pre_develop
daiao 6 years ago
commit d3e61ab869

@ -1,7 +1,10 @@
<%= form_for("",:url => update_exercise_question_exercise_index_path(:exercise_question => exercise_question.id),:html => {:id => "update_exercise_question_#{exercise_question.id}"}) do |f|%> <%= form_for("",:url => update_exercise_question_exercise_index_path(:exercise_question => exercise_question.id),:html => {:id => "update_exercise_question_#{exercise_question.id}"}) do |f|%>
<div class="user_bg_shadow bor-grey-e pl15 pr30 mb20 fillin_Temp" id="poll_answers_<%= exercise_question.id %>"> <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> <p class="fl mt15 font-16 mb10">实训题</p>
<p class="clearfix mb10" style="margin-left: 78px;"><%= exercise_question.shixun.name %></p> <p class="clearfix mb10">
<label class="panel-form-label fl"><span class="mr10">标题</span></label>
<textarea class="panel-form-width2-690 fl panel-box-sizing candiate_answer" name='question_answer[]' id="poll_questions_name_<%=exercise_question.id %>" placeholder="请输入实训标题"><%= exercise_question.shixun.name %></textarea>
</p>
<li class="clearfix pr mb20"> <li class="clearfix pr mb20">
<input name="question_type" value="5" type="hidden"> <input name="question_type" value="5" type="hidden">
<label class="panel-form-label fl"><span class="mr10">要求</span></label> <label class="panel-form-label fl"><span class="mr10">要求</span></label>

@ -106,11 +106,15 @@
//修改标题时确定按钮 //修改标题时确定按钮
function edit_poll_question(doc,id,quest_type) function edit_poll_question(doc,id,quest_type)
{ {
var name = $.trim($("#poll_questions_name_" + id).val());
var title = $.trim($("#poll_questions_title_" + id).val()); var title = $.trim($("#poll_questions_title_" + id).val());
var score = $.trim($("#poll_question_score_"+ id).val()); var score = $.trim($("#poll_question_score_"+ id).val());
var standard_ans = $.trim($("#exercise_choice_" + id).val()); var standard_ans = $.trim($("#exercise_choice_" + id).val());
if(name===""){
notice_box("题目标题");
}
if(title.length == 0 || score.length == 0){ if(title.length == 0 || score.length == 0){
notice_box("题目标题/分数不能为空"); notice_box("要求/分数不能为空");
}else if(!/^[1-9][0-9]*$/.test(score)) { }else if(!/^[1-9][0-9]*$/.test(score)) {
notice_box("分数必须是非零开头的数字"); notice_box("分数必须是非零开头的数字");
}else if(quest_type !=3 && quest_type !=4 && standard_ans.length == 0) { }else if(quest_type !=3 && quest_type !=4 && standard_ans.length == 0) {

Loading…
Cancel
Save