Hide score button if exercise has no tests
We check for all teacher-defined assessments (linter and unit tests) to determine whether scoring should be possible
This commit is contained in:

committed by
Sebastian Serth

parent
ba5918b4ca
commit
e0c2c7b806
@ -29,10 +29,14 @@ class ExercisePolicy < AdminOrAuthorPolicy
|
||||
define_method(action) { (admin? || teacher_in_study_group? || author?) && @user.codeharbor_link }
|
||||
end
|
||||
|
||||
%i[implement? working_times? intervention? search? submit? reload?].each do |action|
|
||||
%i[implement? working_times? intervention? search? reload?].each do |action|
|
||||
define_method(action) { everyone }
|
||||
end
|
||||
|
||||
def submit?
|
||||
everyone && @record.teacher_defined_assessment?
|
||||
end
|
||||
|
||||
class Scope < Scope
|
||||
def resolve
|
||||
if @user.admin?
|
||||
|
Reference in New Issue
Block a user