From 3deae54e9ac8dc8ea259a2f5f64be99d2d15279b 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, 17 Jul 2019 10:12:19 +0800
Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../react/src/modules/courses/poll/PollNew.js | 6 +++---
.../courses/shixunHomework/Listofworks.js | 1 -
.../shixunHomework/ShixunHomeworkPage.js | 20 +++++++++++--------
3 files changed, 15 insertions(+), 12 deletions(-)
diff --git a/public/react/src/modules/courses/poll/PollNew.js b/public/react/src/modules/courses/poll/PollNew.js
index de0a5bbeb..e6dc94515 100644
--- a/public/react/src/modules/courses/poll/PollNew.js
+++ b/public/react/src/modules/courses/poll/PollNew.js
@@ -656,7 +656,7 @@ class PollNew extends Component {
"question_title": "",
"question_type": 1,
"new": "new",
- "newid":Whether=== true? id :this.state.poll_questions[newarr.length - 1].question.id + 1,
+ "newid":Whether=== true? id :ids+ 1,
"answers": [
{"answer_id": 1, "answer_position": 1, "answer_text": ""},
{"answer_id": 2, "answer_position": 2, "answer_text": ""},
@@ -691,7 +691,7 @@ class PollNew extends Component {
"max_choices": 0,
"min_choices": 0,
"new": "new",
- "newid":Whether=== true? id :this.state.poll_questions[newarr.length - 1].question.id + 1,
+ "newid":Whether=== true? id :ids+1,
"answers": [
{"answer_id": 1, "answer_position": 1, "answer_text": ""},
{"answer_id": 2, "answer_position": 2, "answer_text": ""},
@@ -724,7 +724,7 @@ class PollNew extends Component {
"question_title": "",
"question_type": 3,
"new": "new",
- "newid":Whether=== true? id :this.state.poll_questions[newarr.length - 1].question.id + 1,
+ "newid":Whether=== true? id :ids + 1,
"answers": []
};
question = {"question": questiontwo};
diff --git a/public/react/src/modules/courses/shixunHomework/Listofworks.js b/public/react/src/modules/courses/shixunHomework/Listofworks.js
index 1e01b5d6d..584798247 100644
--- a/public/react/src/modules/courses/shixunHomework/Listofworks.js
+++ b/public/react/src/modules/courses/shixunHomework/Listofworks.js
@@ -597,7 +597,6 @@ class Listofworks extends Component {
componentDidMount() {
console.log("Listofworks");
console.log("componentDidMount");
- this.props.onRef(this)
var homeworkid = this.props.match.params.homeworkid;
// console.log(homeworkid)
// this.Gettitleinformation(homeworkid);
diff --git a/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js b/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js
index 2ee8bd7a8..4cd0572a8 100644
--- a/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js
+++ b/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js
@@ -18,9 +18,12 @@ import Workquestionandanswer from './Workquestionandanswer';
import CoursesListType from '../coursesPublic/CoursesListType';
import ShixunStudentWork from "./ShixunStudentWork";
import Startshixuntask from "../coursesPublic/Startshixuntask";
+import TPMMDEditor from "../../tpm/challengesnew/TPMMDEditor";
class ShixunHomeworkPage extends Component {
constructor(props) {
super(props);
+ this.contentMdRef = React.createRef();
+ // this.answerMdRef = React.createRef();
this.state = {
tab: ["0"],
jobsettingsdata: undefined,
@@ -84,15 +87,16 @@ class ShixunHomeworkPage extends Component {
console.log("84");
console.log(ref);
this.child = ref
+
}
homeworkendss(){
- this.child.homeworkends();
+ this.contentMdRef.current.homeworkends();
}
homeworkstarts(){
- this.child.homeworkstart();
+ this.contentMdRef.current.homeworkstart();
}
workshowmodels(){
- this.child.workshowmodel();
+ this.contentMdRef.current.workshowmodel();
}
///////////////教师截止
@@ -235,21 +239,21 @@ class ShixunHomeworkPage extends Component {
{
// 教师列表
parseInt(tab) === 0 ? (isAdmin === true ?
- this.Getdataback(jobsettingsdata, teacherdata)}>
:
- { this.child = ref}}
Getdataback={(jobsettingsdata, teacherdata) => this.Getdataback(jobsettingsdata, teacherdata)}>)
:
parseInt(tab) === 1 ?
- { this.child = ref}}
Getdataback={(jobsettingsdata, teacherdata) => this.Getdataback(jobsettingsdata, teacherdata)}>
:
parseInt(tab) === 2 ?
- { this.child = ref}}
Getdataback={(jobsettingsdata, teacherdata) => this.Getdataback(jobsettingsdata, teacherdata)}>
:
- { this.child = ref}}
Getdataback={(jobsettingsdata, teacherdata) => this.Getdataback(jobsettingsdata, teacherdata)}>
}