ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
class.assTextQuestionGUI.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4require_once './Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
5require_once './Modules/TestQuestionPool/interfaces/interface.ilGuiQuestionScoringAdjustable.php';
6require_once './Modules/TestQuestionPool/interfaces/interface.ilGuiAnswerScoringAdjustable.php';
7require_once './Modules/Test/classes/inc.AssessmentConstants.php';
8
23{
31 public function __construct($id = -1)
32 {
33 parent::__construct();
34 include_once "./Modules/TestQuestionPool/classes/class.assTextQuestion.php";
35 $this->object = new assTextQuestion();
36 if ($id >= 0)
37 {
38 $this->object->loadFromDb($id);
39 }
40 }
41
49 public function writePostData($always = false)
50 {
51 $hasErrors = (!$always) ? $this->editQuestion(true) : false;
52 if (!$hasErrors)
53 {
54 require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
59 return 0;
60 }
61 return 1;
62 }
63
69 public function editQuestion($checkonly = FALSE)
70 {
71 $save = $this->isSaveCommand();
72 $this->getQuestionTemplate();
73
74 include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
75 $form = new ilPropertyFormGUI();
76 $form->setFormAction($this->ctrl->getFormAction($this));
77 $form->setTitle($this->outQuestionType());
78 $form->setMultipart(TRUE);
79 $form->setTableWidth("100%");
80 $form->setId("asstextquestion");
81
82 $this->addBasicQuestionFormProperties( $form );
84 $this->populateAnswerSpecificFormPart( $form );
85
86
87 $this->populateTaxonomyFormSection($form);
88
90
91 $errors = false;
92
93 if ($save)
94 {
95 $form->setValuesByPost();
96 $errors = !$form->checkInput();
97 $form->setValuesByPost(); // again, because checkInput now performs the whole stripSlashes handling and we need this if we don't want to have duplication of backslashes
98 if ($errors) $checkonly = false;
99 }
100
101 if (!$checkonly) $this->tpl->setVariable("QUESTION_DATA", $form->getHTML());
102 return $errors;
103 }
104
105 private static function buildAnswerTextOnlyArray($answers)
106 {
107 $answerTexts = array();
108
109 foreach($answers as $answer)
110 {
111 $answerTexts[] = $answer->getAnswertext();
112 }
113
114 return $answerTexts;
115 }
116
118 {
119 if ($this->object->getMaxNumOfChars() > 0)
120 {
121 $this->tpl->addBlockFile("CONTENT_BLOCK", "charcounter", "tpl.charcounter.html", "Modules/TestQuestionPool");
122 $this->tpl->setCurrentBlock("charcounter");
123 $this->tpl->setVariable("MAXCHARS", $this->object->getMaxNumOfChars());
124 $this->tpl->parseCurrentBlock();
125 }
126 }
127
128 function outQuestionForTest($formaction, $active_id, $pass = NULL, $is_postponed = FALSE, $use_post_solutions = FALSE)
129 {
130 $test_output = $this->getTestOutput($active_id, $pass, $is_postponed, $use_post_solutions);
131 $this->tpl->setVariable("QUESTION_OUTPUT", $test_output);
132 $this->tpl->setVariable("FORMACTION", $formaction);
133
134 // TODO - BEGIN: what exactly is done here? cant we use the parent method?
135
136 include_once "./Services/RTE/classes/class.ilRTE.php";
137 $rtestring = ilRTE::_getRTEClassname();
138 include_once "./Services/RTE/classes/class.$rtestring.php";
139 $rte = new $rtestring();
140 include_once "./Services/Object/classes/class.ilObject.php";
141 $obj_id = ilObject::_lookupObjectId($_GET["ref_id"]);
142 $obj_type = ilObject::_lookupType($_GET["ref_id"], TRUE);
143 $rte->addUserTextEditor("textinput");
144 $this->outAdditionalOutput();
145
146 // TODO - END: what exactly is done here? cant we use the parent method?
147 }
148
163 $active_id,
164 $pass = NULL,
165 $graphicalOutput = FALSE,
166 $result_output = FALSE,
167 $show_question_only = TRUE,
168 $show_feedback = FALSE,
169 $show_correct_solution = FALSE,
170 $show_manual_scoring = FALSE,
171 $show_question_text = TRUE
172 )
173 {
174 // get the solution of the user for the active pass or from the last pass if allowed
175
176 $user_solution = $this->getUserAnswer( $active_id, $pass );
177
178 if (($active_id > 0) && (!$show_correct_solution))
179 {
180 $solution = $user_solution;
181 }
182 else
183 {
184 $solution = $this->getBestAnswer();
185 }
186
187 // generate the question output
188 include_once "./Services/UICore/classes/class.ilTemplate.php";
189 $template = new ilTemplate("tpl.il_as_qpl_text_question_output_solution.html", TRUE, TRUE, "Modules/TestQuestionPool");
190 $solutiontemplate = new ilTemplate("tpl.il_as_tst_solution_output.html",TRUE, TRUE, "Modules/TestQuestionPool");
191
192 $solution = $this->object->getHtmlUserSolutionPurifier()->purify($solution);
193 $template->setVariable("ESSAY", $this->object->prepareTextareaOutput($solution, TRUE));
194
195 $questiontext = $this->object->getQuestion();
196
197 if (!$show_correct_solution)
198 {
199 $max_no_of_chars = $this->object->getMaxNumOfChars();
200
201 if ($max_no_of_chars == 0)
202 {
203 $max_no_of_chars = ucfirst($this->lng->txt('unlimited'));
204 }
205
206 $act_no_of_chars = strlen($user_solution);
207 $template->setVariable("CHARACTER_INFO", '<b>' . $max_no_of_chars . '</b>' .
208 $this->lng->txt('answer_characters') . ' <b>' . $act_no_of_chars . '</b>');
209 }
210 if (($active_id > 0) && (!$show_correct_solution))
211 {
212 if ($graphicalOutput)
213 {
214 // output of ok/not ok icons for user entered solutions
215 $reached_points = $this->object->getReachedPoints($active_id, $pass);
216 if ($reached_points == $this->object->getMaximumPoints())
217 {
218 $template->setCurrentBlock("icon_ok");
219 $template->setVariable("ICON_OK", ilUtil::getImagePath("icon_ok.svg"));
220 $template->setVariable("TEXT_OK", $this->lng->txt("answer_is_right"));
221 $template->parseCurrentBlock();
222 }
223 else
224 {
225 $template->setCurrentBlock("icon_ok");
226 if ($reached_points > 0)
227 {
228 $template->setVariable("ICON_NOT_OK", ilUtil::getImagePath("icon_mostly_ok.svg"));
229 $template->setVariable("TEXT_NOT_OK", $this->lng->txt("answer_is_not_correct_but_positive"));
230 }
231 else
232 {
233 $template->setVariable("ICON_NOT_OK", ilUtil::getImagePath("icon_not_ok.svg"));
234 $template->setVariable("TEXT_NOT_OK", $this->lng->txt("answer_is_wrong"));
235 }
236 $template->parseCurrentBlock();
237 }
238 }
239 }
240 if ($show_question_text==true)
241 {
242 $template->setVariable("QUESTIONTEXT", $this->object->prepareTextareaOutput($questiontext, TRUE));
243 }
244 $questionoutput = $template->get();
245
246 $feedback = '';
247 if($show_feedback)
248 {
249 $fb = $this->getGenericFeedbackOutput($active_id, $pass);
250 $feedback .= strlen($fb) ? $fb : '';
251
252 $fb = $this->getSpecificFeedbackOutput($active_id, $pass);
253 $feedback .= strlen($fb) ? $fb : '';
254 }
255 if (strlen($feedback)) $solutiontemplate->setVariable("FEEDBACK", $this->object->prepareTextareaOutput( $feedback, true ));
256
257 $solutiontemplate->setVariable("SOLUTION_OUTPUT", $questionoutput);
258
259 $solutionoutput = $solutiontemplate->get();
260 if (!$show_question_only)
261 {
262 // get page object output
263 $solutionoutput = $this->getILIASPage($solutionoutput);
264 }
265 return $solutionoutput;
266 }
267
268 private function getBestAnswer()
269 {
270 $answers = $this->object->getAnswers();
271 if (count( $answers ))
272 {
273 $user_solution = $this->lng->txt( "solution_contain_keywords" ) . "<ul>";
274
275 foreach ($answers as $answer)
276 {
277 $user_solution .= '<li>'. $answer->getAnswertext();
278
279 if( in_array($this->object->getKeywordRelation(), assTextQuestion::getScoringModesWithPointsByKeyword()) )
280 {
281 $user_solution .= ' ' . $this->lng->txt('for') . ' ';
282 $user_solution .= $answer->getPoints() . ' ' . $this->lng->txt('points') . '</li>';
283 }
284 }
285 $user_solution .= '</ul>';
286
287 $user_solution .= $this->lng->txt('essay_scoring_mode') . ': ';
288
289 switch( $this->object->getKeywordRelation() )
290 {
291 case 'any':
292 $user_solution .= $this->lng->txt('essay_scoring_mode_keyword_relation_any');
293 break;
294 case 'all':
295 $user_solution .= $this->lng->txt('essay_scoring_mode_keyword_relation_all');
296 break;
297 case 'one':
298 $user_solution .= $this->lng->txt('essay_scoring_mode_keyword_relation_one');
299 break;
300 }
301 }
302 return $user_solution;
303 }
304
305 private function getUserAnswer($active_id, $pass)
306 {
307 $user_solution = "";
308 $solutions = $this->object->getSolutionValues( $active_id, $pass );
309 foreach ($solutions as $idx => $solution_value)
310 {
311 $user_solution = $solution_value["value1"];
312 }
313 return $user_solution;
314 }
315
316 function getPreview($show_question_only = FALSE, $showInlineFeedback = false)
317 {
318 // generate the question output
319 include_once "./Services/UICore/classes/class.ilTemplate.php";
320 $template = new ilTemplate("tpl.il_as_qpl_text_question_output.html", TRUE, TRUE, "Modules/TestQuestionPool");
321 if ($this->object->getMaxNumOfChars())
322 {
323 $template->setCurrentBlock("maximum_char_hint");
324 $template->setVariable("MAXIMUM_CHAR_HINT", sprintf($this->lng->txt("text_maximum_chars_allowed"), $this->object->getMaxNumOfChars()));
325 $template->parseCurrentBlock();
326 #mbecker: No such block. $template->setCurrentBlock("has_maxchars");
327 $template->setVariable("MAXCHARS", $this->object->getMaxNumOfChars());
328 $template->parseCurrentBlock();
329 $template->setCurrentBlock("maxchars_counter");
330 $template->setVariable("MAXCHARS", $this->object->getMaxNumOfChars());
331 $template->setVariable("TEXTBOXSIZE", strlen($this->object->getMaxNumOfChars()));
332 $template->setVariable("CHARACTERS", $this->lng->txt("characters"));
333 $template->parseCurrentBlock();
334 }
335
336 if( is_object($this->getPreviewSession()) )
337 {
338 $template->setVariable("ESSAY", ilUtil::prepareFormOutput(
339 $this->getPreviewSession()->getParticipantsSolution()
340 ));
341 }
342
343 $questiontext = $this->object->getQuestion();
344 $template->setVariable("QUESTIONTEXT", $this->object->prepareTextareaOutput($questiontext, TRUE));
345 $questionoutput = $template->get();
346 if (!$show_question_only)
347 {
348 // get page object output
349 $questionoutput = $this->getILIASPage($questionoutput);
350 }
351 return $questionoutput;
352 }
353
354 function getTestOutput($active_id, $pass = NULL, $is_postponed = FALSE, $use_post_solutions = FALSE)
355 {
356 // get the solution of the user for the active pass or from the last pass if allowed
357 $user_solution = "";
358 if ($active_id)
359 {
360 $solutions = NULL;
361 include_once "./Modules/Test/classes/class.ilObjTest.php";
362 if (!ilObjTest::_getUsePreviousAnswers($active_id, true))
363 {
364 if (is_null($pass)) $pass = ilObjTest::_getPass($active_id);
365 }
366 $solutions =& $this->object->getSolutionValues($active_id, $pass);
367 foreach ($solutions as $idx => $solution_value)
368 {
369 $user_solution = $solution_value["value1"];
370 }
371 }
372
373 // generate the question output
374 include_once "./Services/UICore/classes/class.ilTemplate.php";
375 $template = new ilTemplate("tpl.il_as_qpl_text_question_output.html", TRUE, TRUE, "Modules/TestQuestionPool");
376 if ($this->object->getMaxNumOfChars())
377 {
378 $template->setCurrentBlock("maximum_char_hint");
379 $template->setVariable("MAXIMUM_CHAR_HINT", sprintf($this->lng->txt("text_maximum_chars_allowed"), $this->object->getMaxNumOfChars()));
380 $template->parseCurrentBlock();
381 #mbecker: No such block. $template->setCurrentBlock("has_maxchars");
382 $template->setVariable("MAXCHARS", $this->object->getMaxNumOfChars());
383 $template->parseCurrentBlock();
384 $template->setCurrentBlock("maxchars_counter");
385 $template->setVariable("MAXCHARS", $this->object->getMaxNumOfChars());
386 $template->setVariable("TEXTBOXSIZE", strlen($this->object->getMaxNumOfChars()));
387 $template->setVariable("CHARACTERS", $this->lng->txt("characters"));
388 $template->parseCurrentBlock();
389 }
390 $template->setVariable("ESSAY", ilUtil::prepareFormOutput($user_solution));
391 $questiontext = $this->object->getQuestion();
392 $template->setVariable("QUESTIONTEXT", $this->object->prepareTextareaOutput($questiontext, TRUE));
393 $questionoutput = $template->get();
394 $pageoutput = $this->outQuestionPage("", $is_postponed, $active_id, $questionoutput);
395 include_once "./Services/YUI/classes/class.ilYuiUtil.php";
397 return $pageoutput;
398 }
399
401 {
402 $_SESSION["subquestion_index"] = 0;
403 if ($_POST["cmd"]["addSuggestedSolution"])
404 {
405 if ($this->writePostData())
406 {
408 $this->editQuestion();
409 return;
410 }
411 if (!$this->checkInput())
412 {
413 ilUtil::sendInfo($this->lng->txt("fill_out_all_required_fields_add_answer"));
414 $this->editQuestion();
415 return;
416 }
417 }
418 $this->object->saveToDb();
419 $this->ctrl->setParameter($this, "q_id", $this->object->getId());
420 $this->tpl->setVariable("HEADER", $this->object->getTitle());
421 $this->getQuestionTemplate();
422 parent::addSuggestedSolution();
423 }
424
433 {
434 global $rbacsystem, $ilTabs;
435
436 $ilTabs->clearTargets();
437
438 $this->ctrl->setParameterByClass("ilAssQuestionPageGUI", "q_id", $_GET["q_id"]);
439 include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
440 $q_type = $this->object->getQuestionType();
441
442 if (strlen($q_type))
443 {
444 $classname = $q_type . "GUI";
445 $this->ctrl->setParameterByClass(strtolower($classname), "sel_question_types", $q_type);
446 $this->ctrl->setParameterByClass(strtolower($classname), "q_id", $_GET["q_id"]);
447 }
448
449 if ($_GET["q_id"])
450 {
451 if ($rbacsystem->checkAccess('write', $_GET["ref_id"]))
452 {
453 // edit page
454 $ilTabs->addTarget("edit_page",
455 $this->ctrl->getLinkTargetByClass("ilAssQuestionPageGUI", "edit"),
456 array("edit", "insert", "exec_pg"),
457 "", "", $force_active);
458 }
459
460 $this->addTab_QuestionPreview($ilTabs);
461 }
462
463 $force_active = false;
464 if ($rbacsystem->checkAccess('write', $_GET["ref_id"]))
465 {
466 $url = "";
467 if ($classname) $url = $this->ctrl->getLinkTargetByClass($classname, "editQuestion");
468 // edit question properties
469 $ilTabs->addTarget("edit_question",
470 $url,
471 array("editQuestion", "save", "saveEdit", "originalSyncForm"),
472 $classname, "", $force_active);
473 }
474
475 // add tab for question feedback within common class assQuestionGUI
476 $this->addTab_QuestionFeedback($ilTabs);
477
478 // add tab for question hint within common class assQuestionGUI
479 $this->addTab_QuestionHints($ilTabs);
480
481 // add tab for question's suggested solution within common class assQuestionGUI
482 $this->addTab_SuggestedSolution($ilTabs, $classname);
483
484 // Assessment of questions sub menu entry
485 if ($_GET["q_id"])
486 {
487 $ilTabs->addTarget("statistics",
488 $this->ctrl->getLinkTargetByClass($classname, "assessment"),
489 array("assessment"),
490 $classname, "");
491 }
492
493 $this->addBackTab($ilTabs);
494 }
495
496 function getSpecificFeedbackOutput($active_id, $pass)
497 {
498 $feedback = '<table><tbody>';
499 $user_answers = $this->object->getSolutionValues($active_id);
500 $user_answer = ' '. $user_answers[0]['value1'];
501
502 foreach ($this->object->getAnswers() as $idx => $ans)
503 {
504 if ($this->object->isKeywordMatching($user_answer, $ans->getAnswertext() ))
505 {
506 $fb = $this->object->feedbackOBJ->getSpecificAnswerFeedbackTestPresentation(
507 $this->object->getId(), $idx
508 );
509 $feedback .= '<tr><td><b><i>' . $ans->getAnswertext() . '</i></b></td><td>';
510 $feedback .= $fb . '</td> </tr>';
511 }
512 }
513
514 $feedback .= '</tbody></table>';
515 return $this->object->prepareTextareaOutput($feedback, TRUE);
516 }
517
519 {
520 $this->object->setMaxNumOfChars( $_POST["maxchars"] );
521 $this->object->setTextRating( $_POST["text_rating"] );
522 $this->object->setKeywordRelation( $_POST['scoring_mode'] );
523 }
524
526 {
527 switch ($this->object->getKeywordRelation())
528 {
529 case 'non':
530 $this->object->setAnswers( array() );
531 $this->object->setPoints( $_POST['non_keyword_points'] );
532 break;
533 case 'any':
534 $this->object->setAnswers( $_POST['any_keyword'] );
535 $this->object->setPoints( $this->object->getMaximumPoints() );
536 break;
537 case 'all':
538 $this->object->setAnswers( $_POST['all_keyword'] );
539 $this->object->setPoints( $_POST['all_keyword_points'] );
540 break;
541 case 'one':
542 $this->object->setAnswers( $_POST['one_keyword'] );
543 $this->object->setPoints( $_POST['one_keyword_points'] );
544 break;
545 }
546 }
547
549 {
550 // maxchars
551 $maxchars = new ilNumberInputGUI($this->lng->txt( "maxchars" ), "maxchars");
552 $maxchars->setSize( 5 );
553 if ($this->object->getMaxNumOfChars() > 0)
554 $maxchars->setValue( $this->object->getMaxNumOfChars() );
555 $maxchars->setInfo( $this->lng->txt( "description_maxchars" ) );
556 $form->addItem( $maxchars );
557
558 // text rating
559 $textrating = new ilSelectInputGUI($this->lng->txt("text_rating"), "text_rating");
560 $text_options = array(
561 "ci" => $this->lng->txt("cloze_textgap_case_insensitive"),
562 "cs" => $this->lng->txt("cloze_textgap_case_sensitive"),
563 "l1" => sprintf($this->lng->txt("cloze_textgap_levenshtein_of"), "1"),
564 "l2" => sprintf($this->lng->txt("cloze_textgap_levenshtein_of"), "2"),
565 "l3" => sprintf($this->lng->txt("cloze_textgap_levenshtein_of"), "3"),
566 "l4" => sprintf($this->lng->txt("cloze_textgap_levenshtein_of"), "4"),
567 "l5" => sprintf($this->lng->txt("cloze_textgap_levenshtein_of"), "5")
568 );
569 $textrating->setOptions($text_options);
570 $textrating->setValue($this->object->getTextRating());
571 $form->addItem($textrating);
572
573 return $form;
574 }
575
577 {
578 $scoringMode = new ilRadioGroupInputGUI(
579 $this->lng->txt( 'essay_scoring_mode' ), 'scoring_mode'
580 );
581
582 $scoringOptionNone = new ilRadioOption($this->lng->txt( 'essay_scoring_mode_without_keywords' ),
583 'non', $this->lng->txt( 'essay_scoring_mode_without_keywords_desc'
584 )
585 );
586 $scoringOptionAnyKeyword = new ilRadioOption($this->lng->txt( 'essay_scoring_mode_keyword_relation_any' ),
587 'any', $this->lng->txt( 'essay_scoring_mode_keyword_relation_any_desc'
588 )
589 );
590 $scoringOptionAllKeyword = new ilRadioOption($this->lng->txt( 'essay_scoring_mode_keyword_relation_all' ),
591 'all', $this->lng->txt( 'essay_scoring_mode_keyword_relation_all_desc'
592 )
593 );
594 $scoringOptionOneKeyword = new ilRadioOption($this->lng->txt( 'essay_scoring_mode_keyword_relation_one' ),
595 'one', $this->lng->txt( 'essay_scoring_mode_keyword_relation_one_desc'
596 )
597 );
598
599 $scoringMode->addOption( $scoringOptionNone );
600 $scoringMode->addOption( $scoringOptionAnyKeyword );
601 $scoringMode->addOption( $scoringOptionAllKeyword );
602 $scoringMode->addOption( $scoringOptionOneKeyword );
603 $scoringMode->setRequired( true );
604 $scoringMode->setValue( strlen( $this->object->getKeywordRelation() ) ? $this->object->getKeywordRelation(
605 ) : 'non'
606 );
607
608 if ($this->object->getAnswerCount() == 0)
609 {
610 $this->object->addAnswer( "", 1, 0, 0 );
611 }
612 require_once "./Modules/TestQuestionPool/classes/class.ilEssayKeywordWizardInputGUI.php";
613
614 // Without Keywords
615 $nonKeywordPoints = new ilNumberInputGUI($this->lng->txt( "points" ), "non_keyword_points");
616 $nonKeywordPoints->allowDecimals(true);
617 $nonKeywordPoints->setValue( $this->object->getPoints() );
618 $nonKeywordPoints->setRequired( TRUE );
619 $nonKeywordPoints->setSize( 3 );
620 $nonKeywordPoints->setMinValue( 0.0 );
621 $nonKeywordPoints->setMinvalueShouldBeGreater( true );
622 $scoringOptionNone->addSubItem( $nonKeywordPoints );
623
624 // Any Keyword
625 $anyKeyword = new ilEssayKeywordWizardInputGUI($this->lng->txt( "answers" ), "any_keyword");
626 $anyKeyword->setRequired( TRUE );
627 $anyKeyword->setQuestionObject( $this->object );
628 $anyKeyword->setSingleline( TRUE );
629 $anyKeyword->setValues( $this->object->getAnswers() );
630 $scoringOptionAnyKeyword->addSubItem( $anyKeyword );
631
632 // All Keywords
633 $allKeyword = new ilTextWizardInputGUI($this->lng->txt( "answers" ), "all_keyword");
634 $allKeyword->setRequired( TRUE );
635 //$allKeyword->setQuestionObject($this->object);
636 //$allKeyword->setSingleline(TRUE);
637 $allKeyword->setValues( self::buildAnswerTextOnlyArray( $this->object->getAnswers() ) );
638 $scoringOptionAllKeyword->addSubItem( $allKeyword );
639 $allKeywordPoints = new ilNumberInputGUI($this->lng->txt( "points" ), "all_keyword_points");
640 $allKeywordPoints->allowDecimals(true);
641 $allKeywordPoints->setValue( $this->object->getPoints() );
642 $allKeywordPoints->setRequired( TRUE );
643 $allKeywordPoints->setSize( 3 );
644 $allKeywordPoints->setMinValue( 0.0 );
645 $allKeywordPoints->setMinvalueShouldBeGreater( true );
646 $scoringOptionAllKeyword->addSubItem( $allKeywordPoints );
647
648 // One Keywords
649 $oneKeyword = new ilTextWizardInputGUI($this->lng->txt( "answers" ), "one_keyword");
650 $oneKeyword->setRequired( TRUE );
651 //$oneKeyword->setQuestionObject($this->object);
652 //$oneKeyword->setSingleline(TRUE);
653 $oneKeyword->setValues( self::buildAnswerTextOnlyArray( $this->object->getAnswers() ) );
654 $scoringOptionOneKeyword->addSubItem( $oneKeyword );
655 $oneKeywordPoints = new ilNumberInputGUI($this->lng->txt( "points" ), "one_keyword_points");
656 $oneKeywordPoints->allowDecimals(true);
657 $oneKeywordPoints->setValue( $this->object->getPoints() );
658 $oneKeywordPoints->setRequired( TRUE );
659 $oneKeywordPoints->setSize( 3 );
660 $oneKeywordPoints->setMinValue( 0.0 );
661 $oneKeywordPoints->setMinvalueShouldBeGreater( true );
662 $scoringOptionOneKeyword->addSubItem( $oneKeywordPoints );
663
664 $form->addItem( $scoringMode );
665 }
666
677 {
678 return array();
679 }
680
691 {
692 return array();
693 }
694
703 public function getAggregatedAnswersView($relevant_answers)
704 {
705 return ''; //print_r($relevant_answers,true);
706 }
707}
$_GET["client_id"]
Basic GUI class for assessment questions.
populateTaxonomyFormSection(ilPropertyFormGUI $form)
addTab_QuestionHints(ilTabsGUI $tabs)
adds the hints tab to ilTabsGUI
addQuestionFormCommandButtons($form)
Add the command buttons of a question properties form.
getILIASPage($html="")
Returns the ILIAS Page around a question.
getQuestionTemplate()
get question template
writePostData()
Evaluates a posted edit form and writes the form data in the question object.
addTab_SuggestedSolution(ilTabsGUI $tabs, $classname)
outQuestionPage($a_temp_var, $a_postponed=false, $active_id="", $html="")
output question page
addBackTab(ilTabsGUI $ilTabs)
addTab_QuestionFeedback(ilTabsGUI $tabs)
adds the feedback tab to ilTabsGUI
addBasicQuestionFormProperties($form)
Add basic question form properties: assessment: title, author, description, question,...
addTab_QuestionPreview(ilTabsGUI $tabsGUI)
getGenericFeedbackOutput($active_id, $pass)
Returns the answer specific feedback for the question.
Text question GUI representation.
getPreview($show_question_only=FALSE, $showInlineFeedback=false)
getAggregatedAnswersView($relevant_answers)
Returns an html string containing a question specific representation of the answers so far given in t...
getTestOutput($active_id, $pass=NULL, $is_postponed=FALSE, $use_post_solutions=FALSE)
populateQuestionSpecificFormPart(\ilPropertyFormGUI $form)
getSolutionOutput( $active_id, $pass=NULL, $graphicalOutput=FALSE, $result_output=FALSE, $show_question_only=TRUE, $show_feedback=FALSE, $show_correct_solution=FALSE, $show_manual_scoring=FALSE, $show_question_text=TRUE)
Get the question solution output.
writeQuestionSpecificPostData(ilPropertyFormGUI $form)
Extracts the question specific values from $_POST and applies them to the data object.
writePostData($always=false)
Evaluates a posted edit form and writes the form data in the question object.
__construct($id=-1)
assTextQuestionGUI constructor
getSpecificFeedbackOutput($active_id, $pass)
Returns the answer specific feedback for the question.
getAfterParticipationSuppressionQuestionPostVars()
Returns a list of postvars which will be suppressed in the form output when used in scoring adjustmen...
editQuestion($checkonly=FALSE)
Creates an output of the edit form for the question.
setQuestionTabs()
Sets the ILIAS tabs for this question type.
getAfterParticipationSuppressionAnswerPostVars()
Returns a list of postvars which will be suppressed in the form output when used in scoring adjustmen...
writeAnswerSpecificPostData(ilPropertyFormGUI $form)
Extracts the answer specific values from $_POST and applies them to the data object.
getUserAnswer($active_id, $pass)
static buildAnswerTextOnlyArray($answers)
populateAnswerSpecificFormPart(\ilPropertyFormGUI $form)
outQuestionForTest($formaction, $active_id, $pass=NULL, $is_postponed=FALSE, $use_post_solutions=FALSE)
Class for text questions.
static getScoringModesWithPointsByKeyword()
This class represents a number property in a property form.
_getUsePreviousAnswers($active_id, $user_active_user_setting=false)
Returns if the previous results should be hidden for a learner.
_getPass($active_id)
Retrieves the actual pass of a given user for a given test.
static _lookupObjectId($a_ref_id)
lookup object id
static _lookupType($a_id, $a_reference=false)
lookup object type
This class represents a property form user interface.
addItem($a_item)
Add Item (Property, SectionHeader).
static _getRTEClassname()
This class represents a property in a property form.
This class represents an option in a radio group.
This class represents a selection list property in a property form.
special template class to simplify handling of ITX/PEAR
This class represents a text wizard property in a property form.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms @access public
static initDomEvent()
Init YUI DomEvent.
$_POST['username']
Definition: cron.php:12
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
Interface ilGuiAnswerScoringAdjustable.
Interface ilGuiQuestionScoringAdjustable.
$errors