From 9b2d5bfcd7702730b5c4688e9f158b261cd11b8f Mon Sep 17 00:00:00 2001 From: camperbot Date: Mon, 16 Sep 2024 14:01:58 +0000 Subject: [PATCH] chore(i18n,learn): processed translations --- .../build-a-periodic-table-database.md | 2 +- .../5f3ef6e0a81099d9a697b550.md | 8 + .../introduction-flexbox-lesson-j.md | 6 +- .../introduction-flexbox-lesson-k.md | 6 +- .../learn-block-and-inline-lesson-b.md | 6 +- .../learn-block-and-inline-lesson-g.md | 2 +- ...problems-and-understand-errors-lesson-a.md | 6 +- ...problems-and-understand-errors-lesson-b.md | 6 +- ...problems-and-understand-errors-lesson-c.md | 6 +- .../657b69e10d6606a0185d4d4f.md | 2 +- .../657dce8ff35869721311a5e3.md | 2 +- .../657dcee413423174ca3747f5.md | 2 +- .../5f1a4ef5d5d6b5ab580fc6ae.md | 25 + .../5a8b073d06fa14fcfde687aa.md | 611 ++++++++++++++++++ .../602da04c22201c65d2a019f4.md | 25 + .../bd7158d8c443edefaeb5bdff.md | 65 ++ .../bd7158d8c443edefaeb5bd0e.md | 107 +++ .../5f9771307d4d22b9d2b75a94.md | 25 + .../66a96127422411756204bc1b.md | 4 +- .../66a962954f4e0d76223b37ed.md | 2 +- .../66a972137acd1179fa3fe8a0.md | 2 +- .../66a97ca8c4cbae7d0bb6e0ad.md | 2 +- .../66c8ba41a77db20a93f9d7a1.md | 71 ++ .../66c8ba975ee7230e29f6c4ac.md | 53 ++ .../66c8ba975ee7230e29f6c4ad.md | 55 ++ .../66c8ba975ee7230e29f6c4af.md | 56 ++ .../66c8ba975ee7230e29f6c4b0.md | 56 ++ .../66c8ba975ee7230e29f6c4b1.md | 54 ++ .../66c8ba975ee7230e29f6c4b2.md | 165 +++++ .../5f2c289f164c29556da632fd.md | 19 + .../587d7fb3367417b2b2512bfb.md | 53 ++ .../587d7fb3367417b2b2512bfc.md | 43 ++ .../587d7fb4367417b2b2512bfd.md | 75 +++ .../587d7fb4367417b2b2512bfe.md | 39 ++ .../587d7fb4367417b2b2512bff.md | 37 ++ .../587d7fb4367417b2b2512c00.md | 68 ++ .../587d7fb5367417b2b2512c01.md | 64 ++ .../587d7fb5367417b2b2512c02.md | 66 ++ .../587d7fb5367417b2b2512c03.md | 66 ++ .../587d7fb5367417b2b2512c04.md | 43 ++ .../build-a-periodic-table-database.md | 2 +- .../5f3ef6e0a81099d9a697b550.md | 8 + .../646de7b64467e96b7d35b5cd.md | 2 +- .../introduction-flexbox-lesson-j.md | 6 +- .../introduction-flexbox-lesson-k.md | 6 +- .../learn-block-and-inline-lesson-b.md | 6 +- .../learn-block-and-inline-lesson-g.md | 2 +- ...problems-and-understand-errors-lesson-a.md | 6 +- ...problems-and-understand-errors-lesson-b.md | 6 +- ...problems-and-understand-errors-lesson-c.md | 6 +- .../657b69e10d6606a0185d4d4f.md | 2 +- .../657dce8ff35869721311a5e3.md | 2 +- .../657dcee413423174ca3747f5.md | 2 +- .../5f1a4ef5d5d6b5ab580fc6ae.md | 25 + .../5a8b073d06fa14fcfde687aa.md | 611 ++++++++++++++++++ .../602da04c22201c65d2a019f4.md | 25 + .../bd7158d8c443edefaeb5bdff.md | 65 ++ .../bd7158d8c443edefaeb5bd0e.md | 107 +++ .../5f9771307d4d22b9d2b75a94.md | 25 + .../66a96127422411756204bc1b.md | 4 +- .../66a962954f4e0d76223b37ed.md | 2 +- .../66a972137acd1179fa3fe8a0.md | 2 +- .../66a97ca8c4cbae7d0bb6e0ad.md | 2 +- .../66c8ba41a77db20a93f9d7a1.md | 71 ++ .../66c8ba975ee7230e29f6c4ac.md | 53 ++ .../66c8ba975ee7230e29f6c4ad.md | 55 ++ .../66c8ba975ee7230e29f6c4af.md | 56 ++ .../66c8ba975ee7230e29f6c4b0.md | 56 ++ .../66c8ba975ee7230e29f6c4b1.md | 54 ++ .../66c8ba975ee7230e29f6c4b2.md | 165 +++++ .../5f2c289f164c29556da632fd.md | 19 + .../587d7fb3367417b2b2512bfb.md | 53 ++ .../587d7fb3367417b2b2512bfc.md | 43 ++ .../587d7fb4367417b2b2512bfd.md | 75 +++ .../587d7fb4367417b2b2512bfe.md | 39 ++ .../587d7fb4367417b2b2512bff.md | 37 ++ .../587d7fb4367417b2b2512c00.md | 68 ++ .../587d7fb5367417b2b2512c01.md | 64 ++ .../587d7fb5367417b2b2512c02.md | 66 ++ .../587d7fb5367417b2b2512c03.md | 66 ++ .../587d7fb5367417b2b2512c04.md | 43 ++ .../build-a-periodic-table-database.md | 2 +- .../5f3ef6e0a81099d9a697b550.md | 8 + .../646de7b64467e96b7d35b5cd.md | 2 +- .../introduction-flexbox-lesson-j.md | 6 +- .../introduction-flexbox-lesson-k.md | 6 +- .../learn-block-and-inline-lesson-b.md | 6 +- .../learn-block-and-inline-lesson-g.md | 2 +- ...problems-and-understand-errors-lesson-a.md | 6 +- ...problems-and-understand-errors-lesson-b.md | 6 +- ...problems-and-understand-errors-lesson-c.md | 6 +- .../657b69e10d6606a0185d4d4f.md | 2 +- .../657dce8ff35869721311a5e3.md | 2 +- .../657dcee413423174ca3747f5.md | 2 +- .../5f1a4ef5d5d6b5ab580fc6ae.md | 25 + .../5a8b073d06fa14fcfde687aa.md | 611 ++++++++++++++++++ .../602da04c22201c65d2a019f4.md | 25 + .../bd7158d8c443edefaeb5bdff.md | 65 ++ .../bd7158d8c443edefaeb5bd0e.md | 107 +++ .../5f9771307d4d22b9d2b75a94.md | 25 + .../66a96127422411756204bc1b.md | 4 +- .../66a962954f4e0d76223b37ed.md | 2 +- .../66a972137acd1179fa3fe8a0.md | 2 +- .../66a97ca8c4cbae7d0bb6e0ad.md | 2 +- .../66c8ba41a77db20a93f9d7a1.md | 71 ++ .../66c8ba975ee7230e29f6c4ac.md | 53 ++ .../66c8ba975ee7230e29f6c4ad.md | 55 ++ .../66c8ba975ee7230e29f6c4af.md | 56 ++ .../66c8ba975ee7230e29f6c4b0.md | 56 ++ .../66c8ba975ee7230e29f6c4b1.md | 54 ++ .../66c8ba975ee7230e29f6c4b2.md | 165 +++++ .../5f2c289f164c29556da632fd.md | 19 + .../587d7fb3367417b2b2512bfb.md | 53 ++ .../587d7fb3367417b2b2512bfc.md | 43 ++ .../587d7fb4367417b2b2512bfd.md | 75 +++ .../587d7fb4367417b2b2512bfe.md | 39 ++ .../587d7fb4367417b2b2512bff.md | 37 ++ .../587d7fb4367417b2b2512c00.md | 68 ++ .../587d7fb5367417b2b2512c01.md | 64 ++ .../587d7fb5367417b2b2512c02.md | 66 ++ .../587d7fb5367417b2b2512c03.md | 66 ++ .../587d7fb5367417b2b2512c04.md | 43 ++ ...of-audio-content-with-the-audio-element.md | 2 +- .../create-movement-using-css-animation.md | 2 +- ...by-fading-an-element-from-left-to-right.md | 2 +- .../basic-css/style-the-html-body-element.md | 2 +- .../add-columns-with-grid-template-columns.md | 2 +- .../basic-javascript/record-collection.md | 4 +- ...visualize-data-with-a-scatterplot-graph.md | 2 +- .../serialization-of-a-user-object.md | 2 +- ...ality-with-.deepequal-and-.notdeepequal.md | 4 +- .../compare-the-properties-of-two-elements.md | 4 +- .../learn-how-javascript-assertions-work.md | 4 +- ...sponse-using-chai-http-iii---put-method.md | 2 +- ...-tests-on-api-endpoints-using-chai-http.md | 12 +- ...ional-tests-using-a-headless-browser-ii.md | 2 +- ...nctional-tests-using-a-headless-browser.md | 2 +- .../test-for-truthiness.md | 4 +- .../test-if-a-value-is-an-array.md | 4 +- .../test-if-an-object-has-a-property.md | 4 +- ...-object-is-an-instance-of-a-constructor.md | 4 +- ...s-below-or-at-least-as-large-as-another.md | 2 +- .../use-assert.isok-and-assert.isnotok.md | 4 +- ...se-regular-expressions-to-test-a-string.md | 4 +- ...triple-equals-to-assert-strict-equality.md | 4 +- .../american-british-translator.md | 4 +- .../issue-tracker.md | 6 +- .../metric-imperial-converter.md | 86 +-- .../medical-data-visualizer.md | 6 +- .../page-view-time-series-visualizer.md | 8 +- .../port-scanner.md | 2 +- .../secure-real-time-multiplayer-game.md | 2 +- ...client-side-caching-with-helmet.nocache.md | 2 +- ...sh-and-compare-passwords-asynchronously.md | 2 +- ...ash-and-compare-passwords-synchronously.md | 2 +- ...-information-using-helmet.hidepoweredby.md | 2 +- .../install-and-require-helmet.md | 2 +- ...pting-xss-attacks-with-helmet.xssfilter.md | 4 +- ...ing-untrusted-html-with-helmet.ienoopen.md | 4 +- ...olicy-with-helmet.contentsecuritypolicy.md | 16 +- ...d-a-new-element-to-a-binary-search-tree.md | 2 +- .../take-home-projects/build-a-pong-game.md | 8 +- .../take-home-projects/build-a-recipe-box.md | 18 +- .../chart-the-stock-market.md | 12 +- .../use-the-twitch-json-api.md | 18 +- .../neural-network-sms-text-classifier.md | 12 +- ...earning-algorithms-hidden-markov-models.md | 10 +- .../tensorflow/core-learning-algorithms.md | 2 +- ...roduction-machine-learning-fundamentals.md | 10 +- ...processing-with-rnns-training-the-model.md | 4 +- .../tensorflow/neural-networks-optimizers.md | 10 +- .../neural-networks-with-tensorflow.md | 12 +- .../build-a-periodic-table-database.md | 2 +- .../5f3ef6e0a81099d9a697b550.md | 8 + .../introduction-flexbox-lesson-j.md | 6 +- .../introduction-flexbox-lesson-k.md | 6 +- .../learn-block-and-inline-lesson-b.md | 6 +- .../learn-block-and-inline-lesson-g.md | 2 +- ...problems-and-understand-errors-lesson-a.md | 6 +- ...problems-and-understand-errors-lesson-b.md | 6 +- ...problems-and-understand-errors-lesson-c.md | 6 +- .../657b69e10d6606a0185d4d4f.md | 2 +- .../657dce8ff35869721311a5e3.md | 2 +- .../657dcee413423174ca3747f5.md | 2 +- .../5f1a4ef5d5d6b5ab580fc6ae.md | 25 + .../5a8b073d06fa14fcfde687aa.md | 611 ++++++++++++++++++ .../602da04c22201c65d2a019f4.md | 25 + .../bd7158d8c443edefaeb5bdff.md | 65 ++ .../bd7158d8c443edefaeb5bd0e.md | 107 +++ .../5f9771307d4d22b9d2b75a94.md | 25 + .../66a96127422411756204bc1b.md | 4 +- .../66a962954f4e0d76223b37ed.md | 2 +- .../66a972137acd1179fa3fe8a0.md | 2 +- .../66a97ca8c4cbae7d0bb6e0ad.md | 2 +- .../66c8ba41a77db20a93f9d7a1.md | 71 ++ .../66c8ba975ee7230e29f6c4ac.md | 53 ++ .../66c8ba975ee7230e29f6c4ad.md | 55 ++ .../66c8ba975ee7230e29f6c4af.md | 56 ++ .../66c8ba975ee7230e29f6c4b0.md | 56 ++ .../66c8ba975ee7230e29f6c4b1.md | 54 ++ .../66c8ba975ee7230e29f6c4b2.md | 165 +++++ .../5f2c289f164c29556da632fd.md | 19 + .../587d7fb3367417b2b2512bfb.md | 53 ++ .../587d7fb3367417b2b2512bfc.md | 43 ++ .../587d7fb4367417b2b2512bfd.md | 75 +++ .../587d7fb4367417b2b2512bfe.md | 39 ++ .../587d7fb4367417b2b2512bff.md | 37 ++ .../587d7fb4367417b2b2512c00.md | 68 ++ .../587d7fb5367417b2b2512c01.md | 64 ++ .../587d7fb5367417b2b2512c02.md | 66 ++ .../587d7fb5367417b2b2512c03.md | 66 ++ .../587d7fb5367417b2b2512c04.md | 43 ++ .../build-a-periodic-table-database.md | 2 +- .../5f3ef6e0a81099d9a697b550.md | 8 + .../introduction-flexbox-lesson-j.md | 6 +- .../introduction-flexbox-lesson-k.md | 6 +- .../learn-block-and-inline-lesson-b.md | 6 +- .../learn-block-and-inline-lesson-g.md | 2 +- ...problems-and-understand-errors-lesson-a.md | 6 +- ...problems-and-understand-errors-lesson-b.md | 6 +- ...problems-and-understand-errors-lesson-c.md | 6 +- .../657b69e10d6606a0185d4d4f.md | 2 +- .../657dce8ff35869721311a5e3.md | 2 +- .../657dcee413423174ca3747f5.md | 2 +- .../5f1a4ef5d5d6b5ab580fc6ae.md | 25 + .../5a8b073d06fa14fcfde687aa.md | 611 ++++++++++++++++++ .../602da04c22201c65d2a019f4.md | 25 + .../bd7158d8c443edefaeb5bdff.md | 65 ++ .../bd7158d8c443edefaeb5bd0e.md | 107 +++ .../5f9771307d4d22b9d2b75a94.md | 25 + .../66a96127422411756204bc1b.md | 4 +- .../66a962954f4e0d76223b37ed.md | 2 +- .../66a972137acd1179fa3fe8a0.md | 2 +- .../66a97ca8c4cbae7d0bb6e0ad.md | 2 +- .../66c8ba41a77db20a93f9d7a1.md | 71 ++ .../66c8ba975ee7230e29f6c4ac.md | 53 ++ .../66c8ba975ee7230e29f6c4ad.md | 55 ++ .../66c8ba975ee7230e29f6c4af.md | 56 ++ .../66c8ba975ee7230e29f6c4b0.md | 56 ++ .../66c8ba975ee7230e29f6c4b1.md | 54 ++ .../66c8ba975ee7230e29f6c4b2.md | 165 +++++ .../5f2c289f164c29556da632fd.md | 19 + .../587d7fb3367417b2b2512bfb.md | 53 ++ .../587d7fb3367417b2b2512bfc.md | 43 ++ .../587d7fb4367417b2b2512bfd.md | 75 +++ .../587d7fb4367417b2b2512bfe.md | 39 ++ .../587d7fb4367417b2b2512bff.md | 37 ++ .../587d7fb4367417b2b2512c00.md | 68 ++ .../587d7fb5367417b2b2512c01.md | 64 ++ .../587d7fb5367417b2b2512c02.md | 66 ++ .../587d7fb5367417b2b2512c03.md | 66 ++ .../587d7fb5367417b2b2512c04.md | 43 ++ .../build-a-periodic-table-database.md | 2 +- .../5f3ef6e0a81099d9a697b550.md | 8 + .../introduction-flexbox-lesson-j.md | 6 +- .../introduction-flexbox-lesson-k.md | 6 +- .../learn-block-and-inline-lesson-b.md | 6 +- .../learn-block-and-inline-lesson-g.md | 2 +- ...problems-and-understand-errors-lesson-a.md | 6 +- ...problems-and-understand-errors-lesson-b.md | 6 +- ...problems-and-understand-errors-lesson-c.md | 6 +- .../657b69e10d6606a0185d4d4f.md | 2 +- .../657dce8ff35869721311a5e3.md | 2 +- .../657dcee413423174ca3747f5.md | 2 +- .../5f1a4ef5d5d6b5ab580fc6ae.md | 25 + .../5a8b073d06fa14fcfde687aa.md | 611 ++++++++++++++++++ .../602da04c22201c65d2a019f4.md | 25 + .../bd7158d8c443edefaeb5bdff.md | 65 ++ .../bd7158d8c443edefaeb5bd0e.md | 107 +++ .../5f9771307d4d22b9d2b75a94.md | 25 + .../66a96127422411756204bc1b.md | 4 +- .../66a962954f4e0d76223b37ed.md | 2 +- .../66a972137acd1179fa3fe8a0.md | 2 +- .../66a97ca8c4cbae7d0bb6e0ad.md | 2 +- .../66c8ba41a77db20a93f9d7a1.md | 71 ++ .../66c8ba975ee7230e29f6c4ac.md | 53 ++ .../66c8ba975ee7230e29f6c4ad.md | 55 ++ .../66c8ba975ee7230e29f6c4af.md | 56 ++ .../66c8ba975ee7230e29f6c4b0.md | 56 ++ .../66c8ba975ee7230e29f6c4b1.md | 54 ++ .../66c8ba975ee7230e29f6c4b2.md | 165 +++++ .../5f2c289f164c29556da632fd.md | 19 + .../587d7fb3367417b2b2512bfb.md | 53 ++ .../587d7fb3367417b2b2512bfc.md | 43 ++ .../587d7fb4367417b2b2512bfd.md | 75 +++ .../587d7fb4367417b2b2512bfe.md | 39 ++ .../587d7fb4367417b2b2512bff.md | 37 ++ .../587d7fb4367417b2b2512c00.md | 68 ++ .../587d7fb5367417b2b2512c01.md | 64 ++ .../587d7fb5367417b2b2512c02.md | 66 ++ .../587d7fb5367417b2b2512c03.md | 66 ++ .../587d7fb5367417b2b2512c04.md | 43 ++ .../build-a-periodic-table-database.md | 2 +- .../5f3ef6e0a81099d9a697b550.md | 8 + .../introduction-flexbox-lesson-j.md | 6 +- .../introduction-flexbox-lesson-k.md | 6 +- .../learn-block-and-inline-lesson-b.md | 6 +- .../learn-block-and-inline-lesson-g.md | 2 +- ...problems-and-understand-errors-lesson-a.md | 6 +- ...problems-and-understand-errors-lesson-b.md | 6 +- ...problems-and-understand-errors-lesson-c.md | 6 +- .../657b69e10d6606a0185d4d4f.md | 2 +- .../657dce8ff35869721311a5e3.md | 2 +- .../657dcee413423174ca3747f5.md | 2 +- .../5f1a4ef5d5d6b5ab580fc6ae.md | 25 + .../5a8b073d06fa14fcfde687aa.md | 611 ++++++++++++++++++ .../602da04c22201c65d2a019f4.md | 25 + .../bd7158d8c443edefaeb5bdff.md | 65 ++ .../bd7158d8c443edefaeb5bd0e.md | 107 +++ .../5f9771307d4d22b9d2b75a94.md | 25 + .../66a96127422411756204bc1b.md | 4 +- .../66a962954f4e0d76223b37ed.md | 2 +- .../66a972137acd1179fa3fe8a0.md | 2 +- .../66a97ca8c4cbae7d0bb6e0ad.md | 2 +- .../66c8ba41a77db20a93f9d7a1.md | 71 ++ .../66c8ba975ee7230e29f6c4ac.md | 53 ++ .../66c8ba975ee7230e29f6c4ad.md | 55 ++ .../66c8ba975ee7230e29f6c4af.md | 56 ++ .../66c8ba975ee7230e29f6c4b0.md | 56 ++ .../66c8ba975ee7230e29f6c4b1.md | 54 ++ .../66c8ba975ee7230e29f6c4b2.md | 165 +++++ .../5f2c289f164c29556da632fd.md | 19 + .../587d7fb3367417b2b2512bfb.md | 53 ++ .../587d7fb3367417b2b2512bfc.md | 43 ++ .../587d7fb4367417b2b2512bfd.md | 75 +++ .../587d7fb4367417b2b2512bfe.md | 39 ++ .../587d7fb4367417b2b2512bff.md | 37 ++ .../587d7fb4367417b2b2512c00.md | 68 ++ .../587d7fb5367417b2b2512c01.md | 64 ++ .../587d7fb5367417b2b2512c02.md | 66 ++ .../587d7fb5367417b2b2512c03.md | 66 ++ .../587d7fb5367417b2b2512c04.md | 43 ++ .../chunky-monkey.md | 16 +- .../factorialize-a-number.md | 22 +- .../find-the-longest-word-in-a-string.md | 18 +- .../finders-keepers.md | 8 +- .../basic-algorithm-scripting/mutations.md | 34 +- .../repeat-a-string-repeat-a-string.md | 20 +- .../return-largest-numbers-in-arrays.md | 14 +- .../reverse-a-string.md | 14 +- .../slice-and-splice.md | 22 +- .../truncate-a-string.md | 16 +- .../where-do-i-belong.md | 40 +- .../build-a-periodic-table-database.md | 2 +- .../5f3ef6e0a81099d9a697b550.md | 8 + .../introduction-flexbox-lesson-j.md | 6 +- .../introduction-flexbox-lesson-k.md | 6 +- .../learn-block-and-inline-lesson-b.md | 6 +- .../learn-block-and-inline-lesson-g.md | 2 +- ...problems-and-understand-errors-lesson-a.md | 6 +- ...problems-and-understand-errors-lesson-b.md | 6 +- ...problems-and-understand-errors-lesson-c.md | 6 +- .../657b69e10d6606a0185d4d4f.md | 2 +- .../657dce8ff35869721311a5e3.md | 2 +- .../657dcee413423174ca3747f5.md | 2 +- .../5f1a4ef5d5d6b5ab580fc6ae.md | 25 + .../5a8b073d06fa14fcfde687aa.md | 611 ++++++++++++++++++ .../602da04c22201c65d2a019f4.md | 25 + .../bd7158d8c443edefaeb5bdff.md | 65 ++ .../bd7158d8c443edefaeb5bd0e.md | 107 +++ .../5f9771307d4d22b9d2b75a94.md | 25 + .../66a96127422411756204bc1b.md | 4 +- .../66a962954f4e0d76223b37ed.md | 2 +- .../66a972137acd1179fa3fe8a0.md | 2 +- .../66a97ca8c4cbae7d0bb6e0ad.md | 2 +- .../66c8ba41a77db20a93f9d7a1.md | 71 ++ .../66c8ba975ee7230e29f6c4ac.md | 53 ++ .../66c8ba975ee7230e29f6c4ad.md | 55 ++ .../66c8ba975ee7230e29f6c4af.md | 56 ++ .../66c8ba975ee7230e29f6c4b0.md | 56 ++ .../66c8ba975ee7230e29f6c4b1.md | 54 ++ .../66c8ba975ee7230e29f6c4b2.md | 165 +++++ .../5f2c289f164c29556da632fd.md | 19 + .../587d7fb3367417b2b2512bfb.md | 53 ++ .../587d7fb3367417b2b2512bfc.md | 43 ++ .../587d7fb4367417b2b2512bfd.md | 75 +++ .../587d7fb4367417b2b2512bfe.md | 39 ++ .../587d7fb4367417b2b2512bff.md | 37 ++ .../587d7fb4367417b2b2512c00.md | 68 ++ .../587d7fb5367417b2b2512c01.md | 64 ++ .../587d7fb5367417b2b2512c02.md | 66 ++ .../587d7fb5367417b2b2512c03.md | 66 ++ .../587d7fb5367417b2b2512c04.md | 43 ++ .../build-a-periodic-table-database.md | 2 +- .../5f3ef6e0a81099d9a697b550.md | 8 + .../introduction-flexbox-lesson-a.md | 34 +- .../introduction-flexbox-lesson-c.md | 12 +- .../introduction-flexbox-lesson-d.md | 14 +- .../introduction-flexbox-lesson-e.md | 22 +- .../introduction-flexbox-lesson-i.md | 20 +- .../introduction-flexbox-lesson-j.md | 30 +- .../introduction-flexbox-lesson-k.md | 6 +- .../learn-arrays-and-loops-lesson-a.md | 16 +- .../learn-arrays-and-loops-lesson-c.md | 20 +- .../learn-arrays-and-loops-lesson-d.md | 22 +- .../learn-arrays-and-loops-lesson-e.md | 10 +- .../learn-arrays-and-loops-lesson-f.md | 8 +- .../learn-block-and-inline-lesson-b.md | 6 +- .../learn-block-and-inline-lesson-d.md | 12 +- .../learn-block-and-inline-lesson-e.md | 14 +- .../learn-block-and-inline-lesson-f.md | 12 +- .../learn-block-and-inline-lesson-g.md | 2 +- .../learn-block-and-inline-lesson-i.md | 10 +- .../learn-block-and-inline-lesson-j.md | 14 +- .../learn-block-and-inline-lesson-k.md | 14 +- .../css-foundations-lesson-a.md | 12 +- .../css-foundations-lesson-d.md | 16 +- .../css-foundations-lesson-e.md | 18 +- .../css-foundations-lesson-f.md | 26 +- .../css-foundations-lesson-g.md | 16 +- .../the-cascade-of-css-lesson-a.md | 18 +- .../the-cascade-of-css-lesson-e.md | 16 +- .../the-cascade-of-css-lesson-f.md | 10 +- .../the-cascade-of-css-lesson-g.md | 18 +- ...rn-data-types-and-conditionals-lesson-a.md | 20 +- ...rn-data-types-and-conditionals-lesson-b.md | 12 +- ...rn-data-types-and-conditionals-lesson-e.md | 10 +- ...rn-data-types-and-conditionals-lesson-f.md | 24 +- ...rn-data-types-and-conditionals-lesson-g.md | 22 +- ...rn-data-types-and-conditionals-lesson-h.md | 12 +- ...rn-data-types-and-conditionals-lesson-k.md | 18 +- ...rn-data-types-and-conditionals-lesson-l.md | 10 +- .../learn-function-basics-lesson-c.md | 12 +- .../learn-function-basics-lesson-d.md | 20 +- .../learn-function-basics-lesson-e.md | 18 +- .../learn-function-basics-lesson-f.md | 18 +- .../html-foundations-lesson-a.md | 22 +- .../html-foundations-lesson-c.md | 30 +- .../html-foundations-lesson-e.md | 30 +- .../html-foundations-lesson-f.md | 20 +- .../html-foundations-lesson-g.md | 12 +- ...problems-and-understand-errors-lesson-a.md | 30 +- ...problems-and-understand-errors-lesson-b.md | 36 +- ...problems-and-understand-errors-lesson-c.md | 26 +- ...problems-and-understand-errors-lesson-d.md | 16 +- ...problems-and-understand-errors-lesson-g.md | 20 +- ...problems-and-understand-errors-lesson-h.md | 20 +- .../learn-variables-and-operators-lesson-a.md | 20 +- .../learn-variables-and-operators-lesson-d.md | 8 +- .../learn-variables-and-operators-lesson-e.md | 32 +- .../learn-variables-and-operators-lesson-f.md | 32 +- .../learn-variables-and-operators-lesson-g.md | 20 +- .../learn-variables-and-operators-lesson-i.md | 42 +- .../links-and-images-lesson-a.md | 32 +- .../links-and-images-lesson-e.md | 52 +- .../links-and-images-lesson-f.md | 58 +- .../links-and-images-lesson-g.md | 52 +- .../the-box-model-lesson-c.md | 20 +- .../the-box-model-lesson-d.md | 20 +- .../the-box-model-lesson-e.md | 16 +- .../the-box-model-lesson-h.md | 14 +- .../the-box-model-lesson-i.md | 14 +- .../the-box-model-lesson-j.md | 10 +- .../the-box-model-lesson-k.md | 4 +- .../working-with-text-lesson-a.md | 20 +- .../working-with-text-lesson-b.md | 20 +- .../working-with-text-lesson-d.md | 14 +- .../working-with-text-lesson-f.md | 24 +- .../working-with-text-lesson-g.md | 10 +- .../657b69e10d6606a0185d4d4f.md | 2 +- .../657dce8ff35869721311a5e3.md | 2 +- .../657dcee413423174ca3747f5.md | 2 +- .../6543abeff5f028dba112f278.md | 10 +- .../656a509eeac7e030e2a16bab.md | 6 +- .../656a52da3392f631b9f3e022.md | 8 +- .../656cc523e668741073c4e916.md | 10 +- .../656cc6981cbf2711196a284f.md | 6 +- .../656cd63a45146d1c2c51e682.md | 18 +- .../657b1240ef768447b80817ad.md | 8 +- .../657b163c9da40e62b904be1f.md | 8 +- .../657b1e2fad2ffe84ab420a56.md | 24 +- .../657b2310b8cd52a4f15c1818.md | 18 +- .../666339cedcfb436e2c9fd550.md | 8 +- .../666339dd9d6dc46efa85c8cb.md | 10 +- .../655a54506b259313b2d59577.md | 20 +- .../657e4fc397780aa2bc046ed7.md | 20 +- .../657e77b682b49f70a3adcc0a.md | 18 +- .../651dd5a46ffb500e3f2ce47b.md | 2 +- .../657ca06716e21b803ffb55d5.md | 14 +- .../657ca59e6e559782e4c10056.md | 12 +- .../657cd6c342d0e8093dd5c540.md | 10 +- .../657daa5ab8505427a5b99cd2.md | 18 +- .../657daad61699f1281c5dca55.md | 20 +- .../5f1a4ef5d5d6b5ab580fc6ae.md | 25 + .../5a8b073d06fa14fcfde687aa.md | 611 ++++++++++++++++++ .../602da04c22201c65d2a019f4.md | 25 + .../66bb3e20d3dc5b6d0a21f5dd.md | 36 +- .../668f08ea07b99b1f4a91acab.md | 2 +- .../bd7158d8c443edefaeb5bdff.md | 65 ++ .../66c051d13a6a20255a963695.md | 72 +-- .../bd7158d8c443edefaeb5bd0e.md | 107 +++ .../5f9771307d4d22b9d2b75a94.md | 25 + .../66a33e9bd3aa213cd23d9c57.md | 2 +- .../66cc0de2920bec775f610424.md | 2 +- .../66cc281d687975858049fd8d.md | 2 +- .../66a9ca099e3ecb1be10a2696.md | 2 +- .../66add47d27763c4862492c8c.md | 2 +- .../66a96127422411756204bc1b.md | 4 +- .../66a962954f4e0d76223b37ed.md | 2 +- .../66a972137acd1179fa3fe8a0.md | 2 +- .../66a97ca8c4cbae7d0bb6e0ad.md | 2 +- .../66a9843525e9fa8046d709b7.md | 2 +- .../66c8ba41a77db20a93f9d7a1.md | 71 ++ .../66c8ba975ee7230e29f6c4ac.md | 53 ++ .../66c8ba975ee7230e29f6c4ad.md | 55 ++ .../66c8ba975ee7230e29f6c4af.md | 56 ++ .../66c8ba975ee7230e29f6c4b0.md | 56 ++ .../66c8ba975ee7230e29f6c4b1.md | 54 ++ .../66c8ba975ee7230e29f6c4b2.md | 165 +++++ .../5f2c289f164c29556da632fd.md | 19 + .../587d7fb3367417b2b2512bfb.md | 53 ++ .../587d7fb3367417b2b2512bfc.md | 43 ++ .../587d7fb4367417b2b2512bfd.md | 75 +++ .../587d7fb4367417b2b2512bfe.md | 39 ++ .../587d7fb4367417b2b2512bff.md | 37 ++ .../587d7fb4367417b2b2512c00.md | 68 ++ .../587d7fb5367417b2b2512c01.md | 64 ++ .../587d7fb5367417b2b2512c02.md | 66 ++ .../587d7fb5367417b2b2512c03.md | 66 ++ .../587d7fb5367417b2b2512c04.md | 43 ++ .../66cf13fe7619e9a1d57c7b5e.md | 14 +- .../66cf315cff4d36b27da828ba.md | 32 +- .../66cf33305293e1b35c1aef7f.md | 16 +- .../66cf34fcb005e7b447141afd.md | 22 +- .../66cf35a75f891ab4f4e5497b.md | 16 +- .../66cf3639aca119b5c00b02d3.md | 36 +- .../66d05da61ff145d7a46fe41b.md | 16 +- .../66d064c7d79408da050f8b2f.md | 22 +- .../66d068348ca093db469b4d59.md | 22 +- .../66d0746099f6f3de3678fd26.md | 22 +- .../66d076040c7d1cdf36525af9.md | 18 +- .../66d081d79b1d57e1b42caabf.md | 22 +- .../66d085d37aeffce2ef786de3.md | 8 +- .../66d8fade439d513e5f77c906.md | 16 +- .../66c72b0ffbc5522525768558.md | 2 +- .../66c748ffdfbe4f2ede268be2.md | 2 +- .../66b59be6ab830800c4df9146.md | 2 +- .../66b6e62423e8a031d6c1f03d.md | 2 +- .../66b6e80d6c3f0b329c360283.md | 2 +- .../66b7049b7709ea3a9547c79d.md | 2 +- .../build-a-periodic-table-database.md | 2 +- .../5f3ef6e0a81099d9a697b550.md | 8 + .../introduction-flexbox-lesson-j.md | 6 +- .../introduction-flexbox-lesson-k.md | 6 +- .../learn-block-and-inline-lesson-b.md | 6 +- .../learn-block-and-inline-lesson-g.md | 2 +- ...problems-and-understand-errors-lesson-a.md | 6 +- ...problems-and-understand-errors-lesson-b.md | 6 +- ...problems-and-understand-errors-lesson-c.md | 6 +- .../657b69e10d6606a0185d4d4f.md | 2 +- .../657dce8ff35869721311a5e3.md | 2 +- .../657dcee413423174ca3747f5.md | 2 +- .../5f1a4ef5d5d6b5ab580fc6ae.md | 25 + .../5a8b073d06fa14fcfde687aa.md | 611 ++++++++++++++++++ .../602da04c22201c65d2a019f4.md | 25 + .../bd7158d8c443edefaeb5bdff.md | 65 ++ .../bd7158d8c443edefaeb5bd0e.md | 107 +++ .../5f9771307d4d22b9d2b75a94.md | 25 + .../66a96127422411756204bc1b.md | 4 +- .../66a962954f4e0d76223b37ed.md | 2 +- .../66a972137acd1179fa3fe8a0.md | 2 +- .../66a97ca8c4cbae7d0bb6e0ad.md | 2 +- .../66c8ba41a77db20a93f9d7a1.md | 71 ++ .../66c8ba975ee7230e29f6c4ac.md | 53 ++ .../66c8ba975ee7230e29f6c4ad.md | 55 ++ .../66c8ba975ee7230e29f6c4af.md | 56 ++ .../66c8ba975ee7230e29f6c4b0.md | 56 ++ .../66c8ba975ee7230e29f6c4b1.md | 54 ++ .../66c8ba975ee7230e29f6c4b2.md | 165 +++++ .../5f2c289f164c29556da632fd.md | 19 + .../587d7fb3367417b2b2512bfb.md | 53 ++ .../587d7fb3367417b2b2512bfc.md | 43 ++ .../587d7fb4367417b2b2512bfd.md | 75 +++ .../587d7fb4367417b2b2512bfe.md | 39 ++ .../587d7fb4367417b2b2512bff.md | 37 ++ .../587d7fb4367417b2b2512c00.md | 68 ++ .../587d7fb5367417b2b2512c01.md | 64 ++ .../587d7fb5367417b2b2512c02.md | 66 ++ .../587d7fb5367417b2b2512c03.md | 66 ++ .../587d7fb5367417b2b2512c04.md | 43 ++ .../build-a-periodic-table-database.md | 2 +- .../5f3ef6e0a81099d9a697b550.md | 8 + .../646de7b64467e96b7d35b5cd.md | 2 +- .../introduction-flexbox-lesson-j.md | 6 +- .../introduction-flexbox-lesson-k.md | 6 +- .../learn-block-and-inline-lesson-b.md | 6 +- .../learn-block-and-inline-lesson-g.md | 2 +- ...problems-and-understand-errors-lesson-a.md | 6 +- ...problems-and-understand-errors-lesson-b.md | 6 +- ...problems-and-understand-errors-lesson-c.md | 6 +- .../the-box-model-lesson-b.md | 2 +- .../the-box-model-lesson-c.md | 2 +- .../the-box-model-lesson-d.md | 2 +- .../657b69e10d6606a0185d4d4f.md | 2 +- .../657dce8ff35869721311a5e3.md | 2 +- .../657dcee413423174ca3747f5.md | 2 +- .../5f1a4ef5d5d6b5ab580fc6ae.md | 25 + .../5a8b073d06fa14fcfde687aa.md | 611 ++++++++++++++++++ .../602da04c22201c65d2a019f4.md | 25 + .../bd7158d8c443edefaeb5bdff.md | 65 ++ .../bd7158d8c443edefaeb5bd0e.md | 107 +++ .../5f9771307d4d22b9d2b75a94.md | 25 + .../66a96127422411756204bc1b.md | 4 +- .../66a962954f4e0d76223b37ed.md | 2 +- .../66a972137acd1179fa3fe8a0.md | 2 +- .../66a97ca8c4cbae7d0bb6e0ad.md | 2 +- .../66c8ba41a77db20a93f9d7a1.md | 71 ++ .../66c8ba975ee7230e29f6c4ac.md | 53 ++ .../66c8ba975ee7230e29f6c4ad.md | 55 ++ .../66c8ba975ee7230e29f6c4af.md | 56 ++ .../66c8ba975ee7230e29f6c4b0.md | 56 ++ .../66c8ba975ee7230e29f6c4b1.md | 54 ++ .../66c8ba975ee7230e29f6c4b2.md | 165 +++++ .../5f2c289f164c29556da632fd.md | 19 + .../587d7fb3367417b2b2512bfb.md | 53 ++ .../587d7fb3367417b2b2512bfc.md | 43 ++ .../587d7fb4367417b2b2512bfd.md | 75 +++ .../587d7fb4367417b2b2512bfe.md | 39 ++ .../587d7fb4367417b2b2512bff.md | 37 ++ .../587d7fb4367417b2b2512c00.md | 68 ++ .../587d7fb5367417b2b2512c01.md | 64 ++ .../587d7fb5367417b2b2512c02.md | 66 ++ .../587d7fb5367417b2b2512c03.md | 66 ++ .../587d7fb5367417b2b2512c04.md | 43 ++ 624 files changed, 23080 insertions(+), 1641 deletions(-) create mode 100644 curriculum/challenges/arabic/25-front-end-development/lab-celestial-bodies-database/5f1a4ef5d5d6b5ab580fc6ae.md create mode 100644 curriculum/challenges/arabic/25-front-end-development/lab-exercise-tracker/5a8b073d06fa14fcfde687aa.md create mode 100644 curriculum/challenges/arabic/25-front-end-development/lab-number-guessing-game/602da04c22201c65d2a019f4.md create mode 100644 curriculum/challenges/arabic/25-front-end-development/lab-request-header-parser-microservice/bd7158d8c443edefaeb5bdff.md create mode 100644 curriculum/challenges/arabic/25-front-end-development/lab-url-shortener-microservice/bd7158d8c443edefaeb5bd0e.md create mode 100644 curriculum/challenges/arabic/25-front-end-development/lab-world-cup-database/5f9771307d4d22b9d2b75a94.md create mode 100644 curriculum/challenges/arabic/25-front-end-development/workshop-loan-qualification-checker/66c8ba41a77db20a93f9d7a1.md create mode 100644 curriculum/challenges/arabic/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4ac.md create mode 100644 curriculum/challenges/arabic/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4ad.md create mode 100644 curriculum/challenges/arabic/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4af.md create mode 100644 curriculum/challenges/arabic/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b0.md create mode 100644 curriculum/challenges/arabic/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b1.md create mode 100644 curriculum/challenges/arabic/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b2.md create mode 100644 curriculum/challenges/arabic/25-front-end-development/workshop-mario-database/5f2c289f164c29556da632fd.md create mode 100644 curriculum/challenges/arabic/25-front-end-development/workshop-npm-packages/587d7fb3367417b2b2512bfb.md create mode 100644 curriculum/challenges/arabic/25-front-end-development/workshop-npm-packages/587d7fb3367417b2b2512bfc.md create mode 100644 curriculum/challenges/arabic/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bfd.md create mode 100644 curriculum/challenges/arabic/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bfe.md create mode 100644 curriculum/challenges/arabic/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bff.md create mode 100644 curriculum/challenges/arabic/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512c00.md create mode 100644 curriculum/challenges/arabic/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c01.md create mode 100644 curriculum/challenges/arabic/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c02.md create mode 100644 curriculum/challenges/arabic/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c03.md create mode 100644 curriculum/challenges/arabic/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c04.md create mode 100644 curriculum/challenges/chinese-traditional/25-front-end-development/lab-celestial-bodies-database/5f1a4ef5d5d6b5ab580fc6ae.md create mode 100644 curriculum/challenges/chinese-traditional/25-front-end-development/lab-exercise-tracker/5a8b073d06fa14fcfde687aa.md create mode 100644 curriculum/challenges/chinese-traditional/25-front-end-development/lab-number-guessing-game/602da04c22201c65d2a019f4.md create mode 100644 curriculum/challenges/chinese-traditional/25-front-end-development/lab-request-header-parser-microservice/bd7158d8c443edefaeb5bdff.md create mode 100644 curriculum/challenges/chinese-traditional/25-front-end-development/lab-url-shortener-microservice/bd7158d8c443edefaeb5bd0e.md create mode 100644 curriculum/challenges/chinese-traditional/25-front-end-development/lab-world-cup-database/5f9771307d4d22b9d2b75a94.md create mode 100644 curriculum/challenges/chinese-traditional/25-front-end-development/workshop-loan-qualification-checker/66c8ba41a77db20a93f9d7a1.md create mode 100644 curriculum/challenges/chinese-traditional/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4ac.md create mode 100644 curriculum/challenges/chinese-traditional/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4ad.md create mode 100644 curriculum/challenges/chinese-traditional/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4af.md create mode 100644 curriculum/challenges/chinese-traditional/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b0.md create mode 100644 curriculum/challenges/chinese-traditional/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b1.md create mode 100644 curriculum/challenges/chinese-traditional/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b2.md create mode 100644 curriculum/challenges/chinese-traditional/25-front-end-development/workshop-mario-database/5f2c289f164c29556da632fd.md create mode 100644 curriculum/challenges/chinese-traditional/25-front-end-development/workshop-npm-packages/587d7fb3367417b2b2512bfb.md create mode 100644 curriculum/challenges/chinese-traditional/25-front-end-development/workshop-npm-packages/587d7fb3367417b2b2512bfc.md create mode 100644 curriculum/challenges/chinese-traditional/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bfd.md create mode 100644 curriculum/challenges/chinese-traditional/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bfe.md create mode 100644 curriculum/challenges/chinese-traditional/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bff.md create mode 100644 curriculum/challenges/chinese-traditional/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512c00.md create mode 100644 curriculum/challenges/chinese-traditional/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c01.md create mode 100644 curriculum/challenges/chinese-traditional/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c02.md create mode 100644 curriculum/challenges/chinese-traditional/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c03.md create mode 100644 curriculum/challenges/chinese-traditional/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c04.md create mode 100644 curriculum/challenges/chinese/25-front-end-development/lab-celestial-bodies-database/5f1a4ef5d5d6b5ab580fc6ae.md create mode 100644 curriculum/challenges/chinese/25-front-end-development/lab-exercise-tracker/5a8b073d06fa14fcfde687aa.md create mode 100644 curriculum/challenges/chinese/25-front-end-development/lab-number-guessing-game/602da04c22201c65d2a019f4.md create mode 100644 curriculum/challenges/chinese/25-front-end-development/lab-request-header-parser-microservice/bd7158d8c443edefaeb5bdff.md create mode 100644 curriculum/challenges/chinese/25-front-end-development/lab-url-shortener-microservice/bd7158d8c443edefaeb5bd0e.md create mode 100644 curriculum/challenges/chinese/25-front-end-development/lab-world-cup-database/5f9771307d4d22b9d2b75a94.md create mode 100644 curriculum/challenges/chinese/25-front-end-development/workshop-loan-qualification-checker/66c8ba41a77db20a93f9d7a1.md create mode 100644 curriculum/challenges/chinese/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4ac.md create mode 100644 curriculum/challenges/chinese/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4ad.md create mode 100644 curriculum/challenges/chinese/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4af.md create mode 100644 curriculum/challenges/chinese/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b0.md create mode 100644 curriculum/challenges/chinese/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b1.md create mode 100644 curriculum/challenges/chinese/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b2.md create mode 100644 curriculum/challenges/chinese/25-front-end-development/workshop-mario-database/5f2c289f164c29556da632fd.md create mode 100644 curriculum/challenges/chinese/25-front-end-development/workshop-npm-packages/587d7fb3367417b2b2512bfb.md create mode 100644 curriculum/challenges/chinese/25-front-end-development/workshop-npm-packages/587d7fb3367417b2b2512bfc.md create mode 100644 curriculum/challenges/chinese/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bfd.md create mode 100644 curriculum/challenges/chinese/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bfe.md create mode 100644 curriculum/challenges/chinese/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bff.md create mode 100644 curriculum/challenges/chinese/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512c00.md create mode 100644 curriculum/challenges/chinese/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c01.md create mode 100644 curriculum/challenges/chinese/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c02.md create mode 100644 curriculum/challenges/chinese/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c03.md create mode 100644 curriculum/challenges/chinese/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c04.md create mode 100644 curriculum/challenges/espanol/25-front-end-development/lab-celestial-bodies-database/5f1a4ef5d5d6b5ab580fc6ae.md create mode 100644 curriculum/challenges/espanol/25-front-end-development/lab-exercise-tracker/5a8b073d06fa14fcfde687aa.md create mode 100644 curriculum/challenges/espanol/25-front-end-development/lab-number-guessing-game/602da04c22201c65d2a019f4.md create mode 100644 curriculum/challenges/espanol/25-front-end-development/lab-request-header-parser-microservice/bd7158d8c443edefaeb5bdff.md create mode 100644 curriculum/challenges/espanol/25-front-end-development/lab-url-shortener-microservice/bd7158d8c443edefaeb5bd0e.md create mode 100644 curriculum/challenges/espanol/25-front-end-development/lab-world-cup-database/5f9771307d4d22b9d2b75a94.md create mode 100644 curriculum/challenges/espanol/25-front-end-development/workshop-loan-qualification-checker/66c8ba41a77db20a93f9d7a1.md create mode 100644 curriculum/challenges/espanol/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4ac.md create mode 100644 curriculum/challenges/espanol/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4ad.md create mode 100644 curriculum/challenges/espanol/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4af.md create mode 100644 curriculum/challenges/espanol/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b0.md create mode 100644 curriculum/challenges/espanol/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b1.md create mode 100644 curriculum/challenges/espanol/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b2.md create mode 100644 curriculum/challenges/espanol/25-front-end-development/workshop-mario-database/5f2c289f164c29556da632fd.md create mode 100644 curriculum/challenges/espanol/25-front-end-development/workshop-npm-packages/587d7fb3367417b2b2512bfb.md create mode 100644 curriculum/challenges/espanol/25-front-end-development/workshop-npm-packages/587d7fb3367417b2b2512bfc.md create mode 100644 curriculum/challenges/espanol/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bfd.md create mode 100644 curriculum/challenges/espanol/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bfe.md create mode 100644 curriculum/challenges/espanol/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bff.md create mode 100644 curriculum/challenges/espanol/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512c00.md create mode 100644 curriculum/challenges/espanol/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c01.md create mode 100644 curriculum/challenges/espanol/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c02.md create mode 100644 curriculum/challenges/espanol/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c03.md create mode 100644 curriculum/challenges/espanol/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c04.md create mode 100644 curriculum/challenges/german/25-front-end-development/lab-celestial-bodies-database/5f1a4ef5d5d6b5ab580fc6ae.md create mode 100644 curriculum/challenges/german/25-front-end-development/lab-exercise-tracker/5a8b073d06fa14fcfde687aa.md create mode 100644 curriculum/challenges/german/25-front-end-development/lab-number-guessing-game/602da04c22201c65d2a019f4.md create mode 100644 curriculum/challenges/german/25-front-end-development/lab-request-header-parser-microservice/bd7158d8c443edefaeb5bdff.md create mode 100644 curriculum/challenges/german/25-front-end-development/lab-url-shortener-microservice/bd7158d8c443edefaeb5bd0e.md create mode 100644 curriculum/challenges/german/25-front-end-development/lab-world-cup-database/5f9771307d4d22b9d2b75a94.md create mode 100644 curriculum/challenges/german/25-front-end-development/workshop-loan-qualification-checker/66c8ba41a77db20a93f9d7a1.md create mode 100644 curriculum/challenges/german/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4ac.md create mode 100644 curriculum/challenges/german/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4ad.md create mode 100644 curriculum/challenges/german/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4af.md create mode 100644 curriculum/challenges/german/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b0.md create mode 100644 curriculum/challenges/german/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b1.md create mode 100644 curriculum/challenges/german/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b2.md create mode 100644 curriculum/challenges/german/25-front-end-development/workshop-mario-database/5f2c289f164c29556da632fd.md create mode 100644 curriculum/challenges/german/25-front-end-development/workshop-npm-packages/587d7fb3367417b2b2512bfb.md create mode 100644 curriculum/challenges/german/25-front-end-development/workshop-npm-packages/587d7fb3367417b2b2512bfc.md create mode 100644 curriculum/challenges/german/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bfd.md create mode 100644 curriculum/challenges/german/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bfe.md create mode 100644 curriculum/challenges/german/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bff.md create mode 100644 curriculum/challenges/german/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512c00.md create mode 100644 curriculum/challenges/german/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c01.md create mode 100644 curriculum/challenges/german/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c02.md create mode 100644 curriculum/challenges/german/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c03.md create mode 100644 curriculum/challenges/german/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c04.md create mode 100644 curriculum/challenges/italian/25-front-end-development/lab-celestial-bodies-database/5f1a4ef5d5d6b5ab580fc6ae.md create mode 100644 curriculum/challenges/italian/25-front-end-development/lab-exercise-tracker/5a8b073d06fa14fcfde687aa.md create mode 100644 curriculum/challenges/italian/25-front-end-development/lab-number-guessing-game/602da04c22201c65d2a019f4.md create mode 100644 curriculum/challenges/italian/25-front-end-development/lab-request-header-parser-microservice/bd7158d8c443edefaeb5bdff.md create mode 100644 curriculum/challenges/italian/25-front-end-development/lab-url-shortener-microservice/bd7158d8c443edefaeb5bd0e.md create mode 100644 curriculum/challenges/italian/25-front-end-development/lab-world-cup-database/5f9771307d4d22b9d2b75a94.md create mode 100644 curriculum/challenges/italian/25-front-end-development/workshop-loan-qualification-checker/66c8ba41a77db20a93f9d7a1.md create mode 100644 curriculum/challenges/italian/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4ac.md create mode 100644 curriculum/challenges/italian/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4ad.md create mode 100644 curriculum/challenges/italian/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4af.md create mode 100644 curriculum/challenges/italian/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b0.md create mode 100644 curriculum/challenges/italian/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b1.md create mode 100644 curriculum/challenges/italian/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b2.md create mode 100644 curriculum/challenges/italian/25-front-end-development/workshop-mario-database/5f2c289f164c29556da632fd.md create mode 100644 curriculum/challenges/italian/25-front-end-development/workshop-npm-packages/587d7fb3367417b2b2512bfb.md create mode 100644 curriculum/challenges/italian/25-front-end-development/workshop-npm-packages/587d7fb3367417b2b2512bfc.md create mode 100644 curriculum/challenges/italian/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bfd.md create mode 100644 curriculum/challenges/italian/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bfe.md create mode 100644 curriculum/challenges/italian/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bff.md create mode 100644 curriculum/challenges/italian/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512c00.md create mode 100644 curriculum/challenges/italian/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c01.md create mode 100644 curriculum/challenges/italian/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c02.md create mode 100644 curriculum/challenges/italian/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c03.md create mode 100644 curriculum/challenges/italian/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c04.md create mode 100644 curriculum/challenges/japanese/25-front-end-development/lab-celestial-bodies-database/5f1a4ef5d5d6b5ab580fc6ae.md create mode 100644 curriculum/challenges/japanese/25-front-end-development/lab-exercise-tracker/5a8b073d06fa14fcfde687aa.md create mode 100644 curriculum/challenges/japanese/25-front-end-development/lab-number-guessing-game/602da04c22201c65d2a019f4.md create mode 100644 curriculum/challenges/japanese/25-front-end-development/lab-request-header-parser-microservice/bd7158d8c443edefaeb5bdff.md create mode 100644 curriculum/challenges/japanese/25-front-end-development/lab-url-shortener-microservice/bd7158d8c443edefaeb5bd0e.md create mode 100644 curriculum/challenges/japanese/25-front-end-development/lab-world-cup-database/5f9771307d4d22b9d2b75a94.md create mode 100644 curriculum/challenges/japanese/25-front-end-development/workshop-loan-qualification-checker/66c8ba41a77db20a93f9d7a1.md create mode 100644 curriculum/challenges/japanese/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4ac.md create mode 100644 curriculum/challenges/japanese/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4ad.md create mode 100644 curriculum/challenges/japanese/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4af.md create mode 100644 curriculum/challenges/japanese/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b0.md create mode 100644 curriculum/challenges/japanese/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b1.md create mode 100644 curriculum/challenges/japanese/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b2.md create mode 100644 curriculum/challenges/japanese/25-front-end-development/workshop-mario-database/5f2c289f164c29556da632fd.md create mode 100644 curriculum/challenges/japanese/25-front-end-development/workshop-npm-packages/587d7fb3367417b2b2512bfb.md create mode 100644 curriculum/challenges/japanese/25-front-end-development/workshop-npm-packages/587d7fb3367417b2b2512bfc.md create mode 100644 curriculum/challenges/japanese/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bfd.md create mode 100644 curriculum/challenges/japanese/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bfe.md create mode 100644 curriculum/challenges/japanese/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bff.md create mode 100644 curriculum/challenges/japanese/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512c00.md create mode 100644 curriculum/challenges/japanese/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c01.md create mode 100644 curriculum/challenges/japanese/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c02.md create mode 100644 curriculum/challenges/japanese/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c03.md create mode 100644 curriculum/challenges/japanese/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c04.md create mode 100644 curriculum/challenges/korean/25-front-end-development/lab-celestial-bodies-database/5f1a4ef5d5d6b5ab580fc6ae.md create mode 100644 curriculum/challenges/korean/25-front-end-development/lab-exercise-tracker/5a8b073d06fa14fcfde687aa.md create mode 100644 curriculum/challenges/korean/25-front-end-development/lab-number-guessing-game/602da04c22201c65d2a019f4.md create mode 100644 curriculum/challenges/korean/25-front-end-development/lab-request-header-parser-microservice/bd7158d8c443edefaeb5bdff.md create mode 100644 curriculum/challenges/korean/25-front-end-development/lab-url-shortener-microservice/bd7158d8c443edefaeb5bd0e.md create mode 100644 curriculum/challenges/korean/25-front-end-development/lab-world-cup-database/5f9771307d4d22b9d2b75a94.md create mode 100644 curriculum/challenges/korean/25-front-end-development/workshop-loan-qualification-checker/66c8ba41a77db20a93f9d7a1.md create mode 100644 curriculum/challenges/korean/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4ac.md create mode 100644 curriculum/challenges/korean/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4ad.md create mode 100644 curriculum/challenges/korean/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4af.md create mode 100644 curriculum/challenges/korean/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b0.md create mode 100644 curriculum/challenges/korean/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b1.md create mode 100644 curriculum/challenges/korean/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b2.md create mode 100644 curriculum/challenges/korean/25-front-end-development/workshop-mario-database/5f2c289f164c29556da632fd.md create mode 100644 curriculum/challenges/korean/25-front-end-development/workshop-npm-packages/587d7fb3367417b2b2512bfb.md create mode 100644 curriculum/challenges/korean/25-front-end-development/workshop-npm-packages/587d7fb3367417b2b2512bfc.md create mode 100644 curriculum/challenges/korean/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bfd.md create mode 100644 curriculum/challenges/korean/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bfe.md create mode 100644 curriculum/challenges/korean/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bff.md create mode 100644 curriculum/challenges/korean/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512c00.md create mode 100644 curriculum/challenges/korean/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c01.md create mode 100644 curriculum/challenges/korean/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c02.md create mode 100644 curriculum/challenges/korean/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c03.md create mode 100644 curriculum/challenges/korean/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c04.md create mode 100644 curriculum/challenges/portuguese/25-front-end-development/lab-celestial-bodies-database/5f1a4ef5d5d6b5ab580fc6ae.md create mode 100644 curriculum/challenges/portuguese/25-front-end-development/lab-exercise-tracker/5a8b073d06fa14fcfde687aa.md create mode 100644 curriculum/challenges/portuguese/25-front-end-development/lab-number-guessing-game/602da04c22201c65d2a019f4.md create mode 100644 curriculum/challenges/portuguese/25-front-end-development/lab-request-header-parser-microservice/bd7158d8c443edefaeb5bdff.md create mode 100644 curriculum/challenges/portuguese/25-front-end-development/lab-url-shortener-microservice/bd7158d8c443edefaeb5bd0e.md create mode 100644 curriculum/challenges/portuguese/25-front-end-development/lab-world-cup-database/5f9771307d4d22b9d2b75a94.md create mode 100644 curriculum/challenges/portuguese/25-front-end-development/workshop-loan-qualification-checker/66c8ba41a77db20a93f9d7a1.md create mode 100644 curriculum/challenges/portuguese/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4ac.md create mode 100644 curriculum/challenges/portuguese/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4ad.md create mode 100644 curriculum/challenges/portuguese/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4af.md create mode 100644 curriculum/challenges/portuguese/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b0.md create mode 100644 curriculum/challenges/portuguese/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b1.md create mode 100644 curriculum/challenges/portuguese/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b2.md create mode 100644 curriculum/challenges/portuguese/25-front-end-development/workshop-mario-database/5f2c289f164c29556da632fd.md create mode 100644 curriculum/challenges/portuguese/25-front-end-development/workshop-npm-packages/587d7fb3367417b2b2512bfb.md create mode 100644 curriculum/challenges/portuguese/25-front-end-development/workshop-npm-packages/587d7fb3367417b2b2512bfc.md create mode 100644 curriculum/challenges/portuguese/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bfd.md create mode 100644 curriculum/challenges/portuguese/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bfe.md create mode 100644 curriculum/challenges/portuguese/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bff.md create mode 100644 curriculum/challenges/portuguese/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512c00.md create mode 100644 curriculum/challenges/portuguese/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c01.md create mode 100644 curriculum/challenges/portuguese/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c02.md create mode 100644 curriculum/challenges/portuguese/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c03.md create mode 100644 curriculum/challenges/portuguese/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c04.md create mode 100644 curriculum/challenges/swahili/25-front-end-development/lab-celestial-bodies-database/5f1a4ef5d5d6b5ab580fc6ae.md create mode 100644 curriculum/challenges/swahili/25-front-end-development/lab-exercise-tracker/5a8b073d06fa14fcfde687aa.md create mode 100644 curriculum/challenges/swahili/25-front-end-development/lab-number-guessing-game/602da04c22201c65d2a019f4.md create mode 100644 curriculum/challenges/swahili/25-front-end-development/lab-request-header-parser-microservice/bd7158d8c443edefaeb5bdff.md create mode 100644 curriculum/challenges/swahili/25-front-end-development/lab-url-shortener-microservice/bd7158d8c443edefaeb5bd0e.md create mode 100644 curriculum/challenges/swahili/25-front-end-development/lab-world-cup-database/5f9771307d4d22b9d2b75a94.md create mode 100644 curriculum/challenges/swahili/25-front-end-development/workshop-loan-qualification-checker/66c8ba41a77db20a93f9d7a1.md create mode 100644 curriculum/challenges/swahili/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4ac.md create mode 100644 curriculum/challenges/swahili/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4ad.md create mode 100644 curriculum/challenges/swahili/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4af.md create mode 100644 curriculum/challenges/swahili/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b0.md create mode 100644 curriculum/challenges/swahili/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b1.md create mode 100644 curriculum/challenges/swahili/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b2.md create mode 100644 curriculum/challenges/swahili/25-front-end-development/workshop-mario-database/5f2c289f164c29556da632fd.md create mode 100644 curriculum/challenges/swahili/25-front-end-development/workshop-npm-packages/587d7fb3367417b2b2512bfb.md create mode 100644 curriculum/challenges/swahili/25-front-end-development/workshop-npm-packages/587d7fb3367417b2b2512bfc.md create mode 100644 curriculum/challenges/swahili/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bfd.md create mode 100644 curriculum/challenges/swahili/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bfe.md create mode 100644 curriculum/challenges/swahili/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bff.md create mode 100644 curriculum/challenges/swahili/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512c00.md create mode 100644 curriculum/challenges/swahili/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c01.md create mode 100644 curriculum/challenges/swahili/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c02.md create mode 100644 curriculum/challenges/swahili/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c03.md create mode 100644 curriculum/challenges/swahili/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c04.md create mode 100644 curriculum/challenges/ukrainian/25-front-end-development/lab-celestial-bodies-database/5f1a4ef5d5d6b5ab580fc6ae.md create mode 100644 curriculum/challenges/ukrainian/25-front-end-development/lab-exercise-tracker/5a8b073d06fa14fcfde687aa.md create mode 100644 curriculum/challenges/ukrainian/25-front-end-development/lab-number-guessing-game/602da04c22201c65d2a019f4.md create mode 100644 curriculum/challenges/ukrainian/25-front-end-development/lab-request-header-parser-microservice/bd7158d8c443edefaeb5bdff.md create mode 100644 curriculum/challenges/ukrainian/25-front-end-development/lab-url-shortener-microservice/bd7158d8c443edefaeb5bd0e.md create mode 100644 curriculum/challenges/ukrainian/25-front-end-development/lab-world-cup-database/5f9771307d4d22b9d2b75a94.md create mode 100644 curriculum/challenges/ukrainian/25-front-end-development/workshop-loan-qualification-checker/66c8ba41a77db20a93f9d7a1.md create mode 100644 curriculum/challenges/ukrainian/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4ac.md create mode 100644 curriculum/challenges/ukrainian/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4ad.md create mode 100644 curriculum/challenges/ukrainian/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4af.md create mode 100644 curriculum/challenges/ukrainian/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b0.md create mode 100644 curriculum/challenges/ukrainian/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b1.md create mode 100644 curriculum/challenges/ukrainian/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b2.md create mode 100644 curriculum/challenges/ukrainian/25-front-end-development/workshop-mario-database/5f2c289f164c29556da632fd.md create mode 100644 curriculum/challenges/ukrainian/25-front-end-development/workshop-npm-packages/587d7fb3367417b2b2512bfb.md create mode 100644 curriculum/challenges/ukrainian/25-front-end-development/workshop-npm-packages/587d7fb3367417b2b2512bfc.md create mode 100644 curriculum/challenges/ukrainian/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bfd.md create mode 100644 curriculum/challenges/ukrainian/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bfe.md create mode 100644 curriculum/challenges/ukrainian/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bff.md create mode 100644 curriculum/challenges/ukrainian/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512c00.md create mode 100644 curriculum/challenges/ukrainian/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c01.md create mode 100644 curriculum/challenges/ukrainian/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c02.md create mode 100644 curriculum/challenges/ukrainian/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c03.md create mode 100644 curriculum/challenges/ukrainian/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c04.md diff --git a/curriculum/challenges/arabic/13-relational-databases/build-a-periodic-table-database-project/build-a-periodic-table-database.md b/curriculum/challenges/arabic/13-relational-databases/build-a-periodic-table-database-project/build-a-periodic-table-database.md index db5b0c61e0..5608918f2f 100644 --- a/curriculum/challenges/arabic/13-relational-databases/build-a-periodic-table-database-project/build-a-periodic-table-database.md +++ b/curriculum/challenges/arabic/13-relational-databases/build-a-periodic-table-database-project/build-a-periodic-table-database.md @@ -8,7 +8,7 @@ dashedName: build-a-periodic-table-database # --description-- -This is one of the required projects to earn your certification. For this project, you will create Bash a script to get information about chemical elements from a periodic table database. +This is one of the required projects to earn your certification. For this project, you will create a Bash script to get information about chemical elements from a periodic table database. # --instructions-- diff --git a/curriculum/challenges/arabic/14-responsive-web-design-22/learn-basic-css-by-building-a-cafe-menu/5f3ef6e0a81099d9a697b550.md b/curriculum/challenges/arabic/14-responsive-web-design-22/learn-basic-css-by-building-a-cafe-menu/5f3ef6e0a81099d9a697b550.md index 7651c8ad5f..c1612f1733 100644 --- a/curriculum/challenges/arabic/14-responsive-web-design-22/learn-basic-css-by-building-a-cafe-menu/5f3ef6e0a81099d9a697b550.md +++ b/curriculum/challenges/arabic/14-responsive-web-design-22/learn-basic-css-by-building-a-cafe-menu/5f3ef6e0a81099d9a697b550.md @@ -9,6 +9,8 @@ dashedName: step-64 في داخل `footer`، أضف عنصر `p`. بعد ذلك، قم بدمج عنصر الرابط (`a`) في `p` الذي يربط الي `https://www.freecodecamp.org` ولديه النص `Visit our website`. +Make sure that the link opens in a new tab by adding a `target` attribute with the value `_blank`. + # --hints-- لا يجب عليك تعديل عنصر `footer` الحالي. @@ -43,6 +45,12 @@ assert(document.querySelector("footer > p > a")?.innerText === "Visit our websit assert(document.querySelector("footer > p > a")?.href === "https://www.freecodecamp.org/"); ``` +Your new `a` element should have the `target` attribute set to `_blank`. + +```js +assert.equal(document.querySelector("footer > p > a")?.target, "_blank"); +``` + # --seed-- ## --seed-contents-- diff --git a/curriculum/challenges/arabic/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-j.md b/curriculum/challenges/arabic/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-j.md index d2ad72a1ea..1b6ca05444 100644 --- a/curriculum/challenges/arabic/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-j.md +++ b/curriculum/challenges/arabic/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-j.md @@ -21,12 +21,12 @@ Remove `flex: 1` from `.item` and add `justify-content: space-between` to `.cont `justify-content` aligns items across the **main axis**. There are a few values that you can use here. You'll learn the rest of them in the reading assignments, but for now try changing it to center, which should center the boxes along the main axis. -# --question-- - -## --assignment-- +# --assignment-- Before moving on to the next lesson, see what is possible with the `justify-content` property. Read this [interactive article on MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/justify-content) and play around with the different values of `justify-content` on the example. +# --question-- + ## --text-- How does applying `justify-content: space-between` to a flex container affect the positioning of its items? diff --git a/curriculum/challenges/arabic/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-k.md b/curriculum/challenges/arabic/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-k.md index d3137b0af5..59acb55a29 100644 --- a/curriculum/challenges/arabic/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-k.md +++ b/curriculum/challenges/arabic/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-k.md @@ -17,12 +17,12 @@ To change the placement of items along the cross axis use `align-items`. Try get Because `justify-content` and `align-items` are based on the main and cross axis of your container, their behavior changes when you change the flex-direction of a flex-container. For example, when you change `flex-direction` to `column`, `justify-content` aligns vertically and `align-items` aligns horizontally. The most common behavior, however, is the default, i.e. `justify-content` aligns items horizontally (because the main axis defaults to horizontal), and `align-items` aligns them vertically. One of the biggest sticking points that beginners have with flexbox is confusion when this behavior changes. -# --question-- - -## --assignment-- +# --assignment-- Before moving on to the next lesson, see if you can figure out how `align-items` behaves when you change the `flex-direction` property to `column`. +# --question-- + ## --text-- When changing the `flex-direction` property to `column` in a flex container, how does `align-items` behave in relation to the flex items? diff --git a/curriculum/challenges/arabic/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-b.md b/curriculum/challenges/arabic/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-b.md index 1adf9ce84f..49edeac0e4 100644 --- a/curriculum/challenges/arabic/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-b.md +++ b/curriculum/challenges/arabic/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-b.md @@ -9,12 +9,12 @@ dashedName: learn-block-and-inline-lesson-b Inline elements, however, do not start on a new line. They appear in line with whatever elements they are placed beside. A clear example of an inline element is a link, or `` tag. If you stick one of these in the middle of a paragraph of text, it will behave like a part of the paragraph. (Like this) The link’s text will sit alongside other words in that paragraph. Additionally, padding and margin behave differently on inline elements. In general, you do not want to try to put extra padding or margin on inline elements. -# --question-- - -## --assignment-- +# --assignment-- Search the web for a list of `block` elements and a list of `inline` elements. +# --question-- + ## --text-- What is the difference between a `block` element and an `inline` element? diff --git a/curriculum/challenges/arabic/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-g.md b/curriculum/challenges/arabic/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-g.md index cdd4d5aa87..e75492e9c1 100644 --- a/curriculum/challenges/arabic/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-g.md +++ b/curriculum/challenges/arabic/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-g.md @@ -7,7 +7,7 @@ dashedName: learn-block-and-inline-lesson-g # --description-- -Now that you have some basic understanding of `block` and inline `elements`, pull up your list of `block` and `inline` elements from a couple questions ago and see if you can identify which of the following elements are `block` elements and which are `inline` elements. +Now that you have some basic understanding of `block` and `inline` elements, pull up your list of `block` and `inline` elements from a couple questions ago and see if you can identify which of the following elements are `block` elements and which are `inline` elements. # --question-- diff --git a/curriculum/challenges/arabic/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-a.md b/curriculum/challenges/arabic/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-a.md index 995073b8a2..a7a2ee9a51 100644 --- a/curriculum/challenges/arabic/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-a.md +++ b/curriculum/challenges/arabic/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-a.md @@ -21,12 +21,12 @@ New programmers often find problem solving the hardest skill to build. It's not The best way to improve your problem solving ability is by building experience by making lots and lots of programs. The more practice you have the better you'll be prepared to solve real world problems. -# --question-- - -## --assignment-- +# --assignment-- Read How to Think Like a Programmer - Lessons in Problem Solving by Richard Reis. +# --question-- + ## --text-- According to V. Anton Spraul in "Think Like a Programmer," what is problem solving in programming? diff --git a/curriculum/challenges/arabic/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-b.md b/curriculum/challenges/arabic/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-b.md index ae905ecf89..c57a7d43e8 100644 --- a/curriculum/challenges/arabic/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-b.md +++ b/curriculum/challenges/arabic/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-b.md @@ -25,11 +25,11 @@ Now that you know what you’re aiming to solve, don’t jump into coding just y The last question is where you will write out an algorithm to solve the problem. You can think of an algorithm as a recipe for solving a particular problem. It defines the steps that need to be taken by the computer to solve a problem in pseudocode. -# --question-- - -## --assignment-- +# --assignment-- Watch How to Begin Thinking Like a Programmer by Coding Tech. It’s an hour long but packed full of information and definitely worth your time watching. +# --question-- + ## --text-- What should you do before starting to code according to the provided text? diff --git a/curriculum/challenges/arabic/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-c.md b/curriculum/challenges/arabic/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-c.md index c837fd9658..082f2d51ae 100644 --- a/curriculum/challenges/arabic/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-c.md +++ b/curriculum/challenges/arabic/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-c.md @@ -22,12 +22,12 @@ Print the value of the counter variable This is a basic program to demonstrate how pseudocode looks. There will be more examples of pseudocode included in the assignments. +# --assignment-- -# --question-- - -## --assignment-- Read this Pseudocode: What It Is and How to Write It article from Built In. +# --question-- + ## --text-- What are the benefits of using pseudocode according to the linked article? diff --git a/curriculum/challenges/arabic/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657b69e10d6606a0185d4d4f.md b/curriculum/challenges/arabic/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657b69e10d6606a0185d4d4f.md index d1838e5943..e6aa3a19dc 100644 --- a/curriculum/challenges/arabic/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657b69e10d6606a0185d4d4f.md +++ b/curriculum/challenges/arabic/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657b69e10d6606a0185d4d4f.md @@ -9,7 +9,7 @@ dashedName: task-23 # --description-- -So far you have learned how to create questions with the verb to be. In sentences with the verb `to be` (am, is, are) you just have to change the order of the noun and the verb to create a question. Like this: +So far you have learned how to create questions with the verb `to be`. In sentences with the verb `to be` (am, is, are) you just have to change the order of the noun and the verb to create a question. Like this: `You are a developer` -> `Are you a developer?` diff --git a/curriculum/challenges/arabic/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657dce8ff35869721311a5e3.md b/curriculum/challenges/arabic/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657dce8ff35869721311a5e3.md index 544d8f1988..8cd311a518 100644 --- a/curriculum/challenges/arabic/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657dce8ff35869721311a5e3.md +++ b/curriculum/challenges/arabic/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657dce8ff35869721311a5e3.md @@ -21,7 +21,7 @@ Which sentence is correct for describing one place near you? ### --feedback-- -`There are` is used for plural nouns, and `bank` is singular. You’ll learn about there are in the next few lessons. +`There are` is used for plural nouns, and `bank` is singular. You’ll learn about `there are` in the next few lessons. --- diff --git a/curriculum/challenges/arabic/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657dcee413423174ca3747f5.md b/curriculum/challenges/arabic/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657dcee413423174ca3747f5.md index 6526b1e95b..10c0845779 100644 --- a/curriculum/challenges/arabic/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657dcee413423174ca3747f5.md +++ b/curriculum/challenges/arabic/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657dcee413423174ca3747f5.md @@ -7,7 +7,7 @@ dashedName: task-112 # --description-- -To elaborate a question using `there is` you just need to change the order of the verb to be, like so: +To elaborate a question using `there is` you just need to change the order of the verb `to be`, like so: `There is an ATM nearby` -> `Is there an ATM nearby?` diff --git a/curriculum/challenges/arabic/25-front-end-development/lab-celestial-bodies-database/5f1a4ef5d5d6b5ab580fc6ae.md b/curriculum/challenges/arabic/25-front-end-development/lab-celestial-bodies-database/5f1a4ef5d5d6b5ab580fc6ae.md new file mode 100644 index 0000000000..7d664a8876 --- /dev/null +++ b/curriculum/challenges/arabic/25-front-end-development/lab-celestial-bodies-database/5f1a4ef5d5d6b5ab580fc6ae.md @@ -0,0 +1,25 @@ +--- +id: 5f1a4ef5d5d6b5ab580fc6ae +title: Build a Celestial Bodies Database +challengeType: 13 +url: freeCodeCamp/learn-celestial-bodies-database +dashedName: lab-celestial-bodies-database +--- + +# --description-- + +For this project, you will build a database of celestial bodies using PostgreSQL. + +# --instructions-- + +**Important:** After you pass all the project tests, save a dump of your database into a `universe.sql` file so you can complete step 2. There will be instructions how to do that within the virtual machine. + +# --notes-- + +Required files: `universe.sql` + +# --hints-- + +# --seed-- + +# --solutions-- diff --git a/curriculum/challenges/arabic/25-front-end-development/lab-exercise-tracker/5a8b073d06fa14fcfde687aa.md b/curriculum/challenges/arabic/25-front-end-development/lab-exercise-tracker/5a8b073d06fa14fcfde687aa.md new file mode 100644 index 0000000000..9492b82cb4 --- /dev/null +++ b/curriculum/challenges/arabic/25-front-end-development/lab-exercise-tracker/5a8b073d06fa14fcfde687aa.md @@ -0,0 +1,611 @@ +--- +id: 5a8b073d06fa14fcfde687aa +title: Build an Exercise Tracker +challengeType: 4 +dashedName: build-an-exercise-tracker +--- + +# --description-- + +Build a full stack JavaScript app that is functionally similar to this: https://exercise-tracker.freecodecamp.rocks. Working on this project will involve you writing your code using one of the following methods: + +- Clone this GitHub repo and complete your project locally. +- Use our Gitpod starter project to complete your project. +- Use a site builder of your choice to complete the project. Be sure to incorporate all the files from our GitHub repo. + +# --instructions-- + +Your responses should have the following structures. + +Exercise: + +```js +{ + username: "fcc_test", + description: "test", + duration: 60, + date: "Mon Jan 01 1990", + _id: "5fb5853f734231456ccb3b05" +} +``` + +User: + +```js +{ + username: "fcc_test", + _id: "5fb5853f734231456ccb3b05" +} +``` + +Log: + +```js +{ + username: "fcc_test", + count: 1, + _id: "5fb5853f734231456ccb3b05", + log: [{ + description: "test", + duration: 60, + date: "Mon Jan 01 1990", + }] +} +``` + +**Hint:** For the `date` property, the `toDateString` method of the `Date` API can be used to achieve the expected output. + +# --hints-- + +You should provide your own project, not the example URL. + +```js +(getUserInput) => { + const url = getUserInput('url'); + assert( + !/.*\/exercise-tracker\.freecodecamp\.rocks/.test(getUserInput('url')) + ); +}; +``` + +You can `POST` to `/api/users` with form data `username` to create a new user. + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `username=fcc_test_${Date.now()}`.substring(0, 29) + }); + assert.isTrue(res.ok); + if(!res.ok) { + throw new Error(`${res.status} ${res.statusText}`) + }; +}; +``` + +The returned response from `POST /api/users` with form data `username` will be an object with `username` and `_id` properties. + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `username=fcc_test_${Date.now()}`.substring(0, 29) + }); + if (res.ok) { + const { _id, username } = await res.json(); + assert.exists(_id); + assert.exists(username); + } else { + throw new Error(`${res.status} ${res.statusText}`); + } +}; +``` + +You can make a `GET` request to `/api/users` to get a list of all users. + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users'); + assert.isTrue(res.ok); + if(!res.ok) { + throw new Error(`${res.status} ${res.statusText}`) + }; +}; +``` + +The `GET` request to `/api/users` returns an array. + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users'); + if(res.ok){ + const users = await res.json(); + assert.isArray(users); + } else { + throw new Error(`${res.status} ${res.statusText}`); + }; +}; +``` + +Each element in the array returned from `GET /api/users` is an object literal containing a user's `username` and `_id`. + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users'); + if(res.ok){ + const users = await res.json(); + const user = users[0]; + assert.exists(user); + assert.exists(user.username); + assert.exists(user._id); + assert.isString(user.username); + assert.isString(user._id); + } else { + throw new Error(`${res.status} ${res.statusText}`); + }; +}; +``` + +You can `POST` to `/api/users/:_id/exercises` with form data `description`, `duration`, and optionally `date`. If no date is supplied, the current date will be used. + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `username=fcc_test_${Date.now()}`.substring(0, 29) + }); + if (res.ok) { + const { _id, username } = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: 'Mon Jan 01 1990' + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `description=${expected.description}&duration=${expected.duration}&date=1990-01-01` + }); + assert.isTrue(addRes.ok); + if(!addRes.ok) { + throw new Error(`${addRes.status} ${addRes.statusText}`) + }; + } else { + throw new Error(`${res.status} ${res.statusText}`); + } +}; +``` + +The response returned from `POST /api/users/:_id/exercises` will be the user object with the exercise fields added. + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `username=fcc_test_${Date.now()}`.substring(0, 29) + }); + if (res.ok) { + const { _id, username } = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: 'Mon Jan 01 1990' + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `description=${expected.description}&duration=${expected.duration}&date=1990-01-01` + }); + if (addRes.ok) { + const actual = await addRes.json(); + assert.deepEqual(actual, expected); + assert.isString(actual.description); + assert.isNumber(actual.duration); + assert.isString(actual.date); + } else { + throw new Error(`${addRes.status} ${addRes.statusText}`); + } + } else { + throw new Error(`${res.status} ${res.statusText}`); + } +}; +``` + +You can make a `GET` request to `/api/users/:_id/logs` to retrieve a full exercise log of any user. + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `username=fcc_test_${Date.now()}`.substring(0, 29) + }); + if (res.ok) { + const { _id, username } = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: new Date().toDateString() + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `description=${expected.description}&duration=${expected.duration}` + }); + if (addRes.ok) { + const logRes = await fetch(url + `/api/users/${_id}/logs`); + assert.isTrue(logRes.ok); + if(!logRes.ok) { + throw new Error(`${logRes.status} ${logRes.statusText}`) + }; + } else { + throw new Error(`${addRes.status} ${addRes.statusText}`); + } + } else { + throw new Error(`${res.status} ${res.statusText}`); + } +}; +``` + +A request to a user's log `GET /api/users/:_id/logs` returns a user object with a `count` property representing the number of exercises that belong to that user. + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `username=fcc_test_${Date.now()}`.substring(0, 29) + }); + if (res.ok) { + const { _id, username } = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: new Date().toDateString() + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `description=${expected.description}&duration=${expected.duration}` + }); + if (addRes.ok) { + const logRes = await fetch(url + `/api/users/${_id}/logs`); + if (logRes.ok) { + const { count } = await logRes.json(); + assert(count); + } else { + throw new Error(`${logRes.status} ${logRes.statusText}`); + } + } else { + throw new Error(`${addRes.status} ${addRes.statusText}`); + } + } else { + throw new Error(`${res.status} ${res.statusText}`); + } +}; +``` + +A `GET` request to `/api/users/:_id/logs` will return the user object with a `log` array of all the exercises added. + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded' + }, + body: `username=fcc_test_${Date.now()}`.substring(0, 29) + }) + if(res.ok){ + const {_id, username} = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: new Date().toDateString() + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `description=${expected.description}&duration=${expected.duration}` + }); + if(addRes.ok){ + const logRes = await fetch(url + `/api/users/${_id}/logs`); + if(logRes.ok) { + const {log} = await logRes.json(); + assert.isArray(log); + assert.equal(1, log.length); + } else { + throw new Error(`${logRes.status} ${logRes.statusText}`); + } + } else { + throw new Error(`${addRes.status} ${addRes.statusText}`); + }; + } else { + throw new Error(`${res.status} ${res.statusText}`) + }; +}; +``` + +Each item in the `log` array that is returned from `GET /api/users/:_id/logs` is an object that should have a `description`, `duration`, and `date` properties. + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + `/api/users`, { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded' + }, + body: `username=fcc_test_${Date.now()}`.substring(0, 29) + }); + if(res.ok) { + const {_id, username} = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: new Date().toDateString() + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `description=${expected.description}&duration=${expected.duration}` + }); + if(addRes.ok) { + const logRes = await fetch(url + `/api/users/${_id}/logs`); + if(logRes.ok) { + const {log} = await logRes.json(); + const exercise = log[0]; + assert.exists(exercise); + assert.exists(exercise.description); + assert.exists(exercise.duration); + assert.exists(exercise.date); + } else { + throw new Error(`${logRes.status} ${logRes.statusText}`); + }; + } else { + throw new Error(`${addRes.status} ${addRes.statusText}`); + }; + } else { + throw new Error(`${res.status} ${res.statusText}`) + }; +}; +``` + +The `description` property of any object in the `log` array that is returned from `GET /api/users/:_id/logs` should be a string. + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + body: `username=fcc_test_${Date.now()}`.substring(0,29) + }); + if(res.ok) { + const {_id, username} = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: new Date().toDateString() + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + body: `description=${expected.description}&duration=${expected.duration}` + }); + if(addRes.ok) { + const logRes = await fetch(url + `/api/users/${_id}/logs`); + if(logRes.ok){ + const {log} = await logRes.json(); + const exercise = log[0]; + assert.isString(exercise.description); + assert.equal(exercise.description, expected.description); + } else { + throw new Error(`${logRes.status} ${logRes.statusText}`); + } + } else { + throw new Error(`${addRes.status} ${addRes.statusText}`); + }; + } else { + throw new Error(`${res.status} ${res.statusText}`); + }; +}; +``` + +The `duration` property of any object in the `log` array that is returned from `GET /api/users/:_id/logs` should be a number. + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + body: `username=fcc_test_${Date.now()}`.substring(0,29) + }); + if(res.ok) { + const {_id, username} = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: new Date().toDateString() + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + body: `description=${expected.description}&duration=${expected.duration}` + }); + if(addRes.ok) { + const logRes = await fetch(url + `/api/users/${_id}/logs`); + if(logRes.ok){ + const {log} = await logRes.json(); + const exercise = log[0]; + assert.isNumber(exercise.duration); + assert.equal(exercise.duration, expected.duration); + } else { + throw new Error(`${logRes.status} ${logRes.statusText}`); + } + } else { + throw new Error(`${addRes.status} ${addRes.statusText}`); + }; + } else { + throw new Error(`${res.status} ${res.statusText}`); + }; +}; +``` + +The `date` property of any object in the `log` array that is returned from `GET /api/users/:_id/logs` should be a string. Use the `dateString` format of the `Date` API. + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + body: `username=fcc_test_${Date.now()}`.substring(0,29) + }); + if(res.ok) { + const {_id, username} = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: new Date().toLocaleDateString("en-US", { + timeZone: "UTC", weekday: "short", month: "short", + day: "2-digit", year: "numeric" + }).replaceAll(',', '') + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + body: `description=${expected.description}&duration=${expected.duration}` + }); + if(addRes.ok) { + const logRes = await fetch(url + `/api/users/${_id}/logs`); + if(logRes.ok){ + const {log} = await logRes.json(); + const exercise = log[0]; + assert.isString(exercise.date); + assert.equal(exercise.date, expected.date); + } else { + throw new Error(`${logRes.status} ${logRes.statusText}`); + } + } else { + throw new Error(`${addRes.status} ${addRes.statusText}`); + }; + } else { + throw new Error(`${res.status} ${res.statusText}`); + }; +}; +``` + +You can add `from`, `to` and `limit` parameters to a `GET /api/users/:_id/logs` request to retrieve part of the log of any user. `from` and `to` are dates in `yyyy-mm-dd` format. `limit` is an integer of how many logs to send back. + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `username=fcc_test_${Date.now()}`.substring(0, 29) + }); + if (res.ok) { + const { _id, username } = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: new Date().toDateString() + }; + const addExerciseRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `description=${expected.description}&duration=${expected.duration}&date=1990-01-01` + }); + const addExerciseTwoRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `description=${expected.description}&duration=${expected.duration}&date=1990-01-03` + }); + if (addExerciseRes.ok && addExerciseTwoRes.ok) { + const logRes = await fetch( + url + `/api/users/${_id}/logs?from=1989-12-31&to=1990-01-04` + ); + if (logRes.ok) { + const { log } = await logRes.json(); + assert.isArray(log); + assert.equal(2, log.length); + } else { + throw new Error(`${logRes.status} ${logRes.statusText}`); + } + const limitRes = await fetch( + url + `/api/users/${_id}/logs?limit=1` + ); + if (limitRes.ok) { + const { log } = await limitRes.json(); + assert.isArray(log); + assert.equal(1, log.length); + } else { + throw new Error(`${limitRes.status} ${limitRes.statusText}`); + } + const filterDateBeforeLimitRes = await fetch( + url + `/api/users/${_id}/logs?from=1990-01-02&to=1990-01-04&limit=1` + ); + if (filterDateBeforeLimitRes.ok) { + const { log } = await filterDateBeforeLimitRes.json(); + assert.isArray(log); + assert.equal(1, log.length); + } else { + throw new Error(`${filterDateBeforeLimitRes.status} ${filterDateBeforeLimitRes.statusText}`); + } + } else { + throw new Error(`${res.status} ${res.statusText}`); + } + } else { + throw new Error(`${res.status} ${res.statusText}`); + } +}; +``` diff --git a/curriculum/challenges/arabic/25-front-end-development/lab-number-guessing-game/602da04c22201c65d2a019f4.md b/curriculum/challenges/arabic/25-front-end-development/lab-number-guessing-game/602da04c22201c65d2a019f4.md new file mode 100644 index 0000000000..ef87dc6720 --- /dev/null +++ b/curriculum/challenges/arabic/25-front-end-development/lab-number-guessing-game/602da04c22201c65d2a019f4.md @@ -0,0 +1,25 @@ +--- +id: 602da04c22201c65d2a019f4 +title: Build a Number Guessing Game +challengeType: 13 +url: freeCodeCamp/learn-number-guessing-game +dashedName: lab-number-guessing-game +--- + +# --description-- + +For this lab, you will use Bash scripting, PostgreSQL, and Git to create a number guessing game that runs in the terminal and saves user information. + +# --instructions-- + +**Important:** After you pass all the project tests, save a dump of your database into a `number_guess.sql` file, as well as your `number_guess.sh` file, so you can complete step 2. There will be instructions on how to do that within the virtual machine. + +# --notes-- + +Required files: `number_guess.sql`, `number_guess.sh` + +# --hints-- + +# --seed-- + +# --solutions-- diff --git a/curriculum/challenges/arabic/25-front-end-development/lab-request-header-parser-microservice/bd7158d8c443edefaeb5bdff.md b/curriculum/challenges/arabic/25-front-end-development/lab-request-header-parser-microservice/bd7158d8c443edefaeb5bdff.md new file mode 100644 index 0000000000..5040e27424 --- /dev/null +++ b/curriculum/challenges/arabic/25-front-end-development/lab-request-header-parser-microservice/bd7158d8c443edefaeb5bdff.md @@ -0,0 +1,65 @@ +--- +id: bd7158d8c443edefaeb5bdff +title: Build a Request Header Parser Microservice +challengeType: 4 +dashedName: lab-request-header-parser-microservice +--- + +# --description-- + +Build a full stack JavaScript app that is functionally similar to this: https://request-header-parser-microservice.freecodecamp.rocks/. Working on this project will involve you writing your code using one of the following methods: + +- Clone this GitHub repo and complete your project locally. +- Use our Gitpod starter project to complete your project. +- Use a site builder of your choice to complete the project. Be sure to incorporate all the files from our GitHub repo. + +# --hints-- + +You should provide your own project, not the example URL. + +```js +(getUserInput) => { + assert( + !/.*\/request-header-parser-microservice\.freecodecamp\.rocks/.test( + getUserInput('url') + ) + ); +}; +``` + +A request to `/api/whoami` should return a JSON object with your IP address in the `ipaddress` key. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/api/whoami').then( + (data) => assert(data.ipaddress && data.ipaddress.length > 0), + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + +A request to `/api/whoami` should return a JSON object with your preferred language in the `language` key. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/api/whoami').then( + (data) => assert(data.language && data.language.length > 0), + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + +A request to `/api/whoami` should return a JSON object with your software in the `software` key. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/api/whoami').then( + (data) => assert(data.software && data.software.length > 0), + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/arabic/25-front-end-development/lab-url-shortener-microservice/bd7158d8c443edefaeb5bd0e.md b/curriculum/challenges/arabic/25-front-end-development/lab-url-shortener-microservice/bd7158d8c443edefaeb5bd0e.md new file mode 100644 index 0000000000..0fbf80a0bf --- /dev/null +++ b/curriculum/challenges/arabic/25-front-end-development/lab-url-shortener-microservice/bd7158d8c443edefaeb5bd0e.md @@ -0,0 +1,107 @@ +--- +id: bd7158d8c443edefaeb5bd0e +title: URL Shortener Microservice +challengeType: 4 +dashedName: url-shortener-microservice +--- + +# --description-- + +Build a full stack JavaScript app that is functionally similar to this: https://url-shortener-microservice.freecodecamp.rocks. Working on this project will involve you writing your code using one of the following methods: + +- Clone this GitHub repo and complete your project locally. +- Use our Gitpod starter project to complete your project. +- Use a site builder of your choice to complete the project. Be sure to incorporate all the files from our GitHub repo. + +# --instructions-- + +**HINT:** Do not forget to use a body parsing middleware to handle the POST requests. Also, you can use the function `dns.lookup(host, cb)` from the `dns` core module to verify a submitted URL. + +# --hints-- + +You should provide your own project, not the example URL. + +```js +(getUserInput) => { + assert( + !/.*\/url-shortener-microservice\.freecodecamp\.rocks/.test( + getUserInput('url') + ) + ); +}; +``` + +You can POST a URL to `/api/shorturl` and get a JSON response with `original_url` and `short_url` properties. Here's an example: `{ original_url : 'https://freeCodeCamp.org', short_url : 1}` + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const urlVariable = Date.now(); + const fullUrl = `${url}/?v=${urlVariable}` + const res = await fetch(url + '/api/shorturl', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `url=${fullUrl}` + }); + if (res.ok) { + const { short_url, original_url } = await res.json(); + assert.isNotNull(short_url); + assert.strictEqual(original_url, `${url}/?v=${urlVariable}`); + } else { + throw new Error(`${res.status} ${res.statusText}`); + } +}; +``` + +When you visit `/api/shorturl/`, you will be redirected to the original URL. + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const urlVariable = Date.now(); + const fullUrl = `${url}/?v=${urlVariable}` + let shortenedUrlVariable; + const postResponse = await fetch(url + '/api/shorturl', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `url=${fullUrl}` + }); + if (postResponse.ok) { + const { short_url } = await postResponse.json(); + shortenedUrlVariable = short_url; + } else { + throw new Error(`${postResponse.status} ${postResponse.statusText}`); + } + const getResponse = await fetch( + url + '/api/shorturl/' + shortenedUrlVariable + ); + if (getResponse) { + const { redirected, url } = getResponse; + assert.isTrue(redirected); + assert.strictEqual(url,fullUrl); + } else { + throw new Error(`${getResponse.status} ${getResponse.statusText}`); + } +}; +``` + +If you pass an invalid URL that doesn't follow the valid `http://www.example.com` format, the JSON response will contain `{ error: 'invalid url' }` + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/shorturl', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `url=ftp:/john-doe.invalidTLD` + }); + if (res.ok) { + const { error } = await res.json(); + assert.isNotNull(error); + assert.strictEqual(error.toLowerCase(), 'invalid url'); + } else { + throw new Error(`${res.status} ${res.statusText}`); + } +}; +``` + diff --git a/curriculum/challenges/arabic/25-front-end-development/lab-world-cup-database/5f9771307d4d22b9d2b75a94.md b/curriculum/challenges/arabic/25-front-end-development/lab-world-cup-database/5f9771307d4d22b9d2b75a94.md new file mode 100644 index 0000000000..d77442a1ba --- /dev/null +++ b/curriculum/challenges/arabic/25-front-end-development/lab-world-cup-database/5f9771307d4d22b9d2b75a94.md @@ -0,0 +1,25 @@ +--- +id: 5f9771307d4d22b9d2b75a94 +title: Build a World Cup Database +challengeType: 13 +url: freeCodeCamp/learn-world-cup-database +dashedName: lab-world-cup-database +--- + +# --description-- + +For this project, you will create a Bash script that enters information from World Cup games into PostgreSQL, then query the database for useful statistics. + +# --instructions-- + +**Important:** After you pass all the project tests, save a dump of your database into a `worldcup.sql` file, as well as your `insert_data.sh` and `queries.sh` files, so you can complete step 2. There will be instructions how to do that within the virtual machine. + +# --notes-- + +Required files: `worldcup.sql`, `insert_data.sh`, `queries.sh` + +# --hints-- + +# --seed-- + +# --solutions-- diff --git a/curriculum/challenges/arabic/25-front-end-development/workshop-hotel-feedback-form/66a96127422411756204bc1b.md b/curriculum/challenges/arabic/25-front-end-development/workshop-hotel-feedback-form/66a96127422411756204bc1b.md index 51ea9e3069..753ee1a6bb 100644 --- a/curriculum/challenges/arabic/25-front-end-development/workshop-hotel-feedback-form/66a96127422411756204bc1b.md +++ b/curriculum/challenges/arabic/25-front-end-development/workshop-hotel-feedback-form/66a96127422411756204bc1b.md @@ -7,9 +7,9 @@ dashedName: step-22 # --description-- -Add another label with the text of `Personal Recommendation`. The `for` attribute should be set to `"recommendation"`. +Add another `label` with the text of `Personal Recommendation`. The `for` attribute should be set to `"recommendation"`. -Below the label element, add another checkbox input with the `id`, `name` and `value` attributes set to `"recommendation"`. +Below the `label` element, add another checkbox `input` with the `id`, `name` and `value` attributes set to `"recommendation"`. # --hints-- diff --git a/curriculum/challenges/arabic/25-front-end-development/workshop-hotel-feedback-form/66a962954f4e0d76223b37ed.md b/curriculum/challenges/arabic/25-front-end-development/workshop-hotel-feedback-form/66a962954f4e0d76223b37ed.md index 42c425209d..80a23ca86d 100644 --- a/curriculum/challenges/arabic/25-front-end-development/workshop-hotel-feedback-form/66a962954f4e0d76223b37ed.md +++ b/curriculum/challenges/arabic/25-front-end-development/workshop-hotel-feedback-form/66a962954f4e0d76223b37ed.md @@ -11,7 +11,7 @@ Next, add another `label` element with the text of `Location` and the `for` attr For the checkbox `input`, both the `id`, `name` and `value` attributes should be set to `"location"`. -Below that `input` element, add another `label` element with the text of `Reputation` and the for attribute set to `"reputation"`. +Below that `input` element, add another `label` element with the text of `Reputation` and the `for` attribute set to `"reputation"`. For the checkbox `input`, both the `id`, `name` and `value` attributes should be set to `"reputation"`. diff --git a/curriculum/challenges/arabic/25-front-end-development/workshop-hotel-feedback-form/66a972137acd1179fa3fe8a0.md b/curriculum/challenges/arabic/25-front-end-development/workshop-hotel-feedback-form/66a972137acd1179fa3fe8a0.md index 69efa4832c..09e3e6e59b 100644 --- a/curriculum/challenges/arabic/25-front-end-development/workshop-hotel-feedback-form/66a972137acd1179fa3fe8a0.md +++ b/curriculum/challenges/arabic/25-front-end-development/workshop-hotel-feedback-form/66a972137acd1179fa3fe8a0.md @@ -7,7 +7,7 @@ dashedName: step-28 # --description-- -Inside your `select` element, add the following five `option` elements with these corresponding values for the option text and `value` attribute: +Inside your `select` element, add the following five `option` elements with these corresponding values for the `option` text and `value` attribute: **Value Attributes:** diff --git a/curriculum/challenges/arabic/25-front-end-development/workshop-hotel-feedback-form/66a97ca8c4cbae7d0bb6e0ad.md b/curriculum/challenges/arabic/25-front-end-development/workshop-hotel-feedback-form/66a97ca8c4cbae7d0bb6e0ad.md index 6549345d45..22b9a707be 100644 --- a/curriculum/challenges/arabic/25-front-end-development/workshop-hotel-feedback-form/66a97ca8c4cbae7d0bb6e0ad.md +++ b/curriculum/challenges/arabic/25-front-end-development/workshop-hotel-feedback-form/66a97ca8c4cbae7d0bb6e0ad.md @@ -7,7 +7,7 @@ dashedName: step-31 # --description-- -Inside your `select` element, add the following five `option` elements with these corresponding values for the option text and `value` attribute: +Inside your `select` element, add the following five `option` elements with these corresponding values for the `option` text and `value` attribute: **Value Attribute:** diff --git a/curriculum/challenges/arabic/25-front-end-development/workshop-loan-qualification-checker/66c8ba41a77db20a93f9d7a1.md b/curriculum/challenges/arabic/25-front-end-development/workshop-loan-qualification-checker/66c8ba41a77db20a93f9d7a1.md new file mode 100644 index 0000000000..237515fd88 --- /dev/null +++ b/curriculum/challenges/arabic/25-front-end-development/workshop-loan-qualification-checker/66c8ba41a77db20a93f9d7a1.md @@ -0,0 +1,71 @@ +--- +id: 66c8ba41a77db20a93f9d7a1 +title: Step 1 +challengeType: 1 +dashedName: step-1 +--- + +# --description-- + +In this workshop, you'll review JavaScript conditionals by building a loan qualification checker app. + +The app will check whether the user is eligible for a duplex, car, and condo loan based on their annual income and credit score. A credit score is a number that represents how good you are at managing borrowed money. + +To get started, create the following variables and values. + +| Variable Name | Value | +| ------------------------- | ------- | +| `minIncomeForDuplex` | `60000` | +| `minCreditScoreForDuplex` | `700` | +| `minIncomeForCondo` | `45000` | +| `minCreditScoreForCondo` | `680` | +| `minIncomeForCar` | `30000` | +| `minCreditScoreForCar` | `650` | + +# --hints-- + +You should create a `minIncomeForDuplex` variable set to `60000`. + +```js +assert.equal(minIncomeForDuplex, 60000); +``` + +You should create a `minCreditScoreForDuplex` set to `700`. + +```js +assert.equal(minCreditScoreForDuplex, 700); +``` + +You should create a `minIncomeForCar` variable set to `30000`. + +```js +assert.equal(minIncomeForCar, 30000); +``` + +You should create a `minCreditScoreForCar` variable set to `650`. + +```js +assert.equal(minCreditScoreForCar, 650); +``` + +You should create a `minIncomeForCondo` variable set to `45000`. + +```js +assert.equal(minIncomeForCondo, 45000); +``` + +You should create a `minCreditScoreForCondo` variable set to `680`. + +```js +assert.equal(minCreditScoreForCondo, 680); +``` + +# --seed-- + +## --seed-contents-- + +```js +--fcc-editable-region-- + +--fcc-editable-region-- +``` diff --git a/curriculum/challenges/arabic/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4ac.md b/curriculum/challenges/arabic/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4ac.md new file mode 100644 index 0000000000..7755f823c4 --- /dev/null +++ b/curriculum/challenges/arabic/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4ac.md @@ -0,0 +1,53 @@ +--- +id: 66c8ba975ee7230e29f6c4ac +title: Step 2 +challengeType: 1 +dashedName: step-2 +--- + +# --description-- + +When the user is eligible for a loan, you'll want to display a message to them in the console. + +For that, you'll build out a function inside which you'll have some checks that'll return what loan the applicant is eligible for. + +Create an empty `getLoanMessage` function with an `annualIncome` and `creditScore` parameters. + +# --hints-- + +You should create a `getLoanMessage` function + +```js +assert.isFunction(getLoanMessage) +``` + +Your `getLoanMessage` function should have an `annualIncome` and `creditScore` as parameters. + +```js +assert.match(getLoanMessage?.toString(), /\(\s*annualIncome,\s*creditScore\s*\)|\(\s*creditScore,\s*annualIncome\s*\)/); +``` + +`getLoanMessage` should be an empty function. + +```js +assert.match(getLoanMessage?.toString(), /\{\s*\}/); +``` + +# --seed-- + +## --seed-contents-- + +```js +const minIncomeForDuplex = 60000; +const minCreditScoreForDuplex = 700; + +const minIncomeForCondo = 45000; +const minCreditScoreForCondo = 680; + +const minIncomeForCar = 30000; +const minCreditScoreForCar = 650; + +--fcc-editable-region-- + +--fcc-editable-region-- +``` diff --git a/curriculum/challenges/arabic/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4ad.md b/curriculum/challenges/arabic/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4ad.md new file mode 100644 index 0000000000..82a29d7cd9 --- /dev/null +++ b/curriculum/challenges/arabic/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4ad.md @@ -0,0 +1,55 @@ +--- +id: 66c8ba975ee7230e29f6c4ad +title: Step 3 +challengeType: 1 +dashedName: step-3 +--- + +# --description-- + +To check which loan a user is qualified for based on the `annualIncome` and `creditScore`, you have to use `if/else if` statement or a ternary right inside the `getLoanMessage` function. You'll then return the appropraite message in the block of each condition. + +Starting with the duplex loan, check if `annualIncome` is greater than or equal to `minIncomeForDuplex` AND if `creditScore` is greater than `minCreditScoreForDuplex`. + +If that condition is true, then the applicant is eligible for a duplex loan and the other loans. So, inside the check, return the string `"You qualify for a car, duplex and Condo loan."` + +# --hints-- + +Your `getLoanMessage` function should return a string. + +```js +assert.isString(getLoanMessage(65000, 750)); +``` + +Your `getLoanMessage` function should return the string `"You qualify for a duplex, condo, and car loan."`. + +```js +assert.strictEqual(getLoanMessage(65000, 750), "You qualify for a duplex, condo, and car loan."); +``` + +Your `getLoanMessage` function should return `undefined` if the applicant's annual income and credit score do not meet the requirements for a duplex loan. + +```js +assert.strictEqual(getLoanMessage(59000, 700), undefined); +``` + +# --seed-- + +## --seed-contents-- + +```js +const minIncomeForDuplex = 60000; +const minCreditScoreForDuplex = 700; + +const minIncomeForCondo = 45000; +const minCreditScoreForCondo = 680; + +const minIncomeForCar = 30000; +const minCreditScoreForCar = 650; + +--fcc-editable-region-- +function getLoanMessage(annualIncome, creditScore) { + +} +--fcc-editable-region-- +``` diff --git a/curriculum/challenges/arabic/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4af.md b/curriculum/challenges/arabic/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4af.md new file mode 100644 index 0000000000..638e6291a4 --- /dev/null +++ b/curriculum/challenges/arabic/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4af.md @@ -0,0 +1,56 @@ +--- +id: 66c8ba975ee7230e29f6c4af +title: Step 4 +challengeType: 1 +dashedName: step-4 +--- + +# --description-- + +If the applicant's annual income is greater than or equal to `minIncomeForCondo`, AND if their credit score is greater than or equal to `minCreditScoreForCondo`, then they qualify for a condo and car loan. + +Check if that's true in the `getLoanMessage` function. If it is, return the string `"You qualify for a condo and car loan."` + +# --hints-- + +Your `getLoanMessage` function should return a string if the applicant qualifies for a condo and car loan. + +```js +assert.isString(getLoanMessage(45000, 680)); +``` + +Your `getLoanMessage` function should return the string `"You qualify for a condo and car loan."`. + +```js +assert.strictEqual(getLoanMessage(45000, 680), "You qualify for a condo and car loan."); +``` + +Your `getLoanMessage` function should return `undefined` if the applicant's annual income and credit score do not meet the requirements for a condo loan. + +```js +assert.strictEqual(getLoanMessage(45000, 650), undefined); +``` + +# --seed-- + +## --seed-contents-- + +```js +const minIncomeForDuplex = 60000; +const minCreditScoreForDuplex = 700; + +const minIncomeForCondo = 45000; +const minCreditScoreForCondo = 680; + +const minIncomeForCar = 30000; +const minCreditScoreForCar = 650; + +function getLoanMessage(annualIncome, creditScore) { + if(creditScore >= minCreditScoreForDuplex && annualIncome >= minIncomeForDuplex) { + return "You qualify for a duplex, condo, and car loan." +--fcc-editable-region-- + } + +--fcc-editable-region-- +} +``` diff --git a/curriculum/challenges/arabic/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b0.md b/curriculum/challenges/arabic/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b0.md new file mode 100644 index 0000000000..374ba7b8fe --- /dev/null +++ b/curriculum/challenges/arabic/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b0.md @@ -0,0 +1,56 @@ +--- +id: 66c8ba975ee7230e29f6c4b0 +title: Step 5 +challengeType: 1 +dashedName: step-5 +--- + +# --description-- + +Now, you should check if the applicant is qualified for a car loan only. If they're, return the string `"You qualify for a car loan."`. + +# --hints-- + +Your `getLoanMessage` function should return a string if the applicant qualifies for a car loan. + +```js +assert.isString(getLoanMessage(30000, 650)); +``` + +Your `getLoanMessage` function should return the string `"You qualify for a car loan."`. + +```js +assert.strictEqual(getLoanMessage(30000, 650), "You qualify for a car loan."); +``` + +Your `getLoanMessage` function should return `undefined` if the applicant's annual income and credit score do not meet the requirements for a car loan. + +```js +assert.strictEqual(getLoanMessage(30000, 600), undefined); +``` + +# --seed-- + +## --seed-contents-- + +```js +const minIncomeForDuplex = 60000; +const minCreditScoreForDuplex = 700; + +const minIncomeForCondo = 45000; +const minCreditScoreForCondo = 680; + +const minIncomeForCar = 30000; +const minCreditScoreForCar = 650; + +function getLoanMessage(annualIncome, creditScore) { + if(creditScore >= minCreditScoreForDuplex && annualIncome >= minIncomeForDuplex) { + return "You qualify for a duplex, condo, and car loan." + } else if (annualIncome >= minIncomeForCondo && creditScore >= minCreditScoreForCondo) { + return "You qualify for a condo and car loan." +--fcc-editable-region-- + } + +--fcc-editable-region-- +} +``` diff --git a/curriculum/challenges/arabic/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b1.md b/curriculum/challenges/arabic/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b1.md new file mode 100644 index 0000000000..16e8c7baca --- /dev/null +++ b/curriculum/challenges/arabic/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b1.md @@ -0,0 +1,54 @@ +--- +id: 66c8ba975ee7230e29f6c4b1 +title: Step 6 +challengeType: 1 +dashedName: step-6 +--- + +# --description-- + +If the applicant's annual income and credit score fall below `minIncomeForCar` and `minCreditScoreForCar`, then they don't qualify for any loan. So, return the string `"You don't qualify for any loans."` + +# --hints-- + +Your `getLoanMessage` function should return a string if the applicant doesn't qualify for any loan. + +```js +assert.isString(getLoanMessage(25000, 550)); +``` + +Your `getLoanMessage` function should return the string `"You don't qualify for any loans."` if the applicant does not meet the requirements for any loan. + +```js +assert.strictEqual(getLoanMessage(15000, 600), "You don't qualify for any loans."); +assert.strictEqual(getLoanMessage(25000, 550), "You don't qualify for any loans."); +assert.strictEqual(getLoanMessage(20000, 500), "You don't qualify for any loans."); +``` + +# --seed-- + +## --seed-contents-- + +```js +const minIncomeForDuplex = 60000; +const minCreditScoreForDuplex = 700; + +const minIncomeForCondo = 45000; +const minCreditScoreForCondo = 680; + +const minIncomeForCar = 30000; +const minCreditScoreForCar = 650; + +function getLoanMessage(annualIncome, creditScore) { + if(creditScore >= minCreditScoreForDuplex && annualIncome >= minIncomeForDuplex) { + return "You qualify for a duplex, condo, and car loan." + } else if (annualIncome >= minIncomeForCondo && creditScore >= minCreditScoreForCondo) { + return "You qualify for a condo and car loan." + } else if (annualIncome >= minIncomeForCar && creditScore >= minCreditScoreForCar) { + return "You qualify for a car loan." +--fcc-editable-region-- + } + +--fcc-editable-region-- +} +``` diff --git a/curriculum/challenges/arabic/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b2.md b/curriculum/challenges/arabic/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b2.md new file mode 100644 index 0000000000..9d19f9ea4c --- /dev/null +++ b/curriculum/challenges/arabic/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b2.md @@ -0,0 +1,165 @@ +--- +id: 66c8ba975ee7230e29f6c4b2 +title: Step 7 +challengeType: 1 +dashedName: step-7 +--- + +# --description-- + +Now, it is time to test out your `getLoanMessage` function. + +Use the table below to create `4` variables and their values: + +| Variable Name | Value | +| --------------- | ---------------------------- | +| `duplexLoanMsg` | `getLoanMessage(85000, 850)` | +| `condoLoanMsg` | `getLoanMessage(65000, 690)` | +| `carLoanMsg` | `getLoanMessage(45000, 660)` | +| `noLoanMsg` | `getLoanMessage(25000, 550)` | + +After that, log each variable to the console to see the messages. + +With that, your loan qualification checker project is complete! + +# --hints-- + +You should have a variable called `duplexLoanMsg`. + +```js +assert.isNotNull(duplexLoanMsg); +``` + +Your `duplexLoanMsg` variable should be set to the result of `getLoanMessage(85000, 850)`. + +```js +assert.equal(duplexLoanMsg, getLoanMessage(85000, 850)); +``` + +You should log the `duplexLoanMsg` variable to the console. + +```js +assert.match(code, /console\.log\(duplexLoanMsg\)/) +``` + +You should have a variable called `condoLoanMsg`. + +```js +assert.isNotNull(condoLoanMsg); +``` + +Your `condoLoanMsg` variable should be set to the result of `getLoanMessage(65000, 690)`. + +```js +assert.equal(condoLoanMsg, getLoanMessage(65000, 690)); +``` + +You should log the `condoLoanMsg` variable to the console. + +```js +assert.match(code, /console\.log\(condoLoanMsg\)/) +``` + +You should have a variable called `carLoanMsg`. + +```js +assert.isNotNull(carLoanMsg); +``` + +Your `carLoanMsg` variable should be set to the result of `getLoanMessage(45000, 660)`. + +```js +assert.equal(carLoanMsg, getLoanMessage(45000, 660)); +``` + +You should log the `carLoanMsg` variable to the console. + +```js +assert.match(code, /console\.log\(carLoanMsg\)/) +``` + +You should have a variable called `noLoanMsg`. + +```js +assert.isNotNull(noLoanMsg); +``` + +Your `noLoanMsg` variable should be set to the result of `getLoanMessage(25000, 550)`. + +```js +assert.equal(noLoanMsg, getLoanMessage(25000, 550)); +``` + +You should log the `noLoanMsg` variable to the console. + +```js +assert.match(code, /console\.log\(noLoanMsg\)/) +``` + +# --seed-- + +## --seed-contents-- + +```js +const minIncomeForDuplex = 60000; +const minCreditScoreForDuplex = 700; + +const minIncomeForCondo = 45000; +const minCreditScoreForCondo = 680; + +const minIncomeForCar = 30000; +const minCreditScoreForCar = 650; + +function getLoanMessage(annualIncome, creditScore) { + if(creditScore >= minCreditScoreForDuplex && annualIncome >= minIncomeForDuplex) { + return "You qualify for a duplex, condo, and car loan." + } else if (annualIncome >= minIncomeForCondo && creditScore >= minCreditScoreForCondo) { + return "You qualify for a condo and car loan." + } else if (annualIncome >= minIncomeForCar && creditScore >= minCreditScoreForCar) { + return "You qualify for a car loan." + } else { + return "You don't qualify for any loans." + } +} + +--fcc-editable-region-- + +--fcc-editable-region-- +``` + +# --solutions-- + +```js +const minIncomeForDuplex = 60000; +const minCreditScoreForDuplex = 700; + +const minIncomeForCondo = 45000; +const minCreditScoreForCondo = 680; + +const minIncomeForCar = 30000; +const minCreditScoreForCar = 650; + +function getLoanMessage(annualIncome, creditScore) { + if(creditScore >= minCreditScoreForDuplex && annualIncome >= minIncomeForDuplex) { + return "You qualify for a duplex, condo, and car loan." + } else if (annualIncome >= minIncomeForCondo && creditScore >= minCreditScoreForCondo) { + return "You qualify for a condo and car loan." + } else if (annualIncome >= minIncomeForCar && creditScore >= minCreditScoreForCar) { + return "You qualify for a car loan." + } else { + return "You don't qualify for any loans." + } +} + +const duplexLoanMsg = getLoanMessage(85000, 850) +console.log(duplexLoanMsg) + +const condoLoanMsg = getLoanMessage(65000, 690) +console.log(condoLoanMsg) + +const carLoanMsg = getLoanMessage(45000, 660) +console.log(carLoanMsg) + +const noLoanMsg = getLoanMessage(25000, 550) +console.log(noLoanMsg) +``` diff --git a/curriculum/challenges/arabic/25-front-end-development/workshop-mario-database/5f2c289f164c29556da632fd.md b/curriculum/challenges/arabic/25-front-end-development/workshop-mario-database/5f2c289f164c29556da632fd.md new file mode 100644 index 0000000000..4e11751ca0 --- /dev/null +++ b/curriculum/challenges/arabic/25-front-end-development/workshop-mario-database/5f2c289f164c29556da632fd.md @@ -0,0 +1,19 @@ +--- +id: 5f2c289f164c29556da632fd +title: Build a Mario Database +challengeType: 12 +url: freeCodeCamp/learn-relational-databases-by-building-a-mario-database +dashedName: build-a-mario-database +--- + +# --description-- + +In this 165-lesson workshop, you will learn the basics of a relational database by creating a PostgreSQL database filled with video game characters. + +# --instructions-- + +# --hints-- + +# --seed-- + +# --solutions-- diff --git a/curriculum/challenges/arabic/25-front-end-development/workshop-npm-packages/587d7fb3367417b2b2512bfb.md b/curriculum/challenges/arabic/25-front-end-development/workshop-npm-packages/587d7fb3367417b2b2512bfb.md new file mode 100644 index 0000000000..8d4c90410d --- /dev/null +++ b/curriculum/challenges/arabic/25-front-end-development/workshop-npm-packages/587d7fb3367417b2b2512bfb.md @@ -0,0 +1,53 @@ +--- +id: 587d7fb3367417b2b2512bfb +title: How to Use package.json, the Core of Any Node.js Project or npm Package +challengeType: 2 +forumTopicId: 301528 +dashedName: how-to-use-package-json-the-core-of-any-node-js-project-or-npm-package +--- + +# --description-- + +Working on these challenges will involve you writing your code using one of the following methods: + +- Clone this GitHub repo and complete these challenges locally. +- Use our Gitpod starter project to complete these challenges. +- Use a site builder of your choice to complete the project. Be sure to incorporate all the files from our GitHub repo. + +The `package.json` file is the center of any Node.js project or npm package. It stores information about your project. It consists of a single JSON object where information is stored in key-value pairs. There are only two required fields; `name` and `version`, but it’s good practice to provide additional information. + +You can create the `package.json` file from the terminal using the `npm init` command. This will run a guided setup. Using `npm init` with the `-y` flag will generate the file without having it ask any questions, `npm init -y`. + +If you look at the file tree of your project, you will find the `package.json` file on the top level of the tree. This is the file that you will be improving in the next couple of challenges. + +One of the most common pieces of information in this file is the `author` field. It specifies who created the project, and can consist of a string or an object with contact or other details. An object is recommended for bigger projects, but a simple string like the following example will do for this project. + +```json +"author": "Jane Doe", +``` + +# --instructions-- + +Add your name as the `author` of the project in the `package.json` file. + +**Note:** Remember that you’re writing JSON, so all field names must use double-quotes (") and be separated with a comma (,). + +If you are using Gitpod, make sure the app is running and the preview window is open. Copy the preview window's URL and paste it into the Solution Link input below. + +# --hints-- + +`package.json` should have a valid "author" key + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert(packJson.author, '"author" is missing'); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/arabic/25-front-end-development/workshop-npm-packages/587d7fb3367417b2b2512bfc.md b/curriculum/challenges/arabic/25-front-end-development/workshop-npm-packages/587d7fb3367417b2b2512bfc.md new file mode 100644 index 0000000000..37d15d5261 --- /dev/null +++ b/curriculum/challenges/arabic/25-front-end-development/workshop-npm-packages/587d7fb3367417b2b2512bfc.md @@ -0,0 +1,43 @@ +--- +id: 587d7fb3367417b2b2512bfc +title: Add a Description to Your package.json +challengeType: 2 +forumTopicId: 301522 +dashedName: add-a-description-to-your-package-json +--- + +# --description-- + +The next part of a good package.json file is the `description` field; where a short, but informative description about your project belongs. + +If some day you plan to publish a package to npm, this is the string that should sell your idea to the user when they decide whether to install your package or not. However, that’s not the only use case for the description, it’s a great way to summarize what a project does. It’s just as important in any Node.js project to help other developers, future maintainers or even your future self understand the project quickly. + +Regardless of what you plan for your project, a description is definitely recommended. Here's an example: + +```json +"description": "A project that does something awesome", +``` + +# --instructions-- + +Add a `description` to the package.json file of your project. + +**Note:** Remember to use double-quotes for field-names (") and commas (,) to separate fields. + +# --hints-- + +package.json should have a valid "description" key + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert(packJson.description, '"description" is missing'); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/arabic/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bfd.md b/curriculum/challenges/arabic/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bfd.md new file mode 100644 index 0000000000..a001cdd477 --- /dev/null +++ b/curriculum/challenges/arabic/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bfd.md @@ -0,0 +1,75 @@ +--- +id: 587d7fb4367417b2b2512bfd +title: Add Keywords to Your package.json +challengeType: 2 +forumTopicId: 301526 +dashedName: add-keywords-to-your-package-json +--- + +# --description-- + +The `keywords` field is where you can describe your project using related keywords. Here's an example: + +```json +"keywords": [ "descriptive", "related", "words" ], +``` + +As you can see, this field is structured as an array of double-quoted strings. + +# --instructions-- + +Add an array of suitable strings to the `keywords` field in the package.json file of your project. + +One of the keywords should be "freecodecamp". + +# --hints-- + +package.json should have a valid "keywords" key + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert(packJson.keywords, '"keywords" is missing'); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + +"keywords" field should be an Array + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.isArray(packJson.keywords, '"keywords" is not an array'); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + +"keywords" should include "freecodecamp" + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.include( + packJson.keywords, + 'freecodecamp', + '"keywords" does not include "freecodecamp"' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/arabic/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bfe.md b/curriculum/challenges/arabic/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bfe.md new file mode 100644 index 0000000000..7b09acd042 --- /dev/null +++ b/curriculum/challenges/arabic/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bfe.md @@ -0,0 +1,39 @@ +--- +id: 587d7fb4367417b2b2512bfe +title: Add a License to Your package.json +challengeType: 2 +forumTopicId: 301523 +dashedName: add-a-license-to-your-package-json +--- + +# --description-- + +The `license` field is where you inform users of what they are allowed to do with your project. + +Some common licenses for open source projects include MIT and BSD. License information is not required, and copyright laws in most countries will give you ownership of what you create by default. However, it’s always a good practice to explicitly state what users can and can’t do. Here's an example of the license field: + +```json +"license": "MIT", +``` + +# --instructions-- + +Fill the `license` field in the package.json file of your project as you find suitable. + +# --hints-- + +package.json should have a valid "license" key + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert(packJson.license, '"license" is missing'); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/arabic/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bff.md b/curriculum/challenges/arabic/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bff.md new file mode 100644 index 0000000000..f2e571faed --- /dev/null +++ b/curriculum/challenges/arabic/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bff.md @@ -0,0 +1,37 @@ +--- +id: 587d7fb4367417b2b2512bff +title: Add a Version to Your package.json +challengeType: 2 +forumTopicId: 301525 +dashedName: add-a-version-to-your-package-json +--- + +# --description-- + +A `version` is one of the required fields of your package.json file. This field describes the current version of your project. Here's an example: + +```json +"version": "1.2.0", +``` + +# --instructions-- + +Add a `version` to the package.json file of your project. + +# --hints-- + +package.json should have a valid "version" key + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert(packJson.version, '"version" is missing'); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/arabic/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512c00.md b/curriculum/challenges/arabic/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512c00.md new file mode 100644 index 0000000000..161c60fe69 --- /dev/null +++ b/curriculum/challenges/arabic/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512c00.md @@ -0,0 +1,68 @@ +--- +id: 587d7fb4367417b2b2512c00 +title: Expand Your Project with External Packages from npm +challengeType: 2 +forumTopicId: 301527 +dashedName: expand-your-project-with-external-packages-from-npm +--- + +# --description-- + +One of the biggest reasons to use a package manager, is their powerful dependency management. Instead of manually having to make sure that you get all dependencies whenever you set up a project on a new computer, npm automatically installs everything for you. But how can npm know exactly what your project needs? Meet the `dependencies` section of your package.json file. + +In this section, packages your project requires are stored using the following format: + +```json +"dependencies": { + "package-name": "version", + "express": "4.14.0" +} + +``` + +# --instructions-- + +Add version `1.1.0` of the `@freecodecamp/example` package to the `dependencies` field of your `package.json` file. + +**Note:** `@freecodecamp/example` is a faux package used as a learning tool. + +# --hints-- + +`"dependencies"` should include `"@freecodecamp/example"`. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.property( + packJson.dependencies, + '@freecodecamp/example', + '"dependencies" does not include "@freecodecamp/example"' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + +`"@freecodecamp/example"` version should be `"1.1.0"`. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.match( + packJson.dependencies["@freecodecamp/example"], + /^[\^\~]?1\.1\.0/, + 'Wrong version of "@freecodecamp/example" installed. It should be 1.1.0' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/arabic/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c01.md b/curriculum/challenges/arabic/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c01.md new file mode 100644 index 0000000000..deda9b82de --- /dev/null +++ b/curriculum/challenges/arabic/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c01.md @@ -0,0 +1,64 @@ +--- +id: 587d7fb5367417b2b2512c01 +title: Manage npm Dependencies By Understanding Semantic Versioning +challengeType: 2 +forumTopicId: 301529 +dashedName: manage-npm-dependencies-by-understanding-semantic-versioning +--- + +# --description-- + +`Versions` of the npm packages in the dependencies section of your package.json file follow what’s called Semantic Versioning (SemVer), an industry standard for software versioning aiming to make it easier to manage dependencies. Libraries, frameworks or other tools published on npm should use SemVer in order to clearly communicate what kind of changes projects can expect if they update. + +Knowing SemVer can be useful when you develop software that uses external dependencies (which you almost always do). One day, your understanding of these numbers will save you from accidentally introducing breaking changes to your project without understanding why things that worked yesterday suddenly don’t work today. This is how Semantic Versioning works according to the official website: + +```json +"package": "MAJOR.MINOR.PATCH" +``` + +The MAJOR version should increment when you make incompatible API changes. The MINOR version should increment when you add functionality in a backwards-compatible manner. The PATCH version should increment when you make backwards-compatible bug fixes. This means that PATCHes are bug fixes and MINORs add new features but neither of them break what worked before. Finally, MAJORs add changes that won’t work with earlier versions. + +# --instructions-- + +In the dependencies section of your `package.json` file, change the version of `@freecodecamp/example` to match MAJOR version 1, MINOR version 2 and PATCH version 13 + +# --hints-- + +`"dependencies"` should include `"@freecodecamp/example"`. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.property( + packJson.dependencies, + '@freecodecamp/example', + '"dependencies" does not include "@freecodecamp/example"' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + +`"@freecodecamp/example"` version should be `"1.2.13"`. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.equal( + packJson.dependencies["@freecodecamp/example"], + '1.2.13', + 'Wrong version of "@freecodecamp/example". It should be 1.2.13' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/arabic/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c02.md b/curriculum/challenges/arabic/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c02.md new file mode 100644 index 0000000000..8eae5f51ee --- /dev/null +++ b/curriculum/challenges/arabic/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c02.md @@ -0,0 +1,66 @@ +--- +id: 587d7fb5367417b2b2512c02 +title: Use the Tilde-Character to Always Use the Latest Patch Version of a Dependency +challengeType: 2 +forumTopicId: 301532 +dashedName: use-the-tilde-character-to-always-use-the-latest-patch-version-of-a-dependency +--- + +# --description-- + +In the last challenge, you told npm to only include a specific version of a package. That’s a useful way to freeze your dependencies if you need to make sure that different parts of your project stay compatible with each other. But in most use cases, you don’t want to miss bug fixes since they often include important security patches and (hopefully) don’t break things in doing so. + +To allow an npm dependency to update to the latest PATCH version, you can prefix the dependency’s version with the tilde (`~`) character. Here's an example of how to allow updates to any `1.3.x` version. + +```json +"package": "~1.3.8" +``` + +# --instructions-- + +In the package.json file, your current rule for how npm may upgrade `@freecodecamp/example` is to use a specific version (`1.2.13`). But now, you want to allow the latest `1.2.x` version. + +Use the tilde (`~`) character to prefix the version of `@freecodecamp/example` in your dependencies, and allow npm to update it to any new _patch_ release. + +**Note:** The version numbers themselves should not be changed. + +# --hints-- + +`"dependencies"` should include `"@freecodecamp/example"`. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.property( + packJson.dependencies, + '@freecodecamp/example', + '"dependencies" does not include "@freecodecamp/example"' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + +`"@freecodecamp/example"` version should match `"~1.2.13"`. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.match( + packJson.dependencies["@freecodecamp/example"], + /^\~1\.2\.13/, + 'Wrong version of "@freecodecamp/example". It should be ~1.2.13' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/arabic/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c03.md b/curriculum/challenges/arabic/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c03.md new file mode 100644 index 0000000000..adc3014ea4 --- /dev/null +++ b/curriculum/challenges/arabic/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c03.md @@ -0,0 +1,66 @@ +--- +id: 587d7fb5367417b2b2512c03 +title: Use the Caret-Character to Use the Latest Minor Version of a Dependency +challengeType: 2 +forumTopicId: 301531 +dashedName: use-the-caret-character-to-use-the-latest-minor-version-of-a-dependency +--- + +# --description-- + +Similar to how the tilde we learned about in the last challenge allows npm to install the latest PATCH for a dependency, the caret (`^`) allows npm to install future updates as well. The difference is that the caret will allow both MINOR updates and PATCHes. + +Your current version of `@freecodecamp/example` should be `~1.2.13` which allows npm to install to the latest `1.2.x` version. If you were to use the caret (^) as a version prefix instead, npm would be allowed to update to any `1.x.x` version. + +```json +"package": "^1.3.8" +``` + +This would allow updates to any `1.x.x` version of the package. + +# --instructions-- + +Use the caret (`^`) to prefix the version of `@freecodecamp/example` in your dependencies and allow npm to update it to any new MINOR release. + +**Note:** The version numbers themselves should not be changed. + +# --hints-- + +`"dependencies"` should include `"@freecodecamp/example"`. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.property( + packJson.dependencies, + '@freecodecamp/example', + '"dependencies" does not include "@freecodecamp/example"' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + +`"@freecodecamp/example"` version should match `"^1.x.x"`. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.match( + packJson.dependencies["@freecodecamp/example"], + /^\^1\./, + 'Wrong version of "@freecodecamp/example". It should be ^1.2.13' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/arabic/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c04.md b/curriculum/challenges/arabic/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c04.md new file mode 100644 index 0000000000..5f695eed88 --- /dev/null +++ b/curriculum/challenges/arabic/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c04.md @@ -0,0 +1,43 @@ +--- +id: 587d7fb5367417b2b2512c04 +title: Remove a Package from Your Dependencies +challengeType: 2 +forumTopicId: 301530 +dashedName: remove-a-package-from-your-dependencies +--- + +# --description-- + +You have now tested a few ways you can manage dependencies of your project by using the package.json's dependencies section. You have also included external packages by adding them to the file and even told npm what types of versions you want, by using special characters such as the tilde or the caret. + +But what if you want to remove an external package that you no longer need? You might already have guessed it, just remove the corresponding key-value pair for that package from your dependencies. + +This same method applies to removing other fields in your package.json as well. + +# --instructions-- + +Remove the `@freecodecamp/example` package from your dependencies. + +**Note:** Make sure you have the right amount of commas after removing it. + +# --hints-- + +`"dependencies"` should not include `"@freecodecamp/example"`. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.notProperty( + packJson.dependencies, + '@freecodecamp/example', + '"dependencies" still includes "@freecodecamp/example"' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/chinese-traditional/13-relational-databases/build-a-periodic-table-database-project/build-a-periodic-table-database.md b/curriculum/challenges/chinese-traditional/13-relational-databases/build-a-periodic-table-database-project/build-a-periodic-table-database.md index b41ff255a4..379499275e 100644 --- a/curriculum/challenges/chinese-traditional/13-relational-databases/build-a-periodic-table-database-project/build-a-periodic-table-database.md +++ b/curriculum/challenges/chinese-traditional/13-relational-databases/build-a-periodic-table-database-project/build-a-periodic-table-database.md @@ -8,7 +8,7 @@ dashedName: build-a-periodic-table-database # --description-- -這是你獲得認證的必做項目之一。 對於此項目,你將創建 Bash 腳本以從元素週期表數據庫中獲取有關化學元素的信息。 +這是你獲得認證的必做項目之一。 For this project, you will create a Bash script to get information about chemical elements from a periodic table database. # --instructions-- diff --git a/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/learn-basic-css-by-building-a-cafe-menu/5f3ef6e0a81099d9a697b550.md b/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/learn-basic-css-by-building-a-cafe-menu/5f3ef6e0a81099d9a697b550.md index 8acf942f13..7827cdcb58 100644 --- a/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/learn-basic-css-by-building-a-cafe-menu/5f3ef6e0a81099d9a697b550.md +++ b/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/learn-basic-css-by-building-a-cafe-menu/5f3ef6e0a81099d9a697b550.md @@ -9,6 +9,8 @@ dashedName: step-64 在 `footer` 中,添加一個 `p` 元素。 然後,在 `p` 中嵌套一個錨(`a`)元素,鏈接到 `https://www.freecodecamp.org`,並有文字 `Visit our website`。 +Make sure that the link opens in a new tab by adding a `target` attribute with the value `_blank`. + # --hints-- 你不應該修改現有的 `footer` 元素。 @@ -43,6 +45,12 @@ assert(document.querySelector("footer > p > a")?.innerText === "Visit our websit assert(document.querySelector("footer > p > a")?.href === "https://www.freecodecamp.org/"); ``` +Your new `a` element should have the `target` attribute set to `_blank`. + +```js +assert.equal(document.querySelector("footer > p > a")?.target, "_blank"); +``` + # --seed-- ## --seed-contents-- diff --git a/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/learn-intermediate-css-by-building-a-cat-painting/646de7b64467e96b7d35b5cd.md b/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/learn-intermediate-css-by-building-a-cat-painting/646de7b64467e96b7d35b5cd.md index b9940170e8..b5899009cf 100644 --- a/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/learn-intermediate-css-by-building-a-cat-painting/646de7b64467e96b7d35b5cd.md +++ b/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/learn-intermediate-css-by-building-a-cat-painting/646de7b64467e96b7d35b5cd.md @@ -7,7 +7,7 @@ dashedName: step-47 # --description-- -Move the right eye into position with a `position` property of `absolute`, a `top` of `54px`, and a `left` of `134px`. +將右眼移動到位,其 `position` 屬性爲 `absolute`,`top` 爲 `54px`,`left` 爲 `134px`。 # --hints-- diff --git a/curriculum/challenges/chinese-traditional/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-j.md b/curriculum/challenges/chinese-traditional/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-j.md index d2ad72a1ea..1b6ca05444 100644 --- a/curriculum/challenges/chinese-traditional/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-j.md +++ b/curriculum/challenges/chinese-traditional/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-j.md @@ -21,12 +21,12 @@ Remove `flex: 1` from `.item` and add `justify-content: space-between` to `.cont `justify-content` aligns items across the **main axis**. There are a few values that you can use here. You'll learn the rest of them in the reading assignments, but for now try changing it to center, which should center the boxes along the main axis. -# --question-- - -## --assignment-- +# --assignment-- Before moving on to the next lesson, see what is possible with the `justify-content` property. Read this [interactive article on MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/justify-content) and play around with the different values of `justify-content` on the example. +# --question-- + ## --text-- How does applying `justify-content: space-between` to a flex container affect the positioning of its items? diff --git a/curriculum/challenges/chinese-traditional/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-k.md b/curriculum/challenges/chinese-traditional/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-k.md index d3137b0af5..59acb55a29 100644 --- a/curriculum/challenges/chinese-traditional/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-k.md +++ b/curriculum/challenges/chinese-traditional/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-k.md @@ -17,12 +17,12 @@ To change the placement of items along the cross axis use `align-items`. Try get Because `justify-content` and `align-items` are based on the main and cross axis of your container, their behavior changes when you change the flex-direction of a flex-container. For example, when you change `flex-direction` to `column`, `justify-content` aligns vertically and `align-items` aligns horizontally. The most common behavior, however, is the default, i.e. `justify-content` aligns items horizontally (because the main axis defaults to horizontal), and `align-items` aligns them vertically. One of the biggest sticking points that beginners have with flexbox is confusion when this behavior changes. -# --question-- - -## --assignment-- +# --assignment-- Before moving on to the next lesson, see if you can figure out how `align-items` behaves when you change the `flex-direction` property to `column`. +# --question-- + ## --text-- When changing the `flex-direction` property to `column` in a flex container, how does `align-items` behave in relation to the flex items? diff --git a/curriculum/challenges/chinese-traditional/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-b.md b/curriculum/challenges/chinese-traditional/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-b.md index 1adf9ce84f..49edeac0e4 100644 --- a/curriculum/challenges/chinese-traditional/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-b.md +++ b/curriculum/challenges/chinese-traditional/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-b.md @@ -9,12 +9,12 @@ dashedName: learn-block-and-inline-lesson-b Inline elements, however, do not start on a new line. They appear in line with whatever elements they are placed beside. A clear example of an inline element is a link, or `` tag. If you stick one of these in the middle of a paragraph of text, it will behave like a part of the paragraph. (Like this) The link’s text will sit alongside other words in that paragraph. Additionally, padding and margin behave differently on inline elements. In general, you do not want to try to put extra padding or margin on inline elements. -# --question-- - -## --assignment-- +# --assignment-- Search the web for a list of `block` elements and a list of `inline` elements. +# --question-- + ## --text-- What is the difference between a `block` element and an `inline` element? diff --git a/curriculum/challenges/chinese-traditional/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-g.md b/curriculum/challenges/chinese-traditional/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-g.md index cdd4d5aa87..e75492e9c1 100644 --- a/curriculum/challenges/chinese-traditional/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-g.md +++ b/curriculum/challenges/chinese-traditional/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-g.md @@ -7,7 +7,7 @@ dashedName: learn-block-and-inline-lesson-g # --description-- -Now that you have some basic understanding of `block` and inline `elements`, pull up your list of `block` and `inline` elements from a couple questions ago and see if you can identify which of the following elements are `block` elements and which are `inline` elements. +Now that you have some basic understanding of `block` and `inline` elements, pull up your list of `block` and `inline` elements from a couple questions ago and see if you can identify which of the following elements are `block` elements and which are `inline` elements. # --question-- diff --git a/curriculum/challenges/chinese-traditional/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-a.md b/curriculum/challenges/chinese-traditional/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-a.md index 995073b8a2..a7a2ee9a51 100644 --- a/curriculum/challenges/chinese-traditional/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-a.md +++ b/curriculum/challenges/chinese-traditional/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-a.md @@ -21,12 +21,12 @@ New programmers often find problem solving the hardest skill to build. It's not The best way to improve your problem solving ability is by building experience by making lots and lots of programs. The more practice you have the better you'll be prepared to solve real world problems. -# --question-- - -## --assignment-- +# --assignment-- Read How to Think Like a Programmer - Lessons in Problem Solving by Richard Reis. +# --question-- + ## --text-- According to V. Anton Spraul in "Think Like a Programmer," what is problem solving in programming? diff --git a/curriculum/challenges/chinese-traditional/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-b.md b/curriculum/challenges/chinese-traditional/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-b.md index ae905ecf89..c57a7d43e8 100644 --- a/curriculum/challenges/chinese-traditional/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-b.md +++ b/curriculum/challenges/chinese-traditional/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-b.md @@ -25,11 +25,11 @@ Now that you know what you’re aiming to solve, don’t jump into coding just y The last question is where you will write out an algorithm to solve the problem. You can think of an algorithm as a recipe for solving a particular problem. It defines the steps that need to be taken by the computer to solve a problem in pseudocode. -# --question-- - -## --assignment-- +# --assignment-- Watch How to Begin Thinking Like a Programmer by Coding Tech. It’s an hour long but packed full of information and definitely worth your time watching. +# --question-- + ## --text-- What should you do before starting to code according to the provided text? diff --git a/curriculum/challenges/chinese-traditional/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-c.md b/curriculum/challenges/chinese-traditional/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-c.md index c837fd9658..082f2d51ae 100644 --- a/curriculum/challenges/chinese-traditional/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-c.md +++ b/curriculum/challenges/chinese-traditional/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-c.md @@ -22,12 +22,12 @@ Print the value of the counter variable This is a basic program to demonstrate how pseudocode looks. There will be more examples of pseudocode included in the assignments. +# --assignment-- -# --question-- - -## --assignment-- Read this Pseudocode: What It Is and How to Write It article from Built In. +# --question-- + ## --text-- What are the benefits of using pseudocode according to the linked article? diff --git a/curriculum/challenges/chinese-traditional/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657b69e10d6606a0185d4d4f.md b/curriculum/challenges/chinese-traditional/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657b69e10d6606a0185d4d4f.md index 67cd63830c..9e77d699c7 100644 --- a/curriculum/challenges/chinese-traditional/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657b69e10d6606a0185d4d4f.md +++ b/curriculum/challenges/chinese-traditional/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657b69e10d6606a0185d4d4f.md @@ -9,7 +9,7 @@ dashedName: task-23 # --description-- -So far you have learned how to create questions with the verb to be. In sentences with the verb `to be` (am, is, are) you just have to change the order of the noun and the verb to create a question. Like this: +So far you have learned how to create questions with the verb `to be`. In sentences with the verb `to be` (am, is, are) you just have to change the order of the noun and the verb to create a question. Like this: `You are a developer` -> `Are you a developer?` diff --git a/curriculum/challenges/chinese-traditional/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657dce8ff35869721311a5e3.md b/curriculum/challenges/chinese-traditional/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657dce8ff35869721311a5e3.md index 544d8f1988..8cd311a518 100644 --- a/curriculum/challenges/chinese-traditional/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657dce8ff35869721311a5e3.md +++ b/curriculum/challenges/chinese-traditional/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657dce8ff35869721311a5e3.md @@ -21,7 +21,7 @@ Which sentence is correct for describing one place near you? ### --feedback-- -`There are` is used for plural nouns, and `bank` is singular. You’ll learn about there are in the next few lessons. +`There are` is used for plural nouns, and `bank` is singular. You’ll learn about `there are` in the next few lessons. --- diff --git a/curriculum/challenges/chinese-traditional/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657dcee413423174ca3747f5.md b/curriculum/challenges/chinese-traditional/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657dcee413423174ca3747f5.md index 6526b1e95b..10c0845779 100644 --- a/curriculum/challenges/chinese-traditional/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657dcee413423174ca3747f5.md +++ b/curriculum/challenges/chinese-traditional/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657dcee413423174ca3747f5.md @@ -7,7 +7,7 @@ dashedName: task-112 # --description-- -To elaborate a question using `there is` you just need to change the order of the verb to be, like so: +To elaborate a question using `there is` you just need to change the order of the verb `to be`, like so: `There is an ATM nearby` -> `Is there an ATM nearby?` diff --git a/curriculum/challenges/chinese-traditional/25-front-end-development/lab-celestial-bodies-database/5f1a4ef5d5d6b5ab580fc6ae.md b/curriculum/challenges/chinese-traditional/25-front-end-development/lab-celestial-bodies-database/5f1a4ef5d5d6b5ab580fc6ae.md new file mode 100644 index 0000000000..7d664a8876 --- /dev/null +++ b/curriculum/challenges/chinese-traditional/25-front-end-development/lab-celestial-bodies-database/5f1a4ef5d5d6b5ab580fc6ae.md @@ -0,0 +1,25 @@ +--- +id: 5f1a4ef5d5d6b5ab580fc6ae +title: Build a Celestial Bodies Database +challengeType: 13 +url: freeCodeCamp/learn-celestial-bodies-database +dashedName: lab-celestial-bodies-database +--- + +# --description-- + +For this project, you will build a database of celestial bodies using PostgreSQL. + +# --instructions-- + +**Important:** After you pass all the project tests, save a dump of your database into a `universe.sql` file so you can complete step 2. There will be instructions how to do that within the virtual machine. + +# --notes-- + +Required files: `universe.sql` + +# --hints-- + +# --seed-- + +# --solutions-- diff --git a/curriculum/challenges/chinese-traditional/25-front-end-development/lab-exercise-tracker/5a8b073d06fa14fcfde687aa.md b/curriculum/challenges/chinese-traditional/25-front-end-development/lab-exercise-tracker/5a8b073d06fa14fcfde687aa.md new file mode 100644 index 0000000000..9492b82cb4 --- /dev/null +++ b/curriculum/challenges/chinese-traditional/25-front-end-development/lab-exercise-tracker/5a8b073d06fa14fcfde687aa.md @@ -0,0 +1,611 @@ +--- +id: 5a8b073d06fa14fcfde687aa +title: Build an Exercise Tracker +challengeType: 4 +dashedName: build-an-exercise-tracker +--- + +# --description-- + +Build a full stack JavaScript app that is functionally similar to this: https://exercise-tracker.freecodecamp.rocks. Working on this project will involve you writing your code using one of the following methods: + +- Clone this GitHub repo and complete your project locally. +- Use our Gitpod starter project to complete your project. +- Use a site builder of your choice to complete the project. Be sure to incorporate all the files from our GitHub repo. + +# --instructions-- + +Your responses should have the following structures. + +Exercise: + +```js +{ + username: "fcc_test", + description: "test", + duration: 60, + date: "Mon Jan 01 1990", + _id: "5fb5853f734231456ccb3b05" +} +``` + +User: + +```js +{ + username: "fcc_test", + _id: "5fb5853f734231456ccb3b05" +} +``` + +Log: + +```js +{ + username: "fcc_test", + count: 1, + _id: "5fb5853f734231456ccb3b05", + log: [{ + description: "test", + duration: 60, + date: "Mon Jan 01 1990", + }] +} +``` + +**Hint:** For the `date` property, the `toDateString` method of the `Date` API can be used to achieve the expected output. + +# --hints-- + +You should provide your own project, not the example URL. + +```js +(getUserInput) => { + const url = getUserInput('url'); + assert( + !/.*\/exercise-tracker\.freecodecamp\.rocks/.test(getUserInput('url')) + ); +}; +``` + +You can `POST` to `/api/users` with form data `username` to create a new user. + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `username=fcc_test_${Date.now()}`.substring(0, 29) + }); + assert.isTrue(res.ok); + if(!res.ok) { + throw new Error(`${res.status} ${res.statusText}`) + }; +}; +``` + +The returned response from `POST /api/users` with form data `username` will be an object with `username` and `_id` properties. + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `username=fcc_test_${Date.now()}`.substring(0, 29) + }); + if (res.ok) { + const { _id, username } = await res.json(); + assert.exists(_id); + assert.exists(username); + } else { + throw new Error(`${res.status} ${res.statusText}`); + } +}; +``` + +You can make a `GET` request to `/api/users` to get a list of all users. + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users'); + assert.isTrue(res.ok); + if(!res.ok) { + throw new Error(`${res.status} ${res.statusText}`) + }; +}; +``` + +The `GET` request to `/api/users` returns an array. + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users'); + if(res.ok){ + const users = await res.json(); + assert.isArray(users); + } else { + throw new Error(`${res.status} ${res.statusText}`); + }; +}; +``` + +Each element in the array returned from `GET /api/users` is an object literal containing a user's `username` and `_id`. + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users'); + if(res.ok){ + const users = await res.json(); + const user = users[0]; + assert.exists(user); + assert.exists(user.username); + assert.exists(user._id); + assert.isString(user.username); + assert.isString(user._id); + } else { + throw new Error(`${res.status} ${res.statusText}`); + }; +}; +``` + +You can `POST` to `/api/users/:_id/exercises` with form data `description`, `duration`, and optionally `date`. If no date is supplied, the current date will be used. + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `username=fcc_test_${Date.now()}`.substring(0, 29) + }); + if (res.ok) { + const { _id, username } = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: 'Mon Jan 01 1990' + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `description=${expected.description}&duration=${expected.duration}&date=1990-01-01` + }); + assert.isTrue(addRes.ok); + if(!addRes.ok) { + throw new Error(`${addRes.status} ${addRes.statusText}`) + }; + } else { + throw new Error(`${res.status} ${res.statusText}`); + } +}; +``` + +The response returned from `POST /api/users/:_id/exercises` will be the user object with the exercise fields added. + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `username=fcc_test_${Date.now()}`.substring(0, 29) + }); + if (res.ok) { + const { _id, username } = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: 'Mon Jan 01 1990' + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `description=${expected.description}&duration=${expected.duration}&date=1990-01-01` + }); + if (addRes.ok) { + const actual = await addRes.json(); + assert.deepEqual(actual, expected); + assert.isString(actual.description); + assert.isNumber(actual.duration); + assert.isString(actual.date); + } else { + throw new Error(`${addRes.status} ${addRes.statusText}`); + } + } else { + throw new Error(`${res.status} ${res.statusText}`); + } +}; +``` + +You can make a `GET` request to `/api/users/:_id/logs` to retrieve a full exercise log of any user. + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `username=fcc_test_${Date.now()}`.substring(0, 29) + }); + if (res.ok) { + const { _id, username } = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: new Date().toDateString() + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `description=${expected.description}&duration=${expected.duration}` + }); + if (addRes.ok) { + const logRes = await fetch(url + `/api/users/${_id}/logs`); + assert.isTrue(logRes.ok); + if(!logRes.ok) { + throw new Error(`${logRes.status} ${logRes.statusText}`) + }; + } else { + throw new Error(`${addRes.status} ${addRes.statusText}`); + } + } else { + throw new Error(`${res.status} ${res.statusText}`); + } +}; +``` + +A request to a user's log `GET /api/users/:_id/logs` returns a user object with a `count` property representing the number of exercises that belong to that user. + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `username=fcc_test_${Date.now()}`.substring(0, 29) + }); + if (res.ok) { + const { _id, username } = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: new Date().toDateString() + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `description=${expected.description}&duration=${expected.duration}` + }); + if (addRes.ok) { + const logRes = await fetch(url + `/api/users/${_id}/logs`); + if (logRes.ok) { + const { count } = await logRes.json(); + assert(count); + } else { + throw new Error(`${logRes.status} ${logRes.statusText}`); + } + } else { + throw new Error(`${addRes.status} ${addRes.statusText}`); + } + } else { + throw new Error(`${res.status} ${res.statusText}`); + } +}; +``` + +A `GET` request to `/api/users/:_id/logs` will return the user object with a `log` array of all the exercises added. + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded' + }, + body: `username=fcc_test_${Date.now()}`.substring(0, 29) + }) + if(res.ok){ + const {_id, username} = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: new Date().toDateString() + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `description=${expected.description}&duration=${expected.duration}` + }); + if(addRes.ok){ + const logRes = await fetch(url + `/api/users/${_id}/logs`); + if(logRes.ok) { + const {log} = await logRes.json(); + assert.isArray(log); + assert.equal(1, log.length); + } else { + throw new Error(`${logRes.status} ${logRes.statusText}`); + } + } else { + throw new Error(`${addRes.status} ${addRes.statusText}`); + }; + } else { + throw new Error(`${res.status} ${res.statusText}`) + }; +}; +``` + +Each item in the `log` array that is returned from `GET /api/users/:_id/logs` is an object that should have a `description`, `duration`, and `date` properties. + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + `/api/users`, { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded' + }, + body: `username=fcc_test_${Date.now()}`.substring(0, 29) + }); + if(res.ok) { + const {_id, username} = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: new Date().toDateString() + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `description=${expected.description}&duration=${expected.duration}` + }); + if(addRes.ok) { + const logRes = await fetch(url + `/api/users/${_id}/logs`); + if(logRes.ok) { + const {log} = await logRes.json(); + const exercise = log[0]; + assert.exists(exercise); + assert.exists(exercise.description); + assert.exists(exercise.duration); + assert.exists(exercise.date); + } else { + throw new Error(`${logRes.status} ${logRes.statusText}`); + }; + } else { + throw new Error(`${addRes.status} ${addRes.statusText}`); + }; + } else { + throw new Error(`${res.status} ${res.statusText}`) + }; +}; +``` + +The `description` property of any object in the `log` array that is returned from `GET /api/users/:_id/logs` should be a string. + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + body: `username=fcc_test_${Date.now()}`.substring(0,29) + }); + if(res.ok) { + const {_id, username} = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: new Date().toDateString() + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + body: `description=${expected.description}&duration=${expected.duration}` + }); + if(addRes.ok) { + const logRes = await fetch(url + `/api/users/${_id}/logs`); + if(logRes.ok){ + const {log} = await logRes.json(); + const exercise = log[0]; + assert.isString(exercise.description); + assert.equal(exercise.description, expected.description); + } else { + throw new Error(`${logRes.status} ${logRes.statusText}`); + } + } else { + throw new Error(`${addRes.status} ${addRes.statusText}`); + }; + } else { + throw new Error(`${res.status} ${res.statusText}`); + }; +}; +``` + +The `duration` property of any object in the `log` array that is returned from `GET /api/users/:_id/logs` should be a number. + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + body: `username=fcc_test_${Date.now()}`.substring(0,29) + }); + if(res.ok) { + const {_id, username} = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: new Date().toDateString() + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + body: `description=${expected.description}&duration=${expected.duration}` + }); + if(addRes.ok) { + const logRes = await fetch(url + `/api/users/${_id}/logs`); + if(logRes.ok){ + const {log} = await logRes.json(); + const exercise = log[0]; + assert.isNumber(exercise.duration); + assert.equal(exercise.duration, expected.duration); + } else { + throw new Error(`${logRes.status} ${logRes.statusText}`); + } + } else { + throw new Error(`${addRes.status} ${addRes.statusText}`); + }; + } else { + throw new Error(`${res.status} ${res.statusText}`); + }; +}; +``` + +The `date` property of any object in the `log` array that is returned from `GET /api/users/:_id/logs` should be a string. Use the `dateString` format of the `Date` API. + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + body: `username=fcc_test_${Date.now()}`.substring(0,29) + }); + if(res.ok) { + const {_id, username} = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: new Date().toLocaleDateString("en-US", { + timeZone: "UTC", weekday: "short", month: "short", + day: "2-digit", year: "numeric" + }).replaceAll(',', '') + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + body: `description=${expected.description}&duration=${expected.duration}` + }); + if(addRes.ok) { + const logRes = await fetch(url + `/api/users/${_id}/logs`); + if(logRes.ok){ + const {log} = await logRes.json(); + const exercise = log[0]; + assert.isString(exercise.date); + assert.equal(exercise.date, expected.date); + } else { + throw new Error(`${logRes.status} ${logRes.statusText}`); + } + } else { + throw new Error(`${addRes.status} ${addRes.statusText}`); + }; + } else { + throw new Error(`${res.status} ${res.statusText}`); + }; +}; +``` + +You can add `from`, `to` and `limit` parameters to a `GET /api/users/:_id/logs` request to retrieve part of the log of any user. `from` and `to` are dates in `yyyy-mm-dd` format. `limit` is an integer of how many logs to send back. + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `username=fcc_test_${Date.now()}`.substring(0, 29) + }); + if (res.ok) { + const { _id, username } = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: new Date().toDateString() + }; + const addExerciseRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `description=${expected.description}&duration=${expected.duration}&date=1990-01-01` + }); + const addExerciseTwoRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `description=${expected.description}&duration=${expected.duration}&date=1990-01-03` + }); + if (addExerciseRes.ok && addExerciseTwoRes.ok) { + const logRes = await fetch( + url + `/api/users/${_id}/logs?from=1989-12-31&to=1990-01-04` + ); + if (logRes.ok) { + const { log } = await logRes.json(); + assert.isArray(log); + assert.equal(2, log.length); + } else { + throw new Error(`${logRes.status} ${logRes.statusText}`); + } + const limitRes = await fetch( + url + `/api/users/${_id}/logs?limit=1` + ); + if (limitRes.ok) { + const { log } = await limitRes.json(); + assert.isArray(log); + assert.equal(1, log.length); + } else { + throw new Error(`${limitRes.status} ${limitRes.statusText}`); + } + const filterDateBeforeLimitRes = await fetch( + url + `/api/users/${_id}/logs?from=1990-01-02&to=1990-01-04&limit=1` + ); + if (filterDateBeforeLimitRes.ok) { + const { log } = await filterDateBeforeLimitRes.json(); + assert.isArray(log); + assert.equal(1, log.length); + } else { + throw new Error(`${filterDateBeforeLimitRes.status} ${filterDateBeforeLimitRes.statusText}`); + } + } else { + throw new Error(`${res.status} ${res.statusText}`); + } + } else { + throw new Error(`${res.status} ${res.statusText}`); + } +}; +``` diff --git a/curriculum/challenges/chinese-traditional/25-front-end-development/lab-number-guessing-game/602da04c22201c65d2a019f4.md b/curriculum/challenges/chinese-traditional/25-front-end-development/lab-number-guessing-game/602da04c22201c65d2a019f4.md new file mode 100644 index 0000000000..ef87dc6720 --- /dev/null +++ b/curriculum/challenges/chinese-traditional/25-front-end-development/lab-number-guessing-game/602da04c22201c65d2a019f4.md @@ -0,0 +1,25 @@ +--- +id: 602da04c22201c65d2a019f4 +title: Build a Number Guessing Game +challengeType: 13 +url: freeCodeCamp/learn-number-guessing-game +dashedName: lab-number-guessing-game +--- + +# --description-- + +For this lab, you will use Bash scripting, PostgreSQL, and Git to create a number guessing game that runs in the terminal and saves user information. + +# --instructions-- + +**Important:** After you pass all the project tests, save a dump of your database into a `number_guess.sql` file, as well as your `number_guess.sh` file, so you can complete step 2. There will be instructions on how to do that within the virtual machine. + +# --notes-- + +Required files: `number_guess.sql`, `number_guess.sh` + +# --hints-- + +# --seed-- + +# --solutions-- diff --git a/curriculum/challenges/chinese-traditional/25-front-end-development/lab-request-header-parser-microservice/bd7158d8c443edefaeb5bdff.md b/curriculum/challenges/chinese-traditional/25-front-end-development/lab-request-header-parser-microservice/bd7158d8c443edefaeb5bdff.md new file mode 100644 index 0000000000..5040e27424 --- /dev/null +++ b/curriculum/challenges/chinese-traditional/25-front-end-development/lab-request-header-parser-microservice/bd7158d8c443edefaeb5bdff.md @@ -0,0 +1,65 @@ +--- +id: bd7158d8c443edefaeb5bdff +title: Build a Request Header Parser Microservice +challengeType: 4 +dashedName: lab-request-header-parser-microservice +--- + +# --description-- + +Build a full stack JavaScript app that is functionally similar to this: https://request-header-parser-microservice.freecodecamp.rocks/. Working on this project will involve you writing your code using one of the following methods: + +- Clone this GitHub repo and complete your project locally. +- Use our Gitpod starter project to complete your project. +- Use a site builder of your choice to complete the project. Be sure to incorporate all the files from our GitHub repo. + +# --hints-- + +You should provide your own project, not the example URL. + +```js +(getUserInput) => { + assert( + !/.*\/request-header-parser-microservice\.freecodecamp\.rocks/.test( + getUserInput('url') + ) + ); +}; +``` + +A request to `/api/whoami` should return a JSON object with your IP address in the `ipaddress` key. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/api/whoami').then( + (data) => assert(data.ipaddress && data.ipaddress.length > 0), + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + +A request to `/api/whoami` should return a JSON object with your preferred language in the `language` key. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/api/whoami').then( + (data) => assert(data.language && data.language.length > 0), + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + +A request to `/api/whoami` should return a JSON object with your software in the `software` key. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/api/whoami').then( + (data) => assert(data.software && data.software.length > 0), + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/chinese-traditional/25-front-end-development/lab-url-shortener-microservice/bd7158d8c443edefaeb5bd0e.md b/curriculum/challenges/chinese-traditional/25-front-end-development/lab-url-shortener-microservice/bd7158d8c443edefaeb5bd0e.md new file mode 100644 index 0000000000..0fbf80a0bf --- /dev/null +++ b/curriculum/challenges/chinese-traditional/25-front-end-development/lab-url-shortener-microservice/bd7158d8c443edefaeb5bd0e.md @@ -0,0 +1,107 @@ +--- +id: bd7158d8c443edefaeb5bd0e +title: URL Shortener Microservice +challengeType: 4 +dashedName: url-shortener-microservice +--- + +# --description-- + +Build a full stack JavaScript app that is functionally similar to this: https://url-shortener-microservice.freecodecamp.rocks. Working on this project will involve you writing your code using one of the following methods: + +- Clone this GitHub repo and complete your project locally. +- Use our Gitpod starter project to complete your project. +- Use a site builder of your choice to complete the project. Be sure to incorporate all the files from our GitHub repo. + +# --instructions-- + +**HINT:** Do not forget to use a body parsing middleware to handle the POST requests. Also, you can use the function `dns.lookup(host, cb)` from the `dns` core module to verify a submitted URL. + +# --hints-- + +You should provide your own project, not the example URL. + +```js +(getUserInput) => { + assert( + !/.*\/url-shortener-microservice\.freecodecamp\.rocks/.test( + getUserInput('url') + ) + ); +}; +``` + +You can POST a URL to `/api/shorturl` and get a JSON response with `original_url` and `short_url` properties. Here's an example: `{ original_url : 'https://freeCodeCamp.org', short_url : 1}` + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const urlVariable = Date.now(); + const fullUrl = `${url}/?v=${urlVariable}` + const res = await fetch(url + '/api/shorturl', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `url=${fullUrl}` + }); + if (res.ok) { + const { short_url, original_url } = await res.json(); + assert.isNotNull(short_url); + assert.strictEqual(original_url, `${url}/?v=${urlVariable}`); + } else { + throw new Error(`${res.status} ${res.statusText}`); + } +}; +``` + +When you visit `/api/shorturl/`, you will be redirected to the original URL. + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const urlVariable = Date.now(); + const fullUrl = `${url}/?v=${urlVariable}` + let shortenedUrlVariable; + const postResponse = await fetch(url + '/api/shorturl', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `url=${fullUrl}` + }); + if (postResponse.ok) { + const { short_url } = await postResponse.json(); + shortenedUrlVariable = short_url; + } else { + throw new Error(`${postResponse.status} ${postResponse.statusText}`); + } + const getResponse = await fetch( + url + '/api/shorturl/' + shortenedUrlVariable + ); + if (getResponse) { + const { redirected, url } = getResponse; + assert.isTrue(redirected); + assert.strictEqual(url,fullUrl); + } else { + throw new Error(`${getResponse.status} ${getResponse.statusText}`); + } +}; +``` + +If you pass an invalid URL that doesn't follow the valid `http://www.example.com` format, the JSON response will contain `{ error: 'invalid url' }` + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/shorturl', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `url=ftp:/john-doe.invalidTLD` + }); + if (res.ok) { + const { error } = await res.json(); + assert.isNotNull(error); + assert.strictEqual(error.toLowerCase(), 'invalid url'); + } else { + throw new Error(`${res.status} ${res.statusText}`); + } +}; +``` + diff --git a/curriculum/challenges/chinese-traditional/25-front-end-development/lab-world-cup-database/5f9771307d4d22b9d2b75a94.md b/curriculum/challenges/chinese-traditional/25-front-end-development/lab-world-cup-database/5f9771307d4d22b9d2b75a94.md new file mode 100644 index 0000000000..d77442a1ba --- /dev/null +++ b/curriculum/challenges/chinese-traditional/25-front-end-development/lab-world-cup-database/5f9771307d4d22b9d2b75a94.md @@ -0,0 +1,25 @@ +--- +id: 5f9771307d4d22b9d2b75a94 +title: Build a World Cup Database +challengeType: 13 +url: freeCodeCamp/learn-world-cup-database +dashedName: lab-world-cup-database +--- + +# --description-- + +For this project, you will create a Bash script that enters information from World Cup games into PostgreSQL, then query the database for useful statistics. + +# --instructions-- + +**Important:** After you pass all the project tests, save a dump of your database into a `worldcup.sql` file, as well as your `insert_data.sh` and `queries.sh` files, so you can complete step 2. There will be instructions how to do that within the virtual machine. + +# --notes-- + +Required files: `worldcup.sql`, `insert_data.sh`, `queries.sh` + +# --hints-- + +# --seed-- + +# --solutions-- diff --git a/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-hotel-feedback-form/66a96127422411756204bc1b.md b/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-hotel-feedback-form/66a96127422411756204bc1b.md index 51ea9e3069..753ee1a6bb 100644 --- a/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-hotel-feedback-form/66a96127422411756204bc1b.md +++ b/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-hotel-feedback-form/66a96127422411756204bc1b.md @@ -7,9 +7,9 @@ dashedName: step-22 # --description-- -Add another label with the text of `Personal Recommendation`. The `for` attribute should be set to `"recommendation"`. +Add another `label` with the text of `Personal Recommendation`. The `for` attribute should be set to `"recommendation"`. -Below the label element, add another checkbox input with the `id`, `name` and `value` attributes set to `"recommendation"`. +Below the `label` element, add another checkbox `input` with the `id`, `name` and `value` attributes set to `"recommendation"`. # --hints-- diff --git a/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-hotel-feedback-form/66a962954f4e0d76223b37ed.md b/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-hotel-feedback-form/66a962954f4e0d76223b37ed.md index 42c425209d..80a23ca86d 100644 --- a/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-hotel-feedback-form/66a962954f4e0d76223b37ed.md +++ b/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-hotel-feedback-form/66a962954f4e0d76223b37ed.md @@ -11,7 +11,7 @@ Next, add another `label` element with the text of `Location` and the `for` attr For the checkbox `input`, both the `id`, `name` and `value` attributes should be set to `"location"`. -Below that `input` element, add another `label` element with the text of `Reputation` and the for attribute set to `"reputation"`. +Below that `input` element, add another `label` element with the text of `Reputation` and the `for` attribute set to `"reputation"`. For the checkbox `input`, both the `id`, `name` and `value` attributes should be set to `"reputation"`. diff --git a/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-hotel-feedback-form/66a972137acd1179fa3fe8a0.md b/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-hotel-feedback-form/66a972137acd1179fa3fe8a0.md index 69efa4832c..09e3e6e59b 100644 --- a/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-hotel-feedback-form/66a972137acd1179fa3fe8a0.md +++ b/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-hotel-feedback-form/66a972137acd1179fa3fe8a0.md @@ -7,7 +7,7 @@ dashedName: step-28 # --description-- -Inside your `select` element, add the following five `option` elements with these corresponding values for the option text and `value` attribute: +Inside your `select` element, add the following five `option` elements with these corresponding values for the `option` text and `value` attribute: **Value Attributes:** diff --git a/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-hotel-feedback-form/66a97ca8c4cbae7d0bb6e0ad.md b/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-hotel-feedback-form/66a97ca8c4cbae7d0bb6e0ad.md index 6549345d45..22b9a707be 100644 --- a/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-hotel-feedback-form/66a97ca8c4cbae7d0bb6e0ad.md +++ b/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-hotel-feedback-form/66a97ca8c4cbae7d0bb6e0ad.md @@ -7,7 +7,7 @@ dashedName: step-31 # --description-- -Inside your `select` element, add the following five `option` elements with these corresponding values for the option text and `value` attribute: +Inside your `select` element, add the following five `option` elements with these corresponding values for the `option` text and `value` attribute: **Value Attribute:** diff --git a/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-loan-qualification-checker/66c8ba41a77db20a93f9d7a1.md b/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-loan-qualification-checker/66c8ba41a77db20a93f9d7a1.md new file mode 100644 index 0000000000..237515fd88 --- /dev/null +++ b/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-loan-qualification-checker/66c8ba41a77db20a93f9d7a1.md @@ -0,0 +1,71 @@ +--- +id: 66c8ba41a77db20a93f9d7a1 +title: Step 1 +challengeType: 1 +dashedName: step-1 +--- + +# --description-- + +In this workshop, you'll review JavaScript conditionals by building a loan qualification checker app. + +The app will check whether the user is eligible for a duplex, car, and condo loan based on their annual income and credit score. A credit score is a number that represents how good you are at managing borrowed money. + +To get started, create the following variables and values. + +| Variable Name | Value | +| ------------------------- | ------- | +| `minIncomeForDuplex` | `60000` | +| `minCreditScoreForDuplex` | `700` | +| `minIncomeForCondo` | `45000` | +| `minCreditScoreForCondo` | `680` | +| `minIncomeForCar` | `30000` | +| `minCreditScoreForCar` | `650` | + +# --hints-- + +You should create a `minIncomeForDuplex` variable set to `60000`. + +```js +assert.equal(minIncomeForDuplex, 60000); +``` + +You should create a `minCreditScoreForDuplex` set to `700`. + +```js +assert.equal(minCreditScoreForDuplex, 700); +``` + +You should create a `minIncomeForCar` variable set to `30000`. + +```js +assert.equal(minIncomeForCar, 30000); +``` + +You should create a `minCreditScoreForCar` variable set to `650`. + +```js +assert.equal(minCreditScoreForCar, 650); +``` + +You should create a `minIncomeForCondo` variable set to `45000`. + +```js +assert.equal(minIncomeForCondo, 45000); +``` + +You should create a `minCreditScoreForCondo` variable set to `680`. + +```js +assert.equal(minCreditScoreForCondo, 680); +``` + +# --seed-- + +## --seed-contents-- + +```js +--fcc-editable-region-- + +--fcc-editable-region-- +``` diff --git a/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4ac.md b/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4ac.md new file mode 100644 index 0000000000..7755f823c4 --- /dev/null +++ b/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4ac.md @@ -0,0 +1,53 @@ +--- +id: 66c8ba975ee7230e29f6c4ac +title: Step 2 +challengeType: 1 +dashedName: step-2 +--- + +# --description-- + +When the user is eligible for a loan, you'll want to display a message to them in the console. + +For that, you'll build out a function inside which you'll have some checks that'll return what loan the applicant is eligible for. + +Create an empty `getLoanMessage` function with an `annualIncome` and `creditScore` parameters. + +# --hints-- + +You should create a `getLoanMessage` function + +```js +assert.isFunction(getLoanMessage) +``` + +Your `getLoanMessage` function should have an `annualIncome` and `creditScore` as parameters. + +```js +assert.match(getLoanMessage?.toString(), /\(\s*annualIncome,\s*creditScore\s*\)|\(\s*creditScore,\s*annualIncome\s*\)/); +``` + +`getLoanMessage` should be an empty function. + +```js +assert.match(getLoanMessage?.toString(), /\{\s*\}/); +``` + +# --seed-- + +## --seed-contents-- + +```js +const minIncomeForDuplex = 60000; +const minCreditScoreForDuplex = 700; + +const minIncomeForCondo = 45000; +const minCreditScoreForCondo = 680; + +const minIncomeForCar = 30000; +const minCreditScoreForCar = 650; + +--fcc-editable-region-- + +--fcc-editable-region-- +``` diff --git a/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4ad.md b/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4ad.md new file mode 100644 index 0000000000..82a29d7cd9 --- /dev/null +++ b/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4ad.md @@ -0,0 +1,55 @@ +--- +id: 66c8ba975ee7230e29f6c4ad +title: Step 3 +challengeType: 1 +dashedName: step-3 +--- + +# --description-- + +To check which loan a user is qualified for based on the `annualIncome` and `creditScore`, you have to use `if/else if` statement or a ternary right inside the `getLoanMessage` function. You'll then return the appropraite message in the block of each condition. + +Starting with the duplex loan, check if `annualIncome` is greater than or equal to `minIncomeForDuplex` AND if `creditScore` is greater than `minCreditScoreForDuplex`. + +If that condition is true, then the applicant is eligible for a duplex loan and the other loans. So, inside the check, return the string `"You qualify for a car, duplex and Condo loan."` + +# --hints-- + +Your `getLoanMessage` function should return a string. + +```js +assert.isString(getLoanMessage(65000, 750)); +``` + +Your `getLoanMessage` function should return the string `"You qualify for a duplex, condo, and car loan."`. + +```js +assert.strictEqual(getLoanMessage(65000, 750), "You qualify for a duplex, condo, and car loan."); +``` + +Your `getLoanMessage` function should return `undefined` if the applicant's annual income and credit score do not meet the requirements for a duplex loan. + +```js +assert.strictEqual(getLoanMessage(59000, 700), undefined); +``` + +# --seed-- + +## --seed-contents-- + +```js +const minIncomeForDuplex = 60000; +const minCreditScoreForDuplex = 700; + +const minIncomeForCondo = 45000; +const minCreditScoreForCondo = 680; + +const minIncomeForCar = 30000; +const minCreditScoreForCar = 650; + +--fcc-editable-region-- +function getLoanMessage(annualIncome, creditScore) { + +} +--fcc-editable-region-- +``` diff --git a/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4af.md b/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4af.md new file mode 100644 index 0000000000..638e6291a4 --- /dev/null +++ b/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4af.md @@ -0,0 +1,56 @@ +--- +id: 66c8ba975ee7230e29f6c4af +title: Step 4 +challengeType: 1 +dashedName: step-4 +--- + +# --description-- + +If the applicant's annual income is greater than or equal to `minIncomeForCondo`, AND if their credit score is greater than or equal to `minCreditScoreForCondo`, then they qualify for a condo and car loan. + +Check if that's true in the `getLoanMessage` function. If it is, return the string `"You qualify for a condo and car loan."` + +# --hints-- + +Your `getLoanMessage` function should return a string if the applicant qualifies for a condo and car loan. + +```js +assert.isString(getLoanMessage(45000, 680)); +``` + +Your `getLoanMessage` function should return the string `"You qualify for a condo and car loan."`. + +```js +assert.strictEqual(getLoanMessage(45000, 680), "You qualify for a condo and car loan."); +``` + +Your `getLoanMessage` function should return `undefined` if the applicant's annual income and credit score do not meet the requirements for a condo loan. + +```js +assert.strictEqual(getLoanMessage(45000, 650), undefined); +``` + +# --seed-- + +## --seed-contents-- + +```js +const minIncomeForDuplex = 60000; +const minCreditScoreForDuplex = 700; + +const minIncomeForCondo = 45000; +const minCreditScoreForCondo = 680; + +const minIncomeForCar = 30000; +const minCreditScoreForCar = 650; + +function getLoanMessage(annualIncome, creditScore) { + if(creditScore >= minCreditScoreForDuplex && annualIncome >= minIncomeForDuplex) { + return "You qualify for a duplex, condo, and car loan." +--fcc-editable-region-- + } + +--fcc-editable-region-- +} +``` diff --git a/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b0.md b/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b0.md new file mode 100644 index 0000000000..374ba7b8fe --- /dev/null +++ b/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b0.md @@ -0,0 +1,56 @@ +--- +id: 66c8ba975ee7230e29f6c4b0 +title: Step 5 +challengeType: 1 +dashedName: step-5 +--- + +# --description-- + +Now, you should check if the applicant is qualified for a car loan only. If they're, return the string `"You qualify for a car loan."`. + +# --hints-- + +Your `getLoanMessage` function should return a string if the applicant qualifies for a car loan. + +```js +assert.isString(getLoanMessage(30000, 650)); +``` + +Your `getLoanMessage` function should return the string `"You qualify for a car loan."`. + +```js +assert.strictEqual(getLoanMessage(30000, 650), "You qualify for a car loan."); +``` + +Your `getLoanMessage` function should return `undefined` if the applicant's annual income and credit score do not meet the requirements for a car loan. + +```js +assert.strictEqual(getLoanMessage(30000, 600), undefined); +``` + +# --seed-- + +## --seed-contents-- + +```js +const minIncomeForDuplex = 60000; +const minCreditScoreForDuplex = 700; + +const minIncomeForCondo = 45000; +const minCreditScoreForCondo = 680; + +const minIncomeForCar = 30000; +const minCreditScoreForCar = 650; + +function getLoanMessage(annualIncome, creditScore) { + if(creditScore >= minCreditScoreForDuplex && annualIncome >= minIncomeForDuplex) { + return "You qualify for a duplex, condo, and car loan." + } else if (annualIncome >= minIncomeForCondo && creditScore >= minCreditScoreForCondo) { + return "You qualify for a condo and car loan." +--fcc-editable-region-- + } + +--fcc-editable-region-- +} +``` diff --git a/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b1.md b/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b1.md new file mode 100644 index 0000000000..16e8c7baca --- /dev/null +++ b/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b1.md @@ -0,0 +1,54 @@ +--- +id: 66c8ba975ee7230e29f6c4b1 +title: Step 6 +challengeType: 1 +dashedName: step-6 +--- + +# --description-- + +If the applicant's annual income and credit score fall below `minIncomeForCar` and `minCreditScoreForCar`, then they don't qualify for any loan. So, return the string `"You don't qualify for any loans."` + +# --hints-- + +Your `getLoanMessage` function should return a string if the applicant doesn't qualify for any loan. + +```js +assert.isString(getLoanMessage(25000, 550)); +``` + +Your `getLoanMessage` function should return the string `"You don't qualify for any loans."` if the applicant does not meet the requirements for any loan. + +```js +assert.strictEqual(getLoanMessage(15000, 600), "You don't qualify for any loans."); +assert.strictEqual(getLoanMessage(25000, 550), "You don't qualify for any loans."); +assert.strictEqual(getLoanMessage(20000, 500), "You don't qualify for any loans."); +``` + +# --seed-- + +## --seed-contents-- + +```js +const minIncomeForDuplex = 60000; +const minCreditScoreForDuplex = 700; + +const minIncomeForCondo = 45000; +const minCreditScoreForCondo = 680; + +const minIncomeForCar = 30000; +const minCreditScoreForCar = 650; + +function getLoanMessage(annualIncome, creditScore) { + if(creditScore >= minCreditScoreForDuplex && annualIncome >= minIncomeForDuplex) { + return "You qualify for a duplex, condo, and car loan." + } else if (annualIncome >= minIncomeForCondo && creditScore >= minCreditScoreForCondo) { + return "You qualify for a condo and car loan." + } else if (annualIncome >= minIncomeForCar && creditScore >= minCreditScoreForCar) { + return "You qualify for a car loan." +--fcc-editable-region-- + } + +--fcc-editable-region-- +} +``` diff --git a/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b2.md b/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b2.md new file mode 100644 index 0000000000..9d19f9ea4c --- /dev/null +++ b/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b2.md @@ -0,0 +1,165 @@ +--- +id: 66c8ba975ee7230e29f6c4b2 +title: Step 7 +challengeType: 1 +dashedName: step-7 +--- + +# --description-- + +Now, it is time to test out your `getLoanMessage` function. + +Use the table below to create `4` variables and their values: + +| Variable Name | Value | +| --------------- | ---------------------------- | +| `duplexLoanMsg` | `getLoanMessage(85000, 850)` | +| `condoLoanMsg` | `getLoanMessage(65000, 690)` | +| `carLoanMsg` | `getLoanMessage(45000, 660)` | +| `noLoanMsg` | `getLoanMessage(25000, 550)` | + +After that, log each variable to the console to see the messages. + +With that, your loan qualification checker project is complete! + +# --hints-- + +You should have a variable called `duplexLoanMsg`. + +```js +assert.isNotNull(duplexLoanMsg); +``` + +Your `duplexLoanMsg` variable should be set to the result of `getLoanMessage(85000, 850)`. + +```js +assert.equal(duplexLoanMsg, getLoanMessage(85000, 850)); +``` + +You should log the `duplexLoanMsg` variable to the console. + +```js +assert.match(code, /console\.log\(duplexLoanMsg\)/) +``` + +You should have a variable called `condoLoanMsg`. + +```js +assert.isNotNull(condoLoanMsg); +``` + +Your `condoLoanMsg` variable should be set to the result of `getLoanMessage(65000, 690)`. + +```js +assert.equal(condoLoanMsg, getLoanMessage(65000, 690)); +``` + +You should log the `condoLoanMsg` variable to the console. + +```js +assert.match(code, /console\.log\(condoLoanMsg\)/) +``` + +You should have a variable called `carLoanMsg`. + +```js +assert.isNotNull(carLoanMsg); +``` + +Your `carLoanMsg` variable should be set to the result of `getLoanMessage(45000, 660)`. + +```js +assert.equal(carLoanMsg, getLoanMessage(45000, 660)); +``` + +You should log the `carLoanMsg` variable to the console. + +```js +assert.match(code, /console\.log\(carLoanMsg\)/) +``` + +You should have a variable called `noLoanMsg`. + +```js +assert.isNotNull(noLoanMsg); +``` + +Your `noLoanMsg` variable should be set to the result of `getLoanMessage(25000, 550)`. + +```js +assert.equal(noLoanMsg, getLoanMessage(25000, 550)); +``` + +You should log the `noLoanMsg` variable to the console. + +```js +assert.match(code, /console\.log\(noLoanMsg\)/) +``` + +# --seed-- + +## --seed-contents-- + +```js +const minIncomeForDuplex = 60000; +const minCreditScoreForDuplex = 700; + +const minIncomeForCondo = 45000; +const minCreditScoreForCondo = 680; + +const minIncomeForCar = 30000; +const minCreditScoreForCar = 650; + +function getLoanMessage(annualIncome, creditScore) { + if(creditScore >= minCreditScoreForDuplex && annualIncome >= minIncomeForDuplex) { + return "You qualify for a duplex, condo, and car loan." + } else if (annualIncome >= minIncomeForCondo && creditScore >= minCreditScoreForCondo) { + return "You qualify for a condo and car loan." + } else if (annualIncome >= minIncomeForCar && creditScore >= minCreditScoreForCar) { + return "You qualify for a car loan." + } else { + return "You don't qualify for any loans." + } +} + +--fcc-editable-region-- + +--fcc-editable-region-- +``` + +# --solutions-- + +```js +const minIncomeForDuplex = 60000; +const minCreditScoreForDuplex = 700; + +const minIncomeForCondo = 45000; +const minCreditScoreForCondo = 680; + +const minIncomeForCar = 30000; +const minCreditScoreForCar = 650; + +function getLoanMessage(annualIncome, creditScore) { + if(creditScore >= minCreditScoreForDuplex && annualIncome >= minIncomeForDuplex) { + return "You qualify for a duplex, condo, and car loan." + } else if (annualIncome >= minIncomeForCondo && creditScore >= minCreditScoreForCondo) { + return "You qualify for a condo and car loan." + } else if (annualIncome >= minIncomeForCar && creditScore >= minCreditScoreForCar) { + return "You qualify for a car loan." + } else { + return "You don't qualify for any loans." + } +} + +const duplexLoanMsg = getLoanMessage(85000, 850) +console.log(duplexLoanMsg) + +const condoLoanMsg = getLoanMessage(65000, 690) +console.log(condoLoanMsg) + +const carLoanMsg = getLoanMessage(45000, 660) +console.log(carLoanMsg) + +const noLoanMsg = getLoanMessage(25000, 550) +console.log(noLoanMsg) +``` diff --git a/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-mario-database/5f2c289f164c29556da632fd.md b/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-mario-database/5f2c289f164c29556da632fd.md new file mode 100644 index 0000000000..4e11751ca0 --- /dev/null +++ b/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-mario-database/5f2c289f164c29556da632fd.md @@ -0,0 +1,19 @@ +--- +id: 5f2c289f164c29556da632fd +title: Build a Mario Database +challengeType: 12 +url: freeCodeCamp/learn-relational-databases-by-building-a-mario-database +dashedName: build-a-mario-database +--- + +# --description-- + +In this 165-lesson workshop, you will learn the basics of a relational database by creating a PostgreSQL database filled with video game characters. + +# --instructions-- + +# --hints-- + +# --seed-- + +# --solutions-- diff --git a/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-npm-packages/587d7fb3367417b2b2512bfb.md b/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-npm-packages/587d7fb3367417b2b2512bfb.md new file mode 100644 index 0000000000..8d4c90410d --- /dev/null +++ b/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-npm-packages/587d7fb3367417b2b2512bfb.md @@ -0,0 +1,53 @@ +--- +id: 587d7fb3367417b2b2512bfb +title: How to Use package.json, the Core of Any Node.js Project or npm Package +challengeType: 2 +forumTopicId: 301528 +dashedName: how-to-use-package-json-the-core-of-any-node-js-project-or-npm-package +--- + +# --description-- + +Working on these challenges will involve you writing your code using one of the following methods: + +- Clone this GitHub repo and complete these challenges locally. +- Use our Gitpod starter project to complete these challenges. +- Use a site builder of your choice to complete the project. Be sure to incorporate all the files from our GitHub repo. + +The `package.json` file is the center of any Node.js project or npm package. It stores information about your project. It consists of a single JSON object where information is stored in key-value pairs. There are only two required fields; `name` and `version`, but it’s good practice to provide additional information. + +You can create the `package.json` file from the terminal using the `npm init` command. This will run a guided setup. Using `npm init` with the `-y` flag will generate the file without having it ask any questions, `npm init -y`. + +If you look at the file tree of your project, you will find the `package.json` file on the top level of the tree. This is the file that you will be improving in the next couple of challenges. + +One of the most common pieces of information in this file is the `author` field. It specifies who created the project, and can consist of a string or an object with contact or other details. An object is recommended for bigger projects, but a simple string like the following example will do for this project. + +```json +"author": "Jane Doe", +``` + +# --instructions-- + +Add your name as the `author` of the project in the `package.json` file. + +**Note:** Remember that you’re writing JSON, so all field names must use double-quotes (") and be separated with a comma (,). + +If you are using Gitpod, make sure the app is running and the preview window is open. Copy the preview window's URL and paste it into the Solution Link input below. + +# --hints-- + +`package.json` should have a valid "author" key + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert(packJson.author, '"author" is missing'); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-npm-packages/587d7fb3367417b2b2512bfc.md b/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-npm-packages/587d7fb3367417b2b2512bfc.md new file mode 100644 index 0000000000..37d15d5261 --- /dev/null +++ b/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-npm-packages/587d7fb3367417b2b2512bfc.md @@ -0,0 +1,43 @@ +--- +id: 587d7fb3367417b2b2512bfc +title: Add a Description to Your package.json +challengeType: 2 +forumTopicId: 301522 +dashedName: add-a-description-to-your-package-json +--- + +# --description-- + +The next part of a good package.json file is the `description` field; where a short, but informative description about your project belongs. + +If some day you plan to publish a package to npm, this is the string that should sell your idea to the user when they decide whether to install your package or not. However, that’s not the only use case for the description, it’s a great way to summarize what a project does. It’s just as important in any Node.js project to help other developers, future maintainers or even your future self understand the project quickly. + +Regardless of what you plan for your project, a description is definitely recommended. Here's an example: + +```json +"description": "A project that does something awesome", +``` + +# --instructions-- + +Add a `description` to the package.json file of your project. + +**Note:** Remember to use double-quotes for field-names (") and commas (,) to separate fields. + +# --hints-- + +package.json should have a valid "description" key + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert(packJson.description, '"description" is missing'); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bfd.md b/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bfd.md new file mode 100644 index 0000000000..a001cdd477 --- /dev/null +++ b/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bfd.md @@ -0,0 +1,75 @@ +--- +id: 587d7fb4367417b2b2512bfd +title: Add Keywords to Your package.json +challengeType: 2 +forumTopicId: 301526 +dashedName: add-keywords-to-your-package-json +--- + +# --description-- + +The `keywords` field is where you can describe your project using related keywords. Here's an example: + +```json +"keywords": [ "descriptive", "related", "words" ], +``` + +As you can see, this field is structured as an array of double-quoted strings. + +# --instructions-- + +Add an array of suitable strings to the `keywords` field in the package.json file of your project. + +One of the keywords should be "freecodecamp". + +# --hints-- + +package.json should have a valid "keywords" key + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert(packJson.keywords, '"keywords" is missing'); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + +"keywords" field should be an Array + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.isArray(packJson.keywords, '"keywords" is not an array'); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + +"keywords" should include "freecodecamp" + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.include( + packJson.keywords, + 'freecodecamp', + '"keywords" does not include "freecodecamp"' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bfe.md b/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bfe.md new file mode 100644 index 0000000000..7b09acd042 --- /dev/null +++ b/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bfe.md @@ -0,0 +1,39 @@ +--- +id: 587d7fb4367417b2b2512bfe +title: Add a License to Your package.json +challengeType: 2 +forumTopicId: 301523 +dashedName: add-a-license-to-your-package-json +--- + +# --description-- + +The `license` field is where you inform users of what they are allowed to do with your project. + +Some common licenses for open source projects include MIT and BSD. License information is not required, and copyright laws in most countries will give you ownership of what you create by default. However, it’s always a good practice to explicitly state what users can and can’t do. Here's an example of the license field: + +```json +"license": "MIT", +``` + +# --instructions-- + +Fill the `license` field in the package.json file of your project as you find suitable. + +# --hints-- + +package.json should have a valid "license" key + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert(packJson.license, '"license" is missing'); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bff.md b/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bff.md new file mode 100644 index 0000000000..f2e571faed --- /dev/null +++ b/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bff.md @@ -0,0 +1,37 @@ +--- +id: 587d7fb4367417b2b2512bff +title: Add a Version to Your package.json +challengeType: 2 +forumTopicId: 301525 +dashedName: add-a-version-to-your-package-json +--- + +# --description-- + +A `version` is one of the required fields of your package.json file. This field describes the current version of your project. Here's an example: + +```json +"version": "1.2.0", +``` + +# --instructions-- + +Add a `version` to the package.json file of your project. + +# --hints-- + +package.json should have a valid "version" key + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert(packJson.version, '"version" is missing'); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512c00.md b/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512c00.md new file mode 100644 index 0000000000..161c60fe69 --- /dev/null +++ b/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512c00.md @@ -0,0 +1,68 @@ +--- +id: 587d7fb4367417b2b2512c00 +title: Expand Your Project with External Packages from npm +challengeType: 2 +forumTopicId: 301527 +dashedName: expand-your-project-with-external-packages-from-npm +--- + +# --description-- + +One of the biggest reasons to use a package manager, is their powerful dependency management. Instead of manually having to make sure that you get all dependencies whenever you set up a project on a new computer, npm automatically installs everything for you. But how can npm know exactly what your project needs? Meet the `dependencies` section of your package.json file. + +In this section, packages your project requires are stored using the following format: + +```json +"dependencies": { + "package-name": "version", + "express": "4.14.0" +} + +``` + +# --instructions-- + +Add version `1.1.0` of the `@freecodecamp/example` package to the `dependencies` field of your `package.json` file. + +**Note:** `@freecodecamp/example` is a faux package used as a learning tool. + +# --hints-- + +`"dependencies"` should include `"@freecodecamp/example"`. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.property( + packJson.dependencies, + '@freecodecamp/example', + '"dependencies" does not include "@freecodecamp/example"' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + +`"@freecodecamp/example"` version should be `"1.1.0"`. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.match( + packJson.dependencies["@freecodecamp/example"], + /^[\^\~]?1\.1\.0/, + 'Wrong version of "@freecodecamp/example" installed. It should be 1.1.0' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c01.md b/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c01.md new file mode 100644 index 0000000000..deda9b82de --- /dev/null +++ b/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c01.md @@ -0,0 +1,64 @@ +--- +id: 587d7fb5367417b2b2512c01 +title: Manage npm Dependencies By Understanding Semantic Versioning +challengeType: 2 +forumTopicId: 301529 +dashedName: manage-npm-dependencies-by-understanding-semantic-versioning +--- + +# --description-- + +`Versions` of the npm packages in the dependencies section of your package.json file follow what’s called Semantic Versioning (SemVer), an industry standard for software versioning aiming to make it easier to manage dependencies. Libraries, frameworks or other tools published on npm should use SemVer in order to clearly communicate what kind of changes projects can expect if they update. + +Knowing SemVer can be useful when you develop software that uses external dependencies (which you almost always do). One day, your understanding of these numbers will save you from accidentally introducing breaking changes to your project without understanding why things that worked yesterday suddenly don’t work today. This is how Semantic Versioning works according to the official website: + +```json +"package": "MAJOR.MINOR.PATCH" +``` + +The MAJOR version should increment when you make incompatible API changes. The MINOR version should increment when you add functionality in a backwards-compatible manner. The PATCH version should increment when you make backwards-compatible bug fixes. This means that PATCHes are bug fixes and MINORs add new features but neither of them break what worked before. Finally, MAJORs add changes that won’t work with earlier versions. + +# --instructions-- + +In the dependencies section of your `package.json` file, change the version of `@freecodecamp/example` to match MAJOR version 1, MINOR version 2 and PATCH version 13 + +# --hints-- + +`"dependencies"` should include `"@freecodecamp/example"`. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.property( + packJson.dependencies, + '@freecodecamp/example', + '"dependencies" does not include "@freecodecamp/example"' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + +`"@freecodecamp/example"` version should be `"1.2.13"`. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.equal( + packJson.dependencies["@freecodecamp/example"], + '1.2.13', + 'Wrong version of "@freecodecamp/example". It should be 1.2.13' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c02.md b/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c02.md new file mode 100644 index 0000000000..8eae5f51ee --- /dev/null +++ b/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c02.md @@ -0,0 +1,66 @@ +--- +id: 587d7fb5367417b2b2512c02 +title: Use the Tilde-Character to Always Use the Latest Patch Version of a Dependency +challengeType: 2 +forumTopicId: 301532 +dashedName: use-the-tilde-character-to-always-use-the-latest-patch-version-of-a-dependency +--- + +# --description-- + +In the last challenge, you told npm to only include a specific version of a package. That’s a useful way to freeze your dependencies if you need to make sure that different parts of your project stay compatible with each other. But in most use cases, you don’t want to miss bug fixes since they often include important security patches and (hopefully) don’t break things in doing so. + +To allow an npm dependency to update to the latest PATCH version, you can prefix the dependency’s version with the tilde (`~`) character. Here's an example of how to allow updates to any `1.3.x` version. + +```json +"package": "~1.3.8" +``` + +# --instructions-- + +In the package.json file, your current rule for how npm may upgrade `@freecodecamp/example` is to use a specific version (`1.2.13`). But now, you want to allow the latest `1.2.x` version. + +Use the tilde (`~`) character to prefix the version of `@freecodecamp/example` in your dependencies, and allow npm to update it to any new _patch_ release. + +**Note:** The version numbers themselves should not be changed. + +# --hints-- + +`"dependencies"` should include `"@freecodecamp/example"`. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.property( + packJson.dependencies, + '@freecodecamp/example', + '"dependencies" does not include "@freecodecamp/example"' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + +`"@freecodecamp/example"` version should match `"~1.2.13"`. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.match( + packJson.dependencies["@freecodecamp/example"], + /^\~1\.2\.13/, + 'Wrong version of "@freecodecamp/example". It should be ~1.2.13' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c03.md b/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c03.md new file mode 100644 index 0000000000..adc3014ea4 --- /dev/null +++ b/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c03.md @@ -0,0 +1,66 @@ +--- +id: 587d7fb5367417b2b2512c03 +title: Use the Caret-Character to Use the Latest Minor Version of a Dependency +challengeType: 2 +forumTopicId: 301531 +dashedName: use-the-caret-character-to-use-the-latest-minor-version-of-a-dependency +--- + +# --description-- + +Similar to how the tilde we learned about in the last challenge allows npm to install the latest PATCH for a dependency, the caret (`^`) allows npm to install future updates as well. The difference is that the caret will allow both MINOR updates and PATCHes. + +Your current version of `@freecodecamp/example` should be `~1.2.13` which allows npm to install to the latest `1.2.x` version. If you were to use the caret (^) as a version prefix instead, npm would be allowed to update to any `1.x.x` version. + +```json +"package": "^1.3.8" +``` + +This would allow updates to any `1.x.x` version of the package. + +# --instructions-- + +Use the caret (`^`) to prefix the version of `@freecodecamp/example` in your dependencies and allow npm to update it to any new MINOR release. + +**Note:** The version numbers themselves should not be changed. + +# --hints-- + +`"dependencies"` should include `"@freecodecamp/example"`. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.property( + packJson.dependencies, + '@freecodecamp/example', + '"dependencies" does not include "@freecodecamp/example"' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + +`"@freecodecamp/example"` version should match `"^1.x.x"`. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.match( + packJson.dependencies["@freecodecamp/example"], + /^\^1\./, + 'Wrong version of "@freecodecamp/example". It should be ^1.2.13' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c04.md b/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c04.md new file mode 100644 index 0000000000..5f695eed88 --- /dev/null +++ b/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c04.md @@ -0,0 +1,43 @@ +--- +id: 587d7fb5367417b2b2512c04 +title: Remove a Package from Your Dependencies +challengeType: 2 +forumTopicId: 301530 +dashedName: remove-a-package-from-your-dependencies +--- + +# --description-- + +You have now tested a few ways you can manage dependencies of your project by using the package.json's dependencies section. You have also included external packages by adding them to the file and even told npm what types of versions you want, by using special characters such as the tilde or the caret. + +But what if you want to remove an external package that you no longer need? You might already have guessed it, just remove the corresponding key-value pair for that package from your dependencies. + +This same method applies to removing other fields in your package.json as well. + +# --instructions-- + +Remove the `@freecodecamp/example` package from your dependencies. + +**Note:** Make sure you have the right amount of commas after removing it. + +# --hints-- + +`"dependencies"` should not include `"@freecodecamp/example"`. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.notProperty( + packJson.dependencies, + '@freecodecamp/example', + '"dependencies" still includes "@freecodecamp/example"' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/chinese/13-relational-databases/build-a-periodic-table-database-project/build-a-periodic-table-database.md b/curriculum/challenges/chinese/13-relational-databases/build-a-periodic-table-database-project/build-a-periodic-table-database.md index f5853c146e..50262f5248 100644 --- a/curriculum/challenges/chinese/13-relational-databases/build-a-periodic-table-database-project/build-a-periodic-table-database.md +++ b/curriculum/challenges/chinese/13-relational-databases/build-a-periodic-table-database-project/build-a-periodic-table-database.md @@ -8,7 +8,7 @@ dashedName: build-a-periodic-table-database # --description-- -这是你获得认证的必做项目之一。 对于此项目,你将创建 Bash 脚本以从元素周期表数据库中获取有关化学元素的信息。 +这是你获得认证的必做项目之一。 For this project, you will create a Bash script to get information about chemical elements from a periodic table database. # --instructions-- diff --git a/curriculum/challenges/chinese/14-responsive-web-design-22/learn-basic-css-by-building-a-cafe-menu/5f3ef6e0a81099d9a697b550.md b/curriculum/challenges/chinese/14-responsive-web-design-22/learn-basic-css-by-building-a-cafe-menu/5f3ef6e0a81099d9a697b550.md index e56eff5b06..548bc0088b 100644 --- a/curriculum/challenges/chinese/14-responsive-web-design-22/learn-basic-css-by-building-a-cafe-menu/5f3ef6e0a81099d9a697b550.md +++ b/curriculum/challenges/chinese/14-responsive-web-design-22/learn-basic-css-by-building-a-cafe-menu/5f3ef6e0a81099d9a697b550.md @@ -9,6 +9,8 @@ dashedName: step-64 在 `footer` 中,添加一个 `p` 元素。 然后,在 `p` 中嵌套一个锚(`a`)元素,链接到 `https://www.freecodecamp.org`,并有文字 `Visit our website`。 +Make sure that the link opens in a new tab by adding a `target` attribute with the value `_blank`. + # --hints-- 你不应该修改现有的 `footer` 元素。 @@ -43,6 +45,12 @@ assert(document.querySelector("footer > p > a")?.innerText === "Visit our websit assert(document.querySelector("footer > p > a")?.href === "https://www.freecodecamp.org/"); ``` +Your new `a` element should have the `target` attribute set to `_blank`. + +```js +assert.equal(document.querySelector("footer > p > a")?.target, "_blank"); +``` + # --seed-- ## --seed-contents-- diff --git a/curriculum/challenges/chinese/14-responsive-web-design-22/learn-intermediate-css-by-building-a-cat-painting/646de7b64467e96b7d35b5cd.md b/curriculum/challenges/chinese/14-responsive-web-design-22/learn-intermediate-css-by-building-a-cat-painting/646de7b64467e96b7d35b5cd.md index 7e2d7fc923..f87325c93b 100644 --- a/curriculum/challenges/chinese/14-responsive-web-design-22/learn-intermediate-css-by-building-a-cat-painting/646de7b64467e96b7d35b5cd.md +++ b/curriculum/challenges/chinese/14-responsive-web-design-22/learn-intermediate-css-by-building-a-cat-painting/646de7b64467e96b7d35b5cd.md @@ -7,7 +7,7 @@ dashedName: step-47 # --description-- -Move the right eye into position with a `position` property of `absolute`, a `top` of `54px`, and a `left` of `134px`. +将右眼移动到位,其 `position` 属性为 `absolute`,`top` 为 `54px`,`left` 为 `134px`。 # --hints-- diff --git a/curriculum/challenges/chinese/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-j.md b/curriculum/challenges/chinese/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-j.md index d2ad72a1ea..1b6ca05444 100644 --- a/curriculum/challenges/chinese/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-j.md +++ b/curriculum/challenges/chinese/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-j.md @@ -21,12 +21,12 @@ Remove `flex: 1` from `.item` and add `justify-content: space-between` to `.cont `justify-content` aligns items across the **main axis**. There are a few values that you can use here. You'll learn the rest of them in the reading assignments, but for now try changing it to center, which should center the boxes along the main axis. -# --question-- - -## --assignment-- +# --assignment-- Before moving on to the next lesson, see what is possible with the `justify-content` property. Read this [interactive article on MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/justify-content) and play around with the different values of `justify-content` on the example. +# --question-- + ## --text-- How does applying `justify-content: space-between` to a flex container affect the positioning of its items? diff --git a/curriculum/challenges/chinese/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-k.md b/curriculum/challenges/chinese/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-k.md index d3137b0af5..59acb55a29 100644 --- a/curriculum/challenges/chinese/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-k.md +++ b/curriculum/challenges/chinese/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-k.md @@ -17,12 +17,12 @@ To change the placement of items along the cross axis use `align-items`. Try get Because `justify-content` and `align-items` are based on the main and cross axis of your container, their behavior changes when you change the flex-direction of a flex-container. For example, when you change `flex-direction` to `column`, `justify-content` aligns vertically and `align-items` aligns horizontally. The most common behavior, however, is the default, i.e. `justify-content` aligns items horizontally (because the main axis defaults to horizontal), and `align-items` aligns them vertically. One of the biggest sticking points that beginners have with flexbox is confusion when this behavior changes. -# --question-- - -## --assignment-- +# --assignment-- Before moving on to the next lesson, see if you can figure out how `align-items` behaves when you change the `flex-direction` property to `column`. +# --question-- + ## --text-- When changing the `flex-direction` property to `column` in a flex container, how does `align-items` behave in relation to the flex items? diff --git a/curriculum/challenges/chinese/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-b.md b/curriculum/challenges/chinese/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-b.md index 1adf9ce84f..49edeac0e4 100644 --- a/curriculum/challenges/chinese/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-b.md +++ b/curriculum/challenges/chinese/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-b.md @@ -9,12 +9,12 @@ dashedName: learn-block-and-inline-lesson-b Inline elements, however, do not start on a new line. They appear in line with whatever elements they are placed beside. A clear example of an inline element is a link, or `` tag. If you stick one of these in the middle of a paragraph of text, it will behave like a part of the paragraph. (Like this) The link’s text will sit alongside other words in that paragraph. Additionally, padding and margin behave differently on inline elements. In general, you do not want to try to put extra padding or margin on inline elements. -# --question-- - -## --assignment-- +# --assignment-- Search the web for a list of `block` elements and a list of `inline` elements. +# --question-- + ## --text-- What is the difference between a `block` element and an `inline` element? diff --git a/curriculum/challenges/chinese/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-g.md b/curriculum/challenges/chinese/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-g.md index cdd4d5aa87..e75492e9c1 100644 --- a/curriculum/challenges/chinese/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-g.md +++ b/curriculum/challenges/chinese/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-g.md @@ -7,7 +7,7 @@ dashedName: learn-block-and-inline-lesson-g # --description-- -Now that you have some basic understanding of `block` and inline `elements`, pull up your list of `block` and `inline` elements from a couple questions ago and see if you can identify which of the following elements are `block` elements and which are `inline` elements. +Now that you have some basic understanding of `block` and `inline` elements, pull up your list of `block` and `inline` elements from a couple questions ago and see if you can identify which of the following elements are `block` elements and which are `inline` elements. # --question-- diff --git a/curriculum/challenges/chinese/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-a.md b/curriculum/challenges/chinese/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-a.md index 995073b8a2..a7a2ee9a51 100644 --- a/curriculum/challenges/chinese/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-a.md +++ b/curriculum/challenges/chinese/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-a.md @@ -21,12 +21,12 @@ New programmers often find problem solving the hardest skill to build. It's not The best way to improve your problem solving ability is by building experience by making lots and lots of programs. The more practice you have the better you'll be prepared to solve real world problems. -# --question-- - -## --assignment-- +# --assignment-- Read How to Think Like a Programmer - Lessons in Problem Solving by Richard Reis. +# --question-- + ## --text-- According to V. Anton Spraul in "Think Like a Programmer," what is problem solving in programming? diff --git a/curriculum/challenges/chinese/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-b.md b/curriculum/challenges/chinese/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-b.md index ae905ecf89..c57a7d43e8 100644 --- a/curriculum/challenges/chinese/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-b.md +++ b/curriculum/challenges/chinese/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-b.md @@ -25,11 +25,11 @@ Now that you know what you’re aiming to solve, don’t jump into coding just y The last question is where you will write out an algorithm to solve the problem. You can think of an algorithm as a recipe for solving a particular problem. It defines the steps that need to be taken by the computer to solve a problem in pseudocode. -# --question-- - -## --assignment-- +# --assignment-- Watch How to Begin Thinking Like a Programmer by Coding Tech. It’s an hour long but packed full of information and definitely worth your time watching. +# --question-- + ## --text-- What should you do before starting to code according to the provided text? diff --git a/curriculum/challenges/chinese/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-c.md b/curriculum/challenges/chinese/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-c.md index c837fd9658..082f2d51ae 100644 --- a/curriculum/challenges/chinese/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-c.md +++ b/curriculum/challenges/chinese/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-c.md @@ -22,12 +22,12 @@ Print the value of the counter variable This is a basic program to demonstrate how pseudocode looks. There will be more examples of pseudocode included in the assignments. +# --assignment-- -# --question-- - -## --assignment-- Read this Pseudocode: What It Is and How to Write It article from Built In. +# --question-- + ## --text-- What are the benefits of using pseudocode according to the linked article? diff --git a/curriculum/challenges/chinese/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657b69e10d6606a0185d4d4f.md b/curriculum/challenges/chinese/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657b69e10d6606a0185d4d4f.md index 67cd63830c..9e77d699c7 100644 --- a/curriculum/challenges/chinese/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657b69e10d6606a0185d4d4f.md +++ b/curriculum/challenges/chinese/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657b69e10d6606a0185d4d4f.md @@ -9,7 +9,7 @@ dashedName: task-23 # --description-- -So far you have learned how to create questions with the verb to be. In sentences with the verb `to be` (am, is, are) you just have to change the order of the noun and the verb to create a question. Like this: +So far you have learned how to create questions with the verb `to be`. In sentences with the verb `to be` (am, is, are) you just have to change the order of the noun and the verb to create a question. Like this: `You are a developer` -> `Are you a developer?` diff --git a/curriculum/challenges/chinese/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657dce8ff35869721311a5e3.md b/curriculum/challenges/chinese/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657dce8ff35869721311a5e3.md index 544d8f1988..8cd311a518 100644 --- a/curriculum/challenges/chinese/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657dce8ff35869721311a5e3.md +++ b/curriculum/challenges/chinese/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657dce8ff35869721311a5e3.md @@ -21,7 +21,7 @@ Which sentence is correct for describing one place near you? ### --feedback-- -`There are` is used for plural nouns, and `bank` is singular. You’ll learn about there are in the next few lessons. +`There are` is used for plural nouns, and `bank` is singular. You’ll learn about `there are` in the next few lessons. --- diff --git a/curriculum/challenges/chinese/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657dcee413423174ca3747f5.md b/curriculum/challenges/chinese/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657dcee413423174ca3747f5.md index 6526b1e95b..10c0845779 100644 --- a/curriculum/challenges/chinese/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657dcee413423174ca3747f5.md +++ b/curriculum/challenges/chinese/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657dcee413423174ca3747f5.md @@ -7,7 +7,7 @@ dashedName: task-112 # --description-- -To elaborate a question using `there is` you just need to change the order of the verb to be, like so: +To elaborate a question using `there is` you just need to change the order of the verb `to be`, like so: `There is an ATM nearby` -> `Is there an ATM nearby?` diff --git a/curriculum/challenges/chinese/25-front-end-development/lab-celestial-bodies-database/5f1a4ef5d5d6b5ab580fc6ae.md b/curriculum/challenges/chinese/25-front-end-development/lab-celestial-bodies-database/5f1a4ef5d5d6b5ab580fc6ae.md new file mode 100644 index 0000000000..7d664a8876 --- /dev/null +++ b/curriculum/challenges/chinese/25-front-end-development/lab-celestial-bodies-database/5f1a4ef5d5d6b5ab580fc6ae.md @@ -0,0 +1,25 @@ +--- +id: 5f1a4ef5d5d6b5ab580fc6ae +title: Build a Celestial Bodies Database +challengeType: 13 +url: freeCodeCamp/learn-celestial-bodies-database +dashedName: lab-celestial-bodies-database +--- + +# --description-- + +For this project, you will build a database of celestial bodies using PostgreSQL. + +# --instructions-- + +**Important:** After you pass all the project tests, save a dump of your database into a `universe.sql` file so you can complete step 2. There will be instructions how to do that within the virtual machine. + +# --notes-- + +Required files: `universe.sql` + +# --hints-- + +# --seed-- + +# --solutions-- diff --git a/curriculum/challenges/chinese/25-front-end-development/lab-exercise-tracker/5a8b073d06fa14fcfde687aa.md b/curriculum/challenges/chinese/25-front-end-development/lab-exercise-tracker/5a8b073d06fa14fcfde687aa.md new file mode 100644 index 0000000000..9492b82cb4 --- /dev/null +++ b/curriculum/challenges/chinese/25-front-end-development/lab-exercise-tracker/5a8b073d06fa14fcfde687aa.md @@ -0,0 +1,611 @@ +--- +id: 5a8b073d06fa14fcfde687aa +title: Build an Exercise Tracker +challengeType: 4 +dashedName: build-an-exercise-tracker +--- + +# --description-- + +Build a full stack JavaScript app that is functionally similar to this: https://exercise-tracker.freecodecamp.rocks. Working on this project will involve you writing your code using one of the following methods: + +- Clone this GitHub repo and complete your project locally. +- Use our Gitpod starter project to complete your project. +- Use a site builder of your choice to complete the project. Be sure to incorporate all the files from our GitHub repo. + +# --instructions-- + +Your responses should have the following structures. + +Exercise: + +```js +{ + username: "fcc_test", + description: "test", + duration: 60, + date: "Mon Jan 01 1990", + _id: "5fb5853f734231456ccb3b05" +} +``` + +User: + +```js +{ + username: "fcc_test", + _id: "5fb5853f734231456ccb3b05" +} +``` + +Log: + +```js +{ + username: "fcc_test", + count: 1, + _id: "5fb5853f734231456ccb3b05", + log: [{ + description: "test", + duration: 60, + date: "Mon Jan 01 1990", + }] +} +``` + +**Hint:** For the `date` property, the `toDateString` method of the `Date` API can be used to achieve the expected output. + +# --hints-- + +You should provide your own project, not the example URL. + +```js +(getUserInput) => { + const url = getUserInput('url'); + assert( + !/.*\/exercise-tracker\.freecodecamp\.rocks/.test(getUserInput('url')) + ); +}; +``` + +You can `POST` to `/api/users` with form data `username` to create a new user. + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `username=fcc_test_${Date.now()}`.substring(0, 29) + }); + assert.isTrue(res.ok); + if(!res.ok) { + throw new Error(`${res.status} ${res.statusText}`) + }; +}; +``` + +The returned response from `POST /api/users` with form data `username` will be an object with `username` and `_id` properties. + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `username=fcc_test_${Date.now()}`.substring(0, 29) + }); + if (res.ok) { + const { _id, username } = await res.json(); + assert.exists(_id); + assert.exists(username); + } else { + throw new Error(`${res.status} ${res.statusText}`); + } +}; +``` + +You can make a `GET` request to `/api/users` to get a list of all users. + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users'); + assert.isTrue(res.ok); + if(!res.ok) { + throw new Error(`${res.status} ${res.statusText}`) + }; +}; +``` + +The `GET` request to `/api/users` returns an array. + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users'); + if(res.ok){ + const users = await res.json(); + assert.isArray(users); + } else { + throw new Error(`${res.status} ${res.statusText}`); + }; +}; +``` + +Each element in the array returned from `GET /api/users` is an object literal containing a user's `username` and `_id`. + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users'); + if(res.ok){ + const users = await res.json(); + const user = users[0]; + assert.exists(user); + assert.exists(user.username); + assert.exists(user._id); + assert.isString(user.username); + assert.isString(user._id); + } else { + throw new Error(`${res.status} ${res.statusText}`); + }; +}; +``` + +You can `POST` to `/api/users/:_id/exercises` with form data `description`, `duration`, and optionally `date`. If no date is supplied, the current date will be used. + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `username=fcc_test_${Date.now()}`.substring(0, 29) + }); + if (res.ok) { + const { _id, username } = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: 'Mon Jan 01 1990' + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `description=${expected.description}&duration=${expected.duration}&date=1990-01-01` + }); + assert.isTrue(addRes.ok); + if(!addRes.ok) { + throw new Error(`${addRes.status} ${addRes.statusText}`) + }; + } else { + throw new Error(`${res.status} ${res.statusText}`); + } +}; +``` + +The response returned from `POST /api/users/:_id/exercises` will be the user object with the exercise fields added. + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `username=fcc_test_${Date.now()}`.substring(0, 29) + }); + if (res.ok) { + const { _id, username } = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: 'Mon Jan 01 1990' + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `description=${expected.description}&duration=${expected.duration}&date=1990-01-01` + }); + if (addRes.ok) { + const actual = await addRes.json(); + assert.deepEqual(actual, expected); + assert.isString(actual.description); + assert.isNumber(actual.duration); + assert.isString(actual.date); + } else { + throw new Error(`${addRes.status} ${addRes.statusText}`); + } + } else { + throw new Error(`${res.status} ${res.statusText}`); + } +}; +``` + +You can make a `GET` request to `/api/users/:_id/logs` to retrieve a full exercise log of any user. + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `username=fcc_test_${Date.now()}`.substring(0, 29) + }); + if (res.ok) { + const { _id, username } = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: new Date().toDateString() + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `description=${expected.description}&duration=${expected.duration}` + }); + if (addRes.ok) { + const logRes = await fetch(url + `/api/users/${_id}/logs`); + assert.isTrue(logRes.ok); + if(!logRes.ok) { + throw new Error(`${logRes.status} ${logRes.statusText}`) + }; + } else { + throw new Error(`${addRes.status} ${addRes.statusText}`); + } + } else { + throw new Error(`${res.status} ${res.statusText}`); + } +}; +``` + +A request to a user's log `GET /api/users/:_id/logs` returns a user object with a `count` property representing the number of exercises that belong to that user. + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `username=fcc_test_${Date.now()}`.substring(0, 29) + }); + if (res.ok) { + const { _id, username } = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: new Date().toDateString() + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `description=${expected.description}&duration=${expected.duration}` + }); + if (addRes.ok) { + const logRes = await fetch(url + `/api/users/${_id}/logs`); + if (logRes.ok) { + const { count } = await logRes.json(); + assert(count); + } else { + throw new Error(`${logRes.status} ${logRes.statusText}`); + } + } else { + throw new Error(`${addRes.status} ${addRes.statusText}`); + } + } else { + throw new Error(`${res.status} ${res.statusText}`); + } +}; +``` + +A `GET` request to `/api/users/:_id/logs` will return the user object with a `log` array of all the exercises added. + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded' + }, + body: `username=fcc_test_${Date.now()}`.substring(0, 29) + }) + if(res.ok){ + const {_id, username} = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: new Date().toDateString() + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `description=${expected.description}&duration=${expected.duration}` + }); + if(addRes.ok){ + const logRes = await fetch(url + `/api/users/${_id}/logs`); + if(logRes.ok) { + const {log} = await logRes.json(); + assert.isArray(log); + assert.equal(1, log.length); + } else { + throw new Error(`${logRes.status} ${logRes.statusText}`); + } + } else { + throw new Error(`${addRes.status} ${addRes.statusText}`); + }; + } else { + throw new Error(`${res.status} ${res.statusText}`) + }; +}; +``` + +Each item in the `log` array that is returned from `GET /api/users/:_id/logs` is an object that should have a `description`, `duration`, and `date` properties. + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + `/api/users`, { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded' + }, + body: `username=fcc_test_${Date.now()}`.substring(0, 29) + }); + if(res.ok) { + const {_id, username} = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: new Date().toDateString() + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `description=${expected.description}&duration=${expected.duration}` + }); + if(addRes.ok) { + const logRes = await fetch(url + `/api/users/${_id}/logs`); + if(logRes.ok) { + const {log} = await logRes.json(); + const exercise = log[0]; + assert.exists(exercise); + assert.exists(exercise.description); + assert.exists(exercise.duration); + assert.exists(exercise.date); + } else { + throw new Error(`${logRes.status} ${logRes.statusText}`); + }; + } else { + throw new Error(`${addRes.status} ${addRes.statusText}`); + }; + } else { + throw new Error(`${res.status} ${res.statusText}`) + }; +}; +``` + +The `description` property of any object in the `log` array that is returned from `GET /api/users/:_id/logs` should be a string. + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + body: `username=fcc_test_${Date.now()}`.substring(0,29) + }); + if(res.ok) { + const {_id, username} = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: new Date().toDateString() + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + body: `description=${expected.description}&duration=${expected.duration}` + }); + if(addRes.ok) { + const logRes = await fetch(url + `/api/users/${_id}/logs`); + if(logRes.ok){ + const {log} = await logRes.json(); + const exercise = log[0]; + assert.isString(exercise.description); + assert.equal(exercise.description, expected.description); + } else { + throw new Error(`${logRes.status} ${logRes.statusText}`); + } + } else { + throw new Error(`${addRes.status} ${addRes.statusText}`); + }; + } else { + throw new Error(`${res.status} ${res.statusText}`); + }; +}; +``` + +The `duration` property of any object in the `log` array that is returned from `GET /api/users/:_id/logs` should be a number. + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + body: `username=fcc_test_${Date.now()}`.substring(0,29) + }); + if(res.ok) { + const {_id, username} = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: new Date().toDateString() + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + body: `description=${expected.description}&duration=${expected.duration}` + }); + if(addRes.ok) { + const logRes = await fetch(url + `/api/users/${_id}/logs`); + if(logRes.ok){ + const {log} = await logRes.json(); + const exercise = log[0]; + assert.isNumber(exercise.duration); + assert.equal(exercise.duration, expected.duration); + } else { + throw new Error(`${logRes.status} ${logRes.statusText}`); + } + } else { + throw new Error(`${addRes.status} ${addRes.statusText}`); + }; + } else { + throw new Error(`${res.status} ${res.statusText}`); + }; +}; +``` + +The `date` property of any object in the `log` array that is returned from `GET /api/users/:_id/logs` should be a string. Use the `dateString` format of the `Date` API. + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + body: `username=fcc_test_${Date.now()}`.substring(0,29) + }); + if(res.ok) { + const {_id, username} = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: new Date().toLocaleDateString("en-US", { + timeZone: "UTC", weekday: "short", month: "short", + day: "2-digit", year: "numeric" + }).replaceAll(',', '') + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + body: `description=${expected.description}&duration=${expected.duration}` + }); + if(addRes.ok) { + const logRes = await fetch(url + `/api/users/${_id}/logs`); + if(logRes.ok){ + const {log} = await logRes.json(); + const exercise = log[0]; + assert.isString(exercise.date); + assert.equal(exercise.date, expected.date); + } else { + throw new Error(`${logRes.status} ${logRes.statusText}`); + } + } else { + throw new Error(`${addRes.status} ${addRes.statusText}`); + }; + } else { + throw new Error(`${res.status} ${res.statusText}`); + }; +}; +``` + +You can add `from`, `to` and `limit` parameters to a `GET /api/users/:_id/logs` request to retrieve part of the log of any user. `from` and `to` are dates in `yyyy-mm-dd` format. `limit` is an integer of how many logs to send back. + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `username=fcc_test_${Date.now()}`.substring(0, 29) + }); + if (res.ok) { + const { _id, username } = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: new Date().toDateString() + }; + const addExerciseRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `description=${expected.description}&duration=${expected.duration}&date=1990-01-01` + }); + const addExerciseTwoRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `description=${expected.description}&duration=${expected.duration}&date=1990-01-03` + }); + if (addExerciseRes.ok && addExerciseTwoRes.ok) { + const logRes = await fetch( + url + `/api/users/${_id}/logs?from=1989-12-31&to=1990-01-04` + ); + if (logRes.ok) { + const { log } = await logRes.json(); + assert.isArray(log); + assert.equal(2, log.length); + } else { + throw new Error(`${logRes.status} ${logRes.statusText}`); + } + const limitRes = await fetch( + url + `/api/users/${_id}/logs?limit=1` + ); + if (limitRes.ok) { + const { log } = await limitRes.json(); + assert.isArray(log); + assert.equal(1, log.length); + } else { + throw new Error(`${limitRes.status} ${limitRes.statusText}`); + } + const filterDateBeforeLimitRes = await fetch( + url + `/api/users/${_id}/logs?from=1990-01-02&to=1990-01-04&limit=1` + ); + if (filterDateBeforeLimitRes.ok) { + const { log } = await filterDateBeforeLimitRes.json(); + assert.isArray(log); + assert.equal(1, log.length); + } else { + throw new Error(`${filterDateBeforeLimitRes.status} ${filterDateBeforeLimitRes.statusText}`); + } + } else { + throw new Error(`${res.status} ${res.statusText}`); + } + } else { + throw new Error(`${res.status} ${res.statusText}`); + } +}; +``` diff --git a/curriculum/challenges/chinese/25-front-end-development/lab-number-guessing-game/602da04c22201c65d2a019f4.md b/curriculum/challenges/chinese/25-front-end-development/lab-number-guessing-game/602da04c22201c65d2a019f4.md new file mode 100644 index 0000000000..ef87dc6720 --- /dev/null +++ b/curriculum/challenges/chinese/25-front-end-development/lab-number-guessing-game/602da04c22201c65d2a019f4.md @@ -0,0 +1,25 @@ +--- +id: 602da04c22201c65d2a019f4 +title: Build a Number Guessing Game +challengeType: 13 +url: freeCodeCamp/learn-number-guessing-game +dashedName: lab-number-guessing-game +--- + +# --description-- + +For this lab, you will use Bash scripting, PostgreSQL, and Git to create a number guessing game that runs in the terminal and saves user information. + +# --instructions-- + +**Important:** After you pass all the project tests, save a dump of your database into a `number_guess.sql` file, as well as your `number_guess.sh` file, so you can complete step 2. There will be instructions on how to do that within the virtual machine. + +# --notes-- + +Required files: `number_guess.sql`, `number_guess.sh` + +# --hints-- + +# --seed-- + +# --solutions-- diff --git a/curriculum/challenges/chinese/25-front-end-development/lab-request-header-parser-microservice/bd7158d8c443edefaeb5bdff.md b/curriculum/challenges/chinese/25-front-end-development/lab-request-header-parser-microservice/bd7158d8c443edefaeb5bdff.md new file mode 100644 index 0000000000..5040e27424 --- /dev/null +++ b/curriculum/challenges/chinese/25-front-end-development/lab-request-header-parser-microservice/bd7158d8c443edefaeb5bdff.md @@ -0,0 +1,65 @@ +--- +id: bd7158d8c443edefaeb5bdff +title: Build a Request Header Parser Microservice +challengeType: 4 +dashedName: lab-request-header-parser-microservice +--- + +# --description-- + +Build a full stack JavaScript app that is functionally similar to this: https://request-header-parser-microservice.freecodecamp.rocks/. Working on this project will involve you writing your code using one of the following methods: + +- Clone this GitHub repo and complete your project locally. +- Use our Gitpod starter project to complete your project. +- Use a site builder of your choice to complete the project. Be sure to incorporate all the files from our GitHub repo. + +# --hints-- + +You should provide your own project, not the example URL. + +```js +(getUserInput) => { + assert( + !/.*\/request-header-parser-microservice\.freecodecamp\.rocks/.test( + getUserInput('url') + ) + ); +}; +``` + +A request to `/api/whoami` should return a JSON object with your IP address in the `ipaddress` key. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/api/whoami').then( + (data) => assert(data.ipaddress && data.ipaddress.length > 0), + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + +A request to `/api/whoami` should return a JSON object with your preferred language in the `language` key. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/api/whoami').then( + (data) => assert(data.language && data.language.length > 0), + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + +A request to `/api/whoami` should return a JSON object with your software in the `software` key. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/api/whoami').then( + (data) => assert(data.software && data.software.length > 0), + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/chinese/25-front-end-development/lab-url-shortener-microservice/bd7158d8c443edefaeb5bd0e.md b/curriculum/challenges/chinese/25-front-end-development/lab-url-shortener-microservice/bd7158d8c443edefaeb5bd0e.md new file mode 100644 index 0000000000..0fbf80a0bf --- /dev/null +++ b/curriculum/challenges/chinese/25-front-end-development/lab-url-shortener-microservice/bd7158d8c443edefaeb5bd0e.md @@ -0,0 +1,107 @@ +--- +id: bd7158d8c443edefaeb5bd0e +title: URL Shortener Microservice +challengeType: 4 +dashedName: url-shortener-microservice +--- + +# --description-- + +Build a full stack JavaScript app that is functionally similar to this: https://url-shortener-microservice.freecodecamp.rocks. Working on this project will involve you writing your code using one of the following methods: + +- Clone this GitHub repo and complete your project locally. +- Use our Gitpod starter project to complete your project. +- Use a site builder of your choice to complete the project. Be sure to incorporate all the files from our GitHub repo. + +# --instructions-- + +**HINT:** Do not forget to use a body parsing middleware to handle the POST requests. Also, you can use the function `dns.lookup(host, cb)` from the `dns` core module to verify a submitted URL. + +# --hints-- + +You should provide your own project, not the example URL. + +```js +(getUserInput) => { + assert( + !/.*\/url-shortener-microservice\.freecodecamp\.rocks/.test( + getUserInput('url') + ) + ); +}; +``` + +You can POST a URL to `/api/shorturl` and get a JSON response with `original_url` and `short_url` properties. Here's an example: `{ original_url : 'https://freeCodeCamp.org', short_url : 1}` + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const urlVariable = Date.now(); + const fullUrl = `${url}/?v=${urlVariable}` + const res = await fetch(url + '/api/shorturl', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `url=${fullUrl}` + }); + if (res.ok) { + const { short_url, original_url } = await res.json(); + assert.isNotNull(short_url); + assert.strictEqual(original_url, `${url}/?v=${urlVariable}`); + } else { + throw new Error(`${res.status} ${res.statusText}`); + } +}; +``` + +When you visit `/api/shorturl/`, you will be redirected to the original URL. + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const urlVariable = Date.now(); + const fullUrl = `${url}/?v=${urlVariable}` + let shortenedUrlVariable; + const postResponse = await fetch(url + '/api/shorturl', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `url=${fullUrl}` + }); + if (postResponse.ok) { + const { short_url } = await postResponse.json(); + shortenedUrlVariable = short_url; + } else { + throw new Error(`${postResponse.status} ${postResponse.statusText}`); + } + const getResponse = await fetch( + url + '/api/shorturl/' + shortenedUrlVariable + ); + if (getResponse) { + const { redirected, url } = getResponse; + assert.isTrue(redirected); + assert.strictEqual(url,fullUrl); + } else { + throw new Error(`${getResponse.status} ${getResponse.statusText}`); + } +}; +``` + +If you pass an invalid URL that doesn't follow the valid `http://www.example.com` format, the JSON response will contain `{ error: 'invalid url' }` + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/shorturl', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `url=ftp:/john-doe.invalidTLD` + }); + if (res.ok) { + const { error } = await res.json(); + assert.isNotNull(error); + assert.strictEqual(error.toLowerCase(), 'invalid url'); + } else { + throw new Error(`${res.status} ${res.statusText}`); + } +}; +``` + diff --git a/curriculum/challenges/chinese/25-front-end-development/lab-world-cup-database/5f9771307d4d22b9d2b75a94.md b/curriculum/challenges/chinese/25-front-end-development/lab-world-cup-database/5f9771307d4d22b9d2b75a94.md new file mode 100644 index 0000000000..d77442a1ba --- /dev/null +++ b/curriculum/challenges/chinese/25-front-end-development/lab-world-cup-database/5f9771307d4d22b9d2b75a94.md @@ -0,0 +1,25 @@ +--- +id: 5f9771307d4d22b9d2b75a94 +title: Build a World Cup Database +challengeType: 13 +url: freeCodeCamp/learn-world-cup-database +dashedName: lab-world-cup-database +--- + +# --description-- + +For this project, you will create a Bash script that enters information from World Cup games into PostgreSQL, then query the database for useful statistics. + +# --instructions-- + +**Important:** After you pass all the project tests, save a dump of your database into a `worldcup.sql` file, as well as your `insert_data.sh` and `queries.sh` files, so you can complete step 2. There will be instructions how to do that within the virtual machine. + +# --notes-- + +Required files: `worldcup.sql`, `insert_data.sh`, `queries.sh` + +# --hints-- + +# --seed-- + +# --solutions-- diff --git a/curriculum/challenges/chinese/25-front-end-development/workshop-hotel-feedback-form/66a96127422411756204bc1b.md b/curriculum/challenges/chinese/25-front-end-development/workshop-hotel-feedback-form/66a96127422411756204bc1b.md index 51ea9e3069..753ee1a6bb 100644 --- a/curriculum/challenges/chinese/25-front-end-development/workshop-hotel-feedback-form/66a96127422411756204bc1b.md +++ b/curriculum/challenges/chinese/25-front-end-development/workshop-hotel-feedback-form/66a96127422411756204bc1b.md @@ -7,9 +7,9 @@ dashedName: step-22 # --description-- -Add another label with the text of `Personal Recommendation`. The `for` attribute should be set to `"recommendation"`. +Add another `label` with the text of `Personal Recommendation`. The `for` attribute should be set to `"recommendation"`. -Below the label element, add another checkbox input with the `id`, `name` and `value` attributes set to `"recommendation"`. +Below the `label` element, add another checkbox `input` with the `id`, `name` and `value` attributes set to `"recommendation"`. # --hints-- diff --git a/curriculum/challenges/chinese/25-front-end-development/workshop-hotel-feedback-form/66a962954f4e0d76223b37ed.md b/curriculum/challenges/chinese/25-front-end-development/workshop-hotel-feedback-form/66a962954f4e0d76223b37ed.md index 42c425209d..80a23ca86d 100644 --- a/curriculum/challenges/chinese/25-front-end-development/workshop-hotel-feedback-form/66a962954f4e0d76223b37ed.md +++ b/curriculum/challenges/chinese/25-front-end-development/workshop-hotel-feedback-form/66a962954f4e0d76223b37ed.md @@ -11,7 +11,7 @@ Next, add another `label` element with the text of `Location` and the `for` attr For the checkbox `input`, both the `id`, `name` and `value` attributes should be set to `"location"`. -Below that `input` element, add another `label` element with the text of `Reputation` and the for attribute set to `"reputation"`. +Below that `input` element, add another `label` element with the text of `Reputation` and the `for` attribute set to `"reputation"`. For the checkbox `input`, both the `id`, `name` and `value` attributes should be set to `"reputation"`. diff --git a/curriculum/challenges/chinese/25-front-end-development/workshop-hotel-feedback-form/66a972137acd1179fa3fe8a0.md b/curriculum/challenges/chinese/25-front-end-development/workshop-hotel-feedback-form/66a972137acd1179fa3fe8a0.md index 69efa4832c..09e3e6e59b 100644 --- a/curriculum/challenges/chinese/25-front-end-development/workshop-hotel-feedback-form/66a972137acd1179fa3fe8a0.md +++ b/curriculum/challenges/chinese/25-front-end-development/workshop-hotel-feedback-form/66a972137acd1179fa3fe8a0.md @@ -7,7 +7,7 @@ dashedName: step-28 # --description-- -Inside your `select` element, add the following five `option` elements with these corresponding values for the option text and `value` attribute: +Inside your `select` element, add the following five `option` elements with these corresponding values for the `option` text and `value` attribute: **Value Attributes:** diff --git a/curriculum/challenges/chinese/25-front-end-development/workshop-hotel-feedback-form/66a97ca8c4cbae7d0bb6e0ad.md b/curriculum/challenges/chinese/25-front-end-development/workshop-hotel-feedback-form/66a97ca8c4cbae7d0bb6e0ad.md index 6549345d45..22b9a707be 100644 --- a/curriculum/challenges/chinese/25-front-end-development/workshop-hotel-feedback-form/66a97ca8c4cbae7d0bb6e0ad.md +++ b/curriculum/challenges/chinese/25-front-end-development/workshop-hotel-feedback-form/66a97ca8c4cbae7d0bb6e0ad.md @@ -7,7 +7,7 @@ dashedName: step-31 # --description-- -Inside your `select` element, add the following five `option` elements with these corresponding values for the option text and `value` attribute: +Inside your `select` element, add the following five `option` elements with these corresponding values for the `option` text and `value` attribute: **Value Attribute:** diff --git a/curriculum/challenges/chinese/25-front-end-development/workshop-loan-qualification-checker/66c8ba41a77db20a93f9d7a1.md b/curriculum/challenges/chinese/25-front-end-development/workshop-loan-qualification-checker/66c8ba41a77db20a93f9d7a1.md new file mode 100644 index 0000000000..237515fd88 --- /dev/null +++ b/curriculum/challenges/chinese/25-front-end-development/workshop-loan-qualification-checker/66c8ba41a77db20a93f9d7a1.md @@ -0,0 +1,71 @@ +--- +id: 66c8ba41a77db20a93f9d7a1 +title: Step 1 +challengeType: 1 +dashedName: step-1 +--- + +# --description-- + +In this workshop, you'll review JavaScript conditionals by building a loan qualification checker app. + +The app will check whether the user is eligible for a duplex, car, and condo loan based on their annual income and credit score. A credit score is a number that represents how good you are at managing borrowed money. + +To get started, create the following variables and values. + +| Variable Name | Value | +| ------------------------- | ------- | +| `minIncomeForDuplex` | `60000` | +| `minCreditScoreForDuplex` | `700` | +| `minIncomeForCondo` | `45000` | +| `minCreditScoreForCondo` | `680` | +| `minIncomeForCar` | `30000` | +| `minCreditScoreForCar` | `650` | + +# --hints-- + +You should create a `minIncomeForDuplex` variable set to `60000`. + +```js +assert.equal(minIncomeForDuplex, 60000); +``` + +You should create a `minCreditScoreForDuplex` set to `700`. + +```js +assert.equal(minCreditScoreForDuplex, 700); +``` + +You should create a `minIncomeForCar` variable set to `30000`. + +```js +assert.equal(minIncomeForCar, 30000); +``` + +You should create a `minCreditScoreForCar` variable set to `650`. + +```js +assert.equal(minCreditScoreForCar, 650); +``` + +You should create a `minIncomeForCondo` variable set to `45000`. + +```js +assert.equal(minIncomeForCondo, 45000); +``` + +You should create a `minCreditScoreForCondo` variable set to `680`. + +```js +assert.equal(minCreditScoreForCondo, 680); +``` + +# --seed-- + +## --seed-contents-- + +```js +--fcc-editable-region-- + +--fcc-editable-region-- +``` diff --git a/curriculum/challenges/chinese/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4ac.md b/curriculum/challenges/chinese/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4ac.md new file mode 100644 index 0000000000..7755f823c4 --- /dev/null +++ b/curriculum/challenges/chinese/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4ac.md @@ -0,0 +1,53 @@ +--- +id: 66c8ba975ee7230e29f6c4ac +title: Step 2 +challengeType: 1 +dashedName: step-2 +--- + +# --description-- + +When the user is eligible for a loan, you'll want to display a message to them in the console. + +For that, you'll build out a function inside which you'll have some checks that'll return what loan the applicant is eligible for. + +Create an empty `getLoanMessage` function with an `annualIncome` and `creditScore` parameters. + +# --hints-- + +You should create a `getLoanMessage` function + +```js +assert.isFunction(getLoanMessage) +``` + +Your `getLoanMessage` function should have an `annualIncome` and `creditScore` as parameters. + +```js +assert.match(getLoanMessage?.toString(), /\(\s*annualIncome,\s*creditScore\s*\)|\(\s*creditScore,\s*annualIncome\s*\)/); +``` + +`getLoanMessage` should be an empty function. + +```js +assert.match(getLoanMessage?.toString(), /\{\s*\}/); +``` + +# --seed-- + +## --seed-contents-- + +```js +const minIncomeForDuplex = 60000; +const minCreditScoreForDuplex = 700; + +const minIncomeForCondo = 45000; +const minCreditScoreForCondo = 680; + +const minIncomeForCar = 30000; +const minCreditScoreForCar = 650; + +--fcc-editable-region-- + +--fcc-editable-region-- +``` diff --git a/curriculum/challenges/chinese/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4ad.md b/curriculum/challenges/chinese/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4ad.md new file mode 100644 index 0000000000..82a29d7cd9 --- /dev/null +++ b/curriculum/challenges/chinese/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4ad.md @@ -0,0 +1,55 @@ +--- +id: 66c8ba975ee7230e29f6c4ad +title: Step 3 +challengeType: 1 +dashedName: step-3 +--- + +# --description-- + +To check which loan a user is qualified for based on the `annualIncome` and `creditScore`, you have to use `if/else if` statement or a ternary right inside the `getLoanMessage` function. You'll then return the appropraite message in the block of each condition. + +Starting with the duplex loan, check if `annualIncome` is greater than or equal to `minIncomeForDuplex` AND if `creditScore` is greater than `minCreditScoreForDuplex`. + +If that condition is true, then the applicant is eligible for a duplex loan and the other loans. So, inside the check, return the string `"You qualify for a car, duplex and Condo loan."` + +# --hints-- + +Your `getLoanMessage` function should return a string. + +```js +assert.isString(getLoanMessage(65000, 750)); +``` + +Your `getLoanMessage` function should return the string `"You qualify for a duplex, condo, and car loan."`. + +```js +assert.strictEqual(getLoanMessage(65000, 750), "You qualify for a duplex, condo, and car loan."); +``` + +Your `getLoanMessage` function should return `undefined` if the applicant's annual income and credit score do not meet the requirements for a duplex loan. + +```js +assert.strictEqual(getLoanMessage(59000, 700), undefined); +``` + +# --seed-- + +## --seed-contents-- + +```js +const minIncomeForDuplex = 60000; +const minCreditScoreForDuplex = 700; + +const minIncomeForCondo = 45000; +const minCreditScoreForCondo = 680; + +const minIncomeForCar = 30000; +const minCreditScoreForCar = 650; + +--fcc-editable-region-- +function getLoanMessage(annualIncome, creditScore) { + +} +--fcc-editable-region-- +``` diff --git a/curriculum/challenges/chinese/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4af.md b/curriculum/challenges/chinese/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4af.md new file mode 100644 index 0000000000..638e6291a4 --- /dev/null +++ b/curriculum/challenges/chinese/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4af.md @@ -0,0 +1,56 @@ +--- +id: 66c8ba975ee7230e29f6c4af +title: Step 4 +challengeType: 1 +dashedName: step-4 +--- + +# --description-- + +If the applicant's annual income is greater than or equal to `minIncomeForCondo`, AND if their credit score is greater than or equal to `minCreditScoreForCondo`, then they qualify for a condo and car loan. + +Check if that's true in the `getLoanMessage` function. If it is, return the string `"You qualify for a condo and car loan."` + +# --hints-- + +Your `getLoanMessage` function should return a string if the applicant qualifies for a condo and car loan. + +```js +assert.isString(getLoanMessage(45000, 680)); +``` + +Your `getLoanMessage` function should return the string `"You qualify for a condo and car loan."`. + +```js +assert.strictEqual(getLoanMessage(45000, 680), "You qualify for a condo and car loan."); +``` + +Your `getLoanMessage` function should return `undefined` if the applicant's annual income and credit score do not meet the requirements for a condo loan. + +```js +assert.strictEqual(getLoanMessage(45000, 650), undefined); +``` + +# --seed-- + +## --seed-contents-- + +```js +const minIncomeForDuplex = 60000; +const minCreditScoreForDuplex = 700; + +const minIncomeForCondo = 45000; +const minCreditScoreForCondo = 680; + +const minIncomeForCar = 30000; +const minCreditScoreForCar = 650; + +function getLoanMessage(annualIncome, creditScore) { + if(creditScore >= minCreditScoreForDuplex && annualIncome >= minIncomeForDuplex) { + return "You qualify for a duplex, condo, and car loan." +--fcc-editable-region-- + } + +--fcc-editable-region-- +} +``` diff --git a/curriculum/challenges/chinese/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b0.md b/curriculum/challenges/chinese/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b0.md new file mode 100644 index 0000000000..374ba7b8fe --- /dev/null +++ b/curriculum/challenges/chinese/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b0.md @@ -0,0 +1,56 @@ +--- +id: 66c8ba975ee7230e29f6c4b0 +title: Step 5 +challengeType: 1 +dashedName: step-5 +--- + +# --description-- + +Now, you should check if the applicant is qualified for a car loan only. If they're, return the string `"You qualify for a car loan."`. + +# --hints-- + +Your `getLoanMessage` function should return a string if the applicant qualifies for a car loan. + +```js +assert.isString(getLoanMessage(30000, 650)); +``` + +Your `getLoanMessage` function should return the string `"You qualify for a car loan."`. + +```js +assert.strictEqual(getLoanMessage(30000, 650), "You qualify for a car loan."); +``` + +Your `getLoanMessage` function should return `undefined` if the applicant's annual income and credit score do not meet the requirements for a car loan. + +```js +assert.strictEqual(getLoanMessage(30000, 600), undefined); +``` + +# --seed-- + +## --seed-contents-- + +```js +const minIncomeForDuplex = 60000; +const minCreditScoreForDuplex = 700; + +const minIncomeForCondo = 45000; +const minCreditScoreForCondo = 680; + +const minIncomeForCar = 30000; +const minCreditScoreForCar = 650; + +function getLoanMessage(annualIncome, creditScore) { + if(creditScore >= minCreditScoreForDuplex && annualIncome >= minIncomeForDuplex) { + return "You qualify for a duplex, condo, and car loan." + } else if (annualIncome >= minIncomeForCondo && creditScore >= minCreditScoreForCondo) { + return "You qualify for a condo and car loan." +--fcc-editable-region-- + } + +--fcc-editable-region-- +} +``` diff --git a/curriculum/challenges/chinese/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b1.md b/curriculum/challenges/chinese/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b1.md new file mode 100644 index 0000000000..16e8c7baca --- /dev/null +++ b/curriculum/challenges/chinese/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b1.md @@ -0,0 +1,54 @@ +--- +id: 66c8ba975ee7230e29f6c4b1 +title: Step 6 +challengeType: 1 +dashedName: step-6 +--- + +# --description-- + +If the applicant's annual income and credit score fall below `minIncomeForCar` and `minCreditScoreForCar`, then they don't qualify for any loan. So, return the string `"You don't qualify for any loans."` + +# --hints-- + +Your `getLoanMessage` function should return a string if the applicant doesn't qualify for any loan. + +```js +assert.isString(getLoanMessage(25000, 550)); +``` + +Your `getLoanMessage` function should return the string `"You don't qualify for any loans."` if the applicant does not meet the requirements for any loan. + +```js +assert.strictEqual(getLoanMessage(15000, 600), "You don't qualify for any loans."); +assert.strictEqual(getLoanMessage(25000, 550), "You don't qualify for any loans."); +assert.strictEqual(getLoanMessage(20000, 500), "You don't qualify for any loans."); +``` + +# --seed-- + +## --seed-contents-- + +```js +const minIncomeForDuplex = 60000; +const minCreditScoreForDuplex = 700; + +const minIncomeForCondo = 45000; +const minCreditScoreForCondo = 680; + +const minIncomeForCar = 30000; +const minCreditScoreForCar = 650; + +function getLoanMessage(annualIncome, creditScore) { + if(creditScore >= minCreditScoreForDuplex && annualIncome >= minIncomeForDuplex) { + return "You qualify for a duplex, condo, and car loan." + } else if (annualIncome >= minIncomeForCondo && creditScore >= minCreditScoreForCondo) { + return "You qualify for a condo and car loan." + } else if (annualIncome >= minIncomeForCar && creditScore >= minCreditScoreForCar) { + return "You qualify for a car loan." +--fcc-editable-region-- + } + +--fcc-editable-region-- +} +``` diff --git a/curriculum/challenges/chinese/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b2.md b/curriculum/challenges/chinese/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b2.md new file mode 100644 index 0000000000..9d19f9ea4c --- /dev/null +++ b/curriculum/challenges/chinese/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b2.md @@ -0,0 +1,165 @@ +--- +id: 66c8ba975ee7230e29f6c4b2 +title: Step 7 +challengeType: 1 +dashedName: step-7 +--- + +# --description-- + +Now, it is time to test out your `getLoanMessage` function. + +Use the table below to create `4` variables and their values: + +| Variable Name | Value | +| --------------- | ---------------------------- | +| `duplexLoanMsg` | `getLoanMessage(85000, 850)` | +| `condoLoanMsg` | `getLoanMessage(65000, 690)` | +| `carLoanMsg` | `getLoanMessage(45000, 660)` | +| `noLoanMsg` | `getLoanMessage(25000, 550)` | + +After that, log each variable to the console to see the messages. + +With that, your loan qualification checker project is complete! + +# --hints-- + +You should have a variable called `duplexLoanMsg`. + +```js +assert.isNotNull(duplexLoanMsg); +``` + +Your `duplexLoanMsg` variable should be set to the result of `getLoanMessage(85000, 850)`. + +```js +assert.equal(duplexLoanMsg, getLoanMessage(85000, 850)); +``` + +You should log the `duplexLoanMsg` variable to the console. + +```js +assert.match(code, /console\.log\(duplexLoanMsg\)/) +``` + +You should have a variable called `condoLoanMsg`. + +```js +assert.isNotNull(condoLoanMsg); +``` + +Your `condoLoanMsg` variable should be set to the result of `getLoanMessage(65000, 690)`. + +```js +assert.equal(condoLoanMsg, getLoanMessage(65000, 690)); +``` + +You should log the `condoLoanMsg` variable to the console. + +```js +assert.match(code, /console\.log\(condoLoanMsg\)/) +``` + +You should have a variable called `carLoanMsg`. + +```js +assert.isNotNull(carLoanMsg); +``` + +Your `carLoanMsg` variable should be set to the result of `getLoanMessage(45000, 660)`. + +```js +assert.equal(carLoanMsg, getLoanMessage(45000, 660)); +``` + +You should log the `carLoanMsg` variable to the console. + +```js +assert.match(code, /console\.log\(carLoanMsg\)/) +``` + +You should have a variable called `noLoanMsg`. + +```js +assert.isNotNull(noLoanMsg); +``` + +Your `noLoanMsg` variable should be set to the result of `getLoanMessage(25000, 550)`. + +```js +assert.equal(noLoanMsg, getLoanMessage(25000, 550)); +``` + +You should log the `noLoanMsg` variable to the console. + +```js +assert.match(code, /console\.log\(noLoanMsg\)/) +``` + +# --seed-- + +## --seed-contents-- + +```js +const minIncomeForDuplex = 60000; +const minCreditScoreForDuplex = 700; + +const minIncomeForCondo = 45000; +const minCreditScoreForCondo = 680; + +const minIncomeForCar = 30000; +const minCreditScoreForCar = 650; + +function getLoanMessage(annualIncome, creditScore) { + if(creditScore >= minCreditScoreForDuplex && annualIncome >= minIncomeForDuplex) { + return "You qualify for a duplex, condo, and car loan." + } else if (annualIncome >= minIncomeForCondo && creditScore >= minCreditScoreForCondo) { + return "You qualify for a condo and car loan." + } else if (annualIncome >= minIncomeForCar && creditScore >= minCreditScoreForCar) { + return "You qualify for a car loan." + } else { + return "You don't qualify for any loans." + } +} + +--fcc-editable-region-- + +--fcc-editable-region-- +``` + +# --solutions-- + +```js +const minIncomeForDuplex = 60000; +const minCreditScoreForDuplex = 700; + +const minIncomeForCondo = 45000; +const minCreditScoreForCondo = 680; + +const minIncomeForCar = 30000; +const minCreditScoreForCar = 650; + +function getLoanMessage(annualIncome, creditScore) { + if(creditScore >= minCreditScoreForDuplex && annualIncome >= minIncomeForDuplex) { + return "You qualify for a duplex, condo, and car loan." + } else if (annualIncome >= minIncomeForCondo && creditScore >= minCreditScoreForCondo) { + return "You qualify for a condo and car loan." + } else if (annualIncome >= minIncomeForCar && creditScore >= minCreditScoreForCar) { + return "You qualify for a car loan." + } else { + return "You don't qualify for any loans." + } +} + +const duplexLoanMsg = getLoanMessage(85000, 850) +console.log(duplexLoanMsg) + +const condoLoanMsg = getLoanMessage(65000, 690) +console.log(condoLoanMsg) + +const carLoanMsg = getLoanMessage(45000, 660) +console.log(carLoanMsg) + +const noLoanMsg = getLoanMessage(25000, 550) +console.log(noLoanMsg) +``` diff --git a/curriculum/challenges/chinese/25-front-end-development/workshop-mario-database/5f2c289f164c29556da632fd.md b/curriculum/challenges/chinese/25-front-end-development/workshop-mario-database/5f2c289f164c29556da632fd.md new file mode 100644 index 0000000000..4e11751ca0 --- /dev/null +++ b/curriculum/challenges/chinese/25-front-end-development/workshop-mario-database/5f2c289f164c29556da632fd.md @@ -0,0 +1,19 @@ +--- +id: 5f2c289f164c29556da632fd +title: Build a Mario Database +challengeType: 12 +url: freeCodeCamp/learn-relational-databases-by-building-a-mario-database +dashedName: build-a-mario-database +--- + +# --description-- + +In this 165-lesson workshop, you will learn the basics of a relational database by creating a PostgreSQL database filled with video game characters. + +# --instructions-- + +# --hints-- + +# --seed-- + +# --solutions-- diff --git a/curriculum/challenges/chinese/25-front-end-development/workshop-npm-packages/587d7fb3367417b2b2512bfb.md b/curriculum/challenges/chinese/25-front-end-development/workshop-npm-packages/587d7fb3367417b2b2512bfb.md new file mode 100644 index 0000000000..8d4c90410d --- /dev/null +++ b/curriculum/challenges/chinese/25-front-end-development/workshop-npm-packages/587d7fb3367417b2b2512bfb.md @@ -0,0 +1,53 @@ +--- +id: 587d7fb3367417b2b2512bfb +title: How to Use package.json, the Core of Any Node.js Project or npm Package +challengeType: 2 +forumTopicId: 301528 +dashedName: how-to-use-package-json-the-core-of-any-node-js-project-or-npm-package +--- + +# --description-- + +Working on these challenges will involve you writing your code using one of the following methods: + +- Clone this GitHub repo and complete these challenges locally. +- Use our Gitpod starter project to complete these challenges. +- Use a site builder of your choice to complete the project. Be sure to incorporate all the files from our GitHub repo. + +The `package.json` file is the center of any Node.js project or npm package. It stores information about your project. It consists of a single JSON object where information is stored in key-value pairs. There are only two required fields; `name` and `version`, but it’s good practice to provide additional information. + +You can create the `package.json` file from the terminal using the `npm init` command. This will run a guided setup. Using `npm init` with the `-y` flag will generate the file without having it ask any questions, `npm init -y`. + +If you look at the file tree of your project, you will find the `package.json` file on the top level of the tree. This is the file that you will be improving in the next couple of challenges. + +One of the most common pieces of information in this file is the `author` field. It specifies who created the project, and can consist of a string or an object with contact or other details. An object is recommended for bigger projects, but a simple string like the following example will do for this project. + +```json +"author": "Jane Doe", +``` + +# --instructions-- + +Add your name as the `author` of the project in the `package.json` file. + +**Note:** Remember that you’re writing JSON, so all field names must use double-quotes (") and be separated with a comma (,). + +If you are using Gitpod, make sure the app is running and the preview window is open. Copy the preview window's URL and paste it into the Solution Link input below. + +# --hints-- + +`package.json` should have a valid "author" key + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert(packJson.author, '"author" is missing'); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/chinese/25-front-end-development/workshop-npm-packages/587d7fb3367417b2b2512bfc.md b/curriculum/challenges/chinese/25-front-end-development/workshop-npm-packages/587d7fb3367417b2b2512bfc.md new file mode 100644 index 0000000000..37d15d5261 --- /dev/null +++ b/curriculum/challenges/chinese/25-front-end-development/workshop-npm-packages/587d7fb3367417b2b2512bfc.md @@ -0,0 +1,43 @@ +--- +id: 587d7fb3367417b2b2512bfc +title: Add a Description to Your package.json +challengeType: 2 +forumTopicId: 301522 +dashedName: add-a-description-to-your-package-json +--- + +# --description-- + +The next part of a good package.json file is the `description` field; where a short, but informative description about your project belongs. + +If some day you plan to publish a package to npm, this is the string that should sell your idea to the user when they decide whether to install your package or not. However, that’s not the only use case for the description, it’s a great way to summarize what a project does. It’s just as important in any Node.js project to help other developers, future maintainers or even your future self understand the project quickly. + +Regardless of what you plan for your project, a description is definitely recommended. Here's an example: + +```json +"description": "A project that does something awesome", +``` + +# --instructions-- + +Add a `description` to the package.json file of your project. + +**Note:** Remember to use double-quotes for field-names (") and commas (,) to separate fields. + +# --hints-- + +package.json should have a valid "description" key + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert(packJson.description, '"description" is missing'); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/chinese/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bfd.md b/curriculum/challenges/chinese/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bfd.md new file mode 100644 index 0000000000..a001cdd477 --- /dev/null +++ b/curriculum/challenges/chinese/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bfd.md @@ -0,0 +1,75 @@ +--- +id: 587d7fb4367417b2b2512bfd +title: Add Keywords to Your package.json +challengeType: 2 +forumTopicId: 301526 +dashedName: add-keywords-to-your-package-json +--- + +# --description-- + +The `keywords` field is where you can describe your project using related keywords. Here's an example: + +```json +"keywords": [ "descriptive", "related", "words" ], +``` + +As you can see, this field is structured as an array of double-quoted strings. + +# --instructions-- + +Add an array of suitable strings to the `keywords` field in the package.json file of your project. + +One of the keywords should be "freecodecamp". + +# --hints-- + +package.json should have a valid "keywords" key + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert(packJson.keywords, '"keywords" is missing'); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + +"keywords" field should be an Array + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.isArray(packJson.keywords, '"keywords" is not an array'); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + +"keywords" should include "freecodecamp" + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.include( + packJson.keywords, + 'freecodecamp', + '"keywords" does not include "freecodecamp"' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/chinese/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bfe.md b/curriculum/challenges/chinese/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bfe.md new file mode 100644 index 0000000000..7b09acd042 --- /dev/null +++ b/curriculum/challenges/chinese/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bfe.md @@ -0,0 +1,39 @@ +--- +id: 587d7fb4367417b2b2512bfe +title: Add a License to Your package.json +challengeType: 2 +forumTopicId: 301523 +dashedName: add-a-license-to-your-package-json +--- + +# --description-- + +The `license` field is where you inform users of what they are allowed to do with your project. + +Some common licenses for open source projects include MIT and BSD. License information is not required, and copyright laws in most countries will give you ownership of what you create by default. However, it’s always a good practice to explicitly state what users can and can’t do. Here's an example of the license field: + +```json +"license": "MIT", +``` + +# --instructions-- + +Fill the `license` field in the package.json file of your project as you find suitable. + +# --hints-- + +package.json should have a valid "license" key + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert(packJson.license, '"license" is missing'); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/chinese/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bff.md b/curriculum/challenges/chinese/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bff.md new file mode 100644 index 0000000000..f2e571faed --- /dev/null +++ b/curriculum/challenges/chinese/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bff.md @@ -0,0 +1,37 @@ +--- +id: 587d7fb4367417b2b2512bff +title: Add a Version to Your package.json +challengeType: 2 +forumTopicId: 301525 +dashedName: add-a-version-to-your-package-json +--- + +# --description-- + +A `version` is one of the required fields of your package.json file. This field describes the current version of your project. Here's an example: + +```json +"version": "1.2.0", +``` + +# --instructions-- + +Add a `version` to the package.json file of your project. + +# --hints-- + +package.json should have a valid "version" key + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert(packJson.version, '"version" is missing'); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/chinese/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512c00.md b/curriculum/challenges/chinese/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512c00.md new file mode 100644 index 0000000000..161c60fe69 --- /dev/null +++ b/curriculum/challenges/chinese/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512c00.md @@ -0,0 +1,68 @@ +--- +id: 587d7fb4367417b2b2512c00 +title: Expand Your Project with External Packages from npm +challengeType: 2 +forumTopicId: 301527 +dashedName: expand-your-project-with-external-packages-from-npm +--- + +# --description-- + +One of the biggest reasons to use a package manager, is their powerful dependency management. Instead of manually having to make sure that you get all dependencies whenever you set up a project on a new computer, npm automatically installs everything for you. But how can npm know exactly what your project needs? Meet the `dependencies` section of your package.json file. + +In this section, packages your project requires are stored using the following format: + +```json +"dependencies": { + "package-name": "version", + "express": "4.14.0" +} + +``` + +# --instructions-- + +Add version `1.1.0` of the `@freecodecamp/example` package to the `dependencies` field of your `package.json` file. + +**Note:** `@freecodecamp/example` is a faux package used as a learning tool. + +# --hints-- + +`"dependencies"` should include `"@freecodecamp/example"`. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.property( + packJson.dependencies, + '@freecodecamp/example', + '"dependencies" does not include "@freecodecamp/example"' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + +`"@freecodecamp/example"` version should be `"1.1.0"`. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.match( + packJson.dependencies["@freecodecamp/example"], + /^[\^\~]?1\.1\.0/, + 'Wrong version of "@freecodecamp/example" installed. It should be 1.1.0' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/chinese/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c01.md b/curriculum/challenges/chinese/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c01.md new file mode 100644 index 0000000000..deda9b82de --- /dev/null +++ b/curriculum/challenges/chinese/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c01.md @@ -0,0 +1,64 @@ +--- +id: 587d7fb5367417b2b2512c01 +title: Manage npm Dependencies By Understanding Semantic Versioning +challengeType: 2 +forumTopicId: 301529 +dashedName: manage-npm-dependencies-by-understanding-semantic-versioning +--- + +# --description-- + +`Versions` of the npm packages in the dependencies section of your package.json file follow what’s called Semantic Versioning (SemVer), an industry standard for software versioning aiming to make it easier to manage dependencies. Libraries, frameworks or other tools published on npm should use SemVer in order to clearly communicate what kind of changes projects can expect if they update. + +Knowing SemVer can be useful when you develop software that uses external dependencies (which you almost always do). One day, your understanding of these numbers will save you from accidentally introducing breaking changes to your project without understanding why things that worked yesterday suddenly don’t work today. This is how Semantic Versioning works according to the official website: + +```json +"package": "MAJOR.MINOR.PATCH" +``` + +The MAJOR version should increment when you make incompatible API changes. The MINOR version should increment when you add functionality in a backwards-compatible manner. The PATCH version should increment when you make backwards-compatible bug fixes. This means that PATCHes are bug fixes and MINORs add new features but neither of them break what worked before. Finally, MAJORs add changes that won’t work with earlier versions. + +# --instructions-- + +In the dependencies section of your `package.json` file, change the version of `@freecodecamp/example` to match MAJOR version 1, MINOR version 2 and PATCH version 13 + +# --hints-- + +`"dependencies"` should include `"@freecodecamp/example"`. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.property( + packJson.dependencies, + '@freecodecamp/example', + '"dependencies" does not include "@freecodecamp/example"' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + +`"@freecodecamp/example"` version should be `"1.2.13"`. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.equal( + packJson.dependencies["@freecodecamp/example"], + '1.2.13', + 'Wrong version of "@freecodecamp/example". It should be 1.2.13' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/chinese/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c02.md b/curriculum/challenges/chinese/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c02.md new file mode 100644 index 0000000000..8eae5f51ee --- /dev/null +++ b/curriculum/challenges/chinese/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c02.md @@ -0,0 +1,66 @@ +--- +id: 587d7fb5367417b2b2512c02 +title: Use the Tilde-Character to Always Use the Latest Patch Version of a Dependency +challengeType: 2 +forumTopicId: 301532 +dashedName: use-the-tilde-character-to-always-use-the-latest-patch-version-of-a-dependency +--- + +# --description-- + +In the last challenge, you told npm to only include a specific version of a package. That’s a useful way to freeze your dependencies if you need to make sure that different parts of your project stay compatible with each other. But in most use cases, you don’t want to miss bug fixes since they often include important security patches and (hopefully) don’t break things in doing so. + +To allow an npm dependency to update to the latest PATCH version, you can prefix the dependency’s version with the tilde (`~`) character. Here's an example of how to allow updates to any `1.3.x` version. + +```json +"package": "~1.3.8" +``` + +# --instructions-- + +In the package.json file, your current rule for how npm may upgrade `@freecodecamp/example` is to use a specific version (`1.2.13`). But now, you want to allow the latest `1.2.x` version. + +Use the tilde (`~`) character to prefix the version of `@freecodecamp/example` in your dependencies, and allow npm to update it to any new _patch_ release. + +**Note:** The version numbers themselves should not be changed. + +# --hints-- + +`"dependencies"` should include `"@freecodecamp/example"`. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.property( + packJson.dependencies, + '@freecodecamp/example', + '"dependencies" does not include "@freecodecamp/example"' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + +`"@freecodecamp/example"` version should match `"~1.2.13"`. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.match( + packJson.dependencies["@freecodecamp/example"], + /^\~1\.2\.13/, + 'Wrong version of "@freecodecamp/example". It should be ~1.2.13' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/chinese/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c03.md b/curriculum/challenges/chinese/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c03.md new file mode 100644 index 0000000000..adc3014ea4 --- /dev/null +++ b/curriculum/challenges/chinese/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c03.md @@ -0,0 +1,66 @@ +--- +id: 587d7fb5367417b2b2512c03 +title: Use the Caret-Character to Use the Latest Minor Version of a Dependency +challengeType: 2 +forumTopicId: 301531 +dashedName: use-the-caret-character-to-use-the-latest-minor-version-of-a-dependency +--- + +# --description-- + +Similar to how the tilde we learned about in the last challenge allows npm to install the latest PATCH for a dependency, the caret (`^`) allows npm to install future updates as well. The difference is that the caret will allow both MINOR updates and PATCHes. + +Your current version of `@freecodecamp/example` should be `~1.2.13` which allows npm to install to the latest `1.2.x` version. If you were to use the caret (^) as a version prefix instead, npm would be allowed to update to any `1.x.x` version. + +```json +"package": "^1.3.8" +``` + +This would allow updates to any `1.x.x` version of the package. + +# --instructions-- + +Use the caret (`^`) to prefix the version of `@freecodecamp/example` in your dependencies and allow npm to update it to any new MINOR release. + +**Note:** The version numbers themselves should not be changed. + +# --hints-- + +`"dependencies"` should include `"@freecodecamp/example"`. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.property( + packJson.dependencies, + '@freecodecamp/example', + '"dependencies" does not include "@freecodecamp/example"' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + +`"@freecodecamp/example"` version should match `"^1.x.x"`. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.match( + packJson.dependencies["@freecodecamp/example"], + /^\^1\./, + 'Wrong version of "@freecodecamp/example". It should be ^1.2.13' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/chinese/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c04.md b/curriculum/challenges/chinese/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c04.md new file mode 100644 index 0000000000..5f695eed88 --- /dev/null +++ b/curriculum/challenges/chinese/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c04.md @@ -0,0 +1,43 @@ +--- +id: 587d7fb5367417b2b2512c04 +title: Remove a Package from Your Dependencies +challengeType: 2 +forumTopicId: 301530 +dashedName: remove-a-package-from-your-dependencies +--- + +# --description-- + +You have now tested a few ways you can manage dependencies of your project by using the package.json's dependencies section. You have also included external packages by adding them to the file and even told npm what types of versions you want, by using special characters such as the tilde or the caret. + +But what if you want to remove an external package that you no longer need? You might already have guessed it, just remove the corresponding key-value pair for that package from your dependencies. + +This same method applies to removing other fields in your package.json as well. + +# --instructions-- + +Remove the `@freecodecamp/example` package from your dependencies. + +**Note:** Make sure you have the right amount of commas after removing it. + +# --hints-- + +`"dependencies"` should not include `"@freecodecamp/example"`. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.notProperty( + packJson.dependencies, + '@freecodecamp/example', + '"dependencies" still includes "@freecodecamp/example"' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/espanol/01-responsive-web-design/applied-accessibility/improve-accessibility-of-audio-content-with-the-audio-element.md b/curriculum/challenges/espanol/01-responsive-web-design/applied-accessibility/improve-accessibility-of-audio-content-with-the-audio-element.md index 7a0ea4c642..7415ec18cf 100644 --- a/curriculum/challenges/espanol/01-responsive-web-design/applied-accessibility/improve-accessibility-of-audio-content-with-the-audio-element.md +++ b/curriculum/challenges/espanol/01-responsive-web-design/applied-accessibility/improve-accessibility-of-audio-content-with-the-audio-element.md @@ -26,7 +26,7 @@ Acá tenemos un ejemplo: # --instructions-- -Es hora de salir del Camper Cat y conocer a nuestro compañero Zersiax (@zersiax), un campeón en accesibilidad y un usuario de lector de pantalla. Para escuchar el fragmento de audio de su lector de pantalla en acción, agregue un elemento `audio` después del elemento `p`. Incluye el atributo `controls`. Then place a `source` element inside the `audio` tags with the `src` attribute set to `https://cdn.freecodecamp.org/curriculum/applied-accessibility/screen-reader.mp3` and `type` attribute set to `"audio/mpeg"`. +Es hora de salir del Camper Cat y conocer a nuestro compañero Zersiax (@zersiax), un campeón en accesibilidad y un usuario de lector de pantalla. Para escuchar el fragmento de audio de su lector de pantalla en acción, agregue un elemento `audio` después del elemento `p`. Incluye el atributo `controls`. Luego ubica un elemento `source` dentro del `audio` etiquetado con el atributo `src` asignado a `https://cdn.freecodecamp.org/curriculum/applied-accessibility/screen-reader.mp3` y el atributo`type` asignado a `"audio/mpeg"`. **Note:** El clip del audio puede sonar rápido y quizás sea difícil de entender pero esta velocidad es normal para los lectores de pantalla. diff --git a/curriculum/challenges/espanol/01-responsive-web-design/applied-visual-design/create-movement-using-css-animation.md b/curriculum/challenges/espanol/01-responsive-web-design/applied-visual-design/create-movement-using-css-animation.md index 65baac7481..e0a552c79e 100644 --- a/curriculum/challenges/espanol/01-responsive-web-design/applied-visual-design/create-movement-using-css-animation.md +++ b/curriculum/challenges/espanol/01-responsive-web-design/applied-visual-design/create-movement-using-css-animation.md @@ -1,6 +1,6 @@ --- id: 587d78a7367417b2b2512ae1 -title: Crear movimiento usando animación CSS +title: Crea movimiento usando animación CSS challengeType: 0 videoUrl: 'https://scrimba.com/c/c7amZfW' forumTopicId: 301051 diff --git a/curriculum/challenges/espanol/01-responsive-web-design/applied-visual-design/create-visual-direction-by-fading-an-element-from-left-to-right.md b/curriculum/challenges/espanol/01-responsive-web-design/applied-visual-design/create-visual-direction-by-fading-an-element-from-left-to-right.md index 0e0569db6b..0d4bbb5b04 100644 --- a/curriculum/challenges/espanol/01-responsive-web-design/applied-visual-design/create-visual-direction-by-fading-an-element-from-left-to-right.md +++ b/curriculum/challenges/espanol/01-responsive-web-design/applied-visual-design/create-visual-direction-by-fading-an-element-from-left-to-right.md @@ -1,6 +1,6 @@ --- id: 587d78a7367417b2b2512ae2 -title: Crear dirección visual desvaneciendo un elemento de izquierda a derecha +title: Crea dirección visual desvaneciendo un elemento de izquierda a derecha challengeType: 0 videoUrl: 'https://scrimba.com/c/cGJqqAE' forumTopicId: 301054 diff --git a/curriculum/challenges/espanol/01-responsive-web-design/basic-css/style-the-html-body-element.md b/curriculum/challenges/espanol/01-responsive-web-design/basic-css/style-the-html-body-element.md index 7ba0b2122f..84b47af2f1 100644 --- a/curriculum/challenges/espanol/01-responsive-web-design/basic-css/style-the-html-body-element.md +++ b/curriculum/challenges/espanol/01-responsive-web-design/basic-css/style-the-html-body-element.md @@ -41,7 +41,7 @@ assert( ); ``` -Your CSS rule should end with a semicolon. +La regla de CSS debe terminar con un punto y coma. ```js assert( diff --git a/curriculum/challenges/espanol/01-responsive-web-design/css-grid/add-columns-with-grid-template-columns.md b/curriculum/challenges/espanol/01-responsive-web-design/css-grid/add-columns-with-grid-template-columns.md index 8632af7175..dd27bb97f8 100644 --- a/curriculum/challenges/espanol/01-responsive-web-design/css-grid/add-columns-with-grid-template-columns.md +++ b/curriculum/challenges/espanol/01-responsive-web-design/css-grid/add-columns-with-grid-template-columns.md @@ -9,7 +9,7 @@ dashedName: add-columns-with-grid-template-columns # --description-- -Crear un simple elemento cuadrícula (grid) no te llevará muy lejos. Necesitas también definir su estructura. Para agregar columnas a la cuadrícula, usa la propiedad `grid-template-columns` en el contenedor de la cuadrícula como se demuestra a continuación: +Crea un simple elemento cuadrícula (grid) no te llevará muy lejos. Necesitas también definir su estructura. Para agregar columnas a la cuadrícula, usa la propiedad `grid-template-columns` en el contenedor de la cuadrícula como se demuestra a continuación: ```css .container { diff --git a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/basic-javascript/record-collection.md b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/basic-javascript/record-collection.md index 4a2b16f90f..809137b62c 100644 --- a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/basic-javascript/record-collection.md +++ b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/basic-javascript/record-collection.md @@ -22,8 +22,8 @@ Completa la función utilizando las reglas siguientes para modificar el objeto p - Tu función debe devolver siempre el objeto `records` completo. - Si `value` es una cadena vacía, elimina la propiedad `prop` dada del álbum. - Si `prop` no es `tracks` y `value` no es una cadena vacía, asigna el `value` a la `prop` de ese álbum. -- If `prop` is `tracks` and `value` isn't an empty string, but the album doesn't have a `tracks` property, create an empty array and add `value` to it. -- If prop is `tracks` and `value` isn't an empty string, add `value` to the end of the album's existing `tracks` array. +- Si `prop` es `tracks` y `value` no es una cadena de carácteres vacía, pero el álbum no tiene una propiedad `tracks`, crea un arreglo vacío y agregalo `value` a él. +- Si la propiedad es `tracks` y `value` no es una cadena de caracteres vacía, agregalo `value` al final del arreglo existente `tracks` del álbum. **Nota:** Para las pruebas se utiliza una copia del objeto `recordCollection`. No debes modificar directamente el objeto `recordCollection`. diff --git a/curriculum/challenges/espanol/04-data-visualization/data-visualization-projects/visualize-data-with-a-scatterplot-graph.md b/curriculum/challenges/espanol/04-data-visualization/data-visualization-projects/visualize-data-with-a-scatterplot-graph.md index 5beac2ba93..aca2e9d070 100644 --- a/curriculum/challenges/espanol/04-data-visualization/data-visualization-projects/visualize-data-with-a-scatterplot-graph.md +++ b/curriculum/challenges/espanol/04-data-visualization/data-visualization-projects/visualize-data-with-a-scatterplot-graph.md @@ -12,7 +12,7 @@ dashedName: visualize-data-with-a-scatterplot-graph Completa las historias de usuario a continuación y obtén todas las pruebas para aprobar. Utiliza cualquier librería o API que necesites. Dale tu propio estilo. -Puedes utilizar HTML, JavaScript, CSS y la librería D3 de visualización basada en svg. Las pruebas requieren que los ejes se generen utilizando la propiedad de eje D3, que genera automáticamente marcas a lo largo del eje. Estas marcas son necesarias para pasar las pruebas de D3, ya que sus posiciones se utilizan para determinar el alineamiento de los elementos gráficos. You will find information about generating axes at . Los elementos DOM necesarios se consultan en el momento de cada prueba. Si usas un framework frontend (como por ejemplo Vue), los resultados de la prueba pueden ser inexactos para el contenido dinámico. Esperamos poder adaptarlos eventualmente, pero por ahora estos frameworks no son soportados por los proyectos con D3. +Puedes utilizar HTML, JavaScript, CSS y la librería D3 de visualización basada en svg. Las pruebas requieren que los ejes se generen utilizando la propiedad de eje D3, que genera automáticamente marcas a lo largo del eje. Estas marcas son necesarias para pasar las pruebas de D3, ya que sus posiciones se utilizan para determinar el alineamiento de los elementos gráficos. Encontrarás información sobre la generación de ejes en . Los elementos DOM necesarios se consultan en el momento de cada prueba. Si usas un framework frontend (como por ejemplo Vue), los resultados de la prueba pueden ser inexactos para el contenido dinámico. Esperamos poder adaptarlos eventualmente, pero por ahora estos frameworks no son soportados por los proyectos con D3. **Historia de usuario #1:** Puedo ver un elemento titular que tiene un `id="title"`. diff --git a/curriculum/challenges/espanol/06-quality-assurance/advanced-node-and-express/serialization-of-a-user-object.md b/curriculum/challenges/espanol/06-quality-assurance/advanced-node-and-express/serialization-of-a-user-object.md index 450a519061..5d67bab988 100644 --- a/curriculum/challenges/espanol/06-quality-assurance/advanced-node-and-express/serialization-of-a-user-object.md +++ b/curriculum/challenges/espanol/06-quality-assurance/advanced-node-and-express/serialization-of-a-user-object.md @@ -8,7 +8,7 @@ dashedName: serialization-of-a-user-object # --description-- -Serialization and deserialization are important concepts in regard to authentication. Para serializar un objeto significa convertir su contenido en una pequeña *key* que puede ser deserializada en el objeto original. Esto es lo que nos permite saber quién se ha comunicado con el servidor sin tener que enviar los datos de autentificación, como el nombre de usuario y la contraseña, en cada petición de una nueva página. +La serialización y deserialización son conceptos importantes en lo que respecta a la autenticación. Para serializar un objeto significa convertir su contenido en una pequeña *key* que puede ser deserializada en el objeto original. Esto es lo que nos permite saber quién se ha comunicado con el servidor sin tener que enviar los datos de autentificación, como el nombre de usuario y la contraseña, en cada petición de una nueva página. Para configurar esto apropiadamente, necesita tener una función serializada y una función deserialización. En Passport, esto puede ser creado con: diff --git a/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/assert-deep-equality-with-.deepequal-and-.notdeepequal.md b/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/assert-deep-equality-with-.deepequal-and-.notdeepequal.md index 77576bb4ce..33f194519f 100644 --- a/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/assert-deep-equality-with-.deepequal-and-.notdeepequal.md +++ b/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/assert-deep-equality-with-.deepequal-and-.notdeepequal.md @@ -8,13 +8,13 @@ dashedName: assert-deep-equality-with--deepequal-and--notdeepequal # --description-- -As a reminder, this project is being built upon the following starter project on Gitpod or cloned from GitHub. +Como recordatorio, este proyecto se está construyendo según el siguiente proyecto inicial en Gitpod o clonando desde GitHub. `deepEqual()` confirma que dos objetos son iguales en profundidad. # --instructions-- -Within `tests/1_unit-tests.js` under the test labeled `#7` in the `Equality` suite, change each `assert` to either `assert.deepEqual` or `assert.notDeepEqual` to make the test pass (should evaluate to `true`). No modifiques los argumentos pasados ​​a los verificadores. +Dentro de `tests/1_unit-tests.js` bajo la prueba etiquetada `#7` en el conjunto de pruebas `Equality`, cambia cada `assert` a `assert.deepEqual` o `assert.notDeepEqual` para pasar la prueba (debe evaluarse como `true`). No modifiques los argumentos pasados ​​a los verificadores. # --hints-- diff --git a/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/compare-the-properties-of-two-elements.md b/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/compare-the-properties-of-two-elements.md index c27ff746ed..53a64853a8 100644 --- a/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/compare-the-properties-of-two-elements.md +++ b/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/compare-the-properties-of-two-elements.md @@ -8,11 +8,11 @@ dashedName: compare-the-properties-of-two-elements # --description-- -As a reminder, this project is being built upon the following starter project on Gitpod, or cloned from GitHub. +Como recordatorio, este proyecto se está construyendo según el siguiente proyecto inicial en Gitpod o clonando desde GitHub. # --instructions-- -Within `tests/1_unit-tests.js` under the test labeled `#8` in the `Comparisons` suite, change each `assert` to either `assert.isAbove` or `assert.isAtMost` to make the test pass (should evaluate to `true`). No modifiques los argumentos pasados ​​a los verificadores. +Dentro de `tests/1_unit-tests.js` bajo la prueba etiquetada como `#8` en el conjunto de pruebas `Comparisons`, cambiar cada `assert` a `assert.isAbove` o `assert.isAtMost` para que el test sea aprovado (debe evaluarse a `true`). No modifiques los argumentos pasados ​​a los verificadores. # --hints-- diff --git a/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/learn-how-javascript-assertions-work.md b/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/learn-how-javascript-assertions-work.md index a8a800509f..e09b28228a 100644 --- a/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/learn-how-javascript-assertions-work.md +++ b/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/learn-how-javascript-assertions-work.md @@ -11,12 +11,12 @@ dashedName: learn-how-javascript-assertions-work Trabajar en estos desafíos implica escribir tu código usando uno de los siguientes métodos: - Clone este repositorio de GitHub y complete estos desafíos localmente. -- Use our Gitpod starter project to complete these challenges. +- Utiliza nuestro proyecto inicial en Gitpod para completar estos desafíos. - Utiliza un constructor de sitios web de tu elección para completar el proyecto. Asegúrate de incorporar todos los archivos de nuestro repositorio de GitHub. # --instructions-- -Within `tests/1_unit-tests.js` under the test labeled `#1` in the `Basic Assertions` suite, change each `assert` to either `assert.isNull` or `assert.isNotNull` to make the test pass (should evaluate to `true`). No cambies los argumentos pasados a las aserciones. +Dentro de `tests/1_unit-tests.js`, bajo la prueba etiquetada como `#1` en el conjunto de prueba `Basic Assertions`, cambia cada `assert` a `assert.isNull` o `assert.isNotNull` para pasar la prueba (deber evaluarse como `true`). No cambies los argumentos pasados a las aserciones. # --hints-- diff --git a/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-on-an-api-response-using-chai-http-iii---put-method.md b/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-on-an-api-response-using-chai-http-iii---put-method.md index 2f3abb3b53..dcd5409ba0 100644 --- a/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-on-an-api-response-using-chai-http-iii---put-method.md +++ b/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-on-an-api-response-using-chai-http-iii---put-method.md @@ -8,7 +8,7 @@ dashedName: run-functional-tests-on-an-api-response-using-chai-http-iii---put-me # --description-- -As a reminder, this project is being built upon the following starter project on Gitpod, or cloned from GitHub. +Como recordatorio, este proyecto se está construyendo según el siguiente proyecto inicial en Gitpodo clonando desde GitHub. Cuando se prueba una solicitud `PUT`, a menudo enviarás datos junto con ella. Los datos que incluye con su solicitud `PUT` se llama el body de la petición. diff --git a/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-on-api-endpoints-using-chai-http.md b/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-on-api-endpoints-using-chai-http.md index 9c150351fb..3e244eb50c 100644 --- a/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-on-api-endpoints-using-chai-http.md +++ b/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-on-api-endpoints-using-chai-http.md @@ -8,7 +8,7 @@ dashedName: run-functional-tests-on-api-endpoints-using-chai-http # --description-- -As a reminder, this project is being built upon the following starter project on Gitpod, or cloned from GitHub. +Como recordatorio, este proyecto se está construyendo según el siguiente proyecto inicial en Gitpod o clonando desde GitHub. Mocha te permite comprobar operaciones asíncronas como llamadas a los endpoints de la API con un complemento llamado `chai-http`. @@ -42,13 +42,13 @@ Sin embargo, las pruebas que se ejecutan cuando envía el enlace para tu proyect # --instructions-- -Dentro de `tests/2_functional-tests.js`, altera la prueba `'Test GET /hello with no name'` (`// #1`) para afirmar el `status` y el `text` de la respuesta para hacer que la prueba pase. Do not alter the arguments passed to the asserts. +Dentro de `tests/2_functional-tests.js`, altera la prueba `'Test GET /hello with no name'` (`// #1`) para afirmar el `status` y el `text` de la respuesta para hacer que la prueba pase. No altere los argumentos pasados a las afirmaciones. -There should be no URL query. Without a name URL query, the endpoint responds with `hello Guest`. +No debe haber ninguna consulta de URL. Sin una consulta de URL de nombre, el extremo responde con `hello Guest`. # --hints-- -All tests should pass +Todas las pruebas deben pasar ```js (getUserInput) => @@ -62,7 +62,7 @@ All tests should pass ); ``` -You should test for `res.status` == 200 +Debe probar para `res.status` == 200 ```js (getUserInput) => @@ -78,7 +78,7 @@ You should test for `res.status` == 200 ); ``` -You should test for `res.text` == `'hello Guest'` +Debe probar `res.text` == `'hello Guest'` ```js (getUserInput) => diff --git a/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-using-a-headless-browser-ii.md b/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-using-a-headless-browser-ii.md index ec6bcaedfe..73caa3ce28 100644 --- a/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-using-a-headless-browser-ii.md +++ b/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-using-a-headless-browser-ii.md @@ -8,7 +8,7 @@ dashedName: run-functional-tests-using-a-headless-browser-ii # --description-- -As a reminder, this project is being built upon the following starter project on Gitpod, or cloned from GitHub. +Como recordatorio, este proyecto se está construyendo según el siguiente proyecto inicial en Gitpod o clonando desde GitHub. # --instructions-- diff --git a/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-using-a-headless-browser.md b/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-using-a-headless-browser.md index d5669decee..0829f08653 100644 --- a/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-using-a-headless-browser.md +++ b/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-using-a-headless-browser.md @@ -8,7 +8,7 @@ dashedName: run-functional-tests-using-a-headless-browser # --description-- -As a reminder, this project is being built upon the following starter project on Gitpod, or cloned from GitHub. +Como recordatorio, este proyecto se está construyendo según el siguiente proyecto inicial en Gitpod o clonando desde GitHub. En la página hay un formulario de entrada. Envía datos al endpoint `PUT /travellers` como una solicitud AJAX. diff --git a/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/test-for-truthiness.md b/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/test-for-truthiness.md index bca07b044f..f2e0ca477a 100644 --- a/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/test-for-truthiness.md +++ b/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/test-for-truthiness.md @@ -8,7 +8,7 @@ dashedName: test-for-truthiness # --description-- -As a reminder, this project is being built upon the following starter project on Gitpod, or cloned from GitHub. +Como recordatorio, este proyecto se está construyendo según el siguiente proyecto inicial en Gitpod o clonando desde GitHub. `isTrue()` probará el valor booleano `true` y `isNotTrue()` pasará cuando se le dé cualquier cosa que no sea el valor booleano de `true`. @@ -22,7 +22,7 @@ assert.isTrue(1, 'This will NOT pass with the number value 1'); # --instructions-- -Within `tests/1_unit-tests.js` under the test labeled `#4` in the `Basic Assertions` suite, change each `assert` to either `assert.isTrue` or `assert.isNotTrue` to make the test pass (should evaluate to `true`). No modifiques los argumentos pasados ​​a los verificadores. +Dentro de `tests/1_unit-tests.js` bajo la prueba etiquetada como `#4` en el conjunto de prueba `Basic Assertions`, cambia cada `assert` a `assert.isTrue` o `assert.isNotTrue` para hacer que la prueba pase (debe evaluarse como `true`). No modifiques los argumentos pasados ​​a los verificadores. # --hints-- diff --git a/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/test-if-a-value-is-an-array.md b/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/test-if-a-value-is-an-array.md index 321ae654e2..db9c8e4dc4 100644 --- a/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/test-if-a-value-is-an-array.md +++ b/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/test-if-a-value-is-an-array.md @@ -8,11 +8,11 @@ dashedName: test-if-a-value-is-an-array # --description-- -As a reminder, this project is being built upon the following starter project on Gitpod, or cloned from GitHub. +A modo de recordatorio, este proyecto se está construyendo sobre el siguiente proyecto inicial en Gitpodo clonando desde GitHub. # --instructions-- -Within `tests/1_unit-tests.js` under the test labeled `#11` in the `Arrays` suite, change each `assert` to either `assert.isArray` or `assert.isNotArray` to make the test pass (should evaluate to `true`). No modifiques los argumentos pasados ​​a los verificadores. +Dentro de `tests/1_unit-tests.js` debajo de la prueba etiquetada `#11` en el `Arrays` suite, cambia cada `assert` por cualquiera, `assert.isArray` o `assert.isNotArray` para pasar la prueba (debe evaluarse como `true`). No modifiques los argumentos pasados ​​a los verificadores. # --hints-- diff --git a/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/test-if-an-object-has-a-property.md b/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/test-if-an-object-has-a-property.md index f2c370f3ca..92e55a0df6 100644 --- a/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/test-if-an-object-has-a-property.md +++ b/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/test-if-an-object-has-a-property.md @@ -8,13 +8,13 @@ dashedName: test-if-an-object-has-a-property # --description-- -As a reminder, this project is being built upon the following starter project on Gitpod, or cloned from GitHub. +Como recordatorio, este proyecto se está construyendo según el siguiente proyecto inicial en Gitpodo clonando desde GitHub. `property` verifica que el objeto actual tiene una propiedad determinada. # --instructions-- -Within `tests/1_unit-tests.js` under the test labeled `#16` in the `Objects` suite, change each `assert` to either `assert.property` or `assert.notProperty` to make the test pass (should evaluate to `true`). No modifiques los argumentos pasados ​​a los verificadores. +Dentro de `tests/1_unit-tests.js` bajo la prueba etiquetada `#16` en la suite `Objects`, cambia cada `assert` a `assert.property` o `assert.notProperty` para pasar la prueba (debe evaluarse como `true`). No modifiques los argumentos pasados ​​a los verificadores. # --hints-- diff --git a/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/test-if-an-object-is-an-instance-of-a-constructor.md b/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/test-if-an-object-is-an-instance-of-a-constructor.md index 817e781bd6..5a418e209c 100644 --- a/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/test-if-an-object-is-an-instance-of-a-constructor.md +++ b/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/test-if-an-object-is-an-instance-of-a-constructor.md @@ -8,13 +8,13 @@ dashedName: test-if-an-object-is-an-instance-of-a-constructor # --description-- -As a reminder, this project is being built upon the following starter project on Gitpod, or cloned from GitHub. +Como recordatorio, este proyecto se está construyendo según el siguiente proyecto inicial en Gitpod, o clonando desde GitHub. `#instanceOf` verifica que un objeto es una instancia de un constructor. # --instructions-- -Within `tests/1_unit-tests.js` under the test labeled `#18` in the `Objects` suite, change each `assert` to either `assert.instanceOf` or `assert.notInstanceOf` to make the test pass (should evaluate to `true`). No modifiques los argumentos pasados ​​a los verificadores. +Dentro de `tests/1_unit-tests.js` bajo la prueba etiquetada `#18` en la suite `Objects`, cambia cada `assert` por `assert.instanceOf` o por `assert.notInstanceOf` para pasar la prueba (debe evaluarse como `true`). No modifiques los argumentos pasados ​​a los verificadores. # --hints-- diff --git a/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/test-if-one-value-is-below-or-at-least-as-large-as-another.md b/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/test-if-one-value-is-below-or-at-least-as-large-as-another.md index fd1524668e..735fb65327 100644 --- a/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/test-if-one-value-is-below-or-at-least-as-large-as-another.md +++ b/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/test-if-one-value-is-below-or-at-least-as-large-as-another.md @@ -8,7 +8,7 @@ dashedName: test-if-one-value-is-below-or-at-least-as-large-as-another # --description-- -As a reminder, this project is being built upon the following starter project on Gitpod, or cloned from GitHub. +Como recordatorio, este proyecto se está construyendo según el siguiente proyecto inicial en Gitpod o clonando desde GitHub. # --instructions-- diff --git a/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/use-assert.isok-and-assert.isnotok.md b/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/use-assert.isok-and-assert.isnotok.md index 63a02bd196..ffdbb96ae3 100644 --- a/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/use-assert.isok-and-assert.isnotok.md +++ b/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/use-assert.isok-and-assert.isnotok.md @@ -8,7 +8,7 @@ dashedName: use-assert-isok-and-assert-isnotok # --description-- -As a reminder, this project is being built upon the following starter project on Gitpod, or cloned from GitHub. +Como recordatorio, este proyecto se está construyendo según el siguiente proyecto inicial en Gitpodo clonando desde GitHub. `isOk()` prueba un valor verdadero y `isNotOk()` prueba un valor falso. @@ -16,7 +16,7 @@ Para aprender más sobre los valores verdaderos y falsos, prueba nuestro desafí # --instructions-- -Within `tests/1_unit-tests.js` under the test labeled `#3` in the `Basic Assertions` suite, change each `assert` to either `assert.isOk()` or `assert.isNotOk()` to make the test pass (should evaluate to `true`). No modifiques los argumentos pasados ​​a los verificadores. +Dentro de `tests/1_unit-tests.js` bajo la prueba etiquetada `#3` en la suite `Basic Assertions`, cambia cada `assert` a `assert.isOk()` o a `assert.isNotOk()` para hacer que la prueba pase (debe evaluarse como `true`). No modifiques los argumentos pasados ​​a los verificadores. # --hints-- diff --git a/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/use-regular-expressions-to-test-a-string.md b/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/use-regular-expressions-to-test-a-string.md index 92f156577f..ac33f0cd7e 100644 --- a/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/use-regular-expressions-to-test-a-string.md +++ b/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/use-regular-expressions-to-test-a-string.md @@ -8,13 +8,13 @@ dashedName: use-regular-expressions-to-test-a-string # --description-- -As a reminder, this project is being built upon the following starter project on Gitpod, or cloned from GitHub. +Como recordatorio, este proyecto se está construyendo según el siguiente proyecto inicial en Gitpod o clonando desde GitHub. `match()` verifica que el valor real coincide con la expresión regular del segundo argumento. # --instructions-- -Within `tests/1_unit-tests.js` under the test labeled `#15` in the `Strings` suite, change each `assert` to either `assert.match` or `assert.notMatch` to make the test pass (should evaluate to `true`). No modifiques los argumentos pasados ​​a los verificadores. +Dentro de `tests/1_unit-tests.js` bajo la prueba etiquetada `#15` en el suite `Strings`, cambia cada `assert` por `assert.match` o por `assert.notMatch` para pasar la prueba (debe evaluarse a `true`). No modifiques los argumentos pasados ​​a los verificadores. # --hints-- diff --git a/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/use-the-triple-equals-to-assert-strict-equality.md b/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/use-the-triple-equals-to-assert-strict-equality.md index a65210a4f8..dfa8e67842 100644 --- a/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/use-the-triple-equals-to-assert-strict-equality.md +++ b/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/use-the-triple-equals-to-assert-strict-equality.md @@ -8,13 +8,13 @@ dashedName: use-the-triple-equals-to-assert-strict-equality # --description-- -As a reminder, this project is being built upon the following starter project on Gitpod, or cloned from GitHub. +Como recordatorio, este proyecto se está construyendo según el siguiente proyecto inicial en Gitpod o clonando desde GitHub. `strictEqual()` compara objetos usando `===`. # --instructions-- -Within `tests/1_unit-tests.js` under the test labeled `#6` in the `Equality` suite, change each `assert` to either `assert.strictEqual` or `assert.notStrictEqual` to make the test pass (should evaluate to `true`). No modifiques los argumentos pasados ​​a los verificadores. +Dentro de `tests/1_unit-tests.js` bajo la prueba etiquetada `#6` en la suite `Equality`, cambia cada `assert` por `assert.strictEqual` o por `assert.notStrictEqual`, para pasar la prueba (debe evaluarse como `true`). No modifiques los argumentos pasados ​​a los verificadores. # --hints-- diff --git a/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-projects/american-british-translator.md b/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-projects/american-british-translator.md index 4b75b8e0c2..c6445b0016 100644 --- a/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-projects/american-british-translator.md +++ b/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-projects/american-british-translator.md @@ -11,7 +11,7 @@ dashedName: american-british-translator Crea una aplicación full stack de JavaScript que sea funcionalmente similar a esta: https://american-british-translator.freecodecamp.rocks/. Trabajar en este proyecto implicará escribir tu código utilizando uno de los siguientes métodos: - Clone este repositorio de GitHub y complete estos desafíos localmente. -- Use our Gitpod starter project to complete your project. +- Usa nuestro proyecto inicial de Gitpodpara completar tu proyecto. - Usa un constructor de sitios de tu elección para completar el proyecto. Asegúrate de incorporar todos los archivos de nuestro repositorio de GitHub. # --instructions-- @@ -20,7 +20,7 @@ Crea una aplicación full stack de JavaScript que sea funcionalmente similar a e - Completa la ruta `/api/translate` en `/routes/api.js` - Crea todo lo de las pruebas unitarias/funcionales tests en `tests/1_unit-tests.js` y `tests/2_functional-tests.js` - Consulta los archivos JavaScript en `/components` para las diferentes pronunciaciones y terminos que tu aplicación debería traducir -- To run the tests automatically, set `NODE_ENV` to `test` without quotes in the `.env` file +- Para ejecutar las pruebas automáticamente, establece `NODE_ENV` a `test` sin comillas en el `.env`archivo - Para ejecutar las pruebas en la consola, usa el comando: `npm run test`. Escribe las siguientes pruebas en `tests/1_unit-tests.js`: diff --git a/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-projects/issue-tracker.md b/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-projects/issue-tracker.md index ffe60228c5..5c2958430a 100644 --- a/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-projects/issue-tracker.md +++ b/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-projects/issue-tracker.md @@ -11,7 +11,7 @@ dashedName: issue-tracker Crea una aplicación full stack de JavaScript que sea funcionalmente similar a esta: https://issue-tracker.freecodecamp.rocks/. Trabajar en este proyecto implicará escribir tu código utilizando uno de los siguientes métodos: - Clone este repositorio de GitHub y complete estos desafíos localmente. -- Use our Gitpod starter project to complete your project. +- Utiliza nuestro proyecto inicial en Gitpod para completar tu proyecto. - Usa un constructor de sitios de tu elección para completar el proyecto. Asegúrate de incorporar todos los archivos de nuestro repositorio de GitHub. # --instructions-- @@ -19,8 +19,8 @@ Crea una aplicación full stack de JavaScript que sea funcionalmente similar a e - Complete las rutas necesarias en `/routes/api.js` - Crea todas las pruebas funcionales en `tests/2_functional-tests.js` - Copie el archivo `sample.env` a `.env` y establezca las variables apropiadamente -- To run the tests automatically, add `NODE_ENV=test` in your `.env` file -- To run the tests in the console, use the command `npm run test` +- Para ejecutar las pruebas automáticamente, añade `NODE_ENV=test` en tu archivo `.env` +- Para ejecutar las pruebas en la consola, use el comando `npm run test` Escribir las siguientes pruebas en `tests/2_functional-tests.js`: diff --git a/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-projects/metric-imperial-converter.md b/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-projects/metric-imperial-converter.md index ab8cdfeb6d..eb2d871365 100644 --- a/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-projects/metric-imperial-converter.md +++ b/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-projects/metric-imperial-converter.md @@ -11,45 +11,45 @@ dashedName: metric-imperial-converter Crea una aplicación full stack de JavaScript que sea funcionalmente similar a esta: https://metric-imperial-converter.freecodecamp.rocks/. Trabajar en este proyecto implicará escribir tu código utilizando uno de los siguientes métodos: - Clone este repositorio de GitHub y complete estos desafíos localmente. -- Use our Gitpod starter project to complete your project. +- Utiliza nuestro proyecto inicial de Gitpod para completar tu proyecto. - Usa un constructor de sitios de tu elección para completar el proyecto. Asegúrate de incorporar todos los archivos de nuestro repositorio de GitHub. -**Note:** This project's tests do not work when using `glitch.com`. +**Nota:** Las pruebas de este proyecto no funcionan cuando se usa `glitch.com`. # --instructions-- -- Complete the necessary conversion logic in `/controllers/convertHandler.js` -- Complete the necessary routes in `/routes/api.js` +- Completa la lógica de conversión necesaria en `/controllers/convertHandler.js` +- Completa las rutas necesarias en `/routes/api.js` - Copie el archivo `sample.env` a `.env` y establezca las variables apropiadamente -- To run the tests automatically, add `NODE_ENV=test` in your `.env` file +- Para ejecutar las pruebas automáticamente, añade `NODE_ENV=test` en tu archivo `.env` - Para ejecutar las pruebas en la consola, use el comando `npm run test`. -Write the following tests in `tests/1_unit-tests.js`: - -- `convertHandler` should correctly read a whole number input. -- `convertHandler` should correctly read a decimal number input. -- `convertHandler` should correctly read a fractional input. -- `convertHandler` should correctly read a fractional input with a decimal. -- `convertHandler` should correctly return an error on a double-fraction (i.e. `3/2/3`). -- `convertHandler` should correctly default to a numerical input of `1` when no numerical input is provided. -- `convertHandler` should correctly read each valid input unit. -- `convertHandler` should correctly return an error for an invalid input unit. -- `convertHandler` should return the correct return unit for each valid input unit. -- `convertHandler` should correctly return the spelled-out string unit for each valid input unit. -- `convertHandler` should correctly convert `gal` to `L`. -- `convertHandler` should correctly convert `L` to `gal`. -- `convertHandler` should correctly convert `mi` to `km`. -- `convertHandler` should correctly convert `km` to `mi`. -- `convertHandler` should correctly convert `lbs` to `kg`. -- `convertHandler` should correctly convert `kg` to `lbs`. - -Write the following tests in `tests/2_functional-tests.js`: - -- Convert a valid input such as `10L`: `GET` request to `/api/convert`. -- Convert an invalid input such as `32g`: `GET` request to `/api/convert`. -- Convert an invalid number such as `3/7.2/4kg`: `GET` request to `/api/convert`. -- Convert an invalid number AND unit such as `3/7.2/4kilomegagram`: `GET` request to `/api/convert`. -- Convert with no number such as `kg`: `GET` request to `/api/convert`. +Escribe las siguientes pruebas en `tests/1_unit-tests.js`: + +- `convertHandler` debe leer correctamente una entrada de número entero. +- `convertHandler` debe leer correctamente una entrada de número decimal. +- `convertHandler` debe leer correctamente una entrada fraccional. +- `convertHandler` debe leer correctamente una entrada fraccional con un decimal. +- `convertHandler` debe devolver correctamente un error en una fracción doble (i.e. `3/2/3`). +- `convertHandler` debe predeterminar correctamente una entrada numérica de `1` cuando no se proporciona ninguna entrada numérica. +- `convertHandler` debe leer correctamente cada unidad de las entradas válidas. +- `convertHandler` debe devolver correctamente un error por cada unidad de entrada no válida. +- `convertHandler` debe devolver la unidad de retorno correcta para cada unidad de entrada válida. +- `convertHandler` debe devolver correctamente la unidad de cadena deletreada para cada unidad de entrada válida. +- `convertHandler` debe convertir correctamente `gal` a `L`. +- `convertHandler` debe convertir correctamente `L` a `gal`. +- `convertHandler` debe convertir correctamente `mi` a `km`. +- `convertHandler` debe convertir correctamente `km` a `mi`. +- `convertHandler` debe convertir correctamente `lbs` a `kg`. +- `convertHandler` debe convertir correctamente `kg` a `lbs`. + +Escribir las siguientes pruebas en `tests/2_functional-tests.js`: + +- Convierte una entrada válida como `10L`: petición `GET` a `/api/convert`. +- Convierte una entrada inválida como `32g`: petición `GET` a `/api/convert`. +- Convierte un número inválido como `3/7.2/4kg`: petición `GET` a `/api/convert`. +- Convierte un número Y una unidad no válidos como `3/7.2/4kilomegagram`: petición `GET` a `/api/convert`. +- Convierte sin número tal como `kg`: petición `GET` a `/api/convert`. # --hints-- @@ -65,13 +65,13 @@ getUserInput => { }; ``` -You can `GET` `/api/convert` with a single parameter containing an accepted number and unit and have it converted. (Hint: Split the input by looking for the index of the first character which will mark the start of the unit) +Puedes realizar una petición `GET` `/api/convert` con un único parámetro que contenga un número y una unidad aceptados y que lo convierta. (Pista: Divide la entrada buscando el índice del primer carácter que marcará el inicio de la unidad) ```js ``` -You can convert `'gal'` to `'L'` and vice versa. (1 gal to 3.78541 L) +Puedes convertir `'gal'` a `'L'` y viceversa. (1 gal a 3.78541 L) ```js async getUserInput => { @@ -94,7 +94,7 @@ async getUserInput => { }; ``` -You can convert `'lbs'` to `'kg'` and vice versa. (1 lbs to 0.453592 kg) +Puedes convertir `'lbs'` a `'kg'` y viceversa. (1 lbs a 0.453592 kg) ```js async getUserInput => { @@ -117,7 +117,7 @@ async getUserInput => { }; ``` -You can convert `'mi'` to `'km'` and vice versa. (1 mi to 1.60934 km) +Puedes convertir `'mi'` a `'km'` y viceversa. (1 mi a 1.60934 km) ```js async getUserInput => { @@ -140,7 +140,7 @@ async getUserInput => { }; ``` -All incoming units should be accepted in both upper and lower case, but should be returned in both the `initUnit` and `returnUnit` in lower case, except for liter, which should be represented as an uppercase `'L'`. +Todas las unidades entrantes deben ser aceptadas en mayúsculas y minúsculas, pero debe ser devuelto en `initUnit` y `returnUnit` en minúsculas excepto por litro, que debe ser representado como una `'L'` mayúscula. ```js async getUserInput => { @@ -163,7 +163,7 @@ async getUserInput => { }; ``` -If the unit of measurement is invalid, returned will be `'invalid unit'`. +Si la unidad de medida no es válida, se devolverá `'invalid unit'`. ```js async getUserInput => { @@ -176,7 +176,7 @@ async getUserInput => { }; ``` -If the number is invalid, returned will be `'invalid number'`. +Si el número no es válido, devolverá `'invalid number'`. ```js async getUserInput => { @@ -191,7 +191,7 @@ async getUserInput => { }; ``` -If both the unit and number are invalid, returned will be `'invalid number and unit'`. +Si tanto la unidad como el número son inválidos, se devolverá `'invalid number and unit'`. ```js async getUserInput => { @@ -209,7 +209,7 @@ async getUserInput => { }; ``` -You can use fractions, decimals or both in the parameter (ie. 5, 1/2, 2.5/6), but if nothing is provided it will default to 1. +Puedes utilizar fracciones, decimales o ambos en el parámetro (es decir, 5, 1/2, 2.5/6), pero si no se proporciona nada, el valor predeterminado será 1. ```js async getUserInput => { @@ -240,7 +240,7 @@ async getUserInput => { }; ``` -Your return will consist of the `initNum`, `initUnit`, `returnNum`, `returnUnit`, and `string` spelling out units in the format `'{initNum} {initUnitString} converts to {returnNum} {returnUnitString}'` with the result rounded to 5 decimals. +Tu devolución consistirá en `initNum`, `initUnit`, `returnNum`, `returnUnit`, y `string` detallando unidades en el formato `'{initNum} {initUnitString} converts to {returnNum} {returnUnitString}'` con el resultado redondeado a 5 decimales. ```js async getUserInput => { @@ -257,7 +257,7 @@ async getUserInput => { }; ``` -All 16 unit tests are complete and passing. +Las 16 pruebas unitarias están completas y aprobadas. ```js async getUserInput => { @@ -282,7 +282,7 @@ async getUserInput => { }; ``` -All 5 functional tests are complete and passing. +Las 5 pruebas funcionales están completas y aprobadas. ```js async getUserInput => { diff --git a/curriculum/challenges/espanol/08-data-analysis-with-python/data-analysis-with-python-projects/medical-data-visualizer.md b/curriculum/challenges/espanol/08-data-analysis-with-python/data-analysis-with-python-projects/medical-data-visualizer.md index 10e5232fe9..decba6b2ef 100644 --- a/curriculum/challenges/espanol/08-data-analysis-with-python/data-analysis-with-python-projects/medical-data-visualizer.md +++ b/curriculum/challenges/espanol/08-data-analysis-with-python/data-analysis-with-python-projects/medical-data-visualizer.md @@ -8,7 +8,7 @@ dashedName: medical-data-visualizer # --description-- -You will be working on this project with our Gitpod starter code. +Estarás trabajando en este proyecto con nuestro código inicial en Gitpod. Todavía estamos desarrollando la parte interactiva del currículo de Python. Por ahora, aquí hay algunos vídeos en nuestro canal de YouTube freeCodeCamp.org que te enseñará todo lo que necesitas saber para completer este proyecto: @@ -18,7 +18,7 @@ Todavía estamos desarrollando la parte interactiva del currículo de Python. Po # --instructions-- -In this project, you will visualize and make calculations from medical examination data using `matplotlib`, `seaborn`, and `pandas`. Los valores del conjunto de datos (dataset) se recogieron durante los exámenes médicos. +En este proyecto, visualizarás y realizarás cálculos a partir de datos de exámenes médicos usando `matplotlib`, `seaborn` y `pandas`. Los valores del conjunto de datos (dataset) se recogieron durante los exámenes médicos. ## Descripción de datos @@ -43,7 +43,7 @@ Nombre del archivo: medical_examination.csv ## Tareas -Create a chart similar to `examples/Figure_1.png`, where we show the counts of good and bad outcomes for the `cholesterol`, `gluc`, `alco`, `active`, and `smoke` variables for patients with `cardio=1` and `cardio=0` in different panels. +Crear un gráfico similar a `examples/Figure_1.png`, donde mostramos las cifras de resultados buenos y malos para las variables `cholesterol`, `gluc`, `alco`, `active` y `smoke` en los pacientes con `cardio=1` y `cardio=0` en diferentes paneles. Utiliza los datos para completar las siguientes tareas en `medical_data_visualizer.py`: diff --git a/curriculum/challenges/espanol/08-data-analysis-with-python/data-analysis-with-python-projects/page-view-time-series-visualizer.md b/curriculum/challenges/espanol/08-data-analysis-with-python/data-analysis-with-python-projects/page-view-time-series-visualizer.md index 187d7f6946..3dd63361da 100644 --- a/curriculum/challenges/espanol/08-data-analysis-with-python/data-analysis-with-python-projects/page-view-time-series-visualizer.md +++ b/curriculum/challenges/espanol/08-data-analysis-with-python/data-analysis-with-python-projects/page-view-time-series-visualizer.md @@ -8,11 +8,11 @@ dashedName: page-view-time-series-visualizer # --description-- -You will be working on this project with our Gitpod starter code. +Estarás trabajando en este proyecto con nuestro código inicial en Gitpod. Todavía estamos desarrollando la parte interactiva del currículo de Python. Por el momento, aquí hay algunos videos en el canal de YouTube de freeCodeCamp.org que te enseñaran todo lo que necesitas saber para completar este proyecto: -- Python for Everybody Video Course (14 hours) +- Curso en Vídeo de Python para Todos (Duración: 14 horas) - How to Analyze Data with Python Pandas (10 horas) @@ -34,11 +34,11 @@ El boilerplate también incluye los comandos para guardar y devolver la imagen. ## Desarrollo -Write your code in `time_series_visualizer.py`. For development, you can use `main.py` to test your code. +Escribe tu código en `time_series_visualizer.py`. Para el desarrollo, puedes utilizar `main.py` para probar tu código. ## Pruebas -The unit tests for this project are in `test_module.py`. Hemos importado las pruebas de `test_module.py` a `main.py` para tu conveniencia. +Las pruebas unitarias para este proyecto están en `test_module.py`. Hemos importado las pruebas de `test_module.py` a `main.py` para tu conveniencia. ## Envío diff --git a/curriculum/challenges/espanol/09-information-security/information-security-projects/port-scanner.md b/curriculum/challenges/espanol/09-information-security/information-security-projects/port-scanner.md index 0dc6df49c5..b0df95899f 100644 --- a/curriculum/challenges/espanol/09-information-security/information-security-projects/port-scanner.md +++ b/curriculum/challenges/espanol/09-information-security/information-security-projects/port-scanner.md @@ -9,7 +9,7 @@ dashedName: port-scanner # --description-- -You will be working on this project with our Gitpod starter code. +Estarás trabajando en este proyecto con nuestro código inicial en Gitpod. Todavía estamos desarrollando la parte interactiva del currículo de Python. Por ahora, aquí hay algunos videos en el canal de YouTube de freeCodeCamp.org que te enseñaran todo lo que necesitas saber para completar este proyecto: diff --git a/curriculum/challenges/espanol/09-information-security/information-security-projects/secure-real-time-multiplayer-game.md b/curriculum/challenges/espanol/09-information-security/information-security-projects/secure-real-time-multiplayer-game.md index 9d2076bf17..42d0a32aac 100644 --- a/curriculum/challenges/espanol/09-information-security/information-security-projects/secure-real-time-multiplayer-game.md +++ b/curriculum/challenges/espanol/09-information-security/information-security-projects/secure-real-time-multiplayer-game.md @@ -11,7 +11,7 @@ dashedName: secure-real-time-multiplayer-game Desarrolla un juego multijugador en tiempo real en 2D utilizando HTML Canvas API y Socket.io que sea funcionalmente similar a este: https://secure-real-time-multiplayer-game.freecodecamp.rocks/. Trabajar en este proyecto implicará escribir tu código utilizando uno de los siguientes métodos: - Clona este repositorio de GitHub y completa tu proyecto localmente. -- Use our Gitpod starter project to complete your project. +- Utiliza nuestro proyecto inicial en Gitpod para completar tu proyecto. - Utiliza un constructor de sitios de tu elección para completar el proyecto. Asegúrate de incorporar todos los archivos de nuestro repositorio GitHub. # --instructions-- diff --git a/curriculum/challenges/espanol/09-information-security/information-security-with-helmetjs/disable-client-side-caching-with-helmet.nocache.md b/curriculum/challenges/espanol/09-information-security/information-security-with-helmetjs/disable-client-side-caching-with-helmet.nocache.md index 53096fe9f4..a446b5e02c 100644 --- a/curriculum/challenges/espanol/09-information-security/information-security-with-helmetjs/disable-client-side-caching-with-helmet.nocache.md +++ b/curriculum/challenges/espanol/09-information-security/information-security-with-helmetjs/disable-client-side-caching-with-helmet.nocache.md @@ -8,7 +8,7 @@ dashedName: disable-client-side-caching-with-helmet-nocache # --description-- -As a reminder, this project is being built upon the following starter project on Gitpod, or cloned from GitHub. +Como recordatorio, este proyecto se está construyendo según el siguiente proyecto inicial en Gitpod, o clonando desde GitHub. Si esta lanzando una actualización para su sitio web, y quiere que los usuarios siempre descarguen la versión más reciente, puede (intentar) desactivar la cache en el navegador del cliente. Puede ser útil también en desarrollo. El almacenamiento de cache tiene beneficios de rendimiento, los cuales perderás, así que solo usa está opción cuando haya una necesidad real. diff --git a/curriculum/challenges/espanol/09-information-security/information-security-with-helmetjs/hash-and-compare-passwords-asynchronously.md b/curriculum/challenges/espanol/09-information-security/information-security-with-helmetjs/hash-and-compare-passwords-asynchronously.md index 06d9894516..357b7801eb 100644 --- a/curriculum/challenges/espanol/09-information-security/information-security-with-helmetjs/hash-and-compare-passwords-asynchronously.md +++ b/curriculum/challenges/espanol/09-information-security/information-security-with-helmetjs/hash-and-compare-passwords-asynchronously.md @@ -8,7 +8,7 @@ dashedName: hash-and-compare-passwords-asynchronously # --description-- -As a reminder, this project is being built upon the following starter project on Gitpod, or cloned from GitHub. +Como recordatorio, este proyecto se está construyendo según el siguiente proyecto inicial en Gitpod, o clonando desde GitHub. Como el As hashing esta diseñado para ser computacionalmente intensivo, es recomendado hacerlo de manera asyncrona en tu servidor para evitar conexiones entrantes mientras se efectúa el hash. Todo lo que debes hacer para hash una contraseña asíncrona es llamar diff --git a/curriculum/challenges/espanol/09-information-security/information-security-with-helmetjs/hash-and-compare-passwords-synchronously.md b/curriculum/challenges/espanol/09-information-security/information-security-with-helmetjs/hash-and-compare-passwords-synchronously.md index 2f84ed7575..f62b62bfad 100644 --- a/curriculum/challenges/espanol/09-information-security/information-security-with-helmetjs/hash-and-compare-passwords-synchronously.md +++ b/curriculum/challenges/espanol/09-information-security/information-security-with-helmetjs/hash-and-compare-passwords-synchronously.md @@ -8,7 +8,7 @@ dashedName: hash-and-compare-passwords-synchronously # --description-- -As a reminder, this project is being built upon the following starter project on Gitpod, or cloned from GitHub. +Como recordatorio, este proyecto se está construyendo según el siguiente proyecto inicial en Gitpodo clonando desde GitHub. Picar sincrónicamente es igual de fácil de hacer, pero puede causar retrasos si se usa en el lado del servidor con un alto costo o si se pica con mucha frecuencia. Picar con este método es tan fácil como llamar diff --git a/curriculum/challenges/espanol/09-information-security/information-security-with-helmetjs/hide-potentially-dangerous-information-using-helmet.hidepoweredby.md b/curriculum/challenges/espanol/09-information-security/information-security-with-helmetjs/hide-potentially-dangerous-information-using-helmet.hidepoweredby.md index e45b1fe9c3..43473666b6 100644 --- a/curriculum/challenges/espanol/09-information-security/information-security-with-helmetjs/hide-potentially-dangerous-information-using-helmet.hidepoweredby.md +++ b/curriculum/challenges/espanol/09-information-security/information-security-with-helmetjs/hide-potentially-dangerous-information-using-helmet.hidepoweredby.md @@ -8,7 +8,7 @@ dashedName: hide-potentially-dangerous-information-using-helmet-hidepoweredby # --description-- -As a reminder, this project is being built upon the following starter project on Gitpod, or cloned from GitHub. +Como recordatorio, este proyecto se está construyendo según el siguiente proyecto inicial en Gitpod, o clonando desde GitHub. Los Hackers pueden aprovechar la vulnerabalidades conocidas en Express/Node, si ellos ven que tu sitio está siendo alimentado por Express. `X-Powered-By: Express` Se envía por defecto en cualquier solicitud proveniente de Express. Utilice el middleware de `helmet.hidePoweredBy()` para quitar la cabecera X-Powered-By. diff --git a/curriculum/challenges/espanol/09-information-security/information-security-with-helmetjs/install-and-require-helmet.md b/curriculum/challenges/espanol/09-information-security/information-security-with-helmetjs/install-and-require-helmet.md index 4f3bc72504..38b8711df7 100644 --- a/curriculum/challenges/espanol/09-information-security/information-security-with-helmetjs/install-and-require-helmet.md +++ b/curriculum/challenges/espanol/09-information-security/information-security-with-helmetjs/install-and-require-helmet.md @@ -11,7 +11,7 @@ dashedName: install-and-require-helmet Trabajar en estos desafíos implica escribir tu código usando uno de los siguientes métodos: - Clona este repositorio de GitHub y completa esos retos localmente. -- Use our Gitpod starter project to complete these challenges. +- Usa nuestro proyecto inicial de Gitpod para completar estos desafíos. - Utilice un constructor de sitios de su elección para completar el proyecto. Asegúrese de incorporar todos los archivos de nuestro repositorio de GitHub. Helmet ayuda asegurar tus aplicaciones Express apps configurando varios encabezados HTTP. diff --git a/curriculum/challenges/espanol/09-information-security/information-security-with-helmetjs/mitigate-the-risk-of-cross-site-scripting-xss-attacks-with-helmet.xssfilter.md b/curriculum/challenges/espanol/09-information-security/information-security-with-helmetjs/mitigate-the-risk-of-cross-site-scripting-xss-attacks-with-helmet.xssfilter.md index c3cfec9442..521f6d92dd 100644 --- a/curriculum/challenges/espanol/09-information-security/information-security-with-helmetjs/mitigate-the-risk-of-cross-site-scripting-xss-attacks-with-helmet.xssfilter.md +++ b/curriculum/challenges/espanol/09-information-security/information-security-with-helmetjs/mitigate-the-risk-of-cross-site-scripting-xss-attacks-with-helmet.xssfilter.md @@ -9,11 +9,11 @@ dashedName: mitigate-the-risk-of-cross-site-scripting-xss-attacks-with-helmet-xs # --description-- -As a reminder, this project is being built upon the following starter project on Gitpod, or cloned from GitHub. +Como recordatorio, este proyecto se está construyendo según el siguiente proyecto inicial en Gitpod, o clonando desde GitHub. Secuencias de Comando de Sitio-Cruzado (XSS) es un ataque de tipo frecuente donde instrucciones maliciosas son insertadas dentro de páginas vulnerables, con el propósito de robar información sensible como información almacenada de sesión (cookies), o contraseñas. -The basic rule to lower the risk of an XSS attack is simple: "Never trust user's input". Como desarrollador siempre deberías limpiar toda la información que provenga desde el exterior. Esto incluye datos provenientes de formularios, consultas urls GET, e incluso de cuerpos POST. Sanear significa que tu deberías encontrar y los caracteres que puedan ser peligrosos por ej.: <, >. +La regla básica para disminuir el riesgo de un ataque de XSS es simple: "Nunca confíes en la entrada del usuario". Como desarrollador siempre deberías limpiar toda la información que provenga desde el exterior. Esto incluye datos provenientes de formularios, consultas urls GET, e incluso de cuerpos POST. Sanear significa que tu deberías encontrar y los caracteres que puedan ser peligrosos por ej.: <, >. Navegadores actuales pueden ayudar a mitigar el riesgo mediante la adopción de mejores estrategias de software. A menudo esto es configurable via cabeceras http. diff --git a/curriculum/challenges/espanol/09-information-security/information-security-with-helmetjs/prevent-ie-from-opening-untrusted-html-with-helmet.ienoopen.md b/curriculum/challenges/espanol/09-information-security/information-security-with-helmetjs/prevent-ie-from-opening-untrusted-html-with-helmet.ienoopen.md index 7efa4c2e82..d37e7b933f 100644 --- a/curriculum/challenges/espanol/09-information-security/information-security-with-helmetjs/prevent-ie-from-opening-untrusted-html-with-helmet.ienoopen.md +++ b/curriculum/challenges/espanol/09-information-security/information-security-with-helmetjs/prevent-ie-from-opening-untrusted-html-with-helmet.ienoopen.md @@ -8,9 +8,9 @@ dashedName: prevent-ie-from-opening-untrusted-html-with-helmet-ienoopen # --description-- -As a reminder, this project is being built upon the following starter project on Gitpod, or cloned from GitHub. +Como recordatorio, este proyecto se está construyendo según el siguiente proyecto inicial en Gitpod, o clonando desde GitHub. -Algunas aplicaciones web servirán HTML no confiable en la descarga. Algunas versiones de Internet Explorer por defecto abren estos archivos HTML en el contexto de tu sitio web. Esto significa que una página HTML no confiable podría haber empezado a hacer cosas malas en el contenido de tus páginas. Este middleware ajusta la cabecera X-Download-Options en noopen. This will prevent IE users from executing downloads in the trusted site's context. +Algunas aplicaciones web servirán HTML no confiable en la descarga. Algunas versiones de Internet Explorer por defecto abren estos archivos HTML en el contexto de tu sitio web. Esto significa que una página HTML no confiable podría haber empezado a hacer cosas malas en el contenido de tus páginas. Este middleware ajusta la cabecera X-Download-Options en noopen. Esto evitará que los usuarios de IE ejecuten descargas en el contexto de sitio de confianza. # --instructions-- diff --git a/curriculum/challenges/espanol/09-information-security/information-security-with-helmetjs/set-a-content-security-policy-with-helmet.contentsecuritypolicy.md b/curriculum/challenges/espanol/09-information-security/information-security-with-helmetjs/set-a-content-security-policy-with-helmet.contentsecuritypolicy.md index 65f95fac35..40c9c80299 100644 --- a/curriculum/challenges/espanol/09-information-security/information-security-with-helmetjs/set-a-content-security-policy-with-helmet.contentsecuritypolicy.md +++ b/curriculum/challenges/espanol/09-information-security/information-security-with-helmetjs/set-a-content-security-policy-with-helmet.contentsecuritypolicy.md @@ -1,6 +1,6 @@ --- id: 587d8249367417b2b2512c3f -title: Set a Content Security Policy with helmet.contentSecurityPolicy() +title: Establece una Política de Seguridad de Contenido con helmet.contentSecurityPolicy() challengeType: 2 forumTopicId: 301585 dashedName: set-a-content-security-policy-with-helmet-contentsecuritypolicy @@ -8,21 +8,21 @@ dashedName: set-a-content-security-policy-with-helmet-contentsecuritypolicy # --description-- -As a reminder, this project is being built upon the following starter project on Gitpod, or cloned from GitHub. +Como recordatorio, este proyecto se está construyendo según el siguiente proyecto inicial en Gitpod, o clonando desde GitHub. -This challenge highlights one promising new defense that can significantly reduce the risk and impact of many type of attacks in modern browsers. By setting and configuring a Content Security Policy you can prevent the injection of anything unintended into your page. This will protect your app from XSS vulnerabilities, undesired tracking, malicious frames, and much more. CSP works by defining an allowed list of content sources which are trusted. You can configure them for each kind of resource a web page may need (scripts, stylesheets, fonts, frames, media, and so on...). There are multiple directives available, so a website owner can have a granular control. See HTML 5 Rocks, KeyCDN for more details. Unfortunately CSP is unsupported by older browsers. +Este desafío marca una nueva defensa prometedora que puede significativamente reducir el riesgo e impacto de muchos tipos de ataques en navegadores modernos. Estableciendo y configurando una Política de Seguridad de Contenido puedes prevenir la inyección de cualquier no intencionado en tu página. Esto protegerá tu app de vulnerabilidades XSS, seguimientos no deseados, marcos maliciosos, y mucho más. CSP trabaja defendiendo una lista de fuentes de contenido permitidas las cuales son confiables. Puedes configurarlas para cada tipo de recurso que una página web pueda necesitar (scripts, hojas de estilo, fuentes, marcos, medios, etc...). Hay multiples directivas disponibles, entonces un propietario de un sitio web puede tener un control granular. Vea HTML 5 Rocks, KeyCDN para más detalles. Desafortunadamente CSP no está soportado por navegadores antiguos. -By default, directives are wide open, so it’s important to set the defaultSrc directive as a fallback. Helmet supports both defaultSrc and default-src naming styles. The fallback applies for most of the unspecified directives. +Por defecto, directivas son ampliamente abiertas, entonces es importante la directiva defaultSrc de reserva. Helmet suporta ambos defaultSrc y default-src estilos de nomenclatura. La reserva aplica para la mayoría de directivas no específicadas. # --instructions-- -In this exercise, use `helmet.contentSecurityPolicy()`. Configure it by adding a `directives` object. In the object, set the `defaultSrc` to `["'self'"]` (the list of allowed sources must be in an array), in order to trust only your website address by default. Also set the `scriptSrc` directive so that you only allow scripts to be downloaded from your website (`'self'`), and from the domain `'trusted-cdn.com'`. +En este ejercicio, usa `helmet.contentSecurityPolicy()`. Configurala agregando un objeto `directives`. En eI objeto, establece el `defaultSrc` a `["'self'"]` (la lista de fuentes permitidas debe ser un arreglo), en orden para confiar solo en la dirección de tu sitio web por defecto. También establece la directiva `scriptSrc` para que permita solo descargar scripts desde tu sitio web (`'self'`), y desde el dominio `'trusted-cdn.com'`. -Hint: in the `'self'` keyword, the single quotes are part of the keyword itself, so it needs to be enclosed in double quotes to be working. +Pista: en la palabra clave `'self'`, las comillas simples son partes de la misma palabra clave, entonces se necesita ser encerradas entre comillas dobles para funcionar. # --hints-- -helmet.contentSecurityPolicy() middleware should be mounted correctly +helmet.contentSecurityPolicy() middleware debe ser montado correctamente ```js (getUserInput) => @@ -36,7 +36,7 @@ helmet.contentSecurityPolicy() middleware should be mounted correctly ); ``` -Your csp config is not correct. defaultSrc should be ["'self'"] and scriptSrc should be ["'self'", 'trusted-cdn.com'] +Tu configuración csp no es correcta. defaultSrc debería ser ["'self'"] y scriptSrc debe ser ["'self'", 'trusted-cdn.com'] ```js (getUserInput) => diff --git a/curriculum/challenges/espanol/10-coding-interview-prep/data-structures/add-a-new-element-to-a-binary-search-tree.md b/curriculum/challenges/espanol/10-coding-interview-prep/data-structures/add-a-new-element-to-a-binary-search-tree.md index 5b0e856622..0c00d00611 100644 --- a/curriculum/challenges/espanol/10-coding-interview-prep/data-structures/add-a-new-element-to-a-binary-search-tree.md +++ b/curriculum/challenges/espanol/10-coding-interview-prep/data-structures/add-a-new-element-to-a-binary-search-tree.md @@ -14,7 +14,7 @@ Primero, vamos a describir alguna terminología común que encontraremos con los Para comenzar, trataremos un tipo particular de árbol, el árbol binario. De hecho, en realidad discutiremos un árbol binario en particular, un árbol binario de búsqueda. Describiremos lo que esto significa. Mientras que la estructura de datos de árbol puede tener cualquier número de ramas en un solo nodo, un árbol binario solamente puede tener dos ramas para cada nodo. Además, un árbol binario de búsqueda se ordena respecto a los subárboles hijos, el valor de cada nodo en el subárbol izquierdo es menor o igual que el valor del nodo padre, y el valor de cada nodo en el subárbol derecho es mayor o igual que el valor del nodo padre. Es muy útil visualizar esta relación de orden para entenderla mejor: -
an example of a binary search tree
+
un ejemplo de un árbol de búsqueda binario
Ahora esta relación de orden es fácil de ver. Observa que cada valor a la izquierda de 8, el nodo raíz, es menor que 8, y cada valor a la derecha es mayor que 8. Además note que esta relación también es aplicada para cada de los subárboles. Por ejemplo, el primer hijo izquierdo es un subárbol. 3 es el nodo padre, y tiene exactamente dos nodos hijos - debido a las reglas de los árboles binarios de búsqueda, sabemos sin siquiera ver que el hijo izquierdo de este nodo ( y cualquiera de sus hijos) será menor que, y el hijo derecho(y cualquiera de sus hijos) será mayor que 3 (pero además menor que el valor de la raíz de la estructura). diff --git a/curriculum/challenges/espanol/10-coding-interview-prep/take-home-projects/build-a-pong-game.md b/curriculum/challenges/espanol/10-coding-interview-prep/take-home-projects/build-a-pong-game.md index d48df3b596..8d731d9c97 100644 --- a/curriculum/challenges/espanol/10-coding-interview-prep/take-home-projects/build-a-pong-game.md +++ b/curriculum/challenges/espanol/10-coding-interview-prep/take-home-projects/build-a-pong-game.md @@ -16,15 +16,15 @@ dashedName: build-a-pong-game **User Story:** I can control a paddle. -**User Story:** The computer can control the other paddle. +**Historia de usuario:** El computador puede controlar la otra paleta. -**User Story:** The computer's paddle is unbeatable. It should never miss the ball. +**Historia de usuario:** La paleta del computador es imbatible. Nunca debe fallar el balón. -**User Story:** The game keeps track of the player and computer's score. +**Historia de usuario:** Se mantiene registro de los puntajes del jugador y el computador. Cuando hayas terminado, incluye un enlace a tu proyecto en CodePen y haz clic en el botón "He completado este desafío". -You can get feedback on your project by sharing it on the freeCodeCamp forum. +Puedes recibir retroalimentación de tu proyecto compartiendolo en el foro de freeCodeCamp. # --solutions-- diff --git a/curriculum/challenges/espanol/10-coding-interview-prep/take-home-projects/build-a-recipe-box.md b/curriculum/challenges/espanol/10-coding-interview-prep/take-home-projects/build-a-recipe-box.md index 6f266f91c9..20a52e224d 100644 --- a/curriculum/challenges/espanol/10-coding-interview-prep/take-home-projects/build-a-recipe-box.md +++ b/curriculum/challenges/espanol/10-coding-interview-prep/take-home-projects/build-a-recipe-box.md @@ -8,23 +8,23 @@ dashedName: build-a-recipe-box # --description-- -**Objective:** Build an app that is functionally similar to this: https://codepen.io/freeCodeCamp/full/dNVazZ/. +**Objetivo:** Construir un aplicación que sea funcionalmente similar a ésta: https://codepen.io/freeCodeCamp/full/dNVazZ/. -Fulfill the below user stories and get all of the tests to pass. Utiliza cualquier librería o API que necesites. Dale tu propio estilo personal. +Completa las historias de los usuarios que están aquí abajo y haz que pasen todas las pruebas. Utiliza cualquier librería o API que necesites. Dale tu propio estilo personal. -**User Story:** I can create recipes that have names and ingredients. +**Historia de Usuario:** Puedo crear recetas que tienen nombres e ingredientes. -**User Story:** I can see an index view where the names of all the recipes are visible. +**Historia de Usuario:** Puedo ver un índice donde son visibles los nombres de todas las recetas. -**User Story:** I can click into any of those recipes to view it. +**Historia de Usuario:** Puedo clickear cualquiera de esas recetas para verla. -**User Story:** I can edit these recipes. +**Historia de Usuario:** Puedo editar esas recetas. -**User Story:** I can delete these recipes. +**Historia de Usuario:** Puedo eliminar esas recetas. -**User Story:** All new recipes I add are saved in my browser's local storage. If I refresh the page, these recipes will still be there. +**Historia de Usuario:** Todas las nuevas recetas que agrego están guardadas en el almacenamiento local (local storage) de mi navegador. Si actualizo la página, estas recetas seguirán ahí. -**Hint:** You should prefix your local storage keys on CodePen, i.e. `_username_recipes` +**Sugerencia:** Debes prefijar tus claves de almacenamiento local en CodePen, es decir, `_username_recipes` Cuando hayas terminado, incluye un enlace a tu proyecto en CodePen y haz clic en el botón "He completado este desafío". diff --git a/curriculum/challenges/espanol/10-coding-interview-prep/take-home-projects/chart-the-stock-market.md b/curriculum/challenges/espanol/10-coding-interview-prep/take-home-projects/chart-the-stock-market.md index 650954b6ec..5a5f574d39 100644 --- a/curriculum/challenges/espanol/10-coding-interview-prep/take-home-projects/chart-the-stock-market.md +++ b/curriculum/challenges/espanol/10-coding-interview-prep/take-home-projects/chart-the-stock-market.md @@ -8,19 +8,19 @@ dashedName: chart-the-stock-market # --description-- -Build a full stack JavaScript app that is functionally similar to this: https://chart-the-stock-market.freecodecamp.rocks/. Utiliza un constructor de sitios de tu elección para completar el proyecto. +Construye una aplicación full stack de JavaScript que sea funcionalmente similar a esta: https://chart-the-stock-market.freecodecamp.rocks/. Utiliza un constructor de sitios de tu elección para completar el proyecto. Estas son las historias de usuario específicas que debes implementar para este proyecto: -**User Story:** You can view a graph displaying the recent trend lines for each added stock. +**Historia del usuario:** Puedes ver un gráfico con las recientes líneas de tendencia por cada stock agregado. -**User Story:** You can add new stocks by their symbol name. +**Historia de Usuario:** Puedes agregar nuevas acciones desde su nombre simbólico. -**User Story:** You can remove stocks. +**Historia de Usuario:** Puedes eliminar acciones. -**User Story:** You can see changes in real-time when any other user adds or removes a stock. For this you will need to use Web Sockets. +**Historia de Usuario:** Puedes ver los cambios en tiempo real cuando otro usuario agrega o quita una acción. Para ésto, necesitarás usar Websockets. -Cuando hayas terminado, asegúrate de que un demo funcional de tu proyecto esté alojado en algún lugar público. Then submit the URL to it in the Solution Link field. Optionally, also submit a link to your project's source code in the GitHub Link field. +Cuando hayas terminado, asegúrate de que un demo funcional de tu proyecto esté alojado en algún lugar público. Luego, envía la URL a éste, en el link del campo Solución. Opcionalmente, también envía un enlace al código fuente de tu proyecto en el campo GitHub Link. # --solutions-- diff --git a/curriculum/challenges/espanol/10-coding-interview-prep/take-home-projects/use-the-twitch-json-api.md b/curriculum/challenges/espanol/10-coding-interview-prep/take-home-projects/use-the-twitch-json-api.md index f32ec9909a..7bf0b374d5 100644 --- a/curriculum/challenges/espanol/10-coding-interview-prep/take-home-projects/use-the-twitch-json-api.md +++ b/curriculum/challenges/espanol/10-coding-interview-prep/take-home-projects/use-the-twitch-json-api.md @@ -8,25 +8,25 @@ dashedName: use-the-twitch-json-api # --description-- -**Objective:** Build an app that is functionally similar to this: https://codepen.io/freeCodeCamp/full/Myvqmo/. +**Objetivo:** Construye una aplicación que sea funcionalmente similar a esta: https://codepen.io/freeCodeCamp/full/Myvqmo/. -The Twitch API is a RESTful API that lets developers build creative integrations for the broader Twitch community. +La API de Twitch es una API RESTful que permite a los desarrolladores construir integraciones creativas para la comunidad de Twitch más amplia. -Fulfill the below user stories and get all of the tests to pass. Use whichever libraries or APIs you need. Give it your own personal style. +Completa las siguientes historias de usuario y consigue que todas las pruebas pasen. Utiliza cualquier librería o API que necesites. Dale tu propio estilo. -**User Story:** I can see whether freeCodeCamp is currently streaming on Twitch.tv. +**Historia del usuario:** Puedo ver si freeCodeCamp está transmitiendo en Twitch.tv. -**User Story:** I can click the status output and be sent directly to the freeCodeCamp's Twitch.tv channel. +**Historia del usuario:** Puedo hacer clic en la salida del estado y ser enviado directamente al canal Twitch.tv de freeCodeCamp. -**User Story:** If a Twitch user is currently streaming, I can see additional details about what they are streaming. +**Historia del usuario:** Si un usuario de Twitch está transmitiendo actualmente, puedo ver detalles adicionales sobre lo que está transmitiendo. -**Hint:** Here's an array of the Twitch.tv usernames of people who regularly stream: `["ESL_SC2", "OgamingSC2", "cretetion", "freecodecamp", "storbeck", "habathcx", "RobotCaleb", "noobs2ninjas"]` +**Sugerencia:** Aquí hay un arreglo de los nombres de usuario Twitch.tv de las personas que regularmente transmiten: `["ESL_SC2", "OgamingSC2", "cretetion", "freecodecamp", "storbeck", "habathcx", "RobotCaleb", "noobs2ninjas"]` -**UPDATE:** Due to a change in conditions on API usage, Twitch.tv requires an API key, but we've built a workaround. Use https://twitch-proxy.freecodecamp.rocks/ instead of Twitch's API base URL and you'll still be able to get account information, without needing to sign up for an API key. +**ACTUALIZACIÓN:** Debido a un cambio en las condiciones de uso de la API, Twitch.tv requiere una clave API, pero hemos creado una solución para ello. Usa https://twitch-proxy.freecodecamp. ocks/ en lugar de la URL base de la API de Twitter y todavía podrá obtener información de la cuenta, sin necesidad de registrarse en una clave API. Cuando hayas terminado, incluye un enlace a tu proyecto en CodePen y haz clic en el botón "He completado este desafío". -You can get feedback on your project by sharing it on the freeCodeCamp forum. +Puedes obtener opiniones de tu proyecto compartiéndolo en el foro freeCodeCamp. # --solutions-- diff --git a/curriculum/challenges/espanol/11-machine-learning-with-python/machine-learning-with-python-projects/neural-network-sms-text-classifier.md b/curriculum/challenges/espanol/11-machine-learning-with-python/machine-learning-with-python-projects/neural-network-sms-text-classifier.md index f347d6df3b..0091b0425e 100644 --- a/curriculum/challenges/espanol/11-machine-learning-with-python/machine-learning-with-python-projects/neural-network-sms-text-classifier.md +++ b/curriculum/challenges/espanol/11-machine-learning-with-python/machine-learning-with-python-projects/neural-network-sms-text-classifier.md @@ -8,7 +8,7 @@ dashedName: neural-network-sms-text-classifier # --description-- -You will be working on this project with Google Colaboratory. +Estarás trabajando en este proyecto con Google Colaboratory. Después de acceder al enlace, crea una copia del cuaderno ya sea en tu propia cuenta o de manera local. Una vez hayas completado el proyecto y superes el test (incluido en el enlace), envía el enlace del proyecto a continuación. Si envias un enlace a Google Colaboratory, asegúrate de que activas el uso compartido para "cualquiera con el enlace." @@ -16,17 +16,17 @@ Todavía estamos desarrollando el contenido instructivo interactivo para el plan # --instructions-- -In this challenge, you need to create a machine learning model that will classify SMS messages as either "ham" or "spam". A "ham" message is a normal message sent by a friend. A "spam" message is an advertisement or a message sent by a company. +En este desafío, necesitas crear un modelo de aprendizaje automático que clasifique los mensajes SMS como "jamón" o "spam". Un mensaje "ham" es un mensaje normal enviado por un amigo. Un mensaje "spam" es un anuncio o un mensaje enviado por una empresa. -You should create a function called `predict_message` that takes a message string as an argument and returns a list. The first element in the list should be a number between zero and one that indicates the likeliness of "ham" (0) or "spam" (1). The second element in the list should be the word "ham" or "spam", depending on which is most likely. +Debes crear una función llamada `predict_message` que toma una cadena de mensaje como argumento y devuelve una lista. El primer elemento de la lista debe ser un número entre cero y uno que indique la probabilidad de "jamón" (0) o "spam" (1). El segundo elemento de la lista debe ser la palabra "jamón" o "spam", dependiendo de cuál sea más probable. -For this challenge, you will use the SMS Spam Collection dataset. The dataset has already been grouped into train data and test data. +Para este desafío, usarás el conjunto de datos SMS Spam Collection. El conjunto de datos ya ha sido agrupado en datos de entrenamiento y de pruebas. -The first two cells import the libraries and data. The final cell tests your model and function. Add your code in between these cells. +Las dos primeras celdas importan las bibliotecas y los datos. La celda final prueba tu modelo y función. Escribe tu código entre esas celdas. # --hints-- -It should pass all Python tests. +Debes pasar todas las pruebas de Python. ```js diff --git a/curriculum/challenges/espanol/11-machine-learning-with-python/tensorflow/core-learning-algorithms-hidden-markov-models.md b/curriculum/challenges/espanol/11-machine-learning-with-python/tensorflow/core-learning-algorithms-hidden-markov-models.md index 2adf4b7055..ba19203ca2 100644 --- a/curriculum/challenges/espanol/11-machine-learning-with-python/tensorflow/core-learning-algorithms-hidden-markov-models.md +++ b/curriculum/challenges/espanol/11-machine-learning-with-python/tensorflow/core-learning-algorithms-hidden-markov-models.md @@ -1,6 +1,6 @@ --- id: 5e8f2f13c4cdbe86b5c72d90 -title: 'Core Learning Algorithms: Hidden Markov Models' +title: 'Algoritmos de Aprendizaje Central: Modelos Markov Ocultos' challengeType: 11 videoId: IZg24y4wEPY bilibiliIds: @@ -14,19 +14,19 @@ dashedName: core-learning-algorithms-hidden-markov-models ## --text-- -What makes a Hidden Markov model different than linear regression or classification? +¿Qué hace a un modelo de Markov oculto diferente de una regresión o clasificación lineal? ## --answers-- -It uses probability distributions to predict future events or states. +Usa distribuciones de probabilidades para predecir eventos o estados futuros. --- -It analyzes the relationship between independent and dependent variables to make predictions. +Analiza la relación entre entre variables dependientes e independientes para hacer predicciones. --- -It separates data points into separate categories. +Separa los puntos de datos en categorías separadas. ## --video-solution-- diff --git a/curriculum/challenges/espanol/11-machine-learning-with-python/tensorflow/core-learning-algorithms.md b/curriculum/challenges/espanol/11-machine-learning-with-python/tensorflow/core-learning-algorithms.md index 337151e060..8d8f82f735 100644 --- a/curriculum/challenges/espanol/11-machine-learning-with-python/tensorflow/core-learning-algorithms.md +++ b/curriculum/challenges/espanol/11-machine-learning-with-python/tensorflow/core-learning-algorithms.md @@ -12,7 +12,7 @@ dashedName: core-learning-algorithms # --description-- -The next few video lessons will reference [this Colab notebook](https://colab.research.google.com/drive/15Cyy2H7nT40sGR7TBN5wBvgTd57mVKay#forceEdit=true&sandboxMode=true). +Las próximas videolecciones referenciarán [este cuaderno de Colab](https://colab.research.google.com/drive/15Cyy2H7nT40sGR7TBN5wBvgTd57mVKay#forceEdit=true&sandboxMode=true). # --question-- diff --git a/curriculum/challenges/espanol/11-machine-learning-with-python/tensorflow/introduction-machine-learning-fundamentals.md b/curriculum/challenges/espanol/11-machine-learning-with-python/tensorflow/introduction-machine-learning-fundamentals.md index 61248b976a..b51f5582ba 100644 --- a/curriculum/challenges/espanol/11-machine-learning-with-python/tensorflow/introduction-machine-learning-fundamentals.md +++ b/curriculum/challenges/espanol/11-machine-learning-with-python/tensorflow/introduction-machine-learning-fundamentals.md @@ -1,6 +1,6 @@ --- id: 5e8f2f13c4cdbe86b5c72d87 -title: 'Introduction: Machine Learning Fundamentals' +title: 'Introducción: Fundamentos del aprendizaje automático' challengeType: 11 videoId: KwL1qTR5MT8 bilibiliIds: @@ -14,19 +14,19 @@ dashedName: introduction-machine-learning-fundamentals ## --text-- -Which statement below is **false**? +¿Qué afirmación es **falso**? ## --answers-- -Neural networks are modeled after the way the human brain works. +Las redes neurológicas se modelan según la forma en que funciona el cerebro humano. --- -Computer programs that play tic-tac-toe or chess against human players are examples of simple artificial intelligence. +Los programas informáticos que juegan con el dedo en la mano o el ajedrez contra jugadores humanos son ejemplos de una simple inteligencia artificial. --- -Machine learning is a subset of artificial intelligence. +El aprendizaje automático es un subconjunto de la inteligencia artificial. ## --video-solution-- diff --git a/curriculum/challenges/espanol/11-machine-learning-with-python/tensorflow/natural-language-processing-with-rnns-training-the-model.md b/curriculum/challenges/espanol/11-machine-learning-with-python/tensorflow/natural-language-processing-with-rnns-training-the-model.md index a2d0858bab..11bee28515 100644 --- a/curriculum/challenges/espanol/11-machine-learning-with-python/tensorflow/natural-language-processing-with-rnns-training-the-model.md +++ b/curriculum/challenges/espanol/11-machine-learning-with-python/tensorflow/natural-language-processing-with-rnns-training-the-model.md @@ -1,6 +1,6 @@ --- id: 5e8f2f13c4cdbe86b5c72da2 -title: 'Natural Language Processing With RNNs: Training the Model' +title: 'Procesamiento del lenguaje natural con RNNs: Entrenando el modelo' challengeType: 11 videoId: hEUiK7j9UI8 bilibiliIds: @@ -14,7 +14,7 @@ dashedName: natural-language-processing-with-rnns-training-the-model ## --text-- -Fill in the blanks below to save your model's checkpoints in the `./checkpoints` directory and call the latest checkpoint for training: +Rellena los siguientes espacios en blanco para guardar los puntos de control de tu modelo en el directorio `./checkpoints` y llama al último punto de control para el entrenamiento: ```py checkpoint_dir = __A__ diff --git a/curriculum/challenges/espanol/11-machine-learning-with-python/tensorflow/neural-networks-optimizers.md b/curriculum/challenges/espanol/11-machine-learning-with-python/tensorflow/neural-networks-optimizers.md index c5da846ac0..a6205a8cfd 100644 --- a/curriculum/challenges/espanol/11-machine-learning-with-python/tensorflow/neural-networks-optimizers.md +++ b/curriculum/challenges/espanol/11-machine-learning-with-python/tensorflow/neural-networks-optimizers.md @@ -1,6 +1,6 @@ --- id: 5e8f2f13c4cdbe86b5c72d94 -title: 'Neural Networks: Optimizers' +title: 'Redes Neurales: Optimizadores' challengeType: 11 videoId: hdOtRPQe1o4 bilibiliIds: @@ -14,19 +14,19 @@ dashedName: neural-networks-optimizers ## --text-- -What is an optimizer function? +¿Qué es una función optimizador? ## --answers-- -A function that increases the accuracy of a model's predictions. +Una función que aumenta la precisión de las predicciones de un modelo. --- -A function that implements the gradient descent and backpropagation algorithms for you. +Una función que implementa los algoritmos de descenso y retropropagación degradados para usted. --- -A function that reduces the time a model needs to train. +Una función que reduce el tiempo que un modelo necesita entrenar. ## --video-solution-- diff --git a/curriculum/challenges/espanol/11-machine-learning-with-python/tensorflow/neural-networks-with-tensorflow.md b/curriculum/challenges/espanol/11-machine-learning-with-python/tensorflow/neural-networks-with-tensorflow.md index 2f2ea5c714..1c6a9ca786 100644 --- a/curriculum/challenges/espanol/11-machine-learning-with-python/tensorflow/neural-networks-with-tensorflow.md +++ b/curriculum/challenges/espanol/11-machine-learning-with-python/tensorflow/neural-networks-with-tensorflow.md @@ -1,6 +1,6 @@ --- id: 5e8f2f13c4cdbe86b5c72d92 -title: Neural Networks with TensorFlow +title: Redes Neurales con TensorFlow challengeType: 11 videoId: uisdfrNrZW4 bilibiliIds: @@ -12,25 +12,25 @@ dashedName: neural-networks-with-tensorflow # --description-- -The next few video lessons will reference [this Colab notebook](https://colab.research.google.com/drive/1m2cg3D1x3j5vrFc-Cu0gMvc48gWyCOuG#forceEdit=true&sandboxMode=true). +Las próximas videolecciones referenciarán [este cuaderno de Colab](https://colab.research.google.com/drive/1m2cg3D1x3j5vrFc-Cu0gMvc48gWyCOuG#forceEdit=true&sandboxMode=true). # --question-- ## --text-- -A densely connected neural network is one in which...: +Una red neuronal densamente conectada es aquella en la cual...: ## --answers-- -all the neurons in the current layer are connected to one neuron in the previous layer. +todas las neuronas de la capa actual están conectadas a una neurona en la capa anterior. --- -all the neurons in each layer are connected randomly. +todas las neuronas de cada capa se conectan al azar. --- -all the neurons in the current layer are connected to every neuron in the previous layer. +todas las neuronas de la capa actual están conectadas a una neurona en la capa anterior. ## --video-solution-- diff --git a/curriculum/challenges/espanol/13-relational-databases/build-a-periodic-table-database-project/build-a-periodic-table-database.md b/curriculum/challenges/espanol/13-relational-databases/build-a-periodic-table-database-project/build-a-periodic-table-database.md index c24cc9ea6d..ebf26c9af2 100644 --- a/curriculum/challenges/espanol/13-relational-databases/build-a-periodic-table-database-project/build-a-periodic-table-database.md +++ b/curriculum/challenges/espanol/13-relational-databases/build-a-periodic-table-database-project/build-a-periodic-table-database.md @@ -8,7 +8,7 @@ dashedName: build-a-periodic-table-database # --description-- -Este es uno de los proyectos necesarios para obtener su certificación. Para este proyecto, creará Bash un script para obtener información sobre elementos químicos de una base de datos de tabla periódica. +Este es uno de los proyectos necesarios para obtener su certificación. For this project, you will create a Bash script to get information about chemical elements from a periodic table database. # --instructions-- diff --git a/curriculum/challenges/espanol/14-responsive-web-design-22/learn-basic-css-by-building-a-cafe-menu/5f3ef6e0a81099d9a697b550.md b/curriculum/challenges/espanol/14-responsive-web-design-22/learn-basic-css-by-building-a-cafe-menu/5f3ef6e0a81099d9a697b550.md index 254763ddd4..e05a2fc106 100644 --- a/curriculum/challenges/espanol/14-responsive-web-design-22/learn-basic-css-by-building-a-cafe-menu/5f3ef6e0a81099d9a697b550.md +++ b/curriculum/challenges/espanol/14-responsive-web-design-22/learn-basic-css-by-building-a-cafe-menu/5f3ef6e0a81099d9a697b550.md @@ -9,6 +9,8 @@ dashedName: step-64 Dentro del elemento `footer`, añade un elemento `p`. Después, anida un elemento anchor (`a`) en el elemento `p` que enlace a `https://www.freecodecamp.org` y tenga el texto `Visit our website`. +Make sure that the link opens in a new tab by adding a `target` attribute with the value `_blank`. + # --hints-- No debes modificar el elemento `footer` existente. @@ -43,6 +45,12 @@ Tu nuevo elemento `a` te debe enlazar a `https://www.freecodecamp.org`. Recuerda assert(document.querySelector("footer > p > a")?.href === "https://www.freecodecamp.org/"); ``` +Your new `a` element should have the `target` attribute set to `_blank`. + +```js +assert.equal(document.querySelector("footer > p > a")?.target, "_blank"); +``` + # --seed-- ## --seed-contents-- diff --git a/curriculum/challenges/espanol/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-j.md b/curriculum/challenges/espanol/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-j.md index d2ad72a1ea..1b6ca05444 100644 --- a/curriculum/challenges/espanol/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-j.md +++ b/curriculum/challenges/espanol/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-j.md @@ -21,12 +21,12 @@ Remove `flex: 1` from `.item` and add `justify-content: space-between` to `.cont `justify-content` aligns items across the **main axis**. There are a few values that you can use here. You'll learn the rest of them in the reading assignments, but for now try changing it to center, which should center the boxes along the main axis. -# --question-- - -## --assignment-- +# --assignment-- Before moving on to the next lesson, see what is possible with the `justify-content` property. Read this [interactive article on MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/justify-content) and play around with the different values of `justify-content` on the example. +# --question-- + ## --text-- How does applying `justify-content: space-between` to a flex container affect the positioning of its items? diff --git a/curriculum/challenges/espanol/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-k.md b/curriculum/challenges/espanol/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-k.md index d3137b0af5..59acb55a29 100644 --- a/curriculum/challenges/espanol/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-k.md +++ b/curriculum/challenges/espanol/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-k.md @@ -17,12 +17,12 @@ To change the placement of items along the cross axis use `align-items`. Try get Because `justify-content` and `align-items` are based on the main and cross axis of your container, their behavior changes when you change the flex-direction of a flex-container. For example, when you change `flex-direction` to `column`, `justify-content` aligns vertically and `align-items` aligns horizontally. The most common behavior, however, is the default, i.e. `justify-content` aligns items horizontally (because the main axis defaults to horizontal), and `align-items` aligns them vertically. One of the biggest sticking points that beginners have with flexbox is confusion when this behavior changes. -# --question-- - -## --assignment-- +# --assignment-- Before moving on to the next lesson, see if you can figure out how `align-items` behaves when you change the `flex-direction` property to `column`. +# --question-- + ## --text-- When changing the `flex-direction` property to `column` in a flex container, how does `align-items` behave in relation to the flex items? diff --git a/curriculum/challenges/espanol/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-b.md b/curriculum/challenges/espanol/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-b.md index 1adf9ce84f..49edeac0e4 100644 --- a/curriculum/challenges/espanol/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-b.md +++ b/curriculum/challenges/espanol/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-b.md @@ -9,12 +9,12 @@ dashedName: learn-block-and-inline-lesson-b Inline elements, however, do not start on a new line. They appear in line with whatever elements they are placed beside. A clear example of an inline element is a link, or `` tag. If you stick one of these in the middle of a paragraph of text, it will behave like a part of the paragraph. (Like this) The link’s text will sit alongside other words in that paragraph. Additionally, padding and margin behave differently on inline elements. In general, you do not want to try to put extra padding or margin on inline elements. -# --question-- - -## --assignment-- +# --assignment-- Search the web for a list of `block` elements and a list of `inline` elements. +# --question-- + ## --text-- What is the difference between a `block` element and an `inline` element? diff --git a/curriculum/challenges/espanol/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-g.md b/curriculum/challenges/espanol/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-g.md index cdd4d5aa87..e75492e9c1 100644 --- a/curriculum/challenges/espanol/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-g.md +++ b/curriculum/challenges/espanol/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-g.md @@ -7,7 +7,7 @@ dashedName: learn-block-and-inline-lesson-g # --description-- -Now that you have some basic understanding of `block` and inline `elements`, pull up your list of `block` and `inline` elements from a couple questions ago and see if you can identify which of the following elements are `block` elements and which are `inline` elements. +Now that you have some basic understanding of `block` and `inline` elements, pull up your list of `block` and `inline` elements from a couple questions ago and see if you can identify which of the following elements are `block` elements and which are `inline` elements. # --question-- diff --git a/curriculum/challenges/espanol/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-a.md b/curriculum/challenges/espanol/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-a.md index 995073b8a2..a7a2ee9a51 100644 --- a/curriculum/challenges/espanol/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-a.md +++ b/curriculum/challenges/espanol/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-a.md @@ -21,12 +21,12 @@ New programmers often find problem solving the hardest skill to build. It's not The best way to improve your problem solving ability is by building experience by making lots and lots of programs. The more practice you have the better you'll be prepared to solve real world problems. -# --question-- - -## --assignment-- +# --assignment-- Read How to Think Like a Programmer - Lessons in Problem Solving by Richard Reis. +# --question-- + ## --text-- According to V. Anton Spraul in "Think Like a Programmer," what is problem solving in programming? diff --git a/curriculum/challenges/espanol/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-b.md b/curriculum/challenges/espanol/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-b.md index ae905ecf89..c57a7d43e8 100644 --- a/curriculum/challenges/espanol/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-b.md +++ b/curriculum/challenges/espanol/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-b.md @@ -25,11 +25,11 @@ Now that you know what you’re aiming to solve, don’t jump into coding just y The last question is where you will write out an algorithm to solve the problem. You can think of an algorithm as a recipe for solving a particular problem. It defines the steps that need to be taken by the computer to solve a problem in pseudocode. -# --question-- - -## --assignment-- +# --assignment-- Watch How to Begin Thinking Like a Programmer by Coding Tech. It’s an hour long but packed full of information and definitely worth your time watching. +# --question-- + ## --text-- What should you do before starting to code according to the provided text? diff --git a/curriculum/challenges/espanol/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-c.md b/curriculum/challenges/espanol/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-c.md index c837fd9658..082f2d51ae 100644 --- a/curriculum/challenges/espanol/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-c.md +++ b/curriculum/challenges/espanol/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-c.md @@ -22,12 +22,12 @@ Print the value of the counter variable This is a basic program to demonstrate how pseudocode looks. There will be more examples of pseudocode included in the assignments. +# --assignment-- -# --question-- - -## --assignment-- Read this Pseudocode: What It Is and How to Write It article from Built In. +# --question-- + ## --text-- What are the benefits of using pseudocode according to the linked article? diff --git a/curriculum/challenges/espanol/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657b69e10d6606a0185d4d4f.md b/curriculum/challenges/espanol/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657b69e10d6606a0185d4d4f.md index 60c25af9a5..df1677d813 100644 --- a/curriculum/challenges/espanol/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657b69e10d6606a0185d4d4f.md +++ b/curriculum/challenges/espanol/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657b69e10d6606a0185d4d4f.md @@ -9,7 +9,7 @@ dashedName: task-23 # --description-- -So far you have learned how to create questions with the verb to be. In sentences with the verb `to be` (am, is, are) you just have to change the order of the noun and the verb to create a question. Like this: +So far you have learned how to create questions with the verb `to be`. In sentences with the verb `to be` (am, is, are) you just have to change the order of the noun and the verb to create a question. Like this: `You are a developer` -> `Are you a developer?` diff --git a/curriculum/challenges/espanol/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657dce8ff35869721311a5e3.md b/curriculum/challenges/espanol/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657dce8ff35869721311a5e3.md index 9e7122d39d..41846bc67f 100644 --- a/curriculum/challenges/espanol/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657dce8ff35869721311a5e3.md +++ b/curriculum/challenges/espanol/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657dce8ff35869721311a5e3.md @@ -21,7 +21,7 @@ Which sentence is correct for describing one place near you? ### --retroalimentación-- -`There are` is used for plural nouns, and `bank` is singular. You’ll learn about there are in the next few lessons. +`There are` is used for plural nouns, and `bank` is singular. You’ll learn about `there are` in the next few lessons. --- diff --git a/curriculum/challenges/espanol/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657dcee413423174ca3747f5.md b/curriculum/challenges/espanol/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657dcee413423174ca3747f5.md index e8cb7d2947..fe1ca44d6b 100644 --- a/curriculum/challenges/espanol/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657dcee413423174ca3747f5.md +++ b/curriculum/challenges/espanol/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657dcee413423174ca3747f5.md @@ -7,7 +7,7 @@ dashedName: task-112 # --description-- -To elaborate a question using `there is` you just need to change the order of the verb to be, like so: +To elaborate a question using `there is` you just need to change the order of the verb `to be`, like so: `There is an ATM nearby` -> `Is there an ATM nearby?` diff --git a/curriculum/challenges/espanol/25-front-end-development/lab-celestial-bodies-database/5f1a4ef5d5d6b5ab580fc6ae.md b/curriculum/challenges/espanol/25-front-end-development/lab-celestial-bodies-database/5f1a4ef5d5d6b5ab580fc6ae.md new file mode 100644 index 0000000000..7d664a8876 --- /dev/null +++ b/curriculum/challenges/espanol/25-front-end-development/lab-celestial-bodies-database/5f1a4ef5d5d6b5ab580fc6ae.md @@ -0,0 +1,25 @@ +--- +id: 5f1a4ef5d5d6b5ab580fc6ae +title: Build a Celestial Bodies Database +challengeType: 13 +url: freeCodeCamp/learn-celestial-bodies-database +dashedName: lab-celestial-bodies-database +--- + +# --description-- + +For this project, you will build a database of celestial bodies using PostgreSQL. + +# --instructions-- + +**Important:** After you pass all the project tests, save a dump of your database into a `universe.sql` file so you can complete step 2. There will be instructions how to do that within the virtual machine. + +# --notes-- + +Required files: `universe.sql` + +# --hints-- + +# --seed-- + +# --solutions-- diff --git a/curriculum/challenges/espanol/25-front-end-development/lab-exercise-tracker/5a8b073d06fa14fcfde687aa.md b/curriculum/challenges/espanol/25-front-end-development/lab-exercise-tracker/5a8b073d06fa14fcfde687aa.md new file mode 100644 index 0000000000..9492b82cb4 --- /dev/null +++ b/curriculum/challenges/espanol/25-front-end-development/lab-exercise-tracker/5a8b073d06fa14fcfde687aa.md @@ -0,0 +1,611 @@ +--- +id: 5a8b073d06fa14fcfde687aa +title: Build an Exercise Tracker +challengeType: 4 +dashedName: build-an-exercise-tracker +--- + +# --description-- + +Build a full stack JavaScript app that is functionally similar to this: https://exercise-tracker.freecodecamp.rocks. Working on this project will involve you writing your code using one of the following methods: + +- Clone this GitHub repo and complete your project locally. +- Use our Gitpod starter project to complete your project. +- Use a site builder of your choice to complete the project. Be sure to incorporate all the files from our GitHub repo. + +# --instructions-- + +Your responses should have the following structures. + +Exercise: + +```js +{ + username: "fcc_test", + description: "test", + duration: 60, + date: "Mon Jan 01 1990", + _id: "5fb5853f734231456ccb3b05" +} +``` + +User: + +```js +{ + username: "fcc_test", + _id: "5fb5853f734231456ccb3b05" +} +``` + +Log: + +```js +{ + username: "fcc_test", + count: 1, + _id: "5fb5853f734231456ccb3b05", + log: [{ + description: "test", + duration: 60, + date: "Mon Jan 01 1990", + }] +} +``` + +**Hint:** For the `date` property, the `toDateString` method of the `Date` API can be used to achieve the expected output. + +# --hints-- + +You should provide your own project, not the example URL. + +```js +(getUserInput) => { + const url = getUserInput('url'); + assert( + !/.*\/exercise-tracker\.freecodecamp\.rocks/.test(getUserInput('url')) + ); +}; +``` + +You can `POST` to `/api/users` with form data `username` to create a new user. + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `username=fcc_test_${Date.now()}`.substring(0, 29) + }); + assert.isTrue(res.ok); + if(!res.ok) { + throw new Error(`${res.status} ${res.statusText}`) + }; +}; +``` + +The returned response from `POST /api/users` with form data `username` will be an object with `username` and `_id` properties. + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `username=fcc_test_${Date.now()}`.substring(0, 29) + }); + if (res.ok) { + const { _id, username } = await res.json(); + assert.exists(_id); + assert.exists(username); + } else { + throw new Error(`${res.status} ${res.statusText}`); + } +}; +``` + +You can make a `GET` request to `/api/users` to get a list of all users. + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users'); + assert.isTrue(res.ok); + if(!res.ok) { + throw new Error(`${res.status} ${res.statusText}`) + }; +}; +``` + +The `GET` request to `/api/users` returns an array. + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users'); + if(res.ok){ + const users = await res.json(); + assert.isArray(users); + } else { + throw new Error(`${res.status} ${res.statusText}`); + }; +}; +``` + +Each element in the array returned from `GET /api/users` is an object literal containing a user's `username` and `_id`. + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users'); + if(res.ok){ + const users = await res.json(); + const user = users[0]; + assert.exists(user); + assert.exists(user.username); + assert.exists(user._id); + assert.isString(user.username); + assert.isString(user._id); + } else { + throw new Error(`${res.status} ${res.statusText}`); + }; +}; +``` + +You can `POST` to `/api/users/:_id/exercises` with form data `description`, `duration`, and optionally `date`. If no date is supplied, the current date will be used. + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `username=fcc_test_${Date.now()}`.substring(0, 29) + }); + if (res.ok) { + const { _id, username } = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: 'Mon Jan 01 1990' + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `description=${expected.description}&duration=${expected.duration}&date=1990-01-01` + }); + assert.isTrue(addRes.ok); + if(!addRes.ok) { + throw new Error(`${addRes.status} ${addRes.statusText}`) + }; + } else { + throw new Error(`${res.status} ${res.statusText}`); + } +}; +``` + +The response returned from `POST /api/users/:_id/exercises` will be the user object with the exercise fields added. + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `username=fcc_test_${Date.now()}`.substring(0, 29) + }); + if (res.ok) { + const { _id, username } = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: 'Mon Jan 01 1990' + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `description=${expected.description}&duration=${expected.duration}&date=1990-01-01` + }); + if (addRes.ok) { + const actual = await addRes.json(); + assert.deepEqual(actual, expected); + assert.isString(actual.description); + assert.isNumber(actual.duration); + assert.isString(actual.date); + } else { + throw new Error(`${addRes.status} ${addRes.statusText}`); + } + } else { + throw new Error(`${res.status} ${res.statusText}`); + } +}; +``` + +You can make a `GET` request to `/api/users/:_id/logs` to retrieve a full exercise log of any user. + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `username=fcc_test_${Date.now()}`.substring(0, 29) + }); + if (res.ok) { + const { _id, username } = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: new Date().toDateString() + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `description=${expected.description}&duration=${expected.duration}` + }); + if (addRes.ok) { + const logRes = await fetch(url + `/api/users/${_id}/logs`); + assert.isTrue(logRes.ok); + if(!logRes.ok) { + throw new Error(`${logRes.status} ${logRes.statusText}`) + }; + } else { + throw new Error(`${addRes.status} ${addRes.statusText}`); + } + } else { + throw new Error(`${res.status} ${res.statusText}`); + } +}; +``` + +A request to a user's log `GET /api/users/:_id/logs` returns a user object with a `count` property representing the number of exercises that belong to that user. + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `username=fcc_test_${Date.now()}`.substring(0, 29) + }); + if (res.ok) { + const { _id, username } = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: new Date().toDateString() + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `description=${expected.description}&duration=${expected.duration}` + }); + if (addRes.ok) { + const logRes = await fetch(url + `/api/users/${_id}/logs`); + if (logRes.ok) { + const { count } = await logRes.json(); + assert(count); + } else { + throw new Error(`${logRes.status} ${logRes.statusText}`); + } + } else { + throw new Error(`${addRes.status} ${addRes.statusText}`); + } + } else { + throw new Error(`${res.status} ${res.statusText}`); + } +}; +``` + +A `GET` request to `/api/users/:_id/logs` will return the user object with a `log` array of all the exercises added. + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded' + }, + body: `username=fcc_test_${Date.now()}`.substring(0, 29) + }) + if(res.ok){ + const {_id, username} = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: new Date().toDateString() + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `description=${expected.description}&duration=${expected.duration}` + }); + if(addRes.ok){ + const logRes = await fetch(url + `/api/users/${_id}/logs`); + if(logRes.ok) { + const {log} = await logRes.json(); + assert.isArray(log); + assert.equal(1, log.length); + } else { + throw new Error(`${logRes.status} ${logRes.statusText}`); + } + } else { + throw new Error(`${addRes.status} ${addRes.statusText}`); + }; + } else { + throw new Error(`${res.status} ${res.statusText}`) + }; +}; +``` + +Each item in the `log` array that is returned from `GET /api/users/:_id/logs` is an object that should have a `description`, `duration`, and `date` properties. + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + `/api/users`, { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded' + }, + body: `username=fcc_test_${Date.now()}`.substring(0, 29) + }); + if(res.ok) { + const {_id, username} = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: new Date().toDateString() + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `description=${expected.description}&duration=${expected.duration}` + }); + if(addRes.ok) { + const logRes = await fetch(url + `/api/users/${_id}/logs`); + if(logRes.ok) { + const {log} = await logRes.json(); + const exercise = log[0]; + assert.exists(exercise); + assert.exists(exercise.description); + assert.exists(exercise.duration); + assert.exists(exercise.date); + } else { + throw new Error(`${logRes.status} ${logRes.statusText}`); + }; + } else { + throw new Error(`${addRes.status} ${addRes.statusText}`); + }; + } else { + throw new Error(`${res.status} ${res.statusText}`) + }; +}; +``` + +The `description` property of any object in the `log` array that is returned from `GET /api/users/:_id/logs` should be a string. + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + body: `username=fcc_test_${Date.now()}`.substring(0,29) + }); + if(res.ok) { + const {_id, username} = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: new Date().toDateString() + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + body: `description=${expected.description}&duration=${expected.duration}` + }); + if(addRes.ok) { + const logRes = await fetch(url + `/api/users/${_id}/logs`); + if(logRes.ok){ + const {log} = await logRes.json(); + const exercise = log[0]; + assert.isString(exercise.description); + assert.equal(exercise.description, expected.description); + } else { + throw new Error(`${logRes.status} ${logRes.statusText}`); + } + } else { + throw new Error(`${addRes.status} ${addRes.statusText}`); + }; + } else { + throw new Error(`${res.status} ${res.statusText}`); + }; +}; +``` + +The `duration` property of any object in the `log` array that is returned from `GET /api/users/:_id/logs` should be a number. + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + body: `username=fcc_test_${Date.now()}`.substring(0,29) + }); + if(res.ok) { + const {_id, username} = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: new Date().toDateString() + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + body: `description=${expected.description}&duration=${expected.duration}` + }); + if(addRes.ok) { + const logRes = await fetch(url + `/api/users/${_id}/logs`); + if(logRes.ok){ + const {log} = await logRes.json(); + const exercise = log[0]; + assert.isNumber(exercise.duration); + assert.equal(exercise.duration, expected.duration); + } else { + throw new Error(`${logRes.status} ${logRes.statusText}`); + } + } else { + throw new Error(`${addRes.status} ${addRes.statusText}`); + }; + } else { + throw new Error(`${res.status} ${res.statusText}`); + }; +}; +``` + +The `date` property of any object in the `log` array that is returned from `GET /api/users/:_id/logs` should be a string. Use the `dateString` format of the `Date` API. + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + body: `username=fcc_test_${Date.now()}`.substring(0,29) + }); + if(res.ok) { + const {_id, username} = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: new Date().toLocaleDateString("en-US", { + timeZone: "UTC", weekday: "short", month: "short", + day: "2-digit", year: "numeric" + }).replaceAll(',', '') + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + body: `description=${expected.description}&duration=${expected.duration}` + }); + if(addRes.ok) { + const logRes = await fetch(url + `/api/users/${_id}/logs`); + if(logRes.ok){ + const {log} = await logRes.json(); + const exercise = log[0]; + assert.isString(exercise.date); + assert.equal(exercise.date, expected.date); + } else { + throw new Error(`${logRes.status} ${logRes.statusText}`); + } + } else { + throw new Error(`${addRes.status} ${addRes.statusText}`); + }; + } else { + throw new Error(`${res.status} ${res.statusText}`); + }; +}; +``` + +You can add `from`, `to` and `limit` parameters to a `GET /api/users/:_id/logs` request to retrieve part of the log of any user. `from` and `to` are dates in `yyyy-mm-dd` format. `limit` is an integer of how many logs to send back. + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `username=fcc_test_${Date.now()}`.substring(0, 29) + }); + if (res.ok) { + const { _id, username } = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: new Date().toDateString() + }; + const addExerciseRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `description=${expected.description}&duration=${expected.duration}&date=1990-01-01` + }); + const addExerciseTwoRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `description=${expected.description}&duration=${expected.duration}&date=1990-01-03` + }); + if (addExerciseRes.ok && addExerciseTwoRes.ok) { + const logRes = await fetch( + url + `/api/users/${_id}/logs?from=1989-12-31&to=1990-01-04` + ); + if (logRes.ok) { + const { log } = await logRes.json(); + assert.isArray(log); + assert.equal(2, log.length); + } else { + throw new Error(`${logRes.status} ${logRes.statusText}`); + } + const limitRes = await fetch( + url + `/api/users/${_id}/logs?limit=1` + ); + if (limitRes.ok) { + const { log } = await limitRes.json(); + assert.isArray(log); + assert.equal(1, log.length); + } else { + throw new Error(`${limitRes.status} ${limitRes.statusText}`); + } + const filterDateBeforeLimitRes = await fetch( + url + `/api/users/${_id}/logs?from=1990-01-02&to=1990-01-04&limit=1` + ); + if (filterDateBeforeLimitRes.ok) { + const { log } = await filterDateBeforeLimitRes.json(); + assert.isArray(log); + assert.equal(1, log.length); + } else { + throw new Error(`${filterDateBeforeLimitRes.status} ${filterDateBeforeLimitRes.statusText}`); + } + } else { + throw new Error(`${res.status} ${res.statusText}`); + } + } else { + throw new Error(`${res.status} ${res.statusText}`); + } +}; +``` diff --git a/curriculum/challenges/espanol/25-front-end-development/lab-number-guessing-game/602da04c22201c65d2a019f4.md b/curriculum/challenges/espanol/25-front-end-development/lab-number-guessing-game/602da04c22201c65d2a019f4.md new file mode 100644 index 0000000000..ef87dc6720 --- /dev/null +++ b/curriculum/challenges/espanol/25-front-end-development/lab-number-guessing-game/602da04c22201c65d2a019f4.md @@ -0,0 +1,25 @@ +--- +id: 602da04c22201c65d2a019f4 +title: Build a Number Guessing Game +challengeType: 13 +url: freeCodeCamp/learn-number-guessing-game +dashedName: lab-number-guessing-game +--- + +# --description-- + +For this lab, you will use Bash scripting, PostgreSQL, and Git to create a number guessing game that runs in the terminal and saves user information. + +# --instructions-- + +**Important:** After you pass all the project tests, save a dump of your database into a `number_guess.sql` file, as well as your `number_guess.sh` file, so you can complete step 2. There will be instructions on how to do that within the virtual machine. + +# --notes-- + +Required files: `number_guess.sql`, `number_guess.sh` + +# --hints-- + +# --seed-- + +# --solutions-- diff --git a/curriculum/challenges/espanol/25-front-end-development/lab-request-header-parser-microservice/bd7158d8c443edefaeb5bdff.md b/curriculum/challenges/espanol/25-front-end-development/lab-request-header-parser-microservice/bd7158d8c443edefaeb5bdff.md new file mode 100644 index 0000000000..5040e27424 --- /dev/null +++ b/curriculum/challenges/espanol/25-front-end-development/lab-request-header-parser-microservice/bd7158d8c443edefaeb5bdff.md @@ -0,0 +1,65 @@ +--- +id: bd7158d8c443edefaeb5bdff +title: Build a Request Header Parser Microservice +challengeType: 4 +dashedName: lab-request-header-parser-microservice +--- + +# --description-- + +Build a full stack JavaScript app that is functionally similar to this: https://request-header-parser-microservice.freecodecamp.rocks/. Working on this project will involve you writing your code using one of the following methods: + +- Clone this GitHub repo and complete your project locally. +- Use our Gitpod starter project to complete your project. +- Use a site builder of your choice to complete the project. Be sure to incorporate all the files from our GitHub repo. + +# --hints-- + +You should provide your own project, not the example URL. + +```js +(getUserInput) => { + assert( + !/.*\/request-header-parser-microservice\.freecodecamp\.rocks/.test( + getUserInput('url') + ) + ); +}; +``` + +A request to `/api/whoami` should return a JSON object with your IP address in the `ipaddress` key. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/api/whoami').then( + (data) => assert(data.ipaddress && data.ipaddress.length > 0), + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + +A request to `/api/whoami` should return a JSON object with your preferred language in the `language` key. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/api/whoami').then( + (data) => assert(data.language && data.language.length > 0), + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + +A request to `/api/whoami` should return a JSON object with your software in the `software` key. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/api/whoami').then( + (data) => assert(data.software && data.software.length > 0), + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/espanol/25-front-end-development/lab-url-shortener-microservice/bd7158d8c443edefaeb5bd0e.md b/curriculum/challenges/espanol/25-front-end-development/lab-url-shortener-microservice/bd7158d8c443edefaeb5bd0e.md new file mode 100644 index 0000000000..0fbf80a0bf --- /dev/null +++ b/curriculum/challenges/espanol/25-front-end-development/lab-url-shortener-microservice/bd7158d8c443edefaeb5bd0e.md @@ -0,0 +1,107 @@ +--- +id: bd7158d8c443edefaeb5bd0e +title: URL Shortener Microservice +challengeType: 4 +dashedName: url-shortener-microservice +--- + +# --description-- + +Build a full stack JavaScript app that is functionally similar to this: https://url-shortener-microservice.freecodecamp.rocks. Working on this project will involve you writing your code using one of the following methods: + +- Clone this GitHub repo and complete your project locally. +- Use our Gitpod starter project to complete your project. +- Use a site builder of your choice to complete the project. Be sure to incorporate all the files from our GitHub repo. + +# --instructions-- + +**HINT:** Do not forget to use a body parsing middleware to handle the POST requests. Also, you can use the function `dns.lookup(host, cb)` from the `dns` core module to verify a submitted URL. + +# --hints-- + +You should provide your own project, not the example URL. + +```js +(getUserInput) => { + assert( + !/.*\/url-shortener-microservice\.freecodecamp\.rocks/.test( + getUserInput('url') + ) + ); +}; +``` + +You can POST a URL to `/api/shorturl` and get a JSON response with `original_url` and `short_url` properties. Here's an example: `{ original_url : 'https://freeCodeCamp.org', short_url : 1}` + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const urlVariable = Date.now(); + const fullUrl = `${url}/?v=${urlVariable}` + const res = await fetch(url + '/api/shorturl', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `url=${fullUrl}` + }); + if (res.ok) { + const { short_url, original_url } = await res.json(); + assert.isNotNull(short_url); + assert.strictEqual(original_url, `${url}/?v=${urlVariable}`); + } else { + throw new Error(`${res.status} ${res.statusText}`); + } +}; +``` + +When you visit `/api/shorturl/`, you will be redirected to the original URL. + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const urlVariable = Date.now(); + const fullUrl = `${url}/?v=${urlVariable}` + let shortenedUrlVariable; + const postResponse = await fetch(url + '/api/shorturl', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `url=${fullUrl}` + }); + if (postResponse.ok) { + const { short_url } = await postResponse.json(); + shortenedUrlVariable = short_url; + } else { + throw new Error(`${postResponse.status} ${postResponse.statusText}`); + } + const getResponse = await fetch( + url + '/api/shorturl/' + shortenedUrlVariable + ); + if (getResponse) { + const { redirected, url } = getResponse; + assert.isTrue(redirected); + assert.strictEqual(url,fullUrl); + } else { + throw new Error(`${getResponse.status} ${getResponse.statusText}`); + } +}; +``` + +If you pass an invalid URL that doesn't follow the valid `http://www.example.com` format, the JSON response will contain `{ error: 'invalid url' }` + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/shorturl', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `url=ftp:/john-doe.invalidTLD` + }); + if (res.ok) { + const { error } = await res.json(); + assert.isNotNull(error); + assert.strictEqual(error.toLowerCase(), 'invalid url'); + } else { + throw new Error(`${res.status} ${res.statusText}`); + } +}; +``` + diff --git a/curriculum/challenges/espanol/25-front-end-development/lab-world-cup-database/5f9771307d4d22b9d2b75a94.md b/curriculum/challenges/espanol/25-front-end-development/lab-world-cup-database/5f9771307d4d22b9d2b75a94.md new file mode 100644 index 0000000000..d77442a1ba --- /dev/null +++ b/curriculum/challenges/espanol/25-front-end-development/lab-world-cup-database/5f9771307d4d22b9d2b75a94.md @@ -0,0 +1,25 @@ +--- +id: 5f9771307d4d22b9d2b75a94 +title: Build a World Cup Database +challengeType: 13 +url: freeCodeCamp/learn-world-cup-database +dashedName: lab-world-cup-database +--- + +# --description-- + +For this project, you will create a Bash script that enters information from World Cup games into PostgreSQL, then query the database for useful statistics. + +# --instructions-- + +**Important:** After you pass all the project tests, save a dump of your database into a `worldcup.sql` file, as well as your `insert_data.sh` and `queries.sh` files, so you can complete step 2. There will be instructions how to do that within the virtual machine. + +# --notes-- + +Required files: `worldcup.sql`, `insert_data.sh`, `queries.sh` + +# --hints-- + +# --seed-- + +# --solutions-- diff --git a/curriculum/challenges/espanol/25-front-end-development/workshop-hotel-feedback-form/66a96127422411756204bc1b.md b/curriculum/challenges/espanol/25-front-end-development/workshop-hotel-feedback-form/66a96127422411756204bc1b.md index 51ea9e3069..753ee1a6bb 100644 --- a/curriculum/challenges/espanol/25-front-end-development/workshop-hotel-feedback-form/66a96127422411756204bc1b.md +++ b/curriculum/challenges/espanol/25-front-end-development/workshop-hotel-feedback-form/66a96127422411756204bc1b.md @@ -7,9 +7,9 @@ dashedName: step-22 # --description-- -Add another label with the text of `Personal Recommendation`. The `for` attribute should be set to `"recommendation"`. +Add another `label` with the text of `Personal Recommendation`. The `for` attribute should be set to `"recommendation"`. -Below the label element, add another checkbox input with the `id`, `name` and `value` attributes set to `"recommendation"`. +Below the `label` element, add another checkbox `input` with the `id`, `name` and `value` attributes set to `"recommendation"`. # --hints-- diff --git a/curriculum/challenges/espanol/25-front-end-development/workshop-hotel-feedback-form/66a962954f4e0d76223b37ed.md b/curriculum/challenges/espanol/25-front-end-development/workshop-hotel-feedback-form/66a962954f4e0d76223b37ed.md index 42c425209d..80a23ca86d 100644 --- a/curriculum/challenges/espanol/25-front-end-development/workshop-hotel-feedback-form/66a962954f4e0d76223b37ed.md +++ b/curriculum/challenges/espanol/25-front-end-development/workshop-hotel-feedback-form/66a962954f4e0d76223b37ed.md @@ -11,7 +11,7 @@ Next, add another `label` element with the text of `Location` and the `for` attr For the checkbox `input`, both the `id`, `name` and `value` attributes should be set to `"location"`. -Below that `input` element, add another `label` element with the text of `Reputation` and the for attribute set to `"reputation"`. +Below that `input` element, add another `label` element with the text of `Reputation` and the `for` attribute set to `"reputation"`. For the checkbox `input`, both the `id`, `name` and `value` attributes should be set to `"reputation"`. diff --git a/curriculum/challenges/espanol/25-front-end-development/workshop-hotel-feedback-form/66a972137acd1179fa3fe8a0.md b/curriculum/challenges/espanol/25-front-end-development/workshop-hotel-feedback-form/66a972137acd1179fa3fe8a0.md index 69efa4832c..09e3e6e59b 100644 --- a/curriculum/challenges/espanol/25-front-end-development/workshop-hotel-feedback-form/66a972137acd1179fa3fe8a0.md +++ b/curriculum/challenges/espanol/25-front-end-development/workshop-hotel-feedback-form/66a972137acd1179fa3fe8a0.md @@ -7,7 +7,7 @@ dashedName: step-28 # --description-- -Inside your `select` element, add the following five `option` elements with these corresponding values for the option text and `value` attribute: +Inside your `select` element, add the following five `option` elements with these corresponding values for the `option` text and `value` attribute: **Value Attributes:** diff --git a/curriculum/challenges/espanol/25-front-end-development/workshop-hotel-feedback-form/66a97ca8c4cbae7d0bb6e0ad.md b/curriculum/challenges/espanol/25-front-end-development/workshop-hotel-feedback-form/66a97ca8c4cbae7d0bb6e0ad.md index 6549345d45..22b9a707be 100644 --- a/curriculum/challenges/espanol/25-front-end-development/workshop-hotel-feedback-form/66a97ca8c4cbae7d0bb6e0ad.md +++ b/curriculum/challenges/espanol/25-front-end-development/workshop-hotel-feedback-form/66a97ca8c4cbae7d0bb6e0ad.md @@ -7,7 +7,7 @@ dashedName: step-31 # --description-- -Inside your `select` element, add the following five `option` elements with these corresponding values for the option text and `value` attribute: +Inside your `select` element, add the following five `option` elements with these corresponding values for the `option` text and `value` attribute: **Value Attribute:** diff --git a/curriculum/challenges/espanol/25-front-end-development/workshop-loan-qualification-checker/66c8ba41a77db20a93f9d7a1.md b/curriculum/challenges/espanol/25-front-end-development/workshop-loan-qualification-checker/66c8ba41a77db20a93f9d7a1.md new file mode 100644 index 0000000000..237515fd88 --- /dev/null +++ b/curriculum/challenges/espanol/25-front-end-development/workshop-loan-qualification-checker/66c8ba41a77db20a93f9d7a1.md @@ -0,0 +1,71 @@ +--- +id: 66c8ba41a77db20a93f9d7a1 +title: Step 1 +challengeType: 1 +dashedName: step-1 +--- + +# --description-- + +In this workshop, you'll review JavaScript conditionals by building a loan qualification checker app. + +The app will check whether the user is eligible for a duplex, car, and condo loan based on their annual income and credit score. A credit score is a number that represents how good you are at managing borrowed money. + +To get started, create the following variables and values. + +| Variable Name | Value | +| ------------------------- | ------- | +| `minIncomeForDuplex` | `60000` | +| `minCreditScoreForDuplex` | `700` | +| `minIncomeForCondo` | `45000` | +| `minCreditScoreForCondo` | `680` | +| `minIncomeForCar` | `30000` | +| `minCreditScoreForCar` | `650` | + +# --hints-- + +You should create a `minIncomeForDuplex` variable set to `60000`. + +```js +assert.equal(minIncomeForDuplex, 60000); +``` + +You should create a `minCreditScoreForDuplex` set to `700`. + +```js +assert.equal(minCreditScoreForDuplex, 700); +``` + +You should create a `minIncomeForCar` variable set to `30000`. + +```js +assert.equal(minIncomeForCar, 30000); +``` + +You should create a `minCreditScoreForCar` variable set to `650`. + +```js +assert.equal(minCreditScoreForCar, 650); +``` + +You should create a `minIncomeForCondo` variable set to `45000`. + +```js +assert.equal(minIncomeForCondo, 45000); +``` + +You should create a `minCreditScoreForCondo` variable set to `680`. + +```js +assert.equal(minCreditScoreForCondo, 680); +``` + +# --seed-- + +## --seed-contents-- + +```js +--fcc-editable-region-- + +--fcc-editable-region-- +``` diff --git a/curriculum/challenges/espanol/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4ac.md b/curriculum/challenges/espanol/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4ac.md new file mode 100644 index 0000000000..7755f823c4 --- /dev/null +++ b/curriculum/challenges/espanol/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4ac.md @@ -0,0 +1,53 @@ +--- +id: 66c8ba975ee7230e29f6c4ac +title: Step 2 +challengeType: 1 +dashedName: step-2 +--- + +# --description-- + +When the user is eligible for a loan, you'll want to display a message to them in the console. + +For that, you'll build out a function inside which you'll have some checks that'll return what loan the applicant is eligible for. + +Create an empty `getLoanMessage` function with an `annualIncome` and `creditScore` parameters. + +# --hints-- + +You should create a `getLoanMessage` function + +```js +assert.isFunction(getLoanMessage) +``` + +Your `getLoanMessage` function should have an `annualIncome` and `creditScore` as parameters. + +```js +assert.match(getLoanMessage?.toString(), /\(\s*annualIncome,\s*creditScore\s*\)|\(\s*creditScore,\s*annualIncome\s*\)/); +``` + +`getLoanMessage` should be an empty function. + +```js +assert.match(getLoanMessage?.toString(), /\{\s*\}/); +``` + +# --seed-- + +## --seed-contents-- + +```js +const minIncomeForDuplex = 60000; +const minCreditScoreForDuplex = 700; + +const minIncomeForCondo = 45000; +const minCreditScoreForCondo = 680; + +const minIncomeForCar = 30000; +const minCreditScoreForCar = 650; + +--fcc-editable-region-- + +--fcc-editable-region-- +``` diff --git a/curriculum/challenges/espanol/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4ad.md b/curriculum/challenges/espanol/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4ad.md new file mode 100644 index 0000000000..82a29d7cd9 --- /dev/null +++ b/curriculum/challenges/espanol/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4ad.md @@ -0,0 +1,55 @@ +--- +id: 66c8ba975ee7230e29f6c4ad +title: Step 3 +challengeType: 1 +dashedName: step-3 +--- + +# --description-- + +To check which loan a user is qualified for based on the `annualIncome` and `creditScore`, you have to use `if/else if` statement or a ternary right inside the `getLoanMessage` function. You'll then return the appropraite message in the block of each condition. + +Starting with the duplex loan, check if `annualIncome` is greater than or equal to `minIncomeForDuplex` AND if `creditScore` is greater than `minCreditScoreForDuplex`. + +If that condition is true, then the applicant is eligible for a duplex loan and the other loans. So, inside the check, return the string `"You qualify for a car, duplex and Condo loan."` + +# --hints-- + +Your `getLoanMessage` function should return a string. + +```js +assert.isString(getLoanMessage(65000, 750)); +``` + +Your `getLoanMessage` function should return the string `"You qualify for a duplex, condo, and car loan."`. + +```js +assert.strictEqual(getLoanMessage(65000, 750), "You qualify for a duplex, condo, and car loan."); +``` + +Your `getLoanMessage` function should return `undefined` if the applicant's annual income and credit score do not meet the requirements for a duplex loan. + +```js +assert.strictEqual(getLoanMessage(59000, 700), undefined); +``` + +# --seed-- + +## --seed-contents-- + +```js +const minIncomeForDuplex = 60000; +const minCreditScoreForDuplex = 700; + +const minIncomeForCondo = 45000; +const minCreditScoreForCondo = 680; + +const minIncomeForCar = 30000; +const minCreditScoreForCar = 650; + +--fcc-editable-region-- +function getLoanMessage(annualIncome, creditScore) { + +} +--fcc-editable-region-- +``` diff --git a/curriculum/challenges/espanol/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4af.md b/curriculum/challenges/espanol/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4af.md new file mode 100644 index 0000000000..638e6291a4 --- /dev/null +++ b/curriculum/challenges/espanol/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4af.md @@ -0,0 +1,56 @@ +--- +id: 66c8ba975ee7230e29f6c4af +title: Step 4 +challengeType: 1 +dashedName: step-4 +--- + +# --description-- + +If the applicant's annual income is greater than or equal to `minIncomeForCondo`, AND if their credit score is greater than or equal to `minCreditScoreForCondo`, then they qualify for a condo and car loan. + +Check if that's true in the `getLoanMessage` function. If it is, return the string `"You qualify for a condo and car loan."` + +# --hints-- + +Your `getLoanMessage` function should return a string if the applicant qualifies for a condo and car loan. + +```js +assert.isString(getLoanMessage(45000, 680)); +``` + +Your `getLoanMessage` function should return the string `"You qualify for a condo and car loan."`. + +```js +assert.strictEqual(getLoanMessage(45000, 680), "You qualify for a condo and car loan."); +``` + +Your `getLoanMessage` function should return `undefined` if the applicant's annual income and credit score do not meet the requirements for a condo loan. + +```js +assert.strictEqual(getLoanMessage(45000, 650), undefined); +``` + +# --seed-- + +## --seed-contents-- + +```js +const minIncomeForDuplex = 60000; +const minCreditScoreForDuplex = 700; + +const minIncomeForCondo = 45000; +const minCreditScoreForCondo = 680; + +const minIncomeForCar = 30000; +const minCreditScoreForCar = 650; + +function getLoanMessage(annualIncome, creditScore) { + if(creditScore >= minCreditScoreForDuplex && annualIncome >= minIncomeForDuplex) { + return "You qualify for a duplex, condo, and car loan." +--fcc-editable-region-- + } + +--fcc-editable-region-- +} +``` diff --git a/curriculum/challenges/espanol/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b0.md b/curriculum/challenges/espanol/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b0.md new file mode 100644 index 0000000000..374ba7b8fe --- /dev/null +++ b/curriculum/challenges/espanol/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b0.md @@ -0,0 +1,56 @@ +--- +id: 66c8ba975ee7230e29f6c4b0 +title: Step 5 +challengeType: 1 +dashedName: step-5 +--- + +# --description-- + +Now, you should check if the applicant is qualified for a car loan only. If they're, return the string `"You qualify for a car loan."`. + +# --hints-- + +Your `getLoanMessage` function should return a string if the applicant qualifies for a car loan. + +```js +assert.isString(getLoanMessage(30000, 650)); +``` + +Your `getLoanMessage` function should return the string `"You qualify for a car loan."`. + +```js +assert.strictEqual(getLoanMessage(30000, 650), "You qualify for a car loan."); +``` + +Your `getLoanMessage` function should return `undefined` if the applicant's annual income and credit score do not meet the requirements for a car loan. + +```js +assert.strictEqual(getLoanMessage(30000, 600), undefined); +``` + +# --seed-- + +## --seed-contents-- + +```js +const minIncomeForDuplex = 60000; +const minCreditScoreForDuplex = 700; + +const minIncomeForCondo = 45000; +const minCreditScoreForCondo = 680; + +const minIncomeForCar = 30000; +const minCreditScoreForCar = 650; + +function getLoanMessage(annualIncome, creditScore) { + if(creditScore >= minCreditScoreForDuplex && annualIncome >= minIncomeForDuplex) { + return "You qualify for a duplex, condo, and car loan." + } else if (annualIncome >= minIncomeForCondo && creditScore >= minCreditScoreForCondo) { + return "You qualify for a condo and car loan." +--fcc-editable-region-- + } + +--fcc-editable-region-- +} +``` diff --git a/curriculum/challenges/espanol/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b1.md b/curriculum/challenges/espanol/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b1.md new file mode 100644 index 0000000000..16e8c7baca --- /dev/null +++ b/curriculum/challenges/espanol/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b1.md @@ -0,0 +1,54 @@ +--- +id: 66c8ba975ee7230e29f6c4b1 +title: Step 6 +challengeType: 1 +dashedName: step-6 +--- + +# --description-- + +If the applicant's annual income and credit score fall below `minIncomeForCar` and `minCreditScoreForCar`, then they don't qualify for any loan. So, return the string `"You don't qualify for any loans."` + +# --hints-- + +Your `getLoanMessage` function should return a string if the applicant doesn't qualify for any loan. + +```js +assert.isString(getLoanMessage(25000, 550)); +``` + +Your `getLoanMessage` function should return the string `"You don't qualify for any loans."` if the applicant does not meet the requirements for any loan. + +```js +assert.strictEqual(getLoanMessage(15000, 600), "You don't qualify for any loans."); +assert.strictEqual(getLoanMessage(25000, 550), "You don't qualify for any loans."); +assert.strictEqual(getLoanMessage(20000, 500), "You don't qualify for any loans."); +``` + +# --seed-- + +## --seed-contents-- + +```js +const minIncomeForDuplex = 60000; +const minCreditScoreForDuplex = 700; + +const minIncomeForCondo = 45000; +const minCreditScoreForCondo = 680; + +const minIncomeForCar = 30000; +const minCreditScoreForCar = 650; + +function getLoanMessage(annualIncome, creditScore) { + if(creditScore >= minCreditScoreForDuplex && annualIncome >= minIncomeForDuplex) { + return "You qualify for a duplex, condo, and car loan." + } else if (annualIncome >= minIncomeForCondo && creditScore >= minCreditScoreForCondo) { + return "You qualify for a condo and car loan." + } else if (annualIncome >= minIncomeForCar && creditScore >= minCreditScoreForCar) { + return "You qualify for a car loan." +--fcc-editable-region-- + } + +--fcc-editable-region-- +} +``` diff --git a/curriculum/challenges/espanol/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b2.md b/curriculum/challenges/espanol/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b2.md new file mode 100644 index 0000000000..9d19f9ea4c --- /dev/null +++ b/curriculum/challenges/espanol/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b2.md @@ -0,0 +1,165 @@ +--- +id: 66c8ba975ee7230e29f6c4b2 +title: Step 7 +challengeType: 1 +dashedName: step-7 +--- + +# --description-- + +Now, it is time to test out your `getLoanMessage` function. + +Use the table below to create `4` variables and their values: + +| Variable Name | Value | +| --------------- | ---------------------------- | +| `duplexLoanMsg` | `getLoanMessage(85000, 850)` | +| `condoLoanMsg` | `getLoanMessage(65000, 690)` | +| `carLoanMsg` | `getLoanMessage(45000, 660)` | +| `noLoanMsg` | `getLoanMessage(25000, 550)` | + +After that, log each variable to the console to see the messages. + +With that, your loan qualification checker project is complete! + +# --hints-- + +You should have a variable called `duplexLoanMsg`. + +```js +assert.isNotNull(duplexLoanMsg); +``` + +Your `duplexLoanMsg` variable should be set to the result of `getLoanMessage(85000, 850)`. + +```js +assert.equal(duplexLoanMsg, getLoanMessage(85000, 850)); +``` + +You should log the `duplexLoanMsg` variable to the console. + +```js +assert.match(code, /console\.log\(duplexLoanMsg\)/) +``` + +You should have a variable called `condoLoanMsg`. + +```js +assert.isNotNull(condoLoanMsg); +``` + +Your `condoLoanMsg` variable should be set to the result of `getLoanMessage(65000, 690)`. + +```js +assert.equal(condoLoanMsg, getLoanMessage(65000, 690)); +``` + +You should log the `condoLoanMsg` variable to the console. + +```js +assert.match(code, /console\.log\(condoLoanMsg\)/) +``` + +You should have a variable called `carLoanMsg`. + +```js +assert.isNotNull(carLoanMsg); +``` + +Your `carLoanMsg` variable should be set to the result of `getLoanMessage(45000, 660)`. + +```js +assert.equal(carLoanMsg, getLoanMessage(45000, 660)); +``` + +You should log the `carLoanMsg` variable to the console. + +```js +assert.match(code, /console\.log\(carLoanMsg\)/) +``` + +You should have a variable called `noLoanMsg`. + +```js +assert.isNotNull(noLoanMsg); +``` + +Your `noLoanMsg` variable should be set to the result of `getLoanMessage(25000, 550)`. + +```js +assert.equal(noLoanMsg, getLoanMessage(25000, 550)); +``` + +You should log the `noLoanMsg` variable to the console. + +```js +assert.match(code, /console\.log\(noLoanMsg\)/) +``` + +# --seed-- + +## --seed-contents-- + +```js +const minIncomeForDuplex = 60000; +const minCreditScoreForDuplex = 700; + +const minIncomeForCondo = 45000; +const minCreditScoreForCondo = 680; + +const minIncomeForCar = 30000; +const minCreditScoreForCar = 650; + +function getLoanMessage(annualIncome, creditScore) { + if(creditScore >= minCreditScoreForDuplex && annualIncome >= minIncomeForDuplex) { + return "You qualify for a duplex, condo, and car loan." + } else if (annualIncome >= minIncomeForCondo && creditScore >= minCreditScoreForCondo) { + return "You qualify for a condo and car loan." + } else if (annualIncome >= minIncomeForCar && creditScore >= minCreditScoreForCar) { + return "You qualify for a car loan." + } else { + return "You don't qualify for any loans." + } +} + +--fcc-editable-region-- + +--fcc-editable-region-- +``` + +# --solutions-- + +```js +const minIncomeForDuplex = 60000; +const minCreditScoreForDuplex = 700; + +const minIncomeForCondo = 45000; +const minCreditScoreForCondo = 680; + +const minIncomeForCar = 30000; +const minCreditScoreForCar = 650; + +function getLoanMessage(annualIncome, creditScore) { + if(creditScore >= minCreditScoreForDuplex && annualIncome >= minIncomeForDuplex) { + return "You qualify for a duplex, condo, and car loan." + } else if (annualIncome >= minIncomeForCondo && creditScore >= minCreditScoreForCondo) { + return "You qualify for a condo and car loan." + } else if (annualIncome >= minIncomeForCar && creditScore >= minCreditScoreForCar) { + return "You qualify for a car loan." + } else { + return "You don't qualify for any loans." + } +} + +const duplexLoanMsg = getLoanMessage(85000, 850) +console.log(duplexLoanMsg) + +const condoLoanMsg = getLoanMessage(65000, 690) +console.log(condoLoanMsg) + +const carLoanMsg = getLoanMessage(45000, 660) +console.log(carLoanMsg) + +const noLoanMsg = getLoanMessage(25000, 550) +console.log(noLoanMsg) +``` diff --git a/curriculum/challenges/espanol/25-front-end-development/workshop-mario-database/5f2c289f164c29556da632fd.md b/curriculum/challenges/espanol/25-front-end-development/workshop-mario-database/5f2c289f164c29556da632fd.md new file mode 100644 index 0000000000..4e11751ca0 --- /dev/null +++ b/curriculum/challenges/espanol/25-front-end-development/workshop-mario-database/5f2c289f164c29556da632fd.md @@ -0,0 +1,19 @@ +--- +id: 5f2c289f164c29556da632fd +title: Build a Mario Database +challengeType: 12 +url: freeCodeCamp/learn-relational-databases-by-building-a-mario-database +dashedName: build-a-mario-database +--- + +# --description-- + +In this 165-lesson workshop, you will learn the basics of a relational database by creating a PostgreSQL database filled with video game characters. + +# --instructions-- + +# --hints-- + +# --seed-- + +# --solutions-- diff --git a/curriculum/challenges/espanol/25-front-end-development/workshop-npm-packages/587d7fb3367417b2b2512bfb.md b/curriculum/challenges/espanol/25-front-end-development/workshop-npm-packages/587d7fb3367417b2b2512bfb.md new file mode 100644 index 0000000000..8d4c90410d --- /dev/null +++ b/curriculum/challenges/espanol/25-front-end-development/workshop-npm-packages/587d7fb3367417b2b2512bfb.md @@ -0,0 +1,53 @@ +--- +id: 587d7fb3367417b2b2512bfb +title: How to Use package.json, the Core of Any Node.js Project or npm Package +challengeType: 2 +forumTopicId: 301528 +dashedName: how-to-use-package-json-the-core-of-any-node-js-project-or-npm-package +--- + +# --description-- + +Working on these challenges will involve you writing your code using one of the following methods: + +- Clone this GitHub repo and complete these challenges locally. +- Use our Gitpod starter project to complete these challenges. +- Use a site builder of your choice to complete the project. Be sure to incorporate all the files from our GitHub repo. + +The `package.json` file is the center of any Node.js project or npm package. It stores information about your project. It consists of a single JSON object where information is stored in key-value pairs. There are only two required fields; `name` and `version`, but it’s good practice to provide additional information. + +You can create the `package.json` file from the terminal using the `npm init` command. This will run a guided setup. Using `npm init` with the `-y` flag will generate the file without having it ask any questions, `npm init -y`. + +If you look at the file tree of your project, you will find the `package.json` file on the top level of the tree. This is the file that you will be improving in the next couple of challenges. + +One of the most common pieces of information in this file is the `author` field. It specifies who created the project, and can consist of a string or an object with contact or other details. An object is recommended for bigger projects, but a simple string like the following example will do for this project. + +```json +"author": "Jane Doe", +``` + +# --instructions-- + +Add your name as the `author` of the project in the `package.json` file. + +**Note:** Remember that you’re writing JSON, so all field names must use double-quotes (") and be separated with a comma (,). + +If you are using Gitpod, make sure the app is running and the preview window is open. Copy the preview window's URL and paste it into the Solution Link input below. + +# --hints-- + +`package.json` should have a valid "author" key + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert(packJson.author, '"author" is missing'); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/espanol/25-front-end-development/workshop-npm-packages/587d7fb3367417b2b2512bfc.md b/curriculum/challenges/espanol/25-front-end-development/workshop-npm-packages/587d7fb3367417b2b2512bfc.md new file mode 100644 index 0000000000..37d15d5261 --- /dev/null +++ b/curriculum/challenges/espanol/25-front-end-development/workshop-npm-packages/587d7fb3367417b2b2512bfc.md @@ -0,0 +1,43 @@ +--- +id: 587d7fb3367417b2b2512bfc +title: Add a Description to Your package.json +challengeType: 2 +forumTopicId: 301522 +dashedName: add-a-description-to-your-package-json +--- + +# --description-- + +The next part of a good package.json file is the `description` field; where a short, but informative description about your project belongs. + +If some day you plan to publish a package to npm, this is the string that should sell your idea to the user when they decide whether to install your package or not. However, that’s not the only use case for the description, it’s a great way to summarize what a project does. It’s just as important in any Node.js project to help other developers, future maintainers or even your future self understand the project quickly. + +Regardless of what you plan for your project, a description is definitely recommended. Here's an example: + +```json +"description": "A project that does something awesome", +``` + +# --instructions-- + +Add a `description` to the package.json file of your project. + +**Note:** Remember to use double-quotes for field-names (") and commas (,) to separate fields. + +# --hints-- + +package.json should have a valid "description" key + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert(packJson.description, '"description" is missing'); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/espanol/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bfd.md b/curriculum/challenges/espanol/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bfd.md new file mode 100644 index 0000000000..a001cdd477 --- /dev/null +++ b/curriculum/challenges/espanol/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bfd.md @@ -0,0 +1,75 @@ +--- +id: 587d7fb4367417b2b2512bfd +title: Add Keywords to Your package.json +challengeType: 2 +forumTopicId: 301526 +dashedName: add-keywords-to-your-package-json +--- + +# --description-- + +The `keywords` field is where you can describe your project using related keywords. Here's an example: + +```json +"keywords": [ "descriptive", "related", "words" ], +``` + +As you can see, this field is structured as an array of double-quoted strings. + +# --instructions-- + +Add an array of suitable strings to the `keywords` field in the package.json file of your project. + +One of the keywords should be "freecodecamp". + +# --hints-- + +package.json should have a valid "keywords" key + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert(packJson.keywords, '"keywords" is missing'); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + +"keywords" field should be an Array + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.isArray(packJson.keywords, '"keywords" is not an array'); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + +"keywords" should include "freecodecamp" + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.include( + packJson.keywords, + 'freecodecamp', + '"keywords" does not include "freecodecamp"' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/espanol/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bfe.md b/curriculum/challenges/espanol/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bfe.md new file mode 100644 index 0000000000..7b09acd042 --- /dev/null +++ b/curriculum/challenges/espanol/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bfe.md @@ -0,0 +1,39 @@ +--- +id: 587d7fb4367417b2b2512bfe +title: Add a License to Your package.json +challengeType: 2 +forumTopicId: 301523 +dashedName: add-a-license-to-your-package-json +--- + +# --description-- + +The `license` field is where you inform users of what they are allowed to do with your project. + +Some common licenses for open source projects include MIT and BSD. License information is not required, and copyright laws in most countries will give you ownership of what you create by default. However, it’s always a good practice to explicitly state what users can and can’t do. Here's an example of the license field: + +```json +"license": "MIT", +``` + +# --instructions-- + +Fill the `license` field in the package.json file of your project as you find suitable. + +# --hints-- + +package.json should have a valid "license" key + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert(packJson.license, '"license" is missing'); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/espanol/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bff.md b/curriculum/challenges/espanol/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bff.md new file mode 100644 index 0000000000..f2e571faed --- /dev/null +++ b/curriculum/challenges/espanol/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bff.md @@ -0,0 +1,37 @@ +--- +id: 587d7fb4367417b2b2512bff +title: Add a Version to Your package.json +challengeType: 2 +forumTopicId: 301525 +dashedName: add-a-version-to-your-package-json +--- + +# --description-- + +A `version` is one of the required fields of your package.json file. This field describes the current version of your project. Here's an example: + +```json +"version": "1.2.0", +``` + +# --instructions-- + +Add a `version` to the package.json file of your project. + +# --hints-- + +package.json should have a valid "version" key + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert(packJson.version, '"version" is missing'); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/espanol/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512c00.md b/curriculum/challenges/espanol/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512c00.md new file mode 100644 index 0000000000..161c60fe69 --- /dev/null +++ b/curriculum/challenges/espanol/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512c00.md @@ -0,0 +1,68 @@ +--- +id: 587d7fb4367417b2b2512c00 +title: Expand Your Project with External Packages from npm +challengeType: 2 +forumTopicId: 301527 +dashedName: expand-your-project-with-external-packages-from-npm +--- + +# --description-- + +One of the biggest reasons to use a package manager, is their powerful dependency management. Instead of manually having to make sure that you get all dependencies whenever you set up a project on a new computer, npm automatically installs everything for you. But how can npm know exactly what your project needs? Meet the `dependencies` section of your package.json file. + +In this section, packages your project requires are stored using the following format: + +```json +"dependencies": { + "package-name": "version", + "express": "4.14.0" +} + +``` + +# --instructions-- + +Add version `1.1.0` of the `@freecodecamp/example` package to the `dependencies` field of your `package.json` file. + +**Note:** `@freecodecamp/example` is a faux package used as a learning tool. + +# --hints-- + +`"dependencies"` should include `"@freecodecamp/example"`. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.property( + packJson.dependencies, + '@freecodecamp/example', + '"dependencies" does not include "@freecodecamp/example"' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + +`"@freecodecamp/example"` version should be `"1.1.0"`. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.match( + packJson.dependencies["@freecodecamp/example"], + /^[\^\~]?1\.1\.0/, + 'Wrong version of "@freecodecamp/example" installed. It should be 1.1.0' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/espanol/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c01.md b/curriculum/challenges/espanol/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c01.md new file mode 100644 index 0000000000..deda9b82de --- /dev/null +++ b/curriculum/challenges/espanol/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c01.md @@ -0,0 +1,64 @@ +--- +id: 587d7fb5367417b2b2512c01 +title: Manage npm Dependencies By Understanding Semantic Versioning +challengeType: 2 +forumTopicId: 301529 +dashedName: manage-npm-dependencies-by-understanding-semantic-versioning +--- + +# --description-- + +`Versions` of the npm packages in the dependencies section of your package.json file follow what’s called Semantic Versioning (SemVer), an industry standard for software versioning aiming to make it easier to manage dependencies. Libraries, frameworks or other tools published on npm should use SemVer in order to clearly communicate what kind of changes projects can expect if they update. + +Knowing SemVer can be useful when you develop software that uses external dependencies (which you almost always do). One day, your understanding of these numbers will save you from accidentally introducing breaking changes to your project without understanding why things that worked yesterday suddenly don’t work today. This is how Semantic Versioning works according to the official website: + +```json +"package": "MAJOR.MINOR.PATCH" +``` + +The MAJOR version should increment when you make incompatible API changes. The MINOR version should increment when you add functionality in a backwards-compatible manner. The PATCH version should increment when you make backwards-compatible bug fixes. This means that PATCHes are bug fixes and MINORs add new features but neither of them break what worked before. Finally, MAJORs add changes that won’t work with earlier versions. + +# --instructions-- + +In the dependencies section of your `package.json` file, change the version of `@freecodecamp/example` to match MAJOR version 1, MINOR version 2 and PATCH version 13 + +# --hints-- + +`"dependencies"` should include `"@freecodecamp/example"`. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.property( + packJson.dependencies, + '@freecodecamp/example', + '"dependencies" does not include "@freecodecamp/example"' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + +`"@freecodecamp/example"` version should be `"1.2.13"`. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.equal( + packJson.dependencies["@freecodecamp/example"], + '1.2.13', + 'Wrong version of "@freecodecamp/example". It should be 1.2.13' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/espanol/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c02.md b/curriculum/challenges/espanol/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c02.md new file mode 100644 index 0000000000..8eae5f51ee --- /dev/null +++ b/curriculum/challenges/espanol/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c02.md @@ -0,0 +1,66 @@ +--- +id: 587d7fb5367417b2b2512c02 +title: Use the Tilde-Character to Always Use the Latest Patch Version of a Dependency +challengeType: 2 +forumTopicId: 301532 +dashedName: use-the-tilde-character-to-always-use-the-latest-patch-version-of-a-dependency +--- + +# --description-- + +In the last challenge, you told npm to only include a specific version of a package. That’s a useful way to freeze your dependencies if you need to make sure that different parts of your project stay compatible with each other. But in most use cases, you don’t want to miss bug fixes since they often include important security patches and (hopefully) don’t break things in doing so. + +To allow an npm dependency to update to the latest PATCH version, you can prefix the dependency’s version with the tilde (`~`) character. Here's an example of how to allow updates to any `1.3.x` version. + +```json +"package": "~1.3.8" +``` + +# --instructions-- + +In the package.json file, your current rule for how npm may upgrade `@freecodecamp/example` is to use a specific version (`1.2.13`). But now, you want to allow the latest `1.2.x` version. + +Use the tilde (`~`) character to prefix the version of `@freecodecamp/example` in your dependencies, and allow npm to update it to any new _patch_ release. + +**Note:** The version numbers themselves should not be changed. + +# --hints-- + +`"dependencies"` should include `"@freecodecamp/example"`. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.property( + packJson.dependencies, + '@freecodecamp/example', + '"dependencies" does not include "@freecodecamp/example"' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + +`"@freecodecamp/example"` version should match `"~1.2.13"`. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.match( + packJson.dependencies["@freecodecamp/example"], + /^\~1\.2\.13/, + 'Wrong version of "@freecodecamp/example". It should be ~1.2.13' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/espanol/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c03.md b/curriculum/challenges/espanol/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c03.md new file mode 100644 index 0000000000..adc3014ea4 --- /dev/null +++ b/curriculum/challenges/espanol/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c03.md @@ -0,0 +1,66 @@ +--- +id: 587d7fb5367417b2b2512c03 +title: Use the Caret-Character to Use the Latest Minor Version of a Dependency +challengeType: 2 +forumTopicId: 301531 +dashedName: use-the-caret-character-to-use-the-latest-minor-version-of-a-dependency +--- + +# --description-- + +Similar to how the tilde we learned about in the last challenge allows npm to install the latest PATCH for a dependency, the caret (`^`) allows npm to install future updates as well. The difference is that the caret will allow both MINOR updates and PATCHes. + +Your current version of `@freecodecamp/example` should be `~1.2.13` which allows npm to install to the latest `1.2.x` version. If you were to use the caret (^) as a version prefix instead, npm would be allowed to update to any `1.x.x` version. + +```json +"package": "^1.3.8" +``` + +This would allow updates to any `1.x.x` version of the package. + +# --instructions-- + +Use the caret (`^`) to prefix the version of `@freecodecamp/example` in your dependencies and allow npm to update it to any new MINOR release. + +**Note:** The version numbers themselves should not be changed. + +# --hints-- + +`"dependencies"` should include `"@freecodecamp/example"`. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.property( + packJson.dependencies, + '@freecodecamp/example', + '"dependencies" does not include "@freecodecamp/example"' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + +`"@freecodecamp/example"` version should match `"^1.x.x"`. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.match( + packJson.dependencies["@freecodecamp/example"], + /^\^1\./, + 'Wrong version of "@freecodecamp/example". It should be ^1.2.13' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/espanol/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c04.md b/curriculum/challenges/espanol/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c04.md new file mode 100644 index 0000000000..5f695eed88 --- /dev/null +++ b/curriculum/challenges/espanol/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c04.md @@ -0,0 +1,43 @@ +--- +id: 587d7fb5367417b2b2512c04 +title: Remove a Package from Your Dependencies +challengeType: 2 +forumTopicId: 301530 +dashedName: remove-a-package-from-your-dependencies +--- + +# --description-- + +You have now tested a few ways you can manage dependencies of your project by using the package.json's dependencies section. You have also included external packages by adding them to the file and even told npm what types of versions you want, by using special characters such as the tilde or the caret. + +But what if you want to remove an external package that you no longer need? You might already have guessed it, just remove the corresponding key-value pair for that package from your dependencies. + +This same method applies to removing other fields in your package.json as well. + +# --instructions-- + +Remove the `@freecodecamp/example` package from your dependencies. + +**Note:** Make sure you have the right amount of commas after removing it. + +# --hints-- + +`"dependencies"` should not include `"@freecodecamp/example"`. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.notProperty( + packJson.dependencies, + '@freecodecamp/example', + '"dependencies" still includes "@freecodecamp/example"' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/german/13-relational-databases/build-a-periodic-table-database-project/build-a-periodic-table-database.md b/curriculum/challenges/german/13-relational-databases/build-a-periodic-table-database-project/build-a-periodic-table-database.md index fa2065c819..6667174c95 100644 --- a/curriculum/challenges/german/13-relational-databases/build-a-periodic-table-database-project/build-a-periodic-table-database.md +++ b/curriculum/challenges/german/13-relational-databases/build-a-periodic-table-database-project/build-a-periodic-table-database.md @@ -8,7 +8,7 @@ dashedName: build-a-periodic-table-database # --description-- -Dies ist eines der Projekte, die für den Erhalt der Zertifizierung erforderlich sind. In diesem Projekt erstellst du mit Bash ein Skript, das Informationen über chemische Elemente aus einer Datenbank des Periodensystems abruft. +Dies ist eines der Projekte, die für den Erhalt der Zertifizierung erforderlich sind. For this project, you will create a Bash script to get information about chemical elements from a periodic table database. # --instructions-- diff --git a/curriculum/challenges/german/14-responsive-web-design-22/learn-basic-css-by-building-a-cafe-menu/5f3ef6e0a81099d9a697b550.md b/curriculum/challenges/german/14-responsive-web-design-22/learn-basic-css-by-building-a-cafe-menu/5f3ef6e0a81099d9a697b550.md index 55cc92c8d3..2fceb78181 100644 --- a/curriculum/challenges/german/14-responsive-web-design-22/learn-basic-css-by-building-a-cafe-menu/5f3ef6e0a81099d9a697b550.md +++ b/curriculum/challenges/german/14-responsive-web-design-22/learn-basic-css-by-building-a-cafe-menu/5f3ef6e0a81099d9a697b550.md @@ -9,6 +9,8 @@ dashedName: step-64 Füge innerhalb des `footer` ein `p`-Element hinzu. Bette anschließend ein Ankerelement (`a`) im `p` ein, das mit `https://www.freecodecamp.org` verlinkt ist und den Text `Visit our website` enthält. +Make sure that the link opens in a new tab by adding a `target` attribute with the value `_blank`. + # --hints-- Du solltest nicht das vorhandene `footer`-Element ändern. @@ -43,6 +45,12 @@ Dein neues `a`-Element sollte zu `https://www.freecodecamp.org` verlinkt sein. D assert(document.querySelector("footer > p > a")?.href === "https://www.freecodecamp.org/"); ``` +Your new `a` element should have the `target` attribute set to `_blank`. + +```js +assert.equal(document.querySelector("footer > p > a")?.target, "_blank"); +``` + # --seed-- ## --seed-contents-- diff --git a/curriculum/challenges/german/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-j.md b/curriculum/challenges/german/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-j.md index d2ad72a1ea..1b6ca05444 100644 --- a/curriculum/challenges/german/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-j.md +++ b/curriculum/challenges/german/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-j.md @@ -21,12 +21,12 @@ Remove `flex: 1` from `.item` and add `justify-content: space-between` to `.cont `justify-content` aligns items across the **main axis**. There are a few values that you can use here. You'll learn the rest of them in the reading assignments, but for now try changing it to center, which should center the boxes along the main axis. -# --question-- - -## --assignment-- +# --assignment-- Before moving on to the next lesson, see what is possible with the `justify-content` property. Read this [interactive article on MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/justify-content) and play around with the different values of `justify-content` on the example. +# --question-- + ## --text-- How does applying `justify-content: space-between` to a flex container affect the positioning of its items? diff --git a/curriculum/challenges/german/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-k.md b/curriculum/challenges/german/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-k.md index d3137b0af5..59acb55a29 100644 --- a/curriculum/challenges/german/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-k.md +++ b/curriculum/challenges/german/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-k.md @@ -17,12 +17,12 @@ To change the placement of items along the cross axis use `align-items`. Try get Because `justify-content` and `align-items` are based on the main and cross axis of your container, their behavior changes when you change the flex-direction of a flex-container. For example, when you change `flex-direction` to `column`, `justify-content` aligns vertically and `align-items` aligns horizontally. The most common behavior, however, is the default, i.e. `justify-content` aligns items horizontally (because the main axis defaults to horizontal), and `align-items` aligns them vertically. One of the biggest sticking points that beginners have with flexbox is confusion when this behavior changes. -# --question-- - -## --assignment-- +# --assignment-- Before moving on to the next lesson, see if you can figure out how `align-items` behaves when you change the `flex-direction` property to `column`. +# --question-- + ## --text-- When changing the `flex-direction` property to `column` in a flex container, how does `align-items` behave in relation to the flex items? diff --git a/curriculum/challenges/german/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-b.md b/curriculum/challenges/german/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-b.md index 1adf9ce84f..49edeac0e4 100644 --- a/curriculum/challenges/german/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-b.md +++ b/curriculum/challenges/german/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-b.md @@ -9,12 +9,12 @@ dashedName: learn-block-and-inline-lesson-b Inline elements, however, do not start on a new line. They appear in line with whatever elements they are placed beside. A clear example of an inline element is a link, or `` tag. If you stick one of these in the middle of a paragraph of text, it will behave like a part of the paragraph. (Like this) The link’s text will sit alongside other words in that paragraph. Additionally, padding and margin behave differently on inline elements. In general, you do not want to try to put extra padding or margin on inline elements. -# --question-- - -## --assignment-- +# --assignment-- Search the web for a list of `block` elements and a list of `inline` elements. +# --question-- + ## --text-- What is the difference between a `block` element and an `inline` element? diff --git a/curriculum/challenges/german/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-g.md b/curriculum/challenges/german/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-g.md index cdd4d5aa87..e75492e9c1 100644 --- a/curriculum/challenges/german/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-g.md +++ b/curriculum/challenges/german/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-g.md @@ -7,7 +7,7 @@ dashedName: learn-block-and-inline-lesson-g # --description-- -Now that you have some basic understanding of `block` and inline `elements`, pull up your list of `block` and `inline` elements from a couple questions ago and see if you can identify which of the following elements are `block` elements and which are `inline` elements. +Now that you have some basic understanding of `block` and `inline` elements, pull up your list of `block` and `inline` elements from a couple questions ago and see if you can identify which of the following elements are `block` elements and which are `inline` elements. # --question-- diff --git a/curriculum/challenges/german/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-a.md b/curriculum/challenges/german/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-a.md index 995073b8a2..a7a2ee9a51 100644 --- a/curriculum/challenges/german/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-a.md +++ b/curriculum/challenges/german/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-a.md @@ -21,12 +21,12 @@ New programmers often find problem solving the hardest skill to build. It's not The best way to improve your problem solving ability is by building experience by making lots and lots of programs. The more practice you have the better you'll be prepared to solve real world problems. -# --question-- - -## --assignment-- +# --assignment-- Read How to Think Like a Programmer - Lessons in Problem Solving by Richard Reis. +# --question-- + ## --text-- According to V. Anton Spraul in "Think Like a Programmer," what is problem solving in programming? diff --git a/curriculum/challenges/german/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-b.md b/curriculum/challenges/german/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-b.md index ae905ecf89..c57a7d43e8 100644 --- a/curriculum/challenges/german/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-b.md +++ b/curriculum/challenges/german/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-b.md @@ -25,11 +25,11 @@ Now that you know what you’re aiming to solve, don’t jump into coding just y The last question is where you will write out an algorithm to solve the problem. You can think of an algorithm as a recipe for solving a particular problem. It defines the steps that need to be taken by the computer to solve a problem in pseudocode. -# --question-- - -## --assignment-- +# --assignment-- Watch How to Begin Thinking Like a Programmer by Coding Tech. It’s an hour long but packed full of information and definitely worth your time watching. +# --question-- + ## --text-- What should you do before starting to code according to the provided text? diff --git a/curriculum/challenges/german/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-c.md b/curriculum/challenges/german/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-c.md index c837fd9658..082f2d51ae 100644 --- a/curriculum/challenges/german/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-c.md +++ b/curriculum/challenges/german/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-c.md @@ -22,12 +22,12 @@ Print the value of the counter variable This is a basic program to demonstrate how pseudocode looks. There will be more examples of pseudocode included in the assignments. +# --assignment-- -# --question-- - -## --assignment-- Read this Pseudocode: What It Is and How to Write It article from Built In. +# --question-- + ## --text-- What are the benefits of using pseudocode according to the linked article? diff --git a/curriculum/challenges/german/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657b69e10d6606a0185d4d4f.md b/curriculum/challenges/german/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657b69e10d6606a0185d4d4f.md index bdc2416567..4a8f5d2d91 100644 --- a/curriculum/challenges/german/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657b69e10d6606a0185d4d4f.md +++ b/curriculum/challenges/german/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657b69e10d6606a0185d4d4f.md @@ -9,7 +9,7 @@ dashedName: task-23 # --description-- -Bisher hast du gelernt, wie man Fragen mit dem Verb to be bildet. In Sätzen mit dem Verb `to be` (am, is, are) muss man nur die Reihenfolge von Substantiv und Verb ändern, um eine Frage zu bilden. Like this: +So far you have learned how to create questions with the verb `to be`. In Sätzen mit dem Verb `to be` (am, is, are) muss man nur die Reihenfolge von Substantiv und Verb ändern, um eine Frage zu bilden. Like this: `You are a developer` -> `Are you a developer?` diff --git a/curriculum/challenges/german/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657dce8ff35869721311a5e3.md b/curriculum/challenges/german/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657dce8ff35869721311a5e3.md index a890d35b9a..679acbfe32 100644 --- a/curriculum/challenges/german/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657dce8ff35869721311a5e3.md +++ b/curriculum/challenges/german/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657dce8ff35869721311a5e3.md @@ -21,7 +21,7 @@ Which sentence is correct for describing one place near you? ### --Feedback-- -`There are` is used for plural nouns, and `bank` is singular. You’ll learn about there are in the next few lessons. +`There are` is used for plural nouns, and `bank` is singular. You’ll learn about `there are` in the next few lessons. --- diff --git a/curriculum/challenges/german/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657dcee413423174ca3747f5.md b/curriculum/challenges/german/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657dcee413423174ca3747f5.md index 919eb64a7c..247b605d84 100644 --- a/curriculum/challenges/german/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657dcee413423174ca3747f5.md +++ b/curriculum/challenges/german/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657dcee413423174ca3747f5.md @@ -7,7 +7,7 @@ dashedName: task-112 # --description-- -To elaborate a question using `there is` you just need to change the order of the verb to be, like so: +To elaborate a question using `there is` you just need to change the order of the verb `to be`, like so: `There is an ATM nearby` -> `Is there an ATM nearby?` diff --git a/curriculum/challenges/german/25-front-end-development/lab-celestial-bodies-database/5f1a4ef5d5d6b5ab580fc6ae.md b/curriculum/challenges/german/25-front-end-development/lab-celestial-bodies-database/5f1a4ef5d5d6b5ab580fc6ae.md new file mode 100644 index 0000000000..7d664a8876 --- /dev/null +++ b/curriculum/challenges/german/25-front-end-development/lab-celestial-bodies-database/5f1a4ef5d5d6b5ab580fc6ae.md @@ -0,0 +1,25 @@ +--- +id: 5f1a4ef5d5d6b5ab580fc6ae +title: Build a Celestial Bodies Database +challengeType: 13 +url: freeCodeCamp/learn-celestial-bodies-database +dashedName: lab-celestial-bodies-database +--- + +# --description-- + +For this project, you will build a database of celestial bodies using PostgreSQL. + +# --instructions-- + +**Important:** After you pass all the project tests, save a dump of your database into a `universe.sql` file so you can complete step 2. There will be instructions how to do that within the virtual machine. + +# --notes-- + +Required files: `universe.sql` + +# --hints-- + +# --seed-- + +# --solutions-- diff --git a/curriculum/challenges/german/25-front-end-development/lab-exercise-tracker/5a8b073d06fa14fcfde687aa.md b/curriculum/challenges/german/25-front-end-development/lab-exercise-tracker/5a8b073d06fa14fcfde687aa.md new file mode 100644 index 0000000000..9492b82cb4 --- /dev/null +++ b/curriculum/challenges/german/25-front-end-development/lab-exercise-tracker/5a8b073d06fa14fcfde687aa.md @@ -0,0 +1,611 @@ +--- +id: 5a8b073d06fa14fcfde687aa +title: Build an Exercise Tracker +challengeType: 4 +dashedName: build-an-exercise-tracker +--- + +# --description-- + +Build a full stack JavaScript app that is functionally similar to this: https://exercise-tracker.freecodecamp.rocks. Working on this project will involve you writing your code using one of the following methods: + +- Clone this GitHub repo and complete your project locally. +- Use our Gitpod starter project to complete your project. +- Use a site builder of your choice to complete the project. Be sure to incorporate all the files from our GitHub repo. + +# --instructions-- + +Your responses should have the following structures. + +Exercise: + +```js +{ + username: "fcc_test", + description: "test", + duration: 60, + date: "Mon Jan 01 1990", + _id: "5fb5853f734231456ccb3b05" +} +``` + +User: + +```js +{ + username: "fcc_test", + _id: "5fb5853f734231456ccb3b05" +} +``` + +Log: + +```js +{ + username: "fcc_test", + count: 1, + _id: "5fb5853f734231456ccb3b05", + log: [{ + description: "test", + duration: 60, + date: "Mon Jan 01 1990", + }] +} +``` + +**Hint:** For the `date` property, the `toDateString` method of the `Date` API can be used to achieve the expected output. + +# --hints-- + +You should provide your own project, not the example URL. + +```js +(getUserInput) => { + const url = getUserInput('url'); + assert( + !/.*\/exercise-tracker\.freecodecamp\.rocks/.test(getUserInput('url')) + ); +}; +``` + +You can `POST` to `/api/users` with form data `username` to create a new user. + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `username=fcc_test_${Date.now()}`.substring(0, 29) + }); + assert.isTrue(res.ok); + if(!res.ok) { + throw new Error(`${res.status} ${res.statusText}`) + }; +}; +``` + +The returned response from `POST /api/users` with form data `username` will be an object with `username` and `_id` properties. + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `username=fcc_test_${Date.now()}`.substring(0, 29) + }); + if (res.ok) { + const { _id, username } = await res.json(); + assert.exists(_id); + assert.exists(username); + } else { + throw new Error(`${res.status} ${res.statusText}`); + } +}; +``` + +You can make a `GET` request to `/api/users` to get a list of all users. + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users'); + assert.isTrue(res.ok); + if(!res.ok) { + throw new Error(`${res.status} ${res.statusText}`) + }; +}; +``` + +The `GET` request to `/api/users` returns an array. + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users'); + if(res.ok){ + const users = await res.json(); + assert.isArray(users); + } else { + throw new Error(`${res.status} ${res.statusText}`); + }; +}; +``` + +Each element in the array returned from `GET /api/users` is an object literal containing a user's `username` and `_id`. + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users'); + if(res.ok){ + const users = await res.json(); + const user = users[0]; + assert.exists(user); + assert.exists(user.username); + assert.exists(user._id); + assert.isString(user.username); + assert.isString(user._id); + } else { + throw new Error(`${res.status} ${res.statusText}`); + }; +}; +``` + +You can `POST` to `/api/users/:_id/exercises` with form data `description`, `duration`, and optionally `date`. If no date is supplied, the current date will be used. + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `username=fcc_test_${Date.now()}`.substring(0, 29) + }); + if (res.ok) { + const { _id, username } = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: 'Mon Jan 01 1990' + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `description=${expected.description}&duration=${expected.duration}&date=1990-01-01` + }); + assert.isTrue(addRes.ok); + if(!addRes.ok) { + throw new Error(`${addRes.status} ${addRes.statusText}`) + }; + } else { + throw new Error(`${res.status} ${res.statusText}`); + } +}; +``` + +The response returned from `POST /api/users/:_id/exercises` will be the user object with the exercise fields added. + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `username=fcc_test_${Date.now()}`.substring(0, 29) + }); + if (res.ok) { + const { _id, username } = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: 'Mon Jan 01 1990' + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `description=${expected.description}&duration=${expected.duration}&date=1990-01-01` + }); + if (addRes.ok) { + const actual = await addRes.json(); + assert.deepEqual(actual, expected); + assert.isString(actual.description); + assert.isNumber(actual.duration); + assert.isString(actual.date); + } else { + throw new Error(`${addRes.status} ${addRes.statusText}`); + } + } else { + throw new Error(`${res.status} ${res.statusText}`); + } +}; +``` + +You can make a `GET` request to `/api/users/:_id/logs` to retrieve a full exercise log of any user. + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `username=fcc_test_${Date.now()}`.substring(0, 29) + }); + if (res.ok) { + const { _id, username } = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: new Date().toDateString() + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `description=${expected.description}&duration=${expected.duration}` + }); + if (addRes.ok) { + const logRes = await fetch(url + `/api/users/${_id}/logs`); + assert.isTrue(logRes.ok); + if(!logRes.ok) { + throw new Error(`${logRes.status} ${logRes.statusText}`) + }; + } else { + throw new Error(`${addRes.status} ${addRes.statusText}`); + } + } else { + throw new Error(`${res.status} ${res.statusText}`); + } +}; +``` + +A request to a user's log `GET /api/users/:_id/logs` returns a user object with a `count` property representing the number of exercises that belong to that user. + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `username=fcc_test_${Date.now()}`.substring(0, 29) + }); + if (res.ok) { + const { _id, username } = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: new Date().toDateString() + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `description=${expected.description}&duration=${expected.duration}` + }); + if (addRes.ok) { + const logRes = await fetch(url + `/api/users/${_id}/logs`); + if (logRes.ok) { + const { count } = await logRes.json(); + assert(count); + } else { + throw new Error(`${logRes.status} ${logRes.statusText}`); + } + } else { + throw new Error(`${addRes.status} ${addRes.statusText}`); + } + } else { + throw new Error(`${res.status} ${res.statusText}`); + } +}; +``` + +A `GET` request to `/api/users/:_id/logs` will return the user object with a `log` array of all the exercises added. + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded' + }, + body: `username=fcc_test_${Date.now()}`.substring(0, 29) + }) + if(res.ok){ + const {_id, username} = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: new Date().toDateString() + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `description=${expected.description}&duration=${expected.duration}` + }); + if(addRes.ok){ + const logRes = await fetch(url + `/api/users/${_id}/logs`); + if(logRes.ok) { + const {log} = await logRes.json(); + assert.isArray(log); + assert.equal(1, log.length); + } else { + throw new Error(`${logRes.status} ${logRes.statusText}`); + } + } else { + throw new Error(`${addRes.status} ${addRes.statusText}`); + }; + } else { + throw new Error(`${res.status} ${res.statusText}`) + }; +}; +``` + +Each item in the `log` array that is returned from `GET /api/users/:_id/logs` is an object that should have a `description`, `duration`, and `date` properties. + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + `/api/users`, { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded' + }, + body: `username=fcc_test_${Date.now()}`.substring(0, 29) + }); + if(res.ok) { + const {_id, username} = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: new Date().toDateString() + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `description=${expected.description}&duration=${expected.duration}` + }); + if(addRes.ok) { + const logRes = await fetch(url + `/api/users/${_id}/logs`); + if(logRes.ok) { + const {log} = await logRes.json(); + const exercise = log[0]; + assert.exists(exercise); + assert.exists(exercise.description); + assert.exists(exercise.duration); + assert.exists(exercise.date); + } else { + throw new Error(`${logRes.status} ${logRes.statusText}`); + }; + } else { + throw new Error(`${addRes.status} ${addRes.statusText}`); + }; + } else { + throw new Error(`${res.status} ${res.statusText}`) + }; +}; +``` + +The `description` property of any object in the `log` array that is returned from `GET /api/users/:_id/logs` should be a string. + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + body: `username=fcc_test_${Date.now()}`.substring(0,29) + }); + if(res.ok) { + const {_id, username} = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: new Date().toDateString() + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + body: `description=${expected.description}&duration=${expected.duration}` + }); + if(addRes.ok) { + const logRes = await fetch(url + `/api/users/${_id}/logs`); + if(logRes.ok){ + const {log} = await logRes.json(); + const exercise = log[0]; + assert.isString(exercise.description); + assert.equal(exercise.description, expected.description); + } else { + throw new Error(`${logRes.status} ${logRes.statusText}`); + } + } else { + throw new Error(`${addRes.status} ${addRes.statusText}`); + }; + } else { + throw new Error(`${res.status} ${res.statusText}`); + }; +}; +``` + +The `duration` property of any object in the `log` array that is returned from `GET /api/users/:_id/logs` should be a number. + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + body: `username=fcc_test_${Date.now()}`.substring(0,29) + }); + if(res.ok) { + const {_id, username} = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: new Date().toDateString() + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + body: `description=${expected.description}&duration=${expected.duration}` + }); + if(addRes.ok) { + const logRes = await fetch(url + `/api/users/${_id}/logs`); + if(logRes.ok){ + const {log} = await logRes.json(); + const exercise = log[0]; + assert.isNumber(exercise.duration); + assert.equal(exercise.duration, expected.duration); + } else { + throw new Error(`${logRes.status} ${logRes.statusText}`); + } + } else { + throw new Error(`${addRes.status} ${addRes.statusText}`); + }; + } else { + throw new Error(`${res.status} ${res.statusText}`); + }; +}; +``` + +The `date` property of any object in the `log` array that is returned from `GET /api/users/:_id/logs` should be a string. Use the `dateString` format of the `Date` API. + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + body: `username=fcc_test_${Date.now()}`.substring(0,29) + }); + if(res.ok) { + const {_id, username} = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: new Date().toLocaleDateString("en-US", { + timeZone: "UTC", weekday: "short", month: "short", + day: "2-digit", year: "numeric" + }).replaceAll(',', '') + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + body: `description=${expected.description}&duration=${expected.duration}` + }); + if(addRes.ok) { + const logRes = await fetch(url + `/api/users/${_id}/logs`); + if(logRes.ok){ + const {log} = await logRes.json(); + const exercise = log[0]; + assert.isString(exercise.date); + assert.equal(exercise.date, expected.date); + } else { + throw new Error(`${logRes.status} ${logRes.statusText}`); + } + } else { + throw new Error(`${addRes.status} ${addRes.statusText}`); + }; + } else { + throw new Error(`${res.status} ${res.statusText}`); + }; +}; +``` + +You can add `from`, `to` and `limit` parameters to a `GET /api/users/:_id/logs` request to retrieve part of the log of any user. `from` and `to` are dates in `yyyy-mm-dd` format. `limit` is an integer of how many logs to send back. + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `username=fcc_test_${Date.now()}`.substring(0, 29) + }); + if (res.ok) { + const { _id, username } = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: new Date().toDateString() + }; + const addExerciseRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `description=${expected.description}&duration=${expected.duration}&date=1990-01-01` + }); + const addExerciseTwoRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `description=${expected.description}&duration=${expected.duration}&date=1990-01-03` + }); + if (addExerciseRes.ok && addExerciseTwoRes.ok) { + const logRes = await fetch( + url + `/api/users/${_id}/logs?from=1989-12-31&to=1990-01-04` + ); + if (logRes.ok) { + const { log } = await logRes.json(); + assert.isArray(log); + assert.equal(2, log.length); + } else { + throw new Error(`${logRes.status} ${logRes.statusText}`); + } + const limitRes = await fetch( + url + `/api/users/${_id}/logs?limit=1` + ); + if (limitRes.ok) { + const { log } = await limitRes.json(); + assert.isArray(log); + assert.equal(1, log.length); + } else { + throw new Error(`${limitRes.status} ${limitRes.statusText}`); + } + const filterDateBeforeLimitRes = await fetch( + url + `/api/users/${_id}/logs?from=1990-01-02&to=1990-01-04&limit=1` + ); + if (filterDateBeforeLimitRes.ok) { + const { log } = await filterDateBeforeLimitRes.json(); + assert.isArray(log); + assert.equal(1, log.length); + } else { + throw new Error(`${filterDateBeforeLimitRes.status} ${filterDateBeforeLimitRes.statusText}`); + } + } else { + throw new Error(`${res.status} ${res.statusText}`); + } + } else { + throw new Error(`${res.status} ${res.statusText}`); + } +}; +``` diff --git a/curriculum/challenges/german/25-front-end-development/lab-number-guessing-game/602da04c22201c65d2a019f4.md b/curriculum/challenges/german/25-front-end-development/lab-number-guessing-game/602da04c22201c65d2a019f4.md new file mode 100644 index 0000000000..ef87dc6720 --- /dev/null +++ b/curriculum/challenges/german/25-front-end-development/lab-number-guessing-game/602da04c22201c65d2a019f4.md @@ -0,0 +1,25 @@ +--- +id: 602da04c22201c65d2a019f4 +title: Build a Number Guessing Game +challengeType: 13 +url: freeCodeCamp/learn-number-guessing-game +dashedName: lab-number-guessing-game +--- + +# --description-- + +For this lab, you will use Bash scripting, PostgreSQL, and Git to create a number guessing game that runs in the terminal and saves user information. + +# --instructions-- + +**Important:** After you pass all the project tests, save a dump of your database into a `number_guess.sql` file, as well as your `number_guess.sh` file, so you can complete step 2. There will be instructions on how to do that within the virtual machine. + +# --notes-- + +Required files: `number_guess.sql`, `number_guess.sh` + +# --hints-- + +# --seed-- + +# --solutions-- diff --git a/curriculum/challenges/german/25-front-end-development/lab-request-header-parser-microservice/bd7158d8c443edefaeb5bdff.md b/curriculum/challenges/german/25-front-end-development/lab-request-header-parser-microservice/bd7158d8c443edefaeb5bdff.md new file mode 100644 index 0000000000..5040e27424 --- /dev/null +++ b/curriculum/challenges/german/25-front-end-development/lab-request-header-parser-microservice/bd7158d8c443edefaeb5bdff.md @@ -0,0 +1,65 @@ +--- +id: bd7158d8c443edefaeb5bdff +title: Build a Request Header Parser Microservice +challengeType: 4 +dashedName: lab-request-header-parser-microservice +--- + +# --description-- + +Build a full stack JavaScript app that is functionally similar to this: https://request-header-parser-microservice.freecodecamp.rocks/. Working on this project will involve you writing your code using one of the following methods: + +- Clone this GitHub repo and complete your project locally. +- Use our Gitpod starter project to complete your project. +- Use a site builder of your choice to complete the project. Be sure to incorporate all the files from our GitHub repo. + +# --hints-- + +You should provide your own project, not the example URL. + +```js +(getUserInput) => { + assert( + !/.*\/request-header-parser-microservice\.freecodecamp\.rocks/.test( + getUserInput('url') + ) + ); +}; +``` + +A request to `/api/whoami` should return a JSON object with your IP address in the `ipaddress` key. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/api/whoami').then( + (data) => assert(data.ipaddress && data.ipaddress.length > 0), + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + +A request to `/api/whoami` should return a JSON object with your preferred language in the `language` key. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/api/whoami').then( + (data) => assert(data.language && data.language.length > 0), + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + +A request to `/api/whoami` should return a JSON object with your software in the `software` key. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/api/whoami').then( + (data) => assert(data.software && data.software.length > 0), + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/german/25-front-end-development/lab-url-shortener-microservice/bd7158d8c443edefaeb5bd0e.md b/curriculum/challenges/german/25-front-end-development/lab-url-shortener-microservice/bd7158d8c443edefaeb5bd0e.md new file mode 100644 index 0000000000..0fbf80a0bf --- /dev/null +++ b/curriculum/challenges/german/25-front-end-development/lab-url-shortener-microservice/bd7158d8c443edefaeb5bd0e.md @@ -0,0 +1,107 @@ +--- +id: bd7158d8c443edefaeb5bd0e +title: URL Shortener Microservice +challengeType: 4 +dashedName: url-shortener-microservice +--- + +# --description-- + +Build a full stack JavaScript app that is functionally similar to this: https://url-shortener-microservice.freecodecamp.rocks. Working on this project will involve you writing your code using one of the following methods: + +- Clone this GitHub repo and complete your project locally. +- Use our Gitpod starter project to complete your project. +- Use a site builder of your choice to complete the project. Be sure to incorporate all the files from our GitHub repo. + +# --instructions-- + +**HINT:** Do not forget to use a body parsing middleware to handle the POST requests. Also, you can use the function `dns.lookup(host, cb)` from the `dns` core module to verify a submitted URL. + +# --hints-- + +You should provide your own project, not the example URL. + +```js +(getUserInput) => { + assert( + !/.*\/url-shortener-microservice\.freecodecamp\.rocks/.test( + getUserInput('url') + ) + ); +}; +``` + +You can POST a URL to `/api/shorturl` and get a JSON response with `original_url` and `short_url` properties. Here's an example: `{ original_url : 'https://freeCodeCamp.org', short_url : 1}` + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const urlVariable = Date.now(); + const fullUrl = `${url}/?v=${urlVariable}` + const res = await fetch(url + '/api/shorturl', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `url=${fullUrl}` + }); + if (res.ok) { + const { short_url, original_url } = await res.json(); + assert.isNotNull(short_url); + assert.strictEqual(original_url, `${url}/?v=${urlVariable}`); + } else { + throw new Error(`${res.status} ${res.statusText}`); + } +}; +``` + +When you visit `/api/shorturl/`, you will be redirected to the original URL. + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const urlVariable = Date.now(); + const fullUrl = `${url}/?v=${urlVariable}` + let shortenedUrlVariable; + const postResponse = await fetch(url + '/api/shorturl', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `url=${fullUrl}` + }); + if (postResponse.ok) { + const { short_url } = await postResponse.json(); + shortenedUrlVariable = short_url; + } else { + throw new Error(`${postResponse.status} ${postResponse.statusText}`); + } + const getResponse = await fetch( + url + '/api/shorturl/' + shortenedUrlVariable + ); + if (getResponse) { + const { redirected, url } = getResponse; + assert.isTrue(redirected); + assert.strictEqual(url,fullUrl); + } else { + throw new Error(`${getResponse.status} ${getResponse.statusText}`); + } +}; +``` + +If you pass an invalid URL that doesn't follow the valid `http://www.example.com` format, the JSON response will contain `{ error: 'invalid url' }` + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/shorturl', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `url=ftp:/john-doe.invalidTLD` + }); + if (res.ok) { + const { error } = await res.json(); + assert.isNotNull(error); + assert.strictEqual(error.toLowerCase(), 'invalid url'); + } else { + throw new Error(`${res.status} ${res.statusText}`); + } +}; +``` + diff --git a/curriculum/challenges/german/25-front-end-development/lab-world-cup-database/5f9771307d4d22b9d2b75a94.md b/curriculum/challenges/german/25-front-end-development/lab-world-cup-database/5f9771307d4d22b9d2b75a94.md new file mode 100644 index 0000000000..d77442a1ba --- /dev/null +++ b/curriculum/challenges/german/25-front-end-development/lab-world-cup-database/5f9771307d4d22b9d2b75a94.md @@ -0,0 +1,25 @@ +--- +id: 5f9771307d4d22b9d2b75a94 +title: Build a World Cup Database +challengeType: 13 +url: freeCodeCamp/learn-world-cup-database +dashedName: lab-world-cup-database +--- + +# --description-- + +For this project, you will create a Bash script that enters information from World Cup games into PostgreSQL, then query the database for useful statistics. + +# --instructions-- + +**Important:** After you pass all the project tests, save a dump of your database into a `worldcup.sql` file, as well as your `insert_data.sh` and `queries.sh` files, so you can complete step 2. There will be instructions how to do that within the virtual machine. + +# --notes-- + +Required files: `worldcup.sql`, `insert_data.sh`, `queries.sh` + +# --hints-- + +# --seed-- + +# --solutions-- diff --git a/curriculum/challenges/german/25-front-end-development/workshop-hotel-feedback-form/66a96127422411756204bc1b.md b/curriculum/challenges/german/25-front-end-development/workshop-hotel-feedback-form/66a96127422411756204bc1b.md index 51ea9e3069..753ee1a6bb 100644 --- a/curriculum/challenges/german/25-front-end-development/workshop-hotel-feedback-form/66a96127422411756204bc1b.md +++ b/curriculum/challenges/german/25-front-end-development/workshop-hotel-feedback-form/66a96127422411756204bc1b.md @@ -7,9 +7,9 @@ dashedName: step-22 # --description-- -Add another label with the text of `Personal Recommendation`. The `for` attribute should be set to `"recommendation"`. +Add another `label` with the text of `Personal Recommendation`. The `for` attribute should be set to `"recommendation"`. -Below the label element, add another checkbox input with the `id`, `name` and `value` attributes set to `"recommendation"`. +Below the `label` element, add another checkbox `input` with the `id`, `name` and `value` attributes set to `"recommendation"`. # --hints-- diff --git a/curriculum/challenges/german/25-front-end-development/workshop-hotel-feedback-form/66a962954f4e0d76223b37ed.md b/curriculum/challenges/german/25-front-end-development/workshop-hotel-feedback-form/66a962954f4e0d76223b37ed.md index 42c425209d..80a23ca86d 100644 --- a/curriculum/challenges/german/25-front-end-development/workshop-hotel-feedback-form/66a962954f4e0d76223b37ed.md +++ b/curriculum/challenges/german/25-front-end-development/workshop-hotel-feedback-form/66a962954f4e0d76223b37ed.md @@ -11,7 +11,7 @@ Next, add another `label` element with the text of `Location` and the `for` attr For the checkbox `input`, both the `id`, `name` and `value` attributes should be set to `"location"`. -Below that `input` element, add another `label` element with the text of `Reputation` and the for attribute set to `"reputation"`. +Below that `input` element, add another `label` element with the text of `Reputation` and the `for` attribute set to `"reputation"`. For the checkbox `input`, both the `id`, `name` and `value` attributes should be set to `"reputation"`. diff --git a/curriculum/challenges/german/25-front-end-development/workshop-hotel-feedback-form/66a972137acd1179fa3fe8a0.md b/curriculum/challenges/german/25-front-end-development/workshop-hotel-feedback-form/66a972137acd1179fa3fe8a0.md index 69efa4832c..09e3e6e59b 100644 --- a/curriculum/challenges/german/25-front-end-development/workshop-hotel-feedback-form/66a972137acd1179fa3fe8a0.md +++ b/curriculum/challenges/german/25-front-end-development/workshop-hotel-feedback-form/66a972137acd1179fa3fe8a0.md @@ -7,7 +7,7 @@ dashedName: step-28 # --description-- -Inside your `select` element, add the following five `option` elements with these corresponding values for the option text and `value` attribute: +Inside your `select` element, add the following five `option` elements with these corresponding values for the `option` text and `value` attribute: **Value Attributes:** diff --git a/curriculum/challenges/german/25-front-end-development/workshop-hotel-feedback-form/66a97ca8c4cbae7d0bb6e0ad.md b/curriculum/challenges/german/25-front-end-development/workshop-hotel-feedback-form/66a97ca8c4cbae7d0bb6e0ad.md index 6549345d45..22b9a707be 100644 --- a/curriculum/challenges/german/25-front-end-development/workshop-hotel-feedback-form/66a97ca8c4cbae7d0bb6e0ad.md +++ b/curriculum/challenges/german/25-front-end-development/workshop-hotel-feedback-form/66a97ca8c4cbae7d0bb6e0ad.md @@ -7,7 +7,7 @@ dashedName: step-31 # --description-- -Inside your `select` element, add the following five `option` elements with these corresponding values for the option text and `value` attribute: +Inside your `select` element, add the following five `option` elements with these corresponding values for the `option` text and `value` attribute: **Value Attribute:** diff --git a/curriculum/challenges/german/25-front-end-development/workshop-loan-qualification-checker/66c8ba41a77db20a93f9d7a1.md b/curriculum/challenges/german/25-front-end-development/workshop-loan-qualification-checker/66c8ba41a77db20a93f9d7a1.md new file mode 100644 index 0000000000..237515fd88 --- /dev/null +++ b/curriculum/challenges/german/25-front-end-development/workshop-loan-qualification-checker/66c8ba41a77db20a93f9d7a1.md @@ -0,0 +1,71 @@ +--- +id: 66c8ba41a77db20a93f9d7a1 +title: Step 1 +challengeType: 1 +dashedName: step-1 +--- + +# --description-- + +In this workshop, you'll review JavaScript conditionals by building a loan qualification checker app. + +The app will check whether the user is eligible for a duplex, car, and condo loan based on their annual income and credit score. A credit score is a number that represents how good you are at managing borrowed money. + +To get started, create the following variables and values. + +| Variable Name | Value | +| ------------------------- | ------- | +| `minIncomeForDuplex` | `60000` | +| `minCreditScoreForDuplex` | `700` | +| `minIncomeForCondo` | `45000` | +| `minCreditScoreForCondo` | `680` | +| `minIncomeForCar` | `30000` | +| `minCreditScoreForCar` | `650` | + +# --hints-- + +You should create a `minIncomeForDuplex` variable set to `60000`. + +```js +assert.equal(minIncomeForDuplex, 60000); +``` + +You should create a `minCreditScoreForDuplex` set to `700`. + +```js +assert.equal(minCreditScoreForDuplex, 700); +``` + +You should create a `minIncomeForCar` variable set to `30000`. + +```js +assert.equal(minIncomeForCar, 30000); +``` + +You should create a `minCreditScoreForCar` variable set to `650`. + +```js +assert.equal(minCreditScoreForCar, 650); +``` + +You should create a `minIncomeForCondo` variable set to `45000`. + +```js +assert.equal(minIncomeForCondo, 45000); +``` + +You should create a `minCreditScoreForCondo` variable set to `680`. + +```js +assert.equal(minCreditScoreForCondo, 680); +``` + +# --seed-- + +## --seed-contents-- + +```js +--fcc-editable-region-- + +--fcc-editable-region-- +``` diff --git a/curriculum/challenges/german/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4ac.md b/curriculum/challenges/german/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4ac.md new file mode 100644 index 0000000000..7755f823c4 --- /dev/null +++ b/curriculum/challenges/german/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4ac.md @@ -0,0 +1,53 @@ +--- +id: 66c8ba975ee7230e29f6c4ac +title: Step 2 +challengeType: 1 +dashedName: step-2 +--- + +# --description-- + +When the user is eligible for a loan, you'll want to display a message to them in the console. + +For that, you'll build out a function inside which you'll have some checks that'll return what loan the applicant is eligible for. + +Create an empty `getLoanMessage` function with an `annualIncome` and `creditScore` parameters. + +# --hints-- + +You should create a `getLoanMessage` function + +```js +assert.isFunction(getLoanMessage) +``` + +Your `getLoanMessage` function should have an `annualIncome` and `creditScore` as parameters. + +```js +assert.match(getLoanMessage?.toString(), /\(\s*annualIncome,\s*creditScore\s*\)|\(\s*creditScore,\s*annualIncome\s*\)/); +``` + +`getLoanMessage` should be an empty function. + +```js +assert.match(getLoanMessage?.toString(), /\{\s*\}/); +``` + +# --seed-- + +## --seed-contents-- + +```js +const minIncomeForDuplex = 60000; +const minCreditScoreForDuplex = 700; + +const minIncomeForCondo = 45000; +const minCreditScoreForCondo = 680; + +const minIncomeForCar = 30000; +const minCreditScoreForCar = 650; + +--fcc-editable-region-- + +--fcc-editable-region-- +``` diff --git a/curriculum/challenges/german/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4ad.md b/curriculum/challenges/german/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4ad.md new file mode 100644 index 0000000000..82a29d7cd9 --- /dev/null +++ b/curriculum/challenges/german/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4ad.md @@ -0,0 +1,55 @@ +--- +id: 66c8ba975ee7230e29f6c4ad +title: Step 3 +challengeType: 1 +dashedName: step-3 +--- + +# --description-- + +To check which loan a user is qualified for based on the `annualIncome` and `creditScore`, you have to use `if/else if` statement or a ternary right inside the `getLoanMessage` function. You'll then return the appropraite message in the block of each condition. + +Starting with the duplex loan, check if `annualIncome` is greater than or equal to `minIncomeForDuplex` AND if `creditScore` is greater than `minCreditScoreForDuplex`. + +If that condition is true, then the applicant is eligible for a duplex loan and the other loans. So, inside the check, return the string `"You qualify for a car, duplex and Condo loan."` + +# --hints-- + +Your `getLoanMessage` function should return a string. + +```js +assert.isString(getLoanMessage(65000, 750)); +``` + +Your `getLoanMessage` function should return the string `"You qualify for a duplex, condo, and car loan."`. + +```js +assert.strictEqual(getLoanMessage(65000, 750), "You qualify for a duplex, condo, and car loan."); +``` + +Your `getLoanMessage` function should return `undefined` if the applicant's annual income and credit score do not meet the requirements for a duplex loan. + +```js +assert.strictEqual(getLoanMessage(59000, 700), undefined); +``` + +# --seed-- + +## --seed-contents-- + +```js +const minIncomeForDuplex = 60000; +const minCreditScoreForDuplex = 700; + +const minIncomeForCondo = 45000; +const minCreditScoreForCondo = 680; + +const minIncomeForCar = 30000; +const minCreditScoreForCar = 650; + +--fcc-editable-region-- +function getLoanMessage(annualIncome, creditScore) { + +} +--fcc-editable-region-- +``` diff --git a/curriculum/challenges/german/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4af.md b/curriculum/challenges/german/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4af.md new file mode 100644 index 0000000000..638e6291a4 --- /dev/null +++ b/curriculum/challenges/german/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4af.md @@ -0,0 +1,56 @@ +--- +id: 66c8ba975ee7230e29f6c4af +title: Step 4 +challengeType: 1 +dashedName: step-4 +--- + +# --description-- + +If the applicant's annual income is greater than or equal to `minIncomeForCondo`, AND if their credit score is greater than or equal to `minCreditScoreForCondo`, then they qualify for a condo and car loan. + +Check if that's true in the `getLoanMessage` function. If it is, return the string `"You qualify for a condo and car loan."` + +# --hints-- + +Your `getLoanMessage` function should return a string if the applicant qualifies for a condo and car loan. + +```js +assert.isString(getLoanMessage(45000, 680)); +``` + +Your `getLoanMessage` function should return the string `"You qualify for a condo and car loan."`. + +```js +assert.strictEqual(getLoanMessage(45000, 680), "You qualify for a condo and car loan."); +``` + +Your `getLoanMessage` function should return `undefined` if the applicant's annual income and credit score do not meet the requirements for a condo loan. + +```js +assert.strictEqual(getLoanMessage(45000, 650), undefined); +``` + +# --seed-- + +## --seed-contents-- + +```js +const minIncomeForDuplex = 60000; +const minCreditScoreForDuplex = 700; + +const minIncomeForCondo = 45000; +const minCreditScoreForCondo = 680; + +const minIncomeForCar = 30000; +const minCreditScoreForCar = 650; + +function getLoanMessage(annualIncome, creditScore) { + if(creditScore >= minCreditScoreForDuplex && annualIncome >= minIncomeForDuplex) { + return "You qualify for a duplex, condo, and car loan." +--fcc-editable-region-- + } + +--fcc-editable-region-- +} +``` diff --git a/curriculum/challenges/german/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b0.md b/curriculum/challenges/german/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b0.md new file mode 100644 index 0000000000..374ba7b8fe --- /dev/null +++ b/curriculum/challenges/german/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b0.md @@ -0,0 +1,56 @@ +--- +id: 66c8ba975ee7230e29f6c4b0 +title: Step 5 +challengeType: 1 +dashedName: step-5 +--- + +# --description-- + +Now, you should check if the applicant is qualified for a car loan only. If they're, return the string `"You qualify for a car loan."`. + +# --hints-- + +Your `getLoanMessage` function should return a string if the applicant qualifies for a car loan. + +```js +assert.isString(getLoanMessage(30000, 650)); +``` + +Your `getLoanMessage` function should return the string `"You qualify for a car loan."`. + +```js +assert.strictEqual(getLoanMessage(30000, 650), "You qualify for a car loan."); +``` + +Your `getLoanMessage` function should return `undefined` if the applicant's annual income and credit score do not meet the requirements for a car loan. + +```js +assert.strictEqual(getLoanMessage(30000, 600), undefined); +``` + +# --seed-- + +## --seed-contents-- + +```js +const minIncomeForDuplex = 60000; +const minCreditScoreForDuplex = 700; + +const minIncomeForCondo = 45000; +const minCreditScoreForCondo = 680; + +const minIncomeForCar = 30000; +const minCreditScoreForCar = 650; + +function getLoanMessage(annualIncome, creditScore) { + if(creditScore >= minCreditScoreForDuplex && annualIncome >= minIncomeForDuplex) { + return "You qualify for a duplex, condo, and car loan." + } else if (annualIncome >= minIncomeForCondo && creditScore >= minCreditScoreForCondo) { + return "You qualify for a condo and car loan." +--fcc-editable-region-- + } + +--fcc-editable-region-- +} +``` diff --git a/curriculum/challenges/german/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b1.md b/curriculum/challenges/german/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b1.md new file mode 100644 index 0000000000..16e8c7baca --- /dev/null +++ b/curriculum/challenges/german/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b1.md @@ -0,0 +1,54 @@ +--- +id: 66c8ba975ee7230e29f6c4b1 +title: Step 6 +challengeType: 1 +dashedName: step-6 +--- + +# --description-- + +If the applicant's annual income and credit score fall below `minIncomeForCar` and `minCreditScoreForCar`, then they don't qualify for any loan. So, return the string `"You don't qualify for any loans."` + +# --hints-- + +Your `getLoanMessage` function should return a string if the applicant doesn't qualify for any loan. + +```js +assert.isString(getLoanMessage(25000, 550)); +``` + +Your `getLoanMessage` function should return the string `"You don't qualify for any loans."` if the applicant does not meet the requirements for any loan. + +```js +assert.strictEqual(getLoanMessage(15000, 600), "You don't qualify for any loans."); +assert.strictEqual(getLoanMessage(25000, 550), "You don't qualify for any loans."); +assert.strictEqual(getLoanMessage(20000, 500), "You don't qualify for any loans."); +``` + +# --seed-- + +## --seed-contents-- + +```js +const minIncomeForDuplex = 60000; +const minCreditScoreForDuplex = 700; + +const minIncomeForCondo = 45000; +const minCreditScoreForCondo = 680; + +const minIncomeForCar = 30000; +const minCreditScoreForCar = 650; + +function getLoanMessage(annualIncome, creditScore) { + if(creditScore >= minCreditScoreForDuplex && annualIncome >= minIncomeForDuplex) { + return "You qualify for a duplex, condo, and car loan." + } else if (annualIncome >= minIncomeForCondo && creditScore >= minCreditScoreForCondo) { + return "You qualify for a condo and car loan." + } else if (annualIncome >= minIncomeForCar && creditScore >= minCreditScoreForCar) { + return "You qualify for a car loan." +--fcc-editable-region-- + } + +--fcc-editable-region-- +} +``` diff --git a/curriculum/challenges/german/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b2.md b/curriculum/challenges/german/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b2.md new file mode 100644 index 0000000000..9d19f9ea4c --- /dev/null +++ b/curriculum/challenges/german/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b2.md @@ -0,0 +1,165 @@ +--- +id: 66c8ba975ee7230e29f6c4b2 +title: Step 7 +challengeType: 1 +dashedName: step-7 +--- + +# --description-- + +Now, it is time to test out your `getLoanMessage` function. + +Use the table below to create `4` variables and their values: + +| Variable Name | Value | +| --------------- | ---------------------------- | +| `duplexLoanMsg` | `getLoanMessage(85000, 850)` | +| `condoLoanMsg` | `getLoanMessage(65000, 690)` | +| `carLoanMsg` | `getLoanMessage(45000, 660)` | +| `noLoanMsg` | `getLoanMessage(25000, 550)` | + +After that, log each variable to the console to see the messages. + +With that, your loan qualification checker project is complete! + +# --hints-- + +You should have a variable called `duplexLoanMsg`. + +```js +assert.isNotNull(duplexLoanMsg); +``` + +Your `duplexLoanMsg` variable should be set to the result of `getLoanMessage(85000, 850)`. + +```js +assert.equal(duplexLoanMsg, getLoanMessage(85000, 850)); +``` + +You should log the `duplexLoanMsg` variable to the console. + +```js +assert.match(code, /console\.log\(duplexLoanMsg\)/) +``` + +You should have a variable called `condoLoanMsg`. + +```js +assert.isNotNull(condoLoanMsg); +``` + +Your `condoLoanMsg` variable should be set to the result of `getLoanMessage(65000, 690)`. + +```js +assert.equal(condoLoanMsg, getLoanMessage(65000, 690)); +``` + +You should log the `condoLoanMsg` variable to the console. + +```js +assert.match(code, /console\.log\(condoLoanMsg\)/) +``` + +You should have a variable called `carLoanMsg`. + +```js +assert.isNotNull(carLoanMsg); +``` + +Your `carLoanMsg` variable should be set to the result of `getLoanMessage(45000, 660)`. + +```js +assert.equal(carLoanMsg, getLoanMessage(45000, 660)); +``` + +You should log the `carLoanMsg` variable to the console. + +```js +assert.match(code, /console\.log\(carLoanMsg\)/) +``` + +You should have a variable called `noLoanMsg`. + +```js +assert.isNotNull(noLoanMsg); +``` + +Your `noLoanMsg` variable should be set to the result of `getLoanMessage(25000, 550)`. + +```js +assert.equal(noLoanMsg, getLoanMessage(25000, 550)); +``` + +You should log the `noLoanMsg` variable to the console. + +```js +assert.match(code, /console\.log\(noLoanMsg\)/) +``` + +# --seed-- + +## --seed-contents-- + +```js +const minIncomeForDuplex = 60000; +const minCreditScoreForDuplex = 700; + +const minIncomeForCondo = 45000; +const minCreditScoreForCondo = 680; + +const minIncomeForCar = 30000; +const minCreditScoreForCar = 650; + +function getLoanMessage(annualIncome, creditScore) { + if(creditScore >= minCreditScoreForDuplex && annualIncome >= minIncomeForDuplex) { + return "You qualify for a duplex, condo, and car loan." + } else if (annualIncome >= minIncomeForCondo && creditScore >= minCreditScoreForCondo) { + return "You qualify for a condo and car loan." + } else if (annualIncome >= minIncomeForCar && creditScore >= minCreditScoreForCar) { + return "You qualify for a car loan." + } else { + return "You don't qualify for any loans." + } +} + +--fcc-editable-region-- + +--fcc-editable-region-- +``` + +# --solutions-- + +```js +const minIncomeForDuplex = 60000; +const minCreditScoreForDuplex = 700; + +const minIncomeForCondo = 45000; +const minCreditScoreForCondo = 680; + +const minIncomeForCar = 30000; +const minCreditScoreForCar = 650; + +function getLoanMessage(annualIncome, creditScore) { + if(creditScore >= minCreditScoreForDuplex && annualIncome >= minIncomeForDuplex) { + return "You qualify for a duplex, condo, and car loan." + } else if (annualIncome >= minIncomeForCondo && creditScore >= minCreditScoreForCondo) { + return "You qualify for a condo and car loan." + } else if (annualIncome >= minIncomeForCar && creditScore >= minCreditScoreForCar) { + return "You qualify for a car loan." + } else { + return "You don't qualify for any loans." + } +} + +const duplexLoanMsg = getLoanMessage(85000, 850) +console.log(duplexLoanMsg) + +const condoLoanMsg = getLoanMessage(65000, 690) +console.log(condoLoanMsg) + +const carLoanMsg = getLoanMessage(45000, 660) +console.log(carLoanMsg) + +const noLoanMsg = getLoanMessage(25000, 550) +console.log(noLoanMsg) +``` diff --git a/curriculum/challenges/german/25-front-end-development/workshop-mario-database/5f2c289f164c29556da632fd.md b/curriculum/challenges/german/25-front-end-development/workshop-mario-database/5f2c289f164c29556da632fd.md new file mode 100644 index 0000000000..4e11751ca0 --- /dev/null +++ b/curriculum/challenges/german/25-front-end-development/workshop-mario-database/5f2c289f164c29556da632fd.md @@ -0,0 +1,19 @@ +--- +id: 5f2c289f164c29556da632fd +title: Build a Mario Database +challengeType: 12 +url: freeCodeCamp/learn-relational-databases-by-building-a-mario-database +dashedName: build-a-mario-database +--- + +# --description-- + +In this 165-lesson workshop, you will learn the basics of a relational database by creating a PostgreSQL database filled with video game characters. + +# --instructions-- + +# --hints-- + +# --seed-- + +# --solutions-- diff --git a/curriculum/challenges/german/25-front-end-development/workshop-npm-packages/587d7fb3367417b2b2512bfb.md b/curriculum/challenges/german/25-front-end-development/workshop-npm-packages/587d7fb3367417b2b2512bfb.md new file mode 100644 index 0000000000..8d4c90410d --- /dev/null +++ b/curriculum/challenges/german/25-front-end-development/workshop-npm-packages/587d7fb3367417b2b2512bfb.md @@ -0,0 +1,53 @@ +--- +id: 587d7fb3367417b2b2512bfb +title: How to Use package.json, the Core of Any Node.js Project or npm Package +challengeType: 2 +forumTopicId: 301528 +dashedName: how-to-use-package-json-the-core-of-any-node-js-project-or-npm-package +--- + +# --description-- + +Working on these challenges will involve you writing your code using one of the following methods: + +- Clone this GitHub repo and complete these challenges locally. +- Use our Gitpod starter project to complete these challenges. +- Use a site builder of your choice to complete the project. Be sure to incorporate all the files from our GitHub repo. + +The `package.json` file is the center of any Node.js project or npm package. It stores information about your project. It consists of a single JSON object where information is stored in key-value pairs. There are only two required fields; `name` and `version`, but it’s good practice to provide additional information. + +You can create the `package.json` file from the terminal using the `npm init` command. This will run a guided setup. Using `npm init` with the `-y` flag will generate the file without having it ask any questions, `npm init -y`. + +If you look at the file tree of your project, you will find the `package.json` file on the top level of the tree. This is the file that you will be improving in the next couple of challenges. + +One of the most common pieces of information in this file is the `author` field. It specifies who created the project, and can consist of a string or an object with contact or other details. An object is recommended for bigger projects, but a simple string like the following example will do for this project. + +```json +"author": "Jane Doe", +``` + +# --instructions-- + +Add your name as the `author` of the project in the `package.json` file. + +**Note:** Remember that you’re writing JSON, so all field names must use double-quotes (") and be separated with a comma (,). + +If you are using Gitpod, make sure the app is running and the preview window is open. Copy the preview window's URL and paste it into the Solution Link input below. + +# --hints-- + +`package.json` should have a valid "author" key + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert(packJson.author, '"author" is missing'); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/german/25-front-end-development/workshop-npm-packages/587d7fb3367417b2b2512bfc.md b/curriculum/challenges/german/25-front-end-development/workshop-npm-packages/587d7fb3367417b2b2512bfc.md new file mode 100644 index 0000000000..37d15d5261 --- /dev/null +++ b/curriculum/challenges/german/25-front-end-development/workshop-npm-packages/587d7fb3367417b2b2512bfc.md @@ -0,0 +1,43 @@ +--- +id: 587d7fb3367417b2b2512bfc +title: Add a Description to Your package.json +challengeType: 2 +forumTopicId: 301522 +dashedName: add-a-description-to-your-package-json +--- + +# --description-- + +The next part of a good package.json file is the `description` field; where a short, but informative description about your project belongs. + +If some day you plan to publish a package to npm, this is the string that should sell your idea to the user when they decide whether to install your package or not. However, that’s not the only use case for the description, it’s a great way to summarize what a project does. It’s just as important in any Node.js project to help other developers, future maintainers or even your future self understand the project quickly. + +Regardless of what you plan for your project, a description is definitely recommended. Here's an example: + +```json +"description": "A project that does something awesome", +``` + +# --instructions-- + +Add a `description` to the package.json file of your project. + +**Note:** Remember to use double-quotes for field-names (") and commas (,) to separate fields. + +# --hints-- + +package.json should have a valid "description" key + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert(packJson.description, '"description" is missing'); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/german/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bfd.md b/curriculum/challenges/german/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bfd.md new file mode 100644 index 0000000000..a001cdd477 --- /dev/null +++ b/curriculum/challenges/german/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bfd.md @@ -0,0 +1,75 @@ +--- +id: 587d7fb4367417b2b2512bfd +title: Add Keywords to Your package.json +challengeType: 2 +forumTopicId: 301526 +dashedName: add-keywords-to-your-package-json +--- + +# --description-- + +The `keywords` field is where you can describe your project using related keywords. Here's an example: + +```json +"keywords": [ "descriptive", "related", "words" ], +``` + +As you can see, this field is structured as an array of double-quoted strings. + +# --instructions-- + +Add an array of suitable strings to the `keywords` field in the package.json file of your project. + +One of the keywords should be "freecodecamp". + +# --hints-- + +package.json should have a valid "keywords" key + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert(packJson.keywords, '"keywords" is missing'); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + +"keywords" field should be an Array + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.isArray(packJson.keywords, '"keywords" is not an array'); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + +"keywords" should include "freecodecamp" + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.include( + packJson.keywords, + 'freecodecamp', + '"keywords" does not include "freecodecamp"' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/german/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bfe.md b/curriculum/challenges/german/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bfe.md new file mode 100644 index 0000000000..7b09acd042 --- /dev/null +++ b/curriculum/challenges/german/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bfe.md @@ -0,0 +1,39 @@ +--- +id: 587d7fb4367417b2b2512bfe +title: Add a License to Your package.json +challengeType: 2 +forumTopicId: 301523 +dashedName: add-a-license-to-your-package-json +--- + +# --description-- + +The `license` field is where you inform users of what they are allowed to do with your project. + +Some common licenses for open source projects include MIT and BSD. License information is not required, and copyright laws in most countries will give you ownership of what you create by default. However, it’s always a good practice to explicitly state what users can and can’t do. Here's an example of the license field: + +```json +"license": "MIT", +``` + +# --instructions-- + +Fill the `license` field in the package.json file of your project as you find suitable. + +# --hints-- + +package.json should have a valid "license" key + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert(packJson.license, '"license" is missing'); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/german/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bff.md b/curriculum/challenges/german/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bff.md new file mode 100644 index 0000000000..f2e571faed --- /dev/null +++ b/curriculum/challenges/german/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bff.md @@ -0,0 +1,37 @@ +--- +id: 587d7fb4367417b2b2512bff +title: Add a Version to Your package.json +challengeType: 2 +forumTopicId: 301525 +dashedName: add-a-version-to-your-package-json +--- + +# --description-- + +A `version` is one of the required fields of your package.json file. This field describes the current version of your project. Here's an example: + +```json +"version": "1.2.0", +``` + +# --instructions-- + +Add a `version` to the package.json file of your project. + +# --hints-- + +package.json should have a valid "version" key + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert(packJson.version, '"version" is missing'); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/german/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512c00.md b/curriculum/challenges/german/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512c00.md new file mode 100644 index 0000000000..161c60fe69 --- /dev/null +++ b/curriculum/challenges/german/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512c00.md @@ -0,0 +1,68 @@ +--- +id: 587d7fb4367417b2b2512c00 +title: Expand Your Project with External Packages from npm +challengeType: 2 +forumTopicId: 301527 +dashedName: expand-your-project-with-external-packages-from-npm +--- + +# --description-- + +One of the biggest reasons to use a package manager, is their powerful dependency management. Instead of manually having to make sure that you get all dependencies whenever you set up a project on a new computer, npm automatically installs everything for you. But how can npm know exactly what your project needs? Meet the `dependencies` section of your package.json file. + +In this section, packages your project requires are stored using the following format: + +```json +"dependencies": { + "package-name": "version", + "express": "4.14.0" +} + +``` + +# --instructions-- + +Add version `1.1.0` of the `@freecodecamp/example` package to the `dependencies` field of your `package.json` file. + +**Note:** `@freecodecamp/example` is a faux package used as a learning tool. + +# --hints-- + +`"dependencies"` should include `"@freecodecamp/example"`. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.property( + packJson.dependencies, + '@freecodecamp/example', + '"dependencies" does not include "@freecodecamp/example"' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + +`"@freecodecamp/example"` version should be `"1.1.0"`. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.match( + packJson.dependencies["@freecodecamp/example"], + /^[\^\~]?1\.1\.0/, + 'Wrong version of "@freecodecamp/example" installed. It should be 1.1.0' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/german/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c01.md b/curriculum/challenges/german/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c01.md new file mode 100644 index 0000000000..deda9b82de --- /dev/null +++ b/curriculum/challenges/german/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c01.md @@ -0,0 +1,64 @@ +--- +id: 587d7fb5367417b2b2512c01 +title: Manage npm Dependencies By Understanding Semantic Versioning +challengeType: 2 +forumTopicId: 301529 +dashedName: manage-npm-dependencies-by-understanding-semantic-versioning +--- + +# --description-- + +`Versions` of the npm packages in the dependencies section of your package.json file follow what’s called Semantic Versioning (SemVer), an industry standard for software versioning aiming to make it easier to manage dependencies. Libraries, frameworks or other tools published on npm should use SemVer in order to clearly communicate what kind of changes projects can expect if they update. + +Knowing SemVer can be useful when you develop software that uses external dependencies (which you almost always do). One day, your understanding of these numbers will save you from accidentally introducing breaking changes to your project without understanding why things that worked yesterday suddenly don’t work today. This is how Semantic Versioning works according to the official website: + +```json +"package": "MAJOR.MINOR.PATCH" +``` + +The MAJOR version should increment when you make incompatible API changes. The MINOR version should increment when you add functionality in a backwards-compatible manner. The PATCH version should increment when you make backwards-compatible bug fixes. This means that PATCHes are bug fixes and MINORs add new features but neither of them break what worked before. Finally, MAJORs add changes that won’t work with earlier versions. + +# --instructions-- + +In the dependencies section of your `package.json` file, change the version of `@freecodecamp/example` to match MAJOR version 1, MINOR version 2 and PATCH version 13 + +# --hints-- + +`"dependencies"` should include `"@freecodecamp/example"`. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.property( + packJson.dependencies, + '@freecodecamp/example', + '"dependencies" does not include "@freecodecamp/example"' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + +`"@freecodecamp/example"` version should be `"1.2.13"`. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.equal( + packJson.dependencies["@freecodecamp/example"], + '1.2.13', + 'Wrong version of "@freecodecamp/example". It should be 1.2.13' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/german/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c02.md b/curriculum/challenges/german/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c02.md new file mode 100644 index 0000000000..8eae5f51ee --- /dev/null +++ b/curriculum/challenges/german/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c02.md @@ -0,0 +1,66 @@ +--- +id: 587d7fb5367417b2b2512c02 +title: Use the Tilde-Character to Always Use the Latest Patch Version of a Dependency +challengeType: 2 +forumTopicId: 301532 +dashedName: use-the-tilde-character-to-always-use-the-latest-patch-version-of-a-dependency +--- + +# --description-- + +In the last challenge, you told npm to only include a specific version of a package. That’s a useful way to freeze your dependencies if you need to make sure that different parts of your project stay compatible with each other. But in most use cases, you don’t want to miss bug fixes since they often include important security patches and (hopefully) don’t break things in doing so. + +To allow an npm dependency to update to the latest PATCH version, you can prefix the dependency’s version with the tilde (`~`) character. Here's an example of how to allow updates to any `1.3.x` version. + +```json +"package": "~1.3.8" +``` + +# --instructions-- + +In the package.json file, your current rule for how npm may upgrade `@freecodecamp/example` is to use a specific version (`1.2.13`). But now, you want to allow the latest `1.2.x` version. + +Use the tilde (`~`) character to prefix the version of `@freecodecamp/example` in your dependencies, and allow npm to update it to any new _patch_ release. + +**Note:** The version numbers themselves should not be changed. + +# --hints-- + +`"dependencies"` should include `"@freecodecamp/example"`. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.property( + packJson.dependencies, + '@freecodecamp/example', + '"dependencies" does not include "@freecodecamp/example"' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + +`"@freecodecamp/example"` version should match `"~1.2.13"`. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.match( + packJson.dependencies["@freecodecamp/example"], + /^\~1\.2\.13/, + 'Wrong version of "@freecodecamp/example". It should be ~1.2.13' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/german/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c03.md b/curriculum/challenges/german/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c03.md new file mode 100644 index 0000000000..adc3014ea4 --- /dev/null +++ b/curriculum/challenges/german/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c03.md @@ -0,0 +1,66 @@ +--- +id: 587d7fb5367417b2b2512c03 +title: Use the Caret-Character to Use the Latest Minor Version of a Dependency +challengeType: 2 +forumTopicId: 301531 +dashedName: use-the-caret-character-to-use-the-latest-minor-version-of-a-dependency +--- + +# --description-- + +Similar to how the tilde we learned about in the last challenge allows npm to install the latest PATCH for a dependency, the caret (`^`) allows npm to install future updates as well. The difference is that the caret will allow both MINOR updates and PATCHes. + +Your current version of `@freecodecamp/example` should be `~1.2.13` which allows npm to install to the latest `1.2.x` version. If you were to use the caret (^) as a version prefix instead, npm would be allowed to update to any `1.x.x` version. + +```json +"package": "^1.3.8" +``` + +This would allow updates to any `1.x.x` version of the package. + +# --instructions-- + +Use the caret (`^`) to prefix the version of `@freecodecamp/example` in your dependencies and allow npm to update it to any new MINOR release. + +**Note:** The version numbers themselves should not be changed. + +# --hints-- + +`"dependencies"` should include `"@freecodecamp/example"`. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.property( + packJson.dependencies, + '@freecodecamp/example', + '"dependencies" does not include "@freecodecamp/example"' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + +`"@freecodecamp/example"` version should match `"^1.x.x"`. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.match( + packJson.dependencies["@freecodecamp/example"], + /^\^1\./, + 'Wrong version of "@freecodecamp/example". It should be ^1.2.13' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/german/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c04.md b/curriculum/challenges/german/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c04.md new file mode 100644 index 0000000000..5f695eed88 --- /dev/null +++ b/curriculum/challenges/german/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c04.md @@ -0,0 +1,43 @@ +--- +id: 587d7fb5367417b2b2512c04 +title: Remove a Package from Your Dependencies +challengeType: 2 +forumTopicId: 301530 +dashedName: remove-a-package-from-your-dependencies +--- + +# --description-- + +You have now tested a few ways you can manage dependencies of your project by using the package.json's dependencies section. You have also included external packages by adding them to the file and even told npm what types of versions you want, by using special characters such as the tilde or the caret. + +But what if you want to remove an external package that you no longer need? You might already have guessed it, just remove the corresponding key-value pair for that package from your dependencies. + +This same method applies to removing other fields in your package.json as well. + +# --instructions-- + +Remove the `@freecodecamp/example` package from your dependencies. + +**Note:** Make sure you have the right amount of commas after removing it. + +# --hints-- + +`"dependencies"` should not include `"@freecodecamp/example"`. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.notProperty( + packJson.dependencies, + '@freecodecamp/example', + '"dependencies" still includes "@freecodecamp/example"' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/italian/13-relational-databases/build-a-periodic-table-database-project/build-a-periodic-table-database.md b/curriculum/challenges/italian/13-relational-databases/build-a-periodic-table-database-project/build-a-periodic-table-database.md index b284ce61c9..92943db202 100644 --- a/curriculum/challenges/italian/13-relational-databases/build-a-periodic-table-database-project/build-a-periodic-table-database.md +++ b/curriculum/challenges/italian/13-relational-databases/build-a-periodic-table-database-project/build-a-periodic-table-database.md @@ -8,7 +8,7 @@ dashedName: build-a-periodic-table-database # --description-- -Questo è uno dei progetti richiesti per completare la certificazione. Per questo progetto, creerai uno script Bash per ottenere informazioni sugli elementi chimici da un database della tavola periodica. +Questo è uno dei progetti richiesti per completare la certificazione. For this project, you will create a Bash script to get information about chemical elements from a periodic table database. # --instructions-- diff --git a/curriculum/challenges/italian/14-responsive-web-design-22/learn-basic-css-by-building-a-cafe-menu/5f3ef6e0a81099d9a697b550.md b/curriculum/challenges/italian/14-responsive-web-design-22/learn-basic-css-by-building-a-cafe-menu/5f3ef6e0a81099d9a697b550.md index 81b4ccebac..6b33708d31 100644 --- a/curriculum/challenges/italian/14-responsive-web-design-22/learn-basic-css-by-building-a-cafe-menu/5f3ef6e0a81099d9a697b550.md +++ b/curriculum/challenges/italian/14-responsive-web-design-22/learn-basic-css-by-building-a-cafe-menu/5f3ef6e0a81099d9a697b550.md @@ -9,6 +9,8 @@ dashedName: step-64 Aggiungi un elemento `p` all'interno del `footer`. Poi, annida un elemento di ancoraggio (`a`) nell'elemento `p` contenente il link `https://www.freecodecamp.org` e il testo `Visit our website`. +Make sure that the link opens in a new tab by adding a `target` attribute with the value `_blank`. + # --hints-- Non dovresti modificare l'elemento `footer` esistente. @@ -43,6 +45,12 @@ Il nuovo elemento `a` dovrebbe contenere il link `https://www.freecodecamp.org`. assert(document.querySelector("footer > p > a")?.href === "https://www.freecodecamp.org/"); ``` +Your new `a` element should have the `target` attribute set to `_blank`. + +```js +assert.equal(document.querySelector("footer > p > a")?.target, "_blank"); +``` + # --seed-- ## --seed-contents-- diff --git a/curriculum/challenges/italian/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-j.md b/curriculum/challenges/italian/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-j.md index d2ad72a1ea..1b6ca05444 100644 --- a/curriculum/challenges/italian/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-j.md +++ b/curriculum/challenges/italian/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-j.md @@ -21,12 +21,12 @@ Remove `flex: 1` from `.item` and add `justify-content: space-between` to `.cont `justify-content` aligns items across the **main axis**. There are a few values that you can use here. You'll learn the rest of them in the reading assignments, but for now try changing it to center, which should center the boxes along the main axis. -# --question-- - -## --assignment-- +# --assignment-- Before moving on to the next lesson, see what is possible with the `justify-content` property. Read this [interactive article on MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/justify-content) and play around with the different values of `justify-content` on the example. +# --question-- + ## --text-- How does applying `justify-content: space-between` to a flex container affect the positioning of its items? diff --git a/curriculum/challenges/italian/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-k.md b/curriculum/challenges/italian/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-k.md index d3137b0af5..59acb55a29 100644 --- a/curriculum/challenges/italian/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-k.md +++ b/curriculum/challenges/italian/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-k.md @@ -17,12 +17,12 @@ To change the placement of items along the cross axis use `align-items`. Try get Because `justify-content` and `align-items` are based on the main and cross axis of your container, their behavior changes when you change the flex-direction of a flex-container. For example, when you change `flex-direction` to `column`, `justify-content` aligns vertically and `align-items` aligns horizontally. The most common behavior, however, is the default, i.e. `justify-content` aligns items horizontally (because the main axis defaults to horizontal), and `align-items` aligns them vertically. One of the biggest sticking points that beginners have with flexbox is confusion when this behavior changes. -# --question-- - -## --assignment-- +# --assignment-- Before moving on to the next lesson, see if you can figure out how `align-items` behaves when you change the `flex-direction` property to `column`. +# --question-- + ## --text-- When changing the `flex-direction` property to `column` in a flex container, how does `align-items` behave in relation to the flex items? diff --git a/curriculum/challenges/italian/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-b.md b/curriculum/challenges/italian/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-b.md index 1adf9ce84f..49edeac0e4 100644 --- a/curriculum/challenges/italian/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-b.md +++ b/curriculum/challenges/italian/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-b.md @@ -9,12 +9,12 @@ dashedName: learn-block-and-inline-lesson-b Inline elements, however, do not start on a new line. They appear in line with whatever elements they are placed beside. A clear example of an inline element is a link, or `` tag. If you stick one of these in the middle of a paragraph of text, it will behave like a part of the paragraph. (Like this) The link’s text will sit alongside other words in that paragraph. Additionally, padding and margin behave differently on inline elements. In general, you do not want to try to put extra padding or margin on inline elements. -# --question-- - -## --assignment-- +# --assignment-- Search the web for a list of `block` elements and a list of `inline` elements. +# --question-- + ## --text-- What is the difference between a `block` element and an `inline` element? diff --git a/curriculum/challenges/italian/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-g.md b/curriculum/challenges/italian/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-g.md index cdd4d5aa87..e75492e9c1 100644 --- a/curriculum/challenges/italian/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-g.md +++ b/curriculum/challenges/italian/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-g.md @@ -7,7 +7,7 @@ dashedName: learn-block-and-inline-lesson-g # --description-- -Now that you have some basic understanding of `block` and inline `elements`, pull up your list of `block` and `inline` elements from a couple questions ago and see if you can identify which of the following elements are `block` elements and which are `inline` elements. +Now that you have some basic understanding of `block` and `inline` elements, pull up your list of `block` and `inline` elements from a couple questions ago and see if you can identify which of the following elements are `block` elements and which are `inline` elements. # --question-- diff --git a/curriculum/challenges/italian/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-a.md b/curriculum/challenges/italian/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-a.md index 995073b8a2..a7a2ee9a51 100644 --- a/curriculum/challenges/italian/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-a.md +++ b/curriculum/challenges/italian/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-a.md @@ -21,12 +21,12 @@ New programmers often find problem solving the hardest skill to build. It's not The best way to improve your problem solving ability is by building experience by making lots and lots of programs. The more practice you have the better you'll be prepared to solve real world problems. -# --question-- - -## --assignment-- +# --assignment-- Read How to Think Like a Programmer - Lessons in Problem Solving by Richard Reis. +# --question-- + ## --text-- According to V. Anton Spraul in "Think Like a Programmer," what is problem solving in programming? diff --git a/curriculum/challenges/italian/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-b.md b/curriculum/challenges/italian/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-b.md index ae905ecf89..c57a7d43e8 100644 --- a/curriculum/challenges/italian/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-b.md +++ b/curriculum/challenges/italian/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-b.md @@ -25,11 +25,11 @@ Now that you know what you’re aiming to solve, don’t jump into coding just y The last question is where you will write out an algorithm to solve the problem. You can think of an algorithm as a recipe for solving a particular problem. It defines the steps that need to be taken by the computer to solve a problem in pseudocode. -# --question-- - -## --assignment-- +# --assignment-- Watch How to Begin Thinking Like a Programmer by Coding Tech. It’s an hour long but packed full of information and definitely worth your time watching. +# --question-- + ## --text-- What should you do before starting to code according to the provided text? diff --git a/curriculum/challenges/italian/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-c.md b/curriculum/challenges/italian/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-c.md index c837fd9658..082f2d51ae 100644 --- a/curriculum/challenges/italian/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-c.md +++ b/curriculum/challenges/italian/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-c.md @@ -22,12 +22,12 @@ Print the value of the counter variable This is a basic program to demonstrate how pseudocode looks. There will be more examples of pseudocode included in the assignments. +# --assignment-- -# --question-- - -## --assignment-- Read this Pseudocode: What It Is and How to Write It article from Built In. +# --question-- + ## --text-- What are the benefits of using pseudocode according to the linked article? diff --git a/curriculum/challenges/italian/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657b69e10d6606a0185d4d4f.md b/curriculum/challenges/italian/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657b69e10d6606a0185d4d4f.md index de8a8a3f51..567708f620 100644 --- a/curriculum/challenges/italian/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657b69e10d6606a0185d4d4f.md +++ b/curriculum/challenges/italian/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657b69e10d6606a0185d4d4f.md @@ -9,7 +9,7 @@ dashedName: task-23 # --description-- -So far you have learned how to create questions with the verb to be. In sentences with the verb `to be` (am, is, are) you just have to change the order of the noun and the verb to create a question. Like this: +So far you have learned how to create questions with the verb `to be`. In sentences with the verb `to be` (am, is, are) you just have to change the order of the noun and the verb to create a question. Like this: `You are a developer` -> `Are you a developer?` diff --git a/curriculum/challenges/italian/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657dce8ff35869721311a5e3.md b/curriculum/challenges/italian/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657dce8ff35869721311a5e3.md index 544d8f1988..8cd311a518 100644 --- a/curriculum/challenges/italian/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657dce8ff35869721311a5e3.md +++ b/curriculum/challenges/italian/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657dce8ff35869721311a5e3.md @@ -21,7 +21,7 @@ Which sentence is correct for describing one place near you? ### --feedback-- -`There are` is used for plural nouns, and `bank` is singular. You’ll learn about there are in the next few lessons. +`There are` is used for plural nouns, and `bank` is singular. You’ll learn about `there are` in the next few lessons. --- diff --git a/curriculum/challenges/italian/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657dcee413423174ca3747f5.md b/curriculum/challenges/italian/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657dcee413423174ca3747f5.md index 6526b1e95b..10c0845779 100644 --- a/curriculum/challenges/italian/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657dcee413423174ca3747f5.md +++ b/curriculum/challenges/italian/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657dcee413423174ca3747f5.md @@ -7,7 +7,7 @@ dashedName: task-112 # --description-- -To elaborate a question using `there is` you just need to change the order of the verb to be, like so: +To elaborate a question using `there is` you just need to change the order of the verb `to be`, like so: `There is an ATM nearby` -> `Is there an ATM nearby?` diff --git a/curriculum/challenges/italian/25-front-end-development/lab-celestial-bodies-database/5f1a4ef5d5d6b5ab580fc6ae.md b/curriculum/challenges/italian/25-front-end-development/lab-celestial-bodies-database/5f1a4ef5d5d6b5ab580fc6ae.md new file mode 100644 index 0000000000..7d664a8876 --- /dev/null +++ b/curriculum/challenges/italian/25-front-end-development/lab-celestial-bodies-database/5f1a4ef5d5d6b5ab580fc6ae.md @@ -0,0 +1,25 @@ +--- +id: 5f1a4ef5d5d6b5ab580fc6ae +title: Build a Celestial Bodies Database +challengeType: 13 +url: freeCodeCamp/learn-celestial-bodies-database +dashedName: lab-celestial-bodies-database +--- + +# --description-- + +For this project, you will build a database of celestial bodies using PostgreSQL. + +# --instructions-- + +**Important:** After you pass all the project tests, save a dump of your database into a `universe.sql` file so you can complete step 2. There will be instructions how to do that within the virtual machine. + +# --notes-- + +Required files: `universe.sql` + +# --hints-- + +# --seed-- + +# --solutions-- diff --git a/curriculum/challenges/italian/25-front-end-development/lab-exercise-tracker/5a8b073d06fa14fcfde687aa.md b/curriculum/challenges/italian/25-front-end-development/lab-exercise-tracker/5a8b073d06fa14fcfde687aa.md new file mode 100644 index 0000000000..9492b82cb4 --- /dev/null +++ b/curriculum/challenges/italian/25-front-end-development/lab-exercise-tracker/5a8b073d06fa14fcfde687aa.md @@ -0,0 +1,611 @@ +--- +id: 5a8b073d06fa14fcfde687aa +title: Build an Exercise Tracker +challengeType: 4 +dashedName: build-an-exercise-tracker +--- + +# --description-- + +Build a full stack JavaScript app that is functionally similar to this: https://exercise-tracker.freecodecamp.rocks. Working on this project will involve you writing your code using one of the following methods: + +- Clone this GitHub repo and complete your project locally. +- Use our Gitpod starter project to complete your project. +- Use a site builder of your choice to complete the project. Be sure to incorporate all the files from our GitHub repo. + +# --instructions-- + +Your responses should have the following structures. + +Exercise: + +```js +{ + username: "fcc_test", + description: "test", + duration: 60, + date: "Mon Jan 01 1990", + _id: "5fb5853f734231456ccb3b05" +} +``` + +User: + +```js +{ + username: "fcc_test", + _id: "5fb5853f734231456ccb3b05" +} +``` + +Log: + +```js +{ + username: "fcc_test", + count: 1, + _id: "5fb5853f734231456ccb3b05", + log: [{ + description: "test", + duration: 60, + date: "Mon Jan 01 1990", + }] +} +``` + +**Hint:** For the `date` property, the `toDateString` method of the `Date` API can be used to achieve the expected output. + +# --hints-- + +You should provide your own project, not the example URL. + +```js +(getUserInput) => { + const url = getUserInput('url'); + assert( + !/.*\/exercise-tracker\.freecodecamp\.rocks/.test(getUserInput('url')) + ); +}; +``` + +You can `POST` to `/api/users` with form data `username` to create a new user. + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `username=fcc_test_${Date.now()}`.substring(0, 29) + }); + assert.isTrue(res.ok); + if(!res.ok) { + throw new Error(`${res.status} ${res.statusText}`) + }; +}; +``` + +The returned response from `POST /api/users` with form data `username` will be an object with `username` and `_id` properties. + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `username=fcc_test_${Date.now()}`.substring(0, 29) + }); + if (res.ok) { + const { _id, username } = await res.json(); + assert.exists(_id); + assert.exists(username); + } else { + throw new Error(`${res.status} ${res.statusText}`); + } +}; +``` + +You can make a `GET` request to `/api/users` to get a list of all users. + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users'); + assert.isTrue(res.ok); + if(!res.ok) { + throw new Error(`${res.status} ${res.statusText}`) + }; +}; +``` + +The `GET` request to `/api/users` returns an array. + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users'); + if(res.ok){ + const users = await res.json(); + assert.isArray(users); + } else { + throw new Error(`${res.status} ${res.statusText}`); + }; +}; +``` + +Each element in the array returned from `GET /api/users` is an object literal containing a user's `username` and `_id`. + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users'); + if(res.ok){ + const users = await res.json(); + const user = users[0]; + assert.exists(user); + assert.exists(user.username); + assert.exists(user._id); + assert.isString(user.username); + assert.isString(user._id); + } else { + throw new Error(`${res.status} ${res.statusText}`); + }; +}; +``` + +You can `POST` to `/api/users/:_id/exercises` with form data `description`, `duration`, and optionally `date`. If no date is supplied, the current date will be used. + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `username=fcc_test_${Date.now()}`.substring(0, 29) + }); + if (res.ok) { + const { _id, username } = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: 'Mon Jan 01 1990' + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `description=${expected.description}&duration=${expected.duration}&date=1990-01-01` + }); + assert.isTrue(addRes.ok); + if(!addRes.ok) { + throw new Error(`${addRes.status} ${addRes.statusText}`) + }; + } else { + throw new Error(`${res.status} ${res.statusText}`); + } +}; +``` + +The response returned from `POST /api/users/:_id/exercises` will be the user object with the exercise fields added. + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `username=fcc_test_${Date.now()}`.substring(0, 29) + }); + if (res.ok) { + const { _id, username } = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: 'Mon Jan 01 1990' + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `description=${expected.description}&duration=${expected.duration}&date=1990-01-01` + }); + if (addRes.ok) { + const actual = await addRes.json(); + assert.deepEqual(actual, expected); + assert.isString(actual.description); + assert.isNumber(actual.duration); + assert.isString(actual.date); + } else { + throw new Error(`${addRes.status} ${addRes.statusText}`); + } + } else { + throw new Error(`${res.status} ${res.statusText}`); + } +}; +``` + +You can make a `GET` request to `/api/users/:_id/logs` to retrieve a full exercise log of any user. + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `username=fcc_test_${Date.now()}`.substring(0, 29) + }); + if (res.ok) { + const { _id, username } = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: new Date().toDateString() + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `description=${expected.description}&duration=${expected.duration}` + }); + if (addRes.ok) { + const logRes = await fetch(url + `/api/users/${_id}/logs`); + assert.isTrue(logRes.ok); + if(!logRes.ok) { + throw new Error(`${logRes.status} ${logRes.statusText}`) + }; + } else { + throw new Error(`${addRes.status} ${addRes.statusText}`); + } + } else { + throw new Error(`${res.status} ${res.statusText}`); + } +}; +``` + +A request to a user's log `GET /api/users/:_id/logs` returns a user object with a `count` property representing the number of exercises that belong to that user. + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `username=fcc_test_${Date.now()}`.substring(0, 29) + }); + if (res.ok) { + const { _id, username } = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: new Date().toDateString() + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `description=${expected.description}&duration=${expected.duration}` + }); + if (addRes.ok) { + const logRes = await fetch(url + `/api/users/${_id}/logs`); + if (logRes.ok) { + const { count } = await logRes.json(); + assert(count); + } else { + throw new Error(`${logRes.status} ${logRes.statusText}`); + } + } else { + throw new Error(`${addRes.status} ${addRes.statusText}`); + } + } else { + throw new Error(`${res.status} ${res.statusText}`); + } +}; +``` + +A `GET` request to `/api/users/:_id/logs` will return the user object with a `log` array of all the exercises added. + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded' + }, + body: `username=fcc_test_${Date.now()}`.substring(0, 29) + }) + if(res.ok){ + const {_id, username} = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: new Date().toDateString() + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `description=${expected.description}&duration=${expected.duration}` + }); + if(addRes.ok){ + const logRes = await fetch(url + `/api/users/${_id}/logs`); + if(logRes.ok) { + const {log} = await logRes.json(); + assert.isArray(log); + assert.equal(1, log.length); + } else { + throw new Error(`${logRes.status} ${logRes.statusText}`); + } + } else { + throw new Error(`${addRes.status} ${addRes.statusText}`); + }; + } else { + throw new Error(`${res.status} ${res.statusText}`) + }; +}; +``` + +Each item in the `log` array that is returned from `GET /api/users/:_id/logs` is an object that should have a `description`, `duration`, and `date` properties. + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + `/api/users`, { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded' + }, + body: `username=fcc_test_${Date.now()}`.substring(0, 29) + }); + if(res.ok) { + const {_id, username} = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: new Date().toDateString() + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `description=${expected.description}&duration=${expected.duration}` + }); + if(addRes.ok) { + const logRes = await fetch(url + `/api/users/${_id}/logs`); + if(logRes.ok) { + const {log} = await logRes.json(); + const exercise = log[0]; + assert.exists(exercise); + assert.exists(exercise.description); + assert.exists(exercise.duration); + assert.exists(exercise.date); + } else { + throw new Error(`${logRes.status} ${logRes.statusText}`); + }; + } else { + throw new Error(`${addRes.status} ${addRes.statusText}`); + }; + } else { + throw new Error(`${res.status} ${res.statusText}`) + }; +}; +``` + +The `description` property of any object in the `log` array that is returned from `GET /api/users/:_id/logs` should be a string. + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + body: `username=fcc_test_${Date.now()}`.substring(0,29) + }); + if(res.ok) { + const {_id, username} = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: new Date().toDateString() + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + body: `description=${expected.description}&duration=${expected.duration}` + }); + if(addRes.ok) { + const logRes = await fetch(url + `/api/users/${_id}/logs`); + if(logRes.ok){ + const {log} = await logRes.json(); + const exercise = log[0]; + assert.isString(exercise.description); + assert.equal(exercise.description, expected.description); + } else { + throw new Error(`${logRes.status} ${logRes.statusText}`); + } + } else { + throw new Error(`${addRes.status} ${addRes.statusText}`); + }; + } else { + throw new Error(`${res.status} ${res.statusText}`); + }; +}; +``` + +The `duration` property of any object in the `log` array that is returned from `GET /api/users/:_id/logs` should be a number. + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + body: `username=fcc_test_${Date.now()}`.substring(0,29) + }); + if(res.ok) { + const {_id, username} = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: new Date().toDateString() + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + body: `description=${expected.description}&duration=${expected.duration}` + }); + if(addRes.ok) { + const logRes = await fetch(url + `/api/users/${_id}/logs`); + if(logRes.ok){ + const {log} = await logRes.json(); + const exercise = log[0]; + assert.isNumber(exercise.duration); + assert.equal(exercise.duration, expected.duration); + } else { + throw new Error(`${logRes.status} ${logRes.statusText}`); + } + } else { + throw new Error(`${addRes.status} ${addRes.statusText}`); + }; + } else { + throw new Error(`${res.status} ${res.statusText}`); + }; +}; +``` + +The `date` property of any object in the `log` array that is returned from `GET /api/users/:_id/logs` should be a string. Use the `dateString` format of the `Date` API. + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + body: `username=fcc_test_${Date.now()}`.substring(0,29) + }); + if(res.ok) { + const {_id, username} = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: new Date().toLocaleDateString("en-US", { + timeZone: "UTC", weekday: "short", month: "short", + day: "2-digit", year: "numeric" + }).replaceAll(',', '') + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + body: `description=${expected.description}&duration=${expected.duration}` + }); + if(addRes.ok) { + const logRes = await fetch(url + `/api/users/${_id}/logs`); + if(logRes.ok){ + const {log} = await logRes.json(); + const exercise = log[0]; + assert.isString(exercise.date); + assert.equal(exercise.date, expected.date); + } else { + throw new Error(`${logRes.status} ${logRes.statusText}`); + } + } else { + throw new Error(`${addRes.status} ${addRes.statusText}`); + }; + } else { + throw new Error(`${res.status} ${res.statusText}`); + }; +}; +``` + +You can add `from`, `to` and `limit` parameters to a `GET /api/users/:_id/logs` request to retrieve part of the log of any user. `from` and `to` are dates in `yyyy-mm-dd` format. `limit` is an integer of how many logs to send back. + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `username=fcc_test_${Date.now()}`.substring(0, 29) + }); + if (res.ok) { + const { _id, username } = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: new Date().toDateString() + }; + const addExerciseRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `description=${expected.description}&duration=${expected.duration}&date=1990-01-01` + }); + const addExerciseTwoRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `description=${expected.description}&duration=${expected.duration}&date=1990-01-03` + }); + if (addExerciseRes.ok && addExerciseTwoRes.ok) { + const logRes = await fetch( + url + `/api/users/${_id}/logs?from=1989-12-31&to=1990-01-04` + ); + if (logRes.ok) { + const { log } = await logRes.json(); + assert.isArray(log); + assert.equal(2, log.length); + } else { + throw new Error(`${logRes.status} ${logRes.statusText}`); + } + const limitRes = await fetch( + url + `/api/users/${_id}/logs?limit=1` + ); + if (limitRes.ok) { + const { log } = await limitRes.json(); + assert.isArray(log); + assert.equal(1, log.length); + } else { + throw new Error(`${limitRes.status} ${limitRes.statusText}`); + } + const filterDateBeforeLimitRes = await fetch( + url + `/api/users/${_id}/logs?from=1990-01-02&to=1990-01-04&limit=1` + ); + if (filterDateBeforeLimitRes.ok) { + const { log } = await filterDateBeforeLimitRes.json(); + assert.isArray(log); + assert.equal(1, log.length); + } else { + throw new Error(`${filterDateBeforeLimitRes.status} ${filterDateBeforeLimitRes.statusText}`); + } + } else { + throw new Error(`${res.status} ${res.statusText}`); + } + } else { + throw new Error(`${res.status} ${res.statusText}`); + } +}; +``` diff --git a/curriculum/challenges/italian/25-front-end-development/lab-number-guessing-game/602da04c22201c65d2a019f4.md b/curriculum/challenges/italian/25-front-end-development/lab-number-guessing-game/602da04c22201c65d2a019f4.md new file mode 100644 index 0000000000..ef87dc6720 --- /dev/null +++ b/curriculum/challenges/italian/25-front-end-development/lab-number-guessing-game/602da04c22201c65d2a019f4.md @@ -0,0 +1,25 @@ +--- +id: 602da04c22201c65d2a019f4 +title: Build a Number Guessing Game +challengeType: 13 +url: freeCodeCamp/learn-number-guessing-game +dashedName: lab-number-guessing-game +--- + +# --description-- + +For this lab, you will use Bash scripting, PostgreSQL, and Git to create a number guessing game that runs in the terminal and saves user information. + +# --instructions-- + +**Important:** After you pass all the project tests, save a dump of your database into a `number_guess.sql` file, as well as your `number_guess.sh` file, so you can complete step 2. There will be instructions on how to do that within the virtual machine. + +# --notes-- + +Required files: `number_guess.sql`, `number_guess.sh` + +# --hints-- + +# --seed-- + +# --solutions-- diff --git a/curriculum/challenges/italian/25-front-end-development/lab-request-header-parser-microservice/bd7158d8c443edefaeb5bdff.md b/curriculum/challenges/italian/25-front-end-development/lab-request-header-parser-microservice/bd7158d8c443edefaeb5bdff.md new file mode 100644 index 0000000000..5040e27424 --- /dev/null +++ b/curriculum/challenges/italian/25-front-end-development/lab-request-header-parser-microservice/bd7158d8c443edefaeb5bdff.md @@ -0,0 +1,65 @@ +--- +id: bd7158d8c443edefaeb5bdff +title: Build a Request Header Parser Microservice +challengeType: 4 +dashedName: lab-request-header-parser-microservice +--- + +# --description-- + +Build a full stack JavaScript app that is functionally similar to this: https://request-header-parser-microservice.freecodecamp.rocks/. Working on this project will involve you writing your code using one of the following methods: + +- Clone this GitHub repo and complete your project locally. +- Use our Gitpod starter project to complete your project. +- Use a site builder of your choice to complete the project. Be sure to incorporate all the files from our GitHub repo. + +# --hints-- + +You should provide your own project, not the example URL. + +```js +(getUserInput) => { + assert( + !/.*\/request-header-parser-microservice\.freecodecamp\.rocks/.test( + getUserInput('url') + ) + ); +}; +``` + +A request to `/api/whoami` should return a JSON object with your IP address in the `ipaddress` key. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/api/whoami').then( + (data) => assert(data.ipaddress && data.ipaddress.length > 0), + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + +A request to `/api/whoami` should return a JSON object with your preferred language in the `language` key. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/api/whoami').then( + (data) => assert(data.language && data.language.length > 0), + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + +A request to `/api/whoami` should return a JSON object with your software in the `software` key. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/api/whoami').then( + (data) => assert(data.software && data.software.length > 0), + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/italian/25-front-end-development/lab-url-shortener-microservice/bd7158d8c443edefaeb5bd0e.md b/curriculum/challenges/italian/25-front-end-development/lab-url-shortener-microservice/bd7158d8c443edefaeb5bd0e.md new file mode 100644 index 0000000000..0fbf80a0bf --- /dev/null +++ b/curriculum/challenges/italian/25-front-end-development/lab-url-shortener-microservice/bd7158d8c443edefaeb5bd0e.md @@ -0,0 +1,107 @@ +--- +id: bd7158d8c443edefaeb5bd0e +title: URL Shortener Microservice +challengeType: 4 +dashedName: url-shortener-microservice +--- + +# --description-- + +Build a full stack JavaScript app that is functionally similar to this: https://url-shortener-microservice.freecodecamp.rocks. Working on this project will involve you writing your code using one of the following methods: + +- Clone this GitHub repo and complete your project locally. +- Use our Gitpod starter project to complete your project. +- Use a site builder of your choice to complete the project. Be sure to incorporate all the files from our GitHub repo. + +# --instructions-- + +**HINT:** Do not forget to use a body parsing middleware to handle the POST requests. Also, you can use the function `dns.lookup(host, cb)` from the `dns` core module to verify a submitted URL. + +# --hints-- + +You should provide your own project, not the example URL. + +```js +(getUserInput) => { + assert( + !/.*\/url-shortener-microservice\.freecodecamp\.rocks/.test( + getUserInput('url') + ) + ); +}; +``` + +You can POST a URL to `/api/shorturl` and get a JSON response with `original_url` and `short_url` properties. Here's an example: `{ original_url : 'https://freeCodeCamp.org', short_url : 1}` + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const urlVariable = Date.now(); + const fullUrl = `${url}/?v=${urlVariable}` + const res = await fetch(url + '/api/shorturl', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `url=${fullUrl}` + }); + if (res.ok) { + const { short_url, original_url } = await res.json(); + assert.isNotNull(short_url); + assert.strictEqual(original_url, `${url}/?v=${urlVariable}`); + } else { + throw new Error(`${res.status} ${res.statusText}`); + } +}; +``` + +When you visit `/api/shorturl/`, you will be redirected to the original URL. + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const urlVariable = Date.now(); + const fullUrl = `${url}/?v=${urlVariable}` + let shortenedUrlVariable; + const postResponse = await fetch(url + '/api/shorturl', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `url=${fullUrl}` + }); + if (postResponse.ok) { + const { short_url } = await postResponse.json(); + shortenedUrlVariable = short_url; + } else { + throw new Error(`${postResponse.status} ${postResponse.statusText}`); + } + const getResponse = await fetch( + url + '/api/shorturl/' + shortenedUrlVariable + ); + if (getResponse) { + const { redirected, url } = getResponse; + assert.isTrue(redirected); + assert.strictEqual(url,fullUrl); + } else { + throw new Error(`${getResponse.status} ${getResponse.statusText}`); + } +}; +``` + +If you pass an invalid URL that doesn't follow the valid `http://www.example.com` format, the JSON response will contain `{ error: 'invalid url' }` + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/shorturl', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `url=ftp:/john-doe.invalidTLD` + }); + if (res.ok) { + const { error } = await res.json(); + assert.isNotNull(error); + assert.strictEqual(error.toLowerCase(), 'invalid url'); + } else { + throw new Error(`${res.status} ${res.statusText}`); + } +}; +``` + diff --git a/curriculum/challenges/italian/25-front-end-development/lab-world-cup-database/5f9771307d4d22b9d2b75a94.md b/curriculum/challenges/italian/25-front-end-development/lab-world-cup-database/5f9771307d4d22b9d2b75a94.md new file mode 100644 index 0000000000..d77442a1ba --- /dev/null +++ b/curriculum/challenges/italian/25-front-end-development/lab-world-cup-database/5f9771307d4d22b9d2b75a94.md @@ -0,0 +1,25 @@ +--- +id: 5f9771307d4d22b9d2b75a94 +title: Build a World Cup Database +challengeType: 13 +url: freeCodeCamp/learn-world-cup-database +dashedName: lab-world-cup-database +--- + +# --description-- + +For this project, you will create a Bash script that enters information from World Cup games into PostgreSQL, then query the database for useful statistics. + +# --instructions-- + +**Important:** After you pass all the project tests, save a dump of your database into a `worldcup.sql` file, as well as your `insert_data.sh` and `queries.sh` files, so you can complete step 2. There will be instructions how to do that within the virtual machine. + +# --notes-- + +Required files: `worldcup.sql`, `insert_data.sh`, `queries.sh` + +# --hints-- + +# --seed-- + +# --solutions-- diff --git a/curriculum/challenges/italian/25-front-end-development/workshop-hotel-feedback-form/66a96127422411756204bc1b.md b/curriculum/challenges/italian/25-front-end-development/workshop-hotel-feedback-form/66a96127422411756204bc1b.md index 51ea9e3069..753ee1a6bb 100644 --- a/curriculum/challenges/italian/25-front-end-development/workshop-hotel-feedback-form/66a96127422411756204bc1b.md +++ b/curriculum/challenges/italian/25-front-end-development/workshop-hotel-feedback-form/66a96127422411756204bc1b.md @@ -7,9 +7,9 @@ dashedName: step-22 # --description-- -Add another label with the text of `Personal Recommendation`. The `for` attribute should be set to `"recommendation"`. +Add another `label` with the text of `Personal Recommendation`. The `for` attribute should be set to `"recommendation"`. -Below the label element, add another checkbox input with the `id`, `name` and `value` attributes set to `"recommendation"`. +Below the `label` element, add another checkbox `input` with the `id`, `name` and `value` attributes set to `"recommendation"`. # --hints-- diff --git a/curriculum/challenges/italian/25-front-end-development/workshop-hotel-feedback-form/66a962954f4e0d76223b37ed.md b/curriculum/challenges/italian/25-front-end-development/workshop-hotel-feedback-form/66a962954f4e0d76223b37ed.md index 42c425209d..80a23ca86d 100644 --- a/curriculum/challenges/italian/25-front-end-development/workshop-hotel-feedback-form/66a962954f4e0d76223b37ed.md +++ b/curriculum/challenges/italian/25-front-end-development/workshop-hotel-feedback-form/66a962954f4e0d76223b37ed.md @@ -11,7 +11,7 @@ Next, add another `label` element with the text of `Location` and the `for` attr For the checkbox `input`, both the `id`, `name` and `value` attributes should be set to `"location"`. -Below that `input` element, add another `label` element with the text of `Reputation` and the for attribute set to `"reputation"`. +Below that `input` element, add another `label` element with the text of `Reputation` and the `for` attribute set to `"reputation"`. For the checkbox `input`, both the `id`, `name` and `value` attributes should be set to `"reputation"`. diff --git a/curriculum/challenges/italian/25-front-end-development/workshop-hotel-feedback-form/66a972137acd1179fa3fe8a0.md b/curriculum/challenges/italian/25-front-end-development/workshop-hotel-feedback-form/66a972137acd1179fa3fe8a0.md index 69efa4832c..09e3e6e59b 100644 --- a/curriculum/challenges/italian/25-front-end-development/workshop-hotel-feedback-form/66a972137acd1179fa3fe8a0.md +++ b/curriculum/challenges/italian/25-front-end-development/workshop-hotel-feedback-form/66a972137acd1179fa3fe8a0.md @@ -7,7 +7,7 @@ dashedName: step-28 # --description-- -Inside your `select` element, add the following five `option` elements with these corresponding values for the option text and `value` attribute: +Inside your `select` element, add the following five `option` elements with these corresponding values for the `option` text and `value` attribute: **Value Attributes:** diff --git a/curriculum/challenges/italian/25-front-end-development/workshop-hotel-feedback-form/66a97ca8c4cbae7d0bb6e0ad.md b/curriculum/challenges/italian/25-front-end-development/workshop-hotel-feedback-form/66a97ca8c4cbae7d0bb6e0ad.md index 6549345d45..22b9a707be 100644 --- a/curriculum/challenges/italian/25-front-end-development/workshop-hotel-feedback-form/66a97ca8c4cbae7d0bb6e0ad.md +++ b/curriculum/challenges/italian/25-front-end-development/workshop-hotel-feedback-form/66a97ca8c4cbae7d0bb6e0ad.md @@ -7,7 +7,7 @@ dashedName: step-31 # --description-- -Inside your `select` element, add the following five `option` elements with these corresponding values for the option text and `value` attribute: +Inside your `select` element, add the following five `option` elements with these corresponding values for the `option` text and `value` attribute: **Value Attribute:** diff --git a/curriculum/challenges/italian/25-front-end-development/workshop-loan-qualification-checker/66c8ba41a77db20a93f9d7a1.md b/curriculum/challenges/italian/25-front-end-development/workshop-loan-qualification-checker/66c8ba41a77db20a93f9d7a1.md new file mode 100644 index 0000000000..237515fd88 --- /dev/null +++ b/curriculum/challenges/italian/25-front-end-development/workshop-loan-qualification-checker/66c8ba41a77db20a93f9d7a1.md @@ -0,0 +1,71 @@ +--- +id: 66c8ba41a77db20a93f9d7a1 +title: Step 1 +challengeType: 1 +dashedName: step-1 +--- + +# --description-- + +In this workshop, you'll review JavaScript conditionals by building a loan qualification checker app. + +The app will check whether the user is eligible for a duplex, car, and condo loan based on their annual income and credit score. A credit score is a number that represents how good you are at managing borrowed money. + +To get started, create the following variables and values. + +| Variable Name | Value | +| ------------------------- | ------- | +| `minIncomeForDuplex` | `60000` | +| `minCreditScoreForDuplex` | `700` | +| `minIncomeForCondo` | `45000` | +| `minCreditScoreForCondo` | `680` | +| `minIncomeForCar` | `30000` | +| `minCreditScoreForCar` | `650` | + +# --hints-- + +You should create a `minIncomeForDuplex` variable set to `60000`. + +```js +assert.equal(minIncomeForDuplex, 60000); +``` + +You should create a `minCreditScoreForDuplex` set to `700`. + +```js +assert.equal(minCreditScoreForDuplex, 700); +``` + +You should create a `minIncomeForCar` variable set to `30000`. + +```js +assert.equal(minIncomeForCar, 30000); +``` + +You should create a `minCreditScoreForCar` variable set to `650`. + +```js +assert.equal(minCreditScoreForCar, 650); +``` + +You should create a `minIncomeForCondo` variable set to `45000`. + +```js +assert.equal(minIncomeForCondo, 45000); +``` + +You should create a `minCreditScoreForCondo` variable set to `680`. + +```js +assert.equal(minCreditScoreForCondo, 680); +``` + +# --seed-- + +## --seed-contents-- + +```js +--fcc-editable-region-- + +--fcc-editable-region-- +``` diff --git a/curriculum/challenges/italian/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4ac.md b/curriculum/challenges/italian/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4ac.md new file mode 100644 index 0000000000..7755f823c4 --- /dev/null +++ b/curriculum/challenges/italian/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4ac.md @@ -0,0 +1,53 @@ +--- +id: 66c8ba975ee7230e29f6c4ac +title: Step 2 +challengeType: 1 +dashedName: step-2 +--- + +# --description-- + +When the user is eligible for a loan, you'll want to display a message to them in the console. + +For that, you'll build out a function inside which you'll have some checks that'll return what loan the applicant is eligible for. + +Create an empty `getLoanMessage` function with an `annualIncome` and `creditScore` parameters. + +# --hints-- + +You should create a `getLoanMessage` function + +```js +assert.isFunction(getLoanMessage) +``` + +Your `getLoanMessage` function should have an `annualIncome` and `creditScore` as parameters. + +```js +assert.match(getLoanMessage?.toString(), /\(\s*annualIncome,\s*creditScore\s*\)|\(\s*creditScore,\s*annualIncome\s*\)/); +``` + +`getLoanMessage` should be an empty function. + +```js +assert.match(getLoanMessage?.toString(), /\{\s*\}/); +``` + +# --seed-- + +## --seed-contents-- + +```js +const minIncomeForDuplex = 60000; +const minCreditScoreForDuplex = 700; + +const minIncomeForCondo = 45000; +const minCreditScoreForCondo = 680; + +const minIncomeForCar = 30000; +const minCreditScoreForCar = 650; + +--fcc-editable-region-- + +--fcc-editable-region-- +``` diff --git a/curriculum/challenges/italian/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4ad.md b/curriculum/challenges/italian/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4ad.md new file mode 100644 index 0000000000..82a29d7cd9 --- /dev/null +++ b/curriculum/challenges/italian/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4ad.md @@ -0,0 +1,55 @@ +--- +id: 66c8ba975ee7230e29f6c4ad +title: Step 3 +challengeType: 1 +dashedName: step-3 +--- + +# --description-- + +To check which loan a user is qualified for based on the `annualIncome` and `creditScore`, you have to use `if/else if` statement or a ternary right inside the `getLoanMessage` function. You'll then return the appropraite message in the block of each condition. + +Starting with the duplex loan, check if `annualIncome` is greater than or equal to `minIncomeForDuplex` AND if `creditScore` is greater than `minCreditScoreForDuplex`. + +If that condition is true, then the applicant is eligible for a duplex loan and the other loans. So, inside the check, return the string `"You qualify for a car, duplex and Condo loan."` + +# --hints-- + +Your `getLoanMessage` function should return a string. + +```js +assert.isString(getLoanMessage(65000, 750)); +``` + +Your `getLoanMessage` function should return the string `"You qualify for a duplex, condo, and car loan."`. + +```js +assert.strictEqual(getLoanMessage(65000, 750), "You qualify for a duplex, condo, and car loan."); +``` + +Your `getLoanMessage` function should return `undefined` if the applicant's annual income and credit score do not meet the requirements for a duplex loan. + +```js +assert.strictEqual(getLoanMessage(59000, 700), undefined); +``` + +# --seed-- + +## --seed-contents-- + +```js +const minIncomeForDuplex = 60000; +const minCreditScoreForDuplex = 700; + +const minIncomeForCondo = 45000; +const minCreditScoreForCondo = 680; + +const minIncomeForCar = 30000; +const minCreditScoreForCar = 650; + +--fcc-editable-region-- +function getLoanMessage(annualIncome, creditScore) { + +} +--fcc-editable-region-- +``` diff --git a/curriculum/challenges/italian/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4af.md b/curriculum/challenges/italian/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4af.md new file mode 100644 index 0000000000..638e6291a4 --- /dev/null +++ b/curriculum/challenges/italian/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4af.md @@ -0,0 +1,56 @@ +--- +id: 66c8ba975ee7230e29f6c4af +title: Step 4 +challengeType: 1 +dashedName: step-4 +--- + +# --description-- + +If the applicant's annual income is greater than or equal to `minIncomeForCondo`, AND if their credit score is greater than or equal to `minCreditScoreForCondo`, then they qualify for a condo and car loan. + +Check if that's true in the `getLoanMessage` function. If it is, return the string `"You qualify for a condo and car loan."` + +# --hints-- + +Your `getLoanMessage` function should return a string if the applicant qualifies for a condo and car loan. + +```js +assert.isString(getLoanMessage(45000, 680)); +``` + +Your `getLoanMessage` function should return the string `"You qualify for a condo and car loan."`. + +```js +assert.strictEqual(getLoanMessage(45000, 680), "You qualify for a condo and car loan."); +``` + +Your `getLoanMessage` function should return `undefined` if the applicant's annual income and credit score do not meet the requirements for a condo loan. + +```js +assert.strictEqual(getLoanMessage(45000, 650), undefined); +``` + +# --seed-- + +## --seed-contents-- + +```js +const minIncomeForDuplex = 60000; +const minCreditScoreForDuplex = 700; + +const minIncomeForCondo = 45000; +const minCreditScoreForCondo = 680; + +const minIncomeForCar = 30000; +const minCreditScoreForCar = 650; + +function getLoanMessage(annualIncome, creditScore) { + if(creditScore >= minCreditScoreForDuplex && annualIncome >= minIncomeForDuplex) { + return "You qualify for a duplex, condo, and car loan." +--fcc-editable-region-- + } + +--fcc-editable-region-- +} +``` diff --git a/curriculum/challenges/italian/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b0.md b/curriculum/challenges/italian/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b0.md new file mode 100644 index 0000000000..374ba7b8fe --- /dev/null +++ b/curriculum/challenges/italian/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b0.md @@ -0,0 +1,56 @@ +--- +id: 66c8ba975ee7230e29f6c4b0 +title: Step 5 +challengeType: 1 +dashedName: step-5 +--- + +# --description-- + +Now, you should check if the applicant is qualified for a car loan only. If they're, return the string `"You qualify for a car loan."`. + +# --hints-- + +Your `getLoanMessage` function should return a string if the applicant qualifies for a car loan. + +```js +assert.isString(getLoanMessage(30000, 650)); +``` + +Your `getLoanMessage` function should return the string `"You qualify for a car loan."`. + +```js +assert.strictEqual(getLoanMessage(30000, 650), "You qualify for a car loan."); +``` + +Your `getLoanMessage` function should return `undefined` if the applicant's annual income and credit score do not meet the requirements for a car loan. + +```js +assert.strictEqual(getLoanMessage(30000, 600), undefined); +``` + +# --seed-- + +## --seed-contents-- + +```js +const minIncomeForDuplex = 60000; +const minCreditScoreForDuplex = 700; + +const minIncomeForCondo = 45000; +const minCreditScoreForCondo = 680; + +const minIncomeForCar = 30000; +const minCreditScoreForCar = 650; + +function getLoanMessage(annualIncome, creditScore) { + if(creditScore >= minCreditScoreForDuplex && annualIncome >= minIncomeForDuplex) { + return "You qualify for a duplex, condo, and car loan." + } else if (annualIncome >= minIncomeForCondo && creditScore >= minCreditScoreForCondo) { + return "You qualify for a condo and car loan." +--fcc-editable-region-- + } + +--fcc-editable-region-- +} +``` diff --git a/curriculum/challenges/italian/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b1.md b/curriculum/challenges/italian/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b1.md new file mode 100644 index 0000000000..16e8c7baca --- /dev/null +++ b/curriculum/challenges/italian/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b1.md @@ -0,0 +1,54 @@ +--- +id: 66c8ba975ee7230e29f6c4b1 +title: Step 6 +challengeType: 1 +dashedName: step-6 +--- + +# --description-- + +If the applicant's annual income and credit score fall below `minIncomeForCar` and `minCreditScoreForCar`, then they don't qualify for any loan. So, return the string `"You don't qualify for any loans."` + +# --hints-- + +Your `getLoanMessage` function should return a string if the applicant doesn't qualify for any loan. + +```js +assert.isString(getLoanMessage(25000, 550)); +``` + +Your `getLoanMessage` function should return the string `"You don't qualify for any loans."` if the applicant does not meet the requirements for any loan. + +```js +assert.strictEqual(getLoanMessage(15000, 600), "You don't qualify for any loans."); +assert.strictEqual(getLoanMessage(25000, 550), "You don't qualify for any loans."); +assert.strictEqual(getLoanMessage(20000, 500), "You don't qualify for any loans."); +``` + +# --seed-- + +## --seed-contents-- + +```js +const minIncomeForDuplex = 60000; +const minCreditScoreForDuplex = 700; + +const minIncomeForCondo = 45000; +const minCreditScoreForCondo = 680; + +const minIncomeForCar = 30000; +const minCreditScoreForCar = 650; + +function getLoanMessage(annualIncome, creditScore) { + if(creditScore >= minCreditScoreForDuplex && annualIncome >= minIncomeForDuplex) { + return "You qualify for a duplex, condo, and car loan." + } else if (annualIncome >= minIncomeForCondo && creditScore >= minCreditScoreForCondo) { + return "You qualify for a condo and car loan." + } else if (annualIncome >= minIncomeForCar && creditScore >= minCreditScoreForCar) { + return "You qualify for a car loan." +--fcc-editable-region-- + } + +--fcc-editable-region-- +} +``` diff --git a/curriculum/challenges/italian/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b2.md b/curriculum/challenges/italian/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b2.md new file mode 100644 index 0000000000..9d19f9ea4c --- /dev/null +++ b/curriculum/challenges/italian/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b2.md @@ -0,0 +1,165 @@ +--- +id: 66c8ba975ee7230e29f6c4b2 +title: Step 7 +challengeType: 1 +dashedName: step-7 +--- + +# --description-- + +Now, it is time to test out your `getLoanMessage` function. + +Use the table below to create `4` variables and their values: + +| Variable Name | Value | +| --------------- | ---------------------------- | +| `duplexLoanMsg` | `getLoanMessage(85000, 850)` | +| `condoLoanMsg` | `getLoanMessage(65000, 690)` | +| `carLoanMsg` | `getLoanMessage(45000, 660)` | +| `noLoanMsg` | `getLoanMessage(25000, 550)` | + +After that, log each variable to the console to see the messages. + +With that, your loan qualification checker project is complete! + +# --hints-- + +You should have a variable called `duplexLoanMsg`. + +```js +assert.isNotNull(duplexLoanMsg); +``` + +Your `duplexLoanMsg` variable should be set to the result of `getLoanMessage(85000, 850)`. + +```js +assert.equal(duplexLoanMsg, getLoanMessage(85000, 850)); +``` + +You should log the `duplexLoanMsg` variable to the console. + +```js +assert.match(code, /console\.log\(duplexLoanMsg\)/) +``` + +You should have a variable called `condoLoanMsg`. + +```js +assert.isNotNull(condoLoanMsg); +``` + +Your `condoLoanMsg` variable should be set to the result of `getLoanMessage(65000, 690)`. + +```js +assert.equal(condoLoanMsg, getLoanMessage(65000, 690)); +``` + +You should log the `condoLoanMsg` variable to the console. + +```js +assert.match(code, /console\.log\(condoLoanMsg\)/) +``` + +You should have a variable called `carLoanMsg`. + +```js +assert.isNotNull(carLoanMsg); +``` + +Your `carLoanMsg` variable should be set to the result of `getLoanMessage(45000, 660)`. + +```js +assert.equal(carLoanMsg, getLoanMessage(45000, 660)); +``` + +You should log the `carLoanMsg` variable to the console. + +```js +assert.match(code, /console\.log\(carLoanMsg\)/) +``` + +You should have a variable called `noLoanMsg`. + +```js +assert.isNotNull(noLoanMsg); +``` + +Your `noLoanMsg` variable should be set to the result of `getLoanMessage(25000, 550)`. + +```js +assert.equal(noLoanMsg, getLoanMessage(25000, 550)); +``` + +You should log the `noLoanMsg` variable to the console. + +```js +assert.match(code, /console\.log\(noLoanMsg\)/) +``` + +# --seed-- + +## --seed-contents-- + +```js +const minIncomeForDuplex = 60000; +const minCreditScoreForDuplex = 700; + +const minIncomeForCondo = 45000; +const minCreditScoreForCondo = 680; + +const minIncomeForCar = 30000; +const minCreditScoreForCar = 650; + +function getLoanMessage(annualIncome, creditScore) { + if(creditScore >= minCreditScoreForDuplex && annualIncome >= minIncomeForDuplex) { + return "You qualify for a duplex, condo, and car loan." + } else if (annualIncome >= minIncomeForCondo && creditScore >= minCreditScoreForCondo) { + return "You qualify for a condo and car loan." + } else if (annualIncome >= minIncomeForCar && creditScore >= minCreditScoreForCar) { + return "You qualify for a car loan." + } else { + return "You don't qualify for any loans." + } +} + +--fcc-editable-region-- + +--fcc-editable-region-- +``` + +# --solutions-- + +```js +const minIncomeForDuplex = 60000; +const minCreditScoreForDuplex = 700; + +const minIncomeForCondo = 45000; +const minCreditScoreForCondo = 680; + +const minIncomeForCar = 30000; +const minCreditScoreForCar = 650; + +function getLoanMessage(annualIncome, creditScore) { + if(creditScore >= minCreditScoreForDuplex && annualIncome >= minIncomeForDuplex) { + return "You qualify for a duplex, condo, and car loan." + } else if (annualIncome >= minIncomeForCondo && creditScore >= minCreditScoreForCondo) { + return "You qualify for a condo and car loan." + } else if (annualIncome >= minIncomeForCar && creditScore >= minCreditScoreForCar) { + return "You qualify for a car loan." + } else { + return "You don't qualify for any loans." + } +} + +const duplexLoanMsg = getLoanMessage(85000, 850) +console.log(duplexLoanMsg) + +const condoLoanMsg = getLoanMessage(65000, 690) +console.log(condoLoanMsg) + +const carLoanMsg = getLoanMessage(45000, 660) +console.log(carLoanMsg) + +const noLoanMsg = getLoanMessage(25000, 550) +console.log(noLoanMsg) +``` diff --git a/curriculum/challenges/italian/25-front-end-development/workshop-mario-database/5f2c289f164c29556da632fd.md b/curriculum/challenges/italian/25-front-end-development/workshop-mario-database/5f2c289f164c29556da632fd.md new file mode 100644 index 0000000000..4e11751ca0 --- /dev/null +++ b/curriculum/challenges/italian/25-front-end-development/workshop-mario-database/5f2c289f164c29556da632fd.md @@ -0,0 +1,19 @@ +--- +id: 5f2c289f164c29556da632fd +title: Build a Mario Database +challengeType: 12 +url: freeCodeCamp/learn-relational-databases-by-building-a-mario-database +dashedName: build-a-mario-database +--- + +# --description-- + +In this 165-lesson workshop, you will learn the basics of a relational database by creating a PostgreSQL database filled with video game characters. + +# --instructions-- + +# --hints-- + +# --seed-- + +# --solutions-- diff --git a/curriculum/challenges/italian/25-front-end-development/workshop-npm-packages/587d7fb3367417b2b2512bfb.md b/curriculum/challenges/italian/25-front-end-development/workshop-npm-packages/587d7fb3367417b2b2512bfb.md new file mode 100644 index 0000000000..8d4c90410d --- /dev/null +++ b/curriculum/challenges/italian/25-front-end-development/workshop-npm-packages/587d7fb3367417b2b2512bfb.md @@ -0,0 +1,53 @@ +--- +id: 587d7fb3367417b2b2512bfb +title: How to Use package.json, the Core of Any Node.js Project or npm Package +challengeType: 2 +forumTopicId: 301528 +dashedName: how-to-use-package-json-the-core-of-any-node-js-project-or-npm-package +--- + +# --description-- + +Working on these challenges will involve you writing your code using one of the following methods: + +- Clone this GitHub repo and complete these challenges locally. +- Use our Gitpod starter project to complete these challenges. +- Use a site builder of your choice to complete the project. Be sure to incorporate all the files from our GitHub repo. + +The `package.json` file is the center of any Node.js project or npm package. It stores information about your project. It consists of a single JSON object where information is stored in key-value pairs. There are only two required fields; `name` and `version`, but it’s good practice to provide additional information. + +You can create the `package.json` file from the terminal using the `npm init` command. This will run a guided setup. Using `npm init` with the `-y` flag will generate the file without having it ask any questions, `npm init -y`. + +If you look at the file tree of your project, you will find the `package.json` file on the top level of the tree. This is the file that you will be improving in the next couple of challenges. + +One of the most common pieces of information in this file is the `author` field. It specifies who created the project, and can consist of a string or an object with contact or other details. An object is recommended for bigger projects, but a simple string like the following example will do for this project. + +```json +"author": "Jane Doe", +``` + +# --instructions-- + +Add your name as the `author` of the project in the `package.json` file. + +**Note:** Remember that you’re writing JSON, so all field names must use double-quotes (") and be separated with a comma (,). + +If you are using Gitpod, make sure the app is running and the preview window is open. Copy the preview window's URL and paste it into the Solution Link input below. + +# --hints-- + +`package.json` should have a valid "author" key + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert(packJson.author, '"author" is missing'); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/italian/25-front-end-development/workshop-npm-packages/587d7fb3367417b2b2512bfc.md b/curriculum/challenges/italian/25-front-end-development/workshop-npm-packages/587d7fb3367417b2b2512bfc.md new file mode 100644 index 0000000000..37d15d5261 --- /dev/null +++ b/curriculum/challenges/italian/25-front-end-development/workshop-npm-packages/587d7fb3367417b2b2512bfc.md @@ -0,0 +1,43 @@ +--- +id: 587d7fb3367417b2b2512bfc +title: Add a Description to Your package.json +challengeType: 2 +forumTopicId: 301522 +dashedName: add-a-description-to-your-package-json +--- + +# --description-- + +The next part of a good package.json file is the `description` field; where a short, but informative description about your project belongs. + +If some day you plan to publish a package to npm, this is the string that should sell your idea to the user when they decide whether to install your package or not. However, that’s not the only use case for the description, it’s a great way to summarize what a project does. It’s just as important in any Node.js project to help other developers, future maintainers or even your future self understand the project quickly. + +Regardless of what you plan for your project, a description is definitely recommended. Here's an example: + +```json +"description": "A project that does something awesome", +``` + +# --instructions-- + +Add a `description` to the package.json file of your project. + +**Note:** Remember to use double-quotes for field-names (") and commas (,) to separate fields. + +# --hints-- + +package.json should have a valid "description" key + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert(packJson.description, '"description" is missing'); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/italian/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bfd.md b/curriculum/challenges/italian/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bfd.md new file mode 100644 index 0000000000..a001cdd477 --- /dev/null +++ b/curriculum/challenges/italian/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bfd.md @@ -0,0 +1,75 @@ +--- +id: 587d7fb4367417b2b2512bfd +title: Add Keywords to Your package.json +challengeType: 2 +forumTopicId: 301526 +dashedName: add-keywords-to-your-package-json +--- + +# --description-- + +The `keywords` field is where you can describe your project using related keywords. Here's an example: + +```json +"keywords": [ "descriptive", "related", "words" ], +``` + +As you can see, this field is structured as an array of double-quoted strings. + +# --instructions-- + +Add an array of suitable strings to the `keywords` field in the package.json file of your project. + +One of the keywords should be "freecodecamp". + +# --hints-- + +package.json should have a valid "keywords" key + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert(packJson.keywords, '"keywords" is missing'); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + +"keywords" field should be an Array + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.isArray(packJson.keywords, '"keywords" is not an array'); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + +"keywords" should include "freecodecamp" + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.include( + packJson.keywords, + 'freecodecamp', + '"keywords" does not include "freecodecamp"' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/italian/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bfe.md b/curriculum/challenges/italian/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bfe.md new file mode 100644 index 0000000000..7b09acd042 --- /dev/null +++ b/curriculum/challenges/italian/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bfe.md @@ -0,0 +1,39 @@ +--- +id: 587d7fb4367417b2b2512bfe +title: Add a License to Your package.json +challengeType: 2 +forumTopicId: 301523 +dashedName: add-a-license-to-your-package-json +--- + +# --description-- + +The `license` field is where you inform users of what they are allowed to do with your project. + +Some common licenses for open source projects include MIT and BSD. License information is not required, and copyright laws in most countries will give you ownership of what you create by default. However, it’s always a good practice to explicitly state what users can and can’t do. Here's an example of the license field: + +```json +"license": "MIT", +``` + +# --instructions-- + +Fill the `license` field in the package.json file of your project as you find suitable. + +# --hints-- + +package.json should have a valid "license" key + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert(packJson.license, '"license" is missing'); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/italian/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bff.md b/curriculum/challenges/italian/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bff.md new file mode 100644 index 0000000000..f2e571faed --- /dev/null +++ b/curriculum/challenges/italian/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bff.md @@ -0,0 +1,37 @@ +--- +id: 587d7fb4367417b2b2512bff +title: Add a Version to Your package.json +challengeType: 2 +forumTopicId: 301525 +dashedName: add-a-version-to-your-package-json +--- + +# --description-- + +A `version` is one of the required fields of your package.json file. This field describes the current version of your project. Here's an example: + +```json +"version": "1.2.0", +``` + +# --instructions-- + +Add a `version` to the package.json file of your project. + +# --hints-- + +package.json should have a valid "version" key + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert(packJson.version, '"version" is missing'); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/italian/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512c00.md b/curriculum/challenges/italian/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512c00.md new file mode 100644 index 0000000000..161c60fe69 --- /dev/null +++ b/curriculum/challenges/italian/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512c00.md @@ -0,0 +1,68 @@ +--- +id: 587d7fb4367417b2b2512c00 +title: Expand Your Project with External Packages from npm +challengeType: 2 +forumTopicId: 301527 +dashedName: expand-your-project-with-external-packages-from-npm +--- + +# --description-- + +One of the biggest reasons to use a package manager, is their powerful dependency management. Instead of manually having to make sure that you get all dependencies whenever you set up a project on a new computer, npm automatically installs everything for you. But how can npm know exactly what your project needs? Meet the `dependencies` section of your package.json file. + +In this section, packages your project requires are stored using the following format: + +```json +"dependencies": { + "package-name": "version", + "express": "4.14.0" +} + +``` + +# --instructions-- + +Add version `1.1.0` of the `@freecodecamp/example` package to the `dependencies` field of your `package.json` file. + +**Note:** `@freecodecamp/example` is a faux package used as a learning tool. + +# --hints-- + +`"dependencies"` should include `"@freecodecamp/example"`. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.property( + packJson.dependencies, + '@freecodecamp/example', + '"dependencies" does not include "@freecodecamp/example"' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + +`"@freecodecamp/example"` version should be `"1.1.0"`. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.match( + packJson.dependencies["@freecodecamp/example"], + /^[\^\~]?1\.1\.0/, + 'Wrong version of "@freecodecamp/example" installed. It should be 1.1.0' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/italian/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c01.md b/curriculum/challenges/italian/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c01.md new file mode 100644 index 0000000000..deda9b82de --- /dev/null +++ b/curriculum/challenges/italian/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c01.md @@ -0,0 +1,64 @@ +--- +id: 587d7fb5367417b2b2512c01 +title: Manage npm Dependencies By Understanding Semantic Versioning +challengeType: 2 +forumTopicId: 301529 +dashedName: manage-npm-dependencies-by-understanding-semantic-versioning +--- + +# --description-- + +`Versions` of the npm packages in the dependencies section of your package.json file follow what’s called Semantic Versioning (SemVer), an industry standard for software versioning aiming to make it easier to manage dependencies. Libraries, frameworks or other tools published on npm should use SemVer in order to clearly communicate what kind of changes projects can expect if they update. + +Knowing SemVer can be useful when you develop software that uses external dependencies (which you almost always do). One day, your understanding of these numbers will save you from accidentally introducing breaking changes to your project without understanding why things that worked yesterday suddenly don’t work today. This is how Semantic Versioning works according to the official website: + +```json +"package": "MAJOR.MINOR.PATCH" +``` + +The MAJOR version should increment when you make incompatible API changes. The MINOR version should increment when you add functionality in a backwards-compatible manner. The PATCH version should increment when you make backwards-compatible bug fixes. This means that PATCHes are bug fixes and MINORs add new features but neither of them break what worked before. Finally, MAJORs add changes that won’t work with earlier versions. + +# --instructions-- + +In the dependencies section of your `package.json` file, change the version of `@freecodecamp/example` to match MAJOR version 1, MINOR version 2 and PATCH version 13 + +# --hints-- + +`"dependencies"` should include `"@freecodecamp/example"`. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.property( + packJson.dependencies, + '@freecodecamp/example', + '"dependencies" does not include "@freecodecamp/example"' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + +`"@freecodecamp/example"` version should be `"1.2.13"`. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.equal( + packJson.dependencies["@freecodecamp/example"], + '1.2.13', + 'Wrong version of "@freecodecamp/example". It should be 1.2.13' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/italian/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c02.md b/curriculum/challenges/italian/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c02.md new file mode 100644 index 0000000000..8eae5f51ee --- /dev/null +++ b/curriculum/challenges/italian/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c02.md @@ -0,0 +1,66 @@ +--- +id: 587d7fb5367417b2b2512c02 +title: Use the Tilde-Character to Always Use the Latest Patch Version of a Dependency +challengeType: 2 +forumTopicId: 301532 +dashedName: use-the-tilde-character-to-always-use-the-latest-patch-version-of-a-dependency +--- + +# --description-- + +In the last challenge, you told npm to only include a specific version of a package. That’s a useful way to freeze your dependencies if you need to make sure that different parts of your project stay compatible with each other. But in most use cases, you don’t want to miss bug fixes since they often include important security patches and (hopefully) don’t break things in doing so. + +To allow an npm dependency to update to the latest PATCH version, you can prefix the dependency’s version with the tilde (`~`) character. Here's an example of how to allow updates to any `1.3.x` version. + +```json +"package": "~1.3.8" +``` + +# --instructions-- + +In the package.json file, your current rule for how npm may upgrade `@freecodecamp/example` is to use a specific version (`1.2.13`). But now, you want to allow the latest `1.2.x` version. + +Use the tilde (`~`) character to prefix the version of `@freecodecamp/example` in your dependencies, and allow npm to update it to any new _patch_ release. + +**Note:** The version numbers themselves should not be changed. + +# --hints-- + +`"dependencies"` should include `"@freecodecamp/example"`. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.property( + packJson.dependencies, + '@freecodecamp/example', + '"dependencies" does not include "@freecodecamp/example"' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + +`"@freecodecamp/example"` version should match `"~1.2.13"`. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.match( + packJson.dependencies["@freecodecamp/example"], + /^\~1\.2\.13/, + 'Wrong version of "@freecodecamp/example". It should be ~1.2.13' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/italian/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c03.md b/curriculum/challenges/italian/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c03.md new file mode 100644 index 0000000000..adc3014ea4 --- /dev/null +++ b/curriculum/challenges/italian/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c03.md @@ -0,0 +1,66 @@ +--- +id: 587d7fb5367417b2b2512c03 +title: Use the Caret-Character to Use the Latest Minor Version of a Dependency +challengeType: 2 +forumTopicId: 301531 +dashedName: use-the-caret-character-to-use-the-latest-minor-version-of-a-dependency +--- + +# --description-- + +Similar to how the tilde we learned about in the last challenge allows npm to install the latest PATCH for a dependency, the caret (`^`) allows npm to install future updates as well. The difference is that the caret will allow both MINOR updates and PATCHes. + +Your current version of `@freecodecamp/example` should be `~1.2.13` which allows npm to install to the latest `1.2.x` version. If you were to use the caret (^) as a version prefix instead, npm would be allowed to update to any `1.x.x` version. + +```json +"package": "^1.3.8" +``` + +This would allow updates to any `1.x.x` version of the package. + +# --instructions-- + +Use the caret (`^`) to prefix the version of `@freecodecamp/example` in your dependencies and allow npm to update it to any new MINOR release. + +**Note:** The version numbers themselves should not be changed. + +# --hints-- + +`"dependencies"` should include `"@freecodecamp/example"`. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.property( + packJson.dependencies, + '@freecodecamp/example', + '"dependencies" does not include "@freecodecamp/example"' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + +`"@freecodecamp/example"` version should match `"^1.x.x"`. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.match( + packJson.dependencies["@freecodecamp/example"], + /^\^1\./, + 'Wrong version of "@freecodecamp/example". It should be ^1.2.13' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/italian/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c04.md b/curriculum/challenges/italian/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c04.md new file mode 100644 index 0000000000..5f695eed88 --- /dev/null +++ b/curriculum/challenges/italian/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c04.md @@ -0,0 +1,43 @@ +--- +id: 587d7fb5367417b2b2512c04 +title: Remove a Package from Your Dependencies +challengeType: 2 +forumTopicId: 301530 +dashedName: remove-a-package-from-your-dependencies +--- + +# --description-- + +You have now tested a few ways you can manage dependencies of your project by using the package.json's dependencies section. You have also included external packages by adding them to the file and even told npm what types of versions you want, by using special characters such as the tilde or the caret. + +But what if you want to remove an external package that you no longer need? You might already have guessed it, just remove the corresponding key-value pair for that package from your dependencies. + +This same method applies to removing other fields in your package.json as well. + +# --instructions-- + +Remove the `@freecodecamp/example` package from your dependencies. + +**Note:** Make sure you have the right amount of commas after removing it. + +# --hints-- + +`"dependencies"` should not include `"@freecodecamp/example"`. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.notProperty( + packJson.dependencies, + '@freecodecamp/example', + '"dependencies" still includes "@freecodecamp/example"' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/japanese/13-relational-databases/build-a-periodic-table-database-project/build-a-periodic-table-database.md b/curriculum/challenges/japanese/13-relational-databases/build-a-periodic-table-database-project/build-a-periodic-table-database.md index 959761b914..6efd95e6d2 100644 --- a/curriculum/challenges/japanese/13-relational-databases/build-a-periodic-table-database-project/build-a-periodic-table-database.md +++ b/curriculum/challenges/japanese/13-relational-databases/build-a-periodic-table-database-project/build-a-periodic-table-database.md @@ -8,7 +8,7 @@ dashedName: build-a-periodic-table-database # --description-- -これは認定証を獲得するために必須のプロジェクトの 1 つです。 このプロジェクトでは、周期表データベースから化学元素の情報を取得する、Bash スクリプトを作成します。 +これは認定証を獲得するために必須のプロジェクトの 1 つです。 For this project, you will create a Bash script to get information about chemical elements from a periodic table database. # --instructions-- diff --git a/curriculum/challenges/japanese/14-responsive-web-design-22/learn-basic-css-by-building-a-cafe-menu/5f3ef6e0a81099d9a697b550.md b/curriculum/challenges/japanese/14-responsive-web-design-22/learn-basic-css-by-building-a-cafe-menu/5f3ef6e0a81099d9a697b550.md index 163d37a75e..b88a481061 100644 --- a/curriculum/challenges/japanese/14-responsive-web-design-22/learn-basic-css-by-building-a-cafe-menu/5f3ef6e0a81099d9a697b550.md +++ b/curriculum/challenges/japanese/14-responsive-web-design-22/learn-basic-css-by-building-a-cafe-menu/5f3ef6e0a81099d9a697b550.md @@ -9,6 +9,8 @@ dashedName: step-64 `footer` の中に、`p` 要素を 1 つ追加してください。 次に、リンク先が `https://www.freecodecamp.org` でテキストが `Visit our website` のアンカー (`a`) 要素を、`p` 要素の中にネストしてください。 +Make sure that the link opens in a new tab by adding a `target` attribute with the value `_blank`. + # --hints-- 既存の `footer` 要素を変更しないでください。 @@ -43,6 +45,12 @@ assert(document.querySelector("footer > p > a")?.innerText === "Visit our websit assert(document.querySelector("footer > p > a")?.href === "https://www.freecodecamp.org/"); ``` +Your new `a` element should have the `target` attribute set to `_blank`. + +```js +assert.equal(document.querySelector("footer > p > a")?.target, "_blank"); +``` + # --seed-- ## --seed-contents-- diff --git a/curriculum/challenges/japanese/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-j.md b/curriculum/challenges/japanese/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-j.md index d2ad72a1ea..1b6ca05444 100644 --- a/curriculum/challenges/japanese/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-j.md +++ b/curriculum/challenges/japanese/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-j.md @@ -21,12 +21,12 @@ Remove `flex: 1` from `.item` and add `justify-content: space-between` to `.cont `justify-content` aligns items across the **main axis**. There are a few values that you can use here. You'll learn the rest of them in the reading assignments, but for now try changing it to center, which should center the boxes along the main axis. -# --question-- - -## --assignment-- +# --assignment-- Before moving on to the next lesson, see what is possible with the `justify-content` property. Read this [interactive article on MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/justify-content) and play around with the different values of `justify-content` on the example. +# --question-- + ## --text-- How does applying `justify-content: space-between` to a flex container affect the positioning of its items? diff --git a/curriculum/challenges/japanese/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-k.md b/curriculum/challenges/japanese/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-k.md index d3137b0af5..59acb55a29 100644 --- a/curriculum/challenges/japanese/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-k.md +++ b/curriculum/challenges/japanese/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-k.md @@ -17,12 +17,12 @@ To change the placement of items along the cross axis use `align-items`. Try get Because `justify-content` and `align-items` are based on the main and cross axis of your container, their behavior changes when you change the flex-direction of a flex-container. For example, when you change `flex-direction` to `column`, `justify-content` aligns vertically and `align-items` aligns horizontally. The most common behavior, however, is the default, i.e. `justify-content` aligns items horizontally (because the main axis defaults to horizontal), and `align-items` aligns them vertically. One of the biggest sticking points that beginners have with flexbox is confusion when this behavior changes. -# --question-- - -## --assignment-- +# --assignment-- Before moving on to the next lesson, see if you can figure out how `align-items` behaves when you change the `flex-direction` property to `column`. +# --question-- + ## --text-- When changing the `flex-direction` property to `column` in a flex container, how does `align-items` behave in relation to the flex items? diff --git a/curriculum/challenges/japanese/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-b.md b/curriculum/challenges/japanese/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-b.md index 1adf9ce84f..49edeac0e4 100644 --- a/curriculum/challenges/japanese/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-b.md +++ b/curriculum/challenges/japanese/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-b.md @@ -9,12 +9,12 @@ dashedName: learn-block-and-inline-lesson-b Inline elements, however, do not start on a new line. They appear in line with whatever elements they are placed beside. A clear example of an inline element is a link, or `` tag. If you stick one of these in the middle of a paragraph of text, it will behave like a part of the paragraph. (Like this) The link’s text will sit alongside other words in that paragraph. Additionally, padding and margin behave differently on inline elements. In general, you do not want to try to put extra padding or margin on inline elements. -# --question-- - -## --assignment-- +# --assignment-- Search the web for a list of `block` elements and a list of `inline` elements. +# --question-- + ## --text-- What is the difference between a `block` element and an `inline` element? diff --git a/curriculum/challenges/japanese/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-g.md b/curriculum/challenges/japanese/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-g.md index cdd4d5aa87..e75492e9c1 100644 --- a/curriculum/challenges/japanese/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-g.md +++ b/curriculum/challenges/japanese/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-g.md @@ -7,7 +7,7 @@ dashedName: learn-block-and-inline-lesson-g # --description-- -Now that you have some basic understanding of `block` and inline `elements`, pull up your list of `block` and `inline` elements from a couple questions ago and see if you can identify which of the following elements are `block` elements and which are `inline` elements. +Now that you have some basic understanding of `block` and `inline` elements, pull up your list of `block` and `inline` elements from a couple questions ago and see if you can identify which of the following elements are `block` elements and which are `inline` elements. # --question-- diff --git a/curriculum/challenges/japanese/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-a.md b/curriculum/challenges/japanese/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-a.md index 995073b8a2..a7a2ee9a51 100644 --- a/curriculum/challenges/japanese/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-a.md +++ b/curriculum/challenges/japanese/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-a.md @@ -21,12 +21,12 @@ New programmers often find problem solving the hardest skill to build. It's not The best way to improve your problem solving ability is by building experience by making lots and lots of programs. The more practice you have the better you'll be prepared to solve real world problems. -# --question-- - -## --assignment-- +# --assignment-- Read How to Think Like a Programmer - Lessons in Problem Solving by Richard Reis. +# --question-- + ## --text-- According to V. Anton Spraul in "Think Like a Programmer," what is problem solving in programming? diff --git a/curriculum/challenges/japanese/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-b.md b/curriculum/challenges/japanese/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-b.md index ae905ecf89..c57a7d43e8 100644 --- a/curriculum/challenges/japanese/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-b.md +++ b/curriculum/challenges/japanese/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-b.md @@ -25,11 +25,11 @@ Now that you know what you’re aiming to solve, don’t jump into coding just y The last question is where you will write out an algorithm to solve the problem. You can think of an algorithm as a recipe for solving a particular problem. It defines the steps that need to be taken by the computer to solve a problem in pseudocode. -# --question-- - -## --assignment-- +# --assignment-- Watch How to Begin Thinking Like a Programmer by Coding Tech. It’s an hour long but packed full of information and definitely worth your time watching. +# --question-- + ## --text-- What should you do before starting to code according to the provided text? diff --git a/curriculum/challenges/japanese/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-c.md b/curriculum/challenges/japanese/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-c.md index c837fd9658..082f2d51ae 100644 --- a/curriculum/challenges/japanese/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-c.md +++ b/curriculum/challenges/japanese/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-c.md @@ -22,12 +22,12 @@ Print the value of the counter variable This is a basic program to demonstrate how pseudocode looks. There will be more examples of pseudocode included in the assignments. +# --assignment-- -# --question-- - -## --assignment-- Read this Pseudocode: What It Is and How to Write It article from Built In. +# --question-- + ## --text-- What are the benefits of using pseudocode according to the linked article? diff --git a/curriculum/challenges/japanese/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657b69e10d6606a0185d4d4f.md b/curriculum/challenges/japanese/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657b69e10d6606a0185d4d4f.md index fcc8d61952..bd690bae21 100644 --- a/curriculum/challenges/japanese/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657b69e10d6606a0185d4d4f.md +++ b/curriculum/challenges/japanese/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657b69e10d6606a0185d4d4f.md @@ -9,7 +9,7 @@ dashedName: task-23 # --description-- -So far you have learned how to create questions with the verb to be. In sentences with the verb `to be` (am, is, are) you just have to change the order of the noun and the verb to create a question. Like this: +So far you have learned how to create questions with the verb `to be`. In sentences with the verb `to be` (am, is, are) you just have to change the order of the noun and the verb to create a question. Like this: `You are a developer` -> `Are you a developer?` diff --git a/curriculum/challenges/japanese/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657dce8ff35869721311a5e3.md b/curriculum/challenges/japanese/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657dce8ff35869721311a5e3.md index 544d8f1988..8cd311a518 100644 --- a/curriculum/challenges/japanese/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657dce8ff35869721311a5e3.md +++ b/curriculum/challenges/japanese/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657dce8ff35869721311a5e3.md @@ -21,7 +21,7 @@ Which sentence is correct for describing one place near you? ### --feedback-- -`There are` is used for plural nouns, and `bank` is singular. You’ll learn about there are in the next few lessons. +`There are` is used for plural nouns, and `bank` is singular. You’ll learn about `there are` in the next few lessons. --- diff --git a/curriculum/challenges/japanese/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657dcee413423174ca3747f5.md b/curriculum/challenges/japanese/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657dcee413423174ca3747f5.md index 6526b1e95b..10c0845779 100644 --- a/curriculum/challenges/japanese/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657dcee413423174ca3747f5.md +++ b/curriculum/challenges/japanese/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657dcee413423174ca3747f5.md @@ -7,7 +7,7 @@ dashedName: task-112 # --description-- -To elaborate a question using `there is` you just need to change the order of the verb to be, like so: +To elaborate a question using `there is` you just need to change the order of the verb `to be`, like so: `There is an ATM nearby` -> `Is there an ATM nearby?` diff --git a/curriculum/challenges/japanese/25-front-end-development/lab-celestial-bodies-database/5f1a4ef5d5d6b5ab580fc6ae.md b/curriculum/challenges/japanese/25-front-end-development/lab-celestial-bodies-database/5f1a4ef5d5d6b5ab580fc6ae.md new file mode 100644 index 0000000000..7d664a8876 --- /dev/null +++ b/curriculum/challenges/japanese/25-front-end-development/lab-celestial-bodies-database/5f1a4ef5d5d6b5ab580fc6ae.md @@ -0,0 +1,25 @@ +--- +id: 5f1a4ef5d5d6b5ab580fc6ae +title: Build a Celestial Bodies Database +challengeType: 13 +url: freeCodeCamp/learn-celestial-bodies-database +dashedName: lab-celestial-bodies-database +--- + +# --description-- + +For this project, you will build a database of celestial bodies using PostgreSQL. + +# --instructions-- + +**Important:** After you pass all the project tests, save a dump of your database into a `universe.sql` file so you can complete step 2. There will be instructions how to do that within the virtual machine. + +# --notes-- + +Required files: `universe.sql` + +# --hints-- + +# --seed-- + +# --solutions-- diff --git a/curriculum/challenges/japanese/25-front-end-development/lab-exercise-tracker/5a8b073d06fa14fcfde687aa.md b/curriculum/challenges/japanese/25-front-end-development/lab-exercise-tracker/5a8b073d06fa14fcfde687aa.md new file mode 100644 index 0000000000..9492b82cb4 --- /dev/null +++ b/curriculum/challenges/japanese/25-front-end-development/lab-exercise-tracker/5a8b073d06fa14fcfde687aa.md @@ -0,0 +1,611 @@ +--- +id: 5a8b073d06fa14fcfde687aa +title: Build an Exercise Tracker +challengeType: 4 +dashedName: build-an-exercise-tracker +--- + +# --description-- + +Build a full stack JavaScript app that is functionally similar to this: https://exercise-tracker.freecodecamp.rocks. Working on this project will involve you writing your code using one of the following methods: + +- Clone this GitHub repo and complete your project locally. +- Use our Gitpod starter project to complete your project. +- Use a site builder of your choice to complete the project. Be sure to incorporate all the files from our GitHub repo. + +# --instructions-- + +Your responses should have the following structures. + +Exercise: + +```js +{ + username: "fcc_test", + description: "test", + duration: 60, + date: "Mon Jan 01 1990", + _id: "5fb5853f734231456ccb3b05" +} +``` + +User: + +```js +{ + username: "fcc_test", + _id: "5fb5853f734231456ccb3b05" +} +``` + +Log: + +```js +{ + username: "fcc_test", + count: 1, + _id: "5fb5853f734231456ccb3b05", + log: [{ + description: "test", + duration: 60, + date: "Mon Jan 01 1990", + }] +} +``` + +**Hint:** For the `date` property, the `toDateString` method of the `Date` API can be used to achieve the expected output. + +# --hints-- + +You should provide your own project, not the example URL. + +```js +(getUserInput) => { + const url = getUserInput('url'); + assert( + !/.*\/exercise-tracker\.freecodecamp\.rocks/.test(getUserInput('url')) + ); +}; +``` + +You can `POST` to `/api/users` with form data `username` to create a new user. + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `username=fcc_test_${Date.now()}`.substring(0, 29) + }); + assert.isTrue(res.ok); + if(!res.ok) { + throw new Error(`${res.status} ${res.statusText}`) + }; +}; +``` + +The returned response from `POST /api/users` with form data `username` will be an object with `username` and `_id` properties. + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `username=fcc_test_${Date.now()}`.substring(0, 29) + }); + if (res.ok) { + const { _id, username } = await res.json(); + assert.exists(_id); + assert.exists(username); + } else { + throw new Error(`${res.status} ${res.statusText}`); + } +}; +``` + +You can make a `GET` request to `/api/users` to get a list of all users. + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users'); + assert.isTrue(res.ok); + if(!res.ok) { + throw new Error(`${res.status} ${res.statusText}`) + }; +}; +``` + +The `GET` request to `/api/users` returns an array. + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users'); + if(res.ok){ + const users = await res.json(); + assert.isArray(users); + } else { + throw new Error(`${res.status} ${res.statusText}`); + }; +}; +``` + +Each element in the array returned from `GET /api/users` is an object literal containing a user's `username` and `_id`. + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users'); + if(res.ok){ + const users = await res.json(); + const user = users[0]; + assert.exists(user); + assert.exists(user.username); + assert.exists(user._id); + assert.isString(user.username); + assert.isString(user._id); + } else { + throw new Error(`${res.status} ${res.statusText}`); + }; +}; +``` + +You can `POST` to `/api/users/:_id/exercises` with form data `description`, `duration`, and optionally `date`. If no date is supplied, the current date will be used. + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `username=fcc_test_${Date.now()}`.substring(0, 29) + }); + if (res.ok) { + const { _id, username } = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: 'Mon Jan 01 1990' + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `description=${expected.description}&duration=${expected.duration}&date=1990-01-01` + }); + assert.isTrue(addRes.ok); + if(!addRes.ok) { + throw new Error(`${addRes.status} ${addRes.statusText}`) + }; + } else { + throw new Error(`${res.status} ${res.statusText}`); + } +}; +``` + +The response returned from `POST /api/users/:_id/exercises` will be the user object with the exercise fields added. + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `username=fcc_test_${Date.now()}`.substring(0, 29) + }); + if (res.ok) { + const { _id, username } = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: 'Mon Jan 01 1990' + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `description=${expected.description}&duration=${expected.duration}&date=1990-01-01` + }); + if (addRes.ok) { + const actual = await addRes.json(); + assert.deepEqual(actual, expected); + assert.isString(actual.description); + assert.isNumber(actual.duration); + assert.isString(actual.date); + } else { + throw new Error(`${addRes.status} ${addRes.statusText}`); + } + } else { + throw new Error(`${res.status} ${res.statusText}`); + } +}; +``` + +You can make a `GET` request to `/api/users/:_id/logs` to retrieve a full exercise log of any user. + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `username=fcc_test_${Date.now()}`.substring(0, 29) + }); + if (res.ok) { + const { _id, username } = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: new Date().toDateString() + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `description=${expected.description}&duration=${expected.duration}` + }); + if (addRes.ok) { + const logRes = await fetch(url + `/api/users/${_id}/logs`); + assert.isTrue(logRes.ok); + if(!logRes.ok) { + throw new Error(`${logRes.status} ${logRes.statusText}`) + }; + } else { + throw new Error(`${addRes.status} ${addRes.statusText}`); + } + } else { + throw new Error(`${res.status} ${res.statusText}`); + } +}; +``` + +A request to a user's log `GET /api/users/:_id/logs` returns a user object with a `count` property representing the number of exercises that belong to that user. + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `username=fcc_test_${Date.now()}`.substring(0, 29) + }); + if (res.ok) { + const { _id, username } = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: new Date().toDateString() + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `description=${expected.description}&duration=${expected.duration}` + }); + if (addRes.ok) { + const logRes = await fetch(url + `/api/users/${_id}/logs`); + if (logRes.ok) { + const { count } = await logRes.json(); + assert(count); + } else { + throw new Error(`${logRes.status} ${logRes.statusText}`); + } + } else { + throw new Error(`${addRes.status} ${addRes.statusText}`); + } + } else { + throw new Error(`${res.status} ${res.statusText}`); + } +}; +``` + +A `GET` request to `/api/users/:_id/logs` will return the user object with a `log` array of all the exercises added. + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded' + }, + body: `username=fcc_test_${Date.now()}`.substring(0, 29) + }) + if(res.ok){ + const {_id, username} = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: new Date().toDateString() + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `description=${expected.description}&duration=${expected.duration}` + }); + if(addRes.ok){ + const logRes = await fetch(url + `/api/users/${_id}/logs`); + if(logRes.ok) { + const {log} = await logRes.json(); + assert.isArray(log); + assert.equal(1, log.length); + } else { + throw new Error(`${logRes.status} ${logRes.statusText}`); + } + } else { + throw new Error(`${addRes.status} ${addRes.statusText}`); + }; + } else { + throw new Error(`${res.status} ${res.statusText}`) + }; +}; +``` + +Each item in the `log` array that is returned from `GET /api/users/:_id/logs` is an object that should have a `description`, `duration`, and `date` properties. + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + `/api/users`, { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded' + }, + body: `username=fcc_test_${Date.now()}`.substring(0, 29) + }); + if(res.ok) { + const {_id, username} = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: new Date().toDateString() + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `description=${expected.description}&duration=${expected.duration}` + }); + if(addRes.ok) { + const logRes = await fetch(url + `/api/users/${_id}/logs`); + if(logRes.ok) { + const {log} = await logRes.json(); + const exercise = log[0]; + assert.exists(exercise); + assert.exists(exercise.description); + assert.exists(exercise.duration); + assert.exists(exercise.date); + } else { + throw new Error(`${logRes.status} ${logRes.statusText}`); + }; + } else { + throw new Error(`${addRes.status} ${addRes.statusText}`); + }; + } else { + throw new Error(`${res.status} ${res.statusText}`) + }; +}; +``` + +The `description` property of any object in the `log` array that is returned from `GET /api/users/:_id/logs` should be a string. + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + body: `username=fcc_test_${Date.now()}`.substring(0,29) + }); + if(res.ok) { + const {_id, username} = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: new Date().toDateString() + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + body: `description=${expected.description}&duration=${expected.duration}` + }); + if(addRes.ok) { + const logRes = await fetch(url + `/api/users/${_id}/logs`); + if(logRes.ok){ + const {log} = await logRes.json(); + const exercise = log[0]; + assert.isString(exercise.description); + assert.equal(exercise.description, expected.description); + } else { + throw new Error(`${logRes.status} ${logRes.statusText}`); + } + } else { + throw new Error(`${addRes.status} ${addRes.statusText}`); + }; + } else { + throw new Error(`${res.status} ${res.statusText}`); + }; +}; +``` + +The `duration` property of any object in the `log` array that is returned from `GET /api/users/:_id/logs` should be a number. + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + body: `username=fcc_test_${Date.now()}`.substring(0,29) + }); + if(res.ok) { + const {_id, username} = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: new Date().toDateString() + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + body: `description=${expected.description}&duration=${expected.duration}` + }); + if(addRes.ok) { + const logRes = await fetch(url + `/api/users/${_id}/logs`); + if(logRes.ok){ + const {log} = await logRes.json(); + const exercise = log[0]; + assert.isNumber(exercise.duration); + assert.equal(exercise.duration, expected.duration); + } else { + throw new Error(`${logRes.status} ${logRes.statusText}`); + } + } else { + throw new Error(`${addRes.status} ${addRes.statusText}`); + }; + } else { + throw new Error(`${res.status} ${res.statusText}`); + }; +}; +``` + +The `date` property of any object in the `log` array that is returned from `GET /api/users/:_id/logs` should be a string. Use the `dateString` format of the `Date` API. + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + body: `username=fcc_test_${Date.now()}`.substring(0,29) + }); + if(res.ok) { + const {_id, username} = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: new Date().toLocaleDateString("en-US", { + timeZone: "UTC", weekday: "short", month: "short", + day: "2-digit", year: "numeric" + }).replaceAll(',', '') + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + body: `description=${expected.description}&duration=${expected.duration}` + }); + if(addRes.ok) { + const logRes = await fetch(url + `/api/users/${_id}/logs`); + if(logRes.ok){ + const {log} = await logRes.json(); + const exercise = log[0]; + assert.isString(exercise.date); + assert.equal(exercise.date, expected.date); + } else { + throw new Error(`${logRes.status} ${logRes.statusText}`); + } + } else { + throw new Error(`${addRes.status} ${addRes.statusText}`); + }; + } else { + throw new Error(`${res.status} ${res.statusText}`); + }; +}; +``` + +You can add `from`, `to` and `limit` parameters to a `GET /api/users/:_id/logs` request to retrieve part of the log of any user. `from` and `to` are dates in `yyyy-mm-dd` format. `limit` is an integer of how many logs to send back. + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `username=fcc_test_${Date.now()}`.substring(0, 29) + }); + if (res.ok) { + const { _id, username } = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: new Date().toDateString() + }; + const addExerciseRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `description=${expected.description}&duration=${expected.duration}&date=1990-01-01` + }); + const addExerciseTwoRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `description=${expected.description}&duration=${expected.duration}&date=1990-01-03` + }); + if (addExerciseRes.ok && addExerciseTwoRes.ok) { + const logRes = await fetch( + url + `/api/users/${_id}/logs?from=1989-12-31&to=1990-01-04` + ); + if (logRes.ok) { + const { log } = await logRes.json(); + assert.isArray(log); + assert.equal(2, log.length); + } else { + throw new Error(`${logRes.status} ${logRes.statusText}`); + } + const limitRes = await fetch( + url + `/api/users/${_id}/logs?limit=1` + ); + if (limitRes.ok) { + const { log } = await limitRes.json(); + assert.isArray(log); + assert.equal(1, log.length); + } else { + throw new Error(`${limitRes.status} ${limitRes.statusText}`); + } + const filterDateBeforeLimitRes = await fetch( + url + `/api/users/${_id}/logs?from=1990-01-02&to=1990-01-04&limit=1` + ); + if (filterDateBeforeLimitRes.ok) { + const { log } = await filterDateBeforeLimitRes.json(); + assert.isArray(log); + assert.equal(1, log.length); + } else { + throw new Error(`${filterDateBeforeLimitRes.status} ${filterDateBeforeLimitRes.statusText}`); + } + } else { + throw new Error(`${res.status} ${res.statusText}`); + } + } else { + throw new Error(`${res.status} ${res.statusText}`); + } +}; +``` diff --git a/curriculum/challenges/japanese/25-front-end-development/lab-number-guessing-game/602da04c22201c65d2a019f4.md b/curriculum/challenges/japanese/25-front-end-development/lab-number-guessing-game/602da04c22201c65d2a019f4.md new file mode 100644 index 0000000000..ef87dc6720 --- /dev/null +++ b/curriculum/challenges/japanese/25-front-end-development/lab-number-guessing-game/602da04c22201c65d2a019f4.md @@ -0,0 +1,25 @@ +--- +id: 602da04c22201c65d2a019f4 +title: Build a Number Guessing Game +challengeType: 13 +url: freeCodeCamp/learn-number-guessing-game +dashedName: lab-number-guessing-game +--- + +# --description-- + +For this lab, you will use Bash scripting, PostgreSQL, and Git to create a number guessing game that runs in the terminal and saves user information. + +# --instructions-- + +**Important:** After you pass all the project tests, save a dump of your database into a `number_guess.sql` file, as well as your `number_guess.sh` file, so you can complete step 2. There will be instructions on how to do that within the virtual machine. + +# --notes-- + +Required files: `number_guess.sql`, `number_guess.sh` + +# --hints-- + +# --seed-- + +# --solutions-- diff --git a/curriculum/challenges/japanese/25-front-end-development/lab-request-header-parser-microservice/bd7158d8c443edefaeb5bdff.md b/curriculum/challenges/japanese/25-front-end-development/lab-request-header-parser-microservice/bd7158d8c443edefaeb5bdff.md new file mode 100644 index 0000000000..5040e27424 --- /dev/null +++ b/curriculum/challenges/japanese/25-front-end-development/lab-request-header-parser-microservice/bd7158d8c443edefaeb5bdff.md @@ -0,0 +1,65 @@ +--- +id: bd7158d8c443edefaeb5bdff +title: Build a Request Header Parser Microservice +challengeType: 4 +dashedName: lab-request-header-parser-microservice +--- + +# --description-- + +Build a full stack JavaScript app that is functionally similar to this: https://request-header-parser-microservice.freecodecamp.rocks/. Working on this project will involve you writing your code using one of the following methods: + +- Clone this GitHub repo and complete your project locally. +- Use our Gitpod starter project to complete your project. +- Use a site builder of your choice to complete the project. Be sure to incorporate all the files from our GitHub repo. + +# --hints-- + +You should provide your own project, not the example URL. + +```js +(getUserInput) => { + assert( + !/.*\/request-header-parser-microservice\.freecodecamp\.rocks/.test( + getUserInput('url') + ) + ); +}; +``` + +A request to `/api/whoami` should return a JSON object with your IP address in the `ipaddress` key. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/api/whoami').then( + (data) => assert(data.ipaddress && data.ipaddress.length > 0), + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + +A request to `/api/whoami` should return a JSON object with your preferred language in the `language` key. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/api/whoami').then( + (data) => assert(data.language && data.language.length > 0), + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + +A request to `/api/whoami` should return a JSON object with your software in the `software` key. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/api/whoami').then( + (data) => assert(data.software && data.software.length > 0), + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/japanese/25-front-end-development/lab-url-shortener-microservice/bd7158d8c443edefaeb5bd0e.md b/curriculum/challenges/japanese/25-front-end-development/lab-url-shortener-microservice/bd7158d8c443edefaeb5bd0e.md new file mode 100644 index 0000000000..0fbf80a0bf --- /dev/null +++ b/curriculum/challenges/japanese/25-front-end-development/lab-url-shortener-microservice/bd7158d8c443edefaeb5bd0e.md @@ -0,0 +1,107 @@ +--- +id: bd7158d8c443edefaeb5bd0e +title: URL Shortener Microservice +challengeType: 4 +dashedName: url-shortener-microservice +--- + +# --description-- + +Build a full stack JavaScript app that is functionally similar to this: https://url-shortener-microservice.freecodecamp.rocks. Working on this project will involve you writing your code using one of the following methods: + +- Clone this GitHub repo and complete your project locally. +- Use our Gitpod starter project to complete your project. +- Use a site builder of your choice to complete the project. Be sure to incorporate all the files from our GitHub repo. + +# --instructions-- + +**HINT:** Do not forget to use a body parsing middleware to handle the POST requests. Also, you can use the function `dns.lookup(host, cb)` from the `dns` core module to verify a submitted URL. + +# --hints-- + +You should provide your own project, not the example URL. + +```js +(getUserInput) => { + assert( + !/.*\/url-shortener-microservice\.freecodecamp\.rocks/.test( + getUserInput('url') + ) + ); +}; +``` + +You can POST a URL to `/api/shorturl` and get a JSON response with `original_url` and `short_url` properties. Here's an example: `{ original_url : 'https://freeCodeCamp.org', short_url : 1}` + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const urlVariable = Date.now(); + const fullUrl = `${url}/?v=${urlVariable}` + const res = await fetch(url + '/api/shorturl', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `url=${fullUrl}` + }); + if (res.ok) { + const { short_url, original_url } = await res.json(); + assert.isNotNull(short_url); + assert.strictEqual(original_url, `${url}/?v=${urlVariable}`); + } else { + throw new Error(`${res.status} ${res.statusText}`); + } +}; +``` + +When you visit `/api/shorturl/`, you will be redirected to the original URL. + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const urlVariable = Date.now(); + const fullUrl = `${url}/?v=${urlVariable}` + let shortenedUrlVariable; + const postResponse = await fetch(url + '/api/shorturl', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `url=${fullUrl}` + }); + if (postResponse.ok) { + const { short_url } = await postResponse.json(); + shortenedUrlVariable = short_url; + } else { + throw new Error(`${postResponse.status} ${postResponse.statusText}`); + } + const getResponse = await fetch( + url + '/api/shorturl/' + shortenedUrlVariable + ); + if (getResponse) { + const { redirected, url } = getResponse; + assert.isTrue(redirected); + assert.strictEqual(url,fullUrl); + } else { + throw new Error(`${getResponse.status} ${getResponse.statusText}`); + } +}; +``` + +If you pass an invalid URL that doesn't follow the valid `http://www.example.com` format, the JSON response will contain `{ error: 'invalid url' }` + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/shorturl', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `url=ftp:/john-doe.invalidTLD` + }); + if (res.ok) { + const { error } = await res.json(); + assert.isNotNull(error); + assert.strictEqual(error.toLowerCase(), 'invalid url'); + } else { + throw new Error(`${res.status} ${res.statusText}`); + } +}; +``` + diff --git a/curriculum/challenges/japanese/25-front-end-development/lab-world-cup-database/5f9771307d4d22b9d2b75a94.md b/curriculum/challenges/japanese/25-front-end-development/lab-world-cup-database/5f9771307d4d22b9d2b75a94.md new file mode 100644 index 0000000000..d77442a1ba --- /dev/null +++ b/curriculum/challenges/japanese/25-front-end-development/lab-world-cup-database/5f9771307d4d22b9d2b75a94.md @@ -0,0 +1,25 @@ +--- +id: 5f9771307d4d22b9d2b75a94 +title: Build a World Cup Database +challengeType: 13 +url: freeCodeCamp/learn-world-cup-database +dashedName: lab-world-cup-database +--- + +# --description-- + +For this project, you will create a Bash script that enters information from World Cup games into PostgreSQL, then query the database for useful statistics. + +# --instructions-- + +**Important:** After you pass all the project tests, save a dump of your database into a `worldcup.sql` file, as well as your `insert_data.sh` and `queries.sh` files, so you can complete step 2. There will be instructions how to do that within the virtual machine. + +# --notes-- + +Required files: `worldcup.sql`, `insert_data.sh`, `queries.sh` + +# --hints-- + +# --seed-- + +# --solutions-- diff --git a/curriculum/challenges/japanese/25-front-end-development/workshop-hotel-feedback-form/66a96127422411756204bc1b.md b/curriculum/challenges/japanese/25-front-end-development/workshop-hotel-feedback-form/66a96127422411756204bc1b.md index 51ea9e3069..753ee1a6bb 100644 --- a/curriculum/challenges/japanese/25-front-end-development/workshop-hotel-feedback-form/66a96127422411756204bc1b.md +++ b/curriculum/challenges/japanese/25-front-end-development/workshop-hotel-feedback-form/66a96127422411756204bc1b.md @@ -7,9 +7,9 @@ dashedName: step-22 # --description-- -Add another label with the text of `Personal Recommendation`. The `for` attribute should be set to `"recommendation"`. +Add another `label` with the text of `Personal Recommendation`. The `for` attribute should be set to `"recommendation"`. -Below the label element, add another checkbox input with the `id`, `name` and `value` attributes set to `"recommendation"`. +Below the `label` element, add another checkbox `input` with the `id`, `name` and `value` attributes set to `"recommendation"`. # --hints-- diff --git a/curriculum/challenges/japanese/25-front-end-development/workshop-hotel-feedback-form/66a962954f4e0d76223b37ed.md b/curriculum/challenges/japanese/25-front-end-development/workshop-hotel-feedback-form/66a962954f4e0d76223b37ed.md index 42c425209d..80a23ca86d 100644 --- a/curriculum/challenges/japanese/25-front-end-development/workshop-hotel-feedback-form/66a962954f4e0d76223b37ed.md +++ b/curriculum/challenges/japanese/25-front-end-development/workshop-hotel-feedback-form/66a962954f4e0d76223b37ed.md @@ -11,7 +11,7 @@ Next, add another `label` element with the text of `Location` and the `for` attr For the checkbox `input`, both the `id`, `name` and `value` attributes should be set to `"location"`. -Below that `input` element, add another `label` element with the text of `Reputation` and the for attribute set to `"reputation"`. +Below that `input` element, add another `label` element with the text of `Reputation` and the `for` attribute set to `"reputation"`. For the checkbox `input`, both the `id`, `name` and `value` attributes should be set to `"reputation"`. diff --git a/curriculum/challenges/japanese/25-front-end-development/workshop-hotel-feedback-form/66a972137acd1179fa3fe8a0.md b/curriculum/challenges/japanese/25-front-end-development/workshop-hotel-feedback-form/66a972137acd1179fa3fe8a0.md index 69efa4832c..09e3e6e59b 100644 --- a/curriculum/challenges/japanese/25-front-end-development/workshop-hotel-feedback-form/66a972137acd1179fa3fe8a0.md +++ b/curriculum/challenges/japanese/25-front-end-development/workshop-hotel-feedback-form/66a972137acd1179fa3fe8a0.md @@ -7,7 +7,7 @@ dashedName: step-28 # --description-- -Inside your `select` element, add the following five `option` elements with these corresponding values for the option text and `value` attribute: +Inside your `select` element, add the following five `option` elements with these corresponding values for the `option` text and `value` attribute: **Value Attributes:** diff --git a/curriculum/challenges/japanese/25-front-end-development/workshop-hotel-feedback-form/66a97ca8c4cbae7d0bb6e0ad.md b/curriculum/challenges/japanese/25-front-end-development/workshop-hotel-feedback-form/66a97ca8c4cbae7d0bb6e0ad.md index 6549345d45..22b9a707be 100644 --- a/curriculum/challenges/japanese/25-front-end-development/workshop-hotel-feedback-form/66a97ca8c4cbae7d0bb6e0ad.md +++ b/curriculum/challenges/japanese/25-front-end-development/workshop-hotel-feedback-form/66a97ca8c4cbae7d0bb6e0ad.md @@ -7,7 +7,7 @@ dashedName: step-31 # --description-- -Inside your `select` element, add the following five `option` elements with these corresponding values for the option text and `value` attribute: +Inside your `select` element, add the following five `option` elements with these corresponding values for the `option` text and `value` attribute: **Value Attribute:** diff --git a/curriculum/challenges/japanese/25-front-end-development/workshop-loan-qualification-checker/66c8ba41a77db20a93f9d7a1.md b/curriculum/challenges/japanese/25-front-end-development/workshop-loan-qualification-checker/66c8ba41a77db20a93f9d7a1.md new file mode 100644 index 0000000000..237515fd88 --- /dev/null +++ b/curriculum/challenges/japanese/25-front-end-development/workshop-loan-qualification-checker/66c8ba41a77db20a93f9d7a1.md @@ -0,0 +1,71 @@ +--- +id: 66c8ba41a77db20a93f9d7a1 +title: Step 1 +challengeType: 1 +dashedName: step-1 +--- + +# --description-- + +In this workshop, you'll review JavaScript conditionals by building a loan qualification checker app. + +The app will check whether the user is eligible for a duplex, car, and condo loan based on their annual income and credit score. A credit score is a number that represents how good you are at managing borrowed money. + +To get started, create the following variables and values. + +| Variable Name | Value | +| ------------------------- | ------- | +| `minIncomeForDuplex` | `60000` | +| `minCreditScoreForDuplex` | `700` | +| `minIncomeForCondo` | `45000` | +| `minCreditScoreForCondo` | `680` | +| `minIncomeForCar` | `30000` | +| `minCreditScoreForCar` | `650` | + +# --hints-- + +You should create a `minIncomeForDuplex` variable set to `60000`. + +```js +assert.equal(minIncomeForDuplex, 60000); +``` + +You should create a `minCreditScoreForDuplex` set to `700`. + +```js +assert.equal(minCreditScoreForDuplex, 700); +``` + +You should create a `minIncomeForCar` variable set to `30000`. + +```js +assert.equal(minIncomeForCar, 30000); +``` + +You should create a `minCreditScoreForCar` variable set to `650`. + +```js +assert.equal(minCreditScoreForCar, 650); +``` + +You should create a `minIncomeForCondo` variable set to `45000`. + +```js +assert.equal(minIncomeForCondo, 45000); +``` + +You should create a `minCreditScoreForCondo` variable set to `680`. + +```js +assert.equal(minCreditScoreForCondo, 680); +``` + +# --seed-- + +## --seed-contents-- + +```js +--fcc-editable-region-- + +--fcc-editable-region-- +``` diff --git a/curriculum/challenges/japanese/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4ac.md b/curriculum/challenges/japanese/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4ac.md new file mode 100644 index 0000000000..7755f823c4 --- /dev/null +++ b/curriculum/challenges/japanese/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4ac.md @@ -0,0 +1,53 @@ +--- +id: 66c8ba975ee7230e29f6c4ac +title: Step 2 +challengeType: 1 +dashedName: step-2 +--- + +# --description-- + +When the user is eligible for a loan, you'll want to display a message to them in the console. + +For that, you'll build out a function inside which you'll have some checks that'll return what loan the applicant is eligible for. + +Create an empty `getLoanMessage` function with an `annualIncome` and `creditScore` parameters. + +# --hints-- + +You should create a `getLoanMessage` function + +```js +assert.isFunction(getLoanMessage) +``` + +Your `getLoanMessage` function should have an `annualIncome` and `creditScore` as parameters. + +```js +assert.match(getLoanMessage?.toString(), /\(\s*annualIncome,\s*creditScore\s*\)|\(\s*creditScore,\s*annualIncome\s*\)/); +``` + +`getLoanMessage` should be an empty function. + +```js +assert.match(getLoanMessage?.toString(), /\{\s*\}/); +``` + +# --seed-- + +## --seed-contents-- + +```js +const minIncomeForDuplex = 60000; +const minCreditScoreForDuplex = 700; + +const minIncomeForCondo = 45000; +const minCreditScoreForCondo = 680; + +const minIncomeForCar = 30000; +const minCreditScoreForCar = 650; + +--fcc-editable-region-- + +--fcc-editable-region-- +``` diff --git a/curriculum/challenges/japanese/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4ad.md b/curriculum/challenges/japanese/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4ad.md new file mode 100644 index 0000000000..82a29d7cd9 --- /dev/null +++ b/curriculum/challenges/japanese/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4ad.md @@ -0,0 +1,55 @@ +--- +id: 66c8ba975ee7230e29f6c4ad +title: Step 3 +challengeType: 1 +dashedName: step-3 +--- + +# --description-- + +To check which loan a user is qualified for based on the `annualIncome` and `creditScore`, you have to use `if/else if` statement or a ternary right inside the `getLoanMessage` function. You'll then return the appropraite message in the block of each condition. + +Starting with the duplex loan, check if `annualIncome` is greater than or equal to `minIncomeForDuplex` AND if `creditScore` is greater than `minCreditScoreForDuplex`. + +If that condition is true, then the applicant is eligible for a duplex loan and the other loans. So, inside the check, return the string `"You qualify for a car, duplex and Condo loan."` + +# --hints-- + +Your `getLoanMessage` function should return a string. + +```js +assert.isString(getLoanMessage(65000, 750)); +``` + +Your `getLoanMessage` function should return the string `"You qualify for a duplex, condo, and car loan."`. + +```js +assert.strictEqual(getLoanMessage(65000, 750), "You qualify for a duplex, condo, and car loan."); +``` + +Your `getLoanMessage` function should return `undefined` if the applicant's annual income and credit score do not meet the requirements for a duplex loan. + +```js +assert.strictEqual(getLoanMessage(59000, 700), undefined); +``` + +# --seed-- + +## --seed-contents-- + +```js +const minIncomeForDuplex = 60000; +const minCreditScoreForDuplex = 700; + +const minIncomeForCondo = 45000; +const minCreditScoreForCondo = 680; + +const minIncomeForCar = 30000; +const minCreditScoreForCar = 650; + +--fcc-editable-region-- +function getLoanMessage(annualIncome, creditScore) { + +} +--fcc-editable-region-- +``` diff --git a/curriculum/challenges/japanese/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4af.md b/curriculum/challenges/japanese/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4af.md new file mode 100644 index 0000000000..638e6291a4 --- /dev/null +++ b/curriculum/challenges/japanese/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4af.md @@ -0,0 +1,56 @@ +--- +id: 66c8ba975ee7230e29f6c4af +title: Step 4 +challengeType: 1 +dashedName: step-4 +--- + +# --description-- + +If the applicant's annual income is greater than or equal to `minIncomeForCondo`, AND if their credit score is greater than or equal to `minCreditScoreForCondo`, then they qualify for a condo and car loan. + +Check if that's true in the `getLoanMessage` function. If it is, return the string `"You qualify for a condo and car loan."` + +# --hints-- + +Your `getLoanMessage` function should return a string if the applicant qualifies for a condo and car loan. + +```js +assert.isString(getLoanMessage(45000, 680)); +``` + +Your `getLoanMessage` function should return the string `"You qualify for a condo and car loan."`. + +```js +assert.strictEqual(getLoanMessage(45000, 680), "You qualify for a condo and car loan."); +``` + +Your `getLoanMessage` function should return `undefined` if the applicant's annual income and credit score do not meet the requirements for a condo loan. + +```js +assert.strictEqual(getLoanMessage(45000, 650), undefined); +``` + +# --seed-- + +## --seed-contents-- + +```js +const minIncomeForDuplex = 60000; +const minCreditScoreForDuplex = 700; + +const minIncomeForCondo = 45000; +const minCreditScoreForCondo = 680; + +const minIncomeForCar = 30000; +const minCreditScoreForCar = 650; + +function getLoanMessage(annualIncome, creditScore) { + if(creditScore >= minCreditScoreForDuplex && annualIncome >= minIncomeForDuplex) { + return "You qualify for a duplex, condo, and car loan." +--fcc-editable-region-- + } + +--fcc-editable-region-- +} +``` diff --git a/curriculum/challenges/japanese/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b0.md b/curriculum/challenges/japanese/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b0.md new file mode 100644 index 0000000000..374ba7b8fe --- /dev/null +++ b/curriculum/challenges/japanese/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b0.md @@ -0,0 +1,56 @@ +--- +id: 66c8ba975ee7230e29f6c4b0 +title: Step 5 +challengeType: 1 +dashedName: step-5 +--- + +# --description-- + +Now, you should check if the applicant is qualified for a car loan only. If they're, return the string `"You qualify for a car loan."`. + +# --hints-- + +Your `getLoanMessage` function should return a string if the applicant qualifies for a car loan. + +```js +assert.isString(getLoanMessage(30000, 650)); +``` + +Your `getLoanMessage` function should return the string `"You qualify for a car loan."`. + +```js +assert.strictEqual(getLoanMessage(30000, 650), "You qualify for a car loan."); +``` + +Your `getLoanMessage` function should return `undefined` if the applicant's annual income and credit score do not meet the requirements for a car loan. + +```js +assert.strictEqual(getLoanMessage(30000, 600), undefined); +``` + +# --seed-- + +## --seed-contents-- + +```js +const minIncomeForDuplex = 60000; +const minCreditScoreForDuplex = 700; + +const minIncomeForCondo = 45000; +const minCreditScoreForCondo = 680; + +const minIncomeForCar = 30000; +const minCreditScoreForCar = 650; + +function getLoanMessage(annualIncome, creditScore) { + if(creditScore >= minCreditScoreForDuplex && annualIncome >= minIncomeForDuplex) { + return "You qualify for a duplex, condo, and car loan." + } else if (annualIncome >= minIncomeForCondo && creditScore >= minCreditScoreForCondo) { + return "You qualify for a condo and car loan." +--fcc-editable-region-- + } + +--fcc-editable-region-- +} +``` diff --git a/curriculum/challenges/japanese/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b1.md b/curriculum/challenges/japanese/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b1.md new file mode 100644 index 0000000000..16e8c7baca --- /dev/null +++ b/curriculum/challenges/japanese/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b1.md @@ -0,0 +1,54 @@ +--- +id: 66c8ba975ee7230e29f6c4b1 +title: Step 6 +challengeType: 1 +dashedName: step-6 +--- + +# --description-- + +If the applicant's annual income and credit score fall below `minIncomeForCar` and `minCreditScoreForCar`, then they don't qualify for any loan. So, return the string `"You don't qualify for any loans."` + +# --hints-- + +Your `getLoanMessage` function should return a string if the applicant doesn't qualify for any loan. + +```js +assert.isString(getLoanMessage(25000, 550)); +``` + +Your `getLoanMessage` function should return the string `"You don't qualify for any loans."` if the applicant does not meet the requirements for any loan. + +```js +assert.strictEqual(getLoanMessage(15000, 600), "You don't qualify for any loans."); +assert.strictEqual(getLoanMessage(25000, 550), "You don't qualify for any loans."); +assert.strictEqual(getLoanMessage(20000, 500), "You don't qualify for any loans."); +``` + +# --seed-- + +## --seed-contents-- + +```js +const minIncomeForDuplex = 60000; +const minCreditScoreForDuplex = 700; + +const minIncomeForCondo = 45000; +const minCreditScoreForCondo = 680; + +const minIncomeForCar = 30000; +const minCreditScoreForCar = 650; + +function getLoanMessage(annualIncome, creditScore) { + if(creditScore >= minCreditScoreForDuplex && annualIncome >= minIncomeForDuplex) { + return "You qualify for a duplex, condo, and car loan." + } else if (annualIncome >= minIncomeForCondo && creditScore >= minCreditScoreForCondo) { + return "You qualify for a condo and car loan." + } else if (annualIncome >= minIncomeForCar && creditScore >= minCreditScoreForCar) { + return "You qualify for a car loan." +--fcc-editable-region-- + } + +--fcc-editable-region-- +} +``` diff --git a/curriculum/challenges/japanese/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b2.md b/curriculum/challenges/japanese/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b2.md new file mode 100644 index 0000000000..9d19f9ea4c --- /dev/null +++ b/curriculum/challenges/japanese/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b2.md @@ -0,0 +1,165 @@ +--- +id: 66c8ba975ee7230e29f6c4b2 +title: Step 7 +challengeType: 1 +dashedName: step-7 +--- + +# --description-- + +Now, it is time to test out your `getLoanMessage` function. + +Use the table below to create `4` variables and their values: + +| Variable Name | Value | +| --------------- | ---------------------------- | +| `duplexLoanMsg` | `getLoanMessage(85000, 850)` | +| `condoLoanMsg` | `getLoanMessage(65000, 690)` | +| `carLoanMsg` | `getLoanMessage(45000, 660)` | +| `noLoanMsg` | `getLoanMessage(25000, 550)` | + +After that, log each variable to the console to see the messages. + +With that, your loan qualification checker project is complete! + +# --hints-- + +You should have a variable called `duplexLoanMsg`. + +```js +assert.isNotNull(duplexLoanMsg); +``` + +Your `duplexLoanMsg` variable should be set to the result of `getLoanMessage(85000, 850)`. + +```js +assert.equal(duplexLoanMsg, getLoanMessage(85000, 850)); +``` + +You should log the `duplexLoanMsg` variable to the console. + +```js +assert.match(code, /console\.log\(duplexLoanMsg\)/) +``` + +You should have a variable called `condoLoanMsg`. + +```js +assert.isNotNull(condoLoanMsg); +``` + +Your `condoLoanMsg` variable should be set to the result of `getLoanMessage(65000, 690)`. + +```js +assert.equal(condoLoanMsg, getLoanMessage(65000, 690)); +``` + +You should log the `condoLoanMsg` variable to the console. + +```js +assert.match(code, /console\.log\(condoLoanMsg\)/) +``` + +You should have a variable called `carLoanMsg`. + +```js +assert.isNotNull(carLoanMsg); +``` + +Your `carLoanMsg` variable should be set to the result of `getLoanMessage(45000, 660)`. + +```js +assert.equal(carLoanMsg, getLoanMessage(45000, 660)); +``` + +You should log the `carLoanMsg` variable to the console. + +```js +assert.match(code, /console\.log\(carLoanMsg\)/) +``` + +You should have a variable called `noLoanMsg`. + +```js +assert.isNotNull(noLoanMsg); +``` + +Your `noLoanMsg` variable should be set to the result of `getLoanMessage(25000, 550)`. + +```js +assert.equal(noLoanMsg, getLoanMessage(25000, 550)); +``` + +You should log the `noLoanMsg` variable to the console. + +```js +assert.match(code, /console\.log\(noLoanMsg\)/) +``` + +# --seed-- + +## --seed-contents-- + +```js +const minIncomeForDuplex = 60000; +const minCreditScoreForDuplex = 700; + +const minIncomeForCondo = 45000; +const minCreditScoreForCondo = 680; + +const minIncomeForCar = 30000; +const minCreditScoreForCar = 650; + +function getLoanMessage(annualIncome, creditScore) { + if(creditScore >= minCreditScoreForDuplex && annualIncome >= minIncomeForDuplex) { + return "You qualify for a duplex, condo, and car loan." + } else if (annualIncome >= minIncomeForCondo && creditScore >= minCreditScoreForCondo) { + return "You qualify for a condo and car loan." + } else if (annualIncome >= minIncomeForCar && creditScore >= minCreditScoreForCar) { + return "You qualify for a car loan." + } else { + return "You don't qualify for any loans." + } +} + +--fcc-editable-region-- + +--fcc-editable-region-- +``` + +# --solutions-- + +```js +const minIncomeForDuplex = 60000; +const minCreditScoreForDuplex = 700; + +const minIncomeForCondo = 45000; +const minCreditScoreForCondo = 680; + +const minIncomeForCar = 30000; +const minCreditScoreForCar = 650; + +function getLoanMessage(annualIncome, creditScore) { + if(creditScore >= minCreditScoreForDuplex && annualIncome >= minIncomeForDuplex) { + return "You qualify for a duplex, condo, and car loan." + } else if (annualIncome >= minIncomeForCondo && creditScore >= minCreditScoreForCondo) { + return "You qualify for a condo and car loan." + } else if (annualIncome >= minIncomeForCar && creditScore >= minCreditScoreForCar) { + return "You qualify for a car loan." + } else { + return "You don't qualify for any loans." + } +} + +const duplexLoanMsg = getLoanMessage(85000, 850) +console.log(duplexLoanMsg) + +const condoLoanMsg = getLoanMessage(65000, 690) +console.log(condoLoanMsg) + +const carLoanMsg = getLoanMessage(45000, 660) +console.log(carLoanMsg) + +const noLoanMsg = getLoanMessage(25000, 550) +console.log(noLoanMsg) +``` diff --git a/curriculum/challenges/japanese/25-front-end-development/workshop-mario-database/5f2c289f164c29556da632fd.md b/curriculum/challenges/japanese/25-front-end-development/workshop-mario-database/5f2c289f164c29556da632fd.md new file mode 100644 index 0000000000..4e11751ca0 --- /dev/null +++ b/curriculum/challenges/japanese/25-front-end-development/workshop-mario-database/5f2c289f164c29556da632fd.md @@ -0,0 +1,19 @@ +--- +id: 5f2c289f164c29556da632fd +title: Build a Mario Database +challengeType: 12 +url: freeCodeCamp/learn-relational-databases-by-building-a-mario-database +dashedName: build-a-mario-database +--- + +# --description-- + +In this 165-lesson workshop, you will learn the basics of a relational database by creating a PostgreSQL database filled with video game characters. + +# --instructions-- + +# --hints-- + +# --seed-- + +# --solutions-- diff --git a/curriculum/challenges/japanese/25-front-end-development/workshop-npm-packages/587d7fb3367417b2b2512bfb.md b/curriculum/challenges/japanese/25-front-end-development/workshop-npm-packages/587d7fb3367417b2b2512bfb.md new file mode 100644 index 0000000000..8d4c90410d --- /dev/null +++ b/curriculum/challenges/japanese/25-front-end-development/workshop-npm-packages/587d7fb3367417b2b2512bfb.md @@ -0,0 +1,53 @@ +--- +id: 587d7fb3367417b2b2512bfb +title: How to Use package.json, the Core of Any Node.js Project or npm Package +challengeType: 2 +forumTopicId: 301528 +dashedName: how-to-use-package-json-the-core-of-any-node-js-project-or-npm-package +--- + +# --description-- + +Working on these challenges will involve you writing your code using one of the following methods: + +- Clone this GitHub repo and complete these challenges locally. +- Use our Gitpod starter project to complete these challenges. +- Use a site builder of your choice to complete the project. Be sure to incorporate all the files from our GitHub repo. + +The `package.json` file is the center of any Node.js project or npm package. It stores information about your project. It consists of a single JSON object where information is stored in key-value pairs. There are only two required fields; `name` and `version`, but it’s good practice to provide additional information. + +You can create the `package.json` file from the terminal using the `npm init` command. This will run a guided setup. Using `npm init` with the `-y` flag will generate the file without having it ask any questions, `npm init -y`. + +If you look at the file tree of your project, you will find the `package.json` file on the top level of the tree. This is the file that you will be improving in the next couple of challenges. + +One of the most common pieces of information in this file is the `author` field. It specifies who created the project, and can consist of a string or an object with contact or other details. An object is recommended for bigger projects, but a simple string like the following example will do for this project. + +```json +"author": "Jane Doe", +``` + +# --instructions-- + +Add your name as the `author` of the project in the `package.json` file. + +**Note:** Remember that you’re writing JSON, so all field names must use double-quotes (") and be separated with a comma (,). + +If you are using Gitpod, make sure the app is running and the preview window is open. Copy the preview window's URL and paste it into the Solution Link input below. + +# --hints-- + +`package.json` should have a valid "author" key + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert(packJson.author, '"author" is missing'); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/japanese/25-front-end-development/workshop-npm-packages/587d7fb3367417b2b2512bfc.md b/curriculum/challenges/japanese/25-front-end-development/workshop-npm-packages/587d7fb3367417b2b2512bfc.md new file mode 100644 index 0000000000..37d15d5261 --- /dev/null +++ b/curriculum/challenges/japanese/25-front-end-development/workshop-npm-packages/587d7fb3367417b2b2512bfc.md @@ -0,0 +1,43 @@ +--- +id: 587d7fb3367417b2b2512bfc +title: Add a Description to Your package.json +challengeType: 2 +forumTopicId: 301522 +dashedName: add-a-description-to-your-package-json +--- + +# --description-- + +The next part of a good package.json file is the `description` field; where a short, but informative description about your project belongs. + +If some day you plan to publish a package to npm, this is the string that should sell your idea to the user when they decide whether to install your package or not. However, that’s not the only use case for the description, it’s a great way to summarize what a project does. It’s just as important in any Node.js project to help other developers, future maintainers or even your future self understand the project quickly. + +Regardless of what you plan for your project, a description is definitely recommended. Here's an example: + +```json +"description": "A project that does something awesome", +``` + +# --instructions-- + +Add a `description` to the package.json file of your project. + +**Note:** Remember to use double-quotes for field-names (") and commas (,) to separate fields. + +# --hints-- + +package.json should have a valid "description" key + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert(packJson.description, '"description" is missing'); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/japanese/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bfd.md b/curriculum/challenges/japanese/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bfd.md new file mode 100644 index 0000000000..a001cdd477 --- /dev/null +++ b/curriculum/challenges/japanese/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bfd.md @@ -0,0 +1,75 @@ +--- +id: 587d7fb4367417b2b2512bfd +title: Add Keywords to Your package.json +challengeType: 2 +forumTopicId: 301526 +dashedName: add-keywords-to-your-package-json +--- + +# --description-- + +The `keywords` field is where you can describe your project using related keywords. Here's an example: + +```json +"keywords": [ "descriptive", "related", "words" ], +``` + +As you can see, this field is structured as an array of double-quoted strings. + +# --instructions-- + +Add an array of suitable strings to the `keywords` field in the package.json file of your project. + +One of the keywords should be "freecodecamp". + +# --hints-- + +package.json should have a valid "keywords" key + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert(packJson.keywords, '"keywords" is missing'); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + +"keywords" field should be an Array + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.isArray(packJson.keywords, '"keywords" is not an array'); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + +"keywords" should include "freecodecamp" + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.include( + packJson.keywords, + 'freecodecamp', + '"keywords" does not include "freecodecamp"' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/japanese/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bfe.md b/curriculum/challenges/japanese/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bfe.md new file mode 100644 index 0000000000..7b09acd042 --- /dev/null +++ b/curriculum/challenges/japanese/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bfe.md @@ -0,0 +1,39 @@ +--- +id: 587d7fb4367417b2b2512bfe +title: Add a License to Your package.json +challengeType: 2 +forumTopicId: 301523 +dashedName: add-a-license-to-your-package-json +--- + +# --description-- + +The `license` field is where you inform users of what they are allowed to do with your project. + +Some common licenses for open source projects include MIT and BSD. License information is not required, and copyright laws in most countries will give you ownership of what you create by default. However, it’s always a good practice to explicitly state what users can and can’t do. Here's an example of the license field: + +```json +"license": "MIT", +``` + +# --instructions-- + +Fill the `license` field in the package.json file of your project as you find suitable. + +# --hints-- + +package.json should have a valid "license" key + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert(packJson.license, '"license" is missing'); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/japanese/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bff.md b/curriculum/challenges/japanese/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bff.md new file mode 100644 index 0000000000..f2e571faed --- /dev/null +++ b/curriculum/challenges/japanese/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bff.md @@ -0,0 +1,37 @@ +--- +id: 587d7fb4367417b2b2512bff +title: Add a Version to Your package.json +challengeType: 2 +forumTopicId: 301525 +dashedName: add-a-version-to-your-package-json +--- + +# --description-- + +A `version` is one of the required fields of your package.json file. This field describes the current version of your project. Here's an example: + +```json +"version": "1.2.0", +``` + +# --instructions-- + +Add a `version` to the package.json file of your project. + +# --hints-- + +package.json should have a valid "version" key + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert(packJson.version, '"version" is missing'); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/japanese/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512c00.md b/curriculum/challenges/japanese/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512c00.md new file mode 100644 index 0000000000..161c60fe69 --- /dev/null +++ b/curriculum/challenges/japanese/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512c00.md @@ -0,0 +1,68 @@ +--- +id: 587d7fb4367417b2b2512c00 +title: Expand Your Project with External Packages from npm +challengeType: 2 +forumTopicId: 301527 +dashedName: expand-your-project-with-external-packages-from-npm +--- + +# --description-- + +One of the biggest reasons to use a package manager, is their powerful dependency management. Instead of manually having to make sure that you get all dependencies whenever you set up a project on a new computer, npm automatically installs everything for you. But how can npm know exactly what your project needs? Meet the `dependencies` section of your package.json file. + +In this section, packages your project requires are stored using the following format: + +```json +"dependencies": { + "package-name": "version", + "express": "4.14.0" +} + +``` + +# --instructions-- + +Add version `1.1.0` of the `@freecodecamp/example` package to the `dependencies` field of your `package.json` file. + +**Note:** `@freecodecamp/example` is a faux package used as a learning tool. + +# --hints-- + +`"dependencies"` should include `"@freecodecamp/example"`. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.property( + packJson.dependencies, + '@freecodecamp/example', + '"dependencies" does not include "@freecodecamp/example"' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + +`"@freecodecamp/example"` version should be `"1.1.0"`. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.match( + packJson.dependencies["@freecodecamp/example"], + /^[\^\~]?1\.1\.0/, + 'Wrong version of "@freecodecamp/example" installed. It should be 1.1.0' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/japanese/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c01.md b/curriculum/challenges/japanese/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c01.md new file mode 100644 index 0000000000..deda9b82de --- /dev/null +++ b/curriculum/challenges/japanese/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c01.md @@ -0,0 +1,64 @@ +--- +id: 587d7fb5367417b2b2512c01 +title: Manage npm Dependencies By Understanding Semantic Versioning +challengeType: 2 +forumTopicId: 301529 +dashedName: manage-npm-dependencies-by-understanding-semantic-versioning +--- + +# --description-- + +`Versions` of the npm packages in the dependencies section of your package.json file follow what’s called Semantic Versioning (SemVer), an industry standard for software versioning aiming to make it easier to manage dependencies. Libraries, frameworks or other tools published on npm should use SemVer in order to clearly communicate what kind of changes projects can expect if they update. + +Knowing SemVer can be useful when you develop software that uses external dependencies (which you almost always do). One day, your understanding of these numbers will save you from accidentally introducing breaking changes to your project without understanding why things that worked yesterday suddenly don’t work today. This is how Semantic Versioning works according to the official website: + +```json +"package": "MAJOR.MINOR.PATCH" +``` + +The MAJOR version should increment when you make incompatible API changes. The MINOR version should increment when you add functionality in a backwards-compatible manner. The PATCH version should increment when you make backwards-compatible bug fixes. This means that PATCHes are bug fixes and MINORs add new features but neither of them break what worked before. Finally, MAJORs add changes that won’t work with earlier versions. + +# --instructions-- + +In the dependencies section of your `package.json` file, change the version of `@freecodecamp/example` to match MAJOR version 1, MINOR version 2 and PATCH version 13 + +# --hints-- + +`"dependencies"` should include `"@freecodecamp/example"`. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.property( + packJson.dependencies, + '@freecodecamp/example', + '"dependencies" does not include "@freecodecamp/example"' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + +`"@freecodecamp/example"` version should be `"1.2.13"`. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.equal( + packJson.dependencies["@freecodecamp/example"], + '1.2.13', + 'Wrong version of "@freecodecamp/example". It should be 1.2.13' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/japanese/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c02.md b/curriculum/challenges/japanese/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c02.md new file mode 100644 index 0000000000..8eae5f51ee --- /dev/null +++ b/curriculum/challenges/japanese/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c02.md @@ -0,0 +1,66 @@ +--- +id: 587d7fb5367417b2b2512c02 +title: Use the Tilde-Character to Always Use the Latest Patch Version of a Dependency +challengeType: 2 +forumTopicId: 301532 +dashedName: use-the-tilde-character-to-always-use-the-latest-patch-version-of-a-dependency +--- + +# --description-- + +In the last challenge, you told npm to only include a specific version of a package. That’s a useful way to freeze your dependencies if you need to make sure that different parts of your project stay compatible with each other. But in most use cases, you don’t want to miss bug fixes since they often include important security patches and (hopefully) don’t break things in doing so. + +To allow an npm dependency to update to the latest PATCH version, you can prefix the dependency’s version with the tilde (`~`) character. Here's an example of how to allow updates to any `1.3.x` version. + +```json +"package": "~1.3.8" +``` + +# --instructions-- + +In the package.json file, your current rule for how npm may upgrade `@freecodecamp/example` is to use a specific version (`1.2.13`). But now, you want to allow the latest `1.2.x` version. + +Use the tilde (`~`) character to prefix the version of `@freecodecamp/example` in your dependencies, and allow npm to update it to any new _patch_ release. + +**Note:** The version numbers themselves should not be changed. + +# --hints-- + +`"dependencies"` should include `"@freecodecamp/example"`. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.property( + packJson.dependencies, + '@freecodecamp/example', + '"dependencies" does not include "@freecodecamp/example"' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + +`"@freecodecamp/example"` version should match `"~1.2.13"`. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.match( + packJson.dependencies["@freecodecamp/example"], + /^\~1\.2\.13/, + 'Wrong version of "@freecodecamp/example". It should be ~1.2.13' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/japanese/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c03.md b/curriculum/challenges/japanese/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c03.md new file mode 100644 index 0000000000..adc3014ea4 --- /dev/null +++ b/curriculum/challenges/japanese/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c03.md @@ -0,0 +1,66 @@ +--- +id: 587d7fb5367417b2b2512c03 +title: Use the Caret-Character to Use the Latest Minor Version of a Dependency +challengeType: 2 +forumTopicId: 301531 +dashedName: use-the-caret-character-to-use-the-latest-minor-version-of-a-dependency +--- + +# --description-- + +Similar to how the tilde we learned about in the last challenge allows npm to install the latest PATCH for a dependency, the caret (`^`) allows npm to install future updates as well. The difference is that the caret will allow both MINOR updates and PATCHes. + +Your current version of `@freecodecamp/example` should be `~1.2.13` which allows npm to install to the latest `1.2.x` version. If you were to use the caret (^) as a version prefix instead, npm would be allowed to update to any `1.x.x` version. + +```json +"package": "^1.3.8" +``` + +This would allow updates to any `1.x.x` version of the package. + +# --instructions-- + +Use the caret (`^`) to prefix the version of `@freecodecamp/example` in your dependencies and allow npm to update it to any new MINOR release. + +**Note:** The version numbers themselves should not be changed. + +# --hints-- + +`"dependencies"` should include `"@freecodecamp/example"`. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.property( + packJson.dependencies, + '@freecodecamp/example', + '"dependencies" does not include "@freecodecamp/example"' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + +`"@freecodecamp/example"` version should match `"^1.x.x"`. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.match( + packJson.dependencies["@freecodecamp/example"], + /^\^1\./, + 'Wrong version of "@freecodecamp/example". It should be ^1.2.13' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/japanese/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c04.md b/curriculum/challenges/japanese/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c04.md new file mode 100644 index 0000000000..5f695eed88 --- /dev/null +++ b/curriculum/challenges/japanese/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c04.md @@ -0,0 +1,43 @@ +--- +id: 587d7fb5367417b2b2512c04 +title: Remove a Package from Your Dependencies +challengeType: 2 +forumTopicId: 301530 +dashedName: remove-a-package-from-your-dependencies +--- + +# --description-- + +You have now tested a few ways you can manage dependencies of your project by using the package.json's dependencies section. You have also included external packages by adding them to the file and even told npm what types of versions you want, by using special characters such as the tilde or the caret. + +But what if you want to remove an external package that you no longer need? You might already have guessed it, just remove the corresponding key-value pair for that package from your dependencies. + +This same method applies to removing other fields in your package.json as well. + +# --instructions-- + +Remove the `@freecodecamp/example` package from your dependencies. + +**Note:** Make sure you have the right amount of commas after removing it. + +# --hints-- + +`"dependencies"` should not include `"@freecodecamp/example"`. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.notProperty( + packJson.dependencies, + '@freecodecamp/example', + '"dependencies" still includes "@freecodecamp/example"' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/korean/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/chunky-monkey.md b/curriculum/challenges/korean/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/chunky-monkey.md index 98b950c4ac..efee31a555 100644 --- a/curriculum/challenges/korean/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/chunky-monkey.md +++ b/curriculum/challenges/korean/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/chunky-monkey.md @@ -8,11 +8,11 @@ dashedName: chunky-monkey # --description-- -Write a function that splits an array (first argument) into groups the length of `size` (second argument) and returns them as a two-dimensional array. +배열(첫 번째 인자)을 배열 `size`의 길이(두 번째 인자)만큼의 그룹으로 쪼개고 이를 2차원 배열로 반환하세요. # --hints-- -`chunkArrayInGroups(["a", "b", "c", "d"], 2)` should return `[["a", "b"], ["c", "d"]]`. +`chunkArrayInGroups(["a", "b", "c", "d"], 2)`는 `[["a", "b"], ["c", "d"]]`를 반환해야 합니다. ```js assert.deepEqual(chunkArrayInGroups(['a', 'b', 'c', 'd'], 2), [ @@ -21,7 +21,7 @@ assert.deepEqual(chunkArrayInGroups(['a', 'b', 'c', 'd'], 2), [ ]); ``` -`chunkArrayInGroups([0, 1, 2, 3, 4, 5], 3)` should return `[[0, 1, 2], [3, 4, 5]]`. +`chunkArrayInGroups([0, 1, 2, 3, 4, 5], 3)`는 `[[0, 1, 2], [3, 4, 5]]`를 반환해야 합니다. ```js assert.deepEqual(chunkArrayInGroups([0, 1, 2, 3, 4, 5], 3), [ @@ -30,7 +30,7 @@ assert.deepEqual(chunkArrayInGroups([0, 1, 2, 3, 4, 5], 3), [ ]); ``` -`chunkArrayInGroups([0, 1, 2, 3, 4, 5], 2)` should return `[[0, 1], [2, 3], [4, 5]]`. +`chunkArrayInGroups([0, 1, 2, 3, 4, 5], 2)`는 `[[0, 1], [2, 3], [4, 5]]`를 반환해야 합니다. ```js assert.deepEqual(chunkArrayInGroups([0, 1, 2, 3, 4, 5], 2), [ @@ -40,7 +40,7 @@ assert.deepEqual(chunkArrayInGroups([0, 1, 2, 3, 4, 5], 2), [ ]); ``` -`chunkArrayInGroups([0, 1, 2, 3, 4, 5], 4)` should return `[[0, 1, 2, 3], [4, 5]]`. +`chunkArrayInGroups([0, 1, 2, 3, 4, 5], 4)`는 `[[0, 1, 2, 3], [4, 5]]`를 반환해야 합니다. ```js assert.deepEqual(chunkArrayInGroups([0, 1, 2, 3, 4, 5], 4), [ @@ -49,7 +49,7 @@ assert.deepEqual(chunkArrayInGroups([0, 1, 2, 3, 4, 5], 4), [ ]); ``` -`chunkArrayInGroups([0, 1, 2, 3, 4, 5, 6], 3)` should return `[[0, 1, 2], [3, 4, 5], [6]]`. +`chunkArrayInGroups([0, 1, 2, 3, 4, 5, 6], 3)`는 `[[0, 1, 2], [3, 4, 5], [6]]`를 반환해야 합니다. ```js assert.deepEqual(chunkArrayInGroups([0, 1, 2, 3, 4, 5, 6], 3), [ @@ -59,7 +59,7 @@ assert.deepEqual(chunkArrayInGroups([0, 1, 2, 3, 4, 5, 6], 3), [ ]); ``` -`chunkArrayInGroups([0, 1, 2, 3, 4, 5, 6, 7, 8], 4)` should return `[[0, 1, 2, 3], [4, 5, 6, 7], [8]]`. +`chunkArrayInGroups([0, 1, 2, 3, 4, 5, 6, 7, 8], 4)`는 `[[0, 1, 2, 3], [4, 5, 6, 7], [8]]`를 반환해야 합니다. ```js assert.deepEqual(chunkArrayInGroups([0, 1, 2, 3, 4, 5, 6, 7, 8], 4), [ @@ -69,7 +69,7 @@ assert.deepEqual(chunkArrayInGroups([0, 1, 2, 3, 4, 5, 6, 7, 8], 4), [ ]); ``` -`chunkArrayInGroups([0, 1, 2, 3, 4, 5, 6, 7, 8], 2)` should return `[[0, 1], [2, 3], [4, 5], [6, 7], [8]]`. +`chunkArrayInGroups([0, 1, 2, 3, 4, 5, 6, 7, 8], 2)`는 `[[0, 1], [2, 3], [4, 5], [6, 7], [8]]`를 반환해야 합니다. ```js assert.deepEqual(chunkArrayInGroups([0, 1, 2, 3, 4, 5, 6, 7, 8], 2), [ diff --git a/curriculum/challenges/korean/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/factorialize-a-number.md b/curriculum/challenges/korean/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/factorialize-a-number.md index 9121612847..5b689a5c1a 100644 --- a/curriculum/challenges/korean/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/factorialize-a-number.md +++ b/curriculum/challenges/korean/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/factorialize-a-number.md @@ -1,6 +1,6 @@ --- id: a302f7aae1aa3152a5b413bc -title: Factorialize a Number +title: 숫자 계승화(Factorialize) 하기 challengeType: 1 forumTopicId: 16013 dashedName: factorialize-a-number @@ -8,43 +8,43 @@ dashedName: factorialize-a-number # --description-- -Return the factorial of the provided integer. +주어진 정수의 계승을 반환하세요. -If the integer is represented with the letter `n`, a factorial is the product of all positive integers less than or equal to `n`. +정수 `n`이 주어졌을 때, 계승은 `n`보다 작거나 같은 모든 양수의 곱입니다. -Factorials are often represented with the shorthand notation `n!` +계승은 주로 `n!`으로 표기합니다. -For example: `5! = 1 * 2 * 3 * 4 * 5 = 120` +예시: `5! = 1 * 2 * 3 * 4 * 5 = 120` -Only integers greater than or equal to zero will be supplied to the function. +함수에는 오직 0보다 크거나 같은 정수만 제공됩니다. # --hints-- -`factorialize(5)` should return a number. +`factorialize(5)`는 숫자를 반환해야 합니다. ```js assert(typeof factorialize(5) === 'number'); ``` -`factorialize(5)` should return `120`. +`factorialize(5)`는 `120`을 반환해야 합니다. ```js assert(factorialize(5) === 120); ``` -`factorialize(10)` should return `3628800`. +`factorialize(10)`는 `3628800`을 반환해야 합니다. ```js assert(factorialize(10) === 3628800); ``` -`factorialize(20)` should return `2432902008176640000`. +`factorialize(20)`는 `2432902008176640000`을 반환해야 합니다. ```js assert(factorialize(20) === 2432902008176640000); ``` -`factorialize(0)` should return `1`. +`factorialize(0)`는 `1`을 반환해야 합니다. ```js assert(factorialize(0) === 1); diff --git a/curriculum/challenges/korean/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/find-the-longest-word-in-a-string.md b/curriculum/challenges/korean/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/find-the-longest-word-in-a-string.md index cebe978a7b..aa3f1ad368 100644 --- a/curriculum/challenges/korean/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/find-the-longest-word-in-a-string.md +++ b/curriculum/challenges/korean/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/find-the-longest-word-in-a-string.md @@ -1,6 +1,6 @@ --- id: a26cbbe9ad8655a977e1ceb5 -title: Find the Longest Word in a String +title: 문자열에서 가장 긴 단어 찾기 challengeType: 1 forumTopicId: 16015 dashedName: find-the-longest-word-in-a-string @@ -8,13 +8,13 @@ dashedName: find-the-longest-word-in-a-string # --description-- -Return the length of the longest word in the provided sentence. +주어진 문장에서 가장 긴 단어의 길이를 반환하세요. -Your response should be a number. +숫자를 반환해야 합니다. # --hints-- -`findLongestWordLength("The quick brown fox jumped over the lazy dog")` should return a number. +`findLongestWordLength("The quick brown fox jumped over the lazy dog")`는 숫자를 반환해야 합니다. ```js assert( @@ -24,7 +24,7 @@ assert( ); ``` -`findLongestWordLength("The quick brown fox jumped over the lazy dog")` should return `6`. +`findLongestWordLength("The quick brown fox jumped over the lazy dog")`는 `6`을 반환해야 합니다. ```js assert( @@ -32,19 +32,19 @@ assert( ); ``` -`findLongestWordLength("May the force be with you")` should return `5`. +`findLongestWordLength("May the force be with you")`는 `5`를 반환해야 합니다. ```js assert(findLongestWordLength('May the force be with you') === 5); ``` -`findLongestWordLength("Google do a barrel roll")` should return `6`. +`findLongestWordLength("Google do a barrel roll")`는 `6`을 반환해야 합니다. ```js assert(findLongestWordLength('Google do a barrel roll') === 6); ``` -`findLongestWordLength("What is the average airspeed velocity of an unladen swallow")` should return `8`. +`findLongestWordLength("What is the average airspeed velocity of an unladen swallow")`는 `8`을 반환해야 합니다. ```js assert( @@ -54,7 +54,7 @@ assert( ); ``` -`findLongestWordLength("What if we try a super-long word such as otorhinolaryngology")` should return `19`. +`findLongestWordLength("What if we try a super-long word such as otorhinolaryngology")`는 `19`를 반환해야 합니다. ```js assert( diff --git a/curriculum/challenges/korean/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/finders-keepers.md b/curriculum/challenges/korean/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/finders-keepers.md index 171510f165..44624c8b0a 100644 --- a/curriculum/challenges/korean/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/finders-keepers.md +++ b/curriculum/challenges/korean/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/finders-keepers.md @@ -1,6 +1,6 @@ --- id: a6e40f1041b06c996f7b2406 -title: Finders Keepers +title: 파인더 키퍼(Finders Keepers) challengeType: 1 forumTopicId: 16016 dashedName: finders-keepers @@ -8,11 +8,11 @@ dashedName: finders-keepers # --description-- -Create a function that looks through an array `arr` and returns the first element in it that passes a 'truth test'. This means that given an element `x`, the 'truth test' is passed if `func(x)` is `true`. If no element passes the test, return `undefined`. +배열 `arr`에서 '참값 테스트'(truth test)를 통과하는 첫 번째 요소를 반환하는 함수를 작성하세요. '참값 테스트'는 주어진 요소 `x`에 대해, `func(x)`가 `true`면 통과한다는 것을 의미합니다. 어떤 요소도 이 테스트를 통과하지 못한다면 `undefined`를 반환하세요. # --hints-- -`findElement([1, 3, 5, 8, 9, 10], function(num) { return num % 2 === 0; })` should return `8`. +`findElement([1, 3, 5, 8, 9, 10], function(num) { return num % 2 === 0; })`는 `8`을 반환해야 합니다. ```js assert.strictEqual( @@ -23,7 +23,7 @@ assert.strictEqual( ); ``` -`findElement([1, 3, 5, 9], function(num) { return num % 2 === 0; })` should return `undefined`. +`findElement([1, 3, 5, 9], function(num) { return num % 2 === 0; })`는 `undefined`를 반환해야 합니다. ```js assert.strictEqual( diff --git a/curriculum/challenges/korean/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/mutations.md b/curriculum/challenges/korean/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/mutations.md index 0a17138f1c..4090eca0c1 100644 --- a/curriculum/challenges/korean/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/mutations.md +++ b/curriculum/challenges/korean/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/mutations.md @@ -1,6 +1,6 @@ --- id: af2170cad53daa0770fabdea -title: Mutations +title: 변이(Mutations) challengeType: 1 forumTopicId: 16025 dashedName: mutations @@ -8,83 +8,83 @@ dashedName: mutations # --description-- -Return `true` if the string in the first element of the array contains all of the letters of the string in the second element of the array. +배열의 첫 번째 요소에 있는 문자열이 두 번째 요소에 있는 문자열의 모든 글자를 포함하면 `true`를 반환하세요. -For example, `["hello", "Hello"]`, should return `true` because all of the letters in the second string are present in the first, ignoring case. +예를 들어, `["hello", "Hello"]`는 대/소문자 구분을 하지 않는다면 첫 번째 문자열에 두 번째 문자열의 모든 글자가 있으므로 `true`를 반환해야 합니다. -The arguments `["hello", "hey"]` should return `false` because the string `hello` does not contain a `y`. +`["hello", "hey"]`는 `hello`가 `y`를 포함하지 않기 때문에 `false`를 반환해야 합니다. -Lastly, `["Alien", "line"]`, should return `true` because all of the letters in `line` are present in `Alien`. +마지막으로 `["Alien", "line"]`는 `line`의 모든 글자가 `Alien`에 있으므로 `true`를 반환해야 합니다. # --hints-- -`mutation(["hello", "hey"])` should return `false`. +`mutation(["hello", "hey"])`은 `false`를 반환해야 합니다. ```js assert(mutation(['hello', 'hey']) === false); ``` -`mutation(["hello", "Hello"])` should return `true`. +`mutation(["hello", "Hello"])`은 `true`를 반환해야 합니다. ```js assert(mutation(['hello', 'Hello']) === true); ``` -`mutation(["zyxwvutsrqponmlkjihgfedcba", "qrstu"])` should return `true`. +`mutation(["zyxwvutsrqponmlkjihgfedcba", "qrstu"])`은 `true`를 반환해야 합니다. ```js assert(mutation(['zyxwvutsrqponmlkjihgfedcba', 'qrstu']) === true); ``` -`mutation(["Mary", "Army"])` should return `true`. +`mutation(["Mary", "Army"])`은 `true`를 반환해야 합니다. ```js assert(mutation(['Mary', 'Army']) === true); ``` -`mutation(["Mary", "Aarmy"])` should return `true`. +`mutation(["Mary", "Aarmy"])`은 `true`를 반환해야 합니다. ```js assert(mutation(['Mary', 'Aarmy']) === true); ``` -`mutation(["Alien", "line"])` should return `true`. +`mutation(["Alien", "line"])`은 `true`를 반환해야 합니다. ```js assert(mutation(['Alien', 'line']) === true); ``` -`mutation(["floor", "for"])` should return `true`. +`mutation(["floor", "for"])`은 `true`를 반환해야 합니다. ```js assert(mutation(['floor', 'for']) === true); ``` -`mutation(["hello", "neo"])` should return `false`. +`mutation(["hello", "neo"])`은 `false`를 반환해야 합니다. ```js assert(mutation(['hello', 'neo']) === false); ``` -`mutation(["voodoo", "no"])` should return `false`. +`mutation(["voodoo", "no"])`은 `false`를 반환해야 합니다. ```js assert(mutation(['voodoo', 'no']) === false); ``` -`mutation(["ate", "date"])` should return `false`. +`mutation(["ate", "date"])`은 `false`를 반환해야 합니다. ```js assert(mutation(['ate', 'date']) === false); ``` -`mutation(["Tiger", "Zebra"])` should return `false`. +`mutation(["Tiger", "Zebra"])`은 `false`를 반환해야 합니다. ```js assert(mutation(['Tiger', 'Zebra']) === false); ``` -`mutation(["Noel", "Ole"])` should return `true`. +`mutation(["Noel", "Ole"])`은 `true`를 반환해야 합니다. ```js assert(mutation(['Noel', 'Ole']) === true); diff --git a/curriculum/challenges/korean/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/repeat-a-string-repeat-a-string.md b/curriculum/challenges/korean/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/repeat-a-string-repeat-a-string.md index dbae3dde01..6540224ae6 100644 --- a/curriculum/challenges/korean/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/repeat-a-string-repeat-a-string.md +++ b/curriculum/challenges/korean/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/repeat-a-string-repeat-a-string.md @@ -1,6 +1,6 @@ --- id: afcc8d540bea9ea2669306b6 -title: Repeat a String Repeat a String +title: 문자열 반복하기 challengeType: 1 forumTopicId: 16041 dashedName: repeat-a-string-repeat-a-string @@ -8,53 +8,53 @@ dashedName: repeat-a-string-repeat-a-string # --description-- -Repeat a given string `str` (first argument) for `num` times (second argument). Return an empty string if `num` is not a positive number. For the purpose of this challenge, do *not* use the built-in `.repeat()` method. +주어진 문자열 `str`(첫 번째 인자)을 `num`(두 번째 인자) 회 반복하세요. `num`이 양수가 아니면 빈 문자열을 반환하세요. 이 문제의 목적을 위해, 내장 메서드 `.repeat()`를 사용하지 *않습니다*. # --hints-- -`repeatStringNumTimes("*", 3)` should return the string `***`. +`repeatStringNumTimes("*", 3)`는 문자열 `***`을 반환해야 합니다. ```js assert(repeatStringNumTimes('*', 3) === '***'); ``` -`repeatStringNumTimes("abc", 3)` should return the string `abcabcabc`. +`repeatStringNumTimes("abc", 3)`는 문자열 `abcabcabc`를 반환해야 합니다. ```js assert(repeatStringNumTimes('abc', 3) === 'abcabcabc'); ``` -`repeatStringNumTimes("abc", 4)` should return the string `abcabcabcabc`. +`repeatStringNumTimes("abc", 4)`는 문자열 `abcabcabcabc`를 반환해야 합니다. ```js assert(repeatStringNumTimes('abc', 4) === 'abcabcabcabc'); ``` -`repeatStringNumTimes("abc", 1)` should return the string `abc`. +`repeatStringNumTimes("abc", 1)`는 문자열 `abc`를 반환해야 합니다. ```js assert(repeatStringNumTimes('abc', 1) === 'abc'); ``` -`repeatStringNumTimes("*", 8)` should return the string `********`. +`repeatStringNumTimes("*", 8)`는 문자열 `********`을 반환해야 합니다. ```js assert(repeatStringNumTimes('*', 8) === '********'); ``` -`repeatStringNumTimes("abc", -2)` should return an empty string (`""`). +`repeatStringNumTimes("abc", -2)`는 빈 문자열(`""`)을 반환해야 합니다. ```js assert(repeatStringNumTimes('abc', -2) === ''); ``` -The built-in `repeat()` method should not be used. +내장 메서드 `repeat()`는 사용하지 않습니다. ```js assert(!/\.repeat/g.test(__helpers.removeJSComments(code))); ``` -`repeatStringNumTimes("abc", 0)` should return `""`. +`repeatStringNumTimes("abc", 0)`는 `""`를 반환해야 합니다. ```js assert(repeatStringNumTimes('abc', 0) === ''); diff --git a/curriculum/challenges/korean/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/return-largest-numbers-in-arrays.md b/curriculum/challenges/korean/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/return-largest-numbers-in-arrays.md index 7f8b6a84a2..bfbc39c942 100644 --- a/curriculum/challenges/korean/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/return-largest-numbers-in-arrays.md +++ b/curriculum/challenges/korean/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/return-largest-numbers-in-arrays.md @@ -1,6 +1,6 @@ --- id: a789b3483989747d63b0e427 -title: Return Largest Numbers in Arrays +title: 배열들로부터 가장 큰 수들 반환하기 challengeType: 1 forumTopicId: 16042 dashedName: return-largest-numbers-in-arrays @@ -8,13 +8,13 @@ dashedName: return-largest-numbers-in-arrays # --description-- -Return an array consisting of the largest number from each provided sub-array. For simplicity, the provided array will contain exactly 4 sub-arrays. +주어진 각 하위 배열로부터 얻은 가장 큰 수들을 담은 배열을 반환하세요. 간편한 풀이를 위해 주어진 배열은 정확하게 4개의 하위 배열을 가지게 됩니다. -Remember, you can iterate through an array with a simple for loop, and access each member with array syntax `arr[i]`. +간단한 for 루프로 배열의 요소를 하나씩 순회할 수 있고 `arr[i]` 문법을 통해 각 요소에 접근할 수 있다는 점을 기억하세요. # --hints-- -`largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]])` should return an array. +`largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]])`는 배열을 반환해야 합니다. ```js assert( @@ -27,7 +27,7 @@ assert( ); ``` -`largestOfFour([[13, 27, 18, 26], [4, 5, 1, 3], [32, 35, 37, 39], [1000, 1001, 857, 1]])` should return `[27, 5, 39, 1001]`. +`largestOfFour([[13, 27, 18, 26], [4, 5, 1, 3], [32, 35, 37, 39], [1000, 1001, 857, 1]])`는 `[27, 5, 39, 1001]`을 반환해야 합니다. ```js assert.deepEqual( @@ -41,7 +41,7 @@ assert.deepEqual( ); ``` -`largestOfFour([[4, 9, 1, 3], [13, 35, 18, 26], [32, 35, 97, 39], [1000000, 1001, 857, 1]])` should return `[9, 35, 97, 1000000]`. +`largestOfFour([[4, 9, 1, 3], [13, 35, 18, 26], [32, 35, 97, 39], [1000000, 1001, 857, 1]])`는 `[9, 35, 97, 1000000]`을 반환해야 합니다. ```js assert.deepEqual( @@ -55,7 +55,7 @@ assert.deepEqual( ); ``` -`largestOfFour([[17, 23, 25, 12], [25, 7, 34, 48], [4, -10, 18, 21], [-72, -3, -17, -10]])` should return `[25, 48, 21, -3]`. +`largestOfFour([[17, 23, 25, 12], [25, 7, 34, 48], [4, -10, 18, 21], [-72, -3, -17, -10]])`는 `[25, 48, 21, -3]`을 반환해야 합니다. ```js assert.deepEqual( diff --git a/curriculum/challenges/korean/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/reverse-a-string.md b/curriculum/challenges/korean/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/reverse-a-string.md index bca8cb7bd6..30b1b9d682 100644 --- a/curriculum/challenges/korean/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/reverse-a-string.md +++ b/curriculum/challenges/korean/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/reverse-a-string.md @@ -1,6 +1,6 @@ --- id: a202eed8fc186c8434cb6d61 -title: Reverse a String +title: 문자열 뒤집기 challengeType: 1 forumTopicId: 16043 dashedName: reverse-a-string @@ -8,31 +8,31 @@ dashedName: reverse-a-string # --description-- -Reverse the provided string and return the reversed string. +주어진 문자열을 역순으로 나열하고 그 나열된 문자열을 반환하세요. -For example, `"hello"` should become `"olleh"`. +예를 들어, `"hello"`는 `"olleh"`를 반환해야 합니다. # --hints-- -`reverseString("hello")` should return a string. +`reverseString("hello")`은 문자열을 반환해야 합니다. ```js assert(typeof reverseString('hello') === 'string'); ``` -`reverseString("hello")` should return the string `olleh`. +`reverseString("hello")`은 문자열 `olleh`를 반환해야 합니다. ```js assert(reverseString('hello') === 'olleh'); ``` -`reverseString("Howdy")` should return the string `ydwoH`. +`reverseString("Howdy")`은 문자열 `ydwoH`을 반환해야 합니다. ```js assert(reverseString('Howdy') === 'ydwoH'); ``` -`reverseString("Greetings from Earth")` should return the string `htraE morf sgniteerG`. +`reverseString("Greetings from Earth")`은 문자열 `htraE morf sgniteerG`을 반환해야 합니다. ```js assert(reverseString('Greetings from Earth') === 'htraE morf sgniteerG'); diff --git a/curriculum/challenges/korean/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/slice-and-splice.md b/curriculum/challenges/korean/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/slice-and-splice.md index f336149eae..13586f8b5c 100644 --- a/curriculum/challenges/korean/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/slice-and-splice.md +++ b/curriculum/challenges/korean/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/slice-and-splice.md @@ -1,6 +1,6 @@ --- id: 579e2a2c335b9d72dd32e05c -title: Slice and Splice +title: Slice와 Splice challengeType: 1 forumTopicId: 301148 dashedName: slice-and-splice @@ -8,29 +8,29 @@ dashedName: slice-and-splice # --description-- -You are given two arrays and an index. +두 배열과 인덱스가 주어집니다. -Copy each element of the first array into the second array, in order. +첫 번째 배열의 모든 요소를 두 번째 배열에 순서대로 복사합니다. -Begin inserting elements at index `n` of the second array. +두 번째 배열의 인덱스 `n`에 요소를 삽입하기 시작합니다. -Return the resulting array. The input arrays should remain the same after the function runs. +결과 배열을 반환하세요. 입력 배열들은 함수가 실행되고 난 후에도 변함이 없어야 합니다. # --hints-- -`frankenSplice([1, 2, 3], [4, 5], 1)` should return `[4, 1, 2, 3, 5]`. +`frankenSplice([1, 2, 3], [4, 5], 1)`는 `[4, 1, 2, 3, 5]`를 반환해야 합니다. ```js assert.deepEqual(frankenSplice([1, 2, 3], [4, 5], 1), [4, 1, 2, 3, 5]); ``` -`frankenSplice([1, 2], ["a", "b"], 1)` should return `["a", 1, 2, "b"]`. +`frankenSplice([1, 2], ["a", "b"], 1)`는 `["a", 1, 2, "b"]`를 반환해야 합니다. ```js assert.deepEqual(frankenSplice(testArr1, testArr2, 1), ['a', 1, 2, 'b']); ``` -`frankenSplice(["claw", "tentacle"], ["head", "shoulders", "knees", "toes"], 2)` should return `["head", "shoulders", "claw", "tentacle", "knees", "toes"]`. +`frankenSplice(["claw", "tentacle"], ["head", "shoulders", "knees", "toes"], 2)`는 `["head", "shoulders", "claw", "tentacle", "knees", "toes"]`를 반환해야 합니다. ```js assert.deepEqual( @@ -43,20 +43,20 @@ assert.deepEqual( ); ``` -All elements from the first array should be added to the second array in their original order. `frankenSplice([1, 2, 3, 4], [], 0)` should return `[1, 2, 3, 4]`. +첫 번째 배열의 모든 요소는 기존 순서대로 두 번째 배열에 추가되어야 합니다. `frankenSplice([1, 2, 3, 4], [], 0)`는 `[1, 2, 3, 4]`를 반환해야 합니다. ```js assert.deepEqual(frankenSplice([1, 2, 3, 4], [], 0), [1, 2, 3, 4]); ``` -The first array should remain the same after the function runs. +첫 번째 배열은 함수가 실행되고 난 후에도 변함이 없어야 합니다. ```js frankenSplice(testArr1, testArr2, 1); assert.deepEqual(testArr1, [1, 2]); ``` -The second array should remain the same after the function runs. +두 번째 배열은 함수가 실행되고 난 후에도 변함이 없어야 합니다. ```js frankenSplice(testArr1, testArr2, 1); diff --git a/curriculum/challenges/korean/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/truncate-a-string.md b/curriculum/challenges/korean/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/truncate-a-string.md index 855fe03144..dcd96a75e7 100644 --- a/curriculum/challenges/korean/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/truncate-a-string.md +++ b/curriculum/challenges/korean/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/truncate-a-string.md @@ -1,6 +1,6 @@ --- id: ac6993d51946422351508a41 -title: Truncate a String +title: 문자열 자르기 challengeType: 1 forumTopicId: 16089 dashedName: truncate-a-string @@ -8,11 +8,11 @@ dashedName: truncate-a-string # --description-- -Truncate a string (first argument) if it is longer than the given maximum string length (second argument). Return the truncated string with a `...` ending. +주어진 최대 문자열 길이(두 번째 인수)보다 문자열(첫 번째 인수)이 긴 경우 문자열을 자르세요. 잘린 문자열은 끝에 `...`와 함께 반환되어야 합니다. # --hints-- -`truncateString("A-tisket a-tasket A green and yellow basket", 8)` should return the string `A-tisket...`. +`truncateString("A-tisket a-tasket A green and yellow basket", 8)`은 문자열 `A-tisket...`을 반환해야 합니다. ```js assert( @@ -21,7 +21,7 @@ assert( ); ``` -`truncateString("Peter Piper picked a peck of pickled peppers", 11)` should return the string `Peter Piper...`. +`truncateString("Peter Piper picked a peck of pickled peppers", 11)`은 문자열 `Peter Piper...`을 반환해야 합니다. ```js assert( @@ -30,7 +30,7 @@ assert( ); ``` -`truncateString("A-tisket a-tasket A green and yellow basket", "A-tisket a-tasket A green and yellow basket".length)` should return the string `A-tisket a-tasket A green and yellow basket`. +`truncateString("A-tisket a-tasket A green and yellow basket", "A-tisket a-tasket A green and yellow basket".length)`은 문자열 `A-tisket a-tasket A green and yellow basket`을 반환해야 합니다. ```js assert( @@ -41,7 +41,7 @@ assert( ); ``` -`truncateString("A-tisket a-tasket A green and yellow basket", "A-tisket a-tasket A green and yellow basket".length + 2)` should return the string `A-tisket a-tasket A green and yellow basket`. +`truncateString("A-tisket a-tasket A green and yellow basket", "A-tisket a-tasket A green and yellow basket".length + 2)`은 문자열 `A-tisket a-tasket A green and yellow basket`을 반환해야 합니다. ```js assert( @@ -52,13 +52,13 @@ assert( ); ``` -`truncateString("A-", 1)` should return the string `A...`. +`truncateString("A-", 1)`은 문자열 `A...`을 반환해야 합니다. ```js assert(truncateString('A-', 1) === 'A...'); ``` -`truncateString("Absolutely Longer", 2)` should return the string `Ab...`. +`truncateString("Absolutely Longer", 2)`은 문자열 `Ab...`을 반환해야 합니다. ```js assert(truncateString('Absolutely Longer', 2) === 'Ab...'); diff --git a/curriculum/challenges/korean/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/where-do-i-belong.md b/curriculum/challenges/korean/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/where-do-i-belong.md index 9d32433792..5f596c753f 100644 --- a/curriculum/challenges/korean/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/where-do-i-belong.md +++ b/curriculum/challenges/korean/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/where-do-i-belong.md @@ -1,6 +1,6 @@ --- id: a24c1a4622e3c05097f71d67 -title: Where do I Belong +title: 나는 어디에 속할까요 challengeType: 1 forumTopicId: 16094 dashedName: where-do-i-belong @@ -8,105 +8,105 @@ dashedName: where-do-i-belong # --description-- -Return the lowest index at which a value (second argument) should be inserted into an array (first argument) once it has been sorted. The returned value should be a number. +배열 (첫 번째 인수)이 정렬된 후에 값(두 번째 인수)이 삽입되어야 하는 가장 낮은 인덱스를 반환합니다. 반환된 값은 숫자여야 합니다. -For example, `getIndexToIns([1,2,3,4], 1.5)` should return `1` because it is greater than `1` (index 0), but less than `2` (index 1). +예를 들어, `getIndexToIns([1,2,3,4], 1.5)`는 `1`을 반환해야 합니다. 왜냐하면 1.5가 `1`(인덱스 0)보다 크지만 `2`(인덱스 1)보다 작기 때문입니다. -Likewise, `getIndexToIns([20,3,5], 19)` should return `2` because once the array has been sorted it will look like `[3,5,20]` and `19` is less than `20` (index 2) and greater than `5` (index 1). +마찬가지로, `getIndexToIns([20,3,5], 19)`는 `2`를 반환해야 합니다. 배열이 정렬되면 `[3,5,20]`이 되고 `19`는 `20`(인덱스 2)보다 작지만 `5`(인덱스 1)보다 크기 때문입니다. # --hints-- -`getIndexToIns([10, 20, 30, 40, 50], 35)` should return `3`. +`getIndexToIns([10, 20, 30, 40, 50], 35)`는 `3`을 반환해야 합니다. ```js assert(getIndexToIns([10, 20, 30, 40, 50], 35) === 3); ``` -`getIndexToIns([10, 20, 30, 40, 50], 35)` should return a number. +`getIndexToIns([10, 20, 30, 40, 50], 35)`는 숫자를 반환해야 합니다. ```js assert(typeof getIndexToIns([10, 20, 30, 40, 50], 35) === 'number'); ``` -`getIndexToIns([10, 20, 30, 40, 50], 30)` should return `2`. +`getIndexToIns([10, 20, 30, 40, 50], 30)`는 `2`를 반환해야 합니다. ```js assert(getIndexToIns([10, 20, 30, 40, 50], 30) === 2); ``` -`getIndexToIns([10, 20, 30, 40, 50], 30)` should return a number. +`getIndexToIns([10, 20, 30, 40, 50], 30)`는 숫자를 반환해야 합니다. ```js assert(typeof getIndexToIns([10, 20, 30, 40, 50], 30) === 'number'); ``` -`getIndexToIns([40, 60], 50)` should return `1`. +`getIndexToIns([40, 60], 50)`는 `1`을 반환해야 합니다. ```js assert(getIndexToIns([40, 60], 50) === 1); ``` -`getIndexToIns([40, 60], 50)` should return a number. +`getIndexToIns([40, 60], 50)`는 숫자를 반환해야 합니다. ```js assert(typeof getIndexToIns([40, 60], 50) === 'number'); ``` -`getIndexToIns([3, 10, 5], 3)` should return `0`. +`getIndexToIns([3, 10, 5], 3)`는 `0`을 반환해야 합니다. ```js assert(getIndexToIns([3, 10, 5], 3) === 0); ``` -`getIndexToIns([3, 10, 5], 3)` should return a number. +`getIndexToIns([3, 10, 5], 3)`는 숫자를 반환해야 합니다. ```js assert(typeof getIndexToIns([3, 10, 5], 3) === 'number'); ``` -`getIndexToIns([5, 3, 20, 3], 5)` should return `2`. +`getIndexToIns([5, 3, 20, 3], 5)`는 `2`를 반환해야 합니다. ```js assert(getIndexToIns([5, 3, 20, 3], 5) === 2); ``` -`getIndexToIns([5, 3, 20, 3], 5)` should return a number. +`getIndexToIns([5, 3, 20, 3], 5)`는 숫자를 반환해야 합니다. ```js assert(typeof getIndexToIns([5, 3, 20, 3], 5) === 'number'); ``` -`getIndexToIns([2, 20, 10], 19)` should return `2`. +`getIndexToIns([2, 20, 10], 19)`는 `2`를 반환해야 합니다. ```js assert(getIndexToIns([2, 20, 10], 19) === 2); ``` -`getIndexToIns([2, 20, 10], 19)` should return a number. +`getIndexToIns([2, 20, 10], 19)`는 숫자를 반환해야 합니다. ```js assert(typeof getIndexToIns([2, 20, 10], 19) === 'number'); ``` -`getIndexToIns([2, 5, 10], 15)` should return `3`. +`getIndexToIns([2, 5, 10], 15)`는 `3`을 반환해야 합니다. ```js assert(getIndexToIns([2, 5, 10], 15) === 3); ``` -`getIndexToIns([2, 5, 10], 15)` should return a number. +`getIndexToIns([2, 5, 10], 15)`는 숫자를 반환해야 합니다. ```js assert(typeof getIndexToIns([2, 5, 10], 15) === 'number'); ``` -`getIndexToIns([], 1)` should return `0`. +`getIndexToIns([], 1)`는 `0`을 반환해야 합니다. ```js assert(getIndexToIns([], 1) === 0); ``` -`getIndexToIns([], 1)` should return a number. +`getIndexToIns([], 1)`는 숫자를 반환해야 합니다. ```js assert(typeof getIndexToIns([], 1) === 'number'); diff --git a/curriculum/challenges/korean/13-relational-databases/build-a-periodic-table-database-project/build-a-periodic-table-database.md b/curriculum/challenges/korean/13-relational-databases/build-a-periodic-table-database-project/build-a-periodic-table-database.md index db5b0c61e0..5608918f2f 100644 --- a/curriculum/challenges/korean/13-relational-databases/build-a-periodic-table-database-project/build-a-periodic-table-database.md +++ b/curriculum/challenges/korean/13-relational-databases/build-a-periodic-table-database-project/build-a-periodic-table-database.md @@ -8,7 +8,7 @@ dashedName: build-a-periodic-table-database # --description-- -This is one of the required projects to earn your certification. For this project, you will create Bash a script to get information about chemical elements from a periodic table database. +This is one of the required projects to earn your certification. For this project, you will create a Bash script to get information about chemical elements from a periodic table database. # --instructions-- diff --git a/curriculum/challenges/korean/14-responsive-web-design-22/learn-basic-css-by-building-a-cafe-menu/5f3ef6e0a81099d9a697b550.md b/curriculum/challenges/korean/14-responsive-web-design-22/learn-basic-css-by-building-a-cafe-menu/5f3ef6e0a81099d9a697b550.md index 7d83aef878..2227b3b670 100644 --- a/curriculum/challenges/korean/14-responsive-web-design-22/learn-basic-css-by-building-a-cafe-menu/5f3ef6e0a81099d9a697b550.md +++ b/curriculum/challenges/korean/14-responsive-web-design-22/learn-basic-css-by-building-a-cafe-menu/5f3ef6e0a81099d9a697b550.md @@ -9,6 +9,8 @@ dashedName: step-64 Inside the `footer`, add a `p` element. Then, nest an anchor (`a`) element in the `p` that links to `https://www.freecodecamp.org` and has the text `Visit our website`. +Make sure that the link opens in a new tab by adding a `target` attribute with the value `_blank`. + # --hints-- You should not modify the existing `footer` element. @@ -43,6 +45,12 @@ Your new `a` element should link to `https://www.freecodecamp.org`. Remember tha assert(document.querySelector("footer > p > a")?.href === "https://www.freecodecamp.org/"); ``` +Your new `a` element should have the `target` attribute set to `_blank`. + +```js +assert.equal(document.querySelector("footer > p > a")?.target, "_blank"); +``` + # --seed-- ## --seed-contents-- diff --git a/curriculum/challenges/korean/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-j.md b/curriculum/challenges/korean/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-j.md index d2ad72a1ea..1b6ca05444 100644 --- a/curriculum/challenges/korean/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-j.md +++ b/curriculum/challenges/korean/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-j.md @@ -21,12 +21,12 @@ Remove `flex: 1` from `.item` and add `justify-content: space-between` to `.cont `justify-content` aligns items across the **main axis**. There are a few values that you can use here. You'll learn the rest of them in the reading assignments, but for now try changing it to center, which should center the boxes along the main axis. -# --question-- - -## --assignment-- +# --assignment-- Before moving on to the next lesson, see what is possible with the `justify-content` property. Read this [interactive article on MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/justify-content) and play around with the different values of `justify-content` on the example. +# --question-- + ## --text-- How does applying `justify-content: space-between` to a flex container affect the positioning of its items? diff --git a/curriculum/challenges/korean/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-k.md b/curriculum/challenges/korean/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-k.md index d3137b0af5..59acb55a29 100644 --- a/curriculum/challenges/korean/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-k.md +++ b/curriculum/challenges/korean/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-k.md @@ -17,12 +17,12 @@ To change the placement of items along the cross axis use `align-items`. Try get Because `justify-content` and `align-items` are based on the main and cross axis of your container, their behavior changes when you change the flex-direction of a flex-container. For example, when you change `flex-direction` to `column`, `justify-content` aligns vertically and `align-items` aligns horizontally. The most common behavior, however, is the default, i.e. `justify-content` aligns items horizontally (because the main axis defaults to horizontal), and `align-items` aligns them vertically. One of the biggest sticking points that beginners have with flexbox is confusion when this behavior changes. -# --question-- - -## --assignment-- +# --assignment-- Before moving on to the next lesson, see if you can figure out how `align-items` behaves when you change the `flex-direction` property to `column`. +# --question-- + ## --text-- When changing the `flex-direction` property to `column` in a flex container, how does `align-items` behave in relation to the flex items? diff --git a/curriculum/challenges/korean/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-b.md b/curriculum/challenges/korean/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-b.md index 1adf9ce84f..49edeac0e4 100644 --- a/curriculum/challenges/korean/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-b.md +++ b/curriculum/challenges/korean/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-b.md @@ -9,12 +9,12 @@ dashedName: learn-block-and-inline-lesson-b Inline elements, however, do not start on a new line. They appear in line with whatever elements they are placed beside. A clear example of an inline element is a link, or `` tag. If you stick one of these in the middle of a paragraph of text, it will behave like a part of the paragraph. (Like this) The link’s text will sit alongside other words in that paragraph. Additionally, padding and margin behave differently on inline elements. In general, you do not want to try to put extra padding or margin on inline elements. -# --question-- - -## --assignment-- +# --assignment-- Search the web for a list of `block` elements and a list of `inline` elements. +# --question-- + ## --text-- What is the difference between a `block` element and an `inline` element? diff --git a/curriculum/challenges/korean/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-g.md b/curriculum/challenges/korean/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-g.md index cdd4d5aa87..e75492e9c1 100644 --- a/curriculum/challenges/korean/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-g.md +++ b/curriculum/challenges/korean/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-g.md @@ -7,7 +7,7 @@ dashedName: learn-block-and-inline-lesson-g # --description-- -Now that you have some basic understanding of `block` and inline `elements`, pull up your list of `block` and `inline` elements from a couple questions ago and see if you can identify which of the following elements are `block` elements and which are `inline` elements. +Now that you have some basic understanding of `block` and `inline` elements, pull up your list of `block` and `inline` elements from a couple questions ago and see if you can identify which of the following elements are `block` elements and which are `inline` elements. # --question-- diff --git a/curriculum/challenges/korean/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-a.md b/curriculum/challenges/korean/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-a.md index 995073b8a2..a7a2ee9a51 100644 --- a/curriculum/challenges/korean/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-a.md +++ b/curriculum/challenges/korean/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-a.md @@ -21,12 +21,12 @@ New programmers often find problem solving the hardest skill to build. It's not The best way to improve your problem solving ability is by building experience by making lots and lots of programs. The more practice you have the better you'll be prepared to solve real world problems. -# --question-- - -## --assignment-- +# --assignment-- Read How to Think Like a Programmer - Lessons in Problem Solving by Richard Reis. +# --question-- + ## --text-- According to V. Anton Spraul in "Think Like a Programmer," what is problem solving in programming? diff --git a/curriculum/challenges/korean/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-b.md b/curriculum/challenges/korean/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-b.md index ae905ecf89..c57a7d43e8 100644 --- a/curriculum/challenges/korean/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-b.md +++ b/curriculum/challenges/korean/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-b.md @@ -25,11 +25,11 @@ Now that you know what you’re aiming to solve, don’t jump into coding just y The last question is where you will write out an algorithm to solve the problem. You can think of an algorithm as a recipe for solving a particular problem. It defines the steps that need to be taken by the computer to solve a problem in pseudocode. -# --question-- - -## --assignment-- +# --assignment-- Watch How to Begin Thinking Like a Programmer by Coding Tech. It’s an hour long but packed full of information and definitely worth your time watching. +# --question-- + ## --text-- What should you do before starting to code according to the provided text? diff --git a/curriculum/challenges/korean/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-c.md b/curriculum/challenges/korean/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-c.md index c837fd9658..082f2d51ae 100644 --- a/curriculum/challenges/korean/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-c.md +++ b/curriculum/challenges/korean/16-the-odin-project/top-learn-to-solve-problems-and-understand-errors/learn-to-solve-problems-and-understand-errors-lesson-c.md @@ -22,12 +22,12 @@ Print the value of the counter variable This is a basic program to demonstrate how pseudocode looks. There will be more examples of pseudocode included in the assignments. +# --assignment-- -# --question-- - -## --assignment-- Read this Pseudocode: What It Is and How to Write It article from Built In. +# --question-- + ## --text-- What are the benefits of using pseudocode according to the linked article? diff --git a/curriculum/challenges/korean/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657b69e10d6606a0185d4d4f.md b/curriculum/challenges/korean/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657b69e10d6606a0185d4d4f.md index 3ba0e41199..cfc7c8de5b 100644 --- a/curriculum/challenges/korean/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657b69e10d6606a0185d4d4f.md +++ b/curriculum/challenges/korean/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657b69e10d6606a0185d4d4f.md @@ -9,7 +9,7 @@ dashedName: task-23 # --description-- -So far you have learned how to create questions with the verb to be. In sentences with the verb `to be` (am, is, are) you just have to change the order of the noun and the verb to create a question. Like this: +So far you have learned how to create questions with the verb `to be`. In sentences with the verb `to be` (am, is, are) you just have to change the order of the noun and the verb to create a question. Like this: `You are a developer` -> `Are you a developer?` diff --git a/curriculum/challenges/korean/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657dce8ff35869721311a5e3.md b/curriculum/challenges/korean/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657dce8ff35869721311a5e3.md index 544d8f1988..8cd311a518 100644 --- a/curriculum/challenges/korean/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657dce8ff35869721311a5e3.md +++ b/curriculum/challenges/korean/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657dce8ff35869721311a5e3.md @@ -21,7 +21,7 @@ Which sentence is correct for describing one place near you? ### --feedback-- -`There are` is used for plural nouns, and `bank` is singular. You’ll learn about there are in the next few lessons. +`There are` is used for plural nouns, and `bank` is singular. You’ll learn about `there are` in the next few lessons. --- diff --git a/curriculum/challenges/korean/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657dcee413423174ca3747f5.md b/curriculum/challenges/korean/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657dcee413423174ca3747f5.md index 6526b1e95b..10c0845779 100644 --- a/curriculum/challenges/korean/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657dcee413423174ca3747f5.md +++ b/curriculum/challenges/korean/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657dcee413423174ca3747f5.md @@ -7,7 +7,7 @@ dashedName: task-112 # --description-- -To elaborate a question using `there is` you just need to change the order of the verb to be, like so: +To elaborate a question using `there is` you just need to change the order of the verb `to be`, like so: `There is an ATM nearby` -> `Is there an ATM nearby?` diff --git a/curriculum/challenges/korean/25-front-end-development/lab-celestial-bodies-database/5f1a4ef5d5d6b5ab580fc6ae.md b/curriculum/challenges/korean/25-front-end-development/lab-celestial-bodies-database/5f1a4ef5d5d6b5ab580fc6ae.md new file mode 100644 index 0000000000..7d664a8876 --- /dev/null +++ b/curriculum/challenges/korean/25-front-end-development/lab-celestial-bodies-database/5f1a4ef5d5d6b5ab580fc6ae.md @@ -0,0 +1,25 @@ +--- +id: 5f1a4ef5d5d6b5ab580fc6ae +title: Build a Celestial Bodies Database +challengeType: 13 +url: freeCodeCamp/learn-celestial-bodies-database +dashedName: lab-celestial-bodies-database +--- + +# --description-- + +For this project, you will build a database of celestial bodies using PostgreSQL. + +# --instructions-- + +**Important:** After you pass all the project tests, save a dump of your database into a `universe.sql` file so you can complete step 2. There will be instructions how to do that within the virtual machine. + +# --notes-- + +Required files: `universe.sql` + +# --hints-- + +# --seed-- + +# --solutions-- diff --git a/curriculum/challenges/korean/25-front-end-development/lab-exercise-tracker/5a8b073d06fa14fcfde687aa.md b/curriculum/challenges/korean/25-front-end-development/lab-exercise-tracker/5a8b073d06fa14fcfde687aa.md new file mode 100644 index 0000000000..9492b82cb4 --- /dev/null +++ b/curriculum/challenges/korean/25-front-end-development/lab-exercise-tracker/5a8b073d06fa14fcfde687aa.md @@ -0,0 +1,611 @@ +--- +id: 5a8b073d06fa14fcfde687aa +title: Build an Exercise Tracker +challengeType: 4 +dashedName: build-an-exercise-tracker +--- + +# --description-- + +Build a full stack JavaScript app that is functionally similar to this: https://exercise-tracker.freecodecamp.rocks. Working on this project will involve you writing your code using one of the following methods: + +- Clone this GitHub repo and complete your project locally. +- Use our Gitpod starter project to complete your project. +- Use a site builder of your choice to complete the project. Be sure to incorporate all the files from our GitHub repo. + +# --instructions-- + +Your responses should have the following structures. + +Exercise: + +```js +{ + username: "fcc_test", + description: "test", + duration: 60, + date: "Mon Jan 01 1990", + _id: "5fb5853f734231456ccb3b05" +} +``` + +User: + +```js +{ + username: "fcc_test", + _id: "5fb5853f734231456ccb3b05" +} +``` + +Log: + +```js +{ + username: "fcc_test", + count: 1, + _id: "5fb5853f734231456ccb3b05", + log: [{ + description: "test", + duration: 60, + date: "Mon Jan 01 1990", + }] +} +``` + +**Hint:** For the `date` property, the `toDateString` method of the `Date` API can be used to achieve the expected output. + +# --hints-- + +You should provide your own project, not the example URL. + +```js +(getUserInput) => { + const url = getUserInput('url'); + assert( + !/.*\/exercise-tracker\.freecodecamp\.rocks/.test(getUserInput('url')) + ); +}; +``` + +You can `POST` to `/api/users` with form data `username` to create a new user. + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `username=fcc_test_${Date.now()}`.substring(0, 29) + }); + assert.isTrue(res.ok); + if(!res.ok) { + throw new Error(`${res.status} ${res.statusText}`) + }; +}; +``` + +The returned response from `POST /api/users` with form data `username` will be an object with `username` and `_id` properties. + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `username=fcc_test_${Date.now()}`.substring(0, 29) + }); + if (res.ok) { + const { _id, username } = await res.json(); + assert.exists(_id); + assert.exists(username); + } else { + throw new Error(`${res.status} ${res.statusText}`); + } +}; +``` + +You can make a `GET` request to `/api/users` to get a list of all users. + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users'); + assert.isTrue(res.ok); + if(!res.ok) { + throw new Error(`${res.status} ${res.statusText}`) + }; +}; +``` + +The `GET` request to `/api/users` returns an array. + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users'); + if(res.ok){ + const users = await res.json(); + assert.isArray(users); + } else { + throw new Error(`${res.status} ${res.statusText}`); + }; +}; +``` + +Each element in the array returned from `GET /api/users` is an object literal containing a user's `username` and `_id`. + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users'); + if(res.ok){ + const users = await res.json(); + const user = users[0]; + assert.exists(user); + assert.exists(user.username); + assert.exists(user._id); + assert.isString(user.username); + assert.isString(user._id); + } else { + throw new Error(`${res.status} ${res.statusText}`); + }; +}; +``` + +You can `POST` to `/api/users/:_id/exercises` with form data `description`, `duration`, and optionally `date`. If no date is supplied, the current date will be used. + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `username=fcc_test_${Date.now()}`.substring(0, 29) + }); + if (res.ok) { + const { _id, username } = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: 'Mon Jan 01 1990' + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `description=${expected.description}&duration=${expected.duration}&date=1990-01-01` + }); + assert.isTrue(addRes.ok); + if(!addRes.ok) { + throw new Error(`${addRes.status} ${addRes.statusText}`) + }; + } else { + throw new Error(`${res.status} ${res.statusText}`); + } +}; +``` + +The response returned from `POST /api/users/:_id/exercises` will be the user object with the exercise fields added. + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `username=fcc_test_${Date.now()}`.substring(0, 29) + }); + if (res.ok) { + const { _id, username } = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: 'Mon Jan 01 1990' + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `description=${expected.description}&duration=${expected.duration}&date=1990-01-01` + }); + if (addRes.ok) { + const actual = await addRes.json(); + assert.deepEqual(actual, expected); + assert.isString(actual.description); + assert.isNumber(actual.duration); + assert.isString(actual.date); + } else { + throw new Error(`${addRes.status} ${addRes.statusText}`); + } + } else { + throw new Error(`${res.status} ${res.statusText}`); + } +}; +``` + +You can make a `GET` request to `/api/users/:_id/logs` to retrieve a full exercise log of any user. + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `username=fcc_test_${Date.now()}`.substring(0, 29) + }); + if (res.ok) { + const { _id, username } = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: new Date().toDateString() + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `description=${expected.description}&duration=${expected.duration}` + }); + if (addRes.ok) { + const logRes = await fetch(url + `/api/users/${_id}/logs`); + assert.isTrue(logRes.ok); + if(!logRes.ok) { + throw new Error(`${logRes.status} ${logRes.statusText}`) + }; + } else { + throw new Error(`${addRes.status} ${addRes.statusText}`); + } + } else { + throw new Error(`${res.status} ${res.statusText}`); + } +}; +``` + +A request to a user's log `GET /api/users/:_id/logs` returns a user object with a `count` property representing the number of exercises that belong to that user. + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `username=fcc_test_${Date.now()}`.substring(0, 29) + }); + if (res.ok) { + const { _id, username } = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: new Date().toDateString() + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `description=${expected.description}&duration=${expected.duration}` + }); + if (addRes.ok) { + const logRes = await fetch(url + `/api/users/${_id}/logs`); + if (logRes.ok) { + const { count } = await logRes.json(); + assert(count); + } else { + throw new Error(`${logRes.status} ${logRes.statusText}`); + } + } else { + throw new Error(`${addRes.status} ${addRes.statusText}`); + } + } else { + throw new Error(`${res.status} ${res.statusText}`); + } +}; +``` + +A `GET` request to `/api/users/:_id/logs` will return the user object with a `log` array of all the exercises added. + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded' + }, + body: `username=fcc_test_${Date.now()}`.substring(0, 29) + }) + if(res.ok){ + const {_id, username} = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: new Date().toDateString() + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `description=${expected.description}&duration=${expected.duration}` + }); + if(addRes.ok){ + const logRes = await fetch(url + `/api/users/${_id}/logs`); + if(logRes.ok) { + const {log} = await logRes.json(); + assert.isArray(log); + assert.equal(1, log.length); + } else { + throw new Error(`${logRes.status} ${logRes.statusText}`); + } + } else { + throw new Error(`${addRes.status} ${addRes.statusText}`); + }; + } else { + throw new Error(`${res.status} ${res.statusText}`) + }; +}; +``` + +Each item in the `log` array that is returned from `GET /api/users/:_id/logs` is an object that should have a `description`, `duration`, and `date` properties. + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + `/api/users`, { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded' + }, + body: `username=fcc_test_${Date.now()}`.substring(0, 29) + }); + if(res.ok) { + const {_id, username} = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: new Date().toDateString() + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `description=${expected.description}&duration=${expected.duration}` + }); + if(addRes.ok) { + const logRes = await fetch(url + `/api/users/${_id}/logs`); + if(logRes.ok) { + const {log} = await logRes.json(); + const exercise = log[0]; + assert.exists(exercise); + assert.exists(exercise.description); + assert.exists(exercise.duration); + assert.exists(exercise.date); + } else { + throw new Error(`${logRes.status} ${logRes.statusText}`); + }; + } else { + throw new Error(`${addRes.status} ${addRes.statusText}`); + }; + } else { + throw new Error(`${res.status} ${res.statusText}`) + }; +}; +``` + +The `description` property of any object in the `log` array that is returned from `GET /api/users/:_id/logs` should be a string. + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + body: `username=fcc_test_${Date.now()}`.substring(0,29) + }); + if(res.ok) { + const {_id, username} = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: new Date().toDateString() + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + body: `description=${expected.description}&duration=${expected.duration}` + }); + if(addRes.ok) { + const logRes = await fetch(url + `/api/users/${_id}/logs`); + if(logRes.ok){ + const {log} = await logRes.json(); + const exercise = log[0]; + assert.isString(exercise.description); + assert.equal(exercise.description, expected.description); + } else { + throw new Error(`${logRes.status} ${logRes.statusText}`); + } + } else { + throw new Error(`${addRes.status} ${addRes.statusText}`); + }; + } else { + throw new Error(`${res.status} ${res.statusText}`); + }; +}; +``` + +The `duration` property of any object in the `log` array that is returned from `GET /api/users/:_id/logs` should be a number. + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + body: `username=fcc_test_${Date.now()}`.substring(0,29) + }); + if(res.ok) { + const {_id, username} = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: new Date().toDateString() + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + body: `description=${expected.description}&duration=${expected.duration}` + }); + if(addRes.ok) { + const logRes = await fetch(url + `/api/users/${_id}/logs`); + if(logRes.ok){ + const {log} = await logRes.json(); + const exercise = log[0]; + assert.isNumber(exercise.duration); + assert.equal(exercise.duration, expected.duration); + } else { + throw new Error(`${logRes.status} ${logRes.statusText}`); + } + } else { + throw new Error(`${addRes.status} ${addRes.statusText}`); + }; + } else { + throw new Error(`${res.status} ${res.statusText}`); + }; +}; +``` + +The `date` property of any object in the `log` array that is returned from `GET /api/users/:_id/logs` should be a string. Use the `dateString` format of the `Date` API. + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + body: `username=fcc_test_${Date.now()}`.substring(0,29) + }); + if(res.ok) { + const {_id, username} = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: new Date().toLocaleDateString("en-US", { + timeZone: "UTC", weekday: "short", month: "short", + day: "2-digit", year: "numeric" + }).replaceAll(',', '') + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + body: `description=${expected.description}&duration=${expected.duration}` + }); + if(addRes.ok) { + const logRes = await fetch(url + `/api/users/${_id}/logs`); + if(logRes.ok){ + const {log} = await logRes.json(); + const exercise = log[0]; + assert.isString(exercise.date); + assert.equal(exercise.date, expected.date); + } else { + throw new Error(`${logRes.status} ${logRes.statusText}`); + } + } else { + throw new Error(`${addRes.status} ${addRes.statusText}`); + }; + } else { + throw new Error(`${res.status} ${res.statusText}`); + }; +}; +``` + +You can add `from`, `to` and `limit` parameters to a `GET /api/users/:_id/logs` request to retrieve part of the log of any user. `from` and `to` are dates in `yyyy-mm-dd` format. `limit` is an integer of how many logs to send back. + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `username=fcc_test_${Date.now()}`.substring(0, 29) + }); + if (res.ok) { + const { _id, username } = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: new Date().toDateString() + }; + const addExerciseRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `description=${expected.description}&duration=${expected.duration}&date=1990-01-01` + }); + const addExerciseTwoRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `description=${expected.description}&duration=${expected.duration}&date=1990-01-03` + }); + if (addExerciseRes.ok && addExerciseTwoRes.ok) { + const logRes = await fetch( + url + `/api/users/${_id}/logs?from=1989-12-31&to=1990-01-04` + ); + if (logRes.ok) { + const { log } = await logRes.json(); + assert.isArray(log); + assert.equal(2, log.length); + } else { + throw new Error(`${logRes.status} ${logRes.statusText}`); + } + const limitRes = await fetch( + url + `/api/users/${_id}/logs?limit=1` + ); + if (limitRes.ok) { + const { log } = await limitRes.json(); + assert.isArray(log); + assert.equal(1, log.length); + } else { + throw new Error(`${limitRes.status} ${limitRes.statusText}`); + } + const filterDateBeforeLimitRes = await fetch( + url + `/api/users/${_id}/logs?from=1990-01-02&to=1990-01-04&limit=1` + ); + if (filterDateBeforeLimitRes.ok) { + const { log } = await filterDateBeforeLimitRes.json(); + assert.isArray(log); + assert.equal(1, log.length); + } else { + throw new Error(`${filterDateBeforeLimitRes.status} ${filterDateBeforeLimitRes.statusText}`); + } + } else { + throw new Error(`${res.status} ${res.statusText}`); + } + } else { + throw new Error(`${res.status} ${res.statusText}`); + } +}; +``` diff --git a/curriculum/challenges/korean/25-front-end-development/lab-number-guessing-game/602da04c22201c65d2a019f4.md b/curriculum/challenges/korean/25-front-end-development/lab-number-guessing-game/602da04c22201c65d2a019f4.md new file mode 100644 index 0000000000..ef87dc6720 --- /dev/null +++ b/curriculum/challenges/korean/25-front-end-development/lab-number-guessing-game/602da04c22201c65d2a019f4.md @@ -0,0 +1,25 @@ +--- +id: 602da04c22201c65d2a019f4 +title: Build a Number Guessing Game +challengeType: 13 +url: freeCodeCamp/learn-number-guessing-game +dashedName: lab-number-guessing-game +--- + +# --description-- + +For this lab, you will use Bash scripting, PostgreSQL, and Git to create a number guessing game that runs in the terminal and saves user information. + +# --instructions-- + +**Important:** After you pass all the project tests, save a dump of your database into a `number_guess.sql` file, as well as your `number_guess.sh` file, so you can complete step 2. There will be instructions on how to do that within the virtual machine. + +# --notes-- + +Required files: `number_guess.sql`, `number_guess.sh` + +# --hints-- + +# --seed-- + +# --solutions-- diff --git a/curriculum/challenges/korean/25-front-end-development/lab-request-header-parser-microservice/bd7158d8c443edefaeb5bdff.md b/curriculum/challenges/korean/25-front-end-development/lab-request-header-parser-microservice/bd7158d8c443edefaeb5bdff.md new file mode 100644 index 0000000000..5040e27424 --- /dev/null +++ b/curriculum/challenges/korean/25-front-end-development/lab-request-header-parser-microservice/bd7158d8c443edefaeb5bdff.md @@ -0,0 +1,65 @@ +--- +id: bd7158d8c443edefaeb5bdff +title: Build a Request Header Parser Microservice +challengeType: 4 +dashedName: lab-request-header-parser-microservice +--- + +# --description-- + +Build a full stack JavaScript app that is functionally similar to this: https://request-header-parser-microservice.freecodecamp.rocks/. Working on this project will involve you writing your code using one of the following methods: + +- Clone this GitHub repo and complete your project locally. +- Use our Gitpod starter project to complete your project. +- Use a site builder of your choice to complete the project. Be sure to incorporate all the files from our GitHub repo. + +# --hints-- + +You should provide your own project, not the example URL. + +```js +(getUserInput) => { + assert( + !/.*\/request-header-parser-microservice\.freecodecamp\.rocks/.test( + getUserInput('url') + ) + ); +}; +``` + +A request to `/api/whoami` should return a JSON object with your IP address in the `ipaddress` key. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/api/whoami').then( + (data) => assert(data.ipaddress && data.ipaddress.length > 0), + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + +A request to `/api/whoami` should return a JSON object with your preferred language in the `language` key. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/api/whoami').then( + (data) => assert(data.language && data.language.length > 0), + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + +A request to `/api/whoami` should return a JSON object with your software in the `software` key. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/api/whoami').then( + (data) => assert(data.software && data.software.length > 0), + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/korean/25-front-end-development/lab-url-shortener-microservice/bd7158d8c443edefaeb5bd0e.md b/curriculum/challenges/korean/25-front-end-development/lab-url-shortener-microservice/bd7158d8c443edefaeb5bd0e.md new file mode 100644 index 0000000000..0fbf80a0bf --- /dev/null +++ b/curriculum/challenges/korean/25-front-end-development/lab-url-shortener-microservice/bd7158d8c443edefaeb5bd0e.md @@ -0,0 +1,107 @@ +--- +id: bd7158d8c443edefaeb5bd0e +title: URL Shortener Microservice +challengeType: 4 +dashedName: url-shortener-microservice +--- + +# --description-- + +Build a full stack JavaScript app that is functionally similar to this: https://url-shortener-microservice.freecodecamp.rocks. Working on this project will involve you writing your code using one of the following methods: + +- Clone this GitHub repo and complete your project locally. +- Use our Gitpod starter project to complete your project. +- Use a site builder of your choice to complete the project. Be sure to incorporate all the files from our GitHub repo. + +# --instructions-- + +**HINT:** Do not forget to use a body parsing middleware to handle the POST requests. Also, you can use the function `dns.lookup(host, cb)` from the `dns` core module to verify a submitted URL. + +# --hints-- + +You should provide your own project, not the example URL. + +```js +(getUserInput) => { + assert( + !/.*\/url-shortener-microservice\.freecodecamp\.rocks/.test( + getUserInput('url') + ) + ); +}; +``` + +You can POST a URL to `/api/shorturl` and get a JSON response with `original_url` and `short_url` properties. Here's an example: `{ original_url : 'https://freeCodeCamp.org', short_url : 1}` + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const urlVariable = Date.now(); + const fullUrl = `${url}/?v=${urlVariable}` + const res = await fetch(url + '/api/shorturl', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `url=${fullUrl}` + }); + if (res.ok) { + const { short_url, original_url } = await res.json(); + assert.isNotNull(short_url); + assert.strictEqual(original_url, `${url}/?v=${urlVariable}`); + } else { + throw new Error(`${res.status} ${res.statusText}`); + } +}; +``` + +When you visit `/api/shorturl/`, you will be redirected to the original URL. + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const urlVariable = Date.now(); + const fullUrl = `${url}/?v=${urlVariable}` + let shortenedUrlVariable; + const postResponse = await fetch(url + '/api/shorturl', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `url=${fullUrl}` + }); + if (postResponse.ok) { + const { short_url } = await postResponse.json(); + shortenedUrlVariable = short_url; + } else { + throw new Error(`${postResponse.status} ${postResponse.statusText}`); + } + const getResponse = await fetch( + url + '/api/shorturl/' + shortenedUrlVariable + ); + if (getResponse) { + const { redirected, url } = getResponse; + assert.isTrue(redirected); + assert.strictEqual(url,fullUrl); + } else { + throw new Error(`${getResponse.status} ${getResponse.statusText}`); + } +}; +``` + +If you pass an invalid URL that doesn't follow the valid `http://www.example.com` format, the JSON response will contain `{ error: 'invalid url' }` + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/shorturl', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `url=ftp:/john-doe.invalidTLD` + }); + if (res.ok) { + const { error } = await res.json(); + assert.isNotNull(error); + assert.strictEqual(error.toLowerCase(), 'invalid url'); + } else { + throw new Error(`${res.status} ${res.statusText}`); + } +}; +``` + diff --git a/curriculum/challenges/korean/25-front-end-development/lab-world-cup-database/5f9771307d4d22b9d2b75a94.md b/curriculum/challenges/korean/25-front-end-development/lab-world-cup-database/5f9771307d4d22b9d2b75a94.md new file mode 100644 index 0000000000..d77442a1ba --- /dev/null +++ b/curriculum/challenges/korean/25-front-end-development/lab-world-cup-database/5f9771307d4d22b9d2b75a94.md @@ -0,0 +1,25 @@ +--- +id: 5f9771307d4d22b9d2b75a94 +title: Build a World Cup Database +challengeType: 13 +url: freeCodeCamp/learn-world-cup-database +dashedName: lab-world-cup-database +--- + +# --description-- + +For this project, you will create a Bash script that enters information from World Cup games into PostgreSQL, then query the database for useful statistics. + +# --instructions-- + +**Important:** After you pass all the project tests, save a dump of your database into a `worldcup.sql` file, as well as your `insert_data.sh` and `queries.sh` files, so you can complete step 2. There will be instructions how to do that within the virtual machine. + +# --notes-- + +Required files: `worldcup.sql`, `insert_data.sh`, `queries.sh` + +# --hints-- + +# --seed-- + +# --solutions-- diff --git a/curriculum/challenges/korean/25-front-end-development/workshop-hotel-feedback-form/66a96127422411756204bc1b.md b/curriculum/challenges/korean/25-front-end-development/workshop-hotel-feedback-form/66a96127422411756204bc1b.md index 51ea9e3069..753ee1a6bb 100644 --- a/curriculum/challenges/korean/25-front-end-development/workshop-hotel-feedback-form/66a96127422411756204bc1b.md +++ b/curriculum/challenges/korean/25-front-end-development/workshop-hotel-feedback-form/66a96127422411756204bc1b.md @@ -7,9 +7,9 @@ dashedName: step-22 # --description-- -Add another label with the text of `Personal Recommendation`. The `for` attribute should be set to `"recommendation"`. +Add another `label` with the text of `Personal Recommendation`. The `for` attribute should be set to `"recommendation"`. -Below the label element, add another checkbox input with the `id`, `name` and `value` attributes set to `"recommendation"`. +Below the `label` element, add another checkbox `input` with the `id`, `name` and `value` attributes set to `"recommendation"`. # --hints-- diff --git a/curriculum/challenges/korean/25-front-end-development/workshop-hotel-feedback-form/66a962954f4e0d76223b37ed.md b/curriculum/challenges/korean/25-front-end-development/workshop-hotel-feedback-form/66a962954f4e0d76223b37ed.md index 42c425209d..80a23ca86d 100644 --- a/curriculum/challenges/korean/25-front-end-development/workshop-hotel-feedback-form/66a962954f4e0d76223b37ed.md +++ b/curriculum/challenges/korean/25-front-end-development/workshop-hotel-feedback-form/66a962954f4e0d76223b37ed.md @@ -11,7 +11,7 @@ Next, add another `label` element with the text of `Location` and the `for` attr For the checkbox `input`, both the `id`, `name` and `value` attributes should be set to `"location"`. -Below that `input` element, add another `label` element with the text of `Reputation` and the for attribute set to `"reputation"`. +Below that `input` element, add another `label` element with the text of `Reputation` and the `for` attribute set to `"reputation"`. For the checkbox `input`, both the `id`, `name` and `value` attributes should be set to `"reputation"`. diff --git a/curriculum/challenges/korean/25-front-end-development/workshop-hotel-feedback-form/66a972137acd1179fa3fe8a0.md b/curriculum/challenges/korean/25-front-end-development/workshop-hotel-feedback-form/66a972137acd1179fa3fe8a0.md index 69efa4832c..09e3e6e59b 100644 --- a/curriculum/challenges/korean/25-front-end-development/workshop-hotel-feedback-form/66a972137acd1179fa3fe8a0.md +++ b/curriculum/challenges/korean/25-front-end-development/workshop-hotel-feedback-form/66a972137acd1179fa3fe8a0.md @@ -7,7 +7,7 @@ dashedName: step-28 # --description-- -Inside your `select` element, add the following five `option` elements with these corresponding values for the option text and `value` attribute: +Inside your `select` element, add the following five `option` elements with these corresponding values for the `option` text and `value` attribute: **Value Attributes:** diff --git a/curriculum/challenges/korean/25-front-end-development/workshop-hotel-feedback-form/66a97ca8c4cbae7d0bb6e0ad.md b/curriculum/challenges/korean/25-front-end-development/workshop-hotel-feedback-form/66a97ca8c4cbae7d0bb6e0ad.md index 6549345d45..22b9a707be 100644 --- a/curriculum/challenges/korean/25-front-end-development/workshop-hotel-feedback-form/66a97ca8c4cbae7d0bb6e0ad.md +++ b/curriculum/challenges/korean/25-front-end-development/workshop-hotel-feedback-form/66a97ca8c4cbae7d0bb6e0ad.md @@ -7,7 +7,7 @@ dashedName: step-31 # --description-- -Inside your `select` element, add the following five `option` elements with these corresponding values for the option text and `value` attribute: +Inside your `select` element, add the following five `option` elements with these corresponding values for the `option` text and `value` attribute: **Value Attribute:** diff --git a/curriculum/challenges/korean/25-front-end-development/workshop-loan-qualification-checker/66c8ba41a77db20a93f9d7a1.md b/curriculum/challenges/korean/25-front-end-development/workshop-loan-qualification-checker/66c8ba41a77db20a93f9d7a1.md new file mode 100644 index 0000000000..237515fd88 --- /dev/null +++ b/curriculum/challenges/korean/25-front-end-development/workshop-loan-qualification-checker/66c8ba41a77db20a93f9d7a1.md @@ -0,0 +1,71 @@ +--- +id: 66c8ba41a77db20a93f9d7a1 +title: Step 1 +challengeType: 1 +dashedName: step-1 +--- + +# --description-- + +In this workshop, you'll review JavaScript conditionals by building a loan qualification checker app. + +The app will check whether the user is eligible for a duplex, car, and condo loan based on their annual income and credit score. A credit score is a number that represents how good you are at managing borrowed money. + +To get started, create the following variables and values. + +| Variable Name | Value | +| ------------------------- | ------- | +| `minIncomeForDuplex` | `60000` | +| `minCreditScoreForDuplex` | `700` | +| `minIncomeForCondo` | `45000` | +| `minCreditScoreForCondo` | `680` | +| `minIncomeForCar` | `30000` | +| `minCreditScoreForCar` | `650` | + +# --hints-- + +You should create a `minIncomeForDuplex` variable set to `60000`. + +```js +assert.equal(minIncomeForDuplex, 60000); +``` + +You should create a `minCreditScoreForDuplex` set to `700`. + +```js +assert.equal(minCreditScoreForDuplex, 700); +``` + +You should create a `minIncomeForCar` variable set to `30000`. + +```js +assert.equal(minIncomeForCar, 30000); +``` + +You should create a `minCreditScoreForCar` variable set to `650`. + +```js +assert.equal(minCreditScoreForCar, 650); +``` + +You should create a `minIncomeForCondo` variable set to `45000`. + +```js +assert.equal(minIncomeForCondo, 45000); +``` + +You should create a `minCreditScoreForCondo` variable set to `680`. + +```js +assert.equal(minCreditScoreForCondo, 680); +``` + +# --seed-- + +## --seed-contents-- + +```js +--fcc-editable-region-- + +--fcc-editable-region-- +``` diff --git a/curriculum/challenges/korean/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4ac.md b/curriculum/challenges/korean/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4ac.md new file mode 100644 index 0000000000..7755f823c4 --- /dev/null +++ b/curriculum/challenges/korean/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4ac.md @@ -0,0 +1,53 @@ +--- +id: 66c8ba975ee7230e29f6c4ac +title: Step 2 +challengeType: 1 +dashedName: step-2 +--- + +# --description-- + +When the user is eligible for a loan, you'll want to display a message to them in the console. + +For that, you'll build out a function inside which you'll have some checks that'll return what loan the applicant is eligible for. + +Create an empty `getLoanMessage` function with an `annualIncome` and `creditScore` parameters. + +# --hints-- + +You should create a `getLoanMessage` function + +```js +assert.isFunction(getLoanMessage) +``` + +Your `getLoanMessage` function should have an `annualIncome` and `creditScore` as parameters. + +```js +assert.match(getLoanMessage?.toString(), /\(\s*annualIncome,\s*creditScore\s*\)|\(\s*creditScore,\s*annualIncome\s*\)/); +``` + +`getLoanMessage` should be an empty function. + +```js +assert.match(getLoanMessage?.toString(), /\{\s*\}/); +``` + +# --seed-- + +## --seed-contents-- + +```js +const minIncomeForDuplex = 60000; +const minCreditScoreForDuplex = 700; + +const minIncomeForCondo = 45000; +const minCreditScoreForCondo = 680; + +const minIncomeForCar = 30000; +const minCreditScoreForCar = 650; + +--fcc-editable-region-- + +--fcc-editable-region-- +``` diff --git a/curriculum/challenges/korean/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4ad.md b/curriculum/challenges/korean/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4ad.md new file mode 100644 index 0000000000..82a29d7cd9 --- /dev/null +++ b/curriculum/challenges/korean/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4ad.md @@ -0,0 +1,55 @@ +--- +id: 66c8ba975ee7230e29f6c4ad +title: Step 3 +challengeType: 1 +dashedName: step-3 +--- + +# --description-- + +To check which loan a user is qualified for based on the `annualIncome` and `creditScore`, you have to use `if/else if` statement or a ternary right inside the `getLoanMessage` function. You'll then return the appropraite message in the block of each condition. + +Starting with the duplex loan, check if `annualIncome` is greater than or equal to `minIncomeForDuplex` AND if `creditScore` is greater than `minCreditScoreForDuplex`. + +If that condition is true, then the applicant is eligible for a duplex loan and the other loans. So, inside the check, return the string `"You qualify for a car, duplex and Condo loan."` + +# --hints-- + +Your `getLoanMessage` function should return a string. + +```js +assert.isString(getLoanMessage(65000, 750)); +``` + +Your `getLoanMessage` function should return the string `"You qualify for a duplex, condo, and car loan."`. + +```js +assert.strictEqual(getLoanMessage(65000, 750), "You qualify for a duplex, condo, and car loan."); +``` + +Your `getLoanMessage` function should return `undefined` if the applicant's annual income and credit score do not meet the requirements for a duplex loan. + +```js +assert.strictEqual(getLoanMessage(59000, 700), undefined); +``` + +# --seed-- + +## --seed-contents-- + +```js +const minIncomeForDuplex = 60000; +const minCreditScoreForDuplex = 700; + +const minIncomeForCondo = 45000; +const minCreditScoreForCondo = 680; + +const minIncomeForCar = 30000; +const minCreditScoreForCar = 650; + +--fcc-editable-region-- +function getLoanMessage(annualIncome, creditScore) { + +} +--fcc-editable-region-- +``` diff --git a/curriculum/challenges/korean/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4af.md b/curriculum/challenges/korean/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4af.md new file mode 100644 index 0000000000..638e6291a4 --- /dev/null +++ b/curriculum/challenges/korean/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4af.md @@ -0,0 +1,56 @@ +--- +id: 66c8ba975ee7230e29f6c4af +title: Step 4 +challengeType: 1 +dashedName: step-4 +--- + +# --description-- + +If the applicant's annual income is greater than or equal to `minIncomeForCondo`, AND if their credit score is greater than or equal to `minCreditScoreForCondo`, then they qualify for a condo and car loan. + +Check if that's true in the `getLoanMessage` function. If it is, return the string `"You qualify for a condo and car loan."` + +# --hints-- + +Your `getLoanMessage` function should return a string if the applicant qualifies for a condo and car loan. + +```js +assert.isString(getLoanMessage(45000, 680)); +``` + +Your `getLoanMessage` function should return the string `"You qualify for a condo and car loan."`. + +```js +assert.strictEqual(getLoanMessage(45000, 680), "You qualify for a condo and car loan."); +``` + +Your `getLoanMessage` function should return `undefined` if the applicant's annual income and credit score do not meet the requirements for a condo loan. + +```js +assert.strictEqual(getLoanMessage(45000, 650), undefined); +``` + +# --seed-- + +## --seed-contents-- + +```js +const minIncomeForDuplex = 60000; +const minCreditScoreForDuplex = 700; + +const minIncomeForCondo = 45000; +const minCreditScoreForCondo = 680; + +const minIncomeForCar = 30000; +const minCreditScoreForCar = 650; + +function getLoanMessage(annualIncome, creditScore) { + if(creditScore >= minCreditScoreForDuplex && annualIncome >= minIncomeForDuplex) { + return "You qualify for a duplex, condo, and car loan." +--fcc-editable-region-- + } + +--fcc-editable-region-- +} +``` diff --git a/curriculum/challenges/korean/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b0.md b/curriculum/challenges/korean/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b0.md new file mode 100644 index 0000000000..374ba7b8fe --- /dev/null +++ b/curriculum/challenges/korean/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b0.md @@ -0,0 +1,56 @@ +--- +id: 66c8ba975ee7230e29f6c4b0 +title: Step 5 +challengeType: 1 +dashedName: step-5 +--- + +# --description-- + +Now, you should check if the applicant is qualified for a car loan only. If they're, return the string `"You qualify for a car loan."`. + +# --hints-- + +Your `getLoanMessage` function should return a string if the applicant qualifies for a car loan. + +```js +assert.isString(getLoanMessage(30000, 650)); +``` + +Your `getLoanMessage` function should return the string `"You qualify for a car loan."`. + +```js +assert.strictEqual(getLoanMessage(30000, 650), "You qualify for a car loan."); +``` + +Your `getLoanMessage` function should return `undefined` if the applicant's annual income and credit score do not meet the requirements for a car loan. + +```js +assert.strictEqual(getLoanMessage(30000, 600), undefined); +``` + +# --seed-- + +## --seed-contents-- + +```js +const minIncomeForDuplex = 60000; +const minCreditScoreForDuplex = 700; + +const minIncomeForCondo = 45000; +const minCreditScoreForCondo = 680; + +const minIncomeForCar = 30000; +const minCreditScoreForCar = 650; + +function getLoanMessage(annualIncome, creditScore) { + if(creditScore >= minCreditScoreForDuplex && annualIncome >= minIncomeForDuplex) { + return "You qualify for a duplex, condo, and car loan." + } else if (annualIncome >= minIncomeForCondo && creditScore >= minCreditScoreForCondo) { + return "You qualify for a condo and car loan." +--fcc-editable-region-- + } + +--fcc-editable-region-- +} +``` diff --git a/curriculum/challenges/korean/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b1.md b/curriculum/challenges/korean/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b1.md new file mode 100644 index 0000000000..16e8c7baca --- /dev/null +++ b/curriculum/challenges/korean/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b1.md @@ -0,0 +1,54 @@ +--- +id: 66c8ba975ee7230e29f6c4b1 +title: Step 6 +challengeType: 1 +dashedName: step-6 +--- + +# --description-- + +If the applicant's annual income and credit score fall below `minIncomeForCar` and `minCreditScoreForCar`, then they don't qualify for any loan. So, return the string `"You don't qualify for any loans."` + +# --hints-- + +Your `getLoanMessage` function should return a string if the applicant doesn't qualify for any loan. + +```js +assert.isString(getLoanMessage(25000, 550)); +``` + +Your `getLoanMessage` function should return the string `"You don't qualify for any loans."` if the applicant does not meet the requirements for any loan. + +```js +assert.strictEqual(getLoanMessage(15000, 600), "You don't qualify for any loans."); +assert.strictEqual(getLoanMessage(25000, 550), "You don't qualify for any loans."); +assert.strictEqual(getLoanMessage(20000, 500), "You don't qualify for any loans."); +``` + +# --seed-- + +## --seed-contents-- + +```js +const minIncomeForDuplex = 60000; +const minCreditScoreForDuplex = 700; + +const minIncomeForCondo = 45000; +const minCreditScoreForCondo = 680; + +const minIncomeForCar = 30000; +const minCreditScoreForCar = 650; + +function getLoanMessage(annualIncome, creditScore) { + if(creditScore >= minCreditScoreForDuplex && annualIncome >= minIncomeForDuplex) { + return "You qualify for a duplex, condo, and car loan." + } else if (annualIncome >= minIncomeForCondo && creditScore >= minCreditScoreForCondo) { + return "You qualify for a condo and car loan." + } else if (annualIncome >= minIncomeForCar && creditScore >= minCreditScoreForCar) { + return "You qualify for a car loan." +--fcc-editable-region-- + } + +--fcc-editable-region-- +} +``` diff --git a/curriculum/challenges/korean/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b2.md b/curriculum/challenges/korean/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b2.md new file mode 100644 index 0000000000..9d19f9ea4c --- /dev/null +++ b/curriculum/challenges/korean/25-front-end-development/workshop-loan-qualification-checker/66c8ba975ee7230e29f6c4b2.md @@ -0,0 +1,165 @@ +--- +id: 66c8ba975ee7230e29f6c4b2 +title: Step 7 +challengeType: 1 +dashedName: step-7 +--- + +# --description-- + +Now, it is time to test out your `getLoanMessage` function. + +Use the table below to create `4` variables and their values: + +| Variable Name | Value | +| --------------- | ---------------------------- | +| `duplexLoanMsg` | `getLoanMessage(85000, 850)` | +| `condoLoanMsg` | `getLoanMessage(65000, 690)` | +| `carLoanMsg` | `getLoanMessage(45000, 660)` | +| `noLoanMsg` | `getLoanMessage(25000, 550)` | + +After that, log each variable to the console to see the messages. + +With that, your loan qualification checker project is complete! + +# --hints-- + +You should have a variable called `duplexLoanMsg`. + +```js +assert.isNotNull(duplexLoanMsg); +``` + +Your `duplexLoanMsg` variable should be set to the result of `getLoanMessage(85000, 850)`. + +```js +assert.equal(duplexLoanMsg, getLoanMessage(85000, 850)); +``` + +You should log the `duplexLoanMsg` variable to the console. + +```js +assert.match(code, /console\.log\(duplexLoanMsg\)/) +``` + +You should have a variable called `condoLoanMsg`. + +```js +assert.isNotNull(condoLoanMsg); +``` + +Your `condoLoanMsg` variable should be set to the result of `getLoanMessage(65000, 690)`. + +```js +assert.equal(condoLoanMsg, getLoanMessage(65000, 690)); +``` + +You should log the `condoLoanMsg` variable to the console. + +```js +assert.match(code, /console\.log\(condoLoanMsg\)/) +``` + +You should have a variable called `carLoanMsg`. + +```js +assert.isNotNull(carLoanMsg); +``` + +Your `carLoanMsg` variable should be set to the result of `getLoanMessage(45000, 660)`. + +```js +assert.equal(carLoanMsg, getLoanMessage(45000, 660)); +``` + +You should log the `carLoanMsg` variable to the console. + +```js +assert.match(code, /console\.log\(carLoanMsg\)/) +``` + +You should have a variable called `noLoanMsg`. + +```js +assert.isNotNull(noLoanMsg); +``` + +Your `noLoanMsg` variable should be set to the result of `getLoanMessage(25000, 550)`. + +```js +assert.equal(noLoanMsg, getLoanMessage(25000, 550)); +``` + +You should log the `noLoanMsg` variable to the console. + +```js +assert.match(code, /console\.log\(noLoanMsg\)/) +``` + +# --seed-- + +## --seed-contents-- + +```js +const minIncomeForDuplex = 60000; +const minCreditScoreForDuplex = 700; + +const minIncomeForCondo = 45000; +const minCreditScoreForCondo = 680; + +const minIncomeForCar = 30000; +const minCreditScoreForCar = 650; + +function getLoanMessage(annualIncome, creditScore) { + if(creditScore >= minCreditScoreForDuplex && annualIncome >= minIncomeForDuplex) { + return "You qualify for a duplex, condo, and car loan." + } else if (annualIncome >= minIncomeForCondo && creditScore >= minCreditScoreForCondo) { + return "You qualify for a condo and car loan." + } else if (annualIncome >= minIncomeForCar && creditScore >= minCreditScoreForCar) { + return "You qualify for a car loan." + } else { + return "You don't qualify for any loans." + } +} + +--fcc-editable-region-- + +--fcc-editable-region-- +``` + +# --solutions-- + +```js +const minIncomeForDuplex = 60000; +const minCreditScoreForDuplex = 700; + +const minIncomeForCondo = 45000; +const minCreditScoreForCondo = 680; + +const minIncomeForCar = 30000; +const minCreditScoreForCar = 650; + +function getLoanMessage(annualIncome, creditScore) { + if(creditScore >= minCreditScoreForDuplex && annualIncome >= minIncomeForDuplex) { + return "You qualify for a duplex, condo, and car loan." + } else if (annualIncome >= minIncomeForCondo && creditScore >= minCreditScoreForCondo) { + return "You qualify for a condo and car loan." + } else if (annualIncome >= minIncomeForCar && creditScore >= minCreditScoreForCar) { + return "You qualify for a car loan." + } else { + return "You don't qualify for any loans." + } +} + +const duplexLoanMsg = getLoanMessage(85000, 850) +console.log(duplexLoanMsg) + +const condoLoanMsg = getLoanMessage(65000, 690) +console.log(condoLoanMsg) + +const carLoanMsg = getLoanMessage(45000, 660) +console.log(carLoanMsg) + +const noLoanMsg = getLoanMessage(25000, 550) +console.log(noLoanMsg) +``` diff --git a/curriculum/challenges/korean/25-front-end-development/workshop-mario-database/5f2c289f164c29556da632fd.md b/curriculum/challenges/korean/25-front-end-development/workshop-mario-database/5f2c289f164c29556da632fd.md new file mode 100644 index 0000000000..4e11751ca0 --- /dev/null +++ b/curriculum/challenges/korean/25-front-end-development/workshop-mario-database/5f2c289f164c29556da632fd.md @@ -0,0 +1,19 @@ +--- +id: 5f2c289f164c29556da632fd +title: Build a Mario Database +challengeType: 12 +url: freeCodeCamp/learn-relational-databases-by-building-a-mario-database +dashedName: build-a-mario-database +--- + +# --description-- + +In this 165-lesson workshop, you will learn the basics of a relational database by creating a PostgreSQL database filled with video game characters. + +# --instructions-- + +# --hints-- + +# --seed-- + +# --solutions-- diff --git a/curriculum/challenges/korean/25-front-end-development/workshop-npm-packages/587d7fb3367417b2b2512bfb.md b/curriculum/challenges/korean/25-front-end-development/workshop-npm-packages/587d7fb3367417b2b2512bfb.md new file mode 100644 index 0000000000..8d4c90410d --- /dev/null +++ b/curriculum/challenges/korean/25-front-end-development/workshop-npm-packages/587d7fb3367417b2b2512bfb.md @@ -0,0 +1,53 @@ +--- +id: 587d7fb3367417b2b2512bfb +title: How to Use package.json, the Core of Any Node.js Project or npm Package +challengeType: 2 +forumTopicId: 301528 +dashedName: how-to-use-package-json-the-core-of-any-node-js-project-or-npm-package +--- + +# --description-- + +Working on these challenges will involve you writing your code using one of the following methods: + +- Clone this GitHub repo and complete these challenges locally. +- Use our Gitpod starter project to complete these challenges. +- Use a site builder of your choice to complete the project. Be sure to incorporate all the files from our GitHub repo. + +The `package.json` file is the center of any Node.js project or npm package. It stores information about your project. It consists of a single JSON object where information is stored in key-value pairs. There are only two required fields; `name` and `version`, but it’s good practice to provide additional information. + +You can create the `package.json` file from the terminal using the `npm init` command. This will run a guided setup. Using `npm init` with the `-y` flag will generate the file without having it ask any questions, `npm init -y`. + +If you look at the file tree of your project, you will find the `package.json` file on the top level of the tree. This is the file that you will be improving in the next couple of challenges. + +One of the most common pieces of information in this file is the `author` field. It specifies who created the project, and can consist of a string or an object with contact or other details. An object is recommended for bigger projects, but a simple string like the following example will do for this project. + +```json +"author": "Jane Doe", +``` + +# --instructions-- + +Add your name as the `author` of the project in the `package.json` file. + +**Note:** Remember that you’re writing JSON, so all field names must use double-quotes (") and be separated with a comma (,). + +If you are using Gitpod, make sure the app is running and the preview window is open. Copy the preview window's URL and paste it into the Solution Link input below. + +# --hints-- + +`package.json` should have a valid "author" key + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert(packJson.author, '"author" is missing'); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/korean/25-front-end-development/workshop-npm-packages/587d7fb3367417b2b2512bfc.md b/curriculum/challenges/korean/25-front-end-development/workshop-npm-packages/587d7fb3367417b2b2512bfc.md new file mode 100644 index 0000000000..37d15d5261 --- /dev/null +++ b/curriculum/challenges/korean/25-front-end-development/workshop-npm-packages/587d7fb3367417b2b2512bfc.md @@ -0,0 +1,43 @@ +--- +id: 587d7fb3367417b2b2512bfc +title: Add a Description to Your package.json +challengeType: 2 +forumTopicId: 301522 +dashedName: add-a-description-to-your-package-json +--- + +# --description-- + +The next part of a good package.json file is the `description` field; where a short, but informative description about your project belongs. + +If some day you plan to publish a package to npm, this is the string that should sell your idea to the user when they decide whether to install your package or not. However, that’s not the only use case for the description, it’s a great way to summarize what a project does. It’s just as important in any Node.js project to help other developers, future maintainers or even your future self understand the project quickly. + +Regardless of what you plan for your project, a description is definitely recommended. Here's an example: + +```json +"description": "A project that does something awesome", +``` + +# --instructions-- + +Add a `description` to the package.json file of your project. + +**Note:** Remember to use double-quotes for field-names (") and commas (,) to separate fields. + +# --hints-- + +package.json should have a valid "description" key + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert(packJson.description, '"description" is missing'); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/korean/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bfd.md b/curriculum/challenges/korean/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bfd.md new file mode 100644 index 0000000000..a001cdd477 --- /dev/null +++ b/curriculum/challenges/korean/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bfd.md @@ -0,0 +1,75 @@ +--- +id: 587d7fb4367417b2b2512bfd +title: Add Keywords to Your package.json +challengeType: 2 +forumTopicId: 301526 +dashedName: add-keywords-to-your-package-json +--- + +# --description-- + +The `keywords` field is where you can describe your project using related keywords. Here's an example: + +```json +"keywords": [ "descriptive", "related", "words" ], +``` + +As you can see, this field is structured as an array of double-quoted strings. + +# --instructions-- + +Add an array of suitable strings to the `keywords` field in the package.json file of your project. + +One of the keywords should be "freecodecamp". + +# --hints-- + +package.json should have a valid "keywords" key + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert(packJson.keywords, '"keywords" is missing'); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + +"keywords" field should be an Array + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.isArray(packJson.keywords, '"keywords" is not an array'); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + +"keywords" should include "freecodecamp" + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.include( + packJson.keywords, + 'freecodecamp', + '"keywords" does not include "freecodecamp"' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/korean/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bfe.md b/curriculum/challenges/korean/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bfe.md new file mode 100644 index 0000000000..7b09acd042 --- /dev/null +++ b/curriculum/challenges/korean/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bfe.md @@ -0,0 +1,39 @@ +--- +id: 587d7fb4367417b2b2512bfe +title: Add a License to Your package.json +challengeType: 2 +forumTopicId: 301523 +dashedName: add-a-license-to-your-package-json +--- + +# --description-- + +The `license` field is where you inform users of what they are allowed to do with your project. + +Some common licenses for open source projects include MIT and BSD. License information is not required, and copyright laws in most countries will give you ownership of what you create by default. However, it’s always a good practice to explicitly state what users can and can’t do. Here's an example of the license field: + +```json +"license": "MIT", +``` + +# --instructions-- + +Fill the `license` field in the package.json file of your project as you find suitable. + +# --hints-- + +package.json should have a valid "license" key + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert(packJson.license, '"license" is missing'); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/korean/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bff.md b/curriculum/challenges/korean/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bff.md new file mode 100644 index 0000000000..f2e571faed --- /dev/null +++ b/curriculum/challenges/korean/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512bff.md @@ -0,0 +1,37 @@ +--- +id: 587d7fb4367417b2b2512bff +title: Add a Version to Your package.json +challengeType: 2 +forumTopicId: 301525 +dashedName: add-a-version-to-your-package-json +--- + +# --description-- + +A `version` is one of the required fields of your package.json file. This field describes the current version of your project. Here's an example: + +```json +"version": "1.2.0", +``` + +# --instructions-- + +Add a `version` to the package.json file of your project. + +# --hints-- + +package.json should have a valid "version" key + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert(packJson.version, '"version" is missing'); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/korean/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512c00.md b/curriculum/challenges/korean/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512c00.md new file mode 100644 index 0000000000..161c60fe69 --- /dev/null +++ b/curriculum/challenges/korean/25-front-end-development/workshop-npm-packages/587d7fb4367417b2b2512c00.md @@ -0,0 +1,68 @@ +--- +id: 587d7fb4367417b2b2512c00 +title: Expand Your Project with External Packages from npm +challengeType: 2 +forumTopicId: 301527 +dashedName: expand-your-project-with-external-packages-from-npm +--- + +# --description-- + +One of the biggest reasons to use a package manager, is their powerful dependency management. Instead of manually having to make sure that you get all dependencies whenever you set up a project on a new computer, npm automatically installs everything for you. But how can npm know exactly what your project needs? Meet the `dependencies` section of your package.json file. + +In this section, packages your project requires are stored using the following format: + +```json +"dependencies": { + "package-name": "version", + "express": "4.14.0" +} + +``` + +# --instructions-- + +Add version `1.1.0` of the `@freecodecamp/example` package to the `dependencies` field of your `package.json` file. + +**Note:** `@freecodecamp/example` is a faux package used as a learning tool. + +# --hints-- + +`"dependencies"` should include `"@freecodecamp/example"`. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.property( + packJson.dependencies, + '@freecodecamp/example', + '"dependencies" does not include "@freecodecamp/example"' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + +`"@freecodecamp/example"` version should be `"1.1.0"`. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.match( + packJson.dependencies["@freecodecamp/example"], + /^[\^\~]?1\.1\.0/, + 'Wrong version of "@freecodecamp/example" installed. It should be 1.1.0' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/korean/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c01.md b/curriculum/challenges/korean/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c01.md new file mode 100644 index 0000000000..deda9b82de --- /dev/null +++ b/curriculum/challenges/korean/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c01.md @@ -0,0 +1,64 @@ +--- +id: 587d7fb5367417b2b2512c01 +title: Manage npm Dependencies By Understanding Semantic Versioning +challengeType: 2 +forumTopicId: 301529 +dashedName: manage-npm-dependencies-by-understanding-semantic-versioning +--- + +# --description-- + +`Versions` of the npm packages in the dependencies section of your package.json file follow what’s called Semantic Versioning (SemVer), an industry standard for software versioning aiming to make it easier to manage dependencies. Libraries, frameworks or other tools published on npm should use SemVer in order to clearly communicate what kind of changes projects can expect if they update. + +Knowing SemVer can be useful when you develop software that uses external dependencies (which you almost always do). One day, your understanding of these numbers will save you from accidentally introducing breaking changes to your project without understanding why things that worked yesterday suddenly don’t work today. This is how Semantic Versioning works according to the official website: + +```json +"package": "MAJOR.MINOR.PATCH" +``` + +The MAJOR version should increment when you make incompatible API changes. The MINOR version should increment when you add functionality in a backwards-compatible manner. The PATCH version should increment when you make backwards-compatible bug fixes. This means that PATCHes are bug fixes and MINORs add new features but neither of them break what worked before. Finally, MAJORs add changes that won’t work with earlier versions. + +# --instructions-- + +In the dependencies section of your `package.json` file, change the version of `@freecodecamp/example` to match MAJOR version 1, MINOR version 2 and PATCH version 13 + +# --hints-- + +`"dependencies"` should include `"@freecodecamp/example"`. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.property( + packJson.dependencies, + '@freecodecamp/example', + '"dependencies" does not include "@freecodecamp/example"' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + +`"@freecodecamp/example"` version should be `"1.2.13"`. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.equal( + packJson.dependencies["@freecodecamp/example"], + '1.2.13', + 'Wrong version of "@freecodecamp/example". It should be 1.2.13' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/korean/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c02.md b/curriculum/challenges/korean/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c02.md new file mode 100644 index 0000000000..8eae5f51ee --- /dev/null +++ b/curriculum/challenges/korean/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c02.md @@ -0,0 +1,66 @@ +--- +id: 587d7fb5367417b2b2512c02 +title: Use the Tilde-Character to Always Use the Latest Patch Version of a Dependency +challengeType: 2 +forumTopicId: 301532 +dashedName: use-the-tilde-character-to-always-use-the-latest-patch-version-of-a-dependency +--- + +# --description-- + +In the last challenge, you told npm to only include a specific version of a package. That’s a useful way to freeze your dependencies if you need to make sure that different parts of your project stay compatible with each other. But in most use cases, you don’t want to miss bug fixes since they often include important security patches and (hopefully) don’t break things in doing so. + +To allow an npm dependency to update to the latest PATCH version, you can prefix the dependency’s version with the tilde (`~`) character. Here's an example of how to allow updates to any `1.3.x` version. + +```json +"package": "~1.3.8" +``` + +# --instructions-- + +In the package.json file, your current rule for how npm may upgrade `@freecodecamp/example` is to use a specific version (`1.2.13`). But now, you want to allow the latest `1.2.x` version. + +Use the tilde (`~`) character to prefix the version of `@freecodecamp/example` in your dependencies, and allow npm to update it to any new _patch_ release. + +**Note:** The version numbers themselves should not be changed. + +# --hints-- + +`"dependencies"` should include `"@freecodecamp/example"`. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.property( + packJson.dependencies, + '@freecodecamp/example', + '"dependencies" does not include "@freecodecamp/example"' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + +`"@freecodecamp/example"` version should match `"~1.2.13"`. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.match( + packJson.dependencies["@freecodecamp/example"], + /^\~1\.2\.13/, + 'Wrong version of "@freecodecamp/example". It should be ~1.2.13' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/korean/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c03.md b/curriculum/challenges/korean/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c03.md new file mode 100644 index 0000000000..adc3014ea4 --- /dev/null +++ b/curriculum/challenges/korean/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c03.md @@ -0,0 +1,66 @@ +--- +id: 587d7fb5367417b2b2512c03 +title: Use the Caret-Character to Use the Latest Minor Version of a Dependency +challengeType: 2 +forumTopicId: 301531 +dashedName: use-the-caret-character-to-use-the-latest-minor-version-of-a-dependency +--- + +# --description-- + +Similar to how the tilde we learned about in the last challenge allows npm to install the latest PATCH for a dependency, the caret (`^`) allows npm to install future updates as well. The difference is that the caret will allow both MINOR updates and PATCHes. + +Your current version of `@freecodecamp/example` should be `~1.2.13` which allows npm to install to the latest `1.2.x` version. If you were to use the caret (^) as a version prefix instead, npm would be allowed to update to any `1.x.x` version. + +```json +"package": "^1.3.8" +``` + +This would allow updates to any `1.x.x` version of the package. + +# --instructions-- + +Use the caret (`^`) to prefix the version of `@freecodecamp/example` in your dependencies and allow npm to update it to any new MINOR release. + +**Note:** The version numbers themselves should not be changed. + +# --hints-- + +`"dependencies"` should include `"@freecodecamp/example"`. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.property( + packJson.dependencies, + '@freecodecamp/example', + '"dependencies" does not include "@freecodecamp/example"' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + +`"@freecodecamp/example"` version should match `"^1.x.x"`. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.match( + packJson.dependencies["@freecodecamp/example"], + /^\^1\./, + 'Wrong version of "@freecodecamp/example". It should be ^1.2.13' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/korean/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c04.md b/curriculum/challenges/korean/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c04.md new file mode 100644 index 0000000000..5f695eed88 --- /dev/null +++ b/curriculum/challenges/korean/25-front-end-development/workshop-npm-packages/587d7fb5367417b2b2512c04.md @@ -0,0 +1,43 @@ +--- +id: 587d7fb5367417b2b2512c04 +title: Remove a Package from Your Dependencies +challengeType: 2 +forumTopicId: 301530 +dashedName: remove-a-package-from-your-dependencies +--- + +# --description-- + +You have now tested a few ways you can manage dependencies of your project by using the package.json's dependencies section. You have also included external packages by adding them to the file and even told npm what types of versions you want, by using special characters such as the tilde or the caret. + +But what if you want to remove an external package that you no longer need? You might already have guessed it, just remove the corresponding key-value pair for that package from your dependencies. + +This same method applies to removing other fields in your package.json as well. + +# --instructions-- + +Remove the `@freecodecamp/example` package from your dependencies. + +**Note:** Make sure you have the right amount of commas after removing it. + +# --hints-- + +`"dependencies"` should not include `"@freecodecamp/example"`. + +```js +(getUserInput) => + $.get(getUserInput('url') + '/_api/package.json').then( + (data) => { + var packJson = JSON.parse(data); + assert.notProperty( + packJson.dependencies, + '@freecodecamp/example', + '"dependencies" still includes "@freecodecamp/example"' + ); + }, + (xhr) => { + throw new Error(xhr.responseText); + } + ); +``` + diff --git a/curriculum/challenges/portuguese/13-relational-databases/build-a-periodic-table-database-project/build-a-periodic-table-database.md b/curriculum/challenges/portuguese/13-relational-databases/build-a-periodic-table-database-project/build-a-periodic-table-database.md index 71ebaa41d5..6297c12cea 100644 --- a/curriculum/challenges/portuguese/13-relational-databases/build-a-periodic-table-database-project/build-a-periodic-table-database.md +++ b/curriculum/challenges/portuguese/13-relational-databases/build-a-periodic-table-database-project/build-a-periodic-table-database.md @@ -8,7 +8,7 @@ dashedName: build-a-periodic-table-database # --description-- -Este é um dos projetos necessários para obter sua certificação. Para este projeto, você criará um script no Bash para obter informações sobre elementos químicos de um banco de dados de tabela periódica. +Este é um dos projetos necessários para obter sua certificação. Para este projeto, você criará um script do Bash para obter informações sobre elementos químicos de um banco de dados de tabela periódica. # --instructions-- diff --git a/curriculum/challenges/portuguese/14-responsive-web-design-22/learn-basic-css-by-building-a-cafe-menu/5f3ef6e0a81099d9a697b550.md b/curriculum/challenges/portuguese/14-responsive-web-design-22/learn-basic-css-by-building-a-cafe-menu/5f3ef6e0a81099d9a697b550.md index 8a6a387f29..a655787ba5 100644 --- a/curriculum/challenges/portuguese/14-responsive-web-design-22/learn-basic-css-by-building-a-cafe-menu/5f3ef6e0a81099d9a697b550.md +++ b/curriculum/challenges/portuguese/14-responsive-web-design-22/learn-basic-css-by-building-a-cafe-menu/5f3ef6e0a81099d9a697b550.md @@ -9,6 +9,8 @@ dashedName: step-64 Dentro do `footer`, adicione um elemento `p`. Então, aninhe um elemento de âncora (`a`) no `p` que encaminhe para `https://www.freecodecamp.org` e tenha o texto `Visit our website`. +Make sure that the link opens in a new tab by adding a `target` attribute with the value `_blank`. + # --hints-- O elemento preexistente `footer` deve permanecer o mesmo. @@ -43,6 +45,12 @@ O novo elemento de âncora (`a`) deve fazer um link para `https://www.freecodeca assert(document.querySelector("footer > p > a")?.href === "https://www.freecodecamp.org/"); ``` +Your new `a` element should have the `target` attribute set to `_blank`. + +```js +assert.equal(document.querySelector("footer > p > a")?.target, "_blank"); +``` + # --seed-- ## --seed-contents-- diff --git a/curriculum/challenges/portuguese/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-a.md b/curriculum/challenges/portuguese/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-a.md index e89ae1c17d..5e27afd190 100644 --- a/curriculum/challenges/portuguese/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-a.md +++ b/curriculum/challenges/portuguese/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-a.md @@ -7,53 +7,53 @@ dashedName: introduction-flexbox-lesson-a # --description-- -## Before we get started +## Antes de começarmos -Flexbox layouts can get a little complicated. Em uma lição anterior, você aprendeu como inspecionar e depurar coisas usando as ferramentas de desenvolvedor do seu navegador. Those tools will be crucial for you in the following lessons. If something isn’t behaving the way you expect, inspecting it in the developer tools should be your first step every time. +Os layouts do Flexbox podem ficar um pouco complicados. Em uma lição anterior, você aprendeu como inspecionar e depurar coisas usando as ferramentas de desenvolvedor do seu navegador. Essas ferramentas serão cruciais para você nas próximas lições. Se algo não está se comportando do modo esperado, inspecionar nas ferramentas de desenvolvedor deve ser seu primeiro passo sempre. -Flexbox isn’t necessarily any more difficult than the other concepts that we’ve covered so far, but it does have a few more moving parts. Vai ser um pouco difícil usar qualquer uma das coisas que você está aprendendo nestas primeiras lições até chegar ao fim e conseguir juntar tudo. As we go, do yourself a favor and play with all of the code examples. +O Flexbox não é necessariamente mais difícil do que os outros conceitos que cobrimos até agora, mas tem algumas partes que requerem um pouco mais de atenção. Vai ser um pouco difícil usar qualquer uma das coisas que você está aprendendo nestas primeiras lições até chegar ao fim e conseguir juntar tudo. À medida que avançamos, aproveite o tempo e brinque bastante com todos os exemplos de código. Você quase definitivamente precisará voltar e se referir a essas lições (ou a alguns dos recursos que compartilhamos com você) quando chegar às atividades no final da seção, mas se você levar seu tempo e experimentar todos os exemplos de código que fornecemos, saberá melhor onde procurar quando esse momento chegar. -## Let’s flex +## Vamos usar o flex -Flexbox is a way to arrange items into rows or columns. These items will flex (i.e. grow or shrink) based on some simple rules that you can define. To get started, let’s look at a simple demonstration. +O Flexbox é uma maneira de dispor itens em linhas ou colunas. Esses itens "flexionar" (ou seja, crescer ou encolher) com base em algumas regras simples que você pode definir. Para começar, vamos olhar para uma demonstração simples. -> We’ve embedded a lot of interactive examples in these lessons. Take your time to experiment with them as you go to cement the concepts in your mind! +> Inserimos muitos exemplos interativos nessas lições. Passe um tempo experimentando com eles à medida que avança para fixar os conceitos em sua mente! - + -We’ll get into exactly what’s going on here soon enough. But for now, let’s uncomment the two flex related CSS declarations in the above Codepen by removing the `/*` and `*/` tags surrounding them, then check out the result. +Falaremos sobre o que está acontecendo aqui em breve. Por enquanto, vamos descomentar as duas declarações do CSS relacionadas ao flex no Codepen acima removendo as tags `/*` e `*/` que as envolvem. Depois, conferimos o resultado. -> Comments prevent the browser from interpreting lines as code, and are wrapped between specific tags. CSS uses `/*` as an opening comment tag and `*/` as a closing comment tag, while HTML and JavaScript have their own syntax. Commented out lines of code can be re-enabled simply by removing the comment tags surrounding the code. +> Comentários impedem que o navegador interprete linhas como código e são envoltos entre tags específicas. O CSS usa `/*` como tag de abertura do comentário e `*/` como tag de fechamento do comentário. O HTML e o JavaScript têm sua própria sintaxe. Linhas de código comentadas podem ser reabilitadas simplesmente removendo as tags de comentário que as cercam. -All 3 divs should now be arranged horizontally. If you resize the results frame with the `1x`, `.5x` and `.25x` buttons you’ll also see that the `div` elements will "flex". They will fill the available area and will each have equal width. +Todas as 3 divs devem agora estar dispostas horizontalmente. Se você redimensionar a janela de resultados com os botões `1x`, `.5x` e `.25x` você também verá que os elementos `div` vão "flexionar". Eles preencherão a área disponível e terão largura igual. -If you add another `div` to the HTML, inside of `.flex-container`, it will show up alongside the others, and everything will flex to fit within the available area. +Se você adicionar outra `div` ao HTML, dentro de `.flex-container`, ela aparecerá ao lado dos outras. Tudo se ajustará para caber dentro da área disponível. -> If it’s hard to see what's going on in the small embedded CodePen, feel free to click the "Edit on CodePen" or "Fork on CodePen" button. This will bring the example into a full-sized environment. Some of the later examples might especially benefit from doing this. +> Se for difícil ver o que está acontecendo no pequeno CodePen incorporado, sinta-se à vontade para clicar no botão "Edit on CodePen" ou "Fork on CodePen". Isso trará o exemplo para um ambiente de tamanho completo. Ao fazer isso, será possível visualizar melhor alguns dos exemplos posteriores. # --question-- ## --text-- -What happens when the two flex related CSS declarations in the CodePen are uncommented? +O que acontece quando as duas declarações do CSS relacionadas ao flex no CodePen são descomentadas? ## --answers-- -The `div` elements become hidden from view, losing their visibility within the container. +Os elementos `div` ficam escondidos da vista, perdendo sua visibilidade dentro do contêiner. --- -All 3 `div` elements are arranged horizontally, and they flex to fill the available area with equal width. +Os 3 elementos `div` são dispostos horizontalmente e se flexionam para preencher a área disponível com largura igual. --- -Each `div` element enlarges and covers the entire container, overlapping each other. +Cada elemento `div` se amplia e cobre todo o contêiner, sobrepondo-se uns aos outros. --- -The `div` elements align vertically in a single column, ignoring the flex-related CSS declarations. +Os elementos `div` se alinham verticalmente em uma única coluna, ignorando as declarações do CSS relacionadas ao flex. ## --video-solution-- diff --git a/curriculum/challenges/portuguese/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-c.md b/curriculum/challenges/portuguese/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-c.md index 0b7a8d3948..aa83757e28 100644 --- a/curriculum/challenges/portuguese/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-c.md +++ b/curriculum/challenges/portuguese/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-c.md @@ -7,21 +7,21 @@ dashedName: introduction-flexbox-lesson-c # --description-- -Somewhat confusingly, any element can be both a flex container and a flex item. Said another way, you can also put `display: flex` on a flex item and then use flexbox to arrange its children. +Pode parecer um pouco confuso, mas qualquer elemento pode ser tanto um contêiner flex quanto um item flexível. Dito de outra forma, você também pode colocar `display: flex` em um flex item e usar o flexbox para organizar seus filhos. -a flex container that has multiple flex items, within those flex items are nested flex items as well. Making the parent of those nested flex items also a flex container. +um flex contêiner que tem múltiplos flex itens, dentro desses flex itens estão aninhados flex itens também. Isso também torna o pai desses flex itens aninhados um flex contêiner. -Creating and nesting multiple flex containers and items is the primary way you will be building up complex layouts. The following image was achieved using only flexbox to arrange, size, and place the various elements. Flexbox is a very powerful tool. +Criar e aninhar múltiplos contêineres flex e itens flex é a principal forma de você construir layouts complexos. A imagem a seguir foi obtida utilizando apenas flexbox para organizar, dimensionar e posicionar os diversos elementos. Flexbox é uma ferramenta muito poderosa. -a complex layout of flex items and flex containers. There are multiple flex containers nested into each other, thus making them flex items as well +um layout complexo de itens flex e contêineres flex. Há múltiplos contêineres flex aninhados uns nos outros, portanto tornando-os também itens flex -Certainly, the image features a representation of a CSS Flexbox layout with nested flex containers. The outer container is denoted as "ALSO a flex container" highlighted in blue, and within it is another container marked as "with flex items" in red. Inside the red container, there are three items labeled as "flex items" in peach. This demonstrates that a flex container can be nested within another flex container and contain its own flex items, showcasing the recursive nature of Flexbox layout structures. +Certamente, a imagem apresenta uma representação de um layout Flexbox CSS com contêineres flex aninhados. O contêiner externo é marcado como "ALSO a flex container" destacado em azul, e dentro dele há outro contêiner marcado como "with flex items" em vermelho. Dentro do contêiner vermelho, há três itens rotulados como "flex items" na cor pêssego. Isso demonstra que um contêiner flex pode ser aninhado dentro de outro contêiner flex e conter seus próprios itens flex, mostrando a natureza recursiva das estruturas de layout Flexbox. # --question-- ## --text-- -Which CSS property is applied to elements to make them flex containers? +Qual propriedade CSS é aplicada aos elementos para torná-los contêineres flex? ## --answers-- diff --git a/curriculum/challenges/portuguese/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-d.md b/curriculum/challenges/portuguese/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-d.md index f7e458c52d..c5dd53213c 100644 --- a/curriculum/challenges/portuguese/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-d.md +++ b/curriculum/challenges/portuguese/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-d.md @@ -1,35 +1,35 @@ --- id: 6571b2ffcc1de61d7b4dd382 -title: Introduction to Flexbox Lesson D +title: Lição D de Introdução ao Flexbox challengeType: 15 dashedName: introduction-flexbox-lesson-d --- # --description-- -Now that you have a basic understanding of how flexbox works, what is the primairy role of a flex item in a `flexbox` layout? Try and answer the question below. +Agora que você tem um entendimento básico de como o flexbox funciona, qual é o papel primário de um item flex em um layout do `flexbox`? Tente responder a pergunta abaixo. # --question-- ## --text-- -What role does a flex item play within a flex container? +Qual papel um item flex desempenha dentro de um contêiner flex? ## --answers-- -Flex items define the overall layout structure. +Itens flex definem a estrutura geral do layout. --- -Flex items set the background colors of flex containers. +Itens flex definem as cores de fundo dos contêineres flex. --- -Flex items allow the flex container to resize based on content. +Itens flex permitem que o contêiner flex seja redimensionado com base no conteúdo. --- -Flex items are elements that reside directly within a flex container. +Itens flex são elementos que residem diretamente dentro de um contêiner flex. ## --video-solution-- diff --git a/curriculum/challenges/portuguese/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-e.md b/curriculum/challenges/portuguese/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-e.md index 366cd6d942..a9307e7d8d 100644 --- a/curriculum/challenges/portuguese/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-e.md +++ b/curriculum/challenges/portuguese/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-e.md @@ -7,39 +7,39 @@ dashedName: introduction-flexbox-lesson-e # --description-- -The `flex` declaration is actually a shorthand for 3 properties that you can set on a flex item. These properties affect how flex items size themselves within their container. You've seen some shorthand properties before, but you haven't officially defined them yet. +A declaração `flex` é na verdade uma abreviação para 3 propriedades que você pode definir em um item flex. Essas propriedades afetam como os itens flex dimensionam a si mesmos dentro de seu contêiner. Você já viu algumas propriedades abreviadas antes, mas ainda não as definiu oficialmente. -> Shorthand properties are CSS properties that let you set the values of multiple other CSS properties simultaneously. Using a shorthand property, you can write more concise (and often more readable) stylesheets, saving time and energy. +> Propriedades abreviadas são propriedades do CSS que permitem definir os valores de múltiplas outras propriedades do CSS simultaneamente. Usando uma propriedade abreviada, você pode escrever folhas de estilo mais concisas (e muitas vezes mais legíveis), economizando tempo e energia. -In this case, `flex` is actually a shorthand for `flex-grow`, `flex-shrink` and `flex-basis`. +Neste caso, `flex` é, na verdade, uma abreviação para `flex-grow`, `flex-shrink` e `flex-basis`. -CSS code setting the flex property to 1 for a div element. +Código em CSS definindo a propriedade flex para 1 em um elemento div. -In the above screenshot, `flex: 1` equates to: `flex-grow: 1`, `flex-shrink: 1`, `flex-basis: 0`. +Na captura de tela acima, `flex: 1` equivale a: `flex-grow: 1`, `flex-shrink: 1`, `flex-basis: 0`. -Very often, you see the flex shorthand defined with only one value. In that case, that value is applied to `flex-grow`. So when you put `flex: 1` on our divs, you were actually specifying a shorthand of `flex: 1 1 0`. +Muito frequentemente, você vê a abreviação de flex definida com apenas um valor. Nesse caso, esse valor é aplicado a `flex-grow`. Então, quando você colocou `flex: 1` nas divs, você estava, na verdade, especificando uma abreviação de `flex: 1 1 0`. # --question-- ## --text-- -Which properties are set by the `flex` shorthand? +Quais propriedades são definidas pela abreviação `flex`? ## --answers-- -`flex-grow`, `flex-shrink`, and `flex` +`flex-grow`, `flex-shrink` e `flex` --- -`flex-basis`, `flex-wrap`, and `flex-direction` +`flex-basis`, `flex-wrap` e `flex-direction` --- -`flex-grow`, `flex-shrink`, and `flex-basis` +`flex-grow`, `flex-shrink` e `flex-basis` --- -`flex-direction`, `flex`, and `flex-wrap` +`flex-direction`, `flex` e `flex-wrap` ## --video-solution-- diff --git a/curriculum/challenges/portuguese/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-i.md b/curriculum/challenges/portuguese/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-i.md index daeb69cd8a..1a7f412baa 100644 --- a/curriculum/challenges/portuguese/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-i.md +++ b/curriculum/challenges/portuguese/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-i.md @@ -7,37 +7,37 @@ dashedName: introduction-flexbox-lesson-i # --description-- - + -One thing to note is that in this example, `flex-direction: column` would not work as expected if you used the shorthand `flex: 1`. Try it out now (i.e. go change the flex value on the `flex: 1 1 auto;` line). Can you figure out why it does not work if `flex: 1` is used? The divs collapse, even though they clearly have a height defined there. +Uma coisa a observar é que, neste exemplo, `flex-direction: column` não funcionaria como esperado se você usasse a abreviação `flex: 1`. Tente agora (ou seja, vá mudar o valor do flex na linha `flex: 1 1 auto;`). Você pode descobrir por que não funciona se `flex: 1` for usado? As divs colapsam, embora claramente tenham uma altura definida ali. -The reason for this is that the flex shorthand expands `flex-basis` to `0`, which means that all `flex-growing` and `flex-shrinking` would begin their calculations from 0. Empty divs by default have 0 height, so for our flex items to fill up the height of their container, they don't actually need to have any height at all. +A razão para isso é que a forma abreviada de flex expande `flex-basis` para `0`, o que significa que todo o `flex-growing` e `flex-shrinking` começaria seus cálculos a partir de 0. Divs vazias, por padrão, têm altura 0, então para nossos itens de flex ocuparem a altura de seu contêiner, eles, na verdade, não precisariam ter qualquer altura. -The example above fixed this by specifying `flex: 1 1 auto`, telling the flex items to default to their given height. You could also have fixed it by putting a `height` on the parent `.flex-container`, or by using `flex-grow: 1` instead of the shorthand. +O exemplo acima corrigiu isso especificando `flex: 1 1 auto`, dizendo aos itens flex para adotarem a altura fornecida. Você também poderia ter corrigido isso colocando uma `height` no `.flex-container` pai, ou usando `flex-grow: 1` invés da forma abreviada. -Another detail to notice: when you changed the `flex-direction` to `column`, `flex-basis` refers to `height` instead of `width`. Given the context this may be obvious, but it's something to be aware of. +Outro detalhe a ser observado: quando você alterou a `flex-direction` para `column`, `flex-basis` refere-se a `height` em vez de `width`. Dado o contexto, isso pode ser óbvio, mas é algo a se ter em mente. # --question-- ## --text-- -Why does using `flex: 1` shorthand with `flex-direction: column` lead to collapsed divs in the example described? +Por que usar a forma abreviada `flex: 1` com `flex-direction: column` leva a divs colapsadas no exemplo descrito? ## --answers-- -The `flex` shorthand defaults `flex-basis` to 0, disregarding the defined height of the divs. +A forma abreviada do `flex` define `flex-basis` como 0, desconsiderando a altura definida das divs. --- -The `flex` shorthand overrides the specified `flex-direction`, causing collapsing. +A forma abreviada do `flex` sobrepõe a `flex-direction` especificada, causando o colapso. --- -`flex: 1` only works in a row-based layout, not in a column-based one. +`flex: 1` só funciona com base em layout de linhas, não com base em colunas. --- -The `flex-basis` property becomes fixed to the width, ignoring the height in column layout. +A propriedade `flex-basis` torna-se fixa na largura, ignorando a altura no layout de coluna. ## --video-solution-- diff --git a/curriculum/challenges/portuguese/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-j.md b/curriculum/challenges/portuguese/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-j.md index 0ac30fef8c..b000c7801c 100644 --- a/curriculum/challenges/portuguese/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-j.md +++ b/curriculum/challenges/portuguese/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-j.md @@ -7,45 +7,45 @@ dashedName: introduction-flexbox-lesson-j # --description-- -Let's look at an example. +Dê uma olhada no exemplo. - + -You should be able to predict what happens if you put `flex: 1` on the `.item` by now. Give it a shot before you move on! +Agora você deve ser capaz de prever o que acontece se você colocar `flex: 1` no `.item`. Tente antes de continuar! -Adding `flex: 1` to `.item` makes each of the items grow to fill the available space, but what if you wanted them to stay the same width, but distribute themselves differently inside the container? You can do this! +Adicionar `flex: 1` ao `.item` faz com que cada um dos itens cresça para preencher o espaço disponível, mas o que você poderia fazer se quisesse que eles mantivessem a mesma largura, embora se distribuíssem de modo diferente dentro do contêiner? Você pode fazer isso! -Remove `flex: 1` from `.item` and add `justify-content: space-between` to `.container`. Doing so should give you something like this: +Remova `flex: 1` do `.item` e adicione `justify-content: space-between` ao `.container`. Fazendo isso, você deve obter algo assim: -Three small boxes within a much larger rectangle. The boxes are arranged in a single row, one close to the left edge of the container, one close to the right edge of the container, and the last directly in the middle of the container, placing as much space as possible between each box. +Três pequenas caixas dentro de um retângulo muito maior. As caixas são dispostas em uma única linha, uma próxima à borda esquerda do contêiner, outra próxima à borda direita do contêiner e a última diretamente no meio do contêiner, colocando o máximo de espaço possível entre cada caixa. -`justify-content` aligns items across the **main axis**. There are a few values that you can use here. You'll learn the rest of them in the reading assignments, but for now try changing it to center, which should center the boxes along the main axis. +`justify-content` alinha itens ao longo do **eixo principal**. Existem alguns valores que você pode usar aqui. Você aprenderá o restante nas leituras indicadas. Por enquanto, tente mudar para center, o que deve centralizar as caixas ao longo do eixo principal. -# --question-- +# --assignment-- -## --assignment-- +Antes de passar para a próxima lição, veja o que é possível com a propriedade `justify-content`. Leia este [artigo interativo na MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/justify-content) e experimente com os diferentes valores de `justify-content` no exemplo. -Antes de passar para a próxima lição, veja o que é possível com a propriedade `justify-content`. Read this [interactive article on MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/justify-content) and play around with the different values of `justify-content` on the example. +# --question-- ## --text-- -How does applying `justify-content: space-between` to a flex container affect the positioning of its items? +Como aplicar `justify-content: space-between` a um contêiner flex afeta o posicionamento dos seus itens? ## --answers-- -It evenly distributes space between items, pushing the first and last items to the edges. +Distribui o espaço uniformemente entre os itens, empurrando o primeiro e o último itens para as bordas. --- -It centers all items within the container. +Centraliza todos os itens dentro do contêiner. --- -It causes the items to grow to fill available space. +Faz com que os itens cresçam para preencher o espaço disponível. --- -It aligns items to the left side while leaving excessive space on the right side. +Alinha os itens ao lado esquerdo enquanto deixa espaço excessivo no lado direito. ## --video-solution-- diff --git a/curriculum/challenges/portuguese/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-k.md b/curriculum/challenges/portuguese/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-k.md index 7456af7346..c1385b2770 100644 --- a/curriculum/challenges/portuguese/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-k.md +++ b/curriculum/challenges/portuguese/16-the-odin-project/top-introduction-to-flexbox/introduction-flexbox-lesson-k.md @@ -17,12 +17,12 @@ Para mudar o posicionamento dos itens ao longo do eixo transversal, use `align-i Como `justify-content` e `align-items` são baseados no eixo principal e no eixo transversal do seu contêiner, o comportamento muda quando você muda a flex-direction de um contêiner flexível. Por exemplo, quando você altera `flex-direction` para `column`, `justify-content` alinha verticalmente e `align-items` alinha horizontalmente. O comportamento mais comum, no entanto, é o padrão, ou seja, `justify-content` alinha os itens na horizontal (pois o eixo principal é o horizontal por padrão) e `align-items` os alinha na vertical. Um dos maiores pontos de confusão para iniciantes com flexbox é quando esse comportamento muda. -# --question-- - -## --assignment-- +# --assignment-- Antes de passar para a próxima lição, veja se você consegue entender como `align-items` se comporta quando você muda a propriedade `flex-direction` para `column`. +# --question-- + ## --text-- Ao mudar a propriedade `flex-direction` para `column` em um contêiner flexível, como `align-items` se comporta em relação aos itens flexíveis? diff --git a/curriculum/challenges/portuguese/16-the-odin-project/top-learn-arrays-and-loops/learn-arrays-and-loops-lesson-a.md b/curriculum/challenges/portuguese/16-the-odin-project/top-learn-arrays-and-loops/learn-arrays-and-loops-lesson-a.md index e10900ecdf..24ffbd8f43 100644 --- a/curriculum/challenges/portuguese/16-the-odin-project/top-learn-arrays-and-loops/learn-arrays-and-loops-lesson-a.md +++ b/curriculum/challenges/portuguese/16-the-odin-project/top-learn-arrays-and-loops/learn-arrays-and-loops-lesson-a.md @@ -7,11 +7,11 @@ dashedName: learn-arrays-and-loops-lesson-a # --description-- -Strings and numbers may be our building blocks, but as your scripts get more complex, you're going to need a way to deal with large quantities of them. Luckily, JavaScript has a couple of data types that are used for just that. An Array is an ordered collection of items (Strings, numbers, or other things). +Strings e números podem ser nossos blocos de construção, mas à medida que seus scripts se tornam mais complexos, você vai precisar de uma maneira de lidar com grandes quantidades deles. Felizmente, o JavaScript possui alguns tipos de dados que são utilizados exatamente para isso. Um array é uma coleção ordenada de itens (strings, números ou outras coisas). -Arrays are a way to store multiple values in a single variable. They are a special type of object that has a length property and a series of numbered properties. Each numbered property is called an element, and each element can store a value of any type. +Arrays são uma maneira de armazenar múltiplos valores em uma única variável. Eles são um tipo especial de objeto que possui uma propriedade length e uma série de propriedades numeradas. Cada propriedade numerada é chamada de elemento. Cada elemento pode armazenar um valor de qualquer tipo. -An Example of an array is: +Um exemplo de um array é: ```javascript const fruits = ['apple', 'banana', 'orange']; @@ -21,23 +21,23 @@ const fruits = ['apple', 'banana', 'orange']; ## --text-- -What is an array in JavaScript? +O que é um array no JavaScript? ## --answers-- -A function that stores multiple strings and numbers. +Uma função que armazena múltiplos strings e números. --- -A data type used exclusively for numerical operations. +Um tipo de dado usado exclusivamente para operações numéricas. --- -An ordered collection of items that can store values of any type, including strings and numbers. +Uma coleção ordenada de itens que pode armazenar valores de qualquer tipo, incluindo strings e números. --- -A variable that can only store string values. +Uma variável que só pode armazenar valores de string. ## --video-solution-- diff --git a/curriculum/challenges/portuguese/16-the-odin-project/top-learn-arrays-and-loops/learn-arrays-and-loops-lesson-c.md b/curriculum/challenges/portuguese/16-the-odin-project/top-learn-arrays-and-loops/learn-arrays-and-loops-lesson-c.md index 77689a7e3b..9ac95b743d 100644 --- a/curriculum/challenges/portuguese/16-the-odin-project/top-learn-arrays-and-loops/learn-arrays-and-loops-lesson-c.md +++ b/curriculum/challenges/portuguese/16-the-odin-project/top-learn-arrays-and-loops/learn-arrays-and-loops-lesson-c.md @@ -1,15 +1,15 @@ --- id: 661e27578602567c118451d3 -title: Learn Arrays and Loops Lesson C +title: Lição C de Aprenda arrays e laços challengeType: 15 dashedName: learn-arrays-and-loops-lesson-c --- # --description-- -One of the most common ways to add a new element to an array is by using the `push()` method. The `push()` method adds one or more elements to the end of an array and returns the new length of the array. +Uma das maneiras mais comuns de adicionar um novo elemento a um array é usando o método `push()`. O método `push()` adiciona um ou mais elementos ao final de um array e retorna o novo comprimento do array. -For example, to add a new element to the `pet` array, you can use the following code: +Por exemplo, para adicionar um novo elemento ao array `pet`, você pode usar o seguinte código: ```javascript const pet = ['cat', 'dog', 'bunny']; @@ -17,9 +17,9 @@ pet.push('parrot'); console.log(pet); // Output: ['cat', 'dog', 'bunny', 'parrot'] ``` -To remove the last element of an array, you can use the `pop()` method. The `pop()` method removes the last element from an array and returns that element. +Para remover o último elemento de um array, você pode usar o método `pop()`. O método `pop()` remove o último elemento de um array e retorna aquele elemento. -For example, to remove the last element from the `pet` array, you can use the following code: +Por exemplo, para remover o último elemento do array `pet`, você pode usar o seguinte código: ```javascript const pet = ['cat', 'dog', 'tiger']; @@ -32,7 +32,7 @@ console.log(pet); // Output: ['cat', 'dog'] ## --text-- -Given the following JavaScript code, what will be the output after executing the code snippet? +Dado o seguinte código em JavaScript, qual será a saída após a execução do trecho de código? ```javascript const animals = ['deer', 'whale', 'frog']; @@ -45,19 +45,19 @@ console.log(removed); ## --answers-- -`['deer', 'whale', 'frog', 'shark', 'bear']` and `'bear'` +`['deer', 'whale', 'frog', 'shark', 'bear']` e `'bear'` --- -`['deer', 'whale', 'frog', 'shark']` and `'bear'` +`['deer', 'whale', 'frog', 'shark']` e `'bear'` --- -`['deer', 'whale', 'frog', 'shark', 'bear']` and `null` +`['deer', 'whale', 'frog', 'shark', 'bear']` e `null` --- -`['deer', 'whale', 'frog', 'shark', 'bear']` and `['deer', 'whale', 'frog', 'shark']` +`['deer', 'whale', 'frog', 'shark', 'bear']` e `['deer', 'whale', 'frog', 'shark']` ## --video-solution-- diff --git a/curriculum/challenges/portuguese/16-the-odin-project/top-learn-arrays-and-loops/learn-arrays-and-loops-lesson-d.md b/curriculum/challenges/portuguese/16-the-odin-project/top-learn-arrays-and-loops/learn-arrays-and-loops-lesson-d.md index 3954469401..762c29fc5e 100644 --- a/curriculum/challenges/portuguese/16-the-odin-project/top-learn-arrays-and-loops/learn-arrays-and-loops-lesson-d.md +++ b/curriculum/challenges/portuguese/16-the-odin-project/top-learn-arrays-and-loops/learn-arrays-and-loops-lesson-d.md @@ -1,15 +1,15 @@ --- id: 661e27588602567c118451d4 -title: Learn Arrays and Loops Lesson D +title: Lição D de Aprenda arrays e laços challengeType: 15 dashedName: learn-arrays-and-loops-lesson-d --- # --description-- -One of the more complex methods used with arrays are the `splice()` and `slice()` methods. The `splice()` method changes the contents of an array by removing or replacing an element in the array. The `slice()` method returns a shallow copy of a portion of an array into a new array object selected from `begin` to `end` (`end` not included). The original array will not be modified. +Entre os métodos mais complexos usados com arrays estão os métodos `splice()` e `slice()`. O método `splice()` altera o conteúdo de um array removendo ou substituindo um elemento no array. O método `slice()` retorna uma cópia rasa de uma porção de um array em um novo objeto de array selecionado de `begin` até `end` (não incluindo `end`). O array original não será modificado. -For example, to remove the second element from the `characters` array, you can use the following code: +Por exemplo, para remover o segundo elemento do array `characters`, você pode usar o seguinte código: ```javascript const characters = ['Harry', 'Ron', 'Hermione']; @@ -17,10 +17,10 @@ characters.splice(1, 1); console.log(characters); // Output: ['Harry', 'Hermione'] ``` -The above element removes the second element from the `characters` array. The `splice()` method takes two arguments: the index of the element to remove and the number of elements to remove. +O elemento acima remove o segundo elemento do array `characters`. O método `splice()` recebe dois argumentos: o índice do elemento a ser removido e o número de elementos a remover. -To create a new array with the second element from the `character` array, you can use the following code: +Para criar um array com o segundo elemento do array `character`, você pode usar o seguinte código: ```javascript const characters = ['Harry', 'Ron', 'Hermione']; @@ -28,13 +28,13 @@ const newCharacters = characters.slice(1, 2); console.log(newCharacters); // Output: ['Ron'] ``` -The above code creates a new array `newCharacters` with the second element from the `characters` array. The `slice()` method takes two arguments: the index of the element to start the slice and the index of the element to end the slice (not included). +O código acima cria um array `newCharacters` com o segundo elemento do array `characters`. O método `slice()` recebe dois argumentos: o índice do elemento para iniciar o corte e o índice do elemento para terminar o corte (não incluído). # --question-- ## --text-- -What will be the output of the following JavaScript code snippet? +Qual será a saída do seguinte trecho de código em JavaScript? ```javascript @@ -48,19 +48,19 @@ console.log(slicedNumbers); ## --answers-- -`numbers` output: `[10, 20, 30, 50]` and `slicedNumbers` output: `[30, 50]` +Saída de `numbers`: `[10, 20, 30, 50]`. Saída de `slicedNumbers`: `[30, 50]` --- -`numbers` output: `[10, 20, 30, 40]` and `slicedNumbers` output: `[30, 40]` +Saída de `numbers`: `[10, 20, 30, 40]`. Saída de `slicedNumbers`: `[30, 40]` --- -`numbers` output: `[10, 20, 50, 40]` and `slicedNumbers` output: `[20, 50]` +Saída de `numbers`: `[10, 20, 50, 40]`. Saída de `slicedNumbers`: `[20, 50]` --- -`numbers` output: `[10, 20, 30, 50, 40]` and `slicedNumbers` output: `[30, 50]` +Saída de `numbers`: `[10, 20, 30, 50, 40]`. Saída de `slicedNumbers`: `[30, 50]` ## --video-solution-- diff --git a/curriculum/challenges/portuguese/16-the-odin-project/top-learn-arrays-and-loops/learn-arrays-and-loops-lesson-e.md b/curriculum/challenges/portuguese/16-the-odin-project/top-learn-arrays-and-loops/learn-arrays-and-loops-lesson-e.md index 28382318c1..1dfe0f83b8 100644 --- a/curriculum/challenges/portuguese/16-the-odin-project/top-learn-arrays-and-loops/learn-arrays-and-loops-lesson-e.md +++ b/curriculum/challenges/portuguese/16-the-odin-project/top-learn-arrays-and-loops/learn-arrays-and-loops-lesson-e.md @@ -1,13 +1,13 @@ --- id: 661e27588602567c118451d5 -title: Learn Arrays and Loops Lesson E +title: Lição E de Aprenda arrays e laços challengeType: 15 dashedName: learn-arrays-and-loops-lesson-e --- # --description-- -Now that you have a basic understanding about arrays, let's talk about loops. Loops are used to execute a block of code multiple times. One of those loops is the `while` loop. The `while` loop executes a block of code as long as the condition is true. The syntax of the `while` loop is as follows: +Agora que você tem um entendimento básico sobre arrays, vamos falar sobre laços. Laços são usados para executar um bloco de código várias vezes. Um desses laços é o laço `while`. O laço `while` executa um bloco de código enquanto a condição for verdadeira. A sintaxe do laço `while` é a seguinte: ```javascript while (condition) { @@ -15,7 +15,7 @@ while (condition) { } ``` -For example, the following code snippet prints the numbers from 1 to 5: +Por exemplo, o seguinte trecho de código imprime os números de 1 a 5: ```javascript let i = 1; @@ -25,13 +25,13 @@ while (i <= 5) { } ``` -The above code snippet initializes a variable `i` with the value `1`. The `while` loop executes the block of code as long as the value of `i` is less than or equal to `5`. The value of `i` is incremented by `1` in each iteration. +O trecho de código acima inicializa uma variável `i` com o valor `1`. O laço `while` executa o bloco de código enquanto o valor de `i` for menor ou igual a `5`. O valor de `i` é incrementado em `1` em cada iteração. # --question-- ## --text-- -What will be the output of the following JavaScript code snippet? +Qual será a saída do seguinte trecho de código JavaScript? ```javascript let i = 5; diff --git a/curriculum/challenges/portuguese/16-the-odin-project/top-learn-arrays-and-loops/learn-arrays-and-loops-lesson-f.md b/curriculum/challenges/portuguese/16-the-odin-project/top-learn-arrays-and-loops/learn-arrays-and-loops-lesson-f.md index 3556f1aa5b..30d7083dfa 100644 --- a/curriculum/challenges/portuguese/16-the-odin-project/top-learn-arrays-and-loops/learn-arrays-and-loops-lesson-f.md +++ b/curriculum/challenges/portuguese/16-the-odin-project/top-learn-arrays-and-loops/learn-arrays-and-loops-lesson-f.md @@ -7,7 +7,7 @@ dashedName: learn-arrays-and-loops-lesson-f # --description-- -The `for` loop is another type of loop that is used to execute a block of code multiple times. The `for` loop is used when the number of iterations is known. The syntax of the `for` loop is as follows: +O laço `for` é outro tipo de laço usado para executar um bloco de código várias vezes. O laço `for` é usado quando o número de iterações é conhecido. A sintaxe do laço `for` é a seguinte: ```javascript for (initialization; condition; increment/decrement) { @@ -15,7 +15,7 @@ for (initialization; condition; increment/decrement) { } ``` -For example, the following code snippet prints the numbers from 1 to 5: +Por exemplo, o seguinte trecho de código imprime os números de 1 a 5: ```javascript for (let i = 1; i <= 5; i++) { @@ -23,7 +23,7 @@ for (let i = 1; i <= 5; i++) { } ``` -To iterate over an array using a `for` loop, you can use the array's length property. For example, the following code snippet prints the elements of an array: +Para iterar sobre um array usando um laço `for`, você pode usar a propriedade length do array. Por exemplo, o seguinte trecho de código imprime os elementos de um array: ```javascript const arr = [1, 2, 3, 4, 5]; @@ -36,7 +36,7 @@ for (let i = 0; i < arr.length; i++) { ## --text-- -What will be the output of the following JavaScript code snippet? +Qual será a saída do seguinte trecho de código JavaScript? ```javascript const items = ['apple', 'banana', 'cherry', 'date']; diff --git a/curriculum/challenges/portuguese/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-b.md b/curriculum/challenges/portuguese/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-b.md index c61646de36..904a46be25 100644 --- a/curriculum/challenges/portuguese/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-b.md +++ b/curriculum/challenges/portuguese/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-b.md @@ -9,12 +9,12 @@ dashedName: learn-block-and-inline-lesson-b Elementos inline, no entanto, não começam em uma nova linha. Eles aparecem na linha com quaisquer elementos ao lado dos quais são colocados. Um exemplo claro de um elemento inline é um link, ou tag ``. Se você inserir um desses no meio de um parágrafo de texto, ele se comportará como parte do parágrafo. (assim) O texto do link ficará ao lado de outras palavras nesse parágrafo. Além disso, padding e margem se comportam de maneira diferente em elementos inline. Em geral, você não deve tentar adicionar padding ou margem extra em elementos inline. -# --question-- - -## --assignment-- +# --assignment-- Procure na web uma lista de elementos `block` e uma lista de elementos `inline`. +# --question-- + ## --text-- Qual é a diferença entre um elemento `block` e um elemento `inline`? diff --git a/curriculum/challenges/portuguese/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-d.md b/curriculum/challenges/portuguese/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-d.md index 948f34ccd1..2ea301d885 100644 --- a/curriculum/challenges/portuguese/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-d.md +++ b/curriculum/challenges/portuguese/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-d.md @@ -7,29 +7,29 @@ dashedName: learn-block-and-inline-lesson-d # --description-- -Now that you have a basic understanding on how adding width and height to `inline` elements works, what happens when you add a top margin to an `inline` element? +Agora que você tem uma compreensão básica de como adicionar largura e altura a elementos `inline` funciona, o que acontece quando você adiciona uma margem superior a um elemento `inline`? # --question-- ## --text-- -How does `margin-top` affect `inline` elements? +Como `margin-top` afeta elementos `inline`? ## --answers-- -`margin-top` has no impact on the layout of `inline` elements +`margin-top` não tem impacto no layout de elementos `inline` --- -`margin-top` increases the height of `inline` elements. +`margin-top` aumenta a altura dos elementos `inline`. --- -`margin-top` adds space above the `inline` element. +`margin-top` adiciona espaço acima do elemento `inline`. --- -`margin-top` only affects the horizontal spacing of `inline` elements. +`margin-top` afeta apenas o espaçamento horizontal de elementos `inline`. ## --video-solution-- diff --git a/curriculum/challenges/portuguese/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-e.md b/curriculum/challenges/portuguese/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-e.md index edd07ca149..ec9f5efd1d 100644 --- a/curriculum/challenges/portuguese/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-e.md +++ b/curriculum/challenges/portuguese/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-e.md @@ -1,35 +1,35 @@ --- id: 6570447fe7b02272663824e3 -title: Learn Block and Inline Lesson E +title: Lição E de Aprenda sobre block e inline challengeType: 15 dashedName: learn-block-and-inline-lesson-e --- # --description-- -Inline-block elements behave like inline elements, but with block-style padding and margin. `display: inline-block` is a useful tool to know about, but in practice, you'll probably end up reaching for flexbox more often if you're trying to line up a bunch of boxes. Flexbox will be covered in-depth in the next lesson. +Elementos de inline-block se comportam como elementos inline, mas com preenchimento e margem em estilo de bloco. `display: inline-block` é uma ferramenta útil de se conhecer, mas na prática, você provavelmente acabará recorrendo ao flexbox com mais frequência se estiver tentando alinhar um monte de caixas. Flexbox será tratado em mais detalhes na próxima lição. # --question-- ## --text-- -What is the difference between an `inline` element and an `inline-block` element? +Qual é a diferença entre um elemento `inline` e um elemento `inline-block`? ## --answers-- -`inline` elements are displayed without line breaks, while `inline-block` elements are displayed with line breaks. +Elementos `inline` são exibidos sem quebras de linha, enquanto elementos `inline-block` são exibidos com quebras de linha. --- -`inline` elements do not allow setting width and height, while `inline-block` elements allow setting width and height. +Elementos `inline` não permitem estabelecer largura e altura, enquanto elementos `inline-block` permitem estabelecer largura e altura. --- -`inline` elements are always positioned horizontally, while `inline-block` elements are positioned vertically. +Elementos `inline` estão sempre posicionados horizontalmente, enquanto elementos `inline-block` estão posicionados verticalmente. --- -`inline` elements can contain block-level elements, while `inline-block` elements cannot contain other elements. +Elementos `inline` podem conter elementos de nível de bloco, enquanto elementos `inline-block` não podem conter outros elementos. ## --video-solution-- diff --git a/curriculum/challenges/portuguese/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-f.md b/curriculum/challenges/portuguese/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-f.md index 4a04c7adaa..1ebb1d8f24 100644 --- a/curriculum/challenges/portuguese/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-f.md +++ b/curriculum/challenges/portuguese/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-f.md @@ -7,29 +7,29 @@ dashedName: learn-block-and-inline-lesson-f # --description-- -The concept of “Normal flow” is implied in the box-model resources, but isn’t laid out very specifically. Read Normal Flow from MDN to make sure you understand how elements lay themselves out by default. +O conceito de “Fluxo normal” é implícito nos recursos do modelo de caixas, mas não é apresentado de modo muito específico. Leia Fluxo Normal do MDN para garantir que você compreende como os elementos se dispõem por padrão. # --question-- ## --text-- -What is the "Normal flow" in CSS layouts? +O que é o "Fluxo normal" em layouts do CSS? ## --answers-- -Normal flow refers to the process of animating elements in a CSS layout. +Fluxo normal refere-se ao processo de animação de elementos em um layout do CSS. --- -Normal flow is a CSS property used to control the visibility of elements in a layout. +Fluxo normal é uma propriedade do CSS usada para controlar a visibilidade dos elementos em um layout. --- -Normal flow is a CSS rule that defines the order of media queries for responsive design. +Fluxo normal é uma regra do CSS que define a ordem das media queries para design responsivo. --- -Normal flow in CSS layouts refers to the default positioning of elements on a webpage. +Fluxo normal em layouts do CSS refere-se ao posicionamento padrão dos elementos em uma página da web. ## --video-solution-- diff --git a/curriculum/challenges/portuguese/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-g.md b/curriculum/challenges/portuguese/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-g.md index 1fb356f0bd..a280a254f8 100644 --- a/curriculum/challenges/portuguese/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-g.md +++ b/curriculum/challenges/portuguese/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-g.md @@ -7,7 +7,7 @@ dashedName: learn-block-and-inline-lesson-g # --description-- -Agora que você tem algum entendimento básico de elementos `block` e `inline`, pegue sua lista de elementos `block` e `inline` de algumas perguntas atrás e veja se consegue identificar quais dos elementos a seguir são elementos `block` e quais são elementos `inline`. +Now that you have some basic understanding of `block` and `inline` elements, pull up your list of `block` and `inline` elements from a couple questions ago and see if you can identify which of the following elements are `block` elements and which are `inline` elements. # --question-- diff --git a/curriculum/challenges/portuguese/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-i.md b/curriculum/challenges/portuguese/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-i.md index 5c73752ebf..c2399c4508 100644 --- a/curriculum/challenges/portuguese/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-i.md +++ b/curriculum/challenges/portuguese/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-i.md @@ -7,25 +7,25 @@ dashedName: learn-block-and-inline-lesson-i # --description-- -You can't talk about `block` and `inline` elements without discussing `div`s and `span`s. All the other HTML elements you have encountered so far give meaning to their content. For example, paragraph elements tell the browser to display the text it contains as a paragraph. Strong elements tell the browser which texts within are important and so on. Yet, `div`s and `span`s give no particular meaning to their content. They are just generic boxes that can contain anything. +Você não pode falar sobre elementos `block` e `inline` sem discutir `div`s e `span`s. Todos os outros elementos HTML que você encontrou até agora dão significado ao seu conteúdo. Por exemplo, elementos de parágrafo informam ao navegador para exibir o texto que contém como um parágrafo. Elementos strong informam ao navegador quais textos dentro deles são importantes e assim por diante. Ainda assim, `div`s e `span`s não dão nenhum significado particular ao seu conteúdo. Eles são apenas caixas genéricas que podem conter qualquer coisa. # --question-- ## --text-- -What is the primary difference of `span` and `div` elements from other elements? +Qual é a diferença principal dos elementos `span` e `div` de outros elementos? ## --answers-- -Unlike specific HTML elements that carry inherent meanings, `span` and `div` elements are versatile and are primarily used for styling and layout purposes. +Ao contrário de elementos do HTML específicos que carregam significados inerentes, os elementos `span` e `div` são versáteis e são usados principalmente para fins de estilo e layout. --- -`span` and `div` elements do not impart any specific semantic meaning to the content they contain, unlike other HTML elements such as paragraphs or headings. +Os elementos `span` e `div` não transmitem nenhum significado semântico específico ao conteúdo que contêm, ao contrário de outros elementos HTML, como parágrafos ou cabeçalhos. --- -`span` and `div` elements are generic containers that allow developers to apply CSS styles and structure content without any particular semantic significance. +Os elementos `span` e `div` são contêineres genéricos que permitem aos desenvolvedores aplicar estilos CSS e estruturar conteúdo sem qualquer significado semântico particular. ## --video-solution-- diff --git a/curriculum/challenges/portuguese/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-j.md b/curriculum/challenges/portuguese/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-j.md index 5f6cd8f963..f545d0353f 100644 --- a/curriculum/challenges/portuguese/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-j.md +++ b/curriculum/challenges/portuguese/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-j.md @@ -1,35 +1,35 @@ --- id: 65704485e7b02272663824e8 -title: Learn Block and Inline Lesson J +title: Lição J de Aprenda sobre block e inline challengeType: 15 dashedName: learn-block-and-inline-lesson-j --- # --description-- -Now that you have a basic understanding on how adding width and height to `inline` elements works, what happens when you add a top padding of 10 pixels to a `span` element? +Agora que você tem um entendimento básico de como adicionar largura e altura a elementos `inline` funciona, o que acontece quando você adiciona um padding superior de 10 pixels a um elemento `span`? # --question-- ## --text-- -What happens when you add `padding-top: 10px;` to a `span` element? +O que acontece quando você adiciona `padding-top: 10px;` a um elemento `span`? ## --answers-- -The `span` element's content will shift downward by 10 pixels. +O conteúdo do elemento `span` se moverá para baixo por 10 pixels. --- -The `span` element will gain additional space above its content. +O elemento `span` ganhará espaço adicional acima do seu conteúdo. --- -The `span` element's width will increase by 10 pixels. +A largura do elemento `span` aumentará em 10 pixels. --- -Padding has no effect on the layout of a `span` element. +O padding não tem efeito no layout de um elemento `span`. ## --video-solution-- diff --git a/curriculum/challenges/portuguese/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-k.md b/curriculum/challenges/portuguese/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-k.md index 8a395de16e..37b79b9b72 100644 --- a/curriculum/challenges/portuguese/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-k.md +++ b/curriculum/challenges/portuguese/16-the-odin-project/top-learn-block-and-inline/learn-block-and-inline-lesson-k.md @@ -1,35 +1,35 @@ --- id: 65704486e7b02272663824e9 -title: Learn Block and Inline Lesson K +title: Lição K de Aprenda sobre block e inline challengeType: 15 dashedName: learn-block-and-inline-lesson-k --- # --description-- -Now that you have a basic understanding on how adding width and height to `inline` elements works. +Agora que você tem uma compreensão básica de como adicionar largura e altura aos elementos `inline` funciona. # --question-- ## --text-- -What happens when you add a bottom padding of 15 pixels to a `span` element with display set to `inline-block`? +O que acontece quando você adiciona um padding inferior de 15 pixels a um elemento `span` com exibição definida como `inline-block`? ## --answers-- -The `span` element's content will shift upward by 15 pixels. +O conteúdo do elemento `span` será deslocado para cima em 15 pixels. --- -The `span` element's width will increase by 15 pixels. +A largura do elemento `span` aumentará em 15 pixels. --- -The `span` element will gain additional space below its content. +O elemento `span` ganhará espaço adicional abaixo de seu conteúdo. --- -Padding has no effect on the layout of an `inline-block` `span` element. +Padding não tem efeito no layout de um elemento `span` `inline-block`. ## --video-solution-- diff --git a/curriculum/challenges/portuguese/16-the-odin-project/top-learn-css-foundations/css-foundations-lesson-a.md b/curriculum/challenges/portuguese/16-the-odin-project/top-learn-css-foundations/css-foundations-lesson-a.md index d24d018275..81c02bb299 100644 --- a/curriculum/challenges/portuguese/16-the-odin-project/top-learn-css-foundations/css-foundations-lesson-a.md +++ b/curriculum/challenges/portuguese/16-the-odin-project/top-learn-css-foundations/css-foundations-lesson-a.md @@ -8,7 +8,7 @@ dashedName: css-foundations-lesson-a # --description-- -A type selector (or element selector) will select all elements of the given element type, and the syntax is just the name of the element: +Um seletor de tipo (ou seletor de elemento) selecionará todos os elementos do tipo de elemento dado. A sintaxe é apenas o nome do elemento: ```html @@ -27,25 +27,25 @@ div { } ``` -Here, all three `
` elements would be selected, while the `

` element wouldn’t be. +Aqui, todos os três elementos `

` seriam selecionados, enquanto o elemento `

` não seria. # --question-- ## --text-- -Which of the following best describes the CSS code given above? +Qual das seguintes opções melhor descreve o código em CSS fornecido acima? ## --answers-- -The code applies a `white` color to all elements in the HTML file. +O código aplica uma cor `white` a todos os elementos do arquivo HTML. --- -The code applies a `white` color to all `div` elements in the HTML file. +O código aplica uma cor `white` a todos os elementos `div` do arquivo HTML. --- -The code applies a `white` color to all `p` elements in the HTML file. +O código aplica uma cor `white` a todos os elementos `p` do arquivo HTML. ## --video-solution-- diff --git a/curriculum/challenges/portuguese/16-the-odin-project/top-learn-css-foundations/css-foundations-lesson-d.md b/curriculum/challenges/portuguese/16-the-odin-project/top-learn-css-foundations/css-foundations-lesson-d.md index 9dc6044c89..09684c76e9 100644 --- a/curriculum/challenges/portuguese/16-the-odin-project/top-learn-css-foundations/css-foundations-lesson-d.md +++ b/curriculum/challenges/portuguese/16-the-odin-project/top-learn-css-foundations/css-foundations-lesson-d.md @@ -1,14 +1,14 @@ --- id: 63ee35300d8d4841c3a7091d videoId: LGQuIIv2RVA -title: CSS Foundations Lesson D +title: Lição D sobre Fundamentos de CSS challengeType: 15 dashedName: css-foundations-lesson-d --- # --description-- -Another way to use selectors is to chain them as a list without any separation. Let’s say you had the following HTML: +Outra forma de usar seletores é encadeá-los como uma lista sem separação. Vamos dizer que você tem o seguinte HTML: ```html

@@ -17,7 +17,7 @@ Another way to use selectors is to chain them as a list without any separation.
``` -You have two elements with the `subsection` class that have some sort of unique styles, but what if you only want to apply a separate rule to the element that also has `header` as a second class? Well, you could chain both the `class` selectors together in your CSS like so: +Você tem dois elementos com a classe `subsection` que têm algum tipo de estilo único, mas o que você pode fazer se quiser apenas aplicar uma regra separada para o elemento que também tem `header` como uma segunda classe? Bem, você pode encadear ambos os seletores `class` no CSS assim: ```css .subsection.header { @@ -25,9 +25,9 @@ You have two elements with the `subsection` class that have some sort of unique } ``` -What `.subsection.header` does is it selects any element that has both the `subsection` and `header` classes. Notice how there isn’t any space between the `.subsection` and `.header` `class` selectors. This syntax basically works for chaining any combination of selectors, except for chaining more than one type selector. +O que `.subsection.header` faz é selecionar qualquer elemento que tenha as classes `subsection` e `header`. Observe como não há espaço entre os seletores `class` `.subsection` e `.header`. Essa sintaxe basicamente funciona para encadear qualquer combinação de seletores, exceto para encadear mais de um seletor de tipos. -This can also be used to chain a class and an ID, as shown below: +Isso também pode ser usado para encadear uma classe e um id, como mostrado abaixo: ```html
@@ -36,7 +36,7 @@ This can also be used to chain a class and an ID, as shown below:
``` -You can take the two elements above and combine them with the following: +Você pode pegar os dois elementos acima e combiná-los assim: ```css .subsection.header { @@ -48,13 +48,13 @@ You can take the two elements above and combine them with the following: } ``` -In general, you can’t chain more than one type selector since an element can’t be two different types at once. For example, chaining two type selectors like `div` and `p` would give us the selector `divp`, which wouldn’t work since the selector would try to find a literal `` element, which doesn’t exist. +Geralmente, você não pode encadear mais de um tipo de seletor, já que um elemento não pode ter dois tipos diferentes de uma vez. Por exemplo, encadear dois seletores de tipo como `div` e `p` nos daria o seletor `divp`, que não funcionaria porque o seletor tentaria encontrar um elemento literal, ``, que não existe. # --question-- ## --text-- -Given an element that has an `id` of `title` and a `class` of `primary`, how would you use both attributes for a single rule? +Dado o elemento que tem um `id` `title` e uma `class` `primary`, como você usaria os dois atributos em uma única regra? ## --answers-- diff --git a/curriculum/challenges/portuguese/16-the-odin-project/top-learn-css-foundations/css-foundations-lesson-e.md b/curriculum/challenges/portuguese/16-the-odin-project/top-learn-css-foundations/css-foundations-lesson-e.md index f813f0f3f4..77b57c8c94 100644 --- a/curriculum/challenges/portuguese/16-the-odin-project/top-learn-css-foundations/css-foundations-lesson-e.md +++ b/curriculum/challenges/portuguese/16-the-odin-project/top-learn-css-foundations/css-foundations-lesson-e.md @@ -1,16 +1,16 @@ --- id: 63ee35370d8d4841c3a7091e videoId: LGQuIIv2RVA -title: CSS Foundations Lesson E +title: Lição E de Fundamentos de CSS challengeType: 15 dashedName: css-foundations-lesson-e --- # --description-- -Combinators allow us to combine multiple selectors differently than either grouping or chaining them, as they show a relationship between the selectors. There are four types of combinators in total, but for right now we’re going to only show you the descendant combinator, which is represented in CSS by a single space between selectors. A descendant combinator will only cause elements that match the last selector to be selected if they also have an ancestor (parent, grandparent, etc) that matches the previous selector. +Combinadores nos permitem combinar vários seletores de modo diferente do que por agrupamento ou encadeamento, pois mostram uma relação entre os seletores. Existem quatro tipos de combinadores no total, mas, por enquanto, mostraremos apenas o combinador descendente, que é representado no CSS por um espaço único entre seletores. Um combinador de descendente fará com que elementos que coincidam com o último seletor sejam selecionados se também tiverem um ancestral (pai, avô etc.) que corresponda ao seletor anterior. -So something like `.ancestor .child` would select an element with the class `child` if it has an ancestor with the class `ancestor`. Another way to think of it is child will only be selected if it is nested inside of `ancestor`, no matter how deep. Take a quick look at the example below and see if you can tell which elements would be selected based on the CSS rule provided: +Então, algo como `.ancestor .child` selecionaria um elemento com a classe `child` se tiver um ancestral com a classe `ancestor`. Outro modo de pensar isso é imaginar que o filho só será selecionado se estiver aninhado dentro do `ancestor`, não importando o nível de aninhamento dentro desse ancestral. Dê uma olhada rápida no exemplo abaixo e veja se pode dizer quais elementos serão selecionados com base na regra de CSS fornecida: ```html @@ -33,27 +33,27 @@ So something like `.ancestor .child` would select an element with the class `chi } ``` -In the above example, the first two elements with the `contents` class (`B` and `C`) would be selected, but that last element (`D`) won’t be. Was your guess correct? +No exemplo acima, os dois primeiros elementos com a classe `contents` (`B` e `C`) seriam selecionados, mas o último elemento (`D`) não seria. Seu palpite estava correto? -There’s really no limit to how many combinators you can add to a rule, so `.one .two .three .four` would be totally valid. This would just select an element that has a class of `four` if it has an ancestor with a class of `three`, and if that ancestor has its own ancestor with a class of `two`, and so on. You generally want to avoid trying to select elements that need this level of nesting, though, as it can get pretty confusing and long, and it can cause issues when it comes to specificity. +Não há limite para quantos combinadores você pode adicionar a uma regra. `.one .two .three .four` seria totalmente válido. Isso apenas selecionaria um elemento que tem uma classe `four` se tiver um ancestral com uma classe de `three` e se aquele ancestral tiver seu próprio ancestral com a classe `two` e assim por diante. No entanto, você geralmente vai quer evitar tentar selecionar elementos que precisam deste nível de aninhamento, pois pode ficar muito confuso e longo, além de causar problemas quando se trata de especificidade. # --question-- ## --text-- -What does the descendant combinator do? +O que faz o combinador de descendente? ## --answers-- -It groups certain classes together which share the same declarations. +Ele agrupa certas classes que partilhem das mesmas declarações. --- -It gives the ability to select an element that shares the same `class` and `id`. +Ele dá a capacidade de selecionar um elemento que compartilhe a mesma `class` e o mesmo `id`. --- -It allows you to select an element based on its relationship with its ancestor (parent, grandparent, and so on). +Ele permite selecionar um elemento com base na sua relação com seu ancestral (pai, avô e assim por diante). ## --video-solution-- diff --git a/curriculum/challenges/portuguese/16-the-odin-project/top-learn-css-foundations/css-foundations-lesson-f.md b/curriculum/challenges/portuguese/16-the-odin-project/top-learn-css-foundations/css-foundations-lesson-f.md index 512036b1ab..71232a9a6c 100644 --- a/curriculum/challenges/portuguese/16-the-odin-project/top-learn-css-foundations/css-foundations-lesson-f.md +++ b/curriculum/challenges/portuguese/16-the-odin-project/top-learn-css-foundations/css-foundations-lesson-f.md @@ -1,45 +1,45 @@ --- id: 63ee353e0d8d4841c3a7091f videoId: LGQuIIv2RVA -title: CSS Foundations Lesson F +title: Lição F sobre Fundamentos de CSS challengeType: 15 dashedName: css-foundations-lesson-f --- # --description-- -Okay, you went over quite a bit so far. The only thing left for now is to go over how to add all this CSS to your HTML. There are three methods to do so. +Tudo bem, você já passou por um bocado até aqui. A única coisa que falta por enquanto é ver como adicionar esse CSS ao HTML. Existem três métodos para se fazer isso. -External CSS is the most common method you will come across, and it involves creating a separate file for the CSS and linking it inside of an HTML’s opening and closing `` tags with a self-closing `` element: +O CSS externo é o método mais comum que você encontrará. Ele envolve a criação de um arquivo separado para o CSS e a vinculação desse arquivo dentro das tags de abertura e fechamento de um elemento `` do HTML na forma de um elemento `` de fechamento próprio: -First, you add a self-closing `` element inside of the opening and closing `` tags of the HTML file. The `href` attribute is the location of the CSS file, either an absolute URL or, what you’ll be utilizing, a URL relative to the location of the HTML file. In the example above, you are assuming both files are located in the same directory. The `rel` attribute is required, and it specifies the relationship between the HTML file and the linked file. +Primeiro, você adiciona um elemento `` de fechamento próprio dentro das tags de abertura e fechamento de `` do arquivo HTML. O atributo `href` é o local do arquivo CSS, que pode ser um URL absoluto ou um URL relativo à localização do arquivo HTML (você usará essa última opção). No exemplo acima, você está assumindo que ambos os arquivos estão localizados no mesmo diretório. O atributo `rel` é necessário e especifica a relação entre o arquivo HTML e o arquivo vinculado. -Then inside of the newly created `styles.css` file, you have the selector (the `div` and `p`), followed by a pair of opening and closing curly braces, which create a “declaration block”. Finally, you place any declarations inside of the declaration block. `color: white;` is one declaration, with `color` being the property and `white` being the value, and `background-color: black;` is another declaration. +Então, dentro do arquivo de estilos recém-criado `styles.css`, você tem o seletor (`div` e `p`), seguido por um par de chaves de abertura e de fechamento, que criam um "bloco de declaração". Por fim, colocamos as declarações dentro do bloco da declaração. `color: white;` é uma declaração, com `color` sendo a propriedade e `white` o valor. `background-color: black;` é outra declaração. -A note on file names: `styles.css` is just what you went with as the file name here. You can name the file whatever you want as long as the file type is `.css`, though “style” or “styles” is most commonly used. +Uma observação sobre os nomes dos arquivos: `styles.css` é simplesmente um nome escolhido como nome do arquivo aqui. Você pode nomear o arquivo como quiser, desde que o tipo de arquivo seja `.css`. No entanto, "style" ou "styles" é o nome mais comumente usado. -A couple of the pros to this method are: +Algumas das vantagens desse método são: -1. It keeps your HTML and CSS separated, which results in the HTML file being smaller and making things look cleaner. -2. You only need to edit the CSS in one place, which is especially handy for websites with many pages that all share similar styles. +1. Ele mantém o HTML e o CSS separados, fazendo com que o arquivo HTML seja menor e mais limpo. +2. Você só precisa editar o CSS em um lugar, o que é especialmente útil para sites com muitas páginas e que compartilham estilos semelhantes. # --question-- ## --text-- -Which of the following best describes the purpose of the `rel` attribute in the `` element when linking an external CSS file to an HTML file? +Qual das opções a seguir melhor descreve a finalidade do atributo `rel` no elemento `` ao vincular um arquivo CSS externo a um arquivo HTML? ## --answers-- -It specifies the location of the CSS file relative to the location of the HTML file. +Ele especifica o local do arquivo do CSS com relação ao local do arquivo do HTML. --- -It specifies the relationship between the HTML file and the linked file. +Ele mostra a relação entre o arquivo do HTML e o documento vinculado. --- -It specifies the type of file being linked (e.g. "stylesheet"). +Ele especifica o tipo de arquivo que está sendo vinculado (por exemplo, "stylesheet" – ou folha de estilos). ## --video-solution-- diff --git a/curriculum/challenges/portuguese/16-the-odin-project/top-learn-css-foundations/css-foundations-lesson-g.md b/curriculum/challenges/portuguese/16-the-odin-project/top-learn-css-foundations/css-foundations-lesson-g.md index d31beea7a9..7ec9bfaf03 100644 --- a/curriculum/challenges/portuguese/16-the-odin-project/top-learn-css-foundations/css-foundations-lesson-g.md +++ b/curriculum/challenges/portuguese/16-the-odin-project/top-learn-css-foundations/css-foundations-lesson-g.md @@ -1,16 +1,16 @@ --- id: 63ee35450d8d4841c3a70920 videoId: LGQuIIv2RVA -title: CSS Foundations Lesson G +title: Lição G sobre Fundamentos de CSS challengeType: 15 dashedName: css-foundations-lesson-g --- # --description-- -Internal CSS (or embedded CSS) involves adding the CSS within the HTML file itself instead of creating a completely separate file. With the internal method, you place all the rules inside of a pair of opening and closing `