The patch introduces two new classes for rendering assessments of
example submission - both the training one and the reference one.
Together with the cooking functions for obtaining instances of these
classes.
QuickForms do not distinguish non-checked radio from the checked radio
with the value "0". So we map the database grade value "0" to a value
"-1" when displaying the form and vice versa when saving the form. This
allowed us to have none radios checked by default and force the grader
to actually answer the form themselves, using the 'required' rule.
This patch introduces a new hidden field with the value "-1". The grade
selectors are compared with this values and must be greater than it.
This should fit well for numerical grades with the range 0..x and scale
items with the range 1..x.
New PARAM_COMPONENT, PARAM_AREA and PARAM_PLUGIN + fixing of hopefully all current incorrect parameter types. This should help with diagnosing of incorrectly named 3rd party plugins too.
The Workshop module using the "Number of errors" grading strategy did
not save all items in the grade mapping table. If some assessment form
fields have weight > 1, the number of possible errors is greater that
the number of the assessment form fields. The previous code deleted all
mappings where the number of errors was greater than the number of
fields.
In this patch, the maximum number of possible errors is calculated as a
sum of weights of all fields. Only mappings over this maximum are
deleted now.
For modules that still used the 'old' generic object return from _get_coursemodule_info instead of returning a cached_cm_info object, I changed them to use the new format as part of this. This made a few areas of code regarding onclick links slightly nicer.
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.
Instead of including whole formslib just to get the constant defined, I
decided to hard-code the value and put the reference to the comment so
that eventual grep would spot it. Of course that is is not nice at all
but it's lesser of two evils imho.
MSSQL requires that the columns in the ORDER BY clause list must be
unique. The patch populates the list of fields by combining an array of
explicit sort definition with an array of implicit (default) sort
definition.
When generating the output of the allocation results, the names of
reviewers and authors are obtained based on the current state of assigned
roles and the 'musthavesubmission' setting. Therefore, when we want to
display information about a re-used allocation, the name of the author
or the name of the author may not be available.
In case of reviewers, we first try to reload the list including the
users without own submission. If it does not help, we just display the
id of the user instead of the name. In case of authors, we just display
the id the user. I can't see much point of eventual fetching the user
record from the database just to populate the list that almost no-one
reads anyway.
Because the Workshop module creates two grade items in the gradebook, we
can't use standard modedit features to set the corresponding category in
the gradebook (it supports single grade item only).
The patch also cleans the mod_form.php so that it does not use the
global $COURSE (just because I do not like this global variable).
And for the record - QuickForms must die.
* Added the component and ratingarea fields and implemented it throughout
the rating API as mandatory fields
* Cleanup rating indexes
* Upgrade forum/data/glossary ratings
* Moved the logic in the render_rating method to methods of the rating object.
* Added new callback for checking ratingareas
* Cleaned comments here and there
* Mark the xxx_get_participants methods as deprecated
* Refactor rate_ajax and ratingsuser_can_view_aggregate methods
* Cleaned up rating/index.php to use html_table object and moved inline styles to CSS.
* Added missing properties of the rating object that were being set throughout the rating
API.
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.
The new strings file core_plugin defines names of all plugin types
supported by Moodle. Some strings have already been defined elsewhere
and we use AMOS script here to copy their translation, if it is
available.
AMOS BEGIN
CPY [settings,core],[settings,core_plugin]
CPY [status,core],[status,core_plugin]
CPY [missingfromdisk,core],[status_missing,core_plugin]
CPY [nodatabase,core_admin],[status_nodb,core_plugin]
CPY [authenticationplugins,core],[type_auth_plural,core_plugin]
CPY [block,core],[type_block,core_plugin]
CPY [blocks,core],[type_block_plural,core_plugin]
CPY [coursereport,core],[type_coursereport,core_plugin]
CPY [coursereports,core],[type_coursereport_plural,core_plugin]
CPY [filter,core],[type_filter,core_plugin]
CPY [courseformats,core],[type_format_plural,core_plugin]
CPY [activitymodule,core],[type_mod,core_plugin]
CPY [activitymodules,core],[type_mod_plural,core_plugin]
CPY [plagiarism,core_plagiarism],[type_plagiarism,core_plugin]
CPY [portfolio,core_portfolio],[type_portfolio,core_plugin]
CPY [portfolios,core_portfolio],[type_portfolio_plural,core_plugin]
CPY [questiontype,core_admin],[type_qtype,core_plugin]
CPY [questiontypes,core_admin],[type_qtype_plural,core_plugin]
CPY [repository,core_repository],[type_repository,core_plugin]
CPY [theme,core],[type_theme,core_plugin]
CPY [themes,core],[type_theme_plural,core_plugin]
CPY [uninstallplugin,core_admin],[uninstall,core_plugin]
CPY [version,core],[version,core_plugin]
CPY [assignmenttype,mod_assignment],[subplugintype_assignment,mod_assignment]
CPY [presets,mod_data],[subplugintype_datapreset_plural,mod_data]
CPY [evaluationmethod,mod_workshop],[subplugintype_workshopeval,mod_workshop]
CPY [strategy,mod_workshop],[subplugintype_workshopform,mod_workshop]
AMOS END
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.