From 1aaec08579e5b551dd0f9bf8425e648ce87b5c9d Mon Sep 17 00:00:00 2001 From: SylorHuang Date: Sat, 28 Sep 2019 10:14:07 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=AF=95=E5=8D=B7=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E7=BB=93=E6=9E=9C=E7=9A=84=E7=99=BE=E5=88=86=E6=AF=94=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/exercises_helper.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/helpers/exercises_helper.rb b/app/helpers/exercises_helper.rb index 98a580ecc..ef9261990 100644 --- a/app/helpers/exercises_helper.rb +++ b/app/helpers/exercises_helper.rb @@ -148,7 +148,7 @@ module ExercisesHelper :choice_position => c.choice_position, :choice_text => c.choice_text, :choice_users_count => answer_users_count, - :choice_percent => answer_percent.round(1).to_s, + :choice_percent => answer_percent.round(2).to_s, :right_answer => right_answer } question_answer_infos.push(answer_option) @@ -174,7 +174,7 @@ module ExercisesHelper :choice_position => index+1, :choice_text => s_choice_text, :choice_users_count => user_count, - :choice_percent => answer_percent.round(1).to_s, + :choice_percent => answer_percent.round(2).to_s, :right_answer => true } question_answer_infos.push(answer_option) @@ -194,7 +194,7 @@ module ExercisesHelper :choice_position => (standard_answer_count + 1), :choice_text => "wrong", :choice_users_count => user_wrong_count, - :choice_percent => wrong_percent.round(1).to_s, + :choice_percent => wrong_percent.round(2).to_s, :right_answer => false } question_answer_infos.push(wrong_answer_position) @@ -220,7 +220,7 @@ module ExercisesHelper :choice_position => index+1, :choice_text => index+1, :choice_users_count => s, - :choice_percent => score_percent.round(1).to_s, + :choice_percent => score_percent.round(2).to_s, :right_answer => right_answer } question_answer_infos.push(answer_option) @@ -246,7 +246,7 @@ module ExercisesHelper :choice_position => index+1, :choice_text => index+1, :choice_users_count => s, - :choice_percent => score_percent.round(1).to_s, + :choice_percent => score_percent.round(2).to_s, :right_answer => right_answer } shixun_chas.push(answer_option) @@ -256,7 +256,7 @@ module ExercisesHelper :cha_name => c.challenge.subject, :cha_position => c.position, :cha_details => shixun_chas, - :cha_percent => game_percent.round(1).to_s + :cha_percent => game_percent.round(2).to_s } question_answer_infos.push(shixun_new_chas) end @@ -266,7 +266,7 @@ module ExercisesHelper :ques_less_title => ques_less_title, #副标题,仅实训题才有 :type => ex.question_type, :position => ex.question_number, - :percent => percent.round(1).to_s, + :percent => percent.round(2).to_s, :ques_effictive_counts => effictive_users_count, :ques_details => question_answer_infos } From fec9fb7f2649b1e66fe7b159057a240a00a25257 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Sat, 28 Sep 2019 10:15:03 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E9=97=AE=E5=8D=B7=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=AD=A6=E5=91=98=E5=8D=95=E4=BD=8D=E5=88=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/polls_controller.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/controllers/polls_controller.rb b/app/controllers/polls_controller.rb index 6ffe277a3..6be131d7a 100644 --- a/app/controllers/polls_controller.rb +++ b/app/controllers/polls_controller.rb @@ -1318,7 +1318,7 @@ class PollsController < ApplicationController poll_ques_titles = poll_questions.pluck(:question_title).map {|k| ActionController::Base.helpers.strip_tags(k) if k.present?} poll_un_anony = poll.un_anonymous if poll_un_anony #是否匿名,默认为false - user_info = %w(登陆名 真实姓名 邮箱 学号) + user_info = %w(登陆名 真实姓名 邮箱 学号 学员单位) else user_info = [] end @@ -1392,7 +1392,8 @@ class PollsController < ApplicationController user_login = u_user.login user_name = u_user.real_name.present? ? u_user.real_name : "--" user_student_id = u_user.student_id.present? ? u_user.student_id : "--" - user_cell += [user_login,user_name, u_user.mail, user_student_id] + user_school_name = u_user.school_name.present? ? u_user.school_name : "--" + user_cell += [user_login,user_name, u_user.mail, user_student_id, user_school_name] end all_user_cell = user_cell + user_answer_array user_commit.push(all_user_cell)