4 include_once
"./Modules/Test/classes/inc.AssessmentConstants.php";
5 include_once
"./Modules/Test/classes/class.ilTestServiceGUI.php";
36 parent::ilTestServiceGUI($a_object);
42 protected function buildSubTabs($active_sub_tab =
'man_scoring')
48 $ilTabs->addSubTab(
'man_scoring', $this->lng->txt(
'tst_man_scoring_by_part'), $this->ctrl->getLinkTargetByClass(
'ilTestScoringGUI',
'showManScoringParticipantsTable'));
49 $ilTabs->addSubTab(
'man_scoring_by_qst', $this->lng->txt(
'tst_man_scoring_by_qst'), $this->ctrl->getLinkTargetByClass(
'ilTestScoringByQuestionsGUI',
'showManScoringByQuestionParticipantsTable'));
50 $ilTabs->setSubTabActive($active_sub_tab);
59 if( !isset(
$_GET[
'active_id']) || !(
int)
$_GET[
'active_id'] )
63 $ilCtrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
67 $activeId = (int)$_GET[
'active_id'];
77 $maxPass = $this->
object->_getMaxPass($activeId);
78 if( isset(
$_GET[
"pass"]) && 0 <= (
int)
$_GET[
"pass"] && $maxPass >= (
int)
$_GET[
"pass"] )
80 $pass = $_GET[
"pass"];
88 $pass = $this->
object->_getResultPass($activeId);
101 if( !$ilAccess->checkAccess(
"write",
"", $this->ref_id) )
105 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
108 require_once
'Modules/Test/classes/class.ilObjAssessmentFolder.php';
113 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
116 $cmd = $this->ctrl->getCmd();
117 $next_class = $this->ctrl->getNextClass($this);
119 if (strlen(
$cmd) == 0)
121 $this->ctrl->redirect($this,
"manscoring");
125 $this->buildSubTabs();
142 $tpl->setContent( $table->getHTML() );
149 $table->resetOffset();
150 $table->writeFilterToSession();
159 $table->resetOffset();
160 $table->resetFilter();
175 require_once
'Modules/Test/classes/tables/class.ilTestPassManualScoringOverviewTableGUI.php';
178 $userId = $this->
object->_getUserIdFromActiveId($activeId);
179 $userFullname = $this->
object->userLookupFullName($userId,
false,
true);
180 $tableTitle = sprintf($lng->txt(
'tst_pass_overview_for_participant'), $userFullname);
181 $table->setTitle($tableTitle);
183 $passOverviewData = $this->service->getPassOverviewData($activeId);
184 $table->setData($passOverviewData[
'passes']);
186 $contentHTML .= $table->getHTML().
'<br />';
192 $questionGuiList = $this->service->getManScoringQuestionGuiList($activeId,
$pass);
196 $contentHTML .= $form->getHTML();
200 $tpl->setContent($contentHTML);
214 $questionGuiList = $this->service->getManScoringQuestionGuiList($activeId,
$pass);
217 $form->setValuesByPost();
219 if( !$form->checkInput() )
226 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
228 $maxPointsByQuestionId = array();
229 $maxPointsExceeded =
false;
230 foreach($questionGuiList as $questionId => $questionGui)
232 $reachedPoints = $form->getItemByPostVar(
"question__{$questionId}__points")->getValue();
235 if( $reachedPoints > $maxPoints )
237 $maxPointsExceeded =
true;
239 $form->getItemByPostVar(
"question__{$questionId}__points")->setAlert( sprintf(
240 $lng->txt(
'tst_manscoring_maxpoints_exceeded_input_alert'), $maxPoints
244 $maxPointsByQuestionId[$questionId] = $maxPoints;
247 if( $maxPointsExceeded )
254 include_once
"./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
256 foreach($questionGuiList as $questionId => $questionGui)
258 $reachedPoints = $form->getItemByPostVar(
"question__{$questionId}__points")->getValue();
261 $activeId, $questionId, $reachedPoints, $maxPointsByQuestionId[$questionId],
262 $pass, 1, $this->object->areObligationsEnabled()
266 $form->getItemByPostVar(
"question__{$questionId}__feedback")->getValue(),
270 $this->
object->saveManualFeedback($activeId, $questionId,
$pass, $feedback);
272 $notificationData[$questionId] = array(
273 'points' => $reachedPoints,
'feedback' => $feedback
277 include_once
"./Modules/Test/classes/class.ilObjTestAccess.php";
278 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
283 $manScoringDone = $form->getItemByPostVar(
"manscoring_done")->getChecked();
286 $manScoringNotify = $form->getItemByPostVar(
"manscoring_notify")->getChecked();
287 if($manScoringNotify)
289 require_once
'Modules/Test/classes/notifications/class.ilTestManScoringParticipantNotification.php';
292 $this->object->_getUserIdFromActiveId($activeId), $this->
object->getRefId()
296 'test_title' => $this->object->getTitle(),
297 'test_pass' =>
$pass + 1,
298 'questions_gui_list' => $questionGuiList,
299 'questions_scoring_data' => $notificationData
302 $notification->send();
305 require_once
'./Modules/Test/classes/class.ilTestScoring.php';
307 $scorer->setPreserveManualScores(
true);
308 $scorer->recalculateSolutions();
310 if($this->object->getAnonymity() == 0)
313 $name_real_or_anon = $user_name[
'firstname'].
' '. $user_name[
'lastname'];
317 $name_real_or_anon = $lng->txt(
'anonymous');
322 $ilCtrl->redirect($this,
'showManScoringParticipantScreen');
343 if($participant[
'active_id'] ==
$_GET[
'active_id'])
345 $nextIndex = $index + 1;
352 $ilCtrl->setParameter($this,
'active_id',
$participantData[$nextIndex][
'active_id']);
353 $ilCtrl->redirect($this,
'showManScoringParticipantScreen');
356 $ilCtrl->redirectByClass(
"iltestscoringgui",
"showManScoringParticipantsTable");
366 $ilCtrl->redirectByClass(
"iltestscoringgui",
"showManScoringParticipantsTable");
374 require_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
375 require_once
'Services/Form/classes/class.ilFormSectionHeaderGUI.php';
376 require_once
'Services/Form/classes/class.ilCustomInputGUI.php';
377 require_once
'Services/Form/classes/class.ilCheckboxInputGUI.php';
378 require_once
'Services/Form/classes/class.ilTextInputGUI.php';
379 require_once
'Services/Form/classes/class.ilTextAreaInputGUI.php';
381 $ilCtrl->setParameter($this,
'active_id', $activeId);
382 $ilCtrl->setParameter($this,
'pass',
$pass);
385 $form->setFormAction($ilCtrl->getFormAction($this));
387 $form->setTitle( sprintf($lng->txt(
'manscoring_results_pass'),
$pass + 1) );
388 $form->setTableWidth(
'100%');
390 foreach($questionGuiList as $questionId => $questionGUI)
392 $questionHeader = sprintf($lng->txt(
'tst_manscoring_question_section_header'), $questionGUI->object->getTitle());
393 $questionSolution = $questionGUI->getSolutionOutput($activeId,
$pass,
false,
false,
true,
false,
false,
true);
394 $bestSolution = $questionGUI->object->getSuggestedSolutionOutput();
397 $sect->setTitle( $questionHeader .
' ['. $this->lng->txt(
'question_id_short') .
': ' . $questionGUI->object->getId() .
']');
398 $form->addItem($sect);
400 $cust =
new ilCustomInputGUI($lng->txt(
'tst_manscoring_input_question_and_user_solution'));
401 $cust->
setHtml($questionSolution);
402 $form->addItem($cust);
404 $text =
new ilTextInputGUI($lng->txt(
'tst_change_points_for_question'),
"question__{$questionId}__points");
406 $form->addItem(
$text);
408 $nonedit =
new ilNonEditableValueGUI($lng->txt(
'tst_manscoring_input_max_points_for_question'),
"question__{$questionId}__maxpoints");
410 $form->addItem($nonedit);
412 $area =
new ilTextAreaInputGUI($lng->txt(
'set_manual_feedback'),
"question__{$questionId}__feedback");
413 $area->setUseRTE(
true);
414 if( $initValues ) $area->
setValue( $this->object->getManualFeedback($activeId, $questionId,
$pass) );
415 $form->addItem($area);
417 if(strlen(trim($bestSolution)))
421 $form->addItem($cust);
426 $sect->setTitle($lng->txt(
'tst_participant'));
427 $form->addItem($sect);
431 $form->addItem($check);
433 $check =
new ilCheckboxInputGUI($lng->txt(
'tst_manscoring_user_notification'),
'manscoring_notify');
434 $form->addItem($check);
436 $form->addCommandButton(
'saveManScoringParticipantScreen', $lng->txt(
'save'));
437 $form->addCommandButton(
'saveReturnManScoringParticipantScreen', $lng->txt(
'save_return'));
438 $form->addCommandButton(
'saveNextManScoringParticipantScreen', $lng->txt(
'save_and_next'));
452 require_once
'Modules/Test/classes/tables/class.ilTestManScoringParticipantsTableGUI.php';
457 $participantStatusFilterValue = $table->getFilterItemByPostVar(
'participant_status')->getValue();
458 $table->setData($this->object->getTestParticipantsForManualScoring($participantStatusFilterValue));
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
showManScoringParticipantScreen(ilPropertyFormGUI $form=null)
static _lookupName($a_user_id)
lookup user name
static setManScoringDone($activeId, $manScoringDone)
stores the flag wether manscoring is done for the given test active or not within the global settings...
setValue($a_value)
Set Value.
& _getUsedHTMLTagsAsString($a_module="")
Returns a string of all allowed HTML tags for text editing.
static _updateStatus($a_obj_id, $a_usr_id, $a_obj=null, $a_percentage=false, $a_force_raise=false)
Update status.
setValue($a_value)
Set Value.
applyManScoringParticipantsFilter()
static isManScoringDone($activeId)
reads the flag wether manscoring is done for the given test active or not from the global settings (s...
const PART_FILTER_ACTIVE_ONLY
fetchPassParameter($activeId)
saveReturnManScoringParticipantScreen()
const PART_FILTER_MANSCORING_NONE
& executeCommand()
execute command
getCommand($cmd)
Retrieves the ilCtrl command.
static _mananuallyScoreableQuestionTypesExists()
Returns the fact wether manually scoreable question types exist or not.
buildManScoringParticipantForm($questionGuiList, $activeId, $pass, $initValues=false)
This class represents a text property in a property form.
showManScoringParticipantsTable()
_getParticipantId($active_id)
Get user id for active id.
_getMaximumPoints($question_id)
Returns the maximum points, a learner can reach answering the question.
saveManScoringParticipantScreen($redirect=true)
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
buildManScoringParticipantsTable($withData=false)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
const PART_FILTER_ALL_USERS
const PART_FILTER_INACTIVE_ONLY
_getReachedPoints($active_id, $question_id, $pass=NULL)
Returns the points, a learner has reached answering the question.
This class represents a non editable value in a property form.
This class represents a text area property in a property form.
resetManScoringParticipantsFilter()
_setReachedPoints($active_id, $question_id, $points, $maxpoints, $pass, $manualscoring, $obligationsEnabled)
Sets the points, a learner has reached answering the question Additionally objective results are upda...
Service GUI class for tests.
ilTestScoringGUI(ilObjTest $a_object)
ilTestScoringGUI constructor
sendManScoringParticipantNotification()
saveNextManScoringParticipantScreen()
setAdditionalInformation(array $a_info)
Additional information for creating notification mails.
const PART_FILTER_MANSCORING_DONE