diff --git a/app/services/homeworks_service.rb b/app/services/homeworks_service.rb index 487a79bfe..c70535e17 100644 --- a/app/services/homeworks_service.rb +++ b/app/services/homeworks_service.rb @@ -305,13 +305,20 @@ class HomeworksService myshixun_endtime = games.select{|game| game.status == 2}.size == games.size ? games.map(&:end_time).max : nil - if work.work_status == 0 - is_complete = myshixun_endtime && (myshixun_endtime < setting_time.end_time) - if is_complete || (myshixun.created_at < setting_time.end_time && (!homework.allow_late || setting_time.end_time >= Time.now)) - work.work_status = 1 - elsif homework.allow_late && myshixun.created_at < homework.late_time - work.work_status = 2 - end + is_complete = myshixun_endtime && (myshixun_endtime < setting_time.end_time) + + # if work.work_status == 0 + # if is_complete || (myshixun.created_at < setting_time.end_time && (!homework.allow_late || setting_time.end_time >= Time.now)) + # work.work_status = 1 + # elsif homework.allow_late && myshixun.created_at < homework.late_time + # work.work_status = 2 + # end + # end + + if !homework.allow_late || is_complete + work.work_status = 1 + elsif myshixun.created_at < homework.late_time + work.work_status = 2 end if work.work_status != 0 diff --git a/app/views/homework_commons/works_list.json.jbuilder b/app/views/homework_commons/works_list.json.jbuilder index b8fa73b66..74c7f920c 100644 --- a/app/views/homework_commons/works_list.json.jbuilder +++ b/app/views/homework_commons/works_list.json.jbuilder @@ -43,7 +43,8 @@ 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.current_complete_count myshixun.try(:passed_count) if @homework.end_or_late - json.complete_count @work.myshixun&.time_passed_count(@homework.homework_group_setting(@work.user_id)&.end_time) + end_time = @homework.allow_late ? @homework.late_time : @homework.homework_group_setting(@work.user_id)&.end_time + json.complete_count @work.myshixun&.time_passed_count(end_time) json.view_answer_count @work.myshixun.try(:view_answer_count).to_i json.work_status @work.compelete_status else @@ -101,7 +102,8 @@ if @homework.homework_type == "practice" json.cost_time work.myshixun.try(:total_spend_time) json.current_complete_count myshixun.try(:passed_count) if @homework.end_or_late - json.complete_count work.myshixun&.time_passed_count(@homework.homework_group_setting(work.user_id)&.end_time) + end_time = @homework.allow_late ? @homework.late_time : @homework.homework_group_setting(work.user_id)&.end_time + json.complete_count work.myshixun&.time_passed_count(end_time) json.view_answer_count work.myshixun.try(:view_answer_count).to_i json.user_login work.user.try(:login) json.user_name work.user.try(:real_name) diff --git a/lib/tasks/homework_publishtime.rake b/lib/tasks/homework_publishtime.rake index 918e70a70..a57b97eab 100644 --- a/lib/tasks/homework_publishtime.rake +++ b/lib/tasks/homework_publishtime.rake @@ -81,7 +81,7 @@ namespace :homework_publishtime do end end - student_works.joins(:myshixun).where("myshixuns.status != 1").update_all(late_penalty: homework.late_penalty) if student_works.present? + student_works.joins(:myshixun).where("myshixuns.status != 1").update_all(late_penalty: homework.late_penalty, work_status: 2) if student_works.present? else HomeworkEndUpdateScoreJob.perform_later(homework.id) diff --git a/public/react/src/modules/page/VNC.css b/public/react/src/modules/page/VNC.css index 58a45d735..637cc3589 100644 --- a/public/react/src/modules/page/VNC.css +++ b/public/react/src/modules/page/VNC.css @@ -39,6 +39,7 @@ user-select: none; } + .btn_test_case, .btn_test_case_active{ display: inline-block; @@ -80,6 +81,32 @@ bottom: 4px; } +.blacktab_con_abs{ + position: absolute !important; + left: 150px; + right: 150px; + top: 0; + height: 34px; + background: gold; +} +.code_evalute_icon{ + position: absolute; + top: 0; + width: 56px; + height: 28px; + left: 50%; + margin-left: -28px; + background: rgba(42,58,79,1); + z-index: 10; + border-bottom-left-radius: 100px; + border-bottom-right-radius: 100px; + color: #fff; + text-align: center; + cursor: pointer; + opacity: .4; + transition: all .3s; +} + @keyframes mymove { from {right:0px;} diff --git a/public/react/src/modules/page/VNCContainer.js b/public/react/src/modules/page/VNCContainer.js index 30e439e8d..93da489d5 100644 --- a/public/react/src/modules/page/VNCContainer.js +++ b/public/react/src/modules/page/VNCContainer.js @@ -224,6 +224,10 @@ class VNCContainer extends Component { >