2015-11-26 10:56:24 +08:00
|
|
|
|
<%= form_for(ExerciseQuestion.new,
|
|
|
|
|
:html => { :multipart => true },
|
|
|
|
|
:url=>create_exercise_question_exercise_path(exercise.id),
|
|
|
|
|
:remote=>true ) do |f| %>
|
|
|
|
|
<div class="questionContainer">
|
|
|
|
|
<div class="ur_editor_title">
|
2016-10-25 15:47:26 +08:00
|
|
|
|
<label class="questionLabel mt8">问题: </label>
|
2015-11-26 10:56:24 +08:00
|
|
|
|
<input name="question_type" value="2" type="hidden">
|
2016-10-25 15:47:26 +08:00
|
|
|
|
<textarea name="question_title" id="poll_questions_title" class="questionTitle" placeholder="请输入多选题题目" type="text" oninput="autoHeight('#poll_questions_title',30)"></textarea>
|
2015-11-26 10:56:24 +08:00
|
|
|
|
</div>
|
|
|
|
|
<div class="ur_editor_content">
|
|
|
|
|
<ul>
|
|
|
|
|
<li class="ur_item">
|
|
|
|
|
<% score = exercise.exercise_questions.where("question_type=2").last.nil? ? "": exercise.exercise_questions.where("question_type=2").last.question_score %>
|
|
|
|
|
<label>分数<span class="ur_index"></span>: </label>
|
|
|
|
|
<input id="question_score" value="<%=score %>" type="text" name="question_score" style="width:40px; text-align:center; padding-left:0px;">分
|
|
|
|
|
</li>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
<div>
|
|
|
|
|
<li class="ur_item">
|
2016-07-21 10:20:45 +08:00
|
|
|
|
<label name='select_items' class='w60'>选项A<span class="ur_index"></span>: </label>
|
2015-11-26 10:56:24 +08:00
|
|
|
|
<input maxlength="200" type='text' name='question_answer[0]' placeholder='输入选项内容'>
|
|
|
|
|
<a class="icon_add" title="向下插入选项" onclick="add_single_answer($(this));"></a>
|
|
|
|
|
<a class="icon_remove" title="删除" onclick="remove_single_answer($(this))"></a>
|
|
|
|
|
</li>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
<li class="ur_item">
|
2016-07-21 10:20:45 +08:00
|
|
|
|
<label name='select_items' class='w60'>选项B<span class="ur_index"></span>: </label>
|
2015-11-26 10:56:24 +08:00
|
|
|
|
<input maxlength="200" type='text' name='question_answer[1]' placeholder='输入选项内容'>
|
|
|
|
|
<a class="icon_add" title="向下插入选项" onclick="add_single_answer($(this));"></a>
|
|
|
|
|
<a class="icon_remove" title="删除" onclick="remove_single_answer($(this))"></a>
|
|
|
|
|
</li>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
<li class="ur_item">
|
2016-07-21 10:20:45 +08:00
|
|
|
|
<label name='select_items' class='w60'>选项C<span class="ur_index"></span>: </label>
|
2015-11-26 10:56:24 +08:00
|
|
|
|
<input maxlength="200" type='text' name='question_answer[2]' placeholder='输入选项内容'>
|
|
|
|
|
<a class="icon_add" title="向下插入选项" onclick="add_single_answer($(this));"></a>
|
|
|
|
|
<a class="icon_remove" title="删除" onclick="remove_single_answer($(this))"></a>
|
|
|
|
|
</li>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
<li class="ur_item">
|
2016-07-21 10:20:45 +08:00
|
|
|
|
<label name='select_items' class='w60'>选项D<span class="ur_index"></span>: </label>
|
2015-11-26 10:56:24 +08:00
|
|
|
|
<input maxlength="200" type='text' name='question_answer[3]' placeholder='输入选项内容'>
|
|
|
|
|
<a class="icon_add" title="向下插入选项" onclick="add_single_answer($(this));"></a>
|
|
|
|
|
<a class="icon_remove" title="删除" onclick="remove_single_answer($(this))"></a>
|
|
|
|
|
</li>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="cl"></div>
|
2015-11-26 11:10:17 +08:00
|
|
|
|
<li class="ur_item">
|
|
|
|
|
<label>标准答案<span class="ur_index"></span>: </label>
|
|
|
|
|
<input id="question_standard_ans" name="exercise_choice" placeholder="若标准答案为A,B,C,在答案输入框填入ABC即可" type="text">
|
|
|
|
|
</li>
|
|
|
|
|
<div class="cl"></div>
|
2015-11-26 10:56:24 +08:00
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="ur_editor_footer">
|
2016-05-13 16:50:41 +08:00
|
|
|
|
<a class="btn btn_dark btn_submit c_white" data-button="ok" id="add_new_question"> 保存 </a>
|
2015-11-26 10:56:24 +08:00
|
|
|
|
<a class="btn btn_light btn_cancel" data-button="cancel" onclick="$(this).parent().parent().parent().remove();"> 取消 </a>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
</div>
|
2016-05-13 16:50:41 +08:00
|
|
|
|
<% end %>
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
$(function(){
|
|
|
|
|
$("#add_new_question").one('click', function(){
|
|
|
|
|
add_poll_question($(this),2);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
</script>
|