adding matching suppiort

This commit is contained in:
2023-12-11 17:58:19 -07:00
parent c9f185dea9
commit 95b913ec05
8 changed files with 206 additions and 38 deletions

View File

@@ -314,6 +314,46 @@ short_answer";
};
var quizMarkdown = quiz.ToMarkdown();
var parsedQuiz = LocalQuiz.ParseMarkdown(quizMarkdown);
parsedQuiz.Should().BeEquivalentTo(quiz);
}
[Test]
public void SerializationIsDeterministic_Matching()
{
var quiz = new LocalQuiz()
{
Name = "Test Quiz",
Description = "quiz description",
LockAt = new DateTime(2022, 10, 3, 12, 5, 0),
DueAt = new DateTime(2022, 10, 3, 12, 5, 0),
ShuffleAnswers = true,
OneQuestionAtATime = true,
LocalAssignmentGroupName = "Assignments",
Questions = new LocalQuizQuestion[]
{
new ()
{
Text = "test matching",
QuestionType = QuestionType.MATCHING,
Points = 1,
Answers = new LocalQuizQuestionAnswer[]
{
new() {
Correct = true,
Text="yes",
MatchedText = "testing yes"
},
new() {
Correct = true,
Text="no",
MatchedText = "testing no"
}
}
}
}
};
var quizMarkdown = quiz.ToMarkdown();
var parsedQuiz = LocalQuiz.ParseMarkdown(quizMarkdown);
parsedQuiz.Should().BeEquivalentTo(quiz);
}