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 diff --git a/lib/tasks/public_course.rake b/lib/tasks/public_course.rake index 24fa3e844..ff50a4e28 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 @@ -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 # 作业 @@ -134,5 +137,4 @@ namespace :public_course do end large_time end -end - +end \ No newline at end of file diff --git a/public/react/scripts/build.js b/public/react/scripts/build.js index c18479299..b2bac24ec 100644 --- a/public/react/scripts/build.js +++ b/public/react/scripts/build.js @@ -198,6 +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}`) + // ${cdnHost} 加了cdn后,这个文件里的字体文件加载会有跨域的报错 ../fonts/fontawesome-webfont.eot + // 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}`) 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($('')