/**
* @throws ApiException
*/
- public static function send($url, $courseId, $delete = true)
+ public static function send($url, $courseId, $delete = true, $attempts = 3)
{
$courseAPI = static::_getApi();
}
- if ($delete) {
- static::deleteOldVersions($courseId);
+ try {
+ if ($delete) {
+ static::deleteOldVersions($courseId);
+ }
+ } catch (\Exception $e) {
+ if ($attempts >= 1) {
+ sleep(5);
+ return static::send($url, $courseId, $delete, $attempts - 1);
+ }
}
- return 'https://cloud.scorm.com/sc/user/Course?appId=' . self::getAppID() . '&courseId=' . $courseId;
+ return 'https://cloud.scorm.com/sc/user/Course?appId=' . self::getAppID() . '&courseId=' . $courseId . '&attempts=' . $attempts;
}
/**