fix changing question type

This commit is contained in:
Вячеслав 2025-06-10 13:36:18 +05:00
parent 837f90db52
commit e1f7540803
3 changed files with 22 additions and 2 deletions

View file

@ -69,16 +69,22 @@ public static class QuestionMapper
{
Id = questionId,
Title = dto.Title,
Discriminator = "TextQuestion",
AnswerVariants = []
},
"singleanswerquestion" => new SingleAnswerQuestion
{
Id = questionId,
Title = dto.Title,
Discriminator = "SingleAnswerQuestion",
AnswerVariants = []
},
"multipleanswerquestion" => new MultipleAnswerQuestion
{
Id = questionId,
Title = dto.Title,
Discriminator = "MultipleAnswerQuestion",
AnswerVariants = []
},
_ => throw new BadRequestException("Unknown question type")
};