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, diff --git a/app/services/copy_ec_year_service.rb b/app/services/copy_ec_year_service.rb index 7ad46c5f..31bac9f9 100644 --- a/app/services/copy_ec_year_service.rb +++ b/app/services/copy_ec_year_service.rb @@ -224,8 +224,11 @@ 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] + # 可能不存在,所以为 -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 end end @@ -258,14 +261,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 +285,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 +330,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 diff --git a/app/views/common/index.html.erb b/app/views/common/index.html.erb index 82b976cb..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 diff --git a/app/views/layouts/base_ec.html.erb b/app/views/layouts/base_ec.html.erb index 0e1c6279..10113aa8 100644 --- a/app/views/layouts/base_ec.html.erb +++ b/app/views/layouts/base_ec.html.erb @@ -9,7 +9,13 @@ <%= 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 '/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 %> 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 diff --git a/public/react/src/modules/page/MainContent.js b/public/react/src/modules/page/MainContent.js index ff9f753d..ee3fcdf9 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('vnc=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 ? : + {/* 旧版本、评测等待提示--更新提示块*/} {/*
@@ -74,55 +91,57 @@ class MainContent extends Component {
*/}
-
-
-
-
- - {/* 选择题或编程题 */} - {/* readRepoTimeout 如果读取代码超时,显示重新加载按钮,重新拉取代码 */} - { - st === 0 - ? - readRepoTimeout === true ? : - - -
- -
-
- : - } - - {/* */} -
-
- {/*
*/} -
-
- {/* 测试结果、评测信息区域 */} - { loading ? - : - st === 0 - ? - : - } -
-
-
-
-
- -
- -
+
+
+
+
+ + {/* 选择题或编程题 */} + {/* readRepoTimeout 如果读取代码超时,显示重新加载按钮,重新拉取代码 */} + { + st === 0 + ? + readRepoTimeout === true ? : + + +
+ +
+
+ : + } + + {/* */} +
+
+ {/*
*/} +
+
+ {/* 测试结果、评测信息区域 */} + { loading ? + : + st === 0 + ? + : + } +
+
+
+
+
+ +
+ +
+
+ }