socialforge/app/views/exercise/_edit_single.html.erb

63 lines
4.3 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<%= 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 new_answer'>" +
"<label name='candiate_items'>参考答案<%=convert_to_chi_num(index+1) %><span class='ur_index'></span>&nbsp;&nbsp;&nbsp;</label>" +
"<input class='candiate_answer w560' name='exercise_choice[<%=exercise_choice.id %>]' placeholder='请输入参考答案' type='text' value='<%=exercise_choice.answer_text %>'/>" +
"<a class='icon_remove' title='删除' onclick='remove_single_answer($(this))'></a>" +
"</li>" +
"<div class='cl'></div>" +
"<% end%>" +
"<li class='ur_item'>" +
"<div class='dash-block new-question w560' style='margin-left: 82px;' onclick='add_candidate_answer($(this));'>新建参考答案</div>" +
"</li>" +
"<div class='cl'></div>");
}
</script>
<div class="questionContainer" style="width: 680px;">
<div class="mb10 ur_item">
<label class="ml36">分值<span class="ur_index"></span>&nbsp;&nbsp;&nbsp;</label>
<input id="poll_question_score_<%=exercise_question.id %>" value="<%=exercise_question.question_score %>" type="text" name="question_score" style="width:60px; text-align:center; padding-left:0px;">分
<div class="cl"></div>
</div>
<div class="ur_editor_title">
<label class="questionLabel mt8 ml36">问题:&nbsp;&nbsp;</label>
<input name="question_type" value="<%=exercise_question.question_type %>" type="hidden">
<textarea name="question_title" style="width: 590px;" 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>
</div>
<div class="ur_editor_content" id="edit_single">
<ul>
<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 new_answer">
<label name='candiate_items'>参考答案<%=convert_to_chi_num(index+1) %><span class="ur_index"></span>&nbsp;&nbsp;&nbsp;</label>
<input class="candiate_answer w560" name="exercise_choice[<%=exercise_choice.id %>]" placeholder="请输入参考答案" type="text" value="<%=exercise_choice.answer_text %>"/>
<a class="icon_remove" title="删除" onclick="remove_single_answer($(this));"></a>
</li>
<div class="cl"></div>
<% end %>
<li class="ur_item">
<div class="dash-block new-question w560" style="margin-left: 82px;" onclick="add_candidate_answer($(this));">新建参考答案</div>
</li>
<div class="cl"></div>
</div>
<div class="cl"></div>
</ul>
</div>
<div class="ur_editor_footer">
<span class="fl c_red mt10">温馨提示:[填空题]属于客观题将由系统自动评分,请输入参考答案</span>
<a class="big_blue_btn borderRadius fr" data-button="ok" onclick="edit_poll_question($(this),<%= exercise_question.id %>,3);">保存</a>
<a class="big_grey_btn borderRadius fr mr10" data-button="cancel" onclick="resetQuestion<%=exercise_question.id%>();pollQuestionCancel(<%= exercise_question.id%>);">
<%= l(:button_cancel)%>
</a>
</div>
<div class="cl"></div>
</div>
<!--编辑单选 end-->
<% end%>