예제 #1
0
 public function onImportLesson($lessonId, $data)
 {
     // Change all external content links to the folder of the newly imported lesson
     if (strpos($data[0]['data'], "lessons/" . $data[0]['lessons_ID'] . "/")) {
         $data[0]['data'] = str_replace("lessons/" . $data[0]['lessons_ID'] . "/", "lessons/" . $lessonId . "/", $data[0]['data'] . "/");
     } else {
         if (strpos($data[0]['data'], "lessons\\" . $data[0]['lessons_ID'] . "\\")) {
             $data[0]['data'] = str_replace("lessons\\" . $data[0]['lessons_ID'] . "\\", "lessons\\" . $lessonId . "\\", $data[0]['data'] . "\\");
         }
     }
     $data[0]['lessons_ID'] = $lessonId;
     eF_insertOrupdateTableData("module_billboard", $data[0], "lessons_ID={$lessonId}");
     return true;
 }
예제 #2
0
 //Take the branch and initialize scorm tree
 $scoBranch[$_SESSION['package_ID']] = $currentContent->tree->offsetGet($_SESSION['package_ID']);
 $scoContent = new EfrontContentTreeSCORM($scoBranch, $fields['content_ID']);
 $currentNode = $scoContent->flatTree[$fields['content_ID']];
 $primaryObjective = $scoContent->objectives->get_primary_objective($fields['content_ID']);
 if ($fields['navigation'] != 'abandonAll' && $fields['navigation'] != 'abandon') {
     //Update shared data
     foreach (json_decode($fields['shared_data'], true) as $key => $value) {
         $updateData = array('target_ID' => $value['id']['value'], 'store' => $value['store']['value']);
         $scoContent->maps->updateMapInfo($updateData['target_ID'], $updateData);
     }
     //Update scorm sequencing information
     eF_insertOrupdateTableData("scorm_sequencing_comments_from_learner", array('content_ID' => $fields['content_ID'], 'users_LOGIN' => $_SESSION['s_login'], 'data' => $fields['comments_from_learner']), "content_ID = '" . $fields['content_ID'] . "' AND users_LOGIN = '******'s_login'] . "'");
     eF_insertOrupdateTableData("scorm_sequencing_comments_from_lms", array('content_ID' => $fields['content_ID'], 'data' => $fields['comments_from_learner']), "content_ID = '" . $fields['content_ID'] . "'");
     eF_insertOrupdateTableData("scorm_sequencing_interactions", array('content_ID' => $fields['content_ID'], 'users_LOGIN' => $_SESSION['s_login'], 'data' => $fields['interactions']), "content_ID = '" . $fields['content_ID'] . "' AND users_LOGIN = '******'s_login'] . "'");
     eF_insertOrupdateTableData("scorm_sequencing_learner_preferences", array('content_ID' => $fields['content_ID'], 'users_LOGIN' => $_SESSION['s_login'], 'data' => $fields['learner_preferences']), "content_ID = '" . $fields['content_ID'] . "' AND users_LOGIN = '******'s_login'] . "'");
     //Update objectives and attempts
     $cnt = 0;
     foreach (json_decode($fields['objectives'], true) as $key => $value) {
         $updateData = array('raw_score' => $value['score']['raw']['value'], 'max_score' => $value['score']['max']['value'], 'min_score' => $value['score']['min']['value'], 'score_scaled' => $value['score']['scaled']['value'], 'completion_status' => $value['completion_status']['value'], 'progress_measure' => $value['progress_measure']['value'], 'success_status' => $value['success_status']['value'], 'description' => $value['description']['value']);
         //Deal with sequencing impacts
         //Progress Measure
         if ($updateData['progress_measure']) {
             $scoContent->objectives->update_objective_info($value['id']['value'], $fields['content_ID'], array('attempt_completion_amount_status' => 'true', 'attempt_completion_amount' => $updateData['progress_measure']));
         }
         //Score Scaled
         if ($updateData['score_scaled']) {
             $scoContent->objectives->update_objective_info($value['id']['value'], $fields['content_ID'], array('objective_measure_status' => 'true', 'objective_normalized_measure' => $updateData['score_scaled']));
         }
         $objInfo = $scoContent->objectives->get_objective_info($value['id']['value'], $fields['content_ID'], array('attempt_progress_status' => 'false'));
         $obj = $scoContent->objectives->get_objective($value['id']['value'], $fields['content_ID']);