I do not agree with using object() class for no real reason.
* be used there. This should be changed once we make quickforms deprecated and then,
* this method will just return the required HTML code.
*
- * @param object $wsoutput workshop module renderer can be used
+ * @param stdClass $wsoutput workshop module renderer can be used
* @return void
*/
public function ui(moodle_mod_workshop_renderer $wsoutput);
$hlauthorid = -1; // highlight this author
$hlreviewerid = -1; // highlight this reviewer
- $msg = new object(); // message to render
+ $msg = new stdClass(); // message to render
- $m = optional_param('m', '', PARAM_ALPHANUMEXT); // message object
+ $m = optional_param('m', '', PARAM_ALPHANUMEXT); // message stdClass
if ($m) {
$m = explode('-', $m); // unserialize
switch ($m[0]) {
foreach ($rs as $allocation) {
$currentuserid = $allocation->authorid;
if (!isset($peer[$currentuserid])) {
- $peer[$currentuserid] = new object();
+ $peer[$currentuserid] = new stdClass();
$peer[$currentuserid]->id = $allocation->authorid;
$peer[$currentuserid]->firstname = $allocation->authorfirstname;
$peer[$currentuserid]->lastname = $allocation->authorlastname;
* @param array $peers prepared array of all allocations
* @param int $hlauthorid highlight this author
* @param int $hlreviewerid highlight this reviewer
- * @param object message to display
+ * @param stdClass $msg message to display
* @return string html code
*/
public function display_allocations(workshop $workshop, $peers, $hlauthorid=null, $hlreviewerid=null, $msg=null) {
/**
* Returns information about the workshop participant
*
- * @param object $user participant data
+ * @param stdClass $user participant data
* @return string HTML code
*/
- protected function participant(object $user) {
+ protected function participant(stdClass $user) {
$o = $this->output->user_picture($user, $this->page->course->id);
$o .= fullname($user);
$o .= $this->output->container_start(array('submission'));
/**
* Returns information about the current reviewers of the given participant and a selector do add new one
*
- * @param object $user participant data
+ * @param stdClass $user participant data
* @param workshop $workshop workshop record
* @param array $peers objects with properties to display picture and fullname
* @return string html code
*/
- protected function reviewers_of_participant(object $user, workshop $workshop, $peers) {
+ protected function reviewers_of_participant(stdClass $user, workshop $workshop, $peers) {
$o = '';
if (is_null($user->submissionid)) {
$o .= $this->output->output_tag('span', array('class' => 'info'), get_string('nothingtoreview', 'workshop'));
/**
* Returns information about the current reviewees of the given participant and a selector do add new one
*
- * @param object $user participant data
+ * @param stdClass $user participant data
* @param workshop $workshop workshop record
* @param array $peers objects with properties to display picture and fullname
* @return string html code
*/
- protected function reviewees_of_participant(object $user, workshop $workshop, $peers) {
+ protected function reviewees_of_participant(stdClass $user, workshop $workshop, $peers) {
$o = '';
if (is_null($user->submissionid)) {
$o .= $this->output->container(get_string('withoutsubmission', 'workshop'), 'info');
$this->add_new_allocations($newallocations, $authors, $reviewers);
foreach ($newallocations as $newallocation) {
list($reviewerid, $authorid) = each($newallocation);
- $a = new object();
+ $a = new stdClass();
$a->reviewername = fullname($reviewers[0][$reviewerid]);
$a->authorname = fullname($authors[0][$authorid]);
$o[] = 'ok::indent::' . get_string('allocationaddeddetail', 'workshop', $a);
// by reviewer
$o[] = 'info::' . get_string('numofdeallocatedassessment', 'workshop', count($delassessments));
foreach ($delassessments as $delassessmentkey => $delassessmentid) {
- $a = new object();
+ $a = new stdClass();
$a->authorname = fullname((object)array(
'lastname' => $assessments[$delassessmentid]->authorlastname,
'firstname' => $assessments[$delassessmentid]->authorfirstname));
global $OUTPUT;
$m = optional_param('m', null, PARAM_INT); // status message code
- $msg = new object();
+ $msg = new stdClass();
if ($m == WORKSHOP_ALLOCATION_RANDOM_MSG_SUCCESS) {
$msg = (object)array('text' => get_string('randomallocationdone', 'workshop'), 'sty' => 'ok');
}
public function test_self_allocation_equal_user_groups() {
// fixture setup
- $authors = array(0 => array_fill_keys(array(4, 6, 10), new object()));
- $reviewers = array(0 => array_fill_keys(array(4, 6, 10), new object()));
+ $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
public function test_self_allocation_different_user_groups() {
// fixture setup
- $authors = array(0 => array_fill_keys(array(1, 4, 5, 10, 13), new object()));
- $reviewers = array(0 => array_fill_keys(array(4, 7, 10), new object()));
+ $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
public function test_self_allocation_skip_existing() {
// fixture setup
- $authors = array(0 => array_fill_keys(array(3, 4, 10), new object()));
- $reviewers = array(0 => array_fill_keys(array(3, 4, 10), new object()));
+ $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);
$cm = get_coursemodule_from_id('workshop', $preview, 0, false, MUST_EXIST);
$course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST);
$workshop = $DB->get_record('workshop', array('id' => $cm->instance), '*', MUST_EXIST);
- $submission = new object();
- $assessment = new object();
+ $submission = new stdClass();
+ $assessment = new stdClass();
} else {
$mode = 'assessment';
$c = 0; // counter
foreach ($authors as $authorid => $author) {
$timenow = time() - rand(0, 60 * 60 * 24 * 7); // submitted sometimes during last week
- $submission = new object();
+ $submission = new stdClass();
$submission->workshopid = $workshop->id;
$submission->example = 0;
$submission->userid = $authorid;
* @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
*/
- public function get_assessment_form(moodle_url $actionurl=null, $mode='preview', object $assessment=null) {
+ public function get_assessment_form(moodle_url $actionurl=null, $mode='preview', stdClass $assessment=null) {
global $CFG; // needed because the included files use it
global $PAGE;
global $DB;
if ('assessment' === $mode and !empty($assessment)) {
// load the previously saved assessment data
$grades = $this->reindex_grades_by_dimension($this->get_current_assessment_data($assessment));
- $current = new object();
+ $current = new stdClass();
for ($i = 0; $i < $nodimensions; $i++) {
$dimid = $fields->{'dimensionid__idx_'.$i};
if (isset($grades[$dimid])) {
*
* This method processes data submitted using the form returned by {@link get_assessment_form()}
*
- * @param object $assessment Assessment being filled
- * @param object $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 Percentual grade for submission as suggested by the peer
*/
- public function save_assessment(object $assessment, object $data) {
+ public function save_assessment(stdClass $assessment, stdClass $data) {
global $DB;
if (!isset($data->strategyname) || ($data->strategyname != $this->name())) {
throw coding_expection('You did not send me the number of assessment dimensions to process');
}
for ($i = 0; $i < $data->nodims; $i++) {
- $grade = new object();
+ $grade = new stdClass();
$grade->id = $data->{'gradeid__idx_' . $i};
$grade->assessmentid = $assessment->id;
$grade->dimensionid = $data->{'dimensionid__idx_' . $i};
*/
protected function prepare_form_fields(array $raw) {
- $formdata = new object();
+ $formdata = new stdClass();
$key = 0;
foreach ($raw as $dimension) {
$formdata->{'dimensionid__idx_' . $key} = $dimension->id; // master id, not the local one!
protected function prepare_database_fields(stdClass $raw) {
global $PAGE;
- $cook = new object(); // to be returned
+ $cook = new stdClass(); // to be returned
$cook->forms = array(); // to be stored in {workshop_forms}
$cook->accumulative = array(); // to be stored in {workshop_forms_accumulative}
for ($i = 0; $i < $raw->norepeats; $i++) {
- $cook->forms[$i] = new object();
+ $cook->forms[$i] = new stdClass();
$cook->forms[$i]->id = $raw->{'dimensionid__idx_'.$i};
$cook->forms[$i]->workshopid = $this->workshop->id;
$cook->forms[$i]->sort = $i + 1;
$cook->forms[$i]->strategy = 'accumulative';
- $cook->accumulative[$i] = new object();
+ $cook->accumulative[$i] = new stdClass();
$cook->accumulative[$i]->description_editor = $raw->{'description__idx_'.$i.'_editor'};
$cook->accumulative[$i]->grade = $raw->{'grade__idx_'.$i};
$cook->accumulative[$i]->weight = $raw->{'weight__idx_'.$i};
/**
* Returns the list of current grades filled by the reviewer
*
- * @param object $assessment Assessment record
+ * @param stdClass $assessment Assessment record
* @return array of filtered records from the table workshop_grades
*/
- protected function get_current_assessment_data(object $assessment) {
+ protected function get_current_assessment_data(stdClass $assessment) {
global $DB;
// fetch all grades accociated with this assessment
/**
* Aggregates the assessment form data and sets the grade for the submission given by the peer
*
- * @param object $assessment Assessment record
+ * @param stdClass $assessment Assessment record
* @return float|null Percentual grade for submission as suggested by the peer
*/
- protected function update_peer_grade(object $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)) {
/**
* Add any strategy specific form fields.
*
- * @param object $mform the form being built.
+ * @param stdClass $mform the form being built.
*/
protected function definition_inner(&$mform) {
// By default, do nothing.
/**
* Add any strategy specific form fields.
*
- * @param object $mform the form being built.
+ * @param stdClass $mform the form being built.
*/
protected function definition_inner(&$mform) {
// By default, do nothing.
* 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 object 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);
*
* This method processes data submitted using the form returned by {@link get_assessment_form()}
*
- * @param object $assessment Assessment being filled
- * @param object $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|float Percentual grade for submission as suggested by the peer or null if impossible to count
*/
- public function save_assessment(object $assessment, object $data);
+ public function save_assessment(stdClass $assessment, 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
*/
- public function get_assessment_form(moodle_url $actionurl=null, $mode='preview', object $assessment=null) {
+ public function get_assessment_form(moodle_url $actionurl=null, $mode='preview', stdClass $assessment=null) {
global $CFG; // needed because the included files use it
global $PAGE;
global $DB;
if ('assessment' === $mode and !empty($assessment)) {
// load the previously saved assessment data
$grades = $this->reindex_grades_by_dimension($this->get_current_assessment_data($assessment));
- $current = new object();
+ $current = new stdClass();
for ($i = 0; $i < $nodimensions; $i++) {
$dimid = $fields->{'dimensionid__idx_'.$i};
if (isset($grades[$dimid])) {
*
* This method processes data submitted using the form returned by {@link get_assessment_form()}
*
- * @param object $assessment Assessment being filled
- * @param object $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 Percentual grade for submission as suggested by the peer
*/
- public function save_assessment(object $assessment, object $data) {
+ public function save_assessment(stdClass $assessment, stdClass $data) {
global $DB;
if (!isset($data->strategyname) || ($data->strategyname != $this->name())) {
throw coding_expection('You did not send me the number of assessment dimensions to process');
}
for ($i = 0; $i < $data->nodims; $i++) {
- $grade = new object();
+ $grade = new stdClass();
$grade->id = $data->{'gradeid__idx_' . $i};
$grade->assessmentid = $assessment->id;
$grade->dimensionid = $data->{'dimensionid__idx_' . $i};
* number of errors to a grade are saved into workshop_forms_noerrors_map.
*
* @uses $DB
- * @param object $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_form(object $data) {
+ public function save_form(stdClass $data) {
global $DB;
if (!isset($data->strategyname) || ($data->strategyname != $this->name())) {
*/
protected function prepare_form_fields(array $dims, array $maps) {
- $formdata = new object();
+ $formdata = new stdClass();
$key = 0;
foreach ($dims as $dimension) {
$formdata->{'dimensionid__idx_' . $key} = $dimension->id; // master id, not the local one!
protected function prepare_database_fields(stdClass $raw) {
global $PAGE;
- $cook = new object(); // to be returned
+ $cook = new stdClass(); // to be returned
$cook->forms = array(); // to be stored in {workshop_forms}
$cook->noerrors = array(); // to be stored in {workshop_forms_noerrors}
$cook->mappings = array(); // to be stored in {workshop_forms_noerrors_map}
for ($i = 0; $i < $raw->norepeats; $i++) {
- $cook->forms[$i] = new object();
+ $cook->forms[$i] = new stdClass();
$cook->forms[$i]->id = $raw->{'dimensionid__idx_'.$i};
$cook->forms[$i]->workshopid = $this->workshop->id;
$cook->forms[$i]->sort = $i + 1;
$cook->forms[$i]->strategy = 'noerrors';
- $cook->noerrors[$i] = new object();
+ $cook->noerrors[$i] = new stdClass();
$cook->noerrors[$i]->description_editor = $raw->{'description__idx_'.$i.'_editor'};
$cook->noerrors[$i]->grade0 = $raw->{'grade0__idx_'.$i};
$cook->noerrors[$i]->grade1 = $raw->{'grade1__idx_'.$i};
if (empty($raw->{'map__idx_'.$i})) {
$cook->mappings[$i] = null;
} else {
- $cook->mappings[$i] = new object();
+ $cook->mappings[$i] = new stdClass();
$cook->mappings[$i]->grade = $raw->{'map__idx_'.$i};
}
}
* will save a new instance and return the id number
* of the new instance.
*
- * @param object $data An object from the form in mod_form.php
+ * @param stdClass $data An object from the form in mod_form.php
* @return int The id of the newly inserted workshop record
*/
function workshop_add_instance($data) {
* (defined by the form in mod_form.php) this function
* will update an existing instance with new data.
*
- * @param object $workshop An object from the form in mod_form.php
+ * @param stdClass $workshop An object from the form in mod_form.php
* @return boolean Success/Fail
*/
function workshop_update_instance($workshop) {
* @todo Finish documenting this function
*/
function workshop_user_outline($course, $user, $mod, $workshop) {
- $return = new object();
+ $return = new stdClass();
$return->time = 0;
$return->info = '';
return $return;
* The file area workshop_intro for the activity introduction field is added automatically
* by {@link file_browser::get_file_info_module()}
*
- * @param object $course
- * @param object $cm
- * @param object $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) {
* The access rights to the files are checked here. The user must be either a peer-reviewer
* of the submission or have capability ... (todo) to access the submission files.
*
- * @param object $course
- * @param object $cminfo
- * @param object $context
+ * @param stdClass $course
+ * @param stdClass $cminfo
+ * @param stdClass $context
* @param string $filearea
* @param array $args
* @param bool $forcedownload
/**
* File browsing support for workshop file areas
*
- * @param object $browser
- * @param object $areas
- * @param object $course
- * @param object $cm
- * @param object $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 object 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;
* Each object in the returned array provides information about the name of the level
* and the value of the factor to be used in the calculation.
* The structure of the returned array is
- * array[code int] of object (
+ * array[code int] of stdClass (
* ->name string,
* ->value number,
* )
function workshop_get_comparison_levels() {
$levels = array();
- $levels[WORKSHOP_COMPARISON_VERYHIGH] = new object();
+ $levels[WORKSHOP_COMPARISON_VERYHIGH] = new stdClass();
$levels[WORKSHOP_COMPARISON_VERYHIGH]->name = get_string('comparisonveryhigh', 'workshop');
$levels[WORKSHOP_COMPARISON_VERYHIGH]->value = 5.00;
- $levels[WORKSHOP_COMPARISON_HIGH] = new object();
+ $levels[WORKSHOP_COMPARISON_HIGH] = new stdClass();
$levels[WORKSHOP_COMPARISON_HIGH]->name = get_string('comparisonhigh', 'workshop');
$levels[WORKSHOP_COMPARISON_HIGH]->value = 3.00;
- $levels[WORKSHOP_COMPARISON_NORMAL] = new object();
+ $levels[WORKSHOP_COMPARISON_NORMAL] = new stdClass();
$levels[WORKSHOP_COMPARISON_NORMAL]->name = get_string('comparisonnormal', 'workshop');
$levels[WORKSHOP_COMPARISON_NORMAL]->value = 2.50;
- $levels[WORKSHOP_COMPARISON_LOW] = new object();
+ $levels[WORKSHOP_COMPARISON_LOW] = new stdClass();
$levels[WORKSHOP_COMPARISON_LOW]->name = get_string('comparisonlow', 'workshop');
$levels[WORKSHOP_COMPARISON_LOW]->value = 1.67;
- $levels[WORKSHOP_COMPARISON_VERYLOW] = new object();
+ $levels[WORKSHOP_COMPARISON_VERYLOW] = new stdClass();
$levels[WORKSHOP_COMPARISON_VERYLOW]->name = get_string('comparisonverylow', 'workshop');
$levels[WORKSHOP_COMPARISON_VERYLOW]->value = 1.00;
*/
class workshop {
- /** @var object course module record */
+ /** @var stdClass course module record */
public $cm = null;
- /** @var object course record */
+ /** @var stdClass course record */
public $course = null;
/** grading strategy instance */
private $strategyinstance = null;
/**
- * Initializes the object using the data from DB
+ * Initializes the workshop API instance using the data from DB
*
* 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).
* The returned objects contain id, lastname and firstname properties and are ordered by lastname,firstname
*
* @param bool $musthavesubmission If true, return only users who have already submitted. All possible authors otherwise.
- * @return array array[userid] => object{->id ->lastname ->firstname}
+ * @return array array[userid] => stdClass{->id ->lastname ->firstname}
*/
public function get_peer_authors($musthavesubmission=true) {
global $DB;
*
* @param bool $musthavesubmission If true, return only users who have already submitted. All possible users otherwise.
* @see get_super_reviewers()
- * @return array array[userid] => object{->id ->lastname ->firstname}
+ * @return array array[userid] => stdClass{->id ->lastname ->firstname}
*/
public function get_peer_reviewers($musthavesubmission=false) {
global $DB;
*
* @param bool $musthavesubmission If true, return only users who have already submitted. All possible users otherwise.
* @see get_peer_reviewers()
- * @return array array[userid] => object{->id ->lastname ->firstname}
+ * @return array array[userid] => stdClass{->id ->lastname ->firstname}
*/
public function get_super_reviewers() {
global $DB;
* is set, returns only groups withing the course module grouping. Always returns group [0] with
* all the given users.
*
- * @param array $users array[userid] => object{->id ->lastname ->firstname}
- * @return array array[groupid][userid] => object{->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;
*
* @param mixed $userid int|array|'all' If set to [array of] integer, return submission[s] of the given user[s] only
* @param mixed $examples false|true|'all' Only regular submissions, only examples, all submissions
- * @return object moodle_recordset
+ * @return stdClass moodle_recordset
*/
public function get_submissions_recordset($userid='all', $examples=false) {
global $DB;
* include text fields (to prevent possible memory-lack issues).
*
* @param mixed $id integer|array author ID or IDs
- * @return mixed false if not found, object if $id is int, array if $id is array
+ * @return mixed false if not found, stdClass if $id is int, array if $id is array
*/
public function get_submission_by_author($id) {
if (empty($id)) {
if (is_array($id)) {
$submissions = array();
foreach ($rs as $submission) {
- $submissions[$submission->id] = new object();
+ $submissions[$submission->id] = new stdClass();
foreach ($submission as $property => $value) {
// we do not want text fields here to prevent possible memory issues
if (in_array($property, array('id', 'workshopid', 'example', 'userid', 'authorlastname', 'authorfirstname',
*
* @param mixed $reviewerid 'all'|int|array User ID of the reviewer
* @param mixed $id 'all'|int Assessment ID
- * @return object moodle_recordset
+ * @return stdClass moodle_recordset
*/
public function get_assessments_recordset($reviewerid='all', $id='all') {
global $DB;
*
* @param mixed $reviewerid 'all'|int|array User ID of the reviewer
* @param mixed $id 'all'|int Assessment ID
- * @return array [assessmentid] => assessment object
+ * @return array [assessmentid] => assessment stdClass
* @see workshop::get_assessments_recordset() for the structure of returned objects
*/
public function get_assessments($reviewerid='all', $id='all') {
foreach ($rs as $assessment) {
// copy selected properties into the array to be returned. This is here mainly in order not
// to include text comments.
- $assessments[$assessment->id] = new object();
+ $assessments[$assessment->id] = new stdClass();
foreach ($assessment as $property => $value) {
if (in_array($property, array('id', 'submissionid', 'userid', 'timecreated', 'timemodified',
'timeagreed', 'grade', 'gradinggrade', 'gradinggradeover', 'gradinggradeoverby',
*
* @param int $id Assessment ID
* @see workshop::get_assessments_recordset() for the structure of data returned
- * @return mixed false if not found, object otherwise
+ * @return mixed false if not found, stdClass otherwise
*/
public function get_assessment_by_id($id) {
$rs = $this->get_assessments_recordset('all', $id);
* Note that the returned recordset includes participants without submission as well as those
* without any review allocated yet.
*
- * @return object moodle_recordset
+ * @return stdClass moodle_recordset
*/
public function get_allocations_recordset() {
global $DB;
/**
* Allocate a submission to a user for review
*
- * @param object $submission Submission record
+ * @param stdClass $submission Submission record
* @param int $reviewerid User ID
* @param bool $bulk repeated inserts into DB expected
* @return int ID of the new assessment or an error code
*/
- public function add_allocation(object $submission, $reviewerid, $bulk=false) {
+ public function add_allocation(stdClass $submission, $reviewerid, $bulk=false) {
global $DB;
if ($DB->record_exists('workshop_assessments', array('submissionid' => $submission->id, 'userid' => $reviewerid))) {
}
$now = time();
- $assessment = new object();
+ $assessment = new stdClass();
$assessment->submissionid = $submission->id;
$assessment->userid = $reviewerid;
$assessment->timecreated = $now;
/**
* Returns instance of grading strategy class
*
- * @return object 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
/**
* Returns instance of submissions allocator
*
- * @param object $method The name of the allocation method, must be PARAM_ALPHA
- * @return object Instance of submissions allocator
+ * @param stdClass $method The name of the allocation method, must be PARAM_ALPHA
+ * @return stdClass Instance of submissions allocator
*/
public function allocator_instance($method) {
global $CFG; // because we require other libs here
}
/**
- * @return object {@link moodle_url} the URL of this workshop's view page
+ * @return stdClass {@link moodle_url} the URL of this workshop's view page
*/
public function view_url() {
global $CFG;
}
/**
- * @return object {@link moodle_url} the URL of the page for editing this workshop's grading form
+ * @return stdClass {@link moodle_url} the URL of the page for editing this workshop's grading form
*/
public function editform_url() {
global $CFG;
}
/**
- * @return object {@link moodle_url} the URL of the page for previewing this workshop's grading form
+ * @return stdClass {@link moodle_url} the URL of the page for previewing this workshop's grading form
*/
public function previewform_url() {
global $CFG;
/**
* @param int $assessmentid The ID of assessment record
- * @return object {@link moodle_url} the URL of the assessment page
+ * @return stdClass {@link moodle_url} the URL of the assessment page
*/
public function assess_url($assessmentid) {
global $CFG;
* Returns an object containing all data to display the user's full name and picture
*
* @param int $id optional user id, defaults to the current user
- * @return object containing properties lastname, firstname, picture and imagealt
+ * @return stdClass containing properties lastname, firstname, picture and imagealt
*/
public function user_info($id=null) {
global $USER, $DB;
* @param string $message to display
* @return string html
*/
- public function status_message(object $message) {
+ public function status_message(stdClass $message) {
if (empty($message->text)) {
return '';
}
* @return string html to be echoed
*/
public function allocation_init_result($result='') {
- $msg = new object();
+ $msg = new stdClass();
if ($result === 'WORKSHOP_ALLOCATION_RANDOM_ERROR') {
$msg = (object)array('text' => get_string('randomallocationerror', 'workshop'), 'sty' => 'error');
} else {
$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 object();
+ $a = new stdClass();
$a->name = fullname($author);
$a->url = $userurl->out();
$byfullname = get_string('byfullname', 'workshop', $a);
$submission = $DB->get_record('workshop_submissions', array('id' => $id, 'workshopid' => $workshop->id), '*', MUST_EXIST);
} else { // no submission specified
if (!$submission = $workshop->get_submission_by_author($USER->id)) {
- $submission = new object();
+ $submission = new stdClass();
$submission->id = null;
$submission->userid = $USER->id;
}