From 7f571787c6a9c816a49f889a3002d783b6010e2f Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Thu, 2 Jan 2020 11:52:29 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E7=9A=84=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/homeworks_service.rb | 21 ++++++++++++------- .../homework_commons/works_list.json.jbuilder | 3 ++- lib/tasks/homework_publishtime.rake | 2 +- 3 files changed, 17 insertions(+), 9 deletions(-) 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..beaf644f7 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 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) From 23f99d307f8b77c06dab195b4bf30ab8476eb966 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Thu, 2 Jan 2020 12:02:25 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E7=BB=93=E6=9D=9F=E5=89=8D=E5=AE=8C?= =?UTF-8?q?=E6=88=90=E5=85=B3=E5=8D=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/shixunHomework/Listofworksstudentone.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js index fee00d4eb..879508ea1 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js @@ -363,7 +363,7 @@ class Listofworksstudentone extends Component { ), }, { - title: '截止前完成关卡', + title: '结束前完成关卡', dataIndex: 'completion', key: 'completion', align: "center", @@ -757,7 +757,7 @@ class Listofworksstudentone extends Component { ), }, { - title: '截止前完成关卡', + title: '结束前完成关卡', dataIndex: 'completion', key: 'completion', align: "center", @@ -1110,7 +1110,7 @@ class Listofworksstudentone extends Component { ), }, { - title: '截止前完成关卡', + title: '结束前完成关卡', dataIndex: 'completion', key: 'completion', align: 'center', @@ -1473,7 +1473,7 @@ class Listofworksstudentone extends Component { ), }, { - title: '截止前完成关卡', + title: '结束前完成关卡', dataIndex: 'completion', key: 'completion', align: 'center', From 7f4989a039cf65a82b13d106acc6759c6ae470fc Mon Sep 17 00:00:00 2001 From: tangjiang <465264938@qq.com> Date: Thu, 2 Jan 2020 12:39:35 +0800 Subject: [PATCH 3/7] update test-code style --- public/react/src/modules/page/VNC.css | 27 +++++++ public/react/src/modules/page/VNCContainer.js | 24 ++++-- .../src/modules/page/main/ActionView.css | 2 + .../src/modules/page/main/CodeEvaluateView.js | 62 ++++++++------- .../page/main/CodeRepositoryViewContainer.js | 76 +++++++++++++------ 5 files changed, 130 insertions(+), 61 deletions(-) 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 { >