5 include_once
"./Modules/Test/classes/inc.AssessmentConstants.php";
6 include_once
"./Modules/Test/classes/class.ilTestServiceGUI.php";
46 if( !isset(
$_GET[
'active_id']) || !(
int)
$_GET[
'active_id'] )
50 $ilCtrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
54 $activeId = (int)$_GET[
'active_id'];
64 $maxPass = $this->
object->_getMaxPass($activeId);
65 if( isset(
$_GET[
"pass"]) && 0 <= (
int)
$_GET[
"pass"] && $maxPass >= (
int)
$_GET[
"pass"] )
67 $pass = $_GET[
"pass"];
75 $pass = $this->
object->_getResultPass($activeId);
88 if( !$ilAccess->checkAccess(
"write",
"", $this->ref_id) )
92 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
95 require_once
'Modules/Test/classes/class.ilObjAssessmentFolder.php';
100 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
103 $cmd = $this->ctrl->getCmd();
104 $next_class = $this->ctrl->getNextClass($this);
106 if (strlen(
$cmd) == 0)
108 $this->ctrl->redirect($this,
"manscoring");
127 require_once
'Modules/Test/classes/tables/class.ilTestManScoringParticipantsTableGUI.php';
130 $participantStatusFilterValue = $table->getFilterItemByPostVar(
'participant_status')->getValue();
132 $table->setData( $this->object->getTestParticipantsForManualScoring($participantStatusFilterValue) );
134 $tpl->setContent( $table->getHTML() );
139 require_once
'Modules/Test/classes/tables/class.ilTestManScoringParticipantsTableGUI.php';
142 $table->resetOffset();
143 $table->writeFilterToSession();
150 require_once
'Modules/Test/classes/tables/class.ilTestManScoringParticipantsTableGUI.php';
153 $table->resetOffset();
154 $table->resetFilter();
168 if( $this->object->getNrOfTries() != 1 )
170 require_once
'Modules/Test/classes/tables/class.ilTestPassOverwiewTableGUI.php';
173 $userId = $this->
object->_getUserIdFromActiveId($activeId);
174 $userFullname = $this->
object->userLookupFullName($userId,
false,
true);
175 $tableTitle = sprintf($lng->txt(
'tst_pass_overview_for_participant'), $userFullname);
176 $table->setTitle($tableTitle);
178 $passOverviewData = $this->service->getPassOverviewData($activeId);
179 $table->setData($passOverviewData[
'passes']);
181 $contentHTML .= $table->getHTML().
'<br />';
188 $questionGuiList = $this->service->getManScoringQuestionGuiList($activeId,
$pass);
192 $contentHTML .= $form->getHTML();
196 $tpl->setContent($contentHTML);
206 $questionGuiList = $this->service->getManScoringQuestionGuiList($activeId,
$pass);
209 $form->setValuesByPost();
211 if( !$form->checkInput() )
217 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
219 $maxPointsByQuestionId = array();
220 $maxPointsExceeded =
false;
221 foreach($questionGuiList as $questionId => $questionGui)
223 $reachedPoints = $form->getItemByPostVar(
"question__{$questionId}__points")->getValue();
226 if( $reachedPoints > $maxPoints )
228 $maxPointsExceeded =
true;
230 $form->getItemByPostVar(
"question__{$questionId}__points")->setAlert( sprintf(
231 $lng->txt(
'tst_manscoring_maxpoints_exceeded_input_alert'), $maxPoints
235 $maxPointsByQuestionId[$questionId] = $maxPoints;
238 if( $maxPointsExceeded )
244 include_once
"./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
246 foreach($questionGuiList as $questionId => $questionGui)
248 $reachedPoints = $form->getItemByPostVar(
"question__{$questionId}__points")->getValue();
251 $activeId, $questionId, $reachedPoints, $maxPointsByQuestionId[$questionId],
252 $pass, 1, $this->object->areObligationsEnabled()
256 $form->getItemByPostVar(
"question__{$questionId}__feedback")->getValue(),
260 $this->
object->saveManualFeedback($activeId, $questionId,
$pass, $feedback);
262 $notificationData[$questionId] = array(
263 'points' => $reachedPoints,
'feedback' => $feedback
267 include_once
"./Modules/Test/classes/class.ilObjTestAccess.php";
268 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
273 $manScoringDone = $form->getItemByPostVar(
"manscoring_done")->getChecked();
276 $manScoringNotify = $form->getItemByPostVar(
"manscoring_notify")->getChecked();
277 if($manScoringNotify)
279 require_once
'Modules/Test/classes/notifications/class.ilTestManScoringParticipantNotification.php';
282 $this->object->_getUserIdFromActiveId($activeId), $this->
object->getRefId()
286 'test_title' => $this->object->getTitle(),
287 'test_pass' =>
$pass + 1,
288 'questions_gui_list' => $questionGuiList,
289 'questions_scoring_data' => $notificationData
292 $notification->send();
296 $ilCtrl->redirect($this,
'showManScoringParticipantScreen');
303 require_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
304 require_once
'Services/Form/classes/class.ilFormSectionHeaderGUI.php';
305 require_once
'Services/Form/classes/class.ilCustomInputGUI.php';
306 require_once
'Services/Form/classes/class.ilCheckboxInputGUI.php';
307 require_once
'Services/Form/classes/class.ilTextInputGUI.php';
308 require_once
'Services/Form/classes/class.ilTextAreaInputGUI.php';
310 $ilCtrl->setParameter($this,
'active_id', $activeId);
311 $ilCtrl->setParameter($this,
'pass',
$pass);
314 $form->setFormAction($ilCtrl->getFormAction($this));
316 $form->setTitle( sprintf($lng->txt(
'manscoring_results_pass'),
$pass + 1) );
317 $form->setTableWidth(
'100%');
319 foreach($questionGuiList as $questionId => $questionGUI)
321 $questionHeader = sprintf($lng->txt(
'tst_manscoring_question_section_header'), $questionGUI->object->getTitle());
322 $questionSolution = $questionGUI->getSolutionOutput($activeId,
$pass,
false,
false,
true,
false,
false,
true);
323 $bestSolution = $questionGUI->object->getSuggestedSolutionOutput();
326 $sect->setTitle($questionHeader);
327 $form->addItem($sect);
329 $cust =
new ilCustomInputGUI($lng->txt(
'tst_manscoring_input_question_and_user_solution'));
330 $cust->
setHtml($questionSolution);
331 $form->addItem($cust);
333 $text =
new ilTextInputGUI($lng->txt(
'tst_change_points_for_question'),
"question__{$questionId}__points");
335 $form->addItem($text);
337 $nonedit =
new ilNonEditableValueGUI($lng->txt(
'tst_manscoring_input_max_points_for_question'),
"question__{$questionId}__maxpoints");
339 $form->addItem($nonedit);
341 $area =
new ilTextAreaInputGUI($lng->txt(
'set_manual_feedback'),
"question__{$questionId}__feedback");
342 $area->setUseRTE(
true,
'3.4.7');
343 if( $initValues ) $area->
setValue( $this->object->getManualFeedback($activeId, $questionId,
$pass) );
344 $form->addItem($area);
346 $cust =
new ilCustomInputGUI($lng->txt(
'tst_manscoring_input_best_solution'));
348 $form->addItem($cust);
352 $sect->setTitle($lng->txt(
'tst_participant'));
353 $form->addItem($sect);
357 $form->addItem($check);
359 $check =
new ilCheckboxInputGUI($lng->txt(
'tst_manscoring_user_notification'),
'manscoring_notify');
360 $form->addItem($check);
362 $form->addCommandButton(
'saveManScoringParticipantScreen', $lng->txt(
'save'));