MDL-46805 scorm: Set user_id if scorm|aiccuserid config is set
authorRajesh Taneja <rajesh@moodle.com>
Thu, 2 Apr 2015 07:27:21 +0000 (15:27 +0800)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Thu, 2 Apr 2015 09:09:29 +0000 (11:09 +0200)
mod/scorm/aicc.php

index 1e0fbd9..ce176d9 100644 (file)
@@ -111,7 +111,11 @@ if (!empty($command)) {
                         $userdata->status = '';
                         $userdata->score_raw = '';
                     }
-                    $userdata->student_id = $aiccuser->username;
+                    if (!empty($cfg_scorm->aiccuserid)) {
+                        $userdata->student_id = $aiccuser->id;
+                    } else {
+                        $userdata->student_id = $aiccuser->username;
+                    }
                     $userdata->student_name = $aiccuser->lastname .', '. $aiccuser->firstname;
                     $userdata->mode = $mode;
                     if ($userdata->mode == 'normal') {