5 include_once
"./Modules/Test/classes/inc.AssessmentConstants.php";
6 include_once
"./Modules/Test/classes/class.ilTestServiceGUI.php";
31 $this->ctrl->saveParameter($this,
"active_id");
32 $this->ctrl->saveParameter($this,
"userfilter");
33 $this->ctrl->saveParameter($this,
"pass");
41 $cmd = $this->ctrl->getCmd();
42 $next_class = $this->ctrl->getNextClass($this);
43 if (strlen(
$_POST[
'FORM']))
47 case 'formQuestionScoring':
48 $cmd =
'selectQuestion';
52 if (strlen(
$cmd) == 0)
54 $this->ctrl->redirect($this,
"manscoring");
87 $manscoring_done = (
$_POST[
"manscoring_done"]) ? 1 : 0;
88 $assessmentSetting =
new ilSetting(
"assessment");
89 $assessmentSetting->set(
"manscoring_done_" .
$_GET[
"active_id"], $manscoring_done);
101 if (!$ilAccess->checkAccess(
"write",
"", $this->ref_id))
105 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
108 $active_id = (strlen(
$_POST[
"participants"])) ?
$_POST[
"participants"] : ((strlen(
$_GET[
"active_id"])) ?
$_GET[
"active_id"] : 0);
109 $userfiltervalue = (strlen(
$_POST[
"userfilter"])) ?
$_POST[
"userfilter"] : ((strlen(
$_GET[
"userfilter"])) ?
$_GET[
"userfilter"] : 0);
111 if (strcmp($this->ctrl->getCmd(),
"scoringfilterreset") == 0)
114 $userfiltervalue = 0;
117 include_once
"./Modules/Test/classes/class.ilObjAssessmentFolder.php";
119 if (count($scoring) == 0)
126 $pass = $this->
object->_getResultPass($active_id);
127 if (array_key_exists(
"pass",
$_GET))
129 if (strlen(
$_GET[
"pass"]))
131 $maxpass = $this->
object->_getMaxPass($active_id);
136 $participantsfilter = ($userfiltervalue) ? $userfiltervalue : 0;
137 $participants =& $this->
object->getTestParticipantsForManualScoring($participantsfilter);
138 if (!array_key_exists($active_id, $participants)) $active_id = 0;
140 $this->ctrl->setParameter($this,
"active_id", $active_id);
141 $this->ctrl->setParameter($this,
"userfilter", $userfiltervalue);
143 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_manual_scoring.html",
"Modules/Test");
147 $this->tpl->setCurrentBlock(
"manscoring_done");
148 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this,
"scoringfilter"));
149 $this->tpl->setVariable(
"SAVE", $this->lng->txt(
"save"));
150 $this->tpl->setVariable(
"TEXT_MANSCORING_DONE", $this->lng->txt(
"set_manscoring_done"));
151 $assessmentSetting =
new ilSetting(
"assessment");
152 $manscoring_done = $assessmentSetting->get(
"manscoring_done_" . $active_id);
153 if ($manscoring_done)
155 $this->tpl->setVariable(
"CHECKED_MANSCORING_DONE",
' checked="checked"');
157 $this->tpl->parseCurrentBlock();
160 if (array_key_exists(
"question",
$_POST) || strlen(
$_GET[
"anchor"]))
162 if (strlen(
$_GET[
"anchor"]))
164 $question_id =
$_GET[
"anchor"];
168 $keys = array_keys(
$_POST[
"question"]);
169 $question_id = $keys[0];
171 $this->tpl->setCurrentBlock(
"lastchanged");
172 $this->tpl->setVariable(
"LAST_CHANGED", $question_id);
173 $this->tpl->parseCurrentBlock();
176 foreach ($participants as $participant_active_id =>
$data)
178 $this->tpl->setCurrentBlock(
"participants");
179 $this->tpl->setVariable(
"ID_PARTICIPANT",
$data[
"active_id"]);
181 if ($this->object->getAnonymity())
183 $suffix =
" " . $counter++;
187 if ($active_id ==
$data[
"active_id"])
189 $this->tpl->setVariable(
"SELECTED_PARTICIPANT",
" selected=\"selected\"");
192 $this->tpl->setVariable(
"TEXT_PARTICIPANT", $this->object->userLookupFullName(
$data[
"usr_id"], FALSE, TRUE, $suffix));
193 $this->tpl->parseCurrentBlock();
196 "1" => $this->lng->txt(
"usr_active_only"),
197 "2" => $this->lng->txt(
"usr_inactive_only"),
199 "4" => $this->lng->txt(
"manscoring_done"),
200 "5" => $this->lng->txt(
"manscoring_none"),
203 foreach ($userfilter as $selection => $filtertext)
205 $this->tpl->setCurrentBlock(
"userfilter");
206 $this->tpl->setVariable(
"VALUE_USERFILTER", $selection);
207 $this->tpl->setVariable(
"TEXT_USERFILTER", $filtertext);
208 if ($userfiltervalue == $selection)
210 $this->tpl->setVariable(
"SELECTED_USERFILTER",
" selected=\"selected\"");
212 $this->tpl->parseCurrentBlock();
217 $questions = $this->
object->getTestQuestions();
218 foreach ($questions as
$data)
220 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
222 $type = $info[
"question_type_fi"];
223 if (in_array(
$type, $scoring))
225 $this->tpl->setCurrentBlock(
"questions");
226 $this->tpl->setVariable(
"ID_QUESTION", $data[
'question_id']);
227 if (
$_POST[
'questions'] > 0)
229 if (
$_POST[
'questions'] == $data[
'question_id'])
231 $this->tpl->setVariable(
"SELECTED_QUESTION",
" selected=\"selected\"");
233 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this,
"selectQuestion"));
235 $this->tpl->setVariable(
"TEXT_QUESTION", $data[
'title']);
236 $this->tpl->parseCurrentBlock();
239 $this->tpl->setCurrentBlock(
"questselect");
240 $this->tpl->setVariable(
"FILTER_CLASS_QUESTION", (
$_POST[
'questions'] > 0) ?
"filteractive" :
"filterinactive");
241 $this->tpl->setVariable(
"TEXT_SELECT_QUESTION", $this->lng->txt(
"manscoring_select_question"));
242 $this->tpl->setVariable(
"PLEASE_SELECT_QUESTION", $this->lng->txt(
'question'));
243 $this->tpl->setVariable(
"BUTTON_SELECT_QUESTION", $this->lng->txt(
"to_filter"));
244 $this->tpl->parseCurrentBlock();
247 $this->tpl->setVariable(
"PLEASE_SELECT", $this->lng->txt(
"participants"));
248 $this->tpl->setVariable(
"SELECT_USERFILTER", $this->lng->txt(
"user_status"));
249 $this->tpl->setVariable(
"SELECT_SCOREDFILTER", $this->lng->txt(
"manscoring"));
250 $this->tpl->setVariable(
"BUTTON_SELECT", $this->lng->txt(
"to_filter"));
251 $this->tpl->setVariable(
"BUTTON_RESET", $this->lng->txt(
"reset"));
252 $this->tpl->setVariable(
"FILTER_CLASS", ($active_id) ?
"filteractive" :
"filterinactive");
253 $this->tpl->setVariable(
"FILTER_CLASS_USERFILTER", ($userfiltervalue) ?
"filteractive" :
"filterinactive");
254 $this->tpl->setVariable(
"TEXT_SELECT_USER", $this->lng->txt(
"manscoring_select_user"));
259 if ($this->object->getNrOfTries() != 1)
261 $overview = $this->
getPassOverview($active_id,
"iltestscoringgui",
"manscoring");
262 $this->tpl->setVariable(
"PASS_OVERVIEW", $overview);
267 $result_array =& $this->
object->getTestResult($active_id,
$pass);
269 $this->tpl->setVariable(
"SCORING_DATA", $scoring);
272 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this,
"scoringfilter"));
273 include_once
"./Services/RTE/classes/class.ilRTE.php";
275 include_once
"./Services/RTE/classes/class.$rtestring.php";
276 $rte =
new $rtestring();
277 $rte->addPlugin(
"latex");
278 $rte->addButton(
"latex"); $rte->addButton(
"pastelatex");
279 include_once
"./classes/class.ilObject.php";
282 $rte->addRTESupport($obj_id,
"fdb",
"assessment");
290 if (array_key_exists(
"question",
$_POST))
292 $keys = array_keys(
$_POST[
"question"]);
293 $question_id = $keys[0];
295 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
300 include_once
"./Modules/Test/classes/class.ilObjTestAccess.php";
301 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
319 if (array_key_exists(
"feedback",
$_POST))
321 $feedbacks = array_keys(
$_POST[
"feedback"]);
322 $question_id = $feedbacks[0];
323 include_once
"./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
325 $result = $this->
object->saveManualFeedback(
$_GET[
"active_id"], $question_id,
$_GET[
"pass"], $feedback);
344 $_GET[
"active_id"] = 0;
361 global $ilAccess, $ilUser;
363 if ((!$ilAccess->checkAccess(
"tst_statistics",
"", $this->ref_id)) && (!$ilAccess->checkAccess(
"write",
"", $this->ref_id)))
367 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
370 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
371 if (
$_POST[
"cmd"][
"scoringParticipants"])
373 foreach (
$_POST as $key => $value)
375 if (($value >
"") && (preg_match(
"/(\d+)_(\d+)/", $key, $matches)))
377 $pass = $this->
object->_getResultPass($matches[1]);
385 $template =
new ilTemplate(
"tpl.il_as_tst_scoring_question.html", TRUE, TRUE,
"Modules/Test");
387 $data =& $this->
object->getCompleteEvaluationData(FALSE);
388 $foundParticipants =&
$data->getParticipants();
389 if (count($foundParticipants) == 0)
391 $this->tpl->setVariable(
"EVALUATION_DATA", $this->lng->txt(
"tst_no_evaluation_data"));
393 $eval_complete = array();
395 foreach (
$data->getParticipants() as $active_id => $userdata)
398 $pass = $this->
object->_getResultPass($active_id);
399 array_push($evalrow, $partcount++.
". ". $userdata->getName());
401 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
402 include_once
"./Modules/Test/classes/class.ilObjAssessmentFolder.php";
406 $type = $info[
"question_type_fi"];
408 if (in_array(
$type, $scoring))
410 $question_data = $userdata->getPass(
$pass)->getAnsweredQuestionByQuestionId($q_id);
411 $reached = $question_data[
"reached"];
412 $name = $active_id.
"_".$q_id;
414 $htmloutput =
"<input type=\"text\" name=\"".$name.
"\" size=\"2\" value=\"".$reached.
"\" />".
" ";
416 $htmloutput .=
" [<a href=\"".$this->ctrl->getLinkTargetByClass(get_class($this),
"evaluationDetail") .
"&userdetail=".$active_id.
"&answer=".$q_id.
"\" target=\"popup\" onclick=\"";
417 $htmloutput .=
"window.open('', 'popup', 'width=600, height=300, scrollbars=yes, toolbar=no, status=no, resizable=yes, menubar=no, location=no, directories=no')";
418 $htmloutput .=
"\">".
"Antwort".
"</a>]";
420 array_push($evalrow, $htmloutput);
422 array_push($eval_complete, $evalrow);
424 if (count($evalrow) < 2)
exit;
426 $template->setVariable(
"HEADING", $this->lng->txt(
"manscoring_question_eval"));
428 $color_class = array(
"tblrow1",
"tblrow2");
429 foreach ($eval_complete as
$row)
431 foreach ($row as $key => $value)
433 $template->setCurrentBlock(
"questions_datacol");
434 $template->setVariable(
"COLOR_CLASS", $color_class[$counter % 2]);
435 $template->setVariable(
"TXT_DATA", $value);
436 $template->parseCurrentBlock();
438 $template->setCurrentBlock(
"questions_row");
439 $template->setVariable(
"COLOR_CLASS", $color_class[$counter % 2]);
440 $template->parseCurrentBlock();
443 $template->setVariable(
"QID", $q_id);
444 $template->setVariable(
"BUTTON_SAVE",
"Punkte speichern");
446 $manscoring = $template->get();
447 $this->tpl->setVariable(
"SCORING_DATA",
"");
448 $this->tpl->setVariable(
"QUESTION_MANSCORING", $manscoring);
449 $this->tpl->parseCurrentBlock();
450 if (
$_POST[
"cmd"][
"scoringParticipants"])
453 $this->ctrl->redirect($this,
"manscoring");
461 $active_id =
$_GET[
"userdetail"];
462 $pass = $this->
object->_getResultPass($active_id);
463 $question_id =
$_GET[
"answer"];
464 $question_gui = $this->
object->createQuestionGUI(
"", $question_id);
465 $user_id = $this->
object->_getUserIdFromActiveId($active_id);
468 $this->tpl =
new ilTemplate(
"tpl.il_as_tst_correct_solution_output.html", TRUE, TRUE,
"Modules/Test");
469 $result_output = $question_gui->getSolutionOutput($active_id,
$pass, TRUE, FALSE, FALSE, $this->object->getShowSolutionFeedback());
470 $best_output = $question_gui->getSolutionOutput(
"", NULL, FALSE, FALSE, FALSE);
471 $this->tpl->setVariable(
"TEXT_YOUR_SOLUTION",
"Antwort von ". $uname[
"lastname"] .
", " . $uname[
"firstname"]);
472 $maxpoints = $question_gui->object->getMaximumPoints();
475 $this->tpl->setVariable(
"QUESTION_TITLE", $this->object->getQuestionTitle($question_gui->object->getTitle()) .
" (" . $maxpoints .
" " . $this->lng->txt(
"point") .
")");
479 $this->tpl->setVariable(
"QUESTION_TITLE", $this->object->getQuestionTitle($question_gui->object->getTitle()) .
" (" . $maxpoints .
" " . $this->lng->txt(
"points") .
")");
481 $this->tpl->setVariable(
"SOLUTION_OUTPUT", $result_output);
483 $your_points =
"Der Benutzer hat %s von %s möglichen Punkten erreicht.";
484 $this->tpl->setVariable(
"RECEIVED_POINTS", sprintf($your_points, $question_gui->object->getReachedPoints($active_id,
$pass), $maxpoints));
485 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
486 $this->tpl->setVariable(
"BACKLINK_TEXT",
"<< " . $this->lng->txt(
"back"));