From d4ad370635592fd362a4292dae325a6fc2613466 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 23 May 2019 11:29:29 +0800 Subject: [PATCH 01/67] =?UTF-8?q?=E8=81=8C=E4=B8=9A=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=97=A0=E6=B3=95=E7=BC=96=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/managements/_profession_index.html.erb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/views/managements/_profession_index.html.erb b/app/views/managements/_profession_index.html.erb index f8f906b3..668aa0f1 100644 --- a/app/views/managements/_profession_index.html.erb +++ b/app/views/managements/_profession_index.html.erb @@ -37,13 +37,13 @@ <%= format_time career.created_at %> <%= format_time career.published_at %> - <%# if !career.status %> - - <%# end %> - - <%# if !career.status %> - - <%# end %> + <% if !career.status %> + 发布 + <% end %> + 编辑 + <% if !career.status %> + 删除 + <% end %> <% end %> \ No newline at end of file From fe2eab517b2e71c97fec9c76c5afab948fc5a2a8 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 23 May 2019 16:27:39 +0800 Subject: [PATCH 02/67] =?UTF-8?q?post=E4=B8=AD=E9=97=B4=E5=B1=82=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E5=A2=9E=E5=8A=A0=E9=94=99=E8=AF=AF=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/application_helper.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index ade22d4e..fbad5606 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1187,7 +1187,9 @@ module ApplicationHelper end res rescue Exception => e - Rails.logger.error("post failed! #{e}") + Rails.logger.error("post failed! #{e.message}") + # 增加错误栈信息 + e.backtrace.each { |msg| Rails.logger.error(msg) } raise("实训云平台繁忙(繁忙等级:#{status})") end end @@ -1198,7 +1200,7 @@ module ApplicationHelper res = Net::HTTP.get_response(uri).body res = JSON.parse(res) rescue => e - logger.error("get response failed ! #{e}") + logger.error("get response failed ! #{e.message}") raise("实训云平台繁忙(繁忙等级:84)") end end From 07e6182c7e753c0883cc782d4af03634b560ee5e Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 23 May 2019 16:28:44 +0800 Subject: [PATCH 03/67] =?UTF-8?q?post=E4=B8=AD=E9=97=B4=E5=B1=82=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E5=A2=9E=E5=8A=A0=E9=94=99=E8=AF=AF=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/application_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index fbad5606..55ebb3e7 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1189,7 +1189,7 @@ module ApplicationHelper rescue Exception => e Rails.logger.error("post failed! #{e.message}") # 增加错误栈信息 - e.backtrace.each { |msg| Rails.logger.error(msg) } + e.backtrace.each { |msg| Rails.logger.error("post_backtrace: #{msg}") } raise("实训云平台繁忙(繁忙等级:#{status})") end end From b124c358c9c86050d1a597b62b5a270ed79aa78b Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Thu, 23 May 2019 18:14:57 +0800 Subject: [PATCH 04/67] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/application_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 3cedeb18..35449aad 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -6580,7 +6580,7 @@ def update_shixun_work_status homework myshixuns = Myshixun.where(:shixun_id => shixun.id, :user_id => student_works.map(&:user_id)) myshixuns.each do |myshixun| work = student_works.where(:user_id => myshixun.user_id).first - member = homework.course.members.find_by(:user_id => work.user_id) + member = homework.course.members.find_by_user_id(work.user_id) setting_time = homework_group_setting homework, member.try(:course_group_id) games = myshixun.games.where(:challenge_id => challeng_ids) myshixun_endtime = games.select{|game| game.status == 2}.size == games.size ? games.map(&:end_time).max : nil From 407f5615f22797fc133b8033542ea58b839e0a01 Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Fri, 24 May 2019 10:24:37 +0800 Subject: [PATCH 05/67] =?UTF-8?q?identifier=E7=94=9F=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/application_controller.rb | 10 ---------- app/services/games_service.rb | 9 +++++++++ 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index c1c25151..435c71fc 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -132,16 +132,6 @@ class ApplicationController < ActionController::Base end end - DCODES = %W(2 3 4 5 6 7 8 9 a b c f e f g h i j k l m n o p q r s t u v w x y z) - # 随机生成字符 - def generates_identifier(container, num) - code = DCODES.sample(num).join - while container.exists?(identifier: code) do - code = DCODES.sample(num).join - end - code - end - def ec_public_auth major_school unless User.current.admin? || major_school.template_major || major_school.school.users.where(:id => User.current.id).count > 0 || major_school.ec_major_school_users.where(:user_id => User.current.id).count > 0 || diff --git a/app/services/games_service.rb b/app/services/games_service.rb index 91645e84..b858abe6 100644 --- a/app/services/games_service.rb +++ b/app/services/games_service.rb @@ -1039,6 +1039,15 @@ class GamesService end private + DCODES = %W(2 3 4 5 6 7 8 9 a b c f e f g h i j k l m n o p q r s t u v w x y z) + # 随机生成字符 + def generates_identifier(container, num) + code = DCODES.sample(num).join + while container.exists?(identifier: code) do + code = DCODES.sample(num).join + end + code + end def format_answer_list games user_info = [] From b920395edef1df514ce9416766820f032aac14d0 Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Fri, 24 May 2019 10:37:43 +0800 Subject: [PATCH 06/67] =?UTF-8?q?=E4=B8=AD=E9=97=B4=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E7=9B=91=E6=8E=A7=E6=8E=A5=E5=8F=A3=E6=A0=87=E8=AF=86=E5=AD=98?= =?UTF-8?q?=E5=82=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/myshixuns_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/myshixuns_controller.rb b/app/controllers/myshixuns_controller.rb index 6316446e..7cd18a92 100644 --- a/app/controllers/myshixuns_controller.rb +++ b/app/controllers/myshixuns_controller.rb @@ -493,6 +493,7 @@ class MyshixunsController < ApplicationController return_back_time = format("%.3f", ( t1.to_f - brige_end_time.to_f)).to_f status = jsonTestDetails['status'] game_id = jsonTestDetails['buildID'] + sec_key = jsonTestDetails['sec_key'] logger.info("training_task_status start#1**#{game_id}**** #{Time.now.strftime("%Y-%m-%d %H:%M:%S.%L")}") resubmit = jsonTestDetails['resubmit'] outPut = tran_base64_decode64(jsonTestDetails['outPut']) @@ -535,7 +536,7 @@ class MyshixunsController < ApplicationController end logger.info("#############status: #{status}") logger.info("#############resubmit: #{resubmit}") - record = EvaluateRecord.where(:identifier => params[:sec_key]).first + record = EvaluateRecord.where(:identifier => sec_key).first logger.info("training_task_status start#3**#{game_id}**** #{Time.now.strftime("%Y-%m-%d %H:%M:%S.%L")}") # status:0表示评测成功 From a31b826039c2d9022c1b0d8a5bb4c79eb69eba02 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 24 May 2019 10:51:00 +0800 Subject: [PATCH 07/67] sec_key --- public/react/src/modules/page/MainContentContainer.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/page/MainContentContainer.js b/public/react/src/modules/page/MainContentContainer.js index 01126075..8b60a4c6 100644 --- a/public/react/src/modules/page/MainContentContainer.js +++ b/public/react/src/modules/page/MainContentContainer.js @@ -617,10 +617,10 @@ class MainContentContainer extends Component { // 之前的task_commit方法 gameBuild(fileUpdateResponse, first) { const { st, challenge, output_sets, onRunCodeTestFinish, resetTestSetsExpandedArray, showSnackbar, time_limit } = this.props - const { resubmit, content_modified } = fileUpdateResponse.data; + const { resubmit, content_modified, sec_key } = fileUpdateResponse.data; const timeOut = time_limit; // http://localhost:3000/myshixuns/so5w6iap97/stages/zl6kx8f7vfpo/game_build?first=1&resubmit=GDBEX741_1993 - const game_build_url = `${locationPath}/game_build?first=${first}&resubmit=${resubmit}&content_modified=${content_modified}` + const game_build_url = `${locationPath}/game_build?first=${first}&resubmit=${resubmit}&content_modified=${content_modified}&sec_key=${sec_key}` // var timeOut = parseInt(<%= @myshixun.main_mirror.try(:time_limit) %>); // 超时参数 resetTestSetsExpandedArray() axios.get(game_build_url, { From 80f9ee5ed5d0a359f5a7b6287166e80a97603a56 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 24 May 2019 11:08:52 +0800 Subject: [PATCH 08/67] b --- app/views/common/index.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/common/index.html.erb b/app/views/common/index.html.erb index d99476a6..4ffc07d1 100644 --- a/app/views/common/index.html.erb +++ b/app/views/common/index.html.erb @@ -1 +1 @@ -Educoder
\ No newline at end of file +Educoder
\ No newline at end of file From 7d2730cfa5a4c6e678361f086d3ac7db0fb142ff Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Fri, 24 May 2019 11:35:10 +0800 Subject: [PATCH 09/67] =?UTF-8?q?=E5=B7=A5=E7=A8=8B=E8=AE=A4=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gemfile | 4 +-- .../ec_major_schools/_year_list.html.erb | 12 +++---- app/views/ec_major_schools/show.html.erb | 33 +++++++++++-------- app/views/ec_years/ec_course_setting.html.erb | 7 ++-- .../ec_years/graduation_requirement.html.erb | 11 ++++--- .../requirement_vs_objective.html.erb | 11 ++++--- .../ec_years/requirement_vs_standard.html.erb | 11 ++++--- .../ec_years/training_objectives.html.erb | 11 ++++--- app/views/ecs/_ec_top_navigation.html.erb | 8 +++-- app/views/ecs/department.html.erb | 11 ++++--- .../javascripts/educoder/edu_application.js | 16 +++++++++ public/stylesheets/educoder/edu-all.css | 8 ++--- public/stylesheets/educoder/edu-main.css | 9 +++++ 13 files changed, 101 insertions(+), 51 deletions(-) diff --git a/Gemfile b/Gemfile index 7909cb17..9c18050b 100644 --- a/Gemfile +++ b/Gemfile @@ -63,8 +63,8 @@ gem 'elasticsearch-rails' gem 'oauth2' # xlsx -gem 'axlsx', '3.0.0.pre' -gem 'axlsx_rails', '0.3.0' +# gem 'axlsx', '3.0.0.pre' +# gem 'axlsx_rails', '0.3.0' #Ruby 2.2+ has removed test/unit from the core library. if RUBY_VERSION>='2.2' diff --git a/app/views/ec_major_schools/_year_list.html.erb b/app/views/ec_major_schools/_year_list.html.erb index 45a85d29..1e561782 100644 --- a/app/views/ec_major_schools/_year_list.html.erb +++ b/app/views/ec_major_schools/_year_list.html.erb @@ -15,12 +15,12 @@ <%= graduation_requirements > 0 ? graduation_requirements : @btn_text %> - - <% students = year.ec_year_students.count %> - - <%= students > 0 ? students : @btn_text %> - - + + + + + + <% courses = year.ec_courses.count %> diff --git a/app/views/ec_major_schools/show.html.erb b/app/views/ec_major_schools/show.html.erb index 05b58399..c3e4c924 100644 --- a/app/views/ec_major_schools/show.html.erb +++ b/app/views/ec_major_schools/show.html.erb @@ -4,21 +4,26 @@

-

- <%= @major.name %> +

@@ -31,7 +36,7 @@ 届别 培养目标 毕业要求 - 学生 + 课程体系 课程目标
(达成情况)
毕业要求指标点
(达成情况)
diff --git a/app/views/ec_years/ec_course_setting.html.erb b/app/views/ec_years/ec_course_setting.html.erb index 865d7733..9a697ba3 100644 --- a/app/views/ec_years/ec_course_setting.html.erb +++ b/app/views/ec_years/ec_course_setting.html.erb @@ -1,9 +1,10 @@
<%= render :partial => "ecs/ec_top_navigation" %> -

- 课程体系(<%= @ec_courses.count %>) -

+
    +
  • 课程体系(<%= @ec_courses.count %>)
  • +

    提供模板支持课程信息导入,亦可直接新增课程;并继续完成每门课程的评估机制配置查看详情

    +

温馨提醒:请下载课程模板(点击下载),将本届所有参与认证的课程名称导入系统,以便录入教学活动相关数据 <%= file_field_tag 'attachments[dummy][file]', diff --git a/app/views/ec_years/graduation_requirement.html.erb b/app/views/ec_years/graduation_requirement.html.erb index 955f226d..eab92924 100644 --- a/app/views/ec_years/graduation_requirement.html.erb +++ b/app/views/ec_years/graduation_requirement.html.erb @@ -10,12 +10,15 @@

<%= render :partial => "ecs/ec_top_navigation" %>
-

- 毕业要求(及其指标点) +

    +
  • +

    毕业要求(及其指标点)

    +

    请结合本专业特色修改毕业要求文字描述及指标点,需完全覆盖12项通用标准查看详情

    +
  • <% if @template_major || @ec_major_school.template_major %> - <%=link_to "导出毕业要求", graduation_requirement_ec_major_school_ec_year_path(@year, :ec_major_school_id => @year.ec_major_school_id, :format => 'xls'), :class => "fr white-btn edu-blueback-btn" %> + <%=link_to "导出毕业要求", graduation_requirement_ec_major_school_ec_year_path(@year, :ec_major_school_id => @year.ec_major_school_id, :format => 'xls'), :class => "fr white-btn edu-blueback-btn mt25" %> <% end %> -

    +

指标点 diff --git a/app/views/ec_years/requirement_vs_objective.html.erb b/app/views/ec_years/requirement_vs_objective.html.erb index ad49d552..fc5c9198 100644 --- a/app/views/ec_years/requirement_vs_objective.html.erb +++ b/app/views/ec_years/requirement_vs_objective.html.erb @@ -1,12 +1,15 @@

<%= render :partial => "ecs/ec_top_navigation" %>
-

- 毕业要求对培养目标的支撑 +

    +
  • +

    毕业要求对培养目标的支撑

    +

    用矩阵图的形式说明本专业毕业要求对培养目标的支撑关系,鼠标左键单击单元格即可查看详情

    +
  • <% if @template_major || @ec_major_school.template_major %> - <%=link_to "导出矩阵", requirement_vs_objective_ec_major_school_ec_year_path(@year, :ec_major_school_id => @year.ec_major_school_id, :format => 'xls'), :class => "fr white-btn edu-blueback-btn" %> + <%=link_to "导出矩阵", requirement_vs_objective_ec_major_school_ec_year_path(@year, :ec_major_school_id => @year.ec_major_school_id, :format => 'xls'), :class => "fr white-btn edu-blueback-btn mt25" %> <% end %> -

    +

表示支撑 diff --git a/app/views/ec_years/requirement_vs_standard.html.erb b/app/views/ec_years/requirement_vs_standard.html.erb index 90c4ecce..64acade8 100644 --- a/app/views/ec_years/requirement_vs_standard.html.erb +++ b/app/views/ec_years/requirement_vs_standard.html.erb @@ -1,12 +1,15 @@

<%= render :partial => "ecs/ec_top_navigation" %>
-

- 毕业要求对通用标准的支撑 +

    +
  • +

    毕业要求对通用标准的支撑

    +

    用矩阵图的形式说明本专业毕业要求对12项通用标准的覆盖关系,鼠标左键单击单元格即可查看详情

    +
  • <% if @template_major || @ec_major_school.template_major %> - <%=link_to "导出矩阵", requirement_vs_standard_ec_major_school_ec_year_path(@year, :ec_major_school_id => @year.ec_major_school_id, :format => 'xls'), :class => "fr white-btn edu-blueback-btn" %> + <%=link_to "导出矩阵", requirement_vs_standard_ec_major_school_ec_year_path(@year, :ec_major_school_id => @year.ec_major_school_id, :format => 'xls'), :class => "fr white-btn edu-blueback-btn mt25" %> <% end %> -

    +

表示支撑 diff --git a/app/views/ec_years/training_objectives.html.erb b/app/views/ec_years/training_objectives.html.erb index 585e8e22..fb8d860b 100644 --- a/app/views/ec_years/training_objectives.html.erb +++ b/app/views/ec_years/training_objectives.html.erb @@ -2,12 +2,15 @@ <%= render :partial => "ecs/ec_top_navigation" %>

-

- 培养目标 +

<%= render :partial => "training_objective_contents" %>
diff --git a/app/views/ecs/_ec_top_navigation.html.erb b/app/views/ecs/_ec_top_navigation.html.erb index 56583596..40f3b50e 100644 --- a/app/views/ecs/_ec_top_navigation.html.erb +++ b/app/views/ecs/_ec_top_navigation.html.erb @@ -45,12 +45,16 @@ ">4 " href="<%= requirement_vs_standard_ec_major_school_ec_year_path(@year, :ec_major_school_id => @year.ec_major_school_id) %>">毕业要求 vs 通用标准 +
  • "> + ">5 + " href="<%= student_lists_ec_major_school_ec_year_path(@year, :ec_major_school_id => @year.ec_major_school_id) %>">学生 +
  • "> - ">5 + ">6 " href="<%= ec_course_setting_ec_major_school_ec_year_path(@year, :ec_major_school_id => @year.ec_major_school_id) %>">课程体系
  • "> - ">6 + ">7 " href="<%= requirement_vs_courses_ec_major_school_ec_year_path(@year, :ec_major_school_id => @year.ec_major_school_id) %>">课程体系 vs 毕业要求
  • diff --git a/app/views/ecs/department.html.erb b/app/views/ecs/department.html.erb index d31e0726..a072094a 100644 --- a/app/views/ecs/department.html.erb +++ b/app/views/ecs/department.html.erb @@ -19,12 +19,15 @@ <% end %>
    -

    - 专业列表 +

    <%= @obj_count %> diff --git a/public/javascripts/educoder/edu_application.js b/public/javascripts/educoder/edu_application.js index 437fb319..7cce4a21 100644 --- a/public/javascripts/educoder/edu_application.js +++ b/public/javascripts/educoder/edu_application.js @@ -1229,3 +1229,19 @@ $(document).bind('ajaxError', function(event, xhr, settings) { } }); /** tpm实训开启按钮,不允许多次点击 END */ + + +//工程认证各个页面的查看详情弹层 +function elasticLayer(forumId){ + var html='
    ' + + '

    工程教育专业认证【培养目标】' + + '返回

    ' + + '
    ' + $(".newMain").after(html).hide(); + document.body.addEventListener('touchmove',bodyScroll,false); + $('body').css({'position':'fixed',"width":"100%"}); +} +function removeElasticLayer(){ + $(".layerContent").remove(); + $(".newMain").show(); +} diff --git a/public/stylesheets/educoder/edu-all.css b/public/stylesheets/educoder/edu-all.css index 18438c02..86d852de 100644 --- a/public/stylesheets/educoder/edu-all.css +++ b/public/stylesheets/educoder/edu-all.css @@ -3089,17 +3089,17 @@ a.singlepublishtwo{ .MajorName > i:hover{color: #4CACFF} /*培养目标*/ #traningNav{margin-bottom: 0px!important;} -#traningNav>li{float: left;padding:0px 30px 30px 30px;font-size: 16px;} +#traningNav>li{float: left;padding:0px 30px 30px 30px;font-size: 15px;} #traningNav>li>a,#traningNav li>i{color: #666!important;position: relative} #traningNav>li.active > a,#traningNav li.active > i{color: #05101A!important;} #traningNav>li.active > a:after{content: '';position: absolute;width: 64px;left: 50%;margin-left: -32px;height: 2px;background-color: #05101A;bottom: -35px;} -#traningNav>li>.ecTitle {width: 20px;height: 20px;border: 1px solid rgba(65, 140, 205, 1);border-radius: 50%;text-align: center; -line-height: 20px;display: inline-block;color: rgba(65, 140, 205, 1) !important;margin-right: 8px;} +#traningNav>li>.ecTitle {width: 16px;height: 16px;border: 1px solid rgba(65, 140, 205, 1);border-radius: 50%;text-align: center; +line-height: 16px;display: inline-block;color: rgba(65, 140, 205, 1) !important;margin-right: 8px;font-size: 12px} #traningNav>li>.ecTitlefont:hover{color: rgba(65, 140, 205, 1) !important;} .ecimgs{height: 90px;line-height: 90px;box-sizing: border-box;} #traningNav>li>.ecTitlefontFFF{color:#fff!important;} -#traningNav>li>.ecTitleFFF {width: 20px;height: 20px;border: 1px solid #fff;border-radius: 50%;text-align: center;line-height: 20px; +#traningNav>li>.ecTitleFFF {width: 16px;height: 16px;border: 1px solid #fff;border-radius: 50%;text-align: center;line-height: 16px;font-size: 12px; display: inline-block;color: #fff !important;margin-right: 8px;} .traningNavs>li {padding: 0px 10px 30px 12px !important;} .ecimgs1{background: url("/images/educoder/auth/1.png");background-repeat: no-repeat;background-size: 100% 100%;-moz-background-size: 100% 100%; diff --git a/public/stylesheets/educoder/edu-main.css b/public/stylesheets/educoder/edu-main.css index d48700a3..266f9b7f 100644 --- a/public/stylesheets/educoder/edu-main.css +++ b/public/stylesheets/educoder/edu-main.css @@ -903,4 +903,13 @@ html>body #ajax-indicator { position: fixed; } margin-left: 20px; text-indent: 25px; min-height: 100px; +} + + +/*工程认证 各页面公用弹层*/ +.layerContent{ + margin: 0 auto; + padding-bottom: 235px; + min-width: 1200px; + padding-top: 60px; } \ No newline at end of file From ae07c1b6df863155303ed836fc90874d0be852b7 Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Fri, 24 May 2019 12:49:32 +0800 Subject: [PATCH 10/67] =?UTF-8?q?=E8=87=AA=E5=8A=A8=E8=AF=84=E6=B5=8B?= =?UTF-8?q?=E4=B8=8D=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/myshixuns_controller.rb | 1 + app/services/games_service.rb | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/myshixuns_controller.rb b/app/controllers/myshixuns_controller.rb index 7cd18a92..f6854c7a 100644 --- a/app/controllers/myshixuns_controller.rb +++ b/app/controllers/myshixuns_controller.rb @@ -536,6 +536,7 @@ class MyshixunsController < ApplicationController end logger.info("#############status: #{status}") logger.info("#############resubmit: #{resubmit}") + logger.info("sec_key is#############resubmit: #{sec_key}") record = EvaluateRecord.where(:identifier => sec_key).first logger.info("training_task_status start#3**#{game_id}**** #{Time.now.strftime("%Y-%m-%d %H:%M:%S.%L")}") diff --git a/app/services/games_service.rb b/app/services/games_service.rb index b858abe6..098311f8 100644 --- a/app/services/games_service.rb +++ b/app/services/games_service.rb @@ -347,10 +347,11 @@ class GamesService rev = params[:rev] ? params[:rev] : "master" content_modified = 0 ActiveRecord::Base.transaction do - sec_key = generates_identifier(EvaluateRecord, 10) + # params[:evaluate] 实训评测时更新必须给的参数,需要依据该参数做性能统计,其它类型的更新可以跳过 # 自动保存的时候evaluate为0;点评测的时候为1 if params[:evaluate] == 1 + sec_key = generates_identifier(EvaluateRecord, 10) record = EvaluateRecord.create!(:user_id => current_user.id, :shixun_id => @myshixun.shixun.id, :game_id => @game.id, :identifier => sec_key) Rails.logger.warn("##game is is #{@game.id}, record id is #{record.id}, time is**** #{Time.now.strftime("%Y-%m-%d %H:%M:%S.%L")}") From fdecb7c53d14fce02f266d1068a3fd2f0b5644e5 Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Fri, 24 May 2019 12:50:50 +0800 Subject: [PATCH 11/67] =?UTF-8?q?=E4=BF=AE=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/games_service.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/services/games_service.rb b/app/services/games_service.rb index 098311f8..2139715e 100644 --- a/app/services/games_service.rb +++ b/app/services/games_service.rb @@ -388,7 +388,7 @@ class GamesService if content != last_content && code_file.blank? raise("update file failed") else - return {:success => "success", :resubmit => resubmit ,:content_modified => content_modified, sec_key: record.identifier} + return {:success => "success", :resubmit => resubmit ,:content_modified => content_modified, sec_key: record.try(:identifier)} end end rescue Exception => e From b64c1a50a4bf419380276011c2a680355b84791e Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 24 May 2019 14:11:32 +0800 Subject: [PATCH 12/67] ec --- .../ec/graduatesRequirement/GraduatesRequirement.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/public/react/src/modules/ec/graduatesRequirement/GraduatesRequirement.js b/public/react/src/modules/ec/graduatesRequirement/GraduatesRequirement.js index 00b72e1e..a62849f1 100644 --- a/public/react/src/modules/ec/graduatesRequirement/GraduatesRequirement.js +++ b/public/react/src/modules/ec/graduatesRequirement/GraduatesRequirement.js @@ -605,10 +605,17 @@ class GraduatesRequirement extends Component { >
  • +

    毕业要求指标点达成计算

    +

    + 系统根据课程体系与毕业要求的支持关系,以课程的考核与成绩判定方式,一键计算毕业要求的达成度情况 + window.elasticLayer(3530)} class="color-blue">查看详情 +

    + +
  • +

    From 22f303e4df0b07a5657f0ec6fef8963b79af2892 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 24 May 2019 14:14:33 +0800 Subject: [PATCH 13/67] sec_key --- public/react/src/modules/page/MainContentContainer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/page/MainContentContainer.js b/public/react/src/modules/page/MainContentContainer.js index 8b60a4c6..b7fcdfa8 100644 --- a/public/react/src/modules/page/MainContentContainer.js +++ b/public/react/src/modules/page/MainContentContainer.js @@ -639,7 +639,7 @@ class MainContentContainer extends Component { let requestTimes = 0; var gameStatusIntervalId = setInterval(()=>{ - let game_status_url = `${locationPath}/game_status?port=${port}&resubmit=${resubmit||""}&time_out=${timeOutFlag}` + let game_status_url = `${locationPath}/game_status?port=${port}&resubmit=${resubmit||""}&time_out=${timeOutFlag}&sec_key=${sec_key}` axios.get(game_status_url, { withCredentials: true, From ce9dc71211f88f30dc054ac8a2ab45a6024468fb Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 24 May 2019 14:22:11 +0800 Subject: [PATCH 14/67] b --- app/views/common/index.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/common/index.html.erb b/app/views/common/index.html.erb index 4ffc07d1..e102dde8 100644 --- a/app/views/common/index.html.erb +++ b/app/views/common/index.html.erb @@ -1 +1 @@ -Educoder

    \ No newline at end of file +Educoder
    \ No newline at end of file From b30d8a6a898642510d93c716ec2805e33054c872 Mon Sep 17 00:00:00 2001 From: p31729568 Date: Fri, 24 May 2019 14:51:19 +0800 Subject: [PATCH 15/67] modify create ec year code --- app/controllers/ec_years_controller.rb | 245 +---------------- app/models/ec_graduation_subitem.rb | 3 + app/models/ec_require_sub_vs_standard.rb | 3 + app/models/ec_requirement_vs_objective.rb | 2 + app/models/ec_training_subitem.rb | 1 + app/models/ec_year.rb | 4 + app/models/school.rb | 1 + app/services/copy_ec_year_service.rb | 306 ++++++++++++++++++++++ 8 files changed, 324 insertions(+), 241 deletions(-) create mode 100644 app/services/copy_ec_year_service.rb diff --git a/app/controllers/ec_years_controller.rb b/app/controllers/ec_years_controller.rb index 4661fd7b..c0c9483c 100644 --- a/app/controllers/ec_years_controller.rb +++ b/app/controllers/ec_years_controller.rb @@ -17,18 +17,11 @@ class EcYearsController < ApplicationController # 添加年份 def create @major_school = EcMajorSchool.find(params[:ec_major_school_id]) - ec_years = @major_school.ec_years.pluck(:year) - exist_year = ec_years.include?(params[:year].to_i) - if exist_year + if @major_school.ec_years.exists?(year: params[:year].to_i) @status = -1 else - prev_year = "#{params[:year].to_i - 1}" - prev_ec_year = @major_school.ec_years.where(:year => prev_year).first - if prev_ec_year.blank? - EcYear.create!(:year => params[:year], :ec_major_school_id => @major_school.id) - else - copy_year(prev_ec_year, params[:year]) - end + service = CopyEcYearService.new(@major_school, params[:year].to_i) + service.call @status = 1 end @major_manager = true @@ -246,7 +239,7 @@ class EcYearsController < ApplicationController template_file = EcTemplate.find_by_name "课程列表导入模板" if template_file.present? file = template_file.attachments.first - @file_url = "/attachments/download/#{file.id}/#{file.filename}" + @file_url = '' #"/attachments/download/#{file.id}/#{file.filename}" else @file_url = "javascript:void(0);" end @@ -357,236 +350,6 @@ class EcYearsController < ApplicationController @year = EcYear.find(params[:id]) end - # 复制最新一届下的所有数据. previous_ec_year: 本专业最新一届, new_year: 新建的届别 - def copy_year previous_ec_year, new_year - ActiveRecord::Base.transaction do - begin - # 如果是第一次创建届别,则直接创建 - if previous_ec_year.blank? - raise("没有界别可以复制") - else - logger.info("############previous_ec_year: #{previous_ec_year.id}") - # 多个中间表需要替换的id - egs_record = [] # 记录ec_graduation_subitems的新旧值 例如: [[prev_egs, new_egs], [...]] - egr_record = [] # 记录ec_graduation_requirements的新旧值, 例如: [[prev_egr, new_egr], [...]] - ec_record = [] # 记录ec_courses - ece_record = [] # 记录ec_course_evaluations - eces_record= [] # 记录ec_course_evaluation_subitems - ect_record = [] # 记录ec_course_targets - - # 复制 "届别" - ec_year = EcYear.create!(:year => new_year, - :ec_major_school_id => previous_ec_year.ec_major_school_id, - :calculation_value => previous_ec_year.calculation_value) - - # 复制 "毕业要求" - previous_ec_year.ec_graduation_requirements.try(:each) do |pre_egr| - new_egr = EcGraduationRequirement.new - new_egr.attributes = pre_egr.attributes.dup.except("id", "ec_year_id") - new_egr.ec_year_id = ec_year.id - new_egr.save! - egr_record << [pre_egr.id, new_egr.id] - # 复制 "毕业要求子标点" - pre_egr.ec_graduation_subitems.try(:each) do |pre_egs| - new_egs = EcGraduationSubitem.new - new_egs.attributes = pre_egs.attributes.dup.except("id", "ec_graduation_requirement_id") - new_egs.ec_graduation_requirement_id = new_egr.id - new_egs.save! - # 记录新旧对应关系,为之后的中间表做记录 - egs_record << [pre_egs.id, new_egs.id] - prev_ersvss = EcRequireSubVsStandard.where(:ec_graduation_subitem_id => pre_egs.id) - prev_ersvss.each do |prev_ersvs| - new_ersvss = EcRequireSubVsStandard.new - new_ersvss.attributes = prev_ersvs.attributes.dup.except("id", "ec_graduation_subitem_id") - new_ersvss.ec_graduation_subitem_id = new_egs.id - new_ersvss.save! - end - - end - end - - # 复制 "培养目标" - pre_eto = previous_ec_year.ec_training_objective - if pre_eto.present? - new_eto = EcTrainingObjective.new - new_eto.attributes = pre_eto.attributes.dup.except("id", "ec_year_id") - new_eto.ec_year_id = ec_year.id - new_eto.save! - - # 复制 "培养目标分项" - pre_eto.ec_training_subitems.try(:each) do |pre_ets| - new_ets = EcTrainingSubitem.new - new_ets.attributes = pre_ets.attributes.dup.except("id", "ec_training_objective_id") - new_ets.ec_training_objective_id = new_eto.id - new_ets.save! - - # 复制 "毕业要去 vs 培养目标" - pre_ervsos = EcRequirementVsObjective.where(:ec_training_objective_id => pre_ets.id) - pre_ervsos.each do |ervso| - new_ervso = EcRequirementVsObjective.new - new_ervso.attributes = ervso.attributes.dup.except("id", "ec_training_objective_id", "ec_graduation_requirement_id") - new_ervso.ec_training_objective_id = new_ets.id - new_egr_id = -1 - egr_record.each do |egr_id| - if egr_id[0] == ervso.ec_graduation_requirement_id - new_egr_id = egr_id[1] - end - end - raise("找不对应的毕业要求") if new_egr_id == -1 - new_ervso.ec_graduation_requirement_id = new_egr_id - new_ervso.save! - end - end - end - - # 复制 "课程体系" - previous_ec_year.ec_courses.try(:each) do |pre_ec| - new_ec = EcCourse.create!(name: pre_ec.name, ec_year_id: ec_year.id) - ec_record << [pre_ec.id, new_ec.id] - # 复制 "课程考核标准" - pre_ec.ec_course_evaluations.try(:each) do |pre_ece| - new_ece = EcCourseEvaluation.create!(name: pre_ece.name, - evluation_count: pre_ece.evluation_count, - ec_course_id: new_ec.id, - is_course_type: pre_ece.is_course_type) - ece_record << [pre_ece.id, new_ece.id] - # 复制 "考核分项" - pre_ece.ec_course_evaluation_subitems.try(:each) do |pre_eces| - new_eces = EcCourseEvaluationSubitem.create!(name: pre_eces.name, ec_course_evaluation_id: new_ece.id) - # 记录新旧对应关系,为之后的中间表做记录 - eces_record << [pre_eces.id, new_eces.id] - end - end - - # 复制 "课程目标" - pre_ec.ec_course_targets.try(:each) do |pre_ect| - new_ect = EcCourseTarget.new - new_ect.attributes = pre_ect.attributes.dup.except("id", "ec_course_id") - new_ect.ec_course_id = new_ec.id - new_ect.save! - # 记录新旧对应关系,为之后的中间表做记录 - ect_record << [pre_ect.id, new_ect.id] - # 复制 "课程目标和毕业要求指标点" - pre_ect.ec_graduation_subitem_course_targets.try(:each) do |pre_egsct| - new_egsct = EcGraduationSubitemCourseTarget.new - new_egsct.attributes = pre_egsct.attributes.dup.except("id", "ec_graduation_subitem_id", "ec_course_target_id") - # 寻找对应的new_egs_id - logger.info("############egs_record:#{egs_record}") - logger.info("############ec_graduation_subitem_id: #{pre_egsct.ec_graduation_subitem_id}") - new_egs_id = -1 - egs_record.each do |id| - if id[0] == pre_egsct.ec_graduation_subitem_id - new_egs_id = id[1] - end - end - raise("课程目标和毕业要求指标点找不到对应关系.") if new_egs_id == -1 - new_egsct.ec_graduation_subitem_id = new_egs_id - new_egsct.ec_course_target_id = new_ect.id - new_egsct.save! - end - - # 复制 "课程达成方法" - pre_ect.ec_course_achievement_methods.each do |pre_ecam| - # 寻找对应的 ec_course_id - new_ec_id = -1 - new_ece_id = -1 - new_eces_id = -1 - ec_record.each do |ec_id| - if ec_id[0] == pre_ecam.ec_course_id - new_ec_id = ec_id[1] - end - end - # 寻找对应的ec_course_evaluation_id - ece_record.each do |ece_id| - if ece_id[0] == pre_ecam.ec_course_evaluation_id - new_ece_id = ece_id[1] - end - end - # 寻找对应的ec_course_evaluation_subitem_id - eces_record.each do |eces_id| - if eces_id[0] == pre_ecam.ec_course_evaluation_subitem_id - new_eces_id = eces_id[1] - end - end - - new_ecam = EcCourseAchievementMethod.new - new_ecam.attributes = pre_ecam.attributes.dup.except("id", "ec_course_id", "ec_course_evaluation_id", - "ec_course_evaluation_subitem_id", "ec_course_target_id") - new_ecam.ec_course_id = new_ec_id if new_ec_id != -1 - new_ecam.ec_course_evaluation_id = new_ece_id if new_ece_id != -1 - new_ecam.ec_course_evaluation_subitem_id = new_eces_id if new_eces_id != -1 - new_ecam.ec_course_target_id = new_ect.id - new_ecam.save! - - # 复制 "课程评价达成关系" - pre_ecam.ec_achievement_evaluation_relates.each do |pre_eaer| - new_eaer = EcAchievementEvaluationRelate.new - new_eaer.attributes = pre_eaer.attributes.dup.except("id", "ec_course_achievement_method_id", - "ec_course_evaluation_subitem_id", "ec_course_target_id") - new_eaer.ec_course_achievement_method_id = new_ecam.id - # 寻找对应的 ec_course_evaluation_subitem_id - new_eces_id = -1 - eces_record.each do |eces_id| - if eces_id[0] == pre_eaer.ec_course_evaluation_subitem_id - new_eces_id = eces_id[1] - end - end - new_eaer.ec_course_evaluation_subitem_id = new_eces_id if new_eces_id != -1 - # 寻找对应的 ec_course_target_id - new_ect_id = -1 - ect_record.each do |ect_id| - if ect_id[0] == pre_eaer.ec_course_target_id - new_ect_id = ect_id[1] - end - end - new_eaer.ec_course_target_id = new_ect_id if new_ect_id != -1 - new_eaer.save! - end - end - end - - # 复制 "课程支撑" - pre_ec.ec_course_supports.try(:each) do |pre_ecs| - new_ecs = EcCourseSupport.new - new_ecs.attributes = pre_ecs.attributes.dup.except("id", "ec_course_id") - new_ecs.ec_course_id = new_ec.id - new_ecs.save! - # 复制 "课程vs毕业要求" - pre_ecs.ec_graduation_subitem_courses.try(:each) do |pre_egsc| - new_egs_id = -1 - egs_record.each do |egs_id| - if egs_id[0] == pre_egsc.ec_graduation_subitem_id - new_egs_id = egs_id[1] - end - end - new_egsc = EcGraduationSubitemCourse.new - new_egsc.attributes = pre_egsc.attributes.dup.except("id", "ec_graduation_subitem_id", "ec_course_support_id") - raise("找不到课程vs毕业要求的关联关系!") if new_egs_id == -1 - new_egsc.ec_graduation_subitem_id = new_egs_id - new_egsc.ec_course_support_id = new_ecs.id - new_egsc.save! - end - - end - - # 复制 "成绩等级设置" - pre_ec.ec_score_levels.try(:each) do |pre_esl| - new_esl = EcScoreLevel.new - new_esl.attributes = pre_esl.attributes.dup.except("id", "ec_course_id") - new_esl.ec_course_id = new_ec.id - new_esl.save! - end - - end - end - rescue Exception => e - logger.error("###########error_message: #{e.message}") - raise ActiveRecord::Rollback - end - - end - end - # 导出培养目标excel def export_training_objectives objects xls_report = StringIO.new diff --git a/app/models/ec_graduation_subitem.rb b/app/models/ec_graduation_subitem.rb index b82b0789..12f60091 100644 --- a/app/models/ec_graduation_subitem.rb +++ b/app/models/ec_graduation_subitem.rb @@ -9,4 +9,7 @@ class EcGraduationSubitem < ActiveRecord::Base # 课程目标配置 has_many :ec_course_targets, :through => :ec_graduation_subitem_course_targets has_many :ec_graduation_subitem_course_targets, :dependent => :destroy + + has_many :ec_require_sub_vs_standards + has_many :ec_graduation_standards, through: :ec_require_sub_vs_standards end diff --git a/app/models/ec_require_sub_vs_standard.rb b/app/models/ec_require_sub_vs_standard.rb index a68481e1..0c696a9e 100644 --- a/app/models/ec_require_sub_vs_standard.rb +++ b/app/models/ec_require_sub_vs_standard.rb @@ -1,3 +1,6 @@ class EcRequireSubVsStandard < ActiveRecord::Base attr_accessible :ec_graduation_standard_id, :ec_graduation_subitem_id, :status + + belongs_to :ec_graduation_standard + belongs_to :ec_graduation_subitem end diff --git a/app/models/ec_requirement_vs_objective.rb b/app/models/ec_requirement_vs_objective.rb index 7b17e054..9c2b5878 100644 --- a/app/models/ec_requirement_vs_objective.rb +++ b/app/models/ec_requirement_vs_objective.rb @@ -1,3 +1,5 @@ class EcRequirementVsObjective < ActiveRecord::Base attr_accessible :ec_graduation_requirement_id, :ec_training_objective_id, :status + belongs_to :ec_graduation_requirement + belongs_to :ec_training_subitem end diff --git a/app/models/ec_training_subitem.rb b/app/models/ec_training_subitem.rb index 92edb18b..6f9a4f12 100644 --- a/app/models/ec_training_subitem.rb +++ b/app/models/ec_training_subitem.rb @@ -1,4 +1,5 @@ class EcTrainingSubitem < ActiveRecord::Base belongs_to :ec_training_objective + has_many :ec_requirement_vs_objectives, foreign_key: :ec_training_objective_id end diff --git a/app/models/ec_year.rb b/app/models/ec_year.rb index 83f5f78b..5f9aa00b 100644 --- a/app/models/ec_year.rb +++ b/app/models/ec_year.rb @@ -16,4 +16,8 @@ class EcYear < ActiveRecord::Base # 课堂配置 has_many :ec_courses, :dependent => :destroy acts_as_attachable + + def prev_year + ec_major_school.ec_years.find_by_year(year - 1) + end end diff --git a/app/models/school.rb b/app/models/school.rb index c5018191..8342039e 100644 --- a/app/models/school.rb +++ b/app/models/school.rb @@ -16,6 +16,7 @@ class School < ActiveRecord::Base has_many :ec_majors, :through => :ec_major_schools has_many :ec_major_schools, :dependent => :destroy + has_one :ec_template_major, conditions: 'template_major = 1', class_name: 'EcMajorSchool' has_many :partners, :dependent => :destroy has_many :customers, :dependent => :destroy diff --git a/app/services/copy_ec_year_service.rb b/app/services/copy_ec_year_service.rb new file mode 100644 index 00000000..83073d53 --- /dev/null +++ b/app/services/copy_ec_year_service.rb @@ -0,0 +1,306 @@ + class CopyEcYearService + attr_reader :major_school, :to_year + + def initialize(major_school, year) + @major_school = major_school + @to_year = major_school.ec_years.new(year: year) + end + + def call + if from_year.blank? + to_year.save! + return to_year + end + + # 专业第一次创建届别时,复制示例专业2017届 + ActiveRecord::Base.transaction do + copy_ec_year! + + copy_graduation_requirement! + + copy_training_objective! + + new_major_school? ? copy_template_ec_course! : copy_ec_courses! + end + + to_year + end + + private + + def new_major_school? + @_new_major ||= major_school.ec_years.count.zero? + end + + def from_year + @_from_year ||= new_major_school? ? template_major_year : to_year.prev_year + end + + def template_major_year + EcYear.joins(:ec_major_school).where(ec_major_schools: { template_major: true }).find_by_year('2017') + end + + def copy_ec_year! + to_year.calculation_value = from_year.calculation_value + to_year.save! + end + + def copy_graduation_requirement! + requirements = from_year.ec_graduation_requirements.includes(ec_graduation_subitems: :ec_require_sub_vs_standards) + + requirements.each do |requirement| + to_requirement = to_year.ec_graduation_requirements.new + to_requirement.attributes = requirement.attributes.except('id', 'ec_year_id', 'created_at', 'updated_at') + to_requirement.save! + + # 记录对应关系,创建支撑时使用 + graduation_requirement_map[requirement.id] = to_requirement.id + + copy_graduation_subitems(requirement, to_requirement) + end + end + + def copy_graduation_subitems(requirement, to_requirement) + requirement.ec_graduation_subitems.each do |item| + to_item = to_requirement.ec_graduation_subitems.new + to_item.attributes = item.attributes.except('id', 'ec_graduation_requirement_id', 'created_at', 'updated_at') + to_item.save! + + # 记录对应关系,创建支撑时使用 + graduation_subitem_map[item.id] = to_item.id + + copy_requirement_standard_supports!(item, to_item) + end + end + + def copy_requirement_standard_supports!(graduation_subitem, to_graduation_subitem) + graduation_subitem.ec_require_sub_vs_standards.each do |support| + to_support = to_graduation_subitem.ec_require_sub_vs_standards.new + to_support.attributes = support.attributes.except('id', 'ec_graduation_subitem_id', 'created_at', 'updated_at') + to_support.save! + end + end + + def copy_training_objective! + training_objective = from_year.ec_training_objective + return if training_objective.blank? + + attributes = training_objective.attributes.except('id', 'ec_year_id', 'created_at', 'updated_at') + to_training_objective = to_year.create_ec_training_objective!(attributes) + + copy_training_subitems!(training_objective, to_training_objective) + end + + def copy_training_subitems!(training_objective, to_training_objective) + training_subitems = training_objective.ec_training_subitems.includes(:ec_requirement_vs_objectives) + + training_subitems.each do |item| + to_item = to_training_objective.ec_training_subitems.new + to_item.attributes = item.attributes.except('id', 'ec_training_objective_id', 'created_at', 'updated_at') + to_item.save! + + copy_requirement_vs_objectives!(item, to_item) + end + end + + def copy_requirement_vs_objectives!(training_item, to_training_item) + training_item.ec_requirement_vs_objectives.each do |support| + to_support = to_training_item.ec_requirement_vs_objectives.new(status: support.status) + to_support.ec_graduation_requirement_id = graduation_requirement_map[support.ec_graduation_requirement_id] + to_support.save! + end + end + + def copy_template_ec_course! + course = from_year.ec_courses.includes( + :ec_score_levels, + ec_course_evaluations: :ec_course_evaluation_subitems, + ec_course_targets: :ec_graduation_subitem_course_targets, + ec_course_achievement_methods: :ec_achievement_evaluation_relates, + ec_course_supports: :ec_graduation_subitem_courses + ).find_by_name('数据库原理') + + to_course = to_year.ec_courses.new + to_course.attributes = course.attributes.except('id', 'ec_year_id', 'created_at', 'updated_at') + to_course.save! + + course_map[course.id] = to_course.id + + copy_course_evaluations!(course, to_course) + copy_course_targets!(course, to_course) + copy_course_achievement_methods!(course, to_course) + copy_ec_course_supports!(course, to_course) + copy_score_levels!(course, to_course) + + # 复制示例时需要复制学生和成绩数据 + copy_year_students! + end + + def copy_ec_courses! + courses = from_year.ec_courses.includes( + :ec_score_levels, + ec_course_evaluations: :ec_course_evaluation_subitems, + ec_course_targets: :ec_graduation_subitem_course_targets, + ec_course_achievement_methods: :ec_achievement_evaluation_relates, + ec_course_supports: :ec_graduation_subitem_courses + ) + + courses.each do |course| + to_course = to_year.ec_courses.new + to_course.attributes = course.attributes.except('id', 'ec_year_id', 'created_at', 'updated_at') + to_course.save! + + course_map[course.id] = to_course.id + + copy_course_evaluations!(course, to_course) + copy_course_targets!(course, to_course) + copy_course_achievement_methods!(course, to_course) + copy_ec_course_supports!(course, to_course) + copy_score_levels!(course, to_course) + end + end + + def copy_course_evaluations!(course, to_course) + course.ec_course_evaluations.each do |evaluation| + to_evaluation = to_course.ec_course_evaluations.new + to_evaluation.attributes = evaluation.attributes.except('id', 'ec_course_id', 'created_at', 'updated_at') + to_evaluation.save! + + course_evaluation_map[evaluation.id] = to_evaluation.id + + copy_course_evaluation_subitems!(evaluation, to_evaluation) + end + end + + def copy_course_evaluation_subitems!(evaluation, to_evaluation) + evaluation.ec_course_evaluation_subitems.each do |item| + to_item = to_evaluation.ec_course_evaluation_subitems.new + to_item.attributes = item.attributes.except('id', 'ec_course_evaluation_id', 'created_at', 'updated_at') + to_item.save! + + course_evaluation_subitem_map[item.id] = to_item.id + end + end + + def copy_course_targets!(course, to_course) + course.ec_course_targets.each do |target| + to_target = to_course.ec_course_targets.new + to_target.attributes = target.attributes.except('id', 'ec_course_id', 'created_at', 'updated_at') + to_target.save! + + course_target_map[target.id] = to_target.id + + copy_graduation_subitem_course_targets!(target, to_target) + end + end + + def copy_graduation_subitem_course_targets!(target, to_target) + target.ec_graduation_subitem_course_targets.each do |support| + to_support = to_target.ec_graduation_subitem_course_targets.new + to_support.attributes = support.attributes.except('id', 'ec_graduation_subitem_id', 'created_at', 'updated_at') + to_support.ec_graduation_subitem_id = graduation_subitem_map[support.ec_graduation_subitem_id] + to_support.save! + end + end + + def copy_course_achievement_methods!(course, to_course) + course.ec_course_achievement_methods.each do |from| + to = to_course.ec_course_achievement_methods.new + to.attributes = from.attributes.except('id', 'ec_course_id', 'ec_course_target_id', 'ec_course_evaluation_id', + 'ec_course_evaluation_subitem_id', 'created_at', 'updated_at') + + to.ec_course_target_id = course_target_map[from.ec_course_target_id] + to.ec_course_evaluation_id = course_evaluation_map[from.ec_course_evaluation_id] + to.ec_course_evaluation_subitem_id = course_evaluation_subitem_map[from.ec_course_evaluation_subitem_id] + to.save! + + copy_achievement_evaluation_relates!(from, to) + end + end + + def copy_achievement_evaluation_relates!(method, to_method) + method.ec_achievement_evaluation_relates.each do |relate| + to_relate = to_method.ec_achievement_evaluation_relates.new + to_relate.attributes = relate.attributes.except('id', 'ec_course_achievement_method_id', 'ec_course_target_id', + 'ec_course_evaluation_subitem_id', 'created_at', 'updated_at') + to_relate.ec_course_target_id = course_target_map[relate.ec_course_target_id] + to_relate.ec_course_evaluation_subitem_id = course_target_map[relate.ec_course_evaluation_subitem_id] + to_relate.save! + end + end + + def copy_ec_course_supports!(course, to_course) + course.ec_course_supports.each do |support| + to_support = to_course.ec_course_supports.new + to_support.attributes = support.attributes.except('id', 'ec_course_id', 'created_at', 'updated_at') + to_support.save! + + copy_graduation_subitem_courses!(support, to_support) + end + end + + def copy_graduation_subitem_courses!(course_support, to_course_support) + course_support.ec_graduation_subitem_courses.each do |item| + to_item = to_course_support.ec_graduation_subitem_courses.new + to_item.attributes = item.attributes.except('id', 'ec_course_support_id', 'ec_graduation_subitem_id', + 'created_at', 'updated_at') + to_item.ec_graduation_subitem_id = graduation_subitem_map[item.ec_graduation_subitem_id] + to_item.save! + end + end + + def copy_score_levels!(course, to_course) + course.ec_score_levels.each do |level| + to_level = to_course.ec_score_levels.new + to_level.attributes = level.attributes.except('id', 'ec_course_id', 'created_at', 'updated_at') + to_level.save! + end + end + + def copy_year_students! + students = from_year.ec_year_students.includes(:ec_student_achievements) + + students.each do |student| + to_student = to_year.ec_year_students.new + to_student.attributes = student.attributes.except('id', 'ec_year_id', 'created_at', 'updated') + to_student.save! + + copy_student_achievements!(student, to_student) + end + end + + def copy_student_achievements!(student, to_student) + student.ec_student_achievements.each do |achievement| + to_achievement = to_student.ec_student_achievements.new + to_achievement.attributes = achievement.attributes.except('id', 'ec_year_student_id', 'ec_course_evaluation_id', + 'ec_course_evaluation_subitem_id', 'created_at', 'updated_at') + to_achievement.ec_course_evaluation_id = course_evaluation_map[achievement.ec_course_evaluation_id] + to_achievement.ec_course_evaluation_subitem_id = course_evaluation_subitem_map[achievement.ec_course_evaluation_subitem_id] + to_achievement.save! + end + end + + def graduation_requirement_map + @_graduation_requirement_map ||= {} + end + + def graduation_subitem_map + @_graduation_subitem_map ||= {} + end + + def course_map + @_course_map ||= {} + end + + def course_evaluation_map + @_course_evaluation_map ||= {} + end + + def course_evaluation_subitem_map + @_course_evaluation_subitem_map ||= {} + end + + def course_target_map + @_course_target_map ||= {} + end + end \ No newline at end of file From 2a3e7090ae4aa450926abb0ba522cd2e6c97dd1e 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, 24 May 2019 15:04:29 +0800 Subject: [PATCH 16/67] =?UTF-8?q?=E5=90=88=E5=B9=B6=E8=AE=A4=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/common/index.html.erb | 2 +- .../ec_major_schools/_year_list.html.erb | 12 +++---- app/views/ec_major_schools/show.html.erb | 33 +++++++++++-------- app/views/ec_years/ec_course_setting.html.erb | 7 ++-- .../ec_years/graduation_requirement.html.erb | 11 ++++--- .../requirement_vs_objective.html.erb | 11 ++++--- .../ec_years/requirement_vs_standard.html.erb | 11 ++++--- .../ec_years/training_objectives.html.erb | 11 ++++--- app/views/ecs/_ec_top_navigation.html.erb | 8 +++-- app/views/ecs/department.html.erb | 11 ++++--- .../javascripts/educoder/edu_application.js | 16 +++++++++ public/react/.vscode/settings.json | 3 -- public/react/src/App.js | 15 ++++++--- .../ecCompletion_calculation.js | 3 ++ .../ecCourseEvaluations.js | 3 +- .../ecCourseEvaluationsbottom.js | 5 ++- .../ec/ecCourseSupportSetting/index.js | 1 + .../ec/ecCourseSupports/ecCourseSupports.js | 5 ++- .../ecGradeEvaluations/ecGradeEvaluations.js | 2 ++ .../modules/ec/ecStudentList/ecStudentList.js | 10 ++++-- .../react/src/modules/ec/ecTitle/ecTitle.css | 2 +- .../react/src/modules/ec/ecTitle/ecTitle.js | 11 +++++-- .../GraduatesRequirement.js | 14 ++++++-- public/stylesheets/educoder/edu-all.css | 8 ++--- public/stylesheets/educoder/edu-main.css | 9 +++++ 25 files changed, 153 insertions(+), 71 deletions(-) delete mode 100644 public/react/.vscode/settings.json diff --git a/app/views/common/index.html.erb b/app/views/common/index.html.erb index 4ffc07d1..e5922129 100644 --- a/app/views/common/index.html.erb +++ b/app/views/common/index.html.erb @@ -1 +1 @@ -Educoder
    \ No newline at end of file +Educoder
    \ No newline at end of file diff --git a/app/views/ec_major_schools/_year_list.html.erb b/app/views/ec_major_schools/_year_list.html.erb index 45a85d29..1e561782 100644 --- a/app/views/ec_major_schools/_year_list.html.erb +++ b/app/views/ec_major_schools/_year_list.html.erb @@ -15,12 +15,12 @@ <%= graduation_requirements > 0 ? graduation_requirements : @btn_text %> - - <% students = year.ec_year_students.count %> - - <%= students > 0 ? students : @btn_text %> - - + + + + + + <% courses = year.ec_courses.count %> diff --git a/app/views/ec_major_schools/show.html.erb b/app/views/ec_major_schools/show.html.erb index 05b58399..c3e4c924 100644 --- a/app/views/ec_major_schools/show.html.erb +++ b/app/views/ec_major_schools/show.html.erb @@ -4,21 +4,26 @@

    -

    - <%= @major.name %> +

    @@ -31,7 +36,7 @@ 届别 培养目标 毕业要求 - 学生 + 课程体系 课程目标
    (达成情况)
    毕业要求指标点
    (达成情况)
    diff --git a/app/views/ec_years/ec_course_setting.html.erb b/app/views/ec_years/ec_course_setting.html.erb index 865d7733..9a697ba3 100644 --- a/app/views/ec_years/ec_course_setting.html.erb +++ b/app/views/ec_years/ec_course_setting.html.erb @@ -1,9 +1,10 @@
    <%= render :partial => "ecs/ec_top_navigation" %> -

    - 课程体系(<%= @ec_courses.count %>) -

    +
      +
    • 课程体系(<%= @ec_courses.count %>)
    • +

      提供模板支持课程信息导入,亦可直接新增课程;并继续完成每门课程的评估机制配置查看详情

      +

    温馨提醒:请下载课程模板(点击下载),将本届所有参与认证的课程名称导入系统,以便录入教学活动相关数据 <%= file_field_tag 'attachments[dummy][file]', diff --git a/app/views/ec_years/graduation_requirement.html.erb b/app/views/ec_years/graduation_requirement.html.erb index 955f226d..eab92924 100644 --- a/app/views/ec_years/graduation_requirement.html.erb +++ b/app/views/ec_years/graduation_requirement.html.erb @@ -10,12 +10,15 @@

    <%= render :partial => "ecs/ec_top_navigation" %>
    -

    - 毕业要求(及其指标点) +

      +
    • +

      毕业要求(及其指标点)

      +

      请结合本专业特色修改毕业要求文字描述及指标点,需完全覆盖12项通用标准查看详情

      +
    • <% if @template_major || @ec_major_school.template_major %> - <%=link_to "导出毕业要求", graduation_requirement_ec_major_school_ec_year_path(@year, :ec_major_school_id => @year.ec_major_school_id, :format => 'xls'), :class => "fr white-btn edu-blueback-btn" %> + <%=link_to "导出毕业要求", graduation_requirement_ec_major_school_ec_year_path(@year, :ec_major_school_id => @year.ec_major_school_id, :format => 'xls'), :class => "fr white-btn edu-blueback-btn mt25" %> <% end %> -

      +

    指标点 diff --git a/app/views/ec_years/requirement_vs_objective.html.erb b/app/views/ec_years/requirement_vs_objective.html.erb index ad49d552..fc5c9198 100644 --- a/app/views/ec_years/requirement_vs_objective.html.erb +++ b/app/views/ec_years/requirement_vs_objective.html.erb @@ -1,12 +1,15 @@

    <%= render :partial => "ecs/ec_top_navigation" %>
    -

    - 毕业要求对培养目标的支撑 +

      +
    • +

      毕业要求对培养目标的支撑

      +

      用矩阵图的形式说明本专业毕业要求对培养目标的支撑关系,鼠标左键单击单元格即可查看详情

      +
    • <% if @template_major || @ec_major_school.template_major %> - <%=link_to "导出矩阵", requirement_vs_objective_ec_major_school_ec_year_path(@year, :ec_major_school_id => @year.ec_major_school_id, :format => 'xls'), :class => "fr white-btn edu-blueback-btn" %> + <%=link_to "导出矩阵", requirement_vs_objective_ec_major_school_ec_year_path(@year, :ec_major_school_id => @year.ec_major_school_id, :format => 'xls'), :class => "fr white-btn edu-blueback-btn mt25" %> <% end %> -

      +

    表示支撑 diff --git a/app/views/ec_years/requirement_vs_standard.html.erb b/app/views/ec_years/requirement_vs_standard.html.erb index 90c4ecce..64acade8 100644 --- a/app/views/ec_years/requirement_vs_standard.html.erb +++ b/app/views/ec_years/requirement_vs_standard.html.erb @@ -1,12 +1,15 @@

    <%= render :partial => "ecs/ec_top_navigation" %>
    -

    - 毕业要求对通用标准的支撑 +

      +
    • +

      毕业要求对通用标准的支撑

      +

      用矩阵图的形式说明本专业毕业要求对12项通用标准的覆盖关系,鼠标左键单击单元格即可查看详情

      +
    • <% if @template_major || @ec_major_school.template_major %> - <%=link_to "导出矩阵", requirement_vs_standard_ec_major_school_ec_year_path(@year, :ec_major_school_id => @year.ec_major_school_id, :format => 'xls'), :class => "fr white-btn edu-blueback-btn" %> + <%=link_to "导出矩阵", requirement_vs_standard_ec_major_school_ec_year_path(@year, :ec_major_school_id => @year.ec_major_school_id, :format => 'xls'), :class => "fr white-btn edu-blueback-btn mt25" %> <% end %> -

      +

    表示支撑 diff --git a/app/views/ec_years/training_objectives.html.erb b/app/views/ec_years/training_objectives.html.erb index 585e8e22..fb8d860b 100644 --- a/app/views/ec_years/training_objectives.html.erb +++ b/app/views/ec_years/training_objectives.html.erb @@ -2,12 +2,15 @@ <%= render :partial => "ecs/ec_top_navigation" %>

    -

    - 培养目标 +

    <%= render :partial => "training_objective_contents" %>
    diff --git a/app/views/ecs/_ec_top_navigation.html.erb b/app/views/ecs/_ec_top_navigation.html.erb index 56583596..40f3b50e 100644 --- a/app/views/ecs/_ec_top_navigation.html.erb +++ b/app/views/ecs/_ec_top_navigation.html.erb @@ -45,12 +45,16 @@ ">4 " href="<%= requirement_vs_standard_ec_major_school_ec_year_path(@year, :ec_major_school_id => @year.ec_major_school_id) %>">毕业要求 vs 通用标准 +
  • "> + ">5 + " href="<%= student_lists_ec_major_school_ec_year_path(@year, :ec_major_school_id => @year.ec_major_school_id) %>">学生 +
  • "> - ">5 + ">6 " href="<%= ec_course_setting_ec_major_school_ec_year_path(@year, :ec_major_school_id => @year.ec_major_school_id) %>">课程体系
  • "> - ">6 + ">7 " href="<%= requirement_vs_courses_ec_major_school_ec_year_path(@year, :ec_major_school_id => @year.ec_major_school_id) %>">课程体系 vs 毕业要求
  • diff --git a/app/views/ecs/department.html.erb b/app/views/ecs/department.html.erb index d31e0726..a072094a 100644 --- a/app/views/ecs/department.html.erb +++ b/app/views/ecs/department.html.erb @@ -19,12 +19,15 @@ <% end %>
    -

    - 专业列表 +

    <%= @obj_count %> diff --git a/public/javascripts/educoder/edu_application.js b/public/javascripts/educoder/edu_application.js index 437fb319..7cce4a21 100644 --- a/public/javascripts/educoder/edu_application.js +++ b/public/javascripts/educoder/edu_application.js @@ -1229,3 +1229,19 @@ $(document).bind('ajaxError', function(event, xhr, settings) { } }); /** tpm实训开启按钮,不允许多次点击 END */ + + +//工程认证各个页面的查看详情弹层 +function elasticLayer(forumId){ + var html='
    ' + + '

    工程教育专业认证【培养目标】' + + '返回

    ' + + '
    ' + $(".newMain").after(html).hide(); + document.body.addEventListener('touchmove',bodyScroll,false); + $('body').css({'position':'fixed',"width":"100%"}); +} +function removeElasticLayer(){ + $(".layerContent").remove(); + $(".newMain").show(); +} diff --git a/public/react/.vscode/settings.json b/public/react/.vscode/settings.json deleted file mode 100644 index 0e0dcd23..00000000 --- a/public/react/.vscode/settings.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - -} \ No newline at end of file diff --git a/public/react/src/App.js b/public/react/src/App.js index d0451eaa..9c89cb1b 100644 --- a/public/react/src/App.js +++ b/public/react/src/App.js @@ -125,12 +125,13 @@ const NewContentCareerPathIndex =Loadable({ loader: () => import('./modules/careerPath/managementsCareerPath/New_Content_Career_Path_Index'), loading: Loading, }) - +{/*课程体系对毕业要求的支撑*/} const ecCourseSupports=Loadable({ loader: () => import('./modules/ec/ecCourseSupports/ecCourseSupports'), loading: Loading, }) +//课程体系 const ecCourseEvaluations=Loadable({ loader: () => import('./modules/ec/ecCourseEvaluations/ecCourseEvaluations'), loading: Loading, @@ -141,11 +142,12 @@ const ecGradeEvaluations=Loadable({ loading: Loading, }) +{/*课程目标评价方法*/} const EvaluationMethods=Loadable({ loader: () => import('./modules/ec/ecCourseEvaluations/ecCourseEvaluationsbottom'), loading: Loading, }) - +{/*达成评价详情*/} const EcCompletionCalculation=Loadable({ loader: () => import('./modules/ec/ecCompletion_calculation/ecCompletion_calculation'), loading: Loading, @@ -190,18 +192,21 @@ class App extends Component { - + {/*课程体系对毕业要求的支撑*/} + {/*课程体系*/} - + {/*达成评价详情*/} + {/*课程目标评价方法*/} + @@ -262,7 +267,7 @@ class App extends Component { - + {/*达成评价详情*/} diff --git a/public/react/src/modules/ec/ecCompletion_calculation/ecCompletion_calculation.js b/public/react/src/modules/ec/ecCompletion_calculation/ecCompletion_calculation.js index 01506142..f76e065d 100644 --- a/public/react/src/modules/ec/ecCompletion_calculation/ecCompletion_calculation.js +++ b/public/react/src/modules/ec/ecCompletion_calculation/ecCompletion_calculation.js @@ -432,6 +432,7 @@ class EcCompletionCalculation extends Component {
    课程体系 > {schooldata.ec_course_name} 达成评价详情 {/* 导出培养目标 */} +
    系统根据课程目标、课程考核方式与课程目标评价方法,一键计算评价课程目标的达成情况 window.elasticLayer(3533)}>查看详情
    +
    课程体系 > {schooldata.ec_course_name} +
    请结合本课程的教学情况,修改考核方式、并导入学生的对应考核成绩 window.elasticLayer(3533)}>查看详情
    {/*课程考核方式与数据来源*/} {/* */} {/* 导出培养目标 */} diff --git a/public/react/src/modules/ec/ecCourseEvaluations/ecCourseEvaluationsbottom.js b/public/react/src/modules/ec/ecCourseEvaluations/ecCourseEvaluationsbottom.js index 4f04349f..ac80021d 100644 --- a/public/react/src/modules/ec/ecCourseEvaluations/ecCourseEvaluationsbottom.js +++ b/public/react/src/modules/ec/ecCourseEvaluations/ecCourseEvaluationsbottom.js @@ -703,6 +703,7 @@ class EcCourseEvaluationsbottom extends Component { {/*
    */} @@ -712,7 +713,9 @@ class EcCourseEvaluationsbottom extends Component {

    课程体系 > {schooldata.ec_course_name} - {/*课程考核方式与数据来源*/} +

    请结合本课程的教学情况,修改说明每个课程目标的评价环节和评估方式 window.elasticLayer(3533)}>查看详情
    + + {/*课程考核方式与数据来源*/} {/* */} {/* 导出培养目标 */} diff --git a/public/react/src/modules/ec/ecCourseSupportSetting/index.js b/public/react/src/modules/ec/ecCourseSupportSetting/index.js index ee18e430..82eec19e 100644 --- a/public/react/src/modules/ec/ecCourseSupportSetting/index.js +++ b/public/react/src/modules/ec/ecCourseSupportSetting/index.js @@ -245,6 +245,7 @@ class EcCourseSupportSetting extends Component {
    - 课程体系对毕业要求的支撑 + 课程体系对毕业要求的支撑 {/* 导出培养目标 */} 导出课程体系支撑矩阵 +
    用矩阵图的形式说明本专业课程体系对毕业要求的支撑关系 window.elasticLayer(3534)} >查看详情
    +
    毕业要求指标点({data.subitems_count} diff --git a/public/react/src/modules/ec/ecGradeEvaluations/ecGradeEvaluations.js b/public/react/src/modules/ec/ecGradeEvaluations/ecGradeEvaluations.js index c8598e94..6ae818d9 100644 --- a/public/react/src/modules/ec/ecGradeEvaluations/ecGradeEvaluations.js +++ b/public/react/src/modules/ec/ecGradeEvaluations/ecGradeEvaluations.js @@ -262,6 +262,7 @@ class ecGradeEvaluations extends Component {
    @@ -271,6 +272,7 @@ class ecGradeEvaluations extends Component {

    课程体系 > {schooldata.ec_course_name} + {/*课程考核方式与数据来源*/} {/* */} {/* 导出培养目标 */} diff --git a/public/react/src/modules/ec/ecStudentList/ecStudentList.js b/public/react/src/modules/ec/ecStudentList/ecStudentList.js index 63a56b43..911ee1c2 100644 --- a/public/react/src/modules/ec/ecStudentList/ecStudentList.js +++ b/public/react/src/modules/ec/ecStudentList/ecStudentList.js @@ -23,6 +23,7 @@ class ecStudentList extends Component { schooldata:{}, majorschoollist:undefined, titlemessage:"提示", + ecComponentState:"ecStudentList", visible:false, Modallist:'', Modallisttypes:0, @@ -318,8 +319,9 @@ class ecStudentList extends Component {

    学生列表 @@ -329,9 +331,11 @@ class ecStudentList extends Component {
    学生列表( + className=" font-18 courseSystem">学生列表( {majorschoollist===undefined?"":majorschoollist.total_student} - )
    + ) +
    提供模板支持导入学生信息(请先下载模板) window.elasticLayer(3533)}>查看详情
    +
    {ismanager===false?"": diff --git a/public/react/src/modules/ec/ecTitle/ecTitle.css b/public/react/src/modules/ec/ecTitle/ecTitle.css index 332e6142..c6e612bc 100644 --- a/public/react/src/modules/ec/ecTitle/ecTitle.css +++ b/public/react/src/modules/ec/ecTitle/ecTitle.css @@ -21,7 +21,7 @@ margin-right: 10px; } #traningNav>li>.ecTitles { - line-height: 18px !important; + line-height: 16px !important; } #traningNav>li>.ecTitlefont:hover{ diff --git a/public/react/src/modules/ec/ecTitle/ecTitle.js b/public/react/src/modules/ec/ecTitle/ecTitle.js index 0c6d4e7d..21aec303 100644 --- a/public/react/src/modules/ec/ecTitle/ecTitle.js +++ b/public/react/src/modules/ec/ecTitle/ecTitle.js @@ -21,6 +21,7 @@ class EcTitleCourseEvaluations extends Component { render() { let{schooldata,ecComponentState,ecpaths}=this.state; + return (
    @@ -49,16 +50,20 @@ class EcTitleCourseEvaluations extends Component { 4 毕业要求 vs 通用标准
  • +
  • + 5 + 学生 +
  • - 5 + 6 课程体系
  • - 6 + 7 课程体系 vs 毕业要求
  • - 7 + 8 达成度评价结果
  • {/*
  • */} diff --git a/public/react/src/modules/ec/graduatesRequirement/GraduatesRequirement.js b/public/react/src/modules/ec/graduatesRequirement/GraduatesRequirement.js index 00b72e1e..95545d85 100644 --- a/public/react/src/modules/ec/graduatesRequirement/GraduatesRequirement.js +++ b/public/react/src/modules/ec/graduatesRequirement/GraduatesRequirement.js @@ -599,16 +599,24 @@ class GraduatesRequirement extends Component {
  • +

    毕业要求指标点达成计算

    +

    + 系统根据课程体系与毕业要求的支持关系,以课程的考核与成绩判定方式,一键计算毕业要求的达成度情况 + window.elasticLayer(3530)} class="color-blue">查看详情 +

    + +
  • +

    diff --git a/public/stylesheets/educoder/edu-all.css b/public/stylesheets/educoder/edu-all.css index 18438c02..86d852de 100644 --- a/public/stylesheets/educoder/edu-all.css +++ b/public/stylesheets/educoder/edu-all.css @@ -3089,17 +3089,17 @@ a.singlepublishtwo{ .MajorName > i:hover{color: #4CACFF} /*培养目标*/ #traningNav{margin-bottom: 0px!important;} -#traningNav>li{float: left;padding:0px 30px 30px 30px;font-size: 16px;} +#traningNav>li{float: left;padding:0px 30px 30px 30px;font-size: 15px;} #traningNav>li>a,#traningNav li>i{color: #666!important;position: relative} #traningNav>li.active > a,#traningNav li.active > i{color: #05101A!important;} #traningNav>li.active > a:after{content: '';position: absolute;width: 64px;left: 50%;margin-left: -32px;height: 2px;background-color: #05101A;bottom: -35px;} -#traningNav>li>.ecTitle {width: 20px;height: 20px;border: 1px solid rgba(65, 140, 205, 1);border-radius: 50%;text-align: center; -line-height: 20px;display: inline-block;color: rgba(65, 140, 205, 1) !important;margin-right: 8px;} +#traningNav>li>.ecTitle {width: 16px;height: 16px;border: 1px solid rgba(65, 140, 205, 1);border-radius: 50%;text-align: center; +line-height: 16px;display: inline-block;color: rgba(65, 140, 205, 1) !important;margin-right: 8px;font-size: 12px} #traningNav>li>.ecTitlefont:hover{color: rgba(65, 140, 205, 1) !important;} .ecimgs{height: 90px;line-height: 90px;box-sizing: border-box;} #traningNav>li>.ecTitlefontFFF{color:#fff!important;} -#traningNav>li>.ecTitleFFF {width: 20px;height: 20px;border: 1px solid #fff;border-radius: 50%;text-align: center;line-height: 20px; +#traningNav>li>.ecTitleFFF {width: 16px;height: 16px;border: 1px solid #fff;border-radius: 50%;text-align: center;line-height: 16px;font-size: 12px; display: inline-block;color: #fff !important;margin-right: 8px;} .traningNavs>li {padding: 0px 10px 30px 12px !important;} .ecimgs1{background: url("/images/educoder/auth/1.png");background-repeat: no-repeat;background-size: 100% 100%;-moz-background-size: 100% 100%; diff --git a/public/stylesheets/educoder/edu-main.css b/public/stylesheets/educoder/edu-main.css index d48700a3..266f9b7f 100644 --- a/public/stylesheets/educoder/edu-main.css +++ b/public/stylesheets/educoder/edu-main.css @@ -903,4 +903,13 @@ html>body #ajax-indicator { position: fixed; } margin-left: 20px; text-indent: 25px; min-height: 100px; +} + + +/*工程认证 各页面公用弹层*/ +.layerContent{ + margin: 0 auto; + padding-bottom: 235px; + min-width: 1200px; + padding-top: 60px; } \ No newline at end of file From b6953aa0388aa5e0b42e4d8dd1307c45b1eec4e5 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, 24 May 2019 15:06:23 +0800 Subject: [PATCH 17/67] b --- app/views/common/index.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/common/index.html.erb b/app/views/common/index.html.erb index e102dde8..c17304a5 100644 --- a/app/views/common/index.html.erb +++ b/app/views/common/index.html.erb @@ -1 +1 @@ -Educoder

    \ No newline at end of file +Educoder
    \ No newline at end of file From a339b3c4298582b4af3ea45a6e6eb65fde3c0df7 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, 24 May 2019 15:14:36 +0800 Subject: [PATCH 18/67] =?UTF-8?q?=E6=81=A2=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gemfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index 9c18050b..7909cb17 100644 --- a/Gemfile +++ b/Gemfile @@ -63,8 +63,8 @@ gem 'elasticsearch-rails' gem 'oauth2' # xlsx -# gem 'axlsx', '3.0.0.pre' -# gem 'axlsx_rails', '0.3.0' +gem 'axlsx', '3.0.0.pre' +gem 'axlsx_rails', '0.3.0' #Ruby 2.2+ has removed test/unit from the core library. if RUBY_VERSION>='2.2' From 98ce08d3c7de8fd44e1e64a5c8ac83dae90f0d9e Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 24 May 2019 15:26:13 +0800 Subject: [PATCH 19/67] =?UTF-8?q?ec=20=E5=BC=B9=E5=87=BA=E5=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../javascripts/educoder/edu_application.js | 46 +++++++++++++++++-- public/react/public/index.html | 2 + .../GraduatesRequirement.js | 2 +- 3 files changed, 44 insertions(+), 6 deletions(-) diff --git a/public/javascripts/educoder/edu_application.js b/public/javascripts/educoder/edu_application.js index 7cce4a21..f1caa2c5 100644 --- a/public/javascripts/educoder/edu_application.js +++ b/public/javascripts/educoder/edu_application.js @@ -1233,15 +1233,51 @@ $(document).bind('ajaxError', function(event, xhr, settings) { //工程认证各个页面的查看详情弹层 function elasticLayer(forumId){ + if (window.__memo) { + doElasticLayer(window.__memo, true) + return; + } + if (!forumId) return; + var url = 'https://www.educoder.net/api/v1/memos/' + forumId + $.ajax({ + url: url, + type: 'get', + success: function(res) { + console.log(res) + doElasticLayer(res.memo) + } + }); + + // document.body.addEventListener('touchmove',bodyScroll,false); + // $('body').css({'position':'fixed',"width":"100%"}); +} +function doElasticLayer(memo, rendered){ + if (rendered) { + $(".layerContent").show(); + $(".newMain").hide(); + return; + } + window.__memo = memo + var content = memo.content + var subject = memo.subject var html='
    ' + - '

    工程教育专业认证【培养目标】' + + '

    '+ subject +'' + '返回

    ' + - '
    ' + '
    ' + $(".newMain").after(html).hide(); - document.body.addEventListener('touchmove',bodyScroll,false); - $('body').css({'position':'fixed',"width":"100%"}); + + editormd.markdownToHTML("MDContent", { + htmlDecode: "style,script,iframe", // you can filter tags decode + taskList: true, + tex: true, // 默认不解析 + flowChart: true, // 默认不解析 + sequenceDiagram: true // 默认不解析 + }); } function removeElasticLayer(){ - $(".layerContent").remove(); + $(".layerContent").hide(); $(".newMain").show(); } diff --git a/public/react/public/index.html b/public/react/public/index.html index 71088e5f..e1f4976e 100644 --- a/public/react/public/index.html +++ b/public/react/public/index.html @@ -107,7 +107,9 @@ + + diff --git a/public/react/src/modules/ec/graduatesRequirement/GraduatesRequirement.js b/public/react/src/modules/ec/graduatesRequirement/GraduatesRequirement.js index a62849f1..ba063757 100644 --- a/public/react/src/modules/ec/graduatesRequirement/GraduatesRequirement.js +++ b/public/react/src/modules/ec/graduatesRequirement/GraduatesRequirement.js @@ -611,7 +611,7 @@ class GraduatesRequirement extends Component {

    毕业要求指标点达成计算

    系统根据课程体系与毕业要求的支持关系,以课程的考核与成绩判定方式,一键计算毕业要求的达成度情况 - window.elasticLayer(3530)} class="color-blue">查看详情 + window.elasticLayer(3535)} class="color-blue">查看详情

    From d5e334738f2d777392d0af3220088c5dbe603ea3 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, 24 May 2019 15:26:37 +0800 Subject: [PATCH 20/67] b --- app/views/common/index.html.erb | 2 +- public/react/src/modules/ec/ecTitle/ecTitle.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/common/index.html.erb b/app/views/common/index.html.erb index c17304a5..758b03a5 100644 --- a/app/views/common/index.html.erb +++ b/app/views/common/index.html.erb @@ -1 +1 @@ -Educoder
    \ No newline at end of file +Educoder
    \ No newline at end of file diff --git a/public/react/src/modules/ec/ecTitle/ecTitle.js b/public/react/src/modules/ec/ecTitle/ecTitle.js index 21aec303..16d40c80 100644 --- a/public/react/src/modules/ec/ecTitle/ecTitle.js +++ b/public/react/src/modules/ec/ecTitle/ecTitle.js @@ -50,9 +50,9 @@ class EcTitleCourseEvaluations extends Component { 4 毕业要求 vs 通用标准 -
  • - 5 - 学生 +
  • + 5 + 学生
  • 6 From 436571090a3fb4ef9497852fcad8de89bdb11f37 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, 24 May 2019 15:33:02 +0800 Subject: [PATCH 21/67] b --- app/views/common/index.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/common/index.html.erb b/app/views/common/index.html.erb index 758b03a5..dd2b9cbf 100644 --- a/app/views/common/index.html.erb +++ b/app/views/common/index.html.erb @@ -1 +1 @@ -Educoder
    \ No newline at end of file +Educoder
    \ No newline at end of file From 7efe78c83a16b4f985982d658ae588ba46053c5b Mon Sep 17 00:00:00 2001 From: p31729568 Date: Fri, 24 May 2019 15:42:24 +0800 Subject: [PATCH 22/67] fix copy ec year --- app/services/copy_ec_year_service.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/services/copy_ec_year_service.rb b/app/services/copy_ec_year_service.rb index 83073d53..7ad46c5f 100644 --- a/app/services/copy_ec_year_service.rb +++ b/app/services/copy_ec_year_service.rb @@ -197,7 +197,7 @@ def copy_graduation_subitem_course_targets!(target, to_target) target.ec_graduation_subitem_course_targets.each do |support| to_support = to_target.ec_graduation_subitem_course_targets.new - to_support.attributes = support.attributes.except('id', 'ec_graduation_subitem_id', 'created_at', 'updated_at') + to_support.attributes = support.attributes.except('id', 'ec_course_target_id', 'ec_graduation_subitem_id', 'created_at', 'updated_at') to_support.ec_graduation_subitem_id = graduation_subitem_map[support.ec_graduation_subitem_id] to_support.save! end From 9d00433565a526e4fca2a647d1d2ef8b271fffad Mon Sep 17 00:00:00 2001 From: p31729568 Date: Fri, 24 May 2019 15:51:00 +0800 Subject: [PATCH 23/67] add students_url to get nav api --- app/controllers/ec_major_schools_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/ec_major_schools_controller.rb b/app/controllers/ec_major_schools_controller.rb index 236f57d5..c47899f6 100644 --- a/app/controllers/ec_major_schools_controller.rb +++ b/app/controllers/ec_major_schools_controller.rb @@ -122,6 +122,7 @@ class EcMajorSchoolsController < ApplicationController requirement_vs_objective_url: "#{requirement_vs_objective_ec_major_school_ec_year_path(@year, :ec_major_school_id => @year.ec_major_school_id)}", requirement_vs_standard: "#{requirement_vs_standard_ec_major_school_ec_year_path(@year, :ec_major_school_id => @year.ec_major_school_id)}", requirement_vs_courses: "#{requirement_vs_courses_ec_major_school_ec_year_path(@year, :ec_major_school_id => @year.ec_major_school_id)}", + students_url: student_lists_ec_major_schools_ec_years_path(@year, ec_major_school_id: @year.ec_major_school_id), go_back_url: ec_major_school_path(major), ec_course_support_setting_url: ec_course_support_setting_url, ec_course_reach_setting_url: ec_course_reach_setting_url, From a49385f0734684c24473b3e5a42913165a739912 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, 24 May 2019 15:57:23 +0800 Subject: [PATCH 24/67] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gemfile | 4 ++-- .../ecCourseEvaluations.js | 23 +++++++++++++++---- .../react/src/modules/ec/ecTitle/ecTitle.js | 2 +- 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/Gemfile b/Gemfile index 7909cb17..11029470 100644 --- a/Gemfile +++ b/Gemfile @@ -63,8 +63,8 @@ gem 'elasticsearch-rails' gem 'oauth2' # xlsx -gem 'axlsx', '3.0.0.pre' -gem 'axlsx_rails', '0.3.0' +#gem 'axlsx', '3.0.0.pre' +#gem 'axlsx_rails', '0.3.0' #Ruby 2.2+ has removed test/unit from the core library. if RUBY_VERSION>='2.2' diff --git a/public/react/src/modules/ec/ecCourseEvaluations/ecCourseEvaluations.js b/public/react/src/modules/ec/ecCourseEvaluations/ecCourseEvaluations.js index c3e7a57a..0d2ec519 100644 --- a/public/react/src/modules/ec/ecCourseEvaluations/ecCourseEvaluations.js +++ b/public/react/src/modules/ec/ecCourseEvaluations/ecCourseEvaluations.js @@ -870,15 +870,28 @@ class ecCourseEvaluations extends Component {

    课程体系 > {schooldata.ec_course_name} + +

    +
    请结合本课程的教学情况,修改考核方式、并导入学生的对应考核成绩 window.elasticLayer(3533)}>查看详情
    {/*课程考核方式与数据来源*/} {/* */} {/* 导出培养目标 */} - 关联课堂 - 取消关联 - - 导出考核方法 - + +

    diff --git a/public/react/src/modules/ec/ecTitle/ecTitle.js b/public/react/src/modules/ec/ecTitle/ecTitle.js index 16d40c80..f2440901 100644 --- a/public/react/src/modules/ec/ecTitle/ecTitle.js +++ b/public/react/src/modules/ec/ecTitle/ecTitle.js @@ -52,7 +52,7 @@ class EcTitleCourseEvaluations extends Component {
  • 5 - 学生 + 学生
  • 6 From 740e4d88c430a71ed690ec0eec329ec571844313 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Fri, 24 May 2019 15:58:35 +0800 Subject: [PATCH 25/67] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E5=9D=97=E9=87=8C=E6=9C=89=E6=B2=A1=E6=9C=89=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E7=9A=84=E5=8F=AF=E8=83=BD=EF=BC=8C=E9=9C=80=E8=A6=81=E5=9B=BA?= =?UTF-8?q?=E5=AE=9A=E9=AB=98=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/stylesheets/educoder/edu-all.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/stylesheets/educoder/edu-all.css b/public/stylesheets/educoder/edu-all.css index 86d852de..3da912bb 100644 --- a/public/stylesheets/educoder/edu-all.css +++ b/public/stylesheets/educoder/edu-all.css @@ -74,7 +74,7 @@ em.vertical-line{display: inline-block;width: 2px;background: #999;height: 10px} .moreitem{position: absolute;right: 5px;top:35px;height: 15px;color:#656565} /*块状列表*/ .square-list{width: 100%;box-sizing: border-box;margin-top:20px} -.square-Item{position: relative;width:280px;margin-right: 26px;margin-bottom: 26px;float: left;border-radius: 6px;background-color:#fff;box-shadow: 0px 0px 12px rgba(0,0,0,0.1); } +.square-Item{position: relative;width:280px;margin-right: 26px;margin-bottom: 26px;float: left;border-radius: 6px;background-color:#fff;box-shadow: 0px 0px 12px rgba(0,0,0,0.1); height: 301px;} .square-Item:hover{bottom: 3px; box-shadow: 0px 0px 12px rgba(0,0,0,0.3);} .square-Item:hover .closeSquare{display: block} .square-Item:nth-child(4n+0){margin-right: 0px;} From e38e35c72b83d6aff13cbdec1acb3259a68cdbb6 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, 24 May 2019 16:00:43 +0800 Subject: [PATCH 26/67] b --- app/views/common/index.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/common/index.html.erb b/app/views/common/index.html.erb index dd2b9cbf..82b976cb 100644 --- a/app/views/common/index.html.erb +++ b/app/views/common/index.html.erb @@ -1 +1 @@ -Educoder
    \ No newline at end of file +Educoder
    \ No newline at end of file From 8b42018d40b20c391b1eaa4b5f55c1c76a58c396 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Fri, 24 May 2019 16:13:06 +0800 Subject: [PATCH 27/67] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E5=8F=B3=E4=BE=A7=E6=95=99=E5=AD=A6=E5=9B=A2=E9=98=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/subjects/_subject_members.html.erb | 59 ++++++++++---------- 1 file changed, 29 insertions(+), 30 deletions(-) diff --git a/app/views/subjects/_subject_members.html.erb b/app/views/subjects/_subject_members.html.erb index 87c518c7..b2665099 100644 --- a/app/views/subjects/_subject_members.html.erb +++ b/app/views/subjects/_subject_members.html.erb @@ -4,48 +4,47 @@
    -

    +

    <%= image_tag(url_to_avatar(member.user), :width =>"80", :height => "80", :class => "radius", :alt=>"头像") %> +
    +

    <%= member.user.try(:show_name) %>

    +
    +

    + + <%= member.user.identity == "学生" ? "" : member.user.identity %> +

    + +
    +
    - + - + <% if User.current.admin? && member.role != 1 %> + + + + <% end %> - <% if User.current.admin? && member.role != 1 %> - - - - <% end %> + <% if User.current.member_of_subject?(@subject) && member.position > 1 %> + + + + <% end %> - <% if User.current.member_of_subject?(@subject) && member.position > 1 %> - - - - <% end %> + <% if User.current.member_of_subject?(@subject) && member.position < @subject.subject_members.size %> + + + + <% end %> - <% if User.current.member_of_subject?(@subject) && member.position < @subject.subject_members.size %> - - - - <% end %> + - +
    -

    -
    -

    <%= member.user.try(:show_name) %>

    -
    -

    - - <%= member.user.identity == "学生" ? "" : member.user.identity %> -

    - -
    -
    <% end %> <% end %> \ No newline at end of file From 5885568599a4312df918ad8bf0bfad91aacbb5d1 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 24 May 2019 16:22:09 +0800 Subject: [PATCH 28/67] =?UTF-8?q?=E7=BC=A9=E8=BF=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/page/MainContent.js | 98 ++++++++++---------- 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/public/react/src/modules/page/MainContent.js b/public/react/src/modules/page/MainContent.js index ff9f753d..f5f66abf 100644 --- a/public/react/src/modules/page/MainContent.js +++ b/public/react/src/modules/page/MainContent.js @@ -74,55 +74,55 @@ class MainContent extends Component {
  • */}
    -
    -
    -
    -
    - - {/* 选择题或编程题 */} - {/* readRepoTimeout 如果读取代码超时,显示重新加载按钮,重新拉取代码 */} - { - st === 0 - ? - readRepoTimeout === true ? : - - -
    - -
    -
    - : - } - - {/* */} -
    -
    - {/*
    */} -
    -
    - {/* 测试结果、评测信息区域 */} - { loading ? - : - st === 0 - ? - : - } -
    -
    -
    -
    -
    - -
    - -
    +
    +
    +
    +
    + + {/* 选择题或编程题 */} + {/* readRepoTimeout 如果读取代码超时,显示重新加载按钮,重新拉取代码 */} + { + st === 0 + ? + readRepoTimeout === true ? : + + +
    + +
    +
    + : + } + + {/* */} +
    +
    + {/*
    */} +
    +
    + {/* 测试结果、评测信息区域 */} + { loading ? + : + st === 0 + ? + : + } +
    +
    +
    +
    +
    + +
    + +
    From e5e9b1a04b1bc2518b04c0054f6c0151a4af9d97 Mon Sep 17 00:00:00 2001 From: p31729568 Date: Fri, 24 May 2019 16:54:37 +0800 Subject: [PATCH 29/67] fix get nav data api --- app/controllers/ec_major_schools_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/ec_major_schools_controller.rb b/app/controllers/ec_major_schools_controller.rb index c47899f6..445ce70f 100644 --- a/app/controllers/ec_major_schools_controller.rb +++ b/app/controllers/ec_major_schools_controller.rb @@ -122,7 +122,7 @@ class EcMajorSchoolsController < ApplicationController requirement_vs_objective_url: "#{requirement_vs_objective_ec_major_school_ec_year_path(@year, :ec_major_school_id => @year.ec_major_school_id)}", requirement_vs_standard: "#{requirement_vs_standard_ec_major_school_ec_year_path(@year, :ec_major_school_id => @year.ec_major_school_id)}", requirement_vs_courses: "#{requirement_vs_courses_ec_major_school_ec_year_path(@year, :ec_major_school_id => @year.ec_major_school_id)}", - students_url: student_lists_ec_major_schools_ec_years_path(@year, ec_major_school_id: @year.ec_major_school_id), + students_url: student_lists_ec_major_school_ec_year_path(@year, ec_major_school_id: @year.ec_major_school_id), go_back_url: ec_major_school_path(major), ec_course_support_setting_url: ec_course_support_setting_url, ec_course_reach_setting_url: ec_course_reach_setting_url, From 165dd898d45b6d334ae909903d7424c1d17e4316 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 24 May 2019 17:03:41 +0800 Subject: [PATCH 30/67] showIframeContent --- public/react/src/modules/page/MainContent.js | 31 ++++++++++++++++---- 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/public/react/src/modules/page/MainContent.js b/public/react/src/modules/page/MainContent.js index f5f66abf..b0f8c593 100644 --- a/public/react/src/modules/page/MainContent.js +++ b/public/react/src/modules/page/MainContent.js @@ -17,14 +17,17 @@ import Button from 'material-ui/Button'; import './tpiPage.css'; import './tpiPageForMobile.css'; const $ = window.$; +const showIframeContent = window.location.search.indexOf('enc=1') != -1; class MainContent extends Component { componentDidMount() { // ios下图标位置有问题 - setTimeout(()=>{ - if (window.$('.b-label>.resize-helper').position().top < 100) { - window.$('.b-label>.resize-helper').css('top', '200px') - } - }, 4000) + if (!showIframeContent) { + setTimeout(()=>{ + if (window.$('.b-label>.resize-helper').position().top < 100) { + window.$('.b-label>.resize-helper').css('top', '200px') + } + }, 4000) + } $("body").css("padding-right","0px!important") } onResizeButtonClick = () => { @@ -45,7 +48,6 @@ class MainContent extends Component { } else { games_repository_contents_style = {overflow: 'hidden', height: '445px'} } - return (
    @@ -65,6 +67,21 @@ class MainContent extends Component {
    + {/* + iframe模式下需要这两个样式来调整 + .page--body { z-index: 9999; } + .resize-helper { top: 10px } + */} + + { showIframeContent ? : + {/* 旧版本、评测等待提示--更新提示块*/} {/*
    @@ -123,6 +140,8 @@ class MainContent extends Component {
    + + }
    From cfed9da95e023e69e72878307f7edf987cd0024a Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 24 May 2019 17:11:40 +0800 Subject: [PATCH 31/67] b --- app/views/common/index.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/common/index.html.erb b/app/views/common/index.html.erb index 82b976cb..6e2b93b5 100644 --- a/app/views/common/index.html.erb +++ b/app/views/common/index.html.erb @@ -1 +1 @@ -Educoder
    \ No newline at end of file +Educoder
    \ No newline at end of file From fb353c39ab1658d562658a8c8d4053d20b24e4d9 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 24 May 2019 17:22:36 +0800 Subject: [PATCH 32/67] vnc --- public/react/src/modules/page/MainContent.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/page/MainContent.js b/public/react/src/modules/page/MainContent.js index b0f8c593..9f4b9fd4 100644 --- a/public/react/src/modules/page/MainContent.js +++ b/public/react/src/modules/page/MainContent.js @@ -17,7 +17,7 @@ import Button from 'material-ui/Button'; import './tpiPage.css'; import './tpiPageForMobile.css'; const $ = window.$; -const showIframeContent = window.location.search.indexOf('enc=1') != -1; +const showIframeContent = window.location.search.indexOf('vnc=1') != -1; class MainContent extends Component { componentDidMount() { // ios下图标位置有问题 From 38fe8a2f9e453dc495f693cec397e6bf0d47581c Mon Sep 17 00:00:00 2001 From: p31729568 Date: Fri, 24 May 2019 17:29:54 +0800 Subject: [PATCH 33/67] fix copy ec year issue --- app/services/copy_ec_year_service.rb | 41 ++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/app/services/copy_ec_year_service.rb b/app/services/copy_ec_year_service.rb index 7ad46c5f..cbbcd5f1 100644 --- a/app/services/copy_ec_year_service.rb +++ b/app/services/copy_ec_year_service.rb @@ -226,6 +226,8 @@ to_relate.ec_course_target_id = course_target_map[relate.ec_course_target_id] to_relate.ec_course_evaluation_subitem_id = course_target_map[relate.ec_course_evaluation_subitem_id] to_relate.save! + + achievement_evaluation_relates_map[relate.id] = to_relate.id end end @@ -258,14 +260,16 @@ end def copy_year_students! - students = from_year.ec_year_students.includes(:ec_student_achievements) + students = from_year.ec_year_students.includes(:ec_student_achievements, :ec_course_student_scores, :ec_student_score_targets) students.each do |student| to_student = to_year.ec_year_students.new - to_student.attributes = student.attributes.except('id', 'ec_year_id', 'created_at', 'updated') + to_student.attributes = student.attributes.except('id', 'ec_year_id', 'created_at', 'updated_at') to_student.save! copy_student_achievements!(student, to_student) + copy_course_student_scores!(student, to_student) + copy_student_score_targets!(student, to_student) end end @@ -280,6 +284,31 @@ end end + def copy_course_student_scores!(student, to_student) + student.ec_course_student_scores.each do |score| + to_score = to_student.ec_course_student_scores.new + to_score.attributes = score.attributes.except('id', 'ec_year_student_id', 'ec_course_id', 'created_at', 'updated_at') + to_score.ec_course_id = course_map[score.ec_course_id] + to_score.save! + + course_student_score_map[score.id] = to_score.id + end + end + + def copy_student_score_targets!(student, to_student) + student.ec_student_score_targets.each do |target| + to_target = to_student.ec_student_score_targets.new + to_target.attributes = target.attributes.except('id', 'ec_course_id', 'ec_course_student_score_id', + 'ec_course_target_id', 'ec_year_student_id', 'eaer_id', + 'created_at', 'updated_at') + to_target.ec_course_id = course_map[target.ec_course_id] + to_target.ec_course_student_score_id = course_student_score_map[target.ec_course_student_score_id] + to_target.ec_course_target_id = course_target_map[target.ec_course_target_id] + to_target.eaer_id = achievement_evaluation_relates_map[target.eaer_id] + to_target.save! + end + end + def graduation_requirement_map @_graduation_requirement_map ||= {} end @@ -300,7 +329,15 @@ @_course_evaluation_subitem_map ||= {} end + def achievement_evaluation_relates_map + @_achievement_evaluation_relates_map ||= {} + end + def course_target_map @_course_target_map ||= {} end + + def course_student_score_map + @_course_student_score_map ||= {} + end end \ No newline at end of file From 9f88f9bf3743943b7da8b506eefc072fa1f9ac9c Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 24 May 2019 17:40:42 +0800 Subject: [PATCH 34/67] https --- public/react/src/modules/page/MainContent.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/page/MainContent.js b/public/react/src/modules/page/MainContent.js index 9f4b9fd4..afd0d2d9 100644 --- a/public/react/src/modules/page/MainContent.js +++ b/public/react/src/modules/page/MainContent.js @@ -80,7 +80,7 @@ class MainContent extends Component { .page--body { z-index: ${showIframeContent ? '9999': '1'} ; } .b-label>.resize-helper { top: ${showIframeContent ? '10px': '50%'} } `} - { showIframeContent ? : + { showIframeContent ? : {/* 旧版本、评测等待提示--更新提示块*/} {/*
    From f2bde62acddeeaa8c231daa18dc7f8cf80651670 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 24 May 2019 18:03:17 +0800 Subject: [PATCH 35/67] md --- app/views/layouts/base_ec.html.erb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/views/layouts/base_ec.html.erb b/app/views/layouts/base_ec.html.erb index 0e1c6279..d8c45746 100644 --- a/app/views/layouts/base_ec.html.erb +++ b/app/views/layouts/base_ec.html.erb @@ -9,7 +9,9 @@ <%= favicon %> <%= javascript_heads %> <%= heads_for_theme %> - <%= javascript_include_tag 'educoder/edu_application', 'educoder/edu_shixun','educoder/edu_shixunCommentsStar','educoder/jquery.raty' %> + <%= stylesheet_link_tag "/assets/codemirror/codemirror" %> + <%= stylesheet_link_tag '/editormd/css/editormd.min.css' %> + <%= javascript_include_tag 'educoder/edu_application', 'educoder/edu_shixun','educoder/edu_shixunCommentsStar','educoder/jquery.raty', '/editormd/editormd.min.js' %> <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/edu-popup','css/edu-common','educoder/edu-main','educoder/edu-all', "css/edu-public", 'css/ketang', 'css/common', 'css/taskstyle', 'css/structure','scm','css/public', 'css/project','css/popup','repository','css/gantt', 'css/calendar', 'css/moduel', 'css/font-awesome', 'css/edu-tooltipster', 'educoder/magic-check','/assets/iconfont/iconfont.css' %> <%= call_hook :view_layouts_base_html_head %> From add56f399bec74970e10edb6b824f7ab43512572 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 24 May 2019 18:05:30 +0800 Subject: [PATCH 36/67] md --- app/views/layouts/base_ec.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/layouts/base_ec.html.erb b/app/views/layouts/base_ec.html.erb index d8c45746..306d3785 100644 --- a/app/views/layouts/base_ec.html.erb +++ b/app/views/layouts/base_ec.html.erb @@ -11,7 +11,7 @@ <%= heads_for_theme %> <%= stylesheet_link_tag "/assets/codemirror/codemirror" %> <%= stylesheet_link_tag '/editormd/css/editormd.min.css' %> - <%= javascript_include_tag 'educoder/edu_application', 'educoder/edu_shixun','educoder/edu_shixunCommentsStar','educoder/jquery.raty', '/editormd/editormd.min.js' %> + <%= javascript_include_tag 'educoder/edu_application', 'educoder/edu_shixun','educoder/edu_shixunCommentsStar','educoder/jquery.raty', '/editormd/editormd.min.js', '/editormd/lib/marked.min.js' %> <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/edu-popup','css/edu-common','educoder/edu-main','educoder/edu-all', "css/edu-public", 'css/ketang', 'css/common', 'css/taskstyle', 'css/structure','scm','css/public', 'css/project','css/popup','repository','css/gantt', 'css/calendar', 'css/moduel', 'css/font-awesome', 'css/edu-tooltipster', 'educoder/magic-check','/assets/iconfont/iconfont.css' %> <%= call_hook :view_layouts_base_html_head %> From 78a2cfb0440eb2f419c67bc113ae63db27f945f6 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 24 May 2019 18:07:31 +0800 Subject: [PATCH 37/67] md --- app/views/layouts/base_ec.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/layouts/base_ec.html.erb b/app/views/layouts/base_ec.html.erb index 306d3785..756d1706 100644 --- a/app/views/layouts/base_ec.html.erb +++ b/app/views/layouts/base_ec.html.erb @@ -11,7 +11,7 @@ <%= heads_for_theme %> <%= stylesheet_link_tag "/assets/codemirror/codemirror" %> <%= stylesheet_link_tag '/editormd/css/editormd.min.css' %> - <%= javascript_include_tag 'educoder/edu_application', 'educoder/edu_shixun','educoder/edu_shixunCommentsStar','educoder/jquery.raty', '/editormd/editormd.min.js', '/editormd/lib/marked.min.js' %> + <%= javascript_include_tag 'educoder/edu_application', 'educoder/edu_shixun','educoder/edu_shixunCommentsStar','educoder/jquery.raty', '/editormd/editormd.min.js', '/editormd/lib/marked.min.js', '/editormd/lib/flowchart.min.js', '/editormd/lib/jquery.flowchart.min.js' %> <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/edu-popup','css/edu-common','educoder/edu-main','educoder/edu-all', "css/edu-public", 'css/ketang', 'css/common', 'css/taskstyle', 'css/structure','scm','css/public', 'css/project','css/popup','repository','css/gantt', 'css/calendar', 'css/moduel', 'css/font-awesome', 'css/edu-tooltipster', 'educoder/magic-check','/assets/iconfont/iconfont.css' %> <%= call_hook :view_layouts_base_html_head %> From 0e2dcf12fdfd8ff9e88baea820250ec07dce8d36 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 24 May 2019 18:09:51 +0800 Subject: [PATCH 38/67] md --- app/views/layouts/base_ec.html.erb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/views/layouts/base_ec.html.erb b/app/views/layouts/base_ec.html.erb index 756d1706..10113aa8 100644 --- a/app/views/layouts/base_ec.html.erb +++ b/app/views/layouts/base_ec.html.erb @@ -11,7 +11,11 @@ <%= heads_for_theme %> <%= stylesheet_link_tag "/assets/codemirror/codemirror" %> <%= stylesheet_link_tag '/editormd/css/editormd.min.css' %> - <%= javascript_include_tag 'educoder/edu_application', 'educoder/edu_shixun','educoder/edu_shixunCommentsStar','educoder/jquery.raty', '/editormd/editormd.min.js', '/editormd/lib/marked.min.js', '/editormd/lib/flowchart.min.js', '/editormd/lib/jquery.flowchart.min.js' %> + + <%= javascript_include_tag '/editormd/lib/marked.min.js', '/editormd/lib/prettify.min.js', '/editormd/lib/raphael.min.js', '/editormd/lib/underscore.min.js', '/editormd/lib/sequence-diagram.min.js', + '/editormd/lib/flowchart.min.js', '/editormd/lib/jquery.flowchart.min.js', '/editormd/editormd.js' %> + + <%= javascript_include_tag 'educoder/edu_application', 'educoder/edu_shixun','educoder/edu_shixunCommentsStar','educoder/jquery.raty'%> <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/edu-popup','css/edu-common','educoder/edu-main','educoder/edu-all', "css/edu-public", 'css/ketang', 'css/common', 'css/taskstyle', 'css/structure','scm','css/public', 'css/project','css/popup','repository','css/gantt', 'css/calendar', 'css/moduel', 'css/font-awesome', 'css/edu-tooltipster', 'educoder/magic-check','/assets/iconfont/iconfont.css' %> <%= call_hook :view_layouts_base_html_head %> From 95ded6f4caa62674c72ee025531886d8e366af9e Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 24 May 2019 18:11:34 +0800 Subject: [PATCH 39/67] b --- app/views/common/index.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/common/index.html.erb b/app/views/common/index.html.erb index 6e2b93b5..553fa3db 100644 --- a/app/views/common/index.html.erb +++ b/app/views/common/index.html.erb @@ -1 +1 @@ -Educoder
    \ No newline at end of file +Educoder
    \ No newline at end of file From a316a9cebf22c9c2716eccd29c7da5842680c283 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 24 May 2019 18:20:49 +0800 Subject: [PATCH 40/67] http --- public/react/src/modules/page/MainContent.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/page/MainContent.js b/public/react/src/modules/page/MainContent.js index afd0d2d9..9f4b9fd4 100644 --- a/public/react/src/modules/page/MainContent.js +++ b/public/react/src/modules/page/MainContent.js @@ -80,7 +80,7 @@ class MainContent extends Component { .page--body { z-index: ${showIframeContent ? '9999': '1'} ; } .b-label>.resize-helper { top: ${showIframeContent ? '10px': '50%'} } `} - { showIframeContent ? : + { showIframeContent ? : {/* 旧版本、评测等待提示--更新提示块*/} {/*
    From af37894dbb321c595912b3931461d8145631c5e7 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 24 May 2019 18:28:17 +0800 Subject: [PATCH 41/67] 7999 --- public/react/src/modules/page/MainContent.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/page/MainContent.js b/public/react/src/modules/page/MainContent.js index 9f4b9fd4..ee3fcdf9 100644 --- a/public/react/src/modules/page/MainContent.js +++ b/public/react/src/modules/page/MainContent.js @@ -77,7 +77,7 @@ class MainContent extends Component { height: 100%; background: #fff; } - .page--body { z-index: ${showIframeContent ? '9999': '1'} ; } + .page--body { z-index: ${showIframeContent ? '7999': '1'} ; } .b-label>.resize-helper { top: ${showIframeContent ? '10px': '50%'} } `} { showIframeContent ? : From 478b73bbfbb56b1033b720255b2c626023e197b9 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 24 May 2019 18:30:27 +0800 Subject: [PATCH 42/67] b --- app/views/common/index.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/common/index.html.erb b/app/views/common/index.html.erb index 553fa3db..5762eefe 100644 --- a/app/views/common/index.html.erb +++ b/app/views/common/index.html.erb @@ -1 +1 @@ -Educoder
    \ No newline at end of file +Educoder
    \ No newline at end of file From bef79a52c29bf231d29a1e1dc21b367902afc786 Mon Sep 17 00:00:00 2001 From: p31729568 Date: Fri, 24 May 2019 18:59:14 +0800 Subject: [PATCH 43/67] fix copy ec year --- app/services/copy_ec_year_service.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/services/copy_ec_year_service.rb b/app/services/copy_ec_year_service.rb index cbbcd5f1..15a95ea0 100644 --- a/app/services/copy_ec_year_service.rb +++ b/app/services/copy_ec_year_service.rb @@ -224,7 +224,7 @@ to_relate.attributes = relate.attributes.except('id', 'ec_course_achievement_method_id', 'ec_course_target_id', 'ec_course_evaluation_subitem_id', 'created_at', 'updated_at') to_relate.ec_course_target_id = course_target_map[relate.ec_course_target_id] - to_relate.ec_course_evaluation_subitem_id = course_target_map[relate.ec_course_evaluation_subitem_id] + to_relate.ec_course_evaluation_subitem_id = course_evaluation_subitem_map[relate.ec_course_evaluation_subitem_id] to_relate.save! achievement_evaluation_relates_map[relate.id] = to_relate.id From 27acd561c0c42966b17d4d4e8d9a3b78366662bc Mon Sep 17 00:00:00 2001 From: p31729568 Date: Fri, 24 May 2019 19:11:06 +0800 Subject: [PATCH 44/67] fix copy ec year bug --- app/services/copy_ec_year_service.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/services/copy_ec_year_service.rb b/app/services/copy_ec_year_service.rb index 15a95ea0..31bac9f9 100644 --- a/app/services/copy_ec_year_service.rb +++ b/app/services/copy_ec_year_service.rb @@ -224,7 +224,8 @@ to_relate.attributes = relate.attributes.except('id', 'ec_course_achievement_method_id', 'ec_course_target_id', 'ec_course_evaluation_subitem_id', 'created_at', 'updated_at') to_relate.ec_course_target_id = course_target_map[relate.ec_course_target_id] - to_relate.ec_course_evaluation_subitem_id = course_evaluation_subitem_map[relate.ec_course_evaluation_subitem_id] + # 可能不存在,所以为 -1 + to_relate.ec_course_evaluation_subitem_id = course_evaluation_subitem_map[relate.ec_course_evaluation_subitem_id] || -1 to_relate.save! achievement_evaluation_relates_map[relate.id] = to_relate.id From 02194f5503b83d241027286d414cb0565b10d5c7 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, 24 May 2019 20:18:14 +0800 Subject: [PATCH 45/67] b --- app/views/common/index.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/common/index.html.erb b/app/views/common/index.html.erb index 5762eefe..15d6d3b5 100644 --- a/app/views/common/index.html.erb +++ b/app/views/common/index.html.erb @@ -1 +1 @@ -Educoder
    \ No newline at end of file +Educoder
    \ No newline at end of file From 39801556976f8f49f00485522536ae62668c6b53 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Fri, 24 May 2019 20:40:04 +0800 Subject: [PATCH 46/67] =?UTF-8?q?=E5=9D=97=E7=8A=B6=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/stylesheets/educoder/edu-all.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/stylesheets/educoder/edu-all.css b/public/stylesheets/educoder/edu-all.css index 3da912bb..bbd05a56 100644 --- a/public/stylesheets/educoder/edu-all.css +++ b/public/stylesheets/educoder/edu-all.css @@ -74,7 +74,7 @@ em.vertical-line{display: inline-block;width: 2px;background: #999;height: 10px} .moreitem{position: absolute;right: 5px;top:35px;height: 15px;color:#656565} /*块状列表*/ .square-list{width: 100%;box-sizing: border-box;margin-top:20px} -.square-Item{position: relative;width:280px;margin-right: 26px;margin-bottom: 26px;float: left;border-radius: 6px;background-color:#fff;box-shadow: 0px 0px 12px rgba(0,0,0,0.1); height: 301px;} +.square-Item{position: relative;width:280px;margin-right: 26px;margin-bottom: 26px;float: left;border-radius: 6px;background-color:#fff;box-shadow: 0px 0px 12px rgba(0,0,0,0.1); min-height: 301px;} .square-Item:hover{bottom: 3px; box-shadow: 0px 0px 12px rgba(0,0,0,0.3);} .square-Item:hover .closeSquare{display: block} .square-Item:nth-child(4n+0){margin-right: 0px;} From 543bb3e4c9652f100538959db852b75c7f2678a1 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, 24 May 2019 20:48:24 +0800 Subject: [PATCH 47/67] =?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/ec/ecTitle/ecTitle.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/ec/ecTitle/ecTitle.js b/public/react/src/modules/ec/ecTitle/ecTitle.js index f2440901..77daf2d4 100644 --- a/public/react/src/modules/ec/ecTitle/ecTitle.js +++ b/public/react/src/modules/ec/ecTitle/ecTitle.js @@ -51,7 +51,7 @@ class EcTitleCourseEvaluations extends Component { 毕业要求 vs 通用标准
  • - 5 + 5 学生
  • From 2c20ad2ed58d04ec9d7e43ee916eb53a8351a5c0 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, 24 May 2019 20:54:12 +0800 Subject: [PATCH 48/67] b --- app/views/common/index.html.erb | 2 +- public/react/src/modules/ec/ecTitle/ecTitle.css | 2 ++ public/react/src/modules/ec/ecTitle/ecTitle.js | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/views/common/index.html.erb b/app/views/common/index.html.erb index 15d6d3b5..bc3cb422 100644 --- a/app/views/common/index.html.erb +++ b/app/views/common/index.html.erb @@ -1 +1 @@ -Educoder
    \ No newline at end of file +Educoder
    \ No newline at end of file diff --git a/public/react/src/modules/ec/ecTitle/ecTitle.css b/public/react/src/modules/ec/ecTitle/ecTitle.css index c6e612bc..3f6796cd 100644 --- a/public/react/src/modules/ec/ecTitle/ecTitle.css +++ b/public/react/src/modules/ec/ecTitle/ecTitle.css @@ -22,6 +22,8 @@ } #traningNav>li>.ecTitles { line-height: 16px !important; + height: 18px!important; + width: 18px!important; } #traningNav>li>.ecTitlefont:hover{ diff --git a/public/react/src/modules/ec/ecTitle/ecTitle.js b/public/react/src/modules/ec/ecTitle/ecTitle.js index 77daf2d4..f2440901 100644 --- a/public/react/src/modules/ec/ecTitle/ecTitle.js +++ b/public/react/src/modules/ec/ecTitle/ecTitle.js @@ -51,7 +51,7 @@ class EcTitleCourseEvaluations extends Component { 毕业要求 vs 通用标准
  • - 5 + 5 学生
  • From c677f58ca198c8f43bc1e95239abe82ceca64f48 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, 24 May 2019 20:56:38 +0800 Subject: [PATCH 49/67] b --- app/views/common/index.html.erb | 2 +- public/react/src/modules/ec/ecStudentList/ecStudentList.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/common/index.html.erb b/app/views/common/index.html.erb index bc3cb422..df334ea8 100644 --- a/app/views/common/index.html.erb +++ b/app/views/common/index.html.erb @@ -1 +1 @@ -Educoder
    \ No newline at end of file +Educoder
    \ No newline at end of file diff --git a/public/react/src/modules/ec/ecStudentList/ecStudentList.js b/public/react/src/modules/ec/ecStudentList/ecStudentList.js index 911ee1c2..4208b2bc 100644 --- a/public/react/src/modules/ec/ecStudentList/ecStudentList.js +++ b/public/react/src/modules/ec/ecStudentList/ecStudentList.js @@ -323,7 +323,7 @@ class ecStudentList extends Component { schooldata={schooldata} ecpath={this.state.ecComponentState} /> -
    +
    学生列表 返回
    From 29cf900c9973eea230be5521ab50f62e4d2e15c5 Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Sat, 25 May 2019 14:14:28 +0800 Subject: [PATCH 50/67] =?UTF-8?q?shixun=E9=BB=98=E8=AE=A4=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/shixuns/_settings_show.html.erb | 1 + db/migrate/20190525060616_modify_exec_time_for_shixun.rb | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100644 db/migrate/20190525060616_modify_exec_time_for_shixun.rb diff --git a/app/views/shixuns/_settings_show.html.erb b/app/views/shixuns/_settings_show.html.erb index 92417f49..72752703 100644 --- a/app/views/shixuns/_settings_show.html.erb +++ b/app/views/shixuns/_settings_show.html.erb @@ -1,3 +1,4 @@ +
    配置 diff --git a/db/migrate/20190525060616_modify_exec_time_for_shixun.rb b/db/migrate/20190525060616_modify_exec_time_for_shixun.rb new file mode 100644 index 00000000..a5602ca8 --- /dev/null +++ b/db/migrate/20190525060616_modify_exec_time_for_shixun.rb @@ -0,0 +1,8 @@ +class ModifyExecTimeForShixun < ActiveRecord::Migration + def up + change_column(:shixuns, :exec_time, :integer, :default => 20) + end + + def down + end +end From a5d2976f172003eaa2b502f3fde5ffb69b7455f1 Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Sat, 25 May 2019 15:05:04 +0800 Subject: [PATCH 51/67] =?UTF-8?q?=E8=AF=84=E6=B5=8B=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E4=B8=80=E4=BA=9B=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/games_service.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/services/games_service.rb b/app/services/games_service.rb index 2139715e..f946effa 100644 --- a/app/services/games_service.rb +++ b/app/services/games_service.rb @@ -801,6 +801,7 @@ class GamesService # 轮询获取状态 # resubmit是在file_update中生成的,从game_build中传入的 def game_status params, current_user + Rails.logger("sec_key is #{params[:sec_key]}**1") game = Game.find_by_identifier(params[:identifier]) resubmit_identifier = game.resubmit_identifier # 如果没有超时并且正在评测中 @@ -812,6 +813,7 @@ class GamesService return {:running_code_status => running_code_status, :running_code_message => running_code_message} end + Rails.logger("sec_key is #{params[:sec_key]}**2") Rails.logger.info("##### resubmit_identifier is #{resubmit_identifier}") port = params[:port] score = 0 @@ -838,6 +840,7 @@ class GamesService end end + Rails.logger("sec_key is #{params[:sec_key]}**3") # 实训的最大评测次数,这个值是为了优化查询,每次只取最新的最新一次评测的结果集 max_query_index = game.query_index - 1 # 区分评测过未评测过,未评测过按需求取数据 @@ -854,7 +857,7 @@ class GamesService # 能进入到此处,肯定是已经返回了结果,也就是说outputs中肯定有了数据 - + Rails.logger("sec_key is #{params[:sec_key]}**4") test_sets_count = qurey_test_sets.size # had_test = Output.where(:game_id => game.id, :query_index => max_query_index) # had_test_count = had_test.count @@ -881,6 +884,7 @@ class GamesService web_route = game_challenge.try(:web_route) mirror_name = shixun.mirror_name + Rails.logger("sec_key is #{params[:sec_key]}**5") # 轮询结束,更新评测耗时 e_record = EvaluateRecord.where(:identifier => params[:sec_key]).first if game_status == 0 || game_status == 2 @@ -898,12 +902,14 @@ class GamesService # 实训制作者当前拥有的金币 grade = User.where(:id => game.user_id).pluck(:grade).first + Rails.logger("sec_key is #{params[:sec_key]}**6") # 高性能取上一关、下一关 prev_game = Game.prev_identifier(shixun.id, game.myshixun_id, game_challenge.position) next_game = Game.next_game(shixun.id, game.myshixun_id, game_challenge.position).try(:identifier) output_hash = {:test_sets => test_sets, :had_test_count => test_sets_count, :test_sets_count => test_sets_count, :had_passed_testsests_error_count => had_passed_testsests_error_count} + Rails.logger("sec_key is #{params[:sec_key]}**7") return {:grade => grade, :gold => score, :experience => experience, :status => game_status, :had_done => had_done, :position => game_challenge.position, :port => port, :power => power, :record => record, :mirror_name => mirror_name, :picture => picture, :web_route => web_route, :latest_output => latest_output, From bfc78eb673801ab1666e2cfe44741bf378f6259a Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Sat, 25 May 2019 15:19:26 +0800 Subject: [PATCH 52/67] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E7=9B=91=E6=8E=A7=E7=AD=89=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/games_service.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/services/games_service.rb b/app/services/games_service.rb index f946effa..f6f9926b 100644 --- a/app/services/games_service.rb +++ b/app/services/games_service.rb @@ -801,7 +801,7 @@ class GamesService # 轮询获取状态 # resubmit是在file_update中生成的,从game_build中传入的 def game_status params, current_user - Rails.logger("sec_key is #{params[:sec_key]}**1") + Rails.logger.info("sec_key is #{params[:sec_key]}**1") game = Game.find_by_identifier(params[:identifier]) resubmit_identifier = game.resubmit_identifier # 如果没有超时并且正在评测中 @@ -813,7 +813,7 @@ class GamesService return {:running_code_status => running_code_status, :running_code_message => running_code_message} end - Rails.logger("sec_key is #{params[:sec_key]}**2") + Rails.logger.info("sec_key is #{params[:sec_key]}**2") Rails.logger.info("##### resubmit_identifier is #{resubmit_identifier}") port = params[:port] score = 0 @@ -840,7 +840,7 @@ class GamesService end end - Rails.logger("sec_key is #{params[:sec_key]}**3") + Rails.logger.info("sec_key is #{params[:sec_key]}**3") # 实训的最大评测次数,这个值是为了优化查询,每次只取最新的最新一次评测的结果集 max_query_index = game.query_index - 1 # 区分评测过未评测过,未评测过按需求取数据 @@ -857,7 +857,7 @@ class GamesService # 能进入到此处,肯定是已经返回了结果,也就是说outputs中肯定有了数据 - Rails.logger("sec_key is #{params[:sec_key]}**4") + Rails.logger.info("sec_key is #{params[:sec_key]}**4") test_sets_count = qurey_test_sets.size # had_test = Output.where(:game_id => game.id, :query_index => max_query_index) # had_test_count = had_test.count @@ -884,7 +884,7 @@ class GamesService web_route = game_challenge.try(:web_route) mirror_name = shixun.mirror_name - Rails.logger("sec_key is #{params[:sec_key]}**5") + Rails.logger.info("sec_key is #{params[:sec_key]}**5") # 轮询结束,更新评测耗时 e_record = EvaluateRecord.where(:identifier => params[:sec_key]).first if game_status == 0 || game_status == 2 @@ -902,14 +902,14 @@ class GamesService # 实训制作者当前拥有的金币 grade = User.where(:id => game.user_id).pluck(:grade).first - Rails.logger("sec_key is #{params[:sec_key]}**6") + Rails.logger.info("sec_key is #{params[:sec_key]}**6") # 高性能取上一关、下一关 prev_game = Game.prev_identifier(shixun.id, game.myshixun_id, game_challenge.position) next_game = Game.next_game(shixun.id, game.myshixun_id, game_challenge.position).try(:identifier) output_hash = {:test_sets => test_sets, :had_test_count => test_sets_count, :test_sets_count => test_sets_count, :had_passed_testsests_error_count => had_passed_testsests_error_count} - Rails.logger("sec_key is #{params[:sec_key]}**7") + Rails.logger.info("sec_key is #{params[:sec_key]}**7") return {:grade => grade, :gold => score, :experience => experience, :status => game_status, :had_done => had_done, :position => game_challenge.position, :port => port, :power => power, :record => record, :mirror_name => mirror_name, :picture => picture, :web_route => web_route, :latest_output => latest_output, From 334d0a800d6a3c3ff1c4bf1ca0d135a0961d7359 Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Sat, 25 May 2019 15:24:26 +0800 Subject: [PATCH 53/67] =?UTF-8?q?=E8=AF=84=E6=B5=8B=E7=9B=91=E6=8E=A712?= =?UTF-8?q?=E5=B0=8F=E6=97=B6=E4=B8=80=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/managements_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/managements_controller.rb b/app/controllers/managements_controller.rb index 769481b0..e3ecc2ce 100644 --- a/app/controllers/managements_controller.rb +++ b/app/controllers/managements_controller.rb @@ -853,7 +853,7 @@ class ManagementsController < ApplicationController def evaluate_simple page = params[:page] - @recodes = EvaluateRecord.where("created_at > ?", Time.now - 1.days).reorder("consume_time desc") + @recodes = EvaluateRecord.where("created_at > ?", Time.now - 0.5.days).reorder("consume_time desc") @recodes_count = @recodes.size @record_pages = Paginator.new @recodes_count, 20, page || 1 @offset ||= @record_pages.offset From 768881c1c332a6565f2e64b716154f66c662d394 Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Sat, 25 May 2019 15:43:02 +0800 Subject: [PATCH 54/67] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E5=8C=BA=E5=88=86=E7=94=A8=E6=88=B7=E6=8F=90=E4=BA=A4=E5=92=8C?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E4=BF=9D=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/games_service.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/services/games_service.rb b/app/services/games_service.rb index f6f9926b..e413c101 100644 --- a/app/services/games_service.rb +++ b/app/services/games_service.rb @@ -371,7 +371,8 @@ class GamesService end if content != last_content content_modified = 1 - code_file = @g.edit_file(@myshixun.gpid, current_user.login, :content => content, :file_path => path, :branch_name => "master", :commit_message => "auto commit") + code_file = @g.edit_file(@myshixun.gpid, current_user.login, :content => content, :file_path => path, :branch_name => "master", + :commit_message => (params[:evaluate] == 1 ? "commit by author" : "auto commit" )) end # REDO:是否有读写分离的问题 if record.present? From 88fa6989fecf9eba73e09f26fa05a055657615d2 Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Sat, 25 May 2019 15:57:05 +0800 Subject: [PATCH 55/67] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/games_service.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/services/games_service.rb b/app/services/games_service.rb index e413c101..d4fd733a 100644 --- a/app/services/games_service.rb +++ b/app/services/games_service.rb @@ -371,6 +371,9 @@ class GamesService end if content != last_content content_modified = 1 + + Rails.logger.info("@@@@@####{params[:evaluate]}") + Rails.logger.info("@@@@@####{params[:evaluate] == 1 ? "commit by author" : "auto commit" }") code_file = @g.edit_file(@myshixun.gpid, current_user.login, :content => content, :file_path => path, :branch_name => "master", :commit_message => (params[:evaluate] == 1 ? "commit by author" : "auto commit" )) end From 9ccd8c1c52920bf77c90c2016c7643dc3a8fe5f5 Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Sat, 25 May 2019 16:00:05 +0800 Subject: [PATCH 56/67] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/games_service.rb | 3 --- 1 file changed, 3 deletions(-) diff --git a/app/services/games_service.rb b/app/services/games_service.rb index d4fd733a..e413c101 100644 --- a/app/services/games_service.rb +++ b/app/services/games_service.rb @@ -371,9 +371,6 @@ class GamesService end if content != last_content content_modified = 1 - - Rails.logger.info("@@@@@####{params[:evaluate]}") - Rails.logger.info("@@@@@####{params[:evaluate] == 1 ? "commit by author" : "auto commit" }") code_file = @g.edit_file(@myshixun.gpid, current_user.login, :content => content, :file_path => path, :branch_name => "master", :commit_message => (params[:evaluate] == 1 ? "commit by author" : "auto commit" )) end From 07b7fe630e49f3f9de9db202a116ed143ad04508 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Sat, 25 May 2019 19:31:20 +0800 Subject: [PATCH 57/67] =?UTF-8?q?fork=E5=AE=9E=E8=AE=AD=E4=B8=8D=E5=A4=8D?= =?UTF-8?q?=E5=88=B6=E8=83=8C=E6=99=AF=E7=9F=A5=E8=AF=86?= 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 c60a9959..ecc5ce46 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -850,7 +850,7 @@ class ShixunsController < ApplicationController begin raise "请先绑定邮箱" if User.current.mail.blank? new_shixun = Shixun.new - new_shixun.attributes = @shixun.attributes.dup.except("id","user_id","visits","gpid","status", "identifier", "homepage_show","git_url") + new_shixun.attributes = @shixun.attributes.dup.except("id","user_id","visits","gpid","status", "identifier", "homepage_show","git_url", "propaedeutics") new_shixun.user_id = User.current.id new_shixun.identifier = generate_identifier new_shixun.status = 0 From 58bf8a994734cd1f65eae884d8817d5fa52728c2 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Mon, 27 May 2019 09:10:09 +0800 Subject: [PATCH 58/67] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E7=9A=84=E9=87=8D=E5=91=BD=E5=90=8D=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_common_controller.rb | 18 +++++++++-- .../_homework_index_list.html.erb | 6 +++- .../_rename_shixun_homework.html.erb | 30 +++++++++++++++++++ .../homework_common/rename_homework.js.erb | 5 ++++ app/views/homework_common/rename_modal.js.erb | 2 ++ config/routes.rb | 2 ++ 6 files changed, 60 insertions(+), 3 deletions(-) create mode 100644 app/views/homework_common/_rename_shixun_homework.html.erb create mode 100644 app/views/homework_common/rename_homework.js.erb create mode 100644 app/views/homework_common/rename_modal.js.erb diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb index e404c5ee..0e5ac1d6 100644 --- a/app/controllers/homework_common_controller.rb +++ b/app/controllers/homework_common_controller.rb @@ -12,11 +12,12 @@ class HomeworkCommonController < ApplicationController before_filter :find_homework, :only => [:edit,:update,:alert_anonymous_comment,:start_anonymous_comment,:stop_anonymous_comment,:destroy,:start_evaluation_set, :set_evaluation_attr,:score_rule_set,:alert_forbidden_anonymous_comment,:alert_open_student_works,:open_student_works, :set_score_open,:alert_score_open_modal,:add_to_homework_bank,:publish_notice,:publish_homework,:end_notice,:end_homework, - :setting,:set_public,:homework_setting,:update_explanation,:cancel_publish, :homework_code_repeat, :review_detail,:move_to_category] + :setting,:set_public,:homework_setting,:update_explanation,:cancel_publish, :homework_code_repeat, :review_detail,:move_to_category, + :rename_modal, :rename_homework] before_filter :teacher_of_course, :only => [:new, :create, :edit, :update, :destroy, :start_anonymous_comment, :stop_anonymous_comment, :alert_anonymous_comment, :start_evaluation_set,:set_evaluation_attr,:score_rule_set,:alert_forbidden_anonymous_comment,:alert_open_student_works, :open_student_works,:add_to_homework_bank,:publish_notice,:end_notice,:publish_homework,:end_homework,:update_explanation, - :cancel_publish, :move_to_category,:homework_setting] + :cancel_publish, :move_to_category,:homework_setting, :rename_homework, :rename_modal] # before_filter :member_of_course, :only => [:index,:setting] @@ -275,6 +276,19 @@ class HomeworkCommonController < ApplicationController @groups = paginateHelper @groups, 5 end + def rename_modal + + end + + def rename_homework + if params[:name].blank? + @notice = true + else + @homework.update_attributes(:name => params[:name].strip) + redirect_to homework_common_index_path(:course => @course.id, :homework_type => @homework.homework_type) + end + end + def setting @is_new = params[:is_new].to_i if params[:is_new] @is_empty = @homework.publish_time.nil? diff --git a/app/views/homework_common/_homework_index_list.html.erb b/app/views/homework_common/_homework_index_list.html.erb index 884fd0b9..bcc9bae8 100644 --- a/app/views/homework_common/_homework_index_list.html.erb +++ b/app/views/homework_common/_homework_index_list.html.erb @@ -11,7 +11,8 @@
    # <%= get_hw_index(homework_common, @is_teacher, @homework_type) + 1 %> <% homework_curr_status = homework_curr_time(homework_common) %> - <%= link_to homework_common.name.to_s, student_work_index_path(:homework => homework_common.id,:host=> Setting.host_course), :class => "edu-class-inner-list fl color-grey-3"%> + <%= link_to homework_common.name.to_s, student_work_index_path(:homework => homework_common.id,:host=> Setting.host_course), + :id => "homework_name_#{homework_common.id}", :class => "edu-class-inner-list fl color-grey-3"%> <% unless homework_common.is_public %> <% end %> @@ -144,6 +145,9 @@
  • <%= link_to "设置", student_work_index_path(:homework => homework_common.id, :tab => 4) %>
  • +
  • + <%= link_to "重命名", rename_modal_homework_common_path(homework_common), :remote => true %> +
  • <% if homework_common.homework_detail_manual.try(:comment_status) == 0 %>
  • <%= link_to '立即发布', publish_notice_homework_common_path(homework_common), :remote => true %> diff --git a/app/views/homework_common/_rename_shixun_homework.html.erb b/app/views/homework_common/_rename_shixun_homework.html.erb new file mode 100644 index 00000000..78f8eb27 --- /dev/null +++ b/app/views/homework_common/_rename_shixun_homework.html.erb @@ -0,0 +1,30 @@ +
    +
    + 重命名 +
    +
    + <%= form_for "", :url => rename_homework_homework_common_path(@homework), :remote => true, :html => {:id => "rename_shixun_homework_form"} do |f| %> +
    + 作业名称: +
    + +

    请输入作业名称

    +
    +
    + <% end %> +
  • + 取消 + 确定 +
  • +
    +
    + \ No newline at end of file diff --git a/app/views/homework_common/rename_homework.js.erb b/app/views/homework_common/rename_homework.js.erb new file mode 100644 index 00000000..1022f747 --- /dev/null +++ b/app/views/homework_common/rename_homework.js.erb @@ -0,0 +1,5 @@ +<% if @notice %> + notice_box("作业名称不能为空"); +<% else %> + $("#homework_name_<%= @homework.id %>").html(<%= @homework.name %>); +<% end %> \ No newline at end of file diff --git a/app/views/homework_common/rename_modal.js.erb b/app/views/homework_common/rename_modal.js.erb new file mode 100644 index 00000000..e691dff3 --- /dev/null +++ b/app/views/homework_common/rename_modal.js.erb @@ -0,0 +1,2 @@ +var html = '<%= escape_javascript(render :partial => "homework_common/rename_shixun_homework") %>'; +pop_box_new(html, 460, 227); \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index e4dfe08d..137a1231 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1103,6 +1103,8 @@ RedmineApp::Application.routes.draw do ## oauth相关 match 'move_to_category', :via => [:get,:post] match 'homework_code_repeat', :via => [:get,:post] get 'review_detail' + post 'rename_homework' + get 'rename_modal' end collection do From ecff82dc0c161c2906a2faf73959f95064c499ff Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Mon, 27 May 2019 09:56:08 +0800 Subject: [PATCH 59/67] =?UTF-8?q?=E8=B6=85=E7=BA=A7=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=91=98=E7=9A=84=E8=AF=BE=E5=A0=82=E5=88=97=E8=A1=A8=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E6=8C=89=E8=AF=BE=E5=A0=82=E5=90=8D=E7=A7=B0=E6=90=9C?= =?UTF-8?q?=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/managements_controller.rb | 8 +++++--- app/views/managements/classroom_classment.html.erb | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/controllers/managements_controller.rb b/app/controllers/managements_controller.rb index e3ecc2ce..5df43ed6 100644 --- a/app/controllers/managements_controller.rb +++ b/app/controllers/managements_controller.rb @@ -2023,7 +2023,7 @@ end # @schools = School.where(:id =>user_exs.map(&:school_id)) # end @search = params[:search] # 搜索字 - @keyword = params[:keyword].blank? ? "u_name" : params[:keyword] # 根据姓名/课程名搜索 + @keyword = params[:keyword].blank? ? "c_name" : params[:keyword] # 根据姓名/课程名搜索 @status = params[:status] @school_id = params[:school_id] @@ -2044,11 +2044,13 @@ end if params[:status] && params[:status]!='' @courses = @courses.where(:is_end => @status.to_i) end - if "u_name" == @keyword + if "c_name" == @keyword + @courses = @courses.where("name like ?", "%#{@search}%") + elsif "u_name" == @keyword if @search.blank? @courses = @courses else - user_id = User.where("concat(lastname, firstname) like '%#{@search}%'") + # user_id = User.where("concat(lastname, firstname) like '%#{@search}%'") @courses = @courses.joins("join users u on courses.tea_id = u.id").where("concat(u.lastname, u.firstname) like '%#{@search}%'") end elsif "dep_name" == @keyword diff --git a/app/views/managements/classroom_classment.html.erb b/app/views/managements/classroom_classment.html.erb index 06ea072d..f9417d74 100644 --- a/app/views/managements/classroom_classment.html.erb +++ b/app/views/managements/classroom_classment.html.erb @@ -14,6 +14,7 @@
    From c10ed929da3248d99f93257c2f69cbf75c807357 Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Mon, 27 May 2019 11:05:29 +0800 Subject: [PATCH 60/67] =?UTF-8?q?=E8=AF=84=E6=B5=8B=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=94=AF=E4=B8=80=E8=A1=A8=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/managements_controller.rb | 2 +- .../managements/evaluate_simple.html.erb | 42 ++++--------------- 2 files changed, 10 insertions(+), 34 deletions(-) diff --git a/app/controllers/managements_controller.rb b/app/controllers/managements_controller.rb index e3ecc2ce..636d4edb 100644 --- a/app/controllers/managements_controller.rb +++ b/app/controllers/managements_controller.rb @@ -853,7 +853,7 @@ class ManagementsController < ApplicationController def evaluate_simple page = params[:page] - @recodes = EvaluateRecord.where("created_at > ?", Time.now - 0.5.days).reorder("consume_time desc") + @recodes = EvaluateRecord.where("created_at > ?", Time.now - 10000.days).reorder("consume_time desc") @recodes_count = @recodes.size @record_pages = Paginator.new @recodes_count, 20, page || 1 @offset ||= @record_pages.offset diff --git a/app/views/managements/evaluate_simple.html.erb b/app/views/managements/evaluate_simple.html.erb index cecfe4a9..a278395c 100644 --- a/app/views/managements/evaluate_simple.html.erb +++ b/app/views/managements/evaluate_simple.html.erb @@ -1,54 +1,29 @@ -<% if false %> - -
    -
    -

    耗时详情

    - -
    -
    -
      -
    1. 总耗时:<%= @consume_time %>
    2. -
    3. 作品更新:<%= @student_work %>
    4. -
    5. 文件更新:<%= @file_update %>
    6. -
    7. 中间层总耗时:<%= @brige %>
    8. -
    9. pull代码:<%= @git_pull %>
    10. -
    11. pod启动:<%= @create_pod %>
    12. -
    13. pod执行:<%= @pod_execute %>
    14. -
    15. 中间层回传:<%= @return_back %>--(中间层出结果传Educoder)
    16. -
    17. 前端轮询:<%= @front_js %>--(局部数据查询,Js轮询)
    18. -
    19. 回调结果存储:<%= @test_cases %>
    20. -
    -
    -
    -<% end %> - <% if @recodes.present? %>
    - - + + - + - + - + + - <% @recodes.each_with_index do |record, index| %> + <% @recodes.each do |record| %> - + @@ -60,6 +35,7 @@ + <% end %> From c49f3813452460e6a0bb26b46b8d45f6c3cc3a90 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Mon, 27 May 2019 14:16:48 +0800 Subject: [PATCH 61/67] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_work_controller.rb | 8 ++++---- app/views/student_work/index.html.erb | 9 +++------ 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index 8885353c..1afaefc3 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -584,16 +584,16 @@ class StudentWorkController < ApplicationController @stundet_works = @stundet_works.where(:work_status => @status) end + @stundet_works = search_work_member @stundet_works, @name + if @stundet_works.size != 0 if @order == "student_id" - @stundet_works = @stundet_works.includes(:user => {:user_extensions => []}).order("user_extensions.student_id #{@b_sort}") + @stundet_works = @stundet_works.joins(:user => {:user_extensions => []}).order("user_extensions.student_id #{@b_sort}") else @stundet_works = @stundet_works.order("#{@order} #{@b_sort}") end end - @stundet_works = search_work_member @stundet_works, @name - @score = @b_sort == "desc" ? "asc" : "desc" # @is_focus = params[:is_focus] ? params[:is_focus].to_i : 0 # 消息传过来的ID @@ -615,6 +615,7 @@ class StudentWorkController < ApplicationController _index @stundet_works = paginateHelper @stundet_works, @limit + @members = @course.members.select([:user_id, :course_group_id]) if @stundet_works.size != 0 @stundet_works = if @homework.homework_type == 1 @stundet_works.includes(:student_works_scores, [user: :user_extensions]) @@ -623,7 +624,6 @@ class StudentWorkController < ApplicationController elsif @homework.homework_type == 4 @stundet_works.includes(:student_works_scores, [myshixun: :games], [user: :user_extensions]) end - @members = @course.members.where(user_id: @stundet_works.pluck(:user_id)).select([:user_id, :course_group_id]) end respond_to do |format| format.js diff --git a/app/views/student_work/index.html.erb b/app/views/student_work/index.html.erb index 99384dfc..0e66401c 100644 --- a/app/views/student_work/index.html.erb +++ b/app/views/student_work/index.html.erb @@ -199,14 +199,11 @@ 不限> - + > - + > - +
  • From 5afb8d00d687c4df021efec95c557fc03a413744 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 27 May 2019 17:09:48 +0800 Subject: [PATCH 62/67] =?UTF-8?q?=E5=A5=BD=E5=A4=A7=E5=AD=A6=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/mobile/api.rb | 13 +++++- app/api/mobile/apis/cnmooc.rb | 54 ++++++++++++++++++++++ app/services/cnmoocs_service.rb | 82 +++++++++++++++++++++++++++++++++ 3 files changed, 148 insertions(+), 1 deletion(-) create mode 100644 app/api/mobile/apis/cnmooc.rb create mode 100644 app/services/cnmoocs_service.rb diff --git a/app/api/mobile/api.rb b/app/api/mobile/api.rb index eefedb5b..d13dc61f 100644 --- a/app/api/mobile/api.rb +++ b/app/api/mobile/api.rb @@ -36,7 +36,7 @@ module Mobile content_type :json, "application/json;charset=UTF-8" # use ActionDispatch::Session::CookieStore - + require 'digest' use Mobile::Middleware::ErrorHandler helpers do @@ -53,6 +53,16 @@ module Mobile error!('401 Unauthorized', 401) if params[:private_token] != "hriEn3UwXfJs3PmyXnSG" end + def cnmooc_access_key! + ## 签名 + accessKeyId = 'LTAISM4HFWpQHh3g'.freeze + accessKeySecret = '9NMU8ushmFu8SN1EKHOhvo9jmv1qp0'.freeze + sign = Digest::MD5.hexdigest("AccessKeyId=#{accessKeyId}AccessKeySecret=#{accessKeySecret}").upcase + if params[:sign] != sign + error!('401 Unauthorized', 401) + end + end + # 有一些接口没登录也能查看数据 def career_authenticate! pass = request.path.include?("introduction") || request.path.include?("get_published_careers")|| request.path.include?("get_current_user") @@ -160,6 +170,7 @@ module Mobile mount Apis::Careers mount Apis::Assets mount Apis::Ecloud + mount Apis::Cnmooc diff --git a/app/api/mobile/apis/cnmooc.rb b/app/api/mobile/apis/cnmooc.rb new file mode 100644 index 00000000..f49b4f66 --- /dev/null +++ b/app/api/mobile/apis/cnmooc.rb @@ -0,0 +1,54 @@ +# encoding=utf-8 +# 好大学接口数据 +module Mobile + module Apis + class Cnmooc < Grape::API + before {cnmooc_access_key!} + content_type :json, 'application/json;charset=UTF-8' + + resources :cnmoocs do + desc '获取实训数据' + get "get_resources_data" do + CnmoocsService.new.get_resources_data params + end + + desc "实训搜索功能" + params do + requires :name, type: String, desc: "搜索名称" + end + get 'search_resources' do + CnmoocsService.new.search_resources params + end + + desc " 查找用户" + params do + requires :mail, type: String, desc: "邮箱地址" + end + get 'find_user' do + CnmoocsService.new.find_user params + end + + desc "创建用户" + params do + requires :mail, type: String, desc: "邮箱地址" + requires :name, type: String, desc: "昵称" + requires :password, type: String, desc: "密码" + end + post "create_user" do + CnmoocsService.new.create_user params + end + + desc "远程登录" + params do + requires :mail, type: String, desc: "邮箱地址" + requires :password, type: String, desc: "密码" + end + get "login_educoder" do + CnmoocsService.new.login_educoder params + end + + + end + end + end +end \ No newline at end of file diff --git a/app/services/cnmoocs_service.rb b/app/services/cnmoocs_service.rb new file mode 100644 index 00000000..02e6d54b --- /dev/null +++ b/app/services/cnmoocs_service.rb @@ -0,0 +1,82 @@ +class CnmoocsService + include ApplicationHelper + include GamesHelper + + def get_resources_data params + page = params[:pageNo].to_i + limit = params[:pageSize] || 16 + offset = page * limit.to_i + shixuns = Shixun.select([:id, :identifier, :name, :myshixuns_count, :averge_star, :challenges_count, :trainee]). + where(status: 0, hidden: 0).order("myshixun_count desc") + shixun_count = shixuns.count + pageCount = ((shixun_count / limit.to_f) == (shixun_count / limit)) ? (shixun_count / limit) : ((shixun_count / limit) + 1) + shixuns = shixuns.offset(offset).limit(limit) + shixun_list = shixun_data shixuns + {error: 0, messages: "请求成功", + page: {count: shixuns.count, totalCount: shixun_count, pageNo: page, pageSize: limit, pageCount: pageCount}, + data: shixun_list } + end + + def search_resources params + page = params[:pageNo].to_i + limit = params[:pageSize] || 16 + offset = page * limit.to_i + shixuns = Shixun.select([:id, :identifier, :name, :myshixuns_count, :averge_star, :challenges_count, :trainee]). + where(status: 2, hidden: 0).where("name like ?", "%#{params[:name]}%").offset(offset).limit(limit) + shixun_count = shixuns.count + pageCount = ((shixun_count / limit.to_f) == (shixun_count / limit)) ? (shixun_count / limit) : ((shixun_count / limit) + 1) + shixuns = shixuns.offset(offset).limit(limit) + shixun_list = shixun_data shixuns + {error: 0, messages: "请求成功", + page: {count: shixuns.count, totalCount: shixun_count, pageNo: page, pageSize: limit, pageCount: pageCount}, + data: shixun_list } + end + + def find_user params + user = User.find_by_mail params[:mail] + if user + {error: 0, message: "找到用户"} + else + {error: -1, message: "找不到用户"} + end + end + + def create_user params + user = User.find_by_mail params[:mail] + if user.blank? + ActiveRecord::Base.transaction do + # 如果Educoder中已存在与该OpenI用户的邮箱相同的用户,则会直接跳转到登录educoder的登录页面 + user = User.new(lastname: params[:name], mail: params[:mail], mail_notification: email) + user.login = generate_login('m') + user.password = params[:password] + user.certification = 1 + user.save! + UserExtensions.create!(user_id: user.id, school_id: School.first.id, identity: 4, gender: 0) + end + {error: 0, message: "创建成功"} + else + {error: -1, message: "邮箱已经存在,请直接使用邮箱登录"} + end + end + + def login_educoder params + user, last_login_on = User.try_to_login(params[:mail], params[:password]) + self.logged_user = user + {error: 0, message: "登录成功"} + end + + + private + def shixun_data shixuns + shixun_list = [] + shixuns.includes(:tag_repertoires).find_each do |shixun| + tag_name = shixun.tag_repertoires.first.try(:name) + level = %W(初级 中级 高级 顶级)[shixun.trainee - 1] + shixun_list << {identifier: shixun.identifier, name: shixun.name, students_count: shixun.myshixuns_count, + challenges_count: shixun.challenges_count, score_info: shixun.averge_star, level: level} + + end + {resouces: shixun_list} + end + +end \ No newline at end of file From d56728da62240b50159773b858916cc4e70e1248 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 27 May 2019 17:44:07 +0800 Subject: [PATCH 63/67] =?UTF-8?q?=E5=A5=BD=E5=A4=A7=E5=AD=A6=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/cnmoocs_service.rb | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/services/cnmoocs_service.rb b/app/services/cnmoocs_service.rb index 02e6d54b..fbb8d55c 100644 --- a/app/services/cnmoocs_service.rb +++ b/app/services/cnmoocs_service.rb @@ -7,10 +7,12 @@ class CnmoocsService limit = params[:pageSize] || 16 offset = page * limit.to_i shixuns = Shixun.select([:id, :identifier, :name, :myshixuns_count, :averge_star, :challenges_count, :trainee]). - where(status: 0, hidden: 0).order("myshixun_count desc") + where(status: 0, hidden: 0) shixun_count = shixuns.count pageCount = ((shixun_count / limit.to_f) == (shixun_count / limit)) ? (shixun_count / limit) : ((shixun_count / limit) + 1) - shixuns = shixuns.offset(offset).limit(limit) + Rails.logger.info("#####{pageCount}") + Rails.logger.info("#####{limit}") + shixuns = shixuns.order("myshixuns_count desc").offset(offset).limit(limit) shixun_list = shixun_data shixuns {error: 0, messages: "请求成功", page: {count: shixuns.count, totalCount: shixun_count, pageNo: page, pageSize: limit, pageCount: pageCount}, @@ -22,10 +24,10 @@ class CnmoocsService limit = params[:pageSize] || 16 offset = page * limit.to_i shixuns = Shixun.select([:id, :identifier, :name, :myshixuns_count, :averge_star, :challenges_count, :trainee]). - where(status: 2, hidden: 0).where("name like ?", "%#{params[:name]}%").offset(offset).limit(limit) + where(status: 2, hidden: 0).where("name like ?", "%#{params[:name]}%") shixun_count = shixuns.count pageCount = ((shixun_count / limit.to_f) == (shixun_count / limit)) ? (shixun_count / limit) : ((shixun_count / limit) + 1) - shixuns = shixuns.offset(offset).limit(limit) + shixuns = shixuns.order("myshixuns_count desc").offset(offset).limit(limit) shixun_list = shixun_data shixuns {error: 0, messages: "请求成功", page: {count: shixuns.count, totalCount: shixun_count, pageNo: page, pageSize: limit, pageCount: pageCount}, @@ -69,7 +71,7 @@ class CnmoocsService private def shixun_data shixuns shixun_list = [] - shixuns.includes(:tag_repertoires).find_each do |shixun| + shixuns.includes(:tag_repertoires).each do |shixun| tag_name = shixun.tag_repertoires.first.try(:name) level = %W(初级 中级 高级 顶级)[shixun.trainee - 1] shixun_list << {identifier: shixun.identifier, name: shixun.name, students_count: shixun.myshixuns_count, From f027b52e4a874bfd4ea9c6300cfdc9c5a513d9f0 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 27 May 2019 17:58:52 +0800 Subject: [PATCH 64/67] =?UTF-8?q?=E5=A5=BD=E5=A4=A7=E5=AD=A6=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/cnmoocs_service.rb | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/app/services/cnmoocs_service.rb b/app/services/cnmoocs_service.rb index fbb8d55c..40f75a8c 100644 --- a/app/services/cnmoocs_service.rb +++ b/app/services/cnmoocs_service.rb @@ -37,9 +37,9 @@ class CnmoocsService def find_user params user = User.find_by_mail params[:mail] if user - {error: 0, message: "找到用户"} + {error: 0, messages: "找到用户"} else - {error: -1, message: "找不到用户"} + {error: -1, messages: "找不到用户"} end end @@ -55,16 +55,21 @@ class CnmoocsService user.save! UserExtensions.create!(user_id: user.id, school_id: School.first.id, identity: 4, gender: 0) end - {error: 0, message: "创建成功"} + {error: 0, messages: "创建成功"} else - {error: -1, message: "邮箱已经存在,请直接使用邮箱登录"} + {error: -1, messages: "邮箱已经存在,请直接使用邮箱登录"} end end def login_educoder params user, last_login_on = User.try_to_login(params[:mail], params[:password]) - self.logged_user = user - {error: 0, message: "登录成功"} + if user + self.logged_user = user + {error: 0, messages: "登录成功"} + else + {error: -1, messages: "登录失败,请检查邮箱和密码是否正确"} + end + end From 40a1e1d0341e536af7f731e6db6a7056a8287e7c Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 28 May 2019 09:49:24 +0800 Subject: [PATCH 65/67] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E5=8F=8D=E9=A6=88?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E5=A2=9E=E5=8A=A0=E8=B4=A6=E5=8F=B7=E5=9B=9E?= =?UTF-8?q?=E5=A4=8D=E5=86=85=E5=AE=B9=E5=92=8C=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/managements_controller.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/controllers/managements_controller.rb b/app/controllers/managements_controller.rb index 851c50e6..0f62dbe8 100644 --- a/app/controllers/managements_controller.rb +++ b/app/controllers/managements_controller.rb @@ -4295,7 +4295,7 @@ end count_row = 1 shixuns = Shixun.where(:id => shixun_ids).includes(discusses: [:user]) sheet1.row(0).concat(["序号", "实训ID", "实训名称", "实训作者", "作者单位", "评论数", "评论内容", "关卡", "评论者", "评论者职业", - "评论者单位", "评论时间", "社区导师是否已回复"]) + "评论者单位", "评论时间", "社区导师是否已回复", "我的账号回复内容", "回复时间"]) shixuns.each_with_index do |shixun, i| discusses = shixun.discusses.where("user_id != ?", 1) if beginTime.present? @@ -4313,6 +4313,7 @@ end discusses.each_with_index do |discuss, j| user = discuss.user content = discuss.content.gsub(//, "【图片评论】").gsub(/!\[\].+\)/, "【图片评论】") + myself_discuss = discuss.children.where(user_id: User.current.id).last sheet1[count_row, 6] = strip_html content sheet1[count_row, 7] = "第#{discuss.position}关" sheet1[count_row, 8] = user.show_real_name @@ -4320,6 +4321,8 @@ end sheet1[count_row, 10] = user.school_name sheet1[count_row, 11] = format_time discuss.created_at sheet1[count_row, 12] = discuss.children.pluck(:user_id).include?(1) ? "是" : "否" + sheet1[count_row, 13] = myself_discuss.try(:content) + sheet1[count_row, 14] = myself_discuss ? (format_time myself_discuss.created_at) : "" count_row += 1 end #count_row += 1 From f17754c1480c140ad289bc7d16a5257996dac965 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 28 May 2019 11:13:43 +0800 Subject: [PATCH 66/67] 1 --- app/services/cnmoocs_service.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/services/cnmoocs_service.rb b/app/services/cnmoocs_service.rb index 40f75a8c..33f166da 100644 --- a/app/services/cnmoocs_service.rb +++ b/app/services/cnmoocs_service.rb @@ -7,7 +7,7 @@ class CnmoocsService limit = params[:pageSize] || 16 offset = page * limit.to_i shixuns = Shixun.select([:id, :identifier, :name, :myshixuns_count, :averge_star, :challenges_count, :trainee]). - where(status: 0, hidden: 0) + where(status: 2, hidden: 0) shixun_count = shixuns.count pageCount = ((shixun_count / limit.to_f) == (shixun_count / limit)) ? (shixun_count / limit) : ((shixun_count / limit) + 1) Rails.logger.info("#####{pageCount}") From ee2ae75ecc65f616c6a7cfa38f691f30545d3526 Mon Sep 17 00:00:00 2001 From: p31729568 Date: Tue, 28 May 2019 14:10:01 +0800 Subject: [PATCH 67/67] fix axlsx gem --- Gemfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index 11029470..7909cb17 100644 --- a/Gemfile +++ b/Gemfile @@ -63,8 +63,8 @@ gem 'elasticsearch-rails' gem 'oauth2' # xlsx -#gem 'axlsx', '3.0.0.pre' -#gem 'axlsx_rails', '0.3.0' +gem 'axlsx', '3.0.0.pre' +gem 'axlsx_rails', '0.3.0' #Ruby 2.2+ has removed test/unit from the core library. if RUBY_VERSION>='2.2'
  • 序号总耗时ID总耗时 作品更新 文件更新 中间层总耗时 pull代码 pod启动 pod执行中间层回传回传时间 前端轮询回调结果存储结果存储 创建时间实训名称唯一表示实训名称
    <%= index %><%= record.id %> <%= record.consume_time %> <%= record.student_work %> <%= record.file_update %><%= record.front_js %> <%= record.test_cases %> <%= format_time record.created_at %><%= record.identifier %> <%= link_to record.shixun.try(:name), task_path(record.game), :target => "_blank", :title => "#{record.shixun.try(:name)}" %>