24 include_once
"./Services/Certificate/classes/class.ilCertificateAdapter.php";
46 $lng->loadLanguageModule(
'certificate');
56 return CLIENT_WEB_DIR .
"/assessment/certificates/" . $this->
object->getId() .
"/";
78 $insert_tags = array();
79 foreach($vars as $id => $caption)
81 $insert_tags[
"[".$id.
"]"] = $caption;
98 $active_id = $params[
"active_id"];
99 $pass = $params[
"pass"];
100 $userfilter = array_key_exists(
"userfilter", $params) ? $params[
"userfilter"] :
"";
101 $passedonly = array_key_exists(
"passedonly", $params) ? $params[
"passedonly"] : FALSE;
104 $result_array =& $this->
object->getTestResult($active_id,
$pass);
108 $result_array =& $this->
object->getTestResult($active_id);
110 if (($passedonly) && ($result_array[
"test"][
"passed"] == FALSE))
return "";
111 $passed = $result_array[
"test"][
"passed"] ? $lng->txt(
"certificate_passed") : $lng->txt(
"certificate_failed");
112 if (!$result_array[
"test"][
"total_max_points"])
118 $percentage = ($result_array[
"test"][
"total_reached_points"]/$result_array[
"test"][
"total_max_points"])*100;
120 $mark_obj = $this->
object->mark_schema->getMatchingMark($percentage);
121 $user_id = $this->
object->_getUserIdFromActiveId($active_id);
122 include_once
'./Services/User/classes/class.ilObjUser.php';
124 if (strlen($userfilter))
126 if (!@preg_match(
"/$userfilter/i", $user_data[
"lastname"] .
", " . $user_data[
"firstname"] .
" " . $user_data[
"title"]))
137 $vars[
"RESULT_PERCENT"] = sprintf(
"%2.2f", $percentage) .
"%";
143 foreach($vars as $id => $caption)
145 $insert_tags[
"[".$id.
"]"] = $caption;
161 $vars[
"RESULT_PASSED"] = $lng->txt(
"certificate_ph_passed");
162 $vars[
"RESULT_POINTS"] = $lng->txt(
"certificate_ph_resultpoints");
163 $vars[
"RESULT_PERCENT"] = $lng->txt(
"certificate_ph_resultpercent");
164 $vars[
"MAX_POINTS"] = $lng->txt(
"certificate_ph_maxpoints");
165 $vars[
"RESULT_MARK_SHORT"] = $lng->txt(
"certificate_ph_markshort");
166 $vars[
"RESULT_MARK_LONG"] = $lng->txt(
"certificate_ph_marklong");
167 $vars[
"TEST_TITLE"] = $lng->txt(
"certificate_ph_testtitle");
169 $template =
new ilTemplate(
"tpl.il_as_tst_certificate_edit.html", TRUE, TRUE,
"Modules/Test");
170 $template->setCurrentBlock(
"items");
171 foreach($vars as $id => $caption)
173 $template->setVariable(
"ID", $id);
174 $template->setVariable(
"TXT", $caption);
175 $template->parseCurrentBlock();
178 $template->setVariable(
"PH_INTRODUCTION", $lng->txt(
"certificate_ph_introduction"));
180 return $template->get();
195 $visibility =
new ilRadioMatrixInputGUI($lng->txt(
"certificate_visibility"),
"certificate_visibility");
197 0 => $lng->txt(
"certificate_visibility_always"),
198 1 => $lng->txt(
"certificate_visibility_passed"),
199 2 => $lng->txt(
"certificate_visibility_never")
202 $visibility->setInfo($lng->txt(
"certificate_visibility_introduction"));
203 $visibility->setValue($form_fields[
"certificate_visibility"]);
204 if (count(
$_POST)) $visibility->checkInput();
205 $form->addItem($visibility);
218 $form_fields[
"certificate_visibility"] =
$_POST[
"certificate_visibility"];
231 $form_fields[
"certificate_visibility"] = $this->
object->getCertificateVisibility();
243 $this->
object->saveCertificateVisibility($form_fields[
"certificate_visibility"]);
265 return $this->
object->getId();