4 include_once
"./Services/Certificate/classes/class.ilCertificateAdapter.php";
26 $lng->loadLanguageModule(
'certificate');
36 return CLIENT_WEB_DIR .
"/assessment/certificates/" . $this->
object->getId() .
"/";
58 $insert_tags = array();
59 foreach($vars as $id => $caption)
61 $insert_tags[
"[".$id.
"]"] = $caption;
79 $active_id = $params[
"active_id"];
80 $pass = $params[
"pass"];
81 $userfilter = array_key_exists(
"userfilter", $params) ? $params[
"userfilter"] :
"";
82 $passedonly = array_key_exists(
"passedonly", $params) ? $params[
"passedonly"] : FALSE;
85 $result_array =& $this->
object->getTestResult($active_id,
$pass);
89 $result_array =& $this->
object->getTestResult($active_id);
91 if (($passedonly) && ($result_array[
"test"][
"passed"] == FALSE))
return "";
92 $passed = $result_array[
"test"][
"passed"] ? $lng->txt(
"certificate_passed") : $lng->txt(
"certificate_failed");
93 if (!$result_array[
"test"][
"total_max_points"])
99 $percentage = ($result_array[
"test"][
"total_reached_points"]/$result_array[
"test"][
"total_max_points"])*100;
101 $mark_obj = $this->
object->mark_schema->getMatchingMark($percentage);
102 $user_id = $this->
object->_getUserIdFromActiveId($active_id);
103 include_once
'./Services/User/classes/class.ilObjUser.php';
106 if (strlen($userfilter))
108 if (!@preg_match(
"/$userfilter/i", $user_data[
"lastname"] .
", " . $user_data[
"firstname"] .
" " . $user_data[
"title"]))
114 if($user_data[
"usr_id"] > 0)
120 $completion_date =
false;
126 $vars[
"RESULT_PERCENT"] = sprintf(
"%2.2f", $percentage) .
"%";
132 foreach($vars as $id => $caption)
134 $insert_tags[
"[".$id.
"]"] = $caption;
151 $vars[
"RESULT_PASSED"] = $lng->txt(
"certificate_ph_passed");
152 $vars[
"RESULT_POINTS"] = $lng->txt(
"certificate_ph_resultpoints");
153 $vars[
"RESULT_PERCENT"] = $lng->txt(
"certificate_ph_resultpercent");
154 $vars[
"MAX_POINTS"] = $lng->txt(
"certificate_ph_maxpoints");
155 $vars[
"RESULT_MARK_SHORT"] = $lng->txt(
"certificate_ph_markshort");
156 $vars[
"RESULT_MARK_LONG"] = $lng->txt(
"certificate_ph_marklong");
157 $vars[
"TEST_TITLE"] = $lng->txt(
"certificate_ph_testtitle");
159 $template =
new ilTemplate(
"tpl.il_as_tst_certificate_edit.html", TRUE, TRUE,
"Modules/Test");
160 $template->setCurrentBlock(
"items");
161 foreach($vars as $id => $caption)
163 $template->setVariable(
"ID", $id);
164 $template->setVariable(
"TXT", $caption);
165 $template->parseCurrentBlock();
169 $template->setVariable(
"PH_INTRODUCTION", $lng->txt(
"certificate_ph_introduction"));
171 return $template->get();
187 $visibility =
new ilRadioGroupInputGUI($lng->txt(
"certificate_visibility"),
"certificate_visibility");
189 $visibility->addOption(
new ilRadioOption($lng->txt(
"certificate_visibility_passed"), 1));
190 $visibility->addOption(
new ilRadioOption($lng->txt(
"certificate_visibility_never"), 2));
191 $visibility->setInfo($lng->txt(
"certificate_visibility_introduction"));
192 $visibility->setValue($form_fields[
"certificate_visibility"]);
193 if (count(
$_POST)) $visibility->checkInput();
194 $form->addItem($visibility);
207 $form_fields[
"certificate_visibility"] =
$_POST[
"certificate_visibility"];
220 $form_fields[
"certificate_visibility"] = $this->
object->getCertificateVisibility();
232 $this->
object->saveCertificateVisibility($form_fields[
"certificate_visibility"]);
254 return $this->
object->getId();
265 return $this->
object->_getUserIdFromActiveId($a_params[
"active_id"]);