Merge branches 'dev_aliyun', 'develop' and 'new_shixuns_repository' of https://bdgit.educoder.net/Hjqreturn/educoder into new_shixuns_repository

dev_static
杨树明 5 years ago
commit bd4235fce3

@ -170,11 +170,12 @@ class GraduationTopicsController < ApplicationController
teacher_group = @course.teacher_course_groups.where(:user_id => @graduation_topic.tea_id, :id => params[:group_id]).first
unless teacher_group.present?
member = @course.course_members.where(:user_id => @graduation_topic.tea_id).first
tip_exception("分班名称不能为空") if params[:course_group_name].blank?
course_group = CourseGroup.find_or_create_by!(:name => params[:course_group_name], :course_id => @course.id)
teacher_group = TeacherCourseGroup.find_or_create_by!(:course_id => @course.id, :course_member_id => member.try(:id),
:user_id => @graduation_topic.tea_id,
:course_group_id => course_group.try(:id))
if params[:course_group_name].present?
course_group = CourseGroup.find_or_create_by!(:name => params[:course_group_name], :course_id => @course.id)
teacher_group = TeacherCourseGroup.find_or_create_by!(:course_id => @course.id, :course_member_id => member.try(:id),
:user_id => @graduation_topic.tea_id,
:course_group_id => course_group.try(:id))
end
end
student_member = @course.course_members.where(:user_id => student_graduation_topic.user_id).first
student_member.update_attributes(:course_group_id => teacher_group.course_group_id) if student_member.present?

@ -194,7 +194,7 @@ class HomeworkCommonsController < ApplicationController
# TODO user_extension 如果修改 请调整
unless params[:search].blank?
@student_works = @student_works.joins(user: :user_extension).where("concat(lastname, firstname) like ?
or student_id like ?", "%#{params[:search]}%", "%#{params[:search]}%")
or student_id like ?", "%#{params[:search].strip}%", "%#{params[:search].strip}%")
end
@work_count = @student_works.size

@ -305,13 +305,20 @@ class HomeworksService
myshixun_endtime = games.select{|game| game.status == 2}.size == games.size ? games.map(&:end_time).max : nil
if work.work_status == 0
is_complete = myshixun_endtime && (myshixun_endtime < setting_time.end_time)
if is_complete || (myshixun.created_at < setting_time.end_time && (!homework.allow_late || setting_time.end_time >= Time.now))
work.work_status = 1
elsif homework.allow_late && myshixun.created_at < homework.late_time
work.work_status = 2
end
is_complete = myshixun_endtime && (myshixun_endtime < setting_time.end_time)
# if work.work_status == 0
# if is_complete || (myshixun.created_at < setting_time.end_time && (!homework.allow_late || setting_time.end_time >= Time.now))
# work.work_status = 1
# elsif homework.allow_late && myshixun.created_at < homework.late_time
# work.work_status = 2
# end
# end
if !homework.allow_late || is_complete
work.work_status = 1
elsif myshixun.created_at < homework.late_time
work.work_status = 2
end
if work.work_status != 0

@ -43,7 +43,8 @@ elsif @user_course_identity == Course::STUDENT
json.efficiency work_score_format(@work.efficiency, true, @score_open)
json.eff_score work_score_format(@work.eff_score, true, @score_open)
json.current_complete_count myshixun.try(:passed_count) if @homework.end_or_late
json.complete_count @work.myshixun&.time_passed_count(@homework.homework_group_setting(@work.user_id)&.end_time)
end_time = @homework.allow_late ? @homework.late_time : @homework.homework_group_setting(@work.user_id)&.end_time
json.complete_count @work.myshixun&.time_passed_count(end_time)
json.view_answer_count @work.myshixun.try(:view_answer_count).to_i
json.work_status @work.compelete_status
else
@ -101,7 +102,8 @@ if @homework.homework_type == "practice"
json.cost_time work.myshixun.try(:total_spend_time)
json.current_complete_count myshixun.try(:passed_count) if @homework.end_or_late
json.complete_count work.myshixun&.time_passed_count(@homework.homework_group_setting(work.user_id)&.end_time)
end_time = @homework.allow_late ? @homework.late_time : @homework.homework_group_setting(work.user_id)&.end_time
json.complete_count work.myshixun&.time_passed_count(end_time)
json.view_answer_count work.myshixun.try(:view_answer_count).to_i
json.user_login work.user.try(:login)
json.user_name work.user.try(:real_name)

@ -81,7 +81,7 @@ namespace :homework_publishtime do
end
end
student_works.joins(:myshixun).where("myshixuns.status != 1").update_all(late_penalty: homework.late_penalty) if student_works.present?
student_works.joins(:myshixun).where("myshixuns.status != 1").update_all(late_penalty: homework.late_penalty, work_status: 2) if student_works.present?
else
HomeworkEndUpdateScoreJob.perform_later(homework.id)

@ -79,16 +79,15 @@ class GraduateTopicDetailTable extends Component{
})
}
sureAgreeTopic=(count)=>{
if(count > 0){
let{tableData}=this.props;
let{operationId,classesId}=this.state
let courseId=this.props.match.params.course_id;
let{tableData}=this.props;
let{operationId,classesId}=this.state
let courseId=this.props.match.params.course_id;
if(classesId!=undefined){
let name=tableData.group_list.filter(item=>item.group_id==classesId)[0].group_name;
this.agreeChoose(courseId,operationId,classesId,name);
}else{
this.setState({
un_choose_notice:"请先添加分班"
})
this.agreeChoose(courseId,operationId,classesId);
}
}
@ -205,7 +204,7 @@ class GraduateTopicDetailTable extends Component{
>
<div className="newupload_conbox">
<p className="color-grey-9 mb15 edu-txt-center">确认同意学生的选题将学生加入我的分班</p>
<div className="df">
{ tableData.group_list && tableData.group_list.length===0?"":<div className="df">
<span className="lineh-40 mr10">选择</span>
<div className="flex1">
<Select placeholder="请选择分班" style={{"width":"100%"}} value={classesId} onChange={this.changeClasses}>
@ -220,7 +219,7 @@ class GraduateTopicDetailTable extends Component{
</Select>
<p style={{height:"20px",lineHeight:"20px"}}><span className="color-orange-tip">{un_choose_notice}</span></p>
</div>
</div>
</div>}
<div className="mt20 clearfix edu-txt-center">
<a onClick={this.hideAgreeTopic} className="pop_close task-btn mr30">取消</a>
<a className="task-btn task-btn-orange" onClick={()=>this.sureAgreeTopic(tableData.group_list.length)}>确定</a>

@ -364,7 +364,7 @@ class Listofworksstudentone extends Component {
),
},
{
title: '截止前完成关卡',
title: '结束前完成关卡',
dataIndex: 'completion',
key: 'completion',
align: "center",
@ -758,7 +758,7 @@ class Listofworksstudentone extends Component {
),
},
{
title: '截止前完成关卡',
title: '结束前完成关卡',
dataIndex: 'completion',
key: 'completion',
align: "center",
@ -1111,7 +1111,7 @@ class Listofworksstudentone extends Component {
),
},
{
title: '截止前完成关卡',
title: '结束前完成关卡',
dataIndex: 'completion',
key: 'completion',
align: 'center',
@ -1474,7 +1474,7 @@ class Listofworksstudentone extends Component {
),
},
{
title: '截止前完成关卡',
title: '结束前完成关卡',
dataIndex: 'completion',
key: 'completion',
align: 'center',

@ -39,6 +39,7 @@
user-select: none;
}
.btn_test_case,
.btn_test_case_active{
display: inline-block;
@ -80,6 +81,32 @@
bottom: 4px;
}
.blacktab_con_abs{
position: absolute !important;
left: 150px;
right: 150px;
top: 0;
height: 34px;
background: gold;
}
.code_evalute_icon{
position: absolute;
top: 0;
width: 56px;
height: 28px;
left: 50%;
margin-left: -28px;
background: rgba(42,58,79,1);
z-index: 10;
border-bottom-left-radius: 100px;
border-bottom-right-radius: 100px;
color: #fff;
text-align: center;
cursor: pointer;
opacity: .4;
transition: all .3s;
}
@keyframes mymove
{
from {right:0px;}

@ -224,6 +224,10 @@ class VNCContainer extends Component {
>
<style>{`
/* 评测结果 */
.codeEvaluateDrawer{
// position: absolute;
// bottom: 84px;
}
.codeEvaluateDrawer #game_test_set_results {
height: 198px;
}
@ -233,7 +237,10 @@ class VNCContainer extends Component {
.codeEvaluateDrawer .ant-drawer-content-wrapper, .codeEvaluateDrawer .ant-drawer-mask {
position: absolute;
}
.codeEvaluateDrawer .ant-drawer-content-wrapper .ant-drawer-content{
height: 100%;
background: rgb(5, 16, 26) !important;
}
.codeEvaluateFloatButton {
bottom: 180px !important;
@ -345,7 +352,8 @@ class VNCContainer extends Component {
className={'codeEvaluateDrawer'}
placement="bottom"
getContainer={false}
style={{ position: 'absolute', bottom: '-25px', zIndex: 1 }}
// style={{ position: 'absolute', bottom: '-25px', zIndex: 1 }}
style={{ position: 'absolute', bottom: '50px', zIndex: 1 }}
afterVisibleChange={(visible) => {
if (visible) {
const canvas = $('.vncDisply canvas')[0]
@ -356,16 +364,16 @@ class VNCContainer extends Component {
>
{ this.props.codeEvaluate }
</Drawer>
{/* <FloatButton onClick={this.swtichBottomDrawer}
<FloatButton onClick={this.swtichBottomDrawer}
className="codeEvaluateFloatButton"
>测试集</FloatButton> */}
<div
>测试集</FloatButton>
{/* <div
className={_classCtx}
onClick={this.swtichBottomDrawer}
>
> */}
{/* <span className="iconfont icon-shangjiantou btn-arrow"></span> */}
<span className={_classes}></span>
</div>
{/* <span className={_classes}></span> */}
{/* </div> */}
</VNCDisplay>

@ -1,9 +1,11 @@
#actionView {
position: relative;
background:rgba(5,16,26,1);
min-height: 49px;
/*box-shadow: inset 0 0 10px #27324c;*/
z-index: 9;
box-shadow: 0px -1px 4px 0px rgba(76,172,255,0.08);
z-index: 10001;
}
#time-consuming span {
color: #747A7F;

@ -1,3 +1,4 @@
import '../VNC.css';
import React, { Component } from 'react';
import IconButton from 'material-ui/IconButton';
@ -302,34 +303,39 @@ class CodeEvaluateView extends Component {
return (
<React.Fragment>
<ul id="blacktab_nav">
<li className="blacktab_con undis" >
</li>
{ challenge.isHtml ?
<li className={`blacktab_con ${ tabIndex === 0 ? 'tab_hover' : ''}`} onClick={() => this.tabIndexChange(0)}>
<a href="javascript:void(0);" className="tab_type tab_color">效果显示</a>
</li> : ''}
<li className={`blacktab_con ${ tabIndex === 1 ? 'tab_hover' : ''}`} onClick={() => this.tabIndexChange(1)}>
<a href="javascript:void(0);" className="tab_type tab_color">测试结果</a>
</li>
{this.props.inDrawer ? <Tooltip id="tooltip-icon-expand" title={ "收起" }>
{/*TODO 按钮大小改造css*/}
{/* icon-guanbi */}
<a className="iconButton fr mr15 mt4" onClick={this.props.hideCodeEvaluate} id="extend_and_zoom" >
<i className={ "font-18 iconfont icon-guanbi" }></i>
</a>
</Tooltip> : <Tooltip id="tooltip-icon-expand" title={ evaluateViewExpanded ? "" : ""}>
{/*TODO 按钮大小改造css*/}
<a className="iconButton fr mr15" onClick={this.onEvaluateViewExpand} id="extend_and_zoom" >
<i className={ evaluateViewExpanded ? "font-18 iconfont icon-shousuo" : "iconfont icon-zhankai font-18" }></i>
</a>
</Tooltip>}
<div className="cl"></div>
</ul>
<li className="blacktab_con undis" >
</li>
{ challenge.isHtml ?
<li className={`blacktab_con ${ tabIndex === 0 ? 'tab_hover' : ''}`} onClick={() => this.tabIndexChange(0)}>
<a href="javascript:void(0);" className="tab_type tab_color">效果显示</a>
</li> : ''}
<li className={`blacktab_con ${ tabIndex === 1 ? 'tab_hover' : ''}`} onClick={() => this.tabIndexChange(1)}>
<a href="javascript:void(0);" className="tab_type tab_color">测试结果</a>
</li>
{/* <li className="blacktab_con_abs">
<span className="code_evalute_icon">
<span className="iconfont icon-xiajiantou btn-arrow"></span>
</span>
</li> */}
{this.props.inDrawer ? <Tooltip id="tooltip-icon-expand" title={ "收起" }>
{/*TODO 按钮大小改造css*/}
{/* icon-guanbi */}
<a className="iconButton fr mr15 mt4" onClick={this.props.hideCodeEvaluate} id="extend_and_zoom" >
<i className={ "font-18 iconfont icon-guanbi" }></i>
</a>
</Tooltip> : <Tooltip id="tooltip-icon-expand" title={ evaluateViewExpanded ? "" : ""}>
{/*TODO 按钮大小改造css*/}
<a className="iconButton fr mr15" onClick={this.onEvaluateViewExpand} id="extend_and_zoom" >
<i className={ evaluateViewExpanded ? "font-18 iconfont icon-shousuo" : "iconfont icon-zhankai font-18" }></i>
</a>
</Tooltip>}
<div className="cl"></div>
</ul>
<CircularProgress size={40} thickness={3}

@ -296,32 +296,58 @@ class CodeRepositoryViewContainer extends Component {
render() {
return (
<React.Fragment>
{this.props.isOnlyContainer == true ?
React.Children.map(this.props.children, child => {
if(!child) {
return ''
}
return React.cloneElement(child, Object.assign({...this.state}, {
loadRepoFiles: this.loadRepoFiles,
onTreeSelect: this.onTreeSelect,
onLoadData: this.onLoadData,
}))
})
// <React.Fragment>
// {this.props.isOnlyContainer == true ?
// React.Children.map(this.props.children, child => {
// if(!child) {
// return ''
// }
// return React.cloneElement(child, Object.assign({...this.state}, {
// loadRepoFiles: this.loadRepoFiles,
// onTreeSelect: this.onTreeSelect,
// onLoadData: this.onLoadData,
// }))
// })
:
<CodeRepositoryView {...this.props}
{...this.state}
showFilesDrawer={this.showFilesDrawer}
loadRepoFiles={this.loadRepoFiles}
onLoadData={this.onLoadData}
onTreeSelect={ this.onTreeSelect }
onRepositoryViewExpand={this.onRepositoryViewExpand}
tabIndexChange={this.tabIndexChange}
showSettingDrawer={this.showSettingDrawer}
></CodeRepositoryView> }
</React.Fragment>
// :
// <CodeRepositoryView {...this.props}
// {...this.state}
// showFilesDrawer={this.showFilesDrawer}
// loadRepoFiles={this.loadRepoFiles}
// onLoadData={this.onLoadData}
// onTreeSelect={ this.onTreeSelect }
// onRepositoryViewExpand={this.onRepositoryViewExpand}
// tabIndexChange={this.tabIndexChange}
// showSettingDrawer={this.showSettingDrawer}
// ></CodeRepositoryView> }
// </React.Fragment>
<React.Fragment>
{this.props.isOnlyContainer == true ?
React.Children.map(this.props.children, child => {
if(!child) {
return ''
}
return React.cloneElement(child, Object.assign({...this.state}, {
loadRepoFiles: this.loadRepoFiles,
onTreeSelect: this.onTreeSelect,
onLoadData: this.onLoadData,
}))
})
:
<CodeRepositoryView {...this.props}
{...this.state}
showFilesDrawer={this.showFilesDrawer}
loadRepoFiles={this.loadRepoFiles}
onLoadData={this.onLoadData}
onTreeSelect={ this.onTreeSelect }
onRepositoryViewExpand={this.onRepositoryViewExpand}
tabIndexChange={this.tabIndexChange}
showSettingDrawer={this.showSettingDrawer}
></CodeRepositoryView> }
</React.Fragment>
);
}
}

@ -278,7 +278,7 @@ class Challengesjupyter extends Component {
this.setState({
showtime:false
})
}, 500)
}, 800)
}else{
this.setState({
@ -292,7 +292,7 @@ class Challengesjupyter extends Component {
})
this.props.showNotification('实训保存失败!');
})
}, 500)
}, 800)
}

Loading…
Cancel
Save