ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilObjExerciseVerification Class Reference

Exercise Verification. More...

+ Inheritance diagram for ilObjExerciseVerification:
+ Collaboration diagram for ilObjExerciseVerification:

Static Public Member Functions

static createFromExercise (ilObjExercise $a_exercise, $a_user_id)
 Import relevant properties from given exercise.
- 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

Exercise 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.ilObjExerciseVerification.php.

Member Function Documentation

static ilObjExerciseVerification::createFromExercise ( ilObjExercise  $a_exercise,
  $a_user_id 
)
static

Import relevant properties from given exercise.

Parameters
ilObjExercise$a_test
Returns
object

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

References ilObject\$lng, $path, ilObject\getDescription(), ilObject\getId(), ilObject\getTitle(), IL_CAL_DATETIME, and ilVerificationObject\initStorage().

Referenced by ilObjExerciseVerificationGUI\save().

{
global $lng;
$lng->loadLanguageModule("exercise");
$newObj = new self();
$newObj->setTitle($a_exercise->getTitle());
$newObj->setDescription($a_exercise->getDescription());
include_once "Services/Tracking/classes/class.ilLPMarks.php";
$lp_marks = new ilLPMarks($a_exercise->getId(), $a_user_id);
$newObj->setProperty("issued_on",
new ilDate($lp_marks->getStatusChanged(), IL_CAL_DATETIME));
// create certificate
include_once "Services/Certificate/classes/class.ilCertificate.php";
include_once "Modules/Exercise/classes/class.ilExerciseCertificateAdapter.php";
$certificate = new ilCertificate(new ilExerciseCertificateAdapter($a_exercise));
$certificate = $certificate->outCertificate(array("user_id" => $a_user_id), 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 = "exc_".$a_exercise->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:

ilObjExerciseVerification::getPropertyMap ( )
protected

Return property map (name => type)

Returns
array

Reimplemented from ilVerificationObject.

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

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

Reimplemented from ilObject2.

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

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

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