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

57 lines
3.3 KiB
Plaintext
Raw Normal View History

2016-03-05 03:16:04 +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:55:48 +08:00
<label class="questionLabel mt8">问题:&nbsp;&nbsp;</label>
2016-03-05 03:16:04 +08:00
<input name="question_type" value="3" type="hidden">
2016-10-25 15:55:48 +08:00
<textarea maxlength="250" class="questionTitle" name="question_title" id="poll_questions_title" placeholder="请输入填空题的内容(注意:目前填空题暂时仅支持一个空)" type="text" oninput="autoHeight('#poll_questions_title',30)"></textarea>
2016-03-05 03:16:04 +08:00
</div>
<div class="ur_editor_content" id="new_single">
<ul>
<li class="ur_item">
<% score = exercise.exercise_questions.where("question_type=3").last.nil? ? "": exercise.exercise_questions.where("question_type=3").last.question_score %>
<label>分数<span class="ur_index"></span>&nbsp;&nbsp;&nbsp;</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">
<label name='candiate_items'>候选答案一<span class="ur_index"></span>&nbsp;&nbsp;&nbsp;</label>
<input class="candiate_answer" name="exercise_choice[0]" placeholder="请输入候选答案" type="text">
<a class="icon_add" title="向下插入选项" onclick="add_candidate_answer($(this));"></a>
<a class="icon_remove" title="删除" onclick="remove_single_answer($(this))"></a>
</li>
<div class="cl"></div>
<li class="ur_item">
<label name='candiate_items'>候选答案二<span class="ur_index"></span>&nbsp;&nbsp;&nbsp;</label>
<input class="candiate_answer" name="exercise_choice[1]" placeholder="请输入候选答案(选填)" type="text">
<a class="icon_add" title="向下插入选项" onclick="add_candidate_answer($(this));"></a>
<a class="icon_remove" title="删除" onclick="remove_single_answer($(this))"></a>
</li>
<div class="cl"></div>
<li class="ur_item">
<label name='candiate_items'>候选答案三<span class="ur_index"></span>&nbsp;&nbsp;&nbsp;</label>
<input class="candiate_answer" name="exercise_choice[2]" placeholder="请输入候选答案(选填)" type="text">
<a class="icon_add" title="向下插入选项" onclick="add_candidate_answer($(this));"></a>
<a class="icon_remove" title="删除" onclick="remove_single_answer($(this))"></a>
</li>
</div>
<div class="cl"></div>
</ul>
</div>
<div class="ur_editor_footer">
<a class="btn btn_dark btn_submit c_white" data-button="ok" id="add_new_question"> 保存 </a>
2016-03-05 03:16:04 +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>
<% end %>
<script type="text/javascript">
$(function(){
$("#add_new_question").one('click', function(){
add_poll_question($(this),3);
});
});
</script>