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

dev_ec
jingquan huang 5 years ago
commit aa603a3ffd

@ -842,23 +842,27 @@ class ExercisesController < ApplicationController
exercise_users = exercise.exercise_users
exercise.update_attributes(:exercise_status => 3, :end_time => Time.now,:unified_setting => true)
end
exercise_users.each do |user|
if user.commit_status == 0 && user.start_at.present?
objective_score = calculate_student_score(exercise,user.user)[:total_score]
user_sub_score = user.subjective_score
subjective_score = user_sub_score < 0.0 ? 0.0 : user_sub_score
total_score = objective_score + subjective_score
commit_option = {
:status => 1,
:commit_status => 1,
:end_at => Time.now,
:objective_score => objective_score,
:score => total_score,
:subjective_score => user_sub_score
}
user.update_attributes(commit_option)
end
end
ex_user_ids = exercise_users.pluck(:id)
EndExerciseCalculateJob.perform_later(ex_user_ids,exercise)
# exercise_users.each do |user|
# if user.commit_status == 0 && user.start_at.present?
# objective_score = calculate_student_score(exercise,user.user)[:total_score]
# user_sub_score = user.subjective_score
# subjective_score = user_sub_score < 0.0 ? 0.0 : user_sub_score
# total_score = objective_score + subjective_score
# commit_option = {
# :status => 1,
# :commit_status => 1,
# :end_at => Time.now,
# :objective_score => objective_score,
# :score => total_score,
# :subjective_score => user_sub_score
# }
# user.update_attributes(commit_option)
# end
# end
end
end
normal_status(0, "试卷截止成功!")

@ -0,0 +1,29 @@
class EndExerciseCalculateJob < ApplicationJob
include ExercisesHelper
include GitHelper
queue_as :default
def perform(ex_user_ids,exercise)
exercise_users = ExerciseUser.where(id: ex_user_ids)
exercise_users.each do |user|
if user.commit_status == 0 && user.start_at.present?
objective_score = calculate_student_score(exercise,user.user)[:total_score]
user_sub_score = user.subjective_score
subjective_score = user_sub_score < 0.0 ? 0.0 : user_sub_score
total_score = objective_score + subjective_score
commit_option = {
:status => 1,
:commit_status => 1,
:end_at => Time.now,
:objective_score => objective_score,
:score => total_score,
:subjective_score => user_sub_score
}
user.update_attributes(commit_option)
end
end
end
end

Binary file not shown.

Before

Width:  |  Height:  |  Size: 0 B

After

Width:  |  Height:  |  Size: 8.8 KiB

@ -208,6 +208,7 @@ export function initAxiosInterceptors(props) {
function initOnlineOfflineListener() {
const $ = window.$
$(window).bind("online", () => {
notification.destroy()
notification.success({

@ -19,19 +19,30 @@ class NewShixunModel extends Component{
order:'desc',
diff:0,
limit:15,
sort:"myshixuns_count"
}
}
componentDidMount() {
let{page,type,keyword,order,diff,limit,status}=this.state;
let{page,type,keyword,order,diff,limit,status,sort}=this.state;
if(this.props.type==='shixuns'){
this.getdatalist(page,type,status,keyword,order,diff,limit)
}else{
this.getdatalist(page,type,undefined,keyword,order,undefined,limit,undefined,sort);
}
}
getdatalist=(page,type,newstatus,keyword,order,diff,limit,pagetype)=>{
getdatalist=(page,type,newstatus,keyword,order,diff,limit,pagetype,sort)=>{
this.setState({
isspinning:true
})
let status=this.props.statustype===undefined?newstatus:'published';
let url="/shixun_lists.json"
let url;
if(this.props.type==='shixuns'){
url="/shixun_lists.json";
}else{
url="/subject_lists.json";
}
axios.get(url,{params:{
page,
type,
@ -39,20 +50,21 @@ class NewShixunModel extends Component{
keyword,
order,
diff,
limit
limit,
sort
}}).then((response) => {
if(response.data){
if(pagetype===undefined){
this.setState({
shixun_list:response.data.shixun_list,
shixuns_count:response.data.shixuns_count,
shixun_list:response.data.shixun_list===undefined?response.data.subject_list:response.data.shixun_list,
shixuns_count:response.data.shixuns_count===undefined?response.data.subjects_count:response.data.shixuns_count,
Grouplist:[],
isspinning:false
})
}else if(pagetype==="pagetype"){
this.setState({
shixun_list:response.data.shixun_list,
shixuns_count:response.data.shixuns_count,
shixun_list:response.data.shixun_list===undefined?response.data.subject_list:response.data.shixun_list,
shixuns_count:response.data.shixuns_count===undefined?response.data.subjects_count:response.data.shixuns_count,
isspinning:false
})
}
@ -127,8 +139,13 @@ class NewShixunModel extends Component{
newallGrouplist.push({page:pageNumber,list:[]})
}
let{type,status,keyword,order,diff,limit}=this.state;
let{type,status,keyword,order,diff,limit,sort}=this.state;
if(this.props.type==='shixuns'){
this.getdatalist(pageNumber,type,status,keyword,order,diff,limit,"pagetype")
}else{
this.getdatalist(pageNumber,type,undefined,keyword,order,undefined,limit,"pagetype",sort);
}
this.setState({
page:pageNumber,
allGrouplist:newallGrouplist
@ -142,8 +159,14 @@ class NewShixunModel extends Component{
keyword:undefined,
page:1
})
let{status,order,diff,limit}=this.state;
let{status,order,diff,limit,sort}=this.state;
if(this.props.type==='shixuns'){
this.getdatalist(1,value,status,undefined,order,diff,limit)
}else{
this.getdatalist(1,value,undefined,undefined,order,undefined,limit,undefined,sort)
}
}
updatedlist=(order)=>{
@ -205,7 +228,7 @@ class NewShixunModel extends Component{
this.setState({
hometypepvisible:false
})
this.showNotification("请先选择实训")
this.showNotification(this.props.type==='shixuns'?"请先选择实训":"请先选择课程")
return
}
@ -231,6 +254,7 @@ class NewShixunModel extends Component{
this.props.pathShixun(Grouplist)
return;
}
if(this.props.type==='shixuns'){
let url="/courses/"+coursesId+"/homework_commons/create_shixun_homework.json";
axios.post(url, {
category_id:this.props.category_id===null||this.props.category_id===undefined?undefined:parseInt(this.props.category_id),
@ -245,7 +269,35 @@ class NewShixunModel extends Component{
this.showNotification("操作成功")
this.props.homeworkupdatalists(this.props.Coursename,this.props.page,this.props.order);
this.props.hideNewShixunModelType()
this.props.updataleftNavfun()
}
this.setState({
hometypepvisible:false
})
// category_id: 3
// homework_ids: (5) [9171, 9172, 9173, 9174, 9175]
}).catch((error) => {
console.log(error)
this.setState({
hometypepvisible:false
})
})
}else{
let url="/courses/"+coursesId+"/homework_commons/create_subject_homework.json";
axios.post(url, {
category_id:this.props.category_id===null||this.props.category_id===undefined?undefined:parseInt(this.props.category_id),
subject_ids:Grouplist,
}
).then((response) => {
if(response.data.status===-1){
// this.props.showNotification(response.data.message)
}else{
// this.props.courseshomeworkstart(response.data.category_id,response.data.homework_ids)
this.showNotification("操作成功")
this.props.homeworkupdatalists(this.props.Coursename,this.props.page,this.props.order);
this.props.hideNewShixunModelType()
this.props.updataleftNavfun()
}
this.setState({
hometypepvisible:false
@ -260,6 +312,8 @@ class NewShixunModel extends Component{
})
}
}
poststatus=(status)=>{
this.setState({
status:status
@ -268,9 +322,37 @@ class NewShixunModel extends Component{
this.getdatalist(page,type,status,keyword,order,diff,limit)
}
updatepathlist=(sorts,orders)=>{
let{page,type,keyword,order,diff,limit,status,sort}=this.state;
let seartorders;
if(sort===sorts){
if(orders==="desc"){
this.setState({
sort:sorts,
order:"asc"
})
seartorders="asc"
}else{
this.setState({
sort:sorts,
order:"desc"
})
seartorders="desc"
}
}else{
this.setState({
sort:sorts,
order:"desc"
})
seartorders=orders
}
this.getdatalist(page,type,undefined,keyword,seartorders,undefined,limit,undefined,sorts)
}
render() {
let {diff,Grouplist,status,shixun_list,shixuns_count,page,type,order}=this.state;
let {diff,Grouplist,status,shixun_list,shixuns_count,page,type,order,sort}=this.state;
// let {visible,patheditarry}=this.props;
// console.log(Grouplist)
// console.log(allGrouplist)
@ -331,7 +413,7 @@ class NewShixunModel extends Component{
);
console.log(shixun_list)
return(
<div>
@ -355,7 +437,7 @@ class NewShixunModel extends Component{
closable={true}
destroyOnClose={true}
onClose={()=>this.props.hideNewShixunModelType()}
visible={this.props.NewShixunModelType}
visible={this.props.type==='shixuns'?this.props.NewShixunModelType:this.props.shixunpath}
height={'100%'}
>
<Spin spinning={this.state.isspinning}>
@ -380,7 +462,7 @@ class NewShixunModel extends Component{
<Search
style={{ width: "780px"}}
className="packinput"
placeholder="实训信息 / 院校名称 / 创建者"
placeholder={this.props.type==='shixuns'?"实训信息 / 院校名称 / 创建者":"课程名称 / 院校名称 / 创建者"}
value={this.state.keyword}
enterButton={<span>搜索</span>}
onInput={(e)=>this.setdatafunsval(e)}
@ -391,34 +473,50 @@ class NewShixunModel extends Component{
<div className="font-12 ml5 fl">
<span className="fl color-grey-9 mr20">已选 <span className={"color-blue"}>{Grouplist.length}</span> </span>
<span className="fl color-grey-9 mr20"> <span className={"color-blue"}>{shixuns_count===undefined?"":shixuns_count}</span> </span>
<span className="fl color-grey-9 mr20">已选 <span className={"color-blue"}>{Grouplist.length}</span> {this.props.type==='shixuns'?'':''}</span>
<span className="fl color-grey-9 mr20"> <span className={"color-blue"}>{shixuns_count===undefined?"":shixuns_count}</span> {this.props.type==='shixuns'?'':''}</span>
<span className="fl color-grey-9 pointer mr30">
{this.props.type==='shixuns'?"":<span className="fl color-grey-9 pointer mr30">
<a className={" color-grey-6"} onClick={()=>this.updatepathlist("shixuns_count",order)}>实训数</a>
<sapn className="relativef ml5 " >
<i className={order==="asc"&&sort==="shixuns_count"?"iconfont icon-sanjiaoxing-up font-12 ntopsj color-grey-9 color-blue":"iconfont icon-sanjiaoxing-up font-12 ntopsj color-grey-9"}></i>
<i className={order==="desc"&&sort==="shixuns_count"?"iconfont icon-sanjiaoxing-down font-12 nyslbottomsj color-grey-9 color-blue":"iconfont icon-sanjiaoxing-down font-12 nyslbottomsj color-grey-9"}></i>
</sapn>
</span>}
{this.props.type==='shixuns'?"":<span className="fl color-grey-9 pointer mr30">
<a className={" color-grey-6"} onClick={()=>this.updatepathlist("myshixuns_count",order)}>使用人数</a>
<sapn className="relativef ml5 " >
<i className={order==="asc"&&sort==="myshixuns_count"?"iconfont icon-sanjiaoxing-up font-12 ntopsj color-grey-9 color-blue":"iconfont icon-sanjiaoxing-up font-12 ntopsj color-grey-9"}></i>
<i className={order==="desc"&&sort==="myshixuns_count"?"iconfont icon-sanjiaoxing-down font-12 nyslbottomsj color-grey-9 color-blue":"iconfont icon-sanjiaoxing-down font-12 nyslbottomsj color-grey-9"}></i>
</sapn>
</span>}
{this.props.type==='shixuns'?<span className="fl color-grey-9 pointer mr30">
<a className={" color-grey-6"} onClick={()=>this.updatedlist(order)}>学习人数</a>
<sapn className="relativef ml5 " >
<i className={order==="asc"?"iconfont icon-sanjiaoxing-up font-12 ntopsj color-grey-9 color-blue":"iconfont icon-sanjiaoxing-up font-12 ntopsj color-grey-9"}></i>
<i className={order==="desc"?"iconfont icon-sanjiaoxing-down font-12 nyslbottomsj color-grey-9 color-blue":"iconfont icon-sanjiaoxing-down font-12 nyslbottomsj color-grey-9"}></i>
</sapn>
</span>
</span>:""}
{this.props.statustype===undefined?<Dropdown overlay={statusmenus}>
{this.props.type==='shixuns'?this.props.statustype===undefined?<Dropdown overlay={statusmenus}>
<a className="ant-dropdown-link color-grey-6 mr20">
{status==='all'?"发布状态":status==='published'?"已发布":status==="unpublished"?"未发布":""}<Icon type="down" className={"color-grey-6"}/>
</a>
</Dropdown>:""}
</Dropdown>:"":""}
<Dropdown overlay={menus}>
{this.props.type==='shixuns'? <Dropdown overlay={menus}>
<a className="ant-dropdown-link color-grey-6">
{diff===0?"难度":diff===1?"初级":diff===2?"中级":diff===3?"高级":diff===4?"顶级":""}<Icon type="down" className={"color-grey-6"}/>
</a>
</Dropdown>
</Dropdown>:""}
</div>
<div className="font-12 alltopiscright ml25 fr">
{/*<span className={"fr pointer color-grey-3"} onClick={()=>this.props.hideNewShixunModelType()}>返回</span>*/}
<span className={type==="mine"?"fr topcsactive pointer color-grey-3 color-blue":"fr pointer color-grey-3"} onClick={()=>this.belongto("mine")}>我的实训</span>
<span className={type==="all"?"fr mr30 topcsactive pointer color-grey-3 color-blue":"fr mr30 pointer color-grey-3"} onClick={()=>this.belongto("all")}>全部实训</span>
<span className={type==="mine"?"fr topcsactive pointer color-grey-3 color-blue":"fr pointer color-grey-3"} onClick={()=>this.belongto("mine")}>我的{this.props.type==='shixuns'?'实训':"课程"}</span>
<span className={type==="all"?"fr mr30 topcsactive pointer color-grey-3 color-blue":"fr mr30 pointer color-grey-3"} onClick={()=>this.belongto("all")}>全部{this.props.type==='shixuns'?'实训':"课程"}</span>
</div>
</div>
@ -461,7 +559,7 @@ class NewShixunModel extends Component{
{JSON.stringify(item.description) == "{}"?"":<div className="newshixunmodelmidfont newradioStyles" dangerouslySetInnerHTML={{__html: item.description}}>
</div>}
{item.challenge_names.length===0?"":<div className="newshixunmodelbotfont">
{item.challenge_names===undefined?"":item.challenge_names.length===0?"":<div className="newshixunmodelbotfont">
{item.challenge_names.map((item,key)=>{
return(
<span>{key+1}{item}</span>
@ -498,7 +596,7 @@ class NewShixunModel extends Component{
</Breadcrumb>
</div>
{item.subjects.length===0?"":<Dropdown overlay={()=>this.ItsCourse(item.subjects)}>
{item.subjects===undefined?"":item.subjects.length===0?"":<Dropdown overlay={()=>this.ItsCourse(item.subjects)}>
<a className="ant-dropdown-link fl ml30 newshixunfont12 color-blue" >
所属课程<Icon className={"color-blue"} type="down" />
</a>

@ -43,3 +43,14 @@
.TopicDetailTable .bottomBody li{border-bottom: 1px solid #eee;clear: both;}
.TopicDetailTable .bottomBody li:last-child{border-bottom: none;}
.acrossSureBtn{
width: 40px;
height: 24px;
line-height: 18px;
/* border: 1px solid rgba(76,172,255,1); */
/* color: #4CACFF!important; */
float: left;
/* border-radius: 4px; */
text-align: center;
}

@ -0,0 +1,543 @@
import React, { Component } from 'react';
import { Modal , Radio , Table , Pagination , Select ,Divider ,Icon , Input,Checkbox } from "antd";
import {Link} from 'react-router-dom'
import axios from 'axios';
import '../style.css'
const RadioGroup = Radio.Group;
const { Option } = Select;
const $ = window.$;
const bindTableColumn=(that)=>{
let { course_groups }=that.state
const filter=course_groups && course_groups.map((i,key)=>{
let list={
value: i.id,
text: i.name
}
return list;
})
const columns = [
{
title: '序号',
dataIndex: 'index',
key: 'index',
width:"50px",
className:"edu-txt-center",
render: (id, student, index) => {
return (that.state.page - 1) * that.state.limit + index + 1
}
},
{
title: '姓名',
dataIndex: 'user_name',
key: 'user_name',
render: (user_name, line, index) => {
return(
<span className="fl task-hide" style={{width:"69px"}} title={user_name}>{user_name}</span>
)
}
},{
title: '学号',
dataIndex: 'student_id',
key: 'student_id',
render: (student_id, line, index) => {
return(
<span className="fl task-hide" style={{width:"127px"}} title={student_id}>{student_id}</span>
)
}
},{
title: '分班',
dataIndex: 'course_group_name',
key: 'course_group_name',
filters:filter,
render: (course_group_name, line, index) => {
return(
<span className="fl task-hide" style={{width:"160px"}} title={course_group_name}>{course_group_name}</span>
)
}
}
];
if(that.state.comment_status == 2){
columns.push({
title: '交叉评阅老师',
dataIndex: 'cross_teachers',
key: 'cross_teachers',
width:"200px",
render: (cross_teachers, line, index) => {
return(
<span className="fl task-hide" style={{width:"200px",paddingRight:"20px"}} title={cross_teachers}>{cross_teachers}</span>
)
}
})
}else{
columns.push({
title: '答辩组',
dataIndex: 'cross_groups',
key: 'cross_groups',
width:"200px",
render: (cross_groups, line, index) => {
return(
<span className="fl task-hide" style={{width:"200px",paddingRight:"20px"}} title={cross_groups}>{cross_groups}</span>
)
}
})
}
if(course_groups&&course_groups.length===0){
columns.some((item,key)=> {
if (item.title === "分班") {
columns.splice(key, 1)
return true
}
}
)
}
return columns;
}
class GraduationAcross extends Component{
constructor(props){
super(props);
this.state={
comment_status:2,
page:1,
limit:7,
group_ids:undefined,
users:undefined,
user_count:undefined,
graduation_groups:undefined,
course_groups:undefined,
teachers:undefined,
tableLoading:false,
chooseCount:0,
chooseId:undefined,
AcrossTeamIds:undefined,
searchValue:undefined,
showflag:false
}
}
// 根据分班筛选
filterByGroup=(value,record)=>{
console.log(value);
console.log(record)
}
// 切换分配方式
funcommentstatus = (e) =>{
this.setState({
comment_status:e.target.value,
chooseCount:0,
chooseId:[],
AcrossTeamIds:undefined,
searchValue:undefined,
showflag:false,
page:1
})
let { group_ids }=this.state;
this.getList(1,group_ids,e.target.value);
}
componentDidMount =()=>{
let { comment_status }=this.props;
let { page,group_ids }=this.state;
this.setState({
comment_status
})
this.getList(page,group_ids,comment_status);
window.addEventListener('click', this.clickOther)
}
clickOther = (e) =>{
if(e.target && e.target.matches('#acrossContent') || e.target.matches(".ant-modal-body")
|| e.target.matches(".acrossfoot") || e.target.matches(".acrossHead") || e.target.matches ('.ant-radio-wrapper') ||
e.target.matches("th") || e.target.matches("td")) {
this.setState({
showflag:false
})
}
}
componentWillUnmount() {
window.removeEventListener('click', this.clickOther);
}
getList=(page,group_ids,comment_status)=>{
let { limit }=this.state;
let { task_Id }=this.props;
this.setState({
tableLoading:true
})
let url=`/graduation_tasks/${task_Id}/cross_comment_setting.json`;
axios.get((url),{params:{
page,limit,group_ids,comment_status
}}).then((result)=>{
if(result){
this.setState({
users:result.data.work_users && result.data.work_users.map((item,key)=>{
let list = {
key:item.work_id,
course_group_name:item.course_group_name,
cross_teachers: item.cross_teachers,
student_id:item.student_id,
user_name:item.user_name,
work_id:item.work_id
}
return list;
}),
user_count:result.data.user_count,
graduation_groups:result.data.graduation_groups,
course_groups:result.data.course_groups,
teachers:result.data.teachers,
tableLoading:false,
// AcrossTeamIds:result.data
})
}
}).catch((error)=>{
this.setState({
tableLoading:false
})
console.log(error);
})
}
// 切换分页
onPageChange=(page)=>{
this.setState({
page,
showflag:false
})
let{group_ids,comment_status}=this.state;
this.getList(page,group_ids,comment_status);
}
// 下拉切换
changeSelect = (AcrossTeamIds) =>{
console.log(AcrossTeamIds)
this.setState({
AcrossTeamIds
})
}
// 重置
clearSelect =()=>{
this.setState({
AcrossTeamIds:undefined,
searchValue:undefined
})
}
// 确定分配
sureAcross=()=>{
let { AcrossTeamIds , chooseId , group_ids , comment_status,page }=this.state;
let { task_Id }=this.props;
let type = comment_status == 2 ? "user_ids" : "graduation_group_ids";
let url=`/graduation_tasks/${task_Id}/assign_works.json`;
if(!AcrossTeamIds || (AcrossTeamIds && AcrossTeamIds.length==0)){
this.props.showNotification(`请先选择${ comment_status == 2 ? "老师": "答辩组" }`);
return;
}
if(!chooseId || (chooseId && chooseId.length==0)){
this.props.showNotification("请先选择毕设作品!");
return;
}
axios.post((url),{
[type]:AcrossTeamIds,
work_ids:chooseId
}).then((result)=>{
if(result){
this.props.showNotification(result.data.message);
this.getList(page,group_ids,comment_status);
this.setState({
showflag:false,
AcrossTeamIds:undefined,
chooseCount:0,
chooseId:[]
})
}
}).catch((error)=>{
console.log(error);
})
}
// 筛选
handleTableChange =(pagination, filters, sorter)=>{
console.log(filters.course_group_name)
// if(filters.course_group_name.length > 0){
this.setState({
page:1,
group_ids:filters.course_group_name
})
let { comment_status }= this.state;
this.getList(1,filters.course_group_name,comment_status);
// }
}
// 下拉搜索
changeSearchValue=(e)=>{
this.setState({
searchValue:e.target.value
})
}
// 显示下拉
changeFlag=(flag)=>{
this.setState({
showflag:flag
})
}
checkonChange=(e,list)=>{
let newlist=[]
// AcrossTeamIds
let {comment_status}=this.state;
if(e.target.checked===true){
if(comment_status===2){
list.map((item,key)=>{
newlist.push(String(item.user_id))
})
this.setState({
AcrossTeamIds:newlist
})
}else{
list.map((item,key)=>{
newlist.push(String(item.id))
})
this.setState({
AcrossTeamIds:newlist
})
}
}else{
this.setState({
AcrossTeamIds:undefined
})
}
}
render(){
let {
comment_status,
users,
user_count,
graduation_groups,
course_groups,
teachers,
page,
limit,
tableLoading,
chooseCount,
chooseId,
AcrossTeamIds,
searchValue,showflag
} = this.state;
let { modalVisible } = this.props;
let courseId = this.props.match.params.coursesId;
const radioStyle = {
display: 'block',
height: '30px',
lineHeight: '30px',
marginRight:'0px'
};
const rowSelection = {
// 选中行的key选中行
onChange: (selectedRowKeys, selectedRows) => {
this.setState({
chooseId:selectedRowKeys,
chooseCount:selectedRowKeys.length,
showflag:false
})
console.log(selectedRowKeys);
},
selectedRowKeys:chooseId,
getCheckboxProps: record => ({
disabled: record.name === 'Disabled User', // Column configuration not to be checked
name: record.name,
}),
};
// 筛选下拉列表
const teacherList = searchValue ? teachers&&teachers.filter(e=>e.user_name.indexOf(searchValue)>-1) : teachers;
const course_groupsList = searchValue ? course_groups&&course_groups.filter(e=>e.name.indexOf(searchValue)>-1) : course_groups;
return(
<Modal
className={"AcrossModal"}
title={"交叉评阅设置"}
visible={modalVisible}
closable={false}
footer={null}
width="775px"
destroyOnClose={true}
>
{modalVisible===true?<style>
{
`
body{
overflow: hidden !important;
}
.closeIcon{
font-size: 22px !important;
}
`
}
</style>:""}
<div id="closeIcon" onClick={()=>this.props.modalCloss()}>
<i className="iconfont icon-shanchudiao"></i>
</div>
<style>
{`
.AcrossModal .ant-modal-body{
padding:0px;
}
.AcrossModal span.ant-radio + *{
padding-right:0px;
}
.AcrossModal .ant-table-thead > tr > th,.AcrossModal .ant-table-tbody > tr > td{
padding:7px 5px;
border-bottom:none!important;
}
.AcrossModal .ant-table-tbody{
background:#F7FBFF;
}
.AcrossModal .ant-table-placeholder{
border:none!important;
}
.AcrossModal .ant-table-tbody .ant-table-selection-column,.AcrossModal .ant-table-thead .ant-table-selection-column{
padding-left: 23px!important;
}
.AcrossModal .ant-select-selection--multiple{
padding-top:0px;
}
.AcrossModal .ant-select-selection--multiple .ant-select-selection__rendered>ul>li,.AcrossModal .ant-select-selection--multiple>ul>li{
margin-top:3px;
margin-bottom:0px;
}
.AcrossModal .ant-select-selection__rendered{
height:30px;
line-height:30px;
overflow-y:auto;
overflow-x:hidden;
margin-right:0px;
}
.ant-table-filter-dropdown{
width:200px;
}
.ant-table-filter-dropdown .ant-dropdown-menu{
height:200px
}
.ant-dropdown-menu-item > label{
float:left
}
.ant-dropdown-menu-item > span{
float: left;
max-width: 153px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.pd8px{
padding: 8px;
}
`}
</style>
<div className="pt20 pl30 pr30 acrossHead">
<span className={"fl mt5"} style={{fontWeight: "400",color: "#05101A"}}>评阅分配方式</span>
<span>
<RadioGroup onChange={this.funcommentstatus} value={comment_status}>
<Radio style={radioStyle} value={2}>手动分配评阅<span className={"font-14 color-grey-c ml5"}>逐一指定每个学生的交叉评阅老师</span></Radio>
<Radio style={radioStyle} value={4}>答辩组分配评阅<span className={"font-14 color-grey-c ml5"}>将老师加入不同答辩组指定每个学生的交叉评阅答辩组
<a href={"/courses/"+courseId+"/teachers"} target="_blank">
<span className={"color-blue"}>立即设置答辩组</span></a>
</span></Radio>
</RadioGroup>
</span>
</div>
<div className="clearfix mb15 mt15 pl30 pr30" id="acrossContent">
<span className="fl color-grey-c mt5">已选 { chooseCount == 0 ? 0 : <span className="color-blue">{chooseCount}</span>} </span>
<span className="fr">
<span className={"fl mt5"}><span className={"color-orange"}>分配</span>{ comment_status && comment_status == 2 ? "":""}</span>
<span className={"fl"} style={{height:"32px"}} id="selectTags">
<Select
mode="tags"
placeholder={ comment_status && comment_status == 2 ? "请选择老师":"请选择答辩组"}
value={AcrossTeamIds}
style={{width:"300px",height:"30px"}}
onChange={this.changeSelect}
open={showflag}
onFocus={()=>this.changeFlag(true)}
dropdownRender={menu => (
<div id="selectDropdown">
{comment_status == 2 &&teachers&&teachers.length>10?<div className="padding10-20">
<Input
type='input'
value={searchValue}
onChange={this.changeSearchValue}
placeholder='请输入名称搜索'
style={{height:"30px"}}
className="searchInput"
></Input>
</div>:""}
{comment_status != 2 &&course_groups&&course_groups.length>10?<div className="padding10-20">
<Input
type='input'
value={searchValue}
onChange={this.changeSearchValue}
placeholder='请输入名称搜索'
style={{height:"30px"}}
className="searchInput"
></Input>
</div>:""}
{comment_status == 2 &&teacherList&&teacherList.length>2? <Checkbox className={"pd8px"} onChange={(e)=>this.checkonChange(e,teacherList)}>全选</Checkbox>:""}
{comment_status != 2 &&course_groupsList&&course_groupsList.length>2? <Checkbox className={"pd8px"} onChange={(e)=>this.checkonChange(e,course_groupsList)}>全选</Checkbox>:""}
{menu}
<Divider style={{ margin: '4px 0 0' }} />
<div style={{ padding: '8px 12px', cursor: 'pointer' }}>
<a onClick={this.sureAcross} className="acrossSureBtn color-orange">提交</a>
<a onClick={this.clearSelect} className="ml20"><span className="acrossResetBtn color-blue">重置</span></a>
</div>
</div>
)}
>
{ comment_status == 2 ?
teacherList && teacherList.map((i,key)=>{
return <Option key={i.user_id} value={String(i.user_id)}>{i.user_name}</Option>
}):
course_groupsList && course_groupsList.map((i,key)=>{
return <Option key={i.id} value={String(i.id)}>{i.name}</Option>
})
}
</Select>
</span>
</span>
</div>
<Table rowSelection={rowSelection} columns={bindTableColumn(this)} dataSource={users} pagination={false} onChange={this.handleTableChange} loading={tableLoading}></Table>
<div className="clearfix mt20 pb30 pl30 pr30 acrossfoot">
<div className="fl">
{
user_count > limit ?
<Pagination defaultCurrent={page} current={page} pageSize={limit} total={user_count} onChange={this.onPageChange}></Pagination>:""
}
</div>
{/*<div className="fr">*/}
{/*<a className="task-btn color-white mr30" onClick={this.props.modalCloss}>关闭</a>*/}
{/*<a className="task-btn task-btn-orange" onClick={this.props.modalCloss}>确认</a>*/}
{/*</div>*/}
</div>
</Modal>
)
}
}
export default GraduationAcross;

@ -10,6 +10,7 @@ import HomeworkModal from "../../coursesPublic/HomeworkModal";
import AccessoryModal from "../../coursesPublic/AccessoryModal";
import Associationmodel from '../../coursesPublic/Associationmodel';
import CoursesListType from '../../coursesPublic/CoursesListType';
import GraduationAcross from "./GraduationAcross";
import moment from 'moment';
import "../../css/members.css"
import "../../css/Courses.css"
@ -58,7 +59,8 @@ class GraduationTaskDetail extends Component{
Modalstype:undefined,
Modalstopval:undefined,
ModalCancel:undefined,
ModalSave:undefined
ModalSave:undefined,
acrossVisible:undefined
}
}
componentDidMount(){
@ -80,6 +82,21 @@ class GraduationTaskDetail extends Component{
})
}
// 交叉评阅设置弹框
openAcross=()=>{
this.setState({
acrossVisible:true
})
}
closeAcross=()=>{
this.setState({
acrossVisible:false
})
}
//返回
goback=()=>{
// let courseId=this.props.match.params.coursesId;
@ -190,7 +207,6 @@ class GraduationTaskDetail extends Component{
}
// 取消
cancelmodel=()=>{
debugger
this.setState({
Modalstype:false,
Loadtype:false,
@ -291,11 +307,13 @@ class GraduationTaskDetail extends Component{
Modalstype,
Modalstopval,
ModalCancel,
ModalSave
ModalSave,
acrossVisible
} = this.state
const commom = {
setTab:this.setTab
setTab:this.setTab,
getdatas:this.getdatas
}
return(
<div className="newMain clearfix">
@ -353,6 +371,20 @@ class GraduationTaskDetail extends Component{
destroyOnClose={true}
centered={true}
/>
{
acrossVisible &&
<GraduationAcross
{...this.props}
{...this.state}
task_Id={task_Id}
modalVisible={acrossVisible}
modalCloss={this.closeAcross}
resetFun={this.resetList}
comment_status={ questionslist && questionslist.comment_status }
/>
}
<p className="clearfix mt10">
<a onClick={this.goback} className="color-grey-9 fl">{questionslist.course_name}</a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
@ -436,7 +468,7 @@ class GraduationTaskDetail extends Component{
{/*<a className={"fr color-blue font-16"}>项目在线质量检测</a>*/}
{ this.props.isAdmin() ? questionslist.status===1 ? <a className={"fr color-blue font-16 mr20"} onClick={() => { this.end()} }>立即截止</a> : "" : "" }
{ this.props.isAdmin() ? questionslist.status===0 ? <a className={"fr color-blue font-16 mr20"} onClick={() => { this.publish()} }>立即发布</a> : "" : "" }
{ this.props.isAdmin() && questionslist.cross_comment ? <a className={"fr color-blue font-16"} onClick={this.openAcross}>交叉评阅设置</a> : "" }
{ this.props.isAdmin() ? <a className={"fr color-blue font-16"} href={"/courses/"+courseId+"/graduation_tasks/"+task_Id+"/edit"}>编辑任务</a> : "" }
</div>
</div>

@ -343,6 +343,7 @@ class GraduationTaskssettingapp extends Component{
}
updatesfuncrosscomment=(types,newlatetime,newcommenttime)=>{
debugger
let {endtimetype}=this.state;
if(types===1){
this.setState({
@ -372,7 +373,7 @@ class GraduationTaskssettingapp extends Component{
funcrosscomment=(e)=>{
let {latetime,end_time,allowlate,commenttime,commenttimeone}=this.state;
let commenttimetype=commenttime===null||commenttime==="";
debugger
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");
@ -386,7 +387,7 @@ class GraduationTaskssettingapp extends Component{
let newcommenttimed=moment(end_time).add(8, 'days').format("YYYY-MM-DD HH:mm");
if(e.target.checked===true){
if(commenttimetype===true){
debugger
if(allowlate===1||allowlate===true){
if(latetime===null||latetime===""){
@ -401,12 +402,6 @@ class GraduationTaskssettingapp extends Component{
this.updatesfuncrosscomment(2,newend_timed,newcommenttimed)
}
}
}else{
this.setState({
crosscomment:e.target.checked,
commenttime:commenttimeone,
})
}
}else{
this.setState({
@ -545,25 +540,29 @@ class GraduationTaskssettingapp extends Component{
endTimetypes:false
})
}
debugger
if(moment(latetime)<=moment(publish_time)){
debugger
this.setState({
latetimetype:true,
latetimetypeval:"结束时间必须晚于发布时间"
})
return
}else if(moment(latetime)<=moment(end_time)){
debugger
this.setState({
latetimetype:true,
latetimetypeval:"结束时间必须晚于截止时间"
})
return
}else{
debugger
this.setState({
latetimetype:false
})
}
debugger
if(crosscomment===true){
if(this.state.commenttime===undefined||this.state.commenttime===null||this.state.commenttime===""){
@ -727,6 +726,8 @@ class GraduationTaskssettingapp extends Component{
course_groupslist:[],
})
this.props.showNotification(resulet.data.message);
//调用父组件方法,刷新按钮
this.props.getdatas();
}
}
}).catch((error)=>{
@ -948,9 +949,7 @@ class GraduationTaskssettingapp extends Component{
//
// console.log(moment(publish_time))
// console.log(this.props.isSuperAdmin())
console.log(commenttime)
return(
<React.Fragment>
@ -1206,7 +1205,7 @@ class GraduationTaskssettingapp extends Component{
{crosscomment===true&&commenttimetype===true?<div className={"color-red ml70"}>{commenttimevalue}</div>:""}
</div>
<div className={"mb20 ml30 ml87 ml87"}>
{/* <div className={"mb20 ml30 ml87 ml87"}>
<span className={"fl mt6"}>评阅方式</span>
<span>
@ -1221,10 +1220,10 @@ class GraduationTaskssettingapp extends Component{
</RadioGroup>
</span>
</div>
</div> */}
<div style={{display:crosscomment===false?"none":commentstatus===0?"none":commentstatus===2?"none":commentstatus===4?"":"none"}}>
{/* <div style={{display:crosscomment===false?"none":commentstatus===0?"none":commentstatus===2?"none":commentstatus===4?"":"none"}}>
<div className={"h20 mb30 ml30 ml87"}>
<span>评阅数</span>
<Input className="mr20" style={{width:"200px" }} value={commentnum} disabled={this.props.isAdmin()===true?flagPageEdit===true?false:true:true} onInput={this.setcommentnum} />
@ -1261,7 +1260,7 @@ class GraduationTaskssettingapp extends Component{
)
})}
</div>
</div> */}
</div>:""}

@ -854,21 +854,21 @@ class GraduationTaskssettinglist extends Component{
dataIndex: 'operation',
className:'edu-txt-center',
render: operation => (
<div>
<div style={{cursor: 'pointer'}}>
{this.props.isAdmin()?operation.map((tag,key) => {
return(
<React.Fragment>
{
tag.name &&
<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"} >
<Tooltip key={key} placement="bottom" title={tag.name==="分配"?taskslistdata&&taskslistdata.cross_comment===true?"":"指定该作品的交叉评阅人":tag.name==="调分"?<pre>调整学生最终成绩<br/>其它历史评分将全部失效</pre>:""}>
{tag.name==="评阅"?<p style={{color:'#4CACFF',padding:"0px 5px"}} href={"/courses/"+courseId+"/graduation_tasks/"+tag.id+"/appraise"} >
{tag.name}
</a>
</p>
:
<a style={{color:tag.name==="调分"?"#000":'#4CACFF',padding:"0px 5px"}}
onClick={tag.name==="调分"?()=>this.showModulationtype(tag.id):tag.name==="分配"?()=>this.showAllocationModal(tag.id):""}>
{tag.name}
</a>
<p style={{color:tag.name==="调分"?"#000":'#4CACFF',padding:"0px 5px"}}
onClick={tag.name==="调分"?()=>this.showModulationtype(tag.id):tag.name==="分配"?taskslistdata&&taskslistdata.cross_comment===true?"":()=>this.showAllocationModal(tag.id):""}>
{tag.name==="分配"?taskslistdata&&taskslistdata.cross_comment===true?"":tag.name:tag.name}
</p>
}
</Tooltip>
}
@ -971,9 +971,8 @@ class GraduationTaskssettinglist extends Component{
white-space: nowrap;
}
.ant-table-tbody>tr>td, .ant-table-thead>tr>th{
padding: 16px 10px
padding:16px 8px;
}
`
}
</style>

@ -2643,7 +2643,7 @@ class Listofworksstudentone extends Component {
//学号
//学号排序是从大到小
this.setState({
order: "student_id",
orders: "student_id",
loadingstate: true,
})
this.Startsortingt("student_id", this.state.course_groupyslstwo, this.state.checkedValuesineinfo, this.state.searchtext, this.state.page, this.state.limit);
@ -3047,32 +3047,9 @@ class Listofworksstudentone extends Component {
let {columns,course_groupysls,datajs,isAdmin,homework_status, course_groupyslstwo, unlimited, unlimitedtwo, course_group_info, orders, task_status, checkedValuesine, searchtext, teacherlist, visible,visibles, game_list,columnsstu,columnsstu2, limit,experience, boolgalist,viewtrainingdata, teacherdata, page, data, jobsettingsdata, styletable, datas, order, loadingstate,computeTimetype} = this.state;
const antIcon = <Icon type="loading" style={{ fontSize: 24 }} spin />;
// console.log(this.state.student_works);
// console.log("841");
// console.log(this.state.columns);
// console.log(datajs);
// console.log("2202");
// console.log(this.props.isAdmin());
// console.log("2498");
// console.log(data);
// console.log(datas);
// console.log(this.props.isAdmin());
let course_is_end = this.props.current_user&&this.props.current_user.course_is_end;
// try {
// if(this.props.isAdmin() === false){
// if(teacherdata&&teacherdata.student_works){
// if(teacherdata&&teacherdata.student_works.length>0){
// console.log("这是双层页面。。。。");
//
// }
// }
//
// }
// }catch (e) {
// console.log("Listofworksstudentone123");
// console.log(e);
// }
// console.log("Listofworksstudentone.js");
// console.log(orders);
return (

@ -908,7 +908,8 @@ class ShixunHomework extends Component{
}
hideNewShixunModelType=()=>{
this.setState({
NewShixunModelType:false
NewShixunModelType:false,
shixunpath:false
})
}
render(){
@ -971,6 +972,20 @@ class ShixunHomework extends Component{
statustype={'published'}
/>:""}
{/*新版实训model*/}
{shixunpath===true?<NewShixunModel
{...this.props}
{...this.state}
category_id={this.props.match.params.category_id}
type={'path'}
hideNewShixunModelType={()=>this.hideNewShixunModelType()}
coursesId={this.props.match.params.coursesId}
homeworkupdatalists={(Coursename,page,order)=>this.homeworkupdatalist(Coursename,page,order)}
Coursename={Coursename}
page={page}
order={order}
/>:""}
{/*提示*/}
{Modalstype&&Modalstype===true?<Modals
@ -1005,23 +1020,6 @@ class ShixunHomework extends Component{
getcourse_groupslist={(id)=>this.getcourse_groupslist(id)}
/>:""}
{/*/!*选择实训*!/*/}
{/*{shixunmodal===true?<ShixunModal*/}
{/*{...this.props}*/}
{/*{...this.state}*/}
{/*datas={datas}*/}
{/*category_id={this.props.match.params.category_id}*/}
{/*visible={shixunmodal}*/}
{/*shixunmodallist={shixunmodallist}*/}
{/*homeworkupdatalists={(Coursename,page,order)=>this.homeworkupdatalist(Coursename,page,order)}*/}
{/*hometypepvisible={hometypepvisible}*/}
{/*hidecouseShixunModal={this.hidecouseShixunModal}*/}
{/*newshixunmodallist={newshixunmodallist}*/}
{/*coursesId={this.props.match.params.coursesId}*/}
{/*courseshomeworkstart={(category_id,homework_ids)=>this.newhomeworkstart(category_id,homework_ids)}*/}
{/*funpatheditarry={(patheditarry)=>this.funpatheditarry(patheditarry)}*/}
{/*patheditarry={patheditarry}*/}
{/*/>:""}*/}
{shixunmodal===true||shixunpath===true?<style>
{
@ -1032,25 +1030,7 @@ class ShixunHomework extends Component{
`
}
</style>:""}
{/*选择实训路径*/}
{shixunpath===true? <PathModal
{...this.props}
{...this.state}
datas={datas}
visible={shixunpath}
shixunmodallist={this.state.shixunpathlist}
newshixunmodallist={this.state.newshixunpathlist}
// funshixunpathlist={(search,type,loading,page)=>this.funshixunpathlist(search,type,loading,page)}
hometypepvisible={hometypepvisible}
hidecouseShixunModal={this.hidecouseShixunModal}
coursesId={this.props.match.params.coursesId}
homeworkupdatalists={(Coursename,page,order)=>this.homeworkupdatalist(Coursename,page,order)}
courseshomeworkstart={(category_id,homework_ids)=>this.newhomeworkstart(category_id,homework_ids)}
Coursename={Coursename}
page={page}
order={order}
// courseshomeworkstart={(category_id,homework_ids)=>this.newhomeworkstart(category_id,homework_ids)}
/>:""}
{/*添加目录/选择目录*/}

Loading…
Cancel
Save