24 include_once
"./Modules/Test/classes/inc.AssessmentConstants.php";
25 include_once
"./Modules/Test/classes/class.ilTestServiceGUI.php";
51 $this->ctrl->saveParameter($this,
"active_id");
52 $this->ctrl->saveParameter($this,
"userfilter");
53 $this->ctrl->saveParameter($this,
"pass");
61 $cmd = $this->ctrl->getCmd();
62 $next_class = $this->ctrl->getNextClass($this);
64 if (strlen(
$cmd) == 0)
66 $this->ctrl->redirect($this,
"scoreQuestion");
86 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
87 include_once
"./Modules/Test/classes/class.ilTestNewScoring.php";
90 array_push($qtypes,
"assClozeTest",
"assMultipleChoice",
"assNumeric",
"assTextSubset",
"assSingleChoice",
"assMatchingQuestion",
"assOrderingQuestion",
"assOrderingHorizontal");
92 $questionId =
$_POST[
"id"];
96 $testquestions =& $this->
object->getTestQuestions();
98 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_stat_questions.html",
"Modules/Test/newscoring");
100 foreach ($testquestions as $question)
102 $obj_scoring->loadTempTable($question[
"question_id"]);
104 if (in_array($qtype, $qtypes))
106 $output .= $this->
getQuestionStat($question[
"question_id"], FALSE, $qnum++);
109 $this->tpl->setVariable(
"QUESTION_EXPORT", $output);
115 if (
$_GET[
"sync"] ==
"yes")
116 ilUtil::sendInfo(
"Die Frage wurde im Test und im Fragenpool gespeichert und alle Testteilnehmer wurden neu bewertet.");
117 elseif (
$_GET[
"sync"] ==
"no")
118 ilUtil::sendInfo(
"Die Frage wurde im Test gespeichert und alle Testteilnehmer wurden neu bewertet.");
126 $obj_scoring->saveQuestionAndUserResults(
$_POST);
127 $question = $this->
object->createQuestionGUI(
"",
$_POST[
"id"]);
129 if ($qtype ==
"assOrderingQuestion")
131 $save_qst = $obj_scoring->saveOrderingItemPoints(
$_POST);
133 $originalexists = $question->object->_questionExists($question->object->original_id);
136 if (($qtype ==
"assOrderingQuestion") && !$save_qst)
142 $this->ctrl->setParameter($this,
"q_id",
$_POST[
"id"]);
143 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_qpl_sync_original.html",
"Modules/TestQuestionPool");
144 $this->tpl->setCurrentBlock(
"adm_content");
145 $this->tpl->setVariable(
"BUTTON_YES", $this->lng->txt(
"yes"));
146 $this->tpl->setVariable(
"BUTTON_NO", $this->lng->txt(
"no"));
147 $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this));
148 $this->tpl->setVariable(
"TEXT_SYNC", $this->lng->txt(
"confirm_sync_questions"));
149 $this->tpl->parseCurrentBlock();
154 ilUtil::sendInfo(
"Die Frage wurde im Test gespeichert und alle Testteilnehmer wurden neu bewertet.");
156 $this->ctrl->setParameter($this,
"q_id", $qid);
157 $this->ctrl->setParameter($this,
"command",
"list");
161 $question = $this->
object->createQuestionGUI(
"",
$_POST[
"id"]);
166 $checkb =
$_POST[
"chb_add"];
168 $hint = $this->lng->txt(
"regrading_new_answers_hint");
174 $checkb =
$_POST[
"chb_del"];
176 $checkb =
$_POST[
"chb_del_subset"];
178 $hint =
"Um die Punkte zu aktualisieren, druecken Sie auf Frage und Punkte speichern.";
183 foreach($par as $key => $value)
185 if ($checkb[$key] ==
"on")
187 if (preg_match(
"/(\d+)_(\d+)_(\d+)/", $value, $matches))
191 if (preg_match(
"/(\d+)_(\d+)_(\d+)/", $value, $matches))
192 $gap_id = $matches[1];
193 $order = $matches[2];
194 $solutionId = $matches[3];
196 $answer_item = $obj_scoring->addQuestionAnswer($solutionId, $qtype);
197 if ($qtype ==
"assClozeTest")
199 include_once
"./Modules/TestQuestionPool/classes/class.assAnswerCloze.php";
201 $question->object->gaps[$gap_id]->addItem($answer);
203 if ($qtype ==
"assTextSubset")
205 $order = $matches[2] + $cnt;
206 $question->object->addAnswer($answer_item, 0, $order);
211 if (preg_match(
"/(\d+)_(\d+)/", $value, $matches))
212 $gap_id = $matches[1];
213 $order = $matches[2];
215 if ($qtype ==
"assClozeTest")
217 $question->object->gaps[$gap_id]->deleteItem($order);
219 if ($qtype ==
"assTextSubset")
221 $order = $order - $cnt;
222 $question->object->deleteAnswer($order);
228 $question->object->saveToDb();
230 $this->ctrl->setParameter($this,
"q_id",
$_POST[
"id"]);
231 $this->ctrl->setParameter($this,
"command",
"list");
232 $this->ctrl->setParameter($this,
"warn", $hint);
233 $this->ctrl->redirect($this,
"scoreQuestion");
235 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_newscoring_question.html",
"Modules/Test/newscoring");
237 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getLinkTarget($this,
"scoreQuestion"));
239 $this->tpl->setVariable(
"WARNING",
$_GET[
"warn"]);
245 if ($this->object->isRandomTest())
247 $this->tpl->setCurrentBlock(
"qlist");
248 $this->tpl->setVariable(
"HINT", $this->lng->txt(
"regrading_random"));
249 $this->tpl->ParseCurrentBlock();
252 $data =& $this->
object->getCompleteEvaluationData(FALSE);
253 if (count(
$data->getParticipants()) == 0)
258 $this->tpl->setCurrentBlock(
"qlist");
259 $this->tpl->setVariable(
"HINT",
"<em>" . $this->lng->txt(
"regrading_hint") .
"</em>");
260 $this->tpl->setVariable(
"HEADING", $this->lng->txt(
"regrading_list_of_questions"));
261 $this->tpl->setVariable(
"TXT_NUMBER", $this->lng->txt(
"regrading_number"));
262 $this->tpl->setVariable(
"TXT_QUESTION_TITLE", $this->lng->txt(
"regrading_question_title"));
263 $this->tpl->setVariable(
"TXT_QUESTION_TYPE", $this->lng->txt(
"regrading_question_type"));
264 $this->tpl->setVariable(
"TXT_SHOW_QUESTION_STATS", $this->lng->txt(
"regrading_show_question_stats"));
265 $testquestions =& $this->
object->getTestQuestions();
267 foreach ($testquestions as $quest)
269 $questionId = $quest[
"question_id"];
271 if (in_array($qtype, $qtypes))
273 $questionTitle = $quest[
"title"];
274 $question = $this->
object->createQuestionGUI(
"", $questionId);
275 $this->tpl->setCurrentBlock(
"question");
276 $this->tpl->setVariable(
"QNUM", $qnum++);
277 $this->tpl->setVariable(
"TITLE", $questionTitle);
278 $href= $this->ctrl->getLinkTarget($this,
"scoreQuestion").
"&command=list&q_id=".$questionId;
279 $this->tpl->setVariable(
"HREF",$href);
280 $this->tpl->setVariable(
"QTYPE",$this->lng->txt($qtype));
281 $this->tpl->ParseCurrentBlock();
284 $this->tpl->ParseCurrentBlock();
288 $q_id =
$_GET[
"q_id"] ?
$_GET[
"q_id"] : $questionId;
289 $obj_scoring->loadTempTable($q_id);
292 if ($qtype ==
"assOrderingQuestion")
296 $mess = $this->lng->txt(
"regrading_maxpoints_error");
300 $itemPoints = $obj_scoring->loadOrderingItemPoints($q_id);
303 $mess = $this->lng->txt(
"regrading_newstyle_help");
307 $mess = $this->lng->txt(
"regrading_oldstyle_help");
313 $this->tpl->setVariable(
"QUESTION",
$out);
325 global $ilUser,
$ilDB;
327 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
328 include_once
"./Modules/Test/classes/class.ilTestNewScoring.php";
335 $question = $this->
object->createQuestionGUI(
"", $questionId);
337 $qText = $question->getSolutionOutput(
"", NULL, FALSE, TRUE, FALSE);
338 $qText = preg_replace(
"/<pre>/",
"", $qText);
339 $qText = preg_replace(
"/<\/pre>/",
"", $qText);
341 $template =
new ilTemplate(
"tpl.il_as_tst_stat_question.html", TRUE, TRUE,
"Modules/Test/newscoring");
346 $title = $qnum. $question->object->getTitle().
" - ". $this->lng->txt($qtype);
348 $template->setCurrentBlock(
"qtable");
349 $template->setVariable(
"QUESTION_HEADING",
$title);
350 $template->setVariable(
"TXT_QUESTION_PREVIEW", $this->lng->txt(
"regrading_question_preview"));
351 $template->setVariable(
"TXT_CORRECT_ANSWERS_AND_POINTS", $this->lng->txt(
"regrading_correct_answers_and_points"));
352 $template->setVariable(
"TXT_STATS_USER_ANSWERS", $this->lng->txt(
"regrading_stats_user_answers"));
353 $template->setVariable(
"QUESTION_TEXT", $qText);
354 $template->setVariable(
"QUESTION_ID", $questionId);
358 $template->setCurrentBlock(
"identical_scoring");
359 $identical_scoring = $question->object->getIdenticalScoring();
360 if ($identical_scoring) $template->setVariable(
"CHECKED_IDENT_SCORING",
" checked=\"checked\"");
361 $template->setVariable(
"TEXT_IDENT_SCORING", $this->lng->txt(
"identical_scoring"));
365 $textgap_options = array(
366 array(
"ci", $this->lng->txt(
"cloze_textgap_case_insensitive")),
367 array(
"cs", $this->lng->txt(
"cloze_textgap_case_sensitive")),
368 array(
"l1", sprintf($this->lng->txt(
"cloze_textgap_levenshtein_of"),
"1")),
369 array(
"l2", sprintf($this->lng->txt(
"cloze_textgap_levenshtein_of"),
"2")),
370 array(
"l3", sprintf($this->lng->txt(
"cloze_textgap_levenshtein_of"),
"3")),
371 array(
"l4", sprintf($this->lng->txt(
"cloze_textgap_levenshtein_of"),
"4")),
372 array(
"l5", sprintf($this->lng->txt(
"cloze_textgap_levenshtein_of"),
"5"))
374 $textgap_rating = $question->object->getTextgapRating();
375 $template->setVariable(
"TEXTGAP_RATING",
"Text-Bewertung");
376 foreach ($textgap_options as $textgap_option)
378 $template->setCurrentBlock(
"textgap_rating");
379 $template->setVariable(
"TEXTGAP_VALUE", $textgap_option[0]);
380 $template->setVariable(
"TEXTGAP_TEXT", $textgap_option[1]);
381 if (strcmp($textgap_rating, $textgap_option[0]) == 0)
383 $template->setVariable(
"SELECTED_TEXTGAP_VALUE",
" selected=\"selected\"");
385 $template->parseCurrentBlock();
387 $template->ParseCurrentBlock();
388 $gapTextArray=array();
389 $clozeText = $question->object->getClozeText();
390 $gapTextArray = split (
"/gap", $clozeText);
394 foreach ($question->object->gaps as $gap_id => $value)
397 $gap_text = strstr($gapTextArray[$gap_id],
"[gap]");
398 while(
$pos = strpos($gap_text,
","))
401 $gap_text = strstr(
",", $gap_text);
403 $answerarray = array();
404 for ($order = 0; $order < $question->object->gaps[$gap_id]->getItemCount(); $order++)
408 $answer = $question->object->gaps[$gap_id]->getItem($order);
412 if ($question->object->gaps[$gap_id]->getType() ==
CLOZE_NUMERIC)
414 $template->setCurrentBlock(
"correct_ranges");
415 $template->setVariable(
"LOWNAME",$gap_id.
"_1");
416 $template->setVariable(
"UPPERNAME", $gap_id.
"_2");
417 $template->setVariable(
"TEXT_RANGE_LOWER_LIMIT", ($gap_id+1).
".2. ".$this->lng->txt(
"range_lower_limit"));
418 $template->setVariable(
"VALUE_LOWER_LIMIT",
" value=\"" . $answer->getLowerBound() .
"\"");
419 $template->setVariable(
"TEXT_RANGE_UPPER_LIMIT", ($gap_id+1).
".3. ".$this->lng->txt(
"range_upper_limit"));
420 $template->setVariable(
"VALUE_UPPER_LIMIT",
" value=\"" . $answer->getUpperBound() .
"\"");
421 $template->setVariable(
"VALUENAME", $gap_id.
"_3");
422 $template->setVariable(
"TEXT_VALUE", ($gap_id+1).
".1. ".$this->lng->txt(
"value"));
423 $template->setVariable(
"VALUE_VALUE",
" value=\"" . $answer->getAnswertext() .
"\"");
424 $template->setVariable(
"POINTNAME",$gap_id.
"_0");
425 $template->setVariable(
"TEXT_POINTS", ($gap_id+1).
".4. ". $this->lng->txt(
"points"));
426 $template->setVariable(
"VALUE_POINTS",
"\"".
" value=\"" . $answer->getPoints() .
"\"");
427 $template->parseCurrentBlock();
431 $template->setCurrentBlock(
"correct_cloze");
432 $template->setVariable(
"CORRECT_ANSWER", ($gap_id+1).
".". ($order+1).
".". $answer->getAnswertext());
433 $template->setVariable(
"POINTS", $answer->getPoints());
434 $template->setVariable(
"FIELDNAME", $gap_id.
"_".$order);
435 if (($question->object->gaps[$gap_id]->getType() ==
CLOZE_TEXT) && ($order > $origItemCount))
437 $template->setVariable(
"PARAMS", ($gap_id.
"_".$order));
438 $template->setVariable(
"DELETE",
"0");
439 $template->setVariable(
"COUNTER", $cnt1++);
442 $template->ParseCurrentBlock();
443 array_push($answerarray, $answer->getAnswertext().
"_".$answer->getPoints());
450 foreach ($values as $value2)
452 $template->setCurrentBlock(
"answer_stat");
455 $template->setVariable(
"STUD", ($gap_id+1).
". (". $stat[
"count"].
") ". $userans);
456 $solutionId = $stat[
"val"];
460 if ($question->object->gaps[$gap_id]->getType() ==
CLOZE_SELECT)
462 for ($order = 0; $order < $question->object->gaps[$gap_id]->getItemCount(); $order++)
464 $answer = $question->object->gaps[$gap_id]->getItem($order);
465 if ($answer->getOrder() == $userans)
467 $userans_val = $answer->getAnswertext();
468 $template->setVariable(
"STUD", ($gap_id+1).
".". ($order+1).
". (". $stat[
"count"].
") ". $userans_val);
474 if ($userans AND ($question->object->gaps[$gap_id]->getType() ==
CLOZE_TEXT))
478 $OK = $obj_scoring->checkLevenstein($question, $answerarray, $userans);
481 $maxItem = $question->object->gaps[$gap_id]->getItemCount();
482 $template->setVariable(
"PARAMS", ($gap_id.
"_".$maxItem.
"_".$solutionId));
483 $template->setVariable(
"ADD",
"0");
484 $template->setVariable(
"COUNTER", $cnt2++);
488 $template->ParseCurrentBlock();
494 case "assMatchingQuestion":
496 foreach ($question->object->matchingpairs as $key => $value)
498 $template->setCurrentBlock(
"correct_matching");
499 $question->object->loadFromDb($questionId);
500 $matching_obj = $question->object->matchingpairs[$key];
501 $template->setVariable(
"ORDER", $order);
502 $template->setVariable(
"POINTS", $matching_obj->__get(
"points"));
504 $definition = $matching_obj->__get(
"definition");
505 $term = $matching_obj->__get(
"term");
507 if (strlen($definition->text))
509 $template->setVariable(
"DEFINITION", $definition->text);
511 elseif (strlen($definition->picture))
513 $def_thumb = $question->object->getImagePathWeb(). $question->object->getThumbPrefix() . $definition->picture;
514 $template->setVariable(
"DEFINITION",
"<img src=\"$def_thumb\" />");
516 if (strlen($term->text))
518 $template->setVariable(
"TERM", $term->text);
520 elseif (strlen($term->picture))
522 $term_thumb = $question->object->getImagePathWeb(). $question->object->getThumbPrefix() . $term->picture;
523 $template->setVariable(
"TERM",
"<img src=\"$term_thumb\" />");
525 $template->setVariable(
"TERMID",
"0_". $term->identifier);
526 $template->ParseCurrentBlock();
530 if (strlen($definition->text))
532 $def = $definition->text;
534 elseif (strlen($definition->picture))
536 $def = $definition->picture;
538 $temp = $obj_scoring->getSolutionStat($questionId, $def);
540 foreach ($temp as $val1)
549 $stat = $obj_scoring->getUserAnswers($questionId, $val1, $value2);
550 $template->setCurrentBlock(
"answer_stat");
551 if (!strlen($definition->text) && strlen($definition->picture))
553 $def =
"<img src=\"$def_thumb\" />";
555 if (strlen($term->text))
557 $terms = $stat[
"val"];
559 elseif (strlen($term->picture))
561 $terms =
"<img src=\"$term_thumb\" />";
565 $template->setVariable(
"STUD", $order.
".". $order2.
". (". $stat[
"count"].
") ". $def.
"-". $terms);
567 $template->ParseCurrentBlock();
575 case "assOrderingQuestion":
576 case "assOrderingHorizontal":
580 $template->setCurrentBlock(
"correct_ordering");
582 $itemPoints = $obj_scoring->loadOrderingItemPoints($questionId);
583 if ($qtype ==
"assOrderingHorizontal")
585 $template->setVariable(
"CORRECT_HORIZONTAL", $question->object->getOrderText());
588 foreach ($question->object->answers as $idx => $answer)
590 $template->setCurrentBlock(
"correct_ordering_row");
591 if ($question->object->getOrderingType() ==
OQ_PICTURES)
593 $filename =
"thumb.".$answer->getAnswertext();
594 $imagepath = $question->object->getImagePathWeb() .$filename;
595 $template->setVariable(
"CORRECT_ANSWER",
"<img src=\"$imagepath\" />");
599 $template->setVariable(
"CORRECT_ANSWER", $answer->getAnswertext());
601 $template->setVariable(
"POSITION", ($idx+1));
602 $template->setVariable(
"POINTS_TEXTNAME",
"0_". ($idx+1));
603 if (count($itemPoints))
605 $template->setVariable(
"POINTS_VALUE", $itemPoints[$idx]);
607 $template->ParseCurrentBlock();
609 $template->setCurrentBlock(
"max_points");
610 $maxpoints = $question->object->getMaximumPoints();
611 $template->setVariable(
"POINTS_TEXTNAME", (
"0_0"));
612 $template->setVariable(
"MAX_POINTS", $maxpoints);
613 $template->ParseCurrentBlock();
615 if ($qtype ==
"assOrderingQuestion")
617 foreach ($question->object->answers as $idx => $answer)
622 $temp = $obj_scoring->getSolutionStat($questionId, $value1);
623 $template->setCurrentBlock(
"answer_stat");
625 foreach ($temp as $val2)
627 $stat = $obj_scoring->getUserAnswers($questionId, $value1, $val2);
628 $template->setCurrentBlock(
"answer_stat");
629 if ($question->object->getOrderingType() ==
OQ_PICTURES)
631 $filename =
"thumb.".$answer->getAnswertext();
632 $imagepath = $question->object->getImagePathWeb().
$filename;
633 $template->setVariable(
"STUD", ($value1+1).
". (". $stat[
"count"].
") ". $val2.
" - ".
"<img src=\"$imagepath\" />");
637 $template->setVariable(
"STUD", ($value1+1).
". (". $stat[
"count"].
") ". $val2.
" - ". $answer->getAnswertext());
639 $template->ParseCurrentBlock();
645 $temp = $obj_scoring->getSolutionStat($questionId);
646 $template->setCurrentBlock(
"answer_stat");
647 $template->ParseCurrentBlock();
649 foreach ($temp as $val2)
651 $stat = $obj_scoring->getUserAnswers($questionId, 0, $val2);
652 $template->setCurrentBlock(
"answer_stat");
653 $val = preg_replace(
'/{::}/',
' ', $val2);
654 $template->setVariable(
"STUD", $cnt++.
". (". $stat[
"count"].
") ". $val);
655 $template->ParseCurrentBlock();
660 case "assMultipleChoice":
661 case "assSingleChoice":
665 foreach ($question->object->answers as $answer)
667 if ($qtype ==
"assMultipleChoice")
669 $template->setCurrentBlock(
"correct_mult");
670 $template->setVariable(
"POINTS-UNCHECKED", $answer->getPointsUnchecked());
671 $template->setVariable(
"FIELDNAME_U",
"1_".$answer->getOrder());
675 $template->setCurrentBlock(
"correct_single");
677 $template->setVariable(
"CORRECT_ANSWER", ($answer->getOrder()+1).
". ". $answer->getAnswertext());
678 $template->setVariable(
"POINTS", $answer->getPoints());
679 $template->setVariable(
"FIELDNAME",
"0_".$answer->getOrder());
680 $template->ParseCurrentBlock();
684 $value1 = $answer->getOrder();
685 $temp = $obj_scoring->getSolutionStat($questionId, $value1);
686 $template->setCurrentBlock(
"answer_stat");
687 $template->setVariable(
"STUD", ($value1+1).
". (". count($temp).
") ". $answer->getAnswertext());
688 $template->ParseCurrentBlock();
696 $template->setCurrentBlock(
"correct_ranges");
697 $template->setVariable(
"TEXT_POINTS", $this->lng->txt(
"points"));
698 $template->setVariable(
"VALUE_POINTS",
"\"".
" value=\"" . $question->object->getPoints() .
"\"");
699 $template->setVariable(
"POINTNAME",
"0_0");
700 $template->setVariable(
"LOWNAME",
"1_0");
701 $template->setVariable(
"UPPERNAME",
"2_0");
702 $template->setVariable(
"TEXT_RANGE_LOWER_LIMIT", $this->lng->txt(
"range_lower_limit"));
703 $template->setVariable(
"VALUE_LOWER_LIMIT",
" value=\"" . $question->object->getLowerLimit() .
"\"");
704 $template->setVariable(
"TEXT_RANGE_UPPER_LIMIT", $this->lng->txt(
"range_upper_limit"));
705 $template->setVariable(
"VALUE_UPPER_LIMIT",
" value=\"" . $question->object->getUpperLimit() .
"\"");
706 $template->parseCurrentBlock();
710 $temp = $obj_scoring->getSolutionStat($questionId);
712 foreach ($temp as $value1)
714 $stat = $obj_scoring->getUserAnswers($questionId, $value1);
715 $template->setCurrentBlock(
"answer_stat");
716 $template->setVariable(
"STUD", $counter++.
". (". $stat[
"count"].
") ". $value1);
717 $template->ParseCurrentBlock();
721 case "assTextSubset":
726 if (!$question->object->allanswers)
728 $question->object->setAllAnswers(count($question->object->answers));
729 $question->object->saveToDb();
732 foreach ($question->object->answers as $answer)
734 $template->setCurrentBlock(
"correct_subset");
735 $template->setVariable(
"CORRECT_ANSWER", ($answer->getOrder()+1).
". ". $answer->getAnswertext());
736 $template->setVariable(
"POINTS", $answer->getPoints());
737 $template->setVariable(
"FIELDNAME",
"0_".$answer->getOrder());
738 if (($answer->getOrder()+1) > $question->object->allanswers)
740 $template->setVariable(
"PARAMS", (
"0_".$answer->getOrder()));
741 $template->setVariable(
"DELETE",
"0");
742 $template->setVariable(
"COUNTER", $cnt++);
744 $template->ParseCurrentBlock();
749 $text_options = array(
750 array(
"ci", $this->lng->txt(
"cloze_textgap_case_insensitive")),
751 array(
"cs", $this->lng->txt(
"cloze_textgap_case_sensitive")),
752 array(
"l1", sprintf($this->lng->txt(
"cloze_textgap_levenshtein_of"),
"1")),
753 array(
"l2", sprintf($this->lng->txt(
"cloze_textgap_levenshtein_of"),
"2")),
754 array(
"l3", sprintf($this->lng->txt(
"cloze_textgap_levenshtein_of"),
"3")),
755 array(
"l4", sprintf($this->lng->txt(
"cloze_textgap_levenshtein_of"),
"4")),
756 array(
"l5", sprintf($this->lng->txt(
"cloze_textgap_levenshtein_of"),
"5"))
758 $text_rating = $question->object->getTextRating();
759 foreach ($text_options as $text_option)
761 $template->setCurrentBlock(
"text_rating");
762 $template->setVariable(
"TEXT_VALUE", $text_option[0]);
763 $template->setVariable(
"TEXT_TEXT", $text_option[1]);
764 if (strcmp($text_rating, $text_option[0]) == 0)
766 $template->setVariable(
"SELECTED_TEXT_VALUE",
" selected=\"selected\"");
768 $template->parseCurrentBlock();
773 $temp = $obj_scoring->getSolutionStat($questionId);
775 foreach ($temp as $value1)
779 $stat = $obj_scoring->getUserAnswers($questionId, $value1);
783 $template->setCurrentBlock(
"answer_stat");
784 $available_answers =& $question->object->getAvailableAnswers();
785 $index = $question->object->isAnswerCorrect($available_answers, $value1);
786 if ($index !== FALSE)
788 $template->setVariable(
"STUD", ($index+1).
". (". $stat[
"count"].
") ". $value1);
792 $template->setVariable(
"STUD",
"0. (". $stat[
"count"].
") ". $value1);
793 $template->setVariable(
"PARAMS", (
"0_". $question->object->getAnswerCount().
"_".$stat[
"val"]));
794 $template->setVariable(
"ADD",
"0");
795 $template->setVariable(
"COUNTER", $cnt++);
797 $template->ParseCurrentBlock();
803 $template->ParseCurrentBlock();
806 $template->setVariable(
"SAVEPOINTS", $this->lng->txt(
"regrading_save"));
807 if ($textgap || ($qtype ==
"assTextSubset"))
809 $template->setVariable(
"COLSPAN", 1);
810 $template->setVariable(
"DEL_ANSWER", $this->lng->txt(
"regrading_remove_answer"));
811 $template->setVariable(
"ADD_ANSWER", $this->lng->txt(
"regrading_add_answer"));
815 $template->setVariable(
"COLSPAN", 3);
818 return $template->get();
827 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
829 $question = $this->
object->createQuestionGUI(
"",
$_GET[
"q_id"]);
830 $original_id = $question->object->original_id;
833 $question->object->syncWithOriginal();
835 if ($qtype ==
"assClozeTest")
837 $orig_question = $this->
object->createQuestionGUI(
"", $original_id);
838 $orig_question->object->updateClozeTextFromGaps();
839 $orig_question->object->saveToDb();
842 $this->ctrl->setParameter($this,
"q_id",
$_GET[
"q_id"]);
843 $this->ctrl->setParameter($this,
"sync",
"yes");
844 $this->ctrl->redirect($this,
"scoreQuestion");
853 $this->ctrl->setParameter($this,
"q_id",
$_GET[
"q_id"]);
854 $this->ctrl->setParameter($this,
"sync",
"no");
855 $this->ctrl->redirect($this,
"scoreQuestion");