Moodle  2.2.1
http://www.collinsharper.com
workshop_strategy Interface Reference
Inheritance diagram for workshop_strategy:

Public Member Functions

 get_edit_strategy_form ($actionurl=null)
 save_edit_strategy_form (stdclass $data)
 get_assessment_form (moodle_url $actionurl=null, $mode='preview', stdclass $assessment=null, $editable=true, $options=array())
 save_assessment (stdclass $assessment, stdclass $data)
 form_ready ()
 get_dimensions_info ()
 get_assessments_recordset ($restrict=null)

Static Public Member Functions

static scale_used ($scaleid, $workshopid=null)
static delete_instance ($workshopid)

Detailed Description

Strategy interface defines all methods that strategy subplugins has to implement

Definition at line 32 of file lib.php.


Member Function Documentation

static delete_instance ( workshopid) [static]

Delete all data related to a given workshop module instance

This is called from workshop_delete_instance().

Parameters:
int$workshopidid of the workshop module instance being deleted
Returns:
void

Implemented in workshop_rubric_strategy, workshop_numerrors_strategy, workshop_accumulative_strategy, and workshop_comments_strategy.

Has the assessment form been defined and is ready to be used by the reviewers?

Returns:
boolean

Implemented in workshop_rubric_strategy, workshop_numerrors_strategy, workshop_accumulative_strategy, and workshop_comments_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

Parameters:
moodle_url$actionurlURL of form handler, defaults to auto detect the current url
string$modeMode to open the form in: preview|assessment
stdClass$assessmentIf opening in the assessment mode, the current assessment record
bool$editableShall the form be opened as editable (true) or read-only (false)
array$optionsMore assessment form options, editableweight implemented only now

Implemented in workshop_rubric_strategy, workshop_numerrors_strategy, workshop_accumulative_strategy, and workshop_comments_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.

Parameters:
array | int | null$restrictoptional id or ids of the reviewer
Returns:
moodle_recordset

Implemented in workshop_rubric_strategy, workshop_numerrors_strategy, workshop_accumulative_strategy, and workshop_comments_strategy.

Returns a general information about the assessment dimensions

Returns:
array [dimid] => stdclass (->id ->max ->min ->weight)

Implemented in workshop_rubric_strategy, workshop_numerrors_strategy, workshop_accumulative_strategy, and workshop_comments_strategy.

get_edit_strategy_form ( actionurl = null)

Factory method returning a form that is used to define the assessment form

Parameters:
string$actionurlURL of the action handler script, defaults to auto detect
Returns:
stdclass The instance of the assessment form editor class

Implemented in workshop_rubric_strategy, workshop_numerrors_strategy, workshop_accumulative_strategy, and workshop_comments_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).

See also:
grade_floatval()
Parameters:
stdClass$assessmentAssessment being filled
stdClass$dataRaw data as returned by the assessment form
Returns:
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_rubric_strategy, workshop_numerrors_strategy, workshop_accumulative_strategy, and workshop_comments_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.

Parameters:
stdClass$dataRaw data as returned by the form editor
Returns:
void

Implemented in workshop_rubric_strategy, workshop_numerrors_strategy, workshop_accumulative_strategy, and workshop_comments_strategy.

static scale_used ( scaleid,
workshopid = null 
) [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.

Parameters:
int$scaleidid of the scale to check
int | null$workshopidid of workshop instance to check, checks all in case of null
Returns:
bool

Implemented in workshop_rubric_strategy, workshop_numerrors_strategy, workshop_accumulative_strategy, and workshop_comments_strategy.


The documentation for this interface was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations