From 1acd53d7c86244e72a827ef71338530aa1b98faa Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Tue, 20 Aug 2019 13:55:06 +0800 Subject: [PATCH 1/6] =?UTF-8?q?rake=20=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/tasks/public_course.rake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/tasks/public_course.rake b/lib/tasks/public_course.rake index 6a16fcd3b..67d5603ab 100644 --- a/lib/tasks/public_course.rake +++ b/lib/tasks/public_course.rake @@ -42,7 +42,7 @@ namespace :public_course do begin CourseMember.create!(course_id: course_id, user_id: user_id, role: 4) rescue Exception => e - Rails.logger() + Rails.logger(e.message) end end end @@ -69,6 +69,7 @@ namespace :public_course do when 1 # 讨论区 created_on = random_time start_time, end_time + puts created_on messages = Message.where(board_id: course.boards) messages.each do |message| message.update_columns(created_on: created_on, updated_on: created_on) @@ -133,5 +134,4 @@ namespace :public_course do end large_time end -end - +end \ No newline at end of file From 897c69990ad53b7870af14ce5a82a5a3c31d0049 Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Tue, 20 Aug 2019 14:17:21 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E8=AE=A8=E8=AE=BA=E5=8C=BA=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E8=BD=AE=E8=AE=AD=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/tasks/public_course.rake | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/tasks/public_course.rake b/lib/tasks/public_course.rake index 67d5603ab..ff50a4e28 100644 --- a/lib/tasks/public_course.rake +++ b/lib/tasks/public_course.rake @@ -68,12 +68,15 @@ namespace :public_course do case type.to_i when 1 # 讨论区 - created_on = random_time start_time, end_time - puts created_on messages = Message.where(board_id: course.boards) messages.each do |message| + created_on = random_time start_time, end_time + puts created_on message.update_columns(created_on: created_on, updated_on: created_on) - MessageDetail.where(message_id: message.id).update_all(created_at: created_on, updated_at: created_on) + MessageDetail.where(message_id: message.id).each do |detail| + rand_created_on = random_time start_time, end_time + detail.update_columns(created_at: rand_created_on, updated_at: rand_created_on) + end end when 2 # 作业 From b335b20c483ca65932a1bc5b2ff1186377ec2856 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Tue, 20 Aug 2019 18:19:07 +0800 Subject: [PATCH 3/6] =?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/tpm/TPMIndexHOC.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/react/src/modules/tpm/TPMIndexHOC.js b/public/react/src/modules/tpm/TPMIndexHOC.js index af3e228cd..1a6c38639 100644 --- a/public/react/src/modules/tpm/TPMIndexHOC.js +++ b/public/react/src/modules/tpm/TPMIndexHOC.js @@ -35,14 +35,14 @@ if (!window['indexHOCLoaded']) { // $('head').append($('') // .attr('href', `${_url_origin}/stylesheets/educoder/antd.min.css?1525440977`)); $('head').append($('') - .attr('href', `${_url_origin}/stylesheets/css/edu-common.css?8`)); + .attr('href', `${_url_origin}/stylesheets/css/edu-common.css?9`)); $('head').append($('') - .attr('href', `${_url_origin}/stylesheets/educoder/edu-main.css?8`)); + .attr('href', `${_url_origin}/stylesheets/educoder/edu-main.css?9`)); // index.html有加载 $('head').append($('') - .attr('href', `${_url_origin}/stylesheets/educoder/edu-all.css?8`)); + .attr('href', `${_url_origin}/stylesheets/educoder/edu-all.css?9`)); // $('head').append($('') From 011cca981d6e9de2ec1d86d7aabe9f5bade5acd3 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Tue, 20 Aug 2019 18:33:29 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E5=8A=A0=E4=BA=86cdn=E5=90=8E=EF=BC=8C?= =?UTF-8?q?=E8=BF=99=E4=B8=AA=E6=96=87=E4=BB=B6=E9=87=8C=E7=9A=84=E5=AD=97?= =?UTF-8?q?=E4=BD=93=E6=96=87=E4=BB=B6=E5=8A=A0=E8=BD=BD=E4=BC=9A=E6=9C=89?= =?UTF-8?q?=E8=B7=A8=E5=9F=9F=E7=9A=84=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/scripts/build.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/react/scripts/build.js b/public/react/scripts/build.js index c18479299..b9bb9a702 100644 --- a/public/react/scripts/build.js +++ b/public/react/scripts/build.js @@ -198,7 +198,8 @@ function generateNewIndexJsp() { var result = data.replace('/js/js_min_all.js', `${cdnHost}/react/build/js/js_min_all.js?v=${newVersion}`) // .replace('/js/js_min_all_2.js', `${cdnHost}/react/build/js/js_min_all_2.js?v=${newVersion}`) - .replace('/css/css_min_all.css', `${cdnHost}/react/build/css/css_min_all.css?v=${newVersion}`) + // ${cdnHost} 加了cdn后,这个文件里的字体文件加载会有跨域的报错 ../fonts/fontawesome-webfont.eot + .replace('/css/css_min_all.css', `/react/build/css/css_min_all.css?v=${newVersion}`) .replace('/css/iconfont.css', `${cdnHost}/react/build/css/iconfont.css?v=${newVersion}`) .replace(/\/js\/create_kindeditor.js/g, `${cdnHost}/react/build/js/create_kindeditor.js?v=${newVersion}`) From 926a8748f20e2b6e35f49d8119ee21516da46d2e Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Tue, 20 Aug 2019 18:49:58 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/scripts/build.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/react/scripts/build.js b/public/react/scripts/build.js index b9bb9a702..b2bac24ec 100644 --- a/public/react/scripts/build.js +++ b/public/react/scripts/build.js @@ -199,7 +199,8 @@ function generateNewIndexJsp() { // .replace('/js/js_min_all_2.js', `${cdnHost}/react/build/js/js_min_all_2.js?v=${newVersion}`) // ${cdnHost} 加了cdn后,这个文件里的字体文件加载会有跨域的报错 ../fonts/fontawesome-webfont.eot - .replace('/css/css_min_all.css', `/react/build/css/css_min_all.css?v=${newVersion}`) + // TODO tpi 评测结果关闭也使用了fontawesome + .replace('/css/css_min_all.css', `${cdnHost}/react/build/css/css_min_all.css?v=${newVersion}`) .replace('/css/iconfont.css', `${cdnHost}/react/build/css/iconfont.css?v=${newVersion}`) .replace(/\/js\/create_kindeditor.js/g, `${cdnHost}/react/build/js/create_kindeditor.js?v=${newVersion}`) From 1fcd4283d97fda49ca71ce1310a0e2184f976a26 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Wed, 21 Aug 2019 09:06:20 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E6=88=90=E7=BB=A9=E7=9A=84=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/homeworks_service.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/services/homeworks_service.rb b/app/services/homeworks_service.rb index ab149403d..59bd5dad4 100644 --- a/app/services/homeworks_service.rb +++ b/app/services/homeworks_service.rb @@ -328,7 +328,11 @@ class HomeworksService work.late_penalty = work.work_status == 2 ? homework.late_penalty : 0 work.commit_time = myshixun.created_at > setting_time.publish_time ? setting_time.publish_time : myshixun.created_at work.myshixun_id = myshixun.id - work.update_time = myshixun.updated_at + work.update_time = if myshixun_endtime.present? + myshixun_endtime > homework_end_or_late_time ? homework_end_or_late_time : myshixun_endtime + else + myshixun.updated_at > homework_end_or_late_time ? homework_end_or_late_time : myshixun.updated_at + end work.final_score = final_score score = work.final_score + work.eff_score - work.late_penalty