diff --git a/package-lock.json b/package-lock.json index a098ca1fb0..95732c40f6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26,6 +26,11 @@ "prop-types": "15.6.0" } }, + "@freecodecamp/curriculum": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@freecodecamp/curriculum/-/curriculum-1.2.1.tgz", + "integrity": "sha512-op+0g7cgik3j8t2pRaMpbzDnxVsUztpgkB/o//km3lY36wGM7UOin3D7saliIQxwWmgrKelniKxOOqmAmzC6Og==" + }, "@freecodecamp/loopback-component-passport": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/@freecodecamp/loopback-component-passport/-/loopback-component-passport-1.0.0.tgz", diff --git a/package.json b/package.json index 4870461302..f8351a8525 100644 --- a/package.json +++ b/package.json @@ -42,6 +42,7 @@ "dependencies": { "@fortawesome/fontawesome": "^1.1.8", "@fortawesome/react-fontawesome": "0.0.20", + "@freecodecamp/curriculum": "^1.2.1", "@freecodecamp/loopback-component-passport": "^1.0.0", "accepts": "^1.3.0", "auth0-js": "^9.5.1", diff --git a/seed/.gitignore b/seed/.gitignore deleted file mode 100644 index c1b093a726..0000000000 --- a/seed/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -node_modules - -dist -unpacked/ - -*.log -*.tgz \ No newline at end of file diff --git a/seed/.npmignore b/seed/.npmignore deleted file mode 100644 index 5bcece0a46..0000000000 --- a/seed/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -* -!dist/*.js -!dist/challenges/**/*.json \ No newline at end of file diff --git a/seed/LICENSE.md b/seed/LICENSE.md deleted file mode 100644 index 3b7b82d0da..0000000000 --- a/seed/LICENSE.md +++ /dev/null @@ -1,427 +0,0 @@ -Attribution-ShareAlike 4.0 International - -======================================================================= - -Creative Commons Corporation ("Creative Commons") is not a law firm and -does not provide legal services or legal advice. Distribution of -Creative Commons public licenses does not create a lawyer-client or -other relationship. Creative Commons makes its licenses and related -information available on an "as-is" basis. Creative Commons gives no -warranties regarding its licenses, any material licensed under their -terms and conditions, or any related information. Creative Commons -disclaims all liability for damages resulting from their use to the -fullest extent possible. - -Using Creative Commons Public Licenses - -Creative Commons public licenses provide a standard set of terms and -conditions that creators and other rights holders may use to share -original works of authorship and other material subject to copyright -and certain other rights specified in the public license below. The -following considerations are for informational purposes only, are not -exhaustive, and do not form part of our licenses. - - Considerations for licensors: Our public licenses are - intended for use by those authorized to give the public - permission to use material in ways otherwise restricted by - copyright and certain other rights. Our licenses are - irrevocable. Licensors should read and understand the terms - and conditions of the license they choose before applying it. - Licensors should also secure all rights necessary before - applying our licenses so that the public can reuse the - material as expected. Licensors should clearly mark any - material not subject to the license. This includes other CC- - licensed material, or material used under an exception or - limitation to copyright. More considerations for licensors: - wiki.creativecommons.org/Considerations_for_licensors - - Considerations for the public: By using one of our public - licenses, a licensor grants the public permission to use the - licensed material under specified terms and conditions. If - the licensor's permission is not necessary for any reason--for - example, because of any applicable exception or limitation to - copyright--then that use is not regulated by the license. Our - licenses grant only permissions under copyright and certain - other rights that a licensor has authority to grant. Use of - the licensed material may still be restricted for other - reasons, including because others have copyright or other - rights in the material. A licensor may make special requests, - such as asking that all changes be marked or described. - Although not required by our licenses, you are encouraged to - respect those requests where reasonable. More_considerations - for the public: - wiki.creativecommons.org/Considerations_for_licensees - -======================================================================= - -Creative Commons Attribution-ShareAlike 4.0 International Public -License - -By exercising the Licensed Rights (defined below), You accept and agree -to be bound by the terms and conditions of this Creative Commons -Attribution-ShareAlike 4.0 International Public License ("Public -License"). To the extent this Public License may be interpreted as a -contract, You are granted the Licensed Rights in consideration of Your -acceptance of these terms and conditions, and the Licensor grants You -such rights in consideration of benefits the Licensor receives from -making the Licensed Material available under these terms and -conditions. - - -Section 1 -- Definitions. - - a. Adapted Material means material subject to Copyright and Similar - Rights that is derived from or based upon the Licensed Material - and in which the Licensed Material is translated, altered, - arranged, transformed, or otherwise modified in a manner requiring - permission under the Copyright and Similar Rights held by the - Licensor. For purposes of this Public License, where the Licensed - Material is a musical work, performance, or sound recording, - Adapted Material is always produced where the Licensed Material is - synched in timed relation with a moving image. - - b. Adapter's License means the license You apply to Your Copyright - and Similar Rights in Your contributions to Adapted Material in - accordance with the terms and conditions of this Public License. - - c. BY-SA Compatible License means a license listed at - creativecommons.org/compatiblelicenses, approved by Creative - Commons as essentially the equivalent of this Public License. - - d. Copyright and Similar Rights means copyright and/or similar rights - closely related to copyright including, without limitation, - performance, broadcast, sound recording, and Sui Generis Database - Rights, without regard to how the rights are labeled or - categorized. For purposes of this Public License, the rights - specified in Section 2(b)(1)-(2) are not Copyright and Similar - Rights. - - e. Effective Technological Measures means those measures that, in the - absence of proper authority, may not be circumvented under laws - fulfilling obligations under Article 11 of the WIPO Copyright - Treaty adopted on December 20, 1996, and/or similar international - agreements. - - f. Exceptions and Limitations means fair use, fair dealing, and/or - any other exception or limitation to Copyright and Similar Rights - that applies to Your use of the Licensed Material. - - g. License Elements means the license attributes listed in the name - of a Creative Commons Public License. The License Elements of this - Public License are Attribution and ShareAlike. - - h. Licensed Material means the artistic or literary work, database, - or other material to which the Licensor applied this Public - License. - - i. Licensed Rights means the rights granted to You subject to the - terms and conditions of this Public License, which are limited to - all Copyright and Similar Rights that apply to Your use of the - Licensed Material and that the Licensor has authority to license. - - j. Licensor means the individual(s) or entity(ies) granting rights - under this Public License. - - k. Share means to provide material to the public by any means or - process that requires permission under the Licensed Rights, such - as reproduction, public display, public performance, distribution, - dissemination, communication, or importation, and to make material - available to the public including in ways that members of the - public may access the material from a place and at a time - individually chosen by them. - - l. Sui Generis Database Rights means rights other than copyright - resulting from Directive 96/9/EC of the European Parliament and of - the Council of 11 March 1996 on the legal protection of databases, - as amended and/or succeeded, as well as other essentially - equivalent rights anywhere in the world. - - m. You means the individual or entity exercising the Licensed Rights - under this Public License. Your has a corresponding meaning. - - -Section 2 -- Scope. - - a. License grant. - - 1. Subject to the terms and conditions of this Public License, - the Licensor hereby grants You a worldwide, royalty-free, - non-sublicensable, non-exclusive, irrevocable license to - exercise the Licensed Rights in the Licensed Material to: - - a. reproduce and Share the Licensed Material, in whole or - in part; and - - b. produce, reproduce, and Share Adapted Material. - - 2. Exceptions and Limitations. For the avoidance of doubt, where - Exceptions and Limitations apply to Your use, this Public - License does not apply, and You do not need to comply with - its terms and conditions. - - 3. Term. The term of this Public License is specified in Section - 6(a). - - 4. Media and formats; technical modifications allowed. The - Licensor authorizes You to exercise the Licensed Rights in - all media and formats whether now known or hereafter created, - and to make technical modifications necessary to do so. The - Licensor waives and/or agrees not to assert any right or - authority to forbid You from making technical modifications - necessary to exercise the Licensed Rights, including - technical modifications necessary to circumvent Effective - Technological Measures. For purposes of this Public License, - simply making modifications authorized by this Section 2(a) - (4) never produces Adapted Material. - - 5. Downstream recipients. - - a. Offer from the Licensor -- Licensed Material. Every - recipient of the Licensed Material automatically - receives an offer from the Licensor to exercise the - Licensed Rights under the terms and conditions of this - Public License. - - b. Additional offer from the Licensor -- Adapted Material. - Every recipient of Adapted Material from You - automatically receives an offer from the Licensor to - exercise the Licensed Rights in the Adapted Material - under the conditions of the Adapter's License You apply. - - c. No downstream restrictions. You may not offer or impose - any additional or different terms or conditions on, or - apply any Effective Technological Measures to, the - Licensed Material if doing so restricts exercise of the - Licensed Rights by any recipient of the Licensed - Material. - - 6. No endorsement. Nothing in this Public License constitutes or - may be construed as permission to assert or imply that You - are, or that Your use of the Licensed Material is, connected - with, or sponsored, endorsed, or granted official status by, - the Licensor or others designated to receive attribution as - provided in Section 3(a)(1)(A)(i). - - b. Other rights. - - 1. Moral rights, such as the right of integrity, are not - licensed under this Public License, nor are publicity, - privacy, and/or other similar personality rights; however, to - the extent possible, the Licensor waives and/or agrees not to - assert any such rights held by the Licensor to the limited - extent necessary to allow You to exercise the Licensed - Rights, but not otherwise. - - 2. Patent and trademark rights are not licensed under this - Public License. - - 3. To the extent possible, the Licensor waives any right to - collect royalties from You for the exercise of the Licensed - Rights, whether directly or through a collecting society - under any voluntary or waivable statutory or compulsory - licensing scheme. In all other cases the Licensor expressly - reserves any right to collect such royalties. - - -Section 3 -- License Conditions. - -Your exercise of the Licensed Rights is expressly made subject to the -following conditions. - - a. Attribution. - - 1. If You Share the Licensed Material (including in modified - form), You must: - - a. retain the following if it is supplied by the Licensor - with the Licensed Material: - - i. identification of the creator(s) of the Licensed - Material and any others designated to receive - attribution, in any reasonable manner requested by - the Licensor (including by pseudonym if - designated); - - ii. a copyright notice; - - iii. a notice that refers to this Public License; - - iv. a notice that refers to the disclaimer of - warranties; - - v. a URI or hyperlink to the Licensed Material to the - extent reasonably practicable; - - b. indicate if You modified the Licensed Material and - retain an indication of any previous modifications; and - - c. indicate the Licensed Material is licensed under this - Public License, and include the text of, or the URI or - hyperlink to, this Public License. - - 2. You may satisfy the conditions in Section 3(a)(1) in any - reasonable manner based on the medium, means, and context in - which You Share the Licensed Material. For example, it may be - reasonable to satisfy the conditions by providing a URI or - hyperlink to a resource that includes the required - information. - - 3. If requested by the Licensor, You must remove any of the - information required by Section 3(a)(1)(A) to the extent - reasonably practicable. - - b. ShareAlike. - - In addition to the conditions in Section 3(a), if You Share - Adapted Material You produce, the following conditions also apply. - - 1. The Adapter's License You apply must be a Creative Commons - license with the same License Elements, this version or - later, or a BY-SA Compatible License. - - 2. You must include the text of, or the URI or hyperlink to, the - Adapter's License You apply. You may satisfy this condition - in any reasonable manner based on the medium, means, and - context in which You Share Adapted Material. - - 3. You may not offer or impose any additional or different terms - or conditions on, or apply any Effective Technological - Measures to, Adapted Material that restrict exercise of the - rights granted under the Adapter's License You apply. - - -Section 4 -- Sui Generis Database Rights. - -Where the Licensed Rights include Sui Generis Database Rights that -apply to Your use of the Licensed Material: - - a. for the avoidance of doubt, Section 2(a)(1) grants You the right - to extract, reuse, reproduce, and Share all or a substantial - portion of the contents of the database; - - b. if You include all or a substantial portion of the database - contents in a database in which You have Sui Generis Database - Rights, then the database in which You have Sui Generis Database - Rights (but not its individual contents) is Adapted Material, - - including for purposes of Section 3(b); and - c. You must comply with the conditions in Section 3(a) if You Share - all or a substantial portion of the contents of the database. - -For the avoidance of doubt, this Section 4 supplements and does not -replace Your obligations under this Public License where the Licensed -Rights include other Copyright and Similar Rights. - - -Section 5 -- Disclaimer of Warranties and Limitation of Liability. - - a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE - EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS - AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF - ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, - IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, - WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR - PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, - ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT - KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT - ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. - - b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE - TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, - NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, - INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, - COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR - USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN - ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR - DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR - IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. - - c. The disclaimer of warranties and limitation of liability provided - above shall be interpreted in a manner that, to the extent - possible, most closely approximates an absolute disclaimer and - waiver of all liability. - - -Section 6 -- Term and Termination. - - a. This Public License applies for the term of the Copyright and - Similar Rights licensed here. However, if You fail to comply with - this Public License, then Your rights under this Public License - terminate automatically. - - b. Where Your right to use the Licensed Material has terminated under - Section 6(a), it reinstates: - - 1. automatically as of the date the violation is cured, provided - it is cured within 30 days of Your discovery of the - violation; or - - 2. upon express reinstatement by the Licensor. - - For the avoidance of doubt, this Section 6(b) does not affect any - right the Licensor may have to seek remedies for Your violations - of this Public License. - - c. For the avoidance of doubt, the Licensor may also offer the - Licensed Material under separate terms or conditions or stop - distributing the Licensed Material at any time; however, doing so - will not terminate this Public License. - - d. Sections 1, 5, 6, 7, and 8 survive termination of this Public - License. - - -Section 7 -- Other Terms and Conditions. - - a. The Licensor shall not be bound by any additional or different - terms or conditions communicated by You unless expressly agreed. - - b. Any arrangements, understandings, or agreements regarding the - Licensed Material not stated herein are separate from and - independent of the terms and conditions of this Public License. - - -Section 8 -- Interpretation. - - a. For the avoidance of doubt, this Public License does not, and - shall not be interpreted to, reduce, limit, restrict, or impose - conditions on any use of the Licensed Material that could lawfully - be made without permission under this Public License. - - b. To the extent possible, if any provision of this Public License is - deemed unenforceable, it shall be automatically reformed to the - minimum extent necessary to make it enforceable. If the provision - cannot be reformed, it shall be severed from this Public License - without affecting the enforceability of the remaining terms and - conditions. - - c. No term or condition of this Public License will be waived and no - failure to comply consented to unless expressly agreed to by the - Licensor. - - d. Nothing in this Public License constitutes or may be interpreted - as a limitation upon, or waiver of, any privileges and immunities - that apply to the Licensor or You, including from the legal - processes of any jurisdiction or authority. - - -======================================================================= - -Creative Commons is not a party to its public -licenses. Notwithstanding, Creative Commons may elect to apply one of -its public licenses to material it publishes and in those instances -will be considered the “Licensor.” The text of the Creative Commons -public licenses is dedicated to the public domain under the CC0 Public -Domain Dedication. Except for the limited purpose of indicating that -material is shared under a Creative Commons public license or as -otherwise permitted by the Creative Commons policies published at -creativecommons.org/policies, Creative Commons does not authorize the -use of the trademark "Creative Commons" or any other trademark or logo -of Creative Commons without its prior written consent including, -without limitation, in connection with any unauthorized modifications -to any of its public licenses or any other arrangements, -understandings, or agreements concerning use of licensed material. For -the avoidance of doubt, this paragraph does not form part of the -public licenses. - -Creative Commons may be contacted at creativecommons.org. diff --git a/seed/README.md b/seed/README.md deleted file mode 100644 index d40669838c..0000000000 --- a/seed/README.md +++ /dev/null @@ -1,73 +0,0 @@ -## freeCodeCamp Curriculum - -This package contains the "seed" files used in the freeCodeCamp Curriculum. - -### Installation - -```sh -npm i @freecodecamp/curriculum -# or -yarn add @freecodecamp/curriculum -``` - -### Usage - -```js -import { getChallenges } from '@freecodecamp/curriculum'; - -getChallenges() // will provide an array of blocks i.e. basic CSS, functional programming - -``` -#### `block` Structure - -```json -{ - "name": "ES6", - "order": 2, - "time": "5 hours", - "helpRoom": "Help", - "challenges": [/**/], - "fileName": "02-javascript-algorithms-and-data-structures/es6.json", - "superBlock": "javascript-algorithms-and-data-structures", - "superOrder": 2 -} -``` - -#### `challenge` Structure - -```json -{ - "id": "ObjectId()", - "title": "Declare a Read-Only Variable with the const Keyword", - "description": [ - "A Description of the challenge and what is required to pass" - ], - "tests": [ - { - "text": "should return \"foo\"", - "testString": "a stringified function using Chai asserts" - } - ], - "challengeType": 1, - "translations": {}, - "files": { - "indexjs": { - "key": "indexjs", - "ext": "js", - "name": "index", - "contents": [ - "Initial editor seed" - ], - "head": [ - "A place for test set up", - "Can be thought of as mocha's beforeEach()" - ], - "tail": [ - "A place for test tear down", - "Can be thought of as mocha's afterEach()" - ] - } - } -}, -``` - diff --git a/seed/challenge-style-guide.md b/seed/challenge-style-guide.md deleted file mode 100644 index 7ad12e4fd4..0000000000 --- a/seed/challenge-style-guide.md +++ /dev/null @@ -1,153 +0,0 @@ -# A guide to designing freeCodeCamp coding challenges - -> "Talk is cheap. Show me the code." — Linus Torvalds - -freeCodeCamp offers 1,200 hours of interactive coding challenges. These are 100% focused on the practical skill of building software. You code the entire time. You learn to code by coding. - -You can learn theory through free online university courses. freeCodeCamp will focus instead on helping you learn to code and practice by building apps. - -With that practical focus in mind, let’s talk about the requirements for our coding challenges. (Note that these requirements do not apply to our algorithm challenges, checkpoint challenges, or projects.) - -**Table of Contents** - -- [Proper nouns](#proper-nouns) -- [The 2 minute rule](#the-2-minute-rule) -- [Modularity](#modularity) -- [Naming challenges](#naming-challenges) -- [Writing tests](#writing-tests) -- [Writing instructions](#writing-instructions) -- [Formatting challenge text](#formatting-challenge-text) -- [Formatting seed code](#formatting-seed-code) -- [Why do we have all these rules?](#why-do-we-have-all-these-rules) - -## Proper nouns - -Proper nouns should use correct capitalization when possible. Below is a list of words as they should appear in the challenges. - -- JavaScript (capital letters in "J" and "S" and no abbreviations) -- Node.js - -Front-end development (adjective form with a dash) is when you're working on the front end (noun form with no dash). The same goes with "back end", "full stack", and many other compound terms. - -## The 2 minute rule - -Each challenge should be solvable within 120 seconds  by a native English speaker who has completed the challenges leading up to it. This includes the amount of time it takes to read the directions, understand the seeded code, write their own code, and get all the tests to pass. - -If it takes longer than two minutes to complete the challenge, you have two options: -- simplify the challenge, or -- split the challenge into two challenges. - -The 2 minute rule forces you, the challenge designer, to make your directions concise, your seed code clear, and your tests straight-forward. - -We have JavaScript events that track how long it takes for campers to solve challenges and we can use them to identify challenges that need to be simplified or split. - -## Modularity - -Each challenge should teach exactly one concept, and that concept should be apparent from the challenge's name. - -We can reinforce previously covered concepts through repetition and variations - for example, introducing h1 elements in one challenge, then h3 elements a few challenges later. - -Our goal is to have thousands of 2-minute challenges. These can flow together and reiterate previously-covered concepts. - -## Naming challenges - -Naming things is hard. We've made it easier by imposing some constraints. - -All challenge titles should be explicit and should follow this pattern: - -[verb] [object clause] - -Here are some example challenge names: - -- Use Clockwise Notation to Specify the Padding of an Element -- Condense arrays with .reduce -- Use Bracket Notation to Find the First Character in a String - -## Numbering Challenges - -Every challenge needs an `id`. If you don't specify one, then MongoDB will create a new random one when it saves the data; however, we don't want it to do that, since we want the challenge ids to be consistent across different environments (staging, production, lots of different developers, etc.). - -To generate a new one in a shell (assuming MongoDB is running separately): - -1. Run `mongo` command -2. Run `ObjectId()` command - -For example: - -```sh -$ mongo -MongoDB shell version v3.6.1 -connecting to: mongodb://127.0.0.1:27017 -MongoDB server version: 3.4.10 -... -$ ObjectId() -ObjectId("5a474d78df58bafeb3535d34") -``` - -The result is a new id, for example `5a474d78df58bafeb3535d34` above. - -Once you have your id, put it into the JSON file as the `id` field, e.g. - -``` -{ - "id": "5a474d78df58bafeb3535d34", - "title": "Challenge Title", -``` - - -## Writing tests - -Challenges should have the minimum number of tests necessary to verify that a camper understands a concept. - -Our goal is to communicate the single point that the challenge is trying to teach, and test that they have understood that point. - -Challenge tests can make use of the Node.js and Chai.js assertion libraries. Also, if needed, user-generated code can be accessed in the `code` variable. - -## Writing instructions - -Challenges should be written with short, clear sentences, and use as little jargon as necessary. All jargon should be defined immediately in plain English. - -Keep paragraphs short (around 1-4 sentences). People are more likely to read several short paragraphs over a wall of text. - -Challenge text should use the second person ("you") to help to give it a conversational tone. This way, the text and instructions seem to speak directly to the camper working through the challenge. Try to avoid using the first person ("I", "we", "let's", and "us"). - -Don't use outbound links. These interrupt the flow. And campers should never have to google anything during these challenges. If there are resources you think campers would benefit from, add them to the challenge's wiki article on the forum. - -You can add diagrams if absolutely necessary. - -Don't use emojis or emoticons in challenges. freeCodeCamp has a global community, and the cultural meaning of an emoji or emoticon may be different around the world. Also, emojis can render differently on different systems. - -## Formatting challenge text - -Here are specific formatting guidelines for challenge text and examples: - -- Language keywords go in `` tags. For example, HTML tag names or CSS property names -- The first instance of a keyword when it's being defined, or general keywords (i.e. "object" or "immutable") go in `` tags -- Single line code examples go in `` tags -- Multi-line code examples go in `
` tags, and use the `
` tag to separate lines. For HTML examples, remember to use escape characters to represent the angle brackets -- A single horizontal rules (`
` tag) should separate the text discussing the challenge concept and the challenge instructions -- Additional information in the form of a note should be formatted `Note
Rest of note text...` -- Use double quotes where applicable - -## Formatting seed code - -Here are specific formatting guidelines for the challenge seed code: - -- Use two spaces to indent -- JavaScript statements end with a semicolon -- Use double quotes where applicable -- Comments made should have a space between the comment characters and the comment themselves - - `// Fix this line` - -## Why do we have all these rules? - -Our goal is to have a fun, clear interactive learning experience. - -Designing interactive coding challenges is hard. It would be so much easier to write a lengthy explanation, or to create a video tutorial. There's a place for those on Medium and YouTube. But for our core curriculum, we're sticking with what works best for most people - a fully interactive, video game-like experience. - -We want campers to achieve a flow state. We want them to build momentum and blast through our curriculum with as few snags as possible. We want them to go into the projects with confidence and a wide exposure to programming concepts. - -Creating these challenges requires immense creativity and attention to detail. But you'll have plenty of help. You have support from a whole team of contributors, whom you can bounce ideas off of and demo your challenges to. Stay active in the [contributors room](https://gitter.im/freecodecamp/contributors) and ask lots of questions. - -With your help, we can design an interactive coding curriculum that will help millions of people learn to code for years to come. diff --git a/seed/challengeTitles.js b/seed/challengeTitles.js index a43e144972..6a022f1283 100644 --- a/seed/challengeTitles.js +++ b/seed/challengeTitles.js @@ -1,14 +1,16 @@ -import _ from 'lodash'; - class ChallengeTitles { constructor() { this.knownTitles = []; } check(title) { if (typeof title !== 'string') { - throw new Error(`Expected a valid string for ${title}, but got a(n) ${typeof title}`); + throw new Error(` + Expected a valid string for ${title}, but got a(n) ${typeof title} + `); } else if (title.length === 0) { - throw new Error(`Expected a title length greater than 0`); + throw new Error(` + Expected a title length greater than 0 + `); } const titleToCheck = title.toLowerCase().replace(/\s+/g, ''); const isKnown = this.knownTitles.includes(titleToCheck); diff --git a/seed/challenges/01-responsive-web-design/applied-accessibility.json b/seed/challenges/01-responsive-web-design/applied-accessibility.json deleted file mode 100644 index 4fce242322..0000000000 --- a/seed/challenges/01-responsive-web-design/applied-accessibility.json +++ /dev/null @@ -1,1522 +0,0 @@ -{ - "name": "Applied Accessibility", - "order": 3, - "time": "5 hours", - "helpRoom": "Help", - "challenges": [ - { - "id": "587d774c367417b2b2512a9c", - "title": "Add a Text Alternative to Images for Visually Impaired Accessibility", - "description": [ - "It's likely you've seen an alt attribute on an img tag in other challenges. Alt text describes the content of the image and provides a text-alternative. This helps in case the image fails to load or can't be seen by a user. It's also used by search engines to understand what an image contains to include it in search results. Here's an example:", - "<img src="importantLogo.jpeg" alt="Company logo">", - "People with visual impairments rely on screen readers to convert web content to an audio interface. They won't get information if it's only presented visually. For images, screen readers can access the alt attribute and read its contents to deliver key information.", - "Good alt text is short but descriptive, and meant to briefly convey the meaning of the image. You should always include an alt attribute on your image. Per HTML5 specification, this is now considered mandatory.", - "
", - "Camper Cat happens to be both a coding ninja and an actual ninja, and is building a website to share his knowledge. The profile picture he wants to use shows his skills, and should be appreciated by all site visitors. Add an alt attribute in the img tag, that explains Camper Cat is doing karate. (The image src doesn't link to an actual file, so you should see the alt text in the display.)" - ], - "tests": [ - { - "text": "Your img tag should have an alt attribute, and it should not be empty.", - "testString": "assert($('img').attr('alt'), 'Your img tag should have an alt attribute, and it should not be empty.');" - } - ], - "solutions": [], - "hints": [], - "releasedOn": "Feb 17, 2017", - "challengeType": 0, - "translations": {}, - "guideUrl": "https://guide.freecodecamp.org/certificates/add-alt-text-to-an-image-for-accessibility", - "files": { - "indexhtml": { - "key": "indexhtml", - "ext": "html", - "name": "index", - "contents": [ - "" - ], - "head": [], - "tail": [] - } - } - }, - { - "id": "587d774c367417b2b2512a9d", - "title": "Know When Alt Text Should be Left Blank", - "description": [ - "In the last challenge, you learned that including an alt attribute on img tags is mandatory. However, sometimes images are grouped with a caption already describing them, or are used for decoration only. In these cases alt text may seem redundant or unnecessary.", - "In situations when an image is already explained with text content, or does not add meaning to a page, the img still needs an alt attribute, but it can be set to an empty string. Here's an example:", - "<img src="visualDecoration.jpeg" alt="">", - "Background images usually fall under the 'decorative' label as well. However, they are typically applied with CSS rules, and therefore not part of the markup screen readers process.", - "Note
For images with a caption, you may still want to include alt text, since it helps search engines catalog the content of the image.", - "
", - "Camper Cat has coded a skeleton page for the blog part of his website. He's planning to add a visual break between his two articles with a decorative image of a samurai sword. Add an alt attribute to the img tag and set it to an empty string. (Note that the image src doesn't link to an actual file - don't worry that there are no swords showing in the display.)" - ], - "tests": [ - { - "text": "Your img tag should have an alt attribute.", - "testString": "assert(!($('img').attr('alt') == undefined), 'Your img tag should have an alt attribute.');" - }, - { - "text": "The alt attribute should be set to an empty string.", - "testString": "assert($('img').attr('alt') == '', 'The alt attribute should be set to an empty string.');" - } - ], - "solutions": [], - "hints": [], - "releasedOn": "Feb 17, 2017", - "challengeType": 0, - "translations": {}, - "files": { - "indexhtml": { - "key": "indexhtml", - "ext": "html", - "name": "index", - "contents": [ - "

Deep Thoughts with Master Camper Cat

", - "
", - "

Defeating your Foe: the Red Dot is Ours!

", - "

To Come...

", - "
", - "", - "", - "", - "
", - "

Is Chuck Norris a Cat Person?

", - "

To Come...

", - "
" - ], - "head": [], - "tail": [] - } - } - }, - { - "id": "587d774d367417b2b2512a9e", - "title": "Use Headings to Show Hierarchical Relationships of Content", - "description": [ - "Headings (h1 through h6 elements) are workhorse tags that help provide structure and labeling to your content. Screen readers can be set to read only the headings on a page so the user gets a summary. This means it is important for the heading tags in your markup to have semantic meaning and relate to each other, not be picked merely for their size values.", - "Semantic meaning means that the tag you use around content indicates the type of information it contains.", - "If you were writing a paper with an introduction, a body, and a conclusion, it wouldn't make much sense to put the conclusion as a subsection of the body in your outline. It should be its own section. Similarly, the heading tags in a webpage need to go in order and indicate the hierarchical relationships of your content.", - "Headings with equal (or higher) rank start new implied sections, headings with lower rank start subsections of the previous one.", - "As an example, a page with an h2 element followed by several subsections labeled with h4 tags would confuse a screen reader user. With six choices, it's tempting to use a tag because it looks better in a browser, but you can use CSS to edit the relative sizing.", - "One final point, each page should always have one (and only one) h1 element, which is the main subject of your content. This and the other headings are used in part by search engines to understand the topic of the page.", - "
", - "Camper Cat wants a page on his site dedicated to becoming a ninja. Help him fix the headings so his markup gives semantic meaning to the content, and shows the proper parent-child relationships of his sections. Change all the h5 tags to the proper heading level to indicate they are subsections of the h2 ones." - ], - "tests": [ - { - "text": "Your code should have six h3 tags.", - "testString": "assert($('h3').length === 6, 'Your code should have six h3 tags.');" - }, - { - "text": "Your code should not have any h5 tags.", - "testString": "assert($('h5').length === 0, 'Your code should not have any h5 tags.');" - } - ], - "solutions": [], - "hints": [ - "All the h5 tags are siblings, and should be changed to the same new heading level." - ], - "releasedOn": "Feb 17, 2017", - "challengeType": 0, - "translations": {}, - "files": { - "indexhtml": { - "key": "indexhtml", - "ext": "html", - "name": "index", - "contents": [ - "

How to Become a Ninja

", - "
", - "

Learn the Art of Moving Stealthily

", - "
How to Hide in Plain Sight
", - "
How to Climb a Wall
", - "", - "

Learn the Art of Battle

", - "
How to Strengthen your Body
", - "
How to Fight like a Ninja
", - "", - "

Learn the Art of Living with Honor

", - "
How to Breathe Properly
", - "
How to Simplify your Life
", - "
" - ], - "head": [], - "tail": [] - } - } - }, - { - "id": "587d774e367417b2b2512a9f", - "title": "Jump Straight to the Content Using the main Element", - "description": [ - "HTML5 introduced a number of new elements that give developers more options while also incorporating accessibility features. These tags include main, header, footer, nav, article, and section, among others.", - "By default, a browser renders these elements similarly to the humble div. However, using them where appropriate gives additional meaning in your markup. The tag name alone can indicate the type of information it contains, which adds semantic meaning to that content. Assistive technologies can access this information to provide better page summary or navigation options to their users.", - "The main element is used to wrap (you guessed it) the main content, and there should be only one per page. It's meant to surround the information that's related to the central topic of your page. It's not meant to include items that repeat across pages, like navigation links or banners.", - "The main tag also has an embedded landmark feature that assistive technology can use to quickly navigate to the main content. If you've ever seen a \"Jump to Main Content\" link at the top of a page, using a main tag automatically gives assistive devices that functionality.", - "
", - "Camper Cat has some big ideas for his ninja weapons page. Help him set up his markup by adding opening and closing main tags between the header and footer (covered in other challenges). Keep the main tags empty for now." - ], - "tests": [ - { - "text": "Your code should have one main tag.", - "testString": "assert($('main').length == 1, 'Your code should have one main tag.');" - }, - { - "text": "The main tags should be between the closing header tag and the opening footer tag.", - "testString": "assert(code.match(/<\\/header>\\s*?
\\s*?<\\/main>/gi), 'The main tags should be between the closing header tag and the opening footer tag.');" - } - ], - "solutions": [], - "hints": [], - "releasedOn": "Feb 17, 2017", - "challengeType": 0, - "translations": {}, - "files": { - "indexhtml": { - "key": "indexhtml", - "ext": "html", - "name": "index", - "contents": [ - "
", - "

Weapons of the Ninja

", - "
", - "", - "", - "", - "
" - ], - "head": [], - "tail": [] - } - } - }, - { - "id": "587d774e367417b2b2512aa0", - "title": "Wrap Content in the article Element", - "description": [ - "article is another one of the new HTML5 elements that adds semantic meaning to your markup. Article is a sectioning element, and is used to wrap independent, self-contained content. The tag works well with blog entries, forum posts, or news articles.", - "Determining whether content can stand alone is usually a judgement call, but there are a couple simple tests you can use. Ask yourself if you removed all surrounding context, would that content still make sense? Similarly for text, would the content hold up if it were in an RSS feed?", - "Remember that folks using assistive technologies rely on organized, semantically meaningful markup to better understand your work.", - "Note about section and div
The section element is also new with HTML5, and has a slightly different semantic meaning than article. An article is for standalone content, and a section is for grouping thematically related content. They can be used within each other, as needed. For example, if a book is the article, then each chapter is a section. When there's no relationship between groups of content, then use a div.", - "
<div> - groups content
<section> - groups related content
<article> - groups independent, self-contained content
", - "
", - "Camper Cat used article tags to wrap the posts on his blog page, but he forgot to use them around the top one. Change the div tag to use an article tag instead." - ], - "tests": [ - { - "text": "Your code should have three article tags.", - "testString": "assert($('article').length == 3, 'Your code should have three article tags.');" - }, - { - "text": "Your code should not have any div tags.", - "testString": "assert($('div').length == 0, 'Your code should not have any div tags.');" - } - ], - "solutions": [], - "hints": [], - "releasedOn": "Feb 17, 2017", - "challengeType": 0, - "translations": {}, - "files": { - "indexhtml": { - "key": "indexhtml", - "ext": "html", - "name": "index", - "contents": [ - "

Deep Thoughts with Master Camper Cat

", - "
", - "
", - "

The Garfield Files: Lasagna as Training Fuel?

", - "

The internet is littered with varying opinions on nutritional paradigms, from catnip paleo to hairball cleanses. But let's turn our attention to an often overlooked fitness fuel, and examine the protein-carb-NOM trifecta that is lasagna...

", - "
", - "", - " \"\"", - "", - "
", - "

Defeating your Foe: the Red Dot is Ours!

", - "

Felines the world over have been waging war on the most persistent of foes. This red nemesis combines both cunning stealth and lightening speed. But chin up, fellow fighters, our time for victory may soon be near...

", - "
", - "", - " \"\"", - "", - "
", - "

Is Chuck Norris a Cat Person?

", - "

Chuck Norris is widely regarded as the premier martial artist on the planet, and it's a complete coincidence anyone who disagrees with this fact mysteriously disappears soon after. But the real question is, is he a cat person?...

", - "
", - "
" - ], - "head": [], - "tail": [] - } - } - }, - { - "id": "587d7787367417b2b2512aa1", - "title": "Make Screen Reader Navigation Easier with the header Landmark", - "description": [ - "The next HTML5 element that adds semantic meaning and improves accessibility is the header tag. It's used to wrap introductory information or navigation links for its parent tag, and works well around content that's repeated at the top on multiple pages.", - "header shares the embedded landmark feature you saw with main, allowing assistive technologies to quickly navigate to that content.", - "Note
header is meant for use in the body tag of your HTML document. This is different than the head element, which contains the page's title, meta information, etc.", - "
", - "Camper Cat is writing some great articles about ninja training, and wants to add a page for them to his site. Change the top div that currently contains the h1 to a header tag instead." - ], - "tests": [ - { - "text": "Your code should have one header tag.", - "testString": "assert($('header').length == 1, 'Your code should have one header tag.');" - }, - { - "text": "Your header tags should wrap around the h1.", - "testString": "assert($('header').children('h1').length == 1, 'Your header tags should wrap around the h1.');" - }, - { - "text": "Your code should not have any div tags.", - "testString": "assert($('div').length == 0, 'Your code should not have any div tags.');" - }, - { - "text": "Make sure your header element has a closing tag.", - "testString": "assert(code.match(/<\\/header>/g) && code.match(/<\\/header>/g).length === code.match(/
/g).length, 'Make sure your header element has a closing tag.');" - } - ], - "solutions": [], - "hints": [], - "releasedOn": "Feb 17, 2017", - "challengeType": 0, - "translations": {}, - "files": { - "indexhtml": { - "key": "indexhtml", - "ext": "html", - "name": "index", - "contents": [ - "", - "", - "
", - "

Training with Camper Cat

", - "
", - "", - "", - "
", - "
", - "

Stealth & Agility Training

", - "

Climb foliage quickly using a minimum spanning tree approach

", - "

No training is NP-complete without parkour

", - "
", - "
", - "

Combat Training

", - "

Dispatch multiple enemies with multithreaded tactics

", - "

Goodbye world: 5 proven ways to knock out an opponent

", - "
", - "
", - "

Weapons Training

", - "

Swords: the best tool to literally divide and conquer

", - "

Breadth-first or depth-first in multi-weapon training?

", - "
", - "
", - "" - ], - "head": [], - "tail": [] - } - } - }, - { - "id": "587d7788367417b2b2512aa2", - "title": "Make Screen Reader Navigation Easier with the nav Landmark", - "description": [ - "The nav element is another HTML5 item with the embedded landmark feature for easy screen reader navigation. This tag is meant to wrap around the main navigation links in your page.", - "If there are repeated site links at the bottom of the page, it isn't necessary to markup those with a nav tag as well. Using a footer (covered in the next challenge) is sufficient.", - "
", - "Camper Cat included navigation links at the top of his training page, but wrapped them in a div. Change the div to a nav tag to improve the accessibility on his page." - ], - "tests": [ - { - "text": "Your code should have one nav tag.", - "testString": "assert($('nav').length == 1, 'Your code should have one nav tag.');" - }, - { - "text": "Your nav tags should wrap around the ul and its list items.", - "testString": "assert($('nav').children('ul').length == 1, 'Your nav tags should wrap around the ul and its list items.');" - }, - { - "text": "Your code should not have any div tags.", - "testString": "assert($('div').length == 0, 'Your code should not have any div tags.');" - }, - { - "text": "Make sure your nav element has a closing tag.", - "testString": "assert(code.match(/<\\/nav>/g) && code.match(/<\\/nav>/g).length === code.match(/