Merge branch 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_newshixunModel
hjm 5 years ago
commit 8bac33c034

@ -692,7 +692,7 @@ class PollsController < ApplicationController
else else
unified_setting = @poll.unified_setting unified_setting = @poll.unified_setting
end end
show_result = params[:show_result] ? 1 : 0 show_result = params[:show_result].to_i
un_anonymous = params[:un_anonymous] ? true : false un_anonymous = params[:un_anonymous] ? true : false
# 统一设置或者分班为0则更新问卷并删除问卷分组 # 统一设置或者分班为0则更新问卷并删除问卷分组
if unified_setting || (course_group_ids.size == 0) if unified_setting || (course_group_ids.size == 0)

@ -4,5 +4,5 @@ json.name user.full_name
json.grade user.grade json.grade user.grade
json.identity user&.user_extension&.identity json.identity user&.user_extension&.identity
# json.email user.mail # 邮箱原则上不暴露的,如果实在需要的话只能对某些具体的接口公开 # json.email user.mail # 邮箱原则上不暴露的,如果实在需要的话只能对某些具体的接口公开
json.image_url image_tag(url_to_avatar(user)) json.image_url url_to_avatar(user)
json.school user.school_name json.school user.school_name

@ -1,6 +1,6 @@
json.id @user.id json.id @user.id
json.name @user.full_name json.name @user.full_name
json.avatar_url image_tag("/" + url_to_avatar(@user)) json.avatar_url url_to_avatar(@user)
json.is_logged_user @user.logged_user? json.is_logged_user @user.logged_user?
json.experience @user.experience json.experience @user.experience
json.grade @user.grade json.grade @user.grade

@ -285,7 +285,7 @@ class GraduationTasksSubmitedit extends Component{
let{ search,page,limit,workslist}=this.state; let{ search,page,limit,workslist}=this.state;
let newpage=page+2 let newpage=page+1
this.searchList(search,newpage,limit,workslist.task_id,1) this.searchList(search,newpage,limit,workslist.task_id,1)

@ -271,20 +271,27 @@ class GraduationTasksSubmitnew extends Component{
contentViewScroll=(e)=>{ contentViewScroll=(e)=>{
//滑动到底判断
//滑动到底判断
const {memberslist} = this.state;
let newscrollTop=parseInt(e.currentTarget.scrollTop); let newscrollTop=parseInt(e.currentTarget.scrollTop);
let allclientHeight=e.currentTarget.clientHeight+newscrollTop; let allclientHeight=e.currentTarget.clientHeight+newscrollTop;
if(e.currentTarget.scrollHeight-allclientHeight===0||e.currentTarget.scrollHeight-allclientHeight===1||e.currentTarget.scrollHeight-allclientHeight===-1){ if(e.currentTarget.scrollHeight-allclientHeight===0||e.currentTarget.scrollHeight-allclientHeight===1||e.currentTarget.scrollHeight-allclientHeight===-1){
// console.log("到达底部");
let{ search,page,limit }=this.state; if(memberslist.length===0){
return;
}else{
let{ search,page,limit }=this.state;
let newpage=page+2 let newpage=page+1
this.searchList(search,newpage,limit,1)
}
}
this.searchList(search,newpage,limit,1)
}
} }

@ -80,6 +80,8 @@ class GraduationTaskssettingapp extends Component{
starttime:undefined, starttime:undefined,
DownloadType:false, DownloadType:false,
DownloadMessageval:undefined, DownloadMessageval:undefined,
commentstatustype:undefined,
commenttimeone:undefined
} }
} }
@ -102,10 +104,10 @@ class GraduationTaskssettingapp extends Component{
} }
let starttype=false; let starttype=false;
let endtype=false; let endtype=false;
if(moment(result.data.publish_time)<moment()){ if(moment(result.data.publish_time)<=moment()){
starttype=true starttype=true
} }
if(moment(result.data.end_time)<moment()){ if(moment(result.data.end_time)<=moment()){
endtype=true endtype=true
} }
@ -130,6 +132,7 @@ class GraduationTaskssettingapp extends Component{
taskname: result.data.task_name, taskname: result.data.task_name,
coursename: result.data.course_name, coursename: result.data.course_name,
commentstatus: result.data.comment_status, commentstatus: result.data.comment_status,
commentstatustype:result.data.status,
commentnum: result.data.comment_num, commentnum: result.data.comment_num,
operworks: result.data.open_work, operworks: result.data.open_work,
opergrade: result.data.open_score, opergrade: result.data.open_score,
@ -345,26 +348,31 @@ class GraduationTaskssettingapp extends Component{
this.setState({ this.setState({
latetime:newlatetime, latetime:newlatetime,
crosscomment:true, crosscomment:true,
commenttime:newcommenttime commenttime:newcommenttime,
commenttimeone:newcommenttime,
}) })
}else{ }else{
if(endtimetype===true){ if(endtimetype===true){
this.setState({ this.setState({
crosscomment:true, crosscomment:true,
commenttime:newcommenttime commenttime:newcommenttime,
commenttimeone:newcommenttime,
}) })
}else{ }else{
this.setState({ this.setState({
end_time:newlatetime, end_time:newlatetime,
crosscomment:true, crosscomment:true,
commenttime:newcommenttime commenttime:newcommenttime,
commenttimeone:newcommenttime,
}) })
} }
} }
} }
funcrosscomment=(e)=>{ funcrosscomment=(e)=>{
let {latetime,end_time,allowlate}=this.state; let {latetime,end_time,allowlate,commenttime,commenttimeone}=this.state;
let commenttimetype=commenttime===null||commenttime==="";
let newlatetimea=moment(new Date()).add(7, 'days').format("YYYY-MM-DD HH:mm"); let newlatetimea=moment(new Date()).add(7, 'days').format("YYYY-MM-DD HH:mm");
let newcommenttimea=moment(new Date()).format("YYYY-MM-DD HH:mm"); let newcommenttimea=moment(new Date()).format("YYYY-MM-DD HH:mm");
@ -377,26 +385,33 @@ class GraduationTaskssettingapp extends Component{
let newend_timed=moment(end_time).add(7, 'days').format("YYYY-MM-DD HH:mm"); let newend_timed=moment(end_time).add(7, 'days').format("YYYY-MM-DD HH:mm");
let newcommenttimed=moment(end_time).add(8, 'days').format("YYYY-MM-DD HH:mm"); let newcommenttimed=moment(end_time).add(8, 'days').format("YYYY-MM-DD HH:mm");
let newtime;
if(e.target.checked===true){ if(e.target.checked===true){
if(commenttimetype===true){
if(allowlate===1||allowlate===true){
if(latetime===null||latetime===""){ if(allowlate===1||allowlate===true){
this.updatesfuncrosscomment(1,newlatetimea,newcommenttimea) if(latetime===null||latetime===""){
}else{ this.updatesfuncrosscomment(1,newlatetimea,newcommenttimea)
this.updatesfuncrosscomment(1,newlatetimes,newcommenttimes) }else{
} this.updatesfuncrosscomment(1,newlatetimes,newcommenttimes)
}else{ }
if(end_time===null||end_time===""){ }else{
this.updatesfuncrosscomment(2,newend_timeb,newcommenttimeb) if(end_time===null||end_time===""){
this.updatesfuncrosscomment(2,newend_timeb,newcommenttimeb)
}else{
this.updatesfuncrosscomment(2,newend_timed,newcommenttimed)
}
}
}else{ }else{
this.updatesfuncrosscomment(2,newend_timed,newcommenttimed) this.setState({
} crosscomment:e.target.checked,
} commenttime:commenttimeone,
})
}
}else{ }else{
this.setState({ this.setState({
crosscomment:e.target.checked, crosscomment:e.target.checked,
commenttime:undefined commenttime:undefined
}) })
} }
} }
@ -519,7 +534,7 @@ class GraduationTaskssettingapp extends Component{
} }
if(moment(end_time)<moment(publish_time)){ if(moment(end_time)<=moment(publish_time)){
this.setState({ this.setState({
endTimetypes:true, endTimetypes:true,
endTimetypesval:"截止时间不能早于发布时间" endTimetypesval:"截止时间不能早于发布时间"
@ -531,13 +546,13 @@ class GraduationTaskssettingapp extends Component{
}) })
} }
if(moment(latetime)<moment(publish_time)){ if(moment(latetime)<=moment(publish_time)){
this.setState({ this.setState({
latetimetype:true, latetimetype:true,
latetimetypeval:"结束时间不能早于发布时间" latetimetypeval:"结束时间不能早于发布时间"
}) })
return return
}else if(moment(latetime)<moment(end_time)){ }else if(moment(latetime)<=moment(end_time)){
this.setState({ this.setState({
latetimetype:true, latetimetype:true,
latetimetypeval:"结束时间不能早于截止时间" latetimetypeval:"结束时间不能早于截止时间"
@ -562,7 +577,7 @@ class GraduationTaskssettingapp extends Component{
commenttimetype:false commenttimetype:false
}) })
} }
if(moment(this.state.commenttime)<moment(publish_time)){ if(moment(this.state.commenttime)<=moment(publish_time)){
this.setState({ this.setState({
commenttimetype:true, commenttimetype:true,
commenttimevalue:"开始时间不能小于发布时间", commenttimevalue:"开始时间不能小于发布时间",
@ -574,7 +589,7 @@ class GraduationTaskssettingapp extends Component{
}) })
} }
if(moment(this.state.commenttime)<moment(end_time)){ if(moment(this.state.commenttime)<=moment(end_time)){
this.setState({ this.setState({
commenttimetype:true, commenttimetype:true,
commenttimevalue:"开始时间不能小于截止时间", commenttimevalue:"开始时间不能小于截止时间",
@ -918,7 +933,8 @@ class GraduationTaskssettingapp extends Component{
endtimetype, endtimetype,
commenttimetype, commenttimetype,
commenttimevalue, commenttimevalue,
flagPageEdit flagPageEdit,
commentstatustype
} =this.state; } =this.state;
let courseId=this.props.match.params.coursesId; let courseId=this.props.match.params.coursesId;
@ -1154,7 +1170,7 @@ class GraduationTaskssettingapp extends Component{
<div className={" font-16 color-dark h20 mb20"}>评分设置 </div> <div className={" font-16 color-dark h20 mb20"}>评分设置 </div>
<div className={"font-16 h20 mb20"}>最终成绩组成 <span className={"font-14 color-grey-c"}>取各教师最终评分的平均分</span></div> <div className={"font-16 h20 mb20"}>最终成绩组成 <span className={"font-14 color-grey-c"}>取各教师最终评分的平均分</span></div>
<Checkbox className="ml40 font-16" checked={crosscomment} onChange={this.funcrosscomment} <Checkbox className="ml40 font-16" checked={crosscomment} onChange={this.funcrosscomment}
disabled={this.props.isAdmin()===true?flagPageEdit===true?false:true:true} >启用交叉评阅 <span className={"font-14 color-grey-c"}>给老师分配其他指导老师的学生作品</span> disabled={this.props.isAdmin()===true?flagPageEdit===true?commentstatustype===3?true:false:true:true} >启用交叉评阅 <span className={"font-14 color-grey-c"}>给老师分配其他指导老师的学生作品</span>
</Checkbox> </Checkbox>
{crosscomment===true?<div> {crosscomment===true?<div>
<div className={"h20 mb30 ml30 mt20 ml87"}> <div className={"h20 mb30 ml30 mt20 ml87"}>

@ -850,47 +850,47 @@ class GraduationTaskssettinglist extends Component{
</span> </span>
), ),
}, { }, {
title: '操作', title: '操作',
key: 'operation', key: 'operation',
width:'100px', width:'100px',
dataIndex: 'operation', dataIndex: 'operation',
className:'edu-txt-center', className:'edu-txt-center',
render: operation => ( render: operation => (
<div> <div>
{this.props.isAdmin()?operation.map((tag,key) => { {this.props.isAdmin()?operation.map((tag,key) => {
return( return(
<React.Fragment> <React.Fragment>
{ {
tag.name && tag.name &&
<Tooltip key={key} placement="bottom" title={tag.name==="分配"?"指定该作品的交叉评阅人":tag.name==="调分"?<pre>调整学生最终成绩<br/>其它历史评分将全部失效</pre>:""}> <Tooltip key={key} placement="bottom" title={tag.name==="分配"?"指定该作品的交叉评阅人":tag.name==="调分"?<pre>调整学生最终成绩<br/>其它历史评分将全部失效</pre>:""}>
{tag.name==="评阅"?<a style={{color:'#4CACFF',padding:"0px 5px"}} href={"/courses/"+courseId+"/graduation_tasks/"+tag.id+"/appraise"} > {tag.name==="评阅"?<a style={{color:'#4CACFF',padding:"0px 5px"}} href={"/courses/"+courseId+"/graduation_tasks/"+tag.id+"/appraise"} >
{tag.name} {tag.name}
</a> </a>
: :
<a style={{color:tag.name==="调分"?"#000":'#4CACFF',padding:"0px 5px"}} <a style={{color:tag.name==="调分"?"#000":'#4CACFF',padding:"0px 5px"}}
onClick={tag.name==="调分"?()=>this.showModulationtype(tag.id):tag.name==="分配"?()=>this.showAllocationModal(tag.id):""}> onClick={tag.name==="调分"?()=>this.showModulationtype(tag.id):tag.name==="分配"?()=>this.showAllocationModal(tag.id):""}>
{tag.name} {tag.name}
</a> </a>
} }
</Tooltip> </Tooltip>
} }
</React.Fragment> </React.Fragment>
) )
}):""} }):""}
{ {
this.props.isStudent()? this.props.isStudent()?
operation.map((tag,key) => { operation.map((tag,key) => {
return( return(
<div key={key}> <div key={key}>
{tag.view_work===false?"--":<a style={{color:'#4CACFF'}} href={"/courses/"+courseId+"/graduation_tasks/"+tag.id+"/appraise"} >查看</a>} {tag.view_work===false?"--":<a style={{color:'#4CACFF'}} href={"/courses/"+courseId+"/graduation_tasks/"+tag.id+"/appraise"} >查看</a>}
</div> </div>
)} )}
):"" ):""
} }
</div> </div>
), ),
}]; }];
let courseId=this.props.match.params.coursesId; let courseId=this.props.match.params.coursesId;
let position=this.props.match.params.position; let position=this.props.match.params.position;
@ -972,7 +972,7 @@ class GraduationTaskssettinglist extends Component{
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
} }
.ant-table-tbody>tr>td, .ant-table-thead>tr>th{ .ant-table-tbody>tr>td, .ant-table-thead>tr>th{
padding: 16px 10px padding: 16px 10px
} }

@ -1717,6 +1717,19 @@ class Trainingjobsetting extends Component {
unifiedsetting:this.state.unifiedsetting, unifiedsetting:this.state.unifiedsetting,
latedeductiontwo:20, latedeductiontwo:20,
}); });
//均分比例
try {
if(this.state.proportion==="均分比例"){
this.Equalproportion(20);
}else if(this.state.proportion==="经验值比例"){
this.Empiricalvalueratio(20);
}
}catch (e) {
}
}else { }else {
this.setState({ this.setState({
flagPageEditsbox:true, flagPageEditsbox:true,

Loading…
Cancel
Save