Skip to content

Global annotations#1629

Merged
damianhxy merged 48 commits into
masterfrom
global-annotations
Nov 29, 2022
Merged

Global annotations#1629
damianhxy merged 48 commits into
masterfrom
global-annotations

Conversation

@damianhxy

@damianhxy damianhxy commented Oct 27, 2022

Copy link
Copy Markdown
Member

Description

  • Allow instructors to create, edit, and delete global annotations
  • Display all non-autograded problems in annotation pane to facilitate adding global annotations
  • Show a dash if a problem is released with no score (via annotation) associated with it. This avoids an internal server error when we try to format nil.
  • Update annotations documentation (re: shared comments, global annotations, positive grading)
  • Fix off-by-one line number on viewFeedback page
  • Improve validation for max score upon problem creation
  • Update logic for problemReleased to additionally check that the grading deadline has not passed
  • Automatically destroy annotations when a problem is destroyed

Motivation and Context

To provide instructors with a method of awarding points for a problem globally, without tying it to a specific line of code.

How Has This Been Tested?

Test using an autograded single file assessment (e.g. hello) and a non-autograded tar assessment

  • Ensure that all non-autograded problems are shown in the annotation pane
  • Ensure that you can no longer create a problem without a max score
  • Ensure that annotation line number shown on viewFeedback page is no longer off-by-one
  • Check documentation for annotations
  • Test that clickable chevron toggles collapse of a problem
  • Successfully create, edit, and delete global annotations
    • Global annotations only appear in the annotation pane, and not in the code viewer
    • Global annotations still influence a student's score correctly
    • Global annotations are not clickable
  • Test that above features work even after switching files or adding / editing / deleting annotations
  • Ensure that students are unable to view the annotations when either (1) grades are not released and/or (2) the grading deadline has not passed
    • Ensure that students can view annotation otherwise
  • Ensure that the view feedback page handles global annotations correctly
    • Clickable link loads the student's submission

Creating a global annotation
Screenshot 2022-11-27 at 16 53 52

Screenshot 2022-11-27 at 16 54 45

Editing a global annotation
Screenshot 2022-11-27 at 16 54 08

Screenshot 2022-11-27 at 16 54 52

View feedback page with global annotations - clicking the link loads the first file of the submission
Screen Shot 2022-11-02 at 17 49 33

Student unable to view annotations when unreleased
Screen Shot 2022-11-02 at 17 53 30

Screen Shot 2022-11-02 at 17 54 25

Types of changes

  • New feature (non-breaking change which adds functionality)

Checklist:

  • I have run rubocop for style check. If you haven't, run overcommit --install && overcommit --sign to use pre-commit hook for linting
  • My change requires a change to the documentation, which is located at Autolab Docs
  • I have updated the documentation accordingly, included in this PR

Other issues / help required

  • When annotations are edited, the textarea is initially too small, but they expand correctly once you start typing. I'm not sure if there's a way to make them have the right height from the start.
  • The exception to this is when the file containing the annotation is directly loaded and there have been no actions (e.g. switching files, deleting another annotation, editing another annotation...). In this case, the textarea has a slightly too large height. However, the height does not decrease past the original height when deleting lines.

Comment thread app/assets/javascripts/annotations.js Outdated
Comment thread app/controllers/submissions_controller.rb
Comment thread app/assets/javascripts/annotations.js
Comment thread docs/features/annotations.md
Comment thread app/views/submissions/_annotation_global.html.erb
Comment thread app/views/submissions/_annotation_global.html.erb Outdated
Comment thread app/views/submissions/_annotation_pane.html.erb Outdated
@michellexliu

Copy link
Copy Markdown
Contributor

Found a bug:

Create an annotation for a problem --> edit assessment & delete the problem --> error when you go to load the assignment again:
image

@damianhxy

damianhxy commented Nov 28, 2022

Copy link
Copy Markdown
Member Author

Found a bug:

Create an annotation for a problem --> edit assessment & delete the problem --> error when you go to load the assignment again: image

Remedied by automatically destroying annotations when deleting a problem and updated the warning message when deleting a problem.

Just in case, I added code to handle any annotations that were somehow orphaned (for example, if someone deleted a problem that had annotations in the past). These annotations can only be viewed, and not edited or deleted. They won't affect the overall score either. Note that going forward, annotations shouldn't become orphaned, just deleted.

Before deletion
Screenshot 2022-11-28 at 16 52 42

After deletion
Screenshot 2022-11-28 at 16 53 05

New warning message
Screenshot 2022-11-28 at 16 53 29

Orphaned annotations
Screenshot 2022-11-28 at 16 58 40

@michellexliu

Copy link
Copy Markdown
Contributor

lgtm! just fix the merge conflicts

@victorhuangwq victorhuangwq left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Small nit

Comment thread app/assets/javascripts/annotations.js Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants