Skip to content

Update Quiz.kt#5

Open
lesamouraipourpre wants to merge 1 commit into
Codecademy:mainfrom
lesamouraipourpre:patch-1
Open

Update Quiz.kt#5
lesamouraipourpre wants to merge 1 commit into
Codecademy:mainfrom
lesamouraipourpre:patch-1

Conversation

@lesamouraipourpre

Copy link
Copy Markdown

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

CLAassistant commented Sep 22, 2020

Copy link
Copy Markdown

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
Copy Markdown

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