diff --git a/Gemfile.lock b/Gemfile.lock
index 8aa2daa6a..6a4a7e08f 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -378,7 +378,6 @@ DEPENDENCIES
kaminari (~> 1.1, >= 1.1.1)
listen (>= 3.0.5, < 3.2)
mysql2 (>= 0.4.4, < 0.6.0)
- newrelic_rpm
oauth2
pdfkit
puma (~> 3.11)
diff --git a/app/models/homework_common.rb b/app/models/homework_common.rb
index 4c8f94a42..40de5a87c 100644
--- a/app/models/homework_common.rb
+++ b/app/models/homework_common.rb
@@ -134,6 +134,11 @@ class HomeworkCommon < ApplicationRecord
self.homework_type == 'practice' && self.publish_time.present? && self.publish_time < Time.now && self.homework_group_reviews.count == 0
end
+ # 作业查看最新成绩
+ def update_score identity
+ identity < Course::NORMAL && publish_time.present? && publish_time < Time.now && !course.is_end
+ end
+
# 作业能否立即发布
def publish_immediately user
homework_detail_manual.try(:comment_status) == 0 || homework_group_settings.where(course_group_id: course.charge_group_ids(user)).
diff --git a/app/models/poll.rb b/app/models/poll.rb
index 7f0d2fd94..9cb860f61 100644
--- a/app/models/poll.rb
+++ b/app/models/poll.rb
@@ -104,7 +104,7 @@ class Poll < ApplicationRecord
status = 4
else
if user.present? && user.student_of_course?(course)
- ex_time = get_poll_times(user_id,false)
+ ex_time = get_poll_times(user.id,false)
pb_time = ex_time[:publish_time]
ed_time = ex_time[:end_time]
if pb_time.present? && ed_time.present? && pb_time <= Time.now && ed_time > Time.now
diff --git a/app/views/homework_commons/works_list.json.jbuilder b/app/views/homework_commons/works_list.json.jbuilder
index 08c269670..e567ea79a 100644
--- a/app/views/homework_commons/works_list.json.jbuilder
+++ b/app/views/homework_commons/works_list.json.jbuilder
@@ -4,6 +4,7 @@ json.partial! "homework_btn_check", locals: {identity: @user_course_identity, ho
json.partial! "student_btn_check", locals: {identity: @user_course_identity, homework: @homework, work: @work}
+json.update_score @homework.update_score(@user_course_identity) if @homework.homework_type == "practice"
json.work_count @work_count
json.all_member_count @all_member_count
json.course_group_count @course.course_groups_count
diff --git a/app/views/users/_user.json.jbuilder b/app/views/users/_user.json.jbuilder
index 581072072..4fb05b7ba 100644
--- a/app/views/users/_user.json.jbuilder
+++ b/app/views/users/_user.json.jbuilder
@@ -4,5 +4,5 @@ json.name user.full_name
json.grade user.grade
json.identity user&.user_extension&.identity
# json.email user.mail # 邮箱原则上不暴露的,如果实在需要的话只能对某些具体的接口公开
-json.image_url url_to_avatar(user)
+json.image_url image_tag(url_to_avatar(user))
json.school user.school_name
\ No newline at end of file
diff --git a/app/views/users/homepage_info.json.jbuilder b/app/views/users/homepage_info.json.jbuilder
index 112bd215c..78e0e1d7b 100644
--- a/app/views/users/homepage_info.json.jbuilder
+++ b/app/views/users/homepage_info.json.jbuilder
@@ -1,6 +1,6 @@
json.id @user.id
json.name @user.full_name
-json.avatar_url url_to_avatar(@user)
+json.avatar_url image_tag("/" + url_to_avatar(@user))
json.is_logged_user @user.logged_user?
json.experience @user.experience
json.grade @user.grade
diff --git a/public/react/src/modules/courses/busyWork/NewWorkForm.js b/public/react/src/modules/courses/busyWork/NewWorkForm.js
index 27413ba04..bc74576d3 100644
--- a/public/react/src/modules/courses/busyWork/NewWorkForm.js
+++ b/public/react/src/modules/courses/busyWork/NewWorkForm.js
@@ -479,7 +479,7 @@ class NewWorkForm extends Component{