ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilObjSCORMVerification Class Reference

SCORM Verification. More...

+ Inheritance diagram for ilObjSCORMVerification:
+ Collaboration diagram for ilObjSCORMVerification:

Static Public Member Functions

static createFromSCORMLM (ilObjSAHSLearningModule $a_lm, $a_user_id)
 Import relevant properties from given learning module.
- Static Public Member Functions inherited from ilVerificationObject
static initStorage ($a_id, $a_subdir=null)
- Static Public Member Functions inherited from ilObject2
static _lookupObjIdByImportId ($a_import_id)
static _getAllReferences ($a_id)
 get all reference ids of object
static _lookupTitle ($a_id)
 lookup object title
static _getIdsForTitle ($title, $type= '', $partialmatch=false)
static _lookupDescription ($a_id)
 lookup object description
static _lookupObjId ($a_id)
static _lookupType ($a_id, $a_reference=false)
 lookup object type
static _lookupObjectId ($a_ref_id)
 lookup object id
static _exists ($a_id, $a_reference=false)
static _getObjectsByType ($a_obj_type="", $a_owner="")
 Get objects by type.
static _prepareCloneSelection ($a_ref_ids, $new_type)
static _getIcon ($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
 Get icon for repository item.
- Static Public Member Functions inherited from ilObject
static setDeletedDates ($a_ref_ids)
 Set deleted date type $ilDB.
static _exists ($a_id, $a_reference=false, $a_type=null)
 checks if an object exists in object_data
static _prepareCloneSelection ($a_ref_ids, $new_type, $show_path=true)
 Prepare copy wizard object selection.
static collectDeletionDependencies (&$deps, $a_ref_id, $a_obj_id, $a_type, $a_depth=0)
 Collect deletion dependencies.
static getDeletionDependencies ($a_obj_id)
 Get deletion dependencies.
static getLongDescriptions (array $a_obj_ids)
 Get long description data.
static getAllOwnedRepositoryObjects ($a_user_id)
 Get all ids of objects user owns.
static hasAutoRating ($a_type, $a_ref_id)
 Check if auto rating is active for parent group/course.

Protected Member Functions

 initType ()
 getPropertyMap ()
 Return property map (name => type)
- Protected Member Functions inherited from ilVerificationObject
 importProperty ($a_type, $a_data=null, $a_raw_data=null)
 Import property from database.
 exportProperty ($a_name)
 Export property to database.
 doRead ()
 Read database entry.
 saveProperties ()
 Save current properties to database.
 handleQuotaUpdate ()
- Protected Member Functions inherited from ilObject2
 beforeCreate ()
 beforeUpdate ()
 doMDUpdateListener ($a_element)
 beforeMDUpdateListener ($a_element)
 doCreateMetaData ()
 beforeCreateMetaData ()
 doUpdateMetaData ()
 beforeUpdateMetaData ()
 beforeDelete ()
 doCloneObject ($new_obj, $a_target_id, $a_copy_id=null)
 beforeCloneObject ()

Additional Inherited Members

- Public Member Functions inherited from ilVerificationObject
 __construct ($a_id=0, $a_reference=true)
 Constructor public.
 hasProperty ($a_name)
 Check if given property is valid.
 getPropertyType ($a_name)
 Get property data type.
 getProperty ($a_name)
 Get property value.
 setProperty ($a_name, $a_value)
 Set property value.
 doCreate ()
 doUpdate ()
 doDelete ()
 Delete entry from database.
 getFilePath ()
 getOfflineFilename ()
- Data Fields inherited from ilVerificationObject
const TYPE_STRING = 1
const TYPE_BOOL = 2
const TYPE_INT = 3
const TYPE_DATE = 4
const TYPE_RAW = 5
const TYPE_ARRAY = 6
- Protected Attributes inherited from ilVerificationObject
 $map = array()
 $properties = array()

Detailed Description

SCORM Verification.

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

Definition at line 15 of file class.ilObjSCORMVerification.php.

Member Function Documentation

static ilObjSCORMVerification::createFromSCORMLM ( ilObjSAHSLearningModule  $a_lm,
  $a_user_id 
)
static

Import relevant properties from given learning module.

Parameters
ilObjSAHSLearningModule$a_lm
Returns
object

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

References ilObject\$lng, $path, ilObjUser\_lookupFields(), ilObjSCORMLearningModule\_lookupLastAccess(), ilObjSCORM2004LearningModule\_lookupLastAccess(), ilObject\getDescription(), ilObject\getId(), ilObject\getTitle(), IL_CAL_DATETIME, and ilVerificationObject\initStorage().

Referenced by ilObjSCORMVerificationGUI\save().

{
global $lng;
$lng->loadLanguageModule("sahs");
$newObj = new self();
$newObj->setTitle($a_lm->getTitle());
$newObj->setDescription($a_lm->getDescription());
include_once "Services/Tracking/classes/class.ilLPMarks.php";
$lp_marks = new ilLPMarks($a_lm->getId(), $a_user_id);
$newObj->setProperty("issued_on",
new ilDate($lp_marks->getStatusChanged(), IL_CAL_DATETIME));
// create certificate
if(!stristr(get_class($a_lm), "2004"))
{
$last_access = ilObjSCORMLearningModule::_lookupLastAccess($a_lm->getId(), $a_user_id);
}
else
{
$last_access = ilObjSCORM2004LearningModule::_lookupLastAccess($a_lm->getId(), $a_user_id);
}
$params = array(
"user_data" => ilObjUser::_lookupFields($a_user_id),
"last_access" => $last_access
);
include_once "Services/Certificate/classes/class.ilCertificate.php";
include_once "Modules/ScormAicc/classes/class.ilSCORMCertificateAdapter.php";
$certificate = new ilCertificate(new ilSCORMCertificateAdapter($a_lm));
$certificate = $certificate->outCertificate($params, false);
// save pdf file
if($certificate)
{
// we need the object id for storing the certificate file
$newObj->create();
$path = self::initStorage($newObj->getId(), "certificate");
$file_name = "sahs_".$a_lm->getId()."_".$a_user_id.".pdf";
if(file_put_contents($path.$file_name, $certificate))
{
$newObj->setProperty("file", $file_name);
$newObj->update();
return $newObj;
}
// file creation failed, so remove to object, too
$newObj->delete();
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjSCORMVerification::getPropertyMap ( )
protected

Return property map (name => type)

Returns
array

Reimplemented from ilVerificationObject.

Definition at line 22 of file class.ilObjSCORMVerification.php.

{
return array("issued_on" => self::TYPE_DATE,
"file" => self::TYPE_STRING
);
}
ilObjSCORMVerification::initType ( )
protected

Reimplemented from ilObject2.

Definition at line 17 of file class.ilObjSCORMVerification.php.

{
$this->type = "scov";
}

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