Skip to content

Commit

Permalink
Merge branch 'release-2.5.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
oat-github-bot committed Nov 1, 2024
2 parents 2b26b6a + 849720a commit 21b4450
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@oat-sa/tao-item-runner-qti",
"version": "2.5.0",
"version": "2.5.1",
"displayName": "TAO Item Runner QTI",
"description": "TAO QTI Item Runner modules",
"files": [
Expand Down
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

0 comments on commit 21b4450

Please sign in to comment.