Public Member Functions

ilSoapSCORMAdministration Class Reference

Inheritance diagram for ilSoapSCORMAdministration:
Collaboration diagram for ilSoapSCORMAdministration:

Public Member Functions

 ilSoapExerciseAdministration ()
 getIMSManifestXML ($sid, $ref_id)
 get ims manifest xml

Detailed Description

Definition at line 35 of file class.ilSoapSCORMAdministration.php.


Member Function Documentation

ilSoapSCORMAdministration::getIMSManifestXML ( sid,
ref_id 
)

get ims manifest xml

Parameters:
string $sid
int $ref_id
Returns:
xml following scorm.dtd

Definition at line 51 of file class.ilSoapSCORMAdministration.php.

References $ilLog, $ref_id, ilSoapAdministration::__checkSession(), ilSoapAdministration::__raiseError(), ilObject::_getAllReferences(), ilObject::_isInTrash(), ilObject::_lookupObjectId(), and ilObjectFactory::getInstanceByObjId().

                                                   {
                if(!$this->__checkSession($sid))
                {
                        return $this->__raiseError($this->sauth->getMessage(),$this->sauth->getMessageCode());
                }
                if(!strlen($ref_id))
                {
                        return $this->__raiseError('No ref id given. Aborting!',
                                                                           'Client');
                }
                include_once './include/inc.header.php';
                global $rbacsystem, $tree, $ilLog;

                // get obj_id
                if(!$obj_id = ilObject::_lookupObjectId($ref_id))
                {
                        return $this->__raiseError('No exercise found for id: '.$ref_id,
                                                                           'Client');
                }

                if(ilObject::_isInTrash($ref_id))
                {
                        return $this->__raiseError("Parent with ID $ref_id has been deleted.", 'Client');
                }

                // Check access
                $permission_ok = false;
                foreach($ref_ids = ilObject::_getAllReferences($obj_id) as $ref_id)
                {
                        if($rbacsystem->checkAccess('read',$ref_id))
                        {
                                $permission_ok = true;
                                break;
                        }
                }

                if(!$permission_ok)
                {
                        return $this->__raiseError('No permission to read the object with id: '.$ref_id,
                                                                           'Server');
                }

                $lm_obj = ilObjectFactory::getInstanceByObjId($obj_id, false);
                if (!is_object($lm_obj) || $lm_obj->getType()!= "sahs")
                {
                        return $this->__raiseError('Wrong obj id or type for scorm object with id '.$ref_id,
                                                                           'Server');
                }
                // get scorm xml
                require_once("./Modules/ScormAicc/classes/SCORM/class.ilSCORMObject.php");
                require_once("./Modules/ScormAicc/classes/SCORM/class.ilSCORMResource.php");

                $imsFilename = $lm_obj->getDataDirectory().DIRECTORY_SEPARATOR."imsmanifest.xml";

                if (!file_exists($imsFilename)) {
                        return $this->__raiseError('Could not find manifest file for object with ref id '.$ref_id,
                                                                           'Server');
                        
                }
                return file_get_contents($imsFilename);
        }

Here is the call graph for this function:

ilSoapSCORMAdministration::ilSoapExerciseAdministration (  ) 

Definition at line 37 of file class.ilSoapSCORMAdministration.php.

References ilSoapAdministration::ilSoapAdministration().

Here is the call graph for this function:


The documentation for this class was generated from the following file: