Moodle PHP Documentation 4.3
Moodle 4.3.5 (Build: 20240610) (7dcfaa79f78)
workshop_assessment_base Class Reference

Common base class for assessments rendering. More...

Inheritance diagram for workshop_assessment_base:
workshop_assessment workshop_example_assessment workshop_example_reference_assessment

Public Member Functions

 __construct (workshop $workshop, stdClass $record, array $options=array())
 Copies the properties of the given database record into properties of $this instance.
 
 add_action (moodle_url $url, $label, $method='get')
 Adds a new action.
 

Public Attributes

array $actions = array()
 of actions
 
stdClass null $author = null
 assessed submission's author user info
 
workshop_assessment_form $form
 $form as returned by workshop_strategy::get_assessment_form()
 
float $maxgrade
 the real maximum grade
 
float null $realgrade = null
 the real received grade
 
stdClass null $reviewer = null
 reviewer user info
 
string $title = ''
 the optional title of the assessment
 
moodle_url $url
 
workshop $workshop
 

Protected Member Functions

 validate_raw_record (stdClass $record)
 Makes sure that we can cook the renderable component from the passed raw database record.
 

Protected Attributes

array $fields = array()
 

Detailed Description

Common base class for assessments rendering.

Subclasses of this class convert raw assessment record from workshop_assessments table (as returned by {

See also
workshop\get_assessment_by_id()} for example) into renderable objects.

Constructor & Destructor Documentation

◆ __construct()

workshop_assessment_base::__construct ( workshop $workshop,
stdClass $record,
array $options = array() )

Copies the properties of the given database record into properties of $this instance.

The $options keys are: showreviewer, showauthor

Parameters
workshop$workshop
stdClass$assessmentfull record
array$optionsadditional properties

Member Function Documentation

◆ add_action()

workshop_assessment_base::add_action ( moodle_url $url,
$label,
$method = 'get' )

Adds a new action.

Parameters
moodle_url$urlaction URL
string$labelaction label
string$methodget|post

◆ validate_raw_record()

workshop_assessment_base::validate_raw_record ( stdClass $record)
protected

Makes sure that we can cook the renderable component from the passed raw database record.

Parameters
stdClass$assessmentfull assessment record
Exceptions
coding_exceptionif the caller passed unexpected data

Reimplemented in workshop_example_assessment, and workshop_example_reference_assessment.


The documentation for this class was generated from the following file: