4 include_once
"./Services/Certificate/classes/class.ilCertificateAdapter.php";
25 parent::__construct();
35 return CLIENT_WEB_DIR .
"/assessment/certificates/" . $this->
object->getId() .
"/";
57 $insert_tags =
array();
58 foreach($vars as $id => $caption)
60 $insert_tags[
"[".$id.
"]"] = $caption;
78 $active_id =
$params[
"active_id"];
80 $userfilter = array_key_exists(
"userfilter",
$params) ?
$params[
"userfilter"] :
"";
81 $passedonly = array_key_exists(
"passedonly",
$params) ?
$params[
"passedonly"] : FALSE;
84 $result_array =& $this->
object->getTestResult($active_id,
$pass);
88 $result_array =& $this->
object->getTestResult($active_id);
90 if (($passedonly) && ($result_array[
"test"][
"passed"] == FALSE))
return "";
91 $passed = $result_array[
"test"][
"passed"] ? $lng->txt(
"certificate_passed") : $lng->txt(
"certificate_failed");
92 if (!$result_array[
"test"][
"total_max_points"])
98 $percentage = ($result_array[
"test"][
"total_reached_points"]/$result_array[
"test"][
"total_max_points"])*100;
100 $mark_obj = $this->
object->mark_schema->getMatchingMark($percentage);
101 $user_id = $this->
object->_getUserIdFromActiveId($active_id);
102 include_once
'./Services/User/classes/class.ilObjUser.php';
105 if (strlen($userfilter))
107 if (!@preg_match(
"/$userfilter/i", $user_data[
"lastname"] .
", " . $user_data[
"firstname"] .
" " . $user_data[
"title"]))
113 require_once
'Services/Tracking/classes/class.ilObjUserTracking.php';
127 $vars[
"RESULT_PERCENT"] = sprintf(
"%2.2f", $percentage) .
"%";
133 foreach($vars as $id => $caption)
135 $insert_tags[
"[".$id.
"]"] = $caption;
152 $vars[
"RESULT_PASSED"] = $lng->txt(
"certificate_ph_passed");
153 $vars[
"RESULT_POINTS"] = $lng->txt(
"certificate_ph_resultpoints");
154 $vars[
"RESULT_PERCENT"] = $lng->txt(
"certificate_ph_resultpercent");
155 $vars[
"MAX_POINTS"] = $lng->txt(
"certificate_ph_maxpoints");
156 $vars[
"RESULT_MARK_SHORT"] = $lng->txt(
"certificate_ph_markshort");
157 $vars[
"RESULT_MARK_LONG"] = $lng->txt(
"certificate_ph_marklong");
158 $vars[
"TEST_TITLE"] = $lng->txt(
"certificate_ph_testtitle");
160 $template =
new ilTemplate(
"tpl.il_as_tst_certificate_edit.html", TRUE, TRUE,
"Modules/Test");
161 $template->setCurrentBlock(
"items");
162 foreach($vars as $id => $caption)
164 $template->setVariable(
"ID", $id);
165 $template->setVariable(
"TXT", $caption);
166 $template->parseCurrentBlock();
170 $template->setVariable(
"PH_INTRODUCTION", $lng->txt(
"certificate_ph_introduction"));
172 return $template->get();
188 $visibility =
new ilRadioGroupInputGUI($lng->txt(
"certificate_visibility"),
"certificate_visibility");
190 $visibility->addOption(
new ilRadioOption($lng->txt(
"certificate_visibility_passed"), 1));
191 $visibility->addOption(
new ilRadioOption($lng->txt(
"certificate_visibility_never"), 2));
192 $visibility->setInfo($lng->txt(
"certificate_visibility_introduction"));
193 $visibility->setValue($form_fields[
"certificate_visibility"]);
194 if (count(
$_POST)) $visibility->checkInput();
195 $form->addItem($visibility);
208 $form_fields[
"certificate_visibility"] =
$_POST[
"certificate_visibility"];
221 $form_fields[
"certificate_visibility"] = $this->
object->getCertificateVisibility();
233 $this->
object->saveCertificateVisibility($form_fields[
"certificate_visibility"]);
255 return $this->
object->getId();
266 return $this->
object->_getUserIdFromActiveId($a_params[
"active_id"]);
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
This class represents an option in a radio group.
__construct(&$object)
ilTestCertificateAdapter contructor
getUserCompletionDate($a_user_id, $a_object_id=null)
Get completion for user.
saveFormFields(&$form_fields)
Allows to save additional adapter form fields This method will be called when the certificate editor ...
addFormFieldsFromPOST(&$form_fields)
Allows to add additional form values to the array of form values evaluating a HTTP POST action...
static _enabledLearningProgress()
check wether learing progress is enabled or not
getCertificateVariablesForPresentation($params=array())
Returns an array containing all variables and values which can be exchanged in the certificate The va...
special template class to simplify handling of ITX/PEAR
getBaseVariablesDescription($a_enable_last_access=true, $a_enable_completion_date=true)
Get variable descriptions.
getCertificateID()
Returns a certificate ID This value will be used to generate unique file names for the certificates...
addAdditionalFormElements(&$form, $form_fields)
Allows to add additional form fields to the certificate editor form This method will be called when t...
Create styles array
The data for the language used.
addFormFieldsFromObject(&$form_fields)
Allows to add additional form values to the array of form values evaluating the associated adapter cl...
getCertificateVariablesForPreview()
Returns an array containing all variables and values which can be exchanged in the certificate...
Create new PHPExcel object
obj_idprivate
Adapter class to provide certificate data for the certificate generator.
getAdapterType()
Returns the adapter type This value will be used to generate file names for the certificates.
static _lookupFields($a_user_id)
lookup fields (deprecated; use more specific methods instead)
getBaseVariablesForPreview($a_enable_last_access=true, $a_enable_completion_date=true)
Get variable dummys.
getBaseVariablesForPresentation($a_user_data, $a_last_access=null, $a_completion_date=false)
Get variable values.
getCertificatePath()
Returns the certificate path (with a trailing path separator)
Test certificate adapter.
getUserIdForParams($a_params)
Get user id for params.
getCertificateVariablesDescription()
Returns a description of the available certificate parameters.