插入题目菜单显隐控制;多选题答题限制js
This commit is contained in:
parent
c58fb36f44
commit
ae0db01569
|
@ -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>
|
|
@ -27,9 +27,13 @@
|
|||
|
||||
<script>
|
||||
$(".poll-add").mouseover(function(){
|
||||
$(this).children().show();
|
||||
$(this).next().show();
|
||||
}).mouseout(function(){
|
||||
$(this).next().hide();
|
||||
});
|
||||
$(".poll-add").mouseout(function(){
|
||||
$(this).children().hide();
|
||||
$(".poll-add-menu").mouseover(function(){
|
||||
$(this).show();
|
||||
}).mouseout(function(){
|
||||
$(this).hide();
|
||||
});
|
||||
</script>
|
|
@ -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>: </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,17 @@ 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();
|
||||
for(var i = 1; i <= upperLimit; i++){
|
||||
$(".poll-multiple-limit").append("<option>" + i + "</option>");
|
||||
}
|
||||
}
|
||||
|
||||
//其他选项
|
||||
function add_other_answer(doc)
|
||||
{
|
||||
|
@ -489,6 +497,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()
|
||||
{
|
||||
|
|
|
@ -8,13 +8,12 @@
|
|||
</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">
|
||||
<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>
|
||||
</a>
|
||||
<%= 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>
|
||||
|
|
|
@ -8,13 +8,12 @@
|
|||
</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">
|
||||
<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>
|
||||
</a>
|
||||
<%= 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>
|
||||
|
|
|
@ -8,13 +8,12 @@
|
|||
</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">
|
||||
<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>
|
||||
</a>
|
||||
<%= 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>
|
||||
|
@ -27,7 +26,7 @@
|
|||
<a class="poll-edit" title="编辑" onclick="pollQuestionEdit(<%= poll_question.id%>);"></a>
|
||||
<div class="cl"></div>
|
||||
<div class="ur_inputs">
|
||||
<textarea type="text" size="" maxlength="" value="" style="width:640px; border:1px solid #ddd;" rows="3"></textarea>
|
||||
<textarea type="text" size="" maxlength="" value="" style="width:640px; border:1px solid #ddd;" rows="3" readonly="readonly"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div><!--单行文字展示 end-->
|
||||
|
|
|
@ -574,7 +574,7 @@ a:hover.blueCir{ background:#3598db; color:#fff;}
|
|||
.poll-delete:hover{ background:url(/images/course/icons.png) -17px -343px no-repeat;}
|
||||
.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 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-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;}
|
||||
|
||||
/*黄色边框的提示信息 */
|
||||
|
|
Loading…
Reference in New Issue