4include_once
"./Services/Certificate/classes/class.ilCertificateAdapter.php";
25 parent::__construct();
35 return CLIENT_WEB_DIR .
"/assessment/certificates/" . $this->
object->getId() .
"/";
55 $insert_tags = array();
56 foreach ($vars as
$id => $caption) {
57 $insert_tags[
"[" .
$id .
"]"] = $caption;
73 $active_id =
$params[
"active_id"];
75 $userfilter = array_key_exists(
"userfilter",
$params) ?
$params[
"userfilter"] :
"";
76 $passedonly = array_key_exists(
"passedonly",
$params) ?
$params[
"passedonly"] :
false;
78 $result_array =&$this->
object->getTestResult($active_id,
$pass);
80 $result_array =&$this->
object->getTestResult($active_id);
82 if (($passedonly) && ($result_array[
"test"][
"passed"] ==
false)) {
85 $passed = $result_array[
"test"][
"passed"] ? $this->lng->txt(
"certificate_passed") : $this->lng->txt(
"certificate_failed");
86 if (!$result_array[
"test"][
"total_max_points"]) {
89 $percentage = ($result_array[
"test"][
"total_reached_points"]/$result_array[
"test"][
"total_max_points"])*100;
91 $mark_obj = $this->
object->mark_schema->getMatchingMark($percentage);
92 $user_id = $this->
object->_getUserIdFromActiveId($active_id);
93 include_once
'./Services/User/classes/class.ilObjUser.php';
96 if (strlen($userfilter)) {
97 if (!@preg_match(
"/$userfilter/i", $user_data[
"lastname"] .
", " . $user_data[
"firstname"] .
" " . $user_data[
"title"])) {
112 $vars[
"RESULT_PERCENT"] =
sprintf(
"%2.2f", $percentage) .
"%";
118 foreach ($vars as
$id => $caption) {
119 $insert_tags[
"[" .
$id .
"]"] = $caption;
134 $vars[
"RESULT_PASSED"] = $this->lng->txt(
"certificate_ph_passed");
135 $vars[
"RESULT_POINTS"] = $this->lng->txt(
"certificate_ph_resultpoints");
136 $vars[
"RESULT_PERCENT"] = $this->lng->txt(
"certificate_ph_resultpercent");
137 $vars[
"MAX_POINTS"] = $this->lng->txt(
"certificate_ph_maxpoints");
138 $vars[
"RESULT_MARK_SHORT"] = $this->lng->txt(
"certificate_ph_markshort");
139 $vars[
"RESULT_MARK_LONG"] = $this->lng->txt(
"certificate_ph_marklong");
140 $vars[
"TEST_TITLE"] = $this->lng->txt(
"certificate_ph_testtitle");
142 $template =
new ilTemplate(
"tpl.il_as_tst_certificate_edit.html",
true,
true,
"Modules/Test");
144 foreach ($vars as
$id => $caption) {
151 $template->setVariable(
"PH_INTRODUCTION", $this->lng->txt(
"certificate_ph_introduction"));
167 $visibility =
new ilRadioGroupInputGUI($this->lng->txt(
"certificate_visibility"),
"certificate_visibility");
168 $visibility->addOption(
new ilRadioOption($this->lng->txt(
"certificate_visibility_always"), 0));
169 $visibility->addOption(
new ilRadioOption($this->lng->txt(
"certificate_visibility_passed"), 1));
170 $visibility->addOption(
new ilRadioOption($this->lng->txt(
"certificate_visibility_never"), 2));
171 $visibility->setInfo($this->lng->txt(
"certificate_visibility_introduction"));
172 $visibility->setValue($form_fields[
"certificate_visibility"]);
174 $visibility->checkInput();
176 $form->addItem($visibility);
189 $form_fields[
"certificate_visibility"] =
$_POST[
"certificate_visibility"];
202 $form_fields[
"certificate_visibility"] = $this->
object->getCertificateVisibility();
214 $this->
object->saveCertificateVisibility($form_fields[
"certificate_visibility"]);
236 return $this->
object->getId();
247 return $this->
object->_getUserIdFromActiveId($a_params[
"active_id"]);
sprintf('%.4f', $callTime)
An exception for terminatinating execution or to throw for unit testing.
Adapter class to provide certificate data for the certificate generator.
getBaseVariablesForPresentation($a_user_data, $a_last_access=null, $a_completion_date=false)
Get variable values.
getBaseVariablesForPreview($a_enable_last_access=true, $a_enable_completion_date=true)
Get variable dummys.
getUserCompletionDate($a_user_id, $a_object_id=null)
Get completion for user.
getBaseVariablesDescription($a_enable_last_access=true, $a_enable_completion_date=true)
Get variable descriptions.
@classDescription Date and time handling
static _enabledLearningProgress()
check wether learing progress is enabled or not
static _lookupFields($a_user_id)
lookup fields (deprecated; use more specific methods instead)
This class represents an option in a radio group.
special template class to simplify handling of ITX/PEAR
Test certificate adapter.
getCertificatePath()
Returns the certificate path (with a trailing path separator)
__construct($object)
ilTestCertificateAdapter contructor
addFormFieldsFromObject(&$form_fields)
Allows to add additional form values to the array of form values evaluating the associated adapter cl...
getCertificateVariablesForPresentation($params=array())
Returns an array containing all variables and values which can be exchanged in the certificate The va...
addFormFieldsFromPOST(&$form_fields)
Allows to add additional form values to the array of form values evaluating a HTTP POST action.
getUserIdForParams($a_params)
Get user id for params.
getCertificateVariablesForPreview()
Returns an array containing all variables and values which can be exchanged in the certificate.
addAdditionalFormElements(&$form, $form_fields)
Allows to add additional form fields to the certificate editor form This method will be called when t...
getCertificateID()
Returns a certificate ID This value will be used to generate unique file names for the certificates.
getAdapterType()
Returns the adapter type This value will be used to generate file names for the certificates.
getCertificateVariablesDescription()
Returns a description of the available certificate parameters.
saveFormFields(&$form_fields)
Allows to save additional adapter form fields This method will be called when the certificate editor ...
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms @access public
if(!array_key_exists('StateId', $_REQUEST)) $id
if(isset($_POST['submit'])) $form