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

col_duration "now" when timefinish == timestart

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.8.4, 3.9.1
    • Fix Version/s: None
    • Component/s: Quiz
    • Labels:
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_38_STABLE, MOODLE_39_STABLE

      Description

      /**
       * Generate the display of the time taken column.
       * @param object $attempt the table row being output.
       * @return string HTML content to go inside the td.
       */
      public function col_duration($attempt) {
          if ($attempt->timefinish) {
              return format_time($attempt->timefinish - $attempt->timestart);
          } else {
              return '-';
          }
      }

      When $attempt->timefinish == $attempt->timestart it shows "now"

      Suggested fix:
      if ($attempt->timefinish && $attempt->timestart != $attempt->timefinish) {

        Attachments

          Activity

            People

            Assignee:
            kritisingh1 Kriti Singh
            Reporter:
            jameskinsman James Kinsman
            Participants:
            Component watchers:
            Tim Hunt, Andrew Lyons, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated: