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_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,

@ -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

@ -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 %>
<%= 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' %>
<!-- 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' %>
<%= call_hook :view_layouts_base_html_head %>
<!-- page specific tags -->

@ -4,48 +4,47 @@
<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">
<%= image_tag(url_to_avatar(member.user), :width =>"80", :height => "80", :class => "radius", :alt=>"头像") %>
</a>
<div class="flex1 ml15">
<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="font-18 font-bd"></span>
<span class="fr">
<span class="fr">
<% if User.current.admin? && member.role != 1 %>
<a class="fl mr20 mt4" data-tip-down="删除" onclick="delete_confirm_box_2('<%= delete_member_subject_path(@subject, :mem_id => member.id) %>', '确定要删除该成员吗?');">
<img src="/images/educoder/icon/del.svg" class="fl mt4 ml4">
</a>
<% end %>
<% if User.current.admin? && member.role != 1 %>
<a class="fl mr20 mt4" data-tip-down="删除" onclick="delete_confirm_box_2('<%= delete_member_subject_path(@subject, :mem_id => member.id) %>', '确定要删除该成员吗?');">
<img src="/images/educoder/icon/del.svg" class="fl mt4 ml4">
</a>
<% end %>
<% if User.current.member_of_subject?(@subject) && member.position > 1 %>
<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">
</a>
<% end %>
<% 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) %>">
<img src="/images/educoder/icon/moveup.svg" data-tip-down="向上移动" class="fl mt2 ml4">
</a>
<% end %>
<% if User.current.member_of_subject?(@subject) && member.position < @subject.subject_members.size %>
<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">
</a>
<% end %>
<% 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) %>">
<img src="/images/educoder/icon/movedown.svg" data-tip-down="向下移动" class="fl mt2 ml4">
</a>
<% end %>
</span>
</span>
</div>
</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>
<% end %>
<% end %>

@ -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 (
<div className="page--body -margin-t-64 -flex">
<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"
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="fl tip-img">
@ -74,55 +91,57 @@ class MainContent extends Component {
</div>*/}
<div className="-layout-v -flex">
<div className="-flex -relative">
<div className="split-panel -fit -vertical" id="games_repository_valuation">
<div className="-layout -stretch -fit -vertical centerH">
<div className="-layout -vertical -flex -relative -flex-basic70 -bg-weightblack"
id="games_repository_contents" style={games_repository_contents_style} >
{/* 选择题或编程题 */}
{/* readRepoTimeout 如果读取代码超时,显示重新加载按钮,重新拉取代码 */}
{
st === 0
?
readRepoTimeout === true ? <div className="readRepoFailed">
代码加载失败<a className="retry"
onClick={() => this.props.fetchRepositoryCode(this.props, null, null, true)}>重试</a>
</div> :
<React.Fragment>
<CircularProgress size={40} thickness={3}
style={{ display: (codeLoading ? 'block' : 'none') , marginLeft: 'auto', marginRight: 'auto', marginTop: '20%' }}/>
<div style={{ display: (codeLoading ? 'none' : 'block') }}>
<CodeRepositoryViewContainer { ...this.props } ></CodeRepositoryViewContainer>
</div>
</React.Fragment>
: <ChooseRepositoryView ref="chooseQ" { ...this.props }></ChooseRepositoryView>
}
{/* */}
</div>
<div className="h-center" style={{top: '438px'}}>
{/*<div className="-changebg -bg-weightblack" id="-bg-change-color"></div>*/}
</div>
<div className="split-panel--second -layout -vertical -flex -relative -bg-black -flex-basic60"
id="games_valuation_contents" style={{height: '258px'}}>
{/* 测试结果、评测信息区域 */}
{ loading ? <CircularProgress size={40} thickness={3} style={{ marginLeft: 'auto', marginRight: 'auto', marginTop: '10%', display: 'block' }}/>
:
st === 0
? <CodeEvaluateView output_sets={output_sets} latest_output={latest_output}
record={record} onTestSetHeaderClick={onTestSetHeaderClick} {...this.props}></CodeEvaluateView>
: <ChooseEvaluateView {...this.props}></ChooseEvaluateView>
}
</div>
</div>
</div>
</div>
</div>
<div id="actionView" className="-layout-h -center -bg-grey-90 -grey-20 -bg-darkblack" style={{height:'48px'}}>
<ActionView onRunCodeTest={onRunCodeTest} {...this.props}></ActionView>
</div>
<div className="-flex -relative">
<div className="split-panel -fit -vertical" id="games_repository_valuation">
<div className="-layout -stretch -fit -vertical centerH">
<div className="-layout -vertical -flex -relative -flex-basic70 -bg-weightblack"
id="games_repository_contents" style={games_repository_contents_style} >
{/* 选择题或编程题 */}
{/* readRepoTimeout 如果读取代码超时,显示重新加载按钮,重新拉取代码 */}
{
st === 0
?
readRepoTimeout === true ? <div className="readRepoFailed">
代码加载失败<a className="retry"
onClick={() => this.props.fetchRepositoryCode(this.props, null, null, true)}>重试</a>
</div> :
<React.Fragment>
<CircularProgress size={40} thickness={3}
style={{ display: (codeLoading ? 'block' : 'none') , marginLeft: 'auto', marginRight: 'auto', marginTop: '20%' }}/>
<div style={{ display: (codeLoading ? 'none' : 'block') }}>
<CodeRepositoryViewContainer { ...this.props } ></CodeRepositoryViewContainer>
</div>
</React.Fragment>
: <ChooseRepositoryView ref="chooseQ" { ...this.props }></ChooseRepositoryView>
}
{/* */}
</div>
<div className="h-center" style={{top: '438px'}}>
{/*<div className="-changebg -bg-weightblack" id="-bg-change-color"></div>*/}
</div>
<div className="split-panel--second -layout -vertical -flex -relative -bg-black -flex-basic60"
id="games_valuation_contents" style={{height: '258px'}}>
{/* 测试结果、评测信息区域 */}
{ loading ? <CircularProgress size={40} thickness={3} style={{ marginLeft: 'auto', marginRight: 'auto', marginTop: '10%', display: 'block' }}/>
:
st === 0
? <CodeEvaluateView output_sets={output_sets} latest_output={latest_output}
record={record} onTestSetHeaderClick={onTestSetHeaderClick} {...this.props}></CodeEvaluateView>
: <ChooseEvaluateView {...this.props}></ChooseEvaluateView>
}
</div>
</div>
</div>
</div>
</div>
<div id="actionView" className="-layout-h -center -bg-grey-90 -grey-20 -bg-darkblack" style={{height:'48px'}}>
<ActionView onRunCodeTest={onRunCodeTest} {...this.props}></ActionView>
</div>
</React.Fragment>
}
</div>
</div>
</div>

Loading…
Cancel
Save