Finish code base
This commit is contained in:
@@ -48,7 +48,7 @@ const deleteAnswer = async ({ params, response }) => {
|
||||
const topicId = params.tId;
|
||||
const questionId = params.qId;
|
||||
const optionId = params.oId;
|
||||
await answerService.deleteAnswer(questionId, optionId);
|
||||
await answerService.deleteAnswer(optionId);
|
||||
response.redirect(`/topics/${topicId}/questions/${questionId}`);
|
||||
};
|
||||
|
||||
|
||||
@@ -101,7 +101,6 @@ const storeAnswer = async ({ response, params, state }) => {
|
||||
const correctOptionIds = (
|
||||
await answerService.getCorrectOptionIds(questionId)
|
||||
).map((obj) => obj.id);
|
||||
console.log(correctOptionIds);
|
||||
const correct = correctOptionIds.includes(Number(optionId));
|
||||
await answerService.storeAnswer(userId, questionId, optionId);
|
||||
if (correct) {
|
||||
|
||||
Reference in New Issue
Block a user