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

57 lines
4.2 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-->
<% if false %>
<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>
<% end %>
<div class="user_bg_shadow bor-grey-e pl15 pr30 mb20 fillin_Temp" id="poll_answers_<%= exercise_question.id %>">
<p class="fl mt15 font-16 mb10">填空题</p>
<li class="clearfix pr mb20">
<input name="question_type" value="3" type="hidden">
<label class="panel-form-label fl"><span class="mr10">题目</span></label>
<input name="question_type" value="<%=exercise_question.question_type %>" type="hidden">
<textarea maxlength="250" class="panel-form-width2-690 fl panel-box-sizing questionTitle undis" name="question_title" id="poll_questions_title_<%=exercise_question.id %>"><%=exercise_question.question_title.html_safe %></textarea>
</li>
<% exercise_question.exercise_standard_answers.reorder("created_at").each_with_index do |exercise_choice,index| %>
<li class="clearfix pr mb20">
<label class="panel-form-label fl"><span class="fr mr10 color-grey" name="fill_span">答案 <%=convert_to_chi_num(index+1) %></span></label>
<textarea class="candiate_answer panel-form-width2-690 fl panel-box-sizing" name="exercise_choice[<%=exercise_choice.id %>]" placeholder="请输入参考答案(可选)"><%=exercise_choice.answer_text %></textarea>
<a title="移除" href="javascript:void(0)" class="position-delete option_icon_remove" onclick="removefill(this)"><i class="fa fa-times-circle color-orange font-16 fl"></i></a>
</li>
<div class="cl"></div>
<% end %>
<li class="clearfix mb20">
<label class="panel-form-label fl"><span>&nbsp;</span></label>
<div class="fl panel-box-sizing add-option-input border-dash-orange"><a title="新增" href="javascript:void(0)" class="option_fillin_add" onclick="addfill(this)">新增参考答案</a></div>
</li>
<li class="clearfix mb20">
<label class="panel-form-label fl"><span class="mr10">分值</span></label>
<input id="poll_question_score_<%=exercise_question.id %>" value="<%=exercise_question.question_score %>" type="text" name="question_score" class="with10 mr5 fl pl10 panel-box-sizing task-height-40">
<label class="fl" style="line-height: 40px;">分</label>
<p class="fr">
<span class="font-12 color-grey mb10" style="display: block;">温馨提示:[填空题]属于客观题将由系统自动评分,请设置标准答案</span>
<a href="javascript:void(0)" class="fr task-btn task-btn-orange"onclick="edit_poll_question($(this),<%= exercise_question.id %>,3);">保存</a>
<a href="javascript:void(0)" class="fr task-btn mr10" onclick="$('#edit_poll_questions_<%=exercise_question.id %>').hide();$('#show_poll_questions_<%=exercise_question.id %>').show();">取消</a>
</p>
</li>
</div>
<% end %>