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

73 lines
4.9 KiB
Plaintext

<% if exercise.id %>
<div nhname="new_exercise_mc_q">
<% eq = ExerciseQuestion.new %>
<%= form_for(eq,
: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 single_Temp" id="single_Temp">
<div class="clearfix">
<p class="fl mt15 font-16 mb10">单选题</p>
<input name="question_type" value="1" type="hidden">
<input name="quest_id" id="quest_id" value="0" type="hidden">
<label class="fr mt15">标准答案:<span class="color-orange current-option">请点击正确选项</span></label>
</div>
<li class="clearfix pr mb20">
<label class="panel-form-label fl"><span class="mr10">题目</span></label>
<!--<textarea name="question_title" id="poll_questions_title" class="panel-form-width2-690 fl panel-box-sizing" placeholder="请输入单选题的题干" type="text" oninput="autoHeight('#poll_questions_title',30)"></textarea>-->
<textarea id="poll_questions_title" name="question_title" class="panel-form-width2-690 fl panel-box-sizing undis"></textarea>
</li>
<input style="display: none;" name="exercise_choice" id="exercise_choice_1"/>
<li class="clearfix pr mb20">
<label class="panel-form-label fl">
<span class="option-item fr mr10 color-grey select-choice" onclick="selectchoice(this)" name="option_span" data-tip-down="点击设置答案">A</span>
</label>
<textarea maxlength="200" name='question_answer[0]' class="panel-form-width2-690 fl panel-box-sizing" placeholder="请输入选项内容"></textarea>
<a title="移除" href="javascript:void(0)" class="position-delete option_icon_remove" onclick="removeSingle(this)"><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="option-item fr mr10 color-grey select-choice " onclick="selectchoice(this)" name="option_span" data-tip-down="点击设置答案">B</span>
</label>
<textarea maxlength="200" name='question_answer[1]' class="panel-form-width2-690 fl panel-box-sizing" placeholder="请输入选项内容"></textarea>
<a title="移除" href="javascript:void(0)" class="position-delete option_icon_remove" onclick="removeSingle(this)"><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="option-item fr mr10 color-grey select-choice" onclick="selectchoice(this)" name="option_span" data-tip-down="点击设置答案">C</span>
</label>
<textarea maxlength="200" name='question_answer[2]' class="panel-form-width2-690 fl panel-box-sizing" placeholder="请输入选项内容"></textarea>
<a title="移除" href="javascript:void(0)" class="position-delete option_icon_remove" onclick="removeSingle(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 class="add-option-item fr mr10 color-grey border-dash-orange" name="option_span">D</span>
</label>
<div class="fl panel-box-sizing add-option-input border-dash-orange">
<a title="新增" href="javascript:void(0)" class="option_icon_add" onclick="addSingle(this)">新增选项</a>
</div>
</li>
<li class="clearfix mb20">
<% score = exercise.exercise_questions.where("question_type=1").last.nil? ? "": exercise.exercise_questions.where("question_type=1").last.question_score %>
<label class="panel-form-label fl"><span class="mr10">分值</span></label>
<input id="question_score" value="<%=score %>" type="text" class="with10 mr5 pl10 fl panel-box-sizing task-height-40" name="question_score" />
<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 class="cl"></div>
</div>
<% end %>
</div>
<% end %>
<script type="text/javascript">
$(function(){
$("#add_new_question").one('click', function(){
add_ex_question($(this),1);
});
});
</script>