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;
99 $active_id = $params[
"active_id"];
100 $pass = $params[
"pass"];
101 $userfilter = array_key_exists(
"userfilter", $params) ? $params[
"userfilter"] :
"";
102 $passedonly = array_key_exists(
"passedonly", $params) ? $params[
"passedonly"] : FALSE;
105 $result_array =& $this->
object->getTestResult($active_id,
$pass);
109 $result_array =& $this->
object->getTestResult($active_id);
111 if (($passedonly) && ($result_array[
"test"][
"passed"] == FALSE))
return "";
112 $passed = $result_array[
"test"][
"passed"] ? $lng->txt(
"certificate_passed") : $lng->txt(
"certificate_failed");
113 if (!$result_array[
"test"][
"total_max_points"])
119 $percentage = ($result_array[
"test"][
"total_reached_points"]/$result_array[
"test"][
"total_max_points"])*100;
121 $mark_obj = $this->
object->mark_schema->getMatchingMark($percentage);
122 $user_id = $this->
object->_getUserIdFromActiveId($active_id);
123 include_once
'./Services/User/classes/class.ilObjUser.php';
126 if (strlen($userfilter))
128 if (!@preg_match(
"/$userfilter/i", $user_data[
"lastname"] .
", " . $user_data[
"firstname"] .
" " . $user_data[
"title"]))
134 if($user_data[
"usr_id"] > 0)
140 $completion_date =
false;
146 $vars[
"RESULT_PERCENT"] = sprintf(
"%2.2f", $percentage) .
"%";
152 foreach($vars as $id => $caption)
154 $insert_tags[
"[".$id.
"]"] = $caption;
171 $vars[
"RESULT_PASSED"] = $lng->txt(
"certificate_ph_passed");
172 $vars[
"RESULT_POINTS"] = $lng->txt(
"certificate_ph_resultpoints");
173 $vars[
"RESULT_PERCENT"] = $lng->txt(
"certificate_ph_resultpercent");
174 $vars[
"MAX_POINTS"] = $lng->txt(
"certificate_ph_maxpoints");
175 $vars[
"RESULT_MARK_SHORT"] = $lng->txt(
"certificate_ph_markshort");
176 $vars[
"RESULT_MARK_LONG"] = $lng->txt(
"certificate_ph_marklong");
177 $vars[
"TEST_TITLE"] = $lng->txt(
"certificate_ph_testtitle");
179 $template =
new ilTemplate(
"tpl.il_as_tst_certificate_edit.html", TRUE, TRUE,
"Modules/Test");
180 $template->setCurrentBlock(
"items");
181 foreach($vars as $id => $caption)
183 $template->setVariable(
"ID", $id);
184 $template->setVariable(
"TXT", $caption);
185 $template->parseCurrentBlock();
189 $template->setVariable(
"PH_INTRODUCTION", $lng->txt(
"certificate_ph_introduction"));
191 return $template->get();
206 $visibility =
new ilRadioMatrixInputGUI($lng->txt(
"certificate_visibility"),
"certificate_visibility");
208 0 => $lng->txt(
"certificate_visibility_always"),
209 1 => $lng->txt(
"certificate_visibility_passed"),
210 2 => $lng->txt(
"certificate_visibility_never")
213 $visibility->setInfo($lng->txt(
"certificate_visibility_introduction"));
214 $visibility->setValue($form_fields[
"certificate_visibility"]);
215 if (count(
$_POST)) $visibility->checkInput();
216 $form->addItem($visibility);
229 $form_fields[
"certificate_visibility"] =
$_POST[
"certificate_visibility"];
242 $form_fields[
"certificate_visibility"] = $this->
object->getCertificateVisibility();
254 $this->
object->saveCertificateVisibility($form_fields[
"certificate_visibility"]);
276 return $this->
object->getId();
287 return $this->
object->_getUserIdFromActiveId($a_params[
"active_id"]);