dev_forum
杨树林 6 years ago
parent 99dfd46d34
commit 3deae54e9a

@ -656,7 +656,7 @@ class PollNew extends Component {
"question_title": "", "question_title": "",
"question_type": 1, "question_type": 1,
"new": "new", "new": "new",
"newid":Whether=== true? id :this.state.poll_questions[newarr.length - 1].question.id + 1, "newid":Whether=== true? id :ids+ 1,
"answers": [ "answers": [
{"answer_id": 1, "answer_position": 1, "answer_text": ""}, {"answer_id": 1, "answer_position": 1, "answer_text": ""},
{"answer_id": 2, "answer_position": 2, "answer_text": ""}, {"answer_id": 2, "answer_position": 2, "answer_text": ""},
@ -691,7 +691,7 @@ class PollNew extends Component {
"max_choices": 0, "max_choices": 0,
"min_choices": 0, "min_choices": 0,
"new": "new", "new": "new",
"newid":Whether=== true? id :this.state.poll_questions[newarr.length - 1].question.id + 1, "newid":Whether=== true? id :ids+1,
"answers": [ "answers": [
{"answer_id": 1, "answer_position": 1, "answer_text": ""}, {"answer_id": 1, "answer_position": 1, "answer_text": ""},
{"answer_id": 2, "answer_position": 2, "answer_text": ""}, {"answer_id": 2, "answer_position": 2, "answer_text": ""},
@ -724,7 +724,7 @@ class PollNew extends Component {
"question_title": "", "question_title": "",
"question_type": 3, "question_type": 3,
"new": "new", "new": "new",
"newid":Whether=== true? id :this.state.poll_questions[newarr.length - 1].question.id + 1, "newid":Whether=== true? id :ids + 1,
"answers": [] "answers": []
}; };
question = {"question": questiontwo}; question = {"question": questiontwo};

@ -597,7 +597,6 @@ class Listofworks extends Component {
componentDidMount() { componentDidMount() {
console.log("Listofworks"); console.log("Listofworks");
console.log("componentDidMount"); console.log("componentDidMount");
this.props.onRef(this)
var homeworkid = this.props.match.params.homeworkid; var homeworkid = this.props.match.params.homeworkid;
// console.log(homeworkid) // console.log(homeworkid)
// this.Gettitleinformation(homeworkid); // this.Gettitleinformation(homeworkid);

@ -18,9 +18,12 @@ import Workquestionandanswer from './Workquestionandanswer';
import CoursesListType from '../coursesPublic/CoursesListType'; import CoursesListType from '../coursesPublic/CoursesListType';
import ShixunStudentWork from "./ShixunStudentWork"; import ShixunStudentWork from "./ShixunStudentWork";
import Startshixuntask from "../coursesPublic/Startshixuntask"; import Startshixuntask from "../coursesPublic/Startshixuntask";
import TPMMDEditor from "../../tpm/challengesnew/TPMMDEditor";
class ShixunHomeworkPage extends Component { class ShixunHomeworkPage extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.contentMdRef = React.createRef();
// this.answerMdRef = React.createRef();
this.state = { this.state = {
tab: ["0"], tab: ["0"],
jobsettingsdata: undefined, jobsettingsdata: undefined,
@ -84,15 +87,16 @@ class ShixunHomeworkPage extends Component {
console.log("84"); console.log("84");
console.log(ref); console.log(ref);
this.child = ref this.child = ref
} }
homeworkendss(){ homeworkendss(){
this.child.homeworkends(); this.contentMdRef.current.homeworkends();
} }
homeworkstarts(){ homeworkstarts(){
this.child.homeworkstart(); this.contentMdRef.current.homeworkstart();
} }
workshowmodels(){ workshowmodels(){
this.child.workshowmodel(); this.contentMdRef.current.workshowmodel();
} }
///////////////教师截止 ///////////////教师截止
@ -235,21 +239,21 @@ class ShixunHomeworkPage extends Component {
{ {
// 教师列表 // 教师列表
parseInt(tab) === 0 ? (isAdmin === true ? parseInt(tab) === 0 ? (isAdmin === true ?
<Listofworks {...this.props} {...this.state} onRef={this.onRef} <Listofworks {...this.props} {...this.state} ref={this.contentMdRef}
Getdataback={(jobsettingsdata, teacherdata) => this.Getdataback(jobsettingsdata, teacherdata)}></Listofworks> Getdataback={(jobsettingsdata, teacherdata) => this.Getdataback(jobsettingsdata, teacherdata)}></Listofworks>
: :
<Listofworksstudentone {...this.props} {...this.state} onRef={this.onRef} <Listofworksstudentone ref={this.contentMdRef} {...this.props} {...this.state} onRef={(ref)=>{ this.child = ref}}
Getdataback={(jobsettingsdata, teacherdata) => this.Getdataback(jobsettingsdata, teacherdata)}></Listofworksstudentone>) Getdataback={(jobsettingsdata, teacherdata) => this.Getdataback(jobsettingsdata, teacherdata)}></Listofworksstudentone>)
: :
parseInt(tab) === 1 ? parseInt(tab) === 1 ?
<Workquestionandanswer {...this.props} {...this.state} onRef={this.onRef} <Workquestionandanswer ref={this.contentMdRef} {...this.props} {...this.state} onRef={(ref)=>{ this.child = ref}}
Getdataback={(jobsettingsdata, teacherdata) => this.Getdataback(jobsettingsdata, teacherdata)}></Workquestionandanswer> Getdataback={(jobsettingsdata, teacherdata) => this.Getdataback(jobsettingsdata, teacherdata)}></Workquestionandanswer>
: :
parseInt(tab) === 2 ? parseInt(tab) === 2 ?
<ShixunStudentWork {...this.props} {...this.state} onRef={this.onRef} <ShixunStudentWork ref={this.contentMdRef} {...this.props} {...this.state} onRef={(ref)=>{ this.child = ref}}
Getdataback={(jobsettingsdata, teacherdata) => this.Getdataback(jobsettingsdata, teacherdata)}></ShixunStudentWork> Getdataback={(jobsettingsdata, teacherdata) => this.Getdataback(jobsettingsdata, teacherdata)}></ShixunStudentWork>
: :
<Trainingjobsetting {...this.props} {...this.state} onRef={this.onRef} <Trainingjobsetting ref={this.contentMdRef} {...this.props} {...this.state} onRef={(ref)=>{ this.child = ref}}
Getdataback={(jobsettingsdata, teacherdata) => this.Getdataback(jobsettingsdata, teacherdata)}></Trainingjobsetting> Getdataback={(jobsettingsdata, teacherdata) => this.Getdataback(jobsettingsdata, teacherdata)}></Trainingjobsetting>
} }
</div> </div>

Loading…
Cancel
Save