Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Programming exercises: Fix misplaced inline feedback when switching files in online code editor #7396

Merged
merged 2 commits into from
Oct 21, 2023

Conversation

b-fein
Copy link
Contributor

@b-fein b-fein commented Oct 16, 2023

Checklist

General

Client

  • Important: I implemented the changes with a very good performance, prevented too many (unnecessary) REST calls and made sure the UI is responsive, even with large data.
  • I followed the coding and design guidelines.
  • I documented the TypeScript code using JSDoc style.

Motivation and Context

Hotfix for issue #7033.
Inline feedback sometimes gets placed in the wrong location when switching files. This sometimes leads to overlapping feedback over code or other feedback which makes it tutors to assess the code.

Description

Always scrolls the editor to the top when switching files. This seems to fix the calculations for the annotation placement.

A more permanent solution might be #7393.

No currently available functionality is lost by always scrolling to the top:
Right now, the editor scrolls to some position dependent on whichever file you are switching from (e.g., you were in file $A$ at the very top, switch to file $B$ and scroll down, then switch back to $A$; you are now scrolled down, too). Therefore, the location in the previous file was lost anyway. With this change at least the location you end up in is consistent.

Steps for Testing

Prerequisites:

  • 1 Instructor
  • 1 Programming Exercise with manual assessments that contain inline feedbacks
    • One file $A$ contains an annotation somewhere at the top of the file in line $n$.
    • Another file $B$ is long enough so that you can scroll down far enough so that only lines $l > n$ are visible.
    • Note: This probably also works when starting a new assessment and creating the necessary inline annotations as you go along.
  1. Go to the tutor assessment view for the submission.
  2. Go to file $A$, stay at the top.
  3. Switch to file $B$, scroll down so that the topmost shown line is further down than the line which contains the annotation placed in $A$.
  4. Switch back to file $A$
  5. All the annotations in the file are shown correctly.

Review Progress

Code Review

  • Code Review 1
  • Code Review 2

Manual Tests

  • Test 1
  • Test 2

Test Coverage

unchanged

@github-actions github-actions bot added the client Pull requests that update TypeScript code. (Added Automatically!) label Oct 16, 2023
@b-fein b-fein marked this pull request as ready for review October 16, 2023 16:16
@b-fein b-fein requested a review from a team as a code owner October 16, 2023 16:16
@b-fein b-fein requested a review from chrisknedl October 16, 2023 16:16
@b-fein b-fein added the small label Oct 16, 2023
Copy link
Contributor

@chrisknedl chrisknedl left a comment

Choose a reason for hiding this comment

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

Line of Code + Comment looks good. Will test tomorrow.

Edit: Tested, and inline feedback is still shown correctly after following the testing steps. Thanks for (seemingly) finally finding a fix for this long-running issue.

Copy link
Contributor

@valentin-boehm valentin-boehm left a comment

Choose a reason for hiding this comment

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

Tested, looks good

@b-fein b-fein added this to the 6.6.2 milestone Oct 18, 2023
Copy link
Contributor

@Strohgelaender Strohgelaender left a comment

Choose a reason for hiding this comment

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

code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix client Pull requests that update TypeScript code. (Added Automatically!) component:Programming ready to merge small user interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants