Skip to content

Commit

Permalink
Always show annotations visible to teacher
Browse files Browse the repository at this point in the history
(should not be dependent on whether NEW annotations can be posted
with the teacher or not)
  • Loading branch information
Splines committed Aug 22, 2024
1 parent 6d09e9e commit fd22125
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions app/controllers/annotations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,17 +91,8 @@ def destroy
def update_annotations
medium = Medium.find_by(id: params[:mediumId])

# Get the right annotations
annotations = if medium.annotations_visible?(current_user)
Annotation.where(medium: medium,
visible_for_teacher: true).or(
Annotation.where(medium: medium,
user: current_user)
)
else
Annotation.where(medium: medium,
user: current_user)
end
annotations = Annotation.where(medium: medium, visible_for_teacher: true)
.or(Annotation.where(medium: medium, user: current_user))

# If annotation is associated to a comment,
# the field "comment" is empty -> get it from the commontator comment
Expand Down

0 comments on commit fd22125

Please sign in to comment.