59 lines
3.8 KiB
Plaintext
59 lines
3.8 KiB
Plaintext
<%= form_for("",:url => update_exercise_question_exercise_index_path(:exercise_question => exercise_question.id),:remote => true) do |f|%>
|
||
<!--编辑单选start-->
|
||
<script type="text/javascript">
|
||
function resetQuestion<%=exercise_question.id%>()
|
||
{
|
||
$("#poll_questions_title_<%=exercise_question.id%>").val("<%= exercise_question.question_title%>")
|
||
$("#poll_question_score_<%=exercise_question.id %>").val("<%= exercise_question.question_score%>")
|
||
$("#poll_answers_<%=exercise_question.id%>").html("<% exercise_question.exercise_standard_answers.reorder("created_at").each_with_index do |exercise_choice,index| %>" +
|
||
"<li class='ur_item'>" +
|
||
"<label name='candiate_items'>候选答案<%=convert_to_chi_num(index+1) %><span class='ur_index'></span>: </label>" +
|
||
"<input class='candiate_answer' name='exercise_choice[<%=exercise_choice.id %>]' placeholder='请输入候选答案' type='text' value='<%=exercise_choice.answer_text %>'/>" +
|
||
|
||
"<a class='icon_add' title='向下插入选项' onclick='add_candidate_answer($(this));'></a>" +
|
||
"<a class='icon_remove' title='删除' onclick='remove_single_answer($(this))'></a>" +
|
||
"</li>" +
|
||
"<div class='cl'></div>" +
|
||
"<% end%>");
|
||
}
|
||
</script>
|
||
|
||
<div class="questionContainer" style="width: 680px;">
|
||
<div class="ur_editor_title">
|
||
<label>问题: </label>
|
||
<input name="question_type" value="<%=exercise_question.question_type %>" type="hidden">
|
||
<input name="question_title" id="poll_questions_title_<%=exercise_question.id %>" class="questionTitle" placeholder="请输入填空题的内容(注意:目前填空题暂时仅支持一个空)" type="text" value="<%=exercise_question.question_title %>">
|
||
</div>
|
||
<div class="ur_editor_content" id="edit_single">
|
||
<ul>
|
||
<li class="ur_item">
|
||
<label>分数<span class="ur_index"></span>: </label>
|
||
<input type="text" id="poll_question_score_<%=exercise_question.id %>" name="question_score" style="width:40px; text-align:center; padding-left:0px;" value="<%= exercise_question.question_score %>">分
|
||
</li>
|
||
<div class="cl"></div>
|
||
<div id="poll_answers_<%=exercise_question.id%>">
|
||
<% exercise_question.exercise_standard_answers.reorder("created_at").each_with_index do |exercise_choice,index| %>
|
||
<li class="ur_item">
|
||
<label name='candiate_items'>候选答案<%=convert_to_chi_num(index+1) %><span class="ur_index"></span>: </label>
|
||
<input class="candiate_answer" name="exercise_choice[<%=exercise_choice.id %>]" placeholder="请输入候选答案" type="text" value="<%=exercise_choice.answer_text %>"/>
|
||
<a class="icon_add" title="向下插入选项" onclick="add_candidate_answer($(this));"></a>
|
||
<a class="icon_remove" title="删除" onclick="remove_single_answer($(this));"></a>
|
||
</li>
|
||
<div class="cl"></div>
|
||
<% end %>
|
||
</div>
|
||
<div class="cl"></div>
|
||
</ul>
|
||
</div>
|
||
<div class="ur_editor_footer">
|
||
<a class="btn btn_dark btn_submit c_white" data-button="ok" onclick="edit_poll_question($(this),<%= exercise_question.id %>,3);">
|
||
保存
|
||
</a>
|
||
<a class="btn btn_light btn_cancel" data-button="cancel" onclick="resetQuestion<%=exercise_question.id%>();pollQuestionCancel(<%= exercise_question.id%>);">
|
||
<%= l(:button_cancel)%>
|
||
</a>
|
||
</div>
|
||
<div class="cl"></div>
|
||
</div>
|
||
<!--编辑单选 end-->
|
||
<% end%> |