Add lp name in webservice

1.9.x
Julio Montoya 10 years ago
parent d88246ae03
commit f8d0147b2e
  1. 7
      main/newscorm/scorm.class.php
  2. 7
      main/webservices/lp.php

@ -54,9 +54,8 @@ class scorm extends learnpath
if ($this->debug > 0) { if ($this->debug > 0) {
error_log('New LP - scorm::scorm('.$course_code.','.$resource_id.','.$user_id.') - In scorm constructor', 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 * Import the scorm object (as a result from the parse_manifest function) into the database structure
* @param string $course_code * @param string $course_code
* @param int $use_max_score * @param int $use_max_score
* @param int $sessionId
*
* @return bool Returns -1 on error * @return bool Returns -1 on error
*/ */
public function import_manifest($course_code, $use_max_score = 1, $sessionId = null) public function import_manifest($course_code, $use_max_score = 1, $sessionId = null)

@ -110,6 +110,7 @@ $server->wsdl->addComplexType(
), ),
'file_data' => array('name' => 'file', 'type' => 'xsd:string'), 'file_data' => array('name' => 'file', 'type' => 'xsd:string'),
'filename' => array('name' => 'filename', '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'), '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; $sessionIdName = isset($params['session_id_name']) ? $params['session_id_name'] : null;
$sessionIdValue = isset($params['session_id_value']) ? $params['session_id_value'] : null; $sessionIdValue = isset($params['session_id_value']) ? $params['session_id_value'] : null;
$lpName = $params['lp_name'];
$courseCode = CourseManager::get_course_id_from_original_id( $courseCode = CourseManager::get_course_id_from_original_id(
$courseIdValue, $courseIdValue,
$courseIdName $courseIdName
@ -173,7 +176,7 @@ function WSImportLP($params)
$maker = 'Scorm'; $maker = 'Scorm';
$maxScore = ''; //$_REQUEST['use_max_score'] $maxScore = ''; //$_REQUEST['use_max_score']
$oScorm = new scorm(); $oScorm = new scorm($courseCode);
$fileData = base64_decode($params['file_data']); $fileData = base64_decode($params['file_data']);
$uniqueFile = uniqid(); $uniqueFile = uniqid();
@ -203,7 +206,7 @@ function WSImportLP($params)
$maxScore, $maxScore,
$sessionId $sessionId
); );
$oScorm->set_name($lpName);
$oScorm->set_proximity($proximity, $courseId); $oScorm->set_proximity($proximity, $courseId);
$oScorm->set_maker($maker, $courseId); $oScorm->set_maker($maker, $courseId);
//$oScorm->set_jslib('scorm_api.php'); //$oScorm->set_jslib('scorm_api.php');

Loading…
Cancel
Save