fix changing question type
This commit is contained in:
parent
837f90db52
commit
e1f7540803
3 changed files with 22 additions and 2 deletions
|
|
@ -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")
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue