From f8d0147b2eab1d0da35d002675067e84eacd9692 Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Mon, 21 Dec 2015 17:21:56 +0100 Subject: [PATCH] Add lp name in webservice --- main/newscorm/scorm.class.php | 7 ++++--- main/webservices/lp.php | 7 +++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/main/newscorm/scorm.class.php b/main/newscorm/scorm.class.php index a3f3237231..3297156976 100755 --- a/main/newscorm/scorm.class.php +++ b/main/newscorm/scorm.class.php @@ -54,9 +54,8 @@ class scorm extends learnpath if ($this->debug > 0) { error_log('New LP - scorm::scorm('.$course_code.','.$resource_id.','.$user_id.') - In scorm constructor', 0); } - if (!empty($course_code) && !empty($resource_id) && !empty($user_id)) { - parent::__construct($course_code, $resource_id, $user_id); - } + + parent::__construct($course_code, $resource_id, $user_id); } /** @@ -282,6 +281,8 @@ class scorm extends learnpath * Import the scorm object (as a result from the parse_manifest function) into the database structure * @param string $course_code * @param int $use_max_score + * @param int $sessionId + * * @return bool Returns -1 on error */ public function import_manifest($course_code, $use_max_score = 1, $sessionId = null) diff --git a/main/webservices/lp.php b/main/webservices/lp.php index ef227de227..8d19be84d8 100644 --- a/main/webservices/lp.php +++ b/main/webservices/lp.php @@ -110,6 +110,7 @@ $server->wsdl->addComplexType( ), 'file_data' => array('name' => 'file', 'type' => 'xsd:string'), 'filename' => array('name' => 'filename', 'type' => 'xsd:string'), + 'lp_name' => array('name' => 'lp_name', 'type' => 'xsd:string'), 'secret_key' => array('name' => 'secret_key', 'type' => 'xsd:string'), ) ); @@ -142,6 +143,8 @@ function WSImportLP($params) $sessionIdName = isset($params['session_id_name']) ? $params['session_id_name'] : null; $sessionIdValue = isset($params['session_id_value']) ? $params['session_id_value'] : null; + $lpName = $params['lp_name']; + $courseCode = CourseManager::get_course_id_from_original_id( $courseIdValue, $courseIdName @@ -173,7 +176,7 @@ function WSImportLP($params) $maker = 'Scorm'; $maxScore = ''; //$_REQUEST['use_max_score'] - $oScorm = new scorm(); + $oScorm = new scorm($courseCode); $fileData = base64_decode($params['file_data']); $uniqueFile = uniqid(); @@ -203,7 +206,7 @@ function WSImportLP($params) $maxScore, $sessionId ); - + $oScorm->set_name($lpName); $oScorm->set_proximity($proximity, $courseId); $oScorm->set_maker($maker, $courseId); //$oScorm->set_jslib('scorm_api.php');