Commit Graph

51 Commits

Author SHA1 Message Date
Oliver Eyton-Williams
260f945de8 feat: allow for dynamic hints (#44279) 2021-11-25 15:10:01 +00:00
Nicholas Carrigan (he/him)
07bfe87419 feat: add campfire mode (#42663)
* feat: add campfire mode

fix: resolve lint issues

feat: add sound to editor

fix: restore flash messages

fix: linter issues

fix: obey sound setting

Update the editor to obey the camper's sound setting.

chore: apply suggestions from code review

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

fix: use @types/store

fix: linter issues

feat: simplify sound saga

Update client/src/redux/sound-mode-saga.js

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

fix: missing bracket

chore: use new s3 bucket

fix: lint

fix: import only needed bits

fix: remove from navbar

(was intermittently broken here anyway)

fix: dynamic imports?

fix: more dynamic imports

fix: tweak theme logic

chore: boolean | undefined

fix: dns

fix: no hammer local storage

* chore: apply oliver's review suggestions

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

* fix: lost an import

Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
2021-10-27 17:50:29 -05:00
Oliver Eyton-Williams
22afdd1aad fix: stop modal appearing in steps (#43728)
* fix: stop showing completion modal on steps

* feat: submit steps with ctrl+enter

* fix: handle ctrl+enter when not focussing editor

* fix: reset tests when user types

* refactor: pass showCompletionModal as an option

Otherwise we have to write executeChallenge(true) which does not mean
what you might reasonably expect.

* fix: always executeChallenge when not on step

* fix: update frontend project show

* fix: handle missing payload

* refactor: isProjectStep -> hasEditableRegion

* refactor: more renaming

* fix: make meta.json control multifile editor use

* fix: update the challengeSchema correctly

* Update client/src/templates/Challenges/classic/editor.tsx

Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>

* fix: remove logging

Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>

Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>
2021-10-13 14:47:59 +03:00
Oliver Eyton-Williams
e118dda13a fix: order imports and remove circular dependencies (#41824)
* fix: remove circular dependency

redux depended on templates/Challenges/redux and vice versa.  This
meant that import order mattered and confusing bugs could arise.

(cherry picked from commit 7d67a4e70922bbb3051f2f9982dcc69e240d43dc)

* feat: require imports to be in alphabetical order

Import order generally does not matter, but there are edge cases
(circular  imports and css imports, for example) where changing order
changes behaviour

(cherry picked from commit b8d1393a91ec6e068caf8e8498a5c95df68c2b2c)

* chore: order imports

* fix: lift up challenge description + title comps

This brings the classic Show closer to the others as they
now all create the description and title components

* fix: remove donation-saga/index circular import

(cherry picked from commit 51a44ca668a700786d2744feffeae4fdba5fd207)

* refactor: extract action-types from settings

(cherry picked from commit 25e26124d691c84a0d0827d41dafb761c686fadd)

* fix: lint errors

* feat: prevent useless renames
2021-08-02 08:39:40 -05:00
renovate[bot]
21dd80c47a chore(deps): update dependency prettier to v2.3.0 (#42074)
* chore(deps): update dependency prettier to v2.3.0

* chore: apply formating per prettier

* fix: correctly disable import/no-unresolved

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Mrugesh Mohapatra <hi@mrugesh.dev>
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
2021-05-10 08:48:49 -07:00
Oliver Eyton-Williams
2eac236e39 fix: remove JS comments revisited (#41952)
* fix: restrict removeJSComments to test-evaluator

To prevent @babel from being included everywhere, this only calls
removeJSComments inside the test-evaluator

* test: add removeJSComments test
2021-04-30 22:30:06 +03:00
Oliver Eyton-Williams
9be2fb9a10 fix: use lodash-es in the client (#41931) 2021-04-28 16:11:20 -05:00
Evgeny Klimenchenko
db369fbed1 fix(client): remove JS comments from user code for tests (#41873)
* Removes comments in js challanges by default

* fix local-scope-and-functions test regex

* fix all languages

* revert language changes

* removed unnecessary removeJSComments from challenges

* fix challanges in other languages

* removed removeJSComments from all challanges
2021-04-28 10:18:54 -05:00
Mrugesh Mohapatra
6c91f81b0e chore(deps): upgrade eslint, prettier & related packages 2021-03-11 12:19:42 +05:30
Shaun Hamilton
ab83d698f9 fix(client): give useful error in solutionform (#40225) 2021-02-01 19:04:04 +05:30
Tom
3978c6be28 feat: i18n user interface (#40306)
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
2021-01-31 12:15:32 +05:30
Oliver Eyton-Williams
de55527693 fix: prevent preview-tests race condition (#39286) 2020-07-20 08:33:56 -07:00
Oliver Eyton-Williams
c6eb40ceef feat: remove protection from interview prep (#38136)
The interview prep section includes many challenges that require long
running calculations which can be mistaken for infinite loops. This
removes the loop protection from those challenges, while the tests are
being evaluated.

It keeps the protection for the preview, since it is easy to create
broken code while working on a challenge and that should not crash the
site.
2020-02-04 10:33:56 +05:30
vanya829
d626e898ee fix(curriculum): stop tests running after navigating away (#38146) 2020-02-03 18:52:49 +05:30
Oliver Eyton-Williams
f5feff386a fix: stop user code after 500ms of execution
Code like `var xs = []; while(true){ xs.push(1) }` can quickly run the
browser out of memory causing it to crash.  These changes stop user loops
from running indefinitely so that common mistakes will no longer cause
the browser to crash.

Also, the user is informed if a long running loop is detected (js and
jsx challenges) during preview or testing.  Before this there was no
protection for js challenges and no information was given to the
user if they had created such a loop.

Co-Authored-By: Tom <20648924+moT01@users.noreply.github.com>
Co-Authored-By: mrugesh <1884376+raisedadead@users.noreply.github.com>
Co-Authored-By: Randell Dawson <5313213+RandellDawson@users.noreply.github.com>
2020-01-03 11:41:52 +05:30
Oliver Eyton-Williams
e5abfa15ad Revert "fix: stop user code after 100ms of execution" (#37965)
This reverts commit 01b37f664f.
2019-12-21 11:09:32 +05:30
Oliver Eyton-Williams
01b37f664f fix: stop user code after 100ms of execution (#37841)
Co-authored-by: mrugesh <1884376+raisedadead@users.noreply.github.com>
Co-authored-by: Randell Dawson <5313213+RandellDawson@users.noreply.github.com>
Co-authored-by: Tom <20648924+moT01@users.noreply.github.com>
2019-12-20 19:28:17 +05:30
Oliver Eyton-Williams
febba792e7 fix: allow log in testString, restrict test errors
Console logs from testString get reported and test errors are sent to
the dev console (JS).

challenge building is only attempted if there is a build function to do
so.

Various functions have been renamed to better reflect what they do.
2019-11-19 22:23:57 +05:30
Oliver Eyton-Williams
9194b7731b fix: simplify logging and include console.log
This comes at the cost of creating a flash of the default message when
the preview updates, but significantly simplifies the code.
2019-11-19 22:23:57 +05:30
Oliver Eyton-Williams
beecb04c1a fix: report errors thrown after the frame is ready
Certain challenges involve code that is not run until the user
interacts with the preview (typically via a click listener). This uses
consoleProxy to report those errors.

Error logging has been simplified, reducing the number of places errors
can be reported from.

Some of the redux-saga code has been renamed in an attempt to improve
clarity.
2019-11-19 22:23:57 +05:30
Oliver Eyton-Williams
04d2de96df fix: conditionally log non-assertion errors (JS)
console.logs and errors are only reported during the first evaluation of
the user's code.  This is because the code is evaluated for each test,
but the logs will not change between the build phases of the tests.

Errors thrown during testing (except failing assertions) are always
reported. This is to inform the user that their code is faulty, rather
than that it does not meet the challenge's requirements.
2019-11-19 22:23:57 +05:30
Oliver Eyton-Williams
64fcbbb491 fix: output console.logs as user types (JS) 2019-11-19 22:23:57 +05:30
Oliver Eyton-Williams
29641986ab fix: output console.logs as user types (DOM)
Any console.logs inside script tags will be written to the fcc console
as the user types.  DOM challenges only.

Also, DRYed out the main and test frame creation.
2019-11-19 22:23:57 +05:30
Oliver Eyton-Williams
5059d23600 fix: report all build errors to the fcc console
Previously only challenges with previews would inform the user of syntax
errors.  This extends that to all challenges and corrects the output
format so errors are clearer.
2019-11-19 22:23:57 +05:30
Oliver Eyton-Williams
c6a11dd50a fix: escape HTML entities in code editor log (#37601) 2019-10-31 17:56:10 +05:30
ValeraS
08403ca561 chore(client): update redux-saga 2019-06-12 02:49:29 +05:30
Oliver Eyton-Williams
60dd7ca703 fix: Change test output formatting from code to html (#35857) 2019-06-09 05:28:10 +05:30
Steven Failla
43a4fa8cb0 fix(client): reset test results before execution (#36029)
* fixed issue where tests should fail when code has error

Signed-off-by: Stevo99 <Sfailla1983@gmail.com>

* fix(client): Initialize tests as failing in case of build errors

* fix: Reset tests to initial state when build fails

* fix: simplify expression
2019-05-27 00:00:12 +03:00
Valeriy S
4c252654a4 fix(client): refactor a challenge preview saga 2019-02-16 17:48:37 +00:00
Valeriy S
98f979f3b4 fix(client): disable build on error 2019-02-16 17:48:37 +00:00
Valeriy
dd41028f5b fix(client): replace decodeHTMLEntities to entities package 2019-01-28 12:02:45 +00:00
Valeriy S
3d008c69d7 fix(learn): on user code execution error, run tests anyway 2019-01-16 10:45:39 +00:00
Valeriy
00a1d25fbb feat(learn): lazy load Enzyme in the test frame 2019-01-16 10:45:39 +00:00
Valeriy S
b6e24d4e14 fix(client): add debounce time for a preview 2019-01-14 13:44:54 +00:00
Valeriy
7bfc733da6 fix(client): remove a dependency on the store from build challenges 2019-01-14 13:44:54 +00:00
Valeriy
d263ed4ed7 fix: use document from store context 2019-01-14 13:44:54 +00:00
Valeriy
b59c7cfed0 fix: remove state dependency from frame creation 2019-01-14 13:44:54 +00:00
Valeriy
dcca74ab92 fix: use factory method to create worker executor 2019-01-14 13:44:54 +00:00
Valeriy S
2168b61151 fix: unify build of challenges 2019-01-14 13:44:54 +00:00
Valeriy S
2297881f91 fix: pass proxyLogger to params 2019-01-14 13:44:54 +00:00
Valeriy S
3654f2a971 fix(client): wait for a ready event in jQuery challenges 2019-01-14 13:44:54 +00:00
Valeriy S
7df4d06056 fix(client): refactor a test runner 2019-01-14 13:44:54 +00:00
Valeriy S
de7798c753 fix(client): use proxy logger in test worker 2019-01-14 13:44:54 +00:00
Valeriy S
c43dfe1eb7 feat(client): execute backend challenge saga 2019-01-14 13:44:54 +00:00
Valeriy S
6d7744646d feat(client): extract common tests execution logic 2019-01-14 13:44:54 +00:00
Valeriy S
0775766702 fix(client): log to console saga 2019-01-14 13:44:54 +00:00
Valeriy
a50a048ee7 feat(client): execute DOM challenge saga 2019-01-14 13:44:54 +00:00
Valeriy S
0a7ac8935e fix: extract a test updating logic and logging 2018-12-06 13:05:09 +00:00
Valeriy S
779d2034f3 fix: perform the latest run and cancel previous 2018-12-06 13:05:09 +00:00
Valeriy S
8a6611db3a fix: use common saga to execute challenges 2018-12-06 13:05:09 +00:00