Merge branch 'develop' into educoder

pre_develop
daiao 6 years ago
commit 3c20d476e7

@ -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_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_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)}", 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), go_back_url: ec_major_school_path(major),
ec_course_support_setting_url: ec_course_support_setting_url, ec_course_support_setting_url: ec_course_support_setting_url,
ec_course_reach_setting_url: ec_course_reach_setting_url, ec_course_reach_setting_url: ec_course_reach_setting_url,

@ -224,8 +224,11 @@
to_relate.attributes = relate.attributes.except('id', 'ec_course_achievement_method_id', 'ec_course_target_id', 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') '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_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! to_relate.save!
achievement_evaluation_relates_map[relate.id] = to_relate.id
end end
end end
@ -258,14 +261,16 @@
end end
def copy_year_students! 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| students.each do |student|
to_student = to_year.ec_year_students.new 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! to_student.save!
copy_student_achievements!(student, to_student) copy_student_achievements!(student, to_student)
copy_course_student_scores!(student, to_student)
copy_student_score_targets!(student, to_student)
end end
end end
@ -280,6 +285,31 @@
end end
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 def graduation_requirement_map
@_graduation_requirement_map ||= {} @_graduation_requirement_map ||= {}
end end
@ -300,7 +330,15 @@
@_course_evaluation_subitem_map ||= {} @_course_evaluation_subitem_map ||= {}
end end
def achievement_evaluation_relates_map
@_achievement_evaluation_relates_map ||= {}
end
def course_target_map def course_target_map
@_course_target_map ||= {} @_course_target_map ||= {}
end end
def course_student_score_map
@_course_student_score_map ||= {}
end
end end

@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name="theme-color" content="#000000"><meta name="renderer" content="webkit"/><meta name="force-rendering" content="webkit"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><link rel="manifest" href="/manifest.json"><link rel="shortcut icon" href="/favicon.ico"><title>Educoder</title><script type="text/javascript">window.__isR=!0</script><link rel="stylesheet" href="/react/build/css/css_min_all.css"><link rel="stylesheet" href="/assets/iconfont/iconfont.css"><link href="/react/build/./static/css/main.c233538b.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="md_div" style="display:none"></div><div id="root" class="page -layout-v -fit"></div><div id="picture_display" style="display:none"></div><script type="text/javascript" src="/react/build/js/js_min_all.js"></script><script type="text/javascript" src="/assets/kindeditor/kindeditor.js"></script><script type="text/javascript" src="/react/build/js/create_kindeditor.js"></script><script type="text/javascript" src="/javascripts/educoder/edu_application.js"></script><script type="text/javascript" src="/react/build/./static/js/main.6f8a3c95.js"></script></body></html> <!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name="theme-color" content="#000000"><meta name="renderer" content="webkit"/><meta name="force-rendering" content="webkit"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><link rel="manifest" href="/manifest.json"><link rel="shortcut icon" href="/favicon.ico"><title>Educoder</title><script type="text/javascript">window.__isR=!0</script><link rel="stylesheet" href="/react/build/css/css_min_all.css"><link rel="stylesheet" href="/assets/iconfont/iconfont.css"><link href="/react/build/./static/css/main.ce4a97cd.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="md_div" style="display:none"></div><div id="root" class="page -layout-v -fit"></div><div id="picture_display" style="display:none"></div><script type="text/javascript" src="/react/build/js/js_min_all.js"></script><script type="text/javascript" src="/assets/kindeditor/kindeditor.js"></script><script type="text/javascript" src="/react/build/js/create_kindeditor.js"></script><script type="text/javascript" src="/javascripts/educoder/edu_application.js"></script><script type="text/javascript" src="/react/build/./static/js/main.8545f40f.js"></script></body></html>

@ -9,7 +9,13 @@
<%= favicon %> <%= favicon %>
<%= javascript_heads %> <%= javascript_heads %>
<%= heads_for_theme %> <%= 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' %>
<!-- TODO md找替代方案 -->
<%= 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' %> <%= 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 %> <%= call_hook :view_layouts_base_html_head %>
<!-- page specific tags --> <!-- page specific tags -->

@ -4,13 +4,21 @@
<div class="teacherTeamItem clearfix"> <div class="teacherTeamItem clearfix">
<p class="clearfix title-line"> <div class="clearfix df title-line">
<a href="<%= user_path(member.user) %>" target="_blank" class="fl"> <a href="<%= user_path(member.user) %>" target="_blank" class="fl">
<%= image_tag(url_to_avatar(member.user), :width =>"80", :height => "80", :class => "radius", :alt=>"头像") %> <%= image_tag(url_to_avatar(member.user), :width =>"80", :height => "80", :class => "radius", :alt=>"头像") %>
</a> </a>
<div class="flex1 ml15">
<span class="font-18 font-bd"></span> <p class="mb10 mt5 task-hide" style="max-width: 120px;"><%= member.user.try(:show_name) %></p>
<div class="clearfix ml3">
<p class="color-grey-9 font-12">
<!-- <span class="mr10"><%#= member.user.school_name %></span>-->
<span><%= member.user.identity == "学生" ? "" : member.user.identity %></span>
</p>
<!--<a href="JavaScript:void(0)" class="edu-default-btn edu-focus-btn fr color-grey-6">关注</a>-->
</div>
</div>
<span class="fr"> <span class="fr">
@ -21,31 +29,22 @@
<% end %> <% end %>
<% if User.current.member_of_subject?(@subject) && member.position > 1 %> <% if User.current.member_of_subject?(@subject) && member.position > 1 %>
<a data-method="POST" class="fl ring-op-green mr25 mt7" data-remote="true" href="<%= up_member_position_subject_path(@subject, :mem_id => member.id) %>"> <a data-method="POST" class="fl ring-op-green mr20 mt7" data-remote="true" href="<%= up_member_position_subject_path(@subject, :mem_id => member.id) %>">
<img src="/images/educoder/icon/moveup.svg" data-tip-down="向上移动" class="fl mt2 ml4"> <img src="/images/educoder/icon/moveup.svg" data-tip-down="向上移动" class="fl mt2 ml4">
</a> </a>
<% end %> <% end %>
<% if User.current.member_of_subject?(@subject) && member.position < @subject.subject_members.size %> <% if User.current.member_of_subject?(@subject) && member.position < @subject.subject_members.size %>
<a data-method="POST" class="fl ring-op-green mr25 mt7" data-remote="true" href="<%= down_member_position_subject_path(@subject, :mem_id => member.id) %>"> <a data-method="POST" class="fl ring-op-green mt7" data-remote="true" href="<%= down_member_position_subject_path(@subject, :mem_id => member.id) %>">
<img src="/images/educoder/icon/movedown.svg" data-tip-down="向下移动" class="fl mt2 ml4"> <img src="/images/educoder/icon/movedown.svg" data-tip-down="向下移动" class="fl mt2 ml4">
</a> </a>
<% end %> <% end %>
</span> </span>
</p>
<div class=" ml15">
<p class="mb10 mt5"><%= member.user.try(:show_name) %></p>
<div class="clearfix ml3">
<p class="color-grey-9 font-12">
<!-- <span class="mr10"><%#= member.user.school_name %></span>-->
<span><%= member.user.identity == "学生" ? "" : member.user.identity %></span>
</p>
<!--<a href="JavaScript:void(0)" class="edu-default-btn edu-focus-btn fr color-grey-6">关注</a>-->
</div>
</div> </div>
</div> </div>
<% end %> <% end %>
<% end %> <% end %>

@ -17,14 +17,17 @@ import Button from 'material-ui/Button';
import './tpiPage.css'; import './tpiPage.css';
import './tpiPageForMobile.css'; import './tpiPageForMobile.css';
const $ = window.$; const $ = window.$;
const showIframeContent = window.location.search.indexOf('vnc=1') != -1;
class MainContent extends Component { class MainContent extends Component {
componentDidMount() { componentDidMount() {
// ios下图标位置有问题 // ios下图标位置有问题
if (!showIframeContent) {
setTimeout(()=>{ setTimeout(()=>{
if (window.$('.b-label>.resize-helper').position().top < 100) { if (window.$('.b-label>.resize-helper').position().top < 100) {
window.$('.b-label>.resize-helper').css('top', '200px') window.$('.b-label>.resize-helper').css('top', '200px')
} }
}, 4000) }, 4000)
}
$("body").css("padding-right","0px!important") $("body").css("padding-right","0px!important")
} }
onResizeButtonClick = () => { onResizeButtonClick = () => {
@ -45,7 +48,6 @@ class MainContent extends Component {
} else { } else {
games_repository_contents_style = {overflow: 'hidden', height: '445px'} games_repository_contents_style = {overflow: 'hidden', height: '445px'}
} }
return ( return (
<div className="page--body -margin-t-64 -flex"> <div className="page--body -margin-t-64 -flex">
<div className="-layout -stretch -fit labelN" id="game_show_content"> <div className="-layout -stretch -fit labelN" id="game_show_content">
@ -65,6 +67,21 @@ class MainContent extends Component {
<div className="split-panel--second -layout -vertical -flex -relative -flex-basic50" <div className="split-panel--second -layout -vertical -flex -relative -flex-basic50"
id="game_right_contents" style={{width: '996px'}}> id="game_right_contents" style={{width: '996px'}}>
{/*
iframe模式下需要这两个样式来调整
.page--body { z-index: 9999; }
.resize-helper { top: 10px }
*/}
<style>{`
#contentIframe {
height: 100%;
background: #fff;
}
.page--body { z-index: ${showIframeContent ? '7999': '1'} ; }
.b-label>.resize-helper { top: ${showIframeContent ? '10px': '50%'} }
`}</style>
{ showIframeContent ? <iframe src="http://106.75.27.125:42288/vnc.html" id="contentIframe" ></iframe> :
<React.Fragment>
{/* 旧版本、评测等待提示--更新提示块*/} {/* 旧版本、评测等待提示--更新提示块*/}
{/*<div className="tip-panel-animate clearfix user_bg_shadow bor-grey-e"> {/*<div className="tip-panel-animate clearfix user_bg_shadow bor-grey-e">
<div className="fl tip-img"> <div className="fl tip-img">
@ -123,6 +140,8 @@ class MainContent extends Component {
<div id="actionView" className="-layout-h -center -bg-grey-90 -grey-20 -bg-darkblack" style={{height:'48px'}}> <div id="actionView" className="-layout-h -center -bg-grey-90 -grey-20 -bg-darkblack" style={{height:'48px'}}>
<ActionView onRunCodeTest={onRunCodeTest} {...this.props}></ActionView> <ActionView onRunCodeTest={onRunCodeTest} {...this.props}></ActionView>
</div> </div>
</React.Fragment>
}
</div> </div>
</div> </div>
</div> </div>

Loading…
Cancel
Save