Repository navigation
Conversation
Adds a shared due date trait, quiz due date settings in the builder, student-facing due dates and status badges, late flags in quiz reporting, and per-student due date changes on the student course reporting screen. Amp-Thread-ID: https://ampcode.com/threads/T-01a1a296-f04e-701b-bfda-1b9198c59450 Co-authored-by: brianhogg <brian@brianhogg.com>
Adds a LifterLMS Profile option next to "Allow unlimited quiz time" to extend every quiz and assignment due date by a number of days, or remove due dates entirely, for accessibility accommodations. Per-item due dates for the student still take precedence, and the reporting Due Dates table shows when an accommodation applies. Amp-Thread-ID: https://ampcode.com/threads/T-01a1a296-f04e-701b-bfda-1b9198c59450 Co-authored-by: brianhogg <brian@brianhogg.com>
Due dates were loose text between the Take Quiz / Start Assignment buttons inside .llms-lesson-button-wrapper, which themes lay out as a button row (Sky Pilot crushed the buttons; other themes split a date from its button). They now render as one list before the buttons via the new course/lesson-due-dates.php template, so the button row and the focus mode footer keep only the buttons. Adds LLMS_Lesson::get_due_date_items() so reporting and the lesson list share the llms_lesson_due_date_items filter. Amp-Thread-ID: https://ampcode.com/threads/T-01a1a296-f04e-701b-bfda-1b9198c59450 Co-authored-by: brianhogg <brian@brianhogg.com>
Adds a separator before the status ("Due: Oct 25, 2026 · On time")
that LifterLMS styles hide, for themes that replace the LifterLMS
stylesheet. The <time> element now has a machine-readable datetime.
Amp-Thread-ID: https://ampcode.com/threads/T-01a1a296-f04e-701b-bfda-1b9198c59450
Co-authored-by: brianhogg <brian@brianhogg.com>
Syllabus due dates use a short version of the site's date format (month abbreviated, year dropped for the current year), keeping the site's date order and localized month names, e.g. "Nov 20", "20 Nov", "20 de Nov". Dates can wrap now, so they no longer push lesson rows wider than small screens. Amp-Thread-ID: https://ampcode.com/threads/T-01a1a296-f04e-701b-bfda-1b9198c59450 Co-authored-by: brianhogg <brian@brianhogg.com>
- Remove the stray indent and reduced opacity on standalone due dates. - Darken the "due soon" badge to meet WCAG AA contrast. - Add the site time zone abbreviation to full due dates. - Tell students they can still submit overdue work, and that it will be marked late. Co-authored-by: brianhogg <brian@brianhogg.com>
Below the 782px WordPress admin breakpoint, each item becomes a card with the column name before each value, and the Change form uses the full card width instead of pushing past the table edge. Amp-Thread-ID: https://ampcode.com/threads/T-01a1a296-f04e-701b-bfda-1b9198c59450 Co-authored-by: brianhogg <brian@brianhogg.com>
- Profile accommodation: use a fieldset legend, give each radio and the days input its own label, and link the description with aria-describedby. Move inline styles to the admin stylesheet. - Due Dates report: label the actions column and name each Change button after its item for screen readers. Amp-Thread-ID: https://ampcode.com/threads/T-01a1a296-f04e-701b-bfda-1b9198c59450 Co-authored-by: brianhogg <brian@brianhogg.com>
Review fixes: before and afterCommits 1. Lesson due dates as one list above the buttons ( Mobile, in Twenty Twenty-Five, Sky Pilot, Astra and Kadence: Laptop (1024px): Focus mode: the footer now shows only the buttons. The due dates stay in the lesson body. 2. Markup without LifterLMS styles ( 3. Compact, wrapping syllabus dates in English, French and Spanish ( The new strings ("Has Quiz", "Due:") show in English on the French and Spanish sites because they have no translations yet. 4. Student-facing polish ( 5. Admin Due Dates table on small screens ( After, at desktop, tablet and mobile widths (the second panel has the Change form open): 6. Accessibility of the profile accommodation fields ( Before (top) and after (bottom): The My Grades widget overflow found during the same review is not caused by this PR; it is tracked in #3462 / #3463. |
The <time datetime> value had no offset, so it read as a floating local time. Due timestamps stay "site local", like lesson drip, which keeps day-based extensions on the same wall-clock time across daylight saving changes; only the machine-readable value gains the offset that applies on the due date. Co-authored-by: brianhogg <brian@brianhogg.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a1a296-f04e-701b-bfda-1b9198c59450
Badges are announced as "Status: Overdue" instead of running into the date, and the syllabus adds hidden punctuation so "Has Quiz, Due: Nov 5, Status: Overdue." is read as its own phrase before the assignment. Co-authored-by: brianhogg <brian@brianhogg.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a1a296-f04e-701b-bfda-1b9198c59450
Status words, badges, and column headings such as "Late", "Adjusted", "Item", "Time" and "days" are ambiguous without context. Co-authored-by: brianhogg <brian@brianhogg.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a1a296-f04e-701b-bfda-1b9198c59450
The control was a <details> <summary> styled as a button, so screen
readers didn't announce it as a button or whether its form was open.
It is now a <button> with aria-expanded and aria-controls, and an
accessible name ("Change due date for X") that starts with its visible
text. Opening the form moves focus to the date field, and Escape closes
it and returns focus to the button. "No due date for this student"
disables the date and time fields.
After a save or a validation error, the page returns to the notice and
focuses it so screen readers announce the result; the notice names the
updated item, and a failed item's form stays open.
Co-authored-by: brianhogg <brian@brianhogg.com>
Amp-Thread-ID: https://ampcode.com/threads/T-01a1a296-f04e-701b-bfda-1b9198c59450
Builder settings showed their label in a <span> that wasn't tied to
the input, so text, number and select fields (including the new Due
Date fields) were announced without a name. Inputs now point at their
label with aria-labelledby, help tips are read as descriptions, and
Select2 comboboxes read the field label before the selected option
("Due, On a specific date" instead of "On a specific date").
Amp-Thread-ID: https://ampcode.com/threads/T-01a1a296-f04e-701b-bfda-1b9198c59450
Co-authored-by: brianhogg <brian@brianhogg.com>
Accessibility and translation fixes: before and afterCommits Screen reader output (Playwright accessibility tree, course syllabus row): Machine-readable date: "Change" is now a real button ( After Save, the page returns to the notice and focuses it, so screen readers announce the result: An invalid date focuses the error and keeps that item's form open: Course builder labels ( |
Due timestamps were "site local" (strtotime() on local dates, compared to llms_current_time()), which WordPress has discouraged since 5.3. They are now Unix timestamps compared to time() and formatted with wp_date(): - Due dates and times set on a quiz or assignment are still entered in the site's timezone and converted when read. - Day-based due dates and profile extensions add calendar days in the site's timezone, so 11:59 PM stays 11:59 PM across daylight saving. - Per-student due dates (and when they were set) are stored in UTC. - Quiz attempt dates, which core stores in the site's timezone, are converted with get_gmt_from_date() before comparing. - <time datetime> is printed in UTC. Co-authored-by: brianhogg <brian@brianhogg.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a1a296-f04e-701b-bfda-1b9198c59450
The note was an inline <span>, so in themes that replace the LifterLMS stylesheet (such as Sky Pilot) it ran straight into the "Overdue" badge. It is now a block element, so it always sits on its own line, and the text drops "This is past due." since the badge already says so. Co-authored-by: brianhogg <brian@brianhogg.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a1a296-f04e-701b-bfda-1b9198c59450
Overdue note on its own line (
|
Quiz attempts get late_penalty and late_penalty_note columns. The penalty is in percentage points, comes off the score calculated from the questions, and can't be more than the score, so the score is always the grade plus the penalty. Pass or fail is decided from the final grade, which stays in the grade column so lesson, course and My Grades grades include it with no other changes. The llms_quiz_attempt_late_penalty filter lets a late policy supply the penalty later. Co-authored-by: brianhogg <brian@brianhogg.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a1a296-f04e-701b-bfda-1b9198c59450
Late quiz attempts get a Late penalty box under the stat tiles where an instructor sets the penalty in percentage points and an optional note to the student. It shows the score, penalty and grade, and offers a Remove penalty button once a penalty is set. If the student's due date moves so the attempt is no longer late, the box says so. Saving regrades the attempt through the same steps as saving a review, now shared in regrade(): the grade is recalculated, completion actions run, so a pass that becomes a fail sends the quiz failed notification (and the reverse), and llms_quiz_graded fires. Nothing runs when the penalty and note didn't change. Co-authored-by: brianhogg <brian@brianhogg.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a1a296-f04e-701b-bfda-1b9198c59450
The student's attempt results list the score and late penalty, plus the instructor's note, under the grade donut when the attempt has a penalty. Both quiz attempt tables add a "−35% late" badge after the grade, and the student quiz attempts export gets Score, Late Penalty and Late Penalty Note columns. Co-authored-by: brianhogg <brian@brianhogg.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a1a296-f04e-701b-bfda-1b9198c59450
Saving a penalty that drops a passing attempt below the passing grade fails it and runs the quiz failed and graded actions, saving the same penalty again runs nothing, and removing it passes the attempt again. Students can't add one. Co-authored-by: brianhogg <brian@brianhogg.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a1a296-f04e-701b-bfda-1b9198c59450
Late penalty (Step 1)Manual late penalty on late quiz attempts. Applying, changing or removing a penalty regrades the attempt through the same path as saving a review, so a pass that becomes a fail runs Commits:
35% penalty applied: 100% → 65%, pass → fail (quiz failed notification sent): Due date extended after the penalty, so the attempt is no longer late: Student results, before/after: How It Was Tested
|
Quiz attempt responses add read-only score, late_penalty and late_penalty_note fields, so a client can tell a 60% grade from an 80% score with a 20 point penalty. The grade field is unchanged and is the final grade. Co-authored-by: brianhogg <brian@brianhogg.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a1a296-f04e-701b-bfda-1b9198c59450
An attempt with a late penalty exports its score, penalty and the instructor's note alongside the grade. Co-authored-by: brianhogg <brian@brianhogg.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a1a296-f04e-701b-bfda-1b9198c59450
A penalty saved before the instructor finishes reviewing an attempt is stored without regrading, so the student isn't told the quiz was graded when it has no grade yet. Finishing the review regrades the attempt and applies the penalty. Attempts awaiting review also have no score now, even if an earlier grade is still stored. Co-authored-by: brianhogg <brian@brianhogg.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a1a296-f04e-701b-bfda-1b9198c59450
The note field fills the box and is three rows tall, so the note isn't clipped on phones, spacing inside the box is even, and the help text is shorter. Co-authored-by: brianhogg <brian@brianhogg.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a1a296-f04e-701b-bfda-1b9198c59450
Late penalty follow-ups
Advanced Quizzes needs no changes: it only grades individual questions through core filters, and the attempt grade is always calculated by Penalty box before/after, desktop: Penalty box before/after, 412px: How It Was Tested
|
Closing a picker blurred its input, and the picker's own blur handler closed it again, which blurred again until the stack overflowed, so the picker never hid. It now only blurs an input that still has focus. The assignment settings also set up their date pickers, so the assignment due date and time get a calendar and time list like quizzes. Co-authored-by: brianhogg <brian@brianhogg.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a1a296-f04e-701b-bfda-1b9198c59450
Builder date pickers71f09d8 Close builder date pickers after a date or time is picked.
Quiz due date, after picking the 20th: Assignment due date, on click: How It Was Tested
|
The lesson meta row now wraps with a gap instead of squeezing every item into a narrow column, and each icon stays on the same line as its label. Amp-Thread-ID: https://ampcode.com/threads/T-01a1a296-f04e-701b-bfda-1b9198c59450 Co-authored-by: brianhogg <brian@brianhogg.com>
Syllabus lesson meta wrapping (1b0b39d)In narrow syllabus layouts (theme sidebars, mobile), the quiz and assignment meta broke apart: Sky Pilot left the "Has Assignment" icon at the end of one line and its label on the next, and core's non-wrapping flex row squeezed each item into a narrow column, splitting "Due:" from its date and the favorite count from its heart.
Tested with a lesson that has a quiz and an assignment, both showing the longest badge ("Due soon"), in Twenty Twenty-Five, Astra, Kadence and Sky Pilot at 1440px and 412px, in the main content and in a sidebar syllabus widget. Kadence overrides Sky Pilot sidebar, before/after: 412px (Twenty Twenty-Five, Astra, Kadence, Sky Pilot sidebar): Desktop after (Twenty Twenty-Five, Sky Pilot, Astra): |
The builder's onClose callback blurred the input, and the picker's own blur handler closed it again, which blurred again until the stack overflowed. Each pass also re-parsed the time, and the picker stayed open. Only blur an input that still has focus. Moved from #3446 (71f09d8) so it can land on dev on its own. Fixes #3478 Amp-Thread-ID: https://ampcode.com/threads/T-01a1d0e5-6842-727b-b503-7cd82ab90872 Co-authored-by: brianhogg <brian@brianhogg.com>
Builder date picker fix moved to #3479The
|
* Fix 12-hour times shifting an hour in builder date pickers The bundled php-date-formatter 1.3.4 parsed "h:i A" values as hour + meridiem - 1, so every blur rewrote 02:00 PM as 01:00 PM (and 12:00 PM as 11:00 PM). Apply upstream's fix from kartik-v/php-date-formatter@7e5fa68 to both datetimepicker builds, and version the script with LLMS_ASSETS_VERSION so browsers load the patched file. Fixes #3478 Amp-Thread-ID: https://ampcode.com/threads/T-01a1d0e5-6842-727b-b503-7cd82ab90872 Co-authored-by: brianhogg <brian@brianhogg.com> * Only blur a focused input when a builder date picker closes The builder's onClose callback blurred the input, and the picker's own blur handler closed it again, which blurred again until the stack overflowed. Each pass also re-parsed the time, and the picker stayed open. Only blur an input that still has focus. Moved from #3446 (71f09d8) so it can land on dev on its own. Fixes #3478 Amp-Thread-ID: https://ampcode.com/threads/T-01a1d0e5-6842-727b-b503-7cd82ab90872 Co-authored-by: brianhogg <brian@brianhogg.com> --------- Co-authored-by: Amp <amp@ampcode.com>









































Description
Adds quiz and assignment due dates.
Adds due dates to quizzes, plus the shared code the Assignments add-on uses for assignment due dates (companion PR: gocodebox/lifterlms-assignments#180).
LLMS_Trait_Due_Date(used byLLMS_Quiz, and byLLMS_Assignmentin the add-on):time()and shown withwp_date();llms_current_time()isn't used. Due dates set on a quiz are entered in the site's timezone, per-student due dates are stored in UTC, and day-based dates and extensions add calendar days in the site's timezone so 11:59 PM stays 11:59 PM across daylight saving time.Schemas/DueDate.js, reused by Assignments).templates/course/lesson-due-dates.php). The focus mode footer shows only the buttons.Oct 25,25 Oct,25 de Oct; the year only appears when it isn't the current year). Sites can change it with thellms_short_date_formatfilter.Review fixes (one commit each):
4886de0Lesson due dates as one list above the buttons; focus mode footer shows only the buttons.5a3d273Readable markup without LifterLMS styles (separator and<time datetime>).21de98bCompact, wrapping syllabus date using the site's date format and locale.3169d85Student-facing polish: no indent or opacity on due lines, darker "due soon" badge for contrast, time zone on full dates, past-due note.af831cfThe admin Due Dates table stacks into cards below 782px.7ac1cb2Accessibility of the admin controls: profile accommodation<fieldset>and<legend>, labelled inputs,aria-describedby; an "Actions" column header and per-item "Change due date for …" button names.Accessibility and translation fixes (one commit each):
3160d15<time datetime>includes a UTC offset (superseded by1ae1c57).47f24e2Screen readers hear "Status: Overdue" after the date, and syllabus items are separated ("Has Quiz, Due: Nov 5, Status: Overdue.").e2a3709Translator comments on short or ambiguous strings (statuses, "Late", "Adjusted", "Item", "Time", "days").b5ad17eThe per-student "Change" control is a real<button>witharia-expanded/aria-controls. Opening moves focus to the date, Escape closes and returns focus, "No due date" disables the date and time fields. After saving (or a validation error) the page returns to the notice and focuses it; the notice names the item.757e929Course builder settings fields are labelled for screen readers (aria-labelledby, help tips asaria-describedby, Select2 reads "Due, On a specific date"). This applies to every builder field, not only due dates.1ae1c57UTC timestamps throughout, as described above. Quiz attempt dates, which core stores in the site's timezone, are converted withget_gmt_from_date();<time datetime>is printed in UTC (2026-10-26T03:59:00+00:00).Late penalty (Step 1), manual only:
aa765cbQuiz attempts getlate_penaltyandlate_penalty_notecolumns.calculate_grade()takes the penalty off the score (capped at the score) and decides pass/fail from the final grade, which stays in thegradecolumn. Addsget_score(),get_late_penalty()and thellms_quiz_attempt_late_penaltyfilter.7961cfcA Late penalty box on the single quiz attempt screen for late attempts, for users who can edit the quiz. Saving regrades through the same steps as Save Review (now shared inregrade()), so a pass that becomes a fail sends the quiz failed notification and the reverse sends quiz passed. Completion and awards are not revoked, as with any regrade.f3d1d62Students see the score, penalty and note on their attempt results; the attempts tables show a "−X% late" badge; the student attempts export gets Score, Late Penalty and Late Penalty Note columns.c12df33Controller test and changelog entry.570a184Read-onlyscore,late_penaltyandlate_penalty_noteon the quiz attempts REST API.b95918dScore, late penalty and note rows in the Quiz Data personal data export.e60b820A penalty on an attempt awaiting review is stored without regrading, so no "quiz graded" notification goes out before there's a grade; finishing the review applies it.004d6b9Penalty box spacing and small-screen layout.Advanced Quizzes needs no changes: it grades individual questions through core filters, and the attempt grade always comes from
calculate_grade().Not included: an automatic late policy, bulk penalties, REST write support for penalties, CLI fields, and moving the rest of core off site-local dates.
How has this been tested?
Tested manually in wp-env with a demo course: 4 lessons, 4 quizzes, 3 assignments (Assignments add-on on its due dates branch, gocodebox/lifterlms-assignments#180), and two students.
--filter 'Quiz|Generator|Student|Profile': 397 tests pass. The generator fixture gained the new quiz keys.--filter 'Quiz|Lesson|Student|Profile|Due': 392 tests pass (23 skipped, all existing skips).test_get_short_date_formatcovers the compact date format.--filter 'Quiz|Lesson|Student|Profile|Due|Assets': 449 tests pass (23 skipped, 1 incomplete, all existing).test_get_due_timestamp_utc(fixed dates in EDT and EST, a 7 day extension across the end of DST, a UTC per-student date, and late detection on a site-timezone submission) fails without1ae1c57and passes with it.datetimeattributes changed, to the same moments in UTC. Saving 11:59 PM Oct 25 from the admin form stores2026-10-26 03:59:00.quiz_failedandquiz_gradednotifications. Removing it restored 100% / Pass withquiz_passedandquiz_graded.test_late_penalty_regrades_attemptcovers the same through the controller, plus no actions on an unchanged save and no access for students. PHPUnit--filter 'Quiz|Lesson|Due'(233 tests) and--filter 'Table|Install|Controller'(481 tests) pass.test_get_item_late_penaltyandtest_late_penalty_pending_attemptadded; PHPUnit--filter 'Quiz|Lesson|Due|Controller|Privacy'(553 tests) passes. With Advanced Quizzes active, a late attempt with fill-in-the-blank, reorder and long answer questions took the penalty on review (75% → 55%, Fail, quiz failed notification) and through the REST grade endpoint.phpcs: no errors on the changed PHP files.Screenshots
See the comments below.
Types of changes
New feature (non-breaking change which adds functionality)
Checklist: