Skip to content

Commit

Permalink
Test: Fix Reporting Date Presentation on InfoPage
Browse files Browse the repository at this point in the history
  • Loading branch information
kergomard committed Oct 15, 2024
1 parent 824d61c commit d879eea
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions Modules/Test/classes/class.ilObjTestGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -2806,14 +2806,19 @@ public function infoScreen($session_lock = "")
break;
}
$info->addProperty($this->lng->txt("tst_score_reporting"), $score_reporting_text);
$reporting_date = $this->object->getReportingDate();
if ($reporting_date) {
#preg_match("/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/", $reporting_date, $matches);
#$txt_reporting_date = date($this->lng->text["lang_dateformat"] . " " . $this->lng->text["lang_timeformat"], mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]));
#$info->addProperty($this->lng->txt("tst_score_reporting_date"), $txt_reporting_date);
$reporting_date = $this->getTestObject()
->getScoreSettings()
->getResultSummarySettings()
->getReportingDate();
if ($reporting_date !== null) {
$info->addProperty(
$this->lng->txt('tst_score_reporting_date'),
ilDatePresentation::formatDate(new ilDateTime($reporting_date, IL_CAL_TIMESTAMP))
ilDatePresentation::formatDate(new ilDateTime(
$reporting_date
->setTimezone(new DateTimeZone($this->user->getTimeZone()))
->format('YmdHis'),
IL_CAL_TIMESTAMP
))
);
}

Expand Down

0 comments on commit d879eea

Please sign in to comment.