24 include_once
"./Services/Certificate/classes/class.ilCertificateAdapter.php";
46 $lng->loadLanguageModule(
'certificate');
56 return CLIENT_WEB_DIR .
"/assessment/certificates/" . $this->
object->getId() .
"/";
68 include_once
"./classes/class.ilFormat.php";
105 $active_id = $params[
"active_id"];
106 $pass = $params[
"pass"];
107 $userfilter = array_key_exists(
"userfilter", $params) ? $params[
"userfilter"] :
"";
108 $passedonly = array_key_exists(
"passedonly", $params) ? $params[
"passedonly"] : FALSE;
111 $result_array =& $this->
object->getTestResult($active_id,
$pass);
115 $result_array =& $this->
object->getTestResult($active_id);
117 if (($passedonly) && ($result_array[
"test"][
"passed"] == FALSE))
return "";
118 $passed = $result_array[
"test"][
"passed"] ? $lng->txt(
"certificate_passed") : $lng->txt(
"certificate_failed");
119 if (!$result_array[
"test"][
"total_max_points"])
125 $percentage = ($result_array[
"test"][
"total_reached_points"]/$result_array[
"test"][
"total_max_points"])*100;
127 $mark_obj = $this->
object->mark_schema->getMatchingMark($percentage);
128 $user_id = $this->
object->_getUserIdFromActiveId($active_id);
129 include_once
'./Services/User/classes/class.ilObjUser.php';
131 if (strlen($userfilter))
133 if (!@preg_match(
"/$userfilter/i", $user_data[
"lastname"] .
", " . $user_data[
"firstname"] .
" " . $user_data[
"title"]))
138 include_once
"./classes/class.ilFormat.php";
139 $insert_tags = array(
140 "[USER_FULLNAME]" =>
ilUtil::prepareFormOutput(trim($user_data[
"title"] .
" " . $user_data[
"firstname"] .
" " . $user_data[
"lastname"])),
152 "[RESULT_PERCENT]" => sprintf(
"%2.2f", $percentage) .
"%",
173 $template =
new ilTemplate(
"tpl.il_as_tst_certificate_edit.html", TRUE, TRUE,
"Modules/Test");
174 $template->setVariable(
"PH_INTRODUCTION", $lng->txt(
"certificate_ph_introduction"));
175 $template->setVariable(
"PH_USER_FULLNAME", $lng->txt(
"certificate_ph_fullname"));
176 $template->setVariable(
"PH_USER_FIRSTNAME", $lng->txt(
"certificate_ph_firstname"));
177 $template->setVariable(
"PH_USER_LASTNAME", $lng->txt(
"certificate_ph_lastname"));
178 $template->setVariable(
"PH_RESULT_PASSED", $lng->txt(
"certificate_ph_passed"));
179 $template->setVariable(
"PH_RESULT_POINTS", $lng->txt(
"certificate_ph_resultpoints"));
180 $template->setVariable(
"PH_RESULT_PERCENT", $lng->txt(
"certificate_ph_resultpercent"));
181 $template->setVariable(
"PH_USER_TITLE", $lng->txt(
"certificate_ph_title"));
182 $template->setVariable(
"PH_USER_STREET", $lng->txt(
"certificate_ph_street"));
183 $template->setVariable(
"PH_USER_INSTITUTION", $lng->txt(
"certificate_ph_institution"));
184 $template->setVariable(
"PH_USER_DEPARTMENT", $lng->txt(
"certificate_ph_department"));
185 $template->setVariable(
"PH_USER_CITY", $lng->txt(
"certificate_ph_city"));
186 $template->setVariable(
"PH_USER_ZIPCODE", $lng->txt(
"certificate_ph_zipcode"));
187 $template->setVariable(
"PH_USER_COUNTRY", $lng->txt(
"certificate_ph_country"));
188 $template->setVariable(
"PH_MAX_POINTS", $lng->txt(
"certificate_ph_maxpoints"));
189 $template->setVariable(
"PH_RESULT_MARK_SHORT", $lng->txt(
"certificate_ph_markshort"));
190 $template->setVariable(
"PH_RESULT_MARK_LONG", $lng->txt(
"certificate_ph_marklong"));
191 $template->setVariable(
"PH_TEST_TITLE", $lng->txt(
"certificate_ph_testtitle"));
192 $template->setVariable(
"PH_DATE", $lng->txt(
"certificate_ph_date"));
193 $template->setVariable(
"PH_DATETIME", $lng->txt(
"certificate_ph_datetime"));
194 return $template->get();
209 $visibility =
new ilRadioMatrixInputGUI($lng->txt(
"certificate_visibility"),
"certificate_visibility");
211 0 => $lng->txt(
"certificate_visibility_always"),
212 1 => $lng->txt(
"certificate_visibility_passed"),
213 2 => $lng->txt(
"certificate_visibility_never")
216 $visibility->setInfo($lng->txt(
"certificate_visibility_introduction"));
217 $visibility->setValue($form_fields[
"certificate_visibility"]);
218 if (count(
$_POST)) $visibility->checkInput();
219 $form->addItem($visibility);
232 $form_fields[
"certificate_visibility"] =
$_POST[
"certificate_visibility"];
245 $form_fields[
"certificate_visibility"] = $this->
object->getCertificateVisibility();
257 $this->
object->saveCertificateVisibility($form_fields[
"certificate_visibility"]);
279 return $this->
object->getId();