jiebi/CodeConvo huggingface dataset:
Code change:
const getMultiple = await $.get(url + '?created_by=Alice&assigned_to=Bob'); assert.isArray(getMultiple); assert.lengthOf(getMultiple, 2); <ins> const copyId = getMultiple[0]._id; const getById = await $.get(url + `?_id=${copyId}`); assert.isArray(getById); assert.lengthOf(getById, 1); assert.equal(getById[0]._id, copyId, 'should be able to query a document by _id') </ins> } catch (err) { throw new Error(err.responseText || err.message); }

Related discussion:
text: None of the GET request examples/Tests mention to be able to GET with id param, However during one of the PUT request tests there is a GET request sent with an ID, i struggled to find this Bug in my code, i feel adding one extra Functional test for GET request specifically requiring to be able to GET by IDs, If using mongoDB like i was the ID needs the toString Method in order to be read as a string. i attached a screen shot shows the PUT test with the GET request at the bottom Either extra functional test requiring to be able to GET with an ID, or Updated with GET example that shows GET with an ID ! Device: [Desktop] OS: [Windows 11 WSL Ubuntu 22.04.3 LTS] Browser: [Chrome] Version: [122.0.6261.70 ] No response_
This requirement would be covered by: I'd be fine adding another check inside that existing test to look at the param.
i see now the "any field" and value, this was a lack of knowledge at the time, being able to get data by an "id" is imperative. Id like to propose a solution to the test above, change query of to GET the post created by carol and assigned to eric, this keeps the get Multiple aspect but returns 1 doc the of to GET and assert that of is equal to of
I'm hesitant to rewrite the entire tests, when instead we could update the test I indicated to try a query by ID (which we know won't break existing projects because a later test relies on that functionality).
Agreed my proposed solution would be for the existing GET test that you indicated, you could just drop in and after existing , this adds a query by ID. The current tests only query by and !
Ah, I see. Yes, that would be a good approach. I'll go ahead and open this one up.
Code change:
req.flash('info', { msg: dedent` Once you have completed all of our challenges, you should <del> join our <a href="//gitter.im/freecodecamp/HalfWayClub" target="_blank">Half Way Club</a> and start getting </del> <ins> join our <a href="https://gitter.im/freecodecamp/HalfWayClub" target="_blank">Half Way Club</a> and start getting </ins> ready for our nonprofit projects. `.split('n').join(' ') });

Related discussion:
text: when I finish all challenges, the flash info is Once you have completed all of our challenges, you should join our&lt;a target=""_blank"" href=""""Half Way Club&lt;/aand start getting ready for our nonprofit projects.a element will not open HalfWayClub of gitter I'm using firefox 41.0.1 on windows, I think there is something wrong with
Code change:
Your `h2` tag should have a `width` of 80vw. ```js <del> assert(code.match(/h2s*?{s*?width:s*?80vw;s*?}/g)); </del> <ins> assert( __helpers .removeCssComments(code) .match(/h2s*?{s*?width:s*?80vw;s*?}/g) ); </ins> ``` Your `p` tag should have a `width` of 75vmin. ```js <del> assert(code.match(/ps*?{s*?width:s*?75vmin;s*?}/g)); </del> <ins> assert( __helpers .removeCssComments(code) .match(/ps*?{s*?width:s*?75vmin;s*?}/g) ); </ins> ``` # --seed--

Related discussion:
text: Describe your problem and how to reproduce it: After commenting the code in a , the tests are passing. I think the issue is with this particular challenge only as I have solved many challenges and I haven't observed this bug in any of them. ! Add a Link to the page with the problem: Tell us about your browser and operating system: Browser Name: Chrome Browser Version: 76.0.3809.132 (Official Build) (32-bit) Operating System: Windows 10 Pro
This is not unique to the beta site. Many of the challenges don't ignore comments. We have a helper function which can be applied to the tests which removes comments. We can not use it across all challenges, because there are challenges which involve validating the comments. Since there are only a few challenge tests where we need to be able to check the actual HTML, CSS, or JavaScript comments, maybe we can figure out a way to pass an extra property named with a value of only when comments should not be removed from a specific testString's use of the variable. That way, the default behavior would always be to remove comments from a test. It might be simpler to just add the to the frontMatter of the challenge, so all the tests of a challenge would not remove the comments and the s could be adjusted to account for the comments not being removed from the variable.
I do not like the idea of changing the schema again though. What we really need is a parser to sanitize comments.
Some of the challenges are actually checking the comments, so you can not just sanitize all the challenges' comments.
Did someone say ?
Ooops, been a while since I have been on GitHub. Using an AST will help remove those awful regex tests that many of the older challenges rely on. The is built with . Is wouldn't take much to create a library of helper functions to use in tests.
How do this look? The idea is to provide a challenge test utility to replace the need upon horrible RegEx tests. I have this passing locally as a POC. <img width="568" alt="Screenshot 2019-09-15 at 14 19 32" src="https://user-"
This would be really nice to be able to update those quirky tests. Can you please throw in you changes in a PR?
Code change:
e.preventDefault(); if (executeChallenge) executeChallenge(); }, <ins> FOCUS_EDITOR: e => { e.preventDefault(); if (editorRef && editorRef.current) { editorRef.current.getWrappedInstance().focusOnEditor(); } }, </ins> NAVIGATION_MODE: () => setEditorFocusability(false), NAVIGATE_PREV: () => { if (!canFocusEditor) navigate(prevChallengePath);

Related discussion:
text: Is your feature request related to a problem? Please describe. It currently can take a several key presses to navigate to the editor if it does not have focus. Describe the solution you'd like It should be possible to focus on the editor with a hotkey, for example 'e'. The issue where this was mostly discussed will be closed soon, but some thoughts about implementing this appeared there:
Code change:
id: bad87fee1348bd9aede08817 title: Nest an Anchor Element within a Paragraph challengeType: 0 <del> videoUrl: 'https://scrimba.com/p/pVMPUv/cb6k8Cb' </del> forumTopicId: 18244 dashedName: nest-an-anchor-element-within-a-paragraph ---

Related discussion:
text: <!-- NOTE: If you're reporting a security issue, don't create a GitHub issue. Instead, email We will look into it immediately. --Affected page Your code Typical user code: Expected behavior We've had an uptick of people blindly copying the help video from this challenge without reading the instructions: This leads to campers failing the requirement (This is generally a problem with the help videos, unfortunately - copying with zero understanding.) Does this video link need to be updated or removed? Screenshots If applicable, add screenshots to help explain your problem. you can drag and drop, png, jpg, gif, etc. in this box. System (please complete the following information): Device: [e.g. iPhone6, Laptop] OS: [e.g. iOS 14, Windows 10, Ubuntu 20.4] Browser: [e.g. chrome, safari] Version: [e.g. 22] Additional context Add any other context about the problem here.
let's remove it, it's already that direction with other videos, once there is a discrepancy, the challenge win and the video is removed
Seeing as this is an easy fix (I assume we just remove the URL) I will open this up to first-timers. If anyone disagrees feel free to remove the label.
Thanks for making this a first timers only. The only additional step I would be recommending is using as an example to add clear instructions for first timers. I am going to go ahead and take care of that here. This looks something that can be fixed by "first time" code contributors to this repository. Here are the files that you should be looking at to work on a fix: Edit this file and remove the line containing . Please make sure you read , we prioritize contributors following the instructions in our guides. Join us in our chat room or the forum if you need help contributing, our moderators will guide you through this. Sometimes we may get more than one pull-requests. We typically accept the most quality contribution followed by the one that is made first. Happy contributing.
Thanks for the help. I have the template to a saved reply. Hopefully, I will remember to use it. Also, I have a stupid question. How do you best "quote" the code and line numbers of a .md file?
Code change:
id: bad87fee1348bd9aede08817 title: Nest an Anchor Element within a Paragraph challengeType: 0 <del> videoUrl: 'https://scrimba.com/p/pVMPUv/cb6k8Cb' </del> forumTopicId: 18244 dashedName: nest-an-anchor-element-within-a-paragraph ---

Related discussion:
text: Do you just use the blame view or look at a commit/PR? I don't understand the commit link you have in your quote. It looks to be for something else?
Oh - I just use the code view for a markdown file and then grab the permalink. <details<summaryDetails</summaryOpen file in code-view: It's the icon on the left at the top right of the file. Looks like this: ! Getting the permalink by selecting the line (host shift for more lines): ! </details
Right, but you can only get to the code view from inside a commit, right? I mean I do not see the source view for .md files when just looking at the file. Anyway, I will figure it out sorry to bother you with this I know you are a busy man.
Yes, that is correct. I browse the repo with top commit at the time of making a comment. But again, you do not have to spell out every little detail for the first-timers, it's just a "the more the better" type thing.
Code change:
The `console.log(array[0])` prints `50`, and `data` has the value `60`. <del> **Note:** There shouldn't be any spaces between the array name and the square brackets, like `array [0]`. Although JavaScript is able to process this correctly, this may confuse other programmers reading your code. </del> # --instructions-- Create a variable called `myData` and set it to equal the first value of `myArray` using bracket notation.

Related discussion:
text: I see here that we are intentionally supporting confusing but technically correct syntax. In light of this, we should remove the note here All of these are non-standard things that technically work but nobody actually does in practice. We should either go out of our way to support this sort of thing or not. If we are going out of our way to support this sort of thing, then there really isn't much point of letting the users know that it's unconventional syntax. See also: Personally, I think it's valuable to teach the learners how to write code that others expect to see so that it's easier for them to get hired, but we really need to be consistent. We should either help them with conventions or not bother. If we aren't doing anything after making the note, then it's just visual noise and should be removed.
For what it's worth: This code fails the "bracket notation" test, presumably because of the space. And I'm of the opinion that it should stay that way (I'd be okay with updating the test to allow spacing and adding a third test that clarifies "you should not have spacing"). That being said, there are areas where we are more lenient on the spacing/conventional style, which IMHO is okay if that's not the concept being taught/tested.
For what it's worth here's what I think about formatting. In practice the likes of prettier have rendered manual formatting unnecessary and unhelpful - I don't need to see diff noise obscuring actual code changes. If we're overly picky about formatting then I can see that creating a frustrating experience. However, we should provide nicely formatted code in the examples. That way learners can pick up good habits simply by copying.
I'm generally pretty flexible with formatting. I don't think we have any business requiring a specific brace and indentation style. I'll format utterly unformatted code when someone asks for help and explain how it helps me and the learner discuss the code more easily, but that's a very useful context to discuss readability. But the extra spaces in the above three examples are so unusual and uncommon of syntax that it feels strange to make our tests permit them in the recent couple of issues while also calling it out here as something to not do.
I disagree with both propositions — the note is fine, we should encourage standard style. But also let's not be a PITA.
Code change:
The `console.log(array[0])` prints `50`, and `data` has the value `60`. <del> **Note:** There shouldn't be any spaces between the array name and the square brackets, like `array [0]`. Although JavaScript is able to process this correctly, this may confuse other programmers reading your code. </del> # --instructions-- Create a variable called `myData` and set it to equal the first value of `myArray` using bracket notation.

Related discussion:
text: I'll copy my other comment here, so we can have a discussion in a single place:
If we aren't going to enforce/test it, it's just pointless noise that needs to be removed. Text that doesn't related to what is being tested just fills the screen. We have enough trouble getting users to actually read the challenge text without including text we intend for them to ignore.
From an accessibility perspective, I don't think we should be strict on formatting that does not affect the execution of the code. One example that comes to mind is people who are listening to the code. Screen readers don't announce spaces by default so it might not be obvious that there is an extraneous space between the variable name and the bracket notation. I don't think the tests should penalize them for this when the code executes just fine. On a side note, you can use the keyboard shortcut in monaco to format the code and it will remove the space between the variable name and brackets (I just tested it). So I suppose we could require everyone to format their code properly before testing, but this seems like overkill. Or perhaps there is a way to auto-format the code when the user clicks the test button?
I'm not thrilled about intending this syntax to pass, but I find the accessibility concern more compelling than just allowing highly uncommon syntax variations because it can run in other JS environments. But I still say that it we aren't going to test it, then the spacing note should not be there. If its not part of the challenge outcomes, then it's noise. We already struggle to get learners to actually read the parts of the text that relate to their ability to pass the challenge.
Allow me to revise my previous answer just a little. I think I was assuming that this extraneous space issue was being tested in all challenges, but now I'm realizing that it may apply to only this one particular challenge. If so, then as long as the challenge instructions make it clear that this is a requirement to pass the challenge, and there is a clear error message that indicates the reason the test failed is due to the extraneous space, then I think it is OK to leave this test in there if it's deemed important enough to keep. But in general, I do not think such formatting issues should cause a test to fail (as explained above).
Thanks for the thoughts & Here is what we should do: the note.
Code change:
The `console.log(array[0])` prints `50`, and `data` has the value `60`. <del> **Note:** There shouldn't be any spaces between the array name and the square brackets, like `array [0]`. Although JavaScript is able to process this correctly, this may confuse other programmers reading your code. </del> # --instructions-- Create a variable called `myData` and set it to equal the first value of `myArray` using bracket notation.

Related discussion:
text: IMHO you all are correct in assuming it does nothing other than draw attention to a confusing notion. should support the technically correct syntax (ignore testing for it, if we are). may be a good idea, but I am afraid of accidentally introducing something else.
Code change:
```yml tests: <del> - text: <code>resolve</code> should be executed when the <code>if</code> condition is <code>true</code>. </del> <ins> - text: <code>resolve</code> should be called with the expected string when the <code>if</code> condition is <code>true</code>. </ins> testString: assert(removeJSComments(code).match(/ifs*(s*responseFromServers*)s*{s*resolves*(s*('|"|`)We got the data1s*)(s*|s*;s*)}/g)); <del> - text: <code>reject</code> should be executed when the <code>if</code> condition is <code>false</code>. </del> <ins> - text: <code>reject</code> should be called with the expected string when the <code>if</code> condition is <code>false</code>. </ins> testString: assert(removeJSComments(code).match(/}s*elses*{s*rejects*(s*('|"|`)Data not received1s*)(s*|s*;s*)}/g)); ```

Related discussion:
text: <!-- NOTE: If you're reporting a security issue, don't create a GitHub issue. Instead, email We will look into it immediately. --Describe your problem and how to reproduce it: The test error messages do not indicate anything about resolve and reject’s strings. This may throw some people off as the message error just indicates the if statement did not fire. Add a Link to the page with the problem: Test Code: Tell us about your browser and operating system: Browser Name: Chrome Browser Version: 4044.124 Operating System: iOS 81.0.4044.124 If possible, add a screenshot here (you can drag and drop, png, jpg, gif, etc. in this box): ! !
Hey , I just looked at the page, and want to make sure I got this right, Currently, the test cases only pass if "We got the data" and "Data not received" are the strings inside resolve and reject; if anything else is entered in then the tests fail. If I'm correct, the strings don't really matter, it's just having resolve and reject inside the if and else statements with a string inside. I just wanted to clarify what is needed before starting. BTW, I'm a CS student who's just getting into Open Source and thought it would be awesome to contribute here! I've used freeCodeCamp in the past to help me learn the basics of Web Development, and it really has changed how I look at coding overall. Attached are a couple of screenshots of what I tested. <img width="1540" alt="Screen Shot 2020-05-09 at 2 24 41 PM" src="https://user-"<img width="1533" alt="Screen Shot 2020-05-09 at 2 28 13 PM" src="https://user-"
Hey Thanks for jumping in! The instructions do say that the string does matter, however I believe the test messages should have something pointing the user in the right direction. Eg: Perhaps additional tests should be created for edge cases IDK . The file that needs to be altered for a PR should be:
Just my two-cents: As much as it would reduce posts asking for help on the forum etc., many (if not most) of the challenges require the user to be precise, and follow instructions well.
Code change:
```yml tests: <del> - text: <code>resolve</code> should be executed when the <code>if</code> condition is <code>true</code>. </del> <ins> - text: <code>resolve</code> should be called with the expected string when the <code>if</code> condition is <code>true</code>. </ins> testString: assert(removeJSComments(code).match(/ifs*(s*responseFromServers*)s*{s*resolves*(s*('|"|`)We got the data1s*)(s*|s*;s*)}/g)); <del> - text: <code>reject</code> should be executed when the <code>if</code> condition is <code>false</code>. </del> <ins> - text: <code>reject</code> should be called with the expected string when the <code>if</code> condition is <code>false</code>. </ins> testString: assert(removeJSComments(code).match(/}s*elses*{s*rejects*(s*('|"|`)Data not received1s*)(s*|s*;s*)}/g)); ```

Related discussion:
text: Sure, we could change many tests in other challenges, but I would much rather have the tests as is, teaching users to debug their own code. In programming outside of tutorials, debugging is a massive portion of the process, and programmers do not always write their own tests. In my opinion, the tests are well-suit for teaching programming skills.
Just took a second look and it makes sense now, didn't see the part that specified what the strings had to be. I'll probably just add a couple of tests to check for what the strings are inside of resolve/reject and change the test messages depending on which ones were passed. BTW, if you don't mind me asking, why do you guys have all of your files in Markdown? I'm just curious for the sake of learning.
That’s a question or or some of the moderators could artIculate a better answer, but I think the theory is that markdown is an easy to read input for feeding the curriculum engine/logic.
TL;DR: Markdown is easy on editing. We used to have a json object (schema) for the challenges in the earlier days, but ever since we moved to - A static site generator, we started using markdown. It is easy for contributors to edit a text file. More often than not when making a quick contribution, you do not need to know how the underlying infra works, because maybe you are changing the instructions a little bit, fixing a typo, you get the idea. We wrote a custom parser (and a schema that it needs to be compliant with) to get the content out of the markdown and build the HTML pages (which is implemented as a Gatsby plugin of course). You are welcome to dig into the package to learn how it works. P.S: All questions are welcome, do not be shy :)
That makes a lot of sense thanks for the response, I have a couple more questions actually If you don't mind me asking, Since the challenges are made using Gatsby, how do you guys test your code? Do you make your own site and run it on there? Or do you use extensions on whatever IDE/text editor you use? Also, what does YML mean? I'm assuming YAML, but I honestly don't know, I think however that If I know what that means I can figure it out.
Code change:
```yml tests: <del> - text: <code>resolve</code> should be executed when the <code>if</code> condition is <code>true</code>. </del> <ins> - text: <code>resolve</code> should be called with the expected string when the <code>if</code> condition is <code>true</code>. </ins> testString: assert(removeJSComments(code).match(/ifs*(s*responseFromServers*)s*{s*resolves*(s*('|"|`)We got the data1s*)(s*|s*;s*)}/g)); <del> - text: <code>reject</code> should be executed when the <code>if</code> condition is <code>false</code>. </del> <ins> - text: <code>reject</code> should be called with the expected string when the <code>if</code> condition is <code>false</code>. </ins> testString: assert(removeJSComments(code).match(/}s*elses*{s*rejects*(s*('|"|`)Data not received1s*)(s*|s*;s*)}/g)); ```

Related discussion:
text: Here's what I have so far:  What I want to do is change the first two tests to just resolve and reject with empty strings inside, then have the last two be with the correct string inside. These are probably very simple questions but I think they would help me out a lot as I contribute more this summer!
have you made a PR yet? When you do put the PR # in this thread so we can test your tests. If you need any help with this let me know. EDIT: Yes, YML stands for YAML files (yet another markup language). If you read the instruction on installing FreeCodeCamp locally there should be instructions for testing locally as well. To test curriculum: To test everything: Check out for all the commands for the project.
Also we have some documentation here: if you want to learn more.
I'm working on setting up my repo locally and getting a basic idea of the codebase, as I've never worked with YAML; if anyone else wants to fix this issue don't hesitate! I can work on something else. Like I said I'm new to open source so all of this stuff is new to me, apologies for me taking this long, I will be a lot more productive once I have more time on my hands.