Defines the computation login of the grading evaluation subplugin.  
 More...
|  | 
| static | delete_instance ($workshopid) | 
|  | Delete all data related to a given workshop module instance. 
 | 
|  | 
|  | 
|  | assessments_distance (stdclass $assessment, stdclass $referential, array $diminfo, stdclass $settings) | 
|  | Measures the distance of the assessment from a referential one. 
 | 
|  | 
|  | average_assessment (array $assessments) | 
|  | Given a set of a submission's assessments, returns a hypothetical average assessment. 
 | 
|  | 
|  | normalize_grades (array $assessments, array $diminfo) | 
|  | Normalizes the dimension grades to the interval 0.00000 - 100.00000. 
 | 
|  | 
|  | prepare_data_from_recordset ($assessments) | 
|  | Prepares a structure of assessments and given grades. 
 | 
|  | 
|  | process_assessments (array $assessments, array $diminfo, stdclass $settings) | 
|  | Given a list of all assessments of a single submission, updates the grading grades in database. 
 | 
|  | 
|  | weighted_variance (array $assessments) | 
|  | Given a set of a submission's assessments, returns standard deviations of all their dimensions. 
 | 
|  | 
|  | 
| the | $settings | 
|  | recently used settings in this workshop 
 | 
|  | 
| workshop | $workshop | 
|  | the parent workshop instance 
 | 
|  | 
Defines the computation login of the grading evaluation subplugin. 
◆ __construct()
      
        
          | workshop_best_evaluation::__construct | ( | workshop | $workshop | ) |  | 
      
 
Constructor. 
- Parameters
- 
  
    | workshop | $workshop | The workshop api instance |  
 
- Return values
- 
  
  
 
 
◆ assessments_distance()
  
  | 
        
          | workshop_best_evaluation::assessments_distance | ( | stdclass | $assessment, |  
          |  |  | stdclass | $referential, |  
          |  |  | array | $diminfo, |  
          |  |  | stdclass | $settings ) |  | protected | 
 
Measures the distance of the assessment from a referential one. 
The passed data structures must contain ->dimgrades property. The referential assessment is supposed to be close to the average assessment. All dimension grades are supposed to be normalized to the interval 0 - 100. Returned value is rounded to 4 valid decimals to prevent some rounding issues - see the unit test for an example.
- Parameters
- 
  
    | stdClass | $assessment | the assessment being measured |  | stdClass | $referential | assessment |  | array | $diminfo | of stdclass(->weight ->min ->max ->variance) indexed by dimension id |  | stdClass | $settings |  |  
 
- Return values
- 
  
    | float|null | rounded to 4 valid decimals |  
 
 
 
◆ average_assessment()
  
  | 
        
          | workshop_best_evaluation::average_assessment | ( | array | $assessments | ) |  |  | protected | 
 
Given a set of a submission's assessments, returns a hypothetical average assessment. 
The passed structure must be array of assessments objects with ->weight and ->dimgrades properties. Returns null if all passed assessments have zero weight as there is nothing to choose from then.
- Parameters
- 
  
  
- Return values
- 
  
  
 
 
◆ delete_instance()
  
  | 
        
          | static workshop_best_evaluation::delete_instance | ( |  | $workshopid | ) |  |  | static | 
 
 
◆ get_settings_form()
      
        
          | workshop_best_evaluation::get_settings_form | ( | moodle_url | $actionurl = null | ) |  | 
      
 
Returns an instance of the form to provide evaluation settings. 
- Return values
- 
  
  
Reimplemented from workshop_evaluation.
 
 
◆ normalize_grades()
  
  | 
        
          | workshop_best_evaluation::normalize_grades | ( | array | $assessments, |  
          |  |  | array | $diminfo ) |  | protected | 
 
Normalizes the dimension grades to the interval 0.00000 - 100.00000. 
Note: this heavily relies on PHP5 way of handling references in array of stdclasses. Hopefully it will not change again soon.
- Parameters
- 
  
    | array | $assessments | of stdclass as returned by { |  
 
- See also
- self\prepare_data_from_recordset()} 
- Parameters
- 
  
  
- Return values
- 
  
    | array | of stdclass with the same structure as $assessments |  
 
 
 
◆ prepare_data_from_recordset()
  
  | 
        
          | workshop_best_evaluation::prepare_data_from_recordset | ( |  | $assessments | ) |  |  | protected | 
 
Prepares a structure of assessments and given grades. 
- Parameters
- 
  
    | array | $assessments | batch of recordset items as returned by the grading strategy |  
 
- Return values
- 
  
  
 
 
◆ process_assessments()
  
  | 
        
          | workshop_best_evaluation::process_assessments | ( | array | $assessments, |  
          |  |  | array | $diminfo, |  
          |  |  | stdclass | $settings ) |  | protected | 
 
Given a list of all assessments of a single submission, updates the grading grades in database. 
- Parameters
- 
  
    | array | $assessments | of stdclass (->assessmentid ->assessmentweight ->reviewerid ->gradinggrade ->submissionid ->dimensionid ->grade) |  | array | $diminfo | of stdclass (->id ->weight ->max ->min) |  |  | stdClass | grading evaluation settings |  
 
- Return values
- 
  
  
 
 
◆ update_grading_grades() [1/2]
      
        
          | workshop_best_evaluation::update_grading_grades | ( | stdclass | $settings, | 
        
          |  |  |  | $restrict = null ) | 
      
 
Calculates the grades for assessment and updates 'gradinggrade' fields in 'workshop_assessments' table. 
This function relies on the grading strategy subplugin providing get_assessments_recordset() method. {
- See also
- self\process_assessments()} for the required structure of the recordset.
- Parameters
- 
  
    | stdClass | $settings | The settings for this round of evaluation |  | null | int | array | $restrict | If null, update all reviewers, otherwise update just grades for the given reviewers(s) |  
 
- Return values
- 
  
  
 
 
◆ update_grading_grades() [2/2]
  
  | 
        
          | workshop_evaluation::update_grading_grades | ( | stdClass | $settings, |  
          |  |  |  | $restrict = null ) |  | abstractinherited | 
 
Calculates grades for assessment and updates 'gradinggrade' fields in 'workshop_assessments' table. 
- Parameters
- 
  
    | stdClass | $settings | settings for this round of evaluation |  | null | int | array | $restrict | if null, update all reviewers, otherwise update just grades for the given reviewers(s) |  
 
 
 
◆ weighted_variance()
  
  | 
        
          | workshop_best_evaluation::weighted_variance | ( | array | $assessments | ) |  |  | protected | 
 
Given a set of a submission's assessments, returns standard deviations of all their dimensions. 
The passed structure must be array of assessments objects with at least ->weight and ->dimgrades properties. This implementation uses weighted incremental algorithm as suggested in "D. H. D. West (1979). Communications of the ACM, 22, 9, 532-535:
Updating Mean and Variance Estimates: An Improved Method" 
- Parameters
- 
  
  
- Return values
- 
  
    | null|array | indexed by dimension id |  
 
 
 
The documentation for this class was generated from the following file: