hjm 6 years ago
commit 3c2d784ccc

@ -114,21 +114,21 @@ module.exports = {
// First, run the linter. // First, run the linter.
// It's important to do this before Babel processes the JS. // It's important to do this before Babel processes the JS.
// 上线然后要注释回来 // 上线然后要注释回来
// { {
// test: /\.(js|jsx|mjs)$/, test: /\.(js|jsx|mjs)$/,
// enforce: 'pre', enforce: 'pre',
// use: [ use: [
// { {
// options: { options: {
// formatter: eslintFormatter, formatter: eslintFormatter,
// eslintPath: require.resolve('eslint'), eslintPath: require.resolve('eslint'),
//
// }, },
// loader: require.resolve('eslint-loader'), loader: require.resolve('eslint-loader'),
// }, },
// ], ],
// include: paths.appSrc, include: paths.appSrc,
// }, },
{ {
// "oneOf" will traverse all following loaders until one will // "oneOf" will traverse all following loaders until one will
// match the requirements. When no loader matches it will fall // match the requirements. When no loader matches it will fall

@ -46,7 +46,8 @@ class Startshixuntask extends Component{
}else{ }else{
if(response.data.status!=401&&response.data.status!=403){ if(response.data.status!=401&&response.data.status!=403){
window.location.href = "/tasks/"+response.data.game_identifier; const w=window.open('about:blank');
w.location.href= "/tasks/"+response.data.game_identifier
} }
} }

@ -2,7 +2,7 @@ import React,{Component} from "React";
import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal,Spin,Tooltip} from "antd"; import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal,Spin,Tooltip} from "antd";
import {Link} from 'react-router-dom'; import {Link} from 'react-router-dom';
import TPMMDEditor from '../../../tpm/challengesnew/TPMMDEditor'; import TPMMDEditor from '../../../tpm/challengesnew/TPMMDEditor';
import { WordsBtn,getUrl ,bytesToSize} from 'educoder'; import { WordsBtn,getUrl ,bytesToSize,getImageUrl} from 'educoder';
import axios from 'axios'; import axios from 'axios';
import Modals from '../../../modals/Modals'; import Modals from '../../../modals/Modals';
const Search = Input.Search; const Search = Input.Search;

@ -7,7 +7,8 @@ import Titlesearchsection from '../common/titleSearch/TitleSearchSection'
import ColorCountText from '../common/titleSearch/ColorCountText' import ColorCountText from '../common/titleSearch/ColorCountText'
import update from 'immutability-helper' import update from 'immutability-helper'
import { WordsBtn, ConditionToolTip, on, off } from 'educoder' import { WordsBtn, ConditionToolTip, on, off ,trigger} from 'educoder'
import axios from 'axios' import axios from 'axios'
import _ from 'lodash' import _ from 'lodash'

@ -93,6 +93,7 @@ class Listofworks extends Component {
code_review: false, code_review: false,
boolgalist:true, boolgalist:true,
challenges_count:0, challenges_count:0,
experience:0,
columns: [ columns: [
{ {
title: '序号', title: '序号',
@ -384,7 +385,7 @@ class Listofworks extends Component {
// course_group:分班情况 [232, 231] []:不限(空数组) // course_group:分班情况 [232, 231] []:不限(空数组)
var data = { var data = {
search: "", search: "",
order: "", order: "desc",
b_order: "asc", b_order: "asc",
work_status: "", work_status: "",
course_group: "", course_group: "",
@ -457,6 +458,11 @@ class Listofworks extends Component {
task_status: result.data.task_status, task_status: result.data.task_status,
course_group_info: result.data.course_group_info, course_group_info: result.data.course_group_info,
loadingstate: false, loadingstate: false,
jobsettingsdata: result,
publish_immediately: result.data.publish_immediately,
work_efficiency: result.data.work_efficiency,
end_immediately: result.data.end_immediately,
code_review: result.data.code_review,
challenges_count:result.data.challenges_count, challenges_count:result.data.challenges_count,
}) })
@ -1361,6 +1367,7 @@ class Listofworks extends Component {
let datalist = []; let datalist = [];
var game_list = result.data.game_list var game_list = result.data.game_list
var boolgalist=true; var boolgalist=true;
var experience=0;
for (var i = 0; i < game_list.length; i++) { for (var i = 0; i < game_list.length; i++) {
datalist.push({ datalist.push({
@ -1370,6 +1377,7 @@ class Listofworks extends Component {
classroom: game_list[i].score, classroom: game_list[i].score,
complete_status: game_list[i].complete_status, complete_status: game_list[i].complete_status,
}) })
experience=game_list[i].complete_status+experience;
if(game_list[i].complete_status === 2 || game_list[i].complete_status===3){ if(game_list[i].complete_status === 2 || game_list[i].complete_status===3){
boolgalist=false; boolgalist=false;
@ -1383,6 +1391,7 @@ class Listofworks extends Component {
viewtrainingdata: result.data, viewtrainingdata: result.data,
visibles: true, visibles: true,
game_list: datalist, game_list: datalist,
experience:experience,
boolgalist:boolgalist, boolgalist:boolgalist,
}) })
} }
@ -1588,7 +1597,7 @@ class Listofworks extends Component {
render() { render() {
// console.log("Listofworks.js000") // console.log("Listofworks.js000")
let {columns, page, boolgalist,limit, course_groupysls, course_groupyslstwo, unlimited, unlimitedtwo, loadingstate, viewtrainingdata, game_list, data, course_group_info, order, teacherdata, task_status, checkedValuesine, searchtext, teacherlist, visible, visibles, jobsettingsdata} = this.state; let {columns, page, boolgalist,limit, experience,course_groupysls, course_groupyslstwo, unlimited, unlimitedtwo, loadingstate, viewtrainingdata, game_list, data, course_group_info, order, teacherdata, task_status, checkedValuesine, searchtext, teacherlist, visible, visibles, jobsettingsdata} = this.state;
// //
// console.log(teacherdata&&teacherdata.shixun_identifier) // console.log(teacherdata&&teacherdata.shixun_identifier)
// console.log(course_group_info) // console.log(course_group_info)
@ -1632,6 +1641,7 @@ class Listofworks extends Component {
viewtrainingdata={viewtrainingdata} viewtrainingdata={viewtrainingdata}
game_list={game_list} game_list={game_list}
visible={visibles} visible={visibles}
experience={experience}
boolgalist={boolgalist} boolgalist={boolgalist}
Cancel={() => this.cancelModulationModels()} Cancel={() => this.cancelModulationModels()}
/> />

@ -90,7 +90,7 @@ class Listofworksstudentone extends Component {
var data = { var data = {
search: "", search: "",
order: "", order: "",
b_order: "asc", b_order: "desc",
page: 1, page: 1,
limit: 20, limit: 20,
work_status: "", work_status: "",
@ -107,6 +107,9 @@ class Listofworksstudentone extends Component {
publish_immediately: result.data.publish_immediately, publish_immediately: result.data.publish_immediately,
end_immediately: result.data.end_immediately, end_immediately: result.data.end_immediately,
id: result.data.id, id: result.data.id,
work_efficiency: result.data.work_efficiency,
code_review: result.data.code_review,
challenges_count:result.data.challenges_count,
}) })
if (result.data.student_works === undefined || result.data.student_works === null || JSON.stringify(result.data.student_works) === "[]") { if (result.data.student_works === undefined || result.data.student_works === null || JSON.stringify(result.data.student_works) === "[]") {
this.seacthdata(); this.seacthdata();
@ -154,6 +157,13 @@ class Listofworksstudentone extends Component {
task_status: result.data.task_status, task_status: result.data.task_status,
course_group_info: result.data.course_group_info, course_group_info: result.data.course_group_info,
student_works: result.data.student_works, student_works: result.data.student_works,
loadingstate: false,
jobsettingsdata: result,
publish_immediately: result.data.publish_immediately,
work_efficiency: result.data.work_efficiency,
end_immediately: result.data.end_immediately,
code_review: result.data.code_review,
challenges_count:result.data.challenges_count,
}) })
if (result.data.student_works === undefined || result.data.student_works === null || JSON.stringify(result.data.student_works) === "[]") { if (result.data.student_works === undefined || result.data.student_works === null || JSON.stringify(result.data.student_works) === "[]") {
this.seacthdata(); this.seacthdata();
@ -214,11 +224,15 @@ class Listofworksstudentone extends Component {
// updatetime:this.state.teacherdata.student_works[i].update_time, // updatetime:this.state.teacherdata.student_works[i].update_time,
// updatetime:"", // updatetime:"",
updatetime: timedata === "Invalid date" ? "--" : timedata, updatetime: timedata === "Invalid date" ? "--" : timedata,
completion: this.state.teacherdata.complete_count === 4 ? "4/4" : this.state.teacherdata.complete_count === 3 ? "3/4" : this.state.teacherdata.complete_count === 2 ? "2/4" : this.state.teacherdata.complete_count === 1 ? "1/4" : this.state.teacherdata.complete_count === 0 ? "0" : 0, 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, levelscore: this.state.teacherdata.final_score,
efficiencyscore: this.state.teacherdata.eff_score, efficiencyscore: this.state.teacherdata.eff_score,
finalscore: this.state.teacherdata.work_score, finalscore: this.state.teacherdata.work_score,
operating: "查看", operating: "查看",
late_penalty: this.state.teacherdata.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.ultimate_score,
user_name: this.state.teacherdata.user_name,
user_login: this.state.teacherdata.user_login,
}) })
// } // }
@ -253,11 +267,15 @@ class Listofworksstudentone extends Component {
// updatetime:this.state.teacherdata.student_works[i].update_time, // updatetime:this.state.teacherdata.student_works[i].update_time,
// updatetime:"", // updatetime:"",
updatetime: timedata === "Invalid date" ? "--" : timedata, updatetime: timedata === "Invalid date" ? "--" : timedata,
completion: this.state.student_works[i].complete_count === 4 ? "4/4" : this.state.student_works[i].complete_count === 3 ? "3/4" : this.state.student_works[i].complete_count === 2 ? "2/4" : this.state.student_works[i].complete_count === 1 ? "1/4" : this.state.student_works[i].complete_count === 0 ? "0" : 0, 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, levelscore: this.state.student_works[i].final_score,
efficiencyscore: this.state.student_works[i].eff_score, efficiencyscore: this.state.student_works[i].eff_score,
finalscore: this.state.student_works[i].work_score, finalscore: this.state.student_works[i].work_score,
operating: "查看", 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,
}) })
} }
@ -310,11 +328,15 @@ class Listofworksstudentone extends Component {
// updatetime:this.state.teacherdata.student_works[i].update_time, // updatetime:this.state.teacherdata.student_works[i].update_time,
// updatetime:"", // updatetime:"",
updatetime: timedata === "Invalid date" ? "--" : timedata, updatetime: timedata === "Invalid date" ? "--" : timedata,
completion: this.state.teacherdata.complete_count === 4 ? "4/4" : this.state.teacherdata.complete_count === 3 ? "3/4" : this.state.teacherdata.complete_count === 2 ? "2/4" : this.state.teacherdata.complete_count === 1 ? "1/4" : this.state.teacherdata.complete_count === 0 ? "0" : 0, 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, levelscore: this.state.teacherdata.final_score,
efficiencyscore: this.state.teacherdata.eff_score, efficiencyscore: this.state.teacherdata.eff_score,
finalscore: this.state.teacherdata.work_score, finalscore: this.state.teacherdata.work_score,
operating: "查看", operating: "查看",
late_penalty: this.state.teacherdata.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.ultimate_score,
user_name: this.state.teacherdata.user_name,
user_login: this.state.teacherdata.user_login,
}) })
// } // }
@ -361,7 +383,8 @@ class Listofworksstudentone extends Component {
// console.log(JSON.stringify(result)) // console.log(JSON.stringify(result))
let datalist = []; let datalist = [];
var game_list = result.data.game_list var game_list = result.data.game_list
var boolgalist=true;
var experience=0;
for (var i = 0; i < game_list.length; i++) { for (var i = 0; i < game_list.length; i++) {
datalist.push({ datalist.push({
@ -371,7 +394,11 @@ class Listofworksstudentone extends Component {
classroom: game_list[i].score, classroom: game_list[i].score,
complete_status: game_list[i].complete_status, complete_status: game_list[i].complete_status,
}) })
experience=game_list[i].complete_status+experience;
if(game_list[i].complete_status === 2 || game_list[i].complete_status===3){
boolgalist=false;
}
} }
// console.log("viewtraining"); // console.log("viewtraining");
// console.log(datalist); // console.log(datalist);
@ -379,7 +406,9 @@ class Listofworksstudentone extends Component {
this.setState({ this.setState({
viewtrainingdata: result.data, viewtrainingdata: result.data,
visibles: true, visibles: true,
game_list: datalist game_list: datalist,
experience:experience,
boolgalist:boolgalist,
}) })
} }
}).catch((error) => { }).catch((error) => {
@ -458,7 +487,13 @@ class Listofworksstudentone extends Component {
task_status: result.data.task_status, task_status: result.data.task_status,
course_group_info: result.data.course_group_info, course_group_info: result.data.course_group_info,
student_works: result.data.student_works, student_works: result.data.student_works,
loadingstate: false loadingstate: false,
jobsettingsdata: result,
publish_immediately: result.data.publish_immediately,
work_efficiency: result.data.work_efficiency,
end_immediately: result.data.end_immediately,
code_review: result.data.code_review,
challenges_count:result.data.challenges_count,
}) })
this.seacthdata(); this.seacthdata();
} }
@ -495,7 +530,7 @@ class Listofworksstudentone extends Component {
} }
render() { render() {
let {visibles, game_list, limit, viewtrainingdata, teacherdata, page, data, jobsettingsdata, styletable, datas, order, loadingstate} = this.state; let {visibles, game_list, limit,experience, boolgalist,viewtrainingdata, teacherdata, page, data, jobsettingsdata, styletable, datas, order, loadingstate} = this.state;
let columns = [ let columns = [
{ {
title: '序号', title: '序号',
@ -639,10 +674,7 @@ class Listofworksstudentone extends Component {
align: "center", align: "center",
render: (text, record) => ( render: (text, record) => (
<span> <span>
<a style={{ <a style={{"color": '#07111B', "text-align": "center"}}>{record.completion+"/"+this.state.challenges_count}</a>
"color": '#9A9A9A',
"text-align": "center"
}}>{record.completion === undefined ? "--" : record.completion === "" ? "--" : record.completion}</a>
</span> </span>
), ),
}, },
@ -719,6 +751,8 @@ class Listofworksstudentone extends Component {
viewtrainingdata={viewtrainingdata} viewtrainingdata={viewtrainingdata}
game_list={game_list} game_list={game_list}
visible={visibles} visible={visibles}
experience={experience}
boolgalist={boolgalist}
Cancel={() => this.cancelModulationModels()} Cancel={() => this.cancelModulationModels()}
/> />
</div> </div>
@ -851,6 +885,8 @@ class Listofworksstudentone extends Component {
viewtrainingdata={viewtrainingdata} viewtrainingdata={viewtrainingdata}
game_list={game_list} game_list={game_list}
visible={visibles} visible={visibles}
experience={experience}
boolgalist={boolgalist}
Cancel={() => this.cancelModulationModels()} Cancel={() => this.cancelModulationModels()}
/> : "" /> : ""
} }
@ -925,7 +961,6 @@ class Listofworksstudentone extends Component {
pagination={false} pagination={false}
loading={false} loading={false}
showHeader={false} showHeader={false}
scroll={{y: 240}}
/>} />}
</div> </div>
{JSON.stringify(datas) !== "[]" ? {JSON.stringify(datas) !== "[]" ?

@ -349,7 +349,7 @@ class ShixunhomeWorkItem extends Component{
{this.props.isAdmin?<div className="homepagePostSetting" style={{"right":"4px","top":"44px","display":"block","width":"192px"}}> {this.props.isAdmin?<div className="homepagePostSetting" style={{"right":"4px","top":"44px","display":"block","width":"192px"}}>
<a className="btn colorblue font-16" href={"/shixuns/"+discussMessage.shixun_identifier+"/challenges"} target={"_blank"}>实训详情</a> <a className="btn colorblue font-16" href={"/shixuns/"+discussMessage.shixun_identifier+"/challenges"} target={"_blank"}>实训详情</a>
{this.props.isClassManagement()?<a onClick={()=>this.editname(discussMessage.name,discussMessage.homework_id)} className={"btn colorblue ml20 font-16"}>重命名</a>:""} {this.props.isClassManagement?<a onClick={()=>this.editname(discussMessage.name,discussMessage.homework_id)} className={"btn colorblue ml20 font-16"}>重命名</a>:""}
<WordsBtn className="btn colorblue ml20 font-16" to={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${discussMessage.homework_id}/settings`} > 设置</WordsBtn> <WordsBtn className="btn colorblue ml20 font-16" to={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${discussMessage.homework_id}/settings`} > 设置</WordsBtn>
</div>:""} </div>:""}

@ -37,6 +37,7 @@ class TraineetraininginformationModal extends Component {
userids: this.props.userids, userids: this.props.userids,
game_list:this.props.game_list, game_list:this.props.game_list,
boolgalist:this.props.boolgalist, boolgalist:this.props.boolgalist,
experience:this.props.experience,
}) })
// console.log("TraineetraininginformationModal") // console.log("TraineetraininginformationModal")
@ -60,7 +61,7 @@ class TraineetraininginformationModal extends Component {
} }
render() { render() {
var columns; var columns;
if(this.props.boolgalist === true) { if(this.props.boolgalis&&this.props.boolgalist === true) {
columns = [ columns = [
{ {
title: '关卡', title: '关卡',
@ -195,7 +196,7 @@ class TraineetraininginformationModal extends Component {
<div style={{"width": "100%","text-align": "left","clear": "both"}}> <div style={{"width": "100%","text-align": "left","clear": "both"}}>
<div className="mt5 fl" > <div className="mt5 fl" >
<span style={{"text-align": "left"}}>{this.props.viewtrainingdata === undefined ? "" : this.LimitNumber(this.props.viewtrainingdata.shixun_name)}</span> <span style={{"text-align": "left"}}>{this.props.viewtrainingdata === undefined ? "" : this.LimitNumber(this.props.viewtrainingdata.shixun_name)}</span>
<span className="ml10 " style={{"text-align": "left","color":'#29BD8B'}} >经验值<span style={{"color":'#29BD8B'}}> {this.props.viewtrainingdata === undefined ? "" : this.props.viewtrainingdata.shixun_score}</span></span> <span className="ml10 " style={{"text-align": "left","color":'#29BD8B'}} >经验值<span style={{"color":'#29BD8B'}}> {this.props.experience=== undefined?"0" :this.props.experience}/</span><span style={{"color":'#29BD8B'}}>{this.props.viewtrainingdata === undefined ? "" : this.props.viewtrainingdata.shixun_score}</span></span>
</div> </div>
{/*<Button type="primary" className="ml30" >实训报告</Button>*/} {/*<Button type="primary" className="ml30" >实训报告</Button>*/}
<Button type="primary" className="lh38 fr" style={{"text-align": "center","width": "100px",color: "#fff"}} href={`/courses/${this.props.coursesId}/shixun_homeworks/${this.props.viewtrainingdata.work_id}/shixun_work_report`}> <Button type="primary" className="lh38 fr" style={{"text-align": "center","width": "100px",color: "#fff"}} href={`/courses/${this.props.coursesId}/shixun_homeworks/${this.props.viewtrainingdata.work_id}/shixun_work_report`}>

@ -23,6 +23,7 @@ import {
notification notification
} from "antd"; } from "antd";
import {Link, Switch, Route, Redirect} from 'react-router-dom'; import {Link, Switch, Route, Redirect} from 'react-router-dom';
import moment from 'moment'
import axios from 'axios'; import axios from 'axios';
import '../css/members.css' import '../css/members.css'
import "../common/formCommon.css" import "../common/formCommon.css"

Loading…
Cancel
Save