Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[score_instrument] use getInstanceData to get the instrument data #9263

Merged
merged 2 commits into from
May 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 6 additions & 10 deletions tools/data_integrity/score_instrument.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,14 @@
}

// check that the $test_name is a valid instrument
$qparams = [];
if ($test_name== 'all') {
$query = "SELECT Test_name FROM test_names";
} else {
$query = "SELECT Test_name FROM test_names WHERE Test_name = :tnm";
$query = "SELECT Test_name FROM test_names WHERE Test_name = :tnm";
$qparams['tnm'] = $test_name;
}
$testNames = $DB->pselect($query, ['tnm' => $test_name]);
$testNames = $DB->pselect($query, $qparams);

// if nothing is returned than the instrument DNE
if (!is_array($testNames) || count($testNames)==0) {
Expand Down Expand Up @@ -213,15 +215,9 @@
);

// call the score function
$oldRecord = $DB->pselectRow(
"SELECT * FROM $instrumentTable WHERE CommentID=:cid",
['cid' => $record['CommentID']]
);
$oldRecord = $instrument->getInstanceData();
$success = $instrument->score();
$newRecord = $DB->pselectRow(
"SELECT * FROM $instrumentTable WHERE CommentID=:cid",
['cid' => $record['CommentID']]
);
$newRecord = $instrument->getInstanceData();
unset($oldRecord['Testdate']);
unset($newRecord['Testdate']);
$diff = array_diff_assoc($oldRecord, $newRecord);
Expand Down
Loading