From d8dab33c211df583815601263e3d581e2a2d220f Mon Sep 17 00:00:00 2001 From: SylorHuang Date: Fri, 28 Jun 2019 15:34:24 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=95=E5=8D=B7=E7=9A=84=E7=AD=94=E9=A2=98?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=98=AF=E5=90=A6=E6=98=BE=E7=A4=BA=E5=AE=A2?= =?UTF-8?q?=E8=A7=82=E9=A2=98=E5=92=8C=E4=B8=BB=E8=A7=82=E9=A2=98=E7=9A=84?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/exercises_controller.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/controllers/exercises_controller.rb b/app/controllers/exercises_controller.rb index 01a2d540a..421c5177a 100644 --- a/app/controllers/exercises_controller.rb +++ b/app/controllers/exercises_controller.rb @@ -1177,15 +1177,16 @@ class ExercisesController < ApplicationController @exercise_status = @exercise.get_exercise_status(current_user.id) @course_all_members = @course.students @c_group_counts = @course.course_groups_count - question_types = @exercise.exercise_questions.pluck(:question_type) + question_types = @exercise.exercise_questions.pluck(:question_type).uniq @exercise_publish_count = get_user_permission_course(exercise_ids,2).count #判断是否有已发布的分班 @exercise_unpublish_count = get_user_permission_course(exercise_ids,1).count #判断是否有未发布的分班 - if question_types.include?(4) #是否包含主观题 + if (question_types.size > 1) && question_types.include?(4) #是否包含主观题,或者是否大于1 @subjective_type = 1 else @subjective_type = 0 end + if @user_course_identity < Course::STUDENT #当前为老师,而且老师只能查看自己班级的/课堂的试卷 @exercise_current_user_status = 0 if @exercise_status == 1