-
Notifications
You must be signed in to change notification settings - Fork 73
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
Make course module folding optional and implement automatic scrolling #1189
Conversation
5ba2eec
to
18dccd7
Compare
We agreed to add another button to select the scrolling behavior, because some people might want to disable it or want it to scroll immediately without animation. |
I pushed some updates, ready for a review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! One proposed behavioural change: I don't think the page should scroll automatically for people new to the course. We probably want any introductory text at the top of the course be visible in that case. The simple fix is to not scroll if the first module (or, equivalently, all modules) is visible. Scrolling in that case doesn't seem necessary as the module would be visible anyway (unless the intro text is really long).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! In the future, it'd be preferable if any new changes came in a separate commit to make it easier to see what has changed.
You can still see what changed since the last force-push if you click the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I otherwise approve this but I'm wondering whether the previous module should be uncollapsed as stated in the issue #1125 or wheter it becomes a non-issue after these changes. I also don't see any hurry in merging this, so we could wait in case Markku or Pasi has some comments about the exact behaviour.
You can still see the what changed since the last force-push if you click the
Compare
button next to the force-push activity. It's easier not having to squash the commits later if everything is ready for merging.
Oh! I didn't realize. However, there is still the issue that review comments cannot be added through that compare page. In this case it wouldn't have mattered as I had no new comments to make but in general at least I would prefer having the corrections in separate commits.
I previously talked about expanding the most recently closed module with Markku, and I think we came to the conclusion it would be a bit confusing. For example, it might look like to the student that the module is still open, since the older closed modules are collapsed. |
@@ -0,0 +1,146 @@ | |||
function checkButton(button) { | |||
button | |||
.attr("aria-pressed", "true") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line contains mixed tabs and spaces for indentation. The file uses tabs, but our JS styleguide requires 2 spaces.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed it to spaces myself.
The automatic folding and hiding of expired course modules on the user results page was suboptimal and annoying for some students/teachers. Old course modules are no longer hidden behind a button and folding is made optional with the use of a new "Expand all modules" button. Automatic scrolling takes the user to the first open module, unless the page contains previously unseen course news. Automatic scrolling can be enabled/disabled and the behavior can be selected using two new buttons. Fixes apluslms#1125
dbb5f1c
to
17aa6eb
Compare
Description
What?
The automatic folding and hiding of expired course modules on the user results page was suboptimal and annoying for some students/teachers.
Old course modules are no longer hidden behind a button and folding is made optional with the use of a new "Expand all modules" button. Automatic scrolling takes the user to the first open module, unless the page contains previously unseen course news.
Why?
Improvements to course module folding were requested by a teacher.
How?
Local storage is used to save the state of the "Expand all modules" button and the course news strings for each course.
If the "Expand all modules" button is checked, all course modules will be expanded upon page load, even if they are expired or inaccessible.
If the page contains course news that aren't found in local storage, the page will not be automatically scrolled to the first open module, so that the student has a chance of noticing the news.
Fixes #1125
Testing
What type of test did you run?
Tested that the folding and scrolling work as expected.
Did you test the changes in
Translation
Programming style
Have you updated the README or other relevant documentation?
Is it Done?