46 $this->testrequest = $DIC->test()->internal()->request();
82 public function getHTML($objectiveId = null): string
84 $this->
lng->loadLanguageModule(
'crs');
86 $tpl =
new ilTemplate(
'tpl.tst_lo_status.html',
true,
true,
'Modules/Test');
88 $tpl->setCurrentBlock(
'objectives_progress_header');
89 $tpl->setVariable(
'OBJECTIVES_PROGRESS_HEADER', $this->
lng->txt($this->getHeaderLangVar($objectiveId)));
90 $tpl->parseCurrentBlock();
103 return 'tst_objective_progress_header';
106 return 'tst_objectives_progress_header';
112 $has_initial_test = (bool) $loc_settings->getInitialTest();
114 foreach ($loStatusData as $objtv) {
115 if ($objectiveId && $objtv[
'id'] != $objectiveId) {
119 $tpl->setCurrentBlock(
"objective_nolink_bl");
120 $tpl->setVariable(
"OBJECTIVE_NOLINK_TITLE", $objtv[
"title"]);
121 $tpl->parseCurrentBlock();
125 $tpl->setCurrentBlock(
"objective_bl");
126 $tpl->setVariable(
"OBJTV_ICON_URL", $objtv_icon);
127 $tpl->setVariable(
"OBJTV_ICON_ALT", $this->
lng->txt(
"crs_objectives"));
129 if ($objtv[
"type"]) {
140 $DIC->ctrl()->setParameterByClass(
'ilObjTestGUI',
'ref_id', $this->testrequest->getRefId());
143 $tpl->parseCurrentBlock();
146 $tpl->setCurrentBlock(
"objectives_bl");
148 $tpl->parseCurrentBlock();
156 $coll_objtv = $coll_objtv->getItems();
163 foreach ($coll_objtv as $objective_id) {
166 $tmp[$objective_id] = array(
167 "id" => $objective_id,
168 "title" => $title[
"title"],
169 "desc" => $title[
"description"],
176 if (array_key_exists($objective_id, $lo_results)) {
177 $lo_result = $lo_results[$objective_id];
178 $tmp[$objective_id][
"user_id"] = $lo_result[
"user_id"];
179 $tmp[$objective_id][
"result_perc"] = $lo_result[
"result_perc"];
180 $tmp[$objective_id][
"limit_perc"] = $lo_result[
"limit_perc"];
181 $tmp[$objective_id][
"status"] = $lo_result[
"status"];
182 $tmp[$objective_id][
"type"] = $lo_result[
"type"];
183 $tmp[$objective_id][
"initial"] = $lo_result[
"initial"] ?? null;
188 foreach ($coll_objtv as $objtv_id) {
189 $res[] = $tmp[$objtv_id];
199 $initial_status = null;
202 foreach ($lur->getCourseResultsForUserPresentation() as $objective_id => $types) {
218 $result[
"initial_status"] = $initial_status;
220 $res[$objective_id] = $result;
getUsersObjectivesStatus($crsObjId, $usrId)
static _getIcon(int $obj_id=0, string $size="big", string $type="", bool $offline=false)
Get icon for repository item.
LP collection of objectives.
renderStatus($tpl, $objectiveId, $loStatusData)
__construct(ilLanguage $lng)
getUsersObjectivesResults($crsObjId, $usrId)
static buildObjectiveProgressBar(bool $a_has_initial_test, int $a_objective_id, array $a_lo_result, bool $a_list_mode=false, bool $a_sub=false, string $a_tt_suffix=null)
Render progressbar(s) for given objective and result data.
getHTML($objectiveId=null)
ILIAS Test InternalRequestService $testrequest
getHeaderLangVar($objectiveId)
static lookupObjectiveTitle(int $a_objective_id, bool $a_add_description=false)
static getInstanceByObjId(int $a_obj_id)
static getInstance(int $a_container_id)
const TYPE_TEST_QUALIFIED
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl