2016-03-05 03:16:04 +08:00
|
|
|
|
<%= 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_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">
|
2016-10-25 15:55:48 +08:00
|
|
|
|
<label class="questionLabel mt8">问题: </label>
|
2016-03-05 03:16:04 +08:00
|
|
|
|
<input name="question_type" value="<%=exercise_question.question_type %>" type="hidden">
|
2016-10-25 15:55:48 +08:00
|
|
|
|
<textarea name="question_title" id="poll_questions_title_<%=exercise_question.id %>" class="questionTitle" placeholder="请输入填空题的内容(注意:目前填空题暂时仅支持一个空)" type="text" onfocus="autoHeight('#poll_questions_title_<%=exercise_question.id %>',30)"><%=exercise_question.question_title %></textarea>
|
2016-03-05 03:16:04 +08:00
|
|
|
|
</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-->
|
2015-11-18 20:14:19 +08:00
|
|
|
|
<% end%>
|