diff --git a/app/controllers/homework_commons_controller.rb b/app/controllers/homework_commons_controller.rb index 3b395bab2..06ee8feee 100644 --- a/app/controllers/homework_commons_controller.rb +++ b/app/controllers/homework_commons_controller.rb @@ -113,7 +113,7 @@ class HomeworkCommonsController < ApplicationController if @user_course_identity == Course::STUDENT @work = @homework.user_work(current_user.id) # 学生访问列表时计算个人成绩 - if @homework.homework_type == "practice" + if @homework.homework_type == "practice" && !@homework.end_or_late myshixun = Myshixun.find_by(shixun_id: @shixun.id, user_id: current_user.id) if @work && myshixun challenge_settings = @homework.homework_challenge_settings diff --git a/app/helpers/homework_commons_helper.rb b/app/helpers/homework_commons_helper.rb index a3ed43405..e10917664 100644 --- a/app/helpers/homework_commons_helper.rb +++ b/app/helpers/homework_commons_helper.rb @@ -237,4 +237,9 @@ module HomeworkCommonsHelper def anon_comments user, work_id StudentWorksScore.where(student_work_id: work_id, reviewer_role: 3, user_id: user.id) end + + def student_redo_work work, homework + publish_time = homework.homework_group_setting(work.user_id)&.publish_time + work.myshixun && publish_time && work.myshixun.games.where("status = 2 and answer_open = 1 and end_time <= '#{publish_time}'").count > 0 + end end diff --git a/app/views/courses/online_learning.json.jbuilder b/app/views/courses/online_learning.json.jbuilder index 057ec61cf..b48cd9e23 100644 --- a/app/views/courses/online_learning.json.jbuilder +++ b/app/views/courses/online_learning.json.jbuilder @@ -5,6 +5,7 @@ end # json.description @subject&.description json.start_learning @start_learning +json.subject_id @subject.id json.learned @start_learning ? @course.my_subject_progress : 0 diff --git a/app/views/homework_commons/works_list.json.jbuilder b/app/views/homework_commons/works_list.json.jbuilder index e626cae13..fe05866e6 100644 --- a/app/views/homework_commons/works_list.json.jbuilder +++ b/app/views/homework_commons/works_list.json.jbuilder @@ -31,7 +31,7 @@ elsif @user_course_identity == Course::STUDENT json.left_time left_time @homework, @current_user.id if @homework.homework_type == "practice" - json.(@work, :id, :work_status, :update_time, :ultimate_score) + json.(@work, :id, :work_status, :update_time, :ultimate_score, :myshixun_id) json.calculation_time @work.calculation_time json.late_penalty @work.late_penalty if @homework.allow_late json.cost_time @work.myshixun.try(:total_spend_time) @@ -40,7 +40,7 @@ elsif @user_course_identity == Course::STUDENT json.efficiency work_score_format(@work.efficiency, true, @score_open) json.eff_score work_score_format(@work.eff_score, true, @score_open) json.complete_count @work.myshixun.try(:passed_count) - # json.redo_work student_redo_work(@work) + json.redo_work @homework.end_or_late ? false : student_redo_work(@work, @homework) else json.(@work, :id, :work_status, :update_time, :ultimate_score) diff --git a/public/react/src/modules/tpm/TPMsettings/TPMsettings.js b/public/react/src/modules/tpm/TPMsettings/TPMsettings.js index a46654fe6..f78d62637 100644 --- a/public/react/src/modules/tpm/TPMsettings/TPMsettings.js +++ b/public/react/src/modules/tpm/TPMsettings/TPMsettings.js @@ -2355,10 +2355,10 @@ export default class TPMsettings extends Component { return(
-

+

{item.name} {/*this.Deselectlittle(item.mirror_repository_id)}>*/} -

+