MDL-84641 mod_workshop: add human date to overview

This commit is contained in:
ferran
2025-04-22 16:03:22 +02:00
parent 10d2d31536
commit 7f76a2b626
2 changed files with 6 additions and 5 deletions
@@ -17,6 +17,7 @@
namespace mod_workshop\courseformat;
use cm_info;
use core_calendar\output\humandate;
use core_courseformat\local\overview\overviewitem;
use core\output\action_link;
use core\output\local\properties\text_align;
@@ -130,7 +131,7 @@ class overview extends \core_courseformat\activityoverviewbase {
return new overviewitem(
name: get_string('deadline', 'workshop'),
value: (int) $deadline,
content: userdate($deadline),
content: humandate::create_from_timestamp($deadline),
);
}
@@ -31,9 +31,9 @@ In order to summarize the workshops
| student8 | C1 | student |
| teacher1 | C1 | editingteacher |
And the following "activities" exist:
| activity | name | course | idnumber | submissiontypetext | submissiontypefile | grade | gradinggrade | gradedecimals | overallfeedbackmethod |latesubmissions | submisstionstart | submissionend |
| workshop | Activity 1 | C1 | workshop1 | 2 | 1 | 100 | 5 | 1 | 2 |1 | ##1 Jan 2018 08:00## | ##1 Jan 2040 08:00## |
| workshop | Activity 2 | C1 | workshop1 | 2 | 1 | 100 | 5 | 1 | 2 |1 | ##1 Jan 2018 08:00## | ##1 Jan 2040 08:00## |
| activity | name | course | idnumber | submissiontypetext | submissiontypefile | grade | gradinggrade | gradedecimals | overallfeedbackmethod | latesubmissions | submisstionstart | submissionend |
| workshop | Activity 1 | C1 | workshop1 | 2 | 1 | 100 | 5 | 1 | 2 | 1 | ##1 Jan 2018 08:00## | ##1 Jan 2040 08:00## |
| workshop | Activity 2 | C1 | workshop1 | 2 | 1 | 100 | 5 | 1 | 2 | 1 | ##today noon## | ##tomorrow noon## |
Scenario: The workshop overview report should generate log events
Given I am on the "Course 1" "course > activities > workshop" page logged in as "teacher1"
@@ -145,7 +145,7 @@ In order to summarize the workshops
And I should see "Submission phase" in the "Activity 2" "table_row"
# Cheack Deadline.
And I should see "-" in the "Activity 1" "table_row"
And I should see "1 January 2040" in the "Activity 2" "table_row"
And I should see "Tomorrow" in the "Activity 2" "table_row"
# Check Submissions.
And I should see "1 of 8" in the "Activity 1" "table_row"
And I should see "0 of 8" in the "Activity 2" "table_row"