mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 17:36:38 +02:00
fixed a few spelling problems and standardised stdClass
This commit is contained in:
parent
1c5765dd7a
commit
5924db724d
28 changed files with 151 additions and 151 deletions
|
@ -89,7 +89,7 @@ function workshopform_accumulative_upgrade_legacy() {
|
|||
/**
|
||||
* Transforms a given record from workshop_elements_old into an object to be saved into workshopform_accumulative
|
||||
*
|
||||
* @param stdclass $old legacy record from workshop_elements_old
|
||||
* @param stdClass $old legacy record from workshop_elements_old
|
||||
* @param array $newscaleids mapping from old scale types into new standard ones
|
||||
* @param int $newworkshopid id of the new workshop instance that replaced the previous one
|
||||
* @return stdclass to be saved in workshopform_accumulative
|
||||
|
@ -132,9 +132,9 @@ function workshopform_accumulative_upgrade_element(stdclass $old, array $newscal
|
|||
/**
|
||||
* Transforms given grade record
|
||||
*
|
||||
* @param stdclass $old
|
||||
* @param stdClass $old
|
||||
* @param int $newassessmentid
|
||||
* @param stdclass $newdimensioninfo
|
||||
* @param stdClass $newdimensioninfo
|
||||
* @return stdclass
|
||||
*/
|
||||
function workshopform_accumulative_upgrade_grade(stdclass $old, $newassessmentid, stdclass $newdimensioninfo) {
|
||||
|
|
|
@ -142,7 +142,7 @@ class workshop_accumulative_strategy implements workshop_strategy {
|
|||
* The passed data object are the raw data returned by the get_data().
|
||||
*
|
||||
* @uses $DB
|
||||
* @param stdclass $data Raw data returned by the dimension editor form
|
||||
* @param stdClass $data Raw data returned by the dimension editor form
|
||||
* @return void
|
||||
*/
|
||||
public function save_edit_strategy_form(stdclass $data) {
|
||||
|
@ -184,7 +184,7 @@ class workshop_accumulative_strategy implements workshop_strategy {
|
|||
*
|
||||
* @param moodle_url $actionurl URL of form handler, defaults to auto detect the current url
|
||||
* @param string $mode Mode to open the form in: preview/assessment
|
||||
* @param stdclass $assessment The current assessment
|
||||
* @param stdClass $assessment The current assessment
|
||||
* @param bool $editable
|
||||
* @param array $options
|
||||
*/
|
||||
|
@ -237,8 +237,8 @@ class workshop_accumulative_strategy implements workshop_strategy {
|
|||
*
|
||||
* This method processes data submitted using the form returned by {@link get_assessment_form()}
|
||||
*
|
||||
* @param stdclass $assessment Assessment being filled
|
||||
* @param stdclass $data Raw data as returned by the assessment form
|
||||
* @param stdClass $assessment Assessment being filled
|
||||
* @param stdClass $data Raw data as returned by the assessment form
|
||||
* @return float|null Raw grade (0.00000 to 100.00000) for submission as suggested by the peer
|
||||
*/
|
||||
public function save_assessment(stdclass $assessment, stdclass $data) {
|
||||
|
@ -439,7 +439,7 @@ class workshop_accumulative_strategy implements workshop_strategy {
|
|||
* Called internally from {@link save_edit_strategy_form()} only. Could be private but
|
||||
* keeping protected for unit testing purposes.
|
||||
*
|
||||
* @param stdclass $raw Raw data returned by mform
|
||||
* @param stdClass $raw Raw data returned by mform
|
||||
* @return array Array of objects to be inserted/updated in DB
|
||||
*/
|
||||
protected function prepare_database_fields(stdclass $raw) {
|
||||
|
@ -463,7 +463,7 @@ class workshop_accumulative_strategy implements workshop_strategy {
|
|||
/**
|
||||
* Returns the list of current grades filled by the reviewer indexed by dimensionid
|
||||
*
|
||||
* @param stdclass $assessment Assessment record
|
||||
* @param stdClass $assessment Assessment record
|
||||
* @return array [int dimensionid] => stdclass workshop_grades record
|
||||
*/
|
||||
protected function get_current_assessment_data(stdclass $assessment) {
|
||||
|
@ -486,7 +486,7 @@ class workshop_accumulative_strategy implements workshop_strategy {
|
|||
/**
|
||||
* Aggregates the assessment form data and sets the grade for the submission given by the peer
|
||||
*
|
||||
* @param stdclass $assessment Assessment record
|
||||
* @param stdClass $assessment Assessment record
|
||||
* @return float|null Raw grade (from 0.00000 to 100.00000) for submission as suggested by the peer
|
||||
*/
|
||||
protected function update_peer_grade(stdclass $assessment) {
|
||||
|
|
|
@ -87,7 +87,7 @@ class workshop_accumulative_strategy_test extends UnitTestCase {
|
|||
// fixture set-up
|
||||
$this->strategy->dimensions = array();
|
||||
$grades = array();
|
||||
// excercise SUT
|
||||
// exercise SUT
|
||||
$suggested = $this->strategy->calculate_peer_grade($grades);
|
||||
// validate
|
||||
$this->assertNull($suggested);
|
||||
|
@ -97,7 +97,7 @@ class workshop_accumulative_strategy_test extends UnitTestCase {
|
|||
// fixture set-up
|
||||
$this->strategy->dimensions[1003] = (object)array('grade' => '20', 'weight' => '1');
|
||||
$grades[] = (object)array('dimensionid' => 1003, 'grade' => '5.00000');
|
||||
// excercise SUT
|
||||
// exercise SUT
|
||||
$suggested = $this->strategy->calculate_peer_grade($grades);
|
||||
// validate
|
||||
$this->assertEqual(grade_floatval(5/20 * 100), $suggested);
|
||||
|
@ -108,7 +108,7 @@ class workshop_accumulative_strategy_test extends UnitTestCase {
|
|||
$this->strategy->dimensions[1003] = (object)array('grade' => '20', 'weight' => '-1');
|
||||
$grades[] = (object)array('dimensionid' => 1003, 'grade' => '20');
|
||||
$this->expectException('coding_exception');
|
||||
// excercise SUT
|
||||
// exercise SUT
|
||||
$suggested = $this->strategy->calculate_peer_grade($grades);
|
||||
}
|
||||
|
||||
|
@ -116,7 +116,7 @@ class workshop_accumulative_strategy_test extends UnitTestCase {
|
|||
// fixture set-up
|
||||
$this->strategy->dimensions[1003] = (object)array('grade' => '20', 'weight' => '3');
|
||||
$grades[] = (object)array('dimensionid' => '1003', 'grade' => '5');
|
||||
// excercise SUT
|
||||
// exercise SUT
|
||||
$suggested = $this->strategy->calculate_peer_grade($grades);
|
||||
// validate
|
||||
$this->assertEqual(grade_floatval(5/20 * 100), $suggested);
|
||||
|
@ -132,7 +132,7 @@ class workshop_accumulative_strategy_test extends UnitTestCase {
|
|||
$grades[] = (object)array('dimensionid' => 1004, 'grade' => '87.00000');
|
||||
$grades[] = (object)array('dimensionid' => 1005, 'grade' => '10.00000');
|
||||
|
||||
// excercise SUT
|
||||
// exercise SUT
|
||||
$suggested = $this->strategy->calculate_peer_grade($grades);
|
||||
|
||||
// validate
|
||||
|
@ -149,7 +149,7 @@ class workshop_accumulative_strategy_test extends UnitTestCase {
|
|||
$grades[] = (object)array('dimensionid' => 1004, 'grade' => '66.00000');
|
||||
$grades[] = (object)array('dimensionid' => 1005, 'grade' => '4.00000');
|
||||
|
||||
// excercise SUT
|
||||
// exercise SUT
|
||||
$suggested = $this->strategy->calculate_peer_grade($grades);
|
||||
|
||||
// validate
|
||||
|
@ -166,7 +166,7 @@ class workshop_accumulative_strategy_test extends UnitTestCase {
|
|||
$DB->expectOnce('get_field', array('scale', 'scale', array('id' => 10), MUST_EXIST));
|
||||
$DB->setReturnValue('get_field', $mockscale);
|
||||
|
||||
// excercise SUT
|
||||
// exercise SUT
|
||||
$suggested = $this->strategy->calculate_peer_grade($grades);
|
||||
|
||||
// validate
|
||||
|
@ -181,7 +181,7 @@ class workshop_accumulative_strategy_test extends UnitTestCase {
|
|||
$grades[] = (object)array('dimensionid' => 1008, 'grade' => '1.00000');
|
||||
$DB->expectNever('get_field', array('scale', 'scale', array('id' => 10), MUST_EXIST)); // cached
|
||||
|
||||
// excercise SUT
|
||||
// exercise SUT
|
||||
$suggested = $this->strategy->calculate_peer_grade($grades);
|
||||
|
||||
// validate
|
||||
|
@ -207,7 +207,7 @@ class workshop_accumulative_strategy_test extends UnitTestCase {
|
|||
$DB->expectAt(1, 'get_field', array('scale', 'scale', array('id' => 17), MUST_EXIST));
|
||||
$DB->setReturnValueAt(1, 'get_field', $mockscale17);
|
||||
|
||||
// excercise SUT
|
||||
// exercise SUT
|
||||
$suggested = $this->strategy->calculate_peer_grade($grades);
|
||||
|
||||
// validate
|
||||
|
@ -224,7 +224,7 @@ class workshop_accumulative_strategy_test extends UnitTestCase {
|
|||
$grades[] = (object)array('dimensionid' => 1012, 'grade' => '4.00000'); // exceeds the number of scale items
|
||||
$this->expectException('coding_exception');
|
||||
|
||||
// excercise SUT
|
||||
// exercise SUT
|
||||
$suggested = $this->strategy->calculate_peer_grade($grades);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -87,7 +87,7 @@ class workshop_assessment_form extends moodleform {
|
|||
/**
|
||||
* Add any strategy specific form fields.
|
||||
*
|
||||
* @param stdclass $mform the form being built.
|
||||
* @param stdClass $mform the form being built.
|
||||
*/
|
||||
protected function definition_inner(&$mform) {
|
||||
// By default, do nothing.
|
||||
|
|
|
@ -86,7 +86,7 @@ function workshopform_comments_upgrade_legacy() {
|
|||
/**
|
||||
* Transforms a given record from workshop_elements_old into an object to be saved into workshopform_comments
|
||||
*
|
||||
* @param stdclass $old legacy record from workshop_elements_old
|
||||
* @param stdClass $old legacy record from workshop_elements_old
|
||||
* @param int $newworkshopid id of the new workshop instance that replaced the previous one
|
||||
* @return stdclass to be saved in workshopform_comments
|
||||
*/
|
||||
|
@ -102,9 +102,9 @@ function workshopform_comments_upgrade_element(stdclass $old, $newworkshopid) {
|
|||
/**
|
||||
* Transforms given grade record
|
||||
*
|
||||
* @param stdclass $old
|
||||
* @param stdClass $old
|
||||
* @param int $newassessmentid
|
||||
* @param stdclass $newdimensioninfo
|
||||
* @param stdClass $newdimensioninfo
|
||||
* @return stdclass
|
||||
*/
|
||||
function workshopform_comments_upgrade_grade(stdclass $old, $newassessmentid, stdclass $newdimensioninfo) {
|
||||
|
|
|
@ -115,7 +115,7 @@ class workshop_comments_strategy implements workshop_strategy {
|
|||
$norepeats += self::ADDDIMS;
|
||||
}
|
||||
|
||||
// prepare the embeded files
|
||||
// prepare the embedded files
|
||||
for ($i = 0; $i < $nodimensions; $i++) {
|
||||
// prepare all editor elements
|
||||
$fields = file_prepare_standard_editor($fields, 'description__idx_'.$i, $this->descriptionopts,
|
||||
|
@ -142,7 +142,7 @@ class workshop_comments_strategy implements workshop_strategy {
|
|||
* The passed data object are the raw data returned by the get_data().
|
||||
*
|
||||
* @uses $DB
|
||||
* @param stdclass $data Raw data returned by the dimension editor form
|
||||
* @param stdClass $data Raw data returned by the dimension editor form
|
||||
* @return void
|
||||
*/
|
||||
public function save_edit_strategy_form(stdclass $data) {
|
||||
|
@ -171,7 +171,7 @@ class workshop_comments_strategy implements workshop_strategy {
|
|||
// exiting field
|
||||
$DB->update_record('workshopform_comments', $record);
|
||||
}
|
||||
// re-save with correct path to embeded media files
|
||||
// re-save with correct path to embedded media files
|
||||
$record = file_postupdate_standard_editor($record, 'description', $this->descriptionopts,
|
||||
$PAGE->context, 'workshopform_comments', 'description', $record->id);
|
||||
$DB->update_record('workshopform_comments', $record);
|
||||
|
@ -184,7 +184,7 @@ class workshop_comments_strategy implements workshop_strategy {
|
|||
*
|
||||
* @param moodle_url $actionurl URL of form handler, defaults to auto detect the current url
|
||||
* @param string $mode Mode to open the form in: preview/assessment
|
||||
* @param stdclass $assessment The current assessment
|
||||
* @param stdClass $assessment The current assessment
|
||||
* @param bool $editable
|
||||
* @param array $options
|
||||
*/
|
||||
|
@ -197,7 +197,7 @@ class workshop_comments_strategy implements workshop_strategy {
|
|||
$fields = $this->prepare_form_fields($this->dimensions);
|
||||
$nodimensions = count($this->dimensions);
|
||||
|
||||
// rewrite URLs to the embeded files
|
||||
// rewrite URLs to the embedded files
|
||||
for ($i = 0; $i < $nodimensions; $i++) {
|
||||
$fields->{'description__idx_'.$i} = file_rewrite_pluginfile_urls($fields->{'description__idx_'.$i},
|
||||
'pluginfile.php', $PAGE->context->id, 'workshopform_comments', 'description', $fields->{'dimensionid__idx_'.$i});
|
||||
|
@ -236,8 +236,8 @@ class workshop_comments_strategy implements workshop_strategy {
|
|||
*
|
||||
* This method processes data submitted using the form returned by {@link get_assessment_form()}
|
||||
*
|
||||
* @param stdclass $assessment Assessment being filled
|
||||
* @param stdclass $data Raw data as returned by the assessment form
|
||||
* @param stdClass $assessment Assessment being filled
|
||||
* @param stdClass $data Raw data as returned by the assessment form
|
||||
* @return float|null Constant raw grade 100.00000 for submission as suggested by the peer
|
||||
*/
|
||||
public function save_assessment(stdclass $assessment, stdclass $data) {
|
||||
|
@ -415,7 +415,7 @@ class workshop_comments_strategy implements workshop_strategy {
|
|||
* Called internally from {@link save_edit_strategy_form()} only. Could be private but
|
||||
* keeping protected for unit testing purposes.
|
||||
*
|
||||
* @param stdclass $raw Raw data returned by mform
|
||||
* @param stdClass $raw Raw data returned by mform
|
||||
* @return array Array of objects to be inserted/updated in DB
|
||||
*/
|
||||
protected function prepare_database_fields(stdclass $raw) {
|
||||
|
@ -437,7 +437,7 @@ class workshop_comments_strategy implements workshop_strategy {
|
|||
/**
|
||||
* Returns the list of current grades filled by the reviewer indexed by dimensionid
|
||||
*
|
||||
* @param stdclass $assessment Assessment record
|
||||
* @param stdClass $assessment Assessment record
|
||||
* @return array [int dimensionid] => stdclass workshop_grades record
|
||||
*/
|
||||
protected function get_current_assessment_data(stdclass $assessment) {
|
||||
|
|
|
@ -84,7 +84,7 @@ class workshop_edit_strategy_form extends moodleform {
|
|||
/**
|
||||
* Add any strategy specific form fields.
|
||||
*
|
||||
* @param stdclass $mform the form being built.
|
||||
* @param stdClass $mform the form being built.
|
||||
*/
|
||||
protected function definition_inner(&$mform) {
|
||||
// By default, do nothing.
|
||||
|
|
|
@ -45,7 +45,7 @@ interface workshop_strategy {
|
|||
* to be evaluated. Each dimension consists of a set of form fields. Strategy-specific information
|
||||
* are saved in workshopform_{strategyname} tables.
|
||||
*
|
||||
* @param stdclass $data Raw data as returned by the form editor
|
||||
* @param stdClass $data Raw data as returned by the form editor
|
||||
* @return void
|
||||
*/
|
||||
public function save_edit_strategy_form(stdclass $data);
|
||||
|
@ -55,7 +55,7 @@ interface workshop_strategy {
|
|||
*
|
||||
* @param moodle_url $actionurl URL of form handler, defaults to auto detect the current url
|
||||
* @param string $mode Mode to open the form in: preview|assessment
|
||||
* @param stdclass $assessment If opening in the assessment mode, the current assessment record
|
||||
* @param stdClass $assessment If opening in the assessment mode, the current assessment record
|
||||
* @param bool $editable Shall the form be opened as editable (true) or read-only (false)
|
||||
* @param array $options More assessment form options, editableweight implemented only now
|
||||
*/
|
||||
|
@ -68,8 +68,8 @@ interface workshop_strategy {
|
|||
* The returned grade should be rounded to 5 decimals as with round($grade, 5).
|
||||
*
|
||||
* @see grade_floatval()
|
||||
* @param stdclass $assessment Assessment being filled
|
||||
* @param stdclass $data Raw data as returned by the assessment form
|
||||
* @param stdClass $assessment Assessment being filled
|
||||
* @param stdClass $data Raw data as returned by the assessment form
|
||||
* @return float|null Raw percentual grade (0.00000 to 100.00000) for submission
|
||||
* as suggested by the peer or null if impossible to count
|
||||
*/
|
||||
|
|
|
@ -116,7 +116,7 @@ function workshopform_numerrors_upgrade_legacy() {
|
|||
/**
|
||||
* Transforms a given record from workshop_elements_old into an object to be saved into workshopform_numerrors
|
||||
*
|
||||
* @param stdclass $old legacy record from workshop_elements_old
|
||||
* @param stdClass $old legacy record from workshop_elements_old
|
||||
* @param int $newworkshopid id of the new workshop instance that replaced the previous one
|
||||
* @return stdclass to be saved in workshopform_numerrors
|
||||
*/
|
||||
|
@ -148,9 +148,9 @@ function workshopform_numerrors_upgrade_element(stdclass $old, $newworkshopid) {
|
|||
/**
|
||||
* Transforms given grade record
|
||||
*
|
||||
* @param stdclass $old
|
||||
* @param stdClass $old
|
||||
* @param int $newassessmentid
|
||||
* @param stdclass $newdimensioninfo
|
||||
* @param stdClass $newdimensioninfo
|
||||
* @return stdclass
|
||||
*/
|
||||
function workshopform_numerrors_upgrade_grade(stdclass $old, $newassessmentid, stdclass $newdimensioninfo) {
|
||||
|
|
|
@ -147,7 +147,7 @@ class workshop_numerrors_strategy implements workshop_strategy {
|
|||
* The passed data object are the raw data returned by the get_data().
|
||||
*
|
||||
* @uses $DB
|
||||
* @param stdclass $data Raw data returned by the dimension editor form
|
||||
* @param stdClass $data Raw data returned by the dimension editor form
|
||||
* @return void
|
||||
*/
|
||||
public function save_edit_strategy_form(stdclass $data) {
|
||||
|
@ -219,7 +219,7 @@ class workshop_numerrors_strategy implements workshop_strategy {
|
|||
*
|
||||
* @param moodle_url $actionurl URL of form handler, defaults to auto detect the current url
|
||||
* @param string $mode Mode to open the form in: preview/assessment
|
||||
* @param stdclass $assessment
|
||||
* @param stdClass $assessment
|
||||
* @param bool $editable
|
||||
* @param array $options
|
||||
*/
|
||||
|
@ -272,8 +272,8 @@ class workshop_numerrors_strategy implements workshop_strategy {
|
|||
*
|
||||
* This method processes data submitted using the form returned by {@link get_assessment_form()}
|
||||
*
|
||||
* @param stdclass $assessment Assessment being filled
|
||||
* @param stdclass $data Raw data as returned by the assessment form
|
||||
* @param stdClass $assessment Assessment being filled
|
||||
* @param stdClass $data Raw data as returned by the assessment form
|
||||
* @return float|null Raw grade (from 0.00000 to 100.00000) for submission as suggested by the peer
|
||||
*/
|
||||
public function save_assessment(stdclass $assessment, stdclass $data) {
|
||||
|
@ -473,7 +473,7 @@ class workshop_numerrors_strategy implements workshop_strategy {
|
|||
* Called internally from {@link save_edit_strategy_form()} only. Could be private but
|
||||
* keeping protected for unit testing purposes.
|
||||
*
|
||||
* @param stdclass $raw Raw data returned by mform
|
||||
* @param stdClass $raw Raw data returned by mform
|
||||
* @return array Array of objects to be inserted/updated in DB
|
||||
*/
|
||||
protected function prepare_database_fields(stdclass $raw) {
|
||||
|
@ -510,7 +510,7 @@ class workshop_numerrors_strategy implements workshop_strategy {
|
|||
/**
|
||||
* Returns the list of current grades filled by the reviewer
|
||||
*
|
||||
* @param stdclass $assessment Assessment record
|
||||
* @param stdClass $assessment Assessment record
|
||||
* @return array of filtered records from the table workshop_grades
|
||||
*/
|
||||
protected function get_current_assessment_data(stdclass $assessment) {
|
||||
|
@ -533,7 +533,7 @@ class workshop_numerrors_strategy implements workshop_strategy {
|
|||
/**
|
||||
* Aggregates the assessment form data and sets the grade for the submission given by the peer
|
||||
*
|
||||
* @param stdclass $assessment Assessment record
|
||||
* @param stdClass $assessment Assessment record
|
||||
* @return float|null Raw grade (0.00000 to 100.00000) for submission as suggested by the peer
|
||||
*/
|
||||
protected function update_peer_grade(stdclass $assessment) {
|
||||
|
|
|
@ -91,7 +91,7 @@ class workshop_numerrors_strategy_test extends UnitTestCase {
|
|||
$this->strategy->dimensions = array();
|
||||
$this->strategy->mappings = array();
|
||||
$grades = array();
|
||||
// excercise SUT
|
||||
// exercise SUT
|
||||
$suggested = $this->strategy->calculate_peer_grade($grades);
|
||||
// validate
|
||||
$this->assertNull($suggested);
|
||||
|
@ -108,7 +108,7 @@ class workshop_numerrors_strategy_test extends UnitTestCase {
|
|||
$grades[] = (object)array('dimensionid' => 108, 'grade' => '1.00000');
|
||||
$grades[] = (object)array('dimensionid' => 111, 'grade' => '1.00000');
|
||||
$grades[] = (object)array('dimensionid' => 109, 'grade' => '1.00000');
|
||||
// excercise SUT
|
||||
// exercise SUT
|
||||
$suggested = $this->strategy->calculate_peer_grade($grades);
|
||||
// validate
|
||||
$this->assertEqual($suggested, 100.00000);
|
||||
|
@ -131,7 +131,7 @@ class workshop_numerrors_strategy_test extends UnitTestCase {
|
|||
$grades[] = (object)array('dimensionid' => 111, 'grade' => '0.00000');
|
||||
$grades[] = (object)array('dimensionid' => 109, 'grade' => '1.00000');
|
||||
|
||||
// excercise SUT
|
||||
// exercise SUT
|
||||
$suggested = $this->strategy->calculate_peer_grade($grades);
|
||||
// validate
|
||||
$this->assertEqual($suggested, 80.00000);
|
||||
|
@ -155,7 +155,7 @@ class workshop_numerrors_strategy_test extends UnitTestCase {
|
|||
$grades[] = (object)array('dimensionid' => 111, 'grade' => '0.00000');
|
||||
$grades[] = (object)array('dimensionid' => 109, 'grade' => '0.00000');
|
||||
|
||||
// excercise SUT
|
||||
// exercise SUT
|
||||
$suggested = $this->strategy->calculate_peer_grade($grades);
|
||||
// validate
|
||||
$this->assertEqual($suggested, 10.00000);
|
||||
|
@ -179,7 +179,7 @@ class workshop_numerrors_strategy_test extends UnitTestCase {
|
|||
$grades[] = (object)array('dimensionid' => 111, 'grade' => '0.00000');
|
||||
$grades[] = (object)array('dimensionid' => 109, 'grade' => '0.00000');
|
||||
|
||||
// excercise SUT
|
||||
// exercise SUT
|
||||
$suggested = $this->strategy->calculate_peer_grade($grades);
|
||||
// validate
|
||||
$this->assertEqual($suggested, 0.00000);
|
||||
|
@ -203,7 +203,7 @@ class workshop_numerrors_strategy_test extends UnitTestCase {
|
|||
$grades[] = (object)array('dimensionid' => 111, 'grade' => '1.00000');
|
||||
$grades[] = (object)array('dimensionid' => 109, 'grade' => '0.00000');
|
||||
|
||||
// excercise SUT
|
||||
// exercise SUT
|
||||
$suggested = $this->strategy->calculate_peer_grade($grades);
|
||||
// validate
|
||||
$this->assertEqual($suggested, 33.00000);
|
||||
|
@ -227,7 +227,7 @@ class workshop_numerrors_strategy_test extends UnitTestCase {
|
|||
$grades[] = (object)array('dimensionid' => 111, 'grade' => '0.00000');
|
||||
$grades[] = (object)array('dimensionid' => 109, 'grade' => '1.00000');
|
||||
|
||||
// excercise SUT
|
||||
// exercise SUT
|
||||
$suggested = $this->strategy->calculate_peer_grade($grades);
|
||||
// validate
|
||||
$this->assertEqual($suggested, 100.00000);
|
||||
|
@ -255,7 +255,7 @@ class workshop_numerrors_strategy_test extends UnitTestCase {
|
|||
$grades[] = (object)array('dimensionid' => 111, 'grade' => '0.00000');
|
||||
$grades[] = (object)array('dimensionid' => 109, 'grade' => '0.00000');
|
||||
|
||||
// excercise SUT
|
||||
// exercise SUT
|
||||
$suggested = $this->strategy->calculate_peer_grade($grades);
|
||||
// validate
|
||||
$this->assertEqual($suggested, 5.00000);
|
||||
|
|
|
@ -87,7 +87,7 @@ class backup_workshopform_rubric_subplugin extends backup_subplugin {
|
|||
/**
|
||||
* Returns the structure of dimension grades
|
||||
*
|
||||
* @param string forst parameter of {@link backup_nested_element} constructor
|
||||
* @param string first parameter of {@link backup_nested_element} constructor
|
||||
*/
|
||||
private function dimension_grades_structure($elementname) {
|
||||
|
||||
|
|
|
@ -229,7 +229,7 @@ function workshopform_rubric_upgrade_legacy_rubric() {
|
|||
*
|
||||
* This is used during Criterion 1.9 -> Rubric 2.0 conversion
|
||||
*
|
||||
* @param stdclass $old legacy record from workshop_elements_old
|
||||
* @param stdClass $old legacy record from workshop_elements_old
|
||||
* @param int $newdimensionid id of the new workshopform_rubric dimension record to be linked to
|
||||
* @return stdclass to be saved in workshopform_rubric_levels
|
||||
*/
|
||||
|
@ -247,7 +247,7 @@ function workshopform_rubric_upgrade_criterion_level(stdclass $old, $newdimensio
|
|||
*
|
||||
* This is used during Rubric 1.9 -> Rubric 2.0 conversion
|
||||
*
|
||||
* @param stdclass $old legacy record from joined workshop_elements_old + workshop_rubrics_old
|
||||
* @param stdClass $old legacy record from joined workshop_elements_old + workshop_rubrics_old
|
||||
* @param int $newdimensionid id of the new workshopform_rubric dimension record to be linked to
|
||||
* @return stdclass to be saved in workshopform_rubric_levels
|
||||
*/
|
||||
|
|
|
@ -152,7 +152,7 @@ class workshop_rubric_strategy implements workshop_strategy {
|
|||
* The passed data object are the raw data returned by the get_data().
|
||||
*
|
||||
* @uses $DB
|
||||
* @param stdclass $data Raw data returned by the dimension editor form
|
||||
* @param stdClass $data Raw data returned by the dimension editor form
|
||||
* @return void
|
||||
*/
|
||||
public function save_edit_strategy_form(stdclass $data) {
|
||||
|
@ -225,7 +225,7 @@ class workshop_rubric_strategy implements workshop_strategy {
|
|||
*
|
||||
* @param moodle_url $actionurl URL of form handler, defaults to auto detect the current url
|
||||
* @param string $mode Mode to open the form in: preview/assessment/readonly
|
||||
* @param stdclass $assessment The current assessment
|
||||
* @param stdClass $assessment The current assessment
|
||||
* @param bool $editable
|
||||
* @param array $options
|
||||
*/
|
||||
|
@ -288,8 +288,8 @@ class workshop_rubric_strategy implements workshop_strategy {
|
|||
*
|
||||
* This method processes data submitted using the form returned by {@link get_assessment_form()}
|
||||
*
|
||||
* @param stdclass $assessment Assessment being filled
|
||||
* @param stdclass $data Raw data as returned by the assessment form
|
||||
* @param stdClass $assessment Assessment being filled
|
||||
* @param stdClass $data Raw data as returned by the assessment form
|
||||
* @return float|null Raw grade (0.00000 to 100.00000) for submission as suggested by the peer
|
||||
*/
|
||||
public function save_assessment(stdclass $assessment, stdclass $data) {
|
||||
|
@ -513,7 +513,7 @@ class workshop_rubric_strategy implements workshop_strategy {
|
|||
* Called internally from {@link save_edit_strategy_form()} only. Could be private but
|
||||
* keeping protected for unit testing purposes.
|
||||
*
|
||||
* @param stdclass $raw Raw data returned by mform
|
||||
* @param stdClass $raw Raw data returned by mform
|
||||
* @return array Array of objects to be inserted/updated in DB
|
||||
*/
|
||||
protected function prepare_database_fields(stdclass $raw) {
|
||||
|
@ -546,7 +546,7 @@ class workshop_rubric_strategy implements workshop_strategy {
|
|||
/**
|
||||
* Returns the list of current grades filled by the reviewer indexed by dimensionid
|
||||
*
|
||||
* @param stdclass $assessment Assessment record
|
||||
* @param stdClass $assessment Assessment record
|
||||
* @return array [int dimensionid] => stdclass workshop_grades record
|
||||
*/
|
||||
protected function get_current_assessment_data(stdclass $assessment) {
|
||||
|
@ -569,7 +569,7 @@ class workshop_rubric_strategy implements workshop_strategy {
|
|||
/**
|
||||
* Aggregates the assessment form data and sets the grade for the submission given by the peer
|
||||
*
|
||||
* @param stdclass $assessment Assessment record
|
||||
* @param stdClass $assessment Assessment record
|
||||
* @return float|null Raw grade (from 0.00000 to 100.00000) for submission as suggested by the peer
|
||||
*/
|
||||
protected function update_peer_grade(stdclass $assessment) {
|
||||
|
|
|
@ -114,7 +114,7 @@ class workshop_rubric_strategy_test extends UnitTestCase {
|
|||
public function test_calculate_peer_grade_null_grade() {
|
||||
// fixture set-up
|
||||
$grades = array();
|
||||
// excercise SUT
|
||||
// exercise SUT
|
||||
$suggested = $this->strategy->calculate_peer_grade($grades);
|
||||
// validate
|
||||
$this->assertNull($suggested);
|
||||
|
@ -125,7 +125,7 @@ class workshop_rubric_strategy_test extends UnitTestCase {
|
|||
$grades[6] = (object)array('dimensionid' => 6, 'grade' => 0);
|
||||
$grades[8] = (object)array('dimensionid' => 8, 'grade' => 0);
|
||||
$grades[10] = (object)array('dimensionid' => 10, 'grade' => 10);
|
||||
// excercise SUT
|
||||
// exercise SUT
|
||||
$suggested = $this->strategy->calculate_peer_grade($grades);
|
||||
// validate
|
||||
$this->assertEqual(grade_floatval($suggested), 0.00000);
|
||||
|
@ -136,7 +136,7 @@ class workshop_rubric_strategy_test extends UnitTestCase {
|
|||
$grades[6] = (object)array('dimensionid' => 6, 'grade' => 8);
|
||||
$grades[8] = (object)array('dimensionid' => 8, 'grade' => 3);
|
||||
$grades[10] = (object)array('dimensionid' => 10, 'grade' => 40);
|
||||
// excercise SUT
|
||||
// exercise SUT
|
||||
$suggested = $this->strategy->calculate_peer_grade($grades);
|
||||
// validate
|
||||
$this->assertEqual(grade_floatval($suggested), 100.00000);
|
||||
|
@ -147,7 +147,7 @@ class workshop_rubric_strategy_test extends UnitTestCase {
|
|||
$grades[6] = (object)array('dimensionid' => 6, 'grade' => 2);
|
||||
$grades[8] = (object)array('dimensionid' => 8, 'grade' => 2);
|
||||
$grades[10] = (object)array('dimensionid' => 10, 'grade' => 30);
|
||||
// excercise SUT
|
||||
// exercise SUT
|
||||
$suggested = $this->strategy->calculate_peer_grade($grades);
|
||||
// validate
|
||||
// minimal rubric score is 10, maximal is 51. We have 34 here
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue