ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilTestScoringByQuestionsGUI.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 include_once 'Modules/Test/classes/inc.AssessmentConstants.php';
5 include_once 'Modules/Test/classes/class.ilTestScoringGUI.php';
6 
16 {
17  const ONLY_FINALIZED = 1;
18  const EXCEPT_FINALIZED = 2;
19 
23  public function __construct(ilObjTest $a_object)
24  {
25  parent::__construct($a_object);
26  }
27 
31  protected function getDefaultCommand()
32  {
33  return 'showManScoringByQuestionParticipantsTable';
34  }
35 
39  protected function getActiveSubTabId()
40  {
41  return 'man_scoring_by_qst';
42  }
43 
47  protected function showManScoringByQuestionParticipantsTable($manPointsPost = array())
48  {
49  global $DIC;
50 
51  $tpl = $DIC->ui()->mainTemplate();
52  $ilAccess = $DIC->access();
53 
54  $DIC->tabs()->activateTab(ilTestTabsManager::TAB_ID_MANUAL_SCORING);
55 
56  if (
57  false == $ilAccess->checkAccess("write", "", $this->ref_id) &&
58  false == $ilAccess->checkAccess("man_scoring_access", "", $this->ref_id)
59  ) {
60  ilUtil::sendInfo($this->lng->txt('cannot_edit_test'), true);
61  $this->ctrl->redirectByClass('ilobjtestgui', 'infoScreen');
62  }
63 
67 
68  $mathJaxSetting = new ilSetting('MathJax');
69 
70  if ($mathJaxSetting->get("enable")) {
71  $tpl->addJavaScript($mathJaxSetting->get("path_to_mathjax"));
72  }
73 
74  $tpl->addJavaScript("./Services/JavaScript/js/Basic.js");
75  $tpl->addJavaScript("./Services/Form/js/Form.js");
76  $tpl->addJavascript('./Services/UIComponent/Modal/js/Modal.js');
77  $this->lng->toJSMap(['answer' => $this->lng->txt('answer')]);
78 
80  $table->setManualScoringPointsPostData($manPointsPost);
81 
82  $qst_id = $table->getFilterItemByPostVar('question')->getValue();
83  $passNr = $table->getFilterItemByPostVar('pass')->getValue();
84  $finalized_filter = $table->getFilterItemByPostVar('finalize_evaluation')->getValue();
85  $answered_filter = $table->getFilterItemByPostVar('only_answered')->getChecked();
86  $table_data = [];
87  $selected_questionData = null;
88  $complete_feedback = $this->object->getCompleteManualFeedback($qst_id);
89 
90  if (is_numeric($qst_id)) {
91  $info = assQuestion::_getQuestionInfo($qst_id);
92  $selected_questionData = $info;
93  }
94 
95  if ($selected_questionData && is_numeric($passNr)) {
96  $data = $this->object->getCompleteEvaluationData(false);
97  $participants = $data->getParticipants();
98  $participantData = new ilTestParticipantData($DIC->database(), $DIC->language());
99  $participantData->setActiveIdsFilter(array_keys($data->getParticipants()));
100  $participantData->setParticipantAccessFilter(
102  );
103  $participantData->load($this->object->getTestId());
104 
105  foreach ($participantData->getActiveIds() as $active_id) {
106  $participant = $participants[$active_id];
107  $testResultData = $this->object->getTestResult($active_id, $passNr - 1);
108 
109  foreach ($testResultData as $questionData) {
110  $feedback = [];
111 
112  if (isset($complete_feedback[$active_id][$passNr - 1][$qst_id])) {
113  $feedback = $complete_feedback[$active_id][$passNr - 1][$qst_id];
114  }
115 
116  if (false == isset($feedback['finalized_evaluation'])) {
117  $feedback['finalized_evaluation'] = "";
118  }
119 
120  $check_filter =
121  ($finalized_filter != self::ONLY_FINALIZED || $feedback['finalized_evaluation'] == 1) &&
122  ($finalized_filter != self::EXCEPT_FINALIZED || $feedback['finalized_evaluation'] != 1);
123 
124  $check_answered = ($answered_filter == false || $questionData['answered']);
125 
126  if (
127  isset($questionData['qid']) &&
128  $questionData['qid'] == $selected_questionData['question_id'] &&
129  $check_filter &&
130  $check_answered
131  ) {
132  $table_data[] = [
133  'pass_id' => $passNr - 1,
134  'active_id' => $active_id,
135  'qst_id' => $questionData['qid'],
136  'reached_points' => assQuestion::_getReachedPoints($active_id, $questionData['qid'], $passNr - 1),
137  'maximum_points' => assQuestion::_getMaximumPoints($questionData['qid']),
138  'name' => $participant->getName()
139  ] + $feedback;
140  }
141  }
142  }
143  } else {
144  $table->disable('header');
145  }
146 
147  $table->setTitle($this->lng->txt('tst_man_scoring_by_qst'));
148 
149  if ($selected_questionData) {
150  $maxpoints = assQuestion::_getMaximumPoints($selected_questionData['question_id']);
151  $table->setCurQuestionMaxPoints($maxpoints);
152  $maxpoints = ' (' . $maxpoints . ' ' . $this->lng->txt('points') . ')';
153  if ($maxpoints == 1) {
154  $maxpoints = ' (' . $maxpoints . ' ' . $this->lng->txt('point') . ')';
155  }
156 
157  $table->setTitle(
158  $this->lng->txt('tst_man_scoring_by_qst') . ': ' . $selected_questionData['title'] . $maxpoints .
159  ' [' . $this->lng->txt('question_id_short') . ': ' . $selected_questionData['question_id'] . ']'
160  );
161  }
162 
163  $table->setData($table_data);
164  $tpl->setContent($table->getHTML());
165  }
166 
170  protected function saveManScoringByQuestion($ajax = false)
171  {
172  global $DIC;
173  $ilAccess = $DIC->access();
174 
175  if (
176  false == $ilAccess->checkAccess("write", "", $this->ref_id) &&
177  false == $ilAccess->checkAccess("man_scoring_access", "", $this->ref_id)
178  ) {
179  if ($ajax) {
180  echo $this->lng->txt('cannot_edit_test');
181  exit();
182  }
183 
184  ilUtil::sendInfo($this->lng->txt('cannot_edit_test'), true);
185  $this->ctrl->redirectByClass('ilobjtestgui', 'infoScreen');
186  }
187 
188  if (false == isset($_POST['scoring']) || false == is_array($_POST['scoring'])) {
189  ilUtil::sendFailure($this->lng->txt('tst_save_manscoring_failed_unknown'));
191  return;
192  }
193 
194  $pass = key($_POST['scoring']);
195  $activeData = current($_POST['scoring']);
196  $participantData = new ilTestParticipantData($DIC->database(), $DIC->language());
197  $manPointsPost = [];
198  $skipParticipant = [];
199  $maxPointsByQuestionId = [];
200 
201  $participantData->setActiveIdsFilter(array_keys($activeData));
202  $participantData->setParticipantAccessFilter(
204  );
205  $participantData->load($this->object->getTestId());
206 
207  foreach ($participantData->getActiveIds() as $active_id) {
208  $questions = $activeData[$active_id];
209 
210  // check for existing test result data
211  if (!$this->object->getTestResult($active_id, $pass)) {
212  if (false == isset($skipParticipant[$pass])) {
213  $skipParticipant[$pass] = [];
214  }
215  $skipParticipant[$pass][$active_id] = true;
216 
217  continue;
218  }
219 
220  foreach ((array) $questions as $qst_id => $reached_points) {
221  if (false == isset($manPointsPost[$pass])) {
222  $manPointsPost[$pass] = [];
223  }
224  if (false == isset($manPointsPost[$pass][$active_id])) {
225  $manPointsPost[$pass][$active_id] = [];
226  }
227 
228  $feedback_text = $this->retrieveFeedback($active_id, $qst_id, $pass);
229 
236  $current_feedback_info = ilObjTest::getSingleManualFeedback($active_id, $qst_id, $pass);
237  if (isset($current_feedback_info['finalized_evaluation']) && $current_feedback_info['finalized_evaluation'] === 1) {
238  $reached_points = assQuestion::_getReachedPoints($active_id, $qst_id, $pass);
239  $feedback_text = $current_feedback_info['feedback'];
240  }
241 
242  $maxPointsByQuestionId[$qst_id] = assQuestion::_getMaximumPoints($qst_id);
243  $manPointsPost[$pass][$active_id][$qst_id] = $reached_points;
244 
245  if ($reached_points > $maxPointsByQuestionId[$qst_id]) {
246  ilUtil::sendFailure(sprintf($this->lng->txt('tst_save_manscoring_failed'), $pass + 1));
247  $this->showManScoringByQuestionParticipantsTable($manPointsPost);
248  return;
249  }
250  }
251  }
252 
253  $changed_one = false;
254  $lastAndHopefullyCurrentQuestionId = null;
255 
256  foreach ($participantData->getActiveIds() as $active_id) {
257  $questions = $activeData[$active_id];
258  $update_participant = false;
259 
260  if (false == $skipParticipant[$pass][$active_id]) {
261  foreach ((array) $questions as $qst_id => $reached_points) {
262  $this->saveFinalization((int) $active_id, (int) $qst_id, (int) $pass, $feedback_text, $ajax);
263  // fix #35543: save manual points only if they differ from the existing points
264  // this prevents a question being set to "answered" if only feedback is entered
265  $old_points = assQuestion::_getReachedPoints($active_id, $qst_id, $pass);
266  if ($reached_points != $old_points) {
267  $update_participant = assQuestion::_setReachedPoints(
268  $active_id,
269  $qst_id,
270  $reached_points,
271  $maxPointsByQuestionId[$qst_id],
272  $pass,
273  1,
274  $this->object->areObligationsEnabled()
275  );
276  }
277  }
278 
279  if ($update_participant) {
281  $this->object->getId(),
283  );
284  }
285 
286  $changed_one = true;
287  $lastAndHopefullyCurrentQuestionId = $qst_id;
288  }
289  }
290 
291  $correction_feedback = [];
292  $correction_points = 0;
293 
294  if ($changed_one) {
295  $qTitle = '';
296 
297  if ($lastAndHopefullyCurrentQuestionId) {
298  $question = assQuestion::_instantiateQuestion($lastAndHopefullyCurrentQuestionId);
299  $qTitle = $question->getTitle();
300  }
301 
302  $msg = sprintf(
303  $this->lng->txt('tst_saved_manscoring_by_question_successfully'),
304  $qTitle,
305  $pass + 1
306  );
307 
308  ilUtil::sendSuccess($msg, true);
309 
310  if (isset($active_id)) {
311  $correction_feedback = $this->object->getSingleManualFeedback($active_id, $qst_id, $pass);
312  $correction_points = assQuestion::_getReachedPoints($active_id, $qst_id, $pass);
313  }
314  }
315 
316  if ($ajax && is_array($correction_feedback)) {
317  $correction_feedback['finalized_by'] = ilObjUser::_lookupFullname($correction_feedback['finalized_by_usr_id']);
318  $correction_feedback['finalized_on_date'] = '';
319 
320  if (strlen($correction_feedback['finalized_tstamp']) > 0) {
321  $time = new ilDateTime($correction_feedback['finalized_tstamp'], IL_CAL_UNIX);
322  $correction_feedback['finalized_on_date'] = $time->get(IL_CAL_DATETIME);
323  }
324 
325  if (!$correction_feedback['feedback']) {
326  $correction_feedback['feedback'] = [];
327  }
328  if ($correction_feedback['finalized_evaluation'] == 1) {
329  $correction_feedback['finalized_evaluation'] = $this->lng->txt('yes');
330  } else {
331  $correction_feedback['finalized_evaluation'] = $this->lng->txt('no');
332  }
333  echo json_encode([ 'feedback' => $correction_feedback, 'points' => $correction_points, "translation" => ['yes' => $this->lng->txt('yes'), 'no' => $this->lng->txt('no')]]);
334  exit();
335  } else {
337  }
338  }
339 
343  protected function applyManScoringByQuestionFilter()
344  {
346  $table->resetOffset();
347  $table->writeFilterToSession();
349  }
350 
354  protected function resetManScoringByQuestionFilter()
355  {
357  $table->resetOffset();
358  $table->resetFilter();
360  }
361 
362  protected function getAnswerDetail()
363  {
364  $active_id = (int) $_GET['active_id'];
365  $pass = (int) $_GET['pass_id'];
366  $question_id = (int) $_GET['qst_id'];
367 
368  if (!$this->getTestAccess()->checkScoreParticipantsAccessForActiveId($active_id)) {
369  exit; // illegal ajax call
370  }
371 
372  $data = $this->object->getCompleteEvaluationData(false);
373  $participant = $data->getParticipant($active_id);
374  $question_gui = $this->object->createQuestionGUI('', $question_id);
375  $tmp_tpl = new ilTemplate('tpl.il_as_tst_correct_solution_output.html', true, true, 'Modules/Test');
376  if ($question_gui->supportsIntermediateSolutionOutput() && $question_gui->hasIntermediateSolution($active_id, $pass)) {
377  $question_gui->setUseIntermediateSolution(true);
378  $aresult_output = $question_gui->getSolutionOutput($active_id, $pass, false, false, true, false, false, true);
379  $question_gui->setUseIntermediateSolution(false);
380  $tmp_tpl->setVariable('TEXT_ASOLUTION_OUTPUT', $this->lng->txt('autosavecontent'));
381  $tmp_tpl->setVariable('ASOLUTION_OUTPUT', $aresult_output);
382  }
383  $result_output = $question_gui->getSolutionOutput(
384  $active_id,
385  $pass,
386  false,
387  false,
388  false,
389  $this->object->getShowSolutionFeedback(),
390  false,
391  true
392  );
393  $max_points = $question_gui->object->getMaximumPoints();
394 
395  $this->appendUserNameToModal($tmp_tpl, $participant);
396  $this->appendQuestionTitleToModal($tmp_tpl, $question_id, $max_points, $question_gui->object->getTitle());
398  $tmp_tpl,
399  $result_output,
400  $question_gui->object->getReachedPoints($active_id, $pass),
401  $max_points
402  );
403  $this->appendFormToModal($tmp_tpl, $pass, $active_id, $question_id, $max_points);
404  $tmp_tpl->setVariable('TEXT_YOUR_SOLUTION', $this->lng->txt('answers_of') . ' ' . $participant->getName());
405  $suggested_solution = assQuestion::_getSuggestedSolutionOutput($question_id);
406  if ($this->object->getShowSolutionSuggested() && strlen($suggested_solution) > 0) {
407  $tmp_tpl->setVariable('TEXT_SOLUTION_HINT', $this->lng->txt("solution_hint"));
408  $tmp_tpl->setVariable("SOLUTION_HINT", assQuestion::_getSuggestedSolutionOutput($question_id));
409  }
410 
411  $tmp_tpl->setVariable('TEXT_SOLUTION_OUTPUT', $this->lng->txt('question'));
412  $tmp_tpl->setVariable('TEXT_RECEIVED_POINTS', $this->lng->txt('scoring'));
413  $add_title = ' [' . $this->lng->txt('question_id_short') . ': ' . $question_id . ']';
414  $question_title = $this->object->getQuestionTitle($question_gui->object->getTitle());
415  $lng = $this->lng->txt('points');
416  if ($max_points == 1) {
417  $lng = $this->lng->txt('point');
418  }
419 
420  $tmp_tpl->setVariable(
421  'QUESTION_TITLE',
422  $question_title . ' (' . $max_points . ' ' . $lng . ')' . $add_title
423  );
424  $tmp_tpl->setVariable('SOLUTION_OUTPUT', $result_output);
425 
426  $tmp_tpl->setVariable(
427  'RECEIVED_POINTS',
428  sprintf(
429  $this->lng->txt('part_received_a_of_b_points'),
430  $question_gui->object->getReachedPoints($active_id, $pass),
431  $max_points
432  )
433  );
434 
435  echo $tmp_tpl->get();
436  exit();
437  }
438 
443  {
444  $this->saveManScoringByQuestion(true);
445  }
446 
451  private function appendUserNameToModal($tmp_tpl, $participant)
452  {
453  global $DIC;
454  $ilAccess = $DIC->access();
455 
456  $tmp_tpl->setVariable(
457  'TEXT_YOUR_SOLUTION',
458  $this->lng->txt('answers_of') . ' ' . $participant->getName()
459  );
460 
461  if (
462  $this->object->anonymity == 1 ||
463  ($this->object->getAnonymity() == 2 && !$ilAccess->checkAccess('write', '', $this->object->getRefId()))
464  ) {
465  $tmp_tpl->setVariable(
466  'TEXT_YOUR_SOLUTION',
467  $this->lng->txt('answers_of') . ' ' . $this->lng->txt('anonymous')
468  );
469  }
470  }
471 
478  private function appendQuestionTitleToModal($tmp_tpl, $question_id, $max_points, $title)
479  {
480  $add_title = ' [' . $this->lng->txt('question_id_short') . ': ' . $question_id . ']';
481  $question_title = $this->object->getQuestionTitle($title);
482  $lng = $this->lng->txt('points');
483  if ($max_points == 1) {
484  $lng = $this->lng->txt('point');
485  }
486 
487  $tmp_tpl->setVariable(
488  'QUESTION_TITLE',
489  $question_title . ' (' . $max_points . ' ' . $lng . ')' . $add_title
490  );
491  }
492 
500  private function appendFormToModal($tmp_tpl, $pass, $active_id, $question_id, $max_points)
501  {
502  global $DIC;
503 
504  $ilCtrl = $DIC->ctrl();
505  $post_var = '[' . $pass . '][' . $active_id . '][' . $question_id . ']';
506  $scoring_post_var = 'scoring' . $post_var;
507  $reached_points = assQuestion::_getReachedPoints($active_id, $question_id, $pass);
508  $form = new ilPropertyFormGUI();
509  $feedback = $this->object->getSingleManualFeedback($active_id, $question_id, $pass);
510  $disable = false;
511  $form->setFormAction($ilCtrl->getFormAction($this, 'showManScoringByQuestionParticipantsTable'));
512  $form->setTitle($this->lng->txt('manscoring'));
513 
514  if (isset($feedback['finalized_evaluation']) && $feedback['finalized_evaluation'] == 1) {
515  $disable = true;
516  $hidden_points = new ilHiddenInputGUI($scoring_post_var);
517  $scoring_post_var = $scoring_post_var . '_disabled';
518  $hidden_points->setValue($reached_points);
519  $form->addItem($hidden_points);
520  }
521 
522  $feedback_text = '';
523  if (array_key_exists('feedback', $feedback)) {
524  $feedback_text = $feedback['feedback'];
525  }
526 
527  if ($disable) {
528  $feedback_input = new ilNonEditableValueGUI($this->lng->txt('set_manual_feedback'), 'm_feedback' . $post_var, true);
529  } else {
530  $tmp_tpl->setVariable('TINYMCE_ACTIVE', ilObjAdvancedEditing::_getRichTextEditor());
531  $feedback_input = new ilTextAreaInputGUI($this->lng->txt('set_manual_feedback'), 'm_feedback' . $post_var);
532  }
533  $feedback_input->setValue($feedback_text);
534  $form->addItem($feedback_input);
535 
536  $reached_points_form = new ilNumberInputGUI($this->lng->txt('tst_change_points_for_question'), $scoring_post_var);
537  $reached_points_form->allowDecimals(true);
538  $reached_points_form->setSize(5);
539  $reached_points_form->setMaxValue($max_points, true);
540  $reached_points_form->setMinValue(0);
541  $reached_points_form->setDisabled($disable);
542  $reached_points_form->setValue($reached_points);
543  $reached_points_form->setClientSideValidation(true);
544  $form->addItem($reached_points_form);
545 
546  $hidden_points = new ilHiddenInputGUI('qst_max_points');
547  $hidden_points->setValue($max_points);
548  $form->addItem($hidden_points);
549 
550  $hidden_points_name = new ilHiddenInputGUI('qst_hidden_points_name');
551  $hidden_points_name->setValue('scoring' . $post_var);
552  $form->addItem($hidden_points_name);
553 
554  $hidden_feedback_name = new ilHiddenInputGUI('qst_hidden_feedback_name');
555  $hidden_feedback_name->setValue('m_feedback' . $post_var);
556  $form->addItem($hidden_feedback_name);
557 
558  $hidden_feedback_id = new ilHiddenInputGUI('qst_hidden_feedback_id');
559  $post_id = '__' . $pass . '____' . $active_id . '____' . $question_id . '__';
560  $hidden_feedback_id->setValue('m_feedback' . $post_id);
561  $form->addItem($hidden_feedback_id);
562 
563  $evaluated = new ilCheckboxInputGUI($this->lng->txt('finalized_evaluation'), 'evaluated' . $post_var);
564  if (isset($feedback['finalized_evaluation']) && $feedback['finalized_evaluation'] == 1) {
565  $evaluated->setChecked(true);
566  }
567  $form->addItem($evaluated);
568 
569  $form->addCommandButton('checkConstraintsBeforeSaving', $this->lng->txt('save'));
570  $CharSelector = ilCharSelectorGUI::_getCurrentGUI();
571  $CharSelector->getConfig()->setAvailability(ilCharSelectorConfig::DISABLED);
572 
573  $tmp_tpl->setVariable(
574  'MANUAL_FEEDBACK',
575  $form->getHTML()
576  );
577  $tmp_tpl->setVariable(
578  'MODAL_AJAX_URL',
579  $this->ctrl->getLinkTarget($this, 'checkConstraintsBeforeSaving', '', true, false)
580  );
581  $tmp_tpl->setVariable(
582  'INFO_TEXT_MAX_POINTS_EXCEEDS',
583  sprintf($this->lng->txt('tst_manscoring_maxpoints_exceeded_input_alert'), $max_points)
584  );
585  }
586 
593  private function appendSolutionAndPointsToModal($tmp_tpl, $result_output, $reached_points, $max_points)
594  {
595  $tmp_tpl->setVariable(
596  'SOLUTION_OUTPUT',
597  $result_output
598  );
599  $tmp_tpl->setVariable(
600  'RECEIVED_POINTS',
601  sprintf(
602  $this->lng->txt('part_received_a_of_b_points'),
603  $reached_points,
604  $max_points
605  )
606  );
607  }
608 
609  protected function retrieveFeedback(int $active_id, int $qst_id, int $pass) : ?string
610  {
611  $feedback = $_POST['feedback'];
612  if ($feedback === null || $feedback === '') {
613  $feedback = $_POST['m_feedback'];
614  }
615 
616  if ($feedback === null || $feedback === '') {
617  return null;
618  }
619 
620  return ilUtil::stripSlashes(
621  $feedback[$pass][$active_id][$qst_id],
622  false,
624  );
625  }
626 
633  protected function saveFinalization($active_id, $qst_id, $pass, $feedback, $is_single_feedback)
634  {
635  $evaluated = false;
636  if ($this->doesValueExistsInPostArray('evaluated', $active_id, $qst_id, $pass)) {
637  $evaluated = (int) $_POST['evaluated'][$pass][$active_id][$qst_id];
638  if ($evaluated === 1) {
639  $evaluated = true;
640  }
641  }
642  $this->object->saveManualFeedback($active_id, $qst_id, $pass, $feedback, $evaluated, $is_single_feedback);
643  }
651  protected function doesValueExistsInPostArray($post_value, $active_id, $qst_id, $pass)
652  {
653  return (
654  isset($_POST[$post_value][$pass][$active_id][$qst_id]) &&
655  strlen($_POST[$post_value][$pass][$active_id][$qst_id]) > 0
656  );
657  }
658 }
showManScoringByQuestionParticipantsTable($manPointsPost=array())
exit
Definition: login.php:29
$data
Definition: storeScorm.php:23
const IL_CAL_DATETIME
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 _getRichTextEditor()
Returns the identifier for the Rich Text Editor.
This class represents a property form user interface.
$_GET["client_id"]
static _lookupFullname($a_user_id)
Lookup Full Name.
static _updateStatus($a_obj_id, $a_usr_id, $a_obj=null, $a_percentage=false, $a_force_raise=false)
Update status.
if(strpos($jquery_path, './')===0) elseif(strpos($jquery_path, '.')===0) $mathJaxSetting
Definition: latex.php:54
setValue($a_value)
Set Value.
This class represents a checkbox property in a property form.
Scoring class for tests.
const IL_CAL_UNIX
static initPanel($a_resize=false, ilGlobalTemplateInterface $a_main_tpl=null)
Init yui panel.
static _getMaximumPoints($question_id)
Returns the maximum points, a learner can reach answering the question.
allowDecimals($a_value)
Toggle Decimals.
static _getQuestionInfo($question_id)
Returns question information from the database.
appendFormToModal($tmp_tpl, $pass, $active_id, $question_id, $max_points)
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
setChecked($a_checked)
Set Checked.
This class represents a hidden form property in a property form.
doesValueExistsInPostArray($post_value, $active_id, $qst_id, $pass)
This class represents a number property in a property form.
appendSolutionAndPointsToModal($tmp_tpl, $result_output, $reached_points, $max_points)
global $DIC
Definition: goto.php:24
static _getCurrentGUI(ilObjTest $a_test_obj=null)
Get the GUI that is used for the currently available selector (other GUI instances may exist for conf...
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
appendQuestionTitleToModal($tmp_tpl, $question_id, $max_points, $title)
static _instantiateQuestion($question_id)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
saveFinalization($active_id, $qst_id, $pass, $feedback, $is_single_feedback)
static _getSuggestedSolutionOutput($question_id)
Returns the output of the suggested solution.
static initOverlay(ilGlobalTemplateInterface $a_main_tpl=null)
Init YUI Overlay module.
This class represents a non editable value in a property form.
static initjQuery(ilGlobalTemplateInterface $a_tpl=null)
inits and adds the jQuery JS-File to the global or a passed template
__construct(Container $dic, ilPlugin $plugin)
This class represents a text area property in a property form.
static _getReachedPoints($active_id, $question_id, $pass=null)
Returns the points, a learner has reached answering the question.
retrieveFeedback(int $active_id, int $qst_id, int $pass)
$_POST["username"]
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...
static getSingleManualFeedback($active_id, $question_id, $pass)
Retrieves the manual feedback for a question in a test.