Moodle  2.2.1
http://www.collinsharper.com
workshop_rubric_strategy Class Reference
Inheritance diagram for workshop_rubric_strategy:
Collaboration diagram for workshop_rubric_strategy:

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 ()
 load_config ()
 prepare_form_fields (array $fields)
 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
 $definitionopts
 $config

Detailed Description

Rubric grading strategy logic.

Definition at line 70 of file lib.php.


Constructor & Destructor Documentation

__construct ( workshop workshop)

Constructor

Parameters:
workshop$workshopThe workshop instance record
Returns:
void

Definition at line 99 of file lib.php.

Here is the call graph for this function:


Member Function Documentation

calculate_peer_grade ( array grades) [protected]

Calculates the aggregated grade given by the reviewer

Parameters:
array$gradesGrade records as returned by get_current_assessment_data $this->dimensions
Returns:
float|null Raw grade (from 0.00000 to 100.00000) for submission as suggested by the peer

Reimplemented in testable_workshop_rubric_strategy.

Definition at line 595 of file lib.php.

Here is the call graph for this function:

delete_dimensions ( array ids) [protected]

Deletes dimensions and removes embedded media from its descriptions

todo we may check that there are no assessments done using these dimensions and probably remove them

Parameters:
array$masterids
Returns:
void

Definition at line 500 of file lib.php.

Here is the call graph for this function:

static delete_instance ( workshopid) [static]

Delete all data related to a given workshop module instance

See also:
workshop_delete_instance()
Parameters:
int$workshopidid of the workshop module instance being deleted
Returns:
void

Implements workshop_strategy.

Definition at line 400 of file lib.php.

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

Returns:
boolean

Implements workshop_strategy.

Definition at line 327 of file lib.php.

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/readonly
stdClass$assessmentThe current assessment
bool$editable
array$options

Implements workshop_strategy.

Definition at line 236 of file lib.php.

Here is the call graph for this function:

get_assessments_recordset ( restrict = null)
See also:
parent::get_assessments_recordset()

Implements workshop_strategy.

Definition at line 337 of file lib.php.

get_current_assessment_data ( stdclass $  assessment) [protected]

Returns the list of current grades filled by the reviewer indexed by dimensionid

Parameters:
stdClass$assessmentAssessment record
Returns:
array [int dimensionid] => stdclass workshop_grades record

Definition at line 556 of file lib.php.

See also:
parent::get_dimensions_info()

Implements workshop_strategy.

Definition at line 367 of file lib.php.

get_edit_strategy_form ( actionurl = null)

Factory method returning an instance of an assessment form editor class

Parameters:
$actionurlURL of form handler, defaults to auto detect the current url

Implements workshop_strategy.

Definition at line 113 of file lib.php.

Here is the call graph for this function:

load_config ( ) [protected]

Get the configuration for the current rubric strategy

Returns:
object

Definition at line 455 of file lib.php.

Here is the caller graph for this function:

load_fields ( ) [protected]

Loads the fields of the assessment form currently used in this workshop

Returns:
array definition of assessment dimensions

Definition at line 418 of file lib.php.

Here is the caller graph for this function:

prepare_database_fields ( stdclass $  raw) [protected]

Prepares data returned by workshop_edit_rubric_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.

Parameters:
stdClass$rawRaw data returned by mform
Returns:
array Array of objects to be inserted/updated in DB

Definition at line 523 of file lib.php.

prepare_form_fields ( array fields) [protected]

Maps the dimension data from DB to the form fields

Parameters:
array$fieldsArray of dimensions definition as returned by load_fields()
Returns:
stdclass of fields data to be used by the mform set_data

Definition at line 470 of file lib.php.

Here is the caller graph for this function:

save_assessment ( stdclass $  assessment,
stdclass $  data 
)

Saves the filled assessment

This method processes data submitted using the form returned by get_assessment_form()

Parameters:
stdClass$assessmentAssessment being filled
stdClass$dataRaw data as returned by the assessment form
Returns:
float|null Raw grade (0.00000 to 100.00000) for submission as suggested by the peer

Implements workshop_strategy.

Definition at line 299 of file lib.php.

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

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

Implements workshop_strategy.

Definition at line 162 of file lib.php.

Here is the call graph for this function:

static scale_used ( scaleid,
workshopid = null 
) [static]

Is a given scale used by the instance of workshop?

This grading strategy does not use scales.

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

Implements workshop_strategy.

Definition at line 389 of file lib.php.

update_peer_grade ( stdclass $  assessment) [protected]

Aggregates the assessment form data and sets the grade for the submission given by the peer

Parameters:
stdClass$assessmentAssessment record
Returns:
float|null Raw grade (from 0.00000 to 100.00000) for submission as suggested by the peer

Definition at line 579 of file lib.php.

Here is the call graph for this function:


Field Documentation

$config [protected]

Definition at line 91 of file lib.php.

$definitionopts [protected]

Definition at line 88 of file lib.php.

$descriptionopts [protected]

Definition at line 85 of file lib.php.

$dimensions = null [protected]

Reimplemented in testable_workshop_rubric_strategy.

Definition at line 82 of file lib.php.

$workshop [protected]

Definition at line 79 of file lib.php.

const ADDDIMS = 2

number of dimensions to add

Definition at line 76 of file lib.php.

const MINDIMS = 3

default number of dimensions to show

Definition at line 73 of file lib.php.


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