Merge branch 'cxt_course' of https://git.trustie.net/jacknudt/trustieforge into cxt_course

This commit is contained in:
cxt 2016-10-27 15:12:00 +08:00
commit 26d36358a9
10 changed files with 67 additions and 61 deletions

View File

@ -68,16 +68,5 @@
add_poll_question_new($(this));
});
});
var multiLimit = function(){
var upperLimit = $(".new_answer").size();
for(var i = 1; i <= upperLimit; i++){
$(".poll-multiple-limit").append("<option>" + i + "</option>");
}
}
multiLimit();
$(".new-question").click(function(){
$(".poll-multiple-limit option").remove();
multiLimit();
});
</script>

View File

@ -3,7 +3,7 @@
<div class="ur_editor_title">
<label for="ur_question_title" class="questionLabel mt8">问题:&nbsp;&nbsp;</label>
<input type="hidden" name="question_type" value="3"/>
<textarea maxlength="250" id="poll_questions_title_new" class="questionTitle w590" contenteditable="true" type="text" name="poll_questions_title" placeholder="请输入单行主观题" oninput="autoHeight('#poll_questions_title_new',30)"></textarea>
<textarea maxlength="250" id="poll_questions_title_new" class="questionTitle w590" contenteditable="true" type="text" name="poll_questions_title" placeholder="请输入主观题" oninput="autoHeight('#poll_questions_title_new',30)"></textarea>
<label>
<input name="is_necessary" value="true" checked type="checkbox">
必答

View File

@ -26,10 +26,14 @@
<% end %>
<script>
$(".poll-add").mouseover(function(){
$(this).children().show();
});
$(".poll-add").mouseout(function(){
$(this).children().hide();
});
$(".poll-add").mouseover(function(){
$(this).next().show();
}).mouseout(function(){
$(this).next().hide();
});
$(".poll-add-menu").mouseover(function(){
$(this).show();
}).mouseout(function(){
$(this).hide();
});
</script>

View File

@ -463,6 +463,8 @@ function insert_MCQ(quest_type,quest_num,quest_id){
// doc.parent().before("<li class='ur_item new_answer'><label>选项<span class='ur_index'></span>&nbsp;&nbsp;&nbsp;</label><input maxlength='200' type='text' name='question_answer["+new Date().getTime()+"]' placeholder='输入选项内容'/>" +
// "<a class='icon_remove' title='删除' onclick='remove_single_answer($(this))'></a>"+
// "</li><div class='cl'></div>");
$(".poll-multiple-limit option").remove();
multiLimit();
}
function remove_single_answer(doc)
{
@ -476,11 +478,18 @@ function insert_MCQ(quest_type,quest_num,quest_id){
}
$(".poll-multiple-limit option").remove();
var upperLimit = $(".new_answer").size();
multiLimit();
}
//多选题答题限制数实时更新
function multiLimit(){
var upperLimit = $(".questionContainer .new_answer").size();
$(".poll-multiple-limit").append("<option></option>");
for(var i = 1; i <= upperLimit; i++){
$(".poll-multiple-limit").append("<option>" + i + "</option>");
}
}
//其他选项
function add_other_answer(doc)
{
@ -489,6 +498,9 @@ function insert_MCQ(quest_type,quest_num,quest_id){
"<a class='icon_remove' title='删除' onclick='remove_single_answer($(this))'></a>"+
"</li><div class='cl'></div>");
}
$(".poll-multiple-limit option").remove();
multiLimit();
}
function poll_cancel()
{
@ -549,26 +561,26 @@ function insert_MCQ(quest_type,quest_num,quest_id){
<div class="testQuestion">
<span class="fl mt10 mr18">题型</span>
<ul class="tabs_list fl">
<li class="tab_item02 ">
<li class="tab_item02 mr95">
<a title="<%= l(:label_MC) %>" class="tab_icon icon_radio" onclick="add_MC();">
<%= l(:label_MC) %>
</a>
</li>
<li class="tab_item02 " >
<li class="tab_item02 mr95" >
<a title="<%= l(:label_MCQ) %>" class=" tab_icon icon_checkbox" onclick="add_MCQ();">
<%= l(:label_MCQ) %>
</a>
</li>
<li class="tab_item02 " >
<a title="<%= l(:label_single) %>" class="tab_icon icon_text" onclick="add_single();">
<%= l(:label_single) %>
</a>
</li>
<li class="tab_item02 " >
<a title="<%= l(:label_mulit)%>" class="tab_icon icon_textarea" onclick="add_mulit();">
<%= l(:label_mulit)%>
<a title="<%= l(:label_subjective) %>" class="tab_icon icon_text" onclick="add_single();">
<%= l(:label_subjective) %>
</a>
</li>
<!--<li class="tab_item02 " >-->
<!--<a title="<%#= l(:label_mulit)%>" class="tab_icon icon_textarea" onclick="add_mulit();">-->
<!--<%#= l(:label_mulit)%>-->
<!--</a>-->
<!--</li>-->
</ul>
<div class="cl"></div>
</div><!--选项 end-->

View File

@ -8,23 +8,22 @@
</p>
<a class="poll-up mb8" title="上移"></a>
<a class="poll-down mb8" title="下移"></a>
<a href="javascript:void(0);" class="poll-add pr mb8">
<ul class="poll-add-menu fontGrey3">
<li><a href="javascript:void(0);" onclick=" dismiss('mc',<%=poll_question.id%>);insert_MC('mc',<%=poll_question.question_number%>,<%=poll_question.id%>);">单选题</a></li>
<li><a href="javascript:void(0);" onclick=" dismiss('mc',<%=poll_question.id%>);insert_MCQ('mc',<%=poll_question.question_number%>,<%=poll_question.id%>);">多选题</a></li>
<li><a href="javascript:void(0);" onclick=" dismiss('mc',<%=poll_question.id%>);insert_SINGLE('mc',<%=poll_question.question_number%>,<%=poll_question.id%>);">主观题</a></li>
</ul>
</a>
<a href="javascript:void(0);" class="poll-add mb8"></a>
<ul class="poll-add-menu fontGrey3">
<li><a href="javascript:void(0);" onclick=" dismiss('mc',<%=poll_question.id%>);insert_MC('mc',<%=poll_question.question_number%>,<%=poll_question.id%>);">单选题</a></li>
<li><a href="javascript:void(0);" onclick=" dismiss('mc',<%=poll_question.id%>);insert_MCQ('mc',<%=poll_question.question_number%>,<%=poll_question.id%>);">多选题</a></li>
<li><a href="javascript:void(0);" onclick=" dismiss('mc',<%=poll_question.id%>);insert_SINGLE('mc',<%=poll_question.question_number%>,<%=poll_question.id%>);">主观题</a></li>
</ul>
<%= link_to("", delete_poll_question_poll_index_path(:poll_question => poll_question.id),
method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "poll-delete", :title => "删除") %>
</div>
<div class="poll-content">
<div class="testEditTitle">
<div class="testEditTitle" style="padding-top:0;">
<span class="formatContainer m_w500"><%= poll_question.question_title %></span>
<span class="fontBlue">[单选题]</span>
</div>
<a class="ur_icon_edit" title="编辑" onclick="pollQuestionEdit(<%= poll_question.id%>);"></a>
<a class="poll-edit" title="编辑" onclick="pollQuestionEdit(<%= poll_question.id%>);"></a>
<div class="cl"></div>
<div class="ur_inputs">

View File

@ -8,25 +8,24 @@
</p>
<a class="poll-up mb8" title="上移"></a>
<a class="poll-down mb8" title="下移"></a>
<a href="javascript:void(0);" class="poll-add pr mb8">
<ul class="poll-add-menu fontGrey3">
<li><a href="javascript:void(0);" onclick=" dismiss('mcq',<%=poll_question.id%>);insert_MC('mcq',<%=poll_question.question_number%>,<%=poll_question.id%>);">单选题</a></li>
<li><a href="javascript:void(0);" onclick=" dismiss('mcq',<%=poll_question.id%>);insert_MCQ('mcq',<%=poll_question.question_number%>,<%=poll_question.id%>);">多选题</a></li>
<li><a href="javascript:void(0);" onclick=" dismiss('mcq',<%=poll_question.id%>);insert_SINGLE('mcq',<%=poll_question.question_number%>,<%=poll_question.id%>);">主观题</a></li>
</ul>
</a>
<a href="javascript:void(0);" class="poll-add mb8"> </a>
<ul class="poll-add-menu fontGrey3">
<li><a href="javascript:void(0);" onclick=" dismiss('mcq',<%=poll_question.id%>);insert_MC('mcq',<%=poll_question.question_number%>,<%=poll_question.id%>);">单选题</a></li>
<li><a href="javascript:void(0);" onclick=" dismiss('mcq',<%=poll_question.id%>);insert_MCQ('mcq',<%=poll_question.question_number%>,<%=poll_question.id%>);">多选题</a></li>
<li><a href="javascript:void(0);" onclick=" dismiss('mcq',<%=poll_question.id%>);insert_SINGLE('mcq',<%=poll_question.question_number%>,<%=poll_question.id%>);">主观题</a></li>
</ul>
<%= link_to("", delete_poll_question_poll_index_path(:poll_question => poll_question.id),
method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "poll-delete", :title => "删除") %>
</div>
<div class="poll-content">
<div class="testEditTitle">
<div class="testEditTitle" style="padding-top:0;">
<span class="formatContainer m_w500"><%= poll_question.question_title %></span>
<span class="fontBlue">[多选题]</span>
</div>
<a class="ur_icon_edit" title="编辑" onclick="pollQuestionEdit(<%= poll_question.id%>);"></a>
<a class="poll-edit" title="编辑" onclick="pollQuestionEdit(<%= poll_question.id%>);"></a>
<div class="cl"></div>
<div class="ur_inputs" style="width:675px;">
<table class="ur_table" style="width:675px;">
<div class="ur_inputs">
<table class="ur_table" style="width:647px;">
<tbody>
<% poll_question.poll_answers.reorder("answer_position").each do |poll_answer| %>
<tr>

View File

@ -8,26 +8,25 @@
</p>
<a class="poll-up mb8" title="上移"></a>
<a class="poll-down mb8" title="下移"></a>
<a href="javascript:void(0);" class="poll-add pr mb8">
<ul class="poll-add-menu fontGrey3">
<li><a href="javascript:void(0);" onclick=" dismiss('single',<%=poll_question.id%>);insert_MC('single',<%=poll_question.question_number%>,<%=poll_question.id%>);">单选题</a></li>
<li><a href="javascript:void(0);" onclick=" dismiss('single',<%=poll_question.id%>);insert_MCQ('single',<%=poll_question.question_number%>,<%=poll_question.id%>);">多选题</a></li>
<li><a href="javascript:void(0);" onclick=" dismiss('single',<%=poll_question.id%>);insert_SINGLE('single',<%=poll_question.question_number%>,<%=poll_question.id%>);">主观题</a></li>
</ul>
</a>
<a href="javascript:void(0);" class="poll-add mb8"></a>
<ul class="poll-add-menu fontGrey3">
<li><a href="javascript:void(0);" onclick=" dismiss('single',<%=poll_question.id%>);insert_MC('single',<%=poll_question.question_number%>,<%=poll_question.id%>);">单选题</a></li>
<li><a href="javascript:void(0);" onclick=" dismiss('single',<%=poll_question.id%>);insert_MCQ('single',<%=poll_question.question_number%>,<%=poll_question.id%>);">多选题</a></li>
<li><a href="javascript:void(0);" onclick=" dismiss('single',<%=poll_question.id%>);insert_SINGLE('single',<%=poll_question.question_number%>,<%=poll_question.id%>);">主观题</a></li>
</ul>
<%= link_to("", delete_poll_question_poll_index_path(:poll_question => poll_question.id),
method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "poll-delete", :title => "删除") %>
</div>
<div class="poll-content">
<div class="testEditTitle">
<div class="testEditTitle" style="padding-top:0;">
<span class="formatContainer m_w500"><%= poll_question.question_title %></span>
<span class="fontBlue">[主观题]</span>
</div>
<a class="ur_icon_edit" title="编辑" onclick="pollQuestionEdit(<%= poll_question.id%>);"></a>
<a class="poll-edit" title="编辑" onclick="pollQuestionEdit(<%= poll_question.id%>);"></a>
<div class="cl"></div>
<div class="ur_inputs">
<input class="questionnaire-input" type="text" size="" maxlength="" value="" style="width:692px;">
<textarea type="text" size="" maxlength="" value="" style="width:640px; border:1px solid #ddd;" rows="3" readonly="readonly"></textarea>
</div>
</div>
</div><!--单行文字展示 end-->

View File

@ -2018,6 +2018,7 @@ zh:
label_MCQ: 多选题
label_single: 单行主观
label_mulit: 多行主观
label_subjective: 主观题
label_enter_single_title: 请输入单选题标题
label_new_answer: 新建选项
label_poll_title: 问卷标题

View File

@ -165,7 +165,8 @@ h4{ font-size:14px;}/*color:#3b3b3b;*/
.mr60 {margin-right:60px;}
.mr65 {margin-right:65px;}
.mr70{margin-right: 70px;}
.mr100 {margin-right:100px;}
.mr95 {margin-right:95px !important;}
.mr100 {margin-right:100px !important;}
.mr118 {margin-right:118px !important;}
.mr130 {margin-right:130px;}
.mr150 {margin-right:150px;}

View File

@ -563,7 +563,7 @@ a:hover.blueCir{ background:#3598db; color:#fff;}
/*20161026问卷调查增加toolbar*/
.poll-container {width:718px; border:1px solid #ddd; margin-bottom:10px; background-color:#fff; position:relative; color:#767676; border:1px solid #ddd;}
.pool-tool-bar {width:50px; position:absolute; top:0; left:0; text-align:center;}
.poll-content {margin-left:50px; padding:10px; border-left:1px solid #ddd;}
.poll-content {min-height:150px; margin-left:50px; padding:10px; border-left:1px solid #ddd;}
.poll-up{ background:url(/images/course/icons.png) 0px -479px no-repeat; width:16px; height:20px; display:block; margin-left:auto; margin-right:auto;}
.poll-up:hover{background:url(/images/course/icons.png) -23px -479px no-repeat;}
.poll-down{ background:url(/images/course/icons.png) 0px -502px no-repeat; width:16px; height:20px; display:block; margin-left:auto; margin-right:auto;}
@ -572,7 +572,9 @@ a:hover.blueCir{ background:#3598db; color:#fff;}
.poll-add:hover{background:url(/images/course/icons.png) -18px -317px no-repeat;}
.poll-delete{ background:url(/images/course/icons.png) 3px -343px no-repeat; width:16px; height:20px; display:block; margin-left:auto; margin-right:auto;}
.poll-delete:hover{ background:url(/images/course/icons.png) -17px -343px no-repeat;}
.poll-add-menu {border:1px solid #eaeaea; background:#fff; padding:5px 10px; width:60px; left:0; top:16px; position:absolute; z-index:9999; line-height:2; box-shadow: 0px 2px 8px rgba(146, 153, 169, 0.5); display:none;}
.poll-edit{ background:url(/images/course/icons.png) 0px -272px no-repeat; width:16px; height:27px; display:block;float:right;}
.poll-edit:hover{ background:url(/images/course/icons.png) -21px -272px no-repeat;}
.poll-add-menu {border:1px solid #eaeaea; background:#fff; padding:5px 8px; width:50px; left:15px; top:110px; position:absolute; z-index:9999; line-height:2; box-shadow: 0px 2px 8px rgba(146, 153, 169, 0.5); display:none;}
.poll-multiple-limit {width:70px; outline: none;}
/*黄色边框的提示信息 */