|
Moodle
2.2.1
http://www.collinsharper.com
|


Public Member Functions | |
| __construct (workshop $workshop) | |
| 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_assessments_recordset ($restrict=null) | |
| get_dimensions_info () | |
Static Public Member Functions | |
| static | scale_used ($scaleid, $workshopid=null) |
| static | delete_instance ($workshopid) |
Data Fields | |
| const | MINDIMS = 3 |
| const | ADDDIMS = 2 |
Protected Member Functions | |
| load_fields () | |
| prepare_form_fields (array $raw) | |
| delete_dimensions (array $ids) | |
| prepare_database_fields (stdclass $raw) | |
| get_current_assessment_data (stdclass $assessment) | |
| update_peer_grade (stdclass $assessment) | |
| calculate_peer_grade (array $grades) | |
Protected Attributes | |
| $workshop | |
| $dimensions = null | |
| $descriptionopts | |
| __construct | ( | workshop $ | workshop | ) |
| calculate_peer_grade | ( | array $ | grades | ) | [protected] |
Calculates the aggregated grade given by the reviewer
| array | $grades | Grade records as returned by get_current_assessment_data $this->dimensions |
Reimplemented in testable_workshop_accumulative_strategy.
Definition at line 512 of file lib.php.

| delete_dimensions | ( | array $ | ids | ) | [protected] |
| static delete_instance | ( | $ | workshopid | ) | [static] |
Delete all data related to a given workshop module instance
| int | $workshopid | id of the workshop module instance being deleted |
Implements workshop_strategy.
| form_ready | ( | ) |
Has the assessment form been defined and is ready to be used by the reviewers?
Implements 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 | The current assessment |
| bool | $editable | |
| array | $options |
Implements workshop_strategy.
Definition at line 195 of file lib.php.

| get_assessments_recordset | ( | $ | restrict = null | ) |
Implements workshop_strategy.
| get_current_assessment_data | ( | stdclass $ | assessment | ) | [protected] |
Implements workshop_strategy.
Definition at line 319 of file lib.php.

| get_edit_strategy_form | ( | $ | actionurl = null | ) |
Factory method returning an instance of an assessment form editor class
| $actionurl | URL of form handler, defaults to auto detect the current url |
Implements workshop_strategy.
Definition at line 104 of file lib.php.

| load_fields | ( | ) | [protected] |
| prepare_database_fields | ( | stdclass $ | raw | ) | [protected] |
Prepares data returned by workshop_edit_accumulative_strategy_form so they can be saved into database
It automatically adds some columns into every record. The sorting is done by the order of the returned array and starts with 1. Called internally from save_edit_strategy_form() only. Could be private but keeping protected for unit testing purposes.
| stdClass | $raw | Raw data returned by mform |
| prepare_form_fields | ( | array $ | raw | ) | [protected] |
Maps the dimension data from DB to the form fields
| array | $raw | Array of raw dimension records as returned by load_fields() |
Definition at line 403 of file lib.php.

| save_assessment | ( | stdclass $ | assessment, |
| stdclass $ | data | ||
| ) |
Saves the filled assessment
This method processes data submitted using the form returned by get_assessment_form()
| stdClass | $assessment | Assessment being filled |
| stdClass | $data | Raw data as returned by the assessment form |
Implements workshop_strategy.
| save_edit_strategy_form | ( | stdclass $ | data | ) |
Save the assessment dimensions into database
Saves data into the main strategy form table. If the record->id is null or zero, new record is created. If the record->id is not empty, the existing record is updated. Records with empty 'description' field are removed from database. The passed data object are the raw data returned by the get_data().
$DB
| stdClass | $data | Raw data returned by the dimension editor form |
Implements workshop_strategy.
Definition at line 152 of file lib.php.

| static scale_used | ( | $ | scaleid, |
| $ | workshopid = null |
||
| ) | [static] |
Is a given scale used by the instance of workshop?
| int | $scaleid | id of the scale to check |
| int | null | $workshopid | id of workshop instance to check, checks all in case of null |
Implements workshop_strategy.
| update_peer_grade | ( | stdclass $ | assessment | ) | [protected] |
Aggregates the assessment form data and sets the grade for the submission given by the peer
| stdClass | $assessment | Assessment record |
Definition at line 496 of file lib.php.

$dimensions = null [protected] |
Reimplemented in testable_workshop_accumulative_strategy.