@media-quest/builder 0.0.28 → 0.0.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/public-api.d.ts +3 -0
- package/dist/public-api.js +13 -2
- package/dist/public-api.js.map +1 -1
- package/package.json +2 -2
- package/src/code-book/codebook.ts +10 -2
- package/src/sum-score/sum-score-variable.spec.ts +308 -308
- package/src/sum-score/sum-score-variable.ts +102 -102
- package/src/sum-score/sum-score.ts +6 -1
package/dist/public-api.d.ts
CHANGED
package/dist/public-api.js
CHANGED
|
@@ -1912,7 +1912,15 @@ var fromPage = (page, sumScoreVariables, pagePosition, modulePrefix) => {
|
|
|
1912
1912
|
return { value: o.value, label: o.label };
|
|
1913
1913
|
});
|
|
1914
1914
|
const varId = modulePrefix + "_" + page.prefix;
|
|
1915
|
-
const
|
|
1915
|
+
const pageIncludedInSumScoresArray = page.includedInSumScores ?? [];
|
|
1916
|
+
const includedInSumScores = [];
|
|
1917
|
+
pageIncludedInSumScoresArray.forEach((p) => {
|
|
1918
|
+
sumScoreVariables.forEach((ssv) => {
|
|
1919
|
+
if (p.sumScoreVariableId === ssv.id) {
|
|
1920
|
+
includedInSumScores.push(ssv);
|
|
1921
|
+
}
|
|
1922
|
+
});
|
|
1923
|
+
});
|
|
1916
1924
|
const variable = {
|
|
1917
1925
|
kind: "codebook-question-variable",
|
|
1918
1926
|
label: page.mainText.text,
|
|
@@ -1922,7 +1930,7 @@ var fromPage = (page, sumScoreVariables, pagePosition, modulePrefix) => {
|
|
|
1922
1930
|
modulePrefix,
|
|
1923
1931
|
pagePosition,
|
|
1924
1932
|
varId,
|
|
1925
|
-
includedInSumScores
|
|
1933
|
+
includedInSumScores
|
|
1926
1934
|
};
|
|
1927
1935
|
variables.push(variable);
|
|
1928
1936
|
return variables;
|
|
@@ -2663,6 +2671,9 @@ var calculate = (sumScoreVariable, basedOnVariables, answers) => {
|
|
|
2663
2671
|
});
|
|
2664
2672
|
const avg = sumScore / includedAnswerCount;
|
|
2665
2673
|
const result = {
|
|
2674
|
+
sumScoreVariableId: sumScoreVariable.id,
|
|
2675
|
+
name: sumScoreVariable.name,
|
|
2676
|
+
description: sumScoreVariable.description,
|
|
2666
2677
|
avg,
|
|
2667
2678
|
useAvg,
|
|
2668
2679
|
includedAnswerCount,
|