统一在线测验新建单选选项时,样式出现的bug
This commit is contained in:
parent
b7cf7a2468
commit
7c2495c8a1
|
@ -8,7 +8,7 @@
|
||||||
$("#poll_question_standard_answer_<%=exercise_question.id %>").val("<%= convert_to_char(exercise_question.exercise_standard_answers.first.exercise_choice_id.to_s)%>")
|
$("#poll_question_standard_answer_<%=exercise_question.id %>").val("<%= convert_to_char(exercise_question.exercise_standard_answers.first.exercise_choice_id.to_s)%>")
|
||||||
$("#poll_answers_<%=exercise_question.id%>").html("<% exercise_question.exercise_choices.reorder("choice_position").each_with_index do |exercise_choice,index| %>" +
|
$("#poll_answers_<%=exercise_question.id%>").html("<% exercise_question.exercise_choices.reorder("choice_position").each_with_index do |exercise_choice,index| %>" +
|
||||||
"<li class='ur_item'>" +
|
"<li class='ur_item'>" +
|
||||||
"<label name='select_items' class='w56'>选项<%=convert_to_char (index+1).to_s %><span class='ur_index'></span>: </label>" +
|
"<label name='select_items' class='w60'>选项<%=convert_to_char (index+1).to_s %><span class='ur_index'></span>: </label>" +
|
||||||
"<input maxlength='200' type='text' name='question_answer[<%=exercise_choice.id %>]' placeholder='输入选项内容' value='<%=exercise_choice.choice_text %>'/>" +
|
"<input maxlength='200' type='text' name='question_answer[<%=exercise_choice.id %>]' placeholder='输入选项内容' value='<%=exercise_choice.choice_text %>'/>" +
|
||||||
"<a class='icon_add' title='向下插入选项' onclick='add_single_answer($(this));'></a>" +
|
"<a class='icon_add' title='向下插入选项' onclick='add_single_answer($(this));'></a>" +
|
||||||
"<a class='icon_remove' title='删除' onclick='remove_single_answer($(this))'></a>" +
|
"<a class='icon_remove' title='删除' onclick='remove_single_answer($(this))'></a>" +
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
$("#poll_question_standard_answer_<%=exercise_question.id %>").val("<%= convert_to_char(exercise_question.exercise_standard_answers.first.exercise_choice_id.to_s)%>")
|
$("#poll_question_standard_answer_<%=exercise_question.id %>").val("<%= convert_to_char(exercise_question.exercise_standard_answers.first.exercise_choice_id.to_s)%>")
|
||||||
$("#poll_answers_<%=exercise_question.id%>").html("<% exercise_question.exercise_choices.reorder("choice_position").each_with_index do |exercise_choice,index| %>" +
|
$("#poll_answers_<%=exercise_question.id%>").html("<% exercise_question.exercise_choices.reorder("choice_position").each_with_index do |exercise_choice,index| %>" +
|
||||||
"<li class='ur_item'>" +
|
"<li class='ur_item'>" +
|
||||||
"<label name='select_items' class='w56'>选项<%=convert_to_char (index+1).to_s %><span class='ur_index'></span>: </label>" +
|
"<label name='select_items' class='w60'>选项<%=convert_to_char (index+1).to_s %><span class='ur_index'></span>: </label>" +
|
||||||
"<input maxlength='200' type='text' name='question_answer[<%= exercise_choice.id %>]' placeholder='输入选项内容' value='<%=exercise_choice.choice_text %>'/>" +
|
"<input maxlength='200' type='text' name='question_answer[<%= exercise_choice.id %>]' placeholder='输入选项内容' value='<%=exercise_choice.choice_text %>'/>" +
|
||||||
"<a class='icon_add' title='向下插入选项' onclick='add_single_answer($(this));'></a>" +
|
"<a class='icon_add' title='向下插入选项' onclick='add_single_answer($(this));'></a>" +
|
||||||
"<a class='icon_remove' title='删除' onclick='remove_single_answer($(this))'></a>" +
|
"<a class='icon_remove' title='删除' onclick='remove_single_answer($(this))'></a>" +
|
||||||
|
@ -34,7 +34,7 @@
|
||||||
<div id="poll_answers_<%=exercise_question.id%>">
|
<div id="poll_answers_<%=exercise_question.id%>">
|
||||||
<% exercise_question.exercise_choices.reorder("choice_position").each_with_index do |exercise_choice,index| %>
|
<% exercise_question.exercise_choices.reorder("choice_position").each_with_index do |exercise_choice,index| %>
|
||||||
<li class="ur_item">
|
<li class="ur_item">
|
||||||
<label name='select_items' class='w56'>选项<%=convert_to_char (index+1).to_s %><span class="ur_index"></span>: </label>
|
<label name='select_items' class='w60'>选项<%=convert_to_char (index+1).to_s %><span class="ur_index"></span>: </label>
|
||||||
<input maxlength="200" type='text' name='question_answer[<%= exercise_choice.id %>]' placeholder='输入选项内容' value="<%=exercise_choice.choice_text %>">
|
<input maxlength="200" type='text' name='question_answer[<%= exercise_choice.id %>]' placeholder='输入选项内容' value="<%=exercise_choice.choice_text %>">
|
||||||
<a class="icon_add" title="向下插入选项" onclick="add_single_answer($(this));"></a>
|
<a class="icon_add" title="向下插入选项" onclick="add_single_answer($(this));"></a>
|
||||||
<a class="icon_remove" title="删除" onclick="remove_single_answer($(this))"></a>
|
<a class="icon_remove" title="删除" onclick="remove_single_answer($(this))"></a>
|
||||||
|
|
|
@ -171,7 +171,7 @@
|
||||||
//单选题
|
//单选题
|
||||||
function add_single_answer(doc)
|
function add_single_answer(doc)
|
||||||
{
|
{
|
||||||
var li = doc.parent().after("<li class='ur_item'><label name='select_items' class='w56'>选项 <span class='ur_index'></span>: </label><input maxlength='200' type='text' name='question_answer["+new Date().getTime()+"]' placeholder='输入选项内容'/>" +
|
var li = doc.parent().after("<li class='ur_item'><label name='select_items' class='w60'>选项 <span class='ur_index'></span>: </label><input maxlength='200' type='text' name='question_answer["+new Date().getTime()+"]' placeholder='输入选项内容'/>" +
|
||||||
"<a class='icon_add' title='向下插入选项' onclick='add_single_answer($(this));'></a><a class='icon_remove' title='删除' onclick='remove_single_answer($(this))'></a>"+
|
"<a class='icon_add' title='向下插入选项' onclick='add_single_answer($(this));'></a><a class='icon_remove' title='删除' onclick='remove_single_answer($(this))'></a>"+
|
||||||
"</li><div class='cl'></div>");
|
"</li><div class='cl'></div>");
|
||||||
var select_items =$("label[name='select_items']",li.parent());
|
var select_items =$("label[name='select_items']",li.parent());
|
||||||
|
|
|
@ -18,28 +18,28 @@
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<div>
|
<div>
|
||||||
<li class="ur_item">
|
<li class="ur_item">
|
||||||
<label name='select_items' class='w56'>选项A<span class="ur_index"></span>: </label>
|
<label name='select_items' class='w60'>选项A<span class="ur_index"></span>: </label>
|
||||||
<input maxlength="200" type='text' name='question_answer[0]' placeholder='输入选项内容'>
|
<input maxlength="200" type='text' name='question_answer[0]' placeholder='输入选项内容'>
|
||||||
<a class="icon_add" title="向下插入选项" onclick="add_single_answer($(this));"></a>
|
<a class="icon_add" title="向下插入选项" onclick="add_single_answer($(this));"></a>
|
||||||
<a class="icon_remove" title="删除" onclick="remove_single_answer($(this))"></a>
|
<a class="icon_remove" title="删除" onclick="remove_single_answer($(this))"></a>
|
||||||
</li>
|
</li>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<li class="ur_item">
|
<li class="ur_item">
|
||||||
<label name='select_items' class='w56'>选项B<span class="ur_index"></span>: </label>
|
<label name='select_items' class='w60'>选项B<span class="ur_index"></span>: </label>
|
||||||
<input maxlength="200" type='text' name='question_answer[1]' placeholder='输入选项内容'>
|
<input maxlength="200" type='text' name='question_answer[1]' placeholder='输入选项内容'>
|
||||||
<a class="icon_add" title="向下插入选项" onclick="add_single_answer($(this));"></a>
|
<a class="icon_add" title="向下插入选项" onclick="add_single_answer($(this));"></a>
|
||||||
<a class="icon_remove" title="删除" onclick="remove_single_answer($(this))"></a>
|
<a class="icon_remove" title="删除" onclick="remove_single_answer($(this))"></a>
|
||||||
</li>
|
</li>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<li class="ur_item">
|
<li class="ur_item">
|
||||||
<label name='select_items' class='w56'>选项C<span class="ur_index"></span>: </label>
|
<label name='select_items' class='w60'>选项C<span class="ur_index"></span>: </label>
|
||||||
<input maxlength="200" type='text' name='question_answer[2]' placeholder='输入选项内容'>
|
<input maxlength="200" type='text' name='question_answer[2]' placeholder='输入选项内容'>
|
||||||
<a class="icon_add" title="向下插入选项" onclick="add_single_answer($(this));"></a>
|
<a class="icon_add" title="向下插入选项" onclick="add_single_answer($(this));"></a>
|
||||||
<a class="icon_remove" title="删除" onclick="remove_single_answer($(this))"></a>
|
<a class="icon_remove" title="删除" onclick="remove_single_answer($(this))"></a>
|
||||||
</li>
|
</li>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<li class="ur_item">
|
<li class="ur_item">
|
||||||
<label name='select_items' class='w56'>选项D<span class="ur_index"></span>: </label>
|
<label name='select_items' class='w60'>选项D<span class="ur_index"></span>: </label>
|
||||||
<input maxlength="200" type='text' name='question_answer[3]' placeholder='输入选项内容'>
|
<input maxlength="200" type='text' name='question_answer[3]' placeholder='输入选项内容'>
|
||||||
<a class="icon_add" title="向下插入选项" onclick="add_single_answer($(this));"></a>
|
<a class="icon_add" title="向下插入选项" onclick="add_single_answer($(this));"></a>
|
||||||
<a class="icon_remove" title="删除" onclick="remove_single_answer($(this))"></a>
|
<a class="icon_remove" title="删除" onclick="remove_single_answer($(this))"></a>
|
||||||
|
|
|
@ -54,28 +54,28 @@
|
||||||
'<input value="<%= score %>" id="question_score" type="text" name="question_score" style="width:40px; text-align:center; padding-left:0px;"/>分'+
|
'<input value="<%= score %>" id="question_score" type="text" name="question_score" style="width:40px; text-align:center; padding-left:0px;"/>分'+
|
||||||
'</li><div>'+
|
'</li><div>'+
|
||||||
'<li class="ur_item">'+
|
'<li class="ur_item">'+
|
||||||
'<label name="select_items" class="w56">选项A<span class="ur_index"></span>: </label>'+
|
'<label name="select_items" class="w60">选项A<span class="ur_index"></span>: </label>'+
|
||||||
'<input maxlength="200" type="text" name="question_answer[0]" placeholder="输入选项内容"/>'+
|
'<input maxlength="200" type="text" name="question_answer[0]" placeholder="输入选项内容"/>'+
|
||||||
'<a class="icon_add" title="向下插入选项" onclick="add_single_answer($(this));"></a>'+
|
'<a class="icon_add" title="向下插入选项" onclick="add_single_answer($(this));"></a>'+
|
||||||
'<a class="icon_remove" title="删除" onclick="remove_single_answer($(this))"></a>'+
|
'<a class="icon_remove" title="删除" onclick="remove_single_answer($(this))"></a>'+
|
||||||
'</li>'+
|
'</li>'+
|
||||||
'<div class="cl"></div>'+
|
'<div class="cl"></div>'+
|
||||||
'<li class="ur_item">'+
|
'<li class="ur_item">'+
|
||||||
'<label name="select_items" class="w56">选项B<span class="ur_index"></span>: </label>'+
|
'<label name="select_items" class="w60">选项B<span class="ur_index"></span>: </label>'+
|
||||||
'<input maxlength="200" type="text" name="question_answer[1]" placeholder="输入选项内容"/>'+
|
'<input maxlength="200" type="text" name="question_answer[1]" placeholder="输入选项内容"/>'+
|
||||||
'<a class="icon_add" title="向下插入选项" onclick="add_single_answer($(this));"></a>'+
|
'<a class="icon_add" title="向下插入选项" onclick="add_single_answer($(this));"></a>'+
|
||||||
'<a class="icon_remove" title="删除" onclick="remove_single_answer($(this))"></a>'+
|
'<a class="icon_remove" title="删除" onclick="remove_single_answer($(this))"></a>'+
|
||||||
'</li>'+
|
'</li>'+
|
||||||
'<div class="cl"></div>'+
|
'<div class="cl"></div>'+
|
||||||
'<li class="ur_item">'+
|
'<li class="ur_item">'+
|
||||||
'<label name="select_items" class="w56">选项C<span class="ur_index"></span>: </label>'+
|
'<label name="select_items" class="w60">选项C<span class="ur_index"></span>: </label>'+
|
||||||
'<input maxlength="200" type="text" name="question_answer[2]" placeholder="输入选项内容"/>'+
|
'<input maxlength="200" type="text" name="question_answer[2]" placeholder="输入选项内容"/>'+
|
||||||
'<a class="icon_add" title="向下插入选项" onclick="add_single_answer($(this));"></a>'+
|
'<a class="icon_add" title="向下插入选项" onclick="add_single_answer($(this));"></a>'+
|
||||||
'<a class="icon_remove" title="删除" onclick="remove_single_answer($(this))"></a>'+
|
'<a class="icon_remove" title="删除" onclick="remove_single_answer($(this))"></a>'+
|
||||||
'</li>'+
|
'</li>'+
|
||||||
'<div class="cl"></div>'+
|
'<div class="cl"></div>'+
|
||||||
'<li class="ur_item">'+
|
'<li class="ur_item">'+
|
||||||
'<label name="select_items" class="w56">选项D<span class="ur_index"></span>: </label>'+
|
'<label name="select_items" class="w60">选项D<span class="ur_index"></span>: </label>'+
|
||||||
'<input maxlength="200" type="text" name="question_answer[3]" placeholder="输入选项内容"/>'+
|
'<input maxlength="200" type="text" name="question_answer[3]" placeholder="输入选项内容"/>'+
|
||||||
'<a class="icon_add" title="向下插入选项" onclick="add_single_answer($(this));"></a>'+
|
'<a class="icon_add" title="向下插入选项" onclick="add_single_answer($(this));"></a>'+
|
||||||
'<a class="icon_remove" title="删除" onclick="remove_single_answer($(this))"></a>'+
|
'<a class="icon_remove" title="删除" onclick="remove_single_answer($(this))"></a>'+
|
||||||
|
|
Loading…
Reference in New Issue