Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
|
Strategy interface defines all methods that strategy subplugins has to implement. More...
Public Member Functions | |
form_ready () | |
Has the assessment form been defined and is ready to be used by the reviewers? More... | |
get_assessment_form (moodle_url $actionurl=null, $mode='preview', stdclass $assessment=null, $editable=true, $options=array()) | |
Factory method returning an instance of an assessment form. More... | |
get_assessments_recordset ($restrict=null) | |
Returns recordset with detailed information of all assessments done using this strategy. More... | |
get_dimensions_info () | |
Returns a general information about the assessment dimensions. More... | |
get_edit_strategy_form ($actionurl=null) | |
Factory method returning a form that is used to define the assessment form. More... | |
save_assessment (stdclass $assessment, stdclass $data) | |
Saves the filled assessment and returns the grade for submission as suggested by the reviewer. More... | |
save_edit_strategy_form (stdclass $data) | |
Saves the assessment dimensions and other grading form elements. More... | |
Static Public Member Functions | |
static | delete_instance ($workshopid) |
Delete all data related to a given workshop module instance. More... | |
static | scale_used ($scaleid, $workshopid=null) |
Is a given scale used by the instance of workshop? More... | |
Strategy interface defines all methods that strategy subplugins has to implement.
|
static |
Delete all data related to a given workshop module instance.
This is called from workshop_delete_instance().
int | $workshopid | id of the workshop module instance being deleted |
void |
Implemented in workshop_accumulative_strategy, workshop_comments_strategy, workshop_numerrors_strategy, and workshop_rubric_strategy.
workshop_strategy::form_ready | ( | ) |
Has the assessment form been defined and is ready to be used by the reviewers?
boolean |
Implemented in workshop_accumulative_strategy, workshop_comments_strategy, workshop_numerrors_strategy, and workshop_rubric_strategy.
workshop_strategy::get_assessment_form | ( | moodle_url | $actionurl = null , |
$mode = 'preview' , |
|||
stdclass | $assessment = null , |
||
$editable = true , |
|||
$options = array() |
|||
) |
Factory method returning an instance of an assessment form.
moodle_url | $actionurl | URL of form handler, defaults to auto detect the current url |
string | $mode | Mode to open the form in: preview|assessment |
stdClass | $assessment | If opening in the assessment mode, the current assessment record |
bool | $editable | Shall the form be opened as editable (true) or read-only (false) |
array | $options | More assessment form options, editableweight implemented only now |
Implemented in workshop_accumulative_strategy, workshop_comments_strategy, workshop_numerrors_strategy, and workshop_rubric_strategy.
workshop_strategy::get_assessments_recordset | ( | $restrict = null | ) |
Returns recordset with detailed information of all assessments done using this strategy.
The returned structure must be a recordset of objects containing at least properties: submissionid, assessmentid, assessmentweight, reviewerid, gradinggrade, dimensionid and grade. It is possible to pass user id(s) of reviewer(s). Then, the method returns just the reviewer's assessments info.
array | int | null | $restrict | optional id or ids of the reviewer |
moodle_recordset |
Implemented in workshop_accumulative_strategy, workshop_comments_strategy, workshop_numerrors_strategy, and workshop_rubric_strategy.
workshop_strategy::get_dimensions_info | ( | ) |
Returns a general information about the assessment dimensions.
array | [dimid] => stdclass (->id ->max ->min ->weight and optionally ->scale containing scale items) |
Implemented in workshop_accumulative_strategy, workshop_comments_strategy, workshop_numerrors_strategy, and workshop_rubric_strategy.
workshop_strategy::get_edit_strategy_form | ( | $actionurl = null | ) |
Factory method returning a form that is used to define the assessment form.
string | $actionurl | URL of the action handler script, defaults to auto detect |
stdclass | The instance of the assessment form editor class |
Implemented in workshop_accumulative_strategy, workshop_comments_strategy, workshop_numerrors_strategy, and workshop_rubric_strategy.
workshop_strategy::save_assessment | ( | stdclass | $assessment, |
stdclass | $data | ||
) |
Saves the filled assessment and returns the grade for submission as suggested by the reviewer.
This method processes data submitted using the form returned by get_assessment_form() The returned grade should be rounded to 5 decimals as with round($grade, 5).
stdClass | $assessment | Assessment being filled |
stdClass | $data | Raw data as returned by the assessment form |
float|null | Raw percentual grade (0.00000 to 100.00000) for submission as suggested by the peer or null if impossible to count |
Implemented in workshop_accumulative_strategy, workshop_comments_strategy, workshop_numerrors_strategy, and workshop_rubric_strategy.
workshop_strategy::save_edit_strategy_form | ( | stdclass | $data | ) |
Saves the assessment dimensions and other grading form elements.
Assessment dimension (also know as assessment element) represents one aspect or criterion to be evaluated. Each dimension consists of a set of form fields. Strategy-specific information are saved in workshopform_{strategyname} tables.
stdClass | $data | Raw data as returned by the form editor |
void |
Implemented in workshop_accumulative_strategy, workshop_comments_strategy, workshop_numerrors_strategy, and workshop_rubric_strategy.
|
static |
Is a given scale used by the instance of workshop?
If the grading strategy does not use scales, it should just return false. If the strategy supports scales, it returns true if the given scale is used. If workshopid is null, it checks for any workshop instance. If workshopid is provided, it checks the given instance only.
int | $scaleid | id of the scale to check |
int | null | $workshopid | id of workshop instance to check, checks all in case of null |
bool |
Implemented in workshop_accumulative_strategy, workshop_comments_strategy, workshop_numerrors_strategy, and workshop_rubric_strategy.