Commit Graph

71 Commits (0e611f321e675a88382494e6cff6f6d1c54211f4)

Author SHA1 Message Date
awu43 b84e74ad42
fix(curriculum): improve lazy matching test regex (#42882) 2021-07-16 15:31:19 +01:00
Sem Bauke 21c8500f94
fix(curriculum): prevent submitting array instead of string (#41720)
* fix(curriculum) prevent users from submitting an array instead of string

* use strict equality instead of new test

* Add suggestions from Tom

Co-authored-by: Tom <20648924+moT01@users.noreply.github.com>

Co-authored-by: Tom <20648924+moT01@users.noreply.github.com>
2021-04-09 07:34:55 -05:00
Nicholas Carrigan (he/him) 7117919d36
chore(learn): audit javascript algorithms and data structures (#41092)
* chore(learn): audit basic algorithm scripting

* chore(learn): audit basic data structures

* chore(learn): audit basic javascript

* chore(learn): audit debugging

* chore(learn): audit es6

* chore(learn): audit functional programming

* chore(learn): audit intermidate algorithms

* chore(learn): audit js projects

* chore(learn): audit object oriented programming

* chore(learn): audit regex

* fix(learn): remove stray .

* fix(learn): string to code

* fix(learn): missed some

* fix(learn): clarify strings

Based on Randy's feedback, clarifies string instances where quotes
were removed in favour of back ticks.

* fix: apply suggestions - thanks Randy! :)

Co-authored-by: Randell Dawson <5313213+RandellDawson@users.noreply.github.com>

* fix: non-suggestion comments

* chore(learn): remove comments from codes

Removes the comments from the description and instruction code
blocks to ensure that all relevant information is translatable.

* fix: Apply suggestions from code review

Co-authored-by: Shaun Hamilton <51722130+ShaunSHamilton@users.noreply.github.com>

* fix: revert crowdin fix

* Update curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/mutations.md

Co-authored-by: Randell Dawson <5313213+RandellDawson@users.noreply.github.com>

* fix: Apply suggestions from code review

Co-authored-by: Shaun Hamilton <51722130+ShaunSHamilton@users.noreply.github.com>

* Update curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-to-assign-variables-from-arrays.md

Co-authored-by: Shaun Hamilton <51722130+ShaunSHamilton@users.noreply.github.com>

* fix: Apply suggestions from code review

Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
Co-authored-by: Shaun Hamilton <51722130+ShaunSHamilton@users.noreply.github.com>

* chore: change voice

* fix: Christopher Nolan

* fix: expressions would evaluate

* fix: will -> would

* Update curriculum/challenges/english/02-javascript-algorithms-and-data-structures/object-oriented-programming/add-methods-after-inheritance.md

Co-authored-by: Randell Dawson <5313213+RandellDawson@users.noreply.github.com>

* fix: to work to push

* Update curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/iterate-with-javascript-for-loops.md

Co-authored-by: Shaun Hamilton <51722130+ShaunSHamilton@users.noreply.github.com>

* Update curriculum/challenges/english/02-javascript-algorithms-and-data-structures/object-oriented-programming/add-methods-after-inheritance.md

Co-authored-by: Randell Dawson <5313213+RandellDawson@users.noreply.github.com>

Co-authored-by: Randell Dawson <5313213+RandellDawson@users.noreply.github.com>
Co-authored-by: Shaun Hamilton <51722130+ShaunSHamilton@users.noreply.github.com>
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
2021-03-02 17:12:12 -07:00
Randell Dawson 33356e403a
fix(learn): Use backticks around back slash character (#41254) 2021-02-25 16:34:40 +05:30
Joshua Pelealu c15c27f474
fix(learn): Added another test to check for invalid characters (#41144) 2021-02-17 21:16:07 +05:30
Tom 51f6077f7b
fix(learn): regex-criminal-in-hunt-challenge (#40901)
* fix: regex-criminal-in-hunt-challenge

* Update curriculum/challenges/english/02-javascript-algorithms-and-data-structures/regular-expressions/find-one-or-more-criminals-in-a-hunt.md

Co-authored-by: Randell Dawson <5313213+RandellDawson@users.noreply.github.com>

Co-authored-by: Randell Dawson <5313213+RandellDawson@users.noreply.github.com>
2021-02-08 06:10:59 -08:00
Shaun Hamilton ce3a20e552
fix(learn): change requirements for positive and negative lookaheads (#40570) 2021-01-21 15:35:19 -06:00
Alex Soto ef394093f7
fix(learn): removing unnecessary test case for regex challenge (#40581)
Co-authored-by: Alejandro Soto <alejandro.soto@wundermanthompson.com>
2021-01-20 21:53:04 -08:00
Martin Milani 8e96fef862
fix(learn): Updated instructions for challenge solution for Reuse Patterns Using Capture Groups (#40658)
* Grammatically updated the instructions for the challenge

* Update curriculum/challenges/english/02-javascript-algorithms-and-data-structures/regular-expressions/reuse-patterns-using-capture-groups.md

Co-authored-by: Eric Leung <eric@erictleung.com>

Co-authored-by: Eric Leung <eric@erictleung.com>
2021-01-20 19:39:23 -08:00
Nicholas Carrigan (he/him) 8d8d25e9f2
fix(learn): address escaped backticks (#40717)
* fix(learn): address escaped backticks

Addresses the instances of escaped backticks - where a backtick is
preceded by a backslash.  In most cases, this was left over from the
old parser. In some cases, a backtick was intended to be wrapped in
code tags and has been adjusted accordingly.

This issue came to light due to a bug in the translation flow on
Crowdin.

Signed-off-by: nhcarrigan <nhcarrigan@gmail.com>

* fix: EVEN MORE :( :( :(

Signed-off-by: nhcarrigan <nhcarrigan@gmail.com>

* fix: backslash nightmares

Signed-off-by: nhcarrigan <nhcarrigan@gmail.com>

* fix: When you wish upon a *******

Signed-off-by: nhcarrigan <nhcarrigan@gmail.com>

* fix(curriculum): md error introduced by formatter

* fix(curriculum): remove extra `s

* fix: restore quote symbol

Signed-off-by: nhcarrigan <nhcarrigan@gmail.com>

* fix: Typo

Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>

* fix: apply review changes

Applying review feedback from call with @RandellDawson.

Signed-off-by: nhcarrigan <nhcarrigan@gmail.com>

* fix: markdown does weird stuff sometimes

Can't stick backticks together - use code.

Signed-off-by: nhcarrigan <nhcarrigan@gmail.com>

Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
2021-01-20 19:01:00 -07:00
Oliver Eyton-Williams ee1e8abd87
feat(curriculum): restore seed + solution to Chinese (#40683)
* feat(tools): add seed/solution restore script

* chore(curriculum): remove empty sections' markers

* chore(curriculum): add seed + solution to Chinese

* chore: remove old formatter

* fix: update getChallenges

parse translated challenges separately, without reference to the source

* chore(curriculum): add dashedName to English

* chore(curriculum): add dashedName to Chinese

* refactor: remove unused challenge property 'name'

* fix: relax dashedName requirement

* fix: stray tag

Remove stray `pre` tag from challenge file.

Signed-off-by: nhcarrigan <nhcarrigan@gmail.com>

Co-authored-by: nhcarrigan <nhcarrigan@gmail.com>
2021-01-12 19:31:00 -07:00
Oliver Eyton-Williams 0bd52f8bd1
Feat: add new Markdown parser (#39800)
and change all the challenges to new `md` format.
2020-11-27 10:02:05 -08:00
Marc Antoni 1badd3c3a6
fix(learn): add test case to regex challenge (#40087)
existing test cases can be satisfied by /^[a-z][a-z]+$|^[a-z][a-z]*\d\d+$/i
2020-11-01 13:24:35 +00:00
Oliver Eyton-Williams 35c4020f4d
fix(curriculum): test typos (#39984) 2020-10-15 14:49:57 -04:00
Oliver Eyton-Williams 2b9e38a17b
fix: replace .english.md extension with .md 2020-09-29 22:09:04 +02:00
Oliver Eyton-Williams bd68b70f3d
Feat: hide blocks not challenges (#39504)
* fix: remove isHidden flag from frontmatter

* fix: add isUpcomingChange

Co-authored-by: Ahmad Abdolsaheb <ahmad.abdolsaheb@gmail.com>

* feat: hide blocks not challenges

Co-authored-by: Ahmad Abdolsaheb <ahmad.abdolsaheb@gmail.com>

Co-authored-by: Ahmad Abdolsaheb <ahmad.abdolsaheb@gmail.com>
2020-09-03 15:07:40 -07:00
Yasmin Yazdi cf82a2b33e
fix global flag fail in Regex by resetting last Index (#39457)
* fixing global flag fail by resetting last index. Issue #37890

* fixed syntax error

* making requested changes
2020-08-31 16:59:42 +05:30
Oliver Eyton-Williams f1c9b08cf3 fix(curriculum): add isHidden: false to challenges
This includes certificates (where it does nothing), but does not
include any translations.
2020-05-25 16:25:19 +05:30
Renato Melo e9614d60d4
fix: update regex specify exact number of matches - lastIndex = 0 before test (#38717) 2020-05-19 12:50:20 +02:00
Damjan Ostrelič bfe76794c0
Allow use of g flag in Regular Expressions: Check for All or None (#38659)
* allow use of g flag

added functionality of tests to allow for the use of g flag by resetting the lastIndex as per example in https://github.com/freeCodeCamp/freeCodeCamp/pull/37941.

* Update curriculum/challenges/english/02-javascript-algorithms-and-data-structures/regular-expressions/check-for-all-or-none.english.md

Co-Authored-By: Shaun Hamilton <51722130+Sky020@users.noreply.github.com>

* Update curriculum/challenges/english/02-javascript-algorithms-and-data-structures/regular-expressions/check-for-all-or-none.english.md

Co-Authored-By: Shaun Hamilton <51722130+Sky020@users.noreply.github.com>

* Update curriculum/challenges/english/02-javascript-algorithms-and-data-structures/regular-expressions/check-for-all-or-none.english.md

Co-Authored-By: Shaun Hamilton <51722130+Sky020@users.noreply.github.com>

* Update curriculum/challenges/english/02-javascript-algorithms-and-data-structures/regular-expressions/check-for-all-or-none.english.md

Co-Authored-By: Shaun Hamilton <51722130+Sky020@users.noreply.github.com>

Co-authored-by: Shaun Hamilton <51722130+Sky020@users.noreply.github.com>
2020-05-18 22:50:50 -05:00
Kimon a3b54d34cb
Differentiate between test & match (#38498)
* Differentiate between test & match

I noticed that nowhere was there a mention that .match() and .test() pass in and are applied to opposite objects.  This would've saved me a few minutes of searching during later challenges that assume this is understood.

* Add in .match & .test difference after example

* fix: add spaces to stop lint errors

Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
2020-04-25 08:35:46 -05:00
Hassaan Pasha 4fbce07792
fix: improve test regex to validate disallowed methods that can be bypassed by prototype reassignments and/or otherwise (#38214)
* fix: improve test regex to validate disallowed methods that can be bypassed by prototype reassignments and/or otherwise

* fix: fixing regex pattern
2020-03-26 08:13:34 -07:00
Vincent Shury 6920634e6c
TYPO-FIX JS-regex-match-non-whitespace-characters (#38407)
Added Markdown to correctly display second test
2020-03-20 21:13:48 -07:00
Randell Dawson 9252f96566
fix(curriculum): Consolidated comments for JavaScript Algorithms and Data Structures challenges - part 4 of 4 (#38267)
* fix: consolidate comments


Co-authored-by: Parth Parth <34807532+thecodingaviator@users.noreply.github.com>
2020-03-08 15:46:28 +01:00
Randell Dawson 6a7a7e6d7d
fix(curriculum): Consolidated comments for JavaScript Algorithms and Data Structures challenges - part 2 of 4 (#38259) 2020-03-03 10:18:30 +03:00
Igor Snitkin dc7092ecd1
(fix learn): Update description to accommodate tests (#38224) 2020-02-19 00:13:34 +05:30
Hassaan Pasha 0498e27902
fix: added white space checks including newlines to ensure pro… (#38166)
* fix: added white space checks including newlines to ensure proper validation of trim method

* fix: Addressing comments
2020-02-12 12:17:54 +05:30
Ashraf Nazar 5feabd762c
fix: Add tests to check lazy matching is applied and that the string "h1" is not matched (#38193) 2020-02-11 10:17:51 -06:00
Shubham Shah bef738f0d4
modfied tests and made correction in solution (#38023) 2020-02-06 20:31:03 -05:00
Ashraf Nazar 1159a8dcaf fix: Add edge case for mixed grouping of characters exercise, where "Frank Roosevelt" returns false (#38097) 2020-01-22 15:58:47 +05:30
Tom 1b06bb29f0 fix: allow g flag on regex (#37941) 2020-01-02 18:24:07 -07:00
Arthur 616d96f612 refactor: update trivial regex capture group find and replace challenge (#37768)
* refactor: replace trivial regex capture group challenge

Previous challenge could be completed without any capture groups. New
challenge requires 3 capture groups and 3 uses of the submatches in the
replacement.

resolves #17645

* test: validate at least 3 capture groups were used

Use solution from SO
(https://stackoverflow.com/questions/16046620/regex-to-count-the-number-of-capturing-groups-in-a-regex)
as suggested by @RandellDawson to count the number of capturing
groups, regardless of whether or not the regex in question solves the
broader problem.

Co-Authored-By: Randell Dawson <5313213+RandellDawson@users.noreply.github.com>

* refactor: more meaningful variable name

Co-Authored-By: Randell Dawson <5313213+RandellDawson@users.noreply.github.com>

* test: add parenthesized substring test

* test: ensure 3 uses of substring replacement

* refactor: reword instructions

* fix: minor grammar fix

Co-Authored-By: Manish Giri <manish.giri.me@gmail.com>

* refactor: elaborate wording in test
2019-12-14 16:41:47 -05:00
Randell Dawson 98bb2c1085 fix: added new test case to prevent invalid regex (#37769) 2019-11-25 20:25:24 -05:00
Divyanshu a987245e18 Added new test cases and corrected the solution for positive and negative lookahead for ensuring that strings beginning with numbers are not accepted (#37485)
* Added new test case '8pass99' for positive and negative lookahead

* Changed the pwRegex to reflect the new solution

* Updated the pwRegex to reflect the latest solution as on forum

* Added another test case to catch "/^(?=\w{6,})(?=\D*\d{2})/" solution
2019-11-24 17:11:20 -05:00
SomeDer bfa5c26288 fix: use dfn instead of code tag (#36640)
* Use dfn tags

* remove misused <dfn> tags

* Revert "remove misused <dfn> tags"

This reverts commit b24968a968.

* Update curriculum/challenges/english/01-responsive-web-design/basic-html-and-html5/fill-in-the-blank-with-placeholder-text.english.md

Co-Authored-By: Randell Dawson <5313213+RandellDawson@users.noreply.github.com>

* Make "array" lowercase

Co-Authored-By: Randell Dawson <5313213+RandellDawson@users.noreply.github.com>

* Fix dfn usage

* Address last dfn tags
2019-10-27 12:45:37 -04:00
Chayanon Tonsai 8b082995b5 Change test method from string.test(regex) to regex.test(string) (#37458) 2019-10-23 09:32:17 -05:00
Randell Dawson 568f00e02a fix(curriculum): Added forumTopicId to remaining 1200 challeng… (#36558) 2019-08-05 22:14:37 +05:30
Randell Dawson 3ec1fe8ea7 feat: add forumTopicId to challenge frontmatter [pre-existing]
This commit adds the pre-existing challenge guide topics in the
forum to the forntmatter of their challenge markdown files.
2019-08-05 22:14:37 +05:30
Randell Dawson ba6ae7154c fix: removed more assert msg arguments (#36439) 2019-07-28 05:16:04 +01:00
Randell Dawson 1fa0dcb1e1 fix(curriculum): Remove unnecessary assert message argument from English challenges JavaScript Algorithms and Data Structures - 04 (#36404)
* fix: rm assert msg OOP

* fix: rm assert msg regular expressions
2019-07-24 11:32:04 +02:00
Randell Dawson c387873640 fix(curriculum): added extra line before </section> tag - Engl… (#36278) 2019-07-19 15:30:17 +05:30
Tom 51b5defb7e fix/regex-upper-and-lower-bounds-tests (#36059)
* fix/regex-upper-and-lower-bounds-tests

* fix/add-solution-back

* Update curriculum/challenges/english/02-javascript-algorithms-and-data-structures/regular-expressions/specify-upper-and-lower-number-of-matches.english.md

Co-Authored-By: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
2019-06-25 14:45:20 -07:00
Randell Dawson 63a0fa745b fix: improved tests to allow more valid solutions (#36193) 2019-06-20 17:09:46 -04:00
Siddhant Shekhar c1d3817732 fix : replaced test cases' string to make more sense (#36170) 2019-06-06 15:53:31 -07:00
Tom 21118bc26a fix/regex-lower-number-of-matches (#36004)
* fix/regex-lower-number-of-matches

* fix/update-guide

* fix/convert-blockquote-to-backticks
2019-05-17 23:53:00 +01:00
Randell Dawson 05f73ca409 fix(curriculum): Convert blockquote elements to triple backtick syntax for JavaScript Algorithms and Data Structures (#35992)
* fix: convert js algorithms and data structures

* fix: revert some blocks back to blockquote

* fix: reverted comparison code block to blockquotes

* fix: change js to json

Co-Authored-By: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>

* fix: convert various section to triple backticks

* fix: Make the formatting consistent for comparisons
2019-05-17 08:20:30 -05:00
Randell Dawson a092c76688 fix: added 22 missing solutions (#35747) 2019-05-03 12:05:26 +02:00
Randell Dawson 365ce2ddc7 fix(curriculum): Added test and corrected solution for Restrict Possible Usernames challenge (#35847)
* fix: added test and corrected solution

* fix: removed redundant regex

Co-Authored-By: RandellDawson <5313213+RandellDawson@users.noreply.github.com>
2019-04-30 20:40:38 -05:00
Kristofer Koishigawa 095188215f fix(challenges): Regex Asterisk Challenge (#34800)
* fix(challenges): Fixes description and adds tests to close #17872.

* fix(challenges): Removed unnecessary string arguments from testString

* fix: improved challenge instr and tests
2019-04-01 19:19:13 +05:30
lucassorenson b0565aa8d0 Update match-anything-with-wildcard-period.english.md (#35696)
A fix for issue #35089, updated the examples in the description to use .test() instead of .match() to better reflect the challenge
2019-03-28 11:46:33 -07:00