From fbfa0aa113d887ea37304089786d38d0ee645458 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 9 Oct 2017 09:45:48 +0800 Subject: [PATCH 01/23] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E9=A2=98=E5=9C=A8=E6=9C=89=E5=BF=85=E5=A1=AB=E9=A1=B9=E6=9C=AA?= =?UTF-8?q?=E5=A1=AB=E6=97=B6=E8=BF=9B=E8=A1=8C=E4=BF=9D=E5=AD=98=EF=BC=8C?= =?UTF-8?q?=E5=BA=94=E8=AF=A5=E5=AE=9A=E4=BD=8D=E5=88=B0=E6=9C=AA=E5=A1=AB?= =?UTF-8?q?=E9=A1=B9=E5=A4=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/challenges/_single_or_multiple_question.html.erb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/views/challenges/_single_or_multiple_question.html.erb b/app/views/challenges/_single_or_multiple_question.html.erb index e0c883739..e066ccea3 100644 --- a/app/views/challenges/_single_or_multiple_question.html.erb +++ b/app/views/challenges/_single_or_multiple_question.html.erb @@ -349,6 +349,7 @@ var lens = contents.length; for(var i = 0; i < lens; i++){ if($(contents[i]).val().trim() == ""){ + $(contents[i]).focus(); return true; } } @@ -358,6 +359,7 @@ // 判断选择题选择答案的个数 function judge_choice_answer(){ var answer = document.getElementsByName("choice[answer][]"); + var contents = document.getElementsByName("question[cnt][]"); var lens = answer.length; var num = 0; for(var i= 0; i < lens; i++){ @@ -365,6 +367,7 @@ num += 1; } } + $(contents[0]).focus(); return num; } @@ -438,6 +441,7 @@ if(st == "1"){ if(judge_choice_contents()) { error.html("选项内容不能为空").show(); + }else if(choice_num() < 2){ error.html("单选题选项不能少于2个").show(); }else if(judge_choice_answer() == 0){ From 12159940342bb72bda42641a9d082072229c0861 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 9 Oct 2017 11:07:21 +0800 Subject: [PATCH 02/23] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E9=A2=98tpi=E9=A1=B5=E9=9D=A2=E4=B9=9F=E9=9C=80=E8=A6=81?= =?UTF-8?q?=E6=9C=89=E8=AF=84=E6=B5=8B=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/games_controller.rb | 2 +- app/views/games/_game_choose_results.html.erb | 34 ++++++++++++++++++- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb index d8422beaa..ba639a7bf 100644 --- a/app/controllers/games_controller.rb +++ b/app/controllers/games_controller.rb @@ -88,7 +88,7 @@ class GamesController < ApplicationController # @praise 判断是否点赞 # @tread 判断是否踩 # git_repository_url @myshixun, "Myshixun" - # @st 0 实践任务 1 多选任务 2 单选任务 + # @st 0 实践任务 1 选择题任务 def show # 展示全部实训 @is_subject = params[:is_subject] diff --git a/app/views/games/_game_choose_results.html.erb b/app/views/games/_game_choose_results.html.erb index f212f1f3f..3ab0f6e29 100644 --- a/app/views/games/_game_choose_results.html.erb +++ b/app/views/games/_game_choose_results.html.erb @@ -1,7 +1,10 @@
@@ -60,4 +63,33 @@ ++ <%= @game.choose_correct_num %>/<%= game_challenge.challenge_chooses.count %>共有<%= game_challenge.challenge_chooses.count %>题,其中有<%= game_challenge.challenge_chooses.count - @game.choose_correct_num %>题结果不匹配。 +
+ <% else %> ++ <%= game_challenge.challenge_chooses.count %>/<%= game_challenge.challenge_chooses.count %> 全部通过 +
+ <% end %> + <% end %> +创建于<%=time_from_now exercise.created_at %> 更新于<%=time_from_now exercise.updated_at %> - <%= exercise.exercise_users.where("commit_status = 1").count %>已答 - <%= exercise.course.student.count - exercise.exercise_users.where("commit_status = 1").count %>未答 - <%# count = exercise.exercise_users.where("commit_status = 1 and subjective_score = -1").count %> - <%= un_commit_num exercise %>未评 - <%= ex_curr_status[:time] %> - <% if exercise.try(:exercise_status) == 0 && exercise.publish_time %> + <% if exercise.try(:exercise_status) > 1 %> + <% if @is_teacher %> + + <%= link_to exercise.exercise_users.where("commit_status = 1").count, student_exercise_list_exercise_path(exercise, :ex_status => ['1']), :class => "color-orange05 mr3", :target =>"_blank" %> + 已答 + + <%= link_to (exercise.course.student.count - exercise.exercise_users.where("commit_status = 1").count), student_exercise_list_exercise_path(exercise, :ex_status => ['0']), :class => "color-orange05 mr3", :target =>"_blank" %> + 未答 + <%# count = exercise.exercise_users.where("commit_status = 1 and subjective_score = -1").count %> + + <%= link_to un_commit_num(exercise), student_exercise_list_exercise_path(exercise, :ex_comment => ['0']), :class => "color-orange05 mr3", :target =>"_blank" %> + 未评 + <% else %> + + <%= link_to exercise.exercise_users.where("commit_status = 1").count, student_exercise_list_exercise_path(exercise), :class => "color-orange05 mr3", :target =>"_blank" %> + 已答 + + <%= link_to (exercise.course.student.count - exercise.exercise_users.where("commit_status = 1").count), student_exercise_list_exercise_path(exercise), :class => "color-orange05 mr3", :target =>"_blank" %> + 未答 + <% end %> + <% end %> + <% if exercise.try(:exercise_status) == 1 && exercise.publish_time %> 将于 <%= format_time(exercise.publish_time).to_s %> 发布 + <% else %> + <%= ex_curr_status[:time] %> <% end %>
diff --git a/app/views/homework_common/_homework_index_list.html.erb b/app/views/homework_common/_homework_index_list.html.erb index 4013d1c29..4b957b505 100644 --- a/app/views/homework_common/_homework_index_list.html.erb +++ b/app/views/homework_common/_homework_index_list.html.erb @@ -53,10 +53,11 @@ <% end %> <% end %> - <%= homework_curr_status[:time] %> <% if homework_common.homework_detail_manual.try(:comment_status) == 0 && homework_common.publish_time %> 将于 <%= format_time(homework_common.publish_time).to_s %> 发布 - <% end %> + <% else %> + <%= homework_curr_status[:time] %> + <% end %> <% if @is_teacher %> From c69f9c9d9fc603c5762764c6fe32941b7c746458 Mon Sep 17 00:00:00 2001 From: cxt@@ -9,40 +8,28 @@
@@ -9,81 +9,57 @@
<%= @subject.description.blank? ? "暂未填写" : (@subject.description.html_safe) %>+
<%= @subject.learning_notes.blank? ? "暂未填写" : @subject.learning_notes.html_safe %>
教学团队 @@ -176,6 +183,22 @@