+ {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 {