+
关卡数
@@ -468,7 +471,8 @@ class PathDetailIndex extends Component{
已学 {progress.learned}%
学习耗时{this.timeStamp(progress.time)}
-
+
+
注: “我的进展”以已发布的实训详情关卡数为准。
}
From 9b5a9485e0853446988c7b584b1711cdd50d2d26 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:09:52 +0800
Subject: [PATCH 12/79] =?UTF-8?q?=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../react/src/modules/courses/coursesPublic/NewShixunModel.js | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/public/react/src/modules/courses/coursesPublic/NewShixunModel.js b/public/react/src/modules/courses/coursesPublic/NewShixunModel.js
index 393d714b3..9c0ddd36f 100644
--- a/public/react/src/modules/courses/coursesPublic/NewShixunModel.js
+++ b/public/react/src/modules/courses/coursesPublic/NewShixunModel.js
@@ -48,6 +48,7 @@ class NewShixunModel extends Component{
this.setState({
shixun_list:response.data.shixun_list,
shixuns_count:response.data.shixuns_count,
+ Grouplist:[],
isspinning:false
})
}
@@ -414,7 +415,7 @@ class NewShixunModel extends Component{
{item.challenge_names.length===0?"":
{item.challenge_names.map((item,key)=>{
return(
- {item}
+ 第{key+1}关:{item}
)
})}
}
From 70ad1b51edb4599731e8c86a67887ec6aa344d58 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:11:53 +0800
Subject: [PATCH 13/79] b
---
.../react/src/modules/courses/coursesPublic/NewShixunModel.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/public/react/src/modules/courses/coursesPublic/NewShixunModel.js b/public/react/src/modules/courses/coursesPublic/NewShixunModel.js
index 9c0ddd36f..021b21127 100644
--- a/public/react/src/modules/courses/coursesPublic/NewShixunModel.js
+++ b/public/react/src/modules/courses/coursesPublic/NewShixunModel.js
@@ -30,7 +30,7 @@ class NewShixunModel extends Component{
this.getdatalist(page,type,status,search,order,diff,limit)
}
- getdatalist=(page,type,status,search,order,diff,limit)=>{
+ getdatalist=(page,type,status,search,order,diff,limit,pagetype)=>{
this.setState({
isspinning:true
})
@@ -122,7 +122,7 @@ class NewShixunModel extends Component{
}
let{type,status,search,order,diff,limit}=this.state;
- this.getdatalist(pageNumber,type,status,search,order,diff,limit)
+ this.getdatalist(pageNumber,type,status,search,order,diff,limit,"pagetype")
this.setState({
page:pageNumber,
allGrouplist:newallGrouplist
From 85e5ea80d2b26e43ce74ba214252898a0f854ebe 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:13:52 +0800
Subject: [PATCH 14/79] b
---
.../courses/coursesPublic/NewShixunModel.js | 21 +++++++++++++------
1 file changed, 15 insertions(+), 6 deletions(-)
diff --git a/public/react/src/modules/courses/coursesPublic/NewShixunModel.js b/public/react/src/modules/courses/coursesPublic/NewShixunModel.js
index 021b21127..0e36d3dc6 100644
--- a/public/react/src/modules/courses/coursesPublic/NewShixunModel.js
+++ b/public/react/src/modules/courses/coursesPublic/NewShixunModel.js
@@ -45,12 +45,21 @@ class NewShixunModel extends Component{
limit
}}).then((response) => {
if(response.data){
- this.setState({
- shixun_list:response.data.shixun_list,
- shixuns_count:response.data.shixuns_count,
- Grouplist:[],
- isspinning:false
- })
+ if(pagetype===undefined){
+ this.setState({
+ shixun_list:response.data.shixun_list,
+ shixuns_count:response.data.shixuns_count,
+ Grouplist:[],
+ isspinning:false
+ })
+ }else{
+ this.setState({
+ shixun_list:response.data.shixun_list,
+ shixuns_count:response.data.shixuns_count,
+ isspinning:false
+ })
+ }
+
}
}).catch((error) => {
this.setState({
From 5efc5d7faf2d94aece43bae9ebfaec23b139ca0f 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:48:26 +0800
Subject: [PATCH 15/79] =?UTF-8?q?=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src/modules/courses/coursesPublic/NewShixunModel.js | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/public/react/src/modules/courses/coursesPublic/NewShixunModel.js b/public/react/src/modules/courses/coursesPublic/NewShixunModel.js
index 0e36d3dc6..d0ba33cb3 100644
--- a/public/react/src/modules/courses/coursesPublic/NewShixunModel.js
+++ b/public/react/src/modules/courses/coursesPublic/NewShixunModel.js
@@ -490,10 +490,11 @@ class NewShixunModel extends Component{
:shixun_list.length===0?
:""
}
-
+ {
+ shixun_list===undefined?"":shixun_list.length===0?"":
-
+
}
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 16/79] =?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)
From b7aa0e34c33424df8917663fb4e23c324d6d8bbd Mon Sep 17 00:00:00 2001
From: hjm <63528605@qq.com>
Date: Thu, 12 Sep 2019 10:16:46 +0800
Subject: [PATCH 17/79] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=BC=80=E6=94=BE?=
=?UTF-8?q?=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../modules/tpm/TPMsettings/TPMsettings.js | 21 +++++++++++++++++--
1 file changed, 19 insertions(+), 2 deletions(-)
diff --git a/public/react/src/modules/tpm/TPMsettings/TPMsettings.js b/public/react/src/modules/tpm/TPMsettings/TPMsettings.js
index f78d62637..b2767887d 100644
--- a/public/react/src/modules/tpm/TPMsettings/TPMsettings.js
+++ b/public/react/src/modules/tpm/TPMsettings/TPMsettings.js
@@ -220,6 +220,7 @@ export default class TPMsettings extends Component {
can_copy: undefined,
task_pass: undefined,
test_set_permission: undefined,
+ code_edit_permission: undefined,
hide_code: undefined,
code_hidden: undefined,
forbid_copy: undefined,
@@ -352,6 +353,7 @@ export default class TPMsettings extends Component {
task_pass: response.data.shixun.task_pass,
test_set_permission: response.data.shixun.test_set_permission,
hide_code: response.data.shixun.hide_code,
+ code_edit_permission: response.data.shixun.code_edit_permission,
code_hidden: response.data.shixun.code_hidden,
is_secret_repository: response.data.shixun.is_secret_repository,
init_is_secret_repository: response.data.shixun.is_secret_repository,
@@ -546,7 +548,11 @@ export default class TPMsettings extends Component {
});
}
-
+ code_edit_permission = (e) => {
+ this.setState({
+ code_edit_permission: e.target.checked
+ })
+ }
code_hidden=(e)=>{
let sum = ""
if (e.target.checked === false) {
@@ -869,7 +875,7 @@ export default class TPMsettings extends Component {
let {
name, choice_main_type, choice_small_type, choice_standard_scripts, scope_partment, choice_standard_scriptssum, vnc_evaluate,
evaluate_script, webssh, use_scope, trainee, can_copy, task_pass, test_set_permission, hide_code, code_hidden, forbid_copy, vnc,multi_webssh,
- opening_time,shixunmemoMDvalue,shixun_service_configlist, is_secret_repository
+ opening_time,shixunmemoMDvalue,shixun_service_configlist, is_secret_repository, code_edit_permission
} = this.state;
let newshixun_service_configlist = shixun_service_configlist.map(v => {
@@ -982,6 +988,7 @@ export default class TPMsettings extends Component {
vnc_evaluate: vnc_evaluate===null?undefined:vnc_evaluate,
test_set_permission: test_set_permission,
code_hidden: code_hidden,
+ code_edit_permission: code_edit_permission,
trainee: trainee,
task_pass: task_pass,
hide_code: hide_code,
@@ -1563,6 +1570,7 @@ export default class TPMsettings extends Component {
test_set_permission,
hide_code,
forbid_copy,
+ code_edit_permission,
code_hidden,
vnc,
vnc_evaluate,
@@ -2274,6 +2282,15 @@ export default class TPMsettings extends Component {