dev_static
daiao 5 years ago
commit 680f124bd3

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

@ -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>
);
}
}

Loading…
Cancel
Save