4 include_once
"./Modules/Test/classes/inc.AssessmentConstants.php";
5 include_once
"./Modules/Test/classes/class.ilTestServiceGUI.php";
41 parent::__construct($a_object);
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);
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';
172 $table->writeFilterToSession();
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);
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();
295 $maxPointsByQuestionId[$questionId],
298 $this->object->areObligationsEnabled()
302 $form->getItemByPostVar(
"question__{$questionId}__feedback")->getValue(),
307 $this->
object->saveManualFeedback($activeId, $questionId,
$pass, $feedback);
309 $notificationData[$questionId] = array(
310 'points' => $reachedPoints,
'feedback' => $feedback
314 include_once
"./Modules/Test/classes/class.ilObjTestAccess.php";
315 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
317 $this->object->getId(),
321 $manScoringDone =
$form->getItemByPostVar(
"manscoring_done")->getChecked();
324 $manScoringNotify =
$form->getItemByPostVar(
"manscoring_notify")->getChecked();
325 if ($manScoringNotify) {
326 require_once
'Modules/Test/classes/notifications/class.ilTestManScoringParticipantNotification.php';
329 $this->object->_getUserIdFromActiveId($activeId),
330 $this->
object->getRefId()
334 'test_title' => $this->object->getTitle(),
335 'test_pass' =>
$pass + 1,
336 'questions_gui_list' => $questionGuiList,
337 'questions_scoring_data' => $notificationData
340 $notification->send();
343 require_once
'./Modules/Test/classes/class.ilTestScoring.php';
345 $scorer->setPreserveManualScores(
true);
346 $scorer->recalculateSolutions();
348 if ($this->object->getAnonymity() == 0) {
350 $name_real_or_anon = $user_name[
'firstname'] .
' ' . $user_name[
'lastname'];
352 $name_real_or_anon =
$lng->txt(
'anonymous');
354 ilUtil::sendSuccess(sprintf(
$lng->txt(
'tst_saved_manscoring_successfully'),
$pass + 1, $name_real_or_anon),
true);
355 if ($redirect ==
true) {
356 $ilCtrl->redirect($this,
'showManScoringParticipantScreen');
374 if ($participant[
'active_id'] ==
$_GET[
'active_id']) {
382 $ilCtrl->redirect($this,
'showManScoringParticipantScreen');
385 $ilCtrl->redirectByClass(
"iltestscoringgui",
"showManScoringParticipantsTable");
395 $ilCtrl->redirectByClass(
"iltestscoringgui",
"showManScoringParticipantsTable");
399 private function buildManScoringParticipantForm($questionGuiList, $activeId,
$pass, $initValues =
false)
405 require_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
406 require_once
'Services/Form/classes/class.ilFormSectionHeaderGUI.php';
407 require_once
'Services/Form/classes/class.ilCustomInputGUI.php';
408 require_once
'Services/Form/classes/class.ilCheckboxInputGUI.php';
409 require_once
'Services/Form/classes/class.ilTextInputGUI.php';
410 require_once
'Services/Form/classes/class.ilTextAreaInputGUI.php';
412 $ilCtrl->setParameter($this,
'active_id', $activeId);
418 $form->setTitle(sprintf(
$lng->txt(
'manscoring_results_pass'),
$pass + 1));
419 $form->setTableWidth(
'100%');
422 foreach ($questionGuiList as $questionId => $questionGUI) {
423 $questionHeader = sprintf(
$lng->txt(
'tst_manscoring_question_section_header'), $questionGUI->object->getTitle());
424 $questionSolution = $questionGUI->getSolutionOutput($activeId,
$pass,
false,
false,
true,
false,
false,
true);
425 $bestSolution = $questionGUI->object->getSuggestedSolutionOutput();
428 $sect->setTitle($questionHeader .
' [' . $this->lng->txt(
'question_id_short') .
': ' . $questionGUI->object->getId() .
']');
429 $form->addItem($sect);
432 $cust->
setHtml($questionSolution);
433 $form->addItem($cust);
435 if ($questionGUI->supportsIntermediateSolutionOutput() && $questionGUI->hasIntermediateSolution($activeId,
$pass)) {
436 $questionGUI->setUseIntermediateSolution(
true);
437 $intermediateSolution = $questionGUI->getSolutionOutput($activeId,
$pass,
false,
false,
true,
false,
false,
true);
438 $questionGUI->setUseIntermediateSolution(
false);
440 $cust->
setHtml($intermediateSolution);
441 $form->addItem($cust);
450 $nonedit =
new ilNonEditableValueGUI(
$lng->txt(
'tst_manscoring_input_max_points_for_question'),
"question__{$questionId}__maxpoints");
454 $form->addItem($nonedit);
457 $area->setUseRTE(
true);
459 $area->
setValue($this->object->getManualFeedback($activeId, $questionId,
$pass));
461 $form->addItem($area);
463 if (strlen(trim($bestSolution))) {
466 $form->addItem($cust);
471 $sect->setTitle(
$lng->txt(
'tst_participant'));
472 $form->addItem($sect);
478 $form->addItem($check);
481 $form->addItem($check);
483 $form->addCommandButton(
'saveManScoringParticipantScreen',
$lng->txt(
'save'));
484 $form->addCommandButton(
'saveReturnManScoringParticipantScreen',
$lng->txt(
'save_return'));
485 $form->addCommandButton(
'saveNextManScoringParticipantScreen',
$lng->txt(
'save_and_next'));
499 require_once
'Modules/Test/classes/tables/class.ilTestManScoringParticipantsTableGUI.php';
503 $participantStatusFilterValue =
$table->getFilterItemByPostVar(
'participant_status')->getValue();
505 require_once
'Modules/Test/classes/class.ilTestParticipantList.php';
508 $participantList->initializeFromDbRows(
509 $this->object->getTestParticipantsForManualScoring($participantStatusFilterValue)
512 $participantList = $participantList->getAccessFilteredList(
516 $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
if(isset($_POST['submit'])) $form
static _mananuallyScoreableQuestionTypesExists()
Returns the fact wether manually scoreable question types exist or not.
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)
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)
This class represents a text area property in a property form.
resetManScoringParticipantsFilter()
Service GUI class for tests.
if(empty($password)) $table
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