mirror of
https://github.com/alexmickelson/canvasManagement.git
synced 2026-03-26 15:48:32 -06:00
can get exact answers
This commit is contained in:
@@ -16,7 +16,7 @@ import {
|
||||
rateLimitAwarePost,
|
||||
} from "./canvasWebRequestUtils";
|
||||
|
||||
export const getAnswers = (
|
||||
export const getAnswersForCanvas = (
|
||||
question: LocalQuizQuestion,
|
||||
settings: LocalCourseSettings
|
||||
) => {
|
||||
@@ -32,6 +32,13 @@ export const getAnswers = (
|
||||
};
|
||||
});
|
||||
|
||||
if (question.questionType === QuestionType.NUMERICAL) {
|
||||
return question.answers.map((answer) => ({
|
||||
numerical_answer_type: answer.numericalAnswerType,
|
||||
exact: answer.numericAnswer,
|
||||
}));
|
||||
}
|
||||
|
||||
return question.answers.map((answer) => ({
|
||||
answer_html: markdownToHTMLSafe({ markdownString: answer.text, settings }),
|
||||
answer_weight: answer.correct ? 100 : 0,
|
||||
@@ -64,7 +71,7 @@ const createQuestionOnly = async (
|
||||
question_type: getQuestionTypeForCanvas(question),
|
||||
points_possible: question.points,
|
||||
position,
|
||||
answers: getAnswers(question, settings),
|
||||
answers: getAnswersForCanvas(question, settings),
|
||||
correct_comments: question.incorrectComments,
|
||||
incorrect_comments: question.incorrectComments,
|
||||
neutral_comments: question.neutralComments,
|
||||
|
||||
Reference in New Issue
Block a user