From c424983aece529b951489662b97d26e8fae94230 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Mon, 2 Sep 2019 15:31:15 +0800 Subject: [PATCH 01/10] add previousPathName --- public/react/src/modules/courses/Index.js | 133 ++++++++++++---------- 1 file changed, 71 insertions(+), 62 deletions(-) diff --git a/public/react/src/modules/courses/Index.js b/public/react/src/modules/courses/Index.js index 1b1c523c0..7da04dd0e 100644 --- a/public/react/src/modules/courses/Index.js +++ b/public/react/src/modules/courses/Index.js @@ -1,6 +1,7 @@ import React, { Component } from 'react'; import { SnackbarHOC } from 'educoder'; import {BrowserRouter as Router,Route,Switch} from 'react-router-dom'; +import { withRouter } from 'react-router' import Loadable from 'react-loadable'; import Loading from '../../Loading'; import axios from 'axios'; @@ -309,6 +310,13 @@ class CoursesIndex extends Component{ componentDidMount(){ // this.updataleftNav() + this.historyArray = [] + this.props.history.listen( location => { + console.log(location) + this.historyArray.unshift(location.pathname) + this.historyArray.length = 2; + //Do your stuff here + }); } updataleftNav=()=>{ @@ -443,6 +451,7 @@ class CoursesIndex extends Component{ render() { const common = { + previousPathName: this.historyArray && this.historyArray[1] // isAdmin: this.isAdmin, // isStudent: this.isStudent, // isAdminOrStudent: this.isAdminOrStudent, @@ -464,47 +473,47 @@ class CoursesIndex extends Component{ {/*毕设任务题库详情*/} () + (props) => () } > {/*毕设内容题库详情*/} () + (props) => () } > {/*分组作业题库详情*/} () + (props) => () } > {/* 普通作业题库详情*/} () + (props) => () } > {/* 资源列表页 */} () + (props) => () } > () + (props) => () } > () + (props) => () } > {/*课堂讨论*/} () + (props) => () } > @@ -512,19 +521,19 @@ class CoursesIndex extends Component{ {/* 毕设问答 */} () + (props) => () } > {/* 毕设选题新建页 */} () + (props) => () }> {/* 毕设选题编辑页*/} () + (props) => () }> {/* 毕设选题详情页 */} @@ -537,7 +546,7 @@ class CoursesIndex extends Component{ {/* 毕设选题列表 */} () + (props) => () }> @@ -545,21 +554,21 @@ class CoursesIndex extends Component{ {/* 作品评阅 https://www.trustie.net/issues/19981 */} () + (props) => () } > {/* 新建作品 */} () + (props) => () } > {/* 修改作品 */} () + (props) => () } > @@ -567,20 +576,20 @@ class CoursesIndex extends Component{ () + (props) => () } > () + (props) => () }> () + (props) => () } > @@ -589,7 +598,7 @@ class CoursesIndex extends Component{ {/* 修改毕设任务 https://www.trustie.net/issues/19981 */} () + (props) => () } > @@ -597,7 +606,7 @@ class CoursesIndex extends Component{ {/* 新建毕设任务 https://www.trustie.net/issues/19981 */} () + (props) => () } > @@ -605,87 +614,87 @@ class CoursesIndex extends Component{ {/* 毕设任务列表 https://www.trustie.net/issues/19981 */} () + (props) => () } > {/*/!* 毕业设计主 https://www.trustie.net/issues/19981 *!/*/} {/* ()*/} + {/*(props) => ()*/} {/*}*/} {/*>*/} {/*/!* 资源子目录 https://www.trustie.net/issues/19917 *!/*/} {/* ()*/} + {/*(props) => ()*/} {/*}*/} {/*>*/} {/* 教师列表*/} () + (props) => () } > {/* 学生列表*/} () + (props) => () } > {/* 分班列表 */} () + (props) => () } > {/* 普通作业 */} () + (props) => () } > {/* 分组作业 */} () + (props) => () } > {/* 普通作业 */} () + (props) => () } > {/* 分组作业 */} () + (props) => () } > {/* 问卷答题 */} () + (props) => () } > {/* 问卷详情 */} () + (props) => () } > {/* 问卷新建 */} () + (props) => () } > {/*/!* 问卷编辑 *!/*/} @@ -697,7 +706,7 @@ class CoursesIndex extends Component{ {/* 问卷 */} () + (props) => () } > @@ -705,20 +714,20 @@ class CoursesIndex extends Component{ {/* 试卷查看/评阅 */} () + (props)=>() } > {/*试卷新建 */} () + (props) => () } > {/*试卷新建 */} () + (props) => () } > @@ -726,7 +735,7 @@ class CoursesIndex extends Component{ () + (props) => () } > @@ -735,14 +744,14 @@ class CoursesIndex extends Component{ () + (props) => () } > {/* 试卷 */} () + (props) => () } > @@ -750,65 +759,65 @@ class CoursesIndex extends Component{ {/*实训查重详情*/} () + (props) => () } > () + (props) => () } > {/*实训查重列表*/} () + (props) => () } > () + (props) => () } > {/*实训报告*/} () + (props) => () } > () + (props) => () } > {/*教师列表*/} () + (props) => () } > () + (props) => () } > {/*实训作业page*/} () + (props) => () } > {/*实训作业设置*/} () + (props) => () } > () + (props) => () } > {/*/!*实训作品列表教师*!/*/} @@ -847,21 +856,21 @@ class CoursesIndex extends Component{ {/*实训作业问答主目录*/} () + (props) => () } > {/*实训作业问答子目录*/} () + (props) => () } > {/*新建课堂*/} () + (props) => () } > {/*新建精品课堂*/} @@ -869,47 +878,47 @@ class CoursesIndex extends Component{ {/*id 是否是私有或者公有*/} () + (props) => () } > {/*修改精品课堂*/} () + (props) => () } > {/*修改课堂*/} () + (props) => () } > {/* 实训作业子页面*/} () + (props) => () } > {/* 实训作业页面*/} () + (props) => () } > {/*/!*实训作业and课堂详情页*!/*/} () + (props) => () } > {/*课堂首页*/} () + (props) => () } > {/**/} @@ -919,4 +928,4 @@ class CoursesIndex extends Component{ } } -export default ImageLayerOfCommentHOC({imgSelector: '.imageLayerParent img, .imageLayerParent .imageTarget', parentSelector: '.newMain'}) (CNotificationHOC() ( SnackbarHOC() ( TPMIndexHOC(CoursesIndex) ))); \ No newline at end of file +export default withRouter(ImageLayerOfCommentHOC({imgSelector: '.imageLayerParent img, .imageLayerParent .imageTarget', parentSelector: '.newMain'}) (CNotificationHOC() ( SnackbarHOC() ( TPMIndexHOC(CoursesIndex) )))); \ No newline at end of file From ec11918b6e4ee562057026fe671ed5ee6d959746 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Mon, 2 Sep 2019 16:00:33 +0800 Subject: [PATCH 02/10] =?UTF-8?q?=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/courses/busyWork/CommonWorkQuestion.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/public/react/src/modules/courses/busyWork/CommonWorkQuestion.js b/public/react/src/modules/courses/busyWork/CommonWorkQuestion.js index 472ebd557..04ff2a066 100644 --- a/public/react/src/modules/courses/busyWork/CommonWorkQuestion.js +++ b/public/react/src/modules/courses/busyWork/CommonWorkQuestion.js @@ -81,11 +81,7 @@ class CommonWorkQuestion extends Component{ let category_id=this.props.match.params.category_id; let task_Id=this.props.match.params.task_Id; const isGroup = this.props.isGroup() - /** - - 导出成绩 - - */ + return( From 9cbbda67449c27bf369de3205a468d60402ee0d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Mon, 2 Sep 2019 16:19:03 +0800 Subject: [PATCH 03/10] =?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/modules/message/js/MessagSub.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/message/js/MessagSub.js b/public/react/src/modules/message/js/MessagSub.js index 04b893ddb..fccfbb0b2 100644 --- a/public/react/src/modules/message/js/MessagSub.js +++ b/public/react/src/modules/message/js/MessagSub.js @@ -584,7 +584,7 @@ class MessagSub extends Component{ ` } - + From 5ec82e8032a56777b0d989d9eba1bd7afc62e880 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Mon, 2 Sep 2019 16:27:26 +0800 Subject: [PATCH 04/10] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../react/src/modules/courses/poll/PollNew.js | 29 +++++++++---------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/public/react/src/modules/courses/poll/PollNew.js b/public/react/src/modules/courses/poll/PollNew.js index fb079d621..70fff7e13 100644 --- a/public/react/src/modules/courses/poll/PollNew.js +++ b/public/react/src/modules/courses/poll/PollNew.js @@ -1834,8 +1834,8 @@ class PollNew extends Component { 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, + max_choices: max_choicess===undefined||max_choicess===null||max_choicess===0||max_choicess==="0"?null:max_choicess, + min_choices: min_choicess===undefined||min_choicess===null||min_choicess===0||min_choicess==="0"?null:min_choicess, question_answers: option, question_other_answer: null, insert_id: insert_id @@ -1911,8 +1911,8 @@ class PollNew extends Component { 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, + max_choices: max_choicess===undefined||max_choicess===null||max_choicess===0||max_choicess==="0"?null:max_choicess, + min_choices: min_choicess===undefined||min_choicess===null||min_choicess===0||min_choicess==="0"?null:min_choicess, question_answers: option, question_other_answer: null, }; @@ -2775,7 +2775,7 @@ class PollNew extends Component { {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 + "项")} + className="font-16 mt10 ml10">{(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 === "null" && item.question.max_choices === "null" ? "不限制" : "可选" + item.question.min_choices + "-" + (item.question.max_choices===undefined||item.question.max_choices===null||item.question.max_choices===""||item.question.max_choices==="null"?item.question.answers.length:item.question.max_choices) + "项")} { polls_status === undefined || polls_status === 1 ? @@ -2963,7 +2963,7 @@ class PollNew extends Component { 可选 - {/*可选最小*/} + {/*可选最小1*/} this.HandleGradationGroupChangee(value, indexo, itemo.question.max_choices, itemo.question.answers.length)} - value={itemo.question.min_choices === 0 || itemo.question.min_choices === "0" ? "--" : itemo.question.min_choices === null ? "--" : itemo.question.min_choices === undefined ? "--" : itemo.question.min_choices} - + value={itemo.question.min_choices === null || itemo.question.min_choices === undefined ||itemo.question.min_choices === "null"|| itemo.question.min_choices === 0 || itemo.question.min_choices === "0"?"0": itemo.question.min_choices} > -- {itemo.question.answers === undefined ? "" : itemo.question.answers.map((itemt, indext) => { @@ -2993,10 +2992,10 @@ class PollNew extends Component { ~ - {/*可选最大*/} + {/*可选最大2*/} 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} + value={itemo.question.max_choices === null || itemo.question.max_choices === undefined ||itemo.question.max_choices === "null"|| itemo.question.max_choices === 0 || itemo.question.max_choices === "0"?"0": itemo.question.max_choices} > -- {itemo.question.answers === undefined ? "" : itemo.question.answers.map((itemt, indext) => { @@ -3224,8 +3223,7 @@ class PollNew extends Component { this.HandleGradationGroupChangee(value, indexo, itemo.question.max_choices, itemo.question.answers.length)} - value={itemo.question.min_choices === 0 || itemo.question.min_choices === "0" ? "--" : itemo.question.min_choices === null ? "--" : itemo.question.min_choices === undefined ? "--" : itemo.question.min_choices} - + value={itemo.question.min_choices === null || itemo.question.min_choices === undefined ||itemo.question.min_choices === "null"|| itemo.question.min_choices === 0 || itemo.question.min_choices === "0"?"0": itemo.question.min_choices} > -- {itemo.question.answers === undefined ? "" : itemo.question.answers.map((itemt, indext) => { @@ -3239,7 +3237,7 @@ class PollNew extends Component { {/*可选最大*/} 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} + value={itemo.question.max_choices === null || itemo.question.max_choices === undefined ||itemo.question.max_choices === "null"|| itemo.question.max_choices === 0 || itemo.question.max_choices === "0"?"0": itemo.question.max_choices} > -- {itemo.question.answers === undefined ? "" : itemo.question.answers.map((itemt, indext) => { @@ -3476,8 +3474,7 @@ class PollNew extends Component { this.HandleGradationGroupChangee(value, indexo, itemo.question.max_choices, itemo.question.answers.length)} - value={itemo.question.min_choices === 0 || itemo.question.min_choices === "0" ? "--" : itemo.question.min_choices === null ? "--" : itemo.question.min_choices === undefined ? "--" : itemo.question.min_choices} - + value={itemo.question.min_choices === null || itemo.question.min_choices === undefined ||itemo.question.min_choices === "null"|| itemo.question.min_choices === 0 || itemo.question.min_choices === "0"?"0": itemo.question.min_choices} > -- {itemo.question.answers === undefined ? "" : itemo.question.answers.map((itemt, indext) => { @@ -3491,7 +3488,7 @@ class PollNew extends Component { {/*可选最大*/} 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} + value={itemo.question.max_choices === null || itemo.question.max_choices === undefined ||itemo.question.max_choices === "null"|| itemo.question.max_choices === 0 || itemo.question.max_choices === "0"?"0": itemo.question.max_choices} > -- {itemo.question.answers === undefined ? "" : itemo.question.answers.map((itemt, indext) => { From d89037d07cfbf09c2df5b424689e37a48c344df3 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Mon, 2 Sep 2019 16:27:56 +0800 Subject: [PATCH 05/10] =?UTF-8?q?=E5=AE=BD=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/courses/members/studentsList.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/courses/members/studentsList.js b/public/react/src/modules/courses/members/studentsList.js index fc8346fa3..08f4971ce 100644 --- a/public/react/src/modules/courses/members/studentsList.js +++ b/public/react/src/modules/courses/members/studentsList.js @@ -600,7 +600,7 @@ class studentsList extends Component{ font-size: 14px; } .drop_down_menu { - width: 93px; + /*width: 93px;*/ } .drop_down_menu li { width:100%; From b860e61e006a842839a969a28eb299ee0b51b563 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Mon, 2 Sep 2019 16:29:16 +0800 Subject: [PATCH 06/10] =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E4=B8=8B=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/busyWork/CommonWorkDetailIndex.js | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js b/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js index 0e86cf420..5693b3788 100644 --- a/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js +++ b/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js @@ -129,20 +129,21 @@ class CommonWorkDetailIndex extends Component{ }) } }else { - this.props.showNotification(`正在下载中`); - - this.setState({ donwloading: true }) - downloadFile({ - url: url, - successCallback: (url) => { - this.setState({ donwloading: false }) - console.log('successCallback') - }, - failCallback: (responseHtml, url) => { - this.setState({ donwloading: false }) - console.log('failCallback') - } - }) + this.props.slowDownload(url) + + // this.props.showNotification(`正在下载中`); + // this.setState({ donwloading: true }) + // downloadFile({ + // url: url, + // successCallback: (url) => { + // this.setState({ donwloading: false }) + // console.log('successCallback') + // }, + // failCallback: (responseHtml, url) => { + // this.setState({ donwloading: false }) + // console.log('failCallback') + // } + // }) // window.open("/api"+url, '_blank'); } }).catch((error) => { From 81e11909d1f94d1298ccdca01c95213f03995d19 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Mon, 2 Sep 2019 16:30:51 +0800 Subject: [PATCH 07/10] =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E4=B8=8B=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/courses/busyWork/common/TabRightComponents.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/courses/busyWork/common/TabRightComponents.js b/public/react/src/modules/courses/busyWork/common/TabRightComponents.js index 5320dd0ca..34044330d 100644 --- a/public/react/src/modules/courses/busyWork/common/TabRightComponents.js +++ b/public/react/src/modules/courses/busyWork/common/TabRightComponents.js @@ -63,8 +63,9 @@ class TabRightComponents extends Component{ }) } }else { - this.props.showNotification(`正在下载中`); - window.open("/api"+url, '_blank'); + this.props.slowDownload(url) + // this.props.showNotification(`正在下载中`); + // window.open("/api"+url, '_blank'); } }).catch((error) => { console.log(error) From 9d832a09c69fcc004dc8c67c26917e378a438927 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Mon, 2 Sep 2019 16:31:31 +0800 Subject: [PATCH 08/10] =?UTF-8?q?=E9=A2=98=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_commons_controller.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/controllers/homework_commons_controller.rb b/app/controllers/homework_commons_controller.rb index 081e2fdf1..8268382bd 100644 --- a/app/controllers/homework_commons_controller.rb +++ b/app/controllers/homework_commons_controller.rb @@ -1322,6 +1322,8 @@ class HomeworkCommonsController < ApplicationController else new_homework_bank = add_to_homework_bank_f homework new_homework_bank.save! + + homework.update_attributes!(homework_bank_id: new_homework_bank.id) end rescue Exception => e From 306fcab4347f4af2ebd5beabe692db8fd237298c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Mon, 2 Sep 2019 16:32:13 +0800 Subject: [PATCH 09/10] =?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/modules/courses/poll/PollNew.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/courses/poll/PollNew.js b/public/react/src/modules/courses/poll/PollNew.js index 70fff7e13..9c00ae30d 100644 --- a/public/react/src/modules/courses/poll/PollNew.js +++ b/public/react/src/modules/courses/poll/PollNew.js @@ -2775,7 +2775,7 @@ class PollNew extends Component { {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 === "null" && item.question.max_choices === "null" ? "不限制" : "可选" + item.question.min_choices + "-" + (item.question.max_choices===undefined||item.question.max_choices===null||item.question.max_choices===""||item.question.max_choices==="null"?item.question.answers.length:item.question.max_choices) + "项")} + className="font-16 mt10 ml10">{(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 === "null" && item.question.max_choices === "null" ? "不限制" : "可选" +(item.question.min_choices===undefined||item.question.min_choices===null||item.question.min_choices===""||item.question.min_choices==="null"?2:item.question.min_choices) + "-" + (item.question.max_choices===undefined||item.question.max_choices===null||item.question.max_choices===""||item.question.max_choices==="null"?item.question.answers.length:item.question.max_choices) + "项")} { polls_status === undefined || polls_status === 1 ? From bc06f54ce92ea73c9434fd4258713b6134c4c8f0 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Mon, 2 Sep 2019 16:39:45 +0800 Subject: [PATCH 10/10] =?UTF-8?q?=E9=A2=98=E5=BA=93=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/exercises_controller.rb | 1 + app/controllers/graduation_tasks_controller.rb | 1 + app/controllers/polls_controller.rb | 1 + 3 files changed, 3 insertions(+) diff --git a/app/controllers/exercises_controller.rb b/app/controllers/exercises_controller.rb index 5db704fce..3be35345e 100644 --- a/app/controllers/exercises_controller.rb +++ b/app/controllers/exercises_controller.rb @@ -354,6 +354,7 @@ class ExercisesController < ApplicationController # question_bank = QuestionBank.new ques_params # question_bank.save # end + exercise.update_attributes!(exercise_bank_id: current_ex_bank.id) end # 试卷的问题的输入 exercise.exercise_questions.each do |q| diff --git a/app/controllers/graduation_tasks_controller.rb b/app/controllers/graduation_tasks_controller.rb index 727bdb77e..fe7511e29 100644 --- a/app/controllers/graduation_tasks_controller.rb +++ b/app/controllers/graduation_tasks_controller.rb @@ -301,6 +301,7 @@ class GraduationTasksController < ApplicationController course_list_id: @course.course_list_id) task_bank.save! + task.update_attributes!(gtask_bank_id: task_bank.id) end task.attachments.each do |attachment| att = attachment.copy diff --git a/app/controllers/polls_controller.rb b/app/controllers/polls_controller.rb index bc549cf1d..7cb7ee800 100644 --- a/app/controllers/polls_controller.rb +++ b/app/controllers/polls_controller.rb @@ -562,6 +562,7 @@ class PollsController < ApplicationController question_bank = QuestionBank.new ques_params question_bank.save end + poll.update_attributes!(exercise_bank_id: current_ex_bank.id) end # 问卷的问题的输入 poll.poll_questions.each do |f|