trustieplus/app/views/exercise/_new_single.html.erb

50 lines
3.3 KiB
Plaintext

<% if exercise.id %>
<div nhname="new_exercise_mc_q">
<%= form_for(ExerciseQuestion.new,
:html => { :multipart => true },
:url=>create_exercise_question_exercise_path(exercise.id),
:remote=>true ) do |f| %>
<div class="user_bg_shadow bor-grey-e pl15 pr30 mb20 fillin_Temp" id="fillin_Temp">
<p class="fl mt15 font-16 mb10">填空题</p>
<li class="clearfix pr mb20">
<input name="question_type" value="3" type="hidden">
<input name="quest_id" id="quest_id" value="0" type="hidden">
<label class="panel-form-label fl"><span class="mr10">题目</span></label>
<textarea id="poll_questions_title" name="question_title" class="panel-form-width2-690 fl panel-box-sizing undis"></textarea>
</li>
<li class="clearfix pr mb20">
<label class="panel-form-label fl"><span class="fr mr10 color-grey" name="fill_span">答案 一</span></label>
<textarea class="panel-form-width2-690 fl panel-box-sizing" name="exercise_choice[0]" placeholder="请输入参考答案"></textarea>
<!--<a title="移除" href="javascript:void(0)" class="position-delete option_icon_remove"><i class="fa fa-times-circle color-orange font-16 fl"></i></a>-->
</li>
<li class="clearfix pr mb20">
<label class="panel-form-label fl"><span class="fr mr10 color-grey" name="fill_span">答案 二</span></label>
<textarea class="panel-form-width2-690 fl panel-box-sizing" name="exercise_choice[1]" placeholder="请输入参考答案(可选)"></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>
<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">
<% score = exercise.exercise_questions.where("question_type=3").last.nil? ? "": exercise.exercise_questions.where("question_type=3").last.question_score %>
<label class="panel-form-label fl"><span class="mr10">分值</span></label>
<input id="question_score" value="<%=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" id="add_new_question">保存</a>
<a href="javascript:void(0)" class="fr task-btn mr10" onclick="$(this).parent().parent().parent().parent().parent().remove();">取消</a>
</p>
</li>
</div>
<% end %>
</div>
<% end %>
<script type="text/javascript">
$(function(){
$("#add_new_question").one('click', function(){
add_ex_question($(this),3);
});
});
</script>