From 00777fa2676ef4912b8c5927822051b5fb7f96f1 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Mon, 25 Nov 2019 14:22:14 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/weapps/registers_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/weapps/registers_controller.rb b/app/controllers/weapps/registers_controller.rb index eb1da3dd8..391850090 100644 --- a/app/controllers/weapps/registers_controller.rb +++ b/app/controllers/weapps/registers_controller.rb @@ -50,7 +50,7 @@ class Weapps::RegistersController < Weapps::BaseController successful_authentication(@user) session[:user_id] = @user.id - render_ok(user_id: @user.id) + # render_ok(user_id: @user.id) end private From 59ec6d02961842afa107fdaa2bcfde06e45843cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Mon, 25 Nov 2019 14:50:30 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../exercise/Studentshavecompletedthelist.js | 116 +++++++++++++++++- .../exercise/Testpapersettinghomepage.js | 2 +- 2 files changed, 115 insertions(+), 3 deletions(-) diff --git a/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js b/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js index a06cbbfa7..7cef67aad 100644 --- a/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js +++ b/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js @@ -27,7 +27,6 @@ const Search = Input.Search; const RadioGroup = Radio.Group; const CheckboxGroup = Checkbox.Group; const {Option} = Select; - //学生老师页面 class Studentshavecompletedthelist extends Component { // http://localhost:3007/courses/1309/exercises/722/exercises/student_exercise_list?debug=s @@ -317,6 +316,26 @@ class Studentshavecompletedthelist extends Component { : + 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" @@ -587,6 +606,30 @@ class Studentshavecompletedthelist extends Component { }}>-- : + record.commit_method===5? + +
最终调整成绩:{record.efficiencyscore}分
+ }> + 90 ? { + color: '#DD1717', + textAlign: "center", + width:"199px" + } : parseInt(record.efficiencyscore) <= 90 ? { + color: '#FF6800', + textAlign: "center", + width:"199px" + } : parseInt(record.efficiencyscore) <= 60 ? { + color: '#747A7F', + textAlign: "center", + width:"199px" + } : { + color: '#747A7F', + textAlign: "center", + width:"199px" + }}>{record.efficiencyscore} +
+ : 90 ? { color: '#DD1717', textAlign: "center", @@ -845,6 +888,26 @@ class Studentshavecompletedthelist extends Component { }}>-- : + 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", @@ -1048,6 +1111,26 @@ class Studentshavecompletedthelist extends Component { textAlign: "center",}}>-- : + 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", @@ -1246,6 +1329,26 @@ class Studentshavecompletedthelist extends Component { textAlign: "center",}}>-- : + 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", @@ -1401,7 +1504,9 @@ class Studentshavecompletedthelist extends Component { // //console.log("试卷学生未截止"); this.Generatenewdatas(response.data.exercise_users); if (response.data.exercise_types.subjective === 0) { + if (this.state.noclassroom === undefined || this.state.noclassroom === "" || this.state.noclassroom === null) { + console.log("4"); var arr =[]; for(var i=0;i { // 教师列表 - parseInt(tab[0])==0 ? this.setcourse_groupysls(value)} current_status = {this.state.current_status} Commonheadofthetestpaper={this.state.Commonheadofthetestpaper}>:"" + 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]}`]}>:"" } {/*统计结果*/} From 4075bfc269eeb2b501adb09eaa8fa03e95e42748 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Mon, 25 Nov 2019 18:16:28 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E9=97=AE=E5=8D=B7=E7=9A=84=E7=AD=94?= =?UTF-8?q?=E9=A2=98=E5=85=A5=E5=8F=A3=E4=B8=8E=E7=8A=B6=E6=80=81=E4=B8=8D?= =?UTF-8?q?=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/polls_helper.rb | 2 +- app/models/poll.rb | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/helpers/polls_helper.rb b/app/helpers/polls_helper.rb index 866d28254..7ae4470e2 100644 --- a/app/helpers/polls_helper.rb +++ b/app/helpers/polls_helper.rb @@ -77,7 +77,7 @@ module PollsHelper ex_pb_time = poll.get_poll_times(user.id,false) poll_publish_time = ex_pb_time[:publish_time] poll_end_time = ex_pb_time[:end_time] - current_status = poll.check_user_votes_status(user) + current_status = poll.check_user_votes_status(user, poll_status) lock_icon = 0 #不显示锁图标 else poll_users_list = poll.get_poll_exercise_users diff --git a/app/models/poll.rb b/app/models/poll.rb index 9cb860f61..f3a16198c 100644 --- a/app/models/poll.rb +++ b/app/models/poll.rb @@ -146,12 +146,15 @@ class Poll < ApplicationRecord end #判断当前用户的答题状态 - def check_user_votes_status(user) + def check_user_votes_status(user, poll_status) poll_answer_user = poll_users.where(user_id: user.id).select(:start_at,:end_at,:commit_status) user_status = 2 if poll_answer_user.exists? && (poll_answer_user.first&.start_at.present? || poll_answer_user.first&.end_at.present?) #学生有过答题的,或者立即截止,但学生未做试卷的 user_status = poll_answer_user.first.commit_status end + if poll_status > 2 + user_status = user_status == 1 ? 1 : 4 + end user_status end From 5eeef267e56666f7d08fd80f401bff944bc783b6 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Mon, 25 Nov 2019 18:19:33 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E9=97=AE=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/polls_controller.rb | 4 ++-- app/models/poll.rb | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/app/controllers/polls_controller.rb b/app/controllers/polls_controller.rb index 5a3fda7a4..068a0dafd 100644 --- a/app/controllers/polls_controller.rb +++ b/app/controllers/polls_controller.rb @@ -198,14 +198,14 @@ class PollsController < ApplicationController def common_header ActiveRecord::Base.transaction do begin + @poll_status = @poll.get_poll_status(current_user) if @user_course_identity > Course::ASSISTANT_PROFESSOR @is_teacher_or = 0 - @user_poll_answer = @poll.check_user_votes_status(current_user) + @user_poll_answer = @poll.check_user_votes_status(current_user, @poll_status) else @is_teacher_or = 1 @user_poll_answer = 3 #教师页面 end - @poll_status = @poll.get_poll_status(current_user) poll_id_array = [@poll.id] @poll_publish_count = get_user_permission_course(poll_id_array,2).count #是否存在已发布的 @poll_unpublish_count = get_user_permission_course(poll_id_array,1).count #是否存在未发布的 diff --git a/app/models/poll.rb b/app/models/poll.rb index f3a16198c..626f55dcb 100644 --- a/app/models/poll.rb +++ b/app/models/poll.rb @@ -152,7 +152,14 @@ class Poll < ApplicationRecord if poll_answer_user.exists? && (poll_answer_user.first&.start_at.present? || poll_answer_user.first&.end_at.present?) #学生有过答题的,或者立即截止,但学生未做试卷的 user_status = poll_answer_user.first.commit_status end + # 问卷已截止时学生的答题状态需要考虑问卷的状态 if poll_status > 2 + # 问卷如果还是继续答题状态则自动提交 + if user_status = 0 + poll_end_time = get_poll_times(user.id,false) + poll_answer_user.first.update_attributes!(:commit_status => 1, :end_at => poll_end_time) + user_status = 1 + end user_status = user_status == 1 ? 1 : 4 end user_status From c88a998992ebf8a70e6ffefb0c3be912ca6919f7 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Mon, 25 Nov 2019 18:29:48 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E9=97=AE=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/models/poll.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/poll.rb b/app/models/poll.rb index 626f55dcb..8eb8e6cf9 100644 --- a/app/models/poll.rb +++ b/app/models/poll.rb @@ -155,7 +155,7 @@ class Poll < ApplicationRecord # 问卷已截止时学生的答题状态需要考虑问卷的状态 if poll_status > 2 # 问卷如果还是继续答题状态则自动提交 - if user_status = 0 + if user_status == 0 poll_end_time = get_poll_times(user.id,false) poll_answer_user.first.update_attributes!(:commit_status => 1, :end_at => poll_end_time) user_status = 1 From 34fed0365560f1cc3b5164d2dd4a00c049b81d83 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Mon, 25 Nov 2019 18:31:21 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E9=97=AE=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/models/poll.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/poll.rb b/app/models/poll.rb index 8eb8e6cf9..ea6656ca2 100644 --- a/app/models/poll.rb +++ b/app/models/poll.rb @@ -156,7 +156,7 @@ class Poll < ApplicationRecord if poll_status > 2 # 问卷如果还是继续答题状态则自动提交 if user_status == 0 - poll_end_time = get_poll_times(user.id,false) + poll_end_time = get_poll_times(user.id,false)[:end_time] poll_answer_user.first.update_attributes!(:commit_status => 1, :end_at => poll_end_time) user_status = 1 end