Adding option to define if the user is identified by the user_id or by the username in the LP scorm communication -refs BT#16731

pull/3090/head
NicoDucou 6 years ago
parent 74f71c694e
commit 6eacf4baf0
  1. 4
      main/install/configuration.dist.php
  2. 14
      main/lp/learnpath.class.php
  3. 2
      main/lp/scorm_api.php

@ -1385,6 +1385,10 @@ ALTER TABLE notification_event ADD COLUMN event_id INT NULL;
// Use this link as the "Forgot password?" link instead of the default. This setting should be transformed into a hook for plugins at a later time
//$_configuration['pass_reminder_custom_link'] = '';
// In Scorm comunication use the username instead of the user_id
//$_configuration['scorm_api_username_as_student_id'] = false;
// KEEP THIS AT THE END
// -------- Custom DB changes
// Add user activation by confirmation email

@ -13800,4 +13800,18 @@ EOD;
return $doUseScore;
}
/**
* Get the user identifier (user_id or username
* Depends on scorm_api_username_as_student_id in app/config/configuration.php
*
* @return string
*/
public function getUserIdentifierForExternalServices()
{
if (api_get_configuration_value('scorm_api_username_as_student_id')) {
return api_get_user_info(api_get_user_id())['username'];
} else {
return api_get_user_id();
}
}
}

@ -476,7 +476,7 @@ function LMSGetValue(param) {
}
} else if(param == 'cmi.core.student_id'){
// ---- cmi.core.student_id
result='<?php echo $userId; ?>';
result='<?php echo learnpath::getUserIdentifierForExternalServices(); ?>';
} else if(param == 'cmi.core.student_name'){
// ---- cmi.core.student_name
<?php

Loading…
Cancel
Save