Freecodecamp: [beta] Basic JavaScript: Divide one Decimal by Another with JavaScript Test 3 Failing

Created on 17 Feb 2017  路  19Comments  路  Source: freeCodeCamp/freeCodeCamp


Challenge Name

Basic JavaScript: Divide one Decimal by Another with JavaScript

Issue Description

Test 3 (The quotient variable should only be assigned once) is not passing valid code.

Browser Information

  • Browser Name, Version: Chrome 56.0.2924.87 (Official Build) (32-bit)
  • Operating System: Windows 7 Professional, Service Pack 1
  • Mobile, Desktop, or Tablet: Desktop

Your Code


var quotient = 4.4 / 2.0; // Fix this line

Screenshot


capture

bug

Most helpful comment

This bug appears to come up when an incorrect answer is submitted first, then it won't accept the correct answer afterwards. I ran into the same issue with another challenge Basic JavaScript: Escaping Literal Quotes in Strings. In both cases, I reloaded the page, which also reloaded the correct code that had failed the test. After reloading the page, I submitted the code again with no changes, and the test passed.

All 19 comments

This bug appears to come up when an incorrect answer is submitted first, then it won't accept the correct answer afterwards. I ran into the same issue with another challenge Basic JavaScript: Escaping Literal Quotes in Strings. In both cases, I reloaded the page, which also reloaded the correct code that had failed the test. After reloading the page, I submitted the code again with no changes, and the test passed.

@elrolfe thanks for the issue. I'm unfortunately unable to reproduce your issue. I've tested it on Chrome and Firefox.

cc/ @freeCodeCamp/moderators anybody else can reproduce?

I can't reproduce either. @elrolfe Can you share the exact wrong answer you used? Can you also try running the same thing in a different browser?

@systimotic If I recall correctly, the first thing I did on the page was to click "Run Tests" to make sure not all of the tests passed without doing anything. After that, I put in the correct answer and got the error. I tried reproducing the error in Incognito mode, but it worked fine. I also tried IE 11.0.9600.18537, but the page wouldn't load correctly after multiple refreshes and restarts of IE. A screenshot of what happened is below.

capture

I encountered this bug as well, I was finally able to work around it by reloading the browser. Doing a reset on my code did not work. Very strange.

@elrolfe @TheAaronCovington Thanks for testing this out!
IE/Edge not working is a known issue, we're working on it!

@elrolfe If you try this again in the original browser after clearing your cache and resetting your code, does it work?

This challenge was updated recently in https://github.com/freeCodeCamp/freeCodeCamp/commit/927308bc7f126cd725ea8cb47bc022b93e635f2d, so it is possible that there were cache issues.

What confuses me is that 1) these changes are no longer visible in the file on GitHub while I can't find them being removed anywhere, and 2) the message was updated, and the new test was added, so it seems unlikely the JS didn't update. / cc @erictleung

Edit two weeks later: I think 1) was a weird caching issue

@systimotic here is the line of code for this trouble test. Probably has to do with the weird inclusion of the tail code we've kinda touched on here.

had to force the tab just now for this challenge to work, @erictleung good to know a solution is underway 馃憤
Same for the following challenges:
-Escaping Literal Quotes in Strings
-Quoting Strings with Single Quotes
-Word Blanks
-Shopping List
-Write Reusable Javascript With Functions
-Passing Values to Functions with Arguments

Hey,

I also got this error on chrome Version 56.0.2924.87 (64-bit) just now,

After refreshing the page and submitting correct answer first time it worked

Same issue here on chrome 56.0.2924.87. Confirmed that refreshing the page and submitting the correct answer on the first try allows the test to be completed successfully.

If the correct answer is submitted after an incorrect answer, the test will fail on: The quotient variable should only be assigned once.

Just had this happen to me. I had pasted in the correct answer and ran the test then got this error (the 3rd check failing). I reloaded the page and then re-ran the test and it worked.

I had the same issue on Safari.

After a hard refresh of the page, it worked.

It's clear that a lot of people are having this issue. I can't quite figure out what's going on with it.

@erictleung The PR you linked, https://github.com/freeCodeCamp/freeCodeCamp/pull/11987, should've fixed the issues with the inclusion of the tail. The fact that it works after a hard refresh means that it worked, at least to some extent.

@freeCodeCamp/moderators Can anybody help triage? I'm quite lost as to what could be causing this.

Ok, so I just tested this again, and I can confirm something very weird is going on.

@BerkeleyTrue mentioning you here, because I think this is an issue in the challenge framework stuff

Steps to reproduce in Firefox

The issue here seems different, but it may be related

  1. Go to the previous challenge
  2. Complete the challenge and move to the next challenge
  3. Run the challenge

All tests fail, and the console output looks like this:

// running tests
"product is not defined"
"product is not defined"
"product is not defined"
// tests completed

Steps to reproduce in Chrome

Should probably be the same in Safari.

  1. Go to the previous challenge
  2. Complete the challenge and move to the next challenge
  3. Run the challenge with failing code (the last test should be the only one that passes)
  4. Run the challenge with correct code

Only the last test will fail.

Common

For both of these, it's essential that you did the previous challenge before it. If you start on the dividing challenge, it works fine. This is what makes me suspect that something in our code is not cleared out properly.

12762 may be related, but I'm not certain.

@systimotic Nice triage!

This is what makes me suspect that something in our code is not cleared out properly.

I agree.

Happened to me too. I did what @XXiphias recommended in order to submit.

This is still occurring, will only pass if its correct on the first go, otherwise presents issue above (resetting code didnt work, had to refresh page)

I have the same issue. Did not work to "only pass if its correct on the first go" nor resetting code. For me worked if I refreshed the page and my code was reloaded with message "I found same saved work. Loading now."

This is resolved. Please open a new issue if you are still facing the issue.
Happy coding!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vaibsharma picture vaibsharma  路  3Comments

MelissaManning picture MelissaManning  路  3Comments

trashtalka3000 picture trashtalka3000  路  3Comments

raisedadead picture raisedadead  路  3Comments

DaphnisM picture DaphnisM  路  3Comments