From c216bdf27a7f66e7637331199e0c16062d4daa14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Tue, 16 Jul 2019 14:43:00 +0800 Subject: [PATCH 1/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 --- .../exercise/Testpapersettinghomepage.js | 17 +++++++++++------ .../courses/shixunHomework/Listofworks.js | 7 ------- .../courses/shixunHomework/ShixunStudentWork.js | 7 ------- .../courses/shixunHomework/ShixunWorkReport.js | 6 ------ .../shixunHomework/Trainingjobsetting.js | 7 +------ .../shixunHomework/Workquestionandanswer.js | 6 ------ .../react/src/modules/modals/DownloadMessage.js | 8 +++++++- 7 files changed, 19 insertions(+), 39 deletions(-) diff --git a/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js b/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js index 26f7718ce..81d5a6a27 100644 --- a/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js +++ b/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js @@ -169,12 +169,17 @@ class Testpapersettinghomepage extends Component{ Loadtype:false }) } - + DownloadType=()=>{ + this.setState({ + DownloadType:false, + DownloadMessageval:undefined + }) + } Downloadcal=()=>{ - this.setState({ - DownloadType:false, - DownloadMessageval:undefined - }) + this.setState({ + DownloadType:false, + DownloadMessageval:undefined + }) } render(){ let {tab,visible,Commonheadofthetestpaper}=this.state; @@ -187,7 +192,7 @@ class Testpapersettinghomepage extends Component{ {...this.props} value={this.state.DownloadMessageval} modalCancel={this.Downloadcal} - modalsType={this.state.DownloadType} + modalsType={this.DownloadType} />
{/* 公用的提示弹框 */} diff --git a/public/react/src/modules/courses/shixunHomework/Listofworks.js b/public/react/src/modules/courses/shixunHomework/Listofworks.js index d92848219..cf8a087ec 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworks.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworks.js @@ -1360,13 +1360,6 @@ class Listofworks extends Component { // }); } - Downloadcal=()=>{ - this.setState({ - DownloadType:false, - DownloadMessageval:undefined - }) - } - ChangeTab=(e)=>{ this.props.ChangeTab(e); } diff --git a/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js b/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js index 3a2ebccd5..17e51258f 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js @@ -501,13 +501,6 @@ class ShixunStudentWork extends Component { // console.log(error) // }); } - - Downloadcal=()=>{ - this.setState({ - DownloadType:false, - DownloadMessageval:undefined - }) - } ChangeTab=(e)=>{ this.props.ChangeTab(e); } diff --git a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js index 03630725d..b19821e53 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js @@ -94,12 +94,6 @@ class ShixunWorkReport extends Component { } } } - Downloadcal=()=>{ - this.setState({ - DownloadType:false, - DownloadMessageval:undefined - }) - } render() { let{data} =this.state; let category_id=data===undefined?"":data.category.category_id; diff --git a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js index 2bfe2091e..ae1058d8a 100644 --- a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js +++ b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js @@ -1714,12 +1714,7 @@ class Trainingjobsetting extends Component { // }); } - Downloadcal=()=>{ - this.setState({ - DownloadType:false, - DownloadMessageval:undefined - }) - } + testscripttip =(e)=>{ if(e === 0){ this.setState({ diff --git a/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js b/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js index 01c3088f4..52a214b7e 100644 --- a/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js +++ b/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js @@ -344,12 +344,6 @@ class Workquestionandanswer extends Component { // console.log(error) // }); } - Downloadcal=()=>{ - this.setState({ - DownloadType:false, - DownloadMessageval:undefined - }) - } ChangeTab=(e)=>{ this.props.ChangeTab(e); } diff --git a/public/react/src/modules/modals/DownloadMessage.js b/public/react/src/modules/modals/DownloadMessage.js index e1b217151..d14fccb1e 100644 --- a/public/react/src/modules/modals/DownloadMessage.js +++ b/public/react/src/modules/modals/DownloadMessage.js @@ -19,7 +19,13 @@ class DownloadMessage extends Component { this.modalCancel(); window.open(`/users/${this.props.user.login}/private_messages`) } - + + DownloadType=()=>{ + this.setState({ + DownloadType:false, + DownloadMessageval:undefined + }) + } Downloadcal=()=>{ this.setState({ DownloadType:false, From aea230c45ad1fba50ba46962312c519c896420e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Tue, 16 Jul 2019 14:52:23 +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 --- public/react/config/webpack.config.dev.js | 2 +- .../coursesPublic/modal/ShixunModal2.js | 50 ++--- .../exercise/Exercisestatisticalresult.js | 13 +- .../courses/shixunHomework/Listofworks.js | 4 +- .../shixunHomework/ShixunHomeworkPage.js | 193 +++++++++++++++++- .../tpm/challengesnew/TPMchallengesnew.js | 27 ++- 6 files changed, 250 insertions(+), 39 deletions(-) diff --git a/public/react/config/webpack.config.dev.js b/public/react/config/webpack.config.dev.js index 11cfc1962..80973be75 100644 --- a/public/react/config/webpack.config.dev.js +++ b/public/react/config/webpack.config.dev.js @@ -29,7 +29,7 @@ const env = getClientEnvironment(publicUrl); module.exports = { // You may want 'eval' instead if you prefer to see the compiled output in DevTools. // See the discussion in https://github.com/facebookincubator/create-react-app/issues/343.s - // devtool: "source-map", // 开启调试 + devtool: "source-map", // 开启调试 // These are the "entry points" to our application. // This means they will be the "root" imports that are included in JS bundle. // The first two entry points enable "hot" CSS and auto-refreshes for JS. diff --git a/public/react/src/modules/courses/coursesPublic/modal/ShixunModal2.js b/public/react/src/modules/courses/coursesPublic/modal/ShixunModal2.js index 9148845e9..127abf5cf 100644 --- a/public/react/src/modules/courses/coursesPublic/modal/ShixunModal2.js +++ b/public/react/src/modules/courses/coursesPublic/modal/ShixunModal2.js @@ -248,11 +248,11 @@ class ShixunModal extends Component{ } @@ -271,6 +271,10 @@ class ShixunModal extends Component{ margin-top:0px !important; height: 40px; } + .with11{ + width: 11%; + box-sizing: border-box; + } ` } @@ -279,24 +283,24 @@ class ShixunModal extends Component{ { newshixunmodallist === undefined ? "": newshixunmodallist.map((item,key)=>{ return( -
-
  • - - {item.shixun_name} - -
  • -
  • {item.school_users}
  • -
  • {item.myshixuns_count}
  • -
  • {item.preference}
  • - -
  • 详情
  • -
    -
    +
    +
  • + + {item.shixun_name} + +
  • +
  • {item.school}
  • +
  • {item.myshixuns_count}
  • +
  • {item.level}
  • + +
  • 详情
  • +
    +
    ) }) } diff --git a/public/react/src/modules/courses/exercise/Exercisestatisticalresult.js b/public/react/src/modules/courses/exercise/Exercisestatisticalresult.js index f2098feb0..6a7f1c505 100644 --- a/public/react/src/modules/courses/exercise/Exercisestatisticalresult.js +++ b/public/react/src/modules/courses/exercise/Exercisestatisticalresult.js @@ -172,7 +172,9 @@ class Exercisestatisticalresult extends Component { .bor-greyE{ border: 1px solid #EEEEEE!important; } - + .padtop24{ + padding-top: 24px; + } `} @@ -191,7 +193,7 @@ class Exercisestatisticalresult extends Component { {/**/}
    -
    正确率 {item.right_percent}%
    +
    正确率 {item.right_percent}%
    {item.ques_type===5? @@ -199,9 +201,10 @@ class Exercisestatisticalresult extends Component { return(
    -
    - {ite.challenge_position}:{ite.challenge_name} +
    + {ite.challenge_position}:{ite.challenge_name}
    +
    正确率{ite.challenge_percent}%
    diff --git a/public/react/src/modules/courses/shixunHomework/Listofworks.js b/public/react/src/modules/courses/shixunHomework/Listofworks.js index d92848219..c089c43d2 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworks.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworks.js @@ -1376,7 +1376,7 @@ class Listofworks extends Component { let {columns,computeTimetype, 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) + // console.log(this.props.teacherdata&&this.props.teacherdata.publish_immediately) // console.log(JSON.stringify(this.props)); return (
    @@ -1512,7 +1512,7 @@ class Listofworks extends Component {
  • 计算成绩时间:{teacherdata&&teacherdata.calculation_time==null?"--": moment(teacherdata&&teacherdata.calculation_time).format('YYYY-MM-DD HH:mm')} - {computeTimetype===true?
    + {this.props.teacherdata&&this.props.teacherdata.publish_immediately===false&&computeTimetype===true?
    计算成绩
    :
    计算成绩 diff --git a/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js b/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js index 029d99c27..45ce28e0e 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js @@ -2,19 +2,24 @@ import React, {Component} from "react"; import {Link, NavLink} from 'react-router-dom'; import {WordsBtn, ActionBtn} from 'educoder'; import axios from 'axios'; +import { + notification +} 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 '../css/busyWork.css'; +import '../poll/pollStyle.css'; import Listofworks from "./Listofworks"; -import Listofworksstudentone from './Listofworksstudentone' -import Trainingjobsetting from './Trainingjobsetting' -import Workquestionandanswer from './Workquestionandanswer' +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 HomeworkModal from "../coursesPublic/HomeworkModal"; +import moment from 'moment'; class ShixunHomeworkPage extends Component { constructor(props) { @@ -71,12 +76,190 @@ class ShixunHomeworkPage extends Component { shixuntypes: types[3] }) } + //立即发布 + homeworkstart = () => { + debugger + let homeworkid = this.props.match.params.homeworkid; + let url = "/homework_commons/" + homeworkid + "/publish_groups.json"; + + + axios.get(url).then((response) => { + + if (response.status === 200) { + let starttime = this.props.getNowFormatDates(1); + let endtime = this.props.getNowFormatDates(2); + this.setState({ + modalname: "立即发布", + modaltype: response.data.course_groups === null || response.data.course_groups.length === 0 ? 2 : 1, + svisible: true, + Topval:"学生将立即收到作业", + // Botvalleft:"暂不发布", + Botval:`本操作只对"未发布"的分班有效`, + starttime: "发布时间:" + moment(moment(new Date())).format("YYYY-MM-DD HH:mm"), + endtime: "截止时间:" + endtime, + starttimes:starttime, + typs:"start", + Cancelname: "暂不发布", + Savesname: "立即发布", + Cancel: this.homeworkhide, + Saves: this.homeworkstartend, + course_groups: response.data.course_groups, + }) + } + }).catch((error) => { + console.log(error) + }); + + } + + getcourse_groupslist = (id) => { + this.setState({ + course_groupslist: id + }) + + } + + isupdatas = () => { + // var homeworkid = this.props.match.params.homeworkid; + // // this.Gettitleinformation(homeworkid); + // this.Getalistofworks(homeworkid); + } + + homeworkhide = () => { + this.isupdatas() + this.setState({ + modalname: undefined, + modaltype: undefined, + svisible: false, + Topval: undefined, + Topvalright: undefined, + Botvalleft: undefined, + Botval: undefined, + starttime: undefined, + endtime: undefined, + Cancelname: undefined, + Savesname: undefined, + Cancel: undefined, + Saves: undefined, + StudentList_value: undefined, + addname: undefined, + addnametype: false, + addnametab: undefined, + course_groupyslstwo: undefined, + typs:undefined, + starttimes:undefined, + }) + } +// 立即发布 + homeworkstartend = (ds,endtime) => { + var homeworkid = this.props.match.params.homeworkid; + let {course_groupslist} = this.state; + + let coursesId = this.props.match.params.coursesId; + let url = "/courses/" + coursesId + "/homework_commons/publish_homework.json"; + axios.post(url, { + homework_ids: [homeworkid], + group_ids: course_groupslist, + end_time:endtime, + }).then((result) => { + if (result.status === 200) { + if (result.data.status === 0) { + notification.open({ + message: "提示", + description: result.data.message + }); + this.homeworkhide() + } + + } + }).catch((error) => { + console.log(error); + }) + } + + + //立即截止 + homeworkends = () => { + let homeworkid = this.props.match.params.homeworkid; + let url = "/homework_commons/" + homeworkid + "/end_groups.json"; + + axios.get(url).then((response) => { + + if (response.status === 200) { + this.setState({}) + this.setState({ + modalname: "立即截止", + modaltype: response.data.course_groups === null || response.data.course_groups.length === 0 ? 2 : 1, + svisible: true, + Topval:"学生将不能再提交作业", + // Botvalleft:"暂不截止", + Botval:`本操作只对"提交中"的分班有效`, + Cancelname: "暂不截止", + Savesname: "立即截止", + Cancel: this.homeworkhide, + Saves: this.coursetaskend, + starttime: undefined, + endtime: undefined, + course_groups: response.data.course_groups, + typs:"end", + }) + } + }).catch((error) => { + console.log(error) + }); + } + + //立即截止确定按钮 + coursetaskend = () => { + var homeworkid = this.props.match.params.homeworkid; + let {course_groupslist} = this.state; + + + const cid = this.props.match.params.coursesId; + let url = "/courses/" + cid + "/homework_commons/end_homework.json"; + axios.post(url, { + group_ids: course_groupslist, + homework_ids: [homeworkid], + }) + .then((response) => { + if (response.data.status == 0) { + notification.open({ + message: "提示", + description: response.data.message + }); + this.homeworkhide() + } + }) + .catch(function (error) { + console.log(error); + }); + } render() { let {tab, jobsettingsdata, teacherdata} = this.state; const isAdmin = this.props.isAdmin(); return (
    + {/*立即发布*/} + this.getcourse_groupslist(id)} + starttimes={this.state.starttimes} + typs={this.state.typs} + />
    diff --git a/public/react/src/modules/tpm/challengesnew/TPMchallengesnew.js b/public/react/src/modules/tpm/challengesnew/TPMchallengesnew.js index a50f00dd4..b498d441f 100644 --- a/public/react/src/modules/tpm/challengesnew/TPMchallengesnew.js +++ b/public/react/src/modules/tpm/challengesnew/TPMchallengesnew.js @@ -58,7 +58,8 @@ export default class TPMchallengesnew extends Component { marktype:false, editPracticesendtype:false, CreatePracticesendtype:false, - exec_time:20 + exec_time:20, + shixunExec_timeType:false } } @@ -212,6 +213,13 @@ export default class TPMchallengesnew extends Component { this.props.showSnackbar("技能标签为空") return } + if(exec_time===null||exec_time===undefined||exec_time===""){ + + this.setState({ + shixunExec_timeType:false + }) + return + } const exercise_editormdvalue = this.exercisememoMDRef.current.getValue().trim(); let id = this.props.match.params.shixunId; @@ -329,6 +337,14 @@ export default class TPMchallengesnew extends Component { }) return } + + if(exec_time===null||exec_time===undefined||exec_time===""){ +debugger + this.setState({ + shixunExec_timeType:false + }) + return + } axios.put(url, { tab:0, identifier:id, @@ -394,6 +410,8 @@ export default class TPMchallengesnew extends Component { ) }) + console.log(this.state.shixunExec_timeType ) + return (
    @@ -459,7 +477,7 @@ export default class TPMchallengesnew extends Component { placeholder="请输入任务名称(此信息将提前展示给学员),例:计算学生的课程成绩绩点"/>
    - 必填项 @@ -572,11 +590,14 @@ export default class TPMchallengesnew extends Component {

    服务配置

    - * + *
    + 必填项