Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-84529

Client-side validation of date/time causes issues filtering question bank

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 5.0
    • 5.0
    • Questions, UX
    • MOODLE_500_STABLE
    • MOODLE_500_STABLE
    • Hide
      1. Create a course
      2. Create a question bank or use the default one if it exists
      3. Create 2 questions and then edit them to modify them with a change
      4. Click "Add condition" to add a new filter to the question bank
      5. Select "Time modified" from the available filters drop-down
      6. Choose "Before" from the mode drop-down
      7. Press "Apply filters" with the default time (now) input, and confirm that the 2 questions you created are shown
      8. Change the before time to some time in the future
      9. Press "Apply changes" and confirm it still shows the 2 questions, instead of a popup validation error
      10. Do the same for "After" and "Between" and confirm that it always applies the filter instead of showing the pop-up validation error, which it used to.
      Show
      Create a course Create a question bank or use the default one if it exists Create 2 questions and then edit them to modify them with a change Click "Add condition" to add a new filter to the question bank Select "Time modified" from the available filters drop-down Choose "Before" from the mode drop-down Press "Apply filters" with the default time (now) input, and confirm that the 2 questions you created are shown Change the before time to some time in the future Press "Apply changes" and confirm it still shows the 2 questions, instead of a popup validation error Do the same for "After" and "Between" and confirm that it always applies the filter instead of showing the pop-up validation error, which it used to.
    • Hide

      Code verified against automated checks.

      Checked MDL-84529 using repository: https://github.com/cwarwicker/moodle

      More information about this report

      Built on: Tue Mar 4 05:42:59 UTC 2025

      Show
      Code verified against automated checks. Checked MDL-84529 using repository: https://github.com/cwarwicker/moodle main (0 errors / 0 warnings) [branch: MDL-84529 | CI Job ] More information about this report Built on: Tue Mar 4 05:42:59 UTC 2025
    • Show
      Launching automatic jobs for branch MDL-84529 https://ci.moodle.org/view/Testing/job/DEV.02%20-%20Developer-requested%20PHPUnit/18369/ PHPUnit (sqlsrv) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/62906/ Behat (NonJS - boost and classic) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/62907/ Behat (Firefox - boost) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/62908/ Behat (Firefox - classic) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/62909/ App tests (stable app version) Built on: Thu Feb 27 14:25:16 UTC 2025

      For example on page load (At 14:56) if i apply "Time Modified Before" it won't let me choose any time after 14:56 (e.g. 14:57 will have a validation error and won't apply).

      However, if I wait 5 minutes so it's now 15:01, and I want to filter for before now (15:01), it still won't let me filter by anything after 14:56 when the page loaded.

      Similiar issues occur with After and Between, because the validation is done on the time the page loaded.

      So the overall issue is that the date/time validation should either be server-side, or updated with correct NOW time when applied, or removed (is it necessary to restrict people choosing whatever dates/times they want to filter by?)

            cwarwicker CMR
            cwarwicker CMR
            Mark Johnson Mark Johnson
            Tim Hunt Tim Hunt
            Ron Carl Alfon Yu Ron Carl Alfon Yu
            Votes:
            0 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 5 hours, 56 minutes
                5h 56m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.