Skip to content

Commit

Permalink
[conflict_resolver] Replace 'Value 1 & 2' with 'Incorrect Answer'
Browse files Browse the repository at this point in the history
  • Loading branch information
victori444 committed Dec 10, 2024
1 parent 2e4211f commit 0ede23a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 22 deletions.
8 changes: 2 additions & 6 deletions modules/conflict_resolver/jsx/resolved_filterabledatatable.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,8 @@ class ResolvedFilterableDataTable extends Component {
name: 'Description',
type: 'text',
}},
{label: 'Value 1', show: true, filter: {
name: 'Value1',
type: 'text',
}},
{label: 'Value 2', show: true, filter: {
name: 'Value2',
{label: 'Incorrect Answer', show: true, filter: {
name: 'OldValue',
type: 'text',
}},
{label: 'Correct Answer', show: true, filter: {
Expand Down
6 changes: 2 additions & 4 deletions modules/conflict_resolver/php/models/resolveddto.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ class ResolvedDTO implements DataInstance, SiteHaver
protected $instrument;
protected $question;
protected $description;
protected $value1;
protected $value2;
protected $oldValue;
protected $correctanswer;
protected $user1;
protected $user2;
Expand All @@ -72,8 +71,7 @@ class ResolvedDTO implements DataInstance, SiteHaver
'Instrument' => $this->instrument,
'Question' => $this->question,
'Description' => "",
'Value 1' => $this->value1,
'Value 2' => $this->value2,
'Incorrect Answer' => $this->oldValue,
'Correct Answer' => $this->correctanswer,
'User 1' => $this->user1,
'User 2' => $this->user2,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,21 @@ class ResolvedProvisioner extends \LORIS\Data\Provisioners\DBObjectProvisioner
Project.Name as project,
conflicts_resolved.FieldName as question,
CASE
WHEN conflicts_resolved.FieldName <> "Examiner"
THEN conflicts_resolved.OldValue1
ELSE
CONCAT(conflicts_resolved.OldValue1, " - ",
(SELECT full_name FROM examiners WHERE examinerID = conflicts_resolved.OldValue1))
END as value1,
CASE
WHEN conflicts_resolved.FieldName <> "Examiner"
THEN conflicts_resolved.OldValue2
ELSE CONCAT(conflicts_resolved.OldValue2, " - ",
(SELECT full_name FROM examiners WHERE examinerID = conflicts_resolved.OldValue2))
END as value2,
WHEN conflicts_resolved.NewValue <> 1
AND conflicts_resolved.FieldName <> "Examiner"
THEN conflicts_resolved.OldValue1
WHEN conflicts_resolved.NewValue <> 1
AND conflicts_resolved.FieldName = "Examiner"
THEN CONCAT(conflicts_resolved.OldValue1, " - ",
(SELECT full_name FROM examiners
WHERE examinerID = conflicts_resolved.OldValue1))
WHEN conflicts_resolved.NewValue = 1
AND conflicts_resolved.FieldName = "Examiner"
THEN CONCAT(conflicts_resolved.OldValue2, " - ",
(SELECT full_name FROM examiners
WHERE examinerID = conflicts_resolved.OldValue2))
ELSE conflicts_resolved.OldValue2
END AS oldValue,
CASE
WHEN conflicts_resolved.NewValue = 1
AND conflicts_resolved.FieldName <> "Examiner"
Expand Down

0 comments on commit 0ede23a

Please sign in to comment.