diff --git a/public/react/src/modules/courses/poll/PollNew.js b/public/react/src/modules/courses/poll/PollNew.js index 39a16e8a6..a3513db40 100644 --- a/public/react/src/modules/courses/poll/PollNew.js +++ b/public/react/src/modules/courses/poll/PollNew.js @@ -9,7 +9,6 @@ import '../css/Courses.css' import axios from 'axios' import moment from "../new/CoursesNew"; import Modals from "../../modals/Modals"; -import Editingcomponent from "./components/Editingcomponent" const TextArea = Input.TextArea const RadioGroup = Radio.Group diff --git a/public/react/src/modules/courses/poll/components/Editingcomponent.js b/public/react/src/modules/courses/poll/components/Editingcomponent.js deleted file mode 100644 index 5a27a42e2..000000000 --- a/public/react/src/modules/courses/poll/components/Editingcomponent.js +++ /dev/null @@ -1,332 +0,0 @@ -import React, {Component} from "react"; -import '../pollStyle.css' -import {Input, Tooltip, Checkbox, Radio, Select} from 'antd' -import {WordsBtn, ActionBtn} from 'educoder' -const TextArea = Input.TextArea -const RadioGroup = Radio.Group -const CheckboxGroup = Checkbox.Group -class Editingcomponent extends Component { - - constructor(props) { - super(props); - this.state = { - adddom:this.props.adddom, - Newedit:this.props.Newedit, - } - } - componentWillReceiveProps(nextProps) { - const { adddom } = this.state - const newdata = nextProps.adddom.toString() - if (adddom.toString() !== newdata) { - this.setState({ - adddom: nextProps.adddom, - }) - } - } - // componentWillReceiveProps(nextProps) { - // // console.log("46"); - // // console.log(nextProps); - // // console.log(this.props); - // if (nextProps.adddom != this.props.adddom) { - // // console.log("50"); - // // console.log(nextProps.user); - // if (nextProps.adddom !== undefined) { - // // console.log("53"); - // // console.log(nextProps.user); - // this.setState({ - // adddom: nextProps.adddom, - // }) - // } - // - // - // } - // } - - OnCheckAllChange =(e, indexo)=>{ - this.props.OnCheckAllChange(e, indexo); - } - - HandleInputTopic = (e, indexo)=>{ - this.props.HandleInputTopic(e, indexo); - - } - - Deleteentrys=(id, i, stirngname)=>{ - this.props.Deleteentrys(id, i, stirngname); - } - - HandleInputChanges=(e, i, k)=>{ - console.log("handleInputChanges"+" "+e); - console.log("handleInputChanges"+" "+i); - console.log("handleInputChanges"+" "+k); - - this.props.HandleInputChanges(e, i, k); - } - - Ewoption = (id, object) => { - this.props.Ewoption(id, object) - } - - Addanotheroption = (id) => { - this.props.Addanotheroption(id); - } - Deleteadddom = (indexo) => { - this.props.Deleteadddom(indexo); - } - Deleteadddomthree= (indexo, object)=>{ - this.props.Deleteadddomthree(indexo, object); - } - Deleteadddomtwo =(indexo, object)=>{ - this.props.Deleteadddomtwo(indexo, object); - } - HandleGradationGroupChangee = (value, index, max, length) => { - this.props.HandleGradationGroupChangee(value, index, max, length); - } - HandleGradationGroupChangeee= (value, index) => { - this.props.HandleGradationGroupChangeee(value, index); - } - - render() { - return ( -
- {this.state.adddom === undefined ? "" : this.state.adddom.map((itemo, indexo) => { - let arrid = itemo.question.id; - let resultDomtwo; - resultDomtwo = -
- {itemo.question.question_type === 1 ? "单选题" : itemo.question.question_type === 2 ? "多选题" : "主观题"} - this.OnCheckAllChange(e, indexo)} - className="lineh-40" - style={{"marginLeft": "20px"}}>必答 - - - - - {itemo.question.answers === undefined ? "" : itemo.question.answers.map((itemt, indext) => { - return ( -
- {itemt.answer_text === undefined ? ( -
) : itemt.answer_text === "其他" ? ( -

- 其它 - - - {this.state.polls_status === undefined || this.state.polls_status === 1 ? - this.Deleteentrys(arrid, indext, true)}> - : ""} -

) : (

- 选项 - - - {this.state.polls_status === undefined || this.state.polls_status === 1 ? - this.Deleteentrys(arrid, indext, false)}> - : ""} -

)} -
- ) - })} - -
- {itemo.question.question_type === 1 ? ( -
-
- {this.state.polls_status === undefined || this.state.polls_status === 1 ? - this.Ewoption(itemo.question.id, itemo)}>新增选项 - - : ""} - {this.state.polls_status === undefined || this.state.polls_status === 1 ? - - (this.state.newoption === false ? - this.Addanotheroption(itemo.question.id)}>新增其他选项 - : "") - : ""} - - this.Deleteadddom(indexo)}>取消 - this.Deleteadddomthree(indexo, itemo)}>保存 - this.Deleteadddomtwo(indexo, itemo)}>保存并继续 - -
-
- - - ) - - - : itemo.question.question_type === 2 ? ( - //////////////////////////////////////////// 可选 -
-
-
- 可选 -
- {/*可选最小*/} - - - ~ - {/*可选最大*/} - - - (学生答题时,系统对其选择的选项个数进行限制,--表示不限制) -
- -
-
-
- ) - - : (
) - - } -
-
- {itemo.question.question_type === 2 ? - ( - this.state.polls_status === undefined || this.state.polls_status === 1 ? -
- -
this.Ewoption(itemo.question.id, itemo)}>新增选项 - - { - this.state.newoption === false ? this.Addanotheroption(itemo.question.id)}>新增其他选项 : "" - } - -
- - - - this.Deleteadddom(indexo)}>取消 - this.Deleteadddomthree(indexo, itemo)}>保存 - this.Deleteadddomtwo(indexo, itemo)}>保存并继续 - -
- - - : -
- - this.Deleteadddom(indexo)}>取消 - this.Deleteadddomthree(indexo, itemo)}>保存 - this.Deleteadddomtwo(indexo, itemo)}>保存并继续 - -
- ) - - : itemo.question.question_type === 3 ? -
- - this.Deleteadddom(indexo)}>取消 - this.Deleteadddomthree(indexo, itemo)}>保存 - this.Deleteadddomtwo(indexo, itemo)}>保存并继续 - -
- : - ""} - - -
-
- - - return ( -
- {resultDomtwo} -
- ) - })} -
- ) - - } -} -export default (Editingcomponent);