This class would belong more appropriately within the 'user' API
(core_user) instead of within the 'core' API, since it is
directly related to user data.
Since the class has only just been added to Moodle, now is a good
time to move it.
In all cases changes have been kept to a minimum while not making
the code completely horrible. For example, there are many instances
where it would probably be better to rewrite a query entirely, but
I have not done that (in order to reduce the risk of changes).
The completion set_module_viewed and the course_module_viewed event
code has been moved to the workshop class.
This change is consistent with other modules (like lesson, feedback or
quiz) and it is necessary to be able to use the new method via WS.
The screen reader had to read through all the phases tasks. This patch
adds an accessibility link to the list of the current phase tasks so the
user can skip directly to them.
Change userplan HTML structure from table to unordered definition list
<dl> <dt> and <dd>. Add accessibility string for task-todo, task-done,
task-fail, task-info to be read by screen reader
There was a bug with serving the files from the areas instructauthors,
instructreviewers and conclusion. These three areas should not use the
itemid in the plugininfo URLs. But they did use 0 as the itemid which
broke the file previews when browsing via server files repository.
The first part of the patch fixes all relevant calls to
file_rewrite_pluginfile_urls() so that null is now properly used instead
of zero.
The second part of the fix is that we no longer delete the first $args
element in the workshop_pluginfile() function - the itemid is not
supposed to appear there now.
The last part of the patch is that instead of repeating the same code
block copy&pasted for each file area in workshop_pluginfile(), we now
have a single block covering them all.
dirname() is a slow function compared with __DIR__ and using
'/../'. Moodle has a large number of legacy files that are included
each time a page loads and is not able to use an autoloader as it is
functional code. This allows those required includes to perform as
best as possible in this situation.
The count_submissions() method does not take the actual enrolment into
account. It is part of the API that looks on all existing data
regardless the actual status of their owner. The author of the
submission may be unenrolled or suspended, in which case they are not
displayed in the report and we would get wrong figures.
This patch adds a new report to be displayed during the submission
phase. The report displays all participants who are supposed to submit
their work into the workshop and the status of their submission.
This event was missed in the previous workshop add_to_log change over. The
switch phase event has been moved into the workshop::switch_phase() method.
Also workshop::log() has been deprecated. Developers should use the event
classes to log events.
Now we are checking for the need to switch the phase when the main
view.php is displayed to any user (previously this was done via cron
only). To give our subplugins (such as the scheduled allocation method)
a chance to do what they need to do, the workshop_viewed event is
triggered before the phase is actually switched.
Teachers can now choose the actual grading evaluation method to use
during the grading evaluation phase. The workshopeval_best is still used
as the default one (this may be made configurable later, although there
is no big benefit of it).
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.
The method user_picture::fields() was not available when these SQL
statements were originally written. Now instead of hard-coding the list
of returned fields, the user_picture is asked for the list.
Together with this change, methods workshop::get_submission_by_id()
and workshop::get_submission_by_author() now return the information
about the user who provided the feedback and overwrote the grade.
Includes change so that updating completion resets the cache, and a debugging
warning if any module calls the completion viewed thing after it's already
printed navigation (which will mean navigation obviously doesn't update right
away). All existing modules that currently update after printing navigation
were updated.
While working on the new capability to view authors of published
submissions, I realized that published submissions are correctly listed
(implemented in 00bc77ee) but they can't be viewed by submission.php.
This patch fixes submission.php so that it allows to view published
submissions.
Also, I noticed that when the workshop is closed, the submissions that
were assessed by the user are not listed (as they were in the previous
phases) but submission.php provides access to them correctly. So I added
a code that lists assessed submissions in the closed phase.
Re-using 'mod/workshop:viewauthornames' would not be a happy option here
because teacher would have to change local overrides every time when
they were closing or re-opening the workshop (if they wanted anonymous
assessment but non-anonymous hall of fame).
This was caused by incorrect construction of workshop_submission_summary.
Instead of direct initiation, the helper method should be used. The
helper adds a property 'url' needed to render 'href' later.