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

Add separate vertical scroll bar to exercise submission inspect #1172

Closed

Conversation

EerikSaksi
Copy link
Contributor

Fixes #1111

Description

What?

The exercise submission can now be scrolled separately in the submission inspect view.

2023-04-04.16-15-47.mp4

Why?
This makes viewing long submissions easier

How?
Add the same scroll separately button to the submission as well, and create saas rules which applies the sticky scrolling correctly.

Fixes #1111

Testing

Remember to add or update unit tests for new features and changes.

What type of test did you run?

  • Accessibility test using the WAVE extension.
  • Django unit tests.
  • Selenium tests.
  • Other test. (Add a description below)
  • Manual testing.

Ensuring the sticky scrolling buttons works, and persists in LocalStorage
Did you test the changes in

  • Chrome
  • Firefox
  • This pull request cannot be tested in the browser.

Think of what is affected by these changes and could become broken

Translation

Programming style

  • Did you follow our style guides?
  • Did you use Python type hinting in all functions that you added or edited? (type hints for function parameters and return values)

Have you updated the README or other relevant documentation?

  • documents inside the doc directory.
  • README.md.
  • Aplus Manual.
  • Other documentation (mention below which documentation).

Is it Done?

  • Reviewer has finished the code review
  • After the review, the developer has made changes accordingly
  • Customer/Teacher has accepted the implementation of the feature

Clean up your git commit history before submitting the pull request!

Copy link
Contributor

@ihalaij1 ihalaij1 left a comment

Choose a reason for hiding this comment

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

Looks good, but I think the code in assessment.js could be improved by making the duplicated code into a function. See the comment I left.

exercise/static/exercise/assessment.js Outdated Show resolved Hide resolved
Copy link
Contributor

@markkuriekkinen markkuriekkinen left a comment

Choose a reason for hiding this comment

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

Nice, it looks good indeed! I requested a few minor stylistic changes.

We also need to test this more. The implementation does not seem to change anything concerning HTML-formatted grader feedback (when the feedback is not just plain text in <pre>). Need to check what happens then.

--sticky-top: 0;
flex-grow: 1;
.submitted-file.sticky > div {
@include sticky-submission-scroll
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
@include sticky-submission-scroll
@include sticky-submission-scroll;

Using the semicolon in the end seems to be the preferred programming style.
https://sass-lang.com/documentation/at-rules/mixin

display: flex;
flex-direction: column;
}
@include sticky-submission-scroll
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
@include sticky-submission-scroll
@include sticky-submission-scroll;

@@ -1,4 +1,37 @@
$(function () {
$.fn.addStickyButton = function (localStorageKey, actionCallback) {
// The "skicky" feature is enabled if ResizeObserver is available and there
Copy link
Contributor

Choose a reason for hiding this comment

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

"skicky" -> "sticky"

@@ -1,4 +1,37 @@
$(function () {
$.fn.addStickyButton = function (localStorageKey, actionCallback) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This line and the function definition are indented by 4 spaces, but they should only be indented one level. In JS, we have used only 2 spaces per level as you can see in the line 35:
$(document).on('aplus:translation-ready', function() {

The function body is of course indented more than the outer function(...) line.

@@ -1,4 +1,37 @@
$(function () {
$.fn.addStickyButton = function (localStorageKey, actionCallback) {
Copy link
Contributor

Choose a reason for hiding this comment

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

If the actionCallback is never used, why does the parameter exist?

@EerikSaksi EerikSaksi force-pushed the separate-vertical-scrollbar branch 2 times, most recently from 0de5ef0 to 7266b0f Compare May 9, 2023 11:14
@PasiSa PasiSa assigned markkuriekkinen and ihalaij1 and unassigned EerikSaksi May 18, 2023
@PasiSa
Copy link
Contributor

PasiSa commented May 18, 2023

It looks like Eerik has pushed a new version to address the comments. Maybe reviewers can check if their comments have been satisfied (and mark this as approved if so)?

Copy link
Contributor

@ihalaij1 ihalaij1 left a comment

Choose a reason for hiding this comment

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

There seems to be some problems still.

For example, try to submit two long Python files to aplus-manual exercise 6.3.6 Wallet.

After toggling/scrolling/toggling the left-hand side scroll separately button a few times, you will notice that it does not always function the way it should (sometimes it scrolls separately when the checkmark isn't checked etc.).

Additionally, the HTML feedback on the right-hand side is not separately scrollable at all.

@EerikSaksi
Copy link
Contributor Author

This should work now hopefully

@EerikSaksi
Copy link
Contributor Author

The scroll separately button should be found based on parameters and not the text of the button. Maybe this is possible when we feed the extrabuttons parameter to the highlightCode function?

@EerikSaksi EerikSaksi force-pushed the separate-vertical-scrollbar branch from 0fc9b97 to df038d8 Compare July 5, 2023 09:51
@EerikSaksi EerikSaksi force-pushed the separate-vertical-scrollbar branch from df038d8 to 1af958f Compare July 5, 2023 09:54
ihalaij1 added a commit to ihalaij1/a-plus that referenced this pull request Oct 18, 2023
The grader feedback already had a 'Scroll separately' button,
and it is now also added for the submitted files.

Fixes apluslms#1111
Closes apluslms#1172
ihalaij1 added a commit to ihalaij1/a-plus that referenced this pull request Oct 20, 2023
The grader feedback already had a 'Scroll separately' button,
and it is now also added for the submitted files.

Fixes apluslms#1111
Closes apluslms#1172
ihalaij1 added a commit to ihalaij1/a-plus that referenced this pull request Oct 20, 2023
The grader feedback already had a 'Scroll separately' button,
and it is now also added for the submitted files.

Fixes apluslms#1111
Closes apluslms#1172
ihalaij1 added a commit to ihalaij1/a-plus that referenced this pull request Oct 20, 2023
The grader feedback already had a 'Scroll separately' button,
and it is now also added for the submitted files.

Fixes apluslms#1111
Closes apluslms#1172
ihalaij1 added a commit to ihalaij1/a-plus that referenced this pull request Oct 20, 2023
The grader feedback already had a 'Scroll separately' button,
and it is now also added for the submitted files.

Fixes apluslms#1111
Closes apluslms#1172
ihalaij1 added a commit to ihalaij1/a-plus that referenced this pull request Oct 26, 2023
The grader feedback already had a 'Scroll separately' button,
and it is now also added for the submitted files.

Fixes apluslms#1111
Closes apluslms#1172
ihalaij1 added a commit to ihalaij1/a-plus that referenced this pull request Oct 26, 2023
The grader feedback already had a 'Scroll separately' button,
and it is now also added for the submitted files.

Fixes apluslms#1111
Closes apluslms#1172
ihalaij1 added a commit to ihalaij1/a-plus that referenced this pull request Oct 26, 2023
The grader feedback already had a 'Scroll separately' button,
and it is now also added for the submitted files.

Fixes apluslms#1111
Closes apluslms#1172
@PasiSa
Copy link
Contributor

PasiSa commented Nov 15, 2023

The functionality of this pull request will be covered in an later PR #1286 , that is planned to be merged soon. Therefore closing this pull request now.

@PasiSa PasiSa closed this Nov 15, 2023
ihalaij1 added a commit to ihalaij1/a-plus that referenced this pull request Nov 21, 2023
The grader feedback already had a 'Scroll separately' button,
and it is now also added for the submitted files.

Fixes apluslms#1111
Closes apluslms#1172
ihalaij1 added a commit that referenced this pull request Nov 21, 2023
The grader feedback already had a 'Scroll separately' button,
and it is now also added for the submitted files.

Fixes #1111
Closes #1172
ashi006 pushed a commit to ashi006/a-plus that referenced this pull request Nov 30, 2023
The grader feedback already had a 'Scroll separately' button,
and it is now also added for the submitted files.

Fixes apluslms#1111
Closes apluslms#1172
murhum1 pushed a commit to murhum1/a-plus that referenced this pull request Dec 21, 2023
The grader feedback already had a 'Scroll separately' button,
and it is now also added for the submitted files.

Fixes apluslms#1111
Closes apluslms#1172
ihalaij1 added a commit to ihalaij1/a-plus that referenced this pull request Dec 22, 2023
The grader feedback already had a 'Scroll separately' button,
and it is now also added for the submitted files.

Fixes apluslms#1111
Closes apluslms#1172
ihalaij1 added a commit to ihalaij1/a-plus that referenced this pull request Dec 22, 2023
The grader feedback already had a 'Scroll separately' button,
and it is now also added for the submitted files.

Fixes apluslms#1111
Closes apluslms#1172
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Separate vertical scroll bars for the submitted file and the grader feedback in the inspect submission view
4 participants