4 include_once
"./Modules/Test/classes/inc.AssessmentConstants.php";
5 include_once
"./Modules/Test/classes/class.ilTestServiceGUI.php";
63 protected function buildSubTabs($active_sub_tab =
'man_scoring_by_qst')
69 $ilTabs = $DIC[
'ilTabs'];
71 $ilTabs->addSubTab(
'man_scoring_by_qst', $this->lng->txt(
'tst_man_scoring_by_qst'), $this->ctrl->getLinkTargetByClass(
'ilTestScoringByQuestionsGUI',
'showManScoringByQuestionParticipantsTable'));
72 $ilTabs->addSubTab(
'man_scoring', $this->lng->txt(
'tst_man_scoring_by_part'), $this->ctrl->getLinkTargetByClass(
'ilTestScoringGUI',
'showManScoringParticipantsTable'));
73 $ilTabs->setSubTabActive($active_sub_tab);
79 $ilCtrl = $DIC[
'ilCtrl'];
83 if (!isset(
$_GET[
'active_id']) || !(
int)
$_GET[
'active_id']) {
86 $ilCtrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
88 $activeId = (int) $_GET[
'active_id'];
98 $maxPass = $this->
object->_getMaxPass($activeId);
99 if (isset(
$_GET[
"pass"]) && 0 <= (
int)
$_GET[
"pass"] && $maxPass >= (
int)
$_GET[
"pass"]) {
100 $pass = $_GET[
"pass"];
104 $pass = $this->
object->_getResultPass($activeId);
117 if (!$this->
getTestAccess()->checkScoreParticipantsAccess()) {
121 require_once
'Modules/Test/classes/class.ilObjAssessmentFolder.php';
125 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
131 $nextClass = $this->ctrl->getNextClass($this);
134 switch ($nextClass) {
154 return 'man_scoring';
164 $tpl->setContent($table->getHTML());
171 $table->resetOffset();
172 $table->writeFilterToSession();
181 $table->resetOffset();
182 $table->resetFilter();
195 if (!$this->
getTestAccess()->checkScoreParticipantsAccessForActiveId($activeId)) {
204 require_once
'Modules/Test/classes/tables/class.ilTestPassManualScoringOverviewTableGUI.php';
207 $userId = $this->
object->_getUserIdFromActiveId($activeId);
208 $userFullname = $this->
object->userLookupFullName($userId,
false,
true);
209 $tableTitle = sprintf(
$lng->txt(
'tst_pass_overview_for_participant'), $userFullname);
210 $table->setTitle($tableTitle);
212 $passOverviewData = $this->service->getPassOverviewData($activeId);
213 $table->setData($passOverviewData[
'passes']);
215 $contentHTML .= $table->getHTML() .
'<br />';
219 if ($form === null) {
220 $questionGuiList = $this->service->getManScoringQuestionGuiList($activeId,
$pass);
221 $form = $this->buildManScoringParticipantForm($questionGuiList, $activeId,
$pass,
true);
224 $contentHTML .= $form->getHTML();
228 $tpl->setContent($contentHTML);
238 $ilCtrl = $DIC[
'ilCtrl'];
243 if (!$this->
getTestAccess()->checkScoreParticipantsAccessForActiveId($activeId)) {
249 $questionGuiList = $this->service->getManScoringQuestionGuiList($activeId,
$pass);
250 $form = $this->buildManScoringParticipantForm($questionGuiList, $activeId,
$pass,
false);
252 $form->setValuesByPost();
254 if (!$form->checkInput()) {
260 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
262 $maxPointsByQuestionId = array();
263 $maxPointsExceeded =
false;
264 foreach ($questionGuiList as $questionId => $questionGui) {
265 $reachedPoints = $form->getItemByPostVar(
"question__{$questionId}__points")->getValue();
268 if ($reachedPoints > $maxPoints) {
269 $maxPointsExceeded =
true;
271 $form->getItemByPostVar(
"question__{$questionId}__points")->setAlert(sprintf(
272 $lng->txt(
'tst_manscoring_maxpoints_exceeded_input_alert'),
277 $maxPointsByQuestionId[$questionId] = $maxPoints;
280 if ($maxPointsExceeded) {
286 include_once
"./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
288 foreach ($questionGuiList as $questionId => $questionGui) {
289 $reachedPoints = $form->getItemByPostVar(
"question__{$questionId}__points")->getValue();
291 $finalized = (bool) $form->getItemByPostVar(
"{$questionId}__evaluated")->getchecked();
296 if ($reachedPoints != $oldPoints) {
301 $maxPointsByQuestionId[$questionId],
304 $this->object->areObligationsEnabled()
309 $form->getItemByPostVar(
"question__{$questionId}__feedback")->getValue(),
314 $this->
object->saveManualFeedback($activeId, $questionId,
$pass, $feedback, $finalized,
true);
316 $notificationData[$questionId] = array(
317 'points' => $reachedPoints,
'feedback' => $feedback
321 include_once
"./Modules/Test/classes/class.ilObjTestAccess.php";
322 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
324 $this->object->getId(),
328 $manScoringDone = $form->getItemByPostVar(
"manscoring_done")->getChecked();
331 $manScoringNotify = $form->getItemByPostVar(
"manscoring_notify")->getChecked();
332 if ($manScoringNotify) {
333 require_once
'Modules/Test/classes/notifications/class.ilTestManScoringParticipantNotification.php';
336 $this->object->_getUserIdFromActiveId($activeId),
337 $this->
object->getRefId()
341 'test_title' => $this->object->getTitle(),
342 'test_pass' =>
$pass + 1,
343 'questions_gui_list' => $questionGuiList,
344 'questions_scoring_data' => $notificationData
347 $notification->send();
350 require_once
'./Modules/Test/classes/class.ilTestScoring.php';
352 $scorer->setPreserveManualScores(
true);
353 $scorer->recalculateSolutions();
355 if ($this->object->getAnonymity() == 0) {
357 $name_real_or_anon = $user_name[
'firstname'] .
' ' . $user_name[
'lastname'];
359 $name_real_or_anon =
$lng->txt(
'anonymous');
361 ilUtil::sendSuccess(sprintf(
$lng->txt(
'tst_saved_manscoring_successfully'),
$pass + 1, $name_real_or_anon),
true);
362 if ($redirect ==
true) {
363 $ilCtrl->redirect($this,
'showManScoringParticipantScreen');
372 $ilCtrl = $DIC[
'ilCtrl'];
381 if ($participant[
'active_id'] ==
$_GET[
'active_id']) {
388 $ilCtrl->setParameter($this,
'active_id',
$participantData[$nextIndex][
'active_id']);
389 $ilCtrl->redirect($this,
'showManScoringParticipantScreen');
392 $ilCtrl->redirectByClass(
"iltestscoringgui",
"showManScoringParticipantsTable");
399 $ilCtrl = $DIC[
'ilCtrl'];
402 $ilCtrl->redirectByClass(
"iltestscoringgui",
"showManScoringParticipantsTable");
406 private function buildManScoringParticipantForm($questionGuiList, $activeId,
$pass, $initValues =
false)
409 $ilCtrl = $DIC[
'ilCtrl'];
412 require_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
413 require_once
'Services/Form/classes/class.ilFormSectionHeaderGUI.php';
414 require_once
'Services/Form/classes/class.ilCustomInputGUI.php';
415 require_once
'Services/Form/classes/class.ilCheckboxInputGUI.php';
416 require_once
'Services/Form/classes/class.ilTextInputGUI.php';
417 require_once
'Services/Form/classes/class.ilTextAreaInputGUI.php';
419 $ilCtrl->setParameter($this,
'active_id', $activeId);
420 $ilCtrl->setParameter($this,
'pass',
$pass);
423 $form->setFormAction($ilCtrl->getFormAction($this));
425 $form->setTitle(sprintf(
$lng->txt(
'manscoring_results_pass'),
$pass + 1));
426 $form->setTableWidth(
'100%');
429 foreach ($questionGuiList as $questionId => $questionGUI) {
430 $questionHeader = sprintf(
$lng->txt(
'tst_manscoring_question_section_header'), $questionGUI->object->getTitle());
431 $questionSolution = $questionGUI->getSolutionOutput($activeId,
$pass,
false,
false,
true,
false,
false,
true);
432 $bestSolution = $questionGUI->object->getSuggestedSolutionOutput();
433 $feedback = $this->
object->getSingleManualFeedback($activeId, $questionId,
$pass);
435 if (isset($feedback[
'finalized_evaluation']) && $feedback[
'finalized_evaluation'] == 1) {
440 $sect->setTitle($questionHeader .
' [' . $this->lng->txt(
'question_id_short') .
': ' . $questionGUI->object->getId() .
']');
441 $form->addItem($sect);
444 $cust->
setHtml($questionSolution);
445 $form->addItem($cust);
447 if ($questionGUI->supportsIntermediateSolutionOutput() && $questionGUI->hasIntermediateSolution($activeId,
$pass)) {
448 $questionGUI->setUseIntermediateSolution(
true);
449 $intermediateSolution = $questionGUI->getSolutionOutput($activeId,
$pass,
false,
false,
true,
false,
false,
true);
450 $questionGUI->setUseIntermediateSolution(
false);
452 $cust->
setHtml($intermediateSolution);
453 $form->addItem($cust);
456 $text =
new ilTextInputGUI(
$lng->txt(
'tst_change_points_for_question'),
"question__{$questionId}__points");
461 $text->setDisabled($disabled);
463 $form->addItem($text);
465 $nonedit =
new ilNonEditableValueGUI(
$lng->txt(
'tst_manscoring_input_max_points_for_question'),
"question__{$questionId}__maxpoints");
469 $form->addItem($nonedit);
472 $area->setUseRTE(
true);
474 $area->
setValue($this->object->getSingleManualFeedback($activeId, $questionId,
$pass)[
'feedback']);
477 $area->setDisabled($disabled);
479 $form->addItem($area);
485 $form->addItem($check);
487 if (strlen(trim($bestSolution))) {
490 $form->addItem($cust);
495 $sect->setTitle(
$lng->txt(
'tst_participant'));
496 $form->addItem($sect);
502 $form->addItem($check);
505 $form->addItem($check);
507 $form->addCommandButton(
'saveManScoringParticipantScreen',
$lng->txt(
'save'));
508 $form->addCommandButton(
'saveReturnManScoringParticipantScreen',
$lng->txt(
'save_return'));
509 $form->addCommandButton(
'saveNextManScoringParticipantScreen',
$lng->txt(
'save_and_next'));
523 require_once
'Modules/Test/classes/tables/class.ilTestManScoringParticipantsTableGUI.php';
527 $participantStatusFilterValue = $table->getFilterItemByPostVar(
'participant_status')->getValue();
529 require_once
'Modules/Test/classes/class.ilTestParticipantList.php';
532 $participantList->initializeFromDbRows(
533 $this->object->getTestParticipantsForManualScoring($participantStatusFilterValue)
536 $participantList = $participantList->getAccessFilteredList(
540 $table->setData($participantList->getParticipantsTableRows());
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.
static _getParticipantId($active_id)
Get user id for active id.
static _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.
const TAB_ID_MANUAL_SCORING
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...
__construct(ilObjTest $a_object)
ilTestScoringGUI constructor
const PART_FILTER_ACTIVE_ONLY
fetchPassParameter($activeId)
saveReturnManScoringParticipantScreen()
setTestAccess($testAccess)
executeCommand()
execute command
static accessViolationRedirect()
static _getMaximumPoints($question_id)
Returns the maximum points, a learner can reach answering the question.
const PART_FILTER_MANSCORING_NONE
static _mananuallyScoreableQuestionTypesExists()
Returns the fact wether manually scoreable question types exist or not.
showManScoringParticipantsTable()
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
This class represents a non editable value in a property form.
static getScoreParticipantsUserFilter($refId)
__construct(Container $dic, ilPlugin $plugin)
This class represents a text area property in a property form.
resetManScoringParticipantsFilter()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getReachedPoints($active_id, $question_id, $pass=null)
Returns the points, a learner has reached answering the question.
sendManScoringParticipantNotification()
saveNextManScoringParticipantScreen()
setAdditionalInformation(array $a_info)
Additional information for creating notification mails.
static _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...
const PART_FILTER_MANSCORING_DONE