add basic versions of retrieving answers by question or completion
This commit is contained in:
parent
637e6c9824
commit
d73e0a104f
7 changed files with 95 additions and 16 deletions
|
|
@ -11,10 +11,9 @@ public static class AnswerVariantMapper
|
|||
Text = dto.Text
|
||||
};
|
||||
|
||||
public static AnswerVariant UpdateDtoToModel(AnswerVariantUpdateDto dto, int questionId, int answerVariantId) =>
|
||||
public static AnswerVariant UpdateDtoToModel(AnswerVariantUpdateDto dto, int answerVariantId) =>
|
||||
new AnswerVariant
|
||||
{
|
||||
QuestionId = questionId,
|
||||
Id = answerVariantId,
|
||||
Text = dto.Text
|
||||
};
|
||||
|
|
|
|||
|
|
@ -69,21 +69,16 @@ public static class QuestionMapper
|
|||
{
|
||||
Id = questionId,
|
||||
Title = dto.Title,
|
||||
SurveyId = 0, // bad logic, need to do something
|
||||
},
|
||||
"singleanswerquestion" => new SingleAnswerQuestion
|
||||
{
|
||||
Id = questionId,
|
||||
Title = dto.Title,
|
||||
SurveyId = 0,
|
||||
AnswerVariants = [],
|
||||
},
|
||||
"multipleanswerquestion" => new MultipleAnswerQuestion
|
||||
{
|
||||
Id = questionId,
|
||||
Title = dto.Title,
|
||||
SurveyId = 0,
|
||||
AnswerVariants = []
|
||||
},
|
||||
_ => throw new BadRequestException("Unknown question type")
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue