Skip to content

Commit

Permalink
CTP-3796 avoid var name re-use
Browse files Browse the repository at this point in the history
  • Loading branch information
watson8 committed Sep 23, 2024
1 parent 62ac8c1 commit 07beab8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
7 changes: 4 additions & 3 deletions classes/export/csv/cells/feedbackcomments_cell.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,10 @@ class feedbackcomments_cell extends cell_base {
*/
public function get_cell($submission, $student, $stageidentifier) {

$stageidentifier = ($this->coursework->get_max_markers() == 1)
? "assessor_1" : $this->get_stage_identifier_for_assessor($submission, $student);
$grade = $submission->get_assessor_feedback_by_stage($stageidentifier);
$stageident = ($this->coursework->get_max_markers() == 1)
? "assessor_1"
: $this->get_stage_identifier_for_assessor($submission, $student);
$grade = $submission->get_assessor_feedback_by_stage($stageident);
return (!$grade || !isset($grade->feedbackcomment)) ? '' : strip_tags($grade->feedbackcomment);
}

Expand Down
9 changes: 4 additions & 5 deletions classes/export/csv/cells/singlegrade_cell.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,16 @@ class singlegrade_cell extends cell_base {
* @return array|mixed|null|string
*/
public function get_cell($submission, $student, $stageidentifier) {
$stageident = ($this->coursework->get_max_markers() == 1)
? "assessor_1" : $this->get_stage_identifier_for_assessor($submission, $student);

$stageidentifier = ($this->coursework->get_max_markers() == 1) ? "assessor_1" : $this->get_stage_identifier_for_assessor($submission, $student);

$grade = $submission->get_assessor_feedback_by_stage($stageidentifier);
$grade = $submission->get_assessor_feedback_by_stage($stageident);
if ($this->coursework->is_using_rubric()) {
$gradedata = [];
$this->get_rubric_scores_gradedata($grade, $gradedata); // multiple parts are handled here
$this->get_rubric_scores_gradedata($grade, $gradedata); // Multiple parts are handled here.
} else {
$gradedata = (!$grade) ? '' : $this->get_actual_grade($grade->grade);
}

return $gradedata;
}

Expand Down

0 comments on commit 07beab8

Please sign in to comment.