Skip to content

Commit

Permalink
Add dates to Assignments output
Browse files Browse the repository at this point in the history
  • Loading branch information
csev committed Dec 5, 2023
1 parent 6c130d2 commit e4fbf3a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Grades/GradeUtil.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public static function loadGradesForCourse($user_id, $context_id)
$p = $CFG->dbprefix;
$sql =
"SELECT R.result_id AS result_id, L.title as title, L.link_key AS resource_link_id,
R.grade AS grade, R.note AS note
R.grade AS grade, R.note AS note, R.updated_at AS updated_at
FROM {$p}lti_result AS R
JOIN {$p}lti_link as L ON R.link_id = L.link_id
LEFT JOIN {$p}lti_service AS S ON R.service_id = S.service_id
Expand Down
8 changes: 6 additions & 2 deletions src/UI/Lessons.php
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,7 @@ public function renderAll($buffer=false)
echo($ob_output);
}

public function renderAssignments($allgrades, $buffer=false)
public function renderAssignments($allgrades, $alldates, $buffer=false)
{
ob_start();
echo('<h1>'.$this->lessons->title."</h1>\n");
Expand Down Expand Up @@ -822,7 +822,11 @@ public function renderAssignments($allgrades, $buffer=false)
}
echo("</td><td>".$lti->title."</td>\n");
if ( isset($allgrades[$lti->resource_link_id]) ) {
echo("<td>Score: ".(100*$allgrades[$lti->resource_link_id])."</td>");
$datestring = U::get($alldates, $lti->resource_link_id, "");
if ( strlen($datestring) > 0 ) {
$datestring = " (".substr($datestring,0,10).")";
}
echo("<td>Score: ".(100*$allgrades[$lti->resource_link_id]).$datestring."</td>");
} else {
echo("<td>&nbsp;</td>");
}
Expand Down

0 comments on commit e4fbf3a

Please sign in to comment.