Freecodecamp: Escaping Literal Quotes challenge test is unclear

Created on 29 May 2016  Â·  9Comments  Â·  Source: freeCodeCamp/freeCodeCamp

Challenge Escaping Literal Quotes in Strings has an issue.
User Agent is: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36.
Please describe how to reproduce this issue, and include links to screenshots if possible.

My code:


var myStr = "(I am a \"double quoted\" string inside \"double quotes\").";




first timers only help wanted

Most helpful comment

@Blazer433 thanks for the issue. Your code doesn't require the parentheses. Looking at that last test, I can see how there can be confusion on what the string should be.

We've had lots of issues on this challenge. Looking back at a previous issue, I think a little edit to a suggestion on changing the test to this will help:

Variable myStr should contain the string: I am a "double quoted" string inside "double quotes".

I changed the wording to "contain" because I think the word "equals" could be interpreted as a coding-kind-of equals (i.e. var myStr EQUALS string;), which may have people copy-pasting that string. I think that should help clear up some confusion.

cc/ @FreeCodeCamp/issue-moderators

All 9 comments

RIght, I would want to dig into this code

Solution should be:
Variable myStr should equal to (I am a "double quoted" string inside "double quotes").

and your solution is:
(I am a "double quoted" string inside "double quotes").

Variable myStr should equal to (I am a "double quoted" string inside "double quotes").

The parentheses in the test message are confusing and ambiguous, though I think they were added recently to clear up confusing ambiguity. Probably no perfect solution here 😄

@Blazer433 thanks for the issue. Your code doesn't require the parentheses. Looking at that last test, I can see how there can be confusion on what the string should be.

We've had lots of issues on this challenge. Looking back at a previous issue, I think a little edit to a suggestion on changing the test to this will help:

Variable myStr should contain the string: I am a "double quoted" string inside "double quotes".

I changed the wording to "contain" because I think the word "equals" could be interpreted as a coding-kind-of equals (i.e. var myStr EQUALS string;), which may have people copy-pasting that string. I think that should help clear up some confusion.

cc/ @FreeCodeCamp/issue-moderators

Anyone wanting to fix this, this line needs to be changed to what is below.

"assert(myStr === \"I am a \\\"double quoted\\\" string inside \\\"double quotes\\\".\", 'message: Variable <code>myStr</code> should contain the string: <code>I am a \"double quoted\" string inside \"double quotes\".</code>');"

This is what it should look like:

image

Please first read the contributing guidelines before taking care of this issue. And feel free to visit the Contributors Help if you have any questions about helping. We're there to help.

Since I haven't see any activity on this thread for almost a week, I decided to take a crack at this. Will be submitting a PR shortly.

What all do you know how to do with coding, if I may ask.

On Sunday, June 5, 2016, Daniel Chung [email protected] wrote:

Since I haven't see any activity on this thread for almost a week, I
decided to take a crack at this. Will be submitting a PR shortly.

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/FreeCodeCamp/FreeCodeCamp/issues/8850#issuecomment-223851704,
or mute the thread
https://github.com/notifications/unsubscribe/ASbzOl0xAzGbwKhnx8UG_eiSTc-7nJK0ks5qI3mOgaJpZM4IpR-_
.

Cadet Hall

@Blazer433 I think it makes sense to keep this issue open for the time being because the pull request hasn't been merged yet (and the issue has not been fully addressed).

@AlenaHall do you mind clarifying what you mean? Thanks!

I managed to solve it after a few tries. turns out there's a full stop at the end of the sentence. And guys make sure you have no spaces in between the backslashes and quotes and your next letter in line

Was this page helpful?
0 / 5 - 0 ratings