Skip to content

Commit

Permalink
SV-60 Change behaviour so once the student has voted, they are taken …
Browse files Browse the repository at this point in the history
…automatically to the results screen
  • Loading branch information
odeialba committed Apr 19, 2024
1 parent 2bcc213 commit 9a03bf7
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 10 deletions.
2 changes: 1 addition & 1 deletion amd/build/sortvoting.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion amd/build/sortvoting.min.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions amd/src/sortvoting.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ const saveVote = function(saveSortVoteElement) {
} else {
toastAdd(getString('voteerror', 'mod_sortvoting'), {type: 'danger'});
}
if (result.seeresultsupdated) {
// Reload the whole page so the results tab is visible now but wasn't before (or viceversa).
window.location.reload();
if (result.canseeresults) {
// If the user can see the results, redirect to the results page. Otherwise, reload the page.
window.location.href = result.redirecturl;
} else if (result.allowupdate) {
saveSortVoteElement.removeAttribute('disabled');
} else {
Expand Down
Loading

0 comments on commit 9a03bf7

Please sign in to comment.