From 7d1f7150f6633bf6f4ea2e9b9db5e31c27776d60 Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Tue, 23 Jul 2019 21:40:16 +0800 Subject: [PATCH 1/6] .. --- app/controllers/shixuns_controller.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index be4448a92..9edb6bb9d 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -830,8 +830,6 @@ private def is_shixun_reset?(games, min_challenges, current_myshixun) # 用户在申请发布之前,是否玩过实训 TODO: 重置的字段应该迁移到myshixuns表比较合适 modify_shixun = ShixunModify.exists?(:myshixun_id => current_myshixun.id, :shixun_id => @shixun.id, :status => 1) - games.size != min_challenges.size || - games.map(&:challenge_id) != min_challenges.map{|challenge| challenge.first} || - modify_shixun + games.size != min_challenges.size || modify_shixun end end From 1974d858edb862596ac968b90e345d93b3e63a76 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Tue, 23 Jul 2019 22:04:22 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E9=99=84=E4=BB=B6=E8=B0=83=E6=95=B4?= 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, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/homework_commons_controller.rb b/app/controllers/homework_commons_controller.rb index 8fab8dad3..8e489df1b 100644 --- a/app/controllers/homework_commons_controller.rb +++ b/app/controllers/homework_commons_controller.rb @@ -1593,7 +1593,7 @@ class HomeworkCommonsController < ApplicationController homework_bank.max_num = homework.homework_detail_group.max_num homework_bank.base_on_project = homework.homework_detail_group.base_on_project end - homework.attachments.each do |attachment| + homework.attachments.where("attachtype != 2 and attachtype is null").each do |attachment| att = attachment.copy att.author_id = homework_bank.user_id att.copy_from = attachment.id From 008518e47ff8009151120aa5979bb0a4fc17fd06 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Tue, 23 Jul 2019 22:18:21 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E9=99=84=E4=BB=B6=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_commons_controller.rb | 3 ++- app/controllers/question_banks_controller.rb | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/controllers/homework_commons_controller.rb b/app/controllers/homework_commons_controller.rb index 8e489df1b..84ee9daf2 100644 --- a/app/controllers/homework_commons_controller.rb +++ b/app/controllers/homework_commons_controller.rb @@ -1593,10 +1593,11 @@ class HomeworkCommonsController < ApplicationController homework_bank.max_num = homework.homework_detail_group.max_num homework_bank.base_on_project = homework.homework_detail_group.base_on_project end - homework.attachments.where("attachtype != 2 and attachtype is null").each do |attachment| + homework.attachments.each do |attachment| att = attachment.copy att.author_id = homework_bank.user_id att.copy_from = attachment.id + att.attachtype = attachment.attachtype homework_bank.attachments << att end homework_bank diff --git a/app/controllers/question_banks_controller.rb b/app/controllers/question_banks_controller.rb index 58fa7a8d4..5ff247729 100644 --- a/app/controllers/question_banks_controller.rb +++ b/app/controllers/question_banks_controller.rb @@ -154,7 +154,8 @@ class QuestionBanksController < ApplicationController att.container_id = nil att.container_type = nil att.author_id = homework.user_id - att.attachtype = 1 + att.attachtype = attachment.attachtype + # att.attachtype = 1 att.copy_from = attachment.id att.save! new_homework.attachments << att From 69f0332e18e6687c3f94b346098c32ef62f21325 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Tue, 23 Jul 2019 22:18:58 +0800 Subject: [PATCH 4/6] date --- .../src/modules/courses/busyWork/CommonWorkSetting.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/public/react/src/modules/courses/busyWork/CommonWorkSetting.js b/public/react/src/modules/courses/busyWork/CommonWorkSetting.js index 8d752707c..17a944d41 100644 --- a/public/react/src/modules/courses/busyWork/CommonWorkSetting.js +++ b/public/react/src/modules/courses/busyWork/CommonWorkSetting.js @@ -715,18 +715,18 @@ class CommonWorkSetting extends Component{ course_id , unified_setting: unified_setting, // 统一设置 group_settings: group_settings_param, - publish_time: new Date(temp_publish_time), // 发布 - end_time: new Date(temp_end_time), // 截止 + publish_time: temp_end_time ? new Date(temp_publish_time) : temp_end_time, // 发布 + end_time: temp_end_time ? new Date(temp_end_time) : temp_end_time, // 截止 late_penalty: late_penalty, // 迟交扣分 allow_late: allow_late, // 是否允许补交 - late_time: new Date(late_time), // 补交截止时间 + late_time: late_time ? new Date(late_time) : late_time, // 补交截止时间 anonymous_comment: anonymous_comment, // true: 启用匿评 false:未启用匿评 - evaluation_start: new Date(evaluation_start), //匿评开始时间 + evaluation_start: evaluation_start ? new Date(evaluation_start) : evaluation_start, //匿评开始时间 evaluation_end: evaluation_end, evaluation_num: evaluation_num, // 匿评数 absence_penalty: absence_penalty, // 匿评扣分 anonymous_appeal: anonymous_appeal, // true: 启用匿评申诉, false:未启用 - appeal_time: new Date(appeal_time), // 申诉结束时间 + appeal_time: appeal_time ? new Date(appeal_time) : appeal_time, // 申诉结束时间 appeal_penalty: appeal_penalty, // 违规匿评扣分 ta_mode: ta_mode, // 1:普通模式 0:复审模式 final_mode: final_mode, // true: 单项评分优先, false: 多项评分配比 From 8bd2480503fd5fca3f2a05af21b35b610bf6e9c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Tue, 23 Jul 2019 22:20:59 +0800 Subject: [PATCH 5/6] =?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/AppConfig.js | 15 +++++--- .../shixunHomework/Listofworksstudentone.js | 34 +++++++++++++++++-- .../shixunHomework/ShixunHomeworkPage.js | 14 ++++---- 3 files changed, 49 insertions(+), 14 deletions(-) diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index 5721c88a9..554cb5bcb 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -130,6 +130,9 @@ export function initAxiosInterceptors(props) { throw new axios.Cancel('Operation canceled by the user.'); } + // if(response.data.status === 401){ + // console.log("401401401") + // } if (response.data.status === 403) { // props.history.replace('/403') // 这里会分2个情况,1、刚进入页面发请求返回的403;2、进入页面后,其他用户操作触发请求返回的403; @@ -145,16 +148,20 @@ export function initAxiosInterceptors(props) { locationurl('/500'); } + + // if (response.data.status === 402) { // console.log(response.data.status); // console.log(response.data); // // locationurl(402); // } - - if (response.data.status === 401) { - return config; - } + // + // if (response.data.status === 401) { + // console.log("161"); + // console.log(config); + // return config; + // } // if (response.data.status === 407) { // 在app js 中解决 Trialapplication // // diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js index 3865ee153..60a8512d5 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js @@ -982,7 +982,7 @@ class Listofworksstudentone extends Component { // console.log("935"); // debugger let urll = `/homework_commons/${homeworkid}/works_list.json`; - var data = { + var datasysl = { search: "", order: "", b_order: "desc", @@ -991,12 +991,17 @@ class Listofworksstudentone extends Component { work_status: "", course_group: "", } - axios.post(urll, data).then((result) => { + axios.post(urll, datasysl).then((result) => { console.log("980000000____________________"); - + debugger if(result === undefined){ return } + if(result.data.message!==undefined){ + + return; + } + this.setState({ teacherdata: result.data, task_status: result.data.task_status, @@ -1054,6 +1059,9 @@ class Listofworksstudentone extends Component { } axios.post(urll, data).then((result) => { if (result) { + if(result.data.message!==undefined){ + return; + } // console.log("学生未截至未公开的作品列表") // console.log(JSON.stringify(result)) this.setState({ @@ -1315,6 +1323,9 @@ class Listofworksstudentone extends Component { var url = `/student_works/${userids}/shixun_work.json`; axios.get(url).then((result) => { if (result) { + if(result.data.message!==undefined){ + return; + } // console.log("Listofworksstudentone.js") // console.log(JSON.stringify(result)) let datalist = []; @@ -1416,6 +1427,9 @@ class Listofworksstudentone extends Component { } axios.post(urll, data).then((result) => { if (result !== undefined) { + if(result.data.message!==undefined){ + return; + } // console.log("学生公开的作品列表") // console.log(JSON.stringify(result)) this.setState({ @@ -1476,6 +1490,7 @@ class Listofworksstudentone extends Component { let url = "/homework_commons/"+homeworkid+"/update_student_score.json?shixun_id="+teacherdata.shixun_id; axios.get(url).then((response) => { + this.props.showNotification(`${response.data.message}`); // var homeworkid = this.props.match.params.homeworkid; this.Getalistofworks(homeworkid); @@ -1521,7 +1536,11 @@ class Listofworksstudentone extends Component { // console.log(url) // console.log("作品列表______________________") // console.log(JSON.stringify(result)) + if (result !== undefined) { + if(result.data.message!==undefined){ + return; + } this.setState({ teacherdata: result.data, task_status: result.data.task_status, @@ -1895,6 +1914,7 @@ class Listofworksstudentone extends Component { if (result) { // console.log("TraineetraininginformationModal.js") // console.log(JSON.stringify(result)) + let datalist = []; var game_list = result.data.game_list var boolgalist=true; @@ -2134,11 +2154,16 @@ class Listofworksstudentone extends Component { let url = "/homework_commons/"+homeworkid+"/update_score.json"; axios.get(url).then((response) => { + if(response){ + if(response.data.message!==undefined){ + return; + } this.setState({ loadingstate: true }) this.Startsortingt(this.state.orders, this.state.course_groupyslstwo, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit); this.props.showNotification(`${response.data.message}`); + } }).catch((error) => { console.log(error) }); @@ -2183,6 +2208,9 @@ class Listofworksstudentone extends Component { if(response === undefined){ return } + if(response.data.message!==undefined){ + return; + } if(response.data.status&&response.data.status===-1){ }else if(response.data.status&&response.data.status===-2){ diff --git a/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js b/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js index 91edc45fe..d9e589bd4 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js @@ -59,10 +59,10 @@ class ShixunHomeworkPage extends Component { // console.log(teacherdata); this.setState({ - jobsettingsdatapage: jobsettingsdata.data.message!==undefined?undefined:jobsettingsdata, - teacherdatapage: teacherdata.message!==undefined?undefined:teacherdata, - code_review: teacherdata.code_review!==undefined?teacherdata.code_review :false, - view_report: teacherdata.view_report!==undefined? teacherdata.view_report:false, + jobsettingsdatapage: jobsettingsdata.data.message===undefined?jobsettingsdata:undefined, + teacherdatapage: teacherdata.message===undefined?teacherdata:undefined, + code_review: teacherdata.code_review===undefined?false :teacherdata.code_review, + view_report: teacherdata.view_report!==undefined? false:teacherdata.view_report, }) } @@ -116,9 +116,9 @@ class ShixunHomeworkPage extends Component { let {tab, teacherdatapage, jobsettingsdatapage} = this.state; const isAdmin = this.props.isAdmin(); - // console.log(119) - // console.log(jobsettingsdatapage); - // console.log(teacherdatapage); + console.log(119) + console.log(jobsettingsdatapage); + console.log(teacherdatapage); return (
From 5645883f57853053dd112fb09414dd8c67ffb8cc Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Tue, 23 Jul 2019 22:23:26 +0800 Subject: [PATCH 6/6] =?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 +- app/controllers/question_banks_controller.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/homework_commons_controller.rb b/app/controllers/homework_commons_controller.rb index 84ee9daf2..cfc1c4ba5 100644 --- a/app/controllers/homework_commons_controller.rb +++ b/app/controllers/homework_commons_controller.rb @@ -1597,7 +1597,7 @@ class HomeworkCommonsController < ApplicationController att = attachment.copy att.author_id = homework_bank.user_id att.copy_from = attachment.id - att.attachtype = attachment.attachtype + att.attachtype = attachment.attachtype || 1 homework_bank.attachments << att end homework_bank diff --git a/app/controllers/question_banks_controller.rb b/app/controllers/question_banks_controller.rb index 5ff247729..098c07d1b 100644 --- a/app/controllers/question_banks_controller.rb +++ b/app/controllers/question_banks_controller.rb @@ -154,7 +154,7 @@ class QuestionBanksController < ApplicationController att.container_id = nil att.container_type = nil att.author_id = homework.user_id - att.attachtype = attachment.attachtype + att.attachtype = attachment.attachtype || 1 # att.attachtype = 1 att.copy_from = attachment.id att.save!