Skip to content

[Bugfix:TAGrading] Fix Notebook scroll#12603

Merged
bmcutler merged 5 commits into
Submitty:mainfrom
itsjanajana:fix-notebook-scroll-grader
Apr 15, 2026
Merged

[Bugfix:TAGrading] Fix Notebook scroll#12603
bmcutler merged 5 commits into
Submitty:mainfrom
itsjanajana:fix-notebook-scroll-grader

Conversation

@itsjanajana

Copy link
Copy Markdown
Contributor

Why is this Change Important & Necessary?

Fixes #11096 : Graders cannot scroll to see the full answer in a codebox if the content overflows.
Grading becomes difficult if TA/Instructor can not scroll to view the whole answer. Fix enables to view entire answer, expand and scroll with a horizontal and vertical scrollbar in the codebox. Editing still remains disabled. Text selection, horizontal/vertical scrolling, and box expansion are allowed.

What is the New Behavior?

Before

  • Textboxes and codeboxes could not scroll or expand properly.
  • Horizontal and vertical scrollbars existed but were not accessible due to pointer-events:none.
Screenshot 2026-03-18 232102 Above photo shows how the three textboxes do not expand. There is a little double slash expansion symbol in bottom right corner in all of the textboxes, but cursor can not access it. Screenshot 2026-03-18 232124 Same with codeboxes. The horizontal and vertical scrollbar in each of the codeboxes can not be accessed by cursor.

After

  • Scrollbars in codeboxes are now fully functional.
  • Textboxes (short answer) can be expanded horizontally; text can be scrolled and selected.
  • Editing remains prevented in grader view.
Screenshot 2026-03-18 235307 Screenshot 2026-03-18 235317 Above two photos shows how the textbox can be expanded horizontally. There is no scrollbar, but upon pressing the right key on keyboard, the text does move and can be viewed easily. Editing of the textboxes is still not allowed, even though pointer-events condition removed. Screenshot 2026-03-18 235227 Screenshot 2026-03-18 235251 The codeboxes already came with vertical & horizontal scrollbars, but were initially not working due to the cursor pointer settings, those are working now. The boxes can be expanded, and scrolled horizontally and vertically enabling easier grading.

What steps should a reviewer take to reproduce or test the bug or new feature?

  1. Open Grading for an assignment with a long answer question. I used Notebook Basic Grading.
  2. Select a submission with a long answer that overflows, I used student(Joe) submission.
  3. Try and scroll to see the full content. Before the PR, it does not allow scroll or expansion. It only lets you select texts but that also, you can't really see what youre selecting. After the PR, the scrolling, expansion, and text selection work properly..

Automated Testing & Documentation

  • This fix is a minor UI interaction change.
  • I have manually tested in local Vagrant environment.
  • No automated tests added
  • No additional documentation, it is a minor UI fix.

Other information

  • Is this a breaking change? No
  • Does this PR include migrations to update existing installations? No
  • Are there security concerns with this PR? No

Code Changes

Photo of the changes i have made in code.
Screenshot 2026-03-19 002719

  • Removed "pointer-events:none" as it did not let any mouse interaction with the text/code boxes.
  • Added "readOnly: true" to ensure that even if codebox is uneditable, scrolling/expansion/selection are allowed.

@Benny-Dav Benny-Dav 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.

Great fix.
I tested a similar fix and found a potential simplification. Kindly find comment inline.

$('#codebox_{{ num_codeboxes }}').addClass("small-mirror");
}

{% if viewing_inactive_version or is_grader_view %}

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.

I think this "is_grader_view" condition on this line might be redundant, because lines 382 - 401 also set readOnly to true for is_grader_view condition for the CodeMirror element.
I have tested without the condition here and the fix behaviour still works.
Do you think we could simplify this?

@itsjanajana
itsjanajana force-pushed the fix-notebook-scroll-grader branch from 18e6cf8 to ff071a1 Compare March 21, 2026 23:03
@codecov

codecov Bot commented Mar 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 21.64%. Comparing base (f532a4f) to head (a94f980).
⚠️ Report is 17 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##               main   #12603   +/-   ##
=========================================
  Coverage     21.64%   21.64%           
  Complexity     9654     9654           
=========================================
  Files           268      268           
  Lines         36244    36244           
  Branches        487      487           
=========================================
  Hits           7845     7845           
  Misses        27916    27916           
  Partials        483      483           
Flag Coverage Δ
autograder 21.32% <ø> (ø)
js 2.04% <ø> (ø)
migrator 100.00% <ø> (ø)
php 20.66% <ø> (ø)
python_submitty_utils 80.08% <ø> (ø)
submitty_daemon_jobs 91.13% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dagemcn
dagemcn self-requested a review March 24, 2026 00:32
@automateprojectmangement automateprojectmangement Bot moved this from Seeking Reviewer to In Review in Submitty Development Mar 24, 2026

@dagemcn dagemcn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Good work on this issue. I agree with @Benny-Dav, your change on line 133 is redundant. However, I notice that with the fix you can only expand the boxes vertically. Since this is a fairly small issue I think it would be suitable to implement a fix for this within this PR as opposed to creating an entirely new issue. Remove the changes on lines 133-136 and fix the double slash expansion bug and I'll approve.

@github-project-automation github-project-automation Bot moved this from In Review to Work in Progress in Submitty Development Mar 24, 2026
@dagemcn dagemcn changed the title [Bugfix:TA Grading] Fix Notebook scroll [Bugfix:TAGrading] Fix Notebook scroll Mar 24, 2026
@dagemcn dagemcn self-assigned this Mar 24, 2026
@itsjanajana

Copy link
Copy Markdown
Contributor Author

Thanks for the feedback! I have updated now

  • Removed the redundant "is_grader_view, readOnly" condition.
  • Updated the resize behavior to allow both horizontal and vertical scrolling
    All existing scrolling and selection features still work.

@itsjanajana
itsjanajana requested a review from dagemcn April 1, 2026 12:34
@automateprojectmangement automateprojectmangement Bot moved this from Work in Progress to In Review in Submitty Development Apr 1, 2026

@dagemcn dagemcn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Resizing now works as intended. I notice that if the text does not fix in the text box horizontally, there is no horizontal scroll bar making it difficult for graders to view text that goes past the maximum horizontal expansion size. However, I think this is an issue for another PR. Good changes here.

@github-project-automation github-project-automation Bot moved this from In Review to Awaiting Maintainer Review in Submitty Development Apr 3, 2026
@bmcutler
bmcutler merged commit 6d3367e into Submitty:main Apr 15, 2026
24 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Graders cannot scroll to see the full answer in a codebox if the content overflows.

4 participants