Here, we catch all the places where a student might be accessing their
own attempts, and make sure any automatic state transitions that
should happen, do happen, before the student sees the attempt.
The places where we need to check this are view.php, startattempt.php
and processattempt.php.
We do not really need to check attempt.php or summary.php, because if
the student is on one of those pages, the JavaScript timer will
auto-submit when time expires, taking them to processattempt.php,
which will do the acutal work.
We intentionally do not trigger state transition when a teacher is
looking at a student's quiz attemp. We will trigger state transitions
on cron, but that is still to do.
Also, the body of the process_... methods still needs to be written.
It allows to define M.course.format.swap_sections and
M.course.format.get_section_selector in the course format javascript file, so
that course dragdrop is aware about perculiar layout and changes that need to
be done when sections are swapped.
The workshop_pluginfile() can't be more restrictive than the code that
actually displays the text with the embedded images. To view both
instructions fields in view.php, the capability to view the workshop is
enough. So the same level of access control is applied here by
require_login() at the top of the function.
The user has to have viewallsubmissions capability to be able to see the
submission files in the browser. Additionally, in the separate groups
mode, the user has to have accessallgroups or share at least one group
with the submission author to view their files.
This is a big win, we are now taking enrolment fully into account.
Also, no need to fetch big data from DB just to get their count. Should
have much better performance now.
Workshop grades reports in all three last phases were fixed to support
the group selection. They layout of the report has been unified to be
consistent across all phases.
Note how the participant is defined: it is a user that (1) can submit or
assess or both and (2) is actively enrolled in the course. This means
that usually admins or managers won't be considered as workshop
participants, for example.
If the method is called with $groupid set to 0 and the workshop is in
the groupmembersonly mode, a recursive call is used to populate the
fragments of SQL code that fetch users from all relevant groups. These
fragments are then concatenated using UNION statement.
This patch reimplements get_potential_authors() and get_potential_reviewers()
so that get_enrolled_sql() is used instead of get_users_by_capability().
This excludes non-enrolled users (or users with suspended enrolment)
from the list of potential users.
The patch also extends the returned user structure. Objects in the
returned collection are now suitable for user_picture renderer.