Skip to content

Commit

Permalink
fix: display feedback from editor for scale according to strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
eynimeni committed Jan 23, 2024
1 parent 6c7d9a6 commit a0faf93
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions classes/teststrategy/feedbackgenerator/customscalefeedback.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,15 @@ public function load_data(int $attemptid, array $initialcontext): ?array {
return null;
}

// Make sure that only feedback for specific scale is rendered.
$personabilitiesfeedbackeditor = feedbacksettings::return_scales_according_to_strategy(
$initialcontext['teststrategy'],
(array)$personabilities);

($this->sortfun)($personabilities);

$scalefeedback = [];
foreach ($personabilities as $catscaleid => $personability) {
foreach ($personabilitiesfeedbackeditor as $catscaleid => $personability) {
for ($j = 1; $j <= $quizsettings->numberoffeedbackoptionsselect; $j++) {
$lowerlimitprop = sprintf('feedback_scaleid_limit_lower_%d_%d', $catscaleid, $j);
$lowerlimit = floatval($quizsettings->$lowerlimitprop);
Expand Down Expand Up @@ -206,10 +211,7 @@ public function load_data(int $attemptid, array $initialcontext): ?array {
* @return ?string
*/
private function getfeedbackforrange(int $catscaleid, int $groupnumber, object $quizsettings): ?string {
// TODO: Implement getting the feedback.

// Editor mit key scale und personability schauen.
// Und mit api abgleichen.
$quizsettingskey = 'feedbackeditor_scaleid_' . $catscaleid . '_' . $groupnumber;
return $quizsettings->$quizsettingskey->text;

Expand Down

0 comments on commit a0faf93

Please sign in to comment.