Skip to content

Conversation

@lesamouraipourpre
Copy link

Using increment and decrement in a condition check is dubious, but in this case it will never match a value of one below the correct answer.
Also, correct answers should be immutable.

Using increment and decrement in a condition check is dubious, but in this case it will never match a value of one below the correct answer.
Also, correct answers should be immutable.
@CLAassistant
Copy link

CLAassistant commented Sep 22, 2020

CLA assistant check
All committers have signed the CLA.

if (studentAnswer2 == quizAnswer2) {
points += 25
} else if (studentAnswer2 == quizAnswer2++ || studentAnswer2 == quizAnswer2--) {
} else if (studentAnswer2 == quizAnswer2+1 || studentAnswer2 == quizAnswer2-1) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpicking: I think you should add the space to make it clean
studentAnswer2 == quizAnswer2 + 1 || studentAnswer2 == quizAnswer2 - 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants