Skip to content

Commit

Permalink
Merge pull request #70 from odeialba/SV-60
Browse files Browse the repository at this point in the history
SV-60 Change behaviour so once the student has voted, they are taken automatically to the results screen
  • Loading branch information
odeialba authored May 3, 2024
2 parents 7836a79 + 9a03bf7 commit 667dfd8
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 667dfd8

Please sign in to comment.