In order to use the overall feedback in assessments of example
submissions and in the assessment form preview, significant improvements
in the rendering machinery were done.
Workshop class provides two new methods overall_feedback_content_options()
and overall_feedback_attachment_options() as they are needed at various
scripts and libraries.
Overall feedback is displayed as a part of the workshop_assessment_form
only if the form is in editable mode (not frozen). If the form is
displayed in read-only (frozen) mode, the caller is expected to render
the overall feedback and list of attachments (the editor and filemanager
elements do not support frozen mode). To do so, the renderable
workshop_assessment now loads overall feedback data and provides two new
methods get_overall_feedback_content() and
get_overall_feedback_attachments() to be used by the renderer.
Renderable workshop_submission, workshop_assessment and related classes
now accept the workshop instance as the first parameter in their
constructors. This way, these renderable classes have access to the
workshop API.
In the future, the rendering of submission files should be improved in
the same way as is done in this patch (i.e. moving the logic and data
preparation out of the renderer into the renderable classes).
The assessment form can be displayed as editable or read-only (frozen).
Neither the editor element nor the filemanager element support
displaying frozen content themselves so we need to pre-format and inject
static texts.
The list of attachments should be ideally generated by the renderer and
probably improved a bit - just quick and dirty solution must be enough
for now though (2.5 coding freeze is just behind the corner...).
AMOS BEGIN
CPY [submissionattachment,mod_workshop],[feedbackauthorattachment,mod_workshop]
AMOS END
Three new fields are added into the into the Assessment settings section
of the form. The default value for the overallfeedbackmaxbytes is the
same as the maximum size for submission attachments (which seems to be a
reasonable value). If there is a demand and a strong use case, these
values can became per-site configurable (I can see no big benefit of
doing so right now).
AMOS BEGIN
CPY [maxbytes,mod_workshop],[overallfeedbackmaxbytes,mod_workshop]
AMOS END
These three fields hold the per-instance settings for the new Overall
feedback feature. Expected values in the new overallfeedbackmode fields are:
0 - the feature is disabled in this workshop instance
1 - overall feedback is optional (default)
2 - overall feedback is required (i.e. the reviewer must put some text
into the overall feedback field).
Files can be attached to the overall feedback text field, if the field
overallfeedbackfiles > 0 and the feature is enabled (i.e. it is optional
or required). The actual number of attached files is not checked in the
required mode (i.e. attaching files is always optional, if it is
allowed).
GD PHP extension is now required. Add-ons need to remove $CFG->gdversion tests. The worst case regression is that add-on will think GD is not available.