Closed kartikeypant closed 8 years ago
if the qno is less than lastquestionallowed and the person answers it correctly then also lastquestionallowed is incremented so in the 2nd if statement if "qno > lastquestionallowed" is replaced by "qno!=lastquestionallowed" it may solve the issue.
You can't show an error message for giving answer to a question which the person has already solved. So, you need to give the condition somewhere else.
You are on track! ☺
But if you replace that statement then if I try to answer a previous question I would get a 403. Not very acceptable right. I should be allowed to answer a previous question. Instead try to put the condition near to where we are actually incrementing lastQuestionAllowed
Regards, Megh Parikh On 02-Jul-2016 16:38, "yash-iiith" notifications@github.com wrote:
if the qno is less than lastquestionallowed and the person answers it correctly then also lastquestionallowed is incremented so in the 2nd if statement if "qno > lastquestionallowed" is replaced by "qno!=lastquestionallowed" it may solve the issue.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/felicity-buzz-2k16/quiz-portal-backend/issues/1#issuecomment-230096597, or mute the thread https://github.com/notifications/unsubscribe/AFs91a2qCJ737z37XmiHhI-SbwbyKYI2ks5qRka8gaJpZM4JC3PY .
if (question.answer == answer) req.user.update({lastQuestionAllowed: lastQuestionAllowed + 1}); in this if condition if we && qno==lastquestionallowed then it will be fine i guess
Yes, you're right!
Yes. Great. Would be awesome if you could fork this repo and commit. Then file a PR
Regards, Megh Parikh On 02-Jul-2016 16:50, "yash-iiith" notifications@github.com wrote:
if (question.answer == answer) req.user.update({lastQuestionAllowed: lastQuestionAllowed + 1}); in this if condition if we && qno==lastquestionallowed then it will be fine i guess
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/felicity-buzz-2k16/quiz-portal-backend/issues/1#issuecomment-230097043, or mute the thread https://github.com/notifications/unsubscribe/AFs91RN40nD6tGkBxhtIrRUONKXvR1FSks5qRkl8gaJpZM4JC3PY .
@kartikey You win again :p
Regards, Megh Parikh On 02-Jul-2016 16:52, "Megh Parikh" meghprkh@gmail.com wrote:
Yes. Great. Would be awesome if you could fork this repo and commit. Then file a PR
Regards, Megh Parikh On 02-Jul-2016 16:50, "yash-iiith" notifications@github.com wrote:
if (question.answer == answer) req.user.update({lastQuestionAllowed: lastQuestionAllowed + 1}); in this if condition if we && qno==lastquestionallowed then it will be fine i guess
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/felicity-buzz-2k16/quiz-portal-backend/issues/1#issuecomment-230097043, or mute the thread https://github.com/notifications/unsubscribe/AFs91RN40nD6tGkBxhtIrRUONKXvR1FSks5qRkl8gaJpZM4JC3PY .
@meghprkh Hahaha.. xD
@yash-iiith Thanks :+1:
If you see, a person can easily win just by giving the correct answer to the first question multiple times. Aren't we missing something?
There must be some problem in this part of the code.
Someone please fix it.