From 7a2acb6676d503bdbf89d955d8a8b7027589b888 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Wed, 26 Jun 2019 14:04:22 +0800 Subject: [PATCH 1/2] b --- public/react/config/webpack.config.dev.js | 30 +++++++++---------- .../tasks/GraduationTasksSubmitedit.js | 2 +- .../modules/courses/members/teacherList.js | 3 +- .../shixunHomework/ShixunhomeWorkItem.js | 2 +- .../shixunHomework/Workquestionandanswer.js | 1 + 5 files changed, 20 insertions(+), 18 deletions(-) diff --git a/public/react/config/webpack.config.dev.js b/public/react/config/webpack.config.dev.js index ceddbd81b..dfd54f38b 100644 --- a/public/react/config/webpack.config.dev.js +++ b/public/react/config/webpack.config.dev.js @@ -114,21 +114,21 @@ module.exports = { // First, run the linter. // It's important to do this before Babel processes the JS. // 上线然后要注释回来 - // { - // test: /\.(js|jsx|mjs)$/, - // enforce: 'pre', - // use: [ - // { - // options: { - // formatter: eslintFormatter, - // eslintPath: require.resolve('eslint'), - // - // }, - // loader: require.resolve('eslint-loader'), - // }, - // ], - // include: paths.appSrc, - // }, + { + test: /\.(js|jsx|mjs)$/, + enforce: 'pre', + use: [ + { + options: { + formatter: eslintFormatter, + eslintPath: require.resolve('eslint'), + + }, + loader: require.resolve('eslint-loader'), + }, + ], + include: paths.appSrc, + }, { // "oneOf" will traverse all following loaders until one will // match the requirements. When no loader matches it will fall diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitedit.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitedit.js index 1ba465dfe..314aa5447 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitedit.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitedit.js @@ -2,7 +2,7 @@ import React,{Component} from "React"; import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal,Spin,Tooltip} from "antd"; import {Link} from 'react-router-dom'; import TPMMDEditor from '../../../tpm/challengesnew/TPMMDEditor'; -import { WordsBtn,getUrl ,bytesToSize} from 'educoder'; +import { WordsBtn,getUrl ,bytesToSize,getImageUrl} from 'educoder'; import axios from 'axios'; import Modals from '../../../modals/Modals'; const Search = Input.Search; diff --git a/public/react/src/modules/courses/members/teacherList.js b/public/react/src/modules/courses/members/teacherList.js index 19bb74d44..3c642e34f 100644 --- a/public/react/src/modules/courses/members/teacherList.js +++ b/public/react/src/modules/courses/members/teacherList.js @@ -7,7 +7,8 @@ import Titlesearchsection from '../common/titleSearch/TitleSearchSection' import ColorCountText from '../common/titleSearch/ColorCountText' 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 _ from 'lodash' diff --git a/public/react/src/modules/courses/shixunHomework/ShixunhomeWorkItem.js b/public/react/src/modules/courses/shixunHomework/ShixunhomeWorkItem.js index a21d6f977..013d6d5e4 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunhomeWorkItem.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunhomeWorkItem.js @@ -349,7 +349,7 @@ class ShixunhomeWorkItem extends Component{ {this.props.isAdmin?
实训详情 - {this.props.isClassManagement()?this.editname(discussMessage.name,discussMessage.homework_id)} className={"btn colorblue ml20 font-16"}>重命名:""} + {this.props.isClassManagement?this.editname(discussMessage.name,discussMessage.homework_id)} className={"btn colorblue ml20 font-16"}>重命名:""} 设置
:""} diff --git a/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js b/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js index 438babfea..35b9d7de7 100644 --- a/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js +++ b/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js @@ -23,6 +23,7 @@ import { notification } from "antd"; import {Link, Switch, Route, Redirect} from 'react-router-dom'; +import moment from 'moment' import axios from 'axios'; import '../css/members.css' import "../common/formCommon.css" From 3be31d7f7006d406261f8e3a349ea05554bbcb78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Wed, 26 Jun 2019 15:10:09 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/coursesPublic/Startshixuntask.js | 3 +- .../courses/shixunHomework/Listofworks.js | 14 ++++- .../shixunHomework/Listofworksstudentone.js | 61 +++++++++++++++---- .../TraineetraininginformationModal.js | 5 +- 4 files changed, 65 insertions(+), 18 deletions(-) diff --git a/public/react/src/modules/courses/coursesPublic/Startshixuntask.js b/public/react/src/modules/courses/coursesPublic/Startshixuntask.js index 9cf44c9a7..dfe56f945 100644 --- a/public/react/src/modules/courses/coursesPublic/Startshixuntask.js +++ b/public/react/src/modules/courses/coursesPublic/Startshixuntask.js @@ -46,7 +46,8 @@ class Startshixuntask extends Component{ }else{ 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 } } diff --git a/public/react/src/modules/courses/shixunHomework/Listofworks.js b/public/react/src/modules/courses/shixunHomework/Listofworks.js index 98ba43e55..23cb9c601 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworks.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworks.js @@ -93,6 +93,7 @@ class Listofworks extends Component { code_review: false, boolgalist:true, challenges_count:0, + experience:0, columns: [ { title: '序号', @@ -384,7 +385,7 @@ class Listofworks extends Component { // course_group:分班情况 [232, 231], []:不限(空数组) var data = { search: "", - order: "", + order: "desc", b_order: "asc", work_status: "", course_group: "", @@ -457,6 +458,11 @@ class Listofworks extends Component { task_status: result.data.task_status, course_group_info: result.data.course_group_info, 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, }) @@ -1361,6 +1367,7 @@ class Listofworks extends Component { let datalist = []; var game_list = result.data.game_list var boolgalist=true; + var experience=0; for (var i = 0; i < game_list.length; i++) { datalist.push({ @@ -1370,6 +1377,7 @@ class Listofworks extends Component { classroom: game_list[i].score, 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; @@ -1383,6 +1391,7 @@ class Listofworks extends Component { viewtrainingdata: result.data, visibles: true, game_list: datalist, + experience:experience, boolgalist:boolgalist, }) } @@ -1588,7 +1597,7 @@ class Listofworks extends Component { render() { // 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(course_group_info) @@ -1632,6 +1641,7 @@ class Listofworks extends Component { viewtrainingdata={viewtrainingdata} game_list={game_list} visible={visibles} + experience={experience} boolgalist={boolgalist} Cancel={() => this.cancelModulationModels()} /> diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js index d5dbaf06d..716a6f442 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js @@ -90,7 +90,7 @@ class Listofworksstudentone extends Component { var data = { search: "", order: "", - b_order: "asc", + b_order: "desc", page: 1, limit: 20, work_status: "", @@ -107,6 +107,9 @@ class Listofworksstudentone extends Component { publish_immediately: result.data.publish_immediately, end_immediately: result.data.end_immediately, 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) === "[]") { this.seacthdata(); @@ -154,6 +157,13 @@ class Listofworksstudentone extends Component { task_status: result.data.task_status, course_group_info: result.data.course_group_info, 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) === "[]") { this.seacthdata(); @@ -214,11 +224,15 @@ class Listofworksstudentone extends Component { // updatetime:this.state.teacherdata.student_works[i].update_time, // updatetime:"", 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, efficiencyscore: this.state.teacherdata.eff_score, finalscore: this.state.teacherdata.work_score, 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:"", 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, efficiencyscore: this.state.student_works[i].eff_score, finalscore: this.state.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, }) } @@ -310,11 +328,15 @@ class Listofworksstudentone extends Component { // updatetime:this.state.teacherdata.student_works[i].update_time, // updatetime:"", 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, efficiencyscore: this.state.teacherdata.eff_score, finalscore: this.state.teacherdata.work_score, 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)) let datalist = []; var game_list = result.data.game_list - + var boolgalist=true; + var experience=0; for (var i = 0; i < game_list.length; i++) { datalist.push({ @@ -371,7 +394,11 @@ class Listofworksstudentone extends Component { classroom: game_list[i].score, 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(datalist); @@ -379,7 +406,9 @@ class Listofworksstudentone extends Component { this.setState({ viewtrainingdata: result.data, visibles: true, - game_list: datalist + game_list: datalist, + experience:experience, + boolgalist:boolgalist, }) } }).catch((error) => { @@ -458,7 +487,13 @@ class Listofworksstudentone extends Component { task_status: result.data.task_status, course_group_info: result.data.course_group_info, 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(); } @@ -495,7 +530,7 @@ class Listofworksstudentone extends Component { } 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 = [ { title: '序号', @@ -639,10 +674,7 @@ class Listofworksstudentone extends Component { align: "center", render: (text, record) => ( - {record.completion === undefined ? "--" : record.completion === "" ? "--" : record.completion} + {record.completion+"/"+this.state.challenges_count} ), }, @@ -719,6 +751,8 @@ class Listofworksstudentone extends Component { viewtrainingdata={viewtrainingdata} game_list={game_list} visible={visibles} + experience={experience} + boolgalist={boolgalist} Cancel={() => this.cancelModulationModels()} /> @@ -851,6 +885,8 @@ class Listofworksstudentone extends Component { viewtrainingdata={viewtrainingdata} game_list={game_list} visible={visibles} + experience={experience} + boolgalist={boolgalist} Cancel={() => this.cancelModulationModels()} /> : "" } @@ -925,7 +961,6 @@ class Listofworksstudentone extends Component { pagination={false} loading={false} showHeader={false} - scroll={{y: 240}} />} {JSON.stringify(datas) !== "[]" ? diff --git a/public/react/src/modules/courses/shixunHomework/TraineetraininginformationModal.js b/public/react/src/modules/courses/shixunHomework/TraineetraininginformationModal.js index 9f82abcfe..61b066580 100644 --- a/public/react/src/modules/courses/shixunHomework/TraineetraininginformationModal.js +++ b/public/react/src/modules/courses/shixunHomework/TraineetraininginformationModal.js @@ -37,6 +37,7 @@ class TraineetraininginformationModal extends Component { userids: this.props.userids, game_list:this.props.game_list, boolgalist:this.props.boolgalist, + experience:this.props.experience, }) // console.log("TraineetraininginformationModal") @@ -60,7 +61,7 @@ class TraineetraininginformationModal extends Component { } render() { var columns; - if(this.props.boolgalist === true) { + if(this.props.boolgalis&&this.props.boolgalist === true) { columns = [ { title: '关卡', @@ -195,7 +196,7 @@ class TraineetraininginformationModal extends Component {
{this.props.viewtrainingdata === undefined ? "" : this.LimitNumber(this.props.viewtrainingdata.shixun_name)} - 经验值: {this.props.viewtrainingdata === undefined ? "" : this.props.viewtrainingdata.shixun_score} + 经验值: {this.props.experience=== undefined?"0" :this.props.experience}/{this.props.viewtrainingdata === undefined ? "" : this.props.viewtrainingdata.shixun_score}
{/**/}