19 declare(strict_types=1);
43 bool $is_user_output =
true 62 $question_results = [];
73 $graphical_output =
false;
74 $result_output =
false;
76 $show_feedback =
false;
77 $show_correct_solution =
false;
78 $show_manual_scoring =
false;
79 $show_question_text =
true;
80 $show_inline_feedback =
true;
82 foreach (
$results as $idx => $qresult) {
83 if (!is_numeric($idx)) {
87 $qid = $qresult[
'qid'];
88 $type = $qresult[
'type'];
89 $title = $qresult[
'title'];
90 $question_score = $qresult[
'max'];
91 $usr_score = $qresult[
'reached'];
92 $workedthrough = (bool) $qresult[
'workedthrough'];
93 $answered = (bool) $qresult[
'answered'];
94 $requested_hints = (
int) $qresult[
'requested_hints'];
98 $shuffle_trafo = $this->shuffler->getAnswerShuffleFor($qid, $active_id, $pass_id);
99 $question_gui->object->setShuffler($shuffle_trafo);
101 $graphical_output =
true;
102 $show_correct_solution =
false;
104 $usr_solution = $question_gui->getSolutionOutput(
111 $show_correct_solution,
112 $show_manual_scoring,
114 $show_inline_feedback
117 $autosave_output = null;
118 $show_autosave_title =
false;
120 $autosave_output = $question_gui->getAutoSavedSolutionOutput(
127 $show_correct_solution,
128 $show_manual_scoring,
130 $show_autosave_title,
131 $show_inline_feedback
135 $graphical_output =
false;
136 $show_correct_solution =
true;
137 $show_feedback =
false;
138 $show_inline_feedback =
false;
139 $best_solution = $question_gui->getSolutionOutput(
146 $show_correct_solution,
147 $show_manual_scoring,
149 $show_inline_feedback
152 if ($show_question_only) {
153 $usr_solution = $this->ui_renderer->render($this->ui_factory->legacy(
'<div class="ilc_question_Standard">' . $usr_solution .
'</div>'));
154 $best_solution = $this->ui_renderer->render($this->ui_factory->legacy(
'<div class="ilc_question_Standard">' . $best_solution .
'</div>'));
157 $feedback = $question_gui->getGenericFeedbackOutput($active_id, $pass_id);
159 $recapitulation = null;
161 $recapitulation = $question_gui->object->getSuggestedSolutionOutput();
195 $settings_summary =
$settings->getResultSummarySettings();
196 $settings_result =
$settings->getResultDetailsSettings();
198 $show_hidden_questions =
false;
199 $show_optional_questions =
true;
200 $show_best_solution = $is_user_output ?
201 $settings_result->getShowSolutionListComparison() :
203 $show_feedback = $settings_result->getShowSolutionFeedback();
204 $show_question_text_only = $settings_result->getShowSolutionAnswersOnly();
205 $show_content_for_recapitulation = $settings_result->getShowSolutionSuggested();
208 $show_hidden_questions,
209 $show_optional_questions,
212 $show_question_text_only,
213 $show_content_for_recapitulation
static get(string $a_var)
& getTestResult(int $active_id, ?int $pass=null, bool $ordered_sequence=false, bool $considerHiddenQuestions=true, bool $considerOptionalQuestions=true)
Calculates the results of a test for a given user and returns an array with all test results...
createQuestionGUI($question_type, $question_id=-1)
Creates a question GUI instance of a given question type.
getPassResultsFor(ilObjTest $test_obj, int $active_id, int $pass_id, bool $is_user_output=true)
__construct(protected ilTestShuffler $shuffler, protected UIFactory $ui_factory, protected UIRenderer $ui_renderer)
getShowOptionalQuestions()
buildPassResults(ilTestPassResultsSettings $settings, ilObjTest $test_obj, int $active_id, int $pass_id, bool $is_user_output)
getPassResultsSettings(ilObjTest $test_obj, bool $is_user_output)