From af89b0d051bfff4f6f80c66f058b3992922b7701 Mon Sep 17 00:00:00 2001 From: SylorHuang Date: Wed, 13 Nov 2019 16:52:14 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E9=97=AE=E5=8D=B7=E7=9A=84=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E7=BB=93=E6=9E=9C=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/polls_helper.rb | 2 +- app/views/polls/commit_result.json.jbuilder | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/helpers/polls_helper.rb b/app/helpers/polls_helper.rb index 03210fccd..866d28254 100644 --- a/app/helpers/polls_helper.rb +++ b/app/helpers/polls_helper.rb @@ -13,7 +13,7 @@ module PollsHelper end def poll_votes_count(votes,user_ids) - votes.find_current_vote("user_id",user_ids.uniq).reject(&:blank?).size + votes.find_current_vote("user_id",user_ids.uniq).pluck(:user_id).uniq.reject(&:blank?).size end #公用tab页的相关信息 diff --git a/app/views/polls/commit_result.json.jbuilder b/app/views/polls/commit_result.json.jbuilder index 795d609a7..f5e983acf 100644 --- a/app/views/polls/commit_result.json.jbuilder +++ b/app/views/polls/commit_result.json.jbuilder @@ -14,7 +14,7 @@ if @poll_questions_count > 0 json.array! @poll_questions do |question| json.partial! "polls/commit_answers_result", question: question, answers:question.poll_answers, - question_votes:question.poll_votes.where(user_id:@poll_commit_ids) #问题的全部答案 + question_votes: question.poll_votes.where(user_id:@poll_commit_ids) #问题的全部答案 end end else From 27d363713effe5b8b40ee82a685e2bdead98a914 Mon Sep 17 00:00:00 2001 From: p31729568 Date: Wed, 13 Nov 2019 16:52:31 +0800 Subject: [PATCH 2/4] fix --- app/controllers/cooperative/base_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/cooperative/base_controller.rb b/app/controllers/cooperative/base_controller.rb index 5ab08582d..556cd7aa9 100644 --- a/app/controllers/cooperative/base_controller.rb +++ b/app/controllers/cooperative/base_controller.rb @@ -16,7 +16,7 @@ class Cooperative::BaseController < ApplicationController private def current_laboratory - @_current_laboratory ||= Laboratory.find_by_subdomain('hut' || request.subdomain) + @_current_laboratory ||= Laboratory.find_by_subdomain(request.subdomain) end def current_setting_or_default(name) From 51f0ee88b1e088807c25e9c6804a85cf3bff9ab8 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Wed, 13 Nov 2019 17:00:11 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E9=97=AE=E5=8D=B7=E7=AD=94=E9=A2=98?= =?UTF-8?q?=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/courses/poll/PollDetailTabFirst.js | 14 +++++++------- .../react/src/modules/courses/poll/pollStyle.css | 4 +++- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/public/react/src/modules/courses/poll/PollDetailTabFirst.js b/public/react/src/modules/courses/poll/PollDetailTabFirst.js index 07b9ee197..052382067 100644 --- a/public/react/src/modules/courses/poll/PollDetailTabFirst.js +++ b/public/react/src/modules/courses/poll/PollDetailTabFirst.js @@ -246,13 +246,13 @@ class PollDetailTabFirst extends Component{ dataIndex: 'No', key: 'No', className:"edu-txt-center", - width:110 + width:120 }, { title: '姓名', dataIndex: 'name', key: 'name', className:"edu-txt-center", - width:160 + width:170 }, { title: '学号', dataIndex: 'StudentNo', @@ -269,11 +269,11 @@ class PollDetailTabFirst extends Component{ title: '分班', key: 'classes', dataIndex: 'classes', - width:160, + width:220, className:poll_types && poll_types.groups_count > 0 ? "edu-txt-center":"edu-txt-center none", render:(classes,item,index)=>{ return( - item.classes ? {item.classes} : -- + item.classes ? {item.classes} : -- ) } }, { @@ -281,7 +281,7 @@ class PollDetailTabFirst extends Component{ dataIndex: 'status', key: 'status', className:"edu-txt-center", - width:160, + width:170, render:(status,item,index)=>{ return( item.status == 1 ?按时提交:未提交 @@ -292,7 +292,7 @@ class PollDetailTabFirst extends Component{ dataIndex: 'time', key: 'time', className:"edu-txt-center", - width:160, + width:170, sorter: true, defaultSortOrder: 'descend', sortDirections: sortDirections, @@ -395,7 +395,7 @@ class PollDetailTabFirst extends Component{ {/* */} {/*}*/} } -
+
{ data && data.length > 0 ?
: diff --git a/public/react/src/modules/courses/poll/pollStyle.css b/public/react/src/modules/courses/poll/pollStyle.css index 414d36ab1..5a5e9f76f 100644 --- a/public/react/src/modules/courses/poll/pollStyle.css +++ b/public/react/src/modules/courses/poll/pollStyle.css @@ -338,7 +338,9 @@ textarea:read-only{ border:1px solid #FF0000; border-radius: 5px; } - +.pollResultList .ant-table-thead > tr > th,.pollResultList .ant-table-tbody > tr > td{ + padding:15px 6px; +} /* 试卷 */ .setScoreInput{ width: 60px!important;height: 30px!important;box-sizing: border-box; From 055cb1d8647622e1673b0f30124a5e39d5fe2bee Mon Sep 17 00:00:00 2001 From: SylorHuang Date: Wed, 13 Nov 2019 17:08:57 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=A1=AB=E7=A9=BA?= =?UTF-8?q?=E9=A2=98=E5=88=A0=E9=99=A4=E7=AD=94=E6=A1=88=E5=90=8E=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/exercises_helper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/helpers/exercises_helper.rb b/app/helpers/exercises_helper.rb index bacb95309..33d61d203 100644 --- a/app/helpers/exercises_helper.rb +++ b/app/helpers/exercises_helper.rb @@ -164,7 +164,7 @@ module ExercisesHelper question_answer_infos.push(answer_option) end elsif ex.question_type == Exercise::COMPLETION #填空题 - effictive_users_count = effictive_users.pluck(:user_id).uniq.size + effictive_users_count = effictive_users.where("answer_text is not null").pluck(:user_id).uniq.size ex_ordered = ex.is_ordered null_standard_answer = ex.exercise_standard_answers null_stand_choice = null_standard_answer.pluck(:exercise_choice_id) #一个exercise_choice_id可能对应多个answer_text @@ -214,7 +214,7 @@ module ExercisesHelper # percent = commit_user_ids > 0 ? (all_user_count / commit_user_ids.to_f).round(3)*100 : 0.0 user_right_count = effictive_users.where("score > 0.0").pluck(:user_id).uniq - user_wrong_counts = effictive_users.where("score < 0.0").pluck(:user_id).uniq + user_wrong_counts = effictive_users.where("score < 0.0 and answer_text is not null").pluck(:user_id).uniq user_wrong_count = (user_wrong_counts - user_right_count).size if effictive_users_count > 0 && user_wrong_count >= 0