From f23f5828e889918651fe9b04543743fe1db206b7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com>
Date: Thu, 12 Sep 2019 09:35:18 +0800
Subject: [PATCH 1/5] =?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/Index.js | 2 +-
.../react/src/modules/courses/elearning/Elearning.js | 11 ++++++++---
.../src/modules/courses/elearning/YslDetailCards.js | 6 ++++--
.../modules/paths/PathDetail/DetailCardsEditAndAdd.js | 6 +++---
4 files changed, 16 insertions(+), 9 deletions(-)
diff --git a/public/react/src/modules/courses/Index.js b/public/react/src/modules/courses/Index.js
index a2f9a14e5..95927893d 100644
--- a/public/react/src/modules/courses/Index.js
+++ b/public/react/src/modules/courses/Index.js
@@ -305,7 +305,7 @@ class CoursesIndex extends Component{
//Do your stuff here
});
}
-
+ //更新左边课堂导航
updataleftNav=()=>{
let query=this.props.location.pathname
let {isaloadtype}=this.state;
diff --git a/public/react/src/modules/courses/elearning/Elearning.js b/public/react/src/modules/courses/elearning/Elearning.js
index 74fdfe201..8a0c4e007 100644
--- a/public/react/src/modules/courses/elearning/Elearning.js
+++ b/public/react/src/modules/courses/elearning/Elearning.js
@@ -29,13 +29,15 @@ class Elearning extends Component{
userlogin:"",
isRender:false,
subject_id:0,
+ myupdataleftNavs:this.myupdataleftNav
}
}
componentDidMount() {
// 记得删除退出课堂
- // console.log("获取到数据");
- // console.log(this.props);
+ console.log("在线学习");
+ console.log("获取到数据");
+ console.log(this.props);
this.getdata();
}
@@ -289,6 +291,9 @@ class Elearning extends Component{
})
};
+ myupdataleftNav=()=>{
+ this.props.updataleftNavfun();
+ }
render(){
console.log("Elearning++++++++");
// console.log(this.props.Chapterupdate);
@@ -397,7 +402,7 @@ class Elearning extends Component{
{/*开始学习*/}
- this.Startlearningtwo()} Myreload={()=>this.Myreload()} Tojoinclass={()=>this.Tojoinclass()} getPathCardsList={()=>this.getdata()}>
+ this.Startlearningtwo()} Myreload={()=>this.Myreload()} Tojoinclass={()=>this.Tojoinclass()} getPathCardsList={()=>this.getdata()} >
diff --git a/public/react/src/modules/courses/elearning/YslDetailCards.js b/public/react/src/modules/courses/elearning/YslDetailCards.js
index cb6f06fde..4b295f118 100644
--- a/public/react/src/modules/courses/elearning/YslDetailCards.js
+++ b/public/react/src/modules/courses/elearning/YslDetailCards.js
@@ -210,7 +210,7 @@ class YslDetailCards extends Component{
- //取消的
+ //确认的
updatapathCardsedit=()=>{
this.setState({
idsum:undefined,
@@ -219,9 +219,10 @@ class YslDetailCards extends Component{
editbuttomtypeadd:false
})
this.props.getPathCardsList();
+ this.props.myupdataleftNavs();
// this.props.updatadetailInfoLists();
};
- //确认的
+ //取消的
editeditbuttomtypecanle=()=>{
this.setState({
editbuttomtype:true,
@@ -300,6 +301,7 @@ class YslDetailCards extends Component{
this.updatapathCardsedit()
this.props.showNotification(`删除成功`);
+ this.props.myupdataleftNavs();
}else {
this.props.showNotification(`删除失败`);
}
diff --git a/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js b/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js
index ce38a73ea..87e398888 100644
--- a/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js
+++ b/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js
@@ -123,10 +123,11 @@ class DetailCardsEditAndAdd extends Component{
//点击新建阶段
addStage=()=>{
- this.props.editeditbuttomtypes();
this.setState({
editPanel:true
})
+ this.props.editeditbuttomtypes();
+
}
//取消新建阶段
@@ -294,13 +295,12 @@ class DetailCardsEditAndAdd extends Component{
shixun_id:shixuns_listeditlist
}).then((response) => {
// window.location.href = "/paths/" + response.data.subject_id
- this.props.getPathCardsLists();
-
this.cancelAddState();
this.setState({
stage_nametype:false,
descriptiontype:false
})
+ this.props.getPathCardsLists();
}).catch((error) => {
console.log(error)
});
From 0abe6f9a540b43e96129bcc2b800511714e9ed48 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com>
Date: Thu, 12 Sep 2019 09:36:07 +0800
Subject: [PATCH 2/5] =?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/elearning/Elearning.js | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/public/react/src/modules/courses/elearning/Elearning.js b/public/react/src/modules/courses/elearning/Elearning.js
index 8a0c4e007..2ed4bbaa8 100644
--- a/public/react/src/modules/courses/elearning/Elearning.js
+++ b/public/react/src/modules/courses/elearning/Elearning.js
@@ -35,9 +35,9 @@ class Elearning extends Component{
componentDidMount() {
// 记得删除退出课堂
- console.log("在线学习");
- console.log("获取到数据");
- console.log(this.props);
+ // console.log("在线学习");
+ // console.log("获取到数据");
+ // console.log(this.props);
this.getdata();
}
From 674c44427e94386a09d302ea35316340970e4895 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com>
Date: Thu, 12 Sep 2019 09:43:45 +0800
Subject: [PATCH 3/5] =?UTF-8?q?=E6=9D=83=E9=99=90=E6=A2=B3=E7=90=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/react/src/modules/tpm/TPMIndexHOC.js | 26 +++++++--------------
1 file changed, 9 insertions(+), 17 deletions(-)
diff --git a/public/react/src/modules/tpm/TPMIndexHOC.js b/public/react/src/modules/tpm/TPMIndexHOC.js
index 657a1ef6b..c366b21a3 100644
--- a/public/react/src/modules/tpm/TPMIndexHOC.js
+++ b/public/react/src/modules/tpm/TPMIndexHOC.js
@@ -202,48 +202,40 @@ export function TPMIndexHOC(WrappedComponent) {
NORMAL = 6 # 普通用户
Anonymous = 7 # 普未登录
*/
- //超管
+ //超管0
isSuperAdmin = () => {
// return false
return this.state.coursedata&&this.state.coursedata.course_identity === 0
}
- // 课堂管理等
+ //超管、运维0-1
isClassManagement = () => {
- // return this.state.coursedata&&this.state.coursedata.course_identity >= 0 &&
return this.state.coursedata&&this.state.coursedata.course_identity < 2
}
- //老师等
+ //超管、运维、课堂管理0-2
isAdminOrCreator = () => {
- // return this.state.coursedata&&this.state.coursedata.course_identity >= 0 &&
return this.state.coursedata&&this.state.coursedata.course_identity < 3
}
- // 助教等
+ //超管、运维、课堂管理、老师0-3
isAdminOrTeacher = () => {
- // return this.state.coursedata&&this.state.coursedata.course_identity >= 0 &&
return this.state.coursedata&&this.state.coursedata.course_identity < 4
}
- // 老师、管理员等
+ // 超管、运维、课堂管理、老师、助教0-4
isAdmin = () => {
- // return false
- // return this.state.coursedata&&this.state.coursedata.course_identity >= 0 &&
return this.state.coursedata&&this.state.coursedata.course_identity < 5
}
- // 学生
+ // 学生5
isStudent = () => {
- // return true
- // return this.state.coursedata&&this.state.coursedata.course_identity >= 0 &&
return this.state.coursedata&&this.state.coursedata.course_identity === 5
}
+ // 超管、运维、课堂管理、老师、助教、学生0-5
isAdminOrStudent = () => {
- // return this.state.coursedata&&this.state.coursedata.course_identity >= 0 &&
return this.state.coursedata&&this.state.coursedata.course_identity <= 5
}
- // 非课堂成员
+ // 游客未登录/非课堂成员6>
isNotMember = () => {
- // return this.state.coursedata&&this.state.coursedata.course_identity >= 0 &&
return this.state.coursedata&&this.state.coursedata.course_identity >= 6
}
-
+ //课堂是否已结束
isCourseEnd = () => {
return this.state.current_user ? this.state.current_user.course_is_end : false
}
From 6f68c79f18c388b790ac4aee3d25ad921bf66991 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com>
Date: Thu, 12 Sep 2019 09:44:43 +0800
Subject: [PATCH 4/5] =?UTF-8?q?=E6=9D=83=E9=99=90=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../react/src/modules/courses/shixunHomework/shixunHomework.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/public/react/src/modules/courses/shixunHomework/shixunHomework.js b/public/react/src/modules/courses/shixunHomework/shixunHomework.js
index fe959b691..a2cd5a938 100644
--- a/public/react/src/modules/courses/shixunHomework/shixunHomework.js
+++ b/public/react/src/modules/courses/shixunHomework/shixunHomework.js
@@ -1037,7 +1037,7 @@ class ShixunHomework extends Component{
{/*{datas&&datas.category_name===undefined||datas&&datas.category_name===null?datas&&datas.main_category_name:datas&&datas.category_name+" 作业列表"}*/}
实训作业
- {datas===undefined?"":datas.homeworks && datas.homeworks.length>1?this.props.isClassManagement()===true?datas&&datas.category_name===undefined||datas&&datas.category_name===null?
+ {datas===undefined?"":datas.homeworks && datas.homeworks.length>1?this.props.isAdminOrCreator()===true?datas&&datas.category_name===undefined||datas&&datas.category_name===null?
调整排序
From 2366b4d590c3df2cea90d8c702e503b54eb60595 Mon Sep 17 00:00:00 2001
From: cxt <853663049@qq.com>
Date: Thu, 12 Sep 2019 10:09:36 +0800
Subject: [PATCH 5/5] =?UTF-8?q?=E5=A4=9A=E9=80=89=E9=A2=98=E7=9A=84?=
=?UTF-8?q?=E8=B0=83=E5=88=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../exercise_questions_controller.rb | 39 ++++++++++++++++--
dump.rdb | Bin 2487 -> 2487 bytes
2 files changed, 35 insertions(+), 4 deletions(-)
diff --git a/app/controllers/exercise_questions_controller.rb b/app/controllers/exercise_questions_controller.rb
index 57116a9e5..27e3fa2f4 100644
--- a/app/controllers/exercise_questions_controller.rb
+++ b/app/controllers/exercise_questions_controller.rb
@@ -497,7 +497,38 @@ class ExerciseQuestionsController < ApplicationController
ex_obj_score = @exercise_current_user.objective_score #全部客观题得分
ex_subj_score = @exercise_current_user.subjective_score < 0.0 ? 0.0 : @exercise_current_user.subjective_score #全部主观题得分
ex_answers = @exercise_question.exercise_answers.search_answer_users("user_id",@user_id) #当前用户答案的得分
- if @exercise_question.question_type == Exercise::COMPLETION #当为填空题,更新问题的总分,
+ if @exercise_question.question_type == Exercise::MULTIPLE
+ if ex_answers.present? #学生有回答时 取学生的答题得分,否则0分
+ answer_choice_array = []
+ ex_answers.each do |a|
+ answer_choice_array.push(a.exercise_choice.choice_position) #学生答案的位置
+ end
+ user_answer_content = answer_choice_array.sort
+ standard_answer = @exercise_question.exercise_standard_answers.pluck(:exercise_choice_id).sort
+ if standard_answer.size == 1 # 老数据需要判断学生答题是否正确, 正确取原题得分,否则是0分
+ standard_answer = standard_answer.first.to_s.split("").map(&:to_i).sort
+ if user_answer_content == standard_answer
+ ex_answer_old = @exercise_question.question_score
+ else
+ ex_answer_old = 0
+ end
+ else # 新多选题只需取第一条答题记录的得分
+ ex_answer_old = ex_answers.first.score > 0 ? ex_answers.first.score : 0
+ end
+ else
+ ex_answer_old = 0
+ end
+
+ new_obj_score = ex_obj_score - ex_answer_old + @c_score
+ total_scores = new_obj_score + ex_subj_score
+ ex_scores = {
+ :objective_score => new_obj_score,
+ :score => total_scores
+ }
+ @exercise_current_user.update_attributes(ex_scores)
+ ex_answers.update_all(:score => @c_score) #所有的正确选项需重新更新
+
+ elsif @exercise_question.question_type == Exercise::COMPLETION #当为填空题,更新问题的总分,
ex_answer_old = ex_answers.score_reviewed.pluck(:score).sum #每一关的得分总和
each_right_score = (@c_score / ex_answers.count.to_f) #调分后,平均每关的分数
new_obj_score = ex_obj_score - ex_answer_old + @c_score
@@ -579,7 +610,7 @@ class ExerciseQuestionsController < ApplicationController
end
rescue Exception => e
uid_logger_error(e.message)
- tip_exception("没有权限")
+ tip_exception(e.message)
raise ActiveRecord::Rollback
end
end
@@ -703,8 +734,8 @@ class ExerciseQuestionsController < ApplicationController
normal_status(-1,"用户不存在!")
elsif @c_score.blank?
normal_status(-1,"分数不能为空!")
- elsif @exercise_question.question_type <= Exercise::JUDGMENT
- normal_status(-1,"选择题/判断题不能调分!")
+ elsif @exercise_question.question_type == Exercise::SINGLE || @exercise_question.question_type == Exercise::JUDGMENT
+ normal_status(-1,"单选题/判断题不能调分!")
elsif params[:comment].present? && params[:comment].length > 100
normal_status(-1,"评语不能超过100个字符!")
else
diff --git a/dump.rdb b/dump.rdb
index bcf064366d9465f66c11de3ea1199b9ada47f4bd..9f62f75c757e26158b26bb280d1712217a6aab58 100644
GIT binary patch
delta 37
tcmdlkyj^&Lf#8~l6|uiKN{drdbaPX44}CD*=$OaJ5s~pdA?Vt*uK+ZL5lH|5
delta 37
tcmdlkyj^&Lfnbw(e(W!f(&E$<-Q3jNLl>$yI_7b5tlX>ZyL{oCtpFKi58nU)