Sometimes it is necssary to display parts of a question outside of an
attempt. For example for staff review. When displaying the question, we
need to handle images in the question text. In the past there was a
mechanism for this that could only cope with the question text.
This commit introduces a new method that can handle displaying any
part of the question content.
This commit intentionally does not upgrade the parts of the system that
use the mecanism. That is so that this commit can be used to demonstrate
that backwards-compatibility works. The next commit will upgrade the
callers.
Prior to the fix, if you did not have a capability like mod/page:view,
then you woulds still see the link to the Page activity in the course
section, but when you clicked on it, you would run into a
require_capability error.
It is a principle that we never show users a link to a page they are not
allowed to access, therefore, when users do not have mod/...:view, they
should not see the link on the course page.
This patch implements this in the cm_info class, in a similar way to how
access restrictions by groups works.
It does not assume that the mod/...:view capability exists. If the
capability does not exist, then users are not prevented from seeing the
link.
I have improved the names in the language file so that they actually say
what they do (based on my reading of the code). I have also added
comments to access.php explaining each capability.
I have corrected a few of the RISK in access.php which were wrong.
I have changed a couple of the archetypes so that guests cannot launch
LTI activities, and editing teachers cannot do editing things.
Without this fix, if an LTI tool is set to open in a pop-up, then
clicking the link on the course page opens another almost blank page,
which then tries to open the pop-up, which is almost invariably caught
by your pop-up blocker.
With this fix, clicking the link on the course page opens the pop-up
directly, like for pop-up resources.