From 3a91fd077c995359cf39059c2e705fa39251cb7d Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Tue, 17 Dec 2019 17:38:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E4=BD=9C=E4=B8=9A=E4=BD=9C?= =?UTF-8?q?=E5=93=81=E5=88=97=E8=A1=A8=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_works_controller.rb | 1 + app/views/homework_commons/works_list.json.jbuilder | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/controllers/student_works_controller.rb b/app/controllers/student_works_controller.rb index a347e062d..e3d4d604a 100644 --- a/app/controllers/student_works_controller.rb +++ b/app/controllers/student_works_controller.rb @@ -559,6 +559,7 @@ class StudentWorksController < ApplicationController if @work.work_status == 0 @work.work_status = 1 @work.commit_time = Time.now + @work.compelete_status = 1 if @homework.homework_type == "practice" # 分组作业更新分组id @work.group_id = @homework.max_group_id if @homework.homework_type == "group" end diff --git a/app/views/homework_commons/works_list.json.jbuilder b/app/views/homework_commons/works_list.json.jbuilder index e3a5d9b84..fcc3e7a7c 100644 --- a/app/views/homework_commons/works_list.json.jbuilder +++ b/app/views/homework_commons/works_list.json.jbuilder @@ -43,7 +43,7 @@ elsif @user_course_identity == Course::STUDENT json.eff_score work_score_format(@work.eff_score, true, @score_open) json.current_complete_count @work.myshixun.try(:passed_count) if @homework.end_or_late json.complete_count @work.myshixun&.time_passed_count(@homework.homework_group_setting(@work.user_id)&.end_time) - json.view_answer_count @work.myshixun.try(:view_answer_count) + json.view_answer_count @work.myshixun.try(:view_answer_count).to_i json.work_status @work.compelete_status else json.(@work, :id, :work_status, :update_time, :ultimate_score) @@ -100,7 +100,7 @@ if @homework.homework_type == "practice" json.cost_time work.myshixun.try(:total_spend_time) json.current_complete_count work.myshixun.try(:passed_count) if @homework.end_or_late json.complete_count work.myshixun&.time_passed_count(@homework.homework_group_setting(work.user_id)&.end_time) - json.view_answer_count work.myshixun.try(:view_answer_count) + json.view_answer_count work.myshixun.try(:view_answer_count).to_i json.user_login work.user.try(:login) json.user_name work.user.try(:real_name) json.student_id work.user.try(:student_id)