diff --git a/src/eq_schema/schema/Block/index.js b/src/eq_schema/schema/Block/index.js index 1d824d5b..e3aa59c0 100644 --- a/src/eq_schema/schema/Block/index.js +++ b/src/eq_schema/schema/Block/index.js @@ -21,6 +21,8 @@ const { DrivingQuestion, } = require("../../block-types/listCollector") +const { getValueSource } = require("../../builders/valueSource") + const pageTypeMappings = { QuestionPage: "Question", InterstitialPage: "Interstitial", @@ -91,7 +93,7 @@ class Block { this.type = "CalculatedSummary"; this.calculation = { calculation_type: "sum", - answers_to_calculate: page.summaryAnswers.map((o) => `answer${o}`), + answers_to_calculate: page.summaryAnswers.map((answerId) => getValueSource(ctx, answerId).identifier), title: processPipe(ctx)(page.totalTitle), }; }