You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a teacher tries to create a new Shortmath question, a permission error occurs. You can see it in the screenshot below (in a popup window).
In the question creation page, the page loads the Default template and correctly tries to preview it through a web service call to external function qtype_shortmath_get_template, which calls the get_template function inside the editor_template.
Inside this function template_require_capability_on is called, where the viewall capability is checked (template_has_capability_on) but, since Default template is assigned to system context and course teachers has no system capabilities, obviously a permission error occurs.
A workaround is to assign viewall capability to the Authenticated user role, since it is not assigned by default.
Maybe for "preview only" purpose users should not need any capability, which should be requested only inside template editor.
Steps to reproduce the behavior (after plugin installation):
Create a "test user"
Create a "test course"
Enrol the "test user" in the "test course" with role "editing teacher"
Log in as "test user"
Go to "test course"
Go to Question bank
Create a new Shortmath question
See the error as described before
Thanks,
Giorgio
The text was updated successfully, but these errors were encountered:
We started to experience the same issue, I wonder how come we never experience it before.
Thank you @Kemmotar83 for the workaround, which solved this issue, for now.
Hi,
we experienced the following problem.
When a teacher tries to create a new Shortmath question, a permission error occurs. You can see it in the screenshot below (in a popup window).
In the question creation page, the page loads the Default template and correctly tries to preview it through a web service call to external function qtype_shortmath_get_template, which calls the get_template function inside the editor_template.
Inside this function template_require_capability_on is called, where the viewall capability is checked (template_has_capability_on) but, since Default template is assigned to system context and course teachers has no system capabilities, obviously a permission error occurs.
A workaround is to assign viewall capability to the Authenticated user role, since it is not assigned by default.
Maybe for "preview only" purpose users should not need any capability, which should be requested only inside template editor.
Steps to reproduce the behavior (after plugin installation):
Thanks,
Giorgio
The text was updated successfully, but these errors were encountered: