diff --git a/app/views/exercise/_edit_MC.html.erb b/app/views/exercise/_edit_MC.html.erb index 5a406537b..c769fe634 100644 --- a/app/views/exercise/_edit_MC.html.erb +++ b/app/views/exercise/_edit_MC.html.erb @@ -18,7 +18,7 @@ } -
+
diff --git a/app/views/exercise/_edit_MCQ.html.erb b/app/views/exercise/_edit_MCQ.html.erb index bd7270688..01e63cb24 100644 --- a/app/views/exercise/_edit_MCQ.html.erb +++ b/app/views/exercise/_edit_MCQ.html.erb @@ -18,7 +18,7 @@ } -
+
diff --git a/app/views/exercise/_edit_single.html.erb b/app/views/exercise/_edit_single.html.erb index 070e99343..1048b2145 100644 --- a/app/views/exercise/_edit_single.html.erb +++ b/app/views/exercise/_edit_single.html.erb @@ -17,7 +17,7 @@ } -
+
diff --git a/app/views/exercise/_exercise_form.html.erb b/app/views/exercise/_exercise_form.html.erb index 4ac594d76..863f68a72 100644 --- a/app/views/exercise/_exercise_form.html.erb +++ b/app/views/exercise/_exercise_form.html.erb @@ -60,60 +60,74 @@ } function insert_MC(quest_type,quest_num,quest_id){ - $("#insert_new_poll_question_"+quest_type+"_"+quest_id).html( - '<%= form_for(ExerciseQuestion.new, - :html => { :multipart => true }, - :url => {:controller => 'exercise', - :action => 'create_exercise_question', - :course_id => @course.id - },:remote=>true ) do |f|%>'+ - '
'+ - '
'+ - ''+ - ''+ - ''+ - ''+ - ''+ - ''+ - ''+ - '
'+ - '
'+ - '
    '+ - '
  • '+ - ''+ - ''+ - ''+ - ''+ - '
  • '+ - '
    '+ - '
  • '+ - ''+ - ''+ - ''+ - ''+ - '
  • '+ - '
    '+ - '
  • '+ - ''+ - ''+ - ''+ - ''+ - '
  • '+ - '
    '+ - '
'+ - '
'+ - ''+ - '
'+ - '
'+ - '<% end%>' - ); + if($.trim($("#insert_new_poll_question_"+quest_type+"_"+quest_id).html()) == "") { + $("#insert_new_poll_question_"+quest_type+"_"+quest_id).html( + '<%= form_for(ExerciseQuestion.new,:html=>{:multipart=>true},:url=>{:controller=> 'exercise',:action=>'create_exercise_question',:course_id=>@course.id},:remote=>true) do |f|%>'+ + '
'+ + '
'+ + ''+ + ''+ + ''+ + ''+ + ''+ + '
'+ + '
'+ + '
    '+ + '
  • '+ + ''+ + '分'+ + '
  • '+ + '
  • '+ + ''+ + ''+ + ''+ + ''+ + '
  • '+ + '
    '+ + '
  • '+ + ''+ + ''+ + ''+ + ''+ + '
  • '+ + '
    '+ + '
  • '+ + ''+ + ''+ + ''+ + ''+ + '
  • '+ + '
    '+ + '
  • '+ + ''+ + ''+ + ''+ + ''+ + '
  • '+ + '
    '+ + '
  • '+ + ''+ + ''+ + '
  • '+ + '
    '+ + '
'+ + '
'+ + ''+ + '
'+ + '
'+ + '<% end%>' + ); + } + else { + $("#insert_new_poll_question_"+quest_type+"_"+quest_id).html(""); + } $("#poll_questions_title").focus(); } @@ -123,60 +137,73 @@ } function insert_MCQ(quest_type,quest_num,quest_id){ - $("#insert_new_poll_question_"+quest_type+"_"+quest_id).html( - '<%= form_for(ExerciseQuestion.new, - :html => { :multipart => true }, - :url => {:controller => 'exercise', - :action => 'create_exercise_question', - :course_id => @course.id - },:remote=>true ) do |f|%>'+ - '
'+ - '
'+ - ''+ - ''+ - ''+ - ''+ - ''+ - ''+ - ''+ - '
'+ - '
'+ - '
    '+ - '
  • '+ - ''+ - ''+ - ''+ - ''+ - '
  • '+ - '
    '+ - '
  • '+ - ''+ - ''+ - ''+ - ''+ - '
  • '+ - '
    '+ - '
  • '+ - ''+ - ''+ - ''+ - ''+ - '
  • '+ - '
    '+ - '
'+ - '
'+ - ''+ - '
'+ - '
'+ - '<% end%>' - ); + if($.trim($("#insert_new_poll_question_"+quest_type+"_"+quest_id).html()) == ""){ + $("#insert_new_poll_question_"+quest_type+"_"+quest_id).html( + '<%= form_for(ExerciseQuestion.new,:html=>{:multipart=>true},:url=>{:controller=> 'exercise',:action=>'create_exercise_question',:course_id=>@course.id},:remote=>true) do |f|%>'+ + '
'+ + '
'+ + ''+ + ''+ + ''+ + ''+ + ''+ + '
'+ + '
'+ + '
    '+ + '
  • '+ + ''+ + '分'+ + '
  • '+ + '
  • '+ + ''+ + ''+ + ''+ + ''+ + '
  • '+ + '
    '+ + '
  • '+ + ''+ + ''+ + ''+ + ''+ + '
  • '+ + '
    '+ + '
  • '+ + ''+ + ''+ + ''+ + ''+ + '
  • '+ + '
    '+ + '
  • '+ + ''+ + ''+ + ''+ + ''+ + '
  • '+ + '
    '+ + '
  • '+ + ''+ + ''+ + '
  • '+ + '
    '+ + '
'+ + '
'+ + ''+ + '
'+ + '
'+ + '<% end%>' + ); + } else { + $("#insert_new_poll_question_"+quest_type+"_"+quest_id).html(""); + } $("#poll_questions_title").focus(); } @@ -186,35 +213,61 @@ } function insert_SINGLE(quest_type,quest_num,quest_id){ - $("#insert_new_poll_question_"+quest_type+"_"+quest_id).html( - '<%= form_for(ExerciseQuestion.new, - :html => { :multipart => true }, - :url => {:controller => 'exercise', - :action => 'create_exercise_question', - :course_id => @course.id - },:remote=>true ) do |f|%>'+ - '
'+ - '
'+ - ''+ - ''+ - ''+ - ''+ - ''+ - ''+ - ''+ - '
'+ - ''+ - '
'+ - '
'+ - '<% end%>' - ); + if($.trim($("#insert_new_poll_question_"+quest_type+"_"+quest_id).html()) == "") { + $("#insert_new_poll_question_"+quest_type+"_"+quest_id).html( + '<%= form_for(ExerciseQuestion.new,:html=>{:multipart=>true},:url=>{:controller=> 'exercise',:action=>'create_exercise_question',:course_id=>@course.id},:remote=>true) do |f|%>'+ + '
'+ + '
'+ + ''+ + ''+ + ''+ + ''+ + ''+ + '
'+ + '
'+ + '
    '+ + '
  • '+ + ''+ + '分'+ + '
  • '+ + '
  • '+ + ''+ + ''+ + ''+ + ''+ + '
  • '+ + '
    '+ + '
  • '+ + ''+ + ''+ + ''+ + ''+ + '
  • '+ + '
    '+ + '
  • '+ + ''+ + ''+ + ''+ + ''+ + '
  • '+ + '
    '+ + '
'+ + '
'+ + ''+ + '
'+ + '
'+ + '<% end%>' + ); + } else { + $("#insert_new_poll_question_"+quest_type+"_"+quest_id).html(""); + } $("#poll_questions_title").focus(); } @@ -247,13 +300,13 @@ function add_poll_question(doc) { var title = $.trim($("#poll_questions_title").val()); - if(title.length == 0){alert("标题不能为空");}else{doc.parent().parent().parent().submit();} + if(title.length == 0){alert("题目标题不能为空");}else{doc.parent().parent().parent().submit();} } //修改标题时确定按钮 function edit_poll_question(doc,id) { var title = $.trim($("#poll_questions_title_" + id).val()); - if(title.length == 0){alert("标题不能为空");}else{doc.parent().parent().parent().submit();} + if(title.length == 0){alert("题目标题不能为空");}else{doc.parent().parent().parent().submit();} } //问卷头 diff --git a/app/views/exercise/_new_single.html.erb b/app/views/exercise/_new_single.html.erb index 4d9baf729..a8c6f57ea 100644 --- a/app/views/exercise/_new_single.html.erb +++ b/app/views/exercise/_new_single.html.erb @@ -20,17 +20,23 @@
  • -
  • + + +
  • -
  • + + +
  • -
  • + + +
    diff --git a/app/views/exercise/_show_MC.html.erb b/app/views/exercise/_show_MC.html.erb index d44652603..241cc6009 100644 --- a/app/views/exercise/_show_MC.html.erb +++ b/app/views/exercise/_show_MC.html.erb @@ -7,7 +7,7 @@ <%= link_to("", delete_exercise_question_exercise_index_path(:exercise_question => exercise_question.id), method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "ur_icon_de") %> - +
    @@ -28,11 +28,4 @@
    -
    - \ No newline at end of file diff --git a/app/views/exercise/_show_MCQ.html.erb b/app/views/exercise/_show_MCQ.html.erb index db9fa2dd4..7dd52b30a 100644 --- a/app/views/exercise/_show_MCQ.html.erb +++ b/app/views/exercise/_show_MCQ.html.erb @@ -6,7 +6,7 @@ <%= link_to("", delete_exercise_question_exercise_index_path(:exercise_question => exercise_question.id), method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "ur_icon_de") %> - +
    diff --git a/app/views/exercise/_show_single.html.erb b/app/views/exercise/_show_single.html.erb index 591848d76..452a14bc4 100644 --- a/app/views/exercise/_show_single.html.erb +++ b/app/views/exercise/_show_single.html.erb @@ -5,7 +5,7 @@ <%= link_to("", delete_exercise_question_exercise_index_path(:exercise_question => exercise_question.id), method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "ur_icon_de") %> - +
    <% exercise_question.exercise_standard_answers.reorder("created_at").each_with_index do |exercise_choice,index| %> @@ -15,11 +15,4 @@
    -
    - \ No newline at end of file