From 7a789aa8cc5176353ba18dae7ffe6bb9607842f2 Mon Sep 17 00:00:00 2001 From: David Mudrak Date: Mon, 4 Jan 2010 18:30:57 +0000 Subject: [PATCH] workshop coding style - use stdclass instead of stdClass --- mod/workshop/allocation/lib.php | 2 +- mod/workshop/allocation/manual/lib.php | 12 +- mod/workshop/allocation/manual/renderer.php | 10 +- mod/workshop/allocation/random/lib.php | 6 +- .../random/simpletest/testallocator.php | 18 +-- mod/workshop/assessment.php | 4 +- mod/workshop/eval/best/lib.php | 40 ++--- mod/workshop/eval/best/simpletest/testlib.php | 8 +- mod/workshop/exassessment.php | 2 +- mod/workshop/excompare.php | 2 +- mod/workshop/exsubmission.php | 2 +- mod/workshop/form/accumulative/lib.php | 40 ++--- .../form/accumulative/simpletest/testlib.php | 6 +- mod/workshop/form/assessment_form.php | 2 +- mod/workshop/form/comments/lib.php | 36 ++--- mod/workshop/form/edit_form.php | 2 +- mod/workshop/form/lib.php | 18 +-- mod/workshop/form/numerrors/lib.php | 36 ++--- .../form/numerrors/simpletest/testlib.php | 6 +- mod/workshop/form/rubric/lib.php | 44 ++--- .../form/rubric/simpletest/testlib.php | 12 +- mod/workshop/lib.php | 64 ++++---- mod/workshop/locallib.php | 152 +++++++++--------- mod/workshop/renderer.php | 56 +++---- mod/workshop/simpletest/testlocallib.php | 10 +- mod/workshop/submission.php | 4 +- mod/workshop/view.php | 6 +- 27 files changed, 300 insertions(+), 300 deletions(-) diff --git a/mod/workshop/allocation/lib.php b/mod/workshop/allocation/lib.php index ec9fb60300a17..8644b01967946 100644 --- a/mod/workshop/allocation/lib.php +++ b/mod/workshop/allocation/lib.php @@ -55,7 +55,7 @@ public function init(); * * If a form is part of the UI, the caller should have called $PAGE->set_url(...) * - * @param stdClass $wsoutput workshop module renderer can be used + * @param stdclass $wsoutput workshop module renderer can be used * @return string HTML code to be echoed */ public function ui(); diff --git a/mod/workshop/allocation/manual/lib.php b/mod/workshop/allocation/manual/lib.php index 70a73ad66c909..6ff3fe267d6f8 100644 --- a/mod/workshop/allocation/manual/lib.php +++ b/mod/workshop/allocation/manual/lib.php @@ -136,7 +136,7 @@ public function ui() { $hlauthorid = -1; // highlight this author $hlreviewerid = -1; // highlight this reviewer - $msg = new stdClass(); // message to render + $msg = new stdclass(); // message to render $m = optional_param('m', '', PARAM_ALPHANUMEXT); // message code if ($m) { @@ -214,7 +214,7 @@ public function ui() { $submissions = $this->workshop->get_submissions(array_keys($participants)); foreach ($submissions as $submission) { if (!isset($userinfo[$submission->authorid])) { - $userinfo[$submission->authorid] = new stdClass(); + $userinfo[$submission->authorid] = new stdclass(); $userinfo[$submission->authorid]->id = $submission->authorid; $userinfo[$submission->authorid]->firstname = $submission->authorfirstname; $userinfo[$submission->authorid]->lastname = $submission->authorlastname; @@ -237,7 +237,7 @@ public function ui() { $reviewers = $DB->get_records_sql($sql, $params); foreach ($reviewers as $reviewer) { if (!isset($userinfo[$reviewer->reviewerid])) { - $userinfo[$reviewer->reviewerid] = new stdClass(); + $userinfo[$reviewer->reviewerid] = new stdclass(); $userinfo[$reviewer->reviewerid]->id = $reviewer->reviewerid; $userinfo[$reviewer->reviewerid]->firstname = $reviewer->firstname; $userinfo[$reviewer->reviewerid]->lastname = $reviewer->lastname; @@ -264,7 +264,7 @@ public function ui() { $reviewees = $DB->get_records_sql($sql, $params); foreach ($reviewees as $reviewee) { if (!isset($userinfo[$reviewee->revieweeid])) { - $userinfo[$reviewee->revieweeid] = new stdClass(); + $userinfo[$reviewee->revieweeid] = new stdclass(); $userinfo[$reviewee->revieweeid]->id = $reviewee->revieweeid; $userinfo[$reviewee->revieweeid]->firstname = $reviewee->firstname; $userinfo[$reviewee->revieweeid]->lastname = $reviewee->lastname; @@ -278,7 +278,7 @@ public function ui() { $allocations = array(); foreach ($participants as $participant) { - $allocations[$participant->id] = new stdClass; + $allocations[$participant->id] = new stdclass; $allocations[$participant->id]->userid = $participant->id; $allocations[$participant->id]->submissionid = null; $allocations[$participant->id]->reviewedby = array(); @@ -302,7 +302,7 @@ public function ui() { unset($reviewees); // prepare data to be displayed - $data = new stdClass(); + $data = new stdclass(); $data->allocations = $allocations; $data->userinfo = $userinfo; $data->authors = $this->workshop->get_potential_authors(); diff --git a/mod/workshop/allocation/manual/renderer.php b/mod/workshop/allocation/manual/renderer.php index e471d375c1a3b..205be877372f5 100644 --- a/mod/workshop/allocation/manual/renderer.php +++ b/mod/workshop/allocation/manual/renderer.php @@ -33,10 +33,10 @@ class workshopallocation_manual_renderer extends plugin_renderer_base { /** * Display the table of all current allocations and widgets to modify them * - * @param stdClass $data to be displayed - see the top of the function for the list of needed properties + * @param stdclass $data to be displayed - see the top of the function for the list of needed properties * @return string html code */ - public function display_allocations(stdClass $data) { + public function display_allocations(stdclass $data) { $allocations = $data->allocations; // array prepared array of all allocations data $userinfo = $data->userinfo; // names and pictures of all required users $authors = $data->authors; // array potential reviewees @@ -85,7 +85,7 @@ public function display_allocations(stdClass $data) { * * @return string HTML code */ - protected function participant(stdClass $allocation, array $userinfo) { + protected function participant(stdclass $allocation, array $userinfo) { $o = $this->output->user_picture($userinfo[$allocation->userid], $this->page->course->id); $o .= fullname($userinfo[$allocation->userid]); $o .= $this->output->container_start(array('submission')); @@ -108,7 +108,7 @@ protected function participant(stdClass $allocation, array $userinfo) { * * @return string html code */ - protected function reviewers_of_participant(stdClass $allocation, array $userinfo, array $reviewers, $selfassessment) { + protected function reviewers_of_participant(stdclass $allocation, array $userinfo, array $reviewers, $selfassessment) { $o = ''; if (is_null($allocation->submissionid)) { $o .= $this->output->container(get_string('nothingtoreview', 'workshop'), 'info'); @@ -154,7 +154,7 @@ protected function reviewers_of_participant(stdClass $allocation, array $userinf * * @return string html code */ - protected function reviewees_of_participant(stdClass $allocation, array $userinfo, array $authors, $selfassessment) { + protected function reviewees_of_participant(stdclass $allocation, array $userinfo, array $authors, $selfassessment) { $o = ''; if (is_null($allocation->submissionid)) { $o .= $this->output->container(get_string('withoutsubmission', 'workshop'), 'info'); diff --git a/mod/workshop/allocation/random/lib.php b/mod/workshop/allocation/random/lib.php index be5d7da3ca2de..96073bf8c30a9 100644 --- a/mod/workshop/allocation/random/lib.php +++ b/mod/workshop/allocation/random/lib.php @@ -116,7 +116,7 @@ public function init() { $this->add_new_allocations($newallocations, $authors, $reviewers); foreach ($newallocations as $newallocation) { list($reviewerid, $authorid) = each($newallocation); - $a = new stdClass(); + $a = new stdclass(); $a->reviewername = fullname($reviewers[0][$reviewerid]); $a->authorname = fullname($authors[0][$authorid]); $o[] = 'ok::indent::' . get_string('allocationaddeddetail', 'workshopallocation_random', $a); @@ -128,7 +128,7 @@ public function init() { // by reviewer $o[] = 'info::' . get_string('numofdeallocatedassessment', 'workshopallocation_random', count($delassessments)); foreach ($delassessments as $delassessmentkey => $delassessmentid) { - $a = new stdClass(); + $a = new stdclass(); $a->authorname = fullname((object)array( 'lastname' => $assessments[$delassessmentid]->authorlastname, 'firstname' => $assessments[$delassessmentid]->authorfirstname)); @@ -159,7 +159,7 @@ public function ui() { global $OUTPUT, $PAGE; $m = optional_param('m', null, PARAM_INT); // status message code - $msg = new stdClass(); + $msg = new stdclass(); if ($m == self::MSG_SUCCESS) { $msg = (object)array('text' => get_string('randomallocationdone', 'workshopallocation_random'), 'sty' => 'ok'); } diff --git a/mod/workshop/allocation/random/simpletest/testallocator.php b/mod/workshop/allocation/random/simpletest/testallocator.php index ad0227fdebba1..433ddd291f21e 100644 --- a/mod/workshop/allocation/random/simpletest/testallocator.php +++ b/mod/workshop/allocation/random/simpletest/testallocator.php @@ -68,9 +68,9 @@ class workshop_allocation_random_test extends UnitTestCase { protected $allocator; public function setUp() { - $cm = new stdClass(); - $course = new stdClass(); - $context = new stdClass(); + $cm = new stdclass(); + $course = new stdclass(); + $context = new stdclass(); $workshop = (object)array('id' => 42); $this->workshop = new workshop($workshop, $cm, $course, $context); $this->allocator = new testable_workshop_random_allocator($this->workshop); @@ -88,8 +88,8 @@ public function test_self_allocation_empty_values() { public function test_self_allocation_equal_user_groups() { // fixture setup - $authors = array(0 => array_fill_keys(array(4, 6, 10), new stdClass())); - $reviewers = array(0 => array_fill_keys(array(4, 6, 10), new stdClass())); + $authors = array(0 => array_fill_keys(array(4, 6, 10), new stdclass())); + $reviewers = array(0 => array_fill_keys(array(4, 6, 10), new stdclass())); // exercise SUT $newallocations = $this->allocator->self_allocation($authors, $reviewers); // verify @@ -98,8 +98,8 @@ public function test_self_allocation_equal_user_groups() { public function test_self_allocation_different_user_groups() { // fixture setup - $authors = array(0 => array_fill_keys(array(1, 4, 5, 10, 13), new stdClass())); - $reviewers = array(0 => array_fill_keys(array(4, 7, 10), new stdClass())); + $authors = array(0 => array_fill_keys(array(1, 4, 5, 10, 13), new stdclass())); + $reviewers = array(0 => array_fill_keys(array(4, 7, 10), new stdclass())); // exercise SUT $newallocations = $this->allocator->self_allocation($authors, $reviewers); // verify @@ -108,8 +108,8 @@ public function test_self_allocation_different_user_groups() { public function test_self_allocation_skip_existing() { // fixture setup - $authors = array(0 => array_fill_keys(array(3, 4, 10), new stdClass())); - $reviewers = array(0 => array_fill_keys(array(3, 4, 10), new stdClass())); + $authors = array(0 => array_fill_keys(array(3, 4, 10), new stdclass())); + $reviewers = array(0 => array_fill_keys(array(3, 4, 10), new stdclass())); $assessments = array(23 => (object)array('authorid' => 3, 'reviewerid' => 3)); // exercise SUT $newallocations = $this->allocator->self_allocation($authors, $reviewers, $assessments); diff --git a/mod/workshop/assessment.php b/mod/workshop/assessment.php index dc7f818fadcc1..590e35c6a5398 100644 --- a/mod/workshop/assessment.php +++ b/mod/workshop/assessment.php @@ -98,7 +98,7 @@ $feedbackform = $workshop->get_feedbackreviewer_form($PAGE->url, $assessment); if ($data = $feedbackform->get_data()) { $data = file_postupdate_standard_editor($data, 'feedbackreviewer', array(), $workshop->context); - $record = new stdClass(); + $record = new stdclass(); $record->id = $assessment->id; $record->gradinggradeover = $workshop->raw_grade_value($data->gradinggradeover, $workshop->gradinggrade); $record->gradinggradeoverby = $USER->id; @@ -121,7 +121,7 @@ echo $OUTPUT->heading(get_string('assessmentbyyourself', 'workshop'), 2); } elseif (has_capability('mod/workshop:viewreviewernames', $workshop->context)) { $assessment = $workshop->get_assessment_by_id($assessment->id); // extend the current record with user details - $reviewer = new stdClass(); + $reviewer = new stdclass(); $reviewer->firstname = $assessment->reviewerfirstname; $reviewer->lastname = $assessment->reviewerlastname; echo $OUTPUT->heading(get_string('assessmentbyknown', 'workshop', fullname($reviewer)), 2); diff --git a/mod/workshop/eval/best/lib.php b/mod/workshop/eval/best/lib.php index 256b13cb911b5..7ded7e61c2889 100644 --- a/mod/workshop/eval/best/lib.php +++ b/mod/workshop/eval/best/lib.php @@ -58,17 +58,17 @@ public function __construct(workshop $workshop) { * This function relies on the grading strategy subplugin providing get_assessments_recordset() method. * {@see self::process_assessments()} for the required structure of the recordset. * - * @param stdClass $settings The settings for this round of evaluation + * @param stdclass $settings The settings for this round of evaluation * @param null|int|array $restrict If null, update all reviewers, otherwise update just grades for the given reviewers(s) * * @return void */ - public function update_grading_grades(stdClass $settings, $restrict=null) { + public function update_grading_grades(stdclass $settings, $restrict=null) { global $DB; // remember the recently used settings for this workshop if (empty($this->settings)) { - $record = new stdClass(); + $record = new stdclass(); $record->workshopid = $this->workshop->id; $record->comparison = $settings->comparison; $DB->insert_record('workshopeval_best_settings', $record); @@ -131,12 +131,12 @@ public function get_settings_form(moodle_url $actionurl=null) { /** * Given a list of all assessments of a single submission, updates the grading grades in database * - * @param array $assessments of stdClass (->assessmentid ->assessmentweight ->reviewerid ->gradinggrade ->submissionid ->dimensionid ->grade) - * @param array $diminfo of stdClass (->id ->weight ->max ->min) - * @param stdClass grading evaluation settings + * @param array $assessments of stdclass (->assessmentid ->assessmentweight ->reviewerid ->gradinggrade ->submissionid ->dimensionid ->grade) + * @param array $diminfo of stdclass (->id ->weight ->max ->min) + * @param stdclass grading evaluation settings * @return void */ - protected function process_assessments(array $assessments, array $diminfo, stdClass $settings) { + protected function process_assessments(array $assessments, array $diminfo, stdclass $settings) { global $DB; if (empty($assessments)) { @@ -196,7 +196,7 @@ protected function process_assessments(array $assessments, array $diminfo, stdCl foreach ($grades as $assessmentid => $grade) { if (grade_floats_different($grade, $assessments[$assessmentid]->gradinggrade)) { // the value has changed - $record = new stdClass(); + $record = new stdclass(); $record->id = $assessmentid; $record->gradinggrade = grade_floatval($grade); $DB->update_record('workshop_assessments', $record, true); // bulk operations expected @@ -217,7 +217,7 @@ protected function prepare_data_from_recordset($assessments) { foreach ($assessments as $a) { $id = $a->assessmentid; // just an abbrevation if (!isset($data[$id])) { - $data[$id] = new stdClass(); + $data[$id] = new stdclass(); $data[$id]->assessmentid = $a->assessmentid; $data[$id]->weight = $a->assessmentweight; $data[$id]->reviewerid = $a->reviewerid; @@ -233,12 +233,12 @@ protected function prepare_data_from_recordset($assessments) { /** * 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. Hopefuly + * Note: this heavily relies on PHP5 way of handling references in array of stdclasses. Hopefuly * it will not change again soon. * - * @param array $assessments of stdClass as returned by {@see self::prepare_data_from_recordset()} - * @param array $diminfo of stdClass - * @return array of stdClass with the same structure as $assessments + * @param array $assessments of stdclass as returned by {@see self::prepare_data_from_recordset()} + * @param array $diminfo of stdclass + * @return array of stdclass with the same structure as $assessments */ protected function normalize_grades(array $assessments, array $diminfo) { foreach ($assessments as $asid => $assessment) { @@ -261,7 +261,7 @@ protected function normalize_grades(array $assessments, array $diminfo) { * The passed structure must be array of assessments objects with ->weight and ->dimgrades properties. * * @param array $assessments as prepared by {@link self::prepare_data_from_recordset()} - * @return null|stdClass + * @return null|stdclass */ protected function average_assessment(array $assessments) { $sumdimgrades = array(); @@ -283,7 +283,7 @@ protected function average_assessment(array $assessments) { return null; } - $average = new stdClass(); + $average = new stdclass(); $average->dimgrades = array(); foreach ($sumdimgrades as $dimid => $sumdimgrade) { $average->dimgrades[$dimid] = grade_floatval($sumdimgrade / $sumweights); @@ -356,13 +356,13 @@ protected function weighted_variance(array $assessments) { * Returned value is rounded to 4 valid decimals to prevent some rounding issues - see the unit test * for an example. * - * @param stdClass $assessment the assessment being measured - * @param stdClass $referential assessment - * @param array $diminfo of stdClass(->weight ->min ->max ->variance) indexed by dimension id - * @param stdClass $settings + * @param stdclass $assessment the assessment being measured + * @param stdclass $referential assessment + * @param array $diminfo of stdclass(->weight ->min ->max ->variance) indexed by dimension id + * @param stdclass $settings * @return float|null rounded to 4 valid decimals */ - protected function assessments_distance(stdClass $assessment, stdClass $referential, array $diminfo, stdClass $settings) { + protected function assessments_distance(stdclass $assessment, stdclass $referential, array $diminfo, stdclass $settings) { $distance = 0; $n = 0; foreach (array_keys($assessment->dimgrades) as $dimid) { diff --git a/mod/workshop/eval/best/simpletest/testlib.php b/mod/workshop/eval/best/simpletest/testlib.php index 7756ceaef9057..4c50c6303adaf 100644 --- a/mod/workshop/eval/best/simpletest/testlib.php +++ b/mod/workshop/eval/best/simpletest/testlib.php @@ -47,7 +47,7 @@ public function average_assessment(array $assessments) { public function weighted_variance(array $assessments) { return parent::weighted_variance($assessments); } - public function assessments_distance(stdClass $assessment, stdClass $referential, array $diminfo, stdClass $settings) { + public function assessments_distance(stdclass $assessment, stdclass $referential, array $diminfo, stdclass $settings) { return parent::assessments_distance($assessment, $referential, $diminfo, $settings); } } @@ -71,9 +71,9 @@ public function setUp() { $this->realDB = $DB; $DB = new mockDB(); - $cm = new stdClass(); - $course = new stdClass(); - $context = new stdClass(); + $cm = new stdclass(); + $course = new stdclass(); + $context = new stdclass(); $workshop = (object)array('id' => 42, 'evaluation' => 'best'); $this->workshop = new workshop($workshop, $cm, $course, $context); $this->evaluator = new testable_workshop_best_evaluation($this->workshop); diff --git a/mod/workshop/exassessment.php b/mod/workshop/exassessment.php index b586874f040f2..09f7174a2ae4a 100644 --- a/mod/workshop/exassessment.php +++ b/mod/workshop/exassessment.php @@ -101,7 +101,7 @@ echo $OUTPUT->heading(get_string('assessmentbyyourself', 'workshop'), 2); } else { $assessment = $workshop->get_assessment_by_id($assessment->id); // extend the current record with user details - $reviewer = new stdClass(); + $reviewer = new stdclass(); $reviewer->firstname = $assessment->reviewerfirstname; $reviewer->lastname = $assessment->reviewerlastname; echo $OUTPUT->heading(get_string('assessmentbyknown', 'workshop', fullname($reviewer)), 2); diff --git a/mod/workshop/excompare.php b/mod/workshop/excompare.php index 6366cc2380637..44e97e949e51a 100644 --- a/mod/workshop/excompare.php +++ b/mod/workshop/excompare.php @@ -88,7 +88,7 @@ if ($isreviewer) { echo $OUTPUT->heading(get_string('assessmentbyyourself', 'workshop'), 2); } elseif ($canmanage) { - $reviewer = new stdClass(); + $reviewer = new stdclass(); $reviewer->firstname = $assessment->reviewerfirstname; $reviewer->lastname = $assessment->reviewerlastname; echo $OUTPUT->heading(get_string('assessmentbyknown', 'workshop', fullname($reviewer)), 2); diff --git a/mod/workshop/exsubmission.php b/mod/workshop/exsubmission.php index 44ce039094607..fd2645c5c9a0c 100644 --- a/mod/workshop/exsubmission.php +++ b/mod/workshop/exsubmission.php @@ -50,7 +50,7 @@ $example = $workshop->get_example_by_id($id); } else { // no example specified - create new one require_capability('mod/workshop:manageexamples', $workshop->context); - $example = new stdClass(); + $example = new stdclass(); $example->id = null; $example->authorid = $USER->id; } diff --git a/mod/workshop/form/accumulative/lib.php b/mod/workshop/form/accumulative/lib.php index 131062dd36b86..3e108ee2a2174 100644 --- a/mod/workshop/form/accumulative/lib.php +++ b/mod/workshop/form/accumulative/lib.php @@ -107,10 +107,10 @@ public function get_edit_strategy_form($actionurl=null) { * 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) { + public function save_edit_strategy_form(stdclass $data) { global $DB, $PAGE; $workshopid = $data->workshopid; @@ -149,10 +149,10 @@ public function save_edit_strategy_form(stdClass $data) { * * @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 */ - public function get_assessment_form(moodle_url $actionurl=null, $mode='preview', stdClass $assessment=null, $editable=true) { + public function get_assessment_form(moodle_url $actionurl=null, $mode='preview', stdclass $assessment=null, $editable=true) { global $CFG; // needed because the included files use it global $PAGE; global $DB; @@ -170,7 +170,7 @@ public function get_assessment_form(moodle_url $actionurl=null, $mode='preview', if ('assessment' === $mode and !empty($assessment)) { // load the previously saved assessment data $grades = $this->get_current_assessment_data($assessment); - $current = new stdClass(); + $current = new stdclass(); for ($i = 0; $i < $nodimensions; $i++) { $dimid = $fields->{'dimensionid__idx_'.$i}; if (isset($grades[$dimid])) { @@ -200,18 +200,18 @@ public function get_assessment_form(moodle_url $actionurl=null, $mode='preview', * * 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) { + public function save_assessment(stdclass $assessment, stdclass $data) { global $DB; if (!isset($data->nodims)) { throw coding_expection('You did not send me the number of assessment dimensions to process'); } for ($i = 0; $i < $data->nodims; $i++) { - $grade = new stdClass(); + $grade = new stdclass(); $grade->id = $data->{'gradeid__idx_' . $i}; $grade->assessmentid = $assessment->id; $grade->strategy = 'accumulative'; @@ -286,7 +286,7 @@ public function get_dimensions_info() { $dimrecords = $DB->get_records_sql($sql, $params); $diminfo = array(); foreach ($dimrecords as $dimid => $dimrecord) { - $diminfo[$dimid] = new stdClass(); + $diminfo[$dimid] = new stdclass(); $diminfo[$dimid]->id = $dimid; $diminfo[$dimid]->weight = $dimrecord->weight; if ($dimrecord->grade < 0) { @@ -331,7 +331,7 @@ protected function load_fields() { */ protected function prepare_form_fields(array $raw) { - $formdata = new stdClass(); + $formdata = new stdclass(); $key = 0; foreach ($raw as $dimension) { $formdata->{'dimensionid__idx_' . $key} = $dimension->id; @@ -372,17 +372,17 @@ protected function delete_dimensions(array $ids) { * 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) { + protected function prepare_database_fields(stdclass $raw) { global $PAGE; - $cook = new stdClass(); // to be returned + $cook = new stdclass(); // to be returned $cook->accumulative = array(); // records to be stored in {workshopform_accumulative} for ($i = 0; $i < $raw->norepeats; $i++) { - $cook->accumulative[$i] = new stdClass(); + $cook->accumulative[$i] = new stdclass(); $cook->accumulative[$i]->id = $raw->{'dimensionid__idx_'.$i}; $cook->accumulative[$i]->workshopid = $this->workshop->id; $cook->accumulative[$i]->sort = $i + 1; @@ -396,10 +396,10 @@ protected function prepare_database_fields(stdClass $raw) { /** * Returns the list of current grades filled by the reviewer indexed by dimensionid * - * @param stdClass $assessment Assessment record - * @return array [int dimensionid] => stdClass workshop_grades record + * @param stdclass $assessment Assessment record + * @return array [int dimensionid] => stdclass workshop_grades record */ - protected function get_current_assessment_data(stdClass $assessment) { + protected function get_current_assessment_data(stdclass $assessment) { global $DB; if (empty($this->dimensions)) { @@ -419,10 +419,10 @@ protected function get_current_assessment_data(stdClass $assessment) { /** * 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) { + protected function update_peer_grade(stdclass $assessment) { $grades = $this->get_current_assessment_data($assessment); $suggested = $this->calculate_peer_grade($grades); if (!is_null($suggested)) { diff --git a/mod/workshop/form/accumulative/simpletest/testlib.php b/mod/workshop/form/accumulative/simpletest/testlib.php index 34e6b219b6bc1..174c83437ba8f 100644 --- a/mod/workshop/form/accumulative/simpletest/testlib.php +++ b/mod/workshop/form/accumulative/simpletest/testlib.php @@ -67,9 +67,9 @@ public function setUp() { $this->realDB = $DB; $DB = new mockDB(); - $cm = new stdClass(); - $course = new stdClass(); - $context = new stdClass(); + $cm = new stdclass(); + $course = new stdclass(); + $context = new stdclass(); $workshop = (object)array('id' => 42, 'strategy' => 'accumulative'); $this->workshop = new workshop($workshop, $cm, $course, $context); $this->strategy = new testable_workshop_accumulative_strategy($this->workshop); diff --git a/mod/workshop/form/assessment_form.php b/mod/workshop/form/assessment_form.php index af2c616c451e1..dbb5d6aba245a 100644 --- a/mod/workshop/form/assessment_form.php +++ b/mod/workshop/form/assessment_form.php @@ -78,7 +78,7 @@ public function definition() { /** * 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. diff --git a/mod/workshop/form/comments/lib.php b/mod/workshop/form/comments/lib.php index de2bad4bbe8fd..4df2782459af2 100644 --- a/mod/workshop/form/comments/lib.php +++ b/mod/workshop/form/comments/lib.php @@ -107,10 +107,10 @@ public function get_edit_strategy_form($actionurl=null) { * 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) { + public function save_edit_strategy_form(stdclass $data) { global $DB, $PAGE; $workshopid = $data->workshopid; @@ -149,10 +149,10 @@ public function save_edit_strategy_form(stdClass $data) { * * @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 */ - public function get_assessment_form(moodle_url $actionurl=null, $mode='preview', stdClass $assessment=null, $editable=true) { + public function get_assessment_form(moodle_url $actionurl=null, $mode='preview', stdclass $assessment=null, $editable=true) { global $CFG; // needed because the included files use it global $PAGE; global $DB; @@ -170,7 +170,7 @@ public function get_assessment_form(moodle_url $actionurl=null, $mode='preview', if ('assessment' === $mode and !empty($assessment)) { // load the previously saved assessment data $grades = $this->get_current_assessment_data($assessment); - $current = new stdClass(); + $current = new stdclass(); for ($i = 0; $i < $nodimensions; $i++) { $dimid = $fields->{'dimensionid__idx_'.$i}; if (isset($grades[$dimid])) { @@ -199,18 +199,18 @@ public function get_assessment_form(moodle_url $actionurl=null, $mode='preview', * * 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) { + public function save_assessment(stdclass $assessment, stdclass $data) { global $DB; if (!isset($data->nodims)) { throw coding_expection('You did not send me the number of assessment dimensions to process'); } for ($i = 0; $i < $data->nodims; $i++) { - $grade = new stdClass(); + $grade = new stdclass(); $grade->id = $data->{'gradeid__idx_' . $i}; $grade->assessmentid = $assessment->id; $grade->strategy = 'comments'; @@ -282,7 +282,7 @@ public function get_dimensions_info() { $dimrecords = $DB->get_records('workshopform_comments', array('workshopid' => $this->workshop->id), 'sort', 'id'); $diminfo = array(); foreach ($dimrecords as $dimid => $dimrecord) { - $diminfo[$dimid] = new stdClass(); + $diminfo[$dimid] = new stdclass(); $diminfo[$dimid]->id = $dimid; $diminfo[$dimid]->weight = 1; $diminfo[$dimid]->min = 100; @@ -313,7 +313,7 @@ protected function load_fields() { */ protected function prepare_form_fields(array $raw) { - $formdata = new stdClass(); + $formdata = new stdclass(); $key = 0; foreach ($raw as $dimension) { $formdata->{'dimensionid__idx_' . $key} = $dimension->id; @@ -352,17 +352,17 @@ protected function delete_dimensions(array $ids) { * 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) { + protected function prepare_database_fields(stdclass $raw) { global $PAGE; - $cook = new stdClass(); // to be returned + $cook = new stdclass(); // to be returned $cook->comments = array(); // records to be stored in {workshopform_comments} for ($i = 0; $i < $raw->norepeats; $i++) { - $cook->comments[$i] = new stdClass(); + $cook->comments[$i] = new stdclass(); $cook->comments[$i]->id = $raw->{'dimensionid__idx_'.$i}; $cook->comments[$i]->workshopid = $this->workshop->id; $cook->comments[$i]->sort = $i + 1; @@ -374,10 +374,10 @@ protected function prepare_database_fields(stdClass $raw) { /** * Returns the list of current grades filled by the reviewer indexed by dimensionid * - * @param stdClass $assessment Assessment record - * @return array [int dimensionid] => stdClass workshop_grades record + * @param stdclass $assessment Assessment record + * @return array [int dimensionid] => stdclass workshop_grades record */ - protected function get_current_assessment_data(stdClass $assessment) { + protected function get_current_assessment_data(stdclass $assessment) { global $DB; if (empty($this->dimensions)) { diff --git a/mod/workshop/form/edit_form.php b/mod/workshop/form/edit_form.php index daac75a113f0d..7392bf7f8a09d 100644 --- a/mod/workshop/form/edit_form.php +++ b/mod/workshop/form/edit_form.php @@ -81,7 +81,7 @@ public function definition() { /** * 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. diff --git a/mod/workshop/form/lib.php b/mod/workshop/form/lib.php index 199cd3e364208..98636e2907d80 100644 --- a/mod/workshop/form/lib.php +++ b/mod/workshop/form/lib.php @@ -34,7 +34,7 @@ interface workshop_strategy { * Factory method returning a form that is used to define the assessment form * * @param string $actionurl URL of the action handler script, defaults to auto detect - * @return stdClass The instance of the assessment form editor class + * @return stdclass The instance of the assessment form editor class */ public function get_edit_strategy_form($actionurl=null); @@ -45,20 +45,20 @@ public function get_edit_strategy_form($actionurl=null); * 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); + public function save_edit_strategy_form(stdclass $data); /** * Factory method returning an instance of an assessment form * * @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) */ - public function get_assessment_form(moodle_url $actionurl=null, $mode='preview', stdClass $assessment=null, $editable=true); + public function get_assessment_form(moodle_url $actionurl=null, $mode='preview', stdclass $assessment=null, $editable=true); /** * Saves the filled assessment and returns the grade for submission as suggested by the reviewer @@ -67,12 +67,12 @@ public function get_assessment_form(moodle_url $actionurl=null, $mode='preview', * 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 */ - public function save_assessment(stdClass $assessment, stdClass $data); + public function save_assessment(stdclass $assessment, stdclass $data); /** * Has the assessment form been defined and is ready to be used by the reviewers? @@ -84,7 +84,7 @@ public function form_ready(); /** * Returns a general information about the assessment dimensions * - * @return array [dimid] => stdClass (->id ->max ->min ->weight) + * @return array [dimid] => stdclass (->id ->max ->min ->weight) */ public function get_dimensions_info(); diff --git a/mod/workshop/form/numerrors/lib.php b/mod/workshop/form/numerrors/lib.php index d21a2c421485d..9ae5539239c50 100644 --- a/mod/workshop/form/numerrors/lib.php +++ b/mod/workshop/form/numerrors/lib.php @@ -112,10 +112,10 @@ public function get_edit_strategy_form($actionurl=null) { * 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) { + public function save_edit_strategy_form(stdclass $data) { global $DB, $PAGE; $workshopid = $data->workshopid; @@ -184,10 +184,10 @@ public function save_edit_strategy_form(stdClass $data) { * * @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 */ - public function get_assessment_form(moodle_url $actionurl=null, $mode='preview', stdClass $assessment=null, $editable=true) { + public function get_assessment_form(moodle_url $actionurl=null, $mode='preview', stdclass $assessment=null, $editable=true) { global $CFG; // needed because the included files use it global $PAGE; global $DB; @@ -205,7 +205,7 @@ public function get_assessment_form(moodle_url $actionurl=null, $mode='preview', if ('assessment' === $mode and !empty($assessment)) { // load the previously saved assessment data $grades = $this->get_current_assessment_data($assessment); - $current = new stdClass(); + $current = new stdclass(); for ($i = 0; $i < $nodimensions; $i++) { $dimid = $fields->{'dimensionid__idx_'.$i}; if (isset($grades[$dimid])) { @@ -235,18 +235,18 @@ public function get_assessment_form(moodle_url $actionurl=null, $mode='preview', * * 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) { + public function save_assessment(stdclass $assessment, stdclass $data) { global $DB; if (!isset($data->nodims)) { throw coding_expection('You did not send me the number of assessment dimensions to process'); } for ($i = 0; $i < $data->nodims; $i++) { - $grade = new stdClass(); + $grade = new stdclass(); $grade->id = $data->{'gradeid__idx_' . $i}; $grade->assessmentid = $assessment->id; $grade->strategy = 'numerrors'; @@ -332,7 +332,7 @@ protected function load_mappings() { */ protected function prepare_form_fields(array $dims, array $maps) { - $formdata = new stdClass(); + $formdata = new stdclass(); $key = 0; foreach ($dims as $dimension) { $formdata->{'dimensionid__idx_' . $key} = $dimension->id; @@ -377,18 +377,18 @@ protected function delete_dimensions(array $ids) { * 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) { + protected function prepare_database_fields(stdclass $raw) { global $PAGE; - $cook = new stdClass(); // to be returned + $cook = new stdclass(); // to be returned $cook->numerrors = array(); // to be stored in {workshopform_numerrors} $cook->mappings = array(); // to be stored in {workshopform_numerrors_map} for ($i = 0; $i < $raw->norepeats; $i++) { - $cook->numerrors[$i] = new stdClass(); + $cook->numerrors[$i] = new stdclass(); $cook->numerrors[$i]->id = $raw->{'dimensionid__idx_'.$i}; $cook->numerrors[$i]->workshopid = $this->workshop->id; $cook->numerrors[$i]->sort = $i + 1; @@ -414,10 +414,10 @@ protected function prepare_database_fields(stdClass $raw) { /** * 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) { + protected function get_current_assessment_data(stdclass $assessment) { global $DB; if (empty($this->dimensions)) { @@ -437,10 +437,10 @@ protected function get_current_assessment_data(stdClass $assessment) { /** * 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) { + protected function update_peer_grade(stdclass $assessment) { $grades = $this->get_current_assessment_data($assessment); $suggested = $this->calculate_peer_grade($grades); if (!is_null($suggested)) { diff --git a/mod/workshop/form/numerrors/simpletest/testlib.php b/mod/workshop/form/numerrors/simpletest/testlib.php index 72508fcb3939e..77739880f10b4 100644 --- a/mod/workshop/form/numerrors/simpletest/testlib.php +++ b/mod/workshop/form/numerrors/simpletest/testlib.php @@ -70,9 +70,9 @@ public function setUp() { $this->realDB = $DB; $DB = new mockDB(); - $cm = new stdClass(); - $course = new stdClass(); - $context = new stdClass(); + $cm = new stdclass(); + $course = new stdclass(); + $context = new stdclass(); $workshop = (object)array('id' => 42, 'strategy' => 'numerrors'); $this->workshop = new workshop($workshop, $cm, $course, $context); $this->strategy = new testable_workshop_numerrors_strategy($this->workshop); diff --git a/mod/workshop/form/rubric/lib.php b/mod/workshop/form/rubric/lib.php index 0e752d587ee77..0bc4adafa3d86 100644 --- a/mod/workshop/form/rubric/lib.php +++ b/mod/workshop/form/rubric/lib.php @@ -117,10 +117,10 @@ public function get_edit_strategy_form($actionurl=null) { * 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) { + public function save_edit_strategy_form(stdclass $data) { global $DB; $norepeats = $data->norepeats; @@ -132,7 +132,7 @@ public function save_edit_strategy_form(stdClass $data) { if ($DB->record_exists('workshopform_rubric_config', array('workshopid' => $this->workshop->id))) { $DB->set_field('workshopform_rubric_config', 'layout', $layout, array('workshopid' => $this->workshop->id)); } else { - $record = new stdClass(); + $record = new stdclass(); $record->workshopid = $this->workshop->id; $record->layout = $layout; $DB->insert_record('workshopform_rubric_config', $record, false); @@ -191,7 +191,7 @@ public function save_edit_strategy_form(stdClass $data) { * @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 */ - public function get_assessment_form(moodle_url $actionurl=null, $mode='preview', stdClass $assessment=null, $editable=true) { + public function get_assessment_form(moodle_url $actionurl=null, $mode='preview', stdclass $assessment=null, $editable=true) { global $CFG; // needed because the included files use it global $DB; require_once(dirname(__FILE__) . '/assessment_form.php'); @@ -210,7 +210,7 @@ public function get_assessment_form(moodle_url $actionurl=null, $mode='preview', if ('assessment' === $mode and !empty($assessment)) { // load the previously saved assessment data $grades = $this->get_current_assessment_data($assessment); - $current = new stdClass(); + $current = new stdclass(); for ($i = 0; $i < $nodimensions; $i++) { $dimid = $fields->{'dimensionid__idx_'.$i}; if (isset($grades[$dimid])) { @@ -249,15 +249,15 @@ public function get_assessment_form(moodle_url $actionurl=null, $mode='preview', * * 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) { + public function save_assessment(stdclass $assessment, stdclass $data) { global $DB; for ($i = 0; isset($data->{'dimensionid__idx_' . $i}); $i++) { - $grade = new stdClass(); + $grade = new stdclass(); $grade->id = $data->{'gradeid__idx_' . $i}; $grade->assessmentid = $assessment->id; $grade->strategy = 'rubric'; @@ -357,7 +357,7 @@ protected function load_fields() { $fields = array(); foreach ($records as $record) { if (!isset($fields[$record->rid])) { - $fields[$record->rid] = new stdClass(); + $fields[$record->rid] = new stdclass(); $fields[$record->rid]->id = $record->rid; $fields[$record->rid]->sort = $record->sort; $fields[$record->rid]->description = $record->description; @@ -365,7 +365,7 @@ protected function load_fields() { $fields[$record->rid]->levels = array(); } if (!empty($record->lid)) { - $fields[$record->rid]->levels[$record->lid] = new stdClass(); + $fields[$record->rid]->levels[$record->lid] = new stdclass(); $fields[$record->rid]->levels[$record->lid]->id = $record->lid; $fields[$record->rid]->levels[$record->lid]->grade = $record->grade; $fields[$record->rid]->levels[$record->lid]->definition = $record->definition; @@ -393,11 +393,11 @@ protected function load_config() { * Maps the dimension data from DB to the form fields * * @param array $fields Array of dimensions definition as returned by {@link load_fields()} - * @return stdClass of fields data to be used by the mform set_data + * @return stdclass of fields data to be used by the mform set_data */ protected function prepare_form_fields(array $fields) { - $formdata = new stdClass(); + $formdata = new stdclass(); $key = 0; foreach ($fields as $field) { $formdata->{'dimensionid__idx_' . $key} = $field->id; @@ -445,15 +445,15 @@ protected function delete_dimensions(array $ids) { * 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) { + protected function prepare_database_fields(stdclass $raw) { $cook = array(); for ($i = 0; $i < $raw->norepeats; $i++) { - $cook[$i] = new stdClass(); + $cook[$i] = new stdclass(); $cook[$i]->id = $raw->{'dimensionid__idx_'.$i}; $cook[$i]->workshopid = $this->workshop->id; $cook[$i]->sort = $i + 1; @@ -462,7 +462,7 @@ protected function prepare_database_fields(stdClass $raw) { $j = 0; while (isset($raw->{'levelid__idx_' . $i . '__idy_' . $j})) { - $level = new stdClass(); + $level = new stdclass(); $level->id = $raw->{'levelid__idx_' . $i . '__idy_' . $j}; $level->grade = $raw->{'grade__idx_'.$i.'__idy_'.$j}; $level->definition = $raw->{'definition__idx_'.$i.'__idy_'.$j}; @@ -478,10 +478,10 @@ protected function prepare_database_fields(stdClass $raw) { /** * Returns the list of current grades filled by the reviewer indexed by dimensionid * - * @param stdClass $assessment Assessment record - * @return array [int dimensionid] => stdClass workshop_grades record + * @param stdclass $assessment Assessment record + * @return array [int dimensionid] => stdclass workshop_grades record */ - protected function get_current_assessment_data(stdClass $assessment) { + protected function get_current_assessment_data(stdclass $assessment) { global $DB; if (empty($this->dimensions)) { @@ -501,10 +501,10 @@ protected function get_current_assessment_data(stdClass $assessment) { /** * 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) { + protected function update_peer_grade(stdclass $assessment) { $grades = $this->get_current_assessment_data($assessment); $suggested = $this->calculate_peer_grade($grades); if (!is_null($suggested)) { diff --git a/mod/workshop/form/rubric/simpletest/testlib.php b/mod/workshop/form/rubric/simpletest/testlib.php index 8c5cb8e9a9bd3..e2ef8f579803b 100644 --- a/mod/workshop/form/rubric/simpletest/testlib.php +++ b/mod/workshop/form/rubric/simpletest/testlib.php @@ -67,9 +67,9 @@ public function setUp() { $this->realDB = $DB; $DB = new mockDB(); - $cm = new stdClass(); - $course = new stdClass(); - $context = new stdClass(); + $cm = new stdclass(); + $course = new stdclass(); + $context = new stdclass(); $workshop = (object)array('id' => 42, 'strategy' => 'rubric'); $this->workshop = new workshop($workshop, $cm, $course, $context); $DB->expectOnce('get_records_sql'); @@ -77,7 +77,7 @@ public function setUp() { $this->strategy = new testable_workshop_rubric_strategy($this->workshop); // prepare dimensions definition - $dim = new stdClass(); + $dim = new stdclass(); $dim->id = 6; $dim->levels[10] = (object)array('id' => 10, 'grade' => 0); $dim->levels[13] = (object)array('id' => 13, 'grade' => 2); @@ -85,7 +85,7 @@ public function setUp() { $dim->levels[16] = (object)array('id' => 16, 'grade' => 8); $this->strategy->dimensions[$dim->id] = $dim; - $dim = new stdClass(); + $dim = new stdclass(); $dim->id = 8; $dim->levels[17] = (object)array('id' => 17, 'grade' => 0); $dim->levels[18] = (object)array('id' => 18, 'grade' => 1); @@ -93,7 +93,7 @@ public function setUp() { $dim->levels[20] = (object)array('id' => 20, 'grade' => 3); $this->strategy->dimensions[$dim->id] = $dim; - $dim = new stdClass(); + $dim = new stdclass(); $dim->id = 10; $dim->levels[27] = (object)array('id' => 27, 'grade' => 10); $dim->levels[28] = (object)array('id' => 28, 'grade' => 20); diff --git a/mod/workshop/lib.php b/mod/workshop/lib.php index 591ef3945dbfc..ae99749351bce 100644 --- a/mod/workshop/lib.php +++ b/mod/workshop/lib.php @@ -63,10 +63,10 @@ function workshop_supports($feature) { * will save a new instance and return the id number * of the new instance. * - * @param stdClass $workshop An object from the form in mod_form.php + * @param stdclass $workshop An object from the form in mod_form.php * @return int The id of the newly inserted workshop record */ -function workshop_add_instance(stdClass $workshop) { +function workshop_add_instance(stdclass $workshop) { global $CFG, $DB; require_once(dirname(__FILE__) . '/locallib.php'); @@ -113,10 +113,10 @@ function workshop_add_instance(stdClass $workshop) { * (defined by the form in mod_form.php) this function * will update an existing instance with new data. * - * @param stdClass $workshop An object from the form in mod_form.php + * @param stdclass $workshop An object from the form in mod_form.php * @return bool success */ -function workshop_update_instance(stdClass $workshop) { +function workshop_update_instance(stdclass $workshop) { global $CFG, $DB; require_once(dirname(__FILE__) . '/locallib.php'); @@ -204,7 +204,7 @@ function workshop_delete_instance($id) { * @todo Finish documenting this function */ function workshop_user_outline($course, $user, $mod, $workshop) { - $return = new stdClass(); + $return = new stdclass(); $return->time = 0; $return->info = ''; return $return; @@ -315,16 +315,16 @@ function workshop_get_extra_capabilities() { * Needed by grade_update_mod_grades() in lib/gradelib.php. Also used by * {@link workshop_update_grades()}. * - * @param stdClass $workshop instance object with extra cmidnumber and modname property - * @param stdClass $submissiongrades data for the first grade item - * @param stdClass $assessmentgrades data for the second grade item + * @param stdclass $workshop instance object with extra cmidnumber and modname property + * @param stdclass $submissiongrades data for the first grade item + * @param stdclass $assessmentgrades data for the second grade item * @return void */ -function workshop_grade_item_update(stdClass $workshop, $submissiongrades=null, $assessmentgrades=null) { +function workshop_grade_item_update(stdclass $workshop, $submissiongrades=null, $assessmentgrades=null) { global $CFG; require_once($CFG->libdir.'/gradelib.php'); - $a = new stdClass(); + $a = new stdclass(); $a->workshopname = clean_param($workshop->name, PARAM_NOTAGS); $item = array(); @@ -349,11 +349,11 @@ function workshop_grade_item_update(stdClass $workshop, $submissiongrades=null, * * Needed by grade_update_mod_grades() in lib/gradelib.php * - * @param stdClass $workshop instance object with extra cmidnumber and modname property + * @param stdclass $workshop instance object with extra cmidnumber and modname property * @param int $userid update grade of specific user only, 0 means all participants * @return void */ -function workshop_update_grades(stdClass $workshop, $userid=0) { +function workshop_update_grades(stdclass $workshop, $userid=0) { global $CFG, $DB; require_once($CFG->libdir.'/gradelib.php'); @@ -365,7 +365,7 @@ function workshop_update_grades(stdClass $workshop, $userid=0) { $records = $DB->get_records_sql($sql, $params); $submissiongrades = array(); foreach ($records as $record) { - $grade = new stdClass(); + $grade = new stdclass(); $grade->userid = $record->authorid; if (!is_null($record->gradeover)) { $grade->rawgrade = grade_floatval($workshop->grade * $record->gradeover / 100); @@ -388,7 +388,7 @@ function workshop_update_grades(stdClass $workshop, $userid=0) { $records = $DB->get_records_sql($sql, $params); $assessmentgrades = array(); foreach ($records as $record) { - $grade = new stdClass(); + $grade = new stdclass(); $grade->userid = $record->userid; $grade->rawgrade = grade_floatval($workshop->gradinggrade * $record->gradinggrade / 100); $grade->dategraded = $record->timegraded; @@ -408,9 +408,9 @@ function workshop_update_grades(stdClass $workshop, $userid=0) { * The file area workshop_intro for the activity introduction field is added automatically * by {@link file_browser::get_file_info_module()} * - * @param stdClass $course - * @param stdClass $cm - * @param stdClass $context + * @param stdclass $course + * @param stdclass $cm + * @param stdclass $context * @return array of [(string)filearea] => (string)description */ function workshop_get_file_areas($course, $cm, $context) { @@ -434,9 +434,9 @@ function workshop_get_file_areas($course, $cm, $context) { * Besides that, areas workshop_instructauthors and workshop_instructreviewers contain the media * embedded using the mod_form.php. * - * @param stdClass $course - * @param stdClass $cminfo - * @param stdClass $context + * @param stdclass $course + * @param stdclass $cminfo + * @param stdclass $context * @param string $filearea * @param array $args * @param bool $forcedownload @@ -567,16 +567,16 @@ function workshop_pluginfile($course, $cminfo, $context, $filearea, array $args, /** * File browsing support for workshop file areas * - * @param stdClass $browser - * @param stdClass $areas - * @param stdClass $course - * @param stdClass $cm - * @param stdClass $context + * @param stdclass $browser + * @param stdclass $areas + * @param stdclass $course + * @param stdclass $cm + * @param stdclass $context * @param string $filearea * @param int $itemid * @param string $filepath * @param string $filename - * @return stdClass file_info instance or null if not found + * @return stdclass file_info instance or null if not found */ function workshop_get_file_info($browser, $areas, $course, $cm, $context, $filearea, $itemid, $filepath, $filename) { global $CFG, $DB; @@ -672,11 +672,11 @@ function workshop_get_file_info($browser, $areas, $course, $cm, $context, $filea * This can be called by an AJAX request so do not rely on $PAGE as it might not be set up properly. * * @param navigation_node $navref An object representing the navigation tree node of the workshop module instance - * @param stdClass $course - * @param stdClass $module - * @param stdClass $cm + * @param stdclass $course + * @param stdclass $module + * @param stdclass $cm */ -function workshop_extend_navigation(navigation_node $navref, stdClass $course, stdClass $module, stdClass $cm) { +function workshop_extend_navigation(navigation_node $navref, stdclass $course, stdclass $module, stdclass $cm) { global $CFG; if (has_capability('mod/workshop:submit', $cm->context)) { @@ -693,10 +693,10 @@ function workshop_extend_navigation(navigation_node $navref, stdClass $course, s * so it is safe to rely on the $PAGE. * * @param settings_navigation $settingsnav {@link settings_navigation} - * @param stdClass $module + * @param stdclass $module * @return void|mixed The key to the modules branch */ -function workshop_extend_settings_navigation(settings_navigation $settingsnav, stdClass $module=null) { +function workshop_extend_settings_navigation(settings_navigation $settingsnav, stdclass $module=null) { global $CFG, $PAGE; $workshopkey = $settingsnav->add(get_string('workshopadministration', 'workshop')); diff --git a/mod/workshop/locallib.php b/mod/workshop/locallib.php index 1ebd09f15776a..22650a15d1fe5 100644 --- a/mod/workshop/locallib.php +++ b/mod/workshop/locallib.php @@ -58,13 +58,13 @@ class workshop { const EXAMPLES_BEFORE_SUBMISSION = 1; const EXAMPLES_BEFORE_ASSESSMENT = 2; - /** @var stdClass course module record */ + /** @var stdclass course module record */ public $cm = null; - /** @var stdClass course record */ + /** @var stdclass course record */ public $course = null; - /** @var stdClass context object */ + /** @var stdclass context object */ public $context = null; /** @@ -85,12 +85,12 @@ class workshop { * Makes deep copy of all passed records properties. Replaces integer $course attribute * with a full database record (course should not be stored in instances table anyway). * - * @param stdClass $dbrecord Workshop instance data from {workshop} table - * @param stdClass $cm Course module record as returned by {@link get_coursemodule_from_id()} - * @param stdClass $course Course record from {course} table - * @param stdClass $context The context of the workshop instance + * @param stdclass $dbrecord Workshop instance data from {workshop} table + * @param stdclass $cm Course module record as returned by {@link get_coursemodule_from_id()} + * @param stdclass $course Course record from {course} table + * @param stdclass $context The context of the workshop instance */ - public function __construct(stdClass $dbrecord, stdClass $cm, stdClass $course, stdClass $context=null) { + public function __construct(stdclass $dbrecord, stdclass $cm, stdclass $course, stdclass $context=null) { foreach ($dbrecord as $field => $value) { $this->{$field} = $value; } @@ -135,10 +135,10 @@ public static function installed_allocators() { /** * Returns an array of options for the editors that are used for submitting and assessing instructions * - * @param stdClass $context + * @param stdclass $context * @return array */ - public static function instruction_editors_options(stdClass $context) { + public static function instruction_editors_options(stdclass $context) { return array('subdirs' => 1, 'maxbytes' => 0, 'maxfiles' => EDITOR_UNLIMITED_FILES, 'changeformat' => 1, 'context' => $context, 'noclean' => 1, 'trusttext' => 0); } @@ -246,7 +246,7 @@ public static function lcm($a, $b) { * * @todo handle with limits and groups * @param bool $musthavesubmission If true, return only users who have already submitted. All possible authors otherwise. - * @return array array[userid] => stdClass{->id ->lastname ->firstname} + * @return array array[userid] => stdclass{->id ->lastname ->firstname} */ public function get_potential_authors($musthavesubmission=true) { $users = get_users_by_capability($this->context, 'mod/workshop:submit', @@ -264,7 +264,7 @@ public function get_potential_authors($musthavesubmission=true) { * * @todo handle with limits and groups * @param bool $musthavesubmission If true, return only users who have already submitted. All possible users otherwise. - * @return array array[userid] => stdClass{->id ->lastname ->firstname} + * @return array array[userid] => stdclass{->id ->lastname ->firstname} */ public function get_potential_reviewers($musthavesubmission=false) { $users = get_users_by_capability($this->context, 'mod/workshop:peerassess', @@ -283,8 +283,8 @@ public function get_potential_reviewers($musthavesubmission=false) { * is set, returns only groups withing the course module grouping. Always returns group [0] with * all the given users. * - * @param array $users array[userid] => stdClass{->id ->lastname ->firstname} - * @return array array[groupid][userid] => stdClass{->id ->lastname ->firstname} + * @param array $users array[userid] => stdclass{->id ->lastname ->firstname} + * @return array array[groupid][userid] => stdclass{->id ->lastname ->firstname} */ public function get_grouped($users) { global $DB; @@ -382,7 +382,7 @@ public function get_submissions($authorid='all') { * Returns a submission record with the author's data * * @param int $id submission id - * @return stdClass + * @return stdclass */ public function get_submission_by_id($id) { global $DB; @@ -403,7 +403,7 @@ public function get_submission_by_id($id) { * Returns a submission submitted by the given author * * @param int $id author id - * @return stdClass|false + * @return stdclass|false */ public function get_submission_by_author($authorid) { global $DB; @@ -476,12 +476,12 @@ public function get_examples_for_reviewer($reviewerid) { /** * Prepares component containing summary of given example to be rendered * - * @param stdClass $example as returned by {@link workshop::get_examples_for_manager()} or {@link workshop::get_examples_for_reviewer()} - * @return stdClass component to be rendered + * @param stdclass $example as returned by {@link workshop::get_examples_for_manager()} or {@link workshop::get_examples_for_reviewer()} + * @return stdclass component to be rendered */ - public function prepare_example_summary(stdClass $example) { + public function prepare_example_summary(stdclass $example) { - $summary = new stdClass(); + $summary = new stdclass(); $summary->example = $example; if (is_null($example->grade)) { $summary->status = 'notgraded'; @@ -491,7 +491,7 @@ public function prepare_example_summary(stdClass $example) { $buttontext = get_string('reassess', 'workshop'); } - $summary->gradeinfo = new stdClass(); + $summary->gradeinfo = new stdclass(); $summary->gradeinfo->received = $this->real_grade($example->grade); $summary->gradeinfo->max = $this->real_grade(100); @@ -506,10 +506,10 @@ public function prepare_example_summary(stdClass $example) { /** * Removes the submission and all relevant data * - * @param stdClass $submission record to delete + * @param stdclass $submission record to delete * @return void */ - public function delete_submission(stdClass $submission) { + public function delete_submission(stdclass $submission) { global $DB; $assessments = $DB->get_records('workshop_assessments', array('submissionid' => $submission->id), '', 'id'); $this->delete_assessment(array_keys($assessments)); @@ -523,7 +523,7 @@ public function delete_submission(stdClass $submission) { * tables. The returned object does not contain textual fields (ie comments) to prevent memory * lack issues. * - * @return array [assessmentid] => assessment stdClass + * @return array [assessmentid] => assessment stdclass */ public function get_all_assessments() { global $DB; @@ -548,7 +548,7 @@ public function get_all_assessments() { * Get the complete information about the given assessment * * @param int $id Assessment ID - * @return mixed false if not found, stdClass otherwise + * @return mixed false if not found, stdclass otherwise */ public function get_assessment_by_id($id) { global $DB; @@ -595,13 +595,13 @@ public function get_assessments_by_reviewer($reviewerid) { /** * Allocate a submission to a user for review * - * @param stdClass $submission Submission object with at least id property + * @param stdclass $submission Submission object with at least id property * @param int $reviewerid User ID * @param bool $bulk repeated inserts into DB expected * @param int $weight of the new assessment, from 0 to 16 * @return int ID of the new assessment or an error code */ - public function add_allocation(stdClass $submission, $reviewerid, $bulk=false, $weight=1) { + public function add_allocation(stdclass $submission, $reviewerid, $bulk=false, $weight=1) { global $DB; if ($DB->record_exists('workshop_assessments', array('submissionid' => $submission->id, 'reviewerid' => $reviewerid))) { @@ -609,7 +609,7 @@ public function add_allocation(stdClass $submission, $reviewerid, $bulk=false, $ } $now = time(); - $assessment = new stdClass(); + $assessment = new stdclass(); $assessment->submissionid = $submission->id; $assessment->reviewerid = $reviewerid; $assessment->timecreated = $now; @@ -642,7 +642,7 @@ public function delete_assessment($id) { /** * Returns instance of grading strategy class * - * @return stdClass Instance of a grading strategy + * @return stdclass Instance of a grading strategy */ public function grading_strategy_instance() { global $CFG; // because we require other libs here @@ -666,7 +666,7 @@ public function grading_strategy_instance() { /** * Returns instance of grading evaluation class * - * @return stdClass Instance of a grading evaluation + * @return stdclass Instance of a grading evaluation */ public function grading_evaluation_instance() { global $CFG; // because we require other libs here @@ -691,7 +691,7 @@ public function grading_evaluation_instance() { * Returns instance of submissions allocator * * @param string $method The name of the allocation method, must be PARAM_ALPHA - * @return stdClass Instance of submissions allocator + * @return stdclass Instance of submissions allocator */ public function allocator_instance($method) { global $CFG; // because we require other libs here @@ -924,8 +924,8 @@ public function grades_available() { * Prepare an individual workshop plan for the given user. * * @param int $userid whom the plan is prepared for - * @param stdClass context of the planned workshop - * @return stdClass data object to be passed to the renderer + * @param stdclass context of the planned workshop + * @return stdclass data object to be passed to the renderer */ public function prepare_user_plan($userid) { global $DB; @@ -933,25 +933,25 @@ public function prepare_user_plan($userid) { $phases = array(); // Prepare tasks for the setup phase - $phase = new stdClass(); + $phase = new stdclass(); $phase->title = get_string('phasesetup', 'workshop'); $phase->tasks = array(); if (has_capability('moodle/course:manageactivities', $this->context, $userid)) { - $task = new stdClass(); + $task = new stdclass(); $task->title = get_string('taskintro', 'workshop'); $task->link = $this->updatemod_url(); $task->completed = !(trim(strip_tags($this->intro)) == ''); $phase->tasks['intro'] = $task; } if (has_capability('moodle/course:manageactivities', $this->context, $userid)) { - $task = new stdClass(); + $task = new stdclass(); $task->title = get_string('taskinstructauthors', 'workshop'); $task->link = $this->updatemod_url(); $task->completed = !(trim(strip_tags($this->instructauthors)) == ''); $phase->tasks['instructauthors'] = $task; } if (has_capability('mod/workshop:editdimensions', $this->context, $userid)) { - $task = new stdClass(); + $task = new stdclass(); $task->title = get_string('editassessmentform', 'workshop'); $task->link = $this->editform_url(); if ($this->grading_strategy_instance()->form_ready()) { @@ -962,7 +962,7 @@ public function prepare_user_plan($userid) { $phase->tasks['editform'] = $task; } if ($this->useexamples and has_capability('mod/workshop:manageexamples', $this->context, $userid)) { - $task = new stdClass(); + $task = new stdclass(); $task->title = get_string('prepareexamples', 'workshop'); if ($DB->count_records('workshop_submissions', array('example' => 1, 'workshopid' => $this->id)) > 0) { $task->completed = true; @@ -974,7 +974,7 @@ public function prepare_user_plan($userid) { if (empty($phase->tasks) and $this->phase == self::PHASE_SETUP) { // if we are in the setup phase and there is no task (typical for students), let us // display some explanation what is going on - $task = new stdClass(); + $task = new stdclass(); $task->title = get_string('undersetup', 'workshop'); $task->completed = 'info'; $phase->tasks['setupinfo'] = $task; @@ -982,12 +982,12 @@ public function prepare_user_plan($userid) { $phases[self::PHASE_SETUP] = $phase; // Prepare tasks for the submission phase - $phase = new stdClass(); + $phase = new stdclass(); $phase->title = get_string('phasesubmission', 'workshop'); $phase->tasks = array(); if (($this->usepeerassessment or $this->useselfassessment) and has_capability('moodle/course:manageactivities', $this->context, $userid)) { - $task = new stdClass(); + $task = new stdclass(); $task->title = get_string('taskinstructreviewers', 'workshop'); $task->link = $this->updatemod_url(); if (trim(strip_tags($this->instructreviewers))) { @@ -998,7 +998,7 @@ public function prepare_user_plan($userid) { $phase->tasks['instructreviewers'] = $task; } if (has_capability('mod/workshop:submit', $this->context, $userid, false)) { - $task = new stdClass(); + $task = new stdclass(); $task->title = get_string('tasksubmit', 'workshop'); $task->link = $this->submission_url(); if ($DB->record_exists('workshop_submissions', array('workshopid'=>$this->id, 'example'=>0, 'authorid'=>$userid))) { @@ -1011,7 +1011,7 @@ public function prepare_user_plan($userid) { $phase->tasks['submit'] = $task; } if (has_capability('mod/workshop:allocate', $this->context, $userid)) { - $task = new stdClass(); + $task = new stdclass(); $task->title = get_string('allocate', 'workshop'); $task->link = $this->allocation_url(); $numofauthors = count(get_users_by_capability($this->context, 'mod/workshop:submit', 'u.id', '', '', '', @@ -1032,7 +1032,7 @@ public function prepare_user_plan($userid) { } else { $task->completed = null; // still has a chance to allocate } - $a = new stdClass(); + $a = new stdclass(); $a->expected = $numofauthors; $a->submitted = $numofsubmissions; $a->allocate = $numnonallocated; @@ -1041,7 +1041,7 @@ public function prepare_user_plan($userid) { $phase->tasks['allocate'] = $task; if ($numofsubmissions < $numofauthors and $this->phase >= self::PHASE_SUBMISSION) { - $task = new stdClass(); + $task = new stdclass(); $task->title = get_string('someuserswosubmission', 'workshop'); $task->completed = 'info'; $phase->tasks['allocateinfo'] = $task; @@ -1050,7 +1050,7 @@ public function prepare_user_plan($userid) { $phases[self::PHASE_SUBMISSION] = $phase; // Prepare tasks for the peer-assessment phase (includes eventual self-assessments) - $phase = new stdClass(); + $phase = new stdclass(); $phase->title = get_string('phaseassessment', 'workshop'); $phase->tasks = array(); $phase->isreviewer = has_capability('mod/workshop:peerassess', $this->context, $userid); @@ -1074,13 +1074,13 @@ public function prepare_user_plan($userid) { } unset($a); if ($this->usepeerassessment and $numofpeers) { - $task = new stdClass(); + $task = new stdclass(); if ($numofpeerstodo == 0) { $task->completed = true; } elseif ($this->phase > self::PHASE_ASSESSMENT) { $task->completed = false; } - $a = new stdClass(); + $a = new stdclass(); $a->total = $numofpeers; $a->todo = $numofpeerstodo; $task->title = get_string('taskassesspeers', 'workshop'); @@ -1089,7 +1089,7 @@ public function prepare_user_plan($userid) { $phase->tasks['assesspeers'] = $task; } if ($this->useselfassessment and $numofself) { - $task = new stdClass(); + $task = new stdclass(); if ($numofselftodo == 0) { $task->completed = true; } elseif ($this->phase > self::PHASE_ASSESSMENT) { @@ -1101,16 +1101,16 @@ public function prepare_user_plan($userid) { $phases[self::PHASE_ASSESSMENT] = $phase; // Prepare tasks for the grading evaluation phase - $phase = new stdClass(); + $phase = new stdclass(); $phase->title = get_string('phaseevaluation', 'workshop'); $phase->tasks = array(); if (has_capability('mod/workshop:overridegrades', $this->context)) { $expected = count($this->get_potential_authors(false)); $calculated = $DB->count_records_select('workshop_submissions', 'workshopid = ? AND (grade IS NOT NULL OR gradeover IS NOT NULL)', array($this->id)); - $task = new stdClass(); + $task = new stdclass(); $task->title = get_string('calculatesubmissiongrades', 'workshop'); - $a = new stdClass(); + $a = new stdclass(); $a->expected = $expected; $a->calculated = $calculated; $task->details = get_string('calculatesubmissiongradesdetails', 'workshop', $a); @@ -1124,9 +1124,9 @@ public function prepare_user_plan($userid) { $expected = count($this->get_potential_reviewers(false)); $calculated = $DB->count_records_select('workshop_aggregations', 'workshopid = ? AND gradinggrade IS NOT NULL', array($this->id)); - $task = new stdClass(); + $task = new stdclass(); $task->title = get_string('calculategradinggrades', 'workshop'); - $a = new stdClass(); + $a = new stdclass(); $a->expected = $expected; $a->calculated = $calculated; $task->details = get_string('calculategradinggradesdetails', 'workshop', $a); @@ -1138,7 +1138,7 @@ public function prepare_user_plan($userid) { $phase->tasks['calculategradinggrade'] = $task; } elseif ($this->phase == self::PHASE_EVALUATION) { - $task = new stdClass(); + $task = new stdclass(); $task->title = get_string('evaluategradeswait', 'workshop'); $task->completed = 'info'; $phase->tasks['evaluateinfo'] = $task; @@ -1146,7 +1146,7 @@ public function prepare_user_plan($userid) { $phases[self::PHASE_EVALUATION] = $phase; // Prepare tasks for the "workshop closed" phase - todo - $phase = new stdClass(); + $phase = new stdclass(); $phase->title = get_string('phaseclosed', 'workshop'); $phase->tasks = array(); $phases[self::PHASE_CLOSED] = $phase; @@ -1176,7 +1176,7 @@ public function prepare_user_plan($userid) { if (has_capability('mod/workshop:switchphase', $this->context, $userid)) { foreach ($phases as $phasecode => $phase) { if (! $phase->active) { - $action = new stdClass(); + $action = new stdclass(); $action->type = 'switchphase'; $action->url = $this->switchphase_url($phasecode); $phase->actions[] = $action; @@ -1205,7 +1205,7 @@ public function switch_phase($newphase) { if (self::PHASE_CLOSED == $newphase) { // push the grades into the gradebook - $workshop = new stdClass(); + $workshop = new stdclass(); foreach ($this as $property => $value) { $workshop->{$property} = $value; } @@ -1232,7 +1232,7 @@ public function set_peer_grade($assessmentid, $grade) { if (is_null($grade)) { return false; } - $data = new stdClass(); + $data = new stdclass(); $data->id = $assessmentid; $data->grade = $grade; $DB->update_record('workshop_assessments', $data); @@ -1248,7 +1248,7 @@ public function set_peer_grade($assessmentid, $grade) { * @param int $perpage participants per page (for the pagination) * @param string $sortby lastname|firstname|submissiontitle|submissiongrade|gradinggrade * @param string $sorthow ASC|DESC - * @return stdClass data for the renderer + * @return stdclass data for the renderer */ public function prepare_grading_report($userid, $groups, $page, $perpage, $sortby, $sorthow) { global $DB; @@ -1306,7 +1306,7 @@ public function prepare_grading_report($userid, $groups, $page, $perpage, $sortb // get the user details for all participants to display foreach ($participants as $participant) { if (!isset($userinfo[$participant->userid])) { - $userinfo[$participant->userid] = new stdClass(); + $userinfo[$participant->userid] = new stdclass(); $userinfo[$participant->userid]->id = $participant->userid; $userinfo[$participant->userid]->firstname = $participant->firstname; $userinfo[$participant->userid]->lastname = $participant->lastname; @@ -1321,7 +1321,7 @@ public function prepare_grading_report($userid, $groups, $page, $perpage, $sortb // get the user details for all moderators (teachers) that have overridden a submission grade foreach ($submissions as $submission) { if (!isset($userinfo[$submission->gradeoverby])) { - $userinfo[$submission->gradeoverby] = new stdClass(); + $userinfo[$submission->gradeoverby] = new stdclass(); $userinfo[$submission->gradeoverby]->id = $submission->gradeoverby; $userinfo[$submission->gradeoverby]->firstname = $submission->overfirstname; $userinfo[$submission->gradeoverby]->lastname = $submission->overlastname; @@ -1344,7 +1344,7 @@ public function prepare_grading_report($userid, $groups, $page, $perpage, $sortb $reviewers = $DB->get_records_sql($sql, $params); foreach ($reviewers as $reviewer) { if (!isset($userinfo[$reviewer->reviewerid])) { - $userinfo[$reviewer->reviewerid] = new stdClass(); + $userinfo[$reviewer->reviewerid] = new stdclass(); $userinfo[$reviewer->reviewerid]->id = $reviewer->reviewerid; $userinfo[$reviewer->reviewerid]->firstname = $reviewer->firstname; $userinfo[$reviewer->reviewerid]->lastname = $reviewer->lastname; @@ -1370,7 +1370,7 @@ public function prepare_grading_report($userid, $groups, $page, $perpage, $sortb $reviewees = $DB->get_records_sql($sql, $params); foreach ($reviewees as $reviewee) { if (!isset($userinfo[$reviewee->authorid])) { - $userinfo[$reviewee->authorid] = new stdClass(); + $userinfo[$reviewee->authorid] = new stdclass(); $userinfo[$reviewee->authorid]->id = $reviewee->authorid; $userinfo[$reviewee->authorid]->firstname = $reviewee->firstname; $userinfo[$reviewee->authorid]->lastname = $reviewee->lastname; @@ -1407,7 +1407,7 @@ public function prepare_grading_report($userid, $groups, $page, $perpage, $sortb unset($submission); foreach($reviewers as $reviewer) { - $info = new stdClass(); + $info = new stdclass(); $info->userid = $reviewer->reviewerid; $info->assessmentid = $reviewer->assessmentid; $info->submissionid = $reviewer->submissionid; @@ -1421,7 +1421,7 @@ public function prepare_grading_report($userid, $groups, $page, $perpage, $sortb unset($reviewer); foreach($reviewees as $reviewee) { - $info = new stdClass(); + $info = new stdclass(); $info->userid = $reviewee->authorid; $info->assessmentid = $reviewee->assessmentid; $info->submissionid = $reviewee->submissionid; @@ -1438,7 +1438,7 @@ public function prepare_grading_report($userid, $groups, $page, $perpage, $sortb $grade->gradinggrade = $this->real_grading_grade($grade->gradinggrade); } - $data = new stdClass(); + $data = new stdclass(); $data->grades = $grades; $data->userinfo = $userinfo; $data->totalcount = $numofparticipants; @@ -1625,11 +1625,11 @@ public function aggregate_grading_grades($restrict=null) { * * @return workshop_feedbackreviewer_form */ - public function get_feedbackreviewer_form(moodle_url $actionurl, stdClass $assessment, $editable=true) { + public function get_feedbackreviewer_form(moodle_url $actionurl, stdclass $assessment, $editable=true) { global $CFG; require_once(dirname(__FILE__) . '/feedbackreviewer_form.php'); - $current = new stdClass(); + $current = new stdclass(); $current->asid = $assessment->id; $current->gradinggrade = $this->real_grading_grade($assessment->gradinggrade); $current->gradinggradeover = $this->real_grading_grade($assessment->gradinggradeover); @@ -1652,11 +1652,11 @@ public function get_feedbackreviewer_form(moodle_url $actionurl, stdClass $asses * * @return workshop_feedbackauthor_form */ - public function get_feedbackauthor_form(moodle_url $actionurl, stdClass $submission, $editable=true) { + public function get_feedbackauthor_form(moodle_url $actionurl, stdclass $submission, $editable=true) { global $CFG; require_once(dirname(__FILE__) . '/feedbackauthor_form.php'); - $current = new stdClass(); + $current = new stdclass(); $current->submissionid = $submission->id; $current->grade = $this->real_grade($submission->grade); $current->gradeover = $this->real_grade($submission->gradeover); @@ -1684,7 +1684,7 @@ public function get_feedbackauthor_form(moodle_url $actionurl, stdClass $submiss * This calculates the weighted mean of the passed assessment grades. If, however, the submission grade * was overridden by a teacher, the gradeover value is returned and the rest of grades are ignored. * - * @param array $assessments of stdClass(->submissionid ->submissiongrade ->gradeover ->weight ->grade) + * @param array $assessments of stdclass(->submissionid ->submissiongrade ->gradeover ->weight ->grade) * @return void */ protected function aggregate_submission_grades_process(array $assessments) { @@ -1722,7 +1722,7 @@ protected function aggregate_submission_grades_process(array $assessments) { // check if the new final grade differs from the one stored in the database if (grade_floats_different($finalgrade, $current)) { // we need to save new calculation into the database - $record = new stdClass(); + $record = new stdclass(); $record->id = $submissionid; $record->grade = $finalgrade; $record->timegraded = time(); @@ -1736,7 +1736,7 @@ protected function aggregate_submission_grades_process(array $assessments) { * This calculates the simple mean of the passed grading grades. If, however, the grading grade * was overridden by a teacher, the gradinggradeover value is returned and the rest of grades are ignored. * - * @param array $assessments of stdClass(->reviewerid ->gradinggrade ->gradinggradeover ->aggregationid ->aggregatedgrade) + * @param array $assessments of stdclass(->reviewerid ->gradinggrade ->gradinggradeover ->aggregationid ->aggregatedgrade) * @return void */ protected function aggregate_grading_grades_process(array $assessments) { @@ -1781,14 +1781,14 @@ protected function aggregate_grading_grades_process(array $assessments) { // we need to save new calculation into the database if (is_null($agid)) { // no aggregation record yet - $record = new stdClass(); + $record = new stdclass(); $record->workshopid = $this->id; $record->userid = $reviewerid; $record->gradinggrade = $finalgrade; $record->timegraded = time(); $DB->insert_record('workshop_aggregations', $record); } else { - $record = new stdClass(); + $record = new stdclass(); $record->id = $agid; $record->gradinggrade = $finalgrade; $record->timegraded = time(); diff --git a/mod/workshop/renderer.php b/mod/workshop/renderer.php index a3bdba0a09120..872e11ef7d184 100644 --- a/mod/workshop/renderer.php +++ b/mod/workshop/renderer.php @@ -41,7 +41,7 @@ class mod_workshop_renderer extends plugin_renderer_base { * @param string $message to display * @return string html */ - public function status_message(stdClass $message) { + public function status_message(stdclass $message) { if (empty($message->text)) { return ''; } @@ -68,7 +68,7 @@ public function status_message(stdClass $message) { * @return string html to be echoed */ public function allocation_init_result($result='') { - $msg = new stdClass(); + $msg = new stdclass(); if ($result === workshop::ALLOCATION_ERROR) { $msg = (object)array('text' => get_string('allocationerror', 'workshop'), 'sty' => 'error'); } else { @@ -99,11 +99,11 @@ public function allocation_init_result($result='') { * The passed submission object must define at least: id, title, timecreated, timemodified, * authorid, authorfirstname, authorlastname, authorpicture and authorimagealt * - * @param stdClass $submission The submission record + * @param stdclass $submission The submission record * @param bool $showauthorname Should the author name be displayed * @return string html to be echoed */ - public function submission_summary(stdClass $submission, $showauthorname=false) { + public function submission_summary(stdclass $submission, $showauthorname=false) { global $CFG; $o = ''; // output HTML code @@ -119,7 +119,7 @@ public function submission_summary(stdClass $submission, $showauthorname=false) $link->set_classes('title'); $o .= $this->output->link($link); if ($showauthorname) { - $author = new stdClass(); + $author = new stdclass(); $author->id = $submission->authorid; $author->firstname = $submission->authorfirstname; $author->lastname = $submission->authorlastname; @@ -133,7 +133,7 @@ public function submission_summary(stdClass $submission, $showauthorname=false) $userpic = $this->output->user_picture($userpic); $userurl = new moodle_url($CFG->wwwroot . '/user/view.php', array('id' => $author->id, 'course' => $this->page->course->id)); - $a = new stdClass(); + $a = new stdclass(); $a->name = fullname($author); $a->url = $userurl->out(); $byfullname = get_string('byfullname', 'workshop', $a); @@ -158,11 +158,11 @@ public function submission_summary(stdClass $submission, $showauthorname=false) * * By default, this looks similar to a forum post. * - * @param stdClass $submission The submission data + * @param stdclass $submission The submission data * @param bool $showauthorname Should the author name be displayed * @return string html to be echoed */ - public function submission_full(stdClass $submission, $showauthorname=false) { + public function submission_full(stdclass $submission, $showauthorname=false) { global $CFG; $o = ''; // output HTML code @@ -174,7 +174,7 @@ public function submission_full(stdClass $submission, $showauthorname=false) { $o .= $this->output->container_start('header'); $o .= $this->output->heading(format_string($submission->title), 3, 'title'); if ($showauthorname) { - $author = new stdClass(); + $author = new stdclass(); $author->id = $submission->authorid; $author->firstname = $submission->authorfirstname; $author->lastname = $submission->authorlastname; @@ -188,7 +188,7 @@ public function submission_full(stdClass $submission, $showauthorname=false) { $userpic = $this->output->user_picture($userpic); $userurl = new moodle_url($CFG->wwwroot . '/user/view.php', array('id' => $author->id, 'course' => $this->page->course->id)); - $a = new stdClass(); + $a = new stdclass(); $a->name = fullname($author); $a->url = $userurl->out(); $byfullname = get_string('byfullname', 'workshop', $a); @@ -223,11 +223,11 @@ public function submission_full(stdClass $submission, $showauthorname=false) { * If format==html, then format a html string. If format==text, then format a text-only string. * Otherwise, returns html for non-images and html to display the image inline. * - * @param stdClass $submission Submission record + * @param stdclass $submission Submission record * @param string format The format of the returned string * @return string HTML code to be echoed */ - public function submission_attachments(stdClass $submission, $format=null) { + public function submission_attachments(stdclass $submission, $format=null) { global $CFG; require_once($CFG->libdir.'/filelib.php'); @@ -294,10 +294,10 @@ public function submission_attachments(stdClass $submission, $format=null) { * * The passed submission object must define at least: id and title * - * @param stdClass $data prepared by workshop::prepare_example_summary() + * @param stdclass $data prepared by workshop::prepare_example_summary() * @return string html to be echoed */ - public function example_summary(stdClass $summary) { + public function example_summary(stdclass $summary) { global $CFG; $o = ''; // output HTML code @@ -346,10 +346,10 @@ public function example_summary(stdClass $summary) { * * By default, this looks similar to a forum post. * - * @param stdClass $example The example submission data + * @param stdclass $example The example submission data * @return string html to be echoed */ - public function example_full(stdClass $example) { + public function example_full(stdclass $example) { global $CFG; $o = ''; // output HTML code @@ -430,7 +430,7 @@ public function user_plan(array $plan) { /** * Renders the tasks for the single phase in the user plan * - * @param stdClass $tasks + * @param stdclass $tasks * @return string html code */ protected function user_plan_tasks(array $tasks) { @@ -469,12 +469,12 @@ protected function user_plan_tasks(array $tasks) { * Grades must be already rounded to the set number of decimals or must be null (in which later case, * the [[nullgrade]] string shall be displayed). * - * @param stdClass $data prepared by {@link workshop::prepare_grading_report()} - * @param stdClass $options display options object with properties ->showauthornames ->showreviewernames ->sortby ->sorthow + * @param stdclass $data prepared by {@link workshop::prepare_grading_report()} + * @param stdclass $options display options object with properties ->showauthornames ->showreviewernames ->sortby ->sorthow * ->showsubmissiongrade ->showgradinggrade * @return string html code */ - public function grading_report(stdClass $data, stdClass $options) { + public function grading_report(stdclass $data, stdclass $options) { $grades = $data->grades; $userinfo = $data->userinfo; @@ -654,11 +654,11 @@ protected function sortable_heading($text, $sortid=null, $sortby=null, $sorthow= } /** - * @param stdClass $participant + * @param stdclass $participant * @param array $userinfo * @return string */ - protected function grading_report_participant(stdClass $participant, array $userinfo) { + protected function grading_report_participant(stdclass $participant, array $userinfo) { $userid = $participant->userid; $pic = new moodle_user_picture(); $pic->user = $userinfo[$userid]; @@ -673,10 +673,10 @@ protected function grading_report_participant(stdClass $participant, array $user } /** - * @param stdClass $participant + * @param stdclass $participant * @return string */ - protected function grading_report_submission(stdClass $participant) { + protected function grading_report_submission(stdclass $participant) { global $CFG; if (is_null($participant->submissionid)) { @@ -695,7 +695,7 @@ protected function grading_report_submission(stdClass $participant) { /** * @todo Highlight the nulls - * @param stdClass|null $assessment + * @param stdclass|null $assessment * @param bool $shownames * @param string $separator between the grade and the reviewer/author * @return string @@ -706,7 +706,7 @@ protected function grading_report_assessment($assessment, $shownames, array $use if (is_null($assessment)) { return get_string('nullgrade', 'workshop'); } - $a = new stdClass(); + $a = new stdclass(); $a->grade = is_null($assessment->grade) ? get_string('nullgrade', 'workshop') : $assessment->grade; $a->gradinggrade = is_null($assessment->gradinggrade) ? get_string('nullgrade', 'workshop') : $assessment->gradinggrade; $a->weight = $assessment->weight; @@ -754,7 +754,7 @@ protected function grading_report_assessment($assessment, $shownames, array $use * Formats the aggreagated grades */ protected function grading_report_grade($grade, $over=null) { - $a = new stdClass(); + $a = new stdclass(); $a->grade = is_null($grade) ? get_string('nullgrade', 'workshop') : $grade; if (is_null($over)) { $text = get_string('formataggregatedgrade', 'workshop', $a); @@ -791,7 +791,7 @@ protected static function array_nth(array $a, $n) { * @return string fl|lf */ protected static function fullname_format() { - $fake = new stdClass(); // fake user + $fake = new stdclass(); // fake user $fake->lastname = 'LLLL'; $fake->firstname = 'FFFF'; $fullname = get_string('fullnamedisplay', '', $fake); diff --git a/mod/workshop/simpletest/testlocallib.php b/mod/workshop/simpletest/testlocallib.php index 3eed04ade0074..bd8fbe0cf779b 100644 --- a/mod/workshop/simpletest/testlocallib.php +++ b/mod/workshop/simpletest/testlocallib.php @@ -37,9 +37,9 @@ class testable_workshop extends workshop { public function __construct() { $this->id = 16; - $this->cm = new stdClass(); - $this->course = new stdClass(); - $this->context = new stdClass(); + $this->cm = new stdclass(); + $this->course = new stdclass(); + $this->context = new stdclass(); } public function aggregate_submission_grades_process(array $assessments) { @@ -213,7 +213,7 @@ public function test_aggregate_grading_grades_process_single_grade_new() { $batch = array(); $batch[] = (object)array('reviewerid'=>3, 'gradinggrade'=>82.87670, 'gradinggradeover'=>null, 'aggregationid'=>null, 'aggregatedgrade'=>null); // expectation - $expected = new stdClass(); + $expected = new stdclass(); $expected->workshopid = $this->workshop->id; $expected->userid = 3; $expected->gradinggrade = 82.87670; @@ -264,7 +264,7 @@ public function test_aggregate_grading_grades_process_multiple_grades_new() { $batch[] = (object)array('reviewerid'=>5, 'gradinggrade'=>87.34311, 'gradinggradeover'=>null, 'aggregationid'=>null, 'aggregatedgrade'=>null); $batch[] = (object)array('reviewerid'=>5, 'gradinggrade'=>51.12000, 'gradinggradeover'=>null, 'aggregationid'=>null, 'aggregatedgrade'=>null); // expectation - $expected = new stdClass(); + $expected = new stdclass(); $expected->workshopid = $this->workshop->id; $expected->userid = 5; $expected->gradinggrade = 79.3066; diff --git a/mod/workshop/submission.php b/mod/workshop/submission.php index 875ee2649d177..465cf4cd9e775 100644 --- a/mod/workshop/submission.php +++ b/mod/workshop/submission.php @@ -47,7 +47,7 @@ $submission = $workshop->get_submission_by_id($id); } else { // no submission specified if (!$submission = $workshop->get_submission_by_author($USER->id)) { - $submission = new stdClass(); + $submission = new stdclass(); $submission->id = null; $submission->authorid = $USER->id; } @@ -125,7 +125,7 @@ $feedbackform = $workshop->get_feedbackauthor_form($PAGE->url, $submission); if ($data = $feedbackform->get_data()) { $data = file_postupdate_standard_editor($data, 'feedbackauthor', array(), $workshop->context); - $record = new stdClass(); + $record = new stdclass(); $record->id = $submission->id; $record->gradeover = $workshop->raw_grade_value($data->gradeover, $workshop->grade); $record->gradeoverby = $USER->id; diff --git a/mod/workshop/view.php b/mod/workshop/view.php index 55144b420386d..aceb5d4d8ea6f 100644 --- a/mod/workshop/view.php +++ b/mod/workshop/view.php @@ -199,7 +199,7 @@ $pagingbar->pagevar = 'page'; // grading report display options - $reportopts = new stdClass(); + $reportopts = new stdclass(); $reportopts->showauthornames = $showauthornames; $reportopts->showreviewernames = $showreviewernames; $reportopts->sortby = $sortby; @@ -227,7 +227,7 @@ } else { $shownames = has_capability('mod/workshop:viewauthornames', $PAGE->context); foreach ($assessments as $assessment) { - $submission = new stdClass(); + $submission = new stdclass(); $submission->id = $assessment->submissionid; $submission->title = $assessment->submissiontitle; $submission->timecreated = $assessment->submissioncreated; @@ -289,7 +289,7 @@ $pagingbar->pagevar = 'page'; // grading report display options - $reportopts = new stdClass(); + $reportopts = new stdclass(); $reportopts->showauthornames = $showauthornames; $reportopts->showreviewernames = $showreviewernames; $reportopts->sortby = $sortby;