Skip to content

Commit

Permalink
Fix various bugs in new combinator grader.
Browse files Browse the repository at this point in the history
  • Loading branch information
trampgeek committed Apr 15, 2024
1 parent ecf21bc commit 4010c79
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions classes/combinator_grader_outcome.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ private function insert_file_urls($html, $urls) {
}
}
}
return $html; // return the modified HTML.
return $html; // Return the modified HTML.
}


Expand All @@ -181,12 +181,13 @@ public function set_mark_and_feedback($markfraction, $feedback) {
if ($this->valid_table_formats($testresults, $columnformats)) {
if ($files) {
$urls = $this->save_files($files);
$htmlfields = ['feedbackhtml', 'prologuehtml', 'epiloguehtml', 'instructorhtml'];
foreach ($htmlfields as $field) {
if ($this->$field) {
$this->$field = $this->insert_file_urls($this->$field, $urls);
}
};
}
foreach ($feedback as $field => $value) {
if ($urls && in_array($field, ['prologuehtml', 'epiloguehtml', 'instructorhtml', 'feedbackhtml'])) {
$this->$field = $this->insert_file_urls($value, $urls);
} else {
$this->$field = $value;
}
}
$this->format_results_table($testresults, $columnformats, $urls);
}
Expand Down Expand Up @@ -401,8 +402,8 @@ private function format_results_table($testresults, $columnformats, $urls) {
}
$newtable[] = $newrow;
}
$this->testresults = $newtable;
}
$this->testresults = $newtable;
}

public function get_prologue() {
Expand Down

0 comments on commit 4010c79

Please sign in to comment.