一键评阅

dev_new_shixunsrepository
杨树明 5 years ago
parent b6e2b71959
commit bead5d1a1a

@ -0,0 +1,167 @@
import React,{ Component } from "react";
import { Modal,Checkbox,Upload,Button,Icon,message,Input,Radio} from "antd";
import { WordNumberTextarea } from 'educoder';
class ApprausePublic extends Component{
constructor(props){
super(props);
this.state={
group_ids:[],
fileList:[],
Inputsval:undefined,
textareavaltype:false,
comment:undefined,
hidden_comment:undefined
}
}
componentDidMount() {
}
comment=(e)=>{
this.setState({
comment:e.target.value
})
this.hideentyps(e.target.value)
}
hideentyps=(value)=>{
if(value===undefined||value===null||value===""){
}else{
this.setState({
textareavaltype:false
})
}
}
hidden_comment=(e)=>{
this.setState({
hidden_comment:e.target.value
})
this.hideentyps(e.target.value)
}
Saves=()=>{
let{comment,hidden_comment}=this.state;
let commenttype=comment===undefined||comment===null||comment==="";
let hidden_commenttype=hidden_comment===undefined||hidden_comment===null||hidden_comment==="";
if(commenttype===true&&hidden_commenttype===true){
this.setState({
textareavaltype:true
})
return
}
this.props.SaveAppraiseModal(this.state.comment,this.state.hidden_comment);
}
render(){
let {textareavaltype,comment,hidden_comment}=this.state;
return(
<div>
<style>
{
`
@media (max-width: 2000px) {
.WordNumberTextarea{
height: 130px !important;
}
}
@media (max-width: 1350px) {
.HomeworkModal{
top:10px !important;
}
.WordNumberTextarea{
height: 80px !important;
}
}
@media (max-width: 1250px) {
.HomeworkModal{
top:0px !important;
}
.WordNumberTextarea{
height: 40px !important;
}
}
`
}
</style>
<Modal
keyboard={false}
className={"HomeworkModal"}
title={this.props.ApprausePublicName||"一键评阅"}
visible={this.props.visible}
closable={false}
footer={null}
destroyOnClose={true}
>
<div className={"pd015"}>
<style>
{
`
.pd015 {
padding: 0px 15px 15px 7px;
}
.font{
font-size: 14px;
font-weight: 400;
color: rgba(5,16,26,1);
}
.newfont{
height: 16px;
font-size: 16px;
font-weight: 400;
color: rgba(5,16,26,1);
line-height: 16px;
margin-bottom: 5px;
}
`
}
</style>
<div className="clearfix">
<p className={"font mb10 ml10"}>
可见(学生可查看老师的评阅内容
</p>
{/*<Radio.Group onChange={this.onChanges} value={this.state.valuetype}>*/}
{/*<Radio value={0} style={radioStyle} className={"newfont"}>可见 (学生查看老师的评阅内容)</Radio>*/}
{/*<Radio value={1} style={radioStyle} className={"newfont"}>不可见 (仅对课堂老师可见)</Radio>*/}
{/*</Radio.Group>*/}
<WordNumberTextarea
placeholder={"请填写评阅内容"}
onInput={(e)=>this.comment(e)}
value={comment}
maxlength={500}
/>
<p className={"font mt10 mb10 ml10"}>
不可见(仅对课堂老师可见
</p>
<WordNumberTextarea
placeholder={"请填写评阅内容"}
onInput={(e)=>this.hidden_comment(e)}
value={hidden_comment}
maxlength={500}
/>
<li style={{height:"20px",lineHeight:"20px"}} className={textareavaltype===true?"color-red mt5 mb10 ml10":"none"}><span>评阅内容至少有一个不为空</span></li>
</div>
<div className={textareavaltype===false?"mt20 clearfix edu-txt-center":"clearfix edu-txt-center"}>
<a className="task-btn color-white mr30" onClick={()=>this.props.Cancel()}>{this.props.Cancelname || '取消'}</a>
<a className="task-btn task-btn-orange" onClick={()=>this.Saves()}>{this.props.Savesname || '确定'}</a>
</div>
</div>
</Modal>
</div>
)
}
}
export default ApprausePublic;

@ -308,7 +308,7 @@
backgroud: rgba(234, 234, 234, 1);
width: 530px;
margin-left: 10px;
margin-top: 25px;
margin-top: 5px;
height: 214px !important;
}

@ -116,6 +116,7 @@ class PollDetailTabForth extends Component{
let url=`/polls/${pollId}/poll_setting.json`;
axios.get(url).then((result)=>{
if(result){
this.props.getPollInfo();
this.setState({
polls:result.data.poll,
unitSetting:result.data.poll.unified_setting,

@ -1294,11 +1294,11 @@ class Listofworksstudentone extends Component {
record.submitstate === "未开启" ?
<a style={{textAlign: "center",width: '40px'}} className="color-blue"
onMouseDown={(e) => this.Viewstudenttraininginformationtysl2(e, record)}
onClick={() => this.Viewstudenttraininginformationt(record)}>评阅</a> :
onClick={() => this.Viewstudenttraininginformationt(record)}>{record.has_comment===false?"评阅":"详情"}</a> :
<span>
<a style={{textAlign: "center"}} className="color-blue maxnamewidth120"
onMouseDown={(e) => this.Viewstudenttraininginformationtysl2(e, record)}
onClick={() => this.Viewstudenttraininginformationt(record)}>评阅</a>
onClick={() => this.Viewstudenttraininginformationt(record)}>{record.has_comment===false?"评阅":"详情"}</a>
</span>
)
},
@ -1656,11 +1656,11 @@ class Listofworksstudentone extends Component {
record.submitstate === "未开启" ?
<a style={{textAlign: "center",width: '40px'}} className="color-blue"
onMouseDown={(e) => this.Viewstudenttraininginformationtysl2(e, record)}
onClick={() => this.Viewstudenttraininginformationt(record)}>评阅</a> :
onClick={() => this.Viewstudenttraininginformationt(record)}>{record.has_comment===false?"评阅":"详情"}</a> :
<span>
<a style={{textAlign: "center"}} className="color-blue"
onMouseDown={(e) => this.Viewstudenttraininginformationtysl2(e, record)}
onClick={() => this.Viewstudenttraininginformationt(record)}>评阅</a>
onClick={() => this.Viewstudenttraininginformationt(record)}>{record.has_comment===false?"评阅":"详情"}</a>
</span>
)
},
@ -1886,7 +1886,12 @@ class Listofworksstudentone extends Component {
console.log(error);
})
}
AkeyreviewitGetalistofworkstwo=()=>{
this.setState({
loadingstate: true,
})
this.Getalistofworkstwo("", "", "", "", 1, 20);
}
// 获取作品列表
Getalistofworkstwo = (ordervlue, checkedValuesine, checkedValuesineinfo, searchtext, page, limit) => {
// console.log("获取作品列表");222222222222
@ -2075,6 +2080,7 @@ class Listofworksstudentone extends Component {
stduynumber: teacherdata.student_id,
classroom: teacherdata.group_name,
cost_time: teacherdata.cost_time,
has_comment:teacherdata.has_comment,
submitstate: teacherdata.work_status === 0 ? "未开启" : teacherdata.work_status === 1 ? "未通关" : teacherdata.work_status === 2 ? "按时通关" : "迟交通关",
// updatetime:this.state.teacherdata.student_works[i].update_time,
// updatetime:"",
@ -2119,6 +2125,7 @@ class Listofworksstudentone extends Component {
stduynumber: student_works[i].student_id,
classroom: student_works[i].group_name,
cost_time: student_works[i].cost_time,
has_comment:teacherdata[i].has_comment,
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:"",
@ -2280,6 +2287,7 @@ class Listofworksstudentone extends Component {
stduynumber: teacherdata.student_id,
classroom: teacherdata.group_name,
cost_time: teacherdata.cost_time,
has_comment:teacherdata.has_comment,
submitstate: teacherdata.work_status === 0 ? "未开启" : teacherdata.work_status === 1 ? "未通关" : teacherdata.work_status === 2 ? "按时通关" : "迟交通关",
// updatetime:this.state.teacherdata.student_works[i].update_time,
// updatetime:"",
@ -2642,6 +2650,7 @@ class Listofworksstudentone extends Component {
stduynumber: student_works[i].student_id,
classroom: student_works[i].group_name,
cost_time: student_works[i].cost_time,
has_comment:teacherdata[i].has_comment,
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:"",

@ -6,18 +6,20 @@ import {
notification,
Spin
} from "antd";
import '../css/members.css';
import "../common/formCommon.css";
import '../css/Courses.css';
import './style.css';
import '../css/busyWork.css';
import '../poll/pollStyle.css';
import ApprausePublic from "../coursesPublic/ApprausePublic";
import Listofworksstudentone from './Listofworksstudentone';
import Trainingjobsetting from './Trainingjobsetting';
import Workquestionandanswer from './Workquestionandanswer';
import CoursesListType from '../coursesPublic/CoursesListType';
import ShixunStudentWork from "./ShixunStudentWork";
import Startshixuntask from "../coursesPublic/Startshixuntask";
import '../css/members.css';
import "../common/formCommon.css";
import '../css/Courses.css';
import './style.css';
import '../css/busyWork.css';
import '../poll/pollStyle.css';
import TPMMDEditor from "../../tpm/challengesnew/TPMMDEditor";
import DownloadMessageysl from "../../modals/DownloadMessageysl";
@ -41,6 +43,7 @@ class ShixunHomeworkPage extends Component {
ModalsType:false,
mylistisSpin:false,
Showupdateinstructions:false,
AppraiseModaltype:false
}
}
@ -189,8 +192,41 @@ class ShixunHomeworkPage extends Component {
this.props.history.replace(`/courses/${this.props.match.params.coursesId}/${jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.main === 1 ? "shixun_homeworks" :"shixun_homework"}/${jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.category_id === undefined ? "" : jobsettingsdatapage.data.category.category_id}`);
}
Akeyreviewit=()=>{
this.setState({
AppraiseModaltype:true
})
}
hideAppraiseModaltype=()=>{
this.setState({
AppraiseModaltype:false
})
}
SaveAppraiseModal=(comment,hidden_comment)=>{
let url = `/homework_commons/${this.props.match.params.homeworkid}/batch_comment.jsonr`
axios.post(url,{
comment: comment,
hidden_comment: hidden_comment,
}
)
.then((response) => {
if (response.data.status == 0) {
this.props.showNotification('一键评阅成功')
this.hideAppraiseModaltype()
this.child.AkeyreviewitGetalistofworkstwo()
} else {
}
})
.catch( (error) =>{
});
}
render() {
let {tab, teacherdatapage, jobsettingsdatapage} = this.state;
let {tab, teacherdatapage, jobsettingsdatapage,AppraiseModaltype} = this.state;
const isAdmin = this.props.isAdmin();
// console.log(119)
@ -207,6 +243,17 @@ class ShixunHomeworkPage extends Component {
loadtype={false}
>
</Modals>
{AppraiseModaltype===true?<ApprausePublic
{...this.props}
{...this.state}
ApprausePublicName={"一键评阅"}
visible={AppraiseModaltype}
Cancel={()=>this.hideAppraiseModaltype()}
SaveAppraiseModal={(comment,hidden_comment)=>this.SaveAppraiseModal(comment,hidden_comment)}
/>:""}
<div className={"educontent mt10 mb20"} style={{width: "1200px"}}>
<Spin size="large" spinning={this.state.mylistisSpin}>
{
@ -313,10 +360,17 @@ class ShixunHomeworkPage extends Component {
<a className="fr color-blue font-16" onClick={(child)=>this.homeworkstarts(this.child)}>立即发布</a>
: ""
: ""}
{this.props.isAdmin() ?
teacherdatapage && teacherdatapage.code_review === true ?
<a className="fr color-blue font-16" onClick={(child)=>this.workshowmodels(this.child)}>代码查重</a>
: "" : ""}
{parseInt(tab) === 0 ?this.props.isAdmin() ?
jobsettingsdatapage === undefined ? [""] : jobsettingsdatapage.data.homework_status[0] === "未发布" ? "" :
<a className="fr color-blue font-16" onClick={()=>this.Akeyreviewit()}>一键评阅</a>
: "":""}
{
parseInt(tab)===1?
this.props.isAdmin() ?

@ -733,7 +733,7 @@ a.white-btn.use_scope-btn:hover{
backgroud: rgba(234, 234, 234, 1);
width: 530px;
margin-left: 10px;
margin-top: 25px;
margin-top: 5px;
height: 214px !important;
}

Loading…
Cancel
Save