*
* 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();
$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) {
$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;
$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;
$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;
$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();
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();
/**
* 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
*
* @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'));
*
* @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');
*
* @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');
$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);
// 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));
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');
}
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);
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
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
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);
$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;
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);
* 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);
/**
* 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)) {
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
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;
/**
* 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) {
* 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();
return null;
}
- $average = new stdClass();
+ $average = new stdclass();
$average->dimgrades = array();
foreach ($sumdimgrades as $dimid => $sumdimgrade) {
$average->dimgrades[$dimid] = grade_floatval($sumdimgrade / $sumweights);
* 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) {
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);
}
}
$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);
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);
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);
$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;
}
* 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;
*
* @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;
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])) {
*
* 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';
$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) {
*/
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;
* 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;
/**
* 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)) {
/**
* 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)) {
$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);
/**
* 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.
* 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;
*
* @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;
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])) {
*
* 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';
$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;
*/
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;
* 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;
/**
* 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)) {
/**
* 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.
* 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);
* 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
* 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?
/**
* 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();
* 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;
*
* @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;
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])) {
*
* 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';
*/
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;
* 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;
/**
* 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)) {
/**
* 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)) {
$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);
* 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;
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);
* @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');
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])) {
*
* 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';
$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;
$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;
* 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;
* 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;
$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};
/**
* 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)) {
/**
* 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)) {
$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');
$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);
$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);
$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);
* 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');
* (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');
* @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;
* 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();
*
* 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');
$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);
$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;
* 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) {
* 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
/**
* 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;
* 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)) {
* 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'));
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;
/**
* 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;
}
/**
* 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);
}
*
* @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',
*
* @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',
* 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;
* 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;
* 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;
/**
* 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';
$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);
/**
* 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));
* 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;
* 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;
/**
* 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))) {
}
$now = time();
- $assessment = new stdClass();
+ $assessment = new stdclass();
$assessment->submissionid = $submission->id;
$assessment->reviewerid = $reviewerid;
$assessment->timecreated = $now;
/**
* 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
/**
* 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
* 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
* 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;
$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()) {
$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;
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;
$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))) {
$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))) {
$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', '', '', '',
} 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;
$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;
$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);
}
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');
$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) {
$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);
$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);
$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;
$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;
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;
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;
}
if (is_null($grade)) {
return false;
}
- $data = new stdClass();
+ $data = new stdclass();
$data->id = $assessmentid;
$data->grade = $grade;
$DB->update_record('workshop_assessments', $data);
* @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;
// 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;
// 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;
$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;
$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;
unset($submission);
foreach($reviewers as $reviewer) {
- $info = new stdClass();
+ $info = new stdclass();
$info->userid = $reviewer->reviewerid;
$info->assessmentid = $reviewer->assessmentid;
$info->submissionid = $reviewer->submissionid;
unset($reviewer);
foreach($reviewees as $reviewee) {
- $info = new stdClass();
+ $info = new stdclass();
$info->userid = $reviewee->authorid;
$info->assessmentid = $reviewee->assessmentid;
$info->submissionid = $reviewee->submissionid;
$grade->gradinggrade = $this->real_grading_grade($grade->gradinggrade);
}
- $data = new stdClass();
+ $data = new stdclass();
$data->grades = $grades;
$data->userinfo = $userinfo;
$data->totalcount = $numofparticipants;
*
* @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);
*
* @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);
* 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) {
// 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();
* 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) {
// 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();
* @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 '';
}
* @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 {
* 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
$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;
$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);
*
* 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
$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;
$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);
* 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');
*
* 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
*
* 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
/**
* 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) {
* 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;
}
/**
- * @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];
}
/**
- * @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)) {
/**
* @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
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;
* 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);
* @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);
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) {
$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;
$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;
$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;
}
$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;
$pagingbar->pagevar = 'page';
// grading report display options
- $reportopts = new stdClass();
+ $reportopts = new stdclass();
$reportopts->showauthornames = $showauthornames;
$reportopts->showreviewernames = $showreviewernames;
$reportopts->sortby = $sortby;
} 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;
$pagingbar->pagevar = 'page';
// grading report display options
- $reportopts = new stdClass();
+ $reportopts = new stdclass();
$reportopts->showauthornames = $showauthornames;
$reportopts->showreviewernames = $showreviewernames;
$reportopts->sortby = $sortby;