Moodle
  1. Moodle
  2. MDL-37894

For not yet opened quizzes, show close date as well as open date

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3.4, 2.4, 2.5
    • Fix Version/s: 2.3.5, 2.4.2
    • Component/s: Quiz
    • Labels:
    • Testing Instructions:
      Hide

      Create a quiz with both and open and close date in the future.

      Make sure that both dates are displayed on the quiz view.php page.

      Show
      Create a quiz with both and open and close date in the future. Make sure that both dates are displayed on the quiz view.php page.
    • Affected Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE, MOODLE_25_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      Set a Quiz with an open date and a close date both in the future.
      When student looks at the quiz, it tells them the quiz is not yet available and displays the "open date".
      However, it would be useful to also display the (future) close date.
      See this discussion: https://moodle.org/mod/forum/discuss.php?d=221555

        Gliffy Diagrams

          Activity

          Hide
          Tim Hunt added a comment -

          Joseph. I think this patch does it. Please could you have a quick look and see what you think. Thanks.

          Show
          Tim Hunt added a comment - Joseph. I think this patch does it. Please could you have a quick look and see what you think. Thanks.
          Hide
          Joseph Rézeau added a comment -

          Tim, your patch works fine for me (tested on moodle 2.4).
          Thanks!

          Show
          Joseph Rézeau added a comment - Tim, your patch works fine for me (tested on moodle 2.4). Thanks!
          Hide
          Tim Hunt added a comment -

          I think that this improvement will not cause any problems if we add it to all stable branches, and so we should. (If you insist, I could argue that not displaying this is a bug.)

          Forum thread here: https://moodle.org/mod/forum/discuss.php?d=222449. If anyone objects, I will withdraw this before it is integrated.

          Show
          Tim Hunt added a comment - I think that this improvement will not cause any problems if we add it to all stable branches, and so we should. (If you insist, I could argue that not displaying this is a bug.) Forum thread here: https://moodle.org/mod/forum/discuss.php?d=222449 . If anyone objects, I will withdraw this before it is integrated.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Integrated (23, 24 & master), thanks!

          Show
          Eloy Lafuente (stronk7) added a comment - Integrated (23, 24 & master), thanks!
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Warning, unit tests failing badly:

          quizaccess_openclosedate_testcase::test_both_dates
          Failed asserting that two arrays are equal.
          --- Expected
          +++ Actual
          @@ @@
           Array (
               0 => 'The quiz will not be availabl...:46 pm'
          -    1 => 'This quiz will close at Thurs...:33 am'
           )
           
          mod/quiz/accessrule/openclosedate/tests/rule_test.php:156
          lib/phpunit/classes/basic_testcase.php:64
          

          Ciao

          Show
          Eloy Lafuente (stronk7) added a comment - Warning, unit tests failing badly: quizaccess_openclosedate_testcase::test_both_dates Failed asserting that two arrays are equal. --- Expected +++ Actual @@ @@ Array ( 0 => 'The quiz will not be availabl...:46 pm' - 1 => 'This quiz will close at Thurs...:33 am' )   mod/quiz/accessrule/openclosedate/tests/rule_test.php:156 lib/phpunit/classes/basic_testcase.php:64 Ciao
          Hide
          Eloy Lafuente (stronk7) added a comment - - edited

          I've pushed to all branched one change fixing the test to represent the new openclose rule:

          http://git.moodle.org/gw?p=integration.git;a=commitdiff;h=3b00c13bf120b88376c72b0ee1cf7f958f1bcbba

          BTW, aren't all those tests wrong, with assertions doing (result, expectation) instead of (expectation, result) ?

          Ciao

          Edited: Now they are passing.

          Show
          Eloy Lafuente (stronk7) added a comment - - edited I've pushed to all branched one change fixing the test to represent the new openclose rule: http://git.moodle.org/gw?p=integration.git;a=commitdiff;h=3b00c13bf120b88376c72b0ee1cf7f958f1bcbba BTW, aren't all those tests wrong, with assertions doing (result, expectation) instead of (expectation, result) ? Ciao Edited: Now they are passing.
          Hide
          Frédéric Massart added a comment -

          Passing, thanks!

          Show
          Frédéric Massart added a comment - Passing, thanks!
          Hide
          Tim Hunt added a comment -

          Thanks Eloy for fixing that unit test failure. I have reviewed, an can confirm that your fix is right.

          You are also right that the asserts are the wrong way round. Fortunately, with assertEquals, it is not critical.

          Show
          Tim Hunt added a comment - Thanks Eloy for fixing that unit test failure. I have reviewed, an can confirm that your fix is right. You are also right that the asserts are the wrong way round. Fortunately, with assertEquals, it is not critical.
          Hide
          Damyon Wiese added a comment -

          Thanks for your hard work - this issue has made it! Moodle is now a little bit better.

          Regards, Damyon

          Show
          Damyon Wiese added a comment - Thanks for your hard work - this issue has made it! Moodle is now a little bit better. Regards, Damyon
          Hide
          Mary Cooch added a comment -

          just added a quick note to 2.3 and 2.4 docs about this http://docs.moodle.org/24/en/Quiz_settings#Timing

          Show
          Mary Cooch added a comment - just added a quick note to 2.3 and 2.4 docs about this http://docs.moodle.org/24/en/Quiz_settings#Timing

            People

            • Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: