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();
140 require_once
'Modules/Test/classes/tables/class.ilTestManScoringParticipantsTableGUI.php';
143 $participantStatusFilterValue = $table->getFilterItemByPostVar(
'participant_status')->getValue();
145 $table->setData( $this->object->getTestParticipantsForManualScoring($participantStatusFilterValue) );
147 $tpl->setContent( $table->getHTML() );
152 require_once
'Modules/Test/classes/tables/class.ilTestManScoringParticipantsTableGUI.php';
155 $table->resetOffset();
156 $table->writeFilterToSession();
163 require_once
'Modules/Test/classes/tables/class.ilTestManScoringParticipantsTableGUI.php';
166 $table->resetOffset();
167 $table->resetFilter();
183 if( $this->object->getNrOfTries() != 1 )
185 require_once
'Modules/Test/classes/tables/class.ilTestPassManualScoringOverviewTableGUI.php';
188 $userId = $this->
object->_getUserIdFromActiveId($activeId);
189 $userFullname = $this->
object->userLookupFullName($userId,
false,
true);
190 $tableTitle = sprintf($lng->txt(
'tst_pass_overview_for_participant'), $userFullname);
191 $table->setTitle($tableTitle);
193 $passOverviewData = $this->service->getPassOverviewData($activeId);
194 $table->setData($passOverviewData[
'passes']);
196 $contentHTML .= $table->getHTML().
'<br />';
203 $questionGuiList = $this->service->getManScoringQuestionGuiList($activeId,
$pass);
207 $contentHTML .= $form->getHTML();
211 $tpl->setContent($contentHTML);
221 $questionGuiList = $this->service->getManScoringQuestionGuiList($activeId,
$pass);
224 $form->setValuesByPost();
226 if( !$form->checkInput() )
232 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
234 $maxPointsByQuestionId = array();
235 $maxPointsExceeded =
false;
236 foreach($questionGuiList as $questionId => $questionGui)
238 $reachedPoints = $form->getItemByPostVar(
"question__{$questionId}__points")->getValue();
241 if( $reachedPoints > $maxPoints )
243 $maxPointsExceeded =
true;
245 $form->getItemByPostVar(
"question__{$questionId}__points")->setAlert( sprintf(
246 $lng->txt(
'tst_manscoring_maxpoints_exceeded_input_alert'), $maxPoints
250 $maxPointsByQuestionId[$questionId] = $maxPoints;
253 if( $maxPointsExceeded )
259 include_once
"./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
261 foreach($questionGuiList as $questionId => $questionGui)
263 $reachedPoints = $form->getItemByPostVar(
"question__{$questionId}__points")->getValue();
266 $activeId, $questionId, $reachedPoints, $maxPointsByQuestionId[$questionId],
267 $pass, 1, $this->object->areObligationsEnabled()
271 $form->getItemByPostVar(
"question__{$questionId}__feedback")->getValue(),
275 $this->
object->saveManualFeedback($activeId, $questionId,
$pass, $feedback);
277 $notificationData[$questionId] = array(
278 'points' => $reachedPoints,
'feedback' => $feedback
282 include_once
"./Modules/Test/classes/class.ilObjTestAccess.php";
283 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
288 $manScoringDone = $form->getItemByPostVar(
"manscoring_done")->getChecked();
291 $manScoringNotify = $form->getItemByPostVar(
"manscoring_notify")->getChecked();
292 if($manScoringNotify)
294 require_once
'Modules/Test/classes/notifications/class.ilTestManScoringParticipantNotification.php';
297 $this->object->_getUserIdFromActiveId($activeId), $this->
object->getRefId()
301 'test_title' => $this->object->getTitle(),
302 'test_pass' =>
$pass + 1,
303 'questions_gui_list' => $questionGuiList,
304 'questions_scoring_data' => $notificationData
307 $notification->send();
310 require_once
'./Modules/Test/classes/class.ilTestScoring.php';
312 $scorer->setPreserveManualScores(
true);
313 $scorer->recalculateSolutions();
316 $ilCtrl->redirect($this,
'showManScoringParticipantScreen');
323 require_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
324 require_once
'Services/Form/classes/class.ilFormSectionHeaderGUI.php';
325 require_once
'Services/Form/classes/class.ilCustomInputGUI.php';
326 require_once
'Services/Form/classes/class.ilCheckboxInputGUI.php';
327 require_once
'Services/Form/classes/class.ilTextInputGUI.php';
328 require_once
'Services/Form/classes/class.ilTextAreaInputGUI.php';
330 $ilCtrl->setParameter($this,
'active_id', $activeId);
331 $ilCtrl->setParameter($this,
'pass',
$pass);
334 $form->setFormAction($ilCtrl->getFormAction($this));
336 $form->setTitle( sprintf($lng->txt(
'manscoring_results_pass'),
$pass + 1) );
337 $form->setTableWidth(
'100%');
339 foreach($questionGuiList as $questionId => $questionGUI)
341 $questionHeader = sprintf($lng->txt(
'tst_manscoring_question_section_header'), $questionGUI->object->getTitle());
342 $questionSolution = $questionGUI->getSolutionOutput($activeId,
$pass,
false,
false,
true,
false,
false,
true);
343 $bestSolution = $questionGUI->object->getSuggestedSolutionOutput();
346 $sect->setTitle( $questionHeader .
' ['. $this->lng->txt(
'question_id_short') .
': ' . $questionGUI->object->getId() .
']');
347 $form->addItem($sect);
349 $cust =
new ilCustomInputGUI($lng->txt(
'tst_manscoring_input_question_and_user_solution'));
350 $cust->
setHtml($questionSolution);
351 $form->addItem($cust);
353 $text =
new ilTextInputGUI($lng->txt(
'tst_change_points_for_question'),
"question__{$questionId}__points");
355 $form->addItem($text);
357 $nonedit =
new ilNonEditableValueGUI($lng->txt(
'tst_manscoring_input_max_points_for_question'),
"question__{$questionId}__maxpoints");
359 $form->addItem($nonedit);
361 $area =
new ilTextAreaInputGUI($lng->txt(
'set_manual_feedback'),
"question__{$questionId}__feedback");
362 $area->setUseRTE(
true);
363 if( $initValues ) $area->
setValue( $this->object->getManualFeedback($activeId, $questionId,
$pass) );
364 $form->addItem($area);
366 $cust =
new ilCustomInputGUI($lng->txt(
'tst_manscoring_input_best_solution'));
368 $form->addItem($cust);
372 $sect->setTitle($lng->txt(
'tst_participant'));
373 $form->addItem($sect);
377 $form->addItem($check);
379 $check =
new ilCheckboxInputGUI($lng->txt(
'tst_manscoring_user_notification'),
'manscoring_notify');
380 $form->addItem($check);
382 $form->addCommandButton(
'saveManScoringParticipantScreen', $lng->txt(
'save'));
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
showManScoringParticipantScreen(ilPropertyFormGUI $form=null)
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 _updateStatus($a_obj_id, $a_usr_id, $a_obj=null, $a_percentage=false, $a_no_raise=false, $a_force_raise=false)
Update status.
& _getUsedHTMLTagsAsString($a_module="")
Returns a string of all allowed HTML tags for text editing.
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)
const PART_FILTER_MANSCORING_NONE
saveManScoringParticipantScreen()
& 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.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
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
setValue($a_value)
Set Value.
setAdditionalInformation($a_info)
Additional information for creating notification mails.
sendManScoringParticipantNotification()
const PART_FILTER_MANSCORING_DONE