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

fix: if external scored for SCORE then mac score for item should be i… #414

Merged
merged 6 commits into from
Nov 1, 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
30 changes: 15 additions & 15 deletions src/qtiItem/helper/maxScore.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,23 +104,22 @@ export default {
//try setting the computed normal maximum only if the processing type is known, i.e. 'templateDriven'
if (scoreOutcome && item.responseProcessing && item.responseProcessing.processingType === 'templateDriven') {
const interactions = item.getInteractions();
maxScore = _.reduce(
interactions,
function (acc, interaction) {
var interactionMaxScore = interaction.getNormalMaximum();
if (_.isNumber(interactionMaxScore)) {
return gamp.add(acc, interactionMaxScore);
} else {
hasInvalidInteraction = true;
return acc;
}
},
0
);
if (externalScoredValues.includes(scoreOutcome.attr('externalScored'))) {
maxScore = scoreOutcome.attr('normalMaximum') || 0;
maxScore = maxScore + (scoreOutcome.attr('normalMaximum') || 0);
} else {
maxScore = _.reduce(
interactions,
function (acc, interaction) {
var interactionMaxScore = interaction.getNormalMaximum();
if (_.isNumber(interactionMaxScore)) {
return gamp.add(acc, interactionMaxScore);
} else {
hasInvalidInteraction = true;
return acc;
}
},
0
);

if (customOutcomes.size()) {
maxScore = customOutcomes.reduce(function (acc, outcome) {
return gamp.add(acc, parseFloat(outcome.attr('normalMaximum') || 0));
Expand Down Expand Up @@ -160,6 +159,7 @@ export default {
const template = responseHelper.getTemplateNameFromUri(responseDeclaration.template);
return template !== 'NONE';
});

const outcomesWithExternalScored = customOutcomes.filter(outcome => {
return externalScoredValues.includes(outcome.attr('externalScored'));
});
Expand Down
Loading