You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm building a simple Quiz app.
I have a command SubmitQuiz. It contains QuizId, QuestionIds paired with SelectedAnswerIds.
I need to save this submission and check whether SelectedAnswers match witch CorrectAnswers
And then I need to return a result (number of correct answers, number of wrong answers, and IDs of correct answers)
My question is - how should it be done? From what I've read - returning anything other than affected entity id from a command is a bad practice?
Should my [POST]SubmitQuiz controller first send a command to save quiz, and then send a query to retrieve result?
Should my client first send a POST with quiz, and then send a GET asking for result? (two network calls instead of one :( )
Where (in code) should the "scoring" of the quiz be done? In SubmitQuizCommandHandler, in DomainEventHandler?
Beta Was this translation helpful? Give feedback.
All reactions