ILIAS  Release_4_2_x_branch Revision 61807
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilObjTestVerification Class Reference

Test Verification. More...

+ Inheritance diagram for ilObjTestVerification:
+ Collaboration diagram for ilObjTestVerification:

Static Public Member Functions

static createFromTest (ilObjTest $a_test, $a_user_id)
 Import relevant properties from given test.
- 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 _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 _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.

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.
- 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

Test 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.ilObjTestVerification.php.

Member Function Documentation

static ilObjTestVerification::createFromTest ( ilObjTest  $a_test,
  $a_user_id 
)
static

Import relevant properties from given test.

Parameters
ilObjTest$a_test
Returns
object

Definition at line 40 of file class.ilObjTestVerification.php.

References $file_name, ilObject\$lng, $pass, $path, ilObjTest\_getResultPass(), ilObjTest\getActiveIdOfUser(), ilObject\getDescription(), ilObjTest\getPassFinishDate(), ilObject\getTitle(), IL_CAL_UNIX, and ilVerificationObject\initStorage().

Referenced by ilObjTestVerificationGUI\save().

{
global $lng;
$lng->loadLanguageModule("wsp");
$newObj = new self();
$newObj->setTitle($lng->txt("wsp_type_tstv")." \"".$a_test->getTitle()."\"");
$newObj->setDescription($a_test->getDescription());
$active_id = $a_test->getActiveIdOfUser($a_user_id);
$date = $a_test->getPassFinishDate($active_id, $pass);
$newObj->setProperty("issued_on", new ilDate($date, IL_CAL_UNIX));
// create certificate
include_once "Services/Certificate/classes/class.ilCertificate.php";
include_once "Modules/Test/classes/class.ilTestCertificateAdapter.php";
$certificate = new ilCertificate(new ilTestCertificateAdapter($a_test));
$certificate = $certificate->outCertificate(array("active_id" => $active_id, "pass" => $pass), 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 = "tst_".$a_test->getId()."_".$a_user_id."_".$active_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:

ilObjTestVerification::getPropertyMap ( )
protected

Return property map (name => type)

Returns
array

Reimplemented from ilVerificationObject.

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

{
return array("issued_on" => self::TYPE_DATE,
"file" => self::TYPE_STRING
/*
"success" => self::TYPE_BOOL,
"result" => self::TYPE_STRING,
"mark" => self::TYPE_STRING
*/
);
}
ilObjTestVerification::initType ( )
protected

Reimplemented from ilObject2.

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

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

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