Skip to content

Commit

Permalink
CTP-3690 member var underscores
Browse files Browse the repository at this point in the history
  • Loading branch information
watson8 committed Sep 10, 2024
1 parent 9c7e06d commit 534d318
Show file tree
Hide file tree
Showing 13 changed files with 91 additions and 90 deletions.
4 changes: 2 additions & 2 deletions classes/forms/student_submission_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public function handle() {
$submission->courseworkid = $coursework->id;
$submission->createdby = $USER->id;
$submission->lastupdatedby = $USER->id;
$submission->submission_files = $data->submission_manager;
$submission->submissionfiles = $data->submission_manager;
$submission->manualsrscode = isset($data->manualsrscode) ? $data->manualsrscode : '';
$submission->save(); // Get an id.

Expand Down Expand Up @@ -170,7 +170,7 @@ public function handle() {
$DB->update_record('files', $fileinformation);

// Force submission to update file record.
$submission->submission_files = null;
$submission->submissionfiles = null;
$submission->get_submission_files(true);

if (!$submission->get_coursework()->has_deadline()) {
Expand Down
6 changes: 3 additions & 3 deletions classes/framework/table_base.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public function __construct($dbrecord = false) {
} else if (is_object($dbrecord) || is_array($dbrecord)) {
// Add all of the DB row fields to this object (if the object has a matching property).
$this->apply_data($dbrecord);
$this->data_loaded = true;
$this->dataloaded = true;
}
}

Expand Down Expand Up @@ -237,7 +237,7 @@ private static function ensure_column_exists($colname) {
public function __get($requestedpropertyname) {
static::ensure_column_exists($requestedpropertyname);

if (!$this->data_loaded) {
if (!$this->dataloaded) {
$this->reload(); // Will not set the variable if we have not saved the object yet
}

Expand Down Expand Up @@ -411,7 +411,7 @@ public function reload($complainifnotfound = true) {

if ($dbrecord) {
$this->apply_data($dbrecord);
$this->data_loaded = true;
$this->dataloaded = true;
}

return $this;
Expand Down
2 changes: 1 addition & 1 deletion classes/models/feedback.php
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ public static function fill_pool_submissions($courseworkid, $submissionids) {
];
if ($submissionids) {
list($submissionidsql, $submissionidparams) = $DB->get_in_or_equal($submissionids, SQL_PARAMS_NAMED);
$feedbacks = $DB->get_records_sql("SELECT * FROM {courseworkfeedbacks} WHERE submissionid $submissionidsql", $submissionidparams);
$feedbacks = $DB->get_records_sql("SELECT * FROM {coursework_feedbacks} WHERE submissionid $submissionidsql", $submissionidparams);
foreach ($feedbacks as $record) {
$object = new self($record);
$stageidentifier = $record->stage_identifier;
Expand Down
8 changes: 4 additions & 4 deletions classes/models/submission.php
Original file line number Diff line number Diff line change
Expand Up @@ -369,8 +369,8 @@ public function submit_plagiarism($type = null) {
*/
public function get_submission_files($reset = false) {

if (!$reset && $this->submission_files instanceof submission_files) {
return $this->submission_files;
if (!$reset && $this->submissionfiles instanceof submission_files) {
return $this->submissionfiles;
}

if ($this->id < 1 || $this->get_context_id() < 1) {
Expand All @@ -380,9 +380,9 @@ public function get_submission_files($reset = false) {
$submissionfiles = $this->get_files();

if ($submissionfiles) {
$this->submission_files = new submission_files($submissionfiles, $this);
$this->submissionfiles = new submission_files($submissionfiles, $this);

return $this->submission_files;
return $this->submissionfiles;
}

$files = new submission_files([], $this);
Expand Down
20 changes: 10 additions & 10 deletions classes/test_helpers/factory_mixin.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,10 @@ protected function create_another_student() {

$user = new stdClass();
$user->firstname = 'Other Student';
$this->other_student = user::find($generator->create_user($user));
$this->enrol_as_student($this->other_student);
$this->otherstudent = user::find($generator->create_user($user));
$this->enrol_as_student($this->otherstudent);

return $this->other_student;
return $this->otherstudent;
}

/**
Expand All @@ -136,10 +136,10 @@ protected function create_another_teacher() {

$user = new stdClass();
$user->firstname = 'Other Teacher';
$this->other_teacher = user::find($generator->create_user($user));
$this->enrol_as_teacher($this->other_teacher);
$this->otherteacher = user::find($generator->create_user($user));
$this->enrol_as_teacher($this->otherteacher);

return $this->other_teacher;
return $this->otherteacher;
}

/**
Expand Down Expand Up @@ -189,7 +189,7 @@ protected function add_the_other_student_to_the_group() {

$membership = new stdClass();
$membership->groupid = $this->get_group()->id;
$membership->userid = $this->other_student->id;
$membership->userid = $this->otherstudent->id;
$generator->create_group_member($membership);
}

Expand Down Expand Up @@ -259,9 +259,9 @@ public function create_a_final_feedback_for_the_submisison() {
$feedback->assessorid = 11; // Dummy
$feedback->stage_identifier = 'final_agreed_1';
$feedback->grade = 45;
$this->final_feedback = $generator->create_feedback($feedback);
$this->finalfeedback = $generator->create_feedback($feedback);

return $this->final_feedback;
return $this->finalfeedback;
}

/**
Expand Down Expand Up @@ -336,7 +336,7 @@ protected function enrol_as_manager($user) {
}

protected function enrol_the_other_teacher_as_a_manager() {
$this->enrol_as_manager($this->other_teacher);
$this->enrol_as_manager($this->otherteacher);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion renderers/page_renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,7 @@ protected function file_submission_form($submission, $submitform) {
$fileoptions);

// Load that area into the form.
$submission->submission_files = $draftitemid;
$submission->submissionfiles = $draftitemid;

$submitform->set_data($submission);

Expand Down
Loading

0 comments on commit 534d318

Please sign in to comment.