From 59884af2f9f09f70350895d8be58a7e952135851 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Tue, 26 Mar 2019 16:25:13 +0800 Subject: [PATCH] =?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/courses_controller.rb | 52 +++++++++++++-------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 43b0076f..9a84fc6b 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -2431,8 +2431,8 @@ class CoursesController < ApplicationController sheet1[count_row,column+=1] = 0 else work_score = student_works.first.work_score.nil? ? 0 : student_works.first.work_score - sheet1[count_row,column+=1] = work_score < 0 ? 0 : work_score.round(2) - shixun_score += work_score < 0 ? 0 : work_score.round(2) + sheet1[count_row,column+=1] = work_score < 0 ? 0 : work_score.round(1) + shixun_score += work_score < 0 ? 0 : work_score.round(1) end # current_col += 1 end @@ -2443,8 +2443,8 @@ class CoursesController < ApplicationController sheet1[count_row,column+=1] = 0 else work_score = student_works.first.work_score.nil? ? 0 : student_works.first.work_score - sheet1[count_row,column+=1] = work_score < 0 ? 0 : work_score.round(2) - common_score += work_score < 0 ? 0 : work_score.round(2) + sheet1[count_row,column+=1] = work_score < 0 ? 0 : work_score.round(1) + common_score += work_score < 0 ? 0 : work_score.round(1) end # current_col += 1 end @@ -2455,8 +2455,8 @@ class CoursesController < ApplicationController sheet1[count_row,column+=1] = 0 else work_score = student_works.first.work_score.nil? ? 0 : student_works.first.work_score - sheet1[count_row,column+=1] = work_score < 0 ? 0 : work_score.round(2) - group_score += work_score < 0 ? 0 : work_score.round(2) + sheet1[count_row,column+=1] = work_score < 0 ? 0 : work_score.round(1) + group_score += work_score < 0 ? 0 : work_score.round(1) end # current_col += 1 end @@ -2467,8 +2467,8 @@ class CoursesController < ApplicationController sheet1[count_row,column+=1] = 0 else work_score = exercise_user.first.score.nil? ? 0 : exercise_user.first.score - sheet1[count_row,column+=1] = work_score < 0 ? 0 : work_score.round(2) - exercise_score += work_score < 0 ? 0 : work_score.round(2) + sheet1[count_row,column+=1] = work_score < 0 ? 0 : work_score.round(1) + exercise_score += work_score < 0 ? 0 : work_score.round(1) end # current_col += 1 end @@ -2480,8 +2480,8 @@ class CoursesController < ApplicationController sheet1[count_row,column+=1] = 0 else work_score = graduation_works.first.work_score.nil? ? 0 : graduation_works.first.work_score - sheet1[count_row,column+=1] = work_score < 0 ? 0 : work_score.round(2) - graduation_score += work_score < 0 ? 0 : work_score.round(2) + sheet1[count_row,column+=1] = work_score < 0 ? 0 : work_score.round(1) + graduation_score += work_score < 0 ? 0 : work_score.round(1) end # current_col += 1 end @@ -2494,7 +2494,7 @@ class CoursesController < ApplicationController if tasks.count > 0 sheet1[count_row,column+=1] = graduation_score end - sheet1[count_row,column+=1] = sum.round(2) + sheet1[count_row,column+=1] = sum.round(1) count_row += 1 end @@ -2578,7 +2578,7 @@ class CoursesController < ApplicationController sheet[count_row,3] = stu.user.user_extensions.student_id sheet[count_row,4] = strip_html stu.description sheet[count_row,5] = stu.late_penalty - sheet[count_row,6] = stu.work_score.nil? ? l(:label_without_score) : stu.work_score.round(2) + sheet[count_row,6] = stu.work_score.nil? ? l(:label_without_score) : stu.work_score.round(1) sheet[count_row,7] = format_time(stu.commit_time) count_row += 1 end @@ -2613,17 +2613,17 @@ class CoursesController < ApplicationController sheet[count_row,2] = stu.user.login sheet[count_row,3] = stu.user.user_extensions.student_id sheet[count_row,4] = strip_html stu.description - sheet[count_row,5] = stu.teacher_score.nil? ? l(:label_without_score) : stu.teacher_score.round(2) - sheet[count_row,6] = stu.teaching_asistant_score.nil? ? l(:label_without_score) : stu.teaching_asistant_score.round(2) + sheet[count_row,5] = stu.teacher_score.nil? ? l(:label_without_score) : stu.teacher_score.round(1) + sheet[count_row,6] = stu.teaching_asistant_score.nil? ? l(:label_without_score) : stu.teaching_asistant_score.round(1) if home.anonymous_comment ==0 - sheet[count_row,7] = stu.student_score.nil? ? l(:label_without_score) : stu.student_score.round(2) + sheet[count_row,7] = stu.student_score.nil? ? l(:label_without_score) : stu.student_score.round(1) sheet[count_row,8] = (home.teacher_priority == 1 && !stu.teacher_score.nil?) ? 0 : stu.absence_penalty sheet[count_row,9] = (home.teacher_priority == 1 && !stu.teacher_score.nil?) ? 0 : stu.late_penalty - sheet[count_row,10] = stu.work_score.nil? ? l(:label_without_score) : stu.work_score.round(2) + sheet[count_row,10] = stu.work_score.nil? ? l(:label_without_score) : stu.work_score.round(1) sheet[count_row,11] = format_time(stu.commit_time) else sheet[count_row,7] = (home.teacher_priority == 1 && !stu.teacher_score.nil?) ? 0 : stu.late_penalty - sheet[count_row,8] = stu.work_score.nil? ? l(:label_without_score) : stu.work_score.round(2) + sheet[count_row,8] = stu.work_score.nil? ? l(:label_without_score) : stu.work_score.round(1) sheet[count_row,9] = format_time(stu.commit_time) end count_row += 1 @@ -2662,17 +2662,17 @@ class CoursesController < ApplicationController sheet[count_row,3] = stu.user.user_extensions.student_id sheet[count_row,4] = get_group_member_names home.student_works.where(:group_id => stu.group_id).pluck(:user_id) sheet[count_row,5] = strip_html stu.description - sheet[count_row,6] = stu.teacher_score.nil? ? l(:label_without_score) : stu.teacher_score.round(2) - sheet[count_row,7] = stu.teaching_asistant_score.nil? ? l(:label_without_score) : stu.teaching_asistant_score.round(2) + sheet[count_row,6] = stu.teacher_score.nil? ? l(:label_without_score) : stu.teacher_score.round(1) + sheet[count_row,7] = stu.teaching_asistant_score.nil? ? l(:label_without_score) : stu.teaching_asistant_score.round(1) if home.anonymous_comment ==0 - sheet[count_row,8] = stu.student_score.nil? ? l(:label_without_score) : stu.student_score.round(2) + sheet[count_row,8] = stu.student_score.nil? ? l(:label_without_score) : stu.student_score.round(1) sheet[count_row,9] = (home.teacher_priority == 1 && !stu.teacher_score.nil?) ? 0 : stu.absence_penalty sheet[count_row,10] = (home.teacher_priority == 1 && !stu.teacher_score.nil?) ? 0 : stu.late_penalty - sheet[count_row,11] = stu.work_score.nil? ? l(:label_without_score) : stu.work_score.round(2) + sheet[count_row,11] = stu.work_score.nil? ? l(:label_without_score) : stu.work_score.round(1) sheet[count_row,12] = format_time(stu.commit_time) else sheet[count_row,8] = (home.teacher_priority == 1 && !stu.teacher_score.nil?) ? 0 : stu.late_penalty - sheet[count_row,9] = stu.work_score.nil? ? l(:label_without_score) : stu.work_score.round(2) + sheet[count_row,9] = stu.work_score.nil? ? l(:label_without_score) : stu.work_score.round(1) sheet[count_row,10] = format_time(stu.commit_time) end count_row += 1 @@ -2704,7 +2704,7 @@ class CoursesController < ApplicationController sheet[count_row,3] = stu.user.user_extensions.student_id sheet[count_row,4] = stu.objective_score == -1 ? "0.0" : format("%.1f",stu.objective_score) sheet[count_row,5] = stu.subjective_score == -1 ? "0.0" : format("%.1f",stu.subjective_score) - sheet[count_row,6] = stu.score.nil? ? '--' : stu.score.round(2) + sheet[count_row,6] = stu.score.nil? ? '--' : stu.score.round(1) sheet[count_row,7] = stu.commit_status == 0 ? l(:excel_no_answer) : format_time(stu.start_at) count_row += 1 end @@ -2745,12 +2745,12 @@ class CoursesController < ApplicationController sheet[count_row,column+=1] = get_group_member_names task.graduation_works.where(:group_id => stu.group_id).pluck(:user_id) end sheet[count_row,column+=1] = strip_html stu.description - sheet[count_row,column+=1] = stu.teacher_score.nil? ? l(:label_without_score) : stu.teacher_score.round(2) + sheet[count_row,column+=1] = stu.teacher_score.nil? ? l(:label_without_score) : stu.teacher_score.round(1) if task.cross_comment - sheet[count_row,column+=1] = stu.cross_score.nil? ? l(:label_without_score) : stu.cross_score.round(2) + sheet[count_row,column+=1] = stu.cross_score.nil? ? l(:label_without_score) : stu.cross_score.round(1) end sheet[count_row,column+=1] = stu.late_penalty - sheet[count_row,column+=1] = stu.work_score.nil? ? l(:label_without_score) : stu.work_score.round(2) + sheet[count_row,column+=1] = stu.work_score.nil? ? l(:label_without_score) : stu.work_score.round(1) sheet[count_row,column+=1] = format_time(stu.commit_time) count_row += 1 end