From 3b2ffb723b981114bbb3e8277bd359f15adae9a6 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, 3 Jan 2020 22:39:59 +0800 Subject: [PATCH 01/13] =?UTF-8?q?=E8=B0=83=E6=95=B4=E9=A6=96=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/public/css/edu-all.css | 2 +- public/stylesheets/educoder/edu-all.css | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/public/react/public/css/edu-all.css b/public/react/public/css/edu-all.css index 66adaf482..061cee521 100644 --- a/public/react/public/css/edu-all.css +++ b/public/react/public/css/edu-all.css @@ -174,7 +174,7 @@ em.vertical-line{display: inline-block;width: 2px;background: #999;height: 10px} .user_navlist_white a:hover{color: #4cacff} .headIcon{height: 100%;box-sizing: border-box; margin: 0px!important;} .black_nav_list{padding: 4px 0px;box-sizing: border-box;height: 100%;} -.black_nav_list li{line-height: 42px;height: 42px;color: #fff;cursor: pointer;} +.black_nav_list li{line-height: 40px;height: 40px;color: #fff;cursor: pointer;} .black_nav_span{display: block;margin:0px 20px;border-bottom: 1px solid #4B4B4B;padding-left: 8px;color: #FAFAFA} .welcome_shixun_index:last-child .black_nav_span{border-bottom: none} .black_nav_list li:hover{background: #fff;} diff --git a/public/stylesheets/educoder/edu-all.css b/public/stylesheets/educoder/edu-all.css index 8be6e00ab..b596b6c15 100644 --- a/public/stylesheets/educoder/edu-all.css +++ b/public/stylesheets/educoder/edu-all.css @@ -178,7 +178,7 @@ em.vertical-line{display: inline-block;width: 2px;background: #999;height: 10px} .user_navlist_white a:hover{color: #4cacff} .headIcon{height: 100%;box-sizing: border-box; margin: 0px!important;} .black_nav_list{padding: 4px 0px;box-sizing: border-box;height: 100%;} -.black_nav_list li{line-height: 42px;height: 42px;color: #fff;cursor: pointer;} +.black_nav_list li{line-height: 40px;height: 40px;color: #fff;cursor: pointer;} .black_nav_span{display: block;margin:0px 20px;border-bottom: 1px solid #4B4B4B;padding-left: 8px;color: #FAFAFA} .welcome_shixun_index:last-child .black_nav_span{border-bottom: none} .black_nav_list li:hover{background: #fff;} From bcbb47d7b32c7b310470f9c935f5a1e34f43c3fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Fri, 3 Jan 2020 22:43:37 +0800 Subject: [PATCH 02/13] =?UTF-8?q?=E5=B0=8F=E5=B1=8F=E5=B9=95=E6=8F=90?= =?UTF-8?q?=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/tpm/shixuns/ShixunSearchBar.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/tpm/shixuns/ShixunSearchBar.js b/public/react/src/modules/tpm/shixuns/ShixunSearchBar.js index 65f78502a..02d4d3864 100644 --- a/public/react/src/modules/tpm/shixuns/ShixunSearchBar.js +++ b/public/react/src/modules/tpm/shixuns/ShixunSearchBar.js @@ -239,7 +239,7 @@ render() { { shixunhoverData.map((item,key)=>{ return( - + =8?"bottomLeft":"bottomCenter"}>
  • {item.name}
  • From 06f320ca455ae4f0bc6f8c08563184def04e3743 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, 3 Jan 2020 22:46:59 +0800 Subject: [PATCH 03/13] =?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 e44dac83b..4116aef3a 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?2020`)); + .attr('href', `${_url_origin}/stylesheets/css/edu-common.css?2021`)); $('head').append($('') - .attr('href', `${_url_origin}/stylesheets/educoder/edu-main.css?2020`)); + .attr('href', `${_url_origin}/stylesheets/educoder/edu-main.css?2021`)); // index.html有加载 $('head').append($('') - .attr('href', `${_url_origin}/stylesheets/educoder/edu-all.css?2020`)); + .attr('href', `${_url_origin}/stylesheets/educoder/edu-all.css?2021`)); // $('head').append($('') From 99ec5fb0331a45fbb701cf6a428de33b599dc7b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Fri, 3 Jan 2020 22:50:55 +0800 Subject: [PATCH 04/13] =?UTF-8?q?=E8=AF=95=E5=8D=B7=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../react/src/modules/courses/exercise/new/SingleDisplay.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/courses/exercise/new/SingleDisplay.js b/public/react/src/modules/courses/exercise/new/SingleDisplay.js index 4b8d9ee95..6b84df8ce 100644 --- a/public/react/src/modules/courses/exercise/new/SingleDisplay.js +++ b/public/react/src/modules/courses/exercise/new/SingleDisplay.js @@ -102,7 +102,7 @@ class SingleDisplay extends Component{ display: "flex", flexDirection:"row", }} key={optionIndex}> - {prefix} + {prefix} @@ -116,7 +116,7 @@ class SingleDisplay extends Component{ display: "flex", flexDirection:"row", }} key={optionIndex}> - {prefix} + {prefix} From 1e8e4457a984f313dffa5572469e6014f98bf811 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, 3 Jan 2020 22:55:19 +0800 Subject: [PATCH 05/13] =?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/NewHeader.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index fabe180bf..5884eb4ef 100644 --- a/public/react/src/modules/tpm/NewHeader.js +++ b/public/react/src/modules/tpm/NewHeader.js @@ -1039,17 +1039,17 @@ submittojoinclass=(value)=>{ ` } -
  • - -
    -
    - 题库 -
    -
    -
    -
  • + {/*
  • */} + {/* */} + {/*
    */} + {/*
    */} + {/* 题库*/} + {/*
    */} + {/*
    */} + {/*
    */} + {/*
  • */} From 3db9ac825adb255881d7fc4532e4e7f9600c2141 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, 3 Jan 2020 23:36:47 +0800 Subject: [PATCH 06/13] =?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/page/main/CodeEvaluateView.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/page/main/CodeEvaluateView.js b/public/react/src/modules/page/main/CodeEvaluateView.js index e70d02008..346b8797e 100644 --- a/public/react/src/modules/page/main/CodeEvaluateView.js +++ b/public/react/src/modules/page/main/CodeEvaluateView.js @@ -318,6 +318,7 @@ class CodeEvaluateView extends Component { */ const _arrowClasses = isCollapse ? 'iconfont icon-xiajiantou btn-arrow' : 'iconfont icon-shangjiantou btn-arrow'; + return (
      @@ -330,11 +331,11 @@ class CodeEvaluateView extends Component {
    • this.tabIndexChange(1)}> 测试结果
    • -
    • + {this.props&&this.props.vnc_url?
    • this.handleShowTestCase()}> -
    • + :""} {this.props.inDrawer ? {/*TODO 按钮大小改造,css*/} From 0ed35e841d7f0182978f676521b5d4943a6a771b Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Mon, 6 Jan 2020 11:08:51 +0800 Subject: [PATCH 07/13] =?UTF-8?q?=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/application_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 89d53e73c..4396f5936 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -26,7 +26,7 @@ class ApplicationController < ActionController::Base unless Rails.env.development? Rails.logger.info("66666 #{params}") suffix = request.url.split(".").last.split("?").first - suffix_arr = ["xls", "xlsx", "pdf"] # excel文件先注释 + suffix_arr = ["xls", "xlsx", "pdf", "zip"] # excel文件先注释 unless suffix_arr.include?(suffix) if params[:client_key].present? randomcode = params[:randomcode] From 71903d215770debc4e8083a53a4c47a0e083f08b Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 6 Jan 2020 11:11:40 +0800 Subject: [PATCH 08/13] =?UTF-8?q?=E7=BB=99=E8=BF=90=E8=90=A5=E4=BA=BA?= =?UTF-8?q?=E5=91=98=E5=BC=80=E6=94=BEfork=E5=AE=9E=E8=AE=AD=E7=9A=84?= =?UTF-8?q?=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/shixuns_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index f86ade58f..442881df2 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -147,7 +147,7 @@ class ShixunsController < ApplicationController ## 实训详情 def show # 当前用户开启的实训 - can_fork = current_user.is_certification_teacher || current_user.admin? + can_fork = current_user.is_certification_teacher || current_user.admin_or_business? unless can_fork @can_fork = {can_fork: "已经职业认证的教师才能fork实训", certi_url: "/account/certification"} From 5f90a4a3af8c30b54eaecd010b8bf3f468e7c0cd Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Mon, 6 Jan 2020 11:12:44 +0800 Subject: [PATCH 09/13] =?UTF-8?q?=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/export_shixun_report_service.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/services/export_shixun_report_service.rb b/app/services/export_shixun_report_service.rb index 57b955762..4263ef4f1 100644 --- a/app/services/export_shixun_report_service.rb +++ b/app/services/export_shixun_report_service.rb @@ -43,6 +43,7 @@ class ExportShixunReportService @user = @work.user @shixun = homework.shixuns.take @games = @work.myshixun.games.includes(:challenge, :game_codes,:outputs) if @work.myshixun + @challenges = @shixun.challenges if @shixun # 用户最大评测次数 @user_evaluate_count = @games.pluck(:evaluate_count).sum if @games From 7896b7c73f5d6d5e979f3994a069f37ba9be6845 Mon Sep 17 00:00:00 2001 From: tangjiang <465264938@qq.com> Date: Mon, 6 Jan 2020 11:12:51 +0800 Subject: [PATCH 10/13] update editor style --- .../modules/page/component/monaco/TPIMonaco.css | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/public/react/src/modules/page/component/monaco/TPIMonaco.css b/public/react/src/modules/page/component/monaco/TPIMonaco.css index 75fe4ae8a..368ed5c8f 100644 --- a/public/react/src/modules/page/component/monaco/TPIMonaco.css +++ b/public/react/src/modules/page/component/monaco/TPIMonaco.css @@ -143,4 +143,18 @@ /* 选中行边框 */ .monaco-editor .view-overlays .current-line { border-width: 1px !important; +} + +.monaco-editor .margin, +.monaco-editor .margin-view-overlays{ + width: 54px !important; + text-align: center !important; +} + +.monaco-editor .monaco-scrollable-element{ + left: 54px !important; +} + +.monaco-editor .margin-view-overlays .line-numbers{ + text-align: center !important; } \ No newline at end of file From 92181e916c560d7963a7d432741bf1d2a9977b20 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Mon, 6 Jan 2020 11:54:26 +0800 Subject: [PATCH 11/13] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E6=8A=A5=E5=91=8A?= =?UTF-8?q?=E7=9A=84=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/tasks/zip_pack.rake | 50 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 lib/tasks/zip_pack.rake diff --git a/lib/tasks/zip_pack.rake b/lib/tasks/zip_pack.rake new file mode 100644 index 000000000..7eb757f08 --- /dev/null +++ b/lib/tasks/zip_pack.rake @@ -0,0 +1,50 @@ +# 执行示例 bundle exec rake zip_pack:shixun_pack args=123,2323 +namespace :zip_pack do + desc "手工打包作品" + OUTPUT_FOLDER = "#{Rails.root}/files/archiveZip" + + task :shixun_pack => :environment do + + if ENV['args'] + homework_ids = ENV['args'].split(",").map(&:to_i) + homeworks = HomeworkCommon.where(id: homework_ids) + homeworks.includes(:score_student_works).each do |homework| + out_file_name = "#{Time.now.strftime("%Y%m%d%H%M%S").to_s}-#{homework.course_id}-#{homework.name}.zip" + out_file_name.gsub!(" ", "-") + out_file_name.gsub!("/", "_") + + zipfile_name = "#{OUTPUT_FOLDER}/#{out_file_name}" + Dir.mkdir(File.dirname(zipfile_name)) unless File.exist?(File.dirname(zipfile_name)) + + student_works = homework.score_student_works + + if student_works.size > 0 + Zip::File.open(zipfile_name, Zip::File::CREATE) do |zip| + student_works.find_each.map do |student_work| + export = ExportShixunReportService.new(homework, student_work) + pdf = export.to_pdf + # pdfs << pdf + begin + zip.add(export.filename, pdf.path) + rescue => ex + Rails.logger.error(ex.message) + + zip.get_output_stream('FILE_NOTICE.txt'){|os| os.write("文件重复:#{export.filename}") } + next + end + end + end + zipfile = zipfile_name + else + zipfile = {:message => "no file"} + end + puts "out: #{zipfile}" + + end + end + end + + def filename_for_content_disposition(name) + request.env['HTTP_USER_AGENT'] =~ %r{MSIE|Trident|Edge} ? ERB::Util.url_encode(name) : name + end +end \ No newline at end of file From 445e7daf5f338057da429d8d68195b8478b38a7e Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Mon, 6 Jan 2020 13:48:59 +0800 Subject: [PATCH 12/13] =?UTF-8?q?=E6=89=B9=E9=87=8F=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E6=8A=A5=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/export_shixun_report_service.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/services/export_shixun_report_service.rb b/app/services/export_shixun_report_service.rb index 4263ef4f1..b75f031c0 100644 --- a/app/services/export_shixun_report_service.rb +++ b/app/services/export_shixun_report_service.rb @@ -10,7 +10,7 @@ class ExportShixunReportService end def filename - @_filename ||= "#{work.user&.student_id}_#{work.user.real_name}_#{homework.name}_#{Time.now.strftime('%Y%m%d_%H%M%S')}.pdf".gsub(' ', '-').gsub('/', '_') + @_filename ||= "#{homework.course&.user_group_name(work.user_id)}_#{work.user&.student_id}_#{work.user.real_name}_#{homework.name}_#{Time.now.strftime('%Y%m%d_%H%M%S')}.pdf".gsub(' ', '-').gsub('/', '_') end def prepare_binding From 31062cfa5fad76849f6ac80da6b37128e149884f Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Mon, 6 Jan 2020 13:57:13 +0800 Subject: [PATCH 13/13] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E6=8A=A5=E5=91=8A?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E7=9A=84=E6=96=87=E4=BB=B6=E5=91=BD=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_works_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/student_works_controller.rb b/app/controllers/student_works_controller.rb index d71ca8037..0b7874299 100644 --- a/app/controllers/student_works_controller.rb +++ b/app/controllers/student_works_controller.rb @@ -529,7 +529,7 @@ class StudentWorksController < ApplicationController @echart_data = student_efficiency(@homework, @work) @myself_eff = @echart_data[:efficiency_list].find { |item| item.last == @user.id } @myself_consume = @echart_data[:consume_list].find { |item| item.last == @user.id } - filename_ = "#{@user&.student_id}_#{@user&.real_name}_#{@shixun&.name}_#{Time.now.strftime('%Y%m%d_%H%M%S')}.pdf" + filename_ = "#{@homework.course&.user_group_name(@work.user_id)}_#{@user&.student_id}_#{@user&.real_name}_#{@shixun&.name}_#{Time.now.strftime('%Y%m%d_%H%M%S')}.pdf" filename = filename_.strip.tr("+/", "-_") stylesheets = %w(shixun_work/shixun_work.css shared/codemirror.css) if params[:export].present? && params[:export]