From e39f7e9f0c2883df3e550a0ba8d7bbfaa602caac Mon Sep 17 00:00:00 2001 From: caicai8 <1149225589@qq.com> Date: Wed, 11 Mar 2020 17:13:42 +0800 Subject: [PATCH 01/21] =?UTF-8?q?=E5=AD=A6=E9=99=A2=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/college/College.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/public/react/src/college/College.js b/public/react/src/college/College.js index 15b0e82f8..bc8f2a3a2 100644 --- a/public/react/src/college/College.js +++ b/public/react/src/college/College.js @@ -907,7 +907,7 @@ class College extends Component {
{ - teachers_count? + teachers_count || teachers_count===0?
{teachers_count}
: @@ -915,7 +915,7 @@ class College extends Component {
{ - students_count? + students_count || students_count===0?
{students_count}
: @@ -923,7 +923,7 @@ class College extends Component {
{ - courses_count? + courses_count || courses_count === 0?
{courses_count}
: @@ -931,7 +931,7 @@ class College extends Component {
{ - shixuns_count? + shixuns_count || shixuns_count === 0?
{shixuns_count}
: @@ -939,7 +939,7 @@ class College extends Component {
{ - shixun_report_count? + shixun_report_count || shixun_report_count===0?
{shixun_report_count}
: @@ -947,7 +947,7 @@ class College extends Component {
{ - shixun_time? + shixun_time || shixun_time === 0 ?
{shixun_time}
: From 1ccb16f76d8235e6ec29de8590aae3b4aa35c106 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Wed, 11 Mar 2020 17:34:38 +0800 Subject: [PATCH 02/21] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=B4=A2=E5=BC=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...311092049_add_index_user_id_challenge_id_for_games.rb | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 db/migrate/20200311092049_add_index_user_id_challenge_id_for_games.rb diff --git a/db/migrate/20200311092049_add_index_user_id_challenge_id_for_games.rb b/db/migrate/20200311092049_add_index_user_id_challenge_id_for_games.rb new file mode 100644 index 000000000..c9fab49d4 --- /dev/null +++ b/db/migrate/20200311092049_add_index_user_id_challenge_id_for_games.rb @@ -0,0 +1,9 @@ +class AddIndexUserIdChallengeIdForGames < ActiveRecord::Migration[5.2] + def change + delete_games = Game.where.not(myshixun_id: Myshixun.all).reorder(nil) + puts "delete_games: #{delete_games.pluck(:id)}" + delete_games.destroy_all + + add_index :games, [:user_id, :challenge_id], unique: true + end +end From e80ae9f952535cb0ac816de72651c3f3b25f0ce2 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Wed, 11 Mar 2020 18:02:16 +0800 Subject: [PATCH 03/21] =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E9=80=89=E7=94=A8?= =?UTF-8?q?=E9=A2=98=E5=BA=93=E5=92=8C=E5=88=9B=E5=BB=BA=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=AD=90=E7=9B=AE=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_commons_controller.rb | 5 +++++ app/controllers/question_banks_controller.rb | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/app/controllers/homework_commons_controller.rb b/app/controllers/homework_commons_controller.rb index 0e3771e61..adf0dc6bf 100644 --- a/app/controllers/homework_commons_controller.rb +++ b/app/controllers/homework_commons_controller.rb @@ -376,6 +376,11 @@ class HomeworkCommonsController < ApplicationController @homework.user_id = current_user.id @homework.course_id = @course.id + if params[:category].present? + category = @course.course_second_categories.find_by(id: params[:category]) + @homework.course_second_category_id = category&.id.to_i + end + homework_detail_manual = HomeworkDetailManual.new @homework.homework_detail_manual = homework_detail_manual homework_detail_manual.te_proportion = 0.7 diff --git a/app/controllers/question_banks_controller.rb b/app/controllers/question_banks_controller.rb index bcb88ad85..af6305a64 100644 --- a/app/controllers/question_banks_controller.rb +++ b/app/controllers/question_banks_controller.rb @@ -212,6 +212,11 @@ class QuestionBanksController < ApplicationController homework_type: homework.homework_type, course_id: course.id, homework_bank_id: homework.id, reference_answer: homework.reference_answer) + if params[:category].present? + category = course.course_second_categories.find_by(id: params[:category]) + new_homework.course_second_category_id = category&.id.to_i + end + # 作业的基本设置复制 new_homework.homework_detail_manual = HomeworkDetailManual.new new_homework_detail_manual = new_homework.homework_detail_manual From fdbccae6c8052ec5c68b69b24f2d95ace05bacf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Wed, 11 Mar 2020 18:22:58 +0800 Subject: [PATCH 04/21] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../coursesPublic/ModulationModal_exercise.js | 4 +- .../courses/exercise/ExerciseListItem.js | 21 ++- .../courses/exercise/Exercisesetting.js | 125 +++++++----------- .../exercise/Studentshavecompletedthelist.js | 46 +++++-- .../exercise/Testpapersettinghomepage.js | 18 ++- 5 files changed, 120 insertions(+), 94 deletions(-) diff --git a/public/react/src/modules/courses/coursesPublic/ModulationModal_exercise.js b/public/react/src/modules/courses/coursesPublic/ModulationModal_exercise.js index 7c6e6cf6e..4950d10d0 100644 --- a/public/react/src/modules/courses/coursesPublic/ModulationModal_exercise.js +++ b/public/react/src/modules/courses/coursesPublic/ModulationModal_exercise.js @@ -42,8 +42,8 @@ class ModulationModal_exercise extends Component { } componentDidMount = () => { - console.log("ModulationModal_exercise"); - console.log(this.props); + // console.log("ModulationModal_exercise"); + // console.log(this.props); this.setState({ subjective_score: this.props.subjective_score, objective_score: this.props.objective_score, diff --git a/public/react/src/modules/courses/exercise/ExerciseListItem.js b/public/react/src/modules/courses/exercise/ExerciseListItem.js index 52f05bb6d..f9f3288e8 100644 --- a/public/react/src/modules/courses/exercise/ExerciseListItem.js +++ b/public/react/src/modules/courses/exercise/ExerciseListItem.js @@ -77,7 +77,6 @@ class ExerciseListItem extends Component{ const IsAdmin =this.props.isAdmin(); const IsStudent =this.props.isStudent(); - // console.log(this.props.current_user.user_id) return(
window.$(`.exerciseitem${index} input`).click() }> { @@ -189,8 +188,24 @@ class ExerciseListItem extends Component{ { IsAdmin &&
- this.toDetailPage(`/classrooms/${coursesId}/exercises/${item.id}/student_exercise_list?tab=0`)}>查看详情 - 编辑 + + + { + item&&item.assistant_auth===true? + this.toDetailPage(`/classrooms/${coursesId}/exercises/${item.id}/student_exercise_list?tab=0`)}>查看详情 + : + this.toDetailPage(`/classrooms/${coursesId}/exercises/${item.id}/student_exercise_list?tab=0`)}>查看详情 + + } + { + item&&item.assistant_auth===true? + 编辑 + : + "" + } + 设置
} diff --git a/public/react/src/modules/courses/exercise/Exercisesetting.js b/public/react/src/modules/courses/exercise/Exercisesetting.js index 0e613a554..504c73456 100644 --- a/public/react/src/modules/courses/exercise/Exercisesetting.js +++ b/public/react/src/modules/courses/exercise/Exercisesetting.js @@ -75,10 +75,11 @@ class Exercisesetting extends Component{ limit:10, searchtext:"", order: "end_at", + assistant_auth:false } - console.log("Exercisesetting"); - console.log("69"); - console.log(props); + // console.log("Exercisesetting"); + // console.log("69"); + // console.log(props); } _getRequestParams() { const { order, exercise_group_id,searchtext, page ,limit} = this.state @@ -92,6 +93,10 @@ class Exercisesetting extends Component{ } //加载 componentDidMount=()=>{ + this.setState({ + assistant_auth:this.props.assistant_auth, + }) + this.getSettingInfo(); // window.addEventListener('click', this.handleClick); @@ -113,6 +118,11 @@ class Exercisesetting extends Component{ if(prevProps.Commonheadofthetestpaper!= this.props.Commonheadofthetestpaper){ this.editSetting() } + if(prevProps.assistant_auth!= this.props.assistant_auth){ + this.setState({ + assistant_auth:this.props.assistant_auth, + }) + } } _getRequestParams() { @@ -348,10 +358,16 @@ class Exercisesetting extends Component{ this.commitSetting((result)=>{ console.log(result) - if(result.status==200){ + if(result.status===200){ this.props.showNotification(`${result.data.message}`); this.getSettingInfo(1); this.cancelEdit(); + try { + this.props.assistantauthoritys(this.state.assistant_auth); + + }catch (e) { + + } } }) } @@ -371,6 +387,12 @@ class Exercisesetting extends Component{ this.props.showNotification(`${result.data.message}`); this.cancelEdit(); this.getSettingInfo(1); + try { + this.props.assistantauthoritys(this.state.assistant_auth); + + }catch (e) { + + } } }); @@ -386,11 +408,12 @@ class Exercisesetting extends Component{ publish_time:this.state.publish_time, end_time:this.state.end_time, show_statistic:this.state.show_statistic, - choice_random:this.state.choice_random, + choice_random:this.state.choice_random, score_open:this.state.score_open, answer_open:this.state.answer_open, question_random:this.state.question_random, time:this.state.time, + assistant_auth:this.state.assistant_auth, } }else{ let list=this.state.rules; @@ -403,7 +426,6 @@ class Exercisesetting extends Component{ } lists.push(newlist) }) - params={ unified_setting:this.state.unified_setting, show_statistic:this.state.show_statistic, @@ -413,6 +435,7 @@ class Exercisesetting extends Component{ answer_open:this.state.answer_open, publish_time_groups:lists, time:this.state.time, + assistant_auth:this.state.assistant_auth, } } axios.post((url),params).then((result)=>{ @@ -491,6 +514,12 @@ class Exercisesetting extends Component{ }) } + assistantauthority=(e)=>{ + this.setState({ + assistant_auth:e.target.checked + }) + } + onChangeTimepublish=(date, dateString)=>{ if(date===null){ this.setState({ @@ -608,7 +637,9 @@ class Exercisesetting extends Component{ // console.log("asdasdasda"); // console.log(this.props); // console.log(this.props.Commonheadofthetestpaper); - return( + + + return(
-

公开设置

+

属性设置

@@ -790,7 +821,7 @@ class Exercisesetting extends Component{ (选中,则在试卷截止时间之后,已提交答题的学生可以查看试卷题目的答案,否则不能查看)

-

+

{getFieldDecorator('show_statistic') ( @@ -799,6 +830,15 @@ class Exercisesetting extends Component{ (选中,则在试卷截止时间之后,已提交答题的学生可以查看答题统计,否则不能查看)

+

+ + {getFieldDecorator('assistantauthority') + ( + 助教权限 + )} + + (勾选则允许助教查看答案) +

@@ -820,70 +860,3 @@ const WrappedExercisesetting = Form.create({ name: 'exercisesetting' })(Exercise export default WrappedExercisesetting; -// //提交form表单 -// handleSubmit = (e) => { -// -// let{unified_setting,answer_open}=this.state; -// e.preventDefault(); -// let exercise_id=this.props.match.params.Id; -// -// this.props.form.validateFieldsAndScroll((err, values) => { -// debugger -// if(!err){ -// // 第一次进行问卷设置或者勾选了统一设置 -// if(unified_setting==true){ -// if(this.state.p_flag == false && this.state.e_flag == true){ -// // 选择了发布时间但截至时间没有选择 -// this.setState({ -// modalsType:true, -// modalsTopval:"请选择截止时间", -// loadtype:true, -// modalSave:this.cancelBox -// }) -// return; -// }else if(this.state.p_flag == true && this.state.e_flag == true){ -// // 如果两个时间都没有填写则弹出立即发布弹框 -// let{publish_time,end_time}=this.state -// if(publish_time==undefined && end_time ==undefined){ -// -// }else{ -// // 否则就是选择的时间错误 -// this.setState({ -// modalsType:true, -// modalsTopval:"请选择正确的发布时间和截止时间", -// loadtype:true, -// modalSave:this.cancelBox -// }) -// } -// return; -// } -// } -// -// let url=`/exercises/${exercise_id}/commit_setting.json`; -// let params=[]; -// if(values.unitSet){ -// params={ -// unified_setting:values.unitSet, -// publish_time:this.state.publish_time, -// end_time:this.state.end_time, -// show_result:values.public, -// un_anonymous:values.real -// } -// }else{ -// params={ -// unified_setting:values.unitSet, -// show_result:values.public, -// un_anonymous:values.real, -// publish_time_groups:this.state.rules -// } -// } -// axios.post((url),{params}).then((result)=>{ -// if(result.status==200){ -// this.props.showNotification(`${result.data.message}`); -// } -// }).catch((error)=>{ -// console.log(error); -// }) -// } -// }) -// } diff --git a/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js b/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js index 9c6e8a87b..e9568a1cf 100644 --- a/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js +++ b/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js @@ -1158,8 +1158,19 @@ class Studentshavecompletedthelist extends Component { { record.submitstate === "未提交"||record.commit_method===5? - this.Adjustment(record.user_id)}>评阅 + ( + this.props.assistant_auth&&this.props.assistant_auth===true? + ( + this.props.Commonheadofthetestpaper && this.props.Commonheadofthetestpaper.exercise_status===3? + this.Adjustment(record.user_id)}>评阅 + : + -- + ) + : + this.Adjustment(record.user_id)}>评阅 + ) :record.submitstate === "已提交"? { record.submitstate === "未提交"||record.commit_method===5? - this.Adjustment(record.user_id)}>评阅 + ( + this.props.assistant_auth&&this.props.assistant_auth===true? + ( + this.props.Commonheadofthetestpaper && this.props.Commonheadofthetestpaper.exercise_status===3? + this.Adjustment(record.user_id)}>评阅 + : + -- + ) + : + this.Adjustment(record.user_id)}>评阅 + ) :record.submitstate === "已提交"? { - console.log("Adjustment"); - console.log(e); + // console.log("Adjustment"); + // console.log(e); + if(this.state.objective_score===0&&this.state.subjective_score===0){ + this.props.showNotification('试卷题型分被限制为0分,不能调分,请到编辑试卷中修改题型分数'); + + return + } + + + this.setState({ testpapergradingboll: true, exeuserid: e, @@ -2828,8 +2858,8 @@ class Studentshavecompletedthelist extends Component { // //console.log("this.props.Commonheadofthetestpaper.exercise_status"); // //console.log(this.props.Commonheadofthetestpaper&&this.props.Commonheadofthetestpaper.exercise_status); // //console.log(exercise_status); - console.log("Studentshavecompletedthelis123123t"); - console.log(columnss); + // console.log("Studentshavecompletedthelis123123t"); + // console.log(columnss); return ( isAdmin === true ? ( diff --git a/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js b/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js index ce63ca526..17f95b352 100644 --- a/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js +++ b/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js @@ -35,6 +35,7 @@ class Testpapersettinghomepage extends Component{ DownloadMessageval:undefined, donwloading:false, exercise_status:3, + assistant_auth:false, //设置助教 } } //切换tab @@ -72,6 +73,7 @@ class Testpapersettinghomepage extends Component{ Commonheadofthetestpaper:response.data, current_status:response.data.user_permission.current_status, exercise_status:response.data.exercise_status, + assistant_auth:response.data.assistant_auth, }) // console.log(JSON.stringify(response.data.show_statistic)); @@ -85,6 +87,12 @@ class Testpapersettinghomepage extends Component{ } + assistantauthoritys=(bool)=>{ + this.setState({ + assistant_auth:bool, + }) + } + Ecerciseacallagain=()=>{ this.setState({ visible:true @@ -287,7 +295,7 @@ class Testpapersettinghomepage extends Component{ this.props.history.goBack() } render(){ - let {tab,visible,Commonheadofthetestpaper,exercise_status}=this.state; + let {tab,visible,Commonheadofthetestpaper,exercise_status,assistant_auth}=this.state; const isAdmin =this.props.isAdmin(); const isStudent = this.props.isStudent(); // TODO @@ -461,22 +469,22 @@ class Testpapersettinghomepage extends Component{ /> { // 教师列表 - parseInt(tab[0])==0 ? this.setcourse_groupysls(value)} current_status = {this.state.current_status} Commonheadofthetestpaper={this.state.Commonheadofthetestpaper} yslstustate={[`${polls_status[Commonheadofthetestpaper && Commonheadofthetestpaper.exercise_status]}`]}>:"" + parseInt(tab[0])==0 ? this.setcourse_groupysls(value)} current_status = {this.state.current_status} Commonheadofthetestpaper={this.state.Commonheadofthetestpaper} yslstustate={[`${polls_status[Commonheadofthetestpaper && Commonheadofthetestpaper.exercise_status]}`]}>:"" } {/*统计结果*/} { - parseInt(tab[0])==1 ? :"" + parseInt(tab[0])==1 ? :"" } { - parseInt(tab[0])==2 ? :"" + parseInt(tab[0])==2 ? :"" } { - parseInt(tab[0])==3 ? :"" + parseInt(tab[0])==3 ? this.assistantauthoritys(bool)}>:"" }
From dca59351cf3d07dc1491717433902ad08ba964ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Wed, 11 Mar 2020 18:24:54 +0800 Subject: [PATCH 05/21] =?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/exercise/Studentshavecompletedthelist.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js b/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js index e9568a1cf..b0a337645 100644 --- a/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js +++ b/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js @@ -2797,7 +2797,7 @@ class Studentshavecompletedthelist extends Component { // console.log("Adjustment"); // console.log(e); if(this.state.objective_score===0&&this.state.subjective_score===0){ - this.props.showNotification('试卷题型分被限制为0分,不能调分,请到编辑试卷中修改题型分数'); + this.props.showNotification('试卷题型分被限制为0分,不能调分,请点击编辑试卷修改题型分数'); return } From 4c1de925add462fcd1bb71f85cece807620e3724 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Wed, 11 Mar 2020 19:17:56 +0800 Subject: [PATCH 06/21] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/exercise/ExerciseListItem.js | 35 +++++++++------ .../courses/exercise/Exercisesetting.js | 20 +++++++++ .../exercise/Studentshavecompletedthelist.js | 38 ++++++++++------ .../exercise/Testpapersettinghomepage.js | 43 +++++++++++++++++-- public/react/src/modules/tpm/TPMIndexHOC.js | 5 +++ 5 files changed, 111 insertions(+), 30 deletions(-) diff --git a/public/react/src/modules/courses/exercise/ExerciseListItem.js b/public/react/src/modules/courses/exercise/ExerciseListItem.js index f9f3288e8..a4bdc5c29 100644 --- a/public/react/src/modules/courses/exercise/ExerciseListItem.js +++ b/public/react/src/modules/courses/exercise/ExerciseListItem.js @@ -75,7 +75,9 @@ class ExerciseListItem extends Component{ let{item,checkBox,index}=this.props; let {coursesId,Id}=this.props.match.params const IsAdmin =this.props.isAdmin(); - const IsStudent =this.props.isStudent(); + const isAssistant=this.props.isAssistant(); + + const IsStudent =this.props.isStudent(); return(
window.$(`.exerciseitem${index} input`).click() }> @@ -188,24 +190,31 @@ class ExerciseListItem extends Component{ { IsAdmin &&
- - { - item&&item.assistant_auth===true? - this.toDetailPage(`/classrooms/${coursesId}/exercises/${item.id}/student_exercise_list?tab=0`)}>查看详情 + isAssistant===true? + ( + item&&item.assistant_auth===true? + this.toDetailPage(`/classrooms/${coursesId}/exercises/${item.id}/student_exercise_list?tab=0`)}>查看详情 + : + this.toDetailPage(`/classrooms/${coursesId}/exercises/${item.id}/student_exercise_list?tab=0`)}>查看详情 + ) : - this.toDetailPage(`/classrooms/${coursesId}/exercises/${item.id}/student_exercise_list?tab=0`)}>查看详情 - + this.toDetailPage(`/classrooms/${coursesId}/exercises/${item.id}/student_exercise_list?tab=0`)}>查看详情 } + { - item&&item.assistant_auth===true? - 编辑 + isAssistant===true? + ( + item&&item.assistant_auth===true? + 编辑 + : + "" + ) : - "" + 编辑 } - 设置
} diff --git a/public/react/src/modules/courses/exercise/Exercisesetting.js b/public/react/src/modules/courses/exercise/Exercisesetting.js index 504c73456..ed3db102c 100644 --- a/public/react/src/modules/courses/exercise/Exercisesetting.js +++ b/public/react/src/modules/courses/exercise/Exercisesetting.js @@ -97,6 +97,8 @@ class Exercisesetting extends Component{ assistant_auth:this.props.assistant_auth, }) + + this.getSettingInfo(); // window.addEventListener('click', this.handleClick); @@ -113,6 +115,24 @@ class Exercisesetting extends Component{ if(this.props.isAdmin() === false){ this.cancelEdit() } + + try { + //是否为助教 + if(this.props.isAssistant()===true){ + //如果是助教是否有权限 + if(this.props.assistant_auth===true){ + this.setState({ + flagPageEdit:true + }) + }else{ + this.setState({ + flagPageEdit:false + }) + } + } + }catch (e) { + + } } componentDidUpdate = (prevProps) => { if(prevProps.Commonheadofthetestpaper!= this.props.Commonheadofthetestpaper){ diff --git a/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js b/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js index b0a337645..12e3f4235 100644 --- a/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js +++ b/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js @@ -1158,12 +1158,17 @@ class Studentshavecompletedthelist extends Component { { record.submitstate === "未提交"||record.commit_method===5? - ( - this.props.assistant_auth&&this.props.assistant_auth===true? - ( - this.props.Commonheadofthetestpaper && this.props.Commonheadofthetestpaper.exercise_status===3? - this.Adjustment(record.user_id)}>评阅 + (//是否助教 + this.props.isAssistant()&&this.props.isAssistant()===true? + (//助教是否有权限 + this.props.assistant_auth&&this.props.assistant_auth===true? + (//是否截止 + this.props.Commonheadofthetestpaper && this.props.Commonheadofthetestpaper.exercise_status===3? + this.Adjustment(record.user_id)}>评阅 + : + -- + ) : -- ) @@ -1178,7 +1183,7 @@ class Studentshavecompletedthelist extends Component { : -- } - + ) }, ], @@ -1387,12 +1392,17 @@ class Studentshavecompletedthelist extends Component { { record.submitstate === "未提交"||record.commit_method===5? - ( - this.props.assistant_auth&&this.props.assistant_auth===true? - ( - this.props.Commonheadofthetestpaper && this.props.Commonheadofthetestpaper.exercise_status===3? - this.Adjustment(record.user_id)}>评阅 + (//是否助教 + this.props.isAssistant()&&this.props.isAssistant()===true? + (//助教是否有权限 + this.props.assistant_auth&&this.props.assistant_auth===true? + (//是否截止 + this.props.Commonheadofthetestpaper && this.props.Commonheadofthetestpaper.exercise_status===3? + this.Adjustment(record.user_id)}>评阅 + : + -- + ) : -- ) @@ -1407,7 +1417,7 @@ class Studentshavecompletedthelist extends Component { : -- } - + ) }, ],//columnsystwo 也会被columnsys当作参数接收 diff --git a/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js b/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js index 17f95b352..88d1755f0 100644 --- a/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js +++ b/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js @@ -297,7 +297,9 @@ class Testpapersettinghomepage extends Component{ render(){ let {tab,visible,Commonheadofthetestpaper,exercise_status,assistant_auth}=this.state; const isAdmin =this.props.isAdmin(); - const isStudent = this.props.isStudent(); + const isAssistant=this.props.isAssistant(); + + const isStudent = this.props.isStudent(); // TODO //console.log(Commonheadofthetestpaper.exercise_status); @@ -361,7 +363,26 @@ class Testpapersettinghomepage extends Component{
- {this.props.isAdmin()===true? + {isAssistant===true? + ( + assistant_auth===true? + + 答题列表 + 统计结果 + 试卷预览 + 设置 + + : + + 答题列表 + {Commonheadofthetestpaper&&Commonheadofthetestpaper.show_statistic===true? + Commonheadofthetestpaper && Commonheadofthetestpaper.exercise_status===3? + 统计结果:"":""} + 设置 + + ) + : + this.props.isAdmin()===true? 答题列表 统计结果 @@ -445,7 +466,23 @@ class Testpapersettinghomepage extends Component{ getsetdata={this.getsetdata} > :"":""} - {isAdmin === true? 编辑试卷:""} + {/*const isAdminOrTeacher*/} + {/*assistant_auth===true*/} + {/**/} + {isAdmin === true? + ( + isAssistant===true? + ( + assistant_auth===true? + 编辑试卷 + : + "" + ) + + : + 编辑试卷 + ) + :""} {isAdmin === false && this.props.current_user !== undefined? Commonheadofthetestpaper&&Commonheadofthetestpaper.user_permission.current_status===2? diff --git a/public/react/src/modules/tpm/TPMIndexHOC.js b/public/react/src/modules/tpm/TPMIndexHOC.js index 27ed40437..1731a55fa 100644 --- a/public/react/src/modules/tpm/TPMIndexHOC.js +++ b/public/react/src/modules/tpm/TPMIndexHOC.js @@ -276,6 +276,10 @@ export function TPMIndexHOC(WrappedComponent) { isAdminOrTeacher = () => { return this.state.coursedata&&this.state.coursedata.course_identity < 4 } + // 助教===4 + isAssistant=()=>{ + return this.state.coursedata&&this.state.coursedata.course_identity ===4 + } // 超管、运维、课堂管理、老师、助教0-4 isAdmin = () => { return this.state.coursedata&&this.state.coursedata.course_identity < 5 @@ -711,6 +715,7 @@ export function TPMIndexHOC(WrappedComponent) { isAdmin: this.isAdmin, isAdminOrTeacher: this.isAdminOrTeacher, + isAssistant:this.isAssistant, isStudent: this.isStudent, isAdminOrStudent: this.isAdminOrStudent, isNotMember: this.isNotMember, From 7e3a7fb8914263be0bc09e7e56630f4d4f7f36f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Wed, 11 Mar 2020 19:27:07 +0800 Subject: [PATCH 07/21] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/exercise/Exercisesetting.js | 28 +++++++++++++------ 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/public/react/src/modules/courses/exercise/Exercisesetting.js b/public/react/src/modules/courses/exercise/Exercisesetting.js index ed3db102c..0acfec901 100644 --- a/public/react/src/modules/courses/exercise/Exercisesetting.js +++ b/public/react/src/modules/courses/exercise/Exercisesetting.js @@ -674,13 +674,22 @@ class Exercisesetting extends Component{ 发布设置 { !flagPageEdit&&this.props.isAdmin()===true ? - - 编辑设置 - {/**/} - {/**/} - {/**/} - - :"" + ( + this.props.isAssistant()===true? + ( + this.props.assistant_auth===true? + + 编辑设置 + + : + "" + ) + : + + 编辑设置 + + ) + :"" }

@@ -868,7 +877,10 @@ class Exercisesetting extends Component{
取消 -
:"" +
+ + + :"" } From 2f024d6bcee4b2e2d646e5160caa15af09d3dab1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Wed, 11 Mar 2020 19:36:11 +0800 Subject: [PATCH 08/21] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/coursesDetail/CoursesBanner.js | 25 +++++++++++-------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/public/react/src/modules/courses/coursesDetail/CoursesBanner.js b/public/react/src/modules/courses/coursesDetail/CoursesBanner.js index 98c56ff37..f54c99978 100644 --- a/public/react/src/modules/courses/coursesDetail/CoursesBanner.js +++ b/public/react/src/modules/courses/coursesDetail/CoursesBanner.js @@ -130,16 +130,17 @@ class CoursesBanner extends Component { axios.get(url,{params: dataqueryss }).then((result) => { - if(result.data.status===-2){ - // this.setState({ - // AccountProfiletype:true, - // content:result.data.message, - // okText:"立即认证", - // cannelText:"稍后认证", - // okHref:`/account/certification`, - // Accounturltype:true - // }) - }else{ + try { + if(result.data.status===-2){ + // this.setState({ + // AccountProfiletype:true, + // content:result.data.message, + // okText:"立即认证", + // cannelText:"稍后认证", + // okHref:`/account/certification`, + // Accounturltype:true + // }) + }else{ if( result!=undefined){ let data = result.data; this.setState({ @@ -150,8 +151,12 @@ class CoursesBanner extends Component { }else{ this.onloadupdatabanner() } + } + }catch (e) { + } + }) }; foo=(url)=> { From 40f5cbd4a1557f046248d5d503b4bcc127b3c432 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Wed, 11 Mar 2020 19:57:25 +0800 Subject: [PATCH 09/21] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/exercise/Exercisesetting.js | 30 +++++++++++++++++-- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/public/react/src/modules/courses/exercise/Exercisesetting.js b/public/react/src/modules/courses/exercise/Exercisesetting.js index 0acfec901..2a43f42fb 100644 --- a/public/react/src/modules/courses/exercise/Exercisesetting.js +++ b/public/react/src/modules/courses/exercise/Exercisesetting.js @@ -604,9 +604,33 @@ class Exercisesetting extends Component{ modalSave:this.cancelBox }) }else{ - this.setState({ - flagPageEdit:true - }) + if(this.props.isAdmin()===true){ + try { + //是否为助教 + if(this.props.isAssistant()===true){ + //如果是助教是否有权限 + if(this.props.assistant_auth===true){ + this.setState({ + flagPageEdit:true + }) + }else{ + this.setState({ + flagPageEdit:false + }) + } + }else{ + //是老师 + this.setState({ + flagPageEdit:true + }) + } + }catch (e) { + this.setState({ + flagPageEdit:true + }) + } + } + } } //取消编辑 From 183892304162fe91ad89d63af71809c2486dc8da Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Wed, 11 Mar 2020 20:28:25 +0800 Subject: [PATCH 10/21] =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E5=AD=90=E7=9B=AE?= =?UTF-8?q?=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/homework_common.rb | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/app/models/homework_common.rb b/app/models/homework_common.rb index a6a919981..58a420581 100644 --- a/app/models/homework_common.rb +++ b/app/models/homework_common.rb @@ -69,17 +69,18 @@ class HomeworkCommon < ApplicationRecord # 作业对应的子目录/父目录名称 def category_info - case self.homework_type - when 'normal' - {category_id: course.common_course_modules.first.try(:id), category_name: course.common_course_modules.first.try(:module_name), main: 1} - when 'group' - {category_id: course.group_course_modules.first.try(:id), category_name: course.group_course_modules.first.try(:module_name), main: 1} - when 'practice' - if self.course_second_category.present? - {category_id: self.course_second_category.try(:id), category_name: self.course_second_category.try(:name), main: 0} - else - {category_id: course.shixun_course_modules.take.try(:id), category_name: course.shixun_course_modules.take.try(:module_name), main: 1} - end + if self.course_second_category.present? + {category_id: self.course_second_category.try(:id), category_name: self.course_second_category.try(:name), main: 0} + else + course_module = case homework_type + when 'normal' + course.common_course_modules.take + when 'group' + course.group_course_modules.take + when 'practice' + course.shixun_course_modules.take + end + {category_id: course_module.try(:id), category_name: course_module.try(:module_name), main: 1} end end From c48b37699d138b542684885f111e3474d0b474d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Wed, 11 Mar 2020 20:29:05 +0800 Subject: [PATCH 11/21] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../exercise/Studentshavecompletedthelist.js | 48 ++++++++++++++++--- 1 file changed, 42 insertions(+), 6 deletions(-) diff --git a/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js b/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js index 12e3f4235..755537798 100644 --- a/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js +++ b/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js @@ -1177,9 +1177,26 @@ class Studentshavecompletedthelist extends Component { target="_blank" onClick={() => this.Adjustment(record.user_id)}>评阅 ) :record.submitstate === "已提交"? - {record.finalscore} + (//是否助教 + this.props.isAssistant()&&this.props.isAssistant()===true? + (//助教是否有权限 + this.props.assistant_auth&&this.props.assistant_auth===true? + (//是否截止 + this.props.Commonheadofthetestpaper && this.props.Commonheadofthetestpaper.exercise_status===3? + {record.finalscore} + : + -- + ) + : + -- + ) + : + {record.finalscore} + ) : -- } @@ -1411,9 +1428,28 @@ class Studentshavecompletedthelist extends Component { target="_blank" onClick={() => this.Adjustment(record.user_id)}>评阅 ) :record.submitstate === "已提交"? - {record.finalscore} + (//是否助教 + this.props.isAssistant()&&this.props.isAssistant()===true? + (//助教是否有权限 + this.props.assistant_auth&&this.props.assistant_auth===true? + (//是否截止 + this.props.Commonheadofthetestpaper && this.props.Commonheadofthetestpaper.exercise_status===3? + //是助教就是评阅 + {record.finalscore} + : + -- + ) + : + -- + ) + : + //是老师就是评阅 + {record.finalscore} + ) : -- } From c16057ba7d188286f98dc26f409c072c93043954 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Wed, 11 Mar 2020 20:43:41 +0800 Subject: [PATCH 12/21] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../exercise/Studentshavecompletedthelist.js | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js b/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js index 755537798..5944e9c6f 100644 --- a/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js +++ b/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js @@ -1162,6 +1162,9 @@ class Studentshavecompletedthelist extends Component { this.props.isAssistant()&&this.props.isAssistant()===true? (//助教是否有权限 this.props.assistant_auth&&this.props.assistant_auth===true? + this.Adjustment(record.user_id)}>评阅 + : (//是否截止 this.props.Commonheadofthetestpaper && this.props.Commonheadofthetestpaper.exercise_status===3? -- ) - : - -- ) : {record.finalscore} + : (//是否截止 this.props.Commonheadofthetestpaper && this.props.Commonheadofthetestpaper.exercise_status===3? -- ) - : - -- ) : this.Adjustment(record.user_id)}>评阅 + : (//是否截止 this.props.Commonheadofthetestpaper && this.props.Commonheadofthetestpaper.exercise_status===3? -- ) - : - -- ) : {record.finalscore} + : (//是否截止 this.props.Commonheadofthetestpaper && this.props.Commonheadofthetestpaper.exercise_status===3? //是助教就是评阅 @@ -1441,8 +1449,6 @@ class Studentshavecompletedthelist extends Component { : -- ) - : - -- ) : //是老师就是评阅 From 01d8a87c3903a8b1ec9539657e2cc1e6377a80db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Wed, 11 Mar 2020 20:54:44 +0800 Subject: [PATCH 13/21] =?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/exercise/Exercisesetting.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/courses/exercise/Exercisesetting.js b/public/react/src/modules/courses/exercise/Exercisesetting.js index 2a43f42fb..0bd596c35 100644 --- a/public/react/src/modules/courses/exercise/Exercisesetting.js +++ b/public/react/src/modules/courses/exercise/Exercisesetting.js @@ -890,7 +890,7 @@ class Exercisesetting extends Component{ 助教权限 )} - (勾选则允许助教查看答案) + (选中,则允许助教查看答案)

From 119a76a58557daeae568649a63b424b1a42f82f7 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Wed, 11 Mar 2020 21:02:48 +0800 Subject: [PATCH 14/21] =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E7=9A=84=E5=AD=90?= =?UTF-8?q?=E7=9B=AE=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_commons_controller.rb | 10 +++++++++- app/views/homework_commons/edit.json.jbuilder | 12 +++++++++++- app/views/homework_commons/new.json.jbuilder | 10 +++++++++- 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/app/controllers/homework_commons_controller.rb b/app/controllers/homework_commons_controller.rb index adf0dc6bf..faea30242 100644 --- a/app/controllers/homework_commons_controller.rb +++ b/app/controllers/homework_commons_controller.rb @@ -359,6 +359,9 @@ class HomeworkCommonsController < ApplicationController def new tip_exception("type参数有误") if params[:type].blank? || ![1, 3].include?(params[:type].to_i) @homework_type = params[:type].to_i + module_type = params[:type].to_i == 1 ? "common_homework" : "group_homework" + @main_category = @course.course_modules.find_by(module_type: module_type) + @category = @main_category.course_second_categories.find_by(id: params[:category]) if params[:category].present? end def create @@ -409,7 +412,12 @@ class HomeworkCommonsController < ApplicationController end def edit - + if @homework.course_second_category_id == 0 + module_type = @homework.homework_type == "normal" ? "common_homework" : "group_homework" + @main_category = @course.course_modules.find_by(module_type: module_type) + else + @category = @homework.course_second_category + end end def update diff --git a/app/views/homework_commons/edit.json.jbuilder b/app/views/homework_commons/edit.json.jbuilder index 49dc11dd8..d2eb865ac 100644 --- a/app/views/homework_commons/edit.json.jbuilder +++ b/app/views/homework_commons/edit.json.jbuilder @@ -1,6 +1,16 @@ json.course_id @course.id json.course_name @course.name -json.category @homework.category_info +# json.category @homework.category_info + +json.category do + if @category.present? + json.category_id @category.id + json.category_name @category.name + else + json.category_id @main_category&.id + json.category_name @main_category&.module_name + end +end json.(@homework, :id, :name, :description, :reference_answer) diff --git a/app/views/homework_commons/new.json.jbuilder b/app/views/homework_commons/new.json.jbuilder index 82a5d78fa..9a703d40f 100644 --- a/app/views/homework_commons/new.json.jbuilder +++ b/app/views/homework_commons/new.json.jbuilder @@ -1,3 +1,11 @@ json.course_id @course.id json.course_name @course.name -json.category @course.category_info(@homework_type == 1 ? "common_homework" : "group_homework") \ No newline at end of file +json.category do + if @category.present? + json.category_id @category.id + json.category_name @category.name + else + json.category_id @main_category&.id + json.category_name @main_category&.module_name + end +end \ No newline at end of file From 3bf8e6d80175ad6402d8a4ed374ef45e7ac93074 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Wed, 11 Mar 2020 21:05:58 +0800 Subject: [PATCH 15/21] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../exercise/Studentshavecompletedthelist.js | 271 +----------------- 1 file changed, 7 insertions(+), 264 deletions(-) diff --git a/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js b/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js index 5944e9c6f..1d391bb2c 100644 --- a/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js +++ b/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js @@ -1207,262 +1207,7 @@ class Studentshavecompletedthelist extends Component { ) }, ], - columnsystwo: [ - { - title: '序号', - dataIndex: 'number', - key: 'number', - align: 'center', - className: "edu-txt-center font-14", - render: (text, record) => ( - - {record.number === "--" ? - -- - : - {record.number} - } - - ) - }, - { - title: '姓名', - dataIndex: 'name', - key: 'name', - align: 'center', - className: "edu-txt-center font-14", - - render: (text, record) => ( - - {record.name==="--"? - {record.name} - : - {record.name} - } - - ) - }, - { - title: '学号', - dataIndex: 'stduynumber', - key: 'stduynumber', - align: 'center', - className: "edu-txt-center font-14", - sorter: true, - sortDirections: sortDirections, - render: (text, record) => ( - - {record.stduynumber === "--" ? - {record.stduynumber} - : - {record.stduynumber} - } - - ), - }, - { - title: '分班', - key: 'classroom', - dataIndex: 'classroom', - align: 'center', - className: "edu-txt-center font-14 maxnamewidth260 ", - width:'260px', - render: (text, record) => ( - - {record.classroom==="--"? - {record.classroom} - : - {record.classroom} - } - - ) - }, - { - title: '提交状态', - dataIndex: 'submitstate', - key: 'submitstate', - align: 'center', - className: "edu-txt-center font-14", - render: (text, record) => ( - - {record.submitstate} - - - ) - - }, - { - title: '提交时间', - dataIndex: 'updatetime', - key: 'updatetime', - align: 'center', - className: "edu-txt-center font-14", - sorter: true, - defaultSortOrder: 'descend', - sortDirections: sortDirections, - render: (text, record) => ( - - {record.updatetime==="--"? - -- - : - {record.updatetime} - } - - ), - }, - { - title: '客观题得分', - dataIndex: 'completion', - key: 'completion', - align: 'center', - className: "edu-txt-center font-14", - render: (text, record) => ( - - {record.completion=== "--"? - -- - : - {record.completion} - } - - ) - }, - { - title: '主观题得分', - dataIndex: 'levelscore', - key: 'levelscore', - align: 'center', - className: "edu-txt-center font-14", - render: (text, record) => ( - - {record.levelscore==="--"? - -- - : - {record.levelscore} - } - - ) - }, - { - title: '最终成绩', - dataIndex: 'efficiencyscore', - key: 'efficiencyscore', - align: 'center', - className: "edu-txt-center font-14", - sorter: true, - sortDirections: sortDirections, - render: (text, record) => ( - - {record.efficiencyscore === "--" ? - -
未评分
-
}> - -- - - : - record.commit_method===5? - -
最终调整成绩:{record.efficiencyscore}分
-
}> - 90 ? { - color: '#DD1717', - textAlign: "center", - } : parseInt(record.efficiencyscore) <= 90 ? { - color: '#FF6800', - textAlign: "center", - } : parseInt(record.efficiencyscore) <= 60 ? { - color: '#747A7F', - textAlign: "center", - } : { - color: '#747A7F', - textAlign: "center", - }}>{record.efficiencyscore} - - : - 90 ? { - color: '#DD1717', - textAlign: "center", - } : parseInt(record.efficiencyscore) <= 90 ? { - color: '#FF6800', - textAlign: "center", - } : parseInt(record.efficiencyscore) <= 60 ? { - color: '#747A7F', - textAlign: "center", - } : { - color: '#747A7F', - textAlign: "center", - }}>{record.efficiencyscore} - } - - ) - }, - { - title: '操作', - dataIndex: 'finalscore', - key: 'finalscore', - align: 'center', - className: "edu-txt-center font-14", - render: (text, record) => ( - - { - record.submitstate === "未提交"||record.commit_method===5? - (//是否助教 - this.props.isAssistant()&&this.props.isAssistant()===true? - (//助教是否有权限 - this.props.assistant_auth&&this.props.assistant_auth===true? - this.Adjustment(record.user_id)}>评阅 - : - (//是否截止 - this.props.Commonheadofthetestpaper && this.props.Commonheadofthetestpaper.exercise_status===3? - this.Adjustment(record.user_id)}>评阅 - : - -- - ) - ) - : - this.Adjustment(record.user_id)}>评阅 - ) - :record.submitstate === "已提交"? - (//是否助教 - this.props.isAssistant()&&this.props.isAssistant()===true? - (//助教是否有权限 - this.props.assistant_auth&&this.props.assistant_auth===true? - {record.finalscore} - : - (//是否截止 - this.props.Commonheadofthetestpaper && this.props.Commonheadofthetestpaper.exercise_status===3? - //是助教就是评阅 - {record.finalscore} - : - -- - ) - ) - : - //是老师就是评阅 - {record.finalscore} - ) - : - -- - } - - ) - }, - ],//columnsystwo 也会被columnsys当作参数接收 + columnsystwo: [],// 也会被columnsys当作参数接收 exercise_status:0, order_type: "desc", exeuserid: 0, @@ -1523,20 +1268,18 @@ class Studentshavecompletedthelist extends Component { } componentDidMount() { - // if(this.props.isAdmin() === true){ - // this.Teacherliststudentlistsy(); - // //console.log("1111111111111111"); - // //console.log(this.props.isAdmin()); - // }else { + //被columnsys当作参数接收 + this.setState({ + columnsystwo:this.state.columnsys, + }) this.Teacherliststudentlist(); - // //console.log("2222222222222"); - // //console.log(this.props.isAdmin()); - // } + try { this.props.triggerRef(this); }catch (e) { } + } componentWillReceiveProps = (nextProps) => { From bfdb6b13b8a56e8e720a121f9488c91860946fb8 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Wed, 11 Mar 2020 21:06:32 +0800 Subject: [PATCH 16/21] =?UTF-8?q?=E8=B5=84=E6=BA=90=E6=89=80=E5=B1=9E?= =?UTF-8?q?=E7=9B=AE=E5=BD=95id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/files/index.json.jbuilder | 1 + 1 file changed, 1 insertion(+) diff --git a/app/views/files/index.json.jbuilder b/app/views/files/index.json.jbuilder index 0002cf299..e7805c0d8 100644 --- a/app/views/files/index.json.jbuilder +++ b/app/views/files/index.json.jbuilder @@ -14,6 +14,7 @@ json.data do json.partial! "users/user_simple", user: attachment.author end # json.partial! "files/course_groups", attachment_group_settings: attachment.attachment_group_settings + json.category_id attachment.course_second_category_id if @course_second_category_id.to_i == 0 json.category_name attachment.course_second_category&.name end From 41c04d9499787aadc5c5c3087fbebc1cf691f7ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Wed, 11 Mar 2020 21:12:03 +0800 Subject: [PATCH 17/21] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/exercise/Studentshavecompletedthelist.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js b/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js index 1d391bb2c..3b46b680a 100644 --- a/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js +++ b/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js @@ -28,6 +28,7 @@ const RadioGroup = Radio.Group; const CheckboxGroup = Checkbox.Group; const {Option} = Select; //学生老师页面 +let columnsystwo=[]; class Studentshavecompletedthelist extends Component { // http://localhost:3007/courses/1309/exercises/722/exercises/student_exercise_list?debug=s constructor(props) { @@ -1207,7 +1208,7 @@ class Studentshavecompletedthelist extends Component { ) }, ], - columnsystwo: [],// 也会被columnsys当作参数接收 + // 也会被columnsys当作参数接收 exercise_status:0, order_type: "desc", exeuserid: 0, @@ -1269,9 +1270,10 @@ class Studentshavecompletedthelist extends Component { componentDidMount() { //被columnsys当作参数接收 - this.setState({ - columnsystwo:this.state.columnsys, - }) + // console.log("componentDidMount"); + // console.log(columnsystwo); + columnsystwo=this.state.columnsys; + // console.log(columnsystwo); this.Teacherliststudentlist(); try { @@ -1980,7 +1982,7 @@ class Studentshavecompletedthelist extends Component { course_groups: response.data.course_groups, mylistansum:response.data.exercise_types.answer_users+response.data.exercise_types.unanswer_users, loadingstate: false, - columnsys: this.state.columnsystwo, + columnsys: columnsystwo, subjective: response.data.exercise_types.subjective, objective_score: response.data.exercise_types.objective_score, subjective_score: response.data.exercise_types.subjective_score, From 47b544df4e8f333f33ee7429ea9c4ae6e52cc6ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Wed, 11 Mar 2020 21:12:20 +0800 Subject: [PATCH 18/21] =?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/exercise/Studentshavecompletedthelist.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js b/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js index 3b46b680a..c3d4bf465 100644 --- a/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js +++ b/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js @@ -1272,7 +1272,11 @@ class Studentshavecompletedthelist extends Component { //被columnsys当作参数接收 // console.log("componentDidMount"); // console.log(columnsystwo); + try { columnsystwo=this.state.columnsys; + }catch (e) { + + } // console.log(columnsystwo); this.Teacherliststudentlist(); From 1c8452dd289643e84e4c227a55987ceb8a4593f6 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Wed, 11 Mar 2020 21:12:36 +0800 Subject: [PATCH 19/21] =?UTF-8?q?=E8=AF=95=E5=8D=B7=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/exercises/exercise_setting.json.jbuilder | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/exercises/exercise_setting.json.jbuilder b/app/views/exercises/exercise_setting.json.jbuilder index 25c6fa588..84cd31c55 100644 --- a/app/views/exercises/exercise_setting.json.jbuilder +++ b/app/views/exercises/exercise_setting.json.jbuilder @@ -1,7 +1,7 @@ json.exercise do json.extract! @exercise, :id,:exercise_name, :exercise_status,:time,:publish_time, :end_time,:score_open,:answer_open,:question_random,:choice_random, - :unified_setting,:show_statistic + :unified_setting,:show_statistic,:assistant_auth json.course_id @course.id json.published_count @exercise_publish_count json.unpublish_count @exercise_unpublish_count From 98e2b0448187d2ca8b826d613f27460762e037bc Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Wed, 11 Mar 2020 21:14:53 +0800 Subject: [PATCH 20/21] =?UTF-8?q?=E8=AF=95=E5=8D=B7=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 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/controllers/exercises_controller.rb b/app/controllers/exercises_controller.rb index e5d9fc495..cf67746ac 100644 --- a/app/controllers/exercises_controller.rb +++ b/app/controllers/exercises_controller.rb @@ -399,7 +399,7 @@ class ExercisesController < ApplicationController choice_random = params[:choice_random] ? true : false score_open = params[:score_open] ? true : false #分数是否公开 answer_open = params[:answer_open] ? true : false #答案是否公开 - assistant_auth = params[:assistant_auth] ? true : false # 助教权限 + assistant_auth = params[:assistant_auth] # 助教权限 # 统一设置或者分班为0,则更新试卷,并删除试卷分组 if unified_setting || (course_group_ids.size == 0) @@ -532,7 +532,8 @@ class ExercisesController < ApplicationController :answer_open => answer_open, :exercise_status => exercise_status, :publish_time => p_time, - :end_time => e_time + :end_time => e_time, + :assistant_auth => assistant_auth } @exercise.update!(exercise_params) if @exercise.exercise_status == Exercise::PUBLISHED From f83354dc9dd63fcc65a9a307c3c03dfa5c99b415 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Wed, 11 Mar 2020 21:33:32 +0800 Subject: [PATCH 21/21] =?UTF-8?q?=E8=AF=95=E5=8D=B7=E7=9A=84=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/exercises_controller.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/controllers/exercises_controller.rb b/app/controllers/exercises_controller.rb index cf67746ac..73bd07954 100644 --- a/app/controllers/exercises_controller.rb +++ b/app/controllers/exercises_controller.rb @@ -774,10 +774,11 @@ class ExercisesController < ApplicationController ex_group_setting = exercise.exercise_group_settings old_exercise_groups = ex_group_setting.find_in_exercise_group("course_group_id", g_course) #试卷的分组设置 left_course_groups = teacher_course_group_ids - g_course + all_left_groups = all_course_group_ids - g_course left_exercise_groups = ex_group_setting.find_in_exercise_group("course_group_id", left_course_groups) if left_exercise_groups.blank? && exercise.unified_setting - if left_course_groups.size > 0 #开始为统一设置,但是立即截止为分班。则创建没有立即截止的班级的exercise_group_setting - left_course_groups.each do |g| + if all_left_groups.size > 0 #开始为统一设置,但是立即截止为分班。则创建没有立即截止的班级的exercise_group_setting + all_left_groups.each do |g| ex_group_options = { :exercise_id => exercise.id, :course_group_id => g,