From cfb7fc728015dc0f475192fbaca798e91a7ceb6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Fri, 30 Aug 2019 15:45:19 +0800 Subject: [PATCH 01/22] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../groupjobbank/Groupjobquesanswer.js | 8 +- .../react/src/modules/courses/poll/PollNew.js | 30 ++- .../modules/courses/poll/PollNewQuestbank.js | 220 ++++++++++-------- 3 files changed, 153 insertions(+), 105 deletions(-) diff --git a/public/react/src/modules/courses/groupjobbank/Groupjobquesanswer.js b/public/react/src/modules/courses/groupjobbank/Groupjobquesanswer.js index f0b2be9cd..374aca841 100644 --- a/public/react/src/modules/courses/groupjobbank/Groupjobquesanswer.js +++ b/public/react/src/modules/courses/groupjobbank/Groupjobquesanswer.js @@ -10,6 +10,7 @@ import { Tooltip, notification, } from "antd"; +import AttachmentsList from '../..' import GroupPackage from './GroupPackage'; import GroupPackage2 from './GroupPackage2'; import './questionbanks.css'; @@ -63,11 +64,8 @@ class Groupjobquesanswer extends Component {
- {datas.attachments === undefined ? "" : datas.attachments.map((item, key) => { - return ( - - ) - })} + {datas.attachments === undefined ? "" : } +
diff --git a/public/react/src/modules/courses/poll/PollNew.js b/public/react/src/modules/courses/poll/PollNew.js index 171a27c5e..e269cd8e9 100644 --- a/public/react/src/modules/courses/poll/PollNew.js +++ b/public/react/src/modules/courses/poll/PollNew.js @@ -280,9 +280,13 @@ class PollNew extends Component { questionnair: true, left_banner_id:result.data.left_banner_id }) - // console.log(this.state.polls_nametest) - // console.log(this.state.polls_descriptiontest) - // } + if( result.data.poll.polls_name){ + if( result.data.poll.polls_name.length>0){ + this.setState({ + addonAfter: result.data.poll.polls_name.length, + }) + } + } }).catch((error) => { console.log(error) }) @@ -326,7 +330,13 @@ class PollNew extends Component { polls_descriptiontest: result.data.poll.polls_description, questionnair: true, }) - + if( result.data.poll.polls_name){ + if( result.data.poll.polls_name.length>0){ + this.setState({ + addonAfter: result.data.poll.polls_name.length, + }) + } + } // } }).catch((error) => { console.log(error) @@ -2454,8 +2464,9 @@ class PollNew extends Component { // console.log(this.state.projects===undefined?"":this.state.projects.poll_questions) var displaymysave = (mysave === true) ? "" : "display:none;"; + return ( -
+
{/*提示*/} {Modalstype && Modalstype === true ? : ""} -
+ +

this.gotohome()}>{this.props.coursedata.name} > diff --git a/public/react/src/modules/courses/poll/PollNewQuestbank.js b/public/react/src/modules/courses/poll/PollNewQuestbank.js index de9d461dc..0f5d56677 100644 --- a/public/react/src/modules/courses/poll/PollNewQuestbank.js +++ b/public/react/src/modules/courses/poll/PollNewQuestbank.js @@ -243,39 +243,51 @@ class PollNewQuestbank extends Component { } else { const url = `/exercise_banks/${pollid}.json`; axios.get(url).then((result) => { - if (result) - console.log("247"); - console.log(result); - - // if(result.data){ - // if(result.data.poll){ - // if(result.data.poll.polls_name){ - // let num = parseInt(result.data.poll.polls_name.length); - // this.setState({ - // addonAfter: num < 0 ? 0 : num - // }) - // } - // } - // - // } - // - // this.setState({ - // projects: result.data, - // pollid: pollid, - // polls_status: result.data.poll.polls_status, - // polls_name: result.data.poll.polls_name, - // polls_description: result.data.poll.polls_description, - // poll_questions: result.data.poll_questions, - // question_types: result.data.question_types, - // mysingles: result.data.question_types.q_singles, - // mydoubles: result.data.question_types.q_doubles, - // mymainsint: result.data.question_types.q_mains, - // polls_nametest: result.data.poll.polls_name, - // polls_descriptiontest: result.data.poll.polls_description, - // questionnair: true, - // left_banner_id:result.data.left_banner_id - // }) + if (result){ + console.log("247"); + console.log(result); + + + } + + + if(result.data){ + if(result.data.poll){ + if(result.data.poll.polls_name){ + let num = parseInt(result.data.poll.polls_name.length); + this.setState({ + addonAfter: num < 0 ? 0 : num + }) + } + } + + } + + this.setState({ + projects: result.data, + pollid: pollid, + polls_status: 1, + polls_name: result.data.poll.name, + polls_description: result.data.poll.description, + poll_questions: result.data.questions, + question_types: result.data.question_types, + mysingles: result.data.question_types.q_singles, + mydoubles: result.data.question_types.q_doubles, + mymainsint: result.data.question_types.q_mains, + q_counts: result.data.question_types.q_counts, + polls_nametest: result.data.poll.name, + polls_descriptiontest: result.data.poll.description, + questionnair: true, + left_banner_id:result.data.left_banner_id + }) + if(result.data.poll.name){ + if(result.data.poll.name.length>0){ + this.setState({ + addonAfter:result.data.poll.name.length, + }) + } + } }).catch((error) => { console.log(error) }) @@ -300,26 +312,40 @@ class PollNewQuestbank extends Component { const url = `/exercise_banks/${pollidsy}.json`; axios.get(url).then((result) => { if (result !== undefined){ + this.setState({ + projects: result.data, + pollid: pollid, + polls_status: 1, + polls_name: result.data.poll.name, + polls_description: result.data.poll.description, + poll_questions: result.data.questions, + question_types: result.data.question_types, + mysingles: result.data.question_types.q_singles, + mydoubles: result.data.question_types.q_doubles, + mymainsint: result.data.question_types.q_mains, + q_counts: result.data.question_types.q_counts, + polls_nametest: result.data.poll.name, + polls_descriptiontest: result.data.poll.description, + questionnair: true, + left_banner_id:result.data.left_banner_id + }); + + + + + if(result.data.poll.name){ + if(result.data.poll.name.length>0){ + this.setState({ + addonAfter:result.data.poll.name.length, + }) + } + } } // console.log("有问卷~~~") - // this.setState({ - // projects: result.data, - // pollid: pollidsy, - // polls_status: result.data.poll.polls_status, - // polls_name: result.data.poll.polls_name, - // polls_description: result.data.poll.polls_description, - // poll_questions: result.data.poll_questions, - // question_types: result.data.question_types, - // mysingles: result.data.question_types.q_singles, - // mydoubles: result.data.question_types.q_doubles, - // mymainsint: result.data.question_types.q_mains, - // polls_nametest: result.data.poll.polls_name, - // polls_descriptiontest: result.data.poll.polls_description, - // questionnair: true, - // }) + // } }).catch((error) => { @@ -2326,41 +2352,41 @@ class PollNewQuestbank extends Component { } // 创建问卷 onSaveExercise = () => { - if (this.state.Newedit === true) { - - if (this.state.polls_nametest === undefined || this.state.polls_nametest === "") { - this.props.showNotification(`请输入标题`); - return - } - let coursesId = this.props.match.params.coursesId; - const urlls = `/courses/${coursesId}/polls.json` - axios.post(urlls, { - polls_name: this.state.polls_nametest, - polls_description: this.state.polls_descriptiontest - }).then((result) => { - if (result === undefined) { - return; - } - this.state.Newedit === false; - this.props.showNotification(`问卷创建成功!`); - this.setState({ - pollid: result.data.data.id, - Newedit: false, - mysave: false, - readOnlys: "readOnly", - cancellation: false, - }); - // var currenturl = window.location.href; - // var newUrl = (currenturl.split("?"))[0]; - // var newr=(newUrl.slice("new"))[0]; - // console.log(newUrl); - // console.log("2301"); - // console.log(newr); - // window.history.pushState('','',newUrl+'?tab='+e); - window.location.href = `/courses/${coursesId}/polls/${result.data.data.id}/edit`; - - }) - } else { + // if (this.state.Newedit === true) { + // + // if (this.state.polls_nametest === undefined || this.state.polls_nametest === "") { + // this.props.showNotification(`请输入标题`); + // return + // } + // let coursesId = this.props.match.params.coursesId; + // const urlls = `/courses/${coursesId}/polls.json` + // axios.post(urlls, { + // polls_name: this.state.polls_nametest, + // polls_description: this.state.polls_descriptiontest + // }).then((result) => { + // if (result === undefined) { + // return; + // } + // this.state.Newedit === false; + // this.props.showNotification(`问卷创建成功!`); + // this.setState({ + // pollid: result.data.data.id, + // Newedit: false, + // mysave: false, + // readOnlys: "readOnly", + // cancellation: false, + // }); + // // var currenturl = window.location.href; + // // var newUrl = (currenturl.split("?"))[0]; + // // var newr=(newUrl.slice("new"))[0]; + // // console.log(newUrl); + // // console.log("2301"); + // // console.log(newr); + // // window.history.pushState('','',newUrl+'?tab='+e); + // // window.location.href = `/courses/${coursesId}/polls/${result.data.data.id}/edit`; + // + // }) + // } else { if (this.state.polls_nametest === undefined || this.state.polls_nametest === "") { this.props.showNotification("请输入标题"); return @@ -2374,10 +2400,10 @@ class PollNewQuestbank extends Component { } - var url = `/polls/${pollid}.json`; + var url = `/exercise_banks/${pollid}.json`; axios.put(url, { - polls_name: this.state.polls_nametest, - polls_description: this.state.polls_descriptiontest + exercise_name: this.state.polls_nametest, + exercise_description: this.state.polls_descriptiontest }).then((result) => { if (result !== undefined) { this.props.showNotification(`问卷更新成功!`); @@ -2388,7 +2414,7 @@ class PollNewQuestbank extends Component { } }) - } + // } } gotohome=()=>{ @@ -2449,7 +2475,7 @@ class PollNewQuestbank extends Component { // console.log(this.state.projects===undefined?"":this.state.projects.poll_questions) var displaymysave = (mysave === true) ? "" : "display:none;"; return ( -

+
{/*提示*/} {Modalstype && Modalstype === true ? : ""} -
+ +

this.gotohome()}>{this.props.coursedata.name} > @@ -2479,21 +2512,21 @@ class PollNewQuestbank extends Component {

{/*

{this.props.match.params.news === undefined ? "新建问卷" : this.props.match.params.news === "new" ? "新建问卷" : "编辑问卷"}

*/} -

编辑问卷

+

编辑

{/*{*/} {/* this.props.match.params.news === "new" ?*/} {/* 返回*/} {/* :*/} 返回 + className=" fr font-16"> {/*}*/}
{/*
*/} { this.state.mysave === false ? -
+
{this.state.polls_nametest} @@ -2558,7 +2591,7 @@ class PollNewQuestbank extends Component {
合计 {this.state.mysingles === undefined ? "" : this.state.mydoubles === undefined ? "" : this.state.mymainsint === undefined ? "" : this.state.mysingles + this.state.mydoubles + this.state.mymainsint} + style={{color:"#FF6800"}}>{this.state.q_counts === undefined ? "" :this.state.q_counts} 题
} @@ -2641,7 +2674,6 @@ class PollNewQuestbank extends Component { {polls_status === undefined || polls_status === 1 ?
-
this.addmysingles()}>单选题 From 963f558c9353424dab97bbef9d909d6c3b76060a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Fri, 30 Aug 2019 16:03:13 +0800 Subject: [PATCH 02/22] Merge branches 'dev_Ysl' and 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_Ysl # Conflicts: # public/react/src/modules/courses/Index.js --- .../src/modules/courses/groupjobbank/Groupjobquesanswer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/courses/groupjobbank/Groupjobquesanswer.js b/public/react/src/modules/courses/groupjobbank/Groupjobquesanswer.js index 374aca841..463b6ecdc 100644 --- a/public/react/src/modules/courses/groupjobbank/Groupjobquesanswer.js +++ b/public/react/src/modules/courses/groupjobbank/Groupjobquesanswer.js @@ -10,7 +10,7 @@ import { Tooltip, notification, } from "antd"; -import AttachmentsList from '../..' +// import AttachmentsList from '../..' import GroupPackage from './GroupPackage'; import GroupPackage2 from './GroupPackage2'; import './questionbanks.css'; From f6971595d32773e339d1cf782fa38bc7138a500a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Fri, 30 Aug 2019 16:17:14 +0800 Subject: [PATCH 03/22] Merge branches 'dev_Ysl' and 'topic_bank' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_Ysl # Conflicts: # public/react/src/modules/courses/Index.js --- public/react/src/App.js | 55 ++++++++++++++++++++++ public/react/src/modules/courses/Index.js | 57 +---------------------- 2 files changed, 57 insertions(+), 55 deletions(-) diff --git a/public/react/src/App.js b/public/react/src/App.js index d37034052..bafaa898c 100644 --- a/public/react/src/App.js +++ b/public/react/src/App.js @@ -256,6 +256,31 @@ const Topicbank= Loadable({ loader: () => import('./modules/topic_bank/Topic_bank'), loading: Loading, }) +//普通作业题库详情 +const Generaljobbankdetails =Loadable({ + loader: () => import('./modules/courses/questionbank/Generaljobbankdetails'), + loading: Loading, +}); +//分组作业题库详情 +const GroupjobbankPage =Loadable({ + loader: () => import('./modules/courses/groupjobbank/GroupjobbankPage'), + loading: Loading, +}); +//毕设选题详情 +const CompletetopicdePage =Loadable({ + loader: () => import('./modules/courses/comtopicdetails/CompletetopicdePage'), + loading: Loading, +}); +//毕设任务详情 +const Completetaskpage =Loadable({ + loader: () => import('./modules/courses/completetaskdetails/Completetaskpage'), + loading: Loading, +}); +//问卷编辑 +const PollNewQuestbank =Loadable({ + loader: () => import('./modules/courses/poll/PollNewQuestbank'), + loading: Loading, +}); class App extends Component { constructor(props) { super(props) @@ -347,6 +372,36 @@ class App extends Component { + {/*题库问卷编辑详情*/} + () + } + > + {/*毕设任务题库详情*/} + () + } + > + {/*毕设内容题库详情*/} + () + } + > + {/*分组作业题库详情*/} + () + } + > + {/* 普通作业题库详情*/} + () + } + > {/*题库*/} import('./graduation/tasks/GraduationTasksSubmitedit'), loading: Loading, }) -//普通作业题库详情 -const Generaljobbankdetails =Loadable({ - loader: () => import('../../modules/courses/questionbank/Generaljobbankdetails'), - loading: Loading, -}); -//分组作业题库详情 -const GroupjobbankPage =Loadable({ - loader: () => import('../../modules/courses/groupjobbank/GroupjobbankPage'), - loading: Loading, -}); -//毕设选题详情 -const CompletetopicdePage =Loadable({ - loader: () => import('../../modules/courses/comtopicdetails/CompletetopicdePage'), - loading: Loading, -}); -//毕设任务详情 -const Completetaskpage =Loadable({ - loader: () => import('../../modules/courses/completetaskdetails/Completetaskpage'), - loading: Loading, -}); -//问卷编辑 -const PollNewQuestbank =Loadable({ - loader: () => import('../../modules/courses/poll/PollNewQuestbank'), - loading: Loading, -}); + class CoursesIndex extends Component{ constructor(props) { super(props) @@ -466,36 +442,7 @@ class CoursesIndex extends Component{ // console.log(commons) return ( - {/*题库问卷编辑详情*/} - () - } - > - {/*毕设任务题库详情*/} - () - } - > - {/*毕设内容题库详情*/} - () - } - > - {/*分组作业题库详情*/} - () - } - > - {/* 普通作业题库详情*/} - () - } - > + {/* 资源列表页 */} Date: Fri, 30 Aug 2019 16:28:24 +0800 Subject: [PATCH 04/22] Merge branches 'dev_Ysl' and 'topic_bank' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_Ysl # Conflicts: # public/react/src/modules/courses/Index.js --- .../user/usersInfo/banks/BanksIndex.js | 58 ++++++++++++++++++- 1 file changed, 57 insertions(+), 1 deletion(-) diff --git a/public/react/src/modules/user/usersInfo/banks/BanksIndex.js b/public/react/src/modules/user/usersInfo/banks/BanksIndex.js index 6b636dca2..c1b67fc5e 100644 --- a/public/react/src/modules/user/usersInfo/banks/BanksIndex.js +++ b/public/react/src/modules/user/usersInfo/banks/BanksIndex.js @@ -33,7 +33,33 @@ const GtopicBanksEdit = Loadable({ const HomeworkBanksEdit = Loadable({ loader: () => import('./HomeworkBanksEdit'), loading: Loading, -}) +}); + +//普通作业题库详情 +const Generaljobbankdetails =Loadable({ + loader: () => import('../../../courses/questionbank/Generaljobbankdetails'), + loading: Loading, +}); +//分组作业题库详情 +const GroupjobbankPage =Loadable({ + loader: () => import('../../../courses/groupjobbank/GroupjobbankPage'), + loading: Loading, +}); +//毕设选题详情 +const CompletetopicdePage =Loadable({ + loader: () => import('../../../courses/comtopicdetails/CompletetopicdePage'), + loading: Loading, +}); +//毕设任务详情 +const Completetaskpage =Loadable({ + loader: () => import('../../../courses/completetaskdetails/Completetaskpage'), + loading: Loading, +}); +//问卷编辑 +const PollNewQuestbank =Loadable({ + loader: () => import('../../../courses/poll/PollNewQuestbank'), + loading: Loading, +}); class BanksIndex extends Component{ constructor(props){ @@ -105,6 +131,36 @@ class BanksIndex extends Component{ return () } }> + {/*题库问卷编辑详情*/} + () + } + > + {/*毕设任务题库详情*/} + () + } + > + {/*毕设内容题库详情*/} + () + } + > + {/*分组作业题库详情*/} + () + } + > + {/* 普通作业题库详情*/} + () + } + >
From 2e52420386ffe249da1e3d87e7236ce458acc851 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Fri, 30 Aug 2019 16:32:14 +0800 Subject: [PATCH 05/22] Merge branches 'dev_Ysl' and 'topic_bank' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_Ysl # Conflicts: # public/react/src/modules/courses/Index.js --- .../src/modules/user/usersInfo/banks/BanksIndex.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/public/react/src/modules/user/usersInfo/banks/BanksIndex.js b/public/react/src/modules/user/usersInfo/banks/BanksIndex.js index c1b67fc5e..14ca81e17 100644 --- a/public/react/src/modules/user/usersInfo/banks/BanksIndex.js +++ b/public/react/src/modules/user/usersInfo/banks/BanksIndex.js @@ -134,31 +134,31 @@ class BanksIndex extends Component{ {/*题库问卷编辑详情*/} () + (props) => () } > {/*毕设任务题库详情*/} () + (props) => () } > {/*毕设内容题库详情*/} () + (props) => () } > {/*分组作业题库详情*/} () + (props) => () } > {/* 普通作业题库详情*/} () + (props) => () } > From 35a74601d441437bff57ee7fc3866be191a2b1cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Fri, 30 Aug 2019 18:12:35 +0800 Subject: [PATCH 06/22] =?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/src/App.js | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/public/react/src/App.js b/public/react/src/App.js index 6e2fe3dff..88ed43447 100644 --- a/public/react/src/App.js +++ b/public/react/src/App.js @@ -256,31 +256,6 @@ const Topicbank= Loadable({ loader: () => import('./modules/topic_bank/Topic_bank'), loading: Loading, }) -//普通作业题库详情 -const Generaljobbankdetails =Loadable({ - loader: () => import('./modules/courses/questionbank/Generaljobbankdetails'), - loading: Loading, -}); -//分组作业题库详情 -const GroupjobbankPage =Loadable({ - loader: () => import('./modules/courses/groupjobbank/GroupjobbankPage'), - loading: Loading, -}); -//毕设选题详情 -const CompletetopicdePage =Loadable({ - loader: () => import('./modules/courses/comtopicdetails/CompletetopicdePage'), - loading: Loading, -}); -//毕设任务详情 -const Completetaskpage =Loadable({ - loader: () => import('./modules/courses/completetaskdetails/Completetaskpage'), - loading: Loading, -}); -//问卷编辑 -const PollNewQuestbank =Loadable({ - loader: () => import('./modules/courses/poll/PollNewQuestbank'), - loading: Loading, -}); class App extends Component { constructor(props) { super(props) From 04cd8f4eabe94f139249bd1b4424da0b6919cd2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Fri, 30 Aug 2019 18:38:39 +0800 Subject: [PATCH 07/22] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/courses/poll/PollNewQuestbank.js | 41 +++++++++++-------- 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/public/react/src/modules/courses/poll/PollNewQuestbank.js b/public/react/src/modules/courses/poll/PollNewQuestbank.js index ac325df95..38256f389 100644 --- a/public/react/src/modules/courses/poll/PollNewQuestbank.js +++ b/public/react/src/modules/courses/poll/PollNewQuestbank.js @@ -2141,8 +2141,14 @@ class PollNewQuestbank extends Component { }) } - //最小值 +//最小值 HandleGradationGroupChangee = (value, index, max, length) => { + // console.log("最小值"); + // console.log(value); + // console.log(index); + // console.log(max); + // console.log(length); + // debugger var minbool = false; var maxbool = false; @@ -2166,18 +2172,8 @@ class PollNewQuestbank extends Component { } else { for (var i = 0; i < arr.length; i++) { if (index === i) { - try { - if(parseInt(value)===0){ - arr[i].question.min_choices = 2; - arr[i].question.max_choices = length; - }else{ - arr[i].question.min_choices = parseInt(value); - arr[i].question.max_choices = length; - } - }catch (e) { - arr[i].question.min_choices = 2; - arr[i].question.max_choices = length; - } + arr[i].question.min_choices = parseInt(value); + arr[i].question.max_choices = length; break; } } @@ -2189,19 +2185,32 @@ class PollNewQuestbank extends Component { } //最大值 - HandleGradationGroupChangeee = (value, index,minchoices) => { + HandleGradationGroupChangeee = (value, index,minchoices,length) => { // console.log("2112"); // console.log(value); // console.log(minchoices); + // console.log("最大值"); + // console.log(value); + // console.log(index); + // console.log(minchoices); + // console.log(length); let arr = this.state.adddom; for (var i = 0; i < arr.length; i++) { if (index === i) { if(parseInt(value)===0&&parseInt(minchoices)===0){ + arr[i].question.min_choices= parseInt(0); + arr[i].question.max_choices = parseInt(0); + }else if(parseInt(minchoices)===0){ + arr[i].question.min_choices= parseInt(2); + arr[i].question.max_choices = parseInt(value); + } + else if(parseInt(value)===0&&parseInt(minchoices)>0){ arr[i].question.min_choices= parseInt(minchoices); arr[i].question.max_choices = parseInt(value); - }else { + } + else { arr[i].question.min_choices= minchoices===null?2:minchoices===undefined?2:minchoices===0?2:parseInt(minchoices); - arr[i].question.max_choices = parseInt(value); + arr[i].question.max_choices = parseInt(value); } } } From f230cf8a119756771d3a454c64d52e58ac4eed20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Fri, 30 Aug 2019 21:16:31 +0800 Subject: [PATCH 08/22] =?UTF-8?q?=E5=90=88=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/courses/poll/PollNewQuestbank.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/courses/poll/PollNewQuestbank.js b/public/react/src/modules/courses/poll/PollNewQuestbank.js index 38256f389..d56cf7dc3 100644 --- a/public/react/src/modules/courses/poll/PollNewQuestbank.js +++ b/public/react/src/modules/courses/poll/PollNewQuestbank.js @@ -1892,7 +1892,7 @@ class PollNewQuestbank extends Component { // console.log(poll_question_id) var thiss = this; if (bool === true) { - var url = `/poll_questions/${poll_question_id}/up_down.json`; + var url = `/exercise_bank_questions/${poll_question_id}/up_down.json`; axios.post(url, { opr: "up", }).then((result) => { @@ -1909,7 +1909,7 @@ class PollNewQuestbank extends Component { }) } else { - var url = `/poll_questions/${poll_question_id}/up_down.json`; + var url = `/exercise_bank_questions/${poll_question_id}/up_down.json`; axios.post(url, { opr: "down", }).then((result) => { From 601f4439efaafd834bea2ee8c4db9db047b549d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Sat, 31 Aug 2019 09:03:05 +0800 Subject: [PATCH 09/22] =?UTF-8?q?=E5=90=88=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/courses/poll/PollNewQuestbank.js | 598 +++++++++++------- .../src/modules/courses/poll/pollStyle.css | 17 +- public/stylesheets/educoder/edu-main.css | 4 +- 3 files changed, 400 insertions(+), 219 deletions(-) diff --git a/public/react/src/modules/courses/poll/PollNewQuestbank.js b/public/react/src/modules/courses/poll/PollNewQuestbank.js index d56cf7dc3..35e2a60ae 100644 --- a/public/react/src/modules/courses/poll/PollNewQuestbank.js +++ b/public/react/src/modules/courses/poll/PollNewQuestbank.js @@ -266,7 +266,7 @@ class PollNewQuestbank extends Component { this.setState({ projects: result.data, pollid: pollid, - polls_status: 1, + polls_status: result.data.poll.is_public===false?1:2, polls_name: result.data.poll.name, polls_description: result.data.poll.description, poll_questions: result.data.questions, @@ -315,7 +315,7 @@ class PollNewQuestbank extends Component { this.setState({ projects: result.data, pollid: pollid, - polls_status: 1, + polls_status: result.data.poll.is_public===false?1:2, polls_name: result.data.poll.name, polls_description: result.data.poll.description, poll_questions: result.data.questions, @@ -673,7 +673,7 @@ class PollNewQuestbank extends Component { {"answer_id": 2, "answer_position": 2, "answer_text": ""}, {"answer_id": 3, "answer_position": 3, "answer_text": ""}, {"answer_id": 4, "answer_position": 4, "answer_text": ""}, - // {"answer_id": 5, "answer_position": 5, "answer_text": "其他"}, + {"answer_id": 5, "answer_position": 5, "answer_text": "其他"}, ] }; question = {"question": questiontwo}; @@ -767,7 +767,7 @@ class PollNewQuestbank extends Component { {"answer_id": 2, "answer_position": 2, "answer_text": ""}, {"answer_id": 3, "answer_position": 3, "answer_text": ""}, {"answer_id": 4, "answer_position": 4, "answer_text": ""}, - // {"answer_id": 5, "answer_position": 5, "answer_text": "其他"}, + {"answer_id": 5, "answer_position": 5, "answer_text": "其他"}, ] }; question = {"question": questiontwo}; @@ -823,6 +823,7 @@ class PollNewQuestbank extends Component { problemtopicbool: false, bindingid:undefined, Newdisplay:false, + newoption: false, }) }else{ @@ -832,6 +833,7 @@ class PollNewQuestbank extends Component { problemtopic: null, problemtopicbool: false, Newdisplay:false, + newoption: false, }) } @@ -1775,7 +1777,7 @@ class PollNewQuestbank extends Component { createquestionsandanswers = (object, number, option, other, max_choices, min_choices, insert_id) => { var thiss = this; var poll_id = this.state.pollid; - var urlly = `/polls/${poll_id}/poll_questions.json` + var urlly = `/poll_bank_questions.json`; var max_choicess = null; var min_choicess = null; if (max_choices === 0 && min_choices === 0) { @@ -1786,6 +1788,7 @@ class PollNewQuestbank extends Component { min_choicess = min_choices; } axios.post(urlly, { + exercise_bank_id:poll_id, question_title: object.question.question_title, question_type: number, is_necessary: object.question.is_necessary, @@ -1823,7 +1826,7 @@ class PollNewQuestbank extends Component { ///编辑修改到服务器当中 edittotheserver = (object, number, option, other, max_choices, min_choices) => { // console.log("调用了edittotheserver") - var url = `/poll_questions/${object.question.id}.json` + var url = `/poll_bank_questions/${object.question.id}.json` var thiss = this; axios.put(url, { // debug: true, @@ -1851,7 +1854,7 @@ class PollNewQuestbank extends Component { eletetoserver = (pollid, newarr, type, index) => { // console.log("调用了eletetoserver") var id = pollid; - var url = `/poll_questions/${id}.json` + var url = `/exercise_bank_questions/${id}.json` let {mysingles, mydoubles, mymainsint} = this.state var thiss = this; @@ -1893,7 +1896,7 @@ class PollNewQuestbank extends Component { var thiss = this; if (bool === true) { var url = `/exercise_bank_questions/${poll_question_id}/up_down.json`; - axios.post(url, { + axios.put(url, { opr: "up", }).then((result) => { try { @@ -1910,7 +1913,7 @@ class PollNewQuestbank extends Component { }) } else { var url = `/exercise_bank_questions/${poll_question_id}/up_down.json`; - axios.post(url, { + axios.put(url, { opr: "down", }).then((result) => { try { @@ -2444,7 +2447,7 @@ class PollNewQuestbank extends Component { } //试图 toWorkDetail = () => { - this.props.history.push(`/banks/poll/${this.props.match.params.workId}`); + this.props.history.push(`/banks/poll/${this.props.match.params.workId} `); this.props.initPublic(undefined); } @@ -2707,7 +2710,7 @@ class PollNewQuestbank extends Component { console.log(this.state.poll_questions); console.log(this.state.adddom); let resultDom; - resultDom =
+ resultDom =

第{index + 1}题: return ( -

+
{/*这里是编辑和新增的地方*/} { this.state.bindingid && this.state.bindingid===item.question.id? @@ -2798,6 +2801,7 @@ class PollNewQuestbank extends Component { resultDomtwo =
{itemo.question.question_type === 1 ? "单选题" : itemo.question.question_type === 2 ? "多选题" : "主观题"}
) : itemt.answer_text === "其他" ? (

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

) : (

- 选项 {this.state.polls_status === undefined || this.state.polls_status === 1 ? - this.Deleteentrys(arrid, indext, false)}> + indext>1? + + this.Deleteentrys(arrid, indext, false)}> + { + itemo.question.answers[itemo.question.answers.length-1].answer_text === "其他"&&itemo.question.answers.length-2===indext? + + this.Ewoption(itemo.question.id, itemo)}> + : itemo.question.answers.length-1===indext? + this.Ewoption(itemo.question.id, itemo)}> + : + } + + :indext===1&&itemo.question.answers.length===2||indext===1&&itemo.question.answers.length===3? this.Ewoption(itemo.question.id, itemo)}>:"" : ""}

)}
@@ -2867,26 +2909,26 @@ class PollNewQuestbank extends Component {
{itemo.question.question_type === 1 ? (
-
+ {/* this.Ewoption(itemo.question.id, itemo)}>新增选项*/} +
{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.Addanotheroption(itemo.question.id)}>添加[其它]选项 : "") : ""} - this.Deleteadddom(indexo,true)}>取消 this.Deleteadddomthree(indexo, itemo,true)}>保存 + onClick={() => this.Deleteadddomtwo(indexo, itemo,true)} >保存并继续 this.Deleteadddomtwo(indexo, itemo,true)}>保存并继续 + onClick={() => this.Deleteadddomthree(indexo, itemo,true)}>保存并退出
@@ -2897,8 +2939,8 @@ class PollNewQuestbank extends Component { : itemo.question.question_type === 2 ? ( //////////////////////////////////////////// 可选 -
-
+
+
可选 @@ -2950,6 +2992,14 @@ class PollNewQuestbank extends Component { className="ml10 mr20 color-grey-6 lineh-40 fl font-16">项 (学生答题时,系统对其选择的选项个数进行限制,--表示不限制) + + this.Deleteadddom(indexo,true)}>取消 + this.Deleteadddomtwo(indexo, itemo,true)}>保存并继续 + this.Deleteadddomthree(indexo, itemo,true)}>保存并退出 +
@@ -2957,60 +3007,60 @@ class PollNewQuestbank extends Component {
) - : (
) + : (
) }
{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,true)}>取消 - this.Deleteadddomthree(indexo, itemo,true)}>保存 - this.Deleteadddomtwo(indexo, itemo,true)}>保存并继续 - -
- - - : -
- - this.Deleteadddom(indexo,true)}>取消 - this.Deleteadddomthree(indexo, itemo,true)}>保存 - this.Deleteadddomtwo(indexo, itemo,true)}>保存并继续 - -
- ) - + // ( + // 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,true)}>取消 + // this.Deleteadddomtwo(indexo, itemo,true)}>保存并继续 + // this.Deleteadddomthree(indexo, itemo,true)}>保存并退出 + // + //
+ // + // + // : + //
+ // + // this.Deleteadddom(indexo,true)}>取消 + // this.Deleteadddomtwo(indexo, itemo,true)}>保存并继续 + // this.Deleteadddomthree(indexo, itemo,true)}> 保存并退出 + // + //
+ // ) +"" : itemo.question.question_type === 3 ?
- this.Deleteadddom(indexo,true)}>取消 this.Deleteadddomthree(indexo, itemo,true)}>保存 + onClick={() => this.Deleteadddomtwo(indexo, itemo,true)}>保存并继续 this.Deleteadddomtwo(indexo, itemo,true)}>保存并继续 + onClick={() => this.Deleteadddomthree(indexo, itemo,true)}>保存并退出
: @@ -3041,6 +3091,7 @@ class PollNewQuestbank extends Component { resultDomtwo =
{itemo.question.question_type === 1 ? "单选题" : itemo.question.question_type === 2 ? "多选题" : "主观题"} this.HandleInputTopic(e, indexo)}>{itemo.question.question_title} {itemo.question.answers === undefined ? "" : itemo.question.answers.map((itemt, indext) => { + console.log("chishiyong1"); + console.log( itemo.question.answers[itemo.question.answers.length - 1]); return (
{itemt.answer_text === undefined ? (
) : itemt.answer_text === "其他" ? (

其它 {this.state.polls_status === undefined || this.state.polls_status === 1 ? - this.Deleteentrys(arrid, indext, true)}> + indext>1? + + { + itemo.question.question_type === 2?"": + this.Deleteentrys(arrid, indext, true)}> + } + + {/* {*/} + {/* itemo.question.answers.length-1=== indext?*/} + {/* this.Ewoption(itemo.question.id, itemo)}>*/} + {/*: */} + {/* }*/} + + :"" : ""}

) : (

- 选项 {this.state.polls_status === undefined || this.state.polls_status === 1 ? - this.Deleteentrys(arrid, indext, false)}> + indext>1? + + this.Deleteentrys(arrid, indext, false)}> + { + itemo.question.answers[itemo.question.answers.length - 1].answer_text==="其他"&&itemo.question.answers.length - 2 === indext ? + this.Ewoption(itemo.question.id, itemo)}> + : itemo.question.answers.length - 1 === indext ? + this.Ewoption(itemo.question.id, itemo)}> + : + + } + + :indext===1&&itemo.question.answers.length===2||indext===1&&itemo.question.answers.length===3? this.Ewoption(itemo.question.id, itemo)}>:"" : ""}

)}
@@ -3110,26 +3206,26 @@ class PollNewQuestbank extends Component {
{itemo.question.question_type === 1 ? (
-
+ {/* this.Ewoption(itemo.question.id, itemo)}>新增选项*/} +
{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.Addanotheroption(itemo.question.id)}>添加[其它]选项 : "") : ""} - this.Deleteadddom(indexo,true)}>取消 this.Deleteadddomthree(indexo, itemo,true)}>保存 + onClick={() => this.Deleteadddomtwo(indexo, itemo,true)}>保存并继续 this.Deleteadddomtwo(indexo, itemo,true)}>保存并继续 + onClick={() => this.Deleteadddomthree(indexo, itemo,true)}>保存并退出
@@ -3141,7 +3237,7 @@ class PollNewQuestbank extends Component { : itemo.question.question_type === 2 ? ( //////////////////////////////////////////// 可选
-
+
可选 @@ -3193,6 +3289,15 @@ class PollNewQuestbank extends Component { className="ml10 mr20 color-grey-6 lineh-40 fl font-16">项 (学生答题时,系统对其选择的选项个数进行限制,--表示不限制) + + this.Deleteadddom(indexo,true)}>取消 + this.Deleteadddomtwo(indexo, itemo,true)} + >保存并继续 + this.Deleteadddomthree(indexo, itemo,true)}>保存并退出 +
@@ -3200,60 +3305,64 @@ class PollNewQuestbank extends Component {
) - : (
) + : (
) }
{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,true)}>取消 - this.Deleteadddomthree(indexo, itemo,true)}>保存 - this.Deleteadddomtwo(indexo, itemo,true)}>保存并继续 - -
- - - : -
- - this.Deleteadddom(indexo,true)}>取消 - this.Deleteadddomthree(indexo, itemo,true)}>保存 - this.Deleteadddomtwo(indexo, itemo,true)}>保存并继续 - -
- ) + // ( + // 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,true)}>取消 + // this.Deleteadddomtwo(indexo, itemo,true)} + // >保存并继续 + // this.Deleteadddomthree(indexo, itemo,true)}>保存并退出 + // + //
+ // + // + // : + //
+ // + // this.Deleteadddom(indexo,true)}>取消 + // this.Deleteadddomtwo(indexo, itemo,true)} + // >保存并继续 + // this.Deleteadddomthree(indexo, itemo,true)}> 保存并退出 + // + //
+ // ) + "" : itemo.question.question_type === 3 ?
- this.Deleteadddom(indexo,true)}>取消 this.Deleteadddomthree(indexo, itemo,true)}>保存 + onClick={() => this.Deleteadddomtwo(indexo, itemo,true)} + >保存并继续 this.Deleteadddomtwo(indexo, itemo,true)}>保存并继续 + onClick={() => this.Deleteadddomthree(indexo, itemo,true)}> 保存并退出
: @@ -3293,6 +3402,7 @@ class PollNewQuestbank extends Component { resultDomtwo =
{itemo.question.question_type === 1 ? "单选题" : itemo.question.question_type === 2 ? "多选题" : "主观题"} this.HandleInputTopic(e, indexo)}>{itemo.question.question_title} {itemo.question.answers === undefined ? "" : itemo.question.answers.map((itemt, indext) => { + console.log("ceshiyong2"); + console.log(itemo.question.answers.length-1); return (
{itemt.answer_text === undefined ? (
) : itemt.answer_text === "其他" ? (

其它 {polls_status === undefined || polls_status === 1 ? - this.Deleteentrys(arrid, indext, true)}> + indext>1? + + { + itemo.question.question_type === 2?"" + : + this.Deleteentrys(arrid, indext, true)}> + } + + + + + :"" : ""}

) : (

- 选项 {polls_status === undefined || polls_status === 1 ? - this.Deleteentrys(arrid, indext, false)}> + (indext>1? + + this.Deleteentrys(arrid, indext, false)}> + { + itemo.question.answers[itemo.question.answers.length-1].answer_text==="其他"&&itemo.question.answers.length-2===indext? + this.Ewoption(itemo.question.id, itemo)}> + : + itemo.question.answers.length - 1 === indext ? + this.Ewoption(itemo.question.id, itemo)}> + : + + + } + + :indext===1&&itemo.question.answers.length===2||indext===1&&itemo.question.answers.length===3? this.Ewoption(itemo.question.id, itemo)}>:"") : ""}

)}
@@ -3362,26 +3513,27 @@ class PollNewQuestbank extends Component {
{itemo.question.question_type === 1 ? (
-
+ {/* this.Ewoption(itemo.question.id, itemo)}>新增选项*/} +
{polls_status === undefined || polls_status === 1 ? - this.Ewoption(itemo.question.id, itemo)}>新增选项 - + "" : ""} {polls_status === undefined || polls_status === 1 ? (newoption === false ? - this.Addanotheroption(itemo.question.id)}>新增其他选项 + this.Addanotheroption(itemo.question.id)}>添加[其它]选项 : "") : ""} - this.Deleteadddom(indexo)}>取消 this.Deleteadddomthree(indexo, itemo)}>保存 + onClick={() => this.Deleteadddomtwo(indexo, itemo)} + > 保存并继续 this.Deleteadddomtwo(indexo, itemo)}>保存并继续 + onClick={() => this.Deleteadddomthree(indexo, itemo)}>保存并退出
@@ -3393,7 +3545,7 @@ class PollNewQuestbank extends Component { : itemo.question.question_type === 2 ? ( //////////////////////////////////////////// 可选
-
+
可选 @@ -3445,6 +3597,15 @@ class PollNewQuestbank extends Component { className="ml10 mr20 color-grey-6 lineh-40 fl font-16">项 (学生答题时,系统对其选择的选项个数进行限制,--表示不限制) + + this.Deleteadddom(indexo)}>取消 + this.Deleteadddomtwo(indexo, itemo)} + >保存并继续 + this.Deleteadddomthree(indexo, itemo)}> 保存并退出 +
@@ -3452,60 +3613,63 @@ class PollNewQuestbank extends Component {
) - : (
) + : (
) }
{itemo.question.question_type === 2 ? - ( - polls_status === undefined || polls_status === 1 ? -
- -
this.Ewoption(itemo.question.id, itemo)}>新增选项 - - { - 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)}>保存并继续 - -
- ) - + // ( + // polls_status === undefined || polls_status === 1 ? + //
+ // + //
this.Ewoption(itemo.question.id, itemo)}>新增选项 + // + // { + // newoption === false ? this.Addanotheroption(itemo.question.id)}>新增其他选项 : "" + // } + // + //
+ // + // + // + // this.Deleteadddom(indexo)}>取消 + // this.Deleteadddomtwo(indexo, itemo)} + // >保存并继续 + // this.Deleteadddomthree(indexo, itemo)}> 保存并退出 + // + //
+ // + // + // : + //
+ // + // this.Deleteadddom(indexo)}>取消 + // this.Deleteadddomtwo(indexo, itemo)} + // > 保存并继续 + // this.Deleteadddomthree(indexo, itemo)}>保存并退出 + // + //
+ // ) + "" : itemo.question.question_type === 3 ?
- this.Deleteadddom(indexo)}>取消 this.Deleteadddomthree(indexo, itemo)}>保存 + onClick={() => this.Deleteadddomtwo(indexo, itemo)} + >保存并继续 this.Deleteadddomtwo(indexo, itemo)}>保存并继续 + onClick={() => this.Deleteadddomthree(indexo, itemo)}>保存并退出
: diff --git a/public/react/src/modules/courses/poll/pollStyle.css b/public/react/src/modules/courses/poll/pollStyle.css index 023229f92..19f1b35cd 100644 --- a/public/react/src/modules/courses/poll/pollStyle.css +++ b/public/react/src/modules/courses/poll/pollStyle.css @@ -17,7 +17,22 @@ min-height: 40px; min-line-height: 40px; } - +.ml61{ + margin-left: 61px; +} +.w64{ + width: 64px; +} +.w55{ + width: 55px!important; +} +.max1010{ + width: 1010px !important; + max-width: 1010px !important; +} +.yw18{ + min-width: 18px; +} /* 选答 */ .chooseAnswer{ display: inline-block; diff --git a/public/stylesheets/educoder/edu-main.css b/public/stylesheets/educoder/edu-main.css index 1cceab275..05a7bdba5 100644 --- a/public/stylesheets/educoder/edu-main.css +++ b/public/stylesheets/educoder/edu-main.css @@ -103,6 +103,9 @@ a.decoration{text-decoration: underline} .mb0{margin-bottom: 0px!important;}.mb3{ margin-bottom: 3px;}.mb5{ margin-bottom: 5px;}.mb7{ margin-bottom: 7px;}.mb10{ margin-bottom: 10px;}.mb11{ margin-bottom: 11px;}.mb14{ margin-bottom: 14px;}.mb15{ margin-bottom: 15px;}.mb16{ margin-bottom: 16px;}.mb20{ margin-bottom: 20px!important;}.mb25{ margin-bottom: 25px;}.mb26{ margin-bottom: 26px;}.mb28{ margin-bottom: 28px;}.mb30{ margin-bottom: 30px!important;}.mb40{ margin-bottom: 40px!important;}.mb50{ margin-bottom: 50px!important;}.mb60{ margin-bottom: 60px!important;}.mb70{ margin-bottom: 70px!important;}.mb80{ margin-bottom: 80px!important;}.mb90{ margin-bottom: 90px!important;}.mb100{ margin-bottom: 100px!important;}.mb110{ margin-bottom: 110px;} .ml-3{ margin-left: -3px;}.ml1{margin-left: 1px;}.ml2{margin-left: 2px;}.ml3{margin-left: 3px;}.ml4{margin-left: 4px;}.ml5{ margin-left: 5px;}.ml6{ margin-left: 6px;}.ml10{ margin-left: 10px;}.ml12{ margin-left:12px!important;}.ml13{ margin-left:13px!important;}.ml15{ margin-left: 15px;}.ml18{ margin-left: 18px;}.ml20{ margin-left: 20px;}.ml22{ margin-left: 22px;}.ml25{ margin-left: 25px;}.ml29{margin-left: 29px;}.ml30{ margin-left: 30px;}.ml33{ margin-left: 33px;}.ml35{ margin-left:35px;}.ml40{margin-left:40px;}.ml42{margin-left:42px;}.ml45{ margin-left: 45px;}.ml50{ margin-left: 50px;}.ml55{ margin-left: 55px;}.ml60{ margin-left: 60px;}.ml72{ margin-left: 72px;}.ml73{ margin-left: 73px;}.ml75{ margin-left: 75px;}.ml80{ margin-left: 80px;}.ml85{margin-left:85px;}.ml95{ margin-left: 95px;}.ml115{margin-left: 115px}.ml123{ margin-left: 123px;}.ml150{ margin-left: 150px;}.ml180{ margin-left: 180px;}.ml230{ margin-left: 230px;}.ml240{margin-left: 240px;}.ml250{ margin-left: 250px;}.ml290{ margin-left: 290px;} .mr3{margin-right: 3px}.mr4{margin-right: 4px}.mr5{ margin-right: 5px;}.mr8{ margin-right: 8px;}.mr10{ margin-right: 10px;}.mr12{ margin-right:12px!important;}.mr15{ margin-right: 15px;}.mr18{ margin-right: 18px;}.mr20{ margin-right: 20px;}.mr24{ margin-right: 24px;}.mr25{ margin-right: 25px;}.mr30{ margin-right:30px;}.mr35{margin-right:35px;}.mr40{margin-right:40px;}.mr45{margin-right:45px;}.mr50{ margin-right: 50px;}.mr60{ margin-right:60px;}.mr70{ margin-right: 70px;}.mr75{ margin-right: 75px;}.mr80{ margin-right:80px;}.mr90{ margin-right:90px;}.mr100{ margin-right: 100px;}.mr110{ margin-right:110px;}.mr350{ margin-right:350px;} +.ml61{ + margin-left: 61px; +} .pt1{ padding-top:1px;}.pt3{ padding-top:3px!important;}.pt5{ padding-top:5px!important;}.pt10{ padding-top:10px;}.pt15{ padding-top:15px;}.pt17{ padding-top:17px;}.pt20{ padding-top:20px!important;}.pt25{ padding-top:25px;}.pt30{ padding-top:30px;}.pt35{ padding-top:35px;}.pt37{ padding-top:37px;}.pt40{ padding-top:40px;}.pt47{ padding-top:47px;}.pt49{ padding-top:49px;}.pt50{ padding-top:50px;}.pt60{ padding-top:60px;}.pt70{ padding-top:70px;}.pt80{ padding-top:80px;}.pt90{ padding-top:90px;}.pt100{padding-top:100px;}.pt110{ padding-top:110px;}.pt120{ padding-top:120px;}.pt130{padding-top:130px;} .pb3{ padding-bottom:3px!important;}.pb5{ padding-bottom:5px!important;}.pb10{ padding-bottom:10px;}.pb15{ padding-bottom:15px;}.pb20{ padding-bottom:20px;}.pb25{ padding-bottom:20px;}.pb25{ padding-bottom:20px;}.pb30{ padding-bottom:30px;}.pb35{ padding-bottom:35px;}.pb40{ padding-bottom:40px;}.pb47{ padding-bottom:47px;}.pb50{ padding-bottom:50px;}.pb60{ padding-bottom:60px;}.pb70{ padding-bottom:70px;}.pb80{ padding-bottom:80px;}.pb90{ padding-bottom:90px;}.pb100{ padding-bottom:100px;}.pb110{ padding-bottom:110px;}.pb155{ padding-bottom:155px;} @@ -111,7 +114,6 @@ a.decoration{text-decoration: underline} .pl0{ padding-left:0px!important;}.pl2{ padding-left:2px;}.pl5{ padding-left:5px;}.pl7{ padding-left:7px;}.pl8{ padding-left:8px;}.pl10{ padding-left:10px;}.pl15{ padding-left:15px;}.pl20{ padding-left:20px;}.pl22{ padding-left:22px;}.pl25{ padding-left:25px;}.pl28{ padding-left:28px;}.pl30{ padding-left:30px !important;}.pl33{padding-left: 33px}.pl35{ padding-left:35px;}.pl40{ padding-left:40px;}.pl42{ padding-left:42px;}.pl45{ padding-left:45px;}.pl50{ padding-left:50px;}.pl60{ padding-left:60px;}.pl70{padding-left:70px;}.pl75{padding-left:75px;}.pl80{padding-left:80px;}.pl88{ padding-left:88px;}.pl92{padding-left:92px;}.pl100{ padding-left:100px;} .pr2{ paddding-right:2px;}.pr5{ padding-right:5px;}.pr7{ padding-right:7px;}.pr10{ padding-right:10px;}.pr15{ padding-right:15px;}.pr20{ padding-right:20px!important;}.pr25{ padding-right:25px!important;}.pr30{ padding-right:30px!important;}.pr40{ padding-right:40px;}.pr42{ padding-right:42px;}.pr45{ padding-right:45px;}.pr60{padding-right:60px;}.pr75{padding-right:75px;} - .padding5-10{padding:5px 10px;box-sizing: border-box} .padding5-20{padding:5px 20px;box-sizing: border-box} .padding10{padding: 10px;box-sizing: border-box} From c5b41a28920123c0158da748a1122dbc114bd8d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Sat, 31 Aug 2019 11:10:05 +0800 Subject: [PATCH 10/22] =?UTF-8?q?=E5=90=88=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../react/src/modules/courses/poll/PollNew.js | 10 +- .../modules/courses/poll/PollNewQuestbank.js | 1346 +++++++++-------- 2 files changed, 749 insertions(+), 607 deletions(-) diff --git a/public/react/src/modules/courses/poll/PollNew.js b/public/react/src/modules/courses/poll/PollNew.js index 091f45b94..aab316d82 100644 --- a/public/react/src/modules/courses/poll/PollNew.js +++ b/public/react/src/modules/courses/poll/PollNew.js @@ -1752,7 +1752,7 @@ class PollNew extends Component { question = {"question": questiontwo}; if (uuk !== -1) { // console.log("修改") - this.edittotheserver(object, 3, null, null, 0, 0,0); + this.edittotheserver(object, 3, null, null, 0, 0,0,0); newarrpoll.splice(uuk, 1, question); } else { // console.log("删除") @@ -1859,10 +1859,10 @@ class PollNew extends Component { max_choicess = max_choices; min_choicess = min_choices; } - console.log("createquestionsandanswers"); - console.log(max_choicess); - console.log(min_choicess); - console.log(length); + // console.log("createquestionsandanswers"); + // console.log(max_choicess); + // console.log(min_choicess); + // console.log(length); axios.put(url, { // debug: true, question_title: object.question.question_title, diff --git a/public/react/src/modules/courses/poll/PollNewQuestbank.js b/public/react/src/modules/courses/poll/PollNewQuestbank.js index 35e2a60ae..f86e8515d 100644 --- a/public/react/src/modules/courses/poll/PollNewQuestbank.js +++ b/public/react/src/modules/courses/poll/PollNewQuestbank.js @@ -13,6 +13,7 @@ import axios from 'axios' import moment from "../new/CoursesNew"; import Modals from "../../modals/Modals"; import PollListItem from "./PollListItem"; +import TPMMDEditor from '../../tpm/challengesnew/TPMMDEditor'; const TextArea = Input.TextArea const RadioGroup = Radio.Group @@ -36,12 +37,13 @@ class PollNewQuestbank extends Component { constructor(props) { super(props); + this.contentMdRef = React.createRef(); this.state = { visible: false, poll_questions: [], user_permission: "", addonAfter: 0, - addonAftertwo: 100, + addonAftertwo: 0, mysingles: 0, mydoubles: 0, mymainsint: 0, @@ -52,8 +54,8 @@ class PollNewQuestbank extends Component { polls_nametest: "", polls_description: "", polls_descriptiontest: "", - storagedesc:"", - storagedesctwo:"", + storagedesc: "", + storagedesctwo: "", coursesId: "", pollid: undefined, polls_status: undefined, @@ -67,10 +69,10 @@ class PollNewQuestbank extends Component { problemtopicbool: false, newoption: false, cancellation: false, - bindingid:undefined, - Newdisplay:false, - first_category_url:"", - left_banner_id:"", + bindingid: undefined, + Newdisplay: false, + first_category_url: "", + left_banner_id: "", } // console.log("试卷新建和编辑"); // console.log(JSON.stringify(props)); @@ -80,7 +82,7 @@ class PollNewQuestbank extends Component { changeTopicName = (e) => { // console.log("调用了changeTopicName"); let num = parseInt(e.target.value.length); - if(num>60){ + if (num > 60) { return; } this.setState({ @@ -106,7 +108,7 @@ class PollNewQuestbank extends Component { // 初始化数据 componentDidMount = () => { // console.log("componentDidMount 50") - if( this.props.isStudent() === true){ + if (this.props.isStudent() === true) { this.props.history.push("/403") @@ -122,27 +124,28 @@ class PollNewQuestbank extends Component { // cancellation: true, // }) // } else { - this.Initializatio_data(); - this.state.Newedit === false; - this.setState({ - Newedit: false, - mysave: false, - readOnlys: "readOnly", - }) - // } + + this.Initializatio_data(); + this.state.Newedit === false; + this.setState({ + Newedit: false, + mysave: false, + readOnlys: "readOnly", + }) + // } // } console.log("问卷返回"); console.log(this.props); try { - if(this.props.current_user!==undefined){ + if (this.props.current_user !== undefined) { this.setState({ - first_category_url :this.props.current_user.first_category_url, + first_category_url: this.props.current_user.first_category_url, }); console.log("======================="); console.log(this.props.current_user.first_category_url); } - }catch (e) { + } catch (e) { console.log("12312312312") console.log(e); } @@ -152,12 +155,12 @@ class PollNewQuestbank extends Component { // console.log("componentDidUpdate"); // console.log(prevProps); // console.log(this.props); - if(prevProps.current_user!=this.props.current_user){ - if(this.props.current_user!==undefined){ + if (prevProps.current_user != this.props.current_user) { + if (this.props.current_user !== undefined) { // console.log(this.props.current_user.login); // console.log(prevProps.current_user.login); this.setState({ - first_category_url :this.props.current_user.first_category_url, + first_category_url: this.props.current_user.first_category_url, }) } } @@ -243,7 +246,7 @@ class PollNewQuestbank extends Component { } else { const url = `/exercise_banks/${pollid}.json`; axios.get(url).then((result) => { - if (result){ + if (result) { console.log("247"); console.log(result); @@ -251,10 +254,10 @@ class PollNewQuestbank extends Component { } - if(result.data){ - if(result.data.poll){ - if(result.data.poll.polls_name){ - let num = parseInt(result.data.poll.polls_name.length); + if (result.data) { + if (result.data.poll) { + if (result.data.poll.polls_name) { + let num = parseInt(result.data.poll.polls_name.length); this.setState({ addonAfter: num < 0 ? 0 : num }) @@ -266,7 +269,7 @@ class PollNewQuestbank extends Component { this.setState({ projects: result.data, pollid: pollid, - polls_status: result.data.poll.is_public===false?1:2, + polls_status: result.data.poll.is_public === false ? 1 : 2, polls_name: result.data.poll.name, polls_description: result.data.poll.description, poll_questions: result.data.questions, @@ -278,16 +281,29 @@ class PollNewQuestbank extends Component { polls_nametest: result.data.poll.name, polls_descriptiontest: result.data.poll.description, questionnair: true, - left_banner_id:result.data.left_banner_id + left_banner_id: result.data.left_banner_id }) - if(result.data.poll.name){ - if(result.data.poll.name.length>0){ - this.setState({ - addonAfter:result.data.poll.name.length, - }) + if (result.data.poll.name) { + if (result.data.poll.name.length > 0) { + this.setState({ + addonAfter: result.data.poll.name.length, + }) + } + } + try { + const crumbData={ + title:'编辑', + is_public:result && result.data && result.data.is_public, + crumbArray:[ + {to:`/banks/poll/${pollid}`,content:'详情'}, + {content:'编辑'} + ] } - } + this.props.initPublic(crumbData); + }catch (e) { + + } }).catch((error) => { console.log(error) }) @@ -311,33 +327,30 @@ class PollNewQuestbank extends Component { const url = `/exercise_banks/${pollidsy}.json`; axios.get(url).then((result) => { - if (result !== undefined){ - this.setState({ - projects: result.data, - pollid: pollid, - polls_status: result.data.poll.is_public===false?1:2, - polls_name: result.data.poll.name, - polls_description: result.data.poll.description, - poll_questions: result.data.questions, - question_types: result.data.question_types, - mysingles: result.data.question_types.q_singles, - mydoubles: result.data.question_types.q_doubles, - mymainsint: result.data.question_types.q_mains, - q_counts: result.data.question_types.q_counts, - polls_nametest: result.data.poll.name, - polls_descriptiontest: result.data.poll.description, - questionnair: true, - left_banner_id:result.data.left_banner_id - }); - - - + if (result !== undefined) { + this.setState({ + projects: result.data, + pollid: pollidsy, + polls_status: result.data.poll.is_public === false ? 1 : 2, + polls_name: result.data.poll.name, + polls_description: result.data.poll.description, + poll_questions: result.data.questions, + question_types: result.data.question_types, + mysingles: result.data.question_types.q_singles, + mydoubles: result.data.question_types.q_doubles, + mymainsint: result.data.question_types.q_mains, + q_counts: result.data.question_types.q_counts, + polls_nametest: result.data.poll.name, + polls_descriptiontest: result.data.poll.description, + questionnair: true, + left_banner_id: result.data.left_banner_id + }); - if(result.data.poll.name){ - if(result.data.poll.name.length>0){ + if (result.data.poll.name) { + if (result.data.poll.name.length > 0) { this.setState({ - addonAfter:result.data.poll.name.length, + addonAfter: result.data.poll.name.length, }) } } @@ -346,7 +359,6 @@ class PollNewQuestbank extends Component { // console.log("有问卷~~~") - // } }).catch((error) => { console.log(error) @@ -384,7 +396,7 @@ class PollNewQuestbank extends Component { }) } this.setState({ - Newdisplay:true, + Newdisplay: true, }) var Insertposition = this.state.poll_questions.length; // console.log(JSON.stringify(this.state.poll_questions)); @@ -407,7 +419,7 @@ class PollNewQuestbank extends Component { }) } this.setState({ - Newdisplay:true, + Newdisplay: true, }) var Insertposition = this.state.poll_questions.length; // console.log(JSON.stringify(this.state.poll_questions)); @@ -426,7 +438,7 @@ class PollNewQuestbank extends Component { //添加主观题目 addmymainsint = () => { this.setState({ - Newdisplay:true, + Newdisplay: true, }) var Insertposition = this.state.poll_questions.length; // console.log(JSON.stringify(this.state.poll_questions)); @@ -453,7 +465,7 @@ class PollNewQuestbank extends Component { var anserbool = false; this.setState({ q_countst: 1, - bindingid:object.question.id + bindingid: object.question.id }) // window.scrollTo(0, this.refs.targetElement.offsetTops) let {adddom} = this.state; @@ -631,13 +643,13 @@ class PollNewQuestbank extends Component { var question = {} var questiontwo = { // "id": this.state.poll_questions[arr.length - 1].question.id + 1 + arrr.length, - "id": Whether=== true? id :this.state.poll_questions[newarr.length - 1].question.id, + "id": Whether === true ? id : this.state.poll_questions[newarr.length - 1].question.id, "is_necessary": 1, "question_number": 1, "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 : this.state.poll_questions[newarr.length - 1].question.id + 1, "answers": [ {"answer_id": 1, "answer_position": 1, "answer_text": ""}, {"answer_id": 2, "answer_position": 2, "answer_text": ""}, @@ -659,7 +671,7 @@ class PollNewQuestbank extends Component { //插入多选题 var question = {} var questiontwo = { - "id": Whether=== true? id :this.state.poll_questions[newarr.length - 1].question.id, + "id": Whether === true ? id : this.state.poll_questions[newarr.length - 1].question.id, "is_necessary": 1, "question_number": 2, "question_title": "", @@ -667,7 +679,7 @@ class PollNewQuestbank 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 : this.state.poll_questions[newarr.length - 1].question.id + 1, "answers": [ {"answer_id": 1, "answer_position": 1, "answer_text": ""}, {"answer_id": 2, "answer_position": 2, "answer_text": ""}, @@ -690,13 +702,13 @@ class PollNewQuestbank extends Component { // console.log(this.state.poll_questions[newarr.length - 1].question.id); var question = {} var questiontwo = { - "id": Whether=== true? id :this.state.poll_questions[newarr.length - 1].question.id, + "id": Whether === true ? id : this.state.poll_questions[newarr.length - 1].question.id, "is_necessary": 1, "question_number": 3, "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 : this.state.poll_questions[newarr.length - 1].question.id + 1, "answers": [] }; question = {"question": questiontwo}; @@ -716,17 +728,17 @@ class PollNewQuestbank extends Component { try { ids = this.state.poll_questions[newarr.length - 1].question.id; } catch (e) { - ids= 1; + ids = 1; } var questiontwo = { // "id": this.state.poll_questions[arr.length - 1].question.id + 1 + arrr.length, - "id": Whether=== true? id :ids, + "id": Whether === true ? id : ids, "is_necessary": 1, "question_number": 1, "question_title": "", "question_type": 1, "new": "new", - "newid":Whether=== true? id :ids+ 1, + "newid": Whether === true ? id : ids + 1, "answers": [ {"answer_id": 1, "answer_position": 1, "answer_text": ""}, {"answer_id": 2, "answer_position": 2, "answer_text": ""}, @@ -753,7 +765,7 @@ class PollNewQuestbank extends Component { ids = 1; } var questiontwo = { - "id": Whether=== true? id :ids, + "id": Whether === true ? id : ids, "is_necessary": 1, "question_number": 2, "question_title": "", @@ -761,7 +773,7 @@ class PollNewQuestbank extends Component { "max_choices": 0, "min_choices": 0, "new": "new", - "newid":Whether=== true? id :ids+1, + "newid": Whether === true ? id : ids + 1, "answers": [ {"answer_id": 1, "answer_position": 1, "answer_text": ""}, {"answer_id": 2, "answer_position": 2, "answer_text": ""}, @@ -783,18 +795,18 @@ class PollNewQuestbank extends Component { //插入主观题 var ids; try { - ids= this.state.poll_questions[newarr.length - 1].question.id; + ids = this.state.poll_questions[newarr.length - 1].question.id; } catch (e) { ids = 1; } var questiontwo = { - "id":Whether=== true? id : ids, + "id": Whether === true ? id : ids, "is_necessary": 1, "question_number": 3, "question_title": "", "question_type": 3, "new": "new", - "newid":Whether=== true? id :ids + 1, + "newid": Whether === true ? id : ids + 1, "answers": [] }; question = {"question": questiontwo}; @@ -809,53 +821,55 @@ class PollNewQuestbank extends Component { } //删除指定条目 - Deleteadddom = (indexo,bool) => { + Deleteadddom = (indexo, bool) => { // console.log("deleteadddom 259") var arr = this.state.adddom; let newarr = [...arr]; newarr.splice(indexo, 1); - if(bool === true) { + if (bool === true) { this.setState({ adddom: newarr, q_countst: 0, problemtopic: null, problemtopicbool: false, - bindingid:undefined, - Newdisplay:false, + bindingid: undefined, + Newdisplay: false, newoption: false, }) - }else{ + } else { this.setState({ adddom: newarr, q_countst: 0, problemtopic: null, problemtopicbool: false, - Newdisplay:false, + Newdisplay: false, newoption: false, }) } - } //保存并继续 //保存并继续,即提交本题的新建并继续创建一个相同的题(该新题处于编辑模式,题目和选项不要清空) - Deleteadddomtwo = (indexo, object,bool) => { + Deleteadddomtwo = (indexo, object, bool) => { var thiss = this; - if(bool === true){ + if (bool === true) { this.setState({ q_countst: 1, - bindingid:undefined, - Newdisplay:false, + bindingid: undefined, + Newdisplay: false, }) - }else { + } else { this.setState({ q_countst: 1, - Newdisplay:false, + Newdisplay: false, }) } + if (object.question.question_type === 3) { + this.HandleInputTopics(this.contentMdRef.current.getValue().trim(), indexo); + } var poll_questionslength = this.state.poll_questions.length; // console.log("deleteadddomtwo|||||||||||||||||||||||||||||||||||||||||\\"); // console.log(indexo); @@ -881,10 +895,12 @@ class PollNewQuestbank extends Component { console.log(e) } } - if (newarr[indexo].question.question_title === "") { - this.props.showNotification(`题目不能为空`); + if (object.question.question_type !== 3) { + if (newarr[indexo].question.question_title === "") { + this.props.showNotification(`题目不能为空`); - return + return + } } if (max > 0) { if (object.question.question_type === 1) { @@ -912,8 +928,6 @@ class PollNewQuestbank extends Component { } - - if (object.question.question_type === 2) { if (object.question.max_choices > 0) { // if (object.question.min_choices < 2) { @@ -988,7 +1002,7 @@ class PollNewQuestbank extends Component { if (this.state.problemtopicbool === true) { insindex = this.state.problemtopic; } - this.createquestionsandanswers(object, 1, arrc, null, 0, 0, insindex); + this.createquestionsandanswers(object, 1, arrc, null, 0, 0, insindex,0); // newarrpoll.push(question); newarrpoll.splice(thiss.state.Insertposition, 0, question); @@ -1048,7 +1062,7 @@ class PollNewQuestbank extends Component { if (this.state.problemtopicbool === true) { insindex = this.state.problemtopic; } - this.createquestionsandanswers(object, 2, arrc, null, object.question.max_choices, object.question.min_choices, insindex); + this.createquestionsandanswers(object, 2, arrc, null, object.question.max_choices, object.question.min_choices, insindex,object.question.answers.length); //插入多选题 // if (object.question.max_choices > arrc.length) { // // console.log("选择题的最大可选项不能大于选项数") @@ -1066,6 +1080,7 @@ class PollNewQuestbank extends Component { // newarrpoll.push(question); newarrpoll.splice(thiss.state.Insertposition, 0, question); } else if (object.question.question_type === 3) { + // this.HandleInputTopics(this.contentMdRef.current.getValue().trim(),indexo); //插入主观题 var answers = []; var questiontwo = {}; @@ -1103,7 +1118,7 @@ class PollNewQuestbank extends Component { "id": null, "is_necessary": object.question.is_necessary, "question_number": 3, - "question_title": object.question.question_title, + "question_title": this.contentMdRef.current.getValue().trim(), "question_type": 3, "new": "", "answers": answers @@ -1118,7 +1133,7 @@ class PollNewQuestbank extends Component { if (this.state.problemtopicbool === true) { insindex = this.state.problemtopic; } - this.createquestionsandanswers(object, 3, null, null, 0, 0, insindex); + this.createquestionsandanswers(object, 3, null, null, 0, 0, insindex,0); // newarrpoll.push(question); newarrpoll.splice(thiss.state.Insertposition, 0, question); } @@ -1181,11 +1196,11 @@ class PollNewQuestbank extends Component { question = {"question": questiontwo}; if (uuk !== -1) { // console.log("修改") - this.edittotheserver(object, 1, arrc, null, 0, 0); + this.edittotheserver(object, 1, arrc, null, 0, 0,0); newarrpoll.splice(uuk, 1, question); } else { // console.log("他原来的删除掉了") - this.createquestionsandanswers(object, 1, arrc, null, 0, 0, object.question.id); + this.createquestionsandanswers(object, 1, arrc, null, 0, 0, object.question.id,0); newarrpoll.push(question); } newarr[indexo].question.new = "new" @@ -1252,16 +1267,18 @@ class PollNewQuestbank extends Component { // } if (uuk !== -1) { // console.log("修改") - this.edittotheserver(object, 2, arrc, null, object.question.max_choices, object.question.min_choices); + this.edittotheserver(object, 2, arrc, null, object.question.max_choices, object.question.min_choices,object.question.answers.length); newarrpoll.splice(uuk, 1, question); } else { // console.log("删除") - this.createquestionsandanswers(object, 2, arrc, null, object.question.max_choices, object.question.min_choices, object.question.id); + this.createquestionsandanswers(object, 2, arrc, null, object.question.max_choices, object.question.min_choices, object.question.id,object.question.answers.length); newarrpoll.push(question); } // console.log(newarrpoll) newarr[indexo].question.new = "new" } else if (object.question.question_type === 3) { + // this.HandleInputTopics(this.contentMdRef.current.getValue().trim(),indexo); + //插入主观题 var answers = []; var questiontwo = {}; @@ -1289,7 +1306,7 @@ class PollNewQuestbank extends Component { "id": object.question.id, "is_necessary": object.question.is_necessary, "question_number": 3, - "question_title": object.question.question_title, + "question_title": this.contentMdRef.current.getValue().trim(), "question_type": 3, "new": "", "answers": answers @@ -1298,11 +1315,11 @@ class PollNewQuestbank extends Component { if (uuk !== -1) { // console.log("修改") - this.edittotheserver(object, 3, null, null, 0, 0); + this.edittotheserver(object, 3, null, null, 0, 0,0); newarrpoll.splice(uuk, 1, question); } else { // console.log("删除") - this.createquestionsandanswers(object, 3, null, null, 0, 0, object.question.id); + this.createquestionsandanswers(object, 3, null, null, 0, 0, object.question.id,0); newarrpoll.push(question); } // console.log(newarrpoll) @@ -1342,15 +1359,19 @@ class PollNewQuestbank extends Component { //保存,即完成新建并退出本题编辑 // indexo 第几个数组 //object 单个数组数据 - Deleteadddomthree = (indexo, object,bool) => { - if(bool === true) { + Deleteadddomthree = (indexo, object, bool) => { + if (bool === true) { this.setState({ - bindingid:undefined, + bindingid: undefined, }) } this.setState({ - Newdisplay:false, - }) + Newdisplay: false, + }); + if (object.question.question_type === 3) { + this.HandleInputTopics(this.contentMdRef.current.getValue().trim(), indexo); + + } // console.log("deleteadddom 349") var thiss = this; let arr = this.state.adddom; @@ -1374,9 +1395,11 @@ class PollNewQuestbank extends Component { // console.log(e) } } - if (newarr[indexo].question.question_title === "") { - this.props.showNotification('题目不能为空!'); - return + if (object.question.question_type !== 3) { + if (newarr[indexo].question.question_title === "") { + this.props.showNotification('题目不能为空!'); + return + } } if (max > 0) { if (object.question.question_type === 1) { @@ -1401,7 +1424,6 @@ class PollNewQuestbank extends Component { } - if (object.question.question_type === 2) { if (object.question.max_choices > 0) { // if (object.question.min_choices < 2) { @@ -1470,7 +1492,7 @@ class PollNewQuestbank extends Component { if (this.state.problemtopicbool === true) { insindex = this.state.problemtopic; } - this.createquestionsandanswers(object, 1, arrc, null, 0, 0, insindex); + this.createquestionsandanswers(object, 1, arrc, null, 0, 0, insindex,0); newarrpoll.splice(thiss.state.Insertposition, 0, question); } else if (object.question.question_type === 2) { //插入多选题 @@ -1524,12 +1546,14 @@ class PollNewQuestbank extends Component { if (this.state.problemtopicbool === true) { insindex = this.state.problemtopic; } - this.createquestionsandanswers(object, 2, arrc, null, object.question.max_choices, object.question.min_choices, insindex); + this.createquestionsandanswers(object, 2, arrc, null, object.question.max_choices, object.question.min_choices, insindex,object.question.answers.length); //插入多选题 // if (object.question.max_choices > arrc.length) { newarrpoll.splice(thiss.state.Insertposition, 0, question); } else if (object.question.question_type === 3) { + // this.HandleInputTopics(this.contentMdRef.current.getValue().trim(),indexo); + //插入主观题 var answers = []; var questiontwo = {}; @@ -1560,7 +1584,7 @@ class PollNewQuestbank extends Component { "id": null, "is_necessary": object.question.is_necessary, "question_number": 3, - "question_title": object.question.question_title, + "question_title": this.contentMdRef.current.getValue().trim(), "question_type": 3, "new": "", "answers": answers @@ -1572,7 +1596,7 @@ class PollNewQuestbank extends Component { if (this.state.problemtopicbool === true) { insindex = this.state.problemtopic; } - this.createquestionsandanswers(object, 3, null, null, 0, 0, insindex); + this.createquestionsandanswers(object, 3, null, null, 0, 0, insindex,0); // newarrpoll.push(question); newarrpoll.splice(thiss.state.Insertposition, 0, question); } @@ -1633,11 +1657,11 @@ class PollNewQuestbank extends Component { question = {"question": questiontwo}; if (uuk !== -1) { // console.log("修改") - this.edittotheserver(object, 1, arrc, null, 0, 0); + this.edittotheserver(object, 1, arrc, null, 0, 0,0); newarrpoll.splice(uuk, 1, question); } else { // console.log("删除") - this.createquestionsandanswers(object, 1, arrc, null, 0, 0, object.question.id); + this.createquestionsandanswers(object, 1, arrc, null, 0, 0, object.question.id,0); newarrpoll.push(question); } // console.log(newarrpoll) @@ -1689,16 +1713,18 @@ class PollNewQuestbank extends Component { //插入多选题 if (uuk !== -1) { // console.log("修改") - this.edittotheserver(object, 2, arrc, null, object.question.max_choices, object.question.min_choices); + this.edittotheserver(object, 2, arrc, null, object.question.max_choices, object.question.min_choices,object.question.answers.length); newarrpoll.splice(uuk, 1, question); } else { // console.log("删除") - this.createquestionsandanswers(object, 2, arrc, null, object.question.max_choices, object.question.min_choices, object.question.id); + this.createquestionsandanswers(object, 2, arrc, null, object.question.max_choices, object.question.min_choices, object.question.id,object.question.answers.length); newarrpoll.push(question); } // console.log(newarrpoll) } else if (object.question.question_type === 3) { + // this.HandleInputTopics(this.contentMdRef.current.getValue().trim(),indexo); + //插入主观题 var answers = []; var questiontwo = {}; @@ -1726,7 +1752,7 @@ class PollNewQuestbank extends Component { "id": object.question.id, "is_necessary": object.question.is_necessary, "question_number": 3, - "question_title": object.question.question_title, + "question_title": this.contentMdRef.current.getValue().trim(), "question_type": 3, "new": "", "answers": answers @@ -1734,11 +1760,11 @@ class PollNewQuestbank extends Component { question = {"question": questiontwo}; if (uuk !== -1) { // console.log("修改") - this.edittotheserver(object, 3, null, null, 0, 0); + this.edittotheserver(object, 3, null, null, 0, 0,0); newarrpoll.splice(uuk, 1, question); } else { // console.log("删除") - this.createquestionsandanswers(object, 3, null, null, 0, 0, object.question.id); + this.createquestionsandanswers(object, 3, null, null, 0, 0, object.question.id,0); newarrpoll.push(question); } // console.log(newarrpoll) @@ -1774,7 +1800,7 @@ class PollNewQuestbank extends Component { ////新增到服务器中 - createquestionsandanswers = (object, number, option, other, max_choices, min_choices, insert_id) => { + createquestionsandanswers = (object, number, option, other, max_choices, min_choices, insert_id,length) => { var thiss = this; var poll_id = this.state.pollid; var urlly = `/poll_bank_questions.json`; @@ -1788,12 +1814,12 @@ class PollNewQuestbank extends Component { min_choicess = min_choices; } axios.post(urlly, { - exercise_bank_id:poll_id, + exercise_bank_id: poll_id, question_title: object.question.question_title, question_type: number, is_necessary: object.question.is_necessary, - max_choices: max_choicess, - min_choices: min_choicess, + max_choices: max_choicess===undefined?length:max_choicess===null?length:max_choicess===0?length:max_choicess, + min_choices: min_choicess===undefined?2:min_choicess===null?2:min_choicess===0?2:min_choicess, question_answers: option, question_other_answer: null, insert_id: insert_id @@ -1824,7 +1850,7 @@ class PollNewQuestbank extends Component { } ///编辑修改到服务器当中 - edittotheserver = (object, number, option, other, max_choices, min_choices) => { + edittotheserver = (object, number, option, other, max_choices, min_choices,length) => { // console.log("调用了edittotheserver") var url = `/poll_bank_questions/${object.question.id}.json` var thiss = this; @@ -1833,8 +1859,8 @@ class PollNewQuestbank extends Component { question_title: object.question.question_title, question_type: number, is_necessary: object.question.is_necessary, - max_choices: max_choices, - min_choices: min_choices, + max_choices: max_choicess===undefined?length:max_choicess===null?length:max_choicess===0?length:max_choicess, + min_choices: min_choicess===undefined?2:min_choicess===null?2:min_choicess===0?2:min_choicess, question_answers: option, question_other_answer: null, }).then((result) => { @@ -2111,9 +2137,9 @@ class PollNewQuestbank extends Component { //i外层数组 //k为内层数组 HandleInputChanges = (e, i, k) => { - console.log("handleInputChanges"+" "+e); - console.log("handleInputChanges"+" "+i); - console.log("handleInputChanges"+" "+k); + console.log("handleInputChanges" + " " + e); + console.log("handleInputChanges" + " " + i); + console.log("handleInputChanges" + " " + k); // console.log("handleInputChanges 612") let value = e.target.value;//取到input的数据 @@ -2144,6 +2170,19 @@ class PollNewQuestbank extends Component { }) } + HandleInputTopics = (value, i) => { + console.log("handleInputTopic 633") + console.log(value); + //取到input的数据 + // console.log("handleInputTopic value is :" + value); + // console.log(i); + let arr = this.state.adddom; + let newarr = [...arr]; + newarr[i].question.question_title = value + this.setState({ + adddom: newarr + }) + } //最小值 HandleGradationGroupChangee = (value, index, max, length) => { // console.log("最小值"); @@ -2188,7 +2227,7 @@ class PollNewQuestbank extends Component { } //最大值 - HandleGradationGroupChangeee = (value, index,minchoices,length) => { + HandleGradationGroupChangeee = (value, index, minchoices, length) => { // console.log("2112"); // console.log(value); // console.log(minchoices); @@ -2200,20 +2239,18 @@ class PollNewQuestbank extends Component { let arr = this.state.adddom; for (var i = 0; i < arr.length; i++) { if (index === i) { - if(parseInt(value)===0&&parseInt(minchoices)===0){ - arr[i].question.min_choices= parseInt(0); + if (parseInt(value) === 0 && parseInt(minchoices) === 0) { + arr[i].question.min_choices = parseInt(0); arr[i].question.max_choices = parseInt(0); - }else if(parseInt(minchoices)===0){ - arr[i].question.min_choices= parseInt(2); + } else if (parseInt(minchoices) === 0) { + arr[i].question.min_choices = parseInt(2); arr[i].question.max_choices = parseInt(value); - } - else if(parseInt(value)===0&&parseInt(minchoices)>0){ - arr[i].question.min_choices= parseInt(minchoices); + } else if (parseInt(value) === 0 && parseInt(minchoices) > 0) { + arr[i].question.min_choices = parseInt(minchoices); + arr[i].question.max_choices = parseInt(value); + } else { + arr[i].question.min_choices = minchoices === null ? 2 : minchoices === undefined ? 2 : minchoices === 0 ? 2 : parseInt(minchoices); arr[i].question.max_choices = parseInt(value); - } - else { - arr[i].question.min_choices= minchoices===null?2:minchoices===undefined?2:minchoices===0?2:parseInt(minchoices); - arr[i].question.max_choices = parseInt(value); } } } @@ -2249,7 +2286,7 @@ class PollNewQuestbank extends Component { } // if(mews ==="new"){ - if(this.state.poll_questions&&this.state.poll_questions.length===0){ + if (this.state.poll_questions && this.state.poll_questions.length === 0) { this.props.showNotification("至少创建1个题目"); return; } @@ -2330,15 +2367,15 @@ class PollNewQuestbank extends Component { this.setState({ mysave: false, readOnlys: "readOnly", - storagedesc:this.state.polls_nametest, - storagedesctwo:this.state.polls_descriptiontest, + storagedesc: this.state.polls_nametest, + storagedesctwo: this.state.polls_descriptiontest, }) } else if (this.state.mysave === false) { this.setState({ mysave: true, readOnlys: "", - storagedesc:this.state.polls_nametest, - storagedesctwo:this.state.polls_descriptiontest, + storagedesc: this.state.polls_nametest, + storagedesctwo: this.state.polls_descriptiontest, }) } } @@ -2349,16 +2386,16 @@ class PollNewQuestbank extends Component { mysave: false, Newedit: false, readOnlys: "readOnly", - polls_nametest:this.state.storagedesc, - polls_descriptiontest:this.state.storagedesctwo, + polls_nametest: this.state.storagedesc, + polls_descriptiontest: this.state.storagedesctwo, }) } else { this.setState({ mysave: false, Newedit: false, readOnlys: "readOnly", - polls_nametest:this.state.storagedesc, - polls_descriptiontest:this.state.storagedesctwo, + polls_nametest: this.state.storagedesc, + polls_descriptiontest: this.state.storagedesctwo, }) } } @@ -2399,41 +2436,41 @@ class PollNewQuestbank extends Component { // // }) // } else { - if (this.state.polls_nametest === undefined || this.state.polls_nametest === "") { - this.props.showNotification("请输入标题"); - return - } + if (this.state.polls_nametest === undefined || this.state.polls_nametest === "") { + this.props.showNotification("请输入标题"); + return + } - var pollid; - if (this.state.pollid === undefined) { - pollid = this.props.match.params.workid; - } else { - pollid = this.state.pollid; - } + var pollid; + if (this.state.pollid === undefined) { + pollid = this.props.match.params.workid; + } else { + pollid = this.state.pollid; + } - var url = `/exercise_banks/${pollid}.json`; - axios.put(url, { - exercise_name: this.state.polls_nametest, - exercise_description: this.state.polls_descriptiontest - }).then((result) => { - if (result !== undefined) { - this.props.showNotification(`问卷更新成功!`); - this.setState({ - mysave: false, - readOnlys: "readOnly", - }) - } + var url = `/exercise_banks/${pollid}.json`; + axios.put(url, { + exercise_name: this.state.polls_nametest, + exercise_description: this.state.polls_descriptiontest + }).then((result) => { + if (result !== undefined) { + this.props.showNotification(`问卷更新成功!`); + this.setState({ + mysave: false, + readOnlys: "readOnly", + }) + } - }) + }) // } } - gotohome=()=>{ + gotohome = () => { // const { current_user} = this.props - if(this.state.first_category_url){ - window.location.href=this.state.first_category_url; - }else{ + if (this.state.first_category_url) { + window.location.href = this.state.first_category_url; + } else { this.props.history.goBack(); } @@ -2461,7 +2498,8 @@ class PollNewQuestbank extends Component { readOnlys, newoption, cancellation, - left_banner_id + left_banner_id, + addonAftertwo } = this.state //获取老师权限 // console.log("[`${maps[polls_status && polls_status]}`]]"); @@ -2491,7 +2529,7 @@ class PollNewQuestbank extends Component { // console.log(this.state.projects===undefined?"":this.state.projects.poll_questions) var displaymysave = (mysave === true) ? "" : "display:none;"; return ( -
+
{/*提示*/} {Modalstype && Modalstype === true ? : ""} - -
-

- this.gotohome()}>{this.props.coursedata.name} - > +

+ {/*

*/} + {/* this.gotohome()}>{this.props.coursedata.name}*/} + {/* >*/} {/*{*/} {/* this.props.match.params.news === "new"?*/} {/* 问卷*/} {/* :*/} - 问卷 + {/*问卷*/} {/*}*/} - > + {/*>*/} {/*{this.props.match.params.news === undefined ? "新建" : this.props.match.params.news === "new" ? "新建" : "编辑"}*/} - 编辑 + {/* 编辑*/} -

-
+ {/*

*/} + {/*
*/} {/*

{this.props.match.params.news === undefined ? "新建问卷" : this.props.match.params.news === "new" ? "新建问卷" : "编辑问卷"}

*/} -

编辑

+ {/*

编辑

*/} {/*{*/} {/* this.props.match.params.news === "new" ?*/} {/* 返回*/} {/* :*/} - + {/**/} {/*}*/} -
+ {/*
*/} {/**/} { this.state.mysave === false ? -
+ - :"" + : "" } { this.state.mysave === true ? @@ -2574,14 +2609,14 @@ class PollNewQuestbank extends Component { { // this.props.match.params.news === undefined ? "" : this.props.match.params.news === "new" ? // ( - this.state.mysave === false ? -
+ this.state.mysave === false ? + - : "" +
+ : "" // ) - // :"" + // :"" }
@@ -2596,13 +2631,14 @@ class PollNewQuestbank extends Component { ` } -
@@ -2622,11 +2658,12 @@ class PollNewQuestbank extends Component { + maxLength={100} + autoComplete="off" addonAfter={String(addonAftertwo)} + > { this.state.Newedit === true || this.state.mysave === true ?
@@ -2655,11 +2692,10 @@ class PollNewQuestbank extends Component {
-
:"" +
: "" } -

@@ -2681,7 +2717,7 @@ class PollNewQuestbank extends Component { 合计 {this.state.q_counts === undefined ? "" :this.state.q_counts} + style={{color: "#FF6800"}}>{this.state.q_counts === undefined ? "" : this.state.q_counts} 题

} @@ -2712,11 +2748,11 @@ class PollNewQuestbank extends Component { let resultDom; resultDom =

- 第{index + 1}题: + {index + 1}、 {item.question.question_type === 1 ? "(单选题)" : item.question.question_type === 2 ? "(多选题)" : "(主观题)"} + className="color-grey-9 fl">{item.question.question_type === 1 ? "单选题" : item.question.question_type === 2 ? "多选题" : "主观题"} {item.question.is_necessary === 1 ? "必答" : item.question.question_type === 2 ? "选答" : "选答"} + className=" ml10">{item.question.is_necessary === 1 ? "(必答)" : item.question.question_type === 2 ? "(选答)" : "(选答)"} {(item.question.min_choices === undefined && item.question.max_choices === undefined ? "" : item.question.min_choices === null && item.question.max_choices === null ? "" : item.question.min_choices === 0 && item.question.max_choices === 0 ? "" : "可选" + item.question.min_choices + "-" + item.question.max_choices + "项")} { @@ -2747,7 +2783,11 @@ class PollNewQuestbank extends Component { }

-

{item.question.question_title}

+

{item.question.question_title}

{/*
{item.question.question_title}
*/} {item.question.question_type === 1 ?
@@ -2755,8 +2795,15 @@ class PollNewQuestbank extends Component { {item.question.answers === undefined ? "" : item.question.answers.map((items, i) => { return (
- - {items.answer_text} + + {items.answer_text}
) @@ -2773,7 +2820,14 @@ class PollNewQuestbank extends Component { return (
- {items.answer_text} + {items.answer_text}
) })} @@ -2783,7 +2837,8 @@ class PollNewQuestbank extends Component { : item.question.question_type === 3 ? // 主观题 - (
+ (
+
) : (
)}
@@ -2791,37 +2846,47 @@ class PollNewQuestbank extends Component {
{/*这里是编辑和新增的地方*/} { - this.state.bindingid && this.state.bindingid===item.question.id? - (this.state.Newdisplay === false? + this.state.bindingid && this.state.bindingid === item.question.id ? + (this.state.Newdisplay === false ?
-
- {this.state.adddom === undefined ? "" :this.state.adddom===undefined?"": this.state.adddom.length===0?"":item.question.id === this.state.adddom[0].question.id&&this.state.adddom.map((itemo, indexo) => { +
+ {this.state.adddom === undefined ? "" : this.state.adddom === undefined ? "" : this.state.adddom.length === 0 ? "" : item.question.id === this.state.adddom[0].question.id && 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"}}>必答 +
+ {item.question.question_number}、 + {itemo.question.question_type === 1 ? "单选题" : itemo.question.question_type === 2 ? "多选题" : "主观题"} + this.OnCheckAllChange(e, indexo)} + className="lineh-40" + style={{"marginLeft": "20px"}}>必答 - - + { + itemo.question.question_type === 3 ? + + : + + + } {itemo.question.answers === undefined ? "" : itemo.question.answers.map((itemt, indext) => { return (
@@ -2837,11 +2902,11 @@ class PollNewQuestbank extends Component { placeholder='无法编辑!将由参与答题的人手动录入'> {this.state.polls_status === undefined || this.state.polls_status === 1 ? - itemo.question.question_type === 1?( - indext>1? + itemo.question.question_type === 1 ? ( + indext > 1 ? { - itemo.question.question_type === 2 ?"": + itemo.question.question_type === 2 ? "" : this.Deleteentrys(arrid, indext, true)}> + > - :"") - : "":""} + : "") + : "" : ""}

) : (

this.HandleInputChanges(e, indexo, indext)}> {this.state.polls_status === undefined || this.state.polls_status === 1 ? - indext>1? - + indext > 1 ? + this.Deleteentrys(arrid, indext, false)}> - { - itemo.question.answers[itemo.question.answers.length-1].answer_text === "其他"&&itemo.question.answers.length-2===indext? + { + itemo.question.answers[itemo.question.answers.length - 1].answer_text === "其他" && itemo.question.answers.length - 2 === indext ? - this.Ewoption(itemo.question.id, itemo)}> - : itemo.question.answers.length-1===indext? - this.Ewoption(itemo.question.id, itemo)}> - : - } + this.Ewoption(itemo.question.id, itemo)}> + : itemo.question.answers.length - 1 === indext ? + this.Ewoption(itemo.question.id, itemo)}> + : + } - :indext===1&&itemo.question.answers.length===2||indext===1&&itemo.question.answers.length===3? this.Ewoption(itemo.question.id, itemo)}> this.Ewoption(itemo.question.id, itemo)}>:"" + className="color-green font-18 iconfont icon-roundaddfill"> : "" : ""}

)}
@@ -2913,7 +2979,7 @@ class PollNewQuestbank extends Component { {/* onClick={() => this.Ewoption(itemo.question.id, itemo)}>新增选项*/}
{this.state.polls_status === undefined || this.state.polls_status === 1 ? - "" + "" : ""} {this.state.polls_status === undefined || this.state.polls_status === 1 ? @@ -2924,11 +2990,11 @@ class PollNewQuestbank extends Component { : ""} this.Deleteadddom(indexo,true)}>取消 + onClick={() => this.Deleteadddom(indexo, true)}>取消 this.Deleteadddomtwo(indexo, itemo,true)} >保存并继续 + onClick={() => this.Deleteadddomtwo(indexo, itemo, true)}>保存并继续 this.Deleteadddomthree(indexo, itemo,true)}>保存并退出 + onClick={() => this.Deleteadddomthree(indexo, itemo, true)}>保存并退出
@@ -2939,7 +3005,7 @@ class PollNewQuestbank extends Component { : itemo.question.question_type === 2 ? ( //////////////////////////////////////////// 可选 -
+
-- {itemo.question.answers === undefined ? "" : itemo.question.answers.map((itemt, indext) => { return ( - indext >= 1 ? : "" + indext >= 1 ? + : "" ) })} @@ -2977,13 +3044,14 @@ class PollNewQuestbank extends Component { className="ml10 mr10 color-grey-6 lineh-40 fl">~ {/*可选最大*/} - + { + itemo.question.question_type === 3 ? + + : + + + } {itemo.question.answers === undefined ? "" : itemo.question.answers.map((itemt, indext) => { console.log("chishiyong1"); - console.log( itemo.question.answers[itemo.question.answers.length - 1]); + console.log(itemo.question.answers[itemo.question.answers.length - 1]); return (
{itemt.answer_text === undefined ? ( @@ -3128,10 +3206,10 @@ class PollNewQuestbank extends Component { className="mr20 max1010 input-flex-40 TextAreainput" disabled placeholder='无法编辑!将由参与答题的人手动录入'> {this.state.polls_status === undefined || this.state.polls_status === 1 ? - indext>1? - + indext > 1 ? + { - itemo.question.question_type === 2?"": + itemo.question.question_type === 2 ? "" : this.Deleteentrys(arrid, indext, true)}> } - {/* {*/} - {/* itemo.question.answers.length-1=== indext?*/} - {/* this.Ewoption(itemo.question.id, itemo)}>*/} - {/*: */} - {/* }*/} + {/* {*/} + {/* itemo.question.answers.length-1=== indext?*/} + {/* this.Ewoption(itemo.question.id, itemo)}>*/} + {/*: */} + {/* }*/} - :"" + : "" : ""}

) : (

this.HandleInputChanges(e, indexo, indext)}> {this.state.polls_status === undefined || this.state.polls_status === 1 ? - indext>1? - + indext > 1 ? + this.Deleteentrys(arrid, indext, false)}> - { - itemo.question.answers[itemo.question.answers.length - 1].answer_text==="其他"&&itemo.question.answers.length - 2 === indext ? - this.Ewoption(itemo.question.id, itemo)}> - : itemo.question.answers.length - 1 === indext ? - this.Ewoption(itemo.question.id, itemo)}> - : - - } + { + itemo.question.answers[itemo.question.answers.length - 1].answer_text === "其他" && itemo.question.answers.length - 2 === indext ? + this.Ewoption(itemo.question.id, itemo)}> + : itemo.question.answers.length - 1 === indext ? + this.Ewoption(itemo.question.id, itemo)}> + : + + } - :indext===1&&itemo.question.answers.length===2||indext===1&&itemo.question.answers.length===3? this.Ewoption(itemo.question.id, itemo)}> this.Ewoption(itemo.question.id, itemo)}>:"" + className="color-green font-18 iconfont icon-roundaddfill"> : "" : ""}

)}
@@ -3221,11 +3300,11 @@ class PollNewQuestbank extends Component { : ""} this.Deleteadddom(indexo,true)}>取消 + onClick={() => this.Deleteadddom(indexo, true)}>取消 this.Deleteadddomtwo(indexo, itemo,true)}>保存并继续 + onClick={() => this.Deleteadddomtwo(indexo, itemo, true)}>保存并继续 this.Deleteadddomthree(indexo, itemo,true)}>保存并退出 + onClick={() => this.Deleteadddomthree(indexo, itemo, true)}>保存并退出
@@ -3266,7 +3345,8 @@ class PollNewQuestbank extends Component { {itemo.question.answers === undefined ? "" : itemo.question.answers.map((itemt, indext) => { return ( - indext >= 1 ? : "" + indext >= 1 ? + : "" ) })} @@ -3274,13 +3354,14 @@ class PollNewQuestbank extends Component { className="ml10 mr10 color-grey-6 lineh-40 fl">~ {/*可选最大*/} + } - {itemo.question.answers === undefined ? "" : itemo.question.answers.map((itemt, indext) => { console.log("ceshiyong2"); - console.log(itemo.question.answers.length-1); + console.log(itemo.question.answers.length - 1); return (
{itemt.answer_text === undefined ? ( @@ -3439,10 +3529,10 @@ class PollNewQuestbank extends Component { className="mr20 max1010 input-flex-40 TextAreainput" disabled placeholder='无法编辑!将由参与答题的人手动录入'> {polls_status === undefined || polls_status === 1 ? - indext>1? - + indext > 1 ? + { - itemo.question.question_type === 2?"" + itemo.question.question_type === 2 ? "" : this.Deleteentrys(arrid, indext, true)}> - :"" + : "" : ""}

) : (

this.HandleInputChanges(e, indexo, indext)}> {polls_status === undefined || polls_status === 1 ? - (indext>1? + (indext > 1 ? this.Deleteentrys(arrid, indext, false)}> { - itemo.question.answers[itemo.question.answers.length-1].answer_text==="其他"&&itemo.question.answers.length-2===indext? + itemo.question.answers[itemo.question.answers.length - 1].answer_text === "其他" && itemo.question.answers.length - 2 === indext ? this.Ewoption(itemo.question.id, itemo)}> : itemo.question.answers.length - 1 === indext ? - this.Ewoption(itemo.question.id, itemo)}> - : + this.Ewoption(itemo.question.id, itemo)}> + : - + } - :indext===1&&itemo.question.answers.length===2||indext===1&&itemo.question.answers.length===3? this.Ewoption(itemo.question.id, itemo)}>:"") + : indext === 1 && itemo.question.answers.length === 2 || indext === 1 && itemo.question.answers.length === 3 ? + this.Ewoption(itemo.question.id, itemo)}> : "") : ""}

)}
@@ -3517,7 +3608,7 @@ class PollNewQuestbank extends Component { {/* onClick={() => this.Ewoption(itemo.question.id, itemo)}>新增选项*/}
{polls_status === undefined || polls_status === 1 ? - "" + "" : ""} {polls_status === undefined || polls_status === 1 ? @@ -3531,7 +3622,7 @@ class PollNewQuestbank extends Component { onClick={() => this.Deleteadddom(indexo)}>取消 this.Deleteadddomtwo(indexo, itemo)} - > 保存并继续 + > 保存并继续 this.Deleteadddomthree(indexo, itemo)}>保存并退出 @@ -3574,7 +3665,8 @@ class PollNewQuestbank extends Component { {itemo.question.answers === undefined ? "" : itemo.question.answers.map((itemt, indext) => { return ( - indext >= 1 ? : "" + indext >= 1 ? + : "" ) })} @@ -3582,13 +3674,14 @@ class PollNewQuestbank extends Component { className="ml10 mr10 color-grey-6 lineh-40 fl">~ {/*可选最大*/} this.HandleGradationGroupChangeee(value, indexo, itemo.question.min_choices)} + onChange={(value) => this.HandleGradationGroupChangeee(value, indexo, itemo.question.min_choices,itemo.question.answers.length)} value={itemo.question.max_choices === 0 || itemo.question.max_choices === "0" ? "--" : itemo.question.min_choices === null ? "--" : itemo.question.min_choices === undefined ? "--" : itemo.question.max_choices} > @@ -3354,7 +3340,7 @@ class PollNewQuestbank extends Component { className="ml10 mr10 color-grey-6 lineh-40 fl">~ {/*可选最大*/} this.HandleGradationGroupChangeee(value, indexo, itemo.question.min_choices)} + onChange={(value) => this.HandleGradationGroupChangeee(value, indexo, itemo.question.min_choices,itemo.question.answers.length)} value={itemo.question.max_choices === 0 || itemo.question.max_choices === "0" ? "--" : itemo.question.min_choices === null ? "--" : itemo.question.min_choices === undefined ? "--" : itemo.question.max_choices} > From 07dbcfe137163394a0b2bdb68034187fbb8e8bca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Sat, 31 Aug 2019 13:06:57 +0800 Subject: [PATCH 12/22] =?UTF-8?q?=E5=90=88=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../completetaskdetails/Completetaskpage.js | 48 ++++++++++++------- .../comtopicdetails/CompletetopicdePage.js | 48 ++++++++++++------- .../courses/groupjobbank/GroupjobbankPage.js | 46 +++++++++++------- .../questionbank/Generaljobbankdetails.js | 47 +++++++++++------- 4 files changed, 119 insertions(+), 70 deletions(-) diff --git a/public/react/src/modules/courses/completetaskdetails/Completetaskpage.js b/public/react/src/modules/courses/completetaskdetails/Completetaskpage.js index e21021539..440bfb2f7 100644 --- a/public/react/src/modules/courses/completetaskdetails/Completetaskpage.js +++ b/public/react/src/modules/courses/completetaskdetails/Completetaskpage.js @@ -57,7 +57,19 @@ class Completetaskpage extends Component { if(response.data){ this.setState({ datas:response.data, - }) + }); + try { + const crumbData={ + title:response && response.data && response.data.name, + is_public:response && response.data && response.data.is_public, + crumbArray:[ + {content:'详情'} + ] + } + this.props.initPublic(crumbData); + }catch (e) { + + } }else { this.setState({ datas:[], @@ -100,23 +112,23 @@ class Completetaskpage extends Component {
-
-

- 题库 - > - 详情 -

-
-
-

- {datas&&datas.name} -

- -
+ {/*
*/} + {/*

*/} + {/* 题库*/} + {/* >*/} + {/* 详情*/} + {/*

*/} + {/*
*/} + {/*
*/} + {/*

*/} + {/* {datas&&datas.name}*/} + {/*

*/} + {/* */} + {/*
*/}
diff --git a/public/react/src/modules/courses/comtopicdetails/CompletetopicdePage.js b/public/react/src/modules/courses/comtopicdetails/CompletetopicdePage.js index 2dc873167..abe8f3e36 100644 --- a/public/react/src/modules/courses/comtopicdetails/CompletetopicdePage.js +++ b/public/react/src/modules/courses/comtopicdetails/CompletetopicdePage.js @@ -55,7 +55,19 @@ class CompletetopicdePage extends Component { if(response.data){ this.setState({ datas:response.data, - }) + }); + try { + const crumbData={ + title:response && response.data && response.data.name, + is_public:response && response.data && response.data.is_public, + crumbArray:[ + {content:'详情'} + ] + } + this.props.initPublic(crumbData); + }catch (e) { + + } }else { this.setState({ datas:[], @@ -98,23 +110,23 @@ class CompletetopicdePage extends Component {
-
-

- 题库 - > - 详情 -

-
-
-

- {datas&&datas.name} -

- -
+ {/*
*/} + {/*

*/} + {/* 题库*/} + {/* >*/} + {/* 详情*/} + {/*

*/} + {/*
*/} + {/*
*/} + {/*

*/} + {/* {datas&&datas.name}*/} + {/*

*/} + {/* */} + {/*
*/}
diff --git a/public/react/src/modules/courses/groupjobbank/GroupjobbankPage.js b/public/react/src/modules/courses/groupjobbank/GroupjobbankPage.js index 6dba2a1e1..14512f44f 100644 --- a/public/react/src/modules/courses/groupjobbank/GroupjobbankPage.js +++ b/public/react/src/modules/courses/groupjobbank/GroupjobbankPage.js @@ -94,6 +94,18 @@ class GroupjobbankPage extends Component { this.setState({ datas:response.data, }) + try { + const crumbData={ + title:response && response.data && response.data.name, + is_public:response && response.data && response.data.is_public, + crumbArray:[ + {content:'详情'} + ] + } + this.props.initPublic(crumbData); + }catch (e) { + + } }else { this.setState({ datas:[], @@ -135,23 +147,23 @@ class GroupjobbankPage extends Component {
-
-

- 题库 - > - 详情 -

-
-
-

- {datas&&datas.name} -

- -
+ {/*
*/} + {/*

*/} + {/* 题库*/} + {/* >*/} + {/* 详情*/} + {/*

*/} + {/*
*/} + {/*
*/} + {/*

*/} + {/* {datas&&datas.name}*/} + {/*

*/} + {/* */} + {/*
*/}
diff --git a/public/react/src/modules/courses/questionbank/Generaljobbankdetails.js b/public/react/src/modules/courses/questionbank/Generaljobbankdetails.js index 0a29b0864..e91dcf65b 100644 --- a/public/react/src/modules/courses/questionbank/Generaljobbankdetails.js +++ b/public/react/src/modules/courses/questionbank/Generaljobbankdetails.js @@ -61,6 +61,7 @@ class Generaljobbankdetails extends Component { console.log("Generaljobbankdetails"); console.log(this.props); this.getonedata(); + } getonedata=()=>{ @@ -90,6 +91,18 @@ class Generaljobbankdetails extends Component { this.setState({ datas:response.data, }) + try { + const crumbData={ + title:response && response.data && response.data.name, + is_public:response && response.data && response.data.is_public, + crumbArray:[ + {content:'详情'} + ] + } + this.props.initPublic(crumbData); + }catch (e) { + + } }else { this.setState({ datas:[], @@ -132,23 +145,23 @@ class Generaljobbankdetails extends Component {
-
-

- 题库 - > - 详情 -

-
-
-

- {datas&&datas.name} -

- -
+ {/*
*/} + {/*

*/} + {/* 题库*/} + {/* >*/} + {/* 详情*/} + {/*

*/} + {/*
*/} + {/*
*/} + {/*

*/} + {/* {datas&&datas.name}*/} + {/*

*/} + {/* */} + {/*
*/}
From 2602913c3b72a96e78c231c5586b2d93acb27362 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Sat, 31 Aug 2019 13:44:00 +0800 Subject: [PATCH 13/22] =?UTF-8?q?=E5=90=88=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Completetaskdetails.js | 20 +++++++++++++++-- .../comtopicdetails/Completetopicdetails.js | 20 +++++++++++++++-- .../groupjobbank/Groupjobbandetails.js | 20 +++++++++++++++-- .../groupjobbank/Groupjobquesanswer.js | 20 +++++++++++++++-- .../courses/questionbank/Generaljobanswer.js | 22 ++++++++++++++++++- .../questionbank/Generaljobbankdetails.js | 2 +- .../courses/questionbank/Generaljobdetails.js | 19 ++++++++++++++-- 7 files changed, 111 insertions(+), 12 deletions(-) diff --git a/public/react/src/modules/courses/completetaskdetails/Completetaskdetails.js b/public/react/src/modules/courses/completetaskdetails/Completetaskdetails.js index 05bb600e9..979e6daf7 100644 --- a/public/react/src/modules/courses/completetaskdetails/Completetaskdetails.js +++ b/public/react/src/modules/courses/completetaskdetails/Completetaskdetails.js @@ -61,8 +61,24 @@ class Groupjobbandetails extends Component { return (
- -
+ { + datas&&(datas.description===null? +
+
+

暂时还没有相关数据哦!

+
+ :datas.description==="null"? +
+
+

暂时还没有相关数据哦!

+
+ : +
+ ) + } + {/*
*/} {datas.attachments === undefined ? "" : datas.attachments.map((item, key) => { return ( diff --git a/public/react/src/modules/courses/comtopicdetails/Completetopicdetails.js b/public/react/src/modules/courses/comtopicdetails/Completetopicdetails.js index 5b15bc7f6..fbfb65d44 100644 --- a/public/react/src/modules/courses/comtopicdetails/Completetopicdetails.js +++ b/public/react/src/modules/courses/comtopicdetails/Completetopicdetails.js @@ -61,8 +61,24 @@ class Completetopicdetails extends Component {
- -
+ { + datas&&(datas.description===null? +
+
+

暂时还没有相关数据哦!

+
+ :datas.description==="null"? +
+
+

暂时还没有相关数据哦!

+
+ : +
+ ) + } + {/*
*/} {datas.attachment_list === undefined ? "" : datas.attachment_list.map((item, key) => { return ( diff --git a/public/react/src/modules/courses/groupjobbank/Groupjobbandetails.js b/public/react/src/modules/courses/groupjobbank/Groupjobbandetails.js index 6b3e817c1..805ca65a0 100644 --- a/public/react/src/modules/courses/groupjobbank/Groupjobbandetails.js +++ b/public/react/src/modules/courses/groupjobbank/Groupjobbandetails.js @@ -62,8 +62,24 @@ class Groupjobbandetails extends Component { return (
- -
+ { + datas&&(datas.description===null? +
+
+

暂时还没有相关数据哦!

+
+ :datas.description==="null"? +
+
+

暂时还没有相关数据哦!

+
+ : +
+ ) + } + {/*
*/} {datas.attachments === undefined ? "" : datas.attachments.map((item, key) => { return ( diff --git a/public/react/src/modules/courses/groupjobbank/Groupjobquesanswer.js b/public/react/src/modules/courses/groupjobbank/Groupjobquesanswer.js index a951769be..e668db7e3 100644 --- a/public/react/src/modules/courses/groupjobbank/Groupjobquesanswer.js +++ b/public/react/src/modules/courses/groupjobbank/Groupjobquesanswer.js @@ -61,8 +61,24 @@ class Groupjobquesanswer extends Component { return (
- -
+ { + datas&&(datas.reference_answer===null? +
+
+

暂时还没有相关数据哦!

+
+ :datas.reference_answer==="null"? +
+
+

暂时还没有相关数据哦!

+
+ : +
+ ) + } + {/*
*/} {datas.attachments === undefined ? "" : } diff --git a/public/react/src/modules/courses/questionbank/Generaljobanswer.js b/public/react/src/modules/courses/questionbank/Generaljobanswer.js index d8d86ffa5..17178ecf9 100644 --- a/public/react/src/modules/courses/questionbank/Generaljobanswer.js +++ b/public/react/src/modules/courses/questionbank/Generaljobanswer.js @@ -59,8 +59,28 @@ class Generaljobanswer extends Component { return (
+ { + datas&&(datas.reference_answer===null? +
+
+

暂时还没有相关数据哦!

+
+ :datas.reference_answer==="null"? +
+
+

暂时还没有相关数据哦!

+
+ : +
+ ) + } + {/*
*/} + + + -
{datas.attachments === undefined ? "" : datas.attachments.map((item, key) => { return ( diff --git a/public/react/src/modules/courses/questionbank/Generaljobbankdetails.js b/public/react/src/modules/courses/questionbank/Generaljobbankdetails.js index e91dcf65b..c355d241a 100644 --- a/public/react/src/modules/courses/questionbank/Generaljobbankdetails.js +++ b/public/react/src/modules/courses/questionbank/Generaljobbankdetails.js @@ -1,6 +1,6 @@ import React, {Component} from "react"; import {Link, NavLink} from 'react-router-dom'; -import {WordsBtn, ActionBtn} from 'educoder'; +import {WordsBtn, ActionBtn,getImageUrl} from 'educoder'; import { Input,Checkbox,Table, Pagination, Modal,Menu, Tooltip,Spin,Button,Form } from "antd"; import axios from 'axios'; import { diff --git a/public/react/src/modules/courses/questionbank/Generaljobdetails.js b/public/react/src/modules/courses/questionbank/Generaljobdetails.js index 64413b368..44f45f2cb 100644 --- a/public/react/src/modules/courses/questionbank/Generaljobdetails.js +++ b/public/react/src/modules/courses/questionbank/Generaljobdetails.js @@ -59,8 +59,24 @@ class Generaljobdetails extends Component { return (
+ { + datas&&(datas.description===null? +
+
+

暂时还没有相关数据哦!

+
+ :datas.description==="null"? +
+
+

暂时还没有相关数据哦!

+
+ : +
+ ) + } -
{datas.attachments === undefined ? "" : datas.attachments.map((item, key) => { return ( @@ -69,7 +85,6 @@ class Generaljobdetails extends Component {
-
From 6b5277c6acc4a8098527fbf9d523cc465adfed58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Sat, 31 Aug 2019 13:48:17 +0800 Subject: [PATCH 14/22] =?UTF-8?q?=E5=90=88=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/questionbank/Generaljobanswer.js | 14 ++++++++------ .../courses/questionbank/Generaljobdetails.js | 10 ++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/public/react/src/modules/courses/questionbank/Generaljobanswer.js b/public/react/src/modules/courses/questionbank/Generaljobanswer.js index 17178ecf9..3fdfe8363 100644 --- a/public/react/src/modules/courses/questionbank/Generaljobanswer.js +++ b/public/react/src/modules/courses/questionbank/Generaljobanswer.js @@ -12,6 +12,7 @@ import { } from "antd"; import GroupPackage from '../groupjobbank/GroupPackage' import './questionbank.css'; +import AttachmentsList from '../../../common/components/attachment/AttachmentList'; class Generaljobanswer extends Component { @@ -78,14 +79,15 @@ class Generaljobanswer extends Component { } {/*
*/} + {datas.attachments === undefined ? "" : + } - - {datas.attachments === undefined ? "" : datas.attachments.map((item, key) => { - return ( - - ) - })} + {/*{datas.attachments === undefined ? "" : datas.attachments.map((item, key) => {*/} + {/* return (*/} + {/* */} + {/* )*/} + {/*})}*/}
diff --git a/public/react/src/modules/courses/questionbank/Generaljobdetails.js b/public/react/src/modules/courses/questionbank/Generaljobdetails.js index 44f45f2cb..9a69ce30d 100644 --- a/public/react/src/modules/courses/questionbank/Generaljobdetails.js +++ b/public/react/src/modules/courses/questionbank/Generaljobdetails.js @@ -12,6 +12,7 @@ import { } from "antd"; import GroupPackage from '../groupjobbank/GroupPackage' import './questionbank.css'; +import AttachmentsList from "../../../common/components/attachment/AttachmentList"; //内容详情 class Generaljobdetails extends Component { @@ -76,13 +77,10 @@ class Generaljobdetails extends Component {
) } + {datas.attachments === undefined ? "" : + } - {datas.attachments === undefined ? "" : datas.attachments.map((item, key) => { - return ( - - ) - })} - +
From 687f52e27c1ce9c9980693e537eeed63d576276d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Sat, 31 Aug 2019 13:51:52 +0800 Subject: [PATCH 15/22] =?UTF-8?q?=E5=90=88=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../completetaskdetails/Completetaskdetails.js | 15 +++++++++------ .../comtopicdetails/Completetopicdetails.js | 15 +++++++++------ .../courses/groupjobbank/Groupjobbandetails.js | 14 +++++++++----- .../courses/questionbank/Generaljobdetails.js | 2 +- 4 files changed, 28 insertions(+), 18 deletions(-) diff --git a/public/react/src/modules/courses/completetaskdetails/Completetaskdetails.js b/public/react/src/modules/courses/completetaskdetails/Completetaskdetails.js index 979e6daf7..a80d306a2 100644 --- a/public/react/src/modules/courses/completetaskdetails/Completetaskdetails.js +++ b/public/react/src/modules/courses/completetaskdetails/Completetaskdetails.js @@ -13,6 +13,8 @@ import { import './completetaskdetails.css'; import GroupPackage from "../groupjobbank/GroupPackage"; import GroupPackage2 from "../groupjobbank/GroupPackage2"; +import AttachmentsList from "../../../common/components/attachment/AttachmentList"; + class Groupjobbandetails extends Component { @@ -80,12 +82,13 @@ class Groupjobbandetails extends Component { } {/*
*/} - {datas.attachments === undefined ? "" : datas.attachments.map((item, key) => { - return ( - - ) - })} - + {/*{datas.attachments === undefined ? "" : datas.attachments.map((item, key) => {*/} + {/* return (*/} + {/* */} + {/* )*/} + {/*})}*/} + {datas.attachments === undefined ? "" : + } diff --git a/public/react/src/modules/courses/comtopicdetails/Completetopicdetails.js b/public/react/src/modules/courses/comtopicdetails/Completetopicdetails.js index fbfb65d44..5d06d24c7 100644 --- a/public/react/src/modules/courses/comtopicdetails/Completetopicdetails.js +++ b/public/react/src/modules/courses/comtopicdetails/Completetopicdetails.js @@ -12,6 +12,7 @@ import { } from "antd"; import GroupPackage from '../groupjobbank/GroupPackage' import './completetopicde.css'; +import AttachmentsList from "../../../common/components/attachment/AttachmentList"; class Completetopicdetails extends Component { @@ -79,12 +80,14 @@ class Completetopicdetails extends Component { ) } {/*
*/} - - {datas.attachment_list === undefined ? "" : datas.attachment_list.map((item, key) => { - return ( - - ) - })} + + {/*{datas.attachment_list === undefined ? "" : datas.attachment_list.map((item, key) => {*/} + {/* return (*/} + {/* */} + {/* )*/} + {/*})}*/} + {datas.attachment_list === undefined ? "" : + }
diff --git a/public/react/src/modules/courses/groupjobbank/Groupjobbandetails.js b/public/react/src/modules/courses/groupjobbank/Groupjobbandetails.js index 805ca65a0..7e73d6546 100644 --- a/public/react/src/modules/courses/groupjobbank/Groupjobbandetails.js +++ b/public/react/src/modules/courses/groupjobbank/Groupjobbandetails.js @@ -12,6 +12,8 @@ import { } from "antd"; import './questionbanks.css'; import GroupPackage from "./GroupPackage"; +import AttachmentsList from "../../../common/components/attachment/AttachmentList"; + import GroupPackage2 from "./GroupPackage2"; @@ -81,11 +83,13 @@ class Groupjobbandetails extends Component { } {/*
*/} - {datas.attachments === undefined ? "" : datas.attachments.map((item, key) => { - return ( - - ) - })} + {/*{datas.attachments === undefined ? "" : datas.attachments.map((item, key) => {*/} + {/* return (*/} + {/* */} + {/* )*/} + {/*})}*/} + {datas.attachments === undefined ? "" : + }
diff --git a/public/react/src/modules/courses/questionbank/Generaljobdetails.js b/public/react/src/modules/courses/questionbank/Generaljobdetails.js index 9a69ce30d..8c870dd68 100644 --- a/public/react/src/modules/courses/questionbank/Generaljobdetails.js +++ b/public/react/src/modules/courses/questionbank/Generaljobdetails.js @@ -80,7 +80,7 @@ class Generaljobdetails extends Component { {datas.attachments === undefined ? "" : } - +
From 25450c34d42d951e6bf59df70a2ac14b257ef00d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Sat, 31 Aug 2019 14:07:52 +0800 Subject: [PATCH 16/22] =?UTF-8?q?=E5=90=88=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/courses/poll/PollNewQuestbank.js | 93 ++++++++++--------- 1 file changed, 48 insertions(+), 45 deletions(-) diff --git a/public/react/src/modules/courses/poll/PollNewQuestbank.js b/public/react/src/modules/courses/poll/PollNewQuestbank.js index ea49425d9..2c5f1a634 100644 --- a/public/react/src/modules/courses/poll/PollNewQuestbank.js +++ b/public/react/src/modules/courses/poll/PollNewQuestbank.js @@ -2250,51 +2250,52 @@ class PollNewQuestbank extends Component { //提交题目//没有就创建新的题库,新建问newz题和保存题目不一样不能同时保存 这里只是新建 和编辑 标题和须知 submitQuestionnaire = () => { + this.props.history.push(`/banks/poll/${pollid}`); // console.log("调用了submitQuestionnaire") - if (this.state.Newedit === true) { - - this.newword(); - - } else { - if (this.state.polls_nametest === undefined || this.state.polls_nametest === "") { - this.props.showNotification("请输入标题"); - return - } - - if (this.state.polls_descriptiontest.length > 100) { - - } - var pollid; - if (this.state.pollid === undefined) { - pollid = this.props.match.params.workid; - } else { - pollid = this.state.pollid; - } - - // if(mews ==="new"){ - if (this.state.poll_questions && this.state.poll_questions.length === 0) { - this.props.showNotification("至少创建1个题目"); - return; - } - // } - - var url = `/polls/${pollid}.json`; - axios.put(url, { - polls_name: this.state.polls_nametest, - polls_description: this.state.polls_descriptiontest - }).then((result) => { - try { - // console.log(JSON.stringify(result)) - if (result.data.status === 0) { - // console.log("更新题目成功") - // this.props.showNotification("保存成功"); - this.props.history.push(`/courses/${this.props.match.params.coursesId}/polls/${pollid}/detail?tab=2`) - } - } catch (e) { - - } - }) - } + // if (this.state.Newedit === true) { + // + // this.newword(); + // + // } else { + // if (this.state.polls_nametest === undefined || this.state.polls_nametest === "") { + // this.props.showNotification("请输入标题"); + // return + // } + // + // if (this.state.polls_descriptiontest.length > 100) { + // + // } + // var pollid; + // if (this.state.pollid === undefined) { + // pollid = this.props.match.params.workid; + // } else { + // pollid = this.state.pollid; + // } + // + // // if(mews ==="new"){ + // if (this.state.poll_questions && this.state.poll_questions.length === 0) { + // this.props.showNotification("至少创建1个题目"); + // return; + // } + // // } + // + // var url = `/polls/${pollid}.json`; + // axios.put(url, { + // polls_name: this.state.polls_nametest, + // polls_description: this.state.polls_descriptiontest + // }).then((result) => { + // try { + // // console.log(JSON.stringify(result)) + // if (result.data.status === 0) { + // // console.log("更新题目成功") + // // this.props.showNotification("保存成功"); + // + // } + // } catch (e) { + // + // } + // }) + // } } cancelmodel = () => { @@ -2470,7 +2471,9 @@ class PollNewQuestbank extends Component { } //试图 toWorkDetail = () => { - this.props.history.push(`/banks/poll/${this.props.match.params.workId} `); + console.log(this.props); + console.log("toWorkDetail"); + this.props.history.push(`/banks/poll/${this.props.match.params.workid}`); this.props.initPublic(undefined); } From 26cdcc5dbbeacff650666c32712f4e59cbfb98f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Sat, 31 Aug 2019 14:26:50 +0800 Subject: [PATCH 17/22] =?UTF-8?q?=E5=90=88=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/courses/poll/PollNewQuestbank.js | 38 +++++++++++++------ 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/public/react/src/modules/courses/poll/PollNewQuestbank.js b/public/react/src/modules/courses/poll/PollNewQuestbank.js index 2c5f1a634..7dc277e69 100644 --- a/public/react/src/modules/courses/poll/PollNewQuestbank.js +++ b/public/react/src/modules/courses/poll/PollNewQuestbank.js @@ -1,6 +1,6 @@ import React, {Component} from "react"; import {Form, Input, Tooltip, Checkbox, Radio, Select, message, Modal, Button} from 'antd' -import {WordsBtn, ActionBtn} from 'educoder' +import {WordsBtn, ActionBtn,WordNumberTextarea} from 'educoder' import {Link} from 'react-router-dom' @@ -2250,7 +2250,8 @@ class PollNewQuestbank extends Component { //提交题目//没有就创建新的题库,新建问newz题和保存题目不一样不能同时保存 这里只是新建 和编辑 标题和须知 submitQuestionnaire = () => { - this.props.history.push(`/banks/poll/${pollid}`); + this.props.history.push(`/banks/poll/${this.props.match.params.workid}`); + this.props.initPublic(undefined); // console.log("调用了submitQuestionnaire") // if (this.state.Newedit === true) { // @@ -2471,8 +2472,8 @@ class PollNewQuestbank extends Component { } //试图 toWorkDetail = () => { - console.log(this.props); - console.log("toWorkDetail"); + // console.log(this.props); + // console.log("toWorkDetail"); this.props.history.push(`/banks/poll/${this.props.match.params.workid}`); this.props.initPublic(undefined); } @@ -2640,19 +2641,32 @@ class PollNewQuestbank extends Component {
问卷须知
- + + {/**/} { this.state.Newedit === true || this.state.mysave === true ?
From 827196d0462e644f4cbc197e2f4adae630b43a46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Sat, 31 Aug 2019 14:44:44 +0800 Subject: [PATCH 18/22] =?UTF-8?q?=E5=90=88=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/courses/poll/PollNewQuestbank.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/courses/poll/PollNewQuestbank.js b/public/react/src/modules/courses/poll/PollNewQuestbank.js index 7dc277e69..9e5882db0 100644 --- a/public/react/src/modules/courses/poll/PollNewQuestbank.js +++ b/public/react/src/modules/courses/poll/PollNewQuestbank.js @@ -2251,7 +2251,7 @@ class PollNewQuestbank extends Component { //提交题目//没有就创建新的题库,新建问newz题和保存题目不一样不能同时保存 这里只是新建 和编辑 标题和须知 submitQuestionnaire = () => { this.props.history.push(`/banks/poll/${this.props.match.params.workid}`); - this.props.initPublic(undefined); + // this.props.initPublic(undefined); // console.log("调用了submitQuestionnaire") // if (this.state.Newedit === true) { // @@ -2475,7 +2475,7 @@ class PollNewQuestbank extends Component { // console.log(this.props); // console.log("toWorkDetail"); this.props.history.push(`/banks/poll/${this.props.match.params.workid}`); - this.props.initPublic(undefined); + // this.props.initPublic(undefined); } render() { From 36eef0dda0459143f09b35d7dffc72f8d1a04e27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Sat, 31 Aug 2019 14:46:40 +0800 Subject: [PATCH 19/22] =?UTF-8?q?=E5=90=88=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../javascripts/admins/shixuns/index.js | 5 +- app/controllers/courses_controller.rb | 2 +- app/services/homeworks_service.rb | 3 + app/templates/shared/main.css | 2 +- .../shixun_work/shixun_work.html.erb | 10 +- .../admins/shixun_settings/index.html.erb | 3 +- .../shixun_settings/shared/_list.html.erb | 16 +- app/views/admins/shixuns/index.html.erb | 4 +- .../admins/shixuns/shared/_list.html.erb | 64 +++--- .../adjust_review_score.json.jbuilder | 3 +- public/react/public/css/css_min_all.css | 2 +- public/react/public/css/edu-common.css | 2 +- public/react/src/App.js | 1 - .../modules/courses/gradinforms/Eduinforms.js | 2 + .../modules/courses/members/studentsList.js | 36 ++-- .../src/modules/courses/new/CoursesNew.js | 7 +- .../src/modules/courses/new/Goldsubject.js | 3 +- .../react/src/modules/courses/poll/PollNew.js | 93 ++++++-- .../shixunHomework/ShixunWorkReport.js | 57 +++-- .../OfficialAcademicTranscript.js | 116 ++++++---- public/react/src/modules/tpm/TPMBanner.js | 2 +- public/react/src/modules/tpm/TPMIndex.js | 39 +++- public/react/src/modules/tpm/TPMIndexHOC.js | 6 +- .../tpm/shixunchild/Repository/Repository.js | 21 +- .../Repository/RepositoryAddFile.js | 203 +++++++++++++++--- public/stylesheets/css/edu-common.css | 2 +- public/stylesheets/educoder/edu-main.css | 2 +- 27 files changed, 504 insertions(+), 202 deletions(-) diff --git a/app/assets/javascripts/admins/shixuns/index.js b/app/assets/javascripts/admins/shixuns/index.js index 62239aa0e..849e13b5b 100644 --- a/app/assets/javascripts/admins/shixuns/index.js +++ b/app/assets/javascripts/admins/shixuns/index.js @@ -5,9 +5,10 @@ $(document).on('turbolinks:load', function() { allowClear: true }); + let search_form = $(".search-form"); + //导出 $(".shixuns-list-form").on("click","#shixuns-export",function () { - let search_form = $(".search-form"); window.location.href = "/admins/shixuns.xls?" + search_form.serialize(); - }) + }); } }); \ No newline at end of file diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index b99cac96a..c16f8a97b 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -27,7 +27,7 @@ class CoursesController < ApplicationController :attahcment_category_list,:export_member_scores_excel, :duplicate_course, :switch_to_teacher, :switch_to_assistant, :switch_to_student, :exit_course, :informs, :update_informs, :online_learning, :update_task_position, :tasks_list, - :join_excellent_course, :export_couser_info, :export_member_act_score] + :join_excellent_course, :export_couser_info, :export_member_act_score, :new_informs] before_action :user_course_identity, except: [:join_excellent_course, :index, :create, :new, :apply_to_join_course, :search_course_list, :get_historical_course_students, :mine, :search_slim, :board_list] before_action :teacher_allowed, only: [:update, :destroy, :settings, :search_teacher_candidate, diff --git a/app/services/homeworks_service.rb b/app/services/homeworks_service.rb index 6659ec760..f6868afba 100644 --- a/app/services/homeworks_service.rb +++ b/app/services/homeworks_service.rb @@ -298,6 +298,9 @@ class HomeworksService else 0 end + else + adjust_score = work.challenge_work_scores.select{|work_score| work_score.challenge_id == game.challenge_id}.last + final_score += adjust_score.score if adjust_score.present? end end diff --git a/app/templates/shared/main.css b/app/templates/shared/main.css index 9e9bc4f50..884f6fa37 100644 --- a/app/templates/shared/main.css +++ b/app/templates/shared/main.css @@ -344,7 +344,7 @@ a.edu-txt-w40,.edu-txt-w40{ width:40px; display: inline-block;text-align: center .bor-grey01{border:1px solid #E6EAEB;} .bor-orange{border:1px solid #FF7500;} .bor-blue{border:1px solid #5faee3;} -.bor-red{border:1px solid #db0505;} +.bor-red{border:1px solid #db0505 !important;} .bor-none{border:none;} .bor-outnone{outline:none; border:0px;} diff --git a/app/templates/shixun_work/shixun_work.html.erb b/app/templates/shixun_work/shixun_work.html.erb index f4aec2ea6..a6ef48c3e 100644 --- a/app/templates/shixun_work/shixun_work.html.erb +++ b/app/templates/shixun_work/shixun_work.html.erb @@ -66,15 +66,19 @@ - - + + + + <% @games.each_with_index do |game, index| %> + <% challenge_score = @homework.challenge_score game.challenge_id %> + <% game_score = @work.work_challenge_score game, challenge_score %> + + <% end %> diff --git a/app/views/admins/shixun_settings/index.html.erb b/app/views/admins/shixun_settings/index.html.erb index 4aacfb22e..8fd7a2526 100644 --- a/app/views/admins/shixun_settings/index.html.erb +++ b/app/views/admins/shixun_settings/index.html.erb @@ -22,8 +22,7 @@ <%= text_field_tag(:keyword, params[:keyword], class: 'form-control col-sm-2 ml-3', placeholder: '输入关键字搜索') %> <%= submit_tag('搜索', class: 'btn btn-primary ml-3','data-disable-with': '搜索中...') %> - <%= link_to "清除",admins_shixun_settings_path(status:nil,tag:nil,search_type:nil,keyword:nil),class: "btn btn-default" %> - + <%= link_to "清除",admins_shixun_settings_path,class: "btn btn-default",'data-disable-with': '清除中...' %> diff --git a/app/views/admins/shixun_settings/shared/_list.html.erb b/app/views/admins/shixun_settings/shared/_list.html.erb index 14a97d002..0235e5ef8 100644 --- a/app/views/admins/shixun_settings/shared/_list.html.erb +++ b/app/views/admins/shixun_settings/shared/_list.html.erb @@ -1,5 +1,5 @@
关卡任务名称开启时间任务名称开启时间 评测次数 完成时间 耗时 经验值关卡得分调分
<%= index + 1 %> @@ -88,6 +92,8 @@ <%= finished_time game.end_time %> <%= ApplicationController.helpers.time_consuming game %> <%= game.final_score %> / <%= game.challenge.all_score %><%= game_score %> / <%= challenge_score %><%= game_score %>
- + @@ -19,11 +19,15 @@ - <% shixun_settings.each_with_index do |shixun,index| %> - - <% page_no = (@params_page.to_i - 1) * 20 + index + 1 %> - <%= render partial: "admins/shixun_settings/shared/td",locals: {shixun: shixun,page_no:page_no} %> - + <% if shixun_settings.present? %> + <% shixun_settings.each_with_index do |shixun,index| %> + + <% page_no = (@params_page.to_i - 1) * 20 + index + 1 %> + <%= render partial: "admins/shixun_settings/shared/td",locals: {shixun: shixun,page_no:page_no} %> + + <% end %> + <% else %> + <%= render 'admins/shared/no_data_for_table' %> <% end %>
序号 ID 实训名称
diff --git a/app/views/admins/shixuns/index.html.erb b/app/views/admins/shixuns/index.html.erb index 23f0b9400..92fa670ba 100644 --- a/app/views/admins/shixuns/index.html.erb +++ b/app/views/admins/shixuns/index.html.erb @@ -3,7 +3,7 @@ <% end %>
- <%= form_tag(admins_shixuns_path, method: :get, class: 'form-inline search-form',remote:true) do %> + <%= form_tag(admins_shixuns_path, method: :get, class: 'form-inline search-form',id:"shixuns-search-form",remote:true) do %>
<% status_options = [['全部', ''], ["编辑中(#{@editing_shixuns})", "editing"], ["待审核(#{@pending_shixuns})", 'pending'], ["已发布(#{@processed_shixuns})", 'processed'],["已关闭(#{@closed_shixuns})",'closed']] %> @@ -22,7 +22,7 @@
<%= text_field_tag(:keyword, params[:keyword], class: 'form-control col-sm-2 ml-3', placeholder: '输入关键字搜索') %> <%= submit_tag('搜索', class: 'btn btn-primary ml-3','data-disable-with': '搜索中...') %> - <%= link_to "清除",admins_shixuns_path(status:nil,tag:nil,search_type:nil,keyword:nil),class: "btn btn-default" %> + <%= link_to "清除",admins_shixuns_path,class: "btn btn-default",id:"shixuns-clear-search",'data-disable-with': '清除中...' %> <% end %> 导出
diff --git a/app/views/admins/shixuns/shared/_list.html.erb b/app/views/admins/shixuns/shared/_list.html.erb index afa457a77..64fb32d56 100644 --- a/app/views/admins/shixuns/shared/_list.html.erb +++ b/app/views/admins/shixuns/shared/_list.html.erb @@ -14,36 +14,40 @@ 操作 - <% shixuns.each_with_index do |shixun,index| %> - - <%= (@params_page.to_i - 1) * 20 + index + 1%> - <%= shixun.identifier %> - <%= link_to overflow_hidden_span(shixun.name), "/shixuns/#{shixun.identifier}", :target => "_blank", :title => shixun.name %> - - <%= shixun.shixun_main_name.nil? ? "--" : shixun.shixun_main_name %> - - - <% if shixun.try(:fork_from).nil? %> - -- - <% else%> - <%= link_to shixun.try(:identifier), shixun_path(shixun.try(:identifier)), target: '_blank'%> - <% end%> - - <%= shixun.challenges.where(:st => 0).size %> - <%= shixun.challenges.where(:st => 1).size %> - <%= shixun_authentication_status shixun %> - <%= link_to shixun.owner.try(:show_real_name),"/users/#{shixun.owner.try(:login)}",target:'_blank' %> - <%= format_time shixun.created_at %> - - class="ml-3 mr5 magic-checkbox" id="join_teacher_homepage_<%= shixun.id %>"> - - - - <% if shixun.status == 0 %> - <%= link_to(l(:button_delete), admins_shixun_path(shixun), :method => :delete, :data => { confirm: "您确定要删除吗?" } ) %> - <% end %> - - + <% if shixuns.present? %> + <% shixuns.each_with_index do |shixun,index| %> + + <%= (@params_page.to_i - 1) * 20 + index + 1%> + <%= shixun.identifier %> + <%= link_to overflow_hidden_span(shixun.name), "/shixuns/#{shixun.identifier}", :target => "_blank", :title => shixun.name %> + + <%= shixun.shixun_main_name.nil? ? "--" : shixun.shixun_main_name %> + + + <% if shixun.try(:fork_from).nil? %> + -- + <% else%> + <%= link_to shixun.try(:identifier), shixun_path(shixun.try(:identifier)), target: '_blank'%> + <% end%> + + <%= shixun.challenges.where(:st => 0).size %> + <%= shixun.challenges.where(:st => 1).size %> + <%= shixun_authentication_status shixun %> + <%= link_to shixun.owner.try(:show_real_name),"/users/#{shixun.owner.try(:login)}",target:'_blank' %> + <%= format_time shixun.created_at %> + + class="ml-3 mr5 magic-checkbox" id="join_teacher_homepage_<%= shixun.id %>"> + + + + <% if shixun.status == 0 %> + <%= link_to(l(:button_delete), admins_shixun_path(shixun), :method => :delete, :data => { confirm: "您确定要删除吗?" } ) %> + <% end %> + + + <% end %> + <% else %> + <%= render 'admins/shared/no_data_for_table' %> <% end %> diff --git a/app/views/student_works/adjust_review_score.json.jbuilder b/app/views/student_works/adjust_review_score.json.jbuilder index 09eab5b66..30fb5b115 100644 --- a/app/views/student_works/adjust_review_score.json.jbuilder +++ b/app/views/student_works/adjust_review_score.json.jbuilder @@ -1,4 +1,5 @@ json.status 0 json.message "调分成功" json.work_score number_with_precision(@work.work_score, precision: 1) -json.challenge_score number_with_precision(@work.final_score, precision: 1) \ No newline at end of file +json.challenge_score number_with_precision(@work.final_score, precision: 1) +json.overall_appraisal @work.overall_appraisal \ No newline at end of file diff --git a/public/react/public/css/css_min_all.css b/public/react/public/css/css_min_all.css index 5ffdc4db7..9bbf43e9b 100755 --- a/public/react/public/css/css_min_all.css +++ b/public/react/public/css/css_min_all.css @@ -533,7 +533,7 @@ input::-ms-clear{display:none;} .bor-grey-d{border:1px solid #ddd;} .bor-grey01{border:1px solid #E6EAEB;} .bor-blue{border:1px solid #5faee3;} -.bor-red{border:1px solid #db0505;} +.bor-red{border:1px solid #db0505 !important;} .bor-none{border:none;} .bor-outnone{outline:none; border:0px;} /*延时*/ diff --git a/public/react/public/css/edu-common.css b/public/react/public/css/edu-common.css index a82fa22d2..6817312ad 100755 --- a/public/react/public/css/edu-common.css +++ b/public/react/public/css/edu-common.css @@ -536,7 +536,7 @@ input::-ms-clear{display:none;} .bor-grey-d{border:1px solid #ddd;} .bor-grey01{border:1px solid #E6EAEB;} .bor-blue{border:1px solid #5faee3;} -.bor-red{border:1px solid #db0505;} +.bor-red{border:1px solid #db0505 !important;} .bor-none{border:none;} .bor-outnone{outline:none; border:0px;} /*延时*/ diff --git a/public/react/src/App.js b/public/react/src/App.js index 88ed43447..eae3630cc 100644 --- a/public/react/src/App.js +++ b/public/react/src/App.js @@ -399,7 +399,6 @@ class App extends Component { path="/interesse" component={Interestpage} /> - diff --git a/public/react/src/modules/courses/gradinforms/Eduinforms.js b/public/react/src/modules/courses/gradinforms/Eduinforms.js index b23c33fbb..ad8f7c4e8 100644 --- a/public/react/src/modules/courses/gradinforms/Eduinforms.js +++ b/public/react/src/modules/courses/gradinforms/Eduinforms.js @@ -398,11 +398,13 @@ class Eduinforms extends Component{
{ informs === null || informs=== undefined ||informs.length === 0 ? + this.state.yslbool===false?

暂时还没有相关数据哦!

+ :"" :
diff --git a/public/react/src/modules/courses/members/studentsList.js b/public/react/src/modules/courses/members/studentsList.js index 8071e2680..0b9a9dc86 100644 --- a/public/react/src/modules/courses/members/studentsList.js +++ b/public/react/src/modules/courses/members/studentsList.js @@ -595,23 +595,25 @@ class studentsList extends Component{ { isAdmin && !isParent && course_group_id != 0 && this.deleteDir()}>删除分班 } { isAdmin && !isParent && course_group_id != 0 && this.renameDir()}>分班重命名 } + .drop_down_menu li a { + padding: 0px; + font-size: 14px; + } + .drop_down_menu { + width: 93px; + } + .drop_down_menu li { + overflow: visible; + width:100%; + box-sizing:boder-box; + float:unset; + } + .drop_down_menu, .drop_down_normal { + padding-top: 10px; + padding-bottom: 8px; + } + + `} { isAdmin &&
  • 导出 diff --git a/public/react/src/modules/courses/new/CoursesNew.js b/public/react/src/modules/courses/new/CoursesNew.js index c3096adeb..bcf5a8c19 100644 --- a/public/react/src/modules/courses/new/CoursesNew.js +++ b/public/react/src/modules/courses/new/CoursesNew.js @@ -808,6 +808,7 @@ class CoursesNew extends Component { ], })( + 公告栏 实训作业 普通作业 分组作业 @@ -869,14 +870,14 @@ class CoursesNew extends Component { })( - {optionschool} )} - + {/*(输入内容出现匹配的下拉菜单←同账号管理的单位信息填写)*/}
    diff --git a/public/react/src/modules/courses/new/Goldsubject.js b/public/react/src/modules/courses/new/Goldsubject.js index 8ef193947..a01821cb1 100644 --- a/public/react/src/modules/courses/new/Goldsubject.js +++ b/public/react/src/modules/courses/new/Goldsubject.js @@ -1026,10 +1026,11 @@ class Goldsubject extends Component { - {optionschool} )} diff --git a/public/react/src/modules/courses/poll/PollNew.js b/public/react/src/modules/courses/poll/PollNew.js index aab316d82..fb079d621 100644 --- a/public/react/src/modules/courses/poll/PollNew.js +++ b/public/react/src/modules/courses/poll/PollNew.js @@ -812,6 +812,7 @@ class PollNew extends Component { problemtopicbool: false, bindingid:undefined, Newdisplay:false, + newoption: false, }) }else{ @@ -821,6 +822,7 @@ class PollNew extends Component { problemtopic: null, problemtopicbool: false, Newdisplay:false, + newoption: false, }) } @@ -834,12 +836,13 @@ class PollNew extends Component { q_countst: 1, bindingid:undefined, Newdisplay:false, - + newoption: false, }) }else { this.setState({ q_countst: 1, Newdisplay:false, + newoption: false, }) } @@ -1350,6 +1353,7 @@ class PollNew extends Component { } this.setState({ Newdisplay:false, + newoption: false, }) // console.log("deleteadddom 349") var thiss = this; @@ -1752,7 +1756,7 @@ class PollNew extends Component { question = {"question": questiontwo}; if (uuk !== -1) { // console.log("修改") - this.edittotheserver(object, 3, null, null, 0, 0,0,0); + this.edittotheserver(object, 3, null, null, 0, 0,0); newarrpoll.splice(uuk, 1, question); } else { // console.log("删除") @@ -1799,27 +1803,49 @@ class PollNew extends Component { var urlly = `/polls/${poll_id}/poll_questions.json` var max_choicess = null; var min_choicess = null; - if (max_choices === 0 && min_choices === 0) { + try { + if (max_choices === 0 && min_choices === 0) { + max_choicess = null; + min_choicess = null; + } else { + max_choicess = max_choices; + min_choicess = min_choices; + } + }catch (e) { max_choicess = null; min_choicess = null; - } else { - max_choicess = max_choices; - min_choicess = min_choices; } - console.log("createquestionsandanswers"); - console.log(max_choicess); - console.log(min_choicess); - console.log(length); - axios.post(urlly, { + // console.log("createquestionsandanswers"); + // console.log(max_choicess); + // console.log(min_choicess); + // console.log(length); + var datay={}; + datay={ question_title: object.question.question_title, question_type: number, is_necessary: object.question.is_necessary, - max_choices: max_choicess===undefined?length:max_choicess===null?length:max_choicess===0?length:max_choicess, - min_choices: min_choicess===undefined?2:min_choicess===null?2:min_choicess===0?2:min_choicess, question_answers: option, question_other_answer: null, insert_id: insert_id - }).then((result) => { + } + try { + if(number===2){ + datay={ + question_title: object.question.question_title, + question_type: number, + is_necessary: object.question.is_necessary, + max_choices: max_choicess===undefined?length:max_choicess===null?length:max_choicess===0?length:max_choicess, + min_choices: min_choicess===undefined?2:min_choicess===null?2:min_choicess===0?2:min_choicess, + question_answers: option, + question_other_answer: null, + insert_id: insert_id + } + } + }catch (e) { + + } + + axios.post(urlly, datay).then((result) => { // try { if (result !== undefined) { if (result.data.status === 0) { @@ -1852,27 +1878,50 @@ class PollNew extends Component { var thiss = this; var max_choicess = null; var min_choicess = null; - if (max_choices === 0 && min_choices === 0) { + try { + if (max_choices === 0 && min_choices === 0) { + max_choicess = null; + min_choicess = null; + } else { + max_choicess = max_choices; + min_choicess = min_choices; + } + }catch (e) { max_choicess = null; min_choicess = null; - } else { - max_choicess = max_choices; - min_choicess = min_choices; } + // console.log("createquestionsandanswers"); // console.log(max_choicess); // console.log(min_choicess); // console.log(length); - axios.put(url, { + var datay={}; + datay={ // debug: true, question_title: object.question.question_title, question_type: number, is_necessary: object.question.is_necessary, - max_choices: max_choicess===undefined?length:max_choicess===null?length:max_choicess===0?length:max_choicess, - min_choices: min_choicess===undefined?2:min_choicess===null?2:min_choicess===0?2:min_choicess, question_answers: option, question_other_answer: null, - }).then((result) => { + }; + try { + if(number===2){ + datay={ + // debug: true, + question_title: object.question.question_title, + question_type: number, + is_necessary: object.question.is_necessary, + max_choices: max_choicess===undefined?length:max_choicess===null?length:max_choicess===0?length:max_choicess, + min_choices: min_choicess===undefined?2:min_choicess===null?2:min_choicess===0?2:min_choicess, + question_answers: option, + question_other_answer: null, + }; + } + }catch (e) { + + } + + axios.put(url,datay).then((result) => { try { if (result.data.status === 0) { this.props.showNotification(`编辑题目成功`); diff --git a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js index 1e6b1d6dc..434101f33 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js @@ -1,8 +1,9 @@ import React, {Component} from "react"; -import {WordsBtn,markdownToHTML} from 'educoder'; +import {WordsBtn,markdownToHTML,ActionBtn,queryString,downloadFile} from 'educoder'; import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal, Table, Divider,InputNumber, Tag,DatePicker,Radio,Tooltip,Spin} from "antd"; import {Link,Switch,Route,Redirect} from 'react-router-dom'; import axios from 'axios'; + import ConclusionEvaluation from './shixunreport/ConclusionEvaluation'; import OfficialAcademicTranscript from './shixunreport/OfficialAcademicTranscript'; import Coursesshixundetails from './shixunreport/Coursesshixundetails'; @@ -28,13 +29,25 @@ class ShixunWorkReport extends Component { spinning:true, DownloadType:false, DownloadMessageval:undefined, + isspinning:false } } -/// 确认是否下载 - confirmysl(url){ - axios.get(url).then((response) => { + /// 确认是否下载 + confirmysl(url,child){ + this.setState({ isspinning: true }) + let params ={} + if(child!=undefined){ + params =child._getRequestParams()!==undefined?child._getRequestParams():{}; + } + console.log("170"); + console.log(params); + const urll=url+`?${queryString.stringify(params)}`; + axios.get(urll+ '&export=true').then((response) => { + if(response===undefined){ + return + } if(response.data.status&&response.data.status===-1){ }else if(response.data.status&&response.data.status===-2){ @@ -54,13 +67,13 @@ class ShixunWorkReport extends Component { } }else { this.props.showNotification(`正在下载中`); - window.open("/api"+url, '_blank'); + window.open("/api"+url+'?export=true', '_blank'); + this.setState({ isspinning: false }) } }).catch((error) => { console.log(error) }); } - Downloadcal=()=>{ this.setState({ DownloadType:false, @@ -69,11 +82,18 @@ class ShixunWorkReport extends Component { } componentDidMount() { + let query = this.props.location.pathname; + const type = query.split('/'); this.setState({ + shixuntypes:type[3], spinning:true }) + this.getdatalist() + } + + getdatalist=()=>{ let homeworkid=this.props.match.params.homeworkid; - let url = `/student_works/${homeworkid}/shixun_work_report.json` + let url = `/student_works/${homeworkid}/shixun_work_report.json` axios.get(url).then((result) => { if (result.data.status === 403||result.data.status === 401||result.data.status === 407||result.data.status === 408) { @@ -90,11 +110,7 @@ class ShixunWorkReport extends Component { spinning:false }) }) - let query = this.props.location.pathname; - const type = query.split('/'); - this.setState({ - shixuntypes:type[3] - }) + } jumptopic=(anchorName)=>{ ; if (anchorName) { @@ -118,6 +134,17 @@ class ShixunWorkReport extends Component { goback = () => { this.props.history.replace(`/courses/${this.props.match.params.coursesId}/shixun_homeworks/${this.state.data.homework_common_id}/list?tab=0`); } + + setupdalist=(challenge_score,overall_appraisal,work_score)=>{ + let {data}=this.state; + let newdata=data; + newdata.challenge_score=challenge_score; + newdata.overall_appraisal=overall_appraisal; + newdata.work_score=work_score; + this.setState({ + data:newdata + }) + } render() { let{data} =this.state; console.log(data) @@ -156,9 +183,9 @@ class ShixunWorkReport extends Component { {/*{this.props.isAdmin()?导出实训报告数据:""}*/} 返回 {this.props.isAdmin() ? this.confirmysl(`/student_works/${homeworkid}/export_shixun_work_report.pdf`)} - >导出实训报告数据 : ""} + > 导出实训报告数据 : ""}
  • @@ -182,6 +209,8 @@ class ShixunWorkReport extends Component { {...this.props} data={data} jumptopic={this.jumptopic} + getdatalist={()=>this.getdatalist()} + setupdalist={(challenge_score,overall_appraisal,work_score)=>this.setupdalist(challenge_score,overall_appraisal,work_score)} />
    diff --git a/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js b/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js index d15e23795..2195228e1 100644 --- a/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js +++ b/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js @@ -9,41 +9,12 @@ class OfficialAcademicTranscript extends Component { super(props); this.state = { loadingstate:true, - datas:undefined + datas:undefined, + customsids:undefined } } componentDidMount() { - - } - myjumptopic=(e)=>{ - console.log("获取到值"); - console.log(e); - this.props.jumptopic(e); - } - - editgame_scores=(score,id)=>{ - if(score!=null&&score!=undefined){ - let work_id=this.props.data.work_id; - let url=`/student_works/${work_id}/adjust_review_score.json` - axios.post(url,{ - type:"report", - score:score, - challenge_id:id - }).then((result)=>{ - if(result.data.status===0){ - this.props.showNotification(result.data.message); - }else{ - this.props.showNotification(result.data.message); - } - }).catch((error)=>{ - - }) - } - } - - render() { - let {data}=this.props; let datas=[]; @@ -62,8 +33,70 @@ class OfficialAcademicTranscript extends Component { // adjustmentminute:asdasd }) }) + + this.setState({ + datas:datas + }) } + } + myjumptopic=(e)=>{ + console.log("获取到值"); + console.log(e); + this.props.jumptopic(e); + } + editgame_scores=(e,id,maxsum)=>{ + let{datas}=this.state; + let newdatas=datas; + let score=e.target.value; + + if(score!=null&&score!=undefined&&score!=""){ + if(score<0){ + this.props.showNotification("不能小于0"); + this.setState({ + customsids:id + }) + }else if(score>maxsum){ + this.props.showNotification(`不能大于关卡分值${maxsum}`); + this.setState({ + customsids:id + }) + }else{ + let work_id=this.props.data.work_id; + let url=`/student_works/${work_id}/adjust_review_score.json` + axios.post(url,{ + type:"report", + score:score, + challenge_id:id + }).then((result)=>{ + if(result.data.status===0){ + // this.props.getdatalist() + this.props.showNotification(result.data.message); + this.props.setupdalist(result.data.challenge_score,result.data.overall_appraisal,result.data.work_score) + newdatas.map((item,key)=>{ + if(item.challenge_id.id===id){ + item.game_scores.game_score=score + } + }) + this.setState({ + datas:newdatas, + customsids:undefined + }) + }else{ + this.props.showNotification(result.data.message); + } + }).catch((error)=>{ + + }) + } + + }else{ + this.props.showNotification("调分为空将不会修改之前的分数"); + } + } + + render() { + let {datas,customsids}=this.state; let columns=[{ title: '关卡', @@ -81,9 +114,11 @@ class OfficialAcademicTranscript extends Component { className:"TaskForms", render: (text, record) => ( - this.myjumptopic("id"+record.customs)} title={record.taskname.name} > - {record.taskname.name}{record.taskname.complete_status===2?延时:record.taskname.complete_status===3?延时:""} - + this.myjumptopic("id"+record.customs)} title={record.taskname.name.length>15?record.taskname.name:""} > + {record.taskname.name} + + {record.taskname.complete_status===2?延时:record.taskname.complete_status===3?延时:""} + ), }, { @@ -156,9 +191,9 @@ class OfficialAcademicTranscript extends Component { render: (text, record) => ( - this.editgame_scores(e,record.challenge_id.id)} - min={0} max={record.game_scores.game_score_full} + this.editgame_scores(e,record.challenge_id.id,record.game_scores.game_score_full)} + // min={0} max={record.game_scores.game_score_full} /> {/*查看*/} @@ -221,11 +256,11 @@ class OfficialAcademicTranscript extends Component { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; - width: 450px; + max-width: 225px; text-align: left !important; } .TaskForms{ - width: 450px; + max-width: 260px; text-align: left !important; padding: 16px !important; } @@ -238,6 +273,9 @@ class OfficialAcademicTranscript extends Component { border-radius: 0px; width: 66px; } + .linhe15{ + line-height: 15px; + } `} {datas===undefined?"": +
    {AccountProfiletype===true? import('./TPMChallengeContainer'), @@ -116,6 +118,13 @@ const TPMUpdatepropaede = Loadable({ }) + +// 版本库添加文件 +const AddFile = Loadable({ + loader: () => import('./shixunchild/Repository/RepositoryAddFile'), + loading: Loading, +}) + const interceptorUrlArray = ['repository.json', 'commits.json', 'propaedeutics.json' , 'challenges.json', 'discusses.json', 'ranking_list.json', 'collaborators.json'] const cacheInterceptorUrlMap = {} @@ -258,15 +267,18 @@ class TPMIndex extends Component { // } render() { - + let url = window.location.href; + let flag = url.indexOf("add_file")>-1; return (
    - - - + { + !flag && + + } + ) }> - () - }> + () + }> + + () + }> {/* */} ') // .attr('href', `${_url_origin}/stylesheets/educoder/antd.min.css?1525440977`)); $('head').append($('') - .attr('href', `${_url_origin}/stylesheets/css/edu-common.css?8`)); + .attr('href', `${_url_origin}/stylesheets/css/edu-common.css?6`)); $('head').append($('') - .attr('href', `${_url_origin}/stylesheets/educoder/edu-main.css?8`)); + .attr('href', `${_url_origin}/stylesheets/educoder/edu-main.css?6`)); // index.html有加载 $('head').append($('') - .attr('href', `${_url_origin}/stylesheets/educoder/edu-all.css?8`)); + .attr('href', `${_url_origin}/stylesheets/educoder/edu-all.css?6`)); // $('head').append($('') diff --git a/public/react/src/modules/tpm/shixunchild/Repository/Repository.js b/public/react/src/modules/tpm/shixunchild/Repository/Repository.js index ea9e51694..973fb30f7 100644 --- a/public/react/src/modules/tpm/shixunchild/Repository/Repository.js +++ b/public/react/src/modules/tpm/shixunchild/Repository/Repository.js @@ -13,7 +13,9 @@ import axios from 'axios'; import { trace, trace_collapse ,getImageUrl, toPath} from "educoder"; import RepositoryDirectories from './RepositoryDirectories' -import RepositoryAddFile from './RepositoryAddFile' + +import { ActionBtn , NoneData } from 'educoder' + const $ = window.$; // 点击按钮复制功能 @@ -47,8 +49,7 @@ class Repository extends Component { if(this.props.author!=undefined){ userauthority=this.props.author.login===""||this.props.author.user_id===""||this.props.author.login===null||this.props.author.user_id===null; } - - // console.log(commits) + return ( {/* jfinalshop/WebRoot */} @@ -83,7 +84,12 @@ class Repository extends Component { Git使用指南 - {/* */} + { + this.props.current_user && this.props.current_user.admin ==true ? + +添加文件:"" + } + +
    {/* 用户、最近提交时间 */} { - trees === undefined || trees === null ?
    -
    - -

    暂时还没有相关数据哦!

    -
    -
    : + trees === undefined || trees === null ? :
    {author.name}{ - this.setState({ - visible:true - }) + componentDidMount(){ + let cmOptions = createCMOptions(this.props.mirror_name) + const extend_editor = window.CodeMirror.fromTextArea(window.$('#codemirror-file-edit')[0] + , cmOptions); + + // tpi没setValue也可以 + extend_editor.setValue('') + extend_editor.refresh(); + + // 拖拽也需要用 : window.editor_CodeMirror.refresh() + window.editor_tempCodeMirror = extend_editor; + this.extend_editor = extend_editor; } - cancelAdd = () =>{ - this.setState({ - visible:false + + checkPath= (rule, value, callback) =>{ + if (value.indexOf("/") > -1 && value.length==1 ) { + callback('请输入正确的文件路径'); + }else{ + callback(); + } + } + + handleSubmit = () =>{ + this.props.form.validateFieldsAndScroll((err, values) => { + if(!err){ + let shixunId = this.props.match.params.shixunId; + let url = `/shixuns/${shixunId}/add_file.json` + axios.post(url,{ + path:values.path, + message:values.message, + content:this.extend_editor.getValue() + }).then((result)=>{ + if(result){ + this.props.history.push(`${result.data.url}`) + } + }).catch((error)=>{ + console.log(error); + }) + } }) } render(){ - let { visible } = this.state + const {getFieldDecorator} = this.props.form; + let { shixunId } = this.props.match.params; return( - - +添加文件 - -
    +
    + +

    + + 实训项目 + 版本库 + 添加新文件 + +

    + +
    + + {getFieldDecorator('path', { + rules: [ + {required: true, message: "文件名不能为空"}, + { + validator:this.checkPath + }] + })( + + )} + +
    +
    +

    + +

    + +
    + +
    + + {getFieldDecorator('message', { + rules: [{required: true, message: "请输入提交信息"}], + })( + + )} +
    -
    - 取消 - 提交 +
    + + 取消
    - - + + +
    ) } } diff --git a/public/stylesheets/css/edu-common.css b/public/stylesheets/css/edu-common.css index d785959fb..ad1d2598c 100644 --- a/public/stylesheets/css/edu-common.css +++ b/public/stylesheets/css/edu-common.css @@ -526,7 +526,7 @@ input::-ms-clear{display:none;} .bor-grey01{border:1px solid #E6EAEB;} .bor-orange{border:1px solid #FF7500;} .bor-blue{border:1px solid #5faee3;} -.bor-red{border:1px solid #db0505;} +.bor-red{border:1px solid #db0505 !important;} .bor-none{border:none;} .bor-outnone{outline:none; border:0px;} /*延时*/ diff --git a/public/stylesheets/educoder/edu-main.css b/public/stylesheets/educoder/edu-main.css index 05a7bdba5..68305cc5b 100644 --- a/public/stylesheets/educoder/edu-main.css +++ b/public/stylesheets/educoder/edu-main.css @@ -347,7 +347,7 @@ a.edu-txt-w40,.edu-txt-w40{ width:40px; display: inline-block;text-align: center .bor-grey01{border:1px solid #E6EAEB;} .bor-orange{border:1px solid #FF7500;} .bor-blue{border:1px solid #5faee3;} -.bor-red{border:1px solid #db0505;} +.bor-red{border:1px solid #db0505 !important;} .bor-none{border:none;} .bor-outnone{outline:none; border:0px;} From 2036674b34e457e081785df28d19b8a4dc45d268 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Sat, 31 Aug 2019 15:13:04 +0800 Subject: [PATCH 20/22] =?UTF-8?q?=E5=90=88=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/user/usersInfo/banks/PollBanksContent.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/public/react/src/modules/user/usersInfo/banks/PollBanksContent.js b/public/react/src/modules/user/usersInfo/banks/PollBanksContent.js index 1b77290d1..cd8848b72 100644 --- a/public/react/src/modules/user/usersInfo/banks/PollBanksContent.js +++ b/public/react/src/modules/user/usersInfo/banks/PollBanksContent.js @@ -39,7 +39,9 @@ class PollBanksContent extends Component{ {to:`/banks/poll/${bankId}`,content:'内容详情'} ], category:'poll',//毕设选题 - id:bankId + id:bankId, + edit:'editpoll' + } this.props.initPublic(crumbData,menuData); this.setState({ From 88224a8f8c3c075cfc92aa33636d17678e8ae602 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Sat, 31 Aug 2019 15:40:33 +0800 Subject: [PATCH 21/22] =?UTF-8?q?=E5=90=88=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/courses/poll/PollNewQuestbank.js | 26 +++++++++---------- .../user/usersInfo/banks/PollBanksContent.js | 2 +- .../modules/user/usersInfo/banks/banksMenu.js | 2 +- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/public/react/src/modules/courses/poll/PollNewQuestbank.js b/public/react/src/modules/courses/poll/PollNewQuestbank.js index 9e5882db0..482eb6f6b 100644 --- a/public/react/src/modules/courses/poll/PollNewQuestbank.js +++ b/public/react/src/modules/courses/poll/PollNewQuestbank.js @@ -2858,7 +2858,7 @@ class PollNewQuestbank extends Component { let resultDomtwo; resultDomtwo =
    - {item.question.question_number}、 + {itemo&&itemo.question&&itemo.question.question_number}、 {itemo.question.question_type === 1 ? "单选题" : itemo.question.question_type === 2 ? "多选题" : "主观题"} @@ -2951,12 +2951,12 @@ class PollNewQuestbank extends Component { { itemo.question.answers[itemo.question.answers.length - 1].answer_text === "其他" && itemo.question.answers.length - 2 === indext ? - this.Ewoption(itemo.question.id, itemo)}> : itemo.question.answers.length - 1 === indext ? - this.Ewoption(itemo.question.id, itemo)}> @@ -2965,7 +2965,7 @@ class PollNewQuestbank extends Component { } : indext === 1 && itemo.question.answers.length === 2 || indext === 1 && itemo.question.answers.length === 3 ? - this.Ewoption(itemo.question.id, itemo)}> : "" @@ -3161,7 +3161,7 @@ class PollNewQuestbank extends Component { let resultDomtwo; resultDomtwo =
    - {item.question.question_number}、 + {itemo&&itemo.question&&itemo.question.question_number}、 { itemo.question.answers[itemo.question.answers.length - 1].answer_text === "其他" && itemo.question.answers.length - 2 === indext ? - this.Ewoption(itemo.question.id, itemo)}> : itemo.question.answers.length - 1 === indext ? - this.Ewoption(itemo.question.id, itemo)}> @@ -3275,7 +3275,7 @@ class PollNewQuestbank extends Component { } : indext === 1 && itemo.question.answers.length === 2 || indext === 1 && itemo.question.answers.length === 3 ? - this.Ewoption(itemo.question.id, itemo)}> : "" @@ -3484,7 +3484,7 @@ class PollNewQuestbank extends Component { let resultDomtwo; resultDomtwo =
    - {item.question.question_number}、 + {itemo&&itemo.question&&itemo.question.question_number}、 {itemo.question.question_type === 1 ? "单选题" : itemo.question.question_type === 2 ? "多选题" : "主观题"} @@ -3571,17 +3571,17 @@ class PollNewQuestbank extends Component { this.Deleteentrys(arrid, indext, false)}> + className="iconfont icon-htmal5icon19 font-22 color-grey-c "> { itemo.question.answers[itemo.question.answers.length - 1].answer_text === "其他" && itemo.question.answers.length - 2 === indext ? - this.Ewoption(itemo.question.id, itemo)}> : itemo.question.answers.length - 1 === indext ? - this.Ewoption(itemo.question.id, itemo)}> : indext === 1 && itemo.question.answers.length === 2 || indext === 1 && itemo.question.answers.length === 3 ? - this.Ewoption(itemo.question.id, itemo)}> 删除 - 编辑 + 编辑 发送
    From e1d59c99067bd5f08abb1a8456a4c61d8ae79f05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Sat, 31 Aug 2019 16:13:56 +0800 Subject: [PATCH 22/22] =?UTF-8?q?=E5=90=88=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/courses/poll/PollNewQuestbank.js | 24 ++++++++++++++----- .../shixunHomework/Trainingjobsetting.js | 18 +++++++------- 2 files changed, 27 insertions(+), 15 deletions(-) diff --git a/public/react/src/modules/courses/poll/PollNewQuestbank.js b/public/react/src/modules/courses/poll/PollNewQuestbank.js index 482eb6f6b..366e8f62b 100644 --- a/public/react/src/modules/courses/poll/PollNewQuestbank.js +++ b/public/react/src/modules/courses/poll/PollNewQuestbank.js @@ -407,7 +407,7 @@ class PollNewQuestbank extends Component { } this.addMytopic(1, this.state.pollid, Insertposition, false, 0); - // } + this.scrollToAnchor("publishtimeid"); } //添加多选题目 @@ -431,6 +431,7 @@ class PollNewQuestbank extends Component { } this.addMytopic(2, this.state.pollid, Insertposition, false, 0); + this.scrollToAnchor("publishtimeid"); // } } @@ -451,7 +452,7 @@ class PollNewQuestbank extends Component { } this.addMytopic(3, this.state.pollid, Insertposition, false, 0); - // } + this.scrollToAnchor("publishtimeid"); } //编辑方法 @@ -2476,8 +2477,18 @@ class PollNewQuestbank extends Component { // console.log("toWorkDetail"); this.props.history.push(`/banks/poll/${this.props.match.params.workid}`); // this.props.initPublic(undefined); + }; + //跳转道描点的地方 + scrollToAnchor = (anchorName) => { + if (anchorName) { + // 找到锚点 + let anchorElement = document.getElementById(anchorName); + // 如果对应id的锚点存在,就跳转到锚点 + if(anchorElement) { anchorElement.scrollIntoView(); } + } } + render() { let { addonAfter, @@ -3473,17 +3484,17 @@ class PollNewQuestbank extends Component { {/*新建单选多选2*/} -
    +
    { this.state.Newdisplay === true ?
    - {this.state.adddom === undefined ? "" : this.state.adddom.map((itemo, indexo) => { + {this.state.adddom === undefined ? "": this.state.adddom.map((itemo, indexo) => { // console.log('打印this.state.adddom') // console.log(this.state.adddom); let arrid = itemo.question.id; let resultDomtwo; resultDomtwo = -
    +
    {itemo&&itemo.question&&itemo.question.question_number}、
    {/**/}
    -
    +
    ) } diff --git a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js index bd90db42f..bee373bd9 100644 --- a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js +++ b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js @@ -862,19 +862,19 @@ class Trainingjobsetting extends Component { var exams = parseFloat(Proportion.toFixed(1)); var intk = srorelength*exams; intkk=oushution - intk; - console.log("奇数"); - console.log(srorelength);//3 - console.log(oushution);//79 - console.log(exams);//26.3 - console.log(intk);//78.9 - console.log(intkk); + // console.log("奇数"); + // console.log(srorelength);//3 + // console.log(oushution);//79 + // console.log(exams);//26.3 + // console.log(intk);//78.9 + // console.log(intkk); }else { // 偶数 var examsy =parseFloat(Proportion.toFixed(1)); intkks=oushution - (examsy*srorelength); - console.log("偶数"); - console.log(oushution); - console.log((examsy*srorelength)); + // console.log("偶数"); + // console.log(oushution); + // console.log((examsy*srorelength)); } var mact=0;