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 01/19] =?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 02/19] =?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 &&
}
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 03/19] =?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 04/19] =?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 &&
}
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?
+
+ :
+
+ )
+ :
+ this.props.isAdmin()===true?
+
+
+ :""
}
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 06/19] =?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 07/19] =?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 08/19] =?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 09/19] =?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 10/19] =?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 11/19] =?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 12/19] =?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 13/19] =?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 === "--" ?
-
- 未评分
- }>
-