{/*{data===undefined?"":""}*/}
@@ -301,10 +329,10 @@ class OfficialAcademicTranscript extends Component {
}
`}
- {datas===undefined?"":
}
From 8e82b4c607f60566d2bb29c51314a36ceea0f70a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com>
Date: Tue, 22 Oct 2019 10:58:52 +0800
Subject: [PATCH 2/6] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=AE=9E=E8=AE=AD?=
=?UTF-8?q?=E4=BD=9C=E5=93=81=E9=A1=B5=E9=9D=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../courses/shixunHomework/Listofworksstudentone.js | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js
index 7f18089ae..9d3d94561 100644
--- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js
+++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js
@@ -987,6 +987,7 @@ class Listofworksstudentone extends Component {
已通过{record.completion}关,共{this.state.challenges_count}关
+ 完成任务评测之前查看了参考答案:{record.view_answer_count}关
}>
{record.user_name}{record.user_login}
+ 完成任务评测之前查看了参考答案:{record.view_answer_count}关
{record.levelscore === "--"?关卡得分:0分 :关卡得分:{record.levelscore}分}
{record.efficiencyscore === "--"?效率评分:0分 :效率评分:{record.efficiencyscore}分}
{record.late_penalty === "--"?迟交扣分:0分 :迟交扣分:{record.late_penalty}分}
@@ -1293,6 +1295,7 @@ class Listofworksstudentone extends Component {
已通过{record.completion}关,共{this.state.challenges_count}关
+ 完成任务评测之前查看了参考答案:{record.view_answer_count}关
}>
{record.completion+"/"+this.state.challenges_count}
@@ -1406,6 +1409,7 @@ class Listofworksstudentone extends Component {
:
{record.user_name}{record.user_login}
+ 完成任务评测之前查看了参考答案:{record.view_answer_count}关
{record.levelscore === "--"?关卡得分:0分 :关卡得分:{record.levelscore}分}
{record.efficiencyscore === "--"?效率评分:0分 :效率评分:{record.efficiencyscore}分}
{record.late_penalty === "--"?迟交扣分:0分 :迟交扣分:{record.late_penalty}分}
@@ -1795,6 +1799,7 @@ class Listofworksstudentone extends Component {
updatetime: timedata === "Invalid date" ? "--" : timedata,
completion: teacherdata.complete_count === null ? "0" :teacherdata.complete_count === undefined ? "0": teacherdata.complete_count,
levelscore: teacherdata.final_score,
+ view_answer_count: teacherdata.view_answer_count,
efficiencyscore: teacherdata.eff_score,
finalscore: teacherdata.work_score,
operating: "查看",
@@ -1838,6 +1843,7 @@ class Listofworksstudentone extends Component {
levelscore: student_works[i].final_score,
efficiencyscore: student_works[i].eff_score==="0.0"?"--":student_works[i].eff_score==="0"?"--":student_works[i].eff_score,
finalscore:student_works[i].work_score,
+ view_answer_count: student_works[i].view_answer_count,
operating: "查看",
late_penalty: student_works[i].late_penalty=== null?"0":student_works[i].late_penalty === undefined?"0":student_works[i].late_penalty,
ultimate_score:student_works[i].ultimate_score,
@@ -1979,6 +1985,7 @@ class Listofworksstudentone extends Component {
completion: teacherdata.complete_count === null ? "0" :teacherdata.complete_count === undefined ? "0": teacherdata.complete_count,
levelscore: teacherdata.final_score,
efficiencyscore: teacherdata.eff_score,
+ view_answer_count: teacherdata.view_answer_count,
finalscore: teacherdata.work_score,
operating: "查看",
late_penalty: teacherdata.late_penalty=== null?"0":teacherdata.late_penalty === undefined?"0":teacherdata.late_penalty,
@@ -2327,6 +2334,7 @@ class Listofworksstudentone extends Component {
levelscore: student_works[i].final_score,
efficiencyscore: student_works[i].eff_score==="0.0"?"--":student_works[i].eff_score==="0"?"--":student_works[i].eff_score,
finalscore: student_works[i].work_score,
+ view_answer_count: student_works[i].view_answer_count,
operating: "查看",
late_penalty: student_works[i].late_penalty=== null?"0":student_works[i].late_penalty === undefined?"0":student_works[i].late_penalty,
ultimate_score:student_works[i].ultimate_score,
From 464adbfdb82848d68416e06584d8fcf64a71bbe3 Mon Sep 17 00:00:00 2001
From: p31729568
Date: Tue, 22 Oct 2019 11:03:09 +0800
Subject: [PATCH 3/6] admin: user statistic add column
---
app/libs/util.rb | 15 +++++++++++++++
app/queries/admins/user_statistic_query.rb | 4 ++++
.../admins/user_statistics/export.xlsx.axlsx | 6 ++++--
.../admins/user_statistics/shared/_list.html.erb | 14 +++++++++-----
4 files changed, 32 insertions(+), 7 deletions(-)
diff --git a/app/libs/util.rb b/app/libs/util.rb
index 84f14a6c0..38b5c9af5 100644
--- a/app/libs/util.rb
+++ b/app/libs/util.rb
@@ -65,4 +65,19 @@ module Util
else "#{str[0..2]}***#{str[-3..-1]}"
end
end
+
+ def display_cost_time(time)
+ time = time.to_i
+ return if time.zero? || time < 60
+
+ day = time / (24 * 60 * 60)
+ hour = (time % (24 * 60 * 60)) / (60 * 60)
+ minute = (time % (60 * 60)) / 60
+
+ str = ''
+ str += "#{day}天" unless day.zero?
+ str += "#{hour}小时" unless hour.zero?
+ str += "#{minute}分" unless minute.zero?
+ str
+ end
end
\ No newline at end of file
diff --git a/app/queries/admins/user_statistic_query.rb b/app/queries/admins/user_statistic_query.rb
index d1811e5ab..d05656b3e 100644
--- a/app/queries/admins/user_statistic_query.rb
+++ b/app/queries/admins/user_statistic_query.rb
@@ -50,6 +50,8 @@ class Admins::UserStatisticQuery < ApplicationQuery
finish_myshixun_map = finish_myshixun.group(:user_id).count
study_challenge_map = study_challenge.group(:user_id).count
finish_challenge_map = finish_challenge.group(:user_id).count
+ evaluate_count_map = study_challenge.group(:user_id).sum(:evaluate_count)
+ cost_time_map = study_challenge.group(:user_id).sum(:cost_time)
users.each do |user|
user._extra_data = {
@@ -57,6 +59,8 @@ class Admins::UserStatisticQuery < ApplicationQuery
finish_shixun_count: finish_myshixun_map.fetch(user.id, 0),
study_challenge_count: study_challenge_map.fetch(user.id, 0),
finish_challenge_count: finish_challenge_map.fetch(user.id, 0),
+ evaluate_count: evaluate_count_map.fetch(user.id, 0),
+ cost_time: cost_time_map.fetch(user.id, 0),
}
end
diff --git a/app/views/admins/user_statistics/export.xlsx.axlsx b/app/views/admins/user_statistics/export.xlsx.axlsx
index b66e62a99..1511b6ea3 100644
--- a/app/views/admins/user_statistics/export.xlsx.axlsx
+++ b/app/views/admins/user_statistics/export.xlsx.axlsx
@@ -1,6 +1,6 @@
wb = xlsx_package.workbook
wb.add_worksheet(name: '用户实训情况') do |sheet|
- sheet.add_row %w(姓名 单位部门 学习关卡数 完成关卡数 学习实训数 完成实训数)
+ sheet.add_row %w(姓名 单位部门 学习关卡数 完成关卡数 学习实训数 完成实训数 评测次数 实战时间)
@users.each do |user|
data = [
@@ -9,7 +9,9 @@ wb.add_worksheet(name: '用户实训情况') do |sheet|
user.display_extra_data(:study_challenge_count),
user.display_extra_data(:finish_challenge_count),
user.display_extra_data(:study_shixun_count),
- user.display_extra_data(:finish_shixun_count)
+ user.display_extra_data(:finish_shixun_count),
+ user.display_extra_data(:evaluate_count),
+ Util.display_cost_time(user.display_extra_data(:cost_time)),
]
sheet.add_row(data)
end
diff --git a/app/views/admins/user_statistics/shared/_list.html.erb b/app/views/admins/user_statistics/shared/_list.html.erb
index 1e1b14ea3..44076812d 100644
--- a/app/views/admins/user_statistics/shared/_list.html.erb
+++ b/app/views/admins/user_statistics/shared/_list.html.erb
@@ -2,11 +2,13 @@
姓名 |
- 单位部门 |
- <%= sort_tag('学习关卡数', name: 'study_challenge_count', path: admins_user_statistics_path) %> |
- <%= sort_tag('完成关卡数', name: 'finish_challenge_count', path: admins_user_statistics_path) %> |
- <%= sort_tag('学习实训数', name: 'study_shixun_count', path: admins_user_statistics_path) %> |
- <%= sort_tag('完成实训数', name: 'finish_shixun_count', path: admins_user_statistics_path) %> |
+ 单位部门 |
+ <%= sort_tag('学习关卡数', name: 'study_challenge_count', path: admins_user_statistics_path) %> |
+ <%= sort_tag('完成关卡数', name: 'finish_challenge_count', path: admins_user_statistics_path) %> |
+ <%= sort_tag('学习实训数', name: 'study_shixun_count', path: admins_user_statistics_path) %> |
+ <%= sort_tag('完成实训数', name: 'finish_shixun_count', path: admins_user_statistics_path) %> |
+ 评测次数 |
+ 实战时间 |
@@ -23,6 +25,8 @@
<%= user.display_extra_data(:finish_challenge_count) %> |
<%= user.display_extra_data(:study_shixun_count) %> |
<%= user.display_extra_data(:finish_shixun_count) %> |
+ <%= user.display_extra_data(:evaluate_count) %> |
+ <%= Util.display_cost_time(user.display_extra_data(:cost_time)) || '--' %> |
<% end %>
<% else %>
From e7c52d8eae8753da6d7b99dcf5f41460749d2dfa Mon Sep 17 00:00:00 2001
From: p31729568
Date: Tue, 22 Oct 2019 11:15:14 +0800
Subject: [PATCH 4/6] modify send message
---
app/controllers/application_controller.rb | 2 ++
1 file changed, 2 insertions(+)
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index df3e9c96e..76ffe23d4 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -112,6 +112,8 @@ class ApplicationController < ActionController::Base
"验证码发送次数超过频率"
when 43
"一天内同一手机号发送次数超过限制"
+ when 53
+ "手机号接收超过频率限制"
end
end
From c26c33990306c562ce1c11023072972480b3d4e2 Mon Sep 17 00:00:00 2001
From: p31729568
Date: Tue, 22 Oct 2019 11:19:57 +0800
Subject: [PATCH 5/6] weapp: fix already login buf
---
app/controllers/weapps/code_sessions_controller.rb | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/app/controllers/weapps/code_sessions_controller.rb b/app/controllers/weapps/code_sessions_controller.rb
index 687605fc4..a99a048e2 100644
--- a/app/controllers/weapps/code_sessions_controller.rb
+++ b/app/controllers/weapps/code_sessions_controller.rb
@@ -1,8 +1,10 @@
class Weapps::CodeSessionsController < Weapps::BaseController
def create
- logged = false
return render_error('code不能为空') if params[:code].blank?
+ reset_session
+ logged = false
+
result = Wechat::Weapp.jscode2session(params[:code])
# 能根据 code 拿到 unionid
From 33407ddacd182932fb4984e890654fdf5871f385 Mon Sep 17 00:00:00 2001
From: p31729568
Date: Tue, 22 Oct 2019 11:35:23 +0800
Subject: [PATCH 6/6] admins: fix bug
---
app/views/admins/myshixuns/shared/_list.html.erb | 8 ++------
.../weapp_adverts/shared/_add_weapp_advert_modal.html.erb | 2 +-
.../shared/_add_weapp_carousel_modal.html.erb | 2 +-
3 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/app/views/admins/myshixuns/shared/_list.html.erb b/app/views/admins/myshixuns/shared/_list.html.erb
index 78e42d58b..89ad535c5 100644
--- a/app/views/admins/myshixuns/shared/_list.html.erb
+++ b/app/views/admins/myshixuns/shared/_list.html.erb
@@ -17,14 +17,10 @@
<% myshixuns.each do |myshixun| %>
<%= myshixun.id %> |
-
+ | <%= myshixun.identifier %> |
+
<% current_task = myshixun.last_executable_task || myshixun.last_task %>
<%= link_to "/myshixuns/#{myshixun.identifier}/stages/#{current_task.identifier}", target: '_blank' do %>
- <%= myshixun.identifier %>
- <% end %>
- |
-
- <%= link_to "/shixuns/#{myshixun.shixun.identifier}", target: '_blank' do %>
<%= overflow_hidden_span myshixun.shixun.name, width: 280 %>
<% end %>
|
diff --git a/app/views/admins/weapp_adverts/shared/_add_weapp_advert_modal.html.erb b/app/views/admins/weapp_adverts/shared/_add_weapp_advert_modal.html.erb
index 9909084b8..3937054b5 100644
--- a/app/views/admins/weapp_adverts/shared/_add_weapp_advert_modal.html.erb
+++ b/app/views/admins/weapp_adverts/shared/_add_weapp_advert_modal.html.erb
@@ -21,7 +21,7 @@
- <%= f.input :link, as: :url, label: '跳转地址', placeholder: '请输入跳转地址' %>
+ <%= f.input :link, label: '跳转地址', placeholder: '请输入跳转地址' %>
<% end %>
diff --git a/app/views/admins/weapp_carousels/shared/_add_weapp_carousel_modal.html.erb b/app/views/admins/weapp_carousels/shared/_add_weapp_carousel_modal.html.erb
index 767ae61ae..123ce4a62 100644
--- a/app/views/admins/weapp_carousels/shared/_add_weapp_carousel_modal.html.erb
+++ b/app/views/admins/weapp_carousels/shared/_add_weapp_carousel_modal.html.erb
@@ -21,7 +21,7 @@
- <%= f.input :link, as: :url, label: '跳转地址', placeholder: '请输入跳转地址' %>
+ <%= f.input :link, label: '跳转地址', placeholder: '请输入跳转地址' %>
<% end %>