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

Activity completion API sets timemodified to 0 in database

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 3.5.16
    • Activity completion
    • PHP 7.2.24-0
      ubuntu18.04.7
    • MySQL
    • MOODLE_35_STABLE
    • Easy

      Steps to reproduce it on clean moodle35_16:

      (I reproduced it using SCORM)

      1. Login as admin
      2. Open course
      3. Add scorm package with random name.
      4. Upload for example this Package file (see attachment)
      5. Set Activity completion settings as on screenshot
      6. Save activity
      7. Login as normal user enrolled in course
      8. Enter this scorm in normal mode
      9. Watch one slide and click "Exit activity" , don't watch till end.
      10. In `mdl_course_modules_completion` table there should be new record with timemodified = 0 (see screenshot)
      12. Login again as admin
      13. Go to course > Course administration > Reports > Activity completion ( /report/progress/index.php?course=2 )
      14. Download in spreadsheet format (UTF-8 .csv)
      15. In csv should record with "Thursday, 1 January 1970, 1:00 AM"
       

      LOGS 

      SELECT * FROM `mdl_log_queries` WHERE `sqltext` LIKE '%mdl_course_modules_completion%' ORDER BY `id` DESC

      SQL TEXT:
      INSERT INTO mdl_course_modules_completion (coursemoduleid,userid,completionstate,viewed,overrideby,timemodified) VALUES(?,?,?,?,?,?)

      SQL PARAMS
      array (
        0 => '7',
        1 => '5',
        2 => 0,
        3 => 1,
        4 => NULL,
        5 => 0,
      )

      Backtrace:

      • line 1375 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->insert_record_raw()
      • line 1049 of /lib/completionlib.php: call to mysqli_native_moodle_database->insert_record()
      • line 738 of /lib/completionlib.php: call to completion_info->internal_set_data()
      • line 159 of /mod/scorm/player.php: call to completion_info->set_module_viewed()

        1. database.png
          database.png
          57 kB
        2. settings.png
          settings.png
          43 kB
        3. SVP Structure_V3.zip
          9.99 MB

            Unassigned Unassigned
            jakubkleban Jakub Kleban
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:

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