diff --git a/app/views/exercise/_exercise_form.html.erb b/app/views/exercise/_exercise_form.html.erb index ec099cb09..f8fe7896c 100644 --- a/app/views/exercise/_exercise_form.html.erb +++ b/app/views/exercise/_exercise_form.html.erb @@ -87,10 +87,19 @@ var standard_ans = $.trim($("#question_standard_ans").val()); if(title.length == 0 || score.length == 0){ alert("题目标题/分数不能为空"); + doc.one('click', function(){ + add_poll_question($(this),quest_type); + }); }else if(!/^[1-9][0-9]*$/.test(score)) { alert("分数必须是非零开头的数字"); + doc.one('click', function(){ + add_poll_question($(this),quest_type); + }); }else if(quest_type !=3 && standard_ans.length == 0) { alert("标准答案不能为空"); + doc.one('click', function(){ + add_poll_question($(this),quest_type); + }); }else{ doc.parent().parent().parent().submit();} } diff --git a/app/views/exercise/_new_MC.html.erb b/app/views/exercise/_new_MC.html.erb index 6fd6c201e..43628f104 100644 --- a/app/views/exercise/_new_MC.html.erb +++ b/app/views/exercise/_new_MC.html.erb @@ -54,9 +54,16 @@
-<% end %> \ No newline at end of file +<% end %> + \ No newline at end of file diff --git a/app/views/exercise/_new_MCQ.html.erb b/app/views/exercise/_new_MCQ.html.erb index a24835fc1..875b9ec4c 100644 --- a/app/views/exercise/_new_MCQ.html.erb +++ b/app/views/exercise/_new_MCQ.html.erb @@ -54,9 +54,16 @@ -<% end %> \ No newline at end of file +<% end %> + \ No newline at end of file diff --git a/app/views/exercise/_new_single.html.erb b/app/views/exercise/_new_single.html.erb index 6180dac8e..24a0ad047 100644 --- a/app/views/exercise/_new_single.html.erb +++ b/app/views/exercise/_new_single.html.erb @@ -42,9 +42,16 @@ -<% end %> \ No newline at end of file +<% end %> + \ No newline at end of file diff --git a/app/views/exercise/_show_MC.html.erb b/app/views/exercise/_show_MC.html.erb index eef7546e5..99c48a3ab 100644 --- a/app/views/exercise/_show_MC.html.erb +++ b/app/views/exercise/_show_MC.html.erb @@ -90,7 +90,7 @@ ''+ ''+ ' '+ ' '+ ' -<% end%> \ No newline at end of file +<% end%> + \ No newline at end of file diff --git a/app/views/poll/_new_MCQ.html.erb b/app/views/poll/_new_MCQ.html.erb index 43b41f95d..0fbb588c5 100644 --- a/app/views/poll/_new_MCQ.html.erb +++ b/app/views/poll/_new_MCQ.html.erb @@ -3,7 +3,7 @@