From 7cd8a6eeb8eac49100301941d9925390a2bbd375 Mon Sep 17 00:00:00 2001
From: cxt <853663049@qq.com>
Date: Tue, 7 Jan 2020 16:18:39 +0800
Subject: [PATCH 1/4] =?UTF-8?q?=E9=83=A8=E9=97=A8=E7=BB=9F=E8=AE=A1?=
=?UTF-8?q?=E9=A1=B5=E9=9D=A2=E7=9A=84=E8=B6=85=E9=93=BE=E6=8E=A5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/admins/departments/shared/_department_item.html.erb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/views/admins/departments/shared/_department_item.html.erb b/app/views/admins/departments/shared/_department_item.html.erb
index 62f3a81ac..6018686ff 100644
--- a/app/views/admins/departments/shared/_department_item.html.erb
+++ b/app/views/admins/departments/shared/_department_item.html.erb
@@ -17,7 +17,7 @@
<% if department.identifier.present? %>
- <%= link_to department.identifier.to_s, statistics_college_path(department.identifier), target: '_blank' %>
+ <%= link_to department.identifier.to_s, "/colleges/#{department.identifier}/statistics", target: '_blank' %>
<% else %>
--
<% end %>
From b46a84ebf6c09b8b21af44cb7a117f54ab34c95d Mon Sep 17 00:00:00 2001
From: cxt <853663049@qq.com>
Date: Tue, 7 Jan 2020 16:51:48 +0800
Subject: [PATCH 2/4] =?UTF-8?q?=E8=AF=BE=E5=A0=82=E7=BB=9F=E8=AE=A1?=
=?UTF-8?q?=E6=A8=A1=E5=9D=97=E6=8A=A5=E9=94=99?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/courses_controller.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb
index 33c4226c2..a59ecb543 100644
--- a/app/controllers/courses_controller.rb
+++ b/app/controllers/courses_controller.rb
@@ -1554,7 +1554,7 @@ class CoursesController < ApplicationController
end
def course_statistics course, max_exp, limit
- max_rate = max_exp.nil? ? 0 : 20.0 / max_exp
+ max_rate = max_exp.nil? || max_exp == 0 ? 0 : 20.0 / max_exp
sql_select = %Q{ SELECT a.*, (message_num*0.2 + message_reply_num*0.1 + resource_num*0.5 + homework_journal_num*0.1 + graduation_num +
homework_num + exercise_num + poll_num*0.7 + exercise_score * 0.7 + graduation_score * 0.7 + homework_score * 0.7 + exp*#{max_rate})
From 8fa0d0eb7eaad7dffd272bd7fd2485c8834dc61d Mon Sep 17 00:00:00 2001
From: cxt <853663049@qq.com>
Date: Tue, 7 Jan 2020 16:52:44 +0800
Subject: [PATCH 3/4] =?UTF-8?q?=E8=AF=BE=E5=A0=82=E7=BB=9F=E8=AE=A1?=
=?UTF-8?q?=E6=A8=A1=E5=9D=97=E6=8A=A5=E9=94=99?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/courses_controller.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb
index a59ecb543..599a4440c 100644
--- a/app/controllers/courses_controller.rb
+++ b/app/controllers/courses_controller.rb
@@ -1554,7 +1554,7 @@ class CoursesController < ApplicationController
end
def course_statistics course, max_exp, limit
- max_rate = max_exp.nil? || max_exp == 0 ? 0 : 20.0 / max_exp
+ max_rate = max_exp.nil? || max_exp <= 0 ? 0 : 20.0 / max_exp
sql_select = %Q{ SELECT a.*, (message_num*0.2 + message_reply_num*0.1 + resource_num*0.5 + homework_journal_num*0.1 + graduation_num +
homework_num + exercise_num + poll_num*0.7 + exercise_score * 0.7 + graduation_score * 0.7 + homework_score * 0.7 + exp*#{max_rate})
From e884c200eb6d2c2d9a44e397d8a7cb31d445f2e9 Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Tue, 7 Jan 2020 17:07:49 +0800
Subject: [PATCH 4/4] 1
---
app/views/hack_user_lastest_codes/result.json.jbuilder | 1 +
app/views/hack_user_lastest_codes/show.json.jbuilder | 1 +
2 files changed, 2 insertions(+)
diff --git a/app/views/hack_user_lastest_codes/result.json.jbuilder b/app/views/hack_user_lastest_codes/result.json.jbuilder
index d8f010cc3..0ddd28103 100644
--- a/app/views/hack_user_lastest_codes/result.json.jbuilder
+++ b/app/views/hack_user_lastest_codes/result.json.jbuilder
@@ -3,6 +3,7 @@ json.message "评测完成"
json.data do
json.(@result, :id, :status, :error_line, :error_msg,
:input, :output, :execute_time, :execute_memory)
+ json.passed @my_hack.passed
# 提交模式多了一个预计输出
if @mode == "submit"
json.expected_output @result.expected_output
diff --git a/app/views/hack_user_lastest_codes/show.json.jbuilder b/app/views/hack_user_lastest_codes/show.json.jbuilder
index 04b066aa0..4dd023296 100644
--- a/app/views/hack_user_lastest_codes/show.json.jbuilder
+++ b/app/views/hack_user_lastest_codes/show.json.jbuilder
@@ -8,6 +8,7 @@ json.hack do
json.submit_count @hack.submit_num
json.notes @my_hack.notes
json.modify_code @modify
+ json.passed @my_hack.passed
json.comments_count @hack.discusses.count
json.user_praise @hack.praise_treads.select{|pt| pt.user_id == current_user.id}.length > 0
end
|