Fix UX issue with submit capability in kaltura assignment #380
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
mod/kalvidassign:submit
capability allows students to submit videos in assignments (kalvidassign module). By default, students have this capability and teachers don't. This permission is enforced inmod/kalvidassign/lti_launch.php
. However, themod/kalvidassign/view.php
file renders the submission preview and submit buttons regardless of the user permissions. Thus, a user without the permission (eg. a teacher) sees the submit buttons but when clicking on them the LTI popup window shows an error requiring the permission.This PR improves the module usability for users without this permission by not showing the submit buttons if they don't have the capabaility that will anyway be enforced later.
Diff note:
The PR is just two lines of code (the if and the closing brace), but all lines within the if block are also affected due to the indent.
History note:
Digging in the source history, the initial code came with a similar (but not equal!) check: it only showed the submit buttons if the user did NOT have the permission
mod/gradesubmission
. That resulted in a bug for users with bothsubmit
andgradesubmission
permissions because they could not submit their video. Then in commit cace68e the check was removed in order to fix the bug, but introducing this UX issue. With this PR, the case of students but locally teachers works fine since they see both submit and grade buttons.