Skip to content

Commit

Permalink
Revert name change to ScoringData - we'll do that in one sweep later
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremywiebe committed Nov 19, 2024
1 parent bc50984 commit 3db23fd
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/perseus/src/widgets/expression/score-expression.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,21 @@ import type {
*/
function scoreExpression(
userInput: PerseusExpressionUserInput,
scoringData: PerseusExpressionRubric,
rubric: PerseusExpressionRubric,
strings: PerseusStrings,
locale: string,
): PerseusScore {
const validationResult = validateExpression(
userInput,
scoringData,
rubric,
strings,
locale,
);
if (validationResult) {
return validationResult;
}

const options = _.clone(scoringData);
const options = _.clone(rubric);
_.extend(options, {
decimal_separator: getDecimalSeparator(locale),
});
Expand All @@ -61,7 +61,7 @@ function scoreExpression(
// solution answer, not the student answer, and we don't want a
// solution to work if the student is using a different language
// (different from the content creation language, ie. English).
const expression = KAS.parse(answer.value, scoringData);
const expression = KAS.parse(answer.value, rubric);
// An answer may not be parsed if the expression was defined
// incorrectly. For example if the answer is using a symbol defined
// in the function variables list for the expression.
Expand All @@ -70,7 +70,7 @@ function scoreExpression(
Log.error(
"Unable to parse solution answer for expression",
Errors.InvalidInput,
{loggedMetadata: {rubric: JSON.stringify(scoringData)}},
{loggedMetadata: {rubric: JSON.stringify(rubric)}},
);
return null;
}
Expand Down Expand Up @@ -100,7 +100,7 @@ function scoreExpression(
let matchMessage: string | undefined;
let allEmpty = true;
let firstUngradedResult: Score | undefined;
for (const answerForm of scoringData.answerForms || []) {
for (const answerForm of rubric.answerForms || []) {
const validator = createValidator(answerForm);
if (!validator) {
continue;
Expand Down

0 comments on commit 3db23fd

Please sign in to comment.