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.