hjm 5 years ago
commit ed52b674a2

@ -125,7 +125,7 @@ $(window).resize(function() {
rightSlider();
});
function rightSlider() {
var poi = parseInt((parseInt($(window).width()) - 1200) / 2) - 60;
var poi = parseInt((parseInt($(window).width()) - 1200) / 2) - 34;
// console.log(parseInt($(window).width())+" "+poi);
if (poi > 0) {
$(".-task-sidebar").css("right", poi);

@ -2,12 +2,14 @@ import React, { Component } from 'react';
import { BrowserRouter as Router, Route, Link } from "react-router-dom";
import { Spin } from 'antd';
class Loading extends Component {
render() {
// Loading
return (
<div className="App" style={{minHeight: '800px'}}>
<Spin size="large" />
</div>
);
}

@ -103,7 +103,14 @@ class UseBank extends Component{
}
closeSelectBank=()=>{
this.setState({
flag:false
flag:false,
nav_my: 'myself',
search: '',
page: 1,
checkBoxValues: [],
isChecked:'',
is_teacher:undefined,
hometypepvisible:false
})
}
@ -190,7 +197,7 @@ class UseBank extends Component{
width:218px !important;
}
.bankwidth{
width:29% !important;
width:24% !important;
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap
@ -275,7 +282,7 @@ class UseBank extends Component{
<span className="fl with65">
<label className="task-hide fl" title={item.name && item.name.length > 30 ? item.name:""} style={{"maxWidth":"100%"}}>{item.name}</label>
</span>
<span title={item.course_list_name && item.course_list_name.length > 14 && item.course_list_name}
<span title={item.course_list_name && item.course_list_name.length > 10 && item.course_list_name}
className={nav_my==='myself'?"fl with30 color-grey-6 task-hide pl5 bankwidth":"fl with30 color-grey-6 task-hide pl5 bankwidth"}
>{item.course_list_name}</span>

@ -17,7 +17,8 @@ class AccessoryModal extends Component{
ModalSave:"",
loadtype:false,
updatas:false,
shixunsreplace:false
shixunsreplace:false,
Errormessage:false,
}
}
@ -41,7 +42,10 @@ class AccessoryModal extends Component{
// for(var list of fileList ){
// console.log(fileList)
// }
this.setState({ fileList });
this.setState({
fileList:fileList,
Errormessage:false,
});
}
onAttachmentRemove = (file) => {
@ -121,10 +125,23 @@ class AccessoryModal extends Component{
if (newfileList.length == 0) {
// this.props.showNotification('请先上传附件')
if(this.props.modalname === "补交附件"){
this.setState({
Errormessage:true,
shixunsreplace:false,
})
}else{
this.setState({
shixunsreplace:true,
Errormessage:false,
})
}
return;
}else{
this.setState({
shixunsreplace:false,
Errormessage:false,
})
}
let url= this.props.reviseAttachmentUrl || "/graduation_works/"+id+"/revise_attachment.json"
@ -326,6 +343,14 @@ class AccessoryModal extends Component{
border:'1px solid rgba(234,234,234,1)',
padding: '10px'
}}></textarea>
{
this.state.Errormessage && this.state.Errormessage === true ?
<p className="color-red mt5 mb5 " style={{width: " 100%", height: "20px"}}>
<span className="fl" style={{textAlign:"left",width: " 100%"}}>还未上传附件</span>
</p>
: <div style={{height:"25px"}}></div>
}
{this.state.updatas===true?<span className={"color-red"}>请上传附件</span>:""}
<div className="clearfix mt30 edu-txt-center mb10">
<a className="task-btn color-white mr70" onClick={this.props.Cancel}>{this.props.Cancelname || '取消'}</a>

@ -193,7 +193,7 @@ class Exercise extends Component{
}
// 题库选用成功后刷新页面
useBankSuccess=(checkValue,value)=>{
debugger
let{type,StudentList_value,page,limit}=this.state;
let coursesId=this.props.match.params.coursesId;
let url=`/courses/${coursesId}/exercises/publish_modal.json`;

@ -116,7 +116,7 @@ class ExerciseListItem extends Component{
{
item.lock_status === 0 ?
<Tooltip title={ this.props.isNotMember()?"私有属性,非课堂成员不能访问":"私有属性"} placement="bottom">
<Tooltip title={ this.props.isNotMember()===true?"私有属性,非课堂成员不能访问":"私有属性"} placement="bottom">
<i className="iconfont icon-guansuo color-grey-c ml10 font-16 fl"></i>
</Tooltip>
:""

@ -197,7 +197,7 @@ class Exercisestatisticalresult extends Component {
item.ques_details.map((ite,k)=>{
return(
<div>
<div className={"mt20"}>
<div className="clearfix edu-back-white poll_list" style={{padding: '0px 20px'}}>
<div className="font-16 shixunreporttitle fl" >
<span> {ite.challenge_position}{ite.challenge_name}</span>

@ -159,7 +159,7 @@ class Testpapersettinghomepage extends Component{
return(
<div className="newMain clearfix ">
<div className={"educontent mb20"} style={{width:"1250px"}}>
<div className={"educontent mb20"} style={{width:"1200px"}}>
{/* 公用的提示弹框 */}
{this.state.Modalstype===true?<Modals
modalsType={this.state.Modalstype}
@ -177,7 +177,7 @@ class Testpapersettinghomepage extends Component{
callback={this.callback}
/>:""}
<div className="educontent mb20" style={{width:"1250px"}}>
<div className="educontent mb20" style={{width:"1200px"}}>
<p className="clearfix mb20 mt10">
<ActionBtn className=" btn colorgrey fl hovercolorblue " to={`/courses/${this.props.match.params.coursesId}/students}`}>{this.props.coursedata.name}</ActionBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
@ -195,7 +195,7 @@ class Testpapersettinghomepage extends Component{
`}
</style>
<div className="educontent" style={{width:"1250px"}}>
<div className="educontent" style={{width:"1200px"}}>
<p className=" fl color-black summaryname ">
{Commonheadofthetestpaper === undefined?"":Commonheadofthetestpaper.exercise_name}
</p>
@ -252,19 +252,18 @@ class Testpapersettinghomepage extends Component{
padding-top: 10px;
padding-bottom: 8px;
}
a:hover {
color:#1A0B00 !important;
}
`}
</style>
<div className={"studentList_operation_ul mt23"}>
{isAdmin === true? <li className="li_line drop_down fr color-blue font-15" style={{"paddingLeft":"0px"}}>
导出<i className="iconfont icon-xiajiantou font-12 ml2"></i>
<ul className="drop_down_menu" style={{"right":"-34px","left":"unset","height":"auto"}}>
<li><a
onClick={()=>this.experiment(`/api/exercises/${this.props.match.params.Id}/exercise_lists.xlsx`)}
className="color-dark">学生成绩</a></li>
<li><a href={`/api/exercises/${this.props.match.params.Id}/export_exercise`} className="color-dark">空白试卷</a></li>
<li><a className="color-dark"
onClick={()=>this.experiment(`/api/zip/export_exercises?exercise_id=${this.props.match.params.Id}${this.state.groupyslsval}`)}
>学生答题试卷</a></li>
<li><a onClick={()=>this.experiment(`/api/exercises/${this.props.match.params.Id}/exercise_lists.xlsx`)}>学生成绩</a></li>
<li><a href={`/api/exercises/${this.props.match.params.Id}/export_exercise`} >空白试卷</a></li>
<li><a onClick={()=>this.experiment(`/api/zip/export_exercises?exercise_id=${this.props.match.params.Id}${this.state.groupyslsval}`)}>学生答题试卷</a></li>
</ul>
</li>:""}
</div>

@ -200,7 +200,7 @@ class shixunAnswer extends Component{
className:"edu-txt-center",
render:(testCount,item,index)=>{
return(
<span>{ item.testCount ? item.testCount : "--" }</span>
<span>{ item.testCount ? item.testCount : <span className="color-grey-9">--</span> }</span>
)
}
}, {
@ -210,7 +210,7 @@ class shixunAnswer extends Component{
className:"edu-txt-center",
render:(endTime,item,index)=>{
return(
<span>{ item.endTime ? item.endTime : "--" }</span>
<span>{ item.endTime ? item.endTime : <span className="color-grey-9">--</span> }</span>
)
}
}, {
@ -220,7 +220,7 @@ class shixunAnswer extends Component{
className:"edu-txt-center",
render:(needTime,item,index)=>{
return(
<span>{ item.needTime ? item.needTime : "--" }</span>
<span>{ item.needTime ? item.needTime : <span className="color-grey-9">--</span> }</span>
)
}
}, {
@ -259,7 +259,7 @@ class shixunAnswer extends Component{
step={0.1}
precision={1}
value={item.input_score}
style={{width:"60px",marginRight:"5px"}}
style={{width:"60px",marginLeft:"5px"}}
placeholder="请输入分数"
onChange={(value)=>{this.changeThis(value,index)}}
onBlur={(value)=>this.changeThisScore(value,item.id,index)}
@ -269,9 +269,9 @@ class shixunAnswer extends Component{
}
{
item.operation ?
<a className={isAdmin ? "color-blue ml20":"color-blue"} target="_blank" href='javascript:void(0)' onClick={()=>this.scrollToAnchor(`${questionType.question_id}${index+1}`)}>查看</a>
<a className={isAdmin ? "color-blue mt5 fr":"color-blue"} target="_blank" href='javascript:void(0)' onClick={()=>this.scrollToAnchor(`${questionType.question_id}${index+1}`)}>查看</a>
:
<a className={isAdmin ? "color-grey-9 ml20":"color-grey-9"} target="_blank" href='javascript:void(0)'>--</a>
<span className={isAdmin ? "color-grey-9 mt5 fr":"color-grey-9"} >--</span>
}
</span>
)
@ -279,28 +279,38 @@ class shixunAnswer extends Component{
}];
return(
<div>
<style>
{`
.resetTableStyle .ant-table-tbody > tr > td{
padding:10px 5px!important;
}
.resetCodeMirrorStyle .CodeMirror{
height:auto!important;
}
`}
</style>
{ exercise && ((exercise.student_commit_status && exercise.student_commit_status != 0) || (exercise.user_exercise_status && exercise.user_exercise_status !=0) ) ?
<div>
<p className="padding20-30 font-16 color-grey-6 pl30">阶段成绩</p>
<div className="stageTable">
<div className={challenge && challenge.length > 0 ? "pl30 pr30 resetTableStyle":"pl30 pr30 resetTableStyle stageTable"}>
{ data && data.length>0 ? <Table columns={columns} dataSource={data} pagination={false}></Table> : "" }
</div>
{
challenge && challenge.length > 0 &&
<div>
<p className="padding20-30 font-16 color-grey-6 pl30">实训详情</p>
<p className="mt20 pr30 font-16 color-grey-6 pl30">实训详情</p>
{
challenge.map((item,key)=>{
return(
<div className="pl30 pr30" id={`challenge_${questionType.question_id}${key+1}`}>
<div className="pl30 pr30 mt20" id={`challenge_${questionType.question_id}${key+1}`}>
<p className="clearfix mb20">
<span className="panel-inner-icon mr15 fl mt3 backgroud4CACFF">
<i className="fa fa-code font-16 color_white"></i>
</span>
<span className="fl mt3 font-14">
<span className="fl mt3 font-16">
<span className="font-bd mr15">{item[0].position}</span>
<Link to={"/shixuns/"+item[0].game_identifier+"/challenges"}>
<span className={"font-14"}>{item[0].name}</span>
<span className={"font-16"}>{item[0].name}</span>
</Link>
</span>
</p>
@ -308,7 +318,7 @@ class shixunAnswer extends Component{
{...this.props} {...this.state} challenge={item[0].outputs}
></ShixunAnswerDetail>
{ item[0].st===0 ? <div className="font-16 color-dark-21 mb10">
{ item[0].st===0 ? <div className="font-16 color-dark-21">
<div className="bor-grey-e mt15">
<p className="clearfix pt5 pb5 pl15 pr15 back-f6-grey codebox">
<span className="fl">最近通过的代码</span>
@ -316,7 +326,7 @@ class shixunAnswer extends Component{
</p>
<div className="test-code bor-top-greyE">
<li className="clearfix">
<li className="clearfix resetCodeMirrorStyle">
<CodeMirror
value={item[0].passed_code}
options={{

@ -613,7 +613,7 @@ class GraduationTasksSubmitedit extends Component{
{item.delete===true?
<i className="font-14 iconfont icon-guanbi "
id={item.id}
onClick={()=>this.onAttachmentRemove(item)}
onClick={()=>this.onAttachmentRemove(item.id)}
aria-hidden="true">
</i>:""}
</div>

@ -2,7 +2,7 @@ import React,{Component} from "React";
import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal} from "antd";
import {Link} from 'react-router-dom';
import TPMMDEditor from '../../../tpm/challengesnew/TPMMDEditor';
import { WordsBtn,getUrl } from 'educoder';
import { WordsBtn,getUrl ,bytesToSize} from 'educoder';
import axios from 'axios';
import Modals from '../../../modals/Modals';
import '../../css/Courses.css';
@ -40,27 +40,28 @@ class GraduationTasksedit extends Component{
axios.get(url).then((result)=>{
// console.log(result)
let newfilelist=[];
if(result.data.attachments.length!=0){
for(var list of result.data.attachments){
newfilelist.push({
uid:list.id,
name:list.title,
status: 'done',
url:list.url,
})
}
}
// let newfilelist=[];
// if(result.data.attachments.length!=0){
// for(var list of result.data.attachments){
// newfilelist.push({
// uid:list.id,
// name:list.title,
// status: 'done',
// url:list.url,
// })
// }
//
// }
let namelength=result.data.task_name.length;
let sixlength=title_num-namelength
this.setState({
fileList:newfilelist,
// fileList:newfilelist,
description:result.data.description,
tasktype:result.data.task_type,
name:result.data.task_name,
data:result.data,
title_num:sixlength
title_num:sixlength,
attachments:result.data.attachments,
})
@ -100,36 +101,36 @@ class GraduationTasksedit extends Component{
// 附件相关 START
handleChange = (info) => {
let fileList = info.fileList;
console.log(fileList)
// console.log(fileList)
// for(var list of fileList ){
// console.log(fileList)
// }
this.setState({ fileList });
}
onAttachmentRemove = (file) => {
// confirm({
// title: '确定要删除这个附件吗?',
// okText: '确定',
// cancelText: '取消',
// // content: 'Some descriptions',
// onOk: () => {
// this.deleteAttachment(file)
// },
// onCancel() {
// console.log('Cancel');
// },
// });
// onAttachmentRemove = (file) => {
// // confirm({
// // title: '确定要删除这个附件吗?',
// // okText: '确定',
// // cancelText: '取消',
// // // content: 'Some descriptions',
// // onOk: () => {
// // this.deleteAttachment(file)
// // },
// // onCancel() {
// // console.log('Cancel');
// // },
// // });
// // return false;
//
// this.setState({
// Modalstype:true,
// Modalstopval:'确定要删除这个附件吗?',
// ModalSave: ()=>this.deleteAttachment(file),
// ModalCancel:this.cancelAttachment
// })
// return false;
this.setState({
Modalstype:true,
Modalstopval:'确定要删除这个附件吗?',
ModalSave: ()=>this.deleteAttachment(file),
ModalCancel:this.cancelAttachment
})
return false;
}
// }
cancelAttachment=()=>{
this.setState({
@ -141,10 +142,11 @@ class GraduationTasksedit extends Component{
})
}
deleteAttachment = (file) => {
onAttachmentRemove = (file) => {
this.cancelAttachment();
const url = `/attachments/${file.response ? file.response.id : file.uid}.json`
// const url = `/attachments/${file.response ? file.response.id : file.uid}.json`
const url = `/attachments/${file}.json`
axios.delete(url, {
})
.then((response) => {
@ -268,7 +270,7 @@ class GraduationTasksedit extends Component{
}
render(){
const { getFieldDecorator } = this.props.form;
let {title_num,pageType,name,description,Loadtype,
let {title_num,pageType,name,description,Loadtype,attachments,
Modalstype,Modalstopval,ModalCancel,ModalSave,shixunsreplace} =this.state;
let {coursedata}=this.props;
@ -279,7 +281,7 @@ class GraduationTasksedit extends Component{
width: 600,
// https://github.com/ant-design/ant-design/issues/15505
// showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。
// showUploadList: false,
showUploadList: false,
action: `${getUrl()}/api/attachments.json`,
onChange: this.handleChange,
onRemove: this.onAttachmentRemove,
@ -418,8 +420,65 @@ class GraduationTasksedit extends Component{
</Button>
(单个文件150M以内)
</Upload>
{attachments&&attachments.map((item,key)=>{
return(
<div className="color-grey mt5"
key={key}
>
<a className="color-grey ml3">
<i className="font-14 color-green iconfont icon-fujian mr8" aria-hidden="true"></i>
</a>
<a
href={item.url}
className="mr12 color9B9B" length="58">
{item.title}
</a>
<span className="color656565 mt2 color-grey-6 font-12 mr8">
{item.filesize}
</span>
{item.delete===true?
<i className="font-14 iconfont icon-guanbi "
id={item.id}
onClick={()=>this.onAttachmentRemove(item.id)}
aria-hidden="true">
</i>:""}
</div>
)
})}
<style>
{
`
.maxwidth500{
max-width:500px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
color: #05101a;
}
`
}
</style>
{this.state.fileList.length===0?"":this.state.fileList.map((item,key)=>{
return(
<p className="color-grey mt10" key={key} >
<a className="color-grey fl">
<i className="font-14 color-green iconfont icon-fujian mr8" aria-hidden="true"></i>
</a>
<span className="mr12 color9B9B maxwidth500 fl" length="58">
{item.name}
</span>
<span className="color656565 mt2 color-grey-6 font-12 mr8">
{item.response===undefined?"":bytesToSize(item.size)}
</span>
<i className="font-14 iconfont icon-guanbi "
id={item.response===undefined?"":item.response.id}
aria-hidden="true" onClick={()=>this.onAttachmentRemove(item.response===undefined?"":item.response.id&&item.response.id)}></i>
</p>
)
})}
{/*{attachments&&attachments.map((item,key)=>{*/}
{/*return(*/}

@ -2,7 +2,7 @@ import React, {Component} from "React";
import {Form, Select, Input, Button, Checkbox, Upload, Icon, message, Modal} from "antd";
import {Link} from 'react-router-dom';
import TPMMDEditor from '../../../tpm/challengesnew/TPMMDEditor';
import {WordsBtn, getUrl} from 'educoder';
import {WordsBtn, getUrl,bytesToSize} from 'educoder';
import axios from 'axios';
import Modals from '../../../modals/Modals';
import '../../css/Courses.css';
@ -133,29 +133,29 @@ class GraduationTasksnew extends Component {
this.setState({fileList});
}
onAttachmentRemove = (file) => {
// confirm({
// title: '确定要删除这个附件吗?',
// okText: '确定',
// cancelText: '取消',
// // content: 'Some descriptions',
// onOk: () => {
// this.deleteAttachment(file)
// },
// onCancel() {
// console.log('Cancel');
// },
// });
// onAttachmentRemove = (file) => {
// // confirm({
// // title: '确定要删除这个附件吗?',
// // okText: '确定',
// // cancelText: '取消',
// // // content: 'Some descriptions',
// // onOk: () => {
// // this.deleteAttachment(file)
// // },
// // onCancel() {
// // console.log('Cancel');
// // },
// // });
// // return false;
//
// this.setState({
// Modalstype: true,
// Modalstopval: '确定要删除这个附件吗?',
// ModalSave: () => this.deleteAttachment(file),
// ModalCancel: this.cancelAttachment
// })
// return false;
this.setState({
Modalstype: true,
Modalstopval: '确定要删除这个附件吗?',
ModalSave: () => this.deleteAttachment(file),
ModalCancel: this.cancelAttachment
})
return false;
}
// }
cancelAttachment = () => {
this.setState({
@ -166,8 +166,9 @@ class GraduationTasksnew extends Component {
})
}
deleteAttachment = (file) => {
const url = `/attachments/${file.response ? file.response.id : file.uid}.json`
onAttachmentRemove = (file) => {
// const url = `/attachments/${file.response ? file.response.id : file.uid}.json`
const url = `/attachments/${file}.json`
axios.delete(url, {})
.then((response) => {
if (response.data) {
@ -256,7 +257,7 @@ class GraduationTasksnew extends Component {
multiple: true,
// https://github.com/ant-design/ant-design/issues/15505
// showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。
// showUploadList: false,
showUploadList: false,
action: `${getUrl()}/api/attachments.json`,
onChange: this.handleChange,
onRemove: this.onAttachmentRemove,
@ -385,7 +386,7 @@ class GraduationTasksnew extends Component {
</div>
<div className="stud-class-set pt20 pl20 pr20 coursenavbox edu-back-white">
<div className="stud-class-set pd20 coursenavbox edu-back-white">
<style>{`
.uploadBtn.ant-btn {
border: none;
@ -428,6 +429,39 @@ class GraduationTasksnew extends Component {
</Button>
(单个文件150M以内)
</Upload>
<style>
{
`
.maxwidth500{
max-width:500px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
color: #05101a;
}
`
}
</style>
{this.state.fileList.length===0?"":this.state.fileList.map((item,key)=>{
return(
<p className="color-grey mt10" key={key} >
<a className="color-grey fl">
<i className="font-14 color-green iconfont icon-fujian mr8" aria-hidden="true"></i>
</a>
<span className="mr12 color9B9B maxwidth500 fl" length="58">
{item.name}
</span>
<span className="color656565 mt2 color-grey-6 font-12 mr8">
{item.response===undefined?"":bytesToSize(item.size)}
</span>
<i className="font-14 iconfont icon-guanbi "
id={item.response===undefined?"":item.response.id}
aria-hidden="true" onClick={()=>this.onAttachmentRemove(item.response===undefined?"":item.response.id&&item.response.id)}></i>
</p>
)
})}
</div>

@ -316,6 +316,30 @@ class GraduationTaskssettingapp extends Component{
})
}
updatesfuncrosscomment=(types,checked,newlatetime,newcommenttime)=>{
let {endtimetype}=this.state;
if(types===1){
this.setState({
latetime:newlatetime,
crosscomment:checked,
commenttime:newcommenttime
})
}else{
if(endtimetype===true){
this.setState({
crosscomment:checked,
commenttime:newcommenttime
})
}else{
this.setState({
end_time:newlatetime,
crosscomment:checked,
commenttime:newcommenttime
})
}
}
}
funcrosscomment=(e)=>{
let {latetime,end_time,allowlate}=this.state;
@ -325,41 +349,23 @@ class GraduationTaskssettingapp extends Component{
if(latetime===null||latetime===""){
let newlatetime=moment(new Date()).add(7, 'days').format("YYYY-MM-DD HH:mm");
let newcommenttime=moment(new Date()).format("YYYY-MM-DD HH:mm");
this.setState({
latetime:newlatetime,
crosscomment:e.target.checked,
commenttime:newcommenttime
})
this.updatesfuncrosscomment=(1,e.target.checked,newlatetime,newcommenttime)
}else{
let newlatetime=moment(latetime).add(7, 'days').format("YYYY-MM-DD HH:mm");
let newcommenttime=moment(latetime).format("YYYY-MM-DD HH:mm");
this.setState({
latetime:newlatetime,
crosscomment:e.target.checked,
commenttime:newcommenttime
})
this.updatesfuncrosscomment=(1,e.target.checked,newlatetime,newcommenttime)
}
}else{
if(end_time===null||end_time===""){
let newend_time=moment(new Date()).add(7, 'days').format("YYYY-MM-DD HH:mm");
let newcommenttime=moment(new Date()).add(8, 'days').format("YYYY-MM-DD HH:mm");
this.setState({
end_time:newend_time,
crosscomment:e.target.checked,
commenttime:newcommenttime
})
this.updatesfuncrosscomment=(2,e.target.checked,newend_time,newcommenttime)
}else{
let newend_time=moment(end_time).add(7, 'days').format("YYYY-MM-DD HH:mm");
let newcommenttime=moment(end_time).add(8, 'days').format("YYYY-MM-DD HH:mm");
this.setState({
end_time:newend_time,
crosscomment:e.target.checked,
commenttime:newcommenttime
})
this.updatesfuncrosscomment=(2,e.target.checked,newend_time,newcommenttime)
}
}

@ -103,7 +103,7 @@ class GraduateTopicDetail extends Component{
return(
<div className="newMain">
<div className="educontent mt10 mb50">
<p className="clearfix mb10">
<p className="clearfix mb15 lineh-20">
<WordsBtn style="grey" className="fl" to={`/courses/${tableData.course_id}`}>{tableData && tableData.course_name}</WordsBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn style="grey" className="fl" to={`/courses/${tableData.course_id}/graduation_topics/${tableData.graduation_id}`}>{tableData.graduation_name}</WordsBtn>
@ -111,9 +111,9 @@ class GraduateTopicDetail extends Component{
<span>选题详情</span>
</p>
<p className="clearfix mb20 lineh-25">
<span className="color-grey-3 font-24 fl task-hide" style={{lineHeight:"30px",maxWidth:"900px"}}>{tableData && tableData.graduation_topic_name}</span>
<span className="fl mt4" style={{height:"25px"}}><CoursesListType typelist={[`${tableData && tableData.status_name}`]} typesylename={""} /></span>
<WordsBtn className="fr font-16 mt2" style="grey" onClick={()=>this.props.history.goBack()}>返回</WordsBtn>
<span className="color-grey-3 font-24 fl task-hide" style={{lineHeight:"25px",maxWidth:"900px"}}>{tableData && tableData.graduation_topic_name}</span>
<span className="fl mt1" style={{height:"25px"}}><CoursesListType typelist={[`${tableData && tableData.status_name}`]} typesylename={""} /></span>
<WordsBtn className="fr font-16 mt1" style="grey" onClick={()=>this.props.history.goBack()}>返回</WordsBtn>
</p>
<div>
<div className="clearfix edu-back-white bor-bottom-greyE" >

@ -169,6 +169,7 @@ class GraduateTopicDetailTable extends Component{
} = this.state
const isAdmin =this.props.isAdmin();
const isStudent =this.props.isStudent();
const isNotMember=this.props.isNotMember();
console.log(un_addClass_notice)
return(
<div className="minH-560 edu-back-white">
@ -176,7 +177,7 @@ class GraduateTopicDetailTable extends Component{
<div className="topHead edu-txt-center">
<span style={{"width":"5%"}}>序号</span>
<span style={{"width":"12%"}}>姓名</span>
<span style={{"width":"13%"}}>学号</span>
{isNotMember ?"" :<span style={{"width":"13%"}}>学号</span>}
<span style={{"width":"15%"}}>分班</span>
<span style={{"width":"15%"}}>选题时间</span>
<span style={{"width":"12%"}} className="fr">操作</span>
@ -260,7 +261,7 @@ class GraduateTopicDetailTable extends Component{
<li className="color-grey-9 clearfix" key={key}>
<span style={{"width":"5%"}} className="color-grey-6">{parseInt(key+1)+(parseInt(page-1)*15)}</span>
<span style={{"width":"12%"}} className="color-grey-3">{item.student_name}</span>
<span style={{"width":"13%"}}>{item.student_id}</span>
{isNotMember ?"" :<span style={{"width":"13%"}}>{item.student_id}</span>}
<span style={{"width":"15%"}}>{item.class_group_name || "--"}</span>
<span style={{"width":"15%"}}>{item.selected_time}</span>
{
@ -288,6 +289,9 @@ class GraduateTopicDetailTable extends Component{
isAdmin &&
<span style={{"width":"12%"}} className={item.result === "已拒绝"?"fr color-orange-tip":"fr"}>{item.result=== "待确认"?"--":item.result}</span>
}
{
isNotMember && <span style={{"width":"12%"}} className="fr color-grey-9">--</span>
}
</li>
)

@ -70,9 +70,9 @@ class GraduateTopicItem extends Component{
`}</style>
<h6>
{
isNotMember?discussMessage.private_icon===true?
<a className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</a>:<a onClick={() => this.toDetailPage(`${discussMessage.id}`)}
className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</a>:""
isNotMember && discussMessage.private_icon===true ?
<a className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</a>:
<a onClick={() => this.toDetailPage(`${discussMessage.id}`)} className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</a>
}
{
@ -86,7 +86,7 @@ class GraduateTopicItem extends Component{
{
discussMessage.private_icon===true?
<Tooltip title={ this.props.isNotMember?"私有属性,非课堂成员不能访问":"私有属性"} placement="bottom">
<Tooltip title={ this.props.isNotMember()===true?"私有属性,非课堂成员不能访问":"私有属性"} placement="bottom">
<i className="iconfont icon-guansuo color-grey-c ml10 font-16 fl mt4"></i>
</Tooltip>
:""

@ -192,7 +192,12 @@ class PollDetailTabFirst extends Component{
key: 'classes',
dataIndex: 'classes',
width:160,
className:poll_types && poll_types.groups_count > 0 ? "edu-txt-center":"edu-txt-center none"
className:poll_types && poll_types.groups_count > 0 ? "edu-txt-center":"edu-txt-center none",
render:(classes,item,index)=>{
return(
item.classes ? <span>{item.classes}</span> : <span className="color-grey-9">--</span>
)
}
}, {
title: '提交状态',
dataIndex: 'status',
@ -212,22 +217,42 @@ class PollDetailTabFirst extends Component{
width:160,
render:(time,item,index)=>{
return(
item.time == null ? "--" : moment(item.time).format('YYYY-MM-DD HH:mm')
item.time == null ? <span className="color-grey-9">--</span> : moment(item.time).format('YYYY-MM-DD HH:mm')
)
}
},{
title: '操作',
dataIndex: 'operation',
key: 'operation',
className:poll_types && poll_types.un_anonymous ? "edu-txt-center":"edu-txt-center none",
className:"edu-txt-center",
width:120,
render:(operation,item,index)=>{
return(
item.status == 1 ? <WordsBtn style="blue" to={`/courses/${this.props.match.params.coursesId}/polls/${this.props.match.params.pollId}/users/${item.login}`}>查看</WordsBtn>:<span>--</span>
item.status == 1 ? <WordsBtn style="blue" to={`/courses/${this.props.match.params.coursesId}/polls/${this.props.match.params.pollId}/users/${item.login}`}>查看</WordsBtn>:<span className="color-grey-9">--</span>
)
}
}];
// 非课堂成员不显示学号列
let isNotMember =this.props.isNotMember();
if(isNotMember){
columns.some((item,key)=> {
if (item.title === "学号") {
columns.splice(key, 1)
return true
}
}
)
}
// un_anonymous true为实名问卷显示操作列否则隐藏
if(poll_types && (isNotMember || poll_types.un_anonymous == false)){
columns.some((item,key)=> {
if (item.title === "操作") {
columns.splice(key, 1)
return true
}
}
)
}
return(
<div>
{

@ -796,6 +796,11 @@ class Listofworks extends Component {
if(item.title==="效率分"){
columns.splice(key,1)
}
if(this.props.isNotMember()===true) {
if(item.title==="学号"){
this.state.columnss.splice(key,1)
}
}
})
}else{
if(course_group_info.length < 2){
@ -810,6 +815,11 @@ class Listofworks extends Component {
if(item.title==="效率分"){
columns.splice(key,1)
}
if(this.props.isNotMember()===true) {
if(item.title==="学号"){
this.state.columnss.splice(key,1)
}
}
})
}else {
@ -820,6 +830,11 @@ class Listofworks extends Component {
if(item.title==="效率分"){
columns.splice(key,1)
}
if(this.props.isNotMember()===true) {
if(item.title==="学号"){
this.state.columnss.splice(key,1)
}
}
})
}
}
@ -830,6 +845,11 @@ class Listofworks extends Component {
if(item.title==="分班"){
columns.splice(key,1)
}
if(this.props.isNotMember()===true) {
if(item.title==="学号"){
this.state.columnss.splice(key,1)
}
}
})
}else {
if(course_group_info.length < 2) {
@ -838,6 +858,11 @@ class Listofworks extends Component {
if(item.title==="分班"){
columns.splice(key,1)
}
if(this.props.isNotMember()===true) {
if(item.title==="学号"){
this.state.columnss.splice(key,1)
}
}
})
}
columns=this.state.columnss;
@ -1192,8 +1217,9 @@ class Listofworks extends Component {
course_groupyslstwo: [],
unlimited: 0,
loadingstate: true,
page:1,
})
this.Startsorting(this.state.order, [], this.state.checkedValuesineinfo, this.state.searchtext, this.state.page, this.state.limit);
this.Startsorting(this.state.order, [], this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit);
}
notlimitedst = () => {
@ -1204,7 +1230,7 @@ class Listofworks extends Component {
course_groupysls: undefined,
loadingstate: true,
})
this.Startsorting(this.state.order, this.state.course_groupyslstwo, [], this.state.searchtext, this.state.page, this.state.limit);
this.Startsorting(this.state.order, this.state.course_groupyslstwo, [], this.state.searchtext, 1, this.state.limit);
}
//立即截止确定按钮
coursetaskend = () => {
@ -1417,22 +1443,25 @@ class Listofworks extends Component {
font-size: 14px;
}
.drop_down_menu {
width: 121px;
width: 93px;
}
.drop_down_menu li {
overflow: visible;
width: 121px;
width: 93px;
}
.drop_down_menu, .drop_down_normal {
padding-top: 10px;
padding-bottom: 8px;
}
a:hover {
color:#1A0B00 !important;
}
`}</style>
{this.props.isAdmin()? <li className="li_line drop_down fr color-blue font-16 mr8 mt20" style={{"padding":"0 20px"}}>
导出<i className="iconfont icon-xiajiantou font-12 ml2"></i>
<ul className="drop_down_menu" style={{"right":"-34px","left":"unset","height":"auto"}}>
<li><a href={`/api/student_works/${jobsettingsdata === undefined ? "" :jobsettingsdata.data.category.category_id}/export_shixun_work_report.pdf`} calssName="color-dark">实训报告</a></li>
<li><a href={`/api/homework_commons/${jobsettingsdata === undefined ? "" :jobsettingsdata.data.category.category_id}/works_list.xlsx`} calssName="color-dark">学生成绩</a></li>
<ul className="drop_down_menu" style={{"right":"-0px","left":"unset","height":"auto"}}>
<li><a href={`/api/student_works/${jobsettingsdata === undefined ? "" :jobsettingsdata.data.category.category_id}/export_shixun_work_report.pdf`} >实训报告</a></li>
<li><a href={`/api/homework_commons/${jobsettingsdata === undefined ? "" :jobsettingsdata.data.category.category_id}/works_list.xlsx`} >学生成绩</a></li>
</ul>
</li>:""}
{this.props.isAdmin() ?
@ -1529,16 +1558,16 @@ class Listofworks extends Component {
<div className="clearfix">
<span className="fl color-grey-6 font-12"><span
className="color-orange-tip">{teacherdata === undefined ? "" : teacherdata.student_works.length}</span>{teacherdata === undefined ? "" : teacherdata.all_member_count} </span>
<div className="fr color-grey-6 edu-menu-panel">
<div className="fr edu-menu-panel">
<ul>
<li className="edu-position edu-position-hidebox">
<a className="font-12 color-grey-6">
<a className="font-12">
{order === "update_time" ? "时间" : order === "work_score" ? "成绩" : order === "student_id" ? "学号" : ""}排序</a>
<i className="iconfont icon-xiajiantou ml5 font-12 color-grey-6"></i>
<i className="iconfont icon-xiajiantou ml5 font-12 "></i>
<ul className="edu-position-hide undis mt10">
<li> <a onClick={(e) => this.funorder("update_time")} data-remote="true" className="color-grey-6 font-12" style={{"text-align": "center "}}>更新时间</a></li>
<li> <a onClick={(e) => this.funorder("work_score")} data-remote="true" className="color-grey-6 font-12" style={{"text-align": "center "}}>最终成绩</a></li>
<li> <a onClick={(e) => this.funorder("student_id")} data-remote="true" className="color-grey-6 font-12" style={{"text-align": "center "}}>学生学号</a></li>
<li> <a onClick={(e) => this.funorder("update_time")} data-remote="true" className=" font-12" style={{"text-align": "center "}}>更新时间</a></li>
<li> <a onClick={(e) => this.funorder("work_score")} data-remote="true" className=" font-12" style={{"text-align": "center "}}>最终成绩</a></li>
<li> <a onClick={(e) => this.funorder("student_id")} data-remote="true" className=" font-12" style={{"text-align": "center "}}>学生学号</a></li>
</ul>
</li>
</ul>
@ -1581,7 +1610,6 @@ class Listofworks extends Component {
columns={columns}
pagination={false}
loading={loadingstate}
onChange={this.TablePagination}
/>}
</div>
</div>

@ -40,6 +40,7 @@ class Listofworksstudentone extends Component {
props: props,
data: [],
datas: [],
view_report:false,
page: 1,
pages: 1,
limit: 20,
@ -60,7 +61,202 @@ class Listofworksstudentone extends Component {
"display": "none"
},
student_works: [],
startbtn: false
startbtn: false,
columns: [
{
title: '序号',
dataIndex: 'number',
key: 'number',
align: "center",
className:'font-14',
render: (text, record) => (
<span>
{record.number === undefined ?
<span style={{
"color": '#9A9A9A',
"text-align": "center"
}}> --</span>
: record.number === "" ?
<span style={{
"color": '#9A9A9A',
"text-align": "center"
}}>--</span>
: record.number === "--" ?
<span style={{
"color": '#9A9A9A',
"text-align": "center"
}}>--</span>
:
<span style={{
"color": '#07111B',
"text-align": "center"
}}> {record.number}</span>
}
</span>
),
},
{
title: '姓名',
dataIndex: 'name',
key: 'name',
align: "center",
className:'font-14',
render: (text, record) => (
<span>
{record.name === undefined ?
<span style={{
"color": '#9A9A9A',
"text-align": "center"
}}>--</span>
:
record.name === "" ?
<span style={{
"color": '#9A9A9A',
"text-align": "center"
}}>--</span>
:
record.name === null ?
<span style={{
"color": '#9A9A9A',
"text-align": "center"
}}>--</span>
:
record.name === "--" ?
<span style={{
"color": '#9A9A9A',
"text-align": "center"
}}>--</span>
:
<span style={{
"color": '#07111B',
"text-align": "center"
}}>{record.name}</span>
}
</span>
),
},
{
title: '学号',
dataIndex: 'stduynumber',
key: 'stduynumber',
align: "center",
className:'font-14',
render: (text, record) => (
<span>
<span style={{
"color": '#9A9A9A',
"text-align": "center"
}}>{record.stduynumber === undefined ? "--" : record.stduynumber === null ? "--" : record.stduynumber === "" ? "--" : record.stduynumber}</span>
</span>
),
},
{
title: '分班',
key: 'classroom',
dataIndex: 'classroom',
align: "center",
className:'font-14',
width:'288px',
render: (text, record) => (
<span>
<span style={{
"color": '#9A9A9A',
"text-align": "center"
}}>{record.classroom === undefined ? "--" : record.classroom === "" ? "--" : record.classroom === null ? "--" : record.classroom}</span>
</span>
),
},
{
title: '提交状态',
dataIndex: 'submitstate',
key: 'submitstate',
align: "center",
className:'font-14',
render: (text, record) => (
<span>
<span style={record.submitstate === "延时提交" ? {
"color": '#DD1717',
"text-align": "center"
} : record.submitstate === "按时提交" ? {"color": '#29BD8B', "text-align": "center"} : {
"color": '#747A7F',
"text-align": "center"
}}>{record.submitstate === undefined ? "--" : record.submitstate === "" ? "--" : record.submitstate === null ? "--" : record.submitstate}</span>
</span>
),
},
{
title: '更新时间',
dataIndex: 'updatetime',
key: 'updatetime',
align: "center",
className:'font-14',
render: (text, record) => (
<span>
<span style={{
"color": '#9A9A9A',
"text-align": "center"
}}>{record.updatetime === undefined ? "--" : record.updatetime === "" ? "--" : record.updatetime}</span>
</span>
),
},
{
title: '完成情况',
dataIndex: 'completion',
key: 'completion',
align: "center",
className:'font-14',
render: (text, record) => (
<span>
<span style={{"color": '#07111B', "text-align": "center"}}>{record.completion+"/"+this.state.challenges_count}</span>
</span>
),
},
{
title: '最终成绩',
dataIndex: 'levelscore',
key: 'levelscore',
align: "center",
className:'font-14',
render: (text, record) => (
<span>
{
record.levelscore && record.levelscore === "--"?
<span style={{"color": '#9A9A9A', "text-align": "center"}}>{record.levelscore}</span>
:
<span style={parseInt(record.levelscore) >=90 ? {
"color": '#DD1717',
"text-align": "center"
} : parseInt(record.levelscore) <= 60?{
"color": '#FF6800',
"text-align": "center",
}: {"color": '#747A7F', "text-align": "center"}}>{record.levelscore}</span>
}
</span>
),
},
{
title: '操作',
dataIndex: 'operating',
key: 'operating',
align: "center",
className:'font-14',
render: (text, record) => (
<span>
{
record.submitstate === "未提交" ?<span style={{ color: '#9A9A9A'}}>--</span>
:
<span style={{"text-align": "center"}}
className="color-blue"
onClick={() => this.Viewstudenttraininginformation(record)}>{record.operating}</span>
}
</span>
),
},
],
}
//
}
@ -110,11 +306,12 @@ class Listofworksstudentone extends Component {
work_efficiency: result.data.work_efficiency,
code_review: result.data.code_review,
challenges_count:result.data.challenges_count,
view_report:result.data.view_report,
})
if (result.data.student_works === undefined || result.data.student_works === null || JSON.stringify(result.data.student_works) === "[]") {
this.seacthdata();
this.seacthdata(result.data);
} else {
this.seacthdatas();
this.seacthdatas(result.data,result.data.student_works);
}
}
@ -164,11 +361,12 @@ class Listofworksstudentone extends Component {
end_immediately: result.data.end_immediately,
code_review: result.data.code_review,
challenges_count:result.data.challenges_count,
view_report:result.data.view_report,
})
if (result.data.student_works === undefined || result.data.student_works === null || JSON.stringify(result.data.student_works) === "[]") {
this.seacthdata();
this.seacthdata(result.data);
} else {
this.seacthdatas();
this.seacthdatas(result.data,result.data.student_works);
}
}
@ -187,20 +385,27 @@ class Listofworksstudentone extends Component {
}
seacthdatas = () => {
seacthdatas = (teacherdata,student_works) => {
let {page, limit} = this.state;
let datalist = [];
let datalists = [];
var styletable = {"display": "none"}
// console.log("seacthdata设置数据3")
this.state.columns.map((item,key)=>{
if(this.props.isNotMember()===true) {
if(item.title==="学号"){
this.state.columns.splice(key,1)
}
}
})
let columns2=this.state.columns;
var teacherlist = undefined;
var teacherlists = undefined;
if (this.state.teacherdata !== undefined) {
if (teacherdata !== undefined) {
// console.log("seacthdata设置数据")
// console.log(this.state.teacherdata.id )
if (this.state.teacherdata.id === undefined) {
if (teacherdata.id === undefined) {
this.setState({
data: [],
teacherlist: undefined,
@ -209,36 +414,36 @@ class Listofworksstudentone extends Component {
})
} else {
console.log(this.state.teacherdata)
if (this.state.teacherdata.id !== undefined || this.state.teacherdata.id !== null || this.state.teacherdata.id !== "") {
console.log(teacherdata)
if (teacherdata.id !== undefined || teacherdata.id !== null || teacherdata.id !== "") {
// console.log("seacthdata设置数据1")
// console.log(this.state.teacherdata )
var timedata = moment(this.state.teacherdata.update_time).format('YYYY-MM-DD HH:mm');
var timedata = moment(teacherdata.update_time).format('YYYY-MM-DD HH:mm');
datalist.push({
myid: this.state.teacherdata.id,
myid: teacherdata.id,
number: 1,
name: this.state.teacherdata.user_name,
stduynumber: this.state.teacherdata.student_id,
classroom: this.state.teacherdata.group_name,
submitstate: this.state.teacherdata.work_status === 0 ? "未提交" : this.state.teacherdata.work_status === 1 ? "按时提交" : this.state.teacherdata.work_status === 2 ? "延时提交" : "未提交",
name: teacherdata.user_name,
stduynumber: teacherdata.student_id,
classroom: teacherdata.group_name,
submitstate: teacherdata.work_status === 0 ? "未提交" : teacherdata.work_status === 1 ? "按时提交" : teacherdata.work_status === 2 ? "延时提交" : "未提交",
// updatetime:this.state.teacherdata.student_works[i].update_time,
// updatetime:"",
updatetime: timedata === "Invalid date" ? "--" : timedata,
completion: this.state.teacherdata.complete_count === null ? "0" :this.state.teacherdata.complete_count === undefined ? "0": this.state.teacherdata.complete_count,
levelscore: this.state.teacherdata.final_score,
efficiencyscore: this.state.teacherdata.eff_score,
finalscore: this.state.teacherdata.work_score,
completion: teacherdata.complete_count === null ? "0" :teacherdata.complete_count === undefined ? "0": teacherdata.complete_count,
levelscore: teacherdata.final_score,
efficiencyscore: teacherdata.eff_score,
finalscore: teacherdata.work_score,
operating: "查看",
late_penalty: this.state.teacherdata.late_penalty=== null?"0":this.state.teacherdata.late_penalty === undefined?"0":this.state.teacherdata.late_penalty,
ultimate_score:this.state.teacherdata.ultimate_score,
user_name: this.state.teacherdata.user_name,
user_login: this.state.teacherdata.user_login,
late_penalty: teacherdata.late_penalty=== null?"0":teacherdata.late_penalty === undefined?"0":teacherdata.late_penalty,
ultimate_score:teacherdata.ultimate_score,
user_name: teacherdata.user_name,
user_login: teacherdata.user_login,
})
// }
var teacherlist = { //分页
total: this.state.teacherdata.student_works.length, //数据总数量
pageSize: this.state.teacherdata.student_works.length, //一页显示几条
total: teacherdata.student_works.length, //数据总数量
pageSize: teacherdata.student_works.length, //一页显示几条
current: this.state.page,
}
styletable = {"display": "block",}
@ -252,30 +457,30 @@ class Listofworksstudentone extends Component {
}
if (this.state.student_works !== undefined) {
if (student_works !== undefined) {
for (var i = 0; i < this.state.student_works.length; i++) {
for (var i = 0; i <student_works.length; i++) {
var timedata = moment(this.state.student_works[i].update_time).format('YYYY-MM-DD HH:mm');
var timedata = moment(student_works[i].update_time).format('YYYY-MM-DD HH:mm');
datalists.push({
myid: this.state.student_works[i].id,
myid: student_works[i].id,
number: (parseInt(page) - 1) * parseInt(limit) + (i + 1),
name: this.state.student_works[i].user_name,
stduynumber: this.state.student_works[i].student_id,
classroom: this.state.student_works[i].group_name,
submitstate: this.state.student_works[i].work_status === 0 ? "未提交" : this.state.student_works[i].work_status === 1 ? "按时提交" : this.state.student_works[i].work_status === 2 ? "延时提交" : "未提交",
name: student_works[i].user_name,
stduynumber: student_works[i].student_id,
classroom: student_works[i].group_name,
submitstate: student_works[i].work_status === 0 ? "未提交" : student_works[i].work_status === 1 ? "按时提交" : student_works[i].work_status === 2 ? "延时提交" : "未提交",
// updatetime:this.state.teacherdata.student_works[i].update_time,
// updatetime:"",
updatetime: timedata === "Invalid date" ? "--" : timedata,
completion: this.state.teacherdata.student_works[i].complete_count === null ? "0" :this.state.teacherdata.student_works[i].complete_count === undefined ? "0": this.state.teacherdata.student_works[i].complete_count,
levelscore: this.state.student_works[i].final_score,
efficiencyscore: this.state.student_works[i].eff_score,
finalscore: this.state.student_works[i].work_score,
completion: student_works[i].complete_count === null ? "0" :student_works[i].complete_count === undefined ? "0":student_works[i].complete_count,
levelscore: student_works[i].final_score,
efficiencyscore: student_works[i].eff_score,
finalscore:student_works[i].work_score,
operating: "查看",
late_penalty: this.state.teacherdata.student_works[i].late_penalty=== null?"0":this.state.teacherdata.student_works[i].late_penalty === undefined?"0":this.state.teacherdata.student_works[i].late_penalty,
ultimate_score:this.state.teacherdata.student_works[i].ultimate_score,
user_name: this.state.teacherdata.student_works[i].user_name,
user_login: this.state.teacherdata.student_works[i].user_login,
late_penalty: student_works[i].late_penalty=== null?"0":student_works[i].late_penalty === undefined?"0":student_works[i].late_penalty,
ultimate_score:student_works[i].ultimate_score,
user_name: student_works[i].user_name,
user_login: student_works[i].user_login,
})
}
@ -297,15 +502,25 @@ class Listofworksstudentone extends Component {
teacherlists: teacherlists,
loadingstate: false,
styletable: styletable,
columns:columns2,
})
}
// 设置数据
seacthdata = () => {
seacthdata = (teacherdata) => {
let datalist = [];
if (this.state.teacherdata !== undefined) {
this.state.columns.map((item,key)=>{
if(this.props.isNotMember()===true) {
if(item.title==="学号"){
this.state.columns.splice(key,1)
}
}
})
let columns2=this.state.columns;
if (teacherdata !== undefined) {
// console.log("seacthdata设置数据")
// console.log(this.state.teacherdata.id )
if (this.state.teacherdata.id === undefined) {
if (teacherdata.id === undefined) {
this.setState({
data: [],
teacherlist: undefined,
@ -314,35 +529,35 @@ class Listofworksstudentone extends Component {
return
}
// console.log(this.state.teacherdata )
if (this.state.teacherdata.id !== undefined || this.state.teacherdata.id !== null || this.state.teacherdata.id !== "") {
if (teacherdata.id !== undefined || teacherdata.id !== null ||teacherdata.id !== "") {
// console.log("seacthdata设置数据1")
// console.log(this.state.teacherdata )
var timedata = moment(this.state.teacherdata.update_time).format('YYYY-MM-DD HH:mm');
var timedata = moment(teacherdata.update_time).format('YYYY-MM-DD HH:mm');
datalist.push({
myid: this.state.teacherdata.id,
myid: teacherdata.id,
number: 1,
name: this.state.teacherdata.user_name,
stduynumber: this.state.teacherdata.student_id,
classroom: this.state.teacherdata.group_name,
submitstate: this.state.teacherdata.work_status === 0 ? "未提交" : this.state.teacherdata.work_status === 1 ? "按时提交" : this.state.teacherdata.work_status === 2 ? "延时提交" : "未提交",
name: teacherdata.user_name,
stduynumber: teacherdata.student_id,
classroom: teacherdata.group_name,
submitstate: teacherdata.work_status === 0 ? "未提交" : teacherdata.work_status === 1 ? "按时提交" : teacherdata.work_status === 2 ? "延时提交" : "未提交",
// updatetime:this.state.teacherdata.student_works[i].update_time,
// updatetime:"",
updatetime: timedata === "Invalid date" ? "--" : timedata,
completion: this.state.teacherdata.complete_count === null ? "0" :this.state.teacherdata.complete_count === undefined ? "0": this.state.teacherdata.complete_count,
levelscore: this.state.teacherdata.final_score,
efficiencyscore: this.state.teacherdata.eff_score,
finalscore: this.state.teacherdata.work_score,
completion: teacherdata.complete_count === null ? "0" :teacherdata.complete_count === undefined ? "0": teacherdata.complete_count,
levelscore: teacherdata.final_score,
efficiencyscore: teacherdata.eff_score,
finalscore: teacherdata.work_score,
operating: "查看",
late_penalty: this.state.teacherdata.late_penalty=== null?"0":this.state.teacherdata.late_penalty === undefined?"0":this.state.teacherdata.late_penalty,
ultimate_score:this.state.teacherdata.ultimate_score,
user_name: this.state.teacherdata.user_name,
user_login: this.state.teacherdata.user_login,
late_penalty: teacherdata.late_penalty=== null?"0":teacherdata.late_penalty === undefined?"0":teacherdata.late_penalty,
ultimate_score:teacherdata.ultimate_score,
user_name: teacherdata.user_name,
user_login: teacherdata.user_login,
})
// }
var teacherlist = { //分页
total: this.state.teacherdata.student_works.length, //数据总数量
pageSize: this.state.teacherdata.student_works.length, //一页显示几条
total: teacherdata.student_works.length, //数据总数量
pageSize: teacherdata.student_works.length, //一页显示几条
current: this.state.page,
}
} else {
@ -361,6 +576,7 @@ class Listofworksstudentone extends Component {
data: datalist,
teacherlist: teacherlist,
loadingstate: false,
columns:columns2,
})
}
// 查看学员实训信息
@ -494,8 +710,9 @@ class Listofworksstudentone extends Component {
end_immediately: result.data.end_immediately,
code_review: result.data.code_review,
challenges_count:result.data.challenges_count,
view_report:result.data.view_report,
})
this.seacthdata();
this.seacthdata(result.data);
}
}).catch((error) => {
console.log(error)
@ -530,205 +747,8 @@ class Listofworksstudentone extends Component {
}
render() {
let {visibles, game_list, limit,experience, boolgalist,viewtrainingdata, teacherdata, page, data, jobsettingsdata, styletable, datas, order, loadingstate} = this.state;
let columns = [
{
title: '序号',
dataIndex: 'number',
key: 'number',
align: "center",
width: '96px',
render: (text, record) => (
<span>
{record.number === undefined ?
<a style={{
"color": '#9A9A9A',
"text-align": "center"
}}> --</a>
: record.number === "" ?
<a style={{
"color": '#9A9A9A',
"text-align": "center"
}}>--</a>
: record.number === "--" ?
<a style={{
"color": '#9A9A9A',
"text-align": "center"
}}>--</a>
:
<a style={{
"color": '#07111B',
"text-align": "center"
}}> {record.number}</a>
}
</span>
),
},
{
title: '姓名',
dataIndex: 'name',
key: 'name',
align: "center",
width: '147px',
render: (text, record) => (
<span>
{record.name === undefined ?
<a style={{
"color": '#9A9A9A',
"text-align": "center"
}}>--</a>
:
record.name === "" ?
<a style={{
"color": '#9A9A9A',
"text-align": "center"
}}>--</a>
:
record.name === null ?
<a style={{
"color": '#9A9A9A',
"text-align": "center"
}}>--</a>
:
record.name === "--" ?
<a style={{
"color": '#9A9A9A',
"text-align": "center"
}}>--</a>
:
<a style={{
"color": '#07111B',
"text-align": "center"
}}>{record.name}</a>
}
</span>
),
},
{
title: '学号',
dataIndex: 'stduynumber',
key: 'stduynumber',
align: "center",
width: '200px',
render: (text, record) => (
<span>
<a style={{
"color": '#9A9A9A',
"text-align": "center"
}}>{record.stduynumber === undefined ? "--" : record.stduynumber === null ? "--" : record.stduynumber === "" ? "--" : record.stduynumber}</a>
</span>
),
},
{
title: '分班',
key: 'classroom',
dataIndex: 'classroom',
align: "center",
render: (text, record) => (
<span>
<a style={{
"color": '#9A9A9A',
"text-align": "center"
}}>{record.classroom === undefined ? "--" : record.classroom === "" ? "--" : record.classroom === null ? "--" : record.classroom}</a>
</span>
),
},
{
title: '提交状态',
dataIndex: 'submitstate',
key: 'submitstate',
align: "center",
render: (text, record) => (
<span>
<a style={record.submitstate === "延时提交" ? {
"color": '#DD1717',
"text-align": "center"
} : record.submitstate === "按时提交" ? {"color": '#29BD8B', "text-align": "center"} : {
"color": '#747A7F',
"text-align": "center"
}}>{record.submitstate === undefined ? "--" : record.submitstate === "" ? "--" : record.submitstate === null ? "--" : record.submitstate}</a>
</span>
),
},
{
title: '更新时间',
dataIndex: 'updatetime',
key: 'updatetime',
align: "center",
render: (text, record) => (
<span>
<a style={{
"color": '#9A9A9A',
"text-align": "center"
}}>{record.updatetime === undefined ? "--" : record.updatetime === "" ? "--" : record.updatetime}</a>
</span>
),
},
{
title: '完成情况',
dataIndex: 'completion',
key: 'completion',
align: "center",
render: (text, record) => (
<span>
<a style={{"color": '#07111B', "text-align": "center"}}>{record.completion+"/"+this.state.challenges_count}</a>
</span>
),
},
{
title: '最终成绩',
dataIndex: 'levelscore',
key: 'levelscore',
align: "center",
render: (text, record) => (
<span>
{
record.levelscore && record.levelscore === "--"?
<a style={{"color": '#9A9A9A', "text-align": "center"}}>{record.levelscore}</a>
:
<a style={parseInt(record.levelscore) > 90 ? {
"color": '#DD1717',
"text-align": "center"
} : parseInt(record.levelscore) <= 90 ? {
"color": '#FF6800',
"text-align": "center",
"margin-left": "20px"
} : parseInt(record.levelscore) <= 60 ? {
"color": '#747A7F',
"text-align": "center"
} : {"color": '#747A7F', "text-align": "center"}}>{record.levelscore}</a>
}
let {visibles, game_list,columns, limit,experience, boolgalist,viewtrainingdata, teacherdata, page, data, jobsettingsdata, styletable, datas, order, loadingstate} = this.state;
</span>
),
},
{
title: '操作',
dataIndex: 'operating',
key: 'operating',
align: "center",
width: '96px',
render: (text, record) => (
<span>
{
record.submitstate === "未提交" ?<span style={{ color: '#9A9A9A'}}>--</span>
:
<a style={{"text-align": "center"}}
className="color-blue"
onClick={() => this.Viewstudenttraininginformation(record)}>{record.operating}</a>
}
</span>
),
},
];
// console.log("teacherdatateacherdatateacherdata");
// console.log(teacherdata);
// console.log("teacherdata.work_count");
// console.log(teacherdata&&teacherdata.work_count);
return (
teacherdata === undefined || teacherdata.student_works === undefined || teacherdata.student_works === null || JSON.stringify(teacherdata.student_works) === "[]" ?
// 学生不能查看别人的
@ -794,10 +814,10 @@ class Listofworksstudentone extends Component {
<Link
to={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${this.state.props.match.params.homeworkid}/settings`}
>设置</Link>
<Link className="fr color-blue font-16" target={"_blank"}
{this.state.view_report===true?<Link className="fr color-blue font-16" target={"_blank"}
to={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${teacherdata === undefined ? "" : teacherdata.id}/shixun_work_report`}>
查看实训报告
</Link>
</Link>:""}
{/*<a className="fr color-blue font-16">查看实训报告</a>*/}
{
teacherdata === undefined ? ""
@ -925,10 +945,10 @@ class Listofworksstudentone extends Component {
<Link
to={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${this.state.props.match.params.homeworkid}/settings`}
>设置</Link>
<Link className="fr color-blue font-16" target={"_blank"}
{this.state.view_report===true?<Link className="fr color-blue font-16" target={"_blank"}
to={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${this.state.props.match.params.homeworkid}/shixun_work_report`}>
查看实训报告
</Link>
</Link>:""}
{
teacherdata === undefined ? ""
: teacherdata.commit_des === null || teacherdata.commit_des === undefined ? "" :
@ -981,12 +1001,12 @@ class Listofworksstudentone extends Component {
style={{"color": '#FF6800'}}>{teacherdata.left_time.time}</span>}
</span>
<div className="fr color-grey-6 edu-menu-panel">
<div className="fr edu-menu-panel">
<ul>
<li className="edu-position edu-position-hidebox">
<a className="font-12 color-grey-6">
<a className="font-12 ">
{order === "updated_at" ? "时间" : order === "work_score" ? "成绩" : order === "student_id" ? "学号" : ""}排序</a>
<i className="iconfont icon-xiajiantou ml5 font-12 color-grey-6"></i>
<i className="iconfont icon-xiajiantou ml5 font-12 "></i>
<ul className="edu-position-hide undis mt10">
<li><a onClick={(e) => this.funorder("updated_at")} data-remote="true"
className="color-grey-6 font-12" style={{"text-align": "center "}}>更新时间</a></li>
@ -1016,7 +1036,6 @@ class Listofworksstudentone extends Component {
columns={columns}
pagination={false}
loading={loadingstate}
onChange={this.TablePagination}
/>}
</div>
{

@ -80,7 +80,7 @@ function startechart(data){
{
name:'',
type:'scatter',
data:data.echart_data.efficiency_list,
data:data.echart_data===undefined?"":data.echart_data.efficiency_list,
itemStyle:{
normal:{color:'#2e65ad'}
},
@ -106,9 +106,9 @@ function startechart(data){
data : [
{
name: data.username,
xAxis:data.echart_data.myself_eff[0],
yAxis:data.echart_data.myself_eff[1],
value:data.echart_data.myself_eff[1],
xAxis:data.echart_data===undefined?"":data.echart_data.myself_eff[0],
yAxis:data.echart_data===undefined?"":data.echart_data.myself_eff[1],
value:data.echart_data===undefined?"":data.echart_data.myself_eff[1],
}
],
itemStyle: {
@ -132,7 +132,7 @@ function startechart(data){
{
name:'二班',
type:'scatter',
data: data.echart_data.myself_eff,
data: data.echart_data===undefined?"":data.echart_data.myself_eff,
itemStyle:{
color:'#c23531'
}}
@ -141,7 +141,7 @@ function startechart(data){
var ablChart = echarts.init(document.getElementById('shixun_overall_ablility_chart'));
var dataBJ = data.echart_data.consume_list;
var dataBJ = data.echart_data===undefined?"":data.echart_data.consume_list;
var itemStyle = {
@ -188,7 +188,7 @@ function startechart(data){
formatter: function (obj) {
var value = obj.value;
if(obj.name ==data.username){
return "姓名:"+data.username + "<br/>"+'学号: '+data.user_id + "<br/>"+'得分:'+ data.echart_data.myself_object[1];
return "姓名:"+data.username + "<br/>"+'学号: '+data.user_id + "<br/>"+'得分:'+ data.echart_data===undefined?"":data.echart_data.myself_object[1];
}
}
@ -241,9 +241,9 @@ function startechart(data){
data : [
{
name: data.username,
xAxis: data.echart_data.myself_object[0],
yAxis:data.echart_data.myself_object[1],
value:data.echart_data.myself_object[1]
xAxis: data.echart_data===undefined?"":data.echart_data.myself_object[0],
yAxis:data.echart_data===undefined?"":data.echart_data.myself_object[1],
value:data.echart_data===undefined?"":data.echart_data.myself_object[1]
}
],
itemStyle: {
@ -256,7 +256,7 @@ function startechart(data){
{
name: '能力1',
type: 'scatter',
data: data.echart_data.myself_object,
data: data.echart_data===undefined?"":data.echart_data.myself_object,
itemStyle:itemStyle1,
symbolSize: function (val){
return Math.round(val[2]);
@ -367,8 +367,8 @@ class Shixunechart extends Component {
<div className="fl with65" style={{paddingLeft: "5%"}}>
<li className="mt5 mb5">{data&&data.username}</li>
<li className="mt5 mb5">{data&&data.user_id}</li>
<li className="mt5 mb5 color-orange03"><span className="color-orange03">{data&&data.echart_data.myself_eff[1]}</span></li>
<li className="mt5 mb5 color-orange03"><span className="color-orange03">{data&&data.echart_data.myself_eff[0]}</span></li>
<li className="mt5 mb5 color-orange03"><span className="color-orange03">{data&&data.echart_data===undefined?"":data&&data.echart_data.myself_eff[1]}</span></li>
<li className="mt5 mb5 color-orange03"><span className="color-orange03">{data&&data.echart_data===undefined?"":data&&data.echart_data.myself_eff[0]}</span></li>
</div>
</div>
<div className="pr mt20 with100">
@ -393,7 +393,7 @@ class Shixunechart extends Component {
<div className="fl with65" style={{paddingLeft: "5%"}}>
<li className="mt5 mb5">{data&&data.username}</li>
<li className="mt5 mb5">{data&&data.user_id}</li>
<li className="mt5 mb5 color-orange03"><span className="color-orange03">{data&&data.echart_data.myself_object[1]}</span></li>
<li className="mt5 mb5 color-orange03"><span className="color-orange03">{data&&data.echart_data===undefined?"":data&&data.echart_data.myself_object[1]}</span></li>
</div>
</div>
<div className="popup_tip_box fontGrey2 with100 disc mt20"

@ -198,13 +198,13 @@ class ShixunsHome extends Component {
</div>
<Link to={"/paths"} className="moreitem">更多<i className="fa fa-angle-right ml5"></i></Link>
<div className="square-list clearfix">
<div className="square-list clearfix" style={{width:'102%'}}>
{homedatalist===undefined?"":homedatalist.subjects.map((item,key)=>{
if(key<8)
return(
<div className="square-Item" key={key} id={item.id}>
<div className="square-Item" key={key} id={item.id} style={{width:'286px'}}>
<div className="tag-green">
<span className="tag-name"> {item.name}</span>
@ -272,10 +272,10 @@ class ShixunsHome extends Component {
</div>
<Link to={"/shixuns"} className="moreitem">更多<i className="fa fa-angle-right ml5"></i></Link>
<div className="square-list clearfix">
<div className="square-list clearfix" style={{width:'102%'}}>
{homedatalist===undefined?"":homedatalist.shixuns.map((item,key)=>{
return(
<div className="square-Item" key={key} id={item.id}>
<div className="square-Item" key={key} id={item.id} style={{width:'286px'}}>
<div className="tag-green">
<span className="tag-name"> {item.tag_name}</span>

@ -16,7 +16,7 @@ class NewFooter extends Component {
render() {
return (
<div className="newFooter edu-txt-center">
<div className="newFooter edu-txt-center newContainers">
<div className="inner-footer_con">
<div className="footercon">
<div className="inline mt40 mb5">

@ -671,7 +671,7 @@ submittojoinclass=(value)=>{
</div>
</li>
<li className=""><a href={"/libraries"}>教学案例</a></li>
<li className=""><a href={this.props.Headertop===undefined?"":this.props.Headertop.competitions_url}>竞赛</a></li>
<li className={`${activeForums === true ? 'active' : ''}`}><a href={this.props.Headertop===undefined?"":this.props.Headertop.topic_url}>问答</a></li>

@ -23,7 +23,7 @@ $(window).scroll(function(){
});
function rightSlider(){
var poi=parseInt((parseInt($(window).width())- 1200 )/2)-60;
var poi=parseInt((parseInt($(window).width())- 1200 )/2)-34;
// console.log(parseInt($(window).width())+" "+poi);
if(poi>0){
$(".-task-sidebar").css("right",poi);

@ -294,12 +294,21 @@ export function TPMIndexHOC(WrappedComponent) {
return (
<div>
<SiderBar
Headertop={Headertop}
/>
<SiderBar Headertop={Headertop}/>
<style>{
`
.newContainers{
width: 100%;
min-width: 1440px;
max-width: unset;
}
// .-task-sidebar{
// right: 270px !important;
// }
`
}</style>
<NewHeader {...this.state} {...this.props}></NewHeader>
<div className="newContainer">
<div className="newContainer newContainers">
<WrappedComponent initCommonState={(user)=>this.initCommonState(user)}
{...this.props} {...this.state}
showShixun={this.showShixun} aboutFocus={this.aboutFocus}
@ -308,6 +317,8 @@ export function TPMIndexHOC(WrappedComponent) {
</WrappedComponent>
</div>
<NewFooter
Footerdown={Footerdown}
/>

Loading…
Cancel
Save