Skip to content

Commit

Permalink
[Conflict Resolver] Multiselect values (#7239)
Browse files Browse the repository at this point in the history
Change the display of multi select values from "value1{@}value2" to "value1, value2" in the Correct Answer frontend column of Unresolved and Resolved Conflicts. Backend values should remain unchanged.

    Resolves #7217
  • Loading branch information
laemtl authored Dec 22, 2020
1 parent 35a7bd6 commit bd6e68c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
6 changes: 5 additions & 1 deletion modules/conflict_resolver/php/conflict_resolver.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -406,8 +406,12 @@ class Conflict_Resolver extends \NDB_Menu_Filter_Form
$unanonymized = parent::toArray();
$data = array();

$value1Index = array_search('Value1', $unanonymized['Headers']);
$value2Index = array_search('Value2', $unanonymized['Headers']);
foreach ($unanonymized['Data'] as &$row) {
$data[] = $row;
$row[$value1Index] = str_replace('{@}', ', ', $row[$value1Index]);
$row[$value2Index] = str_replace('{@}', ', ', $row[$value2Index]);
$data[] = $row;
}
return array(
'Headers' => $unanonymized['Headers'],
Expand Down
9 changes: 9 additions & 0 deletions modules/conflict_resolver/php/resolved_conflicts.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,16 @@ class Resolved_Conflicts extends \NDB_Menu_Filter
$unanonymized = parent::toArray();
$data = array();

$correctAnswerIndex = array_search(
'Correct Answer',
$unanonymized['Headers']
);
foreach ($unanonymized['Data'] as &$row) {
$row[$correctAnswerIndex] = str_replace(
'{@}',
', ',
$row[$correctAnswerIndex]
);
$data[] = $row;
}
return array(
Expand Down

0 comments on commit bd6e68c

Please # to comment.