From b768887e26ad7feedd9bf2c75bf2234db0b3eeba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Fri, 20 Mar 2020 23:57:36 +0800 Subject: [PATCH 01/14] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/user/usersInfo/InfosPath.js | 2 +- public/react/src/modules/user/usersInfo/InfosShixun.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/user/usersInfo/InfosPath.js b/public/react/src/modules/user/usersInfo/InfosPath.js index 2829342e7..6debb0fd9 100644 --- a/public/react/src/modules/user/usersInfo/InfosPath.js +++ b/public/react/src/modules/user/usersInfo/InfosPath.js @@ -289,7 +289,7 @@ class InfosPath extends Component{ lineHeight: "41px", marginTop: "10px", }}> - {category && category == "collect" ?"共收藏":"共参与"}{totalCount}个{category?category=="manage"?"发布":"学习":"实践课程"} + {category && category == "collect" ?"共收藏":"共参与"}{totalCount}个{category && category == "collect"?"":category?category=="manage"?"发布":"学习":"实践课程"} - {category && category == "collect"?"共收藏":"共参与"}{totalCount}个{category?category=="manage"?"发布":"学习":"实训"} + {category && category == "collect"?"共收藏":"共参与"}{totalCount}个{category && category == "collect"?"":category?category=="manage"?"发布":"学习":"实训"} Date: Sat, 21 Mar 2020 00:51:36 +0800 Subject: [PATCH 02/14] =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/courses/coursesDetail/CoursesBanner.js | 2 ++ .../src/modules/courses/coursesHome/CoursesHomeCard.js | 6 +++--- public/react/src/modules/user/usersInfo/InfosCourse.js | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/public/react/src/modules/courses/coursesDetail/CoursesBanner.js b/public/react/src/modules/courses/coursesDetail/CoursesBanner.js index 7e324fadc..180599fa8 100644 --- a/public/react/src/modules/courses/coursesDetail/CoursesBanner.js +++ b/public/react/src/modules/courses/coursesDetail/CoursesBanner.js @@ -617,11 +617,13 @@ class CoursesBanner extends Component {

+

{coursedata.teacher_school}

+ {/*{excellent===false?*/} {/* :*/} diff --git a/public/react/src/modules/courses/coursesHome/CoursesHomeCard.js b/public/react/src/modules/courses/coursesHome/CoursesHomeCard.js index c021c07e7..004781ec0 100644 --- a/public/react/src/modules/courses/coursesHome/CoursesHomeCard.js +++ b/public/react/src/modules/courses/coursesHome/CoursesHomeCard.js @@ -94,12 +94,12 @@ class CoursesHomeCard extends Component{

-
+
{item.teacher_users.length===0?'': - 协作老师: + 协作老师: {item.teacher_users.map((iem,idx)=>{ return( - {iem} + {idx<3?iem:''} ) }) } diff --git a/public/react/src/modules/user/usersInfo/InfosCourse.js b/public/react/src/modules/user/usersInfo/InfosCourse.js index 4913588b2..d2510d8a2 100644 --- a/public/react/src/modules/user/usersInfo/InfosCourse.js +++ b/public/react/src/modules/user/usersInfo/InfosCourse.js @@ -346,9 +346,9 @@ class InfosCourse extends Component{ 用户

{item.teacher && item.teacher.real_name}

{item&&item.school}

-
+
{item.teacher_users.length===0?'': - 协作老师: + 协作老师: {item.teacher_users.map((iem,idx)=>{ return( {iem} From abe56a30366117171980cfbef158d399e0b1ce0d Mon Sep 17 00:00:00 2001 From: dinglink <837816638@qq.com> Date: Sat, 21 Mar 2020 01:23:30 +0800 Subject: [PATCH 03/14] =?UTF-8?q?360=E5=AE=89=E5=85=A8=E6=B5=8F=E8=A7=88?= =?UTF-8?q?=E5=99=A8=E6=A0=B7=E5=BC=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../react/src/modules/courses/coursesHome/CoursesHomeCard.js | 4 ++-- public/react/src/modules/user/usersInfo/InfosCourse.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/public/react/src/modules/courses/coursesHome/CoursesHomeCard.js b/public/react/src/modules/courses/coursesHome/CoursesHomeCard.js index 004781ec0..8eca8b7de 100644 --- a/public/react/src/modules/courses/coursesHome/CoursesHomeCard.js +++ b/public/react/src/modules/courses/coursesHome/CoursesHomeCard.js @@ -94,12 +94,12 @@ class CoursesHomeCard extends Component{

-
+
{item.teacher_users.length===0?'': 协作老师: {item.teacher_users.map((iem,idx)=>{ return( - {idx<3?iem:''} + {idx<3?iem:''} ) }) } diff --git a/public/react/src/modules/user/usersInfo/InfosCourse.js b/public/react/src/modules/user/usersInfo/InfosCourse.js index d2510d8a2..e475907ea 100644 --- a/public/react/src/modules/user/usersInfo/InfosCourse.js +++ b/public/react/src/modules/user/usersInfo/InfosCourse.js @@ -346,7 +346,7 @@ class InfosCourse extends Component{ 用户

{item.teacher && item.teacher.real_name}

{item&&item.school}

-
+
{item.teacher_users.length===0?'': 协作老师: {item.teacher_users.map((iem,idx)=>{ From 646f1b12807ee5c4f7632bf478ee4d2f0a646816 Mon Sep 17 00:00:00 2001 From: anke1460 Date: Sun, 22 Mar 2020 18:04:53 +0800 Subject: [PATCH 04/14] =?UTF-8?q?=E7=BC=A9=E5=B0=91=E5=9C=A8=E7=BA=BF?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E6=97=B6=E9=97=B4=E8=8C=83=E5=9B=B4=EF=BC=8C?= =?UTF-8?q?=E6=8F=90=E9=AB=98=E7=BB=9F=E8=AE=A1=E7=B2=BE=E7=A1=AE=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/libs/user_online.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/libs/user_online.rb b/app/libs/user_online.rb index 8db5754f3..6276b3fd4 100644 --- a/app/libs/user_online.rb +++ b/app/libs/user_online.rb @@ -11,7 +11,7 @@ module UserOnline def set_bit(user_id, flag) if !Rails.cache.data.exists(cache_key) Rails.cache.data.setbit(cache_key, user_id, flag) - Rails.cache.data.expire(cache_key, 20 * 60 + 10) + Rails.cache.data.expire(cache_key, 2 * 60 + 10) else Rails.cache.data.setbit(cache_key, user_id, flag) end @@ -27,11 +27,11 @@ module UserOnline def cache_key if Rails.cache.is_a?(ActiveSupport::Cache::RedisStore) - # 10分钟为一段记录用户在线, 统计范围为20分钟内的线用户 + # 如设置2分钟内即120秒有请求的用户视为在线, 则最大会统计到4分钟内有活动用户 # TODO 更精确时长 begin_hour = Time.now.beginning_of_hour - minutes_piece = (Time.now - begin_hour) / 600 - time = begin_hour.since((minutes_piece.to_i - 1) * 600).strftime("%H-%M") + minutes_piece = (Time.now - begin_hour) / 120 + time = begin_hour.since((minutes_piece.to_i - 1) * 120).strftime("%H-%M") "online_user_#{time}" else raise '请配置config.cache_store = redis_store' From 603b3dd270384018cc93f127ba5153f18dbac4e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 23 Mar 2020 11:51:31 +0800 Subject: [PATCH 05/14] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=9F=8E=E5=B8=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/javascripts/educoder/edu_application.js | 4 ++-- public/react/src/common/components/form/City.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/public/javascripts/educoder/edu_application.js b/public/javascripts/educoder/edu_application.js index d11511c63..e18c15930 100644 --- a/public/javascripts/educoder/edu_application.js +++ b/public/javascripts/educoder/edu_application.js @@ -769,7 +769,7 @@ function showcity(province, cityField) { var cityOptions = new Array("福州","厦门","泉州","漳州","龙岩","南平","宁德","莆田","三明"); break; case "甘肃": - var cityOptions = new Array("兰州","白银","定西","敦煌","甘南","金昌","酒泉","临夏","平凉","天水","武都","武威","西峰","张掖"); + var cityOptions = new Array("兰州","白银","定西","敦煌","甘南","金昌","酒泉","临夏","平凉","天水","陇南","武威","西峰","张掖"); break; case "广西": var cityOptions = new Array("南宁","百色","北海","桂林","防城港","贵港","河池","贺州","柳州","钦州","梧州","玉林"); @@ -1267,7 +1267,7 @@ function opClickString(item) { operationItem = item // setTimeout(function(){ $(item).css('background', '#4CACFF');$(item).html(value); }, 4000) } -// +// // var isOperationSending = false; $(document).bind('ajaxStop', function(event, xhr, settings) { if (settings && settings.url && (settings.url.match(/operation\?/))) { diff --git a/public/react/src/common/components/form/City.js b/public/react/src/common/components/form/City.js index 5ee0c080b..e5346ba3e 100644 --- a/public/react/src/common/components/form/City.js +++ b/public/react/src/common/components/form/City.js @@ -524,8 +524,8 @@ const options = [{ value: '天水', label: '天水' },{ - value: '武都', - label: '武都' + value: '陇南', + label: '陇南' },{ value: '武威', label: '武威' From afb856ee2688c9cb3af0c3e2583ab928545fe701 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Mon, 23 Mar 2020 16:12:31 +0800 Subject: [PATCH 06/14] =?UTF-8?q?=E8=AF=95=E5=8D=B7=E6=88=AA=E6=AD=A2?= =?UTF-8?q?=E6=97=B6=E7=9A=84=E5=BC=82=E6=AD=A5=E4=BB=BB=E5=8A=A1=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/exercises_controller.rb | 4 ++-- app/jobs/end_exercise_calculate_job.rb | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/controllers/exercises_controller.rb b/app/controllers/exercises_controller.rb index d99c59c85..e20a8bd28 100644 --- a/app/controllers/exercises_controller.rb +++ b/app/controllers/exercises_controller.rb @@ -816,7 +816,7 @@ class ExercisesController < ApplicationController ex_user_ids = exercise_users.pluck(:id) - EndExerciseCalculateJob.perform_later(ex_user_ids, exercise, Time.now.to_s, true, 4) + EndExerciseCalculateJob.perform_later(ex_user_ids, exercise.id, Time.now.to_s, true, 4) # exercise_users.each do |user| # if user.commit_status == 0 && user.start_at.present? # objective_score = calculate_student_score(exercise,user.user)[:total_score] @@ -1194,7 +1194,7 @@ class ExercisesController < ApplicationController start_time = Time.current - @exercise.time * 60 ex_user_ids = @exercise_users_list.where("start_at <= '#{Time.at(start_time)}' and commit_status = 0").pluck(:id) if ex_user_ids.size > 0 - EndExerciseCalculateJob.perform_later(ex_user_ids, @exercise, Time.now.to_s, false, 2) + EndExerciseCalculateJob.perform_later(ex_user_ids, @exercise.id, Time.now.to_s, false, 2) end end diff --git a/app/jobs/end_exercise_calculate_job.rb b/app/jobs/end_exercise_calculate_job.rb index 28f1f6901..3354be2d5 100644 --- a/app/jobs/end_exercise_calculate_job.rb +++ b/app/jobs/end_exercise_calculate_job.rb @@ -5,7 +5,9 @@ class EndExerciseCalculateJob < ApplicationJob queue_as :default - def perform(ex_user_ids,exercise,end_time,work_time,commit_method) + def perform(ex_user_ids,exercise_id,end_time,work_time,commit_method) + exercise = Exercise.find_by(id: exercise_id) + return if exercise.blank? exercise_users = ExerciseUser.where(id: ex_user_ids) exercise_users.each do |user| if user.commit_status == 0 && user.start_at.present? From 1ff479e971f908672bcc722fc75465b888551d39 Mon Sep 17 00:00:00 2001 From: anke1460 Date: Mon, 23 Mar 2020 16:19:33 +0800 Subject: [PATCH 07/14] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=AF=BE=E5=A0=82?= =?UTF-8?q?=E8=A7=86=E9=A2=91=E4=B8=8A=E4=BC=A0=E9=80=9A=E7=9F=A5bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/jobs/course_video_uploaded_job.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/jobs/course_video_uploaded_job.rb b/app/jobs/course_video_uploaded_job.rb index 71dfaa600..e14663237 100644 --- a/app/jobs/course_video_uploaded_job.rb +++ b/app/jobs/course_video_uploaded_job.rb @@ -7,7 +7,7 @@ class CourseVideoUploadedJob < ApplicationJob return unless course_ids.present? - course_members = CourseMember.where(course_id: course_ids, role: 'STUDENT').select("user_id, course_id") + course_members = CourseMember.where(course_id: course_ids, role: 'STUDENT').select("id, user_id, course_id") Tiding.bulk_insert do |worker| course_members.find_each do |m| worker.add( From 031d921c648aa39cf881ad37473309925737422f Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Mon, 23 Mar 2020 16:52:41 +0800 Subject: [PATCH 08/14] =?UTF-8?q?=E7=AD=BE=E5=88=B0=E7=9A=84=E6=9C=AA?= =?UTF-8?q?=E5=88=86=E7=8F=AD=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/attendances_controller.rb | 19 ++++++++++--------- .../weapps/attendances_controller.rb | 8 ++++---- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/app/controllers/attendances_controller.rb b/app/controllers/attendances_controller.rb index 633da5d5d..2147d9070 100644 --- a/app/controllers/attendances_controller.rb +++ b/app/controllers/attendances_controller.rb @@ -81,19 +81,20 @@ class AttendancesController < ApplicationController old_group_ids = @attendance.course_attendance_groups.pluck(:course_group_id) unless old_group_ids.include?(0) - all_groups_ids = old_group_ids + params[:group_ids].map(&:to_i) - # 如果新增的的分班加上之前的分班是课堂的全部分班,则只需创建一条记录 - if all_groups_ids.uniq.count == @course.course_groups_count - @attendance.course_attendance_groups.destroy_all - @attendance.course_attendance_groups.create!(course_group_id: 0, course_id: @attendance.course_id) - new_group = true - else - new_group_ids = params[:group_ids] - old_group_ids + # all_groups_ids = old_group_ids + params[:group_ids].map(&:to_i) + # 如果新增的的分班加上之前的分班是课堂的全部分班,则只需创建一条记录(未分班需要区分考虑,不需要这步) + # if all_groups_ids.uniq.count == @course.course_groups_count + # @attendance.course_attendance_groups.destroy_all + # @attendance.course_attendance_groups.create!(course_group_id: 0, course_id: @attendance.course_id) + # new_group = true + # else + new_group = false + new_group_ids = params[:group_ids].map(&:to_i) - old_group_ids new_group_ids.each do |group_id| @attendance.course_attendance_groups.create!(course_group_id: group_id, course_id: @attendance.course_id) new_group = true end - end + # end end diff --git a/app/controllers/weapps/attendances_controller.rb b/app/controllers/weapps/attendances_controller.rb index 90f8c24b6..9ce089ccb 100644 --- a/app/controllers/weapps/attendances_controller.rb +++ b/app/controllers/weapps/attendances_controller.rb @@ -11,15 +11,15 @@ class Weapps::AttendancesController < ApplicationController attendance = @course.course_attendances.create!(create_params.merge(user_id: current_user.id)) group_ids = params[:group_ids] || [] group_ids = group_ids.blank? ? @course.charge_group_ids(current_user) : @course.charge_group_ids(current_user) & params[:group_ids].map(&:to_i) - unless group_ids.blank? || @course.course_groups.where(id: group_ids).count == @course.course_groups.count + if group_ids.blank? || (params[:group_ids].blank? && @course.course_groups.where(id: group_ids).count == @course.course_groups.count) + @course.course_attendance_groups.create!(course_group_id: 0, course_attendance: attendance) + CreateStudentAttendanceRecordJob.perform_now(attendance.id, [0]) + else # group_ids = @course.charge_group_ids(current_user) & params[:group_ids].map(&:to_i) group_ids.each do |group_id| @course.course_attendance_groups.create!(course_group_id: group_id, course_attendance: attendance) end CreateStudentAttendanceRecordJob.perform_now(attendance.id, group_ids) - else - @course.course_attendance_groups.create!(course_group_id: 0, course_attendance: attendance) - CreateStudentAttendanceRecordJob.perform_now(attendance.id, [0]) end render_ok({attendance_id: attendance.id}) end From 97765680b4f08ade017f6db22b1c76dcb0ae29f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Mon, 23 Mar 2020 17:14:51 +0800 Subject: [PATCH 09/14] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/AppConfig.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index 5182cb991..afed0fa9d 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -46,7 +46,7 @@ debugType = "admin"; // 老师 // debugType="teacher"; // 学生 - debugType="student"; +// debugType="student"; From bb885624ee94794f72166ccba4c9704e72eca131 Mon Sep 17 00:00:00 2001 From: dinglink <837816638@qq.com> Date: Mon, 23 Mar 2020 17:35:59 +0800 Subject: [PATCH 10/14] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=AE=9E=E8=AE=AD?= =?UTF-8?q?=E5=88=B7=E6=96=B0=E6=97=A0=E6=95=B0=E6=8D=AE=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/AppConfig.js | 2 +- .../react/src/context/TPIContextProvider.js | 23 +++++++++++++++---- public/react/src/modules/page/LeftNav.js | 2 +- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index 5182cb991..d91c42fcf 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -46,7 +46,7 @@ debugType = "admin"; // 老师 // debugType="teacher"; // 学生 - debugType="student"; + //debugType="student"; diff --git a/public/react/src/context/TPIContextProvider.js b/public/react/src/context/TPIContextProvider.js index bb1e0bef4..fa0cbafcd 100644 --- a/public/react/src/context/TPIContextProvider.js +++ b/public/react/src/context/TPIContextProvider.js @@ -137,6 +137,9 @@ class TPIContextProvider extends Component { this.costTimeInterval && window.clearInterval(this.costTimeInterval) } componentDidMount() { + window.$(window).unload( ()=>{ + console.log(12321) + }); // TODO 登录状态的判断? // request @@ -158,12 +161,24 @@ class TPIContextProvider extends Component { } }, 1000) - // 页面离开时存下用户的任务耗时 + // 页面离开时存下用户的任务耗时 + window.$(window).bind('beforeunload', function (e) { + console.log(111111) + this._updateCostTime(); + }) + + // // 页面离开时存下用户的任务耗时 + // window.$(window).unload( ()=>{ + // this._updateCostTime(); + + // }); - window.$(window).unload( ()=>{ - this._updateCostTime(); - }); } + + + + + // force 评测通过后,异步执行该方法,强制同步costTime到服务端 _updateCostTime(async = false, force) { const { game, loading } = this.state; diff --git a/public/react/src/modules/page/LeftNav.js b/public/react/src/modules/page/LeftNav.js index d1a7b1a11..63628d7ff 100644 --- a/public/react/src/modules/page/LeftNav.js +++ b/public/react/src/modules/page/LeftNav.js @@ -59,7 +59,7 @@ class LeftNav extends Component { From 96928934cf5b6b9cc7fdb0a3f90a27ad4460917a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 23 Mar 2020 17:48:23 +0800 Subject: [PATCH 11/14] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=AF=84=E9=98=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/package.json | 1 + public/react/src/AppConfig.js | 2 +- .../src/modules/courses/busyWork/CommonWorkAppraise.js | 10 ++++++++++ public/react/src/modules/page/layers/ImageLayer.js | 10 +++------- 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/public/react/package.json b/public/react/package.json index e21a44df3..47e7ecddd 100644 --- a/public/react/package.json +++ b/public/react/package.json @@ -91,6 +91,7 @@ "react-router-dom": "^4.2.2", "react-split-pane": "^0.1.89", "react-url-query": "^1.4.0", + "react-zmage": "^0.8.5-beta.31", "redux": "^4.0.0", "redux-thunk": "2.3.0", "rsuite": "^4.0.1", diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index 5182cb991..2d04baa58 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -46,7 +46,7 @@ debugType = "admin"; // 老师 // debugType="teacher"; // 学生 - debugType="student"; +// debugType="student"; diff --git a/public/react/src/modules/courses/busyWork/CommonWorkAppraise.js b/public/react/src/modules/courses/busyWork/CommonWorkAppraise.js index 75fbaaab4..db06f0166 100644 --- a/public/react/src/modules/courses/busyWork/CommonWorkAppraise.js +++ b/public/react/src/modules/courses/busyWork/CommonWorkAppraise.js @@ -107,6 +107,15 @@ class CommonWorkAppraise extends Component{ } gotoget_next_work=(id)=>{ + + if(this.props.match.path===`/classrooms/:coursesId/common_homework/:workId/:studentWorkId/appraise`){ + this.props.history.replace(`/classrooms/${this.props.match.params.coursesId}/common_homeworks/${this.props.match.params.workId}/${id}/appraise`); + } + + if(this.props.match.path===`/classrooms/:coursesId/group_homework/:workId/:studentWorkId/appraise`){ + this.props.history.replace(`/classrooms/${this.props.match.params.coursesId}/common_homeworks/${this.props.match.params.workId}/${id}/appraise`); + } + if(this.props.match.path===`/classrooms/:coursesId/common_homeworks/:workId/:studentWorkId/appraise`){ this.props.history.replace(`/classrooms/${this.props.match.params.coursesId}/common_homeworks/${this.props.match.params.workId}/${id}/appraise`); } @@ -114,6 +123,7 @@ class CommonWorkAppraise extends Component{ if(this.props.match.path===`/classrooms/:coursesId/group_homeworks/:workId/:studentWorkId/appraise`){ this.props.history.replace(`/classrooms/${this.props.match.params.coursesId}/common_homeworks/${this.props.match.params.workId}/${id}/appraise`); } + this.setState({ get_next_worktype:false }) diff --git a/public/react/src/modules/page/layers/ImageLayer.js b/public/react/src/modules/page/layers/ImageLayer.js index b1adc5b6b..af9359fe4 100644 --- a/public/react/src/modules/page/layers/ImageLayer.js +++ b/public/react/src/modules/page/layers/ImageLayer.js @@ -1,22 +1,18 @@ import React, { Component } from 'react'; import ReactDOM from 'react-dom' -import { Redirect } from 'react-router'; - -import PropTypes from 'prop-types'; -import Rate from 'rc-rate'; import './TaskResultLayer.css' class ImageLayer extends Component { - + render() { let { showImage, imageSrc, onImageLayerClose } = this.props; - + // 语法介绍 https://reactjs.org/docs/portals.html // 将html渲染都指定的element下 return ReactDOM.createPortal(
- {showImage ? + {showImage ?
From c36be3f87f192497998f12eef08588da3a8fffcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Mon, 23 Mar 2020 18:25:43 +0800 Subject: [PATCH 12/14] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shixunHomework/Trainingjobsetting.js | 178 +++++++++--------- 1 file changed, 89 insertions(+), 89 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js index e14ad1408..6f41869ef 100644 --- a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js +++ b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js @@ -329,6 +329,7 @@ class Trainingjobsetting extends Component { //跳转道描点的地方 scrollToAnchor = (anchorName) => { + debugger if (anchorName) { // 找到锚点 let anchorElement = document.getElementById(anchorName); @@ -547,8 +548,9 @@ class Trainingjobsetting extends Component { } } else { + //不是统一设置 //分班设置 - // console.log("分班设置"); + console.log("分班设置"); // console.log(this.$pollDetailTabForthRules); const result=this.$pollDetailTabForthRules.notUnifiedSettingCheck(this.state.rules); @@ -561,11 +563,76 @@ class Trainingjobsetting extends Component { return false; } let rulesdata = this.state.rulesdata; + if (rulesdata.length === 0) { this.props.showNotification(`分班发布设置不能为空`); return; } + + + + } + }else{ + // console.log("分班设置"); + var mylate_times=false; + if (this.state.unifiedsetting === false) { + ///非统一设置 + let rulesdata = this.state.rulesdata; + // console.log(rulesdata); + //开启了补交 + if(this.state.allowreplenishment===true){ + //补交结束时间不为空 + if(this.state.late_time){ + // 分班设置数组不为空 + if(rulesdata){ + for(var i=0;i { - if (result.data.status == 0) { - // console.log(JSON.stringify(result)); - this.getTrainingjobsetting(true); - this.props.showNotification(`更新成功`); - this.setState({ - flagPageEditsbox: false, - flagPageEdit: false, - flagPageEditstwo: false, - flagPageEditsthrees: false, - flagPageEditsfor: false, - whethertopay: false, - completionefficiencyscore: false, - }) - this.refs.targetElementTrainingjobsetting.scrollIntoView() + if(result){ + if(result.data){ + if (result.data.status == 0) { + // console.log(JSON.stringify(result)); + this.getTrainingjobsetting(true); + this.props.showNotification(`更新成功`); + this.setState({ + flagPageEditsbox: false, + flagPageEdit: false, + flagPageEditstwo: false, + flagPageEditsthrees: false, + flagPageEditsfor: false, + whethertopay: false, + completionefficiencyscore: false, + }) + this.refs.targetElementTrainingjobsetting.scrollIntoView() + } + } } + }).catch((error) => { console.log(error); }) @@ -2577,7 +2649,7 @@ class Trainingjobsetting extends Component {
{/*补交设置*/} -
+
补交设置
@@ -2660,7 +2732,7 @@ class Trainingjobsetting extends Component {

{ this.state.hand__e_tip && this.state.hand__e_tip != "" ? - {this.state.hand__e_tip} : "" + {this.state.hand__e_tip} : "" }

@@ -2929,75 +3001,3 @@ class Trainingjobsetting extends Component { } export default Trainingjobsetting; -//
-//
-// this.ChangeTab(0)}>作品列表 -// this.ChangeTab(1)}>作业问答 -// {this.props.isAdmin()?this.state.code_review===true||jobsettingsdata === undefined ? [""] : jobsettingsdata.data.homework_status[0]==="未发布"?"": this.ChangeTab(2)}>代码查重 : ""} -// -// this.ChangeTab(3)} -// >设置 -// -// {this.props.isAdmin() ?
  • -// 导出 -// -//
  • : ""} -// {this.props.isAdmin() ?jobsettingsdata&&jobsettingsdata.data.end_immediately===true? -// 立即截止 -// : "": ""} -// {this.props.isAdmin() ?jobsettingsdata&&jobsettingsdata.data.publish_immediately===true? -// 立即发布: "" : ""} -// {this.props.isAdmin()? -// jobsettingsdata&&jobsettingsdata.data.code_review===true? -// 代码查重: "":""} -// { -// jobsettingsdata&& jobsettingsdata&&jobsettingsdata.data === undefined ? "" -// : jobsettingsdata&& jobsettingsdata.data.commit_des === null || jobsettingsdata&& jobsettingsdata.data.commit_des === undefined ? "" : -// { jobsettingsdata&& jobsettingsdata.data.commit_des} -// } -// { jobsettingsdata&&jobsettingsdata.data === undefined ? "" : } -{/*
    */ -} -{/*
    */ -} From 3480de8929cac55f6a4d2c1c49c8553a32153607 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Mon, 23 Mar 2020 18:26:58 +0800 Subject: [PATCH 13/14] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shixunHomework/Trainingjobsetting.js | 40 ++++++++++--------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js index 6f41869ef..64a956d28 100644 --- a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js +++ b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js @@ -329,7 +329,6 @@ class Trainingjobsetting extends Component { //跳转道描点的地方 scrollToAnchor = (anchorName) => { - debugger if (anchorName) { // 找到锚点 let anchorElement = document.getElementById(anchorName); @@ -579,7 +578,6 @@ class Trainingjobsetting extends Component { if (this.state.unifiedsetting === false) { ///非统一设置 let rulesdata = this.state.rulesdata; - // console.log(rulesdata); //开启了补交 if(this.state.allowreplenishment===true){ //补交结束时间不为空 @@ -595,25 +593,29 @@ class Trainingjobsetting extends Component { }catch (e) { } - if(moment(this.state.late_time, "YYYY-MM-DD HH:mm") <= emdtimes){ - this.props.showNotification(`补交结束时间必须晚于截止时间`); - mylate_times=true; - let kus=i+1; - this.setState({ - hand__e_tip: "补交时间必须晚于发布规则" +kus+ "的截止时间", - hand_flags: true, - handclass: "bor-reds", - }); - break; - }else{ - mylate_times=false; - this.setState({ - hand__e_tip: "", - hand_flags: false, - handclass: undefined, - }) + if(emdtimes){ + if(moment(this.state.late_time, "YYYY-MM-DD HH:mm") <= emdtimes){ + mylate_times=true; + let kus=i+1; + this.setState({ + hand__e_tip: "补交时间必须晚于发布规则" +kus+ "的截止时间", + hand_flags: true, + handclass: "bor-reds", + }); + this.props.showNotification(`补交结束时间必须晚于截止时间`); + break; + }else{ + mylate_times=false; + this.setState({ + hand__e_tip: "", + hand_flags: false, + handclass: undefined, + }) + } } + + } } } From 963bb9063c760dd795e82b48d51c3aaad00356bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 23 Mar 2020 20:24:06 +0800 Subject: [PATCH 14/14] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=AF=84=E9=98=85?= =?UTF-8?q?=E6=9F=A5=E7=9C=8B=E5=9B=BE=E7=89=87=E4=BA=A4=E4=BA=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/AppConfig.js | 2 +- public/react/src/common/hooks/ImageLayer2.js | 6 +-- .../src/modules/page/layers/ImageLayer.js | 51 +++++++++++++++++-- .../modules/page/layers/TaskResultLayer.css | 11 +++- 4 files changed, 59 insertions(+), 11 deletions(-) diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index 5182cb991..2d04baa58 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -46,7 +46,7 @@ debugType = "admin"; // 老师 // debugType="teacher"; // 学生 - debugType="student"; +// debugType="student"; diff --git a/public/react/src/common/hooks/ImageLayer2.js b/public/react/src/common/hooks/ImageLayer2.js index 202a7f343..504e491ca 100644 --- a/public/react/src/common/hooks/ImageLayer2.js +++ b/public/react/src/common/hooks/ImageLayer2.js @@ -18,8 +18,8 @@ function ImageLayer2(props) { const fileName = event.target.innerHTML.trim() if (isImageExtension((imageSrc && imageSrc.trim())) || isImageExtension(fileName) || event.target.tagName == 'IMG' || (imageSrc && imageSrc.indexOf('base64,')) != -1) { // 非回复里的头像图片; 非emoticons - if (imageSrc.indexOf('/images/avatars/User') === -1 && - imageSrc.indexOf('kindeditor/plugins/emoticons') === -1 ) { + if (imageSrc.indexOf('/images/avatars/User') === -1 && + imageSrc.indexOf('kindeditor/plugins/emoticons') === -1 ) { setShowImage(true) setImageSrc(imageSrc) } @@ -41,7 +41,7 @@ function ImageLayer2(props) { }) return ( - + showImage?:"" ) } diff --git a/public/react/src/modules/page/layers/ImageLayer.js b/public/react/src/modules/page/layers/ImageLayer.js index af9359fe4..17f40bdf9 100644 --- a/public/react/src/modules/page/layers/ImageLayer.js +++ b/public/react/src/modules/page/layers/ImageLayer.js @@ -1,10 +1,27 @@ import React, { Component } from 'react'; import ReactDOM from 'react-dom' - +import { Button,Icon} from 'antd'; import './TaskResultLayer.css' class ImageLayer extends Component { + constructor(props) { + super(props); + this.state = { + visible: false, + previewImage: '', + current: 90, + transStyle: '' + } + } + translate = () => { + this.setState({ + current:(this.state.current+90)%360, + transStyle:'rotate('+this.state.current+'deg)' + }); + } + + render() { let { showImage, imageSrc, onImageLayerClose } = this.props; @@ -13,10 +30,34 @@ class ImageLayer extends Component { return ReactDOM.createPortal(
    {showImage ? -
    -
    - -
    +
    +
    + + + + + +
    +
    + +
    + +
    :
    diff --git a/public/react/src/modules/page/layers/TaskResultLayer.css b/public/react/src/modules/page/layers/TaskResultLayer.css index 25f570a56..962aed0db 100644 --- a/public/react/src/modules/page/layers/TaskResultLayer.css +++ b/public/react/src/modules/page/layers/TaskResultLayer.css @@ -7,7 +7,7 @@ background:rgba(0,0,0,0.8); top: 0px; overflow: hidden; -} +} .taskResultLayer .closeIcon{ position: absolute; right: 100px; @@ -40,7 +40,7 @@ justify-content: center; align-items: center; display: -webkit-flex; - height: 100%; + height: 90%; text-align: center; } .passImg{ @@ -137,4 +137,11 @@ .vertical4{ vertical-align: -4px; +} + +.ImageLayerbutton{ + position: absolute; + top: 0px; + right: 10px; + z-index: 10; } \ No newline at end of file