Skip to content

Commit

Permalink
[Conflict Resolver] Multiselect values
Browse files Browse the repository at this point in the history
  • Loading branch information
laemtl committed Dec 17, 2020
1 parent 4a5c1f2 commit 698ae0d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions modules/conflict_resolver/php/conflict_resolver.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,11 @@ 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) {
$row[$value1Index] = str_replace('{@}', ', ', $row[$value1Index]);
$row[$value2Index] = str_replace('{@}', ', ', $row[$value2Index]);
$data[] = $row;
}
return array(
Expand Down
4 changes: 3 additions & 1 deletion modules/conflict_resolver/php/resolved_conflicts.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -252,10 +252,12 @@ 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(
return [
'Headers' => $unanonymized['Headers'],
'Data' => $data,
);
Expand Down

0 comments on commit 698ae0d

Please # to comment.