Moodle
  1. Moodle
  2. MDL-28602

Quiz attempt report wrong duration

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1
    • Fix Version/s: 2.1.2
    • Component/s: Quiz
    • Labels:
      None
    • Testing Instructions:
      Hide
      • Make sure there's a completed quiz attempt in a course.
      • As an admin, visit the course and find the quiz.
      • Access the list of quiz attempts
      • Note the duration listed in this table (should be the actual, correct duration), see err01.png
      • Click the review attempt link below the users name
      • Note the duration - it appears to be very different than before noted, see err02.png
      Show
      Make sure there's a completed quiz attempt in a course. As an admin, visit the course and find the quiz. Access the list of quiz attempts Note the duration listed in this table (should be the actual, correct duration), see err01.png Click the review attempt link below the users name Note the duration - it appears to be very different than before noted, see err02.png
    • Workaround:
      Hide

      The problem appears to be caused by format_time() being called twice on the $timetaken variable in moodle/mod/quiz/review.php.
      Removing the call to format_time() from line 176 in that file, fixes the issue:
      Before:
      'content' => format_time($timetaken),
      After:
      'content' => $timetaken,

      Show
      The problem appears to be caused by format_time() being called twice on the $timetaken variable in moodle/mod/quiz/review.php. Removing the call to format_time() from line 176 in that file, fixes the issue: Before: 'content' => format_time($timetaken), After: 'content' => $timetaken,
    • Affected Branches:
      MOODLE_21_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE
    • Pull from Repository:
    • Pull Master Branch:
    • Rank:
      18373

      Description

      When viewing the details of a quiz attempt, the duration is invalid. Often indicates few seconds even if the actual duration is more than an hour.

      1. err01.png
        43 kB
      2. err02.png
        28 kB

        Activity

        Hide
        Colin Chambers added a comment -

        I don't have permission to review but checked both diffs. Looks good to me

        Show
        Colin Chambers added a comment - I don't have permission to review but checked both diffs. Looks good to me
        Hide
        Tim Hunt added a comment -

        Thanks for the review Colin. Submitting for integration.

        Show
        Tim Hunt added a comment - Thanks for the review Colin. Submitting for integration.
        Hide
        Mathias Tausen added a comment -

        Thanks for the quick response & processing guys, good to see that even small bugs are taken seriously.

        Show
        Mathias Tausen added a comment - Thanks for the quick response & processing guys, good to see that even small bugs are taken seriously.
        Hide
        Sam Hemelryk added a comment -

        Thanks guys, this has been integrated now

        Show
        Sam Hemelryk added a comment - Thanks guys, this has been integrated now
        Hide
        Aparup Banerjee added a comment -

        worked for me.

        Show
        Aparup Banerjee added a comment - worked for me.
        Hide
        Eloy Lafuente (stronk7) added a comment -

        Sent upstream and closing, many thanks!

        Show
        Eloy Lafuente (stronk7) added a comment - Sent upstream and closing, many thanks!

          People

          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: