4 include_once
"./Modules/Test/classes/inc.AssessmentConstants.php";
5 include_once
"./Modules/Test/classes/class.ilTestServiceGUI.php";
36 parent::__construct($a_object);
42 protected function buildSubTabs($active_sub_tab =
'man_scoring_by_qst')
49 $ilTabs->addSubTab(
'man_scoring_by_qst', $this->lng->txt(
'tst_man_scoring_by_qst'), $this->ctrl->getLinkTargetByClass(
'ilTestScoringByQuestionsGUI',
'showManScoringByQuestionParticipantsTable'));
50 $ilTabs->addSubTab(
'man_scoring', $this->lng->txt(
'tst_man_scoring_by_part'), $this->ctrl->getLinkTargetByClass(
'ilTestScoringGUI',
'showManScoringParticipantsTable'));
51 $ilTabs->setSubTabActive($active_sub_tab);
60 if( !isset(
$_GET[
'active_id']) || !(
int)
$_GET[
'active_id'] )
64 $ilCtrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
68 $activeId = (int)$_GET[
'active_id'];
78 $maxPass = $this->
object->_getMaxPass($activeId);
79 if( isset(
$_GET[
"pass"]) && 0 <= (
int)
$_GET[
"pass"] && $maxPass >= (
int)
$_GET[
"pass"] )
81 $pass = $_GET[
"pass"];
89 $pass = $this->
object->_getResultPass($activeId);
102 if( !$ilAccess->checkAccess(
"write",
"", $this->ref_id) )
106 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
109 require_once
'Modules/Test/classes/class.ilObjAssessmentFolder.php';
114 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
117 $cmd = $this->ctrl->getCmd();
118 $next_class = $this->ctrl->getNextClass($this);
120 if (strlen(
$cmd) == 0)
122 $this->ctrl->redirect($this,
"manscoring");
126 $this->buildSubTabs(
'man_scoring');
143 $tpl->setContent( $table->getHTML() );
150 $table->resetOffset();
151 $table->writeFilterToSession();
160 $table->resetOffset();
161 $table->resetFilter();
176 require_once
'Modules/Test/classes/tables/class.ilTestPassManualScoringOverviewTableGUI.php';
179 $userId = $this->
object->_getUserIdFromActiveId($activeId);
180 $userFullname = $this->
object->userLookupFullName($userId,
false,
true);
181 $tableTitle = sprintf($lng->txt(
'tst_pass_overview_for_participant'), $userFullname);
182 $table->setTitle($tableTitle);
184 $passOverviewData = $this->service->getPassOverviewData($activeId);
185 $table->setData($passOverviewData[
'passes']);
187 $contentHTML .= $table->getHTML().
'<br />';
193 $questionGuiList = $this->service->getManScoringQuestionGuiList($activeId,
$pass);
197 $contentHTML .= $form->getHTML();
201 $tpl->setContent($contentHTML);
215 $questionGuiList = $this->service->getManScoringQuestionGuiList($activeId,
$pass);
218 $form->setValuesByPost();
220 if( !$form->checkInput() )
227 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
229 $maxPointsByQuestionId =
array();
230 $maxPointsExceeded =
false;
231 foreach($questionGuiList as $questionId => $questionGui)
233 $reachedPoints = $form->getItemByPostVar(
"question__{$questionId}__points")->getValue();
236 if( $reachedPoints > $maxPoints )
238 $maxPointsExceeded =
true;
240 $form->getItemByPostVar(
"question__{$questionId}__points")->setAlert( sprintf(
241 $lng->txt(
'tst_manscoring_maxpoints_exceeded_input_alert'), $maxPoints
245 $maxPointsByQuestionId[$questionId] = $maxPoints;
248 if( $maxPointsExceeded )
255 include_once
"./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
257 foreach($questionGuiList as $questionId => $questionGui)
259 $reachedPoints = $form->getItemByPostVar(
"question__{$questionId}__points")->getValue();
262 $activeId, $questionId, $reachedPoints, $maxPointsByQuestionId[$questionId],
267 $form->getItemByPostVar(
"question__{$questionId}__feedback")->getValue(),
271 $this->
object->saveManualFeedback($activeId, $questionId,
$pass, $feedback);
273 $notificationData[$questionId] =
array(
274 'points' => $reachedPoints,
'feedback' => $feedback
278 include_once
"./Modules/Test/classes/class.ilObjTestAccess.php";
279 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
284 $manScoringDone = $form->getItemByPostVar(
"manscoring_done")->getChecked();
287 $manScoringNotify = $form->getItemByPostVar(
"manscoring_notify")->getChecked();
288 if($manScoringNotify)
290 require_once
'Modules/Test/classes/notifications/class.ilTestManScoringParticipantNotification.php';
293 $this->
object->_getUserIdFromActiveId($activeId), $this->
object->getRefId()
297 'test_title' => $this->
object->getTitle(),
298 'test_pass' =>
$pass + 1,
299 'questions_gui_list' => $questionGuiList,
300 'questions_scoring_data' => $notificationData
303 $notification->send();
306 require_once
'./Modules/Test/classes/class.ilTestScoring.php';
308 $scorer->setPreserveManualScores(
true);
309 $scorer->recalculateSolutions();
311 if($this->
object->getAnonymity() == 0)
314 $name_real_or_anon = $user_name[
'firstname'].
' '. $user_name[
'lastname'];
318 $name_real_or_anon = $lng->txt(
'anonymous');
321 if($redirect ==
true)
323 $ilCtrl->redirect($this,
'showManScoringParticipantScreen');
344 if($participant[
'active_id'] ==
$_GET[
'active_id'])
346 $nextIndex = $index + 1;
353 $ilCtrl->setParameter($this,
'active_id',
$participantData[$nextIndex][
'active_id']);
354 $ilCtrl->redirect($this,
'showManScoringParticipantScreen');
357 $ilCtrl->redirectByClass(
"iltestscoringgui",
"showManScoringParticipantsTable");
367 $ilCtrl->redirectByClass(
"iltestscoringgui",
"showManScoringParticipantsTable");
375 require_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
376 require_once
'Services/Form/classes/class.ilFormSectionHeaderGUI.php';
377 require_once
'Services/Form/classes/class.ilCustomInputGUI.php';
378 require_once
'Services/Form/classes/class.ilCheckboxInputGUI.php';
379 require_once
'Services/Form/classes/class.ilTextInputGUI.php';
380 require_once
'Services/Form/classes/class.ilTextAreaInputGUI.php';
382 $ilCtrl->setParameter($this,
'active_id', $activeId);
383 $ilCtrl->setParameter($this,
'pass',
$pass);
386 $form->setFormAction($ilCtrl->getFormAction($this));
388 $form->setTitle( sprintf($lng->txt(
'manscoring_results_pass'),
$pass + 1) );
389 $form->setTableWidth(
'100%');
391 foreach($questionGuiList as $questionId => $questionGUI)
393 $questionHeader = sprintf($lng->txt(
'tst_manscoring_question_section_header'), $questionGUI->object->getTitle());
394 $questionSolution = $questionGUI->getSolutionOutput($activeId,
$pass,
false,
false,
true,
false,
false,
true);
395 $bestSolution = $questionGUI->object->getSuggestedSolutionOutput();
398 $sect->setTitle( $questionHeader .
' ['. $this->lng->txt(
'question_id_short') .
': ' . $questionGUI->object->getId() .
']');
399 $form->addItem($sect);
401 $cust =
new ilCustomInputGUI($lng->txt(
'tst_manscoring_input_question_and_user_solution'));
402 $cust->
setHtml($questionSolution);
403 $form->addItem($cust);
405 $text =
new ilTextInputGUI($lng->txt(
'tst_change_points_for_question'),
"question__{$questionId}__points");
407 $form->addItem(
$text);
409 $nonedit =
new ilNonEditableValueGUI($lng->txt(
'tst_manscoring_input_max_points_for_question'),
"question__{$questionId}__maxpoints");
411 $form->addItem($nonedit);
413 $area =
new ilTextAreaInputGUI($lng->txt(
'set_manual_feedback'),
"question__{$questionId}__feedback");
414 $area->setUseRTE(
true);
415 if( $initValues ) $area->
setValue( $this->
object->getManualFeedback($activeId, $questionId,
$pass) );
416 $form->addItem($area);
418 if(strlen(trim($bestSolution)))
422 $form->addItem($cust);
427 $sect->setTitle($lng->txt(
'tst_participant'));
428 $form->addItem($sect);
432 $form->addItem($check);
434 $check =
new ilCheckboxInputGUI($lng->txt(
'tst_manscoring_user_notification'),
'manscoring_notify');
435 $form->addItem($check);
437 $form->addCommandButton(
'saveManScoringParticipantScreen', $lng->txt(
'save'));
438 $form->addCommandButton(
'saveReturnManScoringParticipantScreen', $lng->txt(
'save_return'));
439 $form->addCommandButton(
'saveNextManScoringParticipantScreen', $lng->txt(
'save_and_next'));
453 require_once
'Modules/Test/classes/tables/class.ilTestManScoringParticipantsTableGUI.php';
458 $participantStatusFilterValue = $table->getFilterItemByPostVar(
'participant_status')->getValue();
459 $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.
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.
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()
executeCommand()
execute command
static _getMaximumPoints($question_id)
Returns the maximum points, a learner can reach answering the question.
const PART_FILTER_MANSCORING_NONE
static _getReachedPoints($active_id, $question_id, $pass=NULL)
Returns the points, a learner has reached answering the question.
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()
saveManScoringParticipantScreen($redirect=true)
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
buildManScoringParticipantsTable($withData=false)
Create styles array
The data for the language used.
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.
Create new PHPExcel object
obj_idprivate
This class represents a text area property in a property form.
resetManScoringParticipantsFilter()
Service GUI class for tests.
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