Skip to content

Commit

Permalink
Merge pull request #1202 from jac-uk/feature/1198-unable-to-download-…
Browse files Browse the repository at this point in the history
…critical-analysis-test-result

#1198 Fixed issue of a QT results  download unable to start if candidates skip questions and submit with no answers.
  • Loading branch information
mbrookeswebdev authored Mar 8, 2021
2 parents 5b2b802 + 4d5e7ac commit a0993f3
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,9 @@ export default {
if (response) {
const responseSelection = response.selection;
if (responseSelection) {
if (responseSelection.mostAppropriate !== undefined && responseSelection.leastAppropriate !== undefined) {
if ((responseSelection.mostAppropriate !== undefined && responseSelection.mostAppropriate !== null)
&& (responseSelection.leastAppropriate !== undefined && responseSelection.leastAppropriate !== null))
{
row.push(
question.options[responseSelection.mostAppropriate].answer,
question.options[responseSelection.leastAppropriate].answer,
Expand Down Expand Up @@ -202,7 +204,7 @@ export default {
}
if (responses) {
responses.forEach((response) => {
row.push(response.text === null ? 'Question skipped' : response.text);
row.push(response.text === undefined || response.text === null ? 'Question skipped' : response.text);
});
}
});
Expand All @@ -219,7 +221,7 @@ export default {
}
if (response) {
const responseSelection = response.selection;
if (responseSelection !== undefined) {
if (responseSelection !== undefined && responseSelection !== null) {
row.push(
question.options[response.selection].answer,
response.score
Expand All @@ -236,8 +238,6 @@ export default {
return row;
});
data;
const xlsxData = [
headers,
...data,
Expand Down

0 comments on commit a0993f3

Please sign in to comment.