diff --git a/client/arabic/intro.json b/client/arabic/intro.json index 981cc3e1e1a..aaa8c2c6b40 100644 --- a/client/arabic/intro.json +++ b/client/arabic/intro.json @@ -1352,12 +1352,6 @@ "في هذه الورشة التي تضم 140 درسًا، ستكمل قاعدة بيانات الطلاب الخاصة بك مع التعمق في أوامر SQL." ] }, - "lab-world-cup-database": { - "title": "بناء قاعدة بيانات لكأس العالم", - "intro": [ - "في هذا المشروع، ستنشئ سكريبت Bash يدخل معلومات من مباريات كأس العالم إلى PostgreSQL، ثم تستعلم قاعدة البيانات للحصول على إحصائيات مفيدة." - ] - }, "workshop-kitty-ipsum-translator": { "title": "بناء مترجم Kitty Ipsum", "intro": [ @@ -1371,6 +1365,12 @@ "في هذه الورشة التي تضم 210 درسًا، ستبني برنامج Bash تفاعلي يخزن معلومات التأجير لمتجر تأجير الدراجات باستخدام PostgreSQL." ] }, + "lab-world-cup-database": { + "title": "بناء قاعدة بيانات لكأس العالم", + "intro": [ + "في هذا المشروع، ستنشئ سكريبت Bash يدخل معلومات من مباريات كأس العالم إلى PostgreSQL، ثم تستعلم قاعدة البيانات للحصول على إحصائيات مفيدة." + ] + }, "lab-salon-appointment-scheduler": { "title": "بناء برنامج جدولة مواعيد الصالون", "intro": [ @@ -2669,6 +2669,13 @@ "ستتمرن على الشرطيات لتحديد درجة الطالب بناءً على نتيجته." ] }, + "lab-story-fragment-restoration": { + "title": "استعادة سرد متماسك من مصفوفة من أجزاء القصة", + "intro": [ + "في هذه الورشة، ستستعيد سردًا متماسكًا من مصفوفة أجزاء قصة تالفة.", + "ستتمرن على العمل مع الحلقات من خلال تنفيذ خوارزميات مصفوفة أساسية من الصفر." + ] + }, "lecture-the-var-keyword-and-hoisting": { "title": "كلمة var والرفع", "intro": [ @@ -3774,18 +3781,18 @@ "تعلم نموذج الصندوق في CSS مع هذه الدورة. افهم كيف تُعرض العناصر على الويب، وتعلم التحكم في التباعد، الحدود، والحشو لتحقيق التخطيط والتصميم الذي تريده." ] }, - "top-introduction-to-flexbox": { - "title": "مقدمة إلى Flexbox", - "intro": [ - "اكتشف قوة Flexbox، نموذج التخطيط الذي يبسط تصميم تخطيطات الويب المرنة والمتجاوبة. تعلم كيفية إنشاء هياكل صفحات ديناميكية وقابلة للتكيف بسهولة." - ] - }, "top-learn-block-and-inline": { "title": "تعلم الفرق بين الكتلي والمضمّن", "intro": [ "استكشف الفروقات بين العناصر الكتلية والعناصر المضمّنة في HTML وCSS. توفر هذه الدورة رؤى حول كيفية تأثير أنواع العرض هذه على التخطيط والسلوك، مما يمكنك من اتخاذ قرارات تصميم مستنيرة." ] }, + "top-introduction-to-flexbox": { + "title": "مقدمة إلى Flexbox", + "intro": [ + "اكتشف قوة Flexbox، نموذج التخطيط الذي يبسط تصميم تخطيطات الويب المرنة والمتجاوبة. تعلم كيفية إنشاء هياكل صفحات ديناميكية وقابلة للتكيف بسهولة." + ] + }, "top-learn-variables-and-operators": { "title": "تعلم المتغيرات والعوامل", "intro": [ @@ -6287,12 +6294,6 @@ "ستتمرن على استخدام فئات المرافق في Tailwind CSS لتخطيطات flexbox والألوان ونقاط التوقف والمزيد." ] }, - "lab-photography-exhibit": { - "title": "تصميم معرض تصوير فوتوغرافي", - "intro": [ - "في هذا المختبر، ستتمرن على استخدام Tailwind CSS من خلال تصميم صفحة ويب لمعرض تصوير فوتوغرافي." - ] - }, "review-css-libraries-and-frameworks": { "title": "مراجعة مكتبات وإطارات CSS", "intro": [ @@ -6306,6 +6307,12 @@ "اختبر ما تعلمته عن مكتبات وإطارات CSS من خلال هذا الاختبار." ] }, + "lab-photography-exhibit": { + "title": "تصميم معرض تصوير فوتوغرافي", + "intro": [ + "في هذا المختبر، ستتمرن على استخدام Tailwind CSS من خلال تصميم صفحة ويب لمعرض تصوير فوتوغرافي." + ] + }, "lecture-introduction-to-typescript": { "title": "مقدمة إلى TypeScript", "intro": [ @@ -6372,18 +6379,6 @@ "في ورشة العمل هذه، ستواصل التمرن على العمل مع TypeScript من خلال بناء تطبيق قراءة الطالع." ] }, - "lab-flashcard-quiz-app": { - "title": "بناء تطبيق اختبار بطاقات تعليمية", - "intro": [ - "في هذا المختبر، ستتمرن على استخدام TypeScript من خلال بناء تطبيق اختبار بطاقات تعليمية." - ] - }, - "lab-digital-pet-game": { - "title": "بناء لعبة حيوان أليف رقمي", - "intro": [ - "في هذا المختبر، ستتمرن على ما تعلمته عن TypeScript وReact من خلال بناء لعبة حيوان أليف رقمي." - ] - }, "workshop-build-a-football-player-card-builder": { "title": "بناء منشئ بطاقة لاعب كرة قدم", "intro": [ @@ -6401,6 +6396,18 @@ "title": "اختبار TypeScript", "intro": ["اختبر ما تعلمته عن TypeScript من خلال هذا الاختبار."] }, + "lab-flashcard-quiz-app": { + "title": "بناء تطبيق اختبار بطاقات تعليمية", + "intro": [ + "في هذا المختبر، ستتمرن على استخدام TypeScript من خلال بناء تطبيق اختبار بطاقات تعليمية." + ] + }, + "lab-digital-pet-game": { + "title": "بناء لعبة حيوان أليف رقمي", + "intro": [ + "في هذا المختبر، ستتمرن على ما تعلمته عن TypeScript وReact من خلال بناء لعبة حيوان أليف رقمي." + ] + }, "review-front-end-libraries": { "title": "مراجعة مكتبات الواجهة الأمامية", "intro": [ @@ -7176,12 +7183,12 @@ "node-package-manager": "Node Package Manager", "lab-prime-number-checker-module": "بناء وحدة فاحص الأعداد الأولية", "http-and-the-web-standards-model": "HTTP ونموذج معايير الويب", - "rest-api-and-web-services": "REST API وخدمات الويب", - "lab-timestamp-microservice": "بناء خدمة مصغرة للطابع الزمني", "introduction-to-express": "مقدمة إلى Express", "lab-personal-profile-app": "بناء تطبيق الملف الشخصي", - "error-handling-in-express": "معالجة الأخطاء في Express", "express-middleware": "برمجيات وسيطة في Express", + "rest-api-and-web-services": "REST API وخدمات الويب", + "lab-timestamp-microservice": "بناء خدمة مصغرة للطابع الزمني", + "error-handling-in-express": "معالجة الأخطاء في Express", "websockets": "WebSockets", "lab-chat-app": "بناء تطبيق دردشة", "security-and-privacy": "الأمان والخصوصية", @@ -7192,109 +7199,91 @@ }, "module-intros": { "introduction-to-nodejs": { - "note": "قادم أواخر 2026", "intro": [ "في هذه الوحدة، ستتعلم أساسيات العمل مع Node.js." ] }, "nodejs-core-modules": { - "note": "قادم أواخر 2026", "intro": [ "في هذه الوحدة، ستتعرف على الوحدات الأساسية الشائعة في Node.js مثل fs وos وpath والمزيد. ثم ستتدرب على ما تعلمته من خلال ورش العمل والمختبرات وتختبر معرفتك في اختبار قصير." ] }, "node-package-manager": { - "note": "قادم أواخر 2026", "intro": [ "في هذه الوحدة، ستتعرف على مدير حزم Node، الذي يستخدمه المطوّرون لإدارة تبعيات المشروع والسكربتات. ثم ستتدرب على ما تعلمته من خلال ورش العمل والمختبرات وتختبر معرفتك في اختبار قصير." ] }, "lab-prime-number-checker-module": { - "note": "قادم أواخر 2026", "intro": [ "تمرن على بناء وتصدير وحدة NPM بإنشاء فاحص أعداد أولية" ] }, "http-and-the-web-standards-model": { - "note": "قادم أواخر 2026", "intro": [ "في هذه الوحدة، ستتعلم عن HTTP (بروتوكول نقل النص الفائق) ومفاهيم مهمة أخرى مثل نموذج الطلب-الاستجابة، رموز الاستجابة الشائعة، DNS، TCP/IP، والمزيد. ثم ستتدرب على ما تعلمته من خلال ورشة بناء خادم ويب خاص بك وتختبر معرفتك في اختبار قصير." ] }, - "rest-api-and-web-services": { - "note": "قادم أواخر 2026", + "introduction-to-express": { "intro": [ - "في هذه الوحدة، ستتعلم عن REST API (واجهة برمجة التطبيقات لنقل الحالة التمثيلية) وكيف تعمل الخدمات المصغرة. ثم ستجري اختبارًا قصيرًا لتقييم معرفتك." + "في هذه الوحدة، ستتعرف على Express.js، وهو إطار عمل يُستخدم لبناء واجهات RESTful. ثم ستتدرب على مهاراتك من خلال ورش العمل والمختبرات وتختبر معرفتك في اختبار قصير." ] }, - "lab-timestamp-microservice": { - "note": "قادم أواخر 2026", + "lab-personal-profile-app": { "intro": [ - "تمرن على بناء واجهة برمجة تطبيقات RESTful مع منطق تحليل التواريخ بإنشاء خدمة مصغرة للطابع الزمني" + "تمرن على بناء خادم Express وواجهة برمجة تطبيقات JSON بإنشاء تطبيق الملف الشخصي" ] }, - "introduction-to-express": { - "note": "قادم أواخر 2026", + "express-middleware": { "intro": [ - "في هذه الوحدة، ستتعرف على Express.js، وهو إطار عمل يُستخدم لبناء واجهات RESTful. ثم ستتدرب على مهاراتك من خلال ورش العمل والمختبرات وتختبر معرفتك في اختبار قصير." + "في هذه الوحدة، ستتعلم عن البرمجيات الوسيطة في Express.js، التي تُستخدم لمعالجة الطلبات والاستجابات بين العميل والخادم. ثم ستتدرب على مهاراتك من خلال ورشة عمل ومختبر وتختبر معرفتك في اختبار قصير." ] }, - "lab-personal-profile-app": { - "note": "قادم أواخر 2026", + "rest-api-and-web-services": { "intro": [ - "تمرن على بناء خادم Express وواجهة برمجة تطبيقات JSON بإنشاء تطبيق الملف الشخصي" + "في هذه الوحدة، ستتعلم عن REST API (واجهة برمجة التطبيقات لنقل الحالة التمثيلية) وكيف تعمل الخدمات المصغرة. ثم ستجري اختبارًا قصيرًا لتقييم معرفتك." ] }, - "error-handling-in-express": { - "note": "قادم أواخر 2026", + "lab-timestamp-microservice": { "intro": [ - "في هذه الوحدة، ستتعلم كيف تعمل معالجة الأخطاء، وتصحيح الأخطاء، وفحوصات الصحة في Express.js. ثم ستتدرب على ما تعلمته في مختبر وتختبر معرفتك في اختبار قصير." + "تمرن على بناء واجهة برمجة تطبيقات RESTful مع منطق تحليل التواريخ بإنشاء خدمة مصغرة للطابع الزمني" ] }, - "express-middleware": { - "note": "قادم أواخر 2026", + "error-handling-in-express": { "intro": [ - "في هذه الوحدة، ستتعلم عن البرمجيات الوسيطة في Express.js، التي تُستخدم لمعالجة الطلبات والاستجابات بين العميل والخادم. ثم ستتدرب على مهاراتك من خلال ورشة عمل ومختبر وتختبر معرفتك في اختبار قصير." + "في هذه الوحدة، ستتعلم كيف تعمل معالجة الأخطاء، وتصحيح الأخطاء، وفحوصات الصحة في Express.js. ثم ستتدرب على ما تعلمته في مختبر وتختبر معرفتك في اختبار قصير." ] }, "websockets": { - "note": "قادم أواخر 2026", "intro": [ "في هذه الوحدة، ستتعرف على WebSockets، وهو بروتوكول يُستخدم للتواصل الفوري بين العميل والخادم. ثم ستتدرب على ما تعلمته في المختبرات وورش العمل وتختبر معرفتك في اختبار قصير." ] }, "lab-chat-app": { - "note": "قادم أواخر 2026", "intro": [ "تمرن على بناء خادم دردشة متعدد العملاء في الوقت الحقيقي باستخدام WebSockets في Node.js" ] }, "security-and-privacy": { - "note": "قادم أواخر 2026", "intro": [ "في هذه الوحدة، ستتعلم الفرق بين الأمان والخصوصية بالإضافة إلى مفاهيم أخرى مثل CSPs، سياسات الأذونات، المعلومات الشخصية القابلة للتعريف، العمل مع CORS، والمزيد. ثم ستجري اختبارًا قصيرًا لتقييم معرفتك." ] }, "authentication": { - "note": "قادم أواخر 2026", "intro": [ "في هذه الوحدة، ستتعلم كيف يعمل التوثيق في تطبيقات الويب إلى جانب مفاهيم مهمة أخرى مثل JWTs، CSRFs، Passport، Helmet، التشفير، والمزيد. ثم ستتدرب على ما تعلمته في المختبرات وورش العمل وتختبر معرفتك في اختبار قصير." ] }, "lab-family-movie-watchlist-api": { - "note": "قادم أواخر 2026", "intro": [ "تمرن على تنفيذ التوثيق والتفويض في تطبيق Express ببناء واجهة برمجة تطبيقات لقائمة مشاهدة أفلام عائلية" ] }, "back-end-development-and-apis-certification-exam": { - "note": "قادم أواخر 2026", "intro": [ "اجتز هذا الاختبار لتحصل على شهادة تطوير الواجهة الخلفية وواجهات برمجة التطبيقات." ] }, "review-back-end-development-and-apis": { - "note": "تصدر أواخر 2026", "intro": [ "راجع مفاهيم تطوير الواجهة الخلفية وواجهات برمجة التطبيقات للتحضير للاختبار القادم." ] @@ -7302,7 +7291,7 @@ }, "blocks": { "lecture-working-with-nodejs-and-event-driven-architecture": { - "title": "العمل مع NodeJS والهندسة المعمارية المعتمدة على الأحداث", + "title": "العمل مع Node.js والعمارة المعتمدة على الأحداث", "intro": [ "تعرف على مكتبات Node.js الأساسية، كيفية تثبيت Node.js على جهازك، ومزايا وعيوب استخدام Node.js في الواجهة الخلفية." ] @@ -7416,24 +7405,6 @@ "" ] }, - "lecture-understanding-rest-api-and-web-services": { - "title": "فهم REST API وخدمات الويب", - "intro": [ - "في هذه الدروس، ستتعلم عن REST APIs وخدمات الويب، وكيف تسمح لتطبيقات مختلفة بالتواصل مع بعضها عبر الإنترنت." - ] - }, - "workshop-build-a-weather-service-api": { - "title": "بناء واجهة برمجة تطبيقات خدمة الطقس", - "intro": [ - "ستتعلم معلمات المسار والتوجيه المعياري باستخدام express.Router من خلال بناء واجهة برمجة تطبيقات خدمة الطقس." - ] - }, - "lab-timestamp-microservice": { - "title": "بناء خدمة مصغرة للطابع الزمني", - "intro": [ - "تمرن على بناء RESTful API مع منطق تحليل التواريخ بإنشاء خدمة مصغرة للطابع الزمني." - ] - }, "lecture-working-with-express": { "title": "العمل مع Express", "intro": [ @@ -7453,16 +7424,10 @@ "ستتعلم التوجيه الأساسي في Express وطرق الاستجابة من خلال بناء تطبيق نكات عشوائية." ] }, - "lab-personal-profile-app": { - "title": "بناء تطبيق ملف شخصي", - "intro": [ - "تمرن على بناء خادم Express وJSON API بإنشاء تطبيق ملف شخصي شخصي." - ] - }, "review-introduction-to-express": { "title": "مراجعة مقدمة إلى Express", "intro": [ - "راجع خدمات الويب وREST والخدمات المصغرة وتوجيه Express.js قبل أداء الاختبار." + "راجع Express.js، التوجيه، طرق الاستجابة، وخدمة الملفات الثابتة قبل أداء الاختبار القصير." ] }, "quiz-introduction-to-express": { @@ -7471,28 +7436,10 @@ "اختبر معرفتك بخدمات الويب وREST والخدمات المصغرة وExpress.js والتوجيه." ] }, - "lecture-understanding-error-handling-and-health-checks": { - "title": "فهم معالجة الأخطاء وفحوصات الصحة", - "intro": [ - "في هذه الدروس، ستتعلم عن معالجة الأخطاء وفحوصات الصحة في Express." - ] - }, - "workshop-build-a-bank-api": { - "title": "بناء واجهة برمجة تطبيقات بنك", - "intro": [ - "ستتعلم التعامل مع الأخطاء في Express 5، وفحوصات الصحة، والإغلاق السلس من خلال بناء واجهة برمجة تطبيقات بنك." - ] - }, - "review-error-handling-in-express": { - "title": "مراجعة معالجة الأخطاء في Express", - "intro": [ - "راجع رموز حالة HTTP، ومعالجة الأخطاء، وتصحيح الأخطاء، والتسجيل، وفحوصات الصحة، والإغلاق السلس قبل أداء الاختبار." - ] - }, - "quiz-error-handling-in-express": { - "title": "اختبار معالجة الأخطاء في Express", + "lab-personal-profile-app": { + "title": "بناء تطبيق ملف شخصي", "intro": [ - "اختبر معرفتك برموز حالة HTTP، ومعالجة الأخطاء، وتصحيح الأخطاء، والتسجيل، وفحوصات الصحة، والإغلاق السلس." + "تمرن على بناء خادم Express وJSON API بإنشاء تطبيق ملف شخصي شخصي." ] }, "lecture-express-middleware": { @@ -7525,6 +7472,54 @@ "اختبر معرفتك بالبرمجيات الوسيطة في Express، بما في ذلك على مستوى التطبيق، والموجّه، ومعالجة الأخطاء، والبرمجيات الوسيطة المدمجة والخارجية." ] }, + "lecture-understanding-rest-api-and-web-services": { + "title": "فهم REST API وخدمات الويب", + "intro": [ + "في هذه الدروس، ستتعلم عن REST APIs وخدمات الويب، وكيف تسمح لتطبيقات مختلفة بالتواصل مع بعضها عبر الإنترنت." + ] + }, + "workshop-build-a-weather-service-api": { + "title": "بناء واجهة برمجة تطبيقات خدمة الطقس", + "intro": [ + "ستتعلم معلمات المسار والتوجيه المعياري باستخدام express.Router من خلال بناء واجهة برمجة تطبيقات خدمة الطقس." + ] + }, + "review-rest-api-and-web-services": { + "title": "مراجعة REST API وخدمات الويب", + "intro": [ + "راجع خدمات الويب، عمارة REST، رموز حالة HTTP، والخدمات المصغرة." + ] + }, + "lab-timestamp-microservice": { + "title": "بناء خدمة مصغرة للطابع الزمني", + "intro": [ + "تمرن على بناء RESTful API مع منطق تحليل التواريخ بإنشاء خدمة مصغرة للطابع الزمني." + ] + }, + "lecture-understanding-error-handling-and-health-checks": { + "title": "فهم معالجة الأخطاء وفحوصات الصحة", + "intro": [ + "في هذه الدروس، ستتعلم عن معالجة الأخطاء وفحوصات الصحة في Express." + ] + }, + "workshop-build-a-bank-api": { + "title": "بناء واجهة برمجة تطبيقات بنك", + "intro": [ + "ستتعلم التعامل مع الأخطاء في Express 5، وفحوصات الصحة، والإغلاق السلس من خلال بناء واجهة برمجة تطبيقات بنك." + ] + }, + "review-error-handling-in-express": { + "title": "مراجعة معالجة الأخطاء في Express", + "intro": [ + "راجع رموز حالة HTTP، ومعالجة الأخطاء، وتصحيح الأخطاء، والتسجيل، وفحوصات الصحة، والإغلاق السلس قبل أداء الاختبار." + ] + }, + "quiz-error-handling-in-express": { + "title": "اختبار معالجة الأخطاء في Express", + "intro": [ + "اختبر معرفتك برموز حالة HTTP، ومعالجة الأخطاء، وتصحيح الأخطاء، والتسجيل، وفحوصات الصحة، والإغلاق السلس." + ] + }, "lecture-understanding-websockets": { "title": "فهم WebSockets", "intro": [ @@ -8427,7 +8422,7 @@ "title": "تصميم قائمة مقهى", "intro": [ "يخبر CSS المتصفح بكيفية عرض صفحة الويب الخاصة بك. يمكنك استخدام CSS لتعيين اللون، الخط، الحجم، وجوانب أخرى لعناصر HTML.", - "في ورشة العمل هذه، ستتعلم CSS من خلال تصميم صفحة قائمة لموقع مقهى." + "في هذه الورشة، ستتعلم CSS من خلال تصميم صفحة قائمة لمقهى." ] }, "lab-business-card": { @@ -9695,7 +9690,7 @@ "title": "تصميم قائمة مقهى", "intro": [ "يخبر CSS المتصفح بكيفية عرض صفحة الويب الخاصة بك. يمكنك استخدام CSS لتعيين اللون، والخط، والحجم، وجوانب أخرى لعناصر HTML.", - "في ورشة العمل هذه، ستتعلم CSS من خلال تصميم صفحة قائمة لموقع مقهى." + "في هذه الورشة، ستتعلم CSS من خلال تصميم صفحة قائمة لمقهى." ] }, "lab-business-card": { diff --git a/client/arabic/translations.json b/client/arabic/translations.json index d7fec1811fd..32a63204f4f 100644 --- a/client/arabic/translations.json +++ b/client/arabic/translations.json @@ -558,6 +558,12 @@ "running-tests": "// جاري تشغيل الاختبارات", "tests-completed": "// تم الانتهاء من الاختبارات", "console-output": "// ناتج وحدة التحكم", + "unavailable-local-resource": "فشل تحميل المورد: \"{{source}}\" ليس ملف {{resourceType}} محلي متاح. استخدم: {{allowedSources}}.", + "unavailable-local-resource-no-allowed": "فشل تحميل المورد: \"{{source}}\" ليس ملف {{resourceType}} محلي متاح في هذا التحدٍّ.", + "local-resource-type": { + "stylesheet": "ورقة أنماط", + "script": "سكريبت" + }, "example-app": "ابنِ تطبيقًا يشبه <0>هذا المشروع المثال من حيث الوظائف. حاول ألا تنسخ المشروع المثال، بل أضف لمستك الشخصية.", "syntax-error": "شفرتك أظهرت خطأ قبل تشغيل أي اختبار. يرجى تصحيحه والمحاولة مجددًا.", "indentation-error": "شفرتك تحتوي على خطأ في التراجع. قد تحتاج إلى إضافة pass في سطر جديد لتكوين كتلة شفرة صحيحة.", @@ -656,25 +662,6 @@ "sub-step-7": "انقر زر <0>إضافة السر", "summary": "إعداد Codespaces" }, - "ona": { - "intro": "تُشغّل هذه الدورة في جهاز Linux افتراضي باستخدام Ona. اتبع هذه التعليمات لبدء الدورة:", - "step-1": "<0>أنشئ حساب Ona إذا لم يكن لديك واحد", - "step-2": "انقر زر البدء أدناه", - "step-3": "في النافذة المنبثقة، انقر زر الإنشاء", - "step-4": "عندما ينتهي تحميل جهاز Linux الافتراضي، ابدأ امتداد CodeRoad عن طريق:", - "step-5": "النقر على قائمة \"الهامبرغر\" قرب أعلى يسار نافذة VSCode،", - "step-6": "الذهاب إلى قائمة <0>العرض،", - "step-7": "النقر على خيار <0>لوحة الأوامر،", - "step-8": "وتشغيل الأمر <0>CodeRoad: Start", - "step-9": "اتبع التعليمات في CodeRoad لإكمال الدورة", - "continue-project": "النقر على زر البدء أدناه سيبدأ مشروعًا جديدًا. إذا بدأت سابقًا دورة {{course}}، اذهب إلى <0>لوحة تحكم Ona الخاصة بك للمتابعة.", - "learn-more": "تعرف على المزيد عن <0>مساحات عمل Ona.", - "logout-warning": "إذا سجلت الخروج من freeCodeCamp قبل إكمال دورة {{course}} بالكامل، فلن يتم حفظ تقدمك في حساب freeCodeCamp الخاص بك.", - "sub-step-3": "انتقل إلى <0>صفحة أسرار Ona الخاصة بك", - "sub-step-4": "أنشئ سرًا جديدًا باسم <0>CODEROAD_WEBHOOK_TOKEN", - "sub-step-5": "في حقل <0>السر، الصق رمزك", - "summary": "إعداد Ona" - }, "freecodecamp-os": { "token-modal": "عند تشغيل الدورة، ستظهر نافذة منبثقة تطلب رمز المستخدم الخاص بك. الصق الرمز الذي نسخته أعلاه فيها. تحتاج إلى فعل ذلك مرة واحدة فقط لكل بيئة عمل.", "local": { @@ -697,16 +684,6 @@ "step-5": "سيفتح المتصفح البسيط عند الانتهاء. إذا ظهرت صفحة بيضاء فارغة، استخدم زر التحديث لرؤيتها وتحديث صفحة البداية للدورة.", "step-6": "انقر على أحد المشاريع المتاحة لبدئه، ثم اتبع التعليمات في المشروع لإكماله.", "continue-project": "النقر على زر البدء أدناه سيشغل جهازًا جديدًا. إذا بدأت سابقًا دورة {{title}}، اذهب إلى <0>صفحة المستودع لإعادة فتح مساحة عمل سابقة." - }, - "ona": { - "intro": "تُشغّل هذه الدورة في جهاز لينكس افتراضي باستخدام Ona وامتداد freeCodeCamp - Courses لـ VS Code. اتبع هذه التعليمات لبدء الدورة:", - "step-1": "<0>أنشئ حساب Ona إذا لم يكن لديك واحد", - "step-2": "انقر زر البدء أدناه", - "step-3": "في النافذة المنبثقة، انقر زر الإنشاء", - "step-4": "عند انتهاء تحميل جهاز لينكس الافتراضي، افتح لوحة الأوامر وشغّل الأمر <0>freeCodeCamp: Run Course", - "step-5": "سيفتح المتصفح البسيط عند الانتهاء. إذا ظهرت صفحة بيضاء فارغة، استخدم زر التحديث لرؤيتها وتحديث صفحة البداية للدورة.", - "step-6": "انقر على أحد المشاريع المتاحة لبدئه، ثم اتبع التعليمات في المشروع لإكماله.", - "continue-project": "النقر على زر البدء أدناه سيشغل جهازًا جديدًا. إذا بدأت سابقًا دورة {{course}}، اذهب إلى <0>لوحة تحكم Ona الخاصة بك للمتابعة." } }, "local": { diff --git a/client/chinese-traditional/intro.json b/client/chinese-traditional/intro.json index 5bb7a871730..63ed58f3f56 100644 --- a/client/chinese-traditional/intro.json +++ b/client/chinese-traditional/intro.json @@ -1352,12 +1352,6 @@ "在這個包含 140 課的工作坊中,你將完成你的學生資料庫,並深入學習 SQL 命令。" ] }, - "lab-world-cup-database": { - "title": "建置世界盃資料庫", - "intro": [ - "在這個專案中,你將創建一個 Bash 腳本,將世界盃比賽資訊輸入 PostgreSQL,然後查詢資料庫以取得有用的統計資料。" - ] - }, "workshop-kitty-ipsum-translator": { "title": "建置 Kitty Ipsum 翻譯器", "intro": [ @@ -1371,6 +1365,12 @@ "在這個包含 210 課的工作坊中,你將建置一個互動式 Bash 程式,使用 PostgreSQL 儲存你的自行車租賃店的租賃資訊。" ] }, + "lab-world-cup-database": { + "title": "建置世界盃資料庫", + "intro": [ + "在這個專案中,你將創建一個 Bash 腳本,將世界盃比賽資訊輸入 PostgreSQL,然後查詢資料庫以取得有用的統計資料。" + ] + }, "lab-salon-appointment-scheduler": { "title": "建置沙龍預約排程器", "intro": [ @@ -2669,6 +2669,13 @@ "你將練習使用條件判斷,根據學生分數決定成績。" ] }, + "lab-story-fragment-restoration": { + "title": "從陣列故事片段還原連貫敘事", + "intro": [ + "在這個實驗中,你將從損壞的故事片段陣列還原出連貫的敘事。", + "你將透過從頭實作基本陣列演算法來練習使用迴圈。" + ] + }, "lecture-the-var-keyword-and-hoisting": { "title": "var 關鍵字與提升", "intro": [ @@ -3774,18 +3781,18 @@ "透過本課程學習 CSS 盒模型。了解元素如何在網頁上呈現,並學會操作間距、邊框與內距,達成理想的版面與設計。" ] }, - "top-introduction-to-flexbox": { - "title": "Flexbox 入門", - "intro": [ - "探索 Flexbox 的強大功能,這是一種簡化彈性且響應式網頁版面設計的模型。學習輕鬆建立動態且適應性的頁面結構。" - ] - }, "top-learn-block-and-inline": { "title": "學習區塊元素與行內元素的差異", "intro": [ "探索 HTML 和 CSS 中區塊元素與行內元素的區別。本課程提供這些顯示類型如何影響版面與行為的見解,讓你做出明智的設計決策。" ] }, + "top-introduction-to-flexbox": { + "title": "Flexbox 入門", + "intro": [ + "探索 Flexbox 的強大功能,這是一種簡化彈性且響應式網頁版面設計的模型。學習輕鬆建立動態且適應性的頁面結構。" + ] + }, "top-learn-variables-and-operators": { "title": "學習變數與運算子", "intro": [ @@ -6287,12 +6294,6 @@ "你將練習使用 Tailwind CSS 的彈性盒布局、顏色、斷點等工具類別。" ] }, - "lab-photography-exhibit": { - "title": "設計攝影展覽", - "intro": [ - "在這個實驗中,你將透過設計攝影展覽網頁練習使用 Tailwind CSS。" - ] - }, "review-css-libraries-and-frameworks": { "title": "CSS 函式庫與框架複習", "intro": [ @@ -6306,6 +6307,12 @@ "透過此測驗測試你對 CSS 函式庫與框架的理解。" ] }, + "lab-photography-exhibit": { + "title": "設計攝影展覽", + "intro": [ + "在這個實驗中,你將透過設計攝影展覽網頁練習使用 Tailwind CSS。" + ] + }, "lecture-introduction-to-typescript": { "title": "TypeScript 入門", "intro": [ @@ -6372,18 +6379,6 @@ "在這個工作坊中,你將繼續透過建置占卜應用程式來練習 TypeScript。" ] }, - "lab-flashcard-quiz-app": { - "title": "建置抽認卡測驗應用程式", - "intro": [ - "在這個實驗中,你將透過建置抽認卡測驗應用程式來練習使用 TypeScript。" - ] - }, - "lab-digital-pet-game": { - "title": "建置數位寵物遊戲", - "intro": [ - "在這個實驗中,你將透過建置數位寵物遊戲來練習你學到的 TypeScript 和 React。" - ] - }, "workshop-build-a-football-player-card-builder": { "title": "建置足球球員卡片建構器", "intro": [ @@ -6401,6 +6396,18 @@ "title": "TypeScript 測驗", "intro": ["透過這個測驗測試你對 TypeScript 的學習成果。"] }, + "lab-flashcard-quiz-app": { + "title": "建置抽認卡測驗應用程式", + "intro": [ + "在這個實驗中,你將透過建置抽認卡測驗應用程式來練習使用 TypeScript。" + ] + }, + "lab-digital-pet-game": { + "title": "建置數位寵物遊戲", + "intro": [ + "在這個實驗中,你將透過建置數位寵物遊戲來練習你學到的 TypeScript 和 React。" + ] + }, "review-front-end-libraries": { "title": "前端函式庫複習", "intro": [ @@ -7176,12 +7183,12 @@ "node-package-manager": "Node 套件管理器", "lab-prime-number-checker-module": "建置質數檢查模組", "http-and-the-web-standards-model": "HTTP 與網頁標準模型", - "rest-api-and-web-services": "REST API 與網路服務", - "lab-timestamp-microservice": "建置時間戳記微服務", "introduction-to-express": "Express 入門", "lab-personal-profile-app": "建置個人評測應用程式", - "error-handling-in-express": "Express 錯誤處理", "express-middleware": "Express 中介層", + "rest-api-and-web-services": "REST API 與網路服務", + "lab-timestamp-microservice": "建置時間戳記微服務", + "error-handling-in-express": "Express 錯誤處理", "websockets": "WebSockets", "lab-chat-app": "建置聊天應用程式", "security-and-privacy": "安全性與隱私", @@ -7192,109 +7199,91 @@ }, "module-intros": { "introduction-to-nodejs": { - "note": "預計 2026 年底推出", "intro": [ "在本模組中,你將學習 Node.js 的基礎操作。" ] }, "nodejs-core-modules": { - "note": "預計 2026 年底推出", "intro": [ "本模組介紹常見的 Node.js 核心模組,包括 fs、os、path 等。接著你將透過工作坊和實驗練習所學,並以短測驗檢驗你的知識。" ] }, "node-package-manager": { - "note": "預計 2026 年底推出", "intro": [ "本模組介紹 Node 套件管理器,開發者用它來管理專案依賴和腳本。接著你將透過工作坊和實驗練習所學,並以短測驗檢驗你的知識。" ] }, "lab-prime-number-checker-module": { - "note": "2026 年底推出", "intro": [ "透過建立質數檢查器練習建置與匯出 NPM 模組。" ] }, "http-and-the-web-standards-model": { - "note": "預計 2026 年底推出", "intro": [ "本模組介紹 HTTP(超文字傳輸協定)及其他重要概念,包括請求-回應模型、常見回應碼、DNS、TCP/IP 等。接著你將透過建置自己的網頁伺服器工作坊練習,並以短測驗檢驗你的知識。" ] }, - "rest-api-and-web-services": { - "note": "預計 2026 年底推出", + "introduction-to-express": { "intro": [ - "本模組介紹 REST API(表述性狀態轉移應用程式介面)及微服務運作方式。接著你將以短測驗檢驗你的知識。" + "本模組介紹 Express.js,一個用來建置 RESTful API 的框架。接著你將透過工作坊和實驗練習技能,並以短測驗檢驗你的知識。" ] }, - "lab-timestamp-microservice": { - "note": "2026 年底推出", + "lab-personal-profile-app": { "intro": [ - "透過建立時間戳記微服務練習建置具日期解析邏輯的 RESTful API。" + "透過建立個人評測應用程式練習建置 Express 伺服器與 JSON API。" ] }, - "introduction-to-express": { - "note": "預計 2026 年底推出", + "express-middleware": { "intro": [ - "本模組介紹 Express.js,一個用來建置 RESTful API 的框架。接著你將透過工作坊和實驗練習技能,並以短測驗檢驗你的知識。" + "本模組介紹 Express.js 的中介層,用於控制客戶端與伺服器間的請求與回應。你將透過工作坊和實驗練習技能,並以短測驗檢驗你的知識。" ] }, - "lab-personal-profile-app": { - "note": "2026 年底推出", + "rest-api-and-web-services": { "intro": [ - "透過建立個人評測應用程式練習建置 Express 伺服器與 JSON API。" + "本模組介紹 REST API(表述性狀態轉移應用程式介面)及微服務運作方式。接著你將以短測驗檢驗你的知識。" ] }, - "error-handling-in-express": { - "note": "預計 2026 年底推出", + "lab-timestamp-microservice": { "intro": [ - "本模組介紹 Express.js 中的錯誤處理、偵錯和健康檢查。你將在實驗中練習所學,並以短測驗檢驗你的知識。" + "透過建立時間戳記微服務練習建置具日期解析邏輯的 RESTful API。" ] }, - "express-middleware": { - "note": "預計 2026 年底推出", + "error-handling-in-express": { "intro": [ - "本模組介紹 Express.js 的中介層,用於控制客戶端與伺服器間的請求與回應。你將透過工作坊和實驗練習技能,並以短測驗檢驗你的知識。" + "本模組介紹 Express.js 中的錯誤處理、偵錯和健康檢查。你將在實驗中練習所學,並以短測驗檢驗你的知識。" ] }, "websockets": { - "note": "預計 2026 年底推出", "intro": [ "本模組介紹 WebSockets,一種用於客戶端與伺服器即時通訊的協定。你將在實驗和工作坊中練習所學,並以短測驗檢驗你的知識。" ] }, "lab-chat-app": { - "note": "2026 年底推出", "intro": [ "透過使用 Node.js WebSockets 建置即時多客戶端聊天伺服器來練習。" ] }, "security-and-privacy": { - "note": "預計 2026 年底推出", "intro": [ "本模組介紹安全性與隱私的差異,以及 CSP、權限政策、個人識別資訊、CORS 操作等概念。接著你將以短測驗檢驗你的知識。" ] }, "authentication": { - "note": "預計 2026 年底推出", "intro": [ "本模組介紹網頁應用程式的身份驗證運作方式,以及 JWT、CSRF、Passport、Helmet、密碼學與加密等重要概念。你將在實驗和工作坊中練習所學,並以短測驗檢驗你的知識。" ] }, "lab-family-movie-watchlist-api": { - "note": "2026 年底推出", "intro": [ "透過建置家庭電影清單 API 練習在 Express 應用程式中實作驗證與授權。" ] }, "back-end-development-and-apis-certification-exam": { - "note": "預計 2026 年底推出", "intro": [ "通過此考試以獲得你的後端開發與 API 認證。" ] }, "review-back-end-development-and-apis": { - "note": "2026 年底推出", "intro": [ "複習後端開發與 API 的概念,為即將到來的考試做準備。" ] @@ -7302,7 +7291,7 @@ }, "blocks": { "lecture-working-with-nodejs-and-event-driven-architecture": { - "title": "使用 NodeJS 與事件驅動架構", + "title": "使用 Node.js 與事件驅動架構", "intro": [ "了解 Node.js 核心函式庫、如何在電腦安裝 Node.js,以及使用 Node.js 作為後端的優缺點。" ] @@ -7416,24 +7405,6 @@ "" ] }, - "lecture-understanding-rest-api-and-web-services": { - "title": "理解 REST API 與網路服務", - "intro": [ - "在這些課程中,你將學習 REST API 和網路服務,以及它們如何讓不同應用程式透過網際網路互相通訊。" - ] - }, - "workshop-build-a-weather-service-api": { - "title": "建置天氣服務 API", - "intro": [ - "你將透過建置天氣服務 API,學習路由參數和使用 express.Router 的模組化路由。" - ] - }, - "lab-timestamp-microservice": { - "title": "建置時間戳記微服務", - "intro": [ - "透過建置時間戳記微服務,練習使用日期解析邏輯建構 RESTful API。" - ] - }, "lecture-working-with-express": { "title": "使用 Express", "intro": [ @@ -7453,16 +7424,10 @@ "你將透過建置隨機笑話應用程式,學習基本的 Express 路由和回應方法。" ] }, - "lab-personal-profile-app": { - "title": "建置個人資料應用程式", - "intro": [ - "透過建置個人資料應用程式,練習建構 Express 伺服器和 JSON API。" - ] - }, "review-introduction-to-express": { "title": "Express 入門複習", "intro": [ - "在進行測驗前,複習網路服務、REST、微服務和 Express.js 路由。" + "在測驗前複習 Express.js、路由、回應方法與靜態檔案服務。" ] }, "quiz-introduction-to-express": { @@ -7471,28 +7436,10 @@ "測試你對網路服務、REST、微服務、Express.js 和路由的知識。" ] }, - "lecture-understanding-error-handling-and-health-checks": { - "title": "理解錯誤處理與健康檢查", - "intro": [ - "在這些課程中,你將學習 Express 的錯誤處理和健康檢查。" - ] - }, - "workshop-build-a-bank-api": { - "title": "建置銀行 API", - "intro": [ - "你將透過建置銀行 API,學習 Express 5 的錯誤處理、健康檢查和優雅關閉。" - ] - }, - "review-error-handling-in-express": { - "title": "Express 錯誤處理複習", - "intro": [ - "在進行測驗前,複習 HTTP 狀態碼、錯誤處理、偵錯、記錄、健康檢查和優雅關閉。" - ] - }, - "quiz-error-handling-in-express": { - "title": "Express 錯誤處理測驗", + "lab-personal-profile-app": { + "title": "建置個人資料應用程式", "intro": [ - "測試你對 HTTP 狀態碼、錯誤處理、偵錯、記錄、健康檢查和優雅關閉的知識。" + "透過建置個人資料應用程式,練習建構 Express 伺服器和 JSON API。" ] }, "lecture-express-middleware": { @@ -7525,6 +7472,54 @@ "測試你對 Express 中介層的知識,包括應用程式層級、路由器層級、錯誤處理,以及內建和第三方中介層。" ] }, + "lecture-understanding-rest-api-and-web-services": { + "title": "理解 REST API 與網路服務", + "intro": [ + "在這些課程中,你將學習 REST API 和網路服務,以及它們如何讓不同應用程式透過網際網路互相通訊。" + ] + }, + "workshop-build-a-weather-service-api": { + "title": "建置天氣服務 API", + "intro": [ + "你將透過建置天氣服務 API,學習路由參數和使用 express.Router 的模組化路由。" + ] + }, + "review-rest-api-and-web-services": { + "title": "REST API 與網路服務複習", + "intro": [ + "複習網路服務、REST 架構、HTTP 狀態碼與微服務。" + ] + }, + "lab-timestamp-microservice": { + "title": "建置時間戳記微服務", + "intro": [ + "透過建置時間戳記微服務,練習使用日期解析邏輯建構 RESTful API。" + ] + }, + "lecture-understanding-error-handling-and-health-checks": { + "title": "理解錯誤處理與健康檢查", + "intro": [ + "在這些課程中,你將學習 Express 的錯誤處理和健康檢查。" + ] + }, + "workshop-build-a-bank-api": { + "title": "建置銀行 API", + "intro": [ + "你將透過建置銀行 API,學習 Express 5 的錯誤處理、健康檢查和優雅關閉。" + ] + }, + "review-error-handling-in-express": { + "title": "Express 錯誤處理複習", + "intro": [ + "在進行測驗前,複習 HTTP 狀態碼、錯誤處理、偵錯、記錄、健康檢查和優雅關閉。" + ] + }, + "quiz-error-handling-in-express": { + "title": "Express 錯誤處理測驗", + "intro": [ + "測試你對 HTTP 狀態碼、錯誤處理、偵錯、記錄、健康檢查和優雅關閉的知識。" + ] + }, "lecture-understanding-websockets": { "title": "理解 WebSockets", "intro": [ @@ -8427,7 +8422,7 @@ "title": "設計咖啡廳選單", "intro": [ "CSS 告訴瀏覽器如何顯示你的網頁。你可以用 CSS 設定 HTML 元素的顏色、字型、大小和其他屬性。", - "在這個工作坊中,你將透過設計咖啡廳網頁的選單頁面來學習 CSS。" + "在這個工作坊中,你將透過設計咖啡廳的選單頁面來學習 CSS。" ] }, "lab-business-card": { @@ -9695,7 +9690,7 @@ "title": "設計咖啡廳菜單", "intro": [ "CSS 告訴瀏覽器如何顯示你的網頁。你可以用 CSS 設定 HTML 元素的顏色、字型、大小和其他屬性。", - "在這個工作坊中,你將透過設計咖啡廳網頁的菜單頁面來學習 CSS。" + "在這個工作坊中,你將透過設計咖啡廳的選單頁面來學習 CSS。" ] }, "lab-business-card": { diff --git a/client/chinese-traditional/translations.json b/client/chinese-traditional/translations.json index 5de10687311..0b3eba34139 100644 --- a/client/chinese-traditional/translations.json +++ b/client/chinese-traditional/translations.json @@ -558,6 +558,12 @@ "running-tests": "// 正在執行測試", "tests-completed": "// 測試完成", "console-output": "// 主控台輸出", + "unavailable-local-resource": "載入資源失敗:「{{source}}」不是可用的區域的 {{resourceType}} 檔案。請使用:{{allowedSources}}。", + "unavailable-local-resource-no-allowed": "載入資源失敗:「{{source}}」不是此挑戰中可用的區域的 {{resourceType}} 檔案。", + "local-resource-type": { + "stylesheet": "樣式表", + "script": "腳本" + }, "example-app": "建置一個功能上類似於<0>此範例專案的應用程式。盡量不要複製範例專案,展現你自己的風格。", "syntax-error": "你的程式碼在任何測試執行前就引發錯誤。請修正後再試。", "indentation-error": "你的程式碼有縮排錯誤。你可能需要在新行加入pass以形成有效的程式碼區塊。", @@ -656,25 +662,6 @@ "sub-step-7": "點擊 <0>新增秘密 按鈕", "summary": "Codespaces 設定" }, - "ona": { - "intro": "本課程在使用 Ona 的虛擬 Linux 機器中執行。請依照以下指示開始課程:", - "step-1": "<0>如果你還沒有,請創建 Ona 帳號", - "step-2": "點擊下方開始按鈕", - "step-3": "在跳出的視窗中點擊建立按鈕", - "step-4": "虛擬 Linux 機器載入完成後,啟動 CodeRoad 擴充套件:", - "step-5": "點擊 VSCode 視窗左上方的「漢堡」選單,", - "step-6": "前往 <0>檢視 選單,", - "step-7": "點擊 <0>指令面板 選項,", - "step-8": "並執行 <0>CodeRoad: Start 指令", - "step-9": "依照 CodeRoad 中的指示完成課程", - "continue-project": "點擊下方開始按鈕會啟動新專案。若你之前已開始 {{course}} 課程,請前往 <0>你的 Ona 儀表板 繼續。", - "learn-more": "了解更多關於 <0>Ona 工作區。", - "logout-warning": "如果你在完成整個 {{course}} 課程前登出 freeCodeCamp,你的進度將不會儲存到你的 freeCodeCamp 帳號。", - "sub-step-3": "前往你的 <0>Ona 秘密頁面", - "sub-step-4": "建立名為 <0>CODEROAD_WEBHOOK_TOKEN 的新秘密", - "sub-step-5": "在 <0>秘密 欄位貼上你的 token", - "summary": "Ona 設定" - }, "freecodecamp-os": { "token-modal": "當你執行課程時,會跳出一個視窗要求輸入你的使用者語彙單元。請將你剛才複製的語彙單元貼上。每個環境只需操作一次。", "local": { @@ -697,16 +684,6 @@ "step-5": "完成後會開啟 Simple Browser。如果是空白白頁,請使用重新整理按鈕更新,查看課程首頁。", "step-6": "點選其中一個可用的專案開始,然後依照專案中的指示完成它。", "continue-project": "點擊下方開始按鈕會啟動一台新機器。若你之前已開始過 {{title}} 課程,請前往 <0>倉庫頁面 重新開啟先前的工作區。" - }, - "ona": { - "intro": "此課程會在虛擬 Linux 機器中使用 Ona 和 freeCodeCamp - Courses VS Code 擴充套件執行。請依照以下指示開始課程:", - "step-1": "<0>如果你還沒有,請創建一個 Ona 帳號", - "step-2": "點擊下方的開始按鈕", - "step-3": "在跳出的視窗中,點擊建立按鈕", - "step-4": "虛擬 Linux 機器載入完成後,開啟指令面板並執行 <0>freeCodeCamp: Run Course 指令", - "step-5": "完成後會開啟 Simple Browser。如果是空白白頁,請使用重新整理按鈕更新,查看課程首頁。", - "step-6": "點選其中一個可用的專案開始,然後依照專案中的指示完成它。", - "continue-project": "點擊下方開始按鈕會啟動一台新機器。若你之前已開始過 {{course}} 課程,請前往 <0>你的 Ona 儀表板 繼續。" } }, "local": { diff --git a/client/chinese/intro.json b/client/chinese/intro.json index cade9271d89..8669c1bb1bc 100644 --- a/client/chinese/intro.json +++ b/client/chinese/intro.json @@ -1352,12 +1352,6 @@ "在这个包含 140 节课的工作坊中,你将完成学生数据库,同时深入学习 SQL 命令。" ] }, - "lab-world-cup-database": { - "title": "构建世界杯数据库", - "intro": [ - "在此项目中,你将创建一个 Bash 脚本,将世界杯比赛信息输入 PostgreSQL,然后查询数据库以获取有用的统计数据。" - ] - }, "workshop-kitty-ipsum-translator": { "title": "构建 Kitty Ipsum 翻译器", "intro": [ @@ -1371,6 +1365,12 @@ "在这个包含 210 节课的工作坊中,你将构建一个交互式 Bash 程序,使用 PostgreSQL 保存自行车租赁店的租赁信息。" ] }, + "lab-world-cup-database": { + "title": "构建世界杯数据库", + "intro": [ + "在此项目中,你将创建一个 Bash 脚本,将世界杯比赛信息输入 PostgreSQL,然后查询数据库以获取有用的统计数据。" + ] + }, "lab-salon-appointment-scheduler": { "title": "构建美发预约调度程序", "intro": [ @@ -2669,6 +2669,13 @@ "你将练习使用条件式,根据学生的分数确定成绩。" ] }, + "lab-story-fragment-restoration": { + "title": "从故事片段数组还原连贯叙事", + "intro": [ + "在本实验中,你将从损坏的故事片段数组中还原连贯的叙事。", + "你将通过从零实现基本数组算法来练习使用循环。" + ] + }, "lecture-the-var-keyword-and-hoisting": { "title": "var 关键字与提升机制", "intro": [ @@ -3774,18 +3781,18 @@ "通过本课程学习 CSS 盒模型。了解网页元素如何渲染,学习调整间距、边框和内边距,实现理想的版型和设计。" ] }, - "top-introduction-to-flexbox": { - "title": "弹性盒模型简介", - "intro": [ - "发现弹性盒模型的强大功能,这是一种简化灵活响应式网页版型设计的模型。学习轻松创建动态且自适应的页面结构。" - ] - }, "top-learn-block-and-inline": { "title": "学习块级元素和内联元素的区别", "intro": [ "探索超文本标记语言和 CSS 中块级元素与内联元素的区别。本课程提供这些显示类型如何影响版型和行为的见解,助你做出明智的设计决策。" ] }, + "top-introduction-to-flexbox": { + "title": "弹性盒模型简介", + "intro": [ + "发现弹性盒模型的强大功能,这是一种简化灵活响应式网页版型设计的模型。学习轻松创建动态且自适应的页面结构。" + ] + }, "top-learn-variables-and-operators": { "title": "学习变量和操作符", "intro": [ @@ -6287,12 +6294,6 @@ "你将练习使用 Tailwind CSS 的弹性布局、颜色、断点等实用类。" ] }, - "lab-photography-exhibit": { - "title": "设计摄影展览", - "intro": [ - "在本实验中,你将通过设计摄影展览网页练习使用 Tailwind CSS。" - ] - }, "review-css-libraries-and-frameworks": { "title": "CSS 库和框架复习", "intro": [ @@ -6306,6 +6307,12 @@ "通过此测验测试你对 CSS 库和框架的掌握。" ] }, + "lab-photography-exhibit": { + "title": "设计摄影展览", + "intro": [ + "在本实验中,你将通过设计摄影展览网页练习使用 Tailwind CSS。" + ] + }, "lecture-introduction-to-typescript": { "title": "TypeScript 入门", "intro": [ @@ -6372,18 +6379,6 @@ "在本工作坊中,你将继续通过创建占卜应用来练习使用 TypeScript。" ] }, - "lab-flashcard-quiz-app": { - "title": "创建抽认卡测验应用", - "intro": [ - "在本实验中,你将通过创建抽认卡测验应用来练习使用 TypeScript。" - ] - }, - "lab-digital-pet-game": { - "title": "创建数字宠物游戏", - "intro": [ - "在本实验中,你将通过创建数字宠物游戏来练习你所学的 TypeScript 和 React 知识。" - ] - }, "workshop-build-a-football-player-card-builder": { "title": "创建足球运动员卡片生成器", "intro": [ @@ -6401,6 +6396,18 @@ "title": "TypeScript 测验", "intro": ["通过此测验测试你对 TypeScript 的掌握。"] }, + "lab-flashcard-quiz-app": { + "title": "创建抽认卡测验应用", + "intro": [ + "在本实验中,你将通过创建抽认卡测验应用来练习使用 TypeScript。" + ] + }, + "lab-digital-pet-game": { + "title": "创建数字宠物游戏", + "intro": [ + "在本实验中,你将通过创建数字宠物游戏来练习你所学的 TypeScript 和 React 知识。" + ] + }, "review-front-end-libraries": { "title": "前端库复习", "intro": [ @@ -7176,12 +7183,12 @@ "node-package-manager": "Node 包管理器", "lab-prime-number-checker-module": "创建素数检测模块", "http-and-the-web-standards-model": "HTTP 与网络标准模型", - "rest-api-and-web-services": "REST API 与网络服务", - "lab-timestamp-microservice": "创建时间戳微服务", "introduction-to-express": "Express 入门", "lab-personal-profile-app": "创建个人评测应用", - "error-handling-in-express": "Express 中的错误处理", "express-middleware": "Express 中间件", + "rest-api-and-web-services": "REST API 与网络服务", + "lab-timestamp-microservice": "创建时间戳微服务", + "error-handling-in-express": "Express 中的错误处理", "websockets": "WebSockets", "lab-chat-app": "创建聊天应用", "security-and-privacy": "安全性与隐私", @@ -7192,109 +7199,91 @@ }, "module-intros": { "introduction-to-nodejs": { - "note": "2026 年底上线", "intro": [ "在本模块中,你将学习 Node.js 的基础知识。" ] }, "nodejs-core-modules": { - "note": "2026 年底上线", "intro": [ "在本模块中,你将学习常见的 Node.js 核心模块,包括 fs、os、path 等。然后通过工作坊和实验练习所学内容,并通过简短测验检验知识。" ] }, "node-package-manager": { - "note": "2026 年底上线", "intro": [ "在本模块中,你将了解 Node 包管理器,它帮助开发者管理项目依赖和脚本。然后通过工作坊和实验练习所学内容,并通过简短测验检验知识。" ] }, "lab-prime-number-checker-module": { - "note": "2026 年底上线", "intro": [ "通过创建素数检测器练习构建和导出 NPM 模块。" ] }, "http-and-the-web-standards-model": { - "note": "2026 年底上线", "intro": [ "在本模块中,你将学习 HTTP(超文本传输协议)及其他重要概念,包括请求-响应模型、常见响应码、DNS、TCP/IP 等。然后通过创建自己的网络服务器工作坊练习所学内容,并通过简短测验检验知识。" ] }, - "rest-api-and-web-services": { - "note": "2026 年底上线", + "introduction-to-express": { "intro": [ - "在本模块中,你将学习 REST API(表现层状态转移应用程序接口)及微服务的工作原理。然后通过简短测验检验知识。" + "在本模块中,你将了解 Express.js,这是一个用于构建 RESTful API 的框架。然后通过工作坊和实验练习技能,并通过简短测验检验知识。" ] }, - "lab-timestamp-microservice": { - "note": "2026 年底上线", + "lab-personal-profile-app": { "intro": [ - "通过创建时间戳微服务练习构建带日期解析逻辑的 RESTful API。" + "通过创建个人评测应用练习构建 Express 服务器和 JSON API。" ] }, - "introduction-to-express": { - "note": "2026 年底上线", + "express-middleware": { "intro": [ - "在本模块中,你将了解 Express.js,这是一个用于构建 RESTful API 的框架。然后通过工作坊和实验练习技能,并通过简短测验检验知识。" + "在本模块中,你将学习 Express.js 中的中间件,它用于处理客户与服务器之间的请求和响应。然后通过工作坊和实验练习技能,并通过简短测验检验知识。" ] }, - "lab-personal-profile-app": { - "note": "2026 年底上线", + "rest-api-and-web-services": { "intro": [ - "通过创建个人评测应用练习构建 Express 服务器和 JSON API。" + "在本模块中,你将学习 REST API(表现层状态转移应用程序接口)及微服务的工作原理。然后通过简短测验检验知识。" ] }, - "error-handling-in-express": { - "note": "2026 年底上线", + "lab-timestamp-microservice": { "intro": [ - "在本模块中,你将学习 Express.js 中的错误处理、调试和健康检查。然后在实验中练习所学内容,并通过简短测验检验知识。" + "通过创建时间戳微服务练习构建带日期解析逻辑的 RESTful API。" ] }, - "express-middleware": { - "note": "2026 年底上线", + "error-handling-in-express": { "intro": [ - "在本模块中,你将学习 Express.js 中的中间件,它用于处理客户与服务器之间的请求和响应。然后通过工作坊和实验练习技能,并通过简短测验检验知识。" + "在本模块中,你将学习 Express.js 中的错误处理、调试和健康检查。然后在实验中练习所学内容,并通过简短测验检验知识。" ] }, "websockets": { - "note": "2026 年底上线", "intro": [ "在本模块中,你将了解 WebSockets,这是一种用于客户与服务器实时通信的协议。然后通过实验和工作坊练习所学内容,并通过简短测验检验知识。" ] }, "lab-chat-app": { - "note": "2026 年底上线", "intro": [ "通过使用 Node.js 套接字练习构建实时多客户聊天服务器。" ] }, "security-and-privacy": { - "note": "2026 年底上线", "intro": [ "在本模块中,你将学习安全性与隐私的区别,以及 CSP、权限策略、个人身份信息、CORS 处理等其他概念。然后通过简短测验检验知识。" ] }, "authentication": { - "note": "2026 年底上线", "intro": [ "在本模块中,你将学习网络应用中的认证机制,以及 JWT、CSRF、Passport、Helmet、密码学和加密等重要概念。然后通过实验和工作坊练习所学内容,并通过简短测验检验知识。" ] }, "lab-family-movie-watchlist-api": { - "note": "2026 年底上线", "intro": [ "通过构建家庭电影观看列表 API 练习在 Express 应用中实现认证和授权。" ] }, "back-end-development-and-apis-certification-exam": { - "note": "2026 年底上线", "intro": [ "通过此考试以获得后端开发与 API 认证。" ] }, "review-back-end-development-and-apis": { - "note": "预计于 2026 年晚些时候推出", "intro": [ "复习后端开发与 API 概念,为即将到来的考试做准备。" ] @@ -7302,7 +7291,7 @@ }, "blocks": { "lecture-working-with-nodejs-and-event-driven-architecture": { - "title": "使用 NodeJS 和事件驱动架构", + "title": "使用 Node.js 和事件驱动架构", "intro": [ "了解 Node.js 核心库,如何在计算机上安装 Node.js,以及在后端使用 Node.js 的优缺点。" ] @@ -7416,24 +7405,6 @@ "" ] }, - "lecture-understanding-rest-api-and-web-services": { - "title": "理解 REST API 和网络服务", - "intro": [ - "在这些课程中,你将学习 REST API 和网络服务,以及它们如何让不同应用通过互联网相互通信。" - ] - }, - "workshop-build-a-weather-service-api": { - "title": "创建天气服务 API", - "intro": [ - "你将通过构建天气服务 API 学习路由参数和使用 express.Router 进行模块化路由。" - ] - }, - "lab-timestamp-microservice": { - "title": "创建时间戳微服务", - "intro": [ - "通过创建时间戳微服务,练习构建带有日期解析逻辑的 RESTful API。" - ] - }, "lecture-working-with-express": { "title": "使用 Express", "intro": [ @@ -7453,16 +7424,10 @@ "你将通过构建随机笑话应用学习基本的 Express 路由和响应方法。" ] }, - "lab-personal-profile-app": { - "title": "创建个人资料应用", - "intro": [ - "通过创建个人资料应用,练习构建 Express 服务器和 JSON API。" - ] - }, "review-introduction-to-express": { "title": "Express 入门复习", "intro": [ - "在参加测验前复习网络服务、REST、微服务和 Express.js 路由。" + "在参加测验前,复习 Express.js、路由、响应方法和静态文件服务。" ] }, "quiz-introduction-to-express": { @@ -7471,28 +7436,10 @@ "测试你对网络服务、REST、微服务、Express.js 和路由的知识。" ] }, - "lecture-understanding-error-handling-and-health-checks": { - "title": "理解错误处理和健康检查", - "intro": [ - "在这些课程中,你将学习 Express 中的错误处理和健康检查。" - ] - }, - "workshop-build-a-bank-api": { - "title": "创建银行 API", - "intro": [ - "你将通过构建银行 API 学习 Express 5 的错误处理、健康检查和优雅关闭。" - ] - }, - "review-error-handling-in-express": { - "title": "Express 中的错误处理复习", - "intro": [ - "在参加测验前复习 HTTP 状态码、错误处理、调试、日志记录、健康检查和优雅关闭。" - ] - }, - "quiz-error-handling-in-express": { - "title": "Express 中的错误处理测验", + "lab-personal-profile-app": { + "title": "创建个人资料应用", "intro": [ - "测试你对 HTTP 状态码、错误处理、调试、日志记录、健康检查和优雅关闭的知识。" + "通过创建个人资料应用,练习构建 Express 服务器和 JSON API。" ] }, "lecture-express-middleware": { @@ -7525,6 +7472,54 @@ "测试你对 Express 中间件的知识,包括应用级、路由级、错误处理以及内置和第三方中间件。" ] }, + "lecture-understanding-rest-api-and-web-services": { + "title": "理解 REST API 和网络服务", + "intro": [ + "在这些课程中,你将学习 REST API 和网络服务,以及它们如何让不同应用通过互联网相互通信。" + ] + }, + "workshop-build-a-weather-service-api": { + "title": "创建天气服务 API", + "intro": [ + "你将通过构建天气服务 API 学习路由参数和使用 express.Router 进行模块化路由。" + ] + }, + "review-rest-api-and-web-services": { + "title": "REST API 和网络服务复习", + "intro": [ + "复习网络服务、REST 架构、超文本传输协议状态码和微服务。" + ] + }, + "lab-timestamp-microservice": { + "title": "创建时间戳微服务", + "intro": [ + "通过创建时间戳微服务,练习构建带有日期解析逻辑的 RESTful API。" + ] + }, + "lecture-understanding-error-handling-and-health-checks": { + "title": "理解错误处理和健康检查", + "intro": [ + "在这些课程中,你将学习 Express 中的错误处理和健康检查。" + ] + }, + "workshop-build-a-bank-api": { + "title": "创建银行 API", + "intro": [ + "你将通过构建银行 API 学习 Express 5 的错误处理、健康检查和优雅关闭。" + ] + }, + "review-error-handling-in-express": { + "title": "Express 中的错误处理复习", + "intro": [ + "在参加测验前复习 HTTP 状态码、错误处理、调试、日志记录、健康检查和优雅关闭。" + ] + }, + "quiz-error-handling-in-express": { + "title": "Express 中的错误处理测验", + "intro": [ + "测试你对 HTTP 状态码、错误处理、调试、日志记录、健康检查和优雅关闭的知识。" + ] + }, "lecture-understanding-websockets": { "title": "理解 WebSockets", "intro": [ @@ -8427,7 +8422,7 @@ "title": "设计咖啡馆菜单", "intro": [ "CSS告诉浏览器如何显示你的网页。你可以使用CSS设置HTML元素的颜色、字体、大小及其他方面。", - "在本工作坊中,你将通过设计咖啡馆网页的菜单页面来学习CSS。" + "在本工作坊中,你将通过设计咖啡馆菜单页面来学习 CSS。" ] }, "lab-business-card": { @@ -9695,7 +9690,7 @@ "title": "设计咖啡馆菜单", "intro": [ "CSS 告诉浏览器如何显示你的网页。你可以用 CSS 设置 HTML 元素的颜色、字体、大小等。", - "在本工作坊中,你将通过设计咖啡馆网页的菜单页面来学习 CSS。" + "在本工作坊中,你将通过设计咖啡馆菜单页面来学习 CSS。" ] }, "lab-business-card": { diff --git a/client/chinese/translations.json b/client/chinese/translations.json index 305eed5ba09..aa737927629 100644 --- a/client/chinese/translations.json +++ b/client/chinese/translations.json @@ -558,6 +558,12 @@ "running-tests": "// 正在运行测试", "tests-completed": "// 测试完成", "console-output": "// 控制台输出", + "unavailable-local-resource": "装载资源失败:“{{source}}”不是可用的局部的{{resourceType}}文件。请使用:{{allowedSources}}。", + "unavailable-local-resource-no-allowed": "装载资源失败:“{{source}}”不是此挑战中可用的局部的{{resourceType}}文件。", + "local-resource-type": { + "stylesheet": "样式表", + "script": "脚本" + }, "example-app": "构建一个功能上类似于<0>此示例项目的应用。尽量不要拷贝示例项目,展现你自己的风格。", "syntax-error": "你的代码在测试运行前引起了误差。请修正后重试。", "indentation-error": "你的代码有缩排误差。你可能需要在新行添加pass以形成有效的代码块。", @@ -656,25 +662,6 @@ "sub-step-7": "点击 <0>添加密钥 按钮", "summary": "Codespaces 设置" }, - "ona": { - "intro": "本课程在使用 Ona 的虚拟 Linux 机器中运行。请按照以下说明开始课程:", - "step-1": "<0>创建一个 Ona 账号(如果你还没有)", - "step-2": "点击下面的开始按钮", - "step-3": "在弹出的模态框中点击创建按钮", - "step-4": "虚拟 Linux 机器装载完成后,通过以下步骤启动 CodeRoad 扩展:", - "step-5": "点击 VSCode 窗口左上角附近的“汉堡”菜单,", - "step-6": "进入 <0>视图 菜单,", - "step-7": "点击 <0>命令面板 选项,", - "step-8": "运行 <0>CodeRoad: Start 命令", - "step-9": "按照 CodeRoad 中的指示完成课程", - "continue-project": "点击下面的开始按钮将启动一个新项目。如果你之前开始过 {{course}} 课程,请前往 <0>你的 Ona 仪表盘继续。", - "learn-more": "了解更多关于 <0>Ona 工作区 的信息。", - "logout-warning": "如果你在完成整个 {{course}} 课程前退出 freeCodeCamp,进度将不会保存到你的 freeCodeCamp 账号。", - "sub-step-3": "导航到你的 <0>Ona 密钥页面", - "sub-step-4": "创建一个名为 <0>CODEROAD_WEBHOOK_TOKEN 的新密钥", - "sub-step-5": "在 <0>密钥 字段中粘贴你的令牌", - "summary": "Ona 设置" - }, "freecodecamp-os": { "token-modal": "当你运行课程时,会弹出一个模态窗口,要求输入你的用户令牌。将你上面复制的令牌粘贴进去。每个环境只需操作一次。", "local": { @@ -697,16 +684,6 @@ "step-5": "完成后会打开 Simple Browser。如果是空白白页,请使用刷新按钮更新,查看课程主页。", "step-6": "点击一个可用项目开始,然后按照项目中的说明完成它。", "continue-project": "点击下面的开始按钮将启动新机器。如果你之前启动过 {{title}} 课程,请前往 <0>仓库页面 重新打开之前的工作区。" - }, - "ona": { - "intro": "本课程在虚拟 Linux 机器中运行,使用 Ona 和 freeCodeCamp - Courses VS Code 扩展。按照以下说明开始课程:", - "step-1": "<0>如果你还没有,请创建一个 Ona 账户", - "step-2": "点击下面的开始按钮", - "step-3": "在弹出的模态窗口中,点击创建按钮", - "step-4": "虚拟 Linux 机器装载完成后,打开命令面板,运行 <0>freeCodeCamp: Run Course 命令", - "step-5": "完成后会打开 Simple Browser。如果是空白白页,请使用刷新按钮更新,查看课程主页。", - "step-6": "点击一个可用项目开始,然后按照项目中的说明完成它。", - "continue-project": "点击下面的开始按钮将启动新机器。如果你之前启动过 {{course}} 课程,请前往 <0>你的 Ona 仪表盘 继续。" } }, "local": { diff --git a/client/espanol/intro.json b/client/espanol/intro.json index c5834f6a8fb..a008d9e5cca 100644 --- a/client/espanol/intro.json +++ b/client/espanol/intro.json @@ -1352,12 +1352,6 @@ "En este taller de 140 lecciones, completarás tu base de datos de estudiantes mientras profundizas en los comandos SQL." ] }, - "lab-world-cup-database": { - "title": "Crear una base de datos de la Copa Mundial", - "intro": [ - "Para este proyecto, crearás un script Bash que ingrese información de partidos de la Copa Mundial en PostgreSQL, luego consultarás la base de datos para obtener estadísticas útiles." - ] - }, "workshop-kitty-ipsum-translator": { "title": "Crear un traductor de Kitty Ipsum", "intro": [ @@ -1371,6 +1365,12 @@ "En este taller de 210 lecciones, crearás un programa Bash interactivo que almacena información de alquiler para tu tienda de bicicletas usando PostgreSQL." ] }, + "lab-world-cup-database": { + "title": "Crear una base de datos de la Copa Mundial", + "intro": [ + "Para este proyecto, crearás un script Bash que ingrese información de partidos de la Copa Mundial en PostgreSQL, luego consultarás la base de datos para obtener estadísticas útiles." + ] + }, "lab-salon-appointment-scheduler": { "title": "Crear un programador de citas para salón", "intro": [ @@ -2669,6 +2669,13 @@ "Practicarás condicionales para determinar la calificación del estudiante según su puntaje." ] }, + "lab-story-fragment-restoration": { + "title": "Restaurar una narrativa coherente a partir de un arreglo de fragmentos de historia", + "intro": [ + "En este laboratorio, restaurarás una narrativa coherente a partir de un arreglo corrupto de fragmentos de historia.", + "Practicarás el uso de ciclos implementando desde cero algoritmos fundamentales para arreglos." + ] + }, "lecture-the-var-keyword-and-hoisting": { "title": "La palabra clave var y el hoisting", "intro": [ @@ -3774,18 +3781,18 @@ "Aprende el modelo de caja CSS con este curso. Entiende cómo se renderizan los elementos en la web y aprende a manipular espacios, bordes y rellenos para lograr el diseño y estilo deseados." ] }, - "top-introduction-to-flexbox": { - "title": "Introducción a flexbox", - "intro": [ - "Descubre el poder de Flexbox, un modelo de diseño que simplifica la creación de diseños web flexibles y adaptables. Aprende a crear estructuras de página dinámicas y adaptativas con facilidad." - ] - }, "top-learn-block-and-inline": { "title": "Aprender la diferencia entre bloque y en línea", "intro": [ "Explora las diferencias entre elementos de bloque y en línea en HTML y CSS. Este curso ofrece perspectivas sobre cómo estos tipos de visualización afectan el diseño y comportamiento, dándote el poder de tomar decisiones informadas de diseño." ] }, + "top-introduction-to-flexbox": { + "title": "Introducción a flexbox", + "intro": [ + "Descubre el poder de Flexbox, un modelo de diseño que simplifica la creación de diseños web flexibles y adaptables. Aprende a crear estructuras de página dinámicas y adaptativas con facilidad." + ] + }, "top-learn-variables-and-operators": { "title": "Aprender variables y operadores", "intro": [ @@ -6287,12 +6294,6 @@ "Practicarás el uso de clases utilitarias de Tailwind CSS para diseños flexbox, colores, puntos de interrupción y más." ] }, - "lab-photography-exhibit": { - "title": "Diseñar una exhibición de fotografía", - "intro": [ - "En este laboratorio, practicarás el uso de Tailwind CSS diseñando una página web para una exhibición de fotografía." - ] - }, "review-css-libraries-and-frameworks": { "title": "Revisión de librerías y frameworks CSS", "intro": [ @@ -6306,6 +6307,12 @@ "Pon a prueba lo que has aprendido sobre librerías y frameworks CSS con este quiz." ] }, + "lab-photography-exhibit": { + "title": "Diseñar una exhibición de fotografía", + "intro": [ + "En este laboratorio, practicarás el uso de Tailwind CSS diseñando una página web para una exhibición de fotografía." + ] + }, "lecture-introduction-to-typescript": { "title": "Introducción a TypeScript", "intro": [ @@ -6372,18 +6379,6 @@ "En este taller, continuarás practicando con TypeScript construyendo una app de adivinación." ] }, - "lab-flashcard-quiz-app": { - "title": "Construir una app de quiz con tarjetas", - "intro": [ - "En este laboratorio, practicarás usando TypeScript construyendo una app de quiz con tarjetas." - ] - }, - "lab-digital-pet-game": { - "title": "Construir un juego de mascota digital", - "intro": [ - "En este laboratorio, practicarás lo que aprendiste sobre TypeScript y React construyendo un juego de mascota digital." - ] - }, "workshop-build-a-football-player-card-builder": { "title": "Construir un creador de tarjetas de jugadores de fútbol", "intro": [ @@ -6401,6 +6396,18 @@ "title": "Quiz de TypeScript", "intro": ["Pon a prueba lo que aprendiste sobre TypeScript con este quiz."] }, + "lab-flashcard-quiz-app": { + "title": "Construir una app de quiz con tarjetas", + "intro": [ + "En este laboratorio, practicarás usando TypeScript construyendo una app de quiz con tarjetas." + ] + }, + "lab-digital-pet-game": { + "title": "Construir un juego de mascota digital", + "intro": [ + "En este laboratorio, practicarás lo que aprendiste sobre TypeScript y React construyendo un juego de mascota digital." + ] + }, "review-front-end-libraries": { "title": "Revisión de bibliotecas front-end", "intro": [ @@ -7176,12 +7183,12 @@ "node-package-manager": "Administrador de paquetes de Node", "lab-prime-number-checker-module": "Crear un módulo para verificar números primos", "http-and-the-web-standards-model": "HTTP y el modelo de estándares web", - "rest-api-and-web-services": "API REST y servicios web", - "lab-timestamp-microservice": "Crear un microservicio de marcas de tiempo", "introduction-to-express": "Introducción a Express", "lab-personal-profile-app": "Crear una app de perfil personal", - "error-handling-in-express": "Manejo de errores en Express", "express-middleware": "Middleware en Express", + "rest-api-and-web-services": "API REST y servicios web", + "lab-timestamp-microservice": "Crear un microservicio de marcas de tiempo", + "error-handling-in-express": "Manejo de errores en Express", "websockets": "WebSockets", "lab-chat-app": "Crear una app de chat", "security-and-privacy": "Seguridad y privacidad", @@ -7192,109 +7199,91 @@ }, "module-intros": { "introduction-to-nodejs": { - "note": "Disponible a finales de 2026", "intro": [ "En este módulo, aprenderás los conceptos básicos para trabajar con Node.js." ] }, "nodejs-core-modules": { - "note": "Disponible a finales de 2026", "intro": [ "En este módulo, aprenderás sobre los módulos principales comunes de Node.js, incluyendo fs, os, path y más. Luego practicarás lo aprendido mediante talleres y laboratorios y pondrás a prueba tus conocimientos con un quiz corto." ] }, "node-package-manager": { - "note": "Disponible a finales de 2026", "intro": [ "En este módulo, te presentarán el administrador de paquetes de Node, que los desarrolladores usan para gestionar las dependencias y scripts del proyecto. Luego practicarás lo aprendido con talleres y laboratorios y evaluarás tus conocimientos con un quiz corto." ] }, "lab-prime-number-checker-module": { - "note": "Disponible a finales de 2026", "intro": [ "Practica crear y exportar un módulo npm creando un verificador de números primos." ] }, "http-and-the-web-standards-model": { - "note": "Disponible a finales de 2026", "intro": [ "En este módulo, aprenderás sobre HTTP (Protocolo de transferencia de hipertexto) y otros conceptos importantes como el modelo solicitud-respuesta, códigos de respuesta comunes, DNS, TCP/IP y más. Luego practicarás lo aprendido construyendo tu propio servidor web en un taller y pondrás a prueba tus conocimientos con un quiz corto." ] }, - "rest-api-and-web-services": { - "note": "Disponible a finales de 2026", + "introduction-to-express": { "intro": [ - "En este módulo, aprenderás sobre la API REST (interfaz de programación de aplicaciones de transferencia de estado representacional) y cómo funcionan los microservicios. Luego realizarás un quiz corto para evaluar tus conocimientos." + "En este módulo, te presentarán Express.js, un framework usado para construir APIs RESTful. Luego practicarás tus habilidades con talleres y laboratorios y evaluarás tus conocimientos con un quiz corto." ] }, - "lab-timestamp-microservice": { - "note": "Disponible a finales de 2026", + "lab-personal-profile-app": { "intro": [ - "Practica crear una API REST con lógica para analizar fechas creando un microservicio de marcas de tiempo." + "Practica crear un servidor Express y una API JSON creando una aplicación de perfil personal." ] }, - "introduction-to-express": { - "note": "Disponible a finales de 2026", + "express-middleware": { "intro": [ - "En este módulo, te presentarán Express.js, un framework usado para construir APIs RESTful. Luego practicarás tus habilidades con talleres y laboratorios y evaluarás tus conocimientos con un quiz corto." + "En este módulo, aprenderás sobre middleware en Express.js, que se usa para manejar solicitudes y respuestas entre el cliente y el servidor. Luego practicarás tus habilidades mediante un taller y un laboratorio y evaluarás tus conocimientos con un quiz corto." ] }, - "lab-personal-profile-app": { - "note": "Disponible a finales de 2026", + "rest-api-and-web-services": { "intro": [ - "Practica crear un servidor Express y una API JSON creando una aplicación de perfil personal." + "En este módulo, aprenderás sobre la API REST (interfaz de programación de aplicaciones de transferencia de estado representacional) y cómo funcionan los microservicios. Luego realizarás un quiz corto para evaluar tus conocimientos." ] }, - "error-handling-in-express": { - "note": "Disponible a finales de 2026", + "lab-timestamp-microservice": { "intro": [ - "En este módulo, aprenderás cómo funciona el manejo de errores, la depuración y las comprobaciones de salud en Express.js. Luego practicarás lo aprendido en un laboratorio y evaluarás tus conocimientos con un quiz corto." + "Practica crear una API REST con lógica para analizar fechas creando un microservicio de marcas de tiempo." ] }, - "express-middleware": { - "note": "Disponible a finales de 2026", + "error-handling-in-express": { "intro": [ - "En este módulo, aprenderás sobre middleware en Express.js, que se usa para manejar solicitudes y respuestas entre el cliente y el servidor. Luego practicarás tus habilidades mediante un taller y un laboratorio y evaluarás tus conocimientos con un quiz corto." + "En este módulo, aprenderás cómo funciona el manejo de errores, la depuración y las comprobaciones de salud en Express.js. Luego practicarás lo aprendido en un laboratorio y evaluarás tus conocimientos con un quiz corto." ] }, "websockets": { - "note": "Disponible a finales de 2026", "intro": [ "En este módulo, te presentarán los websockets, un protocolo usado para la comunicación en tiempo real entre cliente y servidor. Luego practicarás lo aprendido en laboratorios y talleres y evaluarás tus conocimientos con un quiz corto." ] }, "lab-chat-app": { - "note": "Disponible a finales de 2026", "intro": [ "Practica crear un servidor de chat en tiempo real para múltiples clientes usando WebSockets de Node.js." ] }, "security-and-privacy": { - "note": "Disponible a finales de 2026", "intro": [ "En este módulo, aprenderás las diferencias entre seguridad y privacidad, así como otros conceptos como CSPs, políticas de permisos, PII, trabajar con CORS y más. Luego realizarás un quiz corto para evaluar tus conocimientos." ] }, "authentication": { - "note": "Disponible a finales de 2026", "intro": [ "En este módulo, aprenderás cómo funciona la autenticación en aplicaciones web junto con otros conceptos importantes como JWTs, CSRFs, Passport, Helmet, criptografía y encriptación, y más. Luego practicarás lo aprendido en laboratorios y talleres y evaluarás tus conocimientos con un quiz corto." ] }, "lab-family-movie-watchlist-api": { - "note": "Disponible a finales de 2026", "intro": [ "Practica implementar autenticación y autorización en una aplicación Express creando una API para lista de películas familiar." ] }, "back-end-development-and-apis-certification-exam": { - "note": "Disponible a finales de 2026", "intro": [ "Aprueba este examen para obtener tu certificación en desarrollo back-end y APIs." ] }, "review-back-end-development-and-apis": { - "note": "Disponible a finales de 2026", "intro": [ "Revisa los conceptos de desarrollo back-end y APIs para prepararte para el próximo examen." ] @@ -7302,7 +7291,7 @@ }, "blocks": { "lecture-working-with-nodejs-and-event-driven-architecture": { - "title": "Trabajando con NodeJS y arquitectura orientada a eventos", + "title": "Trabajar con Node.js y arquitectura orientada a eventos", "intro": [ "Aprende sobre las bibliotecas principales de Node.js, cómo instalar Node.js en tu computadora y las ventajas y desventajas de usar Node.js en el back-end." ] @@ -7416,24 +7405,6 @@ "" ] }, - "lecture-understanding-rest-api-and-web-services": { - "title": "Entendiendo la API REST y los servicios web", - "intro": [ - "En estas lecciones, aprenderás sobre las APIs REST y los servicios web, y cómo permiten que diferentes aplicaciones se comuniquen entre sí a través de internet." - ] - }, - "workshop-build-a-weather-service-api": { - "title": "Crear una API de servicio meteorológico", - "intro": [ - "Aprenderás sobre parámetros de ruta y enrutamiento modular con express.Router creando una API de servicio meteorológico." - ] - }, - "lab-timestamp-microservice": { - "title": "Construye un microservicio de marca de tiempo", - "intro": [ - "Practica construir una API RESTful con lógica de análisis de fechas creando un microservicio de marca de tiempo." - ] - }, "lecture-working-with-express": { "title": "Trabajando con Express", "intro": [ @@ -7453,16 +7424,10 @@ "Aprenderás enrutamiento básico de Express y métodos de respuesta creando una app de chistes aleatorios." ] }, - "lab-personal-profile-app": { - "title": "Construye una app de perfil personal", - "intro": [ - "Practica construir un servidor Express y una API JSON creando una aplicación de perfil personal." - ] - }, "review-introduction-to-express": { "title": "Revisión de introducción a Express", "intro": [ - "Revisa servicios web, REST, microservicios y enrutamiento de Express.js antes de hacer el quiz." + "Revisa Express.js, el enrutamiento, los métodos de respuesta y cómo servir archivos estáticos antes de hacer el quiz." ] }, "quiz-introduction-to-express": { @@ -7471,28 +7436,10 @@ "Pon a prueba tus conocimientos sobre servicios web, REST, microservicios, Express.js y enrutamiento." ] }, - "lecture-understanding-error-handling-and-health-checks": { - "title": "Entendiendo el manejo de errores y chequeos de salud", - "intro": [ - "En estas lecciones, aprenderás sobre el manejo de errores y chequeos de salud en Express." - ] - }, - "workshop-build-a-bank-api": { - "title": "Crear una API bancaria", - "intro": [ - "Aprenderás manejo de errores en Express 5, chequeos de estado y cierres ordenados creando una API bancaria." - ] - }, - "review-error-handling-in-express": { - "title": "Revisión de manejo de errores en Express", - "intro": [ - "Revisa códigos de estado HTTP, manejo de errores, depuración, registro, chequeos de salud y cierres ordenados antes de hacer el quiz." - ] - }, - "quiz-error-handling-in-express": { - "title": "Quiz de manejo de errores en Express", + "lab-personal-profile-app": { + "title": "Construye una app de perfil personal", "intro": [ - "Pon a prueba tus conocimientos sobre códigos de estado HTTP, manejo de errores, depuración, registro, chequeos de salud y cierres ordenados." + "Practica construir un servidor Express y una API JSON creando una aplicación de perfil personal." ] }, "lecture-express-middleware": { @@ -7525,6 +7472,54 @@ "Pon a prueba tus conocimientos sobre middleware de Express, incluyendo middleware a nivel de aplicación, a nivel de enrutador, para manejo de errores, y middleware integrado y de terceros." ] }, + "lecture-understanding-rest-api-and-web-services": { + "title": "Entendiendo la API REST y los servicios web", + "intro": [ + "En estas lecciones, aprenderás sobre las APIs REST y los servicios web, y cómo permiten que diferentes aplicaciones se comuniquen entre sí a través de internet." + ] + }, + "workshop-build-a-weather-service-api": { + "title": "Crear una API de servicio meteorológico", + "intro": [ + "Aprenderás sobre parámetros de ruta y enrutamiento modular con express.Router creando una API de servicio meteorológico." + ] + }, + "review-rest-api-and-web-services": { + "title": "Revisión de API REST y servicios web", + "intro": [ + "Revisa los servicios web, la arquitectura REST, los códigos de estado HTTP y los microservicios." + ] + }, + "lab-timestamp-microservice": { + "title": "Construye un microservicio de marca de tiempo", + "intro": [ + "Practica construir una API RESTful con lógica de análisis de fechas creando un microservicio de marca de tiempo." + ] + }, + "lecture-understanding-error-handling-and-health-checks": { + "title": "Entendiendo el manejo de errores y chequeos de salud", + "intro": [ + "En estas lecciones, aprenderás sobre el manejo de errores y chequeos de salud en Express." + ] + }, + "workshop-build-a-bank-api": { + "title": "Crear una API bancaria", + "intro": [ + "Aprenderás manejo de errores en Express 5, chequeos de estado y cierres ordenados creando una API bancaria." + ] + }, + "review-error-handling-in-express": { + "title": "Revisión de manejo de errores en Express", + "intro": [ + "Revisa códigos de estado HTTP, manejo de errores, depuración, registro, chequeos de salud y cierres ordenados antes de hacer el quiz." + ] + }, + "quiz-error-handling-in-express": { + "title": "Quiz de manejo de errores en Express", + "intro": [ + "Pon a prueba tus conocimientos sobre códigos de estado HTTP, manejo de errores, depuración, registro, chequeos de salud y cierres ordenados." + ] + }, "lecture-understanding-websockets": { "title": "Entendiendo WebSockets", "intro": [ @@ -8427,7 +8422,7 @@ "title": "Diseñar un menú de café", "intro": [ "CSS indica al navegador cómo mostrar tu página web. Puedes usar CSS para establecer el color, la fuente, el tamaño y otros aspectos de los elementos HTML.", - "En este taller aprenderás CSS diseñando una página de menú para una página web de café." + "En este taller, aprenderás CSS diseñando una página de menú para un café." ] }, "lab-business-card": { @@ -9695,7 +9690,7 @@ "title": "Diseña un menú para un café", "intro": [ "CSS le dice al navegador cómo mostrar tu página web. Puedes usar CSS para establecer el color, la fuente, el tamaño y otros aspectos de los elementos HTML.", - "En este taller aprenderás CSS diseñando una página de menú para un sitio web de un café." + "En este taller, aprenderás CSS diseñando una página de menú para un café." ] }, "lab-business-card": { diff --git a/client/espanol/translations.json b/client/espanol/translations.json index 766d1984f32..764ca2dee50 100644 --- a/client/espanol/translations.json +++ b/client/espanol/translations.json @@ -558,6 +558,12 @@ "running-tests": "// ejecutando pruebas", "tests-completed": "// pruebas completadas", "console-output": "// salida de consola", + "unavailable-local-resource": "No se pudo cargar el recurso: \"{{source}}\" no es un archivo local {{resourceType}} disponible. Usa: {{allowedSources}}.", + "unavailable-local-resource-no-allowed": "No se pudo cargar el recurso: \"{{source}}\" no es un archivo local {{resourceType}} disponible en este desafío.", + "local-resource-type": { + "stylesheet": "hoja de estilos", + "script": "script" + }, "example-app": "Construye una app que sea funcionalmente similar a <0>este proyecto de ejemplo. Trata de no copiar el proyecto de ejemplo, dale tu propio estilo personal.", "syntax-error": "Tu código generó un error antes de que se pudieran ejecutar las pruebas. Por favor, corrígelo y vuelve a intentarlo.", "indentation-error": "Tu código tiene un error de indentación. Puede que necesites agregar pass en una nueva línea para formar un bloque de código válido.", @@ -656,25 +662,6 @@ "sub-step-7": "Haz clic en el botón <0>Agregar secreto", "summary": "Configuración de Codespaces" }, - "ona": { - "intro": "Este curso se ejecuta en una máquina virtual Linux usando Ona. Sigue estas instrucciones para comenzar el curso:", - "step-1": "<0>Crea una cuenta de Ona si no tienes una", - "step-2": "Haz clic en el botón de inicio abajo", - "step-3": "En el modal que aparece, haz clic en el botón crear", - "step-4": "Una vez que la máquina virtual Linux termine de cargar, inicia la extensión CodeRoad haciendo lo siguiente:", - "step-5": "Haz clic en el menú \"hamburguesa\" cerca de la esquina superior izquierda de la ventana de VSCode,", - "step-6": "Ve al menú <0>Ver,", - "step-7": "Haz clic en la opción <0>Paleta de comandos,", - "step-8": "y ejecuta el comando <0>CodeRoad: Start", - "step-9": "Sigue las instrucciones en CodeRoad para completar el curso", - "continue-project": "Hacer clic en el botón de inicio abajo iniciará un nuevo proyecto. Si ya comenzaste el curso {{course}}, ve a <0>tu panel de Ona para continuar.", - "learn-more": "Aprende más sobre los <0>espacios de trabajo de Ona.", - "logout-warning": "Si cierras sesión en freeCodeCamp antes de completar todo el curso {{course}}, tu progreso no se guardará en tu cuenta de freeCodeCamp.", - "sub-step-3": "Navega a tu <0>página de secretos de Ona", - "sub-step-4": "Crea un nuevo secreto llamado <0>CODEROAD_WEBHOOK_TOKEN", - "sub-step-5": "En el campo <0>Secreto, pega tu token", - "summary": "Configuración de Ona" - }, "freecodecamp-os": { "token-modal": "Cuando ejecutes el curso, aparecerá un modal pidiendo tu token de usuario. Pega el token que copiaste arriba. Solo necesitas hacerlo una vez por entorno.", "local": { @@ -697,16 +684,6 @@ "step-5": "Se abrirá el navegador Simple cuando termine. Si ves una página blanca en blanco, usa el botón de actualizar para verla y acceder a la página principal del curso.", "step-6": "Haz clic en uno de los proyectos disponibles para iniciarlo y luego sigue las instrucciones del proyecto para completarlo.", "continue-project": "Hacer clic en el botón de inicio abajo iniciará una nueva máquina. Si ya comenzaste el curso {{title}}, ve a la <0>página del repositorio para reabrir un espacio de trabajo anterior." - }, - "ona": { - "intro": "Este curso se ejecuta en una máquina virtual Linux usando Ona y la extensión freeCodeCamp - Courses para VS Code. Sigue estas instrucciones para iniciar el curso:", - "step-1": "<0>Crea una cuenta de Ona si no tienes una", - "step-2": "Haz clic en el botón de inicio abajo", - "step-3": "En el modal que aparece, haz clic en el botón de crear", - "step-4": "Cuando la máquina virtual Linux termine de cargar, abre la paleta de comandos y ejecuta el comando <0>freeCodeCamp: Run Course", - "step-5": "Se abrirá el navegador Simple cuando termine. Si ves una página blanca en blanco, usa el botón de actualizar para verla y acceder a la página principal del curso.", - "step-6": "Haz clic en uno de los proyectos disponibles para iniciarlo y luego sigue las instrucciones del proyecto para completarlo.", - "continue-project": "Hacer clic en el botón de inicio abajo iniciará una nueva máquina. Si ya comenzaste el curso {{course}}, ve a <0>tu panel de Ona para continuar." } }, "local": { diff --git a/client/german/intro.json b/client/german/intro.json index 1a7bce26d16..e2756858f75 100644 --- a/client/german/intro.json +++ b/client/german/intro.json @@ -1352,12 +1352,6 @@ "In diesem 140-Lektionen-Workshop vervollständigen Sie Ihre Studentendatenbank und vertiefen Ihre Kenntnisse in SQL-Befehlen." ] }, - "lab-world-cup-database": { - "title": "Erstellen einer Weltcup-Datenbank", - "intro": [ - "Für dieses Projekt erstellen Sie ein Bash-Skript, das Informationen von Weltcup-Spielen in PostgreSQL eingibt und dann die Datenbank nach nützlichen Statistiken abfragt." - ] - }, "workshop-kitty-ipsum-translator": { "title": "Erstellen eines Kitty-Ipsum-Übersetzers", "intro": [ @@ -1371,6 +1365,12 @@ "In diesem 210-Lektionen-Workshop erstellen Sie ein interaktives Bash-Programm, das Mietinformationen für Ihren Fahrradverleihshop mit PostgreSQL speichert." ] }, + "lab-world-cup-database": { + "title": "Erstellen einer Weltcup-Datenbank", + "intro": [ + "Für dieses Projekt erstellen Sie ein Bash-Skript, das Informationen von Weltcup-Spielen in PostgreSQL eingibt und dann die Datenbank nach nützlichen Statistiken abfragt." + ] + }, "lab-salon-appointment-scheduler": { "title": "Erstellen eines Terminplaners für einen Salon", "intro": [ @@ -2669,6 +2669,13 @@ "Sie üben bedingte Anweisungen, um die Note eines Schülers basierend auf seiner Punktzahl zu bestimmen." ] }, + "lab-story-fragment-restoration": { + "title": "Stellen Sie eine zusammenhängende Erzählung aus einem Array von Storyfragmenten wieder her", + "intro": [ + "In diesem Workshop stellen Sie eine zusammenhängende Erzählung aus einem beschädigten Array von Storyfragmenten wieder her.", + "Sie üben den Umgang mit Schleifen, indem Sie grundlegende Array-Algorithmen von Grund auf implementieren." + ] + }, "lecture-the-var-keyword-and-hoisting": { "title": "Das var-Schlüsselwort und Hoisting", "intro": [ @@ -3774,18 +3781,18 @@ "Lernen Sie das CSS-Box-Modell mit diesem Kurs. Verstehen Sie, wie Elemente im Web gerendert werden, und lernen Sie, Abstände, Rahmen und Innenabstände zu manipulieren, um Ihr gewünschtes Layout und Design zu erreichen." ] }, - "top-introduction-to-flexbox": { - "title": "Einführung in Flexbox", - "intro": [ - "Entdecken Sie die Kraft von Flexbox, einem Layout-Modell, das das Design flexibler und responsiver Weblayouts vereinfacht. Lernen Sie, dynamische und adaptive Seitenstrukturen mühelos zu erstellen." - ] - }, "top-learn-block-and-inline": { "title": "Den Unterschied zwischen Block und Inline lernen", "intro": [ "Erkunden Sie die Unterschiede zwischen Block- und Inline-Elementen in HTML und CSS. Dieser Kurs bietet Einblicke, wie diese Anzeigearten Layout und Verhalten beeinflussen, sodass Sie fundierte Designentscheidungen treffen können." ] }, + "top-introduction-to-flexbox": { + "title": "Einführung in Flexbox", + "intro": [ + "Entdecken Sie die Kraft von Flexbox, einem Layout-Modell, das das Design flexibler und responsiver Weblayouts vereinfacht. Lernen Sie, dynamische und adaptive Seitenstrukturen mühelos zu erstellen." + ] + }, "top-learn-variables-and-operators": { "title": "Variablen und Operatoren lernen", "intro": [ @@ -6287,12 +6294,6 @@ "Sie üben den Umgang mit Tailwind CSS Utility-Klassen für Flexbox-Layouts, Farben, Breakpoints und mehr." ] }, - "lab-photography-exhibit": { - "title": "Gestalten Sie eine Fotografie-Ausstellung", - "intro": [ - "In diesem Labor üben Sie den Umgang mit Tailwind CSS, indem Sie eine Webseite für eine Fotografie-Ausstellung gestalten." - ] - }, "review-css-libraries-and-frameworks": { "title": "Überblick über CSS-Bibliotheken und Frameworks", "intro": [ @@ -6306,6 +6307,12 @@ "Testen Sie Ihr Wissen über CSS-Bibliotheken und Frameworks mit diesem Quiz." ] }, + "lab-photography-exhibit": { + "title": "Gestalten Sie eine Fotografie-Ausstellung", + "intro": [ + "In diesem Labor üben Sie den Umgang mit Tailwind CSS, indem Sie eine Webseite für eine Fotografie-Ausstellung gestalten." + ] + }, "lecture-introduction-to-typescript": { "title": "Einführung in TypeScript", "intro": [ @@ -6372,18 +6379,6 @@ "In diesem Workshop üben Sie weiterhin den Umgang mit TypeScript, indem Sie eine Wahrsage-App erstellen." ] }, - "lab-flashcard-quiz-app": { - "title": "Erstellen Sie eine Lernkarten-Quiz-App", - "intro": [ - "In diesem Labor üben Sie die Verwendung von TypeScript, indem Sie eine Lernkarten-Quiz-App erstellen." - ] - }, - "lab-digital-pet-game": { - "title": "Erstellen Sie ein digitales Haustierspiel", - "intro": [ - "In diesem Labor wenden Sie Ihr Wissen über TypeScript und React an, indem Sie ein digitales Haustierspiel erstellen." - ] - }, "workshop-build-a-football-player-card-builder": { "title": "Erstellen Sie einen Fußballspieler-Karten-Generator", "intro": [ @@ -6401,6 +6396,18 @@ "title": "TypeScript-Quiz", "intro": ["Testen Sie Ihr Wissen über TypeScript mit diesem Quiz."] }, + "lab-flashcard-quiz-app": { + "title": "Erstellen Sie eine Lernkarten-Quiz-App", + "intro": [ + "In diesem Labor üben Sie die Verwendung von TypeScript, indem Sie eine Lernkarten-Quiz-App erstellen." + ] + }, + "lab-digital-pet-game": { + "title": "Erstellen Sie ein digitales Haustierspiel", + "intro": [ + "In diesem Labor wenden Sie Ihr Wissen über TypeScript und React an, indem Sie ein digitales Haustierspiel erstellen." + ] + }, "review-front-end-libraries": { "title": "Überblick über Front-End-Bibliotheken", "intro": [ @@ -7176,12 +7183,12 @@ "node-package-manager": "Node Package Manager", "lab-prime-number-checker-module": "Erstellen Sie ein Modul zum Prüfen von Primzahlen", "http-and-the-web-standards-model": "HTTP und das Web-Standards-Modell", - "rest-api-and-web-services": "REST API und Webservices", - "lab-timestamp-microservice": "Erstellen Sie einen Zeitstempel-Mikroservice", "introduction-to-express": "Einführung in Express", "lab-personal-profile-app": "Erstellen Sie eine persönliche Profil-Anwendung", - "error-handling-in-express": "Fehlerbehandlung in Express", "express-middleware": "Express-Middleware", + "rest-api-and-web-services": "REST API und Webservices", + "lab-timestamp-microservice": "Erstellen Sie einen Zeitstempel-Mikroservice", + "error-handling-in-express": "Fehlerbehandlung in Express", "websockets": "WebSockets", "lab-chat-app": "Erstellen Sie eine Chat-Anwendung", "security-and-privacy": "Sicherheit und Datenschutz", @@ -7192,109 +7199,91 @@ }, "module-intros": { "introduction-to-nodejs": { - "note": "Verfügbar Ende 2026", "intro": [ "In diesem Modul lernen Sie die Grundlagen der Arbeit mit Node.js." ] }, "nodejs-core-modules": { - "note": "Verfügbar Ende 2026", "intro": [ "In diesem Modul lernen Sie gängige Node.js-Kernmodule wie fs, os, path und weitere kennen. Anschließend üben Sie das Gelernte in Workshops und Laboren und testen Ihr Wissen mit einem kurzen Quiz." ] }, "node-package-manager": { - "note": "Verfügbar Ende 2026", "intro": [ "In diesem Modul lernen Sie den Node Package Manager kennen, mit dem Entwickler Projektabhängigkeiten und Skripte verwalten. Danach üben Sie das Gelernte in Workshops und Laboren und testen Ihr Wissen mit einem kurzen Quiz." ] }, "lab-prime-number-checker-module": { - "note": "Verfügbar Ende 2026", "intro": [ "Üben Sie das Erstellen und Exportieren eines npm-Moduls, indem Sie einen Primzahlprüfer erstellen." ] }, "http-and-the-web-standards-model": { - "note": "Verfügbar Ende 2026", "intro": [ "In diesem Modul lernen Sie HTTP (Hypertext Transfer Protocol) und weitere wichtige Konzepte wie das Anfrage-Antwort-Modell, gängige Antwortcodes, DNS, TCP/IP und mehr kennen. Anschließend bauen Sie in einem Workshop Ihren eigenen Webserver und testen Ihr Wissen mit einem kurzen Quiz." ] }, - "rest-api-and-web-services": { - "note": "Verfügbar Ende 2026", + "introduction-to-express": { "intro": [ - "In diesem Modul lernen Sie die REST API (Representational State Transfer Application Programming Interface) und die Funktionsweise von Microservices kennen. Danach absolvieren Sie ein kurzes Quiz zur Wissensüberprüfung." + "In diesem Modul lernen Sie Express.js kennen, ein Framework zum Erstellen von RESTful APIs. Anschließend üben Sie Ihre Fähigkeiten in Workshops und Laboren und testen Ihr Wissen mit einem kurzen Quiz." ] }, - "lab-timestamp-microservice": { - "note": "Verfügbar Ende 2026", + "lab-personal-profile-app": { "intro": [ - "Üben Sie das Erstellen einer RESTful-API mit Datumsanalyse, indem Sie einen Zeitstempel-Mikroservice erstellen." + "Üben Sie das Erstellen eines Express-Servers und einer JSON-API, indem Sie eine persönliche Profil-Anwendung erstellen." ] }, - "introduction-to-express": { - "note": "Verfügbar Ende 2026", + "express-middleware": { "intro": [ - "In diesem Modul lernen Sie Express.js kennen, ein Framework zum Erstellen von RESTful APIs. Anschließend üben Sie Ihre Fähigkeiten in Workshops und Laboren und testen Ihr Wissen mit einem kurzen Quiz." + "In diesem Modul lernen Sie Middleware in Express.js kennen, die Anfragen und Antworten zwischen Client und Server verarbeitet. Anschließend üben Sie Ihre Fähigkeiten in einem Workshop und Labor und testen Ihr Wissen mit einem kurzen Quiz." ] }, - "lab-personal-profile-app": { - "note": "Verfügbar Ende 2026", + "rest-api-and-web-services": { "intro": [ - "Üben Sie das Erstellen eines Express-Servers und einer JSON-API, indem Sie eine persönliche Profil-Anwendung erstellen." + "In diesem Modul lernen Sie die REST API (Representational State Transfer Application Programming Interface) und die Funktionsweise von Microservices kennen. Danach absolvieren Sie ein kurzes Quiz zur Wissensüberprüfung." ] }, - "error-handling-in-express": { - "note": "Verfügbar Ende 2026", + "lab-timestamp-microservice": { "intro": [ - "In diesem Modul lernen Sie, wie Fehlerbehandlung, Debugging und Gesundheitschecks in Express.js funktionieren. Danach üben Sie das Gelernte in einem Labor und testen Ihr Wissen mit einem kurzen Quiz." + "Üben Sie das Erstellen einer RESTful-API mit Datumsanalyse, indem Sie einen Zeitstempel-Mikroservice erstellen." ] }, - "express-middleware": { - "note": "Verfügbar Ende 2026", + "error-handling-in-express": { "intro": [ - "In diesem Modul lernen Sie Middleware in Express.js kennen, die Anfragen und Antworten zwischen Client und Server verarbeitet. Anschließend üben Sie Ihre Fähigkeiten in einem Workshop und Labor und testen Ihr Wissen mit einem kurzen Quiz." + "In diesem Modul lernen Sie, wie Fehlerbehandlung, Debugging und Gesundheitschecks in Express.js funktionieren. Danach üben Sie das Gelernte in einem Labor und testen Ihr Wissen mit einem kurzen Quiz." ] }, "websockets": { - "note": "Verfügbar Ende 2026", "intro": [ "In diesem Modul lernen Sie WebSockets kennen, ein Protokoll für die Echtzeitkommunikation zwischen Client und Server. Danach üben Sie das Gelernte in Laboren und Workshops und testen Ihr Wissen mit einem kurzen Quiz." ] }, "lab-chat-app": { - "note": "Verfügbar Ende 2026", "intro": [ "Üben Sie das Erstellen eines Echtzeit-Chatservers mit mehreren Clients unter Verwendung von Node.js-WebSockets." ] }, "security-and-privacy": { - "note": "Verfügbar Ende 2026", "intro": [ "In diesem Modul lernen Sie die Unterschiede zwischen Sicherheit und Datenschutz sowie weitere Konzepte wie CSPs, Permissions-Policies, PII, den Umgang mit CORS und mehr kennen. Anschließend absolvieren Sie ein kurzes Quiz zur Wissensüberprüfung." ] }, "authentication": { - "note": "Verfügbar Ende 2026", "intro": [ "In diesem Modul lernen Sie, wie Authentifizierung in Webanwendungen funktioniert, sowie weitere wichtige Konzepte wie JWTs, CSRFs, Passport, Helmet, Kryptografie und Verschlüsselung. Danach üben Sie das Gelernte in Laboren und Workshops und testen Ihr Wissen mit einem kurzen Quiz." ] }, "lab-family-movie-watchlist-api": { - "note": "Verfügbar Ende 2026", "intro": [ "Üben Sie die Implementierung von Authentifizierung und Autorisierung in einer Express-Anwendung, indem Sie eine API für eine Familien-Film-Watchlist erstellen." ] }, "back-end-development-and-apis-certification-exam": { - "note": "Verfügbar Ende 2026", "intro": [ "Bestehen Sie diese Prüfung, um Ihre Zertifizierung für Back-End-Entwicklung und APIs zu erhalten." ] }, "review-back-end-development-and-apis": { - "note": "Verfügbar Ende 2026", "intro": [ "Überprüfen Sie Konzepte der Back-End-Entwicklung und APIs, um sich auf die bevorstehende Prüfung vorzubereiten." ] @@ -7302,7 +7291,7 @@ }, "blocks": { "lecture-working-with-nodejs-and-event-driven-architecture": { - "title": "Arbeiten mit NodeJS und ereignisgesteuerter Architektur", + "title": "Arbeiten mit Node.js und ereignisgesteuerter Architektur", "intro": [ "Lernen Sie die Node.js-Kernbibliotheken kennen, wie Sie Node.js auf Ihrem Computer installieren und welche Vor- und Nachteile die Verwendung von Node.js im Back-End hat." ] @@ -7416,24 +7405,6 @@ "" ] }, - "lecture-understanding-rest-api-and-web-services": { - "title": "Verstehen der REST-API und Webservices", - "intro": [ - "In diesen Lektionen lernen Sie REST-APIs und Webservices kennen und wie sie verschiedenen Anwendungen ermöglichen, über das Internet miteinander zu kommunizieren." - ] - }, - "workshop-build-a-weather-service-api": { - "title": "Erstellen Sie eine Wetterdienst-API", - "intro": [ - "Sie lernen Routenparameter und modulare Routen mit express.Router kennen, indem Sie eine Wetterdienst-API erstellen." - ] - }, - "lab-timestamp-microservice": { - "title": "Erstellen Sie einen Timestamp-Mikroservice", - "intro": [ - "Üben Sie den Aufbau einer RESTful-API mit Datumsparselogik, indem Sie einen Timestamp-Mikroservice erstellen." - ] - }, "lecture-working-with-express": { "title": "Arbeiten mit Express", "intro": [ @@ -7453,16 +7424,10 @@ "Sie lernen grundlegendes Express-Routing und Antwortmethoden kennen, indem Sie eine App für zufällige Witze erstellen." ] }, - "lab-personal-profile-app": { - "title": "Erstellen Sie eine persönliche Profil-App", - "intro": [ - "Üben Sie den Aufbau eines Express-Servers und einer JSON-API, indem Sie eine persönliche Profilanwendung erstellen." - ] - }, "review-introduction-to-express": { "title": "Überprüfung der Einführung in Express", "intro": [ - "Überprüfen Sie Webservices, REST, Mikroservices und Express.js-Routing, bevor Sie das Quiz machen." + "Überprüfen Sie Express.js, Routing, Antwortmethoden und das Bereitstellen statischer Dateien, bevor Sie das Quiz absolvieren." ] }, "quiz-introduction-to-express": { @@ -7471,28 +7436,10 @@ "Testen Sie Ihr Wissen über Webservices, REST, Mikroservices, Express.js und Routing." ] }, - "lecture-understanding-error-handling-and-health-checks": { - "title": "Verstehen von Fehlerbehandlung und Gesundheitschecks", - "intro": [ - "In diesen Lektionen lernen Sie Fehlerbehandlung und Gesundheitschecks in Express kennen." - ] - }, - "workshop-build-a-bank-api": { - "title": "Erstellen Sie eine Bank-API", - "intro": [ - "Sie lernen Express 5 Fehlerbehandlung, Gesundheitschecks und sauberes Herunterfahren kennen, indem Sie eine Bank-API erstellen." - ] - }, - "review-error-handling-in-express": { - "title": "Überprüfung der Fehlerbehandlung in Express", - "intro": [ - "Überprüfen Sie HTTP-Statuscodes, Fehlerbehandlung, Debugging, Protokollierung, Gesundheitschecks und sanfte Abschaltungen, bevor Sie das Quiz machen." - ] - }, - "quiz-error-handling-in-express": { - "title": "Quiz zur Fehlerbehandlung in Express", + "lab-personal-profile-app": { + "title": "Erstellen Sie eine persönliche Profil-App", "intro": [ - "Testen Sie Ihr Wissen über HTTP-Statuscodes, Fehlerbehandlung, Debugging, Protokollierung, Gesundheitschecks und sanfte Abschaltungen." + "Üben Sie den Aufbau eines Express-Servers und einer JSON-API, indem Sie eine persönliche Profilanwendung erstellen." ] }, "lecture-express-middleware": { @@ -7525,6 +7472,54 @@ "Testen Sie Ihr Wissen über Express-Middleware, einschließlich Middleware auf Anwendungs- und Router-Ebene, Fehlerbehandlung sowie eingebaute und Drittanbieter-Middleware." ] }, + "lecture-understanding-rest-api-and-web-services": { + "title": "Verstehen der REST-API und Webservices", + "intro": [ + "In diesen Lektionen lernen Sie REST-APIs und Webservices kennen und wie sie verschiedenen Anwendungen ermöglichen, über das Internet miteinander zu kommunizieren." + ] + }, + "workshop-build-a-weather-service-api": { + "title": "Erstellen Sie eine Wetterdienst-API", + "intro": [ + "Sie lernen Routenparameter und modulare Routen mit express.Router kennen, indem Sie eine Wetterdienst-API erstellen." + ] + }, + "review-rest-api-and-web-services": { + "title": "Überprüfung von REST-API und Webservices", + "intro": [ + "Überprüfen Sie Webservices, die REST-Architektur, HTTP-Statuscodes und Microservices." + ] + }, + "lab-timestamp-microservice": { + "title": "Erstellen Sie einen Timestamp-Mikroservice", + "intro": [ + "Üben Sie den Aufbau einer RESTful-API mit Datumsparselogik, indem Sie einen Timestamp-Mikroservice erstellen." + ] + }, + "lecture-understanding-error-handling-and-health-checks": { + "title": "Verstehen von Fehlerbehandlung und Gesundheitschecks", + "intro": [ + "In diesen Lektionen lernen Sie Fehlerbehandlung und Gesundheitschecks in Express kennen." + ] + }, + "workshop-build-a-bank-api": { + "title": "Erstellen Sie eine Bank-API", + "intro": [ + "Sie lernen Express 5 Fehlerbehandlung, Gesundheitschecks und sauberes Herunterfahren kennen, indem Sie eine Bank-API erstellen." + ] + }, + "review-error-handling-in-express": { + "title": "Überprüfung der Fehlerbehandlung in Express", + "intro": [ + "Überprüfen Sie HTTP-Statuscodes, Fehlerbehandlung, Debugging, Protokollierung, Gesundheitschecks und sanfte Abschaltungen, bevor Sie das Quiz machen." + ] + }, + "quiz-error-handling-in-express": { + "title": "Quiz zur Fehlerbehandlung in Express", + "intro": [ + "Testen Sie Ihr Wissen über HTTP-Statuscodes, Fehlerbehandlung, Debugging, Protokollierung, Gesundheitschecks und sanfte Abschaltungen." + ] + }, "lecture-understanding-websockets": { "title": "Verstehen von WebSockets", "intro": [ @@ -8427,7 +8422,7 @@ "title": "Gestalten einer Café-Speisekarte", "intro": [ "CSS sagt dem Browser, wie Ihre Webseite angezeigt wird. Sie können CSS verwenden, um Farbe, Schriftart, Größe und andere Aspekte von HTML-Elementen festzulegen.", - "In diesem Workshop lernen Sie CSS, indem Sie eine Speisekartenseite für eine Café-Webseite gestalten." + "In diesem Workshop lernen Sie CSS, indem Sie eine Menüseite für ein Café gestalten." ] }, "lab-business-card": { @@ -9695,7 +9690,7 @@ "title": "Ein Café-Menü gestalten", "intro": [ "CSS sagt dem Browser, wie Ihre Webseite angezeigt werden soll. Sie können CSS verwenden, um Farbe, Schriftart, Größe und andere Aspekte von HTML-Elementen festzulegen.", - "In diesem Workshop lernen Sie CSS, indem Sie eine Menüseite für eine Café-Webseite gestalten." + "In diesem Workshop lernen Sie CSS, indem Sie eine Menüseite für ein Café gestalten." ] }, "lab-business-card": { diff --git a/client/german/translations.json b/client/german/translations.json index a8ce9164c9a..54f86c99808 100644 --- a/client/german/translations.json +++ b/client/german/translations.json @@ -558,6 +558,12 @@ "running-tests": "// Tests werden ausgeführt", "tests-completed": "// Tests abgeschlossen", "console-output": "// Konsolenausgabe", + "unavailable-local-resource": "Ressource konnte nicht geladen werden: „{{source}}“ ist keine verfügbare lokale {{resourceType}}-Datei. Verwenden Sie: {{allowedSources}}.", + "unavailable-local-resource-no-allowed": "Ressource konnte nicht geladen werden: „{{source}}“ ist in dieser Aufgabe keine verfügbare lokale {{resourceType}}-Datei.", + "local-resource-type": { + "stylesheet": "Stylesheet", + "script": "Skript" + }, "example-app": "Erstellen Sie eine App, die funktional <0>diesem Beispielprojekt ähnelt. Versuchen Sie, das Beispielprojekt nicht zu kopieren, sondern geben Sie ihm Ihren eigenen Stil.", "syntax-error": "Ihr Code hat einen Fehler verursacht, bevor Tests ausgeführt werden konnten. Bitte beheben Sie ihn und versuchen Sie es erneut.", "indentation-error": "Ihr Code enthält einen Einrückungsfehler. Möglicherweise müssen Sie pass in einer neuen Zeile hinzufügen, um einen gültigen Codeblock zu bilden.", @@ -656,25 +662,6 @@ "sub-step-7": "Klicken Sie auf die Schaltfläche <0>Geheimnis hinzufügen", "summary": "Codespaces-Einrichtung" }, - "ona": { - "intro": "Dieser Kurs läuft in einer virtuellen Linux-Maschine mit Ona. Folgen Sie diesen Anweisungen, um den Kurs zu starten:", - "step-1": "<0>Erstellen Sie ein Ona-Konto, falls Sie noch keines haben", - "step-2": "Klicken Sie unten auf die Start-Schaltfläche", - "step-3": "Klicken Sie im erscheinenden Modal auf die Schaltfläche Erstellen", - "step-4": "Sobald die virtuelle Linux-Maschine geladen ist, starten Sie die CodeRoad-Erweiterung, indem Sie:", - "step-5": "Auf das „Hamburger“-Menü oben links im VSCode-Fenster klicken,", - "step-6": "Zum <0>Ansicht-Menü gehen,", - "step-7": "Auf die Option <0>Befehls-Palette klicken,", - "step-8": "und den Befehl <0>CodeRoad: Start ausführen", - "step-9": "Folgen Sie den Anweisungen in CodeRoad, um den Kurs abzuschließen", - "continue-project": "Wenn Sie unten auf die Start-Schaltfläche klicken, wird ein neues Projekt gestartet. Wenn Sie den {{course}}-Kurs bereits begonnen haben, gehen Sie zu <0>Ihrem Ona-Dashboard, um fortzufahren.", - "learn-more": "Erfahren Sie mehr über <0>Ona-Arbeitsbereiche.", - "logout-warning": "Wenn Sie sich vor Abschluss des gesamten {{course}}-Kurses von freeCodeCamp abmelden, wird Ihr Fortschritt nicht in Ihrem freeCodeCamp-Konto gespeichert.", - "sub-step-3": "Navigieren Sie zu Ihrer <0>Ona-Geheimnisse-Seite", - "sub-step-4": "Erstellen Sie ein neues Geheimnis mit dem Namen <0>CODEROAD_WEBHOOK_TOKEN", - "sub-step-5": "Fügen Sie im Feld <0>Geheimnis Ihren Token ein", - "summary": "Ona-Einrichtung" - }, "freecodecamp-os": { "token-modal": "Wenn Sie den Kurs starten, erscheint ein Modal, das nach Ihrem Benutzertoken fragt. Fügen Sie das oben kopierte Token dort ein. Dies müssen Sie pro Umgebung nur einmal tun.", "local": { @@ -697,16 +684,6 @@ "step-5": "Der Simple Browser öffnet sich, wenn er fertig ist. Wenn die Seite weiß und leer ist, verwenden Sie die Aktualisieren-Schaltfläche, um sie zu aktualisieren und die Kurs-Startseite zu sehen.", "step-6": "Klicken Sie auf eines der verfügbaren Projekte, um es zu starten, und folgen Sie dann den Anweisungen im Projekt, um es abzuschließen.", "continue-project": "Wenn Sie unten auf die Start-Schaltfläche klicken, wird eine neue Maschine gestartet. Wenn Sie den {{title}}-Kurs bereits begonnen haben, gehen Sie zur <0>Repository-Seite, um einen vorherigen Arbeitsbereich erneut zu öffnen." - }, - "ona": { - "intro": "Dieser Kurs läuft in einer virtuellen Linux-Maschine mit Ona und der freeCodeCamp - Courses VS Code-Erweiterung. Folgen Sie diesen Anweisungen, um den Kurs zu starten:", - "step-1": "<0>Erstellen Sie ein Ona-Konto, falls Sie noch keines haben", - "step-2": "Klicken Sie auf die Start-Schaltfläche unten", - "step-3": "Klicken Sie im erscheinenden Modal auf die Erstellen-Schaltfläche", - "step-4": "Sobald die virtuelle Linux-Maschine geladen ist, öffnen Sie die Befehlspalette und führen Sie den Befehl <0>freeCodeCamp: Run Course aus", - "step-5": "Der Simple Browser öffnet sich, wenn er fertig ist. Wenn die Seite weiß und leer ist, verwenden Sie die Aktualisieren-Schaltfläche, um sie zu aktualisieren und die Kurs-Startseite zu sehen.", - "step-6": "Klicken Sie auf eines der verfügbaren Projekte, um es zu starten, und folgen Sie dann den Anweisungen im Projekt, um es abzuschließen.", - "continue-project": "Wenn Sie unten auf die Start-Schaltfläche klicken, wird eine neue Maschine gestartet. Wenn Sie den {{course}}-Kurs bereits begonnen haben, gehen Sie zu <0>Ihrem Ona-Dashboard, um fortzufahren." } }, "local": { diff --git a/client/italian/intro.json b/client/italian/intro.json index 055cfc30682..a4a218a5cf2 100644 --- a/client/italian/intro.json +++ b/client/italian/intro.json @@ -1352,12 +1352,6 @@ "In questo laboratorio di 140 lezioni, completerai il tuo database studenti approfondendo i comandi SQL." ] }, - "lab-world-cup-database": { - "title": "Crea un database della Coppa del Mondo", - "intro": [ - "Per questo progetto, creerai uno script Bash che inserisce informazioni sulle partite della Coppa del Mondo in PostgreSQL, quindi interrogherai il database per statistiche utili." - ] - }, "workshop-kitty-ipsum-translator": { "title": "Crea un traduttore Kitty Ipsum", "intro": [ @@ -1371,6 +1365,12 @@ "In questo laboratorio di 210 lezioni, costruirai un programma Bash interattivo che archivia le informazioni di noleggio per il tuo negozio di biciclette usando PostgreSQL." ] }, + "lab-world-cup-database": { + "title": "Crea un database della Coppa del Mondo", + "intro": [ + "Per questo progetto, creerai uno script Bash che inserisce informazioni sulle partite della Coppa del Mondo in PostgreSQL, quindi interrogherai il database per statistiche utili." + ] + }, "lab-salon-appointment-scheduler": { "title": "Crea un pianificatore di appuntamenti per saloni", "intro": [ @@ -2669,6 +2669,13 @@ "Praticherai le condizioni per determinare il voto dello studente in base al suo punteggio." ] }, + "lab-story-fragment-restoration": { + "title": "Ripristina una narrazione coerente da un array di frammenti di storia", + "intro": [ + "In questo laboratorio, ripristinerai una narrazione coerente da un array corrotto di frammenti di storia.", + "Allenerai l'uso dei loop implementando da zero algoritmi fondamentali per gli array." + ] + }, "lecture-the-var-keyword-and-hoisting": { "title": "La parola chiave var e l'hoisting", "intro": [ @@ -3774,18 +3781,18 @@ "Impara il modello a riquadro CSS con questo corso. Comprendi come gli elementi vengono renderizzati sul web e impara a manipolare spaziature, bordi e spaziatura interna per ottenere il layout e il design desiderati." ] }, - "top-introduction-to-flexbox": { - "title": "Introduzione a Flexbox", - "intro": [ - "Scopri la potenza di Flexbox, un modello di layout che semplifica la progettazione di layout web flessibili e responsivi. Impara a creare strutture di pagina dinamiche e adattive con facilità." - ] - }, "top-learn-block-and-inline": { "title": "Impara la differenza tra blocco e in linea", "intro": [ "Esplora le differenze tra elementi a blocco e in linea in HTML e CSS. Questo corso offre approfondimenti su come questi tipi di visualizzazione influenzano il layout e il comportamento, permettendoti di prendere decisioni di design informate." ] }, + "top-introduction-to-flexbox": { + "title": "Introduzione a Flexbox", + "intro": [ + "Scopri la potenza di Flexbox, un modello di layout che semplifica la progettazione di layout web flessibili e responsivi. Impara a creare strutture di pagina dinamiche e adattive con facilità." + ] + }, "top-learn-variables-and-operators": { "title": "Impara variabili e operatori", "intro": [ @@ -6287,12 +6294,6 @@ "Metterai in pratica l'uso delle classi utility di Tailwind CSS per layout flexbox, colori, breakpoint e altro." ] }, - "lab-photography-exhibit": { - "title": "Progetta una mostra fotografica", - "intro": [ - "In questo laboratorio metterai in pratica Tailwind CSS progettando una pagina web per una mostra fotografica." - ] - }, "review-css-libraries-and-frameworks": { "title": "Revisione di librerie e framework CSS", "intro": [ @@ -6306,6 +6307,12 @@ "Metti alla prova ciò che hai imparato su librerie e framework CSS con questo quiz." ] }, + "lab-photography-exhibit": { + "title": "Progetta una mostra fotografica", + "intro": [ + "In questo laboratorio metterai in pratica Tailwind CSS progettando una pagina web per una mostra fotografica." + ] + }, "lecture-introduction-to-typescript": { "title": "Introduzione a TypeScript", "intro": [ @@ -6372,18 +6379,6 @@ "In questo workshop, continuerai a praticare TypeScript costruendo un'app di lettura della fortuna." ] }, - "lab-flashcard-quiz-app": { - "title": "Crea un'app quiz con flashcard", - "intro": [ - "In questo laboratorio, praticherai l'uso di TypeScript costruendo un'app quiz con flashcard." - ] - }, - "lab-digital-pet-game": { - "title": "Crea un gioco con animale digitale", - "intro": [ - "In questo laboratorio, metterai in pratica ciò che hai imparato su TypeScript e React costruendo un gioco con animale digitale." - ] - }, "workshop-build-a-football-player-card-builder": { "title": "Crea un generatore di schede giocatore di calcio", "intro": [ @@ -6401,6 +6396,18 @@ "title": "Quiz su TypeScript", "intro": ["Metti alla prova ciò che hai imparato su TypeScript con questo quiz."] }, + "lab-flashcard-quiz-app": { + "title": "Crea un'app quiz con flashcard", + "intro": [ + "In questo laboratorio, praticherai l'uso di TypeScript costruendo un'app quiz con flashcard." + ] + }, + "lab-digital-pet-game": { + "title": "Crea un gioco con animale digitale", + "intro": [ + "In questo laboratorio, metterai in pratica ciò che hai imparato su TypeScript e React costruendo un gioco con animale digitale." + ] + }, "review-front-end-libraries": { "title": "Revisione delle librerie front-end", "intro": [ @@ -7176,12 +7183,12 @@ "node-package-manager": "Gestore pacchetti Node", "lab-prime-number-checker-module": "Crea un modulo per verificare i numeri primi", "http-and-the-web-standards-model": "HTTP e il modello degli standard web", - "rest-api-and-web-services": "REST API e servizi web", - "lab-timestamp-microservice": "Crea un microservizio per timestamp", "introduction-to-express": "Introduzione a Express", "lab-personal-profile-app": "Crea un'app per profili personali", - "error-handling-in-express": "Gestione degli errori in Express", "express-middleware": "Middleware di Express", + "rest-api-and-web-services": "REST API e servizi web", + "lab-timestamp-microservice": "Crea un microservizio per timestamp", + "error-handling-in-express": "Gestione degli errori in Express", "websockets": "WebSocket", "lab-chat-app": "Crea un'app di chat", "security-and-privacy": "Sicurezza e privacy", @@ -7192,109 +7199,91 @@ }, "module-intros": { "introduction-to-nodejs": { - "note": "In arrivo a fine 2026", "intro": [ "In questo modulo imparerai le basi per lavorare con Node.js." ] }, "nodejs-core-modules": { - "note": "In arrivo a fine 2026", "intro": [ "In questo modulo imparerai i moduli core comuni di Node.js come fs, os, path e altri. Poi potrai mettere in pratica ciò che hai imparato con workshop e laboratori e verificare le tue conoscenze con un breve quiz." ] }, "node-package-manager": { - "note": "In arrivo a fine 2026", "intro": [ "In questo modulo sarai introdotto al Node Package Manager, che gli sviluppatori usano per gestire le dipendenze e gli script del progetto. Poi potrai mettere in pratica ciò che hai imparato con workshop e laboratori e verificare le tue conoscenze con un breve quiz." ] }, "lab-prime-number-checker-module": { - "note": "In arrivo a fine 2026", "intro": [ "Esercitati a creare ed esportare un modulo npm realizzando un verificatore di numeri primi." ] }, "http-and-the-web-standards-model": { - "note": "In arrivo a fine 2026", "intro": [ "In questo modulo imparerai HTTP (Hypertext Transfer Protocol) e altri concetti importanti come il modello richiesta-risposta, i codici di risposta comuni, DNS, TCP/IP e altro. Poi potrai mettere in pratica ciò che hai imparato costruendo un tuo server web in un workshop e verificare le tue conoscenze con un breve quiz." ] }, - "rest-api-and-web-services": { - "note": "In arrivo a fine 2026", + "introduction-to-express": { "intro": [ - "In questo modulo imparerai la REST API (trasferimento di stato rappresentazionale) e come funzionano i microservizi. Poi farai un breve quiz per verificare le tue conoscenze." + "In questo modulo sarai introdotto a Express.js, un framework usato per costruire API RESTful. Poi metterai in pratica le tue abilità con workshop e laboratori e verificherai le tue conoscenze con un breve quiz." ] }, - "lab-timestamp-microservice": { - "note": "In arrivo a fine 2026", + "lab-personal-profile-app": { "intro": [ - "Esercitati a creare un'API RESTful con logica di parsing delle date realizzando un microservizio per timestamp." + "Esercitati a creare un server express e un'API JSON realizzando un'applicazione per profili personali." ] }, - "introduction-to-express": { - "note": "In arrivo a fine 2026", + "express-middleware": { "intro": [ - "In questo modulo sarai introdotto a Express.js, un framework usato per costruire API RESTful. Poi metterai in pratica le tue abilità con workshop e laboratori e verificherai le tue conoscenze con un breve quiz." + "In questo modulo imparerai il middleware in Express.js, usato per gestire le richieste e le risposte tra client e server. Poi metterai in pratica le tue abilità con un workshop e un laboratorio e verificherai le tue conoscenze con un breve quiz." ] }, - "lab-personal-profile-app": { - "note": "In arrivo a fine 2026", + "rest-api-and-web-services": { "intro": [ - "Esercitati a creare un server express e un'API JSON realizzando un'applicazione per profili personali." + "In questo modulo imparerai la REST API (trasferimento di stato rappresentazionale) e come funzionano i microservizi. Poi farai un breve quiz per verificare le tue conoscenze." ] }, - "error-handling-in-express": { - "note": "In arrivo a fine 2026", + "lab-timestamp-microservice": { "intro": [ - "In questo modulo imparerai come funziona la gestione degli errori, il debugging e i controlli di salute in Express.js. Poi metterai in pratica ciò che hai imparato in un laboratorio e verificherai le tue conoscenze con un breve quiz." + "Esercitati a creare un'API RESTful con logica di parsing delle date realizzando un microservizio per timestamp." ] }, - "express-middleware": { - "note": "In arrivo a fine 2026", + "error-handling-in-express": { "intro": [ - "In questo modulo imparerai il middleware in Express.js, usato per gestire le richieste e le risposte tra client e server. Poi metterai in pratica le tue abilità con un workshop e un laboratorio e verificherai le tue conoscenze con un breve quiz." + "In questo modulo imparerai come funziona la gestione degli errori, il debugging e i controlli di salute in Express.js. Poi metterai in pratica ciò che hai imparato in un laboratorio e verificherai le tue conoscenze con un breve quiz." ] }, "websockets": { - "note": "In arrivo a fine 2026", "intro": [ "In questo modulo sarai introdotto ai websocket, un protocollo usato per la comunicazione in tempo reale tra client e server. Poi metterai in pratica ciò che hai imparato in laboratori e workshop e verificherai le tue conoscenze con un breve quiz." ] }, "lab-chat-app": { - "note": "In arrivo a fine 2026", "intro": [ "Esercitati a creare un server di chat in tempo reale multi-client usando WebSocket di Node.js." ] }, "security-and-privacy": { - "note": "In arrivo a fine 2026", "intro": [ "In questo modulo imparerai le differenze tra sicurezza e privacy e altri concetti come CSP, Permissions-Policies, PII, lavoro con CORS e altro. Poi farai un breve quiz per verificare le tue conoscenze." ] }, "authentication": { - "note": "In arrivo a fine 2026", "intro": [ "In questo modulo imparerai come funziona l'autenticazione nelle applicazioni web insieme ad altri concetti importanti come JWT, CSRF, Passport, Helmet, crittografia e cifratura e altro. Poi metterai in pratica ciò che hai imparato in laboratori e workshop e verificherai le tue conoscenze con un breve quiz." ] }, "lab-family-movie-watchlist-api": { - "note": "In arrivo a fine 2026", "intro": [ "Esercitati a implementare autenticazione e autorizzazione in un'applicazione express creando un'API per la lista film di famiglia." ] }, "back-end-development-and-apis-certification-exam": { - "note": "In arrivo a fine 2026", "intro": [ "Supera questo esame per ottenere la certificazione in sviluppo back-end e API." ] }, "review-back-end-development-and-apis": { - "note": "In arrivo a fine 2026", "intro": [ "Rivedi i concetti di sviluppo back-end e API per prepararti al prossimo esame." ] @@ -7302,7 +7291,7 @@ }, "blocks": { "lecture-working-with-nodejs-and-event-driven-architecture": { - "title": "Lavorare con NodeJS e architettura event driven", + "title": "Lavorare con Node.js e l'architettura basata su eventi", "intro": [ "Scopri le librerie core di Node.js, come installare Node.js sul tuo computer e i vantaggi e svantaggi di usare Node.js nel back-end." ] @@ -7416,24 +7405,6 @@ "" ] }, - "lecture-understanding-rest-api-and-web-services": { - "title": "Comprendere le API REST e i servizi web", - "intro": [ - "In queste lezioni imparerai le API REST e i servizi web, e come permettono a diverse applicazioni di comunicare tra loro su internet." - ] - }, - "workshop-build-a-weather-service-api": { - "title": "Crea un'API per un servizio meteo", - "intro": [ - "Imparerai i parametri di rotta e il routing modulare con express.Router costruendo un'API per un servizio meteo." - ] - }, - "lab-timestamp-microservice": { - "title": "Costruisci un microservizio timestamp", - "intro": [ - "Esercitati a costruire un'API RESTful con logica di parsing delle date creando un microservizio timestamp." - ] - }, "lecture-working-with-express": { "title": "Lavorare con Express", "intro": [ @@ -7453,16 +7424,10 @@ "Imparerai il routing base di Express e i metodi di risposta costruendo un'app di barzellette casuali." ] }, - "lab-personal-profile-app": { - "title": "Costruisci un'app di profilo personale", - "intro": [ - "Esercitati a costruire un server Express e un'API JSON creando un'applicazione di profilo personale." - ] - }, "review-introduction-to-express": { "title": "Revisione introduttiva a Express", "intro": [ - "Rivedi i servizi web, REST, microservizi e il routing di Express.js prima di fare il quiz." + "Ripassa Express.js, il routing, i metodi di risposta e la gestione dei file statici prima di affrontare il quiz." ] }, "quiz-introduction-to-express": { @@ -7471,28 +7436,10 @@ "Metti alla prova le tue conoscenze su servizi web, REST, microservizi, Express.js e routing." ] }, - "lecture-understanding-error-handling-and-health-checks": { - "title": "Comprendere la gestione degli errori e i controlli di integrità", - "intro": [ - "In queste lezioni imparerai la gestione degli errori e i controlli di integrità in Express." - ] - }, - "workshop-build-a-bank-api": { - "title": "Crea un'API bancaria", - "intro": [ - "Imparerai la gestione degli errori in Express 5, i controlli di salute e le chiusure graduali costruendo un'API bancaria." - ] - }, - "review-error-handling-in-express": { - "title": "Revisione della gestione degli errori in Express", - "intro": [ - "Rivedi i codici di stato HTTP, la gestione degli errori, il debugging, il logging, i controlli di integrità e le chiusure graduali prima di fare il quiz." - ] - }, - "quiz-error-handling-in-express": { - "title": "Quiz sulla gestione degli errori in Express", + "lab-personal-profile-app": { + "title": "Costruisci un'app di profilo personale", "intro": [ - "Metti alla prova le tue conoscenze su codici di stato HTTP, gestione degli errori, debugging, logging, controlli di integrità e chiusure graduali." + "Esercitati a costruire un server Express e un'API JSON creando un'applicazione di profilo personale." ] }, "lecture-express-middleware": { @@ -7525,6 +7472,54 @@ "Metti alla prova le tue conoscenze sul middleware di Express, inclusi middleware a livello di applicazione, router, gestione degli errori e middleware integrati e di terze parti." ] }, + "lecture-understanding-rest-api-and-web-services": { + "title": "Comprendere le API REST e i servizi web", + "intro": [ + "In queste lezioni imparerai le API REST e i servizi web, e come permettono a diverse applicazioni di comunicare tra loro su internet." + ] + }, + "workshop-build-a-weather-service-api": { + "title": "Crea un'API per un servizio meteo", + "intro": [ + "Imparerai i parametri di rotta e il routing modulare con express.Router costruendo un'API per un servizio meteo." + ] + }, + "review-rest-api-and-web-services": { + "title": "Revisione delle API REST e dei servizi web", + "intro": [ + "Ripassa i servizi web, l'architettura REST, i codici di stato HTTP e i microservizi." + ] + }, + "lab-timestamp-microservice": { + "title": "Costruisci un microservizio timestamp", + "intro": [ + "Esercitati a costruire un'API RESTful con logica di parsing delle date creando un microservizio timestamp." + ] + }, + "lecture-understanding-error-handling-and-health-checks": { + "title": "Comprendere la gestione degli errori e i controlli di integrità", + "intro": [ + "In queste lezioni imparerai la gestione degli errori e i controlli di integrità in Express." + ] + }, + "workshop-build-a-bank-api": { + "title": "Crea un'API bancaria", + "intro": [ + "Imparerai la gestione degli errori in Express 5, i controlli di salute e le chiusure graduali costruendo un'API bancaria." + ] + }, + "review-error-handling-in-express": { + "title": "Revisione della gestione degli errori in Express", + "intro": [ + "Rivedi i codici di stato HTTP, la gestione degli errori, il debugging, il logging, i controlli di integrità e le chiusure graduali prima di fare il quiz." + ] + }, + "quiz-error-handling-in-express": { + "title": "Quiz sulla gestione degli errori in Express", + "intro": [ + "Metti alla prova le tue conoscenze su codici di stato HTTP, gestione degli errori, debugging, logging, controlli di integrità e chiusure graduali." + ] + }, "lecture-understanding-websockets": { "title": "Comprendere i WebSocket", "intro": [ @@ -8427,7 +8422,7 @@ "title": "Progetta un menu per un caffè", "intro": [ "Il CSS dice al browser come visualizzare la tua pagina web. Puoi usare il CSS per impostare il colore, il carattere tipografico, la dimensione e altri aspetti degli elementi HTML.", - "In questo workshop imparerai il CSS progettando una pagina menu per un sito web di un caffè." + "In questo workshop imparerai CSS progettando una pagina menu per un caffè." ] }, "lab-business-card": { @@ -9695,7 +9690,7 @@ "title": "Progetta un menu per un caffè", "intro": [ "Il CSS dice al browser come mostrare la tua pagina web. Puoi usare il CSS per impostare il colore, il carattere tipografico, la dimensione e altri aspetti degli elementi HTML.", - "In questo workshop imparerai il CSS progettando una pagina menu per un sito web di un caffè." + "In questo workshop imparerai CSS progettando una pagina menu per un caffè." ] }, "lab-business-card": { diff --git a/client/italian/translations.json b/client/italian/translations.json index 845406ac569..05a197467f4 100644 --- a/client/italian/translations.json +++ b/client/italian/translations.json @@ -558,6 +558,12 @@ "running-tests": "// esecuzione dei test", "tests-completed": "// test completati", "console-output": "// output della console", + "unavailable-local-resource": "Caricamento risorsa fallito: \"{{source}}\" non è un file {{resourceType}} locale disponibile. Usa: {{allowedSources}}.", + "unavailable-local-resource-no-allowed": "Caricamento risorsa fallito: \"{{source}}\" non è un file {{resourceType}} locale disponibile in questa sfida.", + "local-resource-type": { + "stylesheet": "foglio di stile", + "script": "script" + }, "example-app": "Crea un'app che sia funzionalmente simile a <0>questo progetto di esempio. Cerca di non copiare il progetto, dagli il tuo stile personale.", "syntax-error": "Il tuo codice ha generato un errore prima che potessero partire i test. Correggilo e riprova.", "indentation-error": "Il tuo codice ha un errore di indentazione. Potresti dover aggiungere pass su una nuova riga per formare un blocco di codice valido.", @@ -656,25 +662,6 @@ "sub-step-7": "Clicca il pulsante <0>Aggiungi segreto", "summary": "Configurazione di Codespaces" }, - "ona": { - "intro": "Questo corso si svolge in una macchina virtuale Linux usando Ona. Segui queste istruzioni per iniziare il corso:", - "step-1": "<0>Crea un account Ona se non ne hai uno", - "step-2": "Clicca il pulsante di avvio qui sotto", - "step-3": "Nel modale che appare, clicca il pulsante crea", - "step-4": "Quando la macchina virtuale Linux ha finito di caricarsi, avvia l'estensione CodeRoad facendo:", - "step-5": "Clic sul menu “hamburger” vicino all'angolo in alto a sinistra della finestra di VSCode,", - "step-6": "Vai al menu <0>Visualizza,", - "step-7": "Clicca sull'opzione <0>Palette comandi,", - "step-8": "e esegui il comando <0>CodeRoad: Start", - "step-9": "Segui le istruzioni in CodeRoad per completare il corso", - "continue-project": "Cliccando il pulsante di avvio qui sotto inizierai un nuovo progetto. Se hai già iniziato il corso {{course}}, vai al <0>tuo cruscotto Ona per continuare.", - "learn-more": "Scopri di più sugli <0>spazi di lavoro Ona.", - "logout-warning": "Se esci da freeCodeCamp prima di completare l'intero corso {{course}}, i tuoi progressi non saranno salvati nel tuo account freeCodeCamp.", - "sub-step-3": "Vai alla tua <0>pagina dei segreti di Ona", - "sub-step-4": "Crea un nuovo segreto chiamato <0>CODEROAD_WEBHOOK_TOKEN", - "sub-step-5": "Nel campo <0>Segreto, incolla il tuo token", - "summary": "Configurazione di Ona" - }, "freecodecamp-os": { "token-modal": "Quando avvii il corso, apparirà una finestra modale che chiede il tuo token utente. Incolla il token che hai copiato sopra. Devi farlo solo una volta per ogni ambiente.", "local": { @@ -697,16 +684,6 @@ "step-5": "Quando ha finito, si aprirà il Simple Browser. Se vedi una pagina bianca vuota, usa il pulsante aggiorna per aggiornare e vedere la pagina iniziale del corso.", "step-6": "Clicca su uno dei progetti disponibili per iniziarlo, poi segui le istruzioni nel progetto per completarlo.", "continue-project": "Cliccando il pulsante di avvio qui sotto si avvierà una nuova macchina. Se hai già iniziato il corso {{title}}, vai alla <0>pagina del repository per riaprire uno spazio di lavoro precedente." - }, - "ona": { - "intro": "Questo corso viene eseguito in una macchina virtuale Linux usando Ona e l'estensione freeCodeCamp - Courses per VS Code. Segui queste istruzioni per avviare il corso:", - "step-1": "<0>Crea un account Ona se non ne hai uno", - "step-2": "Clicca il pulsante di avvio qui sotto", - "step-3": "Nella finestra modale che appare, clicca il pulsante crea", - "step-4": "Quando la macchina virtuale Linux ha finito di caricarsi, apri la palette comandi ed esegui il comando <0>freeCodeCamp: Run Course", - "step-5": "Quando ha finito, si aprirà il Simple Browser. Se vedi una pagina bianca vuota, usa il pulsante aggiorna per aggiornare e vedere la pagina iniziale del corso.", - "step-6": "Clicca su uno dei progetti disponibili per iniziarlo, poi segui le istruzioni nel progetto per completarlo.", - "continue-project": "Cliccando il pulsante di avvio qui sotto si avvierà una nuova macchina. Se hai già iniziato il corso {{course}}, vai al <0>tuo cruscotto Ona per continuare." } }, "local": { diff --git a/client/japanese/intro.json b/client/japanese/intro.json index 71fdef60f9b..8c0f2cace03 100644 --- a/client/japanese/intro.json +++ b/client/japanese/intro.json @@ -1352,12 +1352,6 @@ "この140レッスンのワークショップでは、SQLコマンドをさらに深く学びながら学生データベースを完成させます。" ] }, - "lab-world-cup-database": { - "title": "ワールドカップデータベースを作成する", - "intro": [ - "このプロジェクトでは、ワールドカップの試合情報をPostgreSQLに入力するBashスクリプトを作成し、データベースから有用な統計をクエリします。" - ] - }, "workshop-kitty-ipsum-translator": { "title": "キティイプサム翻訳機を作成する", "intro": [ @@ -1371,6 +1365,12 @@ "この210レッスンのワークショップでは、PostgreSQLを使ってレンタル情報を保存するインタラクティブなBashプログラムを作成します。" ] }, + "lab-world-cup-database": { + "title": "ワールドカップデータベースを作成する", + "intro": [ + "このプロジェクトでは、ワールドカップの試合情報をPostgreSQLに入力するBashスクリプトを作成し、データベースから有用な統計をクエリします。" + ] + }, "lab-salon-appointment-scheduler": { "title": "サロン予約スケジューラーを作成する", "intro": [ @@ -2669,6 +2669,13 @@ "スコアに基づいて学生の成績を判定する条件分岐を練習します。" ] }, + "lab-story-fragment-restoration": { + "title": "配列のストーリー断片から一貫した物語を復元する", + "intro": [ + "このワークショップでは、破損したストーリー断片の配列から一貫した物語を復元します。", + "ループを使った基本的な配列アルゴリズムを一から実装して練習します。" + ] + }, "lecture-the-var-keyword-and-hoisting": { "title": "varキーワードとホイスティング", "intro": [ @@ -3774,18 +3781,18 @@ "このコースでCSSのボックスモデルを学びます。ウェブ上で要素がどのようにレンダリングされるかを理解し、スペース、ボーダー、パディングを操作して望むレイアウトとデザインを実現しましょう。" ] }, - "top-introduction-to-flexbox": { - "title": "Flexbox入門", - "intro": [ - "Flexboxの力を発見しましょう。これは柔軟でレスポンシブなウェブレイアウトの設計を簡単にするレイアウトモデルです。動的で適応的なページ構造を簡単に作成する方法を学びます。" - ] - }, "top-learn-block-and-inline": { "title": "ブロックとインラインの違いを学ぶ", "intro": [ "HTMLとCSSにおけるブロック要素とインライン要素の違いを探求しましょう。このコースはこれらの表示タイプがレイアウトや動作にどのように影響するかを解説し、情報に基づいたデザイン判断を可能にします。" ] }, + "top-introduction-to-flexbox": { + "title": "Flexbox入門", + "intro": [ + "Flexboxの力を発見しましょう。これは柔軟でレスポンシブなウェブレイアウトの設計を簡単にするレイアウトモデルです。動的で適応的なページ構造を簡単に作成する方法を学びます。" + ] + }, "top-learn-variables-and-operators": { "title": "変数と演算子を学ぶ", "intro": [ @@ -6287,12 +6294,6 @@ "Tailwind CSSのフレックスボックスレイアウト、カラー、ブレークポイントなどのユーティリティクラスを使う練習をします。" ] }, - "lab-photography-exhibit": { - "title": "写真展のデザインをする", - "intro": [ - "このラボではTailwind CSSを使って写真展のウェブページをデザインする練習をします。" - ] - }, "review-css-libraries-and-frameworks": { "title": "CSSライブラリとフレームワークの復習", "intro": [ @@ -6306,6 +6307,12 @@ "CSSライブラリとフレームワークについて学んだことをこのクイズで試しましょう。" ] }, + "lab-photography-exhibit": { + "title": "写真展のデザインをする", + "intro": [ + "このラボではTailwind CSSを使って写真展のウェブページをデザインする練習をします。" + ] + }, "lecture-introduction-to-typescript": { "title": "TypeScript入門", "intro": [ @@ -6372,18 +6379,6 @@ "このワークショップでは、TypeScriptの扱いを続けて練習しながら占いアプリを作成します。" ] }, - "lab-flashcard-quiz-app": { - "title": "フラッシュカードクイズアプリを作る", - "intro": [ - "このラボでは、TypeScriptを使ってフラッシュカードクイズアプリを作成します。" - ] - }, - "lab-digital-pet-game": { - "title": "デジタルペットゲームを作る", - "intro": [ - "このラボでは、TypeScriptとReactで学んだことを活かしてデジタルペットゲームを作成します。" - ] - }, "workshop-build-a-football-player-card-builder": { "title": "フットボール選手カードビルダーを作る", "intro": [ @@ -6401,6 +6396,18 @@ "title": "TypeScriptクイズ", "intro": ["このクイズでTypeScriptの学習内容をテストしてください。"] }, + "lab-flashcard-quiz-app": { + "title": "フラッシュカードクイズアプリを作る", + "intro": [ + "このラボでは、TypeScriptを使ってフラッシュカードクイズアプリを作成します。" + ] + }, + "lab-digital-pet-game": { + "title": "デジタルペットゲームを作る", + "intro": [ + "このラボでは、TypeScriptとReactで学んだことを活かしてデジタルペットゲームを作成します。" + ] + }, "review-front-end-libraries": { "title": "フロントエンドライブラリ復習", "intro": [ @@ -7176,12 +7183,12 @@ "node-package-manager": "Nodeパッケージマネージャー", "lab-prime-number-checker-module": "素数チェッカーモジュールを作成する", "http-and-the-web-standards-model": "HTTPとウェブ標準モデル", - "rest-api-and-web-services": "REST APIとウェブサービス", - "lab-timestamp-microservice": "タイムスタンプマイクロサービスを作成する", "introduction-to-express": "Express入門", "lab-personal-profile-app": "個人プロフィールアプリケーションを作成する", - "error-handling-in-express": "Expressのエラーハンドリング", "express-middleware": "Expressミドルウェア", + "rest-api-and-web-services": "REST APIとウェブサービス", + "lab-timestamp-microservice": "タイムスタンプマイクロサービスを作成する", + "error-handling-in-express": "Expressのエラーハンドリング", "websockets": "WebSockets", "lab-chat-app": "チャットアプリを作成する", "security-and-privacy": "セキュリティとプライバシー", @@ -7192,109 +7199,91 @@ }, "module-intros": { "introduction-to-nodejs": { - "note": "2026年後半公開予定", "intro": [ "このモジュールでは、Node.jsの基本的な使い方を学びます。" ] }, "nodejs-core-modules": { - "note": "2026年後半公開予定", "intro": [ "このモジュールでは、fs、os、pathなどの一般的なNode.jsコアモジュールについて学びます。その後、ワークショップやラボで学んだことを実践し、短いクイズで知識を確認します。" ] }, "node-package-manager": { - "note": "2026年後半公開予定", "intro": [ "このモジュールでは、開発者がプロジェクトの依存関係やスクリプトを管理するために使うNodeパッケージマネージャーを紹介します。その後、ワークショップやラボで学んだことを実践し、短いクイズで知識を確認します。" ] }, "lab-prime-number-checker-module": { - "note": "2026年後半公開予定", "intro": [ "素数チェッカーを作成して、npmモジュールの構築とエクスポートを練習してください。" ] }, "http-and-the-web-standards-model": { - "note": "2026年後半公開予定", "intro": [ "このモジュールでは、HTTP(ハイパーテキスト転送プロトコル)やリクエスト-レスポンスモデル、一般的なレスポンスコード、DNS、TCP/IPなどの重要な概念を学びます。その後、自分でウェブサーバーを構築するワークショップで実践し、短いクイズで知識を確認します。" ] }, - "rest-api-and-web-services": { - "note": "2026年後半公開予定", + "introduction-to-express": { "intro": [ - "このモジュールでは、REST API(表現状態転送アプリケーションプログラミングインターフェース)とマイクロサービスの仕組みについて学びます。その後、短いクイズで知識を確認します。" + "このモジュールでは、RESTful APIを構築するためのフレームワークであるExpress.jsを紹介します。その後、ワークショップやラボでスキルを実践し、短いクイズで知識を確認します。" ] }, - "lab-timestamp-microservice": { - "note": "2026年後半公開予定", + "lab-personal-profile-app": { "intro": [ - "タイムスタンプマイクロサービスを作成して、日付解析ロジックを持つRESTful APIの構築を練習してください。" + "個人プロフィールアプリケーションを作成して、ExpressサーバーとJSON APIの構築を練習してください。" ] }, - "introduction-to-express": { - "note": "2026年後半公開予定", + "express-middleware": { "intro": [ - "このモジュールでは、RESTful APIを構築するためのフレームワークであるExpress.jsを紹介します。その後、ワークショップやラボでスキルを実践し、短いクイズで知識を確認します。" + "このモジュールでは、クライアントとサーバー間のリクエストとレスポンスを処理するために使われるExpress.jsのミドルウェアについて学びます。その後、ワークショップとラボでスキルを実践し、短いクイズで知識を確認します。" ] }, - "lab-personal-profile-app": { - "note": "2026年後半公開予定", + "rest-api-and-web-services": { "intro": [ - "個人プロフィールアプリケーションを作成して、ExpressサーバーとJSON APIの構築を練習してください。" + "このモジュールでは、REST API(表現状態転送アプリケーションプログラミングインターフェース)とマイクロサービスの仕組みについて学びます。その後、短いクイズで知識を確認します。" ] }, - "error-handling-in-express": { - "note": "2026年後半公開予定", + "lab-timestamp-microservice": { "intro": [ - "このモジュールでは、Express.jsのエラーハンドリング、デバッグ、ヘルスチェックの仕組みについて学びます。その後、ラボで実践し、短いクイズで知識を確認します。" + "タイムスタンプマイクロサービスを作成して、日付解析ロジックを持つRESTful APIの構築を練習してください。" ] }, - "express-middleware": { - "note": "2026年後半公開予定", + "error-handling-in-express": { "intro": [ - "このモジュールでは、クライアントとサーバー間のリクエストとレスポンスを処理するために使われるExpress.jsのミドルウェアについて学びます。その後、ワークショップとラボでスキルを実践し、短いクイズで知識を確認します。" + "このモジュールでは、Express.jsのエラーハンドリング、デバッグ、ヘルスチェックの仕組みについて学びます。その後、ラボで実践し、短いクイズで知識を確認します。" ] }, "websockets": { - "note": "2026年後半公開予定", "intro": [ "このモジュールでは、クライアントとサーバー間のリアルタイム通信に使われるプロトコルであるWebSocketsを紹介します。その後、ラボやワークショップで学んだことを実践し、短いクイズで知識を確認します。" ] }, "lab-chat-app": { - "note": "2026年後半公開予定", "intro": [ "Node.jsのWebSocketを使ってリアルタイムのマルチクライアントチャットサーバーの構築を練習してください。" ] }, "security-and-privacy": { - "note": "2026年後半公開予定", "intro": [ "このモジュールでは、セキュリティとプライバシーの違い、CSP、Permissions-Policies、PII、CORSの扱いなどの概念について学びます。その後、短いクイズで知識を確認します。" ] }, "authentication": { - "note": "2026年後半公開予定", "intro": [ "このモジュールでは、ウェブアプリケーションの認証の仕組みやJWT、CSRF、Passport、Helmet、暗号化と暗号技術などの重要な概念について学びます。その後、ラボやワークショップで実践し、短いクイズで知識を確認します。" ] }, "lab-family-movie-watchlist-api": { - "note": "2026年後半公開予定", "intro": [ "家族用映画ウォッチリストAPIを作成して、Expressアプリケーションでの認証と認可の実装を練習してください。" ] }, "back-end-development-and-apis-certification-exam": { - "note": "2026年後半公開予定", "intro": [ "この試験に合格してバックエンド開発とAPI認定を取得しましょう。" ] }, "review-back-end-development-and-apis": { - "note": "2026年後半公開予定", "intro": [ "今後の試験に備えてバックエンド開発とAPIの概念を復習しましょう。" ] @@ -7302,7 +7291,7 @@ }, "blocks": { "lecture-working-with-nodejs-and-event-driven-architecture": { - "title": "NodeJSとイベント駆動アーキテクチャの活用", + "title": "Node.jsとイベント駆動アーキテクチャの活用", "intro": [ "Node.jsのコアライブラリ、コンピューターへのNode.jsのインストール方法、バックエンドでNode.jsを使う利点と欠点について学びます。" ] @@ -7416,24 +7405,6 @@ "" ] }, - "lecture-understanding-rest-api-and-web-services": { - "title": "REST APIとウェブサービスの理解", - "intro": [ - "このレッスンでは、REST APIとウェブサービスについて学び、異なるアプリケーションがインターネットを介してどのように通信するかを理解します。" - ] - }, - "workshop-build-a-weather-service-api": { - "title": "天気サービスAPIを作る", - "intro": [ - "express.Router を使ったルートパラメータとモジュラー型ルーティングを学びながら天気サービスAPIを作ります。" - ] - }, - "lab-timestamp-microservice": { - "title": "タイムスタンプマイクロサービスを作る", - "intro": [ - "日付解析ロジックを使ったRESTful APIを作る練習として、タイムスタンプマイクロサービスを作成します。" - ] - }, "lecture-working-with-express": { "title": "Expressの使い方", "intro": [ @@ -7453,16 +7424,10 @@ "ランダムジョークアプリを作りながら、基本的なExpressルーティングとレスポンスメソッドを学びます。" ] }, - "lab-personal-profile-app": { - "title": "個人プロフィールアプリを作る", - "intro": [ - "ExpressサーバーとJSON APIを作る練習として、個人プロフィールアプリケーションを作成します。" - ] - }, "review-introduction-to-express": { "title": "Express入門の復習", "intro": [ - "クイズを受ける前に、ウェブサービス、REST、マイクロサービス、Express.jsのルーティングを復習しましょう。" + "クイズに挑戦する前に、Express.js、ルーティング、レスポンスメソッド、静的ファイルの提供を復習しましょう。" ] }, "quiz-introduction-to-express": { @@ -7471,28 +7436,10 @@ "ウェブサービス、REST、マイクロサービス、Express.js、ルーティングの知識をテストしましょう。" ] }, - "lecture-understanding-error-handling-and-health-checks": { - "title": "エラーハンドリングとヘルスチェックの理解", - "intro": [ - "このレッスンでは、Expressにおけるエラーハンドリングとヘルスチェックについて学びます。" - ] - }, - "workshop-build-a-bank-api": { - "title": "銀行APIを作る", - "intro": [ - "銀行APIを作りながら、Express 5のエラーハンドリング、ヘルスチェック、グレースフルシャットダウンを学びます。" - ] - }, - "review-error-handling-in-express": { - "title": "Expressのエラーハンドリング復習", - "intro": [ - "クイズを受ける前に、HTTPステータスコード、エラーハンドリング、デバッグ、ログ記録、ヘルスチェック、グレースフルシャットダウンを復習しましょう。" - ] - }, - "quiz-error-handling-in-express": { - "title": "Expressのエラーハンドリングクイズ", + "lab-personal-profile-app": { + "title": "個人プロフィールアプリを作る", "intro": [ - "HTTPステータスコード、エラーハンドリング、デバッグ、ログ記録、ヘルスチェック、グレースフルシャットダウンの知識をテストしましょう。" + "ExpressサーバーとJSON APIを作る練習として、個人プロフィールアプリケーションを作成します。" ] }, "lecture-express-middleware": { @@ -7525,6 +7472,54 @@ "Expressのミドルウェア、アプリケーションレベル、ルーターレベル、エラーハンドリング、組み込みおよびサードパーティのミドルウェアの知識をテストしましょう。" ] }, + "lecture-understanding-rest-api-and-web-services": { + "title": "REST APIとウェブサービスの理解", + "intro": [ + "このレッスンでは、REST APIとウェブサービスについて学び、異なるアプリケーションがインターネットを介してどのように通信するかを理解します。" + ] + }, + "workshop-build-a-weather-service-api": { + "title": "天気サービスAPIを作る", + "intro": [ + "express.Router を使ったルートパラメータとモジュラー型ルーティングを学びながら天気サービスAPIを作ります。" + ] + }, + "review-rest-api-and-web-services": { + "title": "REST APIとウェブサービスの復習", + "intro": [ + "ウェブサービス、RESTアーキテクチャ、HTTPステータスコード、マイクロサービスを復習します。" + ] + }, + "lab-timestamp-microservice": { + "title": "タイムスタンプマイクロサービスを作る", + "intro": [ + "日付解析ロジックを使ったRESTful APIを作る練習として、タイムスタンプマイクロサービスを作成します。" + ] + }, + "lecture-understanding-error-handling-and-health-checks": { + "title": "エラーハンドリングとヘルスチェックの理解", + "intro": [ + "このレッスンでは、Expressにおけるエラーハンドリングとヘルスチェックについて学びます。" + ] + }, + "workshop-build-a-bank-api": { + "title": "銀行APIを作る", + "intro": [ + "銀行APIを作りながら、Express 5のエラーハンドリング、ヘルスチェック、グレースフルシャットダウンを学びます。" + ] + }, + "review-error-handling-in-express": { + "title": "Expressのエラーハンドリング復習", + "intro": [ + "クイズを受ける前に、HTTPステータスコード、エラーハンドリング、デバッグ、ログ記録、ヘルスチェック、グレースフルシャットダウンを復習しましょう。" + ] + }, + "quiz-error-handling-in-express": { + "title": "Expressのエラーハンドリングクイズ", + "intro": [ + "HTTPステータスコード、エラーハンドリング、デバッグ、ログ記録、ヘルスチェック、グレースフルシャットダウンの知識をテストしましょう。" + ] + }, "lecture-understanding-websockets": { "title": "WebSocketsの理解", "intro": [ @@ -8427,7 +8422,7 @@ "title": "カフェメニューをデザインする", "intro": [ "CSSはブラウザーにウェブページの表示方法を指示します。色、フォント、サイズなどHTML要素の様々なスタイルを設定できます。", - "このワークショップでは、カフェのウェブページ用メニューページをデザインしながらCSSを学びます。" + "このワークショップでは、カフェのメニューページをデザインしながらCSSを学びます。" ] }, "lab-business-card": { @@ -9695,7 +9690,7 @@ "title": "カフェメニューをデザインする", "intro": [ "CSSはブラウザにウェブページの表示方法を指示します。CSSを使ってHTML要素の色、フォント、サイズなどを設定できます。", - "このワークショップでは、カフェのウェブページのメニューページをデザインしながらCSSを学びます。" + "このワークショップでは、カフェのメニューページをデザインしながらCSSを学びます。" ] }, "lab-business-card": { diff --git a/client/japanese/translations.json b/client/japanese/translations.json index 69373f5e3c7..10b673160c3 100644 --- a/client/japanese/translations.json +++ b/client/japanese/translations.json @@ -558,6 +558,12 @@ "running-tests": "// テスト実行中", "tests-completed": "// テスト完了", "console-output": "// コンソール出力", + "unavailable-local-resource": "リソースの読み込みに失敗しました:「{{source}}」は利用可能なローカル{{resourceType}}ファイルではありません。使用可能なもの:{{allowedSources}}。", + "unavailable-local-resource-no-allowed": "リソースの読み込みに失敗しました:「{{source}}」はこのチャレンジで利用可能なローカル{{resourceType}}ファイルではありません。", + "local-resource-type": { + "stylesheet": "スタイルシート", + "script": "スクリプト" + }, "example-app": "<0>この例のプロジェクトと機能的に似たアプリを作成してください。例のプロジェクトをコピーせず、自分のスタイルを出しましょう。", "syntax-error": "テストを実行する前にコードでエラーが発生しました。修正して再度試してください。", "indentation-error": "コードにインデントエラーがあります。有効なコードブロックを作るために新しい行にpassを追加する必要があるかもしれません。", @@ -656,25 +662,6 @@ "sub-step-7": "<0>シークレットを追加ボタンをクリックしてください", "summary": "Codespacesセットアップ" }, - "ona": { - "intro": "このコースはOnaを使った仮想Linuxマシン上で実行されます。コースを開始するには以下の手順に従ってください:", - "step-1": "<0>Onaアカウントを作成してください(まだお持ちでない場合)", - "step-2": "下の開始ボタンをクリックしてください", - "step-3": "表示されるモーダルで作成ボタンをクリックしてください", - "step-4": "仮想Linuxマシンの読み込みが完了したら、CodeRoad拡張機能を起動してください:", - "step-5": "VSCodeウィンドウ左上の「ハンバーガーメニュー」をクリックし、", - "step-6": "<0>表示メニューに移動し、", - "step-7": "<0>コマンドパレットをクリックし、", - "step-8": "<0>CodeRoad: Startコマンドを実行してください", - "step-9": "CodeRoadの指示に従ってコースを完了してください", - "continue-project": "下の開始ボタンをクリックすると新しいプロジェクトが始まります。以前に{{course}}コースを開始している場合は、<0>Onaダッシュボードに行き続行してください。", - "learn-more": "<0>Onaワークスペースについて詳しく学ぶ。", - "logout-warning": "{{course}}コースを完了する前にfreeCodeCampからログアウトすると、進捗はfreeCodeCampアカウントに保存されません。", - "sub-step-3": "<0>Onaのシークレットページに移動してください", - "sub-step-4": "<0>CODEROAD_WEBHOOK_TOKENという名前の新しいシークレットを作成してください", - "sub-step-5": "<0>シークレット欄にトークンを貼り付けてください", - "summary": "Onaセットアップ" - }, "freecodecamp-os": { "token-modal": "コースを実行すると、ユーザートークンの入力を求めるモーダルが表示されます。上でコピーしたトークンを貼り付けてください。環境ごとに一度だけ行えば十分です。", "local": { @@ -697,16 +684,6 @@ "step-5": "完了すると Simple Browser が開きます。白紙のページが表示された場合は、更新ボタンを使って更新し、コースのホームページを表示してください。", "step-6": "利用可能なプロジェクトのいずれかをクリックして開始し、プロジェクト内の指示に従って完了させてください。", "continue-project": "下の開始ボタンをクリックすると新しいマシンが起動します。以前に {{title}} コースを開始している場合は、<0>リポジトリページに移動して以前のワークスペースを再開してください。" - }, - "ona": { - "intro": "このコースは、Ona と freeCodeCamp - Courses VS Code拡張機能を使って仮想Linuxマシン上で実行されます。コースを開始するには以下の手順に従ってください。", - "step-1": "<0>Onaアカウントを作成してください(まだお持ちでなければ)。", - "step-2": "下の開始ボタンをクリックしてください。", - "step-3": "表示されるモーダルで作成ボタンをクリックしてください。", - "step-4": "仮想Linuxマシンの読み込みが完了したら、コマンドパレットを開き、<0>freeCodeCamp: Run Course コマンドを実行してください。", - "step-5": "完了すると Simple Browser が開きます。白紙のページが表示された場合は、更新ボタンを使って更新し、コースのホームページを表示してください。", - "step-6": "利用可能なプロジェクトのいずれかをクリックして開始し、プロジェクト内の指示に従って完了させてください。", - "continue-project": "下の開始ボタンをクリックすると新しいマシンが起動します。以前に {{course}} コースを開始している場合は、<0>Onaダッシュボードに移動して続行してください。" } }, "local": { diff --git a/client/korean/intro.json b/client/korean/intro.json index 2c00ad660a4..e2a32e33ec3 100644 --- a/client/korean/intro.json +++ b/client/korean/intro.json @@ -1352,12 +1352,6 @@ "이 140수업 워크숍에서 SQL 명령어를 더 깊이 배우며 학생 데이터베이스를 완성하세요." ] }, - "lab-world-cup-database": { - "title": "월드컵 데이터베이스 만들기", - "intro": [ - "이 프로젝트에서 월드컵 경기 정보를 PostgreSQL에 입력하는 Bash 스크립트를 만들고 유용한 통계를 쿼리하세요." - ] - }, "workshop-kitty-ipsum-translator": { "title": "키티 입숨 번역기 만들기", "intro": [ @@ -1371,6 +1365,12 @@ "이 210수업 워크숍에서 PostgreSQL을 사용해 자전거 대여점 대여 정보를 저장하는 대화형 Bash 프로그램을 만드세요." ] }, + "lab-world-cup-database": { + "title": "월드컵 데이터베이스 만들기", + "intro": [ + "이 프로젝트에서 월드컵 경기 정보를 PostgreSQL에 입력하는 Bash 스크립트를 만들고 유용한 통계를 쿼리하세요." + ] + }, "lab-salon-appointment-scheduler": { "title": "살롱 예약 스케줄러 만들기", "intro": [ @@ -2669,6 +2669,13 @@ "점수에 따라 학생의 성적을 결정하는 조건문을 연습합니다." ] }, + "lab-story-fragment-restoration": { + "title": "스토리 조각 배열에서 일관된 내러티브 복원하기", + "intro": [ + "이 워크숍에서는 손상된 스토리 조각 배열에서 일관된 내러티브를 복원합니다.", + "기본 배열 알고리즘을 처음부터 구현하며 반복문 사용법을 연습하세요." + ] + }, "lecture-the-var-keyword-and-hoisting": { "title": "var 키워드와 호이스팅", "intro": [ @@ -3774,18 +3781,18 @@ "이 과정으로 CSS 박스 모델을 배우세요. 웹에서 요소가 어떻게 렌더링되는지 이해하고, 원하는 레이아웃과 디자인을 위해 간격, 테두리, 패딩을 조작하는 방법을 익히세요." ] }, - "top-introduction-to-flexbox": { - "title": "Flexbox 소개", - "intro": [ - "유연하고 반응형 웹 레이아웃 설계를 단순화하는 레이아웃 모델인 Flexbox의 강력함을 발견하세요. 동적이고 적응력 있는 페이지 구조를 쉽게 만드는 방법을 배우세요." - ] - }, "top-learn-block-and-inline": { "title": "블록과 인라인의 차이 배우기", "intro": [ "HTML과 CSS에서 블록 요소와 인라인 요소의 차이를 탐구하세요. 이 과정은 이 디스플레이 유형들이 레이아웃과 동작에 미치는 영향을 알려주어 현명한 디자인 결정을 돕습니다." ] }, + "top-introduction-to-flexbox": { + "title": "Flexbox 소개", + "intro": [ + "유연하고 반응형 웹 레이아웃 설계를 단순화하는 레이아웃 모델인 Flexbox의 강력함을 발견하세요. 동적이고 적응력 있는 페이지 구조를 쉽게 만드는 방법을 배우세요." + ] + }, "top-learn-variables-and-operators": { "title": "변수와 연산자 배우기", "intro": [ @@ -6287,12 +6294,6 @@ "Tailwind CSS 유틸리티 클래스를 사용해 플렉스박스 레이아웃, 색상, 브레이크포인트 등을 다루는 연습을 하세요." ] }, - "lab-photography-exhibit": { - "title": "사진 전시회 디자인하기", - "intro": [ - "이 실습에서 Tailwind CSS를 사용해 사진 전시회 웹페이지를 디자인하는 연습을 하세요." - ] - }, "review-css-libraries-and-frameworks": { "title": "CSS 라이브러리와 프레임워크 복습", "intro": [ @@ -6306,6 +6307,12 @@ "이 퀴즈로 CSS 라이브러리와 프레임워크에 대해 배운 것을 테스트하세요." ] }, + "lab-photography-exhibit": { + "title": "사진 전시회 디자인하기", + "intro": [ + "이 실습에서 Tailwind CSS를 사용해 사진 전시회 웹페이지를 디자인하는 연습을 하세요." + ] + }, "lecture-introduction-to-typescript": { "title": "TypeScript 소개", "intro": [ @@ -6372,18 +6379,6 @@ "이 워크숍에서는 TypeScript를 계속 연습하며 운세 앱을 만듭니다." ] }, - "lab-flashcard-quiz-app": { - "title": "플래시카드 퀴즈 앱 만들기", - "intro": [ - "이 실습에서는 TypeScript를 사용해 플래시카드 퀴즈 앱을 만듭니다." - ] - }, - "lab-digital-pet-game": { - "title": "디지털 펫 게임 만들기", - "intro": [ - "이 실습에서는 TypeScript와 React에서 배운 내용을 활용해 디지털 펫 게임을 만듭니다." - ] - }, "workshop-build-a-football-player-card-builder": { "title": "축구 선수 카드 빌더 만들기", "intro": [ @@ -6401,6 +6396,18 @@ "title": "TypeScript 퀴즈", "intro": ["이 퀴즈로 TypeScript 학습 내용을 테스트하세요."] }, + "lab-flashcard-quiz-app": { + "title": "플래시카드 퀴즈 앱 만들기", + "intro": [ + "이 실습에서는 TypeScript를 사용해 플래시카드 퀴즈 앱을 만듭니다." + ] + }, + "lab-digital-pet-game": { + "title": "디지털 펫 게임 만들기", + "intro": [ + "이 실습에서는 TypeScript와 React에서 배운 내용을 활용해 디지털 펫 게임을 만듭니다." + ] + }, "review-front-end-libraries": { "title": "프론트엔드 라이브러리 복습", "intro": [ @@ -7176,12 +7183,12 @@ "node-package-manager": "Node 패키지 관리자", "lab-prime-number-checker-module": "소수 검사 모듈 만들기", "http-and-the-web-standards-model": "HTTP와 웹 표준 모델", - "rest-api-and-web-services": "REST API와 웹 서비스", - "lab-timestamp-microservice": "타임스탬프 마이크로서비스 만들기", "introduction-to-express": "Express 소개", "lab-personal-profile-app": "개인 프로필 애플리케이션 만들기", - "error-handling-in-express": "Express에서의 오류 처리", "express-middleware": "Express 미들웨어", + "rest-api-and-web-services": "REST API와 웹 서비스", + "lab-timestamp-microservice": "타임스탬프 마이크로서비스 만들기", + "error-handling-in-express": "Express에서의 오류 처리", "websockets": "웹소켓", "lab-chat-app": "채팅 애플리케이션 만들기", "security-and-privacy": "보안과 개인정보 보호", @@ -7192,109 +7199,91 @@ }, "module-intros": { "introduction-to-nodejs": { - "note": "2026년 말 출시 예정", "intro": [ "이 모듈에서는 Node.js 작업의 기본을 배웁니다." ] }, "nodejs-core-modules": { - "note": "2026년 말 출시 예정", "intro": [ "이 모듈에서는 fs, os, path 등 일반적인 Node.js 코어 모듈을 배우고 워크숍과 실습으로 익힌 후 짧은 퀴즈로 지식을 테스트합니다." ] }, "node-package-manager": { - "note": "2026년 말 출시 예정", "intro": [ "이 모듈에서는 개발자가 프로젝트 의존성과 스크립트를 관리하는 데 사용하는 Node 패키지 관리자를 소개합니다. 이후 워크숍과 실습으로 배운 내용을 연습하고 짧은 퀴즈로 지식을 확인합니다." ] }, "lab-prime-number-checker-module": { - "note": "2026년 말 출시 예정", "intro": [ "소수 검사기를 만들어 NPM 모듈을 빌드하고 내보내는 연습을 하세요." ] }, "http-and-the-web-standards-model": { - "note": "2026년 말 출시 예정", "intro": [ "이 모듈에서는 HTTP(하이퍼텍스트 전송 프로토콜)와 요청-응답 모델, 일반 응답 코드, DNS, TCP/IP 등 중요한 개념을 배우고 웹 서버 구축 워크숍과 짧은 퀴즈로 실습합니다." ] }, - "rest-api-and-web-services": { - "note": "2026년 말 출시 예정", + "introduction-to-express": { "intro": [ - "이 모듈에서는 REST API(표현 상태 전송 애플리케이션 프로그래밍 인터페이스)와 마이크로서비스 작동 방식을 배우고 짧은 퀴즈로 지식을 테스트합니다." + "이 모듈에서는 RESTful API를 구축하는 데 사용하는 프레임워크인 Express.js를 소개하고 워크숍과 실습으로 기술을 연습한 뒤 짧은 퀴즈로 확인합니다." ] }, - "lab-timestamp-microservice": { - "note": "2026년 말 출시 예정", + "lab-personal-profile-app": { "intro": [ - "날짜 파싱 로직을 포함한 RESTful API를 만들어 타임스탬프 마이크로서비스를 빌드하는 연습을 하세요." + "Express 서버와 JSON API를 만들어 개인 프로필 애플리케이션을 빌드하는 연습을 하세요." ] }, - "introduction-to-express": { - "note": "2026년 말 출시 예정", + "express-middleware": { "intro": [ - "이 모듈에서는 RESTful API를 구축하는 데 사용하는 프레임워크인 Express.js를 소개하고 워크숍과 실습으로 기술을 연습한 뒤 짧은 퀴즈로 확인합니다." + "이 모듈에서는 클라이언트와 서버 간 요청과 응답을 처리하는 Express.js 미들웨어를 배우고 워크숍과 실습으로 연습한 뒤 짧은 퀴즈로 확인합니다." ] }, - "lab-personal-profile-app": { - "note": "2026년 말 출시 예정", + "rest-api-and-web-services": { "intro": [ - "Express 서버와 JSON API를 만들어 개인 프로필 애플리케이션을 빌드하는 연습을 하세요." + "이 모듈에서는 REST API(표현 상태 전송 애플리케이션 프로그래밍 인터페이스)와 마이크로서비스 작동 방식을 배우고 짧은 퀴즈로 지식을 테스트합니다." ] }, - "error-handling-in-express": { - "note": "2026년 말 출시 예정", + "lab-timestamp-microservice": { "intro": [ - "이 모듈에서는 Express.js에서 오류 처리, 디버깅, 상태 점검이 어떻게 작동하는지 배우고 실습과 짧은 퀴즈로 익힙니다." + "날짜 파싱 로직을 포함한 RESTful API를 만들어 타임스탬프 마이크로서비스를 빌드하는 연습을 하세요." ] }, - "express-middleware": { - "note": "2026년 말 출시 예정", + "error-handling-in-express": { "intro": [ - "이 모듈에서는 클라이언트와 서버 간 요청과 응답을 처리하는 Express.js 미들웨어를 배우고 워크숍과 실습으로 연습한 뒤 짧은 퀴즈로 확인합니다." + "이 모듈에서는 Express.js에서 오류 처리, 디버깅, 상태 점검이 어떻게 작동하는지 배우고 실습과 짧은 퀴즈로 익힙니다." ] }, "websockets": { - "note": "2026년 말 출시 예정", "intro": [ "이 모듈에서는 클라이언트와 서버 간 실시간 통신에 사용하는 프로토콜인 웹소켓을 소개하고 실습과 워크숍으로 배운 내용을 연습한 뒤 짧은 퀴즈로 테스트합니다." ] }, "lab-chat-app": { - "note": "2026년 말 출시 예정", "intro": [ "Node.js WebSocket을 사용해 실시간 다중 클라이언트 채팅 서버를 빌드하는 연습을 하세요." ] }, "security-and-privacy": { - "note": "2026년 말 출시 예정", "intro": [ "이 모듈에서는 보안과 개인정보 보호의 차이점, CSP, 권한 정책, 개인 식별 정보(PII), CORS 작업 등 다양한 개념을 배우고 짧은 퀴즈로 지식을 확인합니다." ] }, "authentication": { - "note": "2026년 말 출시 예정", "intro": [ "이 모듈에서는 웹 애플리케이션에서 인증이 어떻게 작동하는지, JWT, CSRF, Passport, Helmet, 암호화 및 암호화 기술 등 중요한 개념을 배우고 실습과 워크숍으로 연습한 뒤 짧은 퀴즈로 확인합니다." ] }, "lab-family-movie-watchlist-api": { - "note": "2026년 말 출시 예정", "intro": [ "Express 애플리케이션에서 인증과 권한 부여를 구현해 가족 영화 목록 API를 만드는 연습을 하세요." ] }, "back-end-development-and-apis-certification-exam": { - "note": "2026년 말 출시 예정", "intro": [ "이 시험에 합격해 백엔드 개발 및 API 인증을 받으세요." ] }, "review-back-end-development-and-apis": { - "note": "2026년 말 출시 예정", "intro": [ "다가오는 시험 준비를 위해 백엔드 개발 및 API 개념을 복습하세요." ] @@ -7302,7 +7291,7 @@ }, "blocks": { "lecture-working-with-nodejs-and-event-driven-architecture": { - "title": "NodeJS와 이벤트 기반 아키텍처 작업", + "title": "Node.js와 이벤트 기반 아키텍처 다루기", "intro": [ "Node.js 코어 라이브러리, 컴퓨터에 Node.js 설치 방법, 백엔드에서 Node.js 사용의 장단점을 배우세요." ] @@ -7416,24 +7405,6 @@ "" ] }, - "lecture-understanding-rest-api-and-web-services": { - "title": "REST API와 웹 서비스 이해하기", - "intro": [ - "이 수업에서는 REST API와 웹 서비스가 무엇이며, 인터넷을 통해 서로 다른 애플리케이션이 어떻게 통신하는지 배웁니다." - ] - }, - "workshop-build-a-weather-service-api": { - "title": "날씨 서비스 API 만들기", - "intro": [ - "날씨 서비스 API를 만들어 express.Router로 라우트 매개변수와 모듈식 라우팅을 배우세요." - ] - }, - "lab-timestamp-microservice": { - "title": "타임스탬프 마이크로서비스 만들기", - "intro": [ - "날짜 파싱 로직을 포함한 RESTful API를 만들어 타임스탬프 마이크로서비스를 연습하세요." - ] - }, "lecture-working-with-express": { "title": "Express 다루기", "intro": [ @@ -7453,16 +7424,10 @@ "랜덤 농담 앱을 만들어 기본 Express 라우팅과 응답 메서드를 배우세요." ] }, - "lab-personal-profile-app": { - "title": "개인 프로필 앱 만들기", - "intro": [ - "Express 서버와 JSON API를 만들어 개인 프로필 애플리케이션을 연습하세요." - ] - }, "review-introduction-to-express": { "title": "Express 소개 복습", "intro": [ - "퀴즈 전에 웹 서비스, REST, 마이크로서비스, Express.js 라우팅을 복습하세요." + "퀴즈 전에 Express.js, 라우팅, 응답 메서드, 정적 파일 제공을 검토하세요." ] }, "quiz-introduction-to-express": { @@ -7471,28 +7436,10 @@ "웹 서비스, REST, 마이크로서비스, Express.js, 라우팅에 대한 지식을 테스트하세요." ] }, - "lecture-understanding-error-handling-and-health-checks": { - "title": "오류 처리와 상태 점검 이해하기", - "intro": [ - "이 수업에서는 Express에서 오류 처리와 상태 점검에 대해 배웁니다." - ] - }, - "workshop-build-a-bank-api": { - "title": "은행 API 만들기", - "intro": [ - "은행 API를 만들어 Express 5 오류 처리, 상태 점검, 정상 종료를 배우세요." - ] - }, - "review-error-handling-in-express": { - "title": "Express 오류 처리 복습", - "intro": [ - "퀴즈 전에 HTTP 상태 코드, 오류 처리, 디버깅, 로깅, 상태 점검, 정상 종료를 복습하세요." - ] - }, - "quiz-error-handling-in-express": { - "title": "Express 오류 처리 퀴즈", + "lab-personal-profile-app": { + "title": "개인 프로필 앱 만들기", "intro": [ - "HTTP 상태 코드, 오류 처리, 디버깅, 로깅, 상태 점검, 정상 종료에 대한 지식을 테스트하세요." + "Express 서버와 JSON API를 만들어 개인 프로필 애플리케이션을 연습하세요." ] }, "lecture-express-middleware": { @@ -7525,6 +7472,54 @@ "애플리케이션 수준, 라우터 수준, 오류 처리, 내장 및 서드파티 미들웨어를 포함한 Express 미들웨어 지식을 테스트하세요." ] }, + "lecture-understanding-rest-api-and-web-services": { + "title": "REST API와 웹 서비스 이해하기", + "intro": [ + "이 수업에서는 REST API와 웹 서비스가 무엇이며, 인터넷을 통해 서로 다른 애플리케이션이 어떻게 통신하는지 배웁니다." + ] + }, + "workshop-build-a-weather-service-api": { + "title": "날씨 서비스 API 만들기", + "intro": [ + "날씨 서비스 API를 만들어 express.Router로 라우트 매개변수와 모듈식 라우팅을 배우세요." + ] + }, + "review-rest-api-and-web-services": { + "title": "REST API 및 웹 서비스 검토", + "intro": [ + "웹 서비스, REST 아키텍처, HTTP 상태 코드, 마이크로서비스를 검토하세요." + ] + }, + "lab-timestamp-microservice": { + "title": "타임스탬프 마이크로서비스 만들기", + "intro": [ + "날짜 파싱 로직을 포함한 RESTful API를 만들어 타임스탬프 마이크로서비스를 연습하세요." + ] + }, + "lecture-understanding-error-handling-and-health-checks": { + "title": "오류 처리와 상태 점검 이해하기", + "intro": [ + "이 수업에서는 Express에서 오류 처리와 상태 점검에 대해 배웁니다." + ] + }, + "workshop-build-a-bank-api": { + "title": "은행 API 만들기", + "intro": [ + "은행 API를 만들어 Express 5 오류 처리, 상태 점검, 정상 종료를 배우세요." + ] + }, + "review-error-handling-in-express": { + "title": "Express 오류 처리 복습", + "intro": [ + "퀴즈 전에 HTTP 상태 코드, 오류 처리, 디버깅, 로깅, 상태 점검, 정상 종료를 복습하세요." + ] + }, + "quiz-error-handling-in-express": { + "title": "Express 오류 처리 퀴즈", + "intro": [ + "HTTP 상태 코드, 오류 처리, 디버깅, 로깅, 상태 점검, 정상 종료에 대한 지식을 테스트하세요." + ] + }, "lecture-understanding-websockets": { "title": "WebSocket 이해하기", "intro": [ @@ -8427,7 +8422,7 @@ "title": "카페 메뉴 디자인", "intro": [ "CSS는 브라우저가 웹페이지를 어떻게 표시할지 알려줍니다. CSS로 HTML 요소의 색상, 폰트, 크기 등 다양한 속성을 설정할 수 있습니다.", - "이 워크숍에서는 카페 웹페이지 메뉴 페이지를 디자인하며 CSS를 배웁니다." + "이 워크숍에서 카페 메뉴 페이지를 디자인하며 CSS를 배우세요." ] }, "lab-business-card": { @@ -9695,7 +9690,7 @@ "title": "카페 메뉴 디자인하기", "intro": [ "CSS는 브라우저가 웹페이지를 어떻게 표시할지 알려줍니다. CSS로 HTML 요소의 색상, 폰트, 크기 등 다양한 부분을 설정할 수 있습니다.", - "이 워크숍에서 카페 웹페이지 메뉴 페이지를 디자인하며 CSS를 배웁니다." + "이 워크숍에서 카페 메뉴 페이지를 디자인하며 CSS를 배우세요." ] }, "lab-business-card": { diff --git a/client/korean/translations.json b/client/korean/translations.json index c51f8598141..925ad32d763 100644 --- a/client/korean/translations.json +++ b/client/korean/translations.json @@ -558,6 +558,12 @@ "running-tests": "// 테스트 실행 중", "tests-completed": "// 테스트 완료", "console-output": "// 콘솔 출력", + "unavailable-local-resource": "리소스를 불러오지 못했습니다: \"{{source}}\"는 사용 가능한 로컬 {{resourceType}} 파일이 아닙니다. 사용 가능한 소스: {{allowedSources}}.", + "unavailable-local-resource-no-allowed": "리소스를 불러오지 못했습니다: \"{{source}}\"는 이 도전 과제에서 사용 가능한 로컬 {{resourceType}} 파일이 아닙니다.", + "local-resource-type": { + "stylesheet": "스타일시트", + "script": "스크립트" + }, "example-app": "<0>이 예제 프로젝트와 기능적으로 유사한 앱을 만드세요. 예제 프로젝트를 복사하지 말고 자신만의 스타일을 적용해 보세요.", "syntax-error": "테스트를 실행하기 전에 코드에서 오류가 발생했습니다. 수정 후 다시 시도하세요.", "indentation-error": "코드에 들여쓰기 오류가 있습니다. 유효한 코드 블록을 만들려면 새 줄에 pass를 추가해야 할 수 있습니다.", @@ -656,25 +662,6 @@ "sub-step-7": "<0>비밀 추가 버튼을 클릭하세요", "summary": "Codespaces 설정" }, - "ona": { - "intro": "이 과정은 Ona를 사용하는 가상 Linux 머신에서 실행됩니다. 과정을 시작하려면 다음 지침을 따르세요:", - "step-1": "<0>Ona 계정 만들기가 없으면 만드세요", - "step-2": "아래 시작 버튼을 클릭하세요", - "step-3": "팝업 모달에서 생성 버튼을 클릭하세요", - "step-4": "가상 Linux 머신이 로드되면 다음 방법으로 CodeRoad 확장 기능을 시작하세요:", - "step-5": "VSCode 창 왼쪽 상단 근처의 \"햄버거\" 메뉴를 클릭하세요,", - "step-6": "<0>보기 메뉴로 이동하세요,", - "step-7": "<0>명령 팔레트 옵션을 클릭하세요,", - "step-8": "<0>CodeRoad: 시작 명령을 실행하세요", - "step-9": "CodeRoad의 지침을 따라 과정을 완료하세요", - "continue-project": "아래 시작 버튼을 클릭하면 새 프로젝트가 시작됩니다. 이전에 {{course}} 과정을 시작했다면 <0>Ona 대시보드로 가서 계속하세요.", - "learn-more": "<0>Ona 작업 공간에 대해 더 알아보세요.", - "logout-warning": "전체 {{course}} 과정을 완료하기 전에 freeCodeCamp에서 로그아웃하면 진행 상황이 freeCodeCamp 계정에 저장되지 않습니다.", - "sub-step-3": "<0>Ona 비밀 페이지로 이동하세요", - "sub-step-4": "<0>CODEROAD_WEBHOOK_TOKEN이라는 새 비밀을 만드세요", - "sub-step-5": "<0>비밀 필드에 토큰을 붙여넣으세요", - "summary": "Ona 설정" - }, "freecodecamp-os": { "token-modal": "과정을 실행하면 사용자 토큰을 묻는 모달이 나타납니다. 위에서 복사한 토큰을 붙여넣으세요. 환경별로 한 번만 하면 됩니다.", "local": { @@ -697,16 +684,6 @@ "step-5": "완료되면 Simple Browser가 열립니다. 빈 흰색 페이지가 나오면 새로 고침 버튼을 눌러 업데이트하고 과정 홈 페이지를 확인하세요.", "step-6": "사용 가능한 프로젝트 중 하나를 클릭해 시작한 뒤, 프로젝트 내 지침을 따라 완료하세요.", "continue-project": "아래 시작 버튼을 클릭하면 새 머신이 시작됩니다. 이전에 {{title}} 과정을 시작했다면 <0>저장소 페이지로 가서 이전 작업 공간을 다시 여세요." - }, - "ona": { - "intro": "이 과정은 Ona와 freeCodeCamp - Courses VS Code 확장 프로그램을 사용해 가상 Linux 머신에서 실행됩니다. 과정을 시작하려면 다음 지침을 따르세요:", - "step-1": "<0>Ona 계정을 만드세요 없으면", - "step-2": "아래 시작 버튼을 클릭하세요", - "step-3": "팝업 모달에서 생성 버튼을 클릭하세요", - "step-4": "가상 Linux 머신이 로드되면 명령 팔레트를 열고 <0>freeCodeCamp: Run Course 명령을 실행하세요", - "step-5": "완료되면 Simple Browser가 열립니다. 빈 흰색 페이지가 나오면 새로 고침 버튼을 눌러 업데이트하고 과정 홈 페이지를 확인하세요.", - "step-6": "사용 가능한 프로젝트 중 하나를 클릭해 시작한 뒤, 프로젝트 내 지침을 따라 완료하세요.", - "continue-project": "아래 시작 버튼을 클릭하면 새 머신이 시작됩니다. 이전에 {{course}} 과정을 시작했다면 <0>Ona 대시보드로 가서 계속하세요." } }, "local": { diff --git a/client/portuguese/intro.json b/client/portuguese/intro.json index 0013ebfd192..b9ba185fe8b 100644 --- a/client/portuguese/intro.json +++ b/client/portuguese/intro.json @@ -1352,12 +1352,6 @@ "Nesta oficina de 140 lições, você vai completar seu banco de dados de alunos enquanto aprofunda os comandos SQL." ] }, - "lab-world-cup-database": { - "title": "Crie um banco de dados da Copa do Mundo", - "intro": [ - "Para este projeto, você vai criar um script Bash que insere informações de jogos da Copa do Mundo no PostgreSQL, depois consultar o banco de dados para obter estatísticas úteis." - ] - }, "workshop-kitty-ipsum-translator": { "title": "Crie um tradutor Kitty Ipsum", "intro": [ @@ -1371,6 +1365,12 @@ "Nesta oficina de 210 lições, você vai criar um programa Bash interativo que armazena informações de aluguel para sua loja de bicicletas usando PostgreSQL." ] }, + "lab-world-cup-database": { + "title": "Crie um banco de dados da Copa do Mundo", + "intro": [ + "Para este projeto, você vai criar um script Bash que insere informações de jogos da Copa do Mundo no PostgreSQL, depois consultar o banco de dados para obter estatísticas úteis." + ] + }, "lab-salon-appointment-scheduler": { "title": "Crie um agendador de horários para salão", "intro": [ @@ -2669,6 +2669,13 @@ "Você praticará condicionais para determinar a nota do aluno com base na pontuação." ] }, + "lab-story-fragment-restoration": { + "title": "Restaurar uma narrativa coerente a partir de um array de fragmentos de história", + "intro": [ + "Neste laboratório, você vai restaurar uma narrativa coerente a partir de um array corrompido de fragmentos de história.", + "Você vai praticar trabalhar com loops implementando algoritmos fundamentais de array do zero." + ] + }, "lecture-the-var-keyword-and-hoisting": { "title": "A palavra-chave var e hoisting", "intro": [ @@ -3774,18 +3781,18 @@ "Aprenda o modelo de caixa do CSS com este curso. Entenda como os elementos são renderizados na web e aprenda a manipular espaçamento, bordas e preenchimento para alcançar o layout e design desejados." ] }, - "top-introduction-to-flexbox": { - "title": "Introdução ao flexbox", - "intro": [ - "Descubra o poder do Flexbox, um modelo de layout que simplifica o design de layouts web flexíveis e responsivos. Aprenda a criar estruturas de página dinâmicas e adaptativas com facilidade." - ] - }, "top-learn-block-and-inline": { "title": "Aprenda a diferença entre block e inline", "intro": [ "Explore as diferenças entre elementos block e inline em HTML e CSS. Este curso oferece insights sobre como esses tipos de exibição afetam o layout e o comportamento, capacitando você a tomar decisões de design informadas." ] }, + "top-introduction-to-flexbox": { + "title": "Introdução ao flexbox", + "intro": [ + "Descubra o poder do Flexbox, um modelo de layout que simplifica o design de layouts web flexíveis e responsivos. Aprenda a criar estruturas de página dinâmicas e adaptativas com facilidade." + ] + }, "top-learn-variables-and-operators": { "title": "Aprenda variáveis e operadores", "intro": [ @@ -6287,12 +6294,6 @@ "Você praticará o uso das classes utilitárias do Tailwind CSS para layouts flexbox, cores, pontos de interrupção e mais." ] }, - "lab-photography-exhibit": { - "title": "Projete uma exposição de fotografia", - "intro": [ - "Neste laboratório, você praticará o uso do Tailwind CSS projetando uma página web para uma exposição de fotografia." - ] - }, "review-css-libraries-and-frameworks": { "title": "Revisão de bibliotecas e frameworks CSS", "intro": [ @@ -6306,6 +6307,12 @@ "Teste o que aprendeu sobre bibliotecas e frameworks CSS com este quiz." ] }, + "lab-photography-exhibit": { + "title": "Projete uma exposição de fotografia", + "intro": [ + "Neste laboratório, você praticará o uso do Tailwind CSS projetando uma página web para uma exposição de fotografia." + ] + }, "lecture-introduction-to-typescript": { "title": "Introdução ao TypeScript", "intro": [ @@ -6372,18 +6379,6 @@ "Neste workshop, você vai continuar praticando TypeScript criando um app de previsão do futuro." ] }, - "lab-flashcard-quiz-app": { - "title": "Construa um app de quiz com flashcards", - "intro": [ - "Neste laboratório, você vai praticar o uso de TypeScript criando um app de quiz com flashcards." - ] - }, - "lab-digital-pet-game": { - "title": "Construa um jogo de pet digital", - "intro": [ - "Neste laboratório, você vai praticar o que aprendeu sobre TypeScript e React criando um jogo de pet digital." - ] - }, "workshop-build-a-football-player-card-builder": { "title": "Construa um criador de cartões de jogador de futebol", "intro": [ @@ -6401,6 +6396,18 @@ "title": "Quiz de TypeScript", "intro": ["Teste o que você aprendeu sobre TypeScript com este quiz."] }, + "lab-flashcard-quiz-app": { + "title": "Construa um app de quiz com flashcards", + "intro": [ + "Neste laboratório, você vai praticar o uso de TypeScript criando um app de quiz com flashcards." + ] + }, + "lab-digital-pet-game": { + "title": "Construa um jogo de pet digital", + "intro": [ + "Neste laboratório, você vai praticar o que aprendeu sobre TypeScript e React criando um jogo de pet digital." + ] + }, "review-front-end-libraries": { "title": "Revisão de bibliotecas front-end", "intro": [ @@ -7176,12 +7183,12 @@ "node-package-manager": "Gerenciador de pacotes Node", "lab-prime-number-checker-module": "Crie um módulo verificador de números primos", "http-and-the-web-standards-model": "HTTP e o modelo de padrões web", - "rest-api-and-web-services": "API REST e serviços web", - "lab-timestamp-microservice": "Crie um microsserviço de timestamp", "introduction-to-express": "Introdução ao Express", "lab-personal-profile-app": "Crie um app de perfil pessoal", - "error-handling-in-express": "Tratamento de erros no Express", "express-middleware": "Middleware do Express", + "rest-api-and-web-services": "API REST e serviços web", + "lab-timestamp-microservice": "Crie um microsserviço de timestamp", + "error-handling-in-express": "Tratamento de erros no Express", "websockets": "WebSockets", "lab-chat-app": "Crie um app de chat", "security-and-privacy": "Segurança e privacidade", @@ -7192,109 +7199,91 @@ }, "module-intros": { "introduction-to-nodejs": { - "note": "Lançamento previsto para o final de 2026", "intro": [ "Neste módulo, você aprenderá o básico de trabalhar com Node.js." ] }, "nodejs-core-modules": { - "note": "Lançamento previsto para o final de 2026", "intro": [ "Neste módulo, você aprenderá sobre módulos principais comuns do Node.js, incluindo fs, os, path e outros. Depois, praticará o que aprendeu em oficinas e laboratórios e testará seu conhecimento com um quiz curto." ] }, "node-package-manager": { - "note": "Lançamento previsto para o final de 2026", "intro": [ "Neste módulo, você será apresentado ao Node Package Manager, que os desenvolvedores usam para gerenciar dependências e scripts do projeto. Depois, praticará o que aprendeu em oficinas e laboratórios e testará seu conhecimento com um quiz curto." ] }, "lab-prime-number-checker-module": { - "note": "Disponível no final de 2026", "intro": [ "Pratique criar e exportar um módulo npm criando um verificador de números primos." ] }, "http-and-the-web-standards-model": { - "note": "Lançamento previsto para o final de 2026", "intro": [ "Neste módulo, você aprenderá sobre HTTP (Hypertext Transfer Protocol) e outros conceitos importantes, incluindo o modelo requisição-resposta, códigos de resposta comuns, DNS, TCP/IP e mais. Depois, praticará o que aprendeu em uma oficina para criar seu próprio servidor web e testará seu conhecimento com um quiz curto." ] }, - "rest-api-and-web-services": { - "note": "Lançamento previsto para o final de 2026", + "introduction-to-express": { "intro": [ - "Neste módulo, você aprenderá sobre a API REST (transferência de estado representacional) e como microserviços funcionam. Depois, fará um quiz curto para testar seu conhecimento." + "Neste módulo, você será apresentado ao Express.js, um framework usado para criar APIs RESTful. Depois, praticará suas habilidades em oficinas e laboratórios e testará seu conhecimento com um quiz curto." ] }, - "lab-timestamp-microservice": { - "note": "Disponível no final de 2026", + "lab-personal-profile-app": { "intro": [ - "Pratique criar uma API RESTful com lógica de análise de datas criando um microsserviço de timestamp." + "Pratique criar um servidor Express e uma API JSON criando uma aplicação de perfil pessoal." ] }, - "introduction-to-express": { - "note": "Lançamento previsto para o final de 2026", + "express-middleware": { "intro": [ - "Neste módulo, você será apresentado ao Express.js, um framework usado para criar APIs RESTful. Depois, praticará suas habilidades em oficinas e laboratórios e testará seu conhecimento com um quiz curto." + "Neste módulo, você aprenderá sobre middleware no Express.js, usado para tratar requisições e respostas entre cliente e servidor. Depois, praticará suas habilidades em uma oficina e laboratório e testará seu conhecimento com um quiz curto." ] }, - "lab-personal-profile-app": { - "note": "Disponível no final de 2026", + "rest-api-and-web-services": { "intro": [ - "Pratique criar um servidor Express e uma API JSON criando uma aplicação de perfil pessoal." + "Neste módulo, você aprenderá sobre a API REST (transferência de estado representacional) e como microserviços funcionam. Depois, fará um quiz curto para testar seu conhecimento." ] }, - "error-handling-in-express": { - "note": "Lançamento previsto para o final de 2026", + "lab-timestamp-microservice": { "intro": [ - "Neste módulo, você aprenderá como funciona o tratamento de erros, depuração e verificações de saúde no Express.js. Depois, praticará o que aprendeu em um laboratório e testará seu conhecimento com um quiz curto." + "Pratique criar uma API RESTful com lógica de análise de datas criando um microsserviço de timestamp." ] }, - "express-middleware": { - "note": "Lançamento previsto para o final de 2026", + "error-handling-in-express": { "intro": [ - "Neste módulo, você aprenderá sobre middleware no Express.js, usado para tratar requisições e respostas entre cliente e servidor. Depois, praticará suas habilidades em uma oficina e laboratório e testará seu conhecimento com um quiz curto." + "Neste módulo, você aprenderá como funciona o tratamento de erros, depuração e verificações de saúde no Express.js. Depois, praticará o que aprendeu em um laboratório e testará seu conhecimento com um quiz curto." ] }, "websockets": { - "note": "Lançamento previsto para o final de 2026", "intro": [ "Neste módulo, você será apresentado aos websockets, um protocolo usado para comunicação em tempo real entre cliente e servidor. Depois, praticará o que aprendeu em laboratórios e oficinas e testará seu conhecimento com um quiz curto." ] }, "lab-chat-app": { - "note": "Disponível no final de 2026", "intro": [ "Pratique criar um servidor de chat em tempo real para múltiplos clientes usando WebSockets do Node.js." ] }, "security-and-privacy": { - "note": "Lançamento previsto para o final de 2026", "intro": [ "Neste módulo, você aprenderá as diferenças entre segurança e privacidade, além de outros conceitos como CSPs, políticas de permissões, PII, trabalho com CORS e mais. Depois, fará um quiz curto para testar seu conhecimento." ] }, "authentication": { - "note": "Lançamento previsto para o final de 2026", "intro": [ "Neste módulo, você aprenderá como funciona a autenticação em aplicações web, junto com outros conceitos importantes como JWTs, CSRFs, Passport, Helmet, criptografia e encriptação, e mais. Depois, praticará o que aprendeu em laboratórios e oficinas e testará seu conhecimento com um quiz curto." ] }, "lab-family-movie-watchlist-api": { - "note": "Disponível no final de 2026", "intro": [ "Pratique implementar autenticação e autorização em uma aplicação Express criando uma API de lista de filmes para a família." ] }, "back-end-development-and-apis-certification-exam": { - "note": "Lançamento previsto para o final de 2026", "intro": [ "Passe neste exame para obter sua certificação em desenvolvimento back-end e APIs." ] }, "review-back-end-development-and-apis": { - "note": "Previsto para o final de 2026", "intro": [ "Revise os conceitos de desenvolvimento back-end e APIs para se preparar para o próximo exame." ] @@ -7302,7 +7291,7 @@ }, "blocks": { "lecture-working-with-nodejs-and-event-driven-architecture": { - "title": "Trabalhando com NodeJS e arquitetura orientada a eventos", + "title": "Trabalhando com Node.js e arquitetura orientada a eventos", "intro": [ "Aprenda sobre as bibliotecas principais do Node.js, como instalar Node.js no seu computador e as vantagens e desvantagens de usar Node.js no back-end." ] @@ -7416,24 +7405,6 @@ "" ] }, - "lecture-understanding-rest-api-and-web-services": { - "title": "Entendendo a API REST e os serviços web", - "intro": [ - "Nessas lições, você aprenderá sobre APIs REST e serviços web, e como eles permitem que diferentes aplicações se comuniquem pela internet." - ] - }, - "workshop-build-a-weather-service-api": { - "title": "Crie uma API de serviço meteorológico", - "intro": [ - "Você vai aprender parâmetros de rota e roteamento modular com express.Router construindo uma API de serviço meteorológico." - ] - }, - "lab-timestamp-microservice": { - "title": "Construa um microserviço de timestamp", - "intro": [ - "Pratique criar uma API RESTful com lógica de análise de datas criando um microserviço de timestamp." - ] - }, "lecture-working-with-express": { "title": "Trabalhando com Express", "intro": [ @@ -7453,16 +7424,10 @@ "Você vai aprender roteamento básico do Express e métodos de resposta construindo um app de piadas aleatórias." ] }, - "lab-personal-profile-app": { - "title": "Construa um app de perfil pessoal", - "intro": [ - "Pratique criar um servidor Express e uma API JSON criando uma aplicação de perfil pessoal." - ] - }, "review-introduction-to-express": { "title": "Revisão de introdução ao Express", "intro": [ - "Revise serviços web, REST, microserviços e roteamento do Express.js antes de fazer o quiz." + "Revise Express.js, roteamento, métodos de resposta e como servir arquivos estáticos antes de fazer o quiz." ] }, "quiz-introduction-to-express": { @@ -7471,28 +7436,10 @@ "Teste seus conhecimentos sobre serviços web, REST, microserviços, Express.js e roteamento." ] }, - "lecture-understanding-error-handling-and-health-checks": { - "title": "Entendendo o tratamento de erros e verificações de saúde", - "intro": [ - "Nessas lições, você aprenderá sobre tratamento de erros e verificações de saúde no Express." - ] - }, - "workshop-build-a-bank-api": { - "title": "Crie uma API bancária", - "intro": [ - "Você vai aprender tratamento de erros no Express 5, verificações de saúde e desligamentos suaves construindo uma API bancária." - ] - }, - "review-error-handling-in-express": { - "title": "Revisão de tratamento de erros no Express", - "intro": [ - "Revise códigos de status HTTP, tratamento de erros, depuração, registro, verificações de saúde e desligamentos suaves antes de fazer o quiz." - ] - }, - "quiz-error-handling-in-express": { - "title": "Quiz de tratamento de erros no Express", + "lab-personal-profile-app": { + "title": "Construa um app de perfil pessoal", "intro": [ - "Teste seus conhecimentos sobre códigos de status HTTP, tratamento de erros, depuração, registro, verificações de saúde e desligamentos suaves." + "Pratique criar um servidor Express e uma API JSON criando uma aplicação de perfil pessoal." ] }, "lecture-express-middleware": { @@ -7525,6 +7472,54 @@ "Teste seus conhecimentos sobre middleware do Express, incluindo middleware em nível de aplicação, roteador, tratamento de erros, e middleware embutido e de terceiros." ] }, + "lecture-understanding-rest-api-and-web-services": { + "title": "Entendendo a API REST e os serviços web", + "intro": [ + "Nessas lições, você aprenderá sobre APIs REST e serviços web, e como eles permitem que diferentes aplicações se comuniquem pela internet." + ] + }, + "workshop-build-a-weather-service-api": { + "title": "Crie uma API de serviço meteorológico", + "intro": [ + "Você vai aprender parâmetros de rota e roteamento modular com express.Router construindo uma API de serviço meteorológico." + ] + }, + "review-rest-api-and-web-services": { + "title": "Revisão de API REST e serviços web", + "intro": [ + "Revise serviços web, a arquitetura REST, códigos de status HTTP e microsserviços." + ] + }, + "lab-timestamp-microservice": { + "title": "Construa um microserviço de timestamp", + "intro": [ + "Pratique criar uma API RESTful com lógica de análise de datas criando um microserviço de timestamp." + ] + }, + "lecture-understanding-error-handling-and-health-checks": { + "title": "Entendendo o tratamento de erros e verificações de saúde", + "intro": [ + "Nessas lições, você aprenderá sobre tratamento de erros e verificações de saúde no Express." + ] + }, + "workshop-build-a-bank-api": { + "title": "Crie uma API bancária", + "intro": [ + "Você vai aprender tratamento de erros no Express 5, verificações de saúde e desligamentos suaves construindo uma API bancária." + ] + }, + "review-error-handling-in-express": { + "title": "Revisão de tratamento de erros no Express", + "intro": [ + "Revise códigos de status HTTP, tratamento de erros, depuração, registro, verificações de saúde e desligamentos suaves antes de fazer o quiz." + ] + }, + "quiz-error-handling-in-express": { + "title": "Quiz de tratamento de erros no Express", + "intro": [ + "Teste seus conhecimentos sobre códigos de status HTTP, tratamento de erros, depuração, registro, verificações de saúde e desligamentos suaves." + ] + }, "lecture-understanding-websockets": { "title": "Entendendo WebSockets", "intro": [ @@ -8427,7 +8422,7 @@ "title": "Criar um menu de café", "intro": [ "CSS diz ao navegador como exibir sua página web. Você pode usar CSS para definir cor, fonte, tamanho e outros aspectos dos elementos HTML.", - "Nesta oficina, você vai aprender CSS criando uma página de menu para um site de café." + "Nesta oficina, você vai aprender CSS criando uma página de menu para um café." ] }, "lab-business-card": { @@ -9695,7 +9690,7 @@ "title": "Desenhe um menu de café", "intro": [ "O CSS diz ao navegador como exibir sua página. Você pode usar CSS para definir cor, fonte, tamanho e outros aspectos dos elementos HTML.", - "Nesta oficina, você aprenderá CSS criando uma página de menu para um site de café." + "Nesta oficina, você vai aprender CSS criando uma página de menu para um café." ] }, "lab-business-card": { diff --git a/client/portuguese/translations.json b/client/portuguese/translations.json index 196f656bfc0..5bda15863cf 100644 --- a/client/portuguese/translations.json +++ b/client/portuguese/translations.json @@ -558,6 +558,12 @@ "running-tests": "// executando testes", "tests-completed": "// testes concluídos", "console-output": "// saída do console", + "unavailable-local-resource": "Falha ao carregar o recurso: \"{{source}}\" não é um arquivo local {{resourceType}} disponível. Use: {{allowedSources}}.", + "unavailable-local-resource-no-allowed": "Falha ao carregar o recurso: \"{{source}}\" não é um arquivo local {{resourceType}} disponível neste desafio.", + "local-resource-type": { + "stylesheet": "folha de estilo", + "script": "script" + }, "example-app": "Construa um app funcionalmente semelhante a <0>este projeto de exemplo. Tente não copiar o projeto, dê seu estilo pessoal.", "syntax-error": "Seu código gerou um erro antes que os testes pudessem ser executados. Por favor, corrija e tente novamente.", "indentation-error": "Seu código tem um erro de indentação. Pode ser necessário adicionar pass em uma nova linha para formar um bloco válido.", @@ -656,25 +662,6 @@ "sub-step-7": "Clique no botão <0>Adicionar segredo", "summary": "Configuração do Codespaces" }, - "ona": { - "intro": "Este curso roda em uma máquina virtual Linux usando Ona. Siga estas instruções para começar o curso:", - "step-1": "<0>Crie uma conta no Ona se ainda não tiver uma", - "step-2": "Clique no botão iniciar abaixo", - "step-3": "No modal que aparecer, clique no botão criar", - "step-4": "Quando a máquina virtual Linux terminar de carregar, inicie a extensão CodeRoad fazendo o seguinte:", - "step-5": "Clique no menu \"hambúrguer\" perto do canto superior esquerdo da janela do VSCode,", - "step-6": "Vá ao menu <0>Exibir,", - "step-7": "Clique na opção <0>Paleta de comandos,", - "step-8": "e execute o comando <0>CodeRoad: Start", - "step-9": "Siga as instruções no CodeRoad para completar o curso", - "continue-project": "Clicar no botão iniciar abaixo vai começar um novo projeto. Se você já iniciou o curso {{course}}, vá para <0>seu painel do Ona para continuar.", - "learn-more": "Saiba mais sobre <0>workspaces do Ona.", - "logout-warning": "Se você sair do freeCodeCamp antes de completar todo o curso {{course}}, seu progresso não será salvo na sua conta do freeCodeCamp.", - "sub-step-3": "Navegue até sua <0>página de segredos do Ona", - "sub-step-4": "Crie um novo segredo chamado <0>CODEROAD_WEBHOOK_TOKEN", - "sub-step-5": "No campo <0>Segredo, cole seu token", - "summary": "Configuração do Ona" - }, "freecodecamp-os": { "token-modal": "Quando você executar o curso, aparecerá um modal pedindo seu token de usuário. Cole o token que você copiou acima nele. Você só precisa fazer isso uma vez por ambiente.", "local": { @@ -697,16 +684,6 @@ "step-5": "O Simple Browser abrirá quando estiver pronto. Se aparecer uma página branca em branco, use o botão de atualizar para atualizá-la e ver a página inicial do curso.", "step-6": "Clique em um dos projetos disponíveis para iniciá-lo e siga as instruções do projeto para completá-lo.", "continue-project": "Clicar no botão iniciar abaixo iniciará uma nova máquina. Se você já começou o curso {{title}}, vá para a <0>página do repositório para reabrir um workspace anterior." - }, - "ona": { - "intro": "Este curso roda em uma máquina virtual Linux usando Ona e a extensão freeCodeCamp - Courses para VS Code. Siga estas instruções para iniciar o curso:", - "step-1": "<0>Crie uma conta na Ona se ainda não tiver uma", - "step-2": "Clique no botão iniciar abaixo", - "step-3": "No modal que aparecer, clique no botão criar", - "step-4": "Quando a máquina virtual Linux terminar de carregar, abra a paleta de comandos e execute o comando <0>freeCodeCamp: Run Course", - "step-5": "O Simple Browser abrirá quando estiver pronto. Se aparecer uma página branca em branco, use o botão de atualizar para atualizá-la e ver a página inicial do curso.", - "step-6": "Clique em um dos projetos disponíveis para iniciá-lo e siga as instruções do projeto para completá-lo.", - "continue-project": "Clicar no botão iniciar abaixo iniciará uma nova máquina. Se você já começou o curso {{course}}, vá para <0>seu painel da Ona para continuar." } }, "local": { diff --git a/client/swahili/intro.json b/client/swahili/intro.json index 504fa67c3dd..f8d32c675c2 100644 --- a/client/swahili/intro.json +++ b/client/swahili/intro.json @@ -1352,12 +1352,6 @@ "Katika warsha hii yenye mafundisho 140, utakamilisha hifadhidata yako ya wanafunzi huku ukichunguza kwa kina zaidi amri za SQL." ] }, - "lab-world-cup-database": { - "title": "Jenga Hifadhidata ya Kombe la Dunia", - "intro": [ - "Kwa mradi huu, utaunda skripti ya Bash inayoweka taarifa kutoka michezo ya Kombe la Dunia katika PostgreSQL, kisha utatumia hoja ya utafutaji kwenye hifadhidata kupata takwimu muhimu." - ] - }, "workshop-kitty-ipsum-translator": { "title": "Jenga Tafsiri ya Kitty Ipsum", "intro": [ @@ -1371,6 +1365,12 @@ "Katika warsha hii yenye mafundisho 210, utajenga programu ya Bash inayoshirikiana inayohifadhi taarifa za upangaji wa baiskeli kwa duka lako la kukodisha kwa kutumia PostgreSQL." ] }, + "lab-world-cup-database": { + "title": "Jenga Hifadhidata ya Kombe la Dunia", + "intro": [ + "Kwa mradi huu, utaunda skripti ya Bash inayoweka taarifa kutoka michezo ya Kombe la Dunia katika PostgreSQL, kisha utatumia hoja ya utafutaji kwenye hifadhidata kupata takwimu muhimu." + ] + }, "lab-salon-appointment-scheduler": { "title": "Jenga Ratiba ya Miadi ya Saluni", "intro": [ @@ -2669,6 +2669,13 @@ "Utatumia masharti kuamua alama ya mwanafunzi kulingana na alama yake." ] }, + "lab-story-fragment-restoration": { + "title": "Rejesha hadithi inayolingana kutoka kwenye safu ya vipande vya hadithi", + "intro": [ + "Katika warsha hii, utarejesha hadithi inayolingana kutoka kwenye safu ya vipande vya hadithi vilivyoharibika.", + "Utajifunza kutumia mizunguko kwa kutekeleza algoriti za msingi za safu ya data kutoka mwanzo." + ] + }, "lecture-the-var-keyword-and-hoisting": { "title": "Neno la var na Hoisting", "intro": [ @@ -3774,18 +3781,18 @@ "Jifunze mfano wa sanduku wa CSS kupitia kozi hii. Elewa jinsi vipengele vinavyoonyeshwa mtandaoni, na jifunze kudhibiti nafasi, mipaka, na nafasi ya ndani ili kufanikisha mpangilio na muundo unaotaka." ] }, - "top-introduction-to-flexbox": { - "title": "Utangulizi wa Flexbox", - "intro": [ - "Gundua nguvu ya Flexbox, mfano wa mpangilio unaorahisisha muundo wa miundo ya mtandao inayojibadilisha kulingana na kifaa. Jifunze jinsi ya kuunda miundo ya kurasa inayobadilika na inayojibadilisha kwa urahisi." - ] - }, "top-learn-block-and-inline": { "title": "Jifunze tofauti kati ya block na inline", "intro": [ "Chunguza tofauti kati ya vipengele vya block na inline katika HTML na CSS. Kozi hii inatoa ufahamu wa jinsi aina hizi za maonyesho zinavyoathiri mpangilio na tabia, ikikupa uwezo wa kufanya maamuzi sahihi ya muundo." ] }, + "top-introduction-to-flexbox": { + "title": "Utangulizi wa Flexbox", + "intro": [ + "Gundua nguvu ya Flexbox, mfano wa mpangilio unaorahisisha muundo wa miundo ya mtandao inayojibadilisha kulingana na kifaa. Jifunze jinsi ya kuunda miundo ya kurasa inayobadilika na inayojibadilisha kwa urahisi." + ] + }, "top-learn-variables-and-operators": { "title": "Jifunze kuhusu vigezo na waendeshaji", "intro": [ @@ -6287,12 +6294,6 @@ "Utazoeza kufanya kazi na madarasa ya msaada ya Tailwind CSS kwa mpangilio wa flexbox, rangi, viashiria vya kuvunja na zaidi." ] }, - "lab-photography-exhibit": { - "title": "Tengeneza maonyesho ya picha", - "intro": [ - "Katika maabara hii, utazoeza kufanya kazi na Tailwind CSS kwa kutengeneza ukurasa wa maonyesho ya picha mtandaoni." - ] - }, "review-css-libraries-and-frameworks": { "title": "Kagua maktaba za CSS na mifumo ya kazi", "intro": [ @@ -6306,6 +6307,12 @@ "Jaribu kile ulichojifunza kuhusu maktaba za CSS na mifumo ya kazi kwa jaribio hili." ] }, + "lab-photography-exhibit": { + "title": "Tengeneza maonyesho ya picha", + "intro": [ + "Katika maabara hii, utazoeza kufanya kazi na Tailwind CSS kwa kutengeneza ukurasa wa maonyesho ya picha mtandaoni." + ] + }, "lecture-introduction-to-typescript": { "title": "Utangulizi wa TypeScript", "intro": [ @@ -6372,18 +6379,6 @@ "Katika warsha hii, utaendelea kufanya mazoezi ya TypeScript kwa kujenga programu ya kutabiri hatima." ] }, - "lab-flashcard-quiz-app": { - "title": "Jenga programu ya jaribio fupi la kadi za kumbukumbu", - "intro": [ - "Katika maabara hii, utajifunza kutumia TypeScript kwa kujenga programu ya jaribio fupi la kadi za kumbukumbu." - ] - }, - "lab-digital-pet-game": { - "title": "Jenga mchezo wa mnyama wa kidijitali", - "intro": [ - "Katika maabara hii, utatumia kile ulichojifunza kuhusu TypeScript na React kwa kujenga mchezo wa mnyama wa kidijitali." - ] - }, "workshop-build-a-football-player-card-builder": { "title": "Jenga mtengenezaji wa kadi za wachezaji wa mpira wa miguu", "intro": [ @@ -6401,6 +6396,18 @@ "title": "Jaribio la TypeScript", "intro": ["Jaribu kile ulichojifunza kuhusu TypeScript kwa jaribio hili."] }, + "lab-flashcard-quiz-app": { + "title": "Jenga programu ya jaribio fupi la kadi za kumbukumbu", + "intro": [ + "Katika maabara hii, utajifunza kutumia TypeScript kwa kujenga programu ya jaribio fupi la kadi za kumbukumbu." + ] + }, + "lab-digital-pet-game": { + "title": "Jenga mchezo wa mnyama wa kidijitali", + "intro": [ + "Katika maabara hii, utatumia kile ulichojifunza kuhusu TypeScript na React kwa kujenga mchezo wa mnyama wa kidijitali." + ] + }, "review-front-end-libraries": { "title": "Kagua maktaba za mbele", "intro": [ @@ -7176,12 +7183,12 @@ "node-package-manager": "Msimamizi wa vifurushi wa Node", "lab-prime-number-checker-module": "Jenga moduli ya kukagua namba msingi", "http-and-the-web-standards-model": "HTTP na mfano wa viwango vya mtandao", - "rest-api-and-web-services": "REST API na huduma za mtandao", - "lab-timestamp-microservice": "Jenga huduma ndogo ya timestamp", "introduction-to-express": "Utangulizi wa Express", "lab-personal-profile-app": "Jenga programu ya wasifu binafsi", - "error-handling-in-express": "Ushughulikiaji wa hitilafu katika Express", "express-middleware": "Programu ya kati ya Express", + "rest-api-and-web-services": "REST API na huduma za mtandao", + "lab-timestamp-microservice": "Jenga huduma ndogo ya timestamp", + "error-handling-in-express": "Ushughulikiaji wa hitilafu katika Express", "websockets": "WebSockets", "lab-chat-app": "Jenga programu ya mazungumzo", "security-and-privacy": "Usalama na faragha", @@ -7192,109 +7199,91 @@ }, "module-intros": { "introduction-to-nodejs": { - "note": "Inakuja mwishoni mwa 2026", "intro": [ "Katika moduli hii, utajifunza misingi ya kufanya kazi na Node.js." ] }, "nodejs-core-modules": { - "note": "Inakuja mwishoni mwa 2026", "intro": [ "Katika moduli hii, utajifunza kuhusu moduli kuu za Node.js kama fs, os, path na zaidi. Kisha utapata fursa ya kufanya mazoezi kupitia warsha na maabara na kupima maarifa yako kupitia jaribio fupi." ] }, "node-package-manager": { - "note": "Inakuja mwishoni mwa 2026", "intro": [ "Katika moduli hii, utatambulishwa na Msimamizi wa vifurushi wa Node, ambao wasanidi programu hutumia kusimamia utegemezi wa miradi na misimbo. Kisha utafanya mazoezi kupitia warsha na maabara na kupima maarifa yako kwa jaribio fupi." ] }, "lab-prime-number-checker-module": { - "note": "Inakuja mwishoni mwa 2026", "intro": [ "Jifunze kujenga na kusafirisha moduli ya npm kwa kuunda kipima namba msingi." ] }, "http-and-the-web-standards-model": { - "note": "Inakuja mwishoni mwa 2026", "intro": [ "Katika moduli hii, utajifunza kuhusu HTTP (Hypertext Transfer Protocol) na dhana nyingine muhimu ikiwemo mfano wa ombi-jibu, nambari za kawaida za jibu, DNS, TCP/IP, na zaidi. Kisha utafanya mazoezi ya kujenga seva yako mwenyewe kupitia warsha na kupima maarifa yako kwa jaribio fupi." ] }, - "rest-api-and-web-services": { - "note": "Inakuja mwishoni mwa 2026", + "introduction-to-express": { "intro": [ - "Katika moduli hii, utajifunza kuhusu REST API (uhamishaji wa hali ya uwakilishi (REST)) na jinsi microservices zinavyofanya kazi. Kisha utachukua jaribio fupi kupima maarifa yako." + "Katika moduli hii, utatambulishwa na Express.js, ambayo ni mfumo wa kazi unaotumika kujenga RESTful APIs. Kisha utafanya mazoezi kupitia warsha na maabara na kupima maarifa yako kwa jaribio fupi." ] }, - "lab-timestamp-microservice": { - "note": "Inakuja mwishoni mwa 2026", + "lab-personal-profile-app": { "intro": [ - "Jifunze kujenga API ya RESTful yenye mantiki ya kuchambua tarehe kwa kuunda huduma ndogo ya timestamp." + "Jifunze kujenga seva ya Express na API ya JSON kwa kuunda programu ya wasifu binafsi." ] }, - "introduction-to-express": { - "note": "Inakuja mwishoni mwa 2026", + "express-middleware": { "intro": [ - "Katika moduli hii, utatambulishwa na Express.js, ambayo ni mfumo wa kazi unaotumika kujenga RESTful APIs. Kisha utafanya mazoezi kupitia warsha na maabara na kupima maarifa yako kwa jaribio fupi." + "Katika moduli hii, utajifunza kuhusu programu ya kati katika Express.js, inayotumika kushughulikia maombi na majibu kati ya mteja na seva. Kisha utafanya mazoezi kupitia warsha na maabara na kupima maarifa yako kwa jaribio fupi." ] }, - "lab-personal-profile-app": { - "note": "Inakuja mwishoni mwa 2026", + "rest-api-and-web-services": { "intro": [ - "Jifunze kujenga seva ya Express na API ya JSON kwa kuunda programu ya wasifu binafsi." + "Katika moduli hii, utajifunza kuhusu REST API (uhamishaji wa hali ya uwakilishi (REST)) na jinsi microservices zinavyofanya kazi. Kisha utachukua jaribio fupi kupima maarifa yako." ] }, - "error-handling-in-express": { - "note": "Inakuja mwishoni mwa 2026", + "lab-timestamp-microservice": { "intro": [ - "Katika moduli hii, utajifunza jinsi usimamizi wa hitilafu, kutafuta makosa, na ukaguzi wa afya unavyofanya kazi katika Express.js. Kisha utafanya mazoezi katika maabara na kupima maarifa yako kwa jaribio fupi." + "Jifunze kujenga API ya RESTful yenye mantiki ya kuchambua tarehe kwa kuunda huduma ndogo ya timestamp." ] }, - "express-middleware": { - "note": "Inakuja mwishoni mwa 2026", + "error-handling-in-express": { "intro": [ - "Katika moduli hii, utajifunza kuhusu programu ya kati katika Express.js, inayotumika kushughulikia maombi na majibu kati ya mteja na seva. Kisha utafanya mazoezi kupitia warsha na maabara na kupima maarifa yako kwa jaribio fupi." + "Katika moduli hii, utajifunza jinsi usimamizi wa hitilafu, kutafuta makosa, na ukaguzi wa afya unavyofanya kazi katika Express.js. Kisha utafanya mazoezi katika maabara na kupima maarifa yako kwa jaribio fupi." ] }, "websockets": { - "note": "Inakuja mwishoni mwa 2026", "intro": [ "Katika moduli hii, utatambulishwa na websockets, ambayo ni itifaki inayotumika kwa mawasiliano ya wakati halisi kati ya mteja na seva. Kisha utafanya mazoezi katika maabara na warsha na kupima maarifa yako kwa jaribio fupi." ] }, "lab-chat-app": { - "note": "Inakuja mwishoni mwa 2026", "intro": [ "Jifunze kujenga seva ya mazungumzo ya wakati halisi kwa wateja wengi ukitumia Node.js WebSockets." ] }, "security-and-privacy": { - "note": "Inakuja mwishoni mwa 2026", "intro": [ "Katika moduli hii, utajifunza tofauti kati ya usalama na faragha pamoja na dhana nyingine ikiwemo CSPs, Sera za Ruhusa, PII, kufanya kazi na CORS, na zaidi. Kisha utachukua jaribio fupi kupima maarifa yako." ] }, "authentication": { - "note": "Inakuja mwishoni mwa 2026", "intro": [ "Katika moduli hii, utajifunza jinsi uthibitisho wa utambulisho unavyofanya kazi katika programu za mtandao pamoja na dhana nyingine muhimu ikiwemo JWTs, CSRFs, Passport, Helmet, usimbaji fiche na usimbaji, na zaidi. Kisha utafanya mazoezi katika maabara na warsha na kupima maarifa yako kwa jaribio fupi." ] }, "lab-family-movie-watchlist-api": { - "note": "Inakuja mwishoni mwa 2026", "intro": [ "Jifunze kutekeleza uthibitisho wa utambulisho na idhini katika programu ya Express kwa kujenga API ya orodha ya filamu za familia." ] }, "back-end-development-and-apis-certification-exam": { - "note": "Inakuja mwishoni mwa 2026", "intro": [ "Pita mtihani huu ili kupata cheti chako cha ukuzaji wa nyuma na APIs." ] }, "review-back-end-development-and-apis": { - "note": "Inakuja mwishoni mwa 2026", "intro": [ "Kagua dhana za ukuzaji wa nyuma na APIs kujiandaa kwa mtihani ujao." ] @@ -7302,7 +7291,7 @@ }, "blocks": { "lecture-working-with-nodejs-and-event-driven-architecture": { - "title": "Kufanya kazi na NodeJS na usanifu unaoendeshwa na matukio", + "title": "Kufanya kazi na Node.js na usanifu unaoendeshwa na matukio", "intro": [ "Jifunze kuhusu maktaba kuu za Node.js, jinsi ya kusanidi Node.js kwenye kompyuta yako, na faida na hasara za kutumia Node.js upande wa nyuma." ] @@ -7416,24 +7405,6 @@ "" ] }, - "lecture-understanding-rest-api-and-web-services": { - "title": "Kuelewa REST API na huduma za mtandao", - "intro": [ - "Katika masomo haya, utajifunza kuhusu REST APIs na huduma za mtandao, na jinsi zinavyoruhusu programu tofauti kuwasiliana kwa kila mmoja kupitia mtandao." - ] - }, - "workshop-build-a-weather-service-api": { - "title": "Jenga API ya huduma ya hali ya hewa", - "intro": [ - "Utajifunza vigezo vya njia na upangaji njia wa moduli kwa kutumia express.Router kwa kujenga API ya huduma ya hali ya hewa." - ] - }, - "lab-timestamp-microservice": { - "title": "Jenga huduma ndogo ya alama ya wakati", - "intro": [ - "Fanya mazoezi ya kujenga RESTful API yenye mantiki ya uchambuzi wa tarehe kwa kuunda huduma ndogo ya alama ya wakati." - ] - }, "lecture-working-with-express": { "title": "Kufanya kazi na Express", "intro": [ @@ -7453,16 +7424,10 @@ "Utajifunza upangaji wa msingi wa Express na njia za majibu kwa kujenga programu ya vichekesho vya nasibu." ] }, - "lab-personal-profile-app": { - "title": "Jenga programu ya wasifu binafsi", - "intro": [ - "Fanya mazoezi ya kujenga seva ya Express na API ya JSON kwa kuunda programu ya wasifu binafsi." - ] - }, "review-introduction-to-express": { "title": "Kagua utangulizi wa Express", "intro": [ - "Kagua huduma za mtandao, REST, huduma ndogo, na upangaji njia wa Express.js kabla ya kuchukua jaribio fupi." + "Kagua Express.js, njia za kuongoza, njia za majibu, na kuhudumia mafaili ya statiki kabla ya kuchukua jaribio fupi." ] }, "quiz-introduction-to-express": { @@ -7471,28 +7436,10 @@ "Jaribu maarifa yako kuhusu huduma za mtandao, REST, huduma ndogo, Express.js, na upangaji njia." ] }, - "lecture-understanding-error-handling-and-health-checks": { - "title": "Kuelewa usimamizi wa hitilafu na ukaguzi wa afya", - "intro": [ - "Katika masomo haya, utajifunza kuhusu usimamizi wa hitilafu na ukaguzi wa afya katika Express." - ] - }, - "workshop-build-a-bank-api": { - "title": "Jenga API ya benki", - "intro": [ - "Utajifunza usimamizi wa makosa wa Express 5, ukaguzi wa afya, na kufunga kwa heshima kwa kujenga API ya benki." - ] - }, - "review-error-handling-in-express": { - "title": "Kagua usimamizi wa hitilafu katika Express", - "intro": [ - "Kagua nambari za hali za HTTP, usimamizi wa hitilafu, kurekebisha makosa, kuandika kumbukumbu, ukaguzi wa afya, na kufunga kwa heshima kabla ya kuchukua jaribio fupi." - ] - }, - "quiz-error-handling-in-express": { - "title": "Jaribio fupi la usimamizi wa hitilafu katika Express", + "lab-personal-profile-app": { + "title": "Jenga programu ya wasifu binafsi", "intro": [ - "Jaribu maarifa yako kuhusu nambari za hali za HTTP, usimamizi wa hitilafu, kurekebisha makosa, kuandika kumbukumbu, ukaguzi wa afya, na kufunga kwa heshima." + "Fanya mazoezi ya kujenga seva ya Express na API ya JSON kwa kuunda programu ya wasifu binafsi." ] }, "lecture-express-middleware": { @@ -7525,6 +7472,54 @@ "Jaribu maarifa yako kuhusu programu ya kati ya Express, ikiwa ni pamoja na kiwango cha programu, kiwango cha kipanga-njia, usimamizi wa hitilafu, na programu ya kati iliyojengwa ndani na ya wahusika wengine." ] }, + "lecture-understanding-rest-api-and-web-services": { + "title": "Kuelewa REST API na huduma za mtandao", + "intro": [ + "Katika masomo haya, utajifunza kuhusu REST APIs na huduma za mtandao, na jinsi zinavyoruhusu programu tofauti kuwasiliana kwa kila mmoja kupitia mtandao." + ] + }, + "workshop-build-a-weather-service-api": { + "title": "Jenga API ya huduma ya hali ya hewa", + "intro": [ + "Utajifunza vigezo vya njia na upangaji njia wa moduli kwa kutumia express.Router kwa kujenga API ya huduma ya hali ya hewa." + ] + }, + "review-rest-api-and-web-services": { + "title": "Kagua REST API na huduma za mtandao", + "intro": [ + "Kagua huduma za mtandao, usanifu wa REST, nambari za hali za HTTP, na huduma ndogo ndogo." + ] + }, + "lab-timestamp-microservice": { + "title": "Jenga huduma ndogo ya alama ya wakati", + "intro": [ + "Fanya mazoezi ya kujenga RESTful API yenye mantiki ya uchambuzi wa tarehe kwa kuunda huduma ndogo ya alama ya wakati." + ] + }, + "lecture-understanding-error-handling-and-health-checks": { + "title": "Kuelewa usimamizi wa hitilafu na ukaguzi wa afya", + "intro": [ + "Katika masomo haya, utajifunza kuhusu usimamizi wa hitilafu na ukaguzi wa afya katika Express." + ] + }, + "workshop-build-a-bank-api": { + "title": "Jenga API ya benki", + "intro": [ + "Utajifunza usimamizi wa makosa wa Express 5, ukaguzi wa afya, na kufunga kwa heshima kwa kujenga API ya benki." + ] + }, + "review-error-handling-in-express": { + "title": "Kagua usimamizi wa hitilafu katika Express", + "intro": [ + "Kagua nambari za hali za HTTP, usimamizi wa hitilafu, kurekebisha makosa, kuandika kumbukumbu, ukaguzi wa afya, na kufunga kwa heshima kabla ya kuchukua jaribio fupi." + ] + }, + "quiz-error-handling-in-express": { + "title": "Jaribio fupi la usimamizi wa hitilafu katika Express", + "intro": [ + "Jaribu maarifa yako kuhusu nambari za hali za HTTP, usimamizi wa hitilafu, kurekebisha makosa, kuandika kumbukumbu, ukaguzi wa afya, na kufunga kwa heshima." + ] + }, "lecture-understanding-websockets": { "title": "Kuelewa WebSockets", "intro": [ @@ -8427,7 +8422,7 @@ "title": "Tengeneza menyu ya kafé", "intro": [ "CSS inaeleza kivinjari jinsi ya kuonyesha ukurasa wako wa wavuti. Unaweza kutumia CSS kuweka rangi, fonti, ukubwa, na vipengele vingine vya vipengele vya HTML.", - "Katika warsha hii, utajifunza CSS kwa kutengeneza ukurasa wa menyu kwa tovuti ya kafé." + "Katika warsha hii, utajifunza CSS kwa kubuni ukurasa wa menyu kwa ajili ya mkahawa." ] }, "lab-business-card": { @@ -9695,7 +9690,7 @@ "title": "Tengeneza Menyu ya Kafe", "intro": [ "CSS inaeleza kivinjari jinsi ya kuonyesha ukurasa wako wa mtandao. Unaweza kutumia CSS kuweka rangi, fonti, ukubwa, na vipengele vingine vya HTML.", - "Katika warsha hii, utajifunza CSS kwa kutengeneza ukurasa wa menyu kwa tovuti ya kafe." + "Katika warsha hii, utajifunza CSS kwa kubuni ukurasa wa menyu kwa ajili ya mkahawa." ] }, "lab-business-card": { diff --git a/client/swahili/translations.json b/client/swahili/translations.json index bf6b6687b8f..662e614f154 100644 --- a/client/swahili/translations.json +++ b/client/swahili/translations.json @@ -558,6 +558,12 @@ "running-tests": "// kuendesha mitihani", "tests-completed": "// mitihani imemalizika", "console-output": "// matokeo ya konsoli", + "unavailable-local-resource": "Imeshindikana kupakia rasilimali: \"{{source}}\" si faili ya {{resourceType}} ya ndani inayopatikana. Tumia: {{allowedSources}}.", + "unavailable-local-resource-no-allowed": "Imeshindikana kupakia rasilimali: \"{{source}}\" si faili ya {{resourceType}} ya ndani inayopatikana katika changamoto hii.", + "local-resource-type": { + "stylesheet": "lahajedwali", + "script": "scripti" + }, "example-app": "Jenga programu inayofanana kiutendaji na <0>mradi huu wa mfano. Jaribu usikopi mradi wa mfano, toa mtindo wako binafsi.", "syntax-error": "Msimbo wako umeleta kosa kabla ya mitihani kuanza. Tafadhali rekebisha na ujaribu tena.", "indentation-error": "Msimbo wako una kosa la upangaji mistari. Huenda unahitaji kuongeza pass kwenye mstari mpya ili kuunda sehemu halali ya msimbo.", @@ -656,25 +662,6 @@ "sub-step-7": "Bofya kitufe cha <0>Add secret", "summary": "Usanidi wa Codespaces" }, - "ona": { - "intro": "Kozi hii inaendeshwa kwenye mashine ya Linux ya mtandao kwa kutumia Ona. Fuata maelekezo haya kuanza kozi:", - "step-1": "<0>Tengeneza akaunti ya Ona ikiwa huna", - "step-2": "Bofya kitufe cha kuanza hapa chini", - "step-3": "Katika dirisha linalojitokeza, bofya kitufe cha tengeneza", - "step-4": "Mara mashine ya Linux ya mtandao itakapomaliza kupakia, anzisha ugani wa CodeRoad kwa:", - "step-5": "Kubofya menyu ya \"hamburger\" karibu juu kushoto ya dirisha la VSCode,", - "step-6": "Nenda kwenye menyu ya <0>View,", - "step-7": "Bofya chaguo la <0>Command Palette,", - "step-8": "na endesha amri ya <0>CodeRoad: Start", - "step-9": "Fuata maelekezo katika CodeRoad kumaliza kozi", - "continue-project": "Kubofya kitufe cha kuanza hapa chini kutaanzisha mradi mpya. Ikiwa umewahi kuanza kozi ya {{course}}, nenda <0>kibodi chako cha Ona kuendelea.", - "learn-more": "Jifunze zaidi kuhusu <0>eneo la kazi la Ona.", - "logout-warning": "Ikiwa utaondoka kwenye freeCodeCamp kabla ya kumaliza kozi yote ya {{course}}, maendeleo yako hayatatazimwa kwenye akaunti yako ya freeCodeCamp.", - "sub-step-3": "Nenda kwenye <0>ukurasa wa siri za Ona", - "sub-step-4": "Tengeneza siri mpya iitwayo <0>CODEROAD_WEBHOOK_TOKEN", - "sub-step-5": "Katika uwanja wa <0>Secret, bandika tokeni yako", - "summary": "Usanidi wa Ona" - }, "freecodecamp-os": { "token-modal": "Unapoendesha kozi, dirisha la modal litaonekana likiomba tokeni yako ya mtumizi. Bandika tokeni uliyoinakili hapo juu ndani yake. Hii unahitaji kufanya mara moja tu kwa kila mazingira.", "local": { @@ -697,16 +684,6 @@ "step-5": "Kivinjari Rahisi kitafunguka baada ya kumaliza. Ikiwa ni ukurasa mweupe tupu, tumia kitufe cha onyesha upya kuiboresha na kuona ukurasa wa nyumbani wa kozi.", "step-6": "Bofya kwenye mojawapo ya miradi inayopatikana kuianza, kisha fuata maelekezo ya mradi kumaliza.", "continue-project": "Kubofya kitufe cha kuanza kilicho hapa chini kutaanzisha mashine mpya. Ikiwa tayari umeanza kozi ya {{title}}, nenda kwenye <0>ukurasa wa hifadhidata kufungua tena eneo la kazi la awali." - }, - "ona": { - "intro": "Kozi hii inaendeshwa katika mashine pepe ya Linux kwa kutumia Ona na ugani wa freeCodeCamp - Courses VS Code. Fuata maelekezo haya kuanza kozi:", - "step-1": "<0>Tengeneza akaunti ya Ona ikiwa bado huna", - "step-2": "Bofya kitufe cha kuanza kilicho hapa chini", - "step-3": "Katika dirisha la modal linalojitokeza, bofya kitufe cha tengeneza", - "step-4": "Mara mashine pepe ya Linux itakapomaliza kupakia, fungua orodha ya amri na endesha amri ya <0>freeCodeCamp: Run Course", - "step-5": "Kivinjari Rahisi kitafunguka baada ya kumaliza. Ikiwa ni ukurasa mweupe tupu, tumia kitufe cha onyesha upya kuiboresha na kuona ukurasa wa nyumbani wa kozi.", - "step-6": "Bofya kwenye mojawapo ya miradi inayopatikana kuianza, kisha fuata maelekezo ya mradi kumaliza.", - "continue-project": "Kubofya kitufe cha kuanza kilicho hapa chini kutaanzisha mashine mpya. Ikiwa tayari umeanza kozi ya {{course}}, nenda <0>dashibodi yako ya Ona kuendelea." } }, "local": { diff --git a/client/ukrainian/intro.json b/client/ukrainian/intro.json index c954f24e2de..c4ba6e26b5c 100644 --- a/client/ukrainian/intro.json +++ b/client/ukrainian/intro.json @@ -1352,12 +1352,6 @@ "У цьому практичному занятті з 140 уроків ви завершите створення бази даних студентів, глибше вивчаючи команди SQL." ] }, - "lab-world-cup-database": { - "title": "Створіть базу даних чемпіонату світу", - "intro": [ - "Для цього проєкту ви створите Bash-скрипт, який вводить інформацію про матчі чемпіонату світу в PostgreSQL, а потім виконує запити до бази даних для отримання корисної статистики." - ] - }, "workshop-kitty-ipsum-translator": { "title": "Створіть перекладач Kitty Ipsum", "intro": [ @@ -1371,6 +1365,12 @@ "У цьому практичному занятті з 210 уроків ви створите інтерактивну Bash-програму, яка зберігатиме інформацію про оренду для вашого прокату велосипедів за допомогою PostgreSQL." ] }, + "lab-world-cup-database": { + "title": "Створіть базу даних чемпіонату світу", + "intro": [ + "Для цього проєкту ви створите Bash-скрипт, який вводить інформацію про матчі чемпіонату світу в PostgreSQL, а потім виконує запити до бази даних для отримання корисної статистики." + ] + }, "lab-salon-appointment-scheduler": { "title": "Створіть планувальник записів у салон", "intro": [ @@ -2669,6 +2669,13 @@ "Ви практикуватимете умовні оператори, щоб визначити оцінку студента на основі його балів." ] }, + "lab-story-fragment-restoration": { + "title": "Відновіть зв’язний сюжет із масиву фрагментів історії", + "intro": [ + "У цій лабораторній роботі ви відновите зв’язний сюжет із пошкодженого масиву фрагментів історії.", + "Ви попрактикуєтеся у роботі з циклами, реалізуючи базові алгоритми для масивів з нуля." + ] + }, "lecture-the-var-keyword-and-hoisting": { "title": "Ключове слово var і підняття", "intro": [ @@ -3774,18 +3781,18 @@ "Вивчайте CSS-модель блоку з цим курсом. Зрозумійте, як елементи відтворюються в інтернеті, і навчіться керувати відступами, кордонами та padding, щоб досягти бажаного макета та дизайну." ] }, - "top-introduction-to-flexbox": { - "title": "Вступ до гнучкого контейнера", - "intro": [ - "Відкрийте для себе можливості гнучкого контейнера — моделі макета, що спрощує створення гнучких і адаптивних вебмакетів. Навчіться легко створювати динамічні та адаптивні структури сторінок." - ] - }, "top-learn-block-and-inline": { "title": "Вивчайте різницю між блоковими та рядковими елементами", "intro": [ "Дослідіть відмінності між блоковими та рядковими елементами в HTML і CSS. Цей курс дає розуміння того, як ці типи відображення впливають на макет і поведінку, допомагаючи приймати обґрунтовані дизайнерські рішення." ] }, + "top-introduction-to-flexbox": { + "title": "Вступ до гнучкого контейнера", + "intro": [ + "Відкрийте для себе можливості гнучкого контейнера — моделі макета, що спрощує створення гнучких і адаптивних вебмакетів. Навчіться легко створювати динамічні та адаптивні структури сторінок." + ] + }, "top-learn-variables-and-operators": { "title": "Вивчайте змінні та оператори", "intro": [ @@ -6287,12 +6294,6 @@ "Ви попрактикуєтеся у використанні утилітних класів Tailwind CSS для макетів на основі гнучких контейнерів, кольорів, точок зупинки та іншого." ] }, - "lab-photography-exhibit": { - "title": "Спроєктуйте виставку фотографій", - "intro": [ - "У цій лабораторній роботі ви попрактикуєтеся у роботі з Tailwind CSS, створюючи вебсторінку виставки фотографій." - ] - }, "review-css-libraries-and-frameworks": { "title": "Повторення з CSS-бібліотек і фреймворків", "intro": [ @@ -6306,6 +6307,12 @@ "Перевірте свої знання про CSS-бібліотеки і фреймворки за допомогою цього тесту." ] }, + "lab-photography-exhibit": { + "title": "Спроєктуйте виставку фотографій", + "intro": [ + "У цій лабораторній роботі ви попрактикуєтеся у роботі з Tailwind CSS, створюючи вебсторінку виставки фотографій." + ] + }, "lecture-introduction-to-typescript": { "title": "Вступ до TypeScript", "intro": [ @@ -6372,18 +6379,6 @@ "У цьому практичному занятті ви продовжите практикуватися з TypeScript, створюючи додаток для ворожіння." ] }, - "lab-flashcard-quiz-app": { - "title": "Створіть додаток для тестування з картками", - "intro": [ - "У цій лабораторній роботі ви попрактикуєтеся з TypeScript, створюючи додаток для тестування з картками." - ] - }, - "lab-digital-pet-game": { - "title": "Створіть гру з цифровим улюбленцем", - "intro": [ - "У цій лабораторній роботі ви застосуєте знання TypeScript і React, створюючи гру з цифровим улюбленцем." - ] - }, "workshop-build-a-football-player-card-builder": { "title": "Створіть конструктор карток футболістів", "intro": [ @@ -6401,6 +6396,18 @@ "title": "Тест з TypeScript", "intro": ["Перевірте свої знання TypeScript за допомогою цього тесту."] }, + "lab-flashcard-quiz-app": { + "title": "Створіть додаток для тестування з картками", + "intro": [ + "У цій лабораторній роботі ви попрактикуєтеся з TypeScript, створюючи додаток для тестування з картками." + ] + }, + "lab-digital-pet-game": { + "title": "Створіть гру з цифровим улюбленцем", + "intro": [ + "У цій лабораторній роботі ви застосуєте знання TypeScript і React, створюючи гру з цифровим улюбленцем." + ] + }, "review-front-end-libraries": { "title": "Повторення з бібліотек фронтенду", "intro": [ @@ -7176,12 +7183,12 @@ "node-package-manager": "Менеджер пакетів Node", "lab-prime-number-checker-module": "Створіть модуль перевірки простих чисел", "http-and-the-web-standards-model": "HTTP і модель веб-стандартів", - "rest-api-and-web-services": "REST API та веб-сервіси", - "lab-timestamp-microservice": "Створіть мікросервіс часових позначок", "introduction-to-express": "Вступ до Express", "lab-personal-profile-app": "Створіть застосунок особистого профілю", - "error-handling-in-express": "Обробка помилок у Express", "express-middleware": "Підпрограмне забезпечення Express", + "rest-api-and-web-services": "REST API та веб-сервіси", + "lab-timestamp-microservice": "Створіть мікросервіс часових позначок", + "error-handling-in-express": "Обробка помилок у Express", "websockets": "WebSockets", "lab-chat-app": "Створіть чат-застосунок", "security-and-privacy": "Безпека та конфіденційність", @@ -7192,109 +7199,91 @@ }, "module-intros": { "introduction-to-nodejs": { - "note": "Очікується наприкінці 2026 року", "intro": [ "У цьому модулі ви вивчите основи роботи з Node.js." ] }, "nodejs-core-modules": { - "note": "Очікується наприкінці 2026 року", "intro": [ "У цьому модулі ви дізнаєтеся про загальні основні модулі Node.js, зокрема fs, os, path та інші. Потім ви зможете попрактикуватися у лабораторних роботах і практичних заняттях і перевірити свої знання за допомогою короткого тесту." ] }, "node-package-manager": { - "note": "Очікується наприкінці 2026 року", "intro": [ "У цьому модулі ви ознайомитеся з менеджером пакетів Node, який розробники використовують для керування залежностями та скриптами проєкту. Потім ви попрактикуєтеся у лабораторних роботах і практичних заняттях і перевірите свої знання за допомогою короткого тесту." ] }, "lab-prime-number-checker-module": { - "note": "Очікується наприкінці 2026 року", "intro": [ "Попрактикуйтеся у створенні та експорті модуля npm, створивши перевірку простих чисел." ] }, "http-and-the-web-standards-model": { - "note": "Очікується наприкінці 2026 року", "intro": [ "У цьому модулі ви дізнаєтеся про HTTP (протокол передачі гіпертексту) та інші важливі поняття, зокрема модель запит-відповідь, загальні коди відповідей, DNS, TCP/IP та інше. Потім ви попрактикуєтеся, створивши власний вебсервер на практичному занятті, і перевірите свої знання за допомогою короткого тесту." ] }, - "rest-api-and-web-services": { - "note": "Очікується наприкінці 2026 року", + "introduction-to-express": { "intro": [ - "У цьому модулі ви дізнаєтеся про REST API (передача репрезентативного стану через API) і як працюють мікросервіси. Потім ви складете короткий тест для перевірки знань." + "У цьому модулі ви ознайомитеся з Express.js — фреймворком для створення RESTful API. Потім ви попрактикуєтеся на лабораторних роботах і практичних заняттях і перевірите свої знання за допомогою короткого тесту." ] }, - "lab-timestamp-microservice": { - "note": "Очікується наприкінці 2026 року", + "lab-personal-profile-app": { "intro": [ - "Попрактикуйтеся у створенні RESTful API з логікою розбору дат, створивши мікросервіс часових позначок." + "Попрактикуйтеся у створенні сервера Express і JSON API, створивши застосунок особистого профілю." ] }, - "introduction-to-express": { - "note": "Очікується наприкінці 2026 року", + "express-middleware": { "intro": [ - "У цьому модулі ви ознайомитеся з Express.js — фреймворком для створення RESTful API. Потім ви попрактикуєтеся на лабораторних роботах і практичних заняттях і перевірите свої знання за допомогою короткого тесту." + "У цьому модулі ви дізнаєтеся про підпрограмне забезпечення в Express.js, яке використовується для обробки запитів і відповідей між клієнтом і сервером. Потім ви попрактикуєтеся на практичному занятті та лабораторній роботі і перевірите свої знання за допомогою короткого тесту." ] }, - "lab-personal-profile-app": { - "note": "Очікується наприкінці 2026 року", + "rest-api-and-web-services": { "intro": [ - "Попрактикуйтеся у створенні сервера Express і JSON API, створивши застосунок особистого профілю." + "У цьому модулі ви дізнаєтеся про REST API (передача репрезентативного стану через API) і як працюють мікросервіси. Потім ви складете короткий тест для перевірки знань." ] }, - "error-handling-in-express": { - "note": "Очікується наприкінці 2026 року", + "lab-timestamp-microservice": { "intro": [ - "У цьому модулі ви дізнаєтеся, як працює обробка помилок, налагодження та перевірка стану здоров’я у Express.js. Потім ви попрактикуєтеся у лабораторній роботі і перевірите свої знання за допомогою короткого тесту." + "Попрактикуйтеся у створенні RESTful API з логікою розбору дат, створивши мікросервіс часових позначок." ] }, - "express-middleware": { - "note": "Очікується наприкінці 2026 року", + "error-handling-in-express": { "intro": [ - "У цьому модулі ви дізнаєтеся про підпрограмне забезпечення в Express.js, яке використовується для обробки запитів і відповідей між клієнтом і сервером. Потім ви попрактикуєтеся на практичному занятті та лабораторній роботі і перевірите свої знання за допомогою короткого тесту." + "У цьому модулі ви дізнаєтеся, як працює обробка помилок, налагодження та перевірка стану здоров’я у Express.js. Потім ви попрактикуєтеся у лабораторній роботі і перевірите свої знання за допомогою короткого тесту." ] }, "websockets": { - "note": "Очікується наприкінці 2026 року", "intro": [ "У цьому модулі ви ознайомитеся з протоколом WebSockets, який використовується для обміну даними в реальному часі між клієнтом і сервером. Потім ви попрактикуєтеся у лабораторних роботах і практичних заняттях і перевірите свої знання за допомогою короткого тесту." ] }, "lab-chat-app": { - "note": "Очікується наприкінці 2026 року", "intro": [ "Попрактикуйтеся у створенні чат-сервера в реальному часі для кількох клієнтів за допомогою WebSockets у Node.js." ] }, "security-and-privacy": { - "note": "Очікується наприкінці 2026 року", "intro": [ "У цьому модулі ви дізнаєтеся про відмінності між безпекою та конфіденційністю, а також про інші поняття, зокрема CSP, Permissions-Policies, PII, роботу з CORS та інше. Потім ви складете короткий тест для перевірки знань." ] }, "authentication": { - "note": "Очікується наприкінці 2026 року", "intro": [ "У цьому модулі ви дізнаєтеся, як працює автентифікація у вебзастосунках, а також про важливі поняття, зокрема JWT, CSRF, Passport, Helmet, криптографію та шифрування. Потім ви попрактикуєтеся у лабораторних роботах і практичних заняттях і перевірите свої знання за допомогою короткого тесту." ] }, "lab-family-movie-watchlist-api": { - "note": "Очікується наприкінці 2026 року", "intro": [ "Попрактикуйтеся у реалізації автентифікації та авторизації в застосунку Express, створивши API для сімейного списку фільмів." ] }, "back-end-development-and-apis-certification-exam": { - "note": "Очікується наприкінці 2026 року", "intro": [ "Складіть цей екзамен, щоб отримати сертифікацію з розробки бекенду та API." ] }, "review-back-end-development-and-apis": { - "note": "Очікується наприкінці 2026 року", "intro": [ "Повторіть концепції розробки бекенда та API, щоб підготуватися до майбутнього екзамену." ] @@ -7302,7 +7291,7 @@ }, "blocks": { "lecture-working-with-nodejs-and-event-driven-architecture": { - "title": "Робота з NodeJS та подієво-орієнтованою архітектурою", + "title": "Робота з Node.js та архітектурою, орієнтованою на події", "intro": [ "Дізнайтеся про основні бібліотеки Node.js, як встановити Node.js на свій комп’ютер, а також про переваги та недоліки використання Node.js на бекенді." ] @@ -7416,24 +7405,6 @@ "" ] }, - "lecture-understanding-rest-api-and-web-services": { - "title": "Розуміння REST API та веб-сервісів", - "intro": [ - "У цих уроках ви дізнаєтеся про REST API та веб-сервіси, а також про те, як вони дозволяють різним застосункам спілкуватися між собою через інтернет." - ] - }, - "workshop-build-a-weather-service-api": { - "title": "Створіть API сервісу погоди", - "intro": [ - "Ви навчитеся параметрам маршруту та модульному маршрутизуванню з express.Router, створюючи API сервісу погоди." - ] - }, - "lab-timestamp-microservice": { - "title": "Створіть мікросервіс часових позначок", - "intro": [ - "Практикуйте створення RESTful API з логікою розбору дат, створюючи мікросервіс часових позначок." - ] - }, "lecture-working-with-express": { "title": "Робота з Express", "intro": [ @@ -7453,16 +7424,10 @@ "Ви вивчите базове маршрутизування Express і методи відповіді, створюючи застосунок випадкових жартів." ] }, - "lab-personal-profile-app": { - "title": "Створіть застосунок особистого профілю", - "intro": [ - "Практикуйте створення сервера Express і JSON API, створюючи застосунок особистого профілю." - ] - }, "review-introduction-to-express": { "title": "Повторення введення в Express", "intro": [ - "Повторіть веб-сервіси, REST, мікросервіси та маршрутизацію Express.js перед проходженням тесту." + "Повторіть Express.js, маршрутизацію, методи відповіді та обслуговування статичних файлів перед проходженням тесту." ] }, "quiz-introduction-to-express": { @@ -7471,28 +7436,10 @@ "Перевірте свої знання про веб-сервіси, REST, мікросервіси, Express.js і маршрутизацію." ] }, - "lecture-understanding-error-handling-and-health-checks": { - "title": "Розуміння обробки помилок і перевірок стану", - "intro": [ - "У цих уроках ви дізнаєтеся про обробку помилок і перевірки стану в Express." - ] - }, - "workshop-build-a-bank-api": { - "title": "Створіть API банку", - "intro": [ - "Ви навчитеся обробці помилок Express 5, перевіркам стану та коректному завершенню роботи, створюючи API банку." - ] - }, - "review-error-handling-in-express": { - "title": "Повторення обробки помилок в Express", - "intro": [ - "Повторіть HTTP статус-коди, обробку помилок, налагодження, логування, перевірки стану та плавне завершення роботи перед проходженням тесту." - ] - }, - "quiz-error-handling-in-express": { - "title": "Тест з обробки помилок в Express", + "lab-personal-profile-app": { + "title": "Створіть застосунок особистого профілю", "intro": [ - "Перевірте свої знання про HTTP статус-коди, обробку помилок, налагодження, логування, перевірки стану та плавне завершення роботи." + "Практикуйте створення сервера Express і JSON API, створюючи застосунок особистого профілю." ] }, "lecture-express-middleware": { @@ -7525,6 +7472,54 @@ "Перевірте свої знання про підпрограмне забезпечення Express, включно з підпрограмним забезпеченням на рівні застосунку, маршрутизатора, обробки помилок, а також вбудованим і стороннім підпрограмним забезпеченням." ] }, + "lecture-understanding-rest-api-and-web-services": { + "title": "Розуміння REST API та веб-сервісів", + "intro": [ + "У цих уроках ви дізнаєтеся про REST API та веб-сервіси, а також про те, як вони дозволяють різним застосункам спілкуватися між собою через інтернет." + ] + }, + "workshop-build-a-weather-service-api": { + "title": "Створіть API сервісу погоди", + "intro": [ + "Ви навчитеся параметрам маршруту та модульному маршрутизуванню з express.Router, створюючи API сервісу погоди." + ] + }, + "review-rest-api-and-web-services": { + "title": "Повторення REST API та веб-сервісів", + "intro": [ + "Повторіть веб-сервіси, архітектуру REST, коди стану HTTP і мікросервіси." + ] + }, + "lab-timestamp-microservice": { + "title": "Створіть мікросервіс часових позначок", + "intro": [ + "Практикуйте створення RESTful API з логікою розбору дат, створюючи мікросервіс часових позначок." + ] + }, + "lecture-understanding-error-handling-and-health-checks": { + "title": "Розуміння обробки помилок і перевірок стану", + "intro": [ + "У цих уроках ви дізнаєтеся про обробку помилок і перевірки стану в Express." + ] + }, + "workshop-build-a-bank-api": { + "title": "Створіть API банку", + "intro": [ + "Ви навчитеся обробці помилок Express 5, перевіркам стану та коректному завершенню роботи, створюючи API банку." + ] + }, + "review-error-handling-in-express": { + "title": "Повторення обробки помилок в Express", + "intro": [ + "Повторіть HTTP статус-коди, обробку помилок, налагодження, логування, перевірки стану та плавне завершення роботи перед проходженням тесту." + ] + }, + "quiz-error-handling-in-express": { + "title": "Тест з обробки помилок в Express", + "intro": [ + "Перевірте свої знання про HTTP статус-коди, обробку помилок, налагодження, логування, перевірки стану та плавне завершення роботи." + ] + }, "lecture-understanding-websockets": { "title": "Розуміння WebSockets", "intro": [ @@ -8427,7 +8422,7 @@ "title": "Проєктування меню кафе", "intro": [ "CSS вказує браузеру, як відображати вашу вебсторінку. Ви можете використовувати CSS, щоб встановити колір, шрифт, розмір і інші властивості HTML-елементів.", - "У цьому практичному занятті ви вивчите CSS, створюючи сторінку меню для вебсайту кафе." + "На цьому практичному занятті ви вивчите CSS, створюючи сторінку меню для кафе." ] }, "lab-business-card": { @@ -9695,7 +9690,7 @@ "title": "Створіть меню кафе", "intro": [ "CSS вказує браузеру, як відображати вашу вебсторінку. Ви можете використовувати CSS, щоб задати колір, шрифт, розмір та інші властивості HTML-елементів.", - "У цьому практичному занятті ви вивчите CSS, створюючи сторінку меню для вебсайту кафе." + "На цьому практичному занятті ви вивчите CSS, створюючи сторінку меню для кафе." ] }, "lab-business-card": { diff --git a/client/ukrainian/translations.json b/client/ukrainian/translations.json index be4ed0d26c4..31de6c9e581 100644 --- a/client/ukrainian/translations.json +++ b/client/ukrainian/translations.json @@ -558,6 +558,12 @@ "running-tests": "// запуск тестів", "tests-completed": "// тести завершено", "console-output": "// вихідні дані консолі", + "unavailable-local-resource": "Не вдалося завантажити ресурс: \"{{source}}\" не є доступним локальним {{resourceType}} файлом. Використовуйте: {{allowedSources}}.", + "unavailable-local-resource-no-allowed": "Не вдалося завантажити ресурс: \"{{source}}\" не є доступним локальним {{resourceType}} файлом у цьому завданні.", + "local-resource-type": { + "stylesheet": "таблиця стилів", + "script": "скрипт" + }, "example-app": "Створіть застосунок, який функціонально схожий на <0>цей приклад проєкту. Намагайтеся не копіювати приклад, додайте свій особистий стиль.", "syntax-error": "Ваш код викликав помилку до запуску тестів. Будь ласка, виправте її і спробуйте знову.", "indentation-error": "У вашому коді помилка відступу. Можливо, потрібно додати pass на новому рядку, щоб сформувати дійсний блок коду.", @@ -656,25 +662,6 @@ "sub-step-7": "Натисніть кнопку <0>Додати секрет", "summary": "Налаштування Codespaces" }, - "ona": { - "intro": "Цей курс запускається у віртуальній машині Linux за допомогою Ona. Дотримуйтесь цих інструкцій, щоб почати курс:", - "step-1": "<0>Створіть обліковий запис Ona, якщо у вас його немає", - "step-2": "Натисніть кнопку початку нижче", - "step-3": "У спливаючому вікні натисніть кнопку створення", - "step-4": "Після завантаження віртуальної машини Linux запустіть розширення CodeRoad, виконавши:", - "step-5": "Натисніть на меню «гамбургер» у верхньому лівому куті вікна VSCode,", - "step-6": "Перейдіть у меню <0>Вигляд,", - "step-7": "Натисніть на опцію <0>Палітра команд,", - "step-8": "і виконайте команду <0>CodeRoad: Start", - "step-9": "Дотримуйтесь інструкцій у CodeRoad, щоб завершити курс", - "continue-project": "Натиснення кнопки початку нижче запустить новий проєкт. Якщо ви раніше починали курс {{course}}, перейдіть на <0>вашу панель керування Ona, щоб продовжити.", - "learn-more": "Дізнайтеся більше про <0>робочі простори Ona.", - "logout-warning": "Якщо ви вийдете з freeCodeCamp, не завершивши весь курс {{course}}, ваш прогрес не буде збережено у вашому обліковому записі freeCodeCamp.", - "sub-step-3": "Перейдіть на вашу <0>сторінку секретів Ona", - "sub-step-4": "Створіть новий секрет із назвою <0>CODEROAD_WEBHOOK_TOKEN", - "sub-step-5": "У полі <0>Секрет вставте свій токен", - "summary": "Налаштування Ona" - }, "freecodecamp-os": { "token-modal": "Коли ви запускаєте курс, з’явиться модальне вікно з проханням ввести ваш користувацький токен. Вставте туди токен, який ви скопіювали вище. Це потрібно зробити лише один раз для кожного середовища.", "local": { @@ -697,16 +684,6 @@ "step-5": "Коли все буде готово, відкриється Simple Browser. Якщо сторінка порожня і біла, натисніть кнопку оновлення, щоб побачити домашню сторінку курсу.", "step-6": "Натисніть на один із доступних проєктів, щоб почати його, а потім дотримуйтесь інструкцій у проєкті, щоб його завершити.", "continue-project": "Натиснення кнопки запуску нижче запустить нову машину. Якщо ви раніше починали курс {{title}}, перейдіть на <0>сторінку репозиторію, щоб знову відкрити попереднє робоче середовище." - }, - "ona": { - "intro": "Цей курс запускається у віртуальній Linux-машині за допомогою Ona і розширення freeCodeCamp - Courses для VS Code. Дотримуйтесь цих інструкцій, щоб почати курс:", - "step-1": "<0>Створіть обліковий запис Ona, якщо у вас його немає", - "step-2": "Натисніть кнопку запуску нижче", - "step-3": "У модальному вікні, що з’явиться, натисніть кнопку створення", - "step-4": "Коли віртуальна Linux-машина завантажиться, відкрийте палітру команд і виконайте команду <0>freeCodeCamp: Run Course", - "step-5": "Коли все буде готово, відкриється Simple Browser. Якщо сторінка порожня і біла, натисніть кнопку оновлення, щоб побачити домашню сторінку курсу.", - "step-6": "Натисніть на один із доступних проєктів, щоб почати його, а потім дотримуйтесь інструкцій у проєкті, щоб його завершити.", - "continue-project": "Натиснення кнопки запуску нижче запустить нову машину. Якщо ви раніше починали курс {{course}}, перейдіть до <0>свого Ona-дашборда, щоб продовжити." } }, "local": { diff --git a/curriculum/challenges/arabic/blocks/back-end-development-and-apis-projects/bd7158d8c443edefaeb5bd0f.md b/curriculum/challenges/arabic/blocks/back-end-development-and-apis-projects/bd7158d8c443edefaeb5bd0f.md index 6130b80d4f0..1fa6aa1de74 100644 --- a/curriculum/challenges/arabic/blocks/back-end-development-and-apis-projects/bd7158d8c443edefaeb5bd0f.md +++ b/curriculum/challenges/arabic/blocks/back-end-development-and-apis-projects/bd7158d8c443edefaeb5bd0f.md @@ -50,15 +50,18 @@ dashedName: file-metadata-microservice عند إرسال ملف، تستلم في استجابة JSON اسم الملف `name`، نوعه `type`، وحجمه `size` بوحدة البايت. ```js - const formData = new FormData(); - const fileData = await fetch( - 'https://cdn.freecodecamp.org/weather-icons/01d.png' - ); - const file = await fileData.blob(); - formData.append('upfile', file, 'icon'); + const boundary = 'fccBoundary1234567890'; + const head = + `--${boundary}\r\n` + + 'Content-Disposition: form-data; name="upfile"; filename="icon"\r\n' + + 'Content-Type: image/png\r\n\r\n'; + const body = new Blob([head, new Uint8Array(70), `\r\n--${boundary}--\r\n`]); const data = await fetch(code + '/api/fileanalyse', { method: 'POST', - body: formData + headers: { + 'Content-Type': `multipart/form-data; boundary=${boundary}` + }, + body }); const parsed = await data.json(); assert.property(parsed, 'size'); diff --git a/curriculum/challenges/arabic/blocks/daily-coding-challenges-javascript/6a26df3e2988bcdded204895.md b/curriculum/challenges/arabic/blocks/daily-coding-challenges-javascript/6a26df3e2988bcdded204895.md index 59bc412ce72..88566c29f44 100644 --- a/curriculum/challenges/arabic/blocks/daily-coding-challenges-javascript/6a26df3e2988bcdded204895.md +++ b/curriculum/challenges/arabic/blocks/daily-coding-challenges-javascript/6a26df3e2988bcdded204895.md @@ -1,15 +1,15 @@ --- id: 6a26df3e2988bcdded204895 -title: "تحدٍّ 359: حاسبة معامل الغولف" +title: "تحدٍّ 359: حاسبة مؤشر الهانديكاب في الغولف" challengeType: 28 dashedName: challenge-359 --- # --description-- -معطى مصفوفة من نتائج الغولف ومصفوفة مقابلة لقيم بار الدورة، أرجع معامل الإعاقة للاعب الغولف باستخدام الطريقة التالية: +معطاة مصفوفة من نتائج الغولف ومصفوفة مقابلة لقيم البار لكل ملعب، أرجع مؤشر الهانديكاب للاعب الغولف باستخدام الطريقة التالية: -- احسب الفرق لكل جولة بطرح قيمة البار من النتيجة، ثم أرجع متوسط كل الفروق مقربًا إلى منزلة عشرية واحدة. +- احسب الفرق لكل جولة بطرح قيمة البار من النتيجة، ثم أرجع متوسط كل الفروق بعد تقريبه إلى منزلة عشرية واحدة. # --hints-- @@ -25,10 +25,10 @@ assert.equal(calculateHandicap([72, 72, 72], [72, 72, 72]), 0); assert.equal(calculateHandicap([80, 76, 78, 78], [72, 72, 72, 72]), 6); ``` -`calculateHandicap([42, 45, 46, 44], [36, 36, 36, 36])` يجب أن تُرجع `8.3`. +يجب أن تُعيد الدالة `calculateHandicap([42, 45, 46, 45], [36, 36, 36, 36])` القيمة `8.5`. ```js -assert.equal(calculateHandicap([42, 45, 46, 44], [36, 36, 36, 36]), 8.3); +assert.equal(calculateHandicap([42, 45, 46, 45], [36, 36, 36, 36]), 8.5); ``` `calculateHandicap([85, 80, 76, 79, 82], [72, 72, 72, 71, 71])` يجب أن تُرجع `8.8`. diff --git a/curriculum/challenges/arabic/blocks/daily-coding-challenges-python/6a26df3e2988bcdded204895.md b/curriculum/challenges/arabic/blocks/daily-coding-challenges-python/6a26df3e2988bcdded204895.md index 85667b196b2..28949d86351 100644 --- a/curriculum/challenges/arabic/blocks/daily-coding-challenges-python/6a26df3e2988bcdded204895.md +++ b/curriculum/challenges/arabic/blocks/daily-coding-challenges-python/6a26df3e2988bcdded204895.md @@ -31,12 +31,12 @@ TestCase().assertEqual(calculate_handicap([80, 76, 78, 78], [72, 72, 72, 72]), 6 }}) ``` -`calculate_handicap([42, 45, 46, 44], [36, 36, 36, 36])` يجب أن تُرجع `8.3`. +يجب أن تُعيد الدالة `calculate_handicap([42, 45, 46, 45], [36, 36, 36, 36])` القيمة `8.5`. ```js ({test: () => { runPython(` from unittest import TestCase -TestCase().assertEqual(calculate_handicap([42, 45, 46, 44], [36, 36, 36, 36]), 8.3)`) +TestCase().assertEqual(calculate_handicap([42, 45, 46, 45], [36, 36, 36, 36]), 8.5)`) }}) ``` diff --git a/curriculum/challenges/arabic/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb928.md b/curriculum/challenges/arabic/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb928.md index 2425618a772..6a7df7f4e91 100644 --- a/curriculum/challenges/arabic/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb928.md +++ b/curriculum/challenges/arabic/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb928.md @@ -8,9 +8,9 @@ dashedName: mean-variance-standard-deviation-calculator # --description-- -ستعمل على هذا المشروع باستخدام شفرة البداية من Ona. +ستعمل على هذا المشروع باستخدام شفرة البداية الخاصة بنا. -ما زلنا نطوّر الجزء التفاعلي التعليمي من منهج Python. حتى ذلك الحين، إليك بعض الفيديوهات على قناة freeCodeCamp.org على يوتيوب التي ستعلمك كل ما تحتاجه لإكمال هذا المشروع: +نحن لا نزال نطور الجزء التفاعلي التعليمي من منهج Python. حتى ذلك الحين، إليك بعض الفيديوهات على قناة freeCodeCamp.org على يوتيوب التي ستعلمك كل ما تحتاجه لإكمال هذا المشروع: - دورة فيديو Python للجميع (14 ساعة) @@ -53,7 +53,7 @@ dashedName: mean-variance-standard-deviation-calculator ## التطوير اكتب شفرتك في `mean_var_std.py`. للتطوير، يمكنك استخدام `main.py` لاختبار شفرتك. -لتشغيل شفرتك، اكتب `python3 main.py` في طرفية Ona واضغط Enter. سيؤدي ذلك إلى تشغيل مفسر CPython المضمّن ملف `main.py`. +لتشغيل شفرتك، اكتب `python3 main.py` في الطرفية واضغط إدخال. سيؤدي ذلك إلى تشغيل مفسر CPython المضمّن ملف `main.py`. ## الاختبار diff --git a/curriculum/challenges/arabic/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb929.md b/curriculum/challenges/arabic/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb929.md index a39cf06a17c..34eceb67af4 100644 --- a/curriculum/challenges/arabic/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb929.md +++ b/curriculum/challenges/arabic/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb929.md @@ -8,9 +8,9 @@ dashedName: demographic-data-analyzer # --description-- -ستعمل على هذا المشروع باستخدام قالب جاهز Ona الخاص بنا. +ستعمل على هذا المشروع باستخدام شفرة البداية الخاصة بنا. -ما زلنا نطور الجزء التفاعلي التعليمي من منهج Python. حتى ذلك الحين، إليك بعض الفيديوهات على قناة freeCodeCamp.org على YouTube التي ستعلمك كل ما تحتاجه لإكمال هذا المشروع: +نحن لا نزال نطور الجزء التفاعلي التعليمي من منهج Python. حتى ذلك الحين، إليك بعض الفيديوهات على قناة freeCodeCamp.org على يوتيوب التي ستعلمك كل ما تحتاجه لإكمال هذا المشروع: - دورة فيديو Python للجميع (14 ساعة) @@ -44,11 +44,11 @@ dashedName: demographic-data-analyzer استخدم قالب الشفرة في الملف `demographic_data_analyzer.py`. حدّث الشفرة بحيث تُعيّن جميع المتغيرات التي قيمتها `None` إلى الحساب أو الشفرة المناسبة. قرب جميع الأعداد العشرية إلى أقرب عُشر. -## تطوير +## التطوير اكتب شفرتك في `demographic_data_analyzer.py`. للتطوير، يمكنك استخدام `main.py` لاختبار شفرتك. -## اختبار +## الاختبار اختبارات الوحدة لهذا المشروع موجودة في `test_module.py`. استوردنا الاختبارات من `test_module.py` إلى `main.py` لملاءمتك. diff --git a/curriculum/challenges/arabic/blocks/data-analysis-with-python-projects/5e46f7f8ac417301a38fb92a.md b/curriculum/challenges/arabic/blocks/data-analysis-with-python-projects/5e46f7f8ac417301a38fb92a.md index 44f7a13a77a..a8f142cc8c5 100644 --- a/curriculum/challenges/arabic/blocks/data-analysis-with-python-projects/5e46f7f8ac417301a38fb92a.md +++ b/curriculum/challenges/arabic/blocks/data-analysis-with-python-projects/5e46f7f8ac417301a38fb92a.md @@ -8,9 +8,9 @@ dashedName: medical-data-visualizer # --description-- -ستعمل على هذا المشروع باستخدام قالب البداية Ona الخاص بنا. +ستعمل على هذا المشروع باستخدام قالبنا الجاهز للبدء. -ما زلنا نطوّر الجزء التفاعلي التعليمي من منهج Python. حتى ذلك الحين، إليك بعض الفيديوهات على قناة freeCodeCamp.org على يوتيوب التي ستعلمك كل ما تحتاجه لإكمال هذا المشروع: +نحن لا نزال نطور الجزء التفاعلي التعليمي من منهج Python. حتى ذلك الحين، إليك بعض الفيديوهات على قناة freeCodeCamp.org على يوتيوب التي ستعلمك كل ما تحتاجه لإكمال هذا المشروع: - دورة فيديو Python للجميع (14 ساعة) diff --git a/curriculum/challenges/arabic/blocks/data-analysis-with-python-projects/5e46f802ac417301a38fb92b.md b/curriculum/challenges/arabic/blocks/data-analysis-with-python-projects/5e46f802ac417301a38fb92b.md index d1827ed031a..876f5ef4be0 100644 --- a/curriculum/challenges/arabic/blocks/data-analysis-with-python-projects/5e46f802ac417301a38fb92b.md +++ b/curriculum/challenges/arabic/blocks/data-analysis-with-python-projects/5e46f802ac417301a38fb92b.md @@ -8,9 +8,9 @@ dashedName: page-view-time-series-visualizer # --description-- -ستعمل على هذا المشروع باستخدام قالب البداية Ona الخاص بنا. +ستعمل على هذا المشروع باستخدام شفرة البداية الخاصة بنا. -ما زلنا نطور الجزء التفاعلي التعليمي من منهج Python. حتى الآن، إليك بعض الفيديوهات على قناة freeCodeCamp.org على يوتيوب التي ستعلمك كل ما تحتاجه لإكمال هذا المشروع: +نحن لا نزال نطور الجزء التفاعلي التعليمي من منهج Python. حتى ذلك الحين، إليك بعض الفيديوهات على قناة freeCodeCamp.org على يوتيوب التي ستعلمك كل ما تحتاجه لإكمال هذا المشروع: - دورة فيديو Python للجميع (14 ساعة) @@ -30,13 +30,13 @@ dashedName: page-view-time-series-visualizer لكل مخطط، تأكد من استخدام نسخة من إطار البيانات. -يتضمن القالب الجاهز أيضًا أوامر لحفظ الصورة وإرجاعها. +يتضمن قالب البداية أيضًا أوامر لحفظ الصورة وإرجاعها. -## تطوير +## التطوير اكتب شفرتك في `time_series_visualizer.py`. للاختبار أثناء التطوير، يمكنك استخدام `main.py`. -## اختبار +## الاختبار اختبارات الوحدة لهذا المشروع موجودة في `test_module.py`. استوردنا الاختبارات من `test_module.py` إلى `main.py` لملاءمتك. diff --git a/curriculum/challenges/arabic/blocks/data-analysis-with-python-projects/5e4f5c4b570f7e3a4949899f.md b/curriculum/challenges/arabic/blocks/data-analysis-with-python-projects/5e4f5c4b570f7e3a4949899f.md index 3a671958938..ec88a0b0a1e 100644 --- a/curriculum/challenges/arabic/blocks/data-analysis-with-python-projects/5e4f5c4b570f7e3a4949899f.md +++ b/curriculum/challenges/arabic/blocks/data-analysis-with-python-projects/5e4f5c4b570f7e3a4949899f.md @@ -8,9 +8,9 @@ dashedName: sea-level-predictor # --description-- -ستعمل على هذا المشروع باستخدام شفرة البداية من Ona. +ستعمل على هذا المشروع باستخدام شفرة البداية الخاصة بنا. -ما زلنا نطوّر الجزء التفاعلي التعليمي من منهج Python. حتى ذلك الحين، إليك بعض الفيديوهات على قناة freeCodeCamp.org على يوتيوب التي ستعلمك كل ما تحتاجه لإكمال هذا المشروع: +نحن لا نزال نطور الجزء التفاعلي التعليمي من منهج Python. حتى ذلك الحين، إليك بعض الفيديوهات على قناة freeCodeCamp.org على يوتيوب التي ستعلمك كل ما تحتاجه لإكمال هذا المشروع: - دورة فيديو Python للجميع (14 ساعة) @@ -30,11 +30,11 @@ dashedName: sea-level-predictor يتضمن قالب البداية أيضًا أوامر لحفظ الصورة وإرجاعها. -## تطوير +## التطوير اكتب شفرتك في `sea_level_predictor.py`. للاختبار أثناء التطوير، يمكنك استخدام `main.py`. -## اختبار +## الاختبار اختبارات الوحدة لهذا المشروع موجودة في `test_module.py`. استوردنا الاختبارات من `test_module.py` إلى `main.py` لملاءمتك. diff --git a/curriculum/challenges/arabic/blocks/information-security-projects/5e46f979ac417301a38fb932.md b/curriculum/challenges/arabic/blocks/information-security-projects/5e46f979ac417301a38fb932.md index 9dfeb9a5828..f9df3ebaa5c 100644 --- a/curriculum/challenges/arabic/blocks/information-security-projects/5e46f979ac417301a38fb932.md +++ b/curriculum/challenges/arabic/blocks/information-security-projects/5e46f979ac417301a38fb932.md @@ -9,9 +9,9 @@ dashedName: port-scanner # --description-- -ستعمل على هذا المشروع باستخدام شفرة البداية الخاصة بنا من Ona. +ستعمل على هذا المشروع باستخدام شفرة البداية الخاصة بنا. -لا نزال نطور الجزء التفاعلي التعليمي من منهج Python. حتى ذلك الحين، إليك بعض الفيديوهات على قناة freeCodeCamp.org على يوتيوب التي ستعلمك كل ما تحتاجه لإكمال هذا المشروع: +نحن لا نزال نطور الجزء التفاعلي التعليمي من منهج Python. حتى ذلك الحين، إليك بعض الفيديوهات على قناة freeCodeCamp.org على يوتيوب التي ستعلمك كل ما تحتاجه لإكمال هذا المشروع: - دورة فيديو Python للجميع (14 ساعة) diff --git a/curriculum/challenges/arabic/blocks/information-security-projects/5e46f983ac417301a38fb933.md b/curriculum/challenges/arabic/blocks/information-security-projects/5e46f983ac417301a38fb933.md index 7c44e5e1e5c..28640507519 100644 --- a/curriculum/challenges/arabic/blocks/information-security-projects/5e46f983ac417301a38fb933.md +++ b/curriculum/challenges/arabic/blocks/information-security-projects/5e46f983ac417301a38fb933.md @@ -9,7 +9,7 @@ dashedName: sha-1-password-cracker # --description-- -ستعمل على هذا المشروع باستخدام قالب جاهز Ona الخاص بنا. +ستعمل على هذا المشروع باستخدام قالبنا الجاهز للبدء. نحن لا نزال نطور الجزء التفاعلي التعليمي من منهج Python. حتى ذلك الحين، إليك بعض الفيديوهات على قناة freeCodeCamp.org على يوتيوب التي ستعلمك كل ما تحتاجه لإكمال هذا المشروع: @@ -45,17 +45,17 @@ dashedName: sha-1-password-cracker تم استيراد مكتبة `hashlib` لك. يجب أن تفكر في استخدامها في شفرتك. تعرف على المزيد عن "hashlib" هنا. -## تطوير +## التطوير اكتب شفرتك في `password_cracker.py`. للتطوير، يمكنك استخدام `main.py` لاختبار شفرتك. -## اختبار +## الاختبار اختبارات الوحدة لهذا المشروع موجودة في `test_module.py`. استوردنا الاختبارات من `test_module.py` إلى `main.py` لملاءمتك. ## الإرسال -انسخ رابط مشروعك وأرسله إلى freeCodeCamp. +انسخ عنوان URL الخاص بمشروعك وأرسله إلى freeCodeCamp. # --hints-- diff --git a/curriculum/challenges/arabic/blocks/lab-availability-table/66b36358ed4f261d64840c24.md b/curriculum/challenges/arabic/blocks/lab-availability-table/66b36358ed4f261d64840c24.md index 81b93d17015..206d6a542e5 100644 --- a/curriculum/challenges/arabic/blocks/lab-availability-table/66b36358ed4f261d64840c24.md +++ b/curriculum/challenges/arabic/blocks/lab-availability-table/66b36358ed4f261d64840c24.md @@ -12,18 +12,18 @@ demoType: onClick **قصص المستخدم:** -1. يجب أن يحتوي جدولك على ثلاثة أعمدة على الأقل وخمسة صفوف، بما في ذلك الأقسام العلوية. -1. يجب أن تكون الخلايا في الصف الأول أقسامًا علوية للجدول تحتوي على أيام الأسبوع. -1. يجب أن تكون الخلايا في العمود الأول أقسامًا علوية للجدول مع `class` باسم `time` ويجب أن تحتوي على قيم الوقت كنص. -1. يجب أن تحتوي جميع خلايا البيانات على `class` باسم `available-#`، حيث `#` رقم من `0` إلى `5` يحدد عدد الأشخاص المتاحين في ذلك الوقت. -1. يجب أن يحتوي جدولك على عنصر `caption` بالنص `Weekly Meeting Availability Schedule`. -1. يجب أن تحتوي جميع خلايا القسم العلوي في الصف الأول (أيام الأسبوع) على خاصية `scope` بقيمة `col`. -1. يجب أن تحتوي جميع خلايا القسم العلوي في العمود الأول (خلايا الوقت) على خاصية `scope` بقيمة `row`. -1. يجب أن تحتوي جميع خلايا البيانات التي تحمل صنف التوفر على خاصية `aria-label` تصف مستوى التوفر (مثلًا، `0 available` لخلايا `available-0`، و`1 available` لخلايا `available-1`، وهكذا، و`5+ available` لخلايا `available-5`). -1. في محدد `:root`، يجب تعريف ستة متغيرات CSS باسم `--color#`، حيث `#` رقم من `0` إلى `5`، وتعيين قيمة لون لكل منها. استخدم هذه المتغيرات لتعيين لون الخلفية لعناصر `.available-#` المقابلة. -1. في محدد `:root`، يجب تعريف متغيرات CSS باسم `--solid-border` و`--dashed-border`. استخدم هذه المتغيرات لتنسيق حدود الأسفل لخلايا البيانات، بالتناوب بين حدود صلبة وحدود متقطعة حسب الصف. امنح الصفوف صنفًا إما `sharp` أو `half` لتنسيقها. -1. يجب أن يحتوي المستند على عنصر `div` بالمعرف `id` باسم `legend`. يجب أن يحتوي على عنصر `span` بالنص `Availability` وعنصر `div` بالمعرف `id` باسم `legend-gradient`. -1. يجب أن تعطي عنصر `#legend-gradient` تدرجًا خطيًا ينتقل بين جميع الألوان من `--color0` إلى `--color5` بخطوط حادة. +1. يجب أن يحتوي جدولك على ثلاثة أعمدة وخمسة صفوف على الأقل، بما في ذلك صفوف الرؤوس. +1. يجب أن يحتوي الصف الأول على خلايا رؤوس جدول تتضمن أيام الأسبوع. +1. يجب أن يحتوي العمود الأول على خلايا رؤوس جدول تحمل `class` باسم `time` وتتضمن قيم الوقت كنص لها. +1. يجب أن تحمل جميع خلايا البيانات `class` باسم `available-#`، حيث `#` رقم من `0` إلى `5` يحدد عدد الأشخاص المتاحين في ذلك الوقت. +1. يجب أن يحتوي جدولك على عنصر `caption` يحمل النص `Weekly Meeting Availability Schedule`. +1. يجب أن تحمل جميع خلايا رؤوس الجدول في الصف الأول (أيام الأسبوع) خاصية `scope` بالقيمة `col`. +1. يجب أن تحمل جميع خلايا رؤوس الجدول في العمود الأول (خلايا الوقت) خاصية `scope` بالقيمة `row`. +1. يجب أن تحمل جميع خلايا البيانات التي تحمل صنف التوفر خاصية `aria-label` تصف مستوى التوفر (مثلًا `0 available` لخلايا `available-0`، و `1 available` لخلايا `available-1`، وهكذا، و `5+ available` لخلايا `available-5`). +1. في محدد `:root`، يجب تعريف ستة متغيرات CSS بأسماء `--color#`، حيث `#` رقم من `0` إلى `5`، مع إسناد قيمة لون لكل منها. استخدم هذه المتغيرات لتعيين لون خلفية عناصر `.available-#` المقابلة. +1. في محدد `:root`، يجب تعريف متغيري CSS بالاسمين `--solid-border` و `--dashed-border`. استخدم هذين المتغيرين لتنسيق الحدود السفلية لخلايا البيانات، بالتناوب بين الحدود الصلبة والمتقطعة حسب الصف. امنح الصفوف إما الصنف `sharp` أو `half` لتنسيقها. +1. يجب أن يكون لديك عنصر `div` يحمل `id` بقيمة `legend`. ويجب أن يحتوي على عنصر `span` يحمل النص `Availability` وعنصر `div` يحمل `id` بقيمة `legend-gradient`. +1. يجب أن تمنح عنصر `#legend-gradient` تدرجًا لونيًا خطيًا ينتقل بين جميع الألوان من `--color0` إلى `--color5` بخطوط حادة. **ملاحظة:** تأكد من ربط ورقة الأنماط الخاصة بك في ملف HTML لتطبيق CSS. @@ -389,7 +389,7 @@ headers.forEach(header => { يجب أن تحتوي جميع خلايا القسم العلوي في العمود الأول على خاصية `scope` بقيمة `row`. ```js -const timeHeaders = [...document.querySelectorAll('tr > th:first-child')]; +const timeHeaders = [...document.querySelectorAll('th.time')]; assert.isNotEmpty(timeHeaders); timeHeaders.forEach(header => { assert.equal(header.getAttribute('scope'), 'row'); diff --git a/curriculum/challenges/arabic/blocks/lab-cargo-manifest-validator/69a56b5069ca99f7317e6e19.md b/curriculum/challenges/arabic/blocks/lab-cargo-manifest-validator/69a56b5069ca99f7317e6e19.md index bff8b4c306c..dd36ea4cbf9 100644 --- a/curriculum/challenges/arabic/blocks/lab-cargo-manifest-validator/69a56b5069ca99f7317e6e19.md +++ b/curriculum/challenges/arabic/blocks/lab-cargo-manifest-validator/69a56b5069ca99f7317e6e19.md @@ -12,9 +12,9 @@ dashedName: lab-cargo-manifest-validator سيُمثَّل كل بيان شحن ككائن يحتوي على الخصائص التالية: - `containerId`: عدد صحيح موجب يحدد حاوية الشحن المرتبطة. -- `destination`: سلسلة نصية غير فارغة (بعد إزالة الفراغات) تشير إلى وجهة الشحن المستهدفة. +- `destination`: سلسلة نصية غير فارغة (بعد إزالة الفراغات) تحدد وجهة الشحن. - `weight`: عدد موجب يمثل وزن الشحنة. -- `unit`: سلسلة نصية تصف وحدات خاصية الوزن (إما `"kg"` للكيلوغرامات أو `"lb"` للرطل). +- `unit`: سلسلة نصية تصف وحدة خاصية `weight` للشحنة (إما `"kg"` للكيلوجرام أو `"lb"` للرطل). - `hazmat`: قيمة منطقية تشير إلى ما إذا كانت هناك حاجة للتعامل مع مواد خطرة. مثال على كائن بيان شحن: @@ -34,13 +34,13 @@ dashedName: lab-cargo-manifest-validator **قصص المستخدم:** 1. يجب تنفيذ دالة باسم `normalizeUnits` بمعلمة `manifest`. - - يجب ألا تُغيّر الدالة كائن الـ manifest الأصلي ويجب أن تُعيد دائمًا كائنًا جديدًا حيث يُطبع `weight` إلى الكيلوغرامات وتُضبط الخاصية `unit` على القيمة `"kg"`. - - إذا كان وزن كائن الـ manifest معبرًا عنه بالرطل (`unit: "lb"`)، يجب على الدالة تحويل `weight` إلى الكيلوغرامات باستخدام التحويل التقريبي 1 رطل = 0.45 كجم، وتحديث الخاصية `unit` وفقًا لذلك. - - إذا كان الوزن معبرًا عنه بالفعل بالكيلوغرامات (`unit: "kg"`)، يجب أن تبقى الخاصيتان `weight` و `unit` دون تغيير. + - يجب ألا تُعدل الدالة كائن manifest الأصلي، ويجب أن تُعيد دائمًا كائنًا جديدًا حيث يتم تطبيع `weight` إلى الكيلوغرامات وتعيين `unit` إلى `"kg"`. + - إذا كان `weight` في كائن manifest معبرًا عنه بالرطل (`unit: "lb"`)، يجب على الدالة تحويل `weight` إلى الكيلوغرامات باستخدام التحويل التقريبي `1 lb = 0.45 kg`، وتحديث `unit` وفقًا لذلك. + - إذا كان `weight` معبرًا عنه بالفعل بالكيلوغرام (`unit: "kg"`)، يجب أن يبقى كل من `weight` و`unit` دون تغيير. 2. يجب تنفيذ دالة باسم `validateManifest` بمعلمة `manifest`. - - يجب ألا تُغيّر الدالة كائن الـ manifest الأصلي ويجب أن تُعيد دائمًا كائنًا جديدًا. - - إذا كان الـ manifest المُدخل صالحًا (لا توجد خصائص مفقودة أو غير صالحة)، يجب أن تُعيد الدالة كائنًا فارغًا. - - إذا لم يكن الـ manifest المُدخل صالحًا، يجب أن تُعيد الدالة كائنًا يحتوي على مدخلات لكل خاصية مفقودة أو غير صالحة. يجب أن تكون قيمة الخصائص المفقودة هي `"Missing"` وقيمة الخصائص غير الصالحة هي `"Invalid"`. + - يجب ألا تُعدل الدالة كائن manifest الأصلي، ويجب أن تُعيد دائمًا كائنًا جديدًا. + - إذا كان manifest المُدخل صحيحًا (لا توجد خصائص مفقودة أو غير صالحة)، يجب أن تُعيد الدالة كائنًا فارغًا. + - إذا لم يكن manifest المُدخل صحيحًا، يجب أن تُعيد الدالة كائنًا يحتوي على مدخلات لكل خاصية مفقودة أو غير صالحة. يجب أن تكون قيمة الخصائص المفقودة `"Missing"` وقيمة الخصائص غير الصالحة `"Invalid"`. مثال لقيمة الإرجاع عندما يكون كائن الإدخال مفقودًا خاصية `destination` ولديه خاصية `weight` غير صالحة: @@ -51,12 +51,13 @@ dashedName: lab-cargo-manifest-validator } ``` -3. يجب أن تنفذ دالة باسم `processManifest` بمعلمة `manifest`. يجب أن تسجل: - - إذا كان كائن البيان صالحًا، `Validation success: ${containerId}` ثم وزن البيان بالكيلوغرامات على النحو التالي، `Total weight: ${weight} kg`. استخدم `normalizeUnits()` لهذا التحويل. - - إذا لم يكن كائن البيان صالحًا، `Validation error: ${containerId}` ثم الكائن الذي تُرجعه الدالة `validateManifest()` عند استدعائها مع كائن البيان. - **ملاحظة:** يجب أن يكون لكل من هذين الحالتين استدعاءان لـ `console.log()`. +3. يجب تنفيذ دالة باسم `processManifest` بمعلمة `manifest`. يجب أن تسجل الدالة: + - إذا كان كائن manifest صحيحًا، فسجّل `Validation success: ${containerId}` ثم قيمة `weight` للـ manifest بالكيلوغرامات، بالصيغة `Total weight: ${weight} kg`. استخدم `normalizeUnits()` لهذا التحويل. + - إذا لم يكن كائن manifest صحيحًا، فسجّل `Validation error: ${containerId}` ثم الكائن الذي تُعيده `validateManifest()` عند استدعائها بكائن manifest. -**ملاحظة:** لا يجب إعلان `normalizeUnits` أو `validateManifest` أو `processManifest` باستخدام `const`، لأن الاختبارات تحتاج إلى إعادة تعيينها. +**ملاحظة:** يجب أن يحتوي كل من هذين الحالتين على استدعائين لـ `console.log()`. + +**ملاحظة:** لا تعلن عن `normalizeUnits` أو `validateManifest` أو `processManifest` باستخدام `const`، لأن الاختبارات تحتاج إلى إعادة تعيينها. # --before-each-- @@ -120,7 +121,7 @@ console.log = () => {}; # --hints-- -لا يجب إعلان `normalizeUnits` أو `validateManifest` أو `processManifest` باستخدام `const`، لأن الاختبارات تحتاج إلى إعادة تعيينها. +يجب ألا تعلن عن `normalizeUnits` أو `validateManifest` أو `processManifest` باستخدام `const`، لأن الاختبارات تحتاج إلى إعادة تعيينها. ```js assert.doesNotThrow(() => { @@ -140,12 +141,12 @@ assert.equal(params.length, 1); assert.equal(params[0].toString(), 'manifest'); ``` -استدعاء `normalizeUnits()` مع `{ containerId: 68, destination: "Salinas", weight: 101, unit: "lb", hazmat: true }` يجب أن يُرجع الكائن الجديد `{ containerId: 68, destination: "Salinas", weight: 45.45, unit: "kg", hazmat: true }` دون تغيير الإدخال الأصلي. +يجب أن تُرجع دالة `normalizeUnits` الكائن الجديد `{ containerId: 68, destination: "Salinas", weight: 45.45, unit: "kg", hazmat: true }` عند استدعائها مع `{ containerId: 68, destination: "Salinas", weight: 101, unit: "lb", hazmat: true }`، دون تغيير الكائن الأصلي. ```js const testObj = { containerId: 68, - destination: "Salinas", + destination: "Salinas", weight: 101, unit: "lb", hazmat: true @@ -161,7 +162,7 @@ const expected = { const copy = normalizeUnits(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "normalizeUnits() did not return the expected normalized object"); +assert.deepEqual(copy, expected, "normalizeUnits() did not return the expected normalized object."); assert.notStrictEqual(copy, testObj, "normalizeUnits() should return a new object."); assert.strictEqual(testObj.containerId, 68, "Original object should not be mutated."); assert.strictEqual(testObj.destination, "Salinas", "Original object should not be mutated."); @@ -171,13 +172,13 @@ assert.strictEqual(testObj.hazmat, true, "Original object should not be mutated. assert.equal(Object.keys(testObj).length, 5, "Original object should not be mutated."); ``` -يجب أن تُرجع دالة `normalizeUnits` نسخة من كائن البيان المُدخل مع تطبيع `weight` إلى الكيلوغرامات وضبط `unit` إلى `"kg"`. استخدم التحويل التقريبي `1 lb = 0.45 kg` لتحويل الوزن. +يجب أن تُعيد دالة `normalizeUnits` نسخة من كائن البيان المدخل مع تطبيع `weight` إلى الكيلوغرامات وتعيين `unit` إلى `"kg"`. استخدم التحويل التقريبي `1 lb = 0.45 kg` لتحويل `weight`. ```js _validManifests.forEach((obj, i) => { const result = normalizeUnits(obj); - assert.isObject(result, "normalizeUnits should return an object"); - assert.notStrictEqual(result, obj, "normalizeUnits must return a new object, not modify the original"); + assert.isObject(result, "normalizeUnits() should return an object."); + assert.notStrictEqual(result, obj, "normalizeUnits() should return a new object, not mutate the original."); const expectedWeight = obj.unit === "lb" ? obj.weight * 0.45 : obj.weight; const expected = { ...obj, @@ -188,12 +189,12 @@ _validManifests.forEach((obj, i) => { assert.deepEqual( result, expected, - `normalizeUnits did not return the expected normalized object for manifest at index ${i}` + `normalizeUnits() did not return the expected normalized object for manifest at index ${i}.` ); }); ``` -يجب أن تُرجع دالة `normalizeUnits` نسخة جديدة من كائن `manifest` المُدخل دون تغيير الأصلي. +يجب أن تُرجع دالة `normalizeUnits` نسخة جديدة من كائن البيان المدخل دون تغيير الكائن الأصلي. ```js const original = { @@ -231,12 +232,12 @@ assert.equal(params.length, 1); assert.equal(params[0].toString(), 'manifest'); ``` -استدعاء `validateManifest()` مع `{ containerId: 1, destination: "Santa Cruz", weight: 304, unit: "kg", hazmat: false }` يجب أن يُرجع الكائن الجديد `{}`. +يجب أن تُرجع دالة `validateManifest` كائنًا جديدًا فارغًا `{}` عند استدعائها مع `{ containerId: 1, destination: "Santa Cruz", weight: 304, unit: "kg", hazmat: false }`. ```js const testObj = { containerId: 1, - destination: "Santa Cruz", + destination: "Santa Cruz", weight: 304, unit: "kg", hazmat: false @@ -246,16 +247,16 @@ const expected = {}; const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for a valid manifest"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.strictEqual(testObj.containerId, 1, "Original object should not be mutated"); -assert.strictEqual(testObj.destination, "Santa Cruz", "Original object should not be mutated"); -assert.strictEqual(testObj.weight, 304, "Original object should not be mutated"); -assert.strictEqual(testObj.unit, "kg", "Original object should not be mutated"); -assert.strictEqual(testObj.hazmat, false, "Original object should not be mutated"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for a valid manifest."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.strictEqual(testObj.containerId, 1, "Original object should not be mutated."); +assert.strictEqual(testObj.destination, "Santa Cruz", "Original object should not be mutated."); +assert.strictEqual(testObj.weight, 304, "Original object should not be mutated."); +assert.strictEqual(testObj.unit, "kg", "Original object should not be mutated."); +assert.strictEqual(testObj.hazmat, false, "Original object should not be mutated."); ``` -إذا كان كائن البيان المُدخل صالحًا، يجب أن تُرجع دالة `validateManifest` كائنًا فارغًا `{}`. +يجب أن تُرجع دالة `validateManifest` كائنًا فارغًا `{}` إذا كان كائن البيان المدخل صالحًا. ```js const solution = {}; @@ -268,7 +269,7 @@ for (const obj of _validManifests) { } ``` -استدعاء `validateManifest()` مع `{}` يجب أن يُرجع الكائن الجديد `{ containerId: "Missing", destination: "Missing", weight: "Missing", unit: "Missing", hazmat: "Missing" }` دون تغيير الإدخال الأصلي. +يجب أن تُرجع دالة `validateManifest` الكائن الجديد `{ containerId: "Missing", destination: "Missing", weight: "Missing", unit: "Missing", hazmat: "Missing" }` عند استدعائها مع `{}`، دون تغيير الكائن الأصلي. ```js const testObj = {}; @@ -283,12 +284,12 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for missing properties"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.equal(Object.keys(testObj).length, 0, "validateManifest() should return a new object, not mutate the original"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for missing properties."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.equal(Object.keys(testObj).length, 0, "validateManifest() should return a new object, not mutate the original."); ``` -استدعاء `validateManifest()` مع `{ containerId: null, destination: "Santa Cruz", weight: 304, unit: "kg", hazmat: false }` يجب أن يُرجع الكائن الجديد `{ containerId: "Invalid" }` دون تغيير الإدخال الأصلي. +يجب أن تُرجع دالة `validateManifest` الكائن الجديد `{ containerId: "Invalid" }` عند استدعائها مع `{ containerId: null, destination: "Santa Cruz", weight: 304, unit: "kg", hazmat: false }`، دون تغيير الكائن الأصلي. ```js const testObj = { @@ -305,11 +306,11 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for null containerId"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for null containerId."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); ``` -استدعاء `validateManifest()` مع `{ containerId: 0, destination: 405, weight: -84, unit: "pounds", hazmat: "no" }` يجب أن يُرجع الكائن الجديد `{ containerId: "Invalid", destination: "Invalid", weight: "Invalid", unit: "Invalid", hazmat: "Invalid" }` دون تغيير الإدخال الأصلي. +يجب أن تُرجع دالة `validateManifest` الكائن الجديد `{ containerId: "Invalid", destination: "Invalid", weight: "Invalid", unit: "Invalid", hazmat: "Invalid" }` عند استدعائها مع `{ containerId: 0, destination: 405, weight: -84, unit: "pounds", hazmat: "no" }`، دون تغيير الكائن الأصلي. ```js const testObj = { @@ -330,16 +331,16 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid properties"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.strictEqual(testObj.containerId, 0, "Original object should not be mutated"); -assert.strictEqual(testObj.destination, 405, "Original object should not be mutated"); -assert.strictEqual(testObj.weight, -84, "Original object should not be mutated"); -assert.strictEqual(testObj.unit, "pounds", "Original object should not be mutated"); -assert.strictEqual(testObj.hazmat, "no", "Original object should not be mutated"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid properties."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.strictEqual(testObj.containerId, 0, "Original object should not be mutated."); +assert.strictEqual(testObj.destination, 405, "Original object should not be mutated."); +assert.strictEqual(testObj.weight, -84, "Original object should not be mutated."); +assert.strictEqual(testObj.unit, "pounds", "Original object should not be mutated."); +assert.strictEqual(testObj.hazmat, "no", "Original object should not be mutated."); ``` -استدعاء `validateManifest()` مع `{ containerId: -2 }` يجب أن يُرجع الكائن الجديد `{ containerId: "Invalid", destination: "Missing", weight: "Missing", unit: "Missing", hazmat: "Missing" }` دون تغيير الإدخال الأصلي. +يجب أن تُرجع دالة `validateManifest` الكائن الجديد `{ containerId: "Invalid", destination: "Missing", weight: "Missing", unit: "Missing", hazmat: "Missing" }` عند استدعائها مع `{ containerId: -2 }`، دون تغيير الكائن الأصلي. ```js const testObj = { @@ -356,13 +357,13 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.strictEqual(testObj.containerId, -2, "Original object should not be mutated"); -assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.strictEqual(testObj.containerId, -2, "Original object should not be mutated."); +assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated."); ``` -استدعاء `validateManifest()` مع `{ containerId: 3.50 }` يجب أن يُرجع الكائن الجديد `{ containerId: "Invalid", destination: "Missing", weight: "Missing", unit: "Missing", hazmat: "Missing" }` دون تغيير الإدخال الأصلي. يمكنك استخدام `Number.isInteger()` للتحقق من القيم الصحيحة. +يجب أن تُرجع دالة `validateManifest` الكائن الجديد `{ containerId: "Invalid", destination: "Missing", weight: "Missing", unit: "Missing", hazmat: "Missing" }` عند استدعائها مع `{ containerId: 3.50 }`، دون تغيير الكائن الأصلي. يمكنك استخدام `Number.isInteger()` للتحقق من القيم الصحيحة. ```js const testObj = { @@ -379,13 +380,13 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.strictEqual(testObj.containerId, 3.50, "Original object should not be mutated"); -assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.strictEqual(testObj.containerId, 3.50, "Original object should not be mutated."); +assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated."); ``` -استدعاء `validateManifest()` مع `{ destination: " " }` يجب أن يُرجع الكائن الجديد `{ containerId: "Missing", destination: "Invalid", weight: "Missing", unit: "Missing", hazmat: "Missing" }` دون تغيير الإدخال الأصلي. يمكنك استخدام `String.trim()` لإزالة الفراغات من السلسلة النصية. +يجب أن تُرجع دالة `validateManifest` الكائن الجديد `{ containerId: "Missing", destination: "Invalid", weight: "Missing", unit: "Missing", hazmat: "Missing" }` عند استدعائها مع `{ destination: " " }`، دون تغيير الكائن الأصلي. يمكنك استخدام `.trim()` لإزالة الفراغات من السلسلة النصية. ```js const testObj = { @@ -402,13 +403,13 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.strictEqual(testObj.destination, " ", "Original object should not be mutated"); -assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.strictEqual(testObj.destination, " ", "Original object should not be mutated."); +assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated."); ``` -استدعاء `validateManifest()` مع `{ weight: NaN }` يجب أن يُرجع الكائن الجديد `{ containerId: "Missing", destination: "Missing", weight: "Invalid", unit: "Missing", hazmat: "Missing" }` دون تغيير الإدخال الأصلي. يمكنك استخدام `Number.isNaN()` للتحقق من قيم NaN. +يجب أن تُرجع دالة `validateManifest` الكائن الجديد `{ containerId: "Missing", destination: "Missing", weight: "Invalid", unit: "Missing", hazmat: "Missing" }` عند استدعائها مع `{ weight: NaN }`، دون تغيير الكائن الأصلي. يمكنك استخدام `Number.isNaN()` للتحقق من قيم `NaN`. ```js const testObj = { @@ -425,13 +426,13 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.ok(Number.isNaN(testObj.weight), "Original object should not be mutated"); -assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.ok(Number.isNaN(testObj.weight), "Original object should not be mutated."); +assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated."); ``` -إذا لم يكن كائن البيان المُدخل صالحًا، يجب أن تُرجع دالة `validateManifest` كائنًا يصف الخصائص المفقودة و/أو غير الصالحة. +يجب أن تُرجع دالة `validateManifest` كائنًا يصف الخصائص المفقودة و/أو غير الصالحة إذا لم يكن كائن البيان المدخل صالحًا. ```js const solutions = [ @@ -504,7 +505,7 @@ assert.equal(params.length, 1); assert.equal(params[0].toString(), 'manifest'); ``` -استدعاء `processManifest()` مع `{ containerId: 55, destination: "Carmel", weight: 400, unit: "lb", hazmat: false }` يجب أن يسجل أولاً `"Validation success: 55"` ثم يسجل `"Total weight: 180 kg"`. +يجب أن تسجل دالة `processManifest` أولًا `Validation success: 55` ثم تسجل `Total weight: 180 kg` عند استدعائها مع `{ containerId: 55, destination: "Carmel", weight: 400, unit: "lb", hazmat: false }`. ```js const testObj = { @@ -524,8 +525,8 @@ try { ["Validation success: 55"], ["Total weight: 180 kg"] ]; - assert.deepEqual(spy.calls[0], expectedCalls[0], "First log should be the validation success message"); - assert.deepEqual(spy.calls[1], expectedCalls[1], "Second log should be the normalized weight in kg"); + assert.deepEqual(spy.calls[0], expectedCalls[0], "First log should be the validation success message."); + assert.deepEqual(spy.calls[1], expectedCalls[1], "Second log should be the normalized weight in kg."); } catch (err) { assert.fail(err); @@ -534,7 +535,7 @@ try { } ``` -إذا كان كائن البيان المُدخل صالحًا، يجب أن تسجل دالة `processManifest` أولًا رسالة النجاح، `Validation success: ${containerId}`. +يجب أن تسجل دالة `processManifest` أولًا رسالة النجاح، `Validation success: ${containerId}`، إذا كان كائن البيان المدخل صالحًا. ```js const testObj = { @@ -562,7 +563,7 @@ try { } ``` -إذا كان كائن البيان المُدخل صالحًا، يجب أن تطبعه دالة `processManifest` إلى الكيلوغرامات باستخدام `normalizeUnits()` ثم تسجل: `Total weight: ${weight} kg`. +يجب أن تطبع دالة `processManifest` كائن البيان المدخل الصالح بعد تطبيعه إلى الكيلوجرام باستخدام `normalizeUnits()` ثم تسجل `Total weight: ${weight} kg`. ```js const testObj = { @@ -590,7 +591,7 @@ try { } ``` -إذا كان كائن بيان الشحنة المُدخل صحيحًا، يجب أن تقوم دالة `processManifest` بطباعة رسالة نجاح تتضمن قيمة `containerId` للكائن، ثم طباعة قيمة `weight` للكائن بالكيلوغرام. استخدم `normalizeUnits()` للتحويل، ويجب أن يكون هناك استدعاءان لـ `console.log()`. +يجب أن تقوم دالة `processManifest` بطباعة رسالة نجاح تحتوي على `containerId` للكائن، ثم تطبع قيمة `weight` للكائن بالكيلوغرام إذا كان كائن البيان صالحًا. استخدم `normalizeUnits()` للتحويل، ويجب أن يتضمن ذلك استدعاءين لـ `console.log()`. ```js const originalNormalize = normalizeUnits; @@ -605,7 +606,7 @@ try { assert.isTrue( called, - "processManifest should call normalizeUnits() when the manifest is valid" + "processManifest() should call normalizeUnits() when the manifest is valid." ); } catch (err) { @@ -635,7 +636,7 @@ try { } ``` -استدعاء `processManifest()` مع `{ containerId: -88, destination: "Soledad", weight: NaN }` يجب أن يسجل أولًا `Validation error: -88` ثم يسجل الكائن `{ containerId: "Invalid", weight: "Invalid", unit: "Missing", hazmat: "Missing" }`. +يجب أن تسجل دالة `processManifest` أولًا `Validation error: -88` ثم تسجل الكائن `{ containerId: "Invalid", weight: "Invalid", unit: "Missing", hazmat: "Missing" }` عند استدعائها مع `{ containerId: -88, destination: "Soledad", weight: NaN }`. ```js const testObj = { @@ -658,8 +659,8 @@ try { }] ]; - assert.deepEqual(spy.calls[0], expectedCalls[0], "First log should be the validation error message"); - assert.deepEqual(spy.calls[1], expectedCalls[1], "Second log should be the validation result object"); + assert.deepEqual(spy.calls[0], expectedCalls[0], "First log should be the validation error message."); + assert.deepEqual(spy.calls[1], expectedCalls[1], "Second log should be the validation result object."); } catch (err) { assert.fail(err); @@ -668,7 +669,7 @@ try { } ``` -استدعاء `processManifest()` مع `{ destination: "Watsonville", hazmat: true }` يجب أن يسجل أولًا `Validation error: undefined` ثم يسجل الكائن `{ containerId: "Missing", weight: "Missing", unit: "Missing" }`. +يجب أن تسجل دالة `processManifest` أولًا `Validation error: undefined` ثم تسجل الكائن `{ containerId: "Missing", weight: "Missing", unit: "Missing" }` عند استدعائها مع `{ destination: "Watsonville", hazmat: true }`. ```js const testObj = { @@ -689,8 +690,8 @@ try { }] ]; - assert.deepEqual(spy.calls[0], expectedCalls[0], "First log should be the validation error message"); - assert.deepEqual(spy.calls[1], expectedCalls[1], "Second log should be the validation result object"); + assert.deepEqual(spy.calls[0], expectedCalls[0], "First log should be the validation error message."); + assert.deepEqual(spy.calls[1], expectedCalls[1], "Second log should be the validation result object."); } catch (err) { assert.fail(err); @@ -699,7 +700,7 @@ try { } ``` -إذا لم يكن كائن البيان المُدخل صالحًا، يجب أن تسجل دالة `processManifest` أولًا رسالة الخطأ، `Validation error: ${containerId}`. +يجب أن تسجل دالة `processManifest` أولًا رسالة الخطأ، `Validation error: ${containerId}`، إذا لم يكن كائن البيان المدخل صالحًا. ```js const spy = __helpers.spyOn(console, "log"); @@ -718,13 +719,13 @@ try { assert.deepEqual(spy.calls[0], expectedCalls[0]); } catch (err) { - assert.fail(err); + assert.fail(err); } finally { spy.restore(); } ``` -إذا لم يكن كائن البيان المُدخل صالحًا، يجب أن تسجل دالة `processManifest` أيضًا الكائن الذي تُرجعه دالة `validateManifest()` عند استدعائها مع كائن البيان الأصلي. استدعِ `console.log()` مباشرة مع الكائن المُرجع. +يجب أن تسجل دالة `processManifest` أيضًا الكائن الذي تُرجعه الدالة `validateManifest()` عند استدعائها مع كائن البيان الأصلي إذا لم يكن كائن البيان المدخل صالحًا. استدعِ `console.log()` مباشرة مع الكائن المُرجع. ```js const originalValidate = validateManifest; @@ -740,7 +741,7 @@ try { assert.isTrue( called, - "processManifest should call validateManifest() when the manifest is invalid" + "processManifest() should call validateManifest() when the manifest is invalid." ); } catch (err) { @@ -765,13 +766,13 @@ try { assert.deepEqual(spy.calls[1], expectedCalls[1]); } catch (err) { - assert.fail(err); + assert.fail(err); } finally { spy.restore(); } ``` -إذا لم يكن كائن البيان المُدخل صالحًا، يجب أن تسجل دالة `processManifest` رسالة خطأ مع `containerId` للكائن، ثم تسجل الكائن الذي تُرجعه دالة `validateManifest()` عند استدعائها مع كائن الإدخال. يجب أن يتضمن ذلك استدعاءين لـ `console.log()`. +يجب أن تسجل دالة `processManifest` رسالة خطأ مع `containerId` للكائن، ثم تسجل الكائن الذي تُرجعه الدالة `validateManifest()` عند استدعائها مع كائن الإدخال، إذا لم يكن كائن البيان المدخل صالحًا. يجب أن يتضمن ذلك استدعائين لـ `console.log()`. ```js const originalValidate = validateManifest; @@ -787,7 +788,7 @@ try { assert.isTrue( called, - "processManifest should call validateManifest() when the manifest is invalid" + "processManifest() should call validateManifest() when the manifest is invalid." ); } catch (err) { @@ -812,7 +813,7 @@ try { assert.deepEqual(spy.calls, expectedCalls); } catch (err) { - assert.fail(err); + assert.fail(err); } finally { spy.restore(); } diff --git a/curriculum/challenges/arabic/blocks/lab-digital-pet-game/68c362b379059c388d3874f2.md b/curriculum/challenges/arabic/blocks/lab-digital-pet-game/68c362b379059c388d3874f2.md index 2aa21b94fe7..21044c39ec4 100644 --- a/curriculum/challenges/arabic/blocks/lab-digital-pet-game/68c362b379059c388d3874f2.md +++ b/curriculum/challenges/arabic/blocks/lab-digital-pet-game/68c362b379059c388d3874f2.md @@ -60,6 +60,7 @@ saveSubmissionToDB: true ```js globalThis._PET_NAME = 'Fitzgerald'; globalThis._clock = __FakeTimers.install(); +window.fetch = () => Promise.resolve({ json: () => Promise.resolve('Cats sleep for around 13 to 16 hours a day.') }); ``` # --after-all-- diff --git a/curriculum/challenges/arabic/blocks/lab-fcc-forum-leaderboard/673c91f0b934834bc4a3ecc2.md b/curriculum/challenges/arabic/blocks/lab-fcc-forum-leaderboard/673c91f0b934834bc4a3ecc2.md index 706144386a7..b5d5391a1bf 100644 --- a/curriculum/challenges/arabic/blocks/lab-fcc-forum-leaderboard/673c91f0b934834bc4a3ecc2.md +++ b/curriculum/challenges/arabic/blocks/lab-fcc-forum-leaderboard/673c91f0b934834bc4a3ecc2.md @@ -50,7 +50,7 @@ demoType: onClick لاحظ أن قيم `avatar_template` هي مسارات نسبية: تبدأ بـ `/` وتحتوي على عنصر نائب `{size}` يجب استبداله بحجم بكسل. الثابت `avatarUrl` يحمل عنوان URL الأساسي للإضافة عند كون المسار نسبيًا. -**الهدف:** نفذ قصص المستخدم أدناه واجعل جميع الاختبارات تنجح لإكمال المختبر. +**الهدف:** إكمال قصص المستخدم أدناه واجتياز جميع الاختبارات لإتمام المختبر. **قصص المستخدم:** @@ -93,6 +93,68 @@ demoType: onClick 1. يجب أن تطلب دالة `fetchData` البيانات من `forumLatest` وتستدعي `showLatestPosts` مع تمرير الاستجابة بعد تحويلها إلى JSON. 1. إذا حدث خطأ أثناء جلب البيانات، يجب أن تسجل دالة `fetchData` الخطأ في وحدة التحكم. يجب أن تستخدم تحديدًا `console.log` لهذا الغرض. +# --before-all-- + +```js +const _testUsers = [ + { + avatar_template: '/user_avatar/QuincyLarson_{size}.png', + id: 6, + name: 'Quincy Larson', + username: 'QuincyLarson' + }, + { + avatar_template: '/user_avatar/jwilkins.oboe_{size}.png', + id: 285941, + name: 'Jessica Wilkins', + username: 'jwilkins.oboe' + }, + { + avatar_template: '/user_avatar/ilenia_{size}.png', + id: 170865, + name: 'Ilenia', + username: 'ilenia' + } +]; + +const _testPosters = [ + { user_id: 6 }, + { user_id: 285941 }, + { user_id: 170865 } +]; + +const _testData = { + users: _testUsers, + topic_list: { + topics: [ + { + bumped_at: '2024-04-15T16:01:26.403Z', + category_id: 1, + id: 684569, + posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], + posts_count: 8, + slug: 'the-freecodecamp-podcast-is-back-now-with-video', + title: 'The freeCodeCamp Podcast is back – now with video', + views: 542 + }, + { + bumped_at: '2024-04-19T13:52:03.523Z', + category_id: 421, + id: 686149, + posters: [{ user_id: 170865 }], + posts_count: 1, + slug: 'problem-with-making-changes-to-styles-js', + title: 'Problem with making changes to styles. (JS)', + views: 9 + } + ] + } +}; + +window.fetch = () => + Promise.resolve({ json: () => Promise.resolve(_testData) }); +``` + # --hints-- يجب أن يكون لديك دالة باسم `timeAgo` تأخذ معلمة واحدة. @@ -297,31 +359,8 @@ assert.lengthOf(avatars, 2); يجب أن تُرجع دالة `avatars` سلسلة نصية تتكون من ربط عناصر `img`، واحدة لكل ملصق موجود في مصفوفة المستخدمين. ```js -const posters = [{ user_id: 6 }, { user_id: 285941 }, { user_id: 170865 }]; -const users = [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - }, - { id: 20 } -]; +const posters = _testPosters; +const users = [..._testUsers, { id: 20 }]; const actual = avatars(posters, users); const matches = actual.match(/<\s*img\s+.+?>/g); assert.lengthOf(matches, 3); @@ -330,31 +369,8 @@ assert.lengthOf(matches, 3); يجب أن يحتوي كل عنصر `img` في السلسلة التي تُرجعها دالة `avatars` على نص بديل `alt` بقيمة الخاصية `name` للناشر. ```js -const posters = [{ user_id: 6 }, { user_id: 285941 }, { user_id: 170865 }]; -const users = [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - }, - { id: 20 } -]; +const posters = _testPosters; +const users = [..._testUsers, { id: 20 }]; const actual = avatars(posters, users); const matches = actual.match(/<\s*img\s+.+?>/g); @@ -366,31 +382,8 @@ assert.match(matches[2], /alt=('|")Ilenia\1/); يجب أن تضبط دالة `avatars` حجم كل صورة رمزية عبر الوصول إلى خاصية `avatar_template` واستبدال `{size}` بـ `30`. ```js -const posters = [{ user_id: 6 }, { user_id: 285941 }, { user_id: 170865 }]; -const users = [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - }, - { id: 20 } -]; +const posters = _testPosters; +const users = [..._testUsers, { id: 20 }]; const actual = avatars(posters, users); assert.notMatch(actual, /\{size\}/); assert.lengthOf(actual.match(/_30/g), 3); @@ -399,31 +392,8 @@ assert.lengthOf(actual.match(/_30/g), 3); يجب أن يحتوي كل عنصر `img` على خاصية `src` مضبوطة على `avatar_template` للمستخدم المطابق. إذا بدأ `avatar_template` بـ `/`، أضف `avatarUrl` مباشرة قبله. ```js -const posters = [{ user_id: 6 }, { user_id: 285941 }, { user_id: 170865 }]; -const users = [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - }, - { id: 20 } -]; +const posters = _testPosters; +const users = [..._testUsers, { id: 20 }]; const actual = avatars(posters, users); const matches = actual.match(/<\s*img\s+.+?>/g); @@ -458,19 +428,15 @@ assert.isFunction(fetchData); يجب أن تطلب دالة `fetchData` البيانات من `https://cdn.freecodecamp.org/curriculum/forum-latest/latest.json`. ```js -const testArr = []; -const temp = fetch; +const spy = __helpers.spyOn(window, 'fetch'); try { - fetch = source => { - testArr.push(source); - return temp(source); - }; fetchData(); - assert.deepEqual(testArr, [ + assert.include( + spy.calls.map(call => call[0]), 'https://cdn.freecodecamp.org/curriculum/forum-latest/latest.json' - ]); + ); } finally { - fetch = temp; + spy.restore(); } ``` @@ -521,55 +487,7 @@ async () => { يجب أن تضبط دالة `showLatestPosts` المحتوى الداخلي لـ `#posts-container` إلى سلسلة نصية تتكون من ربط عناصر `tr`، واحدة لكل عنصر في `topics`. ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const pContainer = document.getElementById('posts-container'); pContainer.innerHTML = ''; showLatestPosts(data); @@ -579,55 +497,7 @@ assert.lengthOf(pContainer.querySelectorAll('tr'), 2); يجب أن يحتوي كل عنصر `tr` من السلسلة التي تُرجعها دالة `showLatestPosts` على 5 عناصر `td`. ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const pContainer = document.getElementById('posts-container'); pContainer.innerHTML = ''; showLatestPosts(data); @@ -638,55 +508,7 @@ assert.lengthOf(pContainer.querySelectorAll('tr:last-child>td'), 5); يجب أن يحتوي أول عنصر `td` في كل صف جدول من السلسلة التي تُرجعها دالة `showLatestPosts` على عنصرين وسم رابط، الأول بصنف `post-title`، و`href` مكون من `/`, ونص وسم الرابط ``, والثاني يتم الحصول عليه باستدعاء `forumCategory` مع `category_id`. ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const pContainer = document.getElementById('posts-container'); pContainer.innerHTML = ''; showLatestPosts(data); @@ -731,55 +553,7 @@ assert.equal( يجب أن يحتوي ثاني عنصر `td` في كل صف جدول من السلسلة التي تُرجعها دالة `showLatestPosts` على الصور التي تُرجعها دالة `avatars` عند استدعائها مع `posters` و`users` كمعاملات، متداخلة داخل عنصر `div` بصنف `avatar-container`. ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const pContainer = document.getElementById('posts-container'); pContainer.innerHTML = ''; showLatestPosts(data); @@ -820,55 +594,7 @@ assert.equal(imgs2[0].alt, 'Ilenia'); يجب أن يحتوي ثالث عنصر `td` في كل صف جدول من السلسلة التي تُرجعها دالة `showLatestPosts` على عدد الردود على المنشور. _تلميح:_ استخدم `posts_count - 1`. ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const pContainer = document.getElementById('posts-container'); pContainer.innerHTML = ''; showLatestPosts(data); @@ -887,55 +613,7 @@ assert.equal( يجب أن يحتوي رابع عنصر `td` في كل صف جدول من السلسلة التي تُرجعها دالة `showLatestPosts` على عدد مشاهدات المنشور. ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const pContainer = document.getElementById('posts-container'); pContainer.innerHTML = ''; showLatestPosts(data); @@ -954,55 +632,7 @@ assert.equal( يجب أن يحتوي خامس عنصر `td` في كل صف جدول من السلسلة التي تُرجعها دالة `showLatestPosts` على الوقت المنقضي منذ آخر نشاط، المولد باستخدام دالة `timeAgo`. ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const calcTime = time => { const currentTime = new Date(); const lastPost = new Date(time); diff --git a/curriculum/challenges/arabic/blocks/lab-javascript-trivia-bot/66ed41f912d0bb1dc62da5dd.md b/curriculum/challenges/arabic/blocks/lab-javascript-trivia-bot/66ed41f912d0bb1dc62da5dd.md index 4cabd149052..e1aac98e243 100644 --- a/curriculum/challenges/arabic/blocks/lab-javascript-trivia-bot/66ed41f912d0bb1dc62da5dd.md +++ b/curriculum/challenges/arabic/blocks/lab-javascript-trivia-bot/66ed41f912d0bb1dc62da5dd.md @@ -11,17 +11,17 @@ dashedName: lab-javascript-trivia-bot **قصص المستخدم:** -1. يجب أن تسجل في وحدة التحكم الرسالة `"Hello! I'm your coding fun fact guide!"` كتحية للمستخدم. -1. يجب أن تنشئ ثلاثة متغيرات: `botName` و `botLocation` و `favoriteLanguage`، تخزن اسم البوت، ومكانه، ولغة البرمجة المفضلة لديه على التوالي. +1. يجب أن تسجل في وحدة التحكم الرسالة `"Hello! I'm your coding fun fact guide!"` لتحية المستخدم. +1. يجب أن تنشئ ثلاثة متغيرات: `botName` و`botLocation` و`favoriteLanguage`، تخزن اسم الروبوت، ومكانه، ولغة البرمجة المفضلة لديه على التوالي. 1. يجب أن تسجل في وحدة التحكم الرسالة `"My name is (botName) and I live on (botLocation)."`. 1. يجب أن تسجل في وحدة التحكم الرسالة `"My favorite programming language is (favoriteLanguage)."`. -1. يجب أن تستخدم `let` لإنشاء متغير `codingFact` وتعيين سلسلة نصية له تحتوي على حقيقة ممتعة عن لغة البرمجة المفضلة للبوت، مع تضمين استخدام المتغير `favoriteLanguage`. +1. يجب أن تستخدم `let` لإنشاء متغير `codingFact` وتعيين سلسلة نصية له تحتوي على حقيقة ممتعة عن لغة البرمجة المفضلة للروبوت، باستخدام المتغير `favoriteLanguage`. 1. يجب أن تسجل المتغير `codingFact` في وحدة التحكم. -1. يجب أن تعيد تعيين المتغير `codingFact` إلى حقيقة جديدة عن لغة البوت المفضلة باستخدام المتغير `favoriteLanguage` مرة أخرى. +1. يجب أن تعيد تعيين المتغير `codingFact` إلى حقيقة جديدة عن لغة البرمجة المفضلة للروبوت باستخدام المتغير `favoriteLanguage` مرة أخرى. 1. يجب أن تسجل المتغير `codingFact` في وحدة التحكم مرة أخرى. -1. يجب أن تعيد تعيين المتغير `codingFact` مرة أخرى إلى حقيقة جديدة أخرى عن لغة البوت المفضلة باستخدام المتغير `favoriteLanguage`. +1. يجب أن تعيد تعيين المتغير `codingFact` إلى حقيقة ثالثة عن لغة البرمجة المفضلة للروبوت باستخدام المتغير `favoriteLanguage` مرة أخرى. 1. يجب أن تسجل المتغير `codingFact` في وحدة التحكم للمرة الثالثة. -1. يجب أن تسجل في وحدة التحكم الرسالة `"It was fun sharing these facts with you. Goodbye! - (botName) from (botLocation)."` كعبارة وداع من البوت. +1. يجب أن تسجل في وحدة التحكم الرسالة `"It was fun sharing these facts with you. Goodbye! - (botName) from (botLocation)."` كعبارة وداع من الروبوت. # --before-each-- @@ -162,7 +162,7 @@ let codingFact = "Did you know that " + favoriteLanguage + " was created in just console.log(codingFact); -codingFact = "Another fun fact: " + favoriteLanguage + "was originally called Mocha!"; +codingFact = "Another fun fact: " + favoriteLanguage + " was originally called Mocha!"; console.log(codingFact); diff --git a/curriculum/challenges/arabic/blocks/lab-mood-board/673b3d6b7ef7318eef926d5a.md b/curriculum/challenges/arabic/blocks/lab-mood-board/673b3d6b7ef7318eef926d5a.md index b944295a40b..0e180435a49 100644 --- a/curriculum/challenges/arabic/blocks/lab-mood-board/673b3d6b7ef7318eef926d5a.md +++ b/curriculum/challenges/arabic/blocks/lab-mood-board/673b3d6b7ef7318eef926d5a.md @@ -12,20 +12,20 @@ demoType: onClick في هذا المختبر، ستنشئ لوحة مزاجية باستخدام مكوِّنات React قابلة لإعادة الاستخدام. تم توفير CSS لك بالفعل. -**الهدف:** حقق قصص المستخدم أدناه واجعل جميع الاختبارات تنجح لإكمال المختبر. +**الهدف:** إكمال قصص المستخدم أدناه واجتياز جميع الاختبارات لإتمام المختبر. **قصص المستخدم:** -1. يجب عليك إنشاء وتصدير مكوِّن `MoodBoardItem` يقبل ثلاث خصائص: `color`، و`image`، و`description`. -2. يجب أن يُرجع مكوِّن `MoodBoardItem` عنصر `div` مع الصنف `mood-board-item` كعنصر المستوى الأعلى. -3. يجب تعيين لون الخلفية لعنصر `.mood-board-item` إلى قيمة الخاصية `color` باستخدام أنماط مضمَّنة. -4. يجب عرض عنصر `img`، مع صنف `mood-board-image` و`src` الخاص به مضبوط على قيمة الخاصية `image`، داخل عنصر `.mood-board-item`. -5. يجب عرض عنصر `h3`، مع صنف `mood-board-text` ونصه هو قيمة الخاصية `description`، داخل عنصر `.mood-board-item`. -6. يجب إنشاء وتصدير مكوِّن `MoodBoard`. +1. يجب أن تنشئ وتصدر مكوِّن `MoodBoardItem` يقبل ثلاث خصائص: `color` و`image` و`description`. +2. يجب أن يُرجع مكوِّن `MoodBoardItem` عنصر `div` بفئة `mood-board-item` كعنصر المستوى الأعلى. +3. يجب أن تضبط لون خلفية عنصر `.mood-board-item` إلى قيمة الخاصية `color` باستخدام أنماط مضمَّنة. +4. يجب أن تعرض عنصر `img` بفئة `mood-board-image` وخصيصة `src` مضبوطة على قيمة الخاصية `image` داخل عنصر `.mood-board-item`. +5. يجب أن تعرض عنصر `h3` بفئة `mood-board-text` ونصه مضبوط على قيمة الخاصية `description` داخل عنصر `.mood-board-item`. +6. يجب أن تنشئ وتصدر مكوِّن `MoodBoard`. 7. يجب أن يُرجع مكوِّن `MoodBoard` عنصر `div` كعنصر المستوى الأعلى. -8. يجب أن يعرض مكوِّن `MoodBoard` عنصر `h1` مع صنف `mood-board-heading` والنص `Destination Mood Board`. -9. يجب أن يعرض مكوِّن `MoodBoard` عنصر `div` مع صنف `mood-board`. -10. يجب أن يعرض مكوِّن `MoodBoard` ثلاثة مكوِّنات `MoodBoardItem` على الأقل داخل عنصر `.mood-board`، ويجب أن يمرر كل منها الخصائص `color` و`image` و`description` بقيم صحيحة. +8. يجب أن يعرض مكوِّن `MoodBoard` عنصر `h1` بفئة `mood-board-heading` والنص `Destination Mood Board`. +9. يجب أن يعرض مكوِّن `MoodBoard` عنصر `div` بفئة `mood-board`. +10. يجب أن يعرض مكوِّن `MoodBoard` ثلاثة مكوِّنات `MoodBoardItem` على الأقل داخل عنصر `.mood-board`، وكل منها يمرر الخصائص `color` و`image` و`description` بقيم صحيحة. يمكنك استخدام الصور التالية في لوحتك المزاجية إذا أردت: @@ -41,10 +41,10 @@ demoType: onClick يجب تصدير مكوِّن `MoodBoardItem`. ```js -assert.isFunction(window.index.MoodBoardItem, 1); +assert.isFunction(window.index.MoodBoardItem); ``` -يجب أن يُرجع مكوِّن `MoodBoardItem` عنصر `div` مع صنف `mood-board-item` كعنصر المستوى الأعلى. +يجب أن يُرجع مكوِّن `MoodBoardItem` عنصر `div` بفئة `mood-board-item` كعنصر المستوى الأعلى. ```js const item = document.getElementsByClassName('mood-board-item')[0]; @@ -52,7 +52,7 @@ assert.exists(item); assert.equal(item.tagName, 'DIV'); ``` -يجب تعيين لون الخلفية لعنصر `.mood-board-item` إلى قيمة الخاصية `color` باستخدام أنماط مضمَّنة. +يجب أن يُضبط لون خلفية عنصر `.mood-board-item` إلى قيمة الخاصية `color` باستخدام أنماط مضمَّنة. ```js const container = await __helpers.prepTestComponent(window.index.MoodBoardItem, { color: "red" }); @@ -83,7 +83,7 @@ assert.equal(item.tagName, 'DIV'); يجب تصدير مكوِّن `MoodBoard`. ```js -assert.isFunction(window.index.MoodBoard, 1); +assert.isFunction(window.index.MoodBoard); ``` يجب أن يُرجع مكوِّن `MoodBoard` عنصر `div` كعنصر المستوى الأعلى. @@ -102,7 +102,15 @@ assert.equal(heading.tagName, 'H1'); assert.equal(heading.textContent, 'Destination Mood Board'); ``` -يجب أن يعرض مكوِّن `MoodBoard` ثلاثة مكوِّنات `MoodBoardItem` على الأقل، ويمرر كل منها الخصائص `color` و`image` و`description` بقيم صحيحة. +يجب أن يعرض مكوِّن `MoodBoard` عنصر `div` بفئة `mood-board`. + +```js +const moodboard = document.getElementsByClassName('mood-board')[0]; +assert.exists(moodboard); +assert.equal(moodboard.tagName, 'DIV'); +``` + +يجب أن يعرض مكوِّن `MoodBoard` ثلاثة مكوِّنات `MoodBoardItem` على الأقل داخل عنصر `.mood-board`، وكل منها يمرر الخصائص `color` و`image` و`description` بقيم صحيحة. ```js const moodboard = document.getElementsByClassName('mood-board')[0]; diff --git a/curriculum/challenges/arabic/blocks/lab-motorcycle-shop/694175528a794a090ea0ba74.md b/curriculum/challenges/arabic/blocks/lab-motorcycle-shop/694175528a794a090ea0ba74.md index 61c15d17fef..64b66db2b51 100644 --- a/curriculum/challenges/arabic/blocks/lab-motorcycle-shop/694175528a794a090ea0ba74.md +++ b/curriculum/challenges/arabic/blocks/lab-motorcycle-shop/694175528a794a090ea0ba74.md @@ -10,7 +10,7 @@ demoType: onClick في هذا المختبر، تم تزويدك بكل شفرة HTML وCSS. ستستخدم TypeScript لإكمال وظائف صفحة متجر الدراجات النارية. -**الهدف:** حقق قصص المستخدم أدناه واجعل جميع الاختبارات تنجح لإكمال المختبر. +**الهدف:** إكمال قصص المستخدم أدناه واجتياز جميع الاختبارات لإتمام المختبر. **قصص المستخدم:** @@ -35,6 +35,291 @@ demoType: onClick 7. يجب أن يُعرض عدد عناصر `Motorcycle` المعروضة داخل عنصر له معرف `results-number`. 8. يجب تحديث الفلتر عند حدث `input`. +# --before-all-- + +```js +const _testMotorcycles = [ + { + id: '1', + name: 'Ninja H2', + manufacturer: 'Kawasaki', + category: 'Sport', + price: 29000, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-vmoto-stash.jpg', + description: 'Supercharged hypersport with unmatched power', + year: 2024, + created_at: '2024-01-01T00:00:00Z' + }, + { + id: '2', + name: 'Street Triple RS', + manufacturer: 'Triumph', + category: 'Naked', + price: 13500, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-r3.png', + description: 'Agile naked bike with triple-cylinder perfection', + year: 2024, + created_at: '2024-01-02T00:00:00Z' + }, + { + id: '3', + name: 'R1250 GS Adventure', + manufacturer: 'BMW', + category: 'Adventure', + price: 21995, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-vmoto-stash.jpg', + description: 'The ultimate adventure touring machine', + year: 2024, + created_at: '2024-01-03T00:00:00Z' + }, + { + id: '4', + name: 'Panigale V4', + manufacturer: 'Ducati', + category: 'Sport', + price: 28395, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-kawasaki-zx10r.png', + description: 'Italian superbike engineering at its finest', + year: 2024, + created_at: '2024-01-04T00:00:00Z' + }, + { + id: '5', + name: 'Road Glide Special', + manufacturer: 'Harley-Davidson', + category: 'Cruiser', + price: 29999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-vmax.jpg', + description: 'Classic American touring with modern tech', + year: 2024, + created_at: '2024-01-05T00:00:00Z' + }, + { + id: '6', + name: 'MT-09', + manufacturer: 'Yamaha', + category: 'Naked', + price: 9999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-mt7.jpg', + description: 'Lightweight naked bike with crossplane power', + year: 2024, + created_at: '2024-01-06T00:00:00Z' + }, + { + id: '7', + name: 'Africa Twin', + manufacturer: 'Honda', + category: 'Adventure', + price: 14599, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-honda-africa.jpg', + description: 'Legendary adventure bike reborn for modern times', + year: 2024, + created_at: '2024-01-07T00:00:00Z' + }, + { + id: '8', + name: 'Super Duke R', + manufacturer: 'KTM', + category: 'Naked', + price: 18999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-suzuki-sv650.jpg', + description: 'The Beast returns with 180hp of raw power', + year: 2024, + created_at: '2024-01-08T00:00:00Z' + }, + { + id: '9', + name: 'GSX-R1000R', + manufacturer: 'Suzuki', + category: 'Sport', + price: 17199, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-suzuki-gsxr1000.jpg', + description: 'Track-ready sportbike with championship DNA', + year: 2024, + created_at: '2024-01-09T00:00:00Z' + }, + { + id: '10', + name: 'Street Glide', + manufacturer: 'Harley-Davidson', + category: 'Cruiser', + price: 21999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-vmax.jpg', + description: 'Milwaukee-Eight power in a sleek bagger', + year: 2024, + created_at: '2024-01-10T00:00:00Z' + }, + { + id: '11', + name: 'Z H2', + manufacturer: 'Kawasaki', + category: 'Naked', + price: 17000, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-kawasaki-zh2.jpg', + description: 'Supercharged naked bike mayhem', + year: 2024, + created_at: '2024-01-11T00:00:00Z' + }, + { + id: '12', + name: 'Multistrada V4', + manufacturer: 'Ducati', + category: 'Adventure', + price: 22995, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-mt3.jpg', + description: 'Italian style meets adventure capability', + year: 2024, + created_at: '2024-01-12T00:00:00Z' + }, + { + id: '13', + name: 'Speed Triple 1200', + manufacturer: 'Triumph', + category: 'Naked', + price: 16500, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-honda-transalp.jpg', + description: 'British muscle bike with cutting-edge tech', + year: 2024, + created_at: '2024-01-13T00:00:00Z' + }, + { + id: '14', + name: 'S1000RR', + manufacturer: 'BMW', + category: 'Sport', + price: 17295, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-kawasaki-z900a1.jpg', + description: 'German precision in a superbike package', + year: 2024, + created_at: '2024-01-14T00:00:00Z' + }, + { + id: '15', + name: 'MT-07', + manufacturer: 'Yamaha', + category: 'Naked', + price: 7999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-mt7.jpg', + description: 'Best-selling parallel twin for pure fun', + year: 2024, + created_at: '2024-01-15T00:00:00Z' + }, + { + id: '16', + name: 'V-Strom 1050', + manufacturer: 'Suzuki', + category: 'Adventure', + price: 13799, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-benelli-trk702.png', + description: 'Reliable adventure touring on a budget', + year: 2024, + created_at: '2024-01-16T00:00:00Z' + }, + { + id: '17', + name: 'Sportster S', + manufacturer: 'Harley-Davidson', + category: 'Cruiser', + price: 15999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-r3.png', + description: 'Revolution Max engine in a modern cruiser', + year: 2024, + created_at: '2024-01-17T00:00:00Z' + }, + { + id: '18', + name: 'CBR1000RR-R', + manufacturer: 'Honda', + category: 'Sport', + price: 28500, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-honda-cbr500.png', + description: 'Honda racing technology for the street', + year: 2024, + created_at: '2024-01-18T00:00:00Z' + }, + { + id: '19', + name: 'Tiger 900', + manufacturer: 'Triumph', + category: 'Adventure', + price: 14400, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-triumph-tiger900.png', + description: 'Middleweight adventure excellence', + year: 2024, + created_at: '2024-01-19T00:00:00Z' + }, + { + id: '20', + name: '890 Duke R', + manufacturer: 'KTM', + category: 'Naked', + price: 11999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-kawasaki-zx10r.png', + description: 'The Scalpel - precise handling perfection', + year: 2024, + created_at: '2024-01-20T00:00:00Z' + }, + { + id: '21', + name: 'Ninja 400', + manufacturer: 'Kawasaki', + category: 'Sport', + price: 5299, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-vmoto-stash.jpg', + description: 'Perfect entry-level sportbike', + year: 2024, + created_at: '2024-01-21T00:00:00Z' + }, + { + id: '22', + name: 'Scrambler 1200', + manufacturer: 'Triumph', + category: 'Adventure', + price: 13250, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-ducati-scrambler.jpg', + description: 'Modern classic with off-road capability', + year: 2024, + created_at: '2024-01-22T00:00:00Z' + }, + { + id: '23', + name: 'Monster Plus', + manufacturer: 'Ducati', + category: 'Naked', + price: 14295, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-kawasaki-zx10r.png', + description: 'Evolved Monster with V-twin soul', + year: 2024, + created_at: '2024-01-23T00:00:00Z' + }, + { + id: '24', + name: 'CB650R', + manufacturer: 'Honda', + category: 'Naked', + price: 9199, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-kawasaki-z900.png', + description: 'Neo Sports Café styling with inline-four power', + year: 2024, + created_at: '2024-01-24T00:00:00Z' + }, + { + id: '25', + name: 'Low Rider S', + manufacturer: 'Harley-Davidson', + category: 'Cruiser', + price: 17999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-suzuki-vstorm650.jpg', + description: 'Blacked-out cruiser with attitude', + year: 2024, + created_at: '2024-01-25T00:00:00Z' + } +]; + +window.fetch = () => + Promise.resolve({ json: () => Promise.resolve(_testMotorcycles) }); +``` + # --hints-- يجب أن يكون لديك `type` باسم `Category`. @@ -84,16 +369,24 @@ assert.isFunction(fetchMotorcycles); ```js const spy = __helpers.spyOn(window, 'fetch'); -const motorcycles = await fetchMotorcycles(); -assert.strictEqual(spy.calls[0][0].trim(),"https://cdn.freecodecamp.org/curriculum/labs/data/motorcycles.json"); +try { + await fetchMotorcycles(); + assert.strictEqual(spy.calls[0][0].trim(),"https://cdn.freecodecamp.org/curriculum/labs/data/motorcycles.json"); +} finally { + spy.restore(); +} ``` يجب أن تُرجع وعدًا يحتوي على 25 كائنًا من `Motorcycle` من دالة `fetchMotorcycles`. ```js const spy = __helpers.spyOn(window, 'fetch'); -const motorcycles = await fetchMotorcycles(); -assert.lengthOf(motorcycles,25); +try { + const motorcycles = await fetchMotorcycles(); + assert.lengthOf(motorcycles,25); +} finally { + spy.restore(); +} ``` يجب أن يكون لديك دالة باسم `renderMotorcycleCard`. diff --git a/curriculum/challenges/arabic/blocks/lab-nth-fibonacci-number-js/7a97b79c096ecb000d03bd36.md b/curriculum/challenges/arabic/blocks/lab-nth-fibonacci-number-js/7a97b79c096ecb000d03bd36.md index 8781893a3ab..3eeb28138ee 100644 --- a/curriculum/challenges/arabic/blocks/lab-nth-fibonacci-number-js/7a97b79c096ecb000d03bd36.md +++ b/curriculum/challenges/arabic/blocks/lab-nth-fibonacci-number-js/7a97b79c096ecb000d03bd36.md @@ -7,7 +7,7 @@ dashedName: build-an-nth-fibonacci-number-calculator # --description-- -**الهدف:** نفذ قصص المستخدم أدناه واجعل جميع الاختبارات تنجح لإكمال المختبر. +**الهدف:** إكمال قصص المستخدم أدناه واجتياز جميع الاختبارات لإتمام المختبر. **قصص المستخدم:** @@ -22,20 +22,25 @@ dashedName: build-an-nth-fibonacci-number-calculator يجب أن يكون لديك دالة باسم `fibonacci`. ```js -assert.isFunction(fibonacci); +const explorer = await __helpers.Explorer(code); +assert.exists(explorer.allFunctions.fibonacci); ``` يجب أن تأخذ دالة `fibonacci` معلمة واحدة فقط. ```js -const params = __helpers.getFunctionParams(fibonacci.toString()); -assert.equal(params.length, 1); +const explorer = await __helpers.Explorer(code); +const { fibonacci } = explorer.allFunctions; +assert.equal(fibonacci?.parameters.length, 1); ``` يجب أن يكون لديك مصفوفة باسم `sequence` داخل دالة `fibonacci` مهيأة إلى `[0, 1]`. ```js -assert.match(__helpers.removeJSComments(fibonacci.toString()), /(const|let|var)\s+sequence\s*=\s*\[\s*0\s*,\s*1\s*\]/); +const explorer = await __helpers.Explorer(code); +const { fibonacci } = explorer.allFunctions; +const { sequence } = fibonacci?.variables ?? {}; +assert.isTrue(sequence?.value.matches('[0, 1]')); ``` يجب أن تُرجع `fibonacci(0)` القيمة `0`. diff --git a/curriculum/challenges/arabic/blocks/lab-product-showcase/696920c0c98a1ed58eb86293.md b/curriculum/challenges/arabic/blocks/lab-product-showcase/696920c0c98a1ed58eb86293.md index 8e3d3c988c9..0977951428c 100644 --- a/curriculum/challenges/arabic/blocks/lab-product-showcase/696920c0c98a1ed58eb86293.md +++ b/curriculum/challenges/arabic/blocks/lab-product-showcase/696920c0c98a1ed58eb86293.md @@ -421,6 +421,10 @@ assert.isFunction(showProducts); ```js const len = products.items.length; +const books = document.getElementById("books"); +const all = document.getElementById("all"); +const output = document.getElementById("output"); + assert.isAtLeast(len, 3); books.dispatchEvent(new Event("click", { bubbles: true })); all.dispatchEvent(new Event("click", { bubbles: true })); @@ -430,7 +434,11 @@ assert.lengthOf(output.querySelectorAll(".item"), len); يجب أن يعرض النقر على زر `#books` مجموعة المنتجات المقابلة في العنصر `#output`. ```js +const books = document.getElementById("books"); +const clothing = document.getElementById("clothing"); +const output = document.getElementById("output"); const len = products.items.length; + assert.isAtLeast(len, 3); let count = 0; products.items.forEach(i => { @@ -446,7 +454,11 @@ assert.lengthOf(output.querySelectorAll(".item"), count); يجب أن يعرض النقر على زر `#electronics` مجموعة المنتجات المقابلة في العنصر `#output`. ```js +const electronics = document.getElementById("electronics"); +const clothing = document.getElementById("clothing"); +const output = document.getElementById("output"); const len = products.items.length; + assert.isAtLeast(len, 3); let count = 0; products.items.forEach(i => { @@ -462,7 +474,11 @@ assert.lengthOf(output.querySelectorAll(".item"), count); يجب أن يعرض النقر على زر `#clothing` مجموعة المنتجات المقابلة في العنصر `#output`. ```js +const books = document.getElementById("books"); +const clothing = document.getElementById("clothing"); +const output = document.getElementById("output"); const len = products.items.length; + assert.isAtLeast(len, 3); let count = 0; products.items.forEach(i => { @@ -478,6 +494,7 @@ assert.lengthOf(output.querySelectorAll(".item"), count); يجب أن تكون كل المنتجات مرئية افتراضيًا عند تحميل الصفحة. استخدم حدث `DOMContentLoaded` لضمان ذلك. ```js +const output = document.getElementById("output"); const len = products.items.length; assert.isAtLeast(len, 3); document.dispatchEvent(new Event("DOMContentLoaded")); diff --git a/curriculum/challenges/arabic/blocks/lab-reusable-footer/673b02b03134b04637bf7055.md b/curriculum/challenges/arabic/blocks/lab-reusable-footer/673b02b03134b04637bf7055.md index 4cb41e14308..8695bd02a06 100644 --- a/curriculum/challenges/arabic/blocks/lab-reusable-footer/673b02b03134b04637bf7055.md +++ b/curriculum/challenges/arabic/blocks/lab-reusable-footer/673b02b03134b04637bf7055.md @@ -8,7 +8,7 @@ demoType: onClick # --description-- -**الهدف:** نفذ قصص المستخدم أدناه واجعل جميع الاختبارات تنجح لإكمال المختبر. +**الهدف:** إكمال قصص المستخدم أدناه واجتياز جميع الاختبارات لإتمام المختبر. **قصص المستخدم:** @@ -53,7 +53,7 @@ assert.lengthOf(document.getElementById('root').children, 1); assert.isAtLeast(document.querySelectorAll('ul').length, 3); ``` -يجب أن تحتوي كل قائمة غير مرتبة على عنصرين على الأقل. +يجب أن تحتوي كل قائمة غير مرتبة على عنصرين على الأقل من عناصر القائمة. ```js const uls = [...document.querySelectorAll('ul')]; @@ -84,7 +84,7 @@ const links = document.querySelectorAll('a[href="#"]'); assert.isAtLeast(links.length, 3); ``` -يجب ألا يكون أي من روابطك فارغًا. +يجب ألا تكون روابطك فارغة. ```js const links = [...document.querySelectorAll('a[href="#"]')]; diff --git a/curriculum/challenges/arabic/blocks/lab-sentence-maker/66c057041df6394ca796bf33.md b/curriculum/challenges/arabic/blocks/lab-sentence-maker/66c057041df6394ca796bf33.md index fab281511cc..3a7e26d0fa2 100644 --- a/curriculum/challenges/arabic/blocks/lab-sentence-maker/66c057041df6394ca796bf33.md +++ b/curriculum/challenges/arabic/blocks/lab-sentence-maker/66c057041df6394ca796bf33.md @@ -7,7 +7,7 @@ dashedName: build-a-sentence-maker # --description-- -في هذا المختبر، ستنشئ قصتين مختلفتين باستخدام قالب جملة. ستستخدم المتغيرات لتخزين أجزاء مختلفة من القصة ثم تعرض القصص في وحدة التحكم. +في هذا المختبر، ستنشئ قصتين مختلفتين باستخدام قالب جملة. ستستخدم المتغيرات لتخزين أجزاء مختلفة من القصة ثم تسجل القصص في وحدة التحكم. **الهدف:** إكمال قصص المستخدم أدناه واجتياز جميع الاختبارات لإتمام المختبر. @@ -26,19 +26,26 @@ dashedName: build-a-sentence-maker 1. يجب إعلان متغير `firstStory`. -1. يجب عليك استخدام قالب القصة التالي لإنشاء القصة الأولى وتعيينها إلى المتغير `firstStory`: `"Once upon a time, there was a(n) [adjective] [noun] who loved to eat [noun2]. The [noun] lived in a [place] and had [adjective2] nostrils that blew fire when it was [verb]."`; +1. يجب عليك استخدام قالب القصة التالي لإنشاء القصة الأولى وتعيينها إلى المتغير `firstStory`: `"Once upon a time, there was a(n) [adjective] [noun] who loved to eat [noun2]. The [noun] lived in a [place] and had [adjective2] nostrils that blew fire when it was [verb]."` -1. يجب عرض قصتك الأولى في وحدة التحكم باستخدام الرسالة `"First story: [firstStory]"`. +1. يجب عليك تسجيل قصتك الأولى في وحدة التحكم باستخدام الرسالة `"First story: [firstStory]"`. 1. يجب تعيين قيم جديدة للمتغيرات `adjective`، `noun`، `verb`، `place`، `adjective2`، و `noun2`. 1. يجب إعلان متغير `secondStory`. -1. أنشئ قصة أخرى باستخدام نفس القالب وعيّنها إلى المتغير `secondStory`. +1. يجب عليك إنشاء قصة أخرى باستخدام نفس القالب وتعيينها إلى المتغير `secondStory`. -1. يجب عرض قصتك الثانية في وحدة التحكم باستخدام الرسالة `"Second story: [secondStory]"`. +1. يجب عليك تسجيل قصتك الثانية في وحدة التحكم باستخدام الرسالة `"Second story: [secondStory]"`. +# --before-each-- + +```js +const spy = __helpers.spyOn(console, 'log'); +const getLogs = () => spy.calls.map(call => call.join(' ')); +``` + # --hints-- يجب إعلان متغير `adjective`. @@ -142,12 +149,10 @@ assert.match( ); ``` -يجب تسجيل قصتك الأولى باستخدام الرسالة `"First story: [firstStory]"`. +يجب عليك تسجيل قصتك الأولى في وحدة التحكم باستخدام الرسالة `"First story: [firstStory]"`. ```js -const condition1 = /console\.log\(\s*["']First\s+story:\s+["']\s*\+\s*firstStory\s*\);?/gm.test(code); -const condition2 = /console\.log\(\s*`First\s+story:\s+\$\{firstStory\}`\s*\);?/gm.test(code); -assert.isTrue(condition1 || condition2); +assert.include(getLogs(), `First story: ${firstStory}`); ``` يجب إعلان متغير `secondStory`. @@ -208,15 +213,13 @@ assert.match( ); ``` -يجب تسجيل قصتك الثانية باستخدام الصيغة `"Second story: [secondStory]"`. +يجب عليك تسجيل قصتك الثانية في وحدة التحكم باستخدام الرسالة `"Second story: [secondStory]"`. ```js -const condition1 = /console\.log\(\s*["']Second\s+story:\s+["']\s*\+\s*secondStory\s*\);?/gm.test(code); -const condition2 = /console\.log\(\s*`Second\s+story:\s+\$\{secondStory\}`\s*\);?/gm.test(code); -assert.isTrue(condition1 || condition2); +assert.include(getLogs(), `Second story: ${secondStory}`); ``` -يجب ألا تكون القصة `firstStory` هي نفسها القصة `secondStory`. +يجب ألا تكون `firstStory` هي نفسها `secondStory`. ```js assert.notEqual(firstStory, secondStory); diff --git a/curriculum/challenges/arabic/blocks/lab-weather-app/66f12a88741aeb16b9246c59.md b/curriculum/challenges/arabic/blocks/lab-weather-app/66f12a88741aeb16b9246c59.md index 84a379f9039..10530076d68 100644 --- a/curriculum/challenges/arabic/blocks/lab-weather-app/66f12a88741aeb16b9246c59.md +++ b/curriculum/challenges/arabic/blocks/lab-weather-app/66f12a88741aeb16b9246c59.md @@ -333,7 +333,7 @@ assert.strictEqual( ); ``` -داخل عنصر `select` يجب أن يكون هناك 6 عناصر `option`، واحدة لكل من المدن التالية: باريس، لندن، طوكيو، لوس أنجلوس، شيكاغو، نيويورك. +بالإضافة إلى الخيار الأول الفارغ، يجب أن يحتوي عنصر `select` على 6 عناصر `option`، واحدة لكل من المدن التالية: باريس، لندن، طوكيو، لوس أنجلوس، شيكاغو، نيويورك. ```js ['Paris', 'London', 'Tokyo', 'Los Angeles', 'Chicago', 'New York'].forEach( @@ -342,7 +342,7 @@ assert.strictEqual( `select > option[value="${city.toLowerCase()}"]` ); assert.exists(el); - assert.strictEqual(el.innerText.trim(), city); + assert.strictEqual(el.textContent.trim(), city); } ); ``` diff --git a/curriculum/challenges/arabic/blocks/learn-about-speculation-and-requests/67eff6af42e8c425d9ff28e3.md b/curriculum/challenges/arabic/blocks/learn-about-speculation-and-requests/67eff6af42e8c425d9ff28e3.md index 7fef960206e..f9f17a6815e 100644 --- a/curriculum/challenges/arabic/blocks/learn-about-speculation-and-requests/67eff6af42e8c425d9ff28e3.md +++ b/curriculum/challenges/arabic/blocks/learn-about-speculation-and-requests/67eff6af42e8c425d9ff28e3.md @@ -10,7 +10,7 @@ lang: en-US # --instructions-- -استمع إلى الصوت وأكمل الجملة أدناه. +استمع إلى التسجيل الصوتي وأكمل الجملة أدناه. # --fillInTheBlank-- diff --git a/curriculum/challenges/arabic/blocks/learn-basic-css-by-building-a-cafe-menu/5f3ef6e03d719d5ac4738993.md b/curriculum/challenges/arabic/blocks/learn-basic-css-by-building-a-cafe-menu/5f3ef6e03d719d5ac4738993.md index fa9a2e8c0e2..c8775b83293 100644 --- a/curriculum/challenges/arabic/blocks/learn-basic-css-by-building-a-cafe-menu/5f3ef6e03d719d5ac4738993.md +++ b/curriculum/challenges/arabic/blocks/learn-basic-css-by-building-a-cafe-menu/5f3ef6e03d719d5ac4738993.md @@ -7,7 +7,7 @@ dashedName: step-56 # --description-- -العرض الحالي للقائمة سيشغل دائمًا 80% من عرض عنصر `body`. على شاشة واسعة جدًا، يظهر القهوة والحلوى بعيدين عن أسعارهم. +العرض الحالي للقائمة سيأخذ دائمًا `80%` من عرض عنصر الـ `body`. على شاشة واسعة جدًا، تظهر القهوة والحلويات متباعدة كثيرًا عن أسعارها. أضف خاصية `max-width` إلى صنف `menu` بقيمة `500px` لمنع اتساعه أكثر من اللازم. diff --git a/curriculum/challenges/arabic/blocks/learn-how-to-plan-future-events/67531709d628ef047202e6ae.md b/curriculum/challenges/arabic/blocks/learn-how-to-plan-future-events/67531709d628ef047202e6ae.md index c6d7330727d..bb2696f4d3d 100644 --- a/curriculum/challenges/arabic/blocks/learn-how-to-plan-future-events/67531709d628ef047202e6ae.md +++ b/curriculum/challenges/arabic/blocks/learn-how-to-plan-future-events/67531709d628ef047202e6ae.md @@ -12,7 +12,7 @@ lang: en-US # --assignment-- -شاهد الفيديو.. +شاهد الفيديو. # --scene-- diff --git a/curriculum/challenges/arabic/blocks/learn-present-perfect-while-talking-about-accessibility/671b98e9b7c4854e93044e64.md b/curriculum/challenges/arabic/blocks/learn-present-perfect-while-talking-about-accessibility/671b98e9b7c4854e93044e64.md index 52d62aa36da..18ec77ab24e 100644 --- a/curriculum/challenges/arabic/blocks/learn-present-perfect-while-talking-about-accessibility/671b98e9b7c4854e93044e64.md +++ b/curriculum/challenges/arabic/blocks/learn-present-perfect-while-talking-about-accessibility/671b98e9b7c4854e93044e64.md @@ -62,7 +62,7 @@ lang: en-US "startTime": 5.34, "finishTime": 9.26, "dialogue": { - "text": "Yes, for some reason it hasn't been displaying correctly for some users.", + "text": "Yes. For some reason, it hasn't been displaying correctly for some users.", "align": "right" } }, diff --git a/curriculum/challenges/arabic/blocks/learn-present-perfect-while-talking-about-accessibility/671f403c1d4e8a5e046065a0.md b/curriculum/challenges/arabic/blocks/learn-present-perfect-while-talking-about-accessibility/671f403c1d4e8a5e046065a0.md index 7d33f94995e..127943c40e4 100644 --- a/curriculum/challenges/arabic/blocks/learn-present-perfect-while-talking-about-accessibility/671f403c1d4e8a5e046065a0.md +++ b/curriculum/challenges/arabic/blocks/learn-present-perfect-while-talking-about-accessibility/671f403c1d4e8a5e046065a0.md @@ -6,17 +6,17 @@ dashedName: task-36 lang: en-US --- -<!-- (Audio) James: Yes. For some reason, It hasn't been displaying correctly for some users. --> +<!-- (Audio) James: Yes. For some reason, it hasn't been displaying correctly for some users. --> # --instructions-- -استمع إلى الصوت وأكمل الجملة أدناه. +استمع إلى التسجيل الصوتي وأكمل الجملة أدناه. # --fillInTheBlank-- ## --sentence-- -`Yes. For some reason, It BLANK BLANK BLANK correctly for some users.` +`Yes. For some reason, it BLANK BLANK BLANK correctly for some users.` ## --blanks-- @@ -83,7 +83,7 @@ lang: en-US "startTime": 1, "finishTime": 4.92, "dialogue": { - "text": "Yes, for some reason it hasn't been displaying correctly for some users.", + "text": "Yes. For some reason, it hasn't been displaying correctly for some users.", "align": "center" } }, diff --git a/curriculum/challenges/arabic/blocks/learn-present-perfect-while-talking-about-accessibility/671f456994635c6085054cbd.md b/curriculum/challenges/arabic/blocks/learn-present-perfect-while-talking-about-accessibility/671f456994635c6085054cbd.md index b6826b4187e..40fd3961869 100644 --- a/curriculum/challenges/arabic/blocks/learn-present-perfect-while-talking-about-accessibility/671f456994635c6085054cbd.md +++ b/curriculum/challenges/arabic/blocks/learn-present-perfect-while-talking-about-accessibility/671f456994635c6085054cbd.md @@ -6,17 +6,17 @@ dashedName: task-37 lang: en-US --- -<!-- (Audio) James: Yes. For some reason, It hasn't been displaying correctly for some users. --> +<!-- (Audio) James: Yes. For some reason, it hasn't been displaying correctly for some users. --> # --instructions-- -استمع إلى الصوت وأكمل الجملة أدناه. +استمع إلى التسجيل الصوتي وأكمل الجملة أدناه. # --fillInTheBlank-- ## --sentence-- -`Yes. For some reason, It hasn't been displaying BLANK for some BLANK.` +`Yes. For some reason, it hasn't been displaying BLANK for some BLANK.` ## --blanks-- @@ -79,7 +79,7 @@ lang: en-US "startTime": 1, "finishTime": 4.92, "dialogue": { - "text": "Yes, for some reason it hasn't been displaying correctly for some users.", + "text": "Yes. For some reason, it hasn't been displaying correctly for some users.", "align": "center" } }, diff --git a/curriculum/challenges/arabic/blocks/learn-present-perfect-while-talking-about-accessibility/6720cf38beae8c4f1d7af1c0.md b/curriculum/challenges/arabic/blocks/learn-present-perfect-while-talking-about-accessibility/6720cf38beae8c4f1d7af1c0.md index 559df416af5..39e513b5a4e 100644 --- a/curriculum/challenges/arabic/blocks/learn-present-perfect-while-talking-about-accessibility/6720cf38beae8c4f1d7af1c0.md +++ b/curriculum/challenges/arabic/blocks/learn-present-perfect-while-talking-about-accessibility/6720cf38beae8c4f1d7af1c0.md @@ -22,7 +22,7 @@ lang: en-US `Alice: James, have you heard about the BLANK on our video platform?` -`James: Yes. For some reason, It hasn't been BLANK for some users. The captions are misaligned and BLANK, which isn't good for accessibility.` +`James: Yes. For some reason, it hasn't been BLANK for some users. The captions are misaligned and BLANK, which isn't good for accessibility.` `Alice: Exactly. Do you know if it's been affecting all the videos or just a few?` diff --git a/curriculum/challenges/arabic/blocks/lecture-css-specificity-the-cascade-algorithm-and-inheritance/672aa62178d5ff57fe4f98e0.md b/curriculum/challenges/arabic/blocks/lecture-css-specificity-the-cascade-algorithm-and-inheritance/672aa62178d5ff57fe4f98e0.md index 7cc8789c22f..770fa7de818 100644 --- a/curriculum/challenges/arabic/blocks/lecture-css-specificity-the-cascade-algorithm-and-inheritance/672aa62178d5ff57fe4f98e0.md +++ b/curriculum/challenges/arabic/blocks/lecture-css-specificity-the-cascade-algorithm-and-inheritance/672aa62178d5ff57fe4f98e0.md @@ -43,14 +43,14 @@ p { ```html <link rel="stylesheet" href="styles.css"> -<p id="para">Red paragraph</p> +<p id="para-1">Red paragraph</p> <p>Other paragraph</p> <p>Another paragraph</p> <p>Yet another paragraph</p> ``` ```css -#para { +#para-1 { color: red; } @@ -67,24 +67,33 @@ p { **ملاحظة**: ستتعلم المزيد عن الفئات المزيفة في الدروس القادمة. -في هذا المثال، ستكون الفقرة الأولى باللون الأحمر لأن محدد المعرف له خصوصية أعلى من الصنف ومحددات النوع. عناصر `.example-para` ستكون باللون الأخضر بينما بقية عناصر الفقرة ستكون باللون الأزرق. +في هذا المثال: + +- سيكون الفقرة الأولى باللون الأحمر لأن محدد المعرف له أولوية أعلى من محددات الأصناف ومحددات النوع. +- الفقرة الثانية التي تحتوي على محدد صنف `.example-para` سيكون لونها أخضر. +- الفقرة الثالثة التي تحتوي على كل من محدد معرف `#para-3` ومحدد صنف `.example-para` سيكون لونها بنفسجي. +- العنصر الفقري المتبقي سيكون لونه أزرق. :::interactive_editor ```html <link rel="stylesheet" href="styles.css"> -<p id="para">Example paragraph</p> +<p id="para-1">Example paragraph</p> <p class="example-para">Other paragraph</p> -<p class="example-para">Another paragraph</p> +<p id="para-3" class="example-para">Another paragraph</p> <p>Yet another paragraph</p> ``` ```css -#para { +#para-1 { color: red; } +#para-3 { + color: purple; +} + .example-para { color: green; } @@ -105,13 +114,13 @@ p { ```html <link rel="stylesheet" href="styles.css"> -<p id="para">Example paragraph</p> +<p id="para-1">Example paragraph</p> <p>Other paragraph</p> <p>Yet another paragraph</p> ``` ```css -#para { +#para-1 { color: red; } @@ -130,7 +139,7 @@ p { ```html <link rel="stylesheet" href="styles.css"> -<p id="para">Example paragraph</p> +<p id="para-1">Example paragraph</p> <p>Other paragraph</p> <p>Yet another paragraph</p> ``` @@ -140,7 +149,7 @@ p { color: red; } -#para { +#para-1 { color: green; } @@ -330,7 +339,7 @@ p { ### --feedback-- -اعتبر أعلى خصوصية. +ضع في اعتبارك أعلى قيمة خصوصية. --- @@ -338,7 +347,7 @@ p { ### --feedback-- -اعتبر أعلى خصوصية. +ضع في اعتبارك أعلى قيمة خصوصية. --- @@ -346,7 +355,7 @@ p { ### --feedback-- -اعتبر أعلى خصوصية. +ضع في اعتبارك أعلى قيمة خصوصية. ## --video-solution-- diff --git a/curriculum/challenges/arabic/blocks/lecture-express-middleware/69f42d414b7626e21a922794.md b/curriculum/challenges/arabic/blocks/lecture-express-middleware/69f42d414b7626e21a922794.md index 84a8ae20f40..aa06b3be683 100644 --- a/curriculum/challenges/arabic/blocks/lecture-express-middleware/69f42d414b7626e21a922794.md +++ b/curriculum/challenges/arabic/blocks/lecture-express-middleware/69f42d414b7626e21a922794.md @@ -9,9 +9,7 @@ dashedName: what-is-error-handling-middleware برمجيات وسيطة لمعالجة الأخطاء في Express هي نوع خاص من البرمجيات الوسيطة تُستخدم لمعالجة الأخطاء التي تحدث أثناء دورة الطلب والاستجابة. هي ضرورية لالتقاط الأخطاء غير المتوقعة، وتسجيلها، وتوفير استجابات مناسبة للعميل. -كما رأيت في درس سابق تحت معالجة الأخطاء، تحتوي برمجيات وسيطة معالجة الأخطاء في Express على أربع معلمات: `err`، `req`، `res`، و `next`. تُستدعى هذه البرمجيات الوسيطة عندما يُمرر خطأ إلى الدالة `next()`. - -إليك تذكيرًا بصيغة النحو مرة أخرى: +برمجيات Express الوسيطة لمعالجة الأخطاء تحتوي على أربع معلمات: `err`، `req`، `res`، و `next`. تُستدعى هذه البرمجيات الوسيطة عندما يُمرر خطأ إلى الدالة `next()`. هذه هي الصيغة النحوية: ```js app.use((err, req, res, next) => { diff --git a/curriculum/challenges/arabic/blocks/lecture-express-middleware/69f42d414b7626e21a922795.md b/curriculum/challenges/arabic/blocks/lecture-express-middleware/69f42d414b7626e21a922795.md index cdf492bf116..0093ef10bf3 100644 --- a/curriculum/challenges/arabic/blocks/lecture-express-middleware/69f42d414b7626e21a922795.md +++ b/curriculum/challenges/arabic/blocks/lecture-express-middleware/69f42d414b7626e21a922795.md @@ -13,45 +13,45 @@ dashedName: what-are-examples-of-built-in-and-3rd-party-middleware 1. `express.json()`: برمجية وسيطة مدمجة تقوم بتحليل الحمولة الواردة بصيغة JSON. -```js -app.use(express.json()) -``` + ```js + app.use(express.json()) + ``` 1. `express.static()`: برمجية وسيطة لتقديم الملفات الثابتة مثل الصور وملفات CSS وJavaScript. -```js -app.use(express.static('public')) -``` + ```js + app.use(express.static('public')) + ``` 1. `express.urlencoded()`: برمجية وسيطة تحلل الطلبات الواردة التي تحتوي على حمولة مشفرة بصيغة URL، وهو التنسيق الذي ترسله عادة نماذج HTML. تجعل البيانات المحللة متاحة في `req.body`. -```js -app.use(express.urlencoded({ extended: true })) -``` + ```js + app.use(express.urlencoded({ extended: true })) + ``` **والآن، إليك بعض الأمثلة على البرمجيات الوسيطة التابعة لأطراف ثالثة:** 1. `cors`: برمجية وسيطة شهيرة تابعة لأطراف ثالثة لتمكين مشاركة الموارد عبر الأصول المختلفة. -```bash -npm install cors -``` + ```bash + npm install cors + ``` -```js -const cors = require('cors') -app.use(cors()) -``` + ```js + const cors = require('cors') + app.use(cors()) + ``` 1. `morgan`: برمجية وسيطة لتسجيل طلبات HTTP. -```bash -npm install morgan -``` + ```bash + npm install morgan + ``` -```js -const morgan = require('morgan') -app.use(morgan('tiny')) -``` + ```js + const morgan = require('morgan') + app.use(morgan('tiny')) + ``` الآن، لننظر إلى مثال على استخدام كل من البرمجيات الوسيطة المدمجة وتلك التابعة لأطراف ثالثة: diff --git a/curriculum/challenges/arabic/blocks/lecture-importance-of-semantic-html/672990ecf71a852804ababe7.md b/curriculum/challenges/arabic/blocks/lecture-importance-of-semantic-html/672990ecf71a852804ababe7.md index 63e5194a450..606ca6bbe59 100644 --- a/curriculum/challenges/arabic/blocks/lecture-importance-of-semantic-html/672990ecf71a852804ababe7.md +++ b/curriculum/challenges/arabic/blocks/lecture-importance-of-semantic-html/672990ecf71a852804ababe7.md @@ -11,6 +11,10 @@ dashedName: what-is-the-difference-between-presentational-and-semantic-html العديد من عناصر HTML التقديمية أصبحت مهجورة، وهذا يعني أنها قديمة ولم تعد موصى بها. هناك طرق أفضل للحصول على نفس النتائج. مع ذلك، من المفيد معرفة وجودها، لذا سنلقي نظرة على بعض الأمثلة. +## عناصر HTML التقديمية + +### عنصر `font` + عنصر `font` هو عنصر مهجور يُستخدم لتعيين حجم الخط ولون النص. إليك مثالًا على عنصر `font`. فعّل المحرر التفاعلي وغيّر الحجم من 5 إلى 7 لترى زيادة حجم الخط. @@ -27,6 +31,8 @@ dashedName: what-is-the-difference-between-presentational-and-semantic-html رغم أن هذا العنصر لا يزال يعمل، يجب ألا تستخدمه لأن حجم الخط ولونه يجب أن يُحددا دائمًا في CSS، وليس في HTML. +### عنصر `center` + عنصر `center` هو عنصر مهجور آخر يُستخدم لمركزة المحتوى أفقيًا داخل الحاوية الخاصة به. إليك مثالًا على عنصر `center` يحتوي على نص وعنصر فقرة. فعّل المحرر التفاعلي وأضف وسم `center` حول `<p>Another example text.</p>` لترى النص مركّزًا في الصفحة. @@ -44,6 +50,8 @@ dashedName: what-is-the-difference-between-presentational-and-semantic-html ::: +### عنصر `big` + بعد ذلك، لدينا عنصر `big`. هذا عنصر HTML تقديمي مهجور آخر يجعل النص المحاط به أكبر بمستوى واحد من النص المحيط. هنا مثال يعرّف فقرة تحتوي على جزأين. فعّل المحرر التفاعلي وأضف وسم `big` حول `Some other text` لترى التغييرات في نافذة المعاينة. @@ -64,6 +72,8 @@ dashedName: what-is-the-difference-between-presentational-and-semantic-html كانت هذه أمثلة على عناصر HTML التقديمية. لكنها جميعًا مهجورة ولم تعد موصى بها. فماذا يجب أن تستخدم بدلًا منها؟ لنرَ. +## HTML الدلالي + HTML الدلالي هو الآن الممارسة الموصى بها. يصف محتوى العناصر، لذا يصبح من الأسهل قراءته وفهمه وصيانته. يمكن لمحركات البحث فهم موقعك بسهولة عند استخدام HTML الدلالي. كما أنه مفيد لأغراض إمكانية الوصول، لأن قارئات الشاشة تحتاج إلى معلومات دلالية لوصف ما يوجد في صفحة الويب. @@ -75,6 +85,8 @@ HTML الدلالي هو الآن الممارسة الموصى بها. يصف - عنصر `section` لتجميع المعلومات ذات الصلة. - عنصر `figure` للرسوم التوضيحية والمخططات. +### مثال على HTML الدلالي + هذا مثال على عنصر `header` يحتوي على عنصر قسم ملاحي. فعّل المحرر التفاعلي وأضف `<a href="#">Products</a>` داخل `nav` لترى التغييرات في نافذة المعاينة. @@ -97,6 +109,8 @@ HTML الدلالي هو الآن الممارسة الموصى بها. يصف تُظهر العناصر الدلالية بوضوح غرضها داخل هيكل HTML. هناك العديد من عناصر HTML الدلالية المختلفة. ستجد بالتأكيد ما يناسب احتياجات مشروعك. +## ملخص + عمل رائع. الآن تعرف الفرق بين HTML التقديمي وHTML الدلالي: HTML الدلالي يصف المحتوى، بينما HTML التقديمي يركز على المظهر. # --questions-- diff --git a/curriculum/challenges/arabic/blocks/lecture-introduction-to-javascript-libraries-and-frameworks/6734e88cc46e6dc679420040.md b/curriculum/challenges/arabic/blocks/lecture-introduction-to-javascript-libraries-and-frameworks/6734e88cc46e6dc679420040.md index 3dee0e268e7..f7db55a75f7 100644 --- a/curriculum/challenges/arabic/blocks/lecture-introduction-to-javascript-libraries-and-frameworks/6734e88cc46e6dc679420040.md +++ b/curriculum/challenges/arabic/blocks/lecture-introduction-to-javascript-libraries-and-frameworks/6734e88cc46e6dc679420040.md @@ -13,7 +13,7 @@ dashedName: what-is-vite-and-how-can-it-be-used-to-set-up-a-new-react-project لإنشاء مشروع جديد باستخدام Vite، ستحتاج إلى استخدام سطر الأوامر. إذا كنت تستخدم جهاز ويندوز، يمكنك استخدام موجه الأوامر أو Windows PowerShell. وإذا كنت تستخدم جهاز ماك، فاستخدم تطبيق Terminal. -في حال لم يكن Node.js مثبتًا لديك، وهو ضروري لعمل npm، إليك رابط الصفحة الرسمية لـ Node.js: https://nodejs.org. اتبع تعليمات التثبيت ثم عد هنا لاستكمال تثبيت React. +إذا لم يكن لديك Node.js مثبتًا، وهو ضروري لعمل npm، فإليك رابط الصفحة الرسمية لـ Node.js: [nodejs.org](https://nodejs.org). اتبع تعليمات التثبيت، ثم عد هنا لاستكمال تثبيت React. بمجرد فتح سطر الأوامر، يمكنك استخدام الأمر التالي: @@ -36,7 +36,7 @@ npm install يضمن أمر `cd my-react-app` تغيير الدليل إلى المكان الصحيح حيث يوجد مشروعك. -يُستخدم أمر `npm install` لتثبيت التبعيات اللازمة لتشغيل مشروع React الخاص بك بشكل صحيح. التبعيات هي مكتبات أو حزم يحتاجها مشروع React ليعمل بشكل صحيح، مثل React نفسه، ReactDOM، أو حزم طرف ثالث توفر وظائف إضافية. +تُستخدم الأمر `npm install` لتثبيت التبعيات اللازمة لتشغيل مشروع React بشكل صحيح. التبعيات هي مكتبات أو حزم يحتاجها مشروع React ليعمل بشكل سليم، مثل React نفسه، و`react-dom`، أو حزم طرف ثالث أخرى توفر وظائف إضافية. عند تشغيل `npm install`، سيقرأ ملف `package.json` في دليل مشروعك ويثبت كل التبعيات المدرجة هناك، مما يسمح لك ببناء وتشغيل تطبيق React دون فقدان أي مكونات ضرورية. @@ -50,11 +50,11 @@ npm install يجب أن ترى قالب البداية الذي وفره لك Vite. -إذا احتجت إلى إيقاف الخادم المحلي، اضغط `CTRL + C` في سطر الأوامر. +إذا احتجت إلى إيقاف الخادم المحلي، اضغط `Ctrl + C` في سطر الأوامر. -لمشاهدة شفرة هذا القالب المبدئي، يمكنك الدخول إلى مشروعك داخل مجلد `src` وستجد ملف `App.jsx`. +لمشاهدة شفرة قالب البداية هذا، افتح مجلد `src` داخل مشروعك، حيث يجب أن تجد ملف `App.jsx`. -من هناك يمكنك البدء بتعديل الملف، حفظ التغييرات، ورؤية التحديثات الجديدة تظهر في المتصفح. +من هناك يمكنك تعديل الملف، حفظ التغييرات، ومراقبة ظهورها في المتصفح. وبذلك، أنت جاهز لبدء بناء تطبيق React الخاص بك! diff --git a/curriculum/challenges/arabic/blocks/lecture-introduction-to-javascript/672d49959621885e9d3e672c.md b/curriculum/challenges/arabic/blocks/lecture-introduction-to-javascript/672d49959621885e9d3e672c.md index 5960a9e4128..4457c692ecc 100644 --- a/curriculum/challenges/arabic/blocks/lecture-introduction-to-javascript/672d49959621885e9d3e672c.md +++ b/curriculum/challenges/arabic/blocks/lecture-introduction-to-javascript/672d49959621885e9d3e672c.md @@ -72,6 +72,16 @@ console.log(age); // 25 ::: +بينما يمكن إعادة تعيين متغير مُعلن باستخدام `let`، لا يمكن إعادة إعلانه. إذا حاولت إعلان نفس المتغير مرة أخرى باستخدام `let`، ستحصل على خطأ: + +```js +let age = 25; + +let age = 90; // SyntaxError: Identifier 'age' has already been declared +``` + +ينطبق نفس الأمر على `const`: لا يمكن إعادة إعلان متغير مُعلن باستخدام `const` أيضًا. + يجب تعيين قيمة للمتغيرات المُعلنة بـ `const` عند وقت الإعلان. إذا حاولت إعلان متغير `const` بدون تعيين قيمة، ستحصل على خطأ: ```js diff --git a/curriculum/challenges/arabic/blocks/lecture-understanding-aria-expanded-aria-live-and-common-aria-states/672a54dff9dc439089f1a219.md b/curriculum/challenges/arabic/blocks/lecture-understanding-aria-expanded-aria-live-and-common-aria-states/672a54dff9dc439089f1a219.md index 2fa0de21db4..551c3b28edc 100644 --- a/curriculum/challenges/arabic/blocks/lecture-understanding-aria-expanded-aria-live-and-common-aria-states/672a54dff9dc439089f1a219.md +++ b/curriculum/challenges/arabic/blocks/lecture-understanding-aria-expanded-aria-live-and-common-aria-states/672a54dff9dc439089f1a219.md @@ -15,6 +15,8 @@ dashedName: what-is-the-aria-live-attribute هناك ثلاث قيم ممكنة لهذه الخاصية، تعتمد على أولوية المعلومات. +## القيمة `assertive` + إذا ضبطت `aria-live` على القيمة `assertive` فهذا يعني أن التحديث مهم جدًا. له أعلى أولوية، لذا يجب إخطار المستخدم فورًا. هذا يعني أن قارئ الشاشة سيقطع أي إعلان يجريه حاليًا ليعلن عن تغيير المحتوى في المنطقة الحية. يمكن أن تكون هذه الانقطاعات مزعجة للغاية، لذا يجب استخدام القيمة `assertive` فقط للإشعارات الحساسة للوقت أو الحرجة. @@ -81,6 +83,8 @@ document.addEventListener("DOMContentLoaded", () => { ::: +## القيمة `polite` + القيمة التالية حسب الأولوية هي `polite`. تعني هذه القيمة أن التحديث غير عاجل، لذا يمكن لقارئ الشاشة الانتظار حتى ينتهي من الإعلان الحالي أو حتى يتوقف المستخدم عن الكتابة قبل إعلان التحديث. معظم المناطق الحية تستخدم القيمة `polite`. @@ -147,10 +151,16 @@ document.addEventListener("DOMContentLoaded", () => { ::: +## القيمة `off` + أدنى قيمة أولوية لـ `aria-live` هي `off`، والتي تعني أن التحديث لن يُعلن عنه إلا إذا كان المحتوى في عنصر يملك تركيز لوحة المفاتيح حاليًا. عمليًا، نادرًا ما تُستخدم هذه القيمة لأن حالة الاستخدام ضيقة جدًا ولا تُنفذ بشكل متسق (إن وُجدت) عبر قارئات الشاشة. إذا كنت تحتاج إلى مناطق حية، خطط لاستخدام `polite` لكل شيء ما عدا الرسائل الحرجة التي تحتاج `assertive`. +## مناطق البث الحي الافتراضية من أدوار ARIA + من المهم أيضًا ملاحظة أن الخاصية `aria-live` ليست مطلوبة إذا كانت المعلومات المحدثة موجودة في عنصر له دور ARIA مثل `alert`، `log`، `marquee`، `status`، أو `timer`، إذ أن هذه الأدوار لها قيم `aria-live` افتراضية. لكن يمكن تغيير القيمة الافتراضية بتعيين `aria-live` صراحة على العنصر. +## اختيار القيمة المناسبة + اختيار القيمة المناسبة لـ `aria-live` يعتمد على أولوية المعلومات المحدثة. إذا كانت التحديثات عاجلة، يجب إخطار المستخدم فورًا باستخدام `assertive`. لكن يجب استخدام هذا فقط إذا كانت التحديثات عاجلة حقًا لأن الانقطاعات المفاجئة قد تشتت المستخدمين وتؤثر على تجربة الاستخدام. diff --git a/curriculum/challenges/arabic/blocks/lecture-understanding-computer-internet-and-tooling-basics/672aa578a2129554d4675049.md b/curriculum/challenges/arabic/blocks/lecture-understanding-computer-internet-and-tooling-basics/672aa578a2129554d4675049.md index 83bb63aafff..7aea513296f 100644 --- a/curriculum/challenges/arabic/blocks/lecture-understanding-computer-internet-and-tooling-basics/672aa578a2129554d4675049.md +++ b/curriculum/challenges/arabic/blocks/lecture-understanding-computer-internet-and-tooling-basics/672aa578a2129554d4675049.md @@ -11,13 +11,13 @@ dashedName: what-are-the-basic-parts-of-a-computer كمطوِّر، من المهم أن تفهم كيفية عمل الكمبيوتر الأساسية من الداخل. -أول مكوِّن رئيسي في الكمبيوتر هو اللوحة الأم. تحتفظ اللوحة الأم بكل الذاكرة والموصلات اللازمة لتشغيل الكمبيوتر. تعمل كلوحة الدوائر الرئيسية للكمبيوتر. +المكوِّن الرئيسي الأول في الكمبيوتر هو اللوحة الأم. تحتفظ اللوحة الأم بكل الذاكرة والموصلات اللازمة لتشغيل الكمبيوتر. تعمل كلوحة الدوائر الرئيسية للكمبيوتر. -داخل صندوق الكمبيوتر وعلى اللوحة الأم، ستجد وحدة المعالجة المركزية (CPU). وحدة المعالجة المركزية هي المعالج المسؤول عن تنفيذ التعليمات وإجراء الحسابات. غالبًا ما يُشار إليها بأنها عقل الكمبيوتر. +داخل صندوق الكمبيوتر، والمثبتة على اللوحة الأم، ستجد وحدة المعالجة المركزية (CPU). وحدة المعالجة المركزية هي معالج مسؤول عن تنفيذ التعليمات وإجراء الحسابات. غالبًا ما يُشار إليها على أنها دماغ الكمبيوتر. -وحدة المعالجة المركزية عبارة عن مربع صغير يحتوي على شريحة تُركب في مقبس وحدة المعالجة المركزية على اللوحة الأم. سرعة المعالج تُقاس بالجيجاهرتز (GHz) والميجاهرتز (MHz). الجيجاهرتز تعني مليار دورة في الثانية، والميجاهرتز تعني مليون دورة في الثانية. +وحدة المعالجة المركزية هي شريحة مربعة صغيرة توضع في مقبس وحدة المعالجة المركزية على اللوحة الأم. تُقاس سرعة وحدة المعالجة المركزية بالجيجاهرتز (GHz) والميجاهرتز (MHz). الجيجاهرتز تعني مليار دورة في الثانية، والميجاهرتز تعني مليون دورة في الثانية. -المكوِّن الحاسم التالي في الكمبيوتر هو ذاكرة النظام قصيرة الأمد، المعروفة باسم ذاكرة الوصول العشوائي (RAM). RAM هي موقع تخزين مؤقت لوحدة المعالجة المركزية في الكمبيوتر. كلما احتاج الكمبيوتر للوصول إلى بيانات بسرعة، يستخدم RAM. +المكوِّن الحاسم التالي في الكمبيوتر هو ذاكرة النظام قصيرة الأمد. تُعرف هذه باسم ذاكرة الوصول العشوائي (RAM). RAM هي موقع تخزين مؤقت لوحدة المعالجة المركزية في الكمبيوتر. في أي وقت يحتاج فيه الكمبيوتر إلى الوصول إلى البيانات بسرعة، يستخدم RAM. كلما زادت ذاكرة الوصول العشوائي في الكمبيوتر، زادت سرعته وزادت البرامج التي يمكنك تشغيلها في نفس الوقت. إذا كانت ذاكرة الوصول العشوائي منخفضة، سيعمل الكمبيوتر ببطء وستلاحظ الفرق في الأداء. @@ -27,11 +27,11 @@ dashedName: what-are-the-basic-parts-of-a-computer القرص الصلب يتكون من طبق دوار وذراع. الطبق هو مكان تخزين البيانات، والذراع يُستخدم لقراءة وكتابة البيانات على الطبق. كلما كان القرص الصلب أسرع، سيقل وقت إقلاع الكمبيوتر وستعمل برامجك بشكل أسرع. -نوع آخر من تخزين البيانات هو محرك الحالة الصلبة، أو SSD. SSD هو ذاكرة فلاش غير متطايرة ويمكن استخدامه بدلًا من القرص الصلب. محركات SSD أسرع وأصغر من الأقراص الصلبة، لكن الأقراص الصلبة أرخص ولها سعة تخزين أكبر. +نوع آخر من تخزين البيانات هو محرك الحالة الصلبة، أو SSD اختصارًا. SSD هو ذاكرة فلاش غير متطايرة ويمكن استخدامه بدلًا من القرص الصلب. محركات SSD أسرع وأصغر من الأقراص الصلبة، لكن الأقراص الصلبة أرخص ولها سعة تخزين أكبر. مكوِّن رئيسي آخر في الكمبيوتر هو وحدة تزويد الطاقة، أو PSU. PSU مسؤولة عن تحويل الكهرباء من مقبس الحائط إلى شكل يمكن للكمبيوتر استخدامه. ترسل الطاقة من المقبس إلى اللوحة الأم، ووحدة المعالجة المركزية، وباقي مكونات الكمبيوتر. -مكوِّن رئيسي آخر هو بطاقات التوسعة. تُركب هذه البطاقات في اللوحة الأم لإضافة وظائف إضافية للكمبيوتر. أمثلة على بطاقات التوسعة هي بطاقة الفيديو، وبطاقة الصوت، وبطاقة الشبكة. +مكوِّن رئيسي آخر هو بطاقة التوسعة. تُدخل هذه البطاقات في اللوحة الأم لإضافة وظائف إضافية للكمبيوتر. من أمثلة بطاقات التوسعة بطاقة الفيديو، وبطاقة الصوت، وبطاقة الشبكة. بطاقة الفيديو، المعروفة أيضًا بوحدة معالجة الرسومات (GPU)، مسؤولة عن عرض الصور على شاشة الكمبيوتر. diff --git a/curriculum/challenges/arabic/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab82c1a9bbd0e3aabc39d.md b/curriculum/challenges/arabic/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab82c1a9bbd0e3aabc39d.md index 3c3d33217fb..04159498eeb 100644 --- a/curriculum/challenges/arabic/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab82c1a9bbd0e3aabc39d.md +++ b/curriculum/challenges/arabic/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab82c1a9bbd0e3aabc39d.md @@ -7,11 +7,11 @@ dashedName: how-to-effectively-work-with-your-keyboard-mouse-and-other-pointing- # --description-- -لقد اعتدت على العمل بلوحة المفاتيح والفأرة لسنوات طويلة في أنشطة متنوعة مثل الألعاب، أداء مهام العمل، أو تصفح الويب. +لقد عمل الكثير منكم باستخدام لوحة المفاتيح والماوس لسنوات في أنشطة متنوعة مثل الألعاب، وأداء مهام العمل، أو تصفح الويب. لكن سوء استخدام هذه الأجهزة لفترات طويلة قد يؤدي إلى مشاكل صحية خطيرة في المستقبل. -في هذا الدرس، سنغطي طرق العمل مع لوحة المفاتيح والفأرة الخاصة بجهاز الكمبيوتر بطرق صحية. +في هذا الدرس، سنغطي طرق العمل مع لوحة المفاتيح والماوس الخاصة بجهاز الكمبيوتر بطرق صحية. النصيحة الأولى هي الانتباه إلى طريقة إمساك الفأرة. عند العمل على مهام جدية في العمل أو أثناء لحظات الألعاب المكثفة، قد تميل إلى الإمساك بالفأرة بقوة كبيرة. لكن هذا قد يسبب مشاكل خطيرة في اليد والمعصم. لتجنب ذلك، تأكد من إمساك الفأرة بلطف والحفاظ على استرخاء أصابعك. @@ -25,7 +25,7 @@ dashedName: how-to-effectively-work-with-your-keyboard-mouse-and-other-pointing- بينما الحفاظ على وضعية جيدة مهم، تؤكد علميات الراحة الحديثة على أهمية الحركة والجلوس الديناميكي. الجسم البشري مصمم للحركة، والبقاء في وضع ثابت، حتى لو كان مستقيمًا، لفترة طويلة يضغط باستمرار على العمود الفقري. أخذ فترات راحة منتظمة، وتغيير وضعيتك طوال اليوم، والحفاظ على وضع طبيعي للمعصم يساعد على تحسين الدورة الدموية، تقليل التعب، ودعم صحة العمود الفقري على المدى الطويل. -النصيحة الأخيرة هي استخدام اختصارات لوحة المفاتيح كلما أمكن لتقليل الكتابة. هناك العشرات من الاختصارات المتاحة لمهام مثل تصفح الويب، التنقل في نظام التشغيل، العمل داخل محرر الشفرة، وأكثر. لذا من الأفضل البحث عن بعض هذه الاختصارات وبدء دمجها في استخدامك اليومي للكمبيوتر. +النصيحة الأخيرة هي استخدام اختصارات لوحة المفاتيح كلما أمكن لتقليل الحاجة إلى الوصول للماوس. هناك العشرات من الاختصارات المتاحة لمهام مثل التنقل في الويب، والتنقل داخل نظام التشغيل، والعمل داخل محرر الشفرة، وأكثر من ذلك. لذلك، من الأفضل البحث عن بعض هذه الاختصارات وبدء دمجها في استخدامك اليومي للكمبيوتر. أثناء استمرارك في استخدام الفأرة ولوحة المفاتيح في مشاريع البرمجة القادمة وأنشطة أخرى، تذكر أن تضع هذه النصائح الصحية في اعتبارك. @@ -109,7 +109,7 @@ dashedName: how-to-effectively-work-with-your-keyboard-mouse-and-other-pointing- ## --answers-- -يجب أن تكون الفأرة مرتفعة جدًا فوق لوحة المفاتيح. +ارتفاع الماوس لا يهم. ### --feedback-- diff --git a/curriculum/challenges/arabic/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab83c4297910eade53c2e.md b/curriculum/challenges/arabic/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab83c4297910eade53c2e.md index 6c1508102c6..8dabf51d2de 100644 --- a/curriculum/challenges/arabic/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab83c4297910eade53c2e.md +++ b/curriculum/challenges/arabic/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab83c4297910eade53c2e.md @@ -7,13 +7,13 @@ dashedName: what-are-the-different-types-of-internet-service-providers # --description-- -أولًا، ما هو مزود خدمة الإنترنت، أو ISP؟ هو شركة تبيع وصولًا إلى شبكة الإنترنت العالمية، في الأساس. وهناك ثلاثة مستويات مختلفة لهم. +أولًا، ما هو مزود خدمة الإنترنت أو ISP؟ هو في الأساس شركة تبيع وصولًا إلى شبكة الإنترنت العالمية. وهناك ثلاثة مستويات مختلفة منها. -المستوى الأول هو الشركات العملاقة الكبرى، التي تمتلك البنية التحتية للتعامل مع معظم (إن لم يكن كل) حركة مرور شبكتها بشكل مستقل. +المستوى الأول هو شركات التكتل العملاقة، التي تمتلك البنية التحتية للتعامل مع معظم (إن لم يكن كل) حركة مرور شبكتها بشكل مستقل. المستوى الثاني هو المزودون على مستوى الدولة، الذين يستأجرون أحيانًا وصولًا إلى شبكات المستوى الأول لكن يمكنهم الاعتماد على أنفسهم إلى حد كبير. -المستوى الثالث هو الشركات الصغيرة التي تركز بشكل أساسي على توفير الإنترنت للأسواق المحلية، وتعتمد على مزودي خدمة الإنترنت الأكبر لتوفير بنيتهم التحتية. +المستوى الثالث هو الشركات الصغيرة التي تركز بشكل أساسي على توفير الإنترنت للأسواق المحلية، وتعتمد على مزودي خدمة الإنترنت الأكبر لتوفير بنيتها التحتية. هؤلاء المزودون يقدمون أيضًا أنواعًا مختلفة من الاتصالات. @@ -25,7 +25,7 @@ dashedName: what-are-the-different-types-of-internet-service-providers يستخدم الاتصال الهاتفي أيضًا خطوط الهاتف، لكنه يتطلب اتصالًا حصريًا (يعطل استخدام الخط لأغراض الهاتف عند الاتصال بالإنترنت). هذه تقنية قديمة جدًا وأصبحت غير مستخدمة. -تستخدم الاتصالات الفضائية مجموعة من الأقمار الصناعية التي تدور حول الأرض لربط الأجهزة المختلفة عبر العالم. وأخيرًا، وبطريقة مشابهة، يستخدم مزود الإنترنت المنزلي 5G بنية أبراج الهواتف المحمولة لإبقائك متصلًا. +تستخدم الاتصالات الفضائية مجموعة من الأقمار الصناعية التي تدور حول الأرض لربط الأجهزة المختلفة عبر العالم. وأخيرًا، وبطريقة مشابهة، يستخدم مزود الإنترنت المنزلي 5G بنية أبراج الهاتف الخلوي للحفاظ على اتصالك بالإنترنت. وهذا يجب أن يعطيك نظرة أساسية على أنواع مزودي خدمة الإنترنت وأنواع الاتصالات المتوفرة! diff --git a/curriculum/challenges/arabic/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab8573f32480f192aaae1.md b/curriculum/challenges/arabic/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab8573f32480f192aaae1.md index 017e770bbd7..8f96e52370d 100644 --- a/curriculum/challenges/arabic/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab8573f32480f192aaae1.md +++ b/curriculum/challenges/arabic/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab8573f32480f192aaae1.md @@ -9,7 +9,7 @@ dashedName: what-are-the-different-types-of-tools-professional-developers-use يعتمد المطوّرون المحترفون على مجموعة متنوعة من الأدوات لزيادة الإنتاجية وجودة الشفرة. دعنا نتعرف على تلك الأدوات، بما في ذلك التي تبدو واضحة جدًا. -أول الأدوات هي الحواسيب. الحاسوب هو بيئة العمل الأساسية للتطوير. قد يكون جهاز مكتبي ثقيل أو حاسوب محمول قابل للحمل يعمل بنظام تشغيل Windows أو macOS أو Linux. +الأداة الأولى هي الكمبيوتر نفسه. الكمبيوتر هو بيئة العمل الأساسية للتطوير. يمكن أن يكون جهاز مكتبي ثقيل أو حاسوب محمول قابل للحمل يعمل بنظام تشغيل Windows أو macOS أو Linux. غالبًا ما يختار المطوّرون المحترفون حواسيب ذات قدرة معالجة سريعة وذاكرة وصول عشوائي كبيرة للتعامل مع المهام التي تستهلك موارد كثيرة. @@ -21,7 +21,7 @@ dashedName: what-are-the-different-types-of-tools-professional-developers-use من محررات الشفرة الأخرى Sublime Text وAtom وNotepad++ وBrackets. -عندما تكتب شفرة باستخدام محررات الشفرة وبيئات التطوير المتكاملة، تحتاج إلى تتبع التغييرات التي تجريها عليها. الأداة التي تتيح لك تتبع هذه التغييرات هي نظام التحكم في الإصدارات. +عندما تكتب شفرة باستخدام محررات الشفرة وبيئات التطوير المتكاملة، تحتاج إلى تتبع التغييرات التي تجريها على تلك الشفرة. الأداة التي تتيح لك تتبع هذه التغييرات هي نظام التحكم في الإصدارات. Git هو نظام التحكم في الإصدارات الأكثر استخدامًا في مجتمع التطوير. @@ -31,8 +31,8 @@ Git هو نظام التحكم في الإصدارات الأكثر استخدا أمثلة على مديري الحزم الشائعة هي: -* NPM وYarn وPNPM لـ JavaScript -* PIP لـ Python +* npm وYarn وpnpm لـ JavaScript +* pip لـ Python * Composer لـ PHP * Maven لـ Java @@ -147,7 +147,7 @@ Git. --- -أنظمة التحكم في الإصدارات +أنظمة التحكم في الإصدارات. ### --feedback-- diff --git a/curriculum/challenges/arabic/blocks/lecture-understanding-error-handling-and-health-checks/69f3046f4c0e76cbdd24858e.md b/curriculum/challenges/arabic/blocks/lecture-understanding-error-handling-and-health-checks/69f3046f4c0e76cbdd24858e.md index 41746e2e8ee..7793df64092 100644 --- a/curriculum/challenges/arabic/blocks/lecture-understanding-error-handling-and-health-checks/69f3046f4c0e76cbdd24858e.md +++ b/curriculum/challenges/arabic/blocks/lecture-understanding-error-handling-and-health-checks/69f3046f4c0e76cbdd24858e.md @@ -34,7 +34,7 @@ app.use((err, req, res, next) => { يعرف Express أنها معالِج أخطاء لأنها تحتوي على أربعة معلمات — المعلمة الجديدة `err`، بالإضافة إلى المعلمات المعتادة `req` و `res` و `next` الخاصة بدوال البرمجيات الوسيطة الأخرى. -في درس قادم، ستتعلم المزيد عن برمجيات التعامل مع الأخطاء وكيف تندمج في سلسلة برمجيات Express الوسيطة الأوسع. +كما رأيت في درس سابق، تندمج برمجيات وسيطة لمعالجة الأخطاء ضمن مجموعة برمجيات وسيطة أوسع في Express. ## كيفية التعامل مع الأخطاء غير المتزامنة diff --git a/curriculum/challenges/arabic/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/6733affc29df1304e2c97e88.md b/curriculum/challenges/arabic/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/6733affc29df1304e2c97e88.md index 6e59264b84c..59d29c859f3 100644 --- a/curriculum/challenges/arabic/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/6733affc29df1304e2c97e88.md +++ b/curriculum/challenges/arabic/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/6733affc29df1304e2c97e88.md @@ -31,6 +31,8 @@ class MyClassName { المحتوى داخل الأقواس المتعرجة يُعرف بجسم الصنف. هنا توضع دالة البناء والطرق. +## تعريف دوال البناء + دالة البناء هي طريقة خاصة تُستدعى تلقائيًا عند إنشاء كائن جديد من الصنف. تُستخدم عادةً لتهيئة خصائص الكائن. في هذا المثال، يمكنك رؤية صنف `Dog` مع دالة بناء. @@ -45,6 +47,8 @@ class Dog { تُستخدم الكلمة المفتاحية `this` هنا للإشارة إلى النسخة الحالية من صنف `Dog`، مما يسمح لك بتعيين خاصية `name` للكائن الجاري إنشاؤه. ستتعلم المزيد عن الكلمة المفتاحية `this` في درس لاحق. +## تعريف الطرق + أسفل دالة البناء، يمكنك إضافة ما يسمى بالطرق. الطرق هي دوال معرفة داخل الصنف تؤدي إجراءات أو عمليات. تُستخدم لتعريف السلوكيات التي يمكن لنسخ الصنف تنفيذها. إليك مثالًا على إضافة طريقة تسمى `bark` إلى صنف `Dog`. @@ -63,6 +67,8 @@ class Dog { عند استدعاء طريقة `bark`، ستُسجل الرسالة في وحدة التحكم مع الاسم الفعلي الذي تم تمريره إليها. إذا أنشأت نسخة من `Dog` بالاسم `"Buddy"`، فإن استدعاء طريقة `bark()` على تلك النسخة سيطبع `"Buddy says woof!"` في وحدة التحكم. +## إنشاء نسخة من الصنف + بمجرد تعريف الصنف، يمكنك إنشاء نسخة منه باستخدام الكلمة المفتاحية `new`، واسم الصنف، والمعلمات الخاصة به. في هذا المثال، ننشئ نسخة جديدة من `Dog` بالاسم `Gino` ثم نُعيّنها إلى المتغير `dog`. @@ -73,7 +79,9 @@ const dog = new Dog("Gino"); عندما تكتب `new Dog("Gino")` في الشفرة، يُنشأ الكائن الجديد وتُستدعى دالة البناء تلقائيًا بالمعلمات المعطاة. -يمكنك بعد ذلك الوصول إلى هذه الخاصية باستخدام ترميز النقطة، كما ترى في السطر التالي من الشفرة: +## الوصول إلى الخصائص والطرق + +يمكنك بعد ذلك الوصول إلى الخاصية `name` باستخدام ترميز النقطة، كما ترى في السطر التالي من الشفرة: ```js console.log(dog.name); @@ -127,6 +135,8 @@ dog.bark(); ::: +## استخدام تعبيرات الصنف + كما ذُكر سابقًا، يمكنك أيضًا تعريف الأصناف كتعبير صنف. هنا يكون الصنف مجهولًا ويتم تعيينه إلى متغير. إليك كيف يبدو المثال السابق كتعبير صنف: diff --git a/curriculum/challenges/arabic/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/673403ca2bb16658309e3632.md b/curriculum/challenges/arabic/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/673403ca2bb16658309e3632.md index 51c6291ca1e..a5542380dd2 100644 --- a/curriculum/challenges/arabic/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/673403ca2bb16658309e3632.md +++ b/curriculum/challenges/arabic/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/673403ca2bb16658309e3632.md @@ -11,6 +11,8 @@ dashedName: how-does-the-this-keyword-work تحتاج هذه المخططات إلى طريقة عامة للإشارة إلى الكائن المحدد الذي يتم إنشاؤه أو الوصول إليه أو تعديله داخل الشفرة. هذا بالضبط ما تُستخدم له الكلمة المفتاحية `this`. تشير إلى السياق الذي من المفترض أن تُنفذ فيه الشفرة. إذا استخدمتها داخل طريقة، ستكون قيمة `this` مرجعًا إلى الكائن المرتبط بتلك الطريقة. بهذه الطريقة، يمكنك الوصول إلى الخصائص والطرق الخاصة بالكائن داخل الصنف وإعادة استخدام الطريقة على كائنات مختلفة. +## دوال البناء + على سبيل المثال، هنا لدينا صنف `Dessert`. هذه المرة، نُعرّف خاصية `hasPeanuts`. ```js @@ -33,6 +35,8 @@ this.hasPeanuts = hasPeanuts; هذا في سياق دالة البناء، لكن يمكنك أيضًا استخدام الكلمة المفتاحية `this` داخل طرق أخرى. +## الطرق + هذا هو صنف `Dessert` مع بعض التغييرات. الآن لدينا خاصيتان: `name` و `price`. ```js @@ -91,10 +95,16 @@ console.log(brownie); كل هذا بفضل الكلمة المفتاحية `this`، التي تمنحك طريقة عامة للإشارة إلى الكائن الحالي داخل الصنف. هذا يسمح لك بإعادة استخدام الطريقة على كائنات مختلفة. +## الدوال والدوال السهمية + هذا في سياق طرق الكائنات، لكن الكلمة المفتاحية `this` سيكون لها أيضًا قيمة في الدوال المستقلة والدوال السهمية. +### الدوال العادية + قيمتها داخل دالة مستقلة عادةً ما تشير إلى الكائن العالمي (في الوضع غير الصارم) أو `undefined` (في الوضع الصارم). +### الدوال السهمية + قيمة الكلمة المفتاحية `this` تختلف قليلاً في الدوال السهمية. الدوال السهمية ترث قيمة `this` من النطاق المحيط الذي تُعرّف فيه. لا تنشئ ربطًا خاصًا بها لـ `this`. هذا يعني أن قيمة `this` تعتمد على السياق الذي تُعرّف فيه الدالة السهمية، وليس على مكان أو كيفية استدعائها. هذا يجعل الدوال السهمية مفيدة للاستدعاءات الراجعة أو للحفاظ على السياق. لكن بسبب هذا، لن تشير قيمة `this` إلى الكائن الحالي في طرق الكائنات، لذا يجب أن تضع هذا في اعتبارك عند العمل مع الدوال السهمية. diff --git a/curriculum/challenges/arabic/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5160.md b/curriculum/challenges/arabic/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5160.md index e0122a5ea76..f7d346040aa 100644 --- a/curriculum/challenges/arabic/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5160.md +++ b/curriculum/challenges/arabic/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5160.md @@ -14,17 +14,17 @@ dashedName: whats-the-process-for-creating-web-standards 1. ## تحديد الحاجة تبدأ المعايير من وجود احتكاك، مثل اصطدام المطورين بحائط مسدود، أو تنفيذ المتصفحات لنفس السلوك بطرق غير متوافقة، أو وجود قدرة جديدة لا يدعمها النظام الأساسي بعد. شخص ما، في مكان ما، يشعر بالإحباط بما يكفي ليكتب ذلك. يمكن أن يكون هذا الشخص أي أحد؛ مطوِّر، شركة كبيرة بحاجة إلى منتج، أو مهندس داخل فريق المتصفح. ما يهم في هذه المرحلة ليس السلطة، بل الأدلة والأسئلة حول ما إذا كانت المشكلة حقيقية، وهل يواجهها عدد كافٍ من الناس لتبرير اهتمام منصة الويب. -1. **المقترح والنقاش المبكر** - تُكتب الفكرة بشكل غير رسمي عبر مشكلة في GitHub، أو وثيقة قصيرة، أو شرح يصف المشكلة ويرسم حلًا ممكنًا. في هذه المرحلة، الهدف ليس إنتاج مواصفة نهائية، بل معرفة ما إذا كانت المشكلة تثير اهتمام الآخرين. هل يتعرف المطورون الآخرون عليها؟ هل يهتم بائعو المتصفحات؟ هل هناك حل واضح، أم عدة حلول متنافسة؟ في TC39، تتوافق هذه المرحلة المبكرة مع المرحلة 0 والمرحلة 1. في W3C، تحدث غالبًا بشكل غير رسمي في مجموعة مجتمع قبل تأسيس مجموعة عمل رسمية. تتعامل WHATWG مع ذلك من خلال مناقشات مفتوحة على GitHub في مستودعاتها الأساسية. يختلف المكان، لكن الوظيفة واحدة. +1. ## الاقتراح والنقاش المبكر + تُكتب الفكرة بشكل غير رسمي عبر مشكلة في GitHub، أو وثيقة قصيرة، أو شرح يصف المشكلة ويرسم حلاً محتملاً. في هذه المرحلة، الهدف ليس إنتاج مواصفة نهائية، بل معرفة ما إذا كانت المشكلة تثير اهتمام الآخرين. هل يتعرف المطوّرون الآخرون عليها؟ هل يهتم بائعو المتصفحات؟ هل هناك حل واضح، أم عدة حلول متنافسة؟ في TC39، تتوافق هذه المرحلة المبكرة مع المرحلة 0 والمرحلة 1. في W3C، تحدث غالبًا بشكل غير رسمي في مجموعة مجتمع قبل تأسيس مجموعة عمل رسمية. تتعامل WHATWG مع ذلك من خلال مناقشات مفتوحة على GitHub في مستودعاتها الأساسية. المكان يختلف، لكن الوظيفة واحدة. -1. **كتابة المواصفة** - إذا حظي المقترح بدعم، يجب على شخص أو فريق صغير كتابة المواصفة الفعلية، أو spec. المواصفة ليست تدوينة أو درسًا، بل وثيقة دقيقة ورسمية تصف بالضبط كيف يجب أن تتصرف الميزة في كل حالة ممكنة. يجب التفكير وكتابة الحالات الخاصة، وحالات الخطأ، والتفاعلات مع الميزات القائمة، والاعتبارات الأمنية. +1. ## كتابة المواصفة + إذا حظي الاقتراح بدعم، يجب على شخص أو فريق صغير كتابة المواصفة الفعلية، أو spec. المواصفة ليست تدوينة أو درسًا تعليميًا، بل وثيقة دقيقة ورسمية تصف بالضبط كيف يجب أن تتصرف الميزة في كل حالة ممكنة. يجب التفكير في الحالات الحدية، وحالات الخطأ، والتفاعلات مع الميزات القائمة، والاعتبارات الأمنية، وكتابتها كلها. -1. **المراجعة والاعتراض والتكرار** - تُنشر المسودة وتُراجع علنًا، وكذلك من قبل بائعي المتصفحات الآخرين. هنا يحدث معظم العمل الحقيقي. تُثار الاعتراضات، وتُعدل المواصفة. ميزة يرفض محرك متصفح رئيسي تنفيذها نادرًا ما تصبح معيارًا، بغض النظر عن مزاياها التقنية. بناء التوافق في هذه المرحلة قد يستغرق وقتًا طويلًا. بعض المقترحات تتوقف لسنوات بينما يتفاوض البائعون على تفاصيل التصميم. وبعضها يموت تمامًا عندما يتضح أنه لا يمكن التوصل إلى اتفاق. +1. ## المراجعة والاعتراض والتكرار + تُنشر المسودة وتُراجع علنًا، وكذلك من قبل بائعي المتصفحات الآخرين. هنا يحدث معظم العمل الحقيقي. تُثار الاعتراضات، وتُعدل المواصفة. ميزة يرفض محرك متصفح رئيسي تنفيذها نادرًا ما تصبح معيارًا، بغض النظر عن مزاياها التقنية. بناء التوافق في هذه المرحلة قد يستغرق وقتًا طويلًا. بعض الاقتراحات تتوقف لسنوات بينما يتفاوض البائعون على تفاصيل التصميم. وبعضها يموت تمامًا عندما يتضح أنه لا يمكن التوصل إلى اتفاق. -1. **التنفيذ والاختبار** - بمجرد استقرار المواصفة، يبدأ بائعو المتصفحات في تنفيذها. عادةً ما يبدأ ذلك بعلم ميزة أولًا، ليتم اختبارها دون التأثير على المستخدمين الحاليين. يكشف التنفيذ غالبًا عن مشاكل لم تتوقعها المواصفة، فتُعاد إلى المحررين للتوضيح. تتحقق مجموعة اختبارات مشتركة من أن كل تنفيذ يتصرف بنفس الطريقة فعليًا. إذا اجتاز Chrome وFirefox وSafari نفس الاختبارات، فالمواصفة تعمل. إذا اختلفوا، فإما أن المواصفة غير واضحة، أو أن أحد التنفيذات يحتوي على خطأ برمجي. +1. ## التنفيذ والاختبار + بمجرد أن تصبح المواصفة مستقرة بما فيه الكفاية، يبدأ بائعو المتصفحات في تنفيذها. عادةً ما يبدأ ذلك بعلم ميزة أولًا، ليتم اختبارها دون التأثير على المستخدمين الحاليين. غالبًا ما يكشف التنفيذ عن مشاكل لم تتوقعها المواصفة، فتُعاد إلى المحررين للتوضيح. تتحقق مجموعة اختبارات مشتركة من أن كل تنفيذ يتصرف بنفس الطريقة فعليًا. إذا اجتاز Chrome وFirefox وSafari نفس الاختبارات، فالمواصفة تعمل. إذا اختلفوا، فإما أن المواصفة غير واضحة، أو أن أحد التنفيذات يحتوي على خطأ برمجي. 1. ## الإنهاء عندما توجد عدة تنفيذات مستقلة، وتنجح الاختبارات، ويرضى المجتمع، يُنهى المعيار. في W3C، يعني ذلك تحقيق حالة التوصية. في TC39، يعني الوصول إلى المرحلة 4، بعدها تُدرج الميزة في إصدار ECMAScript السنوي التالي. في WHATWG، لا يوجد لحظة إنهاء واحدة، بل يعكس المعيار الحي التوافق الحالي، ويتم تحديثه باستمرار. قد تستغرق العملية بأكملها من بضعة أشهر لإضافة صغيرة غير مثيرة للجدل إلى أكثر من عقد لشيء معقد أو سياسي. على سبيل المثال، اقترح CSS Grid أول مرة في 2011 ولم يُطرح في جميع المتصفحات الرئيسية حتى 2017. تلك الفجوة بين فكرة جيدة ومعيار مستقر مدعوم عالميًا هي حيث يحدث معظم عمل الويب المفتوح بهدوء. @@ -109,7 +109,7 @@ dashedName: whats-the-process-for-creating-web-standards ## --answers-- -لإلغاء الحاجة إلى مواصفة مكتوبة. +استبدال الحاجة إلى مواصفة مكتوبة. ### --feedback-- @@ -121,7 +121,7 @@ dashedName: whats-the-process-for-creating-web-standards --- -لتصنيف أداء المتصفحات لأغراض التسويق. +تصنيف أداء المتصفحات لأغراض التسويق. ### --feedback-- diff --git a/curriculum/challenges/arabic/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5161.md b/curriculum/challenges/arabic/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5161.md index 0b62e8e40f7..7615a09c4f2 100644 --- a/curriculum/challenges/arabic/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5161.md +++ b/curriculum/challenges/arabic/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5161.md @@ -13,23 +13,23 @@ dashedName: what-does-the-lifecycle-of-web-standards-features-look-like فكر في العملية كدليل القواعد، ودورة الحياة كالأحداث الفعلية التي تحدث أثناء لعب اللعبة. -1. **المقترح** - تبدأ كل ميزة بمشكلة اهتم بها شخص بما يكفي ليكتبها. يقدم مطوِّر أو مهندس متصفح أو شركة مشكلة على GitHub أو شرحًا يصف ما لا يستطيع الويب فعله حاليًا ولماذا يجب أن يفعل. في هذه المرحلة، تكون الفكرة غير محددة، مع أسئلة أكثر من الأجوبة. الهدف ببساطة هو معرفة ما إذا كان هناك من يعاني نفس المشكلة. +1. ## الاقتراح + تبدأ كل ميزة بمشكلة اهتم بها شخص ما بما يكفي ليكتبها. يقدم مطوِّر أو مهندس متصفح أو شركة مشكلة على GitHub أو شرحًا يصف ما لا يستطيع الويب فعله حاليًا ولماذا يجب أن يفعل ذلك. في هذه المرحلة، تكون الفكرة غير محددة، مع وجود أسئلة أكثر من الإجابات. الهدف ببساطة هو معرفة ما إذا كان هناك من يشارك نفس المشكلة. -1. **الحضانة** - إذا لاقى المقترح صدى، يدخل فترة من النقاش المفتوح والتصميم المبكر. تُرسم الطرق المتنافسة، تُجمع حالات الاستخدام، ويختبر المجتمع الفكرة تحت الضغط. تموت العديد من المقترحات هنا، ربما لأن المشكلة ضيقة جدًا، أو لا يوجد حل يرضي الجميع. التي تبقى تظهر بشكل أوضح وبها اهتمام من بعض بائعي المتصفحات. +1. ## الحضانة + إذا لاقى الاقتراح صدى، يدخل فترة من النقاش المفتوح والتصميم المبكر. تُرسم الطرق المتنافسة، وتُجمع حالات الاستخدام، ويختبر المجتمع الفكرة تحت الضغط. تموت العديد من الاقتراحات هنا، ربما لأن المشكلة ضيقة جدًا أو لا يوجد حل يرضي الجميع. الناجون يظهرون بشكل أوضح ويحظون على الأقل ببعض اهتمام بائعي المتصفحات. -1. **المواصفة** - يُكتب المقترح الناجح كمواصفة رسمية. يجب تعريف كل حالة حافة، وحالة خطأ، وتفاعل مع الميزات الحالية بوضوح. هذه هي النقطة التي تلتقي فيها الفكرة الجيدة بالواقع الصعب. يجب أن تتحول المفاهيم الغامضة إلى قواعد دقيقة يمكن لمهندسين مستقلين قراءتها وتنفيذها بشكل مطابق. +1. ## المواصفة + يُكتب الاقتراح الناجح كمواصفة رسمية. يجب تعريف كل حالة طرفية، وحالة خطأ، وتفاعل مع الميزات الحالية بوضوح. هذه هي النقطة التي تلتقي فيها الفكرة الجيدة بالواقع الصعب. يجب أن تتحول المفاهيم الغامضة إلى قواعد دقيقة يمكن لمهندسين مستقلين قراءتها وتنفيذها بشكل متطابق. -1. **اختبار التوافقية** - قبل اعتبار ميزة مستقرة، يجب أن تتصرف بنفس الطريقة في كل متصفح. مجموعة اختبارات منصة الويب من W3C هي الأداة الرئيسية للتحقق من ذلك. هي مجموعة مشتركة من الاختبارات التي يشغلها Chrome وFirefox وSafari وغيرهم على تطبيقاتهم. تعني النتائج المتباينة إما أن المواصفة غامضة، أو أن هناك خطأ برمجي. يجب حل أي منهما قبل تقدم الميزة. +1. ## اختبار التوافقية + قبل اعتبار الميزة مستقرة، يجب أن تتصرف بنفس الطريقة في كل متصفح. مجموعة اختبارات منصة الويب الخاصة بـ W3C هي الأداة الرئيسية للتحقق من ذلك. هي مجموعة مشتركة من الاختبارات التي يشغلها Chrome وFirefox وSafari وغيرهم ضد تطبيقاتهم. تعني النتائج المتباينة إما أن المواصفة غامضة أو أن هناك خطأ برمجي. يجب حل أي منهما قبل تقدم الميزة. -1. **الاعتماد النهائي** - بمجرد أن تجتاز عدة تطبيقات مستقلة الاختبارات، تُعتمد الميزة رسميًا. بالنسبة لـ W3C، تصبح توصية، ولـ TC39 تصل للمرحلة 4، وتُدرج بشكل مستقر في معيار WHATWG الحي. تُرفع الأعلام وتُطرح الميزة للمستخدمين. في هذه المرحلة، تصبح جزءًا من منصة الويب الأساسية التي يمكن لكل مطوِّر الاعتماد عليها إلى أجل غير مسمى. +1. ## الإنهاء + بمجرد أن تجتاز عدة تطبيقات مستقلة الاختبارات، تُنهى الميزة. بالنسبة لـ W3C، تصبح توصية، ولـ TC39، تصل إلى المرحلة 4، وتُدرج بشكل مستقر في المعيار الحي لـ WHATWG. تُرفع الأعلام وتُطرح الميزة للمستخدمين. في هذه المرحلة، تصبح جزءًا من منصة الويب الأساسية، يمكن لكل مطوِّر الاعتماد عليها إلى أجل غير مسمى. -1. **الإهمال** - ليست كل المعايير تدوم جيدًا. تُستبدل بعض الميزات بأخرى أفضل، ويكتشف البعض الآخر أن له آثارًا أمنية أو خصوصية لم تكن واضحة في البداية. عندما تحتاج ميزة إلى الإزالة، تُهمل رسميًا. أي تُدعم لكنها تُعلَّم كشيء يجب على المطوّرين التوقف عن استخدامه. في النهاية تُزال من المواصفة. الإزالة من المتصفحات بطيئة وحذرة، لأن الوعد الأساسي للويب هو استمرار عمل الصفحات القديمة. تبقى بعض الميزات المهملة في المتصفحات لعقود فقط من أجل التوافقية العكسية. +1. ## الإهمال + لا يشيخ كل معيار بشكل جيد. تحل بعض الميزات محلها ميزات أفضل، ويتبين أن بعضها له آثار أمنية أو خصوصية لم تكن واضحة في البداية. عندما تحتاج ميزة إلى الإزالة، تُهمل رسميًا. أي تُدعم لكنها تُعلَن كشيء يجب على المطوِّرين التوقف عن استخدامه. في النهاية، تُزال من المواصفة. الإزالة من المتصفحات بطيئة وحذرة، لأن الوعد الأساسي للويب هو استمرار عمل الصفحات القديمة. تبقى بعض الميزات المهملة في المتصفحات لعقود فقط من أجل التوافقية مع الإصدارات السابقة. # --questions-- @@ -39,7 +39,7 @@ dashedName: what-does-the-lifecycle-of-web-standards-features-look-like ## --answers-- -الحضانة +الاحتضان --- @@ -83,7 +83,7 @@ dashedName: what-does-the-lifecycle-of-web-standards-features-look-like --- -لإلغاء الحاجة إلى مواصفة مكتوبة. +استبدال الحاجة إلى مواصفة مكتوبة. ### --feedback-- diff --git a/curriculum/challenges/arabic/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5162.md b/curriculum/challenges/arabic/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5162.md index be1cf7ec2f9..4c35b829783 100644 --- a/curriculum/challenges/arabic/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5162.md +++ b/curriculum/challenges/arabic/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5162.md @@ -9,26 +9,26 @@ dashedName: what-are-the-key-principles-that-web-standards-are-built-on معايير الويب ليست مجرد وثائق تقنية، بل تعكس مجموعة من القيم حول ما يجب أن يكون عليه الويب ولمن يجب أن يخدم. فهم هذه المبادئ يساعدك على رؤية ليس فقط كيف يعمل الويب، بل لماذا بُني بهذه الطريقة. دعنا نناقش تلك المبادئ. -1. **الانفتاح** - تُطوَّر معايير الويب بشكل مفتوح وتُنفذ بدون رسوم ترخيص. يمكن لأي شخص قراءة المواصفات، ويمكن لأي شخص بناء متصفح، ولا يمكن لأي شركة فرض رسوم ترخيص على تنفيذ معيار. هذا الانفتاح هو ما يميز الويب عن المنصات المملوكة وما يسمح للفرق الصغيرة ببناء أدوات تصل إلى مليارات الأشخاص دون الحاجة إلى إذن من جهة تحكم. +1. ## الانفتاح + تُطوَّر معايير الويب بشكل مفتوح وتُنفذ بدون رسوم ترخيص. يمكن لأي شخص قراءة المواصفات، ويمكن لأي شخص بناء متصفح، ولا يمكن لأي شركة فرض رسوم ترخيص على تنفيذ معيار. هذا الانفتاح هو ما يميز الويب عن المنصات المملوكة، ويسمح للفرق الصغيرة ببناء أدوات تصل إلى مليارات الأشخاص دون الحاجة إلى إذن من جهة تحكم. -1. **إمكانية الوصول** - صُمم الويب ليكون قابلاً للاستخدام من قبل الجميع، بغض النظر عن القدرة. إمكانية الوصول ليست ميزة إضافية على معايير الويب، بل هي مدمجة في تصميم HTML وCSS وسلوك المتصفح. تحدد إرشادات WCAG التابعة لـ W3C المعيار الرسمي لما يعنيه الوصول في الممارسة. تُعتبر الميزة التي تخلق حواجز للأشخاص الذين يستخدمون قارئ الشاشة أو التنقل عبر لوحة المفاتيح أو تقنية مساعدة ناقصة بالتأكيد في التصميم، وليس فقط من الناحية الأخلاقية. +1. ## إمكانية الوصول + صُمم الويب ليكون قابلاً للاستخدام من قبل الجميع، بغض النظر عن القدرة. إمكانية الوصول ليست إضافة على معايير الويب، بل هي مدمجة في تصميم HTML وCSS وسلوك المتصفح. تحدد إرشادات WCAG التابعة لـ W3C المعيار الرسمي لما يعنيه الوصول في الممارسة. تُعتبر الميزة التي تخلق حواجز للأشخاص الذين يستخدمون قارئ الشاشة أو التنقل عبر لوحة المفاتيح أو تقنية مساعدة ناقصة بالتصميم، وليس فقط من الناحية الأخلاقية. -1. **التشغيل البيني** - المبدأ الأساسي هو أن يعمل الويب بنفس الطريقة في كل مكان. يجب أن تتصرف الصفحة المبنية وفق المعيار بشكل متطابق في Chrome وFirefox وSafari، وعلى أنظمة Windows وmacOS وLinux وAndroid وiOS. بدون التشغيل البيني، ينقسم الويب إلى تجارب خاصة بكل متصفح، ويُجبر المطوّرون على كتابة نفس الشيء عدة مرات. كل معيار موجود، في جوهره، لمنع ذلك. +1. ## التشغيل البيني + المبدأ الأساسي هو أن يعمل الويب بنفس الطريقة في كل مكان. يجب أن تتصرف الصفحة المبنية وفق المعيار بشكل متماثل في Chrome وFirefox وSafari، وعلى أنظمة Windows وmacOS وLinux وAndroid وiOS. بدون التشغيل البيني، ينقسم الويب إلى تجارب خاصة بكل متصفح، ويُجبر المطوّرون على كتابة نفس الشيء عدة مرات. كل معيار موجود، في جوهره، لمنع ذلك. -1. **التوافق مع الإصدارات السابقة** - يلتزم الويب تقريبًا بعدم كسر الأشياء القديمة. يجب أن تُعرض صفحة كُتبت في 1999 بشكل صحيح في متصفح حديث، وتتعامل هيئات المعايير مع هذا الالتزام بجدية عند تصميم ميزات جديدة. لهذا السبب تُضاف القدرات الجديدة فوق القديمة بدلاً من استبدالها. هذا قيد قد يزعج المصممين أحيانًا، لكنه أيضًا ما يجعل الويب منصة متينة وفريدة. +1. ## التوافق مع الإصدارات السابقة + يلتزم الويب بشكل شبه مطلق بعدم كسر الأشياء القديمة. يجب أن تُعرض صفحة مكتوبة في 1999 بشكل صحيح في متصفح حديث، وتلتزم هيئات المعايير بهذا الالتزام بجدية عند تصميم ميزات جديدة. لهذا السبب تُضاف القدرات الجديدة فوق القديمة بدلاً من استبدالها. هذا قيد قد يزعج المصممين أحيانًا، لكنه ما يجعل الويب منصة متينة وفريدة. -1. **الخصوصية والأمان** +1. ## الخصوصية والأمان تُراجع المعايير الحديثة من حيث تأثيرها على الخصوصية والأمان قبل إصدارها. تواجه واجهات برمجة التطبيقات الجديدة التي قد تكشف بيانات المستخدم أو تمكّن التتبع تدقيقًا دقيقًا في عملية المعايير. المبدأ هو أن تحمي المنصة المستخدمين افتراضيًا، وأن لا تأتي ملاءمة المطوّرين على حساب سلامة المستخدم. -1. **التقسيم الطبقي** - يُبنى الويب على طبقات مميزة وقابلة للتكوين: HTML للهيكل، وCSS للعرض، وJavaScript للسلوك. تُصمم المعايير لاحترام هذه الحدود بدلاً من دمجها. يمكن اعتماد ميزة مقسمة بشكل جيد تدريجيًا. الصفحة التي لا تستخدم JavaScript لا تزال تعمل، والمتصفح الذي لا يدعم خاصية CSS جديدة لا يزال يعرض شيئًا معقولًا. هذا الفصل في الاهتمامات هو ما يمنح الويب مرونته. +1. ## التدرج الطبقي + يُبنى الويب على طبقات مميزة وقابلة للتكوين: HTML للهيكل، وCSS للعرض، وJavaScript للسلوك. تُصمم المعايير لاحترام هذه الحدود بدلاً من دمجها. يمكن اعتماد ميزة ذات طبقات جيدة بشكل تدريجي. الصفحة التي لا تستخدم JavaScript لا تزال تعمل، والمتصفح الذي لا يدعم خاصية CSS جديدة لا يزال يعرض شيئًا معقولًا. هذا الفصل في الاهتمامات هو ما يمنح الويب مرونته. -1. **التحسين التدريجي** - مرتبط ارتباطًا وثيقًا بالتقسيم الطبقي هو فكرة أن يعمل الويب للجميع أولًا، ثم يتحسن لمن لديهم متصفحات أو أجهزة أكثر قدرة. يجب أن تتدهور الميزة القياسية بشكل متدرج عند عدم الدعم، لا أن تنكسر تمامًا. يشكل هذا المبدأ كيفية تحديد خصائص CSS الجديدة، وكيفية تعامل واجهات برمجة التطبيقات في JavaScript مع القدرات المفقودة، وكيف تفكر هيئات المعايير في الفجوة بين المتصفحات الحديثة والقديمة التي لا تزال مستخدمة على نطاق واسع حول العالم. +1. ## التحسين التدريجي + مرتبط ارتباطًا وثيقًا بالتدرج الطبقي هو فكرة أن يعمل الويب للجميع أولًا، ثم يتحسن لمن لديهم متصفحات أو أجهزة أكثر قدرة. يجب أن تتدهور الميزة المعيارية بشكل سلس عند عدم الدعم، وليس أن تتعطل تمامًا. يشكل هذا المبدأ كيفية تحديد خصائص CSS الجديدة، وكيفية تعامل واجهات برمجة JavaScript مع القدرات المفقودة، وكيف تفكر هيئات المعايير في الفجوة بين المتصفحات الحديثة والقديمة التي لا تزال مستخدمة على نطاق واسع في العالم. # --questions-- diff --git a/curriculum/challenges/arabic/blocks/lecture-user-interface-design-fundamentals/672baa97f2990e6631d522e7.md b/curriculum/challenges/arabic/blocks/lecture-user-interface-design-fundamentals/672baa97f2990e6631d522e7.md index 4a9ff3911f3..44410380460 100644 --- a/curriculum/challenges/arabic/blocks/lecture-user-interface-design-fundamentals/672baa97f2990e6631d522e7.md +++ b/curriculum/challenges/arabic/blocks/lecture-user-interface-design-fundamentals/672baa97f2990e6631d522e7.md @@ -7,7 +7,9 @@ dashedName: how-do-you-create-good-background-and-foreground-contrast-in-your-de # --interactive-- -**ملاحظة**: قد تستخدم بعض الأمثلة التفاعلية CSS لم تتعلمه بعد. لا تقلق بشأن محاولة فهم كل الشفرة. الهدف من الأمثلة هو عرض معاينات لهذه المفاهيم التصميمية لتفهم كيف تعمل الأمور بشكل أفضل. +**ملاحظة**: قد تستخدم بعض الأمثلة التفاعلية CSS التي لم تتعلمها بعد. لا تقلق بشأن محاولة فهم كل الشفرة. الهدف من الأمثلة هو عرض معاينات لهذه المفاهيم التصميمية لتفهم كيف تعمل الأمور بشكل أفضل. + +## فهم التباين أولًا، قد تحتاج إلى التعرف على التباين. التباين هو الفرق بين لونين - أو مدى سهولة التمييز بينهما. @@ -53,6 +55,8 @@ dashedName: how-do-you-create-good-background-and-foreground-contrast-in-your-de ::: +### تطبيق التباين على النص + بالطبع، في هذه الأمثلة قد يكون التمييز أوضح بسبب التخطيط. لكن ماذا عن تطبيق هذه الألوان على النص؟ يمكنك أن تضع نصًا أسود عالي التباين على خلفية بيضاء، ونصًا بنفسجيًا منخفض التباين على خلفية زرقاء. :::interactive_editor @@ -96,6 +100,8 @@ dashedName: how-do-you-create-good-background-and-foreground-contrast-in-your-de ::: +### معايير التباين في إرشادات إمكانية الوصول لمحتوى الويب (WCAG) + لكن كيف تحدد ما هو "تباين جيد بما فيه الكفاية"؟ لا يمكنك الاعتماد فقط على كيف يبدو النص لك، لأن تجربة كل مستخدم تختلف. لحسن الحظ، توفر إرشادات إمكانية الوصول إلى محتوى الويب (WCAG) معيارًا لذلك. النص الذي له نسبة تباين 4.5:1 يُعتبر معيار AA، وهو الحد الأدنى الذي يجب اتباعه ليكون النص متاحًا لمعظم المستخدمين. والنص الذي له نسبة تباين 7:1 يُعتبر معيار AAA، ويضمن أفضل مستوى من إمكانية الوصول. @@ -141,6 +147,8 @@ dashedName: how-do-you-create-good-background-and-foreground-contrast-in-your-de ::: +### مقارنة نسب التباين العالية والمنخفضة + هناك العديد من المواقع التي يمكنها فحص نسبة التباين بين لونين، لكن معظم المتصفحات تتيح لك القيام بذلك مباشرة في أدوات المطوِّر على موقعك. لنلقِ نظرة على بعض الأمثلة الإضافية لنسبة التباين لفهم المفهوم بشكل أفضل. @@ -221,8 +229,12 @@ dashedName: how-do-you-create-good-background-and-foreground-contrast-in-your-de هذا المثال له نسبة تباين 1.48:1، وهو لا يفي حتى بمعيار AA. +## تعديل خصائص اللون + كيف يمكنك إصلاح ذلك؟ حسنًا، هناك ثلاثة جوانب تؤثر على نسبة التباين. +### تعديل درجة اللون + الأول هو اللون (hue)، الذي يمثل نوع اللون العام، مثل الأحمر أو الأزرق أو البرتقالي. دعنا ننتقل إلى لون أبعد عن الأزرق. في هذه الحالة، سنستخدم الأحمر. :::interactive_editor @@ -267,6 +279,8 @@ dashedName: how-do-you-create-good-background-and-foreground-contrast-in-your-de ::: +### تعديل التشبع + للأسف، هذا التغيير رفع نسبة التباين فقط إلى 1.49:1، مما يعني أنك بحاجة إلى تغيير التشبع، أو "كمية" اللون الموجودة. دعنا نزيد كمية الأحمر في النص. هذا يقربنا كثيرًا من الهدف، بنسبة تباين 3.54:1. :::interactive_editor @@ -325,6 +339,8 @@ dashedName: how-do-you-create-good-background-and-foreground-contrast-in-your-de ::: +### تعديل فاتح اللون + ومع ذلك، يمكنك الاقتراب أكثر بتغيير القيمة الأخيرة، وهي فاتح اللون (lightness). فاتح اللون يمثل كمية الأبيض الموجودة في اللون. دعنا نقلل فاتح اللون للأحمر. الآن هناك أحمر أغمق بكثير مقابل الخلفية الزرقاء الفاتحة، مما يرفع نسبة التباين إلى 10.34:1. @@ -479,7 +495,7 @@ dashedName: how-do-you-create-good-background-and-foreground-contrast-in-your-de ## --answers-- -اللون (Hue) +درجة اللون ### --feedback-- @@ -495,7 +511,7 @@ dashedName: how-do-you-create-good-background-and-foreground-contrast-in-your-de --- -فاتح اللون +السطوع ### --feedback-- diff --git a/curriculum/challenges/arabic/blocks/lecture-what-is-css/672acc100d59d24da7b4e09c.md b/curriculum/challenges/arabic/blocks/lecture-what-is-css/672acc100d59d24da7b4e09c.md index e8d091960b5..f8ed182ff38 100644 --- a/curriculum/challenges/arabic/blocks/lecture-what-is-css/672acc100d59d24da7b4e09c.md +++ b/curriculum/challenges/arabic/blocks/lecture-what-is-css/672acc100d59d24da7b4e09c.md @@ -7,10 +7,14 @@ dashedName: what-are-the-different-types-of-css-combinators # --interactive-- +## مركبات CSS + تُستخدم محدِّدات CSS المركبة لتعريف العلاقة بين المحدِّدات في CSS. تساعد في اختيار العناصر بناءً على علاقتها بعناصر أخرى، مما يسمح بتنسيق أكثر دقة وكفاءة. سنناقش بعض محدِّدات CSS المركبة الأساسية وحالات استخدامها، بدءًا بمحدِّد العنصر التابع. +### مركب العنصر التابع + يُستخدم محدِّد العنصر التابع لاستهداف العناصر التي يطابقها المحدِّد الثاني إذا كانت مسكنة داخل عنصر أصل يطابق المحدِّد الأول. يمكن أن يكون الأصل أبًا أو جدًا أو أي عنصر أصل آخر أعلى في شجرة المستند. لفهم كيفية عمل ذلك بشكل أفضل، دعنا نلقي نظرة على مثال. @@ -42,6 +46,8 @@ figure img { إذا كان لديك عدة صور داخل عنصر `figure`، فإن استخدام محدِّد العنصر التابع سيكون طريقة جيدة لتطبيق حدود سوداء صلبة حول كل صورة من تلك الصور. +### مركب الابن + نوع آخر من المحدِّدات هو محدِّد الطفل. محدِّد الطفل (`>`) في CSS يُستخدم لاختيار العناصر التي هي أبناء مباشرين لعنصر أب محدد. @@ -102,6 +108,8 @@ figure img { لأن العنصرين الآخرين من نوع الفقرة مسكنان داخل عناصر `div`، فلا يُعتبران أبناء مباشرين لصنف `container` ولن يحصلوا على لون النص الأزرق. +### مركب الأخ التالي + نوع آخر شائع من المحدِّدات هو محدِّد الأخ التالي. محدِّد الأخ التالي (`+`) في CSS يختار عنصرًا يتبع مباشرة عنصر أخ محدد. هذا المحدِّد مفيد عندما تريد تطبيق تنسيقات على عنصر يتبع مباشرة عنصرًا آخر، مما يسمح بالتنسيق المستهدف بناءً على موقع العنصر بالنسبة لإخوته. @@ -150,6 +158,8 @@ img + figcaption { في هذا المثال، يختار المجمّع التالي للأخوة (`+`) عنصر `figcaption` الذي يلي مباشرة عنصر `img`. تضيف قاعدة CSS المطبقة `4px solid black border` حول `figcaption`. +### مركب الأخ اللاحق + نوع آخر شائع من المحدِّدات هو محدِّد الأخ اللاحق. محدِّد الأخ اللاحق (`~`) في CSS يختار جميع الإخوة لعنصر محدد الذين يأتون بعده. @@ -202,6 +212,8 @@ h2 ~ p { يستهدف محدِّد الأخ اللاحق (`~`) جميع إخوة الفقرة الذين يظهرون بعد عنصر `h2`، بغض النظر عما إذا كانوا إخوة مباشرين أم لا. +## لماذا تهم مركبات CSS + في الختام، فهم واستخدام محدِّدات CSS المركبة المختلفة يسمح لك بتطبيق تنسيقات دقيقة على عناصر HTML، مما يعزز التحكم ومرونة التصميم. بإتقان هذه المحدِّدات، يمكنك إنشاء قواعد تنسيق أكثر تطورًا واستهدافًا تحسن مظهر ووظائف صفحات الويب الخاصة بك. diff --git a/curriculum/challenges/arabic/blocks/lecture-working-with-code-editors-and-ides/672d26269456511aa3db614d.md b/curriculum/challenges/arabic/blocks/lecture-working-with-code-editors-and-ides/672d26269456511aa3db614d.md index 004e2ccbfdf..adc65522ac7 100644 --- a/curriculum/challenges/arabic/blocks/lecture-working-with-code-editors-and-ides/672d26269456511aa3db614d.md +++ b/curriculum/challenges/arabic/blocks/lecture-working-with-code-editors-and-ides/672d26269456511aa3db614d.md @@ -7,25 +7,25 @@ dashedName: what-is-a-code-editor-and-ide # --description-- -قد تظن أنهما نفس الشيء، لكن ليس تمامًا. محرر الشفرة هو أي تطبيق يسمح لك بتحرير ملفات الشفرة. أما بيئة التطوير المتكاملة (IDE) فهي تطبيق كامل يسمح لك بترجمة الشفرة، وتشغيلها، وتصحيح الأخطاء أثناء تحريرها. +قد تظن أن هذين الشيئين متماثلان، لكنهما ليسا كذلك تمامًا. محرر الشفرة هو أي تطبيق يسمح لك بتحرير ملفات الشفرة. أما بيئة التطوير المتكاملة (IDE) فهي تطبيق كامل يسمح لك بترجمة الشفرة، وتشغيلها، وتصحيح الأخطاء أثناء تحريرها. -ربما تكون بعض الأمثلة مفيدة. +بعض الأمثلة ستساعد في التوضيح. أولًا، دعنا نلقي نظرة على بعض بيئات التطوير المتكاملة الشهيرة. Visual Studio هي بيئة تطوير متكاملة من مايكروسوفت توفر مجموعة شاملة من الأدوات لبناء التطبيقات وتصحيح أخطائها ونشرها عبر منصات مختلفة. -بيئة تطوير متكاملة أخرى هي XCode. Xcode هي بيئة تطوير متكاملة من آبل مصممة لإنشاء وترميز وتصحيح تطبيقات macOS وiOS وwatchOS وtvOS. +بيئة تطوير متكاملة أخرى هي Xcode. Xcode هي بيئة تطوير متكاملة من Apple مصممة لإنشاء، وترميز، وتصحيح الأخطاء في التطبيقات لأنظمة macOS وiOS وwatchOS وtvOS. -وبيئة تطوير متكاملة أخرى هي Android Studio. Android Studio هي بيئة تطوير متكاملة من جوجل مصممة خصيصًا لبناء وتصحيح واختبار تطبيقات أندرويد. +Android Studio، الذي طورته Google، هو بيئة تطوير متكاملة مصممة خصيصًا لبناء، وتصحيح الأخطاء، واختبار تطبيقات Android. هذه مجرد أمثلة قليلة على بيئات التطوير المتكاملة. الآن، دعنا نلقي نظرة على بعض محررات الشفرة الشهيرة. Visual Studio Code هو محرر شفرة خفيف الوزن ومفتوح المصدر من مايكروسوفت يدعم مجموعة واسعة من لغات البرمجة ويوفر ميزات مثل تصحيح الأخطاء، وتظليل الصيغة النحوية، والتحكم في الإصدارات عبر الإضافات. -محرر شهير آخر هو Sublime Text. Sublime Text هو محرر نصوص سريع ومتعدد الاستخدامات معروف بواجهته الأنيقة وميزاته القوية ودعمه لمجموعة واسعة من لغات البرمجة من خلال تظليل الصيغة النحوية القابل للتخصيص والإضافات. +لتجربة تحرير سريعة ومتعددة الاستخدامات، يقدم Sublime Text واجهة أنيقة ودعمًا لمجموعة واسعة من لغات البرمجة من خلال تمييز الصيغة النحوية القابل للتخصيص والإضافات. -وآخر هو Notepad++. هذا محرر نصوص وشفرة مصدرية مجاني ومفتوح المصدر لنظام ويندوز يوفر تظليل الصيغة النحوية، وطَي الشفرة، ومجموعة من الإضافات لتعزيز الإنتاجية والتخصيص. +يمكن لمستخدمي Windows أيضًا استخدام Notepad++، وهو محرر نصوص ومصدر شفرة مجاني ومفتوح المصدر يوفر تمييز الصيغة النحوية، وطي الشفرة، ومجموعة من الإضافات لتعزيز الإنتاجية والتخصيص. -ربما لاحظت كيف يركز محررو الشفرة بشكل أساسي على محتوى النص في الملف، بينما تتيح بيئات التطوير المتكاملة أدوات مختلفة لإدارة الشفرة. +قد لاحظت كيف يركز محررو الشفرة بشكل أساسي على محتوى النص في الملف، بينما تتيح بيئات التطوير المتكاملة أدوات مختلفة لإدارة الشفرة. كل هذه الأمثلة برامج محلية يمكنك تشغيلها على جهاز الكمبيوتر الخاص بك، لكن هناك أيضًا محررات قائمة على السحابة يمكنك استخدامها. @@ -35,11 +35,11 @@ Visual Studio Code هو محرر شفرة خفيف الوزن ومفتوح ال Replit هو منصة عبر الإنترنت توفر بيئة تعاونية للترميز، تتيح للمستخدمين كتابة وتشغيل ومشاركة الشفرة بلغات برمجة مختلفة مباشرة من متصفح الويب. -محرر آخر شهير قائم على السحابة هو GitHub Codespaces. هذه بيئة تطوير قائمة على السحابة توفر وصولًا فوريًا إلى محرر شفرة وأدوات تطوير مهيأة بالكامل مباشرة من GitHub، مما يمكّن الترميز والتعاون بسلاسة. +محرر سحابي شهير آخر هو GitHub Codespaces. هذه بيئة تطوير سحابية توفر وصولًا فوريًا إلى محرر شفرة مُعد بالكامل وأدوات تطوير مباشرة من GitHub، مما يتيح الترميز والتعاون بسلاسة. -وآخر هو Ona. Ona هي بيئة تطوير قائمة على السحابة تتكامل مع GitHub وGitLab، وتوفر مساحات عمل فورية وقابلة للتخصيص للترميز والبناء وتصحيح الأخطاء مباشرة من متصفحك. +تتكامل Ona مع GitHub وGitLab لتوفير مساحات عمل فورية وقابلة للتخصيص للترميز والبناء وتصحيح الأخطاء مباشرة من متصفحك. -وهناك العديد من الخيارات الأخرى. بعض الخيارات، مثل Visual Studio Code، قابلة للتوسيع بشكل كبير ويمكنها العمل مع أنواع مختلفة من المشاريع واللغات. خيارات أخرى قد تكون مخصصة لمجموعة جزئية صغيرة من اللغات أو أنواع المشاريع. +وهناك العديد من الخيارات الأخرى. بعض الخيارات، مثل Visual Studio Code، قابلة للتوسيع بشكل كبير ويمكنها العمل مع العديد من أنواع المشاريع واللغات. خيارات أخرى قد تكون مخصصة لمجموعة جزئية صغيرة من اللغات أو أنواع المشاريع. التطبيق الذي تستخدمه قد يختلف حسب المشروع المحدد. يجب أن تستكشف الخيارات لترى ما يناسب احتياجاتك أفضل. diff --git a/curriculum/challenges/arabic/blocks/lecture-working-with-code-editors-and-ides/672d45583fd75a504136fbbb.md b/curriculum/challenges/arabic/blocks/lecture-working-with-code-editors-and-ides/672d45583fd75a504136fbbb.md index e2e3595eaff..ac173a5e9af 100644 --- a/curriculum/challenges/arabic/blocks/lecture-working-with-code-editors-and-ides/672d45583fd75a504136fbbb.md +++ b/curriculum/challenges/arabic/blocks/lecture-working-with-code-editors-and-ides/672d45583fd75a504136fbbb.md @@ -1,17 +1,17 @@ --- id: 672d45583fd75a504136fbbb -title: كيفية تثبيت Visual Studio Code على جهاز الكمبيوتر الخاص بك +title: كيفية تثبيت Visual Studio Code على جهاز الكمبيوتر challengeType: 19 dashedName: how-to-install-visual-studio-code-onto-your-computer --- # --description-- -لتثبيت VS Code، زر موقعهم لتحصل على المثبت المناسب لنظام التشغيل لديك. تأكد من زيارة موقع VS Code، وليس موقع Visual Studio. +لتثبيت VS Code، زر موقع VS Code لتحصل على المثبت المناسب لنظام التشغيل لديك. تأكد من زيارة موقع VS Code، وليس موقع Visual Studio. -لنظام ويندوز، يمكنك تنزيل مثبت EXE. بعد التنزيل، شغّل الملف وسيرشدك معالج التثبيت خلال العملية. +لنظام ويندوز، يمكنك تحميل مثبت EXE. بعد التحميل، شغّل الملف، وسيأخذك معالج التثبيت خلال خطوات العملية. -لنظام ماك، يمكنك تنزيل أرشيف zip يحتوي على `.app` يمكنك تشغيله. يمكنك أيضًا تثبيت VS Code عبر homebrew. +لنظام ماك، يمكنك تحميل أرشيف `.zip` يحتوي على `.app` يمكنك تشغيله. يمكنك أيضًا تثبيت VS Code عبر Homebrew. افتح تطبيق Terminal على جهاز ماك وشغّل الأمر التالي: diff --git a/curriculum/challenges/arabic/blocks/lecture-working-with-code-editors-and-ides/672d45651d83b450801efb3a.md b/curriculum/challenges/arabic/blocks/lecture-working-with-code-editors-and-ides/672d45651d83b450801efb3a.md index f66c53dd11f..2422e310221 100644 --- a/curriculum/challenges/arabic/blocks/lecture-working-with-code-editors-and-ides/672d45651d83b450801efb3a.md +++ b/curriculum/challenges/arabic/blocks/lecture-working-with-code-editors-and-ides/672d45651d83b450801efb3a.md @@ -9,15 +9,15 @@ dashedName: how-to-create-a-project-and-run-your-code-locally-in-vs-code لتبدأ، يجب أن تعرف أن VS Code يعتبر المشاريع "مساحات عمل". مساحة العمل هي أي مجلد تفتحه في VS Code. -لبدء العمل، ستحتاج إلى استخدام واجهة سطر الأوامر لإنشاء مجلد جديد لمشروعك الجديد. المجلد هو اسم آخر للدليل. +لتبدأ، تحتاج إلى استخدام واجهة سطر الأوامر لإنشاء مجلد جديد لمشروعك الجديد. المجلد هو اسم آخر للدليل. -تسمح لك واجهات سطر الأوامر، أو CLI اختصارًا، بالتفاعل مع نظام التشغيل الخاص بك من خلال أوامر نصية. ستتعلم المزيد عن هذه الأدوات في دروس لاحقة. +تسمح لك واجهات سطر الأوامر، أو CLI اختصارًا، بالتفاعل مع نظام التشغيل الخاص بك عبر أوامر نصية. ستتعلم المزيد عن هذه الأدوات في دروس لاحقة. إذا كنت تستخدم ويندوز، يمكنك استخدام موجه الأوامر أو PowerShell. وإذا كنت على ماك، يمكنك فتح تطبيق Terminal. -بمجرد فتح سطر الأوامر، انتقل إلى مجلد المنزل بكتابة الأمر `cd ~` واضغط `enter` على لوحة المفاتيح. ثم اكتب الأمر `mkdir my-project` واضغط `enter`. الأمر `mkdir`، أو "إنشاء مجلد"، هو الأمر المستخدم لإنشاء مجلد جديد. بعد ذلك، يجب أن تفتح مجلدك الجديد في VS Code. +بمجرد فتح واجهة سطر الأوامر، انتقل إلى مجلد المنزل الخاص بك. في Command Prompt، اكتب `cd /d %USERPROFILE%` واضغط `Enter` على لوحة المفاتيح. في PowerShell أو Terminal على macOS، اكتب `cd ~` واضغط `Enter`. ثم اكتب الأمر `mkdir my-project` واضغط `Enter`. الأمر `mkdir`، أو "إنشاء مجلد"، هو الأمر المستخدم لإنشاء مجلد جديد. بعد ذلك، يجب أن تفتح مجلدك الجديد باستخدام VS Code. -هناك أيضًا بعض الطرق الرسومية الأخرى لإنشاء مجلد جديد. +هناك أيضًا طرق أخرى لفتح مجلد في VS Code. اعتمادًا على نظام التشغيل، قد يكون لديك قائمة سياقية (أو خيار النقر بزر الماوس الأيمن) لفتح VS Code مباشرة من مستكشف الملفات. يمكنك أيضًا النقر نقرًا مزدوجًا على تطبيق VS Code. إذا كنت مرتاحًا مع سطر الأوامر، يمكنك تشغيل الأمر `code /path/to/folder`. @@ -31,15 +31,15 @@ dashedName: how-to-create-a-project-and-run-your-code-locally-in-vs-code بدلاً من ذلك، يجب أن تضع ملف HTML خلف خادم ويب مناسب. قد يبدو هذا مهمة مخيفة إذا كنت جديدًا على البرمجة، لكن هناك طريقة لفعل ذلك مباشرة من VS Code. -ستحتاج أولًا إلى تثبيت إضافة _Live Server_، المتوفرة مجانًا في السوق. +ستحتاج أولًا إلى تثبيت إضافة Live Server، المتوفرة مجانًا في السوق. -انقر على تبويب الإضافات في الزاوية اليسرى واكتب `Live Server` في شريط البحث. +انقر على تبويب الإضافات في الشريط الجانبي الأيسر واكتب `Live Server` في شريط البحث. -بمجرد تثبيتها، يجب أن ترى زر `Go live` في شريط الحالة. تأكد من فتح ملف HTML الخاص بك، ثم انقر عليه. +بمجرد تثبيت الإضافة، يجب أن ترى زر `Go Live` في شريط الحالة. تأكد من فتح ملف HTML الخاص بك، ثم انقر على الزر. -يجب أن تفتح صفحتك الجديدة تلقائيًا في تبويب جديد في المتصفح. إذا لم يحدث ذلك، يمكنك الذهاب مباشرة إلى `http://localhost:5500/` +يجب أن تفتح صفحتك الجديدة تلقائيًا في تبويب جديد في المتصفح. إذا لم يحدث ذلك، يمكنك الذهاب مباشرة إلى `http://localhost:5500/`. -تهانينا! لقد أعددت الآن مشروعك الخاص في VS Code، ويمكنك عرض تغييراتك باستخدام الخادم الحي. +تهانينا! لقد أعددت الآن مشروعك الخاص في VS Code، ويمكنك عرض تغييراتك باستخدام Live Server. # --questions-- @@ -57,7 +57,7 @@ dashedName: how-to-create-a-project-and-run-your-code-locally-in-vs-code --- -المجلد الذي فتحت منه VS Code. +الدليل الذي فتحته في VS Code. --- @@ -121,7 +121,7 @@ dashedName: how-to-create-a-project-and-run-your-code-locally-in-vs-code ## --answers-- -Web Server. +خادم الويب. ### --feedback-- @@ -133,7 +133,7 @@ Live Server. --- -Local Host. +المضيف المحلي. ### --feedback-- @@ -141,7 +141,7 @@ Local Host. --- -HTML Preview. +معاينة HTML. ### --feedback-- diff --git a/curriculum/challenges/arabic/blocks/lecture-working-with-code-editors-and-ides/672d456f4ac35950b300e93f.md b/curriculum/challenges/arabic/blocks/lecture-working-with-code-editors-and-ides/672d456f4ac35950b300e93f.md index 77edb42629f..7b29da4e820 100644 --- a/curriculum/challenges/arabic/blocks/lecture-working-with-code-editors-and-ides/672d456f4ac35950b300e93f.md +++ b/curriculum/challenges/arabic/blocks/lecture-working-with-code-editors-and-ides/672d456f4ac35950b300e93f.md @@ -11,19 +11,19 @@ dashedName: what-are-several-useful-keyboard-shortcuts-for-maximizing-productivi لكن هناك بعض الاختصارات الخاصة بالتطبيق والتي يمكنها رفع إنتاجيتك. يجدر بالذكر أن بعض هذه الاختصارات قد تختلف حسب نظام التشغيل. -على سبيل المثال، `Shift + Alt + F` يشغل أداة التنسيق المهيأة لديك (مثل prettier، لمشروع JavaScript) على الملف المفتوح حاليًا. +على سبيل المثال، `Shift + Alt + F` يُشغّل أداة التنسيق المُعدة لديك (مثل Prettier لمشروع JavaScript) على الملف المفتوح حاليًا. -أو `Ctrl + Shift + F` (ويندوز)، أو `Cmd + Shift + F` (ماك)، للبحث في محتوى النص لجميع الملفات في مساحة العمل. ثم `Ctrl + Shift + H` (ويندوز)، أو `Cmd + Shift + H` (ماك)، إذا أردت تشغيل البحث والاستبدال. +استخدم `Ctrl + Shift + F` (ويندوز/لينكس) أو `Cmd + Shift + F` (ماك) للبحث في محتوى النص لجميع الملفات في مساحة العمل. ثم استخدم `Ctrl + Shift + H` (ويندوز/لينكس) أو `Cmd + Shift + H` (ماك) إذا أردت تشغيل البحث والاستبدال. -إذا احتجت إلى حذف سطر، `Ctrl + Shift + K` (ويندوز)، أو `Cmd + Shift + K` (ماك)، سيحذفه. +إذا احتجت إلى حذف سطر، فإن `Ctrl + Shift + K` (ويندوز/لينكس) أو `Cmd + Shift + K` (ماك) سيحذفه. -هل تحتاج إلى مساحة إضافية لكل شفرتك؟ `Ctrl + B` (ويندوز)، أو `Cmd + B` (ماك)، يخفي الشريط الجانبي - الذي يحتوي على قائمة الملفات وقائمة الإضافات. +هل تحتاج إلى مساحة إضافية لكل شفرتك؟ `Ctrl + B` (ويندوز) أو `Cmd + B` (ماك) يخفي الشريط الجانبي الذي يحتوي على قائمة الملفات وقائمة الإضافات. -أو ربما لا تستطيع رؤية شفرتك؟ `Ctrl + plus` (ويندوز)، أو `Cmd + plus` (ماك)، يزيد من تكبير المحرر، و`Ctrl + minus` (ويندوز)، أو `Cmd + minus` (ماك)، يقلله. +أو ربما لا تستطيع رؤية شفرتك؟ `Ctrl + Plus` (ويندوز) أو `Cmd + Plus` (ماك) يزيد من تكبير المحرر، و`Ctrl + Minus` (ويندوز) أو `Cmd + Minus` (ماك) يقلله. -ميزة أخرى مفيدة في VS Code هي التحرير متعدد الأسطر، الذي يسمح لك بإجراء تغييرات عبر عدة أسطر دفعة واحدة. على سبيل المثال، يمكنك وضع عدة مؤشرات باستخدام `Ctrl + Alt + down` و`Ctrl + Alt + up` (ويندوز/لينكس)، أو `Option + Command + down` و`Option + Command + up` (ماك)، لتمديد المؤشر إلى أسطر متتالية. يمكنك أيضًا الضغط مع الاستمرار على `Alt` (ويندوز/لينكس) أو `Option` (ماك) والنقر لإضافة مؤشرات على أسطر منفصلة حيثما تحتاجها. بمجرد وضع المؤشرات، أي شيء تكتبه أو تحذفه سيطبق على كل تلك المواقع في نفس الوقت — مما يوفر الكثير من الوقت عند العمل على شفرة متكررة. +ميزة أخرى مفيدة في VS Code هي التحرير متعدد الأسطر، الذي يسمح لك بإجراء تغييرات عبر عدة أسطر دفعة واحدة. على سبيل المثال، يمكنك وضع عدة مؤشرات باستخدام `Ctrl + Alt + Down` و`Ctrl + Alt + Up` (ويندوز/لينكس)، أو `Option + Cmd + Down` و`Option + Cmd + Up` (ماك) لتمديد المؤشر إلى أسطر متتالية. يمكنك أيضًا الضغط مع الاستمرار على `Alt` (ويندوز/لينكس) أو `Option` (ماك) والنقر لإضافة مؤشرات على أسطر منفصلة حيثما تحتاجها. بمجرد وضع المؤشرات، أي شيء تكتبه أو تحذفه سيُطبق على كل تلك المواقع في نفس الوقت — مما يوفر الكثير من الوقت عند العمل على شفرة متكررة. -أخيرًا، إذا نسيت أيًا من هذه الاختصارات، لديك دائمًا `Ctrl + Shift + P` (ويندوز)، أو `Cmd + Shift + P` (ماك)، التي تفتح لوحة الأوامر لتختار ما تحتاجه. +أخيرًا، إذا نسيت أيًا من هذه الاختصارات، يمكنك دائمًا استخدام `Ctrl + Shift + P` (ويندوز/لينكس) أو `Cmd + Shift + P` (ماك) لفتح لوحة الأوامر واختيار ما تحتاجه. مع هذه المعرفة، وربما بعض الممارسة، أنت في طريقك لتصبح مستخدمًا محترفًا لـ VS Code. diff --git a/curriculum/challenges/arabic/blocks/lecture-working-with-code-editors-and-ides/672d457bcdd8b350ec2b6254.md b/curriculum/challenges/arabic/blocks/lecture-working-with-code-editors-and-ides/672d457bcdd8b350ec2b6254.md index f616cd1c296..e73ab26779e 100644 --- a/curriculum/challenges/arabic/blocks/lecture-working-with-code-editors-and-ides/672d457bcdd8b350ec2b6254.md +++ b/curriculum/challenges/arabic/blocks/lecture-working-with-code-editors-and-ides/672d457bcdd8b350ec2b6254.md @@ -7,25 +7,25 @@ dashedName: what-are-some-good-vs-code-extensions-you-can-use-in-your-editor # --description-- -_Better Comments_ إضافة تقدم تمييزًا خاصًا لأنواع معينة من تعليقات الشفرة. على سبيل المثال، ستبرز تعليقات "TODO"، بالإضافة إلى صيغة تشير إلى الأسئلة أو التحذيرات. +Better Comments هو امتداد يوفّر تمييزًا خاصًا لأنواع معينة من تعليقات الشفرة. على سبيل المثال، يبرز تعليقات "TODO"، بالإضافة إلى صيغة نحوية تشير إلى الأسئلة أو التحذيرات. -_Code Spell Checker_ يشير إلى وجود أخطاء إملائية في شفرتك. وبما أنه مصمم لملفات الشفرة، فإنه يأخذ في الاعتبار أشياء مثل camel case. +Code Spell Checker يعلّم الكلمات التي تحتوي على أخطاء إملائية في شفرتك. وبما أنه مصمم لملفات الشفرة، فإنه يأخذ في الاعتبار أشياء مثل camel case. -_Error Lens_ يساعدك على اكتشاف أي أخطاء مميزة في شفرتك. بدلًا من الاعتماد على التسطير الذي يعرضه VS Code افتراضيًا، تبرز هذه الإضافة السطر بأكمله وتعرض رسالة الخطأ. +Error Lens يجعل من الصعب تفويت الأخطاء في شفرتك. بدلًا من الاعتماد على التسطير الذي يعرضه VS Code افتراضيًا، يميّز هذا الامتداد السطر بأكمله ويعرض رسالة الخطأ. -_Indent Rainbow_ يضيف ألوانًا لمستويات التراجع المختلفة في شفرتك. مع تلوين أزواج الأقواس الأصلي في VS Code، يساعد هذا بشكل كبير في تحديد نطاق الشفرة التي تعمل عليها. +Indent Rainbow يضيف ألوانًا لمستويات التراجع المختلفة في شفرتك. وبالاشتراك مع تلوين أزواج الأقواس الأصلي في VS Code، يساعد هذا بشكل كبير في تحديد نطاق الشفرة التي تعمل عليها. -أو ربما تبحث عن شيء أكثر عملية؟ فكر في مساعد ذكي، مثل _GitHub Copilot_ أو _Tabnine_، ليقدم لك اقتراحات مضمَّنة أثناء كتابة الشفرة. +أو ربما تبحث عن شيء أكثر عملية؟ فكّر في مساعد ذكي، مثل GitHub Copilot أو Tabnine، ليقدم لك اقتراحات مضمّنة أثناء كتابة الشفرة. -حزمة أيقونات، مثل _VS Code Great Icons_، تساعد على جعل شجرة الملفات أنظف وأسهل في الفهم بنظرة سريعة. وإضافة مثل _Colorize_ تساعدك على فهم القيم في خصائص CSS. +حزمة أيقونات، مثل VS Code Great Icons، تساعد في جعل شجرة الملفات أنظف وأسهل للفهم بنظرة سريعة. وامتداد مثل Colorize يساعدك على فهم القيم في خصائص CSS الخاصة بك. -ستحتاج أيضًا إلى إضافات خاصة باللغات لمشاريعك. إذا كنت تستخدم JavaScript، فربما تريد _ESLint_ و _Prettier_ لفحص وتنسيق الشفرة. وإذا كنت تستخدم TypeScript، فقد تحتاج _Pretty TypeScript Errors_ لرسائل أسهل في القراءة. +ستحتاج أيضًا إلى امتدادات خاصة باللغات لمشاريعك. إذا كنت تستخدم JavaScript، فغالبًا ما تحتاج إلى ESLint وPrettier لفحص وتنسيق الشفرة. وإذا كنت تستخدم TypeScript، قد تحتاج إلى Pretty TypeScript Errors لرسائل أسهل قراءة. -وأخيرًا، يمكنك أيضًا الاستمتاع قليلاً مع محررك. تقدم _VS Code Pets_ حيوانات افتراضية قابلة للتخصيص لترافقك أثناء معالجة بعض الأخطاء البرمجية. +أخيرًا، يمكنك أيضًا الاستمتاع قليلاً مع محررك. VS Code Pets يوفّر حيوانات أليفة افتراضية قابلة للتخصيص لتبقيك رفيقًا أثناء إصلاح الأخطاء البرمجية. -_Power Mode_ يخلق تأثيرات بصرية لافتة عندما تحقق "كومبو" عالي بكتابة المزيد من الشفرة. +Power Mode يخلق تأثيرات بصرية لافتة عندما تحقق "كومبو" عاليًا بكتابة المزيد من الشفرة. -_Discord Presence_ يتيح لك عرض ما تعمل عليه لجميع أصدقائك. +Discord Presence يتيح لك عرض ما تعمل عليه لجميع أصدقائك. وهناك الكثير من الإضافات الأخرى. استكشف سوق الإضافات لترى ما يناسبك أكثر. @@ -33,7 +33,7 @@ _Discord Presence_ يتيح لك عرض ما تعمل عليه لجميع أصد ## --text-- -ما الميزة التي تقدمها إضافة "Better Comments" في VS Code؟ +ما الميزة التي يوفّرها امتداد Better Comments في VS Code؟ ## --answers-- @@ -69,7 +69,7 @@ _Discord Presence_ يتيح لك عرض ما تعمل عليه لجميع أصد ## --text-- -أي إضافة في VS Code توصف بأنها تساعد على اكتشاف الأخطاء المميزة في شفرتك عن طريق عرض رسالة الخطأ على السطر بأكمله؟ +أي امتداد في VS Code يميّز السطر بأكمله ويعرض رسالة الخطأ مضمّنة، بدلًا من الاعتماد على التسطير الافتراضي؟ ## --answers-- @@ -105,7 +105,7 @@ ESLint ## --text-- -ما الميزة الفريدة التي تقدمها إضافة "VS Code Pets"؟ +ما الميزة الفريدة التي يوفّرها امتداد VS Code Pets؟ ## --answers-- diff --git a/curriculum/challenges/arabic/blocks/lecture-working-with-css-flexbox/672aa7f7284b235f46f7d4e9.md b/curriculum/challenges/arabic/blocks/lecture-working-with-css-flexbox/672aa7f7284b235f46f7d4e9.md index 7558140db03..12f7e7a8ee7 100644 --- a/curriculum/challenges/arabic/blocks/lecture-working-with-css-flexbox/672aa7f7284b235f46f7d4e9.md +++ b/curriculum/challenges/arabic/blocks/lecture-working-with-css-flexbox/672aa7f7284b235f46f7d4e9.md @@ -319,7 +319,7 @@ CSS flexbox هو نموذج تخطيط قوي يوفر طريقة مرنة وف ### --feedback-- -فكر في توزيع العناصر داخل الحاوية المرنة. +فكر في كيفية تموضع المحور الرئيسي والمحور المتقاطع بالنسبة لبعضهما. --- @@ -327,7 +327,7 @@ CSS flexbox هو نموذج تخطيط قوي يوفر طريقة مرنة وف ### --feedback-- -فكر في توزيع العناصر داخل الحاوية المرنة. +فكر في كيفية تموضع المحور الرئيسي والمحور المتقاطع بالنسبة لبعضهما. --- @@ -339,7 +339,7 @@ CSS flexbox هو نموذج تخطيط قوي يوفر طريقة مرنة وف ### --feedback-- -فكر في توزيع العناصر داخل الحاوية المرنة. +فكر في كيفية تموضع المحور الرئيسي والمحور المتقاطع بالنسبة لبعضهما. ## --video-solution-- diff --git a/curriculum/challenges/arabic/blocks/lecture-working-with-css-flexbox/672bd658c0e190f674a5e057.md b/curriculum/challenges/arabic/blocks/lecture-working-with-css-flexbox/672bd658c0e190f674a5e057.md index bddffbcffe8..86f4815186a 100644 --- a/curriculum/challenges/arabic/blocks/lecture-working-with-css-flexbox/672bd658c0e190f674a5e057.md +++ b/curriculum/challenges/arabic/blocks/lecture-working-with-css-flexbox/672bd658c0e190f674a5e057.md @@ -7,11 +7,11 @@ dashedName: what-are-some-common-flex-properties # --interactive-- -خصائص Flex هي خصائص يمكنك تطبيقها على الحاويات المرنة لتحديد توزيع العناصر الفرعية. سنغطي بعضًا من أكثرها استخدامًا: `flex-wrap`، و`justify-content`، و`align-items`. +تتحكم خصائص flex في كيفية تصرف العناصر داخل تخطيط مرن، من توزيع على مستوى الحاوية إلى محاذاة ذاتية على مستوى العنصر. سنغطي بعضًا من أكثرها استخدامًا في هذا الدرس: `flex-wrap`، `flex-flow`، `justify-content`، `align-items`، و`align-self`. -لنبدأ بـ `flex-wrap`. تحدد هذه الخاصية كيفية لف العناصر المرنة داخل الحاوية المرنة لتناسب المساحة المتاحة. يمكن أن تأخذ `flex-wrap` ثلاث قيم ممكنة: `nowrap`، و`wrap`، و`wrap-reverse`. القيمة الافتراضية هي `nowrap`—لن تُلف العناصر المرنة إلى سطر جديد حتى لو تجاوز عرضها عرض الحاوية. +لنبدأ بـ `flex-wrap`. تحدد هذه الخاصية كيفية لف العناصر المرنة داخل الحاوية المرنة لتناسب المساحة المتاحة. يمكن أن تأخذ `flex-wrap` ثلاث قيم ممكنة: `nowrap`، `wrap`، و`wrap-reverse`. القيمة الافتراضية هي `nowrap`: لن تُلف العناصر المرنة إلى سطر جديد حتى لو تجاوز عرضها عرض الحاوية. -في الشفرة أدناه، لدينا ثلاثة عناصر `div`. ركز على خاصية `width`. الحاوية `main` ذات الحدود الحمراء لها `width` بقيمة `200px`، بينما العناصر الثلاثة التابعة لها من نوع `div` مجموع `width` لها هو `240px` (كل واحد منها `80px`). +في الشفرة أدناه، لدينا ثلاثة عناصر `div`. لنركز على `width`. الحاوية `main` المحددة بحدود لها `width` مقدارها `200px`، بينما يبلغ مجموع `width` لعناصر `div` الثلاثة الفرعية `240px` (`80px` لكل منها): :::interactive_editor @@ -28,7 +28,7 @@ dashedName: what-are-some-common-flex-properties main { width: 200px; display: flex; - border: 2px solid red; + border: 2px solid #444; } div { @@ -51,7 +51,6 @@ div { ::: - عرض عناصر `div` يتجاوز عرض الحاوية، لكن افتراضيًا سيتم تقليصها لتناسب المساحة المتاحة. إذا أردت لفها عند تجاوز عرضها عرض الحاوية، يمكنك تعيين `flex-wrap: wrap` على الحاوية المرنة: :::interactive_editor @@ -70,7 +69,7 @@ main { width: 200px; display: flex; flex-wrap: wrap; - border: 2px solid red; + border: 2px solid #444; } div { @@ -109,9 +108,10 @@ div { ```css main { width: 200px; + height: 120px; display: flex; flex-flow: column wrap-reverse; - border: 2px solid red; + border: 2px solid #444; } div { @@ -151,7 +151,7 @@ div { main { display: flex; justify-content: flex-start; - border: 2px solid red; + border: 2px solid #444; } div { @@ -191,7 +191,7 @@ div { main { display: flex; justify-content: flex-end; - border: 2px solid red; + border: 2px solid #444; } div { @@ -231,7 +231,7 @@ div { main { display: flex; justify-content: center; - border: 2px solid red; + border: 2px solid #444; } div { @@ -254,7 +254,7 @@ div { ::: -لتوزيع العناصر بالتساوي على طول المحور الرئيسي، يمكنك استخدام `justify-content: space-between`. سيضيف هذا بعض الفراغ بين العناصر المرنة إذا لزم الأمر. +لتوزيع العناصر على المحور الرئيسي بدون فراغات عند الحواف، يمكنك استخدام `justify-content: space-between`. يجلس العنصر الأول عند بداية المحور الرئيسي، والآخر عند نهايته، ويتم توزيع أي مساحة متبقية بين العناصر المجاورة. :::interactive_editor @@ -271,7 +271,7 @@ div { main { display: flex; justify-content: space-between; - border: 2px solid red; + border: 2px solid #444; } div { @@ -294,7 +294,7 @@ div { ::: -`justify-content: space-around` يوزع العناصر المرنة بالتساوي داخل المحور الرئيسي، مضيفًا فراغًا قبل العنصر الأول وبعد العنصر الأخير. هذا الفراغ الإضافي هو نصف الفراغ بين كل زوج من العناصر المجاورة. إذا كان هناك عنصر واحد فقط للتوزيع، فسيتم تمركزه. +`justify-content: space-around` يوزع العناصر المرنة بالتساوي على المحور الرئيسي، مضيفًا فراغًا قبل العنصر الأول وبعد العنصر الأخير. هذه المساحة الإضافية تساوي نصف المسافة بين كل زوج من العناصر المجاورة. إذا كان هناك عنصر واحد فقط للتوزيع، فسيتم تمركزه. :::interactive_editor @@ -311,7 +311,7 @@ div { main { display: flex; justify-content: space-around; - border: 2px solid red; + border: 2px solid #444; } div { @@ -334,8 +334,7 @@ div { ::: - -وأخيرًا، لدينا `justify-content: space-evenly`، التي توزع العناصر بالتساوي على طول المحور الرئيسي. الفراغ بين العناصر والفراغ قبل وبعد العنصرين الأول والأخير متساوٍ تمامًا: +وأخيرًا، لدينا `justify-content: space-evenly`، التي توزع العناصر بالتساوي على المحور الرئيسي. المسافة بين العناصر والمسافة قبل وبعد العنصرين الأول والأخير متساوية تمامًا: :::interactive_editor @@ -352,7 +351,7 @@ div { main { display: flex; justify-content: space-evenly; - border: 2px solid red; + border: 2px solid #444; } div { @@ -390,10 +389,10 @@ div { ```css main { - height: 300px; display: flex; + height: 300px; align-items: center; - border: 2px solid red; + border: 2px solid #444; } div { @@ -431,10 +430,10 @@ div { ```css main { - height: 300px; display: flex; + height: 300px; align-items: flex-start; - border: 2px solid red; + border: 2px solid #444; } div { @@ -472,10 +471,10 @@ div { ```css main { - height: 300px; display: flex; + height: 300px; align-items: flex-end; - border: 2px solid red; + border: 2px solid #444; } div { @@ -498,33 +497,43 @@ div { ::: -لتمديد العناصر المرنة على طول المحور المتقاطع، يمكنك استخدام `align-items: stretch`. هذا يعمل أيضًا مع العناصر التي تُحدد أبعادها تلقائيًا، مثل تلك التي لا تحتوي على `width` أو `height` محددة، أو التي تحتوي فقط على `width` أو `height` كحد أدنى. ستمتد العناصر المرنة لملء الحاوية في اتجاه المحور المتقاطع. +لتمديد العناصر المرنة على المحور المتقاطع، يمكنك استخدام `align-items: stretch`. يؤثر هذا فقط على العناصر التي يكون حجمها على المحور المتقاطع `auto`؛ العناصر التي لها حجم محدد صراحةً على المحور المتقاطع (مثل `height` محدد في حاوية صف) لن تتمدد. العناصر المتأثرة ستملأ الحاوية في اتجاه المحور المتقاطع. :::interactive_editor ```html <link rel="stylesheet" href="styles.css"> - -<div class="container"> - <div class="box">One</div> - <div class="box">Two</div> - <div class="box">Three</div> -</div> - +<main> + <div id="first-div"></div> + <div id="second-div"></div> + <div id="third-div"></div> +</main> ``` ```css -.container { +main { display: flex; - align-items: stretch; + height: 300px; + align-items: stretch; border: 2px solid #444; - height: 200px; } -.box { - width: 100px; - border: 1px solid #888; - background-color: lightblue; +div { + width: 80px; + height: 50px; +} + +#first-div { + background-color: #4d70b2; +} + +#second-div { + background-color: #5c4db2; +} + +#third-div { + background-color: #4da3b2; + height: auto; } ``` @@ -536,33 +545,37 @@ div { ```html <link rel="stylesheet" href="styles.css"> - -<div class="container"> - <div class="box">One</div> - <div class="box">Two</div> - <div class="box special">Three</div> -</div> - +<main> + <div id="first-div"></div> + <div id="second-div"></div> + <div id="third-div"></div> +</main> ``` ```css -.container { +main { display: flex; - align-items: flex-start; + height: 300px; + align-items: flex-start; border: 2px solid #444; - height: 200px; } -.box { - width: 100px; - border: 1px solid #888; - background-color: lightblue; - margin: 4px; +div { + width: 80px; + height: 50px; } -.special { - align-self: stretch; - background-color: lightcoral; +#first-div { + background-color: #4d70b2; +} + +#second-div { + background-color: #5c4db2; +} + +#third-div { + background-color: #4da3b2; + align-self: stretch; } ``` @@ -574,33 +587,37 @@ div { ```html <link rel="stylesheet" href="styles.css"> - -<div class="container"> - <div class="box">One</div> - <div class="box">Two</div> - <div class="box special">Three</div> -</div> - +<main> + <div id="first-div"></div> + <div id="second-div"></div> + <div id="third-div"></div> +</main> ``` ```css -.container { +main { display: flex; - align-items: flex-start; + height: 300px; + align-items: flex-start; border: 2px solid #444; - height: 200px; } -.box { - width: 100px; - border: 1px solid #888; - background-color: lightblue; - margin: 4px; +div { + width: 80px; + height: 50px; +} + +#first-div { + background-color: #4d70b2; +} + +#second-div { + background-color: #5c4db2; } -.special { - align-self: center; - background-color: lightcoral; +#third-div { + background-color: #4da3b2; + align-self: center; } ``` @@ -612,33 +629,37 @@ div { ```html <link rel="stylesheet" href="styles.css"> - -<div class="container"> - <div class="box">One</div> - <div class="box">Two</div> - <div class="box special">Three</div> -</div> - +<main> + <div id="first-div"></div> + <div id="second-div"></div> + <div id="third-div"></div> +</main> ``` ```css -.container { +main { display: flex; - align-items: flex-start; + height: 300px; + align-items: flex-start; border: 2px solid #444; - height: 200px; } -.box { - width: 100px; - border: 1px solid #888; - background-color: lightblue; - margin: 4px; +div { + width: 80px; + height: 50px; +} + +#first-div { + background-color: #4d70b2; } -.special { - align-self: flex-start; - background-color: lightcoral; +#second-div { + background-color: #5c4db2; +} + +#third-div { + background-color: #4da3b2; + align-self: flex-start; } ``` @@ -650,39 +671,43 @@ div { ```html <link rel="stylesheet" href="styles.css"> - -<div class="container"> - <div class="box">One</div> - <div class="box">Two</div> - <div class="box special">Three</div> -</div> - +<main> + <div id="first-div"></div> + <div id="second-div"></div> + <div id="third-div"></div> +</main> ``` ```css -.container { +main { display: flex; - align-items: flex-start; + height: 300px; + align-items: flex-start; border: 2px solid #444; - height: 200px; } -.box { - width: 100px; - border: 1px solid #888; - background-color: lightblue; - margin: 4px; +div { + width: 80px; + height: 50px; } -.special { - align-self: flex-end; - background-color: lightcoral; +#first-div { + background-color: #4d70b2; +} + +#second-div { + background-color: #5c4db2; +} + +#third-div { + background-color: #4da3b2; + align-self: flex-end; } ``` ::: -هناك خصائص وقيم أخرى لـ flex يمكنك اختيارها لإنشاء التخطيط المتجاوب الذي تتصوره، لكن هذه هي الأكثر استخدامًا. مع هذه الخصائص في CSS flex ومعرفتك الجديدة بنموذج CSS flex، يمكنك البدء في إنشاء تخطيطات متجاوبة لتوفير تجربة مستخدم سلسة وشاملة عبر الأجهزة. +هناك خصائص وقيم flex أخرى يمكنك اختيارها لإنشاء التخطيط المتجاوب الذي تتصوره، لكن هذه هي الأكثر استخدامًا. مع هذه الخصائص في CSS ونموذج flex الجديد الذي تعلمته، يمكنك البدء في إنشاء تخطيطات متجاوبة لتوفير تجربة مستخدم سلسة وشاملة عبر الأجهزة. # --questions-- @@ -764,7 +789,7 @@ div { ## --answers-- -`flex-direction` و`justify-content`. +`flex-direction` و `justify-content` ### --feedback-- @@ -772,7 +797,7 @@ div { --- -`flex-direction` و`align-items`. +`flex-direction` و `align-items` ### --feedback-- @@ -780,7 +805,7 @@ div { --- -`flex-direction` و`align-content`. +`flex-direction` و `align-content` ### --feedback-- @@ -788,7 +813,7 @@ div { --- -`flex-direction` و`flex-wrap`. +`flex-direction` و `flex-wrap` ## --video-solution-- diff --git a/curriculum/challenges/arabic/blocks/lecture-working-with-css-fonts/672bd814105a0ffcf36f9233.md b/curriculum/challenges/arabic/blocks/lecture-working-with-css-fonts/672bd814105a0ffcf36f9233.md index 771b9b12603..3ea0b9d3f0e 100644 --- a/curriculum/challenges/arabic/blocks/lecture-working-with-css-fonts/672bd814105a0ffcf36f9233.md +++ b/curriculum/challenges/arabic/blocks/lecture-working-with-css-fonts/672bd814105a0ffcf36f9233.md @@ -11,6 +11,8 @@ dashedName: what-are-font-families <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/what-are-font-families-and-how-do-they-work-1.png" alt="Diagram showing 'Arial' at the top with two blue arrows pointing down to 'Arial Bold' on the left and 'Arial Italic' on the right, illustrating font family variations" /> +## تعيين عائلات الخطوط في CSS + في CSS، يمكنك تعيين عائلة الخط باستخدام الخاصية `font-family`. إليك مثالًا على تعيين الخط للفقرة إلى `Arial`: :::interactive_editor @@ -29,6 +31,8 @@ dashedName: what-are-font-families ::: +## خطوط النظام البديل + ماذا لو لم يتم العثور على عائلة الخط؟ يمكنك تحديد عدة عائلات خطوط حسب الأولوية من الأعلى إلى الأدنى، بفصلها بفواصل. ستعمل هذه الخطوط البديلة كنظام بديل. في هذا المثال، Arial هو الخط الأساسي وLato هو الخط البديل: :::interactive_editor @@ -51,6 +55,8 @@ dashedName: what-are-font-families يجب أن تعرف أيضًا كيف يعمل هذا الإجراء خلف الكواليس. لا يتوقف اختيار الخط بمجرد توفر الخط الأول. تُختار عائلة الخط حرفًا بحرف، فإذا كان الخط يفتقر إلى حرف معين، يبحث المتصفح عنه في الخطوط ذات الأولوية الأدنى. أليس هذا مثيرًا؟ +## عائلات الخطوط العامة + في سياق تطوير الويب، ستجد أيضًا عائلات خطوط عامة. وهي مهمة جدًا. عائلة الخطوط العامة هي خط افتراضي يعرضه متصفح الويب عندما لا تتوفر الخطوط ذات الأولوية الأعلى. لضمان بقاء المحتوى قابلاً للقراءة، يستبدل المتصفح الخط الأصلي بأكثر خط مناسب بناءً على عائلة الخطوط العامة المحددة. بعض أشهرها هي: - سيريف @@ -81,6 +87,8 @@ dashedName: what-are-font-families يجب دائمًا إضافة عائلة الخطوط العامة في نهاية قائمة عائلة الخطوط. تذكر أن الخط العام قد يبدو مختلفًا عن الخط الذي تخيلته في التصميم، لذلك من المفيد دائمًا معاينة شكل هذه الخطوط في المتصفحات المختلفة. +## خطوط الويب الآمنة + لجعل تجربة المستخدم متسقة قدر الإمكان، يُنصح أيضًا باستخدام خطوط آمنة للويب. عادةً ما تكون هذه العائلات مثبتة على معظم الأجهزة، لذا من المرجح جدًا العثور عليها وعرضها بشكل صحيح لمعظم المستخدمين. ستتعلم المزيد عنها في الدروس القادمة. عائلات الخطوط ضرورية في عالم تصميم الويب. باستخدام خاصية font-family، يمكنك تغيير مظهر وإحساس النص فورًا. diff --git a/curriculum/challenges/arabic/blocks/lecture-working-with-css-fonts/672bd8453d1371fdb1510fe5.md b/curriculum/challenges/arabic/blocks/lecture-working-with-css-fonts/672bd8453d1371fdb1510fe5.md index 5f8ebd3f05c..595c95b39be 100644 --- a/curriculum/challenges/arabic/blocks/lecture-working-with-css-fonts/672bd8453d1371fdb1510fe5.md +++ b/curriculum/challenges/arabic/blocks/lecture-working-with-css-fonts/672bd8453d1371fdb1510fe5.md @@ -11,6 +11,8 @@ dashedName: how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fo Google Fonts وFont Squirrel هما مصدران شهيران على الإنترنت للعثور على خطوط مجانية واستخدامها لأغراض تطوير الويب. يمكنك دمجهما في مشاريعك بسهولة كبيرة. +## خطوط جوجل + لنبدأ بـ Google Fonts. هذه خدمة من Google تقدم مجموعة من الخطوط، العديد منها مصمم خصيصًا لتطوير الويب. في واجهة مستخدم Google Fonts، يمكنك رؤية العديد من العناصر المختلفة. دعنا نستعرضها واحدة تلو الأخرى. في الشريط الجانبي الأيسر، ستجد: - قسم لرؤية الخطوط والعثور عليها وتصفية النتائج. @@ -18,6 +20,8 @@ Google Fonts وFont Squirrel هما مصدران شهيران على الإنت - قسم يمكنك فيه العثور على أيقونات لمشاريع الويب الخاصة بك وتحميلها. - قسم يمكنك من خلاله معرفة المزيد عن الخطوط وأفضل الممارسات المتعلقة بها، يليه قسم للأسئلة المتكررة. +## معاينة خطوط جوجل + لإضافة خط من Google إلى موقعك، يجب أن تذهب إلى القسم الأول (الخطوط). يمكنك تخصيص نص المعاينة في الشريط الجانبي الأيسر حيث يظهر "Preview". فقط اكتب النص الذي تريد رؤيته وسيتم تحديثه تلقائيًا. هذا مفيد لمعاينة الخط مع النص الذي تفكر فيه لموقعك. يمكنك أيضًا تعديل حجم الخط وتصفية الخطوط بناءً على خصائصها. <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-1.png" alt="Google Fonts Fonts section showing a left sidebar with preview text set to 'freeCodeCamp' at 40px, filter options for Language, Technology, and Decorative stroke, and the main panel listing font families including Roboto, SUSE, and Sevillana each previewing 'freeCodeCamp'" /> @@ -28,12 +32,16 @@ Google Fonts وFont Squirrel هما مصدران شهيران على الإنت <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-2.png" alt="Google Fonts Roboto Styles page with Specimen, Type tester, Glyphs, and About & license tabs, a blue Get font button, a preview text field showing 'freeCodeCamp' with a font size slider at 48px, and a list of styles including Thin 100, Thin 100 Italic, Light 300, and Light 300 Italic" /> +## استخدام خطوط جوجل + عندما تكون مستعدًا لإضافة الخط إلى مشروعك، انقر على زر "Get font" الأزرق في الأعلى. ستنتقل إلى صفحة ملخص حيث سترى الخطوط التي اخترتها حاليًا. يمكنك اختيار عدة خطوط في نفس الوقت. <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-3.png" alt="Google Fonts page showing '1 font family selected' with Roboto Static listed, Get embed code and Download all buttons on the right, and a How to use section with All, Design, Develop, and Google products tabs" /> بعد ذلك، عليك اختيار ما إذا كنت تريد تحميل ملفات الخطوط لإضافتها إلى مشروعك كملفات محلية، أو استخدامها كخطوط خارجية وتحميلها من خوادم Google عندما يدخل المستخدم موقعك. انقر على "Download all" إذا أردت تحميلها، أما إذا فضلت استخدامها كخطوط خارجية على خوادم Google، فانقر على "Get embed code". إذا نقرّت على "Get embed code"، سترى التعليمات التي يجب اتباعها لإضافة هذه الخطوط الخارجية إلى مشروعك. +### ربط خطوط جوجل + لمشاريع تطوير الويب، لديك خياران. يمكنك استخدام عنصر `link` أو `@import`. إذا اخترت خيار عنصر `link`، يمكنك نسخ ولصق مقتطف HTML وقواعد CSS لإضافتها إلى مشروعك. يجب تضمين الشفرة داخل عنصر `head` في ملف HTML الخاص بك وإضافة قواعد CSS التي تناسب احتياجاتك. <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-4.png" alt="Google Fonts Embed code page with the link element option selected, showing three link tags for preconnect and the font stylesheet, a CSS classes section with .roboto-thin, .roboto-light, .roboto-regular, and .roboto-medium rules, and a left sidebar showing font style toggles" /> @@ -141,11 +149,13 @@ Google Fonts وFont Squirrel هما مصدران شهيران على الإنت هناك قاعدة CSS لكل نمط خط. كل قاعدة تعيّن الخطوط المخصصة مع خطوط النظام البديل في حال لم تُحمّل الخطوط المخصصة بشكل صحيح. +### استيراد خطوط جوجل + إذا اخترت خيار `@import` بدلاً من ذلك، ستحتاج إلى إضافة تلك القاعدة إلى ملف CSS الخاص بك. <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-5.png" alt="Google Fonts Embed code page with the @import option selected, showing a style block containing the @import URL rule, a CSS classes section below, and the left sidebar with font style toggles" /> -إليك مثالًا: +إليك مثال: ```css @import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap'); @@ -159,10 +169,14 @@ Google Fonts وFont Squirrel هما مصدران شهيران على الإنت وهذا هو Google Fonts. إنه أحد الخيارات الأكثر شعبية للعثور على خطوط مجانية ومفتوحة المصدر لمشاريع تطوير الويب. +## فونت سكويرل + خيار رائع آخر هو Font Squirrel، حيث يمكنك العثور على الخطوط المخصصة التي تتخيلها لتصميمك وتحميلها. <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-7.png" alt="Font Squirrel 'Free Font Utopia' page listing featured free fonts including Acherus Grotesque, Intro Rust, Source Sans Pro, Open Sans, and Questa, each shown with an alphabet specimen and a Download button" /> +## معاينة فونت سكويرل + إذا بحثت عن خط ونقرت على نتيجة، سترى مزيدًا من التفاصيل عن الخط، بما في ذلك عينات، تجربة اختبار، الرموز، وحزمة خطوط الويب. <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-8.png" alt="Font Squirrel search results for 'Roboto' showing three matches: Roboto, Roboto 2014, and Roboto Slab, each with an alphabet specimen and a Download TTF button" /> @@ -173,6 +187,8 @@ Google Fonts وFont Squirrel هما مصدران شهيران على الإنت <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-10.png" alt="Font Squirrel Roboto Specimens section listing all styles with alphabet samples: Roboto Thin, Thin Italic, Light, Light Italic, Regular, Italic, Medium, Medium Italic, Bold, Bold Italic, and Black, each in its respective weight" /> +## استخدام فونت سكويرل + بمجرد أن تقرر الخط الذي تريد استخدامه في مشروعك، اذهب إلى تبويب "Webfont Kit". هنا، يمكنك التحقق مما إذا كان ترخيص الخط يسمح لك باستخدامه في تضمينات CSS عبر `@font-face`. يمكنك أيضًا اختيار المجموعة الجزئية والصيغة. <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-11.png" alt="Font Squirrel Roboto Webfont Kit tab showing a license notice confirming @font-face embedding is allowed, a subset selector set to Western Latin, format checkboxes with WOFF selected, and a Download @font-face Kit button" /> @@ -221,7 +237,7 @@ Google Fonts وFont Squirrel هما مصدران شهيران على الإنت --- -تحسين توافق المتصفح. +تحسين التوافق مع المتصفحات. ### --feedback-- diff --git a/curriculum/challenges/arabic/blocks/lecture-working-with-css-fonts/672bd853c985cdfdeb32f4f9.md b/curriculum/challenges/arabic/blocks/lecture-working-with-css-fonts/672bd853c985cdfdeb32f4f9.md index 5b903808463..d7dd31ae1b0 100644 --- a/curriculum/challenges/arabic/blocks/lecture-working-with-css-fonts/672bd853c985cdfdeb32f4f9.md +++ b/curriculum/challenges/arabic/blocks/lecture-working-with-css-fonts/672bd853c985cdfdeb32f4f9.md @@ -13,6 +13,8 @@ dashedName: what-is-the-text-shadow-property text-shadow: /* Values */ ``` +## قيم إزاحة `X` و `Y` + في CSS، يمكنك وصف الظل من خلال مزيج من إزاحة `X`، وإزاحة `Y`، ونصف قطر التمويه، واللون. أولًا، تحتاج إلى تحديد إزاحة `X` و`Y`، التي تمثل المسافة الأفقية والعمودية للظل من النص على التوالي. هذه القيم مطلوبة. إليك مثالًا على كيفية تطبيق إزاحة `X` و`Y` على الظل. نطبق خاصية `text-shadow` مع إزاحة x مقدارها `3px` وإزاحة y مقدارها `2px`: @@ -32,7 +34,11 @@ p { ::: -في المتصفح، سيبدو النص والظل متشابهين لكن يمكننا أيضًا تخصيص لون الظل بتحديد القيمة قبل أو بعد الإزاحة. لنحدد لون الظل. سنستخدم لونًا سداسيًا عشريًا هنا لكن يمكنك استخدام أي صيغة لون صالحة. +في المتصفح، سيبدو النص والظل متشابهين. + +## إضافة لون إلى الظل + +يمكننا أيضًا تخصيص لون الظل بتحديد القيمة قبل أو بعد الإزاحة. لنحدد لون الظل. سنستخدم لونًا سداسيًا هنا لكن يمكنك استخدام أي صيغة لون صالحة. :::interactive_editor @@ -66,7 +72,11 @@ p { ::: -في المتصفح، سيكون للظل لون محدد، لذا يمكننا تمييزه بسهولة عن النص. الآن بعد أن يمكننا التمييز بين الظل والنص، من المهم أيضًا معرفة كيف تؤثر القيم الموجبة والسالبة على إزاحة الظل. القيم الموجبة لإزاحة `X` و`Y` تحرك الظل إلى اليمين والأسفل على التوالي، بينما القيم السالبة تحرك الظل إلى اليسار والأعلى. إليك مثالًا يستخدم القيم السالبة بدلاً من ذلك: +في المتصفح، سيكون للظل لون محدد، لذا يمكننا تمييزه بسهولة عن النص. + +## قيم الإزاحة الموجبة والسالبة + +الآن بعد أن يمكننا التمييز بين الظل والنص، من المهم أيضًا معرفة كيف تؤثر القيم الموجبة والسالبة على إزاحة الظل. القيم الموجبة لإزاحة `X` و `Y` تحرك الظل إلى اليمين والأسفل على التوالي، بينما القيم السالبة تحرك الظل إلى اليسار والأعلى. إليك مثالًا يستخدم القيم السالبة بدلاً من ذلك: :::interactive_editor @@ -83,7 +93,11 @@ p { ::: -الآن سيتحرك الظل إلى اليسار والأعلى بالنسبة للنص. رائع. لكن الظل لا يبدو جيدًا جدًا، لأنه يشبه النص الأصلي تمامًا لكنه موضوع خلفه. لجعله يبدو أجمل، نحتاج إلى إضافة قيمة ثالثة، وهي نصف قطر التمويه. هذه القيمة اختيارية لكنها تجعل الظل يبدو أكثر نعومة ودقة. القيمة الافتراضية لنصف قطر التمويه هي صفر. كلما زادت القيمة، زاد التمويه، مما يعني أن الظل يصبح أخف. +الآن سيتحرك الظل إلى اليسار والأعلى بالنسبة للنص. ممتاز. + +## نصف قطر التمويه + +لكن الظل لا يبدو جيدًا جدًا، لأنه يشبه النص الأصلي تمامًا لكنه موضوع خلفه. لجعله يبدو أجمل، نحتاج إلى إضافة قيمة ثالثة، وهي نصف قطر التمويه. هذه القيمة اختيارية لكنها تجعل الظل يبدو أكثر نعومة ودقة. القيمة الافتراضية لنصف قطر التمويه هي صفر. كلما زادت القيمة، زاد التمويه، مما يعني أن الظل يصبح أخف. هنا، نحدد نصف قطر التمويه إلى `3px` ونعود إلى القيم الموجبة للإزاحة: @@ -104,6 +118,8 @@ p { الآن بدأ الظل يبدو كظل حقيقي. أصبح أكثر تمويهًا ودقة، لذا يمكننا التركيز على النص الرئيسي بينما يضيف الظل بعض الأناقة في الخلفية. من هنا، يمكننا تعديل القيم قليلاً حتى نجد مزيجًا من الإزاحة واللون ونصف قطر التمويه يناسب احتياجاتنا. +## إضافة عدة ظلال + من المفيد أيضًا معرفة أن النص يمكن أن يحتوي على أكثر من ظل واحد. فقط اكتبهم في نفس خاصية `text-shadow` مفصولين بفواصل. سيتم تطبيقهم على طبقات، من الأمام إلى الخلف، مع الظل الأول في الأعلى. إليك مثالًا على فقرة بها ثلاثة ظلال مطبقة على طبقات. لاحظ أن كل هذه الظلال معرفة في نفس خاصية `text-shadow` ومفصولة بفواصل: diff --git a/curriculum/challenges/arabic/blocks/lecture-working-with-css-transforms-overflow-and-filters/672bccc8ea33bad87abb3c56.md b/curriculum/challenges/arabic/blocks/lecture-working-with-css-transforms-overflow-and-filters/672bccc8ea33bad87abb3c56.md index b2b505a7677..d60f0e22263 100644 --- a/curriculum/challenges/arabic/blocks/lecture-working-with-css-transforms-overflow-and-filters/672bccc8ea33bad87abb3c56.md +++ b/curriculum/challenges/arabic/blocks/lecture-working-with-css-transforms-overflow-and-filters/672bccc8ea33bad87abb3c56.md @@ -19,6 +19,8 @@ dashedName: what-is-the-difference-between-content-box-and-border-box قيمة الخاصية `box-sizing` هي `content-box` افتراضيًا، لكن يمكنك اختيار `border-box` إذا احتجت لذلك. سنستعرض أولًا `content-box` ثم ننتقل إلى `border-box`. +## مراجعة نموذج الصندوق في CSS + لفهم كيفية عمل النماذج، يجب أن تكون على دراية بالمفاهيم الأربعة الأساسية من نموذج الصندوق في CSS. دعنا نراجعها بسرعة. - مساحة المحتوى هي المساحة التي يشغلها محتوى العنصر. @@ -26,6 +28,8 @@ dashedName: what-is-the-difference-between-content-box-and-border-box - الحدود هي الإطار الذي يحيط بمساحة المحتوى والحشو. - الهامش هو المساحة خارج الحدود التي تفصل العنصر عن العناصر الأخرى. +## كيف يعمل `content-box` + في نموذج `content-box`، العرض والارتفاع الذي تحدده لعنصر يحدد أبعاد مساحة المحتوى، لكنه لا يشمل الحشو أو الحدود أو الهامش. استخدم `content-box` عندما تحتاج إلى تحكم دقيق في مساحة المحتوى. عند تعيين `width` و `height`، فأنت تحدد فقط حجم المحتوى نفسه. لإيجاد العرض الكلي للعنصر، تحتاج إلى إضافة الحشو الأيسر والأيمن، والحدود اليسرى واليمنى. وبالمثل، يمكن إيجاد الارتفاع الكلي للعنصر بإضافة ارتفاع المحتوى، الحشو العلوي والسفلي، والحدود العلوية والسفلية. @@ -52,10 +56,14 @@ div { في هذه الحالة، إذا استخدمنا `content-box` ستكون مساحة المحتوى 300px في 200px. الحجم الكلي المعروض يشمل الحشو والحدود — على سبيل المثال، العرض الكلي = 300px (المحتوى) + 40px (الحشو) + 8px (الحدود) = 348px؛ ويتم حساب الارتفاع الكلي بنفس الطريقة. +## كيف يعمل `border-box` + رائع! الآن دعنا نستعرض `border-box`. هو مختلف لأنه العرض والارتفاع الذي تحدده يشمل محتوى العنصر، الحشو، والحدود (لكن لا يشمل الهامش). استخدم `border-box` عندما تريد أن يبقى الحجم الكلي للعنصر ثابتًا حتى لو تغير الحشو أو الحدود — وهذا مفيد غالبًا في التخطيطات المتجاوبة. مع `border-box`، يُدرج الحشو والحدود داخل الحجم المحدد للعنصر. يصبح `width` و `height` اللذان تحددهما هما الأبعاد الكلية للعنصر: المحتوى + الحشو + الحدود؛ بينما يبقى الهامش مستبعدًا. +## مقارنة بين النموذجين + في المثال التالي، هناك عنصران `div` لهما نفس الأبعاد لكن بقيم مختلفة لـ `box-sizing`. لاحظ كيف يؤدي هذا إلى أحجام كلية مختلفة عند العرض في المتصفح: :::interactive_editor diff --git a/curriculum/challenges/arabic/blocks/lecture-working-with-dates/6733aafb9c0802f66cc1e056.md b/curriculum/challenges/arabic/blocks/lecture-working-with-dates/6733aafb9c0802f66cc1e056.md index 3f5707e56ce..e67df741d08 100644 --- a/curriculum/challenges/arabic/blocks/lecture-working-with-dates/6733aafb9c0802f66cc1e056.md +++ b/curriculum/challenges/arabic/blocks/lecture-working-with-dates/6733aafb9c0802f66cc1e056.md @@ -34,21 +34,31 @@ console.log(now); بالنسبة للوقت، يستخدم تنسيق الوقت العسكري، لذا `14:30` تعني `2:30 PM`. `GMT-0700` هي إزاحة المنطقة الزمنية، و`Pacific Daylight Time` هو اسم المنطقة الزمنية. -يمكنك أيضًا تمرير تاريخ ووقت محددين إلى كائن `Date` بتوفير قيم السنة والشهر واليوم والساعة والدقيقة والثانية والميلي ثانية كمعلمات. +إليك مثالًا على إنشاء كائن `Date` جديد باستخدام سلسلة نصية لتاريخ محدد: -إليك مثال على إنشاء كائن `Date` جديد بتاريخ ووقت محددين: +:::interactive_editor + +```js +const dateFromString = new Date("July 4, 1776 12:00:00"); + +console.log(dateFromString); +``` + +::: + +يمكنك أيضًا تمرير تاريخ ووقت محددين إلى كائن `Date` عبر توفير قيم السنة والشهر واليوم والساعة والدقيقة والثانية والميلي ثانية كمعلمات: :::interactive_editor ```js -const specificDate = new Date("July 4, 1776 12:00:00"); +const dateFromArguments = new Date(1776, 6, 4, 12, 0, 0, 0); -console.log(specificDate); +console.log(dateFromArguments); ``` ::: -هذا مفيد عندما تحتاج إلى العمل مع تاريخ ووقت محددين بدلاً من التاريخ والوقت الحاليين. يجب أن يكون الإدخال دائمًا سلسلة نصية، ويجب أن يكون التنسيق قابلاً للتعرف عليه من قبل كائن `Date`. +هذا مفيد عندما تحتاج إلى العمل مع تاريخ ووقت محددين بدلاً من التاريخ والوقت الحاليين. للحصول على التاريخ والوقت الحاليين، يمكنك استخدام الطريقة `Date.now()`، التي تُرجع عدد المللي ثانية منذ `January 1, 1970, 00:00:00 UTC`. يُعرف هذا باسم وقت العصر اليونكس. diff --git a/curriculum/challenges/arabic/blocks/lecture-working-with-file-systems/672ac403a9ba7732b31c6480.md b/curriculum/challenges/arabic/blocks/lecture-working-with-file-systems/672ac403a9ba7732b31c6480.md index c6b39864746..61e28d0fc43 100644 --- a/curriculum/challenges/arabic/blocks/lecture-working-with-file-systems/672ac403a9ba7732b31c6480.md +++ b/curriculum/challenges/arabic/blocks/lecture-working-with-file-systems/672ac403a9ba7732b31c6480.md @@ -51,7 +51,7 @@ WOFF هو تنسيق خط حديث، صُمم خصيصًا لأغراض تطوي عادةً ما تُكتب هذه الملفات بتنسيق يسمى Markdown. باستخدام Markdown، يمكنك إنشاء مستندات منظمة تحتوي على عناوين، وعناوين فرعية، وروابط، وصور، وقوائم، وأكثر. لملفات Markdown امتداد `.md` أو `.markdown`. -هنا يمكنك العثور على ملف `README` لمستودع freeCodeCamp على GitHub: https://github.com/freeCodeCamp/freeCodeCamp/blob/main/README.md +هنا يمكنك العثور على ملف `README` لمستودع freeCodeCamp على GitHub: `https://github.com/freeCodeCamp/freeCodeCamp/blob/main/README.md` يمكنك إنشاء هذا الهيكل التفصيلي والتنسيق باستخدام Markdown. diff --git a/curriculum/challenges/arabic/blocks/lecture-working-with-node-core-modules/695cc6a5eefd305381ec90bc.md b/curriculum/challenges/arabic/blocks/lecture-working-with-node-core-modules/695cc6a5eefd305381ec90bc.md index ea50037c1ca..7dbba8a46c3 100644 --- a/curriculum/challenges/arabic/blocks/lecture-working-with-node-core-modules/695cc6a5eefd305381ec90bc.md +++ b/curriculum/challenges/arabic/blocks/lecture-working-with-node-core-modules/695cc6a5eefd305381ec90bc.md @@ -148,7 +148,7 @@ async function readFileContent() { const fileContent = await fs.readFile("article.md", "utf8"); console.log("File content:", fileContent); } catch (err) { - console.log("File read successfully"); + console.error("Error reading file:", err); } } @@ -169,7 +169,7 @@ async function readFileContent() { const fileContent = await fs.readFile("article.md"); console.log("File content:", fileContent); } catch (err) { - console.log("File read successfully"); + console.error("Error reading file:", err); } } diff --git a/curriculum/challenges/arabic/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d2f232c60f0fa68ef86.md b/curriculum/challenges/arabic/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d2f232c60f0fa68ef86.md index 7f64bd8303a..a720c601a4e 100644 --- a/curriculum/challenges/arabic/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d2f232c60f0fa68ef86.md +++ b/curriculum/challenges/arabic/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d2f232c60f0fa68ef86.md @@ -19,11 +19,11 @@ dashedName: what-is-node-and-what-are-some-differences-between-the-browser-and-n تملك JavaScript على جانب العميل هذه القيود لأنها صُممت في الأصل لتعمل حصريًا على متصفحات الويب. -توفر متصفحات الويب بيئة العمل اللازمة لتشغيل شفرة JavaScript، بما في ذلك محرك JavaScript. كما توفر وصولًا إلى نموذج كائن المستند (DOM)، حتى تتمكن من الوصول إلى عناصر HTML في شفرتك. +توفر متصفحات الويب بيئة العمل اللازمة لتشغيل شفرة JavaScript، بما في ذلك محرك JavaScript. كما توفر وصولًا إلى نموذج كائن المستند (DOM)، بحيث يمكنك الوصول إلى عناصر HTML في شفرتك. -في السابق، لم نكن نستطيع تشغيل JavaScript خارج المتصفح، لكن الآن يمكننا ذلك باستخدام Node.js. +لفترة طويلة، كان استخدام JavaScript مقتصرًا تقريبًا على المتصفحات فقط، لكن مع Node.js يمكنك تشغيلها خارج المتصفح أيضًا. -Node.js هي بيئة تشغيل JavaScript. تُعرف رسميًا بأنها "بيئة تشغيل JavaScript مفتوحة المصدر وعبر المنصات". +Node.js هي بيئة تشغيل JavaScript. تُعرف رسميًا بأنها "بيئة تشغيل JavaScript مفتوحة المصدر وعبر المنصات." لنرَ ماذا يعني هذا: @@ -43,7 +43,7 @@ Node.js هي بيئة تشغيل JavaScript. تُعرف رسميًا بأنها على سبيل المثال، من المتصفح يمكنك الوصول إلى واجهة برمجة تطبيقات DOM، لكن هناك قيود على الوصول إلى نظام الملفات المحلي. بالمقابل، من بيئة تشغيل Node يمكنك الوصول إلى معظم موارد النظام، بما في ذلك نظام الملفات، لكن ليس إلى DOM. -كلتا بيئتي JavaScript توفران كائنًا عالميًا. في بيئة تشغيل JavaScript في المتصفح، يُسمى هذا الكائن `window`. يوفر كائن `window` وصولًا إلى وظائف متعلقة بالمتصفح، مثل الوصول إلى طرق التلاعب بـ DOM، وإدارة الكوكيز، والتعامل مع أحداث المتصفح. في بيئة Node.js، يُسمى هذا الكائن العالمي `global`. يوفر كائن `global` وصولًا إلى وظائف خاصة بـ Node.js، مثل الوحدات المدمجة للعمل مع الملفات المحلية، والشبكات، والتفاعل مع نظام التشغيل. +تقدم بيئتا تشغيل JavaScript كائنًا عالميًا. في بيئة تشغيل JavaScript الخاصة بالمتصفح، يُسمى هذا الكائن `window`. يوفر كائن `window` هذا وصولًا إلى وظائف متعلقة بالمتصفح، مثل الوصول إلى طرق التلاعب بـ DOM، وإدارة ملفات تعريف الارتباط، والتعامل مع أحداث المتصفح. في بيئة Node.js، يُسمى هذا الكائن العالمي `global`. يوفر كائن `global` وصولًا إلى وظائف خاصة بـ Node.js، مثل الوحدات المدمجة للعمل مع الملفات المحلية، والشبكات، والتفاعل مع نظام التشغيل. أخيرًا، فرق مهم آخر هو أنه يمكنك اختيار إصدار Node.js الذي تريد استخدامه في خادمك. لكن لا يمكنك التحكم في إصدار بيئة المتصفح التي سيستخدمها زوار موقعك. @@ -103,7 +103,7 @@ Node.js هي بيئة تشغيل JavaScript. تُعرف رسميًا بأنها --- -بيئة تشغيل Node تستخدم كائن window ككائن عالمي، بينما المتصفحات تستخدم الكائن global. +بيئة تشغيل Node تستخدم الكائن `window` ككائنها العالمي، بينما تستخدم المتصفحات الكائن `global`. ### --feedback-- diff --git a/curriculum/challenges/arabic/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d372ad364f285f0522e.md b/curriculum/challenges/arabic/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d372ad364f285f0522e.md index daac5ba87c4..6557f43ef51 100644 --- a/curriculum/challenges/arabic/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d372ad364f285f0522e.md +++ b/curriculum/challenges/arabic/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d372ad364f285f0522e.md @@ -11,7 +11,7 @@ dashedName: what-are-the-advantages-and-disadvantages-to-using-node-on-the-back- بنية Node تمثل ميزة أخرى. فهي تعتمد على بنية غير حابسة، مدفوعة بالأحداث، وهي رائعة لتطوير التطبيقات في الوقت الحقيقي، حيث تكون الاستجابة والكفاءة ضرورية لخلق تجربة مستخدم جيدة. -هنا يصبح مفهوم "الخيوط" مهمًا جدًا. الخيط هو مسار تنفيذ داخل عملية، مثل برنامج كمبيوتر يعمل حاليًا. +هنا يصبح مفهوم "الخيوط" مهمًا جدًا. الخيط هو مسار تنفيذ داخل عملية، أي برنامج كمبيوتر يعمل حاليًا. تعتمد بنية Node على خيط واحد وحلقة أحداث يمكنها التعامل بفعالية مع عدد كبير من الطلبات المتزامنة وعمليات الإدخال/الإخراج. هذا يجعلها مثالية للتطبيقات التي تتطلب معالجة طلبات متعددة في نفس الوقت. @@ -25,13 +25,13 @@ dashedName: what-are-the-advantages-and-disadvantages-to-using-node-on-the-back- من ناحية أخرى، لدى Node.js بعض العيوب أو القيود التي يجب أن تكون على علم بها. -كما تعلمت، فإنه يشغل خيطًا واحدًا فقط في كل مرة، مما يعني أنه يمكنه التعامل مع عملية واحدة فقط في كل مرة. بينما تسمح بنيته بأن يكون فعالًا في التعامل مع الطلبات المتزامنة، قد تحجب المهام التي تستهلك وحدة المعالجة المركزية الخيط الرئيسي وتؤدي إلى مشاكل في الأداء. +كما تعلم، يشغل JavaScript الخاص بك على خيط واحد، مما يعني أنه يمكنه تنفيذ جزء واحد فقط من الشفرة في كل مرة. بينما تسمح بنيته بأن يكون فعالًا في التعامل مع الطلبات المتزامنة (المتزامنة في الوقت نفسه)، قد تؤدي المهام التي تستهلك وحدة المعالجة المركزية إلى حجب الخيط الرئيسي وتسبب مشاكل في الأداء. تشمل أمثلة المهام التي تستهلك وحدة المعالجة المركزية العمليات الرياضية المعقدة، ومعالجة الصور والفيديو، والتشفير. هناك طرق للتغلب على ذلك، لكنها عادةً ما تزيد من تعقيد التطبيق. -تعتمد Node.js أيضًا على البرمجة غير المتزامنة. في البرمجة غير المتزامنة، تبدأ مهمة قد تستغرق وقتًا طويلاً للتنفيذ، ولكن بدلاً من الانتظار حتى تكتمل، يستمر البرنامج الرئيسي في العمل بينما تعمل المهمة غير المتزامنة بالتوازي. عند اكتمال المهمة، يتعامل البرنامج مع النتيجة. +في البرمجة غير المتزامنة، تبدأ مهمة قد تستغرق وقتًا طويلاً للتنفيذ، ولكن بدلاً من الانتظار حتى تكتمل، يستمر البرنامج الرئيسي في العمل بينما تعمل المهمة غير المتزامنة في الخلفية. -غالبًا ما تتضمن هذه العملية ما نعرفه بـ "الاستدعاءات الراجعة"، وهي دوال تحدد ما يحدث عند اكتمال العمليات غير المتزامنة. الطبيعة غير المتزامنة لـ Node.js قد تجعل الشفرة أكثر صعوبة في القراءة والفهم وتصحيح الأخطاء. +غالبًا ما تتضمن هذه العملية ما نعرفه بـ "استدعاءات راجعة"، وهي دوال تحدد ما يحدث عند اكتمال العمليات غير المتزامنة. الطبيعة غير المتزامنة لـ Node.js قد تجعل الشفرة أكثر صعوبة في القراءة والفهم ومعالجة الأخطاء. وأخيرًا، يجب أن تكون حذرًا عند اختيار الحزم من `npm`، مدير حزم Node، لأن بعضها قد لا يُحافظ عليه باستمرار، مما قد يُدخل ثغرات أمنية في تطبيقك. كمطور، يجب أن تُقيّم كل حزمة بعناية وتتحقق مما إذا كانت تتبع أفضل الممارسات في الجودة والأمان. diff --git a/curriculum/challenges/arabic/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d39d7ed9ef36ff281f3.md b/curriculum/challenges/arabic/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d39d7ed9ef36ff281f3.md index 1584230c86b..1fabcd72a2f 100644 --- a/curriculum/challenges/arabic/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d39d7ed9ef36ff281f3.md +++ b/curriculum/challenges/arabic/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d39d7ed9ef36ff281f3.md @@ -17,7 +17,7 @@ dashedName: how-can-you-install-node-on-your-computer على macOS وLinux، يمكنك تثبيت NVM مباشرة عبر سكربت شل. -لكن بالنسبة لـ macOS، لاحظ أن الوثائق الرسمية لـ NVM تشير إلى أنه "يجب تثبيت أدوات سطر أوامر Xcode يدويًا قبل تشغيل سكربت التثبيت، وإلا سيفشل التثبيت." +لكن بالنسبة لنظام macOS، لاحظ أن الوثائق الرسمية لـ NVM تشير إلى أنه "يجب تثبيت أدوات سطر أوامر Xcode يدويًا قبل تشغيل سكربت التثبيت، وإلا سيفشل التثبيت." على macOS، يمكنك تثبيت أدوات سطر أوامر Xcode بتشغيل هذا الأمر في الطرفية: @@ -41,7 +41,7 @@ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash ``` -للحصول على أحدث إصدار من NVM في الوقت الذي تقرأ فيه هذا المقال، يرجى الرجوع إلى الوثائق الرسمية لـ NVM: `https://github.com/nvm-sh/nvm?tab=readme-ov-file#install--update-script`. هناك ستجد هذه الأوامر مع أحدث رقم إصدار. +للحصول على أحدث إصدار من NVM في الوقت الذي تقرأ فيه هذا الدرس، يرجى الرجوع إلى الوثائق الرسمية لـ NVM: `https://github.com/nvm-sh/nvm?tab=readme-ov-file#install--update-script`. هناك ستجد هذه الأوامر مع أحدث رقم إصدار. قد تحتاج إلى إعادة تشغيل الطرفية بعد اكتمال العملية لتحميل الأمر الجديد والإعدادات الجديدة. @@ -101,7 +101,7 @@ node -v الإصدارات الرسمية من NVM تدعم Windows فقط في حالات محددة. إذا كان لديك Windows Subsystem for Linux (WSL) مُثبت على جهازك، يمكنك اتباع دليل macOS/Linux أعلاه لتثبيت واستخدام NVM. -لكن بالنسبة لـ Windows نفسه، هناك بعض البدائل. أحدها هو `nvm-windows`، أداة لإدارة إصدارات Node.js على Windows. هذا مشروع منفصل تمامًا عن مشروع NVM الرسمي. لكن هدف هذه الأدوات هو نفسه — مساعدتك على العمل مع إصدارات متعددة من Node.js على نفس الجهاز. +ومع ذلك، بالنسبة لنظام Windows نفسه، هناك بعض البدائل. أحدها هو `nvm-windows`، أداة لإدارة إصدارات Node.js على Windows. هذا مشروع منفصل تمامًا عن مشروع NVM الرسمي. لكن هدف هذه الأدوات هو نفسه: مساعدتك على العمل مع إصدارات متعددة من Node.js على نفس الجهاز. قبل تثبيت `nvm-windows`، يجب أن تعرف أن المستودع الرسمي يوصي بإلغاء تثبيت أي تثبيت سابق لـ Node قبل تثبيت NVM على Windows. إذا كانت هذه هي المرة الأولى التي تثبت فيها Node.js، فستكون الأمور على ما يرام. أما إذا كان لديك إصدارات أخرى مثبتة، فمن الأفضل إلغاء تثبيتها أولًا. @@ -155,7 +155,7 @@ nvm use 20 يمكنك أيضًا التحقق من الإصدار الحالي لـ Node.js بهذا الأمر: -```bash +```powershell node -v ``` @@ -165,25 +165,25 @@ node -v أيضًا، بينما تعمل كل هذه الأوامر مع NVM المثبت على macOS/Linux، بما في ذلك WSL، قد تعمل بشكل مختلف أو قد لا تعمل على الإطلاق مع `nvm-windows`. سنوفر أوامر بديلة لـ `nvm-windows` متى أمكن. -### كيفية تعديل سياسة تنفيذ Powershell +### كيفية تعديل سياسة تنفيذ PowerShell -إذا كنت تستخدم Windows وتتابع مع Powershell و`nvm-windows`، قد تحتاج إلى تعديل سياسة تنفيذ Powershell. السياسة الافتراضية لـ Powershell هي `Restricted`، وهي إجراء أمني لمنع تشغيل السكربتات. +إذا كنت تستخدم Windows وتتابع مع PowerShell و`nvm-windows`، قد تحتاج إلى تعديل سياسة تنفيذ PowerShell. السياسة الافتراضية لتنفيذ PowerShell هي `Restricted`، وهي إجراء أمني لمنع تشغيل السكربتات. -أولًا، شغّل Powershell كمسؤول بالنقر بزر الفأرة الأيمن على Powershell، ثم النقر على “تشغيل كمسؤول“. +أولًا، شغّل PowerShell كمسؤول بالنقر بزر الفأرة الأيمن على PowerShell، ثم النقر على "تشغيل كمسؤول". -ثم، لرؤية سياسة التنفيذ الحالية لجلسة Powershell الحالية، شغّل الأمر التالي: +بعدها، لرؤية سياسة التنفيذ الحالية لجلسة PowerShell الحالية، شغّل الأمر التالي: ```powershell Get-ExecutionPolicy ``` -أخيرًا، لتعيين سياسة تنفيذ Powershell إلى `RemoteSigned`، التي تسمح بتشغيل السكربتات المحلية و`npm`، استخدم الأمر التالي: +أخيرًا، لتعيين سياسة تنفيذ PowerShell إلى `RemoteSigned`، التي تسمح بتشغيل السكربتات المحلية و`npm`، استخدم الأمر التالي: ```powershell Set-ExecutionPolicy RemoteSigned ``` -بعد تشغيل الأمر أعلاه، يمكنك إغلاق نافذة Powershell الخاصة بالمسؤول، وفتح نافذة Powershell عادية. +بعد تشغيل الأمر أعلاه، يمكنك إغلاق نافذة PowerShell الخاصة بالمسؤول، وفتح نافذة PowerShell عادية بدون صلاحيات المسؤول. ### عرض جميع الإصدارات @@ -271,7 +271,7 @@ node -v npm -v ``` -### تشغيل ملف JavaScript +### تشغيل ملف جافاسكريبت يشغل هذا الأمر ملف JavaScript الذي تحدده في بيئة تشغيل Node.js النشطة حاليًا: diff --git a/curriculum/challenges/arabic/blocks/lecture-working-with-operator-behavior/6732719e2e3ad4d947410b65.md b/curriculum/challenges/arabic/blocks/lecture-working-with-operator-behavior/6732719e2e3ad4d947410b65.md index 79489a8da67..fc9c680c04a 100644 --- a/curriculum/challenges/arabic/blocks/lecture-working-with-operator-behavior/6732719e2e3ad4d947410b65.md +++ b/curriculum/challenges/arabic/blocks/lecture-working-with-operator-behavior/6732719e2e3ad4d947410b65.md @@ -11,7 +11,13 @@ dashedName: how-does-operator-precedence-work تحدد أسبقية العمليات ترتيب تنفيذ العمليات في التعبير. تُنفذ العوامل ذات الأسبقية الأعلى قبل تلك ذات الأسبقية الأقل. فكر في أسبقية العمليات كما في الرياضيات، حيث تتم عملية القسمة والضرب قبل الجمع والطرح. -بدون اتباع هذه القاعدة، ستعطي المعادلات الأساسية إجابة خاطئة. يعمل JavaScript بنفس الطريقة. لديه قواعده الخاصة لتحديد أي العوامل تأتي أولًا، ثانيًا، وهكذا. على سبيل المثال، انظر إلى التعبير أدناه: +بدون اتباع هذه القاعدة، ستعطي المعادلات الأساسية إجابة خاطئة. جافاسكريبت تعمل بنفس الطريقة. لديها قواعدها الخاصة لتحديد أي العوامل تأتي أولاً، ثم الثاني، وهكذا. + +## الأسبقية في التعبيرات الحسابية + +### أسبقية الضرب + +على سبيل المثال، ألق نظرة على التعبير أدناه: :::interactive_editor @@ -25,36 +31,42 @@ console.log(result); // 14 لو أن JavaScript نفذ هذا التعبير من اليسار إلى اليمين، كنت تتوقع أن يكون `2 + 3 = 5`، ثم `5 * 4 = 20`. لكن لأن الضرب له أسبقية أعلى من الجمع، ينفذ JavaScript الجزء `3 * 4` أولًا، مما ينتج `2 + 12 = 14`. -أحيانًا، قد تريد أن تُنفذ أجزاء معينة من التعبير أولًا بغض النظر عن قواعد الأسبقية. يمكنك استخدام الأقواس العادية، `()`, لفعل ذلك. أي شيء داخل الأقواس يُنفذ أولًا مهما كان. دعنا نجعل الجزء `2 + 3` من المثال السابق يُنفذ أولًا: +### أسبقية القسمة + +عامل القسمة له أسبقية أعلى من الجمع أو الطرح أيضًا: :::interactive_editor ```js -const result = (2 + 3) * 4; +const result = 2 + 6 / 3; -console.log(result); // 20 +console.log(result); // 4 ``` ::: -في المثال أعلاه، تجبر الأقواس JavaScript على تنفيذ `2 + 3` أولًا، ثم ضرب الناتج في `4`. هذا يعطيك `20` بدلًا من `14`. +لو أن JavaScript نفذ هذا التعبير من اليسار إلى اليمين، قد تتوقع أن يكون `2 + 6 = 8`، ثم `8 / 3 = 2.67`. لكن بما أن القسمة لها أسبقية أعلى من الجمع، ينفذ JavaScript القسمة أولًا: `6 / 3 = 2`، ثم يضيف `2 + 2`، مما يعطي النتيجة `4`. -عامل القسمة له أسبقية أعلى من الجمع أو الطرح أيضًا: +### استخدام الأقواس العادية لتجاوز الأسبقية + +أحيانًا، قد ترغب في تنفيذ أجزاء معينة من التعبير أولاً، بغض النظر عن قواعد الأسبقية. يمكنك استخدام الأقواس العادية، `()`, للقيام بذلك. أي شيء داخل الأقواس يُحلل أولاً مهما كان. دعنا نجعل الجزء `2 + 3` من مثال الضرب يُحلل أولاً: :::interactive_editor ```js -const result = 2 + 6 / 3; +const result = (2 + 3) * 4; -console.log(result); // 4 +console.log(result); // 20 ``` ::: -لو أن JavaScript نفذ هذا التعبير من اليسار إلى اليمين، قد تتوقع أن يكون `2 + 6 = 8`، ثم `8 / 3 = 2.67`. لكن بما أن القسمة لها أسبقية أعلى من الجمع، ينفذ JavaScript القسمة أولًا: `6 / 3 = 2`، ثم يضيف `2 + 2`، مما يعطي النتيجة `4`. +في المثال أعلاه، تجبر الأقواس JavaScript على تنفيذ `2 + 3` أولًا، ثم ضرب الناتج في `4`. هذا يعطيك `20` بدلًا من `14`. لذا، في كل من الضرب والقسمة، ستحدث هذه العمليات دائمًا قبل الجمع والطرح ما لم تستخدم الأقواس لتغيير الترتيب. فماذا يحدث إذا كانت العوامل لها نفس الأسبقية؟ يستخدم JavaScript الترابط لتحديد ترتيب التنفيذ. +## فهم الترابط + الترابط هو ما يخبر JavaScript ما إذا كان ينفذ العوامل من اليسار إلى اليمين أو من اليمين إلى اليسار. بالنسبة لمعظم العوامل مثل الجمع والضرب، يكون الترابط من اليسار إلى اليمين. لذا، يعالج JavaScript هذه العوامل من أقصى اليسار في التعبير إلى اليمين: :::interactive_editor @@ -84,6 +96,8 @@ console.log(a + b); // 10 في المثال أعلاه، يعين JavaScript القيمة `5` إلى `b` أولًا، ثم يعين `b` (التي أصبحت الآن `5`) إلى `a`. +### عامل الأس + عامل الأس أيضًا له ترابط من اليمين إلى اليسار: :::interactive_editor diff --git a/curriculum/challenges/arabic/blocks/lecture-working-with-regular-expressions/6733c5e54e3a154c8078ed48.md b/curriculum/challenges/arabic/blocks/lecture-working-with-regular-expressions/6733c5e54e3a154c8078ed48.md index d39bee80543..1d5b0c7c1a8 100644 --- a/curriculum/challenges/arabic/blocks/lecture-working-with-regular-expressions/6733c5e54e3a154c8078ed48.md +++ b/curriculum/challenges/arabic/blocks/lecture-working-with-regular-expressions/6733c5e54e3a154c8078ed48.md @@ -17,6 +17,8 @@ const regex = /^\d\d\d\d$/; وهذا يعمل: سيطابق أربعة أحرف رقمية. لكن بدلًا من كتابة نفس الصنف عدة مرات، يمكنك إعطاؤه محددًا كميًا. +## المحددات الكمية الدقيقة + تُعرف المحددات الكمية بأقواس متعرجة تحتوي على رقم أو رقمين. دعنا نستخدم محددًا كميًا في نمطنا: ```js @@ -40,6 +42,8 @@ console.log(regex.test("1234567")); // false النمط يطابق فقط السلسلة التي تحتوي على أربعة أرقام بالضبط، لأننا استخدمنا وسم الرابط ووسم الرابط للنهاية، ومحددنا الكمي يسمح بأربعة أرقام فقط بالضبط. لكن ربما رمز التعريف يحتاج فقط إلى حد أدنى من أربعة أرقام. +## المحددات الكمية للحد الأدنى والحد الأقصى + للسماح بأربعة أرقام أو أكثر، أضف فاصلة بعد الرقم في المحدد الكمي: ```js @@ -84,6 +88,10 @@ console.log(regex.test("1234567")); // false لاحظ أنه لا يمكنك استخدام هذه الصيغة لتحديد الحد الأقصى فقط: يجب دائمًا تحديد الحد الأدنى. لكن إذا حددت الحد الأدنى بـ `1`، يمكنك تحقيق نفس النتيجة فعليًا. +## المحددات الكمية المختصرة + +### المحدد الكمي علامة الاستفهام (`?`) + تلقينا متطلبات محدثة من المستخدمين. يمكن الآن أن تبدأ الرموز بحرف اختياريًا. نعرف بالفعل صنف الحرف لذلك، فلنضيفه إلى التعبير النمطي: ```js @@ -122,6 +130,8 @@ console.log(regex.test("1234567")); // false نمطنا الآن يسمح بحرف اختياري واحد، يليه من أربعة إلى ستة أرقام. +### المحدد الكمي النجمة (`*`) + للأسف، أدركنا للتو أننا قرأنا المتطلبات بشكل خاطئ. نحتاج للسماح بأي عدد من الحروف قبل الأرقام. يمكننا استخدام محددنا الكمي مع حد أدنى `0` وبدون حد أقصى محدد: ```js @@ -144,6 +154,8 @@ console.log(regex.test("1234567")); // false ::: +### المحدد الكمي علامة الجمع (`+`) + الآن نطابق بنجاح أي معرف يحتوي على صفر أو أكثر من الحروف متبوعة بأربعة إلى ستة أرقام. لكن تبين أن هذا يتسبب في تعطل نظامنا: يجب علينا فعليًا أن نطلب وجود حرف واحد على الأقل. مرة أخرى، يمكننا استخدام محدد كمي بحد أدنى واحد وبدون حد أقصى محدد، أو يمكننا استخدام صيغة خاصة أخرى، وهي رمز الزائد (`+`): diff --git a/curriculum/challenges/arabic/blocks/lecture-working-with-the-dom-click-events-and-web-apis/673368ccf52205329b729378.md b/curriculum/challenges/arabic/blocks/lecture-working-with-the-dom-click-events-and-web-apis/673368ccf52205329b729378.md index 696a5c6e069..b4514450098 100644 --- a/curriculum/challenges/arabic/blocks/lecture-working-with-the-dom-click-events-and-web-apis/673368ccf52205329b729378.md +++ b/curriculum/challenges/arabic/blocks/lecture-working-with-the-dom-click-events-and-web-apis/673368ccf52205329b729378.md @@ -7,12 +7,16 @@ dashedName: what-is-the-difference-between-innertext-textcontent-and-innerhtml # --interactive-- +## نظرة عامة + دعنا نتعلم عن `innerText` و `textContent` و `innerHTML`. هذه خصائص يمكنك الوصول إليها في JavaScript للحصول على محتوى عنصر HTML أو تغييره. رغم أنها قد تبدو متشابهة جدًا في البداية، إلا أن هناك اختلافات رئيسية بينها. اختيار الخاصية المناسبة يعتمد على حالتك الخاصة، فلنبدأ. لنبدأ بـ `innerText`. +## فهم innerText + `innerText` يمثل النص المرئي داخل عنصر HTML وعناصره التابعة. هذه الخاصية لا تشمل النص المخفي أو وسوم HTML، بل النص المعروض فقط. على سبيل المثال، هنا ترى عنصر `div` يحتوي على فقرتين: @@ -109,6 +113,8 @@ container.innerText = "JavaScript is awesome!"; جيد. الآن لنتحدث عن `textContent`. +## فهم textContent + `textContent` يعيد النص العادي داخل العنصر، بما في ذلك كل النص داخل العناصر التابعة. الفرق الأهم بين `innerText` و `textContent` هو أن `textContent` يعيد دائمًا النص الكامل لعنصر HTML وعناصره التابعة، بغض النظر عن كونه مرئيًا أو مخفيًا. @@ -181,6 +187,8 @@ container.textContent = "New content"; ::: +## المقارنة مع innerHTML + وأخيرًا، لنتحدث عن كيف يختلف `textContent` و `innerText` عن `innerHTML`. تذكر أنه مع `innerHTML` يمكنك تعيين محتوى HTML الداخلي لعنصر. هذا مفيد لإدخال HTML جديد في DOM بشكل ديناميكي. @@ -189,6 +197,8 @@ container.textContent = "New content"; لتجنب ذلك، يُنصح باستخدام خاصية `textContent` لإدخال نص عادي بدلاً من ذلك. +## ملخص الفروقات الرئيسية + توفر خصائص `innerText` و `textContent` و `innerHTML` في JavaScript طرقًا مختلفة للوصول إلى محتوى عناصر HTML والتعامل معه. يجب أن تفهم الفروقات بينها إذا كان هدفك العمل بفعالية مع محتوى HTML في JavaScript. # --questions-- diff --git a/curriculum/challenges/arabic/blocks/machine-learning-with-python-projects/5e46f8d6ac417301a38fb92d.md b/curriculum/challenges/arabic/blocks/machine-learning-with-python-projects/5e46f8d6ac417301a38fb92d.md index a402fb1b576..5a8a812ccd4 100644 --- a/curriculum/challenges/arabic/blocks/machine-learning-with-python-projects/5e46f8d6ac417301a38fb92d.md +++ b/curriculum/challenges/arabic/blocks/machine-learning-with-python-projects/5e46f8d6ac417301a38fb92d.md @@ -10,7 +10,7 @@ dashedName: rock-paper-scissors في هذا التحدٍّ، ستنشئ برنامجًا للعب حجر ورقة مقص. البرنامج الذي يختار عشوائيًا عادةً ما يفوز بنسبة 50% من الوقت. لتجاوز هذا التحدٍّ، يجب أن يلعب برنامجك مباريات ضد أربعة روبوتات مختلفة، ويفوز بما لا يقل عن 60% من الألعاب في كل مباراة. -ستعمل <a href="https://app.ona.com/?autostart=true#https://github.com/freeCodeCamp/boilerplate-rock-paper-scissors/" target="_blank" rel="noopener noreferrer nofollow">على هذا المشروع باستخدام قالب أونا الجاهز</a>. +ستعمل على هذا المشروع باستخدام <a href="https://codespaces.new/freeCodeCamp/boilerplate-rock-paper-scissors/" target="_blank" rel="noopener noreferrer nofollow">شفرة البداية الخاصة بنا</a>. ما زلنا نطوّر الجزء التفاعلي التعليمي من منهج تعلم الآلة. في الوقت الحالي، عليك استخدام مصادر أخرى لتتعلم كيفية تجاوز هذا التحدٍّ. diff --git a/curriculum/challenges/arabic/blocks/review-introduction-to-express/6a0354d43d4c00eca38561f7.md b/curriculum/challenges/arabic/blocks/review-introduction-to-express/6a0354d43d4c00eca38561f7.md index 24a80e0719f..625d2560849 100644 --- a/curriculum/challenges/arabic/blocks/review-introduction-to-express/6a0354d43d4c00eca38561f7.md +++ b/curriculum/challenges/arabic/blocks/review-introduction-to-express/6a0354d43d4c00eca38561f7.md @@ -7,53 +7,6 @@ dashedName: review-introduction-to-express # --description-- -## خدمات الويب وواجهات برمجة التطبيقات - -- **API (واجهة برمجة التطبيقات)**: طريقة عامة لتواصل البرمجيات مع بعضها. -- **خدمة ويب**: نوع محدد من API يستخدم تقنيات الويب مثل HTTP لتبادل البيانات عبر الشبكة. كل خدمة ويب هي API، لكن ليس كل API هي خدمة ويب. -- **الخصائص الرئيسية لخدمة الويب**: تعمل على خادم، تتيح التواصل بين الآلات، غير مرتبطة بلغة برمجة معينة، غير مرتبطة بمنصة معينة، وتستخدم بروتوكولات ويب قياسية (HTTP/HTTPS، FTP، SMTP). -- **REST (نقل الحالة التمثيلية)**: أكثر أنواع خدمات الويب استخدامًا اليوم. تتيح الوصول إلى الموارد المحددة بمسارات URL مثل `/users` أو `/users/20`. عادةً ما تكون الاستجابات بصيغة JSON، لكنها قد تكون XML أو نصًا عاديًا. -- **SOAP (بروتوكول الوصول البسيط للكائنات)**: يستخدم XML فقط. شائع في أنظمة المؤسسات التي تحتاج إلى معايير وأمان أكثر صرامة. -- **XML-RPC**: يستخدم XML لترميز الطلبات والاستجابات. خفيف الوزن لكنه أقل مرونة من REST. -- **القسم العلوي `Accept`**: يستخدمه العميل ليخبر الخادم بصيغة الاستجابة المطلوبة، مثل `Accept: application/json`. - -## بنية REST - -- **عديم الحالة**: يجب أن يحتوي كل طلب على كل المعلومات التي يحتاجها الخادم لمعالجته. الخادم لا يتذكر الطلبات السابقة. -- **المورد**: قطعة بيانات يمكن الوصول إليها أو تعديلها، محددة بواسطة URL (مثل `/products/1`). -- **طرق HTTP في REST**: - - `GET` — استرجاع مورد - - `POST` — إنشاء مورد جديد - - `PUT` / `PATCH` — تحديث مورد موجود - - `DELETE` — حذف مورد - -## رموز حالة HTTP - -بعد معالجة الطلب، يرد الخادم برمز حالة يشير إلى النتيجة: - -- `200` **(OK)**: تم تنفيذ الطلب بنجاح -- `201` **(Created)**: تم إنشاء مورد جديد -- `400` **(Bad Request)**: أرسل العميل بيانات غير صحيحة -- `404` **(Not Found)**: المورد المطلوب غير موجود -- `500` **(Internal Server Error)**: حدث خطأ في الخادم - -### كيف يعمل طلب REST - -1. يرسل العميل طلبًا مع طريقة، URL، رؤوس اختيارية، وجسم اختياري. -2. يتحقق الخادم من صحة الطلب ويحدد المورد. -3. ينفذ الخادم الإجراء (استرجاع، إنشاء، تحديث، أو حذف). -4. يبني الخادم استجابة مع رمز حالة وجسم اختياري (عادة JSON). -5. يرسل الخادم الاستجابة — لا يتم تخزين حالة العميل. -6. يتحقق العميل من رمز الحالة ويعالج البيانات المستلمة. - -## التطبيقات الأحادية مقابل الخدمات المصغرة - -- **التطبيق الأحادي**: قاعدة شفرة واحدة كبيرة حيث تتواجد واجهة المستخدم، قاعدة البيانات، وAPI معًا. يعمل جيدًا للتطبيقات الصغيرة لكنه يصبح أصعب في الصيانة والتوسع مع النمو. -- **الخدمات المصغرة**: بنية تقسم التطبيق الكبير إلى خدمات أصغر مستقلة. كل خدمة تتعامل مع قدرة عمل واحدة (مثل المنتجات، الطلبات، المدفوعات) ويمكن أن يكون لها قاعدة شفرة، قاعدة بيانات، وفريق خاص بها. -- **كيف تتواصل الخدمات المصغرة**: عبر APIs أو أنظمة قائمة على الرسائل. -- **مزايا الخدمات المصغرة**: تطوير أسرع، عزل أفضل للأخطاء، وحرية استخدام لغات أو أُطُر مختلفة لكل خدمة. -- **تحديات الخدمات المصغرة**: تصحيح أخطاء أكثر تعقيدًا، إدارة بنية تحتية أصعب، وزيادة الحمل الشبكي بين الخدمات. - ## ما هو Express.js؟ - **Express**: إطار عمل ويب بسيط ومرن مبني على Node.js يسهل بناء خوادم الويب وواجهات برمجة التطبيقات. diff --git a/curriculum/challenges/arabic/blocks/review-javascript/6723d3cfdd0717d3f1bf27e3.md b/curriculum/challenges/arabic/blocks/review-javascript/6723d3cfdd0717d3f1bf27e3.md index 8bc09c88e66..ece1f852b6f 100644 --- a/curriculum/challenges/arabic/blocks/review-javascript/6723d3cfdd0717d3f1bf27e3.md +++ b/curriculum/challenges/arabic/blocks/review-javascript/6723d3cfdd0717d3f1bf27e3.md @@ -3468,9 +3468,7 @@ document.cookie = "username=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/"; ## IndexedDB -- **التعريف**: IndexedDB تُستخدم لتخزين البيانات المهيكلة في المتصفح. وهي مدمجة في متصفحات الويب الحديثة، مما يسمح لتطبيقات الويب بتخزين واسترجاع كائنات JavaScript بكفاءة. - -- **التعريف**: تُستخدم IndexedDB لتخزين البيانات المنظمة في المتصفح. وهي مدمجة في متصفحات الويب الحديثة، مما يسمح لتطبيقات الويب بتخزين واسترجاع كائنات جافاسكريبت بكفاءة. +- **التعريف**: تُستخدم IndexedDB لتخزين البيانات المهيكلة في المتصفح. وهي مدمجة في متصفحات الويب الحديثة، مما يسمح لتطبيقات الويب بتخزين واسترجاع كائنات JavaScript بكفاءة. ## عمال التخزين المؤقت / الخدمة (Cache/Service Workers) diff --git a/curriculum/challenges/arabic/blocks/review-local-storage-and-crud/6723d0ac516099c902394e8b.md b/curriculum/challenges/arabic/blocks/review-local-storage-and-crud/6723d0ac516099c902394e8b.md index 17dff64f78d..fbbe299acbe 100644 --- a/curriculum/challenges/arabic/blocks/review-local-storage-and-crud/6723d0ac516099c902394e8b.md +++ b/curriculum/challenges/arabic/blocks/review-local-storage-and-crud/6723d0ac516099c902394e8b.md @@ -121,7 +121,7 @@ document.cookie = "username=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/"; ## IndexedDB -- **التعريف**: تُستخدم IndexedDB لتخزين البيانات المنظمة في المتصفح. وهي مدمجة في متصفحات الويب الحديثة، مما يسمح لتطبيقات الويب بتخزين واسترجاع كائنات جافاسكريبت بكفاءة. +- **التعريف**: تُستخدم IndexedDB لتخزين البيانات المهيكلة في المتصفح. وهي مدمجة في متصفحات الويب الحديثة، مما يسمح لتطبيقات الويب بتخزين واسترجاع كائنات JavaScript بكفاءة. ## عمال التخزين المؤقت / الخدمة (Cache/Service Workers) diff --git a/curriculum/challenges/arabic/blocks/review-rest-api-and-web-services/6a7c78ad958a597ee788ad2a.md b/curriculum/challenges/arabic/blocks/review-rest-api-and-web-services/6a7c78ad958a597ee788ad2a.md new file mode 100644 index 00000000000..70f21e576e1 --- /dev/null +++ b/curriculum/challenges/arabic/blocks/review-rest-api-and-web-services/6a7c78ad958a597ee788ad2a.md @@ -0,0 +1,59 @@ +--- +id: 6a7c78ad958a597ee788ad2a +title: مراجعة واجهة برمجة التطبيقات REST وخدمات الويب +challengeType: 31 +dashedName: review-rest-api-and-web-services +--- + +# --description-- + +## خدمات الويب وواجهات برمجة التطبيقات + +- **API (واجهة برمجة التطبيقات)**: طريقة عامة لتواصل البرمجيات مع بعضها. +- **خدمة ويب**: نوع محدد من API يستخدم تقنيات الويب مثل HTTP لتبادل البيانات عبر الشبكة. كل خدمة ويب هي API، لكن ليس كل API هي خدمة ويب. +- **الخصائص الرئيسية لخدمة الويب**: تعمل على خادم، تتيح التواصل بين الآلات، غير مرتبطة بلغة برمجة معينة، غير مرتبطة بمنصة معينة، وتستخدم بروتوكولات ويب قياسية (HTTP/HTTPS، FTP، SMTP). +- **REST (نقل الحالة التمثيلية)**: أكثر أنواع خدمات الويب استخدامًا اليوم. تتيح الوصول إلى الموارد المحددة بمسارات URL مثل `/users` أو `/users/20`. عادةً ما تكون الاستجابات بصيغة JSON، لكنها قد تكون XML أو نصًا عاديًا. +- **SOAP (بروتوكول الوصول البسيط للكائنات)**: يستخدم XML فقط. شائع في أنظمة المؤسسات التي تحتاج إلى معايير وأمان أكثر صرامة. +- **XML-RPC**: يستخدم XML لترميز الطلبات والاستجابات. خفيف الوزن لكنه أقل مرونة من REST. +- **القسم العلوي `Accept`**: يستخدمه العميل ليخبر الخادم بصيغة الاستجابة المطلوبة، مثل `Accept: application/json`. + +## بنية REST + +- **عديم الحالة**: يجب أن يحتوي كل طلب على كل المعلومات التي يحتاجها الخادم لمعالجته. الخادم لا يتذكر الطلبات السابقة. +- **المورد**: قطعة بيانات يمكن الوصول إليها أو تعديلها، محددة بواسطة URL (مثل `/products/1`). +- **طرق HTTP في REST**: + - `GET` — استرجاع مورد + - `POST` — إنشاء مورد جديد + - `PUT` / `PATCH` — تحديث مورد موجود + - `DELETE` — حذف مورد + +## رموز حالة HTTP + +بعد معالجة الطلب، يرد الخادم برمز حالة يشير إلى النتيجة: + +- `200` **(OK)**: تم تنفيذ الطلب بنجاح +- `201` **(Created)**: تم إنشاء مورد جديد +- `400` **(Bad Request)**: أرسل العميل بيانات غير صحيحة +- `404` **(Not Found)**: المورد المطلوب غير موجود +- `500` **(Internal Server Error)**: حدث خطأ في الخادم + +### كيف يعمل طلب REST + +1. يرسل العميل طلبًا مع طريقة، URL، رؤوس اختيارية، وجسم اختياري. +2. يتحقق الخادم من صحة الطلب ويحدد المورد. +3. ينفذ الخادم الإجراء (استرجاع، إنشاء، تحديث، أو حذف). +4. يبني الخادم استجابة مع رمز حالة وجسم اختياري (عادة JSON). +5. يرسل الخادم الاستجابة — لا يتم تخزين حالة العميل. +6. يتحقق العميل من رمز الحالة ويعالج البيانات المستلمة. + +## التطبيقات الأحادية مقابل الخدمات المصغرة + +- **التطبيق الأحادي**: قاعدة شفرة واحدة كبيرة حيث تتواجد واجهة المستخدم، قاعدة البيانات، وAPI معًا. يعمل جيدًا للتطبيقات الصغيرة لكنه يصبح أصعب في الصيانة والتوسع مع النمو. +- **الخدمات المصغرة**: بنية تقسم التطبيق الكبير إلى خدمات أصغر مستقلة. كل خدمة تتعامل مع قدرة عمل واحدة (مثل المنتجات، الطلبات، المدفوعات) ويمكن أن يكون لها قاعدة شفرة، قاعدة بيانات، وفريق خاص بها. +- **كيف تتواصل الخدمات المصغرة**: عبر APIs أو أنظمة قائمة على الرسائل. +- **مزايا الخدمات المصغرة**: تطوير أسرع، عزل أفضل للأخطاء، وحرية استخدام لغات أو أُطُر مختلفة لكل خدمة. +- **تحديات الخدمات المصغرة**: تصحيح أخطاء أكثر تعقيدًا، إدارة بنية تحتية أصعب، وزيادة الحمل الشبكي بين الخدمات. + +# --assignment-- + +راجع مواضيع ومفاهيم واجهة برمجة التطبيقات REST وخدمات الويب. diff --git a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e89d557d4b78bf83a02ae6.md b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e89d557d4b78bf83a02ae6.md index 74d285b962a..18ba4355818 100644 --- a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e89d557d4b78bf83a02ae6.md +++ b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e89d557d4b78bf83a02ae6.md @@ -396,10 +396,10 @@ body { const { useState } = React; export const FootballPlayerCard = () => { - return ( + return ( --fcc-editable-region-- - <h1 style={{ backgroundColor: '#fff' }}>Hello, TSX!</h1> + <h1 style={{ backgroundColor: "#fff" }}>Hello, TSX!</h1> --fcc-editable-region-- - ) + ); }; ``` diff --git a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb2.md b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb2.md index e6d02b1e001..5cff9808d59 100644 --- a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb2.md +++ b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb2.md @@ -29,12 +29,10 @@ assert.equal(element?.type, window.index.PlayerCard); <meta charset="utf-8"/> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Football Player Card Builder - - - + @@ -379,21 +377,18 @@ body { ```tsx const { useState } = React; -export function PlayerCard() { +export const PlayerCard = () => { return ( -
- -
+
); -} +}; export const FootballPlayerCard = () => { - + --fcc-editable-region-- return ( - --fcc-editable-region-- -

Football Card Builder

- --fcc-editable-region-- - ) +

Football Card Builder

+ ); + --fcc-editable-region-- }; ``` diff --git a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb3.md b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb3.md index 882af23200c..2698f5174eb 100644 --- a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb3.md +++ b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb3.md @@ -382,15 +382,13 @@ export const PlayerCard = () => { return (
--fcc-editable-region-- - + --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { - return ( - - ); + return ; }; ``` diff --git a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb4.md b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb4.md index 7cedcac5c11..0efeaa61720 100644 --- a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb4.md +++ b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb4.md @@ -381,12 +381,12 @@ export const PlayerCard = () => {
--fcc-editable-region-- - + --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb5.md b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb5.md index 958f10ccfed..2f004899f88 100644 --- a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb5.md +++ b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb5.md @@ -1,6 +1,6 @@ --- id: 69e8b295388ebbd517692bb5 -title: خطوة 6 +title: الخطوة 6 challengeType: 0 dashedName: step-6 --- @@ -394,13 +394,13 @@ export const PlayerCard = () => {
--fcc-editable-region-- - + --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb6.md b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb6.md index ba2166bd471..c4e77f1a6b2 100644 --- a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb6.md +++ b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb6.md @@ -1,6 +1,6 @@ --- id: 69e8b295388ebbd517692bb6 -title: خطوة 7 +title: الخطوة 7 challengeType: 0 dashedName: step-7 --- @@ -390,14 +390,14 @@ export const PlayerCard = () => {
98
--fcc-editable-region-- - + --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb7.md b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb7.md index 97ccf4b34d0..83b016f756c 100644 --- a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb7.md +++ b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb7.md @@ -1,6 +1,6 @@ --- id: 69e8b295388ebbd517692bb7 -title: خطوة 8 +title: الخطوة 8 challengeType: 0 dashedName: step-8 --- @@ -398,13 +398,13 @@ export const PlayerCard = () => {
ST
--fcc-editable-region-- - + --fcc-editable-region-- ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb8.md b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb8.md index a117f63549f..c09a1d51a5f 100644 --- a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb8.md +++ b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb8.md @@ -1,6 +1,6 @@ --- id: 69e8b295388ebbd517692bb8 -title: خطوة 9 +title: الخطوة 9 challengeType: 0 dashedName: step-9 --- @@ -394,14 +394,14 @@ export const PlayerCard = () => {
GOLD
--fcc-editable-region-- - + --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb9.md b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb9.md index afd1dd3a767..98cba9aed67 100644 --- a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb9.md +++ b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb9.md @@ -393,12 +393,12 @@ export const PlayerCard = () => { --fcc-editable-region-- - + --fcc-editable-region-- ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bba.md b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bba.md index 495a84a0b2a..7eccd600659 100644 --- a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bba.md +++ b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bba.md @@ -412,13 +412,13 @@ export const PlayerCard = () => {
--fcc-editable-region-- - + --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbb.md b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbb.md index 14135f09cc6..a2b53169aae 100644 --- a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbb.md +++ b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbb.md @@ -406,12 +406,12 @@ export const PlayerCard = () => { Edson Arantes do Nascimento (Pele) headshot --fcc-editable-region-- - + --fcc-editable-region-- ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbc.md b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbc.md index 706770bdc8e..33dd9894866 100644 --- a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbc.md +++ b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbc.md @@ -409,12 +409,12 @@ export const PlayerCard = () => { PELE --fcc-editable-region-- - + --fcc-editable-region-- ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbd.md b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbd.md index b687c559a86..e4468d752f2 100644 --- a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbd.md +++ b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbd.md @@ -1,6 +1,6 @@ --- id: 69e8b295388ebbd517692bbd -title: خطوة 16 +title: الخطوة 16 challengeType: 0 dashedName: step-16 --- @@ -427,13 +427,13 @@ export const PlayerCard = () => { --fcc-editable-region-- - + --fcc-editable-region-- ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbe.md b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbe.md index 05382490262..5cae7e6a5cb 100644 --- a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbe.md +++ b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbe.md @@ -465,7 +465,7 @@ export const PlayerCard = () => { ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbf.md b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbf.md index 54cea8e3e65..6908889ebd3 100644 --- a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbf.md +++ b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbf.md @@ -420,7 +420,7 @@ interface PlayerData { position: string; club: string; --fcc-editable-region-- - + --fcc-editable-region-- } @@ -478,7 +478,7 @@ export const PlayerCard = () => { ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc0.md b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc0.md index 77158b95a2e..8a001431cd2 100644 --- a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc0.md +++ b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc0.md @@ -497,7 +497,7 @@ export const PlayerCard = () => { ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc1.md b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc1.md index d082a7c163b..03b4a7f0531 100644 --- a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc1.md +++ b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc1.md @@ -398,10 +398,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } --fcc-editable-region-- @@ -460,7 +460,7 @@ export const PlayerCard = () => { ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc2.md b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc2.md index 1c5a336aa79..89e3ac9090c 100644 --- a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc2.md +++ b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc2.md @@ -40,12 +40,10 @@ assert.exists(document.querySelector('.card-wrapper.tier-elite')); Football Player Card Builder - - - + @@ -405,10 +403,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -467,9 +465,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc3.md b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc3.md index dd93f8294e5..64e7496c0f1 100644 --- a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc3.md +++ b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc3.md @@ -399,10 +399,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -461,9 +461,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc4.md b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc4.md index e234794c682..16127c71e9a 100644 --- a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc4.md +++ b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc4.md @@ -1,6 +1,6 @@ --- id: 69e8b295388ebbd517692bc4 -title: الخطوة 26 +title: خطوة 26 challengeType: 0 dashedName: step-26 --- @@ -399,10 +399,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -461,9 +461,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc5.md b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc5.md index 7b20d569e98..8ed0371d942 100644 --- a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc5.md +++ b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc5.md @@ -392,10 +392,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -456,9 +456,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc6.md b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc6.md index 953c436cf6c..450a360c78e 100644 --- a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc6.md +++ b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc6.md @@ -401,10 +401,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -465,9 +465,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc7.md b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc7.md index 495f9e43fc0..063fa33b907 100644 --- a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc7.md +++ b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc7.md @@ -1,6 +1,6 @@ --- id: 69e8b295388ebbd517692bc7 -title: الخطوة 29 +title: خطوة 29 challengeType: 0 dashedName: step-29 --- @@ -391,10 +391,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -455,9 +455,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc8.md b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc8.md index 97cd145386b..25a6017603d 100644 --- a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc8.md +++ b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc8.md @@ -407,10 +407,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -436,9 +436,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { {player.name}
- --fcc-editable-region--
+ --fcc-editable-region-- 97 PAC
@@ -448,10 +448,10 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
83 + --fcc-editable-region-- PAS
- --fcc-editable-region--
@@ -471,9 +471,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc9.md b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc9.md index 2e68663c73f..18c5cafe392 100644 --- a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc9.md +++ b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc9.md @@ -483,10 +483,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -545,13 +545,13 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
); -} +}; --fcc-editable-region-- --fcc-editable-region-- export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bca.md b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bca.md index deb8f52d2ca..827d9bfaa0d 100644 --- a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bca.md +++ b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bca.md @@ -419,10 +419,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -481,14 +481,14 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { - name: 'PELE', + name: "PELE", overallRating: 98, - position: 'ST', - club: 'Santos FC', - imageUrl: 'https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg', + position: "ST", + club: "Santos FC", + imageUrl: "https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg", pac: 97, sho: 98, pas: 83, diff --git a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcb.md b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcb.md index 8e84e1fca5f..f17c4de07ce 100644 --- a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcb.md +++ b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcb.md @@ -435,10 +435,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -497,14 +497,14 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { - name: 'PELE', + name: "PELE", overallRating: 98, - position: 'ST', - club: 'Santos FC', - imageUrl: 'https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg', + position: "ST", + club: "Santos FC", + imageUrl: "https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg", pac: 97, sho: 98, pas: 83, @@ -517,6 +517,7 @@ export const FootballPlayerCard = () => { const [player, setPlayer] = useState(defaultPlayer); return ( --fcc-editable-region-- + --fcc-editable-region-- ); diff --git a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcc.md b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcc.md index 1bc5b3d2202..9c663175494 100644 --- a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcc.md +++ b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcc.md @@ -477,7 +477,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -504,7 +504,9 @@ export const FootballPlayerCard = () => { --fcc-editable-region-- + + --fcc-editable-region-- ); diff --git a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcd.md b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcd.md index 5d9f5bd16a2..772d9265d79 100644 --- a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcd.md +++ b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcd.md @@ -1,6 +1,6 @@ --- id: 69e8b296388ebbd517692bcd -title: خطوة 38 +title: الخطوة 38 challengeType: 0 dashedName: step-38 --- @@ -465,7 +465,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bce.md b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bce.md index e367785e214..aa09bb2c16c 100644 --- a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bce.md +++ b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bce.md @@ -470,7 +470,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcf.md b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcf.md index 576672a5fb5..f65797ffd41 100644 --- a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcf.md +++ b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcf.md @@ -488,7 +488,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd0.md b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd0.md index 469c43d0502..0a694b69a44 100644 --- a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd0.md +++ b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd0.md @@ -471,7 +471,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd1.md b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd1.md index 1959e92e12e..c877fc3f2de 100644 --- a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd1.md +++ b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd1.md @@ -471,7 +471,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd2.md b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd2.md index 3dd0b7209a8..388ccb45140 100644 --- a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd2.md +++ b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd2.md @@ -471,7 +471,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -535,7 +535,7 @@ export const FootballPlayerCard = () => { - --fcc-editable-region-- + --fcc-editable-region-- --fcc-editable-region-- diff --git a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd3.md b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd3.md index 548d27507bd..a500de019c6 100644 --- a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd3.md +++ b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd3.md @@ -497,7 +497,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd4.md b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd4.md index 0aa89660bc3..bd45cab8d3a 100644 --- a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd4.md +++ b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd4.md @@ -497,7 +497,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd5.md b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd5.md index 6ffc9953208..bca0f7eb4e6 100644 --- a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd5.md +++ b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd5.md @@ -1,6 +1,6 @@ --- id: 69e8b296388ebbd517692bd5 -title: الخطوة 47 +title: خطوة 47 challengeType: 0 dashedName: step-47 --- @@ -497,7 +497,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd6.md b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd6.md index 3f56b2775bc..05d202414a3 100644 --- a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd6.md +++ b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd6.md @@ -1,6 +1,6 @@ --- id: 69e8b296388ebbd517692bd6 -title: الخطوة 48 +title: خطوة 48 challengeType: 0 dashedName: step-48 --- @@ -470,7 +470,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd7.md b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd7.md index 5240beaaf91..22d5fea0aa5 100644 --- a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd7.md +++ b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd7.md @@ -478,7 +478,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd8.md b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd8.md index aa9eaf82979..a71e85362a4 100644 --- a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd8.md +++ b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd8.md @@ -410,7 +410,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -484,7 +484,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -538,8 +538,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd9.md b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd9.md index e50fdad0a3d..44cc2c09f39 100644 --- a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd9.md +++ b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd9.md @@ -402,7 +402,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -476,7 +476,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -530,8 +530,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bda.md b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bda.md index 44ed56fdf54..83fe332c973 100644 --- a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bda.md +++ b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bda.md @@ -402,7 +402,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -476,7 +476,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -530,8 +530,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdb.md b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdb.md index 8cb26b8d087..4f937d69c32 100644 --- a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdb.md +++ b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdb.md @@ -402,7 +402,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -476,7 +476,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -530,8 +530,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdc.md b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdc.md index dc16f5834b6..b202d550988 100644 --- a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdc.md +++ b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdc.md @@ -402,7 +402,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -476,7 +476,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -530,8 +530,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdd.md b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdd.md index f5cc4e6729a..24c0234aa4f 100644 --- a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdd.md +++ b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdd.md @@ -402,7 +402,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -476,7 +476,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -530,8 +530,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bde.md b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bde.md index 6d6c2a36e7c..a7c9df2a84f 100644 --- a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bde.md +++ b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bde.md @@ -402,7 +402,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -414,10 +414,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -430,7 +430,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
{player.position}
-
{getPlayerTier(player.overallRating).toUpperCase()}
+
+ {getPlayerTier(player.overallRating).toUpperCase()} +
{player.club}
@@ -474,14 +476,14 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { - name: 'PELE', + name: "PELE", overallRating: 98, - position: 'ST', - club: 'Santos FC', - imageUrl: 'https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg', + position: "ST", + club: "Santos FC", + imageUrl: "https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg", pac: 97, sho: 98, pas: 83, @@ -506,8 +508,18 @@ export const FootballPlayerCard = () => {

Player Info

- - setPlayer({ ...player, name: e.target.value })} /> + + + setPlayer({ ...player, name: e.target.value }) + } + />
@@ -518,8 +530,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( @@ -531,46 +544,115 @@ export const FootballPlayerCard = () => {
- - setPlayer({ ...player, overallRating: Number(e.target.value) })} /> + + + setPlayer({ + ...player, + overallRating: Number(e.target.value), + }) + } + />
- - setPlayer({ ...player, club: e.target.value })} /> + + + setPlayer({ ...player, club: e.target.value }) + } + />
- - setPlayer({ ...player, imageUrl: e.target.value })} /> + + + setPlayer({ ...player, imageUrl: e.target.value }) + } + />

Player Stats

- - setPlayer({ ...player, pac: Number(e.target.value) })} /> + + + setPlayer({ ...player, pac: Number(e.target.value) }) + } + />
- - setPlayer({ ...player, sho: Number(e.target.value) })} /> + + + setPlayer({ ...player, sho: Number(e.target.value) }) + } + />
- - setPlayer({ ...player, pas: Number(e.target.value) })} /> + + + setPlayer({ ...player, pas: Number(e.target.value) }) + } + />
- + --fcc-editable-region-- --fcc-editable-region--
- +
- +
@@ -579,7 +661,9 @@ export const FootballPlayerCard = () => {

Live Preview

Updates as you type

-
+
diff --git a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdf.md b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdf.md index 5863e660574..1106ca6fbc3 100644 --- a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdf.md +++ b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdf.md @@ -421,7 +421,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -495,7 +495,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -549,8 +549,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( @@ -667,11 +668,11 @@ export const FootballPlayerCard = () => { } /> - --fcc-editable-region--
+ --fcc-editable-region--
@@ -679,8 +680,8 @@ export const FootballPlayerCard = () => { PHY -
--fcc-editable-region-- + diff --git a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8d1be04ed6aad1c955729.md b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8d1be04ed6aad1c955729.md index 7bf50cf27b3..859f71316ea 100644 --- a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8d1be04ed6aad1c955729.md +++ b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69e8d1be04ed6aad1c955729.md @@ -391,8 +391,8 @@ const { useState } = React; --fcc-editable-region-- export const FootballPlayerCard = () => { - return ( -

Football Card Builder

- ) + return ( +

Football Card Builder

+ ); }; ``` diff --git a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69ea01c45b04f3e9de845036.md b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69ea01c45b04f3e9de845036.md index f0040d2f71e..2ff55cd1f17 100644 --- a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69ea01c45b04f3e9de845036.md +++ b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69ea01c45b04f3e9de845036.md @@ -405,7 +405,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -483,7 +483,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -537,8 +537,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69ea02adff0fd528639ee23b.md b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69ea02adff0fd528639ee23b.md index d58a9093522..95ba82ebc6f 100644 --- a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69ea02adff0fd528639ee23b.md +++ b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69ea02adff0fd528639ee23b.md @@ -409,7 +409,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -485,7 +485,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -543,8 +543,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69ea0349f8305a99324465ff.md b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69ea0349f8305a99324465ff.md index 8a819c167da..90b4f6d22f4 100644 --- a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69ea0349f8305a99324465ff.md +++ b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69ea0349f8305a99324465ff.md @@ -407,7 +407,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -483,7 +483,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -502,11 +502,9 @@ const defaultPlayer: PlayerData = { function loadPlayer(): PlayerData { try { --fcc-editable-region-- - - --fcc-editable-region-- - } catch (error) { - } + --fcc-editable-region-- + } catch (error) {} } export const FootballPlayerCard = () => { @@ -547,8 +545,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69ea044f8c93a5e7ce64214c.md b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69ea044f8c93a5e7ce64214c.md index 6511f390643..b2ca72aab52 100644 --- a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69ea044f8c93a5e7ce64214c.md +++ b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69ea044f8c93a5e7ce64214c.md @@ -395,7 +395,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -471,7 +471,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -492,12 +492,10 @@ function loadPlayer(): PlayerData { const saved = localStorage.getItem(STORAGE_KEY); if (saved) { --fcc-editable-region-- - + --fcc-editable-region-- - }; - } catch (error) { - - } + } + } catch (error) {} } export const FootballPlayerCard = () => { @@ -538,8 +536,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69ea0577f25e519489353f82.md b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69ea0577f25e519489353f82.md index 357673a14f2..bdb5d92270d 100644 --- a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69ea0577f25e519489353f82.md +++ b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69ea0577f25e519489353f82.md @@ -405,7 +405,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -418,7 +418,6 @@ interface PlayerData { const STORAGE_KEY = "football_player_card"; - export function getPlayerTier(rating: number): string { if (rating >= 92) return "elite"; if (rating >= 85) return "gold"; @@ -482,7 +481,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -505,14 +504,15 @@ function loadPlayer(): PlayerData { return { ...defaultPlayer, ...JSON.parse(saved) - } - }; ---fcc-editable-region-- + }; + } } catch (error) { +--fcc-editable-region-- } -} + --fcc-editable-region-- +} export const FootballPlayerCard = () => { const [player, setPlayer] = useState(defaultPlayer); @@ -552,8 +552,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69ea064edb0dcc46e1422cca.md b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69ea064edb0dcc46e1422cca.md index bdde5028160..969ef88cdea 100644 --- a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69ea064edb0dcc46e1422cca.md +++ b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69ea064edb0dcc46e1422cca.md @@ -401,7 +401,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -477,7 +477,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -500,8 +500,8 @@ function loadPlayer(): PlayerData { return { ...defaultPlayer, ...JSON.parse(saved) - } - }; + }; + } } catch (error) { console.log("Failed to load player data, using defaults:", error); } @@ -546,8 +546,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69ea0939f2f92cfc6c7a850d.md b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69ea0939f2f92cfc6c7a850d.md index 6338ff5e615..82f0d3e9cf5 100644 --- a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69ea0939f2f92cfc6c7a850d.md +++ b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69ea0939f2f92cfc6c7a850d.md @@ -46,12 +46,10 @@ assert.match(__helpers.removeJSComments(code), /useEffect\s*\(\(\)\s=>\s*\{\s*tr Football Player Card Builder - - - + @@ -415,7 +413,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -435,7 +433,7 @@ export function getPlayerTier(rating: number): string { return "bronze"; } -function PlayerCard({ player }: { player: PlayerData }) { +export const PlayerCard = ({ player }: { player: PlayerData }) => { return (
@@ -491,7 +489,7 @@ function PlayerCard({ player }: { player: PlayerData }) {
); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -514,8 +512,8 @@ function loadPlayer(): PlayerData { return { ...defaultPlayer, ...JSON.parse(saved) - } - }; + }; + } } catch (error) { console.log("Failed to load player data, using defaults:", error); } @@ -526,7 +524,7 @@ export const FootballPlayerCard = () => { const [player, setPlayer] = useState(defaultPlayer); --fcc-editable-region-- - + --fcc-editable-region-- return ( @@ -565,8 +563,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69ea0a89bd84cf2461b48ceb.md b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69ea0a89bd84cf2461b48ceb.md index a6b8fdba75d..fd95d2af417 100644 --- a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69ea0a89bd84cf2461b48ceb.md +++ b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69ea0a89bd84cf2461b48ceb.md @@ -403,7 +403,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -479,7 +479,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -502,8 +502,8 @@ function loadPlayer(): PlayerData { return { ...defaultPlayer, ...JSON.parse(saved) - } - }; + }; + } } catch (error) { console.log("Failed to load player data, using defaults:", error); } @@ -513,15 +513,15 @@ function loadPlayer(): PlayerData { export const FootballPlayerCard = () => { const [player, setPlayer] = useState(defaultPlayer); ---fcc-editable-region-- useEffect(() => { try { +--fcc-editable-region-- } catch (error) { +--fcc-editable-region-- } }, [player]); ---fcc-editable-region-- return (
@@ -559,8 +559,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69ea0bb3e7000f44c207bb0e.md b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69ea0bb3e7000f44c207bb0e.md index ce566360256..0f493e32d41 100644 --- a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69ea0bb3e7000f44c207bb0e.md +++ b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69ea0bb3e7000f44c207bb0e.md @@ -401,7 +401,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -477,7 +477,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -500,8 +500,8 @@ function loadPlayer(): PlayerData { return { ...defaultPlayer, ...JSON.parse(saved) - } - }; + }; + } } catch (error) { console.log("Failed to load player data, using defaults:", error); } @@ -557,8 +557,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( @@ -1098,7 +1099,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -1174,7 +1175,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -1197,8 +1198,8 @@ function loadPlayer(): PlayerData { return { ...defaultPlayer, ...JSON.parse(saved) - } - }; + }; + } } catch (error) { console.log("Failed to load player data, using defaults:", error); } @@ -1252,8 +1253,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69ea1bb4a66dd6debb999c7f.md b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69ea1bb4a66dd6debb999c7f.md index 5f02596e35b..0fa739c792d 100644 --- a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69ea1bb4a66dd6debb999c7f.md +++ b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69ea1bb4a66dd6debb999c7f.md @@ -473,7 +473,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69ea1dd8e74976afa407bf22.md b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69ea1dd8e74976afa407bf22.md index 579ffa913bf..3880cbbc581 100644 --- a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69ea1dd8e74976afa407bf22.md +++ b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69ea1dd8e74976afa407bf22.md @@ -479,7 +479,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69ea1ed1543a4db863564aac.md b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69ea1ed1543a4db863564aac.md index e0ece75d6ab..8792bfc9fc1 100644 --- a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69ea1ed1543a4db863564aac.md +++ b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69ea1ed1543a4db863564aac.md @@ -1,6 +1,6 @@ --- id: 69ea1ed1543a4db863564aac -title: خطوة 51 +title: الخطوة 51 challengeType: 0 dashedName: step-51 --- @@ -472,7 +472,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69ea21dcd8c4cb48c23a2c67.md b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69ea21dcd8c4cb48c23a2c67.md index 3f08e472684..8691a01b8ea 100644 --- a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69ea21dcd8c4cb48c23a2c67.md +++ b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69ea21dcd8c4cb48c23a2c67.md @@ -14,7 +14,7 @@ dashedName: step-53 يجب أن يحتوي عنصر `select` الخاص بالموقع على معالِج `onChange` يستدعي `setPlayer` مع نسخ من `player` ويُحدّث `position`. ```js -assert.match(__helpers.removeJSComments(code), /onChange.*setPlayer.*\.\.\.\s*player[\s\S]*position/); +assert.match(__helpers.removeJSComments(code), /onChange=\{[\s\S]*?position:\s*e\.target\.value\s+as\s+Position/); ``` # --seed-- @@ -469,7 +469,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69ea2378f3c6a60a57cc29c3.md b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69ea2378f3c6a60a57cc29c3.md index 36f49fc305c..825b6d28f45 100644 --- a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69ea2378f3c6a60a57cc29c3.md +++ b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69ea2378f3c6a60a57cc29c3.md @@ -483,7 +483,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -537,10 +537,12 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > --fcc-editable-region-- - + --fcc-editable-region-- diff --git a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69eb216380522cfc11aa408c.md b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69eb216380522cfc11aa408c.md index 81e2069fe8a..c479681f0ed 100644 --- a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69eb216380522cfc11aa408c.md +++ b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69eb216380522cfc11aa408c.md @@ -443,7 +443,7 @@ export const PlayerCard = () => { ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69eb23665c115447405343ac.md b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69eb23665c115447405343ac.md index 702d377c817..a9c77f6bafa 100644 --- a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69eb23665c115447405343ac.md +++ b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69eb23665c115447405343ac.md @@ -1,6 +1,6 @@ --- id: 69eb23665c115447405343ac -title: خطوة 18 +title: الخطوة 18 challengeType: 0 dashedName: step-18 --- @@ -461,7 +461,7 @@ export const PlayerCard = () => { ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69eb2847cc8f5638e226e8ce.md b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69eb2847cc8f5638e226e8ce.md index c9d33b043f5..407ecea2e60 100644 --- a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69eb2847cc8f5638e226e8ce.md +++ b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69eb2847cc8f5638e226e8ce.md @@ -483,10 +483,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -543,7 +543,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { --fcc-editable-region-- diff --git a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69ed3985819de69de27c4390.md b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69ed3985819de69de27c4390.md index b06111f3800..0c93e3bc9cd 100644 --- a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69ed3985819de69de27c4390.md +++ b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69ed3985819de69de27c4390.md @@ -391,10 +391,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -453,14 +453,14 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { - name: 'PELE', + name: "PELE", overallRating: 98, - position: 'ST', - club: 'Santos FC', - imageUrl: 'https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg', + position: "ST", + club: "Santos FC", + imageUrl: "https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg", pac: 97, sho: 98, pas: 83, @@ -471,7 +471,7 @@ const defaultPlayer: PlayerData = { export const FootballPlayerCard = () => { --fcc-editable-region-- - return ; + return ; --fcc-editable-region-- }; ``` diff --git a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69f1a6f57dd2d4685822074a.md b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69f1a6f57dd2d4685822074a.md index 0aedab276b5..a724a7df6ce 100644 --- a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69f1a6f57dd2d4685822074a.md +++ b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69f1a6f57dd2d4685822074a.md @@ -1,6 +1,6 @@ --- id: 69f1a6f57dd2d4685822074a -title: خطوة 14 +title: الخطوة 14 challengeType: 0 dashedName: step-14 --- @@ -401,8 +401,8 @@ export const PlayerCard = () => {
- --fcc-editable-region--
+ --fcc-editable-region--
@@ -410,14 +410,14 @@ export const PlayerCard = () => {
-
--fcc-editable-region-- +
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69f1a9e19340f19b1fd051c6.md b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69f1a9e19340f19b1fd051c6.md index fc9763657b2..683b10263e2 100644 --- a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69f1a9e19340f19b1fd051c6.md +++ b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69f1a9e19340f19b1fd051c6.md @@ -1,6 +1,6 @@ --- id: 69f1a9e19340f19b1fd051c6 -title: خطوة 17 +title: الخطوة 17 challengeType: 0 dashedName: step-17 --- @@ -416,9 +416,9 @@ export const PlayerCard = () => {
- --fcc-editable-region--
+ --fcc-editable-region--
@@ -426,14 +426,14 @@ export const PlayerCard = () => {
+ --fcc-editable-region--
- --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69f1af24b0860d13f0b295e5.md b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69f1af24b0860d13f0b295e5.md index a2d3bc2b460..9e688e67868 100644 --- a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69f1af24b0860d13f0b295e5.md +++ b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69f1af24b0860d13f0b295e5.md @@ -407,10 +407,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -451,9 +451,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
- --fcc-editable-region--
+ --fcc-editable-region-- 99 DRI
@@ -463,17 +463,17 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
75 + --fcc-editable-region-- PHY
- --fcc-editable-region-- ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69f1b1fb36c6c0c80907e8e1.md b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69f1b1fb36c6c0c80907e8e1.md index 38f641736e2..040b3fcdc09 100644 --- a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69f1b1fb36c6c0c80907e8e1.md +++ b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69f1b1fb36c6c0c80907e8e1.md @@ -483,7 +483,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -511,17 +511,15 @@ export const FootballPlayerCard = () => {
- --fcc-editable-region-- -
- -
+
+ --fcc-editable-region--
+ --fcc-editable-region--
- --fcc-editable-region-- ); }; diff --git a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69f1b591221851200c734eb4.md b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69f1b591221851200c734eb4.md index e863cd6b28f..25ab642689d 100644 --- a/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69f1b591221851200c734eb4.md +++ b/curriculum/challenges/arabic/blocks/workshop-build-a-football-player-card-builder/69f1b591221851200c734eb4.md @@ -472,7 +472,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f356ed6199b0cdef1d2be8f.md b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f356ed6199b0cdef1d2be8f.md index 6fb74a7cb81..78484162c14 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f356ed6199b0cdef1d2be8f.md +++ b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f356ed6199b0cdef1d2be8f.md @@ -13,11 +13,11 @@ dashedName: step-22 ```css .class-name { - styles + property: value; } ``` -غيّر محدد `#menu` الحالي إلى محدد صنف عن طريق استبدال `#menu` بصنف اسمه `.menu`. +غيّر المحدِّد الحالي `#menu` إلى محدِّد صنف باستبدال `#menu` بمحدِّد الصنف `.menu`. # --hints-- diff --git a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f3cade99dda4e6071a85dfd.md b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f3cade99dda4e6071a85dfd.md index 17c83718ae7..d4d5980c4c8 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f3cade99dda4e6071a85dfd.md +++ b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f3cade99dda4e6071a85dfd.md @@ -109,7 +109,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f3ef6e01f288a026d709587.md b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f3ef6e01f288a026d709587.md index 90236875295..600555f2360 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f3ef6e01f288a026d709587.md +++ b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f3ef6e01f288a026d709587.md @@ -171,7 +171,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f3ef6e03d719d5ac4738993.md b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f3ef6e03d719d5ac4738993.md index cadeffeddeb..f55dc502a99 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f3ef6e03d719d5ac4738993.md +++ b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f3ef6e03d719d5ac4738993.md @@ -115,7 +115,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f3ef6e04559b939080db057.md b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f3ef6e04559b939080db057.md index c12b38cbf32..02269c55730 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f3ef6e04559b939080db057.md +++ b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f3ef6e04559b939080db057.md @@ -139,7 +139,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f3ef6e050279c7a4a7101d3.md b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f3ef6e050279c7a4a7101d3.md index 068510f90d4..c5e46a8df08 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f3ef6e050279c7a4a7101d3.md +++ b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f3ef6e050279c7a4a7101d3.md @@ -137,7 +137,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f3ef6e05473f91f948724ab.md b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f3ef6e05473f91f948724ab.md index 25a53990639..a29160c69c4 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f3ef6e05473f91f948724ab.md +++ b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f3ef6e05473f91f948724ab.md @@ -116,6 +116,6 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f3ef6e056bdde6ae6892ba2.md b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f3ef6e056bdde6ae6892ba2.md index d81f8cb4eaa..c077da8e72e 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f3ef6e056bdde6ae6892ba2.md +++ b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f3ef6e056bdde6ae6892ba2.md @@ -9,7 +9,7 @@ dashedName: step-54 من الممل أن يكون كل النص بنفس `font-family`. يمكنك أن تجعل غالبية النص بـ `sans-serif` وتجعل فقط عناصر `h1` و `h2` مختلفة باستخدام محدِّد مختلف. -نسق كل من عنصرَي `h1` و `h2` باستخدام محدِّد واحد بحيث يستخدم نص هذين العنصرين خط `Impact`. +نسق كلًا من العنصرين `h1` و `h2` باستخدام قائمة محدد واحدة بحيث يستخدم نص هذين العنصرين خط `Impact`. # --hints-- @@ -135,7 +135,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f3ef6e06d34faac0447fc44.md b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f3ef6e06d34faac0447fc44.md index cfe9d5e6688..cee7993b69a 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f3ef6e06d34faac0447fc44.md +++ b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f3ef6e06d34faac0447fc44.md @@ -127,7 +127,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f3ef6e07276f782bb46b93d.md b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f3ef6e07276f782bb46b93d.md index cc6be157374..20a779a56d2 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f3ef6e07276f782bb46b93d.md +++ b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f3ef6e07276f782bb46b93d.md @@ -142,7 +142,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f3ef6e0819d4f23ca7285e6.md b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f3ef6e0819d4f23ca7285e6.md index df9584c15bd..663867f06e1 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f3ef6e0819d4f23ca7285e6.md +++ b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f3ef6e0819d4f23ca7285e6.md @@ -104,7 +104,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f3ef6e087d56ed3ffdc36be.md b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f3ef6e087d56ed3ffdc36be.md index 168a2fb9e2a..d56dd8b6a1f 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f3ef6e087d56ed3ffdc36be.md +++ b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f3ef6e087d56ed3ffdc36be.md @@ -129,6 +129,6 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f3ef6e0a81099d9a697b550.md b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f3ef6e0a81099d9a697b550.md index c7c16e65a45..b2aa1c0e500 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f3ef6e0a81099d9a697b550.md +++ b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f3ef6e0a81099d9a697b550.md @@ -167,7 +167,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f3ef6e0b431cc215bb16f55.md b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f3ef6e0b431cc215bb16f55.md index a6e6e0e5c8a..592bb7e99fb 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f3ef6e0b431cc215bb16f55.md +++ b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f3ef6e0b431cc215bb16f55.md @@ -141,7 +141,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f3ef6e0e0c3feaebcf647ad.md b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f3ef6e0e0c3feaebcf647ad.md index bca97a8929c..e4223e413a6 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f3ef6e0e0c3feaebcf647ad.md +++ b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f3ef6e0e0c3feaebcf647ad.md @@ -103,7 +103,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f3ef6e0e9629bad967cd71e.md b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f3ef6e0e9629bad967cd71e.md index b13bf553406..90d00ce95b3 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f3ef6e0e9629bad967cd71e.md +++ b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f3ef6e0e9629bad967cd71e.md @@ -7,7 +7,7 @@ dashedName: step-55 # --description-- -يمكنك إضافة قيمة النظام البديل لعائلة الخط عن طريق إضافة اسم خط آخر مفصول بفاصلة. يُستخدم النظام البديل في الحالات التي لا يُعثر فيها على الخط الأساسي أو لا يكون متاحًا. +يمكنك إضافة قيمة النظام البديل لخاصية `font-family` بإضافة اسم خط آخر مفصول بفاصلة. يُستخدم النظام البديل عندما لا يتوفر الخط الأول. أضف الخط البديل `serif` بعد الخط `Impact`. @@ -113,7 +113,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f3ef6e0eaa7da26e3d34d78.md b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f3ef6e0eaa7da26e3d34d78.md index 9b69e27c60c..e7d88a83ef5 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f3ef6e0eaa7da26e3d34d78.md +++ b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f3ef6e0eaa7da26e3d34d78.md @@ -128,7 +128,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f3ef6e0f8c230bdd2349716.md b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f3ef6e0f8c230bdd2349716.md index caaa593d928..a9789865563 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f3ef6e0f8c230bdd2349716.md +++ b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f3ef6e0f8c230bdd2349716.md @@ -140,6 +140,6 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f3f26fa39591db45e5cd7a0.md b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f3f26fa39591db45e5cd7a0.md index 0dcae1d8c13..0657b58b944 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f3f26fa39591db45e5cd7a0.md +++ b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f3f26fa39591db45e5cd7a0.md @@ -150,7 +150,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f459225127805351a6ad057.md b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f459225127805351a6ad057.md index 5a278275dd8..cf2c8188b4b 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f459225127805351a6ad057.md +++ b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f459225127805351a6ad057.md @@ -144,7 +144,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f459a7ceb8b5c446656d88b.md b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f459a7ceb8b5c446656d88b.md index e8eaa5991f5..79b1eec6462 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f459a7ceb8b5c446656d88b.md +++ b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f459a7ceb8b5c446656d88b.md @@ -147,6 +147,6 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f459cf202c2a3472fae6a9f.md b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f459cf202c2a3472fae6a9f.md index 7641176436d..efc22141481 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f459cf202c2a3472fae6a9f.md +++ b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f459cf202c2a3472fae6a9f.md @@ -7,7 +7,7 @@ dashedName: step-67 # --description-- -هل لاحظت كيف يبدو سمك الخط أكبر؟ القيمة الافتراضية لخاصية اسمها `border-width` هي `1px` لكل حواف عناصر `hr`. بتغيير الحدود إلى نفس لون الخلفية، يصبح الارتفاع الكلي للخط `5px` (`3px` بالإضافة إلى سمك الحدود العلوية والسفلية التي تبلغ `1px`). +هل لاحظت كيف يبدو سمك الخط أكبر؟ القيمة الافتراضية لخاصية اسمها `border-width` هي `1px` لكل حواف عناصر `hr`. كان الارتفاع الكلي للخط دائمًا `5px` (`3px` بالإضافة إلى عرض الحدود العلوية والسفلية البالغ `1px` لكل منهما)؛ تلوين الحدود جعل تلك الحواف مرئية. غيّر خاصية `height` لعنصر `hr` إلى `2px`، ليصبح ارتفاعه الكلي `4px`. @@ -147,7 +147,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f459fd48bdc98491ca6d1a3.md b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f459fd48bdc98491ca6d1a3.md index e1540fddb1f..161bee82072 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f459fd48bdc98491ca6d1a3.md +++ b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f459fd48bdc98491ca6d1a3.md @@ -145,7 +145,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f45a05977e2fa49d9119437.md b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f45a05977e2fa49d9119437.md index 8ff196ac030..026b47d294e 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f45a05977e2fa49d9119437.md +++ b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f45a05977e2fa49d9119437.md @@ -146,6 +146,6 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f45a276c093334f0f6e9df4.md b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f45a276c093334f0f6e9df4.md index 966607bc68a..b7529f4ead9 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f45a276c093334f0f6e9df4.md +++ b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f45a276c093334f0f6e9df4.md @@ -185,7 +185,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f45a5a7c49a8251f0bdb527.md b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f45a5a7c49a8251f0bdb527.md index d2e4f431f86..38b593f3051 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f45a5a7c49a8251f0bdb527.md +++ b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f45a5a7c49a8251f0bdb527.md @@ -157,7 +157,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f45a66d4a2b0453301e5a26.md b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f45a66d4a2b0453301e5a26.md index e837a047d7b..19c5c44d199 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f45a66d4a2b0453301e5a26.md +++ b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f45a66d4a2b0453301e5a26.md @@ -166,7 +166,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f45b0731d39e15d54df4dfc.md b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f45b0731d39e15d54df4dfc.md index 4d73518ddc6..9da8672a99c 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f45b0731d39e15d54df4dfc.md +++ b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f45b0731d39e15d54df4dfc.md @@ -161,7 +161,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f45b25e7ec2405f166b9de1.md b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f45b25e7ec2405f166b9de1.md index 1141ae1e152..c15f0ca3a18 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f45b25e7ec2405f166b9de1.md +++ b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f45b25e7ec2405f166b9de1.md @@ -9,7 +9,7 @@ dashedName: step-78 تُغيّر خصائص الرابط عندما يزوره المستخدم باستخدام محدد زائف يشبه `a:visited { propertyName: propertyValue; }`. -غيّر لون رابط تذييل `Visit our website` إلى اللون `grey` عندما يزور المستخدم الرابط. +غيّر لون رابط تذييل `Visit our website` إلى `gray` عندما يزور المستخدم الرابط. # --hints-- @@ -20,14 +20,14 @@ const aVisitedStyle = new __helpers.CSSHelp(document).getStyle('a:visited'); assert.exists(aVisitedStyle); ``` -يجب أن تضبط خاصية `color` على `grey`. +يجب تعيين خاصية `color` إلى `gray`. ```js const hasColor = new __helpers.CSSHelp(document).getCSSRules().some(x => (x.style.color === 'grey' || x.style.color === 'gray')); assert.isTrue(hasColor); ``` -يجب أن يكون لـ `a:visited` الخاص بك خاصية `color` بقيمة `grey`. +يجب أن يكون لـ `a:visited` خاصية `color` بقيمة `gray`. ```js const aVisitedColor = new __helpers.CSSHelp(document).getStyle('a:visited')?.getPropertyValue('color'); @@ -161,7 +161,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f45b3c93c027860d9298dbd.md b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f45b3c93c027860d9298dbd.md index 8b944de220b..7498279f05c 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f45b3c93c027860d9298dbd.md +++ b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f45b3c93c027860d9298dbd.md @@ -161,7 +161,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ @@ -179,7 +179,7 @@ a { } a:visited { - color: grey; + color: gray; } --fcc-editable-region-- diff --git a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f45b45d099f3e621fbbb256.md b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f45b45d099f3e621fbbb256.md index 694c1d8872c..156cd06a8a2 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f45b45d099f3e621fbbb256.md +++ b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f45b45d099f3e621fbbb256.md @@ -161,7 +161,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ @@ -179,7 +179,7 @@ a { } a:visited { - color: grey; + color: gray; } a:hover { diff --git a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f45b4c81cea7763550e40df.md b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f45b4c81cea7763550e40df.md index 8c2ccae5e0f..2b84fabc249 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f45b4c81cea7763550e40df.md +++ b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f45b4c81cea7763550e40df.md @@ -152,7 +152,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ @@ -171,7 +171,7 @@ a { --fcc-editable-region-- a:visited { - color: grey; + color: gray; } a:hover { diff --git a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f45b715301bbf667badc04a.md b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f45b715301bbf667badc04a.md index 39aa915466b..b205ddccb90 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f45b715301bbf667badc04a.md +++ b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f45b715301bbf667badc04a.md @@ -7,7 +7,7 @@ dashedName: step-82 # --description-- -نص القائمة `CAMPER CAFE` له مساحة مختلفة من الأعلى مقارنة بمساحة العنوان في أسفل القائمة. هذا بسبب وجود هامش علوي افتراضي للعنصر `h1` في المتصفح. +المسافة فوق نص القائمة `CAMPER CAFE` لا تتطابق مع المسافة تحت العنوان في أسفل القائمة. هذا بسبب وجود هامش علوي افتراضي للعنصر `h1` في المتصفح. غيّر الهامش العلوي للعنصر `h1` إلى `0` لإزالة كل الهامش العلوي. @@ -157,7 +157,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f46e270702a8456a664f0df.md b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f46e270702a8456a664f0df.md index 0affe871e00..f650297bdb0 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f46e270702a8456a664f0df.md +++ b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f46e270702a8456a664f0df.md @@ -156,7 +156,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f46e36e745ead58487aabf2.md b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f46e36e745ead58487aabf2.md index b1cc5cb6db8..57e4d574ff9 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f46e36e745ead58487aabf2.md +++ b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f46e36e745ead58487aabf2.md @@ -163,7 +163,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f46e7a4750dd05b5a673920.md b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f46e7a4750dd05b5a673920.md index 98cc82dec80..f4c849abb80 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f46e7a4750dd05b5a673920.md +++ b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f46e7a4750dd05b5a673920.md @@ -160,7 +160,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f46e8284aae155c83015dee.md b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f46e8284aae155c83015dee.md index 73dcd58a4a7..2e9d63cfae4 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f46e8284aae155c83015dee.md +++ b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f46e8284aae155c83015dee.md @@ -105,6 +105,7 @@ assert.match(imageAltValue, /coffee icon/i);

123 Free Code Camp Drive

+ ``` @@ -171,7 +172,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f46ede1ff8fec5ba656b44c.md b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f46ede1ff8fec5ba656b44c.md index c8f51788021..b4014a3e8e7 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f46ede1ff8fec5ba656b44c.md +++ b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f46ede1ff8fec5ba656b44c.md @@ -144,7 +144,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } --fcc-editable-region-- diff --git a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f46fc57528aa1c4b5ea7c2e.md b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f46fc57528aa1c4b5ea7c2e.md index bf1b25b809b..53ab313f1d1 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f46fc57528aa1c4b5ea7c2e.md +++ b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f46fc57528aa1c4b5ea7c2e.md @@ -161,7 +161,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f4701b942c824109626c3d8.md b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f4701b942c824109626c3d8.md index 96f3376e2d5..437b345aa66 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f4701b942c824109626c3d8.md +++ b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f4701b942c824109626c3d8.md @@ -153,6 +153,6 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f475bb508746c16c9431d42.md b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f475bb508746c16c9431d42.md index 5653e574d1a..03741f87b0d 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f475bb508746c16c9431d42.md +++ b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f475bb508746c16c9431d42.md @@ -7,9 +7,9 @@ dashedName: step-87 # --description-- -الصورة التي أضفتها ليست في الوسط أفقيًا مثل عنوان `Coffee` أعلاها. عناصر `img` "تشبه" العناصر المضمَّنة. +الصورة التي أضفتها ليست في الوسط أفقيًا مثل عنوان `Coffee` أعلاها. عناصر `img` هي عناصر مضمَّنة، لذا تجلس ضمن تدفق النص. -لجعل الصورة تتصرف مثل عناصر مستوى الكتلة مثل العناوين، أنشئ محدِّد نوع `img`. اضبط خاصية `display` على `block`، واستخدم خاصيتي `margin-left` و`margin-right` لتمركزها أفقيًا. +لجعل الصورة تتصرف كعنصر على مستوى الكتلة مثل العنوان، أنشئ محدِّد نوع `img`. اضبط خاصية `display` على `block`، واستخدم خاصيتي `margin-left` و`margin-right` لتمركزها أفقيًا. # --hints-- @@ -120,6 +120,7 @@ assert.equal(imgMarginRight, 'auto');

123 Free Code Camp Drive

+ ``` @@ -190,7 +191,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f475e1c7f71a61d913836c6.md b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f475e1c7f71a61d913836c6.md index 555cd767002..cec970dc352 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f475e1c7f71a61d913836c6.md +++ b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f475e1c7f71a61d913836c6.md @@ -97,6 +97,7 @@ assert.match(lastImage?.alt, /pie icon/i);

123 Free Code Camp Drive

+ ``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f47fe7e31980053a8d4403b.md b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f47fe7e31980053a8d4403b.md index 5c6d7c43c7d..ab4799363e8 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f47fe7e31980053a8d4403b.md +++ b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f47fe7e31980053a8d4403b.md @@ -7,7 +7,7 @@ dashedName: step-89 # --description-- -سيكون من الجيد تقليل المسافة الرأسية بين عناصر `h2` والرموز المرتبطة بها. تحتوي عناصر `h2` على هامش علوي وسفلي افتراضي، لذا يمكنك تغيير الهامش السفلي لعناصر `h2` إلى `0` أو رقم آخر. +سيكون من الجيد أن يكون الفراغ الرأسي بين عناصر `h2` والرموز المرتبطة بها أصغر. تحتوي عناصر `h2` على هامش علوي وسفلي افتراضي، لذا يمكنك تغيير الهامش السفلي لعناصر `h2` إلى `0` أو قيمة أخرى. هناك طريقة أسهل، أضف ببساطة هامشًا علويًا سالبًا لعناصر `img` لسحبها إلى الأعلى من مواقعها الحالية. تُنشأ القيم السالبة باستخدام `-` قبل القيمة. لإكمال هذه الورشة، استخدم هامشًا علويًا سالبًا بقيمة `25px` في محدِّد النوع `img`. diff --git a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f716ad029ee4053c7027a7a.md b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f716ad029ee4053c7027a7a.md index f534665f6c9..740a4d22510 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f716ad029ee4053c7027a7a.md +++ b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f716ad029ee4053c7027a7a.md @@ -119,7 +119,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f716bee5838c354c728a7c5.md b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f716bee5838c354c728a7c5.md index 3017147e7b2..bd2944cfb9c 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f716bee5838c354c728a7c5.md +++ b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f716bee5838c354c728a7c5.md @@ -158,6 +158,6 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f7b87422a560036fd03ccff.md b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f7b87422a560036fd03ccff.md index 269d59dad00..0942c5498c4 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f7b87422a560036fd03ccff.md +++ b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f7b87422a560036fd03ccff.md @@ -118,7 +118,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f7b88d37b1f98386f04edc0.md b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f7b88d37b1f98386f04edc0.md index 803ccf14488..f852783e725 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f7b88d37b1f98386f04edc0.md +++ b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/5f7b88d37b1f98386f04edc0.md @@ -97,6 +97,6 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/6780e8ef4153930b965cd7b7.md b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/6780e8ef4153930b965cd7b7.md index f20dcd85d5e..6a1c4969a56 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/6780e8ef4153930b965cd7b7.md +++ b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/6780e8ef4153930b965cd7b7.md @@ -125,6 +125,6 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/6780f0d898362873ac425dc8.md b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/6780f0d898362873ac425dc8.md index 72cc4186ec7..84429d32f4a 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cafe-menu/6780f0d898362873ac425dc8.md +++ b/curriculum/challenges/arabic/blocks/workshop-cafe-menu/6780f0d898362873ac425dc8.md @@ -23,7 +23,7 @@ assert.isNotNull(new __helpers.CSSHelp(document).getStyle('address')); assert.isNotEmpty(new __helpers.CSSHelp(document).getStyle('address').getPropVal('font-style')); ``` -يجب تعيين خاصية `font-style` إلى `normal`. +يجب تعيين خاصية `font-style` إلى القيمة `normal`. ```js assert.equal(new __helpers.CSSHelp(document).getStyle('address').getPropVal('font-style'), 'normal'); @@ -156,7 +156,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/arabic/blocks/workshop-calculator/66cc095dfe1682753d2ab030.md b/curriculum/challenges/arabic/blocks/workshop-calculator/66cc095dfe1682753d2ab030.md index 6a268a2a9f2..e8feffdf7b8 100644 --- a/curriculum/challenges/arabic/blocks/workshop-calculator/66cc095dfe1682753d2ab030.md +++ b/curriculum/challenges/arabic/blocks/workshop-calculator/66cc095dfe1682753d2ab030.md @@ -7,7 +7,7 @@ dashedName: step-2 # --description-- -أحد المفاهيم التي تعلمتها في الدروس السابقة هو كيفية إرجاع القيم من دالة. +أحد المفاهيم التي تعلمتها في الدروس السابقة كان كيفية إرجاع القيم من دالة. إليك تذكير بكيفية إرجاع قيمة من دالة: @@ -30,7 +30,10 @@ assert.strictEqual(addTwoAndSeven(), 9); يجب أن تُرجع دالتك `addTwoAndSeven` المجموع باستخدام العامل `+`. ```js -assert.match(code, /return\s*(2\s*\+\s*7|7\s*\+\s*2)\s*;?/); +const explorer = await __helpers.Explorer(code); +const { addTwoAndSeven } = explorer.allFunctions; +const validExpressions = ["2 + 7", "7 + 2", "(2 + 7)", "(7 + 2)"]; +assert.isTrue(validExpressions.some(expr => addTwoAndSeven?.hasReturn(expr))); ``` # --seed-- diff --git a/curriculum/challenges/arabic/blocks/workshop-calculator/66cc0a9e06e00b75d6782be9.md b/curriculum/challenges/arabic/blocks/workshop-calculator/66cc0a9e06e00b75d6782be9.md index 30fb8cc1d33..5a92a4cb088 100644 --- a/curriculum/challenges/arabic/blocks/workshop-calculator/66cc0a9e06e00b75d6782be9.md +++ b/curriculum/challenges/arabic/blocks/workshop-calculator/66cc0a9e06e00b75d6782be9.md @@ -26,16 +26,12 @@ myFunction(); # --hints-- -يجب أن تحتوي شفرتك على `console.log`. +يجب استدعاء الدالة `addTwoAndSeven` داخل `console.log`. ```js -assert.match(code, /console\.log(.*)/); -``` - -يجب أن تستدعي الدالة `addTwoAndSeven` داخل `console.log`. - -```js -assert.match(code, /console\.log\(\s*addTwoAndSeven\(\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(addTwoAndSeven())"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/arabic/blocks/workshop-calculator/66cc0ba5881acb7692cfc4de.md b/curriculum/challenges/arabic/blocks/workshop-calculator/66cc0ba5881acb7692cfc4de.md index c8ead3ad4c5..350a00685fb 100644 --- a/curriculum/challenges/arabic/blocks/workshop-calculator/66cc0ba5881acb7692cfc4de.md +++ b/curriculum/challenges/arabic/blocks/workshop-calculator/66cc0ba5881acb7692cfc4de.md @@ -24,22 +24,24 @@ assert.isFunction(addThreeAndFour); يجب أن تُرجع دالة `addThreeAndFour` مجموع `3` و `4`. ```js -assert.equal(addThreeAndFour(), 7); +assert.strictEqual(addThreeAndFour(), 7); ``` يجب أن تُرجع دالة `addThreeAndFour` المجموع باستخدام العامل `+`. ```js -const declarationStyle = /return\s*\(?\s*(3\s*\+\s*4|4\s*\+\s*3)\s*\)?\s*;?/; -const arrowStyle = /=>\s*\(?\s*(3\s*\+\s*4|4\s*\+\s*3)\s*\)?\s*;?/; -const combinedRegex = new RegExp(`(?:${declarationStyle.source})|(?:${arrowStyle.source})`); -assert.match(code, combinedRegex); +const explorer = await __helpers.Explorer(code); +const { addThreeAndFour } = explorer.allFunctions; +const validExpressions = ["3 + 4", "4 + 3", "(3 + 4)", "(4 + 3)"]; +assert.isTrue(validExpressions.some(expr => addThreeAndFour?.hasReturn(expr))); ``` يجب أن تستدعي دالة `addThreeAndFour` داخل `console.log`. ```js -assert.match(code, /console\.log\(\s*addThreeAndFour\(\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(addThreeAndFour())"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/arabic/blocks/workshop-calculator/66cc0de2920bec775f610424.md b/curriculum/challenges/arabic/blocks/workshop-calculator/66cc0de2920bec775f610424.md index d34697e1b44..baf6e1f6e8a 100644 --- a/curriculum/challenges/arabic/blocks/workshop-calculator/66cc0de2920bec775f610424.md +++ b/curriculum/challenges/arabic/blocks/workshop-calculator/66cc0de2920bec775f610424.md @@ -22,25 +22,33 @@ dashedName: step-5 لا يجب أن يكون لديك دالة باسم `addTwoAndSeven`. ```js -assert.notMatch(code, /function\s+addTwoAndSeven\s*\(\s*\)\s*{/); +const explorer = await __helpers.Explorer(code); +const { addTwoAndSeven } = explorer.allFunctions; +assert.notExists(addTwoAndSeven); ``` لا يجب أن يكون لديك استدعاء دالة لـ `addTwoAndSeven`. ```js -assert.notMatch(code, /console\.log\(\s*addTwoAndSeven\(\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const unexpectedStatement = "console.log(addTwoAndSeven())"; +assert.notInclude(strippedCode, unexpectedStatement); ``` لا يجب أن يكون لديك دالة باسم `addThreeAndFour`. ```js -assert.notMatch(code, /function\s+addThreeAndFour\s*\(\s*\)\s*{/); +const explorer = await __helpers.Explorer(code); +const { addThreeAndFour } = explorer.allFunctions; +assert.notExists(addThreeAndFour); ``` لا يجب أن يكون لديك استدعاء دالة لـ `addThreeAndFour`. ```js -assert.notMatch(code, /console\.log\(\s*addThreeAndFour\(\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const unexpectedStatement = "console.log(addThreeAndFour())"; +assert.notInclude(strippedCode, unexpectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/arabic/blocks/workshop-calculator/66cc0f1ae40802781b2ea972.md b/curriculum/challenges/arabic/blocks/workshop-calculator/66cc0f1ae40802781b2ea972.md index c5bc8a6bdbc..3a39c772402 100644 --- a/curriculum/challenges/arabic/blocks/workshop-calculator/66cc0f1ae40802781b2ea972.md +++ b/curriculum/challenges/arabic/blocks/workshop-calculator/66cc0f1ae40802781b2ea972.md @@ -33,8 +33,11 @@ assert.isFunction(calculateSum); يجب أن تأخذ دالة `calculateSum` معلمتين، `num1` و `num2`. ```js -const regex = __helpers.functionRegex('calculateSum', ['num1', 'num2']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { calculateSum } = explorer.allFunctions; +assert.lengthOf(calculateSum?.parameters, 2); +assert.equal(calculateSum?.parameters[0].toString(), "num1"); +assert.equal(calculateSum?.parameters[1].toString(), "num2"); ``` # --seed-- diff --git a/curriculum/challenges/arabic/blocks/workshop-calculator/66cc12fa504b0479dac479a0.md b/curriculum/challenges/arabic/blocks/workshop-calculator/66cc12fa504b0479dac479a0.md index e2aca985f9f..8928916915d 100644 --- a/curriculum/challenges/arabic/blocks/workshop-calculator/66cc12fa504b0479dac479a0.md +++ b/curriculum/challenges/arabic/blocks/workshop-calculator/66cc12fa504b0479dac479a0.md @@ -29,7 +29,9 @@ greetUser("Jane"); // "Hello Jane!" يجب أن يكون لديك `console.log` يستدعي الدالة `calculateSum` بالمعلمات `2` و `5`. ```js -assert.match(code, /console\.log\(calculateSum\(\s*2\s*,\s*5\)\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const validStatements = ["console.log(calculateSum(2,5))", "console.log(calculateSum(5,2))"]; +assert.isTrue(validStatements.some(stmt => strippedCode.includes(stmt))); ``` # --seed-- diff --git a/curriculum/challenges/arabic/blocks/workshop-calculator/66cc14ca14e65e7a9ebecb80.md b/curriculum/challenges/arabic/blocks/workshop-calculator/66cc14ca14e65e7a9ebecb80.md index 6844d23d263..9bac35588a5 100644 --- a/curriculum/challenges/arabic/blocks/workshop-calculator/66cc14ca14e65e7a9ebecb80.md +++ b/curriculum/challenges/arabic/blocks/workshop-calculator/66cc14ca14e65e7a9ebecb80.md @@ -15,7 +15,7 @@ dashedName: step-10 # --hints-- -يجب أن يكون لديك دالة باسم `calculateDifference`. +يجب إعلان دالة باسم `calculateDifference`. ```js assert.isFunction(calculateDifference); @@ -24,8 +24,11 @@ assert.isFunction(calculateDifference); يجب أن تحتوي دالة `calculateDifference` على معلمتين باسم `num1` و `num2`. ```js -const regex = __helpers.functionRegex('calculateDifference', ['num1', 'num2']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { calculateDifference } = explorer.allFunctions; +assert.lengthOf(calculateDifference?.parameters, 2); +assert.equal(calculateDifference?.parameters[0].toString(), "num1"); +assert.equal(calculateDifference?.parameters[1].toString(), "num2"); ``` يجب أن تُرجع دالة `calculateDifference` الفرق بين المعلمتين. diff --git a/curriculum/challenges/arabic/blocks/workshop-calculator/66cc16abc30b367ba1d1f9ef.md b/curriculum/challenges/arabic/blocks/workshop-calculator/66cc16abc30b367ba1d1f9ef.md index 54818ef42a6..92900dcb5cb 100644 --- a/curriculum/challenges/arabic/blocks/workshop-calculator/66cc16abc30b367ba1d1f9ef.md +++ b/curriculum/challenges/arabic/blocks/workshop-calculator/66cc16abc30b367ba1d1f9ef.md @@ -20,19 +20,25 @@ dashedName: step-11 يجب أن يكون لديك `console.log` يستدعي دالة `calculateDifference` بالمعلمتين `22` و `5`. ```js -assert.match(code, /console\.log\s*\(\s*calculateDifference\s*\(\s*22\s*,\s*5\s*\)\s*\)\s*;?/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateDifference(22,5))"; +assert.include(strippedCode, expectedStatement); ``` يجب أن يكون لديك `console.log` يستدعي دالة `calculateDifference` بالمعلمتين `12` و `1`. ```js -assert.match(code, /console\.log\s*\(\s*calculateDifference\s*\(\s*12\s*,\s*1\s*\)\s*\)\s*;?/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateDifference(12,1))"; +assert.include(strippedCode, expectedStatement); ``` يجب أن يكون لديك `console.log` يستدعي دالة `calculateDifference` بالمعلمتين `17` و `9`. ```js -assert.match(code, /console\.log\s*\(\s*calculateDifference\s*\(\s*17\s*,\s*9\s*\)\s*\)\s*;?/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateDifference(17,9))"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/arabic/blocks/workshop-calculator/66cc172af7159a7c67804544.md b/curriculum/challenges/arabic/blocks/workshop-calculator/66cc172af7159a7c67804544.md index 5d8ce68b6e4..a515804679a 100644 --- a/curriculum/challenges/arabic/blocks/workshop-calculator/66cc172af7159a7c67804544.md +++ b/curriculum/challenges/arabic/blocks/workshop-calculator/66cc172af7159a7c67804544.md @@ -17,7 +17,7 @@ dashedName: step-12 # --hints-- -يجب أن يكون لديك دالة باسم `calculateProduct`. +يجب إعلان دالة باسم `calculateProduct`. ```js assert.isFunction(calculateProduct); @@ -26,8 +26,11 @@ assert.isFunction(calculateProduct); يجب أن تحتوي دالة `calculateProduct` على معلمتين باسم `num1` و `num2`. ```js -const regex = __helpers.functionRegex('calculateProduct', ['num1', 'num2']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { calculateProduct } = explorer.allFunctions; +assert.lengthOf(calculateProduct?.parameters, 2); +assert.equal(calculateProduct?.parameters[0].toString(), "num1"); +assert.equal(calculateProduct?.parameters[1].toString(), "num2"); ``` يجب أن تُرجع دالة `calculateProduct` حاصل ضرب المعلمتين. @@ -40,7 +43,9 @@ assert.equal(calculateProduct(10, 5), 50); يجب أن يكون لديك `console.log` يستدعي الدالة `calculateProduct` بالمعاملين `13` و `5`. ```js -assert.match(code, /console\.log\s*\(\s*calculateProduct\s*\(\s*13\s*,\s*5\s*\)\s*\)\s*;?/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const validStatements = ["console.log(calculateProduct(13,5))", "console.log(calculateProduct(5,13))"]; +assert.isTrue(validStatements.some(stmt => strippedCode.includes(stmt))); ``` # --seed-- diff --git a/curriculum/challenges/arabic/blocks/workshop-calculator/66cc1a3a39aef47d6473cb2f.md b/curriculum/challenges/arabic/blocks/workshop-calculator/66cc1a3a39aef47d6473cb2f.md index e9075f0f2b1..aca1272fa8e 100644 --- a/curriculum/challenges/arabic/blocks/workshop-calculator/66cc1a3a39aef47d6473cb2f.md +++ b/curriculum/challenges/arabic/blocks/workshop-calculator/66cc1a3a39aef47d6473cb2f.md @@ -17,7 +17,7 @@ dashedName: step-13 # --hints-- -يجب أن يكون لديك دالة باسم `calculateQuotient`. +يجب إعلان دالة باسم `calculateQuotient`. ```js assert.isFunction(calculateQuotient); @@ -26,8 +26,11 @@ assert.isFunction(calculateQuotient); يجب أن تحتوي دالة `calculateQuotient` على معلمتين باسم `num1` و `num2`. ```js -const regex = __helpers.functionRegex('calculateQuotient', ['num1', 'num2']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { calculateQuotient } = explorer.allFunctions; +assert.lengthOf(calculateQuotient?.parameters, 2); +assert.equal(calculateQuotient?.parameters[0].toString(), "num1"); +assert.equal(calculateQuotient?.parameters[1].toString(), "num2"); ``` يجب أن تُرجع دالة `calculateQuotient` حاصل القسمة للمعلمتين. @@ -40,7 +43,9 @@ assert.equal(calculateQuotient(100, 10), 10); يجب أن يكون لديك `console.log` يستدعي الدالة `calculateQuotient` بالمعاملين `7` و `11`. ```js -assert.match(code, /console\.log\s*\(\s*calculateQuotient\s*\(\s*7\s*,\s*11\s*\)\s*\)\s*;?/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateQuotient(7,11))"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/arabic/blocks/workshop-calculator/66cc1ccfefdd727e18c2ab20.md b/curriculum/challenges/arabic/blocks/workshop-calculator/66cc1ccfefdd727e18c2ab20.md index 45f709387fd..523c02540a0 100644 --- a/curriculum/challenges/arabic/blocks/workshop-calculator/66cc1ccfefdd727e18c2ab20.md +++ b/curriculum/challenges/arabic/blocks/workshop-calculator/66cc1ccfefdd727e18c2ab20.md @@ -7,7 +7,7 @@ dashedName: step-14 # --description-- -تبدو دالة `calculateQuotient` تعمل بشكل صحيح لكن هناك حالة واحدة لم تختبرها بعد. +تبدو دالتك `calculateQuotient` تعمل بشكل صحيح، لكن هناك حالة واحدة لم تختبرها بعد. أضف `console.log` يستدعي الدالة `calculateQuotient` بالمعلمتين `3` و `0`. @@ -18,7 +18,9 @@ dashedName: step-14 يجب أن يكون لديك `console.log` يستدعي الدالة `calculateQuotient` بالمعلمتين `3` و `0`. ```js -assert.match(code, /console\.log\s*\(\s*calculateQuotient\s*\(\s*3\s*,\s*0\s*\)\s*\)\s*;?/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateQuotient(3,0))"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/arabic/blocks/workshop-calculator/66cc1deb1f04647f2aabee2b.md b/curriculum/challenges/arabic/blocks/workshop-calculator/66cc1deb1f04647f2aabee2b.md index 164859f5763..c5bc0e1b791 100644 --- a/curriculum/challenges/arabic/blocks/workshop-calculator/66cc1deb1f04647f2aabee2b.md +++ b/curriculum/challenges/arabic/blocks/workshop-calculator/66cc1deb1f04647f2aabee2b.md @@ -20,8 +20,8 @@ dashedName: step-15 يجب أن تُرجع دالة `calculateQuotient` السلسلة النصية `"Error: Division by zero"` إذا كان `num2` يساوي صفرًا. ```js -assert.strictEqual(calculateQuotient(10, 0), 'Error: Division by zero'); -assert.strictEqual(calculateQuotient(3, 0), 'Error: Division by zero'); +assert.strictEqual(calculateQuotient(10, 0), "Error: Division by zero"); +assert.strictEqual(calculateQuotient(3, 0), "Error: Division by zero"); ``` يجب أن تُرجع دالة `calculateQuotient` نتيجة قسمة `num1` على `num2` إذا لم يكن `num2` صفرًا. diff --git a/curriculum/challenges/arabic/blocks/workshop-calculator/66cc21d23238dc8240a8a182.md b/curriculum/challenges/arabic/blocks/workshop-calculator/66cc21d23238dc8240a8a182.md index 07659a8aea1..f6281d5e8da 100644 --- a/curriculum/challenges/arabic/blocks/workshop-calculator/66cc21d23238dc8240a8a182.md +++ b/curriculum/challenges/arabic/blocks/workshop-calculator/66cc21d23238dc8240a8a182.md @@ -13,7 +13,7 @@ dashedName: step-16 يمكنك أيضًا استخدام عامل الأس (`**`) لحساب مربع الرقم. -إليك مثالًا: +إليك مثال: ```js // base number is 5 @@ -28,7 +28,7 @@ Math.pow(5, 2); // 25 # --hints-- -يجب أن يكون لديك دالة باسم `calculateSquare`. +يجب إعلان دالة باسم `calculateSquare`. ```js assert.isFunction(calculateSquare); @@ -37,8 +37,10 @@ assert.isFunction(calculateSquare); يجب أن تأخذ دالة `calculateSquare` معلمة `num`. ```js -const regex = __helpers.functionRegex('calculateSquare', ['num']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { calculateSquare } = explorer.allFunctions; +assert.lengthOf(calculateSquare?.parameters, 1); +assert.equal(calculateSquare?.parameters[0].toString(), "num"); ``` يجب أن تُرجع دالة `calculateSquare` مربع `num`. diff --git a/curriculum/challenges/arabic/blocks/workshop-calculator/66cc26907ff6908402af0149.md b/curriculum/challenges/arabic/blocks/workshop-calculator/66cc26907ff6908402af0149.md index 863d8bb72b9..8e8a8332c43 100644 --- a/curriculum/challenges/arabic/blocks/workshop-calculator/66cc26907ff6908402af0149.md +++ b/curriculum/challenges/arabic/blocks/workshop-calculator/66cc26907ff6908402af0149.md @@ -18,13 +18,17 @@ dashedName: step-17 يجب أن يكون لديك `console.log` يستدعي دالة `calculateSquare` مع المعلمة `2`. ```js -assert.match(code, /console\.log\s*\(\s*calculateSquare\s*\(\s*2\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateSquare(2))"; +assert.include(strippedCode, expectedStatement); ``` يجب أن يكون لديك `console.log` يستدعي دالة `calculateSquare` مع المعلمة `9`. ```js -assert.match(code, /console\.log\s*\(\s*calculateSquare\s*\(\s*9\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateSquare(9))"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/arabic/blocks/workshop-calculator/66cc2739f687e484d50bb6f1.md b/curriculum/challenges/arabic/blocks/workshop-calculator/66cc2739f687e484d50bb6f1.md index a8eb6961470..19707d05532 100644 --- a/curriculum/challenges/arabic/blocks/workshop-calculator/66cc2739f687e484d50bb6f1.md +++ b/curriculum/challenges/arabic/blocks/workshop-calculator/66cc2739f687e484d50bb6f1.md @@ -15,7 +15,7 @@ dashedName: step-18 لحساب الجذر التربيعي لعدد في JavaScript، يمكنك استخدام الطريقة Math.sqrt(). -إليك مثالاً: +إليك مثال: ```js // result: 3 @@ -26,7 +26,7 @@ Math.sqrt(9); # --hints-- -يجب أن يكون لديك دالة باسم `calculateSquareRoot`. +يجب إعلان دالة باسم `calculateSquareRoot`. ```js assert.isFunction(calculateSquareRoot); @@ -35,8 +35,10 @@ assert.isFunction(calculateSquareRoot); يجب أن تأخذ دالة `calculateSquareRoot` معلمة `num`. ```js -const regex = __helpers.functionRegex('calculateSquareRoot', ['num']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { calculateSquareRoot } = explorer.allFunctions; +assert.lengthOf(calculateSquareRoot?.parameters, 1); +assert.equal(calculateSquareRoot?.parameters[0].toString(), "num"); ``` يجب أن تُرجع دالة `calculateSquareRoot` الجذر التربيعي لـ `num`. diff --git a/curriculum/challenges/arabic/blocks/workshop-calculator/66cc281d687975858049fd8d.md b/curriculum/challenges/arabic/blocks/workshop-calculator/66cc281d687975858049fd8d.md index b503f113165..6680f46ff14 100644 --- a/curriculum/challenges/arabic/blocks/workshop-calculator/66cc281d687975858049fd8d.md +++ b/curriculum/challenges/arabic/blocks/workshop-calculator/66cc281d687975858049fd8d.md @@ -20,13 +20,17 @@ dashedName: step-19 يجب أن يكون لديك `console.log` يستدعي الدالة `calculateSquareRoot` مع المعلمة `25`. ```js -assert.match(code, /console\.log\s*\(\s*calculateSquareRoot\s*\(\s*25\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateSquareRoot(25))"; +assert.include(strippedCode, expectedStatement); ``` يجب أن يكون لديك `console.log` يستدعي الدالة `calculateSquareRoot` مع المعلمة `100`. ```js -assert.match(code, /console\.log\s*\(\s*calculateSquareRoot\s*\(\s*100\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateSquareRoot(100))"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/arabic/blocks/workshop-calculator/66cdf76685e4cb5a8726e27b.md b/curriculum/challenges/arabic/blocks/workshop-calculator/66cdf76685e4cb5a8726e27b.md index 1027d028877..1b1eaf657f7 100644 --- a/curriculum/challenges/arabic/blocks/workshop-calculator/66cdf76685e4cb5a8726e27b.md +++ b/curriculum/challenges/arabic/blocks/workshop-calculator/66cdf76685e4cb5a8726e27b.md @@ -18,13 +18,17 @@ dashedName: step-9 يجب أن يكون لديك `console.log` يستدعي الدالة `calculateSum` بالمعلمات `10` و `10`. ```js -assert.match(code, /console\.log\(calculateSum\(10\s*,\s*10\)\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateSum(10,10))"; +assert.include(strippedCode, expectedStatement); ``` يجب أن يكون لديك `console.log` يستدعي الدالة `calculateSum` بالمعلمات `5` و `5`. ```js -assert.match(code, /console\.log\(calculateSum\(5\s*,\s*5\)\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateSum(5,5))"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646c48df8674cf2b91020ecc.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646c48df8674cf2b91020ecc.md index d289111d233..22a2d7b6b5f 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646c48df8674cf2b91020ecc.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646c48df8674cf2b91020ecc.md @@ -1,6 +1,6 @@ --- id: 646c48df8674cf2b91020ecc -title: خطوة 1 +title: الخطوة 1 challengeType: 0 dashedName: step-1 demoType: onLoad @@ -35,12 +35,13 @@ assert.oneOf(href, ["./styles.css", "styles.css"]); ```html ---fcc-editable-region-- - - fCC Cat Painting - + + fCC Cat Painting --fcc-editable-region-- + +--fcc-editable-region-- + ``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646c586be7180e40ddf74ff6.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646c586be7180e40ddf74ff6.md index ef4bd865904..959b828fca2 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646c586be7180e40ddf74ff6.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646c586be7180e40ddf74ff6.md @@ -31,9 +31,9 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('body')?.backgroundColor, - - fCC Cat Painting - + + fCC Cat Painting + diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646c59e942f35541923104bf.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646c59e942f35541923104bf.md index 2b232083ad4..50f776c01a1 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646c59e942f35541923104bf.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646c59e942f35541923104bf.md @@ -43,13 +43,13 @@ assert.lengthOf(document.querySelectorAll('main div'), 1); - - fCC Cat Painting - + + fCC Cat Painting + --fcc-editable-region-- - + --fcc-editable-region-- diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646c5ace05e4be4211407935.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646c5ace05e4be4211407935.md index bb39c942fbf..81074fcbf6b 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646c5ace05e4be4211407935.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646c5ace05e4be4211407935.md @@ -50,14 +50,14 @@ assert.equal(secondGradient,'(69,69,79)100%)'); - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
+
+
+
``` @@ -71,13 +71,13 @@ body { background-color: #c9d2fc; } ---fcc-editable-region-- .cat-head { +--fcc-editable-region-- + +--fcc-editable-region-- width: 205px; height: 180px; border: 1px solid #000; border-radius: 46%; - } ---fcc-editable-region-- ``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646c5d7057c45f432fcdd46c.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646c5d7057c45f432fcdd46c.md index 76dd93777c9..a525bb25392 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646c5d7057c45f432fcdd46c.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646c5d7057c45f432fcdd46c.md @@ -50,13 +50,13 @@ assert.equal(new __helpers.CSSHelp(document)?.getStyle(".cat-head")?.borderRadiu - - fCC Cat Painting - + + fCC Cat Painting +
-
+
diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646c5e727e56e743c9aed4a1.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646c5e727e56e743c9aed4a1.md index 025235a4589..03775554cad 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646c5e727e56e743c9aed4a1.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646c5e727e56e743c9aed4a1.md @@ -24,13 +24,13 @@ dashedName: step-7 assert.equal(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.position, 'static') ``` -يجب أن يحتوي محدِّد `.cat-head` على خاصية `top` معينة إلى `100px`. تأكد من إضافة فاصلة منقوطة. +يجب أن يحتوي محدِّد `.cat-head` على خاصية `top` مضبوطة على `100px`. تأكد من إضافة فاصلة منقوطة. ```js assert.equal(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.top, '100px') ``` -يجب أن يحتوي محدِّد `.cat-head` على خاصية `left` معينة إلى `100px`. تأكد من إضافة فاصلة منقوطة. +يجب أن يحتوي محدِّد `.cat-head` على خاصية `left` مضبوطة على `100px`. تأكد من إضافة فاصلة منقوطة. ```js assert.equal(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.left, '100px') @@ -44,14 +44,14 @@ assert.equal(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.left, '100p - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
+
+
+
``` @@ -65,16 +65,14 @@ body { background-color: #c9d2fc; } ---fcc-editable-region-- .cat-head { - - +--fcc-editable-region-- +--fcc-editable-region-- background: linear-gradient(#5e5e5e 85%, #45454f 100%); width: 205px; height: 180px; border: 1px solid #000; border-radius: 46%; } ---fcc-editable-region-- ``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646c5ffef5598d449b52ec12.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646c5ffef5598d449b52ec12.md index e61d373b78e..eccfa38a8a7 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646c5ffef5598d449b52ec12.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646c5ffef5598d449b52ec12.md @@ -1,6 +1,6 @@ --- id: 646c5ffef5598d449b52ec12 -title: خطوة 17 +title: الخطوة 17 challengeType: 0 dashedName: step-17 --- @@ -39,18 +39,18 @@ assert.equal(document.querySelectorAll('.cat-head div')[0]?.getAttribute('class' - - fCC Cat Painting - + + fCC Cat Painting + -
+
+
--fcc-editable-region-- -
- -
+ --fcc-editable-region-- -
+ +
``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646ce8bb4b35544d501c7184.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646ce8bb4b35544d501c7184.md index 12a976db9b8..7749f02eaf0 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646ce8bb4b35544d501c7184.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646ce8bb4b35544d501c7184.md @@ -1,6 +1,6 @@ --- id: 646ce8bb4b35544d501c7184 -title: خطوة 18 +title: الخطوة 18 challengeType: 0 dashedName: step-18 --- @@ -43,20 +43,20 @@ assert.isTrue(document.querySelectorAll('.cat-ears div')[1]?.classList.contains( - - fCC Cat Painting - + + fCC Cat Painting + -
-
+
+
+
--fcc-editable-region-- -
- -
+ --fcc-editable-region--
-
+
+
``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646ce9d790d2a44de5f99e04.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646ce9d790d2a44de5f99e04.md index 706d57847ef..5782d34a57f 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646ce9d790d2a44de5f99e04.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646ce9d790d2a44de5f99e04.md @@ -55,25 +55,25 @@ assert.isTrue(document.querySelectorAll('.cat-right-ear div')[0]?.classList.cont - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
- --fcc-editable-region-- -
- -
-
- -
- --fcc-editable-region-- +
+
+
+
+--fcc-editable-region-- + +
+
+ +--fcc-editable-region--
-
+
+
``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646ceb843412c74edee27a79.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646ceb843412c74edee27a79.md index 14438218436..1e62372035d 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646ceb843412c74edee27a79.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646ceb843412c74edee27a79.md @@ -11,7 +11,7 @@ dashedName: step-20 # --hints-- -يجب أن يكون لديك محدِّد `.cat-right-ear`. +يجب أن يكون لديك محدد `.cat-right-ear`. ```js assert.exists(new __helpers.CSSHelp(document)?.getStyle('.cat-right-ear')) @@ -53,7 +53,7 @@ assert.strictEqual(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.b assert.strictEqual(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.borderTop, '35px solid red') ``` -يجب أن يحتوي محدِّد `.cat-right-ear` على خاصية `border-bottom` بقيمة `35px solid red`. لا تنسَ إضافة فاصلة منقوطة. +يجب أن يحتوي محدد `.cat-right-ear` على خاصية `border-bottom` مضبوطة على `35px solid red`. لا تنسَ إضافة فاصلة منقوطة. ```js assert.strictEqual(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.borderBottom, '35px solid red') @@ -67,23 +67,23 @@ assert.strictEqual(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.b - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646cecc9eb5c4f4f73dafd07.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646cecc9eb5c4f4f73dafd07.md index b96051c1d57..5940d41c737 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646cecc9eb5c4f4f73dafd07.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646cecc9eb5c4f4f73dafd07.md @@ -37,23 +37,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-ear')?.left, '- - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` @@ -81,12 +81,12 @@ body { border-radius: 46%; } ---fcc-editable-region-- .cat-left-ear { +--fcc-editable-region-- +--fcc-editable-region-- border-left: 35px solid transparent; border-right: 35px solid transparent; border-bottom: 70px solid #5e5e5e; } ---fcc-editable-region-- ``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646cef0c2b98915094df7099.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646cef0c2b98915094df7099.md index 51ec6096c77..2a3457a64f0 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646cef0c2b98915094df7099.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646cef0c2b98915094df7099.md @@ -31,23 +31,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-ear')?.borderTo - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646cf1206cac5f51804f49cf.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646cf1206cac5f51804f49cf.md index a0149931930..abc16d75ace 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646cf1206cac5f51804f49cf.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646cf1206cac5f51804f49cf.md @@ -29,23 +29,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-ear')?.transfor - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646cf2249f02ca5233d9af7c.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646cf2249f02ca5233d9af7c.md index dc826612b34..4457cea2182 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646cf2249f02ca5233d9af7c.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646cf2249f02ca5233d9af7c.md @@ -1,6 +1,6 @@ --- id: 646cf2249f02ca5233d9af7c -title: الخطوة 26 +title: خطوة 26 challengeType: 0 dashedName: step-26 --- @@ -45,23 +45,23 @@ assert.strictEqual(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.b - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646cf48d8f8e1f535a1821d3.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646cf48d8f8e1f535a1821d3.md index f8b5f3c74c2..c3dc18eeac0 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646cf48d8f8e1f535a1821d3.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646cf48d8f8e1f535a1821d3.md @@ -37,23 +37,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.left, ' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646cf6cbca98e258da65c979.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646cf6cbca98e258da65c979.md index 523080f07d9..502e6fc88bb 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646cf6cbca98e258da65c979.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646cf6cbca98e258da65c979.md @@ -25,23 +25,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.transfo - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646cf88aa884405a11ea5bcc.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646cf88aa884405a11ea5bcc.md index 64e9dd1dfc9..7d6105b124c 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646cf88aa884405a11ea5bcc.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646cf88aa884405a11ea5bcc.md @@ -1,6 +1,6 @@ --- id: 646cf88aa884405a11ea5bcc -title: الخطوة 29 +title: خطوة 29 challengeType: 0 dashedName: step-29 --- @@ -31,23 +31,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.borderT - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646cfc2b8e6fe95c20a819d5.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646cfc2b8e6fe95c20a819d5.md index 301893cef71..7c6ffce2cfb 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646cfc2b8e6fe95c20a819d5.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646cfc2b8e6fe95c20a819d5.md @@ -29,23 +29,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-ear')?.zIndex, - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646cfd853634255d02b64cc1.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646cfd853634255d02b64cc1.md index 5ce459f94ed..200a15e5012 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646cfd853634255d02b64cc1.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646cfd853634255d02b64cc1.md @@ -27,23 +27,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-ear')?.zIndex, - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646cfde6ac612e5d60391f50.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646cfde6ac612e5d60391f50.md index ca7ebeab385..a9aee6749ec 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646cfde6ac612e5d60391f50.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646cfde6ac612e5d60391f50.md @@ -25,23 +25,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.zIndex, - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646dd556d524bc61c0139bd6.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646dd556d524bc61c0139bd6.md index 3167cbdcbfd..d91a5598328 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646dd556d524bc61c0139bd6.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646dd556d524bc61c0139bd6.md @@ -45,23 +45,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-inner-ear')?.bo - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646dd6f9caa862627dd87772.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646dd6f9caa862627dd87772.md index 49bb7bd8b25..97ff6686e9b 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646dd6f9caa862627dd87772.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646dd6f9caa862627dd87772.md @@ -37,23 +37,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-inner-ear')?.le - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646dd7cfd0cfac630c1dd520.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646dd7cfd0cfac630c1dd520.md index 2b361330270..f4a48a39a15 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646dd7cfd0cfac630c1dd520.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646dd7cfd0cfac630c1dd520.md @@ -43,23 +43,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-inner-ear')?.bo - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646dd8c79ec23463a3d0e356.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646dd8c79ec23463a3d0e356.md index d7eebe56a0a..647ef89b635 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646dd8c79ec23463a3d0e356.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646dd8c79ec23463a3d0e356.md @@ -43,23 +43,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-inner-ear')?.b - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646dd9d9a729916460724f16.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646dd9d9a729916460724f16.md index e08dc230803..c42a1c0c9b4 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646dd9d9a729916460724f16.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646dd9d9a729916460724f16.md @@ -37,23 +37,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-inner-ear')?.l - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646ddab8afd73764f5241bbf.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646ddab8afd73764f5241bbf.md index de30dd31c5b..b8ef7207a5e 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646ddab8afd73764f5241bbf.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646ddab8afd73764f5241bbf.md @@ -43,23 +43,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-inner-ear')?.b - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646ddb61ff08366570cc5902.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646ddb61ff08366570cc5902.md index 2fca5b32ede..d2ff984a5f1 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646ddb61ff08366570cc5902.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646ddb61ff08366570cc5902.md @@ -45,27 +45,27 @@ assert.isTrue(document.querySelectorAll('.cat-eyes div')[1].classList.contains(' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- - --fcc-editable-region-- - - --fcc-editable-region--
-
+ + --fcc-editable-region-- + + --fcc-editable-region-- +
+
``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646ddd3f9f97a0667b964bdb.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646ddd3f9f97a0667b964bdb.md index 50d369ec213..049ffda2d1a 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646ddd3f9f97a0667b964bdb.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646ddd3f9f97a0667b964bdb.md @@ -1,6 +1,6 @@ --- id: 646ddd3f9f97a0667b964bdb -title: خطوة 40 +title: الخطوة 40 challengeType: 0 dashedName: step-40 --- @@ -55,34 +55,34 @@ assert.isTrue(document.querySelectorAll('.cat-right-eye div')[0]?.classList.cont - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
- --fcc-editable-region-- -
- -
-
- -
- --fcc-editable-region-- -
-
+ +
+
+--fcc-editable-region-- + +
+
+ +--fcc-editable-region-- +
+
+
+
``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646dde7dc20dc167489faa69.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646dde7dc20dc167489faa69.md index 158fc279c14..37c5afa8768 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646dde7dc20dc167489faa69.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646dde7dc20dc167489faa69.md @@ -1,6 +1,6 @@ --- id: 646dde7dc20dc167489faa69 -title: خطوة 41 +title: الخطوة 41 challengeType: 0 dashedName: step-41 --- @@ -43,32 +43,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-eye')?.backgrou - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646ddf888632fa67f1180940.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646ddf888632fa67f1180940.md index 758e7116ae7..28d8f36f46c 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646ddf888632fa67f1180940.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646ddf888632fa67f1180940.md @@ -37,32 +37,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-eye')?.left, '3 - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646de5dc8988076a1d992afd.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646de5dc8988076a1d992afd.md index 899942739ed..9bd89085166 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646de5dc8988076a1d992afd.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646de5dc8988076a1d992afd.md @@ -31,32 +31,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-eye')?.transfor - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646de6a97b50a86ac487de86.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646de6a97b50a86ac487de86.md index b8f3732d6e5..099c4b59593 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646de6a97b50a86ac487de86.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646de6a97b50a86ac487de86.md @@ -45,32 +45,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-eye')?.backgro - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646de7b64467e96b7d35b5cd.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646de7b64467e96b7d35b5cd.md index 3e6bdee8b3d..b530b70fd9e 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646de7b64467e96b7d35b5cd.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646de7b64467e96b7d35b5cd.md @@ -37,32 +37,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-eye')?.left, ' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646de8478d6f796bfbdccfb2.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646de8478d6f796bfbdccfb2.md index 0f1e48f3a12..6b399704473 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646de8478d6f796bfbdccfb2.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646de8478d6f796bfbdccfb2.md @@ -31,32 +31,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-eye')?.transfo - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646de8d204a3426c7d184372.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646de8d204a3426c7d184372.md index cb2a634192d..919e538bde6 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646de8d204a3426c7d184372.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646de8d204a3426c7d184372.md @@ -1,6 +1,6 @@ --- id: 646de8d204a3426c7d184372 -title: الخطوة 47 +title: خطوة 47 challengeType: 0 dashedName: step-47 --- @@ -45,32 +45,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-inner-eye')?.ba - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646dea1c98c2426d43a705c3.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646dea1c98c2426d43a705c3.md index 55791d02013..8657461cf96 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646dea1c98c2426d43a705c3.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646dea1c98c2426d43a705c3.md @@ -1,6 +1,6 @@ --- id: 646dea1c98c2426d43a705c3 -title: الخطوة 48 +title: خطوة 48 challengeType: 0 dashedName: step-48 --- @@ -49,32 +49,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-inner-eye')?.tr - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646deb169847f86df0f95bfc.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646deb169847f86df0f95bfc.md index 9ca508524bc..277c2621d54 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646deb169847f86df0f95bfc.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646deb169847f86df0f95bfc.md @@ -1,6 +1,6 @@ --- id: 646deb169847f86df0f95bfc -title: خطوة 49 +title: الخطوة 49 challengeType: 0 dashedName: step-49 --- @@ -43,32 +43,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-inner-eye')?.b - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646dec359bef3b7811fba5a6.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646dec359bef3b7811fba5a6.md index c4fe6b7bb13..48d4bb521ef 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646dec359bef3b7811fba5a6.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646dec359bef3b7811fba5a6.md @@ -49,32 +49,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-inner-eye')?.t - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646dedbcba062079128b2ecc.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646dedbcba062079128b2ecc.md index 601902e5dd7..7c94106452d 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646dedbcba062079128b2ecc.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646dedbcba062079128b2ecc.md @@ -1,6 +1,6 @@ --- id: 646dedbcba062079128b2ecc -title: خطوة 51 +title: الخطوة 51 challengeType: 0 dashedName: step-51 --- @@ -31,36 +31,36 @@ assert.isTrue(document.querySelectorAll('div')[11].classList.contains('cat-nose' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
- - --fcc-editable-region-- - - --fcc-editable-region--
-
+ + --fcc-editable-region-- + + --fcc-editable-region-- +
+
``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646def5e863abf7a14501421.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646def5e863abf7a14501421.md index be31b05e6a3..0f02ff83582 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646def5e863abf7a14501421.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646def5e863abf7a14501421.md @@ -43,34 +43,34 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-nose')?.borderBottom - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
- -
-
+ +
+
+
``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646df03c8f79337ab46f148b.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646df03c8f79337ab46f148b.md index 13668521b93..da664bceb97 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646df03c8f79337ab46f148b.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646df03c8f79337ab46f148b.md @@ -37,34 +37,34 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-nose')?.left, '85px' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
- -
-
+ +
+
+
``` @@ -196,5 +196,4 @@ body { border-right: 15px solid transparent; border-bottom: 20px solid #442c2c; } - ``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646df0cf26413a7b35e4b8b3.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646df0cf26413a7b35e4b8b3.md index 99348acf6fe..4289008fe4a 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646df0cf26413a7b35e4b8b3.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646df0cf26413a7b35e4b8b3.md @@ -49,34 +49,34 @@ assert.notMatch(code, /border-top-right-radius:\s*\d+%;/); - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
- -
-
+ +
+
+
``` @@ -211,5 +211,4 @@ body { border-right: 15px solid transparent; border-bottom: 20px solid #442c2c; } - ``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646df1d1aa4ae57bdf1869c4.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646df1d1aa4ae57bdf1869c4.md index 1445ef991b6..f920b63af16 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646df1d1aa4ae57bdf1869c4.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646df1d1aa4ae57bdf1869c4.md @@ -1,6 +1,6 @@ --- id: 646df1d1aa4ae57bdf1869c4 -title: خطوة 55 +title: الخطوة 55 challengeType: 0 dashedName: step-55 --- @@ -33,38 +33,38 @@ assert.isTrue(document.querySelectorAll('div')[12].classList.contains('cat-mouth - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
- --fcc-editable-region-- - - --fcc-editable-region-- +
+
+
+
+
+
+
-
+ +
+ + --fcc-editable-region-- + + --fcc-editable-region-- +
+
``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646dffd8ce9ac77ec1906f2e.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646dffd8ce9ac77ec1906f2e.md index d2aff9edc4f..ec9e9034587 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646dffd8ce9ac77ec1906f2e.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646dffd8ce9ac77ec1906f2e.md @@ -1,6 +1,6 @@ --- id: 646dffd8ce9ac77ec1906f2e -title: خطوة 56 +title: الخطوة 56 challengeType: 0 dashedName: step-56 --- @@ -43,41 +43,40 @@ assert.isTrue(document.querySelectorAll('.cat-mouth div')[1]?.classList.contains - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
- --fcc-editable-region-- -
- +
+
+
+
+
+
- --fcc-editable-region-- +
+ +
+
+--fcc-editable-region-- + +--fcc-editable-region--
-
+
+
``` @@ -213,5 +212,4 @@ body { border-right: 15px solid transparent; border-bottom: 20px solid #442c2c; } - ``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f0417322c0e04983a5149.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f0417322c0e04983a5149.md index a3ba9f2a23a..e02f023aa6a 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f0417322c0e04983a5149.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f0417322c0e04983a5149.md @@ -43,40 +43,39 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-mouth-line-left')?.l - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
+
+
+
+
+ +
+
+
+
-
+
+
``` @@ -222,6 +221,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f08293804a30685533c6f.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f08293804a30685533c6f.md index ed5801bdc1b..29ab8b90b0e 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f08293804a30685533c6f.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f08293804a30685533c6f.md @@ -25,40 +25,39 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-mouth-line-left')?.t - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
+
+
+
+
+ +
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f09293eb3230723a62f77.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f09293eb3230723a62f77.md index dc26c8c72c9..9d06f14584d 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f09293eb3230723a62f77.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f09293eb3230723a62f77.md @@ -43,40 +43,39 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-mouth-line-right')?. - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
+
+
+
+
+ +
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f0c9a1e3360092d1bbd33.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f0c9a1e3360092d1bbd33.md index 884703a60c5..385e3fc3d92 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f0c9a1e3360092d1bbd33.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f0c9a1e3360092d1bbd33.md @@ -25,40 +25,39 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-mouth-line-right')?. - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
+
+
+
+
+ +
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f0ce5737243098ad6e494.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f0ce5737243098ad6e494.md index e430335ab38..93cd61c1580 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f0ce5737243098ad6e494.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f0ce5737243098ad6e494.md @@ -1,6 +1,6 @@ --- id: 646f0ce5737243098ad6e494 -title: خطوة 63 +title: الخطوة 63 challengeType: 0 dashedName: step-63 --- @@ -33,44 +33,43 @@ assert.isTrue(document.querySelectorAll('div')[15].classList.contains('cat-whisk - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
+
+
+
+
+ +
- --fcc-editable-region-- - - --fcc-editable-region-- - +
+
+
-
+ + --fcc-editable-region-- + + --fcc-editable-region-- +
+
``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f0ef13604420a8744f7d4.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f0ef13604420a8744f7d4.md index 8028cd103a7..c5eef67ae0b 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f0ef13604420a8744f7d4.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f0ef13604420a8744f7d4.md @@ -1,6 +1,6 @@ --- id: 646f0ef13604420a8744f7d4 -title: خطوة 64 +title: الخطوة 64 challengeType: 0 dashedName: step-64 --- @@ -43,46 +43,45 @@ assert.isTrue(document.querySelectorAll('.cat-whiskers div')[1].classList.contai - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- - --fcc-editable-region-- -
- +
+
- --fcc-editable-region-- +
+ +
+ +
+
+
+
+
+--fcc-editable-region-- + +--fcc-editable-region--
-
+
+
``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f0f7c5933560af8e7e380.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f0f7c5933560af8e7e380.md index ac5375b094f..f098cceee61 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f0f7c5933560af8e7e380.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f0f7c5933560af8e7e380.md @@ -50,49 +50,48 @@ assert.isTrue(document.querySelectorAll('.cat-whiskers-left div')[2].classList.c - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
- --fcc-editable-region-- -
- -
- --fcc-editable-region-- -
+
+
+
+ +
+
+
+
+
+ +
+
+--fcc-editable-region-- + +--fcc-editable-region-- +
+
-
+
+
``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f102bf87b350b593baa72.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f102bf87b350b593baa72.md index e2c32b88687..108f39d8dc1 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f102bf87b350b593baa72.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f102bf87b350b593baa72.md @@ -49,53 +49,52 @@ assert.isTrue(document.querySelectorAll('.cat-whiskers-right div')[2].classList. - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
- --fcc-editable-region-- -
- -
- --fcc-editable-region-- +
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+--fcc-editable-region-- + +--fcc-editable-region-- +
-
+
+
``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f107abb89d00bb99f387a.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f107abb89d00bb99f387a.md index 5bfbbe23b92..f93e6b01a62 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f107abb89d00bb99f387a.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f107abb89d00bb99f387a.md @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whiskers-left div')? - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f12da0b4c5d0ca162834a.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f12da0b4c5d0ca162834a.md index d82deb0b1eb..72415d1b4cb 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f12da0b4c5d0ca162834a.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f12da0b4c5d0ca162834a.md @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-left-top')?. - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -261,6 +260,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f135eab69d90d0c6d4e9b.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f135eab69d90d0c6d4e9b.md index 96cdadda55a..93fe29dc4c4 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f135eab69d90d0c6d4e9b.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f135eab69d90d0c6d4e9b.md @@ -25,53 +25,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-left-top')?. - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -250,5 +249,4 @@ body { --fcc-editable-region-- } - ``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f159b2cffb21150b927cb.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f159b2cffb21150b927cb.md index 24064ca7cd2..388ada1408d 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f159b2cffb21150b927cb.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f159b2cffb21150b927cb.md @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-left-middle' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -268,6 +267,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f164bf100dd11d226161f.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f164bf100dd11d226161f.md index f876a24f7a0..502c8f44301 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f164bf100dd11d226161f.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f164bf100dd11d226161f.md @@ -25,53 +25,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-left-middle' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -254,7 +253,7 @@ body { top: 127px; left: 52px; --fcc-editable-region-- - + --fcc-editable-region-- } ``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f1764e2f1d212ba9785a7.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f1764e2f1d212ba9785a7.md index b41d1e153f8..e00e9baaae4 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f1764e2f1d212ba9785a7.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f1764e2f1d212ba9785a7.md @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-left-bottom' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -275,6 +274,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f1802a09a171332e14630.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f1802a09a171332e14630.md index f76507be0fe..d279b54fb4b 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f1802a09a171332e14630.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f1802a09a171332e14630.md @@ -25,53 +25,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-left-bottom' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f4d6c42dc5f214f4e7444.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f4d6c42dc5f214f4e7444.md index 95c3dd6f461..7afc745a517 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f4d6c42dc5f214f4e7444.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f4d6c42dc5f214f4e7444.md @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-right-top')? - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -282,6 +281,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f4e46e81f7021d5fd9c1d.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f4e46e81f7021d5fd9c1d.md index 6423884ffcb..6849760df2f 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f4e46e81f7021d5fd9c1d.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f4e46e81f7021d5fd9c1d.md @@ -25,53 +25,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-right-top')? - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f4f6a14e3c522d130a0d2.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f4f6a14e3c522d130a0d2.md index 688d96fd482..8e2d0bb83d6 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f4f6a14e3c522d130a0d2.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f4f6a14e3c522d130a0d2.md @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-right-middle - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -289,6 +288,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f4fe12b7985232bf475a5.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f4fe12b7985232bf475a5.md index 9ac21ac5dd2..80030af0921 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f4fe12b7985232bf475a5.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f4fe12b7985232bf475a5.md @@ -25,53 +25,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-right-middle - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f507e4d1cd323f17db4fc.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f507e4d1cd323f17db4fc.md index f572f05e16e..ce353582fca 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f507e4d1cd323f17db4fc.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f507e4d1cd323f17db4fc.md @@ -44,53 +44,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-right-bottom - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -297,6 +296,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f516dbfc1342495515625.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f516dbfc1342495515625.md index 2dd7c906a59..29b3acf2244 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f516dbfc1342495515625.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/646f516dbfc1342495515625.md @@ -27,53 +27,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-right-bottom - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -295,53 +294,53 @@ body { - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+ +
+
``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/6476f5c17f99146071ee884c.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/6476f5c17f99146071ee884c.md index 064ead3af6b..d254b1cc5d1 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/6476f5c17f99146071ee884c.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/6476f5c17f99146071ee884c.md @@ -21,13 +21,13 @@ dashedName: step-8 assert.equal(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.position, 'relative'); ``` -يجب أن يحتوي محدد `.cat-head` على خاصية `top` مضبوطة على `100px`. تأكد من إضافة فاصلة منقوطة. +يجب أن يحتوي محدِّد `.cat-head` على خاصية `top` مضبوطة على `100px`. تأكد من إضافة فاصلة منقوطة. ```js assert.equal(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.top, '100px'); ``` -يجب أن يحتوي محدد `.cat-head` على خاصية `left` مضبوطة على `100px`. تأكد من إضافة فاصلة منقوطة. +يجب أن يحتوي محدِّد `.cat-head` على خاصية `left` مضبوطة على `100px`. تأكد من إضافة فاصلة منقوطة. ```js assert.equal(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.left, '100px'); @@ -41,14 +41,14 @@ assert.equal(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.left, '100p - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
+
+
+
``` @@ -65,9 +65,9 @@ body { .cat-head { --fcc-editable-region-- position: static; +--fcc-editable-region-- top: 100px; left: 100px; ---fcc-editable-region-- background: linear-gradient(#5e5e5e 85%, #45454f 100%); width: 205px; height: 180px; diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/6476f7a4827bcc61682f2347.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/6476f7a4827bcc61682f2347.md index 25dd968f025..bc610884e6e 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/6476f7a4827bcc61682f2347.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/6476f7a4827bcc61682f2347.md @@ -9,13 +9,11 @@ dashedName: step-9 عندما تستخدم القيمة `absolute` لخاصية `position`، يُخرج العنصر من التدفق الطبيعي للوثيقة، ثم يُحدد موقعه بواسطة الخصائص `top` و`right` و`bottom` و`left`. -عيّن خاصية `position` للعنصر `.cat-head` إلى `absolute`، ثم عيّن الخصائص `top` و`left` إلى أي قيمة بكسل موجبة. - - +عيّن خاصية `position` لعنصر `.cat-head` إلى القيمة `absolute`. # --hints-- -يجب أن يحتوي محدِّد `.cat-head` على خاصية `position` مضبوطة على `absolute`. تأكد من إضافة فاصلة منقوطة. +يجب أن يحتوي محدِّد `.cat-head` على خاصية `position` بقيمة `absolute`. تأكد من إضافة فاصلة منقوطة. ```js assert.equal(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.position, 'absolute'); @@ -43,14 +41,14 @@ assert.match(code, /left:\s*\d{1,4}px;/); - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
+
+
+
``` @@ -67,9 +65,9 @@ body { .cat-head { --fcc-editable-region-- position: relative; +--fcc-editable-region-- top: 100px; left: 100px; ---fcc-editable-region-- background: linear-gradient(#5e5e5e 85%, #45454f 100%); width: 205px; height: 180px; diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/6476fb7cbaafa36d65e9cf35.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/6476fb7cbaafa36d65e9cf35.md index ca9cfd60dfa..7b7b6691bf1 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/6476fb7cbaafa36d65e9cf35.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/6476fb7cbaafa36d65e9cf35.md @@ -33,17 +33,17 @@ assert.equal(document.querySelectorAll('div')[1]?.getAttribute('class'), 'box'); - - fCC Cat Painting - + + fCC Cat Painting + -
-
- --fcc-editable-region-- - - --fcc-editable-region-- -
+
+
+ --fcc-editable-region-- + + --fcc-editable-region-- +
``` @@ -59,8 +59,8 @@ body { .cat-head { position: absolute; - top: 300px; - left: 400px; + top: 100px; + left: 100px; background: linear-gradient(#5e5e5e 85%, #45454f 100%); width: 205px; height: 180px; diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/6476fc5cf14b276e6d04e82a.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/6476fc5cf14b276e6d04e82a.md index 1c88c16ba29..4ad00b30e45 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/6476fc5cf14b276e6d04e82a.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/6476fc5cf14b276e6d04e82a.md @@ -61,15 +61,15 @@ assert.equal(new __helpers.CSSHelp(document)?.getStyle('.box')?.top, '800px'); - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
+
+
+
+
``` @@ -84,7 +84,7 @@ body { } .cat-head { - position: relative; + position: absolute; top: 100px; left: 100px; background: linear-gradient(#5e5e5e 85%, #45454f 100%); diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/6476fd4213318f6ee211028a.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/6476fd4213318f6ee211028a.md index 95d4d921491..13b44aef078 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/6476fd4213318f6ee211028a.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/6476fd4213318f6ee211028a.md @@ -7,7 +7,7 @@ dashedName: step-12 # --description-- -استبدل الآن قيمة خاصية `position` في محدِّد `.cat-head` بـ `fixed`. اترك كل من `top` و `left` كما هما. +استبدل الآن قيمة الخاصية `position` في `.cat-head` بـ `fixed`. بعد ذلك، قم بالتمرير لأعلى ولأسفل لترى كيف تعمل القيمة `fixed`. @@ -39,15 +39,15 @@ assert.equal(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.left, '100p - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
+
+
+
+
``` @@ -63,10 +63,10 @@ body { .cat-head { --fcc-editable-region-- - position: relative; + position: absolute; +--fcc-editable-region-- top: 100px; left: 100px; ---fcc-editable-region-- background: linear-gradient(#5e5e5e 85%, #45454f 100%); width: 205px; height: 180px; diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/64770351e8586671ec0911f0.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/64770351e8586671ec0911f0.md index becbfaf9449..433aba8c247 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/64770351e8586671ec0911f0.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/64770351e8586671ec0911f0.md @@ -21,7 +21,7 @@ dashedName: step-13 assert.equal(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.position, 'sticky'); ``` -يجب أن يحتوي محدد `.cat-head` على خاصية `top` مضبوطة على `0`. تأكد من إضافة فاصلة منقوطة. +يجب أن يحتوي محدِّد `.cat-head` على خاصية `top` بقيمة `0`. تأكد من إضافة فاصلة منقوطة. ```js assert.equal(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.top, '0px'); @@ -41,15 +41,15 @@ assert.notMatch(code, /left:\s*100px;?/); - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
+
+
+
+
``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/6477062778c85972eb648030.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/6477062778c85972eb648030.md index e8570e604a9..ce04a93a39d 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/6477062778c85972eb648030.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/6477062778c85972eb648030.md @@ -57,15 +57,15 @@ assert.equal(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.margin, 'au - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
+
+
+
+
``` @@ -82,8 +82,8 @@ body { .cat-head { --fcc-editable-region-- position: sticky; - top: 0; --fcc-editable-region-- + top: 0; background: linear-gradient(#5e5e5e 85%, #45454f 100%); width: 205px; height: 180px; @@ -92,7 +92,7 @@ body { } .box { - width: 400px; + width: 200px; height: 600px; background-color: #000; position: absolute; diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/647d821de0d97b3283c72b36.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/647d821de0d97b3283c72b36.md index c867e3064c4..7997af47f5c 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/647d821de0d97b3283c72b36.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/647d821de0d97b3283c72b36.md @@ -14,7 +14,7 @@ dashedName: step-16 يجب حذف قاعدة CSS الخاصة بـ `.box` وكل قيمها. ```js -assert.notMatch(code, /\.box\s*\{\s*width:\s*400px;\s*height:\s*600px;\s*background-color:\s*#000;\s*position:\s*absolute;\s*left:\s*650px;\s*top:\s*800px;?\s*\}\s*/) +assert.notMatch(code, /\.box\s*\{\s*width:\s*200px;\s*height:\s*600px;\s*background-color:\s*#000;\s*position:\s*absolute;\s*left:\s*650px;\s*top:\s*800px;?\s*\}\s*/) ``` # --seed-- @@ -25,14 +25,14 @@ assert.notMatch(code, /\.box\s*\{\s*width:\s*400px;\s*height:\s*600px;\s*backgro - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
+
+
+
``` @@ -62,7 +62,7 @@ body { --fcc-editable-region-- .box { - width: 400px; + width: 200px; height: 600px; background-color: #000; position: absolute; diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/647d855ac12cd436059acd39.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/647d855ac12cd436059acd39.md index d3cd24a60bc..3a3efdc6426 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/647d855ac12cd436059acd39.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/647d855ac12cd436059acd39.md @@ -33,9 +33,9 @@ assert.strictEqual(new __helpers.CSSHelp(document).getStyle('*')?.boxSizing, 'bo - - fCC Cat Painting - + + fCC Cat Painting + diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/649353647c44ef4867ab4935.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/649353647c44ef4867ab4935.md index 34af416127a..9b2e421c6b8 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/649353647c44ef4867ab4935.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/649353647c44ef4867ab4935.md @@ -1,6 +1,6 @@ --- id: 649353647c44ef4867ab4935 -title: خطوة 15 +title: الخطوة 15 challengeType: 0 dashedName: step-15 --- @@ -25,17 +25,17 @@ assert.notMatch(code, /<\/div>/) - - fCC Cat Painting - + + fCC Cat Painting + -
-
- --fcc-editable-region-- -
- --fcc-editable-region-- -
+
+
+ --fcc-editable-region-- +
+ --fcc-editable-region-- +
``` @@ -64,7 +64,7 @@ body { } .box { - width: 400px; + width: 200px; height: 600px; background-color: #000; position: absolute; diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/64a2687ef267e5934a2f93e3.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/64a2687ef267e5934a2f93e3.md index 659938a48a9..d48d1b0ef4d 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/64a2687ef267e5934a2f93e3.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/64a2687ef267e5934a2f93e3.md @@ -43,39 +43,39 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-mouth div')?.border, - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
- -
- -
-
-
+
+
-
+ +
+ +
+
+
+
+
+
``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/64a26ac5540c5493f4641f10.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/64a26ac5540c5493f4641f10.md index 86a5bab8810..8e6987cd806 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/64a26ac5540c5493f4641f10.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/64a26ac5540c5493f4641f10.md @@ -32,39 +32,39 @@ assert.match(code, /border-radius:\s*190%\/190px\s*150px\s*0\s*0\s*;?/) - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
- -
- -
-
-
+
+
-
+ +
+ +
+
+
+
+
+
``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/64a3bcbc83e574b58c8ed048.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/64a3bcbc83e574b58c8ed048.md index f6d72fefb7e..eb7b7cf290c 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/64a3bcbc83e574b58c8ed048.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/64a3bcbc83e574b58c8ed048.md @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whiskers-right div') - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/6676a8a8d9861319ee901a90.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/6676a8a8d9861319ee901a90.md index bedca6348f2..3352c220b5e 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/6676a8a8d9861319ee901a90.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/6676a8a8d9861319ee901a90.md @@ -103,23 +103,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-ear')?.borderBo - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/arabic/blocks/workshop-cat-painting/6676a8b01e56ec1a1e07c202.md b/curriculum/challenges/arabic/blocks/workshop-cat-painting/6676a8b01e56ec1a1e07c202.md index 8a88ae90c8b..e45411a3ca1 100644 --- a/curriculum/challenges/arabic/blocks/workshop-cat-painting/6676a8b01e56ec1a1e07c202.md +++ b/curriculum/challenges/arabic/blocks/workshop-cat-painting/6676a8b01e56ec1a1e07c202.md @@ -73,23 +73,23 @@ assert.isEmpty(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.backg - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` @@ -117,15 +117,15 @@ body { border-radius: 46%; } ---fcc-editable-region-- .cat-right-ear { +--fcc-editable-region-- height: 100px; width: 100px; background-color: white; border-left: 35px solid blue; border-right: 35px solid blue; border-top: 35px solid red; +--fcc-editable-region-- border-bottom: 35px solid red; } ---fcc-editable-region-- ``` diff --git a/curriculum/challenges/arabic/blocks/workshop-envelope-budget-app/69b2c970cb02ddaafff1c10d.md b/curriculum/challenges/arabic/blocks/workshop-envelope-budget-app/69b2c970cb02ddaafff1c10d.md index 816f0dc0fbc..782ae47cc9e 100644 --- a/curriculum/challenges/arabic/blocks/workshop-envelope-budget-app/69b2c970cb02ddaafff1c10d.md +++ b/curriculum/challenges/arabic/blocks/workshop-envelope-budget-app/69b2c970cb02ddaafff1c10d.md @@ -62,7 +62,7 @@ assert.notMatch(code, /<\/input>/); يجب أن يحتوي عنصر `input` على علامة الإغلاق `>`. ```js -assert.match(code, /HTMLString\s*=\s*`\n\s*Expense\s\$\{entryNumber\}\sName<\/label>\n\s*]*\/>/); +assert.match(code, /HTMLString\s*=\s*`\n\s*Expense\s\$\{entryNumber\}\sName<\/label>\n\s*]*>/); ``` # --seed-- diff --git a/curriculum/challenges/arabic/blocks/workshop-fcc-authors-page/69e14a2fd8ecf9210c0739ee.md b/curriculum/challenges/arabic/blocks/workshop-fcc-authors-page/69e14a2fd8ecf9210c0739ee.md index 2a759153a52..9af08535fac 100644 --- a/curriculum/challenges/arabic/blocks/workshop-fcc-authors-page/69e14a2fd8ecf9210c0739ee.md +++ b/curriculum/challenges/arabic/blocks/workshop-fcc-authors-page/69e14a2fd8ecf9210c0739ee.md @@ -11,6 +11,12 @@ dashedName: step-26 أضف استدعاء دالة إلى `initialFetch` في المكان المحدد في المحرر. +# --before-all-- + +```js +window.fetch = () => Promise.resolve({json: () => Promise.resolve([{ author: 'Whoever', image: 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==', url: "http://not-a-real-url.nowhere/", bio: 'words go here' }])}); +``` + # --hints-- يجب استدعاء `initialFetch` بدون أي معلمات. diff --git a/curriculum/challenges/arabic/blocks/workshop-fortune-teller-app/68ded620ab19272a3fa97592.md b/curriculum/challenges/arabic/blocks/workshop-fortune-teller-app/68ded620ab19272a3fa97592.md index 6821409a22a..d09e901a786 100644 --- a/curriculum/challenges/arabic/blocks/workshop-fortune-teller-app/68ded620ab19272a3fa97592.md +++ b/curriculum/challenges/arabic/blocks/workshop-fortune-teller-app/68ded620ab19272a3fa97592.md @@ -73,10 +73,9 @@ assert.isTrue(renderCard.hasReturnAnnotation("string")); يجب أن تُرجع دالة `renderCard` نص قالب. ```js -assert.match( - __helpers.removeJSComments(code), - /renderCard\s*=\s*\([^)]*\)\s*:\s*string\s*=>\s*(?:\{\s*return\s*)?`/ -); +const explorer = await __helpers.Explorer(code); +const { renderCard } = explorer.allFunctions; +assert.match(__helpers.removeJSComments(renderCard.toString()), /(?:return|=>)\s*`/); ``` # --seed-- diff --git a/curriculum/challenges/arabic/blocks/workshop-fortune-teller-app/68ed4621677e86eeefa59fe6.md b/curriculum/challenges/arabic/blocks/workshop-fortune-teller-app/68ed4621677e86eeefa59fe6.md index 37f546f80b3..5a2e4ae3cc6 100644 --- a/curriculum/challenges/arabic/blocks/workshop-fortune-teller-app/68ed4621677e86eeefa59fe6.md +++ b/curriculum/challenges/arabic/blocks/workshop-fortune-teller-app/68ed4621677e86eeefa59fe6.md @@ -15,8 +15,8 @@ dashedName: step-26 ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.initializeEventListeners.toString(); -assert.match(method, /initializeEventListeners\s*\(\s*\)\s*:\s*void/); +const { initializeEventListeners } = explorer.classes.Game?.methods ?? {}; +assert.isTrue(initializeEventListeners?.hasReturnAnnotation("void")); ``` # --seed-- diff --git a/curriculum/challenges/arabic/blocks/workshop-fortune-teller-app/68ee6c4b4c764b62d77df717.md b/curriculum/challenges/arabic/blocks/workshop-fortune-teller-app/68ee6c4b4c764b62d77df717.md index b4048664115..df0f135bf44 100644 --- a/curriculum/challenges/arabic/blocks/workshop-fortune-teller-app/68ee6c4b4c764b62d77df717.md +++ b/curriculum/challenges/arabic/blocks/workshop-fortune-teller-app/68ee6c4b4c764b62d77df717.md @@ -17,16 +17,30 @@ dashedName: step-31 ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.singleCardSelected.toString(); -assert.match(method, /const\s+isReversed\s*=/); +const { singleCardSelected } = explorer.classes.Game?.methods ?? {}; +const { isReversed } = singleCardSelected?.variables ?? {}; +assert.exists(isReversed); ``` يجب أن يستخدم متغير `isReversed` دالة `Math.random()` ليقرر عشوائيًا ما إذا كانت البطاقة معكوسة. ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.singleCardSelected.toString(); -assert.match(method, /isReversed\s*=\s*Math\.random\s*\(\s*\)\s*<\s*0\.5/); +const { singleCardSelected } = explorer.classes.Game?.methods ?? {}; +const { isReversed } = singleCardSelected?.variables ?? {}; + +const validForms = [ + 'Math.random() < 0.5', + 'Math.random() > 0.5', + 'Math.random() <= 0.5', + 'Math.random() >= 0.5', + '0.5 < Math.random()', + '0.5 > Math.random()', + '0.5 <= Math.random()', + '0.5 >= Math.random()' +]; + +assert.isTrue(validForms.some((form) => isReversed?.value.matches(form))); ``` # --seed-- diff --git a/curriculum/challenges/arabic/blocks/workshop-fortune-teller-app/68ee6c8c274515694ead0024.md b/curriculum/challenges/arabic/blocks/workshop-fortune-teller-app/68ee6c8c274515694ead0024.md index 13b7e14d27e..009f719a9b6 100644 --- a/curriculum/challenges/arabic/blocks/workshop-fortune-teller-app/68ee6c8c274515694ead0024.md +++ b/curriculum/challenges/arabic/blocks/workshop-fortune-teller-app/68ee6c8c274515694ead0024.md @@ -7,7 +7,7 @@ dashedName: step-32 # --description-- -يجب أن تكون النبوءة عشوائية، لذا تحتاج إلى دالة مساعدة لاختيار نبوءة عشوائية. أعلن عن متغير باسم `chosenCard` داخل الطريقة `singleCardSelected`. استخدم الطريقة `getRandomItem` للحصول على بطاقة عشوائية ومرر `cards` كمعلمة. +يجب أن تكون النبوءة عشوائية، لذا تحتاج إلى دالة مساعدة لاختيار نبوءة عشوائية. أعلن عن متغير باسم `chosenCard` داخل الطريقة `singleCardSelected`. استخدم الدالة `getRandomItem` للحصول على بطاقة عشوائية ومرر `this.cards` كمعلمة. # --hints-- @@ -15,22 +15,18 @@ dashedName: step-32 ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.singleCardSelected.toString(); -assert.match(method, /const\s+chosenCard\s*=/); +const { singleCardSelected } = explorer.classes.Game?.methods ?? {}; +const { chosenCard } = singleCardSelected?.variables ?? {}; +assert.exists(chosenCard); ``` يجب تعيين متغير `chosenCard` الخاص بك عن طريق استدعاء `getRandomItem(this.cards)`. ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.singleCardSelected.toString(); -assert.match(method, /chosenCard\s*=\s*getRandomItem\s*\(\s*this\.cards\s*\)/); -``` - -يجب تمرير `this.cards` كمعلمة إلى `getRandomItem`. - -```js -assert.match(__helpers.removeJSComments(code), /getRandomItem\s*\(\s*this\.cards\s*\)/); +const { singleCardSelected } = explorer.classes.Game?.methods ?? {}; +const { chosenCard } = singleCardSelected?.variables ?? {}; +assert.isTrue(chosenCard?.value.matches("getRandomItem(this.cards)")); ``` # --seed-- diff --git a/curriculum/challenges/arabic/blocks/workshop-fortune-teller-app/68f1e43a5f890b51774d93c4.md b/curriculum/challenges/arabic/blocks/workshop-fortune-teller-app/68f1e43a5f890b51774d93c4.md index b0f84556530..dbd6fcfc0ae 100644 --- a/curriculum/challenges/arabic/blocks/workshop-fortune-teller-app/68f1e43a5f890b51774d93c4.md +++ b/curriculum/challenges/arabic/blocks/workshop-fortune-teller-app/68f1e43a5f890b51774d93c4.md @@ -15,22 +15,28 @@ dashedName: step-43 ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /const\s+target\s*=/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { target } = showFortune?.variables ?? {}; +assert.exists(target); ``` يجب تعيين متغير `target` إلى `e.target`. ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /target\s*=\s*e\.target/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { target } = showFortune?.variables ?? {}; +assert.isTrue(target?.value.matches("e.target")); ``` يجب أن يكون لديك جملة `if` فارغة مباشرة بعد متغير `target`. ```js -assert.match(__helpers.removeJSComments(code), /showFortune\s*\([^)]*\)\s*\{[\s\S]*?if\s*\(\s*\)\s*\{\s*\}/); +const explorer = await __helpers.Explorer(code); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +assert.exists(showFortune); +const method = __helpers.removeJSComments(showFortune.toString()); +assert.match(method, /target\s*=\s*e\.target[\s\S]*?if\s*\(\s*\)\s*\{\s*\}/); ``` # --seed-- diff --git a/curriculum/challenges/arabic/blocks/workshop-fortune-teller-app/68f1e6a98bc05e67cc2b85e6.md b/curriculum/challenges/arabic/blocks/workshop-fortune-teller-app/68f1e6a98bc05e67cc2b85e6.md index 857f72686ab..26a82007062 100644 --- a/curriculum/challenges/arabic/blocks/workshop-fortune-teller-app/68f1e6a98bc05e67cc2b85e6.md +++ b/curriculum/challenges/arabic/blocks/workshop-fortune-teller-app/68f1e6a98bc05e67cc2b85e6.md @@ -15,22 +15,18 @@ dashedName: step-45 ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /const\s+cardElement\s*=/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { cardElement } = showFortune?.variables ?? {}; +assert.exists(cardElement); ``` يجب أن يستخدم `cardElement` الخاص بك `target?.closest` للعثور على `.card_container`. ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /cardElement\s*=\s*target\?\.closest\s*\(\s*['"]\.card_container['"]\s*\)/); -``` - -يجب تمرير `.card_container` كمعلمة إلى `closest`. - -```js -assert.match(__helpers.removeJSComments(code), /\.closest\s*\(\s*['"]\.card_container['"]\s*\)/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { cardElement } = showFortune?.variables ?? {}; +assert.isTrue(cardElement?.value.matches("target?.closest('.card_container')")); ``` # --seed-- diff --git a/curriculum/challenges/arabic/blocks/workshop-fortune-teller-app/68f1e852f705eb77f6bcb893.md b/curriculum/challenges/arabic/blocks/workshop-fortune-teller-app/68f1e852f705eb77f6bcb893.md index 3f104b71478..5bb0f7e9e01 100644 --- a/curriculum/challenges/arabic/blocks/workshop-fortune-teller-app/68f1e852f705eb77f6bcb893.md +++ b/curriculum/challenges/arabic/blocks/workshop-fortune-teller-app/68f1e852f705eb77f6bcb893.md @@ -15,28 +15,18 @@ dashedName: step-48 ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /const\s+cardId\s*=/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { cardId } = showFortune?.variables ?? {}; +assert.exists(cardId); ``` يجب تعيين متغير `cardId` باستدعاء `cardElement.getAttribute("data-id")`. ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /cardId\s*=\s*cardElement\.getAttribute\s*\(\s*['"]data-id['"]\s*\)/); -``` - -يجب استخدام الطريقة `getAttribute` على `cardElement`. - -```js -assert.match(__helpers.removeJSComments(code), /cardElement\.getAttribute\s*\(/); -``` - -يجب تمرير `'data-id'` إلى `getAttribute`. - -```js -assert.match(__helpers.removeJSComments(code), /\.getAttribute\s*\(\s*['"]data-id['"]\s*\)/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { cardId } = showFortune?.variables ?? {}; +assert.isTrue(cardId?.value.matches('cardElement.getAttribute("data-id")')); ``` # --seed-- diff --git a/curriculum/challenges/arabic/blocks/workshop-fortune-teller-app/68f1e8de2731b07d62e738d2.md b/curriculum/challenges/arabic/blocks/workshop-fortune-teller-app/68f1e8de2731b07d62e738d2.md index 6fbe35674cd..5ccc17e8c17 100644 --- a/curriculum/challenges/arabic/blocks/workshop-fortune-teller-app/68f1e8de2731b07d62e738d2.md +++ b/curriculum/challenges/arabic/blocks/workshop-fortune-teller-app/68f1e8de2731b07d62e738d2.md @@ -15,28 +15,38 @@ dashedName: step-49 ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /const\s+foundCard\s*=/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { foundCard } = showFortune?.variables ?? {}; +assert.exists(foundCard); ``` -يجب تعيين `foundCard` الخاص بك عن طريق استدعاء `find` على `this.cards` مع استدعاء راجع صحيح. +يجب تعيين `foundCard` عن طريق استدعاء `find` على `this.cards`، مع تمرير استدعاء راجع يأخذ معلمة `card` ويُرجع نتيجة مقارنة `card.name_short` مع `cardId` باستخدام المساواة الصارمة. ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /foundCard\s*=\s*this\.cards\.find\s*\(/); -``` - -يجب أن يحتوي استدعاء راجع `find` على معلمة باسم `card`. - -```js -assert.match(__helpers.removeJSComments(code), /cards\.find\s*\(\s*\(\s*card\s*\)\s*=>/); -``` - -داخل الاستدعاء الراجع، يجب مقارنة `card.name_short` مع `cardId`. - -```js -assert.match(__helpers.removeJSComments(code), /card\.name_short\s*===?\s*cardId/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { foundCard } = showFortune?.variables ?? {}; + +const validForms = [ + 'this.cards.find((card) => card.name_short === cardId)', + 'this.cards.find((card) => { return card.name_short === cardId; })', + 'this.cards.find((card) => cardId === card.name_short)', + 'this.cards.find((card) => { return cardId === card.name_short; })', + 'this.cards.find(card => card.name_short === cardId)', + 'this.cards.find(card => { return card.name_short === cardId; })', + 'this.cards.find(card => cardId === card.name_short)', + 'this.cards.find(card => { return cardId === card.name_short; })', + 'this.cards.find((card: Card) => card.name_short === cardId)', + 'this.cards.find((card: Card) => { return card.name_short === cardId; })', + 'this.cards.find((card: Card) => cardId === card.name_short)', + 'this.cards.find((card: Card) => { return cardId === card.name_short; })', + 'this.cards.find(function (card) { return card.name_short === cardId; })', + 'this.cards.find(function (card) { return cardId === card.name_short; })', + 'this.cards.find(function (card: Card) { return card.name_short === cardId; })', + 'this.cards.find(function (card: Card) { return cardId === card.name_short; })' +]; + +assert.isTrue(validForms.some((form) => foundCard?.value.matches(form))); ``` # --seed-- diff --git a/curriculum/challenges/arabic/blocks/workshop-greeting-bot/66ad8ab945d266383f318cbf.md b/curriculum/challenges/arabic/blocks/workshop-greeting-bot/66ad8ab945d266383f318cbf.md index 042e207e925..e116f011d1a 100644 --- a/curriculum/challenges/arabic/blocks/workshop-greeting-bot/66ad8ab945d266383f318cbf.md +++ b/curriculum/challenges/arabic/blocks/workshop-greeting-bot/66ad8ab945d266383f318cbf.md @@ -30,7 +30,11 @@ assert.lengthOf(logSpy.calls, 2); يجب أن يحتوي بيان `console` على الرسالة `"I am excited to talk to you."`. لا تنسَ علامات الاقتباس. ```js -assert.deepInclude(logSpy.calls, ["I am excited to talk to you."]); +assert.isTrue( + logSpy.calls.some( + (call) => /I\s+am\s+excited\s+to\s+talk\s+to\s+you\s*\./.test(call[0]) + ) +); ``` # --seed-- diff --git a/curriculum/challenges/arabic/blocks/workshop-greeting-bot/66ad9c633fa26d3c1475eae3.md b/curriculum/challenges/arabic/blocks/workshop-greeting-bot/66ad9c633fa26d3c1475eae3.md index 0b73b66cb28..b7c89851d8a 100644 --- a/curriculum/challenges/arabic/blocks/workshop-greeting-bot/66ad9c633fa26d3c1475eae3.md +++ b/curriculum/challenges/arabic/blocks/workshop-greeting-bot/66ad9c633fa26d3c1475eae3.md @@ -28,7 +28,11 @@ assert.lengthOf(logSpy.calls, 3); يجب أن يحتوي بيان `console` على الرسالة `"Allow me to introduce myself."`. لا تنسَ علامات الاقتباس. ```js -assert.deepInclude(logSpy.calls, ["Allow me to introduce myself."]); +assert.isTrue( + logSpy.calls.some( + (call) => /Allow\s+me\s+to\s+introduce\s+myself\s*\./.test(call[0]) + ) +); ``` # --seed-- diff --git a/curriculum/challenges/arabic/blocks/workshop-greeting-bot/66add47d27763c4862492c8c.md b/curriculum/challenges/arabic/blocks/workshop-greeting-bot/66add47d27763c4862492c8c.md index 8f2ce44a30c..007eb428404 100644 --- a/curriculum/challenges/arabic/blocks/workshop-greeting-bot/66add47d27763c4862492c8c.md +++ b/curriculum/challenges/arabic/blocks/workshop-greeting-bot/66add47d27763c4862492c8c.md @@ -76,12 +76,10 @@ console.log(favoriteSubjectSentence); ```js console.log("Hi there!"); console.log("I am excited to talk to you."); - let bot; -let botLocation; - bot = "teacherBot"; -botLocation = "the universe"; + +let botLocation = "the universe"; console.log("Allow me to introduce myself."); diff --git a/curriculum/challenges/arabic/blocks/workshop-hotel-feedback-form/66a93bbe65a26169dbf3bc39.md b/curriculum/challenges/arabic/blocks/workshop-hotel-feedback-form/66a93bbe65a26169dbf3bc39.md index e814662b8f1..929793f6f9f 100644 --- a/curriculum/challenges/arabic/blocks/workshop-hotel-feedback-form/66a93bbe65a26169dbf3bc39.md +++ b/curriculum/challenges/arabic/blocks/workshop-hotel-feedback-form/66a93bbe65a26169dbf3bc39.md @@ -13,7 +13,7 @@ dashedName: step-10 # --hints-- -يجب أن يكون لديك عنصر `label`. +يجب أن يكون لديك عنصر `label` ثاني داخل `fieldset` الخاص بك. ```js assert.lengthOf(document.querySelectorAll('fieldset label'), 2); diff --git a/curriculum/challenges/arabic/blocks/workshop-hotel-feedback-form/66a9401c9d660d6bb15993e2.md b/curriculum/challenges/arabic/blocks/workshop-hotel-feedback-form/66a9401c9d660d6bb15993e2.md index 020c0dc85e5..de61b03e5ac 100644 --- a/curriculum/challenges/arabic/blocks/workshop-hotel-feedback-form/66a9401c9d660d6bb15993e2.md +++ b/curriculum/challenges/arabic/blocks/workshop-hotel-feedback-form/66a9401c9d660d6bb15993e2.md @@ -15,7 +15,7 @@ dashedName: step-13 # --hints-- -يجب أن يكون لديك عنصر `label`. +يجب أن يكون لديك عنصر `label` ثالث داخل `fieldset`. ```js assert.lengthOf(document.querySelectorAll('fieldset label'), 3); diff --git a/curriculum/challenges/arabic/blocks/workshop-hotel-feedback-form/66a9419e2d18476c645ce693.md b/curriculum/challenges/arabic/blocks/workshop-hotel-feedback-form/66a9419e2d18476c645ce693.md index 803b3af578e..e2771b4fd1e 100644 --- a/curriculum/challenges/arabic/blocks/workshop-hotel-feedback-form/66a9419e2d18476c645ce693.md +++ b/curriculum/challenges/arabic/blocks/workshop-hotel-feedback-form/66a9419e2d18476c645ce693.md @@ -17,7 +17,7 @@ dashedName: step-14 تُستخدم الخاصيتان `min` و `max` لتحديد الحد الأدنى والحد الأقصى للقيم التي يمكن إدخالها في حقل الإدخال. -أسفل عنصر `label` الخاص بك، أضف مُدخَلًا مع خاصية `type` مضبوطة على `"number"` و`id` بقيمة `"age"`. +أسفل عنصر الـ `label`، أضف `input` مع خاصية `type` مضبوطة على `"number"` و`id` بقيمة `"age"`. يجب ضبط خاصية `name` على `"age"`، وخاصية `min` على `"3"`، وخاصية `max` على `"100"`. @@ -29,13 +29,13 @@ dashedName: step-14 assert.isNotNull(document.querySelector('label + input[type="number"]')); ``` -يجب أن يحتوي رقم الـ `input` على `id` بقيمة `age`. +يجب أن يحتوي `input` الرقمي على `id` بقيمة `"age"`. ```js assert.isNotNull(document.querySelector('label + input#age')); ``` -يجب أن يحتوي رقم الـ `input` على خاصية `name` مضبوطة على `age`. +يجب أن يحتوي `input` الرقمي على خاصية `name` مضبوطة على `"age"`. ```js assert.isNotNull(document.querySelector('label + input[name="age"]')); diff --git a/curriculum/challenges/arabic/blocks/workshop-hotel-feedback-form/67a51d3a8a6fe123b77b0c6e.md b/curriculum/challenges/arabic/blocks/workshop-hotel-feedback-form/67a51d3a8a6fe123b77b0c6e.md index 0af9b31bd7e..ad609090cad 100644 --- a/curriculum/challenges/arabic/blocks/workshop-hotel-feedback-form/67a51d3a8a6fe123b77b0c6e.md +++ b/curriculum/challenges/arabic/blocks/workshop-hotel-feedback-form/67a51d3a8a6fe123b77b0c6e.md @@ -7,11 +7,11 @@ dashedName: step-12 # --description-- -عناصر `input` يمكن أن تحتوي على خاصية `size`. تحدد هذه الخاصية عدد الأحرف التي يجب أن تظهر أثناء كتابة المستخدم في المُدخَل. يجب أن تكون قيمة `size` عددًا صحيحًا غير سالب وأكبر من الصفر. إذا لم تُحدد خاصية `size`، أو حُددت بقيمة غير صالحة، فسيكون عرض المُدخَل الافتراضي الذي يحدده المتصفح. +يمكن لعناصر `input` أن تحتوي على خاصية `size`. تحدد هذه الخاصية عدد الأحرف التي يجب أن تكون مرئية أثناء كتابة المستخدم في الـ `input`. يجب أن تكون قيمة `size` عددًا صحيحًا موجبًا. إذا لم تُحدد خاصية `size`، أو تم تحديدها بقيمة غير صالحة، فسيأخذ الـ `input` العرض الافتراضي الذي يحدده المتصفح. ```html - - + + ``` أضف خاصية `size` بقيمة `"20"` إلى مُدخَلي الاسم والبريد الإلكتروني. diff --git a/curriculum/challenges/arabic/blocks/workshop-plant-nursery-catalog/6734a772196245601e4b80e0.md b/curriculum/challenges/arabic/blocks/workshop-plant-nursery-catalog/6734a772196245601e4b80e0.md index 7be09dae68e..3f162721a9c 100644 --- a/curriculum/challenges/arabic/blocks/workshop-plant-nursery-catalog/6734a772196245601e4b80e0.md +++ b/curriculum/challenges/arabic/blocks/workshop-plant-nursery-catalog/6734a772196245601e4b80e0.md @@ -9,7 +9,7 @@ dashedName: step-10 عندما تحتاج إلى استرجاع عنصر من خريطة، يمكنك استخدام الطريقة `get`. تأخذ مفتاحًا كمعلمة، وتُرجع القيمة المرتبطة به. -استخدم الطريقة `get` لاسترجاع قيمة المفتاح `ballerina` من الكتالوج الخاص بك، وعيّنها في متغير باسم `getBallerina`. ثم سجّل المتغير الجديد في وحدة التحكم. +استخدم الطريقة `get` لاسترجاع قيمة المفتاح `ballerina` من الكتالوج، وقم بتعيينها إلى متغير باسم `getBallerina`. ثم سجّل المتغير الجديد في وحدة التحكم. # --hints-- @@ -22,7 +22,10 @@ assert.exists(getBallerina); يجب أن يحتوي متغير `getBallerina` على القيمة الناتجة من `catalog.get(ballerina)`. ```js -assert.match(__helpers.removeJSComments(code), /(const|let|var)\s+getBallerina\s*=\s*catalog\s*\.\s*get\s*\(\s*ballerina\s*\)/); +const explorer = await __helpers.Explorer(code); +const { getBallerina } = explorer.variables; +assert.isTrue(getBallerina?.value.matches('catalog.get(ballerina)') +); ``` يجب أن تسجل متغير `getBallerina` في وحدة التحكم. diff --git a/curriculum/challenges/arabic/blocks/workshop-plant-nursery-catalog/6737a1a073a0d14c6544d301.md b/curriculum/challenges/arabic/blocks/workshop-plant-nursery-catalog/6737a1a073a0d14c6544d301.md index 13c0e0ff78f..fbfe1cb5b68 100644 --- a/curriculum/challenges/arabic/blocks/workshop-plant-nursery-catalog/6737a1a073a0d14c6544d301.md +++ b/curriculum/challenges/arabic/blocks/workshop-plant-nursery-catalog/6737a1a073a0d14c6544d301.md @@ -23,7 +23,9 @@ assert.exists(plantsSet); يجب أن تستدعي `displayPlantsSet` وتعيّن نتيجتها إلى `plantsSet`. ```js -assert.match(__helpers.removeJSComments(code), /(const|let|var)\s+plantsSet\s*=\s*displayPlantsSet\s*\(\s*\)/) +const explorer = await __helpers.Explorer(code); +const { plantsSet } = explorer.variables; +assert.isTrue(plantsSet?.value.matches('displayPlantsSet()')); ``` يجب أن تسجل `plantsSet` في وحدة التحكم. diff --git a/curriculum/challenges/arabic/blocks/workshop-reusable-mega-navbar/6740495ba48aa94e5667b436.md b/curriculum/challenges/arabic/blocks/workshop-reusable-mega-navbar/6740495ba48aa94e5667b436.md index 9e916e75b69..1fd4d11da3f 100644 --- a/curriculum/challenges/arabic/blocks/workshop-reusable-mega-navbar/6740495ba48aa94e5667b436.md +++ b/curriculum/challenges/arabic/blocks/workshop-reusable-mega-navbar/6740495ba48aa94e5667b436.md @@ -24,7 +24,7 @@ export function multiply(a, b) { } ``` -أيضًا، يجب أن تبدأ مكوّنات React الوظيفية بحرف كبير لأنه طريقة للتمييز عن عناصر HTML العادية. +أيضًا، يجب أن تبدأ مكوِّنات React الدالية بحرف كبير لأن React تميزها بذلك عن عناصر HTML العادية. # --hints-- diff --git a/curriculum/challenges/arabic/blocks/workshop-reusable-mega-navbar/67457ff2dc531fbed928a0f0.md b/curriculum/challenges/arabic/blocks/workshop-reusable-mega-navbar/67457ff2dc531fbed928a0f0.md index 3bdcd3a4321..317ee9b338d 100644 --- a/curriculum/challenges/arabic/blocks/workshop-reusable-mega-navbar/67457ff2dc531fbed928a0f0.md +++ b/curriculum/challenges/arabic/blocks/workshop-reusable-mega-navbar/67457ff2dc531fbed928a0f0.md @@ -24,10 +24,9 @@ const App = () => { } ``` - داخل مكوِّن `Navbar`، أعد عنصر `nav` يحتوي على خاصية `className` بقيمة `navbar`. -السبب في استخدام `className` هنا بدلاً من `class` هو أن `class` كلمة محجوزة في JavaScript. لذلك، يستخدم React `className` كطريقة لتطبيق الأصناف على العناصر. +يُستخدم `className` هنا بدلًا من `class` لأن `class` كلمة محجوزة في JavaScript. لذلك، يستخدم React `className` كطريقة لتطبيق الأصناف على العناصر. # --hints-- @@ -37,7 +36,7 @@ const App = () => { assert.exists(document.querySelector('nav')); ``` -يجب أن يحتوي عنصر `nav` الخاص بك على خاصية `className` بقيمة `navbar`. +يجب أن يحتوي عنصر `nav` الخاص بك على `className` بقيمة `navbar`. ```js assert.equal(document.querySelector('nav')?.getAttribute('class'), 'navbar'); diff --git a/curriculum/challenges/arabic/blocks/workshop-reusable-mega-navbar/6745c732dbeb7c04f346e6f7.md b/curriculum/challenges/arabic/blocks/workshop-reusable-mega-navbar/6745c732dbeb7c04f346e6f7.md index f5b8e4b4849..b7b220a5bed 100644 --- a/curriculum/challenges/arabic/blocks/workshop-reusable-mega-navbar/6745c732dbeb7c04f346e6f7.md +++ b/curriculum/challenges/arabic/blocks/workshop-reusable-mega-navbar/6745c732dbeb7c04f346e6f7.md @@ -7,7 +7,7 @@ dashedName: step-3 # --description-- -أنشئ عنصر `ul` داخل عنصر `nav`. داخل ذلك العنصر `ul`، أنشئ ثلاثة عناصر قائمة. +أنشئ عنصر `ul` داخل عنصر `nav` الخاص بك. داخل ذلك العنصر `ul`، أنشئ ثلاثة عناصر `li`. # --hints-- diff --git a/curriculum/challenges/arabic/blocks/workshop-reusable-mega-navbar/6745c89fba004707ded84453.md b/curriculum/challenges/arabic/blocks/workshop-reusable-mega-navbar/6745c89fba004707ded84453.md index f1743af7f5f..9b07a35f320 100644 --- a/curriculum/challenges/arabic/blocks/workshop-reusable-mega-navbar/6745c89fba004707ded84453.md +++ b/curriculum/challenges/arabic/blocks/workshop-reusable-mega-navbar/6745c89fba004707ded84453.md @@ -7,17 +7,17 @@ dashedName: step-5 # --description-- -أنشئ عنصر وسم الرابط داخل أول عنصر `li`. أعطِ عنصر `a` خاصية `href` بقيمة `#` والنص `Dashboard`. +أنشئ عنصر `a` داخل أول عنصر `li` لديك. أعطه خاصية `href` بقيمة `#` والنص `Dashboard`. # --hints-- -يجب أن تنشئ عنصر `a` داخل أول عنصر قائمة. +يجب أن تنشئ عنصر `a` داخل أول عنصر `li` لديك. ```js assert.exists(document.querySelector('li a')); ``` -يجب أن تحمل خاصية `href` في عنصر `a` القيمة `#`. +يجب أن يحتوي عنصر `a` الخاص بك على خاصية `href` بقيمة `#`. ```js assert.equal(document.querySelector('a')?.getAttribute('href'), '#'); diff --git a/curriculum/challenges/arabic/blocks/workshop-reusable-mega-navbar/6745cebbf97ef2129f3b9bab.md b/curriculum/challenges/arabic/blocks/workshop-reusable-mega-navbar/6745cebbf97ef2129f3b9bab.md index f682537ee1c..89e599a7370 100644 --- a/curriculum/challenges/arabic/blocks/workshop-reusable-mega-navbar/6745cebbf97ef2129f3b9bab.md +++ b/curriculum/challenges/arabic/blocks/workshop-reusable-mega-navbar/6745cebbf97ef2129f3b9bab.md @@ -7,17 +7,17 @@ dashedName: step-6 # --description-- -أنشئ عنصر `a` آخر داخل العنصر الثاني `li`. اجعله يحمل خاصية `href` بقيمة `#` والنص `Widgets`. +أنشئ عنصر `a` آخر داخل العنصر الثاني `li`. أعطه خاصية `href` بقيمة `#` والنص `Widgets`. # --hints-- -يجب أن تنشئ عنصر `a` داخل العنصر الثاني من القائمة. +يجب أن تنشئ عنصر `a` داخل العنصر الثاني `li`. ```js assert.lengthOf(document.querySelectorAll('li a'), 2); ``` -يجب أن تحمل خاصية `href` في عنصر `a` القيمة `#`. +يجب أن يحتوي عنصر `a` على خاصية `href` بقيمة `#`. ```js assert.equal(document.querySelectorAll('a')[1]?.getAttribute('href'), '#'); diff --git a/curriculum/challenges/arabic/blocks/workshop-reusable-mega-navbar/6745d799beeb822076a4da9d.md b/curriculum/challenges/arabic/blocks/workshop-reusable-mega-navbar/6745d799beeb822076a4da9d.md index 028e1dd714b..98d9000359d 100644 --- a/curriculum/challenges/arabic/blocks/workshop-reusable-mega-navbar/6745d799beeb822076a4da9d.md +++ b/curriculum/challenges/arabic/blocks/workshop-reusable-mega-navbar/6745d799beeb822076a4da9d.md @@ -7,19 +7,19 @@ dashedName: step-7 # --description-- -داخل عنصر القائمة الثالث، أنشئ عنصر `button` مع خاصية `aria-expanded` مضبوطة على `false`. أيضًا، عيّن نص الـ `button` إلى `Apps`. +داخل عنصر `li` الثالث، أنشئ عنصر `button` مع خاصية `aria-expanded` بقيمة `false`. أيضًا، عيّن نص عنصر `button` إلى `Apps`. خاصية `aria-expanded` ستُخبر مستخدمي قارئ الشاشة أن الزر يُشغّل قائمة فرعية قابلة للتوسيع. # --hints-- -يجب أن تنشئ عنصر `button` داخل عنصر القائمة الثالث. +يجب أن تنشئ عنصر `button` داخل عنصر `li` الثالث. ```js assert.exists(document.querySelector('li:nth-of-type(3) button')); ``` -يجب أن يحتوي عنصر `button` على خاصية `aria-expanded` مضبوطة على `false`. +يجب أن يحتوي عنصر `button` على خاصية `aria-expanded` بقيمة `false`. ```js assert.equal( diff --git a/curriculum/challenges/arabic/blocks/workshop-reusable-mega-navbar/6745d9df333efe2543a1f457.md b/curriculum/challenges/arabic/blocks/workshop-reusable-mega-navbar/6745d9df333efe2543a1f457.md index 518ef593142..7015355f3ab 100644 --- a/curriculum/challenges/arabic/blocks/workshop-reusable-mega-navbar/6745d9df333efe2543a1f457.md +++ b/curriculum/challenges/arabic/blocks/workshop-reusable-mega-navbar/6745d9df333efe2543a1f457.md @@ -7,7 +7,7 @@ dashedName: step-8 # --description-- -لا تزال داخل العنصر الثالث `li`، أنشئ عنصر `ul` للنوافذ المنبثقة. امنحه `className` بقيمة `sub-menu` و`aria-label` بقيمة `Apps`. +لا تزال داخل عنصر `li` الثالث، أنشئ عنصر `ul` للنوافذ المنبثقة. امنحه `className` بقيمة `sub-menu` و`aria-label` بقيمة `Apps`. # --hints-- @@ -17,13 +17,13 @@ dashedName: step-8 assert.exists(document.querySelector('li ul')); ``` -يجب أن تضبط الخاصية `className` لعنصر `ul` على `sub-menu`. +يجب أن يحتوي عنصر `ul` على `className` بقيمة `sub-menu`. ```js assert.equal(document.querySelector('li ul')?.getAttribute('class'), 'sub-menu'); ``` -يجب أن تضبط الخاصية `aria-label` لعنصر `ul` على `Apps`. +يجب أن يحتوي عنصر `ul` على `aria-label` بقيمة `Apps`. ```js assert.equal(document.querySelector('li ul')?.getAttribute('aria-label'), 'Apps'); diff --git a/curriculum/challenges/arabic/blocks/workshop-reusable-mega-navbar/6745dce846995b2a466594be.md b/curriculum/challenges/arabic/blocks/workshop-reusable-mega-navbar/6745dce846995b2a466594be.md index a8b981ecc0c..96272da07bb 100644 --- a/curriculum/challenges/arabic/blocks/workshop-reusable-mega-navbar/6745dce846995b2a466594be.md +++ b/curriculum/challenges/arabic/blocks/workshop-reusable-mega-navbar/6745dce846995b2a466594be.md @@ -7,11 +7,11 @@ dashedName: step-9 # --description-- -أنشئ ثلاثة عناصر قائمة جديدة داخل عنصر `ul.sub-menu` الخاص بك. +أنشئ ثلاثة عناصر `li` جديدة داخل عنصر `ul` الخاص بك مع `className` بقيمة `sub-menu`. # --hints-- -يجب أن تنشئ ثلاثة عناصر قائمة جديدة داخل عنصر `ul` الذي يحمل `className` بقيمة `sub-menu`. +يجب أن تنشئ ثلاثة عناصر `li` جديدة داخل عنصر `ul` الخاص بك مع `className` بقيمة `sub-menu`. ```js assert.lengthOf(document.querySelectorAll('.sub-menu li'), 3); diff --git a/curriculum/challenges/arabic/blocks/workshop-reusable-mega-navbar/6745de9ce925b92d72df713a.md b/curriculum/challenges/arabic/blocks/workshop-reusable-mega-navbar/6745de9ce925b92d72df713a.md index d982052e6e2..f8e245ef58e 100644 --- a/curriculum/challenges/arabic/blocks/workshop-reusable-mega-navbar/6745de9ce925b92d72df713a.md +++ b/curriculum/challenges/arabic/blocks/workshop-reusable-mega-navbar/6745de9ce925b92d72df713a.md @@ -7,11 +7,11 @@ dashedName: step-10 # --description-- -داخل كل عنصر `li`، أنشئ عنصر وسم الرابط مع خاصية `href` مضبوطة على `#`. +داخل كل من عناصر `li` الثلاثة الجديدة، أنشئ عنصر `a` مع خاصية `href` بقيمة `#`. # --hints-- -يجب إنشاء عنصر `a` جديد داخل كل عنصر قائمة وضبط خاصية `href` الخاصة به على `#`. +يجب أن تنشئ عنصر `a` جديد مع خاصية `href` بقيمة `#` داخل كل من عناصر `li` الثلاثة الجديدة. ```js assert.equal(document.querySelectorAll('li a')[2]?.getAttribute('href'), '#'); diff --git a/curriculum/challenges/arabic/blocks/workshop-reusable-mega-navbar/6745e2aca895c935168e7d91.md b/curriculum/challenges/arabic/blocks/workshop-reusable-mega-navbar/6745e2aca895c935168e7d91.md index 15db77a0d6d..81d4a8e273f 100644 --- a/curriculum/challenges/arabic/blocks/workshop-reusable-mega-navbar/6745e2aca895c935168e7d91.md +++ b/curriculum/challenges/arabic/blocks/workshop-reusable-mega-navbar/6745e2aca895c935168e7d91.md @@ -7,25 +7,25 @@ dashedName: step-11 # --description-- -لإنهاء الأمور، عيّن نصًا بـ `Calendar` لوسم الرابط الأول، و`Chat` للثاني، و`Email` للثالث. +لإنهاء الأمور، عيّن نص العنصر الأول `a` إلى `Calendar`، والثاني إلى `Chat`، والثالث إلى `Email`. -بهذا، يصبح مكوِّن شريط التنقل الكبير جاهزًا! +بهذا، يصبح مكوِّن `Navbar` الخاص بك مكتملًا! # --hints-- -يجب أن تعيّن نصًا بـ `Calendar` لعنصر وسم الرابط الأول. +يجب أن تعيّن نص العنصر الأول `a` إلى `Calendar`. ```js assert.equal(document.querySelectorAll('li a')[2]?.textContent, 'Calendar'); ``` -يجب أن تعيّن نصًا بـ `Chat` لعنصر وسم الرابط الثاني. +يجب أن تعيّن نص العنصر الثاني `a` إلى `Chat`. ```js assert.equal(document.querySelectorAll('li a')[3]?.textContent, 'Chat'); ``` -يجب أن تعيّن نصًا بـ `Email` لعنصر وسم الرابط الثالث. +يجب أن تعيّن نص العنصر الثالث `a` إلى `Email`. ```js assert.equal(document.querySelectorAll('li a')[4]?.textContent, 'Email'); diff --git a/curriculum/challenges/arabic/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165b.md b/curriculum/challenges/arabic/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165b.md index bc861a9993d..8e33629c328 100644 --- a/curriculum/challenges/arabic/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165b.md +++ b/curriculum/challenges/arabic/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165b.md @@ -7,7 +7,7 @@ dashedName: step-5 # --description-- -داخل جملة الإرجاع، استبدل السلسلة النصية الفارغة بعنصر `div` يحتوي على خاصية `className` بقيمة `flex-container`. +داخل جملة `return`، استبدل السلسلة النصية الفارغة بعنصر `div` يحمل `className` بقيمة `flex-container`. # --hints-- @@ -26,7 +26,7 @@ dashedName: step-5 assert.lengthOf(testElem.children, 1); ``` -يجب أن يحتوي عنصر `div` الخاص بك على خاصية `className` بقيمة `flex-container`. +يجب أن يحتوي عنصر `div` على `className` بقيمة `flex-container`. ```js const testElem = await __helpers.prepTestComponent(window.index.App); diff --git a/curriculum/challenges/arabic/blocks/workshop-reusable-profile-card-component/68720c179cd34be6793bfdf6.md b/curriculum/challenges/arabic/blocks/workshop-reusable-profile-card-component/68720c179cd34be6793bfdf6.md index 8c4f5fa27c5..e932b808f69 100644 --- a/curriculum/challenges/arabic/blocks/workshop-reusable-profile-card-component/68720c179cd34be6793bfdf6.md +++ b/curriculum/challenges/arabic/blocks/workshop-reusable-profile-card-component/68720c179cd34be6793bfdf6.md @@ -9,7 +9,7 @@ dashedName: step-8 بينما يعمل تطبيقك كما هو متوقع، عادةً لا تضيف مكونات `Card` متعددة يدويًا بهذه الطريقة. -احذف مكونات `` الثلاثة داخل عنصر `
`. في الخطوات التالية، ستنشئ مصفوفة من البيانات وتستخدم الدالة `map()` لعرض مكونات `Card`، وهي الطريقة الأكثر شيوعًا في React. +احذف ثلاثة مكوِّنات `` داخل عنصر `
`. في الخطوات التالية، ستُنشئ مصفوفة من البيانات وتستخدم الطريقة `map()` لعرض مكوِّنات `Card`، وهي الطريقة الأكثر شيوعًا في React. # --hints-- diff --git a/curriculum/challenges/arabic/blocks/workshop-reusable-profile-card-component/68778af56eb5d980a4e2daed.md b/curriculum/challenges/arabic/blocks/workshop-reusable-profile-card-component/68778af56eb5d980a4e2daed.md index b1d89305e66..d6a5b086e99 100644 --- a/curriculum/challenges/arabic/blocks/workshop-reusable-profile-card-component/68778af56eb5d980a4e2daed.md +++ b/curriculum/challenges/arabic/blocks/workshop-reusable-profile-card-component/68778af56eb5d980a4e2daed.md @@ -30,7 +30,7 @@ const profilesVal = eval(profiles?.value.toString()); assert.isArray(profilesVal); ``` -يجب أن تحتوي مصفوفة profiles على كائن يشمل جميع الخصائص المطلوبة: `id`، `name`، `title`، و `bio`. +يجب أن تحتوي مصفوفة `profiles` على كائن يشمل جميع الخصائص المطلوبة: `id`، `name`، `title`، و`bio`. ```js const explorer = await __helpers.Explorer(code); diff --git a/curriculum/challenges/arabic/blocks/workshop-reusable-profile-card-component/68779156bd3704b727ba5f38.md b/curriculum/challenges/arabic/blocks/workshop-reusable-profile-card-component/68779156bd3704b727ba5f38.md index 79774d329b6..aa607351749 100644 --- a/curriculum/challenges/arabic/blocks/workshop-reusable-profile-card-component/68779156bd3704b727ba5f38.md +++ b/curriculum/challenges/arabic/blocks/workshop-reusable-profile-card-component/68779156bd3704b727ba5f38.md @@ -7,7 +7,7 @@ dashedName: step-10 # --description-- -كما تتذكر من الدروس السابقة، يمكنك استخدام الطريقة `map` للتكرار خلال الكائنات المختلفة وعرض المكوِّنات ديناميكيًا بهذا الشكل: +كما تتذكر من الدروس السابقة، يمكنك استخدام الطريقة `map()` للتكرار خلال الكائنات المختلفة وعرض المكوِّنات بشكل ديناميكي مثل هذا: ```jsx export function App() { diff --git a/curriculum/challenges/arabic/blocks/workshop-reusable-profile-card-component/687799aefd1f2af1704065d0.md b/curriculum/challenges/arabic/blocks/workshop-reusable-profile-card-component/687799aefd1f2af1704065d0.md index cbb1bf34a2b..0f7c8e221ef 100644 --- a/curriculum/challenges/arabic/blocks/workshop-reusable-profile-card-component/687799aefd1f2af1704065d0.md +++ b/curriculum/challenges/arabic/blocks/workshop-reusable-profile-card-component/687799aefd1f2af1704065d0.md @@ -23,7 +23,7 @@ dashedName: step-11
``` -تساعد خاصية `key` React على تحديد العناصر التي تغيرت أو أُضيفت أو أُزيلت. هذا يحسن الأداء ويسمح بتحديثات أكثر كفاءة. +تُساعد الخاصية `key` React على تحديد العناصر التي تغيّرت أو أُضيفت أو أُزيلت. هذا يُحسّن الأداء ويسمح بتحديثات أكثر كفاءة. حدّث مكوِّن `Card` ليشمل خاصية `key` بقيمة `profile.id`. diff --git a/curriculum/challenges/arabic/blocks/workshop-toggle-text-app/67cd46ec4ec904186ad52ba5.md b/curriculum/challenges/arabic/blocks/workshop-toggle-text-app/67cd46ec4ec904186ad52ba5.md index 9467e2512dc..1f52bb009ec 100644 --- a/curriculum/challenges/arabic/blocks/workshop-toggle-text-app/67cd46ec4ec904186ad52ba5.md +++ b/curriculum/challenges/arabic/blocks/workshop-toggle-text-app/67cd46ec4ec904186ad52ba5.md @@ -7,7 +7,7 @@ dashedName: step-3 # --description-- -أسفل عنصر `button`، أضف عنصر فقرة مع `id` باسم `message` والنص `I love freeCodeCamp!`. +أسفل عنصر `button` الخاص بك، أضف عنصر فقرة مع `id` يسمى `message` والنص `I love freeCodeCamp!`. # --hints-- @@ -17,7 +17,7 @@ dashedName: step-3 assert.exists(document.querySelector("p")); ``` -يجب أن يحتوي عنصر الفقرة على `id` باسم `message`. +يجب أن يحتوي عنصر الفقرة على `id` يسمى `message`. ```js assert.exists(document.getElementById("message")) diff --git a/curriculum/challenges/arabic/blocks/workshop-toggle-text-app/67cd49e05693111a41771f29.md b/curriculum/challenges/arabic/blocks/workshop-toggle-text-app/67cd49e05693111a41771f29.md index 6ec792576a2..635408782be 100644 --- a/curriculum/challenges/arabic/blocks/workshop-toggle-text-app/67cd49e05693111a41771f29.md +++ b/curriculum/challenges/arabic/blocks/workshop-toggle-text-app/67cd49e05693111a41771f29.md @@ -19,7 +19,7 @@ const [user, setUser] = useState("Jessica"); أنشئ متغير حالة جديد ودالة تعيين باسم `isVisible` و`setIsVisible`. تذكر استخدام صيغة التفكيك للمصفوفة كما هو موضح في المثال. -ثم عيّن الخطاف `useState` بقيمة ابتدائية `false`. +ثم استدعِ دالة `useState` بقيمة ابتدائية `false`. # --hints-- diff --git a/curriculum/challenges/arabic/blocks/workshop-toggle-text-app/67cd4fe67813f71c3479e64a.md b/curriculum/challenges/arabic/blocks/workshop-toggle-text-app/67cd4fe67813f71c3479e64a.md index e519bfcfe89..ad080d648fc 100644 --- a/curriculum/challenges/arabic/blocks/workshop-toggle-text-app/67cd4fe67813f71c3479e64a.md +++ b/curriculum/challenges/arabic/blocks/workshop-toggle-text-app/67cd4fe67813f71c3479e64a.md @@ -1,6 +1,6 @@ --- id: 67cd4fe67813f71c3479e64a -title: خطوة 6 +title: الخطوة 6 challengeType: 0 dashedName: step-6 --- @@ -9,7 +9,7 @@ dashedName: step-6 إحدى الطرق لعرض نص الفقرة هي تغيير القيمة الابتدائية لـ `useState`. -غيّر القيمة الحالية لـ `useState` من `false` إلى `true` وسترى أن نص الفقرة يظهر الآن على الشاشة. +غيّر القيمة الابتدائية لـ `useState` من `false` إلى `true`. عند التنفيذ الصحيح، سترى أن نص الفقرة يظهر الآن على الشاشة. # --hints-- diff --git a/curriculum/challenges/arabic/blocks/workshop-toggle-text-app/67cd525b0e575b1e5abf4c03.md b/curriculum/challenges/arabic/blocks/workshop-toggle-text-app/67cd525b0e575b1e5abf4c03.md index 3d653954207..eb3fb10460a 100644 --- a/curriculum/challenges/arabic/blocks/workshop-toggle-text-app/67cd525b0e575b1e5abf4c03.md +++ b/curriculum/challenges/arabic/blocks/workshop-toggle-text-app/67cd525b0e575b1e5abf4c03.md @@ -16,7 +16,7 @@ const [isUserLoggedIn, setIsUserLoggedIn] = useState(false); setIsUserLoggedIn(!isUserLoggedIn); ``` -المثال التالي يستخدم الدالة set المسماة `setIsUserLoggedIn` لتحديث حالة تسجيل دخول المستخدم. من الممارسات الشائعة استخدام عامل النفي المنطقي (`!`) للتبديل بين `true` و `false`. بما أن القيمة الأولية هي `false`، فإن تطبيق عامل `!` سيغيرها إلى `true`. +المثال أعلاه يستخدم الدالة set المسماة `setIsUserLoggedIn` لتحديث حالة تسجيل الدخول للمستخدم. من الممارسات الشائعة استخدام عامل النفي المنطقي (`!`) للتبديل بين `true` و `false`. بما أن القيمة الأولية هي `false`، فإن تطبيق عامل `!` سيغيرها إلى `true`. داخل الدالة `handleToggleVisibility`، استخدم `setIsVisible` لتحديث حالة مستوى الظهور باستخدام عامل النفي المنطقي (`!`). diff --git a/curriculum/challenges/arabic/blocks/workshop-toggle-text-app/67cd57e96257ed1fabbe4879.md b/curriculum/challenges/arabic/blocks/workshop-toggle-text-app/67cd57e96257ed1fabbe4879.md index 9ab7b67cd78..17f8269b19f 100644 --- a/curriculum/challenges/arabic/blocks/workshop-toggle-text-app/67cd57e96257ed1fabbe4879.md +++ b/curriculum/challenges/arabic/blocks/workshop-toggle-text-app/67cd57e96257ed1fabbe4879.md @@ -27,7 +27,7 @@ function handleClick() { # --hints-- -عند النقر على `toggle-button`، يجب أن تظهر الرسالة `"I love freeCodeCamp!"` على الشاشة. +يجب أن تظهر رسالتك `I love freeCodeCamp!` على الشاشة عند نقر `toggle-button`. ```js const abuseState = __helpers.spyOn(React, "useState"); diff --git a/curriculum/challenges/arabic/blocks/workshop-toggle-text-app/67cd5bace629fa219a70aa6d.md b/curriculum/challenges/arabic/blocks/workshop-toggle-text-app/67cd5bace629fa219a70aa6d.md index 8e58ab4049d..5e011fc0153 100644 --- a/curriculum/challenges/arabic/blocks/workshop-toggle-text-app/67cd5bace629fa219a70aa6d.md +++ b/curriculum/challenges/arabic/blocks/workshop-toggle-text-app/67cd5bace629fa219a70aa6d.md @@ -9,7 +9,7 @@ dashedName: step-12 إذا نظرت إلى وحدة التحكم، قد تتفاجأ برؤية القيمة `false` بدلًا من `true`. يحدث هذا لأن React لا يُحدّث الحالة فورًا. ستُحدّث الحالة فقط في دورة العرض التالية. -خطأ شائع بين المطوّرين الجدد على React هو وضع عبارات وحدة التحكم مباشرة بعد دالة التعيين. لذا يجب أن تكون واعيًا لهذا الأمر أثناء بناء تطبيقات React الخاصة بك. +من الأخطاء الشائعة لدى المطوّرين الجدد على React وضع عبارات وحدة التحكم مباشرة بعد دالة التعيين. لذا يجب أن تكون على وعي بهذا الأمر أثناء بناء تطبيقات React الخاصة بك. بما أن `console.log()` لم يعد ضروريًا، احذفه من دالة `handleToggleVisibility` الخاصة بك. diff --git a/curriculum/challenges/arabic/blocks/workshop-toggle-text-app/67cd61c24bfc0a240132fd2f.md b/curriculum/challenges/arabic/blocks/workshop-toggle-text-app/67cd61c24bfc0a240132fd2f.md index 086d2ed7b09..a699f241f7c 100644 --- a/curriculum/challenges/arabic/blocks/workshop-toggle-text-app/67cd61c24bfc0a240132fd2f.md +++ b/curriculum/challenges/arabic/blocks/workshop-toggle-text-app/67cd61c24bfc0a240132fd2f.md @@ -23,14 +23,14 @@ dashedName: step-13 # --hints-- -عندما تكون قيمة `isVisible` هي `false`، يجب أن يقول نص الزر `Show Message`. +يجب أن يعرض نص الزر `Show Message` عندما تكون قيمة `isVisible` هي `false`. ```js const btn = document.getElementById("toggle-button"); assert.equal(btn.textContent, "Show Message"); ``` -عندما تكون قيمة `isVisible` هي `true`، يجب أن يقول نص الزر `Hide Message`. +يجب أن يعرض نص الزر `Hide Message` عندما تكون قيمة `isVisible` هي `true`. ```js const abuseState = __helpers.spyOn(React, "useState"); @@ -246,7 +246,7 @@ export const ToggleApp = () => { const handleToggleVisibility = () => { setIsVisible(!isVisible); - } + }; return (
diff --git a/curriculum/challenges/arabic/blocks/workshop-wildlife-tracker/6999ac171928136168654774.md b/curriculum/challenges/arabic/blocks/workshop-wildlife-tracker/6999ac171928136168654774.md index 4de5e414761..1e78274cd0f 100644 --- a/curriculum/challenges/arabic/blocks/workshop-wildlife-tracker/6999ac171928136168654774.md +++ b/curriculum/challenges/arabic/blocks/workshop-wildlife-tracker/6999ac171928136168654774.md @@ -42,8 +42,10 @@ assert.isFunction(getSpecies); يجب أن تحتوي دالة `getSpecies` على معلمة واحدة فقط، وهي `animal`. ```js -const regex = __helpers.functionRegex('getSpecies', ['animal']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { getSpecies } = explorer.allFunctions; +assert.equal(getSpecies?.parameters.length, 1); +assert.equal(getSpecies?.parameters[0].toString(), 'animal'); ``` يجب أن تسجل `getSpecies(tiger)` في وحدة التحكم. diff --git a/curriculum/challenges/arabic/blocks/workshop-wildlife-tracker/6999ad1cdc249e185aaeedbd.md b/curriculum/challenges/arabic/blocks/workshop-wildlife-tracker/6999ad1cdc249e185aaeedbd.md index 9e44d2bff7d..eadddb0c0a1 100644 --- a/curriculum/challenges/arabic/blocks/workshop-wildlife-tracker/6999ad1cdc249e185aaeedbd.md +++ b/curriculum/challenges/arabic/blocks/workshop-wildlife-tracker/6999ad1cdc249e185aaeedbd.md @@ -49,8 +49,11 @@ assert.isFunction(addHabitat); يجب أن تحتوي الدالة `addHabitat` على معلمتين: `animal` و `habitat`. ```js -const regex = __helpers.functionRegex('addHabitat', ['animal', 'habitat']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { addHabitat } = explorer.allFunctions; +assert.equal(addHabitat?.parameters.length, 2); +assert.equal(addHabitat?.parameters[0].toString(), 'animal'); +assert.equal(addHabitat?.parameters[1].toString(), 'habitat'); ``` يجب أن تُرجع الدالة `addHabitat` الكائن `animal` المحدث. diff --git a/curriculum/challenges/arabic/blocks/workshop-wildlife-tracker/6999adc72c02812a28c01e31.md b/curriculum/challenges/arabic/blocks/workshop-wildlife-tracker/6999adc72c02812a28c01e31.md index d3bbf7f8679..c7deab36058 100644 --- a/curriculum/challenges/arabic/blocks/workshop-wildlife-tracker/6999adc72c02812a28c01e31.md +++ b/curriculum/challenges/arabic/blocks/workshop-wildlife-tracker/6999adc72c02812a28c01e31.md @@ -43,8 +43,11 @@ assert.isFunction(updateAge); يجب أن تحتوي دالة `updateAge` على معلمتين: `animal` و `newAge`. ```js -const regex = __helpers.functionRegex('updateAge', ['animal', 'newAge']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { updateAge } = explorer.allFunctions; +assert.equal(updateAge?.parameters.length, 2); +assert.equal(updateAge?.parameters[0].toString(), 'animal'); +assert.equal(updateAge?.parameters[1].toString(), 'newAge'); ``` يجب أن تُرجع دالة `updateAge` كائن `animal` المحدث. diff --git a/curriculum/challenges/arabic/blocks/workshop-wildlife-tracker/6999b0198d18d402c36cc5fe.md b/curriculum/challenges/arabic/blocks/workshop-wildlife-tracker/6999b0198d18d402c36cc5fe.md index 337ba05c75f..50bd6031af2 100644 --- a/curriculum/challenges/arabic/blocks/workshop-wildlife-tracker/6999b0198d18d402c36cc5fe.md +++ b/curriculum/challenges/arabic/blocks/workshop-wildlife-tracker/6999b0198d18d402c36cc5fe.md @@ -45,8 +45,10 @@ assert.isFunction(removeEndangeredStatus); يجب أن تحتوي الدالة `removeEndangeredStatus` على معلمة واحدة فقط، وهي `animal`. ```js -const regex = __helpers.functionRegex('removeEndangeredStatus', ['animal']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { removeEndangeredStatus } = explorer.allFunctions; +assert.equal(removeEndangeredStatus?.parameters.length, 1); +assert.equal(removeEndangeredStatus?.parameters[0].toString(), 'animal'); ``` يجب أن تُرجع الدالة `removeEndangeredStatus` الكائن `animal` المحدث. diff --git a/curriculum/challenges/arabic/blocks/workshop-wildlife-tracker/6999b07c34c2cde21ee6e1d8.md b/curriculum/challenges/arabic/blocks/workshop-wildlife-tracker/6999b07c34c2cde21ee6e1d8.md index 9f6c7e5e9f1..5d0014ae453 100644 --- a/curriculum/challenges/arabic/blocks/workshop-wildlife-tracker/6999b07c34c2cde21ee6e1d8.md +++ b/curriculum/challenges/arabic/blocks/workshop-wildlife-tracker/6999b07c34c2cde21ee6e1d8.md @@ -49,8 +49,10 @@ assert.isFunction(hasHabitat); يجب أن تحتوي الدالة `hasHabitat` على معلمة واحدة فقط، وهي `animal`. ```js -const regex = __helpers.functionRegex('hasHabitat', ['animal']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { hasHabitat } = explorer.allFunctions; +assert.equal(hasHabitat?.parameters.length, 1); +assert.equal(hasHabitat?.parameters[0].toString(), 'animal'); ``` يجب أن تستخدم `hasHabitat` طريقة `hasOwnProperty` للتحقق من الخاصية `habitat`. diff --git a/curriculum/challenges/arabic/blocks/workshop-wildlife-tracker/6999b0d79ea938edcb032237.md b/curriculum/challenges/arabic/blocks/workshop-wildlife-tracker/6999b0d79ea938edcb032237.md index e648f084125..1e68ca4ea47 100644 --- a/curriculum/challenges/arabic/blocks/workshop-wildlife-tracker/6999b0d79ea938edcb032237.md +++ b/curriculum/challenges/arabic/blocks/workshop-wildlife-tracker/6999b0d79ea938edcb032237.md @@ -45,8 +45,11 @@ assert.isFunction(getProperty); يجب أن تحتوي دالة `getProperty` على معلمتين: `animal` و `propertyName`. ```js -const regex = __helpers.functionRegex('getProperty', ['animal', 'propertyName']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { getProperty } = explorer.allFunctions; +assert.equal(getProperty?.parameters.length, 2); +assert.equal(getProperty?.parameters[0].toString(), 'animal'); +assert.equal(getProperty?.parameters[1].toString(), 'propertyName'); ``` يجب أن تستخدم `getProperty` ترميز الأقواس للوصول إلى الخاصية. diff --git a/curriculum/challenges/arabic/blocks/workshop-wildlife-tracker/699a00de9f564bb0effaa14d.md b/curriculum/challenges/arabic/blocks/workshop-wildlife-tracker/699a00de9f564bb0effaa14d.md index 28cd4729869..08b0dc6c71d 100644 --- a/curriculum/challenges/arabic/blocks/workshop-wildlife-tracker/699a00de9f564bb0effaa14d.md +++ b/curriculum/challenges/arabic/blocks/workshop-wildlife-tracker/699a00de9f564bb0effaa14d.md @@ -44,8 +44,10 @@ assert.isFunction(getAge); يجب أن تحتوي دالة `getAge` على معلمة واحدة فقط، وهي `animal`. ```js -const regex = __helpers.functionRegex('getAge', ['animal']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { getAge } = explorer.allFunctions; +assert.equal(getAge?.parameters.length, 1); +assert.equal(getAge?.parameters[0].toString(), 'animal'); ``` يجب أن تصل دالة `getAge` إلى خاصية `age` باستخدام ترميز النقطة. diff --git a/curriculum/challenges/chinese-traditional/blocks/back-end-development-and-apis-projects/bd7158d8c443edefaeb5bd0f.md b/curriculum/challenges/chinese-traditional/blocks/back-end-development-and-apis-projects/bd7158d8c443edefaeb5bd0f.md index 17fa345e412..ec7eaa72bb9 100644 --- a/curriculum/challenges/chinese-traditional/blocks/back-end-development-and-apis-projects/bd7158d8c443edefaeb5bd0f.md +++ b/curriculum/challenges/chinese-traditional/blocks/back-end-development-and-apis-projects/bd7158d8c443edefaeb5bd0f.md @@ -50,15 +50,18 @@ dashedName: file-metadata-microservice 當你提交一個檔案時,你會在 JSON 回應中收到該檔案的 `name`、`type` 和以位元組為單位的 `size`。 ```js - const formData = new FormData(); - const fileData = await fetch( - 'https://cdn.freecodecamp.org/weather-icons/01d.png' - ); - const file = await fileData.blob(); - formData.append('upfile', file, 'icon'); + const boundary = 'fccBoundary1234567890'; + const head = + `--${boundary}\r\n` + + 'Content-Disposition: form-data; name="upfile"; filename="icon"\r\n' + + 'Content-Type: image/png\r\n\r\n'; + const body = new Blob([head, new Uint8Array(70), `\r\n--${boundary}--\r\n`]); const data = await fetch(code + '/api/fileanalyse', { method: 'POST', - body: formData + headers: { + 'Content-Type': `multipart/form-data; boundary=${boundary}` + }, + body }); const parsed = await data.json(); assert.property(parsed, 'size'); diff --git a/curriculum/challenges/chinese-traditional/blocks/daily-coding-challenges-javascript/6a26df3e2988bcdded204895.md b/curriculum/challenges/chinese-traditional/blocks/daily-coding-challenges-javascript/6a26df3e2988bcdded204895.md index 23067969e17..f20916d20c5 100644 --- a/curriculum/challenges/chinese-traditional/blocks/daily-coding-challenges-javascript/6a26df3e2988bcdded204895.md +++ b/curriculum/challenges/chinese-traditional/blocks/daily-coding-challenges-javascript/6a26df3e2988bcdded204895.md @@ -25,10 +25,10 @@ assert.equal(calculateHandicap([72, 72, 72], [72, 72, 72]), 0); assert.equal(calculateHandicap([80, 76, 78, 78], [72, 72, 72, 72]), 6); ``` -`calculateHandicap([42, 45, 46, 44], [36, 36, 36, 36])` 應該傳回 `8.3`。 +`calculateHandicap([42, 45, 46, 45], [36, 36, 36, 36])` 應該傳回 `8.5`。 ```js -assert.equal(calculateHandicap([42, 45, 46, 44], [36, 36, 36, 36]), 8.3); +assert.equal(calculateHandicap([42, 45, 46, 45], [36, 36, 36, 36]), 8.5); ``` `calculateHandicap([85, 80, 76, 79, 82], [72, 72, 72, 71, 71])` 應該傳回 `8.8`。 diff --git a/curriculum/challenges/chinese-traditional/blocks/daily-coding-challenges-python/6a26df3e2988bcdded204895.md b/curriculum/challenges/chinese-traditional/blocks/daily-coding-challenges-python/6a26df3e2988bcdded204895.md index 1c83d58b532..b0b5dfd470b 100644 --- a/curriculum/challenges/chinese-traditional/blocks/daily-coding-challenges-python/6a26df3e2988bcdded204895.md +++ b/curriculum/challenges/chinese-traditional/blocks/daily-coding-challenges-python/6a26df3e2988bcdded204895.md @@ -31,12 +31,12 @@ TestCase().assertEqual(calculate_handicap([80, 76, 78, 78], [72, 72, 72, 72]), 6 }}) ``` -`calculate_handicap([42, 45, 46, 44], [36, 36, 36, 36])` 應該傳回 `8.3`。 +`calculate_handicap([42, 45, 46, 45], [36, 36, 36, 36])` 應該傳回 `8.5`。 ```js ({test: () => { runPython(` from unittest import TestCase -TestCase().assertEqual(calculate_handicap([42, 45, 46, 44], [36, 36, 36, 36]), 8.3)`) +TestCase().assertEqual(calculate_handicap([42, 45, 46, 45], [36, 36, 36, 36]), 8.5)`) }}) ``` diff --git a/curriculum/challenges/chinese-traditional/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb928.md b/curriculum/challenges/chinese-traditional/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb928.md index 8dfd3a38345..27b90f11bd7 100644 --- a/curriculum/challenges/chinese-traditional/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb928.md +++ b/curriculum/challenges/chinese-traditional/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb928.md @@ -8,7 +8,7 @@ dashedName: mean-variance-standard-deviation-calculator # --description-- -你將會使用我們的 Ona 起始程式碼來進行這個專案。 +你將會使用我們的起始程式碼來進行這個專案。 我們仍在開發 Python 課程的互動教學零件。目前,這裡有一些 freeCodeCamp.org YouTube 頻道上的影片,將教你完成這個專案所需知道的一切: @@ -52,7 +52,8 @@ dashedName: mean-variance-standard-deviation-calculator ## 開發 -請將你的程式碼寫在 `mean_var_std.py`。在開發時,你可以使用 `main.py` 來測試你的程式碼。為了執行你的程式碼,請在 Ona 終端機輸入 `python3 main.py` 並按下 Enter。這將使內建的 CPython 直譯器執行 `main.py` 檔案。 +請在 `mean_var_std.py` 中撰寫你的程式碼。開發時,你可以使用 `main.py` 來測試你的程式碼。 +要執行你的程式碼,請在終端機輸入 `python3 main.py` 並按下 Enter 鍵。這會讓內建的 CPython 直譯器執行 `main.py` 檔案。 ## 測試 diff --git a/curriculum/challenges/chinese-traditional/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb929.md b/curriculum/challenges/chinese-traditional/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb929.md index 6340ffd060f..75ef2fa38da 100644 --- a/curriculum/challenges/chinese-traditional/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb929.md +++ b/curriculum/challenges/chinese-traditional/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb929.md @@ -8,7 +8,7 @@ dashedName: demographic-data-analyzer # --description-- -你將會使用我們的 Ona 起始程式碼來進行這個專案。 +你將會使用我們的起始程式碼來進行這個專案。 我們仍在開發 Python 課程的互動教學零件。目前,這裡有一些 freeCodeCamp.org YouTube 頻道上的影片,將教你完成這個專案所需知道的一切: diff --git a/curriculum/challenges/chinese-traditional/blocks/data-analysis-with-python-projects/5e46f7f8ac417301a38fb92a.md b/curriculum/challenges/chinese-traditional/blocks/data-analysis-with-python-projects/5e46f7f8ac417301a38fb92a.md index fa812b7c918..d14e661fd11 100644 --- a/curriculum/challenges/chinese-traditional/blocks/data-analysis-with-python-projects/5e46f7f8ac417301a38fb92a.md +++ b/curriculum/challenges/chinese-traditional/blocks/data-analysis-with-python-projects/5e46f7f8ac417301a38fb92a.md @@ -8,7 +8,7 @@ dashedName: medical-data-visualizer # --description-- -你將會使用我們的 Ona 起始程式碼來進行這個專案。 +你將會使用我們的起始程式碼來進行這個專案。 我們仍在開發 Python 課程的互動教學零件。目前,這裡有一些 freeCodeCamp.org YouTube 頻道上的影片,將教你完成這個專案所需知道的一切: @@ -26,20 +26,20 @@ dashedName: medical-data-visualizer 檔案名稱:medical_examination.csv -| Feature | Variable Type | Variable | Value Type | +| 特性 | 變數型別 | 變數 | 值型別 | |:-------:|:------------:|:-------------:|:----------:| -| Age | Objective Feature | `age` | int (days) | -| Height | Objective Feature | `height` | int (cm) | -| Weight | Objective Feature | `weight` | float (kg) | -| Gender | Objective Feature | `gender` | categorical code | -| Systolic blood pressure | Examination Feature | `ap_hi` | int | -| Diastolic blood pressure | Examination Feature | `ap_lo` | int | -| Cholesterol | Examination Feature | `cholesterol` | 1: normal, 2: above normal, 3: well above normal | -| Glucose | Examination Feature | `gluc` | 1: normal, 2: above normal, 3: well above normal | -| Smoking | Subjective Feature | `smoke` | binary | -| Alcohol intake | Subjective Feature | `alco` | binary | -| Physical activity | Subjective Feature | `active` | binary | -| Presence or absence of cardiovascular disease | Target Variable | `cardio` | binary | +| 年齡 | 客觀特性 | `age` | int(天) | +| 身高 | 客觀特性 | `height` | int(公分) | +| 體重 | 客觀特性 | `weight` | float(公斤) | +| 性別 | 客觀特性 | `gender` | 分類代碼 | +| 收縮壓 | 檢查特性 | `ap_hi` | int | +| 舒張壓 | 檢查特性 | `ap_lo` | int | +| 膽固醇 | 檢查特性 | `cholesterol` | 1:正常,2:高於正常,3:遠高於正常 | +| 葡萄糖 | 檢查特性 | `gluc` | 1:正常,2:高於正常,3:遠高於正常 | +| 吸菸 | 主觀特性 | `smoke` | 二進位 | +| 飲酒 | 主觀特性 | `alco` | 二進位 | +| 身體活動 | 主觀特性 | `active` | 二進位 | +| 心血管疾病有無 | 標的變數 | `cardio` | 二進位 | ## 說明 diff --git a/curriculum/challenges/chinese-traditional/blocks/data-analysis-with-python-projects/5e46f802ac417301a38fb92b.md b/curriculum/challenges/chinese-traditional/blocks/data-analysis-with-python-projects/5e46f802ac417301a38fb92b.md index bc8aaffce0d..4d77209bc57 100644 --- a/curriculum/challenges/chinese-traditional/blocks/data-analysis-with-python-projects/5e46f802ac417301a38fb92b.md +++ b/curriculum/challenges/chinese-traditional/blocks/data-analysis-with-python-projects/5e46f802ac417301a38fb92b.md @@ -8,7 +8,7 @@ dashedName: page-view-time-series-visualizer # --description-- -你將會使用我們的 Ona 起始程式碼來進行這個專案。 +你將會使用我們的起始程式碼來進行這個專案。 我們仍在開發 Python 課程的互動教學零件。目前,這裡有一些 freeCodeCamp.org YouTube 頻道上的影片,將教你完成這個專案所需知道的一切: diff --git a/curriculum/challenges/chinese-traditional/blocks/data-analysis-with-python-projects/5e4f5c4b570f7e3a4949899f.md b/curriculum/challenges/chinese-traditional/blocks/data-analysis-with-python-projects/5e4f5c4b570f7e3a4949899f.md index 63de5b26da9..4549a001234 100644 --- a/curriculum/challenges/chinese-traditional/blocks/data-analysis-with-python-projects/5e4f5c4b570f7e3a4949899f.md +++ b/curriculum/challenges/chinese-traditional/blocks/data-analysis-with-python-projects/5e4f5c4b570f7e3a4949899f.md @@ -8,7 +8,7 @@ dashedName: sea-level-predictor # --description-- -你將會使用我們的 Ona 起始程式碼來進行這個專案。 +你將會使用我們的起始程式碼來進行這個專案。 我們仍在開發 Python 課程的互動教學零件。目前,這裡有一些 freeCodeCamp.org YouTube 頻道上的影片,將教你完成這個專案所需知道的一切: diff --git a/curriculum/challenges/chinese-traditional/blocks/information-security-projects/5e46f979ac417301a38fb932.md b/curriculum/challenges/chinese-traditional/blocks/information-security-projects/5e46f979ac417301a38fb932.md index 8cb3f7f13a9..ba4b06b67b9 100644 --- a/curriculum/challenges/chinese-traditional/blocks/information-security-projects/5e46f979ac417301a38fb932.md +++ b/curriculum/challenges/chinese-traditional/blocks/information-security-projects/5e46f979ac417301a38fb932.md @@ -9,7 +9,7 @@ dashedName: port-scanner # --description-- -你將會使用我們的 Ona 起始程式碼來進行這個專案。 +你將會使用我們的起始程式碼來進行這個專案。 我們仍在開發 Python 課程的互動教學零件。目前,這裡有一些 freeCodeCamp.org YouTube 頻道上的影片,將教你完成這個專案所需知道的一切: diff --git a/curriculum/challenges/chinese-traditional/blocks/information-security-projects/5e46f983ac417301a38fb933.md b/curriculum/challenges/chinese-traditional/blocks/information-security-projects/5e46f983ac417301a38fb933.md index 2b5ceb12190..6343b82d7e0 100644 --- a/curriculum/challenges/chinese-traditional/blocks/information-security-projects/5e46f983ac417301a38fb933.md +++ b/curriculum/challenges/chinese-traditional/blocks/information-security-projects/5e46f983ac417301a38fb933.md @@ -9,7 +9,7 @@ dashedName: sha-1-password-cracker # --description-- -你將會使用我們的 Ona 起始程式碼來進行這個專案。 +你將會使用我們的起始程式碼來進行這個專案。 我們仍在開發 Python 課程的互動教學零件。目前,這裡有一些 freeCodeCamp.org YouTube 頻道上的影片,將教你完成這個專案所需知道的一切: diff --git a/curriculum/challenges/chinese-traditional/blocks/lab-availability-table/66b36358ed4f261d64840c24.md b/curriculum/challenges/chinese-traditional/blocks/lab-availability-table/66b36358ed4f261d64840c24.md index 4de4050234e..b76112e0ee0 100644 --- a/curriculum/challenges/chinese-traditional/blocks/lab-availability-table/66b36358ed4f261d64840c24.md +++ b/curriculum/challenges/chinese-traditional/blocks/lab-availability-table/66b36358ed4f261d64840c24.md @@ -12,18 +12,18 @@ demoType: onClick **使用者故事:** -1. 你的表格應該至少有三個行和五個列,包含標頭。 -1. 第一列的儲存格應該是包含一週中各天的表格標頭。 -1. 第一行的儲存格應該是具有 `class` 為 `time` 的表格標頭,並且其文字應包含時間值。 -1. 所有資料儲存格應該有 `class` 為 `available-#`,其中 `#` 是從 `0` 到 `5` 的數字,表示該時間可用的人數。 +1. 你的表格應該至少有三個行和五個列(包含標頭)。 +1. 第一列應該有包含一週中各天的表格標頭儲存格。 +1. 第一行應該有帶有 `class` 為 `time` 的表格標頭儲存格,並以時間值作為其文字。 +1. 所有資料儲存格應該有 `class` 為 `available-#`,其中 `#` 是從 `0` 到 `5` 的數字,表示該時間點可用的人數。 1. 你的表格應該有一個 `caption` 元素,文字為 `Weekly Meeting Availability Schedule`。 -1. 第一列(星期幾)的所有表格標頭儲存格應該有 `scope` 屬性,值為 `col`。 -1. 第一行(時間)的所有表格標頭儲存格應該有 `scope` 屬性,值為 `row`。 -1. 所有具有可用性類別的資料儲存格應該有一個 `aria-label` 屬性,描述可用性層級(例如,`available-0` 的儲存格為 `0 available`,`available-1` 的儲存格為 `1 available`,依此類推,`available-5` 的儲存格為 `5+ available`)。 -1. 在你的 `:root` 選擇器中,應定義六個 CSS 變數,名稱為 `--color#`,其中 `#` 是從 `0` 到 `5` 的數字,並為它們指定顏色值。使用這些變數來設定對應 `.available-#` 元素的背景色。 -1. 在你的 `:root` 選擇器中,應定義 CSS 變數 `--solid-border` 和 `--dashed-border`。使用這些變數來設定資料儲存格的底部邊框,根據列交替使用實線和虛線邊框。為列指定 `sharp` 或 `half` 類別來套用樣式。 +1. 第一列(星期幾)中所有的表格標頭儲存格應該有 `scope` 屬性,值為 `col`。 +1. 第一行(時間)中所有的表格標頭儲存格應該有 `scope` 屬性,值為 `row`。 +1. 所有帶有可用性類別的資料儲存格應該有一個 `aria-label` 屬性,描述可用性層級(例如,`available-0` 的儲存格為 `0 available`,`available-1` 的儲存格為 `1 available`,依此類推,`available-5` 的儲存格為 `5+ available`)。 +1. 在你的 `:root` 選擇器中,應該定義六個 CSS 變數,名稱為 `--color#`,其中 `#` 是從 `0` 到 `5` 的數字,並為它們指定顏色值。使用這些變數來設定對應 `.available-#` 元素的背景色。 +1. 在你的 `:root` 選擇器中,應該定義名為 `--solid-border` 和 `--dashed-border` 的 CSS 變數。使用這些變數來設定資料儲存格的底部邊框,根據列交替使用實線和虛線邊框。為列指定 `sharp` 或 `half` 類別以套用樣式。 1. 你應該有一個 `div` 元素,`id` 為 `legend`。它應包含一個文字為 `Availability` 的 `span` 元素,以及一個 `id` 為 `legend-gradient` 的 `div` 元素。 -1. 你應該為 `#legend-gradient` 元素設定一個線性漸層,從 `--color0` 到 `--color5` 的所有顏色之間以硬線過渡。 +1. 你應該為 `#legend-gradient` 元素設定線性漸層,從 `--color0` 到 `--color5` 的所有顏色之間以硬邊界過渡。 **注意:** 請務必在你的 HTML 中聯結你的樣式表以套用你的 CSS。 @@ -389,7 +389,7 @@ headers.forEach(header => { 第一行的所有表格標頭儲存格應該有 `scope` 屬性,值為 `row`。 ```js -const timeHeaders = [...document.querySelectorAll('tr > th:first-child')]; +const timeHeaders = [...document.querySelectorAll('th.time')]; assert.isNotEmpty(timeHeaders); timeHeaders.forEach(header => { assert.equal(header.getAttribute('scope'), 'row'); diff --git a/curriculum/challenges/chinese-traditional/blocks/lab-cargo-manifest-validator/69a56b5069ca99f7317e6e19.md b/curriculum/challenges/chinese-traditional/blocks/lab-cargo-manifest-validator/69a56b5069ca99f7317e6e19.md index 8b407d24cfe..8fd5e21fa53 100644 --- a/curriculum/challenges/chinese-traditional/blocks/lab-cargo-manifest-validator/69a56b5069ca99f7317e6e19.md +++ b/curriculum/challenges/chinese-traditional/blocks/lab-cargo-manifest-validator/69a56b5069ca99f7317e6e19.md @@ -11,10 +11,10 @@ dashedName: lab-cargo-manifest-validator 每個貨物清單將以物件形式表示,具有以下屬性: -- `containerId`:一個正整數,用來識別相關的貨物容器。 +- `containerId`:一個正整數,用來識別相關的貨櫃。 - `destination`:一個非空字串(去除空白後),表示貨物的標的目的地。 - `weight`:一個正數,代表貨物的重量。 -- `unit`:一個字串,描述貨物重量屬性的單位(要麼是 `"kg"` 表示公斤,要麼是 `"lb"` 表示磅)。 +- `unit`:一個字串,描述貨物 `weight` 屬性的單位(`"kg"` 表示公斤,`"lb"` 表示磅)。 - `hazmat`:一個布林值,表示是否需要危險物品處理。 貨物清單物件範例: @@ -33,14 +33,14 @@ dashedName: lab-cargo-manifest-validator **使用者故事:** -1. 你應該實作一個名為 `normalizeUnits` 的函式,帶有一個 `manifest` 參數。 - - 該函式不得修改原始的清單物件,且必須始終傳回一個新的物件,其中 `weight` 被標準化為公斤,且 `unit` 設為 `"kg"`。 - - 如果清單物件的重量是以磅(`unit: "lb"`)表示,函式應使用近似換算 1 lb = 0.45 kg 將 `weight` 轉換為公斤,並相應更新 `unit`。 - - 如果重量已經是以公斤(`unit: "kg"`)表示,則 `weight` 和 `unit` 應保持不變。 -2. 你應該實作一個名為 `validateManifest` 的函式,帶有一個 `manifest` 參數。 - - 該函式不得修改原始的清單物件,且必須始終傳回一個新的物件。 - - 如果輸入的清單有效(沒有遺漏或無效的屬性),函式應傳回一個空物件。 - - 如果輸入的清單無效,函式應傳回一個物件,包含每個遺漏或無效屬性的條目。遺漏的屬性值應為 `"Missing"`,無效的屬性值應為 `"Invalid"`。 +1. 你應該實作一個名為 `normalizeUnits` 的函式(程式),帶有一個 `manifest` 參數。 + - 該函式不得變更原始的 manifest 物件,且必須永遠傳回一個新的物件,其中 `weight` 已標準化為公斤,且 `unit` 設為 `"kg"`。 + - 如果 manifest 物件的 `weight` 是以磅表示(`unit: "lb"`),函式應使用近似換算 `1 lb = 0.45 kg` 將 `weight` 轉換為公斤,並相應更新 `unit`。 + - 如果 `weight` 已以公斤表示(`unit: "kg"`),則 `weight` 和 `unit` 應保持不變。 +2. 你應該實作一個名為 `validateManifest` 的函式(程式),帶有一個 `manifest` 參數。 + - 該函式不得變更原始的 manifest 物件,且必須永遠傳回一個新的物件。 + - 如果輸入的 manifest 是有效的(沒有遺漏或無效的屬性),函式應傳回一個空物件。 + - 如果輸入的 manifest 無效,函式應傳回一個物件,包含每個遺漏或無效屬性的條目。遺漏的屬性值為 `"Missing"`,無效的屬性值為 `"Invalid"`。 輸入物件遺漏 `destination` 屬性且 `weight` 屬性無效時的範例返回值: @@ -51,12 +51,13 @@ dashedName: lab-cargo-manifest-validator } ``` -3. 你應該實作一個名為 `processManifest` 的函式,帶有一個 `manifest` 參數。該函式應該記錄: - - 如果清單物件有效,先記錄 `Validation success: ${containerId}`,然後記錄該清單的公斤重量,格式為 `Total weight: ${weight} kg`。此轉換應使用 `normalizeUnits()`。 - - 如果清單物件無效,先記錄 `Validation error: ${containerId}`,然後記錄呼叫 `validateManifest()` 並傳入該清單物件所返回的物件。 - **注意:** 這兩種情況都應該有兩次 `console.log()` 呼叫。 +3. 你應該實作一個名為 `processManifest` 的函式(程式),帶有一個 `manifest` 參數。該函式應輸出日誌: + - 如果 manifest 物件有效,輸出 `Validation success: ${containerId}`,接著輸出以公斤表示的 manifest `weight`,格式為 `Total weight: ${weight} kg`。使用 `normalizeUnits()` 進行此轉換。 + - 如果 manifest 物件無效,輸出 `Validation error: ${containerId}`,接著輸出呼叫 `validateManifest()` 並傳入該 manifest 物件所返回的物件。 -**注意:** `normalizeUnits`、`validateManifest` 和 `processManifest` 都不應該用 `const` 宣告,因為測試需要重新指定它們。 +**注意:** 這兩種情況都應該有兩次 `console.log()` 呼叫。 + +**注意:** 不要使用 `const` 宣告 `normalizeUnits`、`validateManifest` 或 `processManifest`,因為測試需要重新指定它們。 # --before-each-- @@ -120,7 +121,7 @@ console.log = () => {}; # --hints-- -`normalizeUnits`、`validateManifest` 和 `processManifest` 都不應該用 `const` 宣告,因為測試需要重新指定它們。 +你不應該使用 `const` 宣告 `normalizeUnits`、`validateManifest` 或 `processManifest`,因為測試需要重新指定它們。 ```js assert.doesNotThrow(() => { @@ -140,12 +141,12 @@ assert.equal(params.length, 1); assert.equal(params[0].toString(), 'manifest'); ``` -呼叫 `normalizeUnits()` 並傳入 `{ containerId: 68, destination: "Salinas", weight: 101, unit: "lb", hazmat: true }` 應該傳回新的物件 `{ containerId: 68, destination: "Salinas", weight: 45.45, unit: "kg", hazmat: true }`,且不會修改原始輸入。 +當呼叫 `normalizeUnits` 函式並傳入 `{ containerId: 68, destination: "Salinas", weight: 101, unit: "lb", hazmat: true }` 時,該函式應傳回新的物件 `{ containerId: 68, destination: "Salinas", weight: 45.45, unit: "kg", hazmat: true }`,且不得變更原始物件。 ```js const testObj = { containerId: 68, - destination: "Salinas", + destination: "Salinas", weight: 101, unit: "lb", hazmat: true @@ -161,7 +162,7 @@ const expected = { const copy = normalizeUnits(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "normalizeUnits() did not return the expected normalized object"); +assert.deepEqual(copy, expected, "normalizeUnits() did not return the expected normalized object."); assert.notStrictEqual(copy, testObj, "normalizeUnits() should return a new object."); assert.strictEqual(testObj.containerId, 68, "Original object should not be mutated."); assert.strictEqual(testObj.destination, "Salinas", "Original object should not be mutated."); @@ -171,13 +172,13 @@ assert.strictEqual(testObj.hazmat, true, "Original object should not be mutated. assert.equal(Object.keys(testObj).length, 5, "Original object should not be mutated."); ``` -你的 `normalizeUnits` 函式應該傳回輸入清單物件的複本,並將其 `weight` 標準化為公斤,且將 `unit` 設為 `"kg"`。使用近似換算 `1 lb = 0.45 kg` 來進行重量轉換。 +你的 `normalizeUnits` 函式應傳回輸入 manifest 物件的複本,並將其 `weight` 標準化為公斤,`unit` 設為 `"kg"`。對 `weight` 的轉換應使用近似換算 `1 lb = 0.45 kg`。 ```js _validManifests.forEach((obj, i) => { const result = normalizeUnits(obj); - assert.isObject(result, "normalizeUnits should return an object"); - assert.notStrictEqual(result, obj, "normalizeUnits must return a new object, not modify the original"); + assert.isObject(result, "normalizeUnits() should return an object."); + assert.notStrictEqual(result, obj, "normalizeUnits() should return a new object, not mutate the original."); const expectedWeight = obj.unit === "lb" ? obj.weight * 0.45 : obj.weight; const expected = { ...obj, @@ -188,12 +189,12 @@ _validManifests.forEach((obj, i) => { assert.deepEqual( result, expected, - `normalizeUnits did not return the expected normalized object for manifest at index ${i}` + `normalizeUnits() did not return the expected normalized object for manifest at index ${i}.` ); }); ``` -你的 `normalizeUnits` 函式應該傳回輸入 `manifest` 物件的新複本,且不會修改原始物件。 +你的 `normalizeUnits` 函式應傳回輸入 manifest 物件的新複本,且不得變更原始物件。 ```js const original = { @@ -231,12 +232,12 @@ assert.equal(params.length, 1); assert.equal(params[0].toString(), 'manifest'); ``` -呼叫 `validateManifest()` 並傳入 `{ containerId: 1, destination: "Santa Cruz", weight: 304, unit: "kg", hazmat: false }` 應該傳回新的物件 `{}`。 +當呼叫 `validateManifest` 函式並傳入 `{ containerId: 1, destination: "Santa Cruz", weight: 304, unit: "kg", hazmat: false }` 時,該函式應傳回新的空物件 `{}`。 ```js const testObj = { containerId: 1, - destination: "Santa Cruz", + destination: "Santa Cruz", weight: 304, unit: "kg", hazmat: false @@ -246,16 +247,16 @@ const expected = {}; const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for a valid manifest"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.strictEqual(testObj.containerId, 1, "Original object should not be mutated"); -assert.strictEqual(testObj.destination, "Santa Cruz", "Original object should not be mutated"); -assert.strictEqual(testObj.weight, 304, "Original object should not be mutated"); -assert.strictEqual(testObj.unit, "kg", "Original object should not be mutated"); -assert.strictEqual(testObj.hazmat, false, "Original object should not be mutated"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for a valid manifest."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.strictEqual(testObj.containerId, 1, "Original object should not be mutated."); +assert.strictEqual(testObj.destination, "Santa Cruz", "Original object should not be mutated."); +assert.strictEqual(testObj.weight, 304, "Original object should not be mutated."); +assert.strictEqual(testObj.unit, "kg", "Original object should not be mutated."); +assert.strictEqual(testObj.hazmat, false, "Original object should not be mutated."); ``` -如果輸入的清單物件有效,你的 `validateManifest` 函式應該傳回空物件 `{}`。 +如果輸入的 manifest 物件有效,你的 `validateManifest` 函式應傳回空物件 `{}`。 ```js const solution = {}; @@ -268,7 +269,7 @@ for (const obj of _validManifests) { } ``` -呼叫 `validateManifest()` 並傳入 `{}` 應該傳回新的物件 `{ containerId: "Missing", destination: "Missing", weight: "Missing", unit: "Missing", hazmat: "Missing" }`,且不會修改原始輸入。 +當呼叫 `validateManifest` 函式並傳入空物件 `{}` 時,該函式應傳回新的物件 `{ containerId: "Missing", destination: "Missing", weight: "Missing", unit: "Missing", hazmat: "Missing" }`,且不得變更原始物件。 ```js const testObj = {}; @@ -283,12 +284,12 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for missing properties"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.equal(Object.keys(testObj).length, 0, "validateManifest() should return a new object, not mutate the original"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for missing properties."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.equal(Object.keys(testObj).length, 0, "validateManifest() should return a new object, not mutate the original."); ``` -呼叫 `validateManifest()` 並傳入 `{ containerId: null, destination: "Santa Cruz", weight: 304, unit: "kg", hazmat: false }` 應該傳回新的物件 `{ containerId: "Invalid" }`,且不會修改原始輸入。 +當呼叫 `validateManifest` 函式並傳入 `{ containerId: null, destination: "Santa Cruz", weight: 304, unit: "kg", hazmat: false }` 時,該函式應傳回新的物件 `{ containerId: "Invalid" }`,且不得變更原始物件。 ```js const testObj = { @@ -305,11 +306,11 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for null containerId"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for null containerId."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); ``` -呼叫 `validateManifest()` 並傳入 `{ containerId: 0, destination: 405, weight: -84, unit: "pounds", hazmat: "no" }` 應該傳回新的物件 `{ containerId: "Invalid", destination: "Invalid", weight: "Invalid", unit: "Invalid", hazmat: "Invalid" }`,且不會修改原始輸入。 +當呼叫 `validateManifest` 函式並傳入 `{ containerId: 0, destination: 405, weight: -84, unit: "pounds", hazmat: "no" }` 時,該函式應傳回新的物件 `{ containerId: "Invalid", destination: "Invalid", weight: "Invalid", unit: "Invalid", hazmat: "Invalid" }`,且不得變更原始物件。 ```js const testObj = { @@ -330,16 +331,16 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid properties"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.strictEqual(testObj.containerId, 0, "Original object should not be mutated"); -assert.strictEqual(testObj.destination, 405, "Original object should not be mutated"); -assert.strictEqual(testObj.weight, -84, "Original object should not be mutated"); -assert.strictEqual(testObj.unit, "pounds", "Original object should not be mutated"); -assert.strictEqual(testObj.hazmat, "no", "Original object should not be mutated"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid properties."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.strictEqual(testObj.containerId, 0, "Original object should not be mutated."); +assert.strictEqual(testObj.destination, 405, "Original object should not be mutated."); +assert.strictEqual(testObj.weight, -84, "Original object should not be mutated."); +assert.strictEqual(testObj.unit, "pounds", "Original object should not be mutated."); +assert.strictEqual(testObj.hazmat, "no", "Original object should not be mutated."); ``` -呼叫 `validateManifest()` 並傳入 `{ containerId: -2 }` 應該傳回新的物件 `{ containerId: "Invalid", destination: "Missing", weight: "Missing", unit: "Missing", hazmat: "Missing" }`,且不會修改原始輸入。 +當呼叫 `validateManifest` 函式並傳入 `{ containerId: -2 }` 時,該函式應傳回新的物件 `{ containerId: "Invalid", destination: "Missing", weight: "Missing", unit: "Missing", hazmat: "Missing" }`,且不得變更原始物件。 ```js const testObj = { @@ -356,13 +357,13 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.strictEqual(testObj.containerId, -2, "Original object should not be mutated"); -assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.strictEqual(testObj.containerId, -2, "Original object should not be mutated."); +assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated."); ``` -呼叫 `validateManifest()` 並傳入 `{ containerId: 3.50 }` 應該傳回新的物件 `{ containerId: "Invalid", destination: "Missing", weight: "Missing", unit: "Missing", hazmat: "Missing" }`,且不會修改原始輸入。你可以使用 `Number.isInteger()` 來驗證整數值。 +當呼叫 `validateManifest` 函式並傳入 `{ containerId: 3.50 }` 時,該函式應傳回新的物件 `{ containerId: "Invalid", destination: "Missing", weight: "Missing", unit: "Missing", hazmat: "Missing" }`,且不得變更原始物件。你可以使用 `Number.isInteger()` 來驗證整數值。 ```js const testObj = { @@ -379,13 +380,13 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.strictEqual(testObj.containerId, 3.50, "Original object should not be mutated"); -assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.strictEqual(testObj.containerId, 3.50, "Original object should not be mutated."); +assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated."); ``` -呼叫 `validateManifest()` 並傳入 `{ destination: " " }` 應該傳回新的物件 `{ containerId: "Missing", destination: "Invalid", weight: "Missing", unit: "Missing", hazmat: "Missing" }`,且不會修改原始輸入。你可以使用 `String.trim()` 來移除字串的空白。 +當呼叫 `validateManifest` 函式並傳入 `{ destination: " " }` 時,該函式應傳回新的物件 `{ containerId: "Missing", destination: "Invalid", weight: "Missing", unit: "Missing", hazmat: "Missing" }`,且不得變更原始物件。你可以使用 `.trim()` 來移除字串的空白。 ```js const testObj = { @@ -402,13 +403,13 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.strictEqual(testObj.destination, " ", "Original object should not be mutated"); -assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.strictEqual(testObj.destination, " ", "Original object should not be mutated."); +assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated."); ``` -呼叫 `validateManifest()` 並傳入 `{ weight: NaN }` 應該傳回新的物件 `{ containerId: "Missing", destination: "Missing", weight: "Invalid", unit: "Missing", hazmat: "Missing" }`,且不會修改原始輸入。你可以使用 `Number.isNaN()` 來驗證 NaN 值。 +當呼叫 `validateManifest` 函式並傳入 `{ weight: NaN }` 時,該函式應傳回新的物件 `{ containerId: "Missing", destination: "Missing", weight: "Invalid", unit: "Missing", hazmat: "Missing" }`,且不得變更原始物件。你可以使用 `Number.isNaN()` 來驗證 `NaN` 值。 ```js const testObj = { @@ -425,13 +426,13 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.ok(Number.isNaN(testObj.weight), "Original object should not be mutated"); -assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.ok(Number.isNaN(testObj.weight), "Original object should not be mutated."); +assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated."); ``` -如果輸入的清單物件無效,你的 `validateManifest` 函式應該傳回描述遺漏和/或無效屬性的物件。 +如果輸入的 manifest 物件無效,你的 `validateManifest` 函式應傳回描述遺漏和/或無效屬性的物件。 ```js const solutions = [ @@ -504,7 +505,7 @@ assert.equal(params.length, 1); assert.equal(params[0].toString(), 'manifest'); ``` -呼叫 `processManifest()` 並傳入 `{ containerId: 55, destination: "Carmel", weight: 400, unit: "lb", hazmat: false }` 應該先記錄 `"Validation success: 55"`,然後再記錄 `"Total weight: 180 kg"`。 +當呼叫 `processManifest` 函式並傳入 `{ containerId: 55, destination: "Carmel", weight: 400, unit: "lb", hazmat: false }` 時,該函式應先輸出 `Validation success: 55`,接著輸出 `Total weight: 180 kg`。 ```js const testObj = { @@ -524,8 +525,8 @@ try { ["Validation success: 55"], ["Total weight: 180 kg"] ]; - assert.deepEqual(spy.calls[0], expectedCalls[0], "First log should be the validation success message"); - assert.deepEqual(spy.calls[1], expectedCalls[1], "Second log should be the normalized weight in kg"); + assert.deepEqual(spy.calls[0], expectedCalls[0], "First log should be the validation success message."); + assert.deepEqual(spy.calls[1], expectedCalls[1], "Second log should be the normalized weight in kg."); } catch (err) { assert.fail(err); @@ -534,7 +535,7 @@ try { } ``` -如果輸入的清單物件有效,你的 `processManifest` 函式應該先記錄成功訊息 `Validation success: ${containerId}`。 +如果輸入的 manifest 物件有效,你的 `processManifest` 函式應先輸出成功訊息 `Validation success: ${containerId}`。 ```js const testObj = { @@ -562,7 +563,7 @@ try { } ``` -如果輸入的清單物件有效,你的 `processManifest` 函式應該使用 `normalizeUnits()` 將其標準化為公斤,然後記錄:`Total weight: ${weight} kg`。 +你的 `processManifest` 函式應使用 `normalizeUnits()` 將有效的輸入 manifest 物件標準化為公斤,然後輸出 `Total weight: ${weight} kg`。 ```js const testObj = { @@ -590,7 +591,7 @@ try { } ``` -如果輸入的清單物件有效,你的 `processManifest` 函式應該記錄帶有該物件 `containerId` 的成功訊息,然後記錄該物件的 `weight`(以公斤為單位)。你應該使用 `normalizeUnits()` 進行轉換,並有兩次 `console.log()` 呼叫。 +如果輸入的 manifest 物件有效,你的 `processManifest` 函式應輸出帶有物件 `containerId` 的成功訊息,接著輸出該物件以公斤表示的 `weight`。你應該使用 `normalizeUnits()` 進行轉換,且這應包含兩次 `console.log()` 呼叫。 ```js const originalNormalize = normalizeUnits; @@ -605,7 +606,7 @@ try { assert.isTrue( called, - "processManifest should call normalizeUnits() when the manifest is valid" + "processManifest() should call normalizeUnits() when the manifest is valid." ); } catch (err) { @@ -635,7 +636,7 @@ try { } ``` -呼叫 `processManifest()` 並傳入 `{ containerId: -88, destination: "Soledad", weight: NaN }` 應該先記錄 `Validation error: -88`,然後記錄物件 `{ containerId: "Invalid", weight: "Invalid", unit: "Missing", hazmat: "Missing" }`。 +當呼叫 `processManifest` 函式並傳入 `{ containerId: -88, destination: "Soledad", weight: NaN }` 時,該函式應先輸出 `Validation error: -88`,接著輸出物件 `{ containerId: "Invalid", weight: "Invalid", unit: "Missing", hazmat: "Missing" }`。 ```js const testObj = { @@ -658,8 +659,8 @@ try { }] ]; - assert.deepEqual(spy.calls[0], expectedCalls[0], "First log should be the validation error message"); - assert.deepEqual(spy.calls[1], expectedCalls[1], "Second log should be the validation result object"); + assert.deepEqual(spy.calls[0], expectedCalls[0], "First log should be the validation error message."); + assert.deepEqual(spy.calls[1], expectedCalls[1], "Second log should be the validation result object."); } catch (err) { assert.fail(err); @@ -668,7 +669,7 @@ try { } ``` -呼叫 `processManifest()` 並傳入 `{ destination: "Watsonville", hazmat: true }` 應該先記錄 `Validation error: undefined`,然後記錄物件 `{ containerId: "Missing", weight: "Missing", unit: "Missing" }`。 +當呼叫 `processManifest` 函式並傳入 `{ destination: "Watsonville", hazmat: true }` 時,該函式應先輸出 `Validation error: undefined`,接著輸出物件 `{ containerId: "Missing", weight: "Missing", unit: "Missing" }`。 ```js const testObj = { @@ -689,8 +690,8 @@ try { }] ]; - assert.deepEqual(spy.calls[0], expectedCalls[0], "First log should be the validation error message"); - assert.deepEqual(spy.calls[1], expectedCalls[1], "Second log should be the validation result object"); + assert.deepEqual(spy.calls[0], expectedCalls[0], "First log should be the validation error message."); + assert.deepEqual(spy.calls[1], expectedCalls[1], "Second log should be the validation result object."); } catch (err) { assert.fail(err); @@ -699,7 +700,7 @@ try { } ``` -如果輸入的清單物件無效,你的 `processManifest` 函式應該先記錄錯誤訊息 `Validation error: ${containerId}`。 +如果輸入的 manifest 物件無效,你的 `processManifest` 函式應先輸出錯誤訊息 `Validation error: ${containerId}`。 ```js const spy = __helpers.spyOn(console, "log"); @@ -718,13 +719,13 @@ try { assert.deepEqual(spy.calls[0], expectedCalls[0]); } catch (err) { - assert.fail(err); + assert.fail(err); } finally { spy.restore(); } ``` -如果輸入的清單物件無效,你的 `processManifest` 函式也應該記錄呼叫 `validateManifest()` 並傳入原始清單物件所返回的物件。直接呼叫 `console.log()` 並傳入該物件。 +如果輸入的 manifest 物件無效,你的 `processManifest` 函式還應輸出呼叫 `validateManifest()` 並傳入原始 manifest 物件所返回的物件。直接使用 `console.log()` 輸出該物件。 ```js const originalValidate = validateManifest; @@ -740,7 +741,7 @@ try { assert.isTrue( called, - "processManifest should call validateManifest() when the manifest is invalid" + "processManifest() should call validateManifest() when the manifest is invalid." ); } catch (err) { @@ -765,13 +766,13 @@ try { assert.deepEqual(spy.calls[1], expectedCalls[1]); } catch (err) { - assert.fail(err); + assert.fail(err); } finally { spy.restore(); } ``` -如果輸入的清單物件無效,你的 `processManifest` 函式應該記錄帶有該物件 `containerId` 的錯誤訊息,然後記錄呼叫 `validateManifest()` 並傳入輸入物件所返回的物件。這應該包含兩次 `console.log()` 呼叫。 +如果輸入的 manifest 物件無效,你的 `processManifest` 函式應先輸出帶有物件 `containerId` 的錯誤訊息,接著輸出呼叫 `validateManifest()` 並傳入該輸入物件所返回的物件。這應包含兩次 `console.log()` 呼叫。 ```js const originalValidate = validateManifest; @@ -787,7 +788,7 @@ try { assert.isTrue( called, - "processManifest should call validateManifest() when the manifest is invalid" + "processManifest() should call validateManifest() when the manifest is invalid." ); } catch (err) { @@ -812,7 +813,7 @@ try { assert.deepEqual(spy.calls, expectedCalls); } catch (err) { - assert.fail(err); + assert.fail(err); } finally { spy.restore(); } diff --git a/curriculum/challenges/chinese-traditional/blocks/lab-digital-pet-game/68c362b379059c388d3874f2.md b/curriculum/challenges/chinese-traditional/blocks/lab-digital-pet-game/68c362b379059c388d3874f2.md index 231089e07ca..1b3cdbebd06 100644 --- a/curriculum/challenges/chinese-traditional/blocks/lab-digital-pet-game/68c362b379059c388d3874f2.md +++ b/curriculum/challenges/chinese-traditional/blocks/lab-digital-pet-game/68c362b379059c388d3874f2.md @@ -9,7 +9,7 @@ saveSubmissionToDB: true # --description-- -**目標:** 完成以下使用者故事並通過所有測試以完成此實驗。 +**目標:** 完成以下使用者故事並通過所有測試以完成實驗。 **使用者故事:** @@ -60,6 +60,7 @@ saveSubmissionToDB: true ```js globalThis._PET_NAME = 'Fitzgerald'; globalThis._clock = __FakeTimers.install(); +window.fetch = () => Promise.resolve({ json: () => Promise.resolve('Cats sleep for around 13 to 16 hours a day.') }); ``` # --after-all-- diff --git a/curriculum/challenges/chinese-traditional/blocks/lab-fcc-forum-leaderboard/673c91f0b934834bc4a3ecc2.md b/curriculum/challenges/chinese-traditional/blocks/lab-fcc-forum-leaderboard/673c91f0b934834bc4a3ecc2.md index c4d9a6759e6..50c312385ce 100644 --- a/curriculum/challenges/chinese-traditional/blocks/lab-fcc-forum-leaderboard/673c91f0b934834bc4a3ecc2.md +++ b/curriculum/challenges/chinese-traditional/blocks/lab-fcc-forum-leaderboard/673c91f0b934834bc4a3ecc2.md @@ -50,7 +50,7 @@ API 端點會傳回如下格式的 JSON: 請注意,`avatar_template` 的值是相對路徑:它們以 `/` 開頭,並包含一個 `{size}` 佔位符,這個佔位符應該被像素大小取代。`avatarUrl` 常數儲存了當路徑為相對路徑時要加在前面的基礎 URL。 -**目標:** 請完成下方的使用者故事,並通過所有測試以完成本實驗。 +**目標:** 完成以下使用者故事並通過所有測試以完成實驗。 **使用者故事:** @@ -93,6 +93,68 @@ API 端點會傳回如下格式的 JSON: 1. `fetchData` 函式應該從 `forumLatest` 取得資料,並將解析為 JSON 的回應傳給 `showLatestPosts`。 1. 如果在取得資料時發生錯誤,`fetchData` 函式應該將錯誤記錄到主控台。你應該特別使用 `console.log` 來完成這件事。 +# --before-all-- + +```js +const _testUsers = [ + { + avatar_template: '/user_avatar/QuincyLarson_{size}.png', + id: 6, + name: 'Quincy Larson', + username: 'QuincyLarson' + }, + { + avatar_template: '/user_avatar/jwilkins.oboe_{size}.png', + id: 285941, + name: 'Jessica Wilkins', + username: 'jwilkins.oboe' + }, + { + avatar_template: '/user_avatar/ilenia_{size}.png', + id: 170865, + name: 'Ilenia', + username: 'ilenia' + } +]; + +const _testPosters = [ + { user_id: 6 }, + { user_id: 285941 }, + { user_id: 170865 } +]; + +const _testData = { + users: _testUsers, + topic_list: { + topics: [ + { + bumped_at: '2024-04-15T16:01:26.403Z', + category_id: 1, + id: 684569, + posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], + posts_count: 8, + slug: 'the-freecodecamp-podcast-is-back-now-with-video', + title: 'The freeCodeCamp Podcast is back – now with video', + views: 542 + }, + { + bumped_at: '2024-04-19T13:52:03.523Z', + category_id: 421, + id: 686149, + posters: [{ user_id: 170865 }], + posts_count: 1, + slug: 'problem-with-making-changes-to-styles-js', + title: 'Problem with making changes to styles. (JS)', + views: 9 + } + ] + } +}; + +window.fetch = () => + Promise.resolve({ json: () => Promise.resolve(_testData) }); +``` + # --hints-- 你應該有一個名為 `timeAgo` 的函式,該函式接受一個引數。 @@ -297,31 +359,8 @@ assert.lengthOf(avatars, 2); `avatars` 函式應該傳回一個字串,內容為將 `img` 元素串接而成,每個在使用者陣列中找到的發文者各有一個。 ```js -const posters = [{ user_id: 6 }, { user_id: 285941 }, { user_id: 170865 }]; -const users = [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - }, - { id: 20 } -]; +const posters = _testPosters; +const users = [..._testUsers, { id: 20 }]; const actual = avatars(posters, users); const matches = actual.match(/<\s*img\s+.+?>/g); assert.lengthOf(matches, 3); @@ -330,31 +369,8 @@ assert.lengthOf(matches, 3); `avatars` 函式傳回的字串中,每個 `img` 元素都應該有一個 `alt` 文字,值為發文者的 `name` 屬性。 ```js -const posters = [{ user_id: 6 }, { user_id: 285941 }, { user_id: 170865 }]; -const users = [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - }, - { id: 20 } -]; +const posters = _testPosters; +const users = [..._testUsers, { id: 20 }]; const actual = avatars(posters, users); const matches = actual.match(/<\s*img\s+.+?>/g); @@ -366,31 +382,8 @@ assert.match(matches[2], /alt=('|")Ilenia\1/); `avatars` 函式應該透過存取 `avatar_template` 屬性,並將 `{size}` 取代為 `30`,來設定每個頭像的大小。 ```js -const posters = [{ user_id: 6 }, { user_id: 285941 }, { user_id: 170865 }]; -const users = [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - }, - { id: 20 } -]; +const posters = _testPosters; +const users = [..._testUsers, { id: 20 }]; const actual = avatars(posters, users); assert.notMatch(actual, /\{size\}/); assert.lengthOf(actual.match(/_30/g), 3); @@ -399,31 +392,8 @@ assert.lengthOf(actual.match(/_30/g), 3); 每個 `img` 元素都應該有一個 `src` 屬性,值為對應使用者的 `avatar_template`。如果 `avatar_template` 以 `/` 開頭,則直接在前面加上 `avatarUrl`。 ```js -const posters = [{ user_id: 6 }, { user_id: 285941 }, { user_id: 170865 }]; -const users = [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - }, - { id: 20 } -]; +const posters = _testPosters; +const users = [..._testUsers, { id: 20 }]; const actual = avatars(posters, users); const matches = actual.match(/<\s*img\s+.+?>/g); @@ -458,19 +428,15 @@ assert.isFunction(fetchData); 你的 `fetchData` 函式應該從 `https://cdn.freecodecamp.org/curriculum/forum-latest/latest.json` 取得資料。 ```js -const testArr = []; -const temp = fetch; +const spy = __helpers.spyOn(window, 'fetch'); try { - fetch = source => { - testArr.push(source); - return temp(source); - }; fetchData(); - assert.deepEqual(testArr, [ + assert.include( + spy.calls.map(call => call[0]), 'https://cdn.freecodecamp.org/curriculum/forum-latest/latest.json' - ]); + ); } finally { - fetch = temp; + spy.restore(); } ``` @@ -521,55 +487,7 @@ async () => { `showLatestPosts` 應該將 `#posts-container` 的 inner HTML 設為一個字串,內容為將 `tr` 元素串接而成,每個 `topics` 項目各有一個。 ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const pContainer = document.getElementById('posts-container'); pContainer.innerHTML = ''; showLatestPosts(data); @@ -579,55 +497,7 @@ assert.lengthOf(pContainer.querySelectorAll('tr'), 2); `showLatestPosts` 傳回的字串中,每個 `tr` 元素都應該包含 5 個 `td` 元素。 ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const pContainer = document.getElementById('posts-container'); pContainer.innerHTML = ''; showLatestPosts(data); @@ -638,55 +508,7 @@ assert.lengthOf(pContainer.querySelectorAll('tr:last-child>td'), 5); `showLatestPosts` 傳回的每一個表格列的第一個 `td` 元素都應該包含兩個錨點元素,第一個 class 為 `post-title`,`href` 為 `/`,錨點文字為 ``,第二個則是呼叫 `forumCategory` 並傳入 `category_id` 得到。 ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const pContainer = document.getElementById('posts-container'); pContainer.innerHTML = ''; showLatestPosts(data); @@ -731,55 +553,7 @@ assert.equal( `showLatestPosts` 傳回的每一個表格列的第二個 `td` 元素都應該包含呼叫 `avatars` 並傳入 `posters` 和 `users` 得到的圖片,這些圖片應該巢狀在一個 class 為 `avatar-container` 的 `div` 元素中。 ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const pContainer = document.getElementById('posts-container'); pContainer.innerHTML = ''; showLatestPosts(data); @@ -820,55 +594,7 @@ assert.equal(imgs2[0].alt, 'Ilenia'); `showLatestPosts` 傳回的每一個表格列的第三個 `td` 元素都應該包含該貼文的回覆數。_提示:_ 請使用 `posts_count - 1`。 ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const pContainer = document.getElementById('posts-container'); pContainer.innerHTML = ''; showLatestPosts(data); @@ -887,55 +613,7 @@ assert.equal( `showLatestPosts` 傳回的每一個表格列的第四個 `td` 元素都應該包含該貼文的瀏覽次數。 ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const pContainer = document.getElementById('posts-container'); pContainer.innerHTML = ''; showLatestPosts(data); @@ -954,55 +632,7 @@ assert.equal( `showLatestPosts` 傳回的每一個表格列的第五個 `td` 元素都應該包含自上次活動以來經過的時間,這個時間是使用 `timeAgo` 函式產生的。 ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const calcTime = time => { const currentTime = new Date(); const lastPost = new Date(time); diff --git a/curriculum/challenges/chinese-traditional/blocks/lab-javascript-trivia-bot/66ed41f912d0bb1dc62da5dd.md b/curriculum/challenges/chinese-traditional/blocks/lab-javascript-trivia-bot/66ed41f912d0bb1dc62da5dd.md index 8a2a50e00f4..aed2db21454 100644 --- a/curriculum/challenges/chinese-traditional/blocks/lab-javascript-trivia-bot/66ed41f912d0bb1dc62da5dd.md +++ b/curriculum/challenges/chinese-traditional/blocks/lab-javascript-trivia-bot/66ed41f912d0bb1dc62da5dd.md @@ -11,17 +11,17 @@ dashedName: lab-javascript-trivia-bot **使用者故事:** -1. 你應該將 `"Hello! I'm your coding fun fact guide!"` 記錄到主控台,作為對使用者的問候訊息。 -1. 你應該創建三個變數:`botName`、`botLocation` 和 `favoriteLanguage`,分別用來儲存機器人的名稱、來源地點和最喜歡的程式語言。 -1. 你應該將 `"My name is (botName) and I live on (botLocation)."` 記錄到主控台。 -1. 你應該將 `"My favorite programming language is (favoriteLanguage)."` 記錄到主控台。 -1. 你應該使用 `let` 來創建一個 `codingFact` 變數,並指定一個字串,該字串是關於你機器人最喜愛的程式語言的有趣事實,且包含 `favoriteLanguage` 變數的使用。 -1. 你應該將 `codingFact` 記錄到主控台。 -1. 你應該再次使用 `favoriteLanguage` 變數,將 `codingFact` 變數指定為關於機器人最愛語言的新事實。 -1. 你應該再次將 `codingFact` 記錄到主控台。 -1. 你應該再次將 `codingFact` 變數指定為關於機器人最愛語言的另一個新事實,並使用 `favoriteLanguage` 變數。 -1. 你應該第三次將 `codingFact` 記錄到主控台。 -1. 你應該將 `"It was fun sharing these facts with you. Goodbye! - (botName) from (botLocation)."` 記錄到主控台,作為機器人的告別述語。 +1. 你應該在主控台輸出 `"Hello! I'm your coding fun fact guide!"` 作為對使用者的問候訊息。 +1. 你應該創建三個變數:`botName`、`botLocation` 和 `favoriteLanguage`,分別用來儲存機器人的名字、來自哪裡,以及它最喜歡的程式設計語言。 +1. 你應該在主控台輸出 `"My name is (botName) and I live on (botLocation)."`。 +1. 你應該在主控台輸出 `"My favorite programming language is (favoriteLanguage)."`。 +1. 你應該使用 `let` 創建一個 `codingFact` 變數,並指定一個字串,內容是關於機器人最喜歡的程式設計語言的有趣事實,使用 `favoriteLanguage` 變數。 +1. 你應該在主控台輸出 `codingFact`。 +1. 你應該重新指定 `codingFact` 變數為另一個關於機器人最喜歡的程式設計語言的新事實,再次使用 `favoriteLanguage` 變數。 +1. 你應該再次在主控台輸出 `codingFact`。 +1. 你應該第三次重新指定 `codingFact` 變數為關於機器人最喜歡的程式設計語言的第三個事實,再次使用 `favoriteLanguage` 變數。 +1. 你應該第三次在主控台輸出 `codingFact`。 +1. 你應該在主控台輸出 `"It was fun sharing these facts with you. Goodbye! - (botName) from (botLocation)."`,作為機器人的告別語。 # --before-each-- @@ -162,7 +162,7 @@ let codingFact = "Did you know that " + favoriteLanguage + " was created in just console.log(codingFact); -codingFact = "Another fun fact: " + favoriteLanguage + "was originally called Mocha!"; +codingFact = "Another fun fact: " + favoriteLanguage + " was originally called Mocha!"; console.log(codingFact); diff --git a/curriculum/challenges/chinese-traditional/blocks/lab-mood-board/673b3d6b7ef7318eef926d5a.md b/curriculum/challenges/chinese-traditional/blocks/lab-mood-board/673b3d6b7ef7318eef926d5a.md index 869365435be..7a1e4aade88 100644 --- a/curriculum/challenges/chinese-traditional/blocks/lab-mood-board/673b3d6b7ef7318eef926d5a.md +++ b/curriculum/challenges/chinese-traditional/blocks/lab-mood-board/673b3d6b7ef7318eef926d5a.md @@ -16,16 +16,16 @@ demoType: onClick **使用者故事:** -1. 你應該創建並匯出一個 `MoodBoardItem` 組件,該組件接受三個 props:`color`、`image` 和 `description`。 -2. 你的 `MoodBoardItem` 組件應該傳回一個帶有類別 `mood-board-item` 的 `div` 作為其頂層元素。 +1. 你應該創建並匯出一個 `MoodBoardItem` 組件,它接受三個屬性:`color`、`image` 和 `description`。 +2. 你的 `MoodBoardItem` 組件應該傳回一個頂層元素為帶有 `mood-board-item` 類別的 `div`。 3. 你應該使用行內樣式將 `.mood-board-item` 元素的背景顏色設為 `color` 屬性的值。 -4. 你應該在 `.mood-board-item` 元素內,算繪一個 `img` 元素,該元素具有 `mood-board-image` 類別,且其 `src` 屬性設為 `image` prop 的值。 -5. 你應該在 `.mood-board-item` 項目內,算繪一個 `h3` 元素,該元素具有 `mood-board-text` 類別,且其文字為 `description` prop 的值。 -6. 你應該創建並匯出一個 `MoodBoard`。 -7. 你的 `MoodBoard` 組件應該傳回一個 `div` 作為其頂層元素。 -8. 你的 `MoodBoard` 組件應該呈現一個帶有 `mood-board-heading` 類別和文字 `Destination Mood Board` 的 `h1` 元素。 -9. 你的 `MoodBoard` 組件應該呈現一個具有 `mood-board` 類別的 `div`。 -10. 你的 `MoodBoard` 組件應該在 `.mood-board` 元素內至少呈現三個 `MoodBoardItem` 組件,每個都應該傳遞具有有效值的 `color`、`image` 和 `description` props。 +4. 你應該在 `.mood-board-item` 元素內呈現一個 `img` 元素,該元素帶有 `mood-board-image` 類別,且其 `src` 屬性設為 `image` 屬性的值。 +5. 你應該在 `.mood-board-item` 元素內呈現一個 `h3` 元素,該元素帶有 `mood-board-text` 類別,且其文字設為 `description` 屬性的值。 +6. 你應該創建並匯出一個 `MoodBoard` 組件。 +7. 你的 `MoodBoard` 組件應該傳回一個 `div` 作為頂層元素。 +8. 你的 `MoodBoard` 組件應該呈現一個帶有 `mood-board-heading` 類別且文字為 `Destination Mood Board` 的 `h1` 元素。 +9. 你的 `MoodBoard` 組件應該呈現一個帶有 `mood-board` 類別的 `div`。 +10. 你的 `MoodBoard` 組件應該在 `.mood-board` 元素內至少呈現三個 `MoodBoardItem` 組件,每個組件都應該傳入有效的 `color`、`image` 和 `description` 屬性值。 如果你願意,可以在你的 Mood Board 中使用以下影像。 @@ -41,10 +41,10 @@ demoType: onClick 你應該匯出一個 `MoodBoardItem` 組件。 ```js -assert.isFunction(window.index.MoodBoardItem, 1); +assert.isFunction(window.index.MoodBoardItem); ``` -你的 `MoodBoardItem` 組件應該在其頂層元素傳回一個具有 `mood-board-item` 類別的 `div`。 +你的 `MoodBoardItem` 組件應該傳回一個頂層元素為帶有 `mood-board-item` 類別的 `div`。 ```js const item = document.getElementsByClassName('mood-board-item')[0]; @@ -52,7 +52,7 @@ assert.exists(item); assert.equal(item.tagName, 'DIV'); ``` -`.mood-board-item` 元素的背景顏色應該使用行內樣式設定為 `color` 屬性的值。 +你應該使用行內樣式將 `.mood-board-item` 元素的背景顏色設為 `color` 屬性的值。 ```js const container = await __helpers.prepTestComponent(window.index.MoodBoardItem, { color: "red" }); @@ -83,7 +83,7 @@ assert.equal(item.tagName, 'DIV'); 你應該匯出一個 `MoodBoard` 組件。 ```js -assert.isFunction(window.index.MoodBoard, 1); +assert.isFunction(window.index.MoodBoard); ``` 你的 `MoodBoard` 組件應該傳回一個 `div` 作為其頂層元素。 @@ -102,7 +102,15 @@ assert.equal(heading.tagName, 'H1'); assert.equal(heading.textContent, 'Destination Mood Board'); ``` -你的 `MoodBoard` 組件應該至少呈現三個 `MoodBoardItem` 組件,每個都應該傳遞具有有效值的 `color`、`image` 和 `description` 屬性。 +你的 `MoodBoard` 組件應該呈現一個帶有 `mood-board` 類別的 `div`。 + +```js +const moodboard = document.getElementsByClassName('mood-board')[0]; +assert.exists(moodboard); +assert.equal(moodboard.tagName, 'DIV'); +``` + +你的 `MoodBoard` 組件應該在 `.mood-board` 元素內至少呈現三個 `MoodBoardItem` 組件,每個組件都應該傳入有效的 `color`、`image` 和 `description` 屬性值。 ```js const moodboard = document.getElementsByClassName('mood-board')[0]; diff --git a/curriculum/challenges/chinese-traditional/blocks/lab-motorcycle-shop/694175528a794a090ea0ba74.md b/curriculum/challenges/chinese-traditional/blocks/lab-motorcycle-shop/694175528a794a090ea0ba74.md index 5e80abfdf5a..0c4a48dd2b0 100644 --- a/curriculum/challenges/chinese-traditional/blocks/lab-motorcycle-shop/694175528a794a090ea0ba74.md +++ b/curriculum/challenges/chinese-traditional/blocks/lab-motorcycle-shop/694175528a794a090ea0ba74.md @@ -1,6 +1,6 @@ --- id: 694175528a794a090ea0ba74 -title: Build a Motorcycle Shop +title: 建置一間機車商店 challengeType: 25 dashedName: lab-motorcycle-shop demoType: onClick @@ -35,6 +35,291 @@ demoType: onClick 7. 顯示的 `Motorcycle` 元素數量應該列在 id 為 `results-number` 的元素內。 8. 篩選器應該在 `input` 事件時更新。 +# --before-all-- + +```js +const _testMotorcycles = [ + { + id: '1', + name: 'Ninja H2', + manufacturer: 'Kawasaki', + category: 'Sport', + price: 29000, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-vmoto-stash.jpg', + description: 'Supercharged hypersport with unmatched power', + year: 2024, + created_at: '2024-01-01T00:00:00Z' + }, + { + id: '2', + name: 'Street Triple RS', + manufacturer: 'Triumph', + category: 'Naked', + price: 13500, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-r3.png', + description: 'Agile naked bike with triple-cylinder perfection', + year: 2024, + created_at: '2024-01-02T00:00:00Z' + }, + { + id: '3', + name: 'R1250 GS Adventure', + manufacturer: 'BMW', + category: 'Adventure', + price: 21995, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-vmoto-stash.jpg', + description: 'The ultimate adventure touring machine', + year: 2024, + created_at: '2024-01-03T00:00:00Z' + }, + { + id: '4', + name: 'Panigale V4', + manufacturer: 'Ducati', + category: 'Sport', + price: 28395, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-kawasaki-zx10r.png', + description: 'Italian superbike engineering at its finest', + year: 2024, + created_at: '2024-01-04T00:00:00Z' + }, + { + id: '5', + name: 'Road Glide Special', + manufacturer: 'Harley-Davidson', + category: 'Cruiser', + price: 29999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-vmax.jpg', + description: 'Classic American touring with modern tech', + year: 2024, + created_at: '2024-01-05T00:00:00Z' + }, + { + id: '6', + name: 'MT-09', + manufacturer: 'Yamaha', + category: 'Naked', + price: 9999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-mt7.jpg', + description: 'Lightweight naked bike with crossplane power', + year: 2024, + created_at: '2024-01-06T00:00:00Z' + }, + { + id: '7', + name: 'Africa Twin', + manufacturer: 'Honda', + category: 'Adventure', + price: 14599, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-honda-africa.jpg', + description: 'Legendary adventure bike reborn for modern times', + year: 2024, + created_at: '2024-01-07T00:00:00Z' + }, + { + id: '8', + name: 'Super Duke R', + manufacturer: 'KTM', + category: 'Naked', + price: 18999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-suzuki-sv650.jpg', + description: 'The Beast returns with 180hp of raw power', + year: 2024, + created_at: '2024-01-08T00:00:00Z' + }, + { + id: '9', + name: 'GSX-R1000R', + manufacturer: 'Suzuki', + category: 'Sport', + price: 17199, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-suzuki-gsxr1000.jpg', + description: 'Track-ready sportbike with championship DNA', + year: 2024, + created_at: '2024-01-09T00:00:00Z' + }, + { + id: '10', + name: 'Street Glide', + manufacturer: 'Harley-Davidson', + category: 'Cruiser', + price: 21999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-vmax.jpg', + description: 'Milwaukee-Eight power in a sleek bagger', + year: 2024, + created_at: '2024-01-10T00:00:00Z' + }, + { + id: '11', + name: 'Z H2', + manufacturer: 'Kawasaki', + category: 'Naked', + price: 17000, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-kawasaki-zh2.jpg', + description: 'Supercharged naked bike mayhem', + year: 2024, + created_at: '2024-01-11T00:00:00Z' + }, + { + id: '12', + name: 'Multistrada V4', + manufacturer: 'Ducati', + category: 'Adventure', + price: 22995, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-mt3.jpg', + description: 'Italian style meets adventure capability', + year: 2024, + created_at: '2024-01-12T00:00:00Z' + }, + { + id: '13', + name: 'Speed Triple 1200', + manufacturer: 'Triumph', + category: 'Naked', + price: 16500, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-honda-transalp.jpg', + description: 'British muscle bike with cutting-edge tech', + year: 2024, + created_at: '2024-01-13T00:00:00Z' + }, + { + id: '14', + name: 'S1000RR', + manufacturer: 'BMW', + category: 'Sport', + price: 17295, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-kawasaki-z900a1.jpg', + description: 'German precision in a superbike package', + year: 2024, + created_at: '2024-01-14T00:00:00Z' + }, + { + id: '15', + name: 'MT-07', + manufacturer: 'Yamaha', + category: 'Naked', + price: 7999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-mt7.jpg', + description: 'Best-selling parallel twin for pure fun', + year: 2024, + created_at: '2024-01-15T00:00:00Z' + }, + { + id: '16', + name: 'V-Strom 1050', + manufacturer: 'Suzuki', + category: 'Adventure', + price: 13799, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-benelli-trk702.png', + description: 'Reliable adventure touring on a budget', + year: 2024, + created_at: '2024-01-16T00:00:00Z' + }, + { + id: '17', + name: 'Sportster S', + manufacturer: 'Harley-Davidson', + category: 'Cruiser', + price: 15999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-r3.png', + description: 'Revolution Max engine in a modern cruiser', + year: 2024, + created_at: '2024-01-17T00:00:00Z' + }, + { + id: '18', + name: 'CBR1000RR-R', + manufacturer: 'Honda', + category: 'Sport', + price: 28500, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-honda-cbr500.png', + description: 'Honda racing technology for the street', + year: 2024, + created_at: '2024-01-18T00:00:00Z' + }, + { + id: '19', + name: 'Tiger 900', + manufacturer: 'Triumph', + category: 'Adventure', + price: 14400, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-triumph-tiger900.png', + description: 'Middleweight adventure excellence', + year: 2024, + created_at: '2024-01-19T00:00:00Z' + }, + { + id: '20', + name: '890 Duke R', + manufacturer: 'KTM', + category: 'Naked', + price: 11999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-kawasaki-zx10r.png', + description: 'The Scalpel - precise handling perfection', + year: 2024, + created_at: '2024-01-20T00:00:00Z' + }, + { + id: '21', + name: 'Ninja 400', + manufacturer: 'Kawasaki', + category: 'Sport', + price: 5299, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-vmoto-stash.jpg', + description: 'Perfect entry-level sportbike', + year: 2024, + created_at: '2024-01-21T00:00:00Z' + }, + { + id: '22', + name: 'Scrambler 1200', + manufacturer: 'Triumph', + category: 'Adventure', + price: 13250, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-ducati-scrambler.jpg', + description: 'Modern classic with off-road capability', + year: 2024, + created_at: '2024-01-22T00:00:00Z' + }, + { + id: '23', + name: 'Monster Plus', + manufacturer: 'Ducati', + category: 'Naked', + price: 14295, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-kawasaki-zx10r.png', + description: 'Evolved Monster with V-twin soul', + year: 2024, + created_at: '2024-01-23T00:00:00Z' + }, + { + id: '24', + name: 'CB650R', + manufacturer: 'Honda', + category: 'Naked', + price: 9199, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-kawasaki-z900.png', + description: 'Neo Sports Café styling with inline-four power', + year: 2024, + created_at: '2024-01-24T00:00:00Z' + }, + { + id: '25', + name: 'Low Rider S', + manufacturer: 'Harley-Davidson', + category: 'Cruiser', + price: 17999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-suzuki-vstorm650.jpg', + description: 'Blacked-out cruiser with attitude', + year: 2024, + created_at: '2024-01-25T00:00:00Z' + } +]; + +window.fetch = () => + Promise.resolve({ json: () => Promise.resolve(_testMotorcycles) }); +``` + # --hints-- 你應該有一個名為 `type` 的 `Category`。 @@ -84,16 +369,24 @@ assert.isFunction(fetchMotorcycles); ```js const spy = __helpers.spyOn(window, 'fetch'); -const motorcycles = await fetchMotorcycles(); -assert.strictEqual(spy.calls[0][0].trim(),"https://cdn.freecodecamp.org/curriculum/labs/data/motorcycles.json"); +try { + await fetchMotorcycles(); + assert.strictEqual(spy.calls[0][0].trim(),"https://cdn.freecodecamp.org/curriculum/labs/data/motorcycles.json"); +} finally { + spy.restore(); +} ``` 你應該從 `Motorcycle` 傳回一個包含 25 個 `fetchMotorcycles` 物件的 Promise。 ```js const spy = __helpers.spyOn(window, 'fetch'); -const motorcycles = await fetchMotorcycles(); -assert.lengthOf(motorcycles,25); +try { + const motorcycles = await fetchMotorcycles(); + assert.lengthOf(motorcycles,25); +} finally { + spy.restore(); +} ``` 你應該有一個名為 `renderMotorcycleCard` 的函式(程式)。 diff --git a/curriculum/challenges/chinese-traditional/blocks/lab-nth-fibonacci-number-js/7a97b79c096ecb000d03bd36.md b/curriculum/challenges/chinese-traditional/blocks/lab-nth-fibonacci-number-js/7a97b79c096ecb000d03bd36.md index 73fce5b347a..c8f0197c1f1 100644 --- a/curriculum/challenges/chinese-traditional/blocks/lab-nth-fibonacci-number-js/7a97b79c096ecb000d03bd36.md +++ b/curriculum/challenges/chinese-traditional/blocks/lab-nth-fibonacci-number-js/7a97b79c096ecb000d03bd36.md @@ -1,6 +1,6 @@ --- id: 7a97b79c096ecb000d03bd36 -title: Build an Nth Fibonacci Number Calculator +title: 建置一個第 N 個費氏數列計算器 challengeType: 26 dashedName: build-an-nth-fibonacci-number-calculator --- @@ -9,7 +9,7 @@ dashedName: build-an-nth-fibonacci-number-calculator **目標:** 完成以下使用者故事並通過所有測試以完成實驗。 -**User Stories:** +**使用者故事:** 1. 你應該創建一個名為 `fibonacci` 的函式。 2. 你應該在 `sequence` 函式內定義一個名為 `fibonacci` 的陣列,並將其初始化為 `[0, 1]` 的值。 @@ -19,68 +19,73 @@ dashedName: build-an-nth-fibonacci-number-calculator # --hints-- -你應該有一個名為 `fibonacci` 的函式。 +你應該有一個名為 `fibonacci` 的函式(程式)。 ```js -assert.isFunction(fibonacci); +const explorer = await __helpers.Explorer(code); +assert.exists(explorer.allFunctions.fibonacci); ``` -你的 `fibonacci` 函式應接受一個參數。 +你的 `fibonacci` 函式應該接受一個單一參數。 ```js -const params = __helpers.getFunctionParams(fibonacci.toString()); -assert.equal(params.length, 1); +const explorer = await __helpers.Explorer(code); +const { fibonacci } = explorer.allFunctions; +assert.equal(fibonacci?.parameters.length, 1); ``` 你應該在 `sequence` 函式內有一個名為 `fibonacci` 的陣列,並初始化為 `[0, 1]`。 ```js -assert.match(__helpers.removeJSComments(fibonacci.toString()), /(const|let|var)\s+sequence\s*=\s*\[\s*0\s*,\s*1\s*\]/); +const explorer = await __helpers.Explorer(code); +const { fibonacci } = explorer.allFunctions; +const { sequence } = fibonacci?.variables ?? {}; +assert.isTrue(sequence?.value.matches('[0, 1]')); ``` -`fibonacci(0)` 應傳回 `0`。 +`fibonacci(0)` 應該傳回 `0`。 ```js assert.equal(fibonacci(0), 0); ``` -`fibonacci(1)` 應傳回 `1`。 +`fibonacci(1)` 應該傳回 `1`。 ```js assert.equal(fibonacci(1), 1); ``` -`fibonacci(2)` 應傳回 `1`。 +`fibonacci(2)` 應該傳回 `1`。 ```js assert.equal(fibonacci(2), 1); ``` -`fibonacci(3)` 應傳回 `2`。 +`fibonacci(3)` 應該傳回 `2`。 ```js assert.equal(fibonacci(3), 2); ``` -`fibonacci(5)` 應傳回 `5`。 +`fibonacci(5)` 應該傳回 `5`。 ```js assert.equal(fibonacci(5), 5); ``` -`fibonacci(10)` 應傳回 `55`。 +`fibonacci(10)` 應該傳回 `55`。 ```js assert.equal(fibonacci(10), 55); ``` -`fibonacci(15)` 應傳回 `610`。 +`fibonacci(15)` 應該傳回 `610`。 ```js assert.equal(fibonacci(15), 610); ``` -你的程式碼中不應使用遞迴。 +你不應該在你的程式碼中使用遞迴。 ```js const funcStr = __helpers.removeJSComments(fibonacci.toString()); diff --git a/curriculum/challenges/chinese-traditional/blocks/lab-product-showcase/696920c0c98a1ed58eb86293.md b/curriculum/challenges/chinese-traditional/blocks/lab-product-showcase/696920c0c98a1ed58eb86293.md index 4e50ba0bec2..9251f5d36e7 100644 --- a/curriculum/challenges/chinese-traditional/blocks/lab-product-showcase/696920c0c98a1ed58eb86293.md +++ b/curriculum/challenges/chinese-traditional/blocks/lab-product-showcase/696920c0c98a1ed58eb86293.md @@ -421,6 +421,10 @@ assert.isFunction(showProducts); ```js const len = products.items.length; +const books = document.getElementById("books"); +const all = document.getElementById("all"); +const output = document.getElementById("output"); + assert.isAtLeast(len, 3); books.dispatchEvent(new Event("click", { bubbles: true })); all.dispatchEvent(new Event("click", { bubbles: true })); @@ -430,7 +434,11 @@ assert.lengthOf(output.querySelectorAll(".item"), len); 點擊 `#books` 按鈕時,應在 `#output` 元素中顯示對應的產品集合。 ```js +const books = document.getElementById("books"); +const clothing = document.getElementById("clothing"); +const output = document.getElementById("output"); const len = products.items.length; + assert.isAtLeast(len, 3); let count = 0; products.items.forEach(i => { @@ -446,7 +454,11 @@ assert.lengthOf(output.querySelectorAll(".item"), count); 點擊 `#electronics` 按鈕時,應在 `#output` 元素中顯示對應的產品集合。 ```js +const electronics = document.getElementById("electronics"); +const clothing = document.getElementById("clothing"); +const output = document.getElementById("output"); const len = products.items.length; + assert.isAtLeast(len, 3); let count = 0; products.items.forEach(i => { @@ -462,7 +474,11 @@ assert.lengthOf(output.querySelectorAll(".item"), count); 點擊 `#clothing` 按鈕時,應在 `#output` 元素中顯示對應的產品集合。 ```js +const books = document.getElementById("books"); +const clothing = document.getElementById("clothing"); +const output = document.getElementById("output"); const len = products.items.length; + assert.isAtLeast(len, 3); let count = 0; products.items.forEach(i => { @@ -478,6 +494,7 @@ assert.lengthOf(output.querySelectorAll(".item"), count); 頁面載入時,預設應顯示所有產品。使用 `DOMContentLoaded` 事件確保此行為。 ```js +const output = document.getElementById("output"); const len = products.items.length; assert.isAtLeast(len, 3); document.dispatchEvent(new Event("DOMContentLoaded")); diff --git a/curriculum/challenges/chinese-traditional/blocks/lab-reusable-footer/673b02b03134b04637bf7055.md b/curriculum/challenges/chinese-traditional/blocks/lab-reusable-footer/673b02b03134b04637bf7055.md index fe0a0d9e6c9..bb9e64c4203 100644 --- a/curriculum/challenges/chinese-traditional/blocks/lab-reusable-footer/673b02b03134b04637bf7055.md +++ b/curriculum/challenges/chinese-traditional/blocks/lab-reusable-footer/673b02b03134b04637bf7055.md @@ -16,7 +16,7 @@ demoType: onClick 2. 你的 `Footer` 組件應該傳回一個包含所有其他元素的 `footer` 元素。 3. 你的 `footer` 元素應該包含: - - 至少三個無序列表,每個列表至少有兩個列表項目。 +- 至少三個無序列表,每個列表至少有兩個列表項目。 - 至少一個段落元素包含版權 `©` 符號。 - 至少三個 `href` 值設定為 `#` 且聯結內容設定為你選擇的圖示或文字的聯結。 @@ -53,7 +53,7 @@ assert.lengthOf(document.getElementById('root').children, 1); assert.isAtLeast(document.querySelectorAll('ul').length, 3); ``` -你的每個無序列表應該至少有兩個列表項目。 +你的無序列表中,每個列表都應該至少有兩個項目、條款。 ```js const uls = [...document.querySelectorAll('ul')]; @@ -84,7 +84,7 @@ const links = document.querySelectorAll('a[href="#"]'); assert.isAtLeast(links.length, 3); ``` -你的任何 link 都不應該是空的。 +你的聯結不應該是空的。 ```js const links = [...document.querySelectorAll('a[href="#"]')]; diff --git a/curriculum/challenges/chinese-traditional/blocks/lab-sentence-maker/66c057041df6394ca796bf33.md b/curriculum/challenges/chinese-traditional/blocks/lab-sentence-maker/66c057041df6394ca796bf33.md index a9162fa33e4..2c80af62eb7 100644 --- a/curriculum/challenges/chinese-traditional/blocks/lab-sentence-maker/66c057041df6394ca796bf33.md +++ b/curriculum/challenges/chinese-traditional/blocks/lab-sentence-maker/66c057041df6394ca796bf33.md @@ -7,7 +7,7 @@ dashedName: build-a-sentence-maker # --description-- -在本實驗中,你將使用句子模板創建兩個不同的故事。你將使用變數來儲存故事的不同零件,然後將故事輸出到主控台。 +在這個實驗中,你將使用句子模板創建兩個不同的故事。你會使用變數來儲存故事的不同部分,然後將故事記錄到主控台。 **目標:** 完成以下使用者故事並通過所有測試以完成實驗。 @@ -26,19 +26,26 @@ dashedName: build-a-sentence-maker 1. 你應該宣告一個 `firstStory` 變數。 -1. 你應該使用以下故事模板來創建第一個故事,並將它指定給 `firstStory` 變數:`"Once upon a time, there was a(n) [adjective] [noun] who loved to eat [noun2]. The [noun] lived in a [place] and had [adjective2] nostrils that blew fire when it was [verb]."`; +1. 你應該使用以下故事模板來創建第一個故事,並將其指定給 `firstStory` 變數:`"Once upon a time, there was a(n) [adjective] [noun] who loved to eat [noun2]. The [noun] lived in a [place] and had [adjective2] nostrils that blew fire when it was [verb]."` -1. 你應該使用訊息 `"First story: [firstStory]"` 將你的第一個故事輸出到主控台。 +1. 你應該使用訊息 `"First story: [firstStory]"` 將你的第一個故事記錄到主控台。 1. 你應該為你的 `adjective`、`noun`、`verb`、`place`、`adjective2` 和 `noun2` 變數指定新值。 1. 你應該宣告一個 `secondStory` 變數。 -1. 使用相同的模板創建另一個故事,並將它指定給 `secondStory` 變數。 +1. 你應該使用相同的模板創建另一個故事,並將其指定給 `secondStory` 變數。 -1. 你應該使用訊息 `"Second story: [secondStory]"` 將你的第二個故事輸出到主控台。 +1. 你應該使用訊息 `"Second story: [secondStory]"` 將你的第二個故事記錄到主控台。 +# --before-each-- + +```js +const spy = __helpers.spyOn(console, 'log'); +const getLogs = () => spy.calls.map(call => call.join(' ')); +``` + # --hints-- 你應該宣告一個 `adjective` 變數。 @@ -142,12 +149,10 @@ assert.match( ); ``` -你應該使用訊息 `"First story: [firstStory]"` 記錄你的第一個故事。 +你應該使用訊息 `"First story: [firstStory]"` 將你的第一個故事記錄到主控台。 ```js -const condition1 = /console\.log\(\s*["']First\s+story:\s+["']\s*\+\s*firstStory\s*\);?/gm.test(code); -const condition2 = /console\.log\(\s*`First\s+story:\s+\$\{firstStory\}`\s*\);?/gm.test(code); -assert.isTrue(condition1 || condition2); +assert.include(getLogs(), `First story: ${firstStory}`); ``` 你應該宣告一個 `secondStory` 變數。 @@ -208,15 +213,13 @@ assert.match( ); ``` -你應該使用格式 `"Second story: [secondStory]"` 記錄你的第二個故事。 +你應該使用訊息 `"Second story: [secondStory]"` 將你的第二個故事記錄到主控台。 ```js -const condition1 = /console\.log\(\s*["']Second\s+story:\s+["']\s*\+\s*secondStory\s*\);?/gm.test(code); -const condition2 = /console\.log\(\s*`Second\s+story:\s+\$\{secondStory\}`\s*\);?/gm.test(code); -assert.isTrue(condition1 || condition2); +assert.include(getLogs(), `Second story: ${secondStory}`); ``` -`firstStory` 不應該與 `secondStory` 相同。 +你的 `firstStory` 不應該和你的 `secondStory` 相同。 ```js assert.notEqual(firstStory, secondStory); diff --git a/curriculum/challenges/chinese-traditional/blocks/lab-weather-app/66f12a88741aeb16b9246c59.md b/curriculum/challenges/chinese-traditional/blocks/lab-weather-app/66f12a88741aeb16b9246c59.md index d6283511270..b100115732d 100644 --- a/curriculum/challenges/chinese-traditional/blocks/lab-weather-app/66f12a88741aeb16b9246c59.md +++ b/curriculum/challenges/chinese-traditional/blocks/lab-weather-app/66f12a88741aeb16b9246c59.md @@ -333,7 +333,7 @@ assert.strictEqual( ); ``` -在 `select` 元素內應該有 6 個 `option` 元素,每個元素對應以下城市之一:Paris、London、Tokyo、Los Angeles、Chicago、New York。 +除了第一個空的選項外,`select` 元素應該包含 6 個 `option` 元素,分別對應以下城市:巴黎、倫敦、東京、洛杉磯、芝加哥、紐約。 ```js ['Paris', 'London', 'Tokyo', 'Los Angeles', 'Chicago', 'New York'].forEach( @@ -342,7 +342,7 @@ assert.strictEqual( `select > option[value="${city.toLowerCase()}"]` ); assert.exists(el); - assert.strictEqual(el.innerText.trim(), city); + assert.strictEqual(el.textContent.trim(), city); } ); ``` diff --git a/curriculum/challenges/chinese-traditional/blocks/learn-about-speculation-and-requests/67eff6af42e8c425d9ff28e3.md b/curriculum/challenges/chinese-traditional/blocks/learn-about-speculation-and-requests/67eff6af42e8c425d9ff28e3.md index 82ec61d55d9..0a82f3389e8 100644 --- a/curriculum/challenges/chinese-traditional/blocks/learn-about-speculation-and-requests/67eff6af42e8c425d9ff28e3.md +++ b/curriculum/challenges/chinese-traditional/blocks/learn-about-speculation-and-requests/67eff6af42e8c425d9ff28e3.md @@ -32,7 +32,7 @@ lang: en-US - `Your software is up to date.` - 該軟體已包含所有最新更新。 -- `Is your resume up to date?`-他們在詢問履歷是否包含此人最近的經歷。 +- `Is your resume up to date?` - 他們在問這份履歷是否包含此人的最新經歷。 # --scene-- diff --git a/curriculum/challenges/chinese-traditional/blocks/learn-basic-css-by-building-a-cafe-menu/5f3ef6e03d719d5ac4738993.md b/curriculum/challenges/chinese-traditional/blocks/learn-basic-css-by-building-a-cafe-menu/5f3ef6e03d719d5ac4738993.md index 3dd5c32a5e7..20b1bc7bb9d 100644 --- a/curriculum/challenges/chinese-traditional/blocks/learn-basic-css-by-building-a-cafe-menu/5f3ef6e03d719d5ac4738993.md +++ b/curriculum/challenges/chinese-traditional/blocks/learn-basic-css-by-building-a-cafe-menu/5f3ef6e03d719d5ac4738993.md @@ -7,7 +7,7 @@ dashedName: step-56 # --description-- -選單目前的寬度將始終佔據 `body` 元素寬度的 80%。在非常寬的螢幕上,咖啡和甜點與它們的價格之間會顯得相距很遠。 +選單的目前寬度將始終佔據 `body` 元素寬度的 `80%`。在非常寬的螢幕上,咖啡和甜點與它們的價格看起來相距很遠。 為你的 `menu` 類別添加一個值為 `500px` 的 `max-width` 屬性,以防止它變得過寬。 diff --git a/curriculum/challenges/chinese-traditional/blocks/learn-present-perfect-while-talking-about-accessibility/671b98e9b7c4854e93044e64.md b/curriculum/challenges/chinese-traditional/blocks/learn-present-perfect-while-talking-about-accessibility/671b98e9b7c4854e93044e64.md index 6b43a21ed3b..d98048019da 100644 --- a/curriculum/challenges/chinese-traditional/blocks/learn-present-perfect-while-talking-about-accessibility/671b98e9b7c4854e93044e64.md +++ b/curriculum/challenges/chinese-traditional/blocks/learn-present-perfect-while-talking-about-accessibility/671b98e9b7c4854e93044e64.md @@ -62,7 +62,7 @@ lang: en-US "startTime": 5.34, "finishTime": 9.26, "dialogue": { - "text": "Yes, for some reason it hasn't been displaying correctly for some users.", + "text": "Yes. For some reason, it hasn't been displaying correctly for some users.", "align": "right" } }, diff --git a/curriculum/challenges/chinese-traditional/blocks/learn-present-perfect-while-talking-about-accessibility/671f403c1d4e8a5e046065a0.md b/curriculum/challenges/chinese-traditional/blocks/learn-present-perfect-while-talking-about-accessibility/671f403c1d4e8a5e046065a0.md index dc0a50aa59b..b1970eca7fe 100644 --- a/curriculum/challenges/chinese-traditional/blocks/learn-present-perfect-while-talking-about-accessibility/671f403c1d4e8a5e046065a0.md +++ b/curriculum/challenges/chinese-traditional/blocks/learn-present-perfect-while-talking-about-accessibility/671f403c1d4e8a5e046065a0.md @@ -6,7 +6,7 @@ dashedName: task-36 lang: en-US --- -<!-- (Audio) James: Yes. For some reason, It hasn't been displaying correctly for some users. --> +<!-- (Audio) James: Yes. For some reason, it hasn't been displaying correctly for some users. --> # --instructions-- @@ -16,7 +16,7 @@ lang: en-US ## --sentence-- -`Yes. For some reason, It BLANK BLANK BLANK correctly for some users.` +`Yes. For some reason, it BLANK BLANK BLANK correctly for some users.` ## --blanks-- @@ -83,7 +83,7 @@ lang: en-US "startTime": 1, "finishTime": 4.92, "dialogue": { - "text": "Yes, for some reason it hasn't been displaying correctly for some users.", + "text": "Yes. For some reason, it hasn't been displaying correctly for some users.", "align": "center" } }, diff --git a/curriculum/challenges/chinese-traditional/blocks/learn-present-perfect-while-talking-about-accessibility/671f456994635c6085054cbd.md b/curriculum/challenges/chinese-traditional/blocks/learn-present-perfect-while-talking-about-accessibility/671f456994635c6085054cbd.md index 0ea0fa38c0b..5d969450e0f 100644 --- a/curriculum/challenges/chinese-traditional/blocks/learn-present-perfect-while-talking-about-accessibility/671f456994635c6085054cbd.md +++ b/curriculum/challenges/chinese-traditional/blocks/learn-present-perfect-while-talking-about-accessibility/671f456994635c6085054cbd.md @@ -6,7 +6,7 @@ dashedName: task-37 lang: en-US --- -<!-- (Audio) James: Yes. For some reason, It hasn't been displaying correctly for some users. --> +<!-- (Audio) James: Yes. For some reason, it hasn't been displaying correctly for some users. --> # --instructions-- @@ -16,7 +16,7 @@ lang: en-US ## --sentence-- -`Yes. For some reason, It hasn't been displaying BLANK for some BLANK.` +`Yes. For some reason, it hasn't been displaying BLANK for some BLANK.` ## --blanks-- @@ -79,7 +79,7 @@ lang: en-US "startTime": 1, "finishTime": 4.92, "dialogue": { - "text": "Yes, for some reason it hasn't been displaying correctly for some users.", + "text": "Yes. For some reason, it hasn't been displaying correctly for some users.", "align": "center" } }, diff --git a/curriculum/challenges/chinese-traditional/blocks/learn-present-perfect-while-talking-about-accessibility/6720cf38beae8c4f1d7af1c0.md b/curriculum/challenges/chinese-traditional/blocks/learn-present-perfect-while-talking-about-accessibility/6720cf38beae8c4f1d7af1c0.md index 27ed9112b96..c0a01b88c8c 100644 --- a/curriculum/challenges/chinese-traditional/blocks/learn-present-perfect-while-talking-about-accessibility/6720cf38beae8c4f1d7af1c0.md +++ b/curriculum/challenges/chinese-traditional/blocks/learn-present-perfect-while-talking-about-accessibility/6720cf38beae8c4f1d7af1c0.md @@ -22,7 +22,7 @@ lang: en-US `Alice: James, have you heard about the BLANK on our video platform?` -`James: Yes. For some reason, It hasn't been BLANK for some users. The captions are misaligned and BLANK, which isn't good for accessibility.` +`James: Yes. For some reason, it hasn't been BLANK for some users. The captions are misaligned and BLANK, which isn't good for accessibility.` `Alice: Exactly. Do you know if it's been affecting all the videos or just a few?` diff --git a/curriculum/challenges/chinese-traditional/blocks/lecture-css-specificity-the-cascade-algorithm-and-inheritance/672aa62178d5ff57fe4f98e0.md b/curriculum/challenges/chinese-traditional/blocks/lecture-css-specificity-the-cascade-algorithm-and-inheritance/672aa62178d5ff57fe4f98e0.md index e68840edb1a..43dc8b69eef 100644 --- a/curriculum/challenges/chinese-traditional/blocks/lecture-css-specificity-the-cascade-algorithm-and-inheritance/672aa62178d5ff57fe4f98e0.md +++ b/curriculum/challenges/chinese-traditional/blocks/lecture-css-specificity-the-cascade-algorithm-and-inheritance/672aa62178d5ff57fe4f98e0.md @@ -43,14 +43,14 @@ p { ```html <link rel="stylesheet" href="styles.css"> -<p id="para">Red paragraph</p> +<p id="para-1">Red paragraph</p> <p>Other paragraph</p> <p>Another paragraph</p> <p>Yet another paragraph</p> ``` ```css -#para { +#para-1 { color: red; } @@ -67,24 +67,33 @@ p { **注意**:你將在未來的課程中學習更多關於偽類別的內容。 -在這個範例中,第一個段落會是紅色,因為 ID 選擇器的特異性比類別和型別選擇器高。`.example-para` 元素會是綠色,而其他段落元素會是藍色。 +在此範例中: + +- 第一段文字會是紅色,因為 ID 選擇器的特異性高於類別和型別選擇器。 +- 第二段文字使用類別選擇器 `.example-para`,顏色會是綠色。 +- 第三段文字同時有 ID 選擇器 `#para-3` 和類別選擇器 `.example-para`,顏色會是紫色。 +- 其餘的段落元素顏色會是藍色。 :::interactive_editor ```html <link rel="stylesheet" href="styles.css"> -<p id="para">Example paragraph</p> +<p id="para-1">Example paragraph</p> <p class="example-para">Other paragraph</p> -<p class="example-para">Another paragraph</p> +<p id="para-3" class="example-para">Another paragraph</p> <p>Yet another paragraph</p> ``` ```css -#para { +#para-1 { color: red; } +#para-3 { + color: purple; +} + .example-para { color: green; } @@ -105,13 +114,13 @@ p { ```html <link rel="stylesheet" href="styles.css"> -<p id="para">Example paragraph</p> +<p id="para-1">Example paragraph</p> <p>Other paragraph</p> <p>Yet another paragraph</p> ``` ```css -#para { +#para-1 { color: red; } @@ -130,7 +139,7 @@ p { ```html <link rel="stylesheet" href="styles.css"> -<p id="para">Example paragraph</p> +<p id="para-1">Example paragraph</p> <p>Other paragraph</p> <p>Yet another paragraph</p> ``` @@ -140,7 +149,7 @@ p { color: red; } -#para { +#para-1 { color: green; } diff --git a/curriculum/challenges/chinese-traditional/blocks/lecture-express-middleware/69f42d414b7626e21a922794.md b/curriculum/challenges/chinese-traditional/blocks/lecture-express-middleware/69f42d414b7626e21a922794.md index 2bbe90fc9e4..5aeb3229465 100644 --- a/curriculum/challenges/chinese-traditional/blocks/lecture-express-middleware/69f42d414b7626e21a922794.md +++ b/curriculum/challenges/chinese-traditional/blocks/lecture-express-middleware/69f42d414b7626e21a922794.md @@ -9,9 +9,7 @@ dashedName: what-is-error-handling-middleware Express 中的錯誤處理中介層是一種特殊類型的中介層,用來處理在請求-回應週期中發生的錯誤。它對於捕捉意外錯誤、記錄錯誤,以及向客戶端提供適當的回應非常重要。 -如你在先前的錯誤處理課程中所見,Express 的錯誤處理中介層有四個參數:`err`、`req`、`res` 和 `next`。當錯誤被傳遞給 `next()` 函式時,這個中介層會被喚起。 - -這裡再提醒一次語法: +Express 的錯誤處理中介層有四個參數:`err`、`req`、`res` 和 `next`。當錯誤被傳遞給 `next()` 函式時,這個中介層會被喚起。語法如下: ```js app.use((err, req, res, next) => { @@ -92,7 +90,7 @@ app.listen(3000, () => { ## --answers-- -`err`、`req`、`res`、`next`。 +`err`, `req`, `res`, `next`. --- diff --git a/curriculum/challenges/chinese-traditional/blocks/lecture-express-middleware/69f42d414b7626e21a922795.md b/curriculum/challenges/chinese-traditional/blocks/lecture-express-middleware/69f42d414b7626e21a922795.md index ca4b6df80cf..fa13cf20ec1 100644 --- a/curriculum/challenges/chinese-traditional/blocks/lecture-express-middleware/69f42d414b7626e21a922795.md +++ b/curriculum/challenges/chinese-traditional/blocks/lecture-express-middleware/69f42d414b7626e21a922795.md @@ -13,45 +13,45 @@ Express 提供一系列內建的中介層函式,幫助執行常見任務,例 1. `express.json()`:一個內建中介層,用來解析傳入的 JSON 載荷。 -```js -app.use(express.json()) -``` + ```js + app.use(express.json()) + ``` 1. `express.static()`:用於提供靜態檔案服務的中介層,例如圖片、CSS 和 JavaScript 檔案。 -```js -app.use(express.static('public')) -``` + ```js + app.use(express.static('public')) + ``` 1. `express.urlencoded()`:解析傳入 URL 編碼載荷的中介層,這是 HTML 表單通常傳送的格式。它會將解析後的資料放在 `req.body` 上。 -```js -app.use(express.urlencoded({ extended: true })) -``` + ```js + app.use(express.urlencoded({ extended: true })) + ``` **現在,以下是一些第三方中介層的範例:** 1. `cors`:一個流行的第三方中介層,用來啟用跨來源資源共享(CORS)。 -```bash -npm install cors -``` + ```bash + npm install cors + ``` -```js -const cors = require('cors') -app.use(cors()) -``` + ```js + const cors = require('cors') + app.use(cors()) + ``` 1. `morgan`:用於 HTTP 請求的記錄中介層。 -```bash -npm install morgan -``` + ```bash + npm install morgan + ``` -```js -const morgan = require('morgan') -app.use(morgan('tiny')) -``` + ```js + const morgan = require('morgan') + app.use(morgan('tiny')) + ``` 現在,讓我們來看一個同時使用內建和第三方中介層的範例: diff --git a/curriculum/challenges/chinese-traditional/blocks/lecture-importance-of-semantic-html/672990ecf71a852804ababe7.md b/curriculum/challenges/chinese-traditional/blocks/lecture-importance-of-semantic-html/672990ecf71a852804ababe7.md index 42663b6ca01..b9f49384a7f 100644 --- a/curriculum/challenges/chinese-traditional/blocks/lecture-importance-of-semantic-html/672990ecf71a852804ababe7.md +++ b/curriculum/challenges/chinese-traditional/blocks/lecture-importance-of-semantic-html/672990ecf71a852804ababe7.md @@ -11,6 +11,10 @@ dashedName: what-is-the-difference-between-presentational-and-semantic-html 許多呈現用的 HTML 元素已被棄用,這表示它們已過時且不再建議使用。有更好的方法可以達成相同的結果。然而,知道它們的存在是有幫助的,所以我們將看看一些範例。 +## 呈現型 HTML 元素 + +### `font` 元素 + `font` 元素是一個已棄用的元素,用於設定文字的字型大小和顏色。以下是一個 `font` 元素的範例。 啟用互動式編輯器並將大小從 5 改為 7,以查看字型增大。 @@ -27,6 +31,8 @@ dashedName: what-is-the-difference-between-presentational-and-semantic-html 雖然此元素仍然有效,但你不應該使用它,因為字型大小和顏色應該始終在 CSS 中設定,而不是在 HTML 中設定。 +### `center` 元素 + `center` 元素是另一個已棄用的元素,用於將內容在其容器中水平置中。以下是一個包含文字和段落元素的 `center` 元素範例。 啟用互動式編輯器,並在 `<p>Another example text.</p>` 周圍添加 `center` 頁籤,以便在頁面上置中顯示。 @@ -44,6 +50,8 @@ dashedName: what-is-the-difference-between-presentational-and-semantic-html ::: +### `big` 元素 + 接著,我們有 `big` 元素。這是另一個已棄用的呈現型 HTML 元素,會使包圍的文字比其周圍的文字大一層級。這裡有一個範例,定義了一個包含兩個零件的段落。 啟用互動式編輯器,並在 `Some other text` 周圍添加 `big` 頁籤,然後在預覽視窗中查看變更。 @@ -64,6 +72,8 @@ dashedName: what-is-the-difference-between-presentational-and-semantic-html 這些是呈現用的 HTML 元素範例。但它們全部都已被淘汰,不再建議使用。那麼你應該改用什麼呢?讓我們來看看。 +## 語意型 HTML + 語意化 HTML 現在是推薦的做法。它描述元素的內容,因此更容易閱讀、理解和維護。 當你使用語意化的 HTML 時,搜尋引擎可以輕鬆理解你的網站。這對於無障礙存取也很有幫助,因為螢幕閱讀器需要語意化的資訊來描述網頁上的內容。 @@ -75,6 +85,8 @@ dashedName: what-is-the-difference-between-presentational-and-semantic-html - 用於群組相關資訊的 `section` 元素。 - 用於插圖和圖表的 `figure` 元素。 +### 語意型 HTML 範例 + 這是一個包含導覽區段元素的 `header` 元素範例。 啟用互動式編輯器,並在 `nav` 中添加一個 `<a href="#">Products</a>`,即可在預覽視窗中看到變更。 @@ -97,6 +109,8 @@ dashedName: what-is-the-difference-between-presentational-and-semantic-html 語意元素清楚地顯示它們在 HTML 結構中的用途。 有許多不同的語意 HTML 元素。 你一定會找到一個符合你專案需求的元素。 +## 總結 + 做得很好。現在你知道了表現型和語意型 HTML 之間的差異:語意型 HTML 描述內容,而表現型 HTML 著重於外觀。 # --questions-- diff --git a/curriculum/challenges/chinese-traditional/blocks/lecture-introduction-to-javascript-libraries-and-frameworks/6734e88cc46e6dc679420040.md b/curriculum/challenges/chinese-traditional/blocks/lecture-introduction-to-javascript-libraries-and-frameworks/6734e88cc46e6dc679420040.md index e8a83cfde96..9a7de5a8458 100644 --- a/curriculum/challenges/chinese-traditional/blocks/lecture-introduction-to-javascript-libraries-and-frameworks/6734e88cc46e6dc679420040.md +++ b/curriculum/challenges/chinese-traditional/blocks/lecture-introduction-to-javascript-libraries-and-frameworks/6734e88cc46e6dc679420040.md @@ -13,7 +13,7 @@ dashedName: what-is-vite-and-how-can-it-be-used-to-set-up-a-new-react-project 要用 Vite 創建新的專案,你需要使用命令列。如果你使用的是 Windows 電腦,可以使用命令提示字元或 Windows PowerShell。如果你使用的是 Mac,則可以使用終端機應用程式。 -如果你還沒有安裝 Node.js,而 npm 需要它才能運作,這裡有官方 Node.js 網頁的連結:https://nodejs.org。請依照安裝說明操作,然後回來繼續你的 React 安裝。 +如果你還沒有安裝 Node.js,而它是讓 npm 能正常運作所必須的,這裡有官方 Node.js 網頁的聯結:[nodejs.org](https://nodejs.org)。請依照安裝說明操作,然後回來繼續你的 React 安裝流程。 一旦你打開命令列,你就可以使用以下指令: @@ -36,7 +36,7 @@ npm install `cd my-react-app` 指令確保你切換到專案所在的正確目錄。 -`npm install` 指令用於安裝正確執行你的 React 專案所需的相依性。相依性是你的 React 專案為了正確運作所需的函式庫或套件,例如 React 本身、ReactDOM,或其他提供額外功能的第三方套件。 +`npm install` 指令用來安裝正確執行你的 React 專案所需的依賴。依賴是你的 React 專案為了正常運作所需要的函式庫或軟體包,例如 React 本身、`react-dom`,或其他提供額外功能的第三方套件。 執行 `npm install` 將會讀取你專案目錄中的 `package.json` 檔案,並安裝那裡列出的所有相依性,讓你能夠在不遺漏任何必要組件的情況下建置並執行你的 React 應用程式。 @@ -50,11 +50,11 @@ npm install 你應該會看到 Vite 為你提供的起始模板。 -如果你需要停止區域的伺服器,請在命令列中按下 `CTRL + C`。 +如果你需要停止區域伺服器,請在命令列按下 `Ctrl + C`。 -若要實際查看此啟動模板的程式碼,你可以進入你的專案中的 `src` 資料夾,並且你應該會看到 `App.jsx` 檔案。 +要實際查看這個起始模板的程式碼,你可以打開專案中的 `src` 資料夾,裡面應該會看到 `App.jsx` 檔案。 -從那裡你可以開始修改檔案、存檔你的變更,並在瀏覽器中看到新的變更顯示。 +從那裡你可以修改該檔案,存檔後,並在瀏覽器中看到變更的即時呈現。 這樣,你就準備好開始建置你的 React 應用程式了! diff --git a/curriculum/challenges/chinese-traditional/blocks/lecture-introduction-to-javascript/672d49959621885e9d3e672c.md b/curriculum/challenges/chinese-traditional/blocks/lecture-introduction-to-javascript/672d49959621885e9d3e672c.md index 97652a47d1f..2a125c14a7b 100644 --- a/curriculum/challenges/chinese-traditional/blocks/lecture-introduction-to-javascript/672d49959621885e9d3e672c.md +++ b/curriculum/challenges/chinese-traditional/blocks/lecture-introduction-to-javascript/672d49959621885e9d3e672c.md @@ -72,6 +72,16 @@ console.log(age); // 25 ::: +雖然使用 `let` 宣告的變數可以被重新指定,但不能被重新宣告。如果你嘗試用 `let` 再次宣告同一個變數,會出現錯誤: + +```js +let age = 25; + +let age = 90; // SyntaxError: Identifier 'age' has already been declared +``` + +對於 `const` 也是一樣:使用 `const` 宣告的變數也不能被重新宣告。 + 使用 `const` 宣告的變數必須在宣告時指定值。如果你嘗試宣告一個未指定值的 `const` 變數,將會產生錯誤: ```js diff --git a/curriculum/challenges/chinese-traditional/blocks/lecture-understanding-aria-expanded-aria-live-and-common-aria-states/672a54dff9dc439089f1a219.md b/curriculum/challenges/chinese-traditional/blocks/lecture-understanding-aria-expanded-aria-live-and-common-aria-states/672a54dff9dc439089f1a219.md index dc092c666ae..f241fe3d534 100644 --- a/curriculum/challenges/chinese-traditional/blocks/lecture-understanding-aria-expanded-aria-live-and-common-aria-states/672a54dff9dc439089f1a219.md +++ b/curriculum/challenges/chinese-traditional/blocks/lecture-understanding-aria-expanded-aria-live-and-common-aria-states/672a54dff9dc439089f1a219.md @@ -11,10 +11,12 @@ dashedName: what-is-the-aria-live-attribute 動態區域的常見用途包括在採取動作後顯示的訊息(例如錯誤訊息或確認訊息)、定期更新的內容(例如跑馬燈、走馬燈或倒數計時器),或一般狀態訊息(例如關於處理程序的更新)。 -因為螢幕閱讀器的閱讀焦點一次只能在一個位置,當焦點在頁面其他零件時,螢幕閱讀器使用者不會注意到內容變更。即時區域允許螢幕閱讀器使用者自動接收頁面上即時發生變更的通知。若沒有即時區域,螢幕閱讀器使用者可能會錯過有視覺使用者可見的重要內容更新,因為有視覺使用者能夠掃描整個頁面。 +因為螢幕閱讀器的閱讀焦點一次只能在一個位置,當焦點在頁面其他零件時,螢幕閱讀器使用者不會注意到內容變更。即時區域允許螢幕閱讀器使用者自動接收頁面上即時發生變更的通知。若沒有即時區域,螢幕閱讀器使用者可能會錯過有視覺使用者可見的重要內容更新,因為有視覺使用者能夠掃描整個頁面。 根據資訊的優先權,此屬性有三個可能的值。 +## `assertive` 值 + 如果你將 `aria-live` 設定為值 `assertive`,表示該更新非常重要。它具有最高的優先權,因此應立即通知使用者。 這表示螢幕閱讀器會中斷它目前正在發出的任何公告,以宣告即時區域中的內容變更。此類中斷可能會造成極大干擾,因此 `assertive` 值應僅用於時間敏感或關鍵通知。 @@ -81,6 +83,8 @@ document.addEventListener("DOMContentLoaded", () => { ::: +## `polite` 值 + 下一個優先權的值是 `polite`。 此值表示更新並非緊急,因此螢幕閱讀器可以等到任何目前的公告結束或使用者停止輸入後再宣布更新。大多數即時區域會使用 `polite` 值。 @@ -147,10 +151,16 @@ document.addEventListener("DOMContentLoaded", () => { ::: +## `off` 值 + `aria-live` 的最低優先權值是 `off`,這表示除非內容位於目前具有鍵盤焦點的元素中,否則更新不會被宣告。實際上,這個值幾乎從未被使用,因為使用情境非常狹窄,且在螢幕閱讀器中並不一致地實作(如果有實作的話)。如果你需要即時區域,請計劃為所有內容使用 `polite`,除了需要 `assertive` 的關鍵訊息。 +## ARIA 角色的預設即時區域 + 同時也要注意,如果更新的資訊包含在具有 `alert`、`log`、`marquee`、`status` 或 `timer` ARIA 角色的元素中,則不需要 `aria-live` 屬性,因為這些角色已經有預設的 `aria-live` 值。但可以透過在元素上明確設定 `aria-live` 來更改預設值。 +## 選擇正確的值 + 選擇正確的 `aria-live` 值取決於更新資訊的優先權。 如果更新是緊急的,你應該立即使用 `assertive` 通知使用者。但你應該只在更新真的很緊急時使用這個,因為突如其來的中斷可能會讓使用者感到迷失並影響使用者體驗。 @@ -205,7 +215,7 @@ document.addEventListener("DOMContentLoaded", () => { ## --answers-- -`true`、`false`、`off`。 +`true`, `false`, `off`. ### --feedback-- @@ -213,7 +223,7 @@ document.addEventListener("DOMContentLoaded", () => { --- -`visible`、`hidden`、`off`。 +`visible`, `hidden`, `off`. ### --feedback-- @@ -221,11 +231,11 @@ document.addEventListener("DOMContentLoaded", () => { --- -`assertive`、`polite` 和 `off`。 +`assertive`, `polite`, `off`. --- -`open`、`closed`、`off`。 +`open`, `closed`, `off`. ### --feedback-- diff --git a/curriculum/challenges/chinese-traditional/blocks/lecture-understanding-computer-internet-and-tooling-basics/672aa578a2129554d4675049.md b/curriculum/challenges/chinese-traditional/blocks/lecture-understanding-computer-internet-and-tooling-basics/672aa578a2129554d4675049.md index 9b8820d766d..da366eaa706 100644 --- a/curriculum/challenges/chinese-traditional/blocks/lecture-understanding-computer-internet-and-tooling-basics/672aa578a2129554d4675049.md +++ b/curriculum/challenges/chinese-traditional/blocks/lecture-understanding-computer-internet-and-tooling-basics/672aa578a2129554d4675049.md @@ -11,13 +11,13 @@ dashedName: what-are-the-basic-parts-of-a-computer 作為開發者,了解電腦的基本內部運作非常重要。 -電腦的第一個主要組件是主機板。主機板承載所有執行電腦所需的記憶體和連接器。它作為電腦的主要電路板。 +電腦的第一個主要組件是主機板。主機板包含了運行電腦所需的所有記憶體和連接器。它作為電腦的主要電路板。 -在主機板的電腦機殼內,你會找到代表中央處理器的 CPU。CPU 是負責執行指令和進行計算的處理器。它通常被稱為電腦的大腦。 +在電腦機殼內,安裝在主機板上的,是 CPU,代表中央處理器。CPU 是負責執行指令和進行計算的處理器。它常被稱為電腦的大腦。 -CPU 是一個帶有晶片的小方塊,插入主機板的 CPU socket。CPU 處理程序速度以 gigahertz(GHz)和 mega-hertz(MHz)為單位測量。Gigahertz 是每秒十億個週期,mega-hertz 是每秒一百萬個週期。 +CPU 是一個小方形晶片,插入主機板的 CPU 插槽。CPU 速度以 GHz(千兆赫)和 MHz(百萬赫)為單位。千兆赫代表每秒十億個週期,百萬赫代表每秒一百萬個週期。 -電腦的下一個關鍵組件是系統的短期記憶體。這稱為 RAM 或隨機存取記憶體。RAM 是電腦 CPU 的臨時儲存位置。每當電腦需要快速存取資料時,會使用 RAM。 +電腦的下一個關鍵組件是系統的短期記憶體,稱為 RAM,或隨機存取記憶體。RAM 是電腦 CPU 的暫時儲存位置。每當電腦需要快速存取資料時,就會使用 RAM。 你的電腦中 RAM 越多,執行速度就越快,且你可以同時執行更多程式。如果你的 RAM 快用完,電腦會變慢,你會注意到效率的差異。 @@ -27,13 +27,13 @@ CPU 是一個帶有晶片的小方塊,插入主機板的 CPU socket。CPU 處 硬碟由一個旋轉的碟片和一個臂組成。碟片是儲存資料的地方,而臂用於讀取和寫入資料到碟片。當你有一個更快的硬碟時,你的電腦將更快開機,你的程式也會更快執行。 -另一種資料儲存類型是固態硬碟,簡稱 SSD。SSD 是非易揮發性的快閃記憶體,可以用來取代硬碟。SSD 比硬碟更快且體積更小,但硬碟較便宜且具有更大的儲存容量。 +另一種資料儲存類型是固態硬碟,簡稱 SSD。SSD 是非易揮發的快閃記憶體,可以用來取代硬碟。SSD 比硬碟更快且體積更小,但硬碟價格較便宜且容量較大。 電腦的另一個關鍵組件是電源供應器,或稱為 PSU。PSU 負責將牆壁插座的電力轉換成電腦可以使用的形式。它將插座的電力傳送到主機板、CPU 和電腦的其他組件。 -另一個關鍵組件是擴充卡。這些卡插入主機板,以為電腦添加額外的功能。擴充卡的範例包括 video card、sound card 和 network card。 +另一個重要組件是擴充卡。這些卡插入主機板以為電腦添加額外功能。擴充卡的例子包括顯示卡、音效卡和網路卡。 -顯示卡,也稱為圖形處理器或 GPU,負責在電腦螢幕上呈現視覺效果。 +顯示卡,也稱為圖形處理器(GPU),負責在電腦螢幕上呈現視覺畫面。 音效卡負責在電腦喇叭上播放聲音。 @@ -49,15 +49,15 @@ CPU 是一個帶有晶片的小方塊,插入主機板的 CPU socket。CPU 處 ## --answers-- -長期記憶。 +長期記憶體。 ### --feedback-- -思考短期資料儲存。 +想想短期資料儲存。 --- -短期記憶。 +短期記憶體。 --- @@ -65,7 +65,7 @@ CPU 是一個帶有晶片的小方塊,插入主機板的 CPU socket。CPU 處 ### --feedback-- -思考短期資料儲存。 +想想短期資料儲存。 --- @@ -73,7 +73,7 @@ CPU 是一個帶有晶片的小方塊,插入主機板的 CPU socket。CPU 處 ### --feedback-- -思考短期資料儲存。 +想想短期資料儲存。 ## --video-solution-- @@ -141,11 +141,11 @@ CPU 代表什麼? --- -儲存短期記憶。 +儲存短期記憶體。 ### --feedback-- -請查看課程結尾的答案 +請查看課程結尾的答案。 ## --video-solution-- diff --git a/curriculum/challenges/chinese-traditional/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab82c1a9bbd0e3aabc39d.md b/curriculum/challenges/chinese-traditional/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab82c1a9bbd0e3aabc39d.md index 968c081cf22..b317a3d3ffe 100644 --- a/curriculum/challenges/chinese-traditional/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab82c1a9bbd0e3aabc39d.md +++ b/curriculum/challenges/chinese-traditional/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab82c1a9bbd0e3aabc39d.md @@ -7,11 +7,11 @@ dashedName: how-to-effectively-work-with-your-keyboard-mouse-and-other-pointing- # --description-- -你們中許多人多年來已習慣使用鍵盤和滑鼠進行各種活動,例如遊戲、工作任務或瀏覽網頁。 +你們中許多人多年來一直使用鍵盤和滑鼠進行各種活動,例如遊戲、執行工作任務或瀏覽網頁。 但長期誤用這些裝置可能會導致日後嚴重的健康問題。 -在本課程中,我們將涵蓋以健康方式使用你的電腦鍵盤和滑鼠的方法。 +在本課程中,我們將涵蓋如何以健康的方式使用你的電腦鍵盤和滑鼠。 第一個建議是要注意滑鼠的握法。當你在處理重要的工作任務或激烈的遊戲時刻,可能會傾向於用力握住滑鼠。然而,這可能導致嚴重的手部和手腕問題。為了避免這種情況,你應該確保輕柔地握住滑鼠,並保持手指放鬆。 @@ -25,7 +25,7 @@ dashedName: how-to-effectively-work-with-your-keyboard-mouse-and-other-pointing- 雖然維持良好姿勢很重要,但現代人體工學強調運動和動態坐姿的重要性。人體是為了運動而設計的,長時間保持任何固定姿勢,即使是筆直的姿勢,也會對脊椎造成持續壓力。定期休息、在一天中調整你的姿勢,以及維持自然的手腕位置,有助於促進血液循環、減少疲勞,並支援長期脊椎健康。 -最後一個建議是盡可能使用鍵盤快速鍵來減少打字。有數十種快速鍵可用於瀏覽網頁、在你的作業系統中導航、在程式碼編輯器中工作等任務。因此,最好研究一些這些鍵盤快速鍵,並開始將它們融入你的日常電腦使用中。 +最後一個建議是盡可能使用鍵盤快速鍵,以減少伸手去拿滑鼠的次數。針對瀏覽網頁、操作作業系統、在程式碼編輯器中工作等任務,有數十種快速鍵可用。因此,最好研究一些這些鍵盤快速鍵,並開始將它們融入你的日常電腦使用中。 當你繼續使用滑鼠和鍵盤進行即將到來的程式設計專案和其他活動時,請記得牢記這些健康提示。 @@ -109,7 +109,7 @@ dashedName: how-to-effectively-work-with-your-keyboard-mouse-and-other-pointing- ## --answers-- -滑鼠應該遠高於鍵盤。 +滑鼠的高度並不重要。 ### --feedback-- diff --git a/curriculum/challenges/chinese-traditional/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab83c4297910eade53c2e.md b/curriculum/challenges/chinese-traditional/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab83c4297910eade53c2e.md index 921ee7ef571..b2c890adc23 100644 --- a/curriculum/challenges/chinese-traditional/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab83c4297910eade53c2e.md +++ b/curriculum/challenges/chinese-traditional/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab83c4297910eade53c2e.md @@ -7,17 +7,17 @@ dashedName: what-are-the-different-types-of-internet-service-providers # --description-- -首先,什麼是網際網路服務提供者,或稱 ISP?它本質上是一家銷售存取全域網際網路網路的公司。而且它們分為三個不同的層級。 +首先,什麼是網際網路服務提供者,或稱 ISP?它本質上是一家公司,販售存取全球網際網路網路的服務。它們分為三個不同的層級。 -第一層是大型企業集團,它們擁有基礎建設,可以獨立控制大部分(如果不是全部)網路流量。 +第一層級是大型企業集團,擁有基礎建設能夠獨立處理大部分(如果不是全部)網路流量。 -第二層是全國性的提供者,他們有時會租用對第一層網路的存取,但通常能夠相當獨立運作。 +第二層級是全國性的提供者,有時會租用第一層級網路的存取權,但也能相當獨立地運作。 -第三層是主要專注於為區域市場提供網際網路的小型公司,並依賴較大型的 ISP 提供他們的基礎建設。 +第三層級是主要專注於為區域市場提供網際網路的小型公司,並依賴較大型的 ISP 提供基礎建設。 這些提供者也會提供不同型別的連接。 -光纖連接依賴玻璃或塑膠纖維透過光傳輸資料,從而達成非常高的連接速度和資料交換。 +光纖連線依靠玻璃或塑膠纖維透過光傳輸資料,帶來非常高的連線速度和資料交換效率。 有線連接使用與有線電視供應商相同的基礎建設,這通常使它們在許多地區隨時可用。 @@ -25,7 +25,7 @@ DSL 連線使用固定電話服務所使用的基礎建設。由於這種基礎 撥號也使用電話線,但需要專用連線(連接到網際網路時會停用電話線的電話功能)。這是一種較舊的技術,已經逐漸被淘汰。 -衛星連線使用繞行地球的衛星陣列來連接全球各地的各種裝置。最後,類似地,5G 家用網際網路供應商使用基地台基礎建設來保持你的線上狀態。 +衛星連線使用環繞地球軌道的一組衛星來連接全球各地的裝置。最後,類似的,5G 家用網際網路提供者則利用行動基地台基礎建設讓你保持線上。 這應該能讓你對現有的網際網路服務提供者和網際網路連接的型別有基本的了解! @@ -69,7 +69,7 @@ DSL 連線使用固定電話服務所使用的基礎建設。由於這種基礎 ## --text-- -哪一種網際網路連線型別使用玻璃或塑膠光纖透過光來傳輸資料? +哪一種網際網路連線使用玻璃或塑膠纖維透過光來傳輸資料? ## --answers-- @@ -89,7 +89,7 @@ DSL 連接。 --- -光纖連接 +光纖連線。 --- @@ -121,7 +121,7 @@ DSL 連接。 --- -他們使用一組繞行地球的衛星陣列。 +它們使用環繞地球軌道的一組衛星。 ### --feedback-- diff --git a/curriculum/challenges/chinese-traditional/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab8573f32480f192aaae1.md b/curriculum/challenges/chinese-traditional/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab8573f32480f192aaae1.md index f984f576b1a..f87218f541d 100644 --- a/curriculum/challenges/chinese-traditional/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab8573f32480f192aaae1.md +++ b/curriculum/challenges/chinese-traditional/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab8573f32480f192aaae1.md @@ -9,7 +9,7 @@ dashedName: what-are-the-different-types-of-tools-professional-developers-use 專業開發人員依賴各種工具來提升生產力和程式碼品質。讓我們來了解這些工具,包括那些看起來非常明顯的工具。 -工具中第一個是電腦。電腦是主要的開發環境。它可以是重型桌上型電腦或攜帶型筆記型電腦,作業系統可以是 Windows、macOS 或 Linux。 +第一個工具就是電腦本身。電腦是主要的開發環境。它可以是笨重的桌上型電腦,也可以是搭載 Windows、macOS 或 Linux 作業系統的便攜式筆記型電腦。 專業開發人員經常選擇具有快速處理能力和大量 RAM 的電腦,以控制代碼資源密集型任務。 @@ -21,7 +21,7 @@ Visual Studio Code(VS Code)本質上是一個程式碼編輯器,但它也 其他程式碼編輯器有 Sublime Text、Atom、Notepad++ 和 Brackets。 -當你使用程式碼編輯器和整合開發環境撰寫程式碼時,你需要追蹤你對它們所做的變更。讓你追蹤這些變更的工具是版本控制系統。 +當你使用程式碼編輯器和整合開發環境撰寫程式碼時,你需要追蹤對該程式碼所做的變更。讓你追蹤這些變更的工具是版本控制系統。 Git 是開發社群中使用最廣泛的版本控制系統。 @@ -31,8 +31,8 @@ Git 是開發社群中使用最廣泛的版本控制系統。 流行軟體包管理工具的範例有: -* JavaScript 的 NPM、Yarn 和 PNPM -* Python 的 PIP +* JavaScript 的 npm、Yarn 和 pnpm +* Python 的 pip * PHP 的 Composer * Java 的 Maven @@ -147,7 +147,7 @@ Git。 --- -版本控制系統 +版本控制系統。 ### --feedback-- diff --git a/curriculum/challenges/chinese-traditional/blocks/lecture-understanding-error-handling-and-health-checks/69f3046f4c0e76cbdd24858e.md b/curriculum/challenges/chinese-traditional/blocks/lecture-understanding-error-handling-and-health-checks/69f3046f4c0e76cbdd24858e.md index ff42a1741b7..c002422c8ec 100644 --- a/curriculum/challenges/chinese-traditional/blocks/lecture-understanding-error-handling-and-health-checks/69f3046f4c0e76cbdd24858e.md +++ b/curriculum/challenges/chinese-traditional/blocks/lecture-understanding-error-handling-and-health-checks/69f3046f4c0e76cbdd24858e.md @@ -34,7 +34,7 @@ app.use((err, req, res, next) => { Express 會知道它是錯誤處理常式,因為它有四個參數 — 新增的 `err`,以及其他中介層函式常見的 `req`、`res` 和 `next`。 -在接下來的課程中,你會學到更多關於錯誤處理中介層,以及它如何融入更廣泛的 Express 中介層堆疊。 +正如你在之前的課程中看到的,錯誤處理中介層是整體 Express 中介層堆疊的一部分。 ## 如何處理非同步錯誤 diff --git a/curriculum/challenges/chinese-traditional/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/6733affc29df1304e2c97e88.md b/curriculum/challenges/chinese-traditional/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/6733affc29df1304e2c97e88.md index ac13463ae27..1342f30fde9 100644 --- a/curriculum/challenges/chinese-traditional/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/6733affc29df1304e2c97e88.md +++ b/curriculum/challenges/chinese-traditional/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/6733affc29df1304e2c97e88.md @@ -31,6 +31,8 @@ class MyClassName { 大括號內的內容稱為類別本體。這裡是建構式和方法將會放置的地方。 +## 定義建構式 + 建構式是一個特殊的行為,當從類別產生新物件時會自動被呼叫。它通常用來初始化物件的屬性。 在這個範例中,你可以看到一個帶有建構式的 `Dog` 類別。 @@ -45,6 +47,8 @@ class Dog { 這裡使用 `this` 關鍵字來指涉 `Dog` 類別的當前實體,讓你可以將 `name` 屬性指定給正在創建的物件。你將在未來的課程中學習更多關於 `this` 關鍵字的內容。 +## 定義方法 + 在建構式下方,你可以擁有所謂的方法。方法是在類別內定義的函式,用來執行動作或操作行為。它們用於定義類別實體可以執行的行為。 這是一個為 `Dog` 類別添加名為 `bark` 的方法的範例。 @@ -63,6 +67,8 @@ class Dog { 當 `bark` 方法被呼叫時,訊息將會以傳入的實際名稱記錄到主控台。如果你創建一個名稱為 `"Buddy"` 的 `Dog` 實體,對該實體呼叫 `bark()` 方法將會在主控台列印 `"Buddy says woof!"`。 +## 實例化類別 + 一旦你定義了你的類別,你就可以使用 `new` 關鍵字、類別名稱及其引數來創建該類別的實體。 在此範例中,我們創建一個名稱為 `Gino` 的新 `Dog` 實體,然後將它指定給變數 `dog`。 @@ -73,7 +79,9 @@ const dog = new Dog("Gino"); 當你在程式碼中寫 `new Dog("Gino")` 時,新的物件會被建立,且建構式會自動以給定的引數被呼叫。 -你接著可以使用點記法存取這個屬性,就像你在以下這行程式碼中看到的那樣: +## 存取屬性和方法 + +你可以使用點記法存取 `name` 屬性,如以下程式碼所示: ```js console.log(dog.name); @@ -127,6 +135,8 @@ dog.bark(); ::: +## 使用類別表達式 + 如前所述,你也可以將類別定義為類別表達式。這是指該類別是匿名的,並指定給一個變數。 以下是先前範例作為類別表達式的樣子: diff --git a/curriculum/challenges/chinese-traditional/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/673403ca2bb16658309e3632.md b/curriculum/challenges/chinese-traditional/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/673403ca2bb16658309e3632.md index 49465b880b3..0afb885d83b 100644 --- a/curriculum/challenges/chinese-traditional/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/673403ca2bb16658309e3632.md +++ b/curriculum/challenges/chinese-traditional/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/673403ca2bb16658309e3632.md @@ -1,6 +1,6 @@ --- id: 673403ca2bb16658309e3632 -title: this 關鍵字如何運作? +title: This 關鍵字如何運作? challengeType: 19 dashedName: how-does-the-this-keyword-work --- @@ -11,6 +11,8 @@ dashedName: how-does-the-this-keyword-work 這些藍圖需要一種通用的方式來指涉在程式碼中被創建、存取或修改的特定物件。這正是 `this` 關鍵字的用途。它指涉程式碼應該執行的背景關係。若你在方法中使用它,`this` 的值將會是指向該方法相關物件的引用。透過這種方式,你可以在類別中存取該物件的屬性和方法,並在不同物件上重複使用該方法。 +## 建構式 + 例如,這裡我們有一個 `Dessert` 類別。這次,我們正在定義一個 `hasPeanuts` 屬性。 ```js @@ -33,6 +35,8 @@ this.hasPeanuts = hasPeanuts; 那是在建構式的背景關係中,但你也可以在其他方法中使用 `this` 關鍵字。 +## 方法 + 這是我們的 `Dessert` 類別,做了一些更改。現在我們有兩個屬性:`name` 和 `price`。 ```js @@ -91,10 +95,16 @@ console.log(brownie); 這全都要歸功於 `this` 關鍵字,它為你提供了一種在類別中指涉目前物件的一般方式。這讓你能夠在不同物件上重複使用該方法。 +## 函式與箭頭函式 + 這是在物件方法的背景關係中,但 `this` 關鍵字在獨立函式和箭頭函式中也會有值。 +### 一般函式 + 在獨立函式(非嚴格模式)中,其值通常取用全域物件,或在嚴格模式中為 `undefined`。 +### 箭頭函式 + `this` 關鍵字的值在箭頭函式中有些不同。箭頭函式會從它們被定義的外層範圍繼承 `this` 的值。它們不會創建自己的 `this` 綁定。這表示 `this` 的值取決於箭頭函式被定義的上下文,而不是箭頭函式被呼叫的位置或方式。這使得箭頭函式對於回呼或保持上下文非常有用。 但是,因為這個原因,`this` 的值在物件方法中不會指向目前的物件,所以在使用箭頭函式時你應該記住這一點。 diff --git a/curriculum/challenges/chinese-traditional/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5160.md b/curriculum/challenges/chinese-traditional/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5160.md index f7fc044744a..0b6ec7e949b 100644 --- a/curriculum/challenges/chinese-traditional/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5160.md +++ b/curriculum/challenges/chinese-traditional/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5160.md @@ -14,17 +14,17 @@ dashedName: whats-the-process-for-creating-web-standards 1. ## 辨識需求 標準的起點通常來自於摩擦,例如開發者遇到瓶頸、瀏覽器對同一行為有不相容的實作,或是平台還不支援某個新功能。某個人,某個地方,因為受挫而決定把問題寫下來。這個人可以是任何人:開發者、有產品需求的大公司,或是瀏覽器團隊內的工程師。在這個階段,重點不是權威,而是證據,以及這個問題是否真實存在,還有是否有足夠多人遇到這個問題,值得網頁平台投入關注。 -1. **提出想法與初步討論** - 這個想法會以非正式的方式寫下來,可能是一個 GitHub issue、一份簡短的文件,或是說明問題並勾勒可能解法的 explainer。這個階段的目標不是產出完成的規範,而是確認這個問題是否引起共鳴。其他開發者是否認同?瀏覽器廠商有興趣嗎?有明顯的解法,還是有多個競爭方案?在 TC39,這個早期階段對應 Stage 0 和 Stage 1。在 W3C,通常會先在 Community Group 非正式討論,之後才成立正式的 Working Group。WHATWG 則是在核心原始碼庫的 GitHub 上公開討論。雖然場域不同,但功能是一樣的。 +1. ## 提案與早期討論 + 這個想法會透過 GitHub 問題、簡短文件或說明文件非正式地寫出來,描述問題並勾勒可能的解決方案。在這個階段,目標不是產出完成的規格,而是了解問題是否引起共鳴。其他開發者是否認同?瀏覽器廠商是否有興趣?是否有明顯的解決方案,或是有幾個競爭方案?在 TC39,這個早期階段對應於 Stage 0 和 Stage 1。在 W3C,這通常在正式工作群組成立前,先在社群群組中非正式進行。WHATWG 則透過其核心儲存庫上的公開 GitHub 討論來處理。場域不同,但功能相同。 -1. **撰寫規範** - 如果提案獲得關注,就需要有人或小團隊來撰寫實際的規範(spec)。規範不是部落格文章或教學,而是精確、正式的文件,詳細描述這個功能在所有可能情境下必須如何運作。邊界情境、錯誤狀況、與現有功能的互動,以及安全性影響,都必須仔細思考並寫下來。 +1. ## 撰寫規格 + 如果提案獲得關注,某人或小團隊必須撰寫實際的規格(spec)。規格不是部落格文章或教學,而是一份精確且正式的文件,詳細描述一個功能在每種可能情況下必須如何運作。邊緣案例、錯誤狀況、與現有功能的互動,以及安全性影響都必須仔細思考並寫下來。 -1. **審查、異議與反覆修正** - 草案會公開發表,並由其他瀏覽器廠商審查。這個階段是大部分實質工作的所在。會有異議被提出,規範也會不斷修訂。如果有主要瀏覽器引擎拒絕實作這個功能,無論技術多好,這個功能都很難成為標準。這個階段的共識建立可能會花很長時間。有些提案會因為設計細節的協商而停滯多年,有些則在無法達成共識時直接終止。 +1. ## 審查、異議與反覆修正 + 草案會公開發佈並由其他瀏覽器廠商審查。這是大部分實際工作的所在。異議會被提出,規格也會被修訂。一個主要瀏覽器引擎拒絕實作的功能,無論技術上多優秀,通常都不會成為標準。這階段的共識建立可能需要很長時間。有些提案因廠商在設計細節上協商而停滯多年。另一些則在明顯無法達成共識時完全終止。 -1. **實作與測試** - 當規範足夠穩定後,瀏覽器廠商會開始實作。通常會先用功能旗標(feature flag)開啟,方便測試又不影響現有使用者。實作過程常常會發現規範沒預料到的問題,這些問題會再回到編輯者手上釐清。共用的測試套件會驗證每個實作是否真的行為一致。如果 Chrome、Firefox 和 Safari 都通過相同的測試,代表規範沒問題。如果結果不同,要嘛是規範不夠明確,要嘛是某個實作有 bug。 +1. ## 實作與測試 + 一旦規格足夠穩定,瀏覽器廠商開始實作。通常會先以功能旗標啟動,讓它能在不影響現有使用者的情況下測試。實作過程常會發現規格未預料到的問題,這些問題會回傳給編輯者進行澄清。共用測試套件用來驗證每個實作是否真的以相同方式運作。如果 Chrome、Firefox 和 Safari 都通過相同測試,代表規格有效。如果它們出現差異,要麼是規格不清楚,要麼是某個實作有錯誤。 1. ## 定案 當有多個獨立實作、測試通過、社群也滿意時,標準就會定案。在 W3C,這代表達到 Recommendation 階段。在 TC39,則是進入 Stage 4,之後這個功能會納入下一版 ECMAScript 年度發行。在 WHATWG,沒有單一的定案時刻,活標準會隨著共識持續更新。整個流程可能只需幾個月(如果是小且無爭議的新增),也可能超過十年(如果很複雜或涉及政治角力)。例如 CSS Grid,2011 年首次提出,直到 2017 年才在所有主流瀏覽器上推出。從好點子到穩定、普遍支援的標準,這段落差就是開放網路大部分工作默默發生的地方。 @@ -109,7 +109,7 @@ dashedName: whats-the-process-for-creating-web-standards ## --answers-- -用來取代書面規範的需求。 +取代書面規格的需求。 ### --feedback-- @@ -121,7 +121,7 @@ dashedName: whats-the-process-for-creating-web-standards --- -用來為行銷目的評比瀏覽器效能。 +為行銷目的排名瀏覽器效能。 ### --feedback-- diff --git a/curriculum/challenges/chinese-traditional/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5161.md b/curriculum/challenges/chinese-traditional/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5161.md index de2cd71b521..2186db215b2 100644 --- a/curriculum/challenges/chinese-traditional/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5161.md +++ b/curriculum/challenges/chinese-traditional/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5161.md @@ -13,23 +13,23 @@ dashedName: what-does-the-lifecycle-of-web-standards-features-look-like 把這個流程想成規則書,而生命週期則是你實際玩遊戲時發生的事情。 -1. **提案** - 每個特性都從有人在意的問題開始。開發者、瀏覽器工程師或公司會在 GitHub 提出議題或說明,描述目前網頁無法做到什麼,以及為什麼應該做到。在這階段,想法還很鬆散,問題多於答案。目標只是看看是否有人也認同這個痛點。 +1. ## 提案 + 每個特性都始於有人在意到一個問題並願意將其寫下。開發者、瀏覽器工程師或公司會在 GitHub 提出議題或說明,描述目前網路無法做到的事以及為何應該做到。在這個階段,想法還很模糊,問題多於答案。目標只是要確認是否有人也認同這個痛點。 -1. **孵育** - 如果提案引起共鳴,它會進入公開討論和早期設計階段。會草擬出不同的方案,收集使用案例,社群會對這個想法進行壓力測試。許多提案會在這裡夭折,可能是因為問題太冷門,或沒有解法能滿足所有人。存活下來的提案會有更清晰的輪廓,並至少獲得一些瀏覽器廠商的興趣。 +1. ## 孵育 + 如果提案引起共鳴,它會進入公開討論和早期設計階段。會草擬出競爭方案、收集使用案例,社群會對這個想法進行壓力測試。許多提案會在此階段夭折,可能是因為問題太過小眾,或沒有解法能滿足所有人。存活下來的提案會有更清晰的輪廓,並至少獲得部分瀏覽器廠商的關注。 -1. **規格** - 存活的提案會被寫成正式規格。每個邊緣案例、錯誤狀況和與現有特性的互動都必須明確定義。這是好點子遇上現實的時刻。模糊的概念必須變成兩個獨立工程師都能讀懂並完全相同實作的明確規則。 +1. ## 規格 + 存活的提案會被寫成正式的規格。每個邊緣案例、錯誤狀況,以及與現有特性的互動都必須明確定義。這是好點子面對現實的時刻。模糊的概念必須變成兩位獨立工程師都能讀懂並完全相同實作的精確規則。 -1. **相容性測試** - 在特性被視為穩定之前,它必須在每個瀏覽器中表現一致。W3C Web Platform Tests 套件是驗證這點的主要工具。這是一套共用的測試,Chrome、Firefox、Safari 等瀏覽器都會用它來測試自己的實作。若結果不一致,代表規格不夠明確,或有人有錯誤。這兩者都必須解決,特性才能繼續前進。 +1. ## 互通性測試 + 在特性被視為穩定之前,它必須在每個瀏覽器中表現一致。W3C Web Platform Tests 套件是驗證這點的主要工具。這是一套由 Chrome、Firefox、Safari 等瀏覽器共同執行的測試集合。測試結果若有差異,代表規格不夠明確,或有人實作有錯誤。這兩者都必須解決,特性才能繼續推進。 -1. **定案** - 當多個獨立實作通過測試後,特性就會定案。對 W3C 來說是推薦標準,對 TC39 是第 4 階段,對 WHATWG 是穩定的活文件標準。旗標會被移除,特性會發布給使用者。此時,它成為基礎網頁平台的一部分,每個開發者都能永遠依賴。 +1. ## 定案 + 一旦多個獨立實作通過測試,該特性就會被定案。對 W3C 來說是推薦標準,對 TC39 是第 4 階段,對 WHATWG 是穩定的活文件標準。旗標會被移除,特性會正式發佈給使用者。此時,它成為基礎網路平台的一部分,每個開發者都能永久依賴它。 -1. **淘汰** - 不是每個標準都能長久。某些特性會被更好的取代,其他則可能有當時未察覺的安全或隱私問題。當特性需要被淘汰時,它會被正式標記為淘汰,也就是仍支援但建議開發者停止使用。最後會從規格中移除。瀏覽器移除這些特性時會非常謹慎且緩慢,因為網頁的核心承諾是舊頁面能繼續運作。有些淘汰的特性會在瀏覽器中存在數十年,純粹是為了向後相容的義務。 +1. ## 棄用 + 並非每個標準都能隨時間保持良好。有些特性被更好的取代,有些則發現當初未察覺的安全或隱私問題。當特性需要被淘汰時,它會被正式標記為棄用,也就是仍被支援但建議開發者停止使用。最終它會從規格中移除。瀏覽器移除這些特性時非常謹慎且緩慢,因為網路的核心承諾是舊網頁能繼續運作。有些棄用特性會因向後相容義務而在瀏覽器中存在數十年。 # --questions-- @@ -39,7 +39,7 @@ dashedName: what-does-the-lifecycle-of-web-standards-features-look-like ## --answers-- -孵育 +孵化階段 --- @@ -83,7 +83,7 @@ dashedName: what-does-the-lifecycle-of-web-standards-features-look-like --- -用來取代書面規格的需求。 +取代書面規格的需求。 ### --feedback-- diff --git a/curriculum/challenges/chinese-traditional/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5162.md b/curriculum/challenges/chinese-traditional/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5162.md index 88806189a2d..0b6600e3a31 100644 --- a/curriculum/challenges/chinese-traditional/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5162.md +++ b/curriculum/challenges/chinese-traditional/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5162.md @@ -9,26 +9,26 @@ dashedName: what-are-the-key-principles-that-web-standards-are-built-on 網頁標準不僅僅是技術文件,它們還反映了關於網路應該是什麼、應該服務誰的一套價值觀。了解這些原則,能幫助你不只看懂網路如何運作,更能理解為什麼網路會被這樣設計。讓我們一起來討論這些原則。 -1. **開放性** - 網頁標準是在公開的環境下制定,並且實作時不需支付權利金。任何人都可以閱讀規格,任何人都可以開發瀏覽器,沒有任何公司可以因為你實作標準而收取授權費。這種開放性讓網路有別於專有平台,也讓小團隊能夠打造出觸及數十億人的工具,而不需要經過守門人的同意。 +1. ## 開放性 + 網頁標準是在公開的環境中開發且免版稅實作。任何人都可以閱讀規範,任何人都可以建置瀏覽器,且沒有公司能對實作標準收取授權費。這種開放性是網路與專有平台的區別,也是讓小團隊能打造觸及數十億人的工具而不需經過守門人許可的原因。 -1. **無障礙** - 網路的設計目標是讓每個人都能使用,不論能力如何。無障礙不是網頁標準的附加功能,而是 HTML、CSS 和瀏覽器行為設計時就內建的。W3C 的 WCAG 指南訂定了實務上「可及性」的正式標準。任何會對螢幕閱讀器、鍵盤操作或輔助科技使用者造成障礙的功能,都被認為是設計上的缺陷,而不僅僅是道德問題。 +1. ## 無障礙 + 網路設計的目標是讓所有人都能使用,無論能力如何。無障礙不是網頁標準的附加功能,而是內建於 HTML、CSS 和瀏覽器行為的設計中。W3C 的 WCAG 指南設定了實務中無障礙的正式標準。任何對使用螢幕閱讀器、鍵盤導航或輔助技術的使用者造成障礙的功能,從設計上就被視為缺陷,而不僅是道德問題。 -1. **互通性** - 最根本的原則是網路應該在任何地方都能以相同方式運作。只要依標準建置的網頁,無論在 Chrome、Firefox、Safari,還是在 Windows、macOS、Linux、Android 或 iOS 上,都應該有相同的行為。沒有互通性,網路就會分裂成各自為政的瀏覽器體驗,開發者也被迫重複撰寫相同內容。每一項標準的核心目的,就是為了避免這種情況。 +1. ## 相容性 + 最根本的原則是網路應該在任何地方都能以相同方式運作。依標準建置的頁面應在 Chrome、Firefox 和 Safari,以及 Windows、macOS、Linux、Android 和 iOS 上表現一致。若沒有相容性,網路將分裂成一堆瀏覽器專屬的體驗,開發者必須重複撰寫相同內容。每個標準的核心目的,就是為了避免這種情況。 -1. **向下相容** - 網路幾乎絕對承諾不會破壞舊有內容。1999 年寫的網頁,今天在現代瀏覽器中仍然能正確呈現,標準制定單位在設計新功能時非常重視這項責任。因此新功能總是以「加上去」的方式疊加,而不是取代舊有內容。這雖然有時會讓設計師感到受限,但也正是讓網路成為獨特且持久平台的原因。 +1. ## 向後相容 + 網路幾乎絕對承諾不破壞舊有內容。1999 年寫的頁面在現代瀏覽器中仍應能正確呈現,標準組織在設計新功能時也非常重視這項義務。這就是為什麼新功能是疊加在舊有功能之上,而非取代它們。這種條件有時會讓設計師感到挫折,但同時也讓網路成為一個獨特且耐用的平台。 -1. **隱私與安全** - 現代標準在發布前都會審查其對隱私和安全的影響。任何可能暴露使用者資料或讓追蹤變得容易的新 API,都會在標準制定過程中受到嚴格審查。這項原則認為,平台應該預設就保護使用者安全,開發者的便利永遠不能以犧牲使用者安全為代價。 +1. ## 隱私與安全 + 現代標準在發布前會審查其對隱私和安全的影響。可能暴露使用者資料或啟用追蹤的新 API,在標準制定過程中會受到嚴格審查。原則是平台應預設保護使用者,開發者的便利絕不應以犧牲使用者安全為代價。 -1. **分層設計** - 網路是由明確、可組合的層次構成:HTML 負責結構、CSS 負責呈現、JavaScript 負責行為。標準的設計會尊重這些界線,而不是將它們混為一談。良好的分層功能可以逐步採用。即使網頁沒用 JavaScript 也能運作,瀏覽器不支援新 CSS 屬性時也能合理呈現。這種關注分工的設計,正是網路具有韌性的關鍵。 +1. ## 分層 + 網路是由明確且可組合的分層建構:HTML 負責結構,CSS 負責呈現,JavaScript 負責行為。標準設計尊重這些界限,而非將它們合併。一個良好分層的功能可以逐步採用。不使用 JavaScript 的頁面仍能運作,不支援新 CSS 屬性的瀏覽器仍能合理呈現內容。這種關注點分離賦予網路韌性。 -1. **漸進增強** - 和分層設計密切相關的是,網路應該先讓每個人都能使用,然後再針對功能更強的瀏覽器或裝置提供更佳體驗。標準功能在不被支援時應該能優雅降級,而不是完全失效。這個原則影響了新 CSS 屬性的規範方式、JavaScript API 如何處理缺少能力,以及標準制定單位如何看待現代瀏覽器與全球仍廣泛使用的舊版瀏覽器之間的落差。 +1. ## 漸進式增強 + 與分層密切相關的是網路應該先為所有人提供基本功能,然後為擁有更強大瀏覽器或裝置的使用者提供更佳體驗。標準功能在不被支援時應優雅降級,而非完全失效。這個原則影響新 CSS 屬性的規範方式、JavaScript API 如何處理缺少的功能,以及標準組織如何看待現代瀏覽器與全球仍廣泛使用的舊瀏覽器之間的差距。 # --questions-- @@ -50,7 +50,7 @@ dashedName: what-are-the-key-principles-that-web-standards-are-built-on --- -漸進增強。 +漸進式增強。 ### --feedback-- diff --git a/curriculum/challenges/chinese-traditional/blocks/lecture-user-interface-design-fundamentals/672baa97f2990e6631d522e7.md b/curriculum/challenges/chinese-traditional/blocks/lecture-user-interface-design-fundamentals/672baa97f2990e6631d522e7.md index ac2729713dc..1d6dfaf093d 100644 --- a/curriculum/challenges/chinese-traditional/blocks/lecture-user-interface-design-fundamentals/672baa97f2990e6631d522e7.md +++ b/curriculum/challenges/chinese-traditional/blocks/lecture-user-interface-design-fundamentals/672baa97f2990e6631d522e7.md @@ -9,6 +9,8 @@ dashedName: how-do-you-create-good-background-and-foreground-contrast-in-your-de **注意**:有些互動範例可能會使用你還沒學過的 CSS。不要擔心要理解所有的程式碼。這些範例的目標是為你展示這些設計概念的預覽,讓你更了解事情的運作方式。 +## 理解對比 + 首先,你可能需要熟悉對比度。對比度是兩種顏色之間的差異-或是辨別它們的難易程度。 對比度較高的顏色在視覺上會更為鮮明,而對比度較低的顏色在視覺上會較為相似。 例如,黑色和白色具有非常高的對比度比率,而淺藍色和淺紫色的對比度較低。 @@ -53,6 +55,8 @@ dashedName: how-do-you-create-good-background-and-foreground-contrast-in-your-de ::: +### 對文字應用對比 + 當然,在這些範例中,由於版面配置,區別可能會更清楚。但將這些顏色應用到文字上呢?你可以有高對比的黑色文字在白色背景上,以及低對比的紫色文字在藍色背景上。 :::interactive_editor @@ -96,7 +100,9 @@ dashedName: how-do-you-create-good-background-and-foreground-contrast-in-your-de ::: -但是你如何判斷什麼是「足夠好」的對比度?你不能僅根據文字在你眼中的外觀來判斷,因為每個使用者的體驗都不同。幸運的是,網頁內容無障礙指引(WCAG)提供了這方面的標準。 +### WCAG 對比標準 + +但是你如何判斷什麼是「足夠好」的對比度?你不能僅根據文字在你眼中的外觀來判斷,因為每個使用者的體驗都不同。幸運的是,網頁內容無障礙指引(WCAG)提供了這方面的標準。 對比度為 4.5:1 的文字被視為 AA 標準,這是你應該遵守的最低標準,以便大多數使用者能夠存取。對比度為 7:1 的文字被視為 AAA 標準,並確保最佳的存取層級。 @@ -141,9 +147,11 @@ dashedName: how-do-you-create-good-background-and-foreground-contrast-in-your-de ::: +### 比較高對比與低對比比率 + 有許多網站可以檢查兩種顏色之間的對比度,但大多數瀏覽器會允許你直接在你網站的開發者工具中執行此操作。 -讓我們再看幾個對比度的範例,以更好地理解這個概念。 +讓我們再看幾個對比度的範例,以更好地理解這個概念。 這是一個黑色文字在白色背景上的範例,其對比度為 21:1。 @@ -221,8 +229,12 @@ dashedName: how-do-you-create-good-background-and-foreground-contrast-in-your-de 此範例的對比度為 1.48:1,甚至未達到 AA 標準。 +## 調整顏色屬性 + 你該如何修正這個問題?其實,有三個面向會影響對比度比率。 +### 調整色相 + 第一個是色相,它表述一般的顏色型別,例如紅色、藍色、橙色。讓我們將色相移動到離藍色更遠的地方。在這種情況下,讓我們使用紅色。 :::interactive_editor @@ -267,6 +279,8 @@ dashedName: how-do-you-create-good-background-and-foreground-contrast-in-your-de ::: +### 調整飽和度 + 不幸的是,這個變更只將對比度提升到 1.49:1,這表示你需要改變飽和度,或是顏色的「量」。讓我們增加文字中紅色的量。這讓我們更接近目標,達到 3.54:1 的對比度。 :::interactive_editor @@ -325,6 +339,8 @@ dashedName: how-do-you-create-good-background-and-foreground-contrast-in-your-de ::: +### 調整明度 + 不過,你可以透過改變最後一個數值,也就是亮度,來更接近目標。亮度表述顏色中白色的含量。 讓我們降低紅色的亮度。現在在淺藍色背景上有一個更深的紅色,這使對比度比率達到 10.34:1。 @@ -439,11 +455,11 @@ dashedName: how-do-you-create-good-background-and-foreground-contrast-in-your-de ## --text-- -根據網頁內容存取指引(WCAG),文字符合 AA 標準的最低對比度比率是多少? +根據網頁內容存取指引(WCAG),文字符合 AA 標準的最低對比度比率是多少? ## --answers-- -3:1 +3:1 ### --feedback-- @@ -451,11 +467,11 @@ dashedName: how-do-you-create-good-background-and-foreground-contrast-in-your-de --- -4.5:1 +4.5:1 --- -7:1 +7:1 ### --feedback-- @@ -475,7 +491,7 @@ dashedName: how-do-you-create-good-background-and-foreground-contrast-in-your-de ## --text-- -以下哪一項未被提及為影響對比度比率的因素? +以下哪一項未被提及為影響對比度比率的因素? ## --answers-- @@ -495,7 +511,7 @@ dashedName: how-do-you-create-good-background-and-foreground-contrast-in-your-de --- -亮度 +明度 ### --feedback-- diff --git a/curriculum/challenges/chinese-traditional/blocks/lecture-what-is-css/672acc100d59d24da7b4e09c.md b/curriculum/challenges/chinese-traditional/blocks/lecture-what-is-css/672acc100d59d24da7b4e09c.md index fab49bc98b7..ebf02e7e7fc 100644 --- a/curriculum/challenges/chinese-traditional/blocks/lecture-what-is-css/672acc100d59d24da7b4e09c.md +++ b/curriculum/challenges/chinese-traditional/blocks/lecture-what-is-css/672acc100d59d24da7b4e09c.md @@ -7,10 +7,14 @@ dashedName: what-are-the-different-types-of-css-combinators # --interactive-- +## CSS 組合器 + CSS 組合器用於定義 CSS 中選取器之間的關係。它們有助於根據元素與其他元素的關係來選取元素,從而實現更精確且高效的樣式設定。 我們將討論一些主要的 CSS 組合器及其使用案例,從後代組合器開始。 +### 後代組合器 + 後代組合子用來選取被第二個選擇器匹配且嵌套在符合第一個選擇器的祖先元素內的元素。祖先可以是父元素、祖父元素,或文件樹中更上層的任何祖先。 為了更好地理解這個運作方式,讓我們來看一個範例。 @@ -42,6 +46,8 @@ figure img { 如果你在 `figure` 元素內有多個影像,使用後代組合器會是為每個影像套用實心黑色邊框的好方法。 +### 子元素組合器 + 另一種型別的組合器是子組合器。 CSS 中的子代組合器(`>`)用於選取指定父元素的直接子元素。 @@ -102,6 +108,8 @@ CSS 中的子代組合器(`>`)用於選取指定父元素的直接子元素 因為另外兩個段落元素是巢狀在 `div` 元素內,所以它們不被視為 `container` 類別的直接子元素,且不會獲得藍色的文字顏色。 +### 下一兄弟組合器 + 另一個常見的組合器是 next-sibling 組合器。 CSS 中的下一個兄弟組合器(`+`)會選取緊接在指定兄弟元素後面的元素。當你想要將樣式套用到直接跟隨另一個元素的元素時,這個組合器非常有用,允許根據元素相對於其兄弟元素的位置進行目標式的樣式設定。 @@ -150,6 +158,8 @@ img + figcaption { 在此範例中,下一個兄弟組合器(`+`)會選取緊接在 `img` 元素後的 `figcaption` 元素。所套用的 CSS 規則會在 `figcaption` 周圍添加 `4px solid black border`。 +### 後續兄弟組合器 + 另一個常見的組合器是後續兄弟組合器。 CSS 中的後續兄弟組合器(`~`)會選取指定元素之後的所有兄弟元素。 @@ -202,6 +212,8 @@ h2 ~ p { 後續兄弟組合器(`~`)會標的所有出現在 `h2` 元素之後的段落兄弟元素,無論它們是否為直接兄弟元素。 +## 為什麼 CSS 組合器很重要 + 總之,理解並使用各種 CSS 組合器讓你能夠對你的 HTML 元素套用精確的樣式,提升你設計的控制元件和彈性。 透過精通這些選擇器,你可以創建更複雜且具標的性的樣式規則,從而提升你的網頁外觀與功能。 diff --git a/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-code-editors-and-ides/672d26269456511aa3db614d.md b/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-code-editors-and-ides/672d26269456511aa3db614d.md index b0ef5b9571c..e32e4120fb5 100644 --- a/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-code-editors-and-ides/672d26269456511aa3db614d.md +++ b/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-code-editors-and-ides/672d26269456511aa3db614d.md @@ -7,25 +7,25 @@ dashedName: what-is-a-code-editor-and-ide # --description-- -你可能會認為這些是相同的東西,但並不完全相同。程式碼編輯器是任何允許你編輯程式碼檔案的應用程式。整合開發環境(IDE)是一個完整的應用程式,允許你在編輯程式碼的同時編譯、執行和偵錯程式碼。 +你可能會以為這兩者是一樣的,但其實不完全相同。程式碼編輯器是任何允許你編輯程式碼檔案的應用程式。IDE,或稱整合開發環境,是一個完整的應用程式,讓你在編輯程式碼的同時,可以建置、執行和偵錯你的程式碼。 -也許一些範例會有所幫助。 +一些範例會有助於理解。 首先,讓我們來看看幾個流行的整合開發環境。Visual Studio 是微軟提供的一個整合開發環境,提供一套完整的工具,用於建置、偵錯及部署跨多個平台的應用程式。 -另一個整合開發環境是 XCode。Xcode 是 Apple 所設計的整合開發環境,用於為 macOS、iOS、watchOS 和 tvOS 建立、撰寫程式碼及偵錯應用程式。 +另一個 IDE 是 Xcode。Xcode 是 Apple 的整合開發環境,專為建立、撰寫程式碼和偵錯 macOS、iOS、watchOS 和 tvOS 應用程式而設計。 -另一個整合開發環境是 Android Studio。Android Studio 是 Google 專門為建置、偵錯和測試 Android 應用程式而設計的整合開發環境。 +Android Studio 是由 Google 開發的整合開發環境,專門用於建置、偵錯和測試 Android 應用程式。 這些只是一些整合開發環境的範例。現在,讓我們來看看幾個受歡迎的程式碼編輯器。 Visual Studio Code 是微軟推出的輕量級、開放原始碼程式碼編輯器,支援廣泛的程式設計語言,並透過擴充套件提供偵錯、語法凸顯標示和版本控制等功能。 -另一個受歡迎的編輯器是 Sublime Text。Sublime Text 是一款快速、多功能的文字編輯器,以其簡潔的介面、強大的功能,以及透過訂製的語法色彩突顯和外掛程式支援廣泛的程式設計語言而聞名。 +為了快速且多功能的編輯體驗,Sublime Text 提供流暢的介面,並透過可自訂的語法凸顯標示和外掛程式,支援多種程式語言。 -另一個是 Notepad++。這是一款免費、開放原始碼的 Windows 文字和原始碼編輯器,提供語法凸顯標示、程式碼摺疊,以及一系列外掛程式以提升生產力和訂製功能。 +Windows 使用者也可以使用 Notepad++,這是一款免費且開源的文字和原始碼編輯器,提供語法凸顯標示、程式碼摺疊,以及多種外掛程式來提升生產力和自訂功能。 -你可能已經注意到程式碼編輯器主要專注於檔案的文字內容,而整合開發環境則提供各種工具來管理你的程式碼。 +你可能已注意到,程式碼編輯器主要專注於檔案的文字內容,而 IDE 則提供各種工具來管理你的程式碼。 這些範例都是你可以在你的電腦上執行的區域的程式,但也有你可以使用的雲端編輯器。 @@ -35,11 +35,11 @@ Visual Studio Code 是微軟推出的輕量級、開放原始碼程式碼編輯 Replit 是一個線上平台,提供一個協作環境讓使用者能夠直接從網頁瀏覽器撰寫、執行和分享多種程式語言的程式碼。 -另一個受歡迎的雲端編輯器是 GitHub Codespaces。這是一個雲端開發環境,能夠即時存取從 GitHub 直接提供的完整組態程式碼編輯器和開發工具,實現無縫的程式碼撰寫和協作。 +另一個受歡迎的雲端編輯器是 GitHub Codespaces。這是一個雲端開發環境,能直接從 GitHub 即時存取完整組態的程式碼編輯器和開發工具,實現無縫的程式設計和協作。 -另一個是 Ona。Ona 是一個基於雲端的開發環境,能與 GitHub 和 GitLab 整合,提供即時且可訂製的工作區,讓你直接從瀏覽器進行程式編寫、建置和偵錯。 +Ona 與 GitHub 和 GitLab 整合,提供即時且可自訂的工作區,讓你直接從瀏覽器進行程式設計、建置和偵錯。 -而且還有更多選項。某些選項,例如 Visual Studio Code,具有高度擴充性,能夠支援多種不同的專案類型和語言。其他選項可能專門針對少數語言或專案類型進行調整。 +還有許多其他選項。有些選項,例如 Visual Studio Code,具有高度擴充性,能支援多種專案類型和程式語言。其他選項則可能專門針對少數程式語言或專案類型設計。 你使用的應用程式可能會因特定專案而異。你應該探索這些選項,以了解哪一個最適合你的需求。 diff --git a/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-code-editors-and-ides/672d45583fd75a504136fbbb.md b/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-code-editors-and-ides/672d45583fd75a504136fbbb.md index 3d8c55a25a5..8b68d0ab185 100644 --- a/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-code-editors-and-ides/672d45583fd75a504136fbbb.md +++ b/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-code-editors-and-ides/672d45583fd75a504136fbbb.md @@ -1,17 +1,17 @@ --- id: 672d45583fd75a504136fbbb -title: 如何將 Visual Studio Code 安裝到你的電腦 +title: 如何在你的電腦上安裝 Visual Studio Code challengeType: 19 dashedName: how-to-install-visual-studio-code-onto-your-computer --- # --description-- -要安裝 VS Code,你需要造訪他們的網站以取得適用於你的作業系統的安裝程式。請確定你造訪的是 VS Code 網站,而不是 Visual Studio 網站。 +要安裝 VS Code,你需要前往 VS Code 網站下載適合你作業系統的安裝程式。請確定你是造訪 VS Code 網站,而不是 Visual Studio 網站。 -對於 Windows,你可以下載 EXE 安裝程式。下載完成後,執行該檔案,安裝精靈將引導你完成安裝程序。 +對於 Windows,你可以下載 EXE 安裝程式。下載完成後,執行該檔案,安裝精靈會引導你完成安裝流程。 -對於 Mac,你可以下載一個包含可執行 `.app` 的 zip 壓縮檔。你也可以透過 homebrew 安裝 VS Code。 +對於 Mac,你可以下載一個 `.zip` 壓縮檔,裡面包含一個可執行的 `.app`。你也可以透過 Homebrew 安裝 VS Code。 在你的 Mac 上開啟終端機應用程式並執行以下指令: diff --git a/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-code-editors-and-ides/672d45651d83b450801efb3a.md b/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-code-editors-and-ides/672d45651d83b450801efb3a.md index cff97ebbecc..159d2a843d4 100644 --- a/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-code-editors-and-ides/672d45651d83b450801efb3a.md +++ b/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-code-editors-and-ides/672d45651d83b450801efb3a.md @@ -9,21 +9,21 @@ dashedName: how-to-create-a-project-and-run-your-code-locally-in-vs-code 要開始,你應該知道 VS Code 將專案視為「工作區」。工作區是你在 VS Code 中開啟的任何目錄。 -首先,你需要使用命令列介面為你的新專案創建一個新的目錄。目錄是資料夾的另一種稱呼。 +首先,你需要使用命令列介面來創建一個新的目錄,作為你的新專案。目錄就是資料夾的另一種說法。 -命令列介面,簡稱 CLI,允許你透過基於文字的指令與你的作業系統互動。你將在未來的課程中學習更多關於這些工具的內容。 +命令列介面,簡稱 CLI,讓你可以透過文字指令與你的作業系統互動。你會在未來的課程中學到更多關於這些工具的內容。 如果你使用的是 Windows,你可以使用命令提示字元或 PowerShell。如果你使用的是 Mac,你可以開啟你的終端機應用程式。 -當命令列開啟後,輸入 `cd ~` 指令並按下鍵盤上的 `enter` 鍵以切換到主目錄。接著輸入 `mkdir my-project` 指令並按下 `enter` 鍵。`mkdir`,或稱「make directory」,是用來創建新目錄的指令。然後你應該使用 VS Code 開啟你的新目錄。 +命令列開啟後,導航到你的主目錄。在命令提示字元中,輸入 `cd /d %USERPROFILE%` 並按鍵盤上的 `Enter`。在 PowerShell 或 macOS 終端機中,輸入 `cd ~` 並按 `Enter`。接著輸入 `mkdir my-project` 指令並按 `Enter`。`mkdir`,也就是「make directory」,是用來創建新目錄的指令。然後你應該用 VS Code 開啟你新創建的目錄。 -還有其他一些圖形化方式來創建新的目錄。 +在 VS Code 中也有其他方式可以開啟目錄。 根據你的作業系統,你可能會有一個背景關係選單(或右鍵選項)可以直接從你的檔案總管開啟 VS Code。你也可以選擇雙擊 VS Code 應用程式。如果你對命令列感到熟悉,你可以執行命令 `code /path/to/folder`。 一旦開啟,你應該會看到一個新的空白工作區。 -要創建一個新的檔案,請點擊左上角的 `File` 選單並選擇 `New File...`。然後將你的檔案命名為 `index.html` 並點擊 `Save`。 +要創建新檔案,點擊左上角的 `File` 選單,然後選擇 `New File...`。接著將檔案命名為 `index.html`,並點擊 `Save`。 現在你應該可以在瀏覽器分頁中看到你的新檔案。試著為你的 `index.html` 檔案添加一些 HTML。 @@ -31,15 +31,15 @@ dashedName: how-to-create-a-project-and-run-your-code-locally-in-vs-code 相反地,你應該將你的 HTML 檔案放在適當的網頁伺服器後面。如果你是程式碼新手,這聽起來可能是一項令人生畏的任務,但其實有一種方法可以直接從 VS Code 完成這件事。 -你需要先取得 *Live Server* 擴充套件,該擴充套件可在市集中免費取得。 +你需要先取得 Live Server 擴充套件,它在市場中是免費提供的。 -點擊左下角的擴充套件分頁,並在搜尋欄中輸入 `Live Server`。 +點擊左側邊欄的擴充套件標籤,並在搜尋欄輸入 `Live Server`。 -安裝完成後,你應該會在你的狀態列看到一個 `Go live` 按鈕。請確定你已開啟你的 HTML 檔案,然後點擊它。 +安裝完成後,你應該會在狀態列看到一個 `Go Live` 按鈕。確定你已開啟 HTML 檔案,然後點擊它。 你的新頁面應該會自動在瀏覽器的新分頁中開啟。如果沒有,你可以直接前往 `http://localhost:5500/`。 -恭喜!你現在已經在 VS Code 中設定好你自己的專案,並且可以使用 live server 查看你的變更。 +恭喜!你現在已經在 VS Code 中設定好自己的專案,並能透過 Live Server 觀看你的變更。 # --questions-- @@ -57,7 +57,7 @@ Visual Studio Code 認為「工作區」是什麼? --- -你從中開啟 VS Code 的目錄。 +你在 VS Code 中開啟的目錄。 --- diff --git a/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-code-editors-and-ides/672d456f4ac35950b300e93f.md b/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-code-editors-and-ides/672d456f4ac35950b300e93f.md index 804ab1aa316..8ee6b1e15ce 100644 --- a/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-code-editors-and-ides/672d456f4ac35950b300e93f.md +++ b/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-code-editors-and-ides/672d456f4ac35950b300e93f.md @@ -9,21 +9,21 @@ dashedName: what-are-several-useful-keyboard-shortcuts-for-maximizing-productivi 你很可能已經熟悉一些基本的快速鍵,這些快速鍵是從你的作業系統繼承而來的。像是 `Ctrl + S` 用來存檔、`Ctrl + C` 用來複製,以及 `Ctrl + V` 用來貼上的快速鍵,都可以在 VS Code 中使用。 -但有一些是應用程式特定的,仍然可以提升你的生產力。值得注意的是,這些捷徑有些可能因作業系統而異。 +但有一些是應用程式專屬的,仍然可以提升你的生產力。值得注意的是,這些快捷鍵在不同作業系統上可能會有所不同。 -例如,`Shift + Alt + F` 將會在目前開啟的檔案上執行你組態好的格式化工具(例如 prettier,針對 JavaScript 專案)。 +舉例來說,`Shift + Alt + F` 會在目前開啟的檔案上執行你組態好的格式化工具(例如 JavaScript 專案中的 Prettier)。 -或按 `Ctrl + Shift + F`(Windows),或 `Cmd + Shift + F`(Mac),以搜尋你工作區中所有檔案的文字內容。然後,如果你想執行尋找與取代,按 `Ctrl + Shift + H`(Windows),或 `Cmd + Shift + H`(Mac)。 +使用 `Ctrl + Shift + F`(Windows/Linux)或 `Cmd + Shift + F`(macOS)可以搜尋工作區中所有檔案的文字內容。如果你想執行尋找並取代,則使用 `Ctrl + Shift + H`(Windows/Linux)或 `Cmd + Shift + H`(macOS)。 -如果你需要刪除一行,`Ctrl + Shift + K`(Windows)或 `Cmd + Shift + K`(Mac)將會刪除它。 +如果你需要刪除一行,`Ctrl + Shift + K`(Windows/Linux)或 `Cmd + Shift + K`(macOS)會將該行刪除。 -需要更多空間來放置你的程式碼嗎?`Ctrl + B`(Windows)或 `Cmd + B`(Mac)會隱藏側邊欄-該側邊欄包含檔案列表和擴充套件選單。 +需要更多空間來顯示你的程式碼嗎?`Ctrl + B`(Windows)或 `Cmd + B`(Mac)會隱藏側邊欄,該側邊欄包含檔案列表和擴充套件選單。 -或者你只是看不到你的程式碼?`Ctrl + plus`(Windows)或 `Cmd + plus`(Mac)會放大編輯器的縮放比例,`Ctrl + minus`(Windows)或 `Cmd + minus`(Mac)會縮小它。 +還是你根本看不到程式碼?`Ctrl + Plus`(Windows)或 `Cmd + Plus`(Mac)會放大編輯器的縮放比例,而 `Ctrl + Minus`(Windows)或 `Cmd + Minus`(Mac)會縮小它。 -VS Code 中另一個有用的功能是多行編輯,允許你同時對多行進行更改。 例如,你可以使用 `Ctrl + Alt + down` 和 `Ctrl + Alt + up`(Windows/Linux),或 `Option + Command + down` 和 `Option + Command + up`(Mac)來將游標延伸到連續的多行。你也可以按住 `Alt`(Windows/Linux)或 `Option`(Mac)並點擊,在需要的不同行上添加游標。游標放置完成後,任何你輸入或刪除的內容都會同時套用到所有這些位置——這在處理重複程式碼時可以節省大量時間。 +VS Code 另一個很有用的功能是多行編輯,讓你能一次在多行做修改。舉例來說,你可以使用 `Ctrl + Alt + Down` 和 `Ctrl + Alt + Up`(Windows/Linux),或 `Option + Cmd + Down` 和 `Option + Cmd + Up`(Mac)來在連續的行上放置多個游標。你也可以按住 `Alt`(Windows/Linux)或 `Option`(Mac)並點擊,在你需要的不同行上新增游標。游標放好後,你輸入或刪除的任何內容都會同時套用到所有這些位置——這在處理重複程式碼時可以節省很多時間。 -最後,如果你忘記任何這些快捷鍵,你隨時可以使用 `Ctrl + Shift + P`(Windows)或 `Cmd + Shift + P`(Mac),這會為你開啟命令調色盤,讓你選擇所需的任何功能。 +最後,如果你忘記任何這些快捷鍵,你隨時可以使用 `Ctrl + Shift + P`(Windows/Linux)或 `Cmd + Shift + P`(macOS)開啟命令調色盤,從中選擇你需要的任何指令。 有了這些知識,並且可能稍加練習,你就已經朝成為 VS Code 高階使用者的道路邁進。 diff --git a/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-code-editors-and-ides/672d457bcdd8b350ec2b6254.md b/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-code-editors-and-ides/672d457bcdd8b350ec2b6254.md index c8608e8c885..9068c20ad9c 100644 --- a/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-code-editors-and-ides/672d457bcdd8b350ec2b6254.md +++ b/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-code-editors-and-ides/672d457bcdd8b350ec2b6254.md @@ -7,25 +7,25 @@ dashedName: what-are-some-good-vs-code-extensions-you-can-use-in-your-editor # --description-- -*Better Comments* 是一個為特定程式碼註解提供特殊色彩突顯的擴充套件。例如,它會凸顯標示 "TODO" 註解,以及用來顯示問題或警告的語法。 +Better Comments 是一個擴充套件,提供特定程式碼註解的特殊凸顯標示。舉例來說,它會標明「TODO」註解,以及用來指出問題或警告的語法。 -*Code Spell Checker* 會在你的程式碼中拼寫錯誤時提供提示。因為它是為程式碼檔案設計的,所以會考慮像駝峰式大小寫這類的情況。 +Code Spell Checker 會標示你程式碼中拼寫錯誤的字。因為它是為程式碼檔案設計,所以會考慮像是駝峰式命名等情況。 -*Error Lens* 將幫助你捕捉程式碼中任何被凸顯標示的錯誤。這個擴充套件不僅依賴 VS Code 預設顯示的底線,還會凸顯整行並顯示錯誤訊息。 +Error Lens 讓你更難忽略程式碼中的錯誤。它不只是依賴 VS Code 預設的底線,還會凸顯整行並顯示錯誤訊息。 -*Indent Rainbow* 為你不同層次的縮排添加顏色。結合 VS Code 原生的括號配對著色,這可以大幅幫助你辨識程式碼所處的作用域。 +Indent Rainbow 會為你不同層次的縮排添加顏色。搭配 VS Code 原生的括號配對色彩化,能大幅幫助你辨識程式碼所處的作用域。 -或者你正在尋找更實用的東西?考慮使用 AI 助手,例如 *GitHub Copilot* 或 *Tabnine*,在你撰寫程式碼時提供行內建議。 +或者你想找更實用的功能?可以考慮 AI 助手,例如 GitHub Copilot 或 Tabnine,當你撰寫程式碼時提供行內建議。 -圖示包,例如 *VS Code Great Icons*,可以幫助你的檔案樹更乾淨且更容易一目了然地解析。而像 *Colorize* 這樣的擴充套件可以幫助你理解 CSS 屬性中的數值。 +像 VS Code Great Icons 這樣的圖示包可以讓你的檔案樹更整潔且一目了然。像 Colorize 這類擴充套件則能幫助你理解 CSS 屬性的值。 -你也會想為你的專案添加語言特定的擴充套件。如果你正在使用 JavaScript,你很可能會想要使用 *ESLint* 和 *Prettier* 來檢查和格式化你的程式碼。如果你正在使用 TypeScript,你可能會想要 *Pretty TypeScript Errors* 來讓訊息更易讀。 +你也會想為你的專案安裝語言專用的擴充套件。如果你使用 JavaScript,可能會想要 ESLint 和 Prettier 來檢查和格式化程式碼。如果你使用 TypeScript,Pretty TypeScript Errors 可以讓訊息更易讀。 -最後,你也可以在你的編輯器中享受一些樂趣。*VS Code Pets* 提供可配置的虛擬寵物,陪伴你在除錯時。 +最後,你也可以在編輯器裡玩得開心一點。VS Code Pets 提供可配置的虛擬寵物,陪伴你除錯時的時光。 -*Power Mode* 會在你透過撰寫更多程式碼達成足夠高的「combo」時產生炫目的效果。 +Power Mode 在你寫出足夠多程式碼達成高「連擊」時,會產生炫目的特效。 -*Discord Presence* 讓你向所有朋友展示你正在進行的工作。 +Discord Presence 讓你向所有朋友展示你正在進行的工作。 而且還有更多擴充套件。歡迎自由探索擴充套件市集,看看哪一個最適合你。 @@ -33,7 +33,7 @@ dashedName: what-are-some-good-vs-code-extensions-you-can-use-in-your-editor ## --text-- -「Better Comments」擴充套件在 VS Code 中提供什麼特性? +Better Comments 擴充套件在 VS Code 中提供什麼功能? ## --answers-- @@ -69,7 +69,7 @@ dashedName: what-are-some-good-vs-code-extensions-you-can-use-in-your-editor ## --text-- -哪一個 VS Code 擴充套件被描述為透過在整行顯示錯誤訊息來幫助你捕捉程式碼中的凸顯標示錯誤? +哪個 VS Code 擴充套件會凸顯整行並行內顯示錯誤訊息,而不是依賴預設的底線? ## --answers-- @@ -105,7 +105,7 @@ ESLint ## --text-- -「VS Code Pets」擴充套件提供什麼獨特的功能? +VS Code Pets 擴充套件提供什麼獨特功能? ## --answers-- diff --git a/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-css-flexbox/672aa7f7284b235f46f7d4e9.md b/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-css-flexbox/672aa7f7284b235f46f7d4e9.md index 82f0cfb2eb4..55cb7e536d7 100644 --- a/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-css-flexbox/672aa7f7284b235f46f7d4e9.md +++ b/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-css-flexbox/672aa7f7284b235f46f7d4e9.md @@ -319,7 +319,7 @@ CSS flexbox 的主要目的為何? ### --feedback-- -思考在彈性容器內元素的分佈。 +想想主軸和交叉軸彼此之間是如何定位的。 --- @@ -327,7 +327,7 @@ CSS flexbox 的主要目的為何? ### --feedback-- -思考在彈性容器內元素的分佈。 +想想主軸和交叉軸彼此之間是如何定位的。 --- @@ -339,7 +339,7 @@ CSS flexbox 的主要目的為何? ### --feedback-- -思考在彈性容器內元素的分佈。 +想想主軸和交叉軸彼此之間是如何定位的。 ## --video-solution-- diff --git a/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-css-flexbox/672bd658c0e190f674a5e057.md b/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-css-flexbox/672bd658c0e190f674a5e057.md index 0259ea8b3c9..71a2be22b1e 100644 --- a/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-css-flexbox/672bd658c0e190f674a5e057.md +++ b/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-css-flexbox/672bd658c0e190f674a5e057.md @@ -7,11 +7,11 @@ dashedName: what-are-some-common-flex-properties # --interactive-- -Flex 屬性是你可以套用到彈性容器的屬性,用來決定子元素的分佈。我們將涵蓋一些最常用的屬性:`flex-wrap`、`justify-content` 和 `align-items`。 +Flex 屬性控制元素在 flex 佈局中的行為,從容器層級的分配到項目層級的自我對齊。本課程將介紹一些最常用的屬性:`flex-wrap`、`flex-flow`、`justify-content`、`align-items` 和 `align-self`。 -讓我們從 `flex-wrap` 開始。這個屬性決定了彈性項目如何在彈性容器內換行以適應可用空間。`flex-wrap` 可以有三種可能的值:`nowrap`、`wrap` 和 `wrap-reverse`。`nowrap` 是預設值——即使彈性項目的寬度超過容器的寬度,也不會換行到新的一行。 +我們先從 `flex-wrap` 開始。這個屬性決定 flex 項目如何在 flex 容器內換行以適應可用空間。`flex-wrap` 有三種可能的值:`nowrap`、`wrap` 和 `wrap-reverse`。`nowrap` 是預設值:即使項目的寬度超過容器寬度,flex 項目也不會換行。 -在下面的程式碼中,我們有三個 `div` 元素。讓我們專注於 `width`。以紅色邊框標示的 `main` 容器的 `width` 為 `200px`,而其三個子 `div` 元素合計的 `width` 為 `240px`(每個 `80px`): +在下面的程式碼中,我們有三個 `div` 元素。讓我們專注於 `width`。有邊框的 `main` 容器的 `width` 是 `200px`,而其三個子 `div` 元素加起來的 `width` 是 `240px`(每個 `80px`): :::interactive_editor @@ -28,7 +28,7 @@ Flex 屬性是你可以套用到彈性容器的屬性,用來決定子元素的 main { width: 200px; display: flex; - border: 2px solid red; + border: 2px solid #444; } div { @@ -51,7 +51,6 @@ div { ::: - `div` 元素的寬度超過它們的容器寬度,但預設會縮小以適應可用空間。如果你確實想在它們超過容器寬度時換行,可以在彈性容器上設定 `flex-wrap: wrap`: :::interactive_editor @@ -70,7 +69,7 @@ main { width: 200px; display: flex; flex-wrap: wrap; - border: 2px solid red; + border: 2px solid #444; } div { @@ -109,9 +108,10 @@ div { ```css main { width: 200px; + height: 120px; display: flex; flex-flow: column wrap-reverse; - border: 2px solid red; + border: 2px solid #444; } div { @@ -151,7 +151,7 @@ div { main { display: flex; justify-content: flex-start; - border: 2px solid red; + border: 2px solid #444; } div { @@ -174,7 +174,7 @@ div { ::: -使用 `justify-content: flex-end` 時,彈性項目會沿主軸的末端對齊,無論是水平還是垂直方向。 +使用 `justify-content: flex-end` 時,彈性項目會沿主軸的末端對齊,無論是水平還是垂直方向。 :::interactive_editor @@ -191,7 +191,7 @@ div { main { display: flex; justify-content: flex-end; - border: 2px solid red; + border: 2px solid #444; } div { @@ -231,7 +231,7 @@ div { main { display: flex; justify-content: center; - border: 2px solid red; + border: 2px solid #444; } div { @@ -254,7 +254,7 @@ div { ::: -要沿主軸均勻分配元素,你可以使用 `justify-content: space-between`。如果需要,這會在彈性項目之間添加一些間距。 +要沿主軸分配元素且邊緣不留空間,可以使用 `justify-content: space-between`。第一個項目位於主軸起點,最後一個項目位於主軸終點,剩餘空間則分配在相鄰項目之間。 :::interactive_editor @@ -271,7 +271,7 @@ div { main { display: flex; justify-content: space-between; - border: 2px solid red; + border: 2px solid #444; } div { @@ -294,7 +294,7 @@ div { ::: -`justify-content: space-around` 在主軸內均勻分配彈性項目,並在第一個項目前和最後一個項目後添加空間。這個額外的空間是每對相鄰項目之間空間的一半。如果只有一個項目要分配,則會置中。 +`justify-content: space-around` 將 flex 項目均勻分布在主軸上,並在第一個項目前和最後一個項目後各加一段空間。這額外的空間是相鄰項目間空間的一半。如果只有一個項目,則會置中。 :::interactive_editor @@ -311,7 +311,7 @@ div { main { display: flex; justify-content: space-around; - border: 2px solid red; + border: 2px solid #444; } div { @@ -334,8 +334,7 @@ div { ::: - -最後但同樣重要的是,我們有 `justify-content: space-evenly`,它會沿主軸平均分配項目。項目之間的間距以及第一個和最後一個元素之前和之後的間距完全相同: +最後,我們有 `justify-content: space-evenly`,它將項目均勻分布在主軸上。項目之間的空間與第一個和最後一個元素前後的空間完全相同: :::interactive_editor @@ -352,7 +351,7 @@ div { main { display: flex; justify-content: space-evenly; - border: 2px solid red; + border: 2px solid #444; } div { @@ -375,7 +374,7 @@ div { ::: -太好了。現在你知道如何沿主軸分配彈性項目。但你可能也想沿交叉軸分配它們。請記住,交叉軸與主軸垂直。你可以使用 `align-items` 屬性來做到這一點。要將項目沿交叉軸置中,只需為彈性容器添加 `align-items: center`: +太好了。現在你知道如何沿主軸分配彈性項目。但你可能也想沿交叉軸分配它們。請記住,交叉軸與主軸垂直。你可以使用 `align-items` 屬性來做到這一點。要將項目沿交叉軸置中,只需為彈性容器添加 `align-items: center`: :::interactive_editor @@ -390,10 +389,10 @@ div { ```css main { - height: 300px; display: flex; + height: 300px; align-items: center; - border: 2px solid red; + border: 2px solid #444; } div { @@ -431,10 +430,10 @@ div { ```css main { - height: 300px; display: flex; + height: 300px; align-items: flex-start; - border: 2px solid red; + border: 2px solid #444; } div { @@ -457,7 +456,7 @@ div { ::: -相反的是 `align-items: flex-end`。這會將彈性項目對齊到交叉軸的末端,垂直或水平。 +相反的是 `align-items: flex-end`。這會將彈性項目對齊到交叉軸的末端,垂直或水平。 :::interactive_editor @@ -472,10 +471,10 @@ div { ```css main { - height: 300px; display: flex; + height: 300px; align-items: flex-end; - border: 2px solid red; + border: 2px solid #444; } div { @@ -498,147 +497,169 @@ div { ::: -要沿著交叉軸拉伸彈性項目,你可以使用 `align-items: stretch`。這也適用於自動調整大小的元素,例如沒有設定 `width` 或 `height`,或只有最小 `width` 或 `height` 的元素。彈性項目將會在交叉軸方向上拉伸以填滿容器。 +要沿交叉軸拉伸 flex 項目,可以使用 `align-items: stretch`。這只會影響交叉軸尺寸為 `auto` 的項目;對於交叉軸有明確尺寸(例如在列容器中設定的 `height`)的項目不會拉伸。受影響的項目會在交叉軸方向填滿容器。 :::interactive_editor ```html <link rel="stylesheet" href="styles.css"> - -<div class="container"> - <div class="box">One</div> - <div class="box">Two</div> - <div class="box">Three</div> -</div> - +<main> + <div id="first-div"></div> + <div id="second-div"></div> + <div id="third-div"></div> +</main> ``` ```css -.container { +main { display: flex; - align-items: stretch; + height: 300px; + align-items: stretch; border: 2px solid #444; - height: 200px; } -.box { - width: 100px; - border: 1px solid #888; - background-color: lightblue; +div { + width: 80px; + height: 50px; +} + +#first-div { + background-color: #4d70b2; +} + +#second-div { + background-color: #5c4db2; +} + +#third-div { + background-color: #4da3b2; + height: auto; } ``` ::: -最後,你可以使用 `align-self` 屬性為單一彈性項目指定交叉軸上的不同對齊方式。例如,你可以使用 `align-self: stretch` 將它拉伸。 +最後,你可以使用 `align-self` 屬性為單一彈性項目指定交叉軸上的不同對齊方式。例如,你可以使用 `align-self: stretch` 將它拉伸。 :::interactive_editor ```html <link rel="stylesheet" href="styles.css"> - -<div class="container"> - <div class="box">One</div> - <div class="box">Two</div> - <div class="box special">Three</div> -</div> - +<main> + <div id="first-div"></div> + <div id="second-div"></div> + <div id="third-div"></div> +</main> ``` ```css -.container { +main { display: flex; - align-items: flex-start; + height: 300px; + align-items: flex-start; border: 2px solid #444; - height: 200px; } -.box { - width: 100px; - border: 1px solid #888; - background-color: lightblue; - margin: 4px; +div { + width: 80px; + height: 50px; } -.special { - align-self: stretch; - background-color: lightcoral; +#first-div { + background-color: #4d70b2; +} + +#second-div { + background-color: #5c4db2; +} + +#third-div { + background-color: #4da3b2; + align-self: stretch; } ``` ::: -你可以用 `align-self: center` 將它置中。 +你可以用 `align-self: center` 將它置中。 :::interactive_editor ```html <link rel="stylesheet" href="styles.css"> - -<div class="container"> - <div class="box">One</div> - <div class="box">Two</div> - <div class="box special">Three</div> -</div> - +<main> + <div id="first-div"></div> + <div id="second-div"></div> + <div id="third-div"></div> +</main> ``` ```css -.container { +main { display: flex; - align-items: flex-start; + height: 300px; + align-items: flex-start; border: 2px solid #444; - height: 200px; } -.box { - width: 100px; - border: 1px solid #888; - background-color: lightblue; - margin: 4px; +div { + width: 80px; + height: 50px; +} + +#first-div { + background-color: #4d70b2; +} + +#second-div { + background-color: #5c4db2; } -.special { - align-self: center; - background-color: lightcoral; +#third-div { + background-color: #4da3b2; + align-self: center; } ``` ::: -你可以使用 `align-self: flex-start` 將其對齊到交叉軸的起點。 +你可以使用 `align-self: flex-start` 將其對齊到交叉軸的起點。 :::interactive_editor ```html <link rel="stylesheet" href="styles.css"> - -<div class="container"> - <div class="box">One</div> - <div class="box">Two</div> - <div class="box special">Three</div> -</div> - +<main> + <div id="first-div"></div> + <div id="second-div"></div> + <div id="third-div"></div> +</main> ``` ```css -.container { +main { display: flex; - align-items: flex-start; + height: 300px; + align-items: flex-start; border: 2px solid #444; - height: 200px; } -.box { - width: 100px; - border: 1px solid #888; - background-color: lightblue; - margin: 4px; +div { + width: 80px; + height: 50px; +} + +#first-div { + background-color: #4d70b2; } -.special { - align-self: flex-start; - background-color: lightcoral; +#second-div { + background-color: #5c4db2; +} + +#third-div { + background-color: #4da3b2; + align-self: flex-start; } ``` @@ -650,39 +671,43 @@ div { ```html <link rel="stylesheet" href="styles.css"> - -<div class="container"> - <div class="box">One</div> - <div class="box">Two</div> - <div class="box special">Three</div> -</div> - +<main> + <div id="first-div"></div> + <div id="second-div"></div> + <div id="third-div"></div> +</main> ``` ```css -.container { +main { display: flex; - align-items: flex-start; + height: 300px; + align-items: flex-start; border: 2px solid #444; - height: 200px; } -.box { - width: 100px; - border: 1px solid #888; - background-color: lightblue; - margin: 4px; +div { + width: 80px; + height: 50px; } -.special { - align-self: flex-end; - background-color: lightcoral; +#first-div { + background-color: #4d70b2; +} + +#second-div { + background-color: #5c4db2; +} + +#third-div { + background-color: #4da3b2; + align-self: flex-end; } ``` ::: -還有其他的 flex 屬性和值,你可以選擇用來創建你所想像的響應式佈局,但這些是最常用的。利用這些 CSS flex 屬性和你對 CSS flex 模型的新認識,你可以開始創建響應式佈局,為不同裝置打造流暢且包容的使用者體驗。 +你還可以選擇其他 flex 屬性和值來創建你想要的響應式佈局,但這些是最常用的。憑藉這些 CSS flex 屬性和你對 CSS flex 模型的新認識,你可以開始創建響應式佈局,為不同裝置帶來流暢且包容的使用者體驗。 # --questions-- @@ -764,7 +789,7 @@ div { ## --answers-- -`flex-direction` 和 `justify-content`。 +`flex-direction` 和 `justify-content` ### --feedback-- @@ -772,7 +797,7 @@ div { --- -`flex-direction` 和 `align-items`。 +`flex-direction` 和 `align-items` ### --feedback-- @@ -780,7 +805,7 @@ div { --- -`flex-direction` 和 `align-content`。 +`flex-direction` 和 `align-content` ### --feedback-- @@ -788,7 +813,7 @@ div { --- -`flex-direction` 和 `flex-wrap`。 +`flex-direction` 和 `flex-wrap` ## --video-solution-- diff --git a/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-css-fonts/672bd814105a0ffcf36f9233.md b/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-css-fonts/672bd814105a0ffcf36f9233.md index 0cb49404fb4..b5a0c01e71b 100644 --- a/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-css-fonts/672bd814105a0ffcf36f9233.md +++ b/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-css-fonts/672bd814105a0ffcf36f9233.md @@ -1,6 +1,6 @@ --- id: 672bd814105a0ffcf36f9233 -title: What Are Font Families and How Do They Work? +title: 字型家族是什麼以及它們如何運作? challengeType: 19 dashedName: what-are-font-families --- @@ -11,6 +11,8 @@ dashedName: what-are-font-families <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/what-are-font-families-and-how-do-they-work-1.png" alt="Diagram showing 'Arial' at the top with two blue arrows pointing down to 'Arial Bold' on the left and 'Arial Italic' on the right, illustrating font family variations" /> +## 在 CSS 中設定字型家族 + 在 CSS 中,你可以使用 `font-family` 屬性設定字型。以下是將段落字型設定為 `Arial` 的範例: :::interactive_editor @@ -29,6 +31,8 @@ dashedName: what-are-font-families ::: +## 備用字型 + 但是如果找不到字型家族怎麼辦?你可以依照優先權從高到低指定多個字型家族,並以逗號分隔。這些替代字型將作為備援選項。在此範例中,Arial 是主要字型,而 Lato 是替代字型: :::interactive_editor @@ -51,6 +55,8 @@ dashedName: what-are-font-families 你也應該知道這個處理程序在幕後如何運作。選擇處理程序不會因為第一個字型可用而停止。字型家族是逐一字元選擇的,所以如果某個字型缺少特定字元,瀏覽器會在較低優先權的字型中尋找。很有趣,對吧? +## 泛型字型家族 + 在網頁開發的背景關係中,你也會找到泛型字型家族。它們非常重要。泛型字型家族是當較高優先權的字型無法使用時,網頁瀏覽器會呈現的預設字型。為了確保內容仍然可讀,瀏覽器會根據指定的泛型字型家族,將原始字型取代為最適合的字型。其中一些最常用的是: - 襯線 @@ -81,6 +87,8 @@ Arial 擁有最高優先權。如果找不到 Arial,瀏覽器將嘗試呈現 L 你應該總是在字型系列列表的最後包含一個泛型字型系列。請記住,泛型字型可能看起來與你在設計中原本想像的字型不同,因此檢查這些備用字型在不同瀏覽器上的顯示效果總是很有幫助。 +## 網頁安全字型 + 為了讓使用者體驗盡可能一致,也建議使用網頁安全字型。這些字型家族通常已安裝在大多數裝置上,因此大多數使用者很可能會找到並正確呈現它們。你將在接下來的課程中學習更多相關內容。 字型家族在網頁設計的世界中至關重要。透過使用 font-family 屬性,你可以立即改變你的文字的外觀與感覺。 diff --git a/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-css-fonts/672bd8453d1371fdb1510fe5.md b/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-css-fonts/672bd8453d1371fdb1510fe5.md index a9bae00e4d7..d9456c357a0 100644 --- a/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-css-fonts/672bd8453d1371fdb1510fe5.md +++ b/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-css-fonts/672bd8453d1371fdb1510fe5.md @@ -11,6 +11,8 @@ dashedName: how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fo Google Fonts 和 Font Squirrel 是尋找及使用免費字型、字體以進行網頁開發的熱門線上資源。你可以非常輕鬆地將它們整合到你的專案中。 +## Google 字體 + 讓我們從 Google Fonts 開始。這是 Google 提供的一項服務,提供一個字型群集,其中許多字型是專為網頁開發設計的。在 Google Fonts 的使用者介面上,你可以看到許多不同的元素。讓我們逐一介紹。在左側邊欄,你會找到: - 一個用來查看、尋找和篩選字型的區段。 @@ -18,6 +20,8 @@ Google Fonts 和 Font Squirrel 是尋找及使用免費字型、字體以進行 - 一個你可以為你的網頁專案尋找並下載圖示的區段。 - 一個你可以進一步了解字型、字體及其最佳實務的章節,接著是常見問題。 +## 預覽 Google 字體 + 要為你的網站添加 Google Font,你應該前往第一個區段(Fonts)。你可以在左側邊欄標示為「Preview」的地方自訂預覽文字。只要輸入你想看到的文字,它就會自動更新。這對於預覽你已經為網站構思好的文字字型非常有幫助。你也可以調整字型大小並根據字型的特性篩選字型。 <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-1.png" alt="Google Fonts Fonts section showing a left sidebar with preview text set to 'freeCodeCamp' at 40px, filter options for Language, Technology, and Decorative stroke, and the main panel listing font families including Roboto, SUSE, and Sevillana each previewing 'freeCodeCamp'" /> @@ -28,12 +32,16 @@ Google Fonts 和 Font Squirrel 是尋找及使用免費字型、字體以進行 <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-2.png" alt="Google Fonts Roboto Styles page with Specimen, Type tester, Glyphs, and About & license tabs, a blue Get font button, a preview text field showing 'freeCodeCamp' with a font size slider at 48px, and a list of styles including Thin 100, Thin 100 Italic, Light 300, and Light 300 Italic" /> +## 使用 Google 字體 + 當你準備好將字型添加到你的專案時,請點擊頂部的藍色 Get font 按鈕。系統會帶你到一個摘要頁面,在那裡你可以看到目前選取的字型。你可以同時選取多個字型。 <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-3.png" alt="Google Fonts page showing '1 font family selected' with Roboto Static listed, Get embed code and Download all buttons on the right, and a How to use section with All, Design, Develop, and Google products tabs" /> 接著,你必須選擇是否要下載字型檔案,將它們作為區域的檔案添加到你的專案中,或是選擇將它們作為外部字型,並在使用者進入你的網站時從 Google 的伺服器下載。如果你想下載字型,請點擊「Download all」,但如果你偏好使用 Google 伺服器上的外部字型,請點擊「Get embed code」。如果你點擊「Get embed code」,你將會看到應該遵循的指示,以將這些外部字型添加到你的專案中。 +### 以聯結方式使用 Google 字體 + 對於網頁開發專案,你有兩個選項,可使用 `link` 元素或 `@import`。如果你選擇 `link` 元素選項,你可以複製並貼上 HTML 片段和 CSS 規則,將它們添加到你的專案中。你應該將程式碼嵌入在 HTML 檔案的 `head` 元素中,並添加符合你需求的 CSS 規則。 <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-4.png" alt="Google Fonts Embed code page with the link element option selected, showing three link tags for preconnect and the font stylesheet, a CSS classes section with .roboto-thin, .roboto-light, .roboto-regular, and .roboto-medium rules, and a left sidebar showing font style toggles" /> @@ -141,6 +149,8 @@ Google Fonts 和 Font Squirrel 是尋找及使用免費字型、字體以進行 每種字型樣式都有一個 CSS 規則。每個規則都會指定訂製字型及備用字型,以防訂製字型未正確載入。 +### 以匯入方式使用 Google 字體 + 如果你選擇 `@import` 選項,則需要將該規則添加到你的 CSS 檔案中。 <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-5.png" alt="Google Fonts Embed code page with the @import option selected, showing a style block containing the @import URL rule, a CSS classes section below, and the left sidebar with font style toggles" /> @@ -159,10 +169,14 @@ CSS 規則完全相同。 這就是 Google Fonts。它是尋找免費且開放原始碼字型、字體用於網頁開發專案中最受歡迎的選項之一。 +## Font Squirrel + 另一個很棒的選項是 Font Squirrel,在那裡你可以找到並下載你為設計所想像的訂製字型。 <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-7.png" alt="Font Squirrel 'Free Font Utopia' page listing featured free fonts including Acherus Grotesque, Intro Rust, Source Sans Pro, Open Sans, and Questa, each shown with an alphabet specimen and a Download button" /> +## 預覽 Font Squirrel + 如果你搜尋字型並點擊結果,你會看到更多關於該字型的詳細資訊,包括樣本、試用、字形和 Webfont 套件。 <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-8.png" alt="Font Squirrel search results for 'Roboto' showing three matches: Roboto, Roboto 2014, and Roboto Slab, each with an alphabet specimen and a Download TTF button" /> @@ -173,6 +187,8 @@ CSS 規則完全相同。 <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-10.png" alt="Font Squirrel Roboto Specimens section listing all styles with alphabet samples: Roboto Thin, Thin Italic, Light, Light Italic, Regular, Italic, Medium, Medium Italic, Bold, Bold Italic, and Black, each in its respective weight" /> +## 使用 Font Squirrel + 一旦你決定了要在你的專案中使用的字型,請前往「Webfont Kit」標籤。在這裡,你可以檢查該字型的授權是否允許你在 `@font-face` CSS 嵌入中使用。你也可以選擇子集和格式。 <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-11.png" alt="Font Squirrel Roboto Webfont Kit tab showing a license notice confirming @font-face embedding is allowed, a subset selector set to Western Latin, format checkboxes with WOFF selected, and a Download @font-face Kit button" /> diff --git a/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-css-fonts/672bd853c985cdfdeb32f4f9.md b/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-css-fonts/672bd853c985cdfdeb32f4f9.md index 2b2decb767b..8657c1e2abe 100644 --- a/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-css-fonts/672bd853c985cdfdeb32f4f9.md +++ b/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-css-fonts/672bd853c985cdfdeb32f4f9.md @@ -13,6 +13,8 @@ CSS 預設不會對文字套用任何陰影。這是一個沒有任何陰影的 text-shadow: /* Values */ ``` +## `X` 和 `Y` 偏移值 + 在 CSS 中,你可以透過 `X` 偏移量、`Y` 偏移量、模糊半徑和顏色的組合來表述陰影。首先,你需要指定 `X` 和 `Y` 偏移量,分別表現陰影與文字的水平和垂直距離。這些數值是必填的。 以下是如何在陰影上套用 `X` 和 `Y` 偏移量的範例。我們使用 `text-shadow` 屬性,x 偏移量為 `3px`,y 偏移量為 `2px`: @@ -32,7 +34,11 @@ p { ::: -在瀏覽器中,文字和陰影看起來會相似,但我們也可以透過在偏移量之前或之後指定值來自訂陰影的顏色。讓我們設定陰影顏色。我們將使用十六進位顏色,但你可以使用任何有效的顏色格式。 +在瀏覽器中,文字和陰影看起來會很相似。 + +## 為陰影添加顏色 + +我們也可以透過在偏移值之前或之後指定顏色來自訂陰影的顏色。讓我們設定陰影顏色。我們這裡使用十六進位顏色,但你也可以使用任何有效的顏色格式。 :::interactive_editor @@ -66,7 +72,11 @@ p { ::: -在瀏覽器中,陰影會有特定的顏色,因此我們可以非常輕鬆地將它與文字區分開來。既然我們可以區分陰影和文字,了解正值和負值如何影響陰影偏移也很重要。`X` 偏移和 `Y` 偏移的正值會分別將陰影向右和向下移動,而負值則會將陰影向左和向上移動。以下是一個使用負值的範例: +在瀏覽器中,陰影會有特定的顏色,因此我們可以很容易地將它與文字區分開來。 + +## 正負偏移值 + +既然我們可以區分陰影和文字,了解正負值如何影響陰影偏移也很重要。`X` 偏移和 `Y` 偏移的正值會分別將陰影向右和向下移動,而負值則會將陰影向左和向上移動。以下是使用負值的範例: :::interactive_editor @@ -83,7 +93,11 @@ p { ::: -現在陰影將會相對於文字向左上移動。很好。但陰影看起來並不太好,因為它看起來完全像原始文字,只是放在後面。為了讓它看起來更好,我們需要添加第三個值,也就是模糊半徑。這個值是選用的,但會讓陰影看起來更平滑且更細緻。模糊半徑的預設值是零。數值越高,模糊越大,這表示陰影會變得越淡。 +現在陰影會相對於文字向左和向上移動。很好。 + +## 模糊半徑 + +但陰影看起來不太好,因為它看起來就像原始文字,只是放在後面。為了讓它看起來更好,我們需要添加第三個值,也就是模糊半徑。這個值是選用的,但會讓陰影看起來更柔和、更細緻。模糊半徑的預設值是零。數值越大,模糊越大,陰影也就越淡。 這裡,我們將模糊半徑設定為 `3px`,並且偏移量回到正值: @@ -104,6 +118,8 @@ p { 現在它開始看起來像陰影了。它更模糊且細緻,所以我們可以專注於主要文字,同時陰影在背景中增添一些風格。從這裡開始,我們可以稍微調整數值,直到找到符合我們需求的偏移量、顏色和模糊半徑組合。 +## 添加多重陰影 + 知道 text 可以有多個陰影也很有幫助。你只需要在同一個 `text-shadow` 屬性中用逗號分隔它們。它們會依層次從前到後套用,第一個陰影會在最上層。 這是一個範例段落,套用了三層陰影。請注意,所有這些陰影都定義在同一個 `text-shadow` 屬性中,並以逗號分隔: diff --git a/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-css-transforms-overflow-and-filters/672bccc8ea33bad87abb3c56.md b/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-css-transforms-overflow-and-filters/672bccc8ea33bad87abb3c56.md index 45e16cdac4c..9b8d4b3008d 100644 --- a/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-css-transforms-overflow-and-filters/672bccc8ea33bad87abb3c56.md +++ b/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-css-transforms-overflow-and-filters/672bccc8ea33bad87abb3c56.md @@ -1,6 +1,6 @@ --- id: 672bccc8ea33bad87abb3c56 -title: content-box 和 border-box 之間的差異是什麼? +title: Content-box 和 border-box 之間的差異是什麼? challengeType: 19 dashedName: what-is-the-difference-between-content-box-and-border-box --- @@ -19,6 +19,8 @@ dashedName: what-is-the-difference-between-content-box-and-border-box `box-sizing` 屬性的值預設為 `content-box`,但如果你需要,可以選擇 `border-box`。我們將先探討 `content-box`,然後再進入 `border-box`。 +## 回顧 CSS 盒模型 + 要了解這些模型如何運作,你需要熟悉 CSS 盒模型中的四個核心概念。讓我們快速回顧它們。 - 內容區域是元素內容所佔據的空間。 @@ -26,11 +28,13 @@ dashedName: what-is-the-difference-between-content-box-and-border-box - 邊框是包圍內容區域和內距的輪廓。 - 外邊距是位於邊框外側的空間,用來將該元素與其他元素分開。 +## `content-box` 的運作方式 + 在 `content-box` 模型中,你為元素設定的寬度和高度決定內容區域的尺寸,但不包含內距、邊框或外距。當你需要精確控制內容區域時,請使用 `content-box`。當你設定 `width` 和 `height` 時,你只是在設定內容本身的大小。 要找出元素的總寬度,你需要將左側和右側的內距,以及左側和右側的邊框相加。同樣地,元素的總高度可以透過將內容高度、上方和下方的內距,以及上方和下方的邊框相加來計算。 -例如,這裡我們有一個針對所有 `div` 元素的 CSS 型別選擇器。 +例如,這裡我們有一個針對所有 `div` 元素的 CSS 型別選擇器。 :::interactive_editor @@ -52,10 +56,14 @@ div { 在這種情況下,如果使用 `content-box`,內容區域將是 300px × 200px。總呈現大小包含內距和邊框——例如,總寬度 = 300px(內容)+ 40px(內距)+ 8px(邊框)= 348px;總高度的計算方式相同。 +## `border-box` 的運作方式 + 太好了!現在讓我們來探索 `border-box`。它的不同之處在於你設定的寬度和高度包含元素的內容、內距和邊框(但不包含外距)。當你希望元素的總尺寸保持固定,即使內距或邊框改變時,請使用 `border-box` — 這在響應式佈局中經常很有幫助。 使用 `border-box` 時,內距和邊框包含在元素指定的大小內。你設定的 `width` 和 `height` 會成為元素的總尺寸:內容+內距+邊框;外距則仍然排除在外。 +## 比較這兩種模型 + 在以下範例中,有兩個 `div` 元素具有相同的尺寸,但 `box-sizing` 值不同。請注意,這會導致在瀏覽器中顯示出不同的總尺寸: :::interactive_editor @@ -89,7 +97,7 @@ div { ::: -你可以看到它們兩者都有相同的 `width`、`height`、`padding`、`border` 和 `margin`。唯一的差異在於顏色和 `box-sizing` 屬性的值。這個小差異對最終尺寸有非常重要的影響。 +你可以看到它們兩者都有相同的 `width`、`height`、`padding`、`border` 和 `margin`。唯一的差異在於顏色和 `box-sizing` 屬性的值。這個小差異對最終尺寸有非常重要的影響。 在 `content-box` 和 `border-box` 之間的選擇,實際上取決於你的專案的具體需求。雖然 `border-box` 因其簡單性和彈性而越來越受歡迎,但理解這兩種模型對於實作有效的 CSS 版面配置非常重要。 diff --git a/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-dates/6733aafb9c0802f66cc1e056.md b/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-dates/6733aafb9c0802f66cc1e056.md index 42d50ddb868..9b581d6824e 100644 --- a/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-dates/6733aafb9c0802f66cc1e056.md +++ b/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-dates/6733aafb9c0802f66cc1e056.md @@ -34,21 +34,31 @@ console.log(now); 時間使用的是 24 小時制格式,所以 `14:30` 是 `2:30 PM`。`GMT-0700` 是時區偏移量,而 `Pacific Daylight Time` 是時區名稱。 -你也可以透過提供年、月、日、時、分、秒和毫秒的引數,將特定的日期和時間傳入 `Date` 物件。 +以下是使用特定日期字串建立新的 `Date` 物件的範例: -這裡是一個使用特定日期和時間建立新的 `Date` 物件的範例: +:::interactive_editor + +```js +const dateFromString = new Date("July 4, 1776 12:00:00"); + +console.log(dateFromString); +``` + +::: + +你也可以透過提供年、月、日、時、分、秒和毫秒的值作為引數,將特定的日期和時間傳入 `Date` 物件: :::interactive_editor ```js -const specificDate = new Date("July 4, 1776 12:00:00"); +const dateFromArguments = new Date(1776, 6, 4, 12, 0, 0, 0); -console.log(specificDate); +console.log(dateFromArguments); ``` ::: -當你需要處理特定的日期和時間,而非目前的日期和時間時,這非常有用。輸入必須始終為字串,且格式應該能被 `Date` 物件識別。 +當你需要處理特定的日期和時間,而非目前的日期和時間時,這會很有用。 要取得目前的日期和時間,你可以使用 `Date.now()` 方法,該方法會傳回自 `January 1, 1970, 00:00:00 UTC` 起的毫秒數。這稱為 Unix 紀元時間。 diff --git a/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-file-systems/672ac403a9ba7732b31c6480.md b/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-file-systems/672ac403a9ba7732b31c6480.md index 9455e7b55ee..15e36f99dbe 100644 --- a/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-file-systems/672ac403a9ba7732b31c6480.md +++ b/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-file-systems/672ac403a9ba7732b31c6480.md @@ -51,11 +51,11 @@ WOFF 是一種現代字型格式,專為網頁開發用途設計。它代表「 它們通常以一種稱為 Markdown 的檔案格式撰寫。使用 Markdown,你可以創建具有標題、副標題、連結、圖片、列表等結構的文件。Markdown 檔案具有 `.md` 或 `.markdown` 擴充套件。 -你可以在這裡找到 freeCodeCamp GitHub 倉庫的 `README` 檔案:https://github.com/freeCodeCamp/freeCodeCamp/blob/main/README.md +你可以在這裡找到 freeCodeCamp GitHub 倉庫的 `README` 檔案:`https://github.com/freeCodeCamp/freeCodeCamp/blob/main/README.md` 你可以使用 Markdown 創建這個詳細的結構和格式。 -你在職業生涯中肯定會閱讀和撰寫許多 `README` 檔案。了解這些常見的檔案型別對於網頁開發至關重要。 +你在職業生涯中肯定會閱讀和撰寫許多 `README` 檔案。了解這些常見的檔案型別對於網頁開發至關重要。 從 HTML、CSS 和 JavaScript 的核心區塊,到影像、影片 和 音訊 格式,每種檔案型別在建立互動式網頁應用程式中都有重要的角色。 diff --git a/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-node-core-modules/695cc6a5eefd305381ec90bc.md b/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-node-core-modules/695cc6a5eefd305381ec90bc.md index cc21378576c..220e304311b 100644 --- a/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-node-core-modules/695cc6a5eefd305381ec90bc.md +++ b/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-node-core-modules/695cc6a5eefd305381ec90bc.md @@ -84,7 +84,7 @@ try { 這就是非同步方法存在的原因。它們讓你的程式在 Node 在背景處理檔案操作時,能繼續執行其他部分。傳統上,這使用回呼,但隨著你的應用程式成長,回呼很快就會變得混亂。 -Promises 和 `async/await` 解決了這個問題。它們仍然是非區塊性的,但程式碼讀起來像一般同步程式碼,且更容易維護。 +Promises 和 `async/await` 解決了這個問題。它們仍然是非區塊性的,但程式碼讀起來像一般同步程式碼,且更容易維護。 因此,基於 promises 的方法通常是今天較受歡迎的做法,而這也是我們在本課程剩餘部分將使用的方法。 @@ -148,7 +148,7 @@ async function readFileContent() { const fileContent = await fs.readFile("article.md", "utf8"); console.log("File content:", fileContent); } catch (err) { - console.log("File read successfully"); + console.error("Error reading file:", err); } } @@ -169,7 +169,7 @@ async function readFileContent() { const fileContent = await fs.readFile("article.md"); console.log("File content:", fileContent); } catch (err) { - console.log("File read successfully"); + console.error("Error reading file:", err); } } @@ -297,7 +297,7 @@ Node fs 模組中哪個方法可以讓你將內容寫入檔案,若該檔案不 --- - 使用 Promise,例如 `fs.promises.writeFile()`。 +使用 Promise,例如 `fs.promises.writeFile()`。 ### --feedback-- diff --git a/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d2f232c60f0fa68ef86.md b/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d2f232c60f0fa68ef86.md index ccf535d38c8..7a9875cec8c 100644 --- a/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d2f232c60f0fa68ef86.md +++ b/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d2f232c60f0fa68ef86.md @@ -1,6 +1,6 @@ --- id: 68ff6d2f232c60f0fa68ef86 -title: 什麼是 Node 以及瀏覽器和 Node 執行期環境之間的一些差異? +title: Node 是什麼,以及瀏覽器與 Node 執行期環境之間的一些差異? challengeType: 19 dashedName: what-is-node-and-what-are-some-differences-between-the-browser-and-node-runtime-environment --- @@ -19,11 +19,11 @@ dashedName: what-is-node-and-what-are-some-differences-between-the-browser-and-n 客戶端 JavaScript 有這些限制,因為它最初是設計為專門在網頁瀏覽器上執行。 -網頁瀏覽器提供執行 JavaScript 程式碼所需的環境,包括 JavaScript 引擎。它們也提供對 Document Object Model(DOM)的存取,讓你可以在程式碼中存取 HTML 元素。 +網頁瀏覽器提供執行 JavaScript 程式碼所需的環境,包括 JavaScript 引擎。它們也提供存取文件物件模型(DOM),讓你可以在程式碼中存取 HTML 元素。 -過去,我們無法在瀏覽器外執行 JavaScript,但現在我們可以使用 Node.js。 +長期以來,JavaScript 幾乎只在瀏覽器內使用,但有了 Node.js,你也可以在瀏覽器外執行它。 -Node.js 是一個 JavaScript 執行期環境。它被官方定義為「一個開放原始碼且跨平台的 JavaScript 執行期環境」。 +Node.js 是一個 JavaScript 執行期環境。官方定義為「一個開源且跨平台的 JavaScript 執行期環境」。 讓我們來看看這是什麼意思: @@ -43,7 +43,7 @@ Node.js 被廣泛應用於各種產業。開發者使用它來建置處理 HTTP 例如,從瀏覽器中,你可以存取 DOM API,但存取區域的檔案系統有侷限。相較之下,從 Node 執行期環境中,你可以存取幾乎所有系統資源,包括檔案系統,但無法存取 DOM。 -兩個 JavaScript 環境都提供一個全域物件。在瀏覽器的 JavaScript 執行期中,這個物件稱為 `window`。這個 `window` 物件提供存取與瀏覽器相關的功能,例如存取操作 DOM、管理 cookie 和處理瀏覽器事件的方法。在 Node.js 環境中,這個全域物件稱為 `global`。`global` 物件提供存取 Node.js 特定的功能,例如用於操作區域檔案、網路和與作業系統互動的內建模組。 +這兩種 JavaScript 環境都提供一個全域物件。在瀏覽器的 JavaScript 執行期中,這個物件稱為 `window`。這個 `window` 物件提供存取瀏覽器相關功能,例如操作 DOM 的方法、管理 Cookie 和處理瀏覽器事件。在 Node.js 環境中,這個全域物件稱為 `global`。`global` 物件提供存取 Node.js 專屬功能,例如用於操作本地檔案、網路和與作業系統互動的內建模組。 最後,另一個重要的差異是你可以選擇在你的伺服端使用的 Node.js 版本。然而,你無法控制使用者用來造訪你網站的瀏覽器環境版本。 @@ -103,7 +103,7 @@ Node.js 已經成為全球開發者非常重要的工具。它是一個強大、 --- -Node 執行期環境使用 window 物件作為其全域物件,而瀏覽器則使用全域物件。 +Node 執行期環境使用 `window` 物件作為其全域物件,而瀏覽器則使用 `global` 物件。 ### --feedback-- diff --git a/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d372ad364f285f0522e.md b/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d372ad364f285f0522e.md index 239627be9e5..e13a54a0bd3 100644 --- a/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d372ad364f285f0522e.md +++ b/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d372ad364f285f0522e.md @@ -1,6 +1,6 @@ --- id: 68ff6d372ad364f285f0522e -title: 在後端使用 Node 的優點和缺點是什麼? +title: 使用 Node 作為後端的優點與缺點是什麼? challengeType: 19 dashedName: what-are-the-advantages-and-disadvantages-to-using-node-on-the-back-end --- @@ -11,7 +11,7 @@ Node.js 的一大優點是你可以使用 JavaScript 實作網頁應用程式的 Node 的架構是另一個優勢。它具有非阻塞、事件驅動的架構,非常適合開發即時應用程式,在這些應用程式中,回應速度和效率對於打造良好的使用者體驗至關重要。 -這就是「執行緒」這個概念變得非常重要的地方。執行緒是在一個處理程序內的執行路徑,就像一個正在執行的電腦程式。 +這時「執行緒」的概念變得非常重要。執行緒是在一個處理程序(也就是目前正在執行的電腦程式)中的執行路徑。 Node 的架構依賴單一執行緒和事件迴圈,能有效控制大量同時的請求和輸入/輸出操作。這使它非常適合需要同時處理多個請求的應用程式。 @@ -25,13 +25,13 @@ Node 的架構依賴單一執行緒和事件迴圈,能有效控制大量同時 另一方面,Node.js 確實有某些缺點或限制,你應該注意。 -如你所學,它一次只執行一個執行緒,這表示它一次只能控制代碼一個操作行為。雖然它的架構允許它高效地控制並行(同時)請求,但 CPU 密集型任務可能會阻塞主執行緒並導致效率問題。 +如你所知,它在單一執行緒上執行你的 JavaScript,這表示它一次只能執行你程式碼中的一個部分。雖然它的架構讓它能高效處理並行(同時)請求,但 CPU 密集型任務可能會阻塞主執行緒,導致效能問題。 CPU 密集型任務的範例包括複雜的數學運算、影像和影片處理,以及密碼學。有方法可以克服這些問題,但通常會增加應用程式的複雜度。 -Node.js 也依賴非同步程式設計。在非同步程式設計中,會啟動一個可能需要很長時間才能執行完成的任務,但程式不會等待該任務完成,而是讓主程式繼續執行,同時非同步任務平行執行。當任務完成時,程式會控制代碼結果。 +在非同步程式設計中,可能需要很長時間執行的任務會被啟動,但主程式不會等待它完成,而是繼續執行,同時非同步任務在背景中運行。 -這個處理程序通常涉及我們所知的「回呼」,這些回呼是定義非同步操作完成後會發生什麼的函式(程式)。Node.js 的非同步特性可能會使程式碼更難閱讀、理解和偵錯。 +這個過程通常涉及我們所知的「回呼」,這些是定義非同步操作完成後會發生什麼的函式。Node.js 的非同步特性可能會讓程式碼更難閱讀、理解和偵錯。 最後,你在從 `npm`(Node 軟體包管理器)選擇軟體包時也應該小心,因為其中一些可能不會持續維護,因此可能會為你自己的應用程式引入漏洞。作為開發者,你應該仔細評估每個軟體包,並檢查它是否遵循品質和安全的最佳實務。 diff --git a/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d39d7ed9ef36ff281f3.md b/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d39d7ed9ef36ff281f3.md index 280cc6e5ca1..0f0d432de29 100644 --- a/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d39d7ed9ef36ff281f3.md +++ b/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d39d7ed9ef36ff281f3.md @@ -17,7 +17,7 @@ dashedName: how-can-you-install-node-on-your-computer 在 macOS 和 Linux 上,你可以直接透過 shell 腳本安裝 NVM。 -但對於 macOS,請注意 NVM 的官方文件提到「你需要在執行安裝腳本之前手動安裝 Xcode 命令列工具,否則會失敗。」 +但對於 macOS,請注意 NVM 的官方文件提到「你需要在執行安裝腳本之前手動安裝 Xcode 命令列工具,否則安裝會失敗。」 在 macOS 上,你可以透過在你的終端機中執行此命令來安裝 Xcode 命令列工具: @@ -41,7 +41,7 @@ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash ``` -若你在閱讀本文時想取得最新版本的 NVM,請參考官方 NVM 文件:`https://github.com/nvm-sh/nvm?tab=readme-ov-file#install--update-script`。在那裡,你會找到帶有最新版本號的這些指令。 +要取得你閱讀本課程時的最新 NVM 版本,請參考官方 NVM 文件:`https://github.com/nvm-sh/nvm?tab=readme-ov-file#install--update-script`。在那裡,你會找到帶有最新版本號的這些命令。 當處理程序完成時,你可能需要重新啟動你的終端機以載入新的指令和新的設定。 @@ -101,7 +101,7 @@ node -v NVM 的正式版本僅在特定情況下支援 Windows。如果你的裝置已設定 Windows Subsystem for Linux(WSL),你可以依照上述 macOS/Linux 指南來安裝和使用 NVM。 -然而,對於 Windows 本身,有幾個替代方案。其中之一是 `nvm-windows`,一個用於 Windows 的 Node.js 版本管理工具。這是與官方 NVM 專案完全獨立的專案。但這些工具的目的相同——幫助你在同一裝置上使用多個版本的 Node.js。 +不過,對於 Windows 本身,有幾個替代方案。其中之一是 `nvm-windows`,這是一個 Windows 用的 Node.js 版本管理工具。這是與官方 NVM 專案完全獨立的專案。但這些工具的目的相同:幫助你在同一裝置上管理多個 Node.js 版本。 在安裝 `nvm-windows` 之前,你應該知道官方儲存庫建議在安裝 NVM for Windows 之前先卸載任何先前的 Node 安裝。如果這是你第一次安裝 Node.js,應該沒問題。如果你已經安裝了其他版本的 Node.js,建議先將它們卸載。 @@ -119,7 +119,7 @@ NVM 的正式版本僅在特定情況下支援 Windows。如果你的裝置已 nvm -v ``` -## 如何使用 NVM for Windows 安裝 Node.js +## 如何在 Windows 上使用 NVM 安裝 Node.js 既然你已經在 Windows 上安裝了 `nvm-windows`,你就可以準備安裝 Node.js。 @@ -155,7 +155,7 @@ nvm use 20 你也可以使用此指令檢查你目前的 Node.js 版本: -```bash +```powershell node -v ``` @@ -165,25 +165,25 @@ node -v 此外,雖然所有這些指令都適用於安裝在 macOS/Linux(包括 WSL)上的 NVM,但它們在 `nvm-windows` 上可能會有不同的執行方式,甚至可能完全無法使用。我們會盡可能提供 `nvm-windows` 的替代指令。 -### 如何調整 Powershell 的執行政策 +### 如何調整 PowerShell 的執行政策 -如果你正在執行 Windows 並且正在使用 Powershell 和 `nvm-windows`,你可能需要調整 Powershell 的執行政策。Powershell 的預設執行政策是 `Restricted`,這是一項防止腳本執行的安全措施。 +如果你正在使用 Windows 並跟著 PowerShell 和 `nvm-windows` 操作,你可能需要調整 PowerShell 的執行政策。PowerShell 的預設執行政策是 `Restricted`,這是一項安全措施,用來防止腳本執行。 -首先,右鍵點擊 Powershell,然後點擊「以系統管理員身分執行」來以系統管理員身分執行 Powershell。 +首先,右鍵點擊 PowerShell,選擇「以系統管理員身分執行」來開啟 PowerShell。 -然後,若要查看目前 Powershell 工作階段的執行政策,請執行以下命令: +接著,執行以下命令來查看目前 PowerShell 工作階段的執行政策: ```powershell Get-ExecutionPolicy ``` -最後,若要將 Powershell 的執行政策設定為 `RemoteSigned`,以允許區域的腳本和 `npm` 執行,請使用以下指令: +最後,使用以下命令將 PowerShell 的執行政策設定為 `RemoteSigned`,允許本地腳本和 `npm` 執行: ```powershell Set-ExecutionPolicy RemoteSigned ``` -在你執行上述指令後,你可以關閉 Powershell 的管理員視窗,並開啟非管理員 Powershell 視窗。 +執行完上述命令後,你可以關閉系統管理員權限的 PowerShell 視窗,然後開啟一般權限的 PowerShell 視窗。 ### 列出所有版本 diff --git a/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-operator-behavior/6732719e2e3ad4d947410b65.md b/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-operator-behavior/6732719e2e3ad4d947410b65.md index 66e8a4299e1..1599d46c6cc 100644 --- a/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-operator-behavior/6732719e2e3ad4d947410b65.md +++ b/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-operator-behavior/6732719e2e3ad4d947410b65.md @@ -11,7 +11,13 @@ dashedName: how-does-operator-precedence-work 運算子優先決定運算式中操作的評估順序。優先較高的運算子會先於優先較低的運算子被評估。將運算子優先想像成數學中的情況,除法和乘法會先於加法和減法進行。 -如果不遵守這條規則,基本方程式會給你錯誤的答案。JavaScript 的運作方式也是如此。它有自己的規則決定哪些運算子先執行、哪些運算子後執行,依此類推。<dfn>例如</dfn>,請看下面的表達式: +如果不遵守這個規則,基本的方程式就會給出錯誤的答案。JavaScript 也是一樣。它有自己的規則決定哪些運算子先執行、哪些後執行,依此類推。 + +## 算術運算式中的優先順序 + +### 乘法的優先順序 + +例如,看看下面的運算式: :::interactive_editor @@ -23,38 +29,44 @@ console.log(result); // 14 ::: -如果 JavaScript 從左到右評估這個表達式,你會預期 `2 + 3 = 5`,然後 `5 * 4 = 20`。但因為乘法的優先高於加法,JavaScript 會先評估 `3 * 4` 這部分,結果是 `2 + 12 = 14`。 +如果 JavaScript 從左到右評估這個表達式,你會預期 `2 + 3 = 5`,然後 `5 * 4 = 20`。但因為乘法的優先高於加法,JavaScript 會先評估 `3 * 4` 這部分,結果是 `2 + 12 = 14`。 -有時候,你可能希望你的表達式中的某些零件先執行,不管優先規則為何。你可以使用小括弧、`()` 來達成這個目的。小括弧內的任何東西都會先被計算,無論如何。讓我們讓前一個範例中的 `2 + 3` 部分先被計算: +### 除法的優先順序 + +除法運算子的優先權也高於加法或減法: :::interactive_editor ```js -const result = (2 + 3) * 4; +const result = 2 + 6 / 3; -console.log(result); // 20 +console.log(result); // 4 ``` ::: -在上述範例中,小括弧強制 JavaScript 先計算 `2 + 3`,然後再將結果乘以 `4`。這會給你 `20` 而不是 `14`。 +如果 JavaScript 從左到右評估這個表達式,你可能會預期 `2 + 6 = 8`,然後 `8 / 3 = 2.67`。但由於除法的優先高於加法,JavaScript 會先評估除法:`6 / 3 = 2`,然後再將 `2 + 2` 相加,得到結果 `4`。 -除法運算子的優先權也高於加法或減法: +### 使用小括號來改寫優先順序 + +有時你可能想讓運算式的某些部分先執行,不管優先順序規則如何。你可以使用小括號 `()` 來達成這點。小括號內的任何東西都會先被求值,無論如何。讓我們讓乘法範例中的 `2 + 3` 部分先被求值: :::interactive_editor ```js -const result = 2 + 6 / 3; +const result = (2 + 3) * 4; -console.log(result); // 4 +console.log(result); // 20 ``` ::: -如果 JavaScript 從左到右評估這個表達式,你可能會預期 `2 + 6 = 8`,然後 `8 / 3 = 2.67`。但由於除法的優先高於加法,JavaScript 會先評估除法:`6 / 3 = 2`,然後再將 `2 + 2` 相加,得到結果 `4`。 +在上述範例中,小括弧強制 JavaScript 先計算 `2 + 3`,然後再將結果乘以 `4`。這會給你 `20` 而不是 `14`。 因此,在乘法和除法中,這些操作行為總是會在加法和減法之前進行,除非你使用小括弧來改變順序。那麼,如果運算子具有相同的優先順序會發生什麼?JavaScript 使用結合性來決定評估它們的順序。 +## 理解結合性 + 結合性告訴 JavaScript 是否要從左到右或從右到左評估運算子。對於大多數運算子,例如加法和乘法,結合性是從左到右。因此,JavaScript 從運算式的最左側開始處理: :::interactive_editor @@ -84,6 +96,8 @@ console.log(a + b); // 10 在上述範例中,JavaScript 先將 `5` 指定給 `b`,然後將 `b`(現在是 `5`)指定給 `a`。 +### 指數運算子 + 指數運算子也是由右至左結合的: :::interactive_editor @@ -96,7 +110,7 @@ console.log(result); // 512 ::: -首先,JavaScript 計算 `3 ** 2`,結果為 `9`,接著計算 `2 ** 9`,結果為 `512`。如果指數運算子具有由左至右的結合性,JavaScript 會先計算 `2 ** 3` 得到 `8`,然後計算 `8 ** 2` 得到 `64`。  +首先,JavaScript 計算 `3 ** 2`,結果為 `9`,接著計算 `2 ** 9`,結果為 `512`。如果指數運算子具有由左至右的結合性,JavaScript 會先計算 `2 ** 3` 得到 `8`,然後計算 `8 ** 2` 得到 `64`。 # --questions-- diff --git a/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-regular-expressions/6733c5e54e3a154c8078ed48.md b/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-regular-expressions/6733c5e54e3a154c8078ed48.md index 6b2962ec8b6..ec4ee7abf21 100644 --- a/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-regular-expressions/6733c5e54e3a154c8078ed48.md +++ b/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-regular-expressions/6733c5e54e3a154c8078ed48.md @@ -17,6 +17,8 @@ const regex = /^\d\d\d\d$/; 這確實有效:它會匹配四個數字字元。但與其多次寫出相同的類別,不如給它一個量詞。 +## 精確量詞 + 量詞由包含一個或兩個數字的大括號定義。讓我們在樣式中使用量詞: ```js @@ -40,6 +42,8 @@ console.log(regex.test("1234567")); // false 該樣式只會匹配恰好四位數字的字串,因為我們使用了錨點且量詞只允許恰好四位數字。但識別碼可能只需要至少四位數字。 +## 最小與最大量詞 + 若要允許四位數或更多位數,請在你的量詞中的數字後面添加逗號: ```js @@ -84,6 +88,10 @@ console.log(regex.test("1234567")); // false 請注意,你不能只用這個語法來設定最大值:你必須總是設定最小值。但如果你將最小值設為 `1`,就能有效達到相同的效果。 +## 簡寫量詞 + +### 問號量詞(`?`) + 我們已經收到來自使用者的更新需求。識別符號現在可以選用以字母開頭。我們已經知道這個字元類別,所以讓我們將它添加到我們的正規表達式中: ```js @@ -122,6 +130,8 @@ console.log(regex.test("1234567")); // false 我們的樣式現在允許一個單一選用字母,後接四到六個數字。 +### 星號量詞(`*`) + 不幸地,我們剛剛發現我們讀錯了需求。我們需要允許在數字前有任意數量的字母。我們可以使用最小值為 `0` 且無定義最大值的量詞: ```js @@ -144,6 +154,8 @@ console.log(regex.test("1234567")); // false ::: +### 加號量詞(`+`) + 現在我們成功匹配任何以零個或多個字母開頭,接著是四到六個數字的識別符號。但結果發現這會讓系統當機:我們其實必須至少要求一個字母。 我們可以再次使用最小值為一且無最大值的量詞,或者使用另一個特殊語法,就是加號(`+`)符號: diff --git a/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-the-dom-click-events-and-web-apis/673368ccf52205329b729378.md b/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-the-dom-click-events-and-web-apis/673368ccf52205329b729378.md index 740a57e3f25..03273e48226 100644 --- a/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-the-dom-click-events-and-web-apis/673368ccf52205329b729378.md +++ b/curriculum/challenges/chinese-traditional/blocks/lecture-working-with-the-dom-click-events-and-web-apis/673368ccf52205329b729378.md @@ -1,19 +1,23 @@ --- id: 673368ccf52205329b729378 -title: innerText、textContent 和 innerHTML 之間的差異是什麼? +title: InnerText、textContent 和 innerHTML 之間的差異是什麼? challengeType: 19 dashedName: what-is-the-difference-between-innertext-textcontent-and-innerhtml --- # --interactive-- +## 概覽 + 讓我們來了解 `innerText`、`textContent` 和 `innerHTML`。 這些是你可以在 JavaScript 中存取的屬性,用來取得或更改 HTML 元素的內容。即使它們乍看之下可能非常相似,但確實有關鍵的差異。選擇正確的屬性取決於你的具體使用情境,所以讓我們深入了解。 讓我們從 `innerText` 開始。 -`innerText` 表述 HTML 元素及其子孫的可見文字內容。此屬性不包含隱藏文字或 HTML 標記,僅包含算繪的文字。 +## 了解 innerText + +`innerText` 表述 HTML 元素及其子孫的可見文字內容。此屬性不包含隱藏文字或 HTML 標記,僅包含算繪的文字。 例如,這裡你可以看到一個包含兩個段落的 `div` 元素: @@ -107,7 +111,9 @@ container.innerText = "JavaScript is awesome!"; 由於 `innerText` 會考慮可見性,取得其值會觸發一個稱為「reflow」的處理程序,該處理程序會重新計算網站上某些元素的位置。這個處理程序可能會消耗大量運算資源,因此如果可能,應避免觸發它。 -太好了。現在讓我們來談談 `textContent`。 +太好了。現在讓我們來談談 `textContent`。 + +## 了解 textContent `textContent` 傳回元素的純文字內容,包括其所有子孫元素中的文字。 @@ -181,6 +187,8 @@ container.textContent = "New content"; ::: +## 與 innerHTML 的比較 + 最後,讓我們談談 `textContent` 和 `innerText` 與 `innerHTML` 的差異。 請記住,使用 `innerHTML` 你可以設定元素的內部 HTML 內容。這對於動態地將新的 HTML 注入到 DOM 中非常有幫助。 @@ -189,6 +197,8 @@ container.textContent = "New content"; 為避免此情況,建議改用 `textContent` 屬性來插入純文字。 +## 主要差異總結 + JavaScript 中的 `innerText`、`textContent` 和 `innerHTML` 屬性提供不同的方式來存取和操作 HTML 元素的內容。如果你的目標是有效地在 JavaScript 中處理 HTML 內容,你應該了解這些屬性之間的差異。 # --questions-- diff --git a/curriculum/challenges/chinese-traditional/blocks/machine-learning-with-python-projects/5e46f8d6ac417301a38fb92d.md b/curriculum/challenges/chinese-traditional/blocks/machine-learning-with-python-projects/5e46f8d6ac417301a38fb92d.md index 31ccb851fac..e6e13187cb8 100644 --- a/curriculum/challenges/chinese-traditional/blocks/machine-learning-with-python-projects/5e46f8d6ac417301a38fb92d.md +++ b/curriculum/challenges/chinese-traditional/blocks/machine-learning-with-python-projects/5e46f8d6ac417301a38fb92d.md @@ -10,7 +10,7 @@ dashedName: rock-paper-scissors 在這個挑戰中,你將創建一個程式來玩剪刀、石頭、布。隨機選擇的程式通常會贏得 50% 的比賽。為了通過這個挑戰,你的程式必須與四個不同的機器人進行比賽,每場比賽至少贏得 60% 的遊戲。 -你將會<a href="https://app.ona.com/?autostart=true#https://github.com/freeCodeCamp/boilerplate-rock-paper-scissors/" target="_blank" rel="noopener noreferrer nofollow">使用我們的 Ona 起始程式碼來進行這個專案</a>。 +你將會<a href="https://codespaces.new/freeCodeCamp/boilerplate-rock-paper-scissors/" target="_blank" rel="noopener noreferrer nofollow">使用我們的起始程式碼來進行這個專案</a>。 我們仍在開發機器學習課程中互動式教學的零件。現在,你必須使用其他資源來學習如何通過這個挑戰。 @@ -26,7 +26,7 @@ dashedName: rock-paper-scissors ## 開發 -請勿修改 `RPS_game.py`。請將所有程式碼寫在 `RPS.py`。在開發時,你可以使用 `main.py` 來測試你的程式碼。 +請勿修改 `RPS_game.py`。請將所有程式碼寫在 `RPS.py`。在開發時,你可以使用 `main.py` 來測試你的程式碼。 `main.py` 從 `RPS_game.py` 匯入遊戲函式(程式)和機器人。 diff --git a/curriculum/challenges/chinese-traditional/blocks/review-introduction-to-express/6a0354d43d4c00eca38561f7.md b/curriculum/challenges/chinese-traditional/blocks/review-introduction-to-express/6a0354d43d4c00eca38561f7.md index d073b099e38..452d26b5552 100644 --- a/curriculum/challenges/chinese-traditional/blocks/review-introduction-to-express/6a0354d43d4c00eca38561f7.md +++ b/curriculum/challenges/chinese-traditional/blocks/review-introduction-to-express/6a0354d43d4c00eca38561f7.md @@ -7,53 +7,6 @@ dashedName: review-introduction-to-express # --description-- -## 網路服務與 API - -- **API(應用程式介面)**:軟體與其他軟體溝通的一般方式。 -- **網路服務**:一種特定類型的 API,使用 HTTP 等網路技術在網路上交換資料。每個網路服務都是 API,但並非每個 API 都是網路服務。 -- **網路服務的主要特性**:運行於伺服器上、支援機器對機器通訊、不依賴語言、不依賴平台,並使用標準網路協定(HTTP/HTTPS、FTP、SMTP)。 -- **REST(表述性狀態轉移)**:目前最廣泛使用的網路服務類型。公開以 URL 路徑識別的資源,如 `/users` 或 `/users/20`。回應通常是 JSON,也可以是 XML 或純文字。 -- **SOAP(簡單物件存取協定)**:只使用 XML。常見於需要更嚴格標準和安全性的企業系統。 -- **XML-RPC**:使用 XML 編碼請求和回應。輕量但比 REST 靈活度低。 -- **`Accept` 標頭**:用於客戶端告訴伺服器它想要的回應格式,例如 `Accept: application/json`。 - -## REST 架構 - -- **無狀態性**:每個請求必須包含伺服器處理所需的所有資訊。伺服器不會記住先前的請求。 -- **資源**:可被存取或修改的資料片段,由 URL 識別(例如 `/products/1`)。 -- **REST 中的 HTTP 方法**: - - `GET` — 取得資源 - - `POST` — 創建新資源 - - `PUT` / `PATCH` — 更新現有資源 - - `DELETE` — 刪除資源 - -## HTTP 狀態碼 - -處理請求後,伺服器會回應一個 **狀態碼**,表示結果: - -- `200` **(成功)**:請求成功 -- `201` **(已創建)**:已創建新資源 -- `400` **(錯誤請求)**:客戶端送出無效資料 -- `404` **(找不到)**:請求的資源不存在 -- `500` **(伺服器內部錯誤)**:伺服器發生錯誤 - -### REST 請求的運作流程 - -1. 客戶端送出包含方法、URL、選用標頭和選用主體的請求。 -2. 伺服器驗證請求並識別資源。 -3. 伺服器執行動作(取得、創建、更新或刪除)。 -4. 伺服器建立包含狀態碼和選用主體(通常是 JSON)的回應。 -5. 伺服器送出回應 — 不會儲存客戶端狀態。 -6. 客戶端檢查狀態碼並處理回傳資料。 - -## 單體式與微服務 - -- **單體式**:單一大型程式碼庫,UI、資料庫和 API 全部在一起。適合小型應用,但隨著規模增大,維護和擴充變得困難。 -- **微服務**:將大型應用拆分成較小、獨立的服務。每個服務負責一項業務功能(例如產品、訂單、付款),並可擁有自己的程式碼庫、資料庫和團隊。 -- **微服務的通訊方式**:透過 API 或訊息系統。 -- **微服務的優點**:開發更快、故障隔離更好,且每個服務可自由選擇不同語言或框架。 -- **微服務的挑戰**:偵錯更複雜、基礎建設管理更困難,服務間的網路額外負擔較大。 - ## 什麼是 Express.js? - **Express**:基於 Node.js 的極簡且彈性的網頁框架,讓建置網頁伺服器和 API 更簡單。 diff --git a/curriculum/challenges/chinese-traditional/blocks/review-rest-api-and-web-services/6a7c78ad958a597ee788ad2a.md b/curriculum/challenges/chinese-traditional/blocks/review-rest-api-and-web-services/6a7c78ad958a597ee788ad2a.md new file mode 100644 index 00000000000..875692af8d0 --- /dev/null +++ b/curriculum/challenges/chinese-traditional/blocks/review-rest-api-and-web-services/6a7c78ad958a597ee788ad2a.md @@ -0,0 +1,59 @@ +--- +id: 6a7c78ad958a597ee788ad2a +title: REST API 和網路服務回顧 +challengeType: 31 +dashedName: review-rest-api-and-web-services +--- + +# --description-- + +## 網路服務與 API + +- **API(應用程式介面)**:軟體與其他軟體溝通的一般方式。 +- **網路服務**:一種特定類型的 API,使用 HTTP 等網路技術在網路上交換資料。每個網路服務都是 API,但並非每個 API 都是網路服務。 +- **網路服務的主要特性**:運行於伺服器上、支援機器對機器通訊、不依賴語言、不依賴平台,並使用標準網路協定(HTTP/HTTPS、FTP、SMTP)。 +- **REST(表述性狀態轉移)**:目前最廣泛使用的網路服務類型。公開以 URL 路徑識別的資源,如 `/users` 或 `/users/20`。回應通常是 JSON,也可以是 XML 或純文字。 +- **SOAP(簡單物件存取協定)**:只使用 XML。常見於需要更嚴格標準和安全性的企業系統。 +- **XML-RPC**:使用 XML 編碼請求和回應。輕量但比 REST 靈活度低。 +- **`Accept` 標頭**:用於客戶端告訴伺服器它想要的回應格式,例如 `Accept: application/json`。 + +## REST 架構 + +- **無狀態性**:每個請求必須包含伺服器處理所需的所有資訊。伺服器不會記住先前的請求。 +- **資源**:可被存取或修改的資料片段,由 URL 識別(例如 `/products/1`)。 +- **REST 中的 HTTP 方法**: + - `GET` — 取得資源 + - `POST` — 創建新資源 + - `PUT` / `PATCH` — 更新現有資源 + - `DELETE` — 刪除資源 + +## HTTP 狀態碼 + +處理請求後,伺服器會回應一個 **狀態碼**,表示結果: + +- `200` **(成功)**:請求成功 +- `201` **(已創建)**:已創建新資源 +- `400` **(錯誤請求)**:客戶端送出無效資料 +- `404` **(找不到)**:請求的資源不存在 +- `500` **(伺服器內部錯誤)**:伺服器發生錯誤 + +### REST 請求的運作流程 + +1. 客戶端送出包含方法、URL、選用標頭和選用主體的請求。 +2. 伺服器驗證請求並識別資源。 +3. 伺服器執行動作(取得、創建、更新或刪除)。 +4. 伺服器建立包含狀態碼和選用主體(通常是 JSON)的回應。 +5. 伺服器送出回應 — 不會儲存客戶端狀態。 +6. 客戶端檢查狀態碼並處理回傳資料。 + +## 單體式與微服務 + +- **單體式**:單一大型程式碼庫,UI、資料庫和 API 全部在一起。適合小型應用,但隨著規模增大,維護和擴充變得困難。 +- **微服務**:將大型應用拆分成較小、獨立的服務。每個服務負責一項業務功能(例如產品、訂單、付款),並可擁有自己的程式碼庫、資料庫和團隊。 +- **微服務的通訊方式**:透過 API 或訊息系統。 +- **微服務的優點**:開發更快、故障隔離更好,且每個服務可自由選擇不同語言或框架。 +- **微服務的挑戰**:偵錯更複雜、基礎建設管理更困難,服務間的網路額外負擔較大。 + +# --assignment-- + +回顧 REST API 和網路服務的主題與概念。 diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e89d557d4b78bf83a02ae6.md b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e89d557d4b78bf83a02ae6.md index 9e1bcfba2bb..5747ca21685 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e89d557d4b78bf83a02ae6.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e89d557d4b78bf83a02ae6.md @@ -396,10 +396,10 @@ body { const { useState } = React; export const FootballPlayerCard = () => { - return ( + return ( --fcc-editable-region-- - <h1 style={{ backgroundColor: '#fff' }}>Hello, TSX!</h1> + <h1 style={{ backgroundColor: "#fff" }}>Hello, TSX!</h1> --fcc-editable-region-- - ) + ); }; ``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb2.md b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb2.md index 12f6c9b5082..5827b3138df 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb2.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb2.md @@ -29,12 +29,10 @@ assert.equal(element?.type, window.index.PlayerCard); <meta charset="utf-8"/> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Football Player Card Builder - - - + @@ -379,21 +377,18 @@ body { ```tsx const { useState } = React; -export function PlayerCard() { +export const PlayerCard = () => { return ( -
- -
+
); -} +}; export const FootballPlayerCard = () => { - + --fcc-editable-region-- return ( - --fcc-editable-region-- -

Football Card Builder

- --fcc-editable-region-- - ) +

Football Card Builder

+ ); + --fcc-editable-region-- }; ``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb3.md b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb3.md index 5d94d6c9d16..485a9d08937 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb3.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb3.md @@ -382,15 +382,13 @@ export const PlayerCard = () => { return (
--fcc-editable-region-- - + --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { - return ( - - ); + return ; }; ``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb4.md b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb4.md index 3ef4cc66848..15dd3d0f71e 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb4.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb4.md @@ -381,12 +381,12 @@ export const PlayerCard = () => {
--fcc-editable-region-- - + --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb5.md b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb5.md index e931c67d7ad..740749d2eb2 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb5.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb5.md @@ -394,13 +394,13 @@ export const PlayerCard = () => {
--fcc-editable-region-- - + --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb6.md b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb6.md index 88f65620e2a..dcebfa627cb 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb6.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb6.md @@ -390,14 +390,14 @@ export const PlayerCard = () => {
98
--fcc-editable-region-- - + --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb7.md b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb7.md index 3a1bc2d7c09..03bf524e066 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb7.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb7.md @@ -398,13 +398,13 @@ export const PlayerCard = () => {
ST
--fcc-editable-region-- - + --fcc-editable-region-- ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb8.md b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb8.md index aba7585103a..196e64d2d06 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb8.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb8.md @@ -394,14 +394,14 @@ export const PlayerCard = () => {
GOLD
--fcc-editable-region-- - + --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb9.md b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb9.md index 101845f2a9d..6771117bb9f 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb9.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb9.md @@ -393,12 +393,12 @@ export const PlayerCard = () => { --fcc-editable-region-- - + --fcc-editable-region-- ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bba.md b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bba.md index c3fc68999aa..126872f0676 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bba.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bba.md @@ -412,13 +412,13 @@ export const PlayerCard = () => {
--fcc-editable-region-- - + --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbb.md b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbb.md index ae45a614d43..07f4e1b58a6 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbb.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbb.md @@ -1,6 +1,6 @@ --- id: 69e8b295388ebbd517692bbb -title: 第 12 步 +title: 第 12 步驟 challengeType: 0 dashedName: step-12 --- @@ -406,12 +406,12 @@ export const PlayerCard = () => { Edson Arantes do Nascimento (Pele) headshot --fcc-editable-region-- - + --fcc-editable-region-- ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbc.md b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbc.md index 778fadeca14..8fbcbbda37b 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbc.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbc.md @@ -1,6 +1,6 @@ --- id: 69e8b295388ebbd517692bbc -title: 第 13 步 +title: 第 13 步驟 challengeType: 0 dashedName: step-13 --- @@ -409,12 +409,12 @@ export const PlayerCard = () => { PELE --fcc-editable-region-- - + --fcc-editable-region-- ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbd.md b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbd.md index 45b05687173..d25ab939ee9 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbd.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbd.md @@ -427,13 +427,13 @@ export const PlayerCard = () => { --fcc-editable-region-- - + --fcc-editable-region-- ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbe.md b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbe.md index 0fb1928a531..0caaa75b72d 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbe.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbe.md @@ -1,6 +1,6 @@ --- id: 69e8b295388ebbd517692bbe -title: 第 19 步 +title: 第 19 步驟 challengeType: 0 dashedName: step-19 --- @@ -465,7 +465,7 @@ export const PlayerCard = () => { ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbf.md b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbf.md index 71573d38580..3d77d4fffc4 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbf.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbf.md @@ -420,7 +420,7 @@ interface PlayerData { position: string; club: string; --fcc-editable-region-- - + --fcc-editable-region-- } @@ -478,7 +478,7 @@ export const PlayerCard = () => { ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc0.md b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc0.md index fca3c2c4d72..52d3fe42101 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc0.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc0.md @@ -497,7 +497,7 @@ export const PlayerCard = () => { ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc1.md b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc1.md index f86cf4bf027..e7750dd537c 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc1.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc1.md @@ -398,10 +398,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } --fcc-editable-region-- @@ -460,7 +460,7 @@ export const PlayerCard = () => { ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc2.md b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc2.md index fb63af9d341..6472cde2c24 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc2.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc2.md @@ -40,12 +40,10 @@ assert.exists(document.querySelector('.card-wrapper.tier-elite')); Football Player Card Builder - - - + @@ -405,10 +403,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -467,9 +465,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc3.md b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc3.md index 670faec0cbd..a1011991385 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc3.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc3.md @@ -399,10 +399,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -461,9 +461,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc4.md b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc4.md index eeafe34d6f7..8675fc4fdb3 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc4.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc4.md @@ -1,6 +1,6 @@ --- id: 69e8b295388ebbd517692bc4 -title: 第 26 步 +title: 步驟 26 challengeType: 0 dashedName: step-26 --- @@ -399,10 +399,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -461,9 +461,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc5.md b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc5.md index 256ee53d1fa..09a9fb1179f 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc5.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc5.md @@ -1,6 +1,6 @@ --- id: 69e8b295388ebbd517692bc5 -title: 第 27 步驟 +title: 步驟 27 challengeType: 0 dashedName: step-27 --- @@ -392,10 +392,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -456,9 +456,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc6.md b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc6.md index 8c906189115..8111672a872 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc6.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc6.md @@ -1,6 +1,6 @@ --- id: 69e8b295388ebbd517692bc6 -title: 第 28 步 +title: 步驟 28 challengeType: 0 dashedName: step-28 --- @@ -401,10 +401,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -465,9 +465,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc7.md b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc7.md index efed554bcc0..4805fcbc190 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc7.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc7.md @@ -391,10 +391,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -455,9 +455,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc8.md b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc8.md index cdc1103a5ca..d18dcc6d363 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc8.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc8.md @@ -407,10 +407,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -436,9 +436,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { {player.name}
- --fcc-editable-region--
+ --fcc-editable-region-- 97 PAC
@@ -448,10 +448,10 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
83 + --fcc-editable-region-- PAS
- --fcc-editable-region--
@@ -471,9 +471,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc9.md b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc9.md index d609c2e67ca..5469a23d3cd 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc9.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc9.md @@ -1,6 +1,6 @@ --- id: 69e8b296388ebbd517692bc9 -title: 第 32 步驟 +title: 步驟 32 challengeType: 0 dashedName: step-32 --- @@ -483,10 +483,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -545,13 +545,13 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
); -} +}; --fcc-editable-region-- --fcc-editable-region-- export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bca.md b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bca.md index 73cb925434a..ed24ddcc0b9 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bca.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bca.md @@ -1,6 +1,6 @@ --- id: 69e8b296388ebbd517692bca -title: 第 34 步 +title: 步驟 34 challengeType: 0 dashedName: step-34 --- @@ -419,10 +419,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -481,14 +481,14 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { - name: 'PELE', + name: "PELE", overallRating: 98, - position: 'ST', - club: 'Santos FC', - imageUrl: 'https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg', + position: "ST", + club: "Santos FC", + imageUrl: "https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg", pac: 97, sho: 98, pas: 83, diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcb.md b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcb.md index a89e2422283..a360e6ff61f 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcb.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcb.md @@ -1,6 +1,6 @@ --- id: 69e8b296388ebbd517692bcb -title: 第 35 步 +title: 步驟 35 challengeType: 0 dashedName: step-35 --- @@ -435,10 +435,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -497,14 +497,14 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { - name: 'PELE', + name: "PELE", overallRating: 98, - position: 'ST', - club: 'Santos FC', - imageUrl: 'https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg', + position: "ST", + club: "Santos FC", + imageUrl: "https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg", pac: 97, sho: 98, pas: 83, @@ -517,6 +517,7 @@ export const FootballPlayerCard = () => { const [player, setPlayer] = useState(defaultPlayer); return ( --fcc-editable-region-- + --fcc-editable-region-- ); diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcc.md b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcc.md index 8acb51dbefe..8b874a8ab89 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcc.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcc.md @@ -477,7 +477,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -504,7 +504,9 @@ export const FootballPlayerCard = () => { --fcc-editable-region-- + + --fcc-editable-region-- ); diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcd.md b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcd.md index da9f13febe4..e0f8e761b32 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcd.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcd.md @@ -465,7 +465,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bce.md b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bce.md index ea30d1c387a..615ba45dc19 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bce.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bce.md @@ -1,6 +1,6 @@ --- id: 69e8b296388ebbd517692bce -title: 第 39 步 +title: 步驟 39 challengeType: 0 dashedName: step-39 --- @@ -470,7 +470,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcf.md b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcf.md index c2be6d772f1..54f8184ff10 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcf.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcf.md @@ -1,6 +1,6 @@ --- id: 69e8b296388ebbd517692bcf -title: 第 40 步 +title: 步驟 40 challengeType: 0 dashedName: step-40 --- @@ -488,7 +488,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd0.md b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd0.md index 2a8095d0e11..88954914395 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd0.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd0.md @@ -1,6 +1,6 @@ --- id: 69e8b296388ebbd517692bd0 -title: 第 42 步 +title: 步驟 42 challengeType: 0 dashedName: step-42 --- @@ -471,7 +471,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd1.md b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd1.md index 07fe58acbb9..f56a12cca06 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd1.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd1.md @@ -1,6 +1,6 @@ --- id: 69e8b296388ebbd517692bd1 -title: 第 43 步 +title: 步驟 43 challengeType: 0 dashedName: step-43 --- @@ -471,7 +471,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd2.md b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd2.md index 2e7843e7007..e638c5e5638 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd2.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd2.md @@ -1,6 +1,6 @@ --- id: 69e8b296388ebbd517692bd2 -title: 第 44 步 +title: 步驟 44 challengeType: 0 dashedName: step-44 --- @@ -471,7 +471,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -535,7 +535,7 @@ export const FootballPlayerCard = () => { - --fcc-editable-region-- + --fcc-editable-region-- --fcc-editable-region-- diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd3.md b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd3.md index 6870a738c9d..45937da2037 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd3.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd3.md @@ -1,6 +1,6 @@ --- id: 69e8b296388ebbd517692bd3 -title: 第 45 步 +title: 步驟 45 challengeType: 0 dashedName: step-45 --- @@ -497,7 +497,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd4.md b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd4.md index 97860811922..cf6b78c2d41 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd4.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd4.md @@ -1,6 +1,6 @@ --- id: 69e8b296388ebbd517692bd4 -title: 第 46 步 +title: 步驟 46 challengeType: 0 dashedName: step-46 --- @@ -497,7 +497,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd5.md b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd5.md index 9a06d8dc2f4..42ae609097f 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd5.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd5.md @@ -1,6 +1,6 @@ --- id: 69e8b296388ebbd517692bd5 -title: 第 47 步 +title: 步驟 47 challengeType: 0 dashedName: step-47 --- @@ -497,7 +497,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd6.md b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd6.md index 91ee365e682..7df22b6036e 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd6.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd6.md @@ -470,7 +470,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd7.md b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd7.md index a05a077ebae..a66c4d4f211 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd7.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd7.md @@ -1,6 +1,6 @@ --- id: 69e8b296388ebbd517692bd7 -title: 第 52 步 +title: 步驟 52 challengeType: 0 dashedName: step-52 --- @@ -478,7 +478,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -609,3 +609,4 @@ export const FootballPlayerCard = () => { ); }; ``` + diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd8.md b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd8.md index a4ab004ae22..9dc8f31c067 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd8.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd8.md @@ -1,6 +1,6 @@ --- id: 69e8b296388ebbd517692bd8 -title: 第 55 步 +title: 步驟 55 challengeType: 0 dashedName: step-55 --- @@ -410,7 +410,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -484,7 +484,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -538,8 +538,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd9.md b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd9.md index ecb99ac2123..c443af650a6 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd9.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd9.md @@ -1,6 +1,6 @@ --- id: 69e8b296388ebbd517692bd9 -title: 第 56 步驟 +title: 步驟 56 challengeType: 0 dashedName: step-56 --- @@ -402,7 +402,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -476,7 +476,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -530,8 +530,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bda.md b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bda.md index aa7f542c05e..0242c2f51b4 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bda.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bda.md @@ -1,6 +1,6 @@ --- id: 69e8b296388ebbd517692bda -title: 第 57 步 +title: 步驟 57 challengeType: 0 dashedName: step-57 --- @@ -402,7 +402,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -476,7 +476,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -530,8 +530,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( @@ -640,3 +641,4 @@ export const FootballPlayerCard = () => { ); }; ``` + diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdb.md b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdb.md index b73ccc3917c..538ad3aeff7 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdb.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdb.md @@ -1,6 +1,6 @@ --- id: 69e8b296388ebbd517692bdb -title: 第 58 步 +title: 步驟 58 challengeType: 0 dashedName: step-58 --- @@ -402,7 +402,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -476,7 +476,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -530,8 +530,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdc.md b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdc.md index dadc84d9a49..72030884a0c 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdc.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdc.md @@ -1,6 +1,6 @@ --- id: 69e8b296388ebbd517692bdc -title: 第 59 步驟 +title: 步驟 59 challengeType: 0 dashedName: step-59 --- @@ -402,7 +402,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -476,7 +476,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -530,8 +530,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdd.md b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdd.md index c6390216bae..b90ee868278 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdd.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdd.md @@ -1,6 +1,6 @@ --- id: 69e8b296388ebbd517692bdd -title: 第 60 步驟 +title: 步驟 60 challengeType: 0 dashedName: step-60 --- @@ -402,7 +402,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -476,7 +476,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -530,8 +530,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bde.md b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bde.md index 3b88ce9fc1b..2d3d262549a 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bde.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bde.md @@ -1,6 +1,6 @@ --- id: 69e8b296388ebbd517692bde -title: 第 61 步 +title: 步驟 61 challengeType: 0 dashedName: step-61 --- @@ -402,7 +402,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -414,10 +414,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -430,7 +430,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
{player.position}
-
{getPlayerTier(player.overallRating).toUpperCase()}
+
+ {getPlayerTier(player.overallRating).toUpperCase()} +
{player.club}
@@ -474,14 +476,14 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { - name: 'PELE', + name: "PELE", overallRating: 98, - position: 'ST', - club: 'Santos FC', - imageUrl: 'https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg', + position: "ST", + club: "Santos FC", + imageUrl: "https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg", pac: 97, sho: 98, pas: 83, @@ -506,8 +508,18 @@ export const FootballPlayerCard = () => {

Player Info

- - setPlayer({ ...player, name: e.target.value })} /> + + + setPlayer({ ...player, name: e.target.value }) + } + />
@@ -518,8 +530,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( @@ -531,46 +544,115 @@ export const FootballPlayerCard = () => {
- - setPlayer({ ...player, overallRating: Number(e.target.value) })} /> + + + setPlayer({ + ...player, + overallRating: Number(e.target.value), + }) + } + />
- - setPlayer({ ...player, club: e.target.value })} /> + + + setPlayer({ ...player, club: e.target.value }) + } + />
- - setPlayer({ ...player, imageUrl: e.target.value })} /> + + + setPlayer({ ...player, imageUrl: e.target.value }) + } + />

Player Stats

- - setPlayer({ ...player, pac: Number(e.target.value) })} /> + + + setPlayer({ ...player, pac: Number(e.target.value) }) + } + />
- - setPlayer({ ...player, sho: Number(e.target.value) })} /> + + + setPlayer({ ...player, sho: Number(e.target.value) }) + } + />
- - setPlayer({ ...player, pas: Number(e.target.value) })} /> + + + setPlayer({ ...player, pas: Number(e.target.value) }) + } + />
- + --fcc-editable-region-- --fcc-editable-region--
- +
- +
@@ -579,7 +661,9 @@ export const FootballPlayerCard = () => {

Live Preview

Updates as you type

-
+
@@ -589,3 +673,4 @@ export const FootballPlayerCard = () => { ); }; ``` + diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdf.md b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdf.md index 9d5d085571a..3e1640f112b 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdf.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdf.md @@ -1,6 +1,6 @@ --- id: 69e8b296388ebbd517692bdf -title: 第 62 步驟 +title: 步驟 62 challengeType: 0 dashedName: step-62 --- @@ -421,7 +421,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -495,7 +495,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -549,8 +549,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( @@ -667,11 +668,11 @@ export const FootballPlayerCard = () => { } /> - --fcc-editable-region--
+ --fcc-editable-region--
@@ -679,8 +680,8 @@ export const FootballPlayerCard = () => { PHY -
--fcc-editable-region-- + diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8d1be04ed6aad1c955729.md b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8d1be04ed6aad1c955729.md index c79835d6fbd..812f5204b9a 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8d1be04ed6aad1c955729.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69e8d1be04ed6aad1c955729.md @@ -391,8 +391,8 @@ const { useState } = React; --fcc-editable-region-- export const FootballPlayerCard = () => { - return ( -

Football Card Builder

- ) + return ( +

Football Card Builder

+ ); }; ``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69ea01c45b04f3e9de845036.md b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69ea01c45b04f3e9de845036.md index 05714281a0a..85dfd26a093 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69ea01c45b04f3e9de845036.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69ea01c45b04f3e9de845036.md @@ -1,6 +1,6 @@ --- id: 69ea01c45b04f3e9de845036 -title: 第 63 步 +title: 步驟 63 challengeType: 0 dashedName: step-63 --- @@ -405,7 +405,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -483,7 +483,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -537,8 +537,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69ea02adff0fd528639ee23b.md b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69ea02adff0fd528639ee23b.md index 22f5761a0d9..0c125a4d7d3 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69ea02adff0fd528639ee23b.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69ea02adff0fd528639ee23b.md @@ -1,6 +1,6 @@ --- id: 69ea02adff0fd528639ee23b -title: 第 64 步 +title: 步驟 64 challengeType: 0 dashedName: step-64 --- @@ -409,7 +409,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -485,7 +485,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -543,8 +543,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69ea0349f8305a99324465ff.md b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69ea0349f8305a99324465ff.md index 4a2204086e9..cdb9717d14e 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69ea0349f8305a99324465ff.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69ea0349f8305a99324465ff.md @@ -1,6 +1,6 @@ --- id: 69ea0349f8305a99324465ff -title: 第 65 步 +title: 步驟 65 challengeType: 0 dashedName: step-65 --- @@ -407,7 +407,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -483,7 +483,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -502,11 +502,9 @@ const defaultPlayer: PlayerData = { function loadPlayer(): PlayerData { try { --fcc-editable-region-- - - --fcc-editable-region-- - } catch (error) { - } + --fcc-editable-region-- + } catch (error) {} } export const FootballPlayerCard = () => { @@ -547,8 +545,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69ea044f8c93a5e7ce64214c.md b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69ea044f8c93a5e7ce64214c.md index 401696c9c66..2fc489edbaf 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69ea044f8c93a5e7ce64214c.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69ea044f8c93a5e7ce64214c.md @@ -1,6 +1,6 @@ --- id: 69ea044f8c93a5e7ce64214c -title: 第 66 步 +title: 步驟 66 challengeType: 0 dashedName: step-66 --- @@ -395,7 +395,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -471,7 +471,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -492,12 +492,10 @@ function loadPlayer(): PlayerData { const saved = localStorage.getItem(STORAGE_KEY); if (saved) { --fcc-editable-region-- - + --fcc-editable-region-- - }; - } catch (error) { - - } + } + } catch (error) {} } export const FootballPlayerCard = () => { @@ -538,8 +536,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69ea0577f25e519489353f82.md b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69ea0577f25e519489353f82.md index 0a15b4b1615..cbff3202c67 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69ea0577f25e519489353f82.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69ea0577f25e519489353f82.md @@ -1,6 +1,6 @@ --- id: 69ea0577f25e519489353f82 -title: 第 67 步 +title: 步驟 67 challengeType: 0 dashedName: step-67 --- @@ -405,7 +405,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -418,7 +418,6 @@ interface PlayerData { const STORAGE_KEY = "football_player_card"; - export function getPlayerTier(rating: number): string { if (rating >= 92) return "elite"; if (rating >= 85) return "gold"; @@ -482,7 +481,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -505,14 +504,15 @@ function loadPlayer(): PlayerData { return { ...defaultPlayer, ...JSON.parse(saved) - } - }; ---fcc-editable-region-- + }; + } } catch (error) { +--fcc-editable-region-- } -} + --fcc-editable-region-- +} export const FootballPlayerCard = () => { const [player, setPlayer] = useState(defaultPlayer); @@ -552,8 +552,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69ea064edb0dcc46e1422cca.md b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69ea064edb0dcc46e1422cca.md index 92c0940f61a..e8319a1d0fe 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69ea064edb0dcc46e1422cca.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69ea064edb0dcc46e1422cca.md @@ -1,6 +1,6 @@ --- id: 69ea064edb0dcc46e1422cca -title: 第 68 步 +title: 步驟 68 challengeType: 0 dashedName: step-68 --- @@ -401,7 +401,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -477,7 +477,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -500,8 +500,8 @@ function loadPlayer(): PlayerData { return { ...defaultPlayer, ...JSON.parse(saved) - } - }; + }; + } } catch (error) { console.log("Failed to load player data, using defaults:", error); } @@ -546,8 +546,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69ea0939f2f92cfc6c7a850d.md b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69ea0939f2f92cfc6c7a850d.md index 5553d785c1a..187c3cdb27e 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69ea0939f2f92cfc6c7a850d.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69ea0939f2f92cfc6c7a850d.md @@ -1,6 +1,6 @@ --- id: 69ea0939f2f92cfc6c7a850d -title: 第 69 步 +title: 步驟 69 challengeType: 0 dashedName: step-69 --- @@ -46,12 +46,10 @@ assert.match(__helpers.removeJSComments(code), /useEffect\s*\(\(\)\s=>\s*\{\s*tr Football Player Card Builder - - - + @@ -415,7 +413,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -435,7 +433,7 @@ export function getPlayerTier(rating: number): string { return "bronze"; } -function PlayerCard({ player }: { player: PlayerData }) { +export const PlayerCard = ({ player }: { player: PlayerData }) => { return (
@@ -491,7 +489,7 @@ function PlayerCard({ player }: { player: PlayerData }) {
); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -514,8 +512,8 @@ function loadPlayer(): PlayerData { return { ...defaultPlayer, ...JSON.parse(saved) - } - }; + }; + } } catch (error) { console.log("Failed to load player data, using defaults:", error); } @@ -526,7 +524,7 @@ export const FootballPlayerCard = () => { const [player, setPlayer] = useState(defaultPlayer); --fcc-editable-region-- - + --fcc-editable-region-- return ( @@ -565,8 +563,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69ea0a89bd84cf2461b48ceb.md b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69ea0a89bd84cf2461b48ceb.md index 681442a11c1..e417b357bef 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69ea0a89bd84cf2461b48ceb.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69ea0a89bd84cf2461b48ceb.md @@ -1,6 +1,6 @@ --- id: 69ea0a89bd84cf2461b48ceb -title: 第 70 步 +title: 步驟 70 challengeType: 0 dashedName: step-70 --- @@ -403,7 +403,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -479,7 +479,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -502,8 +502,8 @@ function loadPlayer(): PlayerData { return { ...defaultPlayer, ...JSON.parse(saved) - } - }; + }; + } } catch (error) { console.log("Failed to load player data, using defaults:", error); } @@ -513,15 +513,15 @@ function loadPlayer(): PlayerData { export const FootballPlayerCard = () => { const [player, setPlayer] = useState(defaultPlayer); ---fcc-editable-region-- useEffect(() => { try { +--fcc-editable-region-- } catch (error) { +--fcc-editable-region-- } }, [player]); ---fcc-editable-region-- return (
@@ -559,8 +559,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69ea0bb3e7000f44c207bb0e.md b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69ea0bb3e7000f44c207bb0e.md index ae8f461975f..6c2dee0f3a3 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69ea0bb3e7000f44c207bb0e.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69ea0bb3e7000f44c207bb0e.md @@ -1,6 +1,6 @@ --- id: 69ea0bb3e7000f44c207bb0e -title: 第 71 步驟 +title: 步驟 71 challengeType: 0 dashedName: step-71 --- @@ -401,7 +401,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -477,7 +477,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -500,8 +500,8 @@ function loadPlayer(): PlayerData { return { ...defaultPlayer, ...JSON.parse(saved) - } - }; + }; + } } catch (error) { console.log("Failed to load player data, using defaults:", error); } @@ -557,8 +557,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( @@ -1098,7 +1099,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -1174,7 +1175,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -1197,8 +1198,8 @@ function loadPlayer(): PlayerData { return { ...defaultPlayer, ...JSON.parse(saved) - } - }; + }; + } } catch (error) { console.log("Failed to load player data, using defaults:", error); } @@ -1252,8 +1253,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69ea1bb4a66dd6debb999c7f.md b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69ea1bb4a66dd6debb999c7f.md index f167d69239c..5ab9335baa9 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69ea1bb4a66dd6debb999c7f.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69ea1bb4a66dd6debb999c7f.md @@ -1,6 +1,6 @@ --- id: 69ea1bb4a66dd6debb999c7f -title: 第 49 步 +title: 步驟 49 challengeType: 0 dashedName: step-49 --- @@ -473,7 +473,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69ea1dd8e74976afa407bf22.md b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69ea1dd8e74976afa407bf22.md index fa937a91336..f9af9533fac 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69ea1dd8e74976afa407bf22.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69ea1dd8e74976afa407bf22.md @@ -1,6 +1,6 @@ --- id: 69ea1dd8e74976afa407bf22 -title: 第 50 步 +title: 步驟 50 challengeType: 0 dashedName: step-50 --- @@ -479,7 +479,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69ea1ed1543a4db863564aac.md b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69ea1ed1543a4db863564aac.md index da6d8291e91..05f7edbc95f 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69ea1ed1543a4db863564aac.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69ea1ed1543a4db863564aac.md @@ -1,6 +1,6 @@ --- id: 69ea1ed1543a4db863564aac -title: 第 51 步 +title: 步驟 51 challengeType: 0 dashedName: step-51 --- @@ -472,7 +472,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69ea21dcd8c4cb48c23a2c67.md b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69ea21dcd8c4cb48c23a2c67.md index 0320daa5257..7d460cca867 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69ea21dcd8c4cb48c23a2c67.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69ea21dcd8c4cb48c23a2c67.md @@ -1,6 +1,6 @@ --- id: 69ea21dcd8c4cb48c23a2c67 -title: 第 53 步 +title: 步驟 53 challengeType: 0 dashedName: step-53 --- @@ -14,7 +14,7 @@ dashedName: step-53 你的位置 `select` 應該有一個 `onChange` 處理常式,該處理常式呼叫 `setPlayer`,傳入展開的 `player`,並更新 `position`。 ```js -assert.match(__helpers.removeJSComments(code), /onChange.*setPlayer.*\.\.\.\s*player[\s\S]*position/); +assert.match(__helpers.removeJSComments(code), /onChange=\{[\s\S]*?position:\s*e\.target\.value\s+as\s+Position/); ``` # --seed-- @@ -469,7 +469,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69ea2378f3c6a60a57cc29c3.md b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69ea2378f3c6a60a57cc29c3.md index f092dda06fa..d7143a499f6 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69ea2378f3c6a60a57cc29c3.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69ea2378f3c6a60a57cc29c3.md @@ -1,6 +1,6 @@ --- id: 69ea2378f3c6a60a57cc29c3 -title: 第 54 步 +title: 步驟 54 challengeType: 0 dashedName: step-54 --- @@ -483,7 +483,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -537,10 +537,12 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > --fcc-editable-region-- - + --fcc-editable-region-- diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69eb216380522cfc11aa408c.md b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69eb216380522cfc11aa408c.md index 6d56da7d95b..0eef7f5102f 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69eb216380522cfc11aa408c.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69eb216380522cfc11aa408c.md @@ -443,7 +443,7 @@ export const PlayerCard = () => { ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69eb23665c115447405343ac.md b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69eb23665c115447405343ac.md index dd608bfe438..de6f85e90c3 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69eb23665c115447405343ac.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69eb23665c115447405343ac.md @@ -461,7 +461,7 @@ export const PlayerCard = () => { ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69eb2847cc8f5638e226e8ce.md b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69eb2847cc8f5638e226e8ce.md index a1a8ce701e6..ceb424a04a7 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69eb2847cc8f5638e226e8ce.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69eb2847cc8f5638e226e8ce.md @@ -483,10 +483,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -543,7 +543,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { --fcc-editable-region-- diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69ed3985819de69de27c4390.md b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69ed3985819de69de27c4390.md index fe2c9d442f5..e7ef08eef35 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69ed3985819de69de27c4390.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69ed3985819de69de27c4390.md @@ -1,6 +1,6 @@ --- id: 69ed3985819de69de27c4390 -title: 第 33 步 +title: 步驟 33 challengeType: 0 dashedName: step-33 --- @@ -391,10 +391,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -453,14 +453,14 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { - name: 'PELE', + name: "PELE", overallRating: 98, - position: 'ST', - club: 'Santos FC', - imageUrl: 'https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg', + position: "ST", + club: "Santos FC", + imageUrl: "https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg", pac: 97, sho: 98, pas: 83, @@ -471,7 +471,7 @@ const defaultPlayer: PlayerData = { export const FootballPlayerCard = () => { --fcc-editable-region-- - return ; + return ; --fcc-editable-region-- }; ``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69f1a6f57dd2d4685822074a.md b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69f1a6f57dd2d4685822074a.md index e6525b8dd84..99938545bb8 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69f1a6f57dd2d4685822074a.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69f1a6f57dd2d4685822074a.md @@ -401,8 +401,8 @@ export const PlayerCard = () => {
- --fcc-editable-region--
+ --fcc-editable-region--
@@ -410,14 +410,14 @@ export const PlayerCard = () => {
-
--fcc-editable-region-- +
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69f1a9e19340f19b1fd051c6.md b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69f1a9e19340f19b1fd051c6.md index 1a89a2e899a..8d9012e1125 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69f1a9e19340f19b1fd051c6.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69f1a9e19340f19b1fd051c6.md @@ -416,9 +416,9 @@ export const PlayerCard = () => {
- --fcc-editable-region--
+ --fcc-editable-region--
@@ -426,14 +426,14 @@ export const PlayerCard = () => {
+ --fcc-editable-region--
- --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69f1af24b0860d13f0b295e5.md b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69f1af24b0860d13f0b295e5.md index ad5a7b376a5..b1fdfaffe06 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69f1af24b0860d13f0b295e5.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69f1af24b0860d13f0b295e5.md @@ -1,6 +1,6 @@ --- id: 69f1af24b0860d13f0b295e5 -title: 第 31 步 +title: 步驟 31 challengeType: 0 dashedName: step-31 --- @@ -407,10 +407,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -451,9 +451,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
- --fcc-editable-region--
+ --fcc-editable-region-- 99 DRI
@@ -463,17 +463,17 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
75 + --fcc-editable-region-- PHY
- --fcc-editable-region-- ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69f1b1fb36c6c0c80907e8e1.md b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69f1b1fb36c6c0c80907e8e1.md index 6d3c2f01ba6..80c74f52185 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69f1b1fb36c6c0c80907e8e1.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69f1b1fb36c6c0c80907e8e1.md @@ -1,6 +1,6 @@ --- id: 69f1b1fb36c6c0c80907e8e1 -title: 第 37 步 +title: 步驟 37 challengeType: 0 dashedName: step-37 --- @@ -483,7 +483,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -511,17 +511,15 @@ export const FootballPlayerCard = () => {
- --fcc-editable-region-- -
- -
+
+ --fcc-editable-region--
+ --fcc-editable-region--
- --fcc-editable-region-- ); }; diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69f1b591221851200c734eb4.md b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69f1b591221851200c734eb4.md index e6923695f9d..53c8a676451 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69f1b591221851200c734eb4.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-build-a-football-player-card-builder/69f1b591221851200c734eb4.md @@ -1,6 +1,6 @@ --- id: 69f1b591221851200c734eb4 -title: 第 41 步 +title: 步驟 41 challengeType: 0 dashedName: step-41 --- @@ -472,7 +472,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f356ed6199b0cdef1d2be8f.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f356ed6199b0cdef1d2be8f.md index ca62f26533f..11a3f818430 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f356ed6199b0cdef1d2be8f.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f356ed6199b0cdef1d2be8f.md @@ -13,11 +13,11 @@ dashedName: step-22 ```css .class-name { - styles + property: value; } ``` -將現有的 `#menu` 選擇器改為類別選擇器,方法是將 `#menu` 替換為名為 `.menu` 的類別。 +將現有的 `#menu` 選擇器改成類別選擇器,方法是將 `#menu` 替換成類別選擇器 `.menu`。 # --hints-- diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f3cade99dda4e6071a85dfd.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f3cade99dda4e6071a85dfd.md index 7644c155b76..fc8f2b424ab 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f3cade99dda4e6071a85dfd.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f3cade99dda4e6071a85dfd.md @@ -109,7 +109,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f3ef6e01f288a026d709587.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f3ef6e01f288a026d709587.md index fc088f5a43f..af322ab9774 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f3ef6e01f288a026d709587.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f3ef6e01f288a026d709587.md @@ -171,7 +171,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f3ef6e03d719d5ac4738993.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f3ef6e03d719d5ac4738993.md index 21fe3a5dd5b..afcb6bec1ab 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f3ef6e03d719d5ac4738993.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f3ef6e03d719d5ac4738993.md @@ -115,7 +115,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f3ef6e04559b939080db057.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f3ef6e04559b939080db057.md index 2743dc25e30..c74182595cb 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f3ef6e04559b939080db057.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f3ef6e04559b939080db057.md @@ -139,7 +139,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f3ef6e050279c7a4a7101d3.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f3ef6e050279c7a4a7101d3.md index 850b462dc66..83b4887db6e 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f3ef6e050279c7a4a7101d3.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f3ef6e050279c7a4a7101d3.md @@ -137,7 +137,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f3ef6e05473f91f948724ab.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f3ef6e05473f91f948724ab.md index ffdf11844ce..960cce40099 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f3ef6e05473f91f948724ab.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f3ef6e05473f91f948724ab.md @@ -116,6 +116,6 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f3ef6e056bdde6ae6892ba2.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f3ef6e056bdde6ae6892ba2.md index bed4ed4160a..ea0d714a343 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f3ef6e056bdde6ae6892ba2.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f3ef6e056bdde6ae6892ba2.md @@ -9,7 +9,7 @@ dashedName: step-54 所有文字使用相同的 `font-family` 有點無聊。你仍然可以讓大部分文字使用 `sans-serif`,並且只用不同的選擇器讓 `h1` 和 `h2` 元素不同。 -使用單一選擇器為 `h1` 和 `h2` 元素設定樣式,使這些元素的文字使用 `Impact` 字型。 +使用單一選擇器列表為 `h1` 和 `h2` 元素設定樣式,使這些元素的文字使用 `Impact` 字型。 # --hints-- @@ -135,7 +135,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f3ef6e06d34faac0447fc44.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f3ef6e06d34faac0447fc44.md index 109d343b0b9..96abe6fb895 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f3ef6e06d34faac0447fc44.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f3ef6e06d34faac0447fc44.md @@ -127,7 +127,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f3ef6e07276f782bb46b93d.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f3ef6e07276f782bb46b93d.md index e6c7aef424a..db079f967f0 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f3ef6e07276f782bb46b93d.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f3ef6e07276f782bb46b93d.md @@ -142,7 +142,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f3ef6e0819d4f23ca7285e6.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f3ef6e0819d4f23ca7285e6.md index aaee212c265..e110ffc5a4c 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f3ef6e0819d4f23ca7285e6.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f3ef6e0819d4f23ca7285e6.md @@ -104,7 +104,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f3ef6e087d56ed3ffdc36be.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f3ef6e087d56ed3ffdc36be.md index bb1109daa8b..50d372c2062 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f3ef6e087d56ed3ffdc36be.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f3ef6e087d56ed3ffdc36be.md @@ -129,6 +129,6 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f3ef6e0a81099d9a697b550.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f3ef6e0a81099d9a697b550.md index 0fcb1d7cfbf..39c4dfa6bcf 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f3ef6e0a81099d9a697b550.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f3ef6e0a81099d9a697b550.md @@ -167,7 +167,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f3ef6e0b431cc215bb16f55.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f3ef6e0b431cc215bb16f55.md index 9a9c303d76d..b6cc2a0927d 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f3ef6e0b431cc215bb16f55.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f3ef6e0b431cc215bb16f55.md @@ -141,7 +141,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f3ef6e0e0c3feaebcf647ad.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f3ef6e0e0c3feaebcf647ad.md index afc6cf576e5..5a097f3eae9 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f3ef6e0e0c3feaebcf647ad.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f3ef6e0e0c3feaebcf647ad.md @@ -103,7 +103,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f3ef6e0e9629bad967cd71e.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f3ef6e0e9629bad967cd71e.md index 84b9dc2b9eb..3466a38d439 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f3ef6e0e9629bad967cd71e.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f3ef6e0e9629bad967cd71e.md @@ -7,7 +7,7 @@ dashedName: step-55 # --description-- -你可以為字型家族添加一個 fallback 值,方法是添加另一個以逗號分隔的字型名稱。當找不到/無法使用初始字型時,會使用 fallback。 +你可以為 `font-family` 添加一個 備援字型,方法是在字型名稱之間用逗號分隔。當第一個字型無法使用時,就會使用備援字型。 在 `Impact` 字型之後添加備用字型 `serif`。 @@ -113,7 +113,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f3ef6e0eaa7da26e3d34d78.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f3ef6e0eaa7da26e3d34d78.md index c4c131a1a2c..01dee72de2b 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f3ef6e0eaa7da26e3d34d78.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f3ef6e0eaa7da26e3d34d78.md @@ -128,7 +128,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f3ef6e0f8c230bdd2349716.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f3ef6e0f8c230bdd2349716.md index c9e8a2f6e2d..c250cdee1c3 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f3ef6e0f8c230bdd2349716.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f3ef6e0f8c230bdd2349716.md @@ -140,6 +140,6 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f3f26fa39591db45e5cd7a0.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f3f26fa39591db45e5cd7a0.md index d783d08020f..3f0a599cbc5 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f3f26fa39591db45e5cd7a0.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f3f26fa39591db45e5cd7a0.md @@ -7,7 +7,7 @@ dashedName: step-64 # --description-- -`hr` 元素的預設屬性會使其顯示為一條細的淺灰色線條。你可以透過為 `height` 屬性指定一個值來更改線條的高度。 +`hr` 元素的預設屬性會讓它呈現為一條細的淺灰色線條。你可以透過指定 `height` 屬性的值來改變這條線的高度。 將 `hr` 元素的高度更改為 `3px`。 @@ -150,7 +150,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f459225127805351a6ad057.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f459225127805351a6ad057.md index 871de4db74a..54085927574 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f459225127805351a6ad057.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f459225127805351a6ad057.md @@ -144,7 +144,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f459a7ceb8b5c446656d88b.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f459a7ceb8b5c446656d88b.md index 6b8af6257b4..099cfc930ca 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f459a7ceb8b5c446656d88b.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f459a7ceb8b5c446656d88b.md @@ -147,6 +147,6 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f459cf202c2a3472fae6a9f.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f459cf202c2a3472fae6a9f.md index 548db1af4ce..e7e36c48b44 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f459cf202c2a3472fae6a9f.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f459cf202c2a3472fae6a9f.md @@ -7,7 +7,7 @@ dashedName: step-67 # --description-- -注意線條的粗細看起來變大了嗎?名為 `border-width` 的屬性的預設值是 `1px`,適用於所有 `hr` 元素的邊緣。透過將邊框改為與背景相同的顏色,線條的總高度為 `5px`(`3px` 加上上下邊框各 `1px`)。 +注意線條的粗細看起來變大了嗎?名為 `border-width` 的屬性的預設值是 `1px`,適用於所有 `hr` 元素的邊框。線條的總高度一直是 `5px`(`3px` 加上上下邊框寬度各 `1px`);為邊框上色讓那些邊框變得可見。 將 `hr` 的 `height` 屬性更改為 `2px`,使其總高度變為 `4px`。 @@ -147,7 +147,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f459fd48bdc98491ca6d1a3.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f459fd48bdc98491ca6d1a3.md index 712f3053a2a..15f18e5085f 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f459fd48bdc98491ca6d1a3.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f459fd48bdc98491ca6d1a3.md @@ -145,7 +145,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f45a05977e2fa49d9119437.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f45a05977e2fa49d9119437.md index f53f7ff9d65..679414f9731 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f45a05977e2fa49d9119437.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f45a05977e2fa49d9119437.md @@ -146,6 +146,6 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f45a276c093334f0f6e9df4.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f45a276c093334f0f6e9df4.md index 6bac6cd4aa9..d8e5ce167bd 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f45a276c093334f0f6e9df4.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f45a276c093334f0f6e9df4.md @@ -185,7 +185,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f45a5a7c49a8251f0bdb527.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f45a5a7c49a8251f0bdb527.md index 7e90e7bbc02..6edc9b2fad9 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f45a5a7c49a8251f0bdb527.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f45a5a7c49a8251f0bdb527.md @@ -157,7 +157,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f45a66d4a2b0453301e5a26.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f45a66d4a2b0453301e5a26.md index 00ceb3a0e74..8db7bcc4d7e 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f45a66d4a2b0453301e5a26.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f45a66d4a2b0453301e5a26.md @@ -166,7 +166,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f45b0731d39e15d54df4dfc.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f45b0731d39e15d54df4dfc.md index 610d1a3ed8a..15a2a03e9e8 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f45b0731d39e15d54df4dfc.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f45b0731d39e15d54df4dfc.md @@ -161,7 +161,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f45b25e7ec2405f166b9de1.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f45b25e7ec2405f166b9de1.md index 575133e64a8..1b966c597cc 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f45b25e7ec2405f166b9de1.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f45b25e7ec2405f166b9de1.md @@ -9,7 +9,7 @@ dashedName: step-78 當連結已被造訪時,你會使用看起來像 `a:visited { propertyName: propertyValue; }` 的 偽選擇器 來更改該連結的屬性。 -當使用者已造訪該聯結時,將頁腳 `Visit our website` 聯結的顏色更改為 `grey`。 +當使用者造訪過該聯結時,將頁腳的 `Visit our website` 聯結顏色改為 `gray`。 # --hints-- @@ -20,14 +20,14 @@ const aVisitedStyle = new __helpers.CSSHelp(document).getStyle('a:visited'); assert.exists(aVisitedStyle); ``` -你應該將 `color` 屬性設為 `grey`。 +你應該將 `color` 屬性設為 `gray`。 ```js const hasColor = new __helpers.CSSHelp(document).getCSSRules().some(x => (x.style.color === 'grey' || x.style.color === 'gray')); assert.isTrue(hasColor); ``` -你的 `a:visited` 應該有 `grey` 的 `color`。 +你的 `a:visited` 應該有 `color` 為 `gray`。 ```js const aVisitedColor = new __helpers.CSSHelp(document).getStyle('a:visited')?.getPropertyValue('color'); @@ -161,7 +161,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f45b3c93c027860d9298dbd.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f45b3c93c027860d9298dbd.md index dc9f5fec0fd..3d84a3af0e8 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f45b3c93c027860d9298dbd.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f45b3c93c027860d9298dbd.md @@ -161,7 +161,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ @@ -179,7 +179,7 @@ a { } a:visited { - color: grey; + color: gray; } --fcc-editable-region-- diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f45b45d099f3e621fbbb256.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f45b45d099f3e621fbbb256.md index 92dc4ce3c3c..a4d3d7a4580 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f45b45d099f3e621fbbb256.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f45b45d099f3e621fbbb256.md @@ -161,7 +161,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ @@ -179,7 +179,7 @@ a { } a:visited { - color: grey; + color: gray; } a:hover { diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f45b4c81cea7763550e40df.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f45b4c81cea7763550e40df.md index eb4ae5b6e0d..e680a861f51 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f45b4c81cea7763550e40df.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f45b4c81cea7763550e40df.md @@ -152,7 +152,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ @@ -171,7 +171,7 @@ a { --fcc-editable-region-- a:visited { - color: grey; + color: gray; } a:hover { diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f45b715301bbf667badc04a.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f45b715301bbf667badc04a.md index e11b6619487..66b178b5be8 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f45b715301bbf667badc04a.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f45b715301bbf667badc04a.md @@ -7,7 +7,7 @@ dashedName: step-82 # --description-- -選單文字 `CAMPER CAFE` 與選單底部的位址空間不同,這是因為瀏覽器對 `h1` 元素有一些預設的上方邊距。 +選單文字 `CAMPER CAFE` 上方的空間與選單底部位址下方的空間不一致。這是因為瀏覽器對 `h1` 元素有預設的上方外距。 將 `h1` 元素的上邊距改為 `0`,以移除所有上邊距。 @@ -157,7 +157,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f46e270702a8456a664f0df.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f46e270702a8456a664f0df.md index 9c91c264cf1..02c9afe5c5f 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f46e270702a8456a664f0df.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f46e270702a8456a664f0df.md @@ -156,7 +156,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f46e36e745ead58487aabf2.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f46e36e745ead58487aabf2.md index f4edb040519..d3105aa6946 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f46e36e745ead58487aabf2.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f46e36e745ead58487aabf2.md @@ -163,7 +163,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f46e7a4750dd05b5a673920.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f46e7a4750dd05b5a673920.md index 766a9dc5875..1e5eb066e43 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f46e7a4750dd05b5a673920.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f46e7a4750dd05b5a673920.md @@ -160,7 +160,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f46e8284aae155c83015dee.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f46e8284aae155c83015dee.md index 028918c5a4d..fe02799240b 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f46e8284aae155c83015dee.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f46e8284aae155c83015dee.md @@ -9,7 +9,7 @@ dashedName: step-86 選單看起來不錯,但除了咖啡豆背景影像外,主要只是文字。 -在 `Coffee` 標題下,使用網址 `https://cdn.freecodecamp.org/curriculum/css-cafe/coffee.jpg` 添加一張影像。為該影像設定 `alt` 值為 `coffee icon`。 +在 `Coffee` 標題下,使用 URL `https://cdn.freecodecamp.org/curriculum/css-cafe/coffee.jpg` 添加一張影像。為該影像設定 `alt` 屬性值為 `coffee icon`。 # --hints-- @@ -105,6 +105,7 @@ assert.match(imageAltValue, /coffee icon/i);

123 Free Code Camp Drive

+ ``` @@ -171,7 +172,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f46ede1ff8fec5ba656b44c.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f46ede1ff8fec5ba656b44c.md index 36272462df5..635f5c98365 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f46ede1ff8fec5ba656b44c.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f46ede1ff8fec5ba656b44c.md @@ -144,7 +144,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } --fcc-editable-region-- diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f46fc57528aa1c4b5ea7c2e.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f46fc57528aa1c4b5ea7c2e.md index 6dcf513ddae..50a9b0071bc 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f46fc57528aa1c4b5ea7c2e.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f46fc57528aa1c4b5ea7c2e.md @@ -161,7 +161,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f4701b942c824109626c3d8.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f4701b942c824109626c3d8.md index 4b7b6ec0d01..a8d43be1d64 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f4701b942c824109626c3d8.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f4701b942c824109626c3d8.md @@ -153,6 +153,6 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f475bb508746c16c9431d42.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f475bb508746c16c9431d42.md index 31c2862b2ce..d2c7f175730 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f475bb508746c16c9431d42.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f475bb508746c16c9431d42.md @@ -7,9 +7,9 @@ dashedName: step-87 # --description-- -你添加的影像沒有像上方的 `Coffee` 標題那樣水平置中。`img` 元素「類似」行內元素。 +你添加的圖片沒有像上方的 `Coffee` 標題那樣水平置中。`img` 元素是行內層級元素,因此它們會置於文字流程中。 -為了讓影像像標題等區塊層級元素一樣行為,請創建一個 `img` 型別選擇器。將 `display` 屬性設為 `block`,並使用 `margin-left` 和 `margin-right` 屬性將其水平置中。 +要讓圖片像標題這類區塊層級元素一樣表現,請建立一個 `img` 型別選擇器。將 `display` 屬性設為 `block`,並使用 `margin-left` 和 `margin-right` 屬性來水平置中它。 # --hints-- @@ -120,6 +120,7 @@ assert.equal(imgMarginRight, 'auto');

123 Free Code Camp Drive

+ ``` @@ -190,7 +191,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f475e1c7f71a61d913836c6.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f475e1c7f71a61d913836c6.md index c38ff4722c5..89d7f0ca9cc 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f475e1c7f71a61d913836c6.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f475e1c7f71a61d913836c6.md @@ -97,6 +97,7 @@ assert.match(lastImage?.alt, /pie icon/i);

123 Free Code Camp Drive

+ ``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f47fe7e31980053a8d4403b.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f47fe7e31980053a8d4403b.md index 748b82771ee..39736e39c9f 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f47fe7e31980053a8d4403b.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f47fe7e31980053a8d4403b.md @@ -7,7 +7,7 @@ dashedName: step-89 # --description-- -如果 `h2` 元素與其相關的圖示之間的垂直間距較小會更好。`h2` 元素有預設的上下邊距,因此你可以將 `h2` 元素的下邊距改為 `0` 或其他數字。 +如果 `h2` 元素和其相關圖示之間的垂直間距能更小會更好。`h2` 元素有預設的上下外距,因此你可以將 `h2` 元素的下外距改為 `0` 或其他值。 有一個更簡單的方法,只要為 `img` 元素添加負的上邊距,就能將它們從目前的位置往上拉。負值是透過在數值前加上 `-` 來產生。要完成這個工作坊,請繼續在 `img` 型別選擇器中使用負的上邊距 `25px`。 diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f716ad029ee4053c7027a7a.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f716ad029ee4053c7027a7a.md index b0e7fb6d09c..1f70675ef3e 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f716ad029ee4053c7027a7a.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f716ad029ee4053c7027a7a.md @@ -119,7 +119,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f716bee5838c354c728a7c5.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f716bee5838c354c728a7c5.md index c7d63f5bb7f..cb7b1310a63 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f716bee5838c354c728a7c5.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f716bee5838c354c728a7c5.md @@ -158,6 +158,6 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f7b87422a560036fd03ccff.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f7b87422a560036fd03ccff.md index 80f30ff1e4c..7159a348c46 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f7b87422a560036fd03ccff.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f7b87422a560036fd03ccff.md @@ -118,7 +118,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f7b88d37b1f98386f04edc0.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f7b88d37b1f98386f04edc0.md index 235749636a3..14589386bc4 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f7b88d37b1f98386f04edc0.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/5f7b88d37b1f98386f04edc0.md @@ -97,6 +97,6 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/6780e8ef4153930b965cd7b7.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/6780e8ef4153930b965cd7b7.md index 7a8303e4231..dbb1b88cc4d 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/6780e8ef4153930b965cd7b7.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/6780e8ef4153930b965cd7b7.md @@ -125,6 +125,6 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/6780f0d898362873ac425dc8.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/6780f0d898362873ac425dc8.md index 352df0c95d6..e00d5fac138 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/6780f0d898362873ac425dc8.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cafe-menu/6780f0d898362873ac425dc8.md @@ -23,7 +23,7 @@ assert.isNotNull(new __helpers.CSSHelp(document).getStyle('address')); assert.isNotEmpty(new __helpers.CSSHelp(document).getStyle('address').getPropVal('font-style')); ``` -`font-style` 屬性應該設定為 `normal`。 +`font-style` 屬性應該設為 `normal`。 ```js assert.equal(new __helpers.CSSHelp(document).getStyle('address').getPropVal('font-style'), 'normal'); @@ -156,7 +156,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-calculator/66cc095dfe1682753d2ab030.md b/curriculum/challenges/chinese-traditional/blocks/workshop-calculator/66cc095dfe1682753d2ab030.md index 9043fa1b85a..e9432c33820 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-calculator/66cc095dfe1682753d2ab030.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-calculator/66cc095dfe1682753d2ab030.md @@ -7,7 +7,7 @@ dashedName: step-2 # --description-- -你在先前課程中學到的概念之一是如何從函式傳回返回值。 +你在之前的課程中學到的概念之一是如何從函式(程式)傳回返回值。 這裡提醒你如何從函式傳回一個值: @@ -30,7 +30,10 @@ assert.strictEqual(addTwoAndSeven(), 9); 你的 `addTwoAndSeven` 函式(程式)應該使用 `+` 運算子傳回總和。 ```js -assert.match(code, /return\s*(2\s*\+\s*7|7\s*\+\s*2)\s*;?/); +const explorer = await __helpers.Explorer(code); +const { addTwoAndSeven } = explorer.allFunctions; +const validExpressions = ["2 + 7", "7 + 2", "(2 + 7)", "(7 + 2)"]; +assert.isTrue(validExpressions.some(expr => addTwoAndSeven?.hasReturn(expr))); ``` # --seed-- diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-calculator/66cc0a9e06e00b75d6782be9.md b/curriculum/challenges/chinese-traditional/blocks/workshop-calculator/66cc0a9e06e00b75d6782be9.md index 8dde8ff0cfa..ab80b027a37 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-calculator/66cc0a9e06e00b75d6782be9.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-calculator/66cc0a9e06e00b75d6782be9.md @@ -1,6 +1,6 @@ --- id: 66cc0a9e06e00b75d6782be9 -title: 步驟 3 +title: 第 3 步 challengeType: 1 dashedName: step-3 --- @@ -26,16 +26,12 @@ myFunction(); # --hints-- -你的程式碼中應該有一個 `console.log`。 - -```js -assert.match(code, /console\.log(.*)/); -``` - 你應該在 `console.log` 裡呼叫 `addTwoAndSeven` 函式(程式)。 ```js -assert.match(code, /console\.log\(\s*addTwoAndSeven\(\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(addTwoAndSeven())"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-calculator/66cc0ba5881acb7692cfc4de.md b/curriculum/challenges/chinese-traditional/blocks/workshop-calculator/66cc0ba5881acb7692cfc4de.md index dd09a75d735..340cc9091bd 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-calculator/66cc0ba5881acb7692cfc4de.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-calculator/66cc0ba5881acb7692cfc4de.md @@ -1,13 +1,13 @@ --- id: 66cc0ba5881acb7692cfc4de -title: 步驟 4 +title: 第 4 步 challengeType: 1 dashedName: step-4 --- # --description-- -現在,是時候為你的程式碼添加另一個函式(程式)。 +現在是時候添加另一個函式(程式)了。 宣告一個名為 `addThreeAndFour` 的函式(程式),傳回 `3` 和 `4` 的總和。 @@ -24,22 +24,24 @@ assert.isFunction(addThreeAndFour); 你的 `addThreeAndFour` 函式(程式)應該傳回 `3` 和 `4` 的總和。 ```js -assert.equal(addThreeAndFour(), 7); +assert.strictEqual(addThreeAndFour(), 7); ``` 你的 `addThreeAndFour` 函式應該使用 `+` 運算子傳回總和。 ```js -const declarationStyle = /return\s*\(?\s*(3\s*\+\s*4|4\s*\+\s*3)\s*\)?\s*;?/; -const arrowStyle = /=>\s*\(?\s*(3\s*\+\s*4|4\s*\+\s*3)\s*\)?\s*;?/; -const combinedRegex = new RegExp(`(?:${declarationStyle.source})|(?:${arrowStyle.source})`); -assert.match(code, combinedRegex); +const explorer = await __helpers.Explorer(code); +const { addThreeAndFour } = explorer.allFunctions; +const validExpressions = ["3 + 4", "4 + 3", "(3 + 4)", "(4 + 3)"]; +assert.isTrue(validExpressions.some(expr => addThreeAndFour?.hasReturn(expr))); ``` 你應該在 `console.log` 內呼叫 `addThreeAndFour` 函式(程式)。 ```js -assert.match(code, /console\.log\(\s*addThreeAndFour\(\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(addThreeAndFour())"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-calculator/66cc0de2920bec775f610424.md b/curriculum/challenges/chinese-traditional/blocks/workshop-calculator/66cc0de2920bec775f610424.md index 0f588bfcb42..275c55a73cc 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-calculator/66cc0de2920bec775f610424.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-calculator/66cc0de2920bec775f610424.md @@ -1,13 +1,13 @@ --- id: 66cc0de2920bec775f610424 -title: 步驟 5 +title: 第 5 步 challengeType: 1 dashedName: step-5 --- # --description-- -即使這些函式(程式)如預期運作,你的程式碼中仍有大量重複。 +即使這些函式(程式)如預期運作,你的程式碼中仍有大量重複。 由於你正在建置一個計算機,你不想為你想要相加的每一種可能的數字組合都創建一個函式(程式)。 @@ -22,25 +22,33 @@ dashedName: step-5 你不應該有一個名為 `addTwoAndSeven` 的函式。 ```js -assert.notMatch(code, /function\s+addTwoAndSeven\s*\(\s*\)\s*{/); +const explorer = await __helpers.Explorer(code); +const { addTwoAndSeven } = explorer.allFunctions; +assert.notExists(addTwoAndSeven); ``` 你不應該有對 `addTwoAndSeven` 的函式(程式)呼叫。 ```js -assert.notMatch(code, /console\.log\(\s*addTwoAndSeven\(\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const unexpectedStatement = "console.log(addTwoAndSeven())"; +assert.notInclude(strippedCode, unexpectedStatement); ``` 你不應該有一個名為 `addThreeAndFour` 的函式(程式)。 ```js -assert.notMatch(code, /function\s+addThreeAndFour\s*\(\s*\)\s*{/); +const explorer = await __helpers.Explorer(code); +const { addThreeAndFour } = explorer.allFunctions; +assert.notExists(addThreeAndFour); ``` 你不應該有對 `addThreeAndFour` 的函式(程式)呼叫。 ```js -assert.notMatch(code, /console\.log\(\s*addThreeAndFour\(\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const unexpectedStatement = "console.log(addThreeAndFour())"; +assert.notInclude(strippedCode, unexpectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-calculator/66cc0f1ae40802781b2ea972.md b/curriculum/challenges/chinese-traditional/blocks/workshop-calculator/66cc0f1ae40802781b2ea972.md index 369efa49d03..24a7d9fdce5 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-calculator/66cc0f1ae40802781b2ea972.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-calculator/66cc0f1ae40802781b2ea972.md @@ -1,6 +1,6 @@ --- id: 66cc0f1ae40802781b2ea972 -title: 步驟 6 +title: 第 6 步 challengeType: 1 dashedName: step-6 --- @@ -33,8 +33,11 @@ assert.isFunction(calculateSum); 你的 `calculateSum` 函式(程式)應該接受兩個參數,`num1` 和 `num2`。 ```js -const regex = __helpers.functionRegex('calculateSum', ['num1', 'num2']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { calculateSum } = explorer.allFunctions; +assert.lengthOf(calculateSum?.parameters, 2); +assert.equal(calculateSum?.parameters[0].toString(), "num1"); +assert.equal(calculateSum?.parameters[1].toString(), "num2"); ``` # --seed-- diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-calculator/66cc12fa504b0479dac479a0.md b/curriculum/challenges/chinese-traditional/blocks/workshop-calculator/66cc12fa504b0479dac479a0.md index 39610d4cf54..c87ddbd32a3 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-calculator/66cc12fa504b0479dac479a0.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-calculator/66cc12fa504b0479dac479a0.md @@ -29,7 +29,9 @@ greetUser("Jane"); // "Hello Jane!" 你應該有一個 `console.log`,它呼叫 `calculateSum` 函式(程式),並帶入引數 `2` 和 `5`。 ```js -assert.match(code, /console\.log\(calculateSum\(\s*2\s*,\s*5\)\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const validStatements = ["console.log(calculateSum(2,5))", "console.log(calculateSum(5,2))"]; +assert.isTrue(validStatements.some(stmt => strippedCode.includes(stmt))); ``` # --seed-- diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-calculator/66cc14ca14e65e7a9ebecb80.md b/curriculum/challenges/chinese-traditional/blocks/workshop-calculator/66cc14ca14e65e7a9ebecb80.md index 147813d0281..f8604957076 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-calculator/66cc14ca14e65e7a9ebecb80.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-calculator/66cc14ca14e65e7a9ebecb80.md @@ -15,7 +15,7 @@ dashedName: step-10 # --hints-- -你應該有一個名為 `calculateDifference` 的函式(程式)。 +你應該宣告一個名為 `calculateDifference` 的函式。 ```js assert.isFunction(calculateDifference); @@ -24,8 +24,11 @@ assert.isFunction(calculateDifference); 你的 `calculateDifference` 函式應該有兩個名為 `num1` 和 `num2` 的參數。 ```js -const regex = __helpers.functionRegex('calculateDifference', ['num1', 'num2']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { calculateDifference } = explorer.allFunctions; +assert.lengthOf(calculateDifference?.parameters, 2); +assert.equal(calculateDifference?.parameters[0].toString(), "num1"); +assert.equal(calculateDifference?.parameters[1].toString(), "num2"); ``` 你的 `calculateDifference` 函式(程式)應該傳回兩個參數之間的差異。 diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-calculator/66cc16abc30b367ba1d1f9ef.md b/curriculum/challenges/chinese-traditional/blocks/workshop-calculator/66cc16abc30b367ba1d1f9ef.md index 98247097548..4bd0a5b4c82 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-calculator/66cc16abc30b367ba1d1f9ef.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-calculator/66cc16abc30b367ba1d1f9ef.md @@ -20,19 +20,25 @@ dashedName: step-11 你應該有一個 `console.log`,它呼叫 `calculateDifference` 函式(程式),並帶入引數 `22` 和 `5`。 ```js -assert.match(code, /console\.log\s*\(\s*calculateDifference\s*\(\s*22\s*,\s*5\s*\)\s*\)\s*;?/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateDifference(22,5))"; +assert.include(strippedCode, expectedStatement); ``` 你應該有一個 `console.log`,它呼叫 `calculateDifference` 函式(程式),並帶入引數 `12` 和 `1`。 ```js -assert.match(code, /console\.log\s*\(\s*calculateDifference\s*\(\s*12\s*,\s*1\s*\)\s*\)\s*;?/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateDifference(12,1))"; +assert.include(strippedCode, expectedStatement); ``` 你應該有一個 `console.log`,它呼叫 `calculateDifference` 函式(程式),並帶入引數 `17` 和 `9`。 ```js -assert.match(code, /console\.log\s*\(\s*calculateDifference\s*\(\s*17\s*,\s*9\s*\)\s*\)\s*;?/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateDifference(17,9))"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-calculator/66cc172af7159a7c67804544.md b/curriculum/challenges/chinese-traditional/blocks/workshop-calculator/66cc172af7159a7c67804544.md index 7bac62b952a..f4604d3cf7b 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-calculator/66cc172af7159a7c67804544.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-calculator/66cc172af7159a7c67804544.md @@ -1,6 +1,6 @@ --- id: 66cc172af7159a7c67804544 -title: 步驟 12 +title: 第 12 步驟 challengeType: 1 dashedName: step-12 --- @@ -17,7 +17,7 @@ dashedName: step-12 # --hints-- -你應該有一個名為 `calculateProduct` 的函式(程式)。 +你應該宣告一個名為 `calculateProduct` 的函式。 ```js assert.isFunction(calculateProduct); @@ -26,8 +26,11 @@ assert.isFunction(calculateProduct); 你的 `calculateProduct` 函式應該有兩個名為 `num1` 和 `num2` 的參數。 ```js -const regex = __helpers.functionRegex('calculateProduct', ['num1', 'num2']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { calculateProduct } = explorer.allFunctions; +assert.lengthOf(calculateProduct?.parameters, 2); +assert.equal(calculateProduct?.parameters[0].toString(), "num1"); +assert.equal(calculateProduct?.parameters[1].toString(), "num2"); ``` 你的 `calculateProduct` 函式(程式)應該傳回這兩個參數的乘積。 @@ -40,7 +43,9 @@ assert.equal(calculateProduct(10, 5), 50); 你應該有一個 `console.log`,它呼叫 `calculateProduct` 函式(程式),並帶入引數 `13` 和 `5`。 ```js -assert.match(code, /console\.log\s*\(\s*calculateProduct\s*\(\s*13\s*,\s*5\s*\)\s*\)\s*;?/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const validStatements = ["console.log(calculateProduct(13,5))", "console.log(calculateProduct(5,13))"]; +assert.isTrue(validStatements.some(stmt => strippedCode.includes(stmt))); ``` # --seed-- diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-calculator/66cc1a3a39aef47d6473cb2f.md b/curriculum/challenges/chinese-traditional/blocks/workshop-calculator/66cc1a3a39aef47d6473cb2f.md index de89c6d783d..e3a0bd6d53b 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-calculator/66cc1a3a39aef47d6473cb2f.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-calculator/66cc1a3a39aef47d6473cb2f.md @@ -1,6 +1,6 @@ --- id: 66cc1a3a39aef47d6473cb2f -title: 步驟 13 +title: 第 13 步驟 challengeType: 1 dashedName: step-13 --- @@ -17,7 +17,7 @@ dashedName: step-13 # --hints-- -你應該有一個名為 `calculateQuotient` 的函式(程式)。 +你應該宣告一個名為 `calculateQuotient` 的函式。 ```js assert.isFunction(calculateQuotient); @@ -26,8 +26,11 @@ assert.isFunction(calculateQuotient); 你的 `calculateQuotient` 函式(程式)應該有兩個名為 `num1` 和 `num2` 的參數。 ```js -const regex = __helpers.functionRegex('calculateQuotient', ['num1', 'num2']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { calculateQuotient } = explorer.allFunctions; +assert.lengthOf(calculateQuotient?.parameters, 2); +assert.equal(calculateQuotient?.parameters[0].toString(), "num1"); +assert.equal(calculateQuotient?.parameters[1].toString(), "num2"); ``` 你的 `calculateQuotient` 函式(程式)應該傳回這兩個參數的商。 @@ -40,7 +43,9 @@ assert.equal(calculateQuotient(100, 10), 10); 你應該有一個 `console.log`,它呼叫 `calculateQuotient` 函式(程式),並帶入引數 `7` 和 `11`。 ```js -assert.match(code, /console\.log\s*\(\s*calculateQuotient\s*\(\s*7\s*,\s*11\s*\)\s*\)\s*;?/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateQuotient(7,11))"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-calculator/66cc1ccfefdd727e18c2ab20.md b/curriculum/challenges/chinese-traditional/blocks/workshop-calculator/66cc1ccfefdd727e18c2ab20.md index 1021559ee84..6c996e80ca8 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-calculator/66cc1ccfefdd727e18c2ab20.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-calculator/66cc1ccfefdd727e18c2ab20.md @@ -7,7 +7,7 @@ dashedName: step-14 # --description-- -你的 `calculateQuotient` 似乎運作正常,但有一種情況你還沒有測試過。 +你的 `calculateQuotient` 看起來運作正常,但有一種情況你還沒測試過。 為你的程式碼添加一個 `console.log`,該 console.log 呼叫 `calculateQuotient` 函式(程式),並帶入引數 `3` 和 `0`。 @@ -18,7 +18,9 @@ dashedName: step-14 你應該有一個 `console.log`,它以引數 `3` 和 `0` 呼叫 `calculateQuotient` 函式(程式)。 ```js -assert.match(code, /console\.log\s*\(\s*calculateQuotient\s*\(\s*3\s*,\s*0\s*\)\s*\)\s*;?/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateQuotient(3,0))"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-calculator/66cc1deb1f04647f2aabee2b.md b/curriculum/challenges/chinese-traditional/blocks/workshop-calculator/66cc1deb1f04647f2aabee2b.md index 4a1a30fc1fb..03ce0e23a2d 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-calculator/66cc1deb1f04647f2aabee2b.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-calculator/66cc1deb1f04647f2aabee2b.md @@ -11,17 +11,17 @@ dashedName: step-15 除以零在數學中不是有效的操作。 -為了處理這個邊緣案例,你應該更新你的 `calculateQuotient` 函式(程式),改為檢查 `num2` 是否為零。 +為了處理這個邊緣案例,你應該更新你的 `calculateQuotient` 函式(程式),改為檢查 `num2` 是否為零。 如果是,該函式(程式)應該傳回字串 `"Error: Division by zero"`。否則,應該傳回將 `num1` 除以 `num2` 的結果。 # --hints-- -如果 `num2` 是零,你的 `calculateQuotient` 函式(程式)應該傳回字串 `"Error: Division by zero"`。 +如果 `num2` 是零,你的 `calculateQuotient` 函式(程式)應該傳回字串 `"Error: Division by zero"`。 ```js -assert.strictEqual(calculateQuotient(10, 0), 'Error: Division by zero'); -assert.strictEqual(calculateQuotient(3, 0), 'Error: Division by zero'); +assert.strictEqual(calculateQuotient(10, 0), "Error: Division by zero"); +assert.strictEqual(calculateQuotient(3, 0), "Error: Division by zero"); ``` 如果 `num2` 不為零,你的 `calculateQuotient` 函式(程式)應該傳回將 `num1` 除以 `num2` 的結果。 diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-calculator/66cc21d23238dc8240a8a182.md b/curriculum/challenges/chinese-traditional/blocks/workshop-calculator/66cc21d23238dc8240a8a182.md index 07eb9d66c10..1d119d5db97 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-calculator/66cc21d23238dc8240a8a182.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-calculator/66cc21d23238dc8240a8a182.md @@ -28,7 +28,7 @@ Math.pow(5, 2); // 25 # --hints-- -你應該有一個名為 `calculateSquare` 的函式(程式)。 +你應該宣告一個名為 `calculateSquare` 的函式。 ```js assert.isFunction(calculateSquare); @@ -37,8 +37,10 @@ assert.isFunction(calculateSquare); 你的 `calculateSquare` 函式(程式)應該接受一個 `num` 參數。 ```js -const regex = __helpers.functionRegex('calculateSquare', ['num']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { calculateSquare } = explorer.allFunctions; +assert.lengthOf(calculateSquare?.parameters, 1); +assert.equal(calculateSquare?.parameters[0].toString(), "num"); ``` 你的 `calculateSquare` 函式(程式)應該傳回 `num` 的平方。 diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-calculator/66cc26907ff6908402af0149.md b/curriculum/challenges/chinese-traditional/blocks/workshop-calculator/66cc26907ff6908402af0149.md index bbc88b069d8..b9afdb65702 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-calculator/66cc26907ff6908402af0149.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-calculator/66cc26907ff6908402af0149.md @@ -18,13 +18,17 @@ dashedName: step-17 你應該有一個 `console.log`,它以引數 `2` 呼叫 `calculateSquare` 函式(程式)。 ```js -assert.match(code, /console\.log\s*\(\s*calculateSquare\s*\(\s*2\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateSquare(2))"; +assert.include(strippedCode, expectedStatement); ``` 你應該有一個 `console.log`,它以引數 `9` 呼叫 `calculateSquare` 函式(程式)。 ```js -assert.match(code, /console\.log\s*\(\s*calculateSquare\s*\(\s*9\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateSquare(9))"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-calculator/66cc2739f687e484d50bb6f1.md b/curriculum/challenges/chinese-traditional/blocks/workshop-calculator/66cc2739f687e484d50bb6f1.md index fc623e64f14..39e285902d7 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-calculator/66cc2739f687e484d50bb6f1.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-calculator/66cc2739f687e484d50bb6f1.md @@ -26,7 +26,7 @@ Math.sqrt(9); # --hints-- -你應該有一個名為 `calculateSquareRoot` 的函式(程式)。 +你應該宣告一個名為 `calculateSquareRoot` 的函式。 ```js assert.isFunction(calculateSquareRoot); @@ -35,8 +35,10 @@ assert.isFunction(calculateSquareRoot); 你的 `calculateSquareRoot` 函式(程式)應該接受一個 `num` 參數。 ```js -const regex = __helpers.functionRegex('calculateSquareRoot', ['num']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { calculateSquareRoot } = explorer.allFunctions; +assert.lengthOf(calculateSquareRoot?.parameters, 1); +assert.equal(calculateSquareRoot?.parameters[0].toString(), "num"); ``` 你的 `calculateSquareRoot` 函式(程式)應該傳回 `num` 的平方根。 diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-calculator/66cc281d687975858049fd8d.md b/curriculum/challenges/chinese-traditional/blocks/workshop-calculator/66cc281d687975858049fd8d.md index 7fe1ce914b1..a7604196e2a 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-calculator/66cc281d687975858049fd8d.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-calculator/66cc281d687975858049fd8d.md @@ -20,13 +20,17 @@ dashedName: step-19 你應該有一個 `console.log`,它呼叫 `calculateSquareRoot` 函式(程式),並帶入引數 `25`。 ```js -assert.match(code, /console\.log\s*\(\s*calculateSquareRoot\s*\(\s*25\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateSquareRoot(25))"; +assert.include(strippedCode, expectedStatement); ``` 你應該有一個 `console.log`,它呼叫 `calculateSquareRoot` 函式並帶入引數 `100`。 ```js -assert.match(code, /console\.log\s*\(\s*calculateSquareRoot\s*\(\s*100\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateSquareRoot(100))"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-calculator/66cdf76685e4cb5a8726e27b.md b/curriculum/challenges/chinese-traditional/blocks/workshop-calculator/66cdf76685e4cb5a8726e27b.md index 4c94097049c..f422fbb137e 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-calculator/66cdf76685e4cb5a8726e27b.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-calculator/66cdf76685e4cb5a8726e27b.md @@ -18,13 +18,17 @@ dashedName: step-9 你應該有一個 `console.log`,它呼叫 `calculateSum` 函式(程式),並帶入引數 `10` 和 `10`。 ```js -assert.match(code, /console\.log\(calculateSum\(10\s*,\s*10\)\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateSum(10,10))"; +assert.include(strippedCode, expectedStatement); ``` 你應該有一個 `console.log`,它呼叫 `calculateSum` 函式(程式),並帶入引數 `5` 和 `5`。 ```js -assert.match(code, /console\.log\(calculateSum\(5\s*,\s*5\)\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateSum(5,5))"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646c48df8674cf2b91020ecc.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646c48df8674cf2b91020ecc.md index 962d11bb677..67ae8b6dd7f 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646c48df8674cf2b91020ecc.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646c48df8674cf2b91020ecc.md @@ -1,6 +1,6 @@ --- id: 646c48df8674cf2b91020ecc -title: 步驟 1 +title: 第 1 步 challengeType: 0 dashedName: step-1 demoType: onLoad @@ -35,12 +35,13 @@ assert.oneOf(href, ["./styles.css", "styles.css"]); ```html ---fcc-editable-region-- - - fCC Cat Painting - + + fCC Cat Painting --fcc-editable-region-- + +--fcc-editable-region-- + ``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646c586be7180e40ddf74ff6.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646c586be7180e40ddf74ff6.md index 1b585b856e0..f701fdecab7 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646c586be7180e40ddf74ff6.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646c586be7180e40ddf74ff6.md @@ -1,6 +1,6 @@ --- id: 646c586be7180e40ddf74ff6 -title: 步驟 3 +title: 第 3 步 challengeType: 0 dashedName: step-3 --- @@ -31,9 +31,9 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('body')?.backgroundColor, - - fCC Cat Painting - + + fCC Cat Painting + diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646c59e942f35541923104bf.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646c59e942f35541923104bf.md index 39b06eabdc0..f111a938eba 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646c59e942f35541923104bf.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646c59e942f35541923104bf.md @@ -1,6 +1,6 @@ --- id: 646c59e942f35541923104bf -title: 步驟 4 +title: 第 4 步 challengeType: 0 dashedName: step-4 --- @@ -43,13 +43,13 @@ assert.lengthOf(document.querySelectorAll('main div'), 1); - - fCC Cat Painting - + + fCC Cat Painting + --fcc-editable-region-- - + --fcc-editable-region-- diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646c5ace05e4be4211407935.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646c5ace05e4be4211407935.md index 12845a4dc07..444cf1657e8 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646c5ace05e4be4211407935.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646c5ace05e4be4211407935.md @@ -1,6 +1,6 @@ --- id: 646c5ace05e4be4211407935 -title: 步驟 6 +title: 第 6 步 challengeType: 0 dashedName: step-6 --- @@ -50,14 +50,14 @@ assert.equal(secondGradient,'(69,69,79)100%)'); - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
+
+
+
``` @@ -71,13 +71,13 @@ body { background-color: #c9d2fc; } ---fcc-editable-region-- .cat-head { +--fcc-editable-region-- + +--fcc-editable-region-- width: 205px; height: 180px; border: 1px solid #000; border-radius: 46%; - } ---fcc-editable-region-- ``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646c5d7057c45f432fcdd46c.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646c5d7057c45f432fcdd46c.md index 04b1e675efd..67173c46554 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646c5d7057c45f432fcdd46c.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646c5d7057c45f432fcdd46c.md @@ -1,13 +1,13 @@ --- id: 646c5d7057c45f432fcdd46c -title: 步驟 5 +title: 第 5 步 challengeType: 0 dashedName: step-5 --- # --description-- -使用類別選擇器,為 `.cat-head` 元素設定寬度為 `205px`、高度為 `180px`。同時,為它添加 `1px solid #000` 的邊框和 `46%` 的 `border-radius`。 +使用類別選擇器,為 `.cat-head` 元素設定寬度為 `205px`、高度為 `180px`。同時,為它添加 `1px solid #000` 的邊框和 `46%` 的 `border-radius`。 # --hints-- @@ -50,13 +50,13 @@ assert.equal(new __helpers.CSSHelp(document)?.getStyle(".cat-head")?.borderRadiu - - fCC Cat Painting - + + fCC Cat Painting +
-
+
diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646c5e727e56e743c9aed4a1.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646c5e727e56e743c9aed4a1.md index cdfaf957eab..1d0ca33372b 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646c5e727e56e743c9aed4a1.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646c5e727e56e743c9aed4a1.md @@ -44,14 +44,14 @@ assert.equal(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.left, '100p - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
+
+
+
``` @@ -65,16 +65,14 @@ body { background-color: #c9d2fc; } ---fcc-editable-region-- .cat-head { - - +--fcc-editable-region-- +--fcc-editable-region-- background: linear-gradient(#5e5e5e 85%, #45454f 100%); width: 205px; height: 180px; border: 1px solid #000; border-radius: 46%; } ---fcc-editable-region-- ``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646c5ffef5598d449b52ec12.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646c5ffef5598d449b52ec12.md index 8f5c1bca7b5..da632de8484 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646c5ffef5598d449b52ec12.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646c5ffef5598d449b52ec12.md @@ -39,18 +39,18 @@ assert.equal(document.querySelectorAll('.cat-head div')[0]?.getAttribute('class' - - fCC Cat Painting - + + fCC Cat Painting + -
+
+
--fcc-editable-region-- -
- -
+ --fcc-editable-region-- -
+ +
``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646ce8bb4b35544d501c7184.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646ce8bb4b35544d501c7184.md index 6225998bbb7..eeec06667c7 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646ce8bb4b35544d501c7184.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646ce8bb4b35544d501c7184.md @@ -1,6 +1,6 @@ --- id: 646ce8bb4b35544d501c7184 -title: 步驟 18 +title: 第 18 步 challengeType: 0 dashedName: step-18 --- @@ -43,20 +43,20 @@ assert.isTrue(document.querySelectorAll('.cat-ears div')[1]?.classList.contains( - - fCC Cat Painting - + + fCC Cat Painting + -
-
+
+
+
--fcc-editable-region-- -
- -
+ --fcc-editable-region--
-
+
+
``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646ce9d790d2a44de5f99e04.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646ce9d790d2a44de5f99e04.md index 22aa4046ddb..fc9501ee277 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646ce9d790d2a44de5f99e04.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646ce9d790d2a44de5f99e04.md @@ -1,6 +1,6 @@ --- id: 646ce9d790d2a44de5f99e04 -title: 第 19 步 +title: 第 19 步驟 challengeType: 0 dashedName: step-19 --- @@ -55,25 +55,25 @@ assert.isTrue(document.querySelectorAll('.cat-right-ear div')[0]?.classList.cont - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
- --fcc-editable-region-- -
- -
-
- -
- --fcc-editable-region-- +
+
+
+
+--fcc-editable-region-- + +
+
+ +--fcc-editable-region--
-
+
+
``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646ceb843412c74edee27a79.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646ceb843412c74edee27a79.md index 25692535421..c6e221d5a38 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646ceb843412c74edee27a79.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646ceb843412c74edee27a79.md @@ -67,23 +67,23 @@ assert.strictEqual(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.b - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646cecc9eb5c4f4f73dafd07.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646cecc9eb5c4f4f73dafd07.md index 8f3600758b4..e9a39923e0f 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646cecc9eb5c4f4f73dafd07.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646cecc9eb5c4f4f73dafd07.md @@ -37,23 +37,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-ear')?.left, '- - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` @@ -81,12 +81,12 @@ body { border-radius: 46%; } ---fcc-editable-region-- .cat-left-ear { +--fcc-editable-region-- +--fcc-editable-region-- border-left: 35px solid transparent; border-right: 35px solid transparent; border-bottom: 70px solid #5e5e5e; } ---fcc-editable-region-- ``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646cef0c2b98915094df7099.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646cef0c2b98915094df7099.md index 06a1ac78cf9..2c3530d69a0 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646cef0c2b98915094df7099.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646cef0c2b98915094df7099.md @@ -31,23 +31,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-ear')?.borderTo - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646cf1206cac5f51804f49cf.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646cf1206cac5f51804f49cf.md index 33d01896560..4a78fddc002 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646cf1206cac5f51804f49cf.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646cf1206cac5f51804f49cf.md @@ -29,23 +29,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-ear')?.transfor - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646cf2249f02ca5233d9af7c.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646cf2249f02ca5233d9af7c.md index 7430844618b..4e33d4c2dd9 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646cf2249f02ca5233d9af7c.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646cf2249f02ca5233d9af7c.md @@ -45,23 +45,23 @@ assert.strictEqual(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.b - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646cf48d8f8e1f535a1821d3.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646cf48d8f8e1f535a1821d3.md index 57ffcc935e9..a4144010d71 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646cf48d8f8e1f535a1821d3.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646cf48d8f8e1f535a1821d3.md @@ -37,23 +37,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.left, ' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646cf6cbca98e258da65c979.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646cf6cbca98e258da65c979.md index ceb06a97ba1..51ccad974b9 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646cf6cbca98e258da65c979.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646cf6cbca98e258da65c979.md @@ -25,23 +25,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.transfo - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646cf88aa884405a11ea5bcc.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646cf88aa884405a11ea5bcc.md index 199379243d6..4a8459cb0b6 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646cf88aa884405a11ea5bcc.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646cf88aa884405a11ea5bcc.md @@ -31,23 +31,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.borderT - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646cfc2b8e6fe95c20a819d5.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646cfc2b8e6fe95c20a819d5.md index baf38a52dfe..7c6daef0699 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646cfc2b8e6fe95c20a819d5.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646cfc2b8e6fe95c20a819d5.md @@ -29,23 +29,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-ear')?.zIndex, - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646cfd853634255d02b64cc1.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646cfd853634255d02b64cc1.md index a34bda488c7..a8b64436887 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646cfd853634255d02b64cc1.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646cfd853634255d02b64cc1.md @@ -27,23 +27,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-ear')?.zIndex, - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646cfde6ac612e5d60391f50.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646cfde6ac612e5d60391f50.md index 9f4378fbc78..5e12fc13943 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646cfde6ac612e5d60391f50.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646cfde6ac612e5d60391f50.md @@ -25,23 +25,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.zIndex, - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646dd556d524bc61c0139bd6.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646dd556d524bc61c0139bd6.md index d164cfbc6a8..ede76cb85e6 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646dd556d524bc61c0139bd6.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646dd556d524bc61c0139bd6.md @@ -45,23 +45,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-inner-ear')?.bo - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646dd6f9caa862627dd87772.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646dd6f9caa862627dd87772.md index 7a2e1526f55..df29fdd77cd 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646dd6f9caa862627dd87772.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646dd6f9caa862627dd87772.md @@ -37,23 +37,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-inner-ear')?.le - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646dd7cfd0cfac630c1dd520.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646dd7cfd0cfac630c1dd520.md index b6a8ea0823f..0d1426bea8b 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646dd7cfd0cfac630c1dd520.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646dd7cfd0cfac630c1dd520.md @@ -43,23 +43,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-inner-ear')?.bo - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646dd8c79ec23463a3d0e356.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646dd8c79ec23463a3d0e356.md index 7bf6ed37410..d56a1252959 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646dd8c79ec23463a3d0e356.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646dd8c79ec23463a3d0e356.md @@ -43,23 +43,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-inner-ear')?.b - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646dd9d9a729916460724f16.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646dd9d9a729916460724f16.md index 0e50660e645..ef403734758 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646dd9d9a729916460724f16.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646dd9d9a729916460724f16.md @@ -37,23 +37,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-inner-ear')?.l - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646ddab8afd73764f5241bbf.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646ddab8afd73764f5241bbf.md index ebe8cddc459..a5ecc247358 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646ddab8afd73764f5241bbf.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646ddab8afd73764f5241bbf.md @@ -43,23 +43,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-inner-ear')?.b - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646ddb61ff08366570cc5902.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646ddb61ff08366570cc5902.md index a09cc009c89..9d7f50db57a 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646ddb61ff08366570cc5902.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646ddb61ff08366570cc5902.md @@ -45,27 +45,27 @@ assert.isTrue(document.querySelectorAll('.cat-eyes div')[1].classList.contains(' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- - --fcc-editable-region-- - - --fcc-editable-region--
-
+ + --fcc-editable-region-- + + --fcc-editable-region-- +
+
``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646ddd3f9f97a0667b964bdb.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646ddd3f9f97a0667b964bdb.md index 9091fbe979d..abbe04b0fcb 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646ddd3f9f97a0667b964bdb.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646ddd3f9f97a0667b964bdb.md @@ -55,34 +55,34 @@ assert.isTrue(document.querySelectorAll('.cat-right-eye div')[0]?.classList.cont - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
- --fcc-editable-region-- -
- -
-
- -
- --fcc-editable-region-- -
-
+ +
+
+--fcc-editable-region-- + +
+
+ +--fcc-editable-region-- +
+
+
+
``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646dde7dc20dc167489faa69.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646dde7dc20dc167489faa69.md index 9105907ca21..3ecf738bf77 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646dde7dc20dc167489faa69.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646dde7dc20dc167489faa69.md @@ -43,32 +43,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-eye')?.backgrou - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646ddf888632fa67f1180940.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646ddf888632fa67f1180940.md index ee4180733f5..c3e2f1453a9 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646ddf888632fa67f1180940.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646ddf888632fa67f1180940.md @@ -37,32 +37,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-eye')?.left, '3 - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646de5dc8988076a1d992afd.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646de5dc8988076a1d992afd.md index f844d1e2590..7edfeed34d1 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646de5dc8988076a1d992afd.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646de5dc8988076a1d992afd.md @@ -31,32 +31,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-eye')?.transfor - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646de6a97b50a86ac487de86.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646de6a97b50a86ac487de86.md index ff0792e7da8..41c0a90cdc6 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646de6a97b50a86ac487de86.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646de6a97b50a86ac487de86.md @@ -45,32 +45,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-eye')?.backgro - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646de7b64467e96b7d35b5cd.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646de7b64467e96b7d35b5cd.md index 11e049208db..ca129ba16db 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646de7b64467e96b7d35b5cd.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646de7b64467e96b7d35b5cd.md @@ -37,32 +37,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-eye')?.left, ' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646de8478d6f796bfbdccfb2.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646de8478d6f796bfbdccfb2.md index 6155e47e819..4474077bab8 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646de8478d6f796bfbdccfb2.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646de8478d6f796bfbdccfb2.md @@ -31,32 +31,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-eye')?.transfo - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646de8d204a3426c7d184372.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646de8d204a3426c7d184372.md index 05366d4c1fb..82f07372059 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646de8d204a3426c7d184372.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646de8d204a3426c7d184372.md @@ -45,32 +45,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-inner-eye')?.ba - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646dea1c98c2426d43a705c3.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646dea1c98c2426d43a705c3.md index e1f15b38c00..1f90569effa 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646dea1c98c2426d43a705c3.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646dea1c98c2426d43a705c3.md @@ -49,32 +49,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-inner-eye')?.tr - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646deb169847f86df0f95bfc.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646deb169847f86df0f95bfc.md index b7a076f2b76..f6b2506699e 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646deb169847f86df0f95bfc.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646deb169847f86df0f95bfc.md @@ -43,32 +43,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-inner-eye')?.b - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646dec359bef3b7811fba5a6.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646dec359bef3b7811fba5a6.md index e85711a8a46..f5fd5e9cc90 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646dec359bef3b7811fba5a6.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646dec359bef3b7811fba5a6.md @@ -49,32 +49,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-inner-eye')?.t - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646dedbcba062079128b2ecc.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646dedbcba062079128b2ecc.md index 8647c0c13b8..cb84c116ee3 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646dedbcba062079128b2ecc.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646dedbcba062079128b2ecc.md @@ -31,36 +31,36 @@ assert.isTrue(document.querySelectorAll('div')[11].classList.contains('cat-nose' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
- - --fcc-editable-region-- - - --fcc-editable-region--
-
+ + --fcc-editable-region-- + + --fcc-editable-region-- +
+
``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646def5e863abf7a14501421.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646def5e863abf7a14501421.md index eaac28de85c..a6e05dada45 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646def5e863abf7a14501421.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646def5e863abf7a14501421.md @@ -43,34 +43,34 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-nose')?.borderBottom - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
- -
-
+ +
+
+
``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646df03c8f79337ab46f148b.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646df03c8f79337ab46f148b.md index 162b2c8468a..7d403a82b4b 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646df03c8f79337ab46f148b.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646df03c8f79337ab46f148b.md @@ -37,34 +37,34 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-nose')?.left, '85px' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
- -
-
+ +
+
+
``` @@ -196,5 +196,4 @@ body { border-right: 15px solid transparent; border-bottom: 20px solid #442c2c; } - ``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646df0cf26413a7b35e4b8b3.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646df0cf26413a7b35e4b8b3.md index 87e70be99ee..71131fdcaa1 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646df0cf26413a7b35e4b8b3.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646df0cf26413a7b35e4b8b3.md @@ -49,34 +49,34 @@ assert.notMatch(code, /border-top-right-radius:\s*\d+%;/); - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
- -
-
+ +
+
+
``` @@ -211,5 +211,4 @@ body { border-right: 15px solid transparent; border-bottom: 20px solid #442c2c; } - ``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646df1d1aa4ae57bdf1869c4.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646df1d1aa4ae57bdf1869c4.md index 387dd7beb9b..fed7bbde2c6 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646df1d1aa4ae57bdf1869c4.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646df1d1aa4ae57bdf1869c4.md @@ -33,38 +33,38 @@ assert.isTrue(document.querySelectorAll('div')[12].classList.contains('cat-mouth - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
- --fcc-editable-region-- - - --fcc-editable-region-- +
+
+
+
+
+
+
-
+ +
+ + --fcc-editable-region-- + + --fcc-editable-region-- +
+
``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646dffd8ce9ac77ec1906f2e.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646dffd8ce9ac77ec1906f2e.md index c754dcc615b..4cf6bf7eb18 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646dffd8ce9ac77ec1906f2e.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646dffd8ce9ac77ec1906f2e.md @@ -43,41 +43,40 @@ assert.isTrue(document.querySelectorAll('.cat-mouth div')[1]?.classList.contains - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
- --fcc-editable-region-- -
- +
+
+
+
+
+
- --fcc-editable-region-- +
+ +
+
+--fcc-editable-region-- + +--fcc-editable-region--
-
+
+
``` @@ -213,5 +212,4 @@ body { border-right: 15px solid transparent; border-bottom: 20px solid #442c2c; } - ``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f0417322c0e04983a5149.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f0417322c0e04983a5149.md index 521962609b7..8ac5869c618 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f0417322c0e04983a5149.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f0417322c0e04983a5149.md @@ -43,40 +43,39 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-mouth-line-left')?.l - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
+
+
+
+
+ +
+
+
+
-
+
+
``` @@ -222,6 +221,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f08293804a30685533c6f.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f08293804a30685533c6f.md index 17d2190fa66..3bd340a35dc 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f08293804a30685533c6f.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f08293804a30685533c6f.md @@ -25,40 +25,39 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-mouth-line-left')?.t - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
+
+
+
+
+ +
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f09293eb3230723a62f77.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f09293eb3230723a62f77.md index 0edc79297bc..09fd869aac1 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f09293eb3230723a62f77.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f09293eb3230723a62f77.md @@ -43,40 +43,39 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-mouth-line-right')?. - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
+
+
+
+
+ +
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f0c9a1e3360092d1bbd33.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f0c9a1e3360092d1bbd33.md index 118088c6a3b..214fac16a32 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f0c9a1e3360092d1bbd33.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f0c9a1e3360092d1bbd33.md @@ -25,40 +25,39 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-mouth-line-right')?. - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
+
+
+
+
+ +
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f0ce5737243098ad6e494.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f0ce5737243098ad6e494.md index 324c153444f..a06c27f4004 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f0ce5737243098ad6e494.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f0ce5737243098ad6e494.md @@ -33,44 +33,43 @@ assert.isTrue(document.querySelectorAll('div')[15].classList.contains('cat-whisk - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
+
+
+
+
+ +
- --fcc-editable-region-- - - --fcc-editable-region-- - +
+
+
-
+ + --fcc-editable-region-- + + --fcc-editable-region-- +
+
``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f0ef13604420a8744f7d4.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f0ef13604420a8744f7d4.md index 87412f8cae4..0089a861895 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f0ef13604420a8744f7d4.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f0ef13604420a8744f7d4.md @@ -43,46 +43,45 @@ assert.isTrue(document.querySelectorAll('.cat-whiskers div')[1].classList.contai - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- - --fcc-editable-region-- -
- +
+
- --fcc-editable-region-- +
+ +
+ +
+
+
+
+
+--fcc-editable-region-- + +--fcc-editable-region--
-
+
+
``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f0f7c5933560af8e7e380.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f0f7c5933560af8e7e380.md index d4687a6d032..7b9a7cbf8bc 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f0f7c5933560af8e7e380.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f0f7c5933560af8e7e380.md @@ -50,49 +50,48 @@ assert.isTrue(document.querySelectorAll('.cat-whiskers-left div')[2].classList.c - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
- --fcc-editable-region-- -
- -
- --fcc-editable-region-- -
+
+
+
+ +
+
+
+
+
+ +
+
+--fcc-editable-region-- + +--fcc-editable-region-- +
+
-
+
+
``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f102bf87b350b593baa72.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f102bf87b350b593baa72.md index edb263c3e31..29db459c621 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f102bf87b350b593baa72.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f102bf87b350b593baa72.md @@ -49,53 +49,52 @@ assert.isTrue(document.querySelectorAll('.cat-whiskers-right div')[2].classList. - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
- --fcc-editable-region-- -
- -
- --fcc-editable-region-- +
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+--fcc-editable-region-- + +--fcc-editable-region-- +
-
+
+
``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f107abb89d00bb99f387a.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f107abb89d00bb99f387a.md index 05143fac610..1bb9e88dadf 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f107abb89d00bb99f387a.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f107abb89d00bb99f387a.md @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whiskers-left div')? - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f12da0b4c5d0ca162834a.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f12da0b4c5d0ca162834a.md index 8030602bca7..8ab7a316a23 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f12da0b4c5d0ca162834a.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f12da0b4c5d0ca162834a.md @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-left-top')?. - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -261,6 +260,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f135eab69d90d0c6d4e9b.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f135eab69d90d0c6d4e9b.md index a40143afdb6..17a7c778610 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f135eab69d90d0c6d4e9b.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f135eab69d90d0c6d4e9b.md @@ -25,53 +25,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-left-top')?. - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -250,5 +249,4 @@ body { --fcc-editable-region-- } - ``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f159b2cffb21150b927cb.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f159b2cffb21150b927cb.md index 6276afd6591..30b949507ad 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f159b2cffb21150b927cb.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f159b2cffb21150b927cb.md @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-left-middle' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -268,6 +267,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f164bf100dd11d226161f.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f164bf100dd11d226161f.md index 87914c3e77b..3d277084af5 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f164bf100dd11d226161f.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f164bf100dd11d226161f.md @@ -25,53 +25,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-left-middle' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -254,7 +253,7 @@ body { top: 127px; left: 52px; --fcc-editable-region-- - + --fcc-editable-region-- } ``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f1764e2f1d212ba9785a7.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f1764e2f1d212ba9785a7.md index 618e1db6b74..de66e3e9118 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f1764e2f1d212ba9785a7.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f1764e2f1d212ba9785a7.md @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-left-bottom' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -275,6 +274,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f1802a09a171332e14630.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f1802a09a171332e14630.md index a8a342ef6c3..452186ac484 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f1802a09a171332e14630.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f1802a09a171332e14630.md @@ -25,53 +25,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-left-bottom' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f4d6c42dc5f214f4e7444.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f4d6c42dc5f214f4e7444.md index 6c03b7585aa..c9bdc6f1c0b 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f4d6c42dc5f214f4e7444.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f4d6c42dc5f214f4e7444.md @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-right-top')? - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -282,6 +281,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f4e46e81f7021d5fd9c1d.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f4e46e81f7021d5fd9c1d.md index 8b0bebf7abd..e82225f1fa9 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f4e46e81f7021d5fd9c1d.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f4e46e81f7021d5fd9c1d.md @@ -25,53 +25,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-right-top')? - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f4f6a14e3c522d130a0d2.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f4f6a14e3c522d130a0d2.md index 86544091824..dceb600bfe1 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f4f6a14e3c522d130a0d2.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f4f6a14e3c522d130a0d2.md @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-right-middle - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -289,6 +288,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f4fe12b7985232bf475a5.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f4fe12b7985232bf475a5.md index 9c5278ac4ef..a258fbfe950 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f4fe12b7985232bf475a5.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f4fe12b7985232bf475a5.md @@ -25,53 +25,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-right-middle - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f507e4d1cd323f17db4fc.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f507e4d1cd323f17db4fc.md index b337cb9f5e5..bd69fae82ab 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f507e4d1cd323f17db4fc.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f507e4d1cd323f17db4fc.md @@ -44,53 +44,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-right-bottom - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -297,6 +296,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f516dbfc1342495515625.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f516dbfc1342495515625.md index d179ea139b4..2ff2bb6f905 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f516dbfc1342495515625.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/646f516dbfc1342495515625.md @@ -27,53 +27,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-right-bottom - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -295,53 +294,53 @@ body { - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+ +
+
``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/6476f5c17f99146071ee884c.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/6476f5c17f99146071ee884c.md index 94ab9a73101..ab0aeed3178 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/6476f5c17f99146071ee884c.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/6476f5c17f99146071ee884c.md @@ -41,14 +41,14 @@ assert.equal(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.left, '100p - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
+
+
+
``` @@ -65,9 +65,9 @@ body { .cat-head { --fcc-editable-region-- position: static; +--fcc-editable-region-- top: 100px; left: 100px; ---fcc-editable-region-- background: linear-gradient(#5e5e5e 85%, #45454f 100%); width: 205px; height: 180px; diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/6476f7a4827bcc61682f2347.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/6476f7a4827bcc61682f2347.md index f84f6e711fc..f9353ffcc74 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/6476f7a4827bcc61682f2347.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/6476f7a4827bcc61682f2347.md @@ -9,9 +9,7 @@ dashedName: step-9 當你為你的 `position` 屬性使用 `absolute` 值時,該元素會被從文件的正常流程中移除,然後其位置由 `top`、`right`、`bottom` 和 `left` 屬性決定。 -將你的 `.cat-head` 元素的 `position` 屬性設為 `absolute`,然後將 `top` 和 `left` 屬性設為任意正的像素值。 - - +將你的 `.cat-head` 元素的 `position` 屬性設為 `absolute`。 # --hints-- @@ -43,14 +41,14 @@ assert.match(code, /left:\s*\d{1,4}px;/); - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
+
+
+
``` @@ -67,9 +65,9 @@ body { .cat-head { --fcc-editable-region-- position: relative; +--fcc-editable-region-- top: 100px; left: 100px; ---fcc-editable-region-- background: linear-gradient(#5e5e5e 85%, #45454f 100%); width: 205px; height: 180px; diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/6476fb7cbaafa36d65e9cf35.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/6476fb7cbaafa36d65e9cf35.md index 99bdeef8ff7..bda7c9b5ea0 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/6476fb7cbaafa36d65e9cf35.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/6476fb7cbaafa36d65e9cf35.md @@ -33,17 +33,17 @@ assert.equal(document.querySelectorAll('div')[1]?.getAttribute('class'), 'box'); - - fCC Cat Painting - + + fCC Cat Painting + -
-
- --fcc-editable-region-- - - --fcc-editable-region-- -
+
+
+ --fcc-editable-region-- + + --fcc-editable-region-- +
``` @@ -59,8 +59,8 @@ body { .cat-head { position: absolute; - top: 300px; - left: 400px; + top: 100px; + left: 100px; background: linear-gradient(#5e5e5e 85%, #45454f 100%); width: 205px; height: 180px; diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/6476fc5cf14b276e6d04e82a.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/6476fc5cf14b276e6d04e82a.md index acc6270c416..77e89871ded 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/6476fc5cf14b276e6d04e82a.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/6476fc5cf14b276e6d04e82a.md @@ -7,7 +7,7 @@ dashedName: step-11 # --description-- -使用類別選擇器為你的 `.box` 元素設定寬度為 `200px`、高度為 `600px` 和背景顏色為 `#000`。同時,為它設定 `position` 為 `absolute`、`top` 為 `800px` 和 `left` 為 `650px`。 +使用類別選擇器為你的 `.box` 元素設定寬度為 `200px`、高度為 `600px` 和背景顏色為 `#000`。同時,為它設定 `position` 為 `absolute`、`top` 為 `800px` 和 `left` 為 `650px`。 # --hints-- @@ -61,15 +61,15 @@ assert.equal(new __helpers.CSSHelp(document)?.getStyle('.box')?.top, '800px'); - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
+
+
+
+
``` @@ -84,7 +84,7 @@ body { } .cat-head { - position: relative; + position: absolute; top: 100px; left: 100px; background: linear-gradient(#5e5e5e 85%, #45454f 100%); diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/6476fd4213318f6ee211028a.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/6476fd4213318f6ee211028a.md index b54a35bcbfa..4ecae0ae7a9 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/6476fd4213318f6ee211028a.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/6476fd4213318f6ee211028a.md @@ -1,13 +1,13 @@ --- id: 6476fd4213318f6ee211028a -title: 步驟 12 +title: 第 12 步驟 challengeType: 0 dashedName: step-12 --- # --description-- -現在將你的 `.cat-head` 的 `position` 屬性值替換為 `fixed`。保持 `top` 和 `left` 不變。 +現在將你的 `.cat-head` 的 `position` 屬性值替換為 `fixed`。 之後,向上和向下捲動以查看 `fixed` 值的運作方式。 @@ -39,15 +39,15 @@ assert.equal(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.left, '100p - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
+
+
+
+
``` @@ -63,10 +63,10 @@ body { .cat-head { --fcc-editable-region-- - position: relative; + position: absolute; +--fcc-editable-region-- top: 100px; left: 100px; ---fcc-editable-region-- background: linear-gradient(#5e5e5e 85%, #45454f 100%); width: 205px; height: 180px; diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/64770351e8586671ec0911f0.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/64770351e8586671ec0911f0.md index 3190eb42e93..5fecc92c96d 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/64770351e8586671ec0911f0.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/64770351e8586671ec0911f0.md @@ -1,6 +1,6 @@ --- id: 64770351e8586671ec0911f0 -title: 步驟 13 +title: 第 13 步驟 challengeType: 0 dashedName: step-13 --- @@ -41,15 +41,15 @@ assert.notMatch(code, /left:\s*100px;?/); - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
+
+
+
+
``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/6477062778c85972eb648030.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/6477062778c85972eb648030.md index 181347323fe..9a06683cfac 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/6477062778c85972eb648030.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/6477062778c85972eb648030.md @@ -7,7 +7,7 @@ dashedName: step-14 # --description-- -你現在應該將貓頭置中。 +你現在應該將貓頭置中。 為 `.cat-head` 元素賦予 `position` 屬性並設為 `absolute`。將 `right`、`left`、`top`、`bottom` 屬性的值設為 `0`,然後將其所有邊的 `margin` 屬性設為 `auto`。這是一種使用 CSS 定位將元素垂直且水平置中的方法。 @@ -57,15 +57,15 @@ assert.equal(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.margin, 'au - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
+
+
+
+
``` @@ -82,8 +82,8 @@ body { .cat-head { --fcc-editable-region-- position: sticky; - top: 0; --fcc-editable-region-- + top: 0; background: linear-gradient(#5e5e5e 85%, #45454f 100%); width: 205px; height: 180px; @@ -92,7 +92,7 @@ body { } .box { - width: 400px; + width: 200px; height: 600px; background-color: #000; position: absolute; diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/647d821de0d97b3283c72b36.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/647d821de0d97b3283c72b36.md index a4d5b65bf57..3186bffa284 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/647d821de0d97b3283c72b36.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/647d821de0d97b3283c72b36.md @@ -14,7 +14,7 @@ dashedName: step-16 你應該移除 `.box` css 規則及其所有值。 ```js -assert.notMatch(code, /\.box\s*\{\s*width:\s*400px;\s*height:\s*600px;\s*background-color:\s*#000;\s*position:\s*absolute;\s*left:\s*650px;\s*top:\s*800px;?\s*\}\s*/) +assert.notMatch(code, /\.box\s*\{\s*width:\s*200px;\s*height:\s*600px;\s*background-color:\s*#000;\s*position:\s*absolute;\s*left:\s*650px;\s*top:\s*800px;?\s*\}\s*/) ``` # --seed-- @@ -25,14 +25,14 @@ assert.notMatch(code, /\.box\s*\{\s*width:\s*400px;\s*height:\s*600px;\s*backgro - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
+
+
+
``` @@ -62,7 +62,7 @@ body { --fcc-editable-region-- .box { - width: 400px; + width: 200px; height: 600px; background-color: #000; position: absolute; diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/647d855ac12cd436059acd39.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/647d855ac12cd436059acd39.md index 506ad0b3e9f..0280b34a41b 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/647d855ac12cd436059acd39.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/647d855ac12cd436059acd39.md @@ -1,6 +1,6 @@ --- id: 647d855ac12cd436059acd39 -title: 步驟 2 +title: 第 2 步 challengeType: 0 dashedName: step-2 --- @@ -33,9 +33,9 @@ assert.strictEqual(new __helpers.CSSHelp(document).getStyle('*')?.boxSizing, 'bo - - fCC Cat Painting - + + fCC Cat Painting + diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/649353647c44ef4867ab4935.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/649353647c44ef4867ab4935.md index c148bb2f536..f4f0cb9b2c0 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/649353647c44ef4867ab4935.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/649353647c44ef4867ab4935.md @@ -25,17 +25,17 @@ assert.notMatch(code, /<\/div>/) - - fCC Cat Painting - + + fCC Cat Painting + -
-
- --fcc-editable-region-- -
- --fcc-editable-region-- -
+
+
+ --fcc-editable-region-- +
+ --fcc-editable-region-- +
``` @@ -64,7 +64,7 @@ body { } .box { - width: 400px; + width: 200px; height: 600px; background-color: #000; position: absolute; diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/64a2687ef267e5934a2f93e3.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/64a2687ef267e5934a2f93e3.md index 6fbb42b6016..c3d88999637 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/64a2687ef267e5934a2f93e3.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/64a2687ef267e5934a2f93e3.md @@ -43,39 +43,39 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-mouth div')?.border, - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
- -
- -
-
-
+
+
-
+ +
+ +
+
+
+
+
+
``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/64a26ac5540c5493f4641f10.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/64a26ac5540c5493f4641f10.md index 7ec10195451..546a4e53eea 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/64a26ac5540c5493f4641f10.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/64a26ac5540c5493f4641f10.md @@ -32,39 +32,39 @@ assert.match(code, /border-radius:\s*190%\/190px\s*150px\s*0\s*0\s*;?/) - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
- -
- -
-
-
+
+
-
+ +
+ +
+
+
+
+
+
``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/64a3bcbc83e574b58c8ed048.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/64a3bcbc83e574b58c8ed048.md index d177025cd5a..937e962e176 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/64a3bcbc83e574b58c8ed048.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/64a3bcbc83e574b58c8ed048.md @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whiskers-right div') - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/6676a8a8d9861319ee901a90.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/6676a8a8d9861319ee901a90.md index bf0d4f7774b..ce6f6af8e98 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/6676a8a8d9861319ee901a90.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/6676a8a8d9861319ee901a90.md @@ -103,23 +103,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-ear')?.borderBo - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/6676a8b01e56ec1a1e07c202.md b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/6676a8b01e56ec1a1e07c202.md index 410bd02d1b6..4519ce3871a 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/6676a8b01e56ec1a1e07c202.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-cat-painting/6676a8b01e56ec1a1e07c202.md @@ -73,23 +73,23 @@ assert.isEmpty(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.backg - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` @@ -117,15 +117,15 @@ body { border-radius: 46%; } ---fcc-editable-region-- .cat-right-ear { +--fcc-editable-region-- height: 100px; width: 100px; background-color: white; border-left: 35px solid blue; border-right: 35px solid blue; border-top: 35px solid red; +--fcc-editable-region-- border-bottom: 35px solid red; } ---fcc-editable-region-- ``` diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-envelope-budget-app/69b2c970cb02ddaafff1c10d.md b/curriculum/challenges/chinese-traditional/blocks/workshop-envelope-budget-app/69b2c970cb02ddaafff1c10d.md index f92a40af70a..a25fd682a05 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-envelope-budget-app/69b2c970cb02ddaafff1c10d.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-envelope-budget-app/69b2c970cb02ddaafff1c10d.md @@ -62,7 +62,7 @@ assert.notMatch(code, /<\/input>/); `input` 元素應該有結尾的 `>`。 ```js -assert.match(code, /HTMLString\s*=\s*`\n\s*Expense\s\$\{entryNumber\}\sName<\/label>\n\s*]*\/>/); +assert.match(code, /HTMLString\s*=\s*`\n\s*Expense\s\$\{entryNumber\}\sName<\/label>\n\s*]*>/); ``` # --seed-- diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-fcc-authors-page/69e14a2fd8ecf9210c0739ee.md b/curriculum/challenges/chinese-traditional/blocks/workshop-fcc-authors-page/69e14a2fd8ecf9210c0739ee.md index 9a101c35662..334f29873ea 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-fcc-authors-page/69e14a2fd8ecf9210c0739ee.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-fcc-authors-page/69e14a2fd8ecf9210c0739ee.md @@ -11,6 +11,12 @@ dashedName: step-26 在編輯器中指定的位置,為 `initialFetch` 添加一個函式呼叫。 +# --before-all-- + +```js +window.fetch = () => Promise.resolve({json: () => Promise.resolve([{ author: 'Whoever', image: 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==', url: "http://not-a-real-url.nowhere/", bio: 'words go here' }])}); +``` + # --hints-- 你應該呼叫 `initialFetch`,且不帶任何引數。 diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-fortune-teller-app/68ded620ab19272a3fa97592.md b/curriculum/challenges/chinese-traditional/blocks/workshop-fortune-teller-app/68ded620ab19272a3fa97592.md index e3553197f1b..49c10eff9d1 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-fortune-teller-app/68ded620ab19272a3fa97592.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-fortune-teller-app/68ded620ab19272a3fa97592.md @@ -73,10 +73,9 @@ assert.isTrue(renderCard.hasReturnAnnotation("string")); 你的 `renderCard` 函式應該傳回一個模板字串。 ```js -assert.match( - __helpers.removeJSComments(code), - /renderCard\s*=\s*\([^)]*\)\s*:\s*string\s*=>\s*(?:\{\s*return\s*)?`/ -); +const explorer = await __helpers.Explorer(code); +const { renderCard } = explorer.allFunctions; +assert.match(__helpers.removeJSComments(renderCard.toString()), /(?:return|=>)\s*`/); ``` # --seed-- diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-fortune-teller-app/68ed4621677e86eeefa59fe6.md b/curriculum/challenges/chinese-traditional/blocks/workshop-fortune-teller-app/68ed4621677e86eeefa59fe6.md index edbb540c019..7fa3d97fd15 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-fortune-teller-app/68ed4621677e86eeefa59fe6.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-fortune-teller-app/68ed4621677e86eeefa59fe6.md @@ -15,8 +15,8 @@ dashedName: step-26 ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.initializeEventListeners.toString(); -assert.match(method, /initializeEventListeners\s*\(\s*\)\s*:\s*void/); +const { initializeEventListeners } = explorer.classes.Game?.methods ?? {}; +assert.isTrue(initializeEventListeners?.hasReturnAnnotation("void")); ``` # --seed-- diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-fortune-teller-app/68ee6c4b4c764b62d77df717.md b/curriculum/challenges/chinese-traditional/blocks/workshop-fortune-teller-app/68ee6c4b4c764b62d77df717.md index 2fbfe90cd31..63cd806ddb4 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-fortune-teller-app/68ee6c4b4c764b62d77df717.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-fortune-teller-app/68ee6c4b4c764b62d77df717.md @@ -17,16 +17,30 @@ dashedName: step-31 ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.singleCardSelected.toString(); -assert.match(method, /const\s+isReversed\s*=/); +const { singleCardSelected } = explorer.classes.Game?.methods ?? {}; +const { isReversed } = singleCardSelected?.variables ?? {}; +assert.exists(isReversed); ``` 你的 `isReversed` 變數應該使用 `Math.random()` 來隨機決定卡片是否反向。 ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.singleCardSelected.toString(); -assert.match(method, /isReversed\s*=\s*Math\.random\s*\(\s*\)\s*<\s*0\.5/); +const { singleCardSelected } = explorer.classes.Game?.methods ?? {}; +const { isReversed } = singleCardSelected?.variables ?? {}; + +const validForms = [ + 'Math.random() < 0.5', + 'Math.random() > 0.5', + 'Math.random() <= 0.5', + 'Math.random() >= 0.5', + '0.5 < Math.random()', + '0.5 > Math.random()', + '0.5 <= Math.random()', + '0.5 >= Math.random()' +]; + +assert.isTrue(validForms.some((form) => isReversed?.value.matches(form))); ``` # --seed-- diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-fortune-teller-app/68ee6c8c274515694ead0024.md b/curriculum/challenges/chinese-traditional/blocks/workshop-fortune-teller-app/68ee6c8c274515694ead0024.md index 8e97e5fdc83..51c9eb1e6f9 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-fortune-teller-app/68ee6c8c274515694ead0024.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-fortune-teller-app/68ee6c8c274515694ead0024.md @@ -7,7 +7,7 @@ dashedName: step-32 # --description-- -幸運籤必須是隨機的,因此需要一個輔助函式來選擇隨機的幸運籤。在 `chosenCard` 方法內宣告一個名為 `singleCardSelected` 的變數。使用 `getRandomItem` 方法取得一張隨機卡片,並將 `cards` 作為引數傳入。 +籤詩必須是隨機的,因此需要一個輔助函式來選擇隨機籤詩。在 `singleCardSelected` 方法內宣告一個名為 `chosenCard` 的變數。使用 `getRandomItem` 函式來取得隨機卡片,並將 `this.cards` 作為引數傳入。 # --hints-- @@ -15,22 +15,18 @@ dashedName: step-32 ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.singleCardSelected.toString(); -assert.match(method, /const\s+chosenCard\s*=/); +const { singleCardSelected } = explorer.classes.Game?.methods ?? {}; +const { chosenCard } = singleCardSelected?.variables ?? {}; +assert.exists(chosenCard); ``` 你的 `chosenCard` 變數應該透過呼叫 `getRandomItem(this.cards)` 來指定。 ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.singleCardSelected.toString(); -assert.match(method, /chosenCard\s*=\s*getRandomItem\s*\(\s*this\.cards\s*\)/); -``` - -你應該將 `this.cards` 作為引數傳給 `getRandomItem`。 - -```js -assert.match(__helpers.removeJSComments(code), /getRandomItem\s*\(\s*this\.cards\s*\)/); +const { singleCardSelected } = explorer.classes.Game?.methods ?? {}; +const { chosenCard } = singleCardSelected?.variables ?? {}; +assert.isTrue(chosenCard?.value.matches("getRandomItem(this.cards)")); ``` # --seed-- diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-fortune-teller-app/68f1e43a5f890b51774d93c4.md b/curriculum/challenges/chinese-traditional/blocks/workshop-fortune-teller-app/68f1e43a5f890b51774d93c4.md index 276707ed898..03e91c66767 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-fortune-teller-app/68f1e43a5f890b51774d93c4.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-fortune-teller-app/68f1e43a5f890b51774d93c4.md @@ -15,22 +15,28 @@ dashedName: step-43 ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /const\s+target\s*=/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { target } = showFortune?.variables ?? {}; +assert.exists(target); ``` 你的 `target` 變數應該被指定為 `e.target`。 ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /target\s*=\s*e\.target/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { target } = showFortune?.variables ?? {}; +assert.isTrue(target?.value.matches("e.target")); ``` 你應該在 `if` 變數後面有一個空的 `target` 述語。 ```js -assert.match(__helpers.removeJSComments(code), /showFortune\s*\([^)]*\)\s*\{[\s\S]*?if\s*\(\s*\)\s*\{\s*\}/); +const explorer = await __helpers.Explorer(code); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +assert.exists(showFortune); +const method = __helpers.removeJSComments(showFortune.toString()); +assert.match(method, /target\s*=\s*e\.target[\s\S]*?if\s*\(\s*\)\s*\{\s*\}/); ``` # --seed-- diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-fortune-teller-app/68f1e6a98bc05e67cc2b85e6.md b/curriculum/challenges/chinese-traditional/blocks/workshop-fortune-teller-app/68f1e6a98bc05e67cc2b85e6.md index 4835c6a76c9..0236c506c07 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-fortune-teller-app/68f1e6a98bc05e67cc2b85e6.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-fortune-teller-app/68f1e6a98bc05e67cc2b85e6.md @@ -15,22 +15,18 @@ dashedName: step-45 ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /const\s+cardElement\s*=/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { cardElement } = showFortune?.variables ?? {}; +assert.exists(cardElement); ``` 你的 `cardElement` 應該使用 `target?.closest` 來尋找 `.card_container`。 ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /cardElement\s*=\s*target\?\.closest\s*\(\s*['"]\.card_container['"]\s*\)/); -``` - -你應該將 `.card_container` 作為引數傳入 `closest`。 - -```js -assert.match(__helpers.removeJSComments(code), /\.closest\s*\(\s*['"]\.card_container['"]\s*\)/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { cardElement } = showFortune?.variables ?? {}; +assert.isTrue(cardElement?.value.matches("target?.closest('.card_container')")); ``` # --seed-- diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-fortune-teller-app/68f1e852f705eb77f6bcb893.md b/curriculum/challenges/chinese-traditional/blocks/workshop-fortune-teller-app/68f1e852f705eb77f6bcb893.md index a939a4bfb2f..f3ae74d4bd3 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-fortune-teller-app/68f1e852f705eb77f6bcb893.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-fortune-teller-app/68f1e852f705eb77f6bcb893.md @@ -15,28 +15,18 @@ dashedName: step-48 ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /const\s+cardId\s*=/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { cardId } = showFortune?.variables ?? {}; +assert.exists(cardId); ``` 你的 `cardId` 變數應該透過呼叫 `cardElement.getAttribute("data-id")` 來指定。 ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /cardId\s*=\s*cardElement\.getAttribute\s*\(\s*['"]data-id['"]\s*\)/); -``` - -你應該對 `getAttribute` 使用 `cardElement` 方法。 - -```js -assert.match(__helpers.removeJSComments(code), /cardElement\.getAttribute\s*\(/); -``` - -你應該將 `'data-id'` 傳入 `getAttribute`。 - -```js -assert.match(__helpers.removeJSComments(code), /\.getAttribute\s*\(\s*['"]data-id['"]\s*\)/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { cardId } = showFortune?.variables ?? {}; +assert.isTrue(cardId?.value.matches('cardElement.getAttribute("data-id")')); ``` # --seed-- diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-fortune-teller-app/68f1e8de2731b07d62e738d2.md b/curriculum/challenges/chinese-traditional/blocks/workshop-fortune-teller-app/68f1e8de2731b07d62e738d2.md index 7ac1c47d959..916bf4d902e 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-fortune-teller-app/68f1e8de2731b07d62e738d2.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-fortune-teller-app/68f1e8de2731b07d62e738d2.md @@ -15,28 +15,38 @@ dashedName: step-49 ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /const\s+foundCard\s*=/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { foundCard } = showFortune?.variables ?? {}; +assert.exists(foundCard); ``` -你的 `foundCard` 應該透過對 `find` 呼叫 `this.cards` 並傳入正確的回呼來指定。 +你的 `foundCard` 應該透過在 `this.cards` 上呼叫 `find` 來指定,並傳入一個回呼,該回呼接受一個 `card` 參數,並傳回使用嚴格相等性比較 `card.name_short` 與 `cardId` 的結果。 ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /foundCard\s*=\s*this\.cards\.find\s*\(/); -``` - -`find` 回呼應該有一個名為 `card` 的參數。 - -```js -assert.match(__helpers.removeJSComments(code), /cards\.find\s*\(\s*\(\s*card\s*\)\s*=>/); -``` - -在回呼內,`card.name_short` 應該與 `cardId` 進行比較。 - -```js -assert.match(__helpers.removeJSComments(code), /card\.name_short\s*===?\s*cardId/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { foundCard } = showFortune?.variables ?? {}; + +const validForms = [ + 'this.cards.find((card) => card.name_short === cardId)', + 'this.cards.find((card) => { return card.name_short === cardId; })', + 'this.cards.find((card) => cardId === card.name_short)', + 'this.cards.find((card) => { return cardId === card.name_short; })', + 'this.cards.find(card => card.name_short === cardId)', + 'this.cards.find(card => { return card.name_short === cardId; })', + 'this.cards.find(card => cardId === card.name_short)', + 'this.cards.find(card => { return cardId === card.name_short; })', + 'this.cards.find((card: Card) => card.name_short === cardId)', + 'this.cards.find((card: Card) => { return card.name_short === cardId; })', + 'this.cards.find((card: Card) => cardId === card.name_short)', + 'this.cards.find((card: Card) => { return cardId === card.name_short; })', + 'this.cards.find(function (card) { return card.name_short === cardId; })', + 'this.cards.find(function (card) { return cardId === card.name_short; })', + 'this.cards.find(function (card: Card) { return card.name_short === cardId; })', + 'this.cards.find(function (card: Card) { return cardId === card.name_short; })' +]; + +assert.isTrue(validForms.some((form) => foundCard?.value.matches(form))); ``` # --seed-- diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-greeting-bot/66ad8ab945d266383f318cbf.md b/curriculum/challenges/chinese-traditional/blocks/workshop-greeting-bot/66ad8ab945d266383f318cbf.md index 0a227df4437..a3da20e502d 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-greeting-bot/66ad8ab945d266383f318cbf.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-greeting-bot/66ad8ab945d266383f318cbf.md @@ -30,7 +30,11 @@ assert.lengthOf(logSpy.calls, 2); 你的 `console` 述語應該包含訊息 `"I am excited to talk to you."`。不要忘記引號。 ```js -assert.deepInclude(logSpy.calls, ["I am excited to talk to you."]); +assert.isTrue( + logSpy.calls.some( + (call) => /I\s+am\s+excited\s+to\s+talk\s+to\s+you\s*\./.test(call[0]) + ) +); ``` # --seed-- diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-greeting-bot/66ad9c633fa26d3c1475eae3.md b/curriculum/challenges/chinese-traditional/blocks/workshop-greeting-bot/66ad9c633fa26d3c1475eae3.md index 4109607d5e9..844662ac0dd 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-greeting-bot/66ad9c633fa26d3c1475eae3.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-greeting-bot/66ad9c633fa26d3c1475eae3.md @@ -28,7 +28,11 @@ assert.lengthOf(logSpy.calls, 3); 你的 `console` 述語應該有訊息 `"Allow me to introduce myself."`。不要忘記引號。 ```js -assert.deepInclude(logSpy.calls, ["Allow me to introduce myself."]); +assert.isTrue( + logSpy.calls.some( + (call) => /Allow\s+me\s+to\s+introduce\s+myself\s*\./.test(call[0]) + ) +); ``` # --seed-- diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-greeting-bot/66add47d27763c4862492c8c.md b/curriculum/challenges/chinese-traditional/blocks/workshop-greeting-bot/66add47d27763c4862492c8c.md index 9d3f80bbdf3..7f8b098988b 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-greeting-bot/66add47d27763c4862492c8c.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-greeting-bot/66add47d27763c4862492c8c.md @@ -76,12 +76,10 @@ console.log(favoriteSubjectSentence); ```js console.log("Hi there!"); console.log("I am excited to talk to you."); - let bot; -let botLocation; - bot = "teacherBot"; -botLocation = "the universe"; + +let botLocation = "the universe"; console.log("Allow me to introduce myself."); diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-hotel-feedback-form/66a93bbe65a26169dbf3bc39.md b/curriculum/challenges/chinese-traditional/blocks/workshop-hotel-feedback-form/66a93bbe65a26169dbf3bc39.md index 130540d47a5..f5741f83c36 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-hotel-feedback-form/66a93bbe65a26169dbf3bc39.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-hotel-feedback-form/66a93bbe65a26169dbf3bc39.md @@ -13,7 +13,7 @@ dashedName: step-10 # --hints-- -你應該有一個 `label` 元素。 +你的 `fieldset` 裡應該有第二個 `label` 元素。 ```js assert.lengthOf(document.querySelectorAll('fieldset label'), 2); diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-hotel-feedback-form/66a9401c9d660d6bb15993e2.md b/curriculum/challenges/chinese-traditional/blocks/workshop-hotel-feedback-form/66a9401c9d660d6bb15993e2.md index 03e8a39779f..178dddc106c 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-hotel-feedback-form/66a9401c9d660d6bb15993e2.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-hotel-feedback-form/66a9401c9d660d6bb15993e2.md @@ -1,13 +1,13 @@ --- id: 66a9401c9d660d6bb15993e2 -title: 步驟 13 +title: 第 13 步驟 challengeType: 0 dashedName: step-13 --- # --description-- -你的飯店回授表單應該有一個選項,可讓使用者添加他們的年齡。 +你的飯店回授表單應該有一個選項,可讓使用者添加他們的年齡。 首先為表單添加一個帶有文字 `Age (optional):` 的 `label` 元素。 @@ -15,7 +15,7 @@ dashedName: step-13 # --hints-- -你應該有一個 `label` 元素。 +你的 `fieldset` 裡應該有第三個 `label` 元素。 ```js assert.lengthOf(document.querySelectorAll('fieldset label'), 3); diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-hotel-feedback-form/66a9419e2d18476c645ce693.md b/curriculum/challenges/chinese-traditional/blocks/workshop-hotel-feedback-form/66a9419e2d18476c645ce693.md index 09e0d8b6584..17e35f10d33 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-hotel-feedback-form/66a9419e2d18476c645ce693.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-hotel-feedback-form/66a9419e2d18476c645ce693.md @@ -7,7 +7,7 @@ dashedName: step-14 # --description-- -數字 `input` 用於創建數字輸入欄。 +數字 `input` 用於創建數字輸入欄。 這是一個數字輸入欄的範例: @@ -17,9 +17,9 @@ dashedName: step-14 `min` 和 `max` 屬性用於設定輸入欄位中可輸入的最小值和最大值。 -在你的 `label` 元素下方,添加一個輸入框,其 `type` 屬性設為 `"number"`,且 `id` 為 `"age"`。 +在你的 `label` 標籤下方,添加一個 `input`,其 `type` 屬性設為 `"number"`,並且 `id` 設為 `"age"`。 -`name` 屬性應設定為 `"age"`,`min` 屬性應設定為 `"3"`,`max` 屬性應設定為 `"100"`。 +`name` 屬性應設為 `"age"`,`min` 屬性應設為 `"3"`,`max` 屬性應設為 `"100"`。 # --hints-- @@ -29,13 +29,13 @@ dashedName: step-14 assert.isNotNull(document.querySelector('label + input[type="number"]')); ``` -你的數字 `input` 應該有一個 `id` 為 `age`。 +你的數字 `input` 應該有一個 `id` 為 `"age"`。 ```js assert.isNotNull(document.querySelector('label + input#age')); ``` -你的數字 `input` 應該有一個設定為 `age` 的 `name` 屬性。 +你的數字 `input` 應該有一個 `name` 屬性設為 `"age"`。 ```js assert.isNotNull(document.querySelector('label + input[name="age"]')); diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-hotel-feedback-form/67a51d3a8a6fe123b77b0c6e.md b/curriculum/challenges/chinese-traditional/blocks/workshop-hotel-feedback-form/67a51d3a8a6fe123b77b0c6e.md index 31c2856cbd2..f6e93c5aeeb 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-hotel-feedback-form/67a51d3a8a6fe123b77b0c6e.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-hotel-feedback-form/67a51d3a8a6fe123b77b0c6e.md @@ -7,11 +7,11 @@ dashedName: step-12 # --description-- -`input` 元素可以有一個 `size` 屬性。此屬性定義使用者在輸入時應該可見的字元數量。`size` 的值應該是大於零的非負整數。如果未指定 `size`,或指定了無效的值,輸入框將使用瀏覽器設定的預設寬度。 +`input` 元素可以有一個 `size` 屬性。這個屬性定義使用者在輸入 `input` 時應該可見的字元數量。`size` 的值應該是正整數。如果沒有指定 `size`,或指定了無效的值,`input` 將會使用瀏覽器設定的預設寬度。 ```html - - + + ``` 為你的 name 和 email 輸入欄位添加一個 `size` 屬性,值為 `"20"`。 diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-plant-nursery-catalog/6734a772196245601e4b80e0.md b/curriculum/challenges/chinese-traditional/blocks/workshop-plant-nursery-catalog/6734a772196245601e4b80e0.md index b21c41f2f29..f92412b3b29 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-plant-nursery-catalog/6734a772196245601e4b80e0.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-plant-nursery-catalog/6734a772196245601e4b80e0.md @@ -9,7 +9,7 @@ dashedName: step-10 當你需要從映射中取得元素時,可以使用 `get` 方法。它以鍵作為引數,並傳回相關的值。 -使用 `get` 方法從你的目錄中取得 `ballerina` 鍵的值,並將其指定到名為 `getBallerina` 的變數。然後,將你的新變數記錄到主控台。 +使用 `get` 方法從你的目錄中取得 `ballerina` 鍵的值,並將它指定給名為 `getBallerina` 的變數。接著,將你的新變數記錄到主控台。 # --hints-- @@ -22,7 +22,10 @@ assert.exists(getBallerina); 你的 `getBallerina` 變數應該具有 `catalog.get(ballerina)` 的值。 ```js -assert.match(__helpers.removeJSComments(code), /(const|let|var)\s+getBallerina\s*=\s*catalog\s*\.\s*get\s*\(\s*ballerina\s*\)/); +const explorer = await __helpers.Explorer(code); +const { getBallerina } = explorer.variables; +assert.isTrue(getBallerina?.value.matches('catalog.get(ballerina)') +); ``` 你應該將你的 `getBallerina` 變數記錄到主控台。 diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-plant-nursery-catalog/6737a1a073a0d14c6544d301.md b/curriculum/challenges/chinese-traditional/blocks/workshop-plant-nursery-catalog/6737a1a073a0d14c6544d301.md index 5992d2ce142..097e969b651 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-plant-nursery-catalog/6737a1a073a0d14c6544d301.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-plant-nursery-catalog/6737a1a073a0d14c6544d301.md @@ -23,7 +23,9 @@ assert.exists(plantsSet); 你應該呼叫 `displayPlantsSet` 並將它指定、設值給 `plantsSet`。 ```js -assert.match(__helpers.removeJSComments(code), /(const|let|var)\s+plantsSet\s*=\s*displayPlantsSet\s*\(\s*\)/) +const explorer = await __helpers.Explorer(code); +const { plantsSet } = explorer.variables; +assert.isTrue(plantsSet?.value.matches('displayPlantsSet()')); ``` 你應該將 `plantsSet` 記錄到主控台。 diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-reusable-mega-navbar/6740495ba48aa94e5667b436.md b/curriculum/challenges/chinese-traditional/blocks/workshop-reusable-mega-navbar/6740495ba48aa94e5667b436.md index 9da72db8ffe..6b5a749e86a 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-reusable-mega-navbar/6740495ba48aa94e5667b436.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-reusable-mega-navbar/6740495ba48aa94e5667b436.md @@ -10,7 +10,7 @@ demoType: onLoad 在本次工作坊中,你將透過建置可重複使用的導覽列來練習使用 React 函式組件。 -所有的 CSS 都已為你提供,讓你可以專注於建立導覽列。 +所有 CSS 都已為你準備好,讓你可以專注於建立導覽列。 首先定義一個 `Navbar` 函式(程式)組件。接下來的步驟中,你將開始使用 JSX 建置該組件。 @@ -24,7 +24,7 @@ export function multiply(a, b) { } ``` -此外,React 函式(程式)組件需要以大寫字母開頭,因為這是區分一般 HTML 元素的一種方式。 +此外,React 函式組件必須以大寫字母開頭,因為這是 React 區分它們與一般 HTML 元素的方式。 # --hints-- diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-reusable-mega-navbar/67457ff2dc531fbed928a0f0.md b/curriculum/challenges/chinese-traditional/blocks/workshop-reusable-mega-navbar/67457ff2dc531fbed928a0f0.md index 240db9d6a2f..ad166faf719 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-reusable-mega-navbar/67457ff2dc531fbed928a0f0.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-reusable-mega-navbar/67457ff2dc531fbed928a0f0.md @@ -24,10 +24,9 @@ const App = () => { } ``` - 在 `Navbar` 組件內,傳回一個具有 `className` 為 `navbar` 的 `nav` 元素。 -這裡使用 `className` 而不是 `class` 的原因是因為 `class` 是 JavaScript 中的保留關鍵字。所以,React 使用 `className` 作為將類別套用到元素上的方式。 +這裡使用 `className` 而不是 `class`,因為 `class` 是 JavaScript 的保留關鍵字。所以,React 使用 `className` 來為元素套用類別。 # --hints-- @@ -37,7 +36,7 @@ const App = () => { assert.exists(document.querySelector('nav')); ``` -你的 `nav` 元素應該有一個 `className` 屬性,值為 `navbar`。 +你的 `nav` 元素應該有一個 `className` 為 `navbar`。 ```js assert.equal(document.querySelector('nav')?.getAttribute('class'), 'navbar'); diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-reusable-mega-navbar/6745c732dbeb7c04f346e6f7.md b/curriculum/challenges/chinese-traditional/blocks/workshop-reusable-mega-navbar/6745c732dbeb7c04f346e6f7.md index e5b2ca57bd3..6737eeb036d 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-reusable-mega-navbar/6745c732dbeb7c04f346e6f7.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-reusable-mega-navbar/6745c732dbeb7c04f346e6f7.md @@ -7,7 +7,7 @@ dashedName: step-3 # --description-- -在 `nav` 元素內創建一個 `ul` 元素。在該 `ul` 元素內,創建三個列表項目。 +在你的 `nav` 元素內建立一個 `ul` 元素。在該 `ul` 元素內,建立三個 `li` 元素。 # --hints-- diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-reusable-mega-navbar/6745c89fba004707ded84453.md b/curriculum/challenges/chinese-traditional/blocks/workshop-reusable-mega-navbar/6745c89fba004707ded84453.md index 8797b111d5e..6d004decd4a 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-reusable-mega-navbar/6745c89fba004707ded84453.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-reusable-mega-navbar/6745c89fba004707ded84453.md @@ -7,17 +7,17 @@ dashedName: step-5 # --description-- -在第一個 `li` 元素內創建一個錨點元素。為 `a` 元素添加 `href` 屬性,值為 `#`,並設定文字為 `Dashboard`。 +在你的第一個 `li` 元素內創建一個 `a` 元素。為它設定一個 `href` 屬性為 `#`,並且文字為 `Dashboard`。 # --hints-- -你應該在第一個列表項目內創建一個 `a` 元素。 +你應該在你的第一個 `li` 元素內創建一個 `a` 元素。 ```js assert.exists(document.querySelector('li a')); ``` -你的 `a` 元素應該將其 `href` 屬性設為 `#`。 +你的 `a` 元素應該有一個 `href` 屬性為 `#`。 ```js assert.equal(document.querySelector('a')?.getAttribute('href'), '#'); diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-reusable-mega-navbar/6745cebbf97ef2129f3b9bab.md b/curriculum/challenges/chinese-traditional/blocks/workshop-reusable-mega-navbar/6745cebbf97ef2129f3b9bab.md index 35634022ae9..ec5b7a17bbf 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-reusable-mega-navbar/6745cebbf97ef2129f3b9bab.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-reusable-mega-navbar/6745cebbf97ef2129f3b9bab.md @@ -7,17 +7,17 @@ dashedName: step-6 # --description-- -在第二個 `li` 元素內創建另一個 `a` 元素。為它的 `href` 屬性指定 `#`,並設定文字為 `Widgets`。 +在你的第二個 `li` 元素內創建另一個 `a` 元素。為它設定一個 `href` 屬性為 `#`,並且文字為 `Widgets`。 # --hints-- -你應該在第二個列表條款內創建一個 `a` 元素。 +你應該在你的第二個 `li` 元素內創建一個 `a` 元素。 ```js assert.lengthOf(document.querySelectorAll('li a'), 2); ``` -你的 `a` 元素應該將其 `href` 屬性設為 `#`。 +你的 `a` 元素應該有一個 `href` 屬性為 `#`。 ```js assert.equal(document.querySelectorAll('a')[1]?.getAttribute('href'), '#'); diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-reusable-mega-navbar/6745d799beeb822076a4da9d.md b/curriculum/challenges/chinese-traditional/blocks/workshop-reusable-mega-navbar/6745d799beeb822076a4da9d.md index 27c7aa4bbcf..db28950dbb8 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-reusable-mega-navbar/6745d799beeb822076a4da9d.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-reusable-mega-navbar/6745d799beeb822076a4da9d.md @@ -7,19 +7,19 @@ dashedName: step-7 # --description-- -在第三個列表項目中,創建一個 `button` 元素,並將 `aria-expanded` 屬性設為 `false`。同時,將 `button` 的文字設為 `Apps`。 +在你的第三個 `li` 元素內,創建一個帶有 `aria-expanded` 屬性且值為 `false` 的 `button` 元素。同時,將該 `button` 的文字設為 `Apps`。 `aria-expanded` 屬性會告知螢幕閱讀器使用者該按鈕會觸發可展開的子選單。 # --hints-- -你應該在第三個列表項目內創建一個 `button` 元素。 +你應該在第三個 `li` 元素內創建一個 `button` 元素。 ```js assert.exists(document.querySelector('li:nth-of-type(3) button')); ``` -你的 `button` 元素應該有一個設定為 `false` 的 `aria-expanded` 屬性。 +你的 `button` 元素應該有一個 `aria-expanded` 屬性,且值為 `false`。 ```js assert.equal( diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-reusable-mega-navbar/6745d9df333efe2543a1f457.md b/curriculum/challenges/chinese-traditional/blocks/workshop-reusable-mega-navbar/6745d9df333efe2543a1f457.md index ddf26c04c21..b9d68326eb4 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-reusable-mega-navbar/6745d9df333efe2543a1f457.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-reusable-mega-navbar/6745d9df333efe2543a1f457.md @@ -7,7 +7,7 @@ dashedName: step-8 # --description-- -仍在第三個 `li` 元素內,為彈出視窗創建一個 `ul` 元素。為它指定 `className` 為 `sub-menu`,並將 `aria-label` 設為 `Apps`。 +仍然在你的第三個 `li` 元素內,為彈出視窗創建一個 `ul` 元素。給它一個 `className` 為 `sub-menu`,並設定 `aria-label` 為 `Apps`。 # --hints-- @@ -17,13 +17,13 @@ dashedName: step-8 assert.exists(document.querySelector('li ul')); ``` -你應該將你的 `ul` 元素的 `className` 屬性設為 `sub-menu`。 +你的 `ul` 元素應該有一個 `className` 為 `sub-menu`。 ```js assert.equal(document.querySelector('li ul')?.getAttribute('class'), 'sub-menu'); ``` -你應該將你的 `ul` 元素的 `aria-label` 屬性設為 `Apps`。 +你的 `ul` 元素應該有一個 `aria-label` 為 `Apps`。 ```js assert.equal(document.querySelector('li ul')?.getAttribute('aria-label'), 'Apps'); diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-reusable-mega-navbar/6745dce846995b2a466594be.md b/curriculum/challenges/chinese-traditional/blocks/workshop-reusable-mega-navbar/6745dce846995b2a466594be.md index 9c2fa0f93b5..8f5259dd5f8 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-reusable-mega-navbar/6745dce846995b2a466594be.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-reusable-mega-navbar/6745dce846995b2a466594be.md @@ -7,11 +7,11 @@ dashedName: step-9 # --description-- -在你的 `ul.sub-menu` 元素內創建三個新的列表項目。 +在你的 `ul` 元素內創建三個新的 `li` 元素,並將它們的 `className` 設為 `sub-menu`。 # --hints-- -你應該在你的 `ul` 元素中,創建三個具有 `className` 為 `sub-menu` 的新列表項目。 +你應該在你的 `ul` 元素內創建三個新的 `li` 元素,並將它們的 `className` 設為 `sub-menu`。 ```js assert.lengthOf(document.querySelectorAll('.sub-menu li'), 3); diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-reusable-mega-navbar/6745de9ce925b92d72df713a.md b/curriculum/challenges/chinese-traditional/blocks/workshop-reusable-mega-navbar/6745de9ce925b92d72df713a.md index a9867727fed..14670cab01d 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-reusable-mega-navbar/6745de9ce925b92d72df713a.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-reusable-mega-navbar/6745de9ce925b92d72df713a.md @@ -7,11 +7,11 @@ dashedName: step-10 # --description-- -在每個 `li` 元素內,創建一個錨點元素,其 `href` 屬性設為 `#`。 +在每個新的三個 `li` 元素內,創建一個帶有 `href` 屬性為 `#` 的 `a` 元素。 # --hints-- -你應該在每個列表項目內創建一個新的 `a` 元素,並將它的 `href` 屬性設為 `#`。 +你應該在每個新的三個 `li` 元素內創建一個帶有 `href` 屬性為 `#` 的新 `a` 元素。 ```js assert.equal(document.querySelectorAll('li a')[2]?.getAttribute('href'), '#'); diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-reusable-mega-navbar/6745e2aca895c935168e7d91.md b/curriculum/challenges/chinese-traditional/blocks/workshop-reusable-mega-navbar/6745e2aca895c935168e7d91.md index f4872a48d26..de8c6cfe875 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-reusable-mega-navbar/6745e2aca895c935168e7d91.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-reusable-mega-navbar/6745e2aca895c935168e7d91.md @@ -7,25 +7,25 @@ dashedName: step-11 # --description-- -最後,為第一個錨點標籤設定 `Calendar` 的文字,為第二個設定 `Chat`,為第三個設定 `Email`。 +最後,將第一個 `a` 元素的文字設為 `Calendar`,第二個設為 `Chat`,第三個設為 `Email`。 -這樣,你的 mega navbar 組件就完成了! +這樣,你的 `Navbar` 組件就完成了! # --hints-- -你應該為第一個錨點元素設定 `Calendar` 的文字。 +你應該將第一個 `a` 元素的文字設為 `Calendar`。 ```js assert.equal(document.querySelectorAll('li a')[2]?.textContent, 'Calendar'); ``` -你應該為第二個錨點元素設定 `Chat` 的文字。 +你應該將第二個 `a` 元素的文字設為 `Chat`。 ```js assert.equal(document.querySelectorAll('li a')[3]?.textContent, 'Chat'); ``` -你應該為第三個錨點元素設定 `Email` 的文字。 +你應該將第三個 `a` 元素的文字設為 `Email`。 ```js assert.equal(document.querySelectorAll('li a')[4]?.textContent, 'Email'); diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165b.md b/curriculum/challenges/chinese-traditional/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165b.md index 7a063be81cf..7f7eae3d926 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165b.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165b.md @@ -7,7 +7,7 @@ dashedName: step-5 # --description-- -在你的傳回述語中,將空字串取代為具有 `className` 屬性且值為 `flex-container` 的 `div` 元素。 +在 `return` 述語中,將空字串替換為一個 `className` 為 `flex-container` 的 `div` 元素。 # --hints-- @@ -26,7 +26,7 @@ dashedName: step-5 assert.lengthOf(testElem.children, 1); ``` -你的 `div` 應該有一個 `className` 屬性為 `flex-container`。 +你的 `div` 應該有一個 `className` 為 `flex-container`。 ```js const testElem = await __helpers.prepTestComponent(window.index.App); diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165c.md b/curriculum/challenges/chinese-traditional/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165c.md index 4c64a3089aa..f54adccab1b 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165c.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165c.md @@ -7,7 +7,7 @@ dashedName: step-6 # --description-- -現在,將 `Card` 組件放入你的 `App` 組件中。為它的 `name` 屬性設定為 `"Mark"`,`title` 屬性設定為 `"Front-End developer"`,`bio` 設定為 `"I like to work with different front-end technologies and play video games."` +現在,將 `Card` 組件放入你的 `App` 組件中。給它設定 `name` 屬性為 `"Mark"`,`title` 屬性為 `"Front-End developer"`,以及 `bio` 屬性為 `"I like to work with different front-end technologies and play video games."` # --hints-- diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-reusable-profile-card-component/68720c179cd34be6793bfdf6.md b/curriculum/challenges/chinese-traditional/blocks/workshop-reusable-profile-card-component/68720c179cd34be6793bfdf6.md index 9ec6425d49c..3b984b86726 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-reusable-profile-card-component/68720c179cd34be6793bfdf6.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-reusable-profile-card-component/68720c179cd34be6793bfdf6.md @@ -9,7 +9,7 @@ dashedName: step-8 雖然你的應用程式運作如預期,但你通常不會像這樣手動添加多個 `Card` 組件。 -移除 `
` 元素內的三個 `` 組件。在接下來的幾個步驟中,你將創建一個資料陣列並使用 `map()` 函式(程式)來呈現 `Card` 組件,這是在 React 中更常見的方法。 +移除 `
` 元素內的三個 `` 組件。在接下來的幾個步驟中,你將創建一個資料陣列並使用 `map()` 方法來呈現 `Card` 組件,這是在 React 中更常見的做法。 # --hints-- diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-reusable-profile-card-component/68778af56eb5d980a4e2daed.md b/curriculum/challenges/chinese-traditional/blocks/workshop-reusable-profile-card-component/68778af56eb5d980a4e2daed.md index 0d8c07ea419..fca5826e313 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-reusable-profile-card-component/68778af56eb5d980a4e2daed.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-reusable-profile-card-component/68778af56eb5d980a4e2daed.md @@ -30,7 +30,7 @@ const profilesVal = eval(profiles?.value.toString()); assert.isArray(profilesVal); ``` -你的評測陣列應該包含一個物件,其中包含所有必要的屬性:`id`、`name`、`title` 和 `bio`。 +你的 `profiles` 陣列應該包含一個物件,該物件包含所有必要的屬性:`id`、`name`、`title` 和 `bio`。 ```js const explorer = await __helpers.Explorer(code); diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-reusable-profile-card-component/68779156bd3704b727ba5f38.md b/curriculum/challenges/chinese-traditional/blocks/workshop-reusable-profile-card-component/68779156bd3704b727ba5f38.md index 50723e1e511..1df62ef630b 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-reusable-profile-card-component/68779156bd3704b727ba5f38.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-reusable-profile-card-component/68779156bd3704b727ba5f38.md @@ -7,7 +7,7 @@ dashedName: step-10 # --description-- -如你從先前課程所回想,你可以使用 `map` 方法來迭代不同的物件,並動態地呈現組件,如下所示: +如你從之前的課程所記得,你可以使用 `map()` 方法來迭代不同的物件,並動態地呈現組件,像這樣: ```jsx export function App() { diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-reusable-profile-card-component/687799aefd1f2af1704065d0.md b/curriculum/challenges/chinese-traditional/blocks/workshop-reusable-profile-card-component/687799aefd1f2af1704065d0.md index cb0d8c2291e..978be81672e 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-reusable-profile-card-component/687799aefd1f2af1704065d0.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-reusable-profile-card-component/687799aefd1f2af1704065d0.md @@ -23,7 +23,7 @@ dashedName: step-11
``` -`key` 屬性有助於 React 識別哪些項目已更改、新增或移除。這提升了效率並允許更高效的更新。 +`key` 屬性幫助 React 識別哪些項目、條款已更改、新增或移除。這提升了效率、性能,並允許更高效的更新。 更新 `Card` 組件以包含值為 `profile.id` 的 `key` 屬性。 diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-toggle-text-app/67cd46ec4ec904186ad52ba5.md b/curriculum/challenges/chinese-traditional/blocks/workshop-toggle-text-app/67cd46ec4ec904186ad52ba5.md index 60a2e58f451..2963d9b5529 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-toggle-text-app/67cd46ec4ec904186ad52ba5.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-toggle-text-app/67cd46ec4ec904186ad52ba5.md @@ -7,7 +7,7 @@ dashedName: step-3 # --description-- -在你的 `button` 元素下方,添加一個具有 `id` 為 `message` 且文字為 `I love freeCodeCamp!` 的段落元素。 +在你的 `button` 元素下方,添加一個段落元素,並設置一個名為 `message` 的 `id`,文字內容為 `I love freeCodeCamp!`。 # --hints-- @@ -17,7 +17,7 @@ dashedName: step-3 assert.exists(document.querySelector("p")); ``` -你的段落元素應該有一個 `id` 為 `message`。 +你的段落元素應該有一個名為 `message` 的 `id`。 ```js assert.exists(document.getElementById("message")) diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-toggle-text-app/67cd49e05693111a41771f29.md b/curriculum/challenges/chinese-traditional/blocks/workshop-toggle-text-app/67cd49e05693111a41771f29.md index 78316d95b66..780896812a2 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-toggle-text-app/67cd49e05693111a41771f29.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-toggle-text-app/67cd49e05693111a41771f29.md @@ -19,7 +19,7 @@ const [user, setUser] = useState("Jessica"); 創建一個新的狀態變數和設定函式(程式),分別稱為 `isVisible` 和 `setIsVisible`。請記得使用範例中所示的陣列解構語法。 -然後將 `useState` 掛鉤指定初始值為 `false`。 +然後以初始值 `false` 呼叫 `useState` 掛鉤。 # --hints-- diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-toggle-text-app/67cd4fe67813f71c3479e64a.md b/curriculum/challenges/chinese-traditional/blocks/workshop-toggle-text-app/67cd4fe67813f71c3479e64a.md index ea4c71ad50c..0319bf1a908 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-toggle-text-app/67cd4fe67813f71c3479e64a.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-toggle-text-app/67cd4fe67813f71c3479e64a.md @@ -9,7 +9,7 @@ dashedName: step-6 顯示段落文字的一種方法是更改 `useState` 掛鉤的初始值。 -將目前的 `useState` 值從 `false` 更改為 `true`,你應該會看到段落文字現在顯示在螢幕上。 +將 `useState` 的初始值從 `false` 改為 `true`。完成後,你應該會看到段落文字現在已經顯示在螢幕上。 # --hints-- diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-toggle-text-app/67cd525b0e575b1e5abf4c03.md b/curriculum/challenges/chinese-traditional/blocks/workshop-toggle-text-app/67cd525b0e575b1e5abf4c03.md index 137472d735f..d264393b0db 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-toggle-text-app/67cd525b0e575b1e5abf4c03.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-toggle-text-app/67cd525b0e575b1e5abf4c03.md @@ -7,7 +7,7 @@ dashedName: step-9 # --description-- -如前所述,set 函式負責更新狀態。切換布林值狀態時,一種常見的方法是以這種方式更新狀態: +如前所述,set 函式負責更新狀態。在切換布林值狀態時,一種常見的方法是以這種方式更新狀態: ```js const [isUserLoggedIn, setIsUserLoggedIn] = useState(false); @@ -16,7 +16,7 @@ const [isUserLoggedIn, setIsUserLoggedIn] = useState(false); setIsUserLoggedIn(!isUserLoggedIn); ``` -以下範例使用名為 `setIsUserLoggedIn` 的設定函式(程式)來更新使用者的登入狀態。常見做法是使用邏輯 NOT(`!`)運算子在 `true` 和 `false` 之間切換。由於初始值為 `false`,套用 `!` 運算子會將其變更為 `true`。 +上述範例使用名為 `setIsUserLoggedIn` 的 set 函式來更新使用者的登入狀態。通常會使用邏輯非(`!`)運算子在 `true` 和 `false` 之間切換。由於初始值是 `false`,套用 `!` 運算子會將其變成 `true`。 在 `handleToggleVisibility` 函式(程式)內,使用 `setIsVisible` 並透過邏輯非運算子(`!`)來更新可見性狀態。 diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-toggle-text-app/67cd57e96257ed1fabbe4879.md b/curriculum/challenges/chinese-traditional/blocks/workshop-toggle-text-app/67cd57e96257ed1fabbe4879.md index df2ae22b496..65f80146529 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-toggle-text-app/67cd57e96257ed1fabbe4879.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-toggle-text-app/67cd57e96257ed1fabbe4879.md @@ -27,7 +27,7 @@ function handleClick() { # --hints-- -當點擊 `toggle-button` 時,訊息 `"I love freeCodeCamp!"` 應該出現在螢幕上。 +當你點擊 `toggle-button` 時,你的訊息 `I love freeCodeCamp!` 應該會出現在螢幕上。 ```js const abuseState = __helpers.spyOn(React, "useState"); diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-toggle-text-app/67cd5bace629fa219a70aa6d.md b/curriculum/challenges/chinese-traditional/blocks/workshop-toggle-text-app/67cd5bace629fa219a70aa6d.md index 3b110bd60ef..f9c86e9bbec 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-toggle-text-app/67cd5bace629fa219a70aa6d.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-toggle-text-app/67cd5bace629fa219a70aa6d.md @@ -9,7 +9,7 @@ dashedName: step-12 如果你查看主控台,你可能會驚訝地看到 `false` 的值,而不是 `true`。這是因為 React 不會立即更新狀態。狀態只會在下一個呈現週期中更新。 -對於剛接觸 React 的開發者來說,常見的錯誤是在 set 函式(程式)後立即放置主控台述語。因此,當你在建置你的 React 應用程式時,這是需要注意的事項。 +對於剛接觸 React 的開發者來說,在設定函式後立刻放置主控台述語是一個常見錯誤。因此,當你建置 React 應用程式時,這是需要注意的地方。 由於不再需要 `console.log()`,請將它從你的 `handleToggleVisibility` 函式中移除。 diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-toggle-text-app/67cd61c24bfc0a240132fd2f.md b/curriculum/challenges/chinese-traditional/blocks/workshop-toggle-text-app/67cd61c24bfc0a240132fd2f.md index f7021ff9c69..9a4c84da876 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-toggle-text-app/67cd61c24bfc0a240132fd2f.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-toggle-text-app/67cd61c24bfc0a240132fd2f.md @@ -23,14 +23,14 @@ dashedName: step-13 # --hints-- -當 `isVisible` 是 `false` 時,按鈕文字應該顯示為 `Show Message`。 +當 `isVisible` 是 `false` 時,你的按鈕文字應該顯示 `Show Message`。 ```js const btn = document.getElementById("toggle-button"); assert.equal(btn.textContent, "Show Message"); ``` -當 `isVisible` 為 `true` 時,按鈕文字應顯示為 `Hide Message`。 +當 `isVisible` 是 `true` 時,你的按鈕文字應該顯示 `Hide Message`。 ```js const abuseState = __helpers.spyOn(React, "useState"); @@ -246,7 +246,7 @@ export const ToggleApp = () => { const handleToggleVisibility = () => { setIsVisible(!isVisible); - } + }; return (
diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-wildlife-tracker/6999ac171928136168654774.md b/curriculum/challenges/chinese-traditional/blocks/workshop-wildlife-tracker/6999ac171928136168654774.md index 20ad15e87e7..75af35eb4a0 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-wildlife-tracker/6999ac171928136168654774.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-wildlife-tracker/6999ac171928136168654774.md @@ -1,6 +1,6 @@ --- id: 6999ac171928136168654774 -title: 第 6 步驟 +title: 第 6 步 challengeType: 1 dashedName: step-6 --- @@ -42,8 +42,10 @@ assert.isFunction(getSpecies); `getSpecies` 函式應該有一個參數,名為 `animal`。 ```js -const regex = __helpers.functionRegex('getSpecies', ['animal']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { getSpecies } = explorer.allFunctions; +assert.equal(getSpecies?.parameters.length, 1); +assert.equal(getSpecies?.parameters[0].toString(), 'animal'); ``` 你應該將 `getSpecies(tiger)` 輸出到主控台。 diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-wildlife-tracker/6999ad1cdc249e185aaeedbd.md b/curriculum/challenges/chinese-traditional/blocks/workshop-wildlife-tracker/6999ad1cdc249e185aaeedbd.md index 38e114ea19d..a2998b9cc30 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-wildlife-tracker/6999ad1cdc249e185aaeedbd.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-wildlife-tracker/6999ad1cdc249e185aaeedbd.md @@ -49,8 +49,11 @@ assert.isFunction(addHabitat); `addHabitat` 函式應該有兩個參數:`animal` 和 `habitat`。 ```js -const regex = __helpers.functionRegex('addHabitat', ['animal', 'habitat']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { addHabitat } = explorer.allFunctions; +assert.equal(addHabitat?.parameters.length, 2); +assert.equal(addHabitat?.parameters[0].toString(), 'animal'); +assert.equal(addHabitat?.parameters[1].toString(), 'habitat'); ``` `addHabitat` 函式應該傳回更新後的 `animal` 物件。 diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-wildlife-tracker/6999adc72c02812a28c01e31.md b/curriculum/challenges/chinese-traditional/blocks/workshop-wildlife-tracker/6999adc72c02812a28c01e31.md index 40cb63338db..9548d4fb79b 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-wildlife-tracker/6999adc72c02812a28c01e31.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-wildlife-tracker/6999adc72c02812a28c01e31.md @@ -43,8 +43,11 @@ assert.isFunction(updateAge); `updateAge` 函式應該有兩個參數:`animal` 和 `newAge`。 ```js -const regex = __helpers.functionRegex('updateAge', ['animal', 'newAge']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { updateAge } = explorer.allFunctions; +assert.equal(updateAge?.parameters.length, 2); +assert.equal(updateAge?.parameters[0].toString(), 'animal'); +assert.equal(updateAge?.parameters[1].toString(), 'newAge'); ``` `updateAge` 函式應該傳回更新後的 `animal` 物件。 diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-wildlife-tracker/6999b0198d18d402c36cc5fe.md b/curriculum/challenges/chinese-traditional/blocks/workshop-wildlife-tracker/6999b0198d18d402c36cc5fe.md index cdd8a8068af..1b17ddb6692 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-wildlife-tracker/6999b0198d18d402c36cc5fe.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-wildlife-tracker/6999b0198d18d402c36cc5fe.md @@ -1,6 +1,6 @@ --- id: 6999b0198d18d402c36cc5fe -title: 第 10 步驟 +title: 第 10 步 challengeType: 1 dashedName: step-10 --- @@ -45,8 +45,10 @@ assert.isFunction(removeEndangeredStatus); `removeEndangeredStatus` 函式應該有一個參數,名為 `animal`。 ```js -const regex = __helpers.functionRegex('removeEndangeredStatus', ['animal']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { removeEndangeredStatus } = explorer.allFunctions; +assert.equal(removeEndangeredStatus?.parameters.length, 1); +assert.equal(removeEndangeredStatus?.parameters[0].toString(), 'animal'); ``` `removeEndangeredStatus` 函式應該傳回更新後的 `animal` 物件。 diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-wildlife-tracker/6999b07c34c2cde21ee6e1d8.md b/curriculum/challenges/chinese-traditional/blocks/workshop-wildlife-tracker/6999b07c34c2cde21ee6e1d8.md index 6f432aed1f1..0998a2ad2cb 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-wildlife-tracker/6999b07c34c2cde21ee6e1d8.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-wildlife-tracker/6999b07c34c2cde21ee6e1d8.md @@ -49,8 +49,10 @@ assert.isFunction(hasHabitat); `hasHabitat` 函式應該有一個參數,名為 `animal`。 ```js -const regex = __helpers.functionRegex('hasHabitat', ['animal']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { hasHabitat } = explorer.allFunctions; +assert.equal(hasHabitat?.parameters.length, 1); +assert.equal(hasHabitat?.parameters[0].toString(), 'animal'); ``` `hasHabitat` 應該使用 `hasOwnProperty` 方法來檢查 `habitat` 屬性。 diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-wildlife-tracker/6999b0d79ea938edcb032237.md b/curriculum/challenges/chinese-traditional/blocks/workshop-wildlife-tracker/6999b0d79ea938edcb032237.md index a05fb203669..00a59d2e517 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-wildlife-tracker/6999b0d79ea938edcb032237.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-wildlife-tracker/6999b0d79ea938edcb032237.md @@ -45,8 +45,11 @@ assert.isFunction(getProperty); `getProperty` 函式應該有兩個參數:`animal` 和 `propertyName`。 ```js -const regex = __helpers.functionRegex('getProperty', ['animal', 'propertyName']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { getProperty } = explorer.allFunctions; +assert.equal(getProperty?.parameters.length, 2); +assert.equal(getProperty?.parameters[0].toString(), 'animal'); +assert.equal(getProperty?.parameters[1].toString(), 'propertyName'); ``` `getProperty` 應該使用中括號表示法來存取屬性。 diff --git a/curriculum/challenges/chinese-traditional/blocks/workshop-wildlife-tracker/699a00de9f564bb0effaa14d.md b/curriculum/challenges/chinese-traditional/blocks/workshop-wildlife-tracker/699a00de9f564bb0effaa14d.md index 03ff289dfef..e68ee62153a 100644 --- a/curriculum/challenges/chinese-traditional/blocks/workshop-wildlife-tracker/699a00de9f564bb0effaa14d.md +++ b/curriculum/challenges/chinese-traditional/blocks/workshop-wildlife-tracker/699a00de9f564bb0effaa14d.md @@ -44,8 +44,10 @@ assert.isFunction(getAge); `getAge` 函式應該有一個參數,名為 `animal`。 ```js -const regex = __helpers.functionRegex('getAge', ['animal']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { getAge } = explorer.allFunctions; +assert.equal(getAge?.parameters.length, 1); +assert.equal(getAge?.parameters[0].toString(), 'animal'); ``` `getAge` 應該使用點記法存取 `age` 屬性。 diff --git a/curriculum/challenges/chinese/blocks/back-end-development-and-apis-projects/bd7158d8c443edefaeb5bd0f.md b/curriculum/challenges/chinese/blocks/back-end-development-and-apis-projects/bd7158d8c443edefaeb5bd0f.md index 30402af6b5b..aa37f885c24 100644 --- a/curriculum/challenges/chinese/blocks/back-end-development-and-apis-projects/bd7158d8c443edefaeb5bd0f.md +++ b/curriculum/challenges/chinese/blocks/back-end-development-and-apis-projects/bd7158d8c443edefaeb5bd0f.md @@ -50,15 +50,18 @@ dashedName: file-metadata-microservice 当你提交一个文件时,在 JSON 响应中收到文件的 `name`、`type` 和 `size`,以 bytes(字节)为单位。 ```js - const formData = new FormData(); - const fileData = await fetch( - 'https://cdn.freecodecamp.org/weather-icons/01d.png' - ); - const file = await fileData.blob(); - formData.append('upfile', file, 'icon'); + const boundary = 'fccBoundary1234567890'; + const head = + `--${boundary}\r\n` + + 'Content-Disposition: form-data; name="upfile"; filename="icon"\r\n' + + 'Content-Type: image/png\r\n\r\n'; + const body = new Blob([head, new Uint8Array(70), `\r\n--${boundary}--\r\n`]); const data = await fetch(code + '/api/fileanalyse', { method: 'POST', - body: formData + headers: { + 'Content-Type': `multipart/form-data; boundary=${boundary}` + }, + body }); const parsed = await data.json(); assert.property(parsed, 'size'); diff --git a/curriculum/challenges/chinese/blocks/daily-coding-challenges-javascript/6a26df3e2988bcdded204895.md b/curriculum/challenges/chinese/blocks/daily-coding-challenges-javascript/6a26df3e2988bcdded204895.md index 80876c46546..34f5bd86c17 100644 --- a/curriculum/challenges/chinese/blocks/daily-coding-challenges-javascript/6a26df3e2988bcdded204895.md +++ b/curriculum/challenges/chinese/blocks/daily-coding-challenges-javascript/6a26df3e2988bcdded204895.md @@ -25,10 +25,10 @@ assert.equal(calculateHandicap([72, 72, 72], [72, 72, 72]), 0); assert.equal(calculateHandicap([80, 76, 78, 78], [72, 72, 72, 72]), 6); ``` -`calculateHandicap([42, 45, 46, 44], [36, 36, 36, 36])` 应该返回 `8.3`。 +`calculateHandicap([42, 45, 46, 45], [36, 36, 36, 36])` 应该返回 `8.5`。 ```js -assert.equal(calculateHandicap([42, 45, 46, 44], [36, 36, 36, 36]), 8.3); +assert.equal(calculateHandicap([42, 45, 46, 45], [36, 36, 36, 36]), 8.5); ``` `calculateHandicap([85, 80, 76, 79, 82], [72, 72, 72, 71, 71])` 应该返回 `8.8`。 diff --git a/curriculum/challenges/chinese/blocks/daily-coding-challenges-python/6a26df3e2988bcdded204895.md b/curriculum/challenges/chinese/blocks/daily-coding-challenges-python/6a26df3e2988bcdded204895.md index 4a522d6a993..d23d8bba221 100644 --- a/curriculum/challenges/chinese/blocks/daily-coding-challenges-python/6a26df3e2988bcdded204895.md +++ b/curriculum/challenges/chinese/blocks/daily-coding-challenges-python/6a26df3e2988bcdded204895.md @@ -31,12 +31,12 @@ TestCase().assertEqual(calculate_handicap([80, 76, 78, 78], [72, 72, 72, 72]), 6 }}) ``` -`calculate_handicap([42, 45, 46, 44], [36, 36, 36, 36])` 应该返回 `8.3`。 +`calculate_handicap([42, 45, 46, 45], [36, 36, 36, 36])` 应该返回 `8.5`。 ```js ({test: () => { runPython(` from unittest import TestCase -TestCase().assertEqual(calculate_handicap([42, 45, 46, 44], [36, 36, 36, 36]), 8.3)`) +TestCase().assertEqual(calculate_handicap([42, 45, 46, 45], [36, 36, 36, 36]), 8.5)`) }}) ``` diff --git a/curriculum/challenges/chinese/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb928.md b/curriculum/challenges/chinese/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb928.md index 62c6cd6815c..a8a95a36dff 100644 --- a/curriculum/challenges/chinese/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb928.md +++ b/curriculum/challenges/chinese/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb928.md @@ -8,7 +8,7 @@ dashedName: mean-variance-standard-deviation-calculator # --description-- -你将使用我们的 Ona 启动代码在此项目中工作。 +你将使用我们的起始代码完成这个项目。 我们仍在开发Python课程的交互式教学部分 目前,你可以在 freeCodeCamp.org 的 YouTube 频道中通过视频学习到这个项目相关的所有知识 @@ -52,7 +52,8 @@ dashedName: mean-variance-standard-deviation-calculator ## 开发 -在 `mean_var_std.py` 中编写你的代码。开发时,你可以使用 `main.py` 来测试你的代码。为了运行你的代码,在 Ona 终端中输入 `python3 main.py` 并按回车。这将使包含的 CPython 解释器运行 `main.py` 文件。 +在 `mean_var_std.py` 中编写你的代码。开发时,你可以使用 `main.py` 来测试你的代码。 +要运行你的代码,在终端输入 `python3 main.py` 并按回车。这会让内置的 CPython 解释器运行 `main.py` 文件。 ## 测试 diff --git a/curriculum/challenges/chinese/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb929.md b/curriculum/challenges/chinese/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb929.md index f37f9c9afa5..42f33215e6a 100644 --- a/curriculum/challenges/chinese/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb929.md +++ b/curriculum/challenges/chinese/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb929.md @@ -8,7 +8,7 @@ dashedName: demographic-data-analyzer # --description-- -你将使用我们的 Ona 启动代码 来完成这个项目。 +你将使用我们的启动代码来完成这个项目。 我们仍在开发Python课程的交互式教学部分 目前,你可以在 freeCodeCamp.org 的 YouTube 频道中通过视频学习到这个项目相关的所有知识 diff --git a/curriculum/challenges/chinese/blocks/data-analysis-with-python-projects/5e46f7f8ac417301a38fb92a.md b/curriculum/challenges/chinese/blocks/data-analysis-with-python-projects/5e46f7f8ac417301a38fb92a.md index 594310057a3..7e7ba751376 100644 --- a/curriculum/challenges/chinese/blocks/data-analysis-with-python-projects/5e46f7f8ac417301a38fb92a.md +++ b/curriculum/challenges/chinese/blocks/data-analysis-with-python-projects/5e46f7f8ac417301a38fb92a.md @@ -8,7 +8,7 @@ dashedName: medical-data-visualizer # --description-- -你将使用我们的 Ona 启动代码来完成这个项目。 +你将使用我们的起始代码进行这个项目的开发。 我们仍在开发Python课程的交互式教学部分 目前,你可以在 freeCodeCamp.org 的 YouTube 频道中通过视频学习到这个项目相关的所有知识 @@ -26,20 +26,20 @@ dashedName: medical-data-visualizer 文件名:medical_examination.csv -| Feature | Variable Type | Variable | Value Type | +| 特色 | 变量类型 | 变量 | 值类型 | |:-------:|:------------:|:-------------:|:----------:| -| Age | Objective Feature | `age` | int (days) | -| Height | Objective Feature | `height` | int (cm) | -| Weight | Objective Feature | `weight` | float (kg) | -| Gender | Objective Feature | `gender` | categorical code | -| Systolic blood pressure | Examination Feature | `ap_hi` | int | -| Diastolic blood pressure | Examination Feature | `ap_lo` | int | -| Cholesterol | Examination Feature | `cholesterol` | 1: normal, 2: above normal, 3: well above normal | -| Glucose | Examination Feature | `gluc` | 1: normal, 2: above normal, 3: well above normal | -| Smoking | Subjective Feature | `smoke` | binary | -| Alcohol intake | Subjective Feature | `alco` | binary | -| Physical activity | Subjective Feature | `active` | binary | -| Presence or absence of cardiovascular disease | Target Variable | `cardio` | binary | +| 年龄 | 客观特色 | `age` | int(天) | +| 身高 | 客观特色 | `height` | int(厘米) | +| 体重 | 客观特色 | `weight` | float(千克) | +| 性别 | 客观特色 | `gender` | 分类代码 | +| 收缩压 | 检查特色 | `ap_hi` | int | +| 舒张压 | 检查特色 | `ap_lo` | int | +| 胆固醇 | 检查特色 | `cholesterol` | 1:正常,2:高于正常,3:远高于正常 | +| 葡萄糖 | 检查特色 | `gluc` | 1:正常,2:高于正常,3:远高于正常 | +| 吸烟 | 主观特色 | `smoke` | 二元 | +| 饮酒 | 主观特色 | `alco` | 二元 | +| 体力活动 | 主观特色 | `active` | 二元 | +| 心血管疾病的有无 | 目标变量 | `cardio` | 二元 | ## 说明 diff --git a/curriculum/challenges/chinese/blocks/data-analysis-with-python-projects/5e46f802ac417301a38fb92b.md b/curriculum/challenges/chinese/blocks/data-analysis-with-python-projects/5e46f802ac417301a38fb92b.md index e89a040b6b2..c0342e87673 100644 --- a/curriculum/challenges/chinese/blocks/data-analysis-with-python-projects/5e46f802ac417301a38fb92b.md +++ b/curriculum/challenges/chinese/blocks/data-analysis-with-python-projects/5e46f802ac417301a38fb92b.md @@ -8,7 +8,7 @@ dashedName: page-view-time-series-visualizer # --description-- -你将使用我们的 Ona 启动代码来完成这个项目。 +你将使用我们的起始代码进行这个项目的开发。 我们仍在开发Python课程的交互式教学部分 目前,你可以在 freeCodeCamp.org 的 YouTube 频道中通过视频学习到这个项目相关的所有知识 diff --git a/curriculum/challenges/chinese/blocks/data-analysis-with-python-projects/5e4f5c4b570f7e3a4949899f.md b/curriculum/challenges/chinese/blocks/data-analysis-with-python-projects/5e4f5c4b570f7e3a4949899f.md index b89ff9aca29..ccf459d8ffc 100644 --- a/curriculum/challenges/chinese/blocks/data-analysis-with-python-projects/5e4f5c4b570f7e3a4949899f.md +++ b/curriculum/challenges/chinese/blocks/data-analysis-with-python-projects/5e4f5c4b570f7e3a4949899f.md @@ -8,7 +8,7 @@ dashedName: sea-level-predictor # --description-- -你将使用我们的 Ona 公式化代码来完成这个项目。 +你将使用我们的起始代码进行这个项目的开发。 我们仍在开发Python课程的交互式教学部分 目前,你可以在 freeCodeCamp.org 的 YouTube 频道中通过视频学习到这个项目相关的所有知识 diff --git a/curriculum/challenges/chinese/blocks/information-security-projects/5e46f979ac417301a38fb932.md b/curriculum/challenges/chinese/blocks/information-security-projects/5e46f979ac417301a38fb932.md index 4aa8353e701..2d5c2144576 100644 --- a/curriculum/challenges/chinese/blocks/information-security-projects/5e46f979ac417301a38fb932.md +++ b/curriculum/challenges/chinese/blocks/information-security-projects/5e46f979ac417301a38fb932.md @@ -9,7 +9,7 @@ dashedName: port-scanner # --description-- -你将使用我们的 Ona 公式化代码来完成这个项目。 +你将使用我们的起始代码进行这个项目的开发。 我们仍在开发Python课程的交互式教学部分 目前,你可以在 freeCodeCamp.org 的 YouTube 频道中通过视频学习到这个项目相关的所有知识 diff --git a/curriculum/challenges/chinese/blocks/information-security-projects/5e46f983ac417301a38fb933.md b/curriculum/challenges/chinese/blocks/information-security-projects/5e46f983ac417301a38fb933.md index 40a73f7fabb..f26fc2e6e96 100644 --- a/curriculum/challenges/chinese/blocks/information-security-projects/5e46f983ac417301a38fb933.md +++ b/curriculum/challenges/chinese/blocks/information-security-projects/5e46f983ac417301a38fb933.md @@ -9,7 +9,7 @@ dashedName: sha-1-password-cracker # --description-- -你将使用我们的 Ona 公式化代码在此项目中工作。 +你将使用我们的起始代码来完成这个项目。 我们仍在开发Python课程的交互式教学部分 目前,你可以在 freeCodeCamp.org 的 YouTube 频道中通过视频学习到这个项目相关的所有知识 diff --git a/curriculum/challenges/chinese/blocks/lab-availability-table/66b36358ed4f261d64840c24.md b/curriculum/challenges/chinese/blocks/lab-availability-table/66b36358ed4f261d64840c24.md index 89107fdb078..ffdd4446b49 100644 --- a/curriculum/challenges/chinese/blocks/lab-availability-table/66b36358ed4f261d64840c24.md +++ b/curriculum/challenges/chinese/blocks/lab-availability-table/66b36358ed4f261d64840c24.md @@ -13,16 +13,16 @@ demoType: onClick **用户故事:** 1. 你的表格应至少包含三列和五行(包括头部)。 -1. 第一行的单元格应为表头,包含一周的天数。 -1. 第一列的单元格应为表头,具有 `class` 为 `time`,并且其文本应包含时间值。 -1. 所有数据单元格应具有 `class` 为 `available-#`,其中 `#` 是从 `0` 到 `5` 的数字,表示该时间段可用人数。 -1. 你的表格应有一个 `caption` 元素,文本为 `Weekly Meeting Availability Schedule`。 -1. 第一行(星期几)的所有表头单元格应具有 `scope` 属性,值为 `col`。 -1. 第一列(时间单元格)的所有表头单元格应具有 `scope` 属性,值为 `row`。 -1. 所有带有可用性类的数据单元格应有一个 `aria-label` 属性,描述可用性级别(例如,`available-0` 单元格为 `0 available`,`available-1` 单元格为 `1 available`,依此类推,`available-5` 单元格为 `5+ available`)。 -1. 在你的 `:root` 选择器中,应定义六个 CSS 变量,命名为 `--color#`,其中 `#` 是从 `0` 到 `5` 的数字,并为它们赋予颜色值。使用这些变量设置对应 `.available-#` 元素的背景色。 -1. 在你的 `:root` 选择器中,应定义名为 `--solid-border` 和 `--dashed-border` 的 CSS 变量。使用这些变量为数据单元格的底部边框设置样式,根据行的不同交替使用实线和虚线边框。为行赋予 `sharp` 或 `half` 类以进行样式设置。 -1. 你应有一个 `div` 元素,`id` 为 `legend`。它应包含一个文本为 `Availability` 的 `span` 元素和一个 `id` 为 `legend-gradient` 的 `div` 元素。 +1. 第一行应包含表示一周中每天的表头单元格。 +1. 第一列应包含带有 `class` 为 `time` 的表头单元格,单元格文本为时间值。 +1. 所有数据单元格应具有 `class` 为 `available-#`,其中 `#` 是从 `0` 到 `5` 的数字,表示该时间点可用人数。 +1. 你的表格应包含一个 `caption` 元素,文本为 `Weekly Meeting Availability Schedule`。 +1. 第一行(星期几)中的所有表头单元格应具有 `scope` 属性,值为 `col`。 +1. 第一列(时间单元格)中的所有表头单元格应具有 `scope` 属性,值为 `row`。 +1. 所有带有可用性类的数据单元格应具有 `aria-label` 属性,描述可用性级别(例如,`available-0` 单元格为 `0 available`,`available-1` 单元格为 `1 available`,依此类推,`available-5` 单元格为 `5+ available`)。 +1. 在你的 `:root` 选择器中,应定义六个 CSS 变量,命名为 `--color#`,其中 `#` 是从 `0` 到 `5` 的数字,并为它们分别赋予颜色值。使用这些变量设置对应 `.available-#` 元素的背景色。 +1. 在你的 `:root` 选择器中,应定义名为 `--solid-border` 和 `--dashed-border` 的 CSS 变量。使用这些变量为数据单元格的底部边框设置样式,根据行的不同交替使用实线和虚线边框。为行添加 `sharp` 或 `half` 类以应用样式。 +1. 你应有一个 `id` 为 `legend` 的 `div` 元素。它应包含一个文本为 `Availability` 的 `span` 元素和一个 `id` 为 `legend-gradient` 的 `div` 元素。 1. 你应为 `#legend-gradient` 元素设置一个线性渐变,颜色从 `--color0` 到 `--color5` 之间以硬边界过渡。 **注意:**请确保在 HTML 中链接样式表以应用 CSS。 @@ -389,7 +389,7 @@ headers.forEach(header => { 第一列的所有表头单元格应具有 `scope` 属性,值为 `row`。 ```js -const timeHeaders = [...document.querySelectorAll('tr > th:first-child')]; +const timeHeaders = [...document.querySelectorAll('th.time')]; assert.isNotEmpty(timeHeaders); timeHeaders.forEach(header => { assert.equal(header.getAttribute('scope'), 'row'); diff --git a/curriculum/challenges/chinese/blocks/lab-cargo-manifest-validator/69a56b5069ca99f7317e6e19.md b/curriculum/challenges/chinese/blocks/lab-cargo-manifest-validator/69a56b5069ca99f7317e6e19.md index 21d0fcb4226..56c3d791386 100644 --- a/curriculum/challenges/chinese/blocks/lab-cargo-manifest-validator/69a56b5069ca99f7317e6e19.md +++ b/curriculum/challenges/chinese/blocks/lab-cargo-manifest-validator/69a56b5069ca99f7317e6e19.md @@ -11,11 +11,11 @@ dashedName: lab-cargo-manifest-validator 每个货物清单将表现为一个具有以下属性的对象: -- `containerId`:一个正整数,用于标识关联的货物容器。 +- `containerId`:一个正整数,用于标识关联的货物集装箱。 - `destination`:一个非空字串(去除空白后),表示货物的目标目的地。 - `weight`:一个正数,表示货物的重量。 -- `unit`:一个字串,描述货物重量属性的单位(要么是 `"kg"` 表示千克,要么是 `"lb"` 表示磅)。 -- `hazmat`:一个布尔值,指示是否需要处理危险物品。 +- `unit`:一个字串,描述货物 `weight` 属性的单位(要么是千克的 `"kg"`,要么是磅的 `"lb"`)。 +- `hazmat`:一个布尔值,表示是否需要危险物品处理。 货物清单对象示例: @@ -34,13 +34,13 @@ dashedName: lab-cargo-manifest-validator **用户故事:** 1. 你应该实现一个名为 `normalizeUnits` 的函数,带有一个 `manifest` 参数。 - - 该函数不得修改原始清单对象,且必须始终返回一个新对象,其中 `weight` 被规范化为千克,且 `unit` 设置为 `"kg"`。 - - 如果清单对象的重量以磅(`unit: "lb"`)表示,函数应使用近似换算 1 lb = 0.45 kg 将 `weight` 转换为千克,并相应更新 `unit`。 - - 如果重量已经以千克(`unit: "kg"`)表示,则 `weight` 和 `unit` 应保持不变。 + - 该函数不得修改原始 manifest 对象,且必须始终返回一个新对象,其中 `weight` 被规范化为千克,`unit` 被设置为 `"kg"`。 + - 如果 manifest 对象的 `weight` 以磅表示(`unit: "lb"`),函数应使用近似换算 `1 lb = 0.45 kg` 将 `weight` 转换为千克,并相应更新 `unit`。 + - 如果 `weight` 已以千克表示(`unit: "kg"`),则 `weight` 和 `unit` 应保持不变。 2. 你应该实现一个名为 `validateManifest` 的函数,带有一个 `manifest` 参数。 - - 该函数不得修改原始清单对象,且必须始终返回一个新对象。 - - 如果输入的清单有效(没有缺失或无效的属性),函数应返回一个空对象。 - - 如果输入的清单无效,函数应返回一个对象,其中包含每个缺失或无效属性的条目。缺失的属性值应为 `"Missing"`,无效的属性值应为 `"Invalid"`。 + - 该函数不得修改原始 manifest 对象,且必须始终返回一个新对象。 + - 如果输入的 manifest 有效(没有缺失或无效属性),函数应返回一个空对象。 + - 如果输入的 manifest 无效,函数应返回一个对象,包含每个缺失或无效属性的条目。缺失属性的值应为 `"Missing"`,无效属性的值应为 `"Invalid"`。 输入对象缺失 `destination` 属性且 `weight` 属性无效时的示例返回值: @@ -51,12 +51,13 @@ dashedName: lab-cargo-manifest-validator } ``` -3. 你应该实现一个名为 `processManifest` 的函数,带有一个 `manifest` 参数。该函数应记录: - - 如果清单对象有效,先记录 `Validation success: ${containerId}`,然后记录清单的重量(以千克为单位),格式为 `Total weight: ${weight} kg`。为此转换使用 `normalizeUnits()`。 - - 如果清单对象无效,先记录 `Validation error: ${containerId}`,然后记录调用 `validateManifest()` 并传入清单对象后返回的对象。 - **注意:** 这两种情况都应有两次 `console.log()` 调用。 +3. 你应该实现一个名为 `processManifest` 的函数,带有一个 `manifest` 参数。该函数应记录日志: + - 如果 manifest 对象有效,记录 `Validation success: ${containerId}`,然后记录 manifest 的 `weight`(单位为千克),格式为 `Total weight: ${weight} kg`。使用 `normalizeUnits()` 进行此转换。 + - 如果 manifest 对象无效,记录 `Validation error: ${containerId}`,然后记录调用 `validateManifest()` 并传入该 manifest 对象返回的对象。 -**注意:** `normalizeUnits`、`validateManifest` 和 `processManifest` 都不应使用 `const` 声明,因为测试需要重新赋值它们。 +**注意:** 这两种情况都应调用两次 `console.log()`。 + +**注意:** 不要使用 `const` 声明 `normalizeUnits`、`validateManifest` 或 `processManifest`,因为测试需要重新赋值它们。 # --before-each-- @@ -120,7 +121,7 @@ console.log = () => {}; # --hints-- -`normalizeUnits`、`validateManifest` 和 `processManifest` 都不应使用 `const` 声明,因为测试需要重新赋值它们。 +你不应该使用 `const` 声明 `normalizeUnits`、`validateManifest` 或 `processManifest`,因为测试需要重新赋值它们。 ```js assert.doesNotThrow(() => { @@ -140,12 +141,12 @@ assert.equal(params.length, 1); assert.equal(params[0].toString(), 'manifest'); ``` -调用 `normalizeUnits()` 并传入 `{ containerId: 68, destination: "Salinas", weight: 101, unit: "lb", hazmat: true }` 应返回新对象 `{ containerId: 68, destination: "Salinas", weight: 45.45, unit: "kg", hazmat: true }`,且不修改源输入。 +当调用 `{ containerId: 68, destination: "Salinas", weight: 101, unit: "lb", hazmat: true }` 时,你的 `normalizeUnits` 函数应返回新对象 `{ containerId: 68, destination: "Salinas", weight: 45.45, unit: "kg", hazmat: true }`,且不修改原始对象。 ```js const testObj = { containerId: 68, - destination: "Salinas", + destination: "Salinas", weight: 101, unit: "lb", hazmat: true @@ -161,7 +162,7 @@ const expected = { const copy = normalizeUnits(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "normalizeUnits() did not return the expected normalized object"); +assert.deepEqual(copy, expected, "normalizeUnits() did not return the expected normalized object."); assert.notStrictEqual(copy, testObj, "normalizeUnits() should return a new object."); assert.strictEqual(testObj.containerId, 68, "Original object should not be mutated."); assert.strictEqual(testObj.destination, "Salinas", "Original object should not be mutated."); @@ -171,13 +172,13 @@ assert.strictEqual(testObj.hazmat, true, "Original object should not be mutated. assert.equal(Object.keys(testObj).length, 5, "Original object should not be mutated."); ``` -你的 `normalizeUnits` 函数应返回输入清单对象的拷贝,其中 `weight` 被规范化为千克,`unit` 设置为 `"kg"`。使用近似换算 `1 lb = 0.45 kg` 进行重量转换。 +你的 `normalizeUnits` 函数应返回输入 manifest 对象的拷贝,且其 `weight` 被规范化为千克,`unit` 被设置为 `"kg"`。`weight` 转换时使用近似换算 `1 lb = 0.45 kg`。 ```js _validManifests.forEach((obj, i) => { const result = normalizeUnits(obj); - assert.isObject(result, "normalizeUnits should return an object"); - assert.notStrictEqual(result, obj, "normalizeUnits must return a new object, not modify the original"); + assert.isObject(result, "normalizeUnits() should return an object."); + assert.notStrictEqual(result, obj, "normalizeUnits() should return a new object, not mutate the original."); const expectedWeight = obj.unit === "lb" ? obj.weight * 0.45 : obj.weight; const expected = { ...obj, @@ -188,12 +189,12 @@ _validManifests.forEach((obj, i) => { assert.deepEqual( result, expected, - `normalizeUnits did not return the expected normalized object for manifest at index ${i}` + `normalizeUnits() did not return the expected normalized object for manifest at index ${i}.` ); }); ``` -你的 `normalizeUnits` 函数应返回输入 `manifest` 对象的新拷贝,且不修改原始对象。 +你的 `normalizeUnits` 函数应返回输入 manifest 对象的新拷贝,且不修改原始对象。 ```js const original = { @@ -231,12 +232,12 @@ assert.equal(params.length, 1); assert.equal(params[0].toString(), 'manifest'); ``` -调用 `validateManifest()` 并传入 `{ containerId: 1, destination: "Santa Cruz", weight: 304, unit: "kg", hazmat: false }` 应返回新对象 `{}`。 +当调用 `{ containerId: 1, destination: "Santa Cruz", weight: 304, unit: "kg", hazmat: false }` 时,你的 `validateManifest` 函数应返回新的空对象 `{}`。 ```js const testObj = { containerId: 1, - destination: "Santa Cruz", + destination: "Santa Cruz", weight: 304, unit: "kg", hazmat: false @@ -246,16 +247,16 @@ const expected = {}; const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for a valid manifest"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.strictEqual(testObj.containerId, 1, "Original object should not be mutated"); -assert.strictEqual(testObj.destination, "Santa Cruz", "Original object should not be mutated"); -assert.strictEqual(testObj.weight, 304, "Original object should not be mutated"); -assert.strictEqual(testObj.unit, "kg", "Original object should not be mutated"); -assert.strictEqual(testObj.hazmat, false, "Original object should not be mutated"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for a valid manifest."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.strictEqual(testObj.containerId, 1, "Original object should not be mutated."); +assert.strictEqual(testObj.destination, "Santa Cruz", "Original object should not be mutated."); +assert.strictEqual(testObj.weight, 304, "Original object should not be mutated."); +assert.strictEqual(testObj.unit, "kg", "Original object should not be mutated."); +assert.strictEqual(testObj.hazmat, false, "Original object should not be mutated."); ``` -如果输入清单对象有效,你的 `validateManifest` 函数应返回空对象 `{}`。 +如果输入的 manifest 对象有效,你的 `validateManifest` 函数应返回空对象 `{}`。 ```js const solution = {}; @@ -268,7 +269,7 @@ for (const obj of _validManifests) { } ``` -调用 `validateManifest()` 并传入 `{}` 应返回新对象 `{ containerId: "Missing", destination: "Missing", weight: "Missing", unit: "Missing", hazmat: "Missing" }`,且不修改源输入。 +当调用空对象 `{}` 时,你的 `validateManifest` 函数应返回新对象 `{ containerId: "Missing", destination: "Missing", weight: "Missing", unit: "Missing", hazmat: "Missing" }`,且不修改原始对象。 ```js const testObj = {}; @@ -283,12 +284,12 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for missing properties"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.equal(Object.keys(testObj).length, 0, "validateManifest() should return a new object, not mutate the original"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for missing properties."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.equal(Object.keys(testObj).length, 0, "validateManifest() should return a new object, not mutate the original."); ``` -调用 `validateManifest()` 并传入 `{ containerId: null, destination: "Santa Cruz", weight: 304, unit: "kg", hazmat: false }` 应返回新对象 `{ containerId: "Invalid" }`,且不修改源输入。 +当调用 `{ containerId: null, destination: "Santa Cruz", weight: 304, unit: "kg", hazmat: false }` 时,你的 `validateManifest` 函数应返回新对象 `{ containerId: "Invalid" }`,且不修改原始对象。 ```js const testObj = { @@ -305,11 +306,11 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for null containerId"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for null containerId."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); ``` -调用 `validateManifest()` 并传入 `{ containerId: 0, destination: 405, weight: -84, unit: "pounds", hazmat: "no" }` 应返回新对象 `{ containerId: "Invalid", destination: "Invalid", weight: "Invalid", unit: "Invalid", hazmat: "Invalid" }`,且不修改源输入。 +当调用 `{ containerId: 0, destination: 405, weight: -84, unit: "pounds", hazmat: "no" }` 时,你的 `validateManifest` 函数应返回新对象 `{ containerId: "Invalid", destination: "Invalid", weight: "Invalid", unit: "Invalid", hazmat: "Invalid" }`,且不修改原始对象。 ```js const testObj = { @@ -330,16 +331,16 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid properties"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.strictEqual(testObj.containerId, 0, "Original object should not be mutated"); -assert.strictEqual(testObj.destination, 405, "Original object should not be mutated"); -assert.strictEqual(testObj.weight, -84, "Original object should not be mutated"); -assert.strictEqual(testObj.unit, "pounds", "Original object should not be mutated"); -assert.strictEqual(testObj.hazmat, "no", "Original object should not be mutated"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid properties."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.strictEqual(testObj.containerId, 0, "Original object should not be mutated."); +assert.strictEqual(testObj.destination, 405, "Original object should not be mutated."); +assert.strictEqual(testObj.weight, -84, "Original object should not be mutated."); +assert.strictEqual(testObj.unit, "pounds", "Original object should not be mutated."); +assert.strictEqual(testObj.hazmat, "no", "Original object should not be mutated."); ``` -调用 `validateManifest()` 并传入 `{ containerId: -2 }` 应返回新对象 `{ containerId: "Invalid", destination: "Missing", weight: "Missing", unit: "Missing", hazmat: "Missing" }`,且不修改源输入。 +当调用 `{ containerId: -2 }` 时,你的 `validateManifest` 函数应返回新对象 `{ containerId: "Invalid", destination: "Missing", weight: "Missing", unit: "Missing", hazmat: "Missing" }`,且不修改原始对象。 ```js const testObj = { @@ -356,13 +357,13 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.strictEqual(testObj.containerId, -2, "Original object should not be mutated"); -assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.strictEqual(testObj.containerId, -2, "Original object should not be mutated."); +assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated."); ``` -调用 `validateManifest()` 并传入 `{ containerId: 3.50 }` 应返回新对象 `{ containerId: "Invalid", destination: "Missing", weight: "Missing", unit: "Missing", hazmat: "Missing" }`,且不修改源输入。你可以使用 `Number.isInteger()` 来验证整数值。 +当调用 `{ containerId: 3.50 }` 时,你的 `validateManifest` 函数应返回新对象 `{ containerId: "Invalid", destination: "Missing", weight: "Missing", unit: "Missing", hazmat: "Missing" }`,且不修改原始对象。你可以使用 `Number.isInteger()` 来验证整数值。 ```js const testObj = { @@ -379,13 +380,13 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.strictEqual(testObj.containerId, 3.50, "Original object should not be mutated"); -assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.strictEqual(testObj.containerId, 3.50, "Original object should not be mutated."); +assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated."); ``` -调用 `validateManifest()` 并传入 `{ destination: " " }` 应返回新对象 `{ containerId: "Missing", destination: "Invalid", weight: "Missing", unit: "Missing", hazmat: "Missing" }`,且不修改源输入。你可以使用 `String.trim()` 来去除字串中的空白。 +当调用 `{ destination: " " }` 时,你的 `validateManifest` 函数应返回新对象 `{ containerId: "Missing", destination: "Invalid", weight: "Missing", unit: "Missing", hazmat: "Missing" }`,且不修改原始对象。你可以使用 `.trim()` 去除字串中的空白。 ```js const testObj = { @@ -402,13 +403,13 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.strictEqual(testObj.destination, " ", "Original object should not be mutated"); -assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.strictEqual(testObj.destination, " ", "Original object should not be mutated."); +assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated."); ``` -调用 `validateManifest()` 并传入 `{ weight: NaN }` 应返回新对象 `{ containerId: "Missing", destination: "Missing", weight: "Invalid", unit: "Missing", hazmat: "Missing" }`,且不修改源输入。你可以使用 `Number.isNaN()` 来验证 NaN 值。 +当调用 `{ weight: NaN }` 时,你的 `validateManifest` 函数应返回新对象 `{ containerId: "Missing", destination: "Missing", weight: "Invalid", unit: "Missing", hazmat: "Missing" }`,且不修改原始对象。你可以使用 `Number.isNaN()` 来验证 `NaN` 值。 ```js const testObj = { @@ -425,13 +426,13 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.ok(Number.isNaN(testObj.weight), "Original object should not be mutated"); -assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.ok(Number.isNaN(testObj.weight), "Original object should not be mutated."); +assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated."); ``` -如果输入清单对象无效,你的 `validateManifest` 函数应返回描述缺失和/或无效属性的对象。 +如果输入的 manifest 对象无效,你的 `validateManifest` 函数应返回描述缺失和/或无效属性的对象。 ```js const solutions = [ @@ -504,7 +505,7 @@ assert.equal(params.length, 1); assert.equal(params[0].toString(), 'manifest'); ``` -调用 `processManifest()` 并传入 `{ containerId: 55, destination: "Carmel", weight: 400, unit: "lb", hazmat: false }` 应先记录 `"Validation success: 55"`,然后记录 `"Total weight: 180 kg"`。 +当调用 `{ containerId: 55, destination: "Carmel", weight: 400, unit: "lb", hazmat: false }` 时,你的 `processManifest` 函数应先打印 `Validation success: 55`,然后打印 `Total weight: 180 kg`。 ```js const testObj = { @@ -524,8 +525,8 @@ try { ["Validation success: 55"], ["Total weight: 180 kg"] ]; - assert.deepEqual(spy.calls[0], expectedCalls[0], "First log should be the validation success message"); - assert.deepEqual(spy.calls[1], expectedCalls[1], "Second log should be the normalized weight in kg"); + assert.deepEqual(spy.calls[0], expectedCalls[0], "First log should be the validation success message."); + assert.deepEqual(spy.calls[1], expectedCalls[1], "Second log should be the normalized weight in kg."); } catch (err) { assert.fail(err); @@ -534,7 +535,7 @@ try { } ``` -如果输入清单对象有效,你的 `processManifest` 函数应先记录成功消息 `Validation success: ${containerId}`。 +如果输入的 manifest 对象有效,你的 `processManifest` 函数应先打印成功消息 `Validation success: ${containerId}`。 ```js const testObj = { @@ -562,7 +563,7 @@ try { } ``` -如果输入清单对象有效,你的 `processManifest` 函数应使用 `normalizeUnits()` 将其规范化为千克,然后记录:`Total weight: ${weight} kg`。 +你的 `processManifest` 函数应使用 `normalizeUnits()` 将有效的输入 manifest 对象规范化为千克,然后打印 `Total weight: ${weight} kg`。 ```js const testObj = { @@ -590,7 +591,7 @@ try { } ``` -如果输入清单对象有效,你的 `processManifest` 函数应记录带有对象 `containerId` 的成功消息,然后记录对象 `weight`(以千克为单位)。你应使用 `normalizeUnits()` 进行转换,并有两次 `console.log()` 调用。 +如果输入的 manifest 对象有效,你的 `processManifest` 函数应该先记录一条包含对象 `containerId` 的成功消息,然后记录对象以千克为单位的 `weight`。你应该使用 `normalizeUnits()` 进行转换,这应包含两次 `console.log()` 调用。 ```js const originalNormalize = normalizeUnits; @@ -605,7 +606,7 @@ try { assert.isTrue( called, - "processManifest should call normalizeUnits() when the manifest is valid" + "processManifest() should call normalizeUnits() when the manifest is valid." ); } catch (err) { @@ -635,7 +636,7 @@ try { } ``` -调用 `processManifest()` 并传入 `{ containerId: -88, destination: "Soledad", weight: NaN }` 应先记录 `Validation error: -88`,然后记录对象 `{ containerId: "Invalid", weight: "Invalid", unit: "Missing", hazmat: "Missing" }`。 +当调用 `{ containerId: -88, destination: "Soledad", weight: NaN }` 时,你的 `processManifest` 函数应先打印 `Validation error: -88`,然后打印对象 `{ containerId: "Invalid", weight: "Invalid", unit: "Missing", hazmat: "Missing" }`。 ```js const testObj = { @@ -658,8 +659,8 @@ try { }] ]; - assert.deepEqual(spy.calls[0], expectedCalls[0], "First log should be the validation error message"); - assert.deepEqual(spy.calls[1], expectedCalls[1], "Second log should be the validation result object"); + assert.deepEqual(spy.calls[0], expectedCalls[0], "First log should be the validation error message."); + assert.deepEqual(spy.calls[1], expectedCalls[1], "Second log should be the validation result object."); } catch (err) { assert.fail(err); @@ -668,7 +669,7 @@ try { } ``` -调用 `processManifest()` 并传入 `{ destination: "Watsonville", hazmat: true }` 应先记录 `Validation error: undefined`,然后记录对象 `{ containerId: "Missing", weight: "Missing", unit: "Missing" }`。 +当调用 `{ destination: "Watsonville", hazmat: true }` 时,你的 `processManifest` 函数应先打印 `Validation error: undefined`,然后打印对象 `{ containerId: "Missing", weight: "Missing", unit: "Missing" }`。 ```js const testObj = { @@ -689,8 +690,8 @@ try { }] ]; - assert.deepEqual(spy.calls[0], expectedCalls[0], "First log should be the validation error message"); - assert.deepEqual(spy.calls[1], expectedCalls[1], "Second log should be the validation result object"); + assert.deepEqual(spy.calls[0], expectedCalls[0], "First log should be the validation error message."); + assert.deepEqual(spy.calls[1], expectedCalls[1], "Second log should be the validation result object."); } catch (err) { assert.fail(err); @@ -699,7 +700,7 @@ try { } ``` -如果输入清单对象无效,你的 `processManifest` 函数应先记录错误信息 `Validation error: ${containerId}`。 +如果输入的 manifest 对象无效,你的 `processManifest` 函数应先打印错误消息 `Validation error: ${containerId}`。 ```js const spy = __helpers.spyOn(console, "log"); @@ -718,13 +719,13 @@ try { assert.deepEqual(spy.calls[0], expectedCalls[0]); } catch (err) { - assert.fail(err); + assert.fail(err); } finally { spy.restore(); } ``` -如果输入清单对象无效,你的 `processManifest` 函数还应记录调用 `validateManifest()` 并传入原始清单对象后返回的对象。直接调用 `console.log()` 并传入该对象。 +如果输入的 manifest 对象无效,你的 `processManifest` 函数还应打印调用 `validateManifest()` 并传入原始 manifest 对象返回的对象。直接用 `console.log()` 打印返回的对象。 ```js const originalValidate = validateManifest; @@ -740,7 +741,7 @@ try { assert.isTrue( called, - "processManifest should call validateManifest() when the manifest is invalid" + "processManifest() should call validateManifest() when the manifest is invalid." ); } catch (err) { @@ -765,13 +766,13 @@ try { assert.deepEqual(spy.calls[1], expectedCalls[1]); } catch (err) { - assert.fail(err); + assert.fail(err); } finally { spy.restore(); } ``` -如果输入清单对象无效,你的 `processManifest` 函数应记录带有对象 `containerId` 的错误信息,然后记录调用 `validateManifest()` 并传入输入对象后返回的对象。应有两次 `console.log()` 调用。 +如果输入的 manifest 对象无效,你的 `processManifest` 函数应先打印带有对象 `containerId` 的错误消息,然后打印调用 `validateManifest()` 并传入输入对象返回的对象。这应包含两次 `console.log()` 调用。 ```js const originalValidate = validateManifest; @@ -787,7 +788,7 @@ try { assert.isTrue( called, - "processManifest should call validateManifest() when the manifest is invalid" + "processManifest() should call validateManifest() when the manifest is invalid." ); } catch (err) { @@ -812,7 +813,7 @@ try { assert.deepEqual(spy.calls, expectedCalls); } catch (err) { - assert.fail(err); + assert.fail(err); } finally { spy.restore(); } diff --git a/curriculum/challenges/chinese/blocks/lab-digital-pet-game/68c362b379059c388d3874f2.md b/curriculum/challenges/chinese/blocks/lab-digital-pet-game/68c362b379059c388d3874f2.md index 5f5e936ea2a..de04e54aa10 100644 --- a/curriculum/challenges/chinese/blocks/lab-digital-pet-game/68c362b379059c388d3874f2.md +++ b/curriculum/challenges/chinese/blocks/lab-digital-pet-game/68c362b379059c388d3874f2.md @@ -9,7 +9,7 @@ saveSubmissionToDB: true # --description-- -**目标:** 完成以下用户故事并通过所有测试以完成实验。 +**目标:**实现以下用户需求并通过所有测试以完成实验。 **用户故事:** @@ -60,6 +60,7 @@ saveSubmissionToDB: true ```js globalThis._PET_NAME = 'Fitzgerald'; globalThis._clock = __FakeTimers.install(); +window.fetch = () => Promise.resolve({ json: () => Promise.resolve('Cats sleep for around 13 to 16 hours a day.') }); ``` # --after-all-- diff --git a/curriculum/challenges/chinese/blocks/lab-fcc-forum-leaderboard/673c91f0b934834bc4a3ecc2.md b/curriculum/challenges/chinese/blocks/lab-fcc-forum-leaderboard/673c91f0b934834bc4a3ecc2.md index d8c135be7b1..75a6168cca6 100644 --- a/curriculum/challenges/chinese/blocks/lab-fcc-forum-leaderboard/673c91f0b934834bc4a3ecc2.md +++ b/curriculum/challenges/chinese/blocks/lab-fcc-forum-leaderboard/673c91f0b934834bc4a3ecc2.md @@ -50,7 +50,7 @@ API 端点返回的 JSON 结构如下: 请注意 `avatar_template` 值是相对路径:它们以 `/` 开头,并包含一个 `{size}` 占位符,应替换为像素大小。`avatarUrl` 常量保存了当路径为相对路径时需要添加的基础 URL。 -**目标:** 完成以下用户故事并通过所有测试以完成实验。 +**目标:**实现以下用户需求并通过所有测试以完成实验。 **用户故事:** @@ -93,6 +93,68 @@ API 端点返回的 JSON 结构如下: 1. `fetchData` 函数应请求 `forumLatest` 的数据,并调用 `showLatestPosts`,传入解析为 JSON 的响应。 1. 如果获取数据时发生错误,`fetchData` 函数应将错误记录到控制台。你应特别使用 `console.log` 来完成此操作。 +# --before-all-- + +```js +const _testUsers = [ + { + avatar_template: '/user_avatar/QuincyLarson_{size}.png', + id: 6, + name: 'Quincy Larson', + username: 'QuincyLarson' + }, + { + avatar_template: '/user_avatar/jwilkins.oboe_{size}.png', + id: 285941, + name: 'Jessica Wilkins', + username: 'jwilkins.oboe' + }, + { + avatar_template: '/user_avatar/ilenia_{size}.png', + id: 170865, + name: 'Ilenia', + username: 'ilenia' + } +]; + +const _testPosters = [ + { user_id: 6 }, + { user_id: 285941 }, + { user_id: 170865 } +]; + +const _testData = { + users: _testUsers, + topic_list: { + topics: [ + { + bumped_at: '2024-04-15T16:01:26.403Z', + category_id: 1, + id: 684569, + posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], + posts_count: 8, + slug: 'the-freecodecamp-podcast-is-back-now-with-video', + title: 'The freeCodeCamp Podcast is back – now with video', + views: 542 + }, + { + bumped_at: '2024-04-19T13:52:03.523Z', + category_id: 421, + id: 686149, + posters: [{ user_id: 170865 }], + posts_count: 1, + slug: 'problem-with-making-changes-to-styles-js', + title: 'Problem with making changes to styles. (JS)', + views: 9 + } + ] + } +}; + +window.fetch = () => + Promise.resolve({ json: () => Promise.resolve(_testData) }); +``` + # --hints-- 你应该有一个名为 `timeAgo` 的函数,接收一个参数。 @@ -297,31 +359,8 @@ assert.lengthOf(avatars, 2); `avatars` 函数应返回一个字符串,由 `img` 个元素组成,每个元素对应用户数组中找到的发帖者。 ```js -const posters = [{ user_id: 6 }, { user_id: 285941 }, { user_id: 170865 }]; -const users = [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - }, - { id: 20 } -]; +const posters = _testPosters; +const users = [..._testUsers, { id: 20 }]; const actual = avatars(posters, users); const matches = actual.match(/<\s*img\s+.+?>/g); assert.lengthOf(matches, 3); @@ -330,31 +369,8 @@ assert.lengthOf(matches, 3); `avatars` 函数返回的字符串中的每个 `img` 元素应有一个文本为发帖者 `alt` 属性值的 `name`。 ```js -const posters = [{ user_id: 6 }, { user_id: 285941 }, { user_id: 170865 }]; -const users = [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - }, - { id: 20 } -]; +const posters = _testPosters; +const users = [..._testUsers, { id: 20 }]; const actual = avatars(posters, users); const matches = actual.match(/<\s*img\s+.+?>/g); @@ -366,31 +382,8 @@ assert.match(matches[2], /alt=('|")Ilenia\1/); `avatars` 函数应通过访问 `avatar_template` 属性并将 `{size}` 替换为 `30`,设置每个头像的大小。 ```js -const posters = [{ user_id: 6 }, { user_id: 285941 }, { user_id: 170865 }]; -const users = [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - }, - { id: 20 } -]; +const posters = _testPosters; +const users = [..._testUsers, { id: 20 }]; const actual = avatars(posters, users); assert.notMatch(actual, /\{size\}/); assert.lengthOf(actual.match(/_30/g), 3); @@ -399,31 +392,8 @@ assert.lengthOf(actual.match(/_30/g), 3); 每个 `img` 元素应有一个 `src` 属性,值为匹配用户的 `avatar_template`。如果 `avatar_template` 以 `/` 开头,则直接在其前面添加 `avatarUrl`。 ```js -const posters = [{ user_id: 6 }, { user_id: 285941 }, { user_id: 170865 }]; -const users = [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - }, - { id: 20 } -]; +const posters = _testPosters; +const users = [..._testUsers, { id: 20 }]; const actual = avatars(posters, users); const matches = actual.match(/<\s*img\s+.+?>/g); @@ -458,19 +428,15 @@ assert.isFunction(fetchData); 你的 `fetchData` 函数应请求 `https://cdn.freecodecamp.org/curriculum/forum-latest/latest.json` 的数据。 ```js -const testArr = []; -const temp = fetch; +const spy = __helpers.spyOn(window, 'fetch'); try { - fetch = source => { - testArr.push(source); - return temp(source); - }; fetchData(); - assert.deepEqual(testArr, [ + assert.include( + spy.calls.map(call => call[0]), 'https://cdn.freecodecamp.org/curriculum/forum-latest/latest.json' - ]); + ); } finally { - fetch = temp; + spy.restore(); } ``` @@ -521,55 +487,7 @@ async () => { `showLatestPosts` 应将 `#posts-container` 的 inner HTML 设置为由 `tr` 个元素组成的字符串,每个元素对应 `topics` 中的一个项。 ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const pContainer = document.getElementById('posts-container'); pContainer.innerHTML = ''; showLatestPosts(data); @@ -579,55 +497,7 @@ assert.lengthOf(pContainer.querySelectorAll('tr'), 2); `tr` 函数返回的字符串中的每个 `showLatestPosts` 元素应包含 5 个 `td` 元素。 ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const pContainer = document.getElementById('posts-container'); pContainer.innerHTML = ''; showLatestPosts(data); @@ -638,55 +508,7 @@ assert.lengthOf(pContainer.querySelectorAll('tr:last-child>td'), 5); `td` 函数返回的字符串中每个表格行的第一个 `showLatestPosts` 元素应包含两个锚点元素,第一个类名为 `post-title`,`href` 为 `/`,锚点文本为 ``,第二个通过调用 `forumCategory` 并传入 `category_id` 获得。 ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const pContainer = document.getElementById('posts-container'); pContainer.innerHTML = ''; showLatestPosts(data); @@ -731,55 +553,7 @@ assert.equal( `td` 函数返回的字符串中每个表格行的第二个 `showLatestPosts` 元素应包含由 `avatars` 函数调用 `posters` 和 `users` 返回的图像,嵌套在类名为 `div` 的 `avatar-container` 元素内。 ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const pContainer = document.getElementById('posts-container'); pContainer.innerHTML = ''; showLatestPosts(data); @@ -820,55 +594,7 @@ assert.equal(imgs2[0].alt, 'Ilenia'); `td` 函数返回的字符串中每个表格行的第三个 `showLatestPosts` 元素应包含帖子的回复数。_提示:_ 使用 `posts_count - 1`。 ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const pContainer = document.getElementById('posts-container'); pContainer.innerHTML = ''; showLatestPosts(data); @@ -887,55 +613,7 @@ assert.equal( `td` 函数返回的字符串中每个表格行的第四个 `showLatestPosts` 元素应包含帖子的浏览次数。 ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const pContainer = document.getElementById('posts-container'); pContainer.innerHTML = ''; showLatestPosts(data); @@ -954,55 +632,7 @@ assert.equal( `td` 函数返回的字符串中每个表格行的第五个 `showLatestPosts` 元素应包含自上次活动以来经过的时间,由 `timeAgo` 函数生成。 ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const calcTime = time => { const currentTime = new Date(); const lastPost = new Date(time); diff --git a/curriculum/challenges/chinese/blocks/lab-javascript-trivia-bot/66ed41f912d0bb1dc62da5dd.md b/curriculum/challenges/chinese/blocks/lab-javascript-trivia-bot/66ed41f912d0bb1dc62da5dd.md index 98c87878cd1..323d6d14969 100644 --- a/curriculum/challenges/chinese/blocks/lab-javascript-trivia-bot/66ed41f912d0bb1dc62da5dd.md +++ b/curriculum/challenges/chinese/blocks/lab-javascript-trivia-bot/66ed41f912d0bb1dc62da5dd.md @@ -11,17 +11,17 @@ dashedName: lab-javascript-trivia-bot **用户故事:** -1. 你应该输出 `"Hello! I'm your coding fun fact guide!"` 到控制台,作为给用户的问候信息。 -1. 你应该创建三个变量:`botName`, `botLocation` 和 `favoriteLanguage`,分别存储机器人的名称、来自哪里以及最喜欢的编程语言。 -1. 你应该将 `"My name is (botName) and I live on (botLocation)."` 记录到控制台日志中。 -1. 你应该将 `"My favorite programming language is (favoriteLanguage)."` 记录到控制台日志。 -1. 你应该使用 `let` 创建一个 `codingFact` 变量,并赋值一个关于你的机器人最喜欢的编程语言的有趣事实的字串,同时包含 `favoriteLanguage` 变量的使用。 -1. 你应该将 `codingFact` 输出到控制台。 -1. 你应该再次使用 `favoriteLanguage` 变量,将有关机器人最喜欢的语言的新事实重新赋值给 `codingFact` 变量。 -1. 你应该再次将 `codingFact` 输出到控制台。 -1. 你应该使用 `favoriteLanguage` 变量,将有关机器人最喜欢的语言的另一个新事实再次重新赋值给 `codingFact` 变量。 -1. 你应该第三次将 `codingFact` 输出到控制台。 -1. 你应该将 `"It was fun sharing these facts with you. Goodbye! - (botName) from (botLocation)."` 作为机器人告别语句记录到控制台日志中。 +1. 你应该在控制台记录 `"Hello! I'm your coding fun fact guide!"` 作为对用户的问候消息。 +1. 你应该创建三个变量:`botName`、`botLocation` 和 `favoriteLanguage`,分别保存机器人名称、它的所在地和它最喜欢的编程语言。 +1. 你应该在控制台记录 `"My name is (botName) and I live on (botLocation)."`。 +1. 你应该在控制台记录 `"My favorite programming language is (favoriteLanguage)."`。 +1. 你应该使用 `let` 创建一个 `codingFact` 变量,并赋值一个关于机器人最喜欢的编程语言的有趣事实字串,使用 `favoriteLanguage` 变量。 +1. 你应该在控制台记录 `codingFact`。 +1. 你应该重新赋值 `codingFact` 变量为另一个关于机器人最喜欢的编程语言的新事实,仍然使用 `favoriteLanguage` 变量。 +1. 你应该再次在控制台记录 `codingFact`。 +1. 你应该第三次重新赋值 `codingFact` 变量为关于机器人最喜欢的编程语言的第三个事实,仍然使用 `favoriteLanguage` 变量。 +1. 你应该第三次在控制台记录 `codingFact`。 +1. 你应该在控制台记录 `"It was fun sharing these facts with you. Goodbye! - (botName) from (botLocation)."`,作为机器人向用户的告别语。 # --before-each-- @@ -162,7 +162,7 @@ let codingFact = "Did you know that " + favoriteLanguage + " was created in just console.log(codingFact); -codingFact = "Another fun fact: " + favoriteLanguage + "was originally called Mocha!"; +codingFact = "Another fun fact: " + favoriteLanguage + " was originally called Mocha!"; console.log(codingFact); diff --git a/curriculum/challenges/chinese/blocks/lab-mood-board/673b3d6b7ef7318eef926d5a.md b/curriculum/challenges/chinese/blocks/lab-mood-board/673b3d6b7ef7318eef926d5a.md index ad71eadddcb..d891d5caafb 100644 --- a/curriculum/challenges/chinese/blocks/lab-mood-board/673b3d6b7ef7318eef926d5a.md +++ b/curriculum/challenges/chinese/blocks/lab-mood-board/673b3d6b7ef7318eef926d5a.md @@ -16,16 +16,16 @@ demoType: onClick **用户故事:** -1. 你应该创建并导出一个接受三个属性的 `MoodBoardItem` 组件:`color`、`image` 和 `description`。 -2. 你的 `MoodBoardItem` 组件应返回一个带有类 `mood-board-item` 的 `div` 作为其顶层元素。 +1. 你应该创建并导出一个 `MoodBoardItem` 组件,该组件接受三个属性:`color`、`image` 和 `description`。 +2. 你的 `MoodBoardItem` 组件应该返回一个顶层元素为带有 `mood-board-item` 类的 `div`。 3. 你应该使用内联样式将 `.mood-board-item` 元素的背景颜色设置为 `color` 属性的值。 -4. 你应该在 `.mood-board-item` 元素内渲染一个 `img` 元素,类名为 `mood-board-image`,并将其 `src` 属性设置为 `image` 属性的值。 -5. 你应该在 `.mood-board-item` 元素内渲染一个 `h3` 元素,该元素具有 `mood-board-text` 类,其文本为 `description` 属性的值。 -6. 你应该创建并导出一个 `MoodBoard`。 -7. 你的 `MoodBoard` 组件应返回一个 `div` 作为其顶层元素。 -8. 你的 `MoodBoard` 组件应渲染一个带有 `mood-board-heading` 类且文本为 `Destination Mood Board` 的 `h1` 元素。 -9. 你的 `MoodBoard` 组件应渲染一个带有 `mood-board` 类的 `div`。 -10. 你的 `MoodBoard` 组件应在 `.mood-board` 元素内至少渲染三个 `MoodBoardItem` 组件,每个组件应传递具有有效值的 `color`、`image` 和 `description` 属性。 +4. 你应该在 `.mood-board-item` 元素内渲染一个 `img` 元素,该元素带有 `mood-board-image` 类,且其 `src` 属性设置为 `image` 属性的值。 +5. 你应该在 `.mood-board-item` 元素内渲染一个 `h3` 元素,该元素带有 `mood-board-text` 类,且其文本设置为 `description` 属性的值。 +6. 你应该创建并导出一个 `MoodBoard` 组件。 +7. 你的 `MoodBoard` 组件应该返回一个顶层元素为 `div`。 +8. 你的 `MoodBoard` 组件应该渲染一个带有 `mood-board-heading` 类且文本为 `Destination Mood Board` 的 `h1` 元素。 +9. 你的 `MoodBoard` 组件应该渲染一个带有 `mood-board` 类的 `div`。 +10. 你的 `MoodBoard` 组件应该在 `.mood-board` 元素内至少渲染三个 `MoodBoardItem` 组件,每个组件都应传入有效的 `color`、`image` 和 `description` 属性值。 如果你愿意,可以在你的 Mood Board 中使用以下图像: @@ -41,10 +41,10 @@ demoType: onClick 你应该导出一个 `MoodBoardItem` 组件。 ```js -assert.isFunction(window.index.MoodBoardItem, 1); +assert.isFunction(window.index.MoodBoardItem); ``` -你的 `MoodBoardItem` 组件应在其顶层元素返回一个带有 `mood-board-item` 类的 `div`。 +你的 `MoodBoardItem` 组件应该返回一个顶层元素为带有 `mood-board-item` 类的 `div`。 ```js const item = document.getElementsByClassName('mood-board-item')[0]; @@ -52,7 +52,7 @@ assert.exists(item); assert.equal(item.tagName, 'DIV'); ``` -`.mood-board-item` 元素的背景颜色应使用内联样式设置为 `color` 属性的值。 +你应该使用内联样式将 `.mood-board-item` 元素的背景颜色设置为 `color` 属性的值。 ```js const container = await __helpers.prepTestComponent(window.index.MoodBoardItem, { color: "red" }); @@ -83,7 +83,7 @@ assert.equal(item.tagName, 'DIV'); 你应该导出一个 `MoodBoard` 组件。 ```js -assert.isFunction(window.index.MoodBoard, 1); +assert.isFunction(window.index.MoodBoard); ``` 你的 `MoodBoard` 组件应返回一个 `div` 作为其顶层元素。 @@ -102,7 +102,15 @@ assert.equal(heading.tagName, 'H1'); assert.equal(heading.textContent, 'Destination Mood Board'); ``` -你的 `MoodBoard` 组件应至少渲染三个 `MoodBoardItem` 组件,每个组件应传递具有有效值的 `color`、`image` 和 `description` 属性。 +你的 `MoodBoard` 组件应该渲染一个带有 `mood-board` 类的 `div`。 + +```js +const moodboard = document.getElementsByClassName('mood-board')[0]; +assert.exists(moodboard); +assert.equal(moodboard.tagName, 'DIV'); +``` + +你的 `MoodBoard` 组件应该在 `.mood-board` 元素内至少渲染三个 `MoodBoardItem` 组件,每个组件都应传入有效的 `color`、`image` 和 `description` 属性值。 ```js const moodboard = document.getElementsByClassName('mood-board')[0]; diff --git a/curriculum/challenges/chinese/blocks/lab-motorcycle-shop/694175528a794a090ea0ba74.md b/curriculum/challenges/chinese/blocks/lab-motorcycle-shop/694175528a794a090ea0ba74.md index 6415630cf9c..59e071cbabe 100644 --- a/curriculum/challenges/chinese/blocks/lab-motorcycle-shop/694175528a794a090ea0ba74.md +++ b/curriculum/challenges/chinese/blocks/lab-motorcycle-shop/694175528a794a090ea0ba74.md @@ -1,6 +1,6 @@ --- id: 694175528a794a090ea0ba74 -title: Build a Motorcycle Shop +title: 建立摩托车商店 challengeType: 25 dashedName: lab-motorcycle-shop demoType: onClick @@ -35,6 +35,291 @@ demoType: onClick 7. 显示的 `Motorcycle` 元素数量应列在 id 为 `results-number` 的元素内。 8. 过滤器应在 `input` 事件上更新。 +# --before-all-- + +```js +const _testMotorcycles = [ + { + id: '1', + name: 'Ninja H2', + manufacturer: 'Kawasaki', + category: 'Sport', + price: 29000, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-vmoto-stash.jpg', + description: 'Supercharged hypersport with unmatched power', + year: 2024, + created_at: '2024-01-01T00:00:00Z' + }, + { + id: '2', + name: 'Street Triple RS', + manufacturer: 'Triumph', + category: 'Naked', + price: 13500, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-r3.png', + description: 'Agile naked bike with triple-cylinder perfection', + year: 2024, + created_at: '2024-01-02T00:00:00Z' + }, + { + id: '3', + name: 'R1250 GS Adventure', + manufacturer: 'BMW', + category: 'Adventure', + price: 21995, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-vmoto-stash.jpg', + description: 'The ultimate adventure touring machine', + year: 2024, + created_at: '2024-01-03T00:00:00Z' + }, + { + id: '4', + name: 'Panigale V4', + manufacturer: 'Ducati', + category: 'Sport', + price: 28395, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-kawasaki-zx10r.png', + description: 'Italian superbike engineering at its finest', + year: 2024, + created_at: '2024-01-04T00:00:00Z' + }, + { + id: '5', + name: 'Road Glide Special', + manufacturer: 'Harley-Davidson', + category: 'Cruiser', + price: 29999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-vmax.jpg', + description: 'Classic American touring with modern tech', + year: 2024, + created_at: '2024-01-05T00:00:00Z' + }, + { + id: '6', + name: 'MT-09', + manufacturer: 'Yamaha', + category: 'Naked', + price: 9999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-mt7.jpg', + description: 'Lightweight naked bike with crossplane power', + year: 2024, + created_at: '2024-01-06T00:00:00Z' + }, + { + id: '7', + name: 'Africa Twin', + manufacturer: 'Honda', + category: 'Adventure', + price: 14599, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-honda-africa.jpg', + description: 'Legendary adventure bike reborn for modern times', + year: 2024, + created_at: '2024-01-07T00:00:00Z' + }, + { + id: '8', + name: 'Super Duke R', + manufacturer: 'KTM', + category: 'Naked', + price: 18999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-suzuki-sv650.jpg', + description: 'The Beast returns with 180hp of raw power', + year: 2024, + created_at: '2024-01-08T00:00:00Z' + }, + { + id: '9', + name: 'GSX-R1000R', + manufacturer: 'Suzuki', + category: 'Sport', + price: 17199, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-suzuki-gsxr1000.jpg', + description: 'Track-ready sportbike with championship DNA', + year: 2024, + created_at: '2024-01-09T00:00:00Z' + }, + { + id: '10', + name: 'Street Glide', + manufacturer: 'Harley-Davidson', + category: 'Cruiser', + price: 21999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-vmax.jpg', + description: 'Milwaukee-Eight power in a sleek bagger', + year: 2024, + created_at: '2024-01-10T00:00:00Z' + }, + { + id: '11', + name: 'Z H2', + manufacturer: 'Kawasaki', + category: 'Naked', + price: 17000, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-kawasaki-zh2.jpg', + description: 'Supercharged naked bike mayhem', + year: 2024, + created_at: '2024-01-11T00:00:00Z' + }, + { + id: '12', + name: 'Multistrada V4', + manufacturer: 'Ducati', + category: 'Adventure', + price: 22995, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-mt3.jpg', + description: 'Italian style meets adventure capability', + year: 2024, + created_at: '2024-01-12T00:00:00Z' + }, + { + id: '13', + name: 'Speed Triple 1200', + manufacturer: 'Triumph', + category: 'Naked', + price: 16500, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-honda-transalp.jpg', + description: 'British muscle bike with cutting-edge tech', + year: 2024, + created_at: '2024-01-13T00:00:00Z' + }, + { + id: '14', + name: 'S1000RR', + manufacturer: 'BMW', + category: 'Sport', + price: 17295, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-kawasaki-z900a1.jpg', + description: 'German precision in a superbike package', + year: 2024, + created_at: '2024-01-14T00:00:00Z' + }, + { + id: '15', + name: 'MT-07', + manufacturer: 'Yamaha', + category: 'Naked', + price: 7999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-mt7.jpg', + description: 'Best-selling parallel twin for pure fun', + year: 2024, + created_at: '2024-01-15T00:00:00Z' + }, + { + id: '16', + name: 'V-Strom 1050', + manufacturer: 'Suzuki', + category: 'Adventure', + price: 13799, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-benelli-trk702.png', + description: 'Reliable adventure touring on a budget', + year: 2024, + created_at: '2024-01-16T00:00:00Z' + }, + { + id: '17', + name: 'Sportster S', + manufacturer: 'Harley-Davidson', + category: 'Cruiser', + price: 15999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-r3.png', + description: 'Revolution Max engine in a modern cruiser', + year: 2024, + created_at: '2024-01-17T00:00:00Z' + }, + { + id: '18', + name: 'CBR1000RR-R', + manufacturer: 'Honda', + category: 'Sport', + price: 28500, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-honda-cbr500.png', + description: 'Honda racing technology for the street', + year: 2024, + created_at: '2024-01-18T00:00:00Z' + }, + { + id: '19', + name: 'Tiger 900', + manufacturer: 'Triumph', + category: 'Adventure', + price: 14400, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-triumph-tiger900.png', + description: 'Middleweight adventure excellence', + year: 2024, + created_at: '2024-01-19T00:00:00Z' + }, + { + id: '20', + name: '890 Duke R', + manufacturer: 'KTM', + category: 'Naked', + price: 11999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-kawasaki-zx10r.png', + description: 'The Scalpel - precise handling perfection', + year: 2024, + created_at: '2024-01-20T00:00:00Z' + }, + { + id: '21', + name: 'Ninja 400', + manufacturer: 'Kawasaki', + category: 'Sport', + price: 5299, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-vmoto-stash.jpg', + description: 'Perfect entry-level sportbike', + year: 2024, + created_at: '2024-01-21T00:00:00Z' + }, + { + id: '22', + name: 'Scrambler 1200', + manufacturer: 'Triumph', + category: 'Adventure', + price: 13250, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-ducati-scrambler.jpg', + description: 'Modern classic with off-road capability', + year: 2024, + created_at: '2024-01-22T00:00:00Z' + }, + { + id: '23', + name: 'Monster Plus', + manufacturer: 'Ducati', + category: 'Naked', + price: 14295, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-kawasaki-zx10r.png', + description: 'Evolved Monster with V-twin soul', + year: 2024, + created_at: '2024-01-23T00:00:00Z' + }, + { + id: '24', + name: 'CB650R', + manufacturer: 'Honda', + category: 'Naked', + price: 9199, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-kawasaki-z900.png', + description: 'Neo Sports Café styling with inline-four power', + year: 2024, + created_at: '2024-01-24T00:00:00Z' + }, + { + id: '25', + name: 'Low Rider S', + manufacturer: 'Harley-Davidson', + category: 'Cruiser', + price: 17999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-suzuki-vstorm650.jpg', + description: 'Blacked-out cruiser with attitude', + year: 2024, + created_at: '2024-01-25T00:00:00Z' + } +]; + +window.fetch = () => + Promise.resolve({ json: () => Promise.resolve(_testMotorcycles) }); +``` + # --hints-- 你应该有一个名为 `type` 的 `Category`。 @@ -84,16 +369,24 @@ assert.isFunction(fetchMotorcycles); ```js const spy = __helpers.spyOn(window, 'fetch'); -const motorcycles = await fetchMotorcycles(); -assert.strictEqual(spy.calls[0][0].trim(),"https://cdn.freecodecamp.org/curriculum/labs/data/motorcycles.json"); +try { + await fetchMotorcycles(); + assert.strictEqual(spy.calls[0][0].trim(),"https://cdn.freecodecamp.org/curriculum/labs/data/motorcycles.json"); +} finally { + spy.restore(); +} ``` 你应该从 `Motorcycle` 返回一个包含 25 个 `fetchMotorcycles` 对象的承诺。 ```js const spy = __helpers.spyOn(window, 'fetch'); -const motorcycles = await fetchMotorcycles(); -assert.lengthOf(motorcycles,25); +try { + const motorcycles = await fetchMotorcycles(); + assert.lengthOf(motorcycles,25); +} finally { + spy.restore(); +} ``` 你应该有一个名为 `renderMotorcycleCard` 的函数。 diff --git a/curriculum/challenges/chinese/blocks/lab-nth-fibonacci-number-js/7a97b79c096ecb000d03bd36.md b/curriculum/challenges/chinese/blocks/lab-nth-fibonacci-number-js/7a97b79c096ecb000d03bd36.md index afdbb3cb181..abd8dab59c1 100644 --- a/curriculum/challenges/chinese/blocks/lab-nth-fibonacci-number-js/7a97b79c096ecb000d03bd36.md +++ b/curriculum/challenges/chinese/blocks/lab-nth-fibonacci-number-js/7a97b79c096ecb000d03bd36.md @@ -1,15 +1,15 @@ --- id: 7a97b79c096ecb000d03bd36 -title: Build an Nth Fibonacci Number Calculator +title: 构建一个第 N 个斐波那契数计算器 challengeType: 26 dashedName: build-an-nth-fibonacci-number-calculator --- # --description-- -**目标:** 完成以下用户故事并通过所有测试以完成实验。 +**目标:**实现以下用户需求并通过所有测试以完成实验。 -**User Stories:** +**用户故事:** 1. 你应该创建一个名为 `fibonacci` 的函数。 2. 你应该在 `sequence` 函数内定义一个名为 `fibonacci` 的数组,并用 `[0, 1]` 的值初始化它。 @@ -22,20 +22,25 @@ dashedName: build-an-nth-fibonacci-number-calculator 你应该有一个名为 `fibonacci` 的函数。 ```js -assert.isFunction(fibonacci); +const explorer = await __helpers.Explorer(code); +assert.exists(explorer.allFunctions.fibonacci); ``` 你的 `fibonacci` 函数应接受一个参数。 ```js -const params = __helpers.getFunctionParams(fibonacci.toString()); -assert.equal(params.length, 1); +const explorer = await __helpers.Explorer(code); +const { fibonacci } = explorer.allFunctions; +assert.equal(fibonacci?.parameters.length, 1); ``` 你应该在 `sequence` 函数内有一个名为 `fibonacci` 的数组,并用 `[0, 1]` 初始化。 ```js -assert.match(__helpers.removeJSComments(fibonacci.toString()), /(const|let|var)\s+sequence\s*=\s*\[\s*0\s*,\s*1\s*\]/); +const explorer = await __helpers.Explorer(code); +const { fibonacci } = explorer.allFunctions; +const { sequence } = fibonacci?.variables ?? {}; +assert.isTrue(sequence?.value.matches('[0, 1]')); ``` `fibonacci(0)` 应该返回 `0`。 @@ -80,7 +85,7 @@ assert.equal(fibonacci(10), 55); assert.equal(fibonacci(15), 610); ``` -你的代码中不应使用递归。 +你不应该在你的代码中使用递归。 ```js const funcStr = __helpers.removeJSComments(fibonacci.toString()); diff --git a/curriculum/challenges/chinese/blocks/lab-product-showcase/696920c0c98a1ed58eb86293.md b/curriculum/challenges/chinese/blocks/lab-product-showcase/696920c0c98a1ed58eb86293.md index 1e0246c6823..7456567e8bd 100644 --- a/curriculum/challenges/chinese/blocks/lab-product-showcase/696920c0c98a1ed58eb86293.md +++ b/curriculum/challenges/chinese/blocks/lab-product-showcase/696920c0c98a1ed58eb86293.md @@ -421,6 +421,10 @@ assert.isFunction(showProducts); ```js const len = products.items.length; +const books = document.getElementById("books"); +const all = document.getElementById("all"); +const output = document.getElementById("output"); + assert.isAtLeast(len, 3); books.dispatchEvent(new Event("click", { bubbles: true })); all.dispatchEvent(new Event("click", { bubbles: true })); @@ -430,7 +434,11 @@ assert.lengthOf(output.querySelectorAll(".item"), len); 点击 `#books` 按钮应在 `#output` 元素中显示对应的产品集合。 ```js +const books = document.getElementById("books"); +const clothing = document.getElementById("clothing"); +const output = document.getElementById("output"); const len = products.items.length; + assert.isAtLeast(len, 3); let count = 0; products.items.forEach(i => { @@ -446,7 +454,11 @@ assert.lengthOf(output.querySelectorAll(".item"), count); 点击 `#electronics` 按钮应在 `#output` 元素中显示对应的产品集合。 ```js +const electronics = document.getElementById("electronics"); +const clothing = document.getElementById("clothing"); +const output = document.getElementById("output"); const len = products.items.length; + assert.isAtLeast(len, 3); let count = 0; products.items.forEach(i => { @@ -462,7 +474,11 @@ assert.lengthOf(output.querySelectorAll(".item"), count); 点击 `#clothing` 按钮应在 `#output` 元素中显示对应的产品集合。 ```js +const books = document.getElementById("books"); +const clothing = document.getElementById("clothing"); +const output = document.getElementById("output"); const len = products.items.length; + assert.isAtLeast(len, 3); let count = 0; products.items.forEach(i => { @@ -478,6 +494,7 @@ assert.lengthOf(output.querySelectorAll(".item"), count); 页面加载时应默认显示所有产品。使用 `DOMContentLoaded` 事件确保这一点。 ```js +const output = document.getElementById("output"); const len = products.items.length; assert.isAtLeast(len, 3); document.dispatchEvent(new Event("DOMContentLoaded")); diff --git a/curriculum/challenges/chinese/blocks/lab-reusable-footer/673b02b03134b04637bf7055.md b/curriculum/challenges/chinese/blocks/lab-reusable-footer/673b02b03134b04637bf7055.md index b1019438e14..f81edf491f7 100644 --- a/curriculum/challenges/chinese/blocks/lab-reusable-footer/673b02b03134b04637bf7055.md +++ b/curriculum/challenges/chinese/blocks/lab-reusable-footer/673b02b03134b04637bf7055.md @@ -16,7 +16,7 @@ demoType: onClick 2. 你的 `Footer` 组件应返回一个包含所有其他元素的 `footer` 元素。 3. 你的 `footer` 元素应包含: - - 至少三个无序列表,每个列表至少有两项。 +- 至少三个无序列表,每个列表至少有两项。 - 至少包含一个带有版权 `©` 符号的段落元素。 - 至少三个 `href` 值设置为 `#` 且链接内容设置为你选择的图标或文本的链接。 @@ -53,7 +53,7 @@ assert.lengthOf(document.getElementById('root').children, 1); assert.isAtLeast(document.querySelectorAll('ul').length, 3); ``` -你的每个无序列表应至少有两项。 +你的无序列表中的每个列表项应至少有两个项。 ```js const uls = [...document.querySelectorAll('ul')]; @@ -84,7 +84,7 @@ const links = document.querySelectorAll('a[href="#"]'); assert.isAtLeast(links.length, 3); ``` -你的任何链接都不应为空。 +你的链接不能为空。 ```js const links = [...document.querySelectorAll('a[href="#"]')]; diff --git a/curriculum/challenges/chinese/blocks/lab-sentence-maker/66c057041df6394ca796bf33.md b/curriculum/challenges/chinese/blocks/lab-sentence-maker/66c057041df6394ca796bf33.md index 171cebcef30..c28888cf028 100644 --- a/curriculum/challenges/chinese/blocks/lab-sentence-maker/66c057041df6394ca796bf33.md +++ b/curriculum/challenges/chinese/blocks/lab-sentence-maker/66c057041df6394ca796bf33.md @@ -7,7 +7,7 @@ dashedName: build-a-sentence-maker # --description-- -在本实验中,你将使用句子模板创建两个不同的故事。 你将使用变量来存储故事的不同部分,然后将故事输出到控制台。 +在本实验中,你将使用句子模板创建两个不同的故事。你将使用变量保存故事的不同部分,然后将故事日志输出到控制台。 **目标:**实现以下用户需求并通过所有测试以完成实验。 @@ -26,19 +26,26 @@ dashedName: build-a-sentence-maker 1. 你应该声明一个 `firstStory` 变量。 -1. 你应使用以下故事模板创建第一个故事,并将其分配给 `firstStory` 变量:`"Once upon a time, there was a(n) [adjective] [noun] who loved to eat [noun2]. The [noun] lived in a [place] and had [adjective2] nostrils that blew fire when it was [verb]."`; +1. 你应该使用以下故事模板创建第一个故事,并将其赋值给 `firstStory` 变量:`"Once upon a time, there was a(n) [adjective] [noun] who loved to eat [noun2]. The [noun] lived in a [place] and had [adjective2] nostrils that blew fire when it was [verb]."` -1. 你应该将第一个故事输出到控制台,使用的信息是 `"First story: [firstStory]"`。 +1. 你应该使用消息 `"First story: [firstStory]"` 将第一个故事日志输出到控制台。 1. 你应该为 `adjective`、`noun`、`verb`、`place`、`adjective2` 和 `noun2` 变量重新赋值。 1. 你应该声明一个 `secondStory` 变量。 -1. 使用相同的模板创建另一个故事,并将其赋值给 `secondStory` 变量。 +1. 你应该使用相同的模板创建另一个故事,并将其赋值给 `secondStory` 变量。 -1. 你应该将第二个故事输出到控制台,使用的信息是 `"Second story: [secondStory]"`。 +1. 你应该使用消息 `"Second story: [secondStory]"` 将第二个故事日志输出到控制台。 +# --before-each-- + +```js +const spy = __helpers.spyOn(console, 'log'); +const getLogs = () => spy.calls.map(call => call.join(' ')); +``` + # --hints-- 你应该声明一个 `adjective` 变量。 @@ -142,12 +149,10 @@ assert.match( ); ``` -你应该将第一个故事输出到控制台,使用的信息是 `"First story: [firstStory]"`。 +你应该使用消息 `"First story: [firstStory]"` 将第一个故事日志输出到控制台。 ```js -const condition1 = /console\.log\(\s*["']First\s+story:\s+["']\s*\+\s*firstStory\s*\);?/gm.test(code); -const condition2 = /console\.log\(\s*`First\s+story:\s+\$\{firstStory\}`\s*\);?/gm.test(code); -assert.isTrue(condition1 || condition2); +assert.include(getLogs(), `First story: ${firstStory}`); ``` 你应该声明一个 `secondStory` 变量。 @@ -208,15 +213,13 @@ assert.match( ); ``` -你应该将第二个故事输出到控制台,使用的格式是 `"Second story: [secondStory]"`。 +你应该使用消息 `"Second story: [secondStory]"` 将第二个故事日志输出到控制台。 ```js -const condition1 = /console\.log\(\s*["']Second\s+story:\s+["']\s*\+\s*secondStory\s*\);?/gm.test(code); -const condition2 = /console\.log\(\s*`Second\s+story:\s+\$\{secondStory\}`\s*\);?/gm.test(code); -assert.isTrue(condition1 || condition2); +assert.include(getLogs(), `Second story: ${secondStory}`); ``` -`firstStory` 不能和 `secondStory` 相同。 +你的 `firstStory` 不应与 `secondStory` 相同。 ```js assert.notEqual(firstStory, secondStory); diff --git a/curriculum/challenges/chinese/blocks/lab-weather-app/66f12a88741aeb16b9246c59.md b/curriculum/challenges/chinese/blocks/lab-weather-app/66f12a88741aeb16b9246c59.md index d3f0259a49e..c7b84f6f91d 100644 --- a/curriculum/challenges/chinese/blocks/lab-weather-app/66f12a88741aeb16b9246c59.md +++ b/curriculum/challenges/chinese/blocks/lab-weather-app/66f12a88741aeb16b9246c59.md @@ -333,7 +333,7 @@ assert.strictEqual( ); ``` -在 `select` 元素内应有 6 个 `option` 元素,每个对应以下城市之一:巴黎、伦敦、东京、洛杉矶、芝加哥、纽约。 +除了第一个空的选项外,`select` 元素还应包含 6 个 `option` 元素,分别对应以下城市:巴黎、伦敦、东京、洛杉矶、芝加哥、纽约。 ```js ['Paris', 'London', 'Tokyo', 'Los Angeles', 'Chicago', 'New York'].forEach( @@ -342,7 +342,7 @@ assert.strictEqual( `select > option[value="${city.toLowerCase()}"]` ); assert.exists(el); - assert.strictEqual(el.innerText.trim(), city); + assert.strictEqual(el.textContent.trim(), city); } ); ``` diff --git a/curriculum/challenges/chinese/blocks/learn-about-speculation-and-requests/67eff6af42e8c425d9ff28e3.md b/curriculum/challenges/chinese/blocks/learn-about-speculation-and-requests/67eff6af42e8c425d9ff28e3.md index 368d4793829..35140aa946b 100644 --- a/curriculum/challenges/chinese/blocks/learn-about-speculation-and-requests/67eff6af42e8c425d9ff28e3.md +++ b/curriculum/challenges/chinese/blocks/learn-about-speculation-and-requests/67eff6af42e8c425d9ff28e3.md @@ -32,7 +32,7 @@ lang: en-US - `Your software is up to date.` - 该软件已安装所有最新更新。 -- `Is your resume up to date?` - 他们在询问简历是否包含此人的最新经历。 +- `Is your resume up to date?` - 他们在问简历是否包含此人的最新经历。 # --scene-- diff --git a/curriculum/challenges/chinese/blocks/learn-basic-css-by-building-a-cafe-menu/5f3ef6e03d719d5ac4738993.md b/curriculum/challenges/chinese/blocks/learn-basic-css-by-building-a-cafe-menu/5f3ef6e03d719d5ac4738993.md index fedc5928ea9..2304a05c46b 100644 --- a/curriculum/challenges/chinese/blocks/learn-basic-css-by-building-a-cafe-menu/5f3ef6e03d719d5ac4738993.md +++ b/curriculum/challenges/chinese/blocks/learn-basic-css-by-building-a-cafe-menu/5f3ef6e03d719d5ac4738993.md @@ -7,7 +7,7 @@ dashedName: step-56 # --description-- -菜单的当前宽度将总是占到 `body` 元素宽度的80%。 在一个非常宽的屏幕上,咖啡和甜点看起来与它们的价格相差甚远。 +菜单当前的宽度始终占据 `body` 元素宽度的 `80%`。在非常宽的屏幕上,咖啡和甜点与它们的价格看起来相距很远。 给 `menu` 类添加一个 `max-width` 的属性,其值为 `500px`,以防止它变得太宽。 diff --git a/curriculum/challenges/chinese/blocks/learn-present-perfect-while-talking-about-accessibility/671b98e9b7c4854e93044e64.md b/curriculum/challenges/chinese/blocks/learn-present-perfect-while-talking-about-accessibility/671b98e9b7c4854e93044e64.md index 4f81ee8041f..3cbaf05628c 100644 --- a/curriculum/challenges/chinese/blocks/learn-present-perfect-while-talking-about-accessibility/671b98e9b7c4854e93044e64.md +++ b/curriculum/challenges/chinese/blocks/learn-present-perfect-while-talking-about-accessibility/671b98e9b7c4854e93044e64.md @@ -62,7 +62,7 @@ lang: en-US "startTime": 5.34, "finishTime": 9.26, "dialogue": { - "text": "Yes, for some reason it hasn't been displaying correctly for some users.", + "text": "Yes. For some reason, it hasn't been displaying correctly for some users.", "align": "right" } }, diff --git a/curriculum/challenges/chinese/blocks/learn-present-perfect-while-talking-about-accessibility/671f403c1d4e8a5e046065a0.md b/curriculum/challenges/chinese/blocks/learn-present-perfect-while-talking-about-accessibility/671f403c1d4e8a5e046065a0.md index ffce68ceb54..e6d2b9a364a 100644 --- a/curriculum/challenges/chinese/blocks/learn-present-perfect-while-talking-about-accessibility/671f403c1d4e8a5e046065a0.md +++ b/curriculum/challenges/chinese/blocks/learn-present-perfect-while-talking-about-accessibility/671f403c1d4e8a5e046065a0.md @@ -6,7 +6,7 @@ dashedName: task-36 lang: en-US --- -<!-- (Audio) James: Yes. For some reason, It hasn't been displaying correctly for some users. --> +<!-- (Audio) James: Yes. For some reason, it hasn't been displaying correctly for some users. --> # --instructions-- @@ -16,7 +16,7 @@ lang: en-US ## --sentence-- -`Yes. For some reason, It BLANK BLANK BLANK correctly for some users.` +`Yes. For some reason, it BLANK BLANK BLANK correctly for some users.` ## --blanks-- @@ -83,7 +83,7 @@ lang: en-US "startTime": 1, "finishTime": 4.92, "dialogue": { - "text": "Yes, for some reason it hasn't been displaying correctly for some users.", + "text": "Yes. For some reason, it hasn't been displaying correctly for some users.", "align": "center" } }, diff --git a/curriculum/challenges/chinese/blocks/learn-present-perfect-while-talking-about-accessibility/671f456994635c6085054cbd.md b/curriculum/challenges/chinese/blocks/learn-present-perfect-while-talking-about-accessibility/671f456994635c6085054cbd.md index 02354e84082..a1434843ac9 100644 --- a/curriculum/challenges/chinese/blocks/learn-present-perfect-while-talking-about-accessibility/671f456994635c6085054cbd.md +++ b/curriculum/challenges/chinese/blocks/learn-present-perfect-while-talking-about-accessibility/671f456994635c6085054cbd.md @@ -6,7 +6,7 @@ dashedName: task-37 lang: en-US --- -<!-- (Audio) James: Yes. For some reason, It hasn't been displaying correctly for some users. --> +<!-- (Audio) James: Yes. For some reason, it hasn't been displaying correctly for some users. --> # --instructions-- @@ -16,7 +16,7 @@ lang: en-US ## --sentence-- -`Yes. For some reason, It hasn't been displaying BLANK for some BLANK.` +`Yes. For some reason, it hasn't been displaying BLANK for some BLANK.` ## --blanks-- @@ -79,7 +79,7 @@ lang: en-US "startTime": 1, "finishTime": 4.92, "dialogue": { - "text": "Yes, for some reason it hasn't been displaying correctly for some users.", + "text": "Yes. For some reason, it hasn't been displaying correctly for some users.", "align": "center" } }, diff --git a/curriculum/challenges/chinese/blocks/learn-present-perfect-while-talking-about-accessibility/6720cf38beae8c4f1d7af1c0.md b/curriculum/challenges/chinese/blocks/learn-present-perfect-while-talking-about-accessibility/6720cf38beae8c4f1d7af1c0.md index 4bab8c04d59..4e1f32904fc 100644 --- a/curriculum/challenges/chinese/blocks/learn-present-perfect-while-talking-about-accessibility/6720cf38beae8c4f1d7af1c0.md +++ b/curriculum/challenges/chinese/blocks/learn-present-perfect-while-talking-about-accessibility/6720cf38beae8c4f1d7af1c0.md @@ -22,7 +22,7 @@ lang: en-US `Alice: James, have you heard about the BLANK on our video platform?` -`James: Yes. For some reason, It hasn't been BLANK for some users. The captions are misaligned and BLANK, which isn't good for accessibility.` +`James: Yes. For some reason, it hasn't been BLANK for some users. The captions are misaligned and BLANK, which isn't good for accessibility.` `Alice: Exactly. Do you know if it's been affecting all the videos or just a few?` diff --git a/curriculum/challenges/chinese/blocks/lecture-css-specificity-the-cascade-algorithm-and-inheritance/672aa62178d5ff57fe4f98e0.md b/curriculum/challenges/chinese/blocks/lecture-css-specificity-the-cascade-algorithm-and-inheritance/672aa62178d5ff57fe4f98e0.md index 925577ba124..9b3a2ccd03c 100644 --- a/curriculum/challenges/chinese/blocks/lecture-css-specificity-the-cascade-algorithm-and-inheritance/672aa62178d5ff57fe4f98e0.md +++ b/curriculum/challenges/chinese/blocks/lecture-css-specificity-the-cascade-algorithm-and-inheritance/672aa62178d5ff57fe4f98e0.md @@ -43,14 +43,14 @@ p { ```html <link rel="stylesheet" href="styles.css"> -<p id="para">Red paragraph</p> +<p id="para-1">Red paragraph</p> <p>Other paragraph</p> <p>Another paragraph</p> <p>Yet another paragraph</p> ``` ```css -#para { +#para-1 { color: red; } @@ -67,24 +67,33 @@ p { **注意**:你将在后续课程中学习更多关于伪类的内容。 -在这个例子中,第一个段落将是红色,因为 ID 选择器的特异性高于类选择器和类型选择器。`.example-para` 元素的颜色将是绿色,而其余的段落元素颜色将是蓝色。 +下面为例: + +- 第一个段落将是红色,因为 ID 选择器的特异性高于类选择器和类型选择器。 +- 第二个带有类选择器 `.example-para` 的段落将是绿色。 +- 第三个同时带有 ID 选择器 `#para-3` 和类选择器 `.example-para` 的段落将是紫色。 +- 其余的段落元素将是蓝色。 :::interactive_editor ```html <link rel="stylesheet" href="styles.css"> -<p id="para">Example paragraph</p> +<p id="para-1">Example paragraph</p> <p class="example-para">Other paragraph</p> -<p class="example-para">Another paragraph</p> +<p id="para-3" class="example-para">Another paragraph</p> <p>Yet another paragraph</p> ``` ```css -#para { +#para-1 { color: red; } +#para-3 { + color: purple; +} + .example-para { color: green; } @@ -105,13 +114,13 @@ p { ```html <link rel="stylesheet" href="styles.css"> -<p id="para">Example paragraph</p> +<p id="para-1">Example paragraph</p> <p>Other paragraph</p> <p>Yet another paragraph</p> ``` ```css -#para { +#para-1 { color: red; } @@ -130,7 +139,7 @@ p { ```html <link rel="stylesheet" href="styles.css"> -<p id="para">Example paragraph</p> +<p id="para-1">Example paragraph</p> <p>Other paragraph</p> <p>Yet another paragraph</p> ``` @@ -140,7 +149,7 @@ p { color: red; } -#para { +#para-1 { color: green; } diff --git a/curriculum/challenges/chinese/blocks/lecture-express-middleware/69f42d414b7626e21a922794.md b/curriculum/challenges/chinese/blocks/lecture-express-middleware/69f42d414b7626e21a922794.md index 73c318578c5..77a5a586821 100644 --- a/curriculum/challenges/chinese/blocks/lecture-express-middleware/69f42d414b7626e21a922794.md +++ b/curriculum/challenges/chinese/blocks/lecture-express-middleware/69f42d414b7626e21a922794.md @@ -9,9 +9,7 @@ dashedName: what-is-error-handling-middleware Express 中的错误处理中间件是一种特殊类型的中间件,用于处理请求-响应周期中发生的错误。它对于捕获意外错误、记录错误以及向客户提供适当的响应至关重要。 -正如你在之前关于错误处理的课程中看到的,Express 的错误处理中间件有四个参数:`err`、`req`、`res` 和 `next`。当错误被传递给 `next()` 函数时,会调用这个中间件。 - -这里再次提醒一下它的语法: +Express 的误差处理中间件有四个参数:`err`、`req`、`res` 和 `next`。当错误被传递给 `next()` 函数时,会调用这个中间件。语法如下: ```js app.use((err, req, res, next) => { @@ -92,7 +90,7 @@ app.listen(3000, () => { ## --answers-- -`err`、`req`、`res`、`next`。 +`err`, `req`, `res`, `next`. --- diff --git a/curriculum/challenges/chinese/blocks/lecture-express-middleware/69f42d414b7626e21a922795.md b/curriculum/challenges/chinese/blocks/lecture-express-middleware/69f42d414b7626e21a922795.md index 4b7c1964887..c6b2f0fc050 100644 --- a/curriculum/challenges/chinese/blocks/lecture-express-middleware/69f42d414b7626e21a922795.md +++ b/curriculum/challenges/chinese/blocks/lecture-express-middleware/69f42d414b7626e21a922795.md @@ -13,45 +13,45 @@ Express 提供了一系列内置中间件函数,帮助执行常见任务,比 1. `express.json()`:一个内置中间件,用于解析传入的 JSON 负载。 -```js -app.use(express.json()) -``` + ```js + app.use(express.json()) + ``` 1. `express.static()`:用于提供静态文件服务的中间件,比如图像、CSS 和 JavaScript 文件。 -```js -app.use(express.static('public')) -``` + ```js + app.use(express.static('public')) + ``` 1. `express.urlencoded()`:一个解析传入 URL 编码负载的中间件,这种格式通常由超文本标记语言表单发送。它会将解析后的数据放在 `req.body` 上。 -```js -app.use(express.urlencoded({ extended: true })) -``` + ```js + app.use(express.urlencoded({ extended: true })) + ``` **现在,以下是一些第三方中间件的示例:** 1. `cors`:一个流行的第三方中间件,用于启用跨域资源共享。 -```bash -npm install cors -``` + ```bash + npm install cors + ``` -```js -const cors = require('cors') -app.use(cors()) -``` + ```js + const cors = require('cors') + app.use(cors()) + ``` 1. `morgan`:一个用于 HTTP 请求的日志中间件。 -```bash -npm install morgan -``` + ```bash + npm install morgan + ``` -```js -const morgan = require('morgan') -app.use(morgan('tiny')) -``` + ```js + const morgan = require('morgan') + app.use(morgan('tiny')) + ``` 现在,让我们看一个同时使用内置和第三方中间件的示例: diff --git a/curriculum/challenges/chinese/blocks/lecture-importance-of-semantic-html/672990ecf71a852804ababe7.md b/curriculum/challenges/chinese/blocks/lecture-importance-of-semantic-html/672990ecf71a852804ababe7.md index bac3630a5e6..aa28399e1b3 100644 --- a/curriculum/challenges/chinese/blocks/lecture-importance-of-semantic-html/672990ecf71a852804ababe7.md +++ b/curriculum/challenges/chinese/blocks/lecture-importance-of-semantic-html/672990ecf71a852804ababe7.md @@ -11,6 +11,10 @@ dashedName: what-is-the-difference-between-presentational-and-semantic-html 许多表现性 HTML 元素已被弃用,这意味着它们已经过时,不再被推荐使用。 有更好的方法可以达到同样的效果。 不过,知道它们的存在还是很有帮助的,所以我们来看一些例子。 +## 表现型 HTML 元素 + +### `font` 元素 + `font` 元素是一个废弃的元素,用于设置文本的字体大小和颜色。以下是一个 `font` 元素的示例。 启用交互式编辑器并将大小从 5 改为 7 以查看字体增大。 @@ -27,6 +31,8 @@ dashedName: what-is-the-difference-between-presentational-and-semantic-html 虽然该元素仍然有效,但你不应该使用它,因为字体大小和颜色应始终在 CSS 中设置,而不是在 HTML 中设置。 +### `center` 元素 + `center` 元素是另一个废弃的元素,用于在其容器内水平居中内容。以下是包含文本和段落元素的 `center` 元素示例。 启用交互式编辑器,并为 `<p>Another example text.</p>` 添加 `center` 标签,以便在页面上居中显示。 @@ -44,6 +50,8 @@ dashedName: what-is-the-difference-between-presentational-and-semantic-html ::: +### `big` 元素 + 接下来是 `big` 元素。 这是另一个已被弃用的表现性 HTML 元素,它能使被括入的文本比周围的文本大一级。 Here we have an example that defines a paragraph with two parts. 启用交互式编辑器,为 `Some other text` 添加 `big` 标签,并在预览窗口中查看更改。 @@ -64,6 +72,8 @@ dashedName: what-is-the-difference-between-presentational-and-semantic-html 这些都是表现性 HTML 元素的例子。 但它们都已过时,不再推荐使用。 那么,应该用什么呢? 让我们看看。 +## 语义化 HTML + 现在,语义化 HTML 已成为推荐做法。 它描述了元素的内容,因此更易于阅读、理解和维护。 当你使用语义化 HTML 时,搜索引擎就能轻松理解你的网站。 这对无障碍访问也很有帮助,因为屏幕阅读器需要语义化信息来描述网页上的内容。 @@ -75,6 +85,8 @@ dashedName: what-is-the-difference-between-presentational-and-semantic-html - `section` 元素用于分组相关信息。 - `figure` 元素用于插图和图表。 +### 语义化 HTML 示例 + 这是一个包含导航区元素的 `header` 元素示例。 启用交互式编辑器,并在 `nav` 内添加 `<a href="#">Products</a>`,然后在预览窗口中查看更改。 @@ -97,6 +109,8 @@ dashedName: what-is-the-difference-between-presentational-and-semantic-html 语义化元素清楚地显示了它们在 HTML 结构中的作用。 有许多不同的语义化 HTML 元素。 你一定能找到适合你项目需求的元素。 +## 总结 + 很好。 现在你知道了表现性 HTML 和语义化 HTML 的区别:语义化 HTML 描述的是内容,而表现性 HTML 侧重于外观。 # --questions-- diff --git a/curriculum/challenges/chinese/blocks/lecture-introduction-to-javascript-libraries-and-frameworks/6734e88cc46e6dc679420040.md b/curriculum/challenges/chinese/blocks/lecture-introduction-to-javascript-libraries-and-frameworks/6734e88cc46e6dc679420040.md index 61c5fe00ffe..2e1140702b3 100644 --- a/curriculum/challenges/chinese/blocks/lecture-introduction-to-javascript-libraries-and-frameworks/6734e88cc46e6dc679420040.md +++ b/curriculum/challenges/chinese/blocks/lecture-introduction-to-javascript-libraries-and-frameworks/6734e88cc46e6dc679420040.md @@ -13,7 +13,7 @@ dashedName: what-is-vite-and-how-can-it-be-used-to-set-up-a-new-react-project 要用 Vite 创建一个新项目,你需要使用命令行。如果你使用的是 Windows 电脑,可以使用命令提示符或 Windows PowerShell。如果你使用的是 Mac,则可以使用终端应用程序。 -如果你还没有安装 Node.js,而它是 npm 正常工作的必要条件,这里有一个官方 Node.js 网页的链接:https://nodejs.org。按照安装说明操作,然后回来继续你的 React 安装。 +如果你还没有安装 Node.js,而它是 npm 正常工作的必要条件,这里有一个官方 Node.js 网页的链接:[nodejs.org](https://nodejs.org)。按照安装说明操作,然后回来继续你的 React 安装。 一旦你打开了命令行,你就可以使用以下命令: @@ -36,7 +36,7 @@ npm install `cd my-react-app` 命令确保你切换到项目所在的正确目录。 -`npm install` 命令用于安装正确运行你的 React 项目所需的依赖项。依赖项是你的 React 项目为了正常运行所需的库或包,例如 React 本身、ReactDOM,或提供额外功能性的其他第三方包。 +`npm install` 命令用于安装正确运行你的 React 项目所需的依赖。依赖是你的 React 项目为了正常运行所需要的库或包,比如 React 本身、`react-dom`,或者其他提供额外功能的第三方包。 运行 `npm install` 会读取你项目目录中的 `package.json` 文件并安装其中列出的所有依赖项,使你能够构建和运行你的 React 应用而不会缺少任何必要的组件。 @@ -50,11 +50,11 @@ npm install 你应该看到 Vite 为你提供的入门模板。 -如果你需要停止局部的服务器,请在命令行中按 `CTRL + C`。 +如果你需要停止本地服务器,在命令行中按 `Ctrl + C`。 -要实际查看此入门模板的代码,你可以进入你的项目中的 `src` 文件夹,应该能看到 `App.jsx` 文件。 +要查看这个起始模板的代码,你可以打开项目中的 `src` 文件夹,在那里你应该能看到 `App.jsx` 文件。 -从那里你可以开始修改该文件,储存你的更改,并在浏览器中看到新的更改显示。 +从那里你可以修改该文件,储存你的更改,并在浏览器中看到它们的实时更新。 这样,你就可以开始创建你的 React 应用了! diff --git a/curriculum/challenges/chinese/blocks/lecture-introduction-to-javascript/672d49959621885e9d3e672c.md b/curriculum/challenges/chinese/blocks/lecture-introduction-to-javascript/672d49959621885e9d3e672c.md index e6982918885..90781fc672f 100644 --- a/curriculum/challenges/chinese/blocks/lecture-introduction-to-javascript/672d49959621885e9d3e672c.md +++ b/curriculum/challenges/chinese/blocks/lecture-introduction-to-javascript/672d49959621885e9d3e672c.md @@ -72,6 +72,16 @@ console.log(age); // 25 ::: +虽然用 `let` 声明的变量可以被重新赋值,但不能被重新声明。如果你尝试用 `let` 再次声明同一个变量,会出现误差: + +```js +let age = 25; + +let age = 90; // SyntaxError: Identifier 'age' has already been declared +``` + +`const` 也一样:用 `const` 声明的变量也不能被重新声明。 + 使用 `const` 声明的变量必须在声明时赋值。 如果你尝试声明一个 `const` 变量而不为其赋值,则会报错: ```js diff --git a/curriculum/challenges/chinese/blocks/lecture-understanding-aria-expanded-aria-live-and-common-aria-states/672a54dff9dc439089f1a219.md b/curriculum/challenges/chinese/blocks/lecture-understanding-aria-expanded-aria-live-and-common-aria-states/672a54dff9dc439089f1a219.md index dfcf1d8a84d..12c4b71eb18 100644 --- a/curriculum/challenges/chinese/blocks/lecture-understanding-aria-expanded-aria-live-and-common-aria-states/672a54dff9dc439089f1a219.md +++ b/curriculum/challenges/chinese/blocks/lecture-understanding-aria-expanded-aria-live-and-common-aria-states/672a54dff9dc439089f1a219.md @@ -11,10 +11,12 @@ dashedName: what-is-the-aria-live-attribute 实时区域的常见用途包括在执行操作后显示的消息(例如错误信息或确认消息)、定期更新的内容(例如跑马灯、走马灯或倒计时器),或通用的状态消息(例如关于进程的更新)。 -由于屏幕阅读器的阅读焦点一次只能位于一个位置,如果焦点在页面的其他部分,屏幕阅读器用户将不会注意到内容的变化。实时区域允许屏幕阅读器用户自动接收页面上实时发生的变化通知。没有实时区域,屏幕阅读器用户可能会错过视觉用户可见的重要内容更新,因为视觉用户能够扫描整个页面。 +由于屏幕阅读器的阅读焦点一次只能位于一个位置,如果焦点在页面的其他部分,屏幕阅读器用户将不会注意到内容的变化。实时区域允许屏幕阅读器用户自动接收页面上实时发生的变化通知。没有实时区域,屏幕阅读器用户可能会错过视觉用户可见的重要内容更新,因为视觉用户能够扫描整个页面。 根据信息的优先级,此属性有三种可能的值。 +## `assertive` 值 + 如果你将 `aria-live` 设置为值 `assertive`,这意味着更新非常重要。它具有最高的优先级,因此应该立即通知用户。 这意味着屏幕阅读器将中止它当前正在进行的任何公告,以宣布实时区域中的内容更改。此类中止可能会极其干扰,因此 `assertive` 值应仅用于时间敏感或关键通知。 @@ -81,6 +83,8 @@ document.addEventListener("DOMContentLoaded", () => { ::: +## `polite` 值 + 下一个优先级的值是 `polite`。 该值表示更新不是紧急的,因此屏幕读取器可以等待当前的任何公告完成或用户停止类型指派后再宣布更新。大多数实时区域将使用 `polite` 值。 @@ -147,10 +151,16 @@ document.addEventListener("DOMContentLoaded", () => { ::: +## `off` 值 + `aria-live` 的最低优先级值是 `off`,这意味着除非内容位于当前具有键盘焦点的元素中,否则更新不会被宣布。实际上,这个值几乎从未被使用,因为使用场景非常狭窄,并且在屏幕阅读器中几乎没有一致地实现(如果有的话)。如果你需要实时区域,计划为除需要 `assertive` 的关键消息外的所有内容使用 `polite`。 +## 来自 ARIA 角色的默认实时区域 + 同样重要的是,如果更新的信息包含在具有 `alert`、`log`、`marquee`、`status` 或 `timer` ARIA 角色的元素中,则不需要 `aria-live` 属性,因为这些角色已经具有默认的 `aria-live` 值。但可以通过在元素上显式设置 `aria-live` 来更改默认值。 +## 选择合适的值 + 选择合适的 `aria-live` 值取决于更新信息的优先级。 如果更新很紧急,你应该立即使用 `assertive` 通知用户。但你应该仅在更新确实紧急时使用此方法,因为突然的中止可能会使用户迷失方向并影响用户体验。 @@ -205,7 +215,7 @@ document.addEventListener("DOMContentLoaded", () => { ## --answers-- -`true`、`false`、`off`。 +`true`, `false`, `off`. ### --feedback-- @@ -213,7 +223,7 @@ document.addEventListener("DOMContentLoaded", () => { --- -`visible`、`hidden`、`off`。 +`visible`, `hidden`, `off`. ### --feedback-- @@ -221,11 +231,11 @@ document.addEventListener("DOMContentLoaded", () => { --- -`assertive`、`polite`、`off`。 +`assertive`, `polite`, `off`. --- -`open`、`closed`、`off`。 +`open`, `closed`, `off`. ### --feedback-- diff --git a/curriculum/challenges/chinese/blocks/lecture-understanding-computer-internet-and-tooling-basics/672aa578a2129554d4675049.md b/curriculum/challenges/chinese/blocks/lecture-understanding-computer-internet-and-tooling-basics/672aa578a2129554d4675049.md index 40ef7333ef2..725c799a464 100644 --- a/curriculum/challenges/chinese/blocks/lecture-understanding-computer-internet-and-tooling-basics/672aa578a2129554d4675049.md +++ b/curriculum/challenges/chinese/blocks/lecture-understanding-computer-internet-and-tooling-basics/672aa578a2129554d4675049.md @@ -11,13 +11,13 @@ dashedName: what-are-the-basic-parts-of-a-computer 作为一名开发人员,了解计算机的基本内部工作原理非常重要。 -电脑的第一个主要部件是主板。 主板上装有运行计算机所需的所有内存和连接器。 它是计算机的主电路板。 +计算机的第一个主要组件是主板。主板包含运行计算机所需的所有内存和连接器。它作为计算机的主电路板。 -在主板的电脑机箱内,你会发现 CPU,即中央处理器。 CPU 是一个负责执行指令和进行计算的处理器。 它通常被称为计算机的大脑。 +在计算机机箱内,安装在主板上的你会找到 CPU,即中央处理单元。CPU 是负责执行指令和进行计算的处理器。它通常被称为计算机的大脑。 -CPU 是一个带芯片的小方块,安装在主板的 CPU 插槽中。 CPU 处理器速度以千兆赫兹(GHz)和兆赫兹(MHz)为单位。 千兆赫兹为每秒十亿个周期,兆赫兹为每秒一百万个周期。 +CPU 是一个小的方形芯片,插入主板的 CPU 套接字中。CPU 的速度以千兆赫兹(GHz)和兆赫兹(MHz)为单位。千兆赫兹表示每秒十亿个周期,兆赫兹表示每秒一百万个周期。 -计算机的下一个关键部件是系统的短期存储器。 这就是所谓的 RAM 或随机存取存储器。 RAM 是计算机 CPU 的临时存储位置。 只要计算机需要快速访问数据,就会使用 RAM。 +计算机的下一个关键组件是系统的短期内存。这就是所谓的随机存取存储器(RAM)。RAM 是计算机 CPU 的临时存储位置。每当计算机需要快速访问数据时,它会使用 RAM。 电脑的 RAM 越大,运行速度就越快,可同时运行的程序也越多。 如果 RAM 不足,电脑运行速度就会变慢,性能也会大打折扣。 @@ -27,13 +27,13 @@ CPU 是一个带芯片的小方块,安装在主板的 CPU 插槽中。 CPU 处 硬盘由旋转盘片和机械臂组成。 盘片是存储数据的地方,机械臂用于向盘片读写数据。 硬盘速度越快,电脑启动速度就越快,程序运行速度也越快。 -另一种数据存储方式是固态硬盘,简称 SSD。 固态硬盘是一种非易失性闪存,可代替硬盘使用。 SSD 比硬盘更快、更小,但硬盘更便宜、存储容量更大。 +另一种数据存储类型是固态硬盘,简称 SSD。SSD 是非易变的闪存,可以替代硬盘使用。SSD 比硬盘更快、更小,但硬盘更便宜且存储容量更大。 计算机的另一个关键部件是电源装置或称 PSU。 PSU 负责将墙上插座的电能转换成计算机可以使用的形式。 它将电源从插座输送到主板、CPU 和计算机的其他组件。 -另一个关键部件是扩展卡。 这些卡插入主板后,可为计算机增加额外的功能。 扩展卡的例子包括显卡、声卡和网卡。 +另一个关键组件是扩展卡。这些卡插入主板以为计算机添加额外的功能。扩展卡的例子包括视频卡、声卡和网络卡。 -显卡又称图形处理器或 GPU,负责在电脑屏幕上呈现视觉效果。 +视频卡,也称为图形处理单元(GPU),负责在计算机屏幕上渲染视觉内容。 声卡负责在电脑扬声器上播放声音。 @@ -45,19 +45,19 @@ CPU 是一个带芯片的小方块,安装在主板的 CPU 插槽中。 CPU 处 ## --text-- -什么是 RAM? +什么是随机存取存储器? ## --answers-- -长期存储器。 +长期内存。 ### --feedback-- -想想短期数据存储器。 +想想短期数据存储。 --- -短期存储器。 +短期内存。 --- @@ -65,7 +65,7 @@ CPU 是一个带芯片的小方块,安装在主板的 CPU 插槽中。 CPU 处 ### --feedback-- -想想短期数据存储器。 +想想短期数据存储。 --- @@ -73,7 +73,7 @@ CPU 是一个带芯片的小方块,安装在主板的 CPU 插槽中。 CPU 处 ### --feedback-- -想想短期数据存储器。 +想想短期数据存储。 ## --video-solution-- @@ -141,7 +141,7 @@ CPU 代表什么? --- -保存短期内存。 +存储短期内存。 ### --feedback-- diff --git a/curriculum/challenges/chinese/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab82c1a9bbd0e3aabc39d.md b/curriculum/challenges/chinese/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab82c1a9bbd0e3aabc39d.md index a6320bcc1e7..a64d7e82ca1 100644 --- a/curriculum/challenges/chinese/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab82c1a9bbd0e3aabc39d.md +++ b/curriculum/challenges/chinese/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab82c1a9bbd0e3aabc39d.md @@ -7,11 +7,11 @@ dashedName: how-to-effectively-work-with-your-keyboard-mouse-and-other-pointing- # --description-- -你们中的许多人多年来一直习惯使用键盘和鼠标进行各种活动,比如游戏、执行工作任务或浏览网页。 +你们中的许多人多年来一直使用键盘和鼠标进行各种活动,比如游戏、执行工作任务或浏览网页。 但长期滥用这些设备可能会导致将来出现严重的健康问题。 -在本课中,我们将介绍以健康方式使用你的计算机键盘和鼠标的方法。 +在本课中,我们将介绍如何以健康的方式使用计算机的键盘和鼠标。 第一个提示是注意鼠标握持。当你在处理严肃的工作任务或激烈的游戏时刻,可能会倾向于用力握住鼠标。然而,这可能导致严重的手部和手腕问题。为防止这种情况,你需要确保轻柔地握住鼠标,并保持手指放松。 @@ -25,7 +25,7 @@ dashedName: how-to-effectively-work-with-your-keyboard-mouse-and-other-pointing- 虽然保持良好姿势很重要,但现代人体工程学强调运动和动态坐姿的重要性。人体是为运动而设计的,长时间保持任何固定姿势,即使是直立姿势,也会对脊柱施加持续压力。定期休息、全天调整你的姿势以及保持自然的手腕位置,有助于改善血液循环、减少疲劳并支持长期脊柱健康。 -最后一个提示是尽可能使用键盘快捷键,以帮助减少类型指派。对于浏览网页、操作系统导航、在代码编辑器中工作等任务,有数十种快捷键可用。因此,最好查找一些这些键盘快捷键,并开始将它们融入你的日常计算机使用中。 +最后一个建议是尽可能使用键盘快捷键,以减少使用鼠标的频率。针对浏览网页、操作操作系统、在代码编辑器中工作等任务,有数十种快捷键可用。因此,最好查找一些这些键盘快捷键,并开始将它们融入你的日常计算机使用中。 当你继续使用鼠标和键盘进行即将到来的编码项目和其他活动时,请记住保持这些健康提示。 @@ -109,7 +109,7 @@ dashedName: how-to-effectively-work-with-your-keyboard-mouse-and-other-pointing- ## --answers-- -鼠标应远高于键盘。 +鼠标的高度无关紧要。 ### --feedback-- diff --git a/curriculum/challenges/chinese/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab83c4297910eade53c2e.md b/curriculum/challenges/chinese/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab83c4297910eade53c2e.md index 3e88e6422fe..257a085ab0b 100644 --- a/curriculum/challenges/chinese/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab83c4297910eade53c2e.md +++ b/curriculum/challenges/chinese/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab83c4297910eade53c2e.md @@ -7,17 +7,17 @@ dashedName: what-are-the-different-types-of-internet-service-providers # --description-- -首先,什么是互联网服务提供商,或称 ISP?它本质上是一家销售访问全球互联网网络的公司。它们分为三种不同的等级。 +首先,什么是互联网服务提供商,简称 ISP?它本质上是一家公司,出售对全球互联网网络的访问。它们分为三种不同的层级。 -第一层是大型企业集团公司,它们拥有独立处理大部分(如果不是全部)network 流量的基础设施。 +第一层级是大型企业集团,它们拥有独立处理大部分(如果不是全部)网络流量的基础设施。 -第二层是全国性的提供商,他们有时会租用对第一层 network 的 access,但通常能够相当独立地运营。 +第二层级是全国性的提供商,它们有时会租用第一层级网络的访问权限,但通常能够相当独立地运营。 -第三级是那些主要专注于为局部市场提供互联网的小公司,并依赖更大的 ISP 提供他们的基础设施。 +第三层级是主要专注于为本地市场提供互联网的小公司,它们依赖更大的 ISP 提供基础设施。 这些提供者也将提供不同类型的连接。 -光纤连接依赖玻璃或塑料光纤通过光传输数据,从而实现非常高的连接速度和数据交换。 +光纤连接依靠玻璃或塑料纤维通过光传输数据,从而实现非常高的连接速度和数据交换。 有线连接使用与有线电视提供商相同的基础设施,这通常使它们在许多地区都能轻松获得。 @@ -25,7 +25,7 @@ DSL 连接使用固定电话服务使用的基础设施。由于这种基础设 拨号也使用电话线,但需要独占连接(连接到互联网时禁用电话线路的电话功能)。这是一种较旧的技术,现已废弃。 -卫星连接使用绕地球轨道运行的卫星数组来连接全球各地的各种设备。最后,类似地,5G 家庭互联网提供商使用基站基础设施让你保持在线。 +卫星连接使用绕地球轨道运行的一组卫星来连接全球各地的设备。最后,类似于此,5G 家庭互联网提供商使用基站基础设施让你保持在线。 这应该能让你对现有的互联网服务提供商和互联网连接类型有一个基本的了解! @@ -69,7 +69,7 @@ DSL 连接使用固定电话服务使用的基础设施。由于这种基础设 ## --text-- -哪种类型的互联网连接使用玻璃或塑料光纤通过光传输数据? +哪种类型的互联网连接使用玻璃或塑料纤维通过光传输数据? ## --answers-- @@ -121,7 +121,7 @@ DSL 连接。 --- -他们使用绕地球轨道运行的卫星数组。 +它们使用绕地球轨道运行的一组卫星。 ### --feedback-- diff --git a/curriculum/challenges/chinese/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab8573f32480f192aaae1.md b/curriculum/challenges/chinese/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab8573f32480f192aaae1.md index a4ea17918f5..25e54d14177 100644 --- a/curriculum/challenges/chinese/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab8573f32480f192aaae1.md +++ b/curriculum/challenges/chinese/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab8573f32480f192aaae1.md @@ -9,7 +9,7 @@ dashedName: what-are-the-different-types-of-tools-professional-developers-use 专业开发者依赖各种工具来提高生产力和代码质量。让我们了解这些工具,包括那些看起来非常明显的工具。 -工具中最重要的是计算机。计算机是主要的开发环境。它可以是运行 Windows、macOS 或 Linux 操作系统的台式机,也可以是可移植的笔记本电脑。 +第一个工具就是计算机本身。计算机是主要的开发环境。它可以是笨重的台式机,也可以是运行 Windows、macOS 或 Linux 操作系统的便携式笔记本。 专业开发者通常选择具有快速处理能力和大量随机存取存储器的计算机,以处理资源密集型任务。 @@ -21,7 +21,7 @@ Visual Studio Code(VS Code)本质上是一个代码编辑器,但它还通 其他代码编辑器有 Sublime Text、Atom、Notepad++ 和 Brackets。 -当你使用代码编辑器和集成开发环境编写代码时,你需要跟踪对它们所做的更改。让你跟踪这些更改的工具是版本控制系统。 +当你使用代码编辑器和集成开发环境编写代码时,需要跟踪你对代码所做的更改。让你跟踪这些更改的工具是版本控件系统。 Git 是开发社区中使用最广泛的版本控制系统。 @@ -31,8 +31,8 @@ Git 是开发社区中使用最广泛的版本控制系统。 流行的包管理器示例有: -* JavaScript 的 NPM、Yarn 和 PNPM -* Python 的 PIP +* JavaScript 的 npm、Yarn 和 pnpm +* Python 的 pip * PHP 的 Composer * Java 的 Maven @@ -147,7 +147,7 @@ Git。 --- -版本控件系统 +版本控件系统。 ### --feedback-- diff --git a/curriculum/challenges/chinese/blocks/lecture-understanding-error-handling-and-health-checks/69f3046f4c0e76cbdd24858e.md b/curriculum/challenges/chinese/blocks/lecture-understanding-error-handling-and-health-checks/69f3046f4c0e76cbdd24858e.md index 8af8db3995c..3d78fc03dac 100644 --- a/curriculum/challenges/chinese/blocks/lecture-understanding-error-handling-and-health-checks/69f3046f4c0e76cbdd24858e.md +++ b/curriculum/challenges/chinese/blocks/lecture-understanding-error-handling-and-health-checks/69f3046f4c0e76cbdd24858e.md @@ -34,7 +34,7 @@ app.use((err, req, res, next) => { Express 之所以知道它是错误处理器,是因为它有四个参数——除了典型的 `err`、`req` 和 `res` 参数外,还有新的 `next` 参数。 -在后续课程中,你将学习更多关于错误处理中间件以及它如何融入更广泛的 Express 中间件栈。 +正如你在之前的课程中看到的,误差处理中间件是 Express 中更广泛中间件栈的一部分。 ## 如何处理异步错误 @@ -251,6 +251,7 @@ Express 只会在所有路由之后检查它。 Express 只会在所有路由之后检查它。 + ## --video-solution-- 3 diff --git a/curriculum/challenges/chinese/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/6733affc29df1304e2c97e88.md b/curriculum/challenges/chinese/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/6733affc29df1304e2c97e88.md index b9e2deab459..409cb47d952 100644 --- a/curriculum/challenges/chinese/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/6733affc29df1304e2c97e88.md +++ b/curriculum/challenges/chinese/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/6733affc29df1304e2c97e88.md @@ -31,6 +31,8 @@ class MyClassName { 花括弧内的内容称为类体。这是构造函数和方法所在的位置。 +## 定义构造函数 + 构造函数是一个特殊的方法,当从类中新建一个对象时会自动调用。它通常用于初始化对象的属性。 在这个例子中,你可以看到一个带有构造函数的 `Dog` 类。 @@ -45,6 +47,8 @@ class Dog { 这里使用 `this` 关键字来参考当前的 `Dog` 类实例,允许你为正在创建的对象赋值 `name` 属性。你将在后续课程中学习更多关于 `this` 关键字的内容。 +## 定义方法 + 在构造函数下面,你可以有称为方法的方法。方法是在类内部定义的函数,用于执行动作或操作。它们用于定义类的实例可以执行的行为。 这里是为你的 `Dog` 类添加一个名为 `bark` 的方法的示例。 @@ -63,6 +67,8 @@ class Dog { 当调用 `bark` 方法时,消息将使用传入的实际名称记录到控制台。如果你创建一个名为 `"Buddy"` 的 `Dog` 实例,调用该实例上的 `bark()` 方法将会在控制台打印 `"Buddy says woof!"`。 +## 实例化类 + 一旦你定义了你的类,你可以使用 `new` 关键字、类名及其参数来创建该类的实例。 在此示例中,我们创建一个名为 `Gino` 的新 `Dog` 实例,然后将其赋值给变量 `dog`。 @@ -73,7 +79,9 @@ const dog = new Dog("Gino"); 当你在代码中写 `new Dog("Gino")` 时,新的对象被创建,并且构造函数会自动使用给定的参数调用。 -然后你可以使用点符号访问这个属性,就像你在下面这行代码中看到的那样: +## 访问属性和方法 + +然后你可以使用点符号访问 `name` 属性,就像下面这行代码中看到的那样: ```js console.log(dog.name); @@ -127,6 +135,8 @@ dog.bark(); ::: +## 使用类表达式 + 如前所述,你也可以将类定义为类表达式。这是指类是匿名的并赋值给一个变量。 下面是之前示例作为一个类表达式的样子: diff --git a/curriculum/challenges/chinese/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/673403ca2bb16658309e3632.md b/curriculum/challenges/chinese/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/673403ca2bb16658309e3632.md index 24592d098fd..db85d247875 100644 --- a/curriculum/challenges/chinese/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/673403ca2bb16658309e3632.md +++ b/curriculum/challenges/chinese/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/673403ca2bb16658309e3632.md @@ -11,6 +11,8 @@ dashedName: how-does-the-this-keyword-work 这些蓝图需要一种通用的方式来引用在代码中被创建、访问或修改的特定对象。这正是 `this` 关键字的用途。它引用代码应运行的上下文。如果你在方法中使用它,`this` 的值将是对关联该方法的对象的引用。通过这种方式,你可以访问类中对象的属性和方法,并在不同对象上重用该方法。 +## 构造函数 + 例如,这里我们有一个 `Dessert` 类。这次,我们定义了一个 `hasPeanuts` 属性。 ```js @@ -33,6 +35,8 @@ this.hasPeanuts = hasPeanuts; 那是在构造函数的上下文中,但你也可以在其他方法中使用 `this` 关键字。 +## 方法 + 这是我们的 `Dessert` 类,带有一些更改。现在我们有两个属性:`name` 和 `price`。 ```js @@ -91,10 +95,16 @@ console.log(brownie); 这都要归功于 `this` 关键字,它为你提供了一种通用的方式来在类中引用当前对象。这使你能够在不同对象上重用该方法。 +## 函数和箭头函数 + 这是在对象方法的上下文中,但 `this` 密钥在独立函数和箭头函数中也会有值。 +### 普通函数 + 它在独立函数中的值通常参考全局对象(在非严格模式下)或 `undefined`(在严格模式下)。 +### 箭头函数 + `this` 关键字的值在箭头函数中有些不同。箭头函数继承定义它们的外层作用域中的 `this` 值。它们不会创建自己的 `this` 绑定。这意味着 `this` 的值取决于箭头函数定义的上下文,而不是箭头函数被调用的位置或方式。这使得箭头函数对于回调或保持上下文非常有用。 但是,因为这个原因,`this` 的值在对象方法中不会指向当前对象,所以在使用箭头函数时你应该记住这一点。 diff --git a/curriculum/challenges/chinese/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5160.md b/curriculum/challenges/chinese/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5160.md index 3b40982a1d2..71a0140d172 100644 --- a/curriculum/challenges/chinese/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5160.md +++ b/curriculum/challenges/chinese/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5160.md @@ -14,17 +14,17 @@ dashedName: whats-the-process-for-creating-web-standards 1. ## 识别需求 标准的起点通常是遇到阻力,比如开发者遇到瓶颈、各浏览器对同一行为的实现不兼容,或者平台还不支持某项新能力。某个人在某个地方感到足够沮丧,于是把问题写了下来。这个人可以是任何人:开发者、有产品需求的大公司,或者浏览器团队里的工程师。在这个阶段,重要的不是权威,而是证据,以及这个问题是否真实存在,是否有足够多的人遇到它,从而值得 Web 平台关注。 -1. **提出想法并早期讨论** - 这个想法会通过 GitHub issue、简短文档或 explainer 的形式被非正式地写出来,描述问题并勾勒出可能的方案。此时的目标不是产出最终的规格说明,而是看看这个问题是否引起共鸣。其他开发者是否认同?浏览器厂商是否感兴趣?有没有明显的方案,还是有多个竞争方案?在 TC39,这一阶段对应 Stage 0 和 Stage 1。在 W3C,通常在正式工作组成立前,会在社区组中非正式地进行。WHATWG 则通过其核心仓库的公开 GitHub 讨论来处理。场所不同,作用相同。 +1. ## 提案和早期讨论 + 这个想法通过 GitHub issue、简短的文档或解释说明非正式地写出来,描述问题并勾勒出可能的解决方案。在这个阶段,目标不是产出完整的规格说明,而是了解问题是否引起共鸣。其他开发者是否认同?浏览器厂商是否感兴趣?是否有明显的解决方案,或者有几个竞争方案?在 TC39,这个早期阶段对应阶段 0 和阶段 1。在 W3C,这通常在正式工作组成立之前,在社区组中非正式进行。WHATWG 通过其核心仓库上的公开 GitHub 讨论来处理。场所不同,但功能相同。 -1. **编写规格说明** - 如果提案获得关注,就需要有人或小团队来编写实际的规格说明(spec)。规格说明不是博客或教程,而是精确、正式地描述某个特色在各种情况下应有行为的文档。边界分支、误差情况、与现有特色的交互、安全性影响等都必须被仔细考虑并写下来。 +1. ## 编写规格说明 + 如果提案获得关注,某个人或一个小团队必须编写实际的规格说明,简称 spec。规格说明不是博客文章或教程,而是一个精确、正式的文档,详细描述功能在各种可能情况下必须如何表现。边缘情况、错误条件、与现有功能的交互以及安全性影响都必须仔细考虑并写入文档。 -1. **评审、异议与迭代** - 草案会被公开发布,并由其他浏览器厂商评审。大部分实际工作都在这一步完成。会有人提出异议,规格说明也会不断修订。如果某个主流浏览器引擎拒绝实现某项特色,这项特色很难成为标准,无论其技术多么优秀。这个阶段的共识建立可能需要很长时间。有些提案会因设计细节的谈判而停滞多年。也有些提案最终被放弃,因为无法达成一致。 +1. ## 审查、异议和迭代 + 草案会公开发布并由其他浏览器厂商审查。这是大部分实际工作发生的地方。会提出异议,规格说明会被修订。一个主要浏览器引擎拒绝实现的功能,无论技术上多么优秀,通常都难以成为标准。这个阶段的共识构建可能需要很长时间。有些提案在厂商就设计细节协商时停滞多年。还有些提案在明确无法达成协议时彻底夭折。 -1. **实现与测试** - 当规格说明足够稳定后,浏览器厂商会开始实现它。通常会先通过特色标记(feature flag)开启,以便测试而不影响现有用户。实现过程中常常会发现规格说明未预料到的问题,这些问题会被反馈给编辑者进一步澄清。共享测试套件用来验证每个实现的行为是否一致。如果 Chrome、Firefox 和 Safari 都通过了相同的测试,说明规格说明有效。如果它们出现发散,要么是规格说明不清晰,要么是某个实现有错误。 +1. ## 实现和测试 + 一旦规格说明足够稳定,浏览器厂商开始实现它。通常先启用功能标记,这样可以在不影响现有用户的情况下进行测试。实现过程中常常会发现规格说明未预见的问题,这些问题会反馈给编辑者进行澄清。共享测试套件用来验证每个实现是否表现一致。如果 Chrome、Firefox 和 Safari 都通过相同的测试,说明规格说明有效。如果它们表现不一致,要么是规格说明不清晰,要么是某个实现存在错误。 1. ## 最终定稿 当有多个独立实现、测试全部通过、社区也满意时,标准就会最终定稿。在 W3C,这意味着达到 Recommendation 状态。在 TC39,则是进入 Stage 4,之后该特色会被纳入下一年度的 ECMAScript 版本。在 WHATWG,没有单一的最终定稿时刻,活标准会持续反映当前共识并不断更新。整个流程可能只需几个月(对于小型、无争议的补充),也可能长达十年以上(对于复杂或有政治分歧的内容)。比如 CSS Grid,最早在 2011 年提出,直到 2017 年才在所有主流浏览器中上线。从一个好想法到一个稳定、被广泛支持的标准,这段过程正是开放 Web 大部分工作的所在。 @@ -109,7 +109,7 @@ dashedName: whats-the-process-for-creating-web-standards ## --answers-- -用来替代书面规格说明。 +替代书面规格说明。 ### --feedback-- @@ -121,7 +121,7 @@ dashedName: whats-the-process-for-creating-web-standards --- -用来为市场营销排名浏览器性能。 +为营销目的排名浏览器性能。 ### --feedback-- diff --git a/curriculum/challenges/chinese/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5161.md b/curriculum/challenges/chinese/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5161.md index 4e4052381d3..7d3c40023f0 100644 --- a/curriculum/challenges/chinese/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5161.md +++ b/curriculum/challenges/chinese/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5161.md @@ -13,23 +13,23 @@ web 标准特色的生命周期相关,但更细化。它跟踪一个特色从 把这个过程想象成规则手册,而生命周期就是你实际玩游戏时发生的事情。 -1. **提案** - 每个特色都始于有人足够关心的问题并写下来。开发者、浏览器工程师或公司会在 GitHub 上提交 issue 或说明文档,描述当前 web 无法实现的功能以及为什么需要它。在这个阶段,想法还很模糊,问题多于答案。目标只是看看是否有人也认同这个痛点。 +1. ## 提案 + 每个特色都始于某人足够关心并写下的问题。开发者、浏览器工程师或公司会提交一个 GitHub 问题或说明,描述当前网页无法实现的功能以及为什么应该实现。在这个阶段,想法还很模糊,问题多于答案。目标只是为了了解是否还有其他人也感受到同样的痛点。 -1. **孵化** - 如果提案引起共鸣,它会进入公开讨论和早期设计阶段。不同方案被草拟出来,收集用例,社区对想法进行压力测试。许多提案在这里夭折,可能是因为问题太小众,或者没有方案能满足所有人。存活下来的提案会变得更清晰,并至少获得一些浏览器厂商的兴趣。 +1. ## 孵化 + 如果提案引起共鸣,它将进入公开讨论和早期设计阶段。竞争方案会被草拟出来,收集使用案例,社区会对这个想法进行压力测试。许多提案会在这里夭折,可能是因为问题过于小众,或者没有解决方案能满足所有人。存活下来的提案会变得更清晰,并至少获得一些浏览器厂商的兴趣支持。 -1. **规格说明** - 存活的提案会被写成正式的规格说明。每个边缘情况、错误条件和与现有特色的交互都必须清晰定义。这是好点子遇到现实的时刻。模糊的概念必须变成两个独立工程师都能一致阅读和实现的精确规则。 +1. ## 规格说明 + 存活的提案会被写成正式的规格说明。每个边缘情况、错误条件以及与现有功能的交互都必须明确定义。这是好点子遇到现实的时刻。模糊的概念必须变成两个独立工程师都能阅读并一致实现的精确规则。 -1. **兼容性测试** - 在特色被认为稳定之前,它必须在每个浏览器中表现一致。W3C Web Platform Tests 套件是验证这一点的主要工具。它是一套共享的测试,Chrome、Firefox、Safari 等浏览器都会用它来测试自己的实现。测试结果不一致意味着规格说明不明确,或者有人写了错误。必须解决这些问题,特色才能继续推进。 +1. ## 兼容性测试 + 在一个特色被认为稳定之前,它必须在每个浏览器中表现一致。W3C Web 平台测试套件是验证这一点的主要工具。它是一套共享的测试,Chrome、Firefox、Safari 以及其他浏览器都会用它来测试各自的实现。测试结果不一致意味着规格说明存在歧义,或者某个实现有错误。必须解决这些问题后,特色才能继续推进。 -1. **定稿** - 一旦多个独立实现通过测试,特色就会被定稿。对于 W3C 来说,它是推荐标准;对于 TC39,是第 4 阶段;对于 WHATWG,是稳定的活文档标准。标记被移除,特色向用户发布。此时,它成为基础 web 平台的一部分,每个开发者都可以长期依赖。 +1. ## 定稿 + 一旦多个独立实现通过测试,该特色就会被定稿。对于 W3C 来说,它是推荐标准;对于 TC39,是第 4 阶段;对于 WHATWG,是稳定的活文档标准。标记被移除,特色开始向用户发布。此时,它成为基础网页平台的一部分,每个开发者都可以永久依赖它。 -1. **废弃** - 并非所有标准都能经得起时间考验。有些特色被更好的替代,有些则暴露出当时未察觉的安全或隐私问题。当特色需要被淘汰时,它会被正式废弃。也就是说,仍然支持但标记为开发者应停止使用。最终,它会从规格说明中移除。浏览器移除过程缓慢且谨慎,因为 web 的核心承诺是旧页面依然可用。有些废弃特色仅为兼容旧版而在浏览器中存在数十年。 +1. ## 废弃 + 并非所有标准都能经得起时间考验。有些特色被更好的替代品取代,有些则暴露出当时未察觉的安全或隐私问题。当一个特色需要被淘汰时,它会被正式废弃。也就是说,仍然支持但标记为开发者应停止使用。最终,它会从规格说明中移除。浏览器移除过程缓慢且谨慎,因为网页的核心承诺是旧页面依然可用。有些废弃的特色仅因向后兼容义务,在浏览器中存在数十年。 # --questions-- @@ -39,7 +39,7 @@ web 特色生命周期的哪个阶段通过公开讨论、收集用例和草拟 ## --answers-- -孵化 +孵化阶段 --- @@ -83,7 +83,7 @@ web 特色生命周期的哪个阶段通过公开讨论、收集用例和草拟 --- -替代书面规格说明的需求。 +替代书面规格说明。 ### --feedback-- diff --git a/curriculum/challenges/chinese/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5162.md b/curriculum/challenges/chinese/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5162.md index 181f0c50578..3b92f4c133a 100644 --- a/curriculum/challenges/chinese/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5162.md +++ b/curriculum/challenges/chinese/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5162.md @@ -9,26 +9,26 @@ dashedName: what-are-the-key-principles-that-web-standards-are-built-on Web 标准不仅仅是技术文档,它们反映了一套关于网络应该是什么以及应该为谁服务的价值观。理解这些原则能帮助你不仅了解网络如何工作,还能明白它为什么会被这样构建。让我们来讨论这些原则。 -1. **开放性** - Web 标准是在公开环境中开发的,并且实现时无需支付版权费。任何人都可以阅读规格,任何人都可以构建浏览器,没有公司可以因实现标准而收取许可费。正是这种开放性使网络区别于专有平台,也让小团队能够构建触达数十亿人的工具,而无需得到守门人的许可。 +1. ## 开放性 + Web 标准是在公开环境中开发并且免版税实现的。任何人都可以阅读规格,任何人都可以构建浏览器,没有公司可以对实现标准收取许可费。正是这种开放性使得网络区别于专有平台,也让小团队能够构建工具,触达数十亿用户,而无需得到守门人的许可。 -1. **无障碍** - 网络设计之初就是为了让所有人都能使用,无论能力如何。无障碍不是 Web 标准的附加功能,而是内嵌在 HTML、CSS 和浏览器行为的设计中。W3C 的 WCAG 指南为无障碍的实际含义设定了正式标准。任何对使用屏幕阅读器、键盘导航或辅助技术的人造成障碍的功能,都是设计上的缺陷,而不仅仅是伦理问题。 +1. ## 无障碍 + 网络设计之初就是为了让所有人都能使用,无论能力如何。无障碍不是 Web 标准的附加功能,而是内嵌在超文本标记语言、CSS 和浏览器行为的设计中。W3C 的 WCAG 指南为无障碍的实际含义设定了正式标准。任何对使用屏幕阅读器、键盘导航或辅助技术的人造成障碍的功能,都是设计上的缺陷,而不仅仅是伦理问题。 -1. **互操作性** - 最根本的原则是网络应该在任何地方都能以相同方式工作。一个符合标准的页面在 Chrome、Firefox 和 Safari 上,以及在 Windows、macOS、Linux、Android 和 iOS 上都应该表现一致。没有互操作性,网络就会分裂成一系列浏览器专属的体验,开发者被迫多次编写相同的内容。每个标准的核心目的就是防止这种情况发生。 +1. ## 互操作性 + 最根本的原则是网络应该在任何地方都能以相同方式工作。按照标准构建的页面应在 Chrome、Firefox 和 Safari 以及 Windows、macOS、Linux、Android 和 iOS 上表现一致。没有互操作性,网络就会变成一堆浏览器特定的体验,开发者被迫多次编写相同的内容。每个标准的核心目的就是防止这种情况发生。 -1. **向后兼容** - 网络几乎绝对承诺不破坏旧内容。1999 年写的页面在现代浏览器中仍应能正确渲染,标准组织在设计新功能时非常重视这一义务。这就是为什么新功能是叠加在旧功能之上的,而不是替代它们。这是一个有时会让设计师感到沮丧的约束,但它也使网络作为一个平台具有独特的持久性。 +1. ## 向后兼容 + 网络几乎绝对承诺不破坏旧内容。1999 年编写的页面在现代浏览器中仍应能正确渲染,标准组织在设计新功能时非常重视这一义务。这就是为什么新功能是叠加在旧功能之上,而不是替代它们。这种约束有时会让设计师感到沮丧,但它也使网络作为一个平台具有独特的持久性。 -1. **隐私和安全性** - 现代标准在发布前会审查隐私和安全性影响。可能暴露用户数据或启用跟踪的新 API 会在标准制定过程中受到严格审查。原则是平台应默认保护用户,开发者的便利绝不能以牺牲用户安全为代价。 +1. ## 隐私和安全性 + 现代标准在发布前会审查其隐私和安全性影响。可能暴露用户数据或启用跟踪的新 API 在标准制定过程中会受到严格审查。原则是平台应默认保护用户,开发者的便利绝不能以牺牲用户安全为代价。 -1. **分层** - 网络由不同且可组合的层构成:HTML 用于结构,CSS 用于表现,JavaScript 用于行为。标准设计尊重这些边界,而不是将它们合并。一个良好分层的功能可以逐步采用。不使用 JavaScript 的页面仍然能工作,不支持新 CSS 属性的浏览器仍能渲染合理的内容。这种关注点分离赋予了网络韧性。 +1. ## 分层 + 网络由不同且可组合的层构成:超文本标记语言负责结构,CSS 负责表现,JavaScript 负责行为。标准设计尊重这些边界,而不是将它们合并。良好分层的功能可以逐步采用。不使用 JavaScript 的页面仍然能工作,不支持新 CSS 属性的浏览器仍能渲染合理内容。这种关注点分离赋予了网络韧性。 -1. **渐进增强** - 与分层密切相关的是网络应先为所有人工作,然后为拥有更强大浏览器或设备的用户提供更好体验的理念。标准功能在不被支持时应优雅降级,而不是完全失效。这个原则影响了新 CSS 属性的规范、JavaScript API 如何处理缺失功能,以及标准组织如何看待现代浏览器与仍广泛使用的旧浏览器之间的差距。 +1. ## 渐进增强 + 与分层密切相关的是网络应对所有人都能工作,然后为拥有更强浏览器或设备的用户提供更好体验的理念。标准功能在不被支持时应优雅降级,而不是完全失效。这个原则影响了新 CSS 属性的规格制定、JavaScript API 如何处理缺失功能,以及标准组织如何看待现代浏览器与仍广泛使用的旧浏览器之间的差距。 # --questions-- diff --git a/curriculum/challenges/chinese/blocks/lecture-user-interface-design-fundamentals/672baa97f2990e6631d522e7.md b/curriculum/challenges/chinese/blocks/lecture-user-interface-design-fundamentals/672baa97f2990e6631d522e7.md index 79bf13b9783..7b61ee4bce2 100644 --- a/curriculum/challenges/chinese/blocks/lecture-user-interface-design-fundamentals/672baa97f2990e6631d522e7.md +++ b/curriculum/challenges/chinese/blocks/lecture-user-interface-design-fundamentals/672baa97f2990e6631d522e7.md @@ -9,6 +9,8 @@ dashedName: how-do-you-create-good-background-and-foreground-contrast-in-your-de **注意**:某些交互示例可能使用你尚未学习的 CSS。不要担心试图理解所有的代码。示例的目的是向你展示这些设计概念的预览,以便你更好地理解其工作原理。 +## 理解对比度 + 首先,你可能需要熟悉对比度。 对比度是指两种颜色之间的差异,或者说是区分两种颜色的难易程度。 对比度较高的颜色在视觉上会更加鲜明,而对比度较低的颜色在视觉上会更加相似。 例如,黑白对比度非常高。 而浅蓝色和浅紫色的对比度较小。 @@ -53,6 +55,8 @@ dashedName: how-do-you-create-good-background-and-foreground-contrast-in-your-de ::: +### 将对比度应用于文本 + 当然,在这些例子中,由于布局的原因,区别可能会更加明显。 但将这些颜色应用到文本中会怎样? 你可以在白色背景上使用高对比度的黑色文字。 还有蓝色背景上的低对比度的紫色文字。 :::interactive_editor @@ -96,7 +100,9 @@ dashedName: how-do-you-create-good-background-and-foreground-contrast-in-your-de ::: -但如何确定什么是 "足够好 "的对比度? 你不能只根据文字在你眼中的样子来判断,因为每个用户都会有不同的体验。 值得庆幸的是,《网页内容可访问性指南》,或称WCAG,为此提供了一个标准。 +### WCAG 对比度标准 + +但如何确定什么是 "足够好 "的对比度? 你不能只根据文字在你眼中的样子来判断,因为每个用户都会有不同的体验。 值得庆幸的是,《网页内容可访问性指南》,或称WCAG,为此提供了一个标准。 对比度为 4.5:1 的文本被认为是 AA 级标准,这是便于大多数用户都能访问的最低标准。 对比度为 7:1 的文本被认为是 AAA 标准,可确保最佳的可访问性水平。 @@ -141,9 +147,11 @@ dashedName: how-do-you-create-good-background-and-foreground-contrast-in-your-de ::: +### 比较高对比度和低对比度比率 + 有很多网站可以检查两种颜色之间的对比度,但大多数浏览器都允许你直接在网站的开发者工具中进行检查。 -让我们再看几个对比度的例子,以更好地理解这个概念。 +让我们再看几个对比度的例子,以更好地理解这个概念。 这是一个黑色文本在白色背景上的示例,其对比度为 21:1。 @@ -221,8 +229,12 @@ dashedName: how-do-you-create-good-background-and-foreground-contrast-in-your-de 此示例的对比度为 1.48:1,甚至未达到 AA 标准。 +## 调整颜色属性 + 如何解决这个问题? 有三个方面会影响对比度。 +### 调整色相 + 首先是色调,它代表一般的颜色类型,如红色、蓝色、橙色。 让我们换一种离蓝色更远的色调。 这里,让我们使用红色。 :::interactive_editor @@ -267,6 +279,8 @@ dashedName: how-do-you-create-good-background-and-foreground-contrast-in-your-de ::: +### 调整饱和度 + 遗憾的是,这种改变只能将对比度提高到 1.49:1,这意味着你需要改变颜色的饱和度或者说颜色的 "量"。 让我们增加文本的红色的量。 这使我们更接近目标,对比度达到 3.54:1。 :::interactive_editor @@ -325,6 +339,8 @@ dashedName: how-do-you-create-good-background-and-foreground-contrast-in-your-de ::: +### 调整亮度 + 不过,通过更改最后一个值,即亮度,你有可能获得更接近的效果。 明度表示颜色中白色的含量。 降低红色的明度。 现在,浅蓝色背景上的红色更深了,对比度达到了 10.34:1。 @@ -439,11 +455,11 @@ dashedName: how-do-you-create-good-background-and-foreground-contrast-in-your-de ## --text-- -根据《网页内容可访问性指南》(WCAG),要达到 AA 标准,文本的最小对比度是多少? +根据《网页内容可访问性指南》(WCAG),要达到 AA 标准,文本的最小对比度是多少? ## --answers-- -3∶1 +3:1 ### --feedback-- @@ -451,7 +467,7 @@ dashedName: how-do-you-create-good-background-and-foreground-contrast-in-your-de --- -4.5:1 +4.5:1 --- @@ -475,7 +491,7 @@ dashedName: how-do-you-create-good-background-and-foreground-contrast-in-your-de ## --text-- -以下哪项未被提及为影响对比度的方面? +以下哪项未被提及为影响对比度的方面? ## --answers-- @@ -495,7 +511,7 @@ dashedName: how-do-you-create-good-background-and-foreground-contrast-in-your-de --- -明度 +亮度 ### --feedback-- diff --git a/curriculum/challenges/chinese/blocks/lecture-what-is-css/672acc100d59d24da7b4e09c.md b/curriculum/challenges/chinese/blocks/lecture-what-is-css/672acc100d59d24da7b4e09c.md index 79d3529fc98..a499b905f15 100644 --- a/curriculum/challenges/chinese/blocks/lecture-what-is-css/672acc100d59d24da7b4e09c.md +++ b/curriculum/challenges/chinese/blocks/lecture-what-is-css/672acc100d59d24da7b4e09c.md @@ -7,10 +7,14 @@ dashedName: what-are-the-different-types-of-css-combinators # --interactive-- +## CSS 组合器 + CSS 组合符用于定义 CSS 中选择器之间的关系。它们帮助根据元素与其他元素的关系选择元素,从而实现更精确和高效的样式设置。 我们将讨论一些主要的 CSS 组合器及其使用分支,首先从后代组合器开始。 +### 后代组合器 + 后代组合器用于选择第二个选择器匹配的元素,前提是这些元素嵌套在匹配第一个选择器的祖先元素内。祖先可以是父元素、祖父元素,或文档树中更上层的任何祖先。 为了更好地理解其工作原理,让我们来看一个例子。 @@ -42,6 +46,8 @@ figure img { 如果你在一个 `figure` 元素内有多个图像,使用后代组合器是为每个图像应用实心黑色边框的好方法。 +### 子元素组合器 + 另一种类型的组合器是子组合器。 CSS 中的子组合符(`>`)用于选择指定父元素的直接子元素。 @@ -102,6 +108,8 @@ CSS 中的子组合符(`>`)用于选择指定父元素的直接子元素。 因为另外两个段落元素嵌套在 `div` 元素内,它们不被视为 `container` 类的直接子元素,因此不会获得蓝色的文本颜色。 +### 相邻兄弟组合器 + 另一个常见的组合器是下一个兄弟组合器。 CSS 中的下一个兄弟组合器(`+`)选择紧跟指定兄弟元素之后的元素。当你想为紧接另一个元素之后的元素应用样式时,这个组合器非常有用,它允许基于元素相对于其兄弟元素的位置进行有针对性的样式设置。 @@ -150,6 +158,8 @@ img + figcaption { 在此示例中,邻接兄弟组合符(`+`)选择紧跟在 `img` 元素之后的 `figcaption` 元素。应用的 CSS 规则为 `figcaption` 添加了 `4px solid black border`。 +### 通用兄弟组合器 + 另一个常见的组合器是后续兄弟组合器。 CSS 中的后续兄弟组合器(`~`)选择指定元素之后的所有兄弟元素。 @@ -202,6 +212,8 @@ h2 ~ p { 后续兄弟组合器(`~`)选择所有出现在 `h2` 元素之后的段落兄弟元素,无论它们是否是直接兄弟。 +## 为什么 CSS 组合器很重要 + 总之,理解和使用各种 CSS 组合器允许你为你的 HTML 元素应用精确的样式,增强你的设计的控件和灵活性。 通过掌握这些选择器,你可以创建更复杂且更有针对性的样式规则,从而提升你网页的外观和功能性。 diff --git a/curriculum/challenges/chinese/blocks/lecture-working-with-code-editors-and-ides/672d26269456511aa3db614d.md b/curriculum/challenges/chinese/blocks/lecture-working-with-code-editors-and-ides/672d26269456511aa3db614d.md index 3e660de9bf0..031d945f43a 100644 --- a/curriculum/challenges/chinese/blocks/lecture-working-with-code-editors-and-ides/672d26269456511aa3db614d.md +++ b/curriculum/challenges/chinese/blocks/lecture-working-with-code-editors-and-ides/672d26269456511aa3db614d.md @@ -7,25 +7,25 @@ dashedName: what-is-a-code-editor-and-ide # --description-- -你可能会认为这两者是一回事,其实不然。 代码编辑器是允许你编辑代码文件的任何应用程序。 IDE 或集成开发环境是一个完整的应用程序,允许你在编辑代码的同时编译、运行和调试代码。 +你可能会认为它们是同一回事,但其实不然。代码编辑器是任何允许你编辑代码文件的应用。IDE,或称集成开发环境,是一个完整的应用,允许你在编辑代码的同时编译、运行和调试代码。 -也许一些例子会有所帮助。 +一些例子会有所帮助。 首先,我们来看看几种流行的 IDE。 Visual Studio 是微软公司推出的集成开发环境,它提供了一套全面的工具,用于在各种平台上构建、调试和部署应用程序。 -另一个 IDE 是 XCode。 Xcode 是 Apple 设计的集成开发环境,用于为 macOS、iOS、watchOS 和 tvOS 创建、编写和调试应用程序。 +另一个 IDE 是 Xcode。Xcode 是苹果公司推出的集成开发环境,专为创建、编写和调试 macOS、iOS、watchOS 和 tvOS 应用而设计。 -还有一个 IDE 是 Android Studio。 Android Studio 是 Google 专门为构建、调试和测试 Android 应用程序而设计的集成开发环境。 +Android Studio 由谷歌开发,是专门为创建、调试和测试 Android 应用设计的集成开发环境。 以上只是 IDE 的几个例子。 现在,让我们来看看几款流行的代码编辑器。 Visual Studio Code 是微软公司推出的一款轻量级开源代码编辑器,支持多种编程语言,并通过扩展提供调试、语法高亮和版本控制等功能。 -另一个流行的编辑器是 Sublime Text。 Sublime Text 是一款快速、多功能的文本编辑器,以其时尚的界面、强大的功能以及通过可定制的语法高亮和插件支持多种编程语言而著称。 +为了快速且多功能的编辑体验,Sublime Text 提供了简洁的界面,并通过可自定义的语法高亮和插件支持多种编程语言。 -还有一个是 Notepad++。 这是一款适用于 Windows 的免费、开源文本和源代码编辑器,提供语法高亮显示、代码折叠和一系列插件,以提高工作效率和自定义功能。 +Windows 用户还可以使用 Notepad++,这是一款免费的开源文本和源代码编辑器,提供语法高亮、代码折叠以及多种插件以提升生产力和自定义功能。 -你可能已经注意到,代码编辑器主要关注文件的文本内容,而集成开发环境则提供各种工具来管理代码。 +你可能已经注意到,代码编辑器主要关注文件的文本内容,而 IDE 则提供了各种工具来管理你的代码。 这些例子都是可以在电脑上运行的本地程序,但也有基于云的编辑器可供使用。 @@ -35,11 +35,11 @@ Visual Studio Code 是微软公司推出的一款轻量级开源代码编辑器 Replit 是一个在线平台,为编码提供了一个协作环境,允许用户直接通过网络浏览器使用各种编程语言编写、运行和共享代码。 -另一个流行的云编辑器是 GitHub Codespaces。 这是一个基于云的开发环境,可直接从 GitHub 即时访问完全配置好的代码编辑器和开发工具,实现无缝编码和协作。 +另一个流行的云端编辑器是 GitHub Codespaces。这是一个云端开发环境,直接从 GitHub 提供即时访问一个完全配置好的代码编辑器和开发工具,实现无缝的编码和协作。 -另一个是 Ona。Ona 是一个基于云的开发环境,集成了 GitHub 和 GitLab,提供即时的、自定义的工作区,供你直接从浏览器进行编码、创建和调试。 +Ona 与 GitHub 和 GitLab 集成,提供即时且可自定义的工作区,让你直接从浏览器进行编码、创建和调试。 -还有很多其他选择。 有些,如 Visual Studio Code,具有很强的可扩展性,可与多种不同的项目类型和语言配合使用。 其他的可能专门针对一小部分语言或项目类型。 +还有许多其他选项。有些选项,比如 Visual Studio Code,具有高度的可扩展性,能够支持多种项目类型和编程语言。其他选项可能专门针对某些语言或项目类型的子集。 对于特定项目,你使用的应用程序可能有所不同。 你应该探索各种选项,看看哪种最符合你的需求。 diff --git a/curriculum/challenges/chinese/blocks/lecture-working-with-code-editors-and-ides/672d45583fd75a504136fbbb.md b/curriculum/challenges/chinese/blocks/lecture-working-with-code-editors-and-ides/672d45583fd75a504136fbbb.md index 44467ab2ad3..e0a13a6dc38 100644 --- a/curriculum/challenges/chinese/blocks/lecture-working-with-code-editors-and-ides/672d45583fd75a504136fbbb.md +++ b/curriculum/challenges/chinese/blocks/lecture-working-with-code-editors-and-ides/672d45583fd75a504136fbbb.md @@ -1,17 +1,17 @@ --- id: 672d45583fd75a504136fbbb -title: 如何在电脑上安装 Visual Studio Code +title: 如何在你的计算机上安装 Visual Studio Code challengeType: 19 dashedName: how-to-install-visual-studio-code-onto-your-computer --- # --description-- -要安装 VS Code,你需要访问他们的网站,获取适合你操作系统的安装程序。 请确保你访问的是 VS Code 网站,而不是 Visual Studio 网站。 +要安装 VS Code,你需要访问 VS Code 网站,获取适合你操作系统的安装程序。确保你访问的是 VS Code 网站,而不是 Visual Studio 网站。 -对于 Windows,你可以下载 EXE 安装程序。 下载完成后,运行文件,安装向导将带你完成安装过程。 +对于 Windows,你可以下载 EXE 安装程序。下载完成后,运行该文件,安装向导会引导你完成安装过程。 -对于 Mac,你可以下载一个压缩包,其中包含一个 `.app`,你可以运行它。 你还可以通过 homebrew 安装 VS Code。 +对于 Mac,你可以下载一个 `.zip` 压缩包,里面包含一个可以运行的 `.app`。你也可以通过 Homebrew 安装 VS Code。 打开 Mac 上的终端应用程序,运行以下命令: diff --git a/curriculum/challenges/chinese/blocks/lecture-working-with-code-editors-and-ides/672d45651d83b450801efb3a.md b/curriculum/challenges/chinese/blocks/lecture-working-with-code-editors-and-ides/672d45651d83b450801efb3a.md index 88cf63df3ff..747a664004c 100644 --- a/curriculum/challenges/chinese/blocks/lecture-working-with-code-editors-and-ides/672d45651d83b450801efb3a.md +++ b/curriculum/challenges/chinese/blocks/lecture-working-with-code-editors-and-ides/672d45651d83b450801efb3a.md @@ -9,21 +9,21 @@ dashedName: how-to-create-a-project-and-run-your-code-locally-in-vs-code 首先,你应该知道 VS Code 将项目视为“工作区”。 工作区就是你在 VS Code 中打开的目录。 -开始时,你需要使用命令行界面为新项目创建一个新目录。 目录是文件夹的另一种说法。 +首先,你需要使用命令行界面为你的新项目创建一个新的目录。目录是文件夹的另一种叫法。 -命令行接口,简称 CLI,允许你通过基于文本的命令与操作系统交互。你将在后续课程中了解更多关于这些工具的内容。 +命令行界面,简称 CLI,允许你通过基于文本的命令与操作系统交互。你将在后续课程中学习更多关于这些工具的内容。 如果你使用的是 Windows 系统,可以使用命令提示符或 PowerShell。 如果你使用的是 Mac,可以打开终端应用程序。 -打开命令行后,输入 `cd ~` 命令并点击键盘上的 `enter` 键,导航到主目录。 Then type in the `mkdir my-project` command and hit `enter`. `mkdir`, or "make directory" is the command used to create a new directory. 然后用 VS Code 打开新目录。 +命令行打开后,导航到你的主目录。在命令提示符中,输入 `cd /d %USERPROFILE%` 并按键盘上的 `Enter`。在 PowerShell 或 macOS 终端中,输入 `cd ~` 并按 `Enter`。然后输入 `mkdir my-project` 命令并按 `Enter`。`mkdir`,即“创建目录”,是用来创建新目录的命令。接着你应该用 VS Code 打开你新创建的目录。 -创建新目录还有其他一些图形化的方式。 +在 VS Code 中还有其他打开目录的方法。 根据操作系统的不同,你可能有一个上下文菜单(或右键单击选项),可以直接从文件资源管理器打开 VS Code。 你也可以选择双击 VS Code 应用程序。 如果你对命令行操作熟练,可以运行 `code /path/to/folder` 命令。 打开后,你会看到一个新的空白工作区。 -要创建新文件,请单击左上角的 `File` 菜单,然后选择 `New File...`。 然后将文件命名为 `index.html`,点击 `Save`。 +要创建新文件,点击左上角的 `File` 菜单并选择 `New File...`。然后将文件命名为 `index.html` 并点击 `Save`。 现在,你应该能在资源管理器选项卡中看到新文件了。 尝试在 `index.html` 文件中添加一些 HTML。 @@ -31,15 +31,15 @@ dashedName: how-to-create-a-project-and-run-your-code-locally-in-vs-code 相反,你应该将 HTML 文件放在一个适当的网络服务器后面。 如果你是编码新手,这听起来可能是一项艰巨的任务,但实际上有一种方法可以从 VS Code 中直接完成这项任务。 -你需要先下载 *Live Server* 扩展,该扩展在应用商店免费提供。 +你需要先获取 Live Server 扩展(程序、功能),它可以在市场中免费获得。 -单击左上角的扩展选项卡,然后在搜索栏中输入 `Live Server`。 +点击左侧边栏的扩展(程序、功能)标签(页),然后在搜索栏中输入 `Live Server`。 -安装完成后,你应该会在状态栏中看到一个 `Go live` 按钮。 确保已打开 HTML 文件,然后点击它。 +安装完成后,你应该会在状态栏看到一个 `Go Live` 按钮。确保你已经打开了 HTML 文件,然后点击它。 -新页面会在浏览器的新标签页中自动打开。 如果没有,你可以直接访问 `http://localhost:5500/` +你的新页面应该会自动在浏览器的新标签(页)中打开。如果没有,你可以直接访问 `http://localhost:5500/`。 -恭喜! 现在,你已经在 VS Code 中建立了自己的项目,并可以通过实时服务器查看更改了。 +恭喜!你现在已经在 VS Code 中设置了你自己的项目,并可以通过 Live Server 查看你的更改。 # --questions-- @@ -57,7 +57,7 @@ Visual Studio Code 讲什么视为“工作区”? --- -你打开 VS Code 的目录。 +你在 VS Code 中打开的目录。 --- diff --git a/curriculum/challenges/chinese/blocks/lecture-working-with-code-editors-and-ides/672d456f4ac35950b300e93f.md b/curriculum/challenges/chinese/blocks/lecture-working-with-code-editors-and-ides/672d456f4ac35950b300e93f.md index 23ca352cc77..f0bec49af37 100644 --- a/curriculum/challenges/chinese/blocks/lecture-working-with-code-editors-and-ides/672d456f4ac35950b300e93f.md +++ b/curriculum/challenges/chinese/blocks/lecture-working-with-code-editors-and-ides/672d456f4ac35950b300e93f.md @@ -9,21 +9,21 @@ dashedName: what-are-several-useful-keyboard-shortcuts-for-maximizing-productivi 你可能已经熟悉了一些基本快捷方式,它们都是从操作系统中继承下来的。 例如,在 VS Code 中,`Ctrl + S` 保存文件、`Ctrl + C` 复制内容、`Ctrl + V` 粘贴内容,这些快捷键都可以正常使用。 -但还有一些特有的快捷键能进一步提升你的效率。 值得注意的是,部分快捷键可能因操作系统不同而有所差异。 +但有一些快捷键是应用特定的,仍然可以提升你的生产力。值得注意的是,这些快捷键在不同操作系统上可能有所不同。 -例如,`Shift + Alt + F` 会对当前打开的文件运行你配置好的格式化工具(比如 JavaScript 项目中的 Prettier)。 +例如,`Shift + Alt + F` 会在当前打开的文件上运行你配置的格式化工具(比如针对 JavaScript 项目的 Prettier)。 -使用 `Ctrl + Shift + F`(Windows)或者`Cmd + Shift + F`(Mac),可以搜索工作区中所有文件的文本内容。 如果想进行查找替换,使用 `Ctrl + Shift + H`(Windows)或 `Cmd + Shift + H`(Mac)。 +使用 `Ctrl + Shift + F`(Windows/Linux)或 `Cmd + Shift + F`(macOS)可以搜索工作区内所有文件的文本内容。如果你想执行查找并替换,可以使用 `Ctrl + Shift + H`(Windows/Linux)或 `Cmd + Shift + H`(macOS)。 -如果要删除一行代码,使用 `Ctrl + Shift + K`(Windows)或 `Cmd + Shift + K` (Mac)即可。 +如果你需要删除一行,`Ctrl + Shift + K`(Windows/Linux)或 `Cmd + Shift + K`(macOS)可以删除该行。 -需要更多空间来容纳你的代码?按 `Ctrl + B`(Windows)或 `Cmd + B`(Mac)将隐藏侧边栏——其中包含文件列表和扩展名菜单。 +需要为你的代码腾出更多空间吗?`Ctrl + B`(Windows)或 `Cmd + B`(Mac)会隐藏侧边栏,侧边栏包含文件列表和扩展(程序、功能)菜单。 -或者你只是看不到你的代码?`Ctrl + plus`(Windows)或 `Cmd + plus`(Mac)将增加编辑器的缩放比例,`Ctrl + minus`(Windows)或 `Cmd + minus`(Mac)将减少它。 +或者你看不清代码?`Ctrl + Plus`(Windows)或 `Cmd + Plus`(Mac)会放大编辑器的缩放比例,`Ctrl + Minus`(Windows)或 `Cmd + Minus`(Mac)会缩小它。 -VS Code 中另一个有用的特色是多行编辑,它允许你一次对多行进行更改。例如,你可以使用 `Ctrl + Alt + down` 和 `Ctrl + Alt + up`(Windows/Linux),或 `Option + Command + down` 和 `Option + Command + up`(Mac),将光标扩展到连续的多行。你也可以按住 `Alt`(Windows/Linux)或 `Option`(Mac)并点击,在需要的不同行添加光标。光标放置好后,你输入或删除的任何内容都会同时应用到所有这些位置——这在处理重复代码时可以节省大量时间。 +VS Code 另一个有用的特色是多行编辑,它允许你一次性修改多行内容。例如,你可以使用 `Ctrl + Alt + Down` 和 `Ctrl + Alt + Up`(Windows/Linux),或 `Option + Cmd + Down` 和 `Option + Cmd + Up`(Mac)在连续行上放置多个光标。你也可以按住 `Alt`(Windows/Linux)或 `Option`(Mac)并点击,在需要的不同行上添加光标。光标放置好后,你输入或删除的内容会同时应用到所有这些位置——这在处理重复代码时能节省大量时间。 -最后,如果你忘记了这些快捷键,随时可以使用 `Ctrl + Shift + P`(Windows)或 `Cmd + Shift + P`(Mac),这会打开命令面板,你可以从中选择所需的任何内容。 +最后,如果你忘记了任何快捷键,总可以使用 `Ctrl + Shift + P`(Windows/Linux)或 `Cmd + Shift + P`(macOS)打开命令面板,选择你需要的任何命令。 掌握这些知识,再加上一些练习,你离成为 VS Code 高级用户就不远了。 diff --git a/curriculum/challenges/chinese/blocks/lecture-working-with-code-editors-and-ides/672d457bcdd8b350ec2b6254.md b/curriculum/challenges/chinese/blocks/lecture-working-with-code-editors-and-ides/672d457bcdd8b350ec2b6254.md index 70760b11b64..6002fd04df2 100644 --- a/curriculum/challenges/chinese/blocks/lecture-working-with-code-editors-and-ides/672d457bcdd8b350ec2b6254.md +++ b/curriculum/challenges/chinese/blocks/lecture-working-with-code-editors-and-ides/672d457bcdd8b350ec2b6254.md @@ -7,25 +7,25 @@ dashedName: what-are-some-good-vs-code-extensions-you-can-use-in-your-editor # --description-- -*Better Comments* 是一个为特定代码注释提供特殊高亮显示的扩展。 例如,它会调出“TODO”注释以及表示问题或警告的语法。 +Better Comments 是一个扩展,提供对特定代码评论的特殊高亮。例如,它会标出“TODO”评论,以及表示疑问或警告的语法。 -*Code Spell Checker* 可在你的代码中出现拼写错误时提供提示。 因为它是为代码文件设计的,所以会考虑到驼峰大小写等情况。 +Code Spell Checker 会标记代码中拼写错误的单词。因为它是为代码文件设计的,所以会考虑驼峰命名等情况。 -*Error Lens* 将帮助你捕捉代码中任何突出显示的错误。 该扩展无需依赖 VS Code 默认显示的下划线,而是高亮显示整行并显示错误信息。 +Error Lens 让你的代码错误更难被忽视。它不依赖 VS Code 默认显示的下划线,而是高亮整行并显示错误信息。 -*Indent Rainbow* 为不同级别的缩进添加颜色。 结合 VS Code 的原生括号对着色,这可以极大地帮助识别代码所处的范围。 +Indent Rainbow 会为不同层级的缩排添加颜色。结合 VS Code 本地的方括弧点对着色,这能大大帮助你识别代码的作用域。 -或者,你也许想找一些更实用的扩展? 可以考虑使用像 *GitHub Copilot* 或 *Tabnine* 这样的 AI 助手,它们能在你编写代码时提供内联建议。 +或者你想找点更实用的东西?考虑使用 AI 助手,比如 GitHub Copilot 或 Tabnine,在你编写代码时提供内联建议。 -*VS Code Great Icons* 等图标包可以让你的文件树更加整洁,一目了然。 而像 *Colorize* 这样的扩展可以帮助你理解 CSS 属性中的值。 +图标包,比如 VS Code Great Icons,可以让你的文件树更整洁、更易于一眼解析。像 Colorize 这样的扩展能帮助你理解 CSS 属性中的数值。 -你还需要为项目安装特定语言的扩展。 如果你在使用 JavaScript,你可能需要 *ESLint* 和 *Prettier* 来检查和格式化代码。 如果你使用的是 TypeScript,你可能需要 *Pretty TypeScript Errors*,以获得更易于阅读的信息。 +你还需要为你的项目添加特定语言的扩展。如果你使用 JavaScript,可能会想要 ESLint 和 Prettier 来检查和格式化代码。如果你使用 TypeScript,可能会想要 Pretty TypeScript Errors 来获得更易读的消息。 -最后,你还可以在编辑器中玩点有趣的东西。*VS Code Pets* 提供可配置的虚拟宠物,陪伴你在碰撞一些错误时。 +最后,你也可以在编辑器里玩点乐子。VS Code Pets 提供可配置的虚拟宠物,陪伴你在修复错误时不孤单。 -*Power Mode* 会在你通过编写更多代码达到足够高的“连击”时产生华丽的效果。 +Power Mode 会在你通过写更多代码达到足够高的“连击”时,产生炫酷的视觉效果。 -*Discord Presence* 可让你向所有朋友展示你的工作成果。 +Discord Presence 让你可以向所有朋友展示你正在做的工作。 还有更多的扩展。 你可以随意浏览扩展市场,看看哪些扩展最适合你。 @@ -33,7 +33,7 @@ dashedName: what-are-some-good-vs-code-extensions-you-can-use-in-your-editor ## --text-- -“Better Comments”扩展在 VS Code 中提供什么功能? +Better Comments 扩展在 VS Code 中提供了什么特色? ## --answers-- @@ -69,7 +69,7 @@ dashedName: what-are-some-good-vs-code-extensions-you-can-use-in-your-editor ## --text-- -哪个VS Code扩展被描述为通过在整个行上显示错误信息来帮助捕获代码中的高亮错误? +哪个 VS Code 扩展会高亮整行并内联显示错误信息,而不是依赖默认的下划线? ## --answers-- @@ -105,7 +105,7 @@ ESLint ## --text-- -“VS Code Pets”扩展提供了什么独特功能? +VS Code Pets 扩展提供了什么独特的特色? ## --answers-- diff --git a/curriculum/challenges/chinese/blocks/lecture-working-with-css-flexbox/672aa7f7284b235f46f7d4e9.md b/curriculum/challenges/chinese/blocks/lecture-working-with-css-flexbox/672aa7f7284b235f46f7d4e9.md index 5f43264529a..4a53ad2b55a 100644 --- a/curriculum/challenges/chinese/blocks/lecture-working-with-css-flexbox/672aa7f7284b235f46f7d4e9.md +++ b/curriculum/challenges/chinese/blocks/lecture-working-with-css-flexbox/672aa7f7284b235f46f7d4e9.md @@ -319,7 +319,7 @@ CSS flexbox 的主要目的是什么? ### --feedback-- -考虑 flex container 内元素的分布。 +想一想主轴和交叉轴是如何相互定位的。 --- @@ -327,7 +327,7 @@ CSS flexbox 的主要目的是什么? ### --feedback-- -考虑 flex container 内元素的分布。 +想一想主轴和交叉轴是如何相互定位的。 --- @@ -339,7 +339,7 @@ CSS flexbox 的主要目的是什么? ### --feedback-- -考虑 flex container 内元素的分布。 +想一想主轴和交叉轴是如何相互定位的。 ## --video-solution-- diff --git a/curriculum/challenges/chinese/blocks/lecture-working-with-css-flexbox/672bd658c0e190f674a5e057.md b/curriculum/challenges/chinese/blocks/lecture-working-with-css-flexbox/672bd658c0e190f674a5e057.md index 6c1511c36f7..6a4ce6fd297 100644 --- a/curriculum/challenges/chinese/blocks/lecture-working-with-css-flexbox/672bd658c0e190f674a5e057.md +++ b/curriculum/challenges/chinese/blocks/lecture-working-with-css-flexbox/672bd658c0e190f674a5e057.md @@ -7,11 +7,11 @@ dashedName: what-are-some-common-flex-properties # --interactive-- -Flex 属性是你可以应用到弹性容器上的属性,用于确定子元素的分布。我们将介绍一些最常用的属性:`flex-wrap`、`justify-content` 和 `align-items`。 +Flex 属性控制元素在 flex 版型中的行为,从容器级别的分布到项级别的自我对齐。本课将介绍一些最常用的属性:`flex-wrap`、`flex-flow`、`justify-content`、`align-items` 和 `align-self`。 -让我们从 `flex-wrap` 开始。该属性决定了弹性项如何在弹性容器内换行以适应可用空间。`flex-wrap` 可以取三个可能的值:`nowrap`、`wrap` 和 `wrap-reverse`。`nowrap` 是默认值——即使弹性项的宽度超过容器宽度,也不会换行到新的一行。 +我们先从 `flex-wrap` 开始。这个属性决定了 flex 项如何在 flex 容器内换行以适应可用空间。`flex-wrap` 有三个可能的取值:`nowrap`、`wrap` 和 `wrap-reverse`。`nowrap` 是默认值:即使 flex 项的宽度超过容器宽度,也不会换行。 -在下面的代码中,我们有三个 `div` 元素。让我们关注 `width`。用红色边框标记的 `main` 容器的 `width` 是 `200px`,而它的三个子 `div` 元素的总 `width` 是 `240px`(每个 `80px`): +在下面的代码中,我们有三个 `div` 元素。让我们关注一下它们的 `width`。带边框的 `main` 容器的 `width` 是 `200px`,而它的三个子 `div` 元素的总 `width` 是 `240px`(每个 `80px`): :::interactive_editor @@ -28,7 +28,7 @@ Flex 属性是你可以应用到弹性容器上的属性,用于确定子元素 main { width: 200px; display: flex; - border: 2px solid red; + border: 2px solid #444; } div { @@ -51,7 +51,6 @@ div { ::: - `div` 元素的宽度超过了它们容器的宽度,但默认情况下它们会被缩小以适应可用空间。如果你确实想在它们超过容器宽度时换行,可以在弹性容器上设置 `flex-wrap: wrap`: :::interactive_editor @@ -70,7 +69,7 @@ main { width: 200px; display: flex; flex-wrap: wrap; - border: 2px solid red; + border: 2px solid #444; } div { @@ -109,9 +108,10 @@ div { ```css main { width: 200px; + height: 120px; display: flex; flex-flow: column wrap-reverse; - border: 2px solid red; + border: 2px solid #444; } div { @@ -151,7 +151,7 @@ div { main { display: flex; justify-content: flex-start; - border: 2px solid red; + border: 2px solid #444; } div { @@ -174,7 +174,7 @@ div { ::: -使用 `justify-content: flex-end`,弹性项沿主轴的末端对齐,水平或垂直方向。 +使用 `justify-content: flex-end`,弹性项沿主轴的末端对齐,水平或垂直方向。 :::interactive_editor @@ -191,7 +191,7 @@ div { main { display: flex; justify-content: flex-end; - border: 2px solid red; + border: 2px solid #444; } div { @@ -231,7 +231,7 @@ div { main { display: flex; justify-content: center; - border: 2px solid red; + border: 2px solid #444; } div { @@ -254,7 +254,7 @@ div { ::: -要沿主轴均匀分布元素,你可以使用 `justify-content: space-between`。如果需要,这将为弹性项之间添加一些间距。 +要沿主轴分布元素且边缘没有空隙,可以使用 `justify-content: space-between`。第一个项位于主轴起点,最后一个项位于主轴终点,剩余空间均匀分布在相邻项之间。 :::interactive_editor @@ -271,7 +271,7 @@ div { main { display: flex; justify-content: space-between; - border: 2px solid red; + border: 2px solid #444; } div { @@ -294,7 +294,7 @@ div { ::: -`justify-content: space-around` 在主轴内均匀分布弹性项,为第一个项之前和最后一个项之后添加空间。这个额外的空间是每对相邻项之间空间的一半。如果只有一项需要分布,它将被居中。 +`justify-content: space-around` 会沿主轴均匀分布 flex 项,在第一个项之前和最后一个项之后各添加一个空隙。这个额外空隙是相邻两项之间空隙的一半。如果只有一个项需要分布,它会被居中。 :::interactive_editor @@ -311,7 +311,7 @@ div { main { display: flex; justify-content: space-around; - border: 2px solid red; + border: 2px solid #444; } div { @@ -334,8 +334,7 @@ div { ::: - -最后但同样重要的是,我们有 `justify-content: space-evenly`,它沿主轴均匀分布这些项。项之间的间距以及第一个和最后一个元素之前和之后的间距完全相同: +最后是 `justify-content: space-evenly`,它沿主轴均匀分布所有项。项之间的空隙以及第一个和最后一个项前后的空隙完全相等: :::interactive_editor @@ -352,7 +351,7 @@ div { main { display: flex; justify-content: space-evenly; - border: 2px solid red; + border: 2px solid #444; } div { @@ -375,7 +374,7 @@ div { ::: -太好了。现在你知道如何沿主轴分布 flex 项。但你可能还想沿交叉轴分布它们。记住交叉轴垂直于主轴。你可以使用 `align-items` 属性来实现这一点。要沿交叉轴居中项,只需为 flex 容器添加 `align-items: center`: +太好了。现在你知道如何沿主轴分布 flex 项。但你可能还想沿交叉轴分布它们。记住交叉轴垂直于主轴。你可以使用 `align-items` 属性来实现这一点。要沿交叉轴居中项,只需为 flex 容器添加 `align-items: center`: :::interactive_editor @@ -390,10 +389,10 @@ div { ```css main { - height: 300px; display: flex; + height: 300px; align-items: center; - border: 2px solid red; + border: 2px solid #444; } div { @@ -431,10 +430,10 @@ div { ```css main { - height: 300px; display: flex; + height: 300px; align-items: flex-start; - border: 2px solid red; + border: 2px solid #444; } div { @@ -457,7 +456,7 @@ div { ::: -相反的是 `align-items: flex-end`。这将使弹性项沿交叉轴的末端对齐,垂直或水平。 +相反的是 `align-items: flex-end`。这将使弹性项沿交叉轴的末端对齐,垂直或水平。 :::interactive_editor @@ -472,10 +471,10 @@ div { ```css main { - height: 300px; display: flex; + height: 300px; align-items: flex-end; - border: 2px solid red; + border: 2px solid #444; } div { @@ -498,147 +497,169 @@ div { ::: -要沿交叉轴拉伸弹性项,你可以使用 `align-items: stretch`。这也适用于自动调整大小的元素,例如那些没有设置 `width` 或 `height`,或者只有最小 `width` 或 `height` 的元素。弹性项将在交叉轴方向上拉伸以填充容器。 +要沿交叉轴拉伸 flex 项,可以使用 `align-items: stretch`。这只影响交叉轴尺寸为 `auto` 的项;那些在交叉轴上有显式尺寸(例如行容器中设置了 `height`)的项不会被拉伸。受影响的项会在交叉轴方向填满容器。 :::interactive_editor ```html <link rel="stylesheet" href="styles.css"> - -<div class="container"> - <div class="box">One</div> - <div class="box">Two</div> - <div class="box">Three</div> -</div> - +<main> + <div id="first-div"></div> + <div id="second-div"></div> + <div id="third-div"></div> +</main> ``` ```css -.container { +main { display: flex; - align-items: stretch; + height: 300px; + align-items: stretch; border: 2px solid #444; - height: 200px; } -.box { - width: 100px; - border: 1px solid #888; - background-color: lightblue; +div { + width: 80px; + height: 50px; +} + +#first-div { + background-color: #4d70b2; +} + +#second-div { + background-color: #5c4db2; +} + +#third-div { + background-color: #4da3b2; + height: auto; } ``` ::: -最后,你可以使用 `align-self` 属性为单个弹性项赋值不同的交叉轴对齐方式。例如,你可以使用 `align-self: stretch` 将其拉伸。 +最后,你可以使用 `align-self` 属性为单个弹性项赋值不同的交叉轴对齐方式。例如,你可以使用 `align-self: stretch` 将其拉伸。 :::interactive_editor ```html <link rel="stylesheet" href="styles.css"> - -<div class="container"> - <div class="box">One</div> - <div class="box">Two</div> - <div class="box special">Three</div> -</div> - +<main> + <div id="first-div"></div> + <div id="second-div"></div> + <div id="third-div"></div> +</main> ``` ```css -.container { +main { display: flex; - align-items: flex-start; + height: 300px; + align-items: flex-start; border: 2px solid #444; - height: 200px; } -.box { - width: 100px; - border: 1px solid #888; - background-color: lightblue; - margin: 4px; +div { + width: 80px; + height: 50px; } -.special { - align-self: stretch; - background-color: lightcoral; +#first-div { + background-color: #4d70b2; +} + +#second-div { + background-color: #5c4db2; +} + +#third-div { + background-color: #4da3b2; + align-self: stretch; } ``` ::: -你可以用 `align-self: center` 将其居中。 +你可以用 `align-self: center` 将其居中。 :::interactive_editor ```html <link rel="stylesheet" href="styles.css"> - -<div class="container"> - <div class="box">One</div> - <div class="box">Two</div> - <div class="box special">Three</div> -</div> - +<main> + <div id="first-div"></div> + <div id="second-div"></div> + <div id="third-div"></div> +</main> ``` ```css -.container { +main { display: flex; - align-items: flex-start; + height: 300px; + align-items: flex-start; border: 2px solid #444; - height: 200px; } -.box { - width: 100px; - border: 1px solid #888; - background-color: lightblue; - margin: 4px; +div { + width: 80px; + height: 50px; +} + +#first-div { + background-color: #4d70b2; +} + +#second-div { + background-color: #5c4db2; } -.special { - align-self: center; - background-color: lightcoral; +#third-div { + background-color: #4da3b2; + align-self: center; } ``` ::: -你可以使用 `align-self: flex-start` 将其对齐到交叉轴的起点。 +你可以使用 `align-self: flex-start` 将其对齐到交叉轴的起点。 :::interactive_editor ```html <link rel="stylesheet" href="styles.css"> - -<div class="container"> - <div class="box">One</div> - <div class="box">Two</div> - <div class="box special">Three</div> -</div> - +<main> + <div id="first-div"></div> + <div id="second-div"></div> + <div id="third-div"></div> +</main> ``` ```css -.container { +main { display: flex; - align-items: flex-start; + height: 300px; + align-items: flex-start; border: 2px solid #444; - height: 200px; } -.box { - width: 100px; - border: 1px solid #888; - background-color: lightblue; - margin: 4px; +div { + width: 80px; + height: 50px; +} + +#first-div { + background-color: #4d70b2; } -.special { - align-self: flex-start; - background-color: lightcoral; +#second-div { + background-color: #5c4db2; +} + +#third-div { + background-color: #4da3b2; + align-self: flex-start; } ``` @@ -650,39 +671,43 @@ div { ```html <link rel="stylesheet" href="styles.css"> - -<div class="container"> - <div class="box">One</div> - <div class="box">Two</div> - <div class="box special">Three</div> -</div> - +<main> + <div id="first-div"></div> + <div id="second-div"></div> + <div id="third-div"></div> +</main> ``` ```css -.container { +main { display: flex; - align-items: flex-start; + height: 300px; + align-items: flex-start; border: 2px solid #444; - height: 200px; } -.box { - width: 100px; - border: 1px solid #888; - background-color: lightblue; - margin: 4px; +div { + width: 80px; + height: 50px; } -.special { - align-self: flex-end; - background-color: lightcoral; +#first-div { + background-color: #4d70b2; +} + +#second-div { + background-color: #5c4db2; +} + +#third-div { + background-color: #4da3b2; + align-self: flex-end; } ``` ::: -还有其他的 flex 属性和值,你可以选择来创建你设想的响应式版型,但这些是最常用的。通过这些 CSS flex 属性和你对 CSS flex 模型的新知识,你可以开始创建响应式版型,以在各种设备上打造流畅且包容的用户体验。 +还有其他 flex 属性和值可供选择,帮助你创建理想的响应式版型,但这些是最常用的。掌握这些 CSS flex 属性和 CSS flex 模型的新知识后,你可以开始创建响应式版型,为各种设备打造流畅且包容的用户体验。 # --questions-- @@ -764,7 +789,7 @@ div { ## --answers-- -`flex-direction` 和 `justify-content`。 +`flex-direction` 和 `justify-content` ### --feedback-- @@ -772,7 +797,7 @@ div { --- -`flex-direction` 和 `align-items`。 +`flex-direction` 和 `align-items` ### --feedback-- @@ -780,7 +805,7 @@ div { --- -`flex-direction` 和 `align-content`。 +`flex-direction` 和 `align-content` ### --feedback-- @@ -788,7 +813,7 @@ div { --- -`flex-direction` 和 `flex-wrap`。 +`flex-direction` 和 `flex-wrap` ## --video-solution-- diff --git a/curriculum/challenges/chinese/blocks/lecture-working-with-css-fonts/672bd814105a0ffcf36f9233.md b/curriculum/challenges/chinese/blocks/lecture-working-with-css-fonts/672bd814105a0ffcf36f9233.md index 664d4779978..d04b4d9579b 100644 --- a/curriculum/challenges/chinese/blocks/lecture-working-with-css-fonts/672bd814105a0ffcf36f9233.md +++ b/curriculum/challenges/chinese/blocks/lecture-working-with-css-fonts/672bd814105a0ffcf36f9233.md @@ -1,6 +1,6 @@ --- id: 672bd814105a0ffcf36f9233 -title: What Are Font Families and How Do They Work? +title: 字体家族是什么以及它们如何工作? challengeType: 19 dashedName: what-are-font-families --- @@ -11,6 +11,8 @@ dashedName: what-are-font-families <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/what-are-font-families-and-how-do-they-work-1.png" alt="Diagram showing 'Arial' at the top with two blue arrows pointing down to 'Arial Bold' on the left and 'Arial Italic' on the right, illustrating font family variations" /> +## 在 CSS 中设置字体家族 + 在 CSS 中,你可以使用 `font-family` 属性设置字体系。下面是将段落字体设置为 `Arial` 的示例: :::interactive_editor @@ -29,6 +31,8 @@ dashedName: what-are-font-families ::: +## 备用字体 + 但如果未找到该字体族怎么办? 你可以通过逗号分隔,按优先级从高到低指定多个字体族。 这些备用字体将作为回退选项。 在此示例中,Arial 是首选字体,Lato 是备用字体: :::interactive_editor @@ -51,6 +55,8 @@ dashedName: what-are-font-families 你还需要了解这一过程背后的工作原理。 即使第一个字体可用,字体选择过程也不会停止。 字体族是逐个字符选择的,因此,如果某个字体缺少特定字符,浏览器会在优先级较低的字体中查找该字符。 很有趣,对吧? +## 通用字体家族 + 在网页开发中,你还会遇到通用字体族。 它们非常重要。 通用字体族是当更高优先级的字体不可用时,网络浏览器将渲染的默认字体。 为确保内容仍可读,浏览器会根据指定的通用字体族,用能找到的最合适的字体替换原始字体。 一些最常用的通用字体族包括: - 衬线 @@ -81,6 +87,8 @@ Arial 具有最高优先级。 如果未找到 Arial,浏览器将尝试渲染 你应始终在字体族列表末尾包含一个通用字体族。 请记住,通用字体可能与你在设计中最初设想的字体外观不同,因此检查这些回退字体在不同浏览器上的显示效果总是很有帮助的。 +## 网络安全字体 + 为了尽可能保持用户体验一致,还建议使用网页安全字体。 这些字体族通常安装在大多数设备上,因此对于大多数用户而言,它们很可能会被找到并正确渲染。 You'll learn more about them in the next lessons. 字体族在网页设计领域至关重要。 通过使用 font-family 属性,你可以立即改变文本的外观和感觉。 diff --git a/curriculum/challenges/chinese/blocks/lecture-working-with-css-fonts/672bd8453d1371fdb1510fe5.md b/curriculum/challenges/chinese/blocks/lecture-working-with-css-fonts/672bd8453d1371fdb1510fe5.md index 10c1a054904..13bc1b3f682 100644 --- a/curriculum/challenges/chinese/blocks/lecture-working-with-css-fonts/672bd8453d1371fdb1510fe5.md +++ b/curriculum/challenges/chinese/blocks/lecture-working-with-css-fonts/672bd8453d1371fdb1510fe5.md @@ -11,6 +11,8 @@ dashedName: how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fo Google Fonts 和 Font Squirrel 是查找和使用免费字体进行网页开发的常用在线资源。 你可以非常容易地将它们融入到项目中。 +## Google 字体 + 让我们从 Google 字体开始。 这是一项 Google 服务,提供一系列字体,其中许多字体是专门为网页开发而设计的。 在 Google Fonts 的用户界面上,你可以看到许多不同的元素。 让我们逐一介绍。 在左侧边栏,你可以找到: - 用于查看、查找和过滤字体的区域。 @@ -18,6 +20,8 @@ Google Fonts 和 Font Squirrel 是查找和使用免费字体进行网页开发 - 可以为你的网络项目查找和下载图标的区域。 - 可以了解更多有关字体及其最佳实践以及常见问题的区域。 +## 预览 Google 字体 + 要在网站上添加 Google Font,应进入第一部分(字体)。 你可以自定义左侧边栏中“Preview”旁边的预览文本。 只需输入你想要查看的文本,它会自动更新。 这有助于你根据网站上已有的文本预览字体。 你还可以调整字体大小,并根据字体的特性筛选字体。 <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-1.png" alt="Google Fonts Fonts section showing a left sidebar with preview text set to 'freeCodeCamp' at 40px, filter options for Language, Technology, and Decorative stroke, and the main panel listing font families including Roboto, SUSE, and Sevillana each previewing 'freeCodeCamp'" /> @@ -28,12 +32,16 @@ Google Fonts 和 Font Squirrel 是查找和使用免费字体进行网页开发 <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-2.png" alt="Google Fonts Roboto Styles page with Specimen, Type tester, Glyphs, and About & license tabs, a blue Get font button, a preview text field showing 'freeCodeCamp' with a font size slider at 48px, and a list of styles including Thin 100, Thin 100 Italic, Light 300, and Light 300 Italic" /> +## 使用 Google 字体 + 准备好将字体添加到项目后,点击顶部的蓝色“获取字体”按钮。 你将进入一个摘要页面,在这里可以看到你当前选择的字体。 你可以同时选择多种字体。 <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-3.png" alt="Google Fonts page showing '1 font family selected' with Roboto Static listed, Get embed code and Download all buttons on the right, and a How to use section with All, Design, Develop, and Google products tabs" /> 接下来,你必须选择是将字体文件下载为局部文件并添加到你的项目中,还是作为外部字体使用,并在用户进入你的网站时从 Google 的服务器下载它们。 如果你想下载字体文件,请点击 "Download all";如果你更愿意将它们作为 Google 服务器上的外部字体使用,请点击 "Get embed code"。 如果你点击 "Get embed code",你将看到添加这些外部字体到你的项目中应遵循的说明。 +### 链接 Google 字体 + 对于网页开发项目,你有两种选择。 你可以使用 `link` 元素或 `@import`。 如果你选择 `link` 元素选项,则可以复制并粘贴 HTML 代码段和 CSS 规则,将其添加到项目中。 你应将代码嵌入 HTML 文件的 `head` 元素中,并添加适合你需要的 CSS 规则。 <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-4.png" alt="Google Fonts Embed code page with the link element option selected, showing three link tags for preconnect and the font stylesheet, a CSS classes section with .roboto-thin, .roboto-light, .roboto-regular, and .roboto-medium rules, and a left sidebar showing font style toggles" /> @@ -141,6 +149,8 @@ Google Fonts 和 Font Squirrel 是查找和使用免费字体进行网页开发 每种字体样式都有一条 CSS 规则。 每条规则都会为自定义字体分配备用字体,以防自定义字体无法正常加载。 +### 导入 Google 字体 + 如果你选择 `@import` 选项,则需要在 CSS 文件中添加该规则。 <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-5.png" alt="Google Fonts Embed code page with the @import option selected, showing a style block containing the @import URL rule, a CSS classes section below, and the left sidebar with font style toggles" /> @@ -159,10 +169,14 @@ CSS 规则完全相同。 这就是 Google Fonts。 它是为网页开发项目查找免费和开源字体的最常用选项之一。 +## Font Squirrel + 另一个不错的选择是 Font Squirrel,你可以在这里找到并下载你为设计所设想的定制字体。 <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-7.png" alt="Font Squirrel 'Free Font Utopia' page listing featured free fonts including Acherus Grotesque, Intro Rust, Source Sans Pro, Open Sans, and Questa, each shown with an alphabet specimen and a Download button" /> +## 预览 Font Squirrel + 如果你搜索字体并点击搜索结果,你将看到有关该字体的更多详细信息,包括字体样本、测试工具、字形和 Webfont 工具包。 <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-8.png" alt="Font Squirrel search results for 'Roboto' showing three matches: Roboto, Roboto 2014, and Roboto Slab, each with an alphabet specimen and a Download TTF button" /> @@ -173,6 +187,8 @@ CSS 规则完全相同。 <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-10.png" alt="Font Squirrel Roboto Specimens section listing all styles with alphabet samples: Roboto Thin, Thin Italic, Light, Light Italic, Regular, Italic, Medium, Medium Italic, Bold, Bold Italic, and Black, each in its respective weight" /> +## 使用 Font Squirrel + 确定要在项目中使用的字体后,请转到 "Webfont Kit" 选项卡。 在这里,你可以检查字体的许可协议是否允许你在 `@font-face` CSS 嵌入中使用该字体。 你还可以选择子集和格式。 <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-11.png" alt="Font Squirrel Roboto Webfont Kit tab showing a license notice confirming @font-face embedding is allowed, a subset selector set to Western Latin, format checkboxes with WOFF selected, and a Download @font-face Kit button" /> diff --git a/curriculum/challenges/chinese/blocks/lecture-working-with-css-fonts/672bd853c985cdfdeb32f4f9.md b/curriculum/challenges/chinese/blocks/lecture-working-with-css-fonts/672bd853c985cdfdeb32f4f9.md index bd43f62a4a2..1794c327d82 100644 --- a/curriculum/challenges/chinese/blocks/lecture-working-with-css-fonts/672bd853c985cdfdeb32f4f9.md +++ b/curriculum/challenges/chinese/blocks/lecture-working-with-css-fonts/672bd853c985cdfdeb32f4f9.md @@ -13,6 +13,8 @@ CSS 默认情况下不会对文字应用任何阴影。 这是一个没有任何 text-shadow: /* Values */ ``` +## `X` 和 `Y` 偏移值 + 在 CSS 中,你可以通过 `X` 偏移、`Y` 偏移、模糊半径和颜色的组合来描述阴影。 首先,你需要指定 `X` 和 `Y` 偏移,它们分别代表阴影与文本的水平和垂直距离。 这些值是必需的。 下面是一个如何在阴影上应用 `X` 和 `Y` 偏移的示例。 我们应用 `text-shadow` 属性,其 x 偏移为 `3px`,y 偏移为 `2px`: @@ -32,7 +34,11 @@ p { ::: -在浏览器中,文本和阴影的外观相似,但我们也可以通过指定偏移之前或之后的值来定制阴影的颜色。 我们来设置阴影颜色。 我们将在这里使用十六进制颜色,但你也可以使用任何有效的颜色格式。 +在浏览器中,文本和阴影看起来会很相似。 + +## 为阴影添加颜色 + +我们还可以通过在偏移值之前或之后指定颜色值来自定义阴影颜色。让我们设置阴影颜色。这里我们将使用十六进制颜色,但你也可以使用任何有效的颜色格式。 :::interactive_editor @@ -66,7 +72,11 @@ p { ::: -在浏览器中,阴影会有特定的颜色,因此我们可以很容易地将其与文本区分开来。 我们区分了阴影和文字,了解正负值对阴影偏移的影响也很重要。 `X` 偏移和 `Y` 偏移的正值将分别使阴影向右和向下移动,而负值将使阴影向左和向上移动。 下面是一个使用负值的例子: +在浏览器中,阴影会有特定的颜色,因此我们可以很容易地区分它和文本。 + +## 正负偏移值 + +既然我们可以区分阴影和文本,了解正负值如何影响阴影偏移也很重要。`X` 偏移和 `Y` 偏移的正值会分别将阴影向右和向下移动,而负值会将阴影向左和向上移动。下面是一个使用负值的例子: :::interactive_editor @@ -83,7 +93,11 @@ p { ::: -现在,阴影将相对文字向左和向上移动。 很好。 但阴影看起来并不美观,因为它看起来和原来的文字一模一样,只是放在了文字的后面。 为了让它看起来更好看,我们需要添加第三个值,即模糊半径。 这个值是可选的,但能让阴影看起来更平滑、更细腻。 模糊半径的默认值为零。 数值越大,模糊程度越高,这意味着阴影会变浅。 +现在阴影会相对于文本向左和向上移动。很好。 + +## 模糊半径 + +但是阴影看起来不太好,因为它看起来和原始文本完全一样,只是放在了后面。为了让它看起来更好,我们需要添加第三个值——模糊半径。这个值是可选的,但能让阴影看起来更平滑、更柔和。模糊半径的默认值是零。值越大,模糊越大,阴影就越浅。 在这里,我们将模糊半径设置为 `3px`,偏移也恢复为正值: @@ -104,6 +118,8 @@ p { 现在,它开始像一个阴影了。 它更模糊、更细腻,因此我们可以把注意力集中在主要文字上,而阴影则为背景增添了一些风格。 在此基础上,我们可以对数值稍作调整,直到找到适合我们需要的偏移、颜色和模糊半径组合。 +## 添加多个阴影 + 知道文字可以有多个阴影也很有帮助。 你只需将它们写入同一个 `text-shadow` 属性中,并用逗号分隔。 他们将从前到后分层应用,第一个阴影位于顶层。 下面是一个分层应用了三种阴影的段落示例。 请注意,所有这些阴影都定义在同一个 `text-shadow` 属性中,并用逗号隔开: diff --git a/curriculum/challenges/chinese/blocks/lecture-working-with-css-transforms-overflow-and-filters/672bccc8ea33bad87abb3c56.md b/curriculum/challenges/chinese/blocks/lecture-working-with-css-transforms-overflow-and-filters/672bccc8ea33bad87abb3c56.md index 20b275c89e0..4b5f5f930c2 100644 --- a/curriculum/challenges/chinese/blocks/lecture-working-with-css-transforms-overflow-and-filters/672bccc8ea33bad87abb3c56.md +++ b/curriculum/challenges/chinese/blocks/lecture-working-with-css-transforms-overflow-and-filters/672bccc8ea33bad87abb3c56.md @@ -1,6 +1,6 @@ --- id: 672bccc8ea33bad87abb3c56 -title: content-box 和 border-box 有什么区别? +title: Content-box 和 border-box 有什么区别? challengeType: 19 dashedName: what-is-the-difference-between-content-box-and-border-box --- @@ -19,6 +19,8 @@ dashedName: what-is-the-difference-between-content-box-and-border-box `box-sizing` 的默认值是 `content-box`,但如果需要,你可以选择 `border-box`。 下面我们先讲 `content-box`,再讲 `border-box`。 +## 回顾 CSS 盒模型 + 要理解这些模型如何工作,你需要熟悉 CSS 盒模型中的四个核心概念。让我们快速回顾一下它们。 - 内容区域是元素内容所占的空间。 @@ -26,11 +28,13 @@ dashedName: what-is-the-difference-between-content-box-and-border-box - 边框是环绕内容区域和内边距的轮廓。 - 外边距是边框外的空间,用于将元素与其他元素分隔开来。 +## `content-box` 的工作原理 + 在 `content-box` 模型中,你为一个元素设置的宽度和高度决定了内容区域的维度,但不包括内边距、边框或外边距。当你需要对内容区域进行精确控制时,使用 `content-box`。当你设置 `width` 和 `height` 时,你仅仅是在设置内容本身的大小。 要查找元素的总宽度,你需要添加左侧和右侧的内边距,以及左侧和右侧的边框。同样,元素的总高度可以通过添加内容高度、顶部和底部的内边距,以及顶部和底部的边框来查找。 -例如,这里我们为所有 `div` 元素设置了一个 CSS 类型选择器。 +例如,这里我们为所有 `div` 元素设置了一个 CSS 类型选择器。 :::interactive_editor @@ -52,10 +56,14 @@ div { 在这种分支中,如果使用 `content-box`,内容区域将是 300px × 200px。总渲染大小包括内边距和边框——例如,总宽度 = 300px(内容)+ 40px(内边距)+ 8px(边框)= 348px;总高度的计算方式相同。 +## `border-box` 的工作原理 + 很好! 现在我们来看 `border-box`。 It's different because the width and height you set include the element's content, padding, and border (but not its margin). Use `border-box` when you want the element's total size to stay fixed even if padding or borders change — that's often helpful in responsive layouts. 使用 `border-box` 时,内边距和边框包含在元素指定的大小内。你设置的 `width` 和 `height` 成为元素的总维度:内容 + 内边距 + 边框;外边距仍然被排除。 +## 比较这两种模型 + 在以下示例中,有两个具有相同维度但不同 `box-sizing` 值的 `div` 元素。注意这如何导致在浏览器中显示时总尺寸不同: :::interactive_editor @@ -89,7 +97,7 @@ div { ::: -你可以看到,二者具有相同的 `width`、`height`、`padding`、`border` 和 `margin`。 The only differences are in the colors and the value of the `box-sizing` property. 这微小的差别对最终尺寸有着非常重要的影响。 +你可以看到,二者具有相同的 `width`、`height`、`padding`、`border` 和 `margin`。 The only differences are in the colors and the value of the `box-sizing` property. 这微小的差别对最终尺寸有着非常重要的影响。 `content-box` 和 `border-box` 之间的选择,实际上取决于项目的具体需求。 虽然 `border-box` 因其简单灵活而越来越受欢迎,但了解这两种模型对于实现有效的 CSS 布局非常重要。 diff --git a/curriculum/challenges/chinese/blocks/lecture-working-with-dates/6733aafb9c0802f66cc1e056.md b/curriculum/challenges/chinese/blocks/lecture-working-with-dates/6733aafb9c0802f66cc1e056.md index 72a7630aa8b..bc19482d878 100644 --- a/curriculum/challenges/chinese/blocks/lecture-working-with-dates/6733aafb9c0802f66cc1e056.md +++ b/curriculum/challenges/chinese/blocks/lecture-working-with-dates/6733aafb9c0802f66cc1e056.md @@ -34,21 +34,31 @@ console.log(now); 时间使用的是 24 小时制格式,所以 `14:30` 是 `2:30 PM`。`GMT-0700` 是时区偏移量,`Pacific Daylight Time` 是时区名称。 -你也可以通过提供年、月、日、小时、分钟、秒和毫秒值作为参数,将特定的日期和时间传递给 `Date` 对象。 +下面是使用特定日期字串创建新的 `Date` 对象的示例: -下面是使用特定日期和时间创建新建 `Date` 对象的示例: +:::interactive_editor + +```js +const dateFromString = new Date("July 4, 1776 12:00:00"); + +console.log(dateFromString); +``` + +::: + +你也可以通过提供年、月、日、小时、分钟、秒和毫秒值作为参数,将特定的日期和时间传递给 `Date` 对象: :::interactive_editor ```js -const specificDate = new Date("July 4, 1776 12:00:00"); +const dateFromArguments = new Date(1776, 6, 4, 12, 0, 0, 0); -console.log(specificDate); +console.log(dateFromArguments); ``` ::: -当你需要处理特定的日期和时间而不是当前的日期和时间时,这非常有用。输入始终需要是一个字串,且格式应能被 `Date` 对象识别。 +当你需要处理特定的日期和时间而不是当前的日期和时间时,这非常有用。 要获取当前日期和时间,你可以使用 `Date.now()` 方法,它返回自 `January 1, 1970, 00:00:00 UTC` 以来的毫秒数。这被称为 Unix 纪元时间。 diff --git a/curriculum/challenges/chinese/blocks/lecture-working-with-file-systems/672ac403a9ba7732b31c6480.md b/curriculum/challenges/chinese/blocks/lecture-working-with-file-systems/672ac403a9ba7732b31c6480.md index 02fd0c7338f..2ffeaff8813 100644 --- a/curriculum/challenges/chinese/blocks/lecture-working-with-file-systems/672ac403a9ba7732b31c6480.md +++ b/curriculum/challenges/chinese/blocks/lecture-working-with-file-systems/672ac403a9ba7732b31c6480.md @@ -51,11 +51,11 @@ WOFF 是一种现代字体格式,专门为网页开发目的设计。它代表 它们通常以一种称为 Markdown 的文件格式编写。使用 Markdown,你可以创建带有标题、副标题、链接、图像、列表等结构化文档。Markdown 文件具有 `.md` 或 `.markdown` 扩展名。 -在这里你可以找到 freeCodeCamp GitHub 仓库的 `README` 文件:https://github.com/freeCodeCamp/freeCodeCamp/blob/main/README.md +你可以在这里找到 freeCodeCamp GitHub 仓库的 `README` 文件:`https://github.com/freeCodeCamp/freeCodeCamp/blob/main/README.md` 你可以使用 Markdown 创建此详细的结构和形式。 -在你的职业生涯中,你肯定会读取和写入许多 `README` 文件。了解这些常见的文件类型对于网页开发至关重要。 +在你的职业生涯中,你肯定会读取和写入许多 `README` 文件。了解这些常见的文件类型对于网页开发至关重要。 从 HTML、CSS 和 JavaScript 的核心创建块,到图像、视频 和 音频 格式,每种文件类型在创建交互式网页应用中都有重要作用。 diff --git a/curriculum/challenges/chinese/blocks/lecture-working-with-node-core-modules/695cc6a5eefd305381ec90bc.md b/curriculum/challenges/chinese/blocks/lecture-working-with-node-core-modules/695cc6a5eefd305381ec90bc.md index 2595d13f2ff..5d0d33db011 100644 --- a/curriculum/challenges/chinese/blocks/lecture-working-with-node-core-modules/695cc6a5eefd305381ec90bc.md +++ b/curriculum/challenges/chinese/blocks/lecture-working-with-node-core-modules/695cc6a5eefd305381ec90bc.md @@ -84,7 +84,7 @@ try { 这就是异步的方法存在的原因。它们允许你的程序其余部分继续运行,同时 Node 在后台处理文件操作。传统上,这使用回调,但随着你的应用程序增长,回调可能很快变得混乱。 -Promises 和 `async/await` 解决了这个问题。它们仍然是非阻塞的,但代码读起来像普通的同步代码,更容易维护。 +Promises 和 `async/await` 解决了这个问题。它们仍然是非阻塞的,但代码读起来像普通的同步代码,更容易维护。 因此,基于 promises 的方法如今通常更受欢迎,这也是我们在本课剩余部分将使用的方法。 @@ -148,7 +148,7 @@ async function readFileContent() { const fileContent = await fs.readFile("article.md", "utf8"); console.log("File content:", fileContent); } catch (err) { - console.log("File read successfully"); + console.error("Error reading file:", err); } } @@ -169,7 +169,7 @@ async function readFileContent() { const fileContent = await fs.readFile("article.md"); console.log("File content:", fileContent); } catch (err) { - console.log("File read successfully"); + console.error("Error reading file:", err); } } @@ -297,7 +297,7 @@ Node fs 模块中哪个 method 允许你将内容写入 file,如果该 file --- - 例如,使用 `fs.promises.writeFile()`。 +例如,使用 `fs.promises.writeFile()`。 ### --feedback-- diff --git a/curriculum/challenges/chinese/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d2f232c60f0fa68ef86.md b/curriculum/challenges/chinese/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d2f232c60f0fa68ef86.md index 92c4f1092c1..3f8716b60a1 100644 --- a/curriculum/challenges/chinese/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d2f232c60f0fa68ef86.md +++ b/curriculum/challenges/chinese/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d2f232c60f0fa68ef86.md @@ -1,6 +1,6 @@ --- id: 68ff6d2f232c60f0fa68ef86 -title: 什么是 Node 以及浏览器和 Node 运行期环境之间的一些区别? +title: Node 是什么以及浏览器和 Node 运行期环境之间有哪些区别? challengeType: 19 dashedName: what-is-node-and-what-are-some-differences-between-the-browser-and-node-runtime-environment --- @@ -19,9 +19,9 @@ dashedName: what-is-node-and-what-are-some-differences-between-the-browser-and-n 客户端 JavaScript 有这些限制,因为它最初设计为专门在网页浏览器上 Run。 -网页浏览器提供运行 JavaScript 代码所需的环境,包括 JavaScript 引擎。它们还提供对文档对象模型(DOM)的访问,因此你可以在代码中访问 HTML 元素。 +Web 浏览器提供运行 JavaScript 代码所需的环境,包括 JavaScript 引擎。它们还提供对文档对象模型(DOM)的访问,因此你可以在代码中访问 HTML 元素。 -以前,我们无法在浏览器外运行 JavaScript,但现在我们可以使用 Node.js。 +长期以来,JavaScript 几乎只在浏览器内使用,但使用 Node.js 你也可以在浏览器外运行它。 Node.js 是一个 JavaScript 运行期环境。它被官方定义为“一个开源且跨平台的 JavaScript 运行期环境”。 @@ -43,7 +43,7 @@ Node.js 被广泛应用于各行各业。开发者使用它来构建处理超文 例如,从浏览器中,你可以访问 DOM API,但访问局部的文件系统有一定限制。相比之下,从 Node 运行期环境中,你可以访问几乎所有系统资源,包括文件系统,但不能访问 DOM。 -两个 JavaScript 环境都提供一个全局对象。在浏览器 JavaScript 运行期中,这个对象称为 `window`。这个 `window` 对象提供对浏览器相关功能的访问,例如访问用于操作 DOM、管理 cookie 和处理浏览器事件的方法。在 Node.js 环境中,这个全局对象称为 `global`。`global` 对象提供对 Node.js 特定功能的访问,例如用于处理局部文件、网络和与操作系统交互的内置模块。 +这两种 JavaScript 环境都提供一个全局对象。在浏览器的 JavaScript 运行期中,这个对象叫做 `window`。这个 `window` 对象提供对浏览器相关功能的访问,比如操作 DOM 的方法、管理 cookie 和处理浏览器事件。在 Node.js 环境中,这个全局对象叫做 `global`。`global` 对象提供对 Node.js 特定功能的访问,比如用于处理本地文件、网络和与操作系统交互的内置模块。 最后,另一个重要的区别是你可以选择在你的服务器中使用的 Node.js 版本。然而,你无法控制用户访问你的网站时所使用的浏览器环境版本。 @@ -103,7 +103,7 @@ Node.js 已经成为全球开发者非常重要的工具。它是一个强大、 --- -Node 运行期环境使用 window 对象作为其全局对象,而浏览器使用全局对象。 +Node 运行期环境使用 `window` 对象作为其全局对象,而浏览器使用 `global` 对象。 ### --feedback-- diff --git a/curriculum/challenges/chinese/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d372ad364f285f0522e.md b/curriculum/challenges/chinese/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d372ad364f285f0522e.md index e121bfba831..c5f3911d08d 100644 --- a/curriculum/challenges/chinese/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d372ad364f285f0522e.md +++ b/curriculum/challenges/chinese/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d372ad364f285f0522e.md @@ -1,6 +1,6 @@ --- id: 68ff6d372ad364f285f0522e -title: 在后端使用 Node 的优点和缺点是什么? +title: 使用 Node 作为后端的优缺点是什么? challengeType: 19 dashedName: what-are-the-advantages-and-disadvantages-to-using-node-on-the-back-end --- @@ -11,7 +11,7 @@ Node.js 的一个巨大优势是你可以使用 JavaScript 实现网页应用的 Node 的架构是另一个优势。它具有非阻塞、事件驱动的架构,非常适合开发实时应用,其中响应性和效率对于创造良好的用户体验至关重要。 -这就是“线程”概念变得非常重要的地方。线程是在进程内的执行路径,就像当前正在运行的计算机程序。 +这就是“线程”概念变得非常重要的地方。线程是进程中的执行路径,也就是说,是当前正在运行的计算机程序中的一条执行路径。 Node 的架构依赖于单线程和事件循环,能够有效处理大量同时的请求和输入/输出操作。这使得它非常适合需要同时处理多个请求的应用。 @@ -25,13 +25,13 @@ Node 的架构依赖于单线程和事件循环,能够有效处理大量同时 另一方面,Node.js 确实存在你需要注意的某些缺点或限制。 -正如你所学,它一次只运行一个线程,这意味着它一次只能处理一个操作。虽然它的架构允许它高效地处理并发(同时)请求,但 CPU 密集型任务可能会阻塞主线程并导致性能问题。 +正如你所学,它在单个线程上运行你的 JavaScript,这意味着它一次只能执行你代码中的一部分。虽然它的架构使其能够高效处理并发(同时)请求,但 CPU 密集型任务可能会阻塞主线程,导致性能问题。 CPU 密集型任务的示例包括复杂的数学运算、图像和视频处理以及密码学。有方法可以克服这一点,但它们通常会增加应用的复杂度。 -Node.js 也依赖于异步的编程。在异步的编程中,一个可能需要很长时间才能完成的任务会被启动,但程序不会等待其完成,而是继续运行主程序,同时异步任务并行运行。当任务完成时,程序会处理结果。 +在异步编程中,可能需要较长时间运行的任务会被启动,但主程序不会等待它完成,而是在异步任务在后台运行时继续执行。 -这个进程通常涉及我们所知的“回调”,它们是定义异步操作完成后发生什么的函数。Node.js 的异步特性可能会使代码更难以读取、理解和调试。 +这个过程通常涉及我们所说的“回调”,即定义异步操作完成后发生什么的函数。Node.js 的异步特性可能会使代码更难阅读、理解和调试。 最后,你在选择来自 `npm`(Node 包管理器)的包时也应当小心,因为其中一些可能不会被持续维护,因此可能会给你自己的应用引入漏洞。作为开发者,你应当仔细评估每个包,并查看它是否遵循质量和安全性最佳实践。 diff --git a/curriculum/challenges/chinese/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d39d7ed9ef36ff281f3.md b/curriculum/challenges/chinese/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d39d7ed9ef36ff281f3.md index 3767a36c60b..526a3076c67 100644 --- a/curriculum/challenges/chinese/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d39d7ed9ef36ff281f3.md +++ b/curriculum/challenges/chinese/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d39d7ed9ef36ff281f3.md @@ -17,7 +17,7 @@ dashedName: how-can-you-install-node-on-your-computer 在 macOS 和 Linux 上,你可以通过一个 shell 脚本直接安装 NVM。 -但对于 macOS,请注意 NVM 的官方文档提到“你需要在运行安装脚本之前手动安装 Xcode 命令行工具,否则安装将失败。” +但对于 macOS,请注意 NVM 的官方文档提到“你需要在运行安装脚本之前手动安装 Xcode 命令行工具,否则安装会失败。” 在 macOS 上,你可以通过在终端中运行此命令来安装 Xcode 命令行工具: @@ -41,7 +41,7 @@ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash ``` -要获取你阅读本文时的最新版本的 NVM,请参阅官方 NVM 文档:`https://github.com/nvm-sh/nvm?tab=readme-ov-file#install--update-script`。在那里,你将找到带有最新版本号的这些命令。 +要获取你阅读本课程时的最新版本 NVM,请参考官方 NVM 文档:`https://github.com/nvm-sh/nvm?tab=readme-ov-file#install--update-script`。在那里,你会找到带有最新版本号的这些命令。 当进程完成后,你可能需要重启终端以装载新建的命令和新建的配置。 @@ -101,7 +101,7 @@ node -v NVM 的官方版本仅在特定分支中支持 Windows。如果你的设备上设置了 Windows Subsystem for Linux(WSL),你可以按照上面的 macOS/Linux 指南安装和使用 NVM。 -但是,对于 Windows 本身,有一些备选方案。其中之一是 `nvm-windows`,这是一个用于 Windows 的 Node.js 版本管理工具。这是一个与官方 NVM 项目完全独立的项目。但这些工具的目的相同——帮助你在同一设备上使用多个版本的 Node.js。 +但是,对于 Windows 本身,有一些备选方案。其中之一是 `nvm-windows`,这是一个适用于 Windows 的 Node.js 版本管理工具。它是一个与官方 NVM 项目完全独立的项目。但这些工具的目的相同:帮助你在同一设备上管理多个 Node.js 版本。 在安装 `nvm-windows` 之前,你应该知道官方仓库建议在安装 NVM for Windows 之前卸载任何先前的 Node 安装。如果这是你第一次安装 Node.js,应该没问题。如果你已经安装了其他版本的 Node.js,建议先卸载它们。 @@ -119,7 +119,7 @@ NVM 的官方版本仅在特定分支中支持 Windows。如果你的设备上 nvm -v ``` -## 如何使用 NVM 为 Windows 安装 Node.js +## 如何使用 Windows 版 NVM 安装 Node.js 现在你已经在 Windows 上安装了 `nvm-windows`,你可以准备安装 Node.js。 @@ -155,7 +155,7 @@ nvm use 20 你也可以使用此 Command 查看你当前的 Node.js 版本: -```bash +```powershell node -v ``` @@ -165,25 +165,25 @@ node -v 此外,虽然所有这些命令都适用于安装在 macOS/Linux(包括 WSL)上的 NVM,但它们在 `nvm-windows` 上可能表现不同或根本无法使用。我们将在可能的情况下为 `nvm-windows` 提供备选命令。 -### 如何调整 Powershell 的执行策略 +### 如何调整 PowerShell 的执行策略 -如果你正在运行 Windows 并且正在使用 Powershell 和 `nvm-windows`,你可能需要调整 Powershell 的执行策略。Powershell 的默认执行策略是 `Restricted`,这是一项防止脚本运行的安全性措施。 +如果你正在运行 Windows 并使用 PowerShell 和 `nvm-windows`,你可能需要调整 PowerShell 的执行策略。PowerShell 的默认执行策略是 `Restricted`,这是一种防止脚本运行的安全措施。 -首先,右键点击 Powershell,然后点击“Run as Administrator”以管理员身份运行 Powershell。 +首先,右键点击 PowerShell,然后选择“以管理员身份运行”来以管理员身份启动 PowerShell。 -然后,要查看当前 Powershell 会话的当前执行策略,请运行以下命令: +然后,运行以下命令查看当前 PowerShell 会话的执行策略: ```powershell Get-ExecutionPolicy ``` -最后,要将 Powershell 的执行策略设置为 `RemoteSigned`,允许局部的脚本和 `npm` 运行,请使用以下命令: +最后,使用以下命令将 PowerShell 的执行策略设置为 `RemoteSigned`,这允许本地脚本和 `npm` 运行: ```powershell Set-ExecutionPolicy RemoteSigned ``` -一旦你运行了上面的命令,你可以关闭 Powershell 的管理员窗口,然后打开一个非管理员 Powershell 窗口。 +运行上述命令后,你可以关闭管理员权限的 PowerShell 窗口,打开一个非管理员权限的 PowerShell 窗口。 ### 列出所有版本 diff --git a/curriculum/challenges/chinese/blocks/lecture-working-with-operator-behavior/6732719e2e3ad4d947410b65.md b/curriculum/challenges/chinese/blocks/lecture-working-with-operator-behavior/6732719e2e3ad4d947410b65.md index 478bbfc0db4..dcd88cbddaa 100644 --- a/curriculum/challenges/chinese/blocks/lecture-working-with-operator-behavior/6732719e2e3ad4d947410b65.md +++ b/curriculum/challenges/chinese/blocks/lecture-working-with-operator-behavior/6732719e2e3ad4d947410b65.md @@ -11,7 +11,13 @@ dashedName: how-does-operator-precedence-work 决定表达式中运算的求值顺序。 优先级较高的运算符先于优先级较低的运算符进行运算。 运算符的优先级就像在数学中一样,除法和乘法先于加法和减法。 -如果不遵循这一规则,基本算式就会给出错误的答案。 JavaScript 的工作原理也是如此。 它有自己的规则,规定哪个运算符在前,哪个运算符在后。 例如,请看下面的表达式: +如果不遵循这个规则,基本的方程就会给出错误的答案。JavaScript 也是这样。它有自己的一套规则来决定哪个操作符先执行,哪个后执行,依此类推。 + +## 算术表达式中的优先级 + +### 乘法优先级 + +例如,看看下面的表达式: :::interactive_editor @@ -23,38 +29,44 @@ console.log(result); // 14 ::: -如果 JavaScript 从左到右计算这个表达式,你可能以为先计算 `2 + 3 = 5`,然后是 `5 * 4 = 20`。 但是,由于乘法的优先级高于加法,JavaScript 会先计算 `3 * 4`,结果是 `2 + 12 = 14`。 +如果 JavaScript 从左到右计算这个表达式,你可能以为先计算 `2 + 3 = 5`,然后是 `5 * 4 = 20`。 但是,由于乘法的优先级高于加法,JavaScript 会先计算 `3 * 4`,结果是 `2 + 12 = 14`。 -有时,你可能希望表达式的某些部分先运行,而不考虑优先级规则。 你可以使用括号 `()` 来做到这一点。 无论优先级如何,括号内的内容都会先被计算。 让我们先对上一个示例中的 `2 + 3` 进行求值: +### 除法优先级 + +除法运算符的优先级也高于加法或减法运算符: :::interactive_editor ```js -const result = (2 + 3) * 4; +const result = 2 + 6 / 3; -console.log(result); // 20 +console.log(result); // 4 ``` ::: -在上例中,括号强制 JavaScript 先计算 `2 + 3`,然后将结果乘以 `4` 。 结果为 `20`,而不是 `14`。 +如果 JavaScript 从左到右计算这个表达式,你可能会以为先计算 `2 + 6 = 8`,然后是 `8 / 3 = 2.67`。 但由于除法的优先级高于加法,JavaScript 会先计算除法:`6 / 3 = 2`,然后是减法 `2 + 2`,结果是 `4`。 -除法运算符的优先级也高于加法或减法运算符: +### 使用括号来覆写优先级 + +有时你可能希望表达式的某些部分先执行,而不管优先级规则。你可以使用括号 `()` 来实现这一点。括号内的内容无论如何都会先被计算。让我们让乘法示例中的 `2 + 3` 部分先计算: :::interactive_editor ```js -const result = 2 + 6 / 3; +const result = (2 + 3) * 4; -console.log(result); // 4 +console.log(result); // 20 ``` ::: -如果 JavaScript 从左到右计算这个表达式,你可能会以为先计算 `2 + 6 = 8`,然后是 `8 / 3 = 2.67`。 但由于除法的优先级高于加法,JavaScript 会先计算除法:`6 / 3 = 2`,然后是减法 `2 + 2`,结果是 `4`。 +在上例中,括号强制 JavaScript 先计算 `2 + 3`,然后将结果乘以 `4` 。 结果为 `20`,而不是 `14`。 因此,在乘法和除法运算中,这些运算总是先于加法和减法进行,除非使用括号改变顺序。 那么,如果运算符具有相同的优先级会怎样呢? JavaScript 使用结合性来确定计算它们的顺序。 +## 理解结合性 + 结合性告诉 JavaScript 是从左到右还是从右到左对运算符进行运算。 对于大多数运算符,如加法和乘法,结合性都是从左到右的。 因此,JavaScript 会从表达式的最左边向右边处理这些表达式: :::interactive_editor @@ -84,6 +96,8 @@ console.log(a + b); // 10 在上面的示例中,JavaScript 首先将 `5` 赋值给 `b`,然后将 `b`(现在是 `5`)赋值给 `a`。 +### 指数操作符 + 指数运算符也是从右到左结合的: :::interactive_editor @@ -96,7 +110,7 @@ console.log(result); // 512 ::: -首先,JavaScript 对 `3 ** 2` 进行求值,等于 `9`,然后计算 `2 ** 9`,等于 `512`。 如果指数运算符是从左到右结合的,JavaScript 会先计算 `2 ** 3`,得到 `8`,然后计算 `8 ** 2` 得到 `64`。  +首先,JavaScript 对 `3 ** 2` 进行求值,等于 `9`,然后计算 `2 ** 9`,等于 `512`。 如果指数运算符是从左到右结合的,JavaScript 会先计算 `2 ** 3`,得到 `8`,然后计算 `8 ** 2` 得到 `64`。 # --questions-- diff --git a/curriculum/challenges/chinese/blocks/lecture-working-with-regular-expressions/6733c5e54e3a154c8078ed48.md b/curriculum/challenges/chinese/blocks/lecture-working-with-regular-expressions/6733c5e54e3a154c8078ed48.md index c0a259d3221..a2de599254d 100644 --- a/curriculum/challenges/chinese/blocks/lecture-working-with-regular-expressions/6733c5e54e3a154c8078ed48.md +++ b/curriculum/challenges/chinese/blocks/lecture-working-with-regular-expressions/6733c5e54e3a154c8078ed48.md @@ -17,6 +17,8 @@ const regex = /^\d\d\d\d$/; 这确实有效:它会匹配四个数字字符。但你不必多次写出相同的类,可以给它添加一个量词。 +## 精确量词 + 量词由包含一个或两个数字的括弧状的花括弧定义。让我们在我们的模式中使用一个量词: ```js @@ -40,6 +42,8 @@ console.log(regex.test("1234567")); // false 该模式仅匹配恰好四位数字的字串,因为我们使用了锚点且量词只允许恰好四位数字。但识别码可能只需要至少四位数字。 +## 最小和最大量词 + 为了允许四位或更多数字,在你的量词数字后添加逗号: ```js @@ -84,6 +88,10 @@ console.log(regex.test("1234567")); // false 注意,你不能仅用这种语法设置最大值:你必须总是设置最小值。但如果你将最小值设为 `1`,实际上可以达到相同的效果。 +## 简写量词 + +### 问号量词(`?`) + 我们已收到来自用户的更新需求。标识符现在可以可选地以字母开头。我们已经知道对应的字符类,所以让我们将其添加到我们的正则表达式中: ```js @@ -122,6 +130,8 @@ console.log(regex.test("1234567")); // false 我们的模式现在允许一个可选的字母,后跟四到六个数字。 +### 星号量词(`*`) + 不幸的是,我们刚刚意识到我们错误地读取了需求。我们需要允许数字前有任意数量的字母。我们可以使用最小为 `0` 且没有定义最大值的量词: ```js @@ -144,6 +154,8 @@ console.log(regex.test("1234567")); // false ::: +### 加号量词(`+`) + 现在我们成功匹配了任意以零个或多个字母开头,后跟四到六个数字的标识符。但事实证明这导致系统崩溃:我们实际上必须至少要求一个字母。 同样,我们可以使用最小值为一且没有定义最大值的量词,或者使用另一个特殊语法,加号(`+`)符号: diff --git a/curriculum/challenges/chinese/blocks/lecture-working-with-the-dom-click-events-and-web-apis/673368ccf52205329b729378.md b/curriculum/challenges/chinese/blocks/lecture-working-with-the-dom-click-events-and-web-apis/673368ccf52205329b729378.md index 61390ccb81a..c064a919113 100644 --- a/curriculum/challenges/chinese/blocks/lecture-working-with-the-dom-click-events-and-web-apis/673368ccf52205329b729378.md +++ b/curriculum/challenges/chinese/blocks/lecture-working-with-the-dom-click-events-and-web-apis/673368ccf52205329b729378.md @@ -1,19 +1,23 @@ --- id: 673368ccf52205329b729378 -title: innerText、textContent 和 innerHTML 之间有什么区别? +title: InnerText、textContent 和 innerHTML 之间有什么区别? challengeType: 19 dashedName: what-is-the-difference-between-innertext-textcontent-and-innerhtml --- # --interactive-- +## 概述 + 让我们了解 `innerText`、`textContent` 和 `innerHTML`。 这些是你可以在 JavaScript 中访问的属性,用于获取或更改 HTML 元素的内容。即使它们乍看起来非常相似,但确实存在关键区别。选择合适的属性取决于你的具体用例,所以让我们深入了解一下。 让我们从 `innerText` 开始。 -`innerText` 表现 HTML 元素及其子元素的可见文本内容。此属性不包括隐藏文本或 HTML 标签,仅包含渲染的文本。 +## 理解 innerText + +`innerText` 表现 HTML 元素及其子元素的可见文本内容。此属性不包括隐藏文本或 HTML 标签,仅包含渲染的文本。 例如,这里你可以看到一个包含两个段落的 `div` 元素: @@ -107,7 +111,9 @@ container.innerText = "JavaScript is awesome!"; 由于 `innerText` 会考虑可见性,获取其值会触发一个称为 "reflow" 的进程,该进程会重新计算网站上某些元素的位置。此进程可能计算量很大,因此如果可能,应该避免触发它。 -很好。现在让我们谈谈 `textContent`。 +很好。现在让我们谈谈 `textContent`。 + +## 理解 textContent `textContent` 返回一个元素的纯文本内容,包括其所有子孙中的文本。 @@ -181,6 +187,8 @@ container.textContent = "New content"; ::: +## 与 innerHTML 的比较 + 最后,让我们谈谈 `textContent` 和 `innerText` 与 `innerHTML` 的区别。 请记住,使用 `innerHTML` 你可以设置元素的内部 HTML 内容。这对于动态地向 DOM 注入新 HTML 很有帮助。 @@ -189,6 +197,8 @@ container.textContent = "New content"; 为避免这种情况,建议使用 `textContent` 属性来插入纯文本。 +## 关键区别回顾 + JavaScript 中的 `innerText`、`textContent` 和 `innerHTML` 属性提供了不同的方式来访问和操作超文本标记语言元素的内容。如果你想有效地在 JavaScript 中处理超文本标记语言内容,你应该了解这些属性之间的区别。 # --questions-- diff --git a/curriculum/challenges/chinese/blocks/machine-learning-with-python-projects/5e46f8d6ac417301a38fb92d.md b/curriculum/challenges/chinese/blocks/machine-learning-with-python-projects/5e46f8d6ac417301a38fb92d.md index ac40fbad9a4..e723a0c4dad 100644 --- a/curriculum/challenges/chinese/blocks/machine-learning-with-python-projects/5e46f8d6ac417301a38fb92d.md +++ b/curriculum/challenges/chinese/blocks/machine-learning-with-python-projects/5e46f8d6ac417301a38fb92d.md @@ -10,7 +10,7 @@ dashedName: rock-paper-scissors 在这个挑战中,你将创建一个程序来玩石头、剪刀、布。 一个随机选取的程序通常会有 50% 的时间获胜。 要通过这一挑战,你的程序必须与四个不同的机器人进行对战,并达到至少 60% 胜率。 -你将使用我们的 Ona 公式化代码<a href="https://app.ona.com/?autostart=true#https://github.com/freeCodeCamp/boilerplate-rock-paper-scissors/" target="_blank" rel="noopener noreferrer nofollow">来完成这个项目</a>。 +你将使用我们的起始代码<a href="https://codespaces.new/freeCodeCamp/boilerplate-rock-paper-scissors/" target="_blank" rel="noopener noreferrer nofollow">进行这个项目的开发</a>。 我们仍在开发机器学习课程的交互式课程部分。 现在,你需要使用其他资源来学习如何通过这一挑战。 @@ -26,7 +26,7 @@ dashedName: rock-paper-scissors ## 开发 -不要修改 `RPS_game.py`。 在 `RPS.py` 中编写所有代码。 对于开发,你可以使用 `main.py` 来测试你的代码。 +不要修改 `RPS_game.py`。 在 `RPS.py` 中编写所有代码。 对于开发,你可以使用 `main.py` 来测试你的代码。 `main.py` 从 `RPS_game.py` 导入游戏功能和机器人。 diff --git a/curriculum/challenges/chinese/blocks/review-introduction-to-express/6a0354d43d4c00eca38561f7.md b/curriculum/challenges/chinese/blocks/review-introduction-to-express/6a0354d43d4c00eca38561f7.md index 57e7ca67152..16793174339 100644 --- a/curriculum/challenges/chinese/blocks/review-introduction-to-express/6a0354d43d4c00eca38561f7.md +++ b/curriculum/challenges/chinese/blocks/review-introduction-to-express/6a0354d43d4c00eca38561f7.md @@ -7,53 +7,6 @@ dashedName: review-introduction-to-express # --description-- -## 网络服务和 API - -- **API(应用程序编程接口)**:软件与其他软件通信的一种通用方式。 -- **网络服务**:一种特定类型的 API,使用 HTTP 等网络技术通过网络交换数据。每个网络服务都是 API,但并非所有 API 都是网络服务。 -- **网络服务的关键特性**:运行在服务器上,支持机器对机器通信,与语言无关,与平台无关,使用标准网络协议(HTTP/HTTPS、FTP、SMTP)。 -- **REST(表现层状态转移)**:目前最广泛使用的网络服务类型。暴露通过 URL 路径标识的资源,如 `/users` 或 `/users/20`。响应通常是 JSON,也可以是 XML 或纯文本。 -- **SOAP(简单对象访问协议)**:仅使用 XML。常见于需要更严格标准和安全性的企业系统。 -- **XML-RPC**:使用 XML 编码请求和响应。轻量但灵活性不如 REST。 -- **`Accept` 头部**:客户端用来告诉服务器它想要的响应格式,例如 `Accept: application/json`。 - -## REST 架构 - -- **无状态性**:每个请求必须包含服务器处理它所需的所有信息。服务器不记忆之前的请求。 -- **资源**:可以访问或修改的数据片段,由 URL 标识(例如 `/products/1`)。 -- **REST 中的 HTTP 方法**: - - `GET` — 获取资源 - - `POST` — 创建新资源 - - `PUT` / `PATCH` — 更新已有资源 - - `DELETE` — 删除资源 - -## HTTP 状态码 - -服务器处理请求后,会返回一个**状态码**表示结果: - -- `200` **(成功)**:请求成功 -- `201` **(已创建)**:新资源已创建 -- `400` **(错误请求)**:客户端发送了无效数据 -- `404` **(未找到)**:请求的资源不存在 -- `500` **(服务器内部错误)**:服务器发生错误 - -### REST 请求的工作流程 - -1. 客户端发送包含方法、URL、可选头部和可选体的请求。 -2. 服务器验证请求并识别资源。 -3. 服务器执行操作(获取、创建、更新或删除)。 -4. 服务器构建带状态码和可选体(通常是 JSON)的响应。 -5. 服务器发送响应——不保存客户端状态。 -6. 客户端查看状态码并处理返回的数据。 - -## 单体应用与微服务 - -- **单体应用**:一个大型代码库,UI、数据库和 API 都在一起。适合小型应用,但随着规模增长,维护和扩展变得困难。 -- **微服务**:将大型应用拆分成更小、独立的服务。每个服务处理一个业务功能(例如产品、订单、支付),可以有自己的代码库、数据库和团队。 -- **微服务之间的通信**:通过 API 或基于消息的系统。 -- **微服务的优点**:开发更快,错误隔离更好,每个服务可以自由选择不同语言或框架。 -- **微服务的挑战**:调试更复杂,基础设施管理更难,服务间网络开销更大。 - ## 什么是 Express.js? - **Express**:基于 Node.js 的极简且灵活的网络框架,使构建网络服务器和 API 更简单。 diff --git a/curriculum/challenges/chinese/blocks/review-rest-api-and-web-services/6a7c78ad958a597ee788ad2a.md b/curriculum/challenges/chinese/blocks/review-rest-api-and-web-services/6a7c78ad958a597ee788ad2a.md new file mode 100644 index 00000000000..aebdd89eaba --- /dev/null +++ b/curriculum/challenges/chinese/blocks/review-rest-api-and-web-services/6a7c78ad958a597ee788ad2a.md @@ -0,0 +1,59 @@ +--- +id: 6a7c78ad958a597ee788ad2a +title: REST API 和 Web 服务回顾 +challengeType: 31 +dashedName: review-rest-api-and-web-services +--- + +# --description-- + +## 网络服务和 API + +- **API(应用程序编程接口)**:软件与其他软件通信的一种通用方式。 +- **网络服务**:一种特定类型的 API,使用 HTTP 等网络技术通过网络交换数据。每个网络服务都是 API,但并非所有 API 都是网络服务。 +- **网络服务的关键特性**:运行在服务器上,支持机器对机器通信,与语言无关,与平台无关,使用标准网络协议(HTTP/HTTPS、FTP、SMTP)。 +- **REST(表现层状态转移)**:目前最广泛使用的网络服务类型。暴露通过 URL 路径标识的资源,如 `/users` 或 `/users/20`。响应通常是 JSON,也可以是 XML 或纯文本。 +- **SOAP(简单对象访问协议)**:仅使用 XML。常见于需要更严格标准和安全性的企业系统。 +- **XML-RPC**:使用 XML 编码请求和响应。轻量但灵活性不如 REST。 +- **`Accept` 头部**:客户端用来告诉服务器它想要的响应格式,例如 `Accept: application/json`。 + +## REST 架构 + +- **无状态性**:每个请求必须包含服务器处理它所需的所有信息。服务器不记忆之前的请求。 +- **资源**:可以访问或修改的数据片段,由 URL 标识(例如 `/products/1`)。 +- **REST 中的 HTTP 方法**: + - `GET` — 获取资源 + - `POST` — 创建新资源 + - `PUT` / `PATCH` — 更新已有资源 + - `DELETE` — 删除资源 + +## HTTP 状态码 + +服务器处理请求后,会返回一个**状态码**表示结果: + +- `200` **(成功)**:请求成功 +- `201` **(已创建)**:新资源已创建 +- `400` **(错误请求)**:客户端发送了无效数据 +- `404` **(未找到)**:请求的资源不存在 +- `500` **(服务器内部错误)**:服务器发生错误 + +### REST 请求的工作流程 + +1. 客户端发送包含方法、URL、可选头部和可选体的请求。 +2. 服务器验证请求并识别资源。 +3. 服务器执行操作(获取、创建、更新或删除)。 +4. 服务器构建带状态码和可选体(通常是 JSON)的响应。 +5. 服务器发送响应——不保存客户端状态。 +6. 客户端查看状态码并处理返回的数据。 + +## 单体应用与微服务 + +- **单体应用**:一个大型代码库,UI、数据库和 API 都在一起。适合小型应用,但随着规模增长,维护和扩展变得困难。 +- **微服务**:将大型应用拆分成更小、独立的服务。每个服务处理一个业务功能(例如产品、订单、支付),可以有自己的代码库、数据库和团队。 +- **微服务之间的通信**:通过 API 或基于消息的系统。 +- **微服务的优点**:开发更快,错误隔离更好,每个服务可以自由选择不同语言或框架。 +- **微服务的挑战**:调试更复杂,基础设施管理更难,服务间网络开销更大。 + +# --assignment-- + +回顾 REST API 和 Web 服务的主题和概念。 diff --git a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e89d557d4b78bf83a02ae6.md b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e89d557d4b78bf83a02ae6.md index 647722404e7..994d5fc272c 100644 --- a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e89d557d4b78bf83a02ae6.md +++ b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e89d557d4b78bf83a02ae6.md @@ -396,10 +396,10 @@ body { const { useState } = React; export const FootballPlayerCard = () => { - return ( + return ( --fcc-editable-region-- - <h1 style={{ backgroundColor: '#fff' }}>Hello, TSX!</h1> + <h1 style={{ backgroundColor: "#fff" }}>Hello, TSX!</h1> --fcc-editable-region-- - ) + ); }; ``` diff --git a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb2.md b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb2.md index 33e9f62e32a..db19311fae9 100644 --- a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb2.md +++ b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb2.md @@ -29,12 +29,10 @@ assert.equal(element?.type, window.index.PlayerCard); <meta charset="utf-8"/> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Football Player Card Builder - - - + @@ -379,21 +377,18 @@ body { ```tsx const { useState } = React; -export function PlayerCard() { +export const PlayerCard = () => { return ( -
- -
+
); -} +}; export const FootballPlayerCard = () => { - + --fcc-editable-region-- return ( - --fcc-editable-region-- -

Football Card Builder

- --fcc-editable-region-- - ) +

Football Card Builder

+ ); + --fcc-editable-region-- }; ``` diff --git a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb3.md b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb3.md index 8b777063be4..ff89ac457fa 100644 --- a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb3.md +++ b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb3.md @@ -382,15 +382,13 @@ export const PlayerCard = () => { return (
--fcc-editable-region-- - + --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { - return ( - - ); + return ; }; ``` diff --git a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb4.md b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb4.md index 8c673b65a63..d85e7f1e57d 100644 --- a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb4.md +++ b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb4.md @@ -381,12 +381,12 @@ export const PlayerCard = () => {
--fcc-editable-region-- - + --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb5.md b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb5.md index 84ff08e356e..18b1ec58830 100644 --- a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb5.md +++ b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb5.md @@ -394,13 +394,13 @@ export const PlayerCard = () => {
--fcc-editable-region-- - + --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb6.md b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb6.md index 33eeb24206e..4445e129ed0 100644 --- a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb6.md +++ b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb6.md @@ -390,14 +390,14 @@ export const PlayerCard = () => {
98
--fcc-editable-region-- - + --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb7.md b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb7.md index be194220b20..c8f6e0e1de6 100644 --- a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb7.md +++ b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb7.md @@ -398,13 +398,13 @@ export const PlayerCard = () => {
ST
--fcc-editable-region-- - + --fcc-editable-region-- ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb8.md b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb8.md index 538b4a995d6..0b1a2507b44 100644 --- a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb8.md +++ b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb8.md @@ -394,14 +394,14 @@ export const PlayerCard = () => {
GOLD
--fcc-editable-region-- - + --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb9.md b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb9.md index 2c6980022bd..9253c9c567f 100644 --- a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb9.md +++ b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb9.md @@ -393,12 +393,12 @@ export const PlayerCard = () => { --fcc-editable-region-- - + --fcc-editable-region-- ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bba.md b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bba.md index d90a442b156..b4838ca66ca 100644 --- a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bba.md +++ b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bba.md @@ -412,13 +412,13 @@ export const PlayerCard = () => {
--fcc-editable-region-- - + --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbb.md b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbb.md index c890bf62ab4..4bfad212add 100644 --- a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbb.md +++ b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbb.md @@ -406,12 +406,12 @@ export const PlayerCard = () => { Edson Arantes do Nascimento (Pele) headshot --fcc-editable-region-- - + --fcc-editable-region-- ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbc.md b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbc.md index b379f107b71..7a4c1f17bf3 100644 --- a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbc.md +++ b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbc.md @@ -409,12 +409,12 @@ export const PlayerCard = () => { PELE --fcc-editable-region-- - + --fcc-editable-region-- ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbd.md b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbd.md index 10a1c60c535..1a24978b2a7 100644 --- a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbd.md +++ b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbd.md @@ -427,13 +427,13 @@ export const PlayerCard = () => { --fcc-editable-region-- - + --fcc-editable-region-- ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbe.md b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbe.md index caa8c740e2c..acb392f8152 100644 --- a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbe.md +++ b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbe.md @@ -465,7 +465,7 @@ export const PlayerCard = () => { ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbf.md b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbf.md index 746f7977f42..66b8fdb8181 100644 --- a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbf.md +++ b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbf.md @@ -1,6 +1,6 @@ --- id: 69e8b295388ebbd517692bbf -title: 第 20 步 +title: 步骤 20 challengeType: 0 dashedName: step-20 --- @@ -420,7 +420,7 @@ interface PlayerData { position: string; club: string; --fcc-editable-region-- - + --fcc-editable-region-- } @@ -478,7 +478,7 @@ export const PlayerCard = () => { ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc0.md b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc0.md index d7aadbad65d..380b7ceb0cd 100644 --- a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc0.md +++ b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc0.md @@ -1,6 +1,6 @@ --- id: 69e8b295388ebbd517692bc0 -title: 第 21 步 +title: 步骤21 challengeType: 0 dashedName: step-21 --- @@ -497,7 +497,7 @@ export const PlayerCard = () => { ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc1.md b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc1.md index c525c44cfac..97bbc850588 100644 --- a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc1.md +++ b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc1.md @@ -1,6 +1,6 @@ --- id: 69e8b295388ebbd517692bc1 -title: 第 22 步 +title: 步骤 22 challengeType: 0 dashedName: step-22 --- @@ -398,10 +398,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } --fcc-editable-region-- @@ -460,7 +460,7 @@ export const PlayerCard = () => { ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc2.md b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc2.md index b2d213a3664..31f26ba3d19 100644 --- a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc2.md +++ b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc2.md @@ -1,6 +1,6 @@ --- id: 69e8b295388ebbd517692bc2 -title: 第 24 步 +title: 步骤 24 challengeType: 0 dashedName: step-24 --- @@ -40,12 +40,10 @@ assert.exists(document.querySelector('.card-wrapper.tier-elite')); Football Player Card Builder - - - + @@ -405,10 +403,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -467,9 +465,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc3.md b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc3.md index 513dc4e0377..4754fa32ce7 100644 --- a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc3.md +++ b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc3.md @@ -1,6 +1,6 @@ --- id: 69e8b295388ebbd517692bc3 -title: 第 25 步 +title: 步骤 25 challengeType: 0 dashedName: step-25 --- @@ -399,10 +399,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -461,9 +461,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc4.md b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc4.md index 76b17b7fa1c..e1fc246d35a 100644 --- a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc4.md +++ b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc4.md @@ -1,6 +1,6 @@ --- id: 69e8b295388ebbd517692bc4 -title: 第 26 步 +title: 步骤 26 challengeType: 0 dashedName: step-26 --- @@ -399,10 +399,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -461,9 +461,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc5.md b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc5.md index d42375b6652..2bfa26390e9 100644 --- a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc5.md +++ b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc5.md @@ -1,6 +1,6 @@ --- id: 69e8b295388ebbd517692bc5 -title: 第 27 步 +title: 步骤 27 challengeType: 0 dashedName: step-27 --- @@ -392,10 +392,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -456,9 +456,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc6.md b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc6.md index 696121f2601..6ee1b708120 100644 --- a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc6.md +++ b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc6.md @@ -401,10 +401,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -465,9 +465,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc7.md b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc7.md index 87e337bced8..eca2f55191c 100644 --- a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc7.md +++ b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc7.md @@ -1,6 +1,6 @@ --- id: 69e8b295388ebbd517692bc7 -title: 第 29 步 +title: 步骤 29 challengeType: 0 dashedName: step-29 --- @@ -391,10 +391,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -455,9 +455,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc8.md b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc8.md index 5ca123a25a7..baa8982f757 100644 --- a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc8.md +++ b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc8.md @@ -407,10 +407,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -436,9 +436,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { {player.name}
- --fcc-editable-region--
+ --fcc-editable-region-- 97 PAC
@@ -448,10 +448,10 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
83 + --fcc-editable-region-- PAS
- --fcc-editable-region--
@@ -471,9 +471,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc9.md b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc9.md index 1f7274be63a..53bbc6cc660 100644 --- a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc9.md +++ b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc9.md @@ -1,6 +1,6 @@ --- id: 69e8b296388ebbd517692bc9 -title: 第 32 步 +title: 步骤 32 challengeType: 0 dashedName: step-32 --- @@ -483,10 +483,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -545,13 +545,13 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
); -} +}; --fcc-editable-region-- --fcc-editable-region-- export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bca.md b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bca.md index bb1bd4474c0..1b5028f4097 100644 --- a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bca.md +++ b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bca.md @@ -1,6 +1,6 @@ --- id: 69e8b296388ebbd517692bca -title: 第 34 步 +title: 步骤 34 challengeType: 0 dashedName: step-34 --- @@ -419,10 +419,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -481,14 +481,14 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { - name: 'PELE', + name: "PELE", overallRating: 98, - position: 'ST', - club: 'Santos FC', - imageUrl: 'https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg', + position: "ST", + club: "Santos FC", + imageUrl: "https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg", pac: 97, sho: 98, pas: 83, diff --git a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcb.md b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcb.md index f7fefb46976..ffef492d250 100644 --- a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcb.md +++ b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcb.md @@ -1,6 +1,6 @@ --- id: 69e8b296388ebbd517692bcb -title: 第 35 步 +title: 步骤35 challengeType: 0 dashedName: step-35 --- @@ -435,10 +435,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -497,14 +497,14 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { - name: 'PELE', + name: "PELE", overallRating: 98, - position: 'ST', - club: 'Santos FC', - imageUrl: 'https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg', + position: "ST", + club: "Santos FC", + imageUrl: "https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg", pac: 97, sho: 98, pas: 83, @@ -517,6 +517,7 @@ export const FootballPlayerCard = () => { const [player, setPlayer] = useState(defaultPlayer); return ( --fcc-editable-region-- + --fcc-editable-region-- ); diff --git a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcc.md b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcc.md index ba99241658a..606d922a25b 100644 --- a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcc.md +++ b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcc.md @@ -1,6 +1,6 @@ --- id: 69e8b296388ebbd517692bcc -title: 第 36 步 +title: 步骤 36 challengeType: 0 dashedName: step-36 --- @@ -477,7 +477,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -504,7 +504,9 @@ export const FootballPlayerCard = () => { --fcc-editable-region-- + + --fcc-editable-region-- ); diff --git a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcd.md b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcd.md index 909d3d00572..6b38c80c31a 100644 --- a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcd.md +++ b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcd.md @@ -1,6 +1,6 @@ --- id: 69e8b296388ebbd517692bcd -title: 第 38 步 +title: 步骤 38 challengeType: 0 dashedName: step-38 --- @@ -465,7 +465,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bce.md b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bce.md index 9aff8f4bd92..51d5406020b 100644 --- a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bce.md +++ b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bce.md @@ -1,6 +1,6 @@ --- id: 69e8b296388ebbd517692bce -title: 第 39 步 +title: 步骤 39 challengeType: 0 dashedName: step-39 --- @@ -470,7 +470,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcf.md b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcf.md index cfb15b0cf84..90edae8d03b 100644 --- a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcf.md +++ b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcf.md @@ -1,6 +1,6 @@ --- id: 69e8b296388ebbd517692bcf -title: 第 40 步 +title: 步骤 40 challengeType: 0 dashedName: step-40 --- @@ -488,7 +488,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd0.md b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd0.md index e9eddfb0e62..5a217a800b4 100644 --- a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd0.md +++ b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd0.md @@ -1,6 +1,6 @@ --- id: 69e8b296388ebbd517692bd0 -title: 第 42 步 +title: 步骤 42 challengeType: 0 dashedName: step-42 --- @@ -471,7 +471,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd1.md b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd1.md index e6726764ff2..3207a7f0b33 100644 --- a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd1.md +++ b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd1.md @@ -471,7 +471,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd2.md b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd2.md index d01bca1e415..38d8481a0df 100644 --- a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd2.md +++ b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd2.md @@ -1,6 +1,6 @@ --- id: 69e8b296388ebbd517692bd2 -title: 第 44 步 +title: 步骤 44 challengeType: 0 dashedName: step-44 --- @@ -471,7 +471,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -535,7 +535,7 @@ export const FootballPlayerCard = () => { - --fcc-editable-region-- + --fcc-editable-region-- --fcc-editable-region-- diff --git a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd3.md b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd3.md index bcc64978104..2cfda8bfafc 100644 --- a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd3.md +++ b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd3.md @@ -1,6 +1,6 @@ --- id: 69e8b296388ebbd517692bd3 -title: 第 45 步 +title: 步骤 45 challengeType: 0 dashedName: step-45 --- @@ -497,7 +497,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd4.md b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd4.md index 681f510ffee..6b6140d986f 100644 --- a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd4.md +++ b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd4.md @@ -1,6 +1,6 @@ --- id: 69e8b296388ebbd517692bd4 -title: 第 46 步 +title: 步骤46 challengeType: 0 dashedName: step-46 --- @@ -497,7 +497,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd5.md b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd5.md index 5ad729c5ba4..6ffdfffc41a 100644 --- a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd5.md +++ b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd5.md @@ -1,6 +1,6 @@ --- id: 69e8b296388ebbd517692bd5 -title: 第 47 步 +title: 步骤 47 challengeType: 0 dashedName: step-47 --- @@ -497,7 +497,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd6.md b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd6.md index 229fe0387c5..4234bfc9c77 100644 --- a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd6.md +++ b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd6.md @@ -1,6 +1,6 @@ --- id: 69e8b296388ebbd517692bd6 -title: 第 48 步 +title: 步骤 48 challengeType: 0 dashedName: step-48 --- @@ -470,7 +470,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd7.md b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd7.md index 4123fe1eb9a..5ac7a147d02 100644 --- a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd7.md +++ b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd7.md @@ -478,7 +478,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -609,3 +609,4 @@ export const FootballPlayerCard = () => { ); }; ``` + diff --git a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd8.md b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd8.md index 77cdbbd44db..d7c705e45cf 100644 --- a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd8.md +++ b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd8.md @@ -1,6 +1,6 @@ --- id: 69e8b296388ebbd517692bd8 -title: 第 55 步 +title: 步骤 55 challengeType: 0 dashedName: step-55 --- @@ -410,7 +410,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -484,7 +484,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -538,8 +538,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd9.md b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd9.md index 6c98c15c09b..164eb156535 100644 --- a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd9.md +++ b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd9.md @@ -1,6 +1,6 @@ --- id: 69e8b296388ebbd517692bd9 -title: 第 56 步 +title: 步骤 56 challengeType: 0 dashedName: step-56 --- @@ -402,7 +402,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -476,7 +476,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -530,8 +530,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bda.md b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bda.md index 730590cfb9e..da1e8cdbcad 100644 --- a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bda.md +++ b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bda.md @@ -1,6 +1,6 @@ --- id: 69e8b296388ebbd517692bda -title: 第 57 步 +title: 步骤 57 challengeType: 0 dashedName: step-57 --- @@ -402,7 +402,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -476,7 +476,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -530,8 +530,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( @@ -640,3 +641,4 @@ export const FootballPlayerCard = () => { ); }; ``` + diff --git a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdb.md b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdb.md index 7c9b7c5b2e9..69ced2d5c33 100644 --- a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdb.md +++ b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdb.md @@ -1,6 +1,6 @@ --- id: 69e8b296388ebbd517692bdb -title: 第 58 步 +title: 步骤 58 challengeType: 0 dashedName: step-58 --- @@ -402,7 +402,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -476,7 +476,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -530,8 +530,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdc.md b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdc.md index 35ad9db0013..073208f3331 100644 --- a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdc.md +++ b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdc.md @@ -1,6 +1,6 @@ --- id: 69e8b296388ebbd517692bdc -title: 第 59 步 +title: 步骤 59 challengeType: 0 dashedName: step-59 --- @@ -402,7 +402,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -476,7 +476,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -530,8 +530,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdd.md b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdd.md index e64bf20891a..6209bbb4f28 100644 --- a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdd.md +++ b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdd.md @@ -1,6 +1,6 @@ --- id: 69e8b296388ebbd517692bdd -title: 第 60 步 +title: 步骤 60 challengeType: 0 dashedName: step-60 --- @@ -402,7 +402,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -476,7 +476,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -530,8 +530,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bde.md b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bde.md index 92ddd684c48..4c35dd51a4b 100644 --- a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bde.md +++ b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bde.md @@ -1,6 +1,6 @@ --- id: 69e8b296388ebbd517692bde -title: 第 61 步 +title: 步骤 61 challengeType: 0 dashedName: step-61 --- @@ -402,7 +402,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -414,10 +414,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -430,7 +430,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
{player.position}
-
{getPlayerTier(player.overallRating).toUpperCase()}
+
+ {getPlayerTier(player.overallRating).toUpperCase()} +
{player.club}
@@ -474,14 +476,14 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { - name: 'PELE', + name: "PELE", overallRating: 98, - position: 'ST', - club: 'Santos FC', - imageUrl: 'https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg', + position: "ST", + club: "Santos FC", + imageUrl: "https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg", pac: 97, sho: 98, pas: 83, @@ -506,8 +508,18 @@ export const FootballPlayerCard = () => {

Player Info

- - setPlayer({ ...player, name: e.target.value })} /> + + + setPlayer({ ...player, name: e.target.value }) + } + />
@@ -518,8 +530,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( @@ -531,46 +544,115 @@ export const FootballPlayerCard = () => {
- - setPlayer({ ...player, overallRating: Number(e.target.value) })} /> + + + setPlayer({ + ...player, + overallRating: Number(e.target.value), + }) + } + />
- - setPlayer({ ...player, club: e.target.value })} /> + + + setPlayer({ ...player, club: e.target.value }) + } + />
- - setPlayer({ ...player, imageUrl: e.target.value })} /> + + + setPlayer({ ...player, imageUrl: e.target.value }) + } + />

Player Stats

- - setPlayer({ ...player, pac: Number(e.target.value) })} /> + + + setPlayer({ ...player, pac: Number(e.target.value) }) + } + />
- - setPlayer({ ...player, sho: Number(e.target.value) })} /> + + + setPlayer({ ...player, sho: Number(e.target.value) }) + } + />
- - setPlayer({ ...player, pas: Number(e.target.value) })} /> + + + setPlayer({ ...player, pas: Number(e.target.value) }) + } + />
- + --fcc-editable-region-- --fcc-editable-region--
- +
- +
@@ -579,7 +661,9 @@ export const FootballPlayerCard = () => {

Live Preview

Updates as you type

-
+
@@ -589,3 +673,4 @@ export const FootballPlayerCard = () => { ); }; ``` + diff --git a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdf.md b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdf.md index b2dbfb3760f..4961bc9bfe0 100644 --- a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdf.md +++ b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdf.md @@ -1,6 +1,6 @@ --- id: 69e8b296388ebbd517692bdf -title: 第 62 步 +title: 步骤62 challengeType: 0 dashedName: step-62 --- @@ -421,7 +421,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -495,7 +495,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -549,8 +549,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( @@ -667,11 +668,11 @@ export const FootballPlayerCard = () => { } /> - --fcc-editable-region--
+ --fcc-editable-region--
@@ -679,8 +680,8 @@ export const FootballPlayerCard = () => { PHY -
--fcc-editable-region-- + diff --git a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8d1be04ed6aad1c955729.md b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8d1be04ed6aad1c955729.md index b28caf92a3e..52e9de9cf35 100644 --- a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8d1be04ed6aad1c955729.md +++ b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69e8d1be04ed6aad1c955729.md @@ -391,8 +391,8 @@ const { useState } = React; --fcc-editable-region-- export const FootballPlayerCard = () => { - return ( -

Football Card Builder

- ) + return ( +

Football Card Builder

+ ); }; ``` diff --git a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69ea01c45b04f3e9de845036.md b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69ea01c45b04f3e9de845036.md index 4ee7d031344..b30c5ec34f2 100644 --- a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69ea01c45b04f3e9de845036.md +++ b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69ea01c45b04f3e9de845036.md @@ -1,6 +1,6 @@ --- id: 69ea01c45b04f3e9de845036 -title: 第 63 步 +title: 步骤 63 challengeType: 0 dashedName: step-63 --- @@ -405,7 +405,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -483,7 +483,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -537,8 +537,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69ea02adff0fd528639ee23b.md b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69ea02adff0fd528639ee23b.md index fe558de3d07..8a036ca0d78 100644 --- a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69ea02adff0fd528639ee23b.md +++ b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69ea02adff0fd528639ee23b.md @@ -1,6 +1,6 @@ --- id: 69ea02adff0fd528639ee23b -title: 第 64 步 +title: 步骤 64 challengeType: 0 dashedName: step-64 --- @@ -409,7 +409,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -485,7 +485,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -543,8 +543,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69ea0349f8305a99324465ff.md b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69ea0349f8305a99324465ff.md index b2ee5124b14..585d716a2bd 100644 --- a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69ea0349f8305a99324465ff.md +++ b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69ea0349f8305a99324465ff.md @@ -1,6 +1,6 @@ --- id: 69ea0349f8305a99324465ff -title: 第 65 步 +title: 步骤 65 challengeType: 0 dashedName: step-65 --- @@ -407,7 +407,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -483,7 +483,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -502,11 +502,9 @@ const defaultPlayer: PlayerData = { function loadPlayer(): PlayerData { try { --fcc-editable-region-- - - --fcc-editable-region-- - } catch (error) { - } + --fcc-editable-region-- + } catch (error) {} } export const FootballPlayerCard = () => { @@ -547,8 +545,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69ea044f8c93a5e7ce64214c.md b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69ea044f8c93a5e7ce64214c.md index 7d39f53faff..a4e5a02a8ac 100644 --- a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69ea044f8c93a5e7ce64214c.md +++ b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69ea044f8c93a5e7ce64214c.md @@ -395,7 +395,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -471,7 +471,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -492,12 +492,10 @@ function loadPlayer(): PlayerData { const saved = localStorage.getItem(STORAGE_KEY); if (saved) { --fcc-editable-region-- - + --fcc-editable-region-- - }; - } catch (error) { - - } + } + } catch (error) {} } export const FootballPlayerCard = () => { @@ -538,8 +536,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69ea0577f25e519489353f82.md b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69ea0577f25e519489353f82.md index 253eace746b..a93aefa0c29 100644 --- a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69ea0577f25e519489353f82.md +++ b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69ea0577f25e519489353f82.md @@ -1,6 +1,6 @@ --- id: 69ea0577f25e519489353f82 -title: 第 67 步 +title: 步骤 67 challengeType: 0 dashedName: step-67 --- @@ -405,7 +405,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -418,7 +418,6 @@ interface PlayerData { const STORAGE_KEY = "football_player_card"; - export function getPlayerTier(rating: number): string { if (rating >= 92) return "elite"; if (rating >= 85) return "gold"; @@ -482,7 +481,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -505,14 +504,15 @@ function loadPlayer(): PlayerData { return { ...defaultPlayer, ...JSON.parse(saved) - } - }; ---fcc-editable-region-- + }; + } } catch (error) { +--fcc-editable-region-- } -} + --fcc-editable-region-- +} export const FootballPlayerCard = () => { const [player, setPlayer] = useState(defaultPlayer); @@ -552,8 +552,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69ea064edb0dcc46e1422cca.md b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69ea064edb0dcc46e1422cca.md index 6cdf823eb7f..044ee1a2e1f 100644 --- a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69ea064edb0dcc46e1422cca.md +++ b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69ea064edb0dcc46e1422cca.md @@ -1,6 +1,6 @@ --- id: 69ea064edb0dcc46e1422cca -title: 第 68 步 +title: 步骤 68 challengeType: 0 dashedName: step-68 --- @@ -401,7 +401,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -477,7 +477,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -500,8 +500,8 @@ function loadPlayer(): PlayerData { return { ...defaultPlayer, ...JSON.parse(saved) - } - }; + }; + } } catch (error) { console.log("Failed to load player data, using defaults:", error); } @@ -546,8 +546,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69ea0939f2f92cfc6c7a850d.md b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69ea0939f2f92cfc6c7a850d.md index 15d83d2ea3f..ccb861f9b78 100644 --- a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69ea0939f2f92cfc6c7a850d.md +++ b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69ea0939f2f92cfc6c7a850d.md @@ -1,6 +1,6 @@ --- id: 69ea0939f2f92cfc6c7a850d -title: 第 69 步 +title: 步骤69 challengeType: 0 dashedName: step-69 --- @@ -46,12 +46,10 @@ assert.match(__helpers.removeJSComments(code), /useEffect\s*\(\(\)\s=>\s*\{\s*tr Football Player Card Builder - - - + @@ -415,7 +413,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -435,7 +433,7 @@ export function getPlayerTier(rating: number): string { return "bronze"; } -function PlayerCard({ player }: { player: PlayerData }) { +export const PlayerCard = ({ player }: { player: PlayerData }) => { return (
@@ -491,7 +489,7 @@ function PlayerCard({ player }: { player: PlayerData }) {
); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -514,8 +512,8 @@ function loadPlayer(): PlayerData { return { ...defaultPlayer, ...JSON.parse(saved) - } - }; + }; + } } catch (error) { console.log("Failed to load player data, using defaults:", error); } @@ -526,7 +524,7 @@ export const FootballPlayerCard = () => { const [player, setPlayer] = useState(defaultPlayer); --fcc-editable-region-- - + --fcc-editable-region-- return ( @@ -565,8 +563,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69ea0a89bd84cf2461b48ceb.md b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69ea0a89bd84cf2461b48ceb.md index eb63e0d22f6..16f43d73303 100644 --- a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69ea0a89bd84cf2461b48ceb.md +++ b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69ea0a89bd84cf2461b48ceb.md @@ -1,6 +1,6 @@ --- id: 69ea0a89bd84cf2461b48ceb -title: 第 70 步 +title: 步骤 70 challengeType: 0 dashedName: step-70 --- @@ -403,7 +403,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -479,7 +479,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -502,8 +502,8 @@ function loadPlayer(): PlayerData { return { ...defaultPlayer, ...JSON.parse(saved) - } - }; + }; + } } catch (error) { console.log("Failed to load player data, using defaults:", error); } @@ -513,15 +513,15 @@ function loadPlayer(): PlayerData { export const FootballPlayerCard = () => { const [player, setPlayer] = useState(defaultPlayer); ---fcc-editable-region-- useEffect(() => { try { +--fcc-editable-region-- } catch (error) { +--fcc-editable-region-- } }, [player]); ---fcc-editable-region-- return (
@@ -559,8 +559,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69ea0bb3e7000f44c207bb0e.md b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69ea0bb3e7000f44c207bb0e.md index a24aaf00152..b770f409545 100644 --- a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69ea0bb3e7000f44c207bb0e.md +++ b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69ea0bb3e7000f44c207bb0e.md @@ -1,6 +1,6 @@ --- id: 69ea0bb3e7000f44c207bb0e -title: 第 71 步 +title: 步骤 71 challengeType: 0 dashedName: step-71 --- @@ -401,7 +401,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -477,7 +477,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -500,8 +500,8 @@ function loadPlayer(): PlayerData { return { ...defaultPlayer, ...JSON.parse(saved) - } - }; + }; + } } catch (error) { console.log("Failed to load player data, using defaults:", error); } @@ -557,8 +557,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( @@ -1098,7 +1099,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -1174,7 +1175,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -1197,8 +1198,8 @@ function loadPlayer(): PlayerData { return { ...defaultPlayer, ...JSON.parse(saved) - } - }; + }; + } } catch (error) { console.log("Failed to load player data, using defaults:", error); } @@ -1252,8 +1253,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69ea1bb4a66dd6debb999c7f.md b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69ea1bb4a66dd6debb999c7f.md index f516fed9de9..3dd3da25a1c 100644 --- a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69ea1bb4a66dd6debb999c7f.md +++ b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69ea1bb4a66dd6debb999c7f.md @@ -1,6 +1,6 @@ --- id: 69ea1bb4a66dd6debb999c7f -title: 第 49 步 +title: 步骤 49 challengeType: 0 dashedName: step-49 --- @@ -473,7 +473,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69ea1dd8e74976afa407bf22.md b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69ea1dd8e74976afa407bf22.md index 137bf1c4c3b..0f1c4d731e6 100644 --- a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69ea1dd8e74976afa407bf22.md +++ b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69ea1dd8e74976afa407bf22.md @@ -1,6 +1,6 @@ --- id: 69ea1dd8e74976afa407bf22 -title: 第 50 步 +title: 步骤 50 challengeType: 0 dashedName: step-50 --- @@ -479,7 +479,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69ea1ed1543a4db863564aac.md b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69ea1ed1543a4db863564aac.md index 398500d528b..50c47f3efbd 100644 --- a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69ea1ed1543a4db863564aac.md +++ b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69ea1ed1543a4db863564aac.md @@ -1,6 +1,6 @@ --- id: 69ea1ed1543a4db863564aac -title: 第 51 步 +title: 步骤51 challengeType: 0 dashedName: step-51 --- @@ -472,7 +472,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69ea21dcd8c4cb48c23a2c67.md b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69ea21dcd8c4cb48c23a2c67.md index a7db66ec5d8..3095eff63c4 100644 --- a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69ea21dcd8c4cb48c23a2c67.md +++ b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69ea21dcd8c4cb48c23a2c67.md @@ -1,6 +1,6 @@ --- id: 69ea21dcd8c4cb48c23a2c67 -title: 第 53 步 +title: 步骤 53 challengeType: 0 dashedName: step-53 --- @@ -14,7 +14,7 @@ dashedName: step-53 你的位置 `select` 应该有一个 `onChange` 处理程序,该处理程序调用 `setPlayer`,传入 `player` 的展开,并更新 `position`。 ```js -assert.match(__helpers.removeJSComments(code), /onChange.*setPlayer.*\.\.\.\s*player[\s\S]*position/); +assert.match(__helpers.removeJSComments(code), /onChange=\{[\s\S]*?position:\s*e\.target\.value\s+as\s+Position/); ``` # --seed-- @@ -469,7 +469,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69ea2378f3c6a60a57cc29c3.md b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69ea2378f3c6a60a57cc29c3.md index c42a8b5d6ec..ae84a66a9d0 100644 --- a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69ea2378f3c6a60a57cc29c3.md +++ b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69ea2378f3c6a60a57cc29c3.md @@ -1,6 +1,6 @@ --- id: 69ea2378f3c6a60a57cc29c3 -title: 第 54 步 +title: 步骤54 challengeType: 0 dashedName: step-54 --- @@ -483,7 +483,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -537,10 +537,12 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > --fcc-editable-region-- - + --fcc-editable-region-- diff --git a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69eb216380522cfc11aa408c.md b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69eb216380522cfc11aa408c.md index be9e15cc3df..13ad7ba887d 100644 --- a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69eb216380522cfc11aa408c.md +++ b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69eb216380522cfc11aa408c.md @@ -443,7 +443,7 @@ export const PlayerCard = () => { ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69eb23665c115447405343ac.md b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69eb23665c115447405343ac.md index ae0b450d70f..4f3eb082073 100644 --- a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69eb23665c115447405343ac.md +++ b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69eb23665c115447405343ac.md @@ -461,7 +461,7 @@ export const PlayerCard = () => { ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69eb2847cc8f5638e226e8ce.md b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69eb2847cc8f5638e226e8ce.md index 377a6a3e0f1..89548615016 100644 --- a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69eb2847cc8f5638e226e8ce.md +++ b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69eb2847cc8f5638e226e8ce.md @@ -1,6 +1,6 @@ --- id: 69eb2847cc8f5638e226e8ce -title: 第 23 步 +title: 步骤-23 challengeType: 0 dashedName: step-23 --- @@ -483,10 +483,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -543,7 +543,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { --fcc-editable-region-- diff --git a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69ed3985819de69de27c4390.md b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69ed3985819de69de27c4390.md index 93de5808946..79561e8bbe6 100644 --- a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69ed3985819de69de27c4390.md +++ b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69ed3985819de69de27c4390.md @@ -1,6 +1,6 @@ --- id: 69ed3985819de69de27c4390 -title: 第 33 步 +title: 步骤 33 challengeType: 0 dashedName: step-33 --- @@ -391,10 +391,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -453,14 +453,14 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { - name: 'PELE', + name: "PELE", overallRating: 98, - position: 'ST', - club: 'Santos FC', - imageUrl: 'https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg', + position: "ST", + club: "Santos FC", + imageUrl: "https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg", pac: 97, sho: 98, pas: 83, @@ -471,7 +471,7 @@ const defaultPlayer: PlayerData = { export const FootballPlayerCard = () => { --fcc-editable-region-- - return ; + return ; --fcc-editable-region-- }; ``` diff --git a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69f1a6f57dd2d4685822074a.md b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69f1a6f57dd2d4685822074a.md index a77748ce7d3..4996991a661 100644 --- a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69f1a6f57dd2d4685822074a.md +++ b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69f1a6f57dd2d4685822074a.md @@ -1,6 +1,6 @@ --- id: 69f1a6f57dd2d4685822074a -title: 第 14 步 +title: 步骤14 challengeType: 0 dashedName: step-14 --- @@ -401,8 +401,8 @@ export const PlayerCard = () => {
- --fcc-editable-region--
+ --fcc-editable-region--
@@ -410,14 +410,14 @@ export const PlayerCard = () => {
-
--fcc-editable-region-- +
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69f1a9e19340f19b1fd051c6.md b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69f1a9e19340f19b1fd051c6.md index d0953c2c029..1b5860c3926 100644 --- a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69f1a9e19340f19b1fd051c6.md +++ b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69f1a9e19340f19b1fd051c6.md @@ -416,9 +416,9 @@ export const PlayerCard = () => {
- --fcc-editable-region--
+ --fcc-editable-region--
@@ -426,14 +426,14 @@ export const PlayerCard = () => {
+ --fcc-editable-region--
- --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69f1af24b0860d13f0b295e5.md b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69f1af24b0860d13f0b295e5.md index 9de20b2085f..9fff009afd4 100644 --- a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69f1af24b0860d13f0b295e5.md +++ b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69f1af24b0860d13f0b295e5.md @@ -1,6 +1,6 @@ --- id: 69f1af24b0860d13f0b295e5 -title: 第 31 步 +title: 步骤 31 challengeType: 0 dashedName: step-31 --- @@ -407,10 +407,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -451,9 +451,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
- --fcc-editable-region--
+ --fcc-editable-region-- 99 DRI
@@ -463,17 +463,17 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
75 + --fcc-editable-region-- PHY
- --fcc-editable-region-- ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69f1b1fb36c6c0c80907e8e1.md b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69f1b1fb36c6c0c80907e8e1.md index e629e3df416..b131f396583 100644 --- a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69f1b1fb36c6c0c80907e8e1.md +++ b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69f1b1fb36c6c0c80907e8e1.md @@ -1,6 +1,6 @@ --- id: 69f1b1fb36c6c0c80907e8e1 -title: 第 37 步 +title: 步骤 37 challengeType: 0 dashedName: step-37 --- @@ -483,7 +483,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -511,17 +511,15 @@ export const FootballPlayerCard = () => {
- --fcc-editable-region-- -
- -
+
+ --fcc-editable-region--
+ --fcc-editable-region--
- --fcc-editable-region-- ); }; diff --git a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69f1b591221851200c734eb4.md b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69f1b591221851200c734eb4.md index 6ca04a50170..fc686ed2903 100644 --- a/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69f1b591221851200c734eb4.md +++ b/curriculum/challenges/chinese/blocks/workshop-build-a-football-player-card-builder/69f1b591221851200c734eb4.md @@ -1,6 +1,6 @@ --- id: 69f1b591221851200c734eb4 -title: 第 41 步 +title: 步骤 41 challengeType: 0 dashedName: step-41 --- @@ -472,7 +472,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f356ed6199b0cdef1d2be8f.md b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f356ed6199b0cdef1d2be8f.md index 7f8dce5bc35..f70bd65ad95 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f356ed6199b0cdef1d2be8f.md +++ b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f356ed6199b0cdef1d2be8f.md @@ -13,11 +13,11 @@ dashedName: step-22 ```css .class-name { - styles + property: value; } ``` -将现有的 `#menu` 选择器更改为类选择器,将 `#menu` 替换为名为 `.menu` 的类。 +将现有的 `#menu` 选择器改为类选择器,方法是将 `#menu` 替换为类选择器 `.menu`。 # --hints-- diff --git a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f3cade99dda4e6071a85dfd.md b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f3cade99dda4e6071a85dfd.md index 4825da02e78..6bcaa232894 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f3cade99dda4e6071a85dfd.md +++ b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f3cade99dda4e6071a85dfd.md @@ -109,7 +109,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f3ef6e01f288a026d709587.md b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f3ef6e01f288a026d709587.md index 3f9badb8411..46d8ef7e3b2 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f3ef6e01f288a026d709587.md +++ b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f3ef6e01f288a026d709587.md @@ -171,7 +171,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f3ef6e03d719d5ac4738993.md b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f3ef6e03d719d5ac4738993.md index 888eb61b7a0..d5865ee8796 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f3ef6e03d719d5ac4738993.md +++ b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f3ef6e03d719d5ac4738993.md @@ -115,7 +115,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f3ef6e04559b939080db057.md b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f3ef6e04559b939080db057.md index 9f05d3ea4d6..e81ad9b655a 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f3ef6e04559b939080db057.md +++ b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f3ef6e04559b939080db057.md @@ -139,7 +139,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f3ef6e050279c7a4a7101d3.md b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f3ef6e050279c7a4a7101d3.md index f67e983a665..848ec9798b4 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f3ef6e050279c7a4a7101d3.md +++ b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f3ef6e050279c7a4a7101d3.md @@ -137,7 +137,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f3ef6e05473f91f948724ab.md b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f3ef6e05473f91f948724ab.md index a62ff72782f..5f837e724e1 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f3ef6e05473f91f948724ab.md +++ b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f3ef6e05473f91f948724ab.md @@ -116,6 +116,6 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f3ef6e056bdde6ae6892ba2.md b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f3ef6e056bdde6ae6892ba2.md index 5041af191bd..f8ea32a5275 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f3ef6e056bdde6ae6892ba2.md +++ b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f3ef6e056bdde6ae6892ba2.md @@ -9,7 +9,7 @@ dashedName: step-54 所有的文字都有相同的 `font-family`,这有点无聊。 你仍然可以让大部分文字都是 `sans-serif` ,只是用不同的选择器使 `h1`和 `h2` 元素不同。 -使用一个选择器设置 `h1` 和 `h2` 元素的样式,使这些元素的文本使用 `Impact` 字体。 +使用单个选择器列表为 `h1` 和 `h2` 元素设置样式,使这些元素的文本使用 `Impact` 字体。 # --hints-- @@ -135,7 +135,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f3ef6e06d34faac0447fc44.md b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f3ef6e06d34faac0447fc44.md index 14f6f5ad6c3..2e2b3716a45 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f3ef6e06d34faac0447fc44.md +++ b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f3ef6e06d34faac0447fc44.md @@ -127,7 +127,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f3ef6e07276f782bb46b93d.md b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f3ef6e07276f782bb46b93d.md index 4d0aa3a4aaa..b0d50e4a96a 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f3ef6e07276f782bb46b93d.md +++ b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f3ef6e07276f782bb46b93d.md @@ -142,7 +142,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f3ef6e0819d4f23ca7285e6.md b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f3ef6e0819d4f23ca7285e6.md index 0f7c3b1c9e6..6ed42587406 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f3ef6e0819d4f23ca7285e6.md +++ b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f3ef6e0819d4f23ca7285e6.md @@ -104,7 +104,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f3ef6e087d56ed3ffdc36be.md b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f3ef6e087d56ed3ffdc36be.md index 637e05fdad8..76a48e781c1 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f3ef6e087d56ed3ffdc36be.md +++ b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f3ef6e087d56ed3ffdc36be.md @@ -129,6 +129,6 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f3ef6e0a81099d9a697b550.md b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f3ef6e0a81099d9a697b550.md index 70cadbed6a9..c0729acc5bd 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f3ef6e0a81099d9a697b550.md +++ b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f3ef6e0a81099d9a697b550.md @@ -167,7 +167,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f3ef6e0b431cc215bb16f55.md b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f3ef6e0b431cc215bb16f55.md index 57e3e1db610..a5d78d9af8e 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f3ef6e0b431cc215bb16f55.md +++ b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f3ef6e0b431cc215bb16f55.md @@ -141,7 +141,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f3ef6e0e0c3feaebcf647ad.md b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f3ef6e0e0c3feaebcf647ad.md index 89941f82c8b..3b12a7242a5 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f3ef6e0e0c3feaebcf647ad.md +++ b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f3ef6e0e0c3feaebcf647ad.md @@ -103,7 +103,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f3ef6e0e9629bad967cd71e.md b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f3ef6e0e9629bad967cd71e.md index ecbc2597a5e..3284ba33801 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f3ef6e0e9629bad967cd71e.md +++ b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f3ef6e0e9629bad967cd71e.md @@ -7,7 +7,7 @@ dashedName: step-55 # --description-- -你可以通过添加另一个用逗号分隔的字体名称来为 font-family 添加一个后备值。 Fallback 是在初始值找不到/无法使用的情况下使用的。 +你可以为 `font-family` 添加一个 回退 值,通过添加另一个用逗号分隔的字体名称。当第一个字体不可用时,会使用回退字体。 在 `Impact` 字体之后添加后备(fallback)字体`serif`。 @@ -113,7 +113,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f3ef6e0eaa7da26e3d34d78.md b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f3ef6e0eaa7da26e3d34d78.md index f22855c5f0f..6bc519093f1 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f3ef6e0eaa7da26e3d34d78.md +++ b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f3ef6e0eaa7da26e3d34d78.md @@ -128,7 +128,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f3ef6e0f8c230bdd2349716.md b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f3ef6e0f8c230bdd2349716.md index d375187e60f..497c747cb84 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f3ef6e0f8c230bdd2349716.md +++ b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f3ef6e0f8c230bdd2349716.md @@ -140,6 +140,6 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f3f26fa39591db45e5cd7a0.md b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f3f26fa39591db45e5cd7a0.md index 88bc6678615..9ed1d71f01f 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f3f26fa39591db45e5cd7a0.md +++ b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f3f26fa39591db45e5cd7a0.md @@ -7,7 +7,7 @@ dashedName: step-64 # --description-- -`hr` 元素的默认属性将使其显示为浅灰色细线。 你可以通过为 `height` 属性指定一个值来改变线条的高度。 +`hr` 元素的默认属性会使其显示为一条细的浅灰色线。你可以通过为 `height` 属性指定一个值来改变这条线的高度。 将 `hr` 元素的高度更改为 `3px`。 @@ -150,7 +150,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f459225127805351a6ad057.md b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f459225127805351a6ad057.md index 6434535d323..7bf54a64133 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f459225127805351a6ad057.md +++ b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f459225127805351a6ad057.md @@ -144,7 +144,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f459a7ceb8b5c446656d88b.md b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f459a7ceb8b5c446656d88b.md index 973db9d62ae..96cbc20c3d7 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f459a7ceb8b5c446656d88b.md +++ b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f459a7ceb8b5c446656d88b.md @@ -147,6 +147,6 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f459cf202c2a3472fae6a9f.md b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f459cf202c2a3472fae6a9f.md index 645f1541bf0..adcea2e6756 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f459cf202c2a3472fae6a9f.md +++ b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f459cf202c2a3472fae6a9f.md @@ -7,7 +7,7 @@ dashedName: step-67 # --description-- -注意到线条如何更粗了吗? 对于 `hr` 元素的所有边缘,名为 `border-width` 的属性的默认值为 `1px`。 通过将边框改为与背景相同的颜色,线条的总高度为 `5px`(`3px` 加上上下边框宽度 `1px`)。 +注意线条的粗细看起来更大了吗?名为 `border-width` 的属性在所有 `hr` 元素的边缘上的默认值是 `1px`。线条的总高度一直是 `5px`(`3px` 加上上下边框宽度各 `1px`);给边框上色使这些边缘变得可见。 将 `hr` 的 `height` 属性改为 `2px`,这样它的总高度就变成了 `4px`。 @@ -147,7 +147,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f459fd48bdc98491ca6d1a3.md b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f459fd48bdc98491ca6d1a3.md index adc452d8f05..52399602b22 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f459fd48bdc98491ca6d1a3.md +++ b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f459fd48bdc98491ca6d1a3.md @@ -145,7 +145,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f45a05977e2fa49d9119437.md b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f45a05977e2fa49d9119437.md index 5cb7e0ab992..7e24ed7c007 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f45a05977e2fa49d9119437.md +++ b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f45a05977e2fa49d9119437.md @@ -146,6 +146,6 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f45a276c093334f0f6e9df4.md b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f45a276c093334f0f6e9df4.md index eb97e17be35..2fbea1b1fe6 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f45a276c093334f0f6e9df4.md +++ b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f45a276c093334f0f6e9df4.md @@ -185,7 +185,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f45a5a7c49a8251f0bdb527.md b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f45a5a7c49a8251f0bdb527.md index eafe667658b..5b5e0ba5ed8 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f45a5a7c49a8251f0bdb527.md +++ b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f45a5a7c49a8251f0bdb527.md @@ -157,7 +157,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f45a66d4a2b0453301e5a26.md b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f45a66d4a2b0453301e5a26.md index c288b0b9509..23a6abe41dd 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f45a66d4a2b0453301e5a26.md +++ b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f45a66d4a2b0453301e5a26.md @@ -166,7 +166,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f45b0731d39e15d54df4dfc.md b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f45b0731d39e15d54df4dfc.md index 0e602081e8b..689373a8486 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f45b0731d39e15d54df4dfc.md +++ b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f45b0731d39e15d54df4dfc.md @@ -161,7 +161,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f45b25e7ec2405f166b9de1.md b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f45b25e7ec2405f166b9de1.md index 305c5fc8ee4..08cfdb72cc9 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f45b25e7ec2405f166b9de1.md +++ b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f45b25e7ec2405f166b9de1.md @@ -9,7 +9,7 @@ dashedName: step-78 当链接已被访问时,你可以使用一个看起来像 `a:visited { propertyName: propertyValue; }` 的伪选择器来更改链接的属性。 -当用户访问链接后,将页脚的 `Visit our website` 链接的颜色更改为 `grey`。 +当用户访问过链接时,将页脚中 `Visit our website` 链接的颜色改为 `gray`。 # --hints-- @@ -20,14 +20,14 @@ const aVisitedStyle = new __helpers.CSSHelp(document).getStyle('a:visited'); assert.exists(aVisitedStyle); ``` -你应该将 `color` 属性设置为 `grey`。 +你应该将 `color` 属性设置为 `gray`。 ```js const hasColor = new __helpers.CSSHelp(document).getCSSRules().some(x => (x.style.color === 'grey' || x.style.color === 'gray')); assert.isTrue(hasColor); ``` -你的 `a:visited` 的 `color` 应该是 `grey`。 +你的 `a:visited` 应该有一个 `color` 为 `gray`。 ```js const aVisitedColor = new __helpers.CSSHelp(document).getStyle('a:visited')?.getPropertyValue('color'); @@ -161,7 +161,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f45b3c93c027860d9298dbd.md b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f45b3c93c027860d9298dbd.md index 368cec4dea7..21da0877ec8 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f45b3c93c027860d9298dbd.md +++ b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f45b3c93c027860d9298dbd.md @@ -161,7 +161,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ @@ -179,7 +179,7 @@ a { } a:visited { - color: grey; + color: gray; } --fcc-editable-region-- diff --git a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f45b45d099f3e621fbbb256.md b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f45b45d099f3e621fbbb256.md index 7b41d69c0fa..660f6e98d86 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f45b45d099f3e621fbbb256.md +++ b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f45b45d099f3e621fbbb256.md @@ -161,7 +161,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ @@ -179,7 +179,7 @@ a { } a:visited { - color: grey; + color: gray; } a:hover { diff --git a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f45b4c81cea7763550e40df.md b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f45b4c81cea7763550e40df.md index 0fe55d2d644..a7cbd6af1c5 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f45b4c81cea7763550e40df.md +++ b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f45b4c81cea7763550e40df.md @@ -152,7 +152,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ @@ -171,7 +171,7 @@ a { --fcc-editable-region-- a:visited { - color: grey; + color: gray; } a:hover { diff --git a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f45b715301bbf667badc04a.md b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f45b715301bbf667badc04a.md index 66eb2648d45..3dec7c2a762 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f45b715301bbf667badc04a.md +++ b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f45b715301bbf667badc04a.md @@ -7,7 +7,7 @@ dashedName: step-82 # --description-- -菜单文本 `CAMPER CAFE` 的顶部空间与菜单底部的地址空间不同。 这是由于浏览器对 `h1` 元素有一些默认顶部 margin。 +菜单文本 `CAMPER CAFE` 上方的空白与菜单底部地址下方的空白不匹配。这是因为浏览器对 `h1` 元素有一些默认的顶部外边距。 将 `h1` 元素的顶部 margin 更改为 `0` 以删除所有顶部 margin。 @@ -157,7 +157,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f46e270702a8456a664f0df.md b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f46e270702a8456a664f0df.md index b0042da4624..4f3ff779e3a 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f46e270702a8456a664f0df.md +++ b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f46e270702a8456a664f0df.md @@ -156,7 +156,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f46e36e745ead58487aabf2.md b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f46e36e745ead58487aabf2.md index 84365847e9e..3fb9a742650 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f46e36e745ead58487aabf2.md +++ b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f46e36e745ead58487aabf2.md @@ -163,7 +163,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f46e7a4750dd05b5a673920.md b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f46e7a4750dd05b5a673920.md index 4cacc432c4f..2dc0e19cf96 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f46e7a4750dd05b5a673920.md +++ b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f46e7a4750dd05b5a673920.md @@ -160,7 +160,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f46e8284aae155c83015dee.md b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f46e8284aae155c83015dee.md index 752f966cb11..d40bcf52e19 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f46e8284aae155c83015dee.md +++ b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f46e8284aae155c83015dee.md @@ -9,7 +9,7 @@ dashedName: step-86 菜单看起来不错,但除了咖啡豆的背景图片外,主要就是文字。 -在 `Coffee` 标题下,使用 Url `https://cdn.freecodecamp.org/curriculum/css-cafe/coffee.jpg` 添加一张图片。 给图像一个 `alt` 值 `coffee icon`。 +在 `Coffee` 标题下,使用 URL `https://cdn.freecodecamp.org/curriculum/css-cafe/coffee.jpg` 添加一张图像。为该图像设置 `alt` 属性值为 `coffee icon`。 # --hints-- @@ -105,6 +105,7 @@ assert.match(imageAltValue, /coffee icon/i);

123 Free Code Camp Drive

+ ``` @@ -171,7 +172,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f46ede1ff8fec5ba656b44c.md b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f46ede1ff8fec5ba656b44c.md index c8857412519..67f6ea7095f 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f46ede1ff8fec5ba656b44c.md +++ b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f46ede1ff8fec5ba656b44c.md @@ -144,7 +144,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } --fcc-editable-region-- diff --git a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f46fc57528aa1c4b5ea7c2e.md b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f46fc57528aa1c4b5ea7c2e.md index ac40360852b..858a8b69902 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f46fc57528aa1c4b5ea7c2e.md +++ b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f46fc57528aa1c4b5ea7c2e.md @@ -161,7 +161,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f4701b942c824109626c3d8.md b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f4701b942c824109626c3d8.md index ba837016259..e6ab28224e8 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f4701b942c824109626c3d8.md +++ b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f4701b942c824109626c3d8.md @@ -153,6 +153,6 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f475bb508746c16c9431d42.md b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f475bb508746c16c9431d42.md index cdfb454283d..e13d16a5e63 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f475bb508746c16c9431d42.md +++ b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f475bb508746c16c9431d42.md @@ -7,9 +7,9 @@ dashedName: step-87 # --description-- -你添加的图像没有像上面的 `Coffee` 标题那样水平居中。`img` 元素“类似”内联元素。 +你添加的图像没有像上面的 `Coffee` 标题那样水平居中。`img` 元素是内联元素,因此它们位于文本流中。 -要使图像的行为像标题一样的块级元素,请创建一个 `img` 类型选择器。 将 `display` 属性设置为 `block`,并使用 `margin-left` 和 `margin-right` 属性将其水平居中。 +为了让图像表现得像标题这样的块级元素,创建一个 `img` 类型选择器。将 `display` 属性设置为 `block`,并使用 `margin-left` 和 `margin-right` 属性使其水平居中。 # --hints-- @@ -120,6 +120,7 @@ assert.equal(imgMarginRight, 'auto');

123 Free Code Camp Drive

+ ``` @@ -190,7 +191,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f475e1c7f71a61d913836c6.md b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f475e1c7f71a61d913836c6.md index 17baeeef780..54082740c9c 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f475e1c7f71a61d913836c6.md +++ b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f475e1c7f71a61d913836c6.md @@ -97,6 +97,7 @@ assert.match(lastImage?.alt, /pie icon/i);

123 Free Code Camp Drive

+ ``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f47fe7e31980053a8d4403b.md b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f47fe7e31980053a8d4403b.md index 82998093d8e..79af69739ef 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f47fe7e31980053a8d4403b.md +++ b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f47fe7e31980053a8d4403b.md @@ -7,7 +7,7 @@ dashedName: step-89 # --description-- -如果 `h2` 元素及其相关图标之间的垂直空间更小,那就太好了。 `h2` 元素具有默认的顶部和底部 margin 空间,因此你可以将 `h2` 元素的底部 margin 更改为 `0` 或其他数字。 +如果 `h2` 元素和它们关联的图标之间的垂直间距更小会更好。`h2` 元素有默认的上下边距,所以你可以将 `h2` 元素的下边距改为 `0` 或其他值。 有一种更简单的方法,只需向 `img` 元素添加一个负的顶部 margin,以将它们从当前位置拉上来。 负值是通过在值前面添加 `-` 创建的。 To complete this workshop, go ahead and use a negative top margin of `25px` in the `img` type selector. diff --git a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f716ad029ee4053c7027a7a.md b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f716ad029ee4053c7027a7a.md index ad08c537f22..547ee883f6d 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f716ad029ee4053c7027a7a.md +++ b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f716ad029ee4053c7027a7a.md @@ -119,7 +119,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f716bee5838c354c728a7c5.md b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f716bee5838c354c728a7c5.md index b20de30f48f..4733952562f 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f716bee5838c354c728a7c5.md +++ b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f716bee5838c354c728a7c5.md @@ -158,6 +158,6 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f7b87422a560036fd03ccff.md b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f7b87422a560036fd03ccff.md index 94f474104df..c31d7df1425 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f7b87422a560036fd03ccff.md +++ b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f7b87422a560036fd03ccff.md @@ -118,7 +118,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f7b88d37b1f98386f04edc0.md b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f7b88d37b1f98386f04edc0.md index 2a12cc0b555..df12caf528e 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f7b88d37b1f98386f04edc0.md +++ b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/5f7b88d37b1f98386f04edc0.md @@ -97,6 +97,6 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/6780e8ef4153930b965cd7b7.md b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/6780e8ef4153930b965cd7b7.md index ee65b4a108b..18f911fd44f 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/6780e8ef4153930b965cd7b7.md +++ b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/6780e8ef4153930b965cd7b7.md @@ -125,6 +125,6 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/6780f0d898362873ac425dc8.md b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/6780f0d898362873ac425dc8.md index ab9642bd9bc..bfaa4aff593 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cafe-menu/6780f0d898362873ac425dc8.md +++ b/curriculum/challenges/chinese/blocks/workshop-cafe-menu/6780f0d898362873ac425dc8.md @@ -156,7 +156,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/chinese/blocks/workshop-calculator/66cc095dfe1682753d2ab030.md b/curriculum/challenges/chinese/blocks/workshop-calculator/66cc095dfe1682753d2ab030.md index 501059617ce..2c2229d17c7 100644 --- a/curriculum/challenges/chinese/blocks/workshop-calculator/66cc095dfe1682753d2ab030.md +++ b/curriculum/challenges/chinese/blocks/workshop-calculator/66cc095dfe1682753d2ab030.md @@ -7,7 +7,7 @@ dashedName: step-2 # --description-- -你在之前的课程中学到的概念之一是如何从函数返回值。 +你在之前的课程中学到的一个概念是如何从函数中返回值。 下面是如何从函数中返回值的提示: @@ -30,7 +30,10 @@ assert.strictEqual(addTwoAndSeven(), 9); 你的 `addTwoAndSeven` 函数应使用 `+` 运算符返回和。 ```js -assert.match(code, /return\s*(2\s*\+\s*7|7\s*\+\s*2)\s*;?/); +const explorer = await __helpers.Explorer(code); +const { addTwoAndSeven } = explorer.allFunctions; +const validExpressions = ["2 + 7", "7 + 2", "(2 + 7)", "(7 + 2)"]; +assert.isTrue(validExpressions.some(expr => addTwoAndSeven?.hasReturn(expr))); ``` # --seed-- diff --git a/curriculum/challenges/chinese/blocks/workshop-calculator/66cc0a9e06e00b75d6782be9.md b/curriculum/challenges/chinese/blocks/workshop-calculator/66cc0a9e06e00b75d6782be9.md index 904a52c3c6a..f08411ed1e7 100644 --- a/curriculum/challenges/chinese/blocks/workshop-calculator/66cc0a9e06e00b75d6782be9.md +++ b/curriculum/challenges/chinese/blocks/workshop-calculator/66cc0a9e06e00b75d6782be9.md @@ -1,6 +1,6 @@ --- id: 66cc0a9e06e00b75d6782be9 -title: 步骤 3 +title: 第 3 步 challengeType: 1 dashedName: step-3 --- @@ -26,16 +26,12 @@ myFunction(); # --hints-- -你的代码中应该有一个 `console.log`。 +你应该在 `console.log` 内调用 `addTwoAndSeven` 函数。 ```js -assert.match(code, /console\.log(.*)/); -``` - -你应在 `console.log` 中调用 `addTwoAndSeven` 函数。 - -```js -assert.match(code, /console\.log\(\s*addTwoAndSeven\(\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(addTwoAndSeven())"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/chinese/blocks/workshop-calculator/66cc0ba5881acb7692cfc4de.md b/curriculum/challenges/chinese/blocks/workshop-calculator/66cc0ba5881acb7692cfc4de.md index e74475cc88b..012408cb13f 100644 --- a/curriculum/challenges/chinese/blocks/workshop-calculator/66cc0ba5881acb7692cfc4de.md +++ b/curriculum/challenges/chinese/blocks/workshop-calculator/66cc0ba5881acb7692cfc4de.md @@ -1,13 +1,13 @@ --- id: 66cc0ba5881acb7692cfc4de -title: 步骤4 +title: 第 4 步 challengeType: 1 dashedName: step-4 --- # --description-- -现在,是时候添加另一个函数了。 +现在是时候添加另一个函数了。 声明一个名为 `addThreeAndFour` 的函数,返回 `3` 与 `4` 的和。 @@ -24,22 +24,24 @@ assert.isFunction(addThreeAndFour); 你的 `addThreeAndFour` 函数应返回 `3` 与 `4` 的和。 ```js -assert.equal(addThreeAndFour(), 7); +assert.strictEqual(addThreeAndFour(), 7); ``` 你的 `addThreeAndFour` 函数应使用 `+` 运算符返回和。 ```js -const declarationStyle = /return\s*\(?\s*(3\s*\+\s*4|4\s*\+\s*3)\s*\)?\s*;?/; -const arrowStyle = /=>\s*\(?\s*(3\s*\+\s*4|4\s*\+\s*3)\s*\)?\s*;?/; -const combinedRegex = new RegExp(`(?:${declarationStyle.source})|(?:${arrowStyle.source})`); -assert.match(code, combinedRegex); +const explorer = await __helpers.Explorer(code); +const { addThreeAndFour } = explorer.allFunctions; +const validExpressions = ["3 + 4", "4 + 3", "(3 + 4)", "(4 + 3)"]; +assert.isTrue(validExpressions.some(expr => addThreeAndFour?.hasReturn(expr))); ``` 你应在一个 `console.log` 中调用 `addThreeAndFour` 函数。 ```js -assert.match(code, /console\.log\(\s*addThreeAndFour\(\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(addThreeAndFour())"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/chinese/blocks/workshop-calculator/66cc0de2920bec775f610424.md b/curriculum/challenges/chinese/blocks/workshop-calculator/66cc0de2920bec775f610424.md index b49a4b6af74..9be5f6ec0b6 100644 --- a/curriculum/challenges/chinese/blocks/workshop-calculator/66cc0de2920bec775f610424.md +++ b/curriculum/challenges/chinese/blocks/workshop-calculator/66cc0de2920bec775f610424.md @@ -1,13 +1,13 @@ --- id: 66cc0de2920bec775f610424 -title: 步骤5 +title: 第 5 步 challengeType: 1 dashedName: step-5 --- # --description-- -尽管这些函数的运行符合预期,但你的代码中存在大量重复。 +尽管这些函数的运行符合预期,但你的代码中存在大量重复。 由于你正在构建一个计算器,因此不必为每种可能的数字加法组合创建一个函数。 @@ -22,25 +22,33 @@ dashedName: step-5 你不应有名为 `addTwoAndSeven` 的函数。 ```js -assert.notMatch(code, /function\s+addTwoAndSeven\s*\(\s*\)\s*{/); +const explorer = await __helpers.Explorer(code); +const { addTwoAndSeven } = explorer.allFunctions; +assert.notExists(addTwoAndSeven); ``` 你不应有名为 `addTwoAndSeven` 的函数。 ```js -assert.notMatch(code, /console\.log\(\s*addTwoAndSeven\(\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const unexpectedStatement = "console.log(addTwoAndSeven())"; +assert.notInclude(strippedCode, unexpectedStatement); ``` 你不应有名为 `addThreeAndFour` 的函数。 ```js -assert.notMatch(code, /function\s+addThreeAndFour\s*\(\s*\)\s*{/); +const explorer = await __helpers.Explorer(code); +const { addThreeAndFour } = explorer.allFunctions; +assert.notExists(addThreeAndFour); ``` 你不应有名为 `addThreeAndFour` 的函数。 ```js -assert.notMatch(code, /console\.log\(\s*addThreeAndFour\(\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const unexpectedStatement = "console.log(addThreeAndFour())"; +assert.notInclude(strippedCode, unexpectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/chinese/blocks/workshop-calculator/66cc0f1ae40802781b2ea972.md b/curriculum/challenges/chinese/blocks/workshop-calculator/66cc0f1ae40802781b2ea972.md index 0ba6f3e243e..a48590d4af8 100644 --- a/curriculum/challenges/chinese/blocks/workshop-calculator/66cc0f1ae40802781b2ea972.md +++ b/curriculum/challenges/chinese/blocks/workshop-calculator/66cc0f1ae40802781b2ea972.md @@ -1,6 +1,6 @@ --- id: 66cc0f1ae40802781b2ea972 -title: 步骤6 +title: 第 6 步 challengeType: 1 dashedName: step-6 --- @@ -33,8 +33,11 @@ assert.isFunction(calculateSum); 你的 `calculateSum` 函数应包含 `num1` 和 `num2` 两个参数,。 ```js -const regex = __helpers.functionRegex('calculateSum', ['num1', 'num2']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { calculateSum } = explorer.allFunctions; +assert.lengthOf(calculateSum?.parameters, 2); +assert.equal(calculateSum?.parameters[0].toString(), "num1"); +assert.equal(calculateSum?.parameters[1].toString(), "num2"); ``` # --seed-- diff --git a/curriculum/challenges/chinese/blocks/workshop-calculator/66cc12fa504b0479dac479a0.md b/curriculum/challenges/chinese/blocks/workshop-calculator/66cc12fa504b0479dac479a0.md index 5fe030cbc39..6862c2b0f84 100644 --- a/curriculum/challenges/chinese/blocks/workshop-calculator/66cc12fa504b0479dac479a0.md +++ b/curriculum/challenges/chinese/blocks/workshop-calculator/66cc12fa504b0479dac479a0.md @@ -29,7 +29,9 @@ greetUser("Jane"); // "Hello Jane!" 你应有一个 `console.log`,在其中调用 `calculateSum` 函数,并传入参数 `2` 和 `5`。 ```js -assert.match(code, /console\.log\(calculateSum\(\s*2\s*,\s*5\)\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const validStatements = ["console.log(calculateSum(2,5))", "console.log(calculateSum(5,2))"]; +assert.isTrue(validStatements.some(stmt => strippedCode.includes(stmt))); ``` # --seed-- diff --git a/curriculum/challenges/chinese/blocks/workshop-calculator/66cc14ca14e65e7a9ebecb80.md b/curriculum/challenges/chinese/blocks/workshop-calculator/66cc14ca14e65e7a9ebecb80.md index 3ac05361524..0ba940c5ac4 100644 --- a/curriculum/challenges/chinese/blocks/workshop-calculator/66cc14ca14e65e7a9ebecb80.md +++ b/curriculum/challenges/chinese/blocks/workshop-calculator/66cc14ca14e65e7a9ebecb80.md @@ -1,6 +1,6 @@ --- id: 66cc14ca14e65e7a9ebecb80 -title: 步骤 10 +title: 第 10 步 challengeType: 1 dashedName: step-10 --- @@ -15,7 +15,7 @@ dashedName: step-10 # --hints-- -你应有一个名为 `calculateDifference` 的函数。 +你应该声明一个名为 `calculateDifference` 的函数。 ```js assert.isFunction(calculateDifference); @@ -24,8 +24,11 @@ assert.isFunction(calculateDifference); 你的 `calculateDifference` 函数应该有两个参数,分别称为 `num1` 和 `num2`。 ```js -const regex = __helpers.functionRegex('calculateDifference', ['num1', 'num2']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { calculateDifference } = explorer.allFunctions; +assert.lengthOf(calculateDifference?.parameters, 2); +assert.equal(calculateDifference?.parameters[0].toString(), "num1"); +assert.equal(calculateDifference?.parameters[1].toString(), "num2"); ``` 你的 `calculateDifference` 函数应返回两个参数的差值。 diff --git a/curriculum/challenges/chinese/blocks/workshop-calculator/66cc16abc30b367ba1d1f9ef.md b/curriculum/challenges/chinese/blocks/workshop-calculator/66cc16abc30b367ba1d1f9ef.md index 55966d4e302..9733b81bacc 100644 --- a/curriculum/challenges/chinese/blocks/workshop-calculator/66cc16abc30b367ba1d1f9ef.md +++ b/curriculum/challenges/chinese/blocks/workshop-calculator/66cc16abc30b367ba1d1f9ef.md @@ -1,6 +1,6 @@ --- id: 66cc16abc30b367ba1d1f9ef -title: 步骤11 +title: 第 11 步 challengeType: 1 dashedName: step-11 --- @@ -20,19 +20,25 @@ dashedName: step-11 你应有一个 `console.log`,在其中调用 `calculateDifference` 函数,并传入参数 `22` 和 `5`。 ```js -assert.match(code, /console\.log\s*\(\s*calculateDifference\s*\(\s*22\s*,\s*5\s*\)\s*\)\s*;?/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateDifference(22,5))"; +assert.include(strippedCode, expectedStatement); ``` 你应有一个 `console.log`,在其中调用 `calculateDifference` 函数,并传入参数 `12` 和 `1`。 ```js -assert.match(code, /console\.log\s*\(\s*calculateDifference\s*\(\s*12\s*,\s*1\s*\)\s*\)\s*;?/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateDifference(12,1))"; +assert.include(strippedCode, expectedStatement); ``` 你应有一个 `console.log`,在其中调用 `calculateDifference` 函数,并传入参数 `17` 和 `9`。 ```js -assert.match(code, /console\.log\s*\(\s*calculateDifference\s*\(\s*17\s*,\s*9\s*\)\s*\)\s*;?/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateDifference(17,9))"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/chinese/blocks/workshop-calculator/66cc172af7159a7c67804544.md b/curriculum/challenges/chinese/blocks/workshop-calculator/66cc172af7159a7c67804544.md index 658ce99c030..12195ed4136 100644 --- a/curriculum/challenges/chinese/blocks/workshop-calculator/66cc172af7159a7c67804544.md +++ b/curriculum/challenges/chinese/blocks/workshop-calculator/66cc172af7159a7c67804544.md @@ -1,6 +1,6 @@ --- id: 66cc172af7159a7c67804544 -title: 步骤 12 +title: 第 12 步 challengeType: 1 dashedName: step-12 --- @@ -17,7 +17,7 @@ dashedName: step-12 # --hints-- -你应有一个名为 `calculateProduct` 的函数。 +你应该声明一个名为 `calculateProduct` 的函数。 ```js assert.isFunction(calculateProduct); @@ -26,8 +26,11 @@ assert.isFunction(calculateProduct); 你的 `calculateProduct` 函数应该有两个参数,分别称为 `num1` 和 `num2`。 ```js -const regex = __helpers.functionRegex('calculateProduct', ['num1', 'num2']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { calculateProduct } = explorer.allFunctions; +assert.lengthOf(calculateProduct?.parameters, 2); +assert.equal(calculateProduct?.parameters[0].toString(), "num1"); +assert.equal(calculateProduct?.parameters[1].toString(), "num2"); ``` 你的 `calculateProduct` 函数应返回两个参数的乘积。 @@ -40,7 +43,9 @@ assert.equal(calculateProduct(10, 5), 50); 你应有一个 `console.log`,在其中调用 `calculateProduct` 函数,并传入参数 `13` 和 `5`。 ```js -assert.match(code, /console\.log\s*\(\s*calculateProduct\s*\(\s*13\s*,\s*5\s*\)\s*\)\s*;?/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const validStatements = ["console.log(calculateProduct(13,5))", "console.log(calculateProduct(5,13))"]; +assert.isTrue(validStatements.some(stmt => strippedCode.includes(stmt))); ``` # --seed-- diff --git a/curriculum/challenges/chinese/blocks/workshop-calculator/66cc1a3a39aef47d6473cb2f.md b/curriculum/challenges/chinese/blocks/workshop-calculator/66cc1a3a39aef47d6473cb2f.md index 4648ab336ee..2c28a4ce018 100644 --- a/curriculum/challenges/chinese/blocks/workshop-calculator/66cc1a3a39aef47d6473cb2f.md +++ b/curriculum/challenges/chinese/blocks/workshop-calculator/66cc1a3a39aef47d6473cb2f.md @@ -1,6 +1,6 @@ --- id: 66cc1a3a39aef47d6473cb2f -title: 步骤 13 +title: 第 13 步 challengeType: 1 dashedName: step-13 --- @@ -17,7 +17,7 @@ dashedName: step-13 # --hints-- -你应有一个名为 `calculateQuotient` 的函数。 +你应该声明一个名为 `calculateQuotient` 的函数。 ```js assert.isFunction(calculateQuotient); @@ -26,8 +26,11 @@ assert.isFunction(calculateQuotient); 你的 `calculateQuotient` 函数应该有两个参数,分别称为 `num1` 和 `num2`。 ```js -const regex = __helpers.functionRegex('calculateQuotient', ['num1', 'num2']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { calculateQuotient } = explorer.allFunctions; +assert.lengthOf(calculateQuotient?.parameters, 2); +assert.equal(calculateQuotient?.parameters[0].toString(), "num1"); +assert.equal(calculateQuotient?.parameters[1].toString(), "num2"); ``` 你的 `calculateQuotient` 函数应返回两个参数的商。 @@ -40,7 +43,9 @@ assert.equal(calculateQuotient(100, 10), 10); 你应有一个 `console.log`,在其中调用 `calculateQuotient` 函数,并传入参数 `7` 和 `11`。 ```js -assert.match(code, /console\.log\s*\(\s*calculateQuotient\s*\(\s*7\s*,\s*11\s*\)\s*\)\s*;?/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateQuotient(7,11))"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/chinese/blocks/workshop-calculator/66cc1ccfefdd727e18c2ab20.md b/curriculum/challenges/chinese/blocks/workshop-calculator/66cc1ccfefdd727e18c2ab20.md index d64511dbdd3..96e348e77f3 100644 --- a/curriculum/challenges/chinese/blocks/workshop-calculator/66cc1ccfefdd727e18c2ab20.md +++ b/curriculum/challenges/chinese/blocks/workshop-calculator/66cc1ccfefdd727e18c2ab20.md @@ -7,7 +7,7 @@ dashedName: step-14 # --description-- -你的 `calculateQuotient` 看起来工作正常,但有一种情况你还没有测试过。 +你的 `calculateQuotient` 看起来工作正常,但还有一个分支你还没有测试过。 添加一个 `console.log`,在其中调用 `calculateQuotient` 函数,并传入参数 `3` 和 `0`。 @@ -18,7 +18,9 @@ dashedName: step-14 你应有一个 `console.log`,在其中调用 `calculateQuotient` 函数,并传入参数 `3` 和 `0`。 ```js -assert.match(code, /console\.log\s*\(\s*calculateQuotient\s*\(\s*3\s*,\s*0\s*\)\s*\)\s*;?/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateQuotient(3,0))"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/chinese/blocks/workshop-calculator/66cc1deb1f04647f2aabee2b.md b/curriculum/challenges/chinese/blocks/workshop-calculator/66cc1deb1f04647f2aabee2b.md index e0abe936208..3764c8fe6f5 100644 --- a/curriculum/challenges/chinese/blocks/workshop-calculator/66cc1deb1f04647f2aabee2b.md +++ b/curriculum/challenges/chinese/blocks/workshop-calculator/66cc1deb1f04647f2aabee2b.md @@ -1,6 +1,6 @@ --- id: 66cc1deb1f04647f2aabee2b -title: 步骤15 +title: 第 15 步 challengeType: 1 dashedName: step-15 --- @@ -11,17 +11,17 @@ dashedName: step-15 除以零不是数学中的有效运算。 -为了考虑这种极端情况,你应该更新 `calculateQuotient` 函数,改为检查 `num2` 是否为零。 +为了考虑这种极端情况,你应该更新 `calculateQuotient` 函数,改为检查 `num2` 是否为零。 如果是,函数应返回字符串 `"Error: Division by zero"`。 否则,应返回 `num1` 除以 `num2` 的结果。 # --hints-- -如果 `num2` 是零,你的 `calculateQuotient` 函数应返回字符串 `"Error: Division by zero"`。 +如果 `num2` 是零,你的 `calculateQuotient` 函数应返回字符串 `"Error: Division by zero"`。 ```js -assert.strictEqual(calculateQuotient(10, 0), 'Error: Division by zero'); -assert.strictEqual(calculateQuotient(3, 0), 'Error: Division by zero'); +assert.strictEqual(calculateQuotient(10, 0), "Error: Division by zero"); +assert.strictEqual(calculateQuotient(3, 0), "Error: Division by zero"); ``` 如果 `num2` 不是零,你的 `calculateQuotient` 函数应返回 `num1` 除以 `num2` 的结果。 diff --git a/curriculum/challenges/chinese/blocks/workshop-calculator/66cc21d23238dc8240a8a182.md b/curriculum/challenges/chinese/blocks/workshop-calculator/66cc21d23238dc8240a8a182.md index f03be7ccf36..79546555a36 100644 --- a/curriculum/challenges/chinese/blocks/workshop-calculator/66cc21d23238dc8240a8a182.md +++ b/curriculum/challenges/chinese/blocks/workshop-calculator/66cc21d23238dc8240a8a182.md @@ -28,7 +28,7 @@ Math.pow(5, 2); // 25 # --hints-- -你应有一个名为 `calculateSquare` 的函数。 +你应该声明一个名为 `calculateSquare` 的函数。 ```js assert.isFunction(calculateSquare); @@ -37,8 +37,10 @@ assert.isFunction(calculateSquare); 你的 `calculateSquare` 函数应接受参数 `num`。 ```js -const regex = __helpers.functionRegex('calculateSquare', ['num']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { calculateSquare } = explorer.allFunctions; +assert.lengthOf(calculateSquare?.parameters, 1); +assert.equal(calculateSquare?.parameters[0].toString(), "num"); ``` 你的 `calculateSquare` 函数应返回 `num` 的平方。 diff --git a/curriculum/challenges/chinese/blocks/workshop-calculator/66cc26907ff6908402af0149.md b/curriculum/challenges/chinese/blocks/workshop-calculator/66cc26907ff6908402af0149.md index b554f2e1f17..295e1184207 100644 --- a/curriculum/challenges/chinese/blocks/workshop-calculator/66cc26907ff6908402af0149.md +++ b/curriculum/challenges/chinese/blocks/workshop-calculator/66cc26907ff6908402af0149.md @@ -18,13 +18,17 @@ dashedName: step-17 你应有一个 `console.log`,在其中调用 `calculateSquare` 函数,并传入参数 `2`。 ```js -assert.match(code, /console\.log\s*\(\s*calculateSquare\s*\(\s*2\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateSquare(2))"; +assert.include(strippedCode, expectedStatement); ``` 你应有一个 `console.log`,在其中调用 `calculateSquare` 函数,并传入参数 `9`。 ```js -assert.match(code, /console\.log\s*\(\s*calculateSquare\s*\(\s*9\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateSquare(9))"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/chinese/blocks/workshop-calculator/66cc2739f687e484d50bb6f1.md b/curriculum/challenges/chinese/blocks/workshop-calculator/66cc2739f687e484d50bb6f1.md index 17a472754f7..38cd8783755 100644 --- a/curriculum/challenges/chinese/blocks/workshop-calculator/66cc2739f687e484d50bb6f1.md +++ b/curriculum/challenges/chinese/blocks/workshop-calculator/66cc2739f687e484d50bb6f1.md @@ -26,7 +26,7 @@ Math.sqrt(9); # --hints-- -你应有一个名为 `calculateSquareRoot` 的函数。 +你应该声明一个名为 `calculateSquareRoot` 的函数。 ```js assert.isFunction(calculateSquareRoot); @@ -35,8 +35,10 @@ assert.isFunction(calculateSquareRoot); 你的 `calculateSquareRoot` 函数应接受参数 `num`。 ```js -const regex = __helpers.functionRegex('calculateSquareRoot', ['num']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { calculateSquareRoot } = explorer.allFunctions; +assert.lengthOf(calculateSquareRoot?.parameters, 1); +assert.equal(calculateSquareRoot?.parameters[0].toString(), "num"); ``` 你的 `calculateSquareRoot` 函数应返回 `num` 的平方根。 diff --git a/curriculum/challenges/chinese/blocks/workshop-calculator/66cc281d687975858049fd8d.md b/curriculum/challenges/chinese/blocks/workshop-calculator/66cc281d687975858049fd8d.md index 12ccfe17f11..927eb5cf71a 100644 --- a/curriculum/challenges/chinese/blocks/workshop-calculator/66cc281d687975858049fd8d.md +++ b/curriculum/challenges/chinese/blocks/workshop-calculator/66cc281d687975858049fd8d.md @@ -20,13 +20,17 @@ dashedName: step-19 你应有一个 `console.log`,在其中调用 `calculateSquareRoot` 函数,并传入参数 `25`。 ```js -assert.match(code, /console\.log\s*\(\s*calculateSquareRoot\s*\(\s*25\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateSquareRoot(25))"; +assert.include(strippedCode, expectedStatement); ``` 你应有一个 `console.log`,在其中调用 `calculateSquareRoot` 函数,并传入参数 `100`。 ```js -assert.match(code, /console\.log\s*\(\s*calculateSquareRoot\s*\(\s*100\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateSquareRoot(100))"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/chinese/blocks/workshop-calculator/66cdf76685e4cb5a8726e27b.md b/curriculum/challenges/chinese/blocks/workshop-calculator/66cdf76685e4cb5a8726e27b.md index c1f8e1e2c44..a553a658fce 100644 --- a/curriculum/challenges/chinese/blocks/workshop-calculator/66cdf76685e4cb5a8726e27b.md +++ b/curriculum/challenges/chinese/blocks/workshop-calculator/66cdf76685e4cb5a8726e27b.md @@ -18,13 +18,17 @@ dashedName: step-9 你应有一个 `console.log`,在其中调用 `calculateSum` 函数,并传入参数 `10` 和 `10`。 ```js -assert.match(code, /console\.log\(calculateSum\(10\s*,\s*10\)\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateSum(10,10))"; +assert.include(strippedCode, expectedStatement); ``` 你应有一个 `console.log`,在其中调用 `calculateSum` 函数,并传入参数 `5` 和 `5`。 ```js -assert.match(code, /console\.log\(calculateSum\(5\s*,\s*5\)\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateSum(5,5))"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646c48df8674cf2b91020ecc.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646c48df8674cf2b91020ecc.md index 2668742141e..ef5a177cf93 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646c48df8674cf2b91020ecc.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646c48df8674cf2b91020ecc.md @@ -1,6 +1,6 @@ --- id: 646c48df8674cf2b91020ecc -title: 步骤 1 +title: 第 1 步 challengeType: 0 dashedName: step-1 demoType: onLoad @@ -35,12 +35,13 @@ assert.oneOf(href, ["./styles.css", "styles.css"]); ```html ---fcc-editable-region-- - - fCC Cat Painting - + + fCC Cat Painting --fcc-editable-region-- + +--fcc-editable-region-- + ``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646c586be7180e40ddf74ff6.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646c586be7180e40ddf74ff6.md index 3ec083ac5ab..2bd1629b2f9 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646c586be7180e40ddf74ff6.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646c586be7180e40ddf74ff6.md @@ -1,6 +1,6 @@ --- id: 646c586be7180e40ddf74ff6 -title: 步骤 3 +title: 第 3 步 challengeType: 0 dashedName: step-3 --- @@ -31,9 +31,9 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('body')?.backgroundColor, - - fCC Cat Painting - + + fCC Cat Painting + diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646c59e942f35541923104bf.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646c59e942f35541923104bf.md index dcaea2b4a69..d8ee55a1fe5 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646c59e942f35541923104bf.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646c59e942f35541923104bf.md @@ -1,6 +1,6 @@ --- id: 646c59e942f35541923104bf -title: 步骤4 +title: 第 4 步 challengeType: 0 dashedName: step-4 --- @@ -43,13 +43,13 @@ assert.lengthOf(document.querySelectorAll('main div'), 1); - - fCC Cat Painting - + + fCC Cat Painting + --fcc-editable-region-- - + --fcc-editable-region-- diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646c5ace05e4be4211407935.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646c5ace05e4be4211407935.md index 3fdabed852a..90ba2b73e3d 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646c5ace05e4be4211407935.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646c5ace05e4be4211407935.md @@ -1,6 +1,6 @@ --- id: 646c5ace05e4be4211407935 -title: 步骤6 +title: 第 6 步 challengeType: 0 dashedName: step-6 --- @@ -50,14 +50,14 @@ assert.equal(secondGradient,'(69,69,79)100%)'); - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
+
+
+
``` @@ -71,13 +71,13 @@ body { background-color: #c9d2fc; } ---fcc-editable-region-- .cat-head { +--fcc-editable-region-- + +--fcc-editable-region-- width: 205px; height: 180px; border: 1px solid #000; border-radius: 46%; - } ---fcc-editable-region-- ``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646c5d7057c45f432fcdd46c.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646c5d7057c45f432fcdd46c.md index c9c93b29b77..1f0b8ca4509 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646c5d7057c45f432fcdd46c.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646c5d7057c45f432fcdd46c.md @@ -1,13 +1,13 @@ --- id: 646c5d7057c45f432fcdd46c -title: 步骤5 +title: 第 5 步 challengeType: 0 dashedName: step-5 --- # --description-- -使用类选择器,设置 `.cat-head` 元素的宽度为 `205px`、高度为 `180px`。 同时,设置它的边框为 `1px solid #000`、`border-radius` 为 `46%`。 +使用类选择器,设置 `.cat-head` 元素的宽度为 `205px`、高度为 `180px`。 同时,设置它的边框为 `1px solid #000`、`border-radius` 为 `46%`。 # --hints-- @@ -50,13 +50,13 @@ assert.equal(new __helpers.CSSHelp(document)?.getStyle(".cat-head")?.borderRadiu - - fCC Cat Painting - + + fCC Cat Painting +
-
+
diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646c5e727e56e743c9aed4a1.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646c5e727e56e743c9aed4a1.md index f8968fb4df4..6b4feadc7f4 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646c5e727e56e743c9aed4a1.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646c5e727e56e743c9aed4a1.md @@ -1,6 +1,6 @@ --- id: 646c5e727e56e743c9aed4a1 -title: 步骤7 +title: 第 7 步 challengeType: 0 dashedName: step-7 --- @@ -44,14 +44,14 @@ assert.equal(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.left, '100p - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
+
+
+
``` @@ -65,16 +65,14 @@ body { background-color: #c9d2fc; } ---fcc-editable-region-- .cat-head { - - +--fcc-editable-region-- +--fcc-editable-region-- background: linear-gradient(#5e5e5e 85%, #45454f 100%); width: 205px; height: 180px; border: 1px solid #000; border-radius: 46%; } ---fcc-editable-region-- ``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646c5ffef5598d449b52ec12.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646c5ffef5598d449b52ec12.md index f5a31df1854..f89e566f5a6 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646c5ffef5598d449b52ec12.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646c5ffef5598d449b52ec12.md @@ -39,18 +39,18 @@ assert.equal(document.querySelectorAll('.cat-head div')[0]?.getAttribute('class' - - fCC Cat Painting - + + fCC Cat Painting + -
+
+
--fcc-editable-region-- -
- -
+ --fcc-editable-region-- -
+ +
``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646ce8bb4b35544d501c7184.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646ce8bb4b35544d501c7184.md index 36ebc8ec058..1e609249fd2 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646ce8bb4b35544d501c7184.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646ce8bb4b35544d501c7184.md @@ -1,6 +1,6 @@ --- id: 646ce8bb4b35544d501c7184 -title: 步骤18 +title: 第 18 步 challengeType: 0 dashedName: step-18 --- @@ -43,20 +43,20 @@ assert.isTrue(document.querySelectorAll('.cat-ears div')[1]?.classList.contains( - - fCC Cat Painting - + + fCC Cat Painting + -
-
+
+
+
--fcc-editable-region-- -
- -
+ --fcc-editable-region--
-
+
+
``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646ce9d790d2a44de5f99e04.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646ce9d790d2a44de5f99e04.md index 8c1d2b6c0aa..acf8df637bb 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646ce9d790d2a44de5f99e04.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646ce9d790d2a44de5f99e04.md @@ -1,6 +1,6 @@ --- id: 646ce9d790d2a44de5f99e04 -title: 步骤 19 +title: 第 19 步 challengeType: 0 dashedName: step-19 --- @@ -55,25 +55,25 @@ assert.isTrue(document.querySelectorAll('.cat-right-ear div')[0]?.classList.cont - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
- --fcc-editable-region-- -
- -
-
- -
- --fcc-editable-region-- +
+
+
+
+--fcc-editable-region-- + +
+
+ +--fcc-editable-region--
-
+
+
``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646ceb843412c74edee27a79.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646ceb843412c74edee27a79.md index 60e35fa763b..4de5cbcae55 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646ceb843412c74edee27a79.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646ceb843412c74edee27a79.md @@ -67,23 +67,23 @@ assert.strictEqual(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.b - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646cecc9eb5c4f4f73dafd07.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646cecc9eb5c4f4f73dafd07.md index c70be982d55..67155e28def 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646cecc9eb5c4f4f73dafd07.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646cecc9eb5c4f4f73dafd07.md @@ -37,23 +37,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-ear')?.left, '- - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` @@ -81,12 +81,12 @@ body { border-radius: 46%; } ---fcc-editable-region-- .cat-left-ear { +--fcc-editable-region-- +--fcc-editable-region-- border-left: 35px solid transparent; border-right: 35px solid transparent; border-bottom: 70px solid #5e5e5e; } ---fcc-editable-region-- ``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646cef0c2b98915094df7099.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646cef0c2b98915094df7099.md index a1331b30379..b672143586c 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646cef0c2b98915094df7099.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646cef0c2b98915094df7099.md @@ -31,23 +31,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-ear')?.borderTo - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646cf1206cac5f51804f49cf.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646cf1206cac5f51804f49cf.md index 2faf422e233..d8ba966189e 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646cf1206cac5f51804f49cf.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646cf1206cac5f51804f49cf.md @@ -29,23 +29,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-ear')?.transfor - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646cf2249f02ca5233d9af7c.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646cf2249f02ca5233d9af7c.md index 60e0d68cb34..1f305890090 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646cf2249f02ca5233d9af7c.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646cf2249f02ca5233d9af7c.md @@ -45,23 +45,23 @@ assert.strictEqual(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.b - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646cf48d8f8e1f535a1821d3.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646cf48d8f8e1f535a1821d3.md index 45a123fad12..dbbcf49a72f 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646cf48d8f8e1f535a1821d3.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646cf48d8f8e1f535a1821d3.md @@ -37,23 +37,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.left, ' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646cf6cbca98e258da65c979.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646cf6cbca98e258da65c979.md index ced6b1eab7d..312568c0d14 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646cf6cbca98e258da65c979.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646cf6cbca98e258da65c979.md @@ -25,23 +25,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.transfo - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646cf88aa884405a11ea5bcc.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646cf88aa884405a11ea5bcc.md index ebb9aba6f04..512147c64b2 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646cf88aa884405a11ea5bcc.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646cf88aa884405a11ea5bcc.md @@ -31,23 +31,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.borderT - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646cfc2b8e6fe95c20a819d5.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646cfc2b8e6fe95c20a819d5.md index 8ccbddbc817..bc154605a3c 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646cfc2b8e6fe95c20a819d5.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646cfc2b8e6fe95c20a819d5.md @@ -29,23 +29,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-ear')?.zIndex, - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646cfd853634255d02b64cc1.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646cfd853634255d02b64cc1.md index 2dacea832f4..1fb3180baf9 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646cfd853634255d02b64cc1.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646cfd853634255d02b64cc1.md @@ -27,23 +27,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-ear')?.zIndex, - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646cfde6ac612e5d60391f50.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646cfde6ac612e5d60391f50.md index 2467a2fe50e..1c94dd89052 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646cfde6ac612e5d60391f50.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646cfde6ac612e5d60391f50.md @@ -25,23 +25,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.zIndex, - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646dd556d524bc61c0139bd6.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646dd556d524bc61c0139bd6.md index 3e06b5814ef..8cdc4fcd90d 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646dd556d524bc61c0139bd6.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646dd556d524bc61c0139bd6.md @@ -45,23 +45,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-inner-ear')?.bo - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646dd6f9caa862627dd87772.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646dd6f9caa862627dd87772.md index c567ad205cb..a4ecad2f84f 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646dd6f9caa862627dd87772.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646dd6f9caa862627dd87772.md @@ -37,23 +37,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-inner-ear')?.le - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646dd7cfd0cfac630c1dd520.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646dd7cfd0cfac630c1dd520.md index 6853af6a53b..1b66d1f4630 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646dd7cfd0cfac630c1dd520.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646dd7cfd0cfac630c1dd520.md @@ -43,23 +43,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-inner-ear')?.bo - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646dd8c79ec23463a3d0e356.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646dd8c79ec23463a3d0e356.md index 71fb84d01ec..4efcc342cc2 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646dd8c79ec23463a3d0e356.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646dd8c79ec23463a3d0e356.md @@ -43,23 +43,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-inner-ear')?.b - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646dd9d9a729916460724f16.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646dd9d9a729916460724f16.md index fb83dd08d99..1eb58bc6615 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646dd9d9a729916460724f16.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646dd9d9a729916460724f16.md @@ -37,23 +37,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-inner-ear')?.l - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646ddab8afd73764f5241bbf.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646ddab8afd73764f5241bbf.md index a823d2af7b1..2762b280669 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646ddab8afd73764f5241bbf.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646ddab8afd73764f5241bbf.md @@ -43,23 +43,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-inner-ear')?.b - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646ddb61ff08366570cc5902.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646ddb61ff08366570cc5902.md index a880edee53b..e7db8dc40c4 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646ddb61ff08366570cc5902.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646ddb61ff08366570cc5902.md @@ -45,27 +45,27 @@ assert.isTrue(document.querySelectorAll('.cat-eyes div')[1].classList.contains(' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- - --fcc-editable-region-- - - --fcc-editable-region--
-
+ + --fcc-editable-region-- + + --fcc-editable-region-- +
+
``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646ddd3f9f97a0667b964bdb.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646ddd3f9f97a0667b964bdb.md index dcd9e12ce81..6598074955d 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646ddd3f9f97a0667b964bdb.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646ddd3f9f97a0667b964bdb.md @@ -55,34 +55,34 @@ assert.isTrue(document.querySelectorAll('.cat-right-eye div')[0]?.classList.cont - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
- --fcc-editable-region-- -
- -
-
- -
- --fcc-editable-region-- -
-
+ +
+
+--fcc-editable-region-- + +
+
+ +--fcc-editable-region-- +
+
+
+
``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646dde7dc20dc167489faa69.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646dde7dc20dc167489faa69.md index ffa7ded7554..cb0a4f1d8e4 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646dde7dc20dc167489faa69.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646dde7dc20dc167489faa69.md @@ -43,32 +43,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-eye')?.backgrou - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646ddf888632fa67f1180940.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646ddf888632fa67f1180940.md index 213bf1fc4b8..87d26eea745 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646ddf888632fa67f1180940.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646ddf888632fa67f1180940.md @@ -37,32 +37,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-eye')?.left, '3 - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646de5dc8988076a1d992afd.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646de5dc8988076a1d992afd.md index 48d63473991..397503edd8c 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646de5dc8988076a1d992afd.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646de5dc8988076a1d992afd.md @@ -31,32 +31,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-eye')?.transfor - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646de6a97b50a86ac487de86.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646de6a97b50a86ac487de86.md index f8d7ec4d5a4..ab8f8e862aa 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646de6a97b50a86ac487de86.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646de6a97b50a86ac487de86.md @@ -45,32 +45,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-eye')?.backgro - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646de7b64467e96b7d35b5cd.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646de7b64467e96b7d35b5cd.md index 1bcc6632fb0..39adc17dde2 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646de7b64467e96b7d35b5cd.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646de7b64467e96b7d35b5cd.md @@ -37,32 +37,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-eye')?.left, ' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646de8478d6f796bfbdccfb2.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646de8478d6f796bfbdccfb2.md index 8ca323ada30..ca91a17996a 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646de8478d6f796bfbdccfb2.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646de8478d6f796bfbdccfb2.md @@ -31,32 +31,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-eye')?.transfo - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646de8d204a3426c7d184372.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646de8d204a3426c7d184372.md index c4714216a2e..48e96dec834 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646de8d204a3426c7d184372.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646de8d204a3426c7d184372.md @@ -45,32 +45,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-inner-eye')?.ba - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646dea1c98c2426d43a705c3.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646dea1c98c2426d43a705c3.md index 19cac6c2a8c..0fb5d616df3 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646dea1c98c2426d43a705c3.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646dea1c98c2426d43a705c3.md @@ -49,32 +49,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-inner-eye')?.tr - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646deb169847f86df0f95bfc.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646deb169847f86df0f95bfc.md index 4d06eeee3b6..7d563c5017d 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646deb169847f86df0f95bfc.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646deb169847f86df0f95bfc.md @@ -43,32 +43,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-inner-eye')?.b - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646dec359bef3b7811fba5a6.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646dec359bef3b7811fba5a6.md index b55702adf89..58c9821a826 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646dec359bef3b7811fba5a6.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646dec359bef3b7811fba5a6.md @@ -49,32 +49,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-inner-eye')?.t - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646dedbcba062079128b2ecc.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646dedbcba062079128b2ecc.md index 9faf8ee2e77..7c72c394be6 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646dedbcba062079128b2ecc.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646dedbcba062079128b2ecc.md @@ -31,36 +31,36 @@ assert.isTrue(document.querySelectorAll('div')[11].classList.contains('cat-nose' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
- - --fcc-editable-region-- - - --fcc-editable-region--
-
+ + --fcc-editable-region-- + + --fcc-editable-region-- +
+
``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646def5e863abf7a14501421.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646def5e863abf7a14501421.md index 4844743a3b6..eacf063dca8 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646def5e863abf7a14501421.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646def5e863abf7a14501421.md @@ -43,34 +43,34 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-nose')?.borderBottom - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
- -
-
+ +
+
+
``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646df03c8f79337ab46f148b.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646df03c8f79337ab46f148b.md index afda3636c9e..c7281b69f0a 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646df03c8f79337ab46f148b.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646df03c8f79337ab46f148b.md @@ -37,34 +37,34 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-nose')?.left, '85px' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
- -
-
+ +
+
+
``` @@ -196,5 +196,4 @@ body { border-right: 15px solid transparent; border-bottom: 20px solid #442c2c; } - ``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646df0cf26413a7b35e4b8b3.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646df0cf26413a7b35e4b8b3.md index 2c1fd6cdb5c..914ffcf3a68 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646df0cf26413a7b35e4b8b3.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646df0cf26413a7b35e4b8b3.md @@ -49,34 +49,34 @@ assert.notMatch(code, /border-top-right-radius:\s*\d+%;/); - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
- -
-
+ +
+
+
``` @@ -211,5 +211,4 @@ body { border-right: 15px solid transparent; border-bottom: 20px solid #442c2c; } - ``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646df1d1aa4ae57bdf1869c4.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646df1d1aa4ae57bdf1869c4.md index 71b14211bc7..77f9843d426 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646df1d1aa4ae57bdf1869c4.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646df1d1aa4ae57bdf1869c4.md @@ -33,38 +33,38 @@ assert.isTrue(document.querySelectorAll('div')[12].classList.contains('cat-mouth - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
- --fcc-editable-region-- - - --fcc-editable-region-- +
+
+
+
+
+
+
-
+ +
+ + --fcc-editable-region-- + + --fcc-editable-region-- +
+
``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646dffd8ce9ac77ec1906f2e.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646dffd8ce9ac77ec1906f2e.md index b0450dc0736..da849c8e47e 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646dffd8ce9ac77ec1906f2e.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646dffd8ce9ac77ec1906f2e.md @@ -43,41 +43,40 @@ assert.isTrue(document.querySelectorAll('.cat-mouth div')[1]?.classList.contains - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
- --fcc-editable-region-- -
- +
+
+
+
+
+
- --fcc-editable-region-- +
+ +
+
+--fcc-editable-region-- + +--fcc-editable-region--
-
+
+
``` @@ -213,5 +212,4 @@ body { border-right: 15px solid transparent; border-bottom: 20px solid #442c2c; } - ``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f0417322c0e04983a5149.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f0417322c0e04983a5149.md index 4a61354c883..18a607a4966 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f0417322c0e04983a5149.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f0417322c0e04983a5149.md @@ -43,40 +43,39 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-mouth-line-left')?.l - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
+
+
+
+
+ +
+
+
+
-
+
+
``` @@ -222,6 +221,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f08293804a30685533c6f.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f08293804a30685533c6f.md index 4f0cd708d95..67f9b4254b3 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f08293804a30685533c6f.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f08293804a30685533c6f.md @@ -25,40 +25,39 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-mouth-line-left')?.t - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
+
+
+
+
+ +
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f09293eb3230723a62f77.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f09293eb3230723a62f77.md index 9ba45890740..1f607610a3b 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f09293eb3230723a62f77.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f09293eb3230723a62f77.md @@ -43,40 +43,39 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-mouth-line-right')?. - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
+
+
+
+
+ +
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f0c9a1e3360092d1bbd33.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f0c9a1e3360092d1bbd33.md index 9b33caef3d3..2713d876e0b 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f0c9a1e3360092d1bbd33.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f0c9a1e3360092d1bbd33.md @@ -25,40 +25,39 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-mouth-line-right')?. - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
+
+
+
+
+ +
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f0ce5737243098ad6e494.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f0ce5737243098ad6e494.md index 017bc5e504d..199daf87350 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f0ce5737243098ad6e494.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f0ce5737243098ad6e494.md @@ -33,44 +33,43 @@ assert.isTrue(document.querySelectorAll('div')[15].classList.contains('cat-whisk - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
+
+
+
+
+ +
- --fcc-editable-region-- - - --fcc-editable-region-- - +
+
+
-
+ + --fcc-editable-region-- + + --fcc-editable-region-- +
+
``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f0ef13604420a8744f7d4.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f0ef13604420a8744f7d4.md index a16a8c049ea..2fd4179ae65 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f0ef13604420a8744f7d4.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f0ef13604420a8744f7d4.md @@ -43,46 +43,45 @@ assert.isTrue(document.querySelectorAll('.cat-whiskers div')[1].classList.contai - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- - --fcc-editable-region-- -
- +
+
- --fcc-editable-region-- +
+ +
+ +
+
+
+
+
+--fcc-editable-region-- + +--fcc-editable-region--
-
+
+
``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f0f7c5933560af8e7e380.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f0f7c5933560af8e7e380.md index cd703b4a7ad..1935c08f0d2 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f0f7c5933560af8e7e380.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f0f7c5933560af8e7e380.md @@ -50,49 +50,48 @@ assert.isTrue(document.querySelectorAll('.cat-whiskers-left div')[2].classList.c - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
- --fcc-editable-region-- -
- -
- --fcc-editable-region-- -
+
+
+
+ +
+
+
+
+
+ +
+
+--fcc-editable-region-- + +--fcc-editable-region-- +
+
-
+
+
``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f102bf87b350b593baa72.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f102bf87b350b593baa72.md index 5e73262bae1..311d64c4248 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f102bf87b350b593baa72.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f102bf87b350b593baa72.md @@ -49,53 +49,52 @@ assert.isTrue(document.querySelectorAll('.cat-whiskers-right div')[2].classList. - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
- --fcc-editable-region-- -
- -
- --fcc-editable-region-- +
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+--fcc-editable-region-- + +--fcc-editable-region-- +
-
+
+
``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f107abb89d00bb99f387a.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f107abb89d00bb99f387a.md index 5df0b0efebc..b6bb1f4f668 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f107abb89d00bb99f387a.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f107abb89d00bb99f387a.md @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whiskers-left div')? - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f12da0b4c5d0ca162834a.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f12da0b4c5d0ca162834a.md index 6e8ec290793..ca5ca5556f8 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f12da0b4c5d0ca162834a.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f12da0b4c5d0ca162834a.md @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-left-top')?. - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -261,6 +260,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f135eab69d90d0c6d4e9b.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f135eab69d90d0c6d4e9b.md index 3420ffd676e..b719a05b03d 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f135eab69d90d0c6d4e9b.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f135eab69d90d0c6d4e9b.md @@ -25,53 +25,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-left-top')?. - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -250,5 +249,4 @@ body { --fcc-editable-region-- } - ``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f159b2cffb21150b927cb.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f159b2cffb21150b927cb.md index 05c71dc6e32..d3b1efe16b5 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f159b2cffb21150b927cb.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f159b2cffb21150b927cb.md @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-left-middle' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -268,6 +267,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f164bf100dd11d226161f.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f164bf100dd11d226161f.md index 4ff24d4fa2e..760245da2ae 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f164bf100dd11d226161f.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f164bf100dd11d226161f.md @@ -25,53 +25,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-left-middle' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -254,7 +253,7 @@ body { top: 127px; left: 52px; --fcc-editable-region-- - + --fcc-editable-region-- } ``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f1764e2f1d212ba9785a7.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f1764e2f1d212ba9785a7.md index a1d16c08863..206492fa008 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f1764e2f1d212ba9785a7.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f1764e2f1d212ba9785a7.md @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-left-bottom' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -275,6 +274,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f1802a09a171332e14630.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f1802a09a171332e14630.md index 44ea44c91a0..a7e4936186c 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f1802a09a171332e14630.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f1802a09a171332e14630.md @@ -25,53 +25,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-left-bottom' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f4d6c42dc5f214f4e7444.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f4d6c42dc5f214f4e7444.md index 78d847ad2e9..c4cc0d1f426 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f4d6c42dc5f214f4e7444.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f4d6c42dc5f214f4e7444.md @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-right-top')? - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -282,6 +281,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f4e46e81f7021d5fd9c1d.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f4e46e81f7021d5fd9c1d.md index 5e511c63089..80861e5bbfc 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f4e46e81f7021d5fd9c1d.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f4e46e81f7021d5fd9c1d.md @@ -25,53 +25,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-right-top')? - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f4f6a14e3c522d130a0d2.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f4f6a14e3c522d130a0d2.md index 050151dfa8d..c122f61b040 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f4f6a14e3c522d130a0d2.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f4f6a14e3c522d130a0d2.md @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-right-middle - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -289,6 +288,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f4fe12b7985232bf475a5.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f4fe12b7985232bf475a5.md index 72fbe6ff55b..5cb829d2d89 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f4fe12b7985232bf475a5.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f4fe12b7985232bf475a5.md @@ -25,53 +25,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-right-middle - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f507e4d1cd323f17db4fc.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f507e4d1cd323f17db4fc.md index ae26a1532ce..ed8932c048d 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f507e4d1cd323f17db4fc.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f507e4d1cd323f17db4fc.md @@ -44,53 +44,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-right-bottom - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -297,6 +296,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f516dbfc1342495515625.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f516dbfc1342495515625.md index 1b4b6105600..a27e3161fdd 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f516dbfc1342495515625.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/646f516dbfc1342495515625.md @@ -27,53 +27,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-right-bottom - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -295,53 +294,53 @@ body { - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+ +
+
``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/6476f5c17f99146071ee884c.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/6476f5c17f99146071ee884c.md index 9ee99e2441c..de90f6b990a 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/6476f5c17f99146071ee884c.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/6476f5c17f99146071ee884c.md @@ -1,6 +1,6 @@ --- id: 6476f5c17f99146071ee884c -title: 步骤 8 +title: 第 8 步 challengeType: 0 dashedName: step-8 --- @@ -41,14 +41,14 @@ assert.equal(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.left, '100p - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
+
+
+
``` @@ -65,9 +65,9 @@ body { .cat-head { --fcc-editable-region-- position: static; +--fcc-editable-region-- top: 100px; left: 100px; ---fcc-editable-region-- background: linear-gradient(#5e5e5e 85%, #45454f 100%); width: 205px; height: 180px; diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/6476f7a4827bcc61682f2347.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/6476f7a4827bcc61682f2347.md index 55ac542847e..fec0e2e46d6 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/6476f7a4827bcc61682f2347.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/6476f7a4827bcc61682f2347.md @@ -1,6 +1,6 @@ --- id: 6476f7a4827bcc61682f2347 -title: 步骤 9 +title: 第 9 步 challengeType: 0 dashedName: step-9 --- @@ -9,9 +9,7 @@ dashedName: step-9 当你将 `position` 属性设置为 `absolute`时,元素就会脱离文件的正常流,它的位置由 `top`、`right`、`bottom` 和 `left` 属性决定。 -将你的 `.cat-head` 元素的 `position` 属性设置为 `absolute`,然后将 `top` 和 `left` 属性设置为任意正像素值。 - - +将你的 `.cat-head` 元素的 `position` 属性设置为 `absolute`。 # --hints-- @@ -43,14 +41,14 @@ assert.match(code, /left:\s*\d{1,4}px;/); - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
+
+
+
``` @@ -67,9 +65,9 @@ body { .cat-head { --fcc-editable-region-- position: relative; +--fcc-editable-region-- top: 100px; left: 100px; ---fcc-editable-region-- background: linear-gradient(#5e5e5e 85%, #45454f 100%); width: 205px; height: 180px; diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/6476fb7cbaafa36d65e9cf35.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/6476fb7cbaafa36d65e9cf35.md index ecd178a6952..3e0092d7eca 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/6476fb7cbaafa36d65e9cf35.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/6476fb7cbaafa36d65e9cf35.md @@ -1,6 +1,6 @@ --- id: 6476fb7cbaafa36d65e9cf35 -title: 步骤 10 +title: 第 10 步 challengeType: 0 dashedName: step-10 --- @@ -33,17 +33,17 @@ assert.equal(document.querySelectorAll('div')[1]?.getAttribute('class'), 'box'); - - fCC Cat Painting - + + fCC Cat Painting + -
-
- --fcc-editable-region-- - - --fcc-editable-region-- -
+
+
+ --fcc-editable-region-- + + --fcc-editable-region-- +
``` @@ -59,8 +59,8 @@ body { .cat-head { position: absolute; - top: 300px; - left: 400px; + top: 100px; + left: 100px; background: linear-gradient(#5e5e5e 85%, #45454f 100%); width: 205px; height: 180px; diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/6476fc5cf14b276e6d04e82a.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/6476fc5cf14b276e6d04e82a.md index 0a70c73e8b6..d08c7d0569a 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/6476fc5cf14b276e6d04e82a.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/6476fc5cf14b276e6d04e82a.md @@ -1,13 +1,13 @@ --- id: 6476fc5cf14b276e6d04e82a -title: 步骤11 +title: 第 11 步 challengeType: 0 dashedName: step-11 --- # --description-- -使用类选择器为你的 `.box` 元素指定宽度为 `200px`、高度为 `600px` 以及背景颜色为 `#000`。 此外,将其 `position` 设置为 `absolute`,`top` 为 `800px`,`left` 为 `650px`。 +使用类选择器为你的 `.box` 元素指定宽度为 `200px`、高度为 `600px` 以及背景颜色为 `#000`。 此外,将其 `position` 设置为 `absolute`,`top` 为 `800px`,`left` 为 `650px`。 # --hints-- @@ -61,15 +61,15 @@ assert.equal(new __helpers.CSSHelp(document)?.getStyle('.box')?.top, '800px'); - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
+
+
+
+
``` @@ -84,7 +84,7 @@ body { } .cat-head { - position: relative; + position: absolute; top: 100px; left: 100px; background: linear-gradient(#5e5e5e 85%, #45454f 100%); diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/6476fd4213318f6ee211028a.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/6476fd4213318f6ee211028a.md index 70aaceabc7e..0134d0a370a 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/6476fd4213318f6ee211028a.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/6476fd4213318f6ee211028a.md @@ -1,13 +1,13 @@ --- id: 6476fd4213318f6ee211028a -title: 步骤 12 +title: 第 12 步 challengeType: 0 dashedName: step-12 --- # --description-- -现在将 `.cat-head` 的 `position` 属性值替换为 `fixed`。 保留 `top` 和 `left` 不变。 +现在将你的 `.cat-head` 的 `position` 属性值替换为 `fixed`。 之后,上下滚动查看 `fixed` 值的工作原理。 @@ -39,15 +39,15 @@ assert.equal(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.left, '100p - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
+
+
+
+
``` @@ -63,10 +63,10 @@ body { .cat-head { --fcc-editable-region-- - position: relative; + position: absolute; +--fcc-editable-region-- top: 100px; left: 100px; ---fcc-editable-region-- background: linear-gradient(#5e5e5e 85%, #45454f 100%); width: 205px; height: 180px; diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/64770351e8586671ec0911f0.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/64770351e8586671ec0911f0.md index 78ca059d282..fd0eb497d03 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/64770351e8586671ec0911f0.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/64770351e8586671ec0911f0.md @@ -1,6 +1,6 @@ --- id: 64770351e8586671ec0911f0 -title: 步骤 13 +title: 第 13 步 challengeType: 0 dashedName: step-13 --- @@ -41,15 +41,15 @@ assert.notMatch(code, /left:\s*100px;?/); - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
+
+
+
+
``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/6477062778c85972eb648030.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/6477062778c85972eb648030.md index 841e4b3034f..19908756814 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/6477062778c85972eb648030.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/6477062778c85972eb648030.md @@ -7,7 +7,7 @@ dashedName: step-14 # --description-- -现在你应该将猫头居中。 +现在你应该将猫头居中。 将 `.cat-head` 元素的 `position` 属性设置为 `absolute`。 将 `right`、`left`、`top`、`bottom` 属性值设置为 `0`,然后将其 `margin` 属性的所有方向都设置为 `auto`。 这是使用 CSS 定位将元素垂直和水平居中的一种方法。 @@ -57,15 +57,15 @@ assert.equal(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.margin, 'au - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
+
+
+
+
``` @@ -82,8 +82,8 @@ body { .cat-head { --fcc-editable-region-- position: sticky; - top: 0; --fcc-editable-region-- + top: 0; background: linear-gradient(#5e5e5e 85%, #45454f 100%); width: 205px; height: 180px; @@ -92,7 +92,7 @@ body { } .box { - width: 400px; + width: 200px; height: 600px; background-color: #000; position: absolute; diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/647d821de0d97b3283c72b36.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/647d821de0d97b3283c72b36.md index 3c59c3ab231..91f9aa15752 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/647d821de0d97b3283c72b36.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/647d821de0d97b3283c72b36.md @@ -1,6 +1,6 @@ --- id: 647d821de0d97b3283c72b36 -title: 步骤 16 +title: 第 16 步 challengeType: 0 dashedName: step-16 --- @@ -14,7 +14,7 @@ dashedName: step-16 你应该删除 `.box` css 规则及其所有值。 ```js -assert.notMatch(code, /\.box\s*\{\s*width:\s*400px;\s*height:\s*600px;\s*background-color:\s*#000;\s*position:\s*absolute;\s*left:\s*650px;\s*top:\s*800px;?\s*\}\s*/) +assert.notMatch(code, /\.box\s*\{\s*width:\s*200px;\s*height:\s*600px;\s*background-color:\s*#000;\s*position:\s*absolute;\s*left:\s*650px;\s*top:\s*800px;?\s*\}\s*/) ``` # --seed-- @@ -25,14 +25,14 @@ assert.notMatch(code, /\.box\s*\{\s*width:\s*400px;\s*height:\s*600px;\s*backgro - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
+
+
+
``` @@ -62,7 +62,7 @@ body { --fcc-editable-region-- .box { - width: 400px; + width: 200px; height: 600px; background-color: #000; position: absolute; diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/647d855ac12cd436059acd39.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/647d855ac12cd436059acd39.md index fced103962b..3068b112a49 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/647d855ac12cd436059acd39.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/647d855ac12cd436059acd39.md @@ -1,6 +1,6 @@ --- id: 647d855ac12cd436059acd39 -title: 步骤2 +title: 第 2 步 challengeType: 0 dashedName: step-2 --- @@ -33,9 +33,9 @@ assert.strictEqual(new __helpers.CSSHelp(document).getStyle('*')?.boxSizing, 'bo - - fCC Cat Painting - + + fCC Cat Painting + diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/649353647c44ef4867ab4935.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/649353647c44ef4867ab4935.md index e9dacb96ef4..3864a1f84fa 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/649353647c44ef4867ab4935.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/649353647c44ef4867ab4935.md @@ -1,6 +1,6 @@ --- id: 649353647c44ef4867ab4935 -title: 步骤15 +title: 第 15 步 challengeType: 0 dashedName: step-15 --- @@ -25,17 +25,17 @@ assert.notMatch(code, /<\/div>/) - - fCC Cat Painting - + + fCC Cat Painting + -
-
- --fcc-editable-region-- -
- --fcc-editable-region-- -
+
+
+ --fcc-editable-region-- +
+ --fcc-editable-region-- +
``` @@ -64,7 +64,7 @@ body { } .box { - width: 400px; + width: 200px; height: 600px; background-color: #000; position: absolute; diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/64a2687ef267e5934a2f93e3.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/64a2687ef267e5934a2f93e3.md index aac009d40ad..86650efd09b 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/64a2687ef267e5934a2f93e3.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/64a2687ef267e5934a2f93e3.md @@ -43,39 +43,39 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-mouth div')?.border, - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
- -
- -
-
-
+
+
-
+ +
+ +
+
+
+
+
+
``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/64a26ac5540c5493f4641f10.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/64a26ac5540c5493f4641f10.md index bb872d45346..a696a24abb2 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/64a26ac5540c5493f4641f10.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/64a26ac5540c5493f4641f10.md @@ -32,39 +32,39 @@ assert.match(code, /border-radius:\s*190%\/190px\s*150px\s*0\s*0\s*;?/) - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
- -
- -
-
-
+
+
-
+ +
+ +
+
+
+
+
+
``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/64a3bcbc83e574b58c8ed048.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/64a3bcbc83e574b58c8ed048.md index 55e571ceca8..cbced2b9c3d 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/64a3bcbc83e574b58c8ed048.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/64a3bcbc83e574b58c8ed048.md @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whiskers-right div') - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/6676a8a8d9861319ee901a90.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/6676a8a8d9861319ee901a90.md index b3646f37f60..6668367ac79 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/6676a8a8d9861319ee901a90.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/6676a8a8d9861319ee901a90.md @@ -103,23 +103,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-ear')?.borderBo - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/chinese/blocks/workshop-cat-painting/6676a8b01e56ec1a1e07c202.md b/curriculum/challenges/chinese/blocks/workshop-cat-painting/6676a8b01e56ec1a1e07c202.md index e14a704ac44..a2920921aea 100644 --- a/curriculum/challenges/chinese/blocks/workshop-cat-painting/6676a8b01e56ec1a1e07c202.md +++ b/curriculum/challenges/chinese/blocks/workshop-cat-painting/6676a8b01e56ec1a1e07c202.md @@ -73,23 +73,23 @@ assert.isEmpty(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.backg - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` @@ -117,15 +117,15 @@ body { border-radius: 46%; } ---fcc-editable-region-- .cat-right-ear { +--fcc-editable-region-- height: 100px; width: 100px; background-color: white; border-left: 35px solid blue; border-right: 35px solid blue; border-top: 35px solid red; +--fcc-editable-region-- border-bottom: 35px solid red; } ---fcc-editable-region-- ``` diff --git a/curriculum/challenges/chinese/blocks/workshop-envelope-budget-app/69b2c970cb02ddaafff1c10d.md b/curriculum/challenges/chinese/blocks/workshop-envelope-budget-app/69b2c970cb02ddaafff1c10d.md index 9bdc4933639..11cf08177a4 100644 --- a/curriculum/challenges/chinese/blocks/workshop-envelope-budget-app/69b2c970cb02ddaafff1c10d.md +++ b/curriculum/challenges/chinese/blocks/workshop-envelope-budget-app/69b2c970cb02ddaafff1c10d.md @@ -62,7 +62,7 @@ assert.notMatch(code, /<\/input>/); `input` 元素应有闭合的 `>`。 ```js -assert.match(code, /HTMLString\s*=\s*`\n\s*Expense\s\$\{entryNumber\}\sName<\/label>\n\s*]*\/>/); +assert.match(code, /HTMLString\s*=\s*`\n\s*Expense\s\$\{entryNumber\}\sName<\/label>\n\s*]*>/); ``` # --seed-- diff --git a/curriculum/challenges/chinese/blocks/workshop-fcc-authors-page/69e14a2fd8ecf9210c0739ee.md b/curriculum/challenges/chinese/blocks/workshop-fcc-authors-page/69e14a2fd8ecf9210c0739ee.md index 8384cee7e79..9ff0efb6fe5 100644 --- a/curriculum/challenges/chinese/blocks/workshop-fcc-authors-page/69e14a2fd8ecf9210c0739ee.md +++ b/curriculum/challenges/chinese/blocks/workshop-fcc-authors-page/69e14a2fd8ecf9210c0739ee.md @@ -11,6 +11,12 @@ dashedName: step-26 在编辑器中指定的位置添加对 `initialFetch` 的函数调用。 +# --before-all-- + +```js +window.fetch = () => Promise.resolve({json: () => Promise.resolve([{ author: 'Whoever', image: 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==', url: "http://not-a-real-url.nowhere/", bio: 'words go here' }])}); +``` + # --hints-- 你应该调用 `initialFetch`,且不带任何参数。 diff --git a/curriculum/challenges/chinese/blocks/workshop-fortune-teller-app/68ded620ab19272a3fa97592.md b/curriculum/challenges/chinese/blocks/workshop-fortune-teller-app/68ded620ab19272a3fa97592.md index 7b6841c1856..69606cb4c1d 100644 --- a/curriculum/challenges/chinese/blocks/workshop-fortune-teller-app/68ded620ab19272a3fa97592.md +++ b/curriculum/challenges/chinese/blocks/workshop-fortune-teller-app/68ded620ab19272a3fa97592.md @@ -73,10 +73,9 @@ assert.isTrue(renderCard.hasReturnAnnotation("string")); 你的 `renderCard` 函数应该返回一个模板字面量。 ```js -assert.match( - __helpers.removeJSComments(code), - /renderCard\s*=\s*\([^)]*\)\s*:\s*string\s*=>\s*(?:\{\s*return\s*)?`/ -); +const explorer = await __helpers.Explorer(code); +const { renderCard } = explorer.allFunctions; +assert.match(__helpers.removeJSComments(renderCard.toString()), /(?:return|=>)\s*`/); ``` # --seed-- diff --git a/curriculum/challenges/chinese/blocks/workshop-fortune-teller-app/68ed4621677e86eeefa59fe6.md b/curriculum/challenges/chinese/blocks/workshop-fortune-teller-app/68ed4621677e86eeefa59fe6.md index bbf24f4dc55..a8cd7f4765b 100644 --- a/curriculum/challenges/chinese/blocks/workshop-fortune-teller-app/68ed4621677e86eeefa59fe6.md +++ b/curriculum/challenges/chinese/blocks/workshop-fortune-teller-app/68ed4621677e86eeefa59fe6.md @@ -15,8 +15,8 @@ dashedName: step-26 ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.initializeEventListeners.toString(); -assert.match(method, /initializeEventListeners\s*\(\s*\)\s*:\s*void/); +const { initializeEventListeners } = explorer.classes.Game?.methods ?? {}; +assert.isTrue(initializeEventListeners?.hasReturnAnnotation("void")); ``` # --seed-- diff --git a/curriculum/challenges/chinese/blocks/workshop-fortune-teller-app/68ee6c4b4c764b62d77df717.md b/curriculum/challenges/chinese/blocks/workshop-fortune-teller-app/68ee6c4b4c764b62d77df717.md index cdefb7a6de6..0ad04de1197 100644 --- a/curriculum/challenges/chinese/blocks/workshop-fortune-teller-app/68ee6c4b4c764b62d77df717.md +++ b/curriculum/challenges/chinese/blocks/workshop-fortune-teller-app/68ee6c4b4c764b62d77df717.md @@ -17,16 +17,30 @@ dashedName: step-31 ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.singleCardSelected.toString(); -assert.match(method, /const\s+isReversed\s*=/); +const { singleCardSelected } = explorer.classes.Game?.methods ?? {}; +const { isReversed } = singleCardSelected?.variables ?? {}; +assert.exists(isReversed); ``` 你的 `isReversed` 变量应该使用 `Math.random()` 来随机决定卡牌是否反转。 ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.singleCardSelected.toString(); -assert.match(method, /isReversed\s*=\s*Math\.random\s*\(\s*\)\s*<\s*0\.5/); +const { singleCardSelected } = explorer.classes.Game?.methods ?? {}; +const { isReversed } = singleCardSelected?.variables ?? {}; + +const validForms = [ + 'Math.random() < 0.5', + 'Math.random() > 0.5', + 'Math.random() <= 0.5', + 'Math.random() >= 0.5', + '0.5 < Math.random()', + '0.5 > Math.random()', + '0.5 <= Math.random()', + '0.5 >= Math.random()' +]; + +assert.isTrue(validForms.some((form) => isReversed?.value.matches(form))); ``` # --seed-- diff --git a/curriculum/challenges/chinese/blocks/workshop-fortune-teller-app/68ee6c8c274515694ead0024.md b/curriculum/challenges/chinese/blocks/workshop-fortune-teller-app/68ee6c8c274515694ead0024.md index d3c5d377a35..e76656507e9 100644 --- a/curriculum/challenges/chinese/blocks/workshop-fortune-teller-app/68ee6c8c274515694ead0024.md +++ b/curriculum/challenges/chinese/blocks/workshop-fortune-teller-app/68ee6c8c274515694ead0024.md @@ -7,7 +7,7 @@ dashedName: step-32 # --description-- -幸运签必须是随机的,因此需要一个辅助函数来选择随机的幸运签。在 `chosenCard` 方法内声明一个名为 `singleCardSelected` 的变量。使用 `getRandomItem` 方法获取一张随机卡片,并将 `cards` 作为参数传入。 +签文必须是随机的,因此需要一个辅助函数来选择随机签文。在 `singleCardSelected` 方法内声明一个名为 `chosenCard` 的变量。使用 `getRandomItem` 函数获取一张随机卡片,并将 `this.cards` 作为参数传入。 # --hints-- @@ -15,22 +15,18 @@ dashedName: step-32 ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.singleCardSelected.toString(); -assert.match(method, /const\s+chosenCard\s*=/); +const { singleCardSelected } = explorer.classes.Game?.methods ?? {}; +const { chosenCard } = singleCardSelected?.variables ?? {}; +assert.exists(chosenCard); ``` 你的 `chosenCard` 变量应该通过调用 `getRandomItem(this.cards)` 来赋值。 ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.singleCardSelected.toString(); -assert.match(method, /chosenCard\s*=\s*getRandomItem\s*\(\s*this\.cards\s*\)/); -``` - -你应该将 `this.cards` 作为参数传递给 `getRandomItem`。 - -```js -assert.match(__helpers.removeJSComments(code), /getRandomItem\s*\(\s*this\.cards\s*\)/); +const { singleCardSelected } = explorer.classes.Game?.methods ?? {}; +const { chosenCard } = singleCardSelected?.variables ?? {}; +assert.isTrue(chosenCard?.value.matches("getRandomItem(this.cards)")); ``` # --seed-- diff --git a/curriculum/challenges/chinese/blocks/workshop-fortune-teller-app/68f1e43a5f890b51774d93c4.md b/curriculum/challenges/chinese/blocks/workshop-fortune-teller-app/68f1e43a5f890b51774d93c4.md index 70e559a5df4..dda4ada1443 100644 --- a/curriculum/challenges/chinese/blocks/workshop-fortune-teller-app/68f1e43a5f890b51774d93c4.md +++ b/curriculum/challenges/chinese/blocks/workshop-fortune-teller-app/68f1e43a5f890b51774d93c4.md @@ -15,22 +15,28 @@ dashedName: step-43 ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /const\s+target\s*=/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { target } = showFortune?.variables ?? {}; +assert.exists(target); ``` 你的 `target` 变量应该赋值为 `e.target`。 ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /target\s*=\s*e\.target/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { target } = showFortune?.variables ?? {}; +assert.isTrue(target?.value.matches("e.target")); ``` 在你的 `if` 变量后面应该有一个空的 `target` 语句。 ```js -assert.match(__helpers.removeJSComments(code), /showFortune\s*\([^)]*\)\s*\{[\s\S]*?if\s*\(\s*\)\s*\{\s*\}/); +const explorer = await __helpers.Explorer(code); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +assert.exists(showFortune); +const method = __helpers.removeJSComments(showFortune.toString()); +assert.match(method, /target\s*=\s*e\.target[\s\S]*?if\s*\(\s*\)\s*\{\s*\}/); ``` # --seed-- diff --git a/curriculum/challenges/chinese/blocks/workshop-fortune-teller-app/68f1e6a98bc05e67cc2b85e6.md b/curriculum/challenges/chinese/blocks/workshop-fortune-teller-app/68f1e6a98bc05e67cc2b85e6.md index 6d4a8e6b5c6..53f8992aa1c 100644 --- a/curriculum/challenges/chinese/blocks/workshop-fortune-teller-app/68f1e6a98bc05e67cc2b85e6.md +++ b/curriculum/challenges/chinese/blocks/workshop-fortune-teller-app/68f1e6a98bc05e67cc2b85e6.md @@ -15,22 +15,18 @@ dashedName: step-45 ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /const\s+cardElement\s*=/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { cardElement } = showFortune?.variables ?? {}; +assert.exists(cardElement); ``` 你的 `cardElement` 应该使用 `target?.closest` 来查找 `.card_container`。 ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /cardElement\s*=\s*target\?\.closest\s*\(\s*['"]\.card_container['"]\s*\)/); -``` - -你应该将 `.card_container` 作为参数传递给 `closest`。 - -```js -assert.match(__helpers.removeJSComments(code), /\.closest\s*\(\s*['"]\.card_container['"]\s*\)/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { cardElement } = showFortune?.variables ?? {}; +assert.isTrue(cardElement?.value.matches("target?.closest('.card_container')")); ``` # --seed-- diff --git a/curriculum/challenges/chinese/blocks/workshop-fortune-teller-app/68f1e852f705eb77f6bcb893.md b/curriculum/challenges/chinese/blocks/workshop-fortune-teller-app/68f1e852f705eb77f6bcb893.md index 974c142ff8f..5cfc949589f 100644 --- a/curriculum/challenges/chinese/blocks/workshop-fortune-teller-app/68f1e852f705eb77f6bcb893.md +++ b/curriculum/challenges/chinese/blocks/workshop-fortune-teller-app/68f1e852f705eb77f6bcb893.md @@ -15,28 +15,18 @@ dashedName: step-48 ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /const\s+cardId\s*=/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { cardId } = showFortune?.variables ?? {}; +assert.exists(cardId); ``` 你的 `cardId` 变量应该通过调用 `cardElement.getAttribute("data-id")` 来赋值。 ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /cardId\s*=\s*cardElement\.getAttribute\s*\(\s*['"]data-id['"]\s*\)/); -``` - -你应该对 `getAttribute` 使用 `cardElement` 方法。 - -```js -assert.match(__helpers.removeJSComments(code), /cardElement\.getAttribute\s*\(/); -``` - -你应该将 `'data-id'` 传递给 `getAttribute`。 - -```js -assert.match(__helpers.removeJSComments(code), /\.getAttribute\s*\(\s*['"]data-id['"]\s*\)/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { cardId } = showFortune?.variables ?? {}; +assert.isTrue(cardId?.value.matches('cardElement.getAttribute("data-id")')); ``` # --seed-- diff --git a/curriculum/challenges/chinese/blocks/workshop-fortune-teller-app/68f1e8de2731b07d62e738d2.md b/curriculum/challenges/chinese/blocks/workshop-fortune-teller-app/68f1e8de2731b07d62e738d2.md index 423edef58a6..34ca1415028 100644 --- a/curriculum/challenges/chinese/blocks/workshop-fortune-teller-app/68f1e8de2731b07d62e738d2.md +++ b/curriculum/challenges/chinese/blocks/workshop-fortune-teller-app/68f1e8de2731b07d62e738d2.md @@ -15,28 +15,38 @@ dashedName: step-49 ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /const\s+foundCard\s*=/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { foundCard } = showFortune?.variables ?? {}; +assert.exists(foundCard); ``` -你的 `foundCard` 应该通过在 `find` 上调用 `this.cards` 并传入正确的回调来赋值。 +你的 `foundCard` 应该通过调用 `this.cards` 上的 `find` 来赋值,传入一个回调,该回调接受一个 `card` 参数,并返回使用严格相等性比较 `card.name_short` 和 `cardId` 的结果。 ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /foundCard\s*=\s*this\.cards\.find\s*\(/); -``` - -`find` 回调应该有一个名为 `card` 的参数。 - -```js -assert.match(__helpers.removeJSComments(code), /cards\.find\s*\(\s*\(\s*card\s*\)\s*=>/); -``` - -在回调内部,应该比较 `card.name_short` 和 `cardId`。 - -```js -assert.match(__helpers.removeJSComments(code), /card\.name_short\s*===?\s*cardId/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { foundCard } = showFortune?.variables ?? {}; + +const validForms = [ + 'this.cards.find((card) => card.name_short === cardId)', + 'this.cards.find((card) => { return card.name_short === cardId; })', + 'this.cards.find((card) => cardId === card.name_short)', + 'this.cards.find((card) => { return cardId === card.name_short; })', + 'this.cards.find(card => card.name_short === cardId)', + 'this.cards.find(card => { return card.name_short === cardId; })', + 'this.cards.find(card => cardId === card.name_short)', + 'this.cards.find(card => { return cardId === card.name_short; })', + 'this.cards.find((card: Card) => card.name_short === cardId)', + 'this.cards.find((card: Card) => { return card.name_short === cardId; })', + 'this.cards.find((card: Card) => cardId === card.name_short)', + 'this.cards.find((card: Card) => { return cardId === card.name_short; })', + 'this.cards.find(function (card) { return card.name_short === cardId; })', + 'this.cards.find(function (card) { return cardId === card.name_short; })', + 'this.cards.find(function (card: Card) { return card.name_short === cardId; })', + 'this.cards.find(function (card: Card) { return cardId === card.name_short; })' +]; + +assert.isTrue(validForms.some((form) => foundCard?.value.matches(form))); ``` # --seed-- diff --git a/curriculum/challenges/chinese/blocks/workshop-greeting-bot/66ad8ab945d266383f318cbf.md b/curriculum/challenges/chinese/blocks/workshop-greeting-bot/66ad8ab945d266383f318cbf.md index 4a1893efc19..783072ef6e2 100644 --- a/curriculum/challenges/chinese/blocks/workshop-greeting-bot/66ad8ab945d266383f318cbf.md +++ b/curriculum/challenges/chinese/blocks/workshop-greeting-bot/66ad8ab945d266383f318cbf.md @@ -30,7 +30,11 @@ assert.lengthOf(logSpy.calls, 2); 你的 `console` 语句应包含信息 `"I am excited to talk to you."`。 别忘了引号。 ```js -assert.deepInclude(logSpy.calls, ["I am excited to talk to you."]); +assert.isTrue( + logSpy.calls.some( + (call) => /I\s+am\s+excited\s+to\s+talk\s+to\s+you\s*\./.test(call[0]) + ) +); ``` # --seed-- diff --git a/curriculum/challenges/chinese/blocks/workshop-greeting-bot/66ad9c633fa26d3c1475eae3.md b/curriculum/challenges/chinese/blocks/workshop-greeting-bot/66ad9c633fa26d3c1475eae3.md index 09f2848f580..1d5b74f28af 100644 --- a/curriculum/challenges/chinese/blocks/workshop-greeting-bot/66ad9c633fa26d3c1475eae3.md +++ b/curriculum/challenges/chinese/blocks/workshop-greeting-bot/66ad9c633fa26d3c1475eae3.md @@ -28,7 +28,11 @@ assert.lengthOf(logSpy.calls, 3); 你的 `console` 语句应包含信息 `"Allow me to introduce myself."`。 别忘了引号。 ```js -assert.deepInclude(logSpy.calls, ["Allow me to introduce myself."]); +assert.isTrue( + logSpy.calls.some( + (call) => /Allow\s+me\s+to\s+introduce\s+myself\s*\./.test(call[0]) + ) +); ``` # --seed-- diff --git a/curriculum/challenges/chinese/blocks/workshop-greeting-bot/66add47d27763c4862492c8c.md b/curriculum/challenges/chinese/blocks/workshop-greeting-bot/66add47d27763c4862492c8c.md index 242f7833e53..39bdebb345f 100644 --- a/curriculum/challenges/chinese/blocks/workshop-greeting-bot/66add47d27763c4862492c8c.md +++ b/curriculum/challenges/chinese/blocks/workshop-greeting-bot/66add47d27763c4862492c8c.md @@ -76,12 +76,10 @@ console.log(favoriteSubjectSentence); ```js console.log("Hi there!"); console.log("I am excited to talk to you."); - let bot; -let botLocation; - bot = "teacherBot"; -botLocation = "the universe"; + +let botLocation = "the universe"; console.log("Allow me to introduce myself."); diff --git a/curriculum/challenges/chinese/blocks/workshop-hotel-feedback-form/66a93bbe65a26169dbf3bc39.md b/curriculum/challenges/chinese/blocks/workshop-hotel-feedback-form/66a93bbe65a26169dbf3bc39.md index 5fd2eb70f63..84fbeeba21d 100644 --- a/curriculum/challenges/chinese/blocks/workshop-hotel-feedback-form/66a93bbe65a26169dbf3bc39.md +++ b/curriculum/challenges/chinese/blocks/workshop-hotel-feedback-form/66a93bbe65a26169dbf3bc39.md @@ -13,7 +13,7 @@ dashedName: step-10 # --hints-- -你应该有一个 `label` 元素。 +你的 `fieldset` 内应该有第二个 `label` 元素。 ```js assert.lengthOf(document.querySelectorAll('fieldset label'), 2); diff --git a/curriculum/challenges/chinese/blocks/workshop-hotel-feedback-form/66a9401c9d660d6bb15993e2.md b/curriculum/challenges/chinese/blocks/workshop-hotel-feedback-form/66a9401c9d660d6bb15993e2.md index 705a26980ff..ca32e5343ea 100644 --- a/curriculum/challenges/chinese/blocks/workshop-hotel-feedback-form/66a9401c9d660d6bb15993e2.md +++ b/curriculum/challenges/chinese/blocks/workshop-hotel-feedback-form/66a9401c9d660d6bb15993e2.md @@ -1,13 +1,13 @@ --- id: 66a9401c9d660d6bb15993e2 -title: 步骤 13 +title: 第 13 步 challengeType: 0 dashedName: step-13 --- # --description-- -你的酒店反馈表应为用户添加年龄选项。 +你的酒店反馈表应为用户添加年龄选项。 首先,在表单中添加一个 `label` 元素,文本为 `Age (optional):`。 @@ -15,7 +15,7 @@ dashedName: step-13 # --hints-- -你应该有一个 `label` 元素。 +你的 `fieldset` 内应该有第三个 `label` 元素。 ```js assert.lengthOf(document.querySelectorAll('fieldset label'), 3); diff --git a/curriculum/challenges/chinese/blocks/workshop-hotel-feedback-form/66a9419e2d18476c645ce693.md b/curriculum/challenges/chinese/blocks/workshop-hotel-feedback-form/66a9419e2d18476c645ce693.md index 68f62a32328..094717970f7 100644 --- a/curriculum/challenges/chinese/blocks/workshop-hotel-feedback-form/66a9419e2d18476c645ce693.md +++ b/curriculum/challenges/chinese/blocks/workshop-hotel-feedback-form/66a9419e2d18476c645ce693.md @@ -7,7 +7,7 @@ dashedName: step-14 # --description-- -数字 `input` 用于创建数字输入框。 +数字 `input` 用于创建数字输入框。 下面是一个数字输入框的示例: @@ -17,7 +17,7 @@ dashedName: step-14 `min` 和 `max` 属性用于设置输入字段中可输入的最小值和最大值。 -在你的 `label` 元素下方,添加一个输入,`type` 属性设置为 `"number"`,`id` 为 `"age"`。 +在你的 `label` 元素下面,添加一个 `input`,其 `type` 属性设置为 `"number"`,`id` 设置为 `"age"`。 `name` 属性应设置为 `"age"`,`min` 属性应设置为 `"3"`,`max` 属性应设置为 `"100"`。 @@ -29,13 +29,13 @@ dashedName: step-14 assert.isNotNull(document.querySelector('label + input[type="number"]')); ``` -你的数字 `input` 应该有一个 `id`,值为 `age`。 +你的数字 `input` 应该有一个 `id` 为 `"age"`。 ```js assert.isNotNull(document.querySelector('label + input#age')); ``` -你的数字 `input` 应有一个 `name` 属性,设置为 `age`。 +你的数字 `input` 应该有一个 `name` 属性设置为 `"age"`。 ```js assert.isNotNull(document.querySelector('label + input[name="age"]')); diff --git a/curriculum/challenges/chinese/blocks/workshop-hotel-feedback-form/67a51d3a8a6fe123b77b0c6e.md b/curriculum/challenges/chinese/blocks/workshop-hotel-feedback-form/67a51d3a8a6fe123b77b0c6e.md index 7c11b4cf3b6..90d90c92543 100644 --- a/curriculum/challenges/chinese/blocks/workshop-hotel-feedback-form/67a51d3a8a6fe123b77b0c6e.md +++ b/curriculum/challenges/chinese/blocks/workshop-hotel-feedback-form/67a51d3a8a6fe123b77b0c6e.md @@ -7,11 +7,11 @@ dashedName: step-12 # --description-- -`input` 元素可以有一个 `size` 属性。 该属性定义了用户在输入时应显示的字符数。 `size` 的值应为大于零的非负整数。 如果未指定 `size` 或指定的值无效,输入内容将使用浏览器设置的默认宽度。 +`input` 元素可以有一个 `size` 属性。这个属性定义了用户在 `input` 中输入时应该可见的字符数。`size` 的值应该是一个正整数。如果未指定 `size`,或者指定了无效的值,`input` 将使用浏览器设置的默认宽度。 ```html - - + + ``` 为姓名和邮箱输入赋予 `size` 属性,其值为 `"20"`。 diff --git a/curriculum/challenges/chinese/blocks/workshop-plant-nursery-catalog/6734a772196245601e4b80e0.md b/curriculum/challenges/chinese/blocks/workshop-plant-nursery-catalog/6734a772196245601e4b80e0.md index b3152a0d71b..990628caa87 100644 --- a/curriculum/challenges/chinese/blocks/workshop-plant-nursery-catalog/6734a772196245601e4b80e0.md +++ b/curriculum/challenges/chinese/blocks/workshop-plant-nursery-catalog/6734a772196245601e4b80e0.md @@ -9,7 +9,7 @@ dashedName: step-10 当你需要从映射中检索一个元素时,可以使用 `get` 方法。它以一个密钥作为参数,并返回关联的值。 -使用 `get` 方法从你的目录中获取 `ballerina` 密钥的值,并将其赋值给名为 `getBallerina` 的变量。然后,将你的新变量记录到控制台日志。 +使用 `get` 方法从你的目录中获取 `ballerina` 密钥对应的值,并将其赋值给名为 `getBallerina` 的变量。然后,将你的新变量记录到控制台。 # --hints-- @@ -22,7 +22,10 @@ assert.exists(getBallerina); 你的 `getBallerina` 变量应具有 `catalog.get(ballerina)` 的值。 ```js -assert.match(__helpers.removeJSComments(code), /(const|let|var)\s+getBallerina\s*=\s*catalog\s*\.\s*get\s*\(\s*ballerina\s*\)/); +const explorer = await __helpers.Explorer(code); +const { getBallerina } = explorer.variables; +assert.isTrue(getBallerina?.value.matches('catalog.get(ballerina)') +); ``` 你应该将你的 `getBallerina` 变量记录到控制台日志。 diff --git a/curriculum/challenges/chinese/blocks/workshop-plant-nursery-catalog/6737a1a073a0d14c6544d301.md b/curriculum/challenges/chinese/blocks/workshop-plant-nursery-catalog/6737a1a073a0d14c6544d301.md index 029b2b2da35..4ff9db3a826 100644 --- a/curriculum/challenges/chinese/blocks/workshop-plant-nursery-catalog/6737a1a073a0d14c6544d301.md +++ b/curriculum/challenges/chinese/blocks/workshop-plant-nursery-catalog/6737a1a073a0d14c6544d301.md @@ -23,7 +23,9 @@ assert.exists(plantsSet); 你应该调用 `displayPlantsSet` 并将其赋值给 `plantsSet`。 ```js -assert.match(__helpers.removeJSComments(code), /(const|let|var)\s+plantsSet\s*=\s*displayPlantsSet\s*\(\s*\)/) +const explorer = await __helpers.Explorer(code); +const { plantsSet } = explorer.variables; +assert.isTrue(plantsSet?.value.matches('displayPlantsSet()')); ``` 你应该将 `plantsSet` 记录到控制台日志。 diff --git a/curriculum/challenges/chinese/blocks/workshop-reusable-mega-navbar/6740495ba48aa94e5667b436.md b/curriculum/challenges/chinese/blocks/workshop-reusable-mega-navbar/6740495ba48aa94e5667b436.md index 7941c75aa67..8219a45ce47 100644 --- a/curriculum/challenges/chinese/blocks/workshop-reusable-mega-navbar/6740495ba48aa94e5667b436.md +++ b/curriculum/challenges/chinese/blocks/workshop-reusable-mega-navbar/6740495ba48aa94e5667b436.md @@ -10,7 +10,7 @@ demoType: onLoad 在本次研讨会中,你将通过创建可复用的导航栏来练习使用 React 函数组件。 -所有的 CSS 都已为你提供,以便你专注于创建导航栏。 +所有的 CSS 都已为你准备好,这样你可以专注于创建导航栏。 首先定义一个 `Navbar` 函数组件。下一步,你将开始使用 JSX 构建该组件。 @@ -24,7 +24,7 @@ export function multiply(a, b) { } ``` -此外,React 函数组件需要以大写字母开头,因为这是区分普通超文本标记语言元素的一种方式。 +此外,React 函数组件必须以大写字母开头,因为这是 React 区分它们与普通超文本标记语言元素的方式。 # --hints-- diff --git a/curriculum/challenges/chinese/blocks/workshop-reusable-mega-navbar/67457ff2dc531fbed928a0f0.md b/curriculum/challenges/chinese/blocks/workshop-reusable-mega-navbar/67457ff2dc531fbed928a0f0.md index af786464915..493dcac07ad 100644 --- a/curriculum/challenges/chinese/blocks/workshop-reusable-mega-navbar/67457ff2dc531fbed928a0f0.md +++ b/curriculum/challenges/chinese/blocks/workshop-reusable-mega-navbar/67457ff2dc531fbed928a0f0.md @@ -24,10 +24,9 @@ const App = () => { } ``` - 在 `Navbar` 组件内,返回一个具有 `className` 为 `navbar` 的 `nav` 元素。 -这里使用 `className` 而不是 `class` 的原因是因为 `class` 是 JavaScript 中的保留关键字。所以,React 使用 `className` 作为为元素应用类的方式。 +这里使用 `className` 而不是 `class`,因为 `class` 是 JavaScript 中的保留关键字。所以,React 使用 `className` 来为元素应用类。 # --hints-- @@ -37,7 +36,7 @@ const App = () => { assert.exists(document.querySelector('nav')); ``` -你的 `nav` 元素应具有值为 `navbar` 的 `className` 属性。 +你的 `nav` 元素应该有一个 `className`,值为 `navbar`。 ```js assert.equal(document.querySelector('nav')?.getAttribute('class'), 'navbar'); diff --git a/curriculum/challenges/chinese/blocks/workshop-reusable-mega-navbar/6745c732dbeb7c04f346e6f7.md b/curriculum/challenges/chinese/blocks/workshop-reusable-mega-navbar/6745c732dbeb7c04f346e6f7.md index c98085f3bd2..2b462ee1ff9 100644 --- a/curriculum/challenges/chinese/blocks/workshop-reusable-mega-navbar/6745c732dbeb7c04f346e6f7.md +++ b/curriculum/challenges/chinese/blocks/workshop-reusable-mega-navbar/6745c732dbeb7c04f346e6f7.md @@ -7,7 +7,7 @@ dashedName: step-3 # --description-- -在 `nav` 元素内创建一个 `ul` 元素。在该 `ul` 元素内,创建三个列表项。 +在你的 `nav` 元素内创建一个 `ul` 元素。在该 `ul` 元素内,创建三个 `li` 元素。 # --hints-- diff --git a/curriculum/challenges/chinese/blocks/workshop-reusable-mega-navbar/6745c89fba004707ded84453.md b/curriculum/challenges/chinese/blocks/workshop-reusable-mega-navbar/6745c89fba004707ded84453.md index 91632550adc..05269123ac3 100644 --- a/curriculum/challenges/chinese/blocks/workshop-reusable-mega-navbar/6745c89fba004707ded84453.md +++ b/curriculum/challenges/chinese/blocks/workshop-reusable-mega-navbar/6745c89fba004707ded84453.md @@ -7,17 +7,17 @@ dashedName: step-5 # --description-- -在第一个 `li` 元素内创建一个锚点元素。为 `a` 元素添加一个值为 `#` 的 `href` 属性和文本 `Dashboard`。 +在你的第一个 `li` 元素内创建一个 `a` 元素。为它添加一个值为 `#` 的 `href` 属性,并设置文本为 `Dashboard`。 # --hints-- -你应该在第一个列表项内创建一个 `a` 元素。 +你应该在你的第一个 `li` 元素内创建一个 `a` 元素。 ```js assert.exists(document.querySelector('li a')); ``` -你的 `a` 元素应将其 `href` 属性设置为 `#`。 +你的 `a` 元素应该有一个值为 `#` 的 `href` 属性。 ```js assert.equal(document.querySelector('a')?.getAttribute('href'), '#'); diff --git a/curriculum/challenges/chinese/blocks/workshop-reusable-mega-navbar/6745cebbf97ef2129f3b9bab.md b/curriculum/challenges/chinese/blocks/workshop-reusable-mega-navbar/6745cebbf97ef2129f3b9bab.md index 0cbe76d56a5..d36aad47556 100644 --- a/curriculum/challenges/chinese/blocks/workshop-reusable-mega-navbar/6745cebbf97ef2129f3b9bab.md +++ b/curriculum/challenges/chinese/blocks/workshop-reusable-mega-navbar/6745cebbf97ef2129f3b9bab.md @@ -7,17 +7,17 @@ dashedName: step-6 # --description-- -在第二个 `li` 元素内创建另一个 `a` 元素。为它添加一个 `href` 属性,值为 `#`,并设置文本为 `Widgets`。 +在你的第二个 `li` 元素内创建另一个 `a` 元素。为它添加一个 `href` 属性,值为 `#`,并设置文本为 `Widgets`。 # --hints-- -你应该在第二个列表项内创建一个 `a` 元素。 +你应该在你的第二个 `li` 元素内创建一个 `a` 元素。 ```js assert.lengthOf(document.querySelectorAll('li a'), 2); ``` -你的 `a` 元素应将其 `href` 属性设置为 `#`。 +你的 `a` 元素应该有一个 `href` 属性,值为 `#`。 ```js assert.equal(document.querySelectorAll('a')[1]?.getAttribute('href'), '#'); diff --git a/curriculum/challenges/chinese/blocks/workshop-reusable-mega-navbar/6745d799beeb822076a4da9d.md b/curriculum/challenges/chinese/blocks/workshop-reusable-mega-navbar/6745d799beeb822076a4da9d.md index 1594342138c..efe5b1654f6 100644 --- a/curriculum/challenges/chinese/blocks/workshop-reusable-mega-navbar/6745d799beeb822076a4da9d.md +++ b/curriculum/challenges/chinese/blocks/workshop-reusable-mega-navbar/6745d799beeb822076a4da9d.md @@ -7,19 +7,19 @@ dashedName: step-7 # --description-- -在第三个列表项内,创建一个带有 `aria-expanded` 属性且属性值为 `false` 的 `button` 元素。还要将 `button` 的文本设置为 `Apps`。 +在你的第三个 `li` 元素内,创建一个带有 `aria-expanded` 属性且值为 `false` 的 `button` 元素。同时,将该 `button` 的文本设置为 `Apps`。 `aria-expanded` 属性会向屏幕阅读器用户传达该按钮触发一个可展开的子菜单。 # --hints-- -你应该在第三个列表项内创建一个 `button` 元素。 +你应该在你的第三个 `li` 元素内创建一个 `button` 元素。 ```js assert.exists(document.querySelector('li:nth-of-type(3) button')); ``` -你的 `button` 元素应具有设置为 `false` 的 `aria-expanded` 属性。 +你的 `button` 元素应具有 `aria-expanded` 属性,且值为 `false`。 ```js assert.equal( diff --git a/curriculum/challenges/chinese/blocks/workshop-reusable-mega-navbar/6745d9df333efe2543a1f457.md b/curriculum/challenges/chinese/blocks/workshop-reusable-mega-navbar/6745d9df333efe2543a1f457.md index 58fb14bc987..8cb9fddea23 100644 --- a/curriculum/challenges/chinese/blocks/workshop-reusable-mega-navbar/6745d9df333efe2543a1f457.md +++ b/curriculum/challenges/chinese/blocks/workshop-reusable-mega-navbar/6745d9df333efe2543a1f457.md @@ -7,7 +7,7 @@ dashedName: step-8 # --description-- -仍在第三个 `li` 元素内,创建一个用于弹出菜单的 `ul` 元素。为它赋予 `className` 为 `sub-menu`,并设置 `aria-label` 为 `Apps`。 +仍然在你的第三个 `li` 元素内部,为弹出菜单创建一个 `ul` 元素。给它一个 `className` 为 `sub-menu`,并设置 `aria-label` 为 `Apps`。 # --hints-- @@ -17,13 +17,13 @@ dashedName: step-8 assert.exists(document.querySelector('li ul')); ``` -你应该将你的 `ul` 元素的 `className` 属性设置为 `sub-menu`。 +你的 `ul` 元素应该有一个 `className` 为 `sub-menu`。 ```js assert.equal(document.querySelector('li ul')?.getAttribute('class'), 'sub-menu'); ``` -你应该将你的 `ul` 元素的 `aria-label` 属性设置为 `Apps`。 +你的 `ul` 元素应该有一个 `aria-label` 为 `Apps`。 ```js assert.equal(document.querySelector('li ul')?.getAttribute('aria-label'), 'Apps'); diff --git a/curriculum/challenges/chinese/blocks/workshop-reusable-mega-navbar/6745dce846995b2a466594be.md b/curriculum/challenges/chinese/blocks/workshop-reusable-mega-navbar/6745dce846995b2a466594be.md index df37d2fa8e6..658f39f3434 100644 --- a/curriculum/challenges/chinese/blocks/workshop-reusable-mega-navbar/6745dce846995b2a466594be.md +++ b/curriculum/challenges/chinese/blocks/workshop-reusable-mega-navbar/6745dce846995b2a466594be.md @@ -7,11 +7,11 @@ dashedName: step-9 # --description-- -在你的 `ul.sub-menu` 元素内创建三个新列表项。 +在你的 `ul` 元素内创建三个新的 `li` 元素,`className` 为 `sub-menu`。 # --hints-- -你应该在你的 `ul` 元素内创建三个具有 `className` 为 `sub-menu` 的新列表项。 +你应该在你的 `ul` 元素内创建三个新的 `li` 元素,`className` 为 `sub-menu`。 ```js assert.lengthOf(document.querySelectorAll('.sub-menu li'), 3); diff --git a/curriculum/challenges/chinese/blocks/workshop-reusable-mega-navbar/6745de9ce925b92d72df713a.md b/curriculum/challenges/chinese/blocks/workshop-reusable-mega-navbar/6745de9ce925b92d72df713a.md index ed03961891d..d827ecb9264 100644 --- a/curriculum/challenges/chinese/blocks/workshop-reusable-mega-navbar/6745de9ce925b92d72df713a.md +++ b/curriculum/challenges/chinese/blocks/workshop-reusable-mega-navbar/6745de9ce925b92d72df713a.md @@ -7,11 +7,11 @@ dashedName: step-10 # --description-- -在每个 `li` 元素内,创建一个锚点元素,其 `href` 属性设置为 `#`。 +在每个新的三个 `li` 元素内部,创建一个带有 `href` 属性且值为 `#` 的 `a` 元素。 # --hints-- -你应该在每个列表项内创建一个新的 `a` 元素,并将其 `href` 属性设置为 `#`。 +你应该在每个新的三个 `li` 元素内部创建一个带有 `href` 属性且值为 `#` 的新 `a` 元素。 ```js assert.equal(document.querySelectorAll('li a')[2]?.getAttribute('href'), '#'); diff --git a/curriculum/challenges/chinese/blocks/workshop-reusable-mega-navbar/6745e2aca895c935168e7d91.md b/curriculum/challenges/chinese/blocks/workshop-reusable-mega-navbar/6745e2aca895c935168e7d91.md index 2fa6fb64818..17bbeb34ce0 100644 --- a/curriculum/challenges/chinese/blocks/workshop-reusable-mega-navbar/6745e2aca895c935168e7d91.md +++ b/curriculum/challenges/chinese/blocks/workshop-reusable-mega-navbar/6745e2aca895c935168e7d91.md @@ -7,25 +7,25 @@ dashedName: step-11 # --description-- -最后,为第一个锚点标签设置文本为 `Calendar`,为第二个设置为 `Chat`,为第三个设置为 `Email`。 +最后,将第一个 `a` 元素的文本设置为 `Calendar`,第二个设置为 `Chat`,第三个设置为 `Email`。 -至此,你的 mega navbar 组件已完成! +这样,你的 `Navbar` 组件就完成了! # --hints-- -你应该为第一个锚点元素设置 `Calendar` 的文本。 +你应该将第一个 `a` 元素的文本设置为 `Calendar`。 ```js assert.equal(document.querySelectorAll('li a')[2]?.textContent, 'Calendar'); ``` -你应该为第二个锚点元素设置 `Chat` 的文本。 +你应该将第二个 `a` 元素的文本设置为 `Chat`。 ```js assert.equal(document.querySelectorAll('li a')[3]?.textContent, 'Chat'); ``` -你应该为第三个锚点元素设置 `Email` 的文本。 +你应该将第三个 `a` 元素的文本设置为 `Email`。 ```js assert.equal(document.querySelectorAll('li a')[4]?.textContent, 'Email'); diff --git a/curriculum/challenges/chinese/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165b.md b/curriculum/challenges/chinese/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165b.md index 96b78effe6e..15e910b8f93 100644 --- a/curriculum/challenges/chinese/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165b.md +++ b/curriculum/challenges/chinese/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165b.md @@ -7,7 +7,7 @@ dashedName: step-5 # --description-- -在你的返回语句中,将空字串替换为一个具有 `className` 属性且值为 `flex-container` 的 `div` 元素。 +在 `return` 语句中,将空字串替换为一个 `div` 元素,该元素的 `className` 为 `flex-container`。 # --hints-- @@ -26,7 +26,7 @@ dashedName: step-5 assert.lengthOf(testElem.children, 1); ``` -你的 `div` 应该有一个 `className` 属性为 `flex-container`。 +你的 `div` 应该有一个 `className` 为 `flex-container`。 ```js const testElem = await __helpers.prepTestComponent(window.index.App); diff --git a/curriculum/challenges/chinese/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165c.md b/curriculum/challenges/chinese/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165c.md index 7c7f3816621..9cbf7d07535 100644 --- a/curriculum/challenges/chinese/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165c.md +++ b/curriculum/challenges/chinese/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165c.md @@ -7,7 +7,7 @@ dashedName: step-6 # --description-- -现在,将 `Card` 组件放入你的 `App` 组件中。为它的 `name` 属性设置为 `"Mark"`,`title` 属性设置为 `"Front-End developer"`,`bio` 设置为 `"I like to work with different front-end technologies and play video games."` +现在,将 `Card` 组件放入你的 `App` 组件中。为它设置 `name` 属性为 `"Mark"`,`title` 属性为 `"Front-End developer"`,以及 `bio` 属性为 `"I like to work with different front-end technologies and play video games."` # --hints-- diff --git a/curriculum/challenges/chinese/blocks/workshop-reusable-profile-card-component/68720c179cd34be6793bfdf6.md b/curriculum/challenges/chinese/blocks/workshop-reusable-profile-card-component/68720c179cd34be6793bfdf6.md index dd0a71de545..f99383450f1 100644 --- a/curriculum/challenges/chinese/blocks/workshop-reusable-profile-card-component/68720c179cd34be6793bfdf6.md +++ b/curriculum/challenges/chinese/blocks/workshop-reusable-profile-card-component/68720c179cd34be6793bfdf6.md @@ -9,7 +9,7 @@ dashedName: step-8 虽然你的应用按预期工作,但你通常不会像这样手动添加多个 `Card` 组件。 -删除 `
` 元素内的三个 `` 组件。在接下来的几个步骤中,你将创建一个数据数组并使用 `map()` 函数来渲染 `Card` 组件,这是 React 中更常见的方法。 +删除 `
` 元素内的三个 `` 组件。在接下来的几个步骤中,你将创建一个数据数组,并使用 `map()` 方法来渲染 `Card` 组件,这在 React 中是更常见的做法。 # --hints-- diff --git a/curriculum/challenges/chinese/blocks/workshop-reusable-profile-card-component/68778af56eb5d980a4e2daed.md b/curriculum/challenges/chinese/blocks/workshop-reusable-profile-card-component/68778af56eb5d980a4e2daed.md index 8ccf3aad752..54b05b176a2 100644 --- a/curriculum/challenges/chinese/blocks/workshop-reusable-profile-card-component/68778af56eb5d980a4e2daed.md +++ b/curriculum/challenges/chinese/blocks/workshop-reusable-profile-card-component/68778af56eb5d980a4e2daed.md @@ -30,7 +30,7 @@ const profilesVal = eval(profiles?.value.toString()); assert.isArray(profilesVal); ``` -你的评测数组应包含一个对象,该对象包括所有必需的属性:`id`、`name`、`title` 和 `bio`。 +你的 `profiles` 数组应包含一个对象,该对象包括所有必需的属性:`id`、`name`、`title` 和 `bio`。 ```js const explorer = await __helpers.Explorer(code); diff --git a/curriculum/challenges/chinese/blocks/workshop-reusable-profile-card-component/68779156bd3704b727ba5f38.md b/curriculum/challenges/chinese/blocks/workshop-reusable-profile-card-component/68779156bd3704b727ba5f38.md index 93370b6d968..0243cd25fd3 100644 --- a/curriculum/challenges/chinese/blocks/workshop-reusable-profile-card-component/68779156bd3704b727ba5f38.md +++ b/curriculum/challenges/chinese/blocks/workshop-reusable-profile-card-component/68779156bd3704b727ba5f38.md @@ -7,7 +7,7 @@ dashedName: step-10 # --description-- -正如你从之前的课程中回忆的那样,你可以使用 `map` 方法来迭代不同的对象并动态渲染组件,如下所示: +正如你从之前的课程中回忆的那样,你可以使用 `map()` 方法迭代不同的对象,并像这样动态渲染组件: ```jsx export function App() { diff --git a/curriculum/challenges/chinese/blocks/workshop-reusable-profile-card-component/687799aefd1f2af1704065d0.md b/curriculum/challenges/chinese/blocks/workshop-reusable-profile-card-component/687799aefd1f2af1704065d0.md index 669c789580f..31e3e99ea57 100644 --- a/curriculum/challenges/chinese/blocks/workshop-reusable-profile-card-component/687799aefd1f2af1704065d0.md +++ b/curriculum/challenges/chinese/blocks/workshop-reusable-profile-card-component/687799aefd1f2af1704065d0.md @@ -23,7 +23,7 @@ dashedName: step-11
``` -`key` 属性帮助 React 识别哪些项已更改、已添加或已删除。这提高了性能,并允许更高效的更新。 +`key` 属性帮助 React 识别哪些项已更改、添加或删除。这提升了性能,并允许更高效的更新。 更新 `Card` 组件以包含值为 `profile.id` 的 `key` 属性。 diff --git a/curriculum/challenges/chinese/blocks/workshop-toggle-text-app/67cd46ec4ec904186ad52ba5.md b/curriculum/challenges/chinese/blocks/workshop-toggle-text-app/67cd46ec4ec904186ad52ba5.md index fd565d53b1f..2d3d1389082 100644 --- a/curriculum/challenges/chinese/blocks/workshop-toggle-text-app/67cd46ec4ec904186ad52ba5.md +++ b/curriculum/challenges/chinese/blocks/workshop-toggle-text-app/67cd46ec4ec904186ad52ba5.md @@ -7,7 +7,7 @@ dashedName: step-3 # --description-- -在你的 `button` 元素下方,添加一个段落元素,其中 `id` 为 `message`,文本为 `I love freeCodeCamp!`。 +在你的 `button` 元素下面,添加一个带有 `id` 为 `message` 的段落元素,文本为 `I love freeCodeCamp!`。 # --hints-- @@ -17,7 +17,7 @@ dashedName: step-3 assert.exists(document.querySelector("p")); ``` -你的段落元素应该具有 `id` 或 `message`。 +你的段落元素应该有一个名为 `message` 的 `id`。 ```js assert.exists(document.getElementById("message")) diff --git a/curriculum/challenges/chinese/blocks/workshop-toggle-text-app/67cd49e05693111a41771f29.md b/curriculum/challenges/chinese/blocks/workshop-toggle-text-app/67cd49e05693111a41771f29.md index d305809e336..1e2d3ddd098 100644 --- a/curriculum/challenges/chinese/blocks/workshop-toggle-text-app/67cd49e05693111a41771f29.md +++ b/curriculum/challenges/chinese/blocks/workshop-toggle-text-app/67cd49e05693111a41771f29.md @@ -19,7 +19,7 @@ const [user, setUser] = useState("Jessica"); 创建一个新的状态变量并设置名为 `isVisible` 和 `setIsVisible` 的函数。 记住使用示例中所示的数组解构语法。 -然后为 `useState` 钩子分配初始值 `false`。 +然后调用 `useState` 钩子,初始值为 `false`。 # --hints-- diff --git a/curriculum/challenges/chinese/blocks/workshop-toggle-text-app/67cd4fe67813f71c3479e64a.md b/curriculum/challenges/chinese/blocks/workshop-toggle-text-app/67cd4fe67813f71c3479e64a.md index b16c3bdec7d..3100738b409 100644 --- a/curriculum/challenges/chinese/blocks/workshop-toggle-text-app/67cd4fe67813f71c3479e64a.md +++ b/curriculum/challenges/chinese/blocks/workshop-toggle-text-app/67cd4fe67813f71c3479e64a.md @@ -9,7 +9,7 @@ dashedName: step-6 显示段落文本的一种方法是更改 `useState` 钩子的初始值。 -将当前 `useState` 值从 `false` 更改为 `true`,你应该会看到段落文本现在显示在屏幕上。 +将 `useState` 的初始值从 `false` 改为 `true`。正确操作后,你应该能看到段落文本现在显示在屏幕上。 # --hints-- diff --git a/curriculum/challenges/chinese/blocks/workshop-toggle-text-app/67cd525b0e575b1e5abf4c03.md b/curriculum/challenges/chinese/blocks/workshop-toggle-text-app/67cd525b0e575b1e5abf4c03.md index c5681d528c9..5318a493b22 100644 --- a/curriculum/challenges/chinese/blocks/workshop-toggle-text-app/67cd525b0e575b1e5abf4c03.md +++ b/curriculum/challenges/chinese/blocks/workshop-toggle-text-app/67cd525b0e575b1e5abf4c03.md @@ -7,7 +7,7 @@ dashedName: step-9 # --description-- -如前所述,set 函数负责更新状态。 在布尔状态值之间切换的常见方法是通过以下方式更新状态: +如前所述,set 函数负责更新状态。在切换布尔状态值时,常用的方法是以这种方式更新状态: ```js const [isUserLoggedIn, setIsUserLoggedIn] = useState(false); @@ -16,7 +16,7 @@ const [isUserLoggedIn, setIsUserLoggedIn] = useState(false); setIsUserLoggedIn(!isUserLoggedIn); ``` -下面的示例使用名为 `setIsUserLoggedIn` 的设置函数来更新用户的登录状态。 通常做法是使用逻辑 NOT (`!`) 运算符在 `true` 和 `false` 之间切换。 由于初始值是 `false`,应用 `!` 运算符会将其更改为 `true`。 +上面的例子使用名为 `setIsUserLoggedIn` 的 set 函数来更新用户的登录状态。通常使用逻辑非(`!`)操作符在 `true` 和 `false` 之间切换。由于初始值是 `false`,应用 `!` 操作符会将其变为 `true`。 在 `handleToggleVisibility` 函数内部,使用 `setIsVisible` 通过逻辑 NOT (`!`) 运算符来更新可见性状态。 diff --git a/curriculum/challenges/chinese/blocks/workshop-toggle-text-app/67cd57e96257ed1fabbe4879.md b/curriculum/challenges/chinese/blocks/workshop-toggle-text-app/67cd57e96257ed1fabbe4879.md index 5ac141d63b5..740945b48d5 100644 --- a/curriculum/challenges/chinese/blocks/workshop-toggle-text-app/67cd57e96257ed1fabbe4879.md +++ b/curriculum/challenges/chinese/blocks/workshop-toggle-text-app/67cd57e96257ed1fabbe4879.md @@ -27,7 +27,7 @@ function handleClick() { # --hints-- -当单击 `toggle-button` 时,屏幕上应出现消息 `"I love freeCodeCamp!"`。 +当点击 `toggle-button` 时,你的消息 `I love freeCodeCamp!` 应该出现在屏幕上。 ```js const abuseState = __helpers.spyOn(React, "useState"); diff --git a/curriculum/challenges/chinese/blocks/workshop-toggle-text-app/67cd59f6581d3a20c9cc6460.md b/curriculum/challenges/chinese/blocks/workshop-toggle-text-app/67cd59f6581d3a20c9cc6460.md index 571067220b6..a75b6e410fa 100644 --- a/curriculum/challenges/chinese/blocks/workshop-toggle-text-app/67cd59f6581d3a20c9cc6460.md +++ b/curriculum/challenges/chinese/blocks/workshop-toggle-text-app/67cd59f6581d3a20c9cc6460.md @@ -9,7 +9,7 @@ dashedName: step-11 现在是查看更新后的 `isVisible` 值的好时机。 -在 `setIsVisible(!isVisible);` 下方,将 `isVisible` 状态变量记录到控制台。 +在 `setIsVisible(!isVisible);` 下面,将 `isVisible` 状态变量记录到控制台。 打开控制台,你会发现该值不是你预期的值。 diff --git a/curriculum/challenges/chinese/blocks/workshop-toggle-text-app/67cd5bace629fa219a70aa6d.md b/curriculum/challenges/chinese/blocks/workshop-toggle-text-app/67cd5bace629fa219a70aa6d.md index 75b77a54a07..002a5b2e9ab 100644 --- a/curriculum/challenges/chinese/blocks/workshop-toggle-text-app/67cd5bace629fa219a70aa6d.md +++ b/curriculum/challenges/chinese/blocks/workshop-toggle-text-app/67cd5bace629fa219a70aa6d.md @@ -9,7 +9,7 @@ dashedName: step-12 如果你查看控制台,你可能会惊讶地看到 `false` 的值而不是 `true`。 发生这种情况是因为 React 没有立即更新状态。 状态只会在下一个渲染周期更新。 -对于刚接触 React 的开发人员来说,将控制台语句放在一组函数之后是一个常见的错误。 因此,在构建 React 应用程序时需要注意这一点。 +对于刚接触 React 的开发者来说,在调用设置函数后立即放置控制台语句是一个常见错误。因此,在构建你的 React 应用时需要注意这一点。 由于不再需要 `console.log()`,请将其从 `handleToggleVisibility` 函数中删除。 diff --git a/curriculum/challenges/chinese/blocks/workshop-toggle-text-app/67cd61c24bfc0a240132fd2f.md b/curriculum/challenges/chinese/blocks/workshop-toggle-text-app/67cd61c24bfc0a240132fd2f.md index f99ea50c201..0fb27a18cc3 100644 --- a/curriculum/challenges/chinese/blocks/workshop-toggle-text-app/67cd61c24bfc0a240132fd2f.md +++ b/curriculum/challenges/chinese/blocks/workshop-toggle-text-app/67cd61c24bfc0a240132fd2f.md @@ -23,14 +23,14 @@ dashedName: step-13 # --hints-- -当 `isVisible` 为 `false` 时,按钮文本应显示 `Show Message`。 +当 `isVisible` 为 `false` 时,你的按钮文本应显示为 `Show Message`。 ```js const btn = document.getElementById("toggle-button"); assert.equal(btn.textContent, "Show Message"); ``` -当 `isVisible` 为 `true` 时,按钮文本应显示 `Hide Message`。 +当 `isVisible` 为 `true` 时,你的按钮文本应显示为 `Hide Message`。 ```js const abuseState = __helpers.spyOn(React, "useState"); @@ -246,7 +246,7 @@ export const ToggleApp = () => { const handleToggleVisibility = () => { setIsVisible(!isVisible); - } + }; return (
diff --git a/curriculum/challenges/chinese/blocks/workshop-wildlife-tracker/6999ac171928136168654774.md b/curriculum/challenges/chinese/blocks/workshop-wildlife-tracker/6999ac171928136168654774.md index 2680d46d0d2..bc11774a540 100644 --- a/curriculum/challenges/chinese/blocks/workshop-wildlife-tracker/6999ac171928136168654774.md +++ b/curriculum/challenges/chinese/blocks/workshop-wildlife-tracker/6999ac171928136168654774.md @@ -42,8 +42,10 @@ assert.isFunction(getSpecies); `getSpecies` 函数应有一个参数,名为 `animal`。 ```js -const regex = __helpers.functionRegex('getSpecies', ['animal']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { getSpecies } = explorer.allFunctions; +assert.equal(getSpecies?.parameters.length, 1); +assert.equal(getSpecies?.parameters[0].toString(), 'animal'); ``` 你应该将 `getSpecies(tiger)` 记录到控制台。 diff --git a/curriculum/challenges/chinese/blocks/workshop-wildlife-tracker/6999ad1cdc249e185aaeedbd.md b/curriculum/challenges/chinese/blocks/workshop-wildlife-tracker/6999ad1cdc249e185aaeedbd.md index 22124c8836c..8404e1a39d2 100644 --- a/curriculum/challenges/chinese/blocks/workshop-wildlife-tracker/6999ad1cdc249e185aaeedbd.md +++ b/curriculum/challenges/chinese/blocks/workshop-wildlife-tracker/6999ad1cdc249e185aaeedbd.md @@ -49,8 +49,11 @@ assert.isFunction(addHabitat); `addHabitat` 函数应有两个参数:`animal` 和 `habitat`。 ```js -const regex = __helpers.functionRegex('addHabitat', ['animal', 'habitat']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { addHabitat } = explorer.allFunctions; +assert.equal(addHabitat?.parameters.length, 2); +assert.equal(addHabitat?.parameters[0].toString(), 'animal'); +assert.equal(addHabitat?.parameters[1].toString(), 'habitat'); ``` `addHabitat` 函数应返回更新后的 `animal` 对象。 diff --git a/curriculum/challenges/chinese/blocks/workshop-wildlife-tracker/6999adc72c02812a28c01e31.md b/curriculum/challenges/chinese/blocks/workshop-wildlife-tracker/6999adc72c02812a28c01e31.md index a814d4d4f5b..81c95b7c453 100644 --- a/curriculum/challenges/chinese/blocks/workshop-wildlife-tracker/6999adc72c02812a28c01e31.md +++ b/curriculum/challenges/chinese/blocks/workshop-wildlife-tracker/6999adc72c02812a28c01e31.md @@ -43,8 +43,11 @@ assert.isFunction(updateAge); `updateAge` 函数应有两个参数:`animal` 和 `newAge`。 ```js -const regex = __helpers.functionRegex('updateAge', ['animal', 'newAge']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { updateAge } = explorer.allFunctions; +assert.equal(updateAge?.parameters.length, 2); +assert.equal(updateAge?.parameters[0].toString(), 'animal'); +assert.equal(updateAge?.parameters[1].toString(), 'newAge'); ``` `updateAge` 函数应返回更新后的 `animal` 对象。 diff --git a/curriculum/challenges/chinese/blocks/workshop-wildlife-tracker/6999b0198d18d402c36cc5fe.md b/curriculum/challenges/chinese/blocks/workshop-wildlife-tracker/6999b0198d18d402c36cc5fe.md index 77cc2cc6c9b..3016a0c9599 100644 --- a/curriculum/challenges/chinese/blocks/workshop-wildlife-tracker/6999b0198d18d402c36cc5fe.md +++ b/curriculum/challenges/chinese/blocks/workshop-wildlife-tracker/6999b0198d18d402c36cc5fe.md @@ -45,8 +45,10 @@ assert.isFunction(removeEndangeredStatus); `removeEndangeredStatus` 函数应有一个参数,名为 `animal`。 ```js -const regex = __helpers.functionRegex('removeEndangeredStatus', ['animal']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { removeEndangeredStatus } = explorer.allFunctions; +assert.equal(removeEndangeredStatus?.parameters.length, 1); +assert.equal(removeEndangeredStatus?.parameters[0].toString(), 'animal'); ``` `removeEndangeredStatus` 函数应返回更新后的 `animal` 对象。 diff --git a/curriculum/challenges/chinese/blocks/workshop-wildlife-tracker/6999b07c34c2cde21ee6e1d8.md b/curriculum/challenges/chinese/blocks/workshop-wildlife-tracker/6999b07c34c2cde21ee6e1d8.md index 08634b502b0..f10e0c42ad8 100644 --- a/curriculum/challenges/chinese/blocks/workshop-wildlife-tracker/6999b07c34c2cde21ee6e1d8.md +++ b/curriculum/challenges/chinese/blocks/workshop-wildlife-tracker/6999b07c34c2cde21ee6e1d8.md @@ -49,8 +49,10 @@ assert.isFunction(hasHabitat); `hasHabitat` 函数应有一个参数,名为 `animal`。 ```js -const regex = __helpers.functionRegex('hasHabitat', ['animal']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { hasHabitat } = explorer.allFunctions; +assert.equal(hasHabitat?.parameters.length, 1); +assert.equal(hasHabitat?.parameters[0].toString(), 'animal'); ``` `hasHabitat` 应该使用 `hasOwnProperty` 方法来检查 `habitat` 属性。 diff --git a/curriculum/challenges/chinese/blocks/workshop-wildlife-tracker/6999b0d79ea938edcb032237.md b/curriculum/challenges/chinese/blocks/workshop-wildlife-tracker/6999b0d79ea938edcb032237.md index 1d0ca93f0d3..36ce53dfa74 100644 --- a/curriculum/challenges/chinese/blocks/workshop-wildlife-tracker/6999b0d79ea938edcb032237.md +++ b/curriculum/challenges/chinese/blocks/workshop-wildlife-tracker/6999b0d79ea938edcb032237.md @@ -45,8 +45,11 @@ assert.isFunction(getProperty); `getProperty` 函数应有两个参数:`animal` 和 `propertyName`。 ```js -const regex = __helpers.functionRegex('getProperty', ['animal', 'propertyName']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { getProperty } = explorer.allFunctions; +assert.equal(getProperty?.parameters.length, 2); +assert.equal(getProperty?.parameters[0].toString(), 'animal'); +assert.equal(getProperty?.parameters[1].toString(), 'propertyName'); ``` `getProperty` 应该使用方括弧表示法访问属性。 diff --git a/curriculum/challenges/chinese/blocks/workshop-wildlife-tracker/699a00de9f564bb0effaa14d.md b/curriculum/challenges/chinese/blocks/workshop-wildlife-tracker/699a00de9f564bb0effaa14d.md index 34f51a825bc..a44d85bed6a 100644 --- a/curriculum/challenges/chinese/blocks/workshop-wildlife-tracker/699a00de9f564bb0effaa14d.md +++ b/curriculum/challenges/chinese/blocks/workshop-wildlife-tracker/699a00de9f564bb0effaa14d.md @@ -44,8 +44,10 @@ assert.isFunction(getAge); `getAge` 函数应有一个参数,名为 `animal`。 ```js -const regex = __helpers.functionRegex('getAge', ['animal']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { getAge } = explorer.allFunctions; +assert.equal(getAge?.parameters.length, 1); +assert.equal(getAge?.parameters[0].toString(), 'animal'); ``` `getAge` 应该使用点符号访问 `age` 属性。 diff --git a/curriculum/challenges/espanol/blocks/back-end-development-and-apis-projects/bd7158d8c443edefaeb5bd0f.md b/curriculum/challenges/espanol/blocks/back-end-development-and-apis-projects/bd7158d8c443edefaeb5bd0f.md index 55e4aac3b7a..b3007072c56 100644 --- a/curriculum/challenges/espanol/blocks/back-end-development-and-apis-projects/bd7158d8c443edefaeb5bd0f.md +++ b/curriculum/challenges/espanol/blocks/back-end-development-and-apis-projects/bd7158d8c443edefaeb5bd0f.md @@ -50,15 +50,18 @@ El campo de entrada del archivo de formulario tiene el atributo `name` estableci Cuando envíes un archivo, recibirá el `name` del archivo, `type` y `size` en bytes dentro de la respuesta JSON. ```js - const formData = new FormData(); - const fileData = await fetch( - 'https://cdn.freecodecamp.org/weather-icons/01d.png' - ); - const file = await fileData.blob(); - formData.append('upfile', file, 'icon'); + const boundary = 'fccBoundary1234567890'; + const head = + `--${boundary}\r\n` + + 'Content-Disposition: form-data; name="upfile"; filename="icon"\r\n' + + 'Content-Type: image/png\r\n\r\n'; + const body = new Blob([head, new Uint8Array(70), `\r\n--${boundary}--\r\n`]); const data = await fetch(code + '/api/fileanalyse', { method: 'POST', - body: formData + headers: { + 'Content-Type': `multipart/form-data; boundary=${boundary}` + }, + body }); const parsed = await data.json(); assert.property(parsed, 'size'); diff --git a/curriculum/challenges/espanol/blocks/daily-coding-challenges-javascript/6a26df3e2988bcdded204895.md b/curriculum/challenges/espanol/blocks/daily-coding-challenges-javascript/6a26df3e2988bcdded204895.md index b0cf05fc524..59e6c993a96 100644 --- a/curriculum/challenges/espanol/blocks/daily-coding-challenges-javascript/6a26df3e2988bcdded204895.md +++ b/curriculum/challenges/espanol/blocks/daily-coding-challenges-javascript/6a26df3e2988bcdded204895.md @@ -25,10 +25,10 @@ assert.equal(calculateHandicap([72, 72, 72], [72, 72, 72]), 0); assert.equal(calculateHandicap([80, 76, 78, 78], [72, 72, 72, 72]), 6); ``` -`calculateHandicap([42, 45, 46, 44], [36, 36, 36, 36])` debería devolver `8.3`. +`calculateHandicap([42, 45, 46, 45], [36, 36, 36, 36])` debería devolver `8.5`. ```js -assert.equal(calculateHandicap([42, 45, 46, 44], [36, 36, 36, 36]), 8.3); +assert.equal(calculateHandicap([42, 45, 46, 45], [36, 36, 36, 36]), 8.5); ``` `calculateHandicap([85, 80, 76, 79, 82], [72, 72, 72, 71, 71])` debería devolver `8.8`. diff --git a/curriculum/challenges/espanol/blocks/daily-coding-challenges-python/6a26df3e2988bcdded204895.md b/curriculum/challenges/espanol/blocks/daily-coding-challenges-python/6a26df3e2988bcdded204895.md index 006cb12eb57..0ece468c22d 100644 --- a/curriculum/challenges/espanol/blocks/daily-coding-challenges-python/6a26df3e2988bcdded204895.md +++ b/curriculum/challenges/espanol/blocks/daily-coding-challenges-python/6a26df3e2988bcdded204895.md @@ -31,12 +31,12 @@ TestCase().assertEqual(calculate_handicap([80, 76, 78, 78], [72, 72, 72, 72]), 6 }}) ``` -`calculate_handicap([42, 45, 46, 44], [36, 36, 36, 36])` debería devolver `8.3`. +`calculate_handicap([42, 45, 46, 45], [36, 36, 36, 36])` debería devolver `8.5`. ```js ({test: () => { runPython(` from unittest import TestCase -TestCase().assertEqual(calculate_handicap([42, 45, 46, 44], [36, 36, 36, 36]), 8.3)`) +TestCase().assertEqual(calculate_handicap([42, 45, 46, 45], [36, 36, 36, 36]), 8.5)`) }}) ``` diff --git a/curriculum/challenges/espanol/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb928.md b/curriculum/challenges/espanol/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb928.md index 806907e4671..914c688e5e4 100644 --- a/curriculum/challenges/espanol/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb928.md +++ b/curriculum/challenges/espanol/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb928.md @@ -8,7 +8,7 @@ dashedName: mean-variance-standard-deviation-calculator # --description-- -Vas a trabajar en este proyecto con nuestro código inicial de Ona. +Vas a trabajar en este proyecto con nuestro código repetitivo inicial. Todavía estamos desarrollando la parte interactiva de la instrucción del plan de estudio de Python. Por ahora, aquí hay algunos videos nuestro canal de YouTube freeCodeCamp.org que te enseñará todo lo que necesitas saber para completar este proyecto: @@ -52,7 +52,8 @@ Por ejemplo, `calculate([0,1,2,3,4,5,6,7,8])` debe regresar: ## Desarrollo -Escribe tu código en `mean_var_std.py`. Para el desarrollo, puedes usar `main.py` para probar tu código. Para ejecutar tu código, escribe `python3 main.py` en la terminal de Ona y presiona enter. Esto hará que el intérprete CPython incluido ejecute el archivo `main.py`. +Escribe tu código en `mean_var_std.py`. Para el desarrollo, puedes usar `main.py` para probar tu código. +Para ejecutar tu código, escribe `python3 main.py` en la terminal y presiona enter. Esto hará que el intérprete CPython incluido ejecute el archivo `main.py`. ## Pruebas diff --git a/curriculum/challenges/espanol/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb929.md b/curriculum/challenges/espanol/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb929.md index ed6320a8fc0..29ee8740d45 100644 --- a/curriculum/challenges/espanol/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb929.md +++ b/curriculum/challenges/espanol/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb929.md @@ -8,7 +8,7 @@ dashedName: demographic-data-analyzer # --description-- -Vas a trabajar en este proyecto con nuestro código inicial de Ona. +Vas a trabajar en este proyecto con nuestro código repetitivo. Todavía estamos desarrollando la parte interactiva de la instrucción del plan de estudio de Python. Por ahora, aquí hay algunos videos nuestro canal de YouTube freeCodeCamp.org que te enseñará todo lo que necesitas saber para completar este proyecto: diff --git a/curriculum/challenges/espanol/blocks/data-analysis-with-python-projects/5e46f7f8ac417301a38fb92a.md b/curriculum/challenges/espanol/blocks/data-analysis-with-python-projects/5e46f7f8ac417301a38fb92a.md index c4af4e5d8e2..c0e1e7f1ff2 100644 --- a/curriculum/challenges/espanol/blocks/data-analysis-with-python-projects/5e46f7f8ac417301a38fb92a.md +++ b/curriculum/challenges/espanol/blocks/data-analysis-with-python-projects/5e46f7f8ac417301a38fb92a.md @@ -8,7 +8,7 @@ dashedName: medical-data-visualizer # --description-- -Vas a trabajar en este proyecto con nuestro código inicial de Ona. +Vas a trabajar en este proyecto con nuestro código inicial. Todavía estamos desarrollando la parte interactiva de la instrucción del plan de estudio de Python. Por ahora, aquí hay algunos videos nuestro canal de YouTube freeCodeCamp.org que te enseñará todo lo que necesitas saber para completar este proyecto: @@ -26,20 +26,20 @@ Las filas del conjunto de datos representan a los pacientes y las columnas repre Nombre del archivo: medical_examination.csv -| Feature | Variable Type | Variable | Value Type | -|:-------:|:------------:|:-------------:|:----------:| -| Age | Objective Feature | `age` | int (days) | -| Height | Objective Feature | `height` | int (cm) | -| Weight | Objective Feature | `weight` | float (kg) | -| Gender | Objective Feature | `gender` | categorical code | -| Systolic blood pressure | Examination Feature | `ap_hi` | int | -| Diastolic blood pressure | Examination Feature | `ap_lo` | int | -| Cholesterol | Examination Feature | `cholesterol` | 1: normal, 2: above normal, 3: well above normal | -| Glucose | Examination Feature | `gluc` | 1: normal, 2: above normal, 3: well above normal | -| Smoking | Subjective Feature | `smoke` | binary | -| Alcohol intake | Subjective Feature | `alco` | binary | -| Physical activity | Subjective Feature | `active` | binary | -| Presence or absence of cardiovascular disease | Target Variable | `cardio` | binary | +| Funcionalidad | Tipo de variable | Variable | Tipo de valor | +|:-------------:|:----------------:|:-------------:|:-------------:| +| Edad | Funcionalidad objetiva | `age` | int (días) | +| Altura | Funcionalidad objetiva | `height` | int (cm) | +| Peso | Funcionalidad objetiva | `weight` | float (kg) | +| Género | Funcionalidad objetiva | `gender` | código categórico | +| Presión arterial sistólica | Funcionalidad de examen | `ap_hi` | int | +| Presión arterial diastólica | Funcionalidad de examen | `ap_lo` | int | +| Colesterol | Funcionalidad de examen | `cholesterol` | 1: normal, 2: por encima de lo normal, 3: muy por encima de lo normal | +| Glucosa | Funcionalidad de examen | `gluc` | 1: normal, 2: por encima de lo normal, 3: muy por encima de lo normal | +| Fumar | Funcionalidad subjetiva | `smoke` | binario | +| Consumo de alcohol | Funcionalidad subjetiva | `alco` | binario | +| Actividad física | Funcionalidad subjetiva | `active` | binario | +| Presencia o ausencia de enfermedad cardiovascular | Variable objetivo | `cardio` | binario | ## Instrucciones diff --git a/curriculum/challenges/espanol/blocks/data-analysis-with-python-projects/5e46f802ac417301a38fb92b.md b/curriculum/challenges/espanol/blocks/data-analysis-with-python-projects/5e46f802ac417301a38fb92b.md index af526752194..069782d0d90 100644 --- a/curriculum/challenges/espanol/blocks/data-analysis-with-python-projects/5e46f802ac417301a38fb92b.md +++ b/curriculum/challenges/espanol/blocks/data-analysis-with-python-projects/5e46f802ac417301a38fb92b.md @@ -8,7 +8,7 @@ dashedName: page-view-time-series-visualizer # --description-- -Vas a trabajar en este proyecto con nuestro código inicial de Ona. +Vas a trabajar en este proyecto con nuestro código repetitivo. Todavía estamos desarrollando la parte interactiva de la instrucción del plan de estudio de Python. Por ahora, aquí hay algunos videos nuestro canal de YouTube freeCodeCamp.org que te enseñará todo lo que necesitas saber para completar este proyecto: diff --git a/curriculum/challenges/espanol/blocks/data-analysis-with-python-projects/5e4f5c4b570f7e3a4949899f.md b/curriculum/challenges/espanol/blocks/data-analysis-with-python-projects/5e4f5c4b570f7e3a4949899f.md index 44fac778e6d..bfec42c967c 100644 --- a/curriculum/challenges/espanol/blocks/data-analysis-with-python-projects/5e4f5c4b570f7e3a4949899f.md +++ b/curriculum/challenges/espanol/blocks/data-analysis-with-python-projects/5e4f5c4b570f7e3a4949899f.md @@ -8,7 +8,7 @@ dashedName: sea-level-predictor # --description-- -Vas a trabajar en este proyecto con nuestro código inicial de Ona. +Vas a trabajar en este proyecto con nuestro código inicial. Todavía estamos desarrollando la parte interactiva de la instrucción del plan de estudio de Python. Por ahora, aquí hay algunos videos nuestro canal de YouTube freeCodeCamp.org que te enseñará todo lo que necesitas saber para completar este proyecto: diff --git a/curriculum/challenges/espanol/blocks/information-security-projects/5e46f979ac417301a38fb932.md b/curriculum/challenges/espanol/blocks/information-security-projects/5e46f979ac417301a38fb932.md index 626aec30b3a..33977f0dafc 100644 --- a/curriculum/challenges/espanol/blocks/information-security-projects/5e46f979ac417301a38fb932.md +++ b/curriculum/challenges/espanol/blocks/information-security-projects/5e46f979ac417301a38fb932.md @@ -9,7 +9,7 @@ dashedName: port-scanner # --description-- -Vas a trabajar en este proyecto con nuestro código inicial de Ona. +Vas a trabajar en este proyecto con nuestro código repetitivo inicial. Todavía estamos desarrollando la parte interactiva de la instrucción del plan de estudio de Python. Por ahora, aquí hay algunos videos nuestro canal de YouTube freeCodeCamp.org que te enseñará todo lo que necesitas saber para completar este proyecto: diff --git a/curriculum/challenges/espanol/blocks/information-security-projects/5e46f983ac417301a38fb933.md b/curriculum/challenges/espanol/blocks/information-security-projects/5e46f983ac417301a38fb933.md index b0b96986a45..43a6072b0a4 100644 --- a/curriculum/challenges/espanol/blocks/information-security-projects/5e46f983ac417301a38fb933.md +++ b/curriculum/challenges/espanol/blocks/information-security-projects/5e46f983ac417301a38fb933.md @@ -9,7 +9,7 @@ dashedName: sha-1-password-cracker # --description-- -Vas a trabajar en este proyecto con nuestro código inicial de Ona. +Vas a trabajar en este proyecto con nuestro código repetitivo inicial. Todavía estamos desarrollando la parte interactiva de la instrucción del plan de estudio de Python. Por ahora, aquí hay algunos videos nuestro canal de YouTube freeCodeCamp.org que te enseñará todo lo que necesitas saber para completar este proyecto: diff --git a/curriculum/challenges/espanol/blocks/lab-availability-table/66b36358ed4f261d64840c24.md b/curriculum/challenges/espanol/blocks/lab-availability-table/66b36358ed4f261d64840c24.md index 65abb1889cd..8ac65f00462 100644 --- a/curriculum/challenges/espanol/blocks/lab-availability-table/66b36358ed4f261d64840c24.md +++ b/curriculum/challenges/espanol/blocks/lab-availability-table/66b36358ed4f261d64840c24.md @@ -12,16 +12,16 @@ demoType: onClick **Historias de usuario:** -1. Debes tener una tabla con al menos tres columnas y cinco filas, incluyendo los encabezados. -1. Las celdas de la primera fila deben ser encabezados de tabla que contengan los días de la semana. -1. Las celdas de la primera columna deben ser encabezados de tabla con una `class` de `time` y deben contener valores de tiempo como texto. +1. Debes tener una tabla con al menos tres columnas y cinco filas, incluidos los encabezados. +1. La primera fila debe tener celdas de encabezado de tabla que contengan los días de la semana. +1. La primera columna debe tener celdas de encabezado de tabla con una `class` de `time` que contengan valores de tiempo como texto. 1. Todas las celdas de datos deben tener la `class` de `available-#`, donde `#` es un número del `0` al `5` que especifica el número de personas disponibles en ese momento. 1. Tu tabla debe tener un elemento `caption` con el texto `Weekly Meeting Availability Schedule`. 1. Todas las celdas de encabezado de tabla en la primera fila (los días de la semana) deben tener un atributo `scope` con el valor `col`. 1. Todas las celdas de encabezado de tabla en la primera columna (las celdas de tiempo) deben tener un atributo `scope` con el valor `row`. 1. Todas las celdas de datos con una clase de disponibilidad deben tener un atributo `aria-label` que describa el nivel de disponibilidad (por ejemplo, `0 available` para las celdas `available-0`, `1 available` para las celdas `available-1`, etc., y `5+ available` para las celdas `available-5`). -1. En tu selector `:root`, debes definir seis variables CSS llamadas `--color#`, donde `#` es un número del `0` al `5`, y asignarles un valor de color. Usa estas variables para establecer el color de fondo de los elementos `.available-#` correspondientes. -1. En tu selector `:root`, debes definir variables CSS llamadas `--solid-border` y `--dashed-border`. Usa estas variables para estilizar los bordes inferiores de tus celdas de datos, alternando entre bordes sólidos y punteados según la fila. Asigna a las filas la clase `sharp` o `half` para darles estilo. +1. En tu selector `:root`, debes definir seis variables CSS llamadas `--color#`, donde `#` es un número del `0` al `5`, y asignarles un valor de color a cada una. Usa estas variables para establecer el color de fondo de los elementos `.available-#` correspondientes. +1. En tu selector `:root`, debes definir variables CSS llamadas `--solid-border` y `--dashed-border`. Usa estas variables para dar estilo a los bordes inferiores de tus celdas de datos, alternando entre bordes sólidos y punteados según la fila. Asigna a las filas la clase `sharp` o `half` para darles estilo. 1. Debes tener un elemento `div` con el `id` de `legend`. Debe contener un elemento `span` con el texto `Availability` y un elemento `div` con el `id` de `legend-gradient`. 1. Debes darle al elemento `#legend-gradient` un degradado lineal que transicione entre todos los colores desde `--color0` hasta `--color5` con líneas definidas. @@ -390,7 +390,7 @@ headers.forEach(header => { Todas las celdas de encabezado de tabla en la primera columna deben tener un atributo `scope` con el valor `row`. ```js -const timeHeaders = [...document.querySelectorAll('tr > th:first-child')]; +const timeHeaders = [...document.querySelectorAll('th.time')]; assert.isNotEmpty(timeHeaders); timeHeaders.forEach(header => { assert.equal(header.getAttribute('scope'), 'row'); diff --git a/curriculum/challenges/espanol/blocks/lab-cargo-manifest-validator/69a56b5069ca99f7317e6e19.md b/curriculum/challenges/espanol/blocks/lab-cargo-manifest-validator/69a56b5069ca99f7317e6e19.md index 2fc96812e1f..d7bf68b7c0d 100644 --- a/curriculum/challenges/espanol/blocks/lab-cargo-manifest-validator/69a56b5069ca99f7317e6e19.md +++ b/curriculum/challenges/espanol/blocks/lab-cargo-manifest-validator/69a56b5069ca99f7317e6e19.md @@ -12,9 +12,9 @@ En este laboratorio, usarás JavaScript para normalizar y validar manifiestos de Cada manifiesto de carga se representará como un objeto con las siguientes propiedades: - `containerId`: un entero positivo que identifica el contenedor de carga asociado. -- `destination`: una cadena no vacía (después de eliminar espacios en blanco) que indica el destino final de la carga. +- `destination`: una cadena no vacía (después de eliminar espacios en blanco) que indica el destino objetivo de la carga. - `weight`: un número positivo que representa el peso de la carga. -- `unit`: una cadena que describe las unidades para la propiedad de peso de la carga (ya sea `"kg"` para kilogramos o `"lb"` para libras). +- `unit`: una cadena que describe la unidad de la propiedad `weight` de la carga (ya sea `"kg"` para kilogramos o `"lb"` para libras). - `hazmat`: un valor booleano que indica si se requiere manejo de material peligroso. Ejemplo de objeto manifiesto de carga: @@ -34,13 +34,13 @@ Ejemplo de objeto manifiesto de carga: **Historias de usuario:** 1. Debes implementar una función llamada `normalizeUnits` con un parámetro `manifest`. - - La función no debe modificar el objeto manifiesto original y siempre debe devolver un nuevo objeto donde `weight` esté normalizado a kilogramos y `unit` esté establecido en `"kg"`. - - Si el peso del objeto manifiesto está expresado en libras (`unit: "lb"`), la función debe convertir el `weight` a kilogramos usando la conversión aproximada, 1 lb = 0.45 kg, y actualizar el `unit` en consecuencia. - - Si el peso ya está expresado en kilogramos (`unit: "kg"`), el `weight` y `unit` deben permanecer sin cambios. + - La función no debe modificar el objeto manifest original y siempre debe devolver un nuevo objeto donde `weight` esté normalizado a kilogramos y `unit` esté establecido en `"kg"`. + - Si el `weight` del objeto manifest está expresado en libras (`unit: "lb"`), la función debe convertir el `weight` a kilogramos usando la conversión aproximada `1 lb = 0.45 kg` y actualizar la `unit` en consecuencia. + - Si el `weight` ya está expresado en kilogramos (`unit: "kg"`), el `weight` y la `unit` deben permanecer sin cambios. 2. Debes implementar una función llamada `validateManifest` con un parámetro `manifest`. - - La función no debe modificar el objeto manifiesto original y siempre debe devolver un nuevo objeto. - - Si el manifiesto de entrada es válido (sin propiedades faltantes o inválidas), la función debe devolver un objeto vacío. - - Si el manifiesto de entrada no es válido, la función debe devolver un objeto que contenga entradas para cada propiedad faltante o inválida. Las propiedades faltantes deben tener el valor `"Missing"` y las propiedades inválidas deben tener el valor `"Invalid"`. + - La función no debe modificar el objeto manifest original y siempre debe devolver un nuevo objeto. + - Si el manifest de entrada es válido (sin propiedades faltantes o inválidas), la función debe devolver un objeto vacío. + - Si el manifest de entrada no es válido, la función debe devolver un objeto que contenga entradas para cada propiedad faltante o inválida. Las propiedades faltantes deben tener el valor `"Missing"` y las propiedades inválidas deben tener el valor `"Invalid"`. Ejemplo de valor de retorno donde el objeto de entrada carece de la propiedad `destination` y tiene una propiedad `weight` inválida: @@ -52,11 +52,12 @@ Ejemplo de valor de retorno donde el objeto de entrada carece de la propiedad `d ``` 3. Debes implementar una función llamada `processManifest` con un parámetro `manifest`. La función debe registrar: - - Si el objeto manifiesto es válido, `Validation success: ${containerId}` y luego el peso del manifiesto en kilogramos así, `Total weight: ${weight} kg`. Usa `normalizeUnits()` para esta conversión. - - Si el objeto manifiesto no es válido, `Validation error: ${containerId}` y luego el objeto devuelto al llamar a `validateManifest()` con el objeto manifiesto. - **Nota:** cada uno de estos dos casos debe tener dos llamadas a `console.log()`. + - Si el objeto manifest es válido, `Validation success: ${containerId}` y luego el `weight` del manifest en kilogramos, en la forma `Total weight: ${weight} kg`. Usa `normalizeUnits()` para esta conversión. + - Si el objeto manifest no es válido, `Validation error: ${containerId}` y luego el objeto devuelto al llamar a `validateManifest()` con el objeto manifest. -**Nota:** Ni `normalizeUnits`, ni `validateManifest`, ni `processManifest` deben declararse usando `const`, ya que las pruebas necesitan reasignarlos. +**Nota:** Cada uno de estos dos casos debe tener dos llamadas a `console.log()`. + +**Nota:** No declares `normalizeUnits`, `validateManifest` ni `processManifest` usando `const`, ya que las pruebas necesitan reasignarlas. # --before-each-- @@ -120,7 +121,7 @@ console.log = () => {}; # --hints-- -Ni `normalizeUnits`, ni `validateManifest`, ni `processManifest` deben declararse usando `const`, ya que las pruebas necesitan reasignarlos. +No debes declarar `normalizeUnits`, `validateManifest` ni `processManifest` usando `const`, ya que las pruebas necesitan reasignarlas. ```js assert.doesNotThrow(() => { @@ -140,12 +141,12 @@ assert.equal(params.length, 1); assert.equal(params[0].toString(), 'manifest'); ``` -Llamar a `normalizeUnits()` con `{ containerId: 68, destination: "Salinas", weight: 101, unit: "lb", hazmat: true }` debe devolver el nuevo objeto `{ containerId: 68, destination: "Salinas", weight: 45.45, unit: "kg", hazmat: true }` sin modificar la entrada original. +Tu función `normalizeUnits` debe devolver el nuevo objeto `{ containerId: 68, destination: "Salinas", weight: 45.45, unit: "kg", hazmat: true }` cuando se llame con `{ containerId: 68, destination: "Salinas", weight: 101, unit: "lb", hazmat: true }`, sin modificar el original. ```js const testObj = { containerId: 68, - destination: "Salinas", + destination: "Salinas", weight: 101, unit: "lb", hazmat: true @@ -161,7 +162,7 @@ const expected = { const copy = normalizeUnits(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "normalizeUnits() did not return the expected normalized object"); +assert.deepEqual(copy, expected, "normalizeUnits() did not return the expected normalized object."); assert.notStrictEqual(copy, testObj, "normalizeUnits() should return a new object."); assert.strictEqual(testObj.containerId, 68, "Original object should not be mutated."); assert.strictEqual(testObj.destination, "Salinas", "Original object should not be mutated."); @@ -171,13 +172,13 @@ assert.strictEqual(testObj.hazmat, true, "Original object should not be mutated. assert.equal(Object.keys(testObj).length, 5, "Original object should not be mutated."); ``` -Tu función `normalizeUnits` debe devolver una copia del objeto manifiesto de entrada con su `weight` normalizado a kilogramos y su `unit` establecido en `"kg"`. Usa la conversión aproximada `1 lb = 0.45 kg` para la conversión de peso. +Tu función `normalizeUnits` debe devolver una copia del objeto manifest de entrada con su `weight` normalizado a kilogramos y su `unit` establecida en `"kg"`. Usa la conversión aproximada `1 lb = 0.45 kg` para la conversión del `weight`. ```js _validManifests.forEach((obj, i) => { const result = normalizeUnits(obj); - assert.isObject(result, "normalizeUnits should return an object"); - assert.notStrictEqual(result, obj, "normalizeUnits must return a new object, not modify the original"); + assert.isObject(result, "normalizeUnits() should return an object."); + assert.notStrictEqual(result, obj, "normalizeUnits() should return a new object, not mutate the original."); const expectedWeight = obj.unit === "lb" ? obj.weight * 0.45 : obj.weight; const expected = { ...obj, @@ -188,12 +189,12 @@ _validManifests.forEach((obj, i) => { assert.deepEqual( result, expected, - `normalizeUnits did not return the expected normalized object for manifest at index ${i}` + `normalizeUnits() did not return the expected normalized object for manifest at index ${i}.` ); }); ``` -Tu función `normalizeUnits` debe devolver una nueva copia del objeto `manifest` de entrada sin modificar el original. +Tu función `normalizeUnits` debe devolver una nueva copia del objeto manifest de entrada sin modificar el original. ```js const original = { @@ -231,12 +232,12 @@ assert.equal(params.length, 1); assert.equal(params[0].toString(), 'manifest'); ``` -Llamar a `validateManifest()` con `{ containerId: 1, destination: "Santa Cruz", weight: 304, unit: "kg", hazmat: false }` debe devolver el nuevo objeto `{}`. +Tu función `validateManifest` debe devolver un nuevo objeto vacío `{}` cuando se llame con `{ containerId: 1, destination: "Santa Cruz", weight: 304, unit: "kg", hazmat: false }`. ```js const testObj = { containerId: 1, - destination: "Santa Cruz", + destination: "Santa Cruz", weight: 304, unit: "kg", hazmat: false @@ -246,16 +247,16 @@ const expected = {}; const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for a valid manifest"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.strictEqual(testObj.containerId, 1, "Original object should not be mutated"); -assert.strictEqual(testObj.destination, "Santa Cruz", "Original object should not be mutated"); -assert.strictEqual(testObj.weight, 304, "Original object should not be mutated"); -assert.strictEqual(testObj.unit, "kg", "Original object should not be mutated"); -assert.strictEqual(testObj.hazmat, false, "Original object should not be mutated"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for a valid manifest."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.strictEqual(testObj.containerId, 1, "Original object should not be mutated."); +assert.strictEqual(testObj.destination, "Santa Cruz", "Original object should not be mutated."); +assert.strictEqual(testObj.weight, 304, "Original object should not be mutated."); +assert.strictEqual(testObj.unit, "kg", "Original object should not be mutated."); +assert.strictEqual(testObj.hazmat, false, "Original object should not be mutated."); ``` -Si el objeto manifiesto de entrada es válido, tu función `validateManifest` debe devolver un objeto vacío `{}`. +Tu función `validateManifest` debe devolver un objeto vacío `{}` si el objeto manifest de entrada es válido. ```js const solution = {}; @@ -268,7 +269,7 @@ for (const obj of _validManifests) { } ``` -Llamar a `validateManifest()` con `{}` debe devolver el nuevo objeto `{ containerId: "Missing", destination: "Missing", weight: "Missing", unit: "Missing", hazmat: "Missing" }` sin modificar la entrada original. +Tu función `validateManifest` debe devolver el nuevo objeto `{ containerId: "Missing", destination: "Missing", weight: "Missing", unit: "Missing", hazmat: "Missing" }` cuando se llame con `{}`, sin modificar el original. ```js const testObj = {}; @@ -283,12 +284,12 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for missing properties"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.equal(Object.keys(testObj).length, 0, "validateManifest() should return a new object, not mutate the original"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for missing properties."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.equal(Object.keys(testObj).length, 0, "validateManifest() should return a new object, not mutate the original."); ``` -Llamar a `validateManifest()` con `{ containerId: null, destination: "Santa Cruz", weight: 304, unit: "kg", hazmat: false }` debe devolver el nuevo objeto `{ containerId: "Invalid" }` sin modificar la entrada original. +Tu función `validateManifest` debe devolver el nuevo objeto `{ containerId: "Invalid" }` cuando se llame con `{ containerId: null, destination: "Santa Cruz", weight: 304, unit: "kg", hazmat: false }`, sin modificar el original. ```js const testObj = { @@ -305,11 +306,11 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for null containerId"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for null containerId."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); ``` -Llamar a `validateManifest()` con `{ containerId: 0, destination: 405, weight: -84, unit: "pounds", hazmat: "no" }` debe devolver el nuevo objeto `{ containerId: "Invalid", destination: "Invalid", weight: "Invalid", unit: "Invalid", hazmat: "Invalid" }` sin modificar la entrada original. +Tu función `validateManifest` debe devolver el nuevo objeto `{ containerId: "Invalid", destination: "Invalid", weight: "Invalid", unit: "Invalid", hazmat: "Invalid" }` cuando se llame con `{ containerId: 0, destination: 405, weight: -84, unit: "pounds", hazmat: "no" }`, sin modificar el original. ```js const testObj = { @@ -330,16 +331,16 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid properties"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.strictEqual(testObj.containerId, 0, "Original object should not be mutated"); -assert.strictEqual(testObj.destination, 405, "Original object should not be mutated"); -assert.strictEqual(testObj.weight, -84, "Original object should not be mutated"); -assert.strictEqual(testObj.unit, "pounds", "Original object should not be mutated"); -assert.strictEqual(testObj.hazmat, "no", "Original object should not be mutated"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid properties."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.strictEqual(testObj.containerId, 0, "Original object should not be mutated."); +assert.strictEqual(testObj.destination, 405, "Original object should not be mutated."); +assert.strictEqual(testObj.weight, -84, "Original object should not be mutated."); +assert.strictEqual(testObj.unit, "pounds", "Original object should not be mutated."); +assert.strictEqual(testObj.hazmat, "no", "Original object should not be mutated."); ``` -Llamar a `validateManifest()` con `{ containerId: -2 }` debe devolver el nuevo objeto `{ containerId: "Invalid", destination: "Missing", weight: "Missing", unit: "Missing", hazmat: "Missing" }` sin modificar la entrada original. +Tu función `validateManifest` debe devolver el nuevo objeto `{ containerId: "Invalid", destination: "Missing", weight: "Missing", unit: "Missing", hazmat: "Missing" }` cuando se llame con `{ containerId: -2 }`, sin modificar el original. ```js const testObj = { @@ -356,13 +357,13 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.strictEqual(testObj.containerId, -2, "Original object should not be mutated"); -assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.strictEqual(testObj.containerId, -2, "Original object should not be mutated."); +assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated."); ``` -Llamar a `validateManifest()` con `{ containerId: 3.50 }` debe devolver el nuevo objeto `{ containerId: "Invalid", destination: "Missing", weight: "Missing", unit: "Missing", hazmat: "Missing" }` sin modificar la entrada original. Puedes usar `Number.isInteger()` para validar valores enteros. +Tu función `validateManifest` debe devolver el nuevo objeto `{ containerId: "Invalid", destination: "Missing", weight: "Missing", unit: "Missing", hazmat: "Missing" }` cuando se llame con `{ containerId: 3.50 }`, sin modificar el original. Puedes usar `Number.isInteger()` para validar valores enteros. ```js const testObj = { @@ -379,13 +380,13 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.strictEqual(testObj.containerId, 3.50, "Original object should not be mutated"); -assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.strictEqual(testObj.containerId, 3.50, "Original object should not be mutated."); +assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated."); ``` -Llamar a `validateManifest()` con `{ destination: " " }` debe devolver el nuevo objeto `{ containerId: "Missing", destination: "Invalid", weight: "Missing", unit: "Missing", hazmat: "Missing" }` sin modificar la entrada original. Puedes usar `String.trim()` para eliminar espacios en blanco de una cadena. +Tu función `validateManifest` debe devolver el nuevo objeto `{ containerId: "Missing", destination: "Invalid", weight: "Missing", unit: "Missing", hazmat: "Missing" }` cuando se llame con `{ destination: " " }`, sin modificar el original. Puedes usar `.trim()` para eliminar espacios en blanco de una cadena. ```js const testObj = { @@ -402,13 +403,13 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.strictEqual(testObj.destination, " ", "Original object should not be mutated"); -assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.strictEqual(testObj.destination, " ", "Original object should not be mutated."); +assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated."); ``` -Llamar a `validateManifest()` con `{ weight: NaN }` debe devolver el nuevo objeto `{ containerId: "Missing", destination: "Missing", weight: "Invalid", unit: "Missing", hazmat: "Missing" }` sin modificar la entrada original. Puedes usar `Number.isNaN()` para validar valores NaN. +Tu función `validateManifest` debe devolver el nuevo objeto `{ containerId: "Missing", destination: "Missing", weight: "Invalid", unit: "Missing", hazmat: "Missing" }` cuando se llame con `{ weight: NaN }`, sin modificar el original. Puedes usar `Number.isNaN()` para validar valores `NaN`. ```js const testObj = { @@ -425,13 +426,13 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.ok(Number.isNaN(testObj.weight), "Original object should not be mutated"); -assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.ok(Number.isNaN(testObj.weight), "Original object should not be mutated."); +assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated."); ``` -Si el objeto manifiesto de entrada no es válido, tu función `validateManifest` debe devolver un objeto que describa las propiedades faltantes y/o inválidas. +Tu función `validateManifest` debe devolver un objeto que describa las propiedades faltantes y/o inválidas si el objeto manifest de entrada no es válido. ```js const solutions = [ @@ -504,7 +505,7 @@ assert.equal(params.length, 1); assert.equal(params[0].toString(), 'manifest'); ``` -Llamar a `processManifest()` con `{ containerId: 55, destination: "Carmel", weight: 400, unit: "lb", hazmat: false }` debe primero registrar `"Validation success: 55"` y luego registrar `"Total weight: 180 kg"`. +Tu función `processManifest` debe primero registrar `Validation success: 55` y luego registrar `Total weight: 180 kg` cuando se llame con `{ containerId: 55, destination: "Carmel", weight: 400, unit: "lb", hazmat: false }`. ```js const testObj = { @@ -524,8 +525,8 @@ try { ["Validation success: 55"], ["Total weight: 180 kg"] ]; - assert.deepEqual(spy.calls[0], expectedCalls[0], "First log should be the validation success message"); - assert.deepEqual(spy.calls[1], expectedCalls[1], "Second log should be the normalized weight in kg"); + assert.deepEqual(spy.calls[0], expectedCalls[0], "First log should be the validation success message."); + assert.deepEqual(spy.calls[1], expectedCalls[1], "Second log should be the normalized weight in kg."); } catch (err) { assert.fail(err); @@ -534,7 +535,7 @@ try { } ``` -Si el objeto manifiesto de entrada es válido, tu función `processManifest` debe primero registrar el mensaje de éxito, `Validation success: ${containerId}`. +Tu función `processManifest` debe primero registrar el mensaje de éxito, `Validation success: ${containerId}`, si el objeto manifest de entrada es válido. ```js const testObj = { @@ -562,7 +563,7 @@ try { } ``` -Si el objeto manifiesto de entrada es válido, tu función `processManifest` debe normalizarlo a kilogramos usando `normalizeUnits()` y luego registrar: `Total weight: ${weight} kg`. +Tu función `processManifest` debe normalizar un objeto manifest de entrada válido a kilogramos usando `normalizeUnits()` y luego registrar `Total weight: ${weight} kg`. ```js const testObj = { @@ -590,7 +591,7 @@ try { } ``` -Si el objeto manifiesto de entrada es válido, tu función `processManifest` debe registrar un mensaje de éxito con el `containerId` del objeto, y luego registrar el `weight` del objeto en kilogramos. Debes usar `normalizeUnits()` para la conversión y hacer dos llamadas a `console.log()`. +Tu función `processManifest` debe registrar un mensaje de éxito con el `containerId` del objeto y luego registrar el `weight` del objeto en kilogramos, si el objeto manifest de entrada es válido. Debes usar `normalizeUnits()` para la conversión, y esto debe implicar dos llamadas a `console.log()`. ```js const originalNormalize = normalizeUnits; @@ -605,7 +606,7 @@ try { assert.isTrue( called, - "processManifest should call normalizeUnits() when the manifest is valid" + "processManifest() should call normalizeUnits() when the manifest is valid." ); } catch (err) { @@ -635,7 +636,7 @@ try { } ``` -Llamar a `processManifest()` con `{ containerId: -88, destination: "Soledad", weight: NaN }` debe primero registrar `Validation error: -88` y luego registrar el objeto `{ containerId: "Invalid", weight: "Invalid", unit: "Missing", hazmat: "Missing" }`. +Tu función `processManifest` debe primero registrar `Validation error: -88` y luego registrar el objeto `{ containerId: "Invalid", weight: "Invalid", unit: "Missing", hazmat: "Missing" }` cuando se llame con `{ containerId: -88, destination: "Soledad", weight: NaN }`. ```js const testObj = { @@ -658,8 +659,8 @@ try { }] ]; - assert.deepEqual(spy.calls[0], expectedCalls[0], "First log should be the validation error message"); - assert.deepEqual(spy.calls[1], expectedCalls[1], "Second log should be the validation result object"); + assert.deepEqual(spy.calls[0], expectedCalls[0], "First log should be the validation error message."); + assert.deepEqual(spy.calls[1], expectedCalls[1], "Second log should be the validation result object."); } catch (err) { assert.fail(err); @@ -668,7 +669,7 @@ try { } ``` -Llamar a `processManifest()` con `{ destination: "Watsonville", hazmat: true }` debe primero registrar `Validation error: undefined` y luego registrar el objeto `{ containerId: "Missing", weight: "Missing", unit: "Missing" }`. +Tu función `processManifest` debe primero registrar `Validation error: undefined` y luego registrar el objeto `{ containerId: "Missing", weight: "Missing", unit: "Missing" }` cuando se llame con `{ destination: "Watsonville", hazmat: true }`. ```js const testObj = { @@ -689,8 +690,8 @@ try { }] ]; - assert.deepEqual(spy.calls[0], expectedCalls[0], "First log should be the validation error message"); - assert.deepEqual(spy.calls[1], expectedCalls[1], "Second log should be the validation result object"); + assert.deepEqual(spy.calls[0], expectedCalls[0], "First log should be the validation error message."); + assert.deepEqual(spy.calls[1], expectedCalls[1], "Second log should be the validation result object."); } catch (err) { assert.fail(err); @@ -699,7 +700,7 @@ try { } ``` -Si el objeto manifiesto de entrada no es válido, tu función `processManifest` debe primero registrar el mensaje de error, `Validation error: ${containerId}`. +Tu función `processManifest` debe primero registrar el mensaje de error, `Validation error: ${containerId}`, si el objeto manifest de entrada no es válido. ```js const spy = __helpers.spyOn(console, "log"); @@ -718,13 +719,13 @@ try { assert.deepEqual(spy.calls[0], expectedCalls[0]); } catch (err) { - assert.fail(err); + assert.fail(err); } finally { spy.restore(); } ``` -Si el objeto manifiesto de entrada no es válido, tu función `processManifest` también debe registrar el objeto devuelto al llamar a `validateManifest()` con el objeto manifiesto original. Llama directamente a `console.log()` con el objeto devuelto. +Tu función `processManifest` también debe registrar el objeto devuelto al llamar a `validateManifest()` con el objeto manifest original si el objeto manifest de entrada no es válido. Llama a `console.log()` directamente con el objeto devuelto. ```js const originalValidate = validateManifest; @@ -740,7 +741,7 @@ try { assert.isTrue( called, - "processManifest should call validateManifest() when the manifest is invalid" + "processManifest() should call validateManifest() when the manifest is invalid." ); } catch (err) { @@ -765,13 +766,13 @@ try { assert.deepEqual(spy.calls[1], expectedCalls[1]); } catch (err) { - assert.fail(err); + assert.fail(err); } finally { spy.restore(); } ``` -Si el objeto manifiesto de entrada no es válido, tu función `processManifest` debe registrar un mensaje de error con el `containerId` del objeto, y luego registrar el objeto devuelto al llamar a `validateManifest()` con el objeto de entrada. Esto debe involucrar dos llamadas a `console.log()`. +Tu función `processManifest` debe registrar un mensaje de error con el `containerId` del objeto y luego registrar el objeto devuelto al llamar a `validateManifest()` con el objeto de entrada, si el objeto manifest de entrada no es válido. Esto debe implicar dos llamadas a `console.log()`. ```js const originalValidate = validateManifest; @@ -787,7 +788,7 @@ try { assert.isTrue( called, - "processManifest should call validateManifest() when the manifest is invalid" + "processManifest() should call validateManifest() when the manifest is invalid." ); } catch (err) { @@ -812,7 +813,7 @@ try { assert.deepEqual(spy.calls, expectedCalls); } catch (err) { - assert.fail(err); + assert.fail(err); } finally { spy.restore(); } diff --git a/curriculum/challenges/espanol/blocks/lab-digital-pet-game/68c362b379059c388d3874f2.md b/curriculum/challenges/espanol/blocks/lab-digital-pet-game/68c362b379059c388d3874f2.md index d5d0b41f9f7..4e637a40ff1 100644 --- a/curriculum/challenges/espanol/blocks/lab-digital-pet-game/68c362b379059c388d3874f2.md +++ b/curriculum/challenges/espanol/blocks/lab-digital-pet-game/68c362b379059c388d3874f2.md @@ -9,7 +9,7 @@ saveSubmissionToDB: true # --description-- -**Objetivo:** Cumple las historias de usuario a continuación y haz que todas las pruebas pasen para completar el laboratorio. +**Objetivo:** Cumplir con las historias de usuario a continuación y pasar todas las pruebas para completar el laboratorio. **Historias de usuario:** @@ -60,6 +60,7 @@ La segunda vista: ```js globalThis._PET_NAME = 'Fitzgerald'; globalThis._clock = __FakeTimers.install(); +window.fetch = () => Promise.resolve({ json: () => Promise.resolve('Cats sleep for around 13 to 16 hours a day.') }); ``` # --after-all-- diff --git a/curriculum/challenges/espanol/blocks/lab-fcc-forum-leaderboard/673c91f0b934834bc4a3ecc2.md b/curriculum/challenges/espanol/blocks/lab-fcc-forum-leaderboard/673c91f0b934834bc4a3ecc2.md index 4646ed1345f..e79e3080e6a 100644 --- a/curriculum/challenges/espanol/blocks/lab-fcc-forum-leaderboard/673c91f0b934834bc4a3ecc2.md +++ b/curriculum/challenges/espanol/blocks/lab-fcc-forum-leaderboard/673c91f0b934834bc4a3ecc2.md @@ -50,7 +50,7 @@ El endpoint de la API devuelve JSON con la siguiente estructura: Ten en cuenta que los valores `avatar_template` son rutas relativas: comienzan con `/` y contienen un marcador `{size}` que debe reemplazarse con un tamaño en píxeles. La constante `avatarUrl` contiene la URL base que se debe anteponer cuando la ruta es relativa. -**Objetivo:** Cumple las historias de usuario a continuación y haz que todas las pruebas pasen para completar el laboratorio. +**Objetivo:** Cumplir con las historias de usuario a continuación y pasar todas las pruebas para completar el laboratorio. **Historias de usuario:** @@ -93,6 +93,68 @@ Ten en cuenta que los valores `avatar_template` son rutas relativas: comienzan c 1. La función `fetchData` debe solicitar datos desde `forumLatest` y llamar a `showLatestPosts` pasando la respuesta parseada como JSON. 1. Si hay un error al obtener los datos, la función `fetchData` debe registrar el error en la consola. Debes usar específicamente `console.log` para esto. +# --before-all-- + +```js +const _testUsers = [ + { + avatar_template: '/user_avatar/QuincyLarson_{size}.png', + id: 6, + name: 'Quincy Larson', + username: 'QuincyLarson' + }, + { + avatar_template: '/user_avatar/jwilkins.oboe_{size}.png', + id: 285941, + name: 'Jessica Wilkins', + username: 'jwilkins.oboe' + }, + { + avatar_template: '/user_avatar/ilenia_{size}.png', + id: 170865, + name: 'Ilenia', + username: 'ilenia' + } +]; + +const _testPosters = [ + { user_id: 6 }, + { user_id: 285941 }, + { user_id: 170865 } +]; + +const _testData = { + users: _testUsers, + topic_list: { + topics: [ + { + bumped_at: '2024-04-15T16:01:26.403Z', + category_id: 1, + id: 684569, + posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], + posts_count: 8, + slug: 'the-freecodecamp-podcast-is-back-now-with-video', + title: 'The freeCodeCamp Podcast is back – now with video', + views: 542 + }, + { + bumped_at: '2024-04-19T13:52:03.523Z', + category_id: 421, + id: 686149, + posters: [{ user_id: 170865 }], + posts_count: 1, + slug: 'problem-with-making-changes-to-styles-js', + title: 'Problem with making changes to styles. (JS)', + views: 9 + } + ] + } +}; + +window.fetch = () => + Promise.resolve({ json: () => Promise.resolve(_testData) }); +``` + # --hints-- Debes tener una función llamada `timeAgo` que tome un solo argumento. @@ -297,31 +359,8 @@ assert.lengthOf(avatars, 2); La función `avatars` debe devolver una cadena formada al unir `img` elementos, uno por cada poster encontrado en el arreglo de usuarios. ```js -const posters = [{ user_id: 6 }, { user_id: 285941 }, { user_id: 170865 }]; -const users = [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - }, - { id: 20 } -]; +const posters = _testPosters; +const users = [..._testUsers, { id: 20 }]; const actual = avatars(posters, users); const matches = actual.match(/<\s*img\s+.+?>/g); assert.lengthOf(matches, 3); @@ -330,31 +369,8 @@ assert.lengthOf(matches, 3); Cada elemento `img` en la cadena devuelta por la función `avatars` debe tener un texto `alt` con el valor de la propiedad `name` del poster. ```js -const posters = [{ user_id: 6 }, { user_id: 285941 }, { user_id: 170865 }]; -const users = [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - }, - { id: 20 } -]; +const posters = _testPosters; +const users = [..._testUsers, { id: 20 }]; const actual = avatars(posters, users); const matches = actual.match(/<\s*img\s+.+?>/g); @@ -366,31 +382,8 @@ assert.match(matches[2], /alt=('|")Ilenia\1/); La función `avatars` debe establecer el tamaño de cada avatar accediendo a la propiedad `avatar_template` y reemplazando `{size}` con `30`. ```js -const posters = [{ user_id: 6 }, { user_id: 285941 }, { user_id: 170865 }]; -const users = [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - }, - { id: 20 } -]; +const posters = _testPosters; +const users = [..._testUsers, { id: 20 }]; const actual = avatars(posters, users); assert.notMatch(actual, /\{size\}/); assert.lengthOf(actual.match(/_30/g), 3); @@ -399,31 +392,8 @@ assert.lengthOf(actual.match(/_30/g), 3); Cada elemento `img` debe tener un atributo `src` establecido al `avatar_template` del usuario correspondiente. Si `avatar_template` comienza con `/`, antepone `avatarUrl` directamente a él. ```js -const posters = [{ user_id: 6 }, { user_id: 285941 }, { user_id: 170865 }]; -const users = [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - }, - { id: 20 } -]; +const posters = _testPosters; +const users = [..._testUsers, { id: 20 }]; const actual = avatars(posters, users); const matches = actual.match(/<\s*img\s+.+?>/g); @@ -458,19 +428,15 @@ assert.isFunction(fetchData); Tu función `fetchData` debe solicitar datos desde `https://cdn.freecodecamp.org/curriculum/forum-latest/latest.json`. ```js -const testArr = []; -const temp = fetch; +const spy = __helpers.spyOn(window, 'fetch'); try { - fetch = source => { - testArr.push(source); - return temp(source); - }; fetchData(); - assert.deepEqual(testArr, [ + assert.include( + spy.calls.map(call => call[0]), 'https://cdn.freecodecamp.org/curriculum/forum-latest/latest.json' - ]); + ); } finally { - fetch = temp; + spy.restore(); } ``` @@ -521,55 +487,7 @@ async () => { `showLatestPosts` debe establecer el HTML interno de `#posts-container` a una cadena formada al unir `tr` elementos, uno por cada ítem en `topics`. ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const pContainer = document.getElementById('posts-container'); pContainer.innerHTML = ''; showLatestPosts(data); @@ -579,55 +497,7 @@ assert.lengthOf(pContainer.querySelectorAll('tr'), 2); Cada elemento `tr` de la cadena devuelta por `showLatestPosts` debe contener 5 elementos `td`. ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const pContainer = document.getElementById('posts-container'); pContainer.innerHTML = ''; showLatestPosts(data); @@ -638,55 +508,7 @@ assert.lengthOf(pContainer.querySelectorAll('tr:last-child>td'), 5); El primer elemento `td` de cada fila de tabla de la cadena devuelta por `showLatestPosts` debe contener dos elementos ancla, el primero con la clase `post-title`, un `href` de `/`, un texto ancla `` y el segundo obtenido llamando a `forumCategory` con `category_id`. ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const pContainer = document.getElementById('posts-container'); pContainer.innerHTML = ''; showLatestPosts(data); @@ -731,55 +553,7 @@ assert.equal( El segundo elemento `td` de cada fila de tabla de la cadena devuelta por `showLatestPosts` debe contener las imágenes devueltas por la función `avatars` llamada con `posters` y `users` como argumentos, anidadas dentro de un elemento `div` con la clase `avatar-container`. ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const pContainer = document.getElementById('posts-container'); pContainer.innerHTML = ''; showLatestPosts(data); @@ -820,55 +594,7 @@ assert.equal(imgs2[0].alt, 'Ilenia'); El tercer elemento `td` de cada fila de tabla de la cadena devuelta por `showLatestPosts` debe contener el número de respuestas a la publicación. _Pista:_ usa `posts_count - 1`. ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const pContainer = document.getElementById('posts-container'); pContainer.innerHTML = ''; showLatestPosts(data); @@ -887,55 +613,7 @@ assert.equal( El cuarto elemento `td` de cada fila de tabla de la cadena devuelta por `showLatestPosts` debe contener el número de vistas de la publicación. ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const pContainer = document.getElementById('posts-container'); pContainer.innerHTML = ''; showLatestPosts(data); @@ -954,55 +632,7 @@ assert.equal( El quinto elemento `td` de cada fila de tabla de la cadena devuelta por `showLatestPosts` debe contener el tiempo transcurrido desde la última actividad, generado usando la función `timeAgo`. ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const calcTime = time => { const currentTime = new Date(); const lastPost = new Date(time); diff --git a/curriculum/challenges/espanol/blocks/lab-javascript-trivia-bot/66ed41f912d0bb1dc62da5dd.md b/curriculum/challenges/espanol/blocks/lab-javascript-trivia-bot/66ed41f912d0bb1dc62da5dd.md index 301c6cf30d9..21e4f43a802 100644 --- a/curriculum/challenges/espanol/blocks/lab-javascript-trivia-bot/66ed41f912d0bb1dc62da5dd.md +++ b/curriculum/challenges/espanol/blocks/lab-javascript-trivia-bot/66ed41f912d0bb1dc62da5dd.md @@ -11,17 +11,17 @@ dashedName: lab-javascript-trivia-bot **Historias de usuario:** -1. Debería registrar `"Hello! I'm your coding fun fact guide!"` en la consola como un mensaje de saludo para el usuario. -1. Deberías crear tres variables: `botName`, `botLocation` y `favoriteLanguage`, que almacenan el nombre del bot, de dónde es y su lenguaje de programación favorito, respectivamente. -1. Debes registrar `"My name is (botName) and I live on (botLocation)."` en la consola. -1. Debes registrar `"My favorite programming language is (favoriteLanguage)."` en la consola. -1. Debes usar `let` para crear una variable `codingFact` y asignarle una cadena que sea un dato curioso sobre el lenguaje de programación favorito de tu bot e incluir el uso de la variable `favoriteLanguage`. -1. Deberías registrar `codingFact` en la consola. -1. Deberías reasignar la variable `codingFact` a un nuevo dato sobre el lenguaje favorito del bot usando nuevamente la variable `favoriteLanguage`. -1. Deberías registrar `codingFact` en la consola nuevamente. -1. Deberías reasignar la variable `codingFact` nuevamente a otro nuevo dato sobre el lenguaje favorito del bot usando la variable `favoriteLanguage`. -1. Deberías registrar `codingFact` en la consola por tercera vez. -1. Debes registrar `"It was fun sharing these facts with you. Goodbye! - (botName) from (botLocation)."` en la consola como una declaración de despedida del bot. +1. Debes registrar en la consola `"Hello! I'm your coding fun fact guide!"` como un mensaje de saludo para el usuario. +1. Debes crear tres variables: `botName`, `botLocation` y `favoriteLanguage`, que almacenan el nombre del bot, de dónde es y su lenguaje de programación favorito, respectivamente. +1. Debes registrar en la consola `"My name is (botName) and I live on (botLocation)."`. +1. Debes registrar en la consola `"My favorite programming language is (favoriteLanguage)."`. +1. Debes usar `let` para crear una variable `codingFact` y asignarle una cadena que sea un dato curioso sobre el lenguaje de programación favorito del bot, usando la variable `favoriteLanguage`. +1. Debes registrar la variable `codingFact` en la consola. +1. Debes reasignar la variable `codingFact` a un nuevo dato curioso sobre el lenguaje de programación favorito del bot usando nuevamente la variable `favoriteLanguage`. +1. Debes registrar la variable `codingFact` en la consola otra vez. +1. Debes reasignar la variable `codingFact` a un tercer dato curioso sobre el lenguaje de programación favorito del bot usando nuevamente la variable `favoriteLanguage`. +1. Debes registrar la variable `codingFact` en la consola por tercera vez. +1. Debes registrar en la consola `"It was fun sharing these facts with you. Goodbye! - (botName) from (botLocation)."` como una despedida del bot. # --before-each-- @@ -162,7 +162,7 @@ let codingFact = "Did you know that " + favoriteLanguage + " was created in just console.log(codingFact); -codingFact = "Another fun fact: " + favoriteLanguage + "was originally called Mocha!"; +codingFact = "Another fun fact: " + favoriteLanguage + " was originally called Mocha!"; console.log(codingFact); diff --git a/curriculum/challenges/espanol/blocks/lab-mood-board/673b3d6b7ef7318eef926d5a.md b/curriculum/challenges/espanol/blocks/lab-mood-board/673b3d6b7ef7318eef926d5a.md index a1ababac91d..0bc64891fae 100644 --- a/curriculum/challenges/espanol/blocks/lab-mood-board/673b3d6b7ef7318eef926d5a.md +++ b/curriculum/challenges/espanol/blocks/lab-mood-board/673b3d6b7ef7318eef926d5a.md @@ -16,16 +16,16 @@ En este laboratorio, crearás un tablero de inspiración utilizando componentes **Historias de usuario:** -1. Deberías crear y exportar un componente `MoodBoardItem` que acepte tres props: `color`, `image` y `description`. -2. Tu componente `MoodBoardItem` debería devolver un `div` con la clase `mood-board-item` como su elemento de nivel superior. -3. Deberías establecer el color de fondo del elemento `.mood-board-item` al valor del prop `color` usando estilos en línea. -4. Deberías renderizar un elemento `img`, con una clase `mood-board-image` y su atributo `src` establecido en el valor del prop `image`, dentro del elemento `.mood-board-item`. -5. Deberías renderizar un elemento `h3`, con una clase `mood-board-text` y su texto el valor del prop `description`, dentro del elemento `.mood-board-item`. -6. Deberías crear y exportar un `MoodBoard`. -7. Tu componente `MoodBoard` debería devolver un `div` como su elemento de nivel superior. -8. Tu componente `MoodBoard` debería renderizar un elemento `h1` con una clase `mood-board-heading` y el texto `Destination Mood Board`. -9. Tu componente `MoodBoard` debería renderizar un `div` con una clase `mood-board`. -10. Tu componente `MoodBoard` debería renderizar al menos tres componentes `MoodBoardItem` dentro del elemento `.mood-board`, cada uno debería pasar props `color`, `image` y `description` con valores válidos. +1. Debes crear y exportar un componente `MoodBoardItem` que acepte tres props: `color`, `image` y `description`. +2. Tu componente `MoodBoardItem` debe devolver un `div` con una clase `mood-board-item` como su elemento principal. +3. Debes establecer el color de fondo del elemento `.mood-board-item` al valor de la prop `color` usando estilos en línea. +4. Debes renderizar un elemento `img`, con una clase `mood-board-image` y su atributo `src` establecido al valor de la prop `image`, dentro del elemento `.mood-board-item`. +5. Debes renderizar un elemento `h3`, con una clase `mood-board-text` y su texto establecido al valor de la prop `description`, dentro del elemento `.mood-board-item`. +6. Debes crear y exportar un componente `MoodBoard`. +7. Tu componente `MoodBoard` debe devolver un `div` como su elemento principal. +8. Tu componente `MoodBoard` debe renderizar un elemento `h1` con una clase `mood-board-heading` y el texto `Destination Mood Board`. +9. Tu componente `MoodBoard` debe renderizar un `div` con una clase `mood-board`. +10. Tu componente `MoodBoard` debe renderizar al menos tres componentes `MoodBoardItem` dentro del elemento `.mood-board`, cada uno de los cuales debe pasar las props `color`, `image` y `description` con valores válidos. Puedes usar las siguientes imágenes en tu Tablero de Inspiración si lo deseas: @@ -41,10 +41,10 @@ Puedes usar las siguientes imágenes en tu Tablero de Inspiración si lo deseas: Deberías exportar un componente `MoodBoardItem`. ```js -assert.isFunction(window.index.MoodBoardItem, 1); +assert.isFunction(window.index.MoodBoardItem); ``` -Tu componente `MoodBoardItem` debería devolver un `div` con la clase `mood-board-item` como su elemento de nivel superior. +Tu componente `MoodBoardItem` debe devolver un `div` con una clase `mood-board-item` como su elemento principal. ```js const item = document.getElementsByClassName('mood-board-item')[0]; @@ -52,7 +52,7 @@ assert.exists(item); assert.equal(item.tagName, 'DIV'); ``` -El color de fondo del elemento `.mood-board-item` debería establecerse al valor del prop `color` usando estilos en línea. +El color de fondo del elemento `.mood-board-item` debe establecerse al valor de la prop `color` usando estilos en línea. ```js const container = await __helpers.prepTestComponent(window.index.MoodBoardItem, { color: "red" }); @@ -83,7 +83,7 @@ Tu componente `MoodBoardItem` debería renderizar un elemento `h3` con una clase Deberías exportar un componente `MoodBoard`. ```js -assert.isFunction(window.index.MoodBoard, 1); +assert.isFunction(window.index.MoodBoard); ``` Tu componente `MoodBoard` debería devolver un `div` como su elemento de nivel superior. @@ -102,7 +102,15 @@ assert.equal(heading.tagName, 'H1'); assert.equal(heading.textContent, 'Destination Mood Board'); ``` -Tu componente `MoodBoard` debería renderizar al menos tres componentes `MoodBoardItem`, cada uno debería pasar props `color`, `image` y `description` con valores válidos. +Tu componente `MoodBoard` debe renderizar un `div` con una clase `mood-board`. + +```js +const moodboard = document.getElementsByClassName('mood-board')[0]; +assert.exists(moodboard); +assert.equal(moodboard.tagName, 'DIV'); +``` + +Tu componente `MoodBoard` debe renderizar al menos tres componentes `MoodBoardItem` dentro del elemento `.mood-board`, cada uno de los cuales debe pasar las props `color`, `image` y `description` con valores válidos. ```js const moodboard = document.getElementsByClassName('mood-board')[0]; diff --git a/curriculum/challenges/espanol/blocks/lab-motorcycle-shop/694175528a794a090ea0ba74.md b/curriculum/challenges/espanol/blocks/lab-motorcycle-shop/694175528a794a090ea0ba74.md index 4bdadee9e6c..62f6f2e6fe5 100644 --- a/curriculum/challenges/espanol/blocks/lab-motorcycle-shop/694175528a794a090ea0ba74.md +++ b/curriculum/challenges/espanol/blocks/lab-motorcycle-shop/694175528a794a090ea0ba74.md @@ -35,6 +35,291 @@ Para este laboratorio, se te ha proporcionado todo el HTML y CSS. Vas a usar Typ 7. El número de elementos `Motorcycle` que se muestran debe listarse dentro de un elemento con id `results-number`. 8. El filtro debe actualizarse en un evento `input`. +# --before-all-- + +```js +const _testMotorcycles = [ + { + id: '1', + name: 'Ninja H2', + manufacturer: 'Kawasaki', + category: 'Sport', + price: 29000, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-vmoto-stash.jpg', + description: 'Supercharged hypersport with unmatched power', + year: 2024, + created_at: '2024-01-01T00:00:00Z' + }, + { + id: '2', + name: 'Street Triple RS', + manufacturer: 'Triumph', + category: 'Naked', + price: 13500, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-r3.png', + description: 'Agile naked bike with triple-cylinder perfection', + year: 2024, + created_at: '2024-01-02T00:00:00Z' + }, + { + id: '3', + name: 'R1250 GS Adventure', + manufacturer: 'BMW', + category: 'Adventure', + price: 21995, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-vmoto-stash.jpg', + description: 'The ultimate adventure touring machine', + year: 2024, + created_at: '2024-01-03T00:00:00Z' + }, + { + id: '4', + name: 'Panigale V4', + manufacturer: 'Ducati', + category: 'Sport', + price: 28395, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-kawasaki-zx10r.png', + description: 'Italian superbike engineering at its finest', + year: 2024, + created_at: '2024-01-04T00:00:00Z' + }, + { + id: '5', + name: 'Road Glide Special', + manufacturer: 'Harley-Davidson', + category: 'Cruiser', + price: 29999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-vmax.jpg', + description: 'Classic American touring with modern tech', + year: 2024, + created_at: '2024-01-05T00:00:00Z' + }, + { + id: '6', + name: 'MT-09', + manufacturer: 'Yamaha', + category: 'Naked', + price: 9999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-mt7.jpg', + description: 'Lightweight naked bike with crossplane power', + year: 2024, + created_at: '2024-01-06T00:00:00Z' + }, + { + id: '7', + name: 'Africa Twin', + manufacturer: 'Honda', + category: 'Adventure', + price: 14599, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-honda-africa.jpg', + description: 'Legendary adventure bike reborn for modern times', + year: 2024, + created_at: '2024-01-07T00:00:00Z' + }, + { + id: '8', + name: 'Super Duke R', + manufacturer: 'KTM', + category: 'Naked', + price: 18999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-suzuki-sv650.jpg', + description: 'The Beast returns with 180hp of raw power', + year: 2024, + created_at: '2024-01-08T00:00:00Z' + }, + { + id: '9', + name: 'GSX-R1000R', + manufacturer: 'Suzuki', + category: 'Sport', + price: 17199, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-suzuki-gsxr1000.jpg', + description: 'Track-ready sportbike with championship DNA', + year: 2024, + created_at: '2024-01-09T00:00:00Z' + }, + { + id: '10', + name: 'Street Glide', + manufacturer: 'Harley-Davidson', + category: 'Cruiser', + price: 21999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-vmax.jpg', + description: 'Milwaukee-Eight power in a sleek bagger', + year: 2024, + created_at: '2024-01-10T00:00:00Z' + }, + { + id: '11', + name: 'Z H2', + manufacturer: 'Kawasaki', + category: 'Naked', + price: 17000, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-kawasaki-zh2.jpg', + description: 'Supercharged naked bike mayhem', + year: 2024, + created_at: '2024-01-11T00:00:00Z' + }, + { + id: '12', + name: 'Multistrada V4', + manufacturer: 'Ducati', + category: 'Adventure', + price: 22995, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-mt3.jpg', + description: 'Italian style meets adventure capability', + year: 2024, + created_at: '2024-01-12T00:00:00Z' + }, + { + id: '13', + name: 'Speed Triple 1200', + manufacturer: 'Triumph', + category: 'Naked', + price: 16500, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-honda-transalp.jpg', + description: 'British muscle bike with cutting-edge tech', + year: 2024, + created_at: '2024-01-13T00:00:00Z' + }, + { + id: '14', + name: 'S1000RR', + manufacturer: 'BMW', + category: 'Sport', + price: 17295, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-kawasaki-z900a1.jpg', + description: 'German precision in a superbike package', + year: 2024, + created_at: '2024-01-14T00:00:00Z' + }, + { + id: '15', + name: 'MT-07', + manufacturer: 'Yamaha', + category: 'Naked', + price: 7999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-mt7.jpg', + description: 'Best-selling parallel twin for pure fun', + year: 2024, + created_at: '2024-01-15T00:00:00Z' + }, + { + id: '16', + name: 'V-Strom 1050', + manufacturer: 'Suzuki', + category: 'Adventure', + price: 13799, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-benelli-trk702.png', + description: 'Reliable adventure touring on a budget', + year: 2024, + created_at: '2024-01-16T00:00:00Z' + }, + { + id: '17', + name: 'Sportster S', + manufacturer: 'Harley-Davidson', + category: 'Cruiser', + price: 15999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-r3.png', + description: 'Revolution Max engine in a modern cruiser', + year: 2024, + created_at: '2024-01-17T00:00:00Z' + }, + { + id: '18', + name: 'CBR1000RR-R', + manufacturer: 'Honda', + category: 'Sport', + price: 28500, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-honda-cbr500.png', + description: 'Honda racing technology for the street', + year: 2024, + created_at: '2024-01-18T00:00:00Z' + }, + { + id: '19', + name: 'Tiger 900', + manufacturer: 'Triumph', + category: 'Adventure', + price: 14400, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-triumph-tiger900.png', + description: 'Middleweight adventure excellence', + year: 2024, + created_at: '2024-01-19T00:00:00Z' + }, + { + id: '20', + name: '890 Duke R', + manufacturer: 'KTM', + category: 'Naked', + price: 11999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-kawasaki-zx10r.png', + description: 'The Scalpel - precise handling perfection', + year: 2024, + created_at: '2024-01-20T00:00:00Z' + }, + { + id: '21', + name: 'Ninja 400', + manufacturer: 'Kawasaki', + category: 'Sport', + price: 5299, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-vmoto-stash.jpg', + description: 'Perfect entry-level sportbike', + year: 2024, + created_at: '2024-01-21T00:00:00Z' + }, + { + id: '22', + name: 'Scrambler 1200', + manufacturer: 'Triumph', + category: 'Adventure', + price: 13250, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-ducati-scrambler.jpg', + description: 'Modern classic with off-road capability', + year: 2024, + created_at: '2024-01-22T00:00:00Z' + }, + { + id: '23', + name: 'Monster Plus', + manufacturer: 'Ducati', + category: 'Naked', + price: 14295, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-kawasaki-zx10r.png', + description: 'Evolved Monster with V-twin soul', + year: 2024, + created_at: '2024-01-23T00:00:00Z' + }, + { + id: '24', + name: 'CB650R', + manufacturer: 'Honda', + category: 'Naked', + price: 9199, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-kawasaki-z900.png', + description: 'Neo Sports Café styling with inline-four power', + year: 2024, + created_at: '2024-01-24T00:00:00Z' + }, + { + id: '25', + name: 'Low Rider S', + manufacturer: 'Harley-Davidson', + category: 'Cruiser', + price: 17999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-suzuki-vstorm650.jpg', + description: 'Blacked-out cruiser with attitude', + year: 2024, + created_at: '2024-01-25T00:00:00Z' + } +]; + +window.fetch = () => + Promise.resolve({ json: () => Promise.resolve(_testMotorcycles) }); +``` + # --hints-- Debes tener un `type` llamado `Category`. @@ -84,16 +369,24 @@ Debes usar el endpoint `https://cdn.freecodecamp.org/curriculum/labs/data/motorc ```js const spy = __helpers.spyOn(window, 'fetch'); -const motorcycles = await fetchMotorcycles(); -assert.strictEqual(spy.calls[0][0].trim(),"https://cdn.freecodecamp.org/curriculum/labs/data/motorcycles.json"); +try { + await fetchMotorcycles(); + assert.strictEqual(spy.calls[0][0].trim(),"https://cdn.freecodecamp.org/curriculum/labs/data/motorcycles.json"); +} finally { + spy.restore(); +} ``` Debes retornar una promesa de 25 objetos `Motorcycle` desde `fetchMotorcycles`. ```js const spy = __helpers.spyOn(window, 'fetch'); -const motorcycles = await fetchMotorcycles(); -assert.lengthOf(motorcycles,25); +try { + const motorcycles = await fetchMotorcycles(); + assert.lengthOf(motorcycles,25); +} finally { + spy.restore(); +} ``` Debes tener una función llamada `renderMotorcycleCard`. diff --git a/curriculum/challenges/espanol/blocks/lab-nth-fibonacci-number-js/7a97b79c096ecb000d03bd36.md b/curriculum/challenges/espanol/blocks/lab-nth-fibonacci-number-js/7a97b79c096ecb000d03bd36.md index e56673cd97f..f91176ec0ef 100644 --- a/curriculum/challenges/espanol/blocks/lab-nth-fibonacci-number-js/7a97b79c096ecb000d03bd36.md +++ b/curriculum/challenges/espanol/blocks/lab-nth-fibonacci-number-js/7a97b79c096ecb000d03bd36.md @@ -1,15 +1,15 @@ --- id: 7a97b79c096ecb000d03bd36 -title: Construir un calculador del enésimo número de Fibonacci +title: Construye una calculadora del n-ésimo número de Fibonacci challengeType: 26 dashedName: build-an-nth-fibonacci-number-calculator --- # --description-- -**Objetivo:** Cumple las historias de usuario a continuación y haz que todas las pruebas pasen para completar el laboratorio. +**Objetivo:** Cumplir con las historias de usuario a continuación y pasar todas las pruebas para completar el laboratorio. -**User Stories:** +**Historias de usuario:** 1. Debes crear una función llamada `fibonacci`. 2. Debes definir un arreglo llamado `sequence` dentro de la función `fibonacci`, y debe inicializarse con los valores `[0, 1]`. @@ -22,59 +22,64 @@ dashedName: build-an-nth-fibonacci-number-calculator Debes tener una función llamada `fibonacci`. ```js -assert.isFunction(fibonacci); +const explorer = await __helpers.Explorer(code); +assert.exists(explorer.allFunctions.fibonacci); ``` Tu función `fibonacci` debe tomar un solo parámetro. ```js -const params = __helpers.getFunctionParams(fibonacci.toString()); -assert.equal(params.length, 1); +const explorer = await __helpers.Explorer(code); +const { fibonacci } = explorer.allFunctions; +assert.equal(fibonacci?.parameters.length, 1); ``` Debes tener un arreglo llamado `sequence` dentro de la función `fibonacci` inicializado a `[0, 1]`. ```js -assert.match(__helpers.removeJSComments(fibonacci.toString()), /(const|let|var)\s+sequence\s*=\s*\[\s*0\s*,\s*1\s*\]/); +const explorer = await __helpers.Explorer(code); +const { fibonacci } = explorer.allFunctions; +const { sequence } = fibonacci?.variables ?? {}; +assert.isTrue(sequence?.value.matches('[0, 1]')); ``` -`fibonacci(0)` should return `0`. +`fibonacci(0)` debería devolver `0`. ```js assert.equal(fibonacci(0), 0); ``` -`fibonacci(1)` should return `1`. +`fibonacci(1)` debería devolver `1`. ```js assert.equal(fibonacci(1), 1); ``` -`fibonacci(2)` should return `1`. +`fibonacci(2)` debería devolver `1`. ```js assert.equal(fibonacci(2), 1); ``` -`fibonacci(3)` should return `2`. +`fibonacci(3)` debería devolver `2`. ```js assert.equal(fibonacci(3), 2); ``` -`fibonacci(5)` should return `5`. +`fibonacci(5)` debería devolver `5`. ```js assert.equal(fibonacci(5), 5); ``` -`fibonacci(10)` should return `55`. +`fibonacci(10)` debería devolver `55`. ```js assert.equal(fibonacci(10), 55); ``` -`fibonacci(15)` should return `610`. +`fibonacci(15)` debería devolver `610`. ```js assert.equal(fibonacci(15), 610); diff --git a/curriculum/challenges/espanol/blocks/lab-product-showcase/696920c0c98a1ed58eb86293.md b/curriculum/challenges/espanol/blocks/lab-product-showcase/696920c0c98a1ed58eb86293.md index a044fe64c09..3de6bdc1aa4 100644 --- a/curriculum/challenges/espanol/blocks/lab-product-showcase/696920c0c98a1ed58eb86293.md +++ b/curriculum/challenges/espanol/blocks/lab-product-showcase/696920c0c98a1ed58eb86293.md @@ -421,6 +421,10 @@ Al hacer clic en el botón `#all` se deben mostrar todos los productos en el ele ```js const len = products.items.length; +const books = document.getElementById("books"); +const all = document.getElementById("all"); +const output = document.getElementById("output"); + assert.isAtLeast(len, 3); books.dispatchEvent(new Event("click", { bubbles: true })); all.dispatchEvent(new Event("click", { bubbles: true })); @@ -430,7 +434,11 @@ assert.lengthOf(output.querySelectorAll(".item"), len); Al hacer clic en el botón `#books` se debe mostrar el conjunto correspondiente de productos en el elemento `#output`. ```js +const books = document.getElementById("books"); +const clothing = document.getElementById("clothing"); +const output = document.getElementById("output"); const len = products.items.length; + assert.isAtLeast(len, 3); let count = 0; products.items.forEach(i => { @@ -446,7 +454,11 @@ assert.lengthOf(output.querySelectorAll(".item"), count); Al hacer clic en el botón `#electronics` se debe mostrar el conjunto correspondiente de productos en el elemento `#output`. ```js +const electronics = document.getElementById("electronics"); +const clothing = document.getElementById("clothing"); +const output = document.getElementById("output"); const len = products.items.length; + assert.isAtLeast(len, 3); let count = 0; products.items.forEach(i => { @@ -462,7 +474,11 @@ assert.lengthOf(output.querySelectorAll(".item"), count); Al hacer clic en el botón `#clothing` se debe mostrar el conjunto correspondiente de productos en el elemento `#output`. ```js +const books = document.getElementById("books"); +const clothing = document.getElementById("clothing"); +const output = document.getElementById("output"); const len = products.items.length; + assert.isAtLeast(len, 3); let count = 0; products.items.forEach(i => { @@ -478,6 +494,7 @@ assert.lengthOf(output.querySelectorAll(".item"), count); Todos los productos deben ser visibles por defecto cuando la página cargue. Usa el evento `DOMContentLoaded` para asegurarlo. ```js +const output = document.getElementById("output"); const len = products.items.length; assert.isAtLeast(len, 3); document.dispatchEvent(new Event("DOMContentLoaded")); diff --git a/curriculum/challenges/espanol/blocks/lab-reusable-footer/673b02b03134b04637bf7055.md b/curriculum/challenges/espanol/blocks/lab-reusable-footer/673b02b03134b04637bf7055.md index 5c404108d6c..0ee2fe7403e 100644 --- a/curriculum/challenges/espanol/blocks/lab-reusable-footer/673b02b03134b04637bf7055.md +++ b/curriculum/challenges/espanol/blocks/lab-reusable-footer/673b02b03134b04637bf7055.md @@ -16,7 +16,7 @@ demoType: onClick 2. Tu componente `Footer` debería devolver un elemento `footer` que contiene todos los demás elementos. 3. Tu elemento `footer` debería tener: - - Al menos tres listas desordenadas, cada una con al menos dos elementos de lista. +- Al menos tres listas desordenadas, cada una con al menos dos elementos de lista. - Al menos un elemento de párrafo con un símbolo de copyright `©`. - Al menos tres enlaces con el valor `href` configurado en `#` y el contenido del enlace establecido como un icono o texto de tu elección. @@ -53,7 +53,7 @@ Tu elemento `footer` debería contener al menos tres listas desordenadas. assert.isAtLeast(document.querySelectorAll('ul').length, 3); ``` -Cada una de tus listas desordenadas debería tener al menos dos elementos de lista. +Cada una de tus listas desordenadas debe tener al menos dos elementos. ```js const uls = [...document.querySelectorAll('ul')]; @@ -84,7 +84,7 @@ const links = document.querySelectorAll('a[href="#"]'); assert.isAtLeast(links.length, 3); ``` -Ninguno de tus enlaces debería estar vacío. +Tus enlaces no deben estar vacíos. ```js const links = [...document.querySelectorAll('a[href="#"]')]; diff --git a/curriculum/challenges/espanol/blocks/lab-sentence-maker/66c057041df6394ca796bf33.md b/curriculum/challenges/espanol/blocks/lab-sentence-maker/66c057041df6394ca796bf33.md index 40dd8962306..813c90ba7ce 100644 --- a/curriculum/challenges/espanol/blocks/lab-sentence-maker/66c057041df6394ca796bf33.md +++ b/curriculum/challenges/espanol/blocks/lab-sentence-maker/66c057041df6394ca796bf33.md @@ -7,7 +7,7 @@ dashedName: build-a-sentence-maker # --description-- -En este laboratorio, crearás dos historias diferentes utilizando una plantilla de oraciones. Usarás variables para almacenar diferentes partes de la historia y luego mostrarás las historias en la consola. +En este laboratorio, crearás dos historias diferentes usando una plantilla de oración. Usarás variables para almacenar diferentes partes de la historia y luego registrarás las historias en la consola. **Objetivo:** Cumplir con las historias de usuario a continuación y pasar todas las pruebas para completar el laboratorio. @@ -26,19 +26,26 @@ En este laboratorio, crearás dos historias diferentes utilizando una plantilla 1. Debes declarar una variable `firstStory`. -1. Debes usar la siguiente plantilla de historia para crear la primera historia y asignarla a la variable `firstStory`: `"Once upon a time, there was a(n) [adjective] [noun] who loved to eat [noun2]. The [noun] lived in a [place] and had [adjective2] nostrils that blew fire when it was [verb]."`; +1. Debes usar la siguiente plantilla de historia para crear la primera historia y asignarla a la variable `firstStory`: `"Once upon a time, there was a(n) [adjective] [noun] who loved to eat [noun2]. The [noun] lived in a [place] and had [adjective2] nostrils that blew fire when it was [verb]."` -1. Debes mostrar tu primera historia en la consola usando el mensaje `"First story: [firstStory]"`. +1. Debes registrar tu primera historia en la consola usando el mensaje `"First story: [firstStory]"`. 1. Debes asignar nuevos valores a tus variables `adjective`, `noun`, `verb`, `place`, `adjective2` y `noun2`. 1. Debes declarar una variable `secondStory`. -1. Crea otra historia utilizando la misma plantilla y asígnala a la variable `secondStory`. +1. Debes crear otra historia usando la misma plantilla y asignarla a la variable `secondStory`. -1. Debes mostrar tu segunda historia en la consola usando el mensaje `"Second story: [secondStory]"`. +1. Debes registrar tu segunda historia en la consola usando el mensaje `"Second story: [secondStory]"`. +# --before-each-- + +```js +const spy = __helpers.spyOn(console, 'log'); +const getLogs = () => spy.calls.map(call => call.join(' ')); +``` + # --hints-- Debes declarar una variable `adjective`. @@ -142,12 +149,10 @@ assert.match( ); ``` -Debes registrar tu primera historia usando el mensaje `"First story: [firstStory]"`. +Debes registrar tu primera historia en la consola usando el mensaje `"First story: [firstStory]"`. ```js -const condition1 = /console\.log\(\s*["']First\s+story:\s+["']\s*\+\s*firstStory\s*\);?/gm.test(code); -const condition2 = /console\.log\(\s*`First\s+story:\s+\$\{firstStory\}`\s*\);?/gm.test(code); -assert.isTrue(condition1 || condition2); +assert.include(getLogs(), `First story: ${firstStory}`); ``` Debes declarar una variable `secondStory`. @@ -208,15 +213,13 @@ assert.match( ); ``` -Debes registrar tu segunda historia usando el formato `"Second story: [secondStory]"`. +Debes registrar tu segunda historia en la consola usando el mensaje `"Second story: [secondStory]"`. ```js -const condition1 = /console\.log\(\s*["']Second\s+story:\s+["']\s*\+\s*secondStory\s*\);?/gm.test(code); -const condition2 = /console\.log\(\s*`Second\s+story:\s+\$\{secondStory\}`\s*\);?/gm.test(code); -assert.isTrue(condition1 || condition2); +assert.include(getLogs(), `Second story: ${secondStory}`); ``` -La `firstStory` no debe ser la misma que la `secondStory`. +Tu `firstStory` no debe ser igual a tu `secondStory`. ```js assert.notEqual(firstStory, secondStory); diff --git a/curriculum/challenges/espanol/blocks/lab-weather-app/66f12a88741aeb16b9246c59.md b/curriculum/challenges/espanol/blocks/lab-weather-app/66f12a88741aeb16b9246c59.md index de2fc8c5995..31ce95a6db8 100644 --- a/curriculum/challenges/espanol/blocks/lab-weather-app/66f12a88741aeb16b9246c59.md +++ b/curriculum/challenges/espanol/blocks/lab-weather-app/66f12a88741aeb16b9246c59.md @@ -333,7 +333,7 @@ assert.strictEqual( ); ``` -Dentro del elemento `select` debería haber 6 elementos `option`, uno por cada una de las siguientes ciudades: París, Londres, Tokio, Los Ángeles, Chicago, Nueva York. +Además de la primera opción vacía, el elemento `select` debe contener 6 elementos `option`, uno para cada una de las siguientes ciudades: París, Londres, Tokio, Los Ángeles, Chicago, Nueva York. ```js ['Paris', 'London', 'Tokyo', 'Los Angeles', 'Chicago', 'New York'].forEach( @@ -342,7 +342,7 @@ Dentro del elemento `select` debería haber 6 elementos `option`, uno por cada u `select > option[value="${city.toLowerCase()}"]` ); assert.exists(el); - assert.strictEqual(el.innerText.trim(), city); + assert.strictEqual(el.textContent.trim(), city); } ); ``` diff --git a/curriculum/challenges/espanol/blocks/learn-basic-css-by-building-a-cafe-menu/5f3ef6e03d719d5ac4738993.md b/curriculum/challenges/espanol/blocks/learn-basic-css-by-building-a-cafe-menu/5f3ef6e03d719d5ac4738993.md index f0397a1c465..71e55253a36 100644 --- a/curriculum/challenges/espanol/blocks/learn-basic-css-by-building-a-cafe-menu/5f3ef6e03d719d5ac4738993.md +++ b/curriculum/challenges/espanol/blocks/learn-basic-css-by-building-a-cafe-menu/5f3ef6e03d719d5ac4738993.md @@ -7,7 +7,7 @@ dashedName: step-56 # --description-- -El ancho actual del menú siempre tomará un 80% del ancho del elemento `body`. En una pantalla muy amplia, el café y el postre aparecerán demasiado lejos de sus precios. +El ancho actual del menú siempre ocupará el `80%` del ancho del elemento `body`. En una pantalla muy ancha, los cafés y postres aparecen muy separados de sus precios. Añade una propiedad `max-width` (ancho-máximo) a la clase `menu` con un valor de `500px` para prevenir que se expanda más de lo necesario. diff --git a/curriculum/challenges/espanol/blocks/learn-how-to-plan-future-events/67531709d628ef047202e6ae.md b/curriculum/challenges/espanol/blocks/learn-how-to-plan-future-events/67531709d628ef047202e6ae.md index 9fcfb3db38d..5655d396292 100644 --- a/curriculum/challenges/espanol/blocks/learn-how-to-plan-future-events/67531709d628ef047202e6ae.md +++ b/curriculum/challenges/espanol/blocks/learn-how-to-plan-future-events/67531709d628ef047202e6ae.md @@ -12,7 +12,7 @@ Mira el video a continuación para entender el contexto de las siguientes leccio # --assignment-- -Mira el video.. +Mira el video. # --scene-- diff --git a/curriculum/challenges/espanol/blocks/learn-present-perfect-while-talking-about-accessibility/671b98e9b7c4854e93044e64.md b/curriculum/challenges/espanol/blocks/learn-present-perfect-while-talking-about-accessibility/671b98e9b7c4854e93044e64.md index 128d91ebbe8..538df82d33b 100644 --- a/curriculum/challenges/espanol/blocks/learn-present-perfect-while-talking-about-accessibility/671b98e9b7c4854e93044e64.md +++ b/curriculum/challenges/espanol/blocks/learn-present-perfect-while-talking-about-accessibility/671b98e9b7c4854e93044e64.md @@ -62,7 +62,7 @@ Mira el video. "startTime": 5.34, "finishTime": 9.26, "dialogue": { - "text": "Yes, for some reason it hasn't been displaying correctly for some users.", + "text": "Yes. For some reason, it hasn't been displaying correctly for some users.", "align": "right" } }, diff --git a/curriculum/challenges/espanol/blocks/learn-present-perfect-while-talking-about-accessibility/671f403c1d4e8a5e046065a0.md b/curriculum/challenges/espanol/blocks/learn-present-perfect-while-talking-about-accessibility/671f403c1d4e8a5e046065a0.md index 7cb08e79928..e1eaf023ab0 100644 --- a/curriculum/challenges/espanol/blocks/learn-present-perfect-while-talking-about-accessibility/671f403c1d4e8a5e046065a0.md +++ b/curriculum/challenges/espanol/blocks/learn-present-perfect-while-talking-about-accessibility/671f403c1d4e8a5e046065a0.md @@ -6,7 +6,7 @@ dashedName: task-36 lang: en-US --- -<!-- (Audio) James: Yes. For some reason, It hasn't been displaying correctly for some users. --> +<!-- (Audio) James: Yes. For some reason, it hasn't been displaying correctly for some users. --> # --instructions-- @@ -16,7 +16,7 @@ Escucha el audio para completar la oración de abajo. ## --sentence-- -`Yes. For some reason, It BLANK BLANK BLANK correctly for some users.` +`Yes. For some reason, it BLANK BLANK BLANK correctly for some users.` ## --blanks-- @@ -83,7 +83,7 @@ La oración está en la forma negativa del tiempo `Present Perfect Continuous`, "startTime": 1, "finishTime": 4.92, "dialogue": { - "text": "Yes, for some reason it hasn't been displaying correctly for some users.", + "text": "Yes. For some reason, it hasn't been displaying correctly for some users.", "align": "center" } }, diff --git a/curriculum/challenges/espanol/blocks/learn-present-perfect-while-talking-about-accessibility/671f456994635c6085054cbd.md b/curriculum/challenges/espanol/blocks/learn-present-perfect-while-talking-about-accessibility/671f456994635c6085054cbd.md index 3a59b70962c..28a1efb4369 100644 --- a/curriculum/challenges/espanol/blocks/learn-present-perfect-while-talking-about-accessibility/671f456994635c6085054cbd.md +++ b/curriculum/challenges/espanol/blocks/learn-present-perfect-while-talking-about-accessibility/671f456994635c6085054cbd.md @@ -6,7 +6,7 @@ dashedName: task-37 lang: en-US --- -<!-- (Audio) James: Yes. For some reason, It hasn't been displaying correctly for some users. --> +<!-- (Audio) James: Yes. For some reason, it hasn't been displaying correctly for some users. --> # --instructions-- @@ -16,7 +16,7 @@ Escucha el audio para completar la oración de abajo. ## --sentence-- -`Yes. For some reason, It hasn't been displaying BLANK for some BLANK.` +`Yes. For some reason, it hasn't been displaying BLANK for some BLANK.` ## --blanks-- @@ -79,7 +79,7 @@ Este sustantivo en plural se refiere a las personas que interactúan con un prod "startTime": 1, "finishTime": 4.92, "dialogue": { - "text": "Yes, for some reason it hasn't been displaying correctly for some users.", + "text": "Yes. For some reason, it hasn't been displaying correctly for some users.", "align": "center" } }, diff --git a/curriculum/challenges/espanol/blocks/learn-present-perfect-while-talking-about-accessibility/6720cf38beae8c4f1d7af1c0.md b/curriculum/challenges/espanol/blocks/learn-present-perfect-while-talking-about-accessibility/6720cf38beae8c4f1d7af1c0.md index 6f037938a7b..74fbea312cb 100644 --- a/curriculum/challenges/espanol/blocks/learn-present-perfect-while-talking-about-accessibility/6720cf38beae8c4f1d7af1c0.md +++ b/curriculum/challenges/espanol/blocks/learn-present-perfect-while-talking-about-accessibility/6720cf38beae8c4f1d7af1c0.md @@ -22,7 +22,7 @@ Escribe las siguientes palabras o frases en el lugar correcto: `rendering consis `Alice: James, have you heard about the BLANK on our video platform?` -`James: Yes. For some reason, It hasn't been BLANK for some users. The captions are misaligned and BLANK, which isn't good for accessibility.` +`James: Yes. For some reason, it hasn't been BLANK for some users. The captions are misaligned and BLANK, which isn't good for accessibility.` `Alice: Exactly. Do you know if it's been affecting all the videos or just a few?` diff --git a/curriculum/challenges/espanol/blocks/lecture-css-specificity-the-cascade-algorithm-and-inheritance/672aa62178d5ff57fe4f98e0.md b/curriculum/challenges/espanol/blocks/lecture-css-specificity-the-cascade-algorithm-and-inheritance/672aa62178d5ff57fe4f98e0.md index 38c8494da80..efd2a62a4ba 100644 --- a/curriculum/challenges/espanol/blocks/lecture-css-specificity-the-cascade-algorithm-and-inheritance/672aa62178d5ff57fe4f98e0.md +++ b/curriculum/challenges/espanol/blocks/lecture-css-specificity-the-cascade-algorithm-and-inheritance/672aa62178d5ff57fe4f98e0.md @@ -43,14 +43,14 @@ Después de esto, los selectores ID tienen un alto nivel de especificidad. ```html <link rel="stylesheet" href="styles.css"> -<p id="para">Red paragraph</p> +<p id="para-1">Red paragraph</p> <p>Other paragraph</p> <p>Another paragraph</p> <p>Yet another paragraph</p> ``` ```css -#para { +#para-1 { color: red; } @@ -67,24 +67,33 @@ Los ejemplos incluyen selectores de clase como `.container` y `.button`, selecto **NOTA**: Aprenderás más sobre pseudo-clases en lecciones futuras. -En este ejemplo, el primer párrafo será rojo porque un selector de ID tiene una especificidad mayor que las clases y los selectores de tipo. Los elementos `.example-para` tendrán un color verde mientras que los demás elementos de párrafo tendrán un color azul. +En este ejemplo: + +- El primer párrafo será rojo porque un selector de ID tiene una especificidad mayor que las clases y los selectores de tipo. +- El segundo párrafo con un selector de clase `.example-para` tendrá un color verde. +- El tercer párrafo con un selector de ID `#para-3` y un selector de clase `.example-para` tendrá un color púrpura. +- El párrafo restante tendrá un color azul. :::interactive_editor ```html <link rel="stylesheet" href="styles.css"> -<p id="para">Example paragraph</p> +<p id="para-1">Example paragraph</p> <p class="example-para">Other paragraph</p> -<p class="example-para">Another paragraph</p> +<p id="para-3" class="example-para">Another paragraph</p> <p>Yet another paragraph</p> ``` ```css -#para { +#para-1 { color: red; } +#para-3 { + color: purple; +} + .example-para { color: green; } @@ -105,13 +114,13 @@ Los selectores de tipo, como `div` y `h1`, y los pseudo-elementos como `::before ```html <link rel="stylesheet" href="styles.css"> -<p id="para">Example paragraph</p> +<p id="para-1">Example paragraph</p> <p>Other paragraph</p> <p>Yet another paragraph</p> ``` ```css -#para { +#para-1 { color: red; } @@ -130,7 +139,7 @@ Aquí tienes un ejemplo de cómo establecer el color de todos los elementos en r ```html <link rel="stylesheet" href="styles.css"> -<p id="para">Example paragraph</p> +<p id="para-1">Example paragraph</p> <p>Other paragraph</p> <p>Yet another paragraph</p> ``` @@ -140,7 +149,7 @@ Aquí tienes un ejemplo de cómo establecer el color de todos los elementos en r color: red; } -#para { +#para-1 { color: green; } diff --git a/curriculum/challenges/espanol/blocks/lecture-express-middleware/69f42d414b7626e21a922794.md b/curriculum/challenges/espanol/blocks/lecture-express-middleware/69f42d414b7626e21a922794.md index 21f16892678..897659fc33f 100644 --- a/curriculum/challenges/espanol/blocks/lecture-express-middleware/69f42d414b7626e21a922794.md +++ b/curriculum/challenges/espanol/blocks/lecture-express-middleware/69f42d414b7626e21a922794.md @@ -9,9 +9,7 @@ dashedName: what-is-error-handling-middleware El middleware para manejo de errores en Express es un tipo especial de middleware que se usa para gestionar los errores que ocurren durante el ciclo de solicitud-respuesta. Es esencial para capturar errores inesperados, registrarlos y proporcionar respuestas adecuadas al cliente. -Como viste en una lección anterior sobre manejo de errores, el middleware para manejo de errores de Express tiene cuatro parámetros: `err`, `req`, `res` y `next`. Este middleware se invoca cuando se pasa un error a la función `next()`. - -Aquí tienes un recordatorio de la sintaxis una vez más: +El middleware de manejo de errores en Express tiene cuatro parámetros: `err`, `req`, `res` y `next`. Este middleware se invoca cuando se pasa un error a la función `next()`. Aquí está la sintaxis: ```js app.use((err, req, res, next) => { diff --git a/curriculum/challenges/espanol/blocks/lecture-express-middleware/69f42d414b7626e21a922795.md b/curriculum/challenges/espanol/blocks/lecture-express-middleware/69f42d414b7626e21a922795.md index cbc95943a45..7473f8a1843 100644 --- a/curriculum/challenges/espanol/blocks/lecture-express-middleware/69f42d414b7626e21a922795.md +++ b/curriculum/challenges/espanol/blocks/lecture-express-middleware/69f42d414b7626e21a922795.md @@ -13,45 +13,45 @@ Express ofrece una variedad de funciones de middleware integradas que ayudan a r 1. `express.json()`: Un middleware integrado que interpreta cargas útiles JSON entrantes. -```js -app.use(express.json()) -``` + ```js + app.use(express.json()) + ``` 1. `express.static()`: Un middleware para servir archivos estáticos como imágenes, CSS y archivos JavaScript. -```js -app.use(express.static('public')) -``` + ```js + app.use(express.static('public')) + ``` 1. `express.urlencoded()`: Un middleware que interpreta solicitudes entrantes con cargas útiles codificadas en URL, el formato que típicamente envían los formularios HTML. Hace que los datos interpretados estén disponibles en `req.body`. -```js -app.use(express.urlencoded({ extended: true })) -``` + ```js + app.use(express.urlencoded({ extended: true })) + ``` **Ahora, aquí tienes algunos ejemplos de middleware de terceros:** 1. `cors`: Un middleware de terceros popular para habilitar el intercambio de recursos de origen cruzado. -```bash -npm install cors -``` + ```bash + npm install cors + ``` -```js -const cors = require('cors') -app.use(cors()) -``` + ```js + const cors = require('cors') + app.use(cors()) + ``` 1. `morgan`: Un middleware de registro para solicitudes HTTP. -```bash -npm install morgan -``` + ```bash + npm install morgan + ``` -```js -const morgan = require('morgan') -app.use(morgan('tiny')) -``` + ```js + const morgan = require('morgan') + app.use(morgan('tiny')) + ``` Ahora, veamos un ejemplo de uso tanto de middleware integrado como de terceros: diff --git a/curriculum/challenges/espanol/blocks/lecture-importance-of-semantic-html/672990ecf71a852804ababe7.md b/curriculum/challenges/espanol/blocks/lecture-importance-of-semantic-html/672990ecf71a852804ababe7.md index 958768951c8..a2f69ba84e1 100644 --- a/curriculum/challenges/espanol/blocks/lecture-importance-of-semantic-html/672990ecf71a852804ababe7.md +++ b/curriculum/challenges/espanol/blocks/lecture-importance-of-semantic-html/672990ecf71a852804ababe7.md @@ -11,6 +11,10 @@ HTML presentacional se centra en la apariencia y el estilo del contenido. En los Muchos elementos de HTML presentacional están obsoletos, lo que significa que están desactualizados y ya no son recomendados. Hay mejores formas de obtener los mismos resultados. Sin embargo, es útil saber que existen, así que veremos algunos ejemplos. +## Elementos HTML presentacionales + +### El elemento `font` + El elemento `font` es un elemento obsoleto que se usa para establecer el tamaño y el color de la fuente del texto. Aquí tienes un ejemplo de un elemento `font`. Activa el editor interactivo y cambia el tamaño de 5 a 7 para ver el aumento de la fuente. @@ -27,6 +31,8 @@ Este ejemplo establece el color del texto a `blue` y el tamaño a un valor de `5 Aunque este elemento todavía funciona, no deberías usarlo porque el tamaño y color de la fuente siempre deben establecerse en CSS, no en HTML. +### El elemento `center` + El elemento `center` es otro elemento obsoleto que se usa para centrar el contenido horizontalmente dentro de su contenedor. Aquí tienes un ejemplo del elemento `center` que contiene texto y un elemento párrafo. Activa el editor interactivo y añade etiquetas `center` alrededor de `<p>Another example text.</p>` para verlo centrado en la página. @@ -44,6 +50,8 @@ Activa el editor interactivo y añade etiquetas `center` alrededor de `<p>Anothe ::: +### El elemento `big` + Y a continuación, tenemos el elemento `big`. Este es otro elemento obsoleto de HTML presentacional que hace que el texto incluido sea un nivel más grande que el texto circundante. Here we have an example that defines a paragraph with two parts. Activa el editor interactivo y agrega etiquetas `big` alrededor de `Some other text` para ver los cambios en la ventana de vista previa. @@ -64,6 +72,8 @@ Recuerda que el tamaño de fuente siempre debe establecerse con CSS, por lo que Estos fueron ejemplos de elementos de HTML presentacional. Pero todos están obsoletos y ya no son recomendados. Entonces, ¿qué deberías usar en su lugar? Veamos. +## HTML semántico + El HTML semántico es ahora la práctica recomendada. Describe el contenido de los elementos, por lo que es mucho más fácil de leer, entender y mantener. Los motores de búsqueda pueden entender fácilmente tu página web cuando usas HTML semántico. También es útil para propósitos de accesibilidad, porque los lectores de pantalla necesitan información semántica para describir lo que hay en la página web. @@ -75,6 +85,8 @@ Los ejemplos de elementos HTML semánticos incluyen: - El elemento `section` para agrupar información relacionada. - El elemento `figure` para ilustraciones y diagramas. +### Ejemplo de HTML semántico + Este es un ejemplo de un elemento `header` que contiene un elemento de sección de navegación. Activa el editor interactivo y añade un `<a href="#">Products</a>` dentro del `nav` y observa los cambios en la ventana de vista previa. @@ -97,6 +109,8 @@ Activa el editor interactivo y añade un `<a href="#">Products</a>` dentro del ` Los elementos semánticos muestran claramente su propósito dentro de la estructura HTML. Existen muchos diferentes elementos de HTML semántico. Definitivamente encontrarás uno que se ajuste a las necesidades de tu proyecto. +## Resumen + Buen trabajo. Ahora sabes la diferencia entre HTML presentacional y HTML semántico: HTML semántico describe el contenido, mientras que HTML presentacional se enfoca en la apariencia. # --questions-- diff --git a/curriculum/challenges/espanol/blocks/lecture-introduction-to-javascript-libraries-and-frameworks/6734e88cc46e6dc679420040.md b/curriculum/challenges/espanol/blocks/lecture-introduction-to-javascript-libraries-and-frameworks/6734e88cc46e6dc679420040.md index d22024e2667..e519d231f41 100644 --- a/curriculum/challenges/espanol/blocks/lecture-introduction-to-javascript-libraries-and-frameworks/6734e88cc46e6dc679420040.md +++ b/curriculum/challenges/espanol/blocks/lecture-introduction-to-javascript-libraries-and-frameworks/6734e88cc46e6dc679420040.md @@ -13,7 +13,7 @@ Una de las herramientas más populares para configurar proyectos es Vite. Vite, Para crear un nuevo proyecto con Vite, necesitarás usar la línea de comandos. Si usas una máquina con Windows, puedes usar el Símbolo del sistema o Windows PowerShell. Si usas una Mac, puedes usar la app Terminal. -En caso de que no tengas Node.js instalado, que es necesario para que npm funcione, aquí tienes un enlace a la página oficial de Node.js: https://nodejs.org. Sigue las instrucciones de instalación y luego regresa aquí para continuar con la instalación de React. +En caso de que no tengas Node.js instalado, que es necesario para que npm funcione, aquí tienes un enlace a la página oficial de Node.js: [nodejs.org](https://nodejs.org). Sigue las instrucciones de instalación y luego regresa aquí para continuar con la instalación de React. Una vez que tengas la línea de comandos abierta, puedes usar el siguiente comando: @@ -36,7 +36,7 @@ npm install El comando `cd my-react-app` garantiza que cambies al directorio correcto donde se encuentra tu proyecto. -El comando `npm install` se usa para instalar las dependencias necesarias para ejecutar correctamente tu proyecto React. Las dependencias son librerías o paquetes que tu proyecto React requiere para funcionar correctamente, como React mismo, ReactDOM o otros paquetes de terceros que proporcionan funcionalidad adicional. +El comando `npm install` se usa para instalar las dependencias necesarias para ejecutar correctamente tu proyecto React. Las dependencias son librerías o paquetes que tu proyecto React requiere para funcionar bien, como React mismo, `react-dom` u otros paquetes de terceros que ofrecen funcionalidades adicionales. Ejecutar `npm install` leerá el archivo `package.json` en tu directorio de proyecto e instalará todas las dependencias allí listadas, permitiéndote construir y ejecutar tu aplicación React sin que falten componentes necesarios. @@ -50,11 +50,11 @@ Para ejecutar tu proyecto, ejecuta el comando `npm run dev` y abre una nueva pes Deberías ver la plantilla inicial que Vite ha proporcionado para ti. -Si necesitas detener el servidor local, presiona `CTRL + C` en la línea de comandos. +Si necesitas detener el servidor local, presiona `Ctrl + C` en la línea de comandos. -Para ver realmente el código de esta plantilla inicial, puedes ir a tu proyecto dentro de la carpeta `src` y deberías ver el archivo `App.jsx`. +Para ver el código de esta plantilla inicial, puedes abrir la carpeta `src` dentro de tu proyecto, donde deberías encontrar el archivo `App.jsx`. -Desde allí, puedes comenzar a modificar el archivo, guardar tus cambios y ver los nuevos cambios visualizados en el navegador. +Desde ahí puedes modificar el archivo, guardar tus cambios y ver cómo aparecen en el navegador. ¡Y con eso, estás listo para comenzar a construir tu aplicación React! diff --git a/curriculum/challenges/espanol/blocks/lecture-introduction-to-javascript/672d49959621885e9d3e672c.md b/curriculum/challenges/espanol/blocks/lecture-introduction-to-javascript/672d49959621885e9d3e672c.md index 037f0f20b59..94f2ee4bc5c 100644 --- a/curriculum/challenges/espanol/blocks/lecture-introduction-to-javascript/672d49959621885e9d3e672c.md +++ b/curriculum/challenges/espanol/blocks/lecture-introduction-to-javascript/672d49959621885e9d3e672c.md @@ -72,6 +72,16 @@ console.log(age); // 25 ::: +Aunque una variable declarada con `let` puede ser reasignada, no puede ser redeclarada. Si intentas declarar la misma variable nuevamente usando `let`, obtendrás un error: + +```js +let age = 25; + +let age = 90; // SyntaxError: Identifier 'age' has already been declared +``` + +Lo mismo aplica para `const`: una variable declarada con `const` tampoco puede ser redeclarada. + Las variables declaradas con `const` deben recibir un valor en el momento de la declaración. Si intentas declarar una variable `const` sin asignarle un valor, obtendrás un error: ```js diff --git a/curriculum/challenges/espanol/blocks/lecture-understanding-aria-expanded-aria-live-and-common-aria-states/672a54dff9dc439089f1a219.md b/curriculum/challenges/espanol/blocks/lecture-understanding-aria-expanded-aria-live-and-common-aria-states/672a54dff9dc439089f1a219.md index 5363b65f87f..b6ac85b1704 100644 --- a/curriculum/challenges/espanol/blocks/lecture-understanding-aria-expanded-aria-live-and-common-aria-states/672a54dff9dc439089f1a219.md +++ b/curriculum/challenges/espanol/blocks/lecture-understanding-aria-expanded-aria-live-and-common-aria-states/672a54dff9dc439089f1a219.md @@ -11,10 +11,12 @@ El `aria-live` atributo crea una región en vivo en la página que se puede usar Los usos comunes de las regiones en vivo incluyen mensajes que se muestran después de que se ha realizado una acción (como un mensaje de error o confirmación), contenido que se actualiza periódicamente (como un teletipo, un marquee o un temporizador de cuenta regresiva), o mensajes de estado generales (como actualizaciones sobre un proceso). -Debido a que el enfoque de lectura para los lectores de pantalla solo puede estar en un lugar a la vez, los usuarios del lector de pantalla no notarán un cambio de contenido si su enfoque está en otra parte de la página. Las regiones en vivo permiten que los usuarios del lector de pantalla sean notificados automáticamente de los cambios que ocurren en la página en tiempo real. Sin una región en vivo, los usuarios del lector de pantalla podrían perder actualizaciones de contenido importantes disponibles para los usuarios videntes, ya que un usuario vidente tiene la capacidad de escanear toda la página. +Debido a que el enfoque de lectura para los lectores de pantalla solo puede estar en un lugar a la vez, los usuarios del lector de pantalla no notarán un cambio de contenido si su enfoque está en otra parte de la página. Las regiones en vivo permiten que los usuarios del lector de pantalla sean notificados automáticamente de los cambios que ocurren en la página en tiempo real. Sin una región en vivo, los usuarios del lector de pantalla podrían perder actualizaciones de contenido importantes disponibles para los usuarios videntes, ya que un usuario vidente tiene la capacidad de escanear toda la página. Hay tres posibles valores para este atributo, según la prioridad de la información. +## El valor `assertive` + Si configuras `aria-live` con el valor `assertive`, eso significa que la actualización es muy importante. Tiene la máxima prioridad, por lo que el usuario debe ser notificado de inmediato. Esto significa que el lector de pantalla interrumpirá cualquier anuncio que esté haciendo actualmente para anunciar el cambio de contenido en la región en vivo. Tales interrupciones pueden ser extremadamente disruptivas, por lo que el valor `assertive` solo debe usarse para notificaciones críticas o sensibles al tiempo. @@ -81,6 +83,8 @@ document.addEventListener("DOMContentLoaded", () => { ::: +## El valor `polite` + El siguiente valor en orden de prioridad es `polite`. Este valor significa que la actualización no es urgente, por lo que el lector de pantalla puede esperar hasta que se termine cualquier anuncio actual o hasta que el usuario deje de escribir antes de anunciar la actualización. La mayoría de las regiones en vivo usarán el valor `polite`. @@ -147,10 +151,16 @@ document.addEventListener("DOMContentLoaded", () => { ::: +## El valor `off` + El valor de menor prioridad para `aria-live` es `off`, lo que significa que la actualización no se anunciará a menos que el contenido esté en un elemento que actualmente tenga el enfoque del teclado. Realmente, este valor casi nunca se usa, ya que el caso de uso es muy estrecho y no se implementa de manera consistente (si es que se implementa) en los lectores de pantalla. Si necesitas regiones en vivo, planea usar `polite` para todo, excepto mensajes críticos que necesitan `assertive`. +## Regiones en vivo predeterminadas de los roles ARIA + También es importante tener en cuenta que el atributo `aria-live` no es necesario si la información actualizada se encuentra en un elemento con un rol ARIA de `alert`, `log`, `marquee`, `status`, o `timer`, ya que estos roles ya tienen valores `aria-live` predeterminados. Pero el valor predeterminado puede cambiarse estableciendo explícitamente `aria-live` en el elemento. +## Elegir el valor correcto + Elegir el valor `aria-live` adecuado depende de la prioridad de la información actualizada. Si las actualizaciones son urgentes, debes notificar inmediatamente al usuario con `assertive`. Pero debes usar esto solo si las actualizaciones son realmente urgentes, porque las interrupciones repentinas pueden potencialmente desorientar a los usuarios y afectar la experiencia del usuario. diff --git a/curriculum/challenges/espanol/blocks/lecture-understanding-computer-internet-and-tooling-basics/672aa578a2129554d4675049.md b/curriculum/challenges/espanol/blocks/lecture-understanding-computer-internet-and-tooling-basics/672aa578a2129554d4675049.md index 2bc25573386..571c93ea846 100644 --- a/curriculum/challenges/espanol/blocks/lecture-understanding-computer-internet-and-tooling-basics/672aa578a2129554d4675049.md +++ b/curriculum/challenges/espanol/blocks/lecture-understanding-computer-internet-and-tooling-basics/672aa578a2129554d4675049.md @@ -11,13 +11,13 @@ Las computadoras son máquinas muy potentes que realizan una variedad de tareas Como desarrollador, es importante entender el funcionamiento interno básico de una computadora. -El primer componente principal de una computadora sería la placa base. La placa base contiene toda la memoria y conectores necesarios para ejecutar la computadora. Sirve como la placa base principal de la computadora. +El primer componente principal de una computadora es la placa base. La placa base contiene toda la memoria y los conectores necesarios para ejecutar la computadora. Sirve como la placa de circuito principal de la computadora. -Dentro de la carcasa de la computadora de la placa base, encontrarás el CPU que significa Unidad Central de Procesamiento. El CPU es un procesador responsable de ejecutar instrucciones y realizar cálculos. A menudo se le llama el cerebro de la computadora. +Dentro de la caja de la computadora, montado en la placa base, encontrarás la CPU, que significa Unidad Central de Procesamiento. La CPU es un procesador responsable de ejecutar instrucciones y realizar cálculos. A menudo se le llama el cerebro de la computadora. -El CPU es un pequeño cuadrado con un chip que va en el zócalo del CPU de la placa base. La velocidad del procesador CPU se mide en gigahercios (GHz) y megahercios (MHz). Un gigahercio equivale a mil millones de ciclos por segundo y un megahercio a un millón de ciclos por segundo. +La CPU es un pequeño chip cuadrado que se inserta en el zócalo de la CPU de la placa base. La velocidad de la CPU se mide en gigahercios (GHz) y megahercios (MHz). Un gigahercio equivale a mil millones de ciclos por segundo y un megahercio a un millón de ciclos por segundo. -El siguiente componente crítico de una computadora sería la memoria a corto plazo del sistema. Esto se conoce como RAM o Memoria de Acceso Aleatorio. La RAM es una ubicación de almacenamiento temporal para el CPU de la computadora. Cada vez que la computadora necesita acceder a datos rápidamente, usará la RAM. +El siguiente componente crítico de una computadora es la memoria a corto plazo del sistema. Esto se conoce como RAM, o memoria de acceso aleatorio. La RAM es un lugar de almacenamiento temporal para la CPU de la computadora. Cada vez que la computadora necesita acceder a datos rápidamente, usa la RAM. Cuanta más RAM tenga tu computadora, más rápido funcionará y más programas podrás ejecutar al mismo tiempo. Si tienes poca RAM, tu computadora funcionará más lento y notarás la diferencia en el rendimiento. @@ -27,13 +27,13 @@ Cuando guardas tus archivos, se almacenan en el disco duro. El disco duro, o HDD El disco duro está compuesto por un plato giratorio y un brazo. El plato es donde se almacenan los datos y el brazo se utiliza para leer y escribir datos en el plato. Cuando tienes un disco duro más rápido, tu computadora arrancará más rápido y tus programas se ejecutarán más rápido. -Otro tipo de almacenamiento de datos sería la Unidad de Estado Sólido, o SSD por sus siglas en inglés. El SSD es memoria flash no volátil y se puede usar en lugar de un disco duro. Los SSD son más rápidos y más pequeños que los discos duros, pero los discos duros son más baratos y tienen más capacidad de almacenamiento. +Otro tipo de almacenamiento de datos es la unidad de estado sólido, o SSD por sus siglas en inglés. El SSD es memoria flash no volátil y puede usarse en lugar de un disco duro. Los SSD son más rápidos y pequeños que los discos duros, pero los discos duros son más baratos y tienen mayor capacidad de almacenamiento. Otro componente clave de una computadora es la unidad de suministro de energía, o PSU. La PSU es responsable de convertir la electricidad del enchufe en una forma que la computadora pueda usar. Envía la energía del enchufe a la placa base, CPU, y otros componentes de la computadora. -Otro componente clave serían las tarjetas de expansión. Estas tarjetas se insertan en la placa base para agregar funcionalidad adicional a la computadora. Ejemplos de tarjetas de expansión serían la tarjeta de video, tarjeta de sonido y tarjeta de red. +Otro componente clave es la tarjeta de expansión. Estas tarjetas se insertan en la placa base para agregar funcionalidad adicional a la computadora. Ejemplos de tarjetas de expansión serían la tarjeta de video, la tarjeta de sonido y la tarjeta de red. -La tarjeta de video, también conocida como la Unidad de Procesamiento de Gráficos o GPU, es responsable de renderizar visuales en la pantalla de la computadora. +La tarjeta de video, también conocida como Unidad de Procesamiento Gráfico o GPU, es responsable de renderizar los visuales en la pantalla de la computadora. La tarjeta de sonido es responsable de reproducir sonido en los altavoces de la computadora. @@ -45,7 +45,7 @@ Aunque hay muchas más partes para la computadora, estas son algunas partes bás ## --text-- -¿Qué es la RAM? +¿Qué es RAM? ## --answers-- @@ -53,7 +53,7 @@ Memoria a largo plazo. ### --feedback-- -Pensar en el almacenamiento de datos a corto plazo. +Piensa en el almacenamiento de datos a corto plazo. --- @@ -65,7 +65,7 @@ La placa base principal. ### --feedback-- -Pensar en el almacenamiento de datos a corto plazo. +Piensa en el almacenamiento de datos a corto plazo. --- @@ -73,7 +73,7 @@ Una tarjeta de video. ### --feedback-- -Pensar en el almacenamiento de datos a corto plazo. +Piensa en el almacenamiento de datos a corto plazo. ## --video-solution-- @@ -145,7 +145,7 @@ Almacenamiento de memoria a corto plazo. ### --feedback-- -Revisa el final de la lección para la respuesta +Revisa el final de la lección para la respuesta. ## --video-solution-- diff --git a/curriculum/challenges/espanol/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab82c1a9bbd0e3aabc39d.md b/curriculum/challenges/espanol/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab82c1a9bbd0e3aabc39d.md index 7b6a0f7751d..3fa76578314 100644 --- a/curriculum/challenges/espanol/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab82c1a9bbd0e3aabc39d.md +++ b/curriculum/challenges/espanol/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab82c1a9bbd0e3aabc39d.md @@ -7,7 +7,7 @@ dashedName: how-to-effectively-work-with-your-keyboard-mouse-and-other-pointing- # --description-- -Muchos de vosotros habéis estado acostumbrados a trabajar con vuestro teclado y ratón durante años para una variedad de actividades como jugar, realizar tareas para el trabajo o navegar por la web. +Muchos de ustedes han estado trabajando con su teclado y mouse durante años para una variedad de actividades como jugar, realizar tareas para el trabajo o navegar por la web. Pero el uso prolongado incorrecto de estos dispositivos puede llevar a serios problemas de salud a largo plazo. @@ -25,7 +25,7 @@ También debes tener en cuenta tu postura general cuando estés sentado frente a Aunque mantener una buena postura es importante, la ergonomía moderna enfatiza la importancia del movimiento y la postura dinámica. El cuerpo humano está diseñado para el movimiento, y permanecer en cualquier posición fija, incluso una recta, por mucho tiempo puede ejercer presión continua sobre la columna vertebral. Tomar descansos regulares, ajustar tu posición a lo largo del día y mantener una posición natural de la muñeca puede ayudar a mejorar la circulación, reducir la fatiga y apoyar la salud a largo plazo de la columna vertebral. -El último consejo sería usar atajos de teclado siempre que sea posible para ayudar a minimizar la escritura. Hay docenas de atajos disponibles para tareas como navegar por la web, moverse por tu sistema operativo, trabajar dentro de un editor de código, y más. So, it’s best to research some of these keyboard shortcuts and start incorporating them into your daily computer usage. +El último consejo es usar atajos de teclado siempre que sea posible para reducir el alcance hacia el mouse. Hay docenas de atajos disponibles para tareas como navegar por la web, moverse por el sistema operativo, trabajar dentro de un editor de código y más. Por eso, es mejor investigar algunos de estos atajos de teclado y comenzar a incorporarlos en tu uso diario de la computadora. A medida que continúas utilizando tu ratón y teclado para próximos proyectos de codificación y otras actividades, recuerda tener en cuenta estos consejos de salud. @@ -109,7 +109,7 @@ El segundo consejo en la lección menciona dispositivos ergonómicos como una fo ## --answers-- -El ratón debería estar muy por encima del teclado. +La altura del mouse no importa. ### --feedback-- diff --git a/curriculum/challenges/espanol/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab83c4297910eade53c2e.md b/curriculum/challenges/espanol/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab83c4297910eade53c2e.md index f73d896901e..c7dcb22048e 100644 --- a/curriculum/challenges/espanol/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab83c4297910eade53c2e.md +++ b/curriculum/challenges/espanol/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab83c4297910eade53c2e.md @@ -7,17 +7,17 @@ dashedName: what-are-the-different-types-of-internet-service-providers # --description-- -En primer lugar, ¿qué es un proveedor de servicios de Internet o ISP? Es una empresa que vende acceso a la red global de internet, en esencia. Y vienen en tres niveles diferentes. +Primero, ¿qué es un proveedor de servicios de internet, o ISP? Es esencialmente una empresa que vende acceso a la red global de internet. Y existen tres niveles diferentes. -El primer nivel son los gigantes conglomerados, que tienen la infraestructura para manejar la mayoría de (si no toda) su tráfico de red de forma independiente. +El primer nivel son las grandes empresas conglomeradas, que tienen la infraestructura para manejar la mayor parte (si no todo) del tráfico de su red de forma independiente. El segundo nivel son los proveedores a nivel nacional, que a veces alquilan acceso a redes de nivel 1 pero pueden sostenerse bastante bien por sí mismos. -El tercer nivel son las pequeñas empresas que se enfocan principalmente en proporcionar internet a mercados locales, y dependen de proveedores de servicios de Internet más grandes para proporcionar su infraestructura. +El tercer nivel son las pequeñas empresas que se enfocan principalmente en proveer internet a mercados locales y dependen de ISPs más grandes para proporcionar su infraestructura. Estos proveedores ofrecerán diferentes tipos de conexiones también. -Las conexiones de fibra óptica dependen de fibras de vidrio o plástico para transmitir datos a través de la luz, lo que da como resultado velocidades de conexión muy altas e intercambio de datos. +Las conexiones de fibra óptica usan fibras de vidrio o plástico para transmitir datos mediante luz, lo que resulta en velocidades de conexión y intercambio de datos muy altas. Las conexiones por cable utilizan la misma infraestructura que un proveedor de televisión por cable, lo que a menudo las hace fácilmente disponibles en muchas regiones. @@ -25,7 +25,7 @@ Las conexiones DSL utilizan la infraestructura que utilizan los servicios telef El acceso telefónico también utiliza las líneas telefónicas, pero requiere conexión exclusiva (deshabilitando el uso de la línea para fines telefónicos cuando está conectado a internet). Esta es una tecnología mucho más antigua que ha caído en desuso. -Las conexiones por satélite utilizan un conjunto de satélites que orbitan la tierra para conectar varios dispositivos en todo el mundo. Y finalmente, similar a eso, un proveedor de internet en casa 5G utiliza la infraestructura de torres celulares para mantenerte en línea. +Las conexiones satelitales usan un arreglo de satélites orbitando la Tierra para conectar varios dispositivos alrededor del mundo. Y finalmente, de manera similar, un proveedor de internet doméstico 5G usa la infraestructura de torres celulares para mantenerte en línea. Y eso debería darte un resumen básico de qué tipos de proveedores de servicios de internet y conexiones a internet están disponibles. @@ -33,7 +33,7 @@ Y eso debería darte un resumen básico de qué tipos de proveedores de servicio ## --text-- -¿Cuál de los siguientes NO es un nivel de proveedor de servicios de Internet (ISP)? +¿Cuál de los siguientes NO es un nivel de proveedor de servicios de internet (ISP)? ## --answers-- @@ -69,7 +69,7 @@ Organizaciones internacionales que supervisan el acceso global a internet. ## --text-- -¿Qué tipo de conexión a Internet utiliza fibras de vidrio o plástico para transmitir datos mediante luz? +¿Qué tipo de conexión a internet usa fibras de vidrio o plástico para transmitir datos mediante luz? ## --answers-- @@ -121,7 +121,7 @@ Requieren el uso exclusivo de la línea telefónica cuando están conectados. --- -Utilizan un conjunto de satélites orbitando la tierra. +Usan un arreglo de satélites orbitando la Tierra. ### --feedback-- diff --git a/curriculum/challenges/espanol/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab8573f32480f192aaae1.md b/curriculum/challenges/espanol/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab8573f32480f192aaae1.md index 4d59902855e..47e3eed2815 100644 --- a/curriculum/challenges/espanol/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab8573f32480f192aaae1.md +++ b/curriculum/challenges/espanol/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab8573f32480f192aaae1.md @@ -9,7 +9,7 @@ dashedName: what-are-the-different-types-of-tools-professional-developers-use Los desarrolladores profesionales confían en una variedad de herramientas para aumentar la productividad y la calidad del código. Aprendamos sobre esas herramientas, incluyendo las que parecen muy obvias. -La primera entre las herramientas son las computadoras. Una computadora es el entorno de desarrollo principal. Podría ser un escritorio pesado o una laptop portátil con ya sea Windows, macOS, o Linux como sistema operativo. +La primera herramienta es la computadora misma. Una computadora es el entorno principal de desarrollo. Puede ser una estación de trabajo pesada o una laptop portátil con Windows, macOS o Linux como sistema operativo. Los desarrolladores profesionales a menudo optan por computadoras con gran poder de procesamiento y mucha RAM para manejar tareas que requieren muchos recursos. @@ -21,7 +21,7 @@ Visual Studio Code (VS Code) es esencialmente un editor de código, pero tambié Otros editores de código son Sublime Text, Atom, Notepad++, y Brackets. -Cuando escribes código con editores de código e IDEs, necesitas rastrear los cambios que haces en ellos. La herramienta que te permite rastrear esos cambios es un sistema de control de versiones. +Cuando escribes código con editores de código e IDEs, necesitas rastrear los cambios que haces en ese código. La herramienta que te permite rastrear esos cambios es un sistema de control de versiones. Git es el sistema de control de versiones más utilizado en la comunidad de desarrollo. @@ -31,8 +31,8 @@ Los gestores de paquetes son otra herramienta crítica. Ayudan a los desarrollad Ejemplos de gestores de paquetes populares son: -* NPM, Yarn, y PNPM para JavaScript -* PIP para Python +* npm, Yarn y pnpm para JavaScript +* pip para Python * Composer para PHP * Maven para Java @@ -147,7 +147,7 @@ Piensa en herramientas que ejecutan verificaciones automáticas en el código. --- -Sistemas de control de versiones +Sistemas de control de versiones. ### --feedback-- diff --git a/curriculum/challenges/espanol/blocks/lecture-understanding-error-handling-and-health-checks/69f3046f4c0e76cbdd24858e.md b/curriculum/challenges/espanol/blocks/lecture-understanding-error-handling-and-health-checks/69f3046f4c0e76cbdd24858e.md index 57ebc6ab6e5..9d7bd67f576 100644 --- a/curriculum/challenges/espanol/blocks/lecture-understanding-error-handling-and-health-checks/69f3046f4c0e76cbdd24858e.md +++ b/curriculum/challenges/espanol/blocks/lecture-understanding-error-handling-and-health-checks/69f3046f4c0e76cbdd24858e.md @@ -34,7 +34,7 @@ Defines este middleware al final de tu pila de middleware. Express sabe que es un manejador de errores porque tiene cuatro parámetros — el nuevo, `err`, además de los típicos `req`, `res` y `next` que usan otras funciones middleware. -En una lección próxima, aprenderás más sobre el middleware para manejo de errores y cómo encaja en la pila más amplia de middleware de Express. +Como viste en una lección anterior, el middleware para manejo de errores encaja dentro de la pila más amplia de middleware de Express. ## Cómo manejar errores asíncronos diff --git a/curriculum/challenges/espanol/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/6733affc29df1304e2c97e88.md b/curriculum/challenges/espanol/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/6733affc29df1304e2c97e88.md index df624b52262..d69319db5a6 100644 --- a/curriculum/challenges/espanol/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/6733affc29df1304e2c97e88.md +++ b/curriculum/challenges/espanol/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/6733affc29df1304e2c97e88.md @@ -31,6 +31,8 @@ Comienzas escribiendo la palabra clave `class` seguida del nombre de la clase. A El contenido dentro de las llaves se conoce como el cuerpo de la clase. Aquí es donde irá el constructor y los métodos. +## Definir constructores + El constructor es un método especial que se llama automáticamente cuando se crea un nuevo objeto a partir de la clase. Se utiliza típicamente para inicializar las propiedades del objeto. En este ejemplo, puedes ver una clase `Dog` con un constructor. @@ -45,6 +47,8 @@ class Dog { La palabra clave `this` se usa aquí para referirse a la instancia actual de la clase `Dog`, permitiéndote asignar la propiedad `name` al objeto que se está creando. Aprenderás más sobre la palabra clave `this` en una lección futura. +## Definir métodos + Debajo del constructor, puedes tener lo que se llaman métodos. Los métodos son funciones definidas dentro de una clase que realizan acciones u operaciones. Se utilizan para definir comportamientos que pueden realizar las instancias de la clase. Aquí hay un ejemplo de cómo agregar un método llamado `bark` a la clase `Dog`. @@ -63,6 +67,8 @@ class Dog { Cuando se llama al método `bark`, el mensaje se registrará en la consola con el nombre real que fue pasado. Si creas una instancia de `Dog` con el nombre `"Buddy"`, llamar al método `bark()` en esa instancia imprimirá `"Buddy says woof!"` en la consola. +## Instanciar una clase + Una vez que tienes tu clase definida, puedes crear una instancia de la clase con la palabra clave `new`, el nombre de la clase y sus argumentos. En este ejemplo, creamos una nueva instancia de `Dog` con el nombre `Gino` y luego la asignamos a la variable `dog`. @@ -73,7 +79,9 @@ const dog = new Dog("Gino"); Al escribir `new Dog("Gino")` en tu código, se crea el nuevo objeto y el constructor se llama automáticamente con los argumentos dados. -Puedes luego acceder a esta propiedad usando la notación de punto, como puedes ver en la siguiente línea de código: +## Acceder a propiedades y métodos + +Luego puedes acceder a la propiedad `name` usando la notación de punto, como puedes ver en la siguiente línea de código: ```js console.log(dog.name); @@ -127,6 +135,8 @@ dog.bark(); ::: +## Usar expresiones de clase + Como se mencionó anteriormente, también puedes definir clases como una expresión de clase. Aquí es donde la clase es anónima y se asigna a una variable. Aquí está cómo se ve el ejemplo anterior como una expresión de clase: diff --git a/curriculum/challenges/espanol/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/673403ca2bb16658309e3632.md b/curriculum/challenges/espanol/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/673403ca2bb16658309e3632.md index 70bec49c9d5..6eea77677b4 100644 --- a/curriculum/challenges/espanol/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/673403ca2bb16658309e3632.md +++ b/curriculum/challenges/espanol/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/673403ca2bb16658309e3632.md @@ -11,6 +11,8 @@ Aprendiste que las clases son como planos que puedes usar para crear objetos. Estos planos necesitan una manera general de referirse al objeto específico que se está creando, accediendo o modificando dentro del código. Eso es exactamente para lo que se usa la palabra clave `this`. Se refiere al contexto donde se supone que el código debe ejecutarse. Si lo usas dentro de un método, el valor de `this` será una referencia al objeto asociado a ese método. De esta manera, puedes acceder a las propiedades y métodos del objeto dentro de la clase y reutilizar el método en diferentes objetos. +## Constructores + Por ejemplo, aquí tenemos una clase `Dessert`. Esta vez, estamos definiendo una propiedad `hasPeanuts`. ```js @@ -33,6 +35,8 @@ this.hasPeanuts = hasPeanuts; Eso en el contexto del constructor, pero también puedes usar la palabra clave `this` dentro de otros métodos. +## Métodos + Esta es nuestra clase `Dessert` con algunos cambios. Ahora tenemos dos propiedades: `name` y `price`. ```js @@ -91,10 +95,16 @@ El nombre y el precio del objeto actual (`brownie`) se reemplazan en la cadena. Todo esto es gracias a la palabra clave `this`, que te da una forma general de referirte al objeto actual dentro de la clase. Esto te permite reutilizar el método en diferentes objetos. +## Funciones y funciones flecha + Esto es en el contexto de métodos de objetos, pero la palabra clave `this` también tendrá un valor en funciones independientes y funciones flecha. +### Funciones regulares + Su valor dentro de una función independiente típicamente se refiere al objeto global (en modo no estricto) o `undefined` (en modo estricto). +### Funciones flecha + El valor de la palabra clave `this` es un poco diferente en las funciones flecha. Las funciones flecha heredan el valor de `this` del ámbito que las envuelve donde se definen. No crean su propia vinculación de `this`. Eso significa que el valor de `this` depende del contexto donde se define la función flecha, no del lugar o cómo se llama a la función flecha. Esto hace que las funciones flecha sean útiles para callbacks o para preservar el contexto. Sin embargo, debido a esto, el valor de `this` no se referirá al objeto actual en métodos de objeto, por lo que debes tenerlo en cuenta al trabajar con funciones flecha. diff --git a/curriculum/challenges/espanol/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5160.md b/curriculum/challenges/espanol/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5160.md index 15f437438ca..0da6a0fd602 100644 --- a/curriculum/challenges/espanol/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5160.md +++ b/curriculum/challenges/espanol/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5160.md @@ -14,17 +14,17 @@ Sin embargo, bajo esas diferencias, el proceso de convertir una idea en un está 1. ## Identificar una necesidad Los estándares comienzan con fricciones, como desarrolladores que se topan con un muro, navegadores que implementan el mismo comportamiento de formas incompatibles o una nueva capacidad que la plataforma simplemente aún no soporta. Alguien, en algún lugar, se frustra lo suficiente como para escribirlo. Esa persona puede ser cualquiera; un desarrollador, una empresa grande con una necesidad de producto o un ingeniero dentro de un equipo de navegador. Lo que importa en esta etapa no es la autoridad, sino la evidencia y las preguntas sobre si el problema es real y si suficientes personas lo enfrentan para justificar la atención de la plataforma web. -1. **Propuesta y discusión inicial** - La idea se redacta informalmente mediante un issue de GitHub, un documento corto o un explicador que describe el problema y bosqueja una posible solución. En esta etapa, el objetivo no es producir una especificación terminada sino descubrir si el problema resuena. ¿Otros desarrolladores lo reconocen? ¿Los proveedores de navegadores están interesados? ¿Hay una solución obvia o varias en competencia? En TC39, esta fase temprana corresponde a la etapa 0 y etapa 1. En el W3C, suele ocurrir informalmente en un grupo comunitario antes de que se cree un grupo de trabajo formal. WHATWG lo maneja mediante discusiones abiertas en GitHub en sus repositorios principales. El lugar varía, pero la función es la misma. +1. ## Propuesta y discusión inicial + La idea se escribe de forma informal mediante un issue en GitHub, un documento corto o un explicador que describe el problema y bosqueja una posible solución. En esta etapa, el objetivo no es producir una especificación terminada sino descubrir si el problema resuena. ¿Lo reconocen otros desarrolladores? ¿Están interesados los proveedores de navegadores? ¿Hay una solución obvia o varias en competencia? En TC39, esta fase temprana corresponde a la etapa 0 y la etapa 1. En el W3C, suele ocurrir de forma informal en un grupo comunitario antes de que se cree un grupo de trabajo formal. El WHATWG lo maneja a través de discusiones abiertas en GitHub en sus repositorios principales. El lugar varía, pero la función es la misma. -1. **Redacción de la especificación** - Si la propuesta gana tracción, alguien o un pequeño equipo debe escribir la especificación real, o spec. Una spec no es un post de blog ni un tutorial, sino un documento preciso y formal que describe exactamente cómo debe comportarse una funcionalidad en cada situación posible. Se deben considerar y documentar casos límite, condiciones de error, interacciones con funcionalidades existentes e implicaciones de seguridad. +1. ## Redacción de la especificación + Si la propuesta gana tracción, alguien o un pequeño equipo debe escribir la especificación real, o spec. Una spec no es una publicación de blog ni un tutorial, sino un documento preciso y formal que describe exactamente cómo debe comportarse una funcionalidad en cada situación posible. Se deben considerar y documentar casos límite, condiciones de error, interacciones con funcionalidades existentes e implicaciones de seguridad. -1. **Revisión, objeciones e iteración** - El borrador se publica y revisa públicamente y por otros proveedores de navegadores. Aquí es donde ocurre la mayor parte del trabajo real. Se plantean objeciones y la spec se revisa. Una funcionalidad que un motor de navegador importante se niega a implementar rara vez se convierte en estándar, sin importar sus méritos técnicos. Construir consenso en esta etapa puede tomar mucho tiempo. Algunas propuestas se estancan durante años mientras los proveedores negocian detalles de diseño. Otras mueren completamente cuando queda claro que no se puede alcanzar un acuerdo. +1. ## Revisión, objeción e iteración + El borrador se publica y revisa públicamente, y por otros proveedores de navegadores. Aquí es donde ocurre la mayor parte del trabajo real. Se plantean objeciones y la spec se revisa. Una funcionalidad que un motor de navegador importante se niega a implementar rara vez se convierte en estándar, sin importar sus méritos técnicos. Construir consenso en esta etapa puede tomar mucho tiempo. Algunas propuestas se estancan durante años mientras los proveedores negocian detalles de diseño. Otras mueren completamente cuando queda claro que no se puede alcanzar un acuerdo. -1. **Implementación y pruebas** - Una vez que una spec es lo suficientemente estable, los proveedores de navegadores comienzan a implementarla. Esto suele empezar con una bandera de funcionalidad para que pueda probarse sin afectar a los usuarios existentes. La implementación a menudo revela problemas que la spec no anticipó, los cuales se envían de vuelta a los editores para aclaración. Un conjunto de pruebas compartido verifica que cada implementación realmente se comporte igual. Si Chrome, Firefox y Safari pasan las mismas pruebas, la spec funciona. Si divergen, o la spec es ambigua o alguna implementación tiene un bug. +1. ## Implementación y pruebas + Una vez que una spec es lo suficientemente estable, los proveedores de navegadores comienzan a implementarla. Esto generalmente empieza con una bandera de funcionalidad, para que pueda probarse sin afectar a los usuarios existentes. La implementación a menudo revela problemas que la spec no anticipó, los cuales se envían de vuelta a los editores para aclaración. Un conjunto de pruebas compartido verifica que cada implementación se comporte de la misma manera. Si Chrome, Firefox y Safari pasan las mismas pruebas, la spec funciona. Si divergen, o la spec es poco clara o alguna implementación tiene un bug. 1. ## Finalización Cuando existen múltiples implementaciones independientes, las pruebas se aprueban y la comunidad está satisfecha, el estándar se finaliza. En el W3C esto significa alcanzar el estatus de recomendación. En TC39, significa llegar a la etapa 4, tras lo cual la funcionalidad se incluye en la siguiente versión anual de ECMAScript. En WHATWG no hay un momento único de finalización, el estándar vivo simplemente refleja el consenso actual, actualizado continuamente. Todo el proceso puede tomar desde unos meses para una adición pequeña y sin controversias hasta más de una década para algo complejo o políticamente delicado. CSS Grid, por ejemplo, se propuso por primera vez en 2011 y no se implementó en todos los navegadores principales hasta 2017. Ese espacio entre una buena idea y un estándar estable y universalmente soportado es donde ocurre la mayor parte del trabajo silencioso de la web abierta. diff --git a/curriculum/challenges/espanol/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5161.md b/curriculum/challenges/espanol/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5161.md index f8aca8f9876..c8c2880cd63 100644 --- a/curriculum/challenges/espanol/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5161.md +++ b/curriculum/challenges/espanol/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5161.md @@ -13,23 +13,23 @@ El ciclo de vida de una funcionalidad de estándar web está relacionado, pero a Piensa en el proceso como el reglamento, y el ciclo de vida como lo que realmente sucede cuando juegas el juego. -1. **Propuesta** - Cada funcionalidad comienza con un problema que alguien consideró lo suficientemente importante para escribir. Un desarrollador, un ingeniero de navegador o una empresa crea un issue en GitHub o un explainer describiendo qué no puede hacer la web actualmente y por qué debería poder hacerlo. En esta etapa, la idea es vaga, con más preguntas que respuestas. El objetivo es simplemente descubrir si alguien más reconoce el mismo problema. +1. ## Propuesta + Cada funcionalidad comienza con un problema que alguien consideró lo suficientemente importante para escribirlo. Un desarrollador, un ingeniero de navegador o una empresa presenta un problema o una explicación en GitHub describiendo lo que la web no puede hacer actualmente y por qué debería poder hacerlo. En esta etapa, la idea es vaga, con más preguntas que respuestas. El objetivo es simplemente descubrir si alguien más reconoce el mismo problema. -1. **Incubación** - Si la propuesta resuena, entra en un período de discusión abierta y diseño temprano. Se bosquejan enfoques competidores, se recopilan casos de uso y la comunidad pone a prueba la idea. Muchas propuestas mueren aquí, posiblemente porque el problema resulta ser demasiado específico o ninguna solución satisface a todos. Las que sobreviven emergen con una forma más clara y al menos algo de interés por parte de algún proveedor de navegador. +1. ## Incubación + Si la propuesta resuena, entra en un período de discusión abierta y diseño inicial. Se bosquejan enfoques competidores, se recopilan casos de uso y la comunidad pone a prueba la idea. Muchas propuestas mueren aquí, posiblemente porque el problema resulta ser demasiado específico o ninguna solución satisface a todos. Las que sobreviven emergen con una forma más clara y al menos algo de interés por parte de algún proveedor de navegador. -1. **Especificación** +1. ## Especificación Una propuesta que sobrevive se redacta como una especificación formal. Cada caso límite, condición de error e interacción con funcionalidades existentes debe definirse claramente. Este es el punto donde una buena idea se enfrenta a la realidad dura. Los conceptos vagos deben convertirse en reglas exactas que dos ingenieros independientes puedan leer e implementar de forma idéntica. -1. **Pruebas de interoperabilidad** - Antes de que una funcionalidad pueda considerarse estable, debe comportarse igual en todos los navegadores. El conjunto de pruebas W3C Web Platform Tests es la herramienta principal para verificar esto. Es una batería compartida de pruebas que Chrome, Firefox, Safari y otros ejecutan contra sus implementaciones. Resultados divergentes significan que la especificación es ambigua o que alguien tiene un bug. Cualquiera de los dos debe resolverse antes de que la funcionalidad avance. +1. ## Pruebas de interoperabilidad + Antes de que una funcionalidad pueda considerarse estable, debe comportarse igual en todos los navegadores. La suite W3C Web Platform Tests es la herramienta principal para verificar esto. Es un conjunto compartido de pruebas que Chrome, Firefox, Safari y otros ejecutan contra sus implementaciones. Resultados divergentes significan que la especificación es ambigua o que alguien tiene un bug. Cualquiera de los dos debe resolverse antes de que la funcionalidad avance. -1. **Finalización** +1. ## Finalización Una vez que múltiples implementaciones independientes pasan las pruebas, la funcionalidad se finaliza. Para W3C, es una recomendación; para TC39, es la etapa 4; y es una entrada estable en el estándar vivo de WHATWG. Las banderas se retiran y la funcionalidad se lanza a los usuarios. En este punto, se convierte en parte de la plataforma web base, algo en lo que todo desarrollador puede confiar indefinidamente. -1. **Desaprobación** - No todos los estándares envejecen bien. Algunas funcionalidades son reemplazadas por mejores, otras resultan tener implicaciones de seguridad o privacidad que no eran evidentes en su momento. Cuando una funcionalidad debe desaparecer, se desaprueba formalmente. Es decir, se sigue soportando pero marcada como algo que los desarrolladores deberían dejar de usar. Eventualmente, se elimina de la especificación. La eliminación de los navegadores es lenta y cautelosa, porque la promesa fundamental de la web es que las páginas antiguas sigan funcionando. Algunas funcionalidades desaprobadas permanecen en los navegadores durante décadas solo por la obligación de compatibilidad hacia atrás. +1. ## Deprecación + No todos los estándares envejecen bien. Algunas funcionalidades son reemplazadas por mejores, otras resultan tener implicaciones de seguridad o privacidad que no eran evidentes en su momento. Cuando una funcionalidad debe desaparecer, se depreca formalmente. Es decir, se sigue soportando pero marcada como algo que los desarrolladores deberían dejar de usar. Eventualmente, se elimina de la especificación. La eliminación en los navegadores es lenta y cautelosa, porque la promesa fundamental de la web es que las páginas antiguas sigan funcionando. Algunas funcionalidades deprecadas permanecen en los navegadores durante décadas solo por la obligación de compatibilidad hacia atrás. # --questions-- diff --git a/curriculum/challenges/espanol/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5162.md b/curriculum/challenges/espanol/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5162.md index dfbddf9fee4..eb0f7f29d35 100644 --- a/curriculum/challenges/espanol/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5162.md +++ b/curriculum/challenges/espanol/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5162.md @@ -9,26 +9,26 @@ dashedName: what-are-the-key-principles-that-web-standards-are-built-on Los estándares web no son solo documentos técnicos, reflejan un conjunto de valores sobre qué debería ser la web y a quién debería servir. Entender estos principios te ayuda a ver no solo cómo funciona la web, sino por qué fue construida de esa manera. Vamos a discutir esos principios. -1. **Apertura** - Los estándares web se desarrollan de forma abierta y se implementan sin regalías. Cualquiera puede leer las especificaciones, cualquiera puede construir un navegador, y ninguna empresa puede cobrar tarifas de licencia por implementar un estándar. Esta apertura es lo que distingue a la web de las plataformas propietarias y lo que permite que equipos pequeños creen herramientas que lleguen a miles de millones de personas sin pedir permiso a un guardián. +1. ## Apertura + Los estándares web se desarrollan de forma abierta y se implementan sin regalías. Cualquiera puede leer las especificaciones, cualquiera puede crear un navegador, y ninguna empresa puede cobrar tarifas de licencia por implementar un estándar. Esta apertura es lo que distingue la web de las plataformas propietarias y lo que permite que equipos pequeños construyan herramientas que llegan a miles de millones de personas sin pedir permiso a un guardián. -1. **Accesibilidad** - La web fue diseñada para ser usable por todos, sin importar la capacidad. La accesibilidad no es un complemento a los estándares web, está integrada en el diseño de HTML, CSS y el comportamiento del navegador. Las pautas WCAG del W3C establecen el estándar formal de lo que significa accesible en la práctica. Una funcionalidad que crea barreras para personas que usan lectores de pantalla, navegación por teclado o tecnología de asistencia se considera deficiente por diseño, no solo por ética. +1. ## Accesibilidad + La web fue diseñada para ser usable por todos, sin importar la capacidad. La accesibilidad no es un complemento de los estándares web, está integrada en el diseño de HTML, CSS y el comportamiento del navegador. Las directrices WCAG del W3C establecen el estándar formal de lo que significa accesible en la práctica. Una funcionalidad que crea barreras para personas que usan lectores de pantalla, navegación por teclado o tecnología de asistencia se considera deficiente por diseño, no solo por ética. -1. **Interoperabilidad** - El principio más fundamental es que la web debería funcionar igual en todas partes. Una página construida según el estándar debería comportarse idénticamente en Chrome, Firefox y Safari, y en Windows, macOS, Linux, Android e iOS. Sin interoperabilidad, la web se fragmenta en una colección de experiencias específicas de navegador, y los desarrolladores se ven obligados a escribir lo mismo varias veces. Cada estándar existe, en su núcleo, para evitar eso. +1. ## Interoperabilidad + El principio más fundamental es que la web debe funcionar igual en todas partes. Una página construida según el estándar debe comportarse idénticamente en Chrome, Firefox y Safari, y en Windows, macOS, Linux, Android e iOS. Sin interoperabilidad, la web se fragmenta en una colección de experiencias específicas de cada navegador, y los desarrolladores se ven obligados a escribir lo mismo varias veces. Cada estándar existe, en su esencia, para evitar eso. -1. **Compatibilidad hacia atrás** - La web tiene un compromiso casi absoluto de no romper cosas antiguas. Una página escrita en 1999 debería seguir renderizándose en un navegador moderno, y los organismos de estándares toman esta obligación en serio al diseñar nuevas funcionalidades. Por eso las nuevas capacidades se agregan encima en lugar de reemplazar lo anterior. Es una restricción que a veces frustra a los diseñadores, pero también es lo que hace que la web sea una plataforma especialmente duradera. +1. ## Compatibilidad hacia atrás + La web tiene un compromiso casi absoluto de no romper cosas antiguas. Una página escrita en 1999 debería seguir renderizándose en un navegador moderno, y los organismos de estándares toman esta obligación en serio al diseñar nuevas funcionalidades. Por eso las nuevas capacidades se agregan encima en lugar de reemplazar lo anterior. Es una restricción que a veces frustra a los diseñadores, pero también es lo que hace que la web sea una plataforma excepcionalmente duradera. -1. **Privacidad y seguridad** - Los estándares modernos se revisan por sus implicaciones de privacidad y seguridad antes de ser lanzados. Las nuevas APIs que podrían exponer datos de usuarios o permitir seguimiento enfrentan un escrutinio significativo en el proceso de estándares. El principio es que la plataforma debe proteger a los usuarios por defecto, y que la conveniencia para los desarrolladores nunca debe estar a costa de la seguridad del usuario. +1. ## Privacidad y seguridad + Los estándares modernos se revisan por sus implicaciones de privacidad y seguridad antes de ser lanzados. Las nuevas APIs que podrían exponer datos de usuarios o permitir el seguimiento enfrentan un escrutinio significativo en el proceso de estándares. El principio es que la plataforma debe proteger a los usuarios por defecto, y que la conveniencia para los desarrolladores nunca debe estar a costa de la seguridad del usuario. -1. **Capas** - La web está construida en capas distintas y componibles: HTML para la estructura, CSS para la presentación y JavaScript para el comportamiento. Los estándares están diseñados para respetar estos límites en lugar de colapsarlos. Una funcionalidad bien estructurada en capas puede adoptarse de forma incremental. Una página que no usa JavaScript sigue funcionando, y un navegador que no soporta una nueva propiedad CSS sigue renderizando algo razonable. Esta separación de responsabilidades es lo que da resiliencia a la web. +1. ## Capas + La web se construye en capas distintas y componibles: HTML para la estructura, CSS para la presentación y JavaScript para el comportamiento. Los estándares están diseñados para respetar estos límites en lugar de colapsarlos. Una funcionalidad bien estructurada en capas puede adoptarse de forma incremental. Una página que no usa JavaScript sigue funcionando, y un navegador que no soporta una nueva propiedad CSS aún renderiza algo razonable. Esta separación de responsabilidades es lo que da resiliencia a la web. -1. **Mejora progresiva** - Muy relacionado con las capas está la idea de que la web debería funcionar para todos y luego mejorar para quienes tienen navegadores o dispositivos más capaces. Una funcionalidad estándar debería degradarse elegantemente cuando no es soportada, no romperse por completo. Este principio guía cómo se especifican nuevas propiedades CSS, cómo las APIs de JavaScript manejan capacidades faltantes y cómo los organismos de estándares piensan en la brecha entre navegadores modernos y los más antiguos que aún se usan ampliamente en el mundo. +1. ## Mejora progresiva + Muy relacionado con las capas está la idea de que la web debe funcionar para todos y luego mejorar para quienes tienen navegadores o dispositivos más capaces. Una funcionalidad estándar debe degradarse de forma elegante cuando no es compatible, no romperse por completo. Este principio influye en cómo se especifican las nuevas propiedades CSS, cómo las APIs de JavaScript manejan capacidades faltantes y cómo los organismos de estándares consideran la brecha entre navegadores modernos y los más antiguos que aún se usan ampliamente en el mundo. # --questions-- @@ -50,7 +50,7 @@ Compatibilidad hacia atrás. --- -Mejora progresiva. +Mejoras progresivas. ### --feedback-- diff --git a/curriculum/challenges/espanol/blocks/lecture-user-interface-design-fundamentals/672baa97f2990e6631d522e7.md b/curriculum/challenges/espanol/blocks/lecture-user-interface-design-fundamentals/672baa97f2990e6631d522e7.md index 86e9f3fb889..b400c68d08d 100644 --- a/curriculum/challenges/espanol/blocks/lecture-user-interface-design-fundamentals/672baa97f2990e6631d522e7.md +++ b/curriculum/challenges/espanol/blocks/lecture-user-interface-design-fundamentals/672baa97f2990e6631d522e7.md @@ -9,6 +9,8 @@ dashedName: how-do-you-create-good-background-and-foreground-contrast-in-your-de **NOTA**: Algunos de los ejemplos interactivos podrían usar CSS que aún no has aprendido. No te preocupes por tratar de entender todo el código. El objetivo de los ejemplos es mostrarte vistas previas de estos conceptos de diseño para que entiendas mejor cómo funcionan las cosas. +## Entendiendo el contraste + Primero, es posible que necesites familiarizarte con el contraste. El contraste es la diferencia entre dos colores, o cuán fácil es distinguirlos. Los colores con mayor contraste serán más visualmente distintos, mientras que los de menor contraste serán más visualmente similares. Por ejemplo, el negro y el blanco tienen una relación de contraste muy alta. Mientras que el azul claro y el morado claro tienen menos contraste. @@ -53,6 +55,8 @@ Los colores con mayor contraste serán más visualmente distintos, mientras que ::: +### Aplicar contraste al texto + Por supuesto, en estos ejemplos la distinción puede hacerse más clara debido al diseño. Pero, ¿qué hay de aplicar estos colores al texto? Puedes tener texto negro de alto contraste sobre un fondo blanco. Y texto morado de bajo contraste sobre un fondo azul. :::interactive_editor @@ -96,7 +100,9 @@ Por supuesto, en estos ejemplos la distinción puede hacerse más clara debido a ::: -Pero, ¿cómo determinas cuál es un contraste "suficientemente bueno"? No puedes basarlo solo en cómo el texto te parece, ya que cada usuario tendrá una experiencia diferente. Afortunadamente, las Pautas de Accesibilidad para el Contenido Web, o WCAG, proporcionan un estándar para esto. +### Estándares de contraste WCAG + +Pero, ¿cómo determinas cuál es un contraste "suficientemente bueno"? No puedes basarlo solo en cómo el texto te parece, ya que cada usuario tendrá una experiencia diferente. Afortunadamente, las Pautas de Accesibilidad para el Contenido Web, o WCAG, proporcionan un estándar para esto. El texto con una relación de contraste de 4.5:1 se considera el estándar AA, que es lo mínimo que deberías seguir para ser accesible para la mayoría de los usuarios. El texto con una relación de contraste de 7:1 se considera el estándar AAA y asegura el mejor nivel de accesibilidad. @@ -141,9 +147,11 @@ El texto con una relación de contraste de 4.5:1 se considera el estándar AA, q ::: +### Comparar relaciones de contraste altas y bajas + Hay una gran cantidad de sitios web que pueden verificar la relación de contraste entre dos colores, pero la mayoría de navegadores te permiten hacerlo directamente en las herramientas de desarrollo de tu sitio web. -Veamos algunos ejemplos más de ratio de contraste para entender mejor el concepto. +Veamos algunos ejemplos más de ratio de contraste para entender mejor el concepto. Aquí tienes un ejemplo de texto negro sobre un fondo blanco que tiene una relación de contraste de 21:1. @@ -221,8 +229,12 @@ Este ejemplo cumple con creces el estándar AAA. Ahora, echemos un vistazo al te Este ejemplo tiene una relación de contraste de 1.48:1 que ni siquiera cumple con el estándar AA. +## Ajustar propiedades del color + ¿Cómo puedes arreglar esto? Pues bien, hay tres aspectos que afectan la relación de contraste. +### Ajustar el tono + El primero es el matiz, que representa el tipo general de color, como rojo, azul, naranja. Cambiemos a un matiz que esté más alejado del azul. En este caso, usaremos el rojo. :::interactive_editor @@ -267,6 +279,8 @@ El primero es el matiz, que representa el tipo general de color, como rojo, azul ::: +### Ajustar la saturación + Desafortunadamente, este cambio solo llevó la relación de contraste a 1.49:1, lo que significa que necesitas cambiar la saturación o la "cantidad" de color presente. Aumentemos la cantidad de rojo en el texto. Eso nos acerca mucho más al objetivo, con una relación de contraste de 3.54:1. :::interactive_editor @@ -325,6 +339,8 @@ Desafortunadamente, este cambio solo llevó la relación de contraste a 1.49:1, ::: +### Ajustar la luminosidad + Sin embargo, podrías acercarte aún más cambiando el último valor, que es la claridad. Claridad representa cuánta cantidad de blanco está presente en el color. Disminuyamos la claridad del rojo. Ahora hay un rojo mucho más oscuro contra el fondo azul claro, lo que lleva la relación de contraste a 10.34:1. @@ -439,7 +455,7 @@ Piensa en cómo la lección define el contraste en relación con los colores. ## --text-- -¿Según las Pautas de Accesibilidad para el Contenido Web (WCAG), cuál es la relación mínima de contraste para que el texto cumpla con el estándar AA? +¿Según las Pautas de Accesibilidad para el Contenido Web (WCAG), cuál es la relación mínima de contraste para que el texto cumpla con el estándar AA? ## --answers-- @@ -475,7 +491,7 @@ Recuerda los números específicos mencionados para diferentes estándares de ac ## --text-- -¿Cuál de los siguientes NO se menciona como un aspecto que afecta la relación de contraste? +¿Cuál de los siguientes NO se menciona como un aspecto que afecta la relación de contraste? ## --answers-- @@ -495,7 +511,7 @@ Recuerda los tres aspectos discutidos en la lección que se pueden ajustar para --- -Claridad +Luminosidad ### --feedback-- diff --git a/curriculum/challenges/espanol/blocks/lecture-what-is-css/672acc100d59d24da7b4e09c.md b/curriculum/challenges/espanol/blocks/lecture-what-is-css/672acc100d59d24da7b4e09c.md index d3a638af206..275ebd688fd 100644 --- a/curriculum/challenges/espanol/blocks/lecture-what-is-css/672acc100d59d24da7b4e09c.md +++ b/curriculum/challenges/espanol/blocks/lecture-what-is-css/672acc100d59d24da7b4e09c.md @@ -7,10 +7,14 @@ dashedName: what-are-the-different-types-of-css-combinators # --interactive-- +## Combinadores de CSS + Los combinadores de CSS se utilizan para definir la relación entre selectores en CSS. Ayudan a seleccionar elementos en función de su relación con otros elementos, lo que permite un estilo más preciso y eficiente. Vamos a discutir algunos combinadores CSS principales y sus casos de uso, comenzando con el combinador de descendiente. +### Combinador descendiente + Un combinador descendiente se usa para seleccionar elementos que coinciden con el segundo selector si están anidados dentro de un elemento ancestro que coincide con el primer selector. Un ancestro puede ser un padre, abuelo o cualquier ancestro más arriba en el árbol del documento. Para entender mejor cómo funciona esto, veamos un ejemplo. @@ -42,6 +46,8 @@ En este caso, el `figure` sería el padre y el `img` sería el hijo. Si tuviera múltiples imágenes dentro de un elemento `figure`, usar el combinador de descendiente sería una buena manera de aplicar un borde negro sólido alrededor de cada una de esas imágenes. +### Combinador hijo + Otro tipo de combinador sería el combinador de niño. El combinador hijo (`>`) en CSS se usa para seleccionar elementos que son hijos directos de un elemento padre especificado. @@ -102,6 +108,8 @@ En el ejemplo anterior, solo estamos seleccionando el hijo directo de la clase ` Puesto que los otros dos elementos de párrafo están anidados dentro de elementos `div`, no se consideran hijos directos de la clase `container` y no recibirán el color de texto azul. +### Combinador hermano siguiente + Otro combinador común sería el combinador de siguiente hermano. El combinador de siguiente hermano (`+`) en CSS selecciona un elemento que sigue inmediatamente a un elemento hermano especificado. Este combinador es útil cuando se quiere aplicar estilos a un elemento que sigue directamente a otro elemento, permitiendo un estilo dirigido basado en la posición del elemento relativo a sus hermanos. @@ -150,6 +158,8 @@ img + figcaption { En este ejemplo, el combinador next-sibling (`+`) selecciona el elemento `figcaption` que sigue inmediatamente al elemento `img`. La regla CSS aplicada agrega un `4px solid black border` alrededor del `figcaption`. +### Combinador hermano posterior + Otro combinador común es el combinador de hermano subsiguiente. El combinador de hermano subsiguiente (`~`) en CSS selecciona todos los hermanos de un elemento especificado que vienen después de él. @@ -202,6 +212,8 @@ En este ejemplo, todos los elementos de párrafo que siguen al elemento `h2` ten El combinador de hermano subsiguiente (`~`) apunta a todos los hermanos de párrafo que aparecen después del elemento `h2`, independientemente de si son hermanos inmediatos. +## Por qué importan los combinadores de CSS + En conclusión, entender y usar varios combinadores de CSS te permite aplicar estilos precisos a tus elementos HTML, mejorando el control y flexibilidad de tu diseño. Al dominar estos selectores, puedes crear reglas de estilo más sofisticadas y dirigidas que mejoran tanto la apariencia como la funcionalidad de tus páginas web. diff --git a/curriculum/challenges/espanol/blocks/lecture-working-with-code-editors-and-ides/672d26269456511aa3db614d.md b/curriculum/challenges/espanol/blocks/lecture-working-with-code-editors-and-ides/672d26269456511aa3db614d.md index 4001afcc3c2..655a679e61a 100644 --- a/curriculum/challenges/espanol/blocks/lecture-working-with-code-editors-and-ides/672d26269456511aa3db614d.md +++ b/curriculum/challenges/espanol/blocks/lecture-working-with-code-editors-and-ides/672d26269456511aa3db614d.md @@ -7,25 +7,25 @@ dashedName: what-is-a-code-editor-and-ide # --description-- -Podrías pensar que son lo mismo, pero no lo son. Un editor de código es cualquier aplicación que permite editar archivos de código. Un IDE, o Entorno de Desarrollo Integrado, es una aplicación completa que permite compilar, ejecutar y depurar tu código mientras lo editas. +Podrías pensar que son lo mismo, pero no del todo. Un editor de código es cualquier aplicación que te permite editar archivos de código. Un IDE, o entorno de desarrollo integrado, es una aplicación completa que te permite compilar, ejecutar y depurar tu código mientras lo editas. -Quizás algunos ejemplos sean útiles. +Algunos ejemplos ayudarán. Primero, consideremos algunos IDEs populares. Visual Studio es un entorno de desarrollo integrado de Microsoft que proporciona un conjunto completo de herramientas para construir, depurar y desplegar aplicaciones en varias plataformas. -Otro IDE es XCode. Xcode es un entorno de desarrollo integrado de Apple diseñado para crear, codificar y depurar aplicaciones para macOS, iOS, watchOS y tvOS. +Otro IDE es Xcode. Xcode es un entorno de desarrollo integrado de Apple diseñado para crear, codificar y depurar aplicaciones para macOS, iOS, watchOS y tvOS. -Y otro IDE sería Android Studio. Android Studio es un entorno de desarrollo integrado de Google específicamente diseñado para construir, depurar y probar aplicaciones Android. +Android Studio, desarrollado por Google, es un entorno de desarrollo integrado específicamente diseñado para construir, depurar y probar aplicaciones Android. Esos son solo algunos ejemplos de IDEs. Ahora, echemos un vistazo a algunos editores de código populares. Visual Studio Code es un editor de código ligero y de código abierto de Microsoft que admite una amplia gama de lenguajes de programación y proporciona características como depuración, resaltado de sintaxis y control de versiones a través de extensiones. -Otro editor popular sería Sublime Text. Sublime Text es un editor de texto rápido y versátil conocido por su interfaz elegante, características poderosas y soporte para una amplia gama de lenguajes de programación a través de resaltado de sintaxis personalizable y plugins. +Para una experiencia de edición rápida y versátil, Sublime Text ofrece una interfaz elegante y soporte para una amplia variedad de lenguajes de programación mediante resaltado de sintaxis personalizable y plugins. -Y otro es Notepad++. Este es un editor de texto y código fuente gratuito y de código abierto para Windows que ofrece resaltado de sintaxis, plegado de código, y una gama de plugins para mejorar la productividad y personalización. +Los usuarios de Windows también pueden usar Notepad++, un editor de texto y código fuente gratuito y de código abierto que ofrece resaltado de sintaxis, plegado de código y una variedad de plugins para mejorar la productividad y personalización. -Puedes haber notado cómo los editores de código se centran principalmente en el contenido de texto del archivo, donde los IDEs exponen varias herramientas para gestionar el código. +Quizás hayas notado que los editores de código se enfocan principalmente en el contenido de texto del archivo, mientras que los IDE exponen varias herramientas para gestionar tu código. Estos ejemplos son todos programas locales que puedes ejecutar en tu computadora, pero también existen editores basados en la nube que puedes usar. @@ -35,11 +35,11 @@ Echemos un vistazo a algunos editores basados en la nube. Replit es una plataforma en línea que proporciona un entorno colaborativo para la codificación, permitiendo a los usuarios escribir, ejecutar y compartir código en varios lenguajes de programación directamente desde un navegador web. -Otro editor popular basado en la nube es GitHub Codespaces. Este es un entorno de desarrollo basado en la nube que proporciona acceso instantáneo a un editor de código completamente configurado y a herramientas de desarrollo directamente desde GitHub, permitiendo una codificación y colaboración sin problemas. +Otro editor popular basado en la nube es GitHub Codespaces. Este es un entorno de desarrollo en la nube que proporciona acceso instantáneo a un editor de código completamente configurado y herramientas de desarrollo directamente desde GitHub, facilitando la codificación y colaboración sin interrupciones. -Y otro es Ona. Ona es un entorno de desarrollo basado en la nube que se integra con GitHub y GitLab, ofreciendo espacios de trabajo instantáneos y personalizables para codificar, construir y depurar directamente desde tu navegador. +Ona se integra con GitHub y GitLab para ofrecer espacios de trabajo instantáneos y personalizables para codificar, construir y depurar directamente desde tu navegador. -Y hay muchas más opciones. Algunas opciones, como Visual Studio Code, son altamente extensibles y pueden funcionar con múltiples tipos de proyectos y lenguajes. Otras opciones podrían estar específicamente adaptadas a un pequeño subconjunto de lenguajes o tipos de proyectos. +Y hay muchas más opciones. Algunas, como Visual Studio Code, son altamente extensibles y pueden trabajar con muchos tipos de proyectos y lenguajes. Otras opciones podrían estar específicamente diseñadas para un pequeño subconjunto de lenguajes o tipos de proyectos. La aplicación que uses puede ser diferente para proyectos específicos. Deberías explorar las opciones para ver qué funcionará mejor para tus necesidades. diff --git a/curriculum/challenges/espanol/blocks/lecture-working-with-code-editors-and-ides/672d45583fd75a504136fbbb.md b/curriculum/challenges/espanol/blocks/lecture-working-with-code-editors-and-ides/672d45583fd75a504136fbbb.md index 5508b753f97..4eb6b680d90 100644 --- a/curriculum/challenges/espanol/blocks/lecture-working-with-code-editors-and-ides/672d45583fd75a504136fbbb.md +++ b/curriculum/challenges/espanol/blocks/lecture-working-with-code-editors-and-ides/672d45583fd75a504136fbbb.md @@ -7,11 +7,11 @@ dashedName: how-to-install-visual-studio-code-onto-your-computer # --description-- -Para instalar VS Code, querrás visitar su sitio web para obtener el instalador apropiado para tu sistema operativo. Asegúrate de visitar el sitio web de VS Code y no el de Visual Studio. +Para instalar VS Code, debes visitar el sitio web de VS Code para obtener el instalador adecuado para tu sistema operativo. Asegúrate de visitar el sitio web de VS Code, y no el de Visual Studio. -Para Windows, puedes descargar un instalador EXE. Una vez descargado, ejecuta el archivo y el asistente de configuración te guiará durante el proceso de instalación. +Para Windows, puedes descargar un instalador EXE. Una vez que lo hayas descargado, ejecuta el archivo y el asistente de instalación te guiará durante el proceso. -Para Mac, puedes descargar un archivo zip que contiene un `.app` que puedes ejecutar. También puedes instalar VS Code a través de homebrew. +Para Mac, puedes descargar un archivo `.zip`, que contiene un `.app` que puedes ejecutar. También puedes instalar VS Code mediante Homebrew. Abre la aplicación Terminal en tu Mac y ejecuta el siguiente comando: diff --git a/curriculum/challenges/espanol/blocks/lecture-working-with-code-editors-and-ides/672d45651d83b450801efb3a.md b/curriculum/challenges/espanol/blocks/lecture-working-with-code-editors-and-ides/672d45651d83b450801efb3a.md index 54c3cd0fbe7..bc25ab72e51 100644 --- a/curriculum/challenges/espanol/blocks/lecture-working-with-code-editors-and-ides/672d45651d83b450801efb3a.md +++ b/curriculum/challenges/espanol/blocks/lecture-working-with-code-editors-and-ides/672d45651d83b450801efb3a.md @@ -9,15 +9,15 @@ dashedName: how-to-create-a-project-and-run-your-code-locally-in-vs-code Para comenzar, debes saber que VS Code considera los proyectos como "workspaces". El workspace es el directorio que abriste en VS Code. -Para comenzar, necesitarás usar una interfaz de línea de comandos para crear un nuevo directorio para tu nuevo proyecto. Un directorio es otro nombre para la carpeta. +Para comenzar, necesitarás usar una interfaz de línea de comandos para crear una nueva carpeta para tu nuevo proyecto. Un directorio es otro nombre para una carpeta. -Las interfaces de línea de comandos, o CLI para abreviar, te permiten interactuar con tu sistema operativo mediante comandos basados en texto. Aprenderás más sobre estas herramientas en lecciones futuras. +Las interfaces de línea de comandos, o CLI para abreviar, te permiten interactuar con tu sistema operativo mediante comandos basados en texto. Aprenderás más sobre estas herramientas en futuras lecciones. Si estás en Windows, puedes usar el Command Prompt o PowerShell. Si estás en una Mac, puedes abrir tu aplicación Terminal. -Una vez que la línea de comandos esté abierta, navega al directorio principal escribiendo el comando `cd ~` y presionando `enter` en tu teclado. Then type in the `mkdir my-project` command and hit `enter`. `mkdir`, or "make directory" is the command used to create a new directory. Deberías luego abrir tu nuevo directorio con VS Code. +Una vez que la línea de comandos esté abierta, navega a tu directorio personal. En el Command Prompt, escribe `cd /d %USERPROFILE%` y presiona `Enter` en tu teclado. En PowerShell o en el Terminal de macOS, escribe `cd ~` y presiona `Enter`. Luego escribe el comando `mkdir my-project` y presiona `Enter`. `mkdir`, o "make directory", es el comando usado para crear un nuevo directorio. Después deberías abrir tu nuevo directorio con VS Code. -También hay algunas otras formas gráficas de crear un nuevo directorio. +También hay otras formas de abrir un directorio en VS Code. Dependiendo de tu sistema operativo, podrías tener un menú contextual (o una opción de clic derecho) para abrir VS Code directamente desde tu explorador de archivos. También podrías elegir hacer doble clic en la aplicación VS Code. Si te sientes cómodo con la línea de comandos, puedes ejecutar el comando `code /path/to/folder`. @@ -31,15 +31,15 @@ Ahora podrías sentir la tentación de abrir el archivo HTML directamente en tu En su lugar, debes poner tu archivo HTML detrás de un servidor web adecuado. Eso puede sonar como una tarea intimidante si eres nuevo en la codificación, pero en realidad hay una manera de hacer esto directamente desde VS Code. -Primero necesitarás instalar la extensión *Servidor en Vivo*, que está disponible gratis en el marketplace. +Primero necesitarás obtener la extensión Live Server, que está disponible gratis en el marketplace. -Haz clic en la pestaña de extensiones en la esquina izquierda y escribe `Live Server` en la barra de búsqueda. +Haz clic en la pestaña de Extensiones en la barra lateral izquierda y escribe `Live Server` en la barra de búsqueda. -Una vez que hayas instalado esto, deberías ver un botón de `Go live` en tu barra de estado. Asegúrate de tener tu archivo HTML abierto y luego haz clic en él. +Una vez que la tengas instalada, deberías ver un botón `Go Live` en tu barra de estado. Asegúrate de tener abierto tu archivo HTML y luego haz clic en él. -Tu nueva página debería abrirse automáticamente en una nueva pestaña en el navegador. Si no es así, entonces puedes ir directamente a `http://localhost:5500/` +Tu nueva página debería abrirse automáticamente en una nueva pestaña del navegador. Si no es así, puedes ir directamente a `http://localhost:5500/`. -¡Felicidades! Ahora has configurado tu propio proyecto en VS Code, y puedes ver tus cambios con el servidor en vivo. +¡Felicidades! Ahora has configurado tu propio proyecto en VS Code y puedes ver tus cambios con Live Server. # --questions-- @@ -57,7 +57,7 @@ La lección menciona cómo VS Code define un espacio de trabajo en relación con --- -El directorio desde el cual abriste VS Code. +El directorio que abriste en VS Code. --- diff --git a/curriculum/challenges/espanol/blocks/lecture-working-with-code-editors-and-ides/672d456f4ac35950b300e93f.md b/curriculum/challenges/espanol/blocks/lecture-working-with-code-editors-and-ides/672d456f4ac35950b300e93f.md index aedc44408e5..43de7476505 100644 --- a/curriculum/challenges/espanol/blocks/lecture-working-with-code-editors-and-ides/672d456f4ac35950b300e93f.md +++ b/curriculum/challenges/espanol/blocks/lecture-working-with-code-editors-and-ides/672d456f4ac35950b300e93f.md @@ -9,21 +9,21 @@ dashedName: what-are-several-useful-keyboard-shortcuts-for-maximizing-productivi Es probable que ya estés familiarizado con algunos de los atajos básicos, que son heredados de tu sistema operativo. Los atajos como `Ctrl + S` para guardar, `Ctrl + C` para copiar, y `Ctrl + V` para pegar, todos funcionan en VS Code. -Pero hay algunos que son específicos de la aplicación y que aún pueden incrementar tu productividad. Vale la pena mencionar que algunos de estos atajos pueden diferir según el sistema operativo. +Pero hay algunos que son específicos de la aplicación y aún pueden aumentar tu productividad. Vale la pena señalar que algunos de estos atajos pueden variar según el sistema operativo. -Por ejemplo, `Shift + Alt + F` ejecutará tu formateador configurado (como prettier, para un proyecto de JavaScript) en el archivo actualmente abierto. +Por ejemplo, `Shift + Alt + F` ejecutará el formateador configurado (como Prettier, para un proyecto de JavaScript) en el archivo que tienes abierto actualmente. -O `Ctrl + Shift + F` (Windows), o `Cmd + Shift + F` (Mac), para buscar en el contenido de texto de todos los archivos en tu espacio de trabajo. Luego `Ctrl + Shift + H` (Windows), o `Cmd + Shift + H` (Mac), si quieres realizar una búsqueda y reemplazo. +Usa `Ctrl + Shift + F` (Windows/Linux) o `Cmd + Shift + F` (macOS) para buscar el contenido de texto en todos los archivos de tu espacio de trabajo. Luego usa `Ctrl + Shift + H` (Windows/Linux) o `Cmd + Shift + H` (macOS) si quieres hacer una búsqueda y reemplazo. -Si necesitas eliminar una línea, `Ctrl + Shift + K` (Windows), o `Cmd + Shift + K` (Mac), la eliminará. +Si necesitas eliminar una línea, `Ctrl + Shift + K` (Windows/Linux) o `Cmd + Shift + K` (macOS) la borrará. -¿Necesitas un poco más de espacio para todo tu código? `Ctrl + B` (Windows) o `Cmd + B` (Mac) ocultarán la barra lateral, que contiene la lista de archivos y el menú de extensiones. +¿Necesitas más espacio para todo tu código? `Ctrl + B` (Windows) o `Cmd + B` (Mac) ocultará la barra lateral, que contiene la lista de archivos y el menú de extensiones. -¿O tal vez simplemente no puedes ver tu código? `Ctrl + plus` (Windows), o `Cmd + plus` (Mac), aumentará la escala del editor, y `Ctrl + minus` (Windows), o `Cmd + minus` (Mac), la disminuirá. +¿O tal vez no puedes ver bien tu código? `Ctrl + Plus` (Windows) o `Cmd + Plus` (Mac) aumentará el tamaño del editor, y `Ctrl + Minus` (Windows) o `Cmd + Minus` (Mac) lo reducirá. -Otra función útil en VS Code es la edición en múltiples líneas, que te permite hacer cambios en varias líneas a la vez. Por ejemplo, puedes colocar múltiples cursores usando `Ctrl + Alt + down` y `Ctrl + Alt + up` (Windows/Linux), o `Option + Command + down` y `Option + Command + up` (Mac), para extender el cursor a líneas consecutivas. También puedes presionar y mantener `Alt` (Windows/Linux) o `Option` (Mac) y hacer clic para agregar cursores en líneas separadas donde los necesites. Una vez que los cursores están colocados, todo lo que escribas o elimines se aplicará a todas esas ubicaciones simultáneamente, lo que puede ahorrar mucho tiempo cuando trabajas con código repetitivo. +Otra funcionalidad útil en VS Code es la edición en varias líneas, que te permite hacer cambios en varias líneas a la vez. Por ejemplo, puedes colocar múltiples cursores usando `Ctrl + Alt + Down` y `Ctrl + Alt + Up` (Windows/Linux), o `Option + Cmd + Down` y `Option + Cmd + Up` (Mac), para extender el cursor a líneas consecutivas. También puedes presionar y mantener `Alt` (Windows/Linux) o `Option` (Mac) y hacer clic para agregar cursores en líneas separadas donde los necesites. Una vez colocados los cursores, todo lo que escribas o elimines se aplicará simultáneamente en todas esas ubicaciones, lo que puede ahorrar mucho tiempo cuando trabajas con código repetitivo. -Finalmente, si olvidas alguno de estos atajos, siempre tienes `Ctrl + Shift + P` (Windows), o `Cmd + Shift + P` (Mac), que abre la paleta de comandos para que selecciones lo que necesites. +Finalmente, si olvidas alguno de estos atajos, siempre tienes `Ctrl + Shift + P` (Windows/Linux) o `Cmd + Shift + P` (macOS), que abre la paleta de comandos para que selecciones lo que necesites. Con este conocimiento, y tal vez un poco de práctica, estás en buen camino para convertirte en un usuario avanzado de VS Code. diff --git a/curriculum/challenges/espanol/blocks/lecture-working-with-code-editors-and-ides/672d457bcdd8b350ec2b6254.md b/curriculum/challenges/espanol/blocks/lecture-working-with-code-editors-and-ides/672d457bcdd8b350ec2b6254.md index 28c1d533603..b95efc72f23 100644 --- a/curriculum/challenges/espanol/blocks/lecture-working-with-code-editors-and-ides/672d457bcdd8b350ec2b6254.md +++ b/curriculum/challenges/espanol/blocks/lecture-working-with-code-editors-and-ides/672d457bcdd8b350ec2b6254.md @@ -7,25 +7,25 @@ dashedName: what-are-some-good-vs-code-extensions-you-can-use-in-your-editor # --description-- -*Mejores comentarios* es una extensión que ofrece un resaltado especial para comentarios de código específicos. Por ejemplo, resaltará comentarios "TODO", así como sintaxis para indicar preguntas o advertencias. +Better Comments es una extensión que ofrece un resaltado especial para comentarios específicos en el código. Por ejemplo, destacará los comentarios "TODO", así como la sintaxis para indicar preguntas o advertencias. -*Corrector ortográfico de código* ofrece una indicación cuando has escrito incorrectamente algo en tu código. Dado que está diseñado para archivos de código, tomará en cuenta cosas como camel case. +Code Spell Checker marca las palabras que están mal escritas en tu código. Como está diseñado para archivos de código, tendrá en cuenta cosas como camel case. -*Lente de error* te ayudará a detectar cualquier error resaltado en tu código. En lugar de depender del subrayado que VS Code muestra por defecto, esta extensión resalta toda la línea y muestra el mensaje de error. +Error Lens hace que los errores en tu código sean más difíciles de pasar por alto. En lugar de depender del subrayado que VS Code muestra por defecto, esta extensión resalta toda la línea y muestra el mensaje de error. -*Arcoíris de sangría* añade color a tus diferentes niveles de indentación. En combinación con la colorización de pares de corchetes nativa de VS Code, esto puede ayudar drásticamente a identificar en qué alcance estás en tu código. +Indent Rainbow agrega color a tus diferentes niveles de indentación. En combinación con la colorización nativa de pares de corchetes de VS Code, esto puede ayudar mucho a identificar en qué ámbito está tu código. -¿O tal vez buscas algo un poco más práctico? Considera un asistente de IA, como *GitHub Copilot* o *Tabnine*, para ofrecerte sugerencias en línea a medida que escribes tu código. +¿O tal vez buscas algo un poco más práctico? Considera un asistente de IA, como GitHub Copilot o Tabnine, para ofrecerte sugerencias en línea mientras escribes tu código. -Un paquete de iconos, como *VS Code Great Icons*, puede ayudar a que tu árbol de archivos sea más limpio y más fácil de analizar a simple vista. Y una extensión como *Colorize* puede ayudarte a entender los valores en tus propiedades CSS. +Un paquete de íconos, como VS Code Great Icons, puede ayudar a que tu árbol de archivos sea más limpio y fácil de interpretar de un vistazo. Y una extensión como Colorize puede ayudarte a entender los valores en tus propiedades CSS. -También querrás extensiones específicas del lenguaje para tus proyectos. Si estás usando JavaScript, probablemente querrás *ESLint* y *Prettier* para corregir y dar formato a tu código. Si estás usando TypeScript, tal vez quieras *Pretty TypeScript Errors* para mensajes más fáciles de leer. +También querrás extensiones específicas para el lenguaje de tus proyectos. Si usas JavaScript, probablemente querrás ESLint y Prettier para analizar y formatear tu código. Si usas TypeScript, podrías querer Pretty TypeScript Errors para mensajes más fáciles de leer. -Finalmente, también puedes divertirte un poco con tu editor. *VS Code Pets* ofrece mascotas virtuales configurables para hacerte compañía mientras aplastas algunos bugs. +Finalmente, también puedes divertirte un poco con tu editor. VS Code Pets ofrece mascotas virtuales configurables para hacerte compañía mientras corriges algunos bugs. -*Modo de energía* creará efectos llamativos cuando logres un "combo" lo suficientemente alto escribiendo más código. +Power Mode creará efectos llamativos cuando logres un "combo" lo suficientemente alto escribiendo más código. -*Presencia en Discord* te permitirá mostrar a todos tus amigos en qué estás trabajando. +Discord Presence te permitirá mostrar a todos tus amigos en qué estás trabajando. Y hay muchas más extensiones allá afuera. Siéntete libre de explorar el mercado de extensiones y ver qué funciona mejor para ti. @@ -33,7 +33,7 @@ Y hay muchas más extensiones allá afuera. Siéntete libre de explorar el merca ## --text-- -¿Qué característica proporciona la extensión "Mejores comentarios" en VS Code? +¿Qué funcionalidad ofrece la extensión Better Comments en VS Code? ## --answers-- @@ -69,7 +69,7 @@ La lección menciona cómo esta extensión afecta ciertos tipos de comentarios. ## --text-- -¿Qué extensión de VS Code se describe como ayudante para detectar errores resaltados en tu código mostrando el mensaje de error en toda la línea? +¿Qué extensión de VS Code resalta toda la línea y muestra el mensaje de error en línea, en lugar de depender del subrayado predeterminado? ## --answers-- @@ -105,7 +105,7 @@ La lección menciona una extensión que mejora la visibilidad de errores más al ## --text-- -¿Qué característica única ofrece la extensión "VS Code Pets"? +¿Qué funcionalidad única ofrece la extensión VS Code Pets? ## --answers-- diff --git a/curriculum/challenges/espanol/blocks/lecture-working-with-css-flexbox/672aa7f7284b235f46f7d4e9.md b/curriculum/challenges/espanol/blocks/lecture-working-with-css-flexbox/672aa7f7284b235f46f7d4e9.md index c6491f005f1..e4ddcb500e0 100644 --- a/curriculum/challenges/espanol/blocks/lecture-working-with-css-flexbox/672aa7f7284b235f46f7d4e9.md +++ b/curriculum/challenges/espanol/blocks/lecture-working-with-css-flexbox/672aa7f7284b235f46f7d4e9.md @@ -319,7 +319,7 @@ El eje principal siempre es horizontal, mientras que el eje transversal siempre ### --feedback-- -Piensa en la distribución de elementos dentro de un contenedor flex. +Piensa en cómo se posicionan el eje principal y el eje transversal en relación uno con el otro. --- @@ -327,7 +327,7 @@ El eje principal siempre es vertical, mientras que el eje transversal siempre es ### --feedback-- -Piensa en la distribución de elementos dentro de un contenedor flex. +Piensa en cómo se posicionan el eje principal y el eje transversal en relación uno con el otro. --- @@ -339,7 +339,7 @@ El eje principal y el eje transversal siempre son paralelos entre sí. ### --feedback-- -Piensa en la distribución de elementos dentro de un contenedor flex. +Piensa en cómo se posicionan el eje principal y el eje transversal en relación uno con el otro. ## --video-solution-- diff --git a/curriculum/challenges/espanol/blocks/lecture-working-with-css-flexbox/672bd658c0e190f674a5e057.md b/curriculum/challenges/espanol/blocks/lecture-working-with-css-flexbox/672bd658c0e190f674a5e057.md index 805ef1dfa5d..d64e4b6eeed 100644 --- a/curriculum/challenges/espanol/blocks/lecture-working-with-css-flexbox/672bd658c0e190f674a5e057.md +++ b/curriculum/challenges/espanol/blocks/lecture-working-with-css-flexbox/672bd658c0e190f674a5e057.md @@ -7,11 +7,11 @@ dashedName: what-are-some-common-flex-properties # --interactive-- -Las propiedades flex son propiedades que se pueden aplicar a contenedores flex para determinar la distribución de los elementos secundarios. Cubriremos algunas de las más usadas: `flex-wrap`, `justify-content`, y `align-items`. +Las propiedades flex controlan cómo se comportan los elementos dentro de un diseño flexible, desde la distribución a nivel de contenedor hasta la autoalineación a nivel de elemento. En esta lección cubriremos algunas de las más comúnmente usadas: `flex-wrap`, `flex-flow`, `justify-content`, `align-items` y `align-self`. Comencemos con `flex-wrap`. Esta propiedad determina cómo se envuelven los elementos flexibles dentro de un contenedor flexible para ajustarse al espacio disponible. `flex-wrap` puede tomar tres valores posibles: `nowrap`, `wrap` y `wrap-reverse`. `nowrap` es el valor predeterminado: los elementos flexibles no se envolverán en una nueva línea, incluso si su ancho excede el ancho del contenedor. -En el código a continuación, tenemos tres elementos `div`. Enfoquémonos en el `width`. El contenedor `main` bordeado en rojo tiene un `width` de `200px`, mientras que sus tres elementos secundarios `div` combinados tienen un `width` de `240px` (`80px` cada uno): +En el código a continuación, tenemos tres elementos `div`. Centrémonos en el `width`. El contenedor `main` con borde tiene un `width` de `200px`, mientras que sus tres elementos `div` hijos combinados tienen un `width` de `240px` (`80px` cada uno): :::interactive_editor @@ -28,7 +28,7 @@ En el código a continuación, tenemos tres elementos `div`. Enfoquémonos en el main { width: 200px; display: flex; - border: 2px solid red; + border: 2px solid #444; } div { @@ -51,7 +51,6 @@ div { ::: - El ancho de los elementos `div` excede el ancho de su contenedor, pero por defecto se reducirán para ajustarse al espacio disponible. Si quieres que se envuelvan cuando exceden el ancho de su contenedor, puedes establecer `flex-wrap: wrap` en el contenedor flex: :::interactive_editor @@ -70,7 +69,7 @@ main { width: 200px; display: flex; flex-wrap: wrap; - border: 2px solid red; + border: 2px solid #444; } div { @@ -109,9 +108,10 @@ Los elementos `div` se reorganizarán en filas cuando excedan el ancho de su con ```css main { width: 200px; + height: 120px; display: flex; flex-flow: column wrap-reverse; - border: 2px solid red; + border: 2px solid #444; } div { @@ -151,7 +151,7 @@ Genial. Now let's talk about `justify-content`. `justify-content` aligns the ch main { display: flex; justify-content: flex-start; - border: 2px solid red; + border: 2px solid #444; } div { @@ -174,7 +174,7 @@ div { ::: -Con `justify-content: flex-end`, los elementos flexibles se alinean al final del eje principal, horizontal o verticalmente. +Con `justify-content: flex-end`, los elementos flexibles se alinean al final del eje principal, horizontal o verticalmente. :::interactive_editor @@ -191,7 +191,7 @@ Con `justify-content: flex-end`, los elementos flexibles se alinean al final del main { display: flex; justify-content: flex-end; - border: 2px solid red; + border: 2px solid #444; } div { @@ -214,7 +214,7 @@ div { ::: -Para centrar los elementos flexibles a lo largo del eje principal, puedes usar `justify-content: center`. +Para centrar los elementos flexibles a lo largo del eje principal, puedes usar `justify-content: center`. :::interactive_editor @@ -231,7 +231,7 @@ Para centrar los elementos flexibles a lo largo del eje principal, puedes usar ` main { display: flex; justify-content: center; - border: 2px solid red; + border: 2px solid #444; } div { @@ -254,7 +254,7 @@ div { ::: -Para distribuir los elementos de manera uniforme a lo largo del eje principal, puedes usar `justify-content: space-between`. Esto añadirá algo de espacio entre los elementos flexibles si es necesario. +Para distribuir los elementos a lo largo del eje principal sin espacio en los bordes, puedes usar `justify-content: space-between`. El primer elemento se sitúa al inicio del eje principal, el último elemento se sitúa al final, y el espacio restante se distribuye entre los elementos adyacentes. :::interactive_editor @@ -271,7 +271,7 @@ Para distribuir los elementos de manera uniforme a lo largo del eje principal, p main { display: flex; justify-content: space-between; - border: 2px solid red; + border: 2px solid #444; } div { @@ -294,7 +294,7 @@ div { ::: -`justify-content: space-around` distribuye los elementos flexibles de manera uniforme dentro del eje principal, añadiendo un espacio antes y después del primer y último elemento. Este espacio adicional es la mitad del espacio entre cada par de elementos adyacentes. Si sólo hay un elemento para distribuir, se centrará. +`justify-content: space-around` distribuye los elementos flexibles de manera uniforme a lo largo del eje principal, agregando un espacio antes del primer elemento y después del último. Este espacio adicional es la mitad del espacio entre cada par de elementos adyacentes. Si solo hay un elemento para distribuir, se centrará. :::interactive_editor @@ -311,7 +311,7 @@ div { main { display: flex; justify-content: space-around; - border: 2px solid red; + border: 2px solid #444; } div { @@ -334,8 +334,7 @@ div { ::: - -Y por último, pero no menos importante, tenemos `justify-content: space-evenly`, que distribuye los elementos de manera uniforme a lo largo del eje principal. El espacio entre los elementos y el espacio antes y después de los primeros y últimos elementos, es exactamente el mismo: +Y por último, pero no menos importante, tenemos `justify-content: space-evenly`, que distribuye los elementos de manera uniforme a lo largo del eje principal. El espacio entre los elementos y el espacio antes y después del primer y último elemento son exactamente iguales: :::interactive_editor @@ -352,7 +351,7 @@ Y por último, pero no menos importante, tenemos `justify-content: space-evenly` main { display: flex; justify-content: space-evenly; - border: 2px solid red; + border: 2px solid #444; } div { @@ -375,7 +374,7 @@ div { ::: -Genial. Ahora sabes cómo distribuir los elementos flex dentro del eje principal. Pero también puede que quieras distribuirlos a lo largo del eje transversal. Recuerda que el eje transversal es perpendicular al eje principal. Puedes hacer esto con la propiedad `align-items`. Para centrar los elementos a lo largo del eje transversal, sólo necesitas agregar `align-items: center` al contenedor flex: +Genial. Ahora sabes cómo distribuir los elementos flex dentro del eje principal. Pero también puede que quieras distribuirlos a lo largo del eje transversal. Recuerda que el eje transversal es perpendicular al eje principal. Puedes hacer esto con la propiedad `align-items`. Para centrar los elementos a lo largo del eje transversal, sólo necesitas agregar `align-items: center` al contenedor flex: :::interactive_editor @@ -390,10 +389,10 @@ Genial. Ahora sabes cómo distribuir los elementos flex dentro del eje principal ```css main { - height: 300px; display: flex; + height: 300px; align-items: center; - border: 2px solid red; + border: 2px solid #444; } div { @@ -431,10 +430,10 @@ En este ejemplo, los elementos flexibles están centrados a lo largo del eje tra ```css main { - height: 300px; display: flex; + height: 300px; align-items: flex-start; - border: 2px solid red; + border: 2px solid #444; } div { @@ -457,7 +456,7 @@ div { ::: -Lo opuesto es `align-items: flex-end`. Esto alineará los elementos flexibles al final del eje transversal, vertical o horizontalmente. +Lo opuesto es `align-items: flex-end`. Esto alineará los elementos flexibles al final del eje transversal, vertical o horizontalmente. :::interactive_editor @@ -472,10 +471,10 @@ Lo opuesto es `align-items: flex-end`. Esto alineará los elementos flexibles al ```css main { - height: 300px; display: flex; + height: 300px; align-items: flex-end; - border: 2px solid red; + border: 2px solid #444; } div { @@ -498,147 +497,169 @@ div { ::: -Para estirar los elementos flexibles a lo largo del eje transversal, puedes usar `align-items: stretch`. Esto también funciona con elementos de tamaño automático, como aquellos sin `width` o `height` establecido, o con sólo un `width` o `height` mínimo. Los elementos flexibles se estirarán para llenar el contenedor en la dirección del eje transversal. +Para estirar los elementos flexibles a lo largo del eje transversal, puedes usar `align-items: stretch`. Esto solo afecta a los elementos cuyo tamaño en el eje transversal es `auto`; los elementos con un tamaño explícito en el eje transversal (por ejemplo, una `height` establecida en un contenedor en fila) no se estirarán. Los elementos afectados llenarán el contenedor en la dirección del eje transversal. :::interactive_editor ```html <link rel="stylesheet" href="styles.css"> - -<div class="container"> - <div class="box">One</div> - <div class="box">Two</div> - <div class="box">Three</div> -</div> - +<main> + <div id="first-div"></div> + <div id="second-div"></div> + <div id="third-div"></div> +</main> ``` ```css -.container { +main { display: flex; - align-items: stretch; + height: 300px; + align-items: stretch; border: 2px solid #444; - height: 200px; } -.box { - width: 100px; - border: 1px solid #888; - background-color: lightblue; +div { + width: 80px; + height: 50px; +} + +#first-div { + background-color: #4d70b2; +} + +#second-div { + background-color: #5c4db2; +} + +#third-div { + background-color: #4da3b2; + height: auto; } ``` ::: -Y finalmente, puedes usar la propiedad `align-self` para asignar una alineación diferente en el eje transversal a un elemento flexible individual. Por ejemplo, puedes estirarlo con `align-self: stretch`. +Y finalmente, puedes usar la propiedad `align-self` para asignar una alineación diferente en el eje transversal a un elemento flexible individual. Por ejemplo, puedes estirarlo con `align-self: stretch`. :::interactive_editor ```html <link rel="stylesheet" href="styles.css"> - -<div class="container"> - <div class="box">One</div> - <div class="box">Two</div> - <div class="box special">Three</div> -</div> - +<main> + <div id="first-div"></div> + <div id="second-div"></div> + <div id="third-div"></div> +</main> ``` ```css -.container { +main { display: flex; - align-items: flex-start; + height: 300px; + align-items: flex-start; border: 2px solid #444; - height: 200px; } -.box { - width: 100px; - border: 1px solid #888; - background-color: lightblue; - margin: 4px; +div { + width: 80px; + height: 50px; } -.special { - align-self: stretch; - background-color: lightcoral; +#first-div { + background-color: #4d70b2; +} + +#second-div { + background-color: #5c4db2; +} + +#third-div { + background-color: #4da3b2; + align-self: stretch; } ``` ::: -Puedes centrarlo con `align-self: center`. +Puedes centrarlo con `align-self: center`. :::interactive_editor ```html <link rel="stylesheet" href="styles.css"> - -<div class="container"> - <div class="box">One</div> - <div class="box">Two</div> - <div class="box special">Three</div> -</div> - +<main> + <div id="first-div"></div> + <div id="second-div"></div> + <div id="third-div"></div> +</main> ``` ```css -.container { +main { display: flex; - align-items: flex-start; + height: 300px; + align-items: flex-start; border: 2px solid #444; - height: 200px; } -.box { - width: 100px; - border: 1px solid #888; - background-color: lightblue; - margin: 4px; +div { + width: 80px; + height: 50px; +} + +#first-div { + background-color: #4d70b2; +} + +#second-div { + background-color: #5c4db2; } -.special { - align-self: center; - background-color: lightcoral; +#third-div { + background-color: #4da3b2; + align-self: center; } ``` ::: -Puedes alinearla al inicio del eje transversal con `align-self: flex-start`. +Puedes alinearla al inicio del eje transversal con `align-self: flex-start`. :::interactive_editor ```html <link rel="stylesheet" href="styles.css"> - -<div class="container"> - <div class="box">One</div> - <div class="box">Two</div> - <div class="box special">Three</div> -</div> - +<main> + <div id="first-div"></div> + <div id="second-div"></div> + <div id="third-div"></div> +</main> ``` ```css -.container { +main { display: flex; - align-items: flex-start; + height: 300px; + align-items: flex-start; border: 2px solid #444; - height: 200px; } -.box { - width: 100px; - border: 1px solid #888; - background-color: lightblue; - margin: 4px; +div { + width: 80px; + height: 50px; +} + +#first-div { + background-color: #4d70b2; } -.special { - align-self: flex-start; - background-color: lightcoral; +#second-div { + background-color: #5c4db2; +} + +#third-div { + background-color: #4da3b2; + align-self: flex-start; } ``` @@ -650,39 +671,43 @@ O puedes alinearla al final del eje transversal con `align-self: flex-end`. ```html <link rel="stylesheet" href="styles.css"> - -<div class="container"> - <div class="box">One</div> - <div class="box">Two</div> - <div class="box special">Three</div> -</div> - +<main> + <div id="first-div"></div> + <div id="second-div"></div> + <div id="third-div"></div> +</main> ``` ```css -.container { +main { display: flex; - align-items: flex-start; + height: 300px; + align-items: flex-start; border: 2px solid #444; - height: 200px; } -.box { - width: 100px; - border: 1px solid #888; - background-color: lightblue; - margin: 4px; +div { + width: 80px; + height: 50px; } -.special { - align-self: flex-end; - background-color: lightcoral; +#first-div { + background-color: #4d70b2; +} + +#second-div { + background-color: #5c4db2; +} + +#third-div { + background-color: #4da3b2; + align-self: flex-end; } ``` ::: -Existen otras propiedades y valores flexibles que puedes elegir para crear el diseño responsivo que imaginas, pero estos son los más comúnmente usados. Con estas propiedades flexibles de CSS y tu nuevo conocimiento del modelo CSS flex, puedes empezar a crear diseños responsivos para ofrecer una experiencia de usuario suave e inclusiva en múltiples dispositivos. +Existen otras propiedades y valores flex que puedes elegir para crear el diseño adaptable que imaginas, pero estos son los más comúnmente usados. Con estas propiedades CSS flex y tu nuevo conocimiento del modelo flex de CSS, puedes comenzar a crear diseños adaptables para ofrecer una experiencia de usuario fluida e inclusiva en todos los dispositivos. # --questions-- @@ -764,7 +789,7 @@ Piensa en cómo están alineados verticalmente los elementos dentro de un conten ## --answers-- -`flex-direction` y `justify-content`. +`flex-direction` y `justify-content` ### --feedback-- @@ -772,7 +797,7 @@ Piensa en los dos aspectos principales de cómo se disponen los elementos flexib --- -`flex-direction` y `align-items`. +`flex-direction` y `align-items` ### --feedback-- @@ -780,7 +805,7 @@ Piensa en los dos aspectos principales de cómo se disponen los elementos flexib --- -`flex-direction` y `align-content`. +`flex-direction` y `align-content` ### --feedback-- @@ -788,7 +813,7 @@ Piensa en los dos aspectos principales de cómo se disponen los elementos flexib --- -`flex-direction` y `flex-wrap`. +`flex-direction` y `flex-wrap` ## --video-solution-- diff --git a/curriculum/challenges/espanol/blocks/lecture-working-with-css-fonts/672bd814105a0ffcf36f9233.md b/curriculum/challenges/espanol/blocks/lecture-working-with-css-fonts/672bd814105a0ffcf36f9233.md index d7ea01ff8b0..ad7dbba002a 100644 --- a/curriculum/challenges/espanol/blocks/lecture-working-with-css-fonts/672bd814105a0ffcf36f9233.md +++ b/curriculum/challenges/espanol/blocks/lecture-working-with-css-fonts/672bd814105a0ffcf36f9233.md @@ -1,6 +1,6 @@ --- id: 672bd814105a0ffcf36f9233 -title: What Are Font Families and How Do They Work? +title: Qué son las familias de fuentes y cómo funcionan challengeType: 19 dashedName: what-are-font-families --- @@ -11,6 +11,8 @@ Una familia de fuentes es un grupo de fuentes que comparte un diseño común. To <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/what-are-font-families-and-how-do-they-work-1.png" alt="Diagram showing 'Arial' at the top with two blue arrows pointing down to 'Arial Bold' on the left and 'Arial Italic' on the right, illustrating font family variations" /> +## Establecer familias de fuentes en CSS + En CSS, puedes establecer la familia de fuentes con la propiedad `font-family`. Aquí tienes un ejemplo de cómo establecer la fuente del párrafo a `Arial`: :::interactive_editor @@ -29,6 +31,8 @@ En CSS, puedes establecer la familia de fuentes con la propiedad `font-family`. ::: +## Fuentes de respaldo + ¿Pero qué pasa si no se encuentra la familia de fuentes? Puedes especificar múltiples familias de fuentes en orden de prioridad, de mayor a menor, separándolas con comas. Estas fuentes alternativas actuarán como opciones de respaldo. En este ejemplo, Arial es una fuente primaria y Lato es una fuente alternativa: :::interactive_editor @@ -51,6 +55,8 @@ El navegador renderizará la primera fuente (Arial) si se encuentra en el dispos También debes saber cómo funciona este proceso detrás de escena. El proceso de selección no se detiene si la primera fuente está disponible. La familia de fuentes se elige un carácter a la vez, por lo que si una fuente carece de un carácter específico, el navegador lo busca en las fuentes de menor prioridad. ¿Interesante, no? +## Familias genéricas de fuentes + En el contexto del desarrollo web, también encontrarás familias de fuentes genéricas. Son muy importantes. Una familia de fuentes genérica es una fuente predeterminada que los navegadores renderizarán cuando las fuentes de mayor prioridad no estén disponibles. Para asegurar que el contenido siga siendo legible, el navegador reemplaza la fuente original con la fuente más adecuada encontrada, basada en la familia de fuentes genérica especificada. Algunas de las más comúnmente utilizadas son: - serif @@ -81,6 +87,8 @@ Arial tiene la más alta prioridad. Si no se encuentra Arial, el navegador inten Siempre debe incluir una familia de fuentes genérica al final de la lista de la propiedad font-family. Ten en cuenta que la fuente genérica puede verse diferente de la fuente que originalmente imaginaste en tu diseño, por lo que siempre es útil verificar cómo se ven estas fuentes alternativas en diferentes navegadores. +## Fuentes seguras para la web + Para que la experiencia del usuario sea lo más consistente posible, también se recomienda usar fuentes seguras para la web. Estas familias de fuentes generalmente están instaladas en la mayoría de los dispositivos, por lo que es muy probable que se encuentren y se rendericen correctamente para la mayoría de los usuarios. You'll learn more about them in the next lessons. Las familias de fuentes son esenciales en el mundo del diseño web. Al usar la propiedad font-family, puedes transformar instantáneamente el aspecto y sensación de tu texto. diff --git a/curriculum/challenges/espanol/blocks/lecture-working-with-css-fonts/672bd8453d1371fdb1510fe5.md b/curriculum/challenges/espanol/blocks/lecture-working-with-css-fonts/672bd8453d1371fdb1510fe5.md index 7348bb30520..2c6dcff0214 100644 --- a/curriculum/challenges/espanol/blocks/lecture-working-with-css-fonts/672bd8453d1371fdb1510fe5.md +++ b/curriculum/challenges/espanol/blocks/lecture-working-with-css-fonts/672bd8453d1371fdb1510fe5.md @@ -11,6 +11,8 @@ Una fuente externa es un archivo de fuente que no está incluido directamente de Google Fonts y Font Squirrel son recursos en línea populares para encontrar y usar fuentes gratuitas para propósitos de desarrollo web. Puedes incorporarlas a tus proyectos muy fácilmente. +## Google Fonts + Comencemos con Google Fonts. Este es un servicio de Google que ofrece una colección de fuentes, muchas de las cuales están diseñadas específicamente para el desarrollo web. En la interfaz de usuario de Google Fonts, puedes ver muchos elementos diferentes. Analicémoslos uno por uno. En la barra lateral izquierda, encontrarás: - Una sección para ver, encontrar y filtrar fuentes. @@ -18,6 +20,8 @@ Comencemos con Google Fonts. Este es un servicio de Google que ofrece una colecc - Una sección donde puedes encontrar y descargar íconos para tus proyectos web. - Una sección donde puedes aprender más sobre las fuentes y sus mejores prácticas, seguida de preguntas frecuentes. +## Previsualizar Google Fonts + Para añadir una fuente de Google a tu sitio web, debes ir a la primera sección (Fuentes). Puedes personalizar el texto de vista previa en la barra lateral izquierda, donde dice "Preview". Solo escribe el texto que te gustaría ver y se actualizará automáticamente. Esto es útil para previsualizar la fuente con el texto que ya tienes en mente para tu sitio web. También puedes ajustar el tamaño de la fuente y filtrar las fuentes según sus características. <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-1.png" alt="Google Fonts Fonts section showing a left sidebar with preview text set to 'freeCodeCamp' at 40px, filter options for Language, Technology, and Decorative stroke, and the main panel listing font families including Roboto, SUSE, and Sevillana each previewing 'freeCodeCamp'" /> @@ -28,12 +32,16 @@ Puedes personalizar el tamaño de la fuente del texto de vista previa con el con <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-2.png" alt="Google Fonts Roboto Styles page with Specimen, Type tester, Glyphs, and About & license tabs, a blue Get font button, a preview text field showing 'freeCodeCamp' with a font size slider at 48px, and a list of styles including Thin 100, Thin 100 Italic, Light 300, and Light 300 Italic" /> +## Usar Google Fonts + Una vez que estés listo para agregar la fuente a tu proyecto, haz clic en el botón azul "Obtener fuente" en la parte superior. Serás llevado a una página de resumen donde verás las fuentes que has seleccionado actualmente. Puedes tener múltiples fuentes seleccionadas simultáneamente. <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-3.png" alt="Google Fonts page showing '1 font family selected' with Roboto Static listed, Get embed code and Download all buttons on the right, and a How to use section with All, Design, Develop, and Google products tabs" /> A continuación, tienes que elegir si quieres descargar los archivos de fuentes para agregarlos a tu proyecto como archivos locales o si prefieres usarlos como fuentes externas y descargarlos desde los servidores de Google cuando un usuario entre a tu sitio web. Haz clic en "Download all" si quieres descargarlos, pero si prefieres usarlos como fuentes externas en los servidores de Google, haz clic en "Get embed code." Si haces clic en "Get embed code," verás las instrucciones que debes seguir para agregar estas fuentes externas a tu proyecto. +### Enlazar Google Fonts + Para los proyectos de desarrollo web, tienes dos opciones. Puedes usar un elemento `link` o `@import`. Si eliges la opción del elemento `link`, puedes copiar y pegar el fragmento de HTML y las reglas CSS para agregarlas a tu proyecto. Debes integrar el código en el elemento `head` de tu archivo HTML y agregar las reglas CSS que se ajusten a tus necesidades. <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-4.png" alt="Google Fonts Embed code page with the link element option selected, showing three link tags for preconnect and the font stylesheet, a CSS classes section with .roboto-thin, .roboto-light, .roboto-regular, and .roboto-medium rules, and a left sidebar showing font style toggles" /> @@ -141,11 +149,13 @@ Aquí tienes un ejemplo de cómo usar todos los estilos de Roboto: Hay una regla CSS para cada estilo de fuente. Cada regla asigna las fuentes personalizadas con fuentes de respaldo en caso de que las fuentes personalizadas no se carguen correctamente. +### Importar Google Fonts + Si eliges la opción `@import`, en su lugar, necesitarás agregar esa regla a tu archivo CSS. <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-5.png" alt="Google Fonts Embed code page with the @import option selected, showing a style block containing the @import URL rule, a CSS classes section below, and the left sidebar with font style toggles" /> -Aquí hay un ejemplo: +Aquí tienes un ejemplo: ```css @import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap'); @@ -159,10 +169,14 @@ Si solo deseas incluir estilos de fuentes específicos, también tienes la opci Y esto es Google Fonts. Es una de las opciones más populares para encontrar fuentes gratuitas y de código abierto para proyectos de desarrollo web. +## Font Squirrel + Otra gran opción es Font Squirrel, donde puedes encontrar y descargar las fuentes personalizadas que visualizas para tu diseño. <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-7.png" alt="Font Squirrel 'Free Font Utopia' page listing featured free fonts including Acherus Grotesque, Intro Rust, Source Sans Pro, Open Sans, and Questa, each shown with an alphabet specimen and a Download button" /> +## Previsualizar Font Squirrel + Si buscas una fuente y haces clic en un resultado, verás más detalles sobre la fuente, incluidos especímenes, prueba de manejo, glifos y kit de Webfont. <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-8.png" alt="Font Squirrel search results for 'Roboto' showing three matches: Roboto, Roboto 2014, and Roboto Slab, each with an alphabet specimen and a Download TTF button" /> @@ -173,6 +187,8 @@ También puedes ver muestras de los diferentes estilos y variaciones de la fuent <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-10.png" alt="Font Squirrel Roboto Specimens section listing all styles with alphabet samples: Roboto Thin, Thin Italic, Light, Light Italic, Regular, Italic, Medium, Medium Italic, Bold, Bold Italic, and Black, each in its respective weight" /> +## Usar Font Squirrel + Una vez que hayas decidido sobre una fuente que quieres usar en tu proyecto, ve a la pestaña "Webfont Kit". Aquí, puedes verificar si la licencia de la fuente permite que la uses en `@font-face` embebidos CSS. También puedes elegir el subconjunto y formato. <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-11.png" alt="Font Squirrel Roboto Webfont Kit tab showing a license notice confirming @font-face embedding is allowed, a subset selector set to Western Latin, format checkboxes with WOFF selected, and a Download @font-face Kit button" /> diff --git a/curriculum/challenges/espanol/blocks/lecture-working-with-css-fonts/672bd853c985cdfdeb32f4f9.md b/curriculum/challenges/espanol/blocks/lecture-working-with-css-fonts/672bd853c985cdfdeb32f4f9.md index 3effcca9312..f22a99fc6ea 100644 --- a/curriculum/challenges/espanol/blocks/lecture-working-with-css-fonts/672bd853c985cdfdeb32f4f9.md +++ b/curriculum/challenges/espanol/blocks/lecture-working-with-css-fonts/672bd853c985cdfdeb32f4f9.md @@ -13,6 +13,8 @@ CSS no aplica sombras al texto por defecto. Este es un ejemplo de un párrafo si text-shadow: /* Values */ ``` +## Los valores de desplazamiento `X` y `Y` + En CSS, puedes describir una sombra combinando su desplazamiento `X`, desplazamiento `Y`, radio de desenfoque y color. Primero, necesitas especificar el desplazamiento `X` y `Y`, que representan la distancia horizontal y vertical de la sombra del texto, respectivamente. Estos valores son obligatorios. Aquí tienes un ejemplo de cómo aplicar un desplazamiento `X` y `Y` a una sombra. Aplicamos la propiedad `text-shadow` con un desplazamiento horizontal de `3px` y un desplazamiento vertical de `2px`: @@ -32,7 +34,11 @@ p { ::: -En el navegador, el texto y la sombra se verán similares, pero también podemos personalizar el color de la sombra especificando el valor antes o después del desplazamiento. Vamos a establecer el color de la sombra. Utilizaremos un color hexadecimal aquí, pero puedes usar cualquier formato de color válido. +En el navegador, el texto y la sombra se verán similares. + +## Agregar un color a la sombra + +También podemos personalizar el color de la sombra especificando el valor antes o después del desplazamiento. Vamos a establecer el color de la sombra. Usaremos un color hexadecimal aquí, pero puedes usar cualquier formato de color válido. :::interactive_editor @@ -66,7 +72,11 @@ p { ::: -En el navegador, la sombra tendrá un color específico, por lo que podemos distinguirla fácilmente del texto. Ahora que podemos diferenciar la sombra del texto, también es importante ver cómo los valores positivos y negativos afectan el desplazamiento de la sombra. Los valores positivos del desplazamiento `X` y `Y` moverán la sombra hacia la derecha y hacia abajo, respectivamente, mientras que los valores negativos moverán la sombra hacia la izquierda y hacia arriba. Aquí tienes un ejemplo que usa valores negativos en su lugar: +En el navegador, la sombra tendrá un color específico, por lo que podemos distinguirla muy fácilmente del texto. + +## Valores de desplazamiento positivos y negativos + +Ahora que podemos diferenciar la sombra del texto, también es importante ver cómo los valores positivos y negativos afectan el desplazamiento de la sombra. Los valores positivos del desplazamiento `X` y `Y` moverán la sombra hacia la derecha y hacia abajo, respectivamente, mientras que los valores negativos moverán la sombra hacia la izquierda y hacia arriba. Aquí tienes un ejemplo que usa valores negativos en su lugar: :::interactive_editor @@ -83,7 +93,11 @@ p { ::: -Ahora la sombra se moverá hacia la izquierda y hacia arriba en relación con el texto. Genial. Pero la sombra no se ve muy bien, porque parece exactamente igual al texto original pero colocada detrás. Para que se vea mejor, necesitamos agregar un tercer valor, el radio de desenfoque. Este valor es opcional, pero hace que la sombra se vea mucho más suave y sutil. El valor predeterminado del radio de desenfoque es cero. Cuanto mayor sea el valor, mayor será el desenfoque, lo que significa que la sombra se vuelve más clara. +Ahora la sombra se moverá hacia la izquierda y hacia arriba en relación con el texto. Genial. + +## El radio de desenfoque + +Pero la sombra no se ve muy bien, porque parece exactamente igual que el texto original pero colocado detrás de él. Para que se vea mejor, necesitamos agregar un tercer valor, el radio de desenfoque. Este valor es opcional pero hace que la sombra se vea mucho más suave y sutil. El valor predeterminado del radio de desenfoque es cero. Cuanto mayor sea el valor, mayor será el desenfoque, lo que significa que la sombra se vuelve más clara. Aquí estamos estableciendo el radio de desenfoque a `3px` y volvemos a los valores positivos para el desplazamiento: @@ -104,6 +118,8 @@ p { Ahora comienza a parecer una sombra. Es más borrosa y sutil, por lo que podemos enfocarnos en el texto principal mientras la sombra añade un poco de estilo en el fondo. Desde aquí, podemos ajustar un poco los valores hasta encontrar una combinación de desplazamiento, color y radio de desenfoque que se ajuste a nuestras necesidades. +## Agregar múltiples sombras + También es útil saber que el texto puede tener más de una sombra. Solo necesitas escribirlas en la misma propiedad `text-shadow` separadas por comas. Se aplicarán en capas, de adelante hacia atrás, con la primera sombra en la parte superior. Aquí tienes un ejemplo de un párrafo con tres sombras aplicadas en capas. Observa que todas estas sombras están definidas en la misma propiedad `text-shadow` y separadas por comas. diff --git a/curriculum/challenges/espanol/blocks/lecture-working-with-css-transforms-overflow-and-filters/672bccc8ea33bad87abb3c56.md b/curriculum/challenges/espanol/blocks/lecture-working-with-css-transforms-overflow-and-filters/672bccc8ea33bad87abb3c56.md index 738b8992049..0964e06d2de 100644 --- a/curriculum/challenges/espanol/blocks/lecture-working-with-css-transforms-overflow-and-filters/672bccc8ea33bad87abb3c56.md +++ b/curriculum/challenges/espanol/blocks/lecture-working-with-css-transforms-overflow-and-filters/672bccc8ea33bad87abb3c56.md @@ -19,6 +19,8 @@ Esta propiedad se puede establecer en el selector universal (`*`) para aplicar a El valor de la propiedad `box-sizing` es `content-box` por defecto, pero puedes elegir `border-box` si lo necesitas. Exploraremos `content-box` primero y luego entraremos en `border-box`. +## Revisión del modelo de caja CSS + Para entender cómo funcionan los modelos, necesitas estar familiarizado con los cuatro conceptos clave del modelo de caja CSS. Repasémoslos rápidamente. - El área de contenido es el espacio ocupado por el contenido del elemento. @@ -26,11 +28,13 @@ Para entender cómo funcionan los modelos, necesitas estar familiarizado con los - El borde es el contorno que rodea el área de contenido y el padding. - El margen es el espacio fuera del borde que separa el elemento de otros elementos. +## Cómo funciona `content-box` + En el modelo `content-box`, el ancho y alto que estableces para un elemento determinan las dimensiones del área de contenido, pero no incluyen el padding, border o margin. Usa `content-box` cuando necesites un control preciso sobre el área de contenido. Cuando estableces `width` y `height`, solo estás definiendo el tamaño del contenido en sí. Para encontrar el ancho total del elemento, necesitarás sumar el padding izquierdo y derecho, y los bordes izquierdo y derecho. De igual manera, la altura total de un elemento se puede encontrar sumando la altura del contenido, el padding superior e inferior, y los bordes superior e inferior. -Por ejemplo, aquí tenemos un selector de tipos CSS para todos los elementos `div`. +Por ejemplo, aquí tenemos un selector de tipos CSS para todos los elementos `div`. :::interactive_editor @@ -52,10 +56,14 @@ div { En este caso, si se usa `content-box` el área de contenido será de 300px por 200px. El tamaño total renderizado incluye padding y bordes — por ejemplo, ancho total = 300px (contenido) + 40px (padding) + 8px (bordes) = 348px; la altura total se calcula de la misma manera. +## Cómo funciona `border-box` + ¡Genial! Ahora exploraremos `border-box`. It's different because the width and height you set include the element's content, padding, and border (but not its margin). Use `border-box` when you want the element's total size to stay fixed even if padding or borders change — that's often helpful in responsive layouts. Con `border-box`, el padding y los bordes se incluyen dentro del tamaño especificado del elemento. El `width` y `height` que configures se convierten en las dimensiones totales del elemento: contenido + padding + borde; los márgenes permanecen excluidos. +## Comparación de los dos modelos + En el siguiente ejemplo, hay dos elementos `div` con las mismas dimensiones pero diferentes valores de `box-sizing`. Observa cómo esto resulta en tamaños totales diferentes al verlos en el navegador: :::interactive_editor @@ -89,7 +97,7 @@ En el siguiente ejemplo, hay dos elementos `div` con las mismas dimensiones pero ::: -Puedes ver que ambos tienen el mismo `width`, `height`, `padding`, `border` y `margin`. The only differences are in the colors and the value of the `box-sizing` property. Esta pequeña diferencia tiene un impacto muy importante en las dimensiones finales. +Puedes ver que ambos tienen el mismo `width`, `height`, `padding`, `border` y `margin`. The only differences are in the colors and the value of the `box-sizing` property. Esta pequeña diferencia tiene un impacto muy importante en las dimensiones finales. Elegir entre `content-box` y `border-box` realmente depende de las necesidades específicas de tu proyecto. Mientras que `border-box` está ganando popularidad por su simplicidad y flexibilidad, entender ambos modelos es importante para implementar diseños de CSS efectivos. diff --git a/curriculum/challenges/espanol/blocks/lecture-working-with-dates/6733aafb9c0802f66cc1e056.md b/curriculum/challenges/espanol/blocks/lecture-working-with-dates/6733aafb9c0802f66cc1e056.md index 6c34c1f0c52..b301f782827 100644 --- a/curriculum/challenges/espanol/blocks/lecture-working-with-dates/6733aafb9c0802f66cc1e056.md +++ b/curriculum/challenges/espanol/blocks/lecture-working-with-dates/6733aafb9c0802f66cc1e056.md @@ -34,21 +34,31 @@ console.log(now); Por ahora, está usando el formato de hora militar, así que `14:30` es `2:30 PM`. `GMT-0700` es el desplazamiento de la zona horaria, y `Pacific Daylight Time` es el nombre de la zona horaria. -También puedes pasar una fecha y hora específica al objeto `Date` proporcionando los valores de año, mes, día, hora, minuto, segundo y milisegundo como argumentos. +Aquí tienes un ejemplo de cómo crear un nuevo objeto `Date` con una cadena de fecha específica: -Aquí tienes un ejemplo de creación de un nuevo objeto `Date` con una fecha y hora específicas: +:::interactive_editor + +```js +const dateFromString = new Date("July 4, 1776 12:00:00"); + +console.log(dateFromString); +``` + +::: + +También puedes pasar una fecha y hora específicas al objeto `Date` proporcionando los valores de año, mes, día, hora, minuto, segundo y milisegundo como argumentos: :::interactive_editor ```js -const specificDate = new Date("July 4, 1776 12:00:00"); +const dateFromArguments = new Date(1776, 6, 4, 12, 0, 0, 0); -console.log(specificDate); +console.log(dateFromArguments); ``` ::: -Esto es útil cuando necesitas trabajar con una fecha y hora específica en lugar de la fecha y hora actual. La entrada siempre debe ser una cadena, y el formato debe ser reconocible por el objeto `Date`. +Esto es útil cuando necesitas trabajar con una fecha y hora específicas en lugar de la fecha y hora actuales. Para obtener la fecha y hora actual, puedes usar el método `Date.now()`, que devuelve el número de milisegundos desde el `January 1, 1970, 00:00:00 UTC`. Esto se conoce como tiempo épico de Unix. diff --git a/curriculum/challenges/espanol/blocks/lecture-working-with-file-systems/672ac403a9ba7732b31c6480.md b/curriculum/challenges/espanol/blocks/lecture-working-with-file-systems/672ac403a9ba7732b31c6480.md index 4fe93fdddf5..691e298eebb 100644 --- a/curriculum/challenges/espanol/blocks/lecture-working-with-file-systems/672ac403a9ba7732b31c6480.md +++ b/curriculum/challenges/espanol/blocks/lecture-working-with-file-systems/672ac403a9ba7732b31c6480.md @@ -51,11 +51,11 @@ Y finalmente, hablemos de documentación. En aplicaciones web, generalmente enco Generalmente están escritos en un formato de archivo llamado Markdown. Con Markdown, puedes crear documentos estructurados con encabezados, subencabezados, enlaces, imágenes, listas y más. Los archivos Markdown tienen una extensión `.md` o `.markdown`. -Aquí puedes encontrar el archivo `README` del repositorio de GitHub de freeCodeCamp: https://github.com/freeCodeCamp/freeCodeCamp/blob/main/README.md +Aquí puedes encontrar el archivo `README` del repositorio de GitHub de freeCodeCamp: `https://github.com/freeCodeCamp/freeCodeCamp/blob/main/README.md` Puedes crear esta estructura detallada y formato usando Markdown. -Definitivamente leerás y escribirás muchos archivos `README` a lo largo de tu carrera. Aprender sobre estos tipos de archivos comunes es esencial para el desarrollo web. +Definitivamente leerás y escribirás muchos archivos `README` a lo largo de tu carrera. Aprender sobre estos tipos de archivos comunes es esencial para el desarrollo web. Desde los bloques de construcción principales de HTML, CSS y JavaScript hasta formatos de imagen, video y audio, cada tipo de archivo tiene un papel importante en la creación de aplicaciones web interactivas. diff --git a/curriculum/challenges/espanol/blocks/lecture-working-with-node-core-modules/695cc6a5eefd305381ec90bc.md b/curriculum/challenges/espanol/blocks/lecture-working-with-node-core-modules/695cc6a5eefd305381ec90bc.md index 7e9b46958b5..080bd8af3ac 100644 --- a/curriculum/challenges/espanol/blocks/lecture-working-with-node-core-modules/695cc6a5eefd305381ec90bc.md +++ b/curriculum/challenges/espanol/blocks/lecture-working-with-node-core-modules/695cc6a5eefd305381ec90bc.md @@ -84,7 +84,7 @@ Para scripts rápidos, proyectos pequeños o tareas puntuales, los métodos sín Por eso existen los métodos asíncronos. Permiten que el resto de tu programa siga ejecutándose mientras Node maneja las operaciones de archivos en segundo plano. Tradicionalmente, esto usaba callbacks, pero estos pueden volverse desordenados rápidamente a medida que tu aplicación crece. -Las Promesas y `async/await` resuelven ese problema. Siguen siendo no bloqueantes, pero el código se lee como código síncrono normal y es mucho más fácil de mantener. +Las Promesas y `async/await` resuelven ese problema. Siguen siendo no bloqueantes, pero el código se lee como código síncrono normal y es mucho más fácil de mantener. Por esta razón, el enfoque basado en promesas es generalmente preferido hoy en día, y eso es lo que usaremos en el resto de esta lección. @@ -148,7 +148,7 @@ async function readFileContent() { const fileContent = await fs.readFile("article.md", "utf8"); console.log("File content:", fileContent); } catch (err) { - console.log("File read successfully"); + console.error("Error reading file:", err); } } @@ -169,7 +169,7 @@ async function readFileContent() { const fileContent = await fs.readFile("article.md"); console.log("File content:", fileContent); } catch (err) { - console.log("File read successfully"); + console.error("Error reading file:", err); } } @@ -297,7 +297,7 @@ Dos son asíncronos, uno es síncrono y uno no existe. --- - Con promesas, por ejemplo `fs.promises.writeFile()`. +Con promesas, por ejemplo `fs.promises.writeFile()`. ### --feedback-- diff --git a/curriculum/challenges/espanol/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d2f232c60f0fa68ef86.md b/curriculum/challenges/espanol/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d2f232c60f0fa68ef86.md index 609edabc1a5..df45de5b730 100644 --- a/curriculum/challenges/espanol/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d2f232c60f0fa68ef86.md +++ b/curriculum/challenges/espanol/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d2f232c60f0fa68ef86.md @@ -1,6 +1,6 @@ --- id: 68ff6d2f232c60f0fa68ef86 -title: ¿Qué es Node y Cuáles son Algunas Diferencias Entre el Entorno de Ejecución del Navegador y Node? +title: Qué es Node y cuáles son algunas diferencias entre el navegador y el entorno de ejecución de Node challengeType: 19 dashedName: what-is-node-and-what-are-some-differences-between-the-browser-and-node-runtime-environment --- @@ -19,11 +19,11 @@ Por ejemplo: JavaScript del lado del cliente tiene estas limitaciones porque fue diseñado inicialmente para ejecutarse exclusivamente en navegadores web. -Los navegadores web proporcionan el entorno necesario para ejecutar código JavaScript, incluido el JavaScript Engine. También proporcionan acceso al Document Object Model (DOM), para que puedas acceder a los elementos HTML en tu código. +Los navegadores web proporcionan el entorno necesario para ejecutar código JavaScript, incluido el motor de JavaScript. También ofrecen acceso al Modelo de Objetos del Documento (DOM), para que puedas acceder a los elementos HTML en tu código. -Antes, no podíamos ejecutar JavaScript fuera de un navegador, pero ahora podemos con Node.js. +Durante mucho tiempo, JavaScript se usó casi exclusivamente dentro de los navegadores, pero con Node.js también puedes ejecutarlo fuera de un navegador. -Node.js es un entorno de ejecución de JavaScript. Está definido oficialmente como “un entorno de ejecución de JavaScript de código abierto y multiplataforma.” +Node.js es un entorno de ejecución de JavaScript. Se define oficialmente como "un entorno de ejecución de JavaScript de código abierto y multiplataforma." Veamos qué significa esto: @@ -43,7 +43,7 @@ El entorno del navegador está diseñado principalmente para el desarrollo web f Por ejemplo, desde el navegador, puedes acceder a la API del DOM, pero hay restricciones para acceder al sistema de archivos local. En cambio, desde el entorno de ejecución Node, puedes acceder a casi todos los recursos del sistema, incluido el sistema de archivos, pero no al DOM. -Ambos entornos de JavaScript proporcionan un objeto global. En el entorno de ejecución de JavaScript del navegador, esto se llama `window`. Este objeto `window` proporciona acceso a funcionalidades relacionadas con el navegador, como acceso a métodos para manipular el DOM, gestionar cookies y manejar eventos del navegador. En el entorno de Node.js, este objeto global se llama `global`. El objeto `global` proporciona acceso a funcionalidades específicas de Node.js, como módulos integrados para trabajar con archivos locales, redes e interactuar con el sistema operativo. +Ambos entornos de JavaScript proporcionan un objeto global. En el entorno de ejecución de JavaScript del navegador, este se llama `window`. Este objeto `window` ofrece acceso a funcionalidades relacionadas con el navegador, como métodos para manipular el DOM, gestionar cookies y manejar eventos del navegador. En el entorno de Node.js, este objeto global se llama `global`. El objeto `global` ofrece acceso a funcionalidades específicas de Node.js, como módulos integrados para trabajar con archivos locales, redes e interactuar con el sistema operativo. Finalmente, otra diferencia importante es que puedes elegir la versión de Node.js que quieres usar en tu servidor. Sin embargo, no tienes control sobre la versión del entorno del navegador que tus usuarios usarán para visitar tu sitio web. @@ -103,7 +103,7 @@ Piensa en los roles y el propósito de cada entorno. --- -El entorno de ejecución de Node usa el objeto window como su objeto global, mientras que los navegadores usan el objeto global. +El entorno de ejecución de Node usa el objeto `window` como su objeto global, mientras que los navegadores usan el objeto `global`. ### --feedback-- diff --git a/curriculum/challenges/espanol/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d372ad364f285f0522e.md b/curriculum/challenges/espanol/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d372ad364f285f0522e.md index b532d08abdf..777287dc91d 100644 --- a/curriculum/challenges/espanol/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d372ad364f285f0522e.md +++ b/curriculum/challenges/espanol/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d372ad364f285f0522e.md @@ -1,6 +1,6 @@ --- id: 68ff6d372ad364f285f0522e -title: ¿Cuáles son las ventajas y desventajas de usar Node en el Back-End? +title: Cuáles son las ventajas y desventajas de usar Node en el back-end? challengeType: 19 dashedName: what-are-the-advantages-and-disadvantages-to-using-node-on-the-back-end --- @@ -11,7 +11,7 @@ Una de las grandes ventajas de Node.js es que puedes implementar tanto el front- La arquitectura de Node es otra ventaja. Tiene una arquitectura no bloqueante y orientada a eventos que es excelente para desarrollar aplicaciones en tiempo real, donde la capacidad de respuesta y la eficiencia son esenciales para crear una buena experiencia de usuario. -Aquí es donde el concepto de “threads” se vuelve muy importante. Un thread es una ruta de ejecución dentro de un proceso, como un programa de computadora que se está ejecutando actualmente. +Aquí es donde el concepto de "hilos" se vuelve muy importante. Un hilo es una ruta de ejecución dentro de un proceso, es decir, un programa de computadora que se está ejecutando actualmente. La arquitectura de Node se basa en un solo hilo y un bucle de eventos que puede manejar eficazmente una gran cantidad de solicitudes simultáneas y operaciones de entrada/salida. Esto lo hace perfecto para aplicaciones que requieren manejar múltiples solicitudes al mismo tiempo. @@ -25,13 +25,13 @@ Y finalmente, en términos de costos, Node.js tiene la gran ventaja de ser gratu Por otro lado, Node.js sí tiene ciertas desventajas o limitaciones que debes conocer. -Como aprendiste, solo ejecuta un hilo a la vez, lo que significa que solo puede manejar una operación a la vez. Aunque su arquitectura le permite ser eficiente para manejar solicitudes concurrentes (simultáneas), las tareas intensivas en CPU pueden bloquear el hilo principal y causar problemas de rendimiento. +Como aprendiste, ejecuta tu JavaScript en un solo hilo, lo que significa que solo puede ejecutar una parte de tu código a la vez. Aunque su arquitectura le permite ser eficiente para manejar solicitudes concurrentes (simultáneas), las tareas intensivas en CPU pueden bloquear el hilo principal y causar problemas de rendimiento. Ejemplos de tareas intensivas para la CPU incluyen operaciones matemáticas complejas, procesamiento de imágenes y videos, y criptografía. Hay formas de superar esto, pero usualmente aumentan la complejidad de la aplicación. -Node.js también depende de la programación asincrónica. En la programación asincrónica, se inicia una tarea que puede tardar mucho en ejecutarse, pero en lugar de esperar a que termine, el programa principal continúa ejecutándose mientras la tarea asincrónica se ejecuta en paralelo. Cuando la tarea se completa, el programa maneja el resultado. +En la programación asíncrona, se inicia una tarea que puede tardar mucho en ejecutarse, pero en lugar de esperar a que termine, el programa principal continúa ejecutándose mientras la tarea asíncrona se ejecuta en segundo plano. -Este proceso a menudo implica lo que conocemos como “callbacks,” que son funciones que definen qué sucede cuando las operaciones asincrónicas se completan. La naturaleza asincrónica de Node.js puede potencialmente hacer que el código sea más difícil de leer, entender y depurar. +Este proceso a menudo involucra lo que conocemos como "callbacks", que son funciones que definen qué sucede cuando las operaciones asíncronas se completan. La naturaleza asíncrona de Node.js puede hacer que el código sea potencialmente más difícil de leer, entender y depurar. Y finalmente, también debes tener cuidado al elegir paquetes de `npm`, el gestor de paquetes de Node, porque algunos de ellos pueden no mantenerse constantemente, por lo que podrían introducir vulnerabilidades en tu propia aplicación. Como desarrollador, debes evaluar cada paquete cuidadosamente y verificar si sigue las mejores prácticas de calidad y seguridad. diff --git a/curriculum/challenges/espanol/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d39d7ed9ef36ff281f3.md b/curriculum/challenges/espanol/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d39d7ed9ef36ff281f3.md index 52f5314ba14..d650c8b1283 100644 --- a/curriculum/challenges/espanol/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d39d7ed9ef36ff281f3.md +++ b/curriculum/challenges/espanol/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d39d7ed9ef36ff281f3.md @@ -1,6 +1,6 @@ --- id: 68ff6d39d7ed9ef36ff281f3 -title: ¿Cómo puedes instalar Node en tu computadora? +title: Cómo puedes instalar Node en tu computadora? challengeType: 19 dashedName: how-can-you-install-node-on-your-computer --- @@ -17,7 +17,7 @@ Veamos cómo puedes instalar NVM en macOS/Linux y Windows, y cómo puedes usarlo En macOS y Linux, puedes instalar NVM directamente a través de un script de shell. -Pero para macOS, ten en cuenta que la documentación oficial de NVM menciona que “necesitas instalar manualmente las herramientas de línea de comandos de Xcode antes de ejecutar el script de instalación, de lo contrario, fallará.” +Pero para macOS, ten en cuenta que la documentación oficial de NVM menciona que "necesitas instalar manualmente las herramientas de línea de comandos de Xcode antes de ejecutar el script de instalación, de lo contrario, fallará." En macOS, puedes instalar las herramientas de línea de comandos de Xcode ejecutando este comando en tu terminal: @@ -41,7 +41,7 @@ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash ``` -Para obtener la versión más reciente de NVM en el momento en que leas este artículo, consulta la documentación oficial de NVM: `https://github.com/nvm-sh/nvm?tab=readme-ov-file#install--update-script`. Allí encontrarás estos comandos con el número de versión más reciente. +Para obtener la versión más reciente de NVM en el momento en que leas esta lección, consulta la documentación oficial de NVM: `https://github.com/nvm-sh/nvm?tab=readme-ov-file#install--update-script`. Allí encontrarás estos comandos con el número de versión más reciente. Es posible que necesites reiniciar tu terminal cuando el proceso haya terminado para cargar el nuevo comando y la nueva configuración. @@ -101,7 +101,7 @@ Ahora veamos cómo puedes instalar y usar NVM en Windows. Las versiones oficiales de NVM solo soportan Windows en casos específicos. Si tienes Windows Subsystem for Linux (WSL) configurado en tu dispositivo, puedes seguir la guía de macOS/Linux arriba para instalar y usar NVM. -Sin embargo, para Windows en sí, hay algunas alternativas. Una de ellas es `nvm-windows`, una utilidad de gestión de versiones de Node.js para Windows. Este es un proyecto completamente separado del proyecto oficial de NVM. Pero el propósito de estas herramientas es el mismo: ayudarte a trabajar con múltiples versiones de Node.js en el mismo dispositivo. +Sin embargo, para Windows en sí, existen algunas alternativas. Una de ellas es `nvm-windows`, una utilidad para gestionar versiones de Node.js en Windows. Este es un proyecto completamente separado del proyecto oficial de NVM. Pero el propósito de estas herramientas es el mismo: ayudarte a trabajar con múltiples versiones de Node.js en el mismo dispositivo. Antes de instalar `nvm-windows`, debes saber que el repositorio oficial recomienda desinstalar cualquier instalación previa de Node antes de instalar NVM para Windows. Si es la primera vez que instalas Node.js, deberías estar bien. Si ya tienes otras versiones de Node.js instaladas, se recomienda desinstalarlas primero. @@ -155,7 +155,7 @@ nvm use 20 También puedes verificar tu versión actual de Node.js con este comando: -```bash +```powershell node -v ``` @@ -165,25 +165,25 @@ Ahora que sabes cómo instalar NVM y Node.js, veamos algunos comandos básicos q Además, aunque todos estos comandos funcionarán para NVM instalado en macOS/Linux, incluyendo WSL, pueden funcionar de manera diferente o no funcionar en absoluto para `nvm-windows`. Dejaremos comandos alternativos para `nvm-windows` siempre que sea posible. -### Cómo ajustar la política de ejecución de Powershell +### Cómo ajustar la política de ejecución de PowerShell -Si estás usando Windows y sigues junto con Powershell y `nvm-windows`, puede que necesites ajustar la política de ejecución de Powershell. La política de ejecución predeterminada para Powershell es `Restricted`, que es una medida de seguridad para evitar que se ejecuten scripts. +Si usas Windows y sigues con PowerShell y `nvm-windows`, puede que necesites ajustar la política de ejecución de PowerShell. La política de ejecución predeterminada para PowerShell es `Restricted`, que es una medida de seguridad para evitar que se ejecuten scripts. -Primero, ejecuta Powershell como administrador haciendo clic derecho en Powershell y luego seleccionando “Ejecutar como administrador“. +Primero, ejecuta PowerShell como administrador haciendo clic derecho sobre PowerShell y luego seleccionando "Ejecutar como administrador". -Luego, para ver la política de ejecución actual de la sesión de Powershell actual, ejecuta el siguiente comando: +Luego, para ver la política de ejecución actual de la sesión de PowerShell, ejecuta el siguiente comando: ```powershell Get-ExecutionPolicy ``` -Finalmente, para establecer la política de ejecución de Powershell en `RemoteSigned`, que permite ejecutar scripts locales y `npm`, usa el siguiente comando: +Finalmente, para establecer la política de ejecución de PowerShell en `RemoteSigned`, que permite ejecutar scripts locales y `npm`, usa el siguiente comando: ```powershell Set-ExecutionPolicy RemoteSigned ``` -Una vez que hayas ejecutado el comando anterior, puedes cerrar la ventana de administrador de Powershell y abrir una ventana de Powershell sin privilegios de administrador. +Una vez que hayas ejecutado el comando anterior, puedes cerrar la ventana de PowerShell con privilegios de administrador y abrir una ventana de PowerShell sin privilegios. ### Listar Todas las Versiones diff --git a/curriculum/challenges/espanol/blocks/lecture-working-with-operator-behavior/6732719e2e3ad4d947410b65.md b/curriculum/challenges/espanol/blocks/lecture-working-with-operator-behavior/6732719e2e3ad4d947410b65.md index a564a66ac6e..c542679eb39 100644 --- a/curriculum/challenges/espanol/blocks/lecture-working-with-operator-behavior/6732719e2e3ad4d947410b65.md +++ b/curriculum/challenges/espanol/blocks/lecture-working-with-operator-behavior/6732719e2e3ad4d947410b65.md @@ -11,7 +11,13 @@ Si escribes una expresión con varios operadores en JavaScript, ¿cómo decide J La precedencia de operadores determina el orden en el que se evalúan las operaciones en una expresión. Los operadores con mayor precedencia se evalúan antes que los de menor precedencia. Piensa en la precedencia de operadores como en las matemáticas, donde la división y multiplicación suceden antes que la suma y resta. -Sin seguir esta regla, las ecuaciones básicas te darían la respuesta incorrecta. JavaScript funciona de la misma manera. Tiene sus propias reglas sobre qué operadores van primero, segundo, y así sucesivamente. Por ejemplo, eche un vistazo a la expresión a continuación: +Sin seguir esta regla, las ecuaciones básicas te darían una respuesta incorrecta. JavaScript funciona igual. Tiene sus propias reglas para qué operadores van primero, segundo y así sucesivamente. + +## Precedencia en expresiones aritméticas + +### Precedencia de la multiplicación + +Por ejemplo, mira la expresión a continuación: :::interactive_editor @@ -23,38 +29,44 @@ console.log(result); // 14 ::: -Si JavaScript evaluara esta expresión de izquierda a derecha, esperarías `2 + 3 = 5`, luego `5 * 4 = 20`. Pero debido a que la multiplicación tiene una precedencia mayor que la suma, JavaScript evalúa primero la parte `3 * 4`, resultando en `2 + 12 = 14`. +Si JavaScript evaluara esta expresión de izquierda a derecha, esperarías `2 + 3 = 5`, luego `5 * 4 = 20`. Pero debido a que la multiplicación tiene una precedencia mayor que la suma, JavaScript evalúa primero la parte `3 * 4`, resultando en `2 + 12 = 14`. -A veces, puedes querer que ciertas partes de tu expresión se ejecuten primero, independientemente de las reglas de precedencia. Puedes usar paréntesis, `()`, para hacerlo. Cualquier cosa dentro de los paréntesis se evalúa primero, sin importar qué. Hagamos que la parte `2 + 3` del ejemplo anterior se evalúe primero: +### Precedencia de la división + +El operador de división tiene más precedencia que la suma o resta también: :::interactive_editor ```js -const result = (2 + 3) * 4; +const result = 2 + 6 / 3; -console.log(result); // 20 +console.log(result); // 4 ``` ::: -En el ejemplo anterior, los paréntesis obligan a JavaScript a evaluar `2 + 3` primero, y luego multiplicar el resultado por `4`. Esto te da `20` en lugar de `14`. +Si JavaScript evaluara esta expresión de izquierda a derecha, podrías esperar `2 + 6 = 8`, luego `8 / 3 = 2.67`. Pero como la división tiene una precedencia mayor que la suma, JavaScript evalúa primero la división: `6 / 3 = 2`, y luego suma `2 + 2`, dando el resultado `4`. -El operador de división tiene más precedencia que la suma o resta también: +### Usar paréntesis para sobrescribir la precedencia + +A veces, puedes querer que ciertas partes de tu expresión se ejecuten primero, sin importar las reglas de precedencia. Puedes usar paréntesis, `()`, para hacer esto. Todo lo que esté dentro de paréntesis se evalúa primero, sin importar qué. Hagamos que la parte `2 + 3` del ejemplo de multiplicación se evalúe primero: :::interactive_editor ```js -const result = 2 + 6 / 3; +const result = (2 + 3) * 4; -console.log(result); // 4 +console.log(result); // 20 ``` ::: -Si JavaScript evaluara esta expresión de izquierda a derecha, podrías esperar `2 + 6 = 8`, luego `8 / 3 = 2.67`. Pero como la división tiene una precedencia mayor que la suma, JavaScript evalúa primero la división: `6 / 3 = 2`, y luego suma `2 + 2`, dando el resultado `4`. +En el ejemplo anterior, los paréntesis obligan a JavaScript a evaluar `2 + 3` primero, y luego multiplicar el resultado por `4`. Esto te da `20` en lugar de `14`. Entonces, en multiplicación y división, esas operaciones siempre se llevan a cabo antes que la suma y la resta, a menos que se usen paréntesis para cambiar el orden. ¿Qué pasa si los operadores tienen la misma precedencia? JavaScript utiliza asociatividad para determinar el orden de evaluación. +## Entendiendo la asociatividad + La asociatividad es lo que le dice a JavaScript si debe evaluar operadores de izquierda a derecha o de derecha a izquierda. Para la mayoría de los operadores como suma y multiplicación, la asociatividad es de izquierda a derecha. Entonces, JavaScript procesa estos de izquierda a derecha de la expresión: :::interactive_editor @@ -84,6 +96,8 @@ console.log(a + b); // 10 En el ejemplo anterior, JavaScript asigna `5` a `b` primero, luego asigna `b` (que ahora es `5`) a `a`. +### El operador de exponente + El operador de exponente también es asociativo de derecha a izquierda: :::interactive_editor @@ -96,7 +110,7 @@ console.log(result); // 512 ::: -Primero, JavaScript evalúa `3 ** 2`, que es igual a `9`, luego, evalúa `2 ** 9`, que es igual a `512`. Si el operador de exponente tuviera asociatividad de izquierda a derecha, JavaScript habría calculado `2 ** 3` primero para obtener `8`, luego `8 ** 2` para obtener `64`.  +Primero, JavaScript evalúa `3 ** 2`, que es igual a `9`, luego, evalúa `2 ** 9`, que es igual a `512`. Si el operador de exponente tuviera asociatividad de izquierda a derecha, JavaScript habría calculado `2 ** 3` primero para obtener `8`, luego `8 ** 2` para obtener `64`. # --questions-- diff --git a/curriculum/challenges/espanol/blocks/lecture-working-with-regular-expressions/6733c5e54e3a154c8078ed48.md b/curriculum/challenges/espanol/blocks/lecture-working-with-regular-expressions/6733c5e54e3a154c8078ed48.md index 7909ab2124c..34c5e30415e 100644 --- a/curriculum/challenges/espanol/blocks/lecture-working-with-regular-expressions/6733c5e54e3a154c8078ed48.md +++ b/curriculum/challenges/espanol/blocks/lecture-working-with-regular-expressions/6733c5e54e3a154c8078ed48.md @@ -17,6 +17,8 @@ const regex = /^\d\d\d\d$/; Y esto funciona: coincidirá con cuatro caracteres numéricos. Pero en lugar de tener que escribir la misma clase varias veces, puedes darle un cuantificador. +## Cuantificadores exactos + Los cuantificadores están definidos por llaves que contienen uno o dos números. Usemos un cuantificador en nuestro patrón: ```js @@ -40,6 +42,8 @@ console.log(regex.test("1234567")); // false El patrón solo coincide con la cadena de exactamente cuatro dígitos, porque hemos usado los anclajes y nuestro cuantificador solo permite exactamente cuatro dígitos. Pero tal vez el código de identificación solo necesita ser un mínimo de cuatro dígitos. +## Cuantificadores mínimos y máximos + Para permitir cuatro o más dígitos, agrega una coma después del número en tu cuantificador: ```js @@ -84,6 +88,10 @@ console.log(regex.test("1234567")); // false Ten en cuenta que no puedes usar esta sintaxis para establecer solo un máximo: siempre debes establecer un mínimo. Pero si estableces el mínimo en `1`, puedes lograr efectivamente el mismo resultado. +## Cuantificadores abreviados + +### El cuantificador de signo de interrogación (`?`) + Hemos recibido requisitos actualizados de nuestros usuarios. Ahora los identificadores pueden comenzar opcionalmente con una letra. Ya conocemos la clase de caracteres para esto, así que agreguémosla a nuestra expresión regular: ```js @@ -122,6 +130,8 @@ console.log(regex.test("1234567")); // false Nuestro patrón ahora permite una única letra opcional, seguida de cuatro a seis dígitos. +### El cuantificador de asterisco (`*`) + Desafortunadamente, acabamos de darnos cuenta de que leímos mal los requisitos. Debemos permitir cualquier cantidad de letras antes de los números. Podemos usar nuestro cuantificador con `0` como mínimo y sin un máximo definido: ```js @@ -144,6 +154,8 @@ console.log(regex.test("1234567")); // false ::: +### El cuantificador de más (`+`) + Ahora coincidimos con éxito cualquier identificador con cero o más letras seguido de cuatro a seis números. Pero resulta que esto está causando que nuestro sistema falle: en realidad tenemos que exigir al menos una letra. De nuevo, podríamos usar un cuantificador con un mínimo de uno y sin máximo definido, o podríamos usar otra sintaxis especial, el símbolo más (`+`): diff --git a/curriculum/challenges/espanol/blocks/lecture-working-with-the-dom-click-events-and-web-apis/673368ccf52205329b729378.md b/curriculum/challenges/espanol/blocks/lecture-working-with-the-dom-click-events-and-web-apis/673368ccf52205329b729378.md index fda36a47e21..5e8b811afdb 100644 --- a/curriculum/challenges/espanol/blocks/lecture-working-with-the-dom-click-events-and-web-apis/673368ccf52205329b729378.md +++ b/curriculum/challenges/espanol/blocks/lecture-working-with-the-dom-click-events-and-web-apis/673368ccf52205329b729378.md @@ -7,13 +7,17 @@ dashedName: what-is-the-difference-between-innertext-textcontent-and-innerhtml # --interactive-- +## Resumen + Aprendamos sobre `innerText`, `textContent` y `innerHTML`. Estas son propiedades que puedes acceder en JavaScript para obtener o cambiar el contenido de un elemento HTML. Aunque al principio pueden parecer muy similares, realmente tienen diferencias clave. Elegir la correcta depende de tu caso de uso específico, así que profundicemos. Comencemos con `innerText`. -`innerText` representa el contenido de texto visible del elemento HTML y sus descendientes. Esta propiedad no incluye texto oculto ni etiquetas HTML, sólo texto renderizado. +## Entendiendo innerText + +`innerText` representa el contenido de texto visible del elemento HTML y sus descendientes. Esta propiedad no incluye texto oculto ni etiquetas HTML, sólo texto renderizado. Por ejemplo, aquí puedes ver un elemento `div` que contiene dos párrafos: @@ -107,7 +111,9 @@ container.innerText = "JavaScript is awesome!"; Ya que `innerText` toma en cuenta la visibilidad, obtener su valor desencadena un proceso llamado "reflow", que recalcula la posición de ciertos elementos en el sitio web. Este proceso puede ser computacionalmente intensivo, así que deberías evitar desencadenarlo si es posible. -Genial. Ahora hablemos de `textContent`. +Genial. Ahora hablemos de `textContent`. + +## Entendiendo textContent `textContent` devuelve el contenido de texto simple de un elemento, incluyendo todo el texto dentro de sus descendientes. @@ -181,6 +187,8 @@ container.textContent = "New content"; ::: +## Comparación con innerHTML + Y finalmente, hablemos de cómo `textContent` e `innerText` difieren de `innerHTML`. Recuerda que con `innerHTML` puedes establecer el contenido interno HTML de un elemento. Esto es útil para inyectar nuevo HTML en el DOM dinámicamente. @@ -189,6 +197,8 @@ Sin embargo, recuerda que esto plantea un riesgo de seguridad si no tienes contr Para evitar esto, se recomienda usar la propiedad `textContent` para insertar texto simple. +## Resumen de las diferencias clave + Las propiedades `innerText`, `textContent` e `innerHTML` en JavaScript ofrecen diferentes maneras de acceder y manipular el contenido de los elementos HTML. Debes entender las diferencias entre estas propiedades si tu objetivo es trabajar eficientemente con el contenido HTML en JavaScript. # --questions-- diff --git a/curriculum/challenges/espanol/blocks/machine-learning-with-python-projects/5e46f8d6ac417301a38fb92d.md b/curriculum/challenges/espanol/blocks/machine-learning-with-python-projects/5e46f8d6ac417301a38fb92d.md index 9ddeb85cbf0..83d6560d08b 100644 --- a/curriculum/challenges/espanol/blocks/machine-learning-with-python-projects/5e46f8d6ac417301a38fb92d.md +++ b/curriculum/challenges/espanol/blocks/machine-learning-with-python-projects/5e46f8d6ac417301a38fb92d.md @@ -10,7 +10,7 @@ dashedName: rock-paper-scissors Para este desafío, crearás un programa para jugar Piedra, Papel o Tijeras. Un programa que elige al azar generalmente ganará el 50% de las veces. Para pasar este desafío, tu programa debe jugar partidas contra cuatro bots diferentes, ganando al menos el 60% de los juegos en cada partida. -Vas a <a href="https://app.ona.com/?autostart=true#https://github.com/freeCodeCamp/boilerplate-rock-paper-scissors/" target="_blank" rel="noopener noreferrer nofollow">trabajar en este proyecto con nuestro código inicial de Ona</a>. +Vas a <a href="https://codespaces.new/freeCodeCamp/boilerplate-rock-paper-scissors/" target="_blank" rel="noopener noreferrer nofollow">trabajar en este proyecto con nuestro código repetitivo inicial</a>. Todavía estamos desarrollando la parte interactiva e instructiva del plan de estudios de machine learning. Por ahora, tendrás que usar otros recursos para aprender cómo superar este desafío. @@ -26,7 +26,7 @@ El archivo `RPS.py` muestra una función de ejemplo que necesitarás actualizar. ## Desarrollo -No modifiques `RPS_game.py`. Escribe todo tu código en `RPS.py`. Para el desarrollo, puedes usar `main.py` para probar tu código. +No modifiques `RPS_game.py`. Escribe todo tu código en `RPS.py`. Para el desarrollo, puedes usar `main.py` para probar tu código. `main.py` importa la función del juego y los bots desde `RPS_game.py`. diff --git a/curriculum/challenges/espanol/blocks/review-introduction-to-express/6a0354d43d4c00eca38561f7.md b/curriculum/challenges/espanol/blocks/review-introduction-to-express/6a0354d43d4c00eca38561f7.md index 6d1528a28d3..f8cc6369857 100644 --- a/curriculum/challenges/espanol/blocks/review-introduction-to-express/6a0354d43d4c00eca38561f7.md +++ b/curriculum/challenges/espanol/blocks/review-introduction-to-express/6a0354d43d4c00eca38561f7.md @@ -7,53 +7,6 @@ dashedName: review-introduction-to-express # --description-- -## Servicios web y APIs - -- **API (interfaz de programación de aplicaciones)**: Una forma general para que el software se comunique con otro software. -- **Servicio web**: Un tipo específico de API que usa tecnologías web como HTTP para intercambiar datos a través de una red. Todo servicio web es una API, pero no toda API es un servicio web. -- **Características clave de un servicio web**: se ejecuta en un servidor, habilita la comunicación máquina a máquina, es independiente del lenguaje, es independiente de la plataforma y usa protocolos web estándar (HTTP/HTTPS, FTP, SMTP). -- **REST (transferencia de estado representacional)**: El tipo de servicio web más usado hoy en día. Expone recursos identificados por rutas URL como `/users` o `/users/20`. Las respuestas suelen estar en JSON, pero también pueden ser XML o texto plano. -- **SOAP (protocolo simple de acceso a objetos)**: Usa solo XML. Común en sistemas empresariales que necesitan estándares y seguridad más estrictos. -- **XML-RPC**: Usa XML para codificar solicitudes y respuestas. Ligero pero menos flexible que REST. -- **Encabezado `Accept`**: Usado por un cliente para indicar al servidor qué formato de respuesta desea, por ejemplo `Accept: application/json`. - -## La arquitectura REST - -- **Sin estado**: Cada solicitud debe incluir toda la información que el servidor necesita para procesarla. El servidor no recuerda solicitudes anteriores. -- **Recurso**: Un dato que puede ser accedido o modificado, identificado por una URL (por ejemplo, `/products/1`). -- **Métodos HTTP en REST**: - - `GET` — recuperar un recurso - - `POST` — crear un recurso nuevo - - `PUT` / `PATCH` — actualizar un recurso existente - - `DELETE` — eliminar un recurso - -## Códigos de estado HTTP - -Después de procesar una solicitud, el servidor responde con un **código de estado** que indica el resultado: - -- `200` **(OK)**: La solicitud fue exitosa -- `201` **(Created)**: Se creó un recurso nuevo -- `400` **(Bad Request)**: El cliente envió datos inválidos -- `404` **(Not Found)**: El recurso solicitado no existe -- `500` **(Internal Server Error)**: Ocurrió un error en el servidor - -### Cómo funciona una solicitud REST - -1. El cliente envía una solicitud con un método, URL, encabezados opcionales y cuerpo opcional. -2. El servidor valida la solicitud e identifica el recurso. -3. El servidor realiza la acción (obtener, crear, actualizar o eliminar). -4. El servidor construye una respuesta con un código de estado y cuerpo opcional (usualmente JSON). -5. El servidor envía la respuesta — no se almacena estado del cliente. -6. El cliente verifica el código de estado y procesa los datos recibidos. - -## Monolitos vs. microservicios - -- **Monolito**: Una base de código grande y única donde la interfaz, base de datos y API conviven juntas. Funciona bien para apps pequeñas pero se vuelve difícil de mantener y escalar al crecer. -- **Microservicios**: Una arquitectura donde una app grande se divide en servicios más pequeños e independientes. Cada servicio maneja una capacidad de negocio (por ejemplo, productos, pedidos, pagos) y puede tener su propia base de código, base de datos y equipo. -- **Cómo se comunican los microservicios**: A través de APIs o sistemas basados en mensajes. -- **Ventajas de los microservicios**: desarrollo más rápido, mejor aislamiento de fallos y libertad para usar distintos lenguajes o frameworks por servicio. -- **Desafíos de los microservicios**: depuración más compleja, gestión de infraestructura más difícil y mayor sobrecarga de red entre servicios. - ## ¿Qué es Express.js? - **Express**: Un framework web minimalista y flexible construido sobre Node.js que facilita crear servidores web y APIs. diff --git a/curriculum/challenges/espanol/blocks/review-rest-api-and-web-services/6a7c78ad958a597ee788ad2a.md b/curriculum/challenges/espanol/blocks/review-rest-api-and-web-services/6a7c78ad958a597ee788ad2a.md new file mode 100644 index 00000000000..c226770791f --- /dev/null +++ b/curriculum/challenges/espanol/blocks/review-rest-api-and-web-services/6a7c78ad958a597ee788ad2a.md @@ -0,0 +1,59 @@ +--- +id: 6a7c78ad958a597ee788ad2a +title: Revisión de API REST y servicios web +challengeType: 31 +dashedName: review-rest-api-and-web-services +--- + +# --description-- + +## Servicios web y APIs + +- **API (interfaz de programación de aplicaciones)**: Una forma general para que el software se comunique con otro software. +- **Servicio web**: Un tipo específico de API que usa tecnologías web como HTTP para intercambiar datos a través de una red. Todo servicio web es una API, pero no toda API es un servicio web. +- **Características clave de un servicio web**: se ejecuta en un servidor, habilita la comunicación máquina a máquina, es independiente del lenguaje, es independiente de la plataforma y usa protocolos web estándar (HTTP/HTTPS, FTP, SMTP). +- **REST (transferencia de estado representacional)**: El tipo de servicio web más usado hoy en día. Expone recursos identificados por rutas URL como `/users` o `/users/20`. Las respuestas suelen estar en JSON, pero también pueden ser XML o texto plano. +- **SOAP (protocolo simple de acceso a objetos)**: Usa solo XML. Común en sistemas empresariales que necesitan estándares y seguridad más estrictos. +- **XML-RPC**: Usa XML para codificar solicitudes y respuestas. Ligero pero menos flexible que REST. +- **Encabezado `Accept`**: Usado por un cliente para indicar al servidor qué formato de respuesta desea, por ejemplo `Accept: application/json`. + +## La arquitectura REST + +- **Sin estado**: Cada solicitud debe incluir toda la información que el servidor necesita para procesarla. El servidor no recuerda solicitudes anteriores. +- **Recurso**: Un dato que puede ser accedido o modificado, identificado por una URL (por ejemplo, `/products/1`). +- **Métodos HTTP en REST**: + - `GET` — recuperar un recurso + - `POST` — crear un recurso nuevo + - `PUT` / `PATCH` — actualizar un recurso existente + - `DELETE` — eliminar un recurso + +## Códigos de estado HTTP + +Después de procesar una solicitud, el servidor responde con un **código de estado** que indica el resultado: + +- `200` **(OK)**: La solicitud fue exitosa +- `201` **(Created)**: Se creó un recurso nuevo +- `400` **(Bad Request)**: El cliente envió datos inválidos +- `404` **(Not Found)**: El recurso solicitado no existe +- `500` **(Internal Server Error)**: Ocurrió un error en el servidor + +### Cómo funciona una solicitud REST + +1. El cliente envía una solicitud con un método, URL, encabezados opcionales y cuerpo opcional. +2. El servidor valida la solicitud e identifica el recurso. +3. El servidor realiza la acción (obtener, crear, actualizar o eliminar). +4. El servidor construye una respuesta con un código de estado y cuerpo opcional (usualmente JSON). +5. El servidor envía la respuesta — no se almacena estado del cliente. +6. El cliente verifica el código de estado y procesa los datos recibidos. + +## Monolitos vs. microservicios + +- **Monolito**: Una base de código grande y única donde la interfaz, base de datos y API conviven juntas. Funciona bien para apps pequeñas pero se vuelve difícil de mantener y escalar al crecer. +- **Microservicios**: Una arquitectura donde una app grande se divide en servicios más pequeños e independientes. Cada servicio maneja una capacidad de negocio (por ejemplo, productos, pedidos, pagos) y puede tener su propia base de código, base de datos y equipo. +- **Cómo se comunican los microservicios**: A través de APIs o sistemas basados en mensajes. +- **Ventajas de los microservicios**: desarrollo más rápido, mejor aislamiento de fallos y libertad para usar distintos lenguajes o frameworks por servicio. +- **Desafíos de los microservicios**: depuración más compleja, gestión de infraestructura más difícil y mayor sobrecarga de red entre servicios. + +# --assignment-- + +Revisa los temas y conceptos de API REST y servicios web. diff --git a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e89d557d4b78bf83a02ae6.md b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e89d557d4b78bf83a02ae6.md index cfbc5363663..1842948c25f 100644 --- a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e89d557d4b78bf83a02ae6.md +++ b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e89d557d4b78bf83a02ae6.md @@ -396,10 +396,10 @@ body { const { useState } = React; export const FootballPlayerCard = () => { - return ( + return ( --fcc-editable-region-- - <h1 style={{ backgroundColor: '#fff' }}>Hello, TSX!</h1> + <h1 style={{ backgroundColor: "#fff" }}>Hello, TSX!</h1> --fcc-editable-region-- - ) + ); }; ``` diff --git a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb2.md b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb2.md index b179eacdac3..cb5ed9c5561 100644 --- a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb2.md +++ b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb2.md @@ -29,12 +29,10 @@ assert.equal(element?.type, window.index.PlayerCard); <meta charset="utf-8"/> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Football Player Card Builder - - - + @@ -379,21 +377,18 @@ body { ```tsx const { useState } = React; -export function PlayerCard() { +export const PlayerCard = () => { return ( -
- -
+
); -} +}; export const FootballPlayerCard = () => { - + --fcc-editable-region-- return ( - --fcc-editable-region-- -

Football Card Builder

- --fcc-editable-region-- - ) +

Football Card Builder

+ ); + --fcc-editable-region-- }; ``` diff --git a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb3.md b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb3.md index ac08dd4de81..2467fc3178f 100644 --- a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb3.md +++ b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb3.md @@ -382,15 +382,13 @@ export const PlayerCard = () => { return (
--fcc-editable-region-- - + --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { - return ( - - ); + return ; }; ``` diff --git a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb4.md b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb4.md index 755dcddd712..af2c521f49e 100644 --- a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb4.md +++ b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb4.md @@ -381,12 +381,12 @@ export const PlayerCard = () => {
--fcc-editable-region-- - + --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb5.md b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb5.md index 28a94201dbc..285e5bfc430 100644 --- a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb5.md +++ b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb5.md @@ -394,13 +394,13 @@ export const PlayerCard = () => {
--fcc-editable-region-- - + --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb6.md b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb6.md index c62c0d9348b..008f658c6f7 100644 --- a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb6.md +++ b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb6.md @@ -390,14 +390,14 @@ export const PlayerCard = () => {
98
--fcc-editable-region-- - + --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb7.md b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb7.md index 6260a8ee9ac..733035a2e29 100644 --- a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb7.md +++ b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb7.md @@ -398,13 +398,13 @@ export const PlayerCard = () => {
ST
--fcc-editable-region-- - + --fcc-editable-region-- ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb8.md b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb8.md index 3fb66badf59..53393e07e6f 100644 --- a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb8.md +++ b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb8.md @@ -394,14 +394,14 @@ export const PlayerCard = () => {
GOLD
--fcc-editable-region-- - + --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb9.md b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb9.md index b4b1d3503b7..a51598ca3fc 100644 --- a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb9.md +++ b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb9.md @@ -393,12 +393,12 @@ export const PlayerCard = () => { --fcc-editable-region-- - + --fcc-editable-region-- ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bba.md b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bba.md index 55864fb949c..baf8fe59223 100644 --- a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bba.md +++ b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bba.md @@ -412,13 +412,13 @@ export const PlayerCard = () => {
--fcc-editable-region-- - + --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbb.md b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbb.md index 6eb4a47d465..4120dffdd9f 100644 --- a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbb.md +++ b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbb.md @@ -406,12 +406,12 @@ export const PlayerCard = () => { Edson Arantes do Nascimento (Pele) headshot --fcc-editable-region-- - + --fcc-editable-region-- ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbc.md b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbc.md index 6af1dea2cf9..8605e8195ed 100644 --- a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbc.md +++ b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbc.md @@ -409,12 +409,12 @@ export const PlayerCard = () => { PELE --fcc-editable-region-- - + --fcc-editable-region-- ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbd.md b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbd.md index 9d9ce76f77d..3f88e469b0f 100644 --- a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbd.md +++ b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbd.md @@ -427,13 +427,13 @@ export const PlayerCard = () => { --fcc-editable-region-- - + --fcc-editable-region-- ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbe.md b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbe.md index 4a2dae4d498..5e0afab0452 100644 --- a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbe.md +++ b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbe.md @@ -465,7 +465,7 @@ export const PlayerCard = () => { ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbf.md b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbf.md index 1e003b70bdf..787d42b7458 100644 --- a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbf.md +++ b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbf.md @@ -420,7 +420,7 @@ interface PlayerData { position: string; club: string; --fcc-editable-region-- - + --fcc-editable-region-- } @@ -478,7 +478,7 @@ export const PlayerCard = () => { ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc0.md b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc0.md index ab3e2c533d5..b780479b62e 100644 --- a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc0.md +++ b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc0.md @@ -497,7 +497,7 @@ export const PlayerCard = () => { ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc1.md b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc1.md index d726bbcaa9e..acda3d53f49 100644 --- a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc1.md +++ b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc1.md @@ -398,10 +398,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } --fcc-editable-region-- @@ -460,7 +460,7 @@ export const PlayerCard = () => { ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc2.md b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc2.md index bfccaf13eb7..1da298b0f78 100644 --- a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc2.md +++ b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc2.md @@ -40,12 +40,10 @@ assert.exists(document.querySelector('.card-wrapper.tier-elite')); Football Player Card Builder - - - + @@ -405,10 +403,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -467,9 +465,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc3.md b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc3.md index 1036c5abf02..e180abc2a57 100644 --- a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc3.md +++ b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc3.md @@ -399,10 +399,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -461,9 +461,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc4.md b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc4.md index 7198509d366..99a2d67fb9d 100644 --- a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc4.md +++ b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc4.md @@ -399,10 +399,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -461,9 +461,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc5.md b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc5.md index 65e9cf4b94d..4d1b82e0d40 100644 --- a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc5.md +++ b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc5.md @@ -392,10 +392,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -456,9 +456,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc6.md b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc6.md index 2d9f7bcfb86..5781bd2b2c6 100644 --- a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc6.md +++ b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc6.md @@ -401,10 +401,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -465,9 +465,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc7.md b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc7.md index 67a334ad0b1..f6aba47eeab 100644 --- a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc7.md +++ b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc7.md @@ -391,10 +391,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -455,9 +455,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc8.md b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc8.md index 19eef3b97da..e1c9d05b14d 100644 --- a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc8.md +++ b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc8.md @@ -407,10 +407,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -436,9 +436,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { {player.name}
- --fcc-editable-region--
+ --fcc-editable-region-- 97 PAC
@@ -448,10 +448,10 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
83 + --fcc-editable-region-- PAS
- --fcc-editable-region--
@@ -471,9 +471,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc9.md b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc9.md index 3cc3fde40a2..ebb394d8ad2 100644 --- a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc9.md +++ b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc9.md @@ -483,10 +483,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -545,13 +545,13 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
); -} +}; --fcc-editable-region-- --fcc-editable-region-- export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bca.md b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bca.md index 9d0d4630968..b661041aad6 100644 --- a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bca.md +++ b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bca.md @@ -419,10 +419,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -481,14 +481,14 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { - name: 'PELE', + name: "PELE", overallRating: 98, - position: 'ST', - club: 'Santos FC', - imageUrl: 'https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg', + position: "ST", + club: "Santos FC", + imageUrl: "https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg", pac: 97, sho: 98, pas: 83, diff --git a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcb.md b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcb.md index bdbedbf90a6..de186792a5e 100644 --- a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcb.md +++ b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcb.md @@ -435,10 +435,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -497,14 +497,14 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { - name: 'PELE', + name: "PELE", overallRating: 98, - position: 'ST', - club: 'Santos FC', - imageUrl: 'https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg', + position: "ST", + club: "Santos FC", + imageUrl: "https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg", pac: 97, sho: 98, pas: 83, @@ -517,6 +517,7 @@ export const FootballPlayerCard = () => { const [player, setPlayer] = useState(defaultPlayer); return ( --fcc-editable-region-- + --fcc-editable-region-- ); diff --git a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcc.md b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcc.md index 65f35c98192..504d2dce850 100644 --- a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcc.md +++ b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcc.md @@ -477,7 +477,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -504,7 +504,9 @@ export const FootballPlayerCard = () => { --fcc-editable-region-- + + --fcc-editable-region-- ); diff --git a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcd.md b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcd.md index e58b8963739..6db4a149820 100644 --- a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcd.md +++ b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcd.md @@ -465,7 +465,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bce.md b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bce.md index 0f6224ea512..325ad3c0013 100644 --- a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bce.md +++ b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bce.md @@ -470,7 +470,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcf.md b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcf.md index 00e3d3c3b7c..b1c5af37805 100644 --- a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcf.md +++ b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcf.md @@ -488,7 +488,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd0.md b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd0.md index 98029a6d6bb..b048692e206 100644 --- a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd0.md +++ b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd0.md @@ -471,7 +471,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd1.md b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd1.md index fee7e1e9f53..bf7e4ce2595 100644 --- a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd1.md +++ b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd1.md @@ -471,7 +471,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd2.md b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd2.md index b3b3b5c847d..6643a0ec5d6 100644 --- a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd2.md +++ b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd2.md @@ -471,7 +471,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -535,7 +535,7 @@ export const FootballPlayerCard = () => { - --fcc-editable-region-- + --fcc-editable-region-- --fcc-editable-region-- diff --git a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd3.md b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd3.md index 0d523e7a73c..89e1e2c5cdf 100644 --- a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd3.md +++ b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd3.md @@ -497,7 +497,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd4.md b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd4.md index d4a4e858402..ba6cf3e39dd 100644 --- a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd4.md +++ b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd4.md @@ -497,7 +497,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd5.md b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd5.md index e4d78f48f76..3f563d32444 100644 --- a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd5.md +++ b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd5.md @@ -497,7 +497,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd6.md b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd6.md index 785e8d29423..0878314fd12 100644 --- a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd6.md +++ b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd6.md @@ -470,7 +470,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd7.md b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd7.md index 6b3b4305b3b..edd85e31e61 100644 --- a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd7.md +++ b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd7.md @@ -478,7 +478,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -609,3 +609,4 @@ export const FootballPlayerCard = () => { ); }; ``` + diff --git a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd8.md b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd8.md index 61ec0977119..85a2b7c6dca 100644 --- a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd8.md +++ b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd8.md @@ -410,7 +410,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -484,7 +484,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -538,8 +538,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd9.md b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd9.md index 7cb009c6fb0..c0adc6ff568 100644 --- a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd9.md +++ b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd9.md @@ -402,7 +402,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -476,7 +476,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -530,8 +530,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bda.md b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bda.md index be0b9cb9df3..1236aca8137 100644 --- a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bda.md +++ b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bda.md @@ -402,7 +402,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -476,7 +476,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -530,8 +530,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( @@ -640,3 +641,4 @@ export const FootballPlayerCard = () => { ); }; ``` + diff --git a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdb.md b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdb.md index 8aa4f3667ca..6db29d43582 100644 --- a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdb.md +++ b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdb.md @@ -1,6 +1,6 @@ --- id: 69e8b296388ebbd517692bdb -title: Paso 58 +title: Preparación 58 challengeType: 0 dashedName: step-58 --- @@ -402,7 +402,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -476,7 +476,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -530,8 +530,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdc.md b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdc.md index 995813b4b47..9c153478c81 100644 --- a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdc.md +++ b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdc.md @@ -402,7 +402,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -476,7 +476,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -530,8 +530,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdd.md b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdd.md index 1b9e75ec80a..fed1fe8fd5f 100644 --- a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdd.md +++ b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdd.md @@ -402,7 +402,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -476,7 +476,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -530,8 +530,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bde.md b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bde.md index 8c85068f363..140267e2669 100644 --- a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bde.md +++ b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bde.md @@ -402,7 +402,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -414,10 +414,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -430,7 +430,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
{player.position}
-
{getPlayerTier(player.overallRating).toUpperCase()}
+
+ {getPlayerTier(player.overallRating).toUpperCase()} +
{player.club}
@@ -474,14 +476,14 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { - name: 'PELE', + name: "PELE", overallRating: 98, - position: 'ST', - club: 'Santos FC', - imageUrl: 'https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg', + position: "ST", + club: "Santos FC", + imageUrl: "https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg", pac: 97, sho: 98, pas: 83, @@ -506,8 +508,18 @@ export const FootballPlayerCard = () => {

Player Info

- - setPlayer({ ...player, name: e.target.value })} /> + + + setPlayer({ ...player, name: e.target.value }) + } + />
@@ -518,8 +530,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( @@ -531,46 +544,115 @@ export const FootballPlayerCard = () => {
- - setPlayer({ ...player, overallRating: Number(e.target.value) })} /> + + + setPlayer({ + ...player, + overallRating: Number(e.target.value), + }) + } + />
- - setPlayer({ ...player, club: e.target.value })} /> + + + setPlayer({ ...player, club: e.target.value }) + } + />
- - setPlayer({ ...player, imageUrl: e.target.value })} /> + + + setPlayer({ ...player, imageUrl: e.target.value }) + } + />

Player Stats

- - setPlayer({ ...player, pac: Number(e.target.value) })} /> + + + setPlayer({ ...player, pac: Number(e.target.value) }) + } + />
- - setPlayer({ ...player, sho: Number(e.target.value) })} /> + + + setPlayer({ ...player, sho: Number(e.target.value) }) + } + />
- - setPlayer({ ...player, pas: Number(e.target.value) })} /> + + + setPlayer({ ...player, pas: Number(e.target.value) }) + } + />
- + --fcc-editable-region-- --fcc-editable-region--
- +
- +
@@ -579,7 +661,9 @@ export const FootballPlayerCard = () => {

Live Preview

Updates as you type

-
+
@@ -589,3 +673,4 @@ export const FootballPlayerCard = () => { ); }; ``` + diff --git a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdf.md b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdf.md index fb896878590..b5d54764b20 100644 --- a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdf.md +++ b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdf.md @@ -421,7 +421,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -495,7 +495,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -549,8 +549,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( @@ -667,11 +668,11 @@ export const FootballPlayerCard = () => { } /> - --fcc-editable-region--
+ --fcc-editable-region--
@@ -679,8 +680,8 @@ export const FootballPlayerCard = () => { PHY -
--fcc-editable-region-- + diff --git a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8d1be04ed6aad1c955729.md b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8d1be04ed6aad1c955729.md index 548857417d6..d686297ef5f 100644 --- a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8d1be04ed6aad1c955729.md +++ b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69e8d1be04ed6aad1c955729.md @@ -391,8 +391,8 @@ const { useState } = React; --fcc-editable-region-- export const FootballPlayerCard = () => { - return ( -

Football Card Builder

- ) + return ( +

Football Card Builder

+ ); }; ``` diff --git a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69ea01c45b04f3e9de845036.md b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69ea01c45b04f3e9de845036.md index 87f3567bb3a..23d7e13dd24 100644 --- a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69ea01c45b04f3e9de845036.md +++ b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69ea01c45b04f3e9de845036.md @@ -405,7 +405,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -483,7 +483,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -537,8 +537,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69ea02adff0fd528639ee23b.md b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69ea02adff0fd528639ee23b.md index 73cafef9417..d5f7bdcba21 100644 --- a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69ea02adff0fd528639ee23b.md +++ b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69ea02adff0fd528639ee23b.md @@ -409,7 +409,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -485,7 +485,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -543,8 +543,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69ea0349f8305a99324465ff.md b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69ea0349f8305a99324465ff.md index 5111d6a8573..9bf1ae9d90e 100644 --- a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69ea0349f8305a99324465ff.md +++ b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69ea0349f8305a99324465ff.md @@ -407,7 +407,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -483,7 +483,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -502,11 +502,9 @@ const defaultPlayer: PlayerData = { function loadPlayer(): PlayerData { try { --fcc-editable-region-- - - --fcc-editable-region-- - } catch (error) { - } + --fcc-editable-region-- + } catch (error) {} } export const FootballPlayerCard = () => { @@ -547,8 +545,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69ea044f8c93a5e7ce64214c.md b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69ea044f8c93a5e7ce64214c.md index 5a37dc3b4a6..81a1a156dd2 100644 --- a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69ea044f8c93a5e7ce64214c.md +++ b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69ea044f8c93a5e7ce64214c.md @@ -395,7 +395,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -471,7 +471,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -492,12 +492,10 @@ function loadPlayer(): PlayerData { const saved = localStorage.getItem(STORAGE_KEY); if (saved) { --fcc-editable-region-- - + --fcc-editable-region-- - }; - } catch (error) { - - } + } + } catch (error) {} } export const FootballPlayerCard = () => { @@ -538,8 +536,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69ea0577f25e519489353f82.md b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69ea0577f25e519489353f82.md index 975677a4dfb..af0c8ab23e6 100644 --- a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69ea0577f25e519489353f82.md +++ b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69ea0577f25e519489353f82.md @@ -405,7 +405,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -418,7 +418,6 @@ interface PlayerData { const STORAGE_KEY = "football_player_card"; - export function getPlayerTier(rating: number): string { if (rating >= 92) return "elite"; if (rating >= 85) return "gold"; @@ -482,7 +481,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -505,14 +504,15 @@ function loadPlayer(): PlayerData { return { ...defaultPlayer, ...JSON.parse(saved) - } - }; ---fcc-editable-region-- + }; + } } catch (error) { +--fcc-editable-region-- } -} + --fcc-editable-region-- +} export const FootballPlayerCard = () => { const [player, setPlayer] = useState(defaultPlayer); @@ -552,8 +552,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69ea064edb0dcc46e1422cca.md b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69ea064edb0dcc46e1422cca.md index 68e3d859123..fd747b154b3 100644 --- a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69ea064edb0dcc46e1422cca.md +++ b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69ea064edb0dcc46e1422cca.md @@ -401,7 +401,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -477,7 +477,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -500,8 +500,8 @@ function loadPlayer(): PlayerData { return { ...defaultPlayer, ...JSON.parse(saved) - } - }; + }; + } } catch (error) { console.log("Failed to load player data, using defaults:", error); } @@ -546,8 +546,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69ea0939f2f92cfc6c7a850d.md b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69ea0939f2f92cfc6c7a850d.md index 60b6ba33c33..97a8fe8a482 100644 --- a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69ea0939f2f92cfc6c7a850d.md +++ b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69ea0939f2f92cfc6c7a850d.md @@ -46,12 +46,10 @@ assert.match(__helpers.removeJSComments(code), /useEffect\s*\(\(\)\s=>\s*\{\s*tr Football Player Card Builder - - - + @@ -415,7 +413,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -435,7 +433,7 @@ export function getPlayerTier(rating: number): string { return "bronze"; } -function PlayerCard({ player }: { player: PlayerData }) { +export const PlayerCard = ({ player }: { player: PlayerData }) => { return (
@@ -491,7 +489,7 @@ function PlayerCard({ player }: { player: PlayerData }) {
); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -514,8 +512,8 @@ function loadPlayer(): PlayerData { return { ...defaultPlayer, ...JSON.parse(saved) - } - }; + }; + } } catch (error) { console.log("Failed to load player data, using defaults:", error); } @@ -526,7 +524,7 @@ export const FootballPlayerCard = () => { const [player, setPlayer] = useState(defaultPlayer); --fcc-editable-region-- - + --fcc-editable-region-- return ( @@ -565,8 +563,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69ea0a89bd84cf2461b48ceb.md b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69ea0a89bd84cf2461b48ceb.md index 64eb0130c11..b5edd3b14f6 100644 --- a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69ea0a89bd84cf2461b48ceb.md +++ b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69ea0a89bd84cf2461b48ceb.md @@ -403,7 +403,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -479,7 +479,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -502,8 +502,8 @@ function loadPlayer(): PlayerData { return { ...defaultPlayer, ...JSON.parse(saved) - } - }; + }; + } } catch (error) { console.log("Failed to load player data, using defaults:", error); } @@ -513,15 +513,15 @@ function loadPlayer(): PlayerData { export const FootballPlayerCard = () => { const [player, setPlayer] = useState(defaultPlayer); ---fcc-editable-region-- useEffect(() => { try { +--fcc-editable-region-- } catch (error) { +--fcc-editable-region-- } }, [player]); ---fcc-editable-region-- return (
@@ -559,8 +559,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69ea0bb3e7000f44c207bb0e.md b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69ea0bb3e7000f44c207bb0e.md index aef0f108218..faa55ce1897 100644 --- a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69ea0bb3e7000f44c207bb0e.md +++ b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69ea0bb3e7000f44c207bb0e.md @@ -401,7 +401,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -477,7 +477,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -500,8 +500,8 @@ function loadPlayer(): PlayerData { return { ...defaultPlayer, ...JSON.parse(saved) - } - }; + }; + } } catch (error) { console.log("Failed to load player data, using defaults:", error); } @@ -557,8 +557,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( @@ -1098,7 +1099,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -1174,7 +1175,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -1197,8 +1198,8 @@ function loadPlayer(): PlayerData { return { ...defaultPlayer, ...JSON.parse(saved) - } - }; + }; + } } catch (error) { console.log("Failed to load player data, using defaults:", error); } @@ -1252,8 +1253,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69ea1bb4a66dd6debb999c7f.md b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69ea1bb4a66dd6debb999c7f.md index 91b390324eb..885988cd8b4 100644 --- a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69ea1bb4a66dd6debb999c7f.md +++ b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69ea1bb4a66dd6debb999c7f.md @@ -473,7 +473,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69ea1dd8e74976afa407bf22.md b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69ea1dd8e74976afa407bf22.md index df2e0baac4b..8f8162394c2 100644 --- a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69ea1dd8e74976afa407bf22.md +++ b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69ea1dd8e74976afa407bf22.md @@ -479,7 +479,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69ea1ed1543a4db863564aac.md b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69ea1ed1543a4db863564aac.md index 037153f41c3..553fdbccfaf 100644 --- a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69ea1ed1543a4db863564aac.md +++ b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69ea1ed1543a4db863564aac.md @@ -472,7 +472,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69ea21dcd8c4cb48c23a2c67.md b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69ea21dcd8c4cb48c23a2c67.md index 2fc67d2c795..9b339a7ee4b 100644 --- a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69ea21dcd8c4cb48c23a2c67.md +++ b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69ea21dcd8c4cb48c23a2c67.md @@ -7,14 +7,14 @@ dashedName: step-53 # --description-- -Agrega un atributo `onChange` asignado a una función flecha que toma `e` como parámetro y llama a `setPlayer` con un spread de `player` y `position` establecido en `e.target.value`, convertido a `Position`. +Agrega un atributo `onChange` asignado a una función flecha que toma `e` como parámetro y llama a `setPlayer` con un spread de `player` y `position` establecido en `e.target.value`, convertido a `Position`. # --hints-- Tu posición `select` debe tener un manejador `onChange` que llame a `setPlayer` con un spread de `player` y actualice `position`. ```js -assert.match(__helpers.removeJSComments(code), /onChange.*setPlayer.*\.\.\.\s*player[\s\S]*position/); +assert.match(__helpers.removeJSComments(code), /onChange=\{[\s\S]*?position:\s*e\.target\.value\s+as\s+Position/); ``` # --seed-- @@ -469,7 +469,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69ea2378f3c6a60a57cc29c3.md b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69ea2378f3c6a60a57cc29c3.md index d3c189d6045..ba6bfd3a880 100644 --- a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69ea2378f3c6a60a57cc29c3.md +++ b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69ea2378f3c6a60a57cc29c3.md @@ -1,6 +1,6 @@ --- id: 69ea2378f3c6a60a57cc29c3 -title: Paso 54 +title: Pasaje 54 challengeType: 0 dashedName: step-54 --- @@ -483,7 +483,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -537,10 +537,12 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > --fcc-editable-region-- - + --fcc-editable-region-- diff --git a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69eb216380522cfc11aa408c.md b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69eb216380522cfc11aa408c.md index 4798342077c..8fd0abfd2bf 100644 --- a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69eb216380522cfc11aa408c.md +++ b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69eb216380522cfc11aa408c.md @@ -443,7 +443,7 @@ export const PlayerCard = () => { ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69eb23665c115447405343ac.md b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69eb23665c115447405343ac.md index 6fba5717c12..4dd1388ab98 100644 --- a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69eb23665c115447405343ac.md +++ b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69eb23665c115447405343ac.md @@ -461,7 +461,7 @@ export const PlayerCard = () => { ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69eb2847cc8f5638e226e8ce.md b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69eb2847cc8f5638e226e8ce.md index 44355c5eebf..49fdc99edc6 100644 --- a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69eb2847cc8f5638e226e8ce.md +++ b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69eb2847cc8f5638e226e8ce.md @@ -483,10 +483,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -543,7 +543,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { --fcc-editable-region-- diff --git a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69ed3985819de69de27c4390.md b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69ed3985819de69de27c4390.md index 12c01069a72..9afaeaadc32 100644 --- a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69ed3985819de69de27c4390.md +++ b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69ed3985819de69de27c4390.md @@ -391,10 +391,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -453,14 +453,14 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { - name: 'PELE', + name: "PELE", overallRating: 98, - position: 'ST', - club: 'Santos FC', - imageUrl: 'https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg', + position: "ST", + club: "Santos FC", + imageUrl: "https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg", pac: 97, sho: 98, pas: 83, @@ -471,7 +471,7 @@ const defaultPlayer: PlayerData = { export const FootballPlayerCard = () => { --fcc-editable-region-- - return ; + return ; --fcc-editable-region-- }; ``` diff --git a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69f1a6f57dd2d4685822074a.md b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69f1a6f57dd2d4685822074a.md index 64f92553478..b2c2c197b86 100644 --- a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69f1a6f57dd2d4685822074a.md +++ b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69f1a6f57dd2d4685822074a.md @@ -401,8 +401,8 @@ export const PlayerCard = () => {
- --fcc-editable-region--
+ --fcc-editable-region--
@@ -410,14 +410,14 @@ export const PlayerCard = () => {
-
--fcc-editable-region-- +
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69f1a9e19340f19b1fd051c6.md b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69f1a9e19340f19b1fd051c6.md index 3ec61802e1f..00c301ba583 100644 --- a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69f1a9e19340f19b1fd051c6.md +++ b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69f1a9e19340f19b1fd051c6.md @@ -416,9 +416,9 @@ export const PlayerCard = () => {
- --fcc-editable-region--
+ --fcc-editable-region--
@@ -426,14 +426,14 @@ export const PlayerCard = () => {
+ --fcc-editable-region--
- --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69f1af24b0860d13f0b295e5.md b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69f1af24b0860d13f0b295e5.md index f4a24437048..fc399b5ea0f 100644 --- a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69f1af24b0860d13f0b295e5.md +++ b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69f1af24b0860d13f0b295e5.md @@ -407,10 +407,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -451,9 +451,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
- --fcc-editable-region--
+ --fcc-editable-region-- 99 DRI
@@ -463,17 +463,17 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
75 + --fcc-editable-region-- PHY
- --fcc-editable-region-- ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69f1b1fb36c6c0c80907e8e1.md b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69f1b1fb36c6c0c80907e8e1.md index 6e233ec9d3d..8c48a39a147 100644 --- a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69f1b1fb36c6c0c80907e8e1.md +++ b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69f1b1fb36c6c0c80907e8e1.md @@ -483,7 +483,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -511,17 +511,15 @@ export const FootballPlayerCard = () => {
- --fcc-editable-region-- -
- -
+
+ --fcc-editable-region--
+ --fcc-editable-region--
- --fcc-editable-region-- ); }; diff --git a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69f1b591221851200c734eb4.md b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69f1b591221851200c734eb4.md index 3cb0dfdfb63..13bc089b069 100644 --- a/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69f1b591221851200c734eb4.md +++ b/curriculum/challenges/espanol/blocks/workshop-build-a-football-player-card-builder/69f1b591221851200c734eb4.md @@ -472,7 +472,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f356ed6199b0cdef1d2be8f.md b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f356ed6199b0cdef1d2be8f.md index ccdbbfd66d9..4e04a72dfb4 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f356ed6199b0cdef1d2be8f.md +++ b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f356ed6199b0cdef1d2be8f.md @@ -13,11 +13,11 @@ Aprendiste cómo trabajar con selectores `class` en lecciones anteriores como es ```css .class-name { - styles + property: value; } ``` -Cambia el selector existente `#menu` a un selector de clase, reemplazando `#menu` con una clase llamada `.menu`. +Cambia el selector `#menu` existente por un selector de clase reemplazando `#menu` con el selector de clase `.menu`. # --hints-- diff --git a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f3cade99dda4e6071a85dfd.md b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f3cade99dda4e6071a85dfd.md index f051361ad35..f6e354e9029 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f3cade99dda4e6071a85dfd.md +++ b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f3cade99dda4e6071a85dfd.md @@ -109,7 +109,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f3ef6e01f288a026d709587.md b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f3ef6e01f288a026d709587.md index 5966ad632bb..d2394c826de 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f3ef6e01f288a026d709587.md +++ b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f3ef6e01f288a026d709587.md @@ -171,7 +171,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f3ef6e03d719d5ac4738993.md b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f3ef6e03d719d5ac4738993.md index d9a25594272..bfa8201b1c6 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f3ef6e03d719d5ac4738993.md +++ b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f3ef6e03d719d5ac4738993.md @@ -115,7 +115,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f3ef6e04559b939080db057.md b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f3ef6e04559b939080db057.md index d3676be624b..e3091efee79 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f3ef6e04559b939080db057.md +++ b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f3ef6e04559b939080db057.md @@ -139,7 +139,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f3ef6e050279c7a4a7101d3.md b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f3ef6e050279c7a4a7101d3.md index 59905225975..5514a8d5578 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f3ef6e050279c7a4a7101d3.md +++ b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f3ef6e050279c7a4a7101d3.md @@ -137,7 +137,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f3ef6e05473f91f948724ab.md b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f3ef6e05473f91f948724ab.md index 1c6e07c3fef..b19235f553f 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f3ef6e05473f91f948724ab.md +++ b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f3ef6e05473f91f948724ab.md @@ -116,6 +116,6 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f3ef6e056bdde6ae6892ba2.md b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f3ef6e056bdde6ae6892ba2.md index 5cd69e591ea..6ea4d0525c9 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f3ef6e056bdde6ae6892ba2.md +++ b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f3ef6e056bdde6ae6892ba2.md @@ -9,7 +9,7 @@ dashedName: step-54 Es un poco aburrido que todo el texto tenga el mismo tipo de fuente (`font-family`). Aún puedes tener la mayoría del texto con la fuente `sans-serif` y hacer que solo los elementos `h1` y `h2` se vean diferentes utilizando otro selector. -Cambia el estilo de los elementos `h1` y `h2`, utilizando un solo selector, dándoles un tipo de fuente `Impact`. +Estiliza tanto los elementos `h1` como `h2` usando una sola lista de selectores para que el texto de estos elementos use la fuente `Impact`. # --hints-- @@ -135,7 +135,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f3ef6e06d34faac0447fc44.md b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f3ef6e06d34faac0447fc44.md index 75252762017..de6cab2822f 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f3ef6e06d34faac0447fc44.md +++ b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f3ef6e06d34faac0447fc44.md @@ -127,7 +127,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f3ef6e07276f782bb46b93d.md b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f3ef6e07276f782bb46b93d.md index 99c106cbeeb..534016e9f5e 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f3ef6e07276f782bb46b93d.md +++ b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f3ef6e07276f782bb46b93d.md @@ -142,7 +142,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f3ef6e0819d4f23ca7285e6.md b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f3ef6e0819d4f23ca7285e6.md index 3fc7cdc813c..1f634468ef0 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f3ef6e0819d4f23ca7285e6.md +++ b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f3ef6e0819d4f23ca7285e6.md @@ -104,7 +104,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f3ef6e087d56ed3ffdc36be.md b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f3ef6e087d56ed3ffdc36be.md index 89de70879f6..4398da8f2cf 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f3ef6e087d56ed3ffdc36be.md +++ b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f3ef6e087d56ed3ffdc36be.md @@ -129,6 +129,6 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f3ef6e0a81099d9a697b550.md b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f3ef6e0a81099d9a697b550.md index 515126897ed..1620b963122 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f3ef6e0a81099d9a697b550.md +++ b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f3ef6e0a81099d9a697b550.md @@ -167,7 +167,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f3ef6e0b431cc215bb16f55.md b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f3ef6e0b431cc215bb16f55.md index b2b98d12ef9..8c360aeeff8 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f3ef6e0b431cc215bb16f55.md +++ b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f3ef6e0b431cc215bb16f55.md @@ -141,7 +141,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f3ef6e0e0c3feaebcf647ad.md b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f3ef6e0e0c3feaebcf647ad.md index 209dc5a7368..97903a6d59c 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f3ef6e0e0c3feaebcf647ad.md +++ b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f3ef6e0e0c3feaebcf647ad.md @@ -103,7 +103,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f3ef6e0e9629bad967cd71e.md b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f3ef6e0e9629bad967cd71e.md index 7de0722cb5a..9840aa84462 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f3ef6e0e9629bad967cd71e.md +++ b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f3ef6e0e9629bad967cd71e.md @@ -7,7 +7,7 @@ dashedName: step-55 # --description-- -Puedes añadir un valor de respaldo para la propiedad font-family añadiendo una fuente extra separada por una coma. Una fuente de respaldo es utilizada en el caso de que la fuente principal no esté disponible o no se pueda encontrar. +Puedes agregar un valor de respaldo para la `font-family` agregando otro nombre de fuente separado por una coma. Un respaldo se usa cuando la primera fuente no está disponible. Añade la fuente `serif` como un respaldo después de la fuente `Impact`. @@ -113,7 +113,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f3ef6e0eaa7da26e3d34d78.md b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f3ef6e0eaa7da26e3d34d78.md index c03b3043fb5..f2c2939e397 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f3ef6e0eaa7da26e3d34d78.md +++ b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f3ef6e0eaa7da26e3d34d78.md @@ -128,7 +128,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f3ef6e0f8c230bdd2349716.md b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f3ef6e0f8c230bdd2349716.md index 092b68bf0e0..73825dfa069 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f3ef6e0f8c230bdd2349716.md +++ b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f3ef6e0f8c230bdd2349716.md @@ -140,6 +140,6 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f3f26fa39591db45e5cd7a0.md b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f3f26fa39591db45e5cd7a0.md index d37f0e6cca4..4b463f09297 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f3f26fa39591db45e5cd7a0.md +++ b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f3f26fa39591db45e5cd7a0.md @@ -7,7 +7,7 @@ dashedName: step-64 # --description-- -Las propiedades predeterminadas de un elemento `hr` harán que luzca como una línea delgada color gris claro. Puede cambiar la altura de la línea añadiendo una propiedad `height` y dándole un valor. +Las propiedades predeterminadas de un elemento `hr` harán que aparezca como una línea delgada de color gris claro. Puedes cambiar la altura de la línea especificando un valor para la propiedad `height`. Cambia la altura del elemento `hr` a `3px`. @@ -150,7 +150,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f459225127805351a6ad057.md b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f459225127805351a6ad057.md index b06aadb18fe..5ffd5f8aecd 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f459225127805351a6ad057.md +++ b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f459225127805351a6ad057.md @@ -144,7 +144,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f459a7ceb8b5c446656d88b.md b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f459a7ceb8b5c446656d88b.md index 41720c4e68c..11a5169eab2 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f459a7ceb8b5c446656d88b.md +++ b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f459a7ceb8b5c446656d88b.md @@ -147,6 +147,6 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f459cf202c2a3472fae6a9f.md b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f459cf202c2a3472fae6a9f.md index 606ef0de895..a366fc48ff1 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f459cf202c2a3472fae6a9f.md +++ b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f459cf202c2a3472fae6a9f.md @@ -7,7 +7,7 @@ dashedName: step-67 # --description-- -¿Observa cómo el grosor de la línea se ve más grande? El valor predeterminado de la propiedad `border-width` (ancho de borde) es `1px` para todos los lados de los elementos `hr`. Cambiando el borde al mismo color de la línea, la altura total de la línea es de `5px` (`3px` más el ancho del borde superior e inferior de `1px` cada uno). +¿Notas cómo el grosor de la línea parece más grande? El valor predeterminado de una propiedad llamada `border-width` es `1px` para todos los bordes de los elementos `hr`. La altura total de la línea siempre ha sido `5px` (`3px` más el borde superior e inferior de `1px`); colorear el borde hizo visibles esos bordes. Cambia la propiedad `height` del `hr` a `2px`, para que la altura total sea `4px`. @@ -147,7 +147,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f459fd48bdc98491ca6d1a3.md b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f459fd48bdc98491ca6d1a3.md index dde3d547f86..815247a8c41 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f459fd48bdc98491ca6d1a3.md +++ b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f459fd48bdc98491ca6d1a3.md @@ -145,7 +145,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f45a05977e2fa49d9119437.md b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f45a05977e2fa49d9119437.md index be9933486ad..2748a7506f3 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f45a05977e2fa49d9119437.md +++ b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f45a05977e2fa49d9119437.md @@ -146,6 +146,6 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f45a276c093334f0f6e9df4.md b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f45a276c093334f0f6e9df4.md index 20a13f7962b..3070f79a740 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f45a276c093334f0f6e9df4.md +++ b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f45a276c093334f0f6e9df4.md @@ -185,7 +185,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f45a5a7c49a8251f0bdb527.md b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f45a5a7c49a8251f0bdb527.md index d68bec84862..8471596316d 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f45a5a7c49a8251f0bdb527.md +++ b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f45a5a7c49a8251f0bdb527.md @@ -157,7 +157,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f45a66d4a2b0453301e5a26.md b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f45a66d4a2b0453301e5a26.md index 7861aad0b48..fbe3e813226 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f45a66d4a2b0453301e5a26.md +++ b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f45a66d4a2b0453301e5a26.md @@ -166,7 +166,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f45b0731d39e15d54df4dfc.md b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f45b0731d39e15d54df4dfc.md index abdcee3f20b..a3fa5e957ab 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f45b0731d39e15d54df4dfc.md +++ b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f45b0731d39e15d54df4dfc.md @@ -161,7 +161,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f45b25e7ec2405f166b9de1.md b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f45b25e7ec2405f166b9de1.md index d5054cb7662..d8fb1c165c2 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f45b25e7ec2405f166b9de1.md +++ b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f45b25e7ec2405f166b9de1.md @@ -9,7 +9,7 @@ dashedName: step-78 Cambias las propiedades de un enlace cuando el enlace ha sido visitado usando un pseudo-selector que se ve así: `a:visited { propertyName: propertyValue; }`. -Cambia el color del enlace `Visit our website` en el pie de página a `grey` cuando un usuario ha visitado el enlace. +Cambia el color del enlace `Visit our website` del pie de página a `gray` cuando un usuario haya visitado el enlace. # --hints-- @@ -20,14 +20,14 @@ const aVisitedStyle = new __helpers.CSSHelp(document).getStyle('a:visited'); assert.exists(aVisitedStyle); ``` -Debes de darle a la propiedad `color` el valor `grey` (gris). +Debes establecer la propiedad `color` a `gray`. ```js const hasColor = new __helpers.CSSHelp(document).getCSSRules().some(x => (x.style.color === 'grey' || x.style.color === 'gray')); assert.isTrue(hasColor); ``` -`a:visited` Debe tener una propiedad `color` con el valor `grey` (gris). +Tu `a:visited` debe tener un `color` de `gray`. ```js const aVisitedColor = new __helpers.CSSHelp(document).getStyle('a:visited')?.getPropertyValue('color'); @@ -161,7 +161,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f45b3c93c027860d9298dbd.md b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f45b3c93c027860d9298dbd.md index fdf9026ce43..fe0b717e498 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f45b3c93c027860d9298dbd.md +++ b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f45b3c93c027860d9298dbd.md @@ -161,7 +161,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ @@ -179,7 +179,7 @@ a { } a:visited { - color: grey; + color: gray; } --fcc-editable-region-- diff --git a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f45b45d099f3e621fbbb256.md b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f45b45d099f3e621fbbb256.md index 79a139d927e..2700f4bf55e 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f45b45d099f3e621fbbb256.md +++ b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f45b45d099f3e621fbbb256.md @@ -161,7 +161,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ @@ -179,7 +179,7 @@ a { } a:visited { - color: grey; + color: gray; } a:hover { diff --git a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f45b4c81cea7763550e40df.md b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f45b4c81cea7763550e40df.md index 427b53983db..6847d4f361c 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f45b4c81cea7763550e40df.md +++ b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f45b4c81cea7763550e40df.md @@ -152,7 +152,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ @@ -171,7 +171,7 @@ a { --fcc-editable-region-- a:visited { - color: grey; + color: gray; } a:hover { diff --git a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f45b715301bbf667badc04a.md b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f45b715301bbf667badc04a.md index fcdb82fbf2c..7ec72d9b13b 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f45b715301bbf667badc04a.md +++ b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f45b715301bbf667badc04a.md @@ -7,7 +7,7 @@ dashedName: step-82 # --description-- -El texto `CAMPER CAFE` del menú, tiene un espaciado diferente en la parte superior que el espaciado entre la dirección en la parte inferior. Esto se debe a que el navegador tiene un margen superior predeterminado para el elemento `h1`. +El espacio sobre el texto del menú `CAMPER CAFE` no coincide con el espacio debajo de la dirección en la parte inferior del menú. Esto se debe a que el navegador tiene un margen superior predeterminado para el elemento `h1`. Cambia el margen superior (top margin) del elemento `h1` a `0` para eliminar todo el margen superior. @@ -157,7 +157,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f46e270702a8456a664f0df.md b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f46e270702a8456a664f0df.md index 60474fc18ac..6cbea72a86d 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f46e270702a8456a664f0df.md +++ b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f46e270702a8456a664f0df.md @@ -156,7 +156,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f46e36e745ead58487aabf2.md b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f46e36e745ead58487aabf2.md index c69e8d17eab..cb6e0dcb14d 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f46e36e745ead58487aabf2.md +++ b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f46e36e745ead58487aabf2.md @@ -163,7 +163,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f46e7a4750dd05b5a673920.md b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f46e7a4750dd05b5a673920.md index 7265b92b7c4..af77c2ece52 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f46e7a4750dd05b5a673920.md +++ b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f46e7a4750dd05b5a673920.md @@ -160,7 +160,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f46e8284aae155c83015dee.md b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f46e8284aae155c83015dee.md index 0546ddbbe6c..206ed53d410 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f46e8284aae155c83015dee.md +++ b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f46e8284aae155c83015dee.md @@ -9,7 +9,7 @@ dashedName: step-86 El menú se ve bien, pero aparte de la imagen de fondo con los granos de café, es prácticamente solo texto. -En el encabezado `Coffee`, añade una imagen usando la url `https://cdn.freecodecamp.org/curriculum/css-cafe/coffee.jpg`. Dale a la imagen un atributo `alt` con el valor `coffee icon`. +Bajo el título `Coffee`, agrega una imagen usando la URL `https://cdn.freecodecamp.org/curriculum/css-cafe/coffee.jpg`. Dale a la imagen un valor `alt` de `coffee icon`. # --hints-- @@ -105,6 +105,7 @@ assert.match(imageAltValue, /coffee icon/i);

123 Free Code Camp Drive

+ ``` @@ -171,7 +172,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f46ede1ff8fec5ba656b44c.md b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f46ede1ff8fec5ba656b44c.md index 311cabfede3..67238b08783 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f46ede1ff8fec5ba656b44c.md +++ b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f46ede1ff8fec5ba656b44c.md @@ -144,7 +144,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } --fcc-editable-region-- diff --git a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f46fc57528aa1c4b5ea7c2e.md b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f46fc57528aa1c4b5ea7c2e.md index 61cc0999845..7136803dc27 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f46fc57528aa1c4b5ea7c2e.md +++ b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f46fc57528aa1c4b5ea7c2e.md @@ -161,7 +161,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f4701b942c824109626c3d8.md b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f4701b942c824109626c3d8.md index 3af3abe72d7..68b0d6e87ec 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f4701b942c824109626c3d8.md +++ b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f4701b942c824109626c3d8.md @@ -153,6 +153,6 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f475bb508746c16c9431d42.md b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f475bb508746c16c9431d42.md index 6acc2420cde..65038fd4e51 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f475bb508746c16c9431d42.md +++ b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f475bb508746c16c9431d42.md @@ -7,9 +7,9 @@ dashedName: step-87 # --description-- -La imagen que agregaste no está centrada horizontalmente como el encabezado `Coffee` que está arriba. Los elementos `img` son "como" elementos en línea. +La imagen que agregaste no está centrada horizontalmente como el título `Coffee` que está arriba. Los elementos `img` son elementos de nivel en línea, por lo que se sitúan en el flujo del texto. -Para hacer que la imagen se comporte como elementos de nivel de bloque, como los encabezados, crea un selector para el tipo `img`. Establece la propiedad `display` a `block` y usa las propiedades `margin-left` y `margin-right` para centrarlo horizontalmente. +Para que la imagen se comporte como un elemento de nivel bloque, como un título, crea un selector de tipo `img`. Configura la propiedad `display` en `block` y usa las propiedades `margin-left` y `margin-right` para centrarla horizontalmente. # --hints-- @@ -120,6 +120,7 @@ assert.equal(imgMarginRight, 'auto');

123 Free Code Camp Drive

+ ``` @@ -190,7 +191,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f475e1c7f71a61d913836c6.md b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f475e1c7f71a61d913836c6.md index e3f5871bfc8..8b9eba7f062 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f475e1c7f71a61d913836c6.md +++ b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f475e1c7f71a61d913836c6.md @@ -97,6 +97,7 @@ assert.match(lastImage?.alt, /pie icon/i);

123 Free Code Camp Drive

+ ``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f47fe7e31980053a8d4403b.md b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f47fe7e31980053a8d4403b.md index 446e1e23673..a3439dca966 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f47fe7e31980053a8d4403b.md +++ b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f47fe7e31980053a8d4403b.md @@ -7,7 +7,7 @@ dashedName: step-89 # --description-- -Sería mejor si el espacio vertical entre los elementos `h2` y sus respectivos íconos fuera más pequeño. Los elementos `h2` tienen un margen superior e inferior predeterminado, porque no cambias el margen inferior del elemento `h2` a `0` ó algún otro número. +Sería bueno que el espacio vertical entre los elementos `h2` y sus íconos asociados fuera más pequeño. Los elementos `h2` tienen un margen superior e inferior predeterminado, así que podrías cambiar el margen inferior de los elementos `h2` a `0` o a algún otro valor. Hay una forma más fácil, simplemente añade un margen superior negativo a los elementos `img` para moverlos de sus posiciones actuales. Los valores negativos se crean usando un `-` delante del valor. Para completar este taller, adelante y usa un margen superior negativo de `25px` en el selector de tipo `img`. diff --git a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f716ad029ee4053c7027a7a.md b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f716ad029ee4053c7027a7a.md index 9bc686f0a1d..7cd06b61a1d 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f716ad029ee4053c7027a7a.md +++ b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f716ad029ee4053c7027a7a.md @@ -119,7 +119,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f716bee5838c354c728a7c5.md b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f716bee5838c354c728a7c5.md index 6dd637c1f17..c798115f5de 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f716bee5838c354c728a7c5.md +++ b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f716bee5838c354c728a7c5.md @@ -158,6 +158,6 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f7b87422a560036fd03ccff.md b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f7b87422a560036fd03ccff.md index 67d08e73800..8b4042f5a7a 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f7b87422a560036fd03ccff.md +++ b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f7b87422a560036fd03ccff.md @@ -118,7 +118,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f7b88d37b1f98386f04edc0.md b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f7b88d37b1f98386f04edc0.md index 7332a7e926d..d31d060f216 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f7b88d37b1f98386f04edc0.md +++ b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/5f7b88d37b1f98386f04edc0.md @@ -97,6 +97,6 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/6780e8ef4153930b965cd7b7.md b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/6780e8ef4153930b965cd7b7.md index 3431770b5b6..08827a0473b 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/6780e8ef4153930b965cd7b7.md +++ b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/6780e8ef4153930b965cd7b7.md @@ -125,6 +125,6 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/6780f0d898362873ac425dc8.md b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/6780f0d898362873ac425dc8.md index 51ee4cda624..e67ac936e9e 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cafe-menu/6780f0d898362873ac425dc8.md +++ b/curriculum/challenges/espanol/blocks/workshop-cafe-menu/6780f0d898362873ac425dc8.md @@ -156,7 +156,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/espanol/blocks/workshop-calculator/66cc095dfe1682753d2ab030.md b/curriculum/challenges/espanol/blocks/workshop-calculator/66cc095dfe1682753d2ab030.md index 91e07c18737..291df256470 100644 --- a/curriculum/challenges/espanol/blocks/workshop-calculator/66cc095dfe1682753d2ab030.md +++ b/curriculum/challenges/espanol/blocks/workshop-calculator/66cc095dfe1682753d2ab030.md @@ -30,7 +30,10 @@ assert.strictEqual(addTwoAndSeven(), 9); Tu función `addTwoAndSeven` debería devolver la suma usando el operador `+`. ```js -assert.match(code, /return\s*(2\s*\+\s*7|7\s*\+\s*2)\s*;?/); +const explorer = await __helpers.Explorer(code); +const { addTwoAndSeven } = explorer.allFunctions; +const validExpressions = ["2 + 7", "7 + 2", "(2 + 7)", "(7 + 2)"]; +assert.isTrue(validExpressions.some(expr => addTwoAndSeven?.hasReturn(expr))); ``` # --seed-- diff --git a/curriculum/challenges/espanol/blocks/workshop-calculator/66cc0a9e06e00b75d6782be9.md b/curriculum/challenges/espanol/blocks/workshop-calculator/66cc0a9e06e00b75d6782be9.md index 1910afb9fc7..fe3cc3c2c04 100644 --- a/curriculum/challenges/espanol/blocks/workshop-calculator/66cc0a9e06e00b75d6782be9.md +++ b/curriculum/challenges/espanol/blocks/workshop-calculator/66cc0a9e06e00b75d6782be9.md @@ -26,16 +26,12 @@ Ahora deberías ver la suma de `2` y `7` en el registro de la consola. # --hints-- -Deberías tener un `console.log` en tu código. +Debes llamar a la función `addTwoAndSeven` dentro de un `console.log`. ```js -assert.match(code, /console\.log(.*)/); -``` - -Deberías llamar a la función `addTwoAndSeven` dentro del `console.log`. - -```js -assert.match(code, /console\.log\(\s*addTwoAndSeven\(\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(addTwoAndSeven())"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/espanol/blocks/workshop-calculator/66cc0ba5881acb7692cfc4de.md b/curriculum/challenges/espanol/blocks/workshop-calculator/66cc0ba5881acb7692cfc4de.md index 43155f4ad0c..05269ea2e40 100644 --- a/curriculum/challenges/espanol/blocks/workshop-calculator/66cc0ba5881acb7692cfc4de.md +++ b/curriculum/challenges/espanol/blocks/workshop-calculator/66cc0ba5881acb7692cfc4de.md @@ -7,7 +7,7 @@ dashedName: step-4 # --description-- -Ahora, es momento de añadir otra función. +Ahora es momento de agregar otra función. Declare una función llamada `addThreeAndFour` que devuelva la suma de `3` y `4`. @@ -24,22 +24,24 @@ assert.isFunction(addThreeAndFour); Su función `addThreeAndFour` debería devolver la suma de `3` y `4`. ```js -assert.equal(addThreeAndFour(), 7); +assert.strictEqual(addThreeAndFour(), 7); ``` Su función `addThreeAndFour` debería devolver la suma usando el operador `+`. ```js -const declarationStyle = /return\s*\(?\s*(3\s*\+\s*4|4\s*\+\s*3)\s*\)?\s*;?/; -const arrowStyle = /=>\s*\(?\s*(3\s*\+\s*4|4\s*\+\s*3)\s*\)?\s*;?/; -const combinedRegex = new RegExp(`(?:${declarationStyle.source})|(?:${arrowStyle.source})`); -assert.match(code, combinedRegex); +const explorer = await __helpers.Explorer(code); +const { addThreeAndFour } = explorer.allFunctions; +const validExpressions = ["3 + 4", "4 + 3", "(3 + 4)", "(4 + 3)"]; +assert.isTrue(validExpressions.some(expr => addThreeAndFour?.hasReturn(expr))); ``` Debería llamar a la función `addThreeAndFour` dentro de un `console.log`. ```js -assert.match(code, /console\.log\(\s*addThreeAndFour\(\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(addThreeAndFour())"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/espanol/blocks/workshop-calculator/66cc0de2920bec775f610424.md b/curriculum/challenges/espanol/blocks/workshop-calculator/66cc0de2920bec775f610424.md index 743bf948c74..aa95465c6b7 100644 --- a/curriculum/challenges/espanol/blocks/workshop-calculator/66cc0de2920bec775f610424.md +++ b/curriculum/challenges/espanol/blocks/workshop-calculator/66cc0de2920bec775f610424.md @@ -7,7 +7,7 @@ dashedName: step-5 # --description-- -Aunque las funciones funcionan como se espera, hay mucha repetición en tu código. +Aunque las funciones funcionan como se espera, hay mucha repetición en tu código. Dado que estás construyendo una calculadora, no deseas tener que crear una función para cada posible combinación de números que quieras sumar. @@ -22,25 +22,33 @@ En el siguiente paso, repasarás cómo trabajar con parámetros y argumentos en No debes tener una función llamada `addTwoAndSeven`. ```js -assert.notMatch(code, /function\s+addTwoAndSeven\s*\(\s*\)\s*{/); +const explorer = await __helpers.Explorer(code); +const { addTwoAndSeven } = explorer.allFunctions; +assert.notExists(addTwoAndSeven); ``` No debes tener una llamada a la función `addTwoAndSeven`. ```js -assert.notMatch(code, /console\.log\(\s*addTwoAndSeven\(\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const unexpectedStatement = "console.log(addTwoAndSeven())"; +assert.notInclude(strippedCode, unexpectedStatement); ``` No debes tener una función llamada `addThreeAndFour`. ```js -assert.notMatch(code, /function\s+addThreeAndFour\s*\(\s*\)\s*{/); +const explorer = await __helpers.Explorer(code); +const { addThreeAndFour } = explorer.allFunctions; +assert.notExists(addThreeAndFour); ``` No debes tener una llamada a la función `addThreeAndFour`. ```js -assert.notMatch(code, /console\.log\(\s*addThreeAndFour\(\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const unexpectedStatement = "console.log(addThreeAndFour())"; +assert.notInclude(strippedCode, unexpectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/espanol/blocks/workshop-calculator/66cc0f1ae40802781b2ea972.md b/curriculum/challenges/espanol/blocks/workshop-calculator/66cc0f1ae40802781b2ea972.md index 861489b15ac..ac556811559 100644 --- a/curriculum/challenges/espanol/blocks/workshop-calculator/66cc0f1ae40802781b2ea972.md +++ b/curriculum/challenges/espanol/blocks/workshop-calculator/66cc0f1ae40802781b2ea972.md @@ -33,8 +33,11 @@ assert.isFunction(calculateSum); Tu función `calculateSum` debería tomar dos parámetros, `num1` y `num2`. ```js -const regex = __helpers.functionRegex('calculateSum', ['num1', 'num2']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { calculateSum } = explorer.allFunctions; +assert.lengthOf(calculateSum?.parameters, 2); +assert.equal(calculateSum?.parameters[0].toString(), "num1"); +assert.equal(calculateSum?.parameters[1].toString(), "num2"); ``` # --seed-- diff --git a/curriculum/challenges/espanol/blocks/workshop-calculator/66cc12fa504b0479dac479a0.md b/curriculum/challenges/espanol/blocks/workshop-calculator/66cc12fa504b0479dac479a0.md index 6ece3d908f7..40d27559038 100644 --- a/curriculum/challenges/espanol/blocks/workshop-calculator/66cc12fa504b0479dac479a0.md +++ b/curriculum/challenges/espanol/blocks/workshop-calculator/66cc12fa504b0479dac479a0.md @@ -29,7 +29,9 @@ Añade un `console.log` que llame a la función `calculateSum` con los argumento Deberías tener un `console.log` que llame a la función `calculateSum` con los argumentos `2` y `5`. ```js -assert.match(code, /console\.log\(calculateSum\(\s*2\s*,\s*5\)\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const validStatements = ["console.log(calculateSum(2,5))", "console.log(calculateSum(5,2))"]; +assert.isTrue(validStatements.some(stmt => strippedCode.includes(stmt))); ``` # --seed-- diff --git a/curriculum/challenges/espanol/blocks/workshop-calculator/66cc14ca14e65e7a9ebecb80.md b/curriculum/challenges/espanol/blocks/workshop-calculator/66cc14ca14e65e7a9ebecb80.md index 4cbd6842e55..d132a3b1eee 100644 --- a/curriculum/challenges/espanol/blocks/workshop-calculator/66cc14ca14e65e7a9ebecb80.md +++ b/curriculum/challenges/espanol/blocks/workshop-calculator/66cc14ca14e65e7a9ebecb80.md @@ -15,7 +15,7 @@ Dentro de la función, retorne la diferencia entre los dos parámetros. # --hints-- -Debería tener una función llamada `calculateDifference`. +Debes declarar una función llamada `calculateDifference`. ```js assert.isFunction(calculateDifference); @@ -24,8 +24,11 @@ assert.isFunction(calculateDifference); Su función `calculateDifference` debe tener dos parámetros llamados `num1` y `num2`. ```js -const regex = __helpers.functionRegex('calculateDifference', ['num1', 'num2']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { calculateDifference } = explorer.allFunctions; +assert.lengthOf(calculateDifference?.parameters, 2); +assert.equal(calculateDifference?.parameters[0].toString(), "num1"); +assert.equal(calculateDifference?.parameters[1].toString(), "num2"); ``` Su función `calculateDifference` debe retornar la diferencia entre los dos parámetros. diff --git a/curriculum/challenges/espanol/blocks/workshop-calculator/66cc16abc30b367ba1d1f9ef.md b/curriculum/challenges/espanol/blocks/workshop-calculator/66cc16abc30b367ba1d1f9ef.md index 67c9cfd96d3..63168d9279c 100644 --- a/curriculum/challenges/espanol/blocks/workshop-calculator/66cc16abc30b367ba1d1f9ef.md +++ b/curriculum/challenges/espanol/blocks/workshop-calculator/66cc16abc30b367ba1d1f9ef.md @@ -20,19 +20,25 @@ Finalmente, añade un tercer `console.log` que llame a la función `calculateDif Debes tener un `console.log` que llame a la función `calculateDifference` con los argumentos `22` y `5`. ```js -assert.match(code, /console\.log\s*\(\s*calculateDifference\s*\(\s*22\s*,\s*5\s*\)\s*\)\s*;?/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateDifference(22,5))"; +assert.include(strippedCode, expectedStatement); ``` Debes tener un `console.log` que llame a la función `calculateDifference` con los argumentos `12` y `1`. ```js -assert.match(code, /console\.log\s*\(\s*calculateDifference\s*\(\s*12\s*,\s*1\s*\)\s*\)\s*;?/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateDifference(12,1))"; +assert.include(strippedCode, expectedStatement); ``` Debes tener un `console.log` que llame a la función `calculateDifference` con los argumentos `17` y `9`. ```js -assert.match(code, /console\.log\s*\(\s*calculateDifference\s*\(\s*17\s*,\s*9\s*\)\s*\)\s*;?/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateDifference(17,9))"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/espanol/blocks/workshop-calculator/66cc172af7159a7c67804544.md b/curriculum/challenges/espanol/blocks/workshop-calculator/66cc172af7159a7c67804544.md index ea49c7a7b36..fa35b63f721 100644 --- a/curriculum/challenges/espanol/blocks/workshop-calculator/66cc172af7159a7c67804544.md +++ b/curriculum/challenges/espanol/blocks/workshop-calculator/66cc172af7159a7c67804544.md @@ -17,7 +17,7 @@ Luego, agrega un `console.log` que llame a la función `calculateProduct` con lo # --hints-- -Debería tener una función llamada `calculateProduct`. +Debes declarar una función llamada `calculateProduct`. ```js assert.isFunction(calculateProduct); @@ -26,8 +26,11 @@ assert.isFunction(calculateProduct); La función `calculateProduct` debería tener dos parámetros llamados `num1` y `num2`. ```js -const regex = __helpers.functionRegex('calculateProduct', ['num1', 'num2']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { calculateProduct } = explorer.allFunctions; +assert.lengthOf(calculateProduct?.parameters, 2); +assert.equal(calculateProduct?.parameters[0].toString(), "num1"); +assert.equal(calculateProduct?.parameters[1].toString(), "num2"); ``` La función `calculateProduct` debería devolver el producto de los dos parámetros. @@ -40,7 +43,9 @@ assert.equal(calculateProduct(10, 5), 50); Debería tener un `console.log` que llame a la función `calculateProduct` con los argumentos `13` y `5`. ```js -assert.match(code, /console\.log\s*\(\s*calculateProduct\s*\(\s*13\s*,\s*5\s*\)\s*\)\s*;?/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const validStatements = ["console.log(calculateProduct(13,5))", "console.log(calculateProduct(5,13))"]; +assert.isTrue(validStatements.some(stmt => strippedCode.includes(stmt))); ``` # --seed-- diff --git a/curriculum/challenges/espanol/blocks/workshop-calculator/66cc1a3a39aef47d6473cb2f.md b/curriculum/challenges/espanol/blocks/workshop-calculator/66cc1a3a39aef47d6473cb2f.md index 11ccca8fb69..87e70e28adc 100644 --- a/curriculum/challenges/espanol/blocks/workshop-calculator/66cc1a3a39aef47d6473cb2f.md +++ b/curriculum/challenges/espanol/blocks/workshop-calculator/66cc1a3a39aef47d6473cb2f.md @@ -17,7 +17,7 @@ Luego, agregue un `console.log` que llame a la función `calculateQuotient` con # --hints-- -Debe tener una función llamada `calculateQuotient`. +Debes declarar una función llamada `calculateQuotient`. ```js assert.isFunction(calculateQuotient); @@ -26,8 +26,11 @@ assert.isFunction(calculateQuotient); Su función `calculateQuotient` debe tener dos parámetros llamados `num1` y `num2`. ```js -const regex = __helpers.functionRegex('calculateQuotient', ['num1', 'num2']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { calculateQuotient } = explorer.allFunctions; +assert.lengthOf(calculateQuotient?.parameters, 2); +assert.equal(calculateQuotient?.parameters[0].toString(), "num1"); +assert.equal(calculateQuotient?.parameters[1].toString(), "num2"); ``` Su función `calculateQuotient` debe devolver el cociente de los dos parámetros. @@ -40,7 +43,9 @@ assert.equal(calculateQuotient(100, 10), 10); Debe tener un `console.log` que llame a la función `calculateQuotient` con los argumentos `7` y `11`. ```js -assert.match(code, /console\.log\s*\(\s*calculateQuotient\s*\(\s*7\s*,\s*11\s*\)\s*\)\s*;?/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateQuotient(7,11))"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/espanol/blocks/workshop-calculator/66cc1ccfefdd727e18c2ab20.md b/curriculum/challenges/espanol/blocks/workshop-calculator/66cc1ccfefdd727e18c2ab20.md index c142a9deffb..8553845e15a 100644 --- a/curriculum/challenges/espanol/blocks/workshop-calculator/66cc1ccfefdd727e18c2ab20.md +++ b/curriculum/challenges/espanol/blocks/workshop-calculator/66cc1ccfefdd727e18c2ab20.md @@ -7,7 +7,7 @@ dashedName: step-14 # --description-- -Tu `calculateQuotient` parece estar funcionando correctamente, pero hay un caso que aún no has probado. +Tu `calculateQuotient` parece funcionar correctamente, pero hay un caso que aún no has probado. Añade un `console.log` que llama a la función `calculateQuotient` con los argumentos `3` y `0`. @@ -18,7 +18,9 @@ Asegúrate de observar detenidamente el resultado de esta llamada. Deberías tener un `console.log` que llama a la función `calculateQuotient` con los argumentos `3` y `0`. ```js -assert.match(code, /console\.log\s*\(\s*calculateQuotient\s*\(\s*3\s*,\s*0\s*\)\s*\)\s*;?/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateQuotient(3,0))"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/espanol/blocks/workshop-calculator/66cc1deb1f04647f2aabee2b.md b/curriculum/challenges/espanol/blocks/workshop-calculator/66cc1deb1f04647f2aabee2b.md index f8bacec6fd4..4d2211e3c3d 100644 --- a/curriculum/challenges/espanol/blocks/workshop-calculator/66cc1deb1f04647f2aabee2b.md +++ b/curriculum/challenges/espanol/blocks/workshop-calculator/66cc1deb1f04647f2aabee2b.md @@ -11,17 +11,17 @@ Si miras en la consola, verás el valor `Infinity`. `Infinity` es un valor espec La división por cero no es una operación válida en matemáticas. -Para tener en cuenta este caso extremo, debes actualizar tu función `calculateQuotient` para comprobar si `num2` es cero. +Para tener en cuenta este caso extremo, debes actualizar tu función `calculateQuotient` para comprobar si `num2` es cero. Si `num2` es cero, la función debe devolver la cadena `"Error: Division by zero"`. De lo contrario, debe devolver el resultado de dividir `num1` por num2. # --hints-- -Tu función `calculateQuotient` debe devolver la cadena `"Error: Division by zero"` si `num2` es cero. +Tu función `calculateQuotient` debe devolver la cadena `"Error: Division by zero"` si `num2` es cero. ```js -assert.strictEqual(calculateQuotient(10, 0), 'Error: Division by zero'); -assert.strictEqual(calculateQuotient(3, 0), 'Error: Division by zero'); +assert.strictEqual(calculateQuotient(10, 0), "Error: Division by zero"); +assert.strictEqual(calculateQuotient(3, 0), "Error: Division by zero"); ``` Tu función `calculateQuotient` debe devolver el resultado de dividir `num1` por `num2` si `num2` no es cero. diff --git a/curriculum/challenges/espanol/blocks/workshop-calculator/66cc21d23238dc8240a8a182.md b/curriculum/challenges/espanol/blocks/workshop-calculator/66cc21d23238dc8240a8a182.md index 1a6be3633fd..de17c1e193e 100644 --- a/curriculum/challenges/espanol/blocks/workshop-calculator/66cc21d23238dc8240a8a182.md +++ b/curriculum/challenges/espanol/blocks/workshop-calculator/66cc21d23238dc8240a8a182.md @@ -28,7 +28,7 @@ Declara una función llamada `calculateSquare` que tome un parámetro `num` y de # --hints-- -Debes tener una función llamada `calculateSquare`. +Debes declarar una función llamada `calculateSquare`. ```js assert.isFunction(calculateSquare); @@ -37,8 +37,10 @@ assert.isFunction(calculateSquare); Tu función `calculateSquare` debe tomar un parámetro `num`. ```js -const regex = __helpers.functionRegex('calculateSquare', ['num']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { calculateSquare } = explorer.allFunctions; +assert.lengthOf(calculateSquare?.parameters, 1); +assert.equal(calculateSquare?.parameters[0].toString(), "num"); ``` Tu función `calculateSquare` debe devolver el cuadrado de `num`. diff --git a/curriculum/challenges/espanol/blocks/workshop-calculator/66cc26907ff6908402af0149.md b/curriculum/challenges/espanol/blocks/workshop-calculator/66cc26907ff6908402af0149.md index bba7c800d76..6dbfe5457f7 100644 --- a/curriculum/challenges/espanol/blocks/workshop-calculator/66cc26907ff6908402af0149.md +++ b/curriculum/challenges/espanol/blocks/workshop-calculator/66cc26907ff6908402af0149.md @@ -18,13 +18,17 @@ Luego, agrega otro `console.log` que llame a la función `calculateSquare` con e Debes tener un `console.log` que llame a la función `calculateSquare` con el argumento de `2`. ```js -assert.match(code, /console\.log\s*\(\s*calculateSquare\s*\(\s*2\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateSquare(2))"; +assert.include(strippedCode, expectedStatement); ``` Debes tener un `console.log` que llame a la función `calculateSquare` con el argumento de `9`. ```js -assert.match(code, /console\.log\s*\(\s*calculateSquare\s*\(\s*9\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateSquare(9))"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/espanol/blocks/workshop-calculator/66cc2739f687e484d50bb6f1.md b/curriculum/challenges/espanol/blocks/workshop-calculator/66cc2739f687e484d50bb6f1.md index 3886a4315cf..5b10f14e21a 100644 --- a/curriculum/challenges/espanol/blocks/workshop-calculator/66cc2739f687e484d50bb6f1.md +++ b/curriculum/challenges/espanol/blocks/workshop-calculator/66cc2739f687e484d50bb6f1.md @@ -26,7 +26,7 @@ Declare una función llamada `calculateSquareRoot` que tome un parámetro `num` # --hints-- -Debería tener una función llamada `calculateSquareRoot`. +Debes declarar una función llamada `calculateSquareRoot`. ```js assert.isFunction(calculateSquareRoot); @@ -35,8 +35,10 @@ assert.isFunction(calculateSquareRoot); Su función `calculateSquareRoot` debería tomar un parámetro `num`. ```js -const regex = __helpers.functionRegex('calculateSquareRoot', ['num']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { calculateSquareRoot } = explorer.allFunctions; +assert.lengthOf(calculateSquareRoot?.parameters, 1); +assert.equal(calculateSquareRoot?.parameters[0].toString(), "num"); ``` Su función `calculateSquareRoot` debería devolver la raíz cuadrada de `num`. diff --git a/curriculum/challenges/espanol/blocks/workshop-calculator/66cc281d687975858049fd8d.md b/curriculum/challenges/espanol/blocks/workshop-calculator/66cc281d687975858049fd8d.md index 4214b20dbd5..5ef86bcc6cd 100644 --- a/curriculum/challenges/espanol/blocks/workshop-calculator/66cc281d687975858049fd8d.md +++ b/curriculum/challenges/espanol/blocks/workshop-calculator/66cc281d687975858049fd8d.md @@ -20,13 +20,17 @@ Luego, agrega un segundo `console.log` que llame a la función `calculateSquareR Debes tener un `console.log` que llame a la función `calculateSquareRoot` con el argumento de `25`. ```js -assert.match(code, /console\.log\s*\(\s*calculateSquareRoot\s*\(\s*25\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateSquareRoot(25))"; +assert.include(strippedCode, expectedStatement); ``` Debes tener un `console.log` que llame a la función `calculateSquareRoot` con el argumento de `100`. ```js -assert.match(code, /console\.log\s*\(\s*calculateSquareRoot\s*\(\s*100\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateSquareRoot(100))"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/espanol/blocks/workshop-calculator/66cdf76685e4cb5a8726e27b.md b/curriculum/challenges/espanol/blocks/workshop-calculator/66cdf76685e4cb5a8726e27b.md index 9166cd2832e..bfb7386e0be 100644 --- a/curriculum/challenges/espanol/blocks/workshop-calculator/66cdf76685e4cb5a8726e27b.md +++ b/curriculum/challenges/espanol/blocks/workshop-calculator/66cdf76685e4cb5a8726e27b.md @@ -18,13 +18,17 @@ Debajo de ese `console.log`, añade otro `console.log` que llame a la función ` Deberías tener un `console.log` que llame a la función `calculateSum` con los argumentos `10` y `10`. ```js -assert.match(code, /console\.log\(calculateSum\(10\s*,\s*10\)\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateSum(10,10))"; +assert.include(strippedCode, expectedStatement); ``` Deberías tener un `console.log` que llame a la función `calculateSum` con los argumentos `5` y `5`. ```js -assert.match(code, /console\.log\(calculateSum\(5\s*,\s*5\)\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateSum(5,5))"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646c48df8674cf2b91020ecc.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646c48df8674cf2b91020ecc.md index 00da3027266..350723e9e27 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646c48df8674cf2b91020ecc.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646c48df8674cf2b91020ecc.md @@ -35,12 +35,13 @@ assert.oneOf(href, ["./styles.css", "styles.css"]); ```html ---fcc-editable-region-- - - fCC Cat Painting - + + fCC Cat Painting --fcc-editable-region-- + +--fcc-editable-region-- + ``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646c586be7180e40ddf74ff6.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646c586be7180e40ddf74ff6.md index 613b8bf0ec9..d6f2ecec6bd 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646c586be7180e40ddf74ff6.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646c586be7180e40ddf74ff6.md @@ -31,9 +31,9 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('body')?.backgroundColor, - - fCC Cat Painting - + + fCC Cat Painting + diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646c59e942f35541923104bf.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646c59e942f35541923104bf.md index 5c228d1875e..4a33b2f6f63 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646c59e942f35541923104bf.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646c59e942f35541923104bf.md @@ -43,13 +43,13 @@ assert.lengthOf(document.querySelectorAll('main div'), 1); - - fCC Cat Painting - + + fCC Cat Painting + --fcc-editable-region-- - + --fcc-editable-region-- diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646c5ace05e4be4211407935.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646c5ace05e4be4211407935.md index 8490cc22395..e4a8a366cf6 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646c5ace05e4be4211407935.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646c5ace05e4be4211407935.md @@ -50,14 +50,14 @@ assert.equal(secondGradient,'(69,69,79)100%)'); - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
+
+
+
``` @@ -71,13 +71,13 @@ body { background-color: #c9d2fc; } ---fcc-editable-region-- .cat-head { +--fcc-editable-region-- + +--fcc-editable-region-- width: 205px; height: 180px; border: 1px solid #000; border-radius: 46%; - } ---fcc-editable-region-- ``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646c5d7057c45f432fcdd46c.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646c5d7057c45f432fcdd46c.md index f08c6c885ff..92f2c3b3be8 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646c5d7057c45f432fcdd46c.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646c5d7057c45f432fcdd46c.md @@ -7,7 +7,7 @@ dashedName: step-5 # --description-- -Usando un selector de clase, da al elemento `.cat-head` un ancho de `205px` y una altura de `180px`. Además, dale un borde de `1px solid #000` y un `border-radius` de `46%`. +Usando un selector de clase, da al elemento `.cat-head` un ancho de `205px` y una altura de `180px`. Además, dale un borde de `1px solid #000` y un `border-radius` de `46%`. # --hints-- @@ -50,13 +50,13 @@ assert.equal(new __helpers.CSSHelp(document)?.getStyle(".cat-head")?.borderRadiu - - fCC Cat Painting - + + fCC Cat Painting +
-
+
diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646c5e727e56e743c9aed4a1.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646c5e727e56e743c9aed4a1.md index e2ec37acb25..7a9dc3bb4c6 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646c5e727e56e743c9aed4a1.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646c5e727e56e743c9aed4a1.md @@ -44,14 +44,14 @@ assert.equal(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.left, '100p - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
+
+
+
``` @@ -65,16 +65,14 @@ body { background-color: #c9d2fc; } ---fcc-editable-region-- .cat-head { - - +--fcc-editable-region-- +--fcc-editable-region-- background: linear-gradient(#5e5e5e 85%, #45454f 100%); width: 205px; height: 180px; border: 1px solid #000; border-radius: 46%; } ---fcc-editable-region-- ``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646c5ffef5598d449b52ec12.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646c5ffef5598d449b52ec12.md index 0e03b94236d..928bf31b7f5 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646c5ffef5598d449b52ec12.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646c5ffef5598d449b52ec12.md @@ -39,18 +39,18 @@ assert.equal(document.querySelectorAll('.cat-head div')[0]?.getAttribute('class' - - fCC Cat Painting - + + fCC Cat Painting + -
+
+
--fcc-editable-region-- -
- -
+ --fcc-editable-region-- -
+ +
``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646ce8bb4b35544d501c7184.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646ce8bb4b35544d501c7184.md index 74e4075b2f2..6aed2bb1612 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646ce8bb4b35544d501c7184.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646ce8bb4b35544d501c7184.md @@ -43,20 +43,20 @@ assert.isTrue(document.querySelectorAll('.cat-ears div')[1]?.classList.contains( - - fCC Cat Painting - + + fCC Cat Painting + -
-
+
+
+
--fcc-editable-region-- -
- -
+ --fcc-editable-region--
-
+
+
``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646ce9d790d2a44de5f99e04.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646ce9d790d2a44de5f99e04.md index e1e7e4ffdac..6e98e3602d9 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646ce9d790d2a44de5f99e04.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646ce9d790d2a44de5f99e04.md @@ -55,25 +55,25 @@ assert.isTrue(document.querySelectorAll('.cat-right-ear div')[0]?.classList.cont - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
- --fcc-editable-region-- -
- -
-
- -
- --fcc-editable-region-- +
+
+
+
+--fcc-editable-region-- + +
+
+ +--fcc-editable-region--
-
+
+
``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646ceb843412c74edee27a79.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646ceb843412c74edee27a79.md index b5538f0a7b8..14a1b437903 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646ceb843412c74edee27a79.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646ceb843412c74edee27a79.md @@ -67,23 +67,23 @@ assert.strictEqual(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.b - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646cecc9eb5c4f4f73dafd07.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646cecc9eb5c4f4f73dafd07.md index d70c410abc4..b9b57a2d66c 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646cecc9eb5c4f4f73dafd07.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646cecc9eb5c4f4f73dafd07.md @@ -37,23 +37,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-ear')?.left, '- - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` @@ -81,12 +81,12 @@ body { border-radius: 46%; } ---fcc-editable-region-- .cat-left-ear { +--fcc-editable-region-- +--fcc-editable-region-- border-left: 35px solid transparent; border-right: 35px solid transparent; border-bottom: 70px solid #5e5e5e; } ---fcc-editable-region-- ``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646cef0c2b98915094df7099.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646cef0c2b98915094df7099.md index b3ae0db0e9a..94097d80896 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646cef0c2b98915094df7099.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646cef0c2b98915094df7099.md @@ -31,23 +31,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-ear')?.borderTo - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646cf1206cac5f51804f49cf.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646cf1206cac5f51804f49cf.md index 5753e816b13..2ca1382a108 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646cf1206cac5f51804f49cf.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646cf1206cac5f51804f49cf.md @@ -29,23 +29,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-ear')?.transfor - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646cf2249f02ca5233d9af7c.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646cf2249f02ca5233d9af7c.md index ba43222ed87..9950257c3ed 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646cf2249f02ca5233d9af7c.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646cf2249f02ca5233d9af7c.md @@ -45,23 +45,23 @@ assert.strictEqual(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.b - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646cf48d8f8e1f535a1821d3.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646cf48d8f8e1f535a1821d3.md index 07bb55b56fd..a6e77817cc6 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646cf48d8f8e1f535a1821d3.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646cf48d8f8e1f535a1821d3.md @@ -37,23 +37,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.left, ' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646cf6cbca98e258da65c979.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646cf6cbca98e258da65c979.md index 487ffc960da..2bc6b07d0bc 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646cf6cbca98e258da65c979.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646cf6cbca98e258da65c979.md @@ -25,23 +25,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.transfo - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646cf88aa884405a11ea5bcc.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646cf88aa884405a11ea5bcc.md index cfdc31e8457..9251fe8a002 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646cf88aa884405a11ea5bcc.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646cf88aa884405a11ea5bcc.md @@ -31,23 +31,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.borderT - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646cfc2b8e6fe95c20a819d5.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646cfc2b8e6fe95c20a819d5.md index 607632aed71..38cb6cec66e 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646cfc2b8e6fe95c20a819d5.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646cfc2b8e6fe95c20a819d5.md @@ -29,23 +29,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-ear')?.zIndex, - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646cfd853634255d02b64cc1.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646cfd853634255d02b64cc1.md index ca2dfa22ad3..d499cf03e22 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646cfd853634255d02b64cc1.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646cfd853634255d02b64cc1.md @@ -27,23 +27,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-ear')?.zIndex, - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646cfde6ac612e5d60391f50.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646cfde6ac612e5d60391f50.md index efbce836e9f..7d6bbae5aaa 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646cfde6ac612e5d60391f50.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646cfde6ac612e5d60391f50.md @@ -25,23 +25,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.zIndex, - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646dd556d524bc61c0139bd6.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646dd556d524bc61c0139bd6.md index d427dd5cf00..5db74ec15c1 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646dd556d524bc61c0139bd6.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646dd556d524bc61c0139bd6.md @@ -45,23 +45,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-inner-ear')?.bo - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646dd6f9caa862627dd87772.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646dd6f9caa862627dd87772.md index 6f14b1e91b1..7230260988d 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646dd6f9caa862627dd87772.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646dd6f9caa862627dd87772.md @@ -37,23 +37,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-inner-ear')?.le - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646dd7cfd0cfac630c1dd520.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646dd7cfd0cfac630c1dd520.md index 94ca4c783bb..61b2a1a7035 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646dd7cfd0cfac630c1dd520.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646dd7cfd0cfac630c1dd520.md @@ -43,23 +43,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-inner-ear')?.bo - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646dd8c79ec23463a3d0e356.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646dd8c79ec23463a3d0e356.md index d83afb9b871..cb61a8903bc 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646dd8c79ec23463a3d0e356.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646dd8c79ec23463a3d0e356.md @@ -43,23 +43,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-inner-ear')?.b - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646dd9d9a729916460724f16.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646dd9d9a729916460724f16.md index 8137d3af1c3..8fef6eabab7 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646dd9d9a729916460724f16.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646dd9d9a729916460724f16.md @@ -37,23 +37,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-inner-ear')?.l - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646ddab8afd73764f5241bbf.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646ddab8afd73764f5241bbf.md index 6a4ef5d279b..6ebb032327d 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646ddab8afd73764f5241bbf.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646ddab8afd73764f5241bbf.md @@ -43,23 +43,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-inner-ear')?.b - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646ddb61ff08366570cc5902.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646ddb61ff08366570cc5902.md index 2e5a4993f6e..d36ecec1c14 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646ddb61ff08366570cc5902.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646ddb61ff08366570cc5902.md @@ -45,27 +45,27 @@ assert.isTrue(document.querySelectorAll('.cat-eyes div')[1].classList.contains(' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- - --fcc-editable-region-- - - --fcc-editable-region--
-
+ + --fcc-editable-region-- + + --fcc-editable-region-- +
+
``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646ddd3f9f97a0667b964bdb.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646ddd3f9f97a0667b964bdb.md index 138dc9ed3ad..81975556354 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646ddd3f9f97a0667b964bdb.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646ddd3f9f97a0667b964bdb.md @@ -55,34 +55,34 @@ assert.isTrue(document.querySelectorAll('.cat-right-eye div')[0]?.classList.cont - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
- --fcc-editable-region-- -
- -
-
- -
- --fcc-editable-region-- -
-
+ +
+
+--fcc-editable-region-- + +
+
+ +--fcc-editable-region-- +
+
+
+
``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646dde7dc20dc167489faa69.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646dde7dc20dc167489faa69.md index 13fae9e7c2a..fd2834ac01f 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646dde7dc20dc167489faa69.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646dde7dc20dc167489faa69.md @@ -43,32 +43,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-eye')?.backgrou - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646ddf888632fa67f1180940.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646ddf888632fa67f1180940.md index 06139118840..30f728337e5 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646ddf888632fa67f1180940.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646ddf888632fa67f1180940.md @@ -37,32 +37,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-eye')?.left, '3 - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646de5dc8988076a1d992afd.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646de5dc8988076a1d992afd.md index 3aa1a3c34fc..2f1d643ef08 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646de5dc8988076a1d992afd.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646de5dc8988076a1d992afd.md @@ -31,32 +31,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-eye')?.transfor - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646de6a97b50a86ac487de86.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646de6a97b50a86ac487de86.md index f7c22ea8240..0139c71284d 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646de6a97b50a86ac487de86.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646de6a97b50a86ac487de86.md @@ -45,32 +45,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-eye')?.backgro - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646de7b64467e96b7d35b5cd.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646de7b64467e96b7d35b5cd.md index 3528b051b9c..64981143bb4 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646de7b64467e96b7d35b5cd.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646de7b64467e96b7d35b5cd.md @@ -37,32 +37,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-eye')?.left, ' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646de8478d6f796bfbdccfb2.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646de8478d6f796bfbdccfb2.md index 81fd75eb07e..ceb57e4b9eb 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646de8478d6f796bfbdccfb2.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646de8478d6f796bfbdccfb2.md @@ -31,32 +31,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-eye')?.transfo - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646de8d204a3426c7d184372.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646de8d204a3426c7d184372.md index 221b212208e..6dceeb88e88 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646de8d204a3426c7d184372.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646de8d204a3426c7d184372.md @@ -45,32 +45,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-inner-eye')?.ba - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646dea1c98c2426d43a705c3.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646dea1c98c2426d43a705c3.md index 4564a1d7b08..371eb3890cd 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646dea1c98c2426d43a705c3.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646dea1c98c2426d43a705c3.md @@ -49,32 +49,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-inner-eye')?.tr - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646deb169847f86df0f95bfc.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646deb169847f86df0f95bfc.md index b0b9f52cb0e..b106ae409c5 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646deb169847f86df0f95bfc.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646deb169847f86df0f95bfc.md @@ -43,32 +43,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-inner-eye')?.b - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646dec359bef3b7811fba5a6.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646dec359bef3b7811fba5a6.md index 2cfbd0ebafe..a97b1a5dc12 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646dec359bef3b7811fba5a6.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646dec359bef3b7811fba5a6.md @@ -49,32 +49,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-inner-eye')?.t - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646dedbcba062079128b2ecc.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646dedbcba062079128b2ecc.md index 791e5844c74..0bf3da6537a 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646dedbcba062079128b2ecc.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646dedbcba062079128b2ecc.md @@ -31,36 +31,36 @@ assert.isTrue(document.querySelectorAll('div')[11].classList.contains('cat-nose' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
- - --fcc-editable-region-- - - --fcc-editable-region--
-
+ + --fcc-editable-region-- + + --fcc-editable-region-- +
+
``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646def5e863abf7a14501421.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646def5e863abf7a14501421.md index 995efada771..3b95ba49568 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646def5e863abf7a14501421.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646def5e863abf7a14501421.md @@ -43,34 +43,34 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-nose')?.borderBottom - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
- -
-
+ +
+
+
``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646df03c8f79337ab46f148b.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646df03c8f79337ab46f148b.md index 5a8bd2d0d54..20c2ae5451a 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646df03c8f79337ab46f148b.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646df03c8f79337ab46f148b.md @@ -37,34 +37,34 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-nose')?.left, '85px' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
- -
-
+ +
+
+
``` @@ -196,5 +196,4 @@ body { border-right: 15px solid transparent; border-bottom: 20px solid #442c2c; } - ``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646df0cf26413a7b35e4b8b3.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646df0cf26413a7b35e4b8b3.md index f231d348a4c..fe49a612cf5 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646df0cf26413a7b35e4b8b3.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646df0cf26413a7b35e4b8b3.md @@ -49,34 +49,34 @@ assert.notMatch(code, /border-top-right-radius:\s*\d+%;/); - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
- -
-
+ +
+
+
``` @@ -211,5 +211,4 @@ body { border-right: 15px solid transparent; border-bottom: 20px solid #442c2c; } - ``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646df1d1aa4ae57bdf1869c4.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646df1d1aa4ae57bdf1869c4.md index f6d488f35ae..152653a57da 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646df1d1aa4ae57bdf1869c4.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646df1d1aa4ae57bdf1869c4.md @@ -33,38 +33,38 @@ assert.isTrue(document.querySelectorAll('div')[12].classList.contains('cat-mouth - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
- --fcc-editable-region-- - - --fcc-editable-region-- +
+
+
+
+
+
+
-
+ +
+ + --fcc-editable-region-- + + --fcc-editable-region-- +
+
``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646dffd8ce9ac77ec1906f2e.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646dffd8ce9ac77ec1906f2e.md index 74d79537c19..aeef9cadea3 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646dffd8ce9ac77ec1906f2e.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646dffd8ce9ac77ec1906f2e.md @@ -43,41 +43,40 @@ assert.isTrue(document.querySelectorAll('.cat-mouth div')[1]?.classList.contains - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
- --fcc-editable-region-- -
- +
+
+
+
+
+
- --fcc-editable-region-- +
+ +
+
+--fcc-editable-region-- + +--fcc-editable-region--
-
+
+
``` @@ -213,5 +212,4 @@ body { border-right: 15px solid transparent; border-bottom: 20px solid #442c2c; } - ``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f0417322c0e04983a5149.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f0417322c0e04983a5149.md index 8d38de2fce8..70ab4887b37 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f0417322c0e04983a5149.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f0417322c0e04983a5149.md @@ -43,40 +43,39 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-mouth-line-left')?.l - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
+
+
+
+
+ +
+
+
+
-
+
+
``` @@ -222,6 +221,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f08293804a30685533c6f.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f08293804a30685533c6f.md index 193b6e8b018..2f17c1956e7 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f08293804a30685533c6f.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f08293804a30685533c6f.md @@ -25,40 +25,39 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-mouth-line-left')?.t - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
+
+
+
+
+ +
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f09293eb3230723a62f77.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f09293eb3230723a62f77.md index e0ed8f59f4e..e97389b851b 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f09293eb3230723a62f77.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f09293eb3230723a62f77.md @@ -43,40 +43,39 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-mouth-line-right')?. - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
+
+
+
+
+ +
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f0c9a1e3360092d1bbd33.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f0c9a1e3360092d1bbd33.md index 87ac304909e..37bc35240b7 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f0c9a1e3360092d1bbd33.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f0c9a1e3360092d1bbd33.md @@ -25,40 +25,39 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-mouth-line-right')?. - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
+
+
+
+
+ +
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f0ce5737243098ad6e494.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f0ce5737243098ad6e494.md index ec9ef358715..b00caeab4a7 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f0ce5737243098ad6e494.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f0ce5737243098ad6e494.md @@ -33,44 +33,43 @@ assert.isTrue(document.querySelectorAll('div')[15].classList.contains('cat-whisk - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
+
+
+
+
+ +
- --fcc-editable-region-- - - --fcc-editable-region-- - +
+
+
-
+ + --fcc-editable-region-- + + --fcc-editable-region-- +
+
``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f0ef13604420a8744f7d4.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f0ef13604420a8744f7d4.md index 5c241963d1e..a96fb17b0fb 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f0ef13604420a8744f7d4.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f0ef13604420a8744f7d4.md @@ -43,46 +43,45 @@ assert.isTrue(document.querySelectorAll('.cat-whiskers div')[1].classList.contai - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- - --fcc-editable-region-- -
- +
+
- --fcc-editable-region-- +
+ +
+ +
+
+
+
+
+--fcc-editable-region-- + +--fcc-editable-region--
-
+
+
``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f0f7c5933560af8e7e380.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f0f7c5933560af8e7e380.md index 1f6921c57b9..12024e0c947 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f0f7c5933560af8e7e380.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f0f7c5933560af8e7e380.md @@ -50,49 +50,48 @@ assert.isTrue(document.querySelectorAll('.cat-whiskers-left div')[2].classList.c - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
- --fcc-editable-region-- -
- -
- --fcc-editable-region-- -
+
+
+
+ +
+
+
+
+
+ +
+
+--fcc-editable-region-- + +--fcc-editable-region-- +
+
-
+
+
``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f102bf87b350b593baa72.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f102bf87b350b593baa72.md index e55db28352d..53eae938a31 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f102bf87b350b593baa72.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f102bf87b350b593baa72.md @@ -49,53 +49,52 @@ assert.isTrue(document.querySelectorAll('.cat-whiskers-right div')[2].classList. - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
- --fcc-editable-region-- -
- -
- --fcc-editable-region-- +
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+--fcc-editable-region-- + +--fcc-editable-region-- +
-
+
+
``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f107abb89d00bb99f387a.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f107abb89d00bb99f387a.md index 6de28aac39b..c8b282dee7e 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f107abb89d00bb99f387a.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f107abb89d00bb99f387a.md @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whiskers-left div')? - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f12da0b4c5d0ca162834a.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f12da0b4c5d0ca162834a.md index 2989b09ccc7..c063cc4d3ce 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f12da0b4c5d0ca162834a.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f12da0b4c5d0ca162834a.md @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-left-top')?. - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -261,6 +260,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f135eab69d90d0c6d4e9b.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f135eab69d90d0c6d4e9b.md index 18c3c9a1141..9913f833be7 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f135eab69d90d0c6d4e9b.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f135eab69d90d0c6d4e9b.md @@ -25,53 +25,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-left-top')?. - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -250,5 +249,4 @@ body { --fcc-editable-region-- } - ``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f159b2cffb21150b927cb.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f159b2cffb21150b927cb.md index e7c4aebdfbe..66c3e87040d 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f159b2cffb21150b927cb.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f159b2cffb21150b927cb.md @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-left-middle' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -268,6 +267,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f164bf100dd11d226161f.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f164bf100dd11d226161f.md index 2a414591db1..4311c2b9836 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f164bf100dd11d226161f.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f164bf100dd11d226161f.md @@ -25,53 +25,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-left-middle' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -254,7 +253,7 @@ body { top: 127px; left: 52px; --fcc-editable-region-- - + --fcc-editable-region-- } ``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f1764e2f1d212ba9785a7.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f1764e2f1d212ba9785a7.md index 38db139fd1a..79f02a687b5 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f1764e2f1d212ba9785a7.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f1764e2f1d212ba9785a7.md @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-left-bottom' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -275,6 +274,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f1802a09a171332e14630.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f1802a09a171332e14630.md index 2bad92746fa..34986ffbcde 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f1802a09a171332e14630.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f1802a09a171332e14630.md @@ -25,53 +25,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-left-bottom' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f4d6c42dc5f214f4e7444.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f4d6c42dc5f214f4e7444.md index f925c95bfe6..51101c9566d 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f4d6c42dc5f214f4e7444.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f4d6c42dc5f214f4e7444.md @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-right-top')? - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -282,6 +281,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f4e46e81f7021d5fd9c1d.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f4e46e81f7021d5fd9c1d.md index d91e6663e7e..a2316a0d1ba 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f4e46e81f7021d5fd9c1d.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f4e46e81f7021d5fd9c1d.md @@ -25,53 +25,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-right-top')? - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f4f6a14e3c522d130a0d2.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f4f6a14e3c522d130a0d2.md index 692859550ca..2f16cf0866f 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f4f6a14e3c522d130a0d2.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f4f6a14e3c522d130a0d2.md @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-right-middle - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -289,6 +288,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f4fe12b7985232bf475a5.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f4fe12b7985232bf475a5.md index f2f51eb3ad1..efee2bfab69 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f4fe12b7985232bf475a5.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f4fe12b7985232bf475a5.md @@ -25,53 +25,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-right-middle - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f507e4d1cd323f17db4fc.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f507e4d1cd323f17db4fc.md index 5d08ce5e3b8..4e34186d346 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f507e4d1cd323f17db4fc.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f507e4d1cd323f17db4fc.md @@ -44,53 +44,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-right-bottom - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -297,6 +296,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f516dbfc1342495515625.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f516dbfc1342495515625.md index 766dfd96264..ee524c52cd9 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f516dbfc1342495515625.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/646f516dbfc1342495515625.md @@ -27,53 +27,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-right-bottom - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -295,53 +294,53 @@ body { - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+ +
+
``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/6476f5c17f99146071ee884c.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/6476f5c17f99146071ee884c.md index dd89f96c9db..1a9b187056a 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/6476f5c17f99146071ee884c.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/6476f5c17f99146071ee884c.md @@ -41,14 +41,14 @@ assert.equal(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.left, '100p - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
+
+
+
``` @@ -65,9 +65,9 @@ body { .cat-head { --fcc-editable-region-- position: static; +--fcc-editable-region-- top: 100px; left: 100px; ---fcc-editable-region-- background: linear-gradient(#5e5e5e 85%, #45454f 100%); width: 205px; height: 180px; diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/6476f7a4827bcc61682f2347.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/6476f7a4827bcc61682f2347.md index b9bd8960e65..e35c6fba190 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/6476f7a4827bcc61682f2347.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/6476f7a4827bcc61682f2347.md @@ -9,9 +9,7 @@ dashedName: step-9 Cuando usas el valor `absolute` para tu propiedad `position`, el elemento se saca del flujo normal del documento, y luego su posición es determinada por las propiedades `top`, `right`, `bottom`, y `left`. -Establece la propiedad `position` de tu elemento `.cat-head` a `absolute`, luego establece las propiedades `top` y `left` a cualquier valor positivo de píxeles. - - +Establece la propiedad `position` de tu elemento `.cat-head` en `absolute`. # --hints-- @@ -43,14 +41,14 @@ assert.match(code, /left:\s*\d{1,4}px;/); - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
+
+
+
``` @@ -67,9 +65,9 @@ body { .cat-head { --fcc-editable-region-- position: relative; +--fcc-editable-region-- top: 100px; left: 100px; ---fcc-editable-region-- background: linear-gradient(#5e5e5e 85%, #45454f 100%); width: 205px; height: 180px; diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/6476fb7cbaafa36d65e9cf35.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/6476fb7cbaafa36d65e9cf35.md index e7833a70745..84385d7b606 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/6476fb7cbaafa36d65e9cf35.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/6476fb7cbaafa36d65e9cf35.md @@ -33,17 +33,17 @@ assert.equal(document.querySelectorAll('div')[1]?.getAttribute('class'), 'box'); - - fCC Cat Painting - + + fCC Cat Painting + -
-
- --fcc-editable-region-- - - --fcc-editable-region-- -
+
+
+ --fcc-editable-region-- + + --fcc-editable-region-- +
``` @@ -59,8 +59,8 @@ body { .cat-head { position: absolute; - top: 300px; - left: 400px; + top: 100px; + left: 100px; background: linear-gradient(#5e5e5e 85%, #45454f 100%); width: 205px; height: 180px; diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/6476fc5cf14b276e6d04e82a.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/6476fc5cf14b276e6d04e82a.md index a32039c88d7..4e2db28e393 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/6476fc5cf14b276e6d04e82a.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/6476fc5cf14b276e6d04e82a.md @@ -61,15 +61,15 @@ assert.equal(new __helpers.CSSHelp(document)?.getStyle('.box')?.top, '800px'); - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
+
+
+
+
``` @@ -84,7 +84,7 @@ body { } .cat-head { - position: relative; + position: absolute; top: 100px; left: 100px; background: linear-gradient(#5e5e5e 85%, #45454f 100%); diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/6476fd4213318f6ee211028a.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/6476fd4213318f6ee211028a.md index 37e1bb7273d..1fbf5ad7936 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/6476fd4213318f6ee211028a.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/6476fd4213318f6ee211028a.md @@ -7,7 +7,7 @@ dashedName: step-12 # --description-- -Ahora reemplaza el valor de propiedad `position` de tu `.cat-head` con `fixed`. Deja tanto `top` como `left` tal como están. +Ahora reemplaza el valor de la propiedad `position` de tu `.cat-head` por `fixed`. Después de eso, desplázate hacia arriba y hacia abajo para ver cómo funciona el valor `fixed`. @@ -39,15 +39,15 @@ assert.equal(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.left, '100p - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
+
+
+
+
``` @@ -63,10 +63,10 @@ body { .cat-head { --fcc-editable-region-- - position: relative; + position: absolute; +--fcc-editable-region-- top: 100px; left: 100px; ---fcc-editable-region-- background: linear-gradient(#5e5e5e 85%, #45454f 100%); width: 205px; height: 180px; diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/64770351e8586671ec0911f0.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/64770351e8586671ec0911f0.md index 379403addaf..fd79bf0c21d 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/64770351e8586671ec0911f0.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/64770351e8586671ec0911f0.md @@ -41,15 +41,15 @@ assert.notMatch(code, /left:\s*100px;?/); - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
+
+
+
+
``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/6477062778c85972eb648030.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/6477062778c85972eb648030.md index 2534bf9a5d8..3b314296761 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/6477062778c85972eb648030.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/6477062778c85972eb648030.md @@ -7,7 +7,7 @@ dashedName: step-14 # --description-- -Ahora debes centrar la cabeza del gato. +Ahora debes centrar la cabeza del gato. Dale al elemento `.cat-head` una propiedad `position` establecida en `absolute`. Establece un valor de `0` para las propiedades `right`, `left`, `top`, `bottom`, luego establece su propiedad `margin` en todos los lados a `auto`. Esa es una manera de centrar un elemento vertical y horizontalmente usando posicionamiento con CSS. @@ -57,15 +57,15 @@ assert.equal(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.margin, 'au - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
+
+
+
+
``` @@ -82,8 +82,8 @@ body { .cat-head { --fcc-editable-region-- position: sticky; - top: 0; --fcc-editable-region-- + top: 0; background: linear-gradient(#5e5e5e 85%, #45454f 100%); width: 205px; height: 180px; @@ -92,7 +92,7 @@ body { } .box { - width: 400px; + width: 200px; height: 600px; background-color: #000; position: absolute; diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/647d821de0d97b3283c72b36.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/647d821de0d97b3283c72b36.md index 91f1f77887f..04a07f721ab 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/647d821de0d97b3283c72b36.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/647d821de0d97b3283c72b36.md @@ -14,7 +14,7 @@ Además, elimina la regla CSS `.box` y sus declaraciones porque ya no las necesi Debes eliminar la regla CSS `.box` y todos sus valores. ```js -assert.notMatch(code, /\.box\s*\{\s*width:\s*400px;\s*height:\s*600px;\s*background-color:\s*#000;\s*position:\s*absolute;\s*left:\s*650px;\s*top:\s*800px;?\s*\}\s*/) +assert.notMatch(code, /\.box\s*\{\s*width:\s*200px;\s*height:\s*600px;\s*background-color:\s*#000;\s*position:\s*absolute;\s*left:\s*650px;\s*top:\s*800px;?\s*\}\s*/) ``` # --seed-- @@ -25,14 +25,14 @@ assert.notMatch(code, /\.box\s*\{\s*width:\s*400px;\s*height:\s*600px;\s*backgro - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
+
+
+
``` @@ -62,7 +62,7 @@ body { --fcc-editable-region-- .box { - width: 400px; + width: 200px; height: 600px; background-color: #000; position: absolute; diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/647d855ac12cd436059acd39.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/647d855ac12cd436059acd39.md index bb9c33e7f0d..11516ef962d 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/647d855ac12cd436059acd39.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/647d855ac12cd436059acd39.md @@ -33,9 +33,9 @@ assert.strictEqual(new __helpers.CSSHelp(document).getStyle('*')?.boxSizing, 'bo - - fCC Cat Painting - + + fCC Cat Painting + diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/649353647c44ef4867ab4935.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/649353647c44ef4867ab4935.md index 3793222d875..33d6debfc08 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/649353647c44ef4867ab4935.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/649353647c44ef4867ab4935.md @@ -25,17 +25,17 @@ assert.notMatch(code, /<\/div>/) - - fCC Cat Painting - + + fCC Cat Painting + -
-
- --fcc-editable-region-- -
- --fcc-editable-region-- -
+
+
+ --fcc-editable-region-- +
+ --fcc-editable-region-- +
``` @@ -64,7 +64,7 @@ body { } .box { - width: 400px; + width: 200px; height: 600px; background-color: #000; position: absolute; diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/64a2687ef267e5934a2f93e3.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/64a2687ef267e5934a2f93e3.md index 95e88cb3d0b..cc5bc962c3b 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/64a2687ef267e5934a2f93e3.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/64a2687ef267e5934a2f93e3.md @@ -43,39 +43,39 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-mouth div')?.border, - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
- -
- -
-
-
+
+
-
+ +
+ +
+
+
+
+
+
``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/64a26ac5540c5493f4641f10.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/64a26ac5540c5493f4641f10.md index 1721f8dbb36..7559c13e648 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/64a26ac5540c5493f4641f10.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/64a26ac5540c5493f4641f10.md @@ -32,39 +32,39 @@ assert.match(code, /border-radius:\s*190%\/190px\s*150px\s*0\s*0\s*;?/) - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
- -
- -
-
-
+
+
-
+ +
+ +
+
+
+
+
+
``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/64a3bcbc83e574b58c8ed048.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/64a3bcbc83e574b58c8ed048.md index cf81bc074fb..eb80096e598 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/64a3bcbc83e574b58c8ed048.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/64a3bcbc83e574b58c8ed048.md @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whiskers-right div') - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/6676a8a8d9861319ee901a90.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/6676a8a8d9861319ee901a90.md index 14d7b834363..36afec92864 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/6676a8a8d9861319ee901a90.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/6676a8a8d9861319ee901a90.md @@ -103,23 +103,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-ear')?.borderBo - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/espanol/blocks/workshop-cat-painting/6676a8b01e56ec1a1e07c202.md b/curriculum/challenges/espanol/blocks/workshop-cat-painting/6676a8b01e56ec1a1e07c202.md index 8d7816ccbb7..a9bd607c75e 100644 --- a/curriculum/challenges/espanol/blocks/workshop-cat-painting/6676a8b01e56ec1a1e07c202.md +++ b/curriculum/challenges/espanol/blocks/workshop-cat-painting/6676a8b01e56ec1a1e07c202.md @@ -73,23 +73,23 @@ assert.isEmpty(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.backg - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` @@ -117,15 +117,15 @@ body { border-radius: 46%; } ---fcc-editable-region-- .cat-right-ear { +--fcc-editable-region-- height: 100px; width: 100px; background-color: white; border-left: 35px solid blue; border-right: 35px solid blue; border-top: 35px solid red; +--fcc-editable-region-- border-bottom: 35px solid red; } ---fcc-editable-region-- ``` diff --git a/curriculum/challenges/espanol/blocks/workshop-envelope-budget-app/69b2c970cb02ddaafff1c10d.md b/curriculum/challenges/espanol/blocks/workshop-envelope-budget-app/69b2c970cb02ddaafff1c10d.md index 391d668be66..d8ea46659a0 100644 --- a/curriculum/challenges/espanol/blocks/workshop-envelope-budget-app/69b2c970cb02ddaafff1c10d.md +++ b/curriculum/challenges/espanol/blocks/workshop-envelope-budget-app/69b2c970cb02ddaafff1c10d.md @@ -62,7 +62,7 @@ assert.notMatch(code, /<\/input>/); El elemento `input` debe tener el cierre `>`. ```js -assert.match(code, /HTMLString\s*=\s*`\n\s*Expense\s\$\{entryNumber\}\sName<\/label>\n\s*]*\/>/); +assert.match(code, /HTMLString\s*=\s*`\n\s*Expense\s\$\{entryNumber\}\sName<\/label>\n\s*]*>/); ``` # --seed-- diff --git a/curriculum/challenges/espanol/blocks/workshop-fcc-authors-page/69e14a2fd8ecf9210c0739ee.md b/curriculum/challenges/espanol/blocks/workshop-fcc-authors-page/69e14a2fd8ecf9210c0739ee.md index 93db4b9a71a..4a0d2786357 100644 --- a/curriculum/challenges/espanol/blocks/workshop-fcc-authors-page/69e14a2fd8ecf9210c0739ee.md +++ b/curriculum/challenges/espanol/blocks/workshop-fcc-authors-page/69e14a2fd8ecf9210c0739ee.md @@ -11,6 +11,12 @@ Al llamar a una función asíncrona, puedes esperar el valor que retorna o dejar Agrega una llamada a la función `initialFetch` en el espacio indicado en el editor. +# --before-all-- + +```js +window.fetch = () => Promise.resolve({json: () => Promise.resolve([{ author: 'Whoever', image: 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==', url: "http://not-a-real-url.nowhere/", bio: 'words go here' }])}); +``` + # --hints-- Debes llamar a `initialFetch` sin argumentos. diff --git a/curriculum/challenges/espanol/blocks/workshop-fortune-teller-app/68ded620ab19272a3fa97592.md b/curriculum/challenges/espanol/blocks/workshop-fortune-teller-app/68ded620ab19272a3fa97592.md index a3a87bea384..d0f768c81af 100644 --- a/curriculum/challenges/espanol/blocks/workshop-fortune-teller-app/68ded620ab19272a3fa97592.md +++ b/curriculum/challenges/espanol/blocks/workshop-fortune-teller-app/68ded620ab19272a3fa97592.md @@ -73,10 +73,9 @@ assert.isTrue(renderCard.hasReturnAnnotation("string")); Tu función `renderCard` debe devolver un template literal. ```js -assert.match( - __helpers.removeJSComments(code), - /renderCard\s*=\s*\([^)]*\)\s*:\s*string\s*=>\s*(?:\{\s*return\s*)?`/ -); +const explorer = await __helpers.Explorer(code); +const { renderCard } = explorer.allFunctions; +assert.match(__helpers.removeJSComments(renderCard.toString()), /(?:return|=>)\s*`/); ``` # --seed-- diff --git a/curriculum/challenges/espanol/blocks/workshop-fortune-teller-app/68ed4621677e86eeefa59fe6.md b/curriculum/challenges/espanol/blocks/workshop-fortune-teller-app/68ed4621677e86eeefa59fe6.md index bdee2a05100..93124ea023b 100644 --- a/curriculum/challenges/espanol/blocks/workshop-fortune-teller-app/68ed4621677e86eeefa59fe6.md +++ b/curriculum/challenges/espanol/blocks/workshop-fortune-teller-app/68ed4621677e86eeefa59fe6.md @@ -15,8 +15,8 @@ Tu método `initializeEventListeners` debe tener un tipo de retorno `void`. ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.initializeEventListeners.toString(); -assert.match(method, /initializeEventListeners\s*\(\s*\)\s*:\s*void/); +const { initializeEventListeners } = explorer.classes.Game?.methods ?? {}; +assert.isTrue(initializeEventListeners?.hasReturnAnnotation("void")); ``` # --seed-- diff --git a/curriculum/challenges/espanol/blocks/workshop-fortune-teller-app/68ee6c4b4c764b62d77df717.md b/curriculum/challenges/espanol/blocks/workshop-fortune-teller-app/68ee6c4b4c764b62d77df717.md index ad0258fe743..5a1d1cdf701 100644 --- a/curriculum/challenges/espanol/blocks/workshop-fortune-teller-app/68ee6c4b4c764b62d77df717.md +++ b/curriculum/challenges/espanol/blocks/workshop-fortune-teller-app/68ee6c4b4c764b62d77df717.md @@ -17,16 +17,30 @@ Debes declarar una variable llamada `isReversed`. ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.singleCardSelected.toString(); -assert.match(method, /const\s+isReversed\s*=/); +const { singleCardSelected } = explorer.classes.Game?.methods ?? {}; +const { isReversed } = singleCardSelected?.variables ?? {}; +assert.exists(isReversed); ``` Tu variable `isReversed` debe usar `Math.random()` para decidir aleatoriamente si la carta está invertida. ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.singleCardSelected.toString(); -assert.match(method, /isReversed\s*=\s*Math\.random\s*\(\s*\)\s*<\s*0\.5/); +const { singleCardSelected } = explorer.classes.Game?.methods ?? {}; +const { isReversed } = singleCardSelected?.variables ?? {}; + +const validForms = [ + 'Math.random() < 0.5', + 'Math.random() > 0.5', + 'Math.random() <= 0.5', + 'Math.random() >= 0.5', + '0.5 < Math.random()', + '0.5 > Math.random()', + '0.5 <= Math.random()', + '0.5 >= Math.random()' +]; + +assert.isTrue(validForms.some((form) => isReversed?.value.matches(form))); ``` # --seed-- diff --git a/curriculum/challenges/espanol/blocks/workshop-fortune-teller-app/68ee6c8c274515694ead0024.md b/curriculum/challenges/espanol/blocks/workshop-fortune-teller-app/68ee6c8c274515694ead0024.md index 530de7b1659..0f4bf8f3b9a 100644 --- a/curriculum/challenges/espanol/blocks/workshop-fortune-teller-app/68ee6c8c274515694ead0024.md +++ b/curriculum/challenges/espanol/blocks/workshop-fortune-teller-app/68ee6c8c274515694ead0024.md @@ -7,7 +7,7 @@ dashedName: step-32 # --description-- -La fortuna debe ser aleatoria, por lo que se requiere una función auxiliar para seleccionar una fortuna al azar. Declara una variable llamada `chosenCard` dentro del método `singleCardSelected`. Usa el método `getRandomItem` para obtener una carta aleatoria y pasa `cards` como argumento. +La fortuna debe ser aleatoria, por lo que se requiere una función auxiliar para seleccionar una fortuna aleatoria. Declara una variable llamada `chosenCard` dentro del método `singleCardSelected`. Usa la función `getRandomItem` para obtener una carta aleatoria y pasa `this.cards` como argumento. # --hints-- @@ -15,22 +15,18 @@ Debes declarar una variable llamada `chosenCard` dentro de `singleCardSelected`. ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.singleCardSelected.toString(); -assert.match(method, /const\s+chosenCard\s*=/); +const { singleCardSelected } = explorer.classes.Game?.methods ?? {}; +const { chosenCard } = singleCardSelected?.variables ?? {}; +assert.exists(chosenCard); ``` Tu variable `chosenCard` debe asignarse llamando a `getRandomItem(this.cards)`. ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.singleCardSelected.toString(); -assert.match(method, /chosenCard\s*=\s*getRandomItem\s*\(\s*this\.cards\s*\)/); -``` - -Debes pasar `this.cards` como argumento a `getRandomItem`. - -```js -assert.match(__helpers.removeJSComments(code), /getRandomItem\s*\(\s*this\.cards\s*\)/); +const { singleCardSelected } = explorer.classes.Game?.methods ?? {}; +const { chosenCard } = singleCardSelected?.variables ?? {}; +assert.isTrue(chosenCard?.value.matches("getRandomItem(this.cards)")); ``` # --seed-- diff --git a/curriculum/challenges/espanol/blocks/workshop-fortune-teller-app/68f1e43a5f890b51774d93c4.md b/curriculum/challenges/espanol/blocks/workshop-fortune-teller-app/68f1e43a5f890b51774d93c4.md index c1d3bd0c222..c0959d59bae 100644 --- a/curriculum/challenges/espanol/blocks/workshop-fortune-teller-app/68f1e43a5f890b51774d93c4.md +++ b/curriculum/challenges/espanol/blocks/workshop-fortune-teller-app/68f1e43a5f890b51774d93c4.md @@ -15,22 +15,28 @@ Debes declarar una variable llamada `target` dentro de `showFortune`. ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /const\s+target\s*=/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { target } = showFortune?.variables ?? {}; +assert.exists(target); ``` Tu variable `target` debe asignarse a `e.target`. ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /target\s*=\s*e\.target/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { target } = showFortune?.variables ?? {}; +assert.isTrue(target?.value.matches("e.target")); ``` Debes tener una estructura `if` vacía justo después de tu variable `target`. ```js -assert.match(__helpers.removeJSComments(code), /showFortune\s*\([^)]*\)\s*\{[\s\S]*?if\s*\(\s*\)\s*\{\s*\}/); +const explorer = await __helpers.Explorer(code); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +assert.exists(showFortune); +const method = __helpers.removeJSComments(showFortune.toString()); +assert.match(method, /target\s*=\s*e\.target[\s\S]*?if\s*\(\s*\)\s*\{\s*\}/); ``` # --seed-- diff --git a/curriculum/challenges/espanol/blocks/workshop-fortune-teller-app/68f1e6a98bc05e67cc2b85e6.md b/curriculum/challenges/espanol/blocks/workshop-fortune-teller-app/68f1e6a98bc05e67cc2b85e6.md index 255c5752611..80426a0ea2c 100644 --- a/curriculum/challenges/espanol/blocks/workshop-fortune-teller-app/68f1e6a98bc05e67cc2b85e6.md +++ b/curriculum/challenges/espanol/blocks/workshop-fortune-teller-app/68f1e6a98bc05e67cc2b85e6.md @@ -15,22 +15,18 @@ Debes declarar una variable llamada `cardElement` dentro de `showFortune`. ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /const\s+cardElement\s*=/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { cardElement } = showFortune?.variables ?? {}; +assert.exists(cardElement); ``` Tu `cardElement` debe usar `target?.closest` para encontrar el `.card_container`. ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /cardElement\s*=\s*target\?\.closest\s*\(\s*['"]\.card_container['"]\s*\)/); -``` - -Debes pasar `.card_container` como argumento a `closest`. - -```js -assert.match(__helpers.removeJSComments(code), /\.closest\s*\(\s*['"]\.card_container['"]\s*\)/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { cardElement } = showFortune?.variables ?? {}; +assert.isTrue(cardElement?.value.matches("target?.closest('.card_container')")); ``` # --seed-- diff --git a/curriculum/challenges/espanol/blocks/workshop-fortune-teller-app/68f1e852f705eb77f6bcb893.md b/curriculum/challenges/espanol/blocks/workshop-fortune-teller-app/68f1e852f705eb77f6bcb893.md index 9436d0492cb..088502a0020 100644 --- a/curriculum/challenges/espanol/blocks/workshop-fortune-teller-app/68f1e852f705eb77f6bcb893.md +++ b/curriculum/challenges/espanol/blocks/workshop-fortune-teller-app/68f1e852f705eb77f6bcb893.md @@ -15,28 +15,18 @@ Debes declarar una variable llamada `cardId` dentro de `showFortune`. ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /const\s+cardId\s*=/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { cardId } = showFortune?.variables ?? {}; +assert.exists(cardId); ``` Tu variable `cardId` debe asignarse llamando a `cardElement.getAttribute("data-id")`. ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /cardId\s*=\s*cardElement\.getAttribute\s*\(\s*['"]data-id['"]\s*\)/); -``` - -Debes usar el método `getAttribute` en `cardElement`. - -```js -assert.match(__helpers.removeJSComments(code), /cardElement\.getAttribute\s*\(/); -``` - -Debes pasar `'data-id'` a `getAttribute`. - -```js -assert.match(__helpers.removeJSComments(code), /\.getAttribute\s*\(\s*['"]data-id['"]\s*\)/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { cardId } = showFortune?.variables ?? {}; +assert.isTrue(cardId?.value.matches('cardElement.getAttribute("data-id")')); ``` # --seed-- diff --git a/curriculum/challenges/espanol/blocks/workshop-fortune-teller-app/68f1e8de2731b07d62e738d2.md b/curriculum/challenges/espanol/blocks/workshop-fortune-teller-app/68f1e8de2731b07d62e738d2.md index 7dd5280a13d..ba17d957573 100644 --- a/curriculum/challenges/espanol/blocks/workshop-fortune-teller-app/68f1e8de2731b07d62e738d2.md +++ b/curriculum/challenges/espanol/blocks/workshop-fortune-teller-app/68f1e8de2731b07d62e738d2.md @@ -15,28 +15,38 @@ Debes declarar una variable llamada `foundCard` dentro de `showFortune`. ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /const\s+foundCard\s*=/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { foundCard } = showFortune?.variables ?? {}; +assert.exists(foundCard); ``` -Tu `foundCard` debe asignarse llamando a `find` sobre `this.cards` con el callback correcto. +Tu `foundCard` debe ser asignado llamando a `find` sobre `this.cards`, pasando un callback que tome un parámetro `card` y devuelva el resultado de comparar `card.name_short` con `cardId` usando igualdad estricta. ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /foundCard\s*=\s*this\.cards\.find\s*\(/); -``` - -El callback `find` debe tener un parámetro llamado `card`. - -```js -assert.match(__helpers.removeJSComments(code), /cards\.find\s*\(\s*\(\s*card\s*\)\s*=>/); -``` - -Dentro del callback, `card.name_short` debe compararse con `cardId`. - -```js -assert.match(__helpers.removeJSComments(code), /card\.name_short\s*===?\s*cardId/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { foundCard } = showFortune?.variables ?? {}; + +const validForms = [ + 'this.cards.find((card) => card.name_short === cardId)', + 'this.cards.find((card) => { return card.name_short === cardId; })', + 'this.cards.find((card) => cardId === card.name_short)', + 'this.cards.find((card) => { return cardId === card.name_short; })', + 'this.cards.find(card => card.name_short === cardId)', + 'this.cards.find(card => { return card.name_short === cardId; })', + 'this.cards.find(card => cardId === card.name_short)', + 'this.cards.find(card => { return cardId === card.name_short; })', + 'this.cards.find((card: Card) => card.name_short === cardId)', + 'this.cards.find((card: Card) => { return card.name_short === cardId; })', + 'this.cards.find((card: Card) => cardId === card.name_short)', + 'this.cards.find((card: Card) => { return cardId === card.name_short; })', + 'this.cards.find(function (card) { return card.name_short === cardId; })', + 'this.cards.find(function (card) { return cardId === card.name_short; })', + 'this.cards.find(function (card: Card) { return card.name_short === cardId; })', + 'this.cards.find(function (card: Card) { return cardId === card.name_short; })' +]; + +assert.isTrue(validForms.some((form) => foundCard?.value.matches(form))); ``` # --seed-- diff --git a/curriculum/challenges/espanol/blocks/workshop-greeting-bot/66ad8ab945d266383f318cbf.md b/curriculum/challenges/espanol/blocks/workshop-greeting-bot/66ad8ab945d266383f318cbf.md index 834b67468f5..9dfb4448595 100644 --- a/curriculum/challenges/espanol/blocks/workshop-greeting-bot/66ad8ab945d266383f318cbf.md +++ b/curriculum/challenges/espanol/blocks/workshop-greeting-bot/66ad8ab945d266383f318cbf.md @@ -30,7 +30,11 @@ assert.lengthOf(logSpy.calls, 2); Tu declaración `console` debe tener el mensaje `"I am excited to talk to you."`. No olvides las comillas. ```js -assert.deepInclude(logSpy.calls, ["I am excited to talk to you."]); +assert.isTrue( + logSpy.calls.some( + (call) => /I\s+am\s+excited\s+to\s+talk\s+to\s+you\s*\./.test(call[0]) + ) +); ``` # --seed-- diff --git a/curriculum/challenges/espanol/blocks/workshop-greeting-bot/66ad9c633fa26d3c1475eae3.md b/curriculum/challenges/espanol/blocks/workshop-greeting-bot/66ad9c633fa26d3c1475eae3.md index 54134432ecd..404fdfef4b1 100644 --- a/curriculum/challenges/espanol/blocks/workshop-greeting-bot/66ad9c633fa26d3c1475eae3.md +++ b/curriculum/challenges/espanol/blocks/workshop-greeting-bot/66ad9c633fa26d3c1475eae3.md @@ -28,7 +28,11 @@ assert.lengthOf(logSpy.calls, 3); Tu declaración de `console` debería tener el mensaje `"Allow me to introduce myself."`. No olvides las comillas. ```js -assert.deepInclude(logSpy.calls, ["Allow me to introduce myself."]); +assert.isTrue( + logSpy.calls.some( + (call) => /Allow\s+me\s+to\s+introduce\s+myself\s*\./.test(call[0]) + ) +); ``` # --seed-- diff --git a/curriculum/challenges/espanol/blocks/workshop-greeting-bot/66add47d27763c4862492c8c.md b/curriculum/challenges/espanol/blocks/workshop-greeting-bot/66add47d27763c4862492c8c.md index e2050069909..ccd7ab6ea1c 100644 --- a/curriculum/challenges/espanol/blocks/workshop-greeting-bot/66add47d27763c4862492c8c.md +++ b/curriculum/challenges/espanol/blocks/workshop-greeting-bot/66add47d27763c4862492c8c.md @@ -76,12 +76,10 @@ console.log(favoriteSubjectSentence); ```js console.log("Hi there!"); console.log("I am excited to talk to you."); - let bot; -let botLocation; - bot = "teacherBot"; -botLocation = "the universe"; + +let botLocation = "the universe"; console.log("Allow me to introduce myself."); diff --git a/curriculum/challenges/espanol/blocks/workshop-hotel-feedback-form/66a93bbe65a26169dbf3bc39.md b/curriculum/challenges/espanol/blocks/workshop-hotel-feedback-form/66a93bbe65a26169dbf3bc39.md index af39890d0b4..817d14a7c87 100644 --- a/curriculum/challenges/espanol/blocks/workshop-hotel-feedback-form/66a93bbe65a26169dbf3bc39.md +++ b/curriculum/challenges/espanol/blocks/workshop-hotel-feedback-form/66a93bbe65a26169dbf3bc39.md @@ -13,7 +13,7 @@ Comienza agregando un nuevo elemento `label` con el texto `Email address (requir # --hints-- -Deberías tener un elemento `label`. +Debes tener un segundo elemento `label` dentro de tu `fieldset`. ```js assert.lengthOf(document.querySelectorAll('fieldset label'), 2); diff --git a/curriculum/challenges/espanol/blocks/workshop-hotel-feedback-form/66a9401c9d660d6bb15993e2.md b/curriculum/challenges/espanol/blocks/workshop-hotel-feedback-form/66a9401c9d660d6bb15993e2.md index ece541c72fb..43546324a4a 100644 --- a/curriculum/challenges/espanol/blocks/workshop-hotel-feedback-form/66a9401c9d660d6bb15993e2.md +++ b/curriculum/challenges/espanol/blocks/workshop-hotel-feedback-form/66a9401c9d660d6bb15993e2.md @@ -7,7 +7,7 @@ dashedName: step-13 # --description-- -El formulario de comentarios de su hotel debe tener una opción para que los usuarios agreguen su edad. +El formulario de comentarios de su hotel debe tener una opción para que los usuarios agreguen su edad. Comience agregando un elemento `label` con el texto `Age (optional):` al formulario. @@ -15,7 +15,7 @@ El atributo `for` debe establecerse en `"age"`. # --hints-- -Deberías tener un elemento `label`. +Debes tener un tercer elemento `label` dentro de tu `fieldset`. ```js assert.lengthOf(document.querySelectorAll('fieldset label'), 3); diff --git a/curriculum/challenges/espanol/blocks/workshop-hotel-feedback-form/66a9419e2d18476c645ce693.md b/curriculum/challenges/espanol/blocks/workshop-hotel-feedback-form/66a9419e2d18476c645ce693.md index ee113ad8130..b78c01da13a 100644 --- a/curriculum/challenges/espanol/blocks/workshop-hotel-feedback-form/66a9419e2d18476c645ce693.md +++ b/curriculum/challenges/espanol/blocks/workshop-hotel-feedback-form/66a9419e2d18476c645ce693.md @@ -7,7 +7,7 @@ dashedName: step-14 # --description-- -`input` de número se utiliza para crear un campo de entrada numérica. +`input` de número se utiliza para crear un campo de entrada numérica. Aquí hay un ejemplo de un campo de entrada de número: @@ -17,9 +17,9 @@ Aquí hay un ejemplo de un campo de entrada de número: Los atributos `min` y `max` se usan para establecer los valores mínimo y máximo que se pueden ingresar en el campo de entrada. -Debajo de su elemento de `label`, añade un input con el atributo `type` establecido en `"number"` y un `id` de `"age"`. +Debajo de tu elemento `label`, agrega un `input` con el atributo `type` establecido en `"number"` y un `id` de `"age"`. -El atributo `name` debe estar configurado como `"age"`, el atributo `min` debe ser `"3"` y el atributo `max` debe ser `"100"`. +El atributo `name` debe estar establecido en `"age"`, el atributo `min` debe estar establecido en `"3"` y el atributo `max` debe estar establecido en `"100"`. # --hints-- @@ -29,13 +29,13 @@ Debe tener un `input` de número debajo de su elemento de `label`. assert.isNotNull(document.querySelector('label + input[type="number"]')); ``` -Su `input` de número debe tener un `id` de `age`. +Tu `input` de número debe tener un `id` de `"age"`. ```js assert.isNotNull(document.querySelector('label + input#age')); ``` -Su `input` de número debe tener un atributo `name` establecido en `age`. +Tu `input` de número debe tener un atributo `name` establecido en `"age"`. ```js assert.isNotNull(document.querySelector('label + input[name="age"]')); diff --git a/curriculum/challenges/espanol/blocks/workshop-hotel-feedback-form/67a51d3a8a6fe123b77b0c6e.md b/curriculum/challenges/espanol/blocks/workshop-hotel-feedback-form/67a51d3a8a6fe123b77b0c6e.md index da60f18cdbe..bf8cc98ff5f 100644 --- a/curriculum/challenges/espanol/blocks/workshop-hotel-feedback-form/67a51d3a8a6fe123b77b0c6e.md +++ b/curriculum/challenges/espanol/blocks/workshop-hotel-feedback-form/67a51d3a8a6fe123b77b0c6e.md @@ -7,11 +7,11 @@ dashedName: step-12 # --description-- -Los elementos `input` pueden tener un atributo `size`. Este atributo define el número de caracteres que deberían ser visibles mientras el usuario escribe en el input. El valor de `size` debe ser un entero no negativo mayor que cero. Si no se especifica `size`, o se especifica con un valor no válido, el input tendrá el ancho predeterminado establecido por el navegador. +Los elementos `input` pueden tener un atributo `size`. Este atributo define el número de caracteres que deben ser visibles mientras el usuario escribe en el `input`. El valor de `size` debe ser un entero positivo. Si no se especifica `size` o se especifica con un valor inválido, el `input` tendrá el ancho predeterminado establecido por el navegador. ```html - - + + ``` Asigne a los inputs de nombre y correo electrónico un atributo `size` con un valor de `"20"`. diff --git a/curriculum/challenges/espanol/blocks/workshop-plant-nursery-catalog/6734a772196245601e4b80e0.md b/curriculum/challenges/espanol/blocks/workshop-plant-nursery-catalog/6734a772196245601e4b80e0.md index 10613cd968b..cafee76f92d 100644 --- a/curriculum/challenges/espanol/blocks/workshop-plant-nursery-catalog/6734a772196245601e4b80e0.md +++ b/curriculum/challenges/espanol/blocks/workshop-plant-nursery-catalog/6734a772196245601e4b80e0.md @@ -9,7 +9,7 @@ dashedName: step-10 Cuando necesites recuperar un elemento de un mapa, puedes usar el método `get`. Toma una clave como argumento y devuelve el valor asociado. -Utiliza el método `get` para recuperar el valor de la clave `ballerina` de tu catálogo y asígneselo a una variable llamada `getBallerina`. Luego, registra tu nueva variable en la consola. +Usa el método `get` para obtener el valor de la clave `ballerina` de tu catálogo y asígnalo a una variable llamada `getBallerina`. Luego, muestra tu nueva variable en la consola. # --hints-- @@ -22,7 +22,10 @@ assert.exists(getBallerina); Tu variable `getBallerina` debe tener el valor de `catalog.get(ballerina)`. ```js -assert.match(__helpers.removeJSComments(code), /(const|let|var)\s+getBallerina\s*=\s*catalog\s*\.\s*get\s*\(\s*ballerina\s*\)/); +const explorer = await __helpers.Explorer(code); +const { getBallerina } = explorer.variables; +assert.isTrue(getBallerina?.value.matches('catalog.get(ballerina)') +); ``` Debes registrar tu variable `getBallerina` en la consola. diff --git a/curriculum/challenges/espanol/blocks/workshop-plant-nursery-catalog/6737a1a073a0d14c6544d301.md b/curriculum/challenges/espanol/blocks/workshop-plant-nursery-catalog/6737a1a073a0d14c6544d301.md index 553253b881f..7b0193a4282 100644 --- a/curriculum/challenges/espanol/blocks/workshop-plant-nursery-catalog/6737a1a073a0d14c6544d301.md +++ b/curriculum/challenges/espanol/blocks/workshop-plant-nursery-catalog/6737a1a073a0d14c6544d301.md @@ -23,7 +23,9 @@ assert.exists(plantsSet); Debe llamar a `displayPlantsSet` y asignarlo a `plantsSet`. ```js -assert.match(__helpers.removeJSComments(code), /(const|let|var)\s+plantsSet\s*=\s*displayPlantsSet\s*\(\s*\)/) +const explorer = await __helpers.Explorer(code); +const { plantsSet } = explorer.variables; +assert.isTrue(plantsSet?.value.matches('displayPlantsSet()')); ``` Debe registrar `plantsSet` en la consola. diff --git a/curriculum/challenges/espanol/blocks/workshop-reusable-mega-navbar/6740495ba48aa94e5667b436.md b/curriculum/challenges/espanol/blocks/workshop-reusable-mega-navbar/6740495ba48aa94e5667b436.md index 3768817a4dc..273c5f43f27 100644 --- a/curriculum/challenges/espanol/blocks/workshop-reusable-mega-navbar/6740495ba48aa94e5667b436.md +++ b/curriculum/challenges/espanol/blocks/workshop-reusable-mega-navbar/6740495ba48aa94e5667b436.md @@ -10,7 +10,7 @@ demoType: onLoad En este taller, practicarás trabajando con componentes funcionales de React construyendo una barra de navegación reutilizable. -Todo el CSS ha sido proporcionado para que te puedas enfocar en crear la barra de navegación. +Todo el CSS ha sido proporcionado para que puedas enfocarte en crear la barra de navegación. Comienza definiendo un componente funcional `Navbar`. En el siguiente paso, comenzarás a desarrollar el componente utilizando JSX. @@ -24,7 +24,7 @@ export function multiply(a, b) { } ``` -Además, los componentes funcionales de React deben comenzar con una letra mayúscula, ya que es una forma de diferenciarlos de los elementos HTML regulares. +Además, los componentes funcionales de React deben comenzar con una letra mayúscula porque así es como React los diferencia de los elementos HTML normales. # --hints-- diff --git a/curriculum/challenges/espanol/blocks/workshop-reusable-mega-navbar/67457ff2dc531fbed928a0f0.md b/curriculum/challenges/espanol/blocks/workshop-reusable-mega-navbar/67457ff2dc531fbed928a0f0.md index f36876e4d6b..50f799bccb3 100644 --- a/curriculum/challenges/espanol/blocks/workshop-reusable-mega-navbar/67457ff2dc531fbed928a0f0.md +++ b/curriculum/challenges/espanol/blocks/workshop-reusable-mega-navbar/67457ff2dc531fbed928a0f0.md @@ -24,10 +24,9 @@ const App = () => { } ``` - Dentro del componente `Navbar`, devuelve un elemento `nav` que tiene un `className` de `navbar`. -La razón por la que se usa `className` aquí en lugar de `class` es porque `class` es una palabra clave reservada en JavaScript. Por lo tanto, React utiliza `className` como una forma de aplicar clases a los elementos. +`className` se usa aquí en lugar de `class` porque `class` es una palabra clave reservada en JavaScript. Por eso, React usa `className` como una forma de aplicar clases a los elementos. # --hints-- @@ -37,7 +36,7 @@ Deberías devolver un elemento `nav`. assert.exists(document.querySelector('nav')); ``` -Tu elemento `nav` debería tener un atributo `className` con el valor `navbar`. +Tu elemento `nav` debe tener un `className` de `navbar`. ```js assert.equal(document.querySelector('nav')?.getAttribute('class'), 'navbar'); diff --git a/curriculum/challenges/espanol/blocks/workshop-reusable-mega-navbar/6745c732dbeb7c04f346e6f7.md b/curriculum/challenges/espanol/blocks/workshop-reusable-mega-navbar/6745c732dbeb7c04f346e6f7.md index e9996eda840..b3bac28a082 100644 --- a/curriculum/challenges/espanol/blocks/workshop-reusable-mega-navbar/6745c732dbeb7c04f346e6f7.md +++ b/curriculum/challenges/espanol/blocks/workshop-reusable-mega-navbar/6745c732dbeb7c04f346e6f7.md @@ -7,7 +7,7 @@ dashedName: step-3 # --description-- -Cree un elemento `ul` dentro del elemento `nav`. Dentro de ese elemento `ul`, cree tres elementos de lista. +Crea un elemento `ul` dentro de tu elemento `nav`. Dentro de ese elemento `ul`, crea tres elementos `li`. # --hints-- diff --git a/curriculum/challenges/espanol/blocks/workshop-reusable-mega-navbar/6745c89fba004707ded84453.md b/curriculum/challenges/espanol/blocks/workshop-reusable-mega-navbar/6745c89fba004707ded84453.md index 674692c053f..f7866dc6a7d 100644 --- a/curriculum/challenges/espanol/blocks/workshop-reusable-mega-navbar/6745c89fba004707ded84453.md +++ b/curriculum/challenges/espanol/blocks/workshop-reusable-mega-navbar/6745c89fba004707ded84453.md @@ -7,17 +7,17 @@ dashedName: step-5 # --description-- -Crea un elemento de anclaje dentro del primer elemento `li`. Asigna al elemento `a` un atributo `href` con el valor `#` y el texto `Dashboard`. +Crea un elemento `a` dentro de tu primer elemento `li`. Dale un atributo `href` con el valor `#` y el texto `Dashboard`. # --hints-- -Debes crear un elemento `a` dentro del primer elemento de la lista. +Debes crear un elemento `a` dentro de tu primer elemento `li`. ```js assert.exists(document.querySelector('li a')); ``` -Tu elemento `a` debería tener su atributo `href` establecido en `#`. +Tu elemento `a` debe tener un atributo `href` con el valor `#`. ```js assert.equal(document.querySelector('a')?.getAttribute('href'), '#'); diff --git a/curriculum/challenges/espanol/blocks/workshop-reusable-mega-navbar/6745cebbf97ef2129f3b9bab.md b/curriculum/challenges/espanol/blocks/workshop-reusable-mega-navbar/6745cebbf97ef2129f3b9bab.md index 73a5ea32cbe..48ebf990758 100644 --- a/curriculum/challenges/espanol/blocks/workshop-reusable-mega-navbar/6745cebbf97ef2129f3b9bab.md +++ b/curriculum/challenges/espanol/blocks/workshop-reusable-mega-navbar/6745cebbf97ef2129f3b9bab.md @@ -7,17 +7,17 @@ dashedName: step-6 # --description-- -Crea otro elemento `a` dentro del segundo elemento `li`. Asígnale un atributo `href` con valor `#` y el texto `Widgets`. +Crea otro elemento `a` dentro de tu segundo elemento `li`. Dale un atributo `href` con el valor `#` y el texto `Widgets`. # --hints-- -Debes crear un elemento `a` dentro del segundo elemento de la lista. +Debes crear un elemento `a` dentro de tu segundo elemento `li`. ```js assert.lengthOf(document.querySelectorAll('li a'), 2); ``` -Tu elemento `a` debería tener su atributo `href` establecido en `#`. +Tu elemento `a` debe tener un atributo `href` con el valor `#`. ```js assert.equal(document.querySelectorAll('a')[1]?.getAttribute('href'), '#'); diff --git a/curriculum/challenges/espanol/blocks/workshop-reusable-mega-navbar/6745d799beeb822076a4da9d.md b/curriculum/challenges/espanol/blocks/workshop-reusable-mega-navbar/6745d799beeb822076a4da9d.md index 981b74ece2e..1fe65e59c8c 100644 --- a/curriculum/challenges/espanol/blocks/workshop-reusable-mega-navbar/6745d799beeb822076a4da9d.md +++ b/curriculum/challenges/espanol/blocks/workshop-reusable-mega-navbar/6745d799beeb822076a4da9d.md @@ -7,19 +7,19 @@ dashedName: step-7 # --description-- -Dentro del tercer elemento de lista, crear un elemento `button` con el atributo `aria-expanded` establecido en `false`. También, establecer el texto del `button` a `Apps`. +Dentro de tu tercer elemento `li`, crea un elemento `button` con un atributo `aria-expanded` de `false`. Además, establece el texto del `button` como `Apps`. El atributo `aria-expanded` comunicará a los usuarios de lectores de pantalla que el botón activa un submenú expandible. # --hints-- -Debes crear un elemento `button` dentro del tercer elemento de la lista. +Debes crear un elemento `button` dentro de tu tercer elemento `li`. ```js assert.exists(document.querySelector('li:nth-of-type(3) button')); ``` -Tu elemento `button` debería tener un atributo `aria-expanded` establecido en `false`. +Tu elemento `button` debe tener un atributo `aria-expanded` con valor `false`. ```js assert.equal( diff --git a/curriculum/challenges/espanol/blocks/workshop-reusable-mega-navbar/6745d9df333efe2543a1f457.md b/curriculum/challenges/espanol/blocks/workshop-reusable-mega-navbar/6745d9df333efe2543a1f457.md index c6d0be396f0..6bc757bfd55 100644 --- a/curriculum/challenges/espanol/blocks/workshop-reusable-mega-navbar/6745d9df333efe2543a1f457.md +++ b/curriculum/challenges/espanol/blocks/workshop-reusable-mega-navbar/6745d9df333efe2543a1f457.md @@ -7,7 +7,7 @@ dashedName: step-8 # --description-- -Todavía dentro del tercer elemento `li`, crea un elemento `ul` para el menú emergente. Asígnale un `className` de `sub-menu` y un `aria-label` de `Apps`. +Todavía dentro de tu tercer elemento `li`, crea un elemento `ul` para el popup. Asígnale un `className` de `sub-menu` y un `aria-label` de `Apps`. # --hints-- @@ -17,13 +17,13 @@ Debes crear un elemento `ul` dentro de tu tercer elemento `li`. assert.exists(document.querySelector('li ul')); ``` -Debes establecer el atributo `className` de tu elemento `ul` a `sub-menu`. +Tu elemento `ul` debe tener un `className` de `sub-menu`. ```js assert.equal(document.querySelector('li ul')?.getAttribute('class'), 'sub-menu'); ``` -Debes establecer el atributo `aria-label` de tu elemento `ul` a `Apps`. +Tu elemento `ul` debe tener un `aria-label` de `Apps`. ```js assert.equal(document.querySelector('li ul')?.getAttribute('aria-label'), 'Apps'); diff --git a/curriculum/challenges/espanol/blocks/workshop-reusable-mega-navbar/6745dce846995b2a466594be.md b/curriculum/challenges/espanol/blocks/workshop-reusable-mega-navbar/6745dce846995b2a466594be.md index 482ae7494be..696ff7ee6ea 100644 --- a/curriculum/challenges/espanol/blocks/workshop-reusable-mega-navbar/6745dce846995b2a466594be.md +++ b/curriculum/challenges/espanol/blocks/workshop-reusable-mega-navbar/6745dce846995b2a466594be.md @@ -7,11 +7,11 @@ dashedName: step-9 # --description-- -Crea tres nuevos elementos de lista dentro de tu elemento `ul.sub-menu`. +Crea tres nuevos elementos `li` dentro de tu elemento `ul` con un `className` de `sub-menu`. # --hints-- -Deberías crear tres nuevos elementos de lista dentro de tu elemento `ul` con el `className` de `sub-menu`. +Debes crear tres nuevos elementos `li` dentro de tu elemento `ul` con un `className` de `sub-menu`. ```js assert.lengthOf(document.querySelectorAll('.sub-menu li'), 3); diff --git a/curriculum/challenges/espanol/blocks/workshop-reusable-mega-navbar/6745de9ce925b92d72df713a.md b/curriculum/challenges/espanol/blocks/workshop-reusable-mega-navbar/6745de9ce925b92d72df713a.md index 6f69d68e40b..022a1dfd8a5 100644 --- a/curriculum/challenges/espanol/blocks/workshop-reusable-mega-navbar/6745de9ce925b92d72df713a.md +++ b/curriculum/challenges/espanol/blocks/workshop-reusable-mega-navbar/6745de9ce925b92d72df713a.md @@ -7,11 +7,11 @@ dashedName: step-10 # --description-- -Dentro de cada elemento `li`, crea un elemento ancla con el atributo `href` establecido en `#`. +Dentro de cada uno de los tres nuevos elementos `li`, crea un elemento `a` con un atributo `href` de `#`. # --hints-- -Debes crear un nuevo elemento `a` dentro de cada elemento de la lista y configurar su atributo `href` en `#`. +Debes crear un nuevo elemento `a` con un atributo `href` de `#` dentro de cada uno de los tres nuevos elementos `li`. ```js assert.equal(document.querySelectorAll('li a')[2]?.getAttribute('href'), '#'); diff --git a/curriculum/challenges/espanol/blocks/workshop-reusable-mega-navbar/6745e2aca895c935168e7d91.md b/curriculum/challenges/espanol/blocks/workshop-reusable-mega-navbar/6745e2aca895c935168e7d91.md index 5c0e297b3dd..31641c64491 100644 --- a/curriculum/challenges/espanol/blocks/workshop-reusable-mega-navbar/6745e2aca895c935168e7d91.md +++ b/curriculum/challenges/espanol/blocks/workshop-reusable-mega-navbar/6745e2aca895c935168e7d91.md @@ -7,25 +7,25 @@ dashedName: step-11 # --description-- -Para terminar, asigna el texto `Calendar` a la primera etiqueta de ancla, `Chat` a la segunda y `Email` a la tercera. +Para terminar, establece el texto del primer elemento `a` en `Calendar`, el segundo en `Chat` y el tercero en `Email`. -¡Con eso, el componente mega barra de navegación está completo! +Con eso, tu componente `Navbar` está completo. # --hints-- -Debe establecer un texto de `Calendar` para el primer elemento ancla. +Debes establecer el texto del primer elemento `a` en `Calendar`. ```js assert.equal(document.querySelectorAll('li a')[2]?.textContent, 'Calendar'); ``` -Debe establecer un texto de `Chat` para el segundo elemento ancla. +Debes establecer el texto del segundo elemento `a` en `Chat`. ```js assert.equal(document.querySelectorAll('li a')[3]?.textContent, 'Chat'); ``` -Debe establecer un texto de `Email` para el tercer elemento ancla. +Debes establecer el texto del tercer elemento `a` en `Email`. ```js assert.equal(document.querySelectorAll('li a')[4]?.textContent, 'Email'); diff --git a/curriculum/challenges/espanol/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165b.md b/curriculum/challenges/espanol/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165b.md index 4cc8914d8c0..3ce554e49da 100644 --- a/curriculum/challenges/espanol/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165b.md +++ b/curriculum/challenges/espanol/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165b.md @@ -7,7 +7,7 @@ dashedName: step-5 # --description-- -Dentro de su declaración return, reemplace la cadena vacía con un elemento `div` con una propiedad `className` de `flex-container`. +Dentro de la sentencia `return`, reemplaza la cadena vacía con un elemento `div` que tenga un `className` de `flex-container`. # --hints-- @@ -26,7 +26,7 @@ Su componente `App` debería devolver un único elemento `div`. assert.lengthOf(testElem.children, 1); ``` -Su `div` debería tener una propiedad `className` de `flex-container`. +Tu `div` debe tener un `className` de `flex-container`. ```js const testElem = await __helpers.prepTestComponent(window.index.App); diff --git a/curriculum/challenges/espanol/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165c.md b/curriculum/challenges/espanol/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165c.md index 81fb08923f0..e11305801a5 100644 --- a/curriculum/challenges/espanol/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165c.md +++ b/curriculum/challenges/espanol/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165c.md @@ -7,7 +7,7 @@ dashedName: step-6 # --description-- -Ahora, coloca el componente `Card` dentro de tu componente `App`. Dale la propiedad `name` con el valor `"Mark"`, la propiedad `title` con el valor `"Front-End developer"` y la propiedad `bio` con el valor `"I like to work with different front-end technologies and play video games."` +Ahora, coloca el componente `Card` dentro de tu componente `App`. Dale la prop `name` con el valor `"Mark"`, la prop `title` con el valor `"Front-End developer"` y la prop `bio` con el valor `"I like to work with different front-end technologies and play video games."` # --hints-- diff --git a/curriculum/challenges/espanol/blocks/workshop-reusable-profile-card-component/68720c179cd34be6793bfdf6.md b/curriculum/challenges/espanol/blocks/workshop-reusable-profile-card-component/68720c179cd34be6793bfdf6.md index 65cc0577d76..f056a2e2ebc 100644 --- a/curriculum/challenges/espanol/blocks/workshop-reusable-profile-card-component/68720c179cd34be6793bfdf6.md +++ b/curriculum/challenges/espanol/blocks/workshop-reusable-profile-card-component/68720c179cd34be6793bfdf6.md @@ -9,7 +9,7 @@ dashedName: step-8 Aunque tu aplicación funciona como se espera, normalmente no agregarías múltiples componentes `Card` manualmente de esta manera. -Elimina los tres componentes `` dentro del elemento `
`. En los siguientes pasos, crearás un arreglo de datos y usarás la función `map()` para renderizar los componentes `Card`, que es el enfoque más común en React. +Elimina los tres componentes `` dentro del elemento `
`. En los próximos pasos, crearás un arreglo de datos y usarás el método `map()` para renderizar los componentes `Card`, que es el enfoque más común en React. # --hints-- diff --git a/curriculum/challenges/espanol/blocks/workshop-reusable-profile-card-component/68778af56eb5d980a4e2daed.md b/curriculum/challenges/espanol/blocks/workshop-reusable-profile-card-component/68778af56eb5d980a4e2daed.md index dbf799ea099..c34b52fd3e5 100644 --- a/curriculum/challenges/espanol/blocks/workshop-reusable-profile-card-component/68778af56eb5d980a4e2daed.md +++ b/curriculum/challenges/espanol/blocks/workshop-reusable-profile-card-component/68778af56eb5d980a4e2daed.md @@ -30,7 +30,7 @@ const profilesVal = eval(profiles?.value.toString()); assert.isArray(profilesVal); ``` -Tu arreglo de perfiles debe contener un objeto que incluya todas las propiedades requeridas: `id`, `name`, `title` y `bio`. +Tu arreglo `profiles` debe contener un objeto que incluya todas las props requeridas: `id`, `name`, `title` y `bio`. ```js const explorer = await __helpers.Explorer(code); diff --git a/curriculum/challenges/espanol/blocks/workshop-reusable-profile-card-component/68779156bd3704b727ba5f38.md b/curriculum/challenges/espanol/blocks/workshop-reusable-profile-card-component/68779156bd3704b727ba5f38.md index 0f6dac3cc55..fc423607939 100644 --- a/curriculum/challenges/espanol/blocks/workshop-reusable-profile-card-component/68779156bd3704b727ba5f38.md +++ b/curriculum/challenges/espanol/blocks/workshop-reusable-profile-card-component/68779156bd3704b727ba5f38.md @@ -7,7 +7,7 @@ dashedName: step-10 # --description-- -Como recuerdas de lecciones anteriores, puedes usar el método `map` para iterar a través de los diferentes objetos y renderizar los componentes dinámicamente así: +Como recuerdas de lecciones anteriores, puedes usar el método `map()` para iterar a través de los diferentes objetos y renderizar los componentes dinámicamente así: ```jsx export function App() { diff --git a/curriculum/challenges/espanol/blocks/workshop-toggle-text-app/67cd46ec4ec904186ad52ba5.md b/curriculum/challenges/espanol/blocks/workshop-toggle-text-app/67cd46ec4ec904186ad52ba5.md index 2d62da21b5e..92a28a4b0f8 100644 --- a/curriculum/challenges/espanol/blocks/workshop-toggle-text-app/67cd46ec4ec904186ad52ba5.md +++ b/curriculum/challenges/espanol/blocks/workshop-toggle-text-app/67cd46ec4ec904186ad52ba5.md @@ -7,7 +7,7 @@ dashedName: step-3 # --description-- -Debajo de su `button` elemento, añada un elemento de párrafo con un `id` de `message` y el texto `I love freeCodeCamp!`. +Debajo de tu elemento `button`, agrega un elemento de párrafo con un `id` llamado `message` y el texto `I love freeCodeCamp!`. # --hints-- @@ -17,7 +17,7 @@ Debe tener un elemento de párrafo. assert.exists(document.querySelector("p")); ``` -Su elemento de párrafo debería tener un `id` de `message`. +Tu elemento de párrafo debe tener un `id` llamado `message`. ```js assert.exists(document.getElementById("message")) diff --git a/curriculum/challenges/espanol/blocks/workshop-toggle-text-app/67cd49e05693111a41771f29.md b/curriculum/challenges/espanol/blocks/workshop-toggle-text-app/67cd49e05693111a41771f29.md index 8994f6c675e..17916c90a8c 100644 --- a/curriculum/challenges/espanol/blocks/workshop-toggle-text-app/67cd49e05693111a41771f29.md +++ b/curriculum/challenges/espanol/blocks/workshop-toggle-text-app/67cd49e05693111a41771f29.md @@ -19,7 +19,7 @@ La convención para nombrar variables de estado es usar el formato `example` y ` Crea una nueva variable de estado y la función de set llamada `isVisible` y `setIsVisible`. Recuerda utilizar la sintaxis de desestructuración de arrays como se muestra en el ejemplo. -Luego asigna el hook `useState` con un valor inicial de `false`. +Luego llama al hook `useState` con un valor inicial de `false`. # --hints-- diff --git a/curriculum/challenges/espanol/blocks/workshop-toggle-text-app/67cd4fe67813f71c3479e64a.md b/curriculum/challenges/espanol/blocks/workshop-toggle-text-app/67cd4fe67813f71c3479e64a.md index 8ad7348c4f6..85ada61cb05 100644 --- a/curriculum/challenges/espanol/blocks/workshop-toggle-text-app/67cd4fe67813f71c3479e64a.md +++ b/curriculum/challenges/espanol/blocks/workshop-toggle-text-app/67cd4fe67813f71c3479e64a.md @@ -9,7 +9,7 @@ dashedName: step-6 Una forma de mostrar el texto del párrafo es cambiar el valor inicial para el `useState` hook. -Cambie el valor actual de `useState` de `false` a `true` y debería ver que el texto del párrafo ahora se muestra en la pantalla. +Cambia el valor inicial de `useState` de `false` a `true`. Cuando lo hagas correctamente, deberías ver que el texto del párrafo ahora se muestra en la pantalla. # --hints-- diff --git a/curriculum/challenges/espanol/blocks/workshop-toggle-text-app/67cd525b0e575b1e5abf4c03.md b/curriculum/challenges/espanol/blocks/workshop-toggle-text-app/67cd525b0e575b1e5abf4c03.md index 6cf0bede03c..5de99e697f3 100644 --- a/curriculum/challenges/espanol/blocks/workshop-toggle-text-app/67cd525b0e575b1e5abf4c03.md +++ b/curriculum/challenges/espanol/blocks/workshop-toggle-text-app/67cd525b0e575b1e5abf4c03.md @@ -7,7 +7,7 @@ dashedName: step-9 # --description-- -Como se mencionó anteriormente, la función set es responsable de actualizar el estado. Un enfoque común al alternar entre valores de estado booleanos es actualizar el estado de esta manera: +Como se mencionó antes, la función set es responsable de actualizar el estado. Un enfoque común al alternar entre valores booleanos de estado es actualizar el estado de esta manera: ```js const [isUserLoggedIn, setIsUserLoggedIn] = useState(false); @@ -16,7 +16,7 @@ const [isUserLoggedIn, setIsUserLoggedIn] = useState(false); setIsUserLoggedIn(!isUserLoggedIn); ``` -En el siguiente ejemplo se usa la función set llamada `setIsUserLoggedIn` para actualizar el estado de inicio de sesión para el usuario. Es una práctica común usar el operador lógico NO (`!`) para alternar entre `true` y `false`. Dado que el valor inicial es `false`, aplicar el operador `!` lo cambiará a `true`. +El ejemplo anterior usa la función set llamada `setIsUserLoggedIn` para actualizar el estado de inicio de sesión del usuario. Es una práctica común usar el operador lógico NOT (`!`) para alternar entre `true` y `false`. Dado que el valor inicial es `false`, aplicar el operador `!` lo cambiará a `true`. Dentro de la función `handleToggleVisibility`, use `setIsVisible` para actualizar el estado de visibilidad usando el operador lógico NO (`!`). diff --git a/curriculum/challenges/espanol/blocks/workshop-toggle-text-app/67cd57e96257ed1fabbe4879.md b/curriculum/challenges/espanol/blocks/workshop-toggle-text-app/67cd57e96257ed1fabbe4879.md index 7d169a77a43..dfb197aaf0a 100644 --- a/curriculum/challenges/espanol/blocks/workshop-toggle-text-app/67cd57e96257ed1fabbe4879.md +++ b/curriculum/challenges/espanol/blocks/workshop-toggle-text-app/67cd57e96257ed1fabbe4879.md @@ -27,7 +27,7 @@ Ahora, cuando haces clic en el botón, verás que la visibilidad del texto del p # --hints-- -Cuando se hace clic en el `toggle-button`, el mensaje `"I love freeCodeCamp!"` debería aparecer en la pantalla. +Tu mensaje `I love freeCodeCamp!` debería aparecer en la pantalla cuando se haga clic en el `toggle-button`. ```js const abuseState = __helpers.spyOn(React, "useState"); diff --git a/curriculum/challenges/espanol/blocks/workshop-toggle-text-app/67cd5bace629fa219a70aa6d.md b/curriculum/challenges/espanol/blocks/workshop-toggle-text-app/67cd5bace629fa219a70aa6d.md index 88bf2cc41ac..d9fb007d171 100644 --- a/curriculum/challenges/espanol/blocks/workshop-toggle-text-app/67cd5bace629fa219a70aa6d.md +++ b/curriculum/challenges/espanol/blocks/workshop-toggle-text-app/67cd5bace629fa219a70aa6d.md @@ -9,7 +9,7 @@ dashedName: step-12 Si miraste la consola, podría haberte sorprendido ver el valor de `false` en lugar de `true`. Esto ocurre porque React no actualiza el estado de inmediato. El estado solo se actualizará en el próximo ciclo de renderizado. -Es un error común que los desarrolladores nuevos en React coloquen declaraciones de consola justo después de una función set. Así que esto es algo a tener en cuenta cuando estés construyendo tus aplicaciones en React. +Es un error común para los desarrolladores nuevos en React colocar sentencias de consola justo después de una función set. Así que esto es algo que debes tener en cuenta mientras construyes tus aplicaciones React. Dado que el `console.log()` ya no es necesario, retíralo de tu función `handleToggleVisibility`. diff --git a/curriculum/challenges/espanol/blocks/workshop-toggle-text-app/67cd61c24bfc0a240132fd2f.md b/curriculum/challenges/espanol/blocks/workshop-toggle-text-app/67cd61c24bfc0a240132fd2f.md index 454cdcaa74f..9b5afcde28a 100644 --- a/curriculum/challenges/espanol/blocks/workshop-toggle-text-app/67cd61c24bfc0a240132fd2f.md +++ b/curriculum/challenges/espanol/blocks/workshop-toggle-text-app/67cd61c24bfc0a240132fd2f.md @@ -23,14 +23,14 @@ Para el último paso del taller, utiliza el operador ternario para mostrar condi # --hints-- -Cuando `isVisible` es `false`, el texto del botón debería decir `Show Message`. +El texto de tu botón debe decir `Show Message` cuando `isVisible` es `false`. ```js const btn = document.getElementById("toggle-button"); assert.equal(btn.textContent, "Show Message"); ``` -Cuando `isVisible` es `true`, el texto del botón debería decir `Hide Message`. +El texto de tu botón debe decir `Hide Message` cuando `isVisible` es `true`. ```js const abuseState = __helpers.spyOn(React, "useState"); @@ -246,7 +246,7 @@ export const ToggleApp = () => { const handleToggleVisibility = () => { setIsVisible(!isVisible); - } + }; return (
diff --git a/curriculum/challenges/espanol/blocks/workshop-wildlife-tracker/6999ac171928136168654774.md b/curriculum/challenges/espanol/blocks/workshop-wildlife-tracker/6999ac171928136168654774.md index aeb4d76fcba..08f43c0d345 100644 --- a/curriculum/challenges/espanol/blocks/workshop-wildlife-tracker/6999ac171928136168654774.md +++ b/curriculum/challenges/espanol/blocks/workshop-wildlife-tracker/6999ac171928136168654774.md @@ -42,8 +42,10 @@ assert.isFunction(getSpecies); La función `getSpecies` debe tener un solo parámetro, `animal`. ```js -const regex = __helpers.functionRegex('getSpecies', ['animal']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { getSpecies } = explorer.allFunctions; +assert.equal(getSpecies?.parameters.length, 1); +assert.equal(getSpecies?.parameters[0].toString(), 'animal'); ``` Debes mostrar `getSpecies(tiger)` en la consola. diff --git a/curriculum/challenges/espanol/blocks/workshop-wildlife-tracker/6999ad1cdc249e185aaeedbd.md b/curriculum/challenges/espanol/blocks/workshop-wildlife-tracker/6999ad1cdc249e185aaeedbd.md index b03e64f842d..ada033952c1 100644 --- a/curriculum/challenges/espanol/blocks/workshop-wildlife-tracker/6999ad1cdc249e185aaeedbd.md +++ b/curriculum/challenges/espanol/blocks/workshop-wildlife-tracker/6999ad1cdc249e185aaeedbd.md @@ -49,8 +49,11 @@ assert.isFunction(addHabitat); La función `addHabitat` debe tener dos parámetros: `animal` y `habitat`. ```js -const regex = __helpers.functionRegex('addHabitat', ['animal', 'habitat']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { addHabitat } = explorer.allFunctions; +assert.equal(addHabitat?.parameters.length, 2); +assert.equal(addHabitat?.parameters[0].toString(), 'animal'); +assert.equal(addHabitat?.parameters[1].toString(), 'habitat'); ``` La función `addHabitat` debe devolver el objeto `animal` actualizado. diff --git a/curriculum/challenges/espanol/blocks/workshop-wildlife-tracker/6999adc72c02812a28c01e31.md b/curriculum/challenges/espanol/blocks/workshop-wildlife-tracker/6999adc72c02812a28c01e31.md index 21d57043bf6..06b780e7687 100644 --- a/curriculum/challenges/espanol/blocks/workshop-wildlife-tracker/6999adc72c02812a28c01e31.md +++ b/curriculum/challenges/espanol/blocks/workshop-wildlife-tracker/6999adc72c02812a28c01e31.md @@ -43,8 +43,11 @@ assert.isFunction(updateAge); La función `updateAge` debe tener dos parámetros: `animal` y `newAge`. ```js -const regex = __helpers.functionRegex('updateAge', ['animal', 'newAge']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { updateAge } = explorer.allFunctions; +assert.equal(updateAge?.parameters.length, 2); +assert.equal(updateAge?.parameters[0].toString(), 'animal'); +assert.equal(updateAge?.parameters[1].toString(), 'newAge'); ``` La función `updateAge` debe devolver el objeto `animal` actualizado. diff --git a/curriculum/challenges/espanol/blocks/workshop-wildlife-tracker/6999b0198d18d402c36cc5fe.md b/curriculum/challenges/espanol/blocks/workshop-wildlife-tracker/6999b0198d18d402c36cc5fe.md index 88899290f72..acbcef3c4b3 100644 --- a/curriculum/challenges/espanol/blocks/workshop-wildlife-tracker/6999b0198d18d402c36cc5fe.md +++ b/curriculum/challenges/espanol/blocks/workshop-wildlife-tracker/6999b0198d18d402c36cc5fe.md @@ -45,8 +45,10 @@ assert.isFunction(removeEndangeredStatus); La función `removeEndangeredStatus` debe tener un solo parámetro, `animal`. ```js -const regex = __helpers.functionRegex('removeEndangeredStatus', ['animal']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { removeEndangeredStatus } = explorer.allFunctions; +assert.equal(removeEndangeredStatus?.parameters.length, 1); +assert.equal(removeEndangeredStatus?.parameters[0].toString(), 'animal'); ``` La función `removeEndangeredStatus` debe devolver el objeto `animal` actualizado. diff --git a/curriculum/challenges/espanol/blocks/workshop-wildlife-tracker/6999b07c34c2cde21ee6e1d8.md b/curriculum/challenges/espanol/blocks/workshop-wildlife-tracker/6999b07c34c2cde21ee6e1d8.md index c9f99d88de1..f53f763f21d 100644 --- a/curriculum/challenges/espanol/blocks/workshop-wildlife-tracker/6999b07c34c2cde21ee6e1d8.md +++ b/curriculum/challenges/espanol/blocks/workshop-wildlife-tracker/6999b07c34c2cde21ee6e1d8.md @@ -49,8 +49,10 @@ assert.isFunction(hasHabitat); La función `hasHabitat` debe tener un solo parámetro, `animal`. ```js -const regex = __helpers.functionRegex('hasHabitat', ['animal']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { hasHabitat } = explorer.allFunctions; +assert.equal(hasHabitat?.parameters.length, 1); +assert.equal(hasHabitat?.parameters[0].toString(), 'animal'); ``` `hasHabitat` debe usar el método `hasOwnProperty` para verificar la propiedad `habitat`. diff --git a/curriculum/challenges/espanol/blocks/workshop-wildlife-tracker/6999b0d79ea938edcb032237.md b/curriculum/challenges/espanol/blocks/workshop-wildlife-tracker/6999b0d79ea938edcb032237.md index 7405a4c0aae..587fc12affe 100644 --- a/curriculum/challenges/espanol/blocks/workshop-wildlife-tracker/6999b0d79ea938edcb032237.md +++ b/curriculum/challenges/espanol/blocks/workshop-wildlife-tracker/6999b0d79ea938edcb032237.md @@ -45,8 +45,11 @@ assert.isFunction(getProperty); La función `getProperty` debe tener dos parámetros: `animal` y `propertyName`. ```js -const regex = __helpers.functionRegex('getProperty', ['animal', 'propertyName']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { getProperty } = explorer.allFunctions; +assert.equal(getProperty?.parameters.length, 2); +assert.equal(getProperty?.parameters[0].toString(), 'animal'); +assert.equal(getProperty?.parameters[1].toString(), 'propertyName'); ``` `getProperty` debe usar la notación de corchetes para acceder a la propiedad. diff --git a/curriculum/challenges/espanol/blocks/workshop-wildlife-tracker/699a00de9f564bb0effaa14d.md b/curriculum/challenges/espanol/blocks/workshop-wildlife-tracker/699a00de9f564bb0effaa14d.md index 7205cfc4347..0b892fa85d3 100644 --- a/curriculum/challenges/espanol/blocks/workshop-wildlife-tracker/699a00de9f564bb0effaa14d.md +++ b/curriculum/challenges/espanol/blocks/workshop-wildlife-tracker/699a00de9f564bb0effaa14d.md @@ -44,8 +44,10 @@ assert.isFunction(getAge); La función `getAge` debe tener un solo parámetro, `animal`. ```js -const regex = __helpers.functionRegex('getAge', ['animal']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { getAge } = explorer.allFunctions; +assert.equal(getAge?.parameters.length, 1); +assert.equal(getAge?.parameters[0].toString(), 'animal'); ``` `getAge` debe acceder a la propiedad `age` usando la notación de punto. diff --git a/curriculum/challenges/german/blocks/back-end-development-and-apis-projects/bd7158d8c443edefaeb5bd0f.md b/curriculum/challenges/german/blocks/back-end-development-and-apis-projects/bd7158d8c443edefaeb5bd0f.md index 67d078c2172..c85b21df0db 100644 --- a/curriculum/challenges/german/blocks/back-end-development-and-apis-projects/bd7158d8c443edefaeb5bd0f.md +++ b/curriculum/challenges/german/blocks/back-end-development-and-apis-projects/bd7158d8c443edefaeb5bd0f.md @@ -50,15 +50,18 @@ Das Eingabefeld für die Datei im Formular hat das `name`-Attribut auf `upfile` Wenn Sie eine Datei absenden, erhalten Sie die Datei-`name`, `type` und `size` in Bytes innerhalb der JSON-Antwort. ```js - const formData = new FormData(); - const fileData = await fetch( - 'https://cdn.freecodecamp.org/weather-icons/01d.png' - ); - const file = await fileData.blob(); - formData.append('upfile', file, 'icon'); + const boundary = 'fccBoundary1234567890'; + const head = + `--${boundary}\r\n` + + 'Content-Disposition: form-data; name="upfile"; filename="icon"\r\n' + + 'Content-Type: image/png\r\n\r\n'; + const body = new Blob([head, new Uint8Array(70), `\r\n--${boundary}--\r\n`]); const data = await fetch(code + '/api/fileanalyse', { method: 'POST', - body: formData + headers: { + 'Content-Type': `multipart/form-data; boundary=${boundary}` + }, + body }); const parsed = await data.json(); assert.property(parsed, 'size'); diff --git a/curriculum/challenges/german/blocks/daily-coding-challenges-javascript/6a26df3e2988bcdded204895.md b/curriculum/challenges/german/blocks/daily-coding-challenges-javascript/6a26df3e2988bcdded204895.md index 5ee967e9952..b685751c4bc 100644 --- a/curriculum/challenges/german/blocks/daily-coding-challenges-javascript/6a26df3e2988bcdded204895.md +++ b/curriculum/challenges/german/blocks/daily-coding-challenges-javascript/6a26df3e2988bcdded204895.md @@ -25,10 +25,10 @@ assert.equal(calculateHandicap([72, 72, 72], [72, 72, 72]), 0); assert.equal(calculateHandicap([80, 76, 78, 78], [72, 72, 72, 72]), 6); ``` -`calculateHandicap([42, 45, 46, 44], [36, 36, 36, 36])` sollte `8.3` zurückgeben. +`calculateHandicap([42, 45, 46, 45], [36, 36, 36, 36])` sollte `8.5` zurückgeben. ```js -assert.equal(calculateHandicap([42, 45, 46, 44], [36, 36, 36, 36]), 8.3); +assert.equal(calculateHandicap([42, 45, 46, 45], [36, 36, 36, 36]), 8.5); ``` `calculateHandicap([85, 80, 76, 79, 82], [72, 72, 72, 71, 71])` sollte `8.8` zurückgeben. diff --git a/curriculum/challenges/german/blocks/daily-coding-challenges-python/6a26df3e2988bcdded204895.md b/curriculum/challenges/german/blocks/daily-coding-challenges-python/6a26df3e2988bcdded204895.md index 080c9638cf7..e3411dd15e8 100644 --- a/curriculum/challenges/german/blocks/daily-coding-challenges-python/6a26df3e2988bcdded204895.md +++ b/curriculum/challenges/german/blocks/daily-coding-challenges-python/6a26df3e2988bcdded204895.md @@ -31,12 +31,12 @@ TestCase().assertEqual(calculate_handicap([80, 76, 78, 78], [72, 72, 72, 72]), 6 }}) ``` -`calculate_handicap([42, 45, 46, 44], [36, 36, 36, 36])` sollte `8.3` zurückgeben. +`calculate_handicap([42, 45, 46, 45], [36, 36, 36, 36])` sollte `8.5` zurückgeben. ```js ({test: () => { runPython(` from unittest import TestCase -TestCase().assertEqual(calculate_handicap([42, 45, 46, 44], [36, 36, 36, 36]), 8.3)`) +TestCase().assertEqual(calculate_handicap([42, 45, 46, 45], [36, 36, 36, 36]), 8.5)`) }}) ``` diff --git a/curriculum/challenges/german/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb928.md b/curriculum/challenges/german/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb928.md index 16e65548d77..29c74009b62 100644 --- a/curriculum/challenges/german/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb928.md +++ b/curriculum/challenges/german/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb928.md @@ -8,9 +8,9 @@ dashedName: mean-variance-standard-deviation-calculator # --description-- -Sie werden an diesem Projekt mit unserem Ona-Starter-Code arbeiten. +Sie werden an diesem Projekt mit unserem Starter-Code arbeiten. -Wir entwickeln noch den interaktiven Unterrichtsteil des Python-Lehrplans. Für den Moment finden Sie hier einige Videos auf dem freeCodeCamp.org YouTube-Kanal, die Ihnen alles beibringen, was Sie brauchen, um dieses Projekt abzuschließen: +Wir entwickeln noch den interaktiven Lehrteil des Python-Lehrplans. Für den Moment finden Sie hier einige Videos auf dem freeCodeCamp.org YouTube-Kanal, die Ihnen alles beibringen, was Sie brauchen, um dieses Projekt abzuschließen: - Python for Everybody Video Course (14 Stunden) @@ -52,15 +52,16 @@ Zum Beispiel sollte `calculate([0,1,2,3,4,5,6,7,8])` Folgendes zurückgeben: ## Entwicklung -Schreiben Sie Ihren Code in `mean_var_std.py`. Für die Entwicklung können Sie `main.py` verwenden, um Ihren Code zu testen. Um Ihren Code auszuführen, geben Sie `python3 main.py` in das Ona-Terminal ein und drücken Sie Enter. Dadurch wird der enthaltene CPython-Interpreter die `main.py`-Datei ausführen. +Schreiben Sie Ihren Code in `mean_var_std.py`. Für die Entwicklung können Sie `main.py` verwenden, um Ihren Code zu testen. +Um Ihren Code auszuführen, geben Sie `python3 main.py` im Terminal ein und drücken Sie Enter. Dadurch wird der enthaltene CPython-Interpreter gestartet, der die Datei `main.py` ausführt. ## Testen -Die Unit-Tests für dieses Projekt befinden sich in `test_module.py`. Wir haben die Tests von `test_module.py` nach `main.py` für Ihren Komfort importiert. +Die Unit-Tests für dieses Projekt befinden sich in `test_module.py`. Wir haben die Tests von `test_module.py` nach `main.py` zu Ihrem Komfort importiert. ## Absenden -Kopieren Sie die URL Ihres Projekts und reichen Sie sie bei freeCodeCamp ein. +Kopieren Sie die URL Ihres Projekts und senden Sie sie an freeCodeCamp. # --hints-- diff --git a/curriculum/challenges/german/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb929.md b/curriculum/challenges/german/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb929.md index 373ef949da0..7c9df69b05f 100644 --- a/curriculum/challenges/german/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb929.md +++ b/curriculum/challenges/german/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb929.md @@ -8,13 +8,13 @@ dashedName: demographic-data-analyzer # --description-- -Sie werden an diesem Projekt mit unserem Ona-Starter-Code arbeiten. +Sie werden an diesem Projekt mit unserem Boilerplate-Code arbeiten. -Wir entwickeln noch den interaktiven Unterrichtsteil des Python-Lehrplans. Für den Moment finden Sie hier einige Videos auf dem freeCodeCamp.org YouTube-Kanal, die Ihnen alles beibringen, was Sie wissen müssen, um dieses Projekt abzuschließen: +Wir entwickeln noch den interaktiven Lehrteil des Python-Lehrplans. Für den Moment finden Sie hier einige Videos auf dem freeCodeCamp.org YouTube-Kanal, die Ihnen alles beibringen, was Sie brauchen, um dieses Projekt abzuschließen: -- Python für alle Video-Kurs (14 Stunden) +- Python for Everybody Video Course (14 Stunden) -- Wie man Daten mit Python Pandas analysiert (10 Stunden) +- How to Analyze Data with Python Pandas (10 Stunden) # --instructions-- @@ -52,9 +52,9 @@ Schreiben Sie Ihren Code in `demographic_data_analyzer.py`. Für die Entwicklung Die Unit-Tests für dieses Projekt befinden sich in `test_module.py`. Wir haben die Tests von `test_module.py` nach `main.py` zu Ihrem Komfort importiert. -## Einreichen +## Absenden -Kopieren Sie die URL Ihres Projekts und reichen Sie sie bei freeCodeCamp ein. +Kopieren Sie die URL Ihres Projekts und senden Sie sie an freeCodeCamp. ## Datenquellen diff --git a/curriculum/challenges/german/blocks/data-analysis-with-python-projects/5e46f7f8ac417301a38fb92a.md b/curriculum/challenges/german/blocks/data-analysis-with-python-projects/5e46f7f8ac417301a38fb92a.md index 17e76c48584..b381fe999a7 100644 --- a/curriculum/challenges/german/blocks/data-analysis-with-python-projects/5e46f7f8ac417301a38fb92a.md +++ b/curriculum/challenges/german/blocks/data-analysis-with-python-projects/5e46f7f8ac417301a38fb92a.md @@ -8,13 +8,13 @@ dashedName: medical-data-visualizer # --description-- -Sie werden an diesem Projekt mit unserem Ona-Starter-Code arbeiten. +Sie werden an diesem Projekt mit unserem Starter-Code arbeiten. -Wir entwickeln noch den interaktiven Unterrichtsteil des Python-Lehrplans. Für den Moment finden Sie hier einige Videos auf dem freeCodeCamp.org YouTube-Kanal, die Ihnen alles beibringen, was Sie brauchen, um dieses Projekt abzuschließen: +Wir entwickeln noch den interaktiven Lehrteil des Python-Lehrplans. Für den Moment finden Sie hier einige Videos auf dem freeCodeCamp.org YouTube-Kanal, die Ihnen alles beibringen, was Sie brauchen, um dieses Projekt abzuschließen: -- Python für alle Video-Kurs (14 Stunden) +- Python for Everybody Video Course (14 Stunden) -- Wie man Daten mit Python Pandas analysiert (10 Stunden) +- How to Analyze Data with Python Pandas (10 Stunden) # --instructions-- @@ -76,11 +76,11 @@ Schreiben Sie Ihren Code in `medical_data_visualizer.py`. Für die Entwicklung k ## Testen -Die Unit-Tests für dieses Projekt befinden sich in `test_module.py`. Wir haben die Tests von `test_module.py` bis `main.py` zu Ihrem Komfort importiert. +Die Unit-Tests für dieses Projekt befinden sich in `test_module.py`. Wir haben die Tests von `test_module.py` nach `main.py` zu Ihrem Komfort importiert. -## Abgabe +## Absenden -Kopieren Sie die URL Ihres Projekts und reichen Sie sie bei freeCodeCamp ein. +Kopieren Sie die URL Ihres Projekts und senden Sie sie an freeCodeCamp. # --hints-- diff --git a/curriculum/challenges/german/blocks/data-analysis-with-python-projects/5e46f802ac417301a38fb92b.md b/curriculum/challenges/german/blocks/data-analysis-with-python-projects/5e46f802ac417301a38fb92b.md index 4bcbfb03fdd..2484796e73b 100644 --- a/curriculum/challenges/german/blocks/data-analysis-with-python-projects/5e46f802ac417301a38fb92b.md +++ b/curriculum/challenges/german/blocks/data-analysis-with-python-projects/5e46f802ac417301a38fb92b.md @@ -8,19 +8,19 @@ dashedName: page-view-time-series-visualizer # --description-- -Sie werden mit diesem Projekt anhand unseres Ona-Starter-Codes arbeiten. +Sie werden an diesem Projekt mit unserem Starter-Code arbeiten. -Wir entwickeln noch den interaktiven Lehrteil des Python-Lehrplans. Für den Moment finden Sie hier einige Videos auf dem freeCodeCamp.org YouTube-Kanal, die Ihnen alles beibringen, was Sie wissen müssen, um dieses Projekt abzuschließen: +Wir entwickeln noch den interaktiven Lehrteil des Python-Lehrplans. Für den Moment finden Sie hier einige Videos auf dem freeCodeCamp.org YouTube-Kanal, die Ihnen alles beibringen, was Sie brauchen, um dieses Projekt abzuschließen: -- Python for Everybody Videokurs (14 Stunden) +- Python for Everybody Video Course (14 Stunden) -- Wie man Daten mit Python Pandas analysiert (10 Stunden) +- How to Analyze Data with Python Pandas (10 Stunden) # --instructions-- Für dieses Projekt visualisieren Sie Zeitreihendaten mit einem Liniendiagramm, Balkendiagramm und Boxplots. Sie verwenden Pandas, Matplotlib und Seaborn, um einen Datensatz zu visualisieren, der die Anzahl der Seitenaufrufe pro Tag im freeCodeCamp.org-Forum vom 09.05.2016 bis 03.12.2019 enthält. Die Datenvisualisierungen helfen Ihnen, Muster bei den Besuchen zu verstehen und jährliches sowie monatliches Wachstum zu erkennen. -Verwenden Sie die Daten, um die folgenden Aufgaben zu erfüllen: +Nutzen Sie die Daten, um die folgenden Aufgaben zu erfüllen: - Verwenden Sie Pandas, um die Daten aus "fcc-forum-pageviews.csv" zu importieren. Setzen Sie den Index auf die `date`-Spalte. - Bereinigen Sie die Daten, indem Sie Tage herausfiltern, an denen die Seitenaufrufe in den obersten 2,5 % oder untersten 2,5 % des Datensatzes lagen. @@ -30,7 +30,7 @@ Verwenden Sie die Daten, um die folgenden Aufgaben zu erfüllen: Verwenden Sie für jedes Diagramm eine Kopie des Dataframes. -Der Boilerplate-Code enthält außerdem Befehle zum Speichern und Zurückgeben des Bildes. +Der Boilerplate-Code enthält auch Befehle zum Speichern und Zurücksenden des Bildes. ## Entwicklung @@ -40,9 +40,9 @@ Schreiben Sie Ihren Code in `time_series_visualizer.py`. Für die Entwicklung k Die Unit-Tests für dieses Projekt befinden sich in `test_module.py`. Wir haben die Tests von `test_module.py` nach `main.py` zu Ihrem Komfort importiert. -## Abgabe +## Absenden -Kopieren Sie die URL Ihres Projekts und reichen Sie sie bei freeCodeCamp ein. +Kopieren Sie die URL Ihres Projekts und senden Sie sie an freeCodeCamp. # --hints-- diff --git a/curriculum/challenges/german/blocks/data-analysis-with-python-projects/5e4f5c4b570f7e3a4949899f.md b/curriculum/challenges/german/blocks/data-analysis-with-python-projects/5e4f5c4b570f7e3a4949899f.md index 9b5d488bfb7..e8793ef2ea5 100644 --- a/curriculum/challenges/german/blocks/data-analysis-with-python-projects/5e4f5c4b570f7e3a4949899f.md +++ b/curriculum/challenges/german/blocks/data-analysis-with-python-projects/5e4f5c4b570f7e3a4949899f.md @@ -8,9 +8,9 @@ dashedName: sea-level-predictor # --description-- -Sie werden an diesem Projekt mit unserem Ona-Boilerplate-Code arbeiten. +Sie werden an diesem Projekt mit unserem Starter-Code arbeiten. -Wir entwickeln noch den interaktiven Unterrichtsteil des Python-Curriculums. Für den Moment finden Sie hier einige Videos auf dem freeCodeCamp.org YouTube-Kanal, die Ihnen alles beibringen, was Sie brauchen, um dieses Projekt abzuschließen: +Wir entwickeln noch den interaktiven Lehrteil des Python-Lehrplans. Für den Moment finden Sie hier einige Videos auf dem freeCodeCamp.org YouTube-Kanal, die Ihnen alles beibringen, was Sie brauchen, um dieses Projekt abzuschließen: - Python for Everybody Video Course (14 Stunden) @@ -36,11 +36,11 @@ Schreiben Sie Ihren Code in `sea_level_predictor.py`. Für die Entwicklung könn ## Testen -Die Unit-Tests für dieses Projekt befinden sich in `test_module.py`. Wir haben die Tests aus `test_module.py` in `main.py` für Ihren Komfort importiert. +Die Unit-Tests für dieses Projekt befinden sich in `test_module.py`. Wir haben die Tests von `test_module.py` nach `main.py` zu Ihrem Komfort importiert. -## Abgabe +## Absenden -Kopieren Sie die URL Ihres Projekts und reichen Sie sie bei freeCodeCamp ein. +Kopieren Sie die URL Ihres Projekts und senden Sie sie an freeCodeCamp. ## Datenquelle Globale durchschnittliche absolute Meeresspiegeländerung, 1880-2014 von der US Environmental Protection Agency mit Daten von CSIRO, 2015; NOAA, 2015. diff --git a/curriculum/challenges/german/blocks/information-security-projects/5e46f979ac417301a38fb932.md b/curriculum/challenges/german/blocks/information-security-projects/5e46f979ac417301a38fb932.md index 696a6b89a89..42a1909109d 100644 --- a/curriculum/challenges/german/blocks/information-security-projects/5e46f979ac417301a38fb932.md +++ b/curriculum/challenges/german/blocks/information-security-projects/5e46f979ac417301a38fb932.md @@ -9,15 +9,15 @@ dashedName: port-scanner # --description-- -Sie werden mit diesem Projekt anhand unseres Ona-Starter-Codes arbeiten. +Sie werden an diesem Projekt mit unserem Starter-Code arbeiten. Wir entwickeln noch den interaktiven Lehrteil des Python-Lehrplans. Für den Moment finden Sie hier einige Videos auf dem freeCodeCamp.org YouTube-Kanal, die Ihnen alles beibringen, was Sie brauchen, um dieses Projekt abzuschließen: -- Python for Everybody Video-Kurs (14 Stunden) +- Python for Everybody Video Course (14 Stunden) -- Lernen Sie Python-Grundlagen ausführlich (4 Stunden) +- Learn Python Basics in Depth (4 Stunden) -- Fortgeschrittener Python-Kurs (6 Stunden) +- Intermediate Python Course (6 Stunden) # --instructions-- @@ -74,11 +74,11 @@ Schreiben Sie Ihren Code in `port_scanner.py`. Für die Entwicklung können Sie ## Testen -Die Unit-Tests für dieses Projekt befinden sich in `test_module.py`. Wir haben die Tests von `test_module.py` zu `main.py` importiert, um Ihnen den Komfort zu bieten. +Die Unit-Tests für dieses Projekt befinden sich in `test_module.py`. Wir haben die Tests von `test_module.py` nach `main.py` zu Ihrem Komfort importiert. -## Einreichen +## Absenden -Kopieren Sie die URL Ihres Projekts und reichen Sie sie bei freeCodeCamp ein. +Kopieren Sie die URL Ihres Projekts und senden Sie sie an freeCodeCamp. # --hints-- diff --git a/curriculum/challenges/german/blocks/information-security-projects/5e46f983ac417301a38fb933.md b/curriculum/challenges/german/blocks/information-security-projects/5e46f983ac417301a38fb933.md index 120717c3f2a..4d8060f1f84 100644 --- a/curriculum/challenges/german/blocks/information-security-projects/5e46f983ac417301a38fb933.md +++ b/curriculum/challenges/german/blocks/information-security-projects/5e46f983ac417301a38fb933.md @@ -9,7 +9,7 @@ dashedName: sha-1-password-cracker # --description-- -Sie werden an diesem Projekt mit unserem Ona-Starter-Code arbeiten. +Sie werden an diesem Projekt mit unserem Starter-Code arbeiten. Wir entwickeln noch den interaktiven Lehrteil des Python-Lehrplans. Für den Moment finden Sie hier einige Videos auf dem freeCodeCamp.org YouTube-Kanal, die Ihnen alles beibringen, was Sie brauchen, um dieses Projekt abzuschließen: @@ -53,9 +53,9 @@ Schreiben Sie Ihren Code in `password_cracker.py`. Für die Entwicklung können Die Unit-Tests für dieses Projekt befinden sich in `test_module.py`. Wir haben die Tests von `test_module.py` nach `main.py` zu Ihrem Komfort importiert. -## Einreichen +## Absenden -Kopieren Sie die URL Ihres Projekts und reichen Sie sie bei freeCodeCamp ein. +Kopieren Sie die URL Ihres Projekts und senden Sie sie an freeCodeCamp. # --hints-- diff --git a/curriculum/challenges/german/blocks/lab-availability-table/66b36358ed4f261d64840c24.md b/curriculum/challenges/german/blocks/lab-availability-table/66b36358ed4f261d64840c24.md index 9f37959db7a..5b5f4cb41dc 100644 --- a/curriculum/challenges/german/blocks/lab-availability-table/66b36358ed4f261d64840c24.md +++ b/curriculum/challenges/german/blocks/lab-availability-table/66b36358ed4f261d64840c24.md @@ -13,17 +13,17 @@ demoType: onClick **User Stories:** 1. Sie sollten eine Tabelle mit mindestens drei Spalten und fünf Zeilen haben, einschließlich Kopfzeilen. -1. Zellen in der ersten Zeile sollten Tabellenkopfzeilen sein, die die Wochentage enthalten. -1. Zellen in der ersten Spalte sollten Tabellenkopfzeilen mit der `class` `time` sein und Zeitwerte als Text enthalten. -1. Alle Datenzellen sollten die `class` `available-#` haben, wobei `#` eine Zahl von `0` bis `5` ist, die die Anzahl der zu dieser Zeit verfügbaren Personen angibt. +1. Die erste Zeile sollte Kopfzeilenzellen enthalten, die die Wochentage anzeigen. +1. Die erste Spalte sollte Kopfzeilenzellen mit der `class` `time` enthalten, die Zeitwerte als Text haben. +1. Alle Datenzellen sollten die `class` `available-#` haben, wobei `#` eine Zahl von `0` bis `5` ist, die die Anzahl der verfügbaren Personen zu dieser Zeit angibt. 1. Ihre Tabelle sollte ein `caption`-Element mit dem Text `Weekly Meeting Availability Schedule` haben. -1. Alle Tabellenkopfzellen in der ersten Zeile (die Wochentage) sollten ein `scope`-Attribut mit dem Wert `col` haben. -1. Alle Tabellenkopfzellen in der ersten Spalte (die Zeit-Zellen) sollten ein `scope`-Attribut mit dem Wert `row` haben. +1. Alle Kopfzeilenzellen in der ersten Zeile (die Wochentage) sollten ein `scope`-Attribut mit dem Wert `col` haben. +1. Alle Kopfzeilenzellen in der ersten Spalte (die Zeit-Zellen) sollten ein `scope`-Attribut mit dem Wert `row` haben. 1. Alle Datenzellen mit einer Verfügbarkeitsklasse sollten ein `aria-label`-Attribut haben, das den Verfügbarkeitsgrad beschreibt (z. B. `0 available` für die `available-0`-Zellen, `1 available` für die `available-1`-Zellen usw. und `5+ available` für die `available-5`-Zellen). 1. In Ihrem `:root`-Selektor sollten Sie sechs CSS-Variablen namens `--color#` definieren, wobei `#` eine Zahl von `0` bis `5` ist, und ihnen jeweils einen Farbwert zuweisen. Verwenden Sie diese Variablen, um die Hintergrundfarbe der entsprechenden `.available-#`-Elemente festzulegen. 1. In Ihrem `:root`-Selektor sollten Sie CSS-Variablen namens `--solid-border` und `--dashed-border` definieren. Verwenden Sie diese Variablen, um die unteren Rahmen Ihrer Datenzellen zu gestalten, wobei Sie je nach Zeile zwischen durchgezogenen und gestrichelten Rahmen wechseln. Geben Sie den Zeilen entweder die Klasse `sharp` oder `half`, um sie zu stylen. 1. Sie sollten ein `div`-Element mit der `id` `legend` haben. Es sollte ein `span`-Element mit dem Text `Availability` und ein `div`-Element mit der `id` `legend-gradient` enthalten. -1. Sie sollten dem `#legend-gradient`-Element einen linearen Farbverlauf geben, der mit harten Linien zwischen allen Farben von `--color0` bis `--color5` übergeht. +1. Sie sollten dem Element `#legend-gradient` einen linearen Farbverlauf geben, der zwischen allen Farben von `--color0` bis `--color5` mit harten Übergängen wechselt. **Hinweis:** Vergewissern Sie sich, dass Sie Ihr Stylesheet in Ihrem HTML verlinken, um Ihr CSS anzuwenden. @@ -389,7 +389,7 @@ headers.forEach(header => { Alle Tabellenkopfzellen in der ersten Spalte sollten ein `scope`-Attribut mit dem Wert `row` haben. ```js -const timeHeaders = [...document.querySelectorAll('tr > th:first-child')]; +const timeHeaders = [...document.querySelectorAll('th.time')]; assert.isNotEmpty(timeHeaders); timeHeaders.forEach(header => { assert.equal(header.getAttribute('scope'), 'row'); diff --git a/curriculum/challenges/german/blocks/lab-cargo-manifest-validator/69a56b5069ca99f7317e6e19.md b/curriculum/challenges/german/blocks/lab-cargo-manifest-validator/69a56b5069ca99f7317e6e19.md index 4bea0c8e0dc..4154491bf42 100644 --- a/curriculum/challenges/german/blocks/lab-cargo-manifest-validator/69a56b5069ca99f7317e6e19.md +++ b/curriculum/challenges/german/blocks/lab-cargo-manifest-validator/69a56b5069ca99f7317e6e19.md @@ -11,10 +11,10 @@ In diesem Labor verwenden Sie JavaScript, um Frachtmanifeste zu normalisieren un Jedes Frachtmanifest wird als Objekt mit den folgenden Eigenschaften dargestellt: -- `containerId`: eine positive ganze Zahl, die den zugehörigen Frachtcontainer identifiziert. -- `destination`: ein nicht leerer String (nach Entfernen von Leerzeichen), der das Ziel der Fracht angibt. -- `weight`: eine positive Zahl, die das Gewicht der Fracht darstellt. -- `unit`: ein String, der die Einheit für die Gewichtseigenschaft der Fracht beschreibt (entweder `"kg"` für Kilogramm oder `"lb"` für Pfund). +- `containerId`: eine positive ganze Zahl, die den zugehörigen Container identifiziert. +- `destination`: ein nicht leerer String (nach Entfernen von Leerzeichen), der das Ziel des Transports angibt. +- `weight`: eine positive Zahl, die das Gewicht der Ladung angibt. +- `unit`: ein String, der die Einheit der `weight`-Eigenschaft der Ladung beschreibt (entweder `"kg"` für Kilogramm oder `"lb"` für Pfund). - `hazmat`: ein Boolean-Wert, der angibt, ob eine Handhabung von Gefahrgut erforderlich ist. Beispiel für ein Frachtmanifest-Objekt: @@ -34,13 +34,13 @@ Beispiel für ein Frachtmanifest-Objekt: **User Stories:** 1. Sie sollten eine Funktion namens `normalizeUnits` mit einem `manifest`-Parameter implementieren. - - Die Funktion darf das ursprüngliche Manifestobjekt nicht verändern und muss immer ein neues Objekt zurückgeben, bei dem `weight` auf Kilogramm normalisiert ist und `unit` auf `"kg"` gesetzt wird. - - Wenn das Gewicht des Manifestobjekts in Pfund (`unit: "lb"`) angegeben ist, sollte die Funktion das `weight` mit der ungefähren Umrechnung 1 lb = 0,45 kg in Kilogramm umrechnen und die `unit` entsprechend aktualisieren. - - Wenn das Gewicht bereits in Kilogramm (`unit: "kg"`) angegeben ist, sollten `weight` und `unit` unverändert bleiben. + - Die Funktion darf das ursprüngliche Manifestobjekt nicht verändern und muss immer ein neues Objekt zurückgeben, bei dem das `weight` auf Kilogramm normalisiert ist und `unit` auf `"kg"` gesetzt ist. + - Wenn das `weight` des Manifestobjekts in Pfund angegeben ist (`unit: "lb"`), soll die Funktion das `weight` mit der ungefähren Umrechnung `1 lb = 0.45 kg` in Kilogramm umrechnen und die `unit` entsprechend aktualisieren. + - Wenn das `weight` bereits in Kilogramm angegeben ist (`unit: "kg"`), sollen `weight` und `unit` unverändert bleiben. 2. Sie sollten eine Funktion namens `validateManifest` mit einem `manifest`-Parameter implementieren. - Die Funktion darf das ursprüngliche Manifestobjekt nicht verändern und muss immer ein neues Objekt zurückgeben. - - Wenn das Eingabe-Manifest gültig ist (keine fehlenden oder ungültigen Eigenschaften), sollte die Funktion ein leeres Objekt zurückgeben. - - Wenn das Eingabe-Manifest nicht gültig ist, sollte die Funktion ein Objekt zurückgeben, das Einträge für jede fehlende oder ungültige Eigenschaft enthält. Fehlende Eigenschaften sollten den Wert `"Missing"` haben und ungültige Eigenschaften den Wert `"Invalid"`. + - Wenn das Eingabe-Manifest gültig ist (keine fehlenden oder ungültigen Eigenschaften), soll die Funktion ein leeres Objekt zurückgeben. + - Wenn das Eingabe-Manifest nicht gültig ist, soll die Funktion ein Objekt zurückgeben, das Einträge für jede fehlende oder ungültige Eigenschaft enthält. Fehlende Eigenschaften sollen den Wert `"Missing"` haben, ungültige Eigenschaften den Wert `"Invalid"`. Beispiel für einen Rückgabewert, bei dem das Eingabeobjekt die Eigenschaft `destination` vermisst und eine ungültige `weight` Eigenschaft hat: @@ -51,12 +51,13 @@ Beispiel für einen Rückgabewert, bei dem das Eingabeobjekt die Eigenschaft `de } ``` -3. Sie sollten eine Funktion namens `processManifest` mit einem `manifest`-Parameter implementieren. Die Funktion sollte Folgendes ausgeben: - - Wenn das Manifestobjekt gültig ist, `Validation success: ${containerId}` und dann das Gewicht des Manifests in Kilogramm, so: `Total weight: ${weight} kg`. Verwenden Sie `normalizeUnits()` für diese Umrechnung. - - Wenn das Manifestobjekt nicht gültig ist, `Validation error: ${containerId}` und dann das Objekt, das durch den Aufruf von `validateManifest()` mit dem Manifestobjekt zurückgegeben wird. - **Hinweis:** Jeder dieser beiden Fälle sollte zwei `console.log()`-Aufrufe enthalten. +3. Sie sollten eine Funktion namens `processManifest` mit einem Parameter `manifest` implementieren. Die Funktion soll Folgendes ausgeben: + - Wenn das Manifest-Objekt gültig ist, `Validation success: ${containerId}` und anschließend das `weight` des Manifests in Kilogramm in der Form `Total weight: ${weight} kg`. Verwenden Sie dafür `normalizeUnits()`. + - Wenn das Manifest-Objekt nicht gültig ist, `Validation error: ${containerId}` und anschließend das Objekt, das durch Aufruf von `validateManifest()` mit dem Manifest-Objekt zurückgegeben wird. -**Hinweis:** Weder `normalizeUnits`, noch `validateManifest` oder `processManifest` sollten mit `const` deklariert werden, da die Tests eine Neuzuweisung benötigen. +**Hinweis:** In beiden Fällen sollen jeweils zwei `console.log()`-Aufrufe erfolgen. + +**Hinweis:** Deklarieren Sie `normalizeUnits`, `validateManifest` oder `processManifest` nicht mit `const`, da die Tests eine Neuzuweisung benötigen. # --before-each-- @@ -120,7 +121,7 @@ console.log = () => {}; # --hints-- -Weder `normalizeUnits`, noch `validateManifest` oder `processManifest` sollten mit `const` deklariert werden, da die Tests eine Neuzuweisung benötigen. +Sie sollten `normalizeUnits`, `validateManifest` oder `processManifest` nicht mit `const` deklarieren, da die Tests eine Neuzuweisung benötigen. ```js assert.doesNotThrow(() => { @@ -140,12 +141,12 @@ assert.equal(params.length, 1); assert.equal(params[0].toString(), 'manifest'); ``` -Der Aufruf von `normalizeUnits()` mit `{ containerId: 68, destination: "Salinas", weight: 101, unit: "lb", hazmat: true }` sollte das neue Objekt `{ containerId: 68, destination: "Salinas", weight: 45.45, unit: "kg", hazmat: true }` zurückgeben, ohne die ursprüngliche Eingabe zu verändern. +Ihre Funktion `normalizeUnits` sollte das neue Objekt `{ containerId: 68, destination: "Salinas", weight: 45.45, unit: "kg", hazmat: true }` zurückgeben, wenn sie mit `{ containerId: 68, destination: "Salinas", weight: 101, unit: "lb", hazmat: true }` aufgerufen wird, ohne das Original zu verändern. ```js const testObj = { containerId: 68, - destination: "Salinas", + destination: "Salinas", weight: 101, unit: "lb", hazmat: true @@ -161,7 +162,7 @@ const expected = { const copy = normalizeUnits(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "normalizeUnits() did not return the expected normalized object"); +assert.deepEqual(copy, expected, "normalizeUnits() did not return the expected normalized object."); assert.notStrictEqual(copy, testObj, "normalizeUnits() should return a new object."); assert.strictEqual(testObj.containerId, 68, "Original object should not be mutated."); assert.strictEqual(testObj.destination, "Salinas", "Original object should not be mutated."); @@ -171,13 +172,13 @@ assert.strictEqual(testObj.hazmat, true, "Original object should not be mutated. assert.equal(Object.keys(testObj).length, 5, "Original object should not be mutated."); ``` -Ihre `normalizeUnits`-Funktion sollte eine Kopie des Eingabe-Manifestobjekts zurückgeben, bei der `weight` auf Kilogramm normalisiert und `unit` auf `"kg"` gesetzt ist. Verwenden Sie die ungefähre Umrechnung `1 lb = 0.45 kg` für die Gewichtsumrechnung. +Ihre Funktion `normalizeUnits` sollte eine Kopie des Eingabe-Manifests zurückgeben, bei der das `weight` auf Kilogramm normalisiert und die `unit` auf `"kg"` gesetzt ist. Verwenden Sie für die Umrechnung des `weight` die ungefähre Umrechnung `1 lb = 0.45 kg`. ```js _validManifests.forEach((obj, i) => { const result = normalizeUnits(obj); - assert.isObject(result, "normalizeUnits should return an object"); - assert.notStrictEqual(result, obj, "normalizeUnits must return a new object, not modify the original"); + assert.isObject(result, "normalizeUnits() should return an object."); + assert.notStrictEqual(result, obj, "normalizeUnits() should return a new object, not mutate the original."); const expectedWeight = obj.unit === "lb" ? obj.weight * 0.45 : obj.weight; const expected = { ...obj, @@ -188,12 +189,12 @@ _validManifests.forEach((obj, i) => { assert.deepEqual( result, expected, - `normalizeUnits did not return the expected normalized object for manifest at index ${i}` + `normalizeUnits() did not return the expected normalized object for manifest at index ${i}.` ); }); ``` -Ihre `normalizeUnits`-Funktion sollte eine neue Kopie des Eingabe-`manifest`-Objekts zurückgeben, ohne das Original zu verändern. +Ihre Funktion `normalizeUnits` sollte eine neue Kopie des Eingabe-Manifest-Objekts zurückgeben, ohne das Original zu verändern. ```js const original = { @@ -231,12 +232,12 @@ assert.equal(params.length, 1); assert.equal(params[0].toString(), 'manifest'); ``` -Der Aufruf von `validateManifest()` mit `{ containerId: 1, destination: "Santa Cruz", weight: 304, unit: "kg", hazmat: false }` sollte das neue Objekt `{}` zurückgeben. +Ihre Funktion `validateManifest` sollte ein neues, leeres Objekt `{}` zurückgeben, wenn sie mit `{ containerId: 1, destination: "Santa Cruz", weight: 304, unit: "kg", hazmat: false }` aufgerufen wird. ```js const testObj = { containerId: 1, - destination: "Santa Cruz", + destination: "Santa Cruz", weight: 304, unit: "kg", hazmat: false @@ -246,16 +247,16 @@ const expected = {}; const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for a valid manifest"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.strictEqual(testObj.containerId, 1, "Original object should not be mutated"); -assert.strictEqual(testObj.destination, "Santa Cruz", "Original object should not be mutated"); -assert.strictEqual(testObj.weight, 304, "Original object should not be mutated"); -assert.strictEqual(testObj.unit, "kg", "Original object should not be mutated"); -assert.strictEqual(testObj.hazmat, false, "Original object should not be mutated"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for a valid manifest."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.strictEqual(testObj.containerId, 1, "Original object should not be mutated."); +assert.strictEqual(testObj.destination, "Santa Cruz", "Original object should not be mutated."); +assert.strictEqual(testObj.weight, 304, "Original object should not be mutated."); +assert.strictEqual(testObj.unit, "kg", "Original object should not be mutated."); +assert.strictEqual(testObj.hazmat, false, "Original object should not be mutated."); ``` -Wenn das Eingabe-Manifestobjekt gültig ist, sollte Ihre `validateManifest`-Funktion ein leeres Objekt `{}` zurückgeben. +Ihre Funktion `validateManifest` sollte ein leeres Objekt `{}` zurückgeben, wenn das Eingabe-Manifest-Objekt gültig ist. ```js const solution = {}; @@ -268,7 +269,7 @@ for (const obj of _validManifests) { } ``` -Der Aufruf von `validateManifest()` mit `{}` sollte das neue Objekt `{ containerId: "Missing", destination: "Missing", weight: "Missing", unit: "Missing", hazmat: "Missing" }` zurückgeben, ohne die ursprüngliche Eingabe zu verändern. +Ihre Funktion `validateManifest` sollte das neue Objekt `{ containerId: "Missing", destination: "Missing", weight: "Missing", unit: "Missing", hazmat: "Missing" }` zurückgeben, wenn sie mit `{}` aufgerufen wird, ohne das Original zu verändern. ```js const testObj = {}; @@ -283,12 +284,12 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for missing properties"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.equal(Object.keys(testObj).length, 0, "validateManifest() should return a new object, not mutate the original"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for missing properties."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.equal(Object.keys(testObj).length, 0, "validateManifest() should return a new object, not mutate the original."); ``` -Der Aufruf von `validateManifest()` mit `{ containerId: null, destination: "Santa Cruz", weight: 304, unit: "kg", hazmat: false }` sollte das neue Objekt `{ containerId: "Invalid" }` zurückgeben, ohne die ursprüngliche Eingabe zu verändern. +Ihre Funktion `validateManifest` sollte das neue Objekt `{ containerId: "Invalid" }` zurückgeben, wenn sie mit `{ containerId: null, destination: "Santa Cruz", weight: 304, unit: "kg", hazmat: false }` aufgerufen wird, ohne das Original zu verändern. ```js const testObj = { @@ -305,11 +306,11 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for null containerId"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for null containerId."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); ``` -Der Aufruf von `validateManifest()` mit `{ containerId: 0, destination: 405, weight: -84, unit: "pounds", hazmat: "no" }` sollte das neue Objekt `{ containerId: "Invalid", destination: "Invalid", weight: "Invalid", unit: "Invalid", hazmat: "Invalid" }` zurückgeben, ohne die ursprüngliche Eingabe zu verändern. +Ihre Funktion `validateManifest` sollte das neue Objekt `{ containerId: "Invalid", destination: "Invalid", weight: "Invalid", unit: "Invalid", hazmat: "Invalid" }` zurückgeben, wenn sie mit `{ containerId: 0, destination: 405, weight: -84, unit: "pounds", hazmat: "no" }` aufgerufen wird, ohne das Original zu verändern. ```js const testObj = { @@ -330,16 +331,16 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid properties"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.strictEqual(testObj.containerId, 0, "Original object should not be mutated"); -assert.strictEqual(testObj.destination, 405, "Original object should not be mutated"); -assert.strictEqual(testObj.weight, -84, "Original object should not be mutated"); -assert.strictEqual(testObj.unit, "pounds", "Original object should not be mutated"); -assert.strictEqual(testObj.hazmat, "no", "Original object should not be mutated"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid properties."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.strictEqual(testObj.containerId, 0, "Original object should not be mutated."); +assert.strictEqual(testObj.destination, 405, "Original object should not be mutated."); +assert.strictEqual(testObj.weight, -84, "Original object should not be mutated."); +assert.strictEqual(testObj.unit, "pounds", "Original object should not be mutated."); +assert.strictEqual(testObj.hazmat, "no", "Original object should not be mutated."); ``` -Der Aufruf von `validateManifest()` mit `{ containerId: -2 }` sollte das neue Objekt `{ containerId: "Invalid", destination: "Missing", weight: "Missing", unit: "Missing", hazmat: "Missing" }` zurückgeben, ohne die ursprüngliche Eingabe zu verändern. +Ihre Funktion `validateManifest` sollte das neue Objekt `{ containerId: "Invalid", destination: "Missing", weight: "Missing", unit: "Missing", hazmat: "Missing" }` zurückgeben, wenn sie mit `{ containerId: -2 }` aufgerufen wird, ohne das Original zu verändern. ```js const testObj = { @@ -356,13 +357,13 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.strictEqual(testObj.containerId, -2, "Original object should not be mutated"); -assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.strictEqual(testObj.containerId, -2, "Original object should not be mutated."); +assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated."); ``` -Der Aufruf von `validateManifest()` mit `{ containerId: 3.50 }` sollte das neue Objekt `{ containerId: "Invalid", destination: "Missing", weight: "Missing", unit: "Missing", hazmat: "Missing" }` zurückgeben, ohne die ursprüngliche Eingabe zu verändern. Sie können `Number.isInteger()` verwenden, um Ganzzahlen zu validieren. +Ihre Funktion `validateManifest` sollte das neue Objekt `{ containerId: "Invalid", destination: "Missing", weight: "Missing", unit: "Missing", hazmat: "Missing" }` zurückgeben, wenn sie mit `{ containerId: 3.50 }` aufgerufen wird, ohne das Original zu verändern. Sie können `Number.isInteger()` verwenden, um ganze Zahlen zu validieren. ```js const testObj = { @@ -379,13 +380,13 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.strictEqual(testObj.containerId, 3.50, "Original object should not be mutated"); -assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.strictEqual(testObj.containerId, 3.50, "Original object should not be mutated."); +assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated."); ``` -Der Aufruf von `validateManifest()` mit `{ destination: " " }` sollte das neue Objekt `{ containerId: "Missing", destination: "Invalid", weight: "Missing", unit: "Missing", hazmat: "Missing" }` zurückgeben, ohne die ursprüngliche Eingabe zu verändern. Sie können `String.trim()` verwenden, um Leerzeichen aus einem String zu entfernen. +Ihre Funktion `validateManifest` sollte das neue Objekt `{ containerId: "Missing", destination: "Invalid", weight: "Missing", unit: "Missing", hazmat: "Missing" }` zurückgeben, wenn sie mit `{ destination: " " }` aufgerufen wird, ohne das Original zu verändern. Sie können `.trim()` verwenden, um Leerzeichen aus einem String zu entfernen. ```js const testObj = { @@ -402,13 +403,13 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.strictEqual(testObj.destination, " ", "Original object should not be mutated"); -assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.strictEqual(testObj.destination, " ", "Original object should not be mutated."); +assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated."); ``` -Der Aufruf von `validateManifest()` mit `{ weight: NaN }` sollte das neue Objekt `{ containerId: "Missing", destination: "Missing", weight: "Invalid", unit: "Missing", hazmat: "Missing" }` zurückgeben, ohne die ursprüngliche Eingabe zu verändern. Sie können `Number.isNaN()` verwenden, um NaN-Werte zu validieren. +Ihre Funktion `validateManifest` sollte das neue Objekt `{ containerId: "Missing", destination: "Missing", weight: "Invalid", unit: "Missing", hazmat: "Missing" }` zurückgeben, wenn sie mit `{ weight: NaN }` aufgerufen wird, ohne das Original zu verändern. Sie können `Number.isNaN()` verwenden, um `NaN`-Werte zu validieren. ```js const testObj = { @@ -425,13 +426,13 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.ok(Number.isNaN(testObj.weight), "Original object should not be mutated"); -assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.ok(Number.isNaN(testObj.weight), "Original object should not be mutated."); +assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated."); ``` -Wenn das Eingabe-Manifestobjekt nicht gültig ist, sollte Ihre `validateManifest`-Funktion ein Objekt zurückgeben, das fehlende und/oder ungültige Eigenschaften beschreibt. +Ihre Funktion `validateManifest` sollte ein Objekt zurückgeben, das fehlende und/oder ungültige Eigenschaften beschreibt, wenn das Eingabe-Manifest-Objekt nicht gültig ist. ```js const solutions = [ @@ -504,7 +505,7 @@ assert.equal(params.length, 1); assert.equal(params[0].toString(), 'manifest'); ``` -Der Aufruf von `processManifest()` mit `{ containerId: 55, destination: "Carmel", weight: 400, unit: "lb", hazmat: false }` sollte zuerst `"Validation success: 55"` ausgeben und dann `"Total weight: 180 kg"`. +Ihre Funktion `processManifest` sollte zuerst `Validation success: 55` ausgeben und dann `Total weight: 180 kg`, wenn sie mit `{ containerId: 55, destination: "Carmel", weight: 400, unit: "lb", hazmat: false }` aufgerufen wird. ```js const testObj = { @@ -524,8 +525,8 @@ try { ["Validation success: 55"], ["Total weight: 180 kg"] ]; - assert.deepEqual(spy.calls[0], expectedCalls[0], "First log should be the validation success message"); - assert.deepEqual(spy.calls[1], expectedCalls[1], "Second log should be the normalized weight in kg"); + assert.deepEqual(spy.calls[0], expectedCalls[0], "First log should be the validation success message."); + assert.deepEqual(spy.calls[1], expectedCalls[1], "Second log should be the normalized weight in kg."); } catch (err) { assert.fail(err); @@ -534,7 +535,7 @@ try { } ``` -Wenn das Eingabe-Manifestobjekt gültig ist, sollte Ihre `processManifest`-Funktion zuerst die Erfolgsmeldung `Validation success: ${containerId}` ausgeben. +Ihre Funktion `processManifest` sollte zuerst die Erfolgsmeldung `Validation success: ${containerId}` ausgeben, wenn das Eingabe-Manifest-Objekt gültig ist. ```js const testObj = { @@ -562,7 +563,7 @@ try { } ``` -Wenn das Eingabe-Manifestobjekt gültig ist, sollte Ihre `processManifest`-Funktion es mit `normalizeUnits()` auf Kilogramm normalisieren und dann Folgendes ausgeben: `Total weight: ${weight} kg`. +Ihre Funktion `processManifest` sollte ein gültiges Eingabe-Manifest-Objekt mit `normalizeUnits()` auf Kilogramm normalisieren und dann `Total weight: ${weight} kg` ausgeben. ```js const testObj = { @@ -590,7 +591,7 @@ try { } ``` -Wenn das Eingabe-Manifestobjekt gültig ist, sollte Ihre `processManifest`-Funktion eine Erfolgsmeldung mit dem `containerId` des Objekts ausgeben und dann das `weight` des Objekts in Kilogramm ausgeben. Sie sollten `normalizeUnits()` für die Umrechnung verwenden und zwei `console.log()`-Aufrufe haben. +Ihre Funktion `processManifest` sollte eine Erfolgsmeldung mit der `containerId` des Objekts ausgeben und anschließend das `weight` des Objekts in Kilogramm ausgeben, wenn das Eingabe-Manifest-Objekt gültig ist. Verwenden Sie für die Umrechnung `normalizeUnits()`. Dies sollte zwei `console.log()`-Aufrufe umfassen. ```js const originalNormalize = normalizeUnits; @@ -605,7 +606,7 @@ try { assert.isTrue( called, - "processManifest should call normalizeUnits() when the manifest is valid" + "processManifest() should call normalizeUnits() when the manifest is valid." ); } catch (err) { @@ -635,7 +636,7 @@ try { } ``` -Der Aufruf von `processManifest()` mit `{ containerId: -88, destination: "Soledad", weight: NaN }` sollte zuerst `Validation error: -88` ausgeben und dann das Objekt `{ containerId: "Invalid", weight: "Invalid", unit: "Missing", hazmat: "Missing" }`. +Ihre Funktion `processManifest` sollte zuerst `Validation error: -88` ausgeben und dann das Objekt `{ containerId: "Invalid", weight: "Invalid", unit: "Missing", hazmat: "Missing" }`, wenn sie mit `{ containerId: -88, destination: "Soledad", weight: NaN }` aufgerufen wird. ```js const testObj = { @@ -658,8 +659,8 @@ try { }] ]; - assert.deepEqual(spy.calls[0], expectedCalls[0], "First log should be the validation error message"); - assert.deepEqual(spy.calls[1], expectedCalls[1], "Second log should be the validation result object"); + assert.deepEqual(spy.calls[0], expectedCalls[0], "First log should be the validation error message."); + assert.deepEqual(spy.calls[1], expectedCalls[1], "Second log should be the validation result object."); } catch (err) { assert.fail(err); @@ -668,7 +669,7 @@ try { } ``` -Der Aufruf von `processManifest()` mit `{ destination: "Watsonville", hazmat: true }` sollte zuerst `Validation error: undefined` ausgeben und dann das Objekt `{ containerId: "Missing", weight: "Missing", unit: "Missing" }`. +Ihre Funktion `processManifest` sollte zuerst `Validation error: undefined` ausgeben und dann das Objekt `{ containerId: "Missing", weight: "Missing", unit: "Missing" }`, wenn sie mit `{ destination: "Watsonville", hazmat: true }` aufgerufen wird. ```js const testObj = { @@ -689,8 +690,8 @@ try { }] ]; - assert.deepEqual(spy.calls[0], expectedCalls[0], "First log should be the validation error message"); - assert.deepEqual(spy.calls[1], expectedCalls[1], "Second log should be the validation result object"); + assert.deepEqual(spy.calls[0], expectedCalls[0], "First log should be the validation error message."); + assert.deepEqual(spy.calls[1], expectedCalls[1], "Second log should be the validation result object."); } catch (err) { assert.fail(err); @@ -699,7 +700,7 @@ try { } ``` -Wenn das Eingabe-Manifestobjekt nicht gültig ist, sollte Ihre `processManifest`-Funktion zuerst die Fehlermeldung `Validation error: ${containerId}` ausgeben. +Ihre Funktion `processManifest` sollte zuerst die Fehlermeldung `Validation error: ${containerId}` ausgeben, wenn das Eingabe-Manifest-Objekt nicht gültig ist. ```js const spy = __helpers.spyOn(console, "log"); @@ -718,13 +719,13 @@ try { assert.deepEqual(spy.calls[0], expectedCalls[0]); } catch (err) { - assert.fail(err); + assert.fail(err); } finally { spy.restore(); } ``` -Wenn das Eingabe-Manifestobjekt nicht gültig ist, sollte Ihre `processManifest`-Funktion auch das Objekt ausgeben, das durch den Aufruf von `validateManifest()` mit dem ursprünglichen Manifestobjekt zurückgegeben wird. Rufen Sie `console.log()` direkt mit dem zurückgegebenen Objekt auf. +Ihre Funktion `processManifest` sollte außerdem das Objekt ausgeben, das durch Aufruf von `validateManifest()` mit dem ursprünglichen Manifest-Objekt zurückgegeben wird, wenn das Eingabe-Manifest-Objekt nicht gültig ist. Rufen Sie `console.log()` direkt mit dem zurückgegebenen Objekt auf. ```js const originalValidate = validateManifest; @@ -740,7 +741,7 @@ try { assert.isTrue( called, - "processManifest should call validateManifest() when the manifest is invalid" + "processManifest() should call validateManifest() when the manifest is invalid." ); } catch (err) { @@ -765,13 +766,13 @@ try { assert.deepEqual(spy.calls[1], expectedCalls[1]); } catch (err) { - assert.fail(err); + assert.fail(err); } finally { spy.restore(); } ``` -Wenn das Eingabe-Manifestobjekt nicht gültig ist, sollte Ihre `processManifest`-Funktion eine Fehlermeldung mit dem `containerId` des Objekts ausgeben und dann das Objekt ausgeben, das durch den Aufruf von `validateManifest()` mit dem Eingabeobjekt zurückgegeben wird. Dies sollte zwei `console.log()`-Aufrufe beinhalten. +Ihre Funktion `processManifest` sollte eine Fehlermeldung mit der `containerId` des Objekts ausgeben und anschließend das Objekt ausgeben, das durch Aufruf von `validateManifest()` mit dem Eingabe-Objekt zurückgegeben wird, wenn das Eingabe-Manifest-Objekt nicht gültig ist. Dies sollte zwei `console.log()`-Aufrufe umfassen. ```js const originalValidate = validateManifest; @@ -787,7 +788,7 @@ try { assert.isTrue( called, - "processManifest should call validateManifest() when the manifest is invalid" + "processManifest() should call validateManifest() when the manifest is invalid." ); } catch (err) { @@ -812,7 +813,7 @@ try { assert.deepEqual(spy.calls, expectedCalls); } catch (err) { - assert.fail(err); + assert.fail(err); } finally { spy.restore(); } diff --git a/curriculum/challenges/german/blocks/lab-digital-pet-game/68c362b379059c388d3874f2.md b/curriculum/challenges/german/blocks/lab-digital-pet-game/68c362b379059c388d3874f2.md index 62060ca62a6..26ef89a75b0 100644 --- a/curriculum/challenges/german/blocks/lab-digital-pet-game/68c362b379059c388d3874f2.md +++ b/curriculum/challenges/german/blocks/lab-digital-pet-game/68c362b379059c388d3874f2.md @@ -9,7 +9,7 @@ saveSubmissionToDB: true # --description-- -**Ziel:** Erfüllen Sie die unten stehenden User Stories und bestehen Sie alle Tests, um das Labor abzuschließen. +**Ziel:** Erfüllen Sie die untenstehenden User Stories und bestehen Sie alle Tests, um das Labor abzuschließen. **User Stories:** @@ -60,6 +60,7 @@ Die zweite Ansicht: ```js globalThis._PET_NAME = 'Fitzgerald'; globalThis._clock = __FakeTimers.install(); +window.fetch = () => Promise.resolve({ json: () => Promise.resolve('Cats sleep for around 13 to 16 hours a day.') }); ``` # --after-all-- diff --git a/curriculum/challenges/german/blocks/lab-fcc-forum-leaderboard/673c91f0b934834bc4a3ecc2.md b/curriculum/challenges/german/blocks/lab-fcc-forum-leaderboard/673c91f0b934834bc4a3ecc2.md index a41fd0fe5ad..8284e188bdf 100644 --- a/curriculum/challenges/german/blocks/lab-fcc-forum-leaderboard/673c91f0b934834bc4a3ecc2.md +++ b/curriculum/challenges/german/blocks/lab-fcc-forum-leaderboard/673c91f0b934834bc4a3ecc2.md @@ -50,7 +50,7 @@ Der API-Endpunkt liefert JSON in folgender Form: Beachten Sie, dass `avatar_template`-Werte relative Pfade sind: Sie beginnen mit `/` und enthalten einen `{size}`-Platzhalter, der durch eine Pixelgröße ersetzt werden sollte. Die Konstante `avatarUrl` enthält die Basis-URL, die vorangestellt werden muss, wenn der Pfad relativ ist. -**Ziel:** Erfüllen Sie die untenstehenden User Stories und lassen Sie alle Tests erfolgreich durchlaufen, um das Labor abzuschließen. +**Ziel:** Erfüllen Sie die untenstehenden User Stories und bestehen Sie alle Tests, um das Labor abzuschließen. **User Stories:** @@ -93,6 +93,68 @@ Beachten Sie, dass `avatar_template`-Werte relative Pfade sind: Sie beginnen mit 1. Die Funktion `fetchData` sollte Daten von `forumLatest` anfordern und `showLatestPosts` mit der als JSON geparsten Antwort aufrufen. 1. Wenn beim Abrufen der Daten ein Fehler auftritt, sollte die Funktion `fetchData` den Fehler in der Konsole protokollieren. Verwenden Sie dafür speziell `console.log`. +# --before-all-- + +```js +const _testUsers = [ + { + avatar_template: '/user_avatar/QuincyLarson_{size}.png', + id: 6, + name: 'Quincy Larson', + username: 'QuincyLarson' + }, + { + avatar_template: '/user_avatar/jwilkins.oboe_{size}.png', + id: 285941, + name: 'Jessica Wilkins', + username: 'jwilkins.oboe' + }, + { + avatar_template: '/user_avatar/ilenia_{size}.png', + id: 170865, + name: 'Ilenia', + username: 'ilenia' + } +]; + +const _testPosters = [ + { user_id: 6 }, + { user_id: 285941 }, + { user_id: 170865 } +]; + +const _testData = { + users: _testUsers, + topic_list: { + topics: [ + { + bumped_at: '2024-04-15T16:01:26.403Z', + category_id: 1, + id: 684569, + posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], + posts_count: 8, + slug: 'the-freecodecamp-podcast-is-back-now-with-video', + title: 'The freeCodeCamp Podcast is back – now with video', + views: 542 + }, + { + bumped_at: '2024-04-19T13:52:03.523Z', + category_id: 421, + id: 686149, + posters: [{ user_id: 170865 }], + posts_count: 1, + slug: 'problem-with-making-changes-to-styles-js', + title: 'Problem with making changes to styles. (JS)', + views: 9 + } + ] + } +}; + +window.fetch = () => + Promise.resolve({ json: () => Promise.resolve(_testData) }); +``` + # --hints-- Sie sollten eine Funktion namens `timeAgo` haben, die ein einzelnes Argument annimmt. @@ -297,31 +359,8 @@ assert.lengthOf(avatars, 2); Die Funktion `avatars` sollte einen String zurückgeben, der durch das Verbinden von `img`-Elementen gebildet wird, eines für jeden Poster, der im Benutzerarray gefunden wurde. ```js -const posters = [{ user_id: 6 }, { user_id: 285941 }, { user_id: 170865 }]; -const users = [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - }, - { id: 20 } -]; +const posters = _testPosters; +const users = [..._testUsers, { id: 20 }]; const actual = avatars(posters, users); const matches = actual.match(/<\s*img\s+.+?>/g); assert.lengthOf(matches, 3); @@ -330,31 +369,8 @@ assert.lengthOf(matches, 3); Jedes `img`-Element im String, der von der Funktion `avatars` zurückgegeben wird, sollte einen `alt`-Text mit dem Wert der Eigenschaft `name` des Posters haben. ```js -const posters = [{ user_id: 6 }, { user_id: 285941 }, { user_id: 170865 }]; -const users = [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - }, - { id: 20 } -]; +const posters = _testPosters; +const users = [..._testUsers, { id: 20 }]; const actual = avatars(posters, users); const matches = actual.match(/<\s*img\s+.+?>/g); @@ -366,31 +382,8 @@ assert.match(matches[2], /alt=('|")Ilenia\1/); Die Funktion `avatars` sollte die Größe jedes Avatars festlegen, indem sie auf die Eigenschaft `avatar_template` zugreift und `{size}` durch `30` ersetzt. ```js -const posters = [{ user_id: 6 }, { user_id: 285941 }, { user_id: 170865 }]; -const users = [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - }, - { id: 20 } -]; +const posters = _testPosters; +const users = [..._testUsers, { id: 20 }]; const actual = avatars(posters, users); assert.notMatch(actual, /\{size\}/); assert.lengthOf(actual.match(/_30/g), 3); @@ -399,31 +392,8 @@ assert.lengthOf(actual.match(/_30/g), 3); Jedes `img`-Element sollte ein `src`-Attribut mit dem Wert `avatar_template` des passenden Benutzers haben. Wenn `avatar_template` mit `/` beginnt, fügen Sie `avatarUrl` direkt davor ein. ```js -const posters = [{ user_id: 6 }, { user_id: 285941 }, { user_id: 170865 }]; -const users = [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - }, - { id: 20 } -]; +const posters = _testPosters; +const users = [..._testUsers, { id: 20 }]; const actual = avatars(posters, users); const matches = actual.match(/<\s*img\s+.+?>/g); @@ -458,19 +428,15 @@ assert.isFunction(fetchData); Ihre Funktion `fetchData` sollte Daten von `https://cdn.freecodecamp.org/curriculum/forum-latest/latest.json` anfordern. ```js -const testArr = []; -const temp = fetch; +const spy = __helpers.spyOn(window, 'fetch'); try { - fetch = source => { - testArr.push(source); - return temp(source); - }; fetchData(); - assert.deepEqual(testArr, [ + assert.include( + spy.calls.map(call => call[0]), 'https://cdn.freecodecamp.org/curriculum/forum-latest/latest.json' - ]); + ); } finally { - fetch = temp; + spy.restore(); } ``` @@ -521,55 +487,7 @@ async () => { `showLatestPosts` sollte das innere HTML von `#posts-container` auf einen String setzen, der durch das Verbinden von `tr`-Elementen gebildet wird, eines für jeden Eintrag in `topics`. ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const pContainer = document.getElementById('posts-container'); pContainer.innerHTML = ''; showLatestPosts(data); @@ -579,55 +497,7 @@ assert.lengthOf(pContainer.querySelectorAll('tr'), 2); Jedes `tr`-Element aus dem String, der von `showLatestPosts` zurückgegeben wird, sollte 5 `td`-Elemente enthalten. ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const pContainer = document.getElementById('posts-container'); pContainer.innerHTML = ''; showLatestPosts(data); @@ -638,55 +508,7 @@ assert.lengthOf(pContainer.querySelectorAll('tr:last-child>td'), 5); Das erste `td`-Element jeder Tabellenzeile aus dem String, der von `showLatestPosts` zurückgegeben wird, sollte zwei Ankerelemente enthalten, das erste mit der Klasse `post-title`, einem `href` von `/`, einem Ankertext von `` und das zweite, das durch Aufrufen von `forumCategory` mit `category_id` erhalten wird. ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const pContainer = document.getElementById('posts-container'); pContainer.innerHTML = ''; showLatestPosts(data); @@ -731,55 +553,7 @@ assert.equal( Das zweite `td`-Element jeder Tabellenzeile aus dem String, der von `showLatestPosts` zurückgegeben wird, sollte die Bilder enthalten, die von der Funktion `avatars` zurückgegeben werden, die mit `posters` und `users` als Argumente aufgerufen wird, verschachtelt in einem `div`-Element mit der Klasse `avatar-container`. ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const pContainer = document.getElementById('posts-container'); pContainer.innerHTML = ''; showLatestPosts(data); @@ -820,55 +594,7 @@ assert.equal(imgs2[0].alt, 'Ilenia'); Das dritte `td`-Element jeder Tabellenzeile aus dem String, der von `showLatestPosts` zurückgegeben wird, sollte die Anzahl der Antworten auf den Beitrag enthalten. _Hinweis:_ Verwenden Sie `posts_count - 1`. ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const pContainer = document.getElementById('posts-container'); pContainer.innerHTML = ''; showLatestPosts(data); @@ -887,55 +613,7 @@ assert.equal( Das vierte `td`-Element jeder Tabellenzeile aus dem String, der von `showLatestPosts` zurückgegeben wird, sollte die Anzahl der Ansichten des Beitrags enthalten. ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const pContainer = document.getElementById('posts-container'); pContainer.innerHTML = ''; showLatestPosts(data); @@ -954,55 +632,7 @@ assert.equal( Das fünfte `td`-Element jeder Tabellenzeile aus dem String, der von `showLatestPosts` zurückgegeben wird, sollte die seit der letzten Aktivität verstrichene Zeit enthalten, die mit der Funktion `timeAgo` generiert wurde. ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const calcTime = time => { const currentTime = new Date(); const lastPost = new Date(time); diff --git a/curriculum/challenges/german/blocks/lab-javascript-trivia-bot/66ed41f912d0bb1dc62da5dd.md b/curriculum/challenges/german/blocks/lab-javascript-trivia-bot/66ed41f912d0bb1dc62da5dd.md index e40f8d1525b..742b3dd086d 100644 --- a/curriculum/challenges/german/blocks/lab-javascript-trivia-bot/66ed41f912d0bb1dc62da5dd.md +++ b/curriculum/challenges/german/blocks/lab-javascript-trivia-bot/66ed41f912d0bb1dc62da5dd.md @@ -11,17 +11,17 @@ dashedName: lab-javascript-trivia-bot **User Stories:** -1. Sie sollten `"Hello! I'm your coding fun fact guide!"` als Begrüßungsnachricht für den Benutzer in der Konsole ausgeben. +1. Sie sollten `"Hello! I'm your coding fun fact guide!"` in der Konsole als Begrüßungsnachricht für den Benutzer ausgeben. 1. Sie sollten drei Variablen erstellen: `botName`, `botLocation` und `favoriteLanguage`, die den Namen des Bots, seinen Herkunftsort und seine bevorzugte Programmiersprache speichern. 1. Sie sollten `"My name is (botName) and I live on (botLocation)."` in der Konsole ausgeben. 1. Sie sollten `"My favorite programming language is (favoriteLanguage)."` in der Konsole ausgeben. -1. Sie sollten `let` verwenden, um eine `codingFact`-Variable zu erstellen und ihr einen String zuzuweisen, der eine interessante Tatsache über die Lieblingsprogrammiersprache Ihres Bots enthält und die Verwendung der `favoriteLanguage`-Variable einschließt. -1. Sie sollten `codingFact` in der Konsole ausgeben. -1. Sie sollten die `codingFact`-Variable mit einer neuen Tatsache über die Lieblingssprache des Bots unter Verwendung der `favoriteLanguage`-Variable erneut zuweisen. -1. Sie sollten `codingFact` erneut in der Konsole ausgeben. -1. Sie sollten die `codingFact`-Variable erneut einer weiteren neuen Tatsache über die Lieblingssprache des Bots unter Verwendung der `favoriteLanguage`-Variable zuweisen. -1. Sie sollten `codingFact` zum dritten Mal in der Konsole ausgeben. -1. Sie sollten `"It was fun sharing these facts with you. Goodbye! - (botName) from (botLocation)."` als Abschiedsaussage des Bots in der Konsole ausgeben. +1. Sie sollten `let` verwenden, um eine Variable `codingFact` zu erstellen und ihr einen String zuzuweisen, der eine interessante Tatsache über die Lieblingsprogrammiersprache des Bots enthält, wobei Sie die Variable `favoriteLanguage` verwenden. +1. Sie sollten die Variable `codingFact` in der Konsole ausgeben. +1. Sie sollten die Variable `codingFact` erneut zu einer neuen Tatsache über die Lieblingsprogrammiersprache des Bots zuweisen, wobei Sie wieder die Variable `favoriteLanguage` verwenden. +1. Sie sollten die Variable `codingFact` erneut in der Konsole ausgeben. +1. Sie sollten die Variable `codingFact` ein drittes Mal zu einer weiteren Tatsache über die Lieblingsprogrammiersprache des Bots zuweisen, wobei Sie wieder die Variable `favoriteLanguage` verwenden. +1. Sie sollten die Variable `codingFact` ein drittes Mal in der Konsole ausgeben. +1. Sie sollten `"It was fun sharing these facts with you. Goodbye! - (botName) from (botLocation)."` als Abschiedsbotschaft des Bots in der Konsole ausgeben. # --before-each-- @@ -162,7 +162,7 @@ let codingFact = "Did you know that " + favoriteLanguage + " was created in just console.log(codingFact); -codingFact = "Another fun fact: " + favoriteLanguage + "was originally called Mocha!"; +codingFact = "Another fun fact: " + favoriteLanguage + " was originally called Mocha!"; console.log(codingFact); diff --git a/curriculum/challenges/german/blocks/lab-mood-board/673b3d6b7ef7318eef926d5a.md b/curriculum/challenges/german/blocks/lab-mood-board/673b3d6b7ef7318eef926d5a.md index 6915561a17b..331e9b2452f 100644 --- a/curriculum/challenges/german/blocks/lab-mood-board/673b3d6b7ef7318eef926d5a.md +++ b/curriculum/challenges/german/blocks/lab-mood-board/673b3d6b7ef7318eef926d5a.md @@ -16,16 +16,16 @@ In diesem Labor erstellen Sie ein Moodboard mit wiederverwendbaren React-Kompone **User Stories:** -1. Sie sollten eine `MoodBoardItem`-Komponente erstellen und exportieren, die drei Props akzeptiert: `color`, `image` und `description`. -2. Ihre `MoodBoardItem`-Komponente sollte ein `div` mit der Klasse `mood-board-item` als oberstes Element zurückgeben. -3. Sie sollten die Hintergrundfarbe des `.mood-board-item`-Elements mit inline Styles auf den Wert der `color`-Prop setzen. -4. Sie sollten ein `img`-Element mit der Klasse `mood-board-image` und dem `src`-Attribut, das auf den Wert der `image`-Prop gesetzt ist, innerhalb des `.mood-board-item`-Elements rendern. -5. Sie sollten ein `h3`-Element mit der Klasse `mood-board-text` und dem Text, der dem Wert der `description`-Prop entspricht, innerhalb des `.mood-board-item`-Elements rendern. -6. Sie sollten eine `MoodBoard` erstellen und exportieren. -7. Ihre `MoodBoard`-Komponente sollte ein `div` als oberstes Element zurückgeben. -8. Ihre `MoodBoard`-Komponente sollte ein `h1`-Element mit der Klasse `mood-board-heading` und dem Text `Destination Mood Board` rendern. -9. Ihre `MoodBoard`-Komponente sollte ein `div` mit der Klasse `mood-board` rendern. -10. Ihre `MoodBoard`-Komponente sollte mindestens drei `MoodBoardItem`-Komponenten innerhalb des `.mood-board`-Elements rendern, wobei jede gültige Werte für die Props `color`, `image` und `description` übergibt. +1. Sie sollten eine `MoodBoardItem` Komponente erstellen und exportieren, die drei Props akzeptiert: `color`, `image` und `description`. +2. Ihre `MoodBoardItem` Komponente sollte ein `div` mit der Klasse `mood-board-item` als oberstes Element zurückgeben. +3. Sie sollten die Hintergrundfarbe des Elements `.mood-board-item` mit inline styles auf den Wert der Prop `color` setzen. +4. Sie sollten innerhalb des Elements `.mood-board-item` ein `img`-Element mit der Klasse `mood-board-image` rendern, dessen `src`-Attribut auf den Wert der Prop `image` gesetzt ist. +5. Sie sollten innerhalb des Elements `.mood-board-item` ein `h3`-Element mit der Klasse `mood-board-text` rendern, dessen Text auf den Wert der Prop `description` gesetzt ist. +6. Sie sollten eine `MoodBoard` Komponente erstellen und exportieren. +7. Ihre `MoodBoard` Komponente sollte ein `div` als oberstes Element zurückgeben. +8. Ihre `MoodBoard` Komponente sollte ein `h1`-Element mit der Klasse `mood-board-heading` und dem Text `Destination Mood Board` rendern. +9. Ihre `MoodBoard` Komponente sollte ein `div` mit der Klasse `mood-board` rendern. +10. Ihre `MoodBoard` Komponente sollte mindestens drei `MoodBoardItem` Komponenten innerhalb des Elements `.mood-board` rendern, von denen jede gültige Werte für die Props `color`, `image` und `description` übergibt. Sie können die folgenden Bilder in Ihrem Moodboard verwenden, wenn Sie möchten: @@ -41,7 +41,7 @@ Sie können die folgenden Bilder in Ihrem Moodboard verwenden, wenn Sie möchten Sie sollten eine `MoodBoardItem`-Komponente exportieren. ```js -assert.isFunction(window.index.MoodBoardItem, 1); +assert.isFunction(window.index.MoodBoardItem); ``` Ihre `MoodBoardItem`-Komponente sollte ein `div` mit der Klasse `mood-board-item` als oberstes Element zurückgeben. @@ -52,7 +52,7 @@ assert.exists(item); assert.equal(item.tagName, 'DIV'); ``` -Die Hintergrundfarbe des `.mood-board-item`-Elements sollte mit inline Styles auf den Wert der `color`-Prop gesetzt werden. +Die Hintergrundfarbe Ihres `.mood-board-item`-Elements sollte mit inline Styles auf den Wert der `color`-Prop gesetzt werden. ```js const container = await __helpers.prepTestComponent(window.index.MoodBoardItem, { color: "red" }); @@ -83,7 +83,7 @@ Ihre `MoodBoardItem`-Komponente sollte ein `h3`-Element mit der Klasse `mood-boa Sie sollten eine `MoodBoard`-Komponente exportieren. ```js -assert.isFunction(window.index.MoodBoard, 1); +assert.isFunction(window.index.MoodBoard); ``` Ihre `MoodBoard`-Komponente sollte ein `div` als oberstes Element zurückgeben. @@ -102,7 +102,15 @@ assert.equal(heading.tagName, 'H1'); assert.equal(heading.textContent, 'Destination Mood Board'); ``` -Ihre `MoodBoard`-Komponente sollte mindestens drei `MoodBoardItem`-Komponenten rendern, wobei jede gültige Werte für die Props `color`, `image` und `description` übergibt. +Ihre `MoodBoard`-Komponente sollte ein `div` mit der Klasse `mood-board` rendern. + +```js +const moodboard = document.getElementsByClassName('mood-board')[0]; +assert.exists(moodboard); +assert.equal(moodboard.tagName, 'DIV'); +``` + +Ihre `MoodBoard`-Komponente sollte mindestens drei `MoodBoardItem`-Komponenten innerhalb des Elements `.mood-board` rendern, die jeweils gültige Werte für die Props `color`, `image` und `description` übergeben bekommen. ```js const moodboard = document.getElementsByClassName('mood-board')[0]; diff --git a/curriculum/challenges/german/blocks/lab-motorcycle-shop/694175528a794a090ea0ba74.md b/curriculum/challenges/german/blocks/lab-motorcycle-shop/694175528a794a090ea0ba74.md index aa39bafd1a3..5a1b9621041 100644 --- a/curriculum/challenges/german/blocks/lab-motorcycle-shop/694175528a794a090ea0ba74.md +++ b/curriculum/challenges/german/blocks/lab-motorcycle-shop/694175528a794a090ea0ba74.md @@ -1,6 +1,6 @@ --- id: 694175528a794a090ea0ba74 -title: Build a Motorcycle Shop +title: Eine Motorradwerkstatt erstellen challengeType: 25 dashedName: lab-motorcycle-shop demoType: onClick @@ -35,6 +35,291 @@ Für dieses Lab wurde Ihnen der gesamte HTML- und CSS-Code bereitgestellt. Sie w 7. Die Anzahl der angezeigten `Motorcycle`-Elemente sollte in einem Element mit der ID `results-number` aufgelistet werden. 8. Der Filter sollte bei einem `input`-Ereignis aktualisiert werden. +# --before-all-- + +```js +const _testMotorcycles = [ + { + id: '1', + name: 'Ninja H2', + manufacturer: 'Kawasaki', + category: 'Sport', + price: 29000, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-vmoto-stash.jpg', + description: 'Supercharged hypersport with unmatched power', + year: 2024, + created_at: '2024-01-01T00:00:00Z' + }, + { + id: '2', + name: 'Street Triple RS', + manufacturer: 'Triumph', + category: 'Naked', + price: 13500, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-r3.png', + description: 'Agile naked bike with triple-cylinder perfection', + year: 2024, + created_at: '2024-01-02T00:00:00Z' + }, + { + id: '3', + name: 'R1250 GS Adventure', + manufacturer: 'BMW', + category: 'Adventure', + price: 21995, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-vmoto-stash.jpg', + description: 'The ultimate adventure touring machine', + year: 2024, + created_at: '2024-01-03T00:00:00Z' + }, + { + id: '4', + name: 'Panigale V4', + manufacturer: 'Ducati', + category: 'Sport', + price: 28395, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-kawasaki-zx10r.png', + description: 'Italian superbike engineering at its finest', + year: 2024, + created_at: '2024-01-04T00:00:00Z' + }, + { + id: '5', + name: 'Road Glide Special', + manufacturer: 'Harley-Davidson', + category: 'Cruiser', + price: 29999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-vmax.jpg', + description: 'Classic American touring with modern tech', + year: 2024, + created_at: '2024-01-05T00:00:00Z' + }, + { + id: '6', + name: 'MT-09', + manufacturer: 'Yamaha', + category: 'Naked', + price: 9999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-mt7.jpg', + description: 'Lightweight naked bike with crossplane power', + year: 2024, + created_at: '2024-01-06T00:00:00Z' + }, + { + id: '7', + name: 'Africa Twin', + manufacturer: 'Honda', + category: 'Adventure', + price: 14599, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-honda-africa.jpg', + description: 'Legendary adventure bike reborn for modern times', + year: 2024, + created_at: '2024-01-07T00:00:00Z' + }, + { + id: '8', + name: 'Super Duke R', + manufacturer: 'KTM', + category: 'Naked', + price: 18999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-suzuki-sv650.jpg', + description: 'The Beast returns with 180hp of raw power', + year: 2024, + created_at: '2024-01-08T00:00:00Z' + }, + { + id: '9', + name: 'GSX-R1000R', + manufacturer: 'Suzuki', + category: 'Sport', + price: 17199, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-suzuki-gsxr1000.jpg', + description: 'Track-ready sportbike with championship DNA', + year: 2024, + created_at: '2024-01-09T00:00:00Z' + }, + { + id: '10', + name: 'Street Glide', + manufacturer: 'Harley-Davidson', + category: 'Cruiser', + price: 21999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-vmax.jpg', + description: 'Milwaukee-Eight power in a sleek bagger', + year: 2024, + created_at: '2024-01-10T00:00:00Z' + }, + { + id: '11', + name: 'Z H2', + manufacturer: 'Kawasaki', + category: 'Naked', + price: 17000, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-kawasaki-zh2.jpg', + description: 'Supercharged naked bike mayhem', + year: 2024, + created_at: '2024-01-11T00:00:00Z' + }, + { + id: '12', + name: 'Multistrada V4', + manufacturer: 'Ducati', + category: 'Adventure', + price: 22995, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-mt3.jpg', + description: 'Italian style meets adventure capability', + year: 2024, + created_at: '2024-01-12T00:00:00Z' + }, + { + id: '13', + name: 'Speed Triple 1200', + manufacturer: 'Triumph', + category: 'Naked', + price: 16500, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-honda-transalp.jpg', + description: 'British muscle bike with cutting-edge tech', + year: 2024, + created_at: '2024-01-13T00:00:00Z' + }, + { + id: '14', + name: 'S1000RR', + manufacturer: 'BMW', + category: 'Sport', + price: 17295, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-kawasaki-z900a1.jpg', + description: 'German precision in a superbike package', + year: 2024, + created_at: '2024-01-14T00:00:00Z' + }, + { + id: '15', + name: 'MT-07', + manufacturer: 'Yamaha', + category: 'Naked', + price: 7999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-mt7.jpg', + description: 'Best-selling parallel twin for pure fun', + year: 2024, + created_at: '2024-01-15T00:00:00Z' + }, + { + id: '16', + name: 'V-Strom 1050', + manufacturer: 'Suzuki', + category: 'Adventure', + price: 13799, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-benelli-trk702.png', + description: 'Reliable adventure touring on a budget', + year: 2024, + created_at: '2024-01-16T00:00:00Z' + }, + { + id: '17', + name: 'Sportster S', + manufacturer: 'Harley-Davidson', + category: 'Cruiser', + price: 15999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-r3.png', + description: 'Revolution Max engine in a modern cruiser', + year: 2024, + created_at: '2024-01-17T00:00:00Z' + }, + { + id: '18', + name: 'CBR1000RR-R', + manufacturer: 'Honda', + category: 'Sport', + price: 28500, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-honda-cbr500.png', + description: 'Honda racing technology for the street', + year: 2024, + created_at: '2024-01-18T00:00:00Z' + }, + { + id: '19', + name: 'Tiger 900', + manufacturer: 'Triumph', + category: 'Adventure', + price: 14400, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-triumph-tiger900.png', + description: 'Middleweight adventure excellence', + year: 2024, + created_at: '2024-01-19T00:00:00Z' + }, + { + id: '20', + name: '890 Duke R', + manufacturer: 'KTM', + category: 'Naked', + price: 11999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-kawasaki-zx10r.png', + description: 'The Scalpel - precise handling perfection', + year: 2024, + created_at: '2024-01-20T00:00:00Z' + }, + { + id: '21', + name: 'Ninja 400', + manufacturer: 'Kawasaki', + category: 'Sport', + price: 5299, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-vmoto-stash.jpg', + description: 'Perfect entry-level sportbike', + year: 2024, + created_at: '2024-01-21T00:00:00Z' + }, + { + id: '22', + name: 'Scrambler 1200', + manufacturer: 'Triumph', + category: 'Adventure', + price: 13250, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-ducati-scrambler.jpg', + description: 'Modern classic with off-road capability', + year: 2024, + created_at: '2024-01-22T00:00:00Z' + }, + { + id: '23', + name: 'Monster Plus', + manufacturer: 'Ducati', + category: 'Naked', + price: 14295, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-kawasaki-zx10r.png', + description: 'Evolved Monster with V-twin soul', + year: 2024, + created_at: '2024-01-23T00:00:00Z' + }, + { + id: '24', + name: 'CB650R', + manufacturer: 'Honda', + category: 'Naked', + price: 9199, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-kawasaki-z900.png', + description: 'Neo Sports Café styling with inline-four power', + year: 2024, + created_at: '2024-01-24T00:00:00Z' + }, + { + id: '25', + name: 'Low Rider S', + manufacturer: 'Harley-Davidson', + category: 'Cruiser', + price: 17999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-suzuki-vstorm650.jpg', + description: 'Blacked-out cruiser with attitude', + year: 2024, + created_at: '2024-01-25T00:00:00Z' + } +]; + +window.fetch = () => + Promise.resolve({ json: () => Promise.resolve(_testMotorcycles) }); +``` + # --hints-- Sie sollten ein `type` namens `Category` haben. @@ -84,16 +369,24 @@ Sie sollten den `https://cdn.freecodecamp.org/curriculum/labs/data/motorcycles.j ```js const spy = __helpers.spyOn(window, 'fetch'); -const motorcycles = await fetchMotorcycles(); -assert.strictEqual(spy.calls[0][0].trim(),"https://cdn.freecodecamp.org/curriculum/labs/data/motorcycles.json"); +try { + await fetchMotorcycles(); + assert.strictEqual(spy.calls[0][0].trim(),"https://cdn.freecodecamp.org/curriculum/labs/data/motorcycles.json"); +} finally { + spy.restore(); +} ``` Sie sollten ein Promise von 25 `Motorcycle`-Objekten von `fetchMotorcycles` zurückgeben. ```js const spy = __helpers.spyOn(window, 'fetch'); -const motorcycles = await fetchMotorcycles(); -assert.lengthOf(motorcycles,25); +try { + const motorcycles = await fetchMotorcycles(); + assert.lengthOf(motorcycles,25); +} finally { + spy.restore(); +} ``` Sie sollten eine Funktion namens `renderMotorcycleCard` haben. diff --git a/curriculum/challenges/german/blocks/lab-nth-fibonacci-number-js/7a97b79c096ecb000d03bd36.md b/curriculum/challenges/german/blocks/lab-nth-fibonacci-number-js/7a97b79c096ecb000d03bd36.md index eeb145fe650..7b0cd931606 100644 --- a/curriculum/challenges/german/blocks/lab-nth-fibonacci-number-js/7a97b79c096ecb000d03bd36.md +++ b/curriculum/challenges/german/blocks/lab-nth-fibonacci-number-js/7a97b79c096ecb000d03bd36.md @@ -7,7 +7,7 @@ dashedName: build-an-nth-fibonacci-number-calculator # --description-- -**Ziel:** Erfüllen Sie die untenstehenden User Stories und bringen Sie alle Tests zum Bestehen, um das Labor abzuschließen. +**Ziel:** Erfüllen Sie die untenstehenden User Stories und bestehen Sie alle Tests, um das Labor abzuschließen. **User Stories:** @@ -22,20 +22,25 @@ dashedName: build-an-nth-fibonacci-number-calculator Sie sollten eine Funktion mit dem Namen `fibonacci` haben. ```js -assert.isFunction(fibonacci); +const explorer = await __helpers.Explorer(code); +assert.exists(explorer.allFunctions.fibonacci); ``` Ihre Funktion `fibonacci` sollte einen einzelnen Parameter annehmen. ```js -const params = __helpers.getFunctionParams(fibonacci.toString()); -assert.equal(params.length, 1); +const explorer = await __helpers.Explorer(code); +const { fibonacci } = explorer.allFunctions; +assert.equal(fibonacci?.parameters.length, 1); ``` Sie sollten innerhalb der Funktion `sequence` ein Array namens `fibonacci` haben, das mit `[0, 1]` initialisiert ist. ```js -assert.match(__helpers.removeJSComments(fibonacci.toString()), /(const|let|var)\s+sequence\s*=\s*\[\s*0\s*,\s*1\s*\]/); +const explorer = await __helpers.Explorer(code); +const { fibonacci } = explorer.allFunctions; +const { sequence } = fibonacci?.variables ?? {}; +assert.isTrue(sequence?.value.matches('[0, 1]')); ``` `fibonacci(0)` sollte `0` zurückgeben. diff --git a/curriculum/challenges/german/blocks/lab-product-showcase/696920c0c98a1ed58eb86293.md b/curriculum/challenges/german/blocks/lab-product-showcase/696920c0c98a1ed58eb86293.md index ba6d6efd604..c605a89635c 100644 --- a/curriculum/challenges/german/blocks/lab-product-showcase/696920c0c98a1ed58eb86293.md +++ b/curriculum/challenges/german/blocks/lab-product-showcase/696920c0c98a1ed58eb86293.md @@ -421,6 +421,10 @@ Das Klicken auf den `#all`-Button sollte alle Produkte im `#output`-Element anze ```js const len = products.items.length; +const books = document.getElementById("books"); +const all = document.getElementById("all"); +const output = document.getElementById("output"); + assert.isAtLeast(len, 3); books.dispatchEvent(new Event("click", { bubbles: true })); all.dispatchEvent(new Event("click", { bubbles: true })); @@ -430,7 +434,11 @@ assert.lengthOf(output.querySelectorAll(".item"), len); Das Klicken auf den `#books`-Button sollte die entsprechende Produktmenge im `#output`-Element anzeigen. ```js +const books = document.getElementById("books"); +const clothing = document.getElementById("clothing"); +const output = document.getElementById("output"); const len = products.items.length; + assert.isAtLeast(len, 3); let count = 0; products.items.forEach(i => { @@ -446,7 +454,11 @@ assert.lengthOf(output.querySelectorAll(".item"), count); Das Klicken auf den `#electronics`-Button sollte die entsprechende Produktmenge im `#output`-Element anzeigen. ```js +const electronics = document.getElementById("electronics"); +const clothing = document.getElementById("clothing"); +const output = document.getElementById("output"); const len = products.items.length; + assert.isAtLeast(len, 3); let count = 0; products.items.forEach(i => { @@ -462,7 +474,11 @@ assert.lengthOf(output.querySelectorAll(".item"), count); Das Klicken auf den `#clothing`-Button sollte die entsprechende Produktmenge im `#output`-Element anzeigen. ```js +const books = document.getElementById("books"); +const clothing = document.getElementById("clothing"); +const output = document.getElementById("output"); const len = products.items.length; + assert.isAtLeast(len, 3); let count = 0; products.items.forEach(i => { @@ -478,6 +494,7 @@ assert.lengthOf(output.querySelectorAll(".item"), count); Alle Produkte sollten beim Laden der Seite standardmäßig sichtbar sein. Verwenden Sie das `DOMContentLoaded`-Ereignis, um dies sicherzustellen. ```js +const output = document.getElementById("output"); const len = products.items.length; assert.isAtLeast(len, 3); document.dispatchEvent(new Event("DOMContentLoaded")); diff --git a/curriculum/challenges/german/blocks/lab-reusable-footer/673b02b03134b04637bf7055.md b/curriculum/challenges/german/blocks/lab-reusable-footer/673b02b03134b04637bf7055.md index 262f7745a87..d560b657f44 100644 --- a/curriculum/challenges/german/blocks/lab-reusable-footer/673b02b03134b04637bf7055.md +++ b/curriculum/challenges/german/blocks/lab-reusable-footer/673b02b03134b04637bf7055.md @@ -16,7 +16,7 @@ demoType: onClick 2. Ihre `Footer`-Komponente sollte ein `footer`-Element zurückgeben, das alle anderen Elemente enthält. 3. Ihr `footer`-Element sollte: - - Mindestens drei ungeordnete Listen enthalten, jede mit mindestens zwei Listenelementen. +- Mindestens drei ungeordnete Listen enthalten, jede mit mindestens zwei Listenelementen. - Mindestens ein Absatz-Element mit einem Copyright-`©`-Symbol enthalten. - Mindestens drei Links haben, deren `href`-Wert auf `#` gesetzt ist und deren Linkinhalt ein Icon oder Text Ihrer Wahl ist. @@ -53,7 +53,7 @@ Ihr `footer`-Element sollte mindestens drei ungeordnete Listen enthalten. assert.isAtLeast(document.querySelectorAll('ul').length, 3); ``` -Jede Ihrer ungeordneten Listen sollte mindestens zwei Listenelemente haben. +Jede Ihrer ungeordneten Listen sollte mindestens zwei Listenelemente enthalten. ```js const uls = [...document.querySelectorAll('ul')]; @@ -84,7 +84,7 @@ const links = document.querySelectorAll('a[href="#"]'); assert.isAtLeast(links.length, 3); ``` -Keiner Ihrer Links sollte leer sein. +Ihre Links sollten nicht leer sein. ```js const links = [...document.querySelectorAll('a[href="#"]')]; diff --git a/curriculum/challenges/german/blocks/lab-sentence-maker/66c057041df6394ca796bf33.md b/curriculum/challenges/german/blocks/lab-sentence-maker/66c057041df6394ca796bf33.md index 4f46d946795..0a543202bf7 100644 --- a/curriculum/challenges/german/blocks/lab-sentence-maker/66c057041df6394ca796bf33.md +++ b/curriculum/challenges/german/blocks/lab-sentence-maker/66c057041df6394ca796bf33.md @@ -7,9 +7,9 @@ dashedName: build-a-sentence-maker # --description-- -In diesem Labor erstellen Sie zwei verschiedene Geschichten mithilfe einer Satzvorlage. Sie verwenden Variablen, um verschiedene Teile der Geschichte zu speichern, und geben dann die Geschichten in der Konsole aus. +In diesem Labor erstellen Sie zwei verschiedene Geschichten mit einer Satzvorlage. Sie verwenden Variablen, um verschiedene Teile der Geschichte zu speichern, und geben die Geschichten dann in der Konsole aus. -**Ziel:** Erfüllen Sie die unten stehenden User Stories und bestehen Sie alle Tests, um das Labor abzuschließen. +**Ziel:** Erfüllen Sie die untenstehenden User Stories und bestehen Sie alle Tests, um das Labor abzuschließen. **User Stories:** @@ -26,7 +26,7 @@ In diesem Labor erstellen Sie zwei verschiedene Geschichten mithilfe einer Satzv 1. Sie sollten eine `firstStory`-Variable deklarieren. -1. Sie sollten die folgende Geschichtenvorlage verwenden, um die erste Geschichte zu erstellen, und sie der `firstStory`-Variable zuweisen: `"Once upon a time, there was a(n) [adjective] [noun] who loved to eat [noun2]. The [noun] lived in a [place] and had [adjective2] nostrils that blew fire when it was [verb]."`; +1. Sie sollten die folgende Satzvorlage verwenden, um die erste Geschichte zu erstellen und sie der Variablen `firstStory` zuzuweisen: `"Once upon a time, there was a(n) [adjective] [noun] who loved to eat [noun2]. The [noun] lived in a [place] and had [adjective2] nostrils that blew fire when it was [verb]."` 1. Sie sollten Ihre erste Geschichte mit der Nachricht `"First story: [firstStory]"` in der Konsole ausgeben. @@ -34,11 +34,18 @@ In diesem Labor erstellen Sie zwei verschiedene Geschichten mithilfe einer Satzv 1. Sie sollten eine `secondStory`-Variable deklarieren. -1. Erstellen Sie eine weitere Geschichte mit derselben Vorlage und weisen Sie sie der `secondStory`-Variable zu. +1. Sie sollten eine weitere Geschichte mit derselben Vorlage erstellen und sie der Variablen `secondStory` zuweisen. 1. Sie sollten Ihre zweite Geschichte mit der Nachricht `"Second story: [secondStory]"` in der Konsole ausgeben. +# --before-each-- + +```js +const spy = __helpers.spyOn(console, 'log'); +const getLogs = () => spy.calls.map(call => call.join(' ')); +``` + # --hints-- Sie sollten eine `adjective`-Variable deklarieren. @@ -142,12 +149,10 @@ assert.match( ); ``` -Sie sollten Ihre erste Geschichte mit der Nachricht `"First story: [firstStory]"` ausgeben. +Sie sollten Ihre erste Geschichte mit der Nachricht `"First story: [firstStory]"` in der Konsole ausgeben. ```js -const condition1 = /console\.log\(\s*["']First\s+story:\s+["']\s*\+\s*firstStory\s*\);?/gm.test(code); -const condition2 = /console\.log\(\s*`First\s+story:\s+\$\{firstStory\}`\s*\);?/gm.test(code); -assert.isTrue(condition1 || condition2); +assert.include(getLogs(), `First story: ${firstStory}`); ``` Sie sollten eine `secondStory`-Variable deklarieren. @@ -208,15 +213,13 @@ assert.match( ); ``` -Sie sollten Ihre zweite Geschichte mit dem Format `"Second story: [secondStory]"` ausgeben. +Sie sollten Ihre zweite Geschichte mit der Nachricht `"Second story: [secondStory]"` in der Konsole ausgeben. ```js -const condition1 = /console\.log\(\s*["']Second\s+story:\s+["']\s*\+\s*secondStory\s*\);?/gm.test(code); -const condition2 = /console\.log\(\s*`Second\s+story:\s+\$\{secondStory\}`\s*\);?/gm.test(code); -assert.isTrue(condition1 || condition2); +assert.include(getLogs(), `Second story: ${secondStory}`); ``` -Die `firstStory` sollte nicht dieselbe sein wie die `secondStory`. +Ihre `firstStory` sollte nicht dieselbe sein wie Ihre `secondStory`. ```js assert.notEqual(firstStory, secondStory); diff --git a/curriculum/challenges/german/blocks/lab-weather-app/66f12a88741aeb16b9246c59.md b/curriculum/challenges/german/blocks/lab-weather-app/66f12a88741aeb16b9246c59.md index a4d15516f0e..5f8fdae9a64 100644 --- a/curriculum/challenges/german/blocks/lab-weather-app/66f12a88741aeb16b9246c59.md +++ b/curriculum/challenges/german/blocks/lab-weather-app/66f12a88741aeb16b9246c59.md @@ -333,7 +333,7 @@ assert.strictEqual( ); ``` -Im `select`-Element sollten 6 `option`-Elemente sein, eines für jede der folgenden Städte: Paris, London, Tokyo, Los Angeles, Chicago, New York. +Zusätzlich zur leeren ersten Option sollte das `select`-Element 6 `option`-Elemente enthalten, jeweils eines für jede der folgenden Städte: Paris, London, Tokyo, Los Angeles, Chicago, New York. ```js ['Paris', 'London', 'Tokyo', 'Los Angeles', 'Chicago', 'New York'].forEach( @@ -342,7 +342,7 @@ Im `select`-Element sollten 6 `option`-Elemente sein, eines für jede der folgen `select > option[value="${city.toLowerCase()}"]` ); assert.exists(el); - assert.strictEqual(el.innerText.trim(), city); + assert.strictEqual(el.textContent.trim(), city); } ); ``` diff --git a/curriculum/challenges/german/blocks/learn-about-speculation-and-requests/67eff6af42e8c425d9ff28e3.md b/curriculum/challenges/german/blocks/learn-about-speculation-and-requests/67eff6af42e8c425d9ff28e3.md index e2989cc3058..9478bed65b9 100644 --- a/curriculum/challenges/german/blocks/learn-about-speculation-and-requests/67eff6af42e8c425d9ff28e3.md +++ b/curriculum/challenges/german/blocks/learn-about-speculation-and-requests/67eff6af42e8c425d9ff28e3.md @@ -32,7 +32,7 @@ Diese dreiteilige Phrase bezieht sich auf die aktuellste oder neueste Version vo - `Your software is up to date.` – Die Software hat alle neuesten Updates. -- `Is your resume up to date?` – Sie fragen, ob der Lebenslauf die aktuellste Erfahrung dieser Person enthält. +- `Is your resume up to date?` – Es wird gefragt, ob der Lebenslauf die aktuellsten Erfahrungen dieser Person enthält. # --scene-- diff --git a/curriculum/challenges/german/blocks/learn-basic-css-by-building-a-cafe-menu/5f3ef6e03d719d5ac4738993.md b/curriculum/challenges/german/blocks/learn-basic-css-by-building-a-cafe-menu/5f3ef6e03d719d5ac4738993.md index e7430072544..58f47bf6048 100644 --- a/curriculum/challenges/german/blocks/learn-basic-css-by-building-a-cafe-menu/5f3ef6e03d719d5ac4738993.md +++ b/curriculum/challenges/german/blocks/learn-basic-css-by-building-a-cafe-menu/5f3ef6e03d719d5ac4738993.md @@ -7,7 +7,7 @@ dashedName: step-56 # --description-- -Die aktuelle Breite des Menüs nimmt immer 80 % der Breite des `body`-Elements ein. Auf einem sehr breiten Bildschirm erscheinen der Kaffee und das Dessert weit entfernt von ihren Preisen. +Die aktuelle Breite des Menüs nimmt immer `80%` der Breite des `body`-Elements ein. Auf einem sehr breiten Bildschirm erscheinen die Kaffees und Desserts weit entfernt von ihren Preisen. Fügen Sie der `menu`-Klasse eine `max-width`-Eigenschaft mit dem Wert `500px` hinzu, um zu verhindern, dass sie zu breit wird. diff --git a/curriculum/challenges/german/blocks/learn-how-to-plan-future-events/67531709d628ef047202e6ae.md b/curriculum/challenges/german/blocks/learn-how-to-plan-future-events/67531709d628ef047202e6ae.md index cbbe6a102a0..ed7531ecf9a 100644 --- a/curriculum/challenges/german/blocks/learn-how-to-plan-future-events/67531709d628ef047202e6ae.md +++ b/curriculum/challenges/german/blocks/learn-how-to-plan-future-events/67531709d628ef047202e6ae.md @@ -12,7 +12,7 @@ Sehen Sie sich das folgende Video an, um den Kontext der kommenden Lektionen zu # --assignment-- -Sehen Sie sich das Video an.. +Sehen Sie sich das Video an. # --scene-- diff --git a/curriculum/challenges/german/blocks/learn-present-perfect-while-talking-about-accessibility/671b98e9b7c4854e93044e64.md b/curriculum/challenges/german/blocks/learn-present-perfect-while-talking-about-accessibility/671b98e9b7c4854e93044e64.md index aad97da963e..9d8f747dc8f 100644 --- a/curriculum/challenges/german/blocks/learn-present-perfect-while-talking-about-accessibility/671b98e9b7c4854e93044e64.md +++ b/curriculum/challenges/german/blocks/learn-present-perfect-while-talking-about-accessibility/671b98e9b7c4854e93044e64.md @@ -1,6 +1,6 @@ --- id: 671b98e9b7c4854e93044e64 -title: "Dialogue 2: Closed Captioning Challenges" +title: "Dialog 2: Herausforderungen bei der Untertitelung" challengeType: 21 dashedName: dialogue-2-closed-captioning-challenges lang: en-US @@ -62,7 +62,7 @@ Sehen Sie sich das Video an. "startTime": 5.34, "finishTime": 9.26, "dialogue": { - "text": "Yes, for some reason it hasn't been displaying correctly for some users.", + "text": "Yes. For some reason, it hasn't been displaying correctly for some users.", "align": "right" } }, diff --git a/curriculum/challenges/german/blocks/learn-present-perfect-while-talking-about-accessibility/671f403c1d4e8a5e046065a0.md b/curriculum/challenges/german/blocks/learn-present-perfect-while-talking-about-accessibility/671f403c1d4e8a5e046065a0.md index 0dc0b01d4fa..fb00ae066f8 100644 --- a/curriculum/challenges/german/blocks/learn-present-perfect-while-talking-about-accessibility/671f403c1d4e8a5e046065a0.md +++ b/curriculum/challenges/german/blocks/learn-present-perfect-while-talking-about-accessibility/671f403c1d4e8a5e046065a0.md @@ -6,7 +6,7 @@ dashedName: task-36 lang: en-US --- -<!-- (Audio) James: Yes. For some reason, It hasn't been displaying correctly for some users. --> +<!-- (Audio) James: Yes. For some reason, it hasn't been displaying correctly for some users. --> # --instructions-- @@ -16,7 +16,7 @@ Hören Sie sich die Audioaufnahme an und vervollständigen Sie den folgenden Sat ## --sentence-- -`Yes. For some reason, It BLANK BLANK BLANK correctly for some users.` +`Yes. For some reason, it BLANK BLANK BLANK correctly for some users.` ## --blanks-- @@ -83,7 +83,7 @@ Der Satz steht in der verneinten Form der `Present Perfect Continuous`-Zeit, die "startTime": 1, "finishTime": 4.92, "dialogue": { - "text": "Yes, for some reason it hasn't been displaying correctly for some users.", + "text": "Yes. For some reason, it hasn't been displaying correctly for some users.", "align": "center" } }, diff --git a/curriculum/challenges/german/blocks/learn-present-perfect-while-talking-about-accessibility/671f456994635c6085054cbd.md b/curriculum/challenges/german/blocks/learn-present-perfect-while-talking-about-accessibility/671f456994635c6085054cbd.md index 834cbeeb196..acffbcb9e78 100644 --- a/curriculum/challenges/german/blocks/learn-present-perfect-while-talking-about-accessibility/671f456994635c6085054cbd.md +++ b/curriculum/challenges/german/blocks/learn-present-perfect-while-talking-about-accessibility/671f456994635c6085054cbd.md @@ -6,17 +6,17 @@ dashedName: task-37 lang: en-US --- -<!-- (Audio) James: Yes. For some reason, It hasn't been displaying correctly for some users. --> +<!-- (Audio) James: Yes. For some reason, it hasn't been displaying correctly for some users. --> # --instructions-- -Hören Sie sich die Audioaufnahme an und vervollständigen Sie den Satz unten. +Hören Sie sich die Audioaufnahme an und vervollständigen Sie den folgenden Satz. # --fillInTheBlank-- ## --sentence-- -`Yes. For some reason, It hasn't been displaying BLANK for some BLANK.` +`Yes. For some reason, it hasn't been displaying BLANK for some BLANK.` ## --blanks-- @@ -79,7 +79,7 @@ Dieses Substantiv im Plural bezeichnet Personen, die mit einem Produkt oder eine "startTime": 1, "finishTime": 4.92, "dialogue": { - "text": "Yes, for some reason it hasn't been displaying correctly for some users.", + "text": "Yes. For some reason, it hasn't been displaying correctly for some users.", "align": "center" } }, diff --git a/curriculum/challenges/german/blocks/learn-present-perfect-while-talking-about-accessibility/6720cf38beae8c4f1d7af1c0.md b/curriculum/challenges/german/blocks/learn-present-perfect-while-talking-about-accessibility/6720cf38beae8c4f1d7af1c0.md index 43a0049ec20..a0ba192a196 100644 --- a/curriculum/challenges/german/blocks/learn-present-perfect-while-talking-about-accessibility/6720cf38beae8c4f1d7af1c0.md +++ b/curriculum/challenges/german/blocks/learn-present-perfect-while-talking-about-accessibility/6720cf38beae8c4f1d7af1c0.md @@ -22,7 +22,7 @@ Schreiben Sie die folgenden Wörter oder Ausdrücke an die richtige Stelle: `ren `Alice: James, have you heard about the BLANK on our video platform?` -`James: Yes. For some reason, It hasn't been BLANK for some users. The captions are misaligned and BLANK, which isn't good for accessibility.` +`James: Yes. For some reason, it hasn't been BLANK for some users. The captions are misaligned and BLANK, which isn't good for accessibility.` `Alice: Exactly. Do you know if it's been affecting all the videos or just a few?` diff --git a/curriculum/challenges/german/blocks/lecture-css-specificity-the-cascade-algorithm-and-inheritance/672aa62178d5ff57fe4f98e0.md b/curriculum/challenges/german/blocks/lecture-css-specificity-the-cascade-algorithm-and-inheritance/672aa62178d5ff57fe4f98e0.md index 343860bd568..7220fd28850 100644 --- a/curriculum/challenges/german/blocks/lecture-css-specificity-the-cascade-algorithm-and-inheritance/672aa62178d5ff57fe4f98e0.md +++ b/curriculum/challenges/german/blocks/lecture-css-specificity-the-cascade-algorithm-and-inheritance/672aa62178d5ff57fe4f98e0.md @@ -43,14 +43,14 @@ Danach haben ID-Selektoren eine hohe Spezifität. ```html <link rel="stylesheet" href="styles.css"> -<p id="para">Red paragraph</p> +<p id="para-1">Red paragraph</p> <p>Other paragraph</p> <p>Another paragraph</p> <p>Yet another paragraph</p> ``` ```css -#para { +#para-1 { color: red; } @@ -67,24 +67,33 @@ Beispiele sind Klassen-Selektoren wie `.container` und `.button`, Attribut-Selek **HINWEIS**: Sie werden in zukünftigen Lektionen mehr über Pseudoklassen lernen. -In diesem Beispiel wird der erste Absatz rot sein, weil ein ID-Selektor eine höhere Spezifität hat als Klassen- und Typselektoren. Die `.example-para`-Elemente werden grün sein, während die übrigen Absatz-Elemente blau gefärbt sind. +In diesem Beispiel: + +- Der erste Absatz wird rot sein, weil ein ID-Selektor eine höhere Spezifität hat als Klassen- und Typselektoren. +- Der zweite Absatz mit einem Klassenselektor `.example-para` wird grün sein. +- Der dritte Absatz mit sowohl einem ID-Selektor `#para-3` als auch einem Klassenselektor `.example-para` wird lila sein. +- Das übrige Absatz-Element wird blau sein. :::interactive_editor ```html <link rel="stylesheet" href="styles.css"> -<p id="para">Example paragraph</p> +<p id="para-1">Example paragraph</p> <p class="example-para">Other paragraph</p> -<p class="example-para">Another paragraph</p> +<p id="para-3" class="example-para">Another paragraph</p> <p>Yet another paragraph</p> ``` ```css -#para { +#para-1 { color: red; } +#para-3 { + color: purple; +} + .example-para { color: green; } @@ -105,13 +114,13 @@ Typselektoren wie `div` und `h1` sowie Pseudoelemente wie `::before` und `::afte ```html <link rel="stylesheet" href="styles.css"> -<p id="para">Example paragraph</p> +<p id="para-1">Example paragraph</p> <p>Other paragraph</p> <p>Yet another paragraph</p> ``` ```css -#para { +#para-1 { color: red; } @@ -130,7 +139,7 @@ Hier ist ein Beispiel, wie Sie mit dem `*`-Selektor die Farbe aller Elemente auf ```html <link rel="stylesheet" href="styles.css"> -<p id="para">Example paragraph</p> +<p id="para-1">Example paragraph</p> <p>Other paragraph</p> <p>Yet another paragraph</p> ``` @@ -140,7 +149,7 @@ Hier ist ein Beispiel, wie Sie mit dem `*`-Selektor die Farbe aller Elemente auf color: red; } -#para { +#para-1 { color: green; } diff --git a/curriculum/challenges/german/blocks/lecture-express-middleware/69f42d414b7626e21a922794.md b/curriculum/challenges/german/blocks/lecture-express-middleware/69f42d414b7626e21a922794.md index c9377cb7b5c..5ccdd338b82 100644 --- a/curriculum/challenges/german/blocks/lecture-express-middleware/69f42d414b7626e21a922794.md +++ b/curriculum/challenges/german/blocks/lecture-express-middleware/69f42d414b7626e21a922794.md @@ -9,9 +9,7 @@ dashedName: what-is-error-handling-middleware Error-handling-Middleware in Express ist eine spezielle Art von Middleware, die verwendet wird, um Fehler zu behandeln, die während des Anfrage-Antwort-Zyklus auftreten. Sie ist unerlässlich, um unerwartete Fehler abzufangen, zu protokollieren und dem Client angemessene Antworten zu geben. -Wie Sie in einer vorherigen Lektion zum Thema Error-handling gesehen haben, hat die Express-Error-handling-Middleware vier Parameter: `err`, `req`, `res` und `next`. Diese Middleware wird aufgerufen, wenn ein Fehler an die `next()`-Funktion übergeben wird. - -Hier noch einmal eine Erinnerung an die Syntax: +Die Express-Error-Handling-Middleware hat vier Parameter: `err`, `req`, `res` und `next`. Diese Middleware wird aufgerufen, wenn ein Fehler an die Funktion `next()` übergeben wird. Hier ist die Syntax: ```js app.use((err, req, res, next) => { diff --git a/curriculum/challenges/german/blocks/lecture-express-middleware/69f42d414b7626e21a922795.md b/curriculum/challenges/german/blocks/lecture-express-middleware/69f42d414b7626e21a922795.md index d9b006f2d31..ec13615e011 100644 --- a/curriculum/challenges/german/blocks/lecture-express-middleware/69f42d414b7626e21a922795.md +++ b/curriculum/challenges/german/blocks/lecture-express-middleware/69f42d414b7626e21a922795.md @@ -13,45 +13,45 @@ Express stellt eine Reihe von eingebauten Middleware-Funktionen bereit, die bei 1. `express.json()`: Eine eingebaute Middleware, die eingehende JSON-Nutzlasten parst. -```js -app.use(express.json()) -``` + ```js + app.use(express.json()) + ``` 1. `express.static()`: Eine Middleware zum Bereitstellen statischer Dateien wie Bilder, CSS- und JavaScript-Dateien. -```js -app.use(express.static('public')) -``` + ```js + app.use(express.static('public')) + ``` 1. `express.urlencoded()`: Eine Middleware, die eingehende Anfragen mit URL-kodierten Nutzlasten parst, das Format, das typischerweise von HTML-Formularen gesendet wird. Sie macht die geparsten Daten auf `req.body` verfügbar. -```js -app.use(express.urlencoded({ extended: true })) -``` + ```js + app.use(express.urlencoded({ extended: true })) + ``` **Nun, hier sind einige Beispiele für Drittanbieter-Middleware:** 1. `cors`: Eine beliebte Drittanbieter-Middleware, um Cross-Origin Resource Sharing zu ermöglichen. -```bash -npm install cors -``` + ```bash + npm install cors + ``` -```js -const cors = require('cors') -app.use(cors()) -``` + ```js + const cors = require('cors') + app.use(cors()) + ``` 1. `morgan`: Eine Logging-Middleware für HTTP-Anfragen. -```bash -npm install morgan -``` + ```bash + npm install morgan + ``` -```js -const morgan = require('morgan') -app.use(morgan('tiny')) -``` + ```js + const morgan = require('morgan') + app.use(morgan('tiny')) + ``` Schauen wir uns nun ein Beispiel an, in dem sowohl eingebaute als auch Drittanbieter-Middleware verwendet werden: diff --git a/curriculum/challenges/german/blocks/lecture-importance-of-semantic-html/672990ecf71a852804ababe7.md b/curriculum/challenges/german/blocks/lecture-importance-of-semantic-html/672990ecf71a852804ababe7.md index befcbbb5a7a..71a4082f76c 100644 --- a/curriculum/challenges/german/blocks/lecture-importance-of-semantic-html/672990ecf71a852804ababe7.md +++ b/curriculum/challenges/german/blocks/lecture-importance-of-semantic-html/672990ecf71a852804ababe7.md @@ -11,6 +11,10 @@ Presentational HTML konzentriert sich auf das Aussehen und den Stil des Inhalts. Viele presentational HTML-Elemente sind veraltet, was bedeutet, dass sie nicht mehr empfohlen werden. Es gibt bessere Möglichkeiten, dieselben Ergebnisse zu erzielen. Es ist jedoch hilfreich zu wissen, dass sie existieren, deshalb schauen wir uns einige Beispiele an. +## Präsentative HTML-Elemente + +### Das `font`-Element + Das `font` Element ist ein veraltetes Element, das verwendet wurde, um die Schriftgröße und Farbe des Texts festzulegen. Hier ist ein Beispiel für ein `font` Element. Aktivieren Sie den interaktiven Editor und ändern Sie die Größe von 5 auf 7, um die Schriftgröße zu erhöhen. @@ -27,6 +31,8 @@ Dieses Beispiel setzt die Farbe des Texts auf `blue` und die Größe auf den Wer Obwohl dieses Element noch funktioniert, sollten Sie es nicht verwenden, da die Schriftgröße und Farbe immer mit CSS und nicht mit HTML festgelegt werden sollten. +### Das `center`-Element + Das `center` Element ist ein weiteres veraltetes Element, das verwendet wurde, um den Inhalt horizontal innerhalb seines Containers zu zentrieren. Hier ist ein Beispiel für das `center` Element, das Text und ein Absatz-Element enthält. Aktivieren Sie den interaktiven Editor und fügen Sie `center`-Tags um das `<p>Another example text.</p>` hinzu, um zu sehen, wie es auf der Seite zentriert wird. @@ -44,6 +50,8 @@ Aktivieren Sie den interaktiven Editor und fügen Sie `center`-Tags um das `<p>A ::: +### Das `big`-Element + Als Nächstes haben wir das `big` Element. Dies ist ein weiteres veraltetes presentational HTML-Element, das den eingeschlossenen Text eine Stufe größer macht als den umgebenden Text. Hier haben wir ein Beispiel, das einen Absatz mit zwei Teilen definiert. Aktivieren Sie den interaktiven Editor und fügen Sie `big`-Tags um das `Some other text` hinzu und sehen Sie die Änderungen im Vorschaufenster. @@ -64,6 +72,8 @@ Denken Sie daran, dass die Schriftgröße immer mit CSS festgelegt werden sollte Dies waren Beispiele für presentational HTML-Elemente. Aber alle sind veraltet und werden nicht mehr empfohlen. Was sollten Sie stattdessen verwenden? Schauen wir es uns an. +## Semantisches HTML + Semantic HTML ist jetzt die empfohlene Praxis. Es beschreibt den Inhalt der Elemente, sodass es viel einfacher ist, sie zu lesen, zu verstehen und zu warten. Suchmaschinen können Ihre Webseite leicht verstehen, wenn Sie semantic HTML verwenden. Es ist auch hilfreich für Barrierefreiheit, da Screenreader semantische Informationen benötigen, um zu beschreiben, was sich auf der Webseite befindet. @@ -75,6 +85,8 @@ Beispiele für semantic HTML-Elemente sind: - Das `section` Element zum Gruppieren verwandter Informationen. - Das `figure` Element für Illustrationen und Diagramme. +### Beispiel für semantisches HTML + Dies ist ein Beispiel für ein `header` Element, das ein Navigations-Abschnitts-Element enthält. Aktivieren Sie den interaktiven Editor und fügen Sie ein `<a href="#">Products</a>` innerhalb des `nav` hinzu und sehen Sie die Änderungen im Vorschaufenster. @@ -97,6 +109,8 @@ Aktivieren Sie den interaktiven Editor und fügen Sie ein `<a href="#">Products< Die semantischen Elemente zeigen klar ihren Zweck innerhalb der HTML-Struktur. Es gibt viele verschiedene semantic HTML-Elemente. Sie werden definitiv eines finden, das den Anforderungen Ihres Projekts entspricht. +## Zusammenfassung + Großartige Arbeit. Jetzt wissen Sie den Unterschied zwischen presentational und semantic HTML: semantic HTML beschreibt den Inhalt, während presentational HTML sich auf das Aussehen konzentriert. # --questions-- diff --git a/curriculum/challenges/german/blocks/lecture-introduction-to-javascript-libraries-and-frameworks/6734e88cc46e6dc679420040.md b/curriculum/challenges/german/blocks/lecture-introduction-to-javascript-libraries-and-frameworks/6734e88cc46e6dc679420040.md index f2b3a6a2b92..8bba9c66339 100644 --- a/curriculum/challenges/german/blocks/lecture-introduction-to-javascript-libraries-and-frameworks/6734e88cc46e6dc679420040.md +++ b/curriculum/challenges/german/blocks/lecture-introduction-to-javascript-libraries-and-frameworks/6734e88cc46e6dc679420040.md @@ -13,7 +13,7 @@ Eines der beliebtesten Tools zur Einrichtung von Projekten ist Vite. Vite, was a Um ein neues Projekt mit Vite zu erstellen, müssen Sie die Kommandozeile verwenden. Wenn Sie einen Windows-Rechner nutzen, können Sie die Eingabeaufforderung oder Windows PowerShell verwenden. Wenn Sie einen Mac verwenden, dann öffnen Sie die Terminal-App. -Falls Sie Node.js nicht installiert haben, was für die Funktion von npm erforderlich ist, finden Sie hier einen Link zur offiziellen Node.js-Webseite: https://nodejs.org. Folgen Sie den Installationsanweisungen und kehren Sie dann hierher zurück, um Ihre React-Installation fortzusetzen. +Falls Sie Node.js nicht installiert haben, was für die Funktion von npm erforderlich ist, finden Sie hier einen Link zur offiziellen Node.js-Webseite: [nodejs.org](https://nodejs.org). Folgen Sie den Installationsanweisungen und kehren Sie dann hierher zurück, um mit der React-Installation fortzufahren. Sobald Sie die Kommandozeile geöffnet haben, können Sie den folgenden Befehl verwenden: @@ -36,7 +36,7 @@ npm install Der `cd my-react-app`-Befehl stellt sicher, dass Sie in das richtige Verzeichnis wechseln, in dem sich Ihr Projekt befindet. -Der `npm install`-Befehl wird verwendet, um die Abhängigkeiten zu installieren, die benötigt werden, damit Ihr React-Projekt ordnungsgemäß läuft. Abhängigkeiten sind Bibliotheken oder Pakete, die Ihr React-Projekt benötigt, um korrekt zu funktionieren, wie React selbst, ReactDOM oder andere Drittanbieterpakete, die zusätzliche Funktionalität bereitstellen. +Der Befehl `npm install` wird verwendet, um die Abhängigkeiten zu installieren, die benötigt werden, damit Ihr React-Projekt korrekt ausgeführt werden kann. Abhängigkeiten sind Bibliotheken oder Pakete, die Ihr React-Projekt benötigt, um richtig zu funktionieren, wie React selbst, `react-dom` oder andere Drittanbieter-Pakete, die zusätzliche Funktionen bereitstellen. Das Ausführen von `npm install` liest die `package.json`-Datei in Ihrem Projektverzeichnis und installiert alle dort aufgeführten Abhängigkeiten, sodass Sie Ihre React-Anwendung ohne fehlende Komponenten bauen und ausführen können. @@ -50,11 +50,11 @@ Um Ihr Projekt auszuführen, führen Sie den `npm run dev`-Befehl aus und öffne Sie sollten die Starter-Vorlage sehen, die Vite für Sie bereitgestellt hat. -Wenn Sie den lokalen Server stoppen müssen, drücken Sie `CTRL + C` in der Kommandozeile. +Wenn Sie den lokalen Server stoppen müssen, drücken Sie `Ctrl + C` in der Befehlszeile. -Um den Code für diese Starter-Vorlage tatsächlich zu sehen, können Sie in Ihrem Projekt in den `src`-Ordner gehen, und Sie sollten die `App.jsx`-Datei sehen. +Um den Code für diese Starter-Vorlage tatsächlich zu sehen, können Sie den Ordner `src` in Ihrem Projekt öffnen, wo Sie die Datei `App.jsx` finden sollten. -Von dort aus können Sie die Datei bearbeiten, Ihre Änderungen speichern und die neuen Änderungen im Browser sehen. +Von dort aus können Sie die Datei bearbeiten, Ihre Änderungen speichern und beobachten, wie sie im Browser angezeigt werden. Damit sind Sie bereit, Ihre React-Anwendung zu entwickeln! diff --git a/curriculum/challenges/german/blocks/lecture-introduction-to-javascript/672d49959621885e9d3e672c.md b/curriculum/challenges/german/blocks/lecture-introduction-to-javascript/672d49959621885e9d3e672c.md index 88b9e1ae2db..a07dd198c73 100644 --- a/curriculum/challenges/german/blocks/lecture-introduction-to-javascript/672d49959621885e9d3e672c.md +++ b/curriculum/challenges/german/blocks/lecture-introduction-to-javascript/672d49959621885e9d3e672c.md @@ -72,6 +72,16 @@ console.log(age); // 25 ::: +Während eine mit `let` deklarierte Variable neu zugewiesen werden kann, darf sie nicht erneut deklariert werden. Wenn Sie versuchen, dieselbe Variable erneut mit `let` zu deklarieren, erhalten Sie einen Fehler: + +```js +let age = 25; + +let age = 90; // SyntaxError: Identifier 'age' has already been declared +``` + +Dasselbe gilt für `const`: Eine mit `const` deklarierte Variable darf ebenfalls nicht erneut deklariert werden. + Variablen, die mit `const` deklariert wurden, müssen zum Zeitpunkt der Deklaration einen Wert zugewiesen bekommen. Wenn Sie versuchen, eine `const`-Variable ohne Wertzuweisung zu deklarieren, erhalten Sie einen Fehler: ```js diff --git a/curriculum/challenges/german/blocks/lecture-understanding-aria-expanded-aria-live-and-common-aria-states/672a54dff9dc439089f1a219.md b/curriculum/challenges/german/blocks/lecture-understanding-aria-expanded-aria-live-and-common-aria-states/672a54dff9dc439089f1a219.md index c120e038314..dc38109a0b9 100644 --- a/curriculum/challenges/german/blocks/lecture-understanding-aria-expanded-aria-live-and-common-aria-states/672a54dff9dc439089f1a219.md +++ b/curriculum/challenges/german/blocks/lecture-understanding-aria-expanded-aria-live-and-common-aria-states/672a54dff9dc439089f1a219.md @@ -15,6 +15,8 @@ Da der Lesefokus bei Screenreadern immer nur an einer Stelle gleichzeitig sein k Es gibt drei mögliche Werte für dieses Attribut, die sich nach der Priorität der Information richten. +## Der Wert `assertive` + Wenn Sie `aria-live` auf den Wert `assertive` setzen, bedeutet das, dass das Update sehr wichtig ist. Es hat die höchste Priorität, sodass der Nutzende sofort benachrichtigt werden sollte. Das bedeutet, dass der Screenreader jede gerade laufende Ansage unterbricht, um die Inhaltsänderung in der Live-Region anzukündigen. Solche Unterbrechungen können sehr störend sein, daher sollte der Wert `assertive` nur für zeitkritische oder wichtige Benachrichtigungen verwendet werden. @@ -81,6 +83,8 @@ document.addEventListener("DOMContentLoaded", () => { ::: +## Der Wert `polite` + Der nächsthöhere Prioritätswert ist `polite`. Dieser Wert bedeutet, dass das Update nicht dringend ist, sodass der Screenreader warten kann, bis eine laufende Ansage beendet ist oder bis der Nutzende mit der Eingabe aufhört, bevor das Update angekündigt wird. Die meisten Live-Regionen verwenden den Wert `polite`. @@ -147,10 +151,16 @@ document.addEventListener("DOMContentLoaded", () => { ::: +## Der Wert `off` + Der Wert mit der niedrigsten Priorität für `aria-live` ist `off`, was bedeutet, dass das Update nur angekündigt wird, wenn sich der Inhalt in einem Element befindet, das gerade den Tastaturfokus hat. Realistisch gesehen wird dieser Wert fast nie verwendet, da der Anwendungsfall sehr eng ist und er nicht einheitlich (wenn überhaupt) von Screenreadern implementiert wird. Wenn Sie Live-Regionen benötigen, planen Sie, `polite` für alles außer kritischen Nachrichten zu verwenden, die `assertive` benötigen. +## Standard-Live-Regionen aus ARIA-Rollen + Es ist auch wichtig zu beachten, dass das `aria-live`-Attribut nicht erforderlich ist, wenn die aktualisierten Informationen in einem Element mit einer ARIA-Rolle von `alert`, `log`, `marquee`, `status` oder `timer` enthalten sind, da diese Rollen bereits Standardwerte für `aria-live` haben. Der Standardwert kann jedoch durch explizites Setzen von `aria-live` auf dem Element geändert werden. +## Die richtige Wertwahl + Die Wahl des richtigen `aria-live`-Werts hängt von der Priorität der aktualisierten Informationen ab. Wenn die Updates dringend sind, sollten Sie den Nutzenden sofort mit `assertive` benachrichtigen. Dies sollten Sie jedoch nur tun, wenn die Updates wirklich dringend sind, da plötzliche Unterbrechungen Nutzende verwirren und die Nutzererfahrung beeinträchtigen können. diff --git a/curriculum/challenges/german/blocks/lecture-understanding-computer-internet-and-tooling-basics/672aa578a2129554d4675049.md b/curriculum/challenges/german/blocks/lecture-understanding-computer-internet-and-tooling-basics/672aa578a2129554d4675049.md index bce79b214bd..c123550f899 100644 --- a/curriculum/challenges/german/blocks/lecture-understanding-computer-internet-and-tooling-basics/672aa578a2129554d4675049.md +++ b/curriculum/challenges/german/blocks/lecture-understanding-computer-internet-and-tooling-basics/672aa578a2129554d4675049.md @@ -11,13 +11,13 @@ Computer sind sehr leistungsstarke Maschinen, die eine Vielzahl von Aufgaben aus Als Entwickler ist es wichtig, die grundlegenden inneren Abläufe eines Computers zu verstehen. -Die erste wichtige Komponente eines Computers ist das Motherboard. Das Motherboard hält den gesamten Speicher und die Anschlüsse, die zum Betrieb des Computers benötigt werden. Es dient als Hauptplatine des Computers. +Die erste wichtige Komponente eines Computers ist das Motherboard. Das Motherboard enthält den gesamten Speicher und die Anschlüsse, die zum Betrieb des Computers benötigt werden. Es dient als Hauptplatine des Computers. -Im Computergehäuse des Motherboards finden Sie die CPU, die für Central Processing Unit steht. Die CPU ist ein Prozessor, der für das Ausführen von Anweisungen und das Durchführen von Berechnungen verantwortlich ist. Sie wird oft als das Gehirn des Computers bezeichnet. +Im Computergehäuse, auf dem Motherboard montiert, finden Sie die CPU, die für Central Processing Unit steht. Die CPU ist ein Prozessor, der für die Ausführung von Anweisungen und Berechnungen verantwortlich ist. Sie wird oft als das Gehirn des Computers bezeichnet. -Die CPU ist ein kleiner quadratischer Chip, der in den CPU-Sockel des Motherboards eingesetzt wird. Die Prozessorgeschwindigkeit der CPU wird in Gigahertz (GHz) und Megahertz (MHz) gemessen. Gigahertz sind eine Milliarde Zyklen pro Sekunde und Megahertz eine Million Zyklen pro Sekunde. +Die CPU ist ein kleiner quadratischer Chip, der in den CPU-Sockel des Motherboards eingesetzt wird. Die CPU-Geschwindigkeit wird in Gigahertz (GHz) und Megahertz (MHz) gemessen. Gigahertz entspricht einer Milliarde Zyklen pro Sekunde und Megahertz einer Million Zyklen pro Sekunde. -Die nächste wichtige Komponente eines Computers ist der Kurzzeitspeicher des Systems. Dieser ist als RAM oder Random Access Memory bekannt. RAM ist ein temporärer Speicherort für die CPU des Computers. Immer wenn der Computer schnell auf Daten zugreifen muss, verwendet er RAM. +Die nächste wichtige Komponente eines Computers ist der Kurzzeitspeicher des Systems. Dieser ist als RAM oder Random Access Memory bekannt. RAM ist ein temporärer Speicherort für die CPU des Computers. Wann immer der Computer schnell auf Daten zugreifen muss, verwendet er RAM. Je mehr RAM Ihr Computer hat, desto schneller läuft er und desto mehr Programme können Sie gleichzeitig ausführen. Wenn Ihr RAM knapp wird, läuft Ihr Computer langsamer und Sie werden den Unterschied in der Leistung bemerken. @@ -27,11 +27,11 @@ Wenn Sie Ihre Dateien speichern, werden sie auf der Festplatte abgelegt. Die Fes Die Festplatte besteht aus einer rotierenden Scheibe und einem Arm. Die Scheibe ist der Ort, an dem die Daten gespeichert werden, und der Arm wird verwendet, um Daten auf die Scheibe zu lesen und zu schreiben. Wenn Sie eine schnellere Festplatte haben, startet Ihr Computer schneller und Ihre Programme laufen schneller. -Eine andere Art der Datenspeicherung ist das Solid State Drive, kurz SSD. SSD ist nichtflüchtiger Flash-Speicher und kann anstelle einer Festplatte verwendet werden. SSDs sind schneller und kleiner als Festplatten, aber Festplatten sind günstiger und haben mehr Speicherkapazität. +Eine weitere Art der Datenspeicherung ist das Solid State Drive, kurz SSD. SSD ist nichtflüchtiger Flash-Speicher und kann anstelle einer Festplatte verwendet werden. SSDs sind schneller und kleiner als Festplatten, aber Festplatten sind günstiger und haben eine größere Speicherkapazität. Eine weitere wichtige Komponente eines Computers ist das Netzteil, oder PSU. Das PSU ist dafür verantwortlich, den Strom aus der Steckdose in eine Form umzuwandeln, die der Computer verwenden kann. Es liefert die Energie von der Steckdose an das Motherboard, die CPU und andere Komponenten des Computers. -Eine weitere wichtige Komponente sind die Erweiterungskarten. Diese Karten werden in das Motherboard eingesetzt, um dem Computer zusätzliche Funktionen hinzuzufügen. Beispiele für Erweiterungskarten sind die Grafikkarte, die Soundkarte und die Netzwerkkarte. +Eine weitere wichtige Komponente ist die Erweiterungskarte. Diese Karten werden in das Motherboard eingesetzt, um dem Computer zusätzliche Funktionen hinzuzufügen. Beispiele für Erweiterungskarten sind die Grafikkarte, Soundkarte und Netzwerkkarte. Die Grafikkarte, auch bekannt als Graphics Processing Unit oder GPU, ist für das Rendern von Bildern auf dem Computerbildschirm verantwortlich. @@ -141,7 +141,7 @@ Den Computer mit dem Internet verbinden. --- -Das Speichern von Kurzzeitspeicher. +Speicherung von Kurzzeitspeicher. ### --feedback-- diff --git a/curriculum/challenges/german/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab82c1a9bbd0e3aabc39d.md b/curriculum/challenges/german/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab82c1a9bbd0e3aabc39d.md index d95f1ca8ce2..d543bbe3f77 100644 --- a/curriculum/challenges/german/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab82c1a9bbd0e3aabc39d.md +++ b/curriculum/challenges/german/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab82c1a9bbd0e3aabc39d.md @@ -7,11 +7,11 @@ dashedName: how-to-effectively-work-with-your-keyboard-mouse-and-other-pointing- # --description-- -Viele von Ihnen sind es gewohnt, seit Jahren mit Ihrer Tastatur und Maus für verschiedene Aktivitäten zu arbeiten, wie zum Beispiel beim Spielen, bei der Erledigung von Aufgaben für die Arbeit oder beim Surfen im Web. +Viele von Ihnen arbeiten seit Jahren mit Ihrer Tastatur und Maus für verschiedene Aktivitäten wie Gaming, das Erledigen von Aufgaben für die Arbeit oder das Surfen im Web. Aber eine längere falsche Nutzung dieser Geräte kann langfristig zu ernsthaften Gesundheitsproblemen führen. -In dieser Lektion behandeln wir Möglichkeiten, wie Sie mit der Tastatur und Maus Ihres Computers gesundheitsbewusst arbeiten können. +In dieser Lektion behandeln wir Möglichkeiten, wie Sie mit der Tastatur und Maus Ihres Computers auf gesunde Weise arbeiten können. Der erste Tipp ist, auf den Griff der Maus zu achten. Wenn Sie an wichtigen Aufgaben für die Arbeit oder während intensiver Spielsituationen arbeiten, neigen Sie möglicherweise dazu, die Maus zu fest zu halten. Das kann jedoch zu ernsthaften Problemen mit Hand und Handgelenk führen. Um das zu vermeiden, sollten Sie die Maus sanft halten und Ihre Finger entspannt lassen. @@ -25,7 +25,7 @@ Sie sollten auch auf Ihre gesamte Körperhaltung achten, wenn Sie längere Zeit Während eine gute Haltung wichtig ist, betont die moderne Ergonomie die Bedeutung von Bewegung und dynamischem Sitzen. Der menschliche Körper ist für Bewegung ausgelegt, und das Verharren in einer festen Position, selbst in einer geraden, über längere Zeit, kann kontinuierlichen Druck auf die Wirbelsäule ausüben. Regelmäßige Pausen, Positionswechsel im Tagesverlauf und eine natürliche Handgelenkhaltung können die Durchblutung verbessern, Ermüdung verringern und die langfristige Gesundheit der Wirbelsäule unterstützen. -Der letzte Tipp ist, wann immer möglich Tastenkombinationen zu verwenden, um das Tippen zu minimieren. Es gibt Dutzende von Shortcuts für Aufgaben wie das Navigieren im Web, das Arbeiten im Betriebssystem, das Arbeiten in einem Code-Editor und mehr. Es ist also ratsam, einige dieser Tastenkombinationen zu recherchieren und in Ihre tägliche Computerarbeit einzubauen. +Der letzte Tipp ist, wann immer möglich Tastenkombinationen zu verwenden, um das Greifen zur Maus zu reduzieren. Es gibt Dutzende von Shortcuts für Aufgaben wie das Navigieren im Web, das Navigieren im Betriebssystem, das Arbeiten in einem Code-Editor und mehr. Es ist also am besten, einige dieser Tastenkombinationen zu recherchieren und sie in Ihre tägliche Computernutzung zu integrieren. Wenn Sie weiterhin Ihre Maus und Tastatur für kommende Coding-Projekte und andere Aktivitäten verwenden, denken Sie daran, diese Gesundheitstipps zu beachten. @@ -109,7 +109,7 @@ Was wird für die Höhe Ihrer Maus im Verhältnis zur Tastatur empfohlen? ## --answers-- -Die Maus sollte weit über der Tastatur sein. +Die Höhe der Maus spielt keine Rolle. ### --feedback-- diff --git a/curriculum/challenges/german/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab83c4297910eade53c2e.md b/curriculum/challenges/german/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab83c4297910eade53c2e.md index 853f5df550c..eb4b15e5bb2 100644 --- a/curriculum/challenges/german/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab83c4297910eade53c2e.md +++ b/curriculum/challenges/german/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab83c4297910eade53c2e.md @@ -7,17 +7,17 @@ dashedName: what-are-the-different-types-of-internet-service-providers # --description-- -Zuerst: Was ist ein Internetdienstanbieter, oder ISP? Es ist im Grunde ein Unternehmen, das Zugang zum globalen Internetnetzwerk verkauft. Und diese Anbieter gibt es in drei verschiedenen Ebenen. +Zuerst: Was ist ein Internetdienstanbieter, oder ISP? Im Wesentlichen ist es ein Unternehmen, das Zugang zum globalen Internetnetz verkauft. Und sie gibt es in drei verschiedenen Ebenen. Die erste Ebene sind die riesigen Konglomeratunternehmen, die über die Infrastruktur verfügen, um den Großteil (wenn nicht sogar den gesamten) ihres Netzwerkverkehrs eigenständig zu bewältigen. Die zweite Ebene sind die landesweiten Anbieter, die manchmal Zugang zu Netzwerken der ersten Ebene mieten, aber auch ziemlich gut eigenständig agieren können. -Die dritte Ebene sind die kleinen Unternehmen, die sich hauptsächlich darauf konzentrieren, Internet in lokalen Märkten bereitzustellen, und dabei auf größere ISPs angewiesen sind, die ihnen die Infrastruktur bereitstellen. +Die dritte Ebene sind die kleinen Unternehmen, die sich hauptsächlich darauf konzentrieren, Internet für lokale Märkte bereitzustellen, und auf größere ISPs angewiesen sind, um ihre Infrastruktur bereitzustellen. Diese Anbieter bieten auch verschiedene Arten von Verbindungen an. -Glasfaserverbindungen nutzen Glas- oder Kunststofffasern, um Daten mittels Licht zu übertragen, was zu sehr hohen Verbindungsgeschwindigkeiten und Datenaustausch führt. +Glasfaserverbindungen basieren auf Glas- oder Kunststofffasern, um Daten mittels Licht zu übertragen, was zu sehr hohen Verbindungsgeschwindigkeiten und Datenaustausch führt. Kabelverbindungen verwenden dieselbe Infrastruktur wie ein Kabel-TV-Anbieter, was sie in vielen Regionen oft leicht verfügbar macht. @@ -25,7 +25,7 @@ DSL-Verbindungen nutzen die Infrastruktur, die auch für Festnetztelefonie verwe Einwahlverbindungen nutzen ebenfalls die Telefonleitungen, erfordern aber eine exklusive Verbindung (die Nutzung der Leitung für Telefonzwecke wird während der Internetverbindung deaktiviert). Dies ist eine viel ältere Technologie, die kaum noch verwendet wird. -Satellitenverbindungen verwenden ein Netzwerk von Satelliten, die die Erde umkreisen, um verschiedene Geräte weltweit zu verbinden. Und schließlich nutzt ein 5G-Heim-Internet-Anbieter ähnlich wie bei Satelliten die Infrastruktur von Mobilfunkmasten, um Sie online zu halten. +Satellitenverbindungen nutzen ein Array von Satelliten, die die Erde umkreisen, um verschiedene Geräte weltweit zu verbinden. Und schließlich nutzt ein 5G-Heiminternet-Anbieter ähnlich wie diese die Infrastruktur von Mobilfunkmasten, um Sie online zu halten. Das sollte Ihnen einen grundlegenden Überblick darüber geben, welche Arten von Internetdienstanbietern und Internetverbindungen es gibt! @@ -69,7 +69,7 @@ Internationale Organisationen, die den globalen Internetzugang überwachen. ## --text-- -Welche Art von Internetverbindung nutzt Glas- oder Kunststofffasern, um Daten mittels Licht zu übertragen? +Welche Art von Internetverbindung verwendet Glas- oder Kunststofffasern, um Daten mittels Licht zu übertragen? ## --answers-- @@ -121,7 +121,7 @@ Sie erfordern die exklusive Nutzung der Telefonleitung während der Verbindung. --- -Sie verwenden ein Netzwerk von Satelliten, die die Erde umkreisen. +Sie nutzen ein Array von Satelliten, die die Erde umkreisen. ### --feedback-- diff --git a/curriculum/challenges/german/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab8573f32480f192aaae1.md b/curriculum/challenges/german/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab8573f32480f192aaae1.md index a3ba712a8ba..a8388fc8912 100644 --- a/curriculum/challenges/german/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab8573f32480f192aaae1.md +++ b/curriculum/challenges/german/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab8573f32480f192aaae1.md @@ -9,7 +9,7 @@ dashedName: what-are-the-different-types-of-tools-professional-developers-use Professionelle Entwickler verlassen sich auf eine Vielzahl von Tools, um Produktivität und Codequalität zu steigern. Lernen wir diese Tools kennen, einschließlich derjenigen, die sehr offensichtlich erscheinen. -An erster Stelle unter den Tools stehen Computer. Ein Computer ist die primäre Entwicklungsumgebung. Es kann ein leistungsstarker Desktop oder ein tragbarer Laptop mit Windows, macOS oder Linux als Betriebssystem sein. +Das erste Werkzeug ist der Computer selbst. Ein Computer ist die primäre Entwicklungsumgebung. Es kann ein leistungsstarker Desktop oder ein tragbarer Laptop mit Windows, macOS oder Linux als Betriebssystem sein. Professionelle Entwickler entscheiden sich oft für Computer mit schneller Rechenleistung und viel RAM, um ressourcenintensive Aufgaben zu bewältigen. @@ -21,7 +21,7 @@ Visual Studio Code (VS Code) ist im Wesentlichen ein Code-Editor, bietet aber au Weitere Code-Editoren sind Sublime Text, Atom, Notepad++ und Brackets. -Wenn Sie Code mit Code-Editoren und IDEs schreiben, müssen Sie die Änderungen, die Sie daran vornehmen, verfolgen. Das Tool, das Ihnen erlaubt, diese Änderungen zu verfolgen, ist ein Versionskontrollsystem. +Wenn Sie mit Code-Editoren und IDEs Code schreiben, müssen Sie die Änderungen, die Sie an diesem Code vornehmen, nachverfolgen. Das Werkzeug, das Ihnen erlaubt, diese Änderungen zu verfolgen, ist ein Versionskontrollsystem. Git ist das am weitesten verbreitete Versionskontrollsystem in der Entwickler-Community. @@ -31,8 +31,8 @@ Paketmanager sind ein weiteres wichtiges Tool. Sie helfen Entwicklern, den Proze Beispiele für beliebte Paketmanager sind: -* NPM, Yarn und PNPM für JavaScript -* PIP für Python +* npm, Yarn und pnpm für JavaScript +* pip für Python * Composer für PHP * Maven für Java @@ -147,7 +147,7 @@ Denken Sie an Tools, die automatisierte Prüfungen des Codes durchführen. --- -Versionskontrollsysteme +Versionskontrollsysteme. ### --feedback-- diff --git a/curriculum/challenges/german/blocks/lecture-understanding-error-handling-and-health-checks/69f3046f4c0e76cbdd24858e.md b/curriculum/challenges/german/blocks/lecture-understanding-error-handling-and-health-checks/69f3046f4c0e76cbdd24858e.md index 5173ade99a5..79151edbbbf 100644 --- a/curriculum/challenges/german/blocks/lecture-understanding-error-handling-and-health-checks/69f3046f4c0e76cbdd24858e.md +++ b/curriculum/challenges/german/blocks/lecture-understanding-error-handling-and-health-checks/69f3046f4c0e76cbdd24858e.md @@ -34,7 +34,7 @@ Sie definieren diese Middleware am Ende Ihres Middleware-Stacks. Express erkennt sie als Fehler-Handler, weil sie vier Parameter hat – den neuen `err` zusätzlich zu den üblichen `req`, `res` und `next` Parametern für andere Middleware-Funktionen. -In einer kommenden Lektion lernen Sie mehr über Fehlerbehandlungs-Middleware und wie sie in den größeren Express-Middleware-Stack passt. +Wie Sie in einer vorherigen Lektion gesehen haben, fügt sich die Middleware zur Fehlerbehandlung in den umfassenderen Express-Middleware-Stack ein. ## Wie man asynchrone Fehler behandelt diff --git a/curriculum/challenges/german/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/6733affc29df1304e2c97e88.md b/curriculum/challenges/german/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/6733affc29df1304e2c97e88.md index 1f675490ce2..0a23cb8b0e4 100644 --- a/curriculum/challenges/german/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/6733affc29df1304e2c97e88.md +++ b/curriculum/challenges/german/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/6733affc29df1304e2c97e88.md @@ -31,6 +31,8 @@ Sie beginnen mit dem `class`-Schlüsselwort, gefolgt vom Namen der Klasse. Beim Der Inhalt innerhalb der geschweiften Klammern wird als Klassenkörper bezeichnet. Hier kommen der Konstruktor und die Methoden hinein. +## Konstruktoren definieren + Der Konstruktor ist eine spezielle Methode, die automatisch aufgerufen wird, wenn ein neues Objekt aus der Klasse erstellt wird. Er wird typischerweise verwendet, um die Eigenschaften des Objekts zu initialisieren. In diesem Beispiel sehen Sie eine `Dog`-Klasse mit einem Konstruktor. @@ -45,6 +47,8 @@ class Dog { Das `this`-Schlüsselwort wird hier verwendet, um auf die aktuelle Instanz der `Dog`-Klasse zuzugreifen, sodass Sie die `name`-Eigenschaft dem gerade erstellten Objekt zuweisen können. Mehr über das `this`-Schlüsselwort lernen Sie in einer zukünftigen Lektion. +## Methoden definieren + Unterhalb des Konstruktors können Sie Methoden definieren. Methoden sind Funktionen, die innerhalb einer Klasse definiert sind und Aktionen oder Operationen ausführen. Sie dienen dazu, Verhaltensweisen zu definieren, die Instanzen der Klasse ausführen können. Hier ist ein Beispiel, wie Sie der `bark`-Klasse eine Methode namens `Dog` hinzufügen. @@ -63,6 +67,8 @@ class Dog { Wenn die `bark`-Methode aufgerufen wird, wird die Nachricht mit dem tatsächlich übergebenen Namen in der Konsole ausgegeben. Wenn Sie eine `Dog`-Instanz mit dem Namen `"Buddy"` erstellen, wird durch den Aufruf der `bark()`-Methode dieser Instanz `"Buddy says woof!"` in der Konsole ausgegeben. +## Eine Klasse instanziieren + Sobald Sie Ihre Klasse definiert haben, können Sie eine Instanz der Klasse mit dem `new`-Schlüsselwort, dem Namen der Klasse und deren Argumenten erstellen. In diesem Beispiel erstellen wir eine neue `Dog`-Instanz mit dem Namen `Gino` und weisen sie dann der Variablen `dog` zu. @@ -73,7 +79,9 @@ const dog = new Dog("Gino"); Wenn Sie `new Dog("Gino")` in Ihrem Code schreiben, wird das neue Objekt erstellt und der Konstruktor automatisch mit den angegebenen Argumenten aufgerufen. -Sie können dann auf diese Eigenschaft mit der Punktnotation zugreifen, wie Sie in der folgenden Codezeile sehen können: +## Auf Eigenschaften und Methoden zugreifen + +Sie können dann mit der Punktnotation auf die `name`-Eigenschaft zugreifen, wie Sie in der folgenden Codezeile sehen können: ```js console.log(dog.name); @@ -127,6 +135,8 @@ dog.bark(); ::: +## Verwendung von Klassenausdrücken + Wie bereits erwähnt, können Sie Klassen auch als Klassen-Ausdruck definieren. Dabei ist die Klasse anonym und wird einer Variablen zugewiesen. So sieht das vorherige Beispiel als Klassen-Ausdruck aus: diff --git a/curriculum/challenges/german/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/673403ca2bb16658309e3632.md b/curriculum/challenges/german/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/673403ca2bb16658309e3632.md index 76990834a2f..ae6aa28cf5e 100644 --- a/curriculum/challenges/german/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/673403ca2bb16658309e3632.md +++ b/curriculum/challenges/german/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/673403ca2bb16658309e3632.md @@ -11,6 +11,8 @@ Sie haben gelernt, dass Klassen wie Baupläne sind, die Sie verwenden können, u Diese Baupläne benötigen eine allgemeine Möglichkeit, auf das spezifische Objekt zuzugreifen, das im Code gerade erstellt, aufgerufen oder verändert wird. Genau dafür wird das `this`-Schlüsselwort verwendet. Es bezieht sich auf den Kontext, in dem der Code ausgeführt werden soll. Wenn Sie es innerhalb einer Methode verwenden, ist der Wert von `this` eine Referenz auf das Objekt, das mit dieser Methode verbunden ist. So können Sie auf die Eigenschaften und Methoden des Objekts innerhalb der Klasse zugreifen und die Methode für verschiedene Objekte wiederverwenden. +## Konstruktoren + Zum Beispiel haben wir hier eine `Dessert`-Klasse. Diesmal definieren wir eine `hasPeanuts`-Eigenschaft. ```js @@ -33,6 +35,8 @@ this.hasPeanuts = hasPeanuts; Das ist im Kontext des Konstruktors, aber Sie können das `this`-Schlüsselwort auch innerhalb anderer Methoden verwenden. +## Methoden + Dies ist unsere `Dessert`-Klasse mit einigen Änderungen. Jetzt haben wir zwei Eigenschaften: `name` und `price`. ```js @@ -91,10 +95,16 @@ Der Name und der Preis des aktuellen Objekts (`brownie`) werden im String ersetz Das ist alles dank des `this`-Schlüsselworts möglich, das Ihnen eine allgemeine Möglichkeit gibt, auf das aktuelle Objekt innerhalb der Klasse zuzugreifen. So können Sie die Methode für verschiedene Objekte wiederverwenden. +## Funktionen und Pfeilfunktionen + Das ist im Kontext von Objektmethoden, aber das `this`-Schlüsselwort hat auch in eigenständigen Funktionen und Pfeilfunktionen einen Wert. +### Reguläre Funktionen + Sein Wert innerhalb einer eigenständigen Funktion bezieht sich typischerweise auf das globale Objekt (im Non-Strict-Modus) oder `undefined` (im Strict-Modus). +### Pfeilfunktionen + Der Wert des `this`-Schlüsselworts ist bei Pfeilfunktionen etwas anders. Pfeilfunktionen erben den Wert von `this` aus dem umgebenden Gültigkeitsbereich, in dem sie definiert sind. Sie erzeugen keine eigene `this`-Bindung. Das bedeutet, dass der Wert von `this` vom Kontext abhängt, in dem die Pfeilfunktion definiert ist, nicht davon, wo oder wie die Pfeilfunktion aufgerufen wird. Das macht Pfeilfunktionen hilfreich für Callbacks oder um den Kontext zu bewahren. Aufgrund dessen bezieht sich der Wert von `this` in Objektmethoden nicht auf das aktuelle Objekt, was Sie bei der Arbeit mit Pfeilfunktionen beachten sollten. diff --git a/curriculum/challenges/german/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5160.md b/curriculum/challenges/german/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5160.md index c03f0cb49b8..62e46267664 100644 --- a/curriculum/challenges/german/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5160.md +++ b/curriculum/challenges/german/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5160.md @@ -14,17 +14,17 @@ Trotz dieser Unterschiede folgt der Prozess, eine Idee in einen Webstandard zu v 1. ## Bedarf erkennen Standards entstehen aus Reibungen, zum Beispiel wenn Entwickler auf eine Wand stoßen, Browser dasselbe Verhalten auf inkompatible Weise umsetzen oder eine neue Fähigkeit von der Plattform einfach noch nicht unterstützt wird. Irgendjemand wird so frustriert, dass er es aufschreibt. Diese Person kann jeder sein: ein Entwickler, ein großes Unternehmen mit einem Produktbedarf oder ein Ingenieur in einem Browserteam. Wichtig ist in diesem Stadium nicht die Autorität, sondern Belege und Fragen, ob das Problem real ist und ob genug Leute darauf stoßen, um die Aufmerksamkeit der Webplattform zu rechtfertigen. -1. **Vorschlag und erste Diskussion** - Die Idee wird informell in einem GitHub-Issue, einem kurzen Dokument oder einem Erklärtext festgehalten, der das Problem beschreibt und eine mögliche Lösung skizziert. Ziel ist es nicht, eine fertige Spezifikation zu erstellen, sondern herauszufinden, ob das Problem Anklang findet. Erkennen andere Entwickler es? Haben Browserhersteller Interesse? Gibt es eine offensichtliche Lösung oder mehrere konkurrierende? Bei TC39 entspricht diese frühe Phase Stage 0 und Stage 1. Im W3C passiert das oft informell in einer Community Group, bevor eine formelle Working Group eingesetzt wird. WHATWG behandelt das über offene GitHub-Diskussionen in seinen Kern-Repositories. Der Ort unterscheidet sich, aber die Funktion ist dieselbe. +1. ## Vorschlag und erste Diskussion + Die Idee wird informell über ein GitHub-Issue, ein kurzes Dokument oder eine Erklärung festgehalten, die das Problem beschreibt und eine mögliche Lösung skizziert. In diesem Stadium ist das Ziel nicht, eine fertige Spezifikation zu erstellen, sondern herauszufinden, ob das Problem Anklang findet. Erkennen andere Entwickler es? Haben Browser-Hersteller Interesse? Gibt es eine offensichtliche Lösung oder mehrere konkurrierende? Bei TC39 entspricht diese frühe Phase den Stufen 0 und 1. Beim W3C geschieht dies oft informell in einer Community Group, bevor eine formelle Working Group eingesetzt wird. Die WHATWG behandelt dies durch offene GitHub-Diskussionen in ihren Kern-Repositories. Der Ort unterscheidet sich, aber die Funktion ist dieselbe. -1. **Die Spezifikation schreiben** - Wenn der Vorschlag an Fahrt gewinnt, muss jemand oder ein kleines Team die eigentliche Spezifikation, das Spec, schreiben. Eine Spezifikation ist kein Blogbeitrag oder Tutorial, sondern ein präzises, formales Dokument, das genau beschreibt, wie eine Funktion sich in jeder möglichen Situation verhalten muss. Randfälle, Fehlerbedingungen, Wechselwirkungen mit bestehenden Funktionen und Sicherheitsaspekte müssen durchdacht und dokumentiert werden. +1. ## Schreiben der Spezifikation + Wenn der Vorschlag an Fahrt gewinnt, muss jemand oder ein kleines Team die eigentliche Spezifikation, oder Spec, schreiben. Eine Spec ist kein Blogbeitrag oder Tutorial, sondern ein präzises, formelles Dokument, das genau beschreibt, wie eine Funktion in jeder möglichen Situation funktionieren muss. Randfälle, Fehlerbedingungen, Wechselwirkungen mit bestehenden Funktionen und Sicherheitsaspekte müssen alle durchdacht und dokumentiert werden. -1. **Überprüfung, Einwände und Iteration** - Der Entwurf wird veröffentlicht und öffentlich sowie von anderen Browserherstellern überprüft. Hier findet die meiste Arbeit statt. Es werden Einwände erhoben, und die Spezifikation wird überarbeitet. Eine Funktion, die eine große Browser-Engine nicht implementieren will, wird selten Standard, egal wie technisch gut sie ist. Der Konsensbildungsprozess kann lange dauern. Manche Vorschläge stocken jahrelang, während Hersteller über Design-Details verhandeln. Andere sterben ganz, wenn klar wird, dass keine Einigung möglich ist. +1. ## Überprüfung, Einwände und Iteration + Der Entwurf wird veröffentlicht und öffentlich sowie von anderen Browser-Herstellern überprüft. Hier findet die meiste Arbeit statt. Es werden Einwände erhoben, und die Spec wird überarbeitet. Eine Funktion, die von einer großen Browser-Engine nicht implementiert wird, wird selten zum Standard, unabhängig von ihren technischen Vorzügen. Der Konsensbildungsprozess kann in diesem Stadium lange dauern. Manche Vorschläge stocken jahrelang, während Hersteller über Design-Details verhandeln. Andere sterben ganz, wenn klar wird, dass keine Einigung möglich ist. -1. **Implementierung und Testen** - Sobald eine Spezifikation stabil genug ist, beginnen Browserhersteller mit der Implementierung. Meist startet das mit einem Feature-Flag, damit die Funktion getestet werden kann, ohne bestehende Nutzer zu beeinträchtigen. Die Implementierung deckt oft Probleme auf, die die Spezifikation nicht vorhergesehen hat, die dann zur Klärung an die Autoren zurückgehen. Eine gemeinsame Testsuite überprüft, ob jede Implementierung sich tatsächlich gleich verhält. Wenn Chrome, Firefox und Safari alle dieselben Tests bestehen, funktioniert die Spezifikation. Wenn sie abweichen, ist entweder die Spezifikation unklar oder eine Implementierung hat einen Bug. +1. ## Implementierung und Testen + Sobald eine Spec stabil genug ist, beginnen die Browser-Hersteller mit der Implementierung. Dies startet meist mit einem Feature-Flag, damit die Funktion getestet werden kann, ohne bestehende Nutzer zu beeinträchtigen. Die Implementierung zeigt oft Probleme auf, die die Spec nicht vorhergesehen hat, welche dann zur Klärung an die Herausgeber zurückgehen. Eine gemeinsame Test-Suite überprüft, ob jede Implementierung tatsächlich gleich funktioniert. Wenn Chrome, Firefox und Safari alle dieselben Tests bestehen, funktioniert die Spec. Wenn sie abweichen, ist entweder die Spec unklar oder eine der Implementierungen hat einen Bug. 1. ## Finalisierung Wenn mehrere unabhängige Implementierungen existieren, die Tests bestanden sind und die Community zufrieden ist, wird der Standard finalisiert. Im W3C bedeutet das den Erhalt des Recommendation-Status. Bei TC39 heißt das Erreichen von Stage 4, wonach die Funktion in die nächste jährliche ECMAScript-Version aufgenommen wird. Bei WHATWG gibt es keinen einzelnen Finalisierungsmoment, der lebende Standard spiegelt einfach den aktuellen Konsens wider und wird kontinuierlich aktualisiert. Der gesamte Prozess kann von wenigen Monaten für eine kleine, unstrittige Ergänzung bis zu über einem Jahrzehnt für etwas Komplexes oder politisch heikles dauern. CSS Grid wurde zum Beispiel erstmals 2011 vorgeschlagen und erst 2017 in allen großen Browsern ausgeliefert. Diese Zeitspanne zwischen einer guten Idee und einem stabilen, universell unterstützten Standard ist der Ort, an dem die meiste Arbeit des offenen Webs still und leise passiert. diff --git a/curriculum/challenges/german/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5161.md b/curriculum/challenges/german/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5161.md index dc9e47da094..ff134882803 100644 --- a/curriculum/challenges/german/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5161.md +++ b/curriculum/challenges/german/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5161.md @@ -13,23 +13,23 @@ Der Lebenszyklus einer Webstandard-Funktion ist ähnlich, aber auf einer detaill Betrachten Sie den Prozess als Regelwerk und den Lebenszyklus als das, was tatsächlich passiert, wenn Sie das Spiel spielen. -1. **Vorschlag** - Jede Funktion beginnt mit einem Problem, das jemand wichtig genug fand, um es aufzuschreiben. Ein Entwickler, ein Browser-Ingenieur oder ein Unternehmen erstellt ein GitHub-Issue oder eine Erklärung, die beschreibt, was das Web derzeit nicht kann und warum es das können sollte. In diesem Stadium ist die Idee noch vage, mit mehr Fragen als Antworten. Das Ziel ist einfach herauszufinden, ob noch jemand dasselbe Problem erkennt. +1. ## Vorschlag + Jede Funktion beginnt mit einem Problem, das jemand wichtig genug fand, um es aufzuschreiben. Ein Entwickler, ein Browser-Ingenieur oder ein Unternehmen erstellt ein GitHub-Issue oder eine Erklärung, die beschreibt, was das Web derzeit nicht kann und warum es das können sollte. In diesem Stadium ist die Idee noch vage, mit mehr Fragen als Antworten. Das Ziel ist einfach herauszufinden, ob noch jemand denselben Schmerz erkennt. -1. **Inkubation** - Wenn der Vorschlag Anklang findet, beginnt eine Phase offener Diskussion und erster Entwürfe. Konkurrenzierende Ansätze werden skizziert, Anwendungsfälle gesammelt und die Community testet die Idee auf Herz und Nieren. Viele Vorschläge sterben hier, möglicherweise weil das Problem zu speziell ist oder keine Lösung alle zufriedenstellt. Die überlebenden Vorschläge erhalten eine klarere Form und zumindest etwas Interesse von Browser-Herstellern. +1. ## Inkubation + Wenn der Vorschlag Anklang findet, beginnt eine Phase offener Diskussion und früher Gestaltung. Konkurrenzierende Ansätze werden skizziert, Anwendungsfälle gesammelt und die Community testet die Idee auf Herz und Nieren. Viele Vorschläge sterben hier, möglicherweise weil sich das Problem als zu speziell herausstellt oder keine Lösung alle zufriedenstellen kann. Diejenigen, die überleben, erhalten eine klarere Form und zumindest etwas Interesse von Browser-Herstellern. -1. **Spezifikation** +1. ## Spezifikation Ein überlebender Vorschlag wird als formale Spezifikation ausgearbeitet. Jeder Randfall, Fehlerzustand und jede Interaktion mit bestehenden Funktionen muss klar definiert sein. Hier trifft eine gute Idee auf die harte Realität. Vage Konzepte müssen zu genauen Regeln werden, die zwei unabhängige Entwickler identisch lesen und implementieren können. -1. **Interoperabilitätstests** - Bevor eine Funktion als stabil gilt, muss sie in jedem Browser gleich funktionieren. Die W3C Web Platform Tests-Suite ist das Hauptwerkzeug zur Überprüfung. Es handelt sich um eine gemeinsame Testsammlung, die Chrome, Firefox, Safari und andere gegen ihre Implementierungen ausführen. Abweichende Ergebnisse bedeuten entweder, dass die Spezifikation unklar ist oder jemand einen Bug hat. Beides muss gelöst werden, bevor die Funktion weiterkommt. +1. ## Interoperabilitätstests + Bevor eine Funktion als stabil gilt, muss sie in jedem Browser gleich funktionieren. Die W3C Web Platform Tests-Suite ist das Hauptwerkzeug zur Überprüfung. Es ist eine gemeinsame Testsammlung, die Chrome, Firefox, Safari und andere gegen ihre Implementierungen ausführen. Abweichende Ergebnisse bedeuten entweder, dass die Spezifikation unklar ist, oder dass jemand einen Bug hat. Beides muss gelöst werden, bevor die Funktion weiterkommt. -1. **Finalisierung** - Sobald mehrere unabhängige Implementierungen die Tests bestehen, wird die Funktion finalisiert. Für die W3C ist sie eine Empfehlung, für TC39 ist sie Stufe 4, und sie ist ein stabiler Eintrag im WHATWG-Living-Standard. Die Flags werden entfernt und die Funktion wird an die Nutzer ausgeliefert. Ab diesem Zeitpunkt ist sie Teil der Baseline-Webplattform, auf die sich jeder Entwickler dauerhaft verlassen kann. +1. ## Finalisierung + Sobald mehrere unabhängige Implementierungen die Tests bestehen, wird die Funktion finalisiert. Für die W3C ist es eine Empfehlung, für TC39 ist es Stufe 4, und es ist ein stabiler Eintrag im WHATWG-Living-Standard. Die Warnhinweise werden entfernt und die Funktion wird an die Nutzer ausgeliefert. Ab diesem Zeitpunkt ist sie Teil der Basis-Webplattform, auf die sich jeder Entwickler dauerhaft verlassen kann. -1. **Veraltung** - Nicht jeder Standard altert gut. Manche Funktionen werden durch bessere ersetzt, andere haben Sicherheits- oder Datenschutzprobleme, die damals nicht erkennbar waren. Wenn eine Funktion entfernt werden muss, wird sie offiziell veraltet. Das heißt, sie wird weiterhin unterstützt, aber als etwas markiert, das Entwickler nicht mehr verwenden sollten. Schließlich wird sie aus der Spezifikation entfernt. Die Entfernung aus den Browsern erfolgt langsam und vorsichtig, weil das Kernversprechen des Webs ist, dass alte Seiten weiterhin funktionieren. Manche veralteten Funktionen bleiben Jahrzehnte in Browsern allein aus Rückwärtskompatibilitätsgründen. +1. ## Veraltung + Nicht jeder Standard altert gut. Manche Funktionen werden durch bessere ersetzt, andere stellen sich als sicherheits- oder datenschutzkritisch heraus, was damals nicht erkennbar war. Wenn eine Funktion entfernt werden muss, wird sie formell veraltet erklärt. Das heißt, sie wird weiterhin unterstützt, aber als etwas markiert, das Entwickler nicht mehr verwenden sollten. Schließlich wird sie aus der Spezifikation entfernt. Die Entfernung aus den Browsern erfolgt langsam und vorsichtig, weil das Kernversprechen des Webs ist, dass alte Seiten weiterhin funktionieren. Manche veralteten Funktionen bleiben Jahrzehnte in Browsern allein aus Rückwärtskompatibilitätsgründen erhalten. # --questions-- diff --git a/curriculum/challenges/german/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5162.md b/curriculum/challenges/german/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5162.md index 0571a47ec68..cbf644ce165 100644 --- a/curriculum/challenges/german/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5162.md +++ b/curriculum/challenges/german/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5162.md @@ -9,26 +9,26 @@ dashedName: what-are-the-key-principles-that-web-standards-are-built-on Webstandards sind nicht nur technische Dokumente, sie spiegeln eine Reihe von Werten wider, wie das Web sein sollte und wem es dienen soll. Wenn Sie diese Grundsätze verstehen, sehen Sie nicht nur, wie das Web funktioniert, sondern auch, warum es so aufgebaut wurde, wie es ist. Lassen Sie uns diese Grundsätze besprechen. -1. **Offenheit** - Webstandards werden offen entwickelt und lizenzfrei implementiert. Jeder kann die Spezifikationen lesen, jeder kann einen Browser bauen, und kein Unternehmen darf Lizenzgebühren für die Implementierung eines Standards verlangen. Diese Offenheit unterscheidet das Web von proprietären Plattformen und ermöglicht es kleinen Teams, Werkzeuge zu entwickeln, die Milliarden von Menschen erreichen, ohne die Erlaubnis eines Gatekeepers einzuholen. +1. ## Offenheit + Webstandards werden offen entwickelt und lizenzgebührenfrei implementiert. Jeder kann die Spezifikationen lesen, jeder kann einen Browser bauen, und kein Unternehmen darf Lizenzgebühren für die Implementierung eines Standards verlangen. Diese Offenheit unterscheidet das Web von proprietären Plattformen und ermöglicht es kleinen Teams, Werkzeuge zu entwickeln, die Milliarden von Menschen erreichen, ohne die Erlaubnis eines Gatekeepers einzuholen. -1. **Barrierefreiheit** - Das Web wurde so gestaltet, dass es von allen genutzt werden kann, unabhängig von ihren Fähigkeiten. Barrierefreiheit ist kein Add-on zu Webstandards, sie ist in das Design von HTML, CSS und dem Verhalten der Browser eingebaut. Die WCAG-Richtlinien des W3C setzen die formalen Maßstäbe dafür, was Barrierefreiheit in der Praxis bedeutet. Eine Funktion, die Barrieren für Menschen schafft, die Screenreader, Tastaturnavigation oder Hilfstechnologie verwenden, gilt als von vornherein mangelhaft, nicht nur aus ethischen Gründen. +1. ## Barrierefreiheit + Das Web wurde so gestaltet, dass es von allen genutzt werden kann, unabhängig von ihren Fähigkeiten. Barrierefreiheit ist kein Add-on zu Webstandards, sondern ist in das Design von HTML, CSS und dem Verhalten der Browser eingebaut. Die WCAG-Richtlinien des W3C setzen die formalen Maßstäbe dafür, was Barrierefreiheit in der Praxis bedeutet. Eine Funktion, die Barrieren für Menschen schafft, die Screenreader, Tastaturnavigation oder Hilfstechnologie verwenden, gilt als von vornherein mangelhaft, nicht nur aus ethischen Gründen. -1. **Interoperabilität** - Der grundlegendste Grundsatz ist, dass das Web überall gleich funktionieren sollte. Eine Seite, die nach Standard gebaut ist, sollte sich in Chrome, Firefox und Safari sowie auf Windows, macOS, Linux, Android und iOS identisch verhalten. Ohne Interoperabilität zerfällt das Web in eine Sammlung browserspezifischer Erlebnisse, und Entwickler müssen dasselbe mehrfach schreiben. Jeder Standard existiert im Kern, um das zu verhindern. +1. ## Interoperabilität + Das grundlegendste Prinzip ist, dass das Web überall gleich funktionieren sollte. Eine Seite, die nach Standard gebaut ist, sollte sich in Chrome, Firefox und Safari sowie auf Windows, macOS, Linux, Android und iOS identisch verhalten. Ohne Interoperabilität zerfällt das Web in eine Sammlung browserspezifischer Erlebnisse, und Entwickler müssen dasselbe mehrfach schreiben. Jeder Standard existiert im Kern, um genau das zu verhindern. -1. **Abwärtskompatibilität** - Das Web verpflichtet sich nahezu uneingeschränkt dazu, alte Inhalte nicht zu zerstören. Eine Seite, die 1999 geschrieben wurde, sollte in einem modernen Browser immer noch korrekt dargestellt werden, und Standardisierungsgremien nehmen diese Verpflichtung ernst, wenn sie neue Funktionen entwerfen. Deshalb werden neue Fähigkeiten auf bestehende aufgebaut, anstatt sie zu ersetzen. Das ist eine Einschränkung, die Designer manchmal frustriert, aber sie macht das Web als Plattform einzigartig langlebig. +1. ## Rückwärtskompatibilität + Das Web verpflichtet sich nahezu uneingeschränkt dazu, alte Inhalte nicht zu zerstören. Eine Seite, die 1999 geschrieben wurde, sollte in einem modernen Browser immer noch korrekt dargestellt werden, und Standardisierungsgremien nehmen diese Verpflichtung ernst, wenn sie neue Funktionen entwerfen. Deshalb werden neue Fähigkeiten oben draufgelegt, anstatt das Vorherige zu ersetzen. Das ist eine Einschränkung, die Designer manchmal frustriert, aber sie macht das Web auch als Plattform einzigartig langlebig. -1. **Datenschutz und Sicherheit** - Moderne Standards werden vor ihrer Veröffentlichung auf Datenschutz- und Sicherheitsaspekte überprüft. Neue APIs, die Benutzerdaten verfügbar machen oder Tracking ermöglichen könnten, unterliegen im Standardisierungsprozess einer intensiven Prüfung. Der Grundsatz ist, dass die Plattform die Nutzer standardmäßig schützen soll und der Komfort für Entwickler niemals auf Kosten der Sicherheit der Nutzer gehen darf. +1. ## Datenschutz und Sicherheit + Moderne Standards werden vor ihrer Veröffentlichung auf Datenschutz- und Sicherheitsaspekte überprüft. Neue APIs, die Benutzerdaten offenlegen oder Tracking ermöglichen könnten, unterliegen im Standardisierungsprozess einer intensiven Prüfung. Das Prinzip ist, dass die Plattform die Nutzer standardmäßig schützen soll und der Komfort für Entwickler niemals auf Kosten der Sicherheit der Nutzer gehen darf. -1. **Schichtung** - Das Web ist in klar abgegrenzte, kombinierbare Schichten aufgebaut: HTML für die Struktur, CSS für die Darstellung und JavaScript für das Verhalten. Standards sind so gestaltet, dass sie diese Grenzen respektieren, anstatt sie aufzulösen. Eine gut geschichtete Funktion kann schrittweise übernommen werden. Eine Seite, die kein JavaScript verwendet, funktioniert weiterhin, und ein Browser, der eine neue CSS-Eigenschaft nicht unterstützt, rendert trotzdem etwas Sinnvolles. Diese Trennung der Zuständigkeiten verleiht dem Web seine Widerstandsfähigkeit. +1. ## Schichtung + Das Web ist in klar abgegrenzte, kombinierbare Schichten aufgebaut: HTML für die Struktur, CSS für die Darstellung und JavaScript für das Verhalten. Standards sind so gestaltet, dass sie diese Grenzen respektieren, statt sie aufzulösen. Eine gut geschichtete Funktion kann schrittweise übernommen werden. Eine Seite, die kein JavaScript verwendet, funktioniert weiterhin, und ein Browser, der eine neue CSS-Eigenschaft nicht unterstützt, rendert trotzdem etwas Sinnvolles. Diese Trennung der Verantwortlichkeiten verleiht dem Web seine Widerstandsfähigkeit. -1. **Progressive Verbesserung** - Eng verbunden mit der Schichtung ist die Idee, dass das Web für alle funktionieren sollte und dann für Nutzer mit leistungsfähigeren Browsern oder Geräten besser wird. Eine Standardfunktion sollte bei fehlender Unterstützung schrittweise zurückgebaut werden, nicht komplett ausfallen. Dieser Grundsatz prägt, wie neue CSS-Eigenschaften spezifiziert werden, wie JavaScript-APIs mit fehlenden Fähigkeiten umgehen und wie Standardisierungsgremien die Kluft zwischen modernen Browsern und älteren, weltweit noch weit verbreiteten, betrachten. +1. ## Progressive Verbesserung + Eng verwandt mit der Schichtung ist die Idee, dass das Web für alle funktionieren soll und dann für Nutzer mit leistungsfähigeren Browsern oder Geräten besser wird. Eine Standardfunktion sollte bei fehlender Unterstützung elegant herunterfallen, nicht komplett ausfallen. Dieses Prinzip prägt, wie neue CSS-Eigenschaften spezifiziert werden, wie JavaScript-APIs mit fehlenden Fähigkeiten umgehen und wie Standardisierungsgremien die Kluft zwischen modernen Browsern und den älteren, weltweit noch weit verbreiteten, betrachten. # --questions-- @@ -50,7 +50,7 @@ Abwärtskompatibilität. --- -Progressive Verbesserung. +Progressive Enhancement. ### --feedback-- diff --git a/curriculum/challenges/german/blocks/lecture-user-interface-design-fundamentals/672baa97f2990e6631d522e7.md b/curriculum/challenges/german/blocks/lecture-user-interface-design-fundamentals/672baa97f2990e6631d522e7.md index 6e10bddb41b..8d4612ac14b 100644 --- a/curriculum/challenges/german/blocks/lecture-user-interface-design-fundamentals/672baa97f2990e6631d522e7.md +++ b/curriculum/challenges/german/blocks/lecture-user-interface-design-fundamentals/672baa97f2990e6631d522e7.md @@ -9,6 +9,8 @@ dashedName: how-do-you-create-good-background-and-foreground-contrast-in-your-de **HINWEIS**: Einige der interaktiven Beispiele verwenden möglicherweise CSS, das Sie noch nicht gelernt haben. Machen Sie sich keine Sorgen, wenn Sie nicht den gesamten Code verstehen. Das Ziel der Beispiele ist es, Ihnen Vorschauen zu diesen Designkonzepten zu zeigen, damit Sie besser verstehen, wie alles funktioniert. +## Kontrast verstehen + Zuerst sollten Sie sich mit dem Kontrast vertraut machen. Kontrast ist der Unterschied zwischen zwei Farben – oder wie leicht sie sich voneinander unterscheiden lassen. Farben mit höherem Kontrast sind visuell stärker unterscheidbar, während Farben mit geringerem Kontrast sich ähnlicher sehen. Zum Beispiel haben Schwarz und Weiß ein sehr hohes Kontrastverhältnis. Hellblau und Hellviolett haben dagegen einen geringeren Kontrast. @@ -53,6 +55,8 @@ Farben mit höherem Kontrast sind visuell stärker unterscheidbar, während Farb ::: +### Kontrast auf Text anwenden + Natürlich ist in diesen Beispielen die Unterscheidung durch das Layout möglicherweise klarer. Aber wie sieht es aus, wenn Sie diese Farben auf Text anwenden? Sie können schwarzen Text mit hohem Kontrast auf weißem Hintergrund haben. Und violetten Text mit geringem Kontrast auf blauem Hintergrund. :::interactive_editor @@ -96,6 +100,8 @@ Natürlich ist in diesen Beispielen die Unterscheidung durch das Layout möglich ::: +### WCAG-Kontraststandards + Aber wie bestimmen Sie, was ein „ausreichend guter“ Kontrast ist? Sie können sich nicht nur darauf verlassen, wie der Text für Sie aussieht, denn jede Nutzerin und jeder Nutzer hat eine andere Wahrnehmung. Glücklicherweise geben die Web Content Accessibility Guidelines, kurz WCAG, einen Standard dafür vor. Text mit einem Kontrastverhältnis von 4,5:1 gilt als AA-Standard, was das absolute Minimum ist, das Sie einhalten sollten, um für die meisten Nutzer zugänglich zu sein. Text mit einem Kontrastverhältnis von 7:1 gilt als AAA-Standard und gewährleistet das beste Maß an Barrierefreiheit. @@ -141,6 +147,8 @@ Text mit einem Kontrastverhältnis von 4,5:1 gilt als AA-Standard, was das absol ::: +### Vergleich von hohen und niedrigen Kontrastverhältnissen + Es gibt viele Websites, die das Kontrastverhältnis zwischen zwei Farben überprüfen können, aber die meisten Browser erlauben es Ihnen, dies direkt in den Entwicklerwerkzeugen auf Ihrer Website zu tun. Schauen wir uns noch ein paar weitere Beispiele für Kontrastverhältnisse an, um das Konzept besser zu verstehen. @@ -221,8 +229,12 @@ Dieses Beispiel erfüllt den AAA-Standard mehr als ausreichend. Nun sehen wir un Dieses Beispiel hat ein Kontrastverhältnis von 1,48:1, was nicht einmal den AA-Standard erfüllt. +## Farbwerte anpassen + Wie können Sie das beheben? Es gibt drei Aspekte, die das Kontrastverhältnis beeinflussen. +### Farbton anpassen + Der erste ist der Farbton (Hue), der die allgemeine Farbart darstellt, wie Rot, Blau oder Orange. Wechseln wir zu einem Farbton, der weiter von Blau entfernt ist. In diesem Fall verwenden wir Rot. :::interactive_editor @@ -267,6 +279,8 @@ Der erste ist der Farbton (Hue), der die allgemeine Farbart darstellt, wie Rot, ::: +### Sättigung anpassen + Leider hat diese Änderung das Kontrastverhältnis nur auf 1,49:1 erhöht, was bedeutet, dass Sie die Sättigung ändern müssen, also die „Menge“ der Farbe. Erhöhen wir den Rotanteil im Text. Damit kommen wir dem Ziel mit einem Kontrastverhältnis von 3,54:1 schon viel näher. :::interactive_editor @@ -325,6 +339,8 @@ Leider hat diese Änderung das Kontrastverhältnis nur auf 1,49:1 erhöht, was b ::: +### Helligkeit anpassen + Sie können jedoch noch näher an das Ziel kommen, indem Sie den letzten Wert ändern, nämlich die Helligkeit (Lightness). Die Helligkeit gibt an, wie viel Weiß in der Farbe enthalten ist. Verringern wir die Helligkeit des Rots. Nun ist ein viel dunkleres Rot auf dem hellblauen Hintergrund, was das Kontrastverhältnis auf 10,34:1 erhöht. @@ -451,7 +467,7 @@ Erinnern Sie sich an die spezifischen Zahlen, die für verschiedene Barrierefrei --- -4,5:1 +4.5:1 --- @@ -479,7 +495,7 @@ Welcher der folgenden Aspekte wird NICHT als Einflussfaktor auf das Kontrastverh ## --answers-- -Farbton (Hue) +Farbton ### --feedback-- @@ -495,7 +511,7 @@ Erinnern Sie sich an die drei Aspekte, die in der Lektion besprochen wurden und --- -Helligkeit (Lightness) +Helligkeit ### --feedback-- @@ -503,7 +519,7 @@ Erinnern Sie sich an die drei Aspekte, die in der Lektion besprochen wurden und --- -Deckkraft (Opacity) +Deckkraft ## --video-solution-- diff --git a/curriculum/challenges/german/blocks/lecture-what-is-css/672acc100d59d24da7b4e09c.md b/curriculum/challenges/german/blocks/lecture-what-is-css/672acc100d59d24da7b4e09c.md index 069c6079909..785d8a82f08 100644 --- a/curriculum/challenges/german/blocks/lecture-what-is-css/672acc100d59d24da7b4e09c.md +++ b/curriculum/challenges/german/blocks/lecture-what-is-css/672acc100d59d24da7b4e09c.md @@ -7,10 +7,14 @@ dashedName: what-are-the-different-types-of-css-combinators # --interactive-- +## CSS-Kombinatoren + CSS-Kombinatoren werden verwendet, um die Beziehung zwischen Selektoren in CSS zu definieren. Sie helfen dabei, Elemente basierend auf ihrer Beziehung zu anderen Elementen auszuwählen, was präziseres und effizienteres Styling ermöglicht. Wir besprechen einige der wichtigsten CSS-Kombinatoren und ihre Anwendungsfälle, beginnend mit dem Nachfahren-Kombinator. +### Nachfahre-Kombinator + Ein Nachfahre-Kombinator wird verwendet, um Elemente anzusprechen, die vom zweiten Selektor ausgewählt werden, wenn sie innerhalb eines Vorfahren-Elements verschachtelt sind, das vom ersten Selektor ausgewählt wird. Ein Vorfahre kann ein Elternteil, Großelternteil oder ein beliebiger weiter oben im Dokumentbaum liegender Vorfahre sein. Um besser zu verstehen, wie das funktioniert, schauen wir uns ein Beispiel an. @@ -42,6 +46,8 @@ In diesem Fall wäre das `figure` das Elternelement und das `img` das Kindelemen Wenn Sie mehrere Bilder innerhalb eines `figure`-Elements hätten, wäre die Verwendung des Nachfahren-Kombinators eine gute Möglichkeit, jedem dieser Bilder einen schwarzen Rahmen zu geben. +### Kind-Kombinator + Eine andere Art von Kombinator ist der Kind-Kombinator. Der Kind-Kombinator (`>`) in CSS wird verwendet, um Elemente auszuwählen, die direkte Kinder eines bestimmten Elternelements sind. @@ -102,6 +108,8 @@ Im obigen Beispiel zielen wir nur auf das direkte Kind der `container`-Klasse ab Da die anderen beiden Absatz-Elemente innerhalb von `div`-Elementen verschachtelt sind, gelten sie nicht als direkte Kinder der `container`-Klasse und erhalten daher nicht die blaue Textfarbe. +### Nächstes Geschwister-Kombinator + Ein weiterer häufiger Kombinator ist der Nachbar-Kombinator. Der Nachbar-Kombinator (`+`) in CSS wählt ein Element aus, das unmittelbar auf ein bestimmtes Geschwisterelement folgt. Dieser Kombinator ist nützlich, wenn Sie einem Element, das direkt auf ein anderes folgt, ein Styling zuweisen möchten, sodass Sie gezieltes Styling basierend auf der Position des Elements relativ zu seinen Geschwistern vornehmen können. @@ -150,6 +158,8 @@ img + figcaption { In diesem Beispiel wählt der Nachbar-Kombinator (`+`) das `figcaption`-Element aus, das unmittelbar auf das `img`-Element folgt. Die angewendete CSS-Regel fügt dem `4px solid black border` einen `figcaption` hinzu. +### Nachfolgendes Geschwister-Kombinator + Ein weiterer häufiger Kombinator ist der allgemeine Geschwister-Kombinator. Der allgemeine Geschwister-Kombinator (`~`) in CSS wählt alle Geschwister eines bestimmten Elements aus, die nach ihm kommen. @@ -202,6 +212,8 @@ In diesem Beispiel erhalten alle Absatz-Elemente, die dem `h2`-Element folgen, d Der allgemeine Geschwister-Kombinator (`~`) zielt auf alle Absatz-Geschwister ab, die nach dem `h2`-Element erscheinen, unabhängig davon, ob sie unmittelbare Geschwister sind. +## Warum CSS-Kombinatoren wichtig sind + Zusammenfassend ermöglicht Ihnen das Verständnis und die Verwendung verschiedener CSS-Kombinatoren, präzise Styles auf Ihre HTML-Elemente anzuwenden und so die Kontrolle und Flexibilität Ihres Designs zu verbessern. Wenn Sie diese Selektoren beherrschen, können Sie anspruchsvollere und gezieltere Styling-Regeln erstellen, die sowohl das Aussehen als auch die Funktionalität Ihrer Webseiten verbessern. diff --git a/curriculum/challenges/german/blocks/lecture-working-with-code-editors-and-ides/672d26269456511aa3db614d.md b/curriculum/challenges/german/blocks/lecture-working-with-code-editors-and-ides/672d26269456511aa3db614d.md index a5e5ecafe87..4de224d9b43 100644 --- a/curriculum/challenges/german/blocks/lecture-working-with-code-editors-and-ides/672d26269456511aa3db614d.md +++ b/curriculum/challenges/german/blocks/lecture-working-with-code-editors-and-ides/672d26269456511aa3db614d.md @@ -7,25 +7,25 @@ dashedName: what-is-a-code-editor-and-ide # --description-- -Sie könnten denken, dass es dasselbe ist, aber das stimmt nicht ganz. Ein Code-Editor ist jede Anwendung, mit der Sie Code-Dateien bearbeiten können. Eine IDE, oder integrierte Entwicklungsumgebung, ist eine vollständige Anwendung, mit der Sie Ihren Code kompilieren, ausführen und debuggen können, während Sie ihn bearbeiten. +Sie könnten denken, dass es dasselbe ist, aber das stimmt nicht ganz. Ein Code-Editor ist jede Anwendung, die Ihnen erlaubt, Code-Dateien zu bearbeiten. Eine IDE, oder integrierte Entwicklungsumgebung, ist eine vollständige Anwendung, die es Ihnen ermöglicht, Ihren Code zu kompilieren, auszuführen und zu debuggen, während Sie ihn bearbeiten. -Vielleicht sind einige Beispiele hilfreich. +Einige Beispiele werden helfen. Betrachten wir zuerst einige beliebte IDEs. Visual Studio ist eine integrierte Entwicklungsumgebung von Microsoft, die eine umfassende Sammlung von Werkzeugen zum Erstellen, Debuggen und Bereitstellen von Anwendungen auf verschiedenen Plattformen bietet. -Eine weitere IDE ist XCode. Xcode ist eine integrierte Entwicklungsumgebung von Apple, die für das Erstellen, Codieren und Debuggen von Anwendungen für macOS, iOS, watchOS und tvOS entwickelt wurde. +Eine weitere IDE ist Xcode. Xcode ist eine integrierte Entwicklungsumgebung von Apple, die für das Erstellen, Codieren und Debuggen von Anwendungen für macOS, iOS, watchOS und tvOS entwickelt wurde. -Und eine weitere IDE ist Android Studio. Android Studio ist eine integrierte Entwicklungsumgebung von Google, die speziell für das Erstellen, Debuggen und Testen von Android-Anwendungen entwickelt wurde. +Android Studio, entwickelt von Google, ist eine integrierte Entwicklungsumgebung, die speziell für das Erstellen, Debuggen und Testen von Android-Anwendungen konzipiert ist. Das sind nur einige Beispiele für IDEs. Schauen wir uns nun einige beliebte Code-Editoren an. Visual Studio Code ist ein leichter, quelloffener Code-Editor von Microsoft, der eine breite Palette von Programmiersprachen unterstützt und Funktionen wie Debugging, Syntaxhervorhebung und Versionskontrolle über Erweiterungen bietet. -Ein weiterer beliebter Editor ist Sublime Text. Sublime Text ist ein schneller, vielseitiger Texteditor, der für seine elegante Benutzeroberfläche, leistungsstarke Funktionen und Unterstützung für viele Programmiersprachen durch anpassbare Syntaxhervorhebung und Plugins bekannt ist. +Für ein schnelles und vielseitiges Bearbeitungserlebnis bietet Sublime Text eine elegante Benutzeroberfläche und Unterstützung für eine breite Palette von Programmiersprachen durch anpassbare Syntaxhervorhebung und Plugins. -Und ein weiterer ist Notepad++. Dies ist ein kostenloser, quelloffener Text- und Quellcode-Editor für Windows, der Syntaxhervorhebung, Code-Folding und eine Reihe von Plugins zur Steigerung der Produktivität und Anpassung bietet. +Windows-Nutzer können auch Notepad++ verwenden, einen kostenlosen, Open-Source-Text- und Quellcode-Editor, der Syntaxhervorhebung, Code-Faltung und eine Reihe von Plugins bietet, um Produktivität und Anpassung zu verbessern. -Sie haben vielleicht bemerkt, dass sich die Code-Editoren hauptsächlich auf den Textinhalt der Datei konzentrieren, während die IDEs verschiedene Werkzeuge bereitstellen, um Ihren Code zu verwalten. +Sie haben vielleicht bemerkt, dass sich die Code-Editoren hauptsächlich auf den Textinhalt der Datei konzentrieren, während die IDEs verschiedene Werkzeuge verfügbar machen, um Ihren Code zu verwalten. Diese Beispiele sind alle lokale Programme, die Sie auf Ihrem Computer ausführen können, aber es gibt auch cloudbasierte Editoren, die Sie verwenden können. @@ -35,11 +35,11 @@ Schauen wir uns einige cloudbasierte Editoren an. Replit ist eine Online-Plattform, die eine kollaborative Umgebung zum Programmieren bietet und es Benutzern ermöglicht, Code in verschiedenen Programmiersprachen direkt im Webbrowser zu schreiben, auszuführen und zu teilen. -Ein weiterer beliebter cloudbasierter Editor ist GitHub Codespaces. Dies ist eine cloudbasierte Entwicklungsumgebung, die sofortigen Zugriff auf einen vollständig konfigurierten Code-Editor und Entwicklungstools direkt von GitHub aus bietet und nahtloses Programmieren und Zusammenarbeit ermöglicht. +Ein weiterer beliebter cloudbasierter Editor ist GitHub Codespaces. Dies ist eine cloudbasierte Entwicklungsumgebung, die sofortigen Zugriff auf einen vollständig konfigurierten Code-Editor und Entwicklungstools direkt von GitHub aus bietet und nahtloses Codieren und Zusammenarbeit ermöglicht. -Und ein weiterer ist Ona. Ona ist eine cloudbasierte Entwicklungsumgebung, die sich mit GitHub und GitLab integriert und sofort anpassbare Arbeitsbereiche zum Codieren, Erstellen und Debuggen direkt im Browser bietet. +Ona integriert sich mit GitHub und GitLab, um sofortige, anpassbare Arbeitsbereiche für das Codieren, Erstellen und Debuggen direkt aus Ihrem Browser bereitzustellen. -Und es gibt noch viele weitere Optionen. Einige Optionen, wie Visual Studio Code, sind sehr erweiterbar und können mit verschiedenen Projekttypen und Sprachen arbeiten. Andere Optionen sind möglicherweise speziell auf eine kleine Teilmenge von Sprachen oder Projekttypen zugeschnitten. +Und es gibt viele weitere Optionen. Einige Optionen, wie Visual Studio Code, sind hochgradig erweiterbar und können mit vielen Projektarten und Sprachen arbeiten. Andere Optionen sind möglicherweise speziell auf eine kleine Teilmenge von Sprachen oder Projektarten zugeschnitten. Die Anwendung, die Sie verwenden, kann je nach Projekt unterschiedlich sein. Sie sollten die Optionen erkunden, um herauszufinden, was am besten zu Ihren Bedürfnissen passt. diff --git a/curriculum/challenges/german/blocks/lecture-working-with-code-editors-and-ides/672d45583fd75a504136fbbb.md b/curriculum/challenges/german/blocks/lecture-working-with-code-editors-and-ides/672d45583fd75a504136fbbb.md index cd75b099f2c..754d5d36c62 100644 --- a/curriculum/challenges/german/blocks/lecture-working-with-code-editors-and-ides/672d45583fd75a504136fbbb.md +++ b/curriculum/challenges/german/blocks/lecture-working-with-code-editors-and-ides/672d45583fd75a504136fbbb.md @@ -1,17 +1,17 @@ --- id: 672d45583fd75a504136fbbb -title: Wie Sie Visual Studio Code auf Ihrem Computer installieren +title: So installieren Sie Visual Studio Code auf Ihrem Computer challengeType: 19 dashedName: how-to-install-visual-studio-code-onto-your-computer --- # --description-- -Um VS Code zu installieren, sollten Sie die Website besuchen, um den passenden Installer für Ihr Betriebssystem zu erhalten. Achten Sie darauf, die VS Code-Website zu besuchen und nicht die Visual Studio-Website. +Um VS Code zu installieren, sollten Sie die VS Code-Website besuchen, um den passenden Installer für Ihr Betriebssystem zu erhalten. Achten Sie darauf, die VS Code-Website zu besuchen und nicht die Visual Studio-Website. Für Windows können Sie einen EXE-Installer herunterladen. Sobald Sie ihn heruntergeladen haben, führen Sie die Datei aus, und der Setup-Assistent führt Sie durch den Installationsprozess. -Für Mac können Sie ein ZIP-Archiv herunterladen, das eine `.app` enthält, die Sie ausführen können. Sie können VS Code auch über Homebrew installieren. +Für Mac können Sie ein `.zip`-Archiv herunterladen, das eine `.app` enthält, die Sie ausführen können. Sie können VS Code auch über Homebrew installieren. Öffnen Sie die Terminal-App auf Ihrem Mac und führen Sie den folgenden Befehl aus: diff --git a/curriculum/challenges/german/blocks/lecture-working-with-code-editors-and-ides/672d45651d83b450801efb3a.md b/curriculum/challenges/german/blocks/lecture-working-with-code-editors-and-ides/672d45651d83b450801efb3a.md index 61ca53fb03b..23d742e2651 100644 --- a/curriculum/challenges/german/blocks/lecture-working-with-code-editors-and-ides/672d45651d83b450801efb3a.md +++ b/curriculum/challenges/german/blocks/lecture-working-with-code-editors-and-ides/672d45651d83b450801efb3a.md @@ -9,21 +9,21 @@ dashedName: how-to-create-a-project-and-run-your-code-locally-in-vs-code Um zu beginnen, sollten Sie wissen, dass VS Code Projekte als „Workspaces“ betrachtet. Der Workspace ist das Verzeichnis, das Sie in VS Code geöffnet haben. -Zunächst müssen Sie eine Befehlszeilenschnittstelle verwenden, um ein neues Verzeichnis für Ihr neues Projekt zu erstellen. Ein Verzeichnis ist ein anderer Begriff für Ordner. +Um zu beginnen, müssen Sie eine Befehlszeilenschnittstelle (CLI) verwenden, um ein neues Verzeichnis für Ihr neues Projekt zu erstellen. Ein Verzeichnis ist ein anderer Begriff für einen Ordner. -Befehlszeilenschnittstellen, kurz CLI, ermöglichen es Ihnen, über textbasierte Befehle mit Ihrem Betriebssystem zu interagieren. Mehr über diese Werkzeuge lernen Sie in zukünftigen Lektionen. +Befehlszeilenschnittstellen, kurz CLIs, ermöglichen es Ihnen, über textbasierte Befehle mit Ihrem Betriebssystem zu interagieren. Sie werden in zukünftigen Lektionen mehr über diese Werkzeuge lernen. Wenn Sie Windows verwenden, können Sie die Eingabeaufforderung oder PowerShell nutzen. Wenn Sie einen Mac haben, öffnen Sie die Terminal-App. -Sobald die Befehlszeile geöffnet ist, navigieren Sie zum Home-Verzeichnis, indem Sie den `cd ~`-Befehl eingeben und `enter` auf Ihrer Tastatur drücken. Dann geben Sie den `mkdir my-project`-Befehl ein und drücken `enter`. `mkdir`, oder „make directory“, ist der Befehl, um ein neues Verzeichnis zu erstellen. Anschließend sollten Sie Ihr neues Verzeichnis mit VS Code öffnen. +Sobald die Befehlszeile geöffnet ist, navigieren Sie zu Ihrem Home-Verzeichnis. Geben Sie im Command Prompt `cd /d %USERPROFILE%` ein und drücken Sie die `Enter`-Taste auf Ihrer Tastatur. In PowerShell oder dem macOS Terminal geben Sie `cd ~` ein und drücken `Enter`. Dann geben Sie den Befehl `mkdir my-project` ein und drücken `Enter`. `mkdir`, oder „make directory“, ist der Befehl, um ein neues Verzeichnis zu erstellen. Öffnen Sie anschließend Ihr neues Verzeichnis mit VS Code. -Es gibt auch andere grafische Möglichkeiten, ein neues Verzeichnis zu erstellen. +Es gibt auch andere Möglichkeiten, ein Verzeichnis in VS Code zu öffnen. Je nach Betriebssystem haben Sie möglicherweise ein Kontextmenü (oder Rechtsklick-Option), um VS Code direkt aus Ihrem Datei-Explorer zu öffnen. Sie können auch doppelt auf die VS Code-Anwendung klicken. Wenn Sie sich mit der Befehlszeile wohlfühlen, können Sie den Befehl `code /path/to/folder` ausführen. Sobald es geöffnet ist, sollten Sie einen neuen leeren Workspace sehen. -Um eine neue Datei zu erstellen, klicken Sie auf das `File`-Menü oben links und wählen `New File...` aus. Benennen Sie dann Ihre Datei `index.html` und klicken Sie auf `Save`. +Um eine neue Datei zu erstellen, klicken Sie im Menü oben links auf `File` und wählen Sie `New File...` aus. Benennen Sie dann Ihre Datei `index.html` und klicken Sie auf `Save`. Jetzt sollten Sie Ihre neue Datei im Explorer-Tab sehen. Versuchen Sie, etwas HTML in Ihre `index.html`-Datei einzufügen. @@ -31,15 +31,15 @@ Vielleicht sind Sie versucht, die HTML-Datei direkt im Browser zu öffnen. Das k Stattdessen sollten Sie Ihre HTML-Datei hinter einem richtigen Webserver ablegen. Das klingt vielleicht einschüchternd, wenn Sie neu im Programmieren sind, aber es gibt tatsächlich eine Möglichkeit, dies direkt in VS Code zu machen. -Dafür müssen Sie zuerst die _Live Server_-Erweiterung installieren, die kostenlos im Marketplace verfügbar ist. +Sie müssen zuerst die Erweiterung Live Server herunterladen, die kostenlos im Marketplace verfügbar ist. -Klicken Sie auf den Erweiterungs-Tab in der linken Ecke und geben Sie `Live Server` in die Suchleiste ein. +Klicken Sie auf den Erweiterungen-Tab in der linken Seitenleiste und geben Sie `Live Server` in die Suchleiste ein. -Nachdem Sie diese installiert haben, sollten Sie einen `Go live`-Button in Ihrer Statusleiste sehen. Stellen Sie sicher, dass Ihre HTML-Datei geöffnet ist, und klicken Sie dann darauf. +Sobald Sie diese installiert haben, sollten Sie einen `Go Live`-Button in Ihrer Statusleiste sehen. Stellen Sie sicher, dass Ihre HTML-Datei geöffnet ist, und klicken Sie dann darauf. Ihre neue Seite sollte automatisch in einem neuen Tab im Browser geöffnet werden. Falls nicht, können Sie direkt zu `http://localhost:5500/` gehen. -Herzlichen Glückwunsch! Sie haben nun Ihr eigenes Projekt in VS Code eingerichtet und können Ihre Änderungen mit Live Server live ansehen. +Herzlichen Glückwunsch! Sie haben nun Ihr eigenes Projekt in VS Code eingerichtet und können Ihre Änderungen mit Live Server ansehen. # --questions-- @@ -57,7 +57,7 @@ In der Lektion wird erklärt, wie VS Code einen Workspace in Bezug auf Verzeichn --- -Das Verzeichnis, von dem aus Sie VS Code geöffnet haben. +Das Verzeichnis, das Sie in VS Code geöffnet haben. --- diff --git a/curriculum/challenges/german/blocks/lecture-working-with-code-editors-and-ides/672d456f4ac35950b300e93f.md b/curriculum/challenges/german/blocks/lecture-working-with-code-editors-and-ides/672d456f4ac35950b300e93f.md index 0b1607c317a..2582ff8ba08 100644 --- a/curriculum/challenges/german/blocks/lecture-working-with-code-editors-and-ides/672d456f4ac35950b300e93f.md +++ b/curriculum/challenges/german/blocks/lecture-working-with-code-editors-and-ides/672d456f4ac35950b300e93f.md @@ -9,21 +9,21 @@ dashedName: what-are-several-useful-keyboard-shortcuts-for-maximizing-productivi Sie kennen wahrscheinlich schon einige der grundlegenden Tastenkombinationen, die von Ihrem Betriebssystem übernommen werden. Tastenkombinationen wie `Ctrl + S` zum Speichern, `Ctrl + C` zum Kopieren und `Ctrl + V` zum Einfügen funktionieren alle in VS Code. -Es gibt jedoch einige, die speziell für die Anwendung sind und Ihre Produktivität noch weiter steigern können. Beachten Sie, dass einige dieser Tastenkombinationen je nach Betriebssystem unterschiedlich sein können. +Es gibt jedoch einige, die an die Anwendung gebunden sind und Ihre Produktivität trotzdem steigern können. Es ist wichtig zu beachten, dass einige dieser Tastenkombinationen je nach Betriebssystem unterschiedlich sein können. -Zum Beispiel führt `Shift + Alt + F` den konfigurierten Formatter (wie prettier für ein JavaScript-Projekt) auf der aktuell geöffneten Datei aus. +Zum Beispiel führt `Shift + Alt + F` den konfigurierten Formatter aus (wie Prettier für ein JavaScript-Projekt) auf der aktuell geöffneten Datei. -Oder `Ctrl + Shift + F` (Windows) bzw. `Cmd + Shift + F` (Mac), um den Textinhalt aller Dateien in Ihrem Arbeitsbereich zu durchsuchen. Dann `Ctrl + Shift + H` (Windows) bzw. `Cmd + Shift + H` (Mac), wenn Sie eine Suche mit Ersetzen ausführen möchten. +Verwenden Sie `Ctrl + Shift + F` (Windows/Linux) oder `Cmd + Shift + F` (macOS), um den Textinhalt aller Dateien in Ihrem Arbeitsbereich zu durchsuchen. Verwenden Sie dann `Ctrl + Shift + H` (Windows/Linux) oder `Cmd + Shift + H` (macOS), wenn Sie eine Suchen-und-Ersetzen-Funktion ausführen möchten. -Wenn Sie eine Zeile entfernen müssen, löscht `Ctrl + Shift + K` (Windows) bzw. `Cmd + Shift + K` (Mac) diese. +Wenn Sie eine Zeile entfernen müssen, löscht `Ctrl + Shift + K` (Windows/Linux) oder `Cmd + Shift + K` (macOS) diese. -Brauchen Sie mehr Platz für Ihren gesamten Code? `Ctrl + B` (Windows) bzw. `Cmd + B` (Mac) blendet die Seitenleiste aus – dort befinden sich die Dateiliste und das Erweiterungsmenü. +Brauchen Sie mehr Platz für Ihren gesamten Code? `Ctrl + B` (Windows) oder `Cmd + B` (Mac) blendet die Seitenleiste aus, die die Dateiliste und das Erweiterungsmenü enthält. -Oder vielleicht können Sie Ihren Code einfach nicht sehen? `Ctrl + plus` (Windows) bzw. `Cmd + plus` (Mac) vergrößert die Skalierung des Editors, und `Ctrl + minus` (Windows) bzw. `Cmd + minus` (Mac) verkleinert sie. +Oder sehen Sie Ihren Code einfach nicht gut genug? `Ctrl + Plus` (Windows) oder `Cmd + Plus` (Mac) vergrößert die Skalierung des Editors, und `Ctrl + Minus` (Windows) oder `Cmd + Minus` (Mac) verkleinert sie. -Eine weitere hilfreiche Funktion in VS Code ist die Mehrzeilenbearbeitung, mit der Sie Änderungen gleichzeitig über mehrere Zeilen vornehmen können. Zum Beispiel können Sie mit `Ctrl + Alt + down` und `Ctrl + Alt + up` (Windows/Linux) oder `Option + Command + down` und `Option + Command + up` (Mac) mehrere Cursor auf aufeinanderfolgenden Zeilen setzen. Sie können auch `Alt` (Windows/Linux) oder `Option` (Mac) gedrückt halten und klicken, um an verschiedenen Stellen auf separaten Zeilen Cursor hinzuzufügen. Sobald die Cursor gesetzt sind, wird alles, was Sie tippen oder löschen, gleichzeitig an all diesen Stellen angewendet – das spart viel Zeit bei der Arbeit mit sich wiederholendem Code. +Eine weitere hilfreiche Funktion in VS Code ist die Mehrzeilenbearbeitung, mit der Sie Änderungen gleichzeitig über mehrere Zeilen vornehmen können. Zum Beispiel können Sie mehrere Cursor setzen, indem Sie `Ctrl + Alt + Down` und `Ctrl + Alt + Up` (Windows/Linux) oder `Option + Cmd + Down` und `Option + Cmd + Up` (Mac) verwenden, um den Cursor auf aufeinanderfolgende Zeilen auszudehnen. Sie können auch `Alt` (Windows/Linux) oder `Option` (Mac) gedrückt halten und klicken, um an verschiedenen Stellen auf separaten Zeilen Cursor hinzuzufügen, wo immer Sie sie brauchen. Sobald die Cursor gesetzt sind, wird alles, was Sie tippen oder löschen, gleichzeitig an all diesen Stellen angewendet – das spart viel Zeit bei der Arbeit mit sich wiederholendem Code. -Wenn Sie eine dieser Tastenkombinationen vergessen, können Sie immer `Ctrl + Shift + P` (Windows) oder `Cmd + Shift + P` (Mac) verwenden, um die Befehlspalette zu öffnen und den benötigten Befehl auszuwählen. +Wenn Sie schließlich eine dieser Tastenkombinationen vergessen, haben Sie immer `Ctrl + Shift + P` (Windows/Linux) oder `Cmd + Shift + P` (macOS), das die Befehls-Palette öffnet, damit Sie alles auswählen können, was Sie benötigen. Mit diesem Wissen und vielleicht etwas Übung sind Sie auf dem besten Weg, ein VS Code-Power-User zu werden. diff --git a/curriculum/challenges/german/blocks/lecture-working-with-code-editors-and-ides/672d457bcdd8b350ec2b6254.md b/curriculum/challenges/german/blocks/lecture-working-with-code-editors-and-ides/672d457bcdd8b350ec2b6254.md index 78333a417aa..5df7adf2f5f 100644 --- a/curriculum/challenges/german/blocks/lecture-working-with-code-editors-and-ides/672d457bcdd8b350ec2b6254.md +++ b/curriculum/challenges/german/blocks/lecture-working-with-code-editors-and-ides/672d457bcdd8b350ec2b6254.md @@ -7,25 +7,25 @@ dashedName: what-are-some-good-vs-code-extensions-you-can-use-in-your-editor # --description-- -_Better Comments_ ist eine Erweiterung, die spezielle Hervorhebungen für bestimmte Code-Kommentare bietet. Zum Beispiel hebt sie "TODO"-Kommentare hervor und zeigt auch eine Syntax für Fragen oder Warnungen an. +Better Comments ist eine Erweiterung, die spezielle Hervorhebungen für bestimmte Code-Kommentare bietet. Zum Beispiel hebt sie "TODO"-Kommentare hervor und zeigt auch Syntax an, um Fragen oder Warnungen zu kennzeichnen. -_Code Spell Checker_ zeigt an, wenn Sie etwas in Ihrem Code falsch geschrieben haben. Da es für Code-Dateien entwickelt wurde, berücksichtigt es Dinge wie Camel Case. +Code Spell Checker markiert Wörter, die in Ihrem Code falsch geschrieben sind. Da es für Code-Dateien entwickelt wurde, berücksichtigt es Dinge wie Camel Case. -_Error Lens_ hilft Ihnen, hervorgehobene Fehler in Ihrem Code zu erkennen. Anstatt sich auf die standardmäßige Unterstreichung von VS Code zu verlassen, hebt diese Erweiterung die gesamte Zeile hervor und zeigt die Fehlermeldung an. +Error Lens macht die Fehler in Ihrem Code schwerer zu übersehen. Anstatt sich auf die standardmäßige Unterstreichung von VS Code zu verlassen, hebt diese Erweiterung die gesamte Zeile hervor und zeigt die Fehlermeldung an. -_Indent Rainbow_ fügt Farbe zu Ihren verschiedenen Einrückungsebenen hinzu. In Kombination mit der nativen Klammerpaar-Farbgebung von VS Code kann dies erheblich dabei helfen, den Gültigkeitsbereich Ihres Codes zu erkennen. +Indent Rainbow fügt Farbe zu Ihren verschiedenen Einrückungsebenen hinzu. In Kombination mit der nativen Klammerpaar-Farbgebung von VS Code kann dies erheblich dabei helfen, den Gültigkeitsbereich Ihres Codes zu erkennen. -Oder suchen Sie vielleicht etwas Praktischeres? Erwägen Sie einen KI-Assistenten wie _GitHub Copilot_ oder _Tabnine_, der Ihnen inline Vorschläge macht, während Sie Ihren Code schreiben. +Oder suchen Sie vielleicht nach etwas Praktischerem? Erwägen Sie einen KI-Assistenten wie GitHub Copilot oder Tabnine, der Ihnen inline Vorschläge macht, während Sie Ihren Code schreiben. -Ein Icon-Pack wie _VS Code Great Icons_ kann Ihren Dateibaum übersichtlicher und auf einen Blick leichter erfassbar machen. Und eine Erweiterung wie _Colorize_ hilft Ihnen, die Werte in Ihren CSS-Eigenschaften besser zu verstehen. +Ein Icon-Pack wie VS Code Great Icons kann Ihren Dateibaum übersichtlicher und auf einen Blick leichter erfassbar machen. Und eine Erweiterung wie Colorize hilft Ihnen, die Werte in Ihren CSS-Eigenschaften besser zu verstehen. -Sie werden auch sprachspezifische Erweiterungen für Ihre Projekte benötigen. Wenn Sie JavaScript verwenden, möchten Sie wahrscheinlich _ESLint_ und _Prettier_, um Ihren Code zu prüfen und zu formatieren. Wenn Sie TypeScript verwenden, könnte _Pretty TypeScript Errors_ hilfreich sein, um leichter lesbare Meldungen zu erhalten. +Sie werden auch sprachspezifische Erweiterungen für Ihre Projekte benötigen. Wenn Sie JavaScript verwenden, möchten Sie wahrscheinlich ESLint und Prettier, um Ihren Code zu prüfen und zu formatieren. Wenn Sie TypeScript nutzen, könnte Pretty TypeScript Errors für leichter lesbare Meldungen hilfreich sein. -Schließlich können Sie auch etwas Spaß mit Ihrem Editor haben. _VS Code Pets_ bietet konfigurierbare virtuelle Haustiere, die Ihnen Gesellschaft leisten, während Sie Bugs beheben. +Schließlich können Sie auch etwas Spaß mit Ihrem Editor haben. VS Code Pets bietet konfigurierbare virtuelle Haustiere, die Ihnen Gesellschaft leisten, während Sie Bugs beheben. -_Power Mode_ erzeugt auffällige Effekte, wenn Sie durch das Schreiben von mehr Code eine hohe „Kombination“ erreichen. +Power Mode erzeugt auffällige Effekte, wenn Sie durch das Schreiben von mehr Code eine ausreichend hohe "Combo" erreichen. -_Discord Presence_ ermöglicht es Ihnen, allen Ihren Freunden zu zeigen, woran Sie gerade arbeiten. +Discord Presence ermöglicht es Ihnen, all Ihren Freunden zu zeigen, woran Sie gerade arbeiten. Und es gibt noch viele weitere Erweiterungen. Erkunden Sie gerne den Erweiterungsmarkt und finden Sie heraus, was am besten zu Ihnen passt. @@ -33,7 +33,7 @@ Und es gibt noch viele weitere Erweiterungen. Erkunden Sie gerne den Erweiterung ## --text-- -Welche Funktion bietet die Erweiterung „Better Comments“ in VS Code? +Welche Funktion bietet die Better Comments-Erweiterung in VS Code? ## --answers-- @@ -69,7 +69,7 @@ In der Lektion wird erwähnt, wie diese Erweiterung bestimmte Arten von Kommenta ## --text-- -Welche VS Code-Erweiterung wird beschrieben, die dabei hilft, hervorgehobene Fehler in Ihrem Code zu erkennen, indem sie die Fehlermeldung über die gesamte Zeile anzeigt? +Welche VS Code-Erweiterung hebt die gesamte Zeile hervor und zeigt die Fehlermeldung inline an, anstatt sich auf die standardmäßige Unterstreichung zu verlassen? ## --answers-- @@ -105,7 +105,7 @@ In der Lektion wird eine Erweiterung erwähnt, die die Fehlererkennung über die ## --text-- -Welche besondere Funktion bietet die Erweiterung „VS Code Pets“? +Welche einzigartige Funktion bietet die VS Code Pets-Erweiterung? ## --answers-- diff --git a/curriculum/challenges/german/blocks/lecture-working-with-css-flexbox/672aa7f7284b235f46f7d4e9.md b/curriculum/challenges/german/blocks/lecture-working-with-css-flexbox/672aa7f7284b235f46f7d4e9.md index 90275b992cc..b9cac563841 100644 --- a/curriculum/challenges/german/blocks/lecture-working-with-css-flexbox/672aa7f7284b235f46f7d4e9.md +++ b/curriculum/challenges/german/blocks/lecture-working-with-css-flexbox/672aa7f7284b235f46f7d4e9.md @@ -319,7 +319,7 @@ Die Hauptachse ist immer horizontal, während die Querachse immer vertikal ist. ### --feedback-- -Denken Sie an die Verteilung der Elemente innerhalb eines Flex-Containers. +Denken Sie darüber nach, wie die Hauptachse und die Querachse zueinander positioniert sind. --- @@ -327,7 +327,7 @@ Die Hauptachse ist immer vertikal, während die Querachse immer horizontal ist. ### --feedback-- -Denken Sie an die Verteilung der Elemente innerhalb eines Flex-Containers. +Denken Sie darüber nach, wie die Hauptachse und die Querachse zueinander positioniert sind. --- @@ -339,7 +339,7 @@ Die Hauptachse und die Querachse sind immer parallel zueinander. ### --feedback-- -Denken Sie an die Verteilung der Elemente innerhalb eines Flex-Containers. +Denken Sie darüber nach, wie die Hauptachse und die Querachse zueinander positioniert sind. ## --video-solution-- diff --git a/curriculum/challenges/german/blocks/lecture-working-with-css-flexbox/672bd658c0e190f674a5e057.md b/curriculum/challenges/german/blocks/lecture-working-with-css-flexbox/672bd658c0e190f674a5e057.md index 84fd76d20c2..e75cd222b30 100644 --- a/curriculum/challenges/german/blocks/lecture-working-with-css-flexbox/672bd658c0e190f674a5e057.md +++ b/curriculum/challenges/german/blocks/lecture-working-with-css-flexbox/672bd658c0e190f674a5e057.md @@ -7,11 +7,11 @@ dashedName: what-are-some-common-flex-properties # --interactive-- -Flex-Eigenschaften sind Eigenschaften, die Sie auf Flex-Container anwenden können, um die Verteilung der Kindelemente zu bestimmen. Wir behandeln einige der am häufigsten verwendeten: `flex-wrap`, `justify-content` und `align-items`. +Flex-Eigenschaften steuern, wie Elemente innerhalb eines Flex-Layouts funktionieren, von der Verteilung auf Container-Ebene bis zur Selbst-Ausrichtung auf Element-Ebene. In dieser Lektion behandeln wir einige der am häufigsten verwendeten: `flex-wrap`, `flex-flow`, `justify-content`, `align-items` und `align-self`. -Beginnen wir mit `flex-wrap`. Diese Eigenschaft bestimmt, wie Flex-Elemente innerhalb eines Flex-Containers umgebrochen werden, um in den verfügbaren Platz zu passen. `flex-wrap` kann drei mögliche Werte annehmen: `nowrap`, `wrap` und `wrap-reverse`. `nowrap` ist der Standardwert – Flex-Elemente werden nicht in eine neue Zeile umgebrochen, selbst wenn ihre Breite die Breite des Containers überschreitet. +Beginnen wir mit `flex-wrap`. Diese Eigenschaft bestimmt, wie Flex-Elemente innerhalb eines Flex-Containers umgebrochen werden, um in den verfügbaren Platz zu passen. `flex-wrap` kann drei mögliche Werte annehmen: `nowrap`, `wrap` und `wrap-reverse`. `nowrap` ist der Standardwert: Flex-Elemente werden nicht in eine neue Zeile umgebrochen, selbst wenn ihre Breite die Breite des Containers überschreitet. -Im folgenden Code haben wir drei `div`-Elemente. Konzentrieren wir uns auf den `width`. Der `main`-Container mit rotem Rahmen hat eine `width` von `200px`, während seine drei Kind-`div`-Elemente zusammen eine `width` von `240px` haben (jeweils `80px`): +Im folgenden Code haben wir drei `div`-Elemente. Konzentrieren wir uns auf die `width`. Der mit einem Rahmen versehene `main`-Container hat eine `width` von `200px`, während seine drei untergeordneten `div`-Elemente zusammen eine `width` von `240px` (`80px` jeweils) haben: :::interactive_editor @@ -28,7 +28,7 @@ Im folgenden Code haben wir drei `div`-Elemente. Konzentrieren wir uns auf den ` main { width: 200px; display: flex; - border: 2px solid red; + border: 2px solid #444; } div { @@ -51,7 +51,6 @@ div { ::: - Die Breite der `div`-Elemente überschreitet die Breite ihres Containers, aber standardmäßig werden sie verkleinert, um in den verfügbaren Platz zu passen. Wenn Sie möchten, dass sie umgebrochen werden, wenn sie die Breite ihres Containers überschreiten, können Sie `flex-wrap: wrap` auf dem Flex-Container setzen: :::interactive_editor @@ -70,7 +69,7 @@ main { width: 200px; display: flex; flex-wrap: wrap; - border: 2px solid red; + border: 2px solid #444; } div { @@ -109,9 +108,10 @@ Die `div`-Elemente werden in Reihen neu angeordnet, wenn sie die Breite ihres Co ```css main { width: 200px; + height: 120px; display: flex; flex-flow: column wrap-reverse; - border: 2px solid red; + border: 2px solid #444; } div { @@ -151,7 +151,7 @@ Super. Nun sprechen wir über `justify-content`. `justify-content` richtet die K main { display: flex; justify-content: flex-start; - border: 2px solid red; + border: 2px solid #444; } div { @@ -191,7 +191,7 @@ Mit `justify-content: flex-end` werden Flex-Elemente am Ende der Hauptachse ausg main { display: flex; justify-content: flex-end; - border: 2px solid red; + border: 2px solid #444; } div { @@ -231,7 +231,7 @@ Um die Flex-Elemente entlang der Hauptachse zu zentrieren, können Sie `justify- main { display: flex; justify-content: center; - border: 2px solid red; + border: 2px solid #444; } div { @@ -254,7 +254,7 @@ div { ::: -Um die Elemente gleichmäßig entlang der Hauptachse zu verteilen, können Sie `justify-content: space-between` verwenden. Dadurch wird bei Bedarf etwas Platz zwischen den Flex-Elementen eingefügt. +Um die Elemente entlang der Hauptachse ohne Abstand an den Rändern zu verteilen, können Sie `justify-content: space-between` verwenden. Das erste Element sitzt am Anfang der Hauptachse, das letzte Element am Ende, und der verbleibende Platz wird zwischen benachbarten Elementen verteilt. :::interactive_editor @@ -271,7 +271,7 @@ Um die Elemente gleichmäßig entlang der Hauptachse zu verteilen, können Sie ` main { display: flex; justify-content: space-between; - border: 2px solid red; + border: 2px solid #444; } div { @@ -294,7 +294,7 @@ div { ::: -`justify-content: space-around` verteilt Flex-Elemente gleichmäßig innerhalb der Hauptachse und fügt einen Abstand vor dem ersten und nach dem letzten Element hinzu. Dieser zusätzliche Abstand entspricht der Hälfte des Abstands zwischen jeweils zwei benachbarten Elementen. Wenn nur ein Element verteilt wird, wird es zentriert. +`justify-content: space-around` verteilt die Flex-Elemente gleichmäßig entlang der Hauptachse und fügt vor dem ersten und nach dem letzten Element einen Abstand hinzu. Dieser zusätzliche Abstand entspricht der Hälfte des Abstands zwischen jeweils zwei benachbarten Elementen. Wenn nur ein Element verteilt wird, wird es zentriert. :::interactive_editor @@ -311,7 +311,7 @@ div { main { display: flex; justify-content: space-around; - border: 2px solid red; + border: 2px solid #444; } div { @@ -334,8 +334,7 @@ div { ::: - -Und zu guter Letzt haben wir `justify-content: space-evenly`, das die Elemente gleichmäßig entlang der Hauptachse verteilt. Der Abstand zwischen den Elementen sowie der Abstand vor dem ersten und nach dem letzten Element sind genau gleich: +Und nicht zuletzt gibt es `justify-content: space-evenly`, das die Elemente gleichmäßig entlang der Hauptachse verteilt. Der Abstand zwischen den Elementen und der Abstand vor dem ersten und nach dem letzten Element sind genau gleich: :::interactive_editor @@ -352,7 +351,7 @@ Und zu guter Letzt haben wir `justify-content: space-evenly`, das die Elemente g main { display: flex; justify-content: space-evenly; - border: 2px solid red; + border: 2px solid #444; } div { @@ -390,10 +389,10 @@ Super. Jetzt wissen Sie, wie Sie Flex-Elemente entlang der Hauptachse verteilen. ```css main { - height: 300px; display: flex; + height: 300px; align-items: center; - border: 2px solid red; + border: 2px solid #444; } div { @@ -431,10 +430,10 @@ In diesem Beispiel sind die Flex-Elemente entlang der Querachse zentriert, die s ```css main { - height: 300px; display: flex; + height: 300px; align-items: flex-start; - border: 2px solid red; + border: 2px solid #444; } div { @@ -472,10 +471,10 @@ Das Gegenteil ist `align-items: flex-end`. Damit werden Flex-Elemente am Ende de ```css main { - height: 300px; display: flex; + height: 300px; align-items: flex-end; - border: 2px solid red; + border: 2px solid #444; } div { @@ -498,33 +497,43 @@ div { ::: -Um die Flex-Elemente entlang der Querachse zu strecken, können Sie `align-items: stretch` verwenden. Das funktioniert auch bei Elementen, die automatisch dimensioniert sind, wie solche ohne festgelegte `width` oder `height` oder mit nur einem Minimum an `width` oder `height`. Die Flex-Elemente werden sich in Richtung der Querachse strecken, um den Container auszufüllen. +Um die Flex-Elemente entlang der Querachse zu strecken, können Sie `align-items: stretch` verwenden. Dies betrifft nur Elemente, deren Größe auf der Querachse `auto` ist; Elemente mit einer expliziten Größe auf der Querachse (zum Beispiel eine festgelegte `height` in einem Zeilen-Container) werden nicht gestreckt. Die betroffenen Elemente füllen den Container in Richtung der Querachse aus. :::interactive_editor ```html <link rel="stylesheet" href="styles.css"> - -<div class="container"> - <div class="box">One</div> - <div class="box">Two</div> - <div class="box">Three</div> -</div> - +<main> + <div id="first-div"></div> + <div id="second-div"></div> + <div id="third-div"></div> +</main> ``` ```css -.container { +main { display: flex; - align-items: stretch; + height: 300px; + align-items: stretch; border: 2px solid #444; - height: 200px; } -.box { - width: 100px; - border: 1px solid #888; - background-color: lightblue; +div { + width: 80px; + height: 50px; +} + +#first-div { + background-color: #4d70b2; +} + +#second-div { + background-color: #5c4db2; +} + +#third-div { + background-color: #4da3b2; + height: auto; } ``` @@ -536,33 +545,37 @@ Und schließlich können Sie mit der `align-self`-Eigenschaft einem einzelnen Fl ```html <link rel="stylesheet" href="styles.css"> - -<div class="container"> - <div class="box">One</div> - <div class="box">Two</div> - <div class="box special">Three</div> -</div> - +<main> + <div id="first-div"></div> + <div id="second-div"></div> + <div id="third-div"></div> +</main> ``` ```css -.container { +main { display: flex; - align-items: flex-start; + height: 300px; + align-items: flex-start; border: 2px solid #444; - height: 200px; } -.box { - width: 100px; - border: 1px solid #888; - background-color: lightblue; - margin: 4px; +div { + width: 80px; + height: 50px; } -.special { - align-self: stretch; - background-color: lightcoral; +#first-div { + background-color: #4d70b2; +} + +#second-div { + background-color: #5c4db2; +} + +#third-div { + background-color: #4da3b2; + align-self: stretch; } ``` @@ -574,33 +587,37 @@ Sie können es mit `align-self: center` zentrieren. ```html <link rel="stylesheet" href="styles.css"> - -<div class="container"> - <div class="box">One</div> - <div class="box">Two</div> - <div class="box special">Three</div> -</div> - +<main> + <div id="first-div"></div> + <div id="second-div"></div> + <div id="third-div"></div> +</main> ``` ```css -.container { +main { display: flex; - align-items: flex-start; + height: 300px; + align-items: flex-start; border: 2px solid #444; - height: 200px; } -.box { - width: 100px; - border: 1px solid #888; - background-color: lightblue; - margin: 4px; +div { + width: 80px; + height: 50px; +} + +#first-div { + background-color: #4d70b2; +} + +#second-div { + background-color: #5c4db2; } -.special { - align-self: center; - background-color: lightcoral; +#third-div { + background-color: #4da3b2; + align-self: center; } ``` @@ -612,33 +629,37 @@ Sie können es am Anfang der Querachse mit `align-self: flex-start` ausrichten. ```html <link rel="stylesheet" href="styles.css"> - -<div class="container"> - <div class="box">One</div> - <div class="box">Two</div> - <div class="box special">Three</div> -</div> - +<main> + <div id="first-div"></div> + <div id="second-div"></div> + <div id="third-div"></div> +</main> ``` ```css -.container { +main { display: flex; - align-items: flex-start; + height: 300px; + align-items: flex-start; border: 2px solid #444; - height: 200px; } -.box { - width: 100px; - border: 1px solid #888; - background-color: lightblue; - margin: 4px; +div { + width: 80px; + height: 50px; +} + +#first-div { + background-color: #4d70b2; } -.special { - align-self: flex-start; - background-color: lightcoral; +#second-div { + background-color: #5c4db2; +} + +#third-div { + background-color: #4da3b2; + align-self: flex-start; } ``` @@ -650,39 +671,43 @@ Oder Sie können es am Ende der Querachse mit `align-self: flex-end` ausrichten. ```html <link rel="stylesheet" href="styles.css"> - -<div class="container"> - <div class="box">One</div> - <div class="box">Two</div> - <div class="box special">Three</div> -</div> - +<main> + <div id="first-div"></div> + <div id="second-div"></div> + <div id="third-div"></div> +</main> ``` ```css -.container { +main { display: flex; - align-items: flex-start; + height: 300px; + align-items: flex-start; border: 2px solid #444; - height: 200px; } -.box { - width: 100px; - border: 1px solid #888; - background-color: lightblue; - margin: 4px; +div { + width: 80px; + height: 50px; } -.special { - align-self: flex-end; - background-color: lightcoral; +#first-div { + background-color: #4d70b2; +} + +#second-div { + background-color: #5c4db2; +} + +#third-div { + background-color: #4da3b2; + align-self: flex-end; } ``` ::: -Es gibt noch weitere Flex-Eigenschaften und Werte, aus denen Sie wählen können, um das responsive Layout zu erstellen, das Sie sich vorstellen, aber dies sind die am häufigsten verwendeten. Mit diesen CSS-Flex-Eigenschaften und Ihrem neuen Wissen über das CSS-Flex-Modell können Sie beginnen, responsive Layouts zu erstellen, um eine flüssige und inklusive Benutzererfahrung auf verschiedenen Geräten zu schaffen. +Es gibt weitere Flex-Eigenschaften und Werte, aus denen Sie wählen können, um das responsive Layout zu erstellen, das Sie sich vorstellen, aber dies sind die am häufigsten verwendeten. Mit diesen CSS-Flex-Eigenschaften und Ihrem neuen Wissen über das CSS-Flex-Modell können Sie beginnen, responsive Layouts zu erstellen, um eine reibungslose und inklusive Benutzererfahrung auf verschiedenen Geräten zu gewährleisten. # --questions-- @@ -764,7 +789,7 @@ Welche der folgenden Eigenschaften können in der `flex-flow`-Eigenschaft kombin ## --answers-- -`flex-direction` und `justify-content`. +`flex-direction` und `justify-content` ### --feedback-- @@ -772,7 +797,7 @@ Denken Sie an die beiden Hauptaspekte, wie Flex-Elemente angeordnet werden. --- -`flex-direction` und `align-items`. +`flex-direction` und `align-items` ### --feedback-- @@ -780,7 +805,7 @@ Denken Sie an die beiden Hauptaspekte, wie Flex-Elemente angeordnet werden. --- -`flex-direction` und `align-content`. +`flex-direction` und `align-content` ### --feedback-- @@ -788,7 +813,7 @@ Denken Sie an die beiden Hauptaspekte, wie Flex-Elemente angeordnet werden. --- -`flex-direction` und `flex-wrap`. +`flex-direction` und `flex-wrap` ## --video-solution-- diff --git a/curriculum/challenges/german/blocks/lecture-working-with-css-fonts/672bd814105a0ffcf36f9233.md b/curriculum/challenges/german/blocks/lecture-working-with-css-fonts/672bd814105a0ffcf36f9233.md index 1433aacf23f..1beaef87d7b 100644 --- a/curriculum/challenges/german/blocks/lecture-working-with-css-fonts/672bd814105a0ffcf36f9233.md +++ b/curriculum/challenges/german/blocks/lecture-working-with-css-fonts/672bd814105a0ffcf36f9233.md @@ -11,6 +11,8 @@ Eine Schriftfamilie ist eine Gruppe von Schriftarten, die ein gemeinsames Design <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/what-are-font-families-and-how-do-they-work-1.png" alt="Diagram showing 'Arial' at the top with two blue arrows pointing down to 'Arial Bold' on the left and 'Arial Italic' on the right, illustrating font family variations" /> +## Schriftfamilien in CSS festlegen + In CSS können Sie die Schriftfamilie mit der `font-family` Eigenschaft festlegen. Hier ist ein Beispiel, wie Sie die Schriftart für den Absatz auf `Arial` setzen: :::interactive_editor @@ -29,6 +31,8 @@ In CSS können Sie die Schriftfamilie mit der `font-family` Eigenschaft festlege ::: +## Fallback-Schriftarten + Aber was passiert, wenn die Schriftfamilie nicht gefunden wird? Sie können mehrere Schriftfamilien in der Reihenfolge ihrer Priorität von höchster zu niedrigster angeben, indem Sie sie mit Kommas trennen. Diese alternativen Schriftarten fungieren als Fallback-Optionen. In diesem Beispiel ist Arial die primäre Schriftart und Lato eine alternative Schriftart: :::interactive_editor @@ -51,6 +55,8 @@ Der Browser rendert die erste Schriftart (Arial), wenn sie auf dem Gerät gefund Sie sollten auch wissen, wie dieser Prozess hinter den Kulissen funktioniert. Der Auswahlprozess endet nicht, wenn die erste Schriftart verfügbar ist. Die Schriftfamilie wird Zeichen für Zeichen ausgewählt, sodass der Browser, falls eine Schriftart ein bestimmtes Zeichen nicht enthält, dieses in den Schriftarten mit niedrigerer Priorität sucht. Interessant, oder? +## Generische Schriftfamilien + Im Kontext der Webentwicklung finden Sie auch generische Schriftfamilien. Diese sind sehr wichtig. Eine generische Schriftfamilie ist eine Standardschriftart, die Webbrowser verwenden, wenn die Schriftarten mit höherer Priorität nicht verfügbar sind. Um sicherzustellen, dass der Inhalt weiterhin lesbar ist, ersetzt der Browser die ursprüngliche Schriftart durch die passendste Schriftart, die auf der angegebenen generischen Schriftfamilie basiert. Einige der am häufigsten verwendeten sind: - serif @@ -81,6 +87,8 @@ Arial hat die höchste Priorität. Wenn Arial nicht gefunden wird, versucht der Sie sollten immer eine generische Schriftfamilie am Ende der font-family-Liste angeben. Bedenken Sie, dass die generische Schriftart anders aussehen kann als die Schriftart, die Sie ursprünglich in Ihrem Design vorgesehen haben. Es ist daher immer hilfreich, zu überprüfen, wie diese Fallback-Schriftarten in verschiedenen Browsern aussehen. +## Web-sichere Schriftarten + Um die Benutzererfahrung so konsistent wie möglich zu gestalten, wird außerdem empfohlen, web-sichere Schriftarten zu verwenden. Diese Schriftfamilien sind normalerweise auf den meisten Geräten installiert, sodass sie sehr wahrscheinlich gefunden und korrekt gerendert werden. Mehr darüber lernen Sie in den nächsten Lektionen. Schriftfamilien sind im Bereich Webdesign unverzichtbar. Mit der Eigenschaft font-family können Sie das Aussehen und Gefühl Ihres Textes sofort verändern. diff --git a/curriculum/challenges/german/blocks/lecture-working-with-css-fonts/672bd8453d1371fdb1510fe5.md b/curriculum/challenges/german/blocks/lecture-working-with-css-fonts/672bd8453d1371fdb1510fe5.md index 315ad0ba746..6cc8732e30b 100644 --- a/curriculum/challenges/german/blocks/lecture-working-with-css-fonts/672bd8453d1371fdb1510fe5.md +++ b/curriculum/challenges/german/blocks/lecture-working-with-css-fonts/672bd8453d1371fdb1510fe5.md @@ -11,6 +11,8 @@ Eine externe Schriftart ist eine Schriftdatei, die nicht direkt in Ihren Projekt Google Fonts und Font Squirrel sind beliebte Online-Ressourcen, um kostenlose Schriftarten für Webentwicklungszwecke zu finden und zu verwenden. Sie können sie sehr einfach in Ihre Projekte einbinden. +## Google Fonts + Beginnen wir mit Google Fonts. Dies ist ein Google-Dienst, der eine Sammlung von Schriftarten anbietet, von denen viele speziell für die Webentwicklung entworfen wurden. In der Benutzeroberfläche von Google Fonts sehen Sie viele verschiedene Elemente. Gehen wir sie einzeln durch. In der linken Seitenleiste finden Sie: - Einen Abschnitt, um Schriftarten zu sehen, zu finden und zu filtern. @@ -18,6 +20,8 @@ Beginnen wir mit Google Fonts. Dies ist ein Google-Dienst, der eine Sammlung von - Einen Abschnitt, in dem Sie Symbole für Ihre Webprojekte finden und herunterladen können. - Einen Abschnitt, in dem Sie mehr über Schriftarten und deren bewährte Vorgehensweisen erfahren können, gefolgt von häufig gestellten Fragen. +## Google Fonts ansehen + Um eine Google Font zu Ihrer Website hinzuzufügen, sollten Sie zum ersten Abschnitt (Fonts) gehen. Sie können den Vorschautext in der linken Seitenleiste anpassen, wo „Preview“ steht. Schreiben Sie einfach den Text, den Sie sehen möchten, und er wird automatisch aktualisiert. Das ist hilfreich, um die Schriftart mit dem Text zu sehen, den Sie bereits für Ihre Website im Kopf haben. Sie können auch die Schriftgröße anpassen und die Schriftarten nach ihren Eigenschaften filtern. <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-1.png" alt="Google Fonts Fonts section showing a left sidebar with preview text set to 'freeCodeCamp' at 40px, filter options for Language, Technology, and Decorative stroke, and the main panel listing font families including Roboto, SUSE, and Sevillana each previewing 'freeCodeCamp'" /> @@ -28,12 +32,16 @@ Sie können die Schriftgröße des Vorschautexts mit dem blauen Schieberegler ne <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-2.png" alt="Google Fonts Roboto Styles page with Specimen, Type tester, Glyphs, and About & license tabs, a blue Get font button, a preview text field showing 'freeCodeCamp' with a font size slider at 48px, and a list of styles including Thin 100, Thin 100 Italic, Light 300, and Light 300 Italic" /> +## Google Fonts verwenden + Sobald Sie bereit sind, die Schriftart zu Ihrem Projekt hinzuzufügen, klicken Sie auf die blaue Schaltfläche „Get font“ oben. Sie gelangen zu einer Übersichtsseite, auf der Sie die Schriftarten sehen, die Sie aktuell ausgewählt haben. Sie können mehrere Schriftarten gleichzeitig auswählen. <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-3.png" alt="Google Fonts page showing '1 font family selected' with Roboto Static listed, Get embed code and Download all buttons on the right, and a How to use section with All, Design, Develop, and Google products tabs" /> Als Nächstes müssen Sie wählen, ob Sie die Schriftdateien herunterladen möchten, um sie als lokale Dateien zu Ihrem Projekt hinzuzufügen, oder ob Sie sie als externe Schriftarten verwenden möchten, die von Googles Servern heruntergeladen werden, wenn ein Benutzer Ihre Website besucht. Klicken Sie auf „Download all“, wenn Sie sie herunterladen möchten, oder wenn Sie sie lieber als externe Schriftarten von Googles Servern verwenden möchten, klicken Sie auf „Get embed code“. Wenn Sie auf „Get embed code“ klicken, sehen Sie die Anweisungen, denen Sie folgen sollten, um diese externen Schriftarten in Ihr Projekt einzubinden. +### Google Fonts per Link einbinden + Für Webentwicklungsprojekte haben Sie zwei Optionen. Sie können entweder ein `link`-Element oder `@import` verwenden. Wenn Sie die `link`-Element-Option wählen, können Sie den HTML-Schnipsel und die CSS-Regeln kopieren und in Ihr Projekt einfügen. Sie sollten den Code im `head`-Element Ihrer HTML-Datei einbetten und die CSS-Regeln hinzufügen, die Ihren Bedürfnissen entsprechen. <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-4.png" alt="Google Fonts Embed code page with the link element option selected, showing three link tags for preconnect and the font stylesheet, a CSS classes section with .roboto-thin, .roboto-light, .roboto-regular, and .roboto-medium rules, and a left sidebar showing font style toggles" /> @@ -141,6 +149,8 @@ Hier ist ein Beispiel für die Verwendung aller Roboto-Stile: Es gibt eine CSS-Regel für jeden Schriftstil. Jede Regel weist die benutzerdefinierten Schriftarten mit Fallback-Schriftarten zu, falls die benutzerdefinierten Schriftarten nicht richtig geladen werden. +### Google Fonts importieren + Wenn Sie stattdessen die `@import`-Option wählen, müssen Sie diese Regel in Ihre CSS-Datei einfügen. <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-5.png" alt="Google Fonts Embed code page with the @import option selected, showing a style block containing the @import URL rule, a CSS classes section below, and the left sidebar with font style toggles" /> @@ -159,10 +169,14 @@ Wenn Sie nur bestimmte Schriftstile einbinden möchten, haben Sie auch die Mögl Und das ist Google Fonts. Es ist eine der beliebtesten Optionen, um kostenlose und Open-Source-Schriftarten für Webentwicklungsprojekte zu finden. +## Font Squirrel + Eine weitere großartige Option ist Font Squirrel, wo Sie benutzerdefinierte Schriftarten finden und herunterladen können, die Sie für Ihr Design vorgesehen haben. <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-7.png" alt="Font Squirrel 'Free Font Utopia' page listing featured free fonts including Acherus Grotesque, Intro Rust, Source Sans Pro, Open Sans, and Questa, each shown with an alphabet specimen and a Download button" /> +## Font Squirrel ansehen + Wenn Sie nach einer Schriftart suchen und auf ein Ergebnis klicken, sehen Sie weitere Details zur Schriftart, einschließlich Proben, Test Drive, Glyphen und Webfont-Kit. <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-8.png" alt="Font Squirrel search results for 'Roboto' showing three matches: Roboto, Roboto 2014, and Roboto Slab, each with an alphabet specimen and a Download TTF button" /> @@ -173,6 +187,8 @@ Sie können auch Beispiele der verschiedenen Stile und Varianten der Schriftart <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-10.png" alt="Font Squirrel Roboto Specimens section listing all styles with alphabet samples: Roboto Thin, Thin Italic, Light, Light Italic, Regular, Italic, Medium, Medium Italic, Bold, Bold Italic, and Black, each in its respective weight" /> +## Font Squirrel verwenden + Sobald Sie sich für eine Schriftart entschieden haben, die Sie in Ihrem Projekt verwenden möchten, gehen Sie zum Tab „Webfont Kit“. Hier können Sie prüfen, ob die Lizenz der Schriftart die Verwendung in `@font-face` CSS-Einbettungen erlaubt. Sie können auch die Teilmenge und das Format auswählen. <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-11.png" alt="Font Squirrel Roboto Webfont Kit tab showing a license notice confirming @font-face embedding is allowed, a subset selector set to Western Latin, format checkboxes with WOFF selected, and a Download @font-face Kit button" /> diff --git a/curriculum/challenges/german/blocks/lecture-working-with-css-fonts/672bd853c985cdfdeb32f4f9.md b/curriculum/challenges/german/blocks/lecture-working-with-css-fonts/672bd853c985cdfdeb32f4f9.md index 9e053a2839b..7f50e80d6b4 100644 --- a/curriculum/challenges/german/blocks/lecture-working-with-css-fonts/672bd853c985cdfdeb32f4f9.md +++ b/curriculum/challenges/german/blocks/lecture-working-with-css-fonts/672bd853c985cdfdeb32f4f9.md @@ -13,6 +13,8 @@ CSS wendet standardmäßig keine Schatten auf den Text an. Dies ist ein Beispiel text-shadow: /* Values */ ``` +## Die `X`- und `Y`-Versatzwerte + In CSS können Sie einen Schatten durch eine Kombination aus seinem `X`-Versatz, `Y`-Versatz, dem Unschärferadius und der Farbe beschreiben. Zuerst müssen Sie den `X`- und `Y`-Versatz angeben, die jeweils den horizontalen und vertikalen Abstand des Schattens vom Text darstellen. Diese Werte sind erforderlich. Hier ist ein Beispiel, wie Sie einen `X`- und `Y`-Versatz auf einen Schatten anwenden. Wir verwenden die `text-shadow`-Eigenschaft mit einem x-Versatz von `3px` und einem y-Versatz von `2px`: @@ -32,7 +34,11 @@ p { ::: -Im Browser sehen der Text und der Schatten ähnlich aus, aber wir können auch die Farbe des Schattens anpassen, indem wir den Wert vor oder nach dem Versatz angeben. Legen wir die Schattenfarbe fest. Wir verwenden hier eine hexadezimale Farbe, aber Sie können jedes gültige Farbformat verwenden. +Im Browser sehen der Text und der Schatten ähnlich aus. + +## Eine Farbe zum Schatten hinzufügen + +Wir können die Farbe des Schattens auch anpassen, indem wir den Wert vor oder nach dem Versatz angeben. Legen wir die Schattenfarbe fest. Hier verwenden wir eine hexadezimale Farbe, aber Sie können jedes gültige Farbformat verwenden. :::interactive_editor @@ -66,7 +72,11 @@ p { ::: -Im Browser hat der Schatten eine bestimmte Farbe, sodass wir ihn sehr leicht vom Text unterscheiden können. Jetzt, wo wir den Schatten vom Text unterscheiden können, ist es auch wichtig zu sehen, wie sich positive und negative Werte auf den Schattenversatz auswirken. Positive Werte des `X`- und `Y`-Versatzes verschieben den Schatten nach rechts bzw. nach unten, während negative Werte den Schatten nach links und oben verschieben. Hier ist ein Beispiel, das stattdessen negative Werte verwendet: +Im Browser hat der Schatten eine bestimmte Farbe, sodass wir ihn sehr leicht vom Text unterscheiden können. + +## Positive und negative Versatzwerte + +Jetzt, wo wir den Schatten vom Text unterscheiden können, ist es auch wichtig zu sehen, wie sich positive und negative Werte auf den Schattenversatz auswirken. Positive Werte des `X`-Versatzes und `Y`-Versatzes verschieben den Schatten nach rechts bzw. nach unten, während negative Werte den Schatten nach links und oben verschieben. Hier ist ein Beispiel, das stattdessen negative Werte verwendet: :::interactive_editor @@ -83,7 +93,11 @@ p { ::: -Jetzt verschiebt sich der Schatten relativ zum Text nach links und oben. Prima. Aber der Schatten sieht nicht sehr schön aus, weil er genau wie der Originaltext aussieht, nur dahinter platziert ist. Um ihn schöner aussehen zu lassen, müssen wir einen dritten Wert hinzufügen, den Unschärferadius. Dieser Wert ist optional, macht den Schatten aber viel weicher und subtiler. Der Standardwert des Unschärferadius ist null. Je höher der Wert, desto größer die Unschärfe, was bedeutet, dass der Schatten heller wird. +Jetzt verschiebt sich der Schatten im Verhältnis zum Text nach links und oben. Super. + +## Der Unschärferadius + +Aber der Schatten sieht nicht sehr schön aus, weil er genau wie der Originaltext aussieht, nur dahinter platziert ist. Um ihn schöner aussehen zu lassen, müssen wir einen dritten Wert hinzufügen, den Unschärferadius. Dieser Wert ist optional, macht den Schatten aber viel weicher und subtiler. Der Standardwert des Unschärferadius ist null. Je höher der Wert, desto größer die Unschärfe, was bedeutet, dass der Schatten heller wird. Hier setzen wir den Unschärferadius auf `3px` und verwenden wieder positive Werte für den Versatz: @@ -104,6 +118,8 @@ p { Jetzt sieht es langsam wie ein Schatten aus. Er ist unschärfer und subtiler, sodass wir den Fokus auf den Haupttext legen können, während der Schatten im Hintergrund etwas Stil hinzufügt. Von hier aus können wir die Werte ein wenig anpassen, bis wir eine Kombination aus Versatz, Farbe und Unschärferadius finden, die unseren Bedürfnissen entspricht. +## Mehrere Schatten hinzufügen + Es ist auch hilfreich zu wissen, dass der Text mehr als einen Schatten haben kann. Sie müssen sie nur in derselben `text-shadow`-Eigenschaft durch Kommas getrennt schreiben. Sie werden in Schichten angewendet, von vorne nach hinten, wobei der erste Schatten oben liegt. Hier ist ein Beispiel für einen Absatz mit drei Schatten, die in Schichten angewendet werden. Beachten Sie, dass alle diese Schatten in derselben `text-shadow`-Eigenschaft definiert und durch Kommas getrennt sind: diff --git a/curriculum/challenges/german/blocks/lecture-working-with-css-transforms-overflow-and-filters/672bccc8ea33bad87abb3c56.md b/curriculum/challenges/german/blocks/lecture-working-with-css-transforms-overflow-and-filters/672bccc8ea33bad87abb3c56.md index 83d31f7948b..68889c9c8f6 100644 --- a/curriculum/challenges/german/blocks/lecture-working-with-css-transforms-overflow-and-filters/672bccc8ea33bad87abb3c56.md +++ b/curriculum/challenges/german/blocks/lecture-working-with-css-transforms-overflow-and-filters/672bccc8ea33bad87abb3c56.md @@ -19,6 +19,8 @@ Diese Eigenschaft kann auf den universellen Selektor (`*`) angewendet werden, um Der Wert der Eigenschaft `box-sizing` ist standardmäßig `content-box`, aber Sie können `border-box` wählen, wenn Sie es benötigen. Wir werden zuerst `content-box` untersuchen und dann auf `border-box` eingehen. +## Überprüfung des CSS-Box-Modells + Um zu verstehen, wie die Modelle funktionieren, müssen Sie mit den vier Kernkonzepten des CSS-Box-Modells vertraut sein. Lassen Sie uns diese schnell überprüfen. - Der Inhaltsbereich ist der Raum, den der Inhalt des Elements einnimmt. @@ -26,6 +28,8 @@ Um zu verstehen, wie die Modelle funktionieren, müssen Sie mit den vier Kernkon - Der border ist die Umrandung, die den Inhaltsbereich und den padding umgibt. - Der Außenabstand ist der Raum außerhalb des border, der das Element von anderen Elementen trennt. +## Wie `content-box` funktioniert + Im `content-box`-Modell bestimmen die von Ihnen festgelegte Breite und Höhe die Abmessungen des Inhaltsbereichs, schließen aber nicht den padding, border oder margin ein. Verwenden Sie `content-box`, wenn Sie eine präzise Kontrolle über den Inhaltsbereich benötigen. Wenn Sie `width` und `height` setzen, legen Sie nur die Größe des Inhalts selbst fest. Um die Gesamtbreite des Elements zu ermitteln, müssen Sie den linken und rechten padding sowie die linken und rechten border addieren. Ebenso kann die Gesamthöhe eines Elements durch Addition der Inhalts-Höhe, des oberen und unteren padding sowie der oberen und unteren border berechnet werden. @@ -52,10 +56,14 @@ div { In diesem Fall beträgt bei Verwendung von `content-box` der Inhaltsbereich 300px mal 200px. Die insgesamt gerenderte Größe umfasst padding und border – zum Beispiel Gesamtbreite = 300px (Inhalt) + 40px (padding) + 8px (border) = 348px; die Gesamthöhe wird auf die gleiche Weise berechnet. +## Wie `border-box` funktioniert + Super! Nun untersuchen wir `border-box`. Es unterscheidet sich dadurch, dass die von Ihnen festgelegte Breite und Höhe den Inhalt, den padding und den border des Elements einschließen (aber nicht den Außenabstand). Verwenden Sie `border-box`, wenn die Gesamtgröße des Elements fest bleiben soll, auch wenn sich padding oder border ändern – das ist oft bei responsiven Layouts hilfreich. Bei `border-box` sind padding und border innerhalb der angegebenen Größe des Elements enthalten. Die von Ihnen gesetzten `width` und `height` werden zu den Gesamtabmessungen des Elements: Inhalt + padding + border; Außenabstände bleiben ausgeschlossen. +## Vergleich der beiden Modelle + Im folgenden Beispiel gibt es zwei `div`-Elemente mit denselben Abmessungen, aber unterschiedlichen `box-sizing`-Werten. Beachten Sie, wie dies zu unterschiedlichen Gesamtgrößen im Browser führt: :::interactive_editor diff --git a/curriculum/challenges/german/blocks/lecture-working-with-dates/6733aafb9c0802f66cc1e056.md b/curriculum/challenges/german/blocks/lecture-working-with-dates/6733aafb9c0802f66cc1e056.md index 84c83a8fd92..82db94f4dc6 100644 --- a/curriculum/challenges/german/blocks/lecture-working-with-dates/6733aafb9c0802f66cc1e056.md +++ b/curriculum/challenges/german/blocks/lecture-working-with-dates/6733aafb9c0802f66cc1e056.md @@ -34,21 +34,31 @@ console.log(now); Für die Uhrzeit wird das 24-Stunden-Format verwendet, also ist `14:30` `2:30 PM`. `GMT-0700` ist der Zeitzonenversatz, und `Pacific Daylight Time` ist der Zeitzonenname. -Sie können auch ein bestimmtes Datum und eine bestimmte Uhrzeit an das `Date`-Objekt übergeben, indem Sie die Werte für Jahr, Monat, Tag, Stunde, Minute, Sekunde und Millisekunde als Argumente angeben. +Hier ist ein Beispiel dafür, wie Sie ein neues `Date`-Objekt mit einem bestimmten Datumsstring erstellen: -Hier ist ein Beispiel, wie man ein neues `Date`-Objekt mit einem bestimmten Datum und einer bestimmten Uhrzeit erstellt: +:::interactive_editor + +```js +const dateFromString = new Date("July 4, 1776 12:00:00"); + +console.log(dateFromString); +``` + +::: + +Sie können dem `Date`-Objekt auch ein bestimmtes Datum und eine bestimmte Uhrzeit übergeben, indem Sie die Werte für Jahr, Monat, Tag, Stunde, Minute, Sekunde und Millisekunde als Argumente angeben: :::interactive_editor ```js -const specificDate = new Date("July 4, 1776 12:00:00"); +const dateFromArguments = new Date(1776, 6, 4, 12, 0, 0, 0); -console.log(specificDate); +console.log(dateFromArguments); ``` ::: -Das ist nützlich, wenn Sie mit einem bestimmten Datum und einer bestimmten Uhrzeit arbeiten müssen, anstatt mit dem aktuellen Datum und der aktuellen Uhrzeit. Die Eingabe muss immer ein String sein, und das Format sollte vom `Date`-Objekt erkannt werden. +Das ist nützlich, wenn Sie mit einem bestimmten Datum und einer bestimmten Uhrzeit arbeiten müssen, anstatt mit dem aktuellen Datum und der aktuellen Uhrzeit. Um das aktuelle Datum und die aktuelle Uhrzeit zu erhalten, können Sie die `Date.now()`-Methode verwenden, die die Anzahl der Millisekunden seit `January 1, 1970, 00:00:00 UTC` zurückgibt. Dies ist als Unix-Epoch-Zeit bekannt. diff --git a/curriculum/challenges/german/blocks/lecture-working-with-file-systems/672ac403a9ba7732b31c6480.md b/curriculum/challenges/german/blocks/lecture-working-with-file-systems/672ac403a9ba7732b31c6480.md index eddf859f2bf..3d9737275b8 100644 --- a/curriculum/challenges/german/blocks/lecture-working-with-file-systems/672ac403a9ba7732b31c6480.md +++ b/curriculum/challenges/german/blocks/lecture-working-with-file-systems/672ac403a9ba7732b31c6480.md @@ -51,7 +51,7 @@ Und schließlich sprechen wir über Dokumentation. In Webanwendungen finden Sie Diese sind meist in einem Dateiformat namens Markdown geschrieben. Mit Markdown können Sie strukturierte Dokumente mit Überschriften, Unterüberschriften, Links, Bildern, Listen und mehr erstellen. Markdown-Dateien haben eine `.md`- oder `.markdown`-Erweiterung. -Hier finden Sie die `README`-Datei des GitHub-Repositorys von freeCodeCamp: https://github.com/freeCodeCamp/freeCodeCamp/blob/main/README.md +Hier finden Sie die `README`-Datei des GitHub-Repositorys von freeCodeCamp: `https://github.com/freeCodeCamp/freeCodeCamp/blob/main/README.md` Sie können diese detaillierte Struktur und Formatierung mit Markdown erstellen. diff --git a/curriculum/challenges/german/blocks/lecture-working-with-node-core-modules/695cc6a5eefd305381ec90bc.md b/curriculum/challenges/german/blocks/lecture-working-with-node-core-modules/695cc6a5eefd305381ec90bc.md index 6b5798832e8..ed776629b9a 100644 --- a/curriculum/challenges/german/blocks/lecture-working-with-node-core-modules/695cc6a5eefd305381ec90bc.md +++ b/curriculum/challenges/german/blocks/lecture-working-with-node-core-modules/695cc6a5eefd305381ec90bc.md @@ -148,7 +148,7 @@ async function readFileContent() { const fileContent = await fs.readFile("article.md", "utf8"); console.log("File content:", fileContent); } catch (err) { - console.log("File read successfully"); + console.error("Error reading file:", err); } } @@ -169,7 +169,7 @@ async function readFileContent() { const fileContent = await fs.readFile("article.md"); console.log("File content:", fileContent); } catch (err) { - console.log("File read successfully"); + console.error("Error reading file:", err); } } diff --git a/curriculum/challenges/german/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d2f232c60f0fa68ef86.md b/curriculum/challenges/german/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d2f232c60f0fa68ef86.md index b5eeda853c5..bc47647e522 100644 --- a/curriculum/challenges/german/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d2f232c60f0fa68ef86.md +++ b/curriculum/challenges/german/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d2f232c60f0fa68ef86.md @@ -1,6 +1,6 @@ --- id: 68ff6d2f232c60f0fa68ef86 -title: Was ist Node und was sind einige Unterschiede zwischen der Browser- und der Node-Laufzeitumgebung? +title: Was ist Node und was sind einige Unterschiede zwischen dem Browser- und dem Node-Laufzeitumfeld? challengeType: 19 dashedName: what-is-node-and-what-are-some-differences-between-the-browser-and-node-runtime-environment --- @@ -19,11 +19,11 @@ Zum Beispiel: Clientseitiges JavaScript hat diese Einschränkungen, weil es ursprünglich ausschließlich für die Ausführung in Webbrowsern entwickelt wurde. -Webbrowser stellen die Umgebung bereit, die benötigt wird, um JavaScript-Code auszuführen, einschließlich der JavaScript-Engine. Sie bieten auch Zugriff auf das Document Object Model (DOM), sodass Sie HTML-Elemente in Ihrem Code ansprechen können. +Webbrowser stellen die Umgebung bereit, die benötigt wird, um JavaScript-Code auszuführen, einschließlich der JavaScript-Engine. Sie bieten auch Zugriff auf das Document Object Model (DOM), sodass Sie in Ihrem Code auf HTML-Elemente zugreifen können. -Früher konnten wir JavaScript nicht außerhalb eines Browsers ausführen, aber jetzt ist das mit Node.js möglich. +Lange Zeit wurde JavaScript fast ausschließlich in Browsern verwendet, aber mit Node.js können Sie es auch außerhalb eines Browsers ausführen. -Node.js ist eine JavaScript-Laufzeitumgebung. Offiziell wird sie definiert als „eine Open-Source- und plattformübergreifende JavaScript-Laufzeitumgebung“. +Node.js ist eine JavaScript-Laufzeitumgebung. Es wird offiziell definiert als „eine Open-Source- und plattformübergreifende JavaScript-Laufzeitumgebung“. Sehen wir uns an, was das bedeutet: @@ -43,7 +43,7 @@ Die Browser-Umgebung ist hauptsächlich für die Frontend-Webentwicklung konzipi Zum Beispiel können Sie vom Browser aus auf die DOM-API zugreifen, aber der Zugriff auf das lokale Dateisystem ist eingeschränkt. Im Gegensatz dazu können Sie von der Node-Laufzeitumgebung aus auf fast alle Systemressourcen zugreifen, einschließlich des Dateisystems, aber nicht auf das DOM. -Beide JavaScript-Umgebungen stellen ein globales Objekt bereit. In der Browser-JavaScript-Laufzeit heißt dieses `window`. Dieses `window`-Objekt bietet Zugriff auf browserbezogene Funktionen, wie Methoden zur Manipulation des DOM, Verwaltung von Cookies und Behandlung von Browser-Ereignissen. In der Node.js-Umgebung heißt dieses globale Objekt `global`. Das `global`-Objekt bietet Zugriff auf Node.js-spezifische Funktionen, wie eingebaute Module zur Arbeit mit lokalen Dateien, Netzwerken und zur Interaktion mit dem Betriebssystem. +Beide JavaScript-Umgebungen stellen ein globales Objekt bereit. In der Browser-JavaScript-Laufzeit heißt dieses `window`. Dieses `window`-Objekt bietet Zugriff auf browserbezogene Funktionen, wie Methoden zur Manipulation des DOM, Verwaltung von Cookies und Behandlung von Browser-Ereignissen. In der Node.js-Umgebung heißt dieses globale Objekt `global`. Das `global`-Objekt bietet Zugriff auf Node.js-spezifische Funktionen, wie eingebaute Module zum Arbeiten mit lokalen Dateien, Netzwerken und zur Interaktion mit dem Betriebssystem. Schließlich ist ein weiterer wichtiger Unterschied, dass Sie die Version von Node.js, die Sie auf Ihrem Server verwenden möchten, selbst auswählen können. Sie haben jedoch keine Kontrolle über die Version der Browser-Umgebung, die Ihre Nutzer zum Besuch Ihrer Webseite verwenden. @@ -103,7 +103,7 @@ Denken Sie an die Rollen und Zwecke jeder Umgebung. --- -Die Node-Laufzeitumgebung verwendet das window-Objekt als globales Objekt, während Browser das global-Objekt verwenden. +Das Node-Laufzeitumfeld verwendet das `window`-Objekt als sein globales Objekt, während Browser das `global`-Objekt verwenden. ### --feedback-- diff --git a/curriculum/challenges/german/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d372ad364f285f0522e.md b/curriculum/challenges/german/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d372ad364f285f0522e.md index ea152026483..dacdcf96e0d 100644 --- a/curriculum/challenges/german/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d372ad364f285f0522e.md +++ b/curriculum/challenges/german/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d372ad364f285f0522e.md @@ -1,6 +1,6 @@ --- id: 68ff6d372ad364f285f0522e -title: Welche Vor- und Nachteile hat die Verwendung von Node im Back-End? +title: Was sind die Vor- und Nachteile der Verwendung von Node im Back-End? challengeType: 19 dashedName: what-are-the-advantages-and-disadvantages-to-using-node-on-the-back-end --- @@ -11,7 +11,7 @@ Ein großer Vorteil von Node.js ist, dass Sie sowohl das Front-End als auch das Die Architektur von Node ist ein weiterer Vorteil. Sie ist nicht blockierend und ereignisgesteuert, was sich hervorragend für die Entwicklung von Echtzeitanwendungen eignet, bei denen Reaktionsfähigkeit und Effizienz entscheidend für eine gute Benutzererfahrung sind. -Hier wird das Konzept der „Threads“ sehr wichtig. Ein Thread ist ein Ausführungspfad innerhalb eines Prozesses, wie ein Computerprogramm, das gerade läuft. +Hier wird das Konzept der „Threads“ sehr wichtig. Ein Thread ist ein Ausführungspfad innerhalb eines Prozesses, also eines Computerprogramms, das gerade läuft. Die Architektur von Node basiert auf einem einzelnen Thread und einer Ereignisschleife, die effektiv eine große Anzahl gleichzeitiger Anfragen und Ein-/Ausgabeoperationen verarbeiten kann. Das macht es perfekt für Anwendungen, die mehrere Anfragen gleichzeitig bearbeiten müssen. @@ -25,13 +25,13 @@ Und schließlich hat Node.js in Bezug auf Kosten den großen Vorteil, dass es ko Auf der anderen Seite hat Node.js auch bestimmte Nachteile oder Einschränkungen, die Sie kennen sollten. -Wie Sie gelernt haben, läuft es immer nur einen Thread gleichzeitig, was bedeutet, dass es immer nur eine Operation gleichzeitig bearbeiten kann. Obwohl seine Architektur es ermöglicht, effizient mit gleichzeitigen (simultanen) Anfragen umzugehen, können CPU-intensive Aufgaben den Hauptthread blockieren und zu Leistungsproblemen führen. +Wie Sie gelernt haben, führt Node Ihr JavaScript auf einem einzelnen Thread aus, was bedeutet, dass es immer nur einen Teil Ihres Codes gleichzeitig ausführen kann. Obwohl seine Architektur es ermöglicht, effizient mit gleichzeitigen (simultanen) Anfragen umzugehen, können CPU-intensive Aufgaben den Hauptthread blockieren und zu Leistungsproblemen führen. Beispiele für CPU-intensive Aufgaben sind komplexe mathematische Operationen, Bild- und Videobearbeitung sowie Kryptografie. Es gibt Möglichkeiten, dies zu umgehen, aber sie erhöhen meist die Komplexität der Anwendung. -Node.js basiert außerdem auf asynchroner Programmierung. Bei asynchroner Programmierung wird eine Aufgabe gestartet, die lange dauern kann, aber anstatt zu warten, bis sie abgeschlossen ist, läuft das Hauptprogramm weiter, während die asynchrone Aufgabe parallel ausgeführt wird. Wenn die Aufgabe abgeschlossen ist, verarbeitet das Programm das Ergebnis. +In der asynchronen Programmierung wird eine Aufgabe gestartet, die lange dauern kann, aber anstatt zu warten, bis sie abgeschlossen ist, läuft das Hauptprogramm weiter, während die asynchrone Aufgabe im Hintergrund ausgeführt wird. -Dieser Prozess beinhaltet oft sogenannte „Callbacks“, also Funktionen, die definieren, was passiert, wenn die asynchronen Operationen abgeschlossen sind. Die asynchrone Natur von Node.js kann den Code potenziell schwerer lesbar, verständlich und debugbar machen. +Dieser Prozess beinhaltet oft das, was wir als „Callbacks“ kennen, also Funktionen, die definieren, was passiert, wenn die asynchronen Operationen abgeschlossen sind. Die asynchrone Natur von Node.js kann den Code potenziell schwerer lesbar, verständlich und debugbar machen. Und schließlich sollten Sie auch vorsichtig sein bei der Auswahl von Paketen aus `npm`, dem Node-Paketmanager, weil einige davon möglicherweise nicht ständig gepflegt werden und so Sicherheitslücken in Ihre eigene Anwendung einführen können. Als Entwickler sollten Sie jedes Paket sorgfältig bewerten und prüfen, ob es bewährte Qualitäts- und Sicherheitspraktiken einhält. diff --git a/curriculum/challenges/german/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d39d7ed9ef36ff281f3.md b/curriculum/challenges/german/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d39d7ed9ef36ff281f3.md index de34cde613c..2658a9ab34a 100644 --- a/curriculum/challenges/german/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d39d7ed9ef36ff281f3.md +++ b/curriculum/challenges/german/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d39d7ed9ef36ff281f3.md @@ -41,7 +41,7 @@ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash ``` -Um die neueste Version von NVM zum Zeitpunkt des Lesens dieses Artikels zu erhalten, konsultieren Sie bitte die offizielle NVM-Dokumentation: `https://github.com/nvm-sh/nvm?tab=readme-ov-file#install--update-script`. Dort finden Sie diese Befehle mit der neuesten Versionsnummer. +Um die neueste Version von NVM zu erhalten, wenn Sie diese Lektion lesen, konsultieren Sie bitte die offizielle NVM-Dokumentation: `https://github.com/nvm-sh/nvm?tab=readme-ov-file#install--update-script`. Dort finden Sie diese Befehle mit der aktuellsten Versionsnummer. Möglicherweise müssen Sie Ihr Terminal neu starten, wenn der Vorgang abgeschlossen ist, damit der neue Befehl und die neue Konfiguration geladen werden. @@ -101,7 +101,7 @@ Sehen wir uns nun an, wie Sie NVM auf Windows installieren und verwenden können Offizielle Versionen von NVM unterstützen Windows nur in bestimmten Fällen. Wenn Sie das Windows Subsystem for Linux (WSL) auf Ihrem Gerät eingerichtet haben, können Sie der oben genannten macOS/Linux-Anleitung folgen, um NVM zu installieren und zu verwenden. -Für Windows selbst gibt es jedoch einige Alternativen. Eine davon ist `nvm-windows`, ein Node.js-Versionsverwaltungs-Tool für Windows. Dies ist ein völlig separates Projekt vom offiziellen NVM-Projekt. Aber der Zweck dieser Tools ist derselbe – Ihnen zu helfen, mit mehreren Versionen von Node.js auf demselben Gerät zu arbeiten. +Für Windows selbst gibt es jedoch einige Alternativen. Eine davon ist `nvm-windows`, ein Dienstprogramm zur Verwaltung von Node.js-Versionen für Windows. Dies ist ein völlig separates Projekt vom offiziellen NVM-Projekt. Aber der Zweck dieser Tools ist derselbe: Ihnen zu helfen, mit mehreren Versionen von Node.js auf demselben Gerät zu arbeiten. Bevor Sie `nvm-windows` installieren, sollten Sie wissen, dass das offizielle Repository empfiehlt, alle vorherigen Node-Installationen zu deinstallieren, bevor Sie NVM für Windows installieren. Wenn dies Ihre erste Node.js-Installation ist, sollten Sie in Ordnung sein. Wenn Sie bereits andere Versionen von Node.js installiert haben, wird empfohlen, diese zuerst zu deinstallieren. @@ -109,7 +109,7 @@ Um `nvm-windows` zu installieren: - Gehen Sie zum Releases-Abschnitt des offiziellen Repositorys: `https://github.com/coreybutler/nvm-windows/releases`. - Laden Sie den neuesten Installer herunter. -- Folgen Sie den Anweisungen. +- Folgen Sie den Anweisungen. Nach Abschluss der Installation müssen Sie möglicherweise Ihr Terminal neu starten, falls der `nvm`-Befehl nicht sofort verfügbar ist. @@ -155,7 +155,7 @@ nvm use 20 Sie können auch Ihre aktuelle Version von Node.js mit diesem Befehl überprüfen: -```bash +```powershell node -v ``` @@ -165,25 +165,25 @@ Jetzt, wo Sie wissen, wie man NVM und Node.js installiert, sehen wir uns einige Obwohl all diese Befehle für NVM auf macOS/Linux, einschließlich WSL, funktionieren, können sie für `nvm-windows` anders funktionieren oder gar nicht funktionieren. Wir geben alternative Befehle für `nvm-windows`, wann immer möglich. -### Wie man die Ausführungsrichtlinie von Powershell anpasst +### Wie man die Ausführungsrichtlinie von PowerShell anpasst -Wenn Sie Windows verwenden und mit Powershell und `nvm-windows` arbeiten, müssen Sie möglicherweise die Ausführungsrichtlinie von Powershell anpassen. Die Standard-Ausführungsrichtlinie für Powershell ist `Restricted`, eine Sicherheitsmaßnahme, um das Ausführen von Skripten zu verhindern. +Wenn Sie Windows verwenden und mit PowerShell und `nvm-windows` arbeiten, müssen Sie möglicherweise die Ausführungsrichtlinie von PowerShell anpassen. Die Standard-Ausführungsrichtlinie für PowerShell ist `Restricted`, was eine Sicherheitsmaßnahme ist, um das Ausführen von Skripten zu verhindern. -Führen Sie zuerst Powershell als Administrator aus, indem Sie mit der rechten Maustaste auf Powershell klicken und dann „Als Administrator ausführen“ wählen. +Öffnen Sie zuerst PowerShell als Administrator, indem Sie mit der rechten Maustaste auf PowerShell klicken und dann „Als Administrator ausführen“ wählen. -Um die aktuelle Ausführungsrichtlinie der aktuellen Powershell-Sitzung zu sehen, führen Sie den folgenden Befehl aus: +Um die aktuelle Ausführungsrichtlinie der aktuellen PowerShell-Sitzung zu sehen, führen Sie den folgenden Befehl aus: ```powershell Get-ExecutionPolicy ``` -Um schließlich die Ausführungsrichtlinie von Powershell auf `RemoteSigned` zu setzen, die lokale Skripte und `npm` ausführen lässt, verwenden Sie den folgenden Befehl: +Um schließlich die Ausführungsrichtlinie von PowerShell auf `RemoteSigned` zu setzen, was lokale Skripte und `npm` ausführen lässt, verwenden Sie den folgenden Befehl: ```powershell Set-ExecutionPolicy RemoteSigned ``` -Nachdem Sie den obigen Befehl ausgeführt haben, können Sie das Administratorfenster von Powershell schließen und ein nicht-administratives Powershell-Fenster öffnen. +Nachdem Sie den obigen Befehl ausgeführt haben, können Sie das Administratorfenster von PowerShell schließen und ein PowerShell-Fenster ohne Administratorrechte öffnen. ### Alle Versionen auflisten @@ -193,7 +193,7 @@ Um alle installierten Versionen von Node.js aufzulisten und die aktuell verwende nvm ls ``` -### Standard-Node.js-Version festlegen (nur NVM auf macOS/Linux) +### Standard-Node.js-Version festlegen (NVM nur auf macOS/Linux) Dieser Befehl legt die Standardversion von Node.js fest, die für neue Terminal-Sitzungen verwendet wird: diff --git a/curriculum/challenges/german/blocks/lecture-working-with-operator-behavior/6732719e2e3ad4d947410b65.md b/curriculum/challenges/german/blocks/lecture-working-with-operator-behavior/6732719e2e3ad4d947410b65.md index 7eaf485d22f..3546681774a 100644 --- a/curriculum/challenges/german/blocks/lecture-working-with-operator-behavior/6732719e2e3ad4d947410b65.md +++ b/curriculum/challenges/german/blocks/lecture-working-with-operator-behavior/6732719e2e3ad4d947410b65.md @@ -11,7 +11,13 @@ Wenn Sie in JavaScript einen Ausdruck mit mehreren Operatoren schreiben, wie ent Die Operatorpriorität bestimmt die Reihenfolge, in der Operationen in einem Ausdruck ausgewertet werden. Operatoren mit höherer Priorität werden vor denen mit niedrigerer Priorität ausgewertet. Denken Sie an die Operatorpriorität wie in der Mathematik, wo Division und Multiplikation vor Addition und Subtraktion stattfinden. -Ohne diese Regel würden einfache Gleichungen falsche Ergebnisse liefern. JavaScript funktioniert genauso. Es hat eigene Regeln, welche Operatoren zuerst, als zweites und so weiter kommen. Schauen Sie sich zum Beispiel den folgenden Ausdruck an: +Ohne diese Regel würden einfache Gleichungen falsche Ergebnisse liefern. JavaScript funktioniert genauso. Es hat seine eigenen Regeln dafür, welche Operatoren zuerst, zweitens und so weiter ausgeführt werden. + +## Vorrang in arithmetischen Ausdrücken + +### Vorrang der Multiplikation + +Schauen Sie sich zum Beispiel den folgenden Ausdruck an: :::interactive_editor @@ -25,36 +31,42 @@ console.log(result); // 14 Wenn JavaScript diesen Ausdruck von links nach rechts auswerten würde, würden Sie `2 + 3 = 5` erwarten, dann `5 * 4 = 20`. Aber da Multiplikation eine höhere Priorität als Addition hat, wertet JavaScript zuerst den `3 * 4`-Teil aus, was zu `2 + 12 = 14` führt. -Manchmal möchten Sie, dass bestimmte Teile Ihres Ausdrucks zuerst ausgeführt werden, unabhängig von den Prioritätsregeln. Dafür können Sie runde Klammern, `()`, verwenden. Alles, was in runden Klammern steht, wird zuerst ausgewertet, egal was. Lassen Sie uns den `2 + 3`-Teil des vorherigen Beispiels zuerst auswerten: +### Vorrang der Division + +Der Divisionsoperator hat ebenfalls eine höhere Priorität als Addition oder Subtraktion: :::interactive_editor ```js -const result = (2 + 3) * 4; +const result = 2 + 6 / 3; -console.log(result); // 20 +console.log(result); // 4 ``` ::: -Im obigen Beispiel zwingen die runden Klammern JavaScript dazu, zuerst `2 + 3` auszuwerten und dann das Ergebnis mit `4` zu multiplizieren. Das ergibt `20` statt `14`. +Wenn JavaScript diesen Ausdruck von links nach rechts auswerten würde, könnten Sie `2 + 6 = 8` erwarten, dann `8 / 3 = 2.67`. Aber da Division eine höhere Priorität als Addition hat, wertet JavaScript zuerst die Division aus: `6 / 3 = 2`, und addiert dann `2 + 2`, was das Ergebnis `4` ergibt. -Der Divisionsoperator hat ebenfalls eine höhere Priorität als Addition oder Subtraktion: +### Verwendung von runden Klammern, um den Vorrang zu überschreiben + +Manchmal möchten Sie, dass bestimmte Teile Ihres Ausdrucks zuerst ausgeführt werden, unabhängig von den Vorrangregeln. Sie können dafür runde Klammern, `()`, verwenden. Alles, was in Klammern steht, wird zuerst ausgewertet, egal was passiert. Lassen Sie uns den Teil `2 + 3` aus dem Multiplikationsbeispiel zuerst auswerten: :::interactive_editor ```js -const result = 2 + 6 / 3; +const result = (2 + 3) * 4; -console.log(result); // 4 +console.log(result); // 20 ``` ::: -Wenn JavaScript diesen Ausdruck von links nach rechts auswerten würde, könnten Sie `2 + 6 = 8` erwarten, dann `8 / 3 = 2.67`. Aber da Division eine höhere Priorität als Addition hat, wertet JavaScript zuerst die Division aus: `6 / 3 = 2`, und addiert dann `2 + 2`, was das Ergebnis `4` ergibt. +Im obigen Beispiel zwingen die runden Klammern JavaScript dazu, zuerst `2 + 3` auszuwerten und dann das Ergebnis mit `4` zu multiplizieren. Das ergibt `20` statt `14`. Sowohl bei Multiplikation als auch bei Division finden diese Operationen also immer vor Addition und Subtraktion statt, es sei denn, Sie verwenden runde Klammern, um die Reihenfolge zu ändern. Aber was passiert, wenn die Operatoren dieselbe Priorität haben? JavaScript verwendet die Assoziativität, um die Reihenfolge der Auswertung zu bestimmen. +## Verstehen der Assoziativität + Die Assoziativität sagt JavaScript, ob Operatoren von links nach rechts oder von rechts nach links ausgewertet werden. Für die meisten Operatoren wie Addition und Multiplikation ist die Assoziativität von links nach rechts. JavaScript verarbeitet diese also von der linken Seite des Ausdrucks zur rechten: :::interactive_editor @@ -84,6 +96,8 @@ console.log(a + b); // 10 Im obigen Beispiel weist JavaScript zuerst `5` `b` zu, dann weist es `b` (das jetzt `5` ist) `a` zu. +### Der Exponentenoperator + Der Exponentenoperator ist ebenfalls von rechts nach links assoziativ: :::interactive_editor diff --git a/curriculum/challenges/german/blocks/lecture-working-with-regular-expressions/6733c5e54e3a154c8078ed48.md b/curriculum/challenges/german/blocks/lecture-working-with-regular-expressions/6733c5e54e3a154c8078ed48.md index a1c397bfe5f..91dd3b1b633 100644 --- a/curriculum/challenges/german/blocks/lecture-working-with-regular-expressions/6733c5e54e3a154c8078ed48.md +++ b/curriculum/challenges/german/blocks/lecture-working-with-regular-expressions/6733c5e54e3a154c8078ed48.md @@ -17,6 +17,8 @@ const regex = /^\d\d\d\d$/; Und das funktioniert: Es werden genau vier numerische Zeichen gefunden. Aber anstatt dieselbe Klasse mehrfach zu schreiben, können Sie ihr einen Quantifizierer geben. +## Exakte Quantifizierer + Quantifizierer werden durch geschweifte Klammern definiert, die eine oder zwei Zahlen enthalten. Verwenden wir einen Quantifizierer in unserem Muster: ```js @@ -40,6 +42,8 @@ console.log(regex.test("1234567")); // false Das Muster findet nur den String mit genau vier Ziffern, weil wir die Anker verwendet haben und unser Quantifizierer nur genau vier Ziffern erlaubt. Aber vielleicht muss der Identifikationscode nur mindestens vier Ziffern haben. +## Minimum- und Maximum-Quantifizierer + Um vier oder mehr Ziffern zu erlauben, fügen Sie ein Komma nach der Zahl in Ihrem Quantifizierer hinzu: ```js @@ -84,6 +88,10 @@ console.log(regex.test("1234567")); // false Beachten Sie, dass Sie diese Syntax nicht verwenden können, um nur ein Maximum festzulegen: Sie müssen immer ein Minimum angeben. Wenn Sie das Minimum auf `1` setzen, erreichen Sie effektiv dasselbe Ergebnis. +## Kurzschreibweisen für Quantifizierer + +### Der Fragezeichen-Quantifizierer (`?`) + Wir haben aktualisierte Anforderungen von unseren Nutzenden erhalten. Identifikatoren können jetzt optional mit einem Buchstaben beginnen. Wir kennen bereits die Zeichenklasse dafür, also fügen wir sie unserem regulären Ausdruck hinzu: ```js @@ -122,6 +130,8 @@ console.log(regex.test("1234567")); // false Unser Muster erlaubt jetzt einen einzelnen optionalen Buchstaben, gefolgt von vier bis sechs Ziffern. +### Der Sternchen-Quantifizierer (`*`) + Leider haben wir gerade festgestellt, dass wir die Anforderungen falsch gelesen haben. Wir müssen beliebig viele Buchstaben vor den Zahlen erlauben. Wir können unseren Quantifizierer mit einem Minimum von `0` und ohne definiertes Maximum verwenden: ```js @@ -144,6 +154,8 @@ console.log(regex.test("1234567")); // false ::: +### Der Plus-Quantifizierer (`+`) + Jetzt matchen wir erfolgreich jeden Bezeichner mit null oder mehr Buchstaben, gefolgt von vier bis sechs Zahlen. Aber das bringt unser System zum Absturz: Wir müssen tatsächlich mindestens einen Buchstaben verlangen. Wir könnten wieder einen Quantifizierer mit einem Minimum von eins und ohne definiertes Maximum verwenden, oder wir nutzen eine weitere spezielle Syntax, das Pluszeichen (`+`): diff --git a/curriculum/challenges/german/blocks/lecture-working-with-the-dom-click-events-and-web-apis/673368ccf52205329b729378.md b/curriculum/challenges/german/blocks/lecture-working-with-the-dom-click-events-and-web-apis/673368ccf52205329b729378.md index 89be2b414ea..71a416c7555 100644 --- a/curriculum/challenges/german/blocks/lecture-working-with-the-dom-click-events-and-web-apis/673368ccf52205329b729378.md +++ b/curriculum/challenges/german/blocks/lecture-working-with-the-dom-click-events-and-web-apis/673368ccf52205329b729378.md @@ -7,12 +7,16 @@ dashedName: what-is-the-difference-between-innertext-textcontent-and-innerhtml # --interactive-- +## Überblick + Lernen wir etwas über `innerText`, `textContent` und `innerHTML`. Dies sind Eigenschaften, auf die Sie in JavaScript zugreifen können, um den Inhalt eines HTML-Elements abzurufen oder zu ändern. Auch wenn sie auf den ersten Blick sehr ähnlich aussehen, gibt es wichtige Unterschiede. Die Wahl der richtigen Eigenschaft hängt von Ihrem konkreten Anwendungsfall ab, also steigen wir ein. Beginnen wir mit `innerText`. +## Verständnis von innerText + `innerText` stellt den sichtbaren Textinhalt des HTML-Elements und seiner Nachfahren dar. Diese Eigenschaft enthält keinen versteckten Text oder HTML-Tags, sondern nur den gerenderten Text. Zum Beispiel sehen Sie hier ein `div`-Element, das zwei Absätze enthält: @@ -109,6 +113,8 @@ Da `innerText` die Sichtbarkeit berücksichtigt, löst das Abrufen seines Werts Gut. Nun sprechen wir über `textContent`. +## Verständnis von textContent + `textContent` gibt den reinen Textinhalt eines Elements zurück, einschließlich aller Texte innerhalb seiner Nachfahren. Der wichtigste Unterschied zwischen `innerText` und `textContent` ist, dass `textContent` immer den vollständigen Textinhalt eines HTML-Elements und seiner Nachfahren zurückgibt, unabhängig davon, ob er sichtbar oder verborgen ist. @@ -181,6 +187,8 @@ container.textContent = "New content"; ::: +## Vergleich mit innerHTML + Und schließlich sprechen wir darüber, wie sich `textContent` und `innerText` von `innerHTML` unterscheiden. Denken Sie daran, dass Sie mit `innerHTML` den inneren HTML-Inhalt eines Elements setzen können. Das ist hilfreich, um neuen HTML-Code dynamisch in den DOM einzufügen. @@ -189,6 +197,8 @@ Beachten Sie jedoch, dass dies ein Sicherheitsrisiko darstellt, wenn Sie keine K Um dies zu vermeiden, wird empfohlen, die `textContent`-Eigenschaft zu verwenden, um reinen Text einzufügen. +## Zusammenfassung der wichtigsten Unterschiede + Die `innerText`-, `textContent`- und `innerHTML`-Eigenschaften in JavaScript bieten verschiedene Möglichkeiten, auf den Inhalt von HTML-Elementen zuzugreifen und ihn zu manipulieren. Sie sollten die Unterschiede zwischen diesen Eigenschaften verstehen, wenn Sie effektiv mit HTML-Inhalten in JavaScript arbeiten möchten. # --questions-- @@ -219,7 +229,7 @@ Welche der folgenden Eigenschaften gibt den sichtbaren Textinhalt eines HTML-Ele --- -Alle oben genannten. +Alle oben genannten Punkte. ### --feedback-- @@ -255,7 +265,7 @@ Welche der folgenden Eigenschaften kann verwendet werden, um dynamisch neuen HTM --- -Keine der oben genannten. +Keine der oben genannten Antworten. ### --feedback-- @@ -291,7 +301,7 @@ Welche der folgenden Eigenschaften gibt den reinen Textinhalt eines Elements zur --- -Alle oben genannten. +Alle oben genannten Punkte. ### --feedback-- diff --git a/curriculum/challenges/german/blocks/machine-learning-with-python-projects/5e46f8d6ac417301a38fb92d.md b/curriculum/challenges/german/blocks/machine-learning-with-python-projects/5e46f8d6ac417301a38fb92d.md index 693791607b2..35965e23874 100644 --- a/curriculum/challenges/german/blocks/machine-learning-with-python-projects/5e46f8d6ac417301a38fb92d.md +++ b/curriculum/challenges/german/blocks/machine-learning-with-python-projects/5e46f8d6ac417301a38fb92d.md @@ -10,7 +10,7 @@ dashedName: rock-paper-scissors Für diese Aufgabe erstellen Sie ein Programm, das Schere, Stein, Papier spielt. Ein Programm, das zufällig auswählt, gewinnt normalerweise 50 % der Zeit. Um diese Aufgabe zu bestehen, muss Ihr Programm gegen vier verschiedene Bots antreten und in jedem Match mindestens 60 % der Spiele gewinnen. -Sie werden <a href="https://app.ona.com/?autostart=true#https://github.com/freeCodeCamp/boilerplate-rock-paper-scissors/" target="_blank" rel="noopener noreferrer nofollow">mit unserem Ona-Starter-Code an diesem Projekt arbeiten</a>. +Sie werden <a href="https://codespaces.new/freeCodeCamp/boilerplate-rock-paper-scissors/" target="_blank" rel="noopener noreferrer nofollow">an diesem Projekt mit unserem Boilerplate-Code arbeiten</a>. Wir entwickeln den interaktiven Unterrichtsteil des Machine-Learning-Lehrplans noch. Für den Moment müssen Sie andere Ressourcen nutzen, um zu lernen, wie Sie diese Aufgabe bestehen. diff --git a/curriculum/challenges/german/blocks/review-introduction-to-express/6a0354d43d4c00eca38561f7.md b/curriculum/challenges/german/blocks/review-introduction-to-express/6a0354d43d4c00eca38561f7.md index 7d028dda629..ab394c1993a 100644 --- a/curriculum/challenges/german/blocks/review-introduction-to-express/6a0354d43d4c00eca38561f7.md +++ b/curriculum/challenges/german/blocks/review-introduction-to-express/6a0354d43d4c00eca38561f7.md @@ -7,53 +7,6 @@ dashedName: review-introduction-to-express # --description-- -## Webservices und APIs - -- **API (Application Programming Interface)**: Eine allgemeine Möglichkeit für Software, mit anderer Software zu kommunizieren. -- **Webservice**: Ein spezieller Typ von API, der Webtechnologien wie HTTP verwendet, um Daten über ein Netzwerk auszutauschen. Jeder Webservice ist eine API, aber nicht jede API ist ein Webservice. -- **Wesentliche Merkmale eines Webservice**: Läuft auf einem Server, ermöglicht Maschine-zu-Maschine-Kommunikation, ist sprachunabhängig, plattformunabhängig und verwendet standardisierte Webprotokolle (HTTP/HTTPS, FTP, SMTP). -- **REST (Representational State Transfer)**: Der heute am weitesten verbreitete Typ von Webservice. Macht Ressourcen verfügbar, die durch URL-Pfade wie `/users` oder `/users/20` identifiziert werden. Antworten sind meist in JSON, können aber auch XML oder Klartext sein. -- **SOAP (Simple Object Access Protocol)**: Verwendet ausschließlich XML. Häufig in Unternehmenssystemen, die strengere Standards und Sicherheit benötigen. -- **XML-RPC**: Verwendet XML zur Kodierung von Anfragen und Antworten. Leichtgewichtig, aber weniger flexibel als REST. -- **`Accept` Kopfzeile**: Wird vom Client verwendet, um dem Server mitzuteilen, in welchem Format die Antwort gewünscht wird, zum Beispiel `Accept: application/json`. - -## Die REST-Architektur - -- **Zustandslosigkeit**: Jede Anfrage muss alle Informationen enthalten, die der Server zur Verarbeitung benötigt. Der Server merkt sich keine vorherigen Anfragen. -- **Ressource**: Ein Datenstück, auf das zugegriffen oder das geändert werden kann, identifiziert durch eine URL (zum Beispiel `/products/1`). -- **HTTP-Methoden in REST**: - - `GET` — eine Ressource abrufen - - `POST` — eine neue Ressource erstellen - - `PUT` / `PATCH` — eine bestehende Ressource aktualisieren - - `DELETE` — eine Ressource entfernen - -## HTTP-Statuscodes - -Nach der Verarbeitung einer Anfrage antwortet der Server mit einem **Statuscode**, der das Ergebnis angibt: - -- `200` **(OK)**: Die Anfrage war erfolgreich -- `201` **(Created)**: Eine neue Ressource wurde erstellt -- `400` **(Bad Request)**: Der Client hat ungültige Daten gesendet -- `404` **(Not Found)**: Die angeforderte Ressource existiert nicht -- `500` **(Internal Server Error)**: Auf dem Server ist ein Fehler aufgetreten - -### Wie eine REST-Anfrage funktioniert - -1. Der Client sendet eine Anfrage mit Methode, URL, optionalen Kopfzeilen und optionalem Body. -2. Der Server überprüft die Anfrage und identifiziert die Ressource. -3. Der Server führt die Aktion aus (abrufen, erstellen, aktualisieren oder löschen). -4. Der Server erstellt eine Antwort mit Statuscode und optionalem Body (meist JSON). -5. Der Server sendet die Antwort — es wird kein Client-Zustand gespeichert. -6. Der Client prüft den Statuscode und verarbeitet die zurückgegebenen Daten. - -## Monolithen vs. Microservices - -- **Monolith**: Eine einzelne, große Codebasis, in der UI, Datenbank und API zusammenleben. Funktioniert gut für kleine Anwendungen, wird aber schwerer zu warten und zu skalieren, wenn sie wächst. -- **Microservices**: Eine Architektur, bei der eine große Anwendung in kleinere, unabhängige Dienste aufgeteilt wird. Jeder Dienst übernimmt eine Geschäftsfähigkeit (zum Beispiel Produkte, Bestellungen, Zahlungen) und kann eine eigene Codebasis, Datenbank und Team haben. -- **Wie Microservices kommunizieren**: Über APIs oder nachrichtenbasierte Systeme. -- **Vorteile von Microservices**: Schnellere Entwicklung, bessere Fehlerisolierung und die Freiheit, verschiedene Sprachen oder Frameworks pro Dienst zu verwenden. -- **Herausforderungen von Microservices**: Komplexeres Debugging, schwierigere Infrastrukturverwaltung und mehr Netzwerk-Overhead zwischen Diensten. - ## Was ist Express.js? - **Express**: Ein minimalistisches und flexibles Webframework, das auf Node.js aufbaut und das Erstellen von Webservern und APIs erleichtert. diff --git a/curriculum/challenges/german/blocks/review-rest-api-and-web-services/6a7c78ad958a597ee788ad2a.md b/curriculum/challenges/german/blocks/review-rest-api-and-web-services/6a7c78ad958a597ee788ad2a.md new file mode 100644 index 00000000000..1a9fb70301b --- /dev/null +++ b/curriculum/challenges/german/blocks/review-rest-api-and-web-services/6a7c78ad958a597ee788ad2a.md @@ -0,0 +1,59 @@ +--- +id: 6a7c78ad958a597ee788ad2a +title: REST-API- und Webservices-Überprüfung +challengeType: 31 +dashedName: review-rest-api-and-web-services +--- + +# --description-- + +## Webservices und APIs + +- **API (Application Programming Interface)**: Eine allgemeine Möglichkeit für Software, mit anderer Software zu kommunizieren. +- **Webservice**: Ein spezieller Typ von API, der Webtechnologien wie HTTP verwendet, um Daten über ein Netzwerk auszutauschen. Jeder Webservice ist eine API, aber nicht jede API ist ein Webservice. +- **Wesentliche Merkmale eines Webservice**: Läuft auf einem Server, ermöglicht Maschine-zu-Maschine-Kommunikation, ist sprachunabhängig, plattformunabhängig und verwendet standardisierte Webprotokolle (HTTP/HTTPS, FTP, SMTP). +- **REST (Representational State Transfer)**: Der heute am weitesten verbreitete Typ von Webservice. Macht Ressourcen verfügbar, die durch URL-Pfade wie `/users` oder `/users/20` identifiziert werden. Antworten sind meist in JSON, können aber auch XML oder Klartext sein. +- **SOAP (Simple Object Access Protocol)**: Verwendet ausschließlich XML. Häufig in Unternehmenssystemen, die strengere Standards und Sicherheit benötigen. +- **XML-RPC**: Verwendet XML zur Kodierung von Anfragen und Antworten. Leichtgewichtig, aber weniger flexibel als REST. +- **`Accept` Kopfzeile**: Wird vom Client verwendet, um dem Server mitzuteilen, in welchem Format die Antwort gewünscht wird, zum Beispiel `Accept: application/json`. + +## Die REST-Architektur + +- **Zustandslosigkeit**: Jede Anfrage muss alle Informationen enthalten, die der Server zur Verarbeitung benötigt. Der Server merkt sich keine vorherigen Anfragen. +- **Ressource**: Ein Datenstück, auf das zugegriffen oder das geändert werden kann, identifiziert durch eine URL (zum Beispiel `/products/1`). +- **HTTP-Methoden in REST**: + - `GET` — eine Ressource abrufen + - `POST` — eine neue Ressource erstellen + - `PUT` / `PATCH` — eine bestehende Ressource aktualisieren + - `DELETE` — eine Ressource entfernen + +## HTTP-Statuscodes + +Nach der Verarbeitung einer Anfrage antwortet der Server mit einem **Statuscode**, der das Ergebnis angibt: + +- `200` **(OK)**: Die Anfrage war erfolgreich +- `201` **(Created)**: Eine neue Ressource wurde erstellt +- `400` **(Bad Request)**: Der Client hat ungültige Daten gesendet +- `404` **(Not Found)**: Die angeforderte Ressource existiert nicht +- `500` **(Internal Server Error)**: Auf dem Server ist ein Fehler aufgetreten + +### Wie eine REST-Anfrage funktioniert + +1. Der Client sendet eine Anfrage mit Methode, URL, optionalen Kopfzeilen und optionalem Body. +2. Der Server überprüft die Anfrage und identifiziert die Ressource. +3. Der Server führt die Aktion aus (abrufen, erstellen, aktualisieren oder löschen). +4. Der Server erstellt eine Antwort mit Statuscode und optionalem Body (meist JSON). +5. Der Server sendet die Antwort — es wird kein Client-Zustand gespeichert. +6. Der Client prüft den Statuscode und verarbeitet die zurückgegebenen Daten. + +## Monolithen vs. Microservices + +- **Monolith**: Eine einzelne, große Codebasis, in der UI, Datenbank und API zusammenleben. Funktioniert gut für kleine Anwendungen, wird aber schwerer zu warten und zu skalieren, wenn sie wächst. +- **Microservices**: Eine Architektur, bei der eine große Anwendung in kleinere, unabhängige Dienste aufgeteilt wird. Jeder Dienst übernimmt eine Geschäftsfähigkeit (zum Beispiel Produkte, Bestellungen, Zahlungen) und kann eine eigene Codebasis, Datenbank und Team haben. +- **Wie Microservices kommunizieren**: Über APIs oder nachrichtenbasierte Systeme. +- **Vorteile von Microservices**: Schnellere Entwicklung, bessere Fehlerisolierung und die Freiheit, verschiedene Sprachen oder Frameworks pro Dienst zu verwenden. +- **Herausforderungen von Microservices**: Komplexeres Debugging, schwierigere Infrastrukturverwaltung und mehr Netzwerk-Overhead zwischen Diensten. + +# --assignment-- + +Überprüfen Sie die Themen und Konzepte zu REST-API und Webservices. diff --git a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e89d557d4b78bf83a02ae6.md b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e89d557d4b78bf83a02ae6.md index f73441037f1..b88ef27a4bf 100644 --- a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e89d557d4b78bf83a02ae6.md +++ b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e89d557d4b78bf83a02ae6.md @@ -396,10 +396,10 @@ body { const { useState } = React; export const FootballPlayerCard = () => { - return ( + return ( --fcc-editable-region-- - <h1 style={{ backgroundColor: '#fff' }}>Hello, TSX!</h1> + <h1 style={{ backgroundColor: "#fff" }}>Hello, TSX!</h1> --fcc-editable-region-- - ) + ); }; ``` diff --git a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb2.md b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb2.md index c292501f434..7fcd77e6154 100644 --- a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb2.md +++ b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb2.md @@ -29,12 +29,10 @@ assert.equal(element?.type, window.index.PlayerCard); <meta charset="utf-8"/> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Football Player Card Builder - - - + @@ -379,21 +377,18 @@ body { ```tsx const { useState } = React; -export function PlayerCard() { +export const PlayerCard = () => { return ( -
- -
+
); -} +}; export const FootballPlayerCard = () => { - + --fcc-editable-region-- return ( - --fcc-editable-region-- -

Football Card Builder

- --fcc-editable-region-- - ) +

Football Card Builder

+ ); + --fcc-editable-region-- }; ``` diff --git a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb3.md b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb3.md index b5e5fca1d35..a6e67f5eb0e 100644 --- a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb3.md +++ b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb3.md @@ -382,15 +382,13 @@ export const PlayerCard = () => { return (
--fcc-editable-region-- - + --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { - return ( - - ); + return ; }; ``` diff --git a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb4.md b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb4.md index 53fac2c3b35..ec7846644a1 100644 --- a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb4.md +++ b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb4.md @@ -381,12 +381,12 @@ export const PlayerCard = () => {
--fcc-editable-region-- - + --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb5.md b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb5.md index eec69e72145..d63b42406ff 100644 --- a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb5.md +++ b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb5.md @@ -394,13 +394,13 @@ export const PlayerCard = () => {
--fcc-editable-region-- - + --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb6.md b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb6.md index 44df9097990..e065e13c6eb 100644 --- a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb6.md +++ b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb6.md @@ -390,14 +390,14 @@ export const PlayerCard = () => {
98
--fcc-editable-region-- - + --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb7.md b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb7.md index 6b4930a5ed7..830205e7882 100644 --- a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb7.md +++ b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb7.md @@ -398,13 +398,13 @@ export const PlayerCard = () => {
ST
--fcc-editable-region-- - + --fcc-editable-region-- ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb8.md b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb8.md index 6c6c9667dcb..1ad68c9574c 100644 --- a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb8.md +++ b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb8.md @@ -394,14 +394,14 @@ export const PlayerCard = () => {
GOLD
--fcc-editable-region-- - + --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb9.md b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb9.md index d7c2d748d75..c5cdc035549 100644 --- a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb9.md +++ b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb9.md @@ -393,12 +393,12 @@ export const PlayerCard = () => { --fcc-editable-region-- - + --fcc-editable-region-- ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bba.md b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bba.md index 659b379d128..4116561ca57 100644 --- a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bba.md +++ b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bba.md @@ -412,13 +412,13 @@ export const PlayerCard = () => {
--fcc-editable-region-- - + --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbb.md b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbb.md index 65fe304b6ab..7ba7f9f196c 100644 --- a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbb.md +++ b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbb.md @@ -406,12 +406,12 @@ export const PlayerCard = () => { Edson Arantes do Nascimento (Pele) headshot --fcc-editable-region-- - + --fcc-editable-region-- ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbc.md b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbc.md index bbb793d532c..93a6f6bbf6b 100644 --- a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbc.md +++ b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbc.md @@ -409,12 +409,12 @@ export const PlayerCard = () => { PELE --fcc-editable-region-- - + --fcc-editable-region-- ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbd.md b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbd.md index 98589791694..5b4911ea5a3 100644 --- a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbd.md +++ b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbd.md @@ -427,13 +427,13 @@ export const PlayerCard = () => { --fcc-editable-region-- - + --fcc-editable-region-- ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbe.md b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbe.md index d982f79797f..a91a47e66d4 100644 --- a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbe.md +++ b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbe.md @@ -465,7 +465,7 @@ export const PlayerCard = () => { ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbf.md b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbf.md index a229ca87131..9be34cb3bda 100644 --- a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbf.md +++ b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbf.md @@ -420,7 +420,7 @@ interface PlayerData { position: string; club: string; --fcc-editable-region-- - + --fcc-editable-region-- } @@ -478,7 +478,7 @@ export const PlayerCard = () => { ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc0.md b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc0.md index a74a77a896b..53ef4e7beac 100644 --- a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc0.md +++ b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc0.md @@ -497,7 +497,7 @@ export const PlayerCard = () => { ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc1.md b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc1.md index b648495d226..84b86173549 100644 --- a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc1.md +++ b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc1.md @@ -398,10 +398,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } --fcc-editable-region-- @@ -460,7 +460,7 @@ export const PlayerCard = () => { ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc2.md b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc2.md index f9baf1a1a76..0ffe1ec321d 100644 --- a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc2.md +++ b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc2.md @@ -40,12 +40,10 @@ assert.exists(document.querySelector('.card-wrapper.tier-elite')); Football Player Card Builder - - - + @@ -405,10 +403,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -467,9 +465,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc3.md b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc3.md index b220ee9f1df..98b23893729 100644 --- a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc3.md +++ b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc3.md @@ -399,10 +399,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -461,9 +461,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc4.md b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc4.md index 0b0e1a2605b..fe07c5addb3 100644 --- a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc4.md +++ b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc4.md @@ -399,10 +399,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -461,9 +461,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc5.md b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc5.md index 6f3a080bc6a..2ce3cd910c4 100644 --- a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc5.md +++ b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc5.md @@ -392,10 +392,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -456,9 +456,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc6.md b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc6.md index c6f8ece4f50..2eb0b21e50a 100644 --- a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc6.md +++ b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc6.md @@ -401,10 +401,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -465,9 +465,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc7.md b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc7.md index af088362db4..941023b8b25 100644 --- a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc7.md +++ b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc7.md @@ -391,10 +391,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -455,9 +455,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc8.md b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc8.md index 162e07d91ce..f202481203b 100644 --- a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc8.md +++ b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc8.md @@ -407,10 +407,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -436,9 +436,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { {player.name}
- --fcc-editable-region--
+ --fcc-editable-region-- 97 PAC
@@ -448,10 +448,10 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
83 + --fcc-editable-region-- PAS
- --fcc-editable-region--
@@ -471,9 +471,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc9.md b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc9.md index 2a54c22e02c..49e4a703275 100644 --- a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc9.md +++ b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc9.md @@ -483,10 +483,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -545,13 +545,13 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
); -} +}; --fcc-editable-region-- --fcc-editable-region-- export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bca.md b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bca.md index 1db2c4e8ec9..25c2d7d9259 100644 --- a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bca.md +++ b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bca.md @@ -419,10 +419,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -481,14 +481,14 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { - name: 'PELE', + name: "PELE", overallRating: 98, - position: 'ST', - club: 'Santos FC', - imageUrl: 'https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg', + position: "ST", + club: "Santos FC", + imageUrl: "https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg", pac: 97, sho: 98, pas: 83, diff --git a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcb.md b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcb.md index 0acc01a64eb..c68473ab77c 100644 --- a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcb.md +++ b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcb.md @@ -435,10 +435,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -497,14 +497,14 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { - name: 'PELE', + name: "PELE", overallRating: 98, - position: 'ST', - club: 'Santos FC', - imageUrl: 'https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg', + position: "ST", + club: "Santos FC", + imageUrl: "https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg", pac: 97, sho: 98, pas: 83, @@ -517,6 +517,7 @@ export const FootballPlayerCard = () => { const [player, setPlayer] = useState(defaultPlayer); return ( --fcc-editable-region-- + --fcc-editable-region-- ); diff --git a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcc.md b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcc.md index 2170f9feeb8..37d61ea2c69 100644 --- a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcc.md +++ b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcc.md @@ -477,7 +477,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -504,7 +504,9 @@ export const FootballPlayerCard = () => { --fcc-editable-region-- + + --fcc-editable-region-- ); diff --git a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcd.md b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcd.md index fbda9057895..752d7650396 100644 --- a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcd.md +++ b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcd.md @@ -465,7 +465,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bce.md b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bce.md index 795438cd894..83f3c015835 100644 --- a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bce.md +++ b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bce.md @@ -470,7 +470,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcf.md b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcf.md index 388f1cd1439..feaa6c343bc 100644 --- a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcf.md +++ b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcf.md @@ -488,7 +488,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd0.md b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd0.md index a1d97b907c8..6f556c95e70 100644 --- a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd0.md +++ b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd0.md @@ -471,7 +471,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -542,3 +542,4 @@ export const FootballPlayerCard = () => { ); }; ``` + diff --git a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd1.md b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd1.md index 86644328aa5..f653c15dfa0 100644 --- a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd1.md +++ b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd1.md @@ -471,7 +471,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd2.md b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd2.md index 011f7c7d010..3880b4e16fe 100644 --- a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd2.md +++ b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd2.md @@ -471,7 +471,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -535,7 +535,7 @@ export const FootballPlayerCard = () => { - --fcc-editable-region-- + --fcc-editable-region-- --fcc-editable-region-- diff --git a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd3.md b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd3.md index 6a04e634808..bf52483c7c1 100644 --- a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd3.md +++ b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd3.md @@ -497,7 +497,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd4.md b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd4.md index 31492042df5..df4f1299756 100644 --- a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd4.md +++ b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd4.md @@ -497,7 +497,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd5.md b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd5.md index 6e8deafcdc5..db178065d79 100644 --- a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd5.md +++ b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd5.md @@ -497,7 +497,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd6.md b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd6.md index 79c3eb24428..4a4369dfe6d 100644 --- a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd6.md +++ b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd6.md @@ -470,7 +470,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd7.md b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd7.md index dee25936cb3..44f9d390386 100644 --- a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd7.md +++ b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd7.md @@ -478,7 +478,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd8.md b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd8.md index 4642ce05bcd..22222f721db 100644 --- a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd8.md +++ b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd8.md @@ -410,7 +410,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -484,7 +484,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -538,8 +538,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd9.md b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd9.md index 375fffb86c5..21a4d4b113f 100644 --- a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd9.md +++ b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd9.md @@ -402,7 +402,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -476,7 +476,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -530,8 +530,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bda.md b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bda.md index c6343d4e5a1..1af2685caef 100644 --- a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bda.md +++ b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bda.md @@ -402,7 +402,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -476,7 +476,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -530,8 +530,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdb.md b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdb.md index f813ca091f6..b24e002ebb2 100644 --- a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdb.md +++ b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdb.md @@ -402,7 +402,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -476,7 +476,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -530,8 +530,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdc.md b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdc.md index 45a48f86ddd..cf000791f7e 100644 --- a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdc.md +++ b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdc.md @@ -402,7 +402,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -476,7 +476,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -530,8 +530,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdd.md b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdd.md index 72cf2d5d02d..51c50c672af 100644 --- a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdd.md +++ b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdd.md @@ -402,7 +402,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -476,7 +476,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -530,8 +530,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bde.md b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bde.md index 44253c73f30..af439833356 100644 --- a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bde.md +++ b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bde.md @@ -402,7 +402,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -414,10 +414,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -430,7 +430,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
{player.position}
-
{getPlayerTier(player.overallRating).toUpperCase()}
+
+ {getPlayerTier(player.overallRating).toUpperCase()} +
{player.club}
@@ -474,14 +476,14 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { - name: 'PELE', + name: "PELE", overallRating: 98, - position: 'ST', - club: 'Santos FC', - imageUrl: 'https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg', + position: "ST", + club: "Santos FC", + imageUrl: "https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg", pac: 97, sho: 98, pas: 83, @@ -506,8 +508,18 @@ export const FootballPlayerCard = () => {

Player Info

- - setPlayer({ ...player, name: e.target.value })} /> + + + setPlayer({ ...player, name: e.target.value }) + } + />
@@ -518,8 +530,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( @@ -531,46 +544,115 @@ export const FootballPlayerCard = () => {
- - setPlayer({ ...player, overallRating: Number(e.target.value) })} /> + + + setPlayer({ + ...player, + overallRating: Number(e.target.value), + }) + } + />
- - setPlayer({ ...player, club: e.target.value })} /> + + + setPlayer({ ...player, club: e.target.value }) + } + />
- - setPlayer({ ...player, imageUrl: e.target.value })} /> + + + setPlayer({ ...player, imageUrl: e.target.value }) + } + />

Player Stats

- - setPlayer({ ...player, pac: Number(e.target.value) })} /> + + + setPlayer({ ...player, pac: Number(e.target.value) }) + } + />
- - setPlayer({ ...player, sho: Number(e.target.value) })} /> + + + setPlayer({ ...player, sho: Number(e.target.value) }) + } + />
- - setPlayer({ ...player, pas: Number(e.target.value) })} /> + + + setPlayer({ ...player, pas: Number(e.target.value) }) + } + />
- + --fcc-editable-region-- --fcc-editable-region--
- +
- +
@@ -579,7 +661,9 @@ export const FootballPlayerCard = () => {

Live Preview

Updates as you type

-
+
diff --git a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdf.md b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdf.md index 990048a60ed..d0a2b373e7b 100644 --- a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdf.md +++ b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdf.md @@ -421,7 +421,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -495,7 +495,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -549,8 +549,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( @@ -667,11 +668,11 @@ export const FootballPlayerCard = () => { } /> - --fcc-editable-region--
+ --fcc-editable-region--
@@ -679,8 +680,8 @@ export const FootballPlayerCard = () => { PHY -
--fcc-editable-region-- + diff --git a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8d1be04ed6aad1c955729.md b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8d1be04ed6aad1c955729.md index 0b75815045d..20e63ebbf0f 100644 --- a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8d1be04ed6aad1c955729.md +++ b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69e8d1be04ed6aad1c955729.md @@ -391,8 +391,8 @@ const { useState } = React; --fcc-editable-region-- export const FootballPlayerCard = () => { - return ( -

Football Card Builder

- ) + return ( +

Football Card Builder

+ ); }; ``` diff --git a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69ea01c45b04f3e9de845036.md b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69ea01c45b04f3e9de845036.md index bad9b18a28b..bd825718aa4 100644 --- a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69ea01c45b04f3e9de845036.md +++ b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69ea01c45b04f3e9de845036.md @@ -405,7 +405,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -483,7 +483,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -537,8 +537,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69ea02adff0fd528639ee23b.md b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69ea02adff0fd528639ee23b.md index 4659b335e90..b361f251b8e 100644 --- a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69ea02adff0fd528639ee23b.md +++ b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69ea02adff0fd528639ee23b.md @@ -409,7 +409,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -485,7 +485,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -543,8 +543,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69ea0349f8305a99324465ff.md b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69ea0349f8305a99324465ff.md index 1ef4254f475..ba4cfed71fb 100644 --- a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69ea0349f8305a99324465ff.md +++ b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69ea0349f8305a99324465ff.md @@ -407,7 +407,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -483,7 +483,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -502,11 +502,9 @@ const defaultPlayer: PlayerData = { function loadPlayer(): PlayerData { try { --fcc-editable-region-- - - --fcc-editable-region-- - } catch (error) { - } + --fcc-editable-region-- + } catch (error) {} } export const FootballPlayerCard = () => { @@ -547,8 +545,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69ea044f8c93a5e7ce64214c.md b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69ea044f8c93a5e7ce64214c.md index c905170aabb..6de5aa3745e 100644 --- a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69ea044f8c93a5e7ce64214c.md +++ b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69ea044f8c93a5e7ce64214c.md @@ -395,7 +395,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -471,7 +471,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -492,12 +492,10 @@ function loadPlayer(): PlayerData { const saved = localStorage.getItem(STORAGE_KEY); if (saved) { --fcc-editable-region-- - + --fcc-editable-region-- - }; - } catch (error) { - - } + } + } catch (error) {} } export const FootballPlayerCard = () => { @@ -538,8 +536,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69ea0577f25e519489353f82.md b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69ea0577f25e519489353f82.md index 72e10955f45..9dadedd65b7 100644 --- a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69ea0577f25e519489353f82.md +++ b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69ea0577f25e519489353f82.md @@ -405,7 +405,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -418,7 +418,6 @@ interface PlayerData { const STORAGE_KEY = "football_player_card"; - export function getPlayerTier(rating: number): string { if (rating >= 92) return "elite"; if (rating >= 85) return "gold"; @@ -482,7 +481,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -505,14 +504,15 @@ function loadPlayer(): PlayerData { return { ...defaultPlayer, ...JSON.parse(saved) - } - }; ---fcc-editable-region-- + }; + } } catch (error) { +--fcc-editable-region-- } -} + --fcc-editable-region-- +} export const FootballPlayerCard = () => { const [player, setPlayer] = useState(defaultPlayer); @@ -552,8 +552,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69ea064edb0dcc46e1422cca.md b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69ea064edb0dcc46e1422cca.md index 7dae4e81137..5515c17ab7e 100644 --- a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69ea064edb0dcc46e1422cca.md +++ b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69ea064edb0dcc46e1422cca.md @@ -401,7 +401,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -477,7 +477,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -500,8 +500,8 @@ function loadPlayer(): PlayerData { return { ...defaultPlayer, ...JSON.parse(saved) - } - }; + }; + } } catch (error) { console.log("Failed to load player data, using defaults:", error); } @@ -546,8 +546,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69ea0939f2f92cfc6c7a850d.md b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69ea0939f2f92cfc6c7a850d.md index 0d858e2d967..45db45e176d 100644 --- a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69ea0939f2f92cfc6c7a850d.md +++ b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69ea0939f2f92cfc6c7a850d.md @@ -46,12 +46,10 @@ assert.match(__helpers.removeJSComments(code), /useEffect\s*\(\(\)\s=>\s*\{\s*tr Football Player Card Builder - - - + @@ -415,7 +413,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -435,7 +433,7 @@ export function getPlayerTier(rating: number): string { return "bronze"; } -function PlayerCard({ player }: { player: PlayerData }) { +export const PlayerCard = ({ player }: { player: PlayerData }) => { return (
@@ -491,7 +489,7 @@ function PlayerCard({ player }: { player: PlayerData }) {
); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -514,8 +512,8 @@ function loadPlayer(): PlayerData { return { ...defaultPlayer, ...JSON.parse(saved) - } - }; + }; + } } catch (error) { console.log("Failed to load player data, using defaults:", error); } @@ -526,7 +524,7 @@ export const FootballPlayerCard = () => { const [player, setPlayer] = useState(defaultPlayer); --fcc-editable-region-- - + --fcc-editable-region-- return ( @@ -565,8 +563,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69ea0a89bd84cf2461b48ceb.md b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69ea0a89bd84cf2461b48ceb.md index 9e0648f3dd7..def6f5aad05 100644 --- a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69ea0a89bd84cf2461b48ceb.md +++ b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69ea0a89bd84cf2461b48ceb.md @@ -403,7 +403,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -479,7 +479,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -502,8 +502,8 @@ function loadPlayer(): PlayerData { return { ...defaultPlayer, ...JSON.parse(saved) - } - }; + }; + } } catch (error) { console.log("Failed to load player data, using defaults:", error); } @@ -513,15 +513,15 @@ function loadPlayer(): PlayerData { export const FootballPlayerCard = () => { const [player, setPlayer] = useState(defaultPlayer); ---fcc-editable-region-- useEffect(() => { try { +--fcc-editable-region-- } catch (error) { +--fcc-editable-region-- } }, [player]); ---fcc-editable-region-- return (
@@ -559,8 +559,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69ea0bb3e7000f44c207bb0e.md b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69ea0bb3e7000f44c207bb0e.md index 8d8652c5070..569d38b823c 100644 --- a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69ea0bb3e7000f44c207bb0e.md +++ b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69ea0bb3e7000f44c207bb0e.md @@ -401,7 +401,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -477,7 +477,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -500,8 +500,8 @@ function loadPlayer(): PlayerData { return { ...defaultPlayer, ...JSON.parse(saved) - } - }; + }; + } } catch (error) { console.log("Failed to load player data, using defaults:", error); } @@ -557,8 +557,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( @@ -1098,7 +1099,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -1174,7 +1175,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -1197,8 +1198,8 @@ function loadPlayer(): PlayerData { return { ...defaultPlayer, ...JSON.parse(saved) - } - }; + }; + } } catch (error) { console.log("Failed to load player data, using defaults:", error); } @@ -1252,8 +1253,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69ea1bb4a66dd6debb999c7f.md b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69ea1bb4a66dd6debb999c7f.md index 98c39e147c4..e78d8782947 100644 --- a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69ea1bb4a66dd6debb999c7f.md +++ b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69ea1bb4a66dd6debb999c7f.md @@ -473,7 +473,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69ea1dd8e74976afa407bf22.md b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69ea1dd8e74976afa407bf22.md index 7b8e8e85121..0bd9a5e9bad 100644 --- a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69ea1dd8e74976afa407bf22.md +++ b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69ea1dd8e74976afa407bf22.md @@ -479,7 +479,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69ea1ed1543a4db863564aac.md b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69ea1ed1543a4db863564aac.md index e107d1cdd9e..3156227ab95 100644 --- a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69ea1ed1543a4db863564aac.md +++ b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69ea1ed1543a4db863564aac.md @@ -472,7 +472,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69ea21dcd8c4cb48c23a2c67.md b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69ea21dcd8c4cb48c23a2c67.md index c991034c8a0..ae923d543ff 100644 --- a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69ea21dcd8c4cb48c23a2c67.md +++ b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69ea21dcd8c4cb48c23a2c67.md @@ -14,7 +14,7 @@ Fügen Sie ein `onChange`-Attribut hinzu, das auf eine Pfeilfunktion gesetzt ist Ihre Position `select` sollte einen `onChange`-Handler haben, der `setPlayer` mit einer Ausbreitung von `player` aufruft und `position` aktualisiert. ```js -assert.match(__helpers.removeJSComments(code), /onChange.*setPlayer.*\.\.\.\s*player[\s\S]*position/); +assert.match(__helpers.removeJSComments(code), /onChange=\{[\s\S]*?position:\s*e\.target\.value\s+as\s+Position/); ``` # --seed-- @@ -469,7 +469,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69ea2378f3c6a60a57cc29c3.md b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69ea2378f3c6a60a57cc29c3.md index b1b3d79303c..386e66c76ab 100644 --- a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69ea2378f3c6a60a57cc29c3.md +++ b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69ea2378f3c6a60a57cc29c3.md @@ -483,7 +483,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -537,10 +537,12 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > --fcc-editable-region-- - + --fcc-editable-region-- diff --git a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69eb216380522cfc11aa408c.md b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69eb216380522cfc11aa408c.md index 6f1f30e508c..75a95b0a141 100644 --- a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69eb216380522cfc11aa408c.md +++ b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69eb216380522cfc11aa408c.md @@ -443,7 +443,7 @@ export const PlayerCard = () => { ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69eb23665c115447405343ac.md b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69eb23665c115447405343ac.md index 71bc05a9f36..9f8e7d4a873 100644 --- a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69eb23665c115447405343ac.md +++ b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69eb23665c115447405343ac.md @@ -461,7 +461,7 @@ export const PlayerCard = () => { ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69eb2847cc8f5638e226e8ce.md b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69eb2847cc8f5638e226e8ce.md index 6fc5304ce24..b0ab483e4fb 100644 --- a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69eb2847cc8f5638e226e8ce.md +++ b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69eb2847cc8f5638e226e8ce.md @@ -483,10 +483,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -543,7 +543,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { --fcc-editable-region-- diff --git a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69ed3985819de69de27c4390.md b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69ed3985819de69de27c4390.md index 00568510743..9f5f7eadc9a 100644 --- a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69ed3985819de69de27c4390.md +++ b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69ed3985819de69de27c4390.md @@ -391,10 +391,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -453,14 +453,14 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { - name: 'PELE', + name: "PELE", overallRating: 98, - position: 'ST', - club: 'Santos FC', - imageUrl: 'https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg', + position: "ST", + club: "Santos FC", + imageUrl: "https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg", pac: 97, sho: 98, pas: 83, @@ -471,7 +471,7 @@ const defaultPlayer: PlayerData = { export const FootballPlayerCard = () => { --fcc-editable-region-- - return ; + return ; --fcc-editable-region-- }; ``` diff --git a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69f1a6f57dd2d4685822074a.md b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69f1a6f57dd2d4685822074a.md index 362ed17dbe9..375f1ae8eec 100644 --- a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69f1a6f57dd2d4685822074a.md +++ b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69f1a6f57dd2d4685822074a.md @@ -401,8 +401,8 @@ export const PlayerCard = () => {
- --fcc-editable-region--
+ --fcc-editable-region--
@@ -410,14 +410,14 @@ export const PlayerCard = () => {
-
--fcc-editable-region-- +
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69f1a9e19340f19b1fd051c6.md b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69f1a9e19340f19b1fd051c6.md index bef015f2c40..7a96d0e81ff 100644 --- a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69f1a9e19340f19b1fd051c6.md +++ b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69f1a9e19340f19b1fd051c6.md @@ -416,9 +416,9 @@ export const PlayerCard = () => {
- --fcc-editable-region--
+ --fcc-editable-region--
@@ -426,14 +426,14 @@ export const PlayerCard = () => {
+ --fcc-editable-region--
- --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69f1af24b0860d13f0b295e5.md b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69f1af24b0860d13f0b295e5.md index cb9b0f34a6f..4ed791460cd 100644 --- a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69f1af24b0860d13f0b295e5.md +++ b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69f1af24b0860d13f0b295e5.md @@ -407,10 +407,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -451,9 +451,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
- --fcc-editable-region--
+ --fcc-editable-region-- 99 DRI
@@ -463,17 +463,17 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
75 + --fcc-editable-region-- PHY
- --fcc-editable-region-- ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69f1b1fb36c6c0c80907e8e1.md b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69f1b1fb36c6c0c80907e8e1.md index 2ffb8ec1461..f5fbc97a378 100644 --- a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69f1b1fb36c6c0c80907e8e1.md +++ b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69f1b1fb36c6c0c80907e8e1.md @@ -483,7 +483,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -511,17 +511,15 @@ export const FootballPlayerCard = () => {
- --fcc-editable-region-- -
- -
+
+ --fcc-editable-region--
+ --fcc-editable-region--
- --fcc-editable-region-- ); }; diff --git a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69f1b591221851200c734eb4.md b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69f1b591221851200c734eb4.md index 9b7e20ea8f0..d270c0405a0 100644 --- a/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69f1b591221851200c734eb4.md +++ b/curriculum/challenges/german/blocks/workshop-build-a-football-player-card-builder/69f1b591221851200c734eb4.md @@ -472,7 +472,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f356ed6199b0cdef1d2be8f.md b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f356ed6199b0cdef1d2be8f.md index b0dcf950b02..def0726c871 100644 --- a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f356ed6199b0cdef1d2be8f.md +++ b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f356ed6199b0cdef1d2be8f.md @@ -13,11 +13,11 @@ Sie haben in vorherigen Lektionen gelernt, wie man mit `class` Selektoren arbeit ```css .class-name { - styles + property: value; } ``` -Ändern Sie den vorhandenen `#menu` Selektor in einen Klassenselektor, indem Sie `#menu` durch eine Klasse namens `.menu` ersetzen. +Ändern Sie den vorhandenen `#menu`-Selektor in einen Klassen-Selektor, indem Sie `#menu` durch den Klassen-Selektor `.menu` ersetzen. # --hints-- diff --git a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f3cade99dda4e6071a85dfd.md b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f3cade99dda4e6071a85dfd.md index 1410ae5c365..d52dcf4e709 100644 --- a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f3cade99dda4e6071a85dfd.md +++ b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f3cade99dda4e6071a85dfd.md @@ -109,7 +109,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f3ef6e01f288a026d709587.md b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f3ef6e01f288a026d709587.md index 4add4422694..fb1e1623938 100644 --- a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f3ef6e01f288a026d709587.md +++ b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f3ef6e01f288a026d709587.md @@ -171,7 +171,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f3ef6e03d719d5ac4738993.md b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f3ef6e03d719d5ac4738993.md index 8b9f1e51a2a..0b92dd59931 100644 --- a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f3ef6e03d719d5ac4738993.md +++ b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f3ef6e03d719d5ac4738993.md @@ -115,7 +115,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f3ef6e04559b939080db057.md b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f3ef6e04559b939080db057.md index d6a3c636259..ac3cb913693 100644 --- a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f3ef6e04559b939080db057.md +++ b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f3ef6e04559b939080db057.md @@ -139,7 +139,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f3ef6e050279c7a4a7101d3.md b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f3ef6e050279c7a4a7101d3.md index d311c05cf7a..81517e358c0 100644 --- a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f3ef6e050279c7a4a7101d3.md +++ b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f3ef6e050279c7a4a7101d3.md @@ -137,7 +137,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f3ef6e05473f91f948724ab.md b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f3ef6e05473f91f948724ab.md index 898344ce204..03c2c204ffa 100644 --- a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f3ef6e05473f91f948724ab.md +++ b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f3ef6e05473f91f948724ab.md @@ -116,6 +116,6 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f3ef6e056bdde6ae6892ba2.md b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f3ef6e056bdde6ae6892ba2.md index 1cd1002520e..6b111fcbb27 100644 --- a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f3ef6e056bdde6ae6892ba2.md +++ b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f3ef6e056bdde6ae6892ba2.md @@ -9,7 +9,7 @@ dashedName: step-54 Es ist etwas langweilig, wenn der gesamte Text die gleiche `font-family` hat. Sie können den Großteil des Texts weiterhin `sans-serif` gestalten und nur die `h1` und `h2` Elemente mit einem anderen Selektor unterschiedlich gestalten. -Formatieren Sie sowohl die `h1` als auch die `h2` Elemente mit einem einzigen Selektor, sodass der Text dieser Elemente die `Impact` Schriftart verwendet. +Formatieren Sie sowohl die `h1`- als auch die `h2`-Elemente mit einer einzigen Selektorliste, sodass der Text dieser Elemente die Schriftart `Impact` verwendet. # --hints-- @@ -135,7 +135,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f3ef6e06d34faac0447fc44.md b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f3ef6e06d34faac0447fc44.md index e9351a7b95d..5c0839989b3 100644 --- a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f3ef6e06d34faac0447fc44.md +++ b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f3ef6e06d34faac0447fc44.md @@ -127,7 +127,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f3ef6e07276f782bb46b93d.md b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f3ef6e07276f782bb46b93d.md index be1c5ff1982..82eb23ae566 100644 --- a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f3ef6e07276f782bb46b93d.md +++ b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f3ef6e07276f782bb46b93d.md @@ -142,7 +142,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f3ef6e0819d4f23ca7285e6.md b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f3ef6e0819d4f23ca7285e6.md index 89480cd716c..a9587091fd7 100644 --- a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f3ef6e0819d4f23ca7285e6.md +++ b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f3ef6e0819d4f23ca7285e6.md @@ -104,7 +104,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f3ef6e087d56ed3ffdc36be.md b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f3ef6e087d56ed3ffdc36be.md index 8ba505a9ddb..dcf17a04917 100644 --- a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f3ef6e087d56ed3ffdc36be.md +++ b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f3ef6e087d56ed3ffdc36be.md @@ -129,6 +129,6 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f3ef6e0a81099d9a697b550.md b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f3ef6e0a81099d9a697b550.md index a60a24c5d48..055bd9c5a84 100644 --- a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f3ef6e0a81099d9a697b550.md +++ b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f3ef6e0a81099d9a697b550.md @@ -167,7 +167,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f3ef6e0b431cc215bb16f55.md b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f3ef6e0b431cc215bb16f55.md index baf651baa05..f8989609f96 100644 --- a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f3ef6e0b431cc215bb16f55.md +++ b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f3ef6e0b431cc215bb16f55.md @@ -141,7 +141,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f3ef6e0e0c3feaebcf647ad.md b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f3ef6e0e0c3feaebcf647ad.md index b6af46c062d..9b8ae1171ed 100644 --- a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f3ef6e0e0c3feaebcf647ad.md +++ b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f3ef6e0e0c3feaebcf647ad.md @@ -103,7 +103,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f3ef6e0e9629bad967cd71e.md b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f3ef6e0e9629bad967cd71e.md index c78442ced59..27431be12ee 100644 --- a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f3ef6e0e9629bad967cd71e.md +++ b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f3ef6e0e9629bad967cd71e.md @@ -7,7 +7,7 @@ dashedName: step-55 # --description-- -Sie können einen Fallback-Wert für die Schriftart hinzufügen, indem Sie einen weiteren Schriftartnamen durch ein Komma getrennt angeben. Fallbacks werden verwendet, wenn die ursprüngliche Schriftart nicht gefunden oder nicht verfügbar ist. +Sie können einen Fallback-Wert für die `font-family` hinzufügen, indem Sie einen weiteren Schriftartnamen durch ein Komma getrennt hinzufügen. Ein Fallback wird verwendet, wenn die erste Schriftart nicht verfügbar ist. Fügen Sie die Fallback-Schriftart `serif` nach der Schriftart `Impact` hinzu. @@ -113,7 +113,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f3ef6e0eaa7da26e3d34d78.md b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f3ef6e0eaa7da26e3d34d78.md index 0279feb8ca1..a7dbb2da75c 100644 --- a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f3ef6e0eaa7da26e3d34d78.md +++ b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f3ef6e0eaa7da26e3d34d78.md @@ -128,7 +128,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f3ef6e0f8c230bdd2349716.md b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f3ef6e0f8c230bdd2349716.md index 84530b835b4..c41ac7e7568 100644 --- a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f3ef6e0f8c230bdd2349716.md +++ b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f3ef6e0f8c230bdd2349716.md @@ -140,6 +140,6 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f3f26fa39591db45e5cd7a0.md b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f3f26fa39591db45e5cd7a0.md index 8474d26461b..4830202880c 100644 --- a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f3f26fa39591db45e5cd7a0.md +++ b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f3f26fa39591db45e5cd7a0.md @@ -7,7 +7,7 @@ dashedName: step-64 # --description-- -Die Standard-Eigenschaften eines `hr`-Elements lassen es als dünne, hellgraue Linie erscheinen. Sie können die Höhe der Linie ändern, indem Sie einen Wert für die `height`-Eigenschaft angeben. +Die Standard-Eigenschaften eines `hr`-Elements lassen es als dünne hellgraue Linie erscheinen. Sie können die Höhe der Linie ändern, indem Sie einen Wert für die `height`-Eigenschaft angeben. Ändern Sie die Höhe des `hr`-Elements auf `3px`. @@ -150,7 +150,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f459225127805351a6ad057.md b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f459225127805351a6ad057.md index f5c3b67ea43..e656a8989cc 100644 --- a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f459225127805351a6ad057.md +++ b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f459225127805351a6ad057.md @@ -144,7 +144,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f459a7ceb8b5c446656d88b.md b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f459a7ceb8b5c446656d88b.md index 299c83a58c2..22276307505 100644 --- a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f459a7ceb8b5c446656d88b.md +++ b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f459a7ceb8b5c446656d88b.md @@ -147,6 +147,6 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f459cf202c2a3472fae6a9f.md b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f459cf202c2a3472fae6a9f.md index 004eb31f603..f98b999f299 100644 --- a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f459cf202c2a3472fae6a9f.md +++ b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f459cf202c2a3472fae6a9f.md @@ -7,7 +7,7 @@ dashedName: step-67 # --description-- -Ist Ihnen aufgefallen, wie die Dicke der Linie größer aussieht? Der Standardwert einer Eigenschaft namens `border-width` ist `1px` für alle Kanten von `hr`-Elementen. Indem Sie den Rahmen auf dieselbe Farbe wie den Hintergrund ändern, beträgt die Gesamthöhe der Linie `5px` (`3px` plus die obere und untere Rahmenbreite von `1px`). +Fällt Ihnen auf, wie die Dicke der Linie größer aussieht? Der Standardwert einer Eigenschaft namens `border-width` beträgt `1px` für alle Kanten von `hr`-Elementen. Die Gesamthöhe der Linie betrug immer `5px` (`3px` plus der obere und untere Rahmen von jeweils `1px`); das Einfärben des Rahmens machte diese Kanten sichtbar. Ändern Sie die `height`-Eigenschaft des `hr` auf `2px`, sodass die Gesamthöhe davon `4px` wird. @@ -147,7 +147,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f459fd48bdc98491ca6d1a3.md b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f459fd48bdc98491ca6d1a3.md index fb55ce23847..ee336f1b3ee 100644 --- a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f459fd48bdc98491ca6d1a3.md +++ b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f459fd48bdc98491ca6d1a3.md @@ -145,7 +145,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f45a05977e2fa49d9119437.md b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f45a05977e2fa49d9119437.md index d7de99d50d2..e49b6d8a60d 100644 --- a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f45a05977e2fa49d9119437.md +++ b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f45a05977e2fa49d9119437.md @@ -146,6 +146,6 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f45a276c093334f0f6e9df4.md b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f45a276c093334f0f6e9df4.md index f293e8ae324..ca88fff27d9 100644 --- a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f45a276c093334f0f6e9df4.md +++ b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f45a276c093334f0f6e9df4.md @@ -185,7 +185,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f45a5a7c49a8251f0bdb527.md b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f45a5a7c49a8251f0bdb527.md index a608dd2e027..7ce6954d650 100644 --- a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f45a5a7c49a8251f0bdb527.md +++ b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f45a5a7c49a8251f0bdb527.md @@ -157,7 +157,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f45a66d4a2b0453301e5a26.md b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f45a66d4a2b0453301e5a26.md index 1fb05f4a290..d6259ce51ec 100644 --- a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f45a66d4a2b0453301e5a26.md +++ b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f45a66d4a2b0453301e5a26.md @@ -166,7 +166,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f45b0731d39e15d54df4dfc.md b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f45b0731d39e15d54df4dfc.md index 1e672b7e462..adb37aac0d8 100644 --- a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f45b0731d39e15d54df4dfc.md +++ b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f45b0731d39e15d54df4dfc.md @@ -161,7 +161,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f45b25e7ec2405f166b9de1.md b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f45b25e7ec2405f166b9de1.md index 9b5c8bc5c46..3424dddb6fd 100644 --- a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f45b25e7ec2405f166b9de1.md +++ b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f45b25e7ec2405f166b9de1.md @@ -9,7 +9,7 @@ dashedName: step-78 Sie ändern die Eigenschaften eines Links, wenn der Link bereits besucht wurde, indem Sie einen Pseudo-Selektor verwenden, der wie `a:visited { propertyName: propertyValue; }` aussieht. -Ändern Sie die Farbe des Fußzeilen-`Visit our website`-Links in `grey`, wenn ein Benutzer den Link besucht hat. +Ändern Sie die Farbe des Links in der Fußzeile `Visit our website` auf `gray`, wenn ein Benutzer den Link besucht hat. # --hints-- @@ -20,14 +20,14 @@ const aVisitedStyle = new __helpers.CSSHelp(document).getStyle('a:visited'); assert.exists(aVisitedStyle); ``` -Sie sollten die `color`-Eigenschaft auf `grey` setzen. +Sie sollten die `color`-Eigenschaft auf `gray` setzen. ```js const hasColor = new __helpers.CSSHelp(document).getCSSRules().some(x => (x.style.color === 'grey' || x.style.color === 'gray')); assert.isTrue(hasColor); ``` -Ihr `a:visited` sollte eine `color` von `grey` haben. +Ihr `a:visited` sollte eine `color` von `gray` haben. ```js const aVisitedColor = new __helpers.CSSHelp(document).getStyle('a:visited')?.getPropertyValue('color'); @@ -161,7 +161,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f45b3c93c027860d9298dbd.md b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f45b3c93c027860d9298dbd.md index 8fe83cc56a1..6b423a9b5a8 100644 --- a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f45b3c93c027860d9298dbd.md +++ b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f45b3c93c027860d9298dbd.md @@ -161,7 +161,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ @@ -179,7 +179,7 @@ a { } a:visited { - color: grey; + color: gray; } --fcc-editable-region-- diff --git a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f45b45d099f3e621fbbb256.md b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f45b45d099f3e621fbbb256.md index 6894f139c62..a2e21578f8b 100644 --- a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f45b45d099f3e621fbbb256.md +++ b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f45b45d099f3e621fbbb256.md @@ -161,7 +161,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ @@ -179,7 +179,7 @@ a { } a:visited { - color: grey; + color: gray; } a:hover { diff --git a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f45b4c81cea7763550e40df.md b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f45b4c81cea7763550e40df.md index 60a8716ae41..b09e077d4be 100644 --- a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f45b4c81cea7763550e40df.md +++ b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f45b4c81cea7763550e40df.md @@ -152,7 +152,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ @@ -171,7 +171,7 @@ a { --fcc-editable-region-- a:visited { - color: grey; + color: gray; } a:hover { diff --git a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f45b715301bbf667badc04a.md b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f45b715301bbf667badc04a.md index 25b11990bf7..b80becec87b 100644 --- a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f45b715301bbf667badc04a.md +++ b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f45b715301bbf667badc04a.md @@ -7,7 +7,7 @@ dashedName: step-82 # --description-- -Der Menütext `CAMPER CAFE` hat einen anderen Abstand von oben als der Abstand der Adresse unten im Menü. Das liegt daran, dass der Browser für das `h1`-Element einen Standard-Außenabstand oben hat. +Der Abstand über dem Menütitel `CAMPER CAFE` stimmt nicht mit dem Abstand unter der Adresse am unteren Rand des Menüs überein. Das liegt daran, dass der Browser für das `h1`-Element einen standardmäßigen Außenabstand oben hat. Ändern Sie den Außenabstand oben des `h1`-Elements auf `0`, um den gesamten Außenabstand oben zu entfernen. @@ -157,7 +157,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f46e270702a8456a664f0df.md b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f46e270702a8456a664f0df.md index bf096158002..b2664f24a78 100644 --- a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f46e270702a8456a664f0df.md +++ b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f46e270702a8456a664f0df.md @@ -156,7 +156,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f46e36e745ead58487aabf2.md b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f46e36e745ead58487aabf2.md index 83fb7cd82ee..d080744cef0 100644 --- a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f46e36e745ead58487aabf2.md +++ b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f46e36e745ead58487aabf2.md @@ -163,7 +163,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f46e7a4750dd05b5a673920.md b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f46e7a4750dd05b5a673920.md index 80ed53d40d9..b372a64d97b 100644 --- a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f46e7a4750dd05b5a673920.md +++ b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f46e7a4750dd05b5a673920.md @@ -160,7 +160,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f46e8284aae155c83015dee.md b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f46e8284aae155c83015dee.md index c7ddec870a3..ff8153678bf 100644 --- a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f46e8284aae155c83015dee.md +++ b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f46e8284aae155c83015dee.md @@ -105,6 +105,7 @@ assert.match(imageAltValue, /coffee icon/i);

123 Free Code Camp Drive

+ ``` @@ -171,7 +172,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f46ede1ff8fec5ba656b44c.md b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f46ede1ff8fec5ba656b44c.md index 3e540d13ecb..427e41d82e2 100644 --- a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f46ede1ff8fec5ba656b44c.md +++ b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f46ede1ff8fec5ba656b44c.md @@ -144,7 +144,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } --fcc-editable-region-- diff --git a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f46fc57528aa1c4b5ea7c2e.md b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f46fc57528aa1c4b5ea7c2e.md index b64a66aab8a..29485c80de0 100644 --- a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f46fc57528aa1c4b5ea7c2e.md +++ b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f46fc57528aa1c4b5ea7c2e.md @@ -161,7 +161,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f4701b942c824109626c3d8.md b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f4701b942c824109626c3d8.md index b6f53414878..a1407738bd4 100644 --- a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f4701b942c824109626c3d8.md +++ b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f4701b942c824109626c3d8.md @@ -153,6 +153,6 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f475bb508746c16c9431d42.md b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f475bb508746c16c9431d42.md index 5639c80623f..513df3d03f2 100644 --- a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f475bb508746c16c9431d42.md +++ b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f475bb508746c16c9431d42.md @@ -7,9 +7,9 @@ dashedName: step-87 # --description-- -Das Bild, das Sie hinzugefügt haben, ist nicht horizontal zentriert wie die `Coffee` Überschrift darüber. `img` Elemente sind „wie“ Inline-Elemente. +Das Bild, das Sie hinzugefügt haben, ist nicht horizontal zentriert wie die `Coffee`-Überschrift darüber. `img`-Elemente sind inline-Elemente, daher befinden sie sich im Textfluss. -Um das Bild wie Block-Elemente wie Überschriften zu verhalten, erstellen Sie einen `img` Typselektor. Setzen Sie die `display` Eigenschaft auf `block` und verwenden Sie die `margin-left` und `margin-right` Eigenschaften, um es horizontal zu zentrieren. +Damit sich das Bild wie ein Blockelement wie eine Überschrift verhält, erstellen Sie einen `img`-Typselektor. Setzen Sie die `display`-Eigenschaft auf `block` und verwenden Sie die Eigenschaften `margin-left` und `margin-right`, um es horizontal zu zentrieren. # --hints-- @@ -120,6 +120,7 @@ assert.equal(imgMarginRight, 'auto');

123 Free Code Camp Drive

+ ``` @@ -190,7 +191,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f475e1c7f71a61d913836c6.md b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f475e1c7f71a61d913836c6.md index caf838458c4..9aa056c9db9 100644 --- a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f475e1c7f71a61d913836c6.md +++ b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f475e1c7f71a61d913836c6.md @@ -97,6 +97,7 @@ assert.match(lastImage?.alt, /pie icon/i);

123 Free Code Camp Drive

+ ``` diff --git a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f47fe7e31980053a8d4403b.md b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f47fe7e31980053a8d4403b.md index 5f53028fb01..e5514a1b6ba 100644 --- a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f47fe7e31980053a8d4403b.md +++ b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f47fe7e31980053a8d4403b.md @@ -7,7 +7,7 @@ dashedName: step-89 # --description-- -Es wäre schön, wenn der vertikale Abstand zwischen den `h2`-Elementen und ihren zugehörigen Symbolen kleiner wäre. Die `h2`-Elemente haben standardmäßigen Außenabstand oben und unten, daher könnten Sie den unteren Außenabstand der `h2`-Elemente auf zum Beispiel `0` oder eine andere Zahl ändern. +Es wäre schön, wenn der vertikale Abstand zwischen den `h2`-Elementen und ihren zugehörigen Symbolen kleiner wäre. Die `h2`-Elemente haben standardmäßig einen Außenabstand oben und unten, daher könnten Sie den unteren Außenabstand der `h2`-Elemente auf `0` oder einen anderen Wert ändern. Es gibt einen einfacheren Weg: Fügen Sie einfach einen negativen oberen Außenabstand zu den `img`-Elementen hinzu, um sie von ihrer aktuellen Position nach oben zu ziehen. Negative Werte werden mit einem `-` vor dem Wert erzeugt. Um diesen Workshop abzuschließen, verwenden Sie einen negativen oberen Außenabstand von `25px` im `img`-Typselektor. diff --git a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f716ad029ee4053c7027a7a.md b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f716ad029ee4053c7027a7a.md index d9607a37f97..2dbfbc9f04a 100644 --- a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f716ad029ee4053c7027a7a.md +++ b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f716ad029ee4053c7027a7a.md @@ -119,7 +119,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f716bee5838c354c728a7c5.md b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f716bee5838c354c728a7c5.md index fdf99231b01..e2045a97ef0 100644 --- a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f716bee5838c354c728a7c5.md +++ b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f716bee5838c354c728a7c5.md @@ -158,6 +158,6 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f7b87422a560036fd03ccff.md b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f7b87422a560036fd03ccff.md index fdf01c807e3..14bff3a5747 100644 --- a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f7b87422a560036fd03ccff.md +++ b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f7b87422a560036fd03ccff.md @@ -118,7 +118,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f7b88d37b1f98386f04edc0.md b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f7b88d37b1f98386f04edc0.md index 79bca15b589..9562fbbf939 100644 --- a/curriculum/challenges/german/blocks/workshop-cafe-menu/5f7b88d37b1f98386f04edc0.md +++ b/curriculum/challenges/german/blocks/workshop-cafe-menu/5f7b88d37b1f98386f04edc0.md @@ -97,6 +97,6 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/german/blocks/workshop-cafe-menu/6780e8ef4153930b965cd7b7.md b/curriculum/challenges/german/blocks/workshop-cafe-menu/6780e8ef4153930b965cd7b7.md index 03460ea2883..cd57471c1e5 100644 --- a/curriculum/challenges/german/blocks/workshop-cafe-menu/6780e8ef4153930b965cd7b7.md +++ b/curriculum/challenges/german/blocks/workshop-cafe-menu/6780e8ef4153930b965cd7b7.md @@ -125,6 +125,6 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/german/blocks/workshop-cafe-menu/6780f0d898362873ac425dc8.md b/curriculum/challenges/german/blocks/workshop-cafe-menu/6780f0d898362873ac425dc8.md index ae20ad356e7..4b52f16fc6e 100644 --- a/curriculum/challenges/german/blocks/workshop-cafe-menu/6780f0d898362873ac425dc8.md +++ b/curriculum/challenges/german/blocks/workshop-cafe-menu/6780f0d898362873ac425dc8.md @@ -23,7 +23,7 @@ Der `address`-Selektor sollte die `font-style`-Eigenschaft setzen. assert.isNotEmpty(new __helpers.CSSHelp(document).getStyle('address').getPropVal('font-style')); ``` -Die `font-style`-Eigenschaft sollte auf `normal` gesetzt werden. +Die Eigenschaft `font-style` sollte auf `normal` gesetzt werden. ```js assert.equal(new __helpers.CSSHelp(document).getStyle('address').getPropVal('font-style'), 'normal'); @@ -156,7 +156,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/german/blocks/workshop-calculator/66cc095dfe1682753d2ab030.md b/curriculum/challenges/german/blocks/workshop-calculator/66cc095dfe1682753d2ab030.md index 6c2b261eda7..0eb248e24a7 100644 --- a/curriculum/challenges/german/blocks/workshop-calculator/66cc095dfe1682753d2ab030.md +++ b/curriculum/challenges/german/blocks/workshop-calculator/66cc095dfe1682753d2ab030.md @@ -30,7 +30,10 @@ assert.strictEqual(addTwoAndSeven(), 9); Ihre `addTwoAndSeven`-Funktion sollte die Summe mit dem `+`-Operator zurückgeben. ```js -assert.match(code, /return\s*(2\s*\+\s*7|7\s*\+\s*2)\s*;?/); +const explorer = await __helpers.Explorer(code); +const { addTwoAndSeven } = explorer.allFunctions; +const validExpressions = ["2 + 7", "7 + 2", "(2 + 7)", "(7 + 2)"]; +assert.isTrue(validExpressions.some(expr => addTwoAndSeven?.hasReturn(expr))); ``` # --seed-- diff --git a/curriculum/challenges/german/blocks/workshop-calculator/66cc0a9e06e00b75d6782be9.md b/curriculum/challenges/german/blocks/workshop-calculator/66cc0a9e06e00b75d6782be9.md index 8a99f101c39..01bb7e3aac9 100644 --- a/curriculum/challenges/german/blocks/workshop-calculator/66cc0a9e06e00b75d6782be9.md +++ b/curriculum/challenges/german/blocks/workshop-calculator/66cc0a9e06e00b75d6782be9.md @@ -26,16 +26,12 @@ Sie sollten nun die Summe von `2` und `7` in der Konsole sehen. # --hints-- -Sie sollten eine `console.log` in Ihrem Code haben. +Sie sollten die `addTwoAndSeven`-Funktion innerhalb einer `console.log` aufrufen. ```js -assert.match(code, /console\.log(.*)/); -``` - -Sie sollten die `addTwoAndSeven`-Funktion innerhalb der `console.log` aufrufen. - -```js -assert.match(code, /console\.log\(\s*addTwoAndSeven\(\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(addTwoAndSeven())"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/german/blocks/workshop-calculator/66cc0ba5881acb7692cfc4de.md b/curriculum/challenges/german/blocks/workshop-calculator/66cc0ba5881acb7692cfc4de.md index 9d49eb19b37..bd716921a0b 100644 --- a/curriculum/challenges/german/blocks/workshop-calculator/66cc0ba5881acb7692cfc4de.md +++ b/curriculum/challenges/german/blocks/workshop-calculator/66cc0ba5881acb7692cfc4de.md @@ -24,22 +24,24 @@ assert.isFunction(addThreeAndFour); Ihre `addThreeAndFour`-Funktion sollte die Summe von `3` und `4` zurückgeben. ```js -assert.equal(addThreeAndFour(), 7); +assert.strictEqual(addThreeAndFour(), 7); ``` Ihre `addThreeAndFour`-Funktion sollte die Summe mit dem `+`-Operator zurückgeben. ```js -const declarationStyle = /return\s*\(?\s*(3\s*\+\s*4|4\s*\+\s*3)\s*\)?\s*;?/; -const arrowStyle = /=>\s*\(?\s*(3\s*\+\s*4|4\s*\+\s*3)\s*\)?\s*;?/; -const combinedRegex = new RegExp(`(?:${declarationStyle.source})|(?:${arrowStyle.source})`); -assert.match(code, combinedRegex); +const explorer = await __helpers.Explorer(code); +const { addThreeAndFour } = explorer.allFunctions; +const validExpressions = ["3 + 4", "4 + 3", "(3 + 4)", "(4 + 3)"]; +assert.isTrue(validExpressions.some(expr => addThreeAndFour?.hasReturn(expr))); ``` Sie sollten die `addThreeAndFour`-Funktion innerhalb eines `console.log` aufrufen. ```js -assert.match(code, /console\.log\(\s*addThreeAndFour\(\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(addThreeAndFour())"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/german/blocks/workshop-calculator/66cc0de2920bec775f610424.md b/curriculum/challenges/german/blocks/workshop-calculator/66cc0de2920bec775f610424.md index b7e5a191404..ccd5ca29c36 100644 --- a/curriculum/challenges/german/blocks/workshop-calculator/66cc0de2920bec775f610424.md +++ b/curriculum/challenges/german/blocks/workshop-calculator/66cc0de2920bec775f610424.md @@ -22,25 +22,33 @@ Im nächsten Schritt werden Sie lernen, wie man mit Parametern und Argumenten in Sie sollten keine Funktion namens `addTwoAndSeven` haben. ```js -assert.notMatch(code, /function\s+addTwoAndSeven\s*\(\s*\)\s*{/); +const explorer = await __helpers.Explorer(code); +const { addTwoAndSeven } = explorer.allFunctions; +assert.notExists(addTwoAndSeven); ``` Sie sollten keinen Funktionsaufruf zu `addTwoAndSeven` haben. ```js -assert.notMatch(code, /console\.log\(\s*addTwoAndSeven\(\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const unexpectedStatement = "console.log(addTwoAndSeven())"; +assert.notInclude(strippedCode, unexpectedStatement); ``` Sie sollten keine Funktion namens `addThreeAndFour` haben. ```js -assert.notMatch(code, /function\s+addThreeAndFour\s*\(\s*\)\s*{/); +const explorer = await __helpers.Explorer(code); +const { addThreeAndFour } = explorer.allFunctions; +assert.notExists(addThreeAndFour); ``` Sie sollten keinen Funktionsaufruf zu `addThreeAndFour` haben. ```js -assert.notMatch(code, /console\.log\(\s*addThreeAndFour\(\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const unexpectedStatement = "console.log(addThreeAndFour())"; +assert.notInclude(strippedCode, unexpectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/german/blocks/workshop-calculator/66cc0f1ae40802781b2ea972.md b/curriculum/challenges/german/blocks/workshop-calculator/66cc0f1ae40802781b2ea972.md index 678f3c37d2f..f82ee342a61 100644 --- a/curriculum/challenges/german/blocks/workshop-calculator/66cc0f1ae40802781b2ea972.md +++ b/curriculum/challenges/german/blocks/workshop-calculator/66cc0f1ae40802781b2ea972.md @@ -33,8 +33,11 @@ assert.isFunction(calculateSum); Ihre `calculateSum`-Funktion sollte zwei Parameter, `num1` und `num2`, entgegennehmen. ```js -const regex = __helpers.functionRegex('calculateSum', ['num1', 'num2']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { calculateSum } = explorer.allFunctions; +assert.lengthOf(calculateSum?.parameters, 2); +assert.equal(calculateSum?.parameters[0].toString(), "num1"); +assert.equal(calculateSum?.parameters[1].toString(), "num2"); ``` # --seed-- diff --git a/curriculum/challenges/german/blocks/workshop-calculator/66cc12fa504b0479dac479a0.md b/curriculum/challenges/german/blocks/workshop-calculator/66cc12fa504b0479dac479a0.md index 94255dce186..df83c4830ab 100644 --- a/curriculum/challenges/german/blocks/workshop-calculator/66cc12fa504b0479dac479a0.md +++ b/curriculum/challenges/german/blocks/workshop-calculator/66cc12fa504b0479dac479a0.md @@ -29,7 +29,9 @@ Fügen Sie einen `console.log` hinzu, der die `calculateSum`-Funktion mit den Ar Sie sollten einen `console.log` haben, der die `calculateSum`-Funktion mit den Argumenten `2` und `5` aufruft. ```js -assert.match(code, /console\.log\(calculateSum\(\s*2\s*,\s*5\)\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const validStatements = ["console.log(calculateSum(2,5))", "console.log(calculateSum(5,2))"]; +assert.isTrue(validStatements.some(stmt => strippedCode.includes(stmt))); ``` # --seed-- diff --git a/curriculum/challenges/german/blocks/workshop-calculator/66cc14ca14e65e7a9ebecb80.md b/curriculum/challenges/german/blocks/workshop-calculator/66cc14ca14e65e7a9ebecb80.md index 22c69b0b763..a529d5c965a 100644 --- a/curriculum/challenges/german/blocks/workshop-calculator/66cc14ca14e65e7a9ebecb80.md +++ b/curriculum/challenges/german/blocks/workshop-calculator/66cc14ca14e65e7a9ebecb80.md @@ -15,7 +15,7 @@ Geben Sie innerhalb der Funktion die Differenz der beiden Parameter zurück. # --hints-- -Sie sollten eine Funktion namens `calculateDifference` haben. +Sie sollten eine Funktion namens `calculateDifference` deklarieren. ```js assert.isFunction(calculateDifference); @@ -24,8 +24,11 @@ assert.isFunction(calculateDifference); Ihre `calculateDifference`-Funktion sollte zwei Parameter namens `num1` und `num2` haben. ```js -const regex = __helpers.functionRegex('calculateDifference', ['num1', 'num2']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { calculateDifference } = explorer.allFunctions; +assert.lengthOf(calculateDifference?.parameters, 2); +assert.equal(calculateDifference?.parameters[0].toString(), "num1"); +assert.equal(calculateDifference?.parameters[1].toString(), "num2"); ``` Ihre `calculateDifference`-Funktion sollte die Differenz der beiden Parameter zurückgeben. diff --git a/curriculum/challenges/german/blocks/workshop-calculator/66cc16abc30b367ba1d1f9ef.md b/curriculum/challenges/german/blocks/workshop-calculator/66cc16abc30b367ba1d1f9ef.md index 33f131da536..f33f0def91c 100644 --- a/curriculum/challenges/german/blocks/workshop-calculator/66cc16abc30b367ba1d1f9ef.md +++ b/curriculum/challenges/german/blocks/workshop-calculator/66cc16abc30b367ba1d1f9ef.md @@ -20,19 +20,25 @@ Schließlich fügen Sie eine dritte `console.log` hinzu, die die `calculateDiffe Sie sollten eine `console.log` haben, die die `calculateDifference`-Funktion mit den Argumenten `22` und `5` aufruft. ```js -assert.match(code, /console\.log\s*\(\s*calculateDifference\s*\(\s*22\s*,\s*5\s*\)\s*\)\s*;?/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateDifference(22,5))"; +assert.include(strippedCode, expectedStatement); ``` Sie sollten eine `console.log` haben, die die `calculateDifference`-Funktion mit den Argumenten `12` und `1` aufruft. ```js -assert.match(code, /console\.log\s*\(\s*calculateDifference\s*\(\s*12\s*,\s*1\s*\)\s*\)\s*;?/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateDifference(12,1))"; +assert.include(strippedCode, expectedStatement); ``` Sie sollten eine `console.log` haben, die die `calculateDifference`-Funktion mit den Argumenten `17` und `9` aufruft. ```js -assert.match(code, /console\.log\s*\(\s*calculateDifference\s*\(\s*17\s*,\s*9\s*\)\s*\)\s*;?/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateDifference(17,9))"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/german/blocks/workshop-calculator/66cc172af7159a7c67804544.md b/curriculum/challenges/german/blocks/workshop-calculator/66cc172af7159a7c67804544.md index ea020e656c1..6cb2e90ede9 100644 --- a/curriculum/challenges/german/blocks/workshop-calculator/66cc172af7159a7c67804544.md +++ b/curriculum/challenges/german/blocks/workshop-calculator/66cc172af7159a7c67804544.md @@ -17,7 +17,7 @@ Fügen Sie dann einen `console.log` hinzu, der die Funktion `calculateProduct` m # --hints-- -Sie sollten eine Funktion namens `calculateProduct` haben. +Sie sollten eine Funktion namens `calculateProduct` deklarieren. ```js assert.isFunction(calculateProduct); @@ -26,8 +26,11 @@ assert.isFunction(calculateProduct); Ihre `calculateProduct`-Funktion sollte zwei Parameter namens `num1` und `num2` haben. ```js -const regex = __helpers.functionRegex('calculateProduct', ['num1', 'num2']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { calculateProduct } = explorer.allFunctions; +assert.lengthOf(calculateProduct?.parameters, 2); +assert.equal(calculateProduct?.parameters[0].toString(), "num1"); +assert.equal(calculateProduct?.parameters[1].toString(), "num2"); ``` Ihre `calculateProduct`-Funktion sollte das Produkt der beiden Parameter zurückgeben. @@ -40,7 +43,9 @@ assert.equal(calculateProduct(10, 5), 50); Sie sollten einen `console.log` haben, der die Funktion `calculateProduct` mit den Argumenten `13` und `5` aufruft. ```js -assert.match(code, /console\.log\s*\(\s*calculateProduct\s*\(\s*13\s*,\s*5\s*\)\s*\)\s*;?/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const validStatements = ["console.log(calculateProduct(13,5))", "console.log(calculateProduct(5,13))"]; +assert.isTrue(validStatements.some(stmt => strippedCode.includes(stmt))); ``` # --seed-- diff --git a/curriculum/challenges/german/blocks/workshop-calculator/66cc1a3a39aef47d6473cb2f.md b/curriculum/challenges/german/blocks/workshop-calculator/66cc1a3a39aef47d6473cb2f.md index 8294f728ca8..6ec86e7ee02 100644 --- a/curriculum/challenges/german/blocks/workshop-calculator/66cc1a3a39aef47d6473cb2f.md +++ b/curriculum/challenges/german/blocks/workshop-calculator/66cc1a3a39aef47d6473cb2f.md @@ -17,7 +17,7 @@ Fügen Sie dann einen `console.log` hinzu, der die Funktion `calculateQuotient` # --hints-- -Sie sollten eine Funktion namens `calculateQuotient` haben. +Sie sollten eine Funktion namens `calculateQuotient` deklarieren. ```js assert.isFunction(calculateQuotient); @@ -26,8 +26,11 @@ assert.isFunction(calculateQuotient); Ihre Funktion `calculateQuotient` sollte zwei Parameter namens `num1` und `num2` haben. ```js -const regex = __helpers.functionRegex('calculateQuotient', ['num1', 'num2']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { calculateQuotient } = explorer.allFunctions; +assert.lengthOf(calculateQuotient?.parameters, 2); +assert.equal(calculateQuotient?.parameters[0].toString(), "num1"); +assert.equal(calculateQuotient?.parameters[1].toString(), "num2"); ``` Ihre Funktion `calculateQuotient` sollte den Quotienten der beiden Parameter zurückgeben. @@ -40,7 +43,9 @@ assert.equal(calculateQuotient(100, 10), 10); Sie sollten einen `console.log` haben, der die Funktion `calculateQuotient` mit den Argumenten `7` und `11` aufruft. ```js -assert.match(code, /console\.log\s*\(\s*calculateQuotient\s*\(\s*7\s*,\s*11\s*\)\s*\)\s*;?/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateQuotient(7,11))"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/german/blocks/workshop-calculator/66cc1ccfefdd727e18c2ab20.md b/curriculum/challenges/german/blocks/workshop-calculator/66cc1ccfefdd727e18c2ab20.md index 1f5ad57ee77..1f1f9e6c73e 100644 --- a/curriculum/challenges/german/blocks/workshop-calculator/66cc1ccfefdd727e18c2ab20.md +++ b/curriculum/challenges/german/blocks/workshop-calculator/66cc1ccfefdd727e18c2ab20.md @@ -18,7 +18,9 @@ Achten Sie genau auf die Ausgabe dieses Aufrufs. Sie sollten einen `console.log` haben, der die `calculateQuotient`-Funktion mit den Argumenten `3` und `0` aufruft. ```js -assert.match(code, /console\.log\s*\(\s*calculateQuotient\s*\(\s*3\s*,\s*0\s*\)\s*\)\s*;?/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateQuotient(3,0))"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/german/blocks/workshop-calculator/66cc1deb1f04647f2aabee2b.md b/curriculum/challenges/german/blocks/workshop-calculator/66cc1deb1f04647f2aabee2b.md index 9e29df043f9..d7ccfa8f5ec 100644 --- a/curriculum/challenges/german/blocks/workshop-calculator/66cc1deb1f04647f2aabee2b.md +++ b/curriculum/challenges/german/blocks/workshop-calculator/66cc1deb1f04647f2aabee2b.md @@ -20,8 +20,8 @@ Wenn das der Fall ist, sollte die Funktion den String `"Error: Division by zero" Ihre `calculateQuotient`-Funktion sollte den String `"Error: Division by zero"` zurückgeben, wenn `num2` null ist. ```js -assert.strictEqual(calculateQuotient(10, 0), 'Error: Division by zero'); -assert.strictEqual(calculateQuotient(3, 0), 'Error: Division by zero'); +assert.strictEqual(calculateQuotient(10, 0), "Error: Division by zero"); +assert.strictEqual(calculateQuotient(3, 0), "Error: Division by zero"); ``` Ihre `calculateQuotient`-Funktion sollte das Ergebnis der Division von `num1` durch `num2` zurückgeben, wenn `num2` nicht null ist. diff --git a/curriculum/challenges/german/blocks/workshop-calculator/66cc21d23238dc8240a8a182.md b/curriculum/challenges/german/blocks/workshop-calculator/66cc21d23238dc8240a8a182.md index ea3685bba78..5876efd4a9a 100644 --- a/curriculum/challenges/german/blocks/workshop-calculator/66cc21d23238dc8240a8a182.md +++ b/curriculum/challenges/german/blocks/workshop-calculator/66cc21d23238dc8240a8a182.md @@ -28,7 +28,7 @@ Deklarieren Sie eine Funktion namens `calculateSquare`, die einen `num`-Paramete # --hints-- -Sie sollten eine Funktion namens `calculateSquare` haben. +Sie sollten eine Funktion namens `calculateSquare` deklarieren. ```js assert.isFunction(calculateSquare); @@ -37,8 +37,10 @@ assert.isFunction(calculateSquare); Ihre `calculateSquare`-Funktion sollte einen `num`-Parameter annehmen. ```js -const regex = __helpers.functionRegex('calculateSquare', ['num']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { calculateSquare } = explorer.allFunctions; +assert.lengthOf(calculateSquare?.parameters, 1); +assert.equal(calculateSquare?.parameters[0].toString(), "num"); ``` Ihre `calculateSquare`-Funktion sollte das Quadrat von `num` zurückgeben. diff --git a/curriculum/challenges/german/blocks/workshop-calculator/66cc26907ff6908402af0149.md b/curriculum/challenges/german/blocks/workshop-calculator/66cc26907ff6908402af0149.md index 066bc6058ab..fbfa2f5509c 100644 --- a/curriculum/challenges/german/blocks/workshop-calculator/66cc26907ff6908402af0149.md +++ b/curriculum/challenges/german/blocks/workshop-calculator/66cc26907ff6908402af0149.md @@ -18,13 +18,17 @@ Fügen Sie dann einen weiteren `console.log` hinzu, der die `calculateSquare`-Fu Sie sollten einen `console.log` haben, der die `calculateSquare`-Funktion mit dem Argument `2` aufruft. ```js -assert.match(code, /console\.log\s*\(\s*calculateSquare\s*\(\s*2\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateSquare(2))"; +assert.include(strippedCode, expectedStatement); ``` Sie sollten einen `console.log` haben, der die `calculateSquare`-Funktion mit dem Argument `9` aufruft. ```js -assert.match(code, /console\.log\s*\(\s*calculateSquare\s*\(\s*9\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateSquare(9))"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/german/blocks/workshop-calculator/66cc2739f687e484d50bb6f1.md b/curriculum/challenges/german/blocks/workshop-calculator/66cc2739f687e484d50bb6f1.md index d2f3513da96..ffd6ebee250 100644 --- a/curriculum/challenges/german/blocks/workshop-calculator/66cc2739f687e484d50bb6f1.md +++ b/curriculum/challenges/german/blocks/workshop-calculator/66cc2739f687e484d50bb6f1.md @@ -26,7 +26,7 @@ Deklarieren Sie eine Funktion namens `calculateSquareRoot`, die einen `num`-Para # --hints-- -Sie sollten eine Funktion namens `calculateSquareRoot` haben. +Sie sollten eine Funktion namens `calculateSquareRoot` deklarieren. ```js assert.isFunction(calculateSquareRoot); @@ -35,8 +35,10 @@ assert.isFunction(calculateSquareRoot); Ihre `calculateSquareRoot`-Funktion sollte einen `num`-Parameter annehmen. ```js -const regex = __helpers.functionRegex('calculateSquareRoot', ['num']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { calculateSquareRoot } = explorer.allFunctions; +assert.lengthOf(calculateSquareRoot?.parameters, 1); +assert.equal(calculateSquareRoot?.parameters[0].toString(), "num"); ``` Ihre `calculateSquareRoot`-Funktion sollte die Quadratwurzel von `num` zurückgeben. diff --git a/curriculum/challenges/german/blocks/workshop-calculator/66cc281d687975858049fd8d.md b/curriculum/challenges/german/blocks/workshop-calculator/66cc281d687975858049fd8d.md index 79836235c11..27cd7938285 100644 --- a/curriculum/challenges/german/blocks/workshop-calculator/66cc281d687975858049fd8d.md +++ b/curriculum/challenges/german/blocks/workshop-calculator/66cc281d687975858049fd8d.md @@ -20,13 +20,17 @@ Mit diesen Änderungen ist Ihre Taschenrechner-App fertig! Sie sollten einen `console.log` haben, der die `calculateSquareRoot`-Funktion mit dem Argument `25` aufruft. ```js -assert.match(code, /console\.log\s*\(\s*calculateSquareRoot\s*\(\s*25\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateSquareRoot(25))"; +assert.include(strippedCode, expectedStatement); ``` Sie sollten einen `console.log` haben, der die `calculateSquareRoot`-Funktion mit dem Argument `100` aufruft. ```js -assert.match(code, /console\.log\s*\(\s*calculateSquareRoot\s*\(\s*100\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateSquareRoot(100))"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/german/blocks/workshop-calculator/66cdf76685e4cb5a8726e27b.md b/curriculum/challenges/german/blocks/workshop-calculator/66cdf76685e4cb5a8726e27b.md index f3fa305cea9..e575d512d65 100644 --- a/curriculum/challenges/german/blocks/workshop-calculator/66cdf76685e4cb5a8726e27b.md +++ b/curriculum/challenges/german/blocks/workshop-calculator/66cdf76685e4cb5a8726e27b.md @@ -18,13 +18,17 @@ Fügen Sie unter dieser `console.log` eine weitere `console.log` hinzu, die die Sie sollten eine `console.log` haben, die die `calculateSum`-Funktion mit den Argumenten `10` und `10` aufruft. ```js -assert.match(code, /console\.log\(calculateSum\(10\s*,\s*10\)\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateSum(10,10))"; +assert.include(strippedCode, expectedStatement); ``` Sie sollten eine `console.log` haben, die die `calculateSum`-Funktion mit den Argumenten `5` und `5` aufruft. ```js -assert.match(code, /console\.log\(calculateSum\(5\s*,\s*5\)\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateSum(5,5))"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/646c48df8674cf2b91020ecc.md b/curriculum/challenges/german/blocks/workshop-cat-painting/646c48df8674cf2b91020ecc.md index 49ee5c2223a..6fd5d316ceb 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/646c48df8674cf2b91020ecc.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/646c48df8674cf2b91020ecc.md @@ -35,12 +35,13 @@ assert.oneOf(href, ["./styles.css", "styles.css"]); ```html ---fcc-editable-region-- - - fCC Cat Painting - + + fCC Cat Painting --fcc-editable-region-- + +--fcc-editable-region-- + ``` diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/646c586be7180e40ddf74ff6.md b/curriculum/challenges/german/blocks/workshop-cat-painting/646c586be7180e40ddf74ff6.md index 4f6da034701..421dcf2fb3b 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/646c586be7180e40ddf74ff6.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/646c586be7180e40ddf74ff6.md @@ -1,6 +1,6 @@ --- id: 646c586be7180e40ddf74ff6 -title: Step 3 +title: Schritt 3 challengeType: 0 dashedName: step-3 --- @@ -31,9 +31,9 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('body')?.backgroundColor, - - fCC Cat Painting - + + fCC Cat Painting + diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/646c59e942f35541923104bf.md b/curriculum/challenges/german/blocks/workshop-cat-painting/646c59e942f35541923104bf.md index 0335c3b452c..ee9df378228 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/646c59e942f35541923104bf.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/646c59e942f35541923104bf.md @@ -1,6 +1,6 @@ --- id: 646c59e942f35541923104bf -title: Step 4 +title: Schritt 4 challengeType: 0 dashedName: step-4 --- @@ -43,13 +43,13 @@ assert.lengthOf(document.querySelectorAll('main div'), 1); - - fCC Cat Painting - + + fCC Cat Painting + --fcc-editable-region-- - + --fcc-editable-region-- diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/646c5ace05e4be4211407935.md b/curriculum/challenges/german/blocks/workshop-cat-painting/646c5ace05e4be4211407935.md index 49c2787df1c..19586f33345 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/646c5ace05e4be4211407935.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/646c5ace05e4be4211407935.md @@ -1,6 +1,6 @@ --- id: 646c5ace05e4be4211407935 -title: Step 6 +title: Schritt 6 challengeType: 0 dashedName: step-6 --- @@ -50,14 +50,14 @@ assert.equal(secondGradient,'(69,69,79)100%)'); - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
+
+
+
``` @@ -71,13 +71,13 @@ body { background-color: #c9d2fc; } ---fcc-editable-region-- .cat-head { +--fcc-editable-region-- + +--fcc-editable-region-- width: 205px; height: 180px; border: 1px solid #000; border-radius: 46%; - } ---fcc-editable-region-- ``` diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/646c5d7057c45f432fcdd46c.md b/curriculum/challenges/german/blocks/workshop-cat-painting/646c5d7057c45f432fcdd46c.md index 84c193e66ab..145ba1d8a8c 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/646c5d7057c45f432fcdd46c.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/646c5d7057c45f432fcdd46c.md @@ -1,6 +1,6 @@ --- id: 646c5d7057c45f432fcdd46c -title: Step 5 +title: Schritt 5 challengeType: 0 dashedName: step-5 --- @@ -50,13 +50,13 @@ assert.equal(new __helpers.CSSHelp(document)?.getStyle(".cat-head")?.borderRadiu - - fCC Cat Painting - + + fCC Cat Painting +
-
+
diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/646c5e727e56e743c9aed4a1.md b/curriculum/challenges/german/blocks/workshop-cat-painting/646c5e727e56e743c9aed4a1.md index f86a2857e89..37bae1c37e0 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/646c5e727e56e743c9aed4a1.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/646c5e727e56e743c9aed4a1.md @@ -1,6 +1,6 @@ --- id: 646c5e727e56e743c9aed4a1 -title: Step 7 +title: Schritt 7 challengeType: 0 dashedName: step-7 --- @@ -44,14 +44,14 @@ assert.equal(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.left, '100p - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
+
+
+
``` @@ -65,16 +65,14 @@ body { background-color: #c9d2fc; } ---fcc-editable-region-- .cat-head { - - +--fcc-editable-region-- +--fcc-editable-region-- background: linear-gradient(#5e5e5e 85%, #45454f 100%); width: 205px; height: 180px; border: 1px solid #000; border-radius: 46%; } ---fcc-editable-region-- ``` diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/646c5ffef5598d449b52ec12.md b/curriculum/challenges/german/blocks/workshop-cat-painting/646c5ffef5598d449b52ec12.md index f0afeb393e1..ee7fa802cc8 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/646c5ffef5598d449b52ec12.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/646c5ffef5598d449b52ec12.md @@ -1,6 +1,6 @@ --- id: 646c5ffef5598d449b52ec12 -title: Step 17 +title: Schritt 17 challengeType: 0 dashedName: step-17 --- @@ -39,18 +39,18 @@ assert.equal(document.querySelectorAll('.cat-head div')[0]?.getAttribute('class' - - fCC Cat Painting - + + fCC Cat Painting + -
+
+
--fcc-editable-region-- -
- -
+ --fcc-editable-region-- -
+ +
``` diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/646ce8bb4b35544d501c7184.md b/curriculum/challenges/german/blocks/workshop-cat-painting/646ce8bb4b35544d501c7184.md index d22827b4d1a..f7079a8f51d 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/646ce8bb4b35544d501c7184.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/646ce8bb4b35544d501c7184.md @@ -1,6 +1,6 @@ --- id: 646ce8bb4b35544d501c7184 -title: Step 18 +title: Schritt 18 challengeType: 0 dashedName: step-18 --- @@ -43,20 +43,20 @@ assert.isTrue(document.querySelectorAll('.cat-ears div')[1]?.classList.contains( - - fCC Cat Painting - + + fCC Cat Painting + -
-
+
+
+
--fcc-editable-region-- -
- -
+ --fcc-editable-region--
-
+
+
``` diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/646ce9d790d2a44de5f99e04.md b/curriculum/challenges/german/blocks/workshop-cat-painting/646ce9d790d2a44de5f99e04.md index c578ff70f8d..c3b11245631 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/646ce9d790d2a44de5f99e04.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/646ce9d790d2a44de5f99e04.md @@ -1,6 +1,6 @@ --- id: 646ce9d790d2a44de5f99e04 -title: Step 19 +title: Schritt 19 challengeType: 0 dashedName: step-19 --- @@ -55,25 +55,25 @@ assert.isTrue(document.querySelectorAll('.cat-right-ear div')[0]?.classList.cont - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
- --fcc-editable-region-- -
- -
-
- -
- --fcc-editable-region-- +
+
+
+
+--fcc-editable-region-- + +
+
+ +--fcc-editable-region--
-
+
+
``` diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/646ceb843412c74edee27a79.md b/curriculum/challenges/german/blocks/workshop-cat-painting/646ceb843412c74edee27a79.md index 5a34c27116c..4ee55d7cce4 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/646ceb843412c74edee27a79.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/646ceb843412c74edee27a79.md @@ -1,6 +1,6 @@ --- id: 646ceb843412c74edee27a79 -title: Step 20 +title: Schritt 20 challengeType: 0 dashedName: step-20 --- @@ -67,23 +67,23 @@ assert.strictEqual(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.b - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/646cecc9eb5c4f4f73dafd07.md b/curriculum/challenges/german/blocks/workshop-cat-painting/646cecc9eb5c4f4f73dafd07.md index 47666e3d6cf..3eccb810665 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/646cecc9eb5c4f4f73dafd07.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/646cecc9eb5c4f4f73dafd07.md @@ -1,6 +1,6 @@ --- id: 646cecc9eb5c4f4f73dafd07 -title: Step 23 +title: Schritt 23 challengeType: 0 dashedName: step-23 --- @@ -37,23 +37,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-ear')?.left, '- - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` @@ -81,12 +81,12 @@ body { border-radius: 46%; } ---fcc-editable-region-- .cat-left-ear { +--fcc-editable-region-- +--fcc-editable-region-- border-left: 35px solid transparent; border-right: 35px solid transparent; border-bottom: 70px solid #5e5e5e; } ---fcc-editable-region-- ``` diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/646cef0c2b98915094df7099.md b/curriculum/challenges/german/blocks/workshop-cat-painting/646cef0c2b98915094df7099.md index 81f3c304901..bba3ad4ba1b 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/646cef0c2b98915094df7099.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/646cef0c2b98915094df7099.md @@ -1,6 +1,6 @@ --- id: 646cef0c2b98915094df7099 -title: Step 24 +title: Schritt 24 challengeType: 0 dashedName: step-24 --- @@ -31,23 +31,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-ear')?.borderTo - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/646cf1206cac5f51804f49cf.md b/curriculum/challenges/german/blocks/workshop-cat-painting/646cf1206cac5f51804f49cf.md index 6be6c021516..ca5a43ebc76 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/646cf1206cac5f51804f49cf.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/646cf1206cac5f51804f49cf.md @@ -1,6 +1,6 @@ --- id: 646cf1206cac5f51804f49cf -title: Step 25 +title: Schritt 25 challengeType: 0 dashedName: step-25 --- @@ -29,23 +29,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-ear')?.transfor - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/646cf2249f02ca5233d9af7c.md b/curriculum/challenges/german/blocks/workshop-cat-painting/646cf2249f02ca5233d9af7c.md index 5173b34b183..60e1d9a1577 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/646cf2249f02ca5233d9af7c.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/646cf2249f02ca5233d9af7c.md @@ -1,6 +1,6 @@ --- id: 646cf2249f02ca5233d9af7c -title: Step 26 +title: Schritt 26 challengeType: 0 dashedName: step-26 --- @@ -45,23 +45,23 @@ assert.strictEqual(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.b - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/646cf48d8f8e1f535a1821d3.md b/curriculum/challenges/german/blocks/workshop-cat-painting/646cf48d8f8e1f535a1821d3.md index 64e4ec63164..f6e0325b070 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/646cf48d8f8e1f535a1821d3.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/646cf48d8f8e1f535a1821d3.md @@ -1,6 +1,6 @@ --- id: 646cf48d8f8e1f535a1821d3 -title: Step 27 +title: Schritt 27 challengeType: 0 dashedName: step-27 --- @@ -37,23 +37,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.left, ' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/646cf6cbca98e258da65c979.md b/curriculum/challenges/german/blocks/workshop-cat-painting/646cf6cbca98e258da65c979.md index 308a462b38e..5031a1b2f19 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/646cf6cbca98e258da65c979.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/646cf6cbca98e258da65c979.md @@ -1,6 +1,6 @@ --- id: 646cf6cbca98e258da65c979 -title: Step 28 +title: Schritt 28 challengeType: 0 dashedName: step-28 --- @@ -25,23 +25,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.transfo - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/646cf88aa884405a11ea5bcc.md b/curriculum/challenges/german/blocks/workshop-cat-painting/646cf88aa884405a11ea5bcc.md index 935c681d5bb..a458a44f713 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/646cf88aa884405a11ea5bcc.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/646cf88aa884405a11ea5bcc.md @@ -1,6 +1,6 @@ --- id: 646cf88aa884405a11ea5bcc -title: Step 29 +title: Schritt 29 challengeType: 0 dashedName: step-29 --- @@ -31,23 +31,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.borderT - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/646cfc2b8e6fe95c20a819d5.md b/curriculum/challenges/german/blocks/workshop-cat-painting/646cfc2b8e6fe95c20a819d5.md index c37f4a42912..fc41629bee0 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/646cfc2b8e6fe95c20a819d5.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/646cfc2b8e6fe95c20a819d5.md @@ -1,6 +1,6 @@ --- id: 646cfc2b8e6fe95c20a819d5 -title: Step 30 +title: Schritt 30 challengeType: 0 dashedName: step-30 --- @@ -29,23 +29,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-ear')?.zIndex, - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/646cfd853634255d02b64cc1.md b/curriculum/challenges/german/blocks/workshop-cat-painting/646cfd853634255d02b64cc1.md index 60e10bed6d6..6fb4f496999 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/646cfd853634255d02b64cc1.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/646cfd853634255d02b64cc1.md @@ -1,6 +1,6 @@ --- id: 646cfd853634255d02b64cc1 -title: Step 31 +title: Schritt 31 challengeType: 0 dashedName: step-31 --- @@ -27,23 +27,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-ear')?.zIndex, - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/646cfde6ac612e5d60391f50.md b/curriculum/challenges/german/blocks/workshop-cat-painting/646cfde6ac612e5d60391f50.md index f4000a5c452..c9bddaadf1d 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/646cfde6ac612e5d60391f50.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/646cfde6ac612e5d60391f50.md @@ -1,6 +1,6 @@ --- id: 646cfde6ac612e5d60391f50 -title: Step 32 +title: Schritt 32 challengeType: 0 dashedName: step-32 --- @@ -25,23 +25,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.zIndex, - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/646dd556d524bc61c0139bd6.md b/curriculum/challenges/german/blocks/workshop-cat-painting/646dd556d524bc61c0139bd6.md index 25482b11451..ec4b6953510 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/646dd556d524bc61c0139bd6.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/646dd556d524bc61c0139bd6.md @@ -1,6 +1,6 @@ --- id: 646dd556d524bc61c0139bd6 -title: Step 33 +title: Schritt 33 challengeType: 0 dashedName: step-33 --- @@ -45,23 +45,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-inner-ear')?.bo - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/646dd6f9caa862627dd87772.md b/curriculum/challenges/german/blocks/workshop-cat-painting/646dd6f9caa862627dd87772.md index e586787c53c..279fe65f5dd 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/646dd6f9caa862627dd87772.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/646dd6f9caa862627dd87772.md @@ -1,6 +1,6 @@ --- id: 646dd6f9caa862627dd87772 -title: Step 34 +title: Schritt 34 challengeType: 0 dashedName: step-34 --- @@ -37,23 +37,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-inner-ear')?.le - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/646dd7cfd0cfac630c1dd520.md b/curriculum/challenges/german/blocks/workshop-cat-painting/646dd7cfd0cfac630c1dd520.md index d92eee56e61..9ecb0fc4741 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/646dd7cfd0cfac630c1dd520.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/646dd7cfd0cfac630c1dd520.md @@ -1,6 +1,6 @@ --- id: 646dd7cfd0cfac630c1dd520 -title: Step 35 +title: Schritt 35 challengeType: 0 dashedName: step-35 --- @@ -43,23 +43,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-inner-ear')?.bo - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/646dd8c79ec23463a3d0e356.md b/curriculum/challenges/german/blocks/workshop-cat-painting/646dd8c79ec23463a3d0e356.md index 3ae1ac3157f..e7b941188b1 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/646dd8c79ec23463a3d0e356.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/646dd8c79ec23463a3d0e356.md @@ -1,6 +1,6 @@ --- id: 646dd8c79ec23463a3d0e356 -title: Step 36 +title: Schritt 36 challengeType: 0 dashedName: step-36 --- @@ -43,23 +43,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-inner-ear')?.b - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/646dd9d9a729916460724f16.md b/curriculum/challenges/german/blocks/workshop-cat-painting/646dd9d9a729916460724f16.md index e1db0bd2fda..bc9971b00ce 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/646dd9d9a729916460724f16.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/646dd9d9a729916460724f16.md @@ -1,6 +1,6 @@ --- id: 646dd9d9a729916460724f16 -title: Step 37 +title: Schritt 37 challengeType: 0 dashedName: step-37 --- @@ -37,23 +37,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-inner-ear')?.l - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/646ddab8afd73764f5241bbf.md b/curriculum/challenges/german/blocks/workshop-cat-painting/646ddab8afd73764f5241bbf.md index cdad0f67668..35ea7c1ebfc 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/646ddab8afd73764f5241bbf.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/646ddab8afd73764f5241bbf.md @@ -1,6 +1,6 @@ --- id: 646ddab8afd73764f5241bbf -title: Step 38 +title: Schritt 38 challengeType: 0 dashedName: step-38 --- @@ -43,23 +43,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-inner-ear')?.b - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/646ddb61ff08366570cc5902.md b/curriculum/challenges/german/blocks/workshop-cat-painting/646ddb61ff08366570cc5902.md index e8a11202b69..974f2348b31 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/646ddb61ff08366570cc5902.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/646ddb61ff08366570cc5902.md @@ -1,6 +1,6 @@ --- id: 646ddb61ff08366570cc5902 -title: Step 39 +title: Schritt 39 challengeType: 0 dashedName: step-39 --- @@ -45,27 +45,27 @@ assert.isTrue(document.querySelectorAll('.cat-eyes div')[1].classList.contains(' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- - --fcc-editable-region-- - - --fcc-editable-region--
-
+ + --fcc-editable-region-- + + --fcc-editable-region-- +
+
``` diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/646ddd3f9f97a0667b964bdb.md b/curriculum/challenges/german/blocks/workshop-cat-painting/646ddd3f9f97a0667b964bdb.md index 92614d040ef..1364b1d1c85 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/646ddd3f9f97a0667b964bdb.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/646ddd3f9f97a0667b964bdb.md @@ -1,6 +1,6 @@ --- id: 646ddd3f9f97a0667b964bdb -title: Step 40 +title: Schritt 40 challengeType: 0 dashedName: step-40 --- @@ -55,34 +55,34 @@ assert.isTrue(document.querySelectorAll('.cat-right-eye div')[0]?.classList.cont - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
- --fcc-editable-region-- -
- -
-
- -
- --fcc-editable-region-- -
-
+ +
+
+--fcc-editable-region-- + +
+
+ +--fcc-editable-region-- +
+
+
+
``` diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/646dde7dc20dc167489faa69.md b/curriculum/challenges/german/blocks/workshop-cat-painting/646dde7dc20dc167489faa69.md index 1ded6c7d5dc..5222aaf5be3 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/646dde7dc20dc167489faa69.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/646dde7dc20dc167489faa69.md @@ -1,6 +1,6 @@ --- id: 646dde7dc20dc167489faa69 -title: Step 41 +title: Schritt 41 challengeType: 0 dashedName: step-41 --- @@ -43,32 +43,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-eye')?.backgrou - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/646ddf888632fa67f1180940.md b/curriculum/challenges/german/blocks/workshop-cat-painting/646ddf888632fa67f1180940.md index a6fe006d251..a2c5946f436 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/646ddf888632fa67f1180940.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/646ddf888632fa67f1180940.md @@ -1,6 +1,6 @@ --- id: 646ddf888632fa67f1180940 -title: Step 42 +title: Schritt 42 challengeType: 0 dashedName: step-42 --- @@ -37,32 +37,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-eye')?.left, '3 - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/646de5dc8988076a1d992afd.md b/curriculum/challenges/german/blocks/workshop-cat-painting/646de5dc8988076a1d992afd.md index 2ba96e1a190..7f4b017bce6 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/646de5dc8988076a1d992afd.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/646de5dc8988076a1d992afd.md @@ -1,6 +1,6 @@ --- id: 646de5dc8988076a1d992afd -title: Step 43 +title: Schritt 43 challengeType: 0 dashedName: step-43 --- @@ -31,32 +31,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-eye')?.transfor - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/646de6a97b50a86ac487de86.md b/curriculum/challenges/german/blocks/workshop-cat-painting/646de6a97b50a86ac487de86.md index 23fa837c000..3de8c0d97e6 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/646de6a97b50a86ac487de86.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/646de6a97b50a86ac487de86.md @@ -1,6 +1,6 @@ --- id: 646de6a97b50a86ac487de86 -title: Step 44 +title: Schritt 44 challengeType: 0 dashedName: step-44 --- @@ -45,32 +45,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-eye')?.backgro - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/646de7b64467e96b7d35b5cd.md b/curriculum/challenges/german/blocks/workshop-cat-painting/646de7b64467e96b7d35b5cd.md index 2749d2f1aa2..53f2c55f21d 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/646de7b64467e96b7d35b5cd.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/646de7b64467e96b7d35b5cd.md @@ -1,6 +1,6 @@ --- id: 646de7b64467e96b7d35b5cd -title: Step 45 +title: Schritt 45 challengeType: 0 dashedName: step-45 --- @@ -37,32 +37,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-eye')?.left, ' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/646de8478d6f796bfbdccfb2.md b/curriculum/challenges/german/blocks/workshop-cat-painting/646de8478d6f796bfbdccfb2.md index 75e1a554bc4..be66f663e8a 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/646de8478d6f796bfbdccfb2.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/646de8478d6f796bfbdccfb2.md @@ -1,6 +1,6 @@ --- id: 646de8478d6f796bfbdccfb2 -title: Step 46 +title: Schritt 46 challengeType: 0 dashedName: step-46 --- @@ -31,32 +31,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-eye')?.transfo - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/646de8d204a3426c7d184372.md b/curriculum/challenges/german/blocks/workshop-cat-painting/646de8d204a3426c7d184372.md index 2c01f3fa69b..9709be8d90e 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/646de8d204a3426c7d184372.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/646de8d204a3426c7d184372.md @@ -1,6 +1,6 @@ --- id: 646de8d204a3426c7d184372 -title: Step 47 +title: Schritt 47 challengeType: 0 dashedName: step-47 --- @@ -45,32 +45,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-inner-eye')?.ba - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/646dea1c98c2426d43a705c3.md b/curriculum/challenges/german/blocks/workshop-cat-painting/646dea1c98c2426d43a705c3.md index 75d9bcaafa9..224400e0b88 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/646dea1c98c2426d43a705c3.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/646dea1c98c2426d43a705c3.md @@ -1,6 +1,6 @@ --- id: 646dea1c98c2426d43a705c3 -title: Step 48 +title: Schritt 48 challengeType: 0 dashedName: step-48 --- @@ -49,32 +49,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-inner-eye')?.tr - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/646deb169847f86df0f95bfc.md b/curriculum/challenges/german/blocks/workshop-cat-painting/646deb169847f86df0f95bfc.md index 23c4c008448..bb75e9927f4 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/646deb169847f86df0f95bfc.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/646deb169847f86df0f95bfc.md @@ -1,6 +1,6 @@ --- id: 646deb169847f86df0f95bfc -title: Step 49 +title: Schritt 49 challengeType: 0 dashedName: step-49 --- @@ -43,32 +43,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-inner-eye')?.b - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/646dec359bef3b7811fba5a6.md b/curriculum/challenges/german/blocks/workshop-cat-painting/646dec359bef3b7811fba5a6.md index 6ab079b10be..f86c3daac18 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/646dec359bef3b7811fba5a6.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/646dec359bef3b7811fba5a6.md @@ -49,32 +49,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-inner-eye')?.t - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/646dedbcba062079128b2ecc.md b/curriculum/challenges/german/blocks/workshop-cat-painting/646dedbcba062079128b2ecc.md index dea570e2fd5..c44b3f62903 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/646dedbcba062079128b2ecc.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/646dedbcba062079128b2ecc.md @@ -1,6 +1,6 @@ --- id: 646dedbcba062079128b2ecc -title: Step 51 +title: Schritt 51 challengeType: 0 dashedName: step-51 --- @@ -31,36 +31,36 @@ assert.isTrue(document.querySelectorAll('div')[11].classList.contains('cat-nose' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
- - --fcc-editable-region-- - - --fcc-editable-region--
-
+ + --fcc-editable-region-- + + --fcc-editable-region-- +
+
``` diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/646def5e863abf7a14501421.md b/curriculum/challenges/german/blocks/workshop-cat-painting/646def5e863abf7a14501421.md index 9d89158ad05..b8cee28e381 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/646def5e863abf7a14501421.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/646def5e863abf7a14501421.md @@ -1,6 +1,6 @@ --- id: 646def5e863abf7a14501421 -title: Step 52 +title: Schritt 52 challengeType: 0 dashedName: step-52 --- @@ -43,34 +43,34 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-nose')?.borderBottom - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
- -
-
+ +
+
+
``` diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/646df03c8f79337ab46f148b.md b/curriculum/challenges/german/blocks/workshop-cat-painting/646df03c8f79337ab46f148b.md index d15ba8175c0..ff20f4dfe59 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/646df03c8f79337ab46f148b.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/646df03c8f79337ab46f148b.md @@ -1,6 +1,6 @@ --- id: 646df03c8f79337ab46f148b -title: Step 53 +title: Schritt 53 challengeType: 0 dashedName: step-53 --- @@ -37,34 +37,34 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-nose')?.left, '85px' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
- -
-
+ +
+
+
``` @@ -196,5 +196,4 @@ body { border-right: 15px solid transparent; border-bottom: 20px solid #442c2c; } - ``` diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/646df0cf26413a7b35e4b8b3.md b/curriculum/challenges/german/blocks/workshop-cat-painting/646df0cf26413a7b35e4b8b3.md index fc3889740c6..87ec6ea34d6 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/646df0cf26413a7b35e4b8b3.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/646df0cf26413a7b35e4b8b3.md @@ -1,6 +1,6 @@ --- id: 646df0cf26413a7b35e4b8b3 -title: Step 54 +title: Schritt 54 challengeType: 0 dashedName: step-54 --- @@ -49,34 +49,34 @@ assert.notMatch(code, /border-top-right-radius:\s*\d+%;/); - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
- -
-
+ +
+
+
``` @@ -211,5 +211,4 @@ body { border-right: 15px solid transparent; border-bottom: 20px solid #442c2c; } - ``` diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/646df1d1aa4ae57bdf1869c4.md b/curriculum/challenges/german/blocks/workshop-cat-painting/646df1d1aa4ae57bdf1869c4.md index a1ff1d2b803..4837ff9c72a 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/646df1d1aa4ae57bdf1869c4.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/646df1d1aa4ae57bdf1869c4.md @@ -1,6 +1,6 @@ --- id: 646df1d1aa4ae57bdf1869c4 -title: Step 55 +title: Schritt 55 challengeType: 0 dashedName: step-55 --- @@ -33,38 +33,38 @@ assert.isTrue(document.querySelectorAll('div')[12].classList.contains('cat-mouth - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
- --fcc-editable-region-- - - --fcc-editable-region-- +
+
+
+
+
+
+
-
+ +
+ + --fcc-editable-region-- + + --fcc-editable-region-- +
+
``` diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/646dffd8ce9ac77ec1906f2e.md b/curriculum/challenges/german/blocks/workshop-cat-painting/646dffd8ce9ac77ec1906f2e.md index ade173efdb1..87f082c421b 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/646dffd8ce9ac77ec1906f2e.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/646dffd8ce9ac77ec1906f2e.md @@ -1,6 +1,6 @@ --- id: 646dffd8ce9ac77ec1906f2e -title: Step 56 +title: Schritt 56 challengeType: 0 dashedName: step-56 --- @@ -43,41 +43,40 @@ assert.isTrue(document.querySelectorAll('.cat-mouth div')[1]?.classList.contains - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
- --fcc-editable-region-- -
- +
+
+
+
+
+
- --fcc-editable-region-- +
+ +
+
+--fcc-editable-region-- + +--fcc-editable-region--
-
+
+
``` @@ -213,5 +212,4 @@ body { border-right: 15px solid transparent; border-bottom: 20px solid #442c2c; } - ``` diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/646f0417322c0e04983a5149.md b/curriculum/challenges/german/blocks/workshop-cat-painting/646f0417322c0e04983a5149.md index abb62751cb6..7fa9e9ac68e 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/646f0417322c0e04983a5149.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/646f0417322c0e04983a5149.md @@ -1,6 +1,6 @@ --- id: 646f0417322c0e04983a5149 -title: Step 59 +title: Schritt 59 challengeType: 0 dashedName: step-59 --- @@ -43,40 +43,39 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-mouth-line-left')?.l - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
+
+
+
+
+ +
+
+
+
-
+
+
``` @@ -222,6 +221,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/646f08293804a30685533c6f.md b/curriculum/challenges/german/blocks/workshop-cat-painting/646f08293804a30685533c6f.md index 489f13f4823..04a0e297103 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/646f08293804a30685533c6f.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/646f08293804a30685533c6f.md @@ -1,6 +1,6 @@ --- id: 646f08293804a30685533c6f -title: Step 60 +title: Schritt 60 challengeType: 0 dashedName: step-60 --- @@ -25,40 +25,39 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-mouth-line-left')?.t - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
+
+
+
+
+ +
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/646f09293eb3230723a62f77.md b/curriculum/challenges/german/blocks/workshop-cat-painting/646f09293eb3230723a62f77.md index 3cdf5a2435a..c5bbe564dec 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/646f09293eb3230723a62f77.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/646f09293eb3230723a62f77.md @@ -1,6 +1,6 @@ --- id: 646f09293eb3230723a62f77 -title: Step 61 +title: Schritt 61 challengeType: 0 dashedName: step-61 --- @@ -43,40 +43,39 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-mouth-line-right')?. - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
+
+
+
+
+ +
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/646f0c9a1e3360092d1bbd33.md b/curriculum/challenges/german/blocks/workshop-cat-painting/646f0c9a1e3360092d1bbd33.md index a1cca7c1add..825cbc6eed6 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/646f0c9a1e3360092d1bbd33.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/646f0c9a1e3360092d1bbd33.md @@ -1,6 +1,6 @@ --- id: 646f0c9a1e3360092d1bbd33 -title: Step 62 +title: Schritt 62 challengeType: 0 dashedName: step-62 --- @@ -25,40 +25,39 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-mouth-line-right')?. - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
+
+
+
+
+ +
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/646f0ce5737243098ad6e494.md b/curriculum/challenges/german/blocks/workshop-cat-painting/646f0ce5737243098ad6e494.md index 676df3cc11d..a861c6bbf37 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/646f0ce5737243098ad6e494.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/646f0ce5737243098ad6e494.md @@ -1,6 +1,6 @@ --- id: 646f0ce5737243098ad6e494 -title: Step 63 +title: Schritt 63 challengeType: 0 dashedName: step-63 --- @@ -33,44 +33,43 @@ assert.isTrue(document.querySelectorAll('div')[15].classList.contains('cat-whisk - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
+
+
+
+
+ +
- --fcc-editable-region-- - - --fcc-editable-region-- - +
+
+
-
+ + --fcc-editable-region-- + + --fcc-editable-region-- +
+
``` diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/646f0ef13604420a8744f7d4.md b/curriculum/challenges/german/blocks/workshop-cat-painting/646f0ef13604420a8744f7d4.md index ec240916b36..12921adbc06 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/646f0ef13604420a8744f7d4.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/646f0ef13604420a8744f7d4.md @@ -1,6 +1,6 @@ --- id: 646f0ef13604420a8744f7d4 -title: Step 64 +title: Schritt 64 challengeType: 0 dashedName: step-64 --- @@ -43,46 +43,45 @@ assert.isTrue(document.querySelectorAll('.cat-whiskers div')[1].classList.contai - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- - --fcc-editable-region-- -
- +
+
- --fcc-editable-region-- +
+ +
+ +
+
+
+
+
+--fcc-editable-region-- + +--fcc-editable-region--
-
+
+
``` diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/646f0f7c5933560af8e7e380.md b/curriculum/challenges/german/blocks/workshop-cat-painting/646f0f7c5933560af8e7e380.md index 529a5d4b627..91b583310b7 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/646f0f7c5933560af8e7e380.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/646f0f7c5933560af8e7e380.md @@ -1,6 +1,6 @@ --- id: 646f0f7c5933560af8e7e380 -title: Step 65 +title: Schritt 65 challengeType: 0 dashedName: step-65 --- @@ -50,49 +50,48 @@ assert.isTrue(document.querySelectorAll('.cat-whiskers-left div')[2].classList.c - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
- --fcc-editable-region-- -
- -
- --fcc-editable-region-- -
+
+
+
+ +
+
+
+
+
+ +
+
+--fcc-editable-region-- + +--fcc-editable-region-- +
+
-
+
+
``` diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/646f102bf87b350b593baa72.md b/curriculum/challenges/german/blocks/workshop-cat-painting/646f102bf87b350b593baa72.md index 1e971ea61db..b751869ec5e 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/646f102bf87b350b593baa72.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/646f102bf87b350b593baa72.md @@ -1,6 +1,6 @@ --- id: 646f102bf87b350b593baa72 -title: Step 66 +title: Schritt 66 challengeType: 0 dashedName: step-66 --- @@ -49,53 +49,52 @@ assert.isTrue(document.querySelectorAll('.cat-whiskers-right div')[2].classList. - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
- --fcc-editable-region-- -
- -
- --fcc-editable-region-- +
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+--fcc-editable-region-- + +--fcc-editable-region-- +
-
+
+
``` diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/646f107abb89d00bb99f387a.md b/curriculum/challenges/german/blocks/workshop-cat-painting/646f107abb89d00bb99f387a.md index 9e8ec662ae3..5fab6013f04 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/646f107abb89d00bb99f387a.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/646f107abb89d00bb99f387a.md @@ -1,6 +1,6 @@ --- id: 646f107abb89d00bb99f387a -title: Step 67 +title: Schritt 67 challengeType: 0 dashedName: step-67 --- @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whiskers-left div')? - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/646f12da0b4c5d0ca162834a.md b/curriculum/challenges/german/blocks/workshop-cat-painting/646f12da0b4c5d0ca162834a.md index 6b1ef543913..571f916705b 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/646f12da0b4c5d0ca162834a.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/646f12da0b4c5d0ca162834a.md @@ -1,6 +1,6 @@ --- id: 646f12da0b4c5d0ca162834a -title: Step 69 +title: Schritt 69 challengeType: 0 dashedName: step-69 --- @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-left-top')?. - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -261,6 +260,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/646f135eab69d90d0c6d4e9b.md b/curriculum/challenges/german/blocks/workshop-cat-painting/646f135eab69d90d0c6d4e9b.md index 8c63963380a..e05c9d39c07 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/646f135eab69d90d0c6d4e9b.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/646f135eab69d90d0c6d4e9b.md @@ -1,6 +1,6 @@ --- id: 646f135eab69d90d0c6d4e9b -title: Step 70 +title: Schritt 70 challengeType: 0 dashedName: step-70 --- @@ -25,53 +25,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-left-top')?. - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -250,5 +249,4 @@ body { --fcc-editable-region-- } - ``` diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/646f159b2cffb21150b927cb.md b/curriculum/challenges/german/blocks/workshop-cat-painting/646f159b2cffb21150b927cb.md index 8f84db65a26..c86fd1be1b0 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/646f159b2cffb21150b927cb.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/646f159b2cffb21150b927cb.md @@ -1,6 +1,6 @@ --- id: 646f159b2cffb21150b927cb -title: Step 71 +title: Schritt 71 challengeType: 0 dashedName: step-71 --- @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-left-middle' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -268,6 +267,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/646f164bf100dd11d226161f.md b/curriculum/challenges/german/blocks/workshop-cat-painting/646f164bf100dd11d226161f.md index b0d19abcf6a..f6e721b8f18 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/646f164bf100dd11d226161f.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/646f164bf100dd11d226161f.md @@ -1,6 +1,6 @@ --- id: 646f164bf100dd11d226161f -title: Step 72 +title: Schritt 72 challengeType: 0 dashedName: step-72 --- @@ -25,53 +25,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-left-middle' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -254,7 +253,7 @@ body { top: 127px; left: 52px; --fcc-editable-region-- - + --fcc-editable-region-- } ``` diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/646f1764e2f1d212ba9785a7.md b/curriculum/challenges/german/blocks/workshop-cat-painting/646f1764e2f1d212ba9785a7.md index be3fc270679..46b767ae5c2 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/646f1764e2f1d212ba9785a7.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/646f1764e2f1d212ba9785a7.md @@ -1,6 +1,6 @@ --- id: 646f1764e2f1d212ba9785a7 -title: Step 73 +title: Schritt 73 challengeType: 0 dashedName: step-73 --- @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-left-bottom' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -275,6 +274,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/646f1802a09a171332e14630.md b/curriculum/challenges/german/blocks/workshop-cat-painting/646f1802a09a171332e14630.md index bcc7c7de971..4f274b5f52e 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/646f1802a09a171332e14630.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/646f1802a09a171332e14630.md @@ -1,6 +1,6 @@ --- id: 646f1802a09a171332e14630 -title: Step 74 +title: Schritt 74 challengeType: 0 dashedName: step-74 --- @@ -25,53 +25,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-left-bottom' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/646f4d6c42dc5f214f4e7444.md b/curriculum/challenges/german/blocks/workshop-cat-painting/646f4d6c42dc5f214f4e7444.md index 81f9872ce61..4e228a11090 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/646f4d6c42dc5f214f4e7444.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/646f4d6c42dc5f214f4e7444.md @@ -1,6 +1,6 @@ --- id: 646f4d6c42dc5f214f4e7444 -title: Step 75 +title: Schritt 75 challengeType: 0 dashedName: step-75 --- @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-right-top')? - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -282,6 +281,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/646f4e46e81f7021d5fd9c1d.md b/curriculum/challenges/german/blocks/workshop-cat-painting/646f4e46e81f7021d5fd9c1d.md index 8c49b67855e..6c0bea87378 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/646f4e46e81f7021d5fd9c1d.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/646f4e46e81f7021d5fd9c1d.md @@ -1,6 +1,6 @@ --- id: 646f4e46e81f7021d5fd9c1d -title: Step 76 +title: Schritt 76 challengeType: 0 dashedName: step-76 --- @@ -25,53 +25,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-right-top')? - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/646f4f6a14e3c522d130a0d2.md b/curriculum/challenges/german/blocks/workshop-cat-painting/646f4f6a14e3c522d130a0d2.md index 2e5fe2acf1d..ff073218427 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/646f4f6a14e3c522d130a0d2.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/646f4f6a14e3c522d130a0d2.md @@ -1,6 +1,6 @@ --- id: 646f4f6a14e3c522d130a0d2 -title: Step 77 +title: Schritt 77 challengeType: 0 dashedName: step-77 --- @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-right-middle - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -289,6 +288,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/646f4fe12b7985232bf475a5.md b/curriculum/challenges/german/blocks/workshop-cat-painting/646f4fe12b7985232bf475a5.md index 7fea28be469..718aa838737 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/646f4fe12b7985232bf475a5.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/646f4fe12b7985232bf475a5.md @@ -1,6 +1,6 @@ --- id: 646f4fe12b7985232bf475a5 -title: Step 78 +title: Schritt 78 challengeType: 0 dashedName: step-78 --- @@ -25,53 +25,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-right-middle - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/646f507e4d1cd323f17db4fc.md b/curriculum/challenges/german/blocks/workshop-cat-painting/646f507e4d1cd323f17db4fc.md index 82312f646f7..da43c49f4a5 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/646f507e4d1cd323f17db4fc.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/646f507e4d1cd323f17db4fc.md @@ -1,6 +1,6 @@ --- id: 646f507e4d1cd323f17db4fc -title: Step 79 +title: Schritt 79 challengeType: 0 dashedName: step-79 --- @@ -44,53 +44,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-right-bottom - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -297,6 +296,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/646f516dbfc1342495515625.md b/curriculum/challenges/german/blocks/workshop-cat-painting/646f516dbfc1342495515625.md index 4df8aca924a..7b09ba4ca67 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/646f516dbfc1342495515625.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/646f516dbfc1342495515625.md @@ -1,6 +1,6 @@ --- id: 646f516dbfc1342495515625 -title: Step 80 +title: Schritt 80 challengeType: 0 dashedName: step-80 --- @@ -27,53 +27,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-right-bottom - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -295,53 +294,53 @@ body { - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+ +
+
``` diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/6476f5c17f99146071ee884c.md b/curriculum/challenges/german/blocks/workshop-cat-painting/6476f5c17f99146071ee884c.md index ae194b127e7..d2ceaf7ded6 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/6476f5c17f99146071ee884c.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/6476f5c17f99146071ee884c.md @@ -1,6 +1,6 @@ --- id: 6476f5c17f99146071ee884c -title: Step 8 +title: Schritt 8 challengeType: 0 dashedName: step-8 --- @@ -41,14 +41,14 @@ assert.equal(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.left, '100p - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
+
+
+
``` @@ -65,9 +65,9 @@ body { .cat-head { --fcc-editable-region-- position: static; +--fcc-editable-region-- top: 100px; left: 100px; ---fcc-editable-region-- background: linear-gradient(#5e5e5e 85%, #45454f 100%); width: 205px; height: 180px; diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/6476f7a4827bcc61682f2347.md b/curriculum/challenges/german/blocks/workshop-cat-painting/6476f7a4827bcc61682f2347.md index 9c2b4f6a741..1c0ca9d69f8 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/6476f7a4827bcc61682f2347.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/6476f7a4827bcc61682f2347.md @@ -9,9 +9,7 @@ dashedName: step-9 Wenn Sie den Wert `absolute` für Ihre `position`-Eigenschaft verwenden, wird das Element aus dem normalen Fluss des Dokuments genommen, und seine Position wird dann durch die Eigenschaften `top`, `right`, `bottom` und `left` bestimmt. -Setzen Sie die `position`-Eigenschaft Ihres `.cat-head`-Elements auf `absolute`, und setzen Sie dann die Eigenschaften `top` und `left` auf einen beliebigen positiven Pixelwert. - - +Setzen Sie die `position`-Eigenschaft Ihres `.cat-head`-Elements auf `absolute`. # --hints-- @@ -43,14 +41,14 @@ assert.match(code, /left:\s*\d{1,4}px;/); - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
+
+
+
``` @@ -67,9 +65,9 @@ body { .cat-head { --fcc-editable-region-- position: relative; +--fcc-editable-region-- top: 100px; left: 100px; ---fcc-editable-region-- background: linear-gradient(#5e5e5e 85%, #45454f 100%); width: 205px; height: 180px; diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/6476fb7cbaafa36d65e9cf35.md b/curriculum/challenges/german/blocks/workshop-cat-painting/6476fb7cbaafa36d65e9cf35.md index cc218c1c881..5b76fad9d2a 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/6476fb7cbaafa36d65e9cf35.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/6476fb7cbaafa36d65e9cf35.md @@ -1,6 +1,6 @@ --- id: 6476fb7cbaafa36d65e9cf35 -title: Step 10 +title: Schritt 10 challengeType: 0 dashedName: step-10 --- @@ -33,17 +33,17 @@ assert.equal(document.querySelectorAll('div')[1]?.getAttribute('class'), 'box'); - - fCC Cat Painting - + + fCC Cat Painting + -
-
- --fcc-editable-region-- - - --fcc-editable-region-- -
+
+
+ --fcc-editable-region-- + + --fcc-editable-region-- +
``` @@ -59,8 +59,8 @@ body { .cat-head { position: absolute; - top: 300px; - left: 400px; + top: 100px; + left: 100px; background: linear-gradient(#5e5e5e 85%, #45454f 100%); width: 205px; height: 180px; diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/6476fc5cf14b276e6d04e82a.md b/curriculum/challenges/german/blocks/workshop-cat-painting/6476fc5cf14b276e6d04e82a.md index 2146f01256f..9cf33f232e2 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/6476fc5cf14b276e6d04e82a.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/6476fc5cf14b276e6d04e82a.md @@ -1,6 +1,6 @@ --- id: 6476fc5cf14b276e6d04e82a -title: Step 11 +title: Schritt 11 challengeType: 0 dashedName: step-11 --- @@ -61,15 +61,15 @@ assert.equal(new __helpers.CSSHelp(document)?.getStyle('.box')?.top, '800px'); - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
+
+
+
+
``` @@ -84,7 +84,7 @@ body { } .cat-head { - position: relative; + position: absolute; top: 100px; left: 100px; background: linear-gradient(#5e5e5e 85%, #45454f 100%); diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/6476fd4213318f6ee211028a.md b/curriculum/challenges/german/blocks/workshop-cat-painting/6476fd4213318f6ee211028a.md index bae9c6ecc00..65dc4cbce5a 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/6476fd4213318f6ee211028a.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/6476fd4213318f6ee211028a.md @@ -1,13 +1,13 @@ --- id: 6476fd4213318f6ee211028a -title: Step 12 +title: Schritt 12 challengeType: 0 dashedName: step-12 --- # --description-- -Ersetzen Sie nun den Wert der `position` Eigenschaft Ihres `.cat-head` durch `fixed`. Lassen Sie sowohl `top` als auch `left` unverändert. +Ersetzen Sie jetzt den Wert der `position`-Eigenschaft Ihrer `.cat-head` durch `fixed`. Scrollen Sie danach nach oben und unten, um zu sehen, wie der `fixed` Wert funktioniert. @@ -39,15 +39,15 @@ assert.equal(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.left, '100p - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
+
+
+
+
``` @@ -63,10 +63,10 @@ body { .cat-head { --fcc-editable-region-- - position: relative; + position: absolute; +--fcc-editable-region-- top: 100px; left: 100px; ---fcc-editable-region-- background: linear-gradient(#5e5e5e 85%, #45454f 100%); width: 205px; height: 180px; diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/64770351e8586671ec0911f0.md b/curriculum/challenges/german/blocks/workshop-cat-painting/64770351e8586671ec0911f0.md index 30104b4b92e..7b9340b0ba8 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/64770351e8586671ec0911f0.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/64770351e8586671ec0911f0.md @@ -41,15 +41,15 @@ assert.notMatch(code, /left:\s*100px;?/); - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
+
+
+
+
``` diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/6477062778c85972eb648030.md b/curriculum/challenges/german/blocks/workshop-cat-painting/6477062778c85972eb648030.md index 941b997b585..a1349832525 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/6477062778c85972eb648030.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/6477062778c85972eb648030.md @@ -1,6 +1,6 @@ --- id: 6477062778c85972eb648030 -title: Step 14 +title: Schritt 14 challengeType: 0 dashedName: step-14 --- @@ -57,15 +57,15 @@ assert.equal(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.margin, 'au - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
+
+
+
+
``` @@ -82,8 +82,8 @@ body { .cat-head { --fcc-editable-region-- position: sticky; - top: 0; --fcc-editable-region-- + top: 0; background: linear-gradient(#5e5e5e 85%, #45454f 100%); width: 205px; height: 180px; @@ -92,7 +92,7 @@ body { } .box { - width: 400px; + width: 200px; height: 600px; background-color: #000; position: absolute; diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/647d821de0d97b3283c72b36.md b/curriculum/challenges/german/blocks/workshop-cat-painting/647d821de0d97b3283c72b36.md index c70520dbc0c..95f3d4d0247 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/647d821de0d97b3283c72b36.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/647d821de0d97b3283c72b36.md @@ -1,6 +1,6 @@ --- id: 647d821de0d97b3283c72b36 -title: Step 16 +title: Schritt 16 challengeType: 0 dashedName: step-16 --- @@ -14,7 +14,7 @@ Entfernen Sie außerdem die `.box`-CSS-Regel und deren Deklarationen, da Sie die Sie sollten die `.box`-CSS-Regel und alle ihre Werte entfernen. ```js -assert.notMatch(code, /\.box\s*\{\s*width:\s*400px;\s*height:\s*600px;\s*background-color:\s*#000;\s*position:\s*absolute;\s*left:\s*650px;\s*top:\s*800px;?\s*\}\s*/) +assert.notMatch(code, /\.box\s*\{\s*width:\s*200px;\s*height:\s*600px;\s*background-color:\s*#000;\s*position:\s*absolute;\s*left:\s*650px;\s*top:\s*800px;?\s*\}\s*/) ``` # --seed-- @@ -25,14 +25,14 @@ assert.notMatch(code, /\.box\s*\{\s*width:\s*400px;\s*height:\s*600px;\s*backgro - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
+
+
+
``` @@ -62,7 +62,7 @@ body { --fcc-editable-region-- .box { - width: 400px; + width: 200px; height: 600px; background-color: #000; position: absolute; diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/647d855ac12cd436059acd39.md b/curriculum/challenges/german/blocks/workshop-cat-painting/647d855ac12cd436059acd39.md index a4fa0161721..bccdc8bf33d 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/647d855ac12cd436059acd39.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/647d855ac12cd436059acd39.md @@ -1,6 +1,6 @@ --- id: 647d855ac12cd436059acd39 -title: Step 2 +title: Schritt 2 challengeType: 0 dashedName: step-2 --- @@ -33,9 +33,9 @@ assert.strictEqual(new __helpers.CSSHelp(document).getStyle('*')?.boxSizing, 'bo - - fCC Cat Painting - + + fCC Cat Painting + diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/649353647c44ef4867ab4935.md b/curriculum/challenges/german/blocks/workshop-cat-painting/649353647c44ef4867ab4935.md index b95975eee30..80c1704da48 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/649353647c44ef4867ab4935.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/649353647c44ef4867ab4935.md @@ -1,6 +1,6 @@ --- id: 649353647c44ef4867ab4935 -title: Step 15 +title: Schritt 15 challengeType: 0 dashedName: step-15 --- @@ -25,17 +25,17 @@ assert.notMatch(code, /<\/div>/) - - fCC Cat Painting - + + fCC Cat Painting + -
-
- --fcc-editable-region-- -
- --fcc-editable-region-- -
+
+
+ --fcc-editable-region-- +
+ --fcc-editable-region-- +
``` @@ -64,7 +64,7 @@ body { } .box { - width: 400px; + width: 200px; height: 600px; background-color: #000; position: absolute; diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/64a2687ef267e5934a2f93e3.md b/curriculum/challenges/german/blocks/workshop-cat-painting/64a2687ef267e5934a2f93e3.md index 6f8a317573d..8e9816ce49d 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/64a2687ef267e5934a2f93e3.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/64a2687ef267e5934a2f93e3.md @@ -1,6 +1,6 @@ --- id: 64a2687ef267e5934a2f93e3 -title: Step 57 +title: Schritt 57 challengeType: 0 dashedName: step-57 --- @@ -43,39 +43,39 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-mouth div')?.border, - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
- -
- -
-
-
+
+
-
+ +
+ +
+
+
+
+
+
``` diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/64a26ac5540c5493f4641f10.md b/curriculum/challenges/german/blocks/workshop-cat-painting/64a26ac5540c5493f4641f10.md index 57423cb8021..f9c224f196a 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/64a26ac5540c5493f4641f10.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/64a26ac5540c5493f4641f10.md @@ -1,6 +1,6 @@ --- id: 64a26ac5540c5493f4641f10 -title: Step 58 +title: Schritt 58 challengeType: 0 dashedName: step-58 --- @@ -32,39 +32,39 @@ assert.match(code, /border-radius:\s*190%\/190px\s*150px\s*0\s*0\s*;?/) - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
- -
- -
-
-
+
+
-
+ +
+ +
+
+
+
+
+
``` diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/64a3bcbc83e574b58c8ed048.md b/curriculum/challenges/german/blocks/workshop-cat-painting/64a3bcbc83e574b58c8ed048.md index f8717a96579..e5748eb60b7 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/64a3bcbc83e574b58c8ed048.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/64a3bcbc83e574b58c8ed048.md @@ -1,6 +1,6 @@ --- id: 64a3bcbc83e574b58c8ed048 -title: Step 68 +title: Schritt 68 challengeType: 0 dashedName: step-68 --- @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whiskers-right div') - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/6676a8a8d9861319ee901a90.md b/curriculum/challenges/german/blocks/workshop-cat-painting/6676a8a8d9861319ee901a90.md index b13b042ae6d..b2daf1b86ce 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/6676a8a8d9861319ee901a90.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/6676a8a8d9861319ee901a90.md @@ -1,6 +1,6 @@ --- id: 6676a8a8d9861319ee901a90 -title: Step 22 +title: Schritt 22 challengeType: 0 dashedName: step-22 --- @@ -103,23 +103,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-ear')?.borderBo - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/german/blocks/workshop-cat-painting/6676a8b01e56ec1a1e07c202.md b/curriculum/challenges/german/blocks/workshop-cat-painting/6676a8b01e56ec1a1e07c202.md index 8c5c52345be..c51beeeee24 100644 --- a/curriculum/challenges/german/blocks/workshop-cat-painting/6676a8b01e56ec1a1e07c202.md +++ b/curriculum/challenges/german/blocks/workshop-cat-painting/6676a8b01e56ec1a1e07c202.md @@ -73,23 +73,23 @@ assert.isEmpty(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.backg - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` @@ -117,15 +117,15 @@ body { border-radius: 46%; } ---fcc-editable-region-- .cat-right-ear { +--fcc-editable-region-- height: 100px; width: 100px; background-color: white; border-left: 35px solid blue; border-right: 35px solid blue; border-top: 35px solid red; +--fcc-editable-region-- border-bottom: 35px solid red; } ---fcc-editable-region-- ``` diff --git a/curriculum/challenges/german/blocks/workshop-envelope-budget-app/69b2c970cb02ddaafff1c10d.md b/curriculum/challenges/german/blocks/workshop-envelope-budget-app/69b2c970cb02ddaafff1c10d.md index c01042f75c1..bf7ec404b1d 100644 --- a/curriculum/challenges/german/blocks/workshop-envelope-budget-app/69b2c970cb02ddaafff1c10d.md +++ b/curriculum/challenges/german/blocks/workshop-envelope-budget-app/69b2c970cb02ddaafff1c10d.md @@ -62,7 +62,7 @@ assert.notMatch(code, /<\/input>/); Das `input`-Element sollte den schließenden `>` haben. ```js -assert.match(code, /HTMLString\s*=\s*`\n\s*Expense\s\$\{entryNumber\}\sName<\/label>\n\s*]*\/>/); +assert.match(code, /HTMLString\s*=\s*`\n\s*Expense\s\$\{entryNumber\}\sName<\/label>\n\s*]*>/); ``` # --seed-- diff --git a/curriculum/challenges/german/blocks/workshop-fcc-authors-page/69e14a2fd8ecf9210c0739ee.md b/curriculum/challenges/german/blocks/workshop-fcc-authors-page/69e14a2fd8ecf9210c0739ee.md index 3702f8579a8..f7a0d73814e 100644 --- a/curriculum/challenges/german/blocks/workshop-fcc-authors-page/69e14a2fd8ecf9210c0739ee.md +++ b/curriculum/challenges/german/blocks/workshop-fcc-authors-page/69e14a2fd8ecf9210c0739ee.md @@ -11,6 +11,12 @@ Beim Aufrufen einer asynchronen Funktion können Sie entweder auf die Rückgabe Fügen Sie im angegebenen Bereich im Editor einen Funktionsaufruf zu `initialFetch` hinzu. +# --before-all-- + +```js +window.fetch = () => Promise.resolve({json: () => Promise.resolve([{ author: 'Whoever', image: 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==', url: "http://not-a-real-url.nowhere/", bio: 'words go here' }])}); +``` + # --hints-- Sie sollten `initialFetch` ohne Argumente aufrufen. diff --git a/curriculum/challenges/german/blocks/workshop-fortune-teller-app/68ded620ab19272a3fa97592.md b/curriculum/challenges/german/blocks/workshop-fortune-teller-app/68ded620ab19272a3fa97592.md index c50d6a14083..bfd0fb898b7 100644 --- a/curriculum/challenges/german/blocks/workshop-fortune-teller-app/68ded620ab19272a3fa97592.md +++ b/curriculum/challenges/german/blocks/workshop-fortune-teller-app/68ded620ab19272a3fa97592.md @@ -73,10 +73,9 @@ assert.isTrue(renderCard.hasReturnAnnotation("string")); Ihre `renderCard`-Funktion sollte ein Template Literal zurückgeben. ```js -assert.match( - __helpers.removeJSComments(code), - /renderCard\s*=\s*\([^)]*\)\s*:\s*string\s*=>\s*(?:\{\s*return\s*)?`/ -); +const explorer = await __helpers.Explorer(code); +const { renderCard } = explorer.allFunctions; +assert.match(__helpers.removeJSComments(renderCard.toString()), /(?:return|=>)\s*`/); ``` # --seed-- diff --git a/curriculum/challenges/german/blocks/workshop-fortune-teller-app/68ed4621677e86eeefa59fe6.md b/curriculum/challenges/german/blocks/workshop-fortune-teller-app/68ed4621677e86eeefa59fe6.md index 34b696cd3aa..219df1cf05e 100644 --- a/curriculum/challenges/german/blocks/workshop-fortune-teller-app/68ed4621677e86eeefa59fe6.md +++ b/curriculum/challenges/german/blocks/workshop-fortune-teller-app/68ed4621677e86eeefa59fe6.md @@ -15,8 +15,8 @@ Ihre `initializeEventListeners`-Methode sollte den Rückgabetyp `void` haben. ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.initializeEventListeners.toString(); -assert.match(method, /initializeEventListeners\s*\(\s*\)\s*:\s*void/); +const { initializeEventListeners } = explorer.classes.Game?.methods ?? {}; +assert.isTrue(initializeEventListeners?.hasReturnAnnotation("void")); ``` # --seed-- diff --git a/curriculum/challenges/german/blocks/workshop-fortune-teller-app/68ee6c4b4c764b62d77df717.md b/curriculum/challenges/german/blocks/workshop-fortune-teller-app/68ee6c4b4c764b62d77df717.md index 7a3335adc5b..5a465efb3b0 100644 --- a/curriculum/challenges/german/blocks/workshop-fortune-teller-app/68ee6c4b4c764b62d77df717.md +++ b/curriculum/challenges/german/blocks/workshop-fortune-teller-app/68ee6c4b4c764b62d77df717.md @@ -17,16 +17,30 @@ Sie sollten eine Variable namens `isReversed` deklarieren. ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.singleCardSelected.toString(); -assert.match(method, /const\s+isReversed\s*=/); +const { singleCardSelected } = explorer.classes.Game?.methods ?? {}; +const { isReversed } = singleCardSelected?.variables ?? {}; +assert.exists(isReversed); ``` Ihre `isReversed`-Variable sollte `Math.random()` verwenden, um zufällig zu entscheiden, ob die Karte umgedreht ist. ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.singleCardSelected.toString(); -assert.match(method, /isReversed\s*=\s*Math\.random\s*\(\s*\)\s*<\s*0\.5/); +const { singleCardSelected } = explorer.classes.Game?.methods ?? {}; +const { isReversed } = singleCardSelected?.variables ?? {}; + +const validForms = [ + 'Math.random() < 0.5', + 'Math.random() > 0.5', + 'Math.random() <= 0.5', + 'Math.random() >= 0.5', + '0.5 < Math.random()', + '0.5 > Math.random()', + '0.5 <= Math.random()', + '0.5 >= Math.random()' +]; + +assert.isTrue(validForms.some((form) => isReversed?.value.matches(form))); ``` # --seed-- diff --git a/curriculum/challenges/german/blocks/workshop-fortune-teller-app/68ee6c8c274515694ead0024.md b/curriculum/challenges/german/blocks/workshop-fortune-teller-app/68ee6c8c274515694ead0024.md index ca6fb7d5585..db8ba5d0bcd 100644 --- a/curriculum/challenges/german/blocks/workshop-fortune-teller-app/68ee6c8c274515694ead0024.md +++ b/curriculum/challenges/german/blocks/workshop-fortune-teller-app/68ee6c8c274515694ead0024.md @@ -7,7 +7,7 @@ dashedName: step-32 # --description-- -Das Glück muss zufällig sein, daher wird eine Hilfsfunktion benötigt, um ein zufälliges Glück auszuwählen. Deklarieren Sie eine Variable namens `chosenCard` innerhalb der `singleCardSelected`-Methode. Verwenden Sie die `getRandomItem`-Methode, um eine zufällige Karte zu erhalten, und übergeben Sie `cards` als Argument. +Das Orakel muss zufällig sein, daher ist eine Hilfsfunktion erforderlich, um ein zufälliges Orakel auszuwählen. Deklarieren Sie eine Variable namens `chosenCard` innerhalb der Methode `singleCardSelected`. Verwenden Sie die Funktion `getRandomItem`, um eine zufällige Karte zu erhalten, und übergeben Sie `this.cards` als Argument. # --hints-- @@ -15,22 +15,18 @@ Sie sollten eine Variable namens `chosenCard` innerhalb von `singleCardSelected` ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.singleCardSelected.toString(); -assert.match(method, /const\s+chosenCard\s*=/); +const { singleCardSelected } = explorer.classes.Game?.methods ?? {}; +const { chosenCard } = singleCardSelected?.variables ?? {}; +assert.exists(chosenCard); ``` Ihre `chosenCard`-Variable sollte durch den Aufruf von `getRandomItem(this.cards)` zugewiesen werden. ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.singleCardSelected.toString(); -assert.match(method, /chosenCard\s*=\s*getRandomItem\s*\(\s*this\.cards\s*\)/); -``` - -Sie sollten `this.cards` als Argument an `getRandomItem` übergeben. - -```js -assert.match(__helpers.removeJSComments(code), /getRandomItem\s*\(\s*this\.cards\s*\)/); +const { singleCardSelected } = explorer.classes.Game?.methods ?? {}; +const { chosenCard } = singleCardSelected?.variables ?? {}; +assert.isTrue(chosenCard?.value.matches("getRandomItem(this.cards)")); ``` # --seed-- diff --git a/curriculum/challenges/german/blocks/workshop-fortune-teller-app/68f1e43a5f890b51774d93c4.md b/curriculum/challenges/german/blocks/workshop-fortune-teller-app/68f1e43a5f890b51774d93c4.md index 7cdf7e9d034..a706b761a56 100644 --- a/curriculum/challenges/german/blocks/workshop-fortune-teller-app/68f1e43a5f890b51774d93c4.md +++ b/curriculum/challenges/german/blocks/workshop-fortune-teller-app/68f1e43a5f890b51774d93c4.md @@ -15,22 +15,28 @@ Sie sollten eine Variable namens `target` innerhalb von `showFortune` deklariere ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /const\s+target\s*=/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { target } = showFortune?.variables ?? {}; +assert.exists(target); ``` Ihr `target`-Variable sollte `e.target` zugewiesen sein. ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /target\s*=\s*e\.target/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { target } = showFortune?.variables ?? {}; +assert.isTrue(target?.value.matches("e.target")); ``` Sie sollten direkt nach Ihrer `if`-Variable eine leere `target`-Anweisung haben. ```js -assert.match(__helpers.removeJSComments(code), /showFortune\s*\([^)]*\)\s*\{[\s\S]*?if\s*\(\s*\)\s*\{\s*\}/); +const explorer = await __helpers.Explorer(code); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +assert.exists(showFortune); +const method = __helpers.removeJSComments(showFortune.toString()); +assert.match(method, /target\s*=\s*e\.target[\s\S]*?if\s*\(\s*\)\s*\{\s*\}/); ``` # --seed-- diff --git a/curriculum/challenges/german/blocks/workshop-fortune-teller-app/68f1e6a98bc05e67cc2b85e6.md b/curriculum/challenges/german/blocks/workshop-fortune-teller-app/68f1e6a98bc05e67cc2b85e6.md index 22d27c4676e..a5feb160578 100644 --- a/curriculum/challenges/german/blocks/workshop-fortune-teller-app/68f1e6a98bc05e67cc2b85e6.md +++ b/curriculum/challenges/german/blocks/workshop-fortune-teller-app/68f1e6a98bc05e67cc2b85e6.md @@ -15,22 +15,18 @@ Sie sollten eine Variable namens `cardElement` innerhalb von `showFortune` dekla ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /const\s+cardElement\s*=/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { cardElement } = showFortune?.variables ?? {}; +assert.exists(cardElement); ``` Ihre `cardElement` sollte `target?.closest` verwenden, um das `.card_container` zu finden. ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /cardElement\s*=\s*target\?\.closest\s*\(\s*['"]\.card_container['"]\s*\)/); -``` - -Sie sollten `.card_container` als Argument an `closest` übergeben. - -```js -assert.match(__helpers.removeJSComments(code), /\.closest\s*\(\s*['"]\.card_container['"]\s*\)/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { cardElement } = showFortune?.variables ?? {}; +assert.isTrue(cardElement?.value.matches("target?.closest('.card_container')")); ``` # --seed-- diff --git a/curriculum/challenges/german/blocks/workshop-fortune-teller-app/68f1e852f705eb77f6bcb893.md b/curriculum/challenges/german/blocks/workshop-fortune-teller-app/68f1e852f705eb77f6bcb893.md index 554ef01af5f..6de1dda5dd2 100644 --- a/curriculum/challenges/german/blocks/workshop-fortune-teller-app/68f1e852f705eb77f6bcb893.md +++ b/curriculum/challenges/german/blocks/workshop-fortune-teller-app/68f1e852f705eb77f6bcb893.md @@ -15,28 +15,18 @@ Sie sollten eine Variable namens `cardId` innerhalb von `showFortune` deklariere ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /const\s+cardId\s*=/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { cardId } = showFortune?.variables ?? {}; +assert.exists(cardId); ``` Ihre `cardId`-Variable sollte durch den Aufruf von `cardElement.getAttribute("data-id")` zugewiesen werden. ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /cardId\s*=\s*cardElement\.getAttribute\s*\(\s*['"]data-id['"]\s*\)/); -``` - -Sie sollten die `getAttribute`-Methode auf `cardElement` verwenden. - -```js -assert.match(__helpers.removeJSComments(code), /cardElement\.getAttribute\s*\(/); -``` - -Sie sollten `'data-id'` an `getAttribute` übergeben. - -```js -assert.match(__helpers.removeJSComments(code), /\.getAttribute\s*\(\s*['"]data-id['"]\s*\)/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { cardId } = showFortune?.variables ?? {}; +assert.isTrue(cardId?.value.matches('cardElement.getAttribute("data-id")')); ``` # --seed-- diff --git a/curriculum/challenges/german/blocks/workshop-fortune-teller-app/68f1e8de2731b07d62e738d2.md b/curriculum/challenges/german/blocks/workshop-fortune-teller-app/68f1e8de2731b07d62e738d2.md index d2b17d44232..cee525067ba 100644 --- a/curriculum/challenges/german/blocks/workshop-fortune-teller-app/68f1e8de2731b07d62e738d2.md +++ b/curriculum/challenges/german/blocks/workshop-fortune-teller-app/68f1e8de2731b07d62e738d2.md @@ -15,28 +15,38 @@ Sie sollten eine Variable namens `foundCard` innerhalb von `showFortune` deklari ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /const\s+foundCard\s*=/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { foundCard } = showFortune?.variables ?? {}; +assert.exists(foundCard); ``` -Ihre `foundCard` sollte zugewiesen werden, indem Sie `find` auf `this.cards` mit dem korrekten Callback aufrufen. +Ihr `foundCard` sollte zugewiesen werden, indem Sie `find` auf `this.cards` aufrufen und einen Callback übergeben, der einen `card`-Parameter annimmt und das Ergebnis des Vergleichs von `card.name_short` mit `cardId` unter Verwendung strikter Gleichheit zurückgibt. ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /foundCard\s*=\s*this\.cards\.find\s*\(/); -``` - -Der `find`-Callback sollte einen Parameter namens `card` haben. - -```js -assert.match(__helpers.removeJSComments(code), /cards\.find\s*\(\s*\(\s*card\s*\)\s*=>/); -``` - -Innerhalb des Callbacks sollte `card.name_short` mit `cardId` verglichen werden. - -```js -assert.match(__helpers.removeJSComments(code), /card\.name_short\s*===?\s*cardId/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { foundCard } = showFortune?.variables ?? {}; + +const validForms = [ + 'this.cards.find((card) => card.name_short === cardId)', + 'this.cards.find((card) => { return card.name_short === cardId; })', + 'this.cards.find((card) => cardId === card.name_short)', + 'this.cards.find((card) => { return cardId === card.name_short; })', + 'this.cards.find(card => card.name_short === cardId)', + 'this.cards.find(card => { return card.name_short === cardId; })', + 'this.cards.find(card => cardId === card.name_short)', + 'this.cards.find(card => { return cardId === card.name_short; })', + 'this.cards.find((card: Card) => card.name_short === cardId)', + 'this.cards.find((card: Card) => { return card.name_short === cardId; })', + 'this.cards.find((card: Card) => cardId === card.name_short)', + 'this.cards.find((card: Card) => { return cardId === card.name_short; })', + 'this.cards.find(function (card) { return card.name_short === cardId; })', + 'this.cards.find(function (card) { return cardId === card.name_short; })', + 'this.cards.find(function (card: Card) { return card.name_short === cardId; })', + 'this.cards.find(function (card: Card) { return cardId === card.name_short; })' +]; + +assert.isTrue(validForms.some((form) => foundCard?.value.matches(form))); ``` # --seed-- diff --git a/curriculum/challenges/german/blocks/workshop-greeting-bot/66ad8ab945d266383f318cbf.md b/curriculum/challenges/german/blocks/workshop-greeting-bot/66ad8ab945d266383f318cbf.md index ac8ac4bad00..f055413da98 100644 --- a/curriculum/challenges/german/blocks/workshop-greeting-bot/66ad8ab945d266383f318cbf.md +++ b/curriculum/challenges/german/blocks/workshop-greeting-bot/66ad8ab945d266383f318cbf.md @@ -30,7 +30,11 @@ assert.lengthOf(logSpy.calls, 2); Ihre `console`-Anweisung sollte die Nachricht `"I am excited to talk to you."` enthalten. Vergessen Sie die Anführungszeichen nicht. ```js -assert.deepInclude(logSpy.calls, ["I am excited to talk to you."]); +assert.isTrue( + logSpy.calls.some( + (call) => /I\s+am\s+excited\s+to\s+talk\s+to\s+you\s*\./.test(call[0]) + ) +); ``` # --seed-- diff --git a/curriculum/challenges/german/blocks/workshop-greeting-bot/66ad9c633fa26d3c1475eae3.md b/curriculum/challenges/german/blocks/workshop-greeting-bot/66ad9c633fa26d3c1475eae3.md index cf668c08385..0b2e01da1cd 100644 --- a/curriculum/challenges/german/blocks/workshop-greeting-bot/66ad9c633fa26d3c1475eae3.md +++ b/curriculum/challenges/german/blocks/workshop-greeting-bot/66ad9c633fa26d3c1475eae3.md @@ -28,7 +28,11 @@ assert.lengthOf(logSpy.calls, 3); Ihre `console`-Anweisung sollte die Nachricht `"Allow me to introduce myself."` enthalten. Vergessen Sie nicht die Anführungszeichen. ```js -assert.deepInclude(logSpy.calls, ["Allow me to introduce myself."]); +assert.isTrue( + logSpy.calls.some( + (call) => /Allow\s+me\s+to\s+introduce\s+myself\s*\./.test(call[0]) + ) +); ``` # --seed-- diff --git a/curriculum/challenges/german/blocks/workshop-greeting-bot/66add47d27763c4862492c8c.md b/curriculum/challenges/german/blocks/workshop-greeting-bot/66add47d27763c4862492c8c.md index 2772d777efb..c7138c112c2 100644 --- a/curriculum/challenges/german/blocks/workshop-greeting-bot/66add47d27763c4862492c8c.md +++ b/curriculum/challenges/german/blocks/workshop-greeting-bot/66add47d27763c4862492c8c.md @@ -76,12 +76,10 @@ console.log(favoriteSubjectSentence); ```js console.log("Hi there!"); console.log("I am excited to talk to you."); - let bot; -let botLocation; - bot = "teacherBot"; -botLocation = "the universe"; + +let botLocation = "the universe"; console.log("Allow me to introduce myself."); diff --git a/curriculum/challenges/german/blocks/workshop-hotel-feedback-form/66a93bbe65a26169dbf3bc39.md b/curriculum/challenges/german/blocks/workshop-hotel-feedback-form/66a93bbe65a26169dbf3bc39.md index 02e97edfb65..968938551a7 100644 --- a/curriculum/challenges/german/blocks/workshop-hotel-feedback-form/66a93bbe65a26169dbf3bc39.md +++ b/curriculum/challenges/german/blocks/workshop-hotel-feedback-form/66a93bbe65a26169dbf3bc39.md @@ -13,7 +13,7 @@ Beginnen Sie damit, dem Formular ein neues `label`-Element mit dem Text `Email a # --hints-- -Sie sollten ein `label`-Element haben. +Sie sollten ein zweites `label`-Element innerhalb Ihres `fieldset` haben. ```js assert.lengthOf(document.querySelectorAll('fieldset label'), 2); diff --git a/curriculum/challenges/german/blocks/workshop-hotel-feedback-form/66a9401c9d660d6bb15993e2.md b/curriculum/challenges/german/blocks/workshop-hotel-feedback-form/66a9401c9d660d6bb15993e2.md index ce25f162b8d..1253c1e13bd 100644 --- a/curriculum/challenges/german/blocks/workshop-hotel-feedback-form/66a9401c9d660d6bb15993e2.md +++ b/curriculum/challenges/german/blocks/workshop-hotel-feedback-form/66a9401c9d660d6bb15993e2.md @@ -15,7 +15,7 @@ Das `for`-Attribut sollte auf `"age"` gesetzt werden. # --hints-- -Sie sollten ein `label`-Element haben. +Sie sollten ein drittes `label`-Element innerhalb Ihres `fieldset` haben. ```js assert.lengthOf(document.querySelectorAll('fieldset label'), 3); diff --git a/curriculum/challenges/german/blocks/workshop-hotel-feedback-form/66a9419e2d18476c645ce693.md b/curriculum/challenges/german/blocks/workshop-hotel-feedback-form/66a9419e2d18476c645ce693.md index 721526512dd..4cfb2cba949 100644 --- a/curriculum/challenges/german/blocks/workshop-hotel-feedback-form/66a9419e2d18476c645ce693.md +++ b/curriculum/challenges/german/blocks/workshop-hotel-feedback-form/66a9419e2d18476c645ce693.md @@ -17,7 +17,7 @@ Hier ist ein Beispiel für ein Zahlen-Eingabefeld: Die `min`- und `max`-Attribute werden verwendet, um die minimalen und maximalen Werte festzulegen, die im Eingabefeld eingegeben werden können. -Fügen Sie unter Ihrem `label`-Element ein Eingabefeld mit dem `type`-Attribut, das auf `"number"` gesetzt ist, und einem `id` von `"age"` hinzu. +Fügen Sie unter Ihrem `label`-Element ein `input` mit dem `type`-Attribut auf `"number"` und einer `id` von `"age"` hinzu. Das `name`-Attribut sollte auf `"age"` gesetzt sein, das `min`-Attribut auf `"3"` und das `max`-Attribut auf `"100"`. @@ -29,13 +29,13 @@ Sie sollten ein Zahlen-`input` unter Ihrem `label`-Element haben. assert.isNotNull(document.querySelector('label + input[type="number"]')); ``` -Ihr Zahlen-`input` sollte ein `id` von `age` haben. +Ihr nummerisches `input` sollte eine `id` von `"age"` haben. ```js assert.isNotNull(document.querySelector('label + input#age')); ``` -Ihr Zahlen-`input` sollte ein `name`-Attribut mit dem Wert `age` haben. +Ihr nummerisches `input` sollte ein `name`-Attribut mit dem Wert `"age"` haben. ```js assert.isNotNull(document.querySelector('label + input[name="age"]')); diff --git a/curriculum/challenges/german/blocks/workshop-hotel-feedback-form/67a51d3a8a6fe123b77b0c6e.md b/curriculum/challenges/german/blocks/workshop-hotel-feedback-form/67a51d3a8a6fe123b77b0c6e.md index f8f7330bf91..cf36dbc3c55 100644 --- a/curriculum/challenges/german/blocks/workshop-hotel-feedback-form/67a51d3a8a6fe123b77b0c6e.md +++ b/curriculum/challenges/german/blocks/workshop-hotel-feedback-form/67a51d3a8a6fe123b77b0c6e.md @@ -7,11 +7,11 @@ dashedName: step-12 # --description-- -`input`-Elemente können ein `size`-Attribut haben. Dieses Attribut definiert die Anzahl der Zeichen, die sichtbar sein sollen, während der Benutzer in die Eingabe tippt. Der Wert von `size` sollte eine nicht negative ganze Zahl größer als null sein. Wenn `size` nicht angegeben ist oder mit einem ungültigen Wert angegeben wird, hat die Eingabe die vom Browser voreingestellte Standardbreite. +`input`-Elemente können ein `size`-Attribut haben. Dieses Attribut definiert die Anzahl der Zeichen, die sichtbar sein sollen, während der Benutzer in das `input` tippt. Der Wert von `size` sollte eine positive ganze Zahl sein. Wenn `size` nicht angegeben ist oder mit einem ungültigen Wert angegeben wird, erhält das `input` die vom Browser festgelegte Standardbreite. ```html - - + + ``` Geben Sie den Eingaben für Name und E-Mail ein `size`-Attribut mit dem Wert `"20"`. diff --git a/curriculum/challenges/german/blocks/workshop-plant-nursery-catalog/6734a772196245601e4b80e0.md b/curriculum/challenges/german/blocks/workshop-plant-nursery-catalog/6734a772196245601e4b80e0.md index 6fb6f1d27a7..165ada0ccdb 100644 --- a/curriculum/challenges/german/blocks/workshop-plant-nursery-catalog/6734a772196245601e4b80e0.md +++ b/curriculum/challenges/german/blocks/workshop-plant-nursery-catalog/6734a772196245601e4b80e0.md @@ -9,7 +9,7 @@ dashedName: step-10 Wenn Sie ein Element aus einer Map abrufen müssen, können Sie die `get`-Methode verwenden. Sie nimmt einen Schlüssel als Argument und gibt den zugehörigen Wert zurück. -Verwenden Sie die `get`-Methode, um den Wert des Schlüssels `ballerina` aus Ihrem Katalog abzurufen und weisen Sie ihn einer Variablen namens `getBallerina` zu. Geben Sie dann Ihre neue Variable in der Konsole aus. +Verwenden Sie die `get`-Methode, um den Wert des Schlüssels `ballerina` aus Ihrem Katalog abzurufen, und weisen Sie ihn einer Variablen namens `getBallerina` zu. Geben Sie dann Ihre neue Variable in der Konsole aus. # --hints-- @@ -22,7 +22,10 @@ assert.exists(getBallerina); Ihre `getBallerina`-Variable sollte den Wert von `catalog.get(ballerina)` haben. ```js -assert.match(__helpers.removeJSComments(code), /(const|let|var)\s+getBallerina\s*=\s*catalog\s*\.\s*get\s*\(\s*ballerina\s*\)/); +const explorer = await __helpers.Explorer(code); +const { getBallerina } = explorer.variables; +assert.isTrue(getBallerina?.value.matches('catalog.get(ballerina)') +); ``` Sie sollten Ihre `getBallerina`-Variable in der Konsole ausgeben. diff --git a/curriculum/challenges/german/blocks/workshop-plant-nursery-catalog/6737a1a073a0d14c6544d301.md b/curriculum/challenges/german/blocks/workshop-plant-nursery-catalog/6737a1a073a0d14c6544d301.md index 92c65a3acb7..464c7390297 100644 --- a/curriculum/challenges/german/blocks/workshop-plant-nursery-catalog/6737a1a073a0d14c6544d301.md +++ b/curriculum/challenges/german/blocks/workshop-plant-nursery-catalog/6737a1a073a0d14c6544d301.md @@ -23,7 +23,9 @@ assert.exists(plantsSet); Sie sollten `displayPlantsSet` aufrufen und es `plantsSet` zuweisen. ```js -assert.match(__helpers.removeJSComments(code), /(const|let|var)\s+plantsSet\s*=\s*displayPlantsSet\s*\(\s*\)/) +const explorer = await __helpers.Explorer(code); +const { plantsSet } = explorer.variables; +assert.isTrue(plantsSet?.value.matches('displayPlantsSet()')); ``` Sie sollten `plantsSet` in der Konsole ausgeben. diff --git a/curriculum/challenges/german/blocks/workshop-reusable-mega-navbar/6740495ba48aa94e5667b436.md b/curriculum/challenges/german/blocks/workshop-reusable-mega-navbar/6740495ba48aa94e5667b436.md index 79d4556bf0f..2d0dcd3bd63 100644 --- a/curriculum/challenges/german/blocks/workshop-reusable-mega-navbar/6740495ba48aa94e5667b436.md +++ b/curriculum/challenges/german/blocks/workshop-reusable-mega-navbar/6740495ba48aa94e5667b436.md @@ -10,7 +10,7 @@ demoType: onLoad In diesem Workshop üben Sie den Umgang mit React-Funktionskomponenten, indem Sie eine wiederverwendbare Navigationsleiste erstellen. -Das gesamte CSS wurde für Sie bereitgestellt, damit Sie sich auf die Erstellung der Navigationsleiste konzentrieren können. +Das gesamte CSS wurde für Sie bereitgestellt, damit Sie sich auf das Erstellen der Navigationsleiste konzentrieren können. Beginnen Sie damit, eine `Navbar` Funktionskomponente zu definieren. Im nächsten Schritt werden Sie die Komponente mit JSX weiter ausbauen. @@ -24,7 +24,7 @@ export function multiply(a, b) { } ``` -Außerdem müssen React-Funktionskomponenten mit einem Großbuchstaben beginnen, da dies eine Möglichkeit ist, sie von regulären HTML-Elementen zu unterscheiden. +Außerdem müssen React-Funktionskomponenten mit einem Großbuchstaben beginnen, da React sie so von regulären HTML-Elementen unterscheidet. # --hints-- diff --git a/curriculum/challenges/german/blocks/workshop-reusable-mega-navbar/67457ff2dc531fbed928a0f0.md b/curriculum/challenges/german/blocks/workshop-reusable-mega-navbar/67457ff2dc531fbed928a0f0.md index 5817b924a09..d4926ef56c8 100644 --- a/curriculum/challenges/german/blocks/workshop-reusable-mega-navbar/67457ff2dc531fbed928a0f0.md +++ b/curriculum/challenges/german/blocks/workshop-reusable-mega-navbar/67457ff2dc531fbed928a0f0.md @@ -24,10 +24,9 @@ const App = () => { } ``` - Innerhalb der `Navbar`-Komponente geben Sie ein `nav`-Element zurück, das ein `className`-Attribut mit dem Wert `navbar` besitzt. -Der Grund, warum hier `className` anstelle von `class` verwendet wird, ist, dass `class` ein reserviertes Schlüsselwort in JavaScript ist. Deshalb verwendet React `className`, um Klassen auf Elemente anzuwenden. +`className` wird hier anstelle von `class` verwendet, weil `class` ein reserviertes Schlüsselwort in JavaScript ist. React nutzt daher `className`, um Klassen auf Elemente anzuwenden. # --hints-- @@ -37,7 +36,7 @@ Sie sollten ein `nav`-Element zurückgeben. assert.exists(document.querySelector('nav')); ``` -Ihr `nav`-Element sollte ein `className`-Attribut mit dem Wert `navbar` haben. +Ihr `nav`-Element sollte eine `className` von `navbar` haben. ```js assert.equal(document.querySelector('nav')?.getAttribute('class'), 'navbar'); diff --git a/curriculum/challenges/german/blocks/workshop-reusable-mega-navbar/6745c732dbeb7c04f346e6f7.md b/curriculum/challenges/german/blocks/workshop-reusable-mega-navbar/6745c732dbeb7c04f346e6f7.md index 8f76a22f33e..2c8d040397f 100644 --- a/curriculum/challenges/german/blocks/workshop-reusable-mega-navbar/6745c732dbeb7c04f346e6f7.md +++ b/curriculum/challenges/german/blocks/workshop-reusable-mega-navbar/6745c732dbeb7c04f346e6f7.md @@ -7,7 +7,7 @@ dashedName: step-3 # --description-- -Erstellen Sie ein `ul`-Element innerhalb des `nav`-Elements. Erstellen Sie innerhalb dieses `ul`-Elements drei Listenelemente. +Erstellen Sie ein `ul`-Element innerhalb Ihres `nav`-Elements. Erstellen Sie innerhalb dieses `ul`-Elements drei `li`-Elemente. # --hints-- diff --git a/curriculum/challenges/german/blocks/workshop-reusable-mega-navbar/6745c89fba004707ded84453.md b/curriculum/challenges/german/blocks/workshop-reusable-mega-navbar/6745c89fba004707ded84453.md index a6bab04bea1..67c0f1a8871 100644 --- a/curriculum/challenges/german/blocks/workshop-reusable-mega-navbar/6745c89fba004707ded84453.md +++ b/curriculum/challenges/german/blocks/workshop-reusable-mega-navbar/6745c89fba004707ded84453.md @@ -7,17 +7,17 @@ dashedName: step-5 # --description-- -Erstellen Sie ein Ankerelement innerhalb des ersten `li`-Elements. Geben Sie dem `a`-Element ein `href`-Attribut mit dem Wert `#` und den Text `Dashboard`. +Erstellen Sie ein `a`-Element innerhalb Ihres ersten `li`-Elements. Geben Sie ihm ein `href`-Attribut mit dem Wert `#` und den Text `Dashboard`. # --hints-- -Sie sollten ein `a`-Element innerhalb des ersten Listenelements erstellen. +Sie sollten ein `a`-Element innerhalb Ihres ersten `li`-Elements erstellen. ```js assert.exists(document.querySelector('li a')); ``` -Ihr `a`-Element sollte sein `href`-Attribut auf `#` gesetzt haben. +Ihr `a`-Element sollte ein `href`-Attribut mit dem Wert `#` haben. ```js assert.equal(document.querySelector('a')?.getAttribute('href'), '#'); diff --git a/curriculum/challenges/german/blocks/workshop-reusable-mega-navbar/6745cebbf97ef2129f3b9bab.md b/curriculum/challenges/german/blocks/workshop-reusable-mega-navbar/6745cebbf97ef2129f3b9bab.md index e28e3e6a137..037d59570cb 100644 --- a/curriculum/challenges/german/blocks/workshop-reusable-mega-navbar/6745cebbf97ef2129f3b9bab.md +++ b/curriculum/challenges/german/blocks/workshop-reusable-mega-navbar/6745cebbf97ef2129f3b9bab.md @@ -7,17 +7,17 @@ dashedName: step-6 # --description-- -Erstellen Sie ein weiteres `a`-Element innerhalb des zweiten `li`-Elements. Geben Sie ihm ein `href`-Attribut mit dem Wert `#` und den Text `Widgets`. +Erstellen Sie ein weiteres `a`-Element innerhalb Ihres zweiten `li`-Elements. Geben Sie ihm ein `href`-Attribut mit dem Wert `#` und den Text `Widgets`. # --hints-- -Sie sollten ein `a`-Element innerhalb des zweiten Listenelements erstellen. +Sie sollten ein `a`-Element innerhalb Ihres zweiten `li`-Elements erstellen. ```js assert.lengthOf(document.querySelectorAll('li a'), 2); ``` -Ihr `a`-Element sollte sein `href`-Attribut auf `#` gesetzt haben. +Ihr `a`-Element sollte ein `href`-Attribut mit dem Wert `#` haben. ```js assert.equal(document.querySelectorAll('a')[1]?.getAttribute('href'), '#'); diff --git a/curriculum/challenges/german/blocks/workshop-reusable-mega-navbar/6745d799beeb822076a4da9d.md b/curriculum/challenges/german/blocks/workshop-reusable-mega-navbar/6745d799beeb822076a4da9d.md index 1fc0588e3a4..f77011e94fe 100644 --- a/curriculum/challenges/german/blocks/workshop-reusable-mega-navbar/6745d799beeb822076a4da9d.md +++ b/curriculum/challenges/german/blocks/workshop-reusable-mega-navbar/6745d799beeb822076a4da9d.md @@ -7,19 +7,19 @@ dashedName: step-7 # --description-- -Erstellen Sie innerhalb des dritten Listenelements ein `button`-Element mit einem `aria-expanded`-Attribut, das auf `false` gesetzt ist. Setzen Sie außerdem den Text des `button` auf `Apps`. +Erstellen Sie innerhalb Ihres dritten `li`-Elements ein `button`-Element mit einem `aria-expanded`-Attribut von `false`. Setzen Sie außerdem den Text des `button` auf `Apps`. Das `aria-expanded`-Attribut signalisiert Screenreader-Nutzenden, dass die Schaltfläche ein erweiterbares Untermenü auslöst. # --hints-- -Sie sollten innerhalb des dritten Listenelements ein `button`-Element erstellen. +Sie sollten ein `button`-Element innerhalb Ihres dritten `li`-Elements erstellen. ```js assert.exists(document.querySelector('li:nth-of-type(3) button')); ``` -Ihr `button`-Element sollte ein `aria-expanded`-Attribut haben, das auf `false` gesetzt ist. +Ihr `button`-Element sollte ein `aria-expanded`-Attribut mit dem Wert `false` haben. ```js assert.equal( diff --git a/curriculum/challenges/german/blocks/workshop-reusable-mega-navbar/6745d9df333efe2543a1f457.md b/curriculum/challenges/german/blocks/workshop-reusable-mega-navbar/6745d9df333efe2543a1f457.md index 089f758d170..600b3607880 100644 --- a/curriculum/challenges/german/blocks/workshop-reusable-mega-navbar/6745d9df333efe2543a1f457.md +++ b/curriculum/challenges/german/blocks/workshop-reusable-mega-navbar/6745d9df333efe2543a1f457.md @@ -7,7 +7,7 @@ dashedName: step-8 # --description-- -Erstellen Sie noch innerhalb des dritten `li`-Elements ein `ul`-Element für das Popup. Geben Sie ihm ein `className` mit dem Wert `sub-menu` und ein `aria-label` mit dem Wert `Apps`. +Erstellen Sie noch innerhalb Ihres dritten `li`-Elements ein `ul`-Element für das Popup. Geben Sie ihm einen `className` von `sub-menu` und ein `aria-label` von `Apps`. # --hints-- @@ -17,13 +17,13 @@ Sie sollten ein `ul`-Element innerhalb Ihres dritten `li`-Elements erstellen. assert.exists(document.querySelector('li ul')); ``` -Sie sollten das `className`-Attribut Ihres `ul`-Elements auf `sub-menu` setzen. +Ihr `ul`-Element sollte einen `className` von `sub-menu` haben. ```js assert.equal(document.querySelector('li ul')?.getAttribute('class'), 'sub-menu'); ``` -Sie sollten das `aria-label`-Attribut Ihres `ul`-Elements auf `Apps` setzen. +Ihr `ul`-Element sollte ein `aria-label` von `Apps` haben. ```js assert.equal(document.querySelector('li ul')?.getAttribute('aria-label'), 'Apps'); diff --git a/curriculum/challenges/german/blocks/workshop-reusable-mega-navbar/6745dce846995b2a466594be.md b/curriculum/challenges/german/blocks/workshop-reusable-mega-navbar/6745dce846995b2a466594be.md index 83dc8d72863..d028c2663e5 100644 --- a/curriculum/challenges/german/blocks/workshop-reusable-mega-navbar/6745dce846995b2a466594be.md +++ b/curriculum/challenges/german/blocks/workshop-reusable-mega-navbar/6745dce846995b2a466594be.md @@ -7,11 +7,11 @@ dashedName: step-9 # --description-- -Erstellen Sie drei neue Listenelemente innerhalb Ihres `ul.sub-menu`-Elements. +Erstellen Sie drei neue `li`-Elemente innerhalb Ihres `ul`-Elements mit einem `className` von `sub-menu`. # --hints-- -Sie sollten drei neue Listenelemente innerhalb Ihres `ul`-Elements mit dem `className` von `sub-menu` erstellen. +Sie sollten drei neue `li`-Elemente innerhalb Ihres `ul`-Elements mit einem `className` von `sub-menu` erstellen. ```js assert.lengthOf(document.querySelectorAll('.sub-menu li'), 3); diff --git a/curriculum/challenges/german/blocks/workshop-reusable-mega-navbar/6745de9ce925b92d72df713a.md b/curriculum/challenges/german/blocks/workshop-reusable-mega-navbar/6745de9ce925b92d72df713a.md index 1a212431557..55081589d89 100644 --- a/curriculum/challenges/german/blocks/workshop-reusable-mega-navbar/6745de9ce925b92d72df713a.md +++ b/curriculum/challenges/german/blocks/workshop-reusable-mega-navbar/6745de9ce925b92d72df713a.md @@ -7,11 +7,11 @@ dashedName: step-10 # --description-- -Erstellen Sie innerhalb jedes `li`-Elements ein Ankerelement mit einem `href`-Attribut, das auf `#` gesetzt ist. +Erstellen Sie innerhalb jedes der drei neuen `li`-Elemente ein `a`-Element mit einem `href`-Attribut von `#`. # --hints-- -Sie sollten innerhalb jedes Listenelements ein neues `a`-Element erstellen und dessen `href`-Attribut auf `#` setzen. +Sie sollten innerhalb jedes der drei neuen `li`-Elemente ein neues `a`-Element mit einem `href`-Attribut von `#` erstellen. ```js assert.equal(document.querySelectorAll('li a')[2]?.getAttribute('href'), '#'); diff --git a/curriculum/challenges/german/blocks/workshop-reusable-mega-navbar/6745e2aca895c935168e7d91.md b/curriculum/challenges/german/blocks/workshop-reusable-mega-navbar/6745e2aca895c935168e7d91.md index 85875eb5723..d9116cd4f22 100644 --- a/curriculum/challenges/german/blocks/workshop-reusable-mega-navbar/6745e2aca895c935168e7d91.md +++ b/curriculum/challenges/german/blocks/workshop-reusable-mega-navbar/6745e2aca895c935168e7d91.md @@ -7,25 +7,25 @@ dashedName: step-11 # --description-- -Um alles abzuschließen, setzen Sie einen Text von `Calendar` für das erste Ankerelement, `Chat` für das zweite und `Email` für das dritte. +Um alles abzuschließen, setzen Sie den Text des ersten `a`-Elements auf `Calendar`, den zweiten auf `Chat` und den dritten auf `Email`. -Damit ist Ihre Mega-Navigationsleisten-Komponente fertig! +Damit ist Ihre `Navbar`-Komponente fertig! # --hints-- -Sie sollten einen Text von `Calendar` für das erste Ankerelement setzen. +Sie sollten den Text des ersten `a`-Elements auf `Calendar` setzen. ```js assert.equal(document.querySelectorAll('li a')[2]?.textContent, 'Calendar'); ``` -Sie sollten einen Text von `Chat` für das zweite Ankerelement setzen. +Sie sollten den Text des zweiten `a`-Elements auf `Chat` setzen. ```js assert.equal(document.querySelectorAll('li a')[3]?.textContent, 'Chat'); ``` -Sie sollten einen Text von `Email` für das dritte Ankerelement setzen. +Sie sollten den Text des dritten `a`-Elements auf `Email` setzen. ```js assert.equal(document.querySelectorAll('li a')[4]?.textContent, 'Email'); diff --git a/curriculum/challenges/german/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165b.md b/curriculum/challenges/german/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165b.md index 98493b37c14..0b1569984e3 100644 --- a/curriculum/challenges/german/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165b.md +++ b/curriculum/challenges/german/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165b.md @@ -7,7 +7,7 @@ dashedName: step-5 # --description-- -Ersetzen Sie in Ihrer return-Anweisung den leeren String durch ein `div`-Element mit einer `className`-Eigenschaft von `flex-container`. +Ersetzen Sie innerhalb der `return`-Anweisung den leeren String durch ein `div`-Element mit einem `className` von `flex-container`. # --hints-- @@ -26,7 +26,7 @@ Ihre `App`-Komponente sollte ein einzelnes `div`-Element zurückgeben. assert.lengthOf(testElem.children, 1); ``` -Ihre `div` sollte eine `className`-Eigenschaft von `flex-container` haben. +Ihr `div` sollte einen `className` von `flex-container` haben. ```js const testElem = await __helpers.prepTestComponent(window.index.App); diff --git a/curriculum/challenges/german/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165c.md b/curriculum/challenges/german/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165c.md index c8ef55c7095..a5ab8795e25 100644 --- a/curriculum/challenges/german/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165c.md +++ b/curriculum/challenges/german/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165c.md @@ -7,7 +7,7 @@ dashedName: step-6 # --description-- -Setzen Sie nun die `Card`-Komponente in Ihre `App`-Komponente ein. Geben Sie ihr die Prop `name` mit dem Wert `"Mark"`, die Prop `title` mit dem Wert `"Front-End developer"` und die Prop `bio` mit dem Wert `"I like to work with different front-end technologies and play video games."` +Fügen Sie jetzt die `Card` Komponente in Ihre `App` Komponente ein. Geben Sie ihr die `name` Prop mit dem Wert `"Mark"`, die `title` Prop mit dem Wert `"Front-End developer"` und die `bio` Prop mit dem Wert `"I like to work with different front-end technologies and play video games."`. # --hints-- diff --git a/curriculum/challenges/german/blocks/workshop-reusable-profile-card-component/68720c179cd34be6793bfdf6.md b/curriculum/challenges/german/blocks/workshop-reusable-profile-card-component/68720c179cd34be6793bfdf6.md index a0b4b3beef9..26167568f65 100644 --- a/curriculum/challenges/german/blocks/workshop-reusable-profile-card-component/68720c179cd34be6793bfdf6.md +++ b/curriculum/challenges/german/blocks/workshop-reusable-profile-card-component/68720c179cd34be6793bfdf6.md @@ -9,7 +9,7 @@ dashedName: step-8 Obwohl Ihre Anwendung wie erwartet funktioniert, würden Sie normalerweise nicht mehrere `Card`-Komponenten manuell auf diese Weise hinzufügen. -Entfernen Sie die drei ``-Komponenten innerhalb des `
`-Elements. In den nächsten Schritten erstellen Sie ein Array von Daten und verwenden die `map()`-Funktion, um die `Card`-Komponenten zu rendern, was der üblichere Ansatz in React ist. +Entfernen Sie die drei ``-Komponenten innerhalb des `
`-Elements. In den nächsten Schritten erstellen Sie ein Array mit Daten und verwenden die `map()`-Methode, um die `Card`-Komponenten zu rendern, was der üblichere Ansatz in React ist. # --hints-- diff --git a/curriculum/challenges/german/blocks/workshop-reusable-profile-card-component/68778af56eb5d980a4e2daed.md b/curriculum/challenges/german/blocks/workshop-reusable-profile-card-component/68778af56eb5d980a4e2daed.md index 500aa53fa82..ed0b7318ff9 100644 --- a/curriculum/challenges/german/blocks/workshop-reusable-profile-card-component/68778af56eb5d980a4e2daed.md +++ b/curriculum/challenges/german/blocks/workshop-reusable-profile-card-component/68778af56eb5d980a4e2daed.md @@ -30,7 +30,7 @@ const profilesVal = eval(profiles?.value.toString()); assert.isArray(profilesVal); ``` -Ihr profiles-Array sollte ein Objekt enthalten, das alle erforderlichen Eigenschaften umfasst: `id`, `name`, `title` und `bio`. +Ihr `profiles` Array sollte ein Objekt enthalten, das alle erforderlichen Eigenschaften umfasst: `id`, `name`, `title` und `bio`. ```js const explorer = await __helpers.Explorer(code); diff --git a/curriculum/challenges/german/blocks/workshop-reusable-profile-card-component/68779156bd3704b727ba5f38.md b/curriculum/challenges/german/blocks/workshop-reusable-profile-card-component/68779156bd3704b727ba5f38.md index 7405a5306d2..9ba24def7e8 100644 --- a/curriculum/challenges/german/blocks/workshop-reusable-profile-card-component/68779156bd3704b727ba5f38.md +++ b/curriculum/challenges/german/blocks/workshop-reusable-profile-card-component/68779156bd3704b727ba5f38.md @@ -7,7 +7,7 @@ dashedName: step-10 # --description-- -Wie Sie sich aus früheren Lektionen erinnern, können Sie die `map`-Methode verwenden, um die verschiedenen Objekte zu durchlaufen und die Komponenten dynamisch so zu rendern: +Wie Sie sich aus früheren Lektionen erinnern, können Sie die `map()`-Methode verwenden, um die verschiedenen Objekte durchzulaufen und die Komponenten dynamisch so zu rendern: ```jsx export function App() { diff --git a/curriculum/challenges/german/blocks/workshop-reusable-profile-card-component/687799aefd1f2af1704065d0.md b/curriculum/challenges/german/blocks/workshop-reusable-profile-card-component/687799aefd1f2af1704065d0.md index d2759153c60..4ad0ecd7f05 100644 --- a/curriculum/challenges/german/blocks/workshop-reusable-profile-card-component/687799aefd1f2af1704065d0.md +++ b/curriculum/challenges/german/blocks/workshop-reusable-profile-card-component/687799aefd1f2af1704065d0.md @@ -23,7 +23,7 @@ Wie Sie sich aus vorherigen Lektionen erinnern, ist es eine bewährte Vorgehensw
``` -Die `key`-Prop hilft React dabei zu erkennen, welche Elemente sich geändert haben, hinzugefügt oder entfernt wurden. Das verbessert die Leistung und ermöglicht effizientere Aktualisierungen. +Die `key` Prop hilft React dabei, zu erkennen, welche Elemente sich geändert haben, hinzugefügt wurden oder entfernt wurden. Das verbessert die Leistung und ermöglicht effizientere Aktualisierungen. Aktualisieren Sie die `Card`-Komponente, um eine `key`-Prop mit dem Wert `profile.id` einzufügen. diff --git a/curriculum/challenges/german/blocks/workshop-toggle-text-app/67cd46ec4ec904186ad52ba5.md b/curriculum/challenges/german/blocks/workshop-toggle-text-app/67cd46ec4ec904186ad52ba5.md index 91213d1ab16..29e206c1af2 100644 --- a/curriculum/challenges/german/blocks/workshop-toggle-text-app/67cd46ec4ec904186ad52ba5.md +++ b/curriculum/challenges/german/blocks/workshop-toggle-text-app/67cd46ec4ec904186ad52ba5.md @@ -7,7 +7,7 @@ dashedName: step-3 # --description-- -Fügen Sie unter Ihrem `button`-Element ein Absatz-Element mit einem `id` von `message` und dem Text `I love freeCodeCamp!` hinzu. +Fügen Sie unter Ihrem `button`-Element ein Absatz-Element mit einer `id` namens `message` und dem Text `I love freeCodeCamp!` hinzu. # --hints-- @@ -17,7 +17,7 @@ Sie sollten ein Absatz-Element haben. assert.exists(document.querySelector("p")); ``` -Ihr Absatz-Element sollte ein `id` von `message` haben. +Ihr Absatz-Element sollte eine `id` namens `message` haben. ```js assert.exists(document.getElementById("message")) diff --git a/curriculum/challenges/german/blocks/workshop-toggle-text-app/67cd49e05693111a41771f29.md b/curriculum/challenges/german/blocks/workshop-toggle-text-app/67cd49e05693111a41771f29.md index ea773ff241f..d49d26558c4 100644 --- a/curriculum/challenges/german/blocks/workshop-toggle-text-app/67cd49e05693111a41771f29.md +++ b/curriculum/challenges/german/blocks/workshop-toggle-text-app/67cd49e05693111a41771f29.md @@ -19,7 +19,7 @@ Die Konvention zur Benennung von Zustandsvariablen ist die Verwendung des Format Erstellen Sie eine neue Zustandsvariable und eine Set-Funktion namens `isVisible` und `setIsVisible`. Denken Sie daran, die Syntax der Destrukturierung von Arrays wie im Beispiel gezeigt zu verwenden. -Weisen Sie dann dem `useState`-Hook einen Anfangswert von `false` zu. +Rufen Sie dann den `useState` Hook mit einem Anfangswert von `false` auf. # --hints-- diff --git a/curriculum/challenges/german/blocks/workshop-toggle-text-app/67cd4fe67813f71c3479e64a.md b/curriculum/challenges/german/blocks/workshop-toggle-text-app/67cd4fe67813f71c3479e64a.md index e220b7aac6a..f9e16a1984e 100644 --- a/curriculum/challenges/german/blocks/workshop-toggle-text-app/67cd4fe67813f71c3479e64a.md +++ b/curriculum/challenges/german/blocks/workshop-toggle-text-app/67cd4fe67813f71c3479e64a.md @@ -9,7 +9,7 @@ dashedName: step-6 Eine Möglichkeit, den Absatztext anzuzeigen, besteht darin, den Anfangswert für den `useState`-Hook zu ändern. -Ändern Sie den aktuellen `useState`-Wert von `false` zu `true`, und Sie sollten sehen, dass der Absatztext jetzt auf dem Bildschirm angezeigt wird. +Ändern Sie den Anfangswert für `useState` von `false` auf `true`. Wenn Sie es richtig machen, sollten Sie sehen, dass der Absatztext jetzt auf dem Bildschirm angezeigt wird. # --hints-- diff --git a/curriculum/challenges/german/blocks/workshop-toggle-text-app/67cd525b0e575b1e5abf4c03.md b/curriculum/challenges/german/blocks/workshop-toggle-text-app/67cd525b0e575b1e5abf4c03.md index 41106f4d5ff..3c07cd5e017 100644 --- a/curriculum/challenges/german/blocks/workshop-toggle-text-app/67cd525b0e575b1e5abf4c03.md +++ b/curriculum/challenges/german/blocks/workshop-toggle-text-app/67cd525b0e575b1e5abf4c03.md @@ -7,7 +7,7 @@ dashedName: step-9 # --description-- -Wie bereits erwähnt, ist die set-Funktion dafür zuständig, den State zu aktualisieren. Ein gängiger Ansatz beim Umschalten zwischen Boolean-State-Werten ist es, den State auf diese Weise zu aktualisieren: +Wie bereits erwähnt, ist die set-Funktion dafür verantwortlich, den Zustand zu aktualisieren. Ein gängiger Ansatz beim Umschalten zwischen Boolean-Zustandswerten besteht darin, den Zustand auf diese Weise zu aktualisieren: ```js const [isUserLoggedIn, setIsUserLoggedIn] = useState(false); @@ -16,7 +16,7 @@ const [isUserLoggedIn, setIsUserLoggedIn] = useState(false); setIsUserLoggedIn(!isUserLoggedIn); ``` -Im folgenden Beispiel wird die set-Funktion namens `setIsUserLoggedIn` verwendet, um den Login-Status des Benutzers zu aktualisieren. Es ist üblich, den logischen NOT-Operator (`!`) zu verwenden, um zwischen `true` und `false` umzuschalten. Da der Anfangswert `false` ist, ändert sich dieser durch Anwenden des `!`-Operators zu `true`. +Im obigen Beispiel wird die set-Funktion mit dem Namen `setIsUserLoggedIn` verwendet, um den Anmeldestatus des Benutzers zu aktualisieren. Es ist üblich, den logischen NICHT-Operator (`!`) zu verwenden, um zwischen `true` und `false` umzuschalten. Da der Anfangswert `false` ist, ändert sich durch Anwenden des `!`-Operators der Wert auf `true`. Verwenden Sie innerhalb der `handleToggleVisibility`-Funktion `setIsVisible`, um den Sichtbarkeits-State mit dem logischen NOT-Operator (`!`) zu aktualisieren. diff --git a/curriculum/challenges/german/blocks/workshop-toggle-text-app/67cd57e96257ed1fabbe4879.md b/curriculum/challenges/german/blocks/workshop-toggle-text-app/67cd57e96257ed1fabbe4879.md index cbf13f137bf..d77133a5eb1 100644 --- a/curriculum/challenges/german/blocks/workshop-toggle-text-app/67cd57e96257ed1fabbe4879.md +++ b/curriculum/challenges/german/blocks/workshop-toggle-text-app/67cd57e96257ed1fabbe4879.md @@ -27,7 +27,7 @@ Jetzt wird beim Klicken auf die Schaltfläche die Sichtbarkeit des Absatztexts a # --hints-- -Wenn auf das `toggle-button` geklickt wird, sollte die Nachricht `"I love freeCodeCamp!"` auf dem Bildschirm erscheinen. +Ihre Nachricht `I love freeCodeCamp!` sollte auf dem Bildschirm erscheinen, wenn auf den `toggle-button` geklickt wird. ```js const abuseState = __helpers.spyOn(React, "useState"); diff --git a/curriculum/challenges/german/blocks/workshop-toggle-text-app/67cd59f6581d3a20c9cc6460.md b/curriculum/challenges/german/blocks/workshop-toggle-text-app/67cd59f6581d3a20c9cc6460.md index 02310d36579..8fdb8e3b4a3 100644 --- a/curriculum/challenges/german/blocks/workshop-toggle-text-app/67cd59f6581d3a20c9cc6460.md +++ b/curriculum/challenges/german/blocks/workshop-toggle-text-app/67cd59f6581d3a20c9cc6460.md @@ -9,7 +9,7 @@ dashedName: step-11 Jetzt ist ein guter Zeitpunkt, um den aktualisierten Wert von `isVisible` anzusehen. -Unterhalb von `setIsVisible(!isVisible);` protokollieren Sie die `isVisible`-Statusvariable in der Konsole. +Geben Sie unter `setIsVisible(!isVisible);` die Zustandsvariable `isVisible` in der Konsole aus. Öffnen Sie die Konsole, und Sie werden feststellen, dass der Wert nicht dem entspricht, was Sie erwartet haben. diff --git a/curriculum/challenges/german/blocks/workshop-toggle-text-app/67cd5bace629fa219a70aa6d.md b/curriculum/challenges/german/blocks/workshop-toggle-text-app/67cd5bace629fa219a70aa6d.md index 741f0e0f9be..1f644fdd44f 100644 --- a/curriculum/challenges/german/blocks/workshop-toggle-text-app/67cd5bace629fa219a70aa6d.md +++ b/curriculum/challenges/german/blocks/workshop-toggle-text-app/67cd5bace629fa219a70aa6d.md @@ -9,7 +9,7 @@ dashedName: step-12 Wenn Sie in die Konsole geschaut haben, waren Sie vielleicht überrascht, den Wert von `false` statt `true` zu sehen. Das passiert, weil React den Zustand nicht sofort aktualisiert. Der Zustand wird erst im nächsten Render-Zyklus aktualisiert. -Es ist ein häufiger Fehler bei Entwickelnden, die neu in React sind, Konsolenausgaben direkt nach einer Set-Funktion zu platzieren. Das sollten Sie beachten, wenn Sie Ihre React-Anwendungen entwickeln. +Es ist ein häufiger Fehler bei Entwicklern, die neu in React sind, Konsolenausgaben direkt nach einer Set-Funktion zu platzieren. Das sollten Sie beachten, während Sie Ihre React-Anwendungen entwickeln. Da `console.log()` nicht mehr benötigt wird, entfernen Sie es aus Ihrer `handleToggleVisibility`-Funktion. diff --git a/curriculum/challenges/german/blocks/workshop-toggle-text-app/67cd61c24bfc0a240132fd2f.md b/curriculum/challenges/german/blocks/workshop-toggle-text-app/67cd61c24bfc0a240132fd2f.md index 9ab25ff436c..fb8722ac056 100644 --- a/curriculum/challenges/german/blocks/workshop-toggle-text-app/67cd61c24bfc0a240132fd2f.md +++ b/curriculum/challenges/german/blocks/workshop-toggle-text-app/67cd61c24bfc0a240132fd2f.md @@ -23,14 +23,14 @@ Und mit dieser letzten Änderung ist Ihr Workshop abgeschlossen! Testen Sie Ihre # --hints-- -Wenn `isVisible` `false` ist, sollte der Button-Text `Show Message` anzeigen. +Ihr Button-Text sollte `Show Message` anzeigen, wenn `isVisible` auf `false` steht. ```js const btn = document.getElementById("toggle-button"); assert.equal(btn.textContent, "Show Message"); ``` -Wenn `isVisible` `true` ist, sollte der Button-Text `Hide Message` anzeigen. +Ihr Button-Text sollte `Hide Message` anzeigen, wenn `isVisible` auf `true` steht. ```js const abuseState = __helpers.spyOn(React, "useState"); @@ -246,7 +246,7 @@ export const ToggleApp = () => { const handleToggleVisibility = () => { setIsVisible(!isVisible); - } + }; return (
diff --git a/curriculum/challenges/german/blocks/workshop-wildlife-tracker/6999ac171928136168654774.md b/curriculum/challenges/german/blocks/workshop-wildlife-tracker/6999ac171928136168654774.md index dc46c16d97d..64998c2eda0 100644 --- a/curriculum/challenges/german/blocks/workshop-wildlife-tracker/6999ac171928136168654774.md +++ b/curriculum/challenges/german/blocks/workshop-wildlife-tracker/6999ac171928136168654774.md @@ -42,8 +42,10 @@ assert.isFunction(getSpecies); Die `getSpecies` Funktion sollte einen einzelnen Parameter namens `animal` haben. ```js -const regex = __helpers.functionRegex('getSpecies', ['animal']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { getSpecies } = explorer.allFunctions; +assert.equal(getSpecies?.parameters.length, 1); +assert.equal(getSpecies?.parameters[0].toString(), 'animal'); ``` Sie sollten `getSpecies(tiger)` in der Konsole ausgeben. diff --git a/curriculum/challenges/german/blocks/workshop-wildlife-tracker/6999ad1cdc249e185aaeedbd.md b/curriculum/challenges/german/blocks/workshop-wildlife-tracker/6999ad1cdc249e185aaeedbd.md index fd750e9a970..e7dae90d3af 100644 --- a/curriculum/challenges/german/blocks/workshop-wildlife-tracker/6999ad1cdc249e185aaeedbd.md +++ b/curriculum/challenges/german/blocks/workshop-wildlife-tracker/6999ad1cdc249e185aaeedbd.md @@ -49,8 +49,11 @@ assert.isFunction(addHabitat); Die Funktion `addHabitat` sollte zwei Parameter haben: `animal` und `habitat`. ```js -const regex = __helpers.functionRegex('addHabitat', ['animal', 'habitat']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { addHabitat } = explorer.allFunctions; +assert.equal(addHabitat?.parameters.length, 2); +assert.equal(addHabitat?.parameters[0].toString(), 'animal'); +assert.equal(addHabitat?.parameters[1].toString(), 'habitat'); ``` Die Funktion `addHabitat` sollte das aktualisierte Objekt `animal` zurückgeben. diff --git a/curriculum/challenges/german/blocks/workshop-wildlife-tracker/6999adc72c02812a28c01e31.md b/curriculum/challenges/german/blocks/workshop-wildlife-tracker/6999adc72c02812a28c01e31.md index 20564b9193a..e73396d37af 100644 --- a/curriculum/challenges/german/blocks/workshop-wildlife-tracker/6999adc72c02812a28c01e31.md +++ b/curriculum/challenges/german/blocks/workshop-wildlife-tracker/6999adc72c02812a28c01e31.md @@ -43,8 +43,11 @@ assert.isFunction(updateAge); Die `updateAge`-Funktion sollte zwei Parameter haben: `animal` und `newAge`. ```js -const regex = __helpers.functionRegex('updateAge', ['animal', 'newAge']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { updateAge } = explorer.allFunctions; +assert.equal(updateAge?.parameters.length, 2); +assert.equal(updateAge?.parameters[0].toString(), 'animal'); +assert.equal(updateAge?.parameters[1].toString(), 'newAge'); ``` Die `updateAge`-Funktion sollte das aktualisierte `animal`-Objekt zurückgeben. diff --git a/curriculum/challenges/german/blocks/workshop-wildlife-tracker/6999b0198d18d402c36cc5fe.md b/curriculum/challenges/german/blocks/workshop-wildlife-tracker/6999b0198d18d402c36cc5fe.md index d2f06c2f721..20bc8297495 100644 --- a/curriculum/challenges/german/blocks/workshop-wildlife-tracker/6999b0198d18d402c36cc5fe.md +++ b/curriculum/challenges/german/blocks/workshop-wildlife-tracker/6999b0198d18d402c36cc5fe.md @@ -45,8 +45,10 @@ assert.isFunction(removeEndangeredStatus); Die Funktion `removeEndangeredStatus` sollte einen einzelnen Parameter `animal` haben. ```js -const regex = __helpers.functionRegex('removeEndangeredStatus', ['animal']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { removeEndangeredStatus } = explorer.allFunctions; +assert.equal(removeEndangeredStatus?.parameters.length, 1); +assert.equal(removeEndangeredStatus?.parameters[0].toString(), 'animal'); ``` Die Funktion `removeEndangeredStatus` sollte das aktualisierte Objekt `animal` zurückgeben. diff --git a/curriculum/challenges/german/blocks/workshop-wildlife-tracker/6999b07c34c2cde21ee6e1d8.md b/curriculum/challenges/german/blocks/workshop-wildlife-tracker/6999b07c34c2cde21ee6e1d8.md index c555547391d..cea225d4527 100644 --- a/curriculum/challenges/german/blocks/workshop-wildlife-tracker/6999b07c34c2cde21ee6e1d8.md +++ b/curriculum/challenges/german/blocks/workshop-wildlife-tracker/6999b07c34c2cde21ee6e1d8.md @@ -49,8 +49,10 @@ assert.isFunction(hasHabitat); Die `hasHabitat`-Funktion sollte einen einzelnen Parameter namens `animal` haben. ```js -const regex = __helpers.functionRegex('hasHabitat', ['animal']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { hasHabitat } = explorer.allFunctions; +assert.equal(hasHabitat?.parameters.length, 1); +assert.equal(hasHabitat?.parameters[0].toString(), 'animal'); ``` `hasHabitat` sollte die `hasOwnProperty`-Methode verwenden, um die `habitat`-Eigenschaft zu überprüfen. diff --git a/curriculum/challenges/german/blocks/workshop-wildlife-tracker/6999b0d79ea938edcb032237.md b/curriculum/challenges/german/blocks/workshop-wildlife-tracker/6999b0d79ea938edcb032237.md index e440c63ba86..e79b52a85f4 100644 --- a/curriculum/challenges/german/blocks/workshop-wildlife-tracker/6999b0d79ea938edcb032237.md +++ b/curriculum/challenges/german/blocks/workshop-wildlife-tracker/6999b0d79ea938edcb032237.md @@ -45,8 +45,11 @@ assert.isFunction(getProperty); Die Funktion `getProperty` sollte zwei Parameter haben: `animal` und `propertyName`. ```js -const regex = __helpers.functionRegex('getProperty', ['animal', 'propertyName']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { getProperty } = explorer.allFunctions; +assert.equal(getProperty?.parameters.length, 2); +assert.equal(getProperty?.parameters[0].toString(), 'animal'); +assert.equal(getProperty?.parameters[1].toString(), 'propertyName'); ``` `getProperty` sollte Klammernotation verwenden, um auf die Eigenschaft zuzugreifen. diff --git a/curriculum/challenges/german/blocks/workshop-wildlife-tracker/699a00de9f564bb0effaa14d.md b/curriculum/challenges/german/blocks/workshop-wildlife-tracker/699a00de9f564bb0effaa14d.md index 22f676913e8..1d42ce070e2 100644 --- a/curriculum/challenges/german/blocks/workshop-wildlife-tracker/699a00de9f564bb0effaa14d.md +++ b/curriculum/challenges/german/blocks/workshop-wildlife-tracker/699a00de9f564bb0effaa14d.md @@ -44,8 +44,10 @@ assert.isFunction(getAge); Die `getAge` Funktion sollte einen einzelnen Parameter haben, `animal`. ```js -const regex = __helpers.functionRegex('getAge', ['animal']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { getAge } = explorer.allFunctions; +assert.equal(getAge?.parameters.length, 1); +assert.equal(getAge?.parameters[0].toString(), 'animal'); ``` `getAge` sollte auf die `age` Eigenschaft mit Punktnotation zugreifen. diff --git a/curriculum/challenges/italian/blocks/back-end-development-and-apis-projects/bd7158d8c443edefaeb5bd0f.md b/curriculum/challenges/italian/blocks/back-end-development-and-apis-projects/bd7158d8c443edefaeb5bd0f.md index c66f2150e7a..39cf69c5e66 100644 --- a/curriculum/challenges/italian/blocks/back-end-development-and-apis-projects/bd7158d8c443edefaeb5bd0f.md +++ b/curriculum/challenges/italian/blocks/back-end-development-and-apis-projects/bd7158d8c443edefaeb5bd0f.md @@ -50,18 +50,22 @@ Il campo di input file del modulo ha l'attributo `name` impostato su `upfile`. Quando invii un file, ricevi il `name`, `type` e `size` del file in byte all'interno della risposta JSON. ```js - const formData = new FormData(); - const fileData = await fetch( - 'https://cdn.freecodecamp.org/weather-icons/01d.png' - ); - const file = await fileData.blob(); - formData.append('upfile', file, 'icon'); + const boundary = 'fccBoundary1234567890'; + const head = + `--${boundary}\r\n` + + 'Content-Disposition: form-data; name="upfile"; filename="icon"\r\n' + + 'Content-Type: image/png\r\n\r\n'; + const body = new Blob([head, new Uint8Array(70), `\r\n--${boundary}--\r\n`]); const data = await fetch(code + '/api/fileanalyse', { method: 'POST', - body: formData + headers: { + 'Content-Type': `multipart/form-data; boundary=${boundary}` + }, + body }); const parsed = await data.json(); assert.property(parsed, 'size'); assert.equal(parsed.name, 'icon'); assert.equal(parsed.type, 'image/png'); ``` + diff --git a/curriculum/challenges/italian/blocks/daily-coding-challenges-javascript/6a26df3e2988bcdded204895.md b/curriculum/challenges/italian/blocks/daily-coding-challenges-javascript/6a26df3e2988bcdded204895.md index 8790693afab..8bdc620c75e 100644 --- a/curriculum/challenges/italian/blocks/daily-coding-challenges-javascript/6a26df3e2988bcdded204895.md +++ b/curriculum/challenges/italian/blocks/daily-coding-challenges-javascript/6a26df3e2988bcdded204895.md @@ -25,10 +25,10 @@ assert.equal(calculateHandicap([72, 72, 72], [72, 72, 72]), 0); assert.equal(calculateHandicap([80, 76, 78, 78], [72, 72, 72, 72]), 6); ``` -`calculateHandicap([42, 45, 46, 44], [36, 36, 36, 36])` dovrebbe restituire `8.3`. +`calculateHandicap([42, 45, 46, 45], [36, 36, 36, 36])` dovrebbe restituire `8.5`. ```js -assert.equal(calculateHandicap([42, 45, 46, 44], [36, 36, 36, 36]), 8.3); +assert.equal(calculateHandicap([42, 45, 46, 45], [36, 36, 36, 36]), 8.5); ``` `calculateHandicap([85, 80, 76, 79, 82], [72, 72, 72, 71, 71])` dovrebbe restituire `8.8`. diff --git a/curriculum/challenges/italian/blocks/daily-coding-challenges-python/6a26df3e2988bcdded204895.md b/curriculum/challenges/italian/blocks/daily-coding-challenges-python/6a26df3e2988bcdded204895.md index 823c20318a9..e63982a4874 100644 --- a/curriculum/challenges/italian/blocks/daily-coding-challenges-python/6a26df3e2988bcdded204895.md +++ b/curriculum/challenges/italian/blocks/daily-coding-challenges-python/6a26df3e2988bcdded204895.md @@ -31,12 +31,12 @@ TestCase().assertEqual(calculate_handicap([80, 76, 78, 78], [72, 72, 72, 72]), 6 }}) ``` -`calculate_handicap([42, 45, 46, 44], [36, 36, 36, 36])` dovrebbe restituire `8.3`. +`calculate_handicap([42, 45, 46, 45], [36, 36, 36, 36])` dovrebbe restituire `8.5`. ```js ({test: () => { runPython(` from unittest import TestCase -TestCase().assertEqual(calculate_handicap([42, 45, 46, 44], [36, 36, 36, 36]), 8.3)`) +TestCase().assertEqual(calculate_handicap([42, 45, 46, 45], [36, 36, 36, 36]), 8.5)`) }}) ``` diff --git a/curriculum/challenges/italian/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb928.md b/curriculum/challenges/italian/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb928.md index 506d6ddeadd..45a64c6b381 100644 --- a/curriculum/challenges/italian/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb928.md +++ b/curriculum/challenges/italian/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb928.md @@ -8,11 +8,11 @@ dashedName: mean-variance-standard-deviation-calculator # --description-- -Lavorerai su questo progetto con il nostro codice boilerplate Ona disponibile qui. +Lavorerai su questo progetto con il nostro codice boilerplate di partenza: clicca qui. Stiamo ancora sviluppando la parte interattiva e didattica del corso di Python. Per ora, ecco alcuni video sul canale YouTube di freeCodeCamp.org che ti insegneranno tutto ciò che ti serve per completare questo progetto: -- Corso video Python per tutti (14 ore) +- Corso video Python for Everybody (14 ore) - Come analizzare dati con Python Pandas (10 ore) @@ -52,7 +52,8 @@ Per esempio, `calculate([0,1,2,3,4,5,6,7,8])` dovrebbe restituire: ## Sviluppo -Scrivi il tuo codice in `mean_var_std.py`. Per lo sviluppo, puoi usare `main.py` per testare il tuo codice. Per eseguire il codice, digita `python3 main.py` nel terminale Ona e premi invio. Questo farà eseguire l'interprete CPython incluso sul file `main.py`. +Scrivi il tuo codice in `mean_var_std.py`. Per lo sviluppo, puoi usare `main.py` per testare il tuo codice. +Per eseguire il codice, digita `python3 main.py` nel terminale e premi invio. Questo farà partire l'interprete CPython incluso per eseguire il file `main.py`. ## Test @@ -60,7 +61,7 @@ I test unitari per questo progetto sono in `test_module.py`. Abbiamo importato i ## Invio -Copia l'URL del tuo progetto e invialo a freeCodeCamp. +Copia l’URL del tuo progetto e invialo a freeCodeCamp. # --hints-- diff --git a/curriculum/challenges/italian/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb929.md b/curriculum/challenges/italian/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb929.md index 870a88b6fa6..fddbeda1bfd 100644 --- a/curriculum/challenges/italian/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb929.md +++ b/curriculum/challenges/italian/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb929.md @@ -8,13 +8,13 @@ dashedName: demographic-data-analyzer # --description-- -Lavorerai su questo progetto con il nostro codice boilerplate di partenza Ona. +Lavorerai su questo progetto con il nostro codice boilerplate di partenza: clicca qui. Stiamo ancora sviluppando la parte interattiva e didattica del corso di Python. Per ora, ecco alcuni video sul canale YouTube di freeCodeCamp.org che ti insegneranno tutto ciò che ti serve per completare questo progetto: -- Corso video Python for Everybody (14 ore) +- Corso video Python for Everybody (14 ore) -- Come analizzare dati con Python Pandas (10 ore) +- Come analizzare dati con Python Pandas (10 ore) # --instructions-- diff --git a/curriculum/challenges/italian/blocks/data-analysis-with-python-projects/5e46f7f8ac417301a38fb92a.md b/curriculum/challenges/italian/blocks/data-analysis-with-python-projects/5e46f7f8ac417301a38fb92a.md index 5de8415fb74..a39bbb427ce 100644 --- a/curriculum/challenges/italian/blocks/data-analysis-with-python-projects/5e46f7f8ac417301a38fb92a.md +++ b/curriculum/challenges/italian/blocks/data-analysis-with-python-projects/5e46f7f8ac417301a38fb92a.md @@ -8,7 +8,7 @@ dashedName: medical-data-visualizer # --description-- -Lavorerai su questo progetto con il nostro codice boilerplate di partenza Ona. +Lavorerai su questo progetto con il nostro codice boilerplate di partenza, disponibile qui. Stiamo ancora sviluppando la parte interattiva e didattica del corso di Python. Per ora, ecco alcuni video sul canale YouTube di freeCodeCamp.org che ti insegneranno tutto ciò che ti serve per completare questo progetto: diff --git a/curriculum/challenges/italian/blocks/data-analysis-with-python-projects/5e46f802ac417301a38fb92b.md b/curriculum/challenges/italian/blocks/data-analysis-with-python-projects/5e46f802ac417301a38fb92b.md index dd3cfe7aa8c..cd0ef69def6 100644 --- a/curriculum/challenges/italian/blocks/data-analysis-with-python-projects/5e46f802ac417301a38fb92b.md +++ b/curriculum/challenges/italian/blocks/data-analysis-with-python-projects/5e46f802ac417301a38fb92b.md @@ -8,13 +8,13 @@ dashedName: page-view-time-series-visualizer # --description-- -Lavorerai su questo progetto con il nostro codice starter di Ona. +Lavorerai su questo progetto con il nostro codice boilerplate di partenza qui. Stiamo ancora sviluppando la parte interattiva e didattica del corso di Python. Per ora, ecco alcuni video sul canale YouTube di freeCodeCamp.org che ti insegneranno tutto ciò che ti serve per completare questo progetto: -- Corso video Python per tutti (14 ore) +- Corso video Python for Everybody (14 ore) -- Come analizzare i dati con Python Pandas (10 ore) +- Come analizzare dati con Python Pandas (10 ore) # --instructions-- @@ -30,7 +30,7 @@ Usa i dati per completare le seguenti attività: Per ogni grafico, assicurati di usare una copia del dataframe. -Il codice boilerplate include anche comandi per salvare e restituire l'immagine. +Il codice boilerplate include anche comandi per salvare e restituire l’immagine. ## Sviluppo @@ -42,7 +42,7 @@ I test unitari per questo progetto sono in `test_module.py`. Abbiamo importato i ## Invio -Copia l'URL del tuo progetto e invialo a freeCodeCamp. +Copia l’URL del tuo progetto e invialo a freeCodeCamp. # --hints-- diff --git a/curriculum/challenges/italian/blocks/data-analysis-with-python-projects/5e4f5c4b570f7e3a4949899f.md b/curriculum/challenges/italian/blocks/data-analysis-with-python-projects/5e4f5c4b570f7e3a4949899f.md index 0a25716b061..fba80c9050d 100644 --- a/curriculum/challenges/italian/blocks/data-analysis-with-python-projects/5e4f5c4b570f7e3a4949899f.md +++ b/curriculum/challenges/italian/blocks/data-analysis-with-python-projects/5e4f5c4b570f7e3a4949899f.md @@ -8,7 +8,7 @@ dashedName: sea-level-predictor # --description-- -Lavorerai su questo progetto con il nostro codice boilerplate Ona disponibile qui. +Lavorerai su questo progetto con il nostro codice boilerplate di partenza qui. Stiamo ancora sviluppando la parte interattiva e didattica del corso di Python. Per ora, ecco alcuni video sul canale YouTube di freeCodeCamp.org che ti insegneranno tutto ciò che ti serve per completare questo progetto: @@ -30,15 +30,15 @@ Usa i dati per completare le seguenti attività: Il codice boilerplate include anche comandi per salvare e restituire l’immagine. -## Development +## Sviluppo Scrivi il tuo codice in `sea_level_predictor.py`. Per lo sviluppo, puoi usare `main.py` per testare il codice. -## Testing +## Test -I test unitari per questo progetto si trovano in `test_module.py`. Abbiamo importato i test da `test_module.py` a `main.py` per tua convenienza. +I test unitari per questo progetto sono in `test_module.py`. Abbiamo importato i test da `test_module.py` a `main.py` per tua convenienza. -## Submitting +## Invio Copia l’URL del tuo progetto e invialo a freeCodeCamp. diff --git a/curriculum/challenges/italian/blocks/information-security-projects/5e46f979ac417301a38fb932.md b/curriculum/challenges/italian/blocks/information-security-projects/5e46f979ac417301a38fb932.md index 840f3ffb520..7f64dedc00a 100644 --- a/curriculum/challenges/italian/blocks/information-security-projects/5e46f979ac417301a38fb932.md +++ b/curriculum/challenges/italian/blocks/information-security-projects/5e46f979ac417301a38fb932.md @@ -9,15 +9,15 @@ dashedName: port-scanner # --description-- -Lavorerai su questo progetto con il nostro codice boilerplate Ona. +Lavorerai su questo progetto con il nostro codice boilerplate. Stiamo ancora sviluppando la parte interattiva e didattica del corso di Python. Per ora, ecco alcuni video sul canale YouTube di freeCodeCamp.org che ti insegneranno tutto ciò che ti serve per completare questo progetto: -- Python for Everybody Video Course (14 ore) +- Corso video Python for Everybody (14 ore) -- Learn Python Basics in Depth (4 ore) +- Impara le basi di Python in profondità (4 ore) -- Intermediate Python Course (6 ore) +- Corso intermedio di Python (6 ore) # --instructions-- diff --git a/curriculum/challenges/italian/blocks/information-security-projects/5e46f983ac417301a38fb933.md b/curriculum/challenges/italian/blocks/information-security-projects/5e46f983ac417301a38fb933.md index e2761890292..311d689af60 100644 --- a/curriculum/challenges/italian/blocks/information-security-projects/5e46f983ac417301a38fb933.md +++ b/curriculum/challenges/italian/blocks/information-security-projects/5e46f983ac417301a38fb933.md @@ -9,7 +9,7 @@ dashedName: sha-1-password-cracker # --description-- -Lavorerai su questo progetto con il nostro codice boilerplate Ona disponibile qui. +Lavorerai su questo progetto con il nostro codice boilerplate. Stiamo ancora sviluppando la parte interattiva e didattica del corso di Python. Per ora, ecco alcuni video sul canale YouTube di freeCodeCamp.org che ti insegneranno tutto ciò che ti serve per completare questo progetto: @@ -55,7 +55,7 @@ I test unitari per questo progetto sono in `test_module.py`. Abbiamo importato i ## Invio -Copia l'URL del tuo progetto e invialo a freeCodeCamp. +Copia l’URL del tuo progetto e invialo a freeCodeCamp. # --hints-- diff --git a/curriculum/challenges/italian/blocks/lab-availability-table/66b36358ed4f261d64840c24.md b/curriculum/challenges/italian/blocks/lab-availability-table/66b36358ed4f261d64840c24.md index 4b894842971..a28ea6cb6c3 100644 --- a/curriculum/challenges/italian/blocks/lab-availability-table/66b36358ed4f261d64840c24.md +++ b/curriculum/challenges/italian/blocks/lab-availability-table/66b36358ed4f261d64840c24.md @@ -13,17 +13,17 @@ demoType: onClick **Storie utente:** 1. Dovresti avere una tabella con almeno tre colonne e cinque righe, intestazioni incluse. -1. Le celle nella prima riga dovrebbero essere intestazioni di tabella contenenti i giorni della settimana. -1. Le celle nella prima colonna dovrebbero essere intestazioni di tabella con una `class` di `time` e dovrebbero contenere valori orari come testo. -1. Tutte le celle dati dovrebbero avere la `class` di `available-#`, dove `#` è un numero da `0` a `5` che specifica il numero di persone disponibili in quel momento. +1. La prima riga dovrebbe avere celle di intestazione della tabella contenenti i giorni della settimana. +1. La prima colonna dovrebbe avere celle di intestazione della tabella con una `class` di `time` contenenti valori orari come testo. +1. Tutte le celle di dati dovrebbero avere la `class` di `available-#`, dove `#` è un numero da `0` a `5` che specifica il numero di persone disponibili in quel momento. 1. La tua tabella dovrebbe avere un elemento `caption` con il testo `Weekly Meeting Availability Schedule`. -1. Tutte le celle intestazione della tabella nella prima riga (i giorni della settimana) dovrebbero avere un attributo `scope` con il valore `col`. -1. Tutte le celle intestazione della tabella nella prima colonna (le celle orarie) dovrebbero avere un attributo `scope` con il valore `row`. -1. Tutte le celle dati con una classe di disponibilità dovrebbero avere un attributo `aria-label` che descrive il livello di disponibilità (ad esempio, `0 available` per le celle `available-0`, `1 available` per le celle `available-1`, ecc., e `5+ available` per le celle `available-5`). -1. Nel tuo selettore `:root`, dovresti definire sei variabili CSS chiamate `--color#`, dove `#` è un numero da `0` a `5`, e assegnare a ciascuna un valore colore. Usa queste variabili per impostare il colore di sfondo degli elementi corrispondenti `.available-#`. -1. Nel tuo selettore `:root`, dovresti definire variabili CSS chiamate `--solid-border` e `--dashed-border`. Usa queste variabili per definire lo stile del bordo inferiore delle celle dati, alternando tra bordi solidi e tratteggiati a seconda della riga. Dai alle righe la classe `sharp` o `half` per definirne lo stile. +1. Tutte le celle di intestazione della tabella nella prima riga (i giorni della settimana) dovrebbero avere un attributo `scope` con il valore `col`. +1. Tutte le celle di intestazione della tabella nella prima colonna (le celle orarie) dovrebbero avere un attributo `scope` con il valore `row`. +1. Tutte le celle di dati con una classe di disponibilità dovrebbero avere un attributo `aria-label` che descrive il livello di disponibilità (ad esempio, `0 available` per le celle `available-0`, `1 available` per le celle `available-1`, ecc., e `5+ available` per le celle `available-5`). +1. Nel tuo selettore `:root`, dovresti definire sei variabili CSS chiamate `--color#`, dove `#` è un numero da `0` a `5`, e assegnare a ciascuna un valore colore. Usa queste variabili per impostare il colore di sfondo degli elementi `.available-#` corrispondenti. +1. Nel tuo selettore `:root`, dovresti definire variabili CSS chiamate `--solid-border` e `--dashed-border`. Usa queste variabili per definire lo stile dei bordi inferiori delle celle di dati, alternando tra bordi solidi e tratteggiati a seconda della riga. Dai alle righe la classe `sharp` o `half` per definirne lo stile. 1. Dovresti avere un elemento `div` con l'`id` di `legend`. Dovrebbe contenere un elemento `span` con il testo `Availability` e un elemento `div` con l'`id` di `legend-gradient`. -1. Dovresti dare all'elemento `#legend-gradient` un gradiente lineare che transizioni tra tutti i colori da `--color0` a `--color5` con linee nette. +1. Dovresti dare all'elemento `#legend-gradient` un gradiente lineare che transita tra tutti i colori da `--color0` a `--color5` con linee nette. **Nota:** Assicurati di collegare il tuo foglio di stile nel tuo HTML per applicare il CSS. @@ -389,7 +389,7 @@ headers.forEach(header => { Tutte le celle intestazione della tabella nella prima colonna dovrebbero avere un attributo `scope` con il valore `row`. ```js -const timeHeaders = [...document.querySelectorAll('tr > th:first-child')]; +const timeHeaders = [...document.querySelectorAll('th.time')]; assert.isNotEmpty(timeHeaders); timeHeaders.forEach(header => { assert.equal(header.getAttribute('scope'), 'row'); diff --git a/curriculum/challenges/italian/blocks/lab-cargo-manifest-validator/69a56b5069ca99f7317e6e19.md b/curriculum/challenges/italian/blocks/lab-cargo-manifest-validator/69a56b5069ca99f7317e6e19.md index 6c5c2def201..dbd0faba0fe 100644 --- a/curriculum/challenges/italian/blocks/lab-cargo-manifest-validator/69a56b5069ca99f7317e6e19.md +++ b/curriculum/challenges/italian/blocks/lab-cargo-manifest-validator/69a56b5069ca99f7317e6e19.md @@ -11,10 +11,10 @@ In questo laboratorio userai JavaScript per normalizzare e validare i manifesti Ogni manifesto di carico sarà rappresentato come un oggetto con le seguenti proprietà: -- `containerId`: un intero positivo che identifica il contenitore di carico associato. -- `destination`: una stringa non vuota (dopo aver rimosso gli spazi bianchi) che indica la destinazione finale del carico. +- `containerId`: un numero intero positivo che identifica il contenitore associato. +- `destination`: una stringa non vuota (dopo aver rimosso gli spazi) che indica la destinazione finale del carico. - `weight`: un numero positivo che rappresenta il peso del carico. -- `unit`: una stringa che descrive le unità per la proprietà peso del carico (o `"kg"` per chilogrammi o `"lb"` per libbre). +- `unit`: una stringa che descrive l'unità della proprietà `weight` del carico (o `"kg"` per chilogrammi o `"lb"` per libbre). - `hazmat`: un valore booleano che indica se è necessario gestire materiali pericolosi. Esempio di oggetto manifesto di carico: @@ -34,13 +34,13 @@ Esempio di oggetto manifesto di carico: **Storie utente:** 1. Devi implementare una funzione chiamata `normalizeUnits` con un parametro `manifest`. - - La funzione non deve modificare l'oggetto manifesto originale e deve sempre restituire un nuovo oggetto dove `weight` è normalizzato in chilogrammi e `unit` è impostato su `"kg"`. - - Se il peso dell'oggetto manifesto è espresso in libbre (`unit: "lb"`), la funzione deve convertire `weight` in chilogrammi usando la conversione approssimativa 1 lb = 0,45 kg e aggiornare di conseguenza `unit`. - - Se il peso è già espresso in chilogrammi (`unit: "kg"`), `weight` e `unit` devono rimanere invariati. + - La funzione non deve modificare l'oggetto manifest originale e deve sempre restituire un nuovo oggetto in cui `weight` è normalizzato in chilogrammi e `unit` è impostato su `"kg"`. + - Se il `weight` dell'oggetto manifest è espresso in libbre (`unit: "lb"`), la funzione deve convertire il `weight` in chilogrammi usando la conversione approssimativa `1 lb = 0.45 kg` e aggiornare di conseguenza la `unit`. + - Se il `weight` è già espresso in chilogrammi (`unit: "kg"`), `weight` e `unit` devono rimanere invariati. 2. Devi implementare una funzione chiamata `validateManifest` con un parametro `manifest`. - - La funzione non deve modificare l'oggetto manifesto originale e deve sempre restituire un nuovo oggetto. - - Se il manifesto in input è valido (nessuna proprietà mancante o non valida), la funzione deve restituire un oggetto vuoto. - - Se il manifesto in input non è valido, la funzione deve restituire un oggetto contenente elementi per ogni proprietà mancante o non valida. Le proprietà mancanti devono avere il valore `"Missing"` e quelle non valide il valore `"Invalid"`. + - La funzione non deve modificare l'oggetto manifest originale e deve sempre restituire un nuovo oggetto. + - Se il manifest in input è valido (nessuna proprietà mancante o non valida), la funzione deve restituire un oggetto vuoto. + - Se il manifest in input non è valido, la funzione deve restituire un oggetto contenente elementi per ogni proprietà mancante o non valida. Le proprietà mancanti devono avere il valore `"Missing"` e quelle non valide il valore `"Invalid"`. Esempio di valore di ritorno quando l'oggetto in input manca della proprietà `destination` e ha una proprietà `weight` non valida: @@ -52,11 +52,12 @@ Esempio di valore di ritorno quando l'oggetto in input manca della proprietà `d ``` 3. Devi implementare una funzione chiamata `processManifest` con un parametro `manifest`. La funzione deve stampare: - - Se l'oggetto manifesto è valido, `Validation success: ${containerId}` e poi il peso del manifesto in chilogrammi come `Total weight: ${weight} kg`. Usa `normalizeUnits()` per questa conversione. - - Se l'oggetto manifesto non è valido, `Validation error: ${containerId}` e poi l'oggetto restituito chiamando `validateManifest()` con l'oggetto manifesto. - **Nota:** ciascuno di questi due casi deve avere due chiamate `console.log()`. + - Se l'oggetto manifest è valido, `Validation success: ${containerId}` e poi il `weight` del manifest in chilogrammi, nel formato `Total weight: ${weight} kg`. Usa `normalizeUnits()` per questa conversione. + - Se l'oggetto manifest non è valido, `Validation error: ${containerId}` e poi l'oggetto restituito chiamando `validateManifest()` con l'oggetto manifest. -**Nota:** né `normalizeUnits`, né `validateManifest`, né `processManifest` dovrebbero essere dichiarate usando `const`, poiché i test devono poterle riassegnare. +**Nota:** Ciascuno di questi due casi deve prevedere due chiamate a `console.log()`. + +**Nota:** Non dichiarare `normalizeUnits`, `validateManifest` o `processManifest` usando `const`, perché i test devono poterle riassegnare. # --before-each-- @@ -120,7 +121,7 @@ console.log = () => {}; # --hints-- -Né `normalizeUnits`, né `validateManifest`, né `processManifest` dovrebbero essere dichiarate usando `const`, poiché i test devono poterle riassegnare. +Non devi dichiarare `normalizeUnits`, `validateManifest` o `processManifest` usando `const`, perché i test devono poterle riassegnare. ```js assert.doesNotThrow(() => { @@ -140,12 +141,12 @@ assert.equal(params.length, 1); assert.equal(params[0].toString(), 'manifest'); ``` -Chiamare `normalizeUnits()` con `{ containerId: 68, destination: "Salinas", weight: 101, unit: "lb", hazmat: true }` deve restituire il nuovo oggetto `{ containerId: 68, destination: "Salinas", weight: 45.45, unit: "kg", hazmat: true }` senza modificare l'input originale. +La tua funzione `normalizeUnits` deve restituire il nuovo oggetto `{ containerId: 68, destination: "Salinas", weight: 45.45, unit: "kg", hazmat: true }` quando viene chiamata con `{ containerId: 68, destination: "Salinas", weight: 101, unit: "lb", hazmat: true }`, senza modificare l'originale. ```js const testObj = { containerId: 68, - destination: "Salinas", + destination: "Salinas", weight: 101, unit: "lb", hazmat: true @@ -161,7 +162,7 @@ const expected = { const copy = normalizeUnits(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "normalizeUnits() did not return the expected normalized object"); +assert.deepEqual(copy, expected, "normalizeUnits() did not return the expected normalized object."); assert.notStrictEqual(copy, testObj, "normalizeUnits() should return a new object."); assert.strictEqual(testObj.containerId, 68, "Original object should not be mutated."); assert.strictEqual(testObj.destination, "Salinas", "Original object should not be mutated."); @@ -171,13 +172,13 @@ assert.strictEqual(testObj.hazmat, true, "Original object should not be mutated. assert.equal(Object.keys(testObj).length, 5, "Original object should not be mutated."); ``` -La tua funzione `normalizeUnits` deve restituire una copia dell'oggetto manifesto in input con `weight` normalizzato in chilogrammi e `unit` impostato su `"kg"`. Usa la conversione approssimativa `1 lb = 0.45 kg` per la conversione del peso. +La tua funzione `normalizeUnits` deve restituire una copia dell'oggetto manifest in input con il suo `weight` normalizzato in chilogrammi e la sua `unit` impostata su `"kg"`. Usa la conversione approssimativa `1 lb = 0.45 kg` per la conversione del `weight`. ```js _validManifests.forEach((obj, i) => { const result = normalizeUnits(obj); - assert.isObject(result, "normalizeUnits should return an object"); - assert.notStrictEqual(result, obj, "normalizeUnits must return a new object, not modify the original"); + assert.isObject(result, "normalizeUnits() should return an object."); + assert.notStrictEqual(result, obj, "normalizeUnits() should return a new object, not mutate the original."); const expectedWeight = obj.unit === "lb" ? obj.weight * 0.45 : obj.weight; const expected = { ...obj, @@ -188,12 +189,12 @@ _validManifests.forEach((obj, i) => { assert.deepEqual( result, expected, - `normalizeUnits did not return the expected normalized object for manifest at index ${i}` + `normalizeUnits() did not return the expected normalized object for manifest at index ${i}.` ); }); ``` -La tua funzione `normalizeUnits` deve restituire una nuova copia dell'oggetto `manifest` in input senza modificare l'originale. +La tua funzione `normalizeUnits` deve restituire una nuova copia dell'oggetto manifest in input senza modificare l'originale. ```js const original = { @@ -231,12 +232,12 @@ assert.equal(params.length, 1); assert.equal(params[0].toString(), 'manifest'); ``` -Chiamare `validateManifest()` con `{ containerId: 1, destination: "Santa Cruz", weight: 304, unit: "kg", hazmat: false }` deve restituire il nuovo oggetto `{}`. +La tua funzione `validateManifest` deve restituire un nuovo oggetto vuoto `{}` quando viene chiamata con `{ containerId: 1, destination: "Santa Cruz", weight: 304, unit: "kg", hazmat: false }`. ```js const testObj = { containerId: 1, - destination: "Santa Cruz", + destination: "Santa Cruz", weight: 304, unit: "kg", hazmat: false @@ -246,16 +247,16 @@ const expected = {}; const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for a valid manifest"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.strictEqual(testObj.containerId, 1, "Original object should not be mutated"); -assert.strictEqual(testObj.destination, "Santa Cruz", "Original object should not be mutated"); -assert.strictEqual(testObj.weight, 304, "Original object should not be mutated"); -assert.strictEqual(testObj.unit, "kg", "Original object should not be mutated"); -assert.strictEqual(testObj.hazmat, false, "Original object should not be mutated"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for a valid manifest."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.strictEqual(testObj.containerId, 1, "Original object should not be mutated."); +assert.strictEqual(testObj.destination, "Santa Cruz", "Original object should not be mutated."); +assert.strictEqual(testObj.weight, 304, "Original object should not be mutated."); +assert.strictEqual(testObj.unit, "kg", "Original object should not be mutated."); +assert.strictEqual(testObj.hazmat, false, "Original object should not be mutated."); ``` -Se l'oggetto manifesto in input è valido, la tua funzione `validateManifest` deve restituire un oggetto vuoto `{}`. +La tua funzione `validateManifest` deve restituire un oggetto vuoto `{}` se l'oggetto manifest in input è valido. ```js const solution = {}; @@ -268,7 +269,7 @@ for (const obj of _validManifests) { } ``` -Chiamare `validateManifest()` con `{}` deve restituire il nuovo oggetto `{ containerId: "Missing", destination: "Missing", weight: "Missing", unit: "Missing", hazmat: "Missing" }` senza modificare l'input originale. +La tua funzione `validateManifest` deve restituire il nuovo oggetto `{ containerId: "Missing", destination: "Missing", weight: "Missing", unit: "Missing", hazmat: "Missing" }` quando viene chiamata con `{}`, senza modificare l'originale. ```js const testObj = {}; @@ -283,12 +284,12 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for missing properties"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.equal(Object.keys(testObj).length, 0, "validateManifest() should return a new object, not mutate the original"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for missing properties."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.equal(Object.keys(testObj).length, 0, "validateManifest() should return a new object, not mutate the original."); ``` -Chiamare `validateManifest()` con `{ containerId: null, destination: "Santa Cruz", weight: 304, unit: "kg", hazmat: false }` deve restituire il nuovo oggetto `{ containerId: "Invalid" }` senza modificare l'input originale. +La tua funzione `validateManifest` deve restituire il nuovo oggetto `{ containerId: "Invalid" }` quando viene chiamata con `{ containerId: null, destination: "Santa Cruz", weight: 304, unit: "kg", hazmat: false }`, senza modificare l'originale. ```js const testObj = { @@ -305,11 +306,11 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for null containerId"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for null containerId."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); ``` -Chiamare `validateManifest()` con `{ containerId: 0, destination: 405, weight: -84, unit: "pounds", hazmat: "no" }` deve restituire il nuovo oggetto `{ containerId: "Invalid", destination: "Invalid", weight: "Invalid", unit: "Invalid", hazmat: "Invalid" }` senza modificare l'input originale. +La tua funzione `validateManifest` deve restituire il nuovo oggetto `{ containerId: "Invalid", destination: "Invalid", weight: "Invalid", unit: "Invalid", hazmat: "Invalid" }` quando viene chiamata con `{ containerId: 0, destination: 405, weight: -84, unit: "pounds", hazmat: "no" }`, senza modificare l'originale. ```js const testObj = { @@ -330,16 +331,16 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid properties"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.strictEqual(testObj.containerId, 0, "Original object should not be mutated"); -assert.strictEqual(testObj.destination, 405, "Original object should not be mutated"); -assert.strictEqual(testObj.weight, -84, "Original object should not be mutated"); -assert.strictEqual(testObj.unit, "pounds", "Original object should not be mutated"); -assert.strictEqual(testObj.hazmat, "no", "Original object should not be mutated"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid properties."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.strictEqual(testObj.containerId, 0, "Original object should not be mutated."); +assert.strictEqual(testObj.destination, 405, "Original object should not be mutated."); +assert.strictEqual(testObj.weight, -84, "Original object should not be mutated."); +assert.strictEqual(testObj.unit, "pounds", "Original object should not be mutated."); +assert.strictEqual(testObj.hazmat, "no", "Original object should not be mutated."); ``` -Chiamare `validateManifest()` con `{ containerId: -2 }` deve restituire il nuovo oggetto `{ containerId: "Invalid", destination: "Missing", weight: "Missing", unit: "Missing", hazmat: "Missing" }` senza modificare l'input originale. +La tua funzione `validateManifest` deve restituire il nuovo oggetto `{ containerId: "Invalid", destination: "Missing", weight: "Missing", unit: "Missing", hazmat: "Missing" }` quando viene chiamata con `{ containerId: -2 }`, senza modificare l'originale. ```js const testObj = { @@ -356,13 +357,13 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.strictEqual(testObj.containerId, -2, "Original object should not be mutated"); -assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.strictEqual(testObj.containerId, -2, "Original object should not be mutated."); +assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated."); ``` -Chiamare `validateManifest()` con `{ containerId: 3.50 }` deve restituire il nuovo oggetto `{ containerId: "Invalid", destination: "Missing", weight: "Missing", unit: "Missing", hazmat: "Missing" }` senza modificare l'input originale. Puoi usare `Number.isInteger()` per validare valori interi. +La tua funzione `validateManifest` deve restituire il nuovo oggetto `{ containerId: "Invalid", destination: "Missing", weight: "Missing", unit: "Missing", hazmat: "Missing" }` quando viene chiamata con `{ containerId: 3.50 }`, senza modificare l'originale. Puoi usare `Number.isInteger()` per validare i valori interi. ```js const testObj = { @@ -379,13 +380,13 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.strictEqual(testObj.containerId, 3.50, "Original object should not be mutated"); -assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.strictEqual(testObj.containerId, 3.50, "Original object should not be mutated."); +assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated."); ``` -Chiamare `validateManifest()` con `{ destination: " " }` deve restituire il nuovo oggetto `{ containerId: "Missing", destination: "Invalid", weight: "Missing", unit: "Missing", hazmat: "Missing" }` senza modificare l'input originale. Puoi usare `String.trim()` per rimuovere gli spazi bianchi da una stringa. +La tua funzione `validateManifest` deve restituire il nuovo oggetto `{ containerId: "Missing", destination: "Invalid", weight: "Missing", unit: "Missing", hazmat: "Missing" }` quando viene chiamata con `{ destination: " " }`, senza modificare l'originale. Puoi usare `.trim()` per rimuovere gli spazi da una stringa. ```js const testObj = { @@ -402,13 +403,13 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.strictEqual(testObj.destination, " ", "Original object should not be mutated"); -assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.strictEqual(testObj.destination, " ", "Original object should not be mutated."); +assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated."); ``` -Chiamare `validateManifest()` con `{ weight: NaN }` deve restituire il nuovo oggetto `{ containerId: "Missing", destination: "Missing", weight: "Invalid", unit: "Missing", hazmat: "Missing" }` senza modificare l'input originale. Puoi usare `Number.isNaN()` per validare valori NaN. +La tua funzione `validateManifest` deve restituire il nuovo oggetto `{ containerId: "Missing", destination: "Missing", weight: "Invalid", unit: "Missing", hazmat: "Missing" }` quando viene chiamata con `{ weight: NaN }`, senza modificare l'originale. Puoi usare `Number.isNaN()` per validare i valori `NaN`. ```js const testObj = { @@ -425,13 +426,13 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.ok(Number.isNaN(testObj.weight), "Original object should not be mutated"); -assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.ok(Number.isNaN(testObj.weight), "Original object should not be mutated."); +assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated."); ``` -Se l'oggetto manifesto in input non è valido, la tua funzione `validateManifest` deve restituire un oggetto che descrive le proprietà mancanti e/o non valide. +La tua funzione `validateManifest` deve restituire un oggetto che descrive le proprietà mancanti e/o non valide se l'oggetto manifest in input non è valido. ```js const solutions = [ @@ -504,7 +505,7 @@ assert.equal(params.length, 1); assert.equal(params[0].toString(), 'manifest'); ``` -Chiamare `processManifest()` con `{ containerId: 55, destination: "Carmel", weight: 400, unit: "lb", hazmat: false }` deve prima stampare `"Validation success: 55"` e poi `"Total weight: 180 kg"`. +La tua funzione `processManifest` deve prima stampare `Validation success: 55` e poi stampare `Total weight: 180 kg` quando viene chiamata con `{ containerId: 55, destination: "Carmel", weight: 400, unit: "lb", hazmat: false }`. ```js const testObj = { @@ -524,8 +525,8 @@ try { ["Validation success: 55"], ["Total weight: 180 kg"] ]; - assert.deepEqual(spy.calls[0], expectedCalls[0], "First log should be the validation success message"); - assert.deepEqual(spy.calls[1], expectedCalls[1], "Second log should be the normalized weight in kg"); + assert.deepEqual(spy.calls[0], expectedCalls[0], "First log should be the validation success message."); + assert.deepEqual(spy.calls[1], expectedCalls[1], "Second log should be the normalized weight in kg."); } catch (err) { assert.fail(err); @@ -534,7 +535,7 @@ try { } ``` -Se l'oggetto manifesto in input è valido, la tua funzione `processManifest` deve prima stampare il messaggio di successo `Validation success: ${containerId}`. +La tua funzione `processManifest` deve prima stampare il messaggio di successo, `Validation success: ${containerId}`, se l'oggetto manifest in input è valido. ```js const testObj = { @@ -562,7 +563,7 @@ try { } ``` -Se l'oggetto manifesto in input è valido, la tua funzione `processManifest` deve normalizzarlo in chilogrammi usando `normalizeUnits()` e poi stampare: `Total weight: ${weight} kg`. +La tua funzione `processManifest` deve normalizzare un oggetto manifest valido in input in chilogrammi usando `normalizeUnits()` e poi stampare `Total weight: ${weight} kg`. ```js const testObj = { @@ -590,7 +591,7 @@ try { } ``` -Se l'oggetto manifesto in input è valido, la tua funzione `processManifest` deve stampare un messaggio di successo con `containerId` dell'oggetto, e poi stampare `weight` dell'oggetto in chilogrammi. Devi usare `normalizeUnits()` per la conversione e avere due chiamate `console.log()`. +La tua funzione `processManifest` deve stampare un messaggio di successo con il `containerId` dell'oggetto, e poi stampare il `weight` dell'oggetto in chilogrammi, se l'oggetto manifest in input è valido. Devi usare `normalizeUnits()` per la conversione, e questo deve prevedere due chiamate a `console.log()`. ```js const originalNormalize = normalizeUnits; @@ -605,7 +606,7 @@ try { assert.isTrue( called, - "processManifest should call normalizeUnits() when the manifest is valid" + "processManifest() should call normalizeUnits() when the manifest is valid." ); } catch (err) { @@ -635,7 +636,7 @@ try { } ``` -Chiamare `processManifest()` con `{ containerId: -88, destination: "Soledad", weight: NaN }` deve prima stampare `Validation error: -88` e poi stampare l'oggetto `{ containerId: "Invalid", weight: "Invalid", unit: "Missing", hazmat: "Missing" }`. +La tua funzione `processManifest` deve prima stampare `Validation error: -88` e poi stampare l'oggetto `{ containerId: "Invalid", weight: "Invalid", unit: "Missing", hazmat: "Missing" }` quando viene chiamata con `{ containerId: -88, destination: "Soledad", weight: NaN }`. ```js const testObj = { @@ -658,8 +659,8 @@ try { }] ]; - assert.deepEqual(spy.calls[0], expectedCalls[0], "First log should be the validation error message"); - assert.deepEqual(spy.calls[1], expectedCalls[1], "Second log should be the validation result object"); + assert.deepEqual(spy.calls[0], expectedCalls[0], "First log should be the validation error message."); + assert.deepEqual(spy.calls[1], expectedCalls[1], "Second log should be the validation result object."); } catch (err) { assert.fail(err); @@ -668,7 +669,7 @@ try { } ``` -Chiamare `processManifest()` con `{ destination: "Watsonville", hazmat: true }` deve prima stampare `Validation error: undefined` e poi stampare l'oggetto `{ containerId: "Missing", weight: "Missing", unit: "Missing" }`. +La tua funzione `processManifest` deve prima stampare `Validation error: undefined` e poi stampare l'oggetto `{ containerId: "Missing", weight: "Missing", unit: "Missing" }` quando viene chiamata con `{ destination: "Watsonville", hazmat: true }`. ```js const testObj = { @@ -689,8 +690,8 @@ try { }] ]; - assert.deepEqual(spy.calls[0], expectedCalls[0], "First log should be the validation error message"); - assert.deepEqual(spy.calls[1], expectedCalls[1], "Second log should be the validation result object"); + assert.deepEqual(spy.calls[0], expectedCalls[0], "First log should be the validation error message."); + assert.deepEqual(spy.calls[1], expectedCalls[1], "Second log should be the validation result object."); } catch (err) { assert.fail(err); @@ -699,7 +700,7 @@ try { } ``` -Se l'oggetto manifesto in input non è valido, la tua funzione `processManifest` deve prima stampare il messaggio di errore `Validation error: ${containerId}`. +La tua funzione `processManifest` deve prima stampare il messaggio di errore, `Validation error: ${containerId}`, se l'oggetto manifest in input non è valido. ```js const spy = __helpers.spyOn(console, "log"); @@ -718,13 +719,13 @@ try { assert.deepEqual(spy.calls[0], expectedCalls[0]); } catch (err) { - assert.fail(err); + assert.fail(err); } finally { spy.restore(); } ``` -Se l'oggetto manifesto in input non è valido, la tua funzione `processManifest` deve anche stampare l'oggetto restituito chiamando `validateManifest()` con l'oggetto manifesto originale. Chiama `console.log()` direttamente con l'oggetto restituito. +La tua funzione `processManifest` deve anche stampare l'oggetto restituito chiamando `validateManifest()` con l'oggetto manifest originale se l'oggetto manifest in input non è valido. Chiama direttamente `console.log()` con l'oggetto restituito. ```js const originalValidate = validateManifest; @@ -740,7 +741,7 @@ try { assert.isTrue( called, - "processManifest should call validateManifest() when the manifest is invalid" + "processManifest() should call validateManifest() when the manifest is invalid." ); } catch (err) { @@ -765,13 +766,13 @@ try { assert.deepEqual(spy.calls[1], expectedCalls[1]); } catch (err) { - assert.fail(err); + assert.fail(err); } finally { spy.restore(); } ``` -Se l'oggetto manifesto in input non è valido, la tua funzione `processManifest` deve stampare un messaggio di errore con `containerId` dell'oggetto, e poi stampare l'oggetto restituito chiamando `validateManifest()` con l'oggetto in input. Questo deve prevedere due chiamate `console.log()`. +La tua funzione `processManifest` deve stampare un messaggio di errore con il `containerId` dell'oggetto, e poi stampare l'oggetto restituito chiamando `validateManifest()` con l'oggetto in input, se l'oggetto manifest in input non è valido. Questo deve prevedere due chiamate a `console.log()`. ```js const originalValidate = validateManifest; @@ -787,7 +788,7 @@ try { assert.isTrue( called, - "processManifest should call validateManifest() when the manifest is invalid" + "processManifest() should call validateManifest() when the manifest is invalid." ); } catch (err) { @@ -812,7 +813,7 @@ try { assert.deepEqual(spy.calls, expectedCalls); } catch (err) { - assert.fail(err); + assert.fail(err); } finally { spy.restore(); } diff --git a/curriculum/challenges/italian/blocks/lab-digital-pet-game/68c362b379059c388d3874f2.md b/curriculum/challenges/italian/blocks/lab-digital-pet-game/68c362b379059c388d3874f2.md index 66e9d27eabe..ba4a310897c 100644 --- a/curriculum/challenges/italian/blocks/lab-digital-pet-game/68c362b379059c388d3874f2.md +++ b/curriculum/challenges/italian/blocks/lab-digital-pet-game/68c362b379059c388d3874f2.md @@ -1,6 +1,6 @@ --- id: 68c362b379059c388d3874f2 -title: crea un gioco con un animale digitale +title: Crea un gioco con un animale digitale challengeType: 25 dashedName: lab-digital-pet-game demoType: onClick @@ -60,6 +60,7 @@ La seconda vista: ```js globalThis._PET_NAME = 'Fitzgerald'; globalThis._clock = __FakeTimers.install(); +window.fetch = () => Promise.resolve({ json: () => Promise.resolve('Cats sleep for around 13 to 16 hours a day.') }); ``` # --after-all-- diff --git a/curriculum/challenges/italian/blocks/lab-fcc-forum-leaderboard/673c91f0b934834bc4a3ecc2.md b/curriculum/challenges/italian/blocks/lab-fcc-forum-leaderboard/673c91f0b934834bc4a3ecc2.md index bf6e3ece39e..170173995ae 100644 --- a/curriculum/challenges/italian/blocks/lab-fcc-forum-leaderboard/673c91f0b934834bc4a3ecc2.md +++ b/curriculum/challenges/italian/blocks/lab-fcc-forum-leaderboard/673c91f0b934834bc4a3ecc2.md @@ -93,6 +93,68 @@ Nota che i valori `avatar_template` sono percorsi relativi: iniziano con `/` e c 1. La funzione `fetchData` deve richiedere dati da `forumLatest` e chiamare `showLatestPosts` passando la risposta analizzata come JSON. 1. Se c'è un errore durante il recupero dei dati, la funzione `fetchData` deve registrare l'errore nella console. Devi usare specificamente `console.log` per questo. +# --before-all-- + +```js +const _testUsers = [ + { + avatar_template: '/user_avatar/QuincyLarson_{size}.png', + id: 6, + name: 'Quincy Larson', + username: 'QuincyLarson' + }, + { + avatar_template: '/user_avatar/jwilkins.oboe_{size}.png', + id: 285941, + name: 'Jessica Wilkins', + username: 'jwilkins.oboe' + }, + { + avatar_template: '/user_avatar/ilenia_{size}.png', + id: 170865, + name: 'Ilenia', + username: 'ilenia' + } +]; + +const _testPosters = [ + { user_id: 6 }, + { user_id: 285941 }, + { user_id: 170865 } +]; + +const _testData = { + users: _testUsers, + topic_list: { + topics: [ + { + bumped_at: '2024-04-15T16:01:26.403Z', + category_id: 1, + id: 684569, + posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], + posts_count: 8, + slug: 'the-freecodecamp-podcast-is-back-now-with-video', + title: 'The freeCodeCamp Podcast is back – now with video', + views: 542 + }, + { + bumped_at: '2024-04-19T13:52:03.523Z', + category_id: 421, + id: 686149, + posters: [{ user_id: 170865 }], + posts_count: 1, + slug: 'problem-with-making-changes-to-styles-js', + title: 'Problem with making changes to styles. (JS)', + views: 9 + } + ] + } +}; + +window.fetch = () => + Promise.resolve({ json: () => Promise.resolve(_testData) }); +``` + # --hints-- Devi avere una funzione chiamata `timeAgo` che prende un singolo argomento. @@ -297,31 +359,8 @@ assert.lengthOf(avatars, 2); La funzione `avatars` deve restituire una stringa ottenuta unendo `img` elementi, uno per ogni poster trovato nell'array utenti. ```js -const posters = [{ user_id: 6 }, { user_id: 285941 }, { user_id: 170865 }]; -const users = [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - }, - { id: 20 } -]; +const posters = _testPosters; +const users = [..._testUsers, { id: 20 }]; const actual = avatars(posters, users); const matches = actual.match(/<\s*img\s+.+?>/g); assert.lengthOf(matches, 3); @@ -330,31 +369,8 @@ assert.lengthOf(matches, 3); Ogni elemento `img` nella stringa restituita dalla funzione `avatars` deve avere un testo `alt` con il valore della proprietà `name` del poster. ```js -const posters = [{ user_id: 6 }, { user_id: 285941 }, { user_id: 170865 }]; -const users = [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - }, - { id: 20 } -]; +const posters = _testPosters; +const users = [..._testUsers, { id: 20 }]; const actual = avatars(posters, users); const matches = actual.match(/<\s*img\s+.+?>/g); @@ -366,31 +382,8 @@ assert.match(matches[2], /alt=('|")Ilenia\1/); La funzione `avatars` deve impostare la dimensione di ogni avatar consultando la proprietà `avatar_template` e sostituendo `{size}` con `30`. ```js -const posters = [{ user_id: 6 }, { user_id: 285941 }, { user_id: 170865 }]; -const users = [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - }, - { id: 20 } -]; +const posters = _testPosters; +const users = [..._testUsers, { id: 20 }]; const actual = avatars(posters, users); assert.notMatch(actual, /\{size\}/); assert.lengthOf(actual.match(/_30/g), 3); @@ -399,31 +392,8 @@ assert.lengthOf(actual.match(/_30/g), 3); Ogni elemento `img` deve avere un attributo `src` impostato al `avatar_template` dell'utente corrispondente. Se `avatar_template` inizia con `/`, anteponi direttamente `avatarUrl`. ```js -const posters = [{ user_id: 6 }, { user_id: 285941 }, { user_id: 170865 }]; -const users = [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - }, - { id: 20 } -]; +const posters = _testPosters; +const users = [..._testUsers, { id: 20 }]; const actual = avatars(posters, users); const matches = actual.match(/<\s*img\s+.+?>/g); @@ -458,19 +428,15 @@ assert.isFunction(fetchData); La tua funzione `fetchData` deve richiedere dati da `https://cdn.freecodecamp.org/curriculum/forum-latest/latest.json`. ```js -const testArr = []; -const temp = fetch; +const spy = __helpers.spyOn(window, 'fetch'); try { - fetch = source => { - testArr.push(source); - return temp(source); - }; fetchData(); - assert.deepEqual(testArr, [ + assert.include( + spy.calls.map(call => call[0]), 'https://cdn.freecodecamp.org/curriculum/forum-latest/latest.json' - ]); + ); } finally { - fetch = temp; + spy.restore(); } ``` @@ -521,55 +487,7 @@ async () => { `showLatestPosts` deve impostare l'HTML interno di `#posts-container` a una stringa ottenuta unendo `tr` elementi, uno per ogni elemento in `topics`. ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const pContainer = document.getElementById('posts-container'); pContainer.innerHTML = ''; showLatestPosts(data); @@ -579,55 +497,7 @@ assert.lengthOf(pContainer.querySelectorAll('tr'), 2); Ogni elemento `tr` dalla stringa restituita da `showLatestPosts` deve contenere 5 elementi `td`. ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const pContainer = document.getElementById('posts-container'); pContainer.innerHTML = ''; showLatestPosts(data); @@ -638,55 +508,7 @@ assert.lengthOf(pContainer.querySelectorAll('tr:last-child>td'), 5); Il primo elemento `td` di ogni riga della tabella dalla stringa restituita da `showLatestPosts` deve contenere due elementi àncora, il primo con la classe `post-title`, un `href` di `/`, un testo dell'àncora `` e il secondo ottenuto chiamando `forumCategory` con `category_id`. ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const pContainer = document.getElementById('posts-container'); pContainer.innerHTML = ''; showLatestPosts(data); @@ -731,55 +553,7 @@ assert.equal( Il secondo elemento `td` di ogni riga della tabella dalla stringa restituita da `showLatestPosts` deve contenere le immagini restituite dalla funzione `avatars` chiamata con `posters` e `users` come argomenti, annidate in un elemento `div` con la classe `avatar-container`. ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const pContainer = document.getElementById('posts-container'); pContainer.innerHTML = ''; showLatestPosts(data); @@ -820,55 +594,7 @@ assert.equal(imgs2[0].alt, 'Ilenia'); Il terzo elemento `td` di ogni riga della tabella dalla stringa restituita da `showLatestPosts` deve contenere il numero di risposte al post. _Suggerimento:_ usa `posts_count - 1`. ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const pContainer = document.getElementById('posts-container'); pContainer.innerHTML = ''; showLatestPosts(data); @@ -887,55 +613,7 @@ assert.equal( Il quarto elemento `td` di ogni riga della tabella dalla stringa restituita da `showLatestPosts` deve contenere il numero di visualizzazioni del post. ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const pContainer = document.getElementById('posts-container'); pContainer.innerHTML = ''; showLatestPosts(data); @@ -954,55 +632,7 @@ assert.equal( Il quinto elemento `td` di ogni riga della tabella dalla stringa restituita da `showLatestPosts` deve contenere il tempo trascorso dall'ultima attività, generato usando la funzione `timeAgo`. ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const calcTime = time => { const currentTime = new Date(); const lastPost = new Date(time); diff --git a/curriculum/challenges/italian/blocks/lab-javascript-trivia-bot/66ed41f912d0bb1dc62da5dd.md b/curriculum/challenges/italian/blocks/lab-javascript-trivia-bot/66ed41f912d0bb1dc62da5dd.md index 8a6a5754875..4a1bdf4ad0a 100644 --- a/curriculum/challenges/italian/blocks/lab-javascript-trivia-bot/66ed41f912d0bb1dc62da5dd.md +++ b/curriculum/challenges/italian/blocks/lab-javascript-trivia-bot/66ed41f912d0bb1dc62da5dd.md @@ -11,17 +11,17 @@ dashedName: lab-javascript-trivia-bot **Storie utente:** -1. Dovresti stampare `"Hello! I'm your coding fun fact guide!"` nella console come messaggio di saluto per l'utente. -1. Dovresti creare tre variabili: `botName`, `botLocation` e `favoriteLanguage`, che archiviano rispettivamente il nome del bot, da dove viene e il suo linguaggio di programmazione preferito. -1. Dovresti stampare `"My name is (botName) and I live on (botLocation)."` nella console. -1. Dovresti stampare `"My favorite programming language is (favoriteLanguage)."` nella console. -1. Dovresti usare `let` per creare una variabile `codingFact` e assegnarle una stringa che sia un fatto divertente sul linguaggio di programmazione preferito del tuo bot, includendo l'uso della variabile `favoriteLanguage`. -1. Dovresti stampare `codingFact` nella console. -1. Dovresti riassegnare la variabile `codingFact` a un nuovo fatto sul linguaggio preferito del bot usando di nuovo la variabile `favoriteLanguage`. -1. Dovresti stampare di nuovo `codingFact` nella console. -1. Dovresti riassegnare di nuovo la variabile `codingFact` a un altro nuovo fatto sul linguaggio preferito del bot usando la variabile `favoriteLanguage`. -1. Dovresti stampare per la terza volta `codingFact` nella console. -1. Dovresti stampare `"It was fun sharing these facts with you. Goodbye! - (botName) from (botLocation)."` nella console come messaggio di addio del bot. +1. Dovresti stampare nella console `"Hello! I'm your coding fun fact guide!"` come messaggio di benvenuto per l'utente. +1. Dovresti creare tre variabili: `botName`, `botLocation` e `favoriteLanguage`, che archiviano rispettivamente il nome del bot, il luogo da cui proviene e il suo linguaggio di programmazione preferito. +1. Dovresti stampare nella console `"My name is (botName) and I live on (botLocation)."`. +1. Dovresti stampare nella console `"My favorite programming language is (favoriteLanguage)."`. +1. Dovresti usare `let` per creare una variabile `codingFact` e assegnarle una stringa che sia un fatto divertente sul linguaggio di programmazione preferito del bot, usando la variabile `favoriteLanguage`. +1. Dovresti stampare nella console il valore di `codingFact`. +1. Dovresti riassegnare la variabile `codingFact` a un nuovo fatto sul linguaggio di programmazione preferito del bot usando di nuovo la variabile `favoriteLanguage`. +1. Dovresti stampare di nuovo nella console il valore di `codingFact`. +1. Dovresti riassegnare la variabile `codingFact` a un terzo fatto sul linguaggio di programmazione preferito del bot usando ancora la variabile `favoriteLanguage`. +1. Dovresti stampare per la terza volta nella console il valore di `codingFact`. +1. Dovresti stampare nella console `"It was fun sharing these facts with you. Goodbye! - (botName) from (botLocation)."` come messaggio di saluto dal bot. # --before-each-- @@ -162,7 +162,7 @@ let codingFact = "Did you know that " + favoriteLanguage + " was created in just console.log(codingFact); -codingFact = "Another fun fact: " + favoriteLanguage + "was originally called Mocha!"; +codingFact = "Another fun fact: " + favoriteLanguage + " was originally called Mocha!"; console.log(codingFact); diff --git a/curriculum/challenges/italian/blocks/lab-mood-board/673b3d6b7ef7318eef926d5a.md b/curriculum/challenges/italian/blocks/lab-mood-board/673b3d6b7ef7318eef926d5a.md index 31a737bd88c..71e50a448d8 100644 --- a/curriculum/challenges/italian/blocks/lab-mood-board/673b3d6b7ef7318eef926d5a.md +++ b/curriculum/challenges/italian/blocks/lab-mood-board/673b3d6b7ef7318eef926d5a.md @@ -17,15 +17,15 @@ In questo laboratorio, creerai una mood board usando componenti React riutilizza **Storie utente:** 1. Dovresti creare ed esportare un componente `MoodBoardItem` che accetta tre props: `color`, `image` e `description`. -2. Il tuo componente `MoodBoardItem` dovrebbe restituire un `div` con la classe `mood-board-item` come elemento di livello superiore. -3. Dovresti impostare il colore di sfondo dell’elemento `.mood-board-item` al valore della prop `color` usando stili in linea. -4. Dovresti renderizzare un elemento `img`, con classe `mood-board-image` e il suo attributo `src` impostato al valore della prop `image`, all’interno dell’elemento `.mood-board-item`. -5. Dovresti renderizzare un elemento `h3`, con classe `mood-board-text` e il suo testo impostato al valore della prop `description`, all’interno dell’elemento `.mood-board-item`. -6. Dovresti creare ed esportare un `MoodBoard`. +2. Il tuo componente `MoodBoardItem` dovrebbe restituire un `div` con una classe `mood-board-item` come elemento di livello superiore. +3. Dovresti impostare il colore di sfondo dell'elemento `.mood-board-item` al valore della prop `color` usando stili in linea. +4. Dovresti renderizzare un elemento `img`, con una classe `mood-board-image` e il suo attributo `src` impostato al valore della prop `image`, all'interno dell'elemento `.mood-board-item`. +5. Dovresti renderizzare un elemento `h3`, con una classe `mood-board-text` e il suo testo impostato al valore della prop `description`, all'interno dell'elemento `.mood-board-item`. +6. Dovresti creare ed esportare un componente `MoodBoard`. 7. Il tuo componente `MoodBoard` dovrebbe restituire un `div` come elemento di livello superiore. -8. Il tuo componente `MoodBoard` dovrebbe renderizzare un elemento `h1` con classe `mood-board-heading` e il testo `Destination Mood Board`. -9. Il tuo componente `MoodBoard` dovrebbe renderizzare un `div` con classe `mood-board`. -10. Il tuo componente `MoodBoard` dovrebbe renderizzare almeno tre componenti `MoodBoardItem` all’interno dell’elemento `.mood-board`, ognuno dovrebbe passare le props `color`, `image` e `description` con valori validi. +8. Il tuo componente `MoodBoard` dovrebbe renderizzare un elemento `h1` con una classe `mood-board-heading` e il testo `Destination Mood Board`. +9. Il tuo componente `MoodBoard` dovrebbe renderizzare un `div` con una classe `mood-board`. +10. Il tuo componente `MoodBoard` dovrebbe renderizzare almeno tre componenti `MoodBoardItem` all'interno dell'elemento `.mood-board`, ognuno dei quali deve passare props `color`, `image` e `description` con valori validi. Puoi usare le seguenti immagini nella tua mood board se vuoi: @@ -41,10 +41,10 @@ Puoi usare le seguenti immagini nella tua mood board se vuoi: Dovresti esportare un componente `MoodBoardItem`. ```js -assert.isFunction(window.index.MoodBoardItem, 1); +assert.isFunction(window.index.MoodBoardItem); ``` -Il tuo componente `MoodBoardItem` dovrebbe restituire un `div` con classe `mood-board-item` come elemento di livello superiore. +Il tuo componente `MoodBoardItem` dovrebbe restituire un `div` con una classe `mood-board-item` come elemento di livello superiore. ```js const item = document.getElementsByClassName('mood-board-item')[0]; @@ -52,7 +52,7 @@ assert.exists(item); assert.equal(item.tagName, 'DIV'); ``` -Il colore di sfondo dell’elemento `.mood-board-item` dovrebbe essere impostato al valore della prop `color` usando stili in linea. +Il colore di sfondo dell'elemento `.mood-board-item` dovrebbe essere impostato al valore della prop `color` usando stili in linea. ```js const container = await __helpers.prepTestComponent(window.index.MoodBoardItem, { color: "red" }); @@ -83,7 +83,7 @@ Il tuo componente `MoodBoardItem` dovrebbe renderizzare un elemento `h3` con cla Dovresti esportare un componente `MoodBoard`. ```js -assert.isFunction(window.index.MoodBoard, 1); +assert.isFunction(window.index.MoodBoard); ``` Il tuo componente `MoodBoard` dovrebbe restituire un `div` come elemento di livello superiore. @@ -102,7 +102,15 @@ assert.equal(heading.tagName, 'H1'); assert.equal(heading.textContent, 'Destination Mood Board'); ``` -Il tuo componente `MoodBoard` dovrebbe renderizzare almeno tre componenti `MoodBoardItem`, ognuno dovrebbe passare le props `color`, `image` e `description` con valori validi. +Il tuo componente `MoodBoard` dovrebbe renderizzare un `div` con una classe `mood-board`. + +```js +const moodboard = document.getElementsByClassName('mood-board')[0]; +assert.exists(moodboard); +assert.equal(moodboard.tagName, 'DIV'); +``` + +Il tuo componente `MoodBoard` dovrebbe renderizzare almeno tre componenti `MoodBoardItem` all'interno dell'elemento `.mood-board`, ognuno dei quali deve passare props `color`, `image` e `description` con valori validi. ```js const moodboard = document.getElementsByClassName('mood-board')[0]; diff --git a/curriculum/challenges/italian/blocks/lab-motorcycle-shop/694175528a794a090ea0ba74.md b/curriculum/challenges/italian/blocks/lab-motorcycle-shop/694175528a794a090ea0ba74.md index 2b0b58ccb10..928a4eb847b 100644 --- a/curriculum/challenges/italian/blocks/lab-motorcycle-shop/694175528a794a090ea0ba74.md +++ b/curriculum/challenges/italian/blocks/lab-motorcycle-shop/694175528a794a090ea0ba74.md @@ -35,6 +35,291 @@ Per questo laboratorio, ti sono stati forniti tutto l'HTML e il CSS. Userai Type 7. Il numero di elementi `Motorcycle` visualizzati dovrebbe essere elencato all'interno di un elemento con id `results-number`. 8. Il filtro dovrebbe essere aggiornato su un evento `input`. +# --before-all-- + +```js +const _testMotorcycles = [ + { + id: '1', + name: 'Ninja H2', + manufacturer: 'Kawasaki', + category: 'Sport', + price: 29000, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-vmoto-stash.jpg', + description: 'Supercharged hypersport with unmatched power', + year: 2024, + created_at: '2024-01-01T00:00:00Z' + }, + { + id: '2', + name: 'Street Triple RS', + manufacturer: 'Triumph', + category: 'Naked', + price: 13500, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-r3.png', + description: 'Agile naked bike with triple-cylinder perfection', + year: 2024, + created_at: '2024-01-02T00:00:00Z' + }, + { + id: '3', + name: 'R1250 GS Adventure', + manufacturer: 'BMW', + category: 'Adventure', + price: 21995, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-vmoto-stash.jpg', + description: 'The ultimate adventure touring machine', + year: 2024, + created_at: '2024-01-03T00:00:00Z' + }, + { + id: '4', + name: 'Panigale V4', + manufacturer: 'Ducati', + category: 'Sport', + price: 28395, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-kawasaki-zx10r.png', + description: 'Italian superbike engineering at its finest', + year: 2024, + created_at: '2024-01-04T00:00:00Z' + }, + { + id: '5', + name: 'Road Glide Special', + manufacturer: 'Harley-Davidson', + category: 'Cruiser', + price: 29999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-vmax.jpg', + description: 'Classic American touring with modern tech', + year: 2024, + created_at: '2024-01-05T00:00:00Z' + }, + { + id: '6', + name: 'MT-09', + manufacturer: 'Yamaha', + category: 'Naked', + price: 9999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-mt7.jpg', + description: 'Lightweight naked bike with crossplane power', + year: 2024, + created_at: '2024-01-06T00:00:00Z' + }, + { + id: '7', + name: 'Africa Twin', + manufacturer: 'Honda', + category: 'Adventure', + price: 14599, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-honda-africa.jpg', + description: 'Legendary adventure bike reborn for modern times', + year: 2024, + created_at: '2024-01-07T00:00:00Z' + }, + { + id: '8', + name: 'Super Duke R', + manufacturer: 'KTM', + category: 'Naked', + price: 18999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-suzuki-sv650.jpg', + description: 'The Beast returns with 180hp of raw power', + year: 2024, + created_at: '2024-01-08T00:00:00Z' + }, + { + id: '9', + name: 'GSX-R1000R', + manufacturer: 'Suzuki', + category: 'Sport', + price: 17199, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-suzuki-gsxr1000.jpg', + description: 'Track-ready sportbike with championship DNA', + year: 2024, + created_at: '2024-01-09T00:00:00Z' + }, + { + id: '10', + name: 'Street Glide', + manufacturer: 'Harley-Davidson', + category: 'Cruiser', + price: 21999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-vmax.jpg', + description: 'Milwaukee-Eight power in a sleek bagger', + year: 2024, + created_at: '2024-01-10T00:00:00Z' + }, + { + id: '11', + name: 'Z H2', + manufacturer: 'Kawasaki', + category: 'Naked', + price: 17000, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-kawasaki-zh2.jpg', + description: 'Supercharged naked bike mayhem', + year: 2024, + created_at: '2024-01-11T00:00:00Z' + }, + { + id: '12', + name: 'Multistrada V4', + manufacturer: 'Ducati', + category: 'Adventure', + price: 22995, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-mt3.jpg', + description: 'Italian style meets adventure capability', + year: 2024, + created_at: '2024-01-12T00:00:00Z' + }, + { + id: '13', + name: 'Speed Triple 1200', + manufacturer: 'Triumph', + category: 'Naked', + price: 16500, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-honda-transalp.jpg', + description: 'British muscle bike with cutting-edge tech', + year: 2024, + created_at: '2024-01-13T00:00:00Z' + }, + { + id: '14', + name: 'S1000RR', + manufacturer: 'BMW', + category: 'Sport', + price: 17295, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-kawasaki-z900a1.jpg', + description: 'German precision in a superbike package', + year: 2024, + created_at: '2024-01-14T00:00:00Z' + }, + { + id: '15', + name: 'MT-07', + manufacturer: 'Yamaha', + category: 'Naked', + price: 7999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-mt7.jpg', + description: 'Best-selling parallel twin for pure fun', + year: 2024, + created_at: '2024-01-15T00:00:00Z' + }, + { + id: '16', + name: 'V-Strom 1050', + manufacturer: 'Suzuki', + category: 'Adventure', + price: 13799, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-benelli-trk702.png', + description: 'Reliable adventure touring on a budget', + year: 2024, + created_at: '2024-01-16T00:00:00Z' + }, + { + id: '17', + name: 'Sportster S', + manufacturer: 'Harley-Davidson', + category: 'Cruiser', + price: 15999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-r3.png', + description: 'Revolution Max engine in a modern cruiser', + year: 2024, + created_at: '2024-01-17T00:00:00Z' + }, + { + id: '18', + name: 'CBR1000RR-R', + manufacturer: 'Honda', + category: 'Sport', + price: 28500, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-honda-cbr500.png', + description: 'Honda racing technology for the street', + year: 2024, + created_at: '2024-01-18T00:00:00Z' + }, + { + id: '19', + name: 'Tiger 900', + manufacturer: 'Triumph', + category: 'Adventure', + price: 14400, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-triumph-tiger900.png', + description: 'Middleweight adventure excellence', + year: 2024, + created_at: '2024-01-19T00:00:00Z' + }, + { + id: '20', + name: '890 Duke R', + manufacturer: 'KTM', + category: 'Naked', + price: 11999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-kawasaki-zx10r.png', + description: 'The Scalpel - precise handling perfection', + year: 2024, + created_at: '2024-01-20T00:00:00Z' + }, + { + id: '21', + name: 'Ninja 400', + manufacturer: 'Kawasaki', + category: 'Sport', + price: 5299, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-vmoto-stash.jpg', + description: 'Perfect entry-level sportbike', + year: 2024, + created_at: '2024-01-21T00:00:00Z' + }, + { + id: '22', + name: 'Scrambler 1200', + manufacturer: 'Triumph', + category: 'Adventure', + price: 13250, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-ducati-scrambler.jpg', + description: 'Modern classic with off-road capability', + year: 2024, + created_at: '2024-01-22T00:00:00Z' + }, + { + id: '23', + name: 'Monster Plus', + manufacturer: 'Ducati', + category: 'Naked', + price: 14295, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-kawasaki-zx10r.png', + description: 'Evolved Monster with V-twin soul', + year: 2024, + created_at: '2024-01-23T00:00:00Z' + }, + { + id: '24', + name: 'CB650R', + manufacturer: 'Honda', + category: 'Naked', + price: 9199, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-kawasaki-z900.png', + description: 'Neo Sports Café styling with inline-four power', + year: 2024, + created_at: '2024-01-24T00:00:00Z' + }, + { + id: '25', + name: 'Low Rider S', + manufacturer: 'Harley-Davidson', + category: 'Cruiser', + price: 17999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-suzuki-vstorm650.jpg', + description: 'Blacked-out cruiser with attitude', + year: 2024, + created_at: '2024-01-25T00:00:00Z' + } +]; + +window.fetch = () => + Promise.resolve({ json: () => Promise.resolve(_testMotorcycles) }); +``` + # --hints-- Dovresti avere un `type` chiamato `Category`. @@ -84,16 +369,24 @@ Dovresti usare l'endpoint `https://cdn.freecodecamp.org/curriculum/labs/data/mot ```js const spy = __helpers.spyOn(window, 'fetch'); -const motorcycles = await fetchMotorcycles(); -assert.strictEqual(spy.calls[0][0].trim(),"https://cdn.freecodecamp.org/curriculum/labs/data/motorcycles.json"); +try { + await fetchMotorcycles(); + assert.strictEqual(spy.calls[0][0].trim(),"https://cdn.freecodecamp.org/curriculum/labs/data/motorcycles.json"); +} finally { + spy.restore(); +} ``` Dovresti restituire una promise di 25 oggetti `Motorcycle` da `fetchMotorcycles`. ```js const spy = __helpers.spyOn(window, 'fetch'); -const motorcycles = await fetchMotorcycles(); -assert.lengthOf(motorcycles,25); +try { + const motorcycles = await fetchMotorcycles(); + assert.lengthOf(motorcycles,25); +} finally { + spy.restore(); +} ``` Dovresti avere una funzione chiamata `renderMotorcycleCard`. diff --git a/curriculum/challenges/italian/blocks/lab-nth-fibonacci-number-js/7a97b79c096ecb000d03bd36.md b/curriculum/challenges/italian/blocks/lab-nth-fibonacci-number-js/7a97b79c096ecb000d03bd36.md index 2fc44124d89..7ec6d8ea2a8 100644 --- a/curriculum/challenges/italian/blocks/lab-nth-fibonacci-number-js/7a97b79c096ecb000d03bd36.md +++ b/curriculum/challenges/italian/blocks/lab-nth-fibonacci-number-js/7a97b79c096ecb000d03bd36.md @@ -7,7 +7,7 @@ dashedName: build-an-nth-fibonacci-number-calculator # --description-- -**Obiettivo:** Soddisfa le storie utente qui sotto e fai superare tutti i test per completare il laboratorio. +**Obiettivo:** Completa le storie utente qui sotto e fai passare tutti i test per completare il laboratorio. **Storie utente:** @@ -22,20 +22,25 @@ dashedName: build-an-nth-fibonacci-number-calculator Dovresti avere una funzione chiamata `fibonacci`. ```js -assert.isFunction(fibonacci); +const explorer = await __helpers.Explorer(code); +assert.exists(explorer.allFunctions.fibonacci); ``` La tua funzione `fibonacci` dovrebbe prendere un solo parametro. ```js -const params = __helpers.getFunctionParams(fibonacci.toString()); -assert.equal(params.length, 1); +const explorer = await __helpers.Explorer(code); +const { fibonacci } = explorer.allFunctions; +assert.equal(fibonacci?.parameters.length, 1); ``` Dovresti avere un array chiamato `sequence` all'interno della funzione `fibonacci` inizializzato a `[0, 1]`. ```js -assert.match(__helpers.removeJSComments(fibonacci.toString()), /(const|let|var)\s+sequence\s*=\s*\[\s*0\s*,\s*1\s*\]/); +const explorer = await __helpers.Explorer(code); +const { fibonacci } = explorer.allFunctions; +const { sequence } = fibonacci?.variables ?? {}; +assert.isTrue(sequence?.value.matches('[0, 1]')); ``` `fibonacci(0)` dovrebbe restituire `0`. diff --git a/curriculum/challenges/italian/blocks/lab-product-showcase/696920c0c98a1ed58eb86293.md b/curriculum/challenges/italian/blocks/lab-product-showcase/696920c0c98a1ed58eb86293.md index c0a65804dfe..115a169cdcc 100644 --- a/curriculum/challenges/italian/blocks/lab-product-showcase/696920c0c98a1ed58eb86293.md +++ b/curriculum/challenges/italian/blocks/lab-product-showcase/696920c0c98a1ed58eb86293.md @@ -421,6 +421,10 @@ Cliccando il pulsante `#all` dovrebbero essere mostrati tutti i prodotti nell'el ```js const len = products.items.length; +const books = document.getElementById("books"); +const all = document.getElementById("all"); +const output = document.getElementById("output"); + assert.isAtLeast(len, 3); books.dispatchEvent(new Event("click", { bubbles: true })); all.dispatchEvent(new Event("click", { bubbles: true })); @@ -430,7 +434,11 @@ assert.lengthOf(output.querySelectorAll(".item"), len); Cliccando il pulsante `#books` dovrebbe essere mostrato l'insieme corrispondente di prodotti nell'elemento `#output`. ```js +const books = document.getElementById("books"); +const clothing = document.getElementById("clothing"); +const output = document.getElementById("output"); const len = products.items.length; + assert.isAtLeast(len, 3); let count = 0; products.items.forEach(i => { @@ -446,7 +454,11 @@ assert.lengthOf(output.querySelectorAll(".item"), count); Cliccando il pulsante `#electronics` dovrebbe essere mostrato l'insieme corrispondente di prodotti nell'elemento `#output`. ```js +const electronics = document.getElementById("electronics"); +const clothing = document.getElementById("clothing"); +const output = document.getElementById("output"); const len = products.items.length; + assert.isAtLeast(len, 3); let count = 0; products.items.forEach(i => { @@ -462,7 +474,11 @@ assert.lengthOf(output.querySelectorAll(".item"), count); Cliccando il pulsante `#clothing` dovrebbe essere mostrato l'insieme corrispondente di prodotti nell'elemento `#output`. ```js +const books = document.getElementById("books"); +const clothing = document.getElementById("clothing"); +const output = document.getElementById("output"); const len = products.items.length; + assert.isAtLeast(len, 3); let count = 0; products.items.forEach(i => { @@ -478,6 +494,7 @@ assert.lengthOf(output.querySelectorAll(".item"), count); Tutti i prodotti dovrebbero essere visibili per impostazione predefinita al caricamento della pagina. Usa l'evento `DOMContentLoaded` per assicurartene. ```js +const output = document.getElementById("output"); const len = products.items.length; assert.isAtLeast(len, 3); document.dispatchEvent(new Event("DOMContentLoaded")); diff --git a/curriculum/challenges/italian/blocks/lab-reusable-footer/673b02b03134b04637bf7055.md b/curriculum/challenges/italian/blocks/lab-reusable-footer/673b02b03134b04637bf7055.md index a53ee791f9b..877b603f096 100644 --- a/curriculum/challenges/italian/blocks/lab-reusable-footer/673b02b03134b04637bf7055.md +++ b/curriculum/challenges/italian/blocks/lab-reusable-footer/673b02b03134b04637bf7055.md @@ -16,7 +16,7 @@ demoType: onClick 2. Il tuo componente `Footer` dovrebbe restituire un elemento `footer` che contiene tutti gli altri elementi. 3. Il tuo elemento `footer` dovrebbe avere: - - Almeno tre liste non ordinate, ciascuna con almeno due elementi di lista. +- Almeno tre liste non ordinate, ciascuna con almeno due elementi di lista. - Almeno un elemento paragrafo con un simbolo di copyright `©`. - Almeno tre collegamenti con il valore `href` impostato su `#` e il contenuto del collegamento impostato su un’icona o testo a tua scelta. @@ -53,7 +53,7 @@ Il tuo elemento `footer` dovrebbe contenere almeno tre liste non ordinate. assert.isAtLeast(document.querySelectorAll('ul').length, 3); ``` -Ognuna delle tue liste non ordinate dovrebbe avere almeno due elementi di lista. +Le tue liste non ordinate dovrebbero avere ciascuna almeno due elementi. ```js const uls = [...document.querySelectorAll('ul')]; @@ -84,7 +84,7 @@ const links = document.querySelectorAll('a[href="#"]'); assert.isAtLeast(links.length, 3); ``` -Nessuno dei tuoi collegamenti dovrebbe essere vuoto. +I tuoi collegamenti non dovrebbero essere vuoti. ```js const links = [...document.querySelectorAll('a[href="#"]')]; diff --git a/curriculum/challenges/italian/blocks/lab-sentence-maker/66c057041df6394ca796bf33.md b/curriculum/challenges/italian/blocks/lab-sentence-maker/66c057041df6394ca796bf33.md index cb4e6273733..49fffff2d47 100644 --- a/curriculum/challenges/italian/blocks/lab-sentence-maker/66c057041df6394ca796bf33.md +++ b/curriculum/challenges/italian/blocks/lab-sentence-maker/66c057041df6394ca796bf33.md @@ -1,13 +1,13 @@ --- id: 66c057041df6394ca796bf33 -title: crea un generatore di frasi +title: Crea un generatore di frasi challengeType: 26 dashedName: build-a-sentence-maker --- # --description-- -In questo laboratorio, creerai due storie diverse usando un modello di frase. Userai variabili per archiviare parti diverse della storia e poi stamperai le storie nella console. +In questo laboratorio, creerai due storie diverse usando un modello di frase. Userai variabili per archiviare le diverse parti della storia e poi stamperai le storie nella console. **Obiettivo:** Completa le storie utente qui sotto e fai passare tutti i test per completare il laboratorio. @@ -26,7 +26,7 @@ In questo laboratorio, creerai due storie diverse usando un modello di frase. Us 1. Dovresti dichiarare una variabile `firstStory`. -1. Dovresti usare il seguente modello di storia per creare la prima storia e assegnarla alla variabile `firstStory`: `"Once upon a time, there was a(n) [adjective] [noun] who loved to eat [noun2]. The [noun] lived in a [place] and had [adjective2] nostrils that blew fire when it was [verb]."`; +1. Dovresti usare il seguente modello di storia per creare la prima storia e assegnarla alla variabile `firstStory`: `"Once upon a time, there was a(n) [adjective] [noun] who loved to eat [noun2]. The [noun] lived in a [place] and had [adjective2] nostrils that blew fire when it was [verb]."` 1. Dovresti stampare la tua prima storia nella console usando il messaggio `"First story: [firstStory]"`. @@ -34,11 +34,18 @@ In questo laboratorio, creerai due storie diverse usando un modello di frase. Us 1. Dovresti dichiarare una variabile `secondStory`. -1. Crea un’altra storia usando lo stesso modello e assegnala alla variabile `secondStory`. +1. Dovresti creare un'altra storia usando lo stesso modello e assegnarla alla variabile `secondStory`. 1. Dovresti stampare la tua seconda storia nella console usando il messaggio `"Second story: [secondStory]"`. +# --before-each-- + +```js +const spy = __helpers.spyOn(console, 'log'); +const getLogs = () => spy.calls.map(call => call.join(' ')); +``` + # --hints-- Dovresti dichiarare una variabile `adjective`. @@ -142,12 +149,10 @@ assert.match( ); ``` -Dovresti stampare la tua prima storia usando il messaggio `"First story: [firstStory]"`. +Dovresti stampare la tua prima storia nella console usando il messaggio `"First story: [firstStory]"`. ```js -const condition1 = /console\.log\(\s*["']First\s+story:\s+["']\s*\+\s*firstStory\s*\);?/gm.test(code); -const condition2 = /console\.log\(\s*`First\s+story:\s+\$\{firstStory\}`\s*\);?/gm.test(code); -assert.isTrue(condition1 || condition2); +assert.include(getLogs(), `First story: ${firstStory}`); ``` Dovresti dichiarare una variabile `secondStory`. @@ -208,15 +213,13 @@ assert.match( ); ``` -Dovresti stampare la tua seconda storia usando il formato `"Second story: [secondStory]"`. +Dovresti stampare la tua seconda storia nella console usando il messaggio `"Second story: [secondStory]"`. ```js -const condition1 = /console\.log\(\s*["']Second\s+story:\s+["']\s*\+\s*secondStory\s*\);?/gm.test(code); -const condition2 = /console\.log\(\s*`Second\s+story:\s+\$\{secondStory\}`\s*\);?/gm.test(code); -assert.isTrue(condition1 || condition2); +assert.include(getLogs(), `Second story: ${secondStory}`); ``` -La `firstStory` non dovrebbe essere uguale alla `secondStory`. +La tua `firstStory` non dovrebbe essere uguale alla tua `secondStory`. ```js assert.notEqual(firstStory, secondStory); @@ -255,3 +258,4 @@ const secondStory = `Once upon a time, there was a(n) ${adjective} ${noun} who l console.log("Second story: " + secondStory); ``` + diff --git a/curriculum/challenges/italian/blocks/lab-weather-app/66f12a88741aeb16b9246c59.md b/curriculum/challenges/italian/blocks/lab-weather-app/66f12a88741aeb16b9246c59.md index 8eadccd5ab9..000c79a1077 100644 --- a/curriculum/challenges/italian/blocks/lab-weather-app/66f12a88741aeb16b9246c59.md +++ b/curriculum/challenges/italian/blocks/lab-weather-app/66f12a88741aeb16b9246c59.md @@ -333,7 +333,7 @@ assert.strictEqual( ); ``` -All'interno dell'elemento `select` dovrebbero esserci 6 elementi `option`, uno per ciascuna delle seguenti città: Parigi, Londra, Tokyo, Los Angeles, Chicago, New York. +Oltre alla prima opzione vuota, l'elemento `select` dovrebbe contenere 6 elementi `option`, uno per ciascuna delle seguenti città: Parigi, Londra, Tokyo, Los Angeles, Chicago, New York. ```js ['Paris', 'London', 'Tokyo', 'Los Angeles', 'Chicago', 'New York'].forEach( @@ -342,7 +342,7 @@ All'interno dell'elemento `select` dovrebbero esserci 6 elementi `option`, uno p `select > option[value="${city.toLowerCase()}"]` ); assert.exists(el); - assert.strictEqual(el.innerText.trim(), city); + assert.strictEqual(el.textContent.trim(), city); } ); ``` diff --git a/curriculum/challenges/italian/blocks/learn-about-speculation-and-requests/67eff6af42e8c425d9ff28e3.md b/curriculum/challenges/italian/blocks/learn-about-speculation-and-requests/67eff6af42e8c425d9ff28e3.md index 6f2b4c0714b..9504080047c 100644 --- a/curriculum/challenges/italian/blocks/learn-about-speculation-and-requests/67eff6af42e8c425d9ff28e3.md +++ b/curriculum/challenges/italian/blocks/learn-about-speculation-and-requests/67eff6af42e8c425d9ff28e3.md @@ -10,7 +10,7 @@ lang: en-US # --instructions-- -Ascolta l’audio e completa la frase qui sotto. +Ascolta l'audio e completa la frase qui sotto. # --fillInTheBlank-- @@ -32,7 +32,7 @@ Questa frase di tre parole si riferisce alla versione più recente o aggiornata - `Your software is up to date.` - Il software ha tutti gli ultimi aggiornamenti. -- `Is your resume up to date?` - Stanno chiedendo se il curriculum include l’esperienza più recente di questa persona. +- `Is your resume up to date?` - Chiedono se il curriculum include l'esperienza più recente di questa persona. # --scene-- diff --git a/curriculum/challenges/italian/blocks/learn-basic-css-by-building-a-cafe-menu/5f3ef6e03d719d5ac4738993.md b/curriculum/challenges/italian/blocks/learn-basic-css-by-building-a-cafe-menu/5f3ef6e03d719d5ac4738993.md index 538ac08ffed..54231867706 100644 --- a/curriculum/challenges/italian/blocks/learn-basic-css-by-building-a-cafe-menu/5f3ef6e03d719d5ac4738993.md +++ b/curriculum/challenges/italian/blocks/learn-basic-css-by-building-a-cafe-menu/5f3ef6e03d719d5ac4738993.md @@ -7,9 +7,9 @@ dashedName: step-56 # --description-- -La larghezza attuale del menu occuperà sempre l'80% della larghezza dell'elemento `body`. Su uno schermo molto ampio, il caffè e il dessert appaiono molto distanti dai loro prezzi. +La larghezza attuale del menu occuperà sempre l'`80%` della larghezza dell'elemento `body`. Su uno schermo molto ampio, i caffè e i dolci appaiono molto distanti dai loro prezzi. -Aggiungi una proprietà `max-width` alla classe `menu` con un valore `500px` per evitare che diventi troppo larga. +Aggiungi una proprietà `max-width` alla classe `menu` con un valore `500px` per evitare che si allarghi troppo. # --hints-- @@ -117,3 +117,4 @@ h1, h2, p { width: 25%; } ``` + diff --git a/curriculum/challenges/italian/blocks/learn-how-to-plan-future-events/67531709d628ef047202e6ae.md b/curriculum/challenges/italian/blocks/learn-how-to-plan-future-events/67531709d628ef047202e6ae.md index 837100eba48..06ab996142c 100644 --- a/curriculum/challenges/italian/blocks/learn-how-to-plan-future-events/67531709d628ef047202e6ae.md +++ b/curriculum/challenges/italian/blocks/learn-how-to-plan-future-events/67531709d628ef047202e6ae.md @@ -12,7 +12,7 @@ Guarda il video qui sotto per capire il contesto delle prossime lezioni. # --assignment-- -Guarda il video.. +Guarda il video. # --scene-- diff --git a/curriculum/challenges/italian/blocks/learn-present-perfect-while-talking-about-accessibility/671b98e9b7c4854e93044e64.md b/curriculum/challenges/italian/blocks/learn-present-perfect-while-talking-about-accessibility/671b98e9b7c4854e93044e64.md index 6963a30ee3c..ce7d04af142 100644 --- a/curriculum/challenges/italian/blocks/learn-present-perfect-while-talking-about-accessibility/671b98e9b7c4854e93044e64.md +++ b/curriculum/challenges/italian/blocks/learn-present-perfect-while-talking-about-accessibility/671b98e9b7c4854e93044e64.md @@ -62,7 +62,7 @@ Guarda il video. "startTime": 5.34, "finishTime": 9.26, "dialogue": { - "text": "Yes, for some reason it hasn't been displaying correctly for some users.", + "text": "Yes. For some reason, it hasn't been displaying correctly for some users.", "align": "right" } }, diff --git a/curriculum/challenges/italian/blocks/learn-present-perfect-while-talking-about-accessibility/671f403c1d4e8a5e046065a0.md b/curriculum/challenges/italian/blocks/learn-present-perfect-while-talking-about-accessibility/671f403c1d4e8a5e046065a0.md index 7d3817ca523..fc2ce9ed786 100644 --- a/curriculum/challenges/italian/blocks/learn-present-perfect-while-talking-about-accessibility/671f403c1d4e8a5e046065a0.md +++ b/curriculum/challenges/italian/blocks/learn-present-perfect-while-talking-about-accessibility/671f403c1d4e8a5e046065a0.md @@ -6,7 +6,7 @@ dashedName: task-36 lang: en-US --- -<!-- (Audio) James: Yes. For some reason, It hasn't been displaying correctly for some users. --> +<!-- (Audio) James: Yes. For some reason, it hasn't been displaying correctly for some users. --> # --instructions-- @@ -16,7 +16,7 @@ Ascolta l'audio e completa la frase qui sotto. ## --sentence-- -`Yes. For some reason, It BLANK BLANK BLANK correctly for some users.` +`Yes. For some reason, it BLANK BLANK BLANK correctly for some users.` ## --blanks-- @@ -83,7 +83,7 @@ La frase è nella forma negativa del tempo `Present Perfect Continuous`, costrui "startTime": 1, "finishTime": 4.92, "dialogue": { - "text": "Yes, for some reason it hasn't been displaying correctly for some users.", + "text": "Yes. For some reason, it hasn't been displaying correctly for some users.", "align": "center" } }, diff --git a/curriculum/challenges/italian/blocks/learn-present-perfect-while-talking-about-accessibility/671f456994635c6085054cbd.md b/curriculum/challenges/italian/blocks/learn-present-perfect-while-talking-about-accessibility/671f456994635c6085054cbd.md index 49a0bb3154b..54cbe3a875f 100644 --- a/curriculum/challenges/italian/blocks/learn-present-perfect-while-talking-about-accessibility/671f456994635c6085054cbd.md +++ b/curriculum/challenges/italian/blocks/learn-present-perfect-while-talking-about-accessibility/671f456994635c6085054cbd.md @@ -6,7 +6,7 @@ dashedName: task-37 lang: en-US --- -<!-- (Audio) James: Yes. For some reason, It hasn't been displaying correctly for some users. --> +<!-- (Audio) James: Yes. For some reason, it hasn't been displaying correctly for some users. --> # --instructions-- @@ -16,7 +16,7 @@ Ascolta l'audio e completa la frase qui sotto. ## --sentence-- -`Yes. For some reason, It hasn't been displaying BLANK for some BLANK.` +`Yes. For some reason, it hasn't been displaying BLANK for some BLANK.` ## --blanks-- @@ -79,7 +79,7 @@ Questo sostantivo al plurale si riferisce alle persone che interagiscono con un "startTime": 1, "finishTime": 4.92, "dialogue": { - "text": "Yes, for some reason it hasn't been displaying correctly for some users.", + "text": "Yes. For some reason, it hasn't been displaying correctly for some users.", "align": "center" } }, diff --git a/curriculum/challenges/italian/blocks/learn-present-perfect-while-talking-about-accessibility/6720cf38beae8c4f1d7af1c0.md b/curriculum/challenges/italian/blocks/learn-present-perfect-while-talking-about-accessibility/6720cf38beae8c4f1d7af1c0.md index d356407fd68..10398fe82c2 100644 --- a/curriculum/challenges/italian/blocks/learn-present-perfect-while-talking-about-accessibility/6720cf38beae8c4f1d7af1c0.md +++ b/curriculum/challenges/italian/blocks/learn-present-perfect-while-talking-about-accessibility/6720cf38beae8c4f1d7af1c0.md @@ -22,7 +22,7 @@ Scrivi le seguenti parole o frasi nel punto corretto: `rendering consistently`, `Alice: James, have you heard about the BLANK on our video platform?` -`James: Yes. For some reason, It hasn't been BLANK for some users. The captions are misaligned and BLANK, which isn't good for accessibility.` +`James: Yes. For some reason, it hasn't been BLANK for some users. The captions are misaligned and BLANK, which isn't good for accessibility.` `Alice: Exactly. Do you know if it's been affecting all the videos or just a few?` diff --git a/curriculum/challenges/italian/blocks/lecture-css-specificity-the-cascade-algorithm-and-inheritance/672aa62178d5ff57fe4f98e0.md b/curriculum/challenges/italian/blocks/lecture-css-specificity-the-cascade-algorithm-and-inheritance/672aa62178d5ff57fe4f98e0.md index ea962d412ce..0ef6af70f9a 100644 --- a/curriculum/challenges/italian/blocks/lecture-css-specificity-the-cascade-algorithm-and-inheritance/672aa62178d5ff57fe4f98e0.md +++ b/curriculum/challenges/italian/blocks/lecture-css-specificity-the-cascade-algorithm-and-inheritance/672aa62178d5ff57fe4f98e0.md @@ -43,14 +43,14 @@ Successivamente, i selettori ID hanno un alto livello di specificità. ```html <link rel="stylesheet" href="styles.css"> -<p id="para">Red paragraph</p> +<p id="para-1">Red paragraph</p> <p>Other paragraph</p> <p>Another paragraph</p> <p>Yet another paragraph</p> ``` ```css -#para { +#para-1 { color: red; } @@ -67,24 +67,33 @@ Gli esempi includono selettori di classe come `.container` e `.button`, selettor **NOTA**: Imparerai di più sulle pseudo-classi nelle lezioni future. -In questo esempio, il primo paragrafo sarà rosso perché un selettore ID ha una specificità più alta rispetto alle classi e ai selettori di tipo. Gli elementi `.example-para` avranno un colore verde mentre gli altri paragrafi avranno un colore blu. +In questo esempio: + +- Il primo paragrafo sarà rosso perché un selettore ID ha una specificità più alta rispetto alle classi e ai selettori di tipo. +- Il secondo paragrafo con un selettore di classe `.example-para` avrà un colore verde. +- Il terzo paragrafo con sia un selettore ID `#para-3` sia un selettore di classe `.example-para` avrà un colore viola. +- L'elemento paragrafo rimanente avrà un colore blu. :::interactive_editor ```html <link rel="stylesheet" href="styles.css"> -<p id="para">Example paragraph</p> +<p id="para-1">Example paragraph</p> <p class="example-para">Other paragraph</p> -<p class="example-para">Another paragraph</p> +<p id="para-3" class="example-para">Another paragraph</p> <p>Yet another paragraph</p> ``` ```css -#para { +#para-1 { color: red; } +#para-3 { + color: purple; +} + .example-para { color: green; } @@ -105,13 +114,13 @@ I selettori di tipo, come `div` e `h1`, e i pseudo-elementi come `::before` e `: ```html <link rel="stylesheet" href="styles.css"> -<p id="para">Example paragraph</p> +<p id="para-1">Example paragraph</p> <p>Other paragraph</p> <p>Yet another paragraph</p> ``` ```css -#para { +#para-1 { color: red; } @@ -130,7 +139,7 @@ Ecco un esempio di come impostare il colore di tutti gli elementi su rosso usand ```html <link rel="stylesheet" href="styles.css"> -<p id="para">Example paragraph</p> +<p id="para-1">Example paragraph</p> <p>Other paragraph</p> <p>Yet another paragraph</p> ``` @@ -140,7 +149,7 @@ Ecco un esempio di come impostare il colore di tutti gli elementi su rosso usand color: red; } -#para { +#para-1 { color: green; } diff --git a/curriculum/challenges/italian/blocks/lecture-express-middleware/69f42d414b7626e21a922794.md b/curriculum/challenges/italian/blocks/lecture-express-middleware/69f42d414b7626e21a922794.md index 2a63a1c74ae..b79201ad13e 100644 --- a/curriculum/challenges/italian/blocks/lecture-express-middleware/69f42d414b7626e21a922794.md +++ b/curriculum/challenges/italian/blocks/lecture-express-middleware/69f42d414b7626e21a922794.md @@ -9,9 +9,7 @@ dashedName: what-is-error-handling-middleware Il middleware per la gestione degli errori in Express è un tipo speciale di middleware usato per gestire gli errori che si verificano durante il ciclo richiesta-risposta. È fondamentale per intercettare errori imprevisti, registrarli e fornire risposte appropriate al client. -Come hai visto in una lezione precedente sulla gestione degli errori, il middleware di Express per la gestione degli errori ha quattro parametri: `err`, `req`, `res` e `next`. Questo middleware viene invocato quando un errore viene passato alla funzione `next()`. - -Ecco un promemoria della sintassi: +Il middleware di gestione degli errori in Express ha quattro parametri: `err`, `req`, `res` e `next`. Questo middleware viene invocato quando un errore viene passato alla funzione `next()`. Ecco la sintassi: ```js app.use((err, req, res, next) => { diff --git a/curriculum/challenges/italian/blocks/lecture-express-middleware/69f42d414b7626e21a922795.md b/curriculum/challenges/italian/blocks/lecture-express-middleware/69f42d414b7626e21a922795.md index 9914b6b2915..85467fbd84a 100644 --- a/curriculum/challenges/italian/blocks/lecture-express-middleware/69f42d414b7626e21a922795.md +++ b/curriculum/challenges/italian/blocks/lecture-express-middleware/69f42d414b7626e21a922795.md @@ -13,45 +13,45 @@ Express offre una serie di funzioni middleware integrate che aiutano a svolgere 1. `express.json()`: Un middleware integrato che analizza i payload JSON in arrivo. -```js -app.use(express.json()) -``` + ```js + app.use(express.json()) + ``` 1. `express.static()`: Un middleware per servire file statici come immagini, CSS e file JavaScript. -```js -app.use(express.static('public')) -``` + ```js + app.use(express.static('public')) + ``` 1. `express.urlencoded()`: Un middleware che analizza le richieste in arrivo con payload codificati in URL, il formato tipicamente inviato dai moduli HTML. Rende i dati analizzati disponibili su `req.body`. -```js -app.use(express.urlencoded({ extended: true })) -``` + ```js + app.use(express.urlencoded({ extended: true })) + ``` **Ora, ecco alcuni esempi di middleware di terze parti:** 1. `cors`: Un middleware di terze parti molto usato per abilitare il Cross-Origin Resource Sharing. -```bash -npm install cors -``` + ```bash + npm install cors + ``` -```js -const cors = require('cors') -app.use(cors()) -``` + ```js + const cors = require('cors') + app.use(cors()) + ``` 1. `morgan`: Un middleware per il logging delle richieste HTTP. -```bash -npm install morgan -``` + ```bash + npm install morgan + ``` -```js -const morgan = require('morgan') -app.use(morgan('tiny')) -``` + ```js + const morgan = require('morgan') + app.use(morgan('tiny')) + ``` Ora, vediamo un esempio di utilizzo sia di middleware integrato sia di terze parti: diff --git a/curriculum/challenges/italian/blocks/lecture-importance-of-semantic-html/672990ecf71a852804ababe7.md b/curriculum/challenges/italian/blocks/lecture-importance-of-semantic-html/672990ecf71a852804ababe7.md index e89db97ea4e..6cd6e4c798c 100644 --- a/curriculum/challenges/italian/blocks/lecture-importance-of-semantic-html/672990ecf71a852804ababe7.md +++ b/curriculum/challenges/italian/blocks/lecture-importance-of-semantic-html/672990ecf71a852804ababe7.md @@ -11,6 +11,10 @@ L'HTML presentazionale si concentra sull'aspetto e sullo stile del contenuto. Ne Molti elementi HTML presentazionali sono deprecati, cioè obsoleti e non più consigliati. Esistono modi migliori per ottenere gli stessi risultati. Tuttavia, è utile sapere che esistono, quindi vedremo alcuni esempi. +## Elementi HTML presentazionali + +### L'elemento `font` + L'elemento `font` è un elemento deprecato usato per definire la dimensione e il colore del carattere tipografico del testo. Ecco un esempio di un elemento `font`. Attiva l'editor interattivo e cambia la dimensione da 5 a 7 per vedere il carattere aumentare. @@ -27,6 +31,8 @@ Questo esempio imposta il colore del testo su `blue` e la dimensione su un valor Anche se questo elemento funziona ancora, non dovresti usarlo perché la dimensione e il colore del carattere tipografico dovrebbero sempre essere definiti con CSS, non in HTML. +### L'elemento `center` + L'elemento `center` è un altro elemento deprecato usato per centrare orizzontalmente il contenuto all'interno del suo contenitore. Ecco un esempio dell'elemento `center` che contiene testo e un elemento paragrafo. Attiva l'editor interattivo e aggiungi i tag `center` intorno a `<p>Another example text.</p>` per vederlo centrato nella pagina. @@ -44,6 +50,8 @@ Attiva l'editor interattivo e aggiungi i tag `center` intorno a `<p>Another exam ::: +### L'elemento `big` + E poi abbiamo l'elemento `big`. Questo è un altro elemento HTML presentazionale deprecato che rende il testo racchiuso un livello più grande rispetto al testo circostante. Qui abbiamo un esempio che definisce un paragrafo con due parti. Attiva l'editor interattivo e aggiungi i tag `big` intorno a `Some other text` e osserva i cambiamenti nella finestra di anteprima. @@ -64,6 +72,8 @@ Ricorda che la dimensione del carattere tipografico dovrebbe sempre essere defin Questi erano esempi di elementi HTML presentazionali. Ma tutti sono deprecati e non più consigliati. Quindi cosa dovresti usare invece? Vediamolo. +## HTML semantico + L'HTML semantico è ora la pratica consigliata. Descrive il contenuto degli elementi, quindi è molto più facile da leggere, comprendere e mantenere. I motori di ricerca possono facilmente comprendere il tuo sito web quando usi HTML semantico. È anche utile per l'accessibilità, perché i lettori di schermo hanno bisogno di informazioni semantiche per descrivere cosa c'è nella pagina web. @@ -75,6 +85,8 @@ Esempi di elementi HTML semantici includono: - L'elemento `section` per raggruppare informazioni correlate. - L'elemento `figure` per illustrazioni e diagrammi. +### Esempio di HTML semantico + Questo è un esempio di un elemento `header` che contiene un elemento sezione di navigazione. Attiva l'editor interattivo e aggiungi un `<a href="#">Products</a>` all'interno di `nav` e osserva i cambiamenti nella finestra di anteprima. @@ -97,6 +109,8 @@ Attiva l'editor interattivo e aggiungi un `<a href="#">Products</a>` all'interno Gli elementi semantici mostrano chiaramente il loro scopo all'interno della struttura HTML. Esistono molti diversi elementi HTML semantici. Troverai sicuramente uno che si adatta alle esigenze del tuo progetto. +## Riepilogo + Ottimo lavoro. Ora sai qual è la differenza tra HTML presentazionale e semantico: l'HTML semantico descrive il contenuto, mentre l'HTML presentazionale si concentra sull'aspetto. # --questions-- diff --git a/curriculum/challenges/italian/blocks/lecture-introduction-to-javascript-libraries-and-frameworks/6734e88cc46e6dc679420040.md b/curriculum/challenges/italian/blocks/lecture-introduction-to-javascript-libraries-and-frameworks/6734e88cc46e6dc679420040.md index e5b649040ba..39d21669097 100644 --- a/curriculum/challenges/italian/blocks/lecture-introduction-to-javascript-libraries-and-frameworks/6734e88cc46e6dc679420040.md +++ b/curriculum/challenges/italian/blocks/lecture-introduction-to-javascript-libraries-and-frameworks/6734e88cc46e6dc679420040.md @@ -13,7 +13,7 @@ Uno degli strumenti più popolari per impostare progetti è Vite. Vite, che in f Per creare un nuovo progetto con Vite, devi usare la riga di comando. Se usi un computer Windows, puoi usare il Prompt dei comandi o Windows PowerShell. Se usi un Mac, puoi usare l'app Terminale. -Se non hai Node.js installato, necessario per far funzionare npm, ecco un collegamento alla pagina ufficiale di Node.js: https://nodejs.org. Segui le istruzioni di installazione e poi torna qui per continuare con l'installazione di React. +Se non hai installato Node.js, necessario per far funzionare npm, ecco un collegamento alla pagina ufficiale di Node.js: [nodejs.org](https://nodejs.org). Segui le istruzioni per l'installazione, poi torna qui per continuare con l'installazione di React. Una volta aperta la riga di comando, puoi usare il seguente comando: @@ -36,7 +36,7 @@ npm install Il comando `cd my-react-app` serve per spostarti nella directory corretta dove si trova il tuo progetto. -Il comando `npm install` serve per installare le dipendenze necessarie a far funzionare correttamente il tuo progetto React. Le dipendenze sono librerie o pacchetti che il tuo progetto React richiede per funzionare, come React stesso, ReactDOM o altri pacchetti di terze parti che aggiungono funzionalità. +Il comando `npm install` serve per installare le dipendenze necessarie a far funzionare correttamente il tuo progetto React. Le dipendenze sono librerie o pacchetti che il tuo progetto React richiede per funzionare, come React stesso, `react-dom` o altri pacchetti di terze parti che offrono funzionalità aggiuntive. Eseguendo `npm install` verrà letto il file `package.json` nella directory del progetto e verranno installate tutte le dipendenze elencate, permettendoti di costruire e far girare la tua app React senza mancare nessun componente necessario. @@ -50,11 +50,11 @@ Per far partire il progetto, esegui il comando `npm run dev` e apri una nuova sc Dovresti vedere il template iniziale che Vite ha preparato per te. -Se devi fermare il server locale, premi `CTRL + C` nella riga di comando. +Se hai bisogno di fermare il server locale, premi `Ctrl + C` nella riga di comando. -Per vedere il codice di questo template iniziale, puoi entrare nella cartella `src` dentro il progetto e dovresti vedere il file `App.jsx`. +Per vedere effettivamente il codice di questo template iniziale, puoi aprire la cartella `src` all'interno del tuo progetto, dove dovresti trovare il file `App.jsx`. -Da lì puoi iniziare a modificare il file, salvare le modifiche e vedere i nuovi cambiamenti apparire nel browser. +Da lì puoi modificare il file, salvare le modifiche e vederle apparire nel browser. E con questo, sei pronto per iniziare a costruire la tua applicazione React! diff --git a/curriculum/challenges/italian/blocks/lecture-introduction-to-javascript/672d49959621885e9d3e672c.md b/curriculum/challenges/italian/blocks/lecture-introduction-to-javascript/672d49959621885e9d3e672c.md index efe46d230bf..353ede56557 100644 --- a/curriculum/challenges/italian/blocks/lecture-introduction-to-javascript/672d49959621885e9d3e672c.md +++ b/curriculum/challenges/italian/blocks/lecture-introduction-to-javascript/672d49959621885e9d3e672c.md @@ -72,6 +72,16 @@ console.log(age); // 25 ::: +Anche se una variabile dichiarata con `let` può essere riassegnata, non può essere ridefinita. Se provi a dichiarare di nuovo la stessa variabile usando `let`, otterrai un errore: + +```js +let age = 25; + +let age = 90; // SyntaxError: Identifier 'age' has already been declared +``` + +Lo stesso vale per `const`: una variabile dichiarata con `const` non può essere ridefinita. + Le variabili dichiarate con `const` devono avere un valore assegnato al momento della dichiarazione. Se provi a dichiarare una variabile `const` senza assegnarle un valore, otterrai un errore: ```js diff --git a/curriculum/challenges/italian/blocks/lecture-understanding-aria-expanded-aria-live-and-common-aria-states/672a54dff9dc439089f1a219.md b/curriculum/challenges/italian/blocks/lecture-understanding-aria-expanded-aria-live-and-common-aria-states/672a54dff9dc439089f1a219.md index a1b8ffa27ce..c83c2cbf7d8 100644 --- a/curriculum/challenges/italian/blocks/lecture-understanding-aria-expanded-aria-live-and-common-aria-states/672a54dff9dc439089f1a219.md +++ b/curriculum/challenges/italian/blocks/lecture-understanding-aria-expanded-aria-live-and-common-aria-states/672a54dff9dc439089f1a219.md @@ -15,6 +15,8 @@ Poiché il focus di lettura per i lettori di schermo può essere solo in un punt Ci sono tre valori possibili per questo attributo, basati sulla priorità dell’informazione. +## Il valore `assertive` + Se imposti `aria-live` al valore `assertive` significa che l’aggiornamento è molto importante. Ha la priorità più alta, quindi l’utente dovrebbe essere notificato immediatamente. Questo significa che il lettore di schermo interromperà qualsiasi annuncio stia facendo per annunciare il cambiamento di contenuto nella regione live. Tali interruzioni possono essere estremamente fastidiose, quindi il valore `assertive` dovrebbe essere usato solo per notifiche critiche o sensibili al tempo. @@ -81,6 +83,8 @@ document.addEventListener("DOMContentLoaded", () => { ::: +## Il valore `polite` + Il valore successivo in ordine di priorità è `polite`. Questo valore significa che l’aggiornamento non è urgente, quindi il lettore di schermo può aspettare che qualsiasi annuncio in corso sia terminato o che l’utente smetta di digitare prima di annunciare l’aggiornamento. La maggior parte delle regioni live userà il valore `polite`. @@ -147,10 +151,16 @@ document.addEventListener("DOMContentLoaded", () => { ::: +## Il valore `off` + Il valore di priorità più basso per `aria-live` è `off` che significa che l’aggiornamento non sarà annunciato a meno che il contenuto non sia in un elemento che ha attualmente il focus da tastiera. Realisticamente, questo valore è quasi mai usato perché il caso d’uso è molto ristretto e non è implementato in modo coerente (se non per niente) tra i lettori di schermo. Se hai bisogno di regioni live, pianifica di usare `polite` per tutto tranne che per messaggi critici che richiedono `assertive`. +## Regioni live predefinite dai ruoli ARIA + È anche importante notare che l’attributo `aria-live` non è richiesto se l’informazione aggiornata è contenuta in un elemento con un ruolo ARIA di `alert`, `log`, `marquee`, `status` o `timer`, poiché questi ruoli hanno già valori `aria-live` predefiniti. Ma il valore predefinito può essere cambiato impostando esplicitamente `aria-live` sull’elemento. +## Scegliere il valore giusto + Scegliere il valore `aria-live` giusto dipende dalla priorità dell’informazione aggiornata. Se gli aggiornamenti sono urgenti, dovresti notificare l’utente immediatamente con `assertive`. Ma dovresti usarlo solo se gli aggiornamenti sono davvero urgenti perché interruzioni improvvise possono potenzialmente disorientare gli utenti e influenzare l’esperienza d’uso. diff --git a/curriculum/challenges/italian/blocks/lecture-understanding-computer-internet-and-tooling-basics/672aa578a2129554d4675049.md b/curriculum/challenges/italian/blocks/lecture-understanding-computer-internet-and-tooling-basics/672aa578a2129554d4675049.md index 4e777f7c832..c1d0ab28f9a 100644 --- a/curriculum/challenges/italian/blocks/lecture-understanding-computer-internet-and-tooling-basics/672aa578a2129554d4675049.md +++ b/curriculum/challenges/italian/blocks/lecture-understanding-computer-internet-and-tooling-basics/672aa578a2129554d4675049.md @@ -11,13 +11,13 @@ I computer sono macchine molto potenti che svolgono una varietà di attività co Come sviluppatore, è importante comprendere il funzionamento interno di base di un computer. -Il primo componente principale di un computer è la scheda madre. La scheda madre contiene tutta la memoria e i connettori necessari per far funzionare il computer. Funziona come la scheda circuito principale del computer. +Il primo componente principale di un computer è la scheda madre. La scheda madre contiene tutta la memoria e i connettori necessari per far funzionare il computer. Serve come la scheda madre principale del computer. -All'interno del case del computer, sulla scheda madre, trovi la CPU che sta per Central Processing Unit. La CPU è un processore responsabile dell'esecuzione delle istruzioni e dei calcoli. Spesso viene chiamata il cervello del computer. +All'interno del case del computer, montata sulla scheda madre, trovi la CPU, che sta per Central Processing Unit. La CPU è un processore responsabile dell'esecuzione delle istruzioni e dei calcoli. Spesso viene chiamata il cervello del computer. -La CPU è un piccolo quadrato con un chip che si inserisce nel socket CPU della scheda madre. La velocità del processore CPU si misura in gigahertz (GHz) e megahertz (MHz). Il gigahertz corrisponde a un miliardo di cicli al secondo e il megahertz a un milione di cicli al secondo. +La CPU è un piccolo chip quadrato che si inserisce nel socket CPU della scheda madre. La velocità della CPU si misura in gigahertz (GHz) e megahertz (MHz). Un gigahertz corrisponde a un miliardo di cicli al secondo e un megahertz a un milione di cicli al secondo. -Il componente successivo fondamentale di un computer è la memoria a breve termine del sistema. Questa è nota come RAM o Random Access Memory. La RAM è un'area di archiviazione temporanea per la CPU del computer. Ogni volta che il computer ha bisogno di consultare dati rapidamente, usa la RAM. +Il componente critico successivo di un computer è la memoria a breve termine del sistema. Questa è conosciuta come RAM, o Random Access Memory. La RAM è un'area di memoria temporanea per la CPU del computer. Ogni volta che il computer ha bisogno di consultare dati rapidamente, usa la RAM. Più RAM hai sul computer, più velocemente funzionerà e più programmi potrai eseguire contemporaneamente. Se la RAM è insufficiente, il computer rallenterà e noterai la differenza nelle prestazioni. @@ -27,13 +27,13 @@ Quando salvi i tuoi file, vengono archiviati sull'hard disk. L'hard disk drive, L'hard disk è composto da un piatto rotante e un braccio. Il piatto è dove si archiviano i dati e il braccio serve per leggere e scrivere i dati sul piatto. Con un hard disk più veloce, il computer si avvierà più rapidamente e i programmi gireranno più velocemente. -Un altro tipo di archiviazione dati è il Solid State Drive, o SSD. L'SSD è una memoria flash non volatile e può sostituire un hard disk. Gli SSD sono più veloci e più piccoli degli hard disk, ma gli hard disk sono più economici e hanno una capacità di archiviazione maggiore. +Un altro tipo di memoria di archiviazione è il Solid State Drive, o SSD. L'SSD è una memoria flash non volatile e può essere usata al posto di un hard disk. Gli SSD sono più veloci e più piccoli degli hard disk, ma gli hard disk sono più economici e hanno una capacità di archiviazione maggiore. Un altro componente chiave di un computer è l'alimentatore, o PSU. Il PSU si occupa di convertire l'elettricità dalla presa a muro in una forma utilizzabile dal computer. Invia l'energia dalla presa alla scheda madre, alla CPU e agli altri componenti del computer. -Un altro componente importante sono le schede di espansione. Queste schede si inseriscono nella scheda madre per aggiungere funzionalità al computer. Esempi di schede di espansione sono la scheda video, la scheda audio e la scheda di rete. +Un altro componente chiave è la scheda di espansione. Queste schede si inseriscono nella scheda madre per aggiungere funzionalità extra al computer. Esempi di schede di espansione sono la scheda video, la scheda audio e la scheda di rete. -La scheda video, nota anche come Graphics Processing Unit o GPU, si occupa di renderizzare le immagini sullo schermo del computer. +La scheda video, nota anche come Graphics Processing Unit, o GPU, è responsabile di renderizzare le immagini sullo schermo del computer. La scheda audio si occupa di riprodurre il suono dagli altoparlanti del computer. @@ -53,7 +53,7 @@ Memoria a lungo termine. ### --feedback-- -Pensa all'archiviazione dati a breve termine. +Pensa alla memoria a breve termine. --- @@ -65,7 +65,7 @@ La scheda circuito principale. ### --feedback-- -Pensa all'archiviazione dati a breve termine. +Pensa alla memoria a breve termine. --- @@ -73,7 +73,7 @@ Una scheda video. ### --feedback-- -Pensa all'archiviazione dati a breve termine. +Pensa alla memoria a breve termine. ## --video-solution-- @@ -85,31 +85,31 @@ Cosa significa CPU? ## --answers-- -Centered Protocol Unit. +Unità di protocollo centrata. ### --feedback-- -Rivedi l'inizio della lezione dove è stato spiegato. +Rivedi l’inizio della lezione dove questo è stato spiegato. --- -City Processing Unit. +Unità di elaborazione della città. ### --feedback-- -Rivedi l'inizio della lezione dove è stato spiegato. +Rivedi l’inizio della lezione dove questo è stato spiegato. --- -Central Processing Unit. +Unità centrale di elaborazione. --- -Central Pixel Unit. +Unità pixel centrale. ### --feedback-- -Rivedi l'inizio della lezione dove è stato spiegato. +Rivedi l’inizio della lezione dove questo è stato spiegato. ## --video-solution-- @@ -141,7 +141,7 @@ Collegare il computer a internet. --- -Archiviare la memoria a breve termine. +Memorizzare la memoria a breve termine. ### --feedback-- diff --git a/curriculum/challenges/italian/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab82c1a9bbd0e3aabc39d.md b/curriculum/challenges/italian/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab82c1a9bbd0e3aabc39d.md index cd3e2462583..ca2bcd5028c 100644 --- a/curriculum/challenges/italian/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab82c1a9bbd0e3aabc39d.md +++ b/curriculum/challenges/italian/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab82c1a9bbd0e3aabc39d.md @@ -7,11 +7,11 @@ dashedName: how-to-effectively-work-with-your-keyboard-mouse-and-other-pointing- # --description-- -Molti di voi sono abituati a lavorare con tastiera e mouse da anni per varie attività come giocare, svolgere compiti di lavoro o navigare sul web. +Molti di voi usano la tastiera e il mouse da anni per una varietà di attività come giocare, svolgere compiti lavorativi o navigare sul web. Ma un uso prolungato e scorretto di questi dispositivi può portare a seri problemi di salute nel tempo. -In questa lezione vedremo come usare tastiera e mouse del computer in modo sano. +In questa lezione, vedremo come usare la tastiera e il mouse del computer in modo sano. Il primo consiglio è fare attenzione alla presa del mouse. Quando lavori a compiti importanti per lavoro o durante momenti intensi di gioco, potresti tendere a stringere troppo il mouse. Tuttavia, questo può causare seri problemi a mano e polso. Per evitarlo, devi assicurarti di tenere il mouse delicatamente e mantenere le dita rilassate. @@ -25,7 +25,7 @@ Devi anche fare attenzione alla postura generale quando stai seduto al computer Mantenere una buona postura è importante, ma l’ergonomia moderna sottolinea anche l’importanza del movimento e della seduta dinamica. Il corpo umano è fatto per muoversi, e restare in una posizione fissa, anche se dritta, per troppo tempo può esercitare una pressione continua sulla colonna vertebrale. Fare pause regolari, cambiare posizione durante la giornata e mantenere una posizione naturale dei polsi può aiutare a migliorare la circolazione, ridurre la stanchezza e sostenere la salute della colonna vertebrale nel lungo periodo. -L’ultimo consiglio è usare le scorciatoie da tastiera ogni volta che puoi per ridurre la digitazione. Ci sono decine di scorciatoie disponibili per navigare sul web, muoverti nel sistema operativo, lavorare in un editor di codice e altro ancora. Quindi, è meglio informarti su alcune di queste scorciatoie e iniziare a usarle nella tua routine al computer. +L'ultimo consiglio è di usare le scorciatoie da tastiera ogni volta che è possibile per ridurre il bisogno di raggiungere il mouse. Ci sono decine di scorciatoie disponibili per attività come navigare sul web, muoversi nel sistema operativo, lavorare in un editor di codice e altro ancora. Quindi, è meglio informarsi su alcune di queste scorciatoie e iniziare a integrarle nell'uso quotidiano del computer. Mentre continui a usare mouse e tastiera per i prossimi progetti di programmazione e altre attività, ricorda di tenere a mente questi consigli per la salute. @@ -109,7 +109,7 @@ Qual è la raccomandazione per l’altezza del mouse rispetto alla tastiera? ## --answers-- -Il mouse dovrebbe essere molto più in alto della tastiera. +L'altezza del mouse non è importante. ### --feedback-- diff --git a/curriculum/challenges/italian/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab83c4297910eade53c2e.md b/curriculum/challenges/italian/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab83c4297910eade53c2e.md index 1d3d1f62263..5675afd53be 100644 --- a/curriculum/challenges/italian/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab83c4297910eade53c2e.md +++ b/curriculum/challenges/italian/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab83c4297910eade53c2e.md @@ -7,11 +7,11 @@ dashedName: what-are-the-different-types-of-internet-service-providers # --description-- -Prima di tutto, cos’è un provider di servizi internet, o ISP? È essenzialmente un’azienda che vende l’accesso alla rete globale di internet. E si dividono in tre livelli diversi. +Prima di tutto, cos'è un internet service provider, o ISP? È essenzialmente un'azienda che vende l'accesso alla rete globale di internet. E si dividono in tre livelli diversi. -Il primo livello è costituito dalle grandi aziende conglomerate, che hanno l’infrastruttura per gestire la maggior parte (se non tutto) del loro traffico di rete in modo indipendente. +Il primo livello è costituito dalle grandi aziende conglomerate, che hanno l'infrastruttura per gestire in modo indipendente la maggior parte (se non tutto) del loro traffico di rete. -Il secondo livello è rappresentato dai provider a livello nazionale, che a volte affittano l’accesso alle reti di primo livello ma possono reggersi abbastanza bene da soli. +Il secondo livello è rappresentato dai provider a livello nazionale, che a volte affittano l'accesso alle reti di primo livello ma possono reggersi abbastanza bene da soli. Il terzo livello è formato dalle piccole aziende che si concentrano principalmente sul fornire internet ai mercati locali e si affidano a ISP più grandi per fornire la loro infrastruttura. @@ -25,7 +25,7 @@ Le connessioni DSL usano l’infrastruttura dei servizi telefonici a linea fissa Il dial-up usa anch’esso le linee telefoniche, ma richiede una connessione esclusiva (disabilitando l’uso della linea per scopi telefonici quando si è connessi a internet). Questa è una tecnologia molto più vecchia e ormai in disuso. -Le connessioni satellitari usano una serie di satelliti in orbita intorno alla terra per collegare vari dispositivi in tutto il mondo. Infine, in modo simile, un provider di internet domestico 5G usa l’infrastruttura delle torri cellulari per tenerti online. +Le connessioni satellitari usano un array di satelliti in orbita intorno alla Terra per collegare vari dispositivi in tutto il mondo. E infine, in modo simile, un provider di internet domestico 5G usa l'infrastruttura delle torri cellulari per mantenerti online. E questo dovrebbe darti una panoramica di base sui tipi di provider di servizi internet e di connessioni internet disponibili! @@ -33,7 +33,7 @@ E questo dovrebbe darti una panoramica di base sui tipi di provider di servizi i ## --text-- -Quale dei seguenti NON è un livello di provider di servizi internet (ISP)? +Quale dei seguenti NON è un livello di internet service provider (ISP)? ## --answers-- @@ -121,7 +121,7 @@ Richiedono l’uso esclusivo della linea telefonica quando si è connessi. --- -Usano una serie di satelliti in orbita intorno alla terra. +Usano un array di satelliti in orbita intorno alla Terra. ### --feedback-- diff --git a/curriculum/challenges/italian/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab8573f32480f192aaae1.md b/curriculum/challenges/italian/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab8573f32480f192aaae1.md index 80e6585c4cb..cbfbccb0a28 100644 --- a/curriculum/challenges/italian/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab8573f32480f192aaae1.md +++ b/curriculum/challenges/italian/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab8573f32480f192aaae1.md @@ -9,7 +9,7 @@ dashedName: what-are-the-different-types-of-tools-professional-developers-use Gli sviluppatori professionisti si affidano a una varietà di strumenti per aumentare la produttività e la qualità del codice. Scopriamo insieme questi strumenti, inclusi quelli che sembrano molto ovvi. -Il primo tra gli strumenti è il computer. Un computer è l'ambiente principale di sviluppo. Può essere un desktop potente o un laptop portatile con Windows, macOS o Linux come sistema operativo. +Il primo strumento è il computer stesso. Un computer è l'ambiente di sviluppo principale. Può essere un desktop potente o un laptop portatile con Windows, macOS o Linux come sistema operativo. Gli sviluppatori professionisti spesso scelgono computer con una potenza di elaborazione elevata e molta RAM per gestire attività che richiedono molte risorse. @@ -21,7 +21,7 @@ Visual Studio Code (VS Code) è essenzialmente un editor di codice, ma offre anc Altri editor di codice sono Sublime Text, Atom, Notepad++ e Brackets. -Quando scrivi codice con editor e IDE, devi tenere traccia delle modifiche che apporti. Lo strumento che ti permette di monitorare queste modifiche è un sistema di controllo versione. +Quando scrivi codice con editor di codice e IDE, devi tenere traccia delle modifiche che apporti a quel codice. Lo strumento che ti permette di tracciare queste modifiche è un sistema di controllo versione. Git è il sistema di controllo versione più usato nella comunità di sviluppo. @@ -31,8 +31,8 @@ I package manager sono un altro strumento fondamentale. Aiutano gli sviluppatori Esempi di package manager popolari sono: -* NPM, Yarn e PNPM per JavaScript -* PIP per Python +* npm, Yarn e pnpm per JavaScript +* pip per Python * Composer per PHP * Maven per Java @@ -147,7 +147,7 @@ Pensa agli strumenti che eseguono controlli automatici sul codice. --- -Sistemi di controllo versione +Sistemi di controllo versione. ### --feedback-- diff --git a/curriculum/challenges/italian/blocks/lecture-understanding-error-handling-and-health-checks/69f3046f4c0e76cbdd24858e.md b/curriculum/challenges/italian/blocks/lecture-understanding-error-handling-and-health-checks/69f3046f4c0e76cbdd24858e.md index 5a4bafa0fc6..f8f91e2711d 100644 --- a/curriculum/challenges/italian/blocks/lecture-understanding-error-handling-and-health-checks/69f3046f4c0e76cbdd24858e.md +++ b/curriculum/challenges/italian/blocks/lecture-understanding-error-handling-and-health-checks/69f3046f4c0e76cbdd24858e.md @@ -34,7 +34,7 @@ Definisci questo middleware alla fine della tua catena di middleware. Express sa che è un gestore di errori perché ha quattro parametri — quello nuovo, `err`, oltre ai soliti `req`, `res` e `next` usati per gli altri middleware. -In una lezione futura, imparerai di più sul middleware per la gestione degli errori e su come si inserisce nella più ampia catena di middleware di Express. +Come hai visto in una lezione precedente, il middleware per la gestione degli errori si inserisce nello stack più ampio del middleware di Express. ## Come gestire errori asincroni diff --git a/curriculum/challenges/italian/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/6733affc29df1304e2c97e88.md b/curriculum/challenges/italian/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/6733affc29df1304e2c97e88.md index be202cd2f0b..845659ef2d3 100644 --- a/curriculum/challenges/italian/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/6733affc29df1304e2c97e88.md +++ b/curriculum/challenges/italian/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/6733affc29df1304e2c97e88.md @@ -31,6 +31,8 @@ Inizi scrivendo la parola chiave `class` seguita dal nome della classe. Quando n Il contenuto all’interno delle parentesi graffe è noto come corpo della classe. Qui vanno il costruttore e i metodi. +## Definire i costruttori + Il costruttore è un metodo speciale che viene chiamato automaticamente quando viene creato un nuovo oggetto dalla classe. Viene tipicamente usato per inizializzare le proprietà dell’oggetto. In questo esempio, puoi vedere una classe `Dog` con un costruttore. @@ -45,6 +47,8 @@ class Dog { La parola chiave `this` viene usata qui per riferirsi all’istanza corrente della classe `Dog`, permettendoti di assegnare la proprietà `name` all’oggetto che viene creato. Imparerai di più sulla parola chiave `this` in una lezione futura. +## Definire i metodi + Sotto il costruttore, puoi avere quello che si chiamano metodi. I metodi sono funzioni definite all’interno di una classe che eseguono azioni o operazioni. Servono a definire comportamenti che le istanze della classe possono eseguire. Ecco un esempio di aggiunta di un metodo chiamato `bark` alla classe `Dog`. @@ -63,6 +67,8 @@ class Dog { Quando il metodo `bark` viene chiamato, il messaggio verrà stampato nella console con il nome effettivo che è stato passato. Se crei un’istanza `Dog` con il nome `"Buddy"`, chiamare il metodo `bark()` su quell’istanza stamperà `"Buddy says woof!"` nella console. +## Creare un'istanza di una classe + Una volta definita la tua classe, puoi creare un’istanza della classe con la parola chiave `new`, il nome della classe e i suoi argomenti. In questo esempio, creiamo una nuova istanza `Dog` con il nome `Gino` e poi la assegniamo alla variabile `dog`. @@ -73,13 +79,15 @@ const dog = new Dog("Gino"); Quando scrivi `new Dog("Gino")` nel tuo codice, il nuovo oggetto viene creato e il costruttore viene chiamato automaticamente con gli argomenti dati. -Puoi quindi consultare questa proprietà usando la notazione a punto, come puoi vedere nella riga di codice seguente: +## Consultare proprietà e metodi + +Puoi quindi consultare la proprietà `name` usando la notazione a punto, come puoi vedere nella seguente riga di codice: ```js console.log(dog.name); ``` -Ecco l’esempio completo: +Ecco l'esempio completo: :::interactive_editor @@ -127,6 +135,8 @@ dog.bark(); ::: +## Usare le espressioni di classe + Come detto prima, puoi anche definire le classi come espressione di classe. Qui la classe è anonima e assegnata a una variabile. Ecco come appare l’esempio precedente come espressione di classe: diff --git a/curriculum/challenges/italian/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/673403ca2bb16658309e3632.md b/curriculum/challenges/italian/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/673403ca2bb16658309e3632.md index 46fd07d7702..e8218c9bbe7 100644 --- a/curriculum/challenges/italian/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/673403ca2bb16658309e3632.md +++ b/curriculum/challenges/italian/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/673403ca2bb16658309e3632.md @@ -11,6 +11,8 @@ Hai imparato che le classi sono come modelli che puoi usare per creare oggetti. Questi modelli hanno bisogno di un modo generale per riferirsi all’oggetto specifico che viene creato, consultato o modificato all’interno del codice. Proprio per questo si usa la parola chiave `this`. Essa si riferisce al contesto in cui il codice deve essere eseguito. Se la usi all’interno di un metodo, il valore di `this` sarà un riferimento all’oggetto associato a quel metodo. In questo modo puoi consultare le proprietà e i metodi dell’oggetto all’interno della classe e riutilizzare il metodo su oggetti diversi. +## Costruttori + Per esempio, qui abbiamo una classe `Dessert`. Questa volta stiamo definendo una proprietà `hasPeanuts`. ```js @@ -33,6 +35,8 @@ this.hasPeanuts = hasPeanuts; Questo è nel contesto del costruttore, ma puoi usare la parola chiave `this` anche all’interno di altri metodi. +## Metodi + Questa è la nostra classe `Dessert` con qualche modifica. Ora abbiamo due proprietà: `name` e `price`. ```js @@ -64,7 +68,7 @@ Se chiamiamo il metodo `.showPrice()` su questo oggetto: brownie.showPrice(); ``` -Ecco l’esempio completo: +Ecco l'esempio completo: :::interactive_editor @@ -91,10 +95,16 @@ Il nome e il prezzo dell’oggetto corrente (`brownie`) vengono sostituiti nella Tutto questo è possibile grazie alla parola chiave `this`, che ti dà un modo generale per riferirti all’oggetto corrente all’interno della classe. Questo ti permette di riutilizzare il metodo su oggetti diversi. +## Funzioni e funzioni freccia + Questo è nel contesto dei metodi degli oggetti, ma la parola chiave `this` avrà un valore anche nelle funzioni autonome e nelle funzioni freccia. +### Funzioni regolari + Il suo valore all’interno di una funzione autonoma di solito si riferisce all’oggetto globale (in modalità non strict) o a `undefined` (in modalità strict). +### Funzioni freccia + Il valore della parola chiave `this` è un po’ diverso nelle funzioni freccia. Le funzioni freccia ereditano il valore di `this` dall’ambito esterno in cui sono definite. Non creano un proprio binding di `this`. Questo significa che il valore di `this` dipende dal contesto in cui la funzione freccia è definita, non da dove o come viene chiamata. Questo rende le funzioni freccia utili per le callback o per preservare il contesto. Tuttavia, proprio per questo, il valore di `this` non si riferirà all’oggetto corrente nei metodi degli oggetti, quindi è qualcosa da tenere a mente quando lavori con le funzioni freccia. diff --git a/curriculum/challenges/italian/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5160.md b/curriculum/challenges/italian/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5160.md index ff30390eef2..a0e0c06d715 100644 --- a/curriculum/challenges/italian/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5160.md +++ b/curriculum/challenges/italian/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5160.md @@ -14,17 +14,17 @@ Tuttavia, al di sotto di queste differenze, il processo che trasforma un’idea 1. ## Identificare un bisogno Gli standard nascono da attriti, come sviluppatori che si scontrano con un muro, browser che implementano lo stesso comportamento in modi incompatibili o una nuova capacità che la piattaforma semplicemente non supporta ancora. Qualcuno, da qualche parte, si stanca abbastanza da scriverlo. Questa persona può essere chiunque: uno sviluppatore, una grande azienda con una necessità di prodotto o un ingegnere all’interno di un team browser. Ciò che conta in questa fase non è l’autorità, ma le prove e le domande su quanto il problema sia reale e se abbastanza persone lo incontrino da giustificare l’attenzione della piattaforma web. -1. **Proposta e discussione iniziale** - L’idea viene scritta informalmente tramite un issue su GitHub, un documento breve o un explainer che descrive il problema e abbozza una possibile soluzione. In questa fase, l’obiettivo non è produrre una specifica finita ma capire se il problema risuona. Altri sviluppatori lo riconoscono? I fornitori di browser sono interessati? Esiste una soluzione ovvia o più soluzioni in competizione? In TC39 questa fase corrisponde allo Stage 0 e Stage 1. Nel W3C spesso avviene informalmente in un Community Group prima che venga costituito un Working Group formale. WHATWG la gestisce tramite discussioni aperte su GitHub nei suoi repository principali. Il luogo cambia, ma la funzione è la stessa. +1. ## Proposta e discussione iniziale + L'idea viene scritta informalmente tramite un problema su GitHub, un documento breve o un explainer che descrive il problema e abbozza una possibile soluzione. A questo stadio, l'obiettivo non è produrre una specifica definitiva ma capire se il problema risuona. Altri sviluppatori lo riconoscono? I fornitori di browser sono interessati? Esiste una soluzione ovvia o diverse soluzioni in competizione? In TC39, questa fase iniziale corrisponde allo Stage 0 e Stage 1. Nel W3C, spesso avviene informalmente in un Community Group prima che venga costituito un Working Group formale. Il WHATWG la gestisce tramite discussioni aperte su GitHub nei suoi repository principali. Il luogo cambia, ma la funzione è la stessa. -1. **Scrivere la specifica** - Se la proposta prende piede, qualcuno o un piccolo team deve scrivere la specifica vera e propria, o spec. Una spec non è un post sul blog o un tutorial, ma un documento preciso e formale che descrive esattamente come una funzionalità deve comportarsi in ogni situazione possibile. Vanno considerate e documentate tutte le casistiche limite, condizioni di errore, interazioni con funzionalità esistenti e implicazioni di sicurezza. +1. ## Scrivere la specifica + Se la proposta prende piede, qualcuno o un piccolo team deve scrivere la specifica vera e propria, o spec. Una spec non è un post sul blog o un tutorial, ma un documento preciso e formale che descrive esattamente come una funzionalità deve comportarsi in ogni situazione possibile. Devono essere considerati e scritti i casi limite, le condizioni di errore, le interazioni con funzionalità esistenti e le implicazioni di sicurezza. -1. **Revisione, obiezioni e iterazione** - La bozza viene pubblicata e revisionata pubblicamente e dagli altri fornitori di browser. Qui avviene la maggior parte del lavoro vero. Vengono sollevate obiezioni e la spec viene rivista. Una funzionalità che un motore browser importante rifiuta di implementare difficilmente diventerà uno standard, indipendentemente dai suoi meriti tecnici. Costruire consenso in questa fase può richiedere molto tempo. Alcune proposte si bloccano per anni mentre i fornitori negoziano dettagli di design. Altre muoiono del tutto quando diventa chiaro che non si può raggiungere un accordo. +1. ## Revisione, obiezioni e iterazione + La bozza viene pubblicata e revisionata pubblicamente e dagli altri fornitori di browser. Qui avviene la maggior parte del lavoro reale. Vengono sollevate obiezioni e la spec viene rivista. Una funzionalità che un motore di browser importante rifiuta di implementare difficilmente diventerà uno standard, indipendentemente dai suoi meriti tecnici. Costruire consenso a questo stadio può richiedere molto tempo. Alcune proposte si bloccano per anni mentre i fornitori negoziano dettagli di design. Altre muoiono completamente quando diventa chiaro che non si può raggiungere un accordo. -1. **Implementazione e test** - Quando una spec è abbastanza stabile, i fornitori di browser iniziano a implementarla. Di solito si parte con un feature flag, così può essere testata senza influenzare gli utenti esistenti. L’implementazione spesso rivela problemi che la spec non aveva previsto, che vengono quindi rimandati agli editor per chiarimenti. Una suite di test condivisa verifica che ogni implementazione si comporti effettivamente allo stesso modo. Se Chrome, Firefox e Safari superano gli stessi test, la spec funziona. Se divergono, o la spec è poco chiara o una delle implementazioni ha un bug. +1. ## Implementazione e test + Una volta che una spec è abbastanza stabile, i fornitori di browser iniziano a implementarla. Di solito si parte con un feature flag, così può essere testata senza influenzare gli utenti esistenti. L'implementazione spesso rivela problemi che la spec non aveva previsto, che vengono quindi rimandati agli editor per chiarimenti. Una suite di test condivisa verifica che ogni implementazione si comporti effettivamente allo stesso modo. Se Chrome, Firefox e Safari superano tutti gli stessi test, la spec funziona. Se divergono, o la spec è poco chiara o una delle implementazioni ha un bug. 1. ## Finalizzazione Quando esistono più implementazioni indipendenti, i test sono superati e la comunità è soddisfatta, lo standard viene finalizzato. Nel W3C questo significa raggiungere lo status di raccomandazione. In TC39 significa arrivare allo Stage 4, dopo il quale la funzionalità viene inclusa nella prossima release annuale di ECMAScript. In WHATWG non c’è un momento unico di finalizzazione, lo standard “vivo” riflette semplicemente il consenso attuale, aggiornato continuamente. L’intero processo può durare da pochi mesi per un’aggiunta piccola e non controversa fino a oltre un decennio per qualcosa di complesso o politicamente delicato. CSS Grid, per esempio, è stato proposto per la prima volta nel 2011 e non è stato supportato in tutti i browser principali fino al 2017. Quello spazio tra una buona idea e uno standard stabile e universalmente supportato è dove avviene gran parte del lavoro silenzioso del web aperto. @@ -109,7 +109,7 @@ Perché una suite di test condivisa è importante durante la fase di implementaz ## --answers-- -Per sostituire la necessità di una specifica scritta. +Sostituire la necessità di una specifica scritta. ### --feedback-- @@ -121,7 +121,7 @@ Per verificare che tutte le implementazioni dei browser si comportino allo stess --- -Per classificare le prestazioni dei browser a scopo di marketing. +Classificare le prestazioni dei browser a scopo di marketing. ### --feedback-- diff --git a/curriculum/challenges/italian/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5161.md b/curriculum/challenges/italian/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5161.md index 25a262d895b..837aa1dee40 100644 --- a/curriculum/challenges/italian/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5161.md +++ b/curriculum/challenges/italian/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5161.md @@ -13,23 +13,23 @@ Il ciclo di vita di una funzionalità degli standard web è collegato, ma su una Pensa al processo come al regolamento, e al ciclo di vita come a ciò che succede realmente quando giochi. -1. **Proposta** - Ogni funzionalità inizia con un problema che qualcuno ha ritenuto importante scrivere. Uno sviluppatore, un ingegnere di browser o un’azienda apre un problema su GitHub o un documento esplicativo che descrive cosa il web non può fare attualmente e perché dovrebbe poterlo fare. In questa fase l’idea è vaga, con più domande che risposte. L’obiettivo è semplicemente capire se qualcun altro riconosce lo stesso problema. +1. ## Proposta + Ogni funzionalità inizia con un problema che qualcuno ha ritenuto importante abbastanza da scrivere. Uno sviluppatore, un ingegnere di browser o un'azienda apre un problema su GitHub o un documento esplicativo che descrive cosa il web non può fare attualmente e perché dovrebbe poterlo fare. In questa fase, l'idea è vaga, con più domande che risposte. L'obiettivo è semplicemente scoprire se qualcun altro riconosce lo stesso problema. -1. **Incubazione** - Se la proposta risuona, entra in un periodo di discussione aperta e progettazione iniziale. Vengono abbozzati approcci concorrenti, raccolti casi d’uso e la comunità mette alla prova l’idea. Molte proposte muoiono qui, forse perché il problema si rivela troppo di nicchia o nessuna soluzione soddisfa tutti. Quelle che sopravvivono emergono con una forma più chiara e almeno un certo interesse da parte dei vendor di browser. +1. ## Incubazione + Se la proposta risuona, entra in un periodo di discussione aperta e progettazione iniziale. Vengono abbozzati approcci concorrenti, raccolti casi d'uso e la comunità mette alla prova l'idea. Molte proposte muoiono qui, forse perché il problema si rivela troppo di nicchia o nessuna soluzione soddisfa tutti. Quelle che sopravvivono emergono con una forma più chiara e almeno un certo interesse da parte dei fornitori di browser. -1. **Specificazione** - Una proposta sopravvissuta viene formalizzata in una specifica. Ogni caso limite, condizione di errore e interazione con funzionalità esistenti deve essere definita chiaramente. Questo è il momento in cui una buona idea incontra la dura realtà. I concetti vaghi devono diventare regole precise che due ingegneri indipendenti possono leggere e implementare in modo identico. +1. ## Specifica + Una proposta sopravvissuta viene redatta come specifica formale. Ogni caso limite, condizione di errore e interazione con funzionalità esistenti deve essere definita chiaramente. Questo è il momento in cui una buona idea incontra la dura realtà. Concetti vaghi devono diventare regole esatte che due ingegneri indipendenti possono leggere e implementare in modo identico. -1. **Test di interoperabilità** - Prima che una funzionalità possa essere considerata stabile, deve comportarsi allo stesso modo in ogni browser. La suite W3C Web Platform Tests è lo strumento principale per verificarlo. È una batteria condivisa di test che Chrome, Firefox, Safari e altri eseguono sulle loro implementazioni. Risultati divergenti significano che la specifica è ambigua o che qualcuno ha un bug. Entrambi devono essere risolti prima che la funzionalità possa andare avanti. +1. ## Test di interoperabilità + Prima che una funzionalità possa essere considerata stabile, deve comportarsi allo stesso modo in ogni browser. La suite W3C Web Platform Tests è lo strumento principale per verificarlo. È una batteria condivisa di test che Chrome, Firefox, Safari e altri eseguono contro le loro implementazioni. Risultati divergenti significano che la specifica è ambigua o che qualcuno ha un bug. Entrambi devono essere risolti prima che la funzionalità possa andare avanti. -1. **Finalizzazione** - Una volta che più implementazioni indipendenti superano i test, la funzionalità viene finalizzata. Per il W3C è una raccomandazione, per TC39 è lo stage 4, ed è una voce stabile nello standard living del WHATWG. Le flag vengono rimosse e la funzionalità viene distribuita agli utenti. A questo punto diventa parte della piattaforma web di base, qualcosa su cui ogni sviluppatore può fare affidamento indefinitamente. +1. ## Finalizzazione + Una volta che più implementazioni indipendenti superano i test, la funzionalità viene finalizzata. Per il W3C è una raccomandazione, per TC39 è lo stage 4, ed è una voce stabile nello standard living del WHATWG. I flag vengono rimossi e la funzionalità viene distribuita agli utenti. A questo punto diventa parte della piattaforma web di base, qualcosa su cui ogni sviluppatore può fare affidamento indefinitamente. -1. **Deprecazione** - Non tutti gli standard invecchiano bene. Alcune funzionalità vengono superate da altre migliori, altre si rivelano avere implicazioni di sicurezza o privacy non evidenti al momento. Quando una funzionalità deve essere rimossa, viene formalmente deprecata. Cioè, è supportata ma segnata come qualcosa che gli sviluppatori dovrebbero smettere di usare. Alla fine viene rimossa dalla specifica. La rimozione dai browser è lenta e cauta, perché la promessa fondamentale del web è che le vecchie pagine continuino a funzionare. Alcune funzionalità deprecate rimangono nei browser per decenni solo per obbligo di retrocompatibilità. +1. ## Deprecazione + Non tutti gli standard invecchiano bene. Alcune funzionalità vengono superate da altre migliori, altre si rivelano avere implicazioni di sicurezza o privacy non evidenti all'epoca. Quando una funzionalità deve essere rimossa, viene formalmente deprecata. Cioè, è supportata ma segnata come qualcosa che gli sviluppatori dovrebbero smettere di usare. Alla fine viene rimossa dalla specifica. La rimozione dai browser è lenta e cauta, perché la promessa fondamentale del web è che le vecchie pagine continuino a funzionare. Alcune funzionalità deprecate permangono nei browser per decenni solo per l'obbligo di retrocompatibilità. # --questions-- diff --git a/curriculum/challenges/italian/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5162.md b/curriculum/challenges/italian/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5162.md index e578ac74f42..9203db14c35 100644 --- a/curriculum/challenges/italian/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5162.md +++ b/curriculum/challenges/italian/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5162.md @@ -9,26 +9,26 @@ dashedName: what-are-the-key-principles-that-web-standards-are-built-on Gli standard web non sono solo documenti tecnici, riflettono un insieme di valori su cosa dovrebbe essere il web e a chi dovrebbe servire. Comprendere questi principi ti aiuta a capire non solo come funziona il web, ma perché è stato costruito in questo modo. Discutiamo di questi principi. -1. **Apertura** - Gli standard web sono sviluppati in modo aperto e implementati senza royalty. Chiunque può leggere le specifiche, chiunque può costruire un browser, e nessuna azienda può chiedere diritti di licenza per implementare uno standard. Questa apertura distingue il web dalle piattaforme proprietarie e permette a piccoli team di creare strumenti che raggiungono miliardi di persone senza chiedere il permesso a un controllore. +1. ## Apertura + Gli standard web sono sviluppati in modo aperto e implementati senza royalty. Chiunque può leggere le specifiche, chiunque può costruire un browser e nessuna azienda può chiedere diritti di licenza per implementare uno standard. Questa apertura è ciò che distingue il web dalle piattaforme proprietarie e ciò che permette a piccoli team di creare strumenti che raggiungono miliardi di persone senza chiedere il permesso a un controllore. -1. **Accessibilità** - Il web è stato progettato per essere utilizzabile da tutti, indipendentemente dalle capacità. L'accessibilità non è un componente aggiuntivo agli standard web, è integrata nel design di HTML, CSS e nel comportamento dei browser. Le linee guida WCAG del W3C stabiliscono il livello formale di cosa significa accessibile nella pratica. Una funzionalità che crea barriere per chi usa lettori di schermo, navigazione da tastiera o tecnologia assistiva è considerata difettosa per progettazione, non solo per etica. +1. ## Accessibilità + Il web è stato progettato per essere utilizzabile da tutti, indipendentemente dalle capacità. L'accessibilità non è un componente aggiuntivo agli standard web, è integrata nel design di HTML, CSS e nel comportamento del browser. Le linee guida WCAG del W3C stabiliscono il livello formale di cosa significa accessibile nella pratica. Una funzionalità che crea barriere per chi usa lettori di schermo, la navigazione da tastiera o tecnologia assistiva è considerata difettosa per design, non solo per etica. -1. **Interoperabilità** - Il principio più fondamentale è che il web dovrebbe funzionare allo stesso modo ovunque. Una pagina costruita secondo lo standard dovrebbe comportarsi identicamente in Chrome, Firefox e Safari, e su Windows, macOS, Linux, Android e iOS. Senza interoperabilità, il web si frammenta in una raccolta di esperienze specifiche per browser, e gli sviluppatori sono costretti a scrivere lo stesso codice più volte. Ogni standard esiste, nel suo nucleo, per evitare questo. +1. ## Interoperabilità + Il principio più fondamentale è che il web dovrebbe funzionare allo stesso modo ovunque. Una pagina costruita secondo lo standard dovrebbe comportarsi in modo identico su Chrome, Firefox e Safari, e su Windows, macOS, Linux, Android e iOS. Senza interoperabilità, il web si frammenta in una collezione di esperienze specifiche per browser, e gli sviluppatori sono costretti a scrivere la stessa cosa più volte. Ogni standard esiste, nel suo nucleo, per prevenire questo. -1. **Compatibilità retroattiva** - Il web ha un impegno quasi assoluto a non rompere le cose vecchie. Una pagina scritta nel 1999 dovrebbe ancora renderizzarsi in un browser moderno, e gli enti di standardizzazione prendono seriamente questo obbligo quando progettano nuove funzionalità. Per questo motivo le nuove capacità si aggiungono sopra quelle esistenti invece di sostituirle. È un vincolo che a volte frustra i designer, ma è anche ciò che rende il web una piattaforma unicamente duratura. +1. ## Compatibilità retroattiva + Il web ha un impegno quasi assoluto a non rompere le cose vecchie. Una pagina scritta nel 1999 dovrebbe ancora renderizzarsi in un browser moderno, e gli enti di standardizzazione prendono seriamente questo obbligo quando progettano nuove funzionalità. Per questo motivo le nuove capacità sono sovrapposte a quelle precedenti invece di sostituirle. È un vincolo che a volte frustra i progettisti, ma è anche ciò che rende il web una piattaforma unicamente durevole. -1. **Privacy e sicurezza** - Gli standard moderni sono sottoposti a revisione per le implicazioni di privacy e sicurezza prima di essere rilasciati. Le nuove API che potrebbero esporre dati degli utenti o abilitare il tracciamento affrontano un controllo rigoroso nel processo di standardizzazione. Il principio è che la piattaforma dovrebbe proteggere gli utenti per impostazione predefinita, e che la convenienza per gli sviluppatori non dovrebbe mai andare a scapito della sicurezza degli utenti. +1. ## Privacy e sicurezza + Gli standard moderni sono sottoposti a revisione per le implicazioni di privacy e sicurezza prima di essere rilasciati. Le nuove API che potrebbero esporre dati degli utenti o abilitare il tracciamento affrontano un controllo significativo nel processo di standardizzazione. Il principio è che la piattaforma dovrebbe proteggere gli utenti per impostazione predefinita, e che la convenienza per gli sviluppatori non dovrebbe mai andare a scapito della sicurezza degli utenti. -1. **Stratificazione** - Il web è costruito in livelli distinti e componibili: HTML per la struttura, CSS per la presentazione e JavaScript per il comportamento. Gli standard sono progettati per rispettare questi confini invece di fonderli. Una funzionalità ben stratificata può essere adottata gradualmente. Una pagina che non usa JavaScript funziona comunque, e un browser che non supporta una nuova proprietà CSS renderizza comunque qualcosa di ragionevole. Questa separazione delle responsabilità è ciò che conferisce al web la sua resilienza. +1. ## Stratificazione + Il web è costruito in livelli distinti e componibili: HTML per la struttura, CSS per la presentazione e JavaScript per il comportamento. Gli standard sono progettati per rispettare questi confini invece di annullarli. Una funzionalità ben stratificata può essere adottata in modo incrementale. Una pagina che non usa JavaScript funziona comunque, e un browser che non supporta una nuova proprietà CSS renderizza comunque qualcosa di ragionevole. Questa separazione delle responsabilità è ciò che dà al web la sua resilienza. -1. **Miglioramento progressivo** - Strettamente legato alla stratificazione è l’idea che il web dovrebbe funzionare per tutti, per poi migliorare per chi ha browser o dispositivi più capaci. Una funzionalità standard dovrebbe degradare in modo graduale quando non supportata, non rompersi completamente. Questo principio guida come vengono specificate le nuove proprietà CSS, come le API JavaScript gestiscono le capacità mancanti e come gli enti di standardizzazione considerano il divario tra browser moderni e quelli più vecchi ancora molto usati nel mondo. +1. ## Miglioramento progressivo + Stretta correlata alla stratificazione è l'idea che il web dovrebbe funzionare per tutti, per poi migliorare per chi ha browser o dispositivi più capaci. Una funzionalità standard dovrebbe degradare in modo elegante quando non supportata, non rompersi completamente. Questo principio influenza come vengono specificate le nuove proprietà CSS, come le API JavaScript gestiscono le capacità mancanti e come gli enti di standardizzazione considerano il divario tra browser moderni e quelli più vecchi ancora ampiamente usati nel mondo. # --questions-- diff --git a/curriculum/challenges/italian/blocks/lecture-user-interface-design-fundamentals/672baa97f2990e6631d522e7.md b/curriculum/challenges/italian/blocks/lecture-user-interface-design-fundamentals/672baa97f2990e6631d522e7.md index e093ac4b4de..89aa8aa8bb2 100644 --- a/curriculum/challenges/italian/blocks/lecture-user-interface-design-fundamentals/672baa97f2990e6631d522e7.md +++ b/curriculum/challenges/italian/blocks/lecture-user-interface-design-fundamentals/672baa97f2990e6631d522e7.md @@ -9,6 +9,8 @@ dashedName: how-do-you-create-good-background-and-foreground-contrast-in-your-de **NOTA**: Alcuni esempi interattivi potrebbero usare CSS che non hai ancora imparato. Non preoccuparti di capire tutto il codice. Lo scopo degli esempi è mostrarti anteprime di questi concetti di design per farti capire meglio come funzionano. +## Comprendere il contrasto + Per prima cosa, potresti dover familiarizzare con il contrasto. Il contrasto è la differenza tra due colori — o quanto è facile distinguerli. I colori con un contrasto più alto saranno più distinti visivamente, mentre quelli con un contrasto più basso saranno più simili tra loro. Per esempio, il nero e il bianco hanno un rapporto di contrasto molto alto. Mentre l’azzurro chiaro e il viola chiaro hanno un contrasto minore. @@ -53,6 +55,8 @@ I colori con un contrasto più alto saranno più distinti visivamente, mentre qu ::: +### Applicare il contrasto al testo + Ovviamente, in questi esempi la distinzione potrebbe essere più chiara grazie al layout. Ma cosa succede applicando questi colori al testo? Puoi avere testo nero ad alto contrasto su sfondo bianco. E testo viola a basso contrasto su sfondo blu. :::interactive_editor @@ -96,6 +100,8 @@ Ovviamente, in questi esempi la distinzione potrebbe essere più chiara grazie a ::: +### Standard di contrasto WCAG + Ma come si determina cosa sia un contrasto “abbastanza buono”? Non puoi basarti solo su come il testo ti appare, perché ogni utente avrà un’esperienza diversa. Per fortuna, le Web Content Accessibility Guidelines, o WCAG, forniscono uno standard per questo. Il testo con un rapporto di contrasto di 4.5:1 è considerato lo standard AA, che è il minimo indispensabile per essere accessibile alla maggior parte degli utenti. Il testo con un rapporto di contrasto di 7:1 è considerato lo standard AAA, e garantisce il miglior livello di accessibilità. @@ -141,6 +147,8 @@ Il testo con un rapporto di contrasto di 4.5:1 è considerato lo standard AA, ch ::: +### Confronto tra rapporti di contrasto alti e bassi + Esistono diversi siti web che possono controllare il rapporto di contrasto tra due colori, ma la maggior parte dei browser ti permette di farlo direttamente negli strumenti per sviluppatori sul tuo sito. Diamo un’occhiata a qualche altro esempio di rapporto di contrasto per capire meglio il concetto. @@ -221,8 +229,12 @@ Questo esempio supera ampiamente lo standard AAA. Ora, vediamo il testo viola su Questo esempio ha un rapporto di contrasto di 1.48:1, che non raggiunge nemmeno lo standard AA. +## Regolare le proprietà del colore + Come puoi risolvere questo? Ci sono tre aspetti che influenzano il rapporto di contrasto. +### Regolare la tonalità + Il primo è la tonalità, che rappresenta il tipo generale di colore, come rosso, blu, arancione. Cambiamo la tonalità verso un colore più distante dal blu. In questo caso, usiamo il rosso. :::interactive_editor @@ -267,6 +279,8 @@ Il primo è la tonalità, che rappresenta il tipo generale di colore, come rosso ::: +### Regolare la saturazione + Purtroppo, questo cambiamento ha portato il rapporto di contrasto solo a 1.49:1, quindi devi modificare la saturazione, cioè la “quantità” di colore presente. Aumentiamo la quantità di rosso nel testo. Questo ci avvicina molto all’obiettivo, con un rapporto di contrasto di 3.54:1. :::interactive_editor @@ -325,6 +339,8 @@ Purtroppo, questo cambiamento ha portato il rapporto di contrasto solo a 1.49:1, ::: +### Regolare la luminosità + Tuttavia, puoi avvicinarti ancora di più cambiando l’ultimo valore, che è la luminosità. La luminosità rappresenta quanta parte di bianco è presente nel colore. Abbassiamo la luminosità del rosso. Ora c’è un rosso molto più scuro rispetto allo sfondo azzurro chiaro, e il rapporto di contrasto sale a 10.34:1. diff --git a/curriculum/challenges/italian/blocks/lecture-what-is-css/672acc100d59d24da7b4e09c.md b/curriculum/challenges/italian/blocks/lecture-what-is-css/672acc100d59d24da7b4e09c.md index 4f1fbb8c6d4..566bd52c408 100644 --- a/curriculum/challenges/italian/blocks/lecture-what-is-css/672acc100d59d24da7b4e09c.md +++ b/curriculum/challenges/italian/blocks/lecture-what-is-css/672acc100d59d24da7b4e09c.md @@ -7,10 +7,14 @@ dashedName: what-are-the-different-types-of-css-combinators # --interactive-- +## Combinatori CSS + I combinatori CSS sono usati per definire la relazione tra i selettori in CSS. Aiutano a selezionare elementi in base alla loro relazione con altri elementi, permettendo uno stile più preciso ed efficiente. Discuteremo alcuni combinatori CSS principali e i loro casi d'uso, iniziando dal combinatore discendente. +### Combinatore discendente + Un combinatore discendente viene usato per selezionare gli elementi corrispondenti al secondo selettore se sono annidati all'interno di un elemento antenato che corrisponde al primo selettore. Un antenato può essere un genitore, un nonno o qualsiasi antenato più in alto nell'albero del documento. Per capire meglio come funziona, diamo un'occhiata a un esempio. @@ -42,6 +46,8 @@ In questo caso, `figure` sarebbe il genitore e `img` il figlio. Se avessi più immagini all'interno di un elemento `figure`, usare il combinatore discendente sarebbe un buon modo per applicare un bordo nero solido attorno a ciascuna di quelle immagini. +### Combinatore figlio + Un altro tipo di combinatore è il combinatore figlio. Il combinatore figlio (`>`) in CSS viene usato per selezionare gli elementi che sono figli diretti di un elemento genitore specificato. @@ -102,6 +108,8 @@ Nell'esempio sopra, stiamo selezionando solo il figlio diretto della classe `con Poiché gli altri due elementi paragrafo sono annidati dentro elementi `div`, non sono considerati figli diretti della classe `container` e non avranno il colore del testo blu. +### Combinatore fratello immediato + Un altro combinatore comune è il combinatore fratello immediato. Il combinatore fratello immediato (`+`) in CSS seleziona un elemento che segue immediatamente un elemento fratello specificato. Questo combinatore è utile quando vuoi applicare stili a un elemento che segue direttamente un altro elemento, permettendo uno stile mirato basato sulla posizione dell'elemento rispetto ai suoi fratelli. @@ -150,6 +158,8 @@ img + figcaption { In questo esempio, il combinatore fratello immediato (`+`) seleziona l'elemento `figcaption` che segue immediatamente l'elemento `img`. La regola CSS applicata aggiunge un bordo `4px solid black border` attorno all'elemento `figcaption`. +### Combinatore fratello successivo + Un altro combinatore comune è il combinatore fratello successivo. Il combinatore fratello successivo (`~`) in CSS seleziona tutti i fratelli di un elemento specificato che lo seguono. @@ -202,6 +212,8 @@ In questo esempio, tutti gli elementi paragrafo che seguono l'elemento `h2` avra Il combinatore fratello successivo (`~`) seleziona tutti i fratelli paragrafo che appaiono dopo l'elemento `h2`, indipendentemente dal fatto che siano fratelli immediati. +## Perché i combinatori CSS sono importanti + In conclusione, comprendere e usare vari combinatori CSS ti permette di applicare stili precisi ai tuoi elementi HTML, migliorando il controllo e la flessibilità del tuo design. Padroneggiando questi selettori, puoi creare regole di stile più sofisticate e mirate che migliorano sia l'aspetto sia la funzionalità delle tue pagine web. diff --git a/curriculum/challenges/italian/blocks/lecture-working-with-code-editors-and-ides/672d26269456511aa3db614d.md b/curriculum/challenges/italian/blocks/lecture-working-with-code-editors-and-ides/672d26269456511aa3db614d.md index e143c30eb38..ebbae12f890 100644 --- a/curriculum/challenges/italian/blocks/lecture-working-with-code-editors-and-ides/672d26269456511aa3db614d.md +++ b/curriculum/challenges/italian/blocks/lecture-working-with-code-editors-and-ides/672d26269456511aa3db614d.md @@ -7,25 +7,25 @@ dashedName: what-is-a-code-editor-and-ide # --description-- -Potresti pensare che siano la stessa cosa, ma non è proprio così. Un editor di codice è qualsiasi applicazione che ti permette di modificare file di codice. Un IDE, o ambiente di sviluppo integrato, è un’applicazione completa che ti consente di compilare, eseguire e eseguire il debug del codice mentre lo modifichi. +Potresti pensare che siano la stessa cosa, ma non è così. Un code editor è qualsiasi applicazione che ti permette di modificare file di codice. Un IDE, o ambiente di sviluppo integrato, è un'applicazione completa che ti consente di compilare, eseguire e eseguire il debug del tuo codice mentre lo modifichi. -Forse qualche esempio può essere utile. +Alcuni esempi ti aiuteranno. Per prima cosa, consideriamo alcuni IDE popolari. Visual Studio è un ambiente di sviluppo integrato di Microsoft che offre una suite completa di strumenti per creare, eseguire il debug e distribuire applicazioni su diverse piattaforme. -Un altro IDE è XCode. Xcode è un ambiente di sviluppo integrato di Apple progettato per creare, scrivere codice ed eseguire il debug di applicazioni per macOS, iOS, watchOS e tvOS. +Un altro IDE è Xcode. Xcode è un ambiente di sviluppo integrato di Apple progettato per creare, scrivere codice e eseguire il debug di applicazioni per macOS, iOS, watchOS e tvOS. -Un altro IDE è Android Studio. Android Studio è un ambiente di sviluppo integrato di Google specificamente progettato per creare, eseguire il debug e testare applicazioni Android. +Android Studio, sviluppato da Google, è un ambiente di sviluppo integrato specificamente progettato per costruire, eseguire il debug e testare applicazioni Android. Questi sono solo alcuni esempi di IDE. Ora diamo un’occhiata ad alcuni editor di codice popolari. Visual Studio Code è un editor di codice leggero e open source di Microsoft che supporta un’ampia gamma di linguaggi di programmazione e offre funzionalità come il debugging, l’evidenziazione della sintassi e il controllo delle versioni tramite estensioni. -Un altro editor popolare è Sublime Text. Sublime Text è un editor di testo veloce e versatile noto per la sua interfaccia elegante, le funzionalità potenti e il supporto per molti linguaggi di programmazione tramite evidenziazione della sintassi personalizzabile e plugin. +Per un'esperienza di modifica veloce e versatile, Sublime Text offre un'interfaccia elegante e supporta un'ampia gamma di linguaggi di programmazione tramite evidenziazione della sintassi personalizzabile e plugin. -Un altro è Notepad++. Questo è un editor di testo e codice sorgente gratuito e open source per Windows che offre evidenziazione della sintassi, folding del codice e una serie di plugin per migliorare la produttività e la personalizzazione. +Gli utenti Windows possono anche usare Notepad++, un editor di testo e codice sorgente gratuito e open source che offre evidenziazione della sintassi, folding del codice e una serie di plugin per migliorare la produttività e la personalizzazione. -Avrai notato come gli editor di codice si concentrino principalmente sul contenuto testuale del file, mentre gli IDE espongono vari strumenti per gestire il codice. +Avrai notato come i code editor si concentrino principalmente sul contenuto testuale del file, mentre gli IDE espongono vari strumenti per gestire il tuo codice. Questi esempi sono tutti programmi locali che puoi eseguire sul tuo computer, ma esistono anche editor basati sul cloud che puoi usare. @@ -35,11 +35,11 @@ Diamo un’occhiata ad alcuni editor basati sul cloud. Replit è una piattaforma online che offre un ambiente collaborativo per scrivere codice, permettendo agli utenti di scrivere, eseguire e condividere codice in vari linguaggi di programmazione direttamente dal browser. -Un altro editor basato sul cloud popolare è GitHub Codespaces. Questo è un ambiente di sviluppo basato sul cloud che fornisce accesso immediato a un editor di codice completamente configurato e strumenti di sviluppo direttamente da GitHub, permettendo una programmazione e collaborazione senza interruzioni. +Un altro editor cloud-based popolare è GitHub Codespaces. Si tratta di un ambiente di sviluppo basato sul cloud che fornisce accesso immediato a un code editor completamente configurato e a strumenti di sviluppo direttamente da GitHub, permettendo una programmazione e collaborazione senza interruzioni. -Un altro è Ona. Ona è un ambiente di sviluppo basato sul cloud che si integra con GitHub e GitLab, offrendo spazi di lavoro personalizzabili e immediati per scrivere codice, creare e eseguire il debug direttamente dal browser. +Ona si integra con GitHub e GitLab per offrire spazi di lavoro istantanei e personalizzabili per scrivere codice, costruire ed eseguire il debug direttamente dal tuo browser. -E ci sono molte altre opzioni. Alcune, come Visual Studio Code, sono altamente estensibili e possono lavorare con diversi tipi di progetti e linguaggi. Altre potrebbero essere specificamente pensate per un sottoinsieme ristretto di linguaggi o tipi di progetto. +E ci sono molte altre opzioni. Alcune, come Visual Studio Code, sono altamente estensibili e possono lavorare con molti tipi di progetto e linguaggi. Altre potrebbero essere specificamente pensate per un piccolo sottoinsieme di linguaggi o tipi di progetto. L’applicazione che usi potrebbe essere diversa a seconda dei progetti specifici. Esplora le opzioni per vedere quale funziona meglio per le tue esigenze. diff --git a/curriculum/challenges/italian/blocks/lecture-working-with-code-editors-and-ides/672d45583fd75a504136fbbb.md b/curriculum/challenges/italian/blocks/lecture-working-with-code-editors-and-ides/672d45583fd75a504136fbbb.md index 79ade8f195f..510894bea7b 100644 --- a/curriculum/challenges/italian/blocks/lecture-working-with-code-editors-and-ides/672d45583fd75a504136fbbb.md +++ b/curriculum/challenges/italian/blocks/lecture-working-with-code-editors-and-ides/672d45583fd75a504136fbbb.md @@ -7,11 +7,11 @@ dashedName: how-to-install-visual-studio-code-onto-your-computer # --description-- -Per installare VS Code, visita il loro sito web per scaricare l’installer adatto al tuo sistema operativo. Assicurati di visitare il sito di VS Code, non quello di Visual Studio. +Per installare VS Code, visita il sito web di VS Code per scaricare l'installer adatto al tuo sistema operativo. Assicurati di visitare il sito di VS Code e non quello di Visual Studio. -Per Windows, puoi scaricare un installer EXE. Una volta scaricato, esegui il file e la procedura guidata ti accompagnerà nell’installazione. +Per Windows, puoi scaricare un installer EXE. Una volta scaricato, esegui il file e la procedura guidata ti accompagnerà durante l'installazione. -Per Mac, puoi scaricare un archivio zip che contiene un `.app` eseguibile. Puoi anche installare VS Code tramite homebrew. +Per Mac, puoi scaricare un archivio `.zip` che contiene una `.app` che puoi eseguire. Puoi anche installare VS Code tramite Homebrew. Apri l’app Terminale sul tuo Mac ed esegui il seguente comando: diff --git a/curriculum/challenges/italian/blocks/lecture-working-with-code-editors-and-ides/672d45651d83b450801efb3a.md b/curriculum/challenges/italian/blocks/lecture-working-with-code-editors-and-ides/672d45651d83b450801efb3a.md index 21eea760435..7d94310a842 100644 --- a/curriculum/challenges/italian/blocks/lecture-working-with-code-editors-and-ides/672d45651d83b450801efb3a.md +++ b/curriculum/challenges/italian/blocks/lecture-working-with-code-editors-and-ides/672d45651d83b450801efb3a.md @@ -9,21 +9,21 @@ dashedName: how-to-create-a-project-and-run-your-code-locally-in-vs-code Per iniziare, devi sapere che VS Code considera i progetti come "workspaces". Lo workspace è la directory che hai aperto in VS Code. -Per cominciare, dovrai usare un'interfaccia a riga di comando per creare una nuova directory per il tuo nuovo progetto. Una directory è un altro nome per cartella. +Per cominciare, dovrai usare un'interfaccia a riga di comando per creare una nuova directory per il tuo nuovo progetto. Una directory è un altro nome per una cartella. -Le interfacce a riga di comando, o CLI in breve, ti permettono di interagire con il sistema operativo tramite comandi testuali. Imparerai di più su questi strumenti nelle prossime lezioni. +Le interfacce a riga di comando, o CLI in breve, ti permettono di interagire con il tuo sistema operativo tramite comandi testuali. Imparerai di più su questi strumenti nelle lezioni future. Se usi Windows, puoi usare il Prompt dei comandi o PowerShell. Se usi un Mac, puoi aprire l'app Terminal. -Una volta aperta la riga di comando, vai alla directory home digitando il comando `cd ~` e premendo `enter` sulla tastiera. Poi digita il comando `mkdir my-project` e premi `enter`. `mkdir`, o "make directory", è il comando usato per creare una nuova directory. Dovresti poi aprire la nuova directory con VS Code. +Una volta aperta la riga di comando, naviga nella tua directory home. Nel Prompt dei comandi, digita `cd /d %USERPROFILE%` e premi `Enter` sulla tastiera. In PowerShell o nel Terminale macOS, digita `cd ~` e premi `Enter`. Poi digita il comando `mkdir my-project` e premi `Enter`. `mkdir`, o "make directory", è il comando usato per creare una nuova directory. Dovresti poi aprire la tua nuova directory con VS Code. -Ci sono anche altri modi grafici per creare una nuova directory. +Ci sono anche altri modi per aprire una directory in VS Code. A seconda del sistema operativo, potresti avere un menu contestuale (o opzione clic destro) per aprire VS Code direttamente dall'esplora file. Potresti anche scegliere di fare doppio clic sull'app VS Code. Se ti senti a tuo agio con la riga di comando, puoi eseguire il comando `code /path/to/folder`. Una volta aperto, dovresti vedere un nuovo workspace vuoto. -Per creare un nuovo file, clicca sul menu `File` in alto a sinistra e seleziona `New File...`. Poi dai un nome al file `index.html` e clicca su `Save`. +Per creare un nuovo file, clicca sul menu `File` nell'angolo in alto a sinistra e seleziona `New File...`. Poi dai al file il nome `index.html` e clicca su `Save`. Ora dovresti vedere il nuovo file nella scheda esplora. Prova ad aggiungere un po' di HTML al file `index.html`. @@ -31,15 +31,15 @@ Ora potresti essere tentato di aprire il file HTML direttamente nel browser. Anc Invece, dovresti mettere il file HTML dietro un vero server web. Questo può sembrare un compito intimidatorio se sei nuovo alla programmazione, ma in realtà c’è un modo per farlo direttamente da VS Code. -Prima devi installare l’estensione _Live Server_, disponibile gratuitamente nel marketplace. +Prima dovrai prendere l'estensione Live Server, che è disponibile gratuitamente nel marketplace. -Clicca sulla scheda delle estensioni nell’angolo in basso a sinistra e digita `Live Server` nella barra di ricerca. +Clicca sulla scheda Estensioni nella barra laterale sinistra e digita `Live Server` nella barra di ricerca. -Una volta installata, dovresti vedere un pulsante `Go live` nella barra di stato. Assicurati di avere aperto il file HTML, poi cliccalo. +Una volta installata, dovresti vedere un pulsante `Go Live` nella barra di stato. Assicurati di avere aperto il tuo file HTML, poi cliccaci sopra. -La tua nuova pagina dovrebbe aprirsi automaticamente in una nuova scheda del browser. Se non succede, puoi andare direttamente a `http://localhost:5500/` +La tua nuova pagina dovrebbe aprirsi automaticamente in una nuova scheda del browser. Se non succede, puoi andare direttamente a `http://localhost:5500/`. -Congratulazioni! Hai appena configurato il tuo progetto in VS Code e puoi vedere le modifiche con live server. +Congratulazioni! Hai appena configurato il tuo progetto in VS Code e puoi vedere le tue modifiche con Live Server. # --questions-- @@ -57,7 +57,7 @@ La lezione spiega come VS Code definisce uno workspace in relazione alle directo --- -La directory da cui hai aperto VS Code. +La directory che hai aperto in VS Code. --- diff --git a/curriculum/challenges/italian/blocks/lecture-working-with-code-editors-and-ides/672d456f4ac35950b300e93f.md b/curriculum/challenges/italian/blocks/lecture-working-with-code-editors-and-ides/672d456f4ac35950b300e93f.md index 0ae8026551b..abe11ae25b0 100644 --- a/curriculum/challenges/italian/blocks/lecture-working-with-code-editors-and-ides/672d456f4ac35950b300e93f.md +++ b/curriculum/challenges/italian/blocks/lecture-working-with-code-editors-and-ides/672d456f4ac35950b300e93f.md @@ -9,21 +9,21 @@ dashedName: what-are-several-useful-keyboard-shortcuts-for-maximizing-productivi Probabilmente conosci già alcune delle scorciatoie di base, che derivano dal tuo sistema operativo. Scorciatoie come `Ctrl + S` per salvare, `Ctrl + C` per copiare e `Ctrl + V` per incollare funzionano tutte in VS Code. -Ma ce ne sono alcune specifiche dell’applicazione che possono comunque aumentare la tua produttività. Vale la pena notare che alcune di queste scorciatoie possono variare a seconda del sistema operativo. +Ma ci sono alcune scorciatoie specifiche dell'applicazione che possono comunque aumentare la tua produttività. Vale la pena notare che alcune di queste scorciatoie possono variare a seconda del sistema operativo. -Per esempio, `Shift + Alt + F` eseguirà il formatter configurato (come prettier, per un progetto JavaScript) sul file attualmente aperto. +Ad esempio, `Shift + Alt + F` eseguirà il formatter configurato (come Prettier, per un progetto JavaScript) sul file attualmente aperto. -Oppure `Ctrl + Shift + F` (Windows), o `Cmd + Shift + F` (Mac), per cercare il contenuto testuale di tutti i file nel tuo workspace. Poi `Ctrl + Shift + H` (Windows), o `Cmd + Shift + H` (Mac), se vuoi eseguire una ricerca e sostituzione. +Usa `Ctrl + Shift + F` (Windows/Linux) o `Cmd + Shift + F` (macOS) per cercare il contenuto testuale di tutti i file nel tuo workspace. Poi usa `Ctrl + Shift + H` (Windows/Linux) o `Cmd + Shift + H` (macOS) se vuoi eseguire una ricerca e sostituzione. -Se devi eliminare una riga, `Ctrl + Shift + K` (Windows), o `Cmd + Shift + K` (Mac), la cancellerà. +Se hai bisogno di eliminare una riga, `Ctrl + Shift + K` (Windows/Linux) o `Cmd + Shift + K` (macOS) la cancellerà. -Ti serve più spazio per tutto il tuo codice? `Ctrl + B` (Windows), o `Cmd + B` (Mac), nasconderà la barra laterale — che contiene la lista dei file e il menu delle estensioni. +Ti serve più spazio per tutto il tuo codice? `Ctrl + B` (Windows) o `Cmd + B` (Mac) nasconderà la barra laterale, che contiene la lista dei file e il menu delle estensioni. -O magari non riesci proprio a vedere il tuo codice? `Ctrl + plus` (Windows), o `Cmd + plus` (Mac), aumenterà la scala dell’editor, mentre `Ctrl + minus` (Windows), o `Cmd + minus` (Mac), la ridurrà. +O forse non riesci proprio a vedere il tuo codice? `Ctrl + Plus` (Windows) o `Cmd + Plus` (Mac) aumenterà la scala dell'editor, mentre `Ctrl + Minus` (Windows) o `Cmd + Minus` (Mac) la ridurrà. -Un’altra funzionalità utile in VS Code è la modifica multipla di righe, che ti permette di fare cambiamenti su più righe contemporaneamente. Per esempio, puoi posizionare più cursori usando `Ctrl + Alt + down` e `Ctrl + Alt + up` (Windows/Linux), o `Option + Command + down` e `Option + Command + up` (Mac), per estendere il cursore su righe consecutive. Puoi anche tenere premuto `Alt` (Windows/Linux) o `Option` (Mac) e cliccare per aggiungere cursori su righe separate dove ti servono. Una volta posizionati i cursori, tutto quello che digiti o elimini si applicherà simultaneamente a tutte quelle posizioni — il che può farti risparmiare molto tempo quando lavori con codice ripetitivo. +Un'altra funzionalità utile in VS Code è la modifica multipla su più righe, che ti permette di fare cambiamenti su diverse righe contemporaneamente. Ad esempio, puoi posizionare più cursori usando `Ctrl + Alt + Down` e `Ctrl + Alt + Up` (Windows/Linux) o `Option + Cmd + Down` e `Option + Cmd + Up` (Mac) per estendere il cursore su righe consecutive. Puoi anche tenere premuto `Alt` (Windows/Linux) o `Option` (Mac) e cliccare per aggiungere cursori su righe separate dove ti servono. Una volta posizionati i cursori, tutto ciò che digiti o elimini si applicherà simultaneamente a tutte quelle posizioni — il che può farti risparmiare molto tempo quando lavori con codice ripetitivo. -Infine, se dimentichi una di queste scorciatoie, hai sempre `Ctrl + Shift + P` (Windows), o `Cmd + Shift + P` (Mac), che apre la command palette per selezionare qualsiasi cosa ti serva. +Infine, se dimentichi una di queste scorciatoie, hai sempre `Ctrl + Shift + P` (Windows/Linux) o `Cmd + Shift + P` (macOS), che apre la command palette per selezionare tutto ciò di cui potresti aver bisogno. Con queste conoscenze, e magari un po’ di pratica, sei sulla buona strada per diventare un utente esperto di VS Code. diff --git a/curriculum/challenges/italian/blocks/lecture-working-with-code-editors-and-ides/672d457bcdd8b350ec2b6254.md b/curriculum/challenges/italian/blocks/lecture-working-with-code-editors-and-ides/672d457bcdd8b350ec2b6254.md index d050f27ef63..38f312692da 100644 --- a/curriculum/challenges/italian/blocks/lecture-working-with-code-editors-and-ides/672d457bcdd8b350ec2b6254.md +++ b/curriculum/challenges/italian/blocks/lecture-working-with-code-editors-and-ides/672d457bcdd8b350ec2b6254.md @@ -7,25 +7,25 @@ dashedName: what-are-some-good-vs-code-extensions-you-can-use-in-your-editor # --description-- -_Better Comments_ è un’estensione che offre un’evidenziazione speciale per specifici commenti nel codice. Per esempio, segnala i commenti "TODO", così come la sintassi per indicare domande o avvisi. +Better Comments è un'estensione che offre un'evidenziazione speciale per specifici commenti nel codice. Per esempio, segnala i commenti "TODO", così come la sintassi per indicare domande o avvisi. -_Code Spell Checker_ segnala quando hai scritto qualcosa in modo errato nel tuo codice. Poiché è progettata per i file di codice, tiene conto di cose come il camel case. +Code Spell Checker segnala le parole scritte in modo errato nel tuo codice. Poiché è progettato per i file di codice, tiene conto di elementi come il camel case. -_Error Lens_ ti aiuta a individuare gli errori evidenziati nel tuo codice. Invece di dover fare affidamento sulla sottolineatura che VS Code mostra per impostazione predefinita, questa estensione evidenzia l’intera riga e mostra il messaggio di errore. +Error Lens rende gli errori nel tuo codice più difficili da non notare. Invece di dover fare affidamento sulla sottolineatura che VS Code mostra per impostazione predefinita, questa estensione evidenzia l'intera riga e mostra il messaggio di errore. -_Indent Rainbow_ aggiunge colore ai diversi livelli di indentazione. In combinazione con la colorazione nativa delle coppie di parentesi di VS Code, questo può aiutare molto a identificare in quale ambito si trova il tuo codice. +Indent Rainbow aggiunge colore ai diversi livelli di indentazione. In combinazione con la colorazione nativa delle coppie di parentesi di VS Code, questo può aiutare notevolmente a identificare in quale ambito si trova il tuo codice. -O forse stai cercando qualcosa di un po’ più pratico? Considera un assistente AI, come _GitHub Copilot_ o _Tabnine_, che ti offre suggerimenti in linea mentre scrivi il codice. +O forse stai cercando qualcosa di un po' più pratico? Considera un assistente AI, come GitHub Copilot o Tabnine, che ti offre suggerimenti in linea mentre scrivi il tuo codice. -Un pacchetto di icone, come _VS Code Great Icons_, può aiutarti a rendere il tuo albero dei file più pulito e facile da interpretare a colpo d’occhio. E un’estensione come _Colorize_ può aiutarti a capire i valori nelle proprietà CSS. +Un pacchetto di icone, come VS Code Great Icons, può aiutarti a rendere il tuo albero dei file più pulito e facile da interpretare a colpo d'occhio. E un'estensione come Colorize può aiutarti a capire i valori nelle proprietà CSS. -Vorrai anche estensioni specifiche per il linguaggio dei tuoi progetti. Se usi JavaScript, probabilmente vorrai _ESLint_ e _Prettier_ per fare il linting e formattare il codice. Se usi TypeScript, potresti voler _Pretty TypeScript Errors_ per messaggi più facili da leggere. +Vorrai anche estensioni specifiche per linguaggio per i tuoi progetti. Se usi JavaScript, probabilmente vorrai ESLint e Prettier per lintare e formattare il tuo codice. Se usi TypeScript, potresti voler Pretty TypeScript Errors per messaggi più facili da leggere. -Infine, puoi anche divertirti un po’ con il tuo editor. _VS Code Pets_ offre animali virtuali configurabili che ti tengono compagnia mentre risolvi qualche bug. +Infine, puoi anche divertirti un po' con il tuo editor. VS Code Pets offre animali virtuali configurabili che ti tengono compagnia mentre risolvi qualche bug. -_Power Mode_ crea effetti vistosi quando raggiungi un “combo” abbastanza alto scrivendo più codice. +Power Mode crea effetti vistosi quando raggiungi un "combo" abbastanza alto scrivendo più codice. -_Discord Presence_ ti permette di mostrare a tutti i tuoi amici su cosa stai lavorando. +Discord Presence ti permette di mostrare a tutti i tuoi amici su cosa stai lavorando. E ci sono molte altre estensioni là fuori. Sentiti libero di esplorare il marketplace delle estensioni e vedere cosa funziona meglio per te. @@ -33,7 +33,7 @@ E ci sono molte altre estensioni là fuori. Sentiti libero di esplorare il marke ## --text-- -Quale funzionalità offre l’estensione "Better Comments" in VS Code? +Quale funzionalità offre l'estensione Better Comments in VS Code? ## --answers-- @@ -69,7 +69,7 @@ La lezione spiega come questa estensione influisce su certi tipi di commenti. ## --text-- -Quale estensione di VS Code è descritta come utile per individuare errori evidenziati nel codice mostrando il messaggio di errore sull’intera riga? +Quale estensione di VS Code evidenzia l'intera riga e mostra il messaggio di errore in linea, invece di affidarsi alla sottolineatura predefinita? ## --answers-- @@ -105,7 +105,7 @@ La lezione menziona un’estensione che migliora la visibilità degli errori olt ## --text-- -Quale caratteristica unica offre l’estensione "VS Code Pets"? +Quale funzionalità unica offre l'estensione VS Code Pets? ## --answers-- diff --git a/curriculum/challenges/italian/blocks/lecture-working-with-css-flexbox/672aa7f7284b235f46f7d4e9.md b/curriculum/challenges/italian/blocks/lecture-working-with-css-flexbox/672aa7f7284b235f46f7d4e9.md index 658b9d95292..96eeff8e422 100644 --- a/curriculum/challenges/italian/blocks/lecture-working-with-css-flexbox/672aa7f7284b235f46f7d4e9.md +++ b/curriculum/challenges/italian/blocks/lecture-working-with-css-flexbox/672aa7f7284b235f46f7d4e9.md @@ -319,7 +319,7 @@ L’asse principale è sempre orizzontale, mentre l’asse trasversale è sempre ### --feedback-- -Pensa alla distribuzione degli elementi all’interno di un contenitore flex. +Pensa a come l'asse principale e l'asse trasversale sono posizionati l'uno rispetto all'altro. --- @@ -327,7 +327,7 @@ L’asse principale è sempre verticale, mentre l’asse trasversale è sempre o ### --feedback-- -Pensa alla distribuzione degli elementi all’interno di un contenitore flex. +Pensa a come l'asse principale e l'asse trasversale sono posizionati l'uno rispetto all'altro. --- @@ -339,7 +339,7 @@ L’asse principale e l’asse trasversale sono sempre paralleli tra loro. ### --feedback-- -Pensa alla distribuzione degli elementi all’interno di un contenitore flex. +Pensa a come l'asse principale e l'asse trasversale sono posizionati l'uno rispetto all'altro. ## --video-solution-- diff --git a/curriculum/challenges/italian/blocks/lecture-working-with-css-flexbox/672bd658c0e190f674a5e057.md b/curriculum/challenges/italian/blocks/lecture-working-with-css-flexbox/672bd658c0e190f674a5e057.md index ff06da31e89..d8d1eb11153 100644 --- a/curriculum/challenges/italian/blocks/lecture-working-with-css-flexbox/672bd658c0e190f674a5e057.md +++ b/curriculum/challenges/italian/blocks/lecture-working-with-css-flexbox/672bd658c0e190f674a5e057.md @@ -7,11 +7,11 @@ dashedName: what-are-some-common-flex-properties # --interactive-- -Le proprietà flex sono proprietà che puoi applicare ai contenitori flex per determinare la distribuzione degli elementi figli. Vedremo alcune delle più comunemente usate: `flex-wrap`, `justify-content` e `align-items`. +Le proprietà flex controllano come gli elementi si comportano all'interno di un layout flex, dalla distribuzione a livello di contenitore all'autoallineamento a livello di elemento. In questa lezione vedremo alcune delle più comunemente usate: `flex-wrap`, `flex-flow`, `justify-content`, `align-items` e `align-self`. Iniziamo con `flex-wrap`. Questa proprietà determina come gli elementi flex vengono avvolti all'interno di un contenitore flex per adattarsi allo spazio disponibile. `flex-wrap` può assumere tre valori possibili: `nowrap`, `wrap` e `wrap-reverse`. `nowrap` è il valore predefinito: gli elementi flex non verranno avvolti su una nuova riga, anche se la loro larghezza supera quella del contenitore. -Nel codice qui sotto, abbiamo tre elementi `div`. Concentrati sul `width`. Il contenitore `main` bordato di rosso ha un `width` di `200px`, mentre i suoi tre elementi figli `div` combinati hanno un `width` di `240px` (`80px` ciascuno): +Nel codice qui sotto, abbiamo tre elementi `div`. Concentrati sulla `width`. Il contenitore `main` con bordo ha una `width` di `200px`, mentre i suoi tre elementi `div` figli combinati hanno una `width` di `240px` (`80px` ciascuno): :::interactive_editor @@ -28,7 +28,7 @@ Nel codice qui sotto, abbiamo tre elementi `div`. Concentrati sul `width`. Il co main { width: 200px; display: flex; - border: 2px solid red; + border: 2px solid #444; } div { @@ -51,7 +51,6 @@ div { ::: - La larghezza degli elementi `div` supera quella del loro contenitore, ma per impostazione predefinita verranno ridotti per adattarsi allo spazio disponibile. Se vuoi invece avvolgerli quando superano la larghezza del contenitore, puoi impostare `flex-wrap: wrap` sul contenitore flex: :::interactive_editor @@ -70,7 +69,7 @@ main { width: 200px; display: flex; flex-wrap: wrap; - border: 2px solid red; + border: 2px solid #444; } div { @@ -109,9 +108,10 @@ Gli elementi `div` verranno riorganizzati in righe quando superano la larghezza ```css main { width: 200px; + height: 120px; display: flex; flex-flow: column wrap-reverse; - border: 2px solid red; + border: 2px solid #444; } div { @@ -151,7 +151,7 @@ Ottimo. Ora parliamo di `justify-content`. `justify-content` allinea gli element main { display: flex; justify-content: flex-start; - border: 2px solid red; + border: 2px solid #444; } div { @@ -191,7 +191,7 @@ Con `justify-content: flex-end`, gli elementi flex sono allineati alla fine dell main { display: flex; justify-content: flex-end; - border: 2px solid red; + border: 2px solid #444; } div { @@ -231,7 +231,7 @@ Per centrare gli elementi flex lungo l'asse principale, puoi usare `justify-cont main { display: flex; justify-content: center; - border: 2px solid red; + border: 2px solid #444; } div { @@ -254,7 +254,7 @@ div { ::: -Per distribuire gli elementi in modo uniforme lungo l'asse principale, puoi usare `justify-content: space-between`. Questo aggiungerà dello spazio tra gli elementi flex se necessario. +Per distribuire gli elementi lungo l'asse principale senza spazi ai bordi, puoi usare `justify-content: space-between`. Il primo elemento si posiziona all'inizio dell'asse principale, l'ultimo alla fine, e lo spazio rimanente viene distribuito tra gli elementi adiacenti. :::interactive_editor @@ -271,7 +271,7 @@ Per distribuire gli elementi in modo uniforme lungo l'asse principale, puoi usar main { display: flex; justify-content: space-between; - border: 2px solid red; + border: 2px solid #444; } div { @@ -294,7 +294,7 @@ div { ::: -`justify-content: space-around` distribuisce gli elementi flex in modo uniforme all'interno dell'asse principale, aggiungendo uno spazio prima del primo elemento e dopo l'ultimo. Questo spazio aggiuntivo è la metà dello spazio tra ogni coppia di elementi adiacenti. Se c'è un solo elemento da distribuire, sarà centrato. +`justify-content: space-around` distribuisce gli elementi flex in modo uniforme lungo l'asse principale, aggiungendo uno spazio prima del primo elemento e dopo l'ultimo. Questo spazio aggiuntivo è la metà dello spazio tra ogni coppia di elementi adiacenti. Se c'è un solo elemento da distribuire, sarà centrato. :::interactive_editor @@ -311,7 +311,7 @@ div { main { display: flex; justify-content: space-around; - border: 2px solid red; + border: 2px solid #444; } div { @@ -334,8 +334,7 @@ div { ::: - -E infine, ma non meno importante, abbiamo `justify-content: space-evenly`, che distribuisce gli elementi in modo uniforme lungo l'asse principale. Lo spazio tra gli elementi e lo spazio prima e dopo il primo e l'ultimo elemento sono esattamente uguali: +E infine, `justify-content: space-evenly` distribuisce gli elementi in modo uniforme lungo l'asse principale. Lo spazio tra gli elementi e lo spazio prima e dopo il primo e l'ultimo elemento sono esattamente uguali: :::interactive_editor @@ -352,7 +351,7 @@ E infine, ma non meno importante, abbiamo `justify-content: space-evenly`, che d main { display: flex; justify-content: space-evenly; - border: 2px solid red; + border: 2px solid #444; } div { @@ -390,10 +389,10 @@ Ottimo. Ora sai come distribuire gli elementi flex lungo l'asse principale. Ma p ```css main { - height: 300px; display: flex; + height: 300px; align-items: center; - border: 2px solid red; + border: 2px solid #444; } div { @@ -431,10 +430,10 @@ In questo esempio, gli elementi flex sono centrati lungo l'asse trasversale, che ```css main { - height: 300px; display: flex; + height: 300px; align-items: flex-start; - border: 2px solid red; + border: 2px solid #444; } div { @@ -472,10 +471,10 @@ L'opposto è `align-items: flex-end`. Questo allineerà gli elementi flex alla f ```css main { - height: 300px; display: flex; + height: 300px; align-items: flex-end; - border: 2px solid red; + border: 2px solid #444; } div { @@ -498,33 +497,43 @@ div { ::: -Per allungare gli elementi flex lungo l'asse trasversale, puoi usare `align-items: stretch`. Questo funziona anche con elementi che hanno dimensioni automatiche, come quelli senza `width` o `height` impostati, o con solo un `width` o `height` minimo. Gli elementi flex si allungheranno per riempire il contenitore nella direzione dell'asse trasversale. +Per estendere gli elementi flex lungo l'asse trasversale, puoi usare `align-items: stretch`. Questo interessa solo gli elementi la cui dimensione sull'asse trasversale è `auto`; gli elementi con una dimensione esplicita sull'asse trasversale (ad esempio, un `height` impostato in un contenitore a riga) non si estenderanno. Gli elementi interessati riempiranno il contenitore nella direzione dell'asse trasversale. :::interactive_editor ```html <link rel="stylesheet" href="styles.css"> - -<div class="container"> - <div class="box">One</div> - <div class="box">Two</div> - <div class="box">Three</div> -</div> - +<main> + <div id="first-div"></div> + <div id="second-div"></div> + <div id="third-div"></div> +</main> ``` ```css -.container { +main { display: flex; - align-items: stretch; + height: 300px; + align-items: stretch; border: 2px solid #444; - height: 200px; } -.box { - width: 100px; - border: 1px solid #888; - background-color: lightblue; +div { + width: 80px; + height: 50px; +} + +#first-div { + background-color: #4d70b2; +} + +#second-div { + background-color: #5c4db2; +} + +#third-div { + background-color: #4da3b2; + height: auto; } ``` @@ -536,33 +545,37 @@ E infine, puoi usare la proprietà `align-self` per assegnare un allineamento di ```html <link rel="stylesheet" href="styles.css"> - -<div class="container"> - <div class="box">One</div> - <div class="box">Two</div> - <div class="box special">Three</div> -</div> - +<main> + <div id="first-div"></div> + <div id="second-div"></div> + <div id="third-div"></div> +</main> ``` ```css -.container { +main { display: flex; - align-items: flex-start; + height: 300px; + align-items: flex-start; border: 2px solid #444; - height: 200px; } -.box { - width: 100px; - border: 1px solid #888; - background-color: lightblue; - margin: 4px; +div { + width: 80px; + height: 50px; } -.special { - align-self: stretch; - background-color: lightcoral; +#first-div { + background-color: #4d70b2; +} + +#second-div { + background-color: #5c4db2; +} + +#third-div { + background-color: #4da3b2; + align-self: stretch; } ``` @@ -574,33 +587,37 @@ Puoi centrarlo con `align-self: center`. ```html <link rel="stylesheet" href="styles.css"> - -<div class="container"> - <div class="box">One</div> - <div class="box">Two</div> - <div class="box special">Three</div> -</div> - +<main> + <div id="first-div"></div> + <div id="second-div"></div> + <div id="third-div"></div> +</main> ``` ```css -.container { +main { display: flex; - align-items: flex-start; + height: 300px; + align-items: flex-start; border: 2px solid #444; - height: 200px; } -.box { - width: 100px; - border: 1px solid #888; - background-color: lightblue; - margin: 4px; +div { + width: 80px; + height: 50px; +} + +#first-div { + background-color: #4d70b2; +} + +#second-div { + background-color: #5c4db2; } -.special { - align-self: center; - background-color: lightcoral; +#third-div { + background-color: #4da3b2; + align-self: center; } ``` @@ -612,33 +629,37 @@ Puoi allinearlo all'inizio dell'asse trasversale con `align-self: flex-start`. ```html <link rel="stylesheet" href="styles.css"> - -<div class="container"> - <div class="box">One</div> - <div class="box">Two</div> - <div class="box special">Three</div> -</div> - +<main> + <div id="first-div"></div> + <div id="second-div"></div> + <div id="third-div"></div> +</main> ``` ```css -.container { +main { display: flex; - align-items: flex-start; + height: 300px; + align-items: flex-start; border: 2px solid #444; - height: 200px; } -.box { - width: 100px; - border: 1px solid #888; - background-color: lightblue; - margin: 4px; +div { + width: 80px; + height: 50px; +} + +#first-div { + background-color: #4d70b2; } -.special { - align-self: flex-start; - background-color: lightcoral; +#second-div { + background-color: #5c4db2; +} + +#third-div { + background-color: #4da3b2; + align-self: flex-start; } ``` @@ -650,39 +671,43 @@ Oppure puoi allinearlo alla fine dell'asse trasversale con `align-self: flex-end ```html <link rel="stylesheet" href="styles.css"> - -<div class="container"> - <div class="box">One</div> - <div class="box">Two</div> - <div class="box special">Three</div> -</div> - +<main> + <div id="first-div"></div> + <div id="second-div"></div> + <div id="third-div"></div> +</main> ``` ```css -.container { +main { display: flex; - align-items: flex-start; + height: 300px; + align-items: flex-start; border: 2px solid #444; - height: 200px; } -.box { - width: 100px; - border: 1px solid #888; - background-color: lightblue; - margin: 4px; +div { + width: 80px; + height: 50px; } -.special { - align-self: flex-end; - background-color: lightcoral; +#first-div { + background-color: #4d70b2; +} + +#second-div { + background-color: #5c4db2; +} + +#third-div { + background-color: #4da3b2; + align-self: flex-end; } ``` ::: -Ci sono altre proprietà e valori flex tra cui scegliere per creare il layout responsivo che immagini, ma queste sono le più comunemente usate. Con queste proprietà CSS flex e la tua nuova conoscenza del modello flex CSS, puoi iniziare a creare layout responsivi per offrire un'esperienza utente fluida e inclusiva su tutti i dispositivi. +Ci sono altre proprietà e valori flex tra cui puoi scegliere per creare il layout responsivo che immagini, ma questi sono i più comunemente usati. Con queste proprietà CSS flex e la tua nuova conoscenza del modello flex CSS, puoi iniziare a creare layout responsivi per offrire un'esperienza utente fluida e inclusiva su tutti i dispositivi. # --questions-- @@ -764,7 +789,7 @@ Quali delle seguenti proprietà possono essere combinate nella proprietà `flex- ## --answers-- -`flex-direction` e `justify-content`. +`flex-direction` e `justify-content` ### --feedback-- @@ -772,7 +797,7 @@ Pensa ai due aspetti principali di come gli elementi flex sono disposti. --- -`flex-direction` e `align-items`. +`flex-direction` e `align-items` ### --feedback-- @@ -780,7 +805,7 @@ Pensa ai due aspetti principali di come gli elementi flex sono disposti. --- -`flex-direction` e `align-content`. +`flex-direction` e `align-content` ### --feedback-- @@ -788,7 +813,7 @@ Pensa ai due aspetti principali di come gli elementi flex sono disposti. --- -`flex-direction` e `flex-wrap`. +`flex-direction` e `flex-wrap` ## --video-solution-- diff --git a/curriculum/challenges/italian/blocks/lecture-working-with-css-fonts/672bd814105a0ffcf36f9233.md b/curriculum/challenges/italian/blocks/lecture-working-with-css-fonts/672bd814105a0ffcf36f9233.md index 55033a608b0..836ec47b80e 100644 --- a/curriculum/challenges/italian/blocks/lecture-working-with-css-fonts/672bd814105a0ffcf36f9233.md +++ b/curriculum/challenges/italian/blocks/lecture-working-with-css-fonts/672bd814105a0ffcf36f9233.md @@ -1,6 +1,6 @@ --- id: 672bd814105a0ffcf36f9233 -title: What Are Font Families and How Do They Work? +title: Cosa sono le famiglie di caratteri tipografici e come funzionano? challengeType: 19 dashedName: what-are-font-families --- @@ -11,6 +11,8 @@ Una famiglia di caratteri tipografici è un gruppo di caratteri che condividono <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/what-are-font-families-and-how-do-they-work-1.png" alt="Diagram showing 'Arial' at the top with two blue arrows pointing down to 'Arial Bold' on the left and 'Arial Italic' on the right, illustrating font family variations" /> +## Impostare le famiglie di caratteri tipografici in CSS + In CSS, puoi impostare la famiglia di caratteri con la proprietà `font-family`. Ecco un esempio di come impostare il carattere per il paragrafo su `Arial`: :::interactive_editor @@ -29,6 +31,8 @@ In CSS, puoi impostare la famiglia di caratteri con la proprietà `font-family`. ::: +## Caratteri tipografici di fallback + Ma cosa succede se la famiglia di caratteri non viene trovata? Puoi specificare più famiglie di caratteri in ordine di priorità, dalla più alta alla più bassa, separandole con delle virgole. Questi caratteri alternativi agiranno come opzioni di fallback. In questo esempio, Arial è il carattere principale e Lato è un carattere alternativo: :::interactive_editor @@ -51,12 +55,14 @@ Il browser renderizzerà il primo carattere (Arial) se è presente sul dispositi Devi anche sapere come funziona questo processo dietro le quinte. La selezione non si ferma se il primo carattere è disponibile. La famiglia di caratteri viene scelta un carattere alla volta, quindi se un carattere manca in un font, il browser lo cerca nei font con priorità più bassa. Interessante, vero? +## Famiglie di caratteri tipografici generiche + Nel contesto dello sviluppo web, troverai anche famiglie di caratteri generiche. Sono molto importanti. Una famiglia di caratteri generica è un carattere predefinito che i browser web renderizzeranno quando i caratteri con priorità più alta non sono disponibili. Per assicurare che il contenuto sia comunque leggibile, il browser sostituisce il carattere originale con il carattere più appropriato trovato, basandosi sulla famiglia di caratteri generica specificata. Alcune delle più comuni sono: - serif - sans-serif - monospace -- cursive +- corsivo - fantasy Ma ci sono altre opzioni tra cui scegliere. Nel codice qui sotto, abbiamo tre famiglie di caratteri alternative: @@ -81,6 +87,8 @@ Arial ha la priorità più alta. Se Arial non viene trovato, il browser proverà Dovresti sempre includere una famiglia di caratteri generica alla fine della lista di font-family. Tieni presente che il carattere generico potrebbe apparire diverso dal carattere che avevi immaginato nel tuo design, quindi è sempre utile verificare come appaiono questi font di fallback su diversi browser. +## Caratteri tipografici sicuri per il web + Per rendere l’esperienza utente il più coerente possibile, è anche consigliato usare caratteri web-safe. Queste famiglie di caratteri sono solitamente installate sulla maggior parte dei dispositivi, quindi è molto probabile che vengano trovate e renderizzate correttamente per la maggior parte degli utenti. Ne imparerai di più nelle prossime lezioni. Le famiglie di caratteri sono essenziali nel mondo del design web. Usando la proprietà font-family, puoi trasformare istantaneamente l’aspetto e la sensazione del tuo testo. diff --git a/curriculum/challenges/italian/blocks/lecture-working-with-css-fonts/672bd8453d1371fdb1510fe5.md b/curriculum/challenges/italian/blocks/lecture-working-with-css-fonts/672bd8453d1371fdb1510fe5.md index e9fc06e54ed..712be0dbf69 100644 --- a/curriculum/challenges/italian/blocks/lecture-working-with-css-fonts/672bd8453d1371fdb1510fe5.md +++ b/curriculum/challenges/italian/blocks/lecture-working-with-css-fonts/672bd8453d1371fdb1510fe5.md @@ -11,6 +11,8 @@ Un font esterno è un file di font che non è incluso direttamente nei file del Google Fonts e Font Squirrel sono risorse online popolari per trovare e usare font gratuiti per progetti di sviluppo web. Puoi incorporarli nei tuoi progetti molto facilmente. +## Google Fonts + Iniziamo con Google Fonts. Questo è un servizio di Google che offre una raccolta di font, molti dei quali sono progettati specificamente per lo sviluppo web. Nell’interfaccia utente di Google Fonts puoi vedere molti elementi diversi. Vediamoli uno per uno. Nella barra laterale sinistra troverai: - Una sezione per vedere, trovare e filtrare i font. @@ -18,6 +20,8 @@ Iniziamo con Google Fonts. Questo è un servizio di Google che offre una raccolt - Una sezione dove puoi trovare e scaricare icone per i tuoi progetti web. - Una sezione dove puoi imparare di più sui font e sulle loro buone pratiche, seguita da domande frequenti. +## Anteprima di Google Fonts + Per aggiungere un Google Font al tuo sito web, devi andare alla prima sezione (Fonts). Puoi personalizzare il testo di anteprima nella barra laterale sinistra, dove c’è scritto "Preview". Basta scrivere il testo che vuoi vedere e si aggiornerà automaticamente. Questo è utile per vedere in anteprima il font con il testo che hai già in mente per il tuo sito. Puoi anche regolare la dimensione del font e filtrare i font in base alle loro caratteristiche. <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-1.png" alt="Google Fonts Fonts section showing a left sidebar with preview text set to 'freeCodeCamp' at 40px, filter options for Language, Technology, and Decorative stroke, and the main panel listing font families including Roboto, SUSE, and Sevillana each previewing 'freeCodeCamp'" /> @@ -28,12 +32,16 @@ Puoi personalizzare la dimensione del testo di anteprima con il cursore blu acca <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-2.png" alt="Google Fonts Roboto Styles page with Specimen, Type tester, Glyphs, and About & license tabs, a blue Get font button, a preview text field showing 'freeCodeCamp' with a font size slider at 48px, and a list of styles including Thin 100, Thin 100 Italic, Light 300, and Light 300 Italic" /> +## Usare Google Fonts + Quando sei pronto per aggiungere il font al tuo progetto, clicca sul pulsante blu "Get font" in alto. Verrai portato a una pagina di riepilogo dove vedrai i font che hai selezionato. Puoi selezionare più font contemporaneamente. <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-3.png" alt="Google Fonts page showing '1 font family selected' with Roboto Static listed, Get embed code and Download all buttons on the right, and a How to use section with All, Design, Develop, and Google products tabs" /> Poi devi scegliere se vuoi scaricare i file del font per aggiungerli al progetto come file locali oppure se preferisci usarli come font esterni e scaricarli dai server di Google quando un utente visita il tuo sito. Clicca su "Download all" se vuoi scaricarli, ma se preferisci usarli come font esterni sui server di Google, clicca su "Get embed code". Se clicchi su "Get embed code", vedrai le istruzioni da seguire per aggiungere questi font esterni al tuo progetto. +### Collegare Google Fonts + Per i progetti di sviluppo web, hai due opzioni. Puoi usare un elemento `link` oppure `@import`. Se scegli l’opzione elemento `link`, puoi copiare e incollare lo snippet HTML e le regole CSS per aggiungerli al progetto. Devi incorporare il codice nell’elemento `head` del tuo file HTML e aggiungere le regole CSS che ti servono. <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-4.png" alt="Google Fonts Embed code page with the link element option selected, showing three link tags for preconnect and the font stylesheet, a CSS classes section with .roboto-thin, .roboto-light, .roboto-regular, and .roboto-medium rules, and a left sidebar showing font style toggles" /> @@ -141,6 +149,8 @@ Ecco un esempio che usa tutti gli stili di Roboto: C’è una regola CSS per ogni stile di font. Ogni regola assegna i font personalizzati con font di fallback nel caso in cui i font personalizzati non vengano caricati correttamente. +### Importare Google Fonts + Se invece scegli l’opzione `@import`, dovrai aggiungere quella regola al tuo file CSS. <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-5.png" alt="Google Fonts Embed code page with the @import option selected, showing a style block containing the @import URL rule, a CSS classes section below, and the left sidebar with font style toggles" /> @@ -159,10 +169,14 @@ Se vuoi includere solo stili di font specifici, puoi anche rimuoverli da questi E questo è Google Fonts. È una delle opzioni più popolari per trovare font gratuiti e open source per progetti di sviluppo web. +## Font Squirrel + Un’altra ottima opzione è Font Squirrel, dove puoi trovare e scaricare i font personalizzati che immagini per il tuo design. <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-7.png" alt="Font Squirrel 'Free Font Utopia' page listing featured free fonts including Acherus Grotesque, Intro Rust, Source Sans Pro, Open Sans, and Questa, each shown with an alphabet specimen and a Download button" /> +## Anteprima di Font Squirrel + Se cerchi un font e clicchi su un risultato, vedrai più dettagli sul font, inclusi campioni, test drive, glifi e Webfont kit. <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-8.png" alt="Font Squirrel search results for 'Roboto' showing three matches: Roboto, Roboto 2014, and Roboto Slab, each with an alphabet specimen and a Download TTF button" /> @@ -173,6 +187,8 @@ Puoi anche vedere esempi dei diversi stili e variazioni del font, come thin, lig <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-10.png" alt="Font Squirrel Roboto Specimens section listing all styles with alphabet samples: Roboto Thin, Thin Italic, Light, Light Italic, Regular, Italic, Medium, Medium Italic, Bold, Bold Italic, and Black, each in its respective weight" /> +## Usare Font Squirrel + Una volta deciso il font che vuoi usare nel progetto, vai alla scheda "Webfont Kit". Qui puoi verificare se la licenza del font ti permette di usarlo in incorporamenti CSS `@font-face`. Puoi anche scegliere il sottoinsieme e il formato. <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-11.png" alt="Font Squirrel Roboto Webfont Kit tab showing a license notice confirming @font-face embedding is allowed, a subset selector set to Western Latin, format checkboxes with WOFF selected, and a Download @font-face Kit button" /> @@ -221,7 +237,7 @@ Selezione e varietà di font ampliata. --- -Migliore compatibilità con i browser. +Migliore compatibilità tra browser. ### --feedback-- diff --git a/curriculum/challenges/italian/blocks/lecture-working-with-css-fonts/672bd853c985cdfdeb32f4f9.md b/curriculum/challenges/italian/blocks/lecture-working-with-css-fonts/672bd853c985cdfdeb32f4f9.md index 345bf4a6cee..c10e8f889b0 100644 --- a/curriculum/challenges/italian/blocks/lecture-working-with-css-fonts/672bd853c985cdfdeb32f4f9.md +++ b/curriculum/challenges/italian/blocks/lecture-working-with-css-fonts/672bd853c985cdfdeb32f4f9.md @@ -13,6 +13,8 @@ Per impostazione predefinita, il CSS non applica ombre al testo. Questo è un es text-shadow: /* Values */ ``` +## I valori di offset `X` e `Y` + In CSS, puoi descrivere un’ombra attraverso una combinazione del suo offset `X`, offset `Y`, raggio di sfocatura e colore. Prima devi specificare l’offset `X` e `Y`, che rappresentano rispettivamente la distanza orizzontale e verticale dell’ombra rispetto al testo. Questi valori sono obbligatori. Ecco un esempio di come applicare un offset `X` e `Y` su un’ombra. Applichiamo la proprietà `text-shadow` con un offset x di `3px` e un offset y di `2px`: @@ -32,7 +34,11 @@ p { ::: -Nel browser, il testo e l’ombra appariranno simili ma possiamo anche personalizzare il colore dell’ombra specificando il valore prima o dopo l’offset. Impostiamo il colore dell’ombra. Qui useremo un colore esadecimale ma puoi usare qualsiasi formato colore valido. +Nel browser, il testo e l'ombra avranno un aspetto simile. + +## Aggiungere un colore all'ombra + +Possiamo anche personalizzare il colore dell'ombra specificando il valore prima o dopo l'offset. Impostiamo il colore dell'ombra. Qui useremo un colore esadecimale ma puoi usare qualsiasi formato colore valido. :::interactive_editor @@ -66,7 +72,11 @@ p { ::: -Nel browser, l’ombra avrà un colore specifico, così possiamo distinguerla facilmente dal testo. Ora che possiamo differenziare l’ombra dal testo, è importante vedere anche come i valori positivi e negativi influenzano l’offset dell’ombra. I valori positivi dell’offset `X` e `Y` sposteranno l’ombra rispettivamente a destra e in basso, mentre i valori negativi la sposteranno a sinistra e in alto. Ecco un esempio che usa valori negativi: +Nel browser, l'ombra avrà un colore specifico, così possiamo distinguerla molto facilmente dal testo. + +## Valori di offset positivi e negativi + +Ora che possiamo distinguere l'ombra dal testo, è importante vedere anche come i valori positivi e negativi influenzano l'offset dell'ombra. I valori positivi dell'offset `X` e `Y` sposteranno l'ombra rispettivamente a destra e in basso, mentre i valori negativi la sposteranno a sinistra e in alto. Ecco un esempio che usa invece valori negativi: :::interactive_editor @@ -83,7 +93,11 @@ p { ::: -Ora l’ombra si sposterà a sinistra e in alto rispetto al testo. Ottimo. Ma l’ombra non sembra molto bella, perché appare esattamente come il testo originale ma posizionata dietro di esso. Per farla sembrare migliore, dobbiamo aggiungere un terzo valore, il raggio di sfocatura. Questo valore è opzionale ma rende l’ombra molto più morbida e sottile. Il valore predefinito del raggio di sfocatura è zero. Più alto è il valore, maggiore è la sfocatura, il che significa che l’ombra diventa più chiara. +Ora l'ombra si sposterà a sinistra e in alto rispetto al testo. Ottimo. + +## Il raggio di sfocatura + +Ma l'ombra non ha un aspetto molto bello, perché sembra esattamente come il testo originale ma posizionata dietro di esso. Per renderla più gradevole, dobbiamo aggiungere un terzo valore, il raggio di sfocatura. Questo valore è opzionale ma rende l'ombra molto più morbida e sottile. Il valore predefinito del raggio di sfocatura è zero. Più alto è il valore, maggiore è la sfocatura, il che significa che l'ombra diventa più chiara. Qui stiamo impostando il raggio di sfocatura a `3px` e torniamo a valori positivi per l’offset: @@ -104,6 +118,8 @@ p { Ora inizia a sembrare un’ombra. È più sfocata e sottile, così possiamo concentrarci sul testo principale mentre l’ombra aggiunge un po’ di stile sullo sfondo. Da qui, possiamo modificare un po’ i valori finché non troviamo una combinazione di offset, colore e raggio di sfocatura che soddisfa le nostre esigenze. +## Aggiungere ombre multiple + È anche utile sapere che il testo può avere più di un’ombra. Devi solo scriverle nella stessa proprietà `text-shadow` separate da virgole. Verranno applicate a strati, dal primo in primo piano all’ultimo sullo sfondo, con la prima ombra in cima. Ecco un esempio di un paragrafo con tre ombre applicate a strati. Nota che tutte queste ombre sono definite nella stessa proprietà `text-shadow` e separate da virgole: diff --git a/curriculum/challenges/italian/blocks/lecture-working-with-css-transforms-overflow-and-filters/672bccc8ea33bad87abb3c56.md b/curriculum/challenges/italian/blocks/lecture-working-with-css-transforms-overflow-and-filters/672bccc8ea33bad87abb3c56.md index b029c415362..20215930d5c 100644 --- a/curriculum/challenges/italian/blocks/lecture-working-with-css-transforms-overflow-and-filters/672bccc8ea33bad87abb3c56.md +++ b/curriculum/challenges/italian/blocks/lecture-working-with-css-transforms-overflow-and-filters/672bccc8ea33bad87abb3c56.md @@ -19,6 +19,8 @@ Questa proprietà può essere impostata sul selettore universale (`*`) per appli Il valore della proprietà `box-sizing` è `content-box` per impostazione predefinita, ma puoi scegliere `border-box` se necessario. Esploreremo prima `content-box` e poi passeremo a `border-box`. +## Revisione del modello a riquadro CSS + Per capire come funzionano i modelli, devi conoscere i quattro concetti fondamentali del modello a riquadro CSS. Facciamo una rapida revisione. - L'area contenuto è lo spazio occupato dal contenuto dell'elemento. @@ -26,6 +28,8 @@ Per capire come funzionano i modelli, devi conoscere i quattro concetti fondamen - Il bordo è il contorno che circonda l'area contenuto e la spaziatura interna. - Il margine è lo spazio esterno al bordo che separa l'elemento dagli altri elementi. +## Come funziona `content-box` + Nel modello `content-box`, la larghezza e l'altezza che imposti per un elemento determinano le dimensioni dell'area contenuto, ma non includono la spaziatura interna, il bordo o il margine. Usa `content-box` quando ti serve un controllo preciso sull'area contenuto. Quando imposti `width` e `height`, stai definendo solo la dimensione del contenuto stesso. Per trovare la larghezza totale dell'elemento, devi aggiungere la spaziatura interna sinistra e destra e i bordi sinistro e destro. Allo stesso modo, l'altezza totale di un elemento si trova sommando l'altezza del contenuto, la spaziatura interna superiore e inferiore e i bordi superiore e inferiore. @@ -52,10 +56,14 @@ div { In questo caso, se si usa `content-box` l'area contenuto sarà di 300px per 200px. La dimensione totale renderizzata include spaziatura interna e bordi — per esempio, larghezza totale = 300px (contenuto) + 40px (spaziatura interna) + 8px (bordi) = 348px; l'altezza totale si calcola allo stesso modo. +## Come funziona `border-box` + Ottimo! Ora esploriamo `border-box`. È diverso perché la larghezza e l'altezza che imposti includono il contenuto dell'elemento, la spaziatura interna e il bordo (ma non il margine). Usa `border-box` quando vuoi che la dimensione totale dell'elemento rimanga fissa anche se cambiano spaziatura interna o bordi — questo è spesso utile nei layout responsivi. Con `border-box`, spaziatura interna e bordi sono inclusi all'interno della dimensione specificata dell'elemento. La `width` e la `height` che imposti diventano le dimensioni totali dell'elemento: contenuto + spaziatura interna + bordo; i margini restano esclusi. +## Confronto tra i due modelli + Nell'esempio seguente, ci sono due elementi `div` con le stesse dimensioni ma valori diversi della proprietà `box-sizing`. Nota come questo comporti dimensioni totali diverse quando li vedi nel browser: :::interactive_editor diff --git a/curriculum/challenges/italian/blocks/lecture-working-with-dates/6733aafb9c0802f66cc1e056.md b/curriculum/challenges/italian/blocks/lecture-working-with-dates/6733aafb9c0802f66cc1e056.md index 41e9fb1f1b5..e2346b01d95 100644 --- a/curriculum/challenges/italian/blocks/lecture-working-with-dates/6733aafb9c0802f66cc1e056.md +++ b/curriculum/challenges/italian/blocks/lecture-working-with-dates/6733aafb9c0802f66cc1e056.md @@ -34,21 +34,31 @@ console.log(now); Per l'orario, usa il formato militare, quindi `14:30` è `2:30 PM`. `GMT-0700` è l'offset del fuso orario, e `Pacific Daylight Time` è il nome del fuso orario. -Puoi anche passare una data e un orario specifici all'oggetto `Date` fornendo come argomenti anno, mese, giorno, ora, minuto, secondo e millisecondo. +Ecco un esempio di creazione di un nuovo `Date` object con una stringa di data specifica: -Ecco un esempio di creazione di un nuovo oggetto `Date` con una data e un orario specifici: +:::interactive_editor + +```js +const dateFromString = new Date("July 4, 1776 12:00:00"); + +console.log(dateFromString); +``` + +::: + +Puoi anche passare una data e un orario specifici al `Date` object fornendo come argomenti l'anno, il mese, il giorno, l'ora, il minuto, il secondo e il millisecondo: :::interactive_editor ```js -const specificDate = new Date("July 4, 1776 12:00:00"); +const dateFromArguments = new Date(1776, 6, 4, 12, 0, 0, 0); -console.log(specificDate); +console.log(dateFromArguments); ``` ::: -Questo è utile quando devi lavorare con una data e un orario specifici invece che con quelli correnti. L'input deve sempre essere una stringa, e il formato deve essere riconoscibile dall'oggetto `Date`. +Questo è utile quando devi lavorare con una data e un orario specifici invece che con la data e l'ora correnti. Per ottenere la data e l'ora correnti, puoi usare il metodo `Date.now()`, che restituisce il numero di millisecondi trascorsi da `January 1, 1970, 00:00:00 UTC`. Questo è noto come tempo epoch Unix. diff --git a/curriculum/challenges/italian/blocks/lecture-working-with-file-systems/672ac403a9ba7732b31c6480.md b/curriculum/challenges/italian/blocks/lecture-working-with-file-systems/672ac403a9ba7732b31c6480.md index e89d72132bb..a7f349f4bcd 100644 --- a/curriculum/challenges/italian/blocks/lecture-working-with-file-systems/672ac403a9ba7732b31c6480.md +++ b/curriculum/challenges/italian/blocks/lecture-working-with-file-systems/672ac403a9ba7732b31c6480.md @@ -51,7 +51,7 @@ Infine, parliamo della documentazione. Nelle applicazioni web, di solito trovera Di solito sono scritti in un formato di file chiamato Markdown. Con Markdown puoi creare documenti strutturati con intestazioni, sottotitoli, collegamenti, immagini, elenchi e altro. I file Markdown hanno un'estensione `.md` o `.markdown`. -Qui puoi trovare il file `README` del repository GitHub di freeCodeCamp: https://github.com/freeCodeCamp/freeCodeCamp/blob/main/README.md +Qui puoi trovare il file `README` del repository GitHub di freeCodeCamp: `https://github.com/freeCodeCamp/freeCodeCamp/blob/main/README.md` Puoi creare questa struttura dettagliata e questo formato usando Markdown. diff --git a/curriculum/challenges/italian/blocks/lecture-working-with-node-core-modules/695cc6a5eefd305381ec90bc.md b/curriculum/challenges/italian/blocks/lecture-working-with-node-core-modules/695cc6a5eefd305381ec90bc.md index 010da18f6e0..2ef5cd188f9 100644 --- a/curriculum/challenges/italian/blocks/lecture-working-with-node-core-modules/695cc6a5eefd305381ec90bc.md +++ b/curriculum/challenges/italian/blocks/lecture-working-with-node-core-modules/695cc6a5eefd305381ec90bc.md @@ -148,7 +148,7 @@ async function readFileContent() { const fileContent = await fs.readFile("article.md", "utf8"); console.log("File content:", fileContent); } catch (err) { - console.log("File read successfully"); + console.error("Error reading file:", err); } } @@ -169,7 +169,7 @@ async function readFileContent() { const fileContent = await fs.readFile("article.md"); console.log("File content:", fileContent); } catch (err) { - console.log("File read successfully"); + console.error("Error reading file:", err); } } @@ -318,3 +318,4 @@ Con parsing JSON, per esempio `fs.parseFile()`. ## --video-solution-- 4 + diff --git a/curriculum/challenges/italian/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d2f232c60f0fa68ef86.md b/curriculum/challenges/italian/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d2f232c60f0fa68ef86.md index 71158d5cb61..27c45a5728a 100644 --- a/curriculum/challenges/italian/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d2f232c60f0fa68ef86.md +++ b/curriculum/challenges/italian/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d2f232c60f0fa68ef86.md @@ -1,6 +1,6 @@ --- id: 68ff6d2f232c60f0fa68ef86 -title: "Cos'è Node e quali sono alcune differenze tra il browser e l'ambiente di esecuzione Node?" +title: "Cos'è Node e quali sono alcune differenze tra l'ambiente di esecuzione del browser e quello di Node?" challengeType: 19 dashedName: what-is-node-and-what-are-some-differences-between-the-browser-and-node-runtime-environment --- @@ -21,9 +21,9 @@ Il JavaScript client-side ha queste limitazioni perché è stato inizialmente pr I browser web forniscono l'ambiente necessario per eseguire codice JavaScript, incluso il motore JavaScript. Offrono anche l'accesso al Document Object Model (DOM), così puoi consultare gli elementi HTML nel tuo codice. -In passato non potevamo eseguire JavaScript al di fuori di un browser, ma ora possiamo farlo con Node.js. +Per molto tempo, JavaScript è stato usato quasi esclusivamente all'interno dei browser, ma con Node.js puoi eseguirlo anche al di fuori di un browser. -Node.js è un ambiente di esecuzione JavaScript. È definito ufficialmente come “un ambiente di esecuzione JavaScript open source e multipiattaforma”. +Node.js è un ambiente di esecuzione JavaScript. È definito ufficialmente come "un ambiente di esecuzione JavaScript open source e multipiattaforma." Vediamo cosa significa: @@ -43,7 +43,7 @@ L'ambiente del browser è progettato principalmente per lo sviluppo front-end, q Per esempio, dal browser puoi consultare l'API DOM, ma ci sono restrizioni per l'accesso al file system locale. Al contrario, dall'ambiente di esecuzione Node puoi consultare quasi tutte le risorse di sistema, incluso il file system, ma non il DOM. -Entrambi gli ambienti JavaScript forniscono un oggetto globale. Nell'ambiente JavaScript del browser, questo si chiama `window`. Questo oggetto `window` fornisce accesso a funzionalità legate al browser, come metodi per manipolare il DOM, gestire i cookie e gestire eventi del browser. Nell'ambiente Node.js, questo oggetto globale si chiama `global`. L'oggetto `global` fornisce accesso a funzionalità specifiche di Node.js, come moduli integrati per lavorare con file locali, networking e interazione con il sistema operativo. +Entrambi gli ambienti JavaScript forniscono un oggetto globale. Nell'ambiente di esecuzione JavaScript del browser, questo si chiama `window`. Questo oggetto `window` consente di consultare funzionalità legate al browser, come metodi per manipolare il DOM, gestire i cookie e gestire gli eventi del browser. Nell'ambiente Node.js, questo oggetto globale si chiama `global`. L'oggetto `global` consente di consultare funzionalità specifiche di Node.js, come i moduli integrati per lavorare con file locali, la rete e l'interazione con il sistema operativo. Infine, un'altra differenza importante è che puoi scegliere la versione di Node.js che vuoi usare nel tuo server. Tuttavia, non hai alcun controllo sulla versione dell'ambiente browser che i tuoi utenti useranno per visitare il tuo sito web. @@ -103,7 +103,7 @@ Pensa ai ruoli e allo scopo di ciascun ambiente. --- -L'ambiente di esecuzione Node usa l'oggetto window come oggetto globale, mentre i browser usano l'oggetto global. +L'ambiente di esecuzione Node usa l'oggetto `window` come oggetto globale, mentre i browser usano l'oggetto `global`. ### --feedback-- diff --git a/curriculum/challenges/italian/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d372ad364f285f0522e.md b/curriculum/challenges/italian/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d372ad364f285f0522e.md index e9677c54fae..4f135fcc7c1 100644 --- a/curriculum/challenges/italian/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d372ad364f285f0522e.md +++ b/curriculum/challenges/italian/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d372ad364f285f0522e.md @@ -1,6 +1,6 @@ --- id: 68ff6d372ad364f285f0522e -title: Quali sono i vantaggi e gli svantaggi di usare Node nel back-end? +title: "Quali sono i vantaggi e gli svantaggi dell'uso di Node nel back-end?" challengeType: 19 dashedName: what-are-the-advantages-and-disadvantages-to-using-node-on-the-back-end --- @@ -11,7 +11,7 @@ Uno dei grandi vantaggi di Node.js è che puoi implementare sia il front-end sia L’architettura di Node è un altro vantaggio. Ha un’architettura non bloccante e basata su eventi, ideale per sviluppare applicazioni in tempo reale, dove la reattività e l’efficienza sono essenziali per creare una buona esperienza utente. -Qui entra in gioco il concetto di “thread”. Un thread è un percorso di esecuzione all’interno di un processo, come un programma per computer che è in esecuzione. +Qui il concetto di "thread" diventa molto importante. Un thread è un percorso di esecuzione all'interno di un processo, cioè un programma per computer che è attualmente in esecuzione. L’architettura di Node si basa su un singolo thread e un event loop che possono gestire efficacemente un gran numero di richieste simultanee e operazioni di input/output. Questo lo rende perfetto per applicazioni che richiedono di gestire più richieste contemporaneamente. @@ -25,13 +25,13 @@ Infine, in termini di costi, Node.js ha il grande vantaggio di essere gratuito e D’altra parte, Node.js ha anche alcuni svantaggi o limitazioni di cui dovresti essere consapevole. -Come hai imparato, esegue solo un thread alla volta, il che significa che può gestire solo un’operazione alla volta. Sebbene la sua architettura gli permetta di essere efficiente nel gestire richieste concorrenti (simultanee), le attività intensive per la CPU possono bloccare il thread principale e causare problemi di prestazioni. +Come hai imparato, esegue il tuo JavaScript su un singolo thread, il che significa che può eseguire solo una parte del tuo codice alla volta. Sebbene la sua architettura gli permetta di essere efficiente nel gestire richieste concorrenti (simultanee), le attività intensive per la CPU possono bloccare il thread principale e causare problemi di prestazioni. Esempi di attività intensive per la CPU includono operazioni matematiche complesse, elaborazione di immagini e video e crittografia. Ci sono modi per superare questo, ma di solito aumentano la complessità dell’applicazione. -Node.js si basa anche sulla programmazione asincrona. Nella programmazione asincrona, un’attività che può richiedere molto tempo per essere eseguita viene avviata, ma invece di aspettare che sia completata, il programma principale continua a funzionare mentre l’attività asincrona procede in parallelo. Quando l’attività è completata, il programma gestisce il risultato. +Nella programmazione asincrona, un'attività che può richiedere molto tempo per essere eseguita viene avviata, ma invece di aspettare che sia completata, il programma principale continua a funzionare mentre l'attività asincrona viene eseguita in background. -Questo processo spesso coinvolge quelle che conosciamo come “callback”, funzioni che definiscono cosa succede quando le operazioni asincrone sono completate. La natura asincrona di Node.js può potenzialmente rendere il codice più difficile da leggere, comprendere e eseguire il debug. +Questo processo spesso coinvolge quelle che conosciamo come "callback", che sono funzioni che definiscono cosa succede quando le operazioni asincrone sono completate. La natura asincrona di Node.js può potenzialmente rendere il codice più difficile da leggere, comprendere e eseguire il debug. Infine, devi anche fare attenzione quando scegli i pacchetti da `npm`, il package manager di Node, perché alcuni potrebbero non essere mantenuti costantemente e quindi potrebbero introdurre vulnerabilità nella tua applicazione. Come sviluppatore, dovresti valutare ogni pacchetto con attenzione e verificare se segue le migliori pratiche di qualità e sicurezza. diff --git a/curriculum/challenges/italian/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d39d7ed9ef36ff281f3.md b/curriculum/challenges/italian/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d39d7ed9ef36ff281f3.md index 3da6c8d7d9d..3867ecc3c97 100644 --- a/curriculum/challenges/italian/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d39d7ed9ef36ff281f3.md +++ b/curriculum/challenges/italian/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d39d7ed9ef36ff281f3.md @@ -1,6 +1,6 @@ --- id: 68ff6d39d7ed9ef36ff281f3 -title: Come installare Node sul tuo computer? +title: Come puoi installare Node sul tuo computer? challengeType: 19 dashedName: how-can-you-install-node-on-your-computer --- @@ -17,7 +17,7 @@ Vediamo come puoi installare NVM su macOS/Linux e Windows, e come usarlo per ins Su macOS e Linux puoi installare NVM direttamente tramite uno script shell. -Ma per macOS, nota che la documentazione ufficiale di NVM menziona che “devi installare manualmente gli strumenti da riga di comando di Xcode prima di eseguire lo script di installazione, altrimenti fallirà.” +Per macOS, nota che la documentazione ufficiale di NVM menziona che "devi installare manualmente gli strumenti da riga di comando di Xcode prima di eseguire lo script di installazione, altrimenti fallirà." Su macOS puoi installare gli strumenti da riga di comando di Xcode eseguendo questo comando nel terminale: @@ -41,7 +41,7 @@ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash ``` -Per ottenere l’ultima versione di NVM al momento in cui leggi questo articolo, consulta la documentazione ufficiale di NVM: `https://github.com/nvm-sh/nvm?tab=readme-ov-file#install--update-script`. Lì troverai questi comandi con il numero di versione più aggiornato. +Per ottenere l'ultima versione di NVM al momento in cui stai leggendo questa lezione, consulta la documentazione ufficiale di NVM: `https://github.com/nvm-sh/nvm?tab=readme-ov-file#install--update-script`. Lì troverai questi comandi con il numero della versione più recente. Potresti dover riavviare il terminale al termine del processo per caricare il nuovo comando e la nuova configurazione. @@ -101,7 +101,7 @@ Ora vediamo come puoi installare e usare NVM su Windows. Le versioni ufficiali di NVM supportano Windows solo in casi specifici. Se hai configurato Windows Subsystem for Linux (WSL) sul tuo dispositivo, puoi seguire la guida per macOS/Linux sopra per installare e usare NVM. -Tuttavia, per Windows stesso, ci sono alcune alternative. Una di queste è `nvm-windows`, un’utilità per la gestione delle versioni di Node.js per Windows. Questo è un progetto completamente separato dal progetto ufficiale NVM. Ma lo scopo di questi strumenti è lo stesso — aiutarti a lavorare con più versioni di Node.js sullo stesso dispositivo. +Tuttavia, per Windows in sé, ci sono alcune alternative. Una di queste è `nvm-windows`, un'utilità per la gestione delle versioni di Node.js su Windows. Questo è un progetto completamente separato dal progetto ufficiale NVM. Ma lo scopo di questi strumenti è lo stesso: aiutarti a lavorare con più versioni di Node.js sullo stesso dispositivo. Prima di installare `nvm-windows`, devi sapere che il repository ufficiale raccomanda di disinstallare qualsiasi installazione precedente di Node prima di installare NVM per Windows. Se è la prima volta che installi Node.js, dovresti essere a posto. Se hai già altre versioni di Node.js installate, è consigliato disinstallarle prima. @@ -109,7 +109,7 @@ Per installare `nvm-windows`: - Vai alla sezione Releases del repository ufficiale: `https://github.com/coreybutler/nvm-windows/releases`. - Scarica l’installer più recente. -- Segui le istruzioni. +- Segui le istruzioni. Dopo aver completato l’installazione, potresti dover riavviare il terminale se il comando `nvm` non è subito disponibile. @@ -135,7 +135,7 @@ La versione Long-Term Support (LTS) è solitamente consigliata, ma puoi installa nvm install <version> ``` -Ad esempio: +Per esempio: ```powershell nvm install 20 @@ -147,7 +147,7 @@ Quando l’installazione è completata, puoi passare a quella versione di Node.j nvm use <version> ``` -Ad esempio: +Per esempio: ```powershell nvm use 20 @@ -155,7 +155,7 @@ nvm use 20 Puoi anche controllare la tua versione corrente di Node.js con questo comando: -```bash +```powershell node -v ``` @@ -165,25 +165,25 @@ Ora che sai come installare NVM e Node.js, vediamo alcuni comandi base che ti sa Inoltre, mentre tutti questi comandi funzioneranno per NVM installato su macOS/Linux, incluso WSL, potrebbero funzionare in modo diverso o non funzionare affatto per `nvm-windows`. Lasceremo comandi alternativi per `nvm-windows` quando possibile. -### Come modificare la policy di esecuzione di Powershell +### Come modificare la policy di esecuzione di PowerShell -Se usi Windows e stai seguendo con Powershell e `nvm-windows`, potresti dover modificare la policy di esecuzione di Powershell. La policy di esecuzione predefinita per Powershell è `Restricted`, che è una misura di sicurezza per impedire l’esecuzione di script. +Se usi Windows e stai seguendo con PowerShell e `nvm-windows`, potresti dover modificare la policy di esecuzione di PowerShell. La policy di esecuzione predefinita per PowerShell è `Restricted`, una misura di sicurezza per impedire l'esecuzione di script. -Per prima cosa, esegui Powershell come amministratore cliccando con il tasto destro su Powershell, poi cliccando su “Esegui come amministratore“. +Per prima cosa, esegui PowerShell come amministratore cliccando con il tasto destro su PowerShell, poi clicca su "Esegui come amministratore". -Poi, per vedere la policy di esecuzione attuale della sessione Powershell corrente, esegui questo comando: +Poi, per vedere la policy di esecuzione corrente della sessione PowerShell attiva, esegui il seguente comando: ```powershell Get-ExecutionPolicy ``` -Infine, per impostare la policy di esecuzione di Powershell su `RemoteSigned`, che permette l’esecuzione di script locali e `npm`, usa questo comando: +Infine, per impostare la policy di esecuzione di PowerShell su `RemoteSigned`, che permette l'esecuzione di script locali e di `npm`, usa il seguente comando: ```powershell Set-ExecutionPolicy RemoteSigned ``` -Dopo aver eseguito il comando sopra, puoi chiudere la finestra di Powershell amministratore e aprire una finestra di Powershell senza privilegi amministrativi. +Dopo aver eseguito il comando sopra, puoi chiudere la finestra di PowerShell con privilegi di amministratore e aprire una finestra di PowerShell senza privilegi elevati. ### Elencare tutte le versioni @@ -193,7 +193,7 @@ Per elencare tutte le versioni di Node.js installate e controllare quella attual nvm ls ``` -### Impostare la versione predefinita di Node.js (solo NVM su macOS/Linux) +### Imposta versione Node.js predefinita (solo NVM su macOS/Linux) Questo comando imposta la versione predefinita di Node.js che sarà usata per nuove sessioni terminale: @@ -201,7 +201,7 @@ Questo comando imposta la versione predefinita di Node.js che sarà usata per nu nvm alias default <version> ``` -Ad esempio: +Per esempio: ```bash nvm alias default 22.20.0 @@ -213,7 +213,7 @@ Puoi anche creare alias personalizzati per assegnare un nome più specifico a un nvm alias <new_name> <version> ``` -Ad esempio: +Per esempio: ```bash nvm alias new-api 18.20.8 @@ -225,13 +225,13 @@ Dopo aver impostato l’alias, puoi usare questo nuovo nome per passare a quella nvm use <new_name> ``` -Ad esempio: +Per esempio: ```bash nvm use new-api ``` -### Rimuovere una versione di Node.js +### Rimuovi una versione di Node.js Per rimuovere una versione di Node.js, esegui questo comando: @@ -239,7 +239,7 @@ Per rimuovere una versione di Node.js, esegui questo comando: nvm uninstall <version> ``` -Ad esempio: +Per esempio: ```bash nvm uninstall 20.19.5 @@ -271,7 +271,7 @@ Per controllare la tua versione corrente di `npm`, esegui questo comando: npm -v ``` -### Eseguire un file JavaScript +### Esegui un file JavaScript Questo comando esegue il file JavaScript che specifichi nel runtime Node.js attivo: @@ -279,13 +279,13 @@ Questo comando esegue il file JavaScript che specifichi nel runtime Node.js atti node <file.js> ``` -Ad esempio: +Per esempio: ```bash node app.js ``` -### Creare un progetto Node.js +### Crea un progetto Node.js Questo comando crea un nuovo progetto Node.js creando un file `package.json` che tiene traccia dei dettagli e delle dipendenze. @@ -295,7 +295,7 @@ npm init Quando esegui il comando `npm init`, ti guiderà attraverso una guida CLI interattiva per configurare il file `package.json`. Ti farà domande sul nome del progetto, descrizione, versione, ecc. Se vuoi partire con un file `package.json` predefinito, puoi usare il comando `npm init -y` o `npm init --yes`. -### Installare un pacchetto +### Installa un pacchetto Per installare un pacchetto specifico, esegui: @@ -303,7 +303,7 @@ Per installare un pacchetto specifico, esegui: npm install <package> ``` -Ad esempio: +Per esempio: ```bash npm install express @@ -430,3 +430,4 @@ Il comando deve creare il file fondamentale del progetto per la gestione dei pac ## --video-solution-- 1 + diff --git a/curriculum/challenges/italian/blocks/lecture-working-with-operator-behavior/6732719e2e3ad4d947410b65.md b/curriculum/challenges/italian/blocks/lecture-working-with-operator-behavior/6732719e2e3ad4d947410b65.md index b27e22cf189..f093564a395 100644 --- a/curriculum/challenges/italian/blocks/lecture-working-with-operator-behavior/6732719e2e3ad4d947410b65.md +++ b/curriculum/challenges/italian/blocks/lecture-working-with-operator-behavior/6732719e2e3ad4d947410b65.md @@ -11,7 +11,13 @@ Se scrivi un’espressione con diversi operatori in JavaScript, come fa JavaScri La precedenza degli operatori determina l’ordine in cui le operazioni vengono valutate in un’espressione. Gli operatori con precedenza più alta vengono valutati prima di quelli con precedenza più bassa. Pensa alla precedenza degli operatori come in matematica, dove divisione e moltiplicazione avvengono prima di addizione e sottrazione. -Senza questa regola, le equazioni di base darebbero risultati sbagliati. JavaScript funziona allo stesso modo. Ha le sue regole su quali operatori vengono prima, seconda e così via. Per esempio, guarda l’espressione qui sotto: +Senza seguire questa regola, le equazioni di base darebbero un risultato sbagliato. JavaScript funziona allo stesso modo. Ha le sue regole per stabilire quale operatore viene prima, secondo e così via. + +## Precedenza nelle espressioni aritmetiche + +### Precedenza della moltiplicazione + +Per esempio, dai un'occhiata all'espressione qui sotto: :::interactive_editor @@ -25,36 +31,42 @@ console.log(result); // 14 Se JavaScript valutasse questa espressione da sinistra a destra, ti aspetteresti `2 + 3 = 5`, poi `5 * 4 = 20`. Ma poiché la moltiplicazione ha una precedenza più alta dell’addizione, JavaScript valuta prima la parte `3 * 4`, ottenendo `2 + 12 = 14`. -A volte, potresti voler che certe parti della tua espressione vengano eseguite prima, indipendentemente dalle regole di precedenza. Puoi usare le parentesi tonde, `()`, per farlo. Qualsiasi cosa dentro le parentesi viene valutata prima, a prescindere da tutto. Facciamo in modo che la parte `2 + 3` dell’esempio precedente venga valutata per prima: +### Precedenza della divisione + +Anche l’operatore di divisione ha più precedenza dell’addizione o sottrazione: :::interactive_editor ```js -const result = (2 + 3) * 4; +const result = 2 + 6 / 3; -console.log(result); // 20 +console.log(result); // 4 ``` ::: -Nell’esempio sopra, le parentesi costringono JavaScript a valutare prima `2 + 3`, e poi moltiplicare il risultato per `4`. Questo ti dà `20` invece di `14`. +Se JavaScript valutasse questa espressione da sinistra a destra, potresti aspettarti `2 + 6 = 8`, poi `8 / 3 = 2.67`. Ma dato che la divisione ha una precedenza più alta dell’addizione, JavaScript valuta prima la divisione: `6 / 3 = 2`, e poi aggiunge `2 + 2`, ottenendo il risultato `4`. -Anche l’operatore di divisione ha più precedenza dell’addizione o sottrazione: +### Usare le parentesi per sovrascrivere la precedenza + +A volte, potresti voler che alcune parti della tua espressione vengano eseguite per prime, indipendentemente dalle regole di precedenza. Puoi usare le parentesi tonde, `()`, per farlo. Qualsiasi cosa dentro le parentesi viene valutata prima, a prescindere da tutto. Facciamo in modo che la parte `2 + 3` dell'esempio di moltiplicazione venga valutata per prima: :::interactive_editor ```js -const result = 2 + 6 / 3; +const result = (2 + 3) * 4; -console.log(result); // 4 +console.log(result); // 20 ``` ::: -Se JavaScript valutasse questa espressione da sinistra a destra, potresti aspettarti `2 + 6 = 8`, poi `8 / 3 = 2.67`. Ma dato che la divisione ha una precedenza più alta dell’addizione, JavaScript valuta prima la divisione: `6 / 3 = 2`, e poi aggiunge `2 + 2`, ottenendo il risultato `4`. +Nell’esempio sopra, le parentesi costringono JavaScript a valutare prima `2 + 3`, e poi moltiplicare il risultato per `4`. Questo ti dà `20` invece di `14`. Quindi, sia nella moltiplicazione sia nella divisione, queste operazioni avvengono sempre prima di addizione e sottrazione a meno che non usi le parentesi per cambiare l’ordine. Ma cosa succede se gli operatori hanno la stessa precedenza? JavaScript usa l’associatività per capire in quale ordine valutarli. +## Comprendere l'associatività + L’associatività dice a JavaScript se valutare gli operatori da sinistra a destra o da destra a sinistra. Per la maggior parte degli operatori come addizione e moltiplicazione, l’associatività è da sinistra a destra. Quindi, JavaScript li elabora partendo dal lato più a sinistra dell’espressione verso destra: :::interactive_editor @@ -84,6 +96,8 @@ console.log(a + b); // 10 Nell’esempio sopra, JavaScript assegna prima `5` a `b`, poi assegna `b` (che ora è `5`) a `a`. +### L'operatore esponenziale + Anche l’operatore di esponente è associativo da destra a sinistra: :::interactive_editor diff --git a/curriculum/challenges/italian/blocks/lecture-working-with-regular-expressions/6733c5e54e3a154c8078ed48.md b/curriculum/challenges/italian/blocks/lecture-working-with-regular-expressions/6733c5e54e3a154c8078ed48.md index 89ba9e28aa9..7a49973fd96 100644 --- a/curriculum/challenges/italian/blocks/lecture-working-with-regular-expressions/6733c5e54e3a154c8078ed48.md +++ b/curriculum/challenges/italian/blocks/lecture-working-with-regular-expressions/6733c5e54e3a154c8078ed48.md @@ -17,6 +17,8 @@ const regex = /^\d\d\d\d$/; E funziona: corrisponderà a quattro caratteri numerici. Ma invece di dover scrivere la stessa classe più volte, puoi assegnarle un quantificatore. +## Quantificatori esatti + I quantificatori si definiscono con parentesi graffe contenenti uno o due numeri. Usiamo un quantificatore nel nostro pattern: ```js @@ -40,6 +42,8 @@ console.log(regex.test("1234567")); // false Il pattern corrisponde solo alla stringa con esattamente quattro cifre, perché abbiamo usato le àncore e il nostro quantificatore permette solo esattamente quattro cifre. Ma forse il codice identificativo deve essere almeno di quattro cifre. +## Quantificatori minimo e massimo + Per permettere quattro o più cifre, aggiungi una virgola dopo il numero nel tuo quantificatore: ```js @@ -84,6 +88,10 @@ console.log(regex.test("1234567")); // false Nota che non puoi usare questa sintassi per impostare solo un massimo: devi sempre impostare un minimo. Ma se imposti il minimo a `1`, puoi ottenere lo stesso risultato. +## Quantificatori abbreviati + +### Il quantificatore punto interrogativo (`?`) + Abbiamo ricevuto requisiti aggiornati dagli utenti. Gli identificatori possono ora opzionalmente iniziare con una lettera. Conosciamo già la classe di caratteri per questo, quindi aggiungiamola alla nostra espressione regolare: ```js @@ -122,6 +130,8 @@ console.log(regex.test("1234567")); // false Il nostro pattern ora permette una singola lettera opzionale, seguita da quattro a sei cifre. +### Il quantificatore asterisco (`*`) + Sfortunatamente, ci siamo appena accorti di aver interpretato male i requisiti. Dobbiamo permettere un numero qualsiasi di lettere prima dei numeri. Possiamo usare il nostro quantificatore con un minimo `0` e nessun massimo definito: ```js @@ -144,6 +154,8 @@ console.log(regex.test("1234567")); // false ::: +### Il quantificatore più (`+`) + Ora corrispondiamo con successo a qualsiasi identificatore con zero o più lettere seguite da quattro a sei numeri. Ma si scopre che questo sta causando un crash nel nostro sistema: dobbiamo effettivamente richiedere almeno una lettera. Ancora una volta, potremmo usare un quantificatore con un minimo di uno e nessun massimo definito, oppure potremmo usare un'altra sintassi speciale, il simbolo più (`+`): diff --git a/curriculum/challenges/italian/blocks/lecture-working-with-the-dom-click-events-and-web-apis/673368ccf52205329b729378.md b/curriculum/challenges/italian/blocks/lecture-working-with-the-dom-click-events-and-web-apis/673368ccf52205329b729378.md index 3d3fa7eeecf..80393ebc8a1 100644 --- a/curriculum/challenges/italian/blocks/lecture-working-with-the-dom-click-events-and-web-apis/673368ccf52205329b729378.md +++ b/curriculum/challenges/italian/blocks/lecture-working-with-the-dom-click-events-and-web-apis/673368ccf52205329b729378.md @@ -7,12 +7,16 @@ dashedName: what-is-the-difference-between-innertext-textcontent-and-innerhtml # --interactive-- +## Panoramica + Impariamo a conoscere `innerText`, `textContent` e `innerHTML`. Queste sono proprietà che puoi consultare in JavaScript per ottenere o modificare il contenuto di un elemento HTML. Anche se all’inizio possono sembrare molto simili, hanno differenze chiave. Scegliere quella giusta dipende dal tuo caso d’uso specifico, quindi entriamo nel dettaglio. Iniziamo con `innerText`. +## Comprendere innerText + `innerText` rappresenta il contenuto testuale visibile dell’elemento HTML e dei suoi discendenti. Questa proprietà non include il testo nascosto o i tag HTML, solo il testo renderizzato. Ad esempio, qui puoi vedere un elemento `div` che contiene due paragrafi: @@ -109,6 +113,8 @@ Poiché `innerText` tiene conto della visibilità, ottenere il suo valore attiva Ottimo. Ora parliamo di `textContent`. +## Comprendere textContent + `textContent` restituisce il contenuto testuale semplice di un elemento, incluso tutto il testo all’interno dei suoi discendenti. La differenza più importante tra `innerText` e `textContent` è che `textContent` restituisce sempre il contenuto testuale completo di un elemento HTML e dei suoi discendenti, indipendentemente dal fatto che sia visibile o nascosto. @@ -181,6 +187,8 @@ container.textContent = "New content"; ::: +## Confronto con innerHTML + E infine, parliamo di come `textContent` e `innerText` differiscono da `innerHTML`. Ricorda che con `innerHTML` puoi impostare il contenuto HTML interno di un elemento. Questo è utile per inserire dinamicamente nuovo HTML nel DOM. @@ -189,6 +197,8 @@ Tuttavia, ricorda che questo comporta un rischio per la sicurezza se non hai il Per evitare questo, si consiglia di usare la proprietà `textContent` per inserire testo semplice invece. +## Riepilogo delle differenze chiave + Le proprietà `innerText`, `textContent` e `innerHTML` in JavaScript offrono modi diversi per consultare e manipolare il contenuto degli elementi HTML. Dovresti capire le differenze tra queste proprietà se vuoi lavorare efficacemente con contenuti HTML in JavaScript. # --questions-- diff --git a/curriculum/challenges/italian/blocks/machine-learning-with-python-projects/5e46f8d6ac417301a38fb92d.md b/curriculum/challenges/italian/blocks/machine-learning-with-python-projects/5e46f8d6ac417301a38fb92d.md index 0e6e3a73a39..04d01f123de 100644 --- a/curriculum/challenges/italian/blocks/machine-learning-with-python-projects/5e46f8d6ac417301a38fb92d.md +++ b/curriculum/challenges/italian/blocks/machine-learning-with-python-projects/5e46f8d6ac417301a38fb92d.md @@ -10,7 +10,7 @@ dashedName: rock-paper-scissors Per questa sfida, creerai un programma per giocare a carta forbice sasso. Un programma che sceglie a caso di solito vince il 50% delle volte. Per superare questa sfida il tuo programma deve giocare partite contro quattro bot diversi, vincendo almeno il 60% delle partite in ogni match. -Lavorerai <a href="https://app.ona.com/?autostart=true#https://github.com/freeCodeCamp/boilerplate-rock-paper-scissors/" target="_blank" rel="noopener noreferrer nofollow">su questo progetto con il nostro codice boilerplate Ona</a>. +Lavorerai su questo progetto con il nostro codice boilerplate di partenza <a href="https://codespaces.new/freeCodeCamp/boilerplate-rock-paper-scissors/" target="_blank" rel="noopener noreferrer nofollow">qui</a>. Stiamo ancora sviluppando la parte interattiva e didattica del curriculum di machine learning. Per ora, dovrai usare altre risorse per imparare come superare questa sfida. diff --git a/curriculum/challenges/italian/blocks/review-introduction-to-express/6a0354d43d4c00eca38561f7.md b/curriculum/challenges/italian/blocks/review-introduction-to-express/6a0354d43d4c00eca38561f7.md index 69ee65d3c6f..b30e8827705 100644 --- a/curriculum/challenges/italian/blocks/review-introduction-to-express/6a0354d43d4c00eca38561f7.md +++ b/curriculum/challenges/italian/blocks/review-introduction-to-express/6a0354d43d4c00eca38561f7.md @@ -7,53 +7,6 @@ dashedName: review-introduction-to-express # --description-- -## Servizi web e API - -- **API (Application Programming Interface)**: un modo generale per il software di comunicare con altro software. -- **Servizio web**: un tipo specifico di API che usa tecnologie web come HTTP per scambiare dati su una rete. Ogni servizio web è un’API, ma non ogni API è un servizio web. -- **Caratteristiche chiave di un servizio web**: gira su un server, permette la comunicazione macchina-macchina, è indipendente dal linguaggio, è indipendente dalla piattaforma e usa protocolli web standard (HTTP/HTTPS, FTP, SMTP). -- **REST (trasferimento di stato rappresentazionale)**: il tipo di servizio web più usato oggi. Espone risorse identificate da percorsi URL come `/users` o `/users/20`. Le risposte sono di solito in JSON, ma possono anche essere XML o testo semplice. -- **SOAP (Simple Object Access Protocol)**: usa solo XML. Comune nei sistemi aziendali che richiedono standard e sicurezza più rigidi. -- **XML-RPC**: usa XML per codificare richieste e risposte. Leggero ma meno flessibile di REST. -- **Intestazione `Accept`**: usata da un client per indicare al server quale formato di risposta desidera, per esempio `Accept: application/json`. - -## L’architettura REST - -- **Senza stato**: ogni richiesta deve includere tutte le informazioni che il server serve per elaborarla. Il server non ricorda le richieste precedenti. -- **Risorsa**: un pezzo di dati che può essere consultato o modificato, identificato da un URL (per esempio `/products/1`). -- **Metodi HTTP in REST**: - - `GET` — recuperare una risorsa - - `POST` — creare una nuova risorsa - - `PUT` / `PATCH` — aggiornare una risorsa esistente - - `DELETE` — rimuovere una risorsa - -## Codici di stato HTTP - -Dopo aver elaborato una richiesta, il server risponde con un **codice di stato** che indica il risultato: - -- `200` **(OK)**: la richiesta è andata a buon fine -- `201` **(Created)**: è stata creata una nuova risorsa -- `400` **(Bad Request)**: il client ha inviato dati non validi -- `404` **(Not Found)**: la risorsa richiesta non esiste -- `500` **(Internal Server Error)**: si è verificato un errore sul server - -### Come funziona una richiesta REST - -1. Il client invia una richiesta con un metodo, URL, intestazioni opzionali e corpo opzionale. -2. Il server valida la richiesta e identifica la risorsa. -3. Il server esegue l’azione (ottenere, creare, aggiornare o eliminare). -4. Il server costruisce una risposta con un codice di stato e corpo opzionale (di solito JSON). -5. Il server invia la risposta — non viene memorizzato alcuno stato del client. -6. Il client controlla il codice di stato e elabora i dati ricevuti. - -## Monoliti vs microservizi - -- **Monolite**: un’unica grande base di codice dove UI, database e API convivono insieme. Funziona bene per app piccole ma diventa più difficile da mantenere e scalare con la crescita. -- **Microservizi**: un’architettura in cui una grande app è suddivisa in servizi più piccoli e indipendenti. Ogni servizio gestisce una capacità aziendale (per esempio prodotti, ordini, pagamenti) e può avere la propria base di codice, database e team. -- **Come comunicano i microservizi**: tramite API o sistemi basati su messaggi. -- **Vantaggi dei microservizi**: sviluppo più rapido, migliore isolamento dei guasti e libertà di usare linguaggi o framework diversi per ogni servizio. -- **Sfide dei microservizi**: debugging più complesso, gestione dell’infrastruttura più difficile e maggiore overhead di rete tra i servizi. - ## Cos’è Express.js? - **Express**: un framework web minimale e flessibile costruito sopra Node.js che facilita la creazione di server web e API. diff --git a/curriculum/challenges/italian/blocks/review-rest-api-and-web-services/6a7c78ad958a597ee788ad2a.md b/curriculum/challenges/italian/blocks/review-rest-api-and-web-services/6a7c78ad958a597ee788ad2a.md new file mode 100644 index 00000000000..7617e0c4b64 --- /dev/null +++ b/curriculum/challenges/italian/blocks/review-rest-api-and-web-services/6a7c78ad958a597ee788ad2a.md @@ -0,0 +1,59 @@ +--- +id: 6a7c78ad958a597ee788ad2a +title: Revisione delle API rest e dei servizi web +challengeType: 31 +dashedName: review-rest-api-and-web-services +--- + +# --description-- + +## Servizi web e API + +- **API (Application Programming Interface)**: un modo generale per il software di comunicare con altro software. +- **Servizio web**: un tipo specifico di API che usa tecnologie web come HTTP per scambiare dati su una rete. Ogni servizio web è un’API, ma non ogni API è un servizio web. +- **Caratteristiche chiave di un servizio web**: gira su un server, permette la comunicazione macchina-macchina, è indipendente dal linguaggio, è indipendente dalla piattaforma e usa protocolli web standard (HTTP/HTTPS, FTP, SMTP). +- **REST (trasferimento di stato rappresentazionale)**: il tipo di servizio web più usato oggi. Espone risorse identificate da percorsi URL come `/users` o `/users/20`. Le risposte sono di solito in JSON, ma possono anche essere XML o testo semplice. +- **SOAP (Simple Object Access Protocol)**: usa solo XML. Comune nei sistemi aziendali che richiedono standard e sicurezza più rigidi. +- **XML-RPC**: usa XML per codificare richieste e risposte. Leggero ma meno flessibile di REST. +- **Intestazione `Accept`**: usata da un client per indicare al server quale formato di risposta desidera, per esempio `Accept: application/json`. + +## L’architettura REST + +- **Senza stato**: ogni richiesta deve includere tutte le informazioni che il server serve per elaborarla. Il server non ricorda le richieste precedenti. +- **Risorsa**: un pezzo di dati che può essere consultato o modificato, identificato da un URL (per esempio `/products/1`). +- **Metodi HTTP in REST**: + - `GET` — recuperare una risorsa + - `POST` — creare una nuova risorsa + - `PUT` / `PATCH` — aggiornare una risorsa esistente + - `DELETE` — rimuovere una risorsa + +## Codici di stato HTTP + +Dopo aver elaborato una richiesta, il server risponde con un **codice di stato** che indica il risultato: + +- `200` **(OK)**: la richiesta è andata a buon fine +- `201` **(Created)**: è stata creata una nuova risorsa +- `400` **(Bad Request)**: il client ha inviato dati non validi +- `404` **(Not Found)**: la risorsa richiesta non esiste +- `500` **(Internal Server Error)**: si è verificato un errore sul server + +### Come funziona una richiesta REST + +1. Il client invia una richiesta con un metodo, URL, intestazioni opzionali e corpo opzionale. +2. Il server valida la richiesta e identifica la risorsa. +3. Il server esegue l’azione (ottenere, creare, aggiornare o eliminare). +4. Il server costruisce una risposta con un codice di stato e corpo opzionale (di solito JSON). +5. Il server invia la risposta — non viene memorizzato alcuno stato del client. +6. Il client controlla il codice di stato e elabora i dati ricevuti. + +## Monoliti vs microservizi + +- **Monolite**: un’unica grande base di codice dove UI, database e API convivono insieme. Funziona bene per app piccole ma diventa più difficile da mantenere e scalare con la crescita. +- **Microservizi**: un’architettura in cui una grande app è suddivisa in servizi più piccoli e indipendenti. Ogni servizio gestisce una capacità aziendale (per esempio prodotti, ordini, pagamenti) e può avere la propria base di codice, database e team. +- **Come comunicano i microservizi**: tramite API o sistemi basati su messaggi. +- **Vantaggi dei microservizi**: sviluppo più rapido, migliore isolamento dei guasti e libertà di usare linguaggi o framework diversi per ogni servizio. +- **Sfide dei microservizi**: debugging più complesso, gestione dell’infrastruttura più difficile e maggiore overhead di rete tra i servizi. + +# --assignment-- + +Rivedi gli argomenti e i concetti delle API rest e dei servizi web. diff --git a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e89d557d4b78bf83a02ae6.md b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e89d557d4b78bf83a02ae6.md index f0ed2d3a9af..a29561c72e0 100644 --- a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e89d557d4b78bf83a02ae6.md +++ b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e89d557d4b78bf83a02ae6.md @@ -396,10 +396,10 @@ body { const { useState } = React; export const FootballPlayerCard = () => { - return ( + return ( --fcc-editable-region-- - <h1 style={{ backgroundColor: '#fff' }}>Hello, TSX!</h1> + <h1 style={{ backgroundColor: "#fff" }}>Hello, TSX!</h1> --fcc-editable-region-- - ) + ); }; ``` diff --git a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb2.md b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb2.md index 70db6356dfb..9dec3033230 100644 --- a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb2.md +++ b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb2.md @@ -29,12 +29,10 @@ assert.equal(element?.type, window.index.PlayerCard); <meta charset="utf-8"/> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Football Player Card Builder - - - + @@ -379,21 +377,18 @@ body { ```tsx const { useState } = React; -export function PlayerCard() { +export const PlayerCard = () => { return ( -
- -
+
); -} +}; export const FootballPlayerCard = () => { - + --fcc-editable-region-- return ( - --fcc-editable-region-- -

Football Card Builder

- --fcc-editable-region-- - ) +

Football Card Builder

+ ); + --fcc-editable-region-- }; ``` diff --git a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb3.md b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb3.md index 2626a83d74e..24b8b920fd1 100644 --- a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb3.md +++ b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb3.md @@ -382,15 +382,13 @@ export const PlayerCard = () => { return (
--fcc-editable-region-- - + --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { - return ( - - ); + return ; }; ``` diff --git a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb4.md b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb4.md index 2e2a76a6cc3..dfd7fbaf7f4 100644 --- a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb4.md +++ b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb4.md @@ -381,12 +381,12 @@ export const PlayerCard = () => {
--fcc-editable-region-- - + --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb5.md b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb5.md index bf76f19d198..b7ddb9cf907 100644 --- a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb5.md +++ b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb5.md @@ -394,13 +394,13 @@ export const PlayerCard = () => {
--fcc-editable-region-- - + --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb6.md b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb6.md index 513b1c83487..dfbf552f087 100644 --- a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb6.md +++ b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb6.md @@ -390,14 +390,14 @@ export const PlayerCard = () => {
98
--fcc-editable-region-- - + --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb7.md b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb7.md index e3011e612ca..f98a4a4b44a 100644 --- a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb7.md +++ b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb7.md @@ -398,13 +398,13 @@ export const PlayerCard = () => {
ST
--fcc-editable-region-- - + --fcc-editable-region-- ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb8.md b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb8.md index 1d8befaf1d4..5ab60e86f35 100644 --- a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb8.md +++ b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb8.md @@ -394,14 +394,14 @@ export const PlayerCard = () => {
GOLD
--fcc-editable-region-- - + --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb9.md b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb9.md index 97e64498128..8ec197d3a4d 100644 --- a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb9.md +++ b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb9.md @@ -393,12 +393,12 @@ export const PlayerCard = () => { --fcc-editable-region-- - + --fcc-editable-region-- ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bba.md b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bba.md index 87a7e68a54c..4055e80d120 100644 --- a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bba.md +++ b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bba.md @@ -412,13 +412,13 @@ export const PlayerCard = () => {
--fcc-editable-region-- - + --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbb.md b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbb.md index 4337b021243..5a7eebf1426 100644 --- a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbb.md +++ b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbb.md @@ -406,12 +406,12 @@ export const PlayerCard = () => { Edson Arantes do Nascimento (Pele) headshot --fcc-editable-region-- - + --fcc-editable-region-- ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbc.md b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbc.md index 81054925ccc..b10bcc08b6f 100644 --- a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbc.md +++ b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbc.md @@ -409,12 +409,12 @@ export const PlayerCard = () => { PELE --fcc-editable-region-- - + --fcc-editable-region-- ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbd.md b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbd.md index acbfeb49600..3e938a666ef 100644 --- a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbd.md +++ b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbd.md @@ -427,13 +427,13 @@ export const PlayerCard = () => { --fcc-editable-region-- - + --fcc-editable-region-- ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbe.md b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbe.md index 8dfc43f803b..768a4ea3a85 100644 --- a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbe.md +++ b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbe.md @@ -465,7 +465,7 @@ export const PlayerCard = () => { ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbf.md b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbf.md index 8e1eec5cc3c..10b4a75fedb 100644 --- a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbf.md +++ b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbf.md @@ -420,7 +420,7 @@ interface PlayerData { position: string; club: string; --fcc-editable-region-- - + --fcc-editable-region-- } @@ -478,7 +478,7 @@ export const PlayerCard = () => { ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc0.md b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc0.md index b0206842cfd..21d764a15ee 100644 --- a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc0.md +++ b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc0.md @@ -497,7 +497,7 @@ export const PlayerCard = () => { ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc1.md b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc1.md index 1e74e7755d4..ba43315916c 100644 --- a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc1.md +++ b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc1.md @@ -398,10 +398,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } --fcc-editable-region-- @@ -460,7 +460,7 @@ export const PlayerCard = () => { ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc2.md b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc2.md index 8db2e82c733..bf06a952741 100644 --- a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc2.md +++ b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc2.md @@ -40,12 +40,10 @@ assert.exists(document.querySelector('.card-wrapper.tier-elite')); Football Player Card Builder - - - + @@ -405,10 +403,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -467,9 +465,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc3.md b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc3.md index ee514c2d133..d7a03dc790e 100644 --- a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc3.md +++ b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc3.md @@ -399,10 +399,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -461,9 +461,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc4.md b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc4.md index 9bc28a2434d..54bbcd076b7 100644 --- a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc4.md +++ b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc4.md @@ -399,10 +399,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -461,9 +461,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc5.md b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc5.md index 693dd7abb94..c894b5d4e7a 100644 --- a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc5.md +++ b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc5.md @@ -392,10 +392,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -456,9 +456,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc6.md b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc6.md index 7f02d835315..065b96ee863 100644 --- a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc6.md +++ b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc6.md @@ -401,10 +401,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -465,9 +465,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc7.md b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc7.md index dc4984c4050..44b846252ee 100644 --- a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc7.md +++ b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc7.md @@ -391,10 +391,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -455,9 +455,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc8.md b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc8.md index 5e24f1297bb..748f25bfbcc 100644 --- a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc8.md +++ b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc8.md @@ -407,10 +407,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -436,9 +436,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { {player.name}
- --fcc-editable-region--
+ --fcc-editable-region-- 97 PAC
@@ -448,10 +448,10 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
83 + --fcc-editable-region-- PAS
- --fcc-editable-region--
@@ -471,9 +471,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc9.md b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc9.md index 98232d4e12b..8ac72150a03 100644 --- a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc9.md +++ b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc9.md @@ -483,10 +483,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -545,13 +545,13 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
); -} +}; --fcc-editable-region-- --fcc-editable-region-- export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bca.md b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bca.md index 0ef417a33a0..4484e57087d 100644 --- a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bca.md +++ b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bca.md @@ -419,10 +419,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -481,14 +481,14 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { - name: 'PELE', + name: "PELE", overallRating: 98, - position: 'ST', - club: 'Santos FC', - imageUrl: 'https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg', + position: "ST", + club: "Santos FC", + imageUrl: "https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg", pac: 97, sho: 98, pas: 83, diff --git a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcb.md b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcb.md index 3f0cd5e3b94..e6c016164dc 100644 --- a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcb.md +++ b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcb.md @@ -435,10 +435,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -497,14 +497,14 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { - name: 'PELE', + name: "PELE", overallRating: 98, - position: 'ST', - club: 'Santos FC', - imageUrl: 'https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg', + position: "ST", + club: "Santos FC", + imageUrl: "https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg", pac: 97, sho: 98, pas: 83, @@ -517,6 +517,7 @@ export const FootballPlayerCard = () => { const [player, setPlayer] = useState(defaultPlayer); return ( --fcc-editable-region-- + --fcc-editable-region-- ); diff --git a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcc.md b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcc.md index e9e88deb57b..44f08bf678e 100644 --- a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcc.md +++ b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcc.md @@ -477,7 +477,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -504,7 +504,9 @@ export const FootballPlayerCard = () => { --fcc-editable-region-- + + --fcc-editable-region-- ); diff --git a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcd.md b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcd.md index 3412348fc47..b57b29dd231 100644 --- a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcd.md +++ b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcd.md @@ -465,7 +465,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bce.md b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bce.md index 3c18c2ceaf8..ce370f39730 100644 --- a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bce.md +++ b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bce.md @@ -470,7 +470,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcf.md b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcf.md index a8c0b60426f..c49dcf09158 100644 --- a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcf.md +++ b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcf.md @@ -488,7 +488,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd0.md b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd0.md index 48f79bb93a7..45c0fe32b47 100644 --- a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd0.md +++ b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd0.md @@ -471,7 +471,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd1.md b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd1.md index 50fb085d36d..6089dad0cec 100644 --- a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd1.md +++ b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd1.md @@ -471,7 +471,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd2.md b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd2.md index 54f302c052d..e139b672b08 100644 --- a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd2.md +++ b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd2.md @@ -471,7 +471,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -535,7 +535,7 @@ export const FootballPlayerCard = () => { - --fcc-editable-region-- + --fcc-editable-region-- --fcc-editable-region-- diff --git a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd3.md b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd3.md index 0f7414a34b2..c98bb2024ed 100644 --- a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd3.md +++ b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd3.md @@ -497,7 +497,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd4.md b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd4.md index 281fd47aa59..85ad1d0949a 100644 --- a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd4.md +++ b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd4.md @@ -497,7 +497,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd5.md b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd5.md index 0a65d93e1cd..b35fb08cd0a 100644 --- a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd5.md +++ b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd5.md @@ -497,7 +497,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd6.md b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd6.md index 84f7fa5a161..a72efe1777c 100644 --- a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd6.md +++ b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd6.md @@ -470,7 +470,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd7.md b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd7.md index 96d0a0dc4c9..d8efbb64ab9 100644 --- a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd7.md +++ b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd7.md @@ -478,7 +478,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -609,3 +609,4 @@ export const FootballPlayerCard = () => { ); }; ``` + diff --git a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd8.md b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd8.md index 08be2df5fba..595170cde32 100644 --- a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd8.md +++ b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd8.md @@ -410,7 +410,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -484,7 +484,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -538,8 +538,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd9.md b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd9.md index 7dcd0cd37c6..e0c8cc7981b 100644 --- a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd9.md +++ b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd9.md @@ -402,7 +402,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -476,7 +476,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -530,8 +530,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bda.md b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bda.md index 2d6e5854f8d..13b2ceeb55b 100644 --- a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bda.md +++ b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bda.md @@ -402,7 +402,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -476,7 +476,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -530,8 +530,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( @@ -640,3 +641,4 @@ export const FootballPlayerCard = () => { ); }; ``` + diff --git a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdb.md b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdb.md index fbb768ea710..9c2409f79ae 100644 --- a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdb.md +++ b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdb.md @@ -402,7 +402,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -476,7 +476,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -530,8 +530,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdc.md b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdc.md index c5379c5ade6..9dfa4bc1dce 100644 --- a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdc.md +++ b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdc.md @@ -402,7 +402,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -476,7 +476,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -530,8 +530,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdd.md b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdd.md index 43f271d384a..e3b29cad8f3 100644 --- a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdd.md +++ b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdd.md @@ -402,7 +402,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -476,7 +476,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -530,8 +530,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bde.md b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bde.md index c7612c5d795..c74ce9876fb 100644 --- a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bde.md +++ b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bde.md @@ -402,7 +402,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -414,10 +414,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -430,7 +430,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
{player.position}
-
{getPlayerTier(player.overallRating).toUpperCase()}
+
+ {getPlayerTier(player.overallRating).toUpperCase()} +
{player.club}
@@ -474,14 +476,14 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { - name: 'PELE', + name: "PELE", overallRating: 98, - position: 'ST', - club: 'Santos FC', - imageUrl: 'https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg', + position: "ST", + club: "Santos FC", + imageUrl: "https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg", pac: 97, sho: 98, pas: 83, @@ -506,8 +508,18 @@ export const FootballPlayerCard = () => {

Player Info

- - setPlayer({ ...player, name: e.target.value })} /> + + + setPlayer({ ...player, name: e.target.value }) + } + />
@@ -518,8 +530,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( @@ -531,46 +544,115 @@ export const FootballPlayerCard = () => {
- - setPlayer({ ...player, overallRating: Number(e.target.value) })} /> + + + setPlayer({ + ...player, + overallRating: Number(e.target.value), + }) + } + />
- - setPlayer({ ...player, club: e.target.value })} /> + + + setPlayer({ ...player, club: e.target.value }) + } + />
- - setPlayer({ ...player, imageUrl: e.target.value })} /> + + + setPlayer({ ...player, imageUrl: e.target.value }) + } + />

Player Stats

- - setPlayer({ ...player, pac: Number(e.target.value) })} /> + + + setPlayer({ ...player, pac: Number(e.target.value) }) + } + />
- - setPlayer({ ...player, sho: Number(e.target.value) })} /> + + + setPlayer({ ...player, sho: Number(e.target.value) }) + } + />
- - setPlayer({ ...player, pas: Number(e.target.value) })} /> + + + setPlayer({ ...player, pas: Number(e.target.value) }) + } + />
- + --fcc-editable-region-- --fcc-editable-region--
- +
- +
@@ -579,7 +661,9 @@ export const FootballPlayerCard = () => {

Live Preview

Updates as you type

-
+
@@ -589,3 +673,4 @@ export const FootballPlayerCard = () => { ); }; ``` + diff --git a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdf.md b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdf.md index 3ea7ff629a3..8f6c9c0291a 100644 --- a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdf.md +++ b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdf.md @@ -421,7 +421,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -495,7 +495,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -549,8 +549,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( @@ -667,11 +668,11 @@ export const FootballPlayerCard = () => { } /> - --fcc-editable-region--
+ --fcc-editable-region--
@@ -679,8 +680,8 @@ export const FootballPlayerCard = () => { PHY -
--fcc-editable-region-- + diff --git a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8d1be04ed6aad1c955729.md b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8d1be04ed6aad1c955729.md index a31d373760d..8232c2979ed 100644 --- a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8d1be04ed6aad1c955729.md +++ b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69e8d1be04ed6aad1c955729.md @@ -391,8 +391,8 @@ const { useState } = React; --fcc-editable-region-- export const FootballPlayerCard = () => { - return ( -

Football Card Builder

- ) + return ( +

Football Card Builder

+ ); }; ``` diff --git a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69ea01c45b04f3e9de845036.md b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69ea01c45b04f3e9de845036.md index 99b276b5216..1892917706b 100644 --- a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69ea01c45b04f3e9de845036.md +++ b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69ea01c45b04f3e9de845036.md @@ -405,7 +405,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -483,7 +483,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -537,8 +537,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69ea02adff0fd528639ee23b.md b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69ea02adff0fd528639ee23b.md index d17b9a18f47..e6c4ebc750d 100644 --- a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69ea02adff0fd528639ee23b.md +++ b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69ea02adff0fd528639ee23b.md @@ -409,7 +409,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -485,7 +485,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -543,8 +543,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69ea0349f8305a99324465ff.md b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69ea0349f8305a99324465ff.md index 04c15fe7d6b..3a217946b0c 100644 --- a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69ea0349f8305a99324465ff.md +++ b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69ea0349f8305a99324465ff.md @@ -407,7 +407,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -483,7 +483,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -502,11 +502,9 @@ const defaultPlayer: PlayerData = { function loadPlayer(): PlayerData { try { --fcc-editable-region-- - - --fcc-editable-region-- - } catch (error) { - } + --fcc-editable-region-- + } catch (error) {} } export const FootballPlayerCard = () => { @@ -547,8 +545,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69ea044f8c93a5e7ce64214c.md b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69ea044f8c93a5e7ce64214c.md index 2c80352327f..bf589e1974a 100644 --- a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69ea044f8c93a5e7ce64214c.md +++ b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69ea044f8c93a5e7ce64214c.md @@ -395,7 +395,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -471,7 +471,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -492,12 +492,10 @@ function loadPlayer(): PlayerData { const saved = localStorage.getItem(STORAGE_KEY); if (saved) { --fcc-editable-region-- - + --fcc-editable-region-- - }; - } catch (error) { - - } + } + } catch (error) {} } export const FootballPlayerCard = () => { @@ -538,8 +536,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69ea0577f25e519489353f82.md b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69ea0577f25e519489353f82.md index b4c8648c7e6..52ea508d6b0 100644 --- a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69ea0577f25e519489353f82.md +++ b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69ea0577f25e519489353f82.md @@ -405,7 +405,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -418,7 +418,6 @@ interface PlayerData { const STORAGE_KEY = "football_player_card"; - export function getPlayerTier(rating: number): string { if (rating >= 92) return "elite"; if (rating >= 85) return "gold"; @@ -482,7 +481,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -505,14 +504,15 @@ function loadPlayer(): PlayerData { return { ...defaultPlayer, ...JSON.parse(saved) - } - }; ---fcc-editable-region-- + }; + } } catch (error) { +--fcc-editable-region-- } -} + --fcc-editable-region-- +} export const FootballPlayerCard = () => { const [player, setPlayer] = useState(defaultPlayer); @@ -552,8 +552,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69ea064edb0dcc46e1422cca.md b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69ea064edb0dcc46e1422cca.md index 09ebfc9a715..a71303c12bb 100644 --- a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69ea064edb0dcc46e1422cca.md +++ b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69ea064edb0dcc46e1422cca.md @@ -401,7 +401,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -477,7 +477,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -500,8 +500,8 @@ function loadPlayer(): PlayerData { return { ...defaultPlayer, ...JSON.parse(saved) - } - }; + }; + } } catch (error) { console.log("Failed to load player data, using defaults:", error); } @@ -546,8 +546,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69ea0939f2f92cfc6c7a850d.md b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69ea0939f2f92cfc6c7a850d.md index bfe4ece60d7..3fc7a6da2b9 100644 --- a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69ea0939f2f92cfc6c7a850d.md +++ b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69ea0939f2f92cfc6c7a850d.md @@ -46,12 +46,10 @@ assert.match(__helpers.removeJSComments(code), /useEffect\s*\(\(\)\s=>\s*\{\s*tr Football Player Card Builder - - - + @@ -415,7 +413,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -435,7 +433,7 @@ export function getPlayerTier(rating: number): string { return "bronze"; } -function PlayerCard({ player }: { player: PlayerData }) { +export const PlayerCard = ({ player }: { player: PlayerData }) => { return (
@@ -491,7 +489,7 @@ function PlayerCard({ player }: { player: PlayerData }) {
); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -514,8 +512,8 @@ function loadPlayer(): PlayerData { return { ...defaultPlayer, ...JSON.parse(saved) - } - }; + }; + } } catch (error) { console.log("Failed to load player data, using defaults:", error); } @@ -526,7 +524,7 @@ export const FootballPlayerCard = () => { const [player, setPlayer] = useState(defaultPlayer); --fcc-editable-region-- - + --fcc-editable-region-- return ( @@ -565,8 +563,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69ea0a89bd84cf2461b48ceb.md b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69ea0a89bd84cf2461b48ceb.md index 5598f499aff..72b7339cb43 100644 --- a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69ea0a89bd84cf2461b48ceb.md +++ b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69ea0a89bd84cf2461b48ceb.md @@ -403,7 +403,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -479,7 +479,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -502,8 +502,8 @@ function loadPlayer(): PlayerData { return { ...defaultPlayer, ...JSON.parse(saved) - } - }; + }; + } } catch (error) { console.log("Failed to load player data, using defaults:", error); } @@ -513,15 +513,15 @@ function loadPlayer(): PlayerData { export const FootballPlayerCard = () => { const [player, setPlayer] = useState(defaultPlayer); ---fcc-editable-region-- useEffect(() => { try { +--fcc-editable-region-- } catch (error) { +--fcc-editable-region-- } }, [player]); ---fcc-editable-region-- return (
@@ -559,8 +559,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69ea0bb3e7000f44c207bb0e.md b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69ea0bb3e7000f44c207bb0e.md index a3fbb9596ba..89e585fbfef 100644 --- a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69ea0bb3e7000f44c207bb0e.md +++ b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69ea0bb3e7000f44c207bb0e.md @@ -401,7 +401,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -477,7 +477,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -500,8 +500,8 @@ function loadPlayer(): PlayerData { return { ...defaultPlayer, ...JSON.parse(saved) - } - }; + }; + } } catch (error) { console.log("Failed to load player data, using defaults:", error); } @@ -557,8 +557,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( @@ -1098,7 +1099,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -1174,7 +1175,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -1197,8 +1198,8 @@ function loadPlayer(): PlayerData { return { ...defaultPlayer, ...JSON.parse(saved) - } - }; + }; + } } catch (error) { console.log("Failed to load player data, using defaults:", error); } @@ -1252,8 +1253,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69ea1bb4a66dd6debb999c7f.md b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69ea1bb4a66dd6debb999c7f.md index ee643844e66..e57c7a9c274 100644 --- a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69ea1bb4a66dd6debb999c7f.md +++ b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69ea1bb4a66dd6debb999c7f.md @@ -473,7 +473,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69ea1dd8e74976afa407bf22.md b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69ea1dd8e74976afa407bf22.md index effc76a0251..7514e3f1cbc 100644 --- a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69ea1dd8e74976afa407bf22.md +++ b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69ea1dd8e74976afa407bf22.md @@ -479,7 +479,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69ea1ed1543a4db863564aac.md b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69ea1ed1543a4db863564aac.md index b768dac4d41..d6cec0b2f0a 100644 --- a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69ea1ed1543a4db863564aac.md +++ b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69ea1ed1543a4db863564aac.md @@ -472,7 +472,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69ea21dcd8c4cb48c23a2c67.md b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69ea21dcd8c4cb48c23a2c67.md index e85a0f42972..ee9b98f9c0f 100644 --- a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69ea21dcd8c4cb48c23a2c67.md +++ b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69ea21dcd8c4cb48c23a2c67.md @@ -14,7 +14,7 @@ Aggiungi un attributo `onChange` impostato su una funzione freccia che prende `e La tua posizione `select` dovrebbe avere un gestore `onChange` che chiama `setPlayer` con uno spread di `player` e aggiorna `position`. ```js -assert.match(__helpers.removeJSComments(code), /onChange.*setPlayer.*\.\.\.\s*player[\s\S]*position/); +assert.match(__helpers.removeJSComments(code), /onChange=\{[\s\S]*?position:\s*e\.target\.value\s+as\s+Position/); ``` # --seed-- @@ -469,7 +469,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69ea2378f3c6a60a57cc29c3.md b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69ea2378f3c6a60a57cc29c3.md index d5c0fd1220d..60f1341a53a 100644 --- a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69ea2378f3c6a60a57cc29c3.md +++ b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69ea2378f3c6a60a57cc29c3.md @@ -483,7 +483,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -537,10 +537,12 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > --fcc-editable-region-- - + --fcc-editable-region-- diff --git a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69eb216380522cfc11aa408c.md b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69eb216380522cfc11aa408c.md index 45e1c839a25..436b1c7ba04 100644 --- a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69eb216380522cfc11aa408c.md +++ b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69eb216380522cfc11aa408c.md @@ -443,7 +443,7 @@ export const PlayerCard = () => { ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69eb23665c115447405343ac.md b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69eb23665c115447405343ac.md index 4046bd1f583..078d4772bfd 100644 --- a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69eb23665c115447405343ac.md +++ b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69eb23665c115447405343ac.md @@ -461,7 +461,7 @@ export const PlayerCard = () => { ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69eb2847cc8f5638e226e8ce.md b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69eb2847cc8f5638e226e8ce.md index 76dd3fd6feb..fea5d237485 100644 --- a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69eb2847cc8f5638e226e8ce.md +++ b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69eb2847cc8f5638e226e8ce.md @@ -483,10 +483,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -543,7 +543,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { --fcc-editable-region-- diff --git a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69ed3985819de69de27c4390.md b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69ed3985819de69de27c4390.md index a0d9e3cef44..55bc2a377e7 100644 --- a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69ed3985819de69de27c4390.md +++ b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69ed3985819de69de27c4390.md @@ -391,10 +391,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -453,14 +453,14 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { - name: 'PELE', + name: "PELE", overallRating: 98, - position: 'ST', - club: 'Santos FC', - imageUrl: 'https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg', + position: "ST", + club: "Santos FC", + imageUrl: "https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg", pac: 97, sho: 98, pas: 83, @@ -471,7 +471,7 @@ const defaultPlayer: PlayerData = { export const FootballPlayerCard = () => { --fcc-editable-region-- - return ; + return ; --fcc-editable-region-- }; ``` diff --git a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69f1a6f57dd2d4685822074a.md b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69f1a6f57dd2d4685822074a.md index 23020f51c38..e6078c12097 100644 --- a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69f1a6f57dd2d4685822074a.md +++ b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69f1a6f57dd2d4685822074a.md @@ -401,8 +401,8 @@ export const PlayerCard = () => {
- --fcc-editable-region--
+ --fcc-editable-region--
@@ -410,14 +410,14 @@ export const PlayerCard = () => {
-
--fcc-editable-region-- +
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69f1a9e19340f19b1fd051c6.md b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69f1a9e19340f19b1fd051c6.md index 2adcf72c76d..4d4c5190ea2 100644 --- a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69f1a9e19340f19b1fd051c6.md +++ b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69f1a9e19340f19b1fd051c6.md @@ -416,9 +416,9 @@ export const PlayerCard = () => {
- --fcc-editable-region--
+ --fcc-editable-region--
@@ -426,14 +426,14 @@ export const PlayerCard = () => {
+ --fcc-editable-region--
- --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69f1af24b0860d13f0b295e5.md b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69f1af24b0860d13f0b295e5.md index f49a89f0067..19f5e81133b 100644 --- a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69f1af24b0860d13f0b295e5.md +++ b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69f1af24b0860d13f0b295e5.md @@ -407,10 +407,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -451,9 +451,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
- --fcc-editable-region--
+ --fcc-editable-region-- 99 DRI
@@ -463,17 +463,17 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
75 + --fcc-editable-region-- PHY
- --fcc-editable-region-- ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69f1b1fb36c6c0c80907e8e1.md b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69f1b1fb36c6c0c80907e8e1.md index 83d0f7e975f..4535ad418f9 100644 --- a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69f1b1fb36c6c0c80907e8e1.md +++ b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69f1b1fb36c6c0c80907e8e1.md @@ -483,7 +483,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -511,17 +511,15 @@ export const FootballPlayerCard = () => {
- --fcc-editable-region-- -
- -
+
+ --fcc-editable-region--
+ --fcc-editable-region--
- --fcc-editable-region-- ); }; diff --git a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69f1b591221851200c734eb4.md b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69f1b591221851200c734eb4.md index 5819bdc8c31..b28ae3710cd 100644 --- a/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69f1b591221851200c734eb4.md +++ b/curriculum/challenges/italian/blocks/workshop-build-a-football-player-card-builder/69f1b591221851200c734eb4.md @@ -472,7 +472,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f356ed6199b0cdef1d2be8f.md b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f356ed6199b0cdef1d2be8f.md index ce01f6aabfc..7d953ce824e 100644 --- a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f356ed6199b0cdef1d2be8f.md +++ b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f356ed6199b0cdef1d2be8f.md @@ -13,11 +13,11 @@ Hai imparato a lavorare con i selettori `class` in lezioni precedenti come quest ```css .class-name { - styles + property: value; } ``` -Trasforma il selettore `#menu` esistente in un selettore di classe sostituendo `#menu` con una classe chiamata `.menu`. +Trasforma il selettore esistente `#menu` in un selettore di classe sostituendo `#menu` con il selettore di classe `.menu`. # --hints-- diff --git a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f3cade99dda4e6071a85dfd.md b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f3cade99dda4e6071a85dfd.md index 32f8410d025..5f90a443d2c 100644 --- a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f3cade99dda4e6071a85dfd.md +++ b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f3cade99dda4e6071a85dfd.md @@ -109,7 +109,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f3ef6e01f288a026d709587.md b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f3ef6e01f288a026d709587.md index 47f5701b1d6..320d3eb176a 100644 --- a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f3ef6e01f288a026d709587.md +++ b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f3ef6e01f288a026d709587.md @@ -171,7 +171,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f3ef6e03d719d5ac4738993.md b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f3ef6e03d719d5ac4738993.md index b116a98fe98..be5da2be8cf 100644 --- a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f3ef6e03d719d5ac4738993.md +++ b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f3ef6e03d719d5ac4738993.md @@ -115,7 +115,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f3ef6e04559b939080db057.md b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f3ef6e04559b939080db057.md index dda2c4568db..36a84ad9a38 100644 --- a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f3ef6e04559b939080db057.md +++ b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f3ef6e04559b939080db057.md @@ -139,7 +139,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f3ef6e050279c7a4a7101d3.md b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f3ef6e050279c7a4a7101d3.md index 60753d2403a..a47bdeaf82d 100644 --- a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f3ef6e050279c7a4a7101d3.md +++ b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f3ef6e050279c7a4a7101d3.md @@ -137,7 +137,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f3ef6e05473f91f948724ab.md b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f3ef6e05473f91f948724ab.md index ff65385c4c1..747e423cf3c 100644 --- a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f3ef6e05473f91f948724ab.md +++ b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f3ef6e05473f91f948724ab.md @@ -116,6 +116,6 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f3ef6e056bdde6ae6892ba2.md b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f3ef6e056bdde6ae6892ba2.md index 14bf227e968..0869ae4a57f 100644 --- a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f3ef6e056bdde6ae6892ba2.md +++ b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f3ef6e056bdde6ae6892ba2.md @@ -9,7 +9,7 @@ dashedName: step-54 È un po' noioso che tutto il testo abbia lo stesso `font-family`. Puoi comunque far sì che la maggior parte del testo sia `sans-serif` e rendere solo gli elementi `h1` e `h2` diversi usando un selettore diverso. -Definisci lo stile sia per gli elementi `h1` sia per `h2` usando un unico selettore in modo che il testo di questi elementi usi un carattere tipografico `Impact`. +Definisci lo stile sia per gli elementi `h1` che per gli elementi `h2` usando un'unica lista di selettori in modo che il testo di questi elementi usi il carattere tipografico `Impact`. # --hints-- @@ -135,7 +135,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f3ef6e06d34faac0447fc44.md b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f3ef6e06d34faac0447fc44.md index a075c256e66..b9868a45c3c 100644 --- a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f3ef6e06d34faac0447fc44.md +++ b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f3ef6e06d34faac0447fc44.md @@ -127,7 +127,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f3ef6e07276f782bb46b93d.md b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f3ef6e07276f782bb46b93d.md index e31230fd254..aaaec514efd 100644 --- a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f3ef6e07276f782bb46b93d.md +++ b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f3ef6e07276f782bb46b93d.md @@ -142,7 +142,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f3ef6e0819d4f23ca7285e6.md b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f3ef6e0819d4f23ca7285e6.md index 375886fac72..9ce0c22b408 100644 --- a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f3ef6e0819d4f23ca7285e6.md +++ b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f3ef6e0819d4f23ca7285e6.md @@ -104,7 +104,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f3ef6e087d56ed3ffdc36be.md b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f3ef6e087d56ed3ffdc36be.md index 5493218dc79..6ee0c1892e2 100644 --- a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f3ef6e087d56ed3ffdc36be.md +++ b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f3ef6e087d56ed3ffdc36be.md @@ -129,6 +129,6 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f3ef6e0a81099d9a697b550.md b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f3ef6e0a81099d9a697b550.md index d6e0aba4c35..b7ba8d22c10 100644 --- a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f3ef6e0a81099d9a697b550.md +++ b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f3ef6e0a81099d9a697b550.md @@ -167,7 +167,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f3ef6e0b431cc215bb16f55.md b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f3ef6e0b431cc215bb16f55.md index dbc186b2fa9..2478714f25a 100644 --- a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f3ef6e0b431cc215bb16f55.md +++ b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f3ef6e0b431cc215bb16f55.md @@ -141,7 +141,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f3ef6e0e0c3feaebcf647ad.md b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f3ef6e0e0c3feaebcf647ad.md index 5e5e3f250ec..a6d92e61b1d 100644 --- a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f3ef6e0e0c3feaebcf647ad.md +++ b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f3ef6e0e0c3feaebcf647ad.md @@ -103,7 +103,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f3ef6e0e9629bad967cd71e.md b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f3ef6e0e9629bad967cd71e.md index e7ab7ad35b9..ca7f9cd091f 100644 --- a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f3ef6e0e9629bad967cd71e.md +++ b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f3ef6e0e9629bad967cd71e.md @@ -7,7 +7,7 @@ dashedName: step-55 # --description-- -Puoi aggiungere un valore fallback per la font-family aggiungendo un altro nome di carattere tipografico separato da una virgola. I fallback si usano quando il carattere iniziale non viene trovato o non è disponibile. +Puoi aggiungere un valore fallback per la `font-family` aggiungendo un altro nome di carattere tipografico separato da una virgola. Un fallback viene usato quando il primo carattere tipografico non è disponibile. Aggiungi il carattere tipografico di fallback `serif` dopo il carattere `Impact`. @@ -113,7 +113,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f3ef6e0eaa7da26e3d34d78.md b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f3ef6e0eaa7da26e3d34d78.md index a5d28085038..85c7e8e8de6 100644 --- a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f3ef6e0eaa7da26e3d34d78.md +++ b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f3ef6e0eaa7da26e3d34d78.md @@ -128,7 +128,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f3ef6e0f8c230bdd2349716.md b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f3ef6e0f8c230bdd2349716.md index 148341b6f7b..ff663a165a7 100644 --- a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f3ef6e0f8c230bdd2349716.md +++ b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f3ef6e0f8c230bdd2349716.md @@ -140,6 +140,6 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f3f26fa39591db45e5cd7a0.md b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f3f26fa39591db45e5cd7a0.md index f59d7dbd906..ce0e89edb43 100644 --- a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f3f26fa39591db45e5cd7a0.md +++ b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f3f26fa39591db45e5cd7a0.md @@ -150,7 +150,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f459225127805351a6ad057.md b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f459225127805351a6ad057.md index 9494de537d2..1543a2ea6ab 100644 --- a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f459225127805351a6ad057.md +++ b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f459225127805351a6ad057.md @@ -144,7 +144,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f459a7ceb8b5c446656d88b.md b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f459a7ceb8b5c446656d88b.md index 9ecae6003af..76d5e4bb42b 100644 --- a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f459a7ceb8b5c446656d88b.md +++ b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f459a7ceb8b5c446656d88b.md @@ -147,6 +147,6 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f459cf202c2a3472fae6a9f.md b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f459cf202c2a3472fae6a9f.md index 910d37d0240..5c03910e202 100644 --- a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f459cf202c2a3472fae6a9f.md +++ b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f459cf202c2a3472fae6a9f.md @@ -7,7 +7,7 @@ dashedName: step-67 # --description-- -Hai notato come lo spessore della riga sembra più grande? Il valore predefinito di una proprietà chiamata `border-width` è `1px` per tutti i bordi degli elementi `hr`. Cambiando il bordo con lo stesso colore dello sfondo, l'altezza totale della riga diventa `5px` (`3px` più lo spessore del bordo superiore e inferiore di `1px`). +Hai notato come lo spessore della linea sembri più grande? Il valore predefinito di una proprietà chiamata `border-width` è `1px` per tutti i bordi degli elementi `hr`. L'altezza totale della linea è sempre stata di `5px` (`3px` più il bordo superiore e inferiore di `1px`); colorare il bordo ha reso visibili quei bordi. Modifica la proprietà `height` del `hr` in `2px`, così l'altezza totale diventerà `4px`. @@ -147,7 +147,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f459fd48bdc98491ca6d1a3.md b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f459fd48bdc98491ca6d1a3.md index 1b73eb75f8f..61936abdbd5 100644 --- a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f459fd48bdc98491ca6d1a3.md +++ b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f459fd48bdc98491ca6d1a3.md @@ -145,7 +145,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f45a05977e2fa49d9119437.md b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f45a05977e2fa49d9119437.md index 61565e6f403..55bd8e18af2 100644 --- a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f45a05977e2fa49d9119437.md +++ b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f45a05977e2fa49d9119437.md @@ -146,6 +146,6 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f45a276c093334f0f6e9df4.md b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f45a276c093334f0f6e9df4.md index 93b9c4b1213..a029ef434d5 100644 --- a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f45a276c093334f0f6e9df4.md +++ b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f45a276c093334f0f6e9df4.md @@ -185,7 +185,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f45a5a7c49a8251f0bdb527.md b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f45a5a7c49a8251f0bdb527.md index 7aad4cb18a5..1511da9d5bd 100644 --- a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f45a5a7c49a8251f0bdb527.md +++ b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f45a5a7c49a8251f0bdb527.md @@ -157,7 +157,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f45a66d4a2b0453301e5a26.md b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f45a66d4a2b0453301e5a26.md index 87646c71d43..33072d11195 100644 --- a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f45a66d4a2b0453301e5a26.md +++ b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f45a66d4a2b0453301e5a26.md @@ -166,7 +166,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f45b0731d39e15d54df4dfc.md b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f45b0731d39e15d54df4dfc.md index 4e504461c8f..375a816d658 100644 --- a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f45b0731d39e15d54df4dfc.md +++ b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f45b0731d39e15d54df4dfc.md @@ -161,7 +161,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f45b25e7ec2405f166b9de1.md b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f45b25e7ec2405f166b9de1.md index 203d59d2aef..64423107b8c 100644 --- a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f45b25e7ec2405f166b9de1.md +++ b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f45b25e7ec2405f166b9de1.md @@ -9,7 +9,7 @@ dashedName: step-78 Modifichi le proprietà di un collegamento quando è stato visitato usando un pseudo-selettore che assomiglia a `a:visited { propertyName: propertyValue; }`. -Cambia il colore del collegamento `Visit our website` nel piè di pagina in `grey` quando un utente ha visitato il collegamento. +Cambia il colore del collegamento `Visit our website` nel piè di pagina in `gray` quando un utente ha visitato il collegamento. # --hints-- @@ -20,14 +20,14 @@ const aVisitedStyle = new __helpers.CSSHelp(document).getStyle('a:visited'); assert.exists(aVisitedStyle); ``` -Dovresti impostare la proprietà `color` su `grey`. +Dovresti impostare la proprietà `color` su `gray`. ```js const hasColor = new __helpers.CSSHelp(document).getCSSRules().some(x => (x.style.color === 'grey' || x.style.color === 'gray')); assert.isTrue(hasColor); ``` -Il tuo `a:visited` dovrebbe avere una `color` di `grey`. +Il tuo `a:visited` dovrebbe avere un `color` di `gray`. ```js const aVisitedColor = new __helpers.CSSHelp(document).getStyle('a:visited')?.getPropertyValue('color'); @@ -161,7 +161,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f45b3c93c027860d9298dbd.md b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f45b3c93c027860d9298dbd.md index 5c422198ef3..062b87353ff 100644 --- a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f45b3c93c027860d9298dbd.md +++ b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f45b3c93c027860d9298dbd.md @@ -161,7 +161,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ @@ -179,7 +179,7 @@ a { } a:visited { - color: grey; + color: gray; } --fcc-editable-region-- diff --git a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f45b45d099f3e621fbbb256.md b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f45b45d099f3e621fbbb256.md index d83d9a790f5..50449853d4a 100644 --- a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f45b45d099f3e621fbbb256.md +++ b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f45b45d099f3e621fbbb256.md @@ -161,7 +161,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ @@ -179,7 +179,7 @@ a { } a:visited { - color: grey; + color: gray; } a:hover { diff --git a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f45b4c81cea7763550e40df.md b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f45b4c81cea7763550e40df.md index e4c81c90af6..1cf9e504bb3 100644 --- a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f45b4c81cea7763550e40df.md +++ b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f45b4c81cea7763550e40df.md @@ -152,7 +152,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ @@ -171,7 +171,7 @@ a { --fcc-editable-region-- a:visited { - color: grey; + color: gray; } a:hover { diff --git a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f45b715301bbf667badc04a.md b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f45b715301bbf667badc04a.md index 2c32661959d..086ee98e255 100644 --- a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f45b715301bbf667badc04a.md +++ b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f45b715301bbf667badc04a.md @@ -7,7 +7,7 @@ dashedName: step-82 # --description-- -Il testo del menu `CAMPER CAFE` ha uno spazio diverso in alto rispetto allo spazio in basso dell'indirizzo nel menu. Questo succede perché il browser applica un margine superiore predefinito all'elemento `h1`. +Lo spazio sopra il testo del menu `CAMPER CAFE` non corrisponde allo spazio sotto l'indirizzo in fondo al menu. Questo succede perché il browser applica un margine superiore predefinito all'elemento `h1`. Modifica il margine superiore dell'elemento `h1` impostandolo su `0` per rimuovere tutto il margine superiore. @@ -157,7 +157,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f46e270702a8456a664f0df.md b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f46e270702a8456a664f0df.md index 3bf6748b00f..5ac07d244fe 100644 --- a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f46e270702a8456a664f0df.md +++ b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f46e270702a8456a664f0df.md @@ -156,7 +156,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f46e36e745ead58487aabf2.md b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f46e36e745ead58487aabf2.md index d6be882a6ed..1e5d4e3ceaa 100644 --- a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f46e36e745ead58487aabf2.md +++ b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f46e36e745ead58487aabf2.md @@ -163,7 +163,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f46e7a4750dd05b5a673920.md b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f46e7a4750dd05b5a673920.md index b16dbb30a3e..6dd265c9f75 100644 --- a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f46e7a4750dd05b5a673920.md +++ b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f46e7a4750dd05b5a673920.md @@ -160,7 +160,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f46e8284aae155c83015dee.md b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f46e8284aae155c83015dee.md index 49cf62700c3..43f36d80f64 100644 --- a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f46e8284aae155c83015dee.md +++ b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f46e8284aae155c83015dee.md @@ -9,7 +9,7 @@ dashedName: step-86 Il menu è ben fatto, ma a parte l'immagine di sfondo con i chicchi di caffè, è principalmente solo testo. -Sotto l'intestazione `Coffee`, aggiungi un'immagine usando l'url `https://cdn.freecodecamp.org/curriculum/css-cafe/coffee.jpg`. Dai all'immagine un valore `alt` pari a `coffee icon`. +Sotto l'intestazione `Coffee`, aggiungi un'immagine usando l'URL `https://cdn.freecodecamp.org/curriculum/css-cafe/coffee.jpg`. Dai all'immagine un valore `alt` di `coffee icon`. # --hints-- @@ -105,6 +105,7 @@ assert.match(imageAltValue, /coffee icon/i);

123 Free Code Camp Drive

+ ``` @@ -171,7 +172,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f46ede1ff8fec5ba656b44c.md b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f46ede1ff8fec5ba656b44c.md index 23ff1aafc38..1673742a8cf 100644 --- a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f46ede1ff8fec5ba656b44c.md +++ b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f46ede1ff8fec5ba656b44c.md @@ -144,7 +144,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } --fcc-editable-region-- diff --git a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f46fc57528aa1c4b5ea7c2e.md b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f46fc57528aa1c4b5ea7c2e.md index 5a96bda34b5..d3a41770778 100644 --- a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f46fc57528aa1c4b5ea7c2e.md +++ b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f46fc57528aa1c4b5ea7c2e.md @@ -161,7 +161,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f4701b942c824109626c3d8.md b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f4701b942c824109626c3d8.md index 371958112a7..95ce4587bc3 100644 --- a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f4701b942c824109626c3d8.md +++ b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f4701b942c824109626c3d8.md @@ -153,6 +153,6 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f475bb508746c16c9431d42.md b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f475bb508746c16c9431d42.md index b70961300ad..c361b7daa9d 100644 --- a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f475bb508746c16c9431d42.md +++ b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f475bb508746c16c9431d42.md @@ -7,9 +7,9 @@ dashedName: step-87 # --description-- -L'immagine che hai aggiunto non è centrata orizzontalmente come l'intestazione `Coffee` sopra di essa. Gli elementi `img` sono "simili" agli elementi in linea. +L'immagine che hai aggiunto non è centrata orizzontalmente come l'intestazione `Coffee` sopra di essa. Gli elementi `img` sono elementi di livello in linea, quindi si trovano nel flusso del testo. -Per far comportare l'immagine come elementi a livello di blocco come le intestazioni, crea un selettore di tipo `img`. Imposta la proprietà `display` su `block` e usa le proprietà `margin-left` e `margin-right` per centrarla orizzontalmente. +Per far comportare l'immagine come un elemento di livello blocco come un'intestazione, crea un selettore di tipo `img`. Imposta la proprietà `display` su `block` e usa le proprietà `margin-left` e `margin-right` per centrarla orizzontalmente. # --hints-- @@ -120,6 +120,7 @@ assert.equal(imgMarginRight, 'auto');

123 Free Code Camp Drive

+ ``` @@ -190,7 +191,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f475e1c7f71a61d913836c6.md b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f475e1c7f71a61d913836c6.md index eedfca8e01c..0279b86161d 100644 --- a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f475e1c7f71a61d913836c6.md +++ b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f475e1c7f71a61d913836c6.md @@ -97,6 +97,7 @@ assert.match(lastImage?.alt, /pie icon/i);

123 Free Code Camp Drive

+ ``` diff --git a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f47fe7e31980053a8d4403b.md b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f47fe7e31980053a8d4403b.md index 39a7313528f..0ec987a2583 100644 --- a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f47fe7e31980053a8d4403b.md +++ b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f47fe7e31980053a8d4403b.md @@ -7,7 +7,7 @@ dashedName: step-89 # --description-- -Sarebbe bello se lo spazio verticale tra gli elementi `h2` e le loro icone associate fosse più piccolo. Gli elementi `h2` hanno un margine predefinito sopra e sotto, quindi potresti modificare il margine inferiore degli elementi `h2` impostandolo su `0` o un altro numero. +Sarebbe bello se lo spazio verticale tra gli elementi `h2` e le loro icone associate fosse più piccolo. Gli elementi `h2` hanno un margine superiore e inferiore predefinito, quindi potresti modificare il margine inferiore degli elementi `h2` a `0` o a qualche altro valore. C'è un modo più semplice: basta aggiungere un margine superiore negativo agli elementi `img` per sollevarli dalle loro posizioni attuali. I valori negativi si creano usando un `-` davanti al valore. Per completare questo workshop, usa un margine superiore negativo di `25px` nel selettore di tipo `img`. diff --git a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f716ad029ee4053c7027a7a.md b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f716ad029ee4053c7027a7a.md index 7ce3c358c53..414a766d8aa 100644 --- a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f716ad029ee4053c7027a7a.md +++ b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f716ad029ee4053c7027a7a.md @@ -119,7 +119,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f716bee5838c354c728a7c5.md b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f716bee5838c354c728a7c5.md index 57a3d2019cc..cfffc00f681 100644 --- a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f716bee5838c354c728a7c5.md +++ b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f716bee5838c354c728a7c5.md @@ -158,6 +158,6 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f7b87422a560036fd03ccff.md b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f7b87422a560036fd03ccff.md index 2244daa84a9..a3ed2fce6cf 100644 --- a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f7b87422a560036fd03ccff.md +++ b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f7b87422a560036fd03ccff.md @@ -118,7 +118,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f7b88d37b1f98386f04edc0.md b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f7b88d37b1f98386f04edc0.md index ca8ec268c45..4c39ec4cfc3 100644 --- a/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f7b88d37b1f98386f04edc0.md +++ b/curriculum/challenges/italian/blocks/workshop-cafe-menu/5f7b88d37b1f98386f04edc0.md @@ -97,6 +97,6 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/italian/blocks/workshop-cafe-menu/6780e8ef4153930b965cd7b7.md b/curriculum/challenges/italian/blocks/workshop-cafe-menu/6780e8ef4153930b965cd7b7.md index 2699e567981..763be5c2c43 100644 --- a/curriculum/challenges/italian/blocks/workshop-cafe-menu/6780e8ef4153930b965cd7b7.md +++ b/curriculum/challenges/italian/blocks/workshop-cafe-menu/6780e8ef4153930b965cd7b7.md @@ -125,6 +125,6 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/italian/blocks/workshop-cafe-menu/6780f0d898362873ac425dc8.md b/curriculum/challenges/italian/blocks/workshop-cafe-menu/6780f0d898362873ac425dc8.md index ef7c3059605..937e8e09c21 100644 --- a/curriculum/challenges/italian/blocks/workshop-cafe-menu/6780f0d898362873ac425dc8.md +++ b/curriculum/challenges/italian/blocks/workshop-cafe-menu/6780f0d898362873ac425dc8.md @@ -156,7 +156,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/italian/blocks/workshop-calculator/66cc095dfe1682753d2ab030.md b/curriculum/challenges/italian/blocks/workshop-calculator/66cc095dfe1682753d2ab030.md index d5b4207b358..f8767f71bab 100644 --- a/curriculum/challenges/italian/blocks/workshop-calculator/66cc095dfe1682753d2ab030.md +++ b/curriculum/challenges/italian/blocks/workshop-calculator/66cc095dfe1682753d2ab030.md @@ -30,7 +30,10 @@ assert.strictEqual(addTwoAndSeven(), 9); La tua funzione `addTwoAndSeven` dovrebbe restituire la somma usando l'operatore `+`. ```js -assert.match(code, /return\s*(2\s*\+\s*7|7\s*\+\s*2)\s*;?/); +const explorer = await __helpers.Explorer(code); +const { addTwoAndSeven } = explorer.allFunctions; +const validExpressions = ["2 + 7", "7 + 2", "(2 + 7)", "(7 + 2)"]; +assert.isTrue(validExpressions.some(expr => addTwoAndSeven?.hasReturn(expr))); ``` # --seed-- diff --git a/curriculum/challenges/italian/blocks/workshop-calculator/66cc0a9e06e00b75d6782be9.md b/curriculum/challenges/italian/blocks/workshop-calculator/66cc0a9e06e00b75d6782be9.md index a13091f7c0b..44f163cdb99 100644 --- a/curriculum/challenges/italian/blocks/workshop-calculator/66cc0a9e06e00b75d6782be9.md +++ b/curriculum/challenges/italian/blocks/workshop-calculator/66cc0a9e06e00b75d6782be9.md @@ -26,16 +26,12 @@ Ora dovresti vedere la somma di `2` e `7` stampata nella console. # --hints-- -Dovresti avere un `console.log` nel tuo codice. +Dovresti chiamare la funzione `addTwoAndSeven` all'interno di una `console.log`. ```js -assert.match(code, /console\.log(.*)/); -``` - -Dovresti chiamare la funzione `addTwoAndSeven` all'interno del `console.log`. - -```js -assert.match(code, /console\.log\(\s*addTwoAndSeven\(\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(addTwoAndSeven())"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/italian/blocks/workshop-calculator/66cc0ba5881acb7692cfc4de.md b/curriculum/challenges/italian/blocks/workshop-calculator/66cc0ba5881acb7692cfc4de.md index 92c5b58bd29..ae8b3cd87bc 100644 --- a/curriculum/challenges/italian/blocks/workshop-calculator/66cc0ba5881acb7692cfc4de.md +++ b/curriculum/challenges/italian/blocks/workshop-calculator/66cc0ba5881acb7692cfc4de.md @@ -24,22 +24,24 @@ assert.isFunction(addThreeAndFour); La tua funzione `addThreeAndFour` dovrebbe restituire la somma di `3` e `4`. ```js -assert.equal(addThreeAndFour(), 7); +assert.strictEqual(addThreeAndFour(), 7); ``` La tua funzione `addThreeAndFour` dovrebbe restituire la somma usando l'operatore `+`. ```js -const declarationStyle = /return\s*\(?\s*(3\s*\+\s*4|4\s*\+\s*3)\s*\)?\s*;?/; -const arrowStyle = /=>\s*\(?\s*(3\s*\+\s*4|4\s*\+\s*3)\s*\)?\s*;?/; -const combinedRegex = new RegExp(`(?:${declarationStyle.source})|(?:${arrowStyle.source})`); -assert.match(code, combinedRegex); +const explorer = await __helpers.Explorer(code); +const { addThreeAndFour } = explorer.allFunctions; +const validExpressions = ["3 + 4", "4 + 3", "(3 + 4)", "(4 + 3)"]; +assert.isTrue(validExpressions.some(expr => addThreeAndFour?.hasReturn(expr))); ``` Dovresti chiamare la funzione `addThreeAndFour` all'interno di un `console.log`. ```js -assert.match(code, /console\.log\(\s*addThreeAndFour\(\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(addThreeAndFour())"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/italian/blocks/workshop-calculator/66cc0de2920bec775f610424.md b/curriculum/challenges/italian/blocks/workshop-calculator/66cc0de2920bec775f610424.md index 39f2652eed1..64141c45e2c 100644 --- a/curriculum/challenges/italian/blocks/workshop-calculator/66cc0de2920bec775f610424.md +++ b/curriculum/challenges/italian/blocks/workshop-calculator/66cc0de2920bec775f610424.md @@ -22,25 +22,33 @@ Nel passaggio successivo, vedrai come lavorare con parametri e argomenti nelle f Non dovresti avere una funzione chiamata `addTwoAndSeven`. ```js -assert.notMatch(code, /function\s+addTwoAndSeven\s*\(\s*\)\s*{/); +const explorer = await __helpers.Explorer(code); +const { addTwoAndSeven } = explorer.allFunctions; +assert.notExists(addTwoAndSeven); ``` Non dovresti avere una chiamata a funzione a `addTwoAndSeven`. ```js -assert.notMatch(code, /console\.log\(\s*addTwoAndSeven\(\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const unexpectedStatement = "console.log(addTwoAndSeven())"; +assert.notInclude(strippedCode, unexpectedStatement); ``` Non dovresti avere una funzione chiamata `addThreeAndFour`. ```js -assert.notMatch(code, /function\s+addThreeAndFour\s*\(\s*\)\s*{/); +const explorer = await __helpers.Explorer(code); +const { addThreeAndFour } = explorer.allFunctions; +assert.notExists(addThreeAndFour); ``` Non dovresti avere una chiamata a funzione a `addThreeAndFour`. ```js -assert.notMatch(code, /console\.log\(\s*addThreeAndFour\(\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const unexpectedStatement = "console.log(addThreeAndFour())"; +assert.notInclude(strippedCode, unexpectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/italian/blocks/workshop-calculator/66cc0f1ae40802781b2ea972.md b/curriculum/challenges/italian/blocks/workshop-calculator/66cc0f1ae40802781b2ea972.md index 5409b5a0470..6fa79dbfe3c 100644 --- a/curriculum/challenges/italian/blocks/workshop-calculator/66cc0f1ae40802781b2ea972.md +++ b/curriculum/challenges/italian/blocks/workshop-calculator/66cc0f1ae40802781b2ea972.md @@ -33,8 +33,11 @@ assert.isFunction(calculateSum); La tua funzione `calculateSum` dovrebbe prendere due parametri, `num1` e `num2`. ```js -const regex = __helpers.functionRegex('calculateSum', ['num1', 'num2']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { calculateSum } = explorer.allFunctions; +assert.lengthOf(calculateSum?.parameters, 2); +assert.equal(calculateSum?.parameters[0].toString(), "num1"); +assert.equal(calculateSum?.parameters[1].toString(), "num2"); ``` # --seed-- diff --git a/curriculum/challenges/italian/blocks/workshop-calculator/66cc12fa504b0479dac479a0.md b/curriculum/challenges/italian/blocks/workshop-calculator/66cc12fa504b0479dac479a0.md index f1b1b2b23fd..990a73978ed 100644 --- a/curriculum/challenges/italian/blocks/workshop-calculator/66cc12fa504b0479dac479a0.md +++ b/curriculum/challenges/italian/blocks/workshop-calculator/66cc12fa504b0479dac479a0.md @@ -29,7 +29,9 @@ Aggiungi un `console.log` che chiami la funzione `calculateSum` con gli argoment Dovresti avere un `console.log` che chiami la funzione `calculateSum` con gli argomenti `2` e `5`. ```js -assert.match(code, /console\.log\(calculateSum\(\s*2\s*,\s*5\)\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const validStatements = ["console.log(calculateSum(2,5))", "console.log(calculateSum(5,2))"]; +assert.isTrue(validStatements.some(stmt => strippedCode.includes(stmt))); ``` # --seed-- diff --git a/curriculum/challenges/italian/blocks/workshop-calculator/66cc14ca14e65e7a9ebecb80.md b/curriculum/challenges/italian/blocks/workshop-calculator/66cc14ca14e65e7a9ebecb80.md index 13a0b215ce3..d0a8c88b05f 100644 --- a/curriculum/challenges/italian/blocks/workshop-calculator/66cc14ca14e65e7a9ebecb80.md +++ b/curriculum/challenges/italian/blocks/workshop-calculator/66cc14ca14e65e7a9ebecb80.md @@ -15,7 +15,7 @@ All'interno della funzione, restituisci la differenza tra i due parametri. # --hints-- -Dovresti avere una funzione chiamata `calculateDifference`. +Dovresti dichiarare una funzione chiamata `calculateDifference`. ```js assert.isFunction(calculateDifference); @@ -24,8 +24,11 @@ assert.isFunction(calculateDifference); La tua funzione `calculateDifference` dovrebbe avere due parametri chiamati `num1` e `num2`. ```js -const regex = __helpers.functionRegex('calculateDifference', ['num1', 'num2']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { calculateDifference } = explorer.allFunctions; +assert.lengthOf(calculateDifference?.parameters, 2); +assert.equal(calculateDifference?.parameters[0].toString(), "num1"); +assert.equal(calculateDifference?.parameters[1].toString(), "num2"); ``` La tua funzione `calculateDifference` dovrebbe restituire la differenza tra i due parametri. diff --git a/curriculum/challenges/italian/blocks/workshop-calculator/66cc16abc30b367ba1d1f9ef.md b/curriculum/challenges/italian/blocks/workshop-calculator/66cc16abc30b367ba1d1f9ef.md index cdb38e9119b..30af50598f3 100644 --- a/curriculum/challenges/italian/blocks/workshop-calculator/66cc16abc30b367ba1d1f9ef.md +++ b/curriculum/challenges/italian/blocks/workshop-calculator/66cc16abc30b367ba1d1f9ef.md @@ -20,19 +20,25 @@ Infine, aggiungi una terza `console.log` che chiama la funzione `calculateDiffer Dovresti avere una `console.log` che chiama la funzione `calculateDifference` con gli argomenti `22` e `5`. ```js -assert.match(code, /console\.log\s*\(\s*calculateDifference\s*\(\s*22\s*,\s*5\s*\)\s*\)\s*;?/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateDifference(22,5))"; +assert.include(strippedCode, expectedStatement); ``` Dovresti avere una `console.log` che chiama la funzione `calculateDifference` con gli argomenti `12` e `1`. ```js -assert.match(code, /console\.log\s*\(\s*calculateDifference\s*\(\s*12\s*,\s*1\s*\)\s*\)\s*;?/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateDifference(12,1))"; +assert.include(strippedCode, expectedStatement); ``` Dovresti avere una `console.log` che chiama la funzione `calculateDifference` con gli argomenti `17` e `9`. ```js -assert.match(code, /console\.log\s*\(\s*calculateDifference\s*\(\s*17\s*,\s*9\s*\)\s*\)\s*;?/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateDifference(17,9))"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/italian/blocks/workshop-calculator/66cc172af7159a7c67804544.md b/curriculum/challenges/italian/blocks/workshop-calculator/66cc172af7159a7c67804544.md index 9e38a6eb608..9417e5c2b6b 100644 --- a/curriculum/challenges/italian/blocks/workshop-calculator/66cc172af7159a7c67804544.md +++ b/curriculum/challenges/italian/blocks/workshop-calculator/66cc172af7159a7c67804544.md @@ -17,7 +17,7 @@ Poi, aggiungi una `console.log` che chiama la funzione `calculateProduct` con gl # --hints-- -Dovresti avere una funzione chiamata `calculateProduct`. +Dovresti dichiarare una funzione chiamata `calculateProduct`. ```js assert.isFunction(calculateProduct); @@ -26,8 +26,11 @@ assert.isFunction(calculateProduct); La tua funzione `calculateProduct` dovrebbe avere due parametri chiamati `num1` e `num2`. ```js -const regex = __helpers.functionRegex('calculateProduct', ['num1', 'num2']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { calculateProduct } = explorer.allFunctions; +assert.lengthOf(calculateProduct?.parameters, 2); +assert.equal(calculateProduct?.parameters[0].toString(), "num1"); +assert.equal(calculateProduct?.parameters[1].toString(), "num2"); ``` La tua funzione `calculateProduct` dovrebbe restituire il prodotto dei due parametri. @@ -40,7 +43,9 @@ assert.equal(calculateProduct(10, 5), 50); Dovresti avere una `console.log` che chiama la funzione `calculateProduct` con gli argomenti `13` e `5`. ```js -assert.match(code, /console\.log\s*\(\s*calculateProduct\s*\(\s*13\s*,\s*5\s*\)\s*\)\s*;?/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const validStatements = ["console.log(calculateProduct(13,5))", "console.log(calculateProduct(5,13))"]; +assert.isTrue(validStatements.some(stmt => strippedCode.includes(stmt))); ``` # --seed-- diff --git a/curriculum/challenges/italian/blocks/workshop-calculator/66cc1a3a39aef47d6473cb2f.md b/curriculum/challenges/italian/blocks/workshop-calculator/66cc1a3a39aef47d6473cb2f.md index 955a9115f4a..f9395e9ec04 100644 --- a/curriculum/challenges/italian/blocks/workshop-calculator/66cc1a3a39aef47d6473cb2f.md +++ b/curriculum/challenges/italian/blocks/workshop-calculator/66cc1a3a39aef47d6473cb2f.md @@ -17,7 +17,7 @@ Poi, aggiungi una `console.log` che chiama la funzione `calculateQuotient` con g # --hints-- -Dovresti avere una funzione chiamata `calculateQuotient`. +Dovresti dichiarare una funzione chiamata `calculateQuotient`. ```js assert.isFunction(calculateQuotient); @@ -26,8 +26,11 @@ assert.isFunction(calculateQuotient); La tua funzione `calculateQuotient` dovrebbe avere due parametri chiamati `num1` e `num2`. ```js -const regex = __helpers.functionRegex('calculateQuotient', ['num1', 'num2']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { calculateQuotient } = explorer.allFunctions; +assert.lengthOf(calculateQuotient?.parameters, 2); +assert.equal(calculateQuotient?.parameters[0].toString(), "num1"); +assert.equal(calculateQuotient?.parameters[1].toString(), "num2"); ``` La tua funzione `calculateQuotient` dovrebbe restituire il quoziente dei due parametri. @@ -40,7 +43,9 @@ assert.equal(calculateQuotient(100, 10), 10); Dovresti avere una `console.log` che chiama la funzione `calculateQuotient` con gli argomenti `7` e `11`. ```js -assert.match(code, /console\.log\s*\(\s*calculateQuotient\s*\(\s*7\s*,\s*11\s*\)\s*\)\s*;?/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateQuotient(7,11))"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/italian/blocks/workshop-calculator/66cc1ccfefdd727e18c2ab20.md b/curriculum/challenges/italian/blocks/workshop-calculator/66cc1ccfefdd727e18c2ab20.md index 55e1d9ba72f..88e6f1bba88 100644 --- a/curriculum/challenges/italian/blocks/workshop-calculator/66cc1ccfefdd727e18c2ab20.md +++ b/curriculum/challenges/italian/blocks/workshop-calculator/66cc1ccfefdd727e18c2ab20.md @@ -7,7 +7,7 @@ dashedName: step-14 # --description-- -Il tuo `calculateQuotient` sembra funzionare correttamente ma c’è un caso che non hai ancora testato. +`calculateQuotient` sembra funzionare correttamente, ma c'è un caso che non hai ancora testato. Aggiungi un `console.log` che chiami la funzione `calculateQuotient` con gli argomenti `3` e `0`. @@ -18,7 +18,9 @@ Assicurati di osservare attentamente l’output di questa chiamata. Dovresti avere un `console.log` che chiami la funzione `calculateQuotient` con gli argomenti `3` e `0`. ```js -assert.match(code, /console\.log\s*\(\s*calculateQuotient\s*\(\s*3\s*,\s*0\s*\)\s*\)\s*;?/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateQuotient(3,0))"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/italian/blocks/workshop-calculator/66cc1deb1f04647f2aabee2b.md b/curriculum/challenges/italian/blocks/workshop-calculator/66cc1deb1f04647f2aabee2b.md index 728d836c7c0..e727fdcd63b 100644 --- a/curriculum/challenges/italian/blocks/workshop-calculator/66cc1deb1f04647f2aabee2b.md +++ b/curriculum/challenges/italian/blocks/workshop-calculator/66cc1deb1f04647f2aabee2b.md @@ -20,8 +20,8 @@ Se lo è, la funzione dovrebbe restituire la stringa `"Error: Division by zero"` La tua funzione `calculateQuotient` dovrebbe restituire la stringa `"Error: Division by zero"` se `num2` è zero. ```js -assert.strictEqual(calculateQuotient(10, 0), 'Error: Division by zero'); -assert.strictEqual(calculateQuotient(3, 0), 'Error: Division by zero'); +assert.strictEqual(calculateQuotient(10, 0), "Error: Division by zero"); +assert.strictEqual(calculateQuotient(3, 0), "Error: Division by zero"); ``` La tua funzione `calculateQuotient` dovrebbe restituire il risultato della divisione di `num1` per `num2` se `num2` non è zero. diff --git a/curriculum/challenges/italian/blocks/workshop-calculator/66cc21d23238dc8240a8a182.md b/curriculum/challenges/italian/blocks/workshop-calculator/66cc21d23238dc8240a8a182.md index 421467488ed..a375455f6a0 100644 --- a/curriculum/challenges/italian/blocks/workshop-calculator/66cc21d23238dc8240a8a182.md +++ b/curriculum/challenges/italian/blocks/workshop-calculator/66cc21d23238dc8240a8a182.md @@ -28,7 +28,7 @@ Dichiara una funzione chiamata `calculateSquare` che prende un parametro `num` e # --hints-- -Dovresti avere una funzione chiamata `calculateSquare`. +Dovresti dichiarare una funzione chiamata `calculateSquare`. ```js assert.isFunction(calculateSquare); @@ -37,8 +37,10 @@ assert.isFunction(calculateSquare); La tua funzione `calculateSquare` dovrebbe prendere un parametro `num`. ```js -const regex = __helpers.functionRegex('calculateSquare', ['num']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { calculateSquare } = explorer.allFunctions; +assert.lengthOf(calculateSquare?.parameters, 1); +assert.equal(calculateSquare?.parameters[0].toString(), "num"); ``` La tua funzione `calculateSquare` dovrebbe restituire il quadrato di `num`. diff --git a/curriculum/challenges/italian/blocks/workshop-calculator/66cc26907ff6908402af0149.md b/curriculum/challenges/italian/blocks/workshop-calculator/66cc26907ff6908402af0149.md index 26f67fb5789..08f843f869a 100644 --- a/curriculum/challenges/italian/blocks/workshop-calculator/66cc26907ff6908402af0149.md +++ b/curriculum/challenges/italian/blocks/workshop-calculator/66cc26907ff6908402af0149.md @@ -18,13 +18,17 @@ Poi, aggiungi un'altra `console.log` che chiami la funzione `calculateSquare` co Dovresti avere una `console.log` che chiami la funzione `calculateSquare` con l'argomento `2`. ```js -assert.match(code, /console\.log\s*\(\s*calculateSquare\s*\(\s*2\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateSquare(2))"; +assert.include(strippedCode, expectedStatement); ``` Dovresti avere una `console.log` che chiami la funzione `calculateSquare` con l'argomento `9`. ```js -assert.match(code, /console\.log\s*\(\s*calculateSquare\s*\(\s*9\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateSquare(9))"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/italian/blocks/workshop-calculator/66cc2739f687e484d50bb6f1.md b/curriculum/challenges/italian/blocks/workshop-calculator/66cc2739f687e484d50bb6f1.md index 49c41de9498..6daa83d4207 100644 --- a/curriculum/challenges/italian/blocks/workshop-calculator/66cc2739f687e484d50bb6f1.md +++ b/curriculum/challenges/italian/blocks/workshop-calculator/66cc2739f687e484d50bb6f1.md @@ -26,7 +26,7 @@ Dichiara una funzione chiamata `calculateSquareRoot` che prende un parametro `nu # --hints-- -Dovresti avere una funzione chiamata `calculateSquareRoot`. +Dovresti dichiarare una funzione chiamata `calculateSquareRoot`. ```js assert.isFunction(calculateSquareRoot); @@ -35,8 +35,10 @@ assert.isFunction(calculateSquareRoot); La tua funzione `calculateSquareRoot` dovrebbe prendere un parametro `num`. ```js -const regex = __helpers.functionRegex('calculateSquareRoot', ['num']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { calculateSquareRoot } = explorer.allFunctions; +assert.lengthOf(calculateSquareRoot?.parameters, 1); +assert.equal(calculateSquareRoot?.parameters[0].toString(), "num"); ``` La tua funzione `calculateSquareRoot` dovrebbe restituire la radice quadrata di `num`. diff --git a/curriculum/challenges/italian/blocks/workshop-calculator/66cc281d687975858049fd8d.md b/curriculum/challenges/italian/blocks/workshop-calculator/66cc281d687975858049fd8d.md index 49f6cd9c444..e859d5316cd 100644 --- a/curriculum/challenges/italian/blocks/workshop-calculator/66cc281d687975858049fd8d.md +++ b/curriculum/challenges/italian/blocks/workshop-calculator/66cc281d687975858049fd8d.md @@ -20,13 +20,17 @@ E con queste modifiche, la tua app calcolatrice è completa! Dovresti avere una `console.log` che chiama la funzione `calculateSquareRoot` con l'argomento `25`. ```js -assert.match(code, /console\.log\s*\(\s*calculateSquareRoot\s*\(\s*25\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateSquareRoot(25))"; +assert.include(strippedCode, expectedStatement); ``` Dovresti avere una `console.log` che chiama la funzione `calculateSquareRoot` con l'argomento `100`. ```js -assert.match(code, /console\.log\s*\(\s*calculateSquareRoot\s*\(\s*100\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateSquareRoot(100))"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/italian/blocks/workshop-calculator/66cdf76685e4cb5a8726e27b.md b/curriculum/challenges/italian/blocks/workshop-calculator/66cdf76685e4cb5a8726e27b.md index 2643367dd0d..dd8d7045474 100644 --- a/curriculum/challenges/italian/blocks/workshop-calculator/66cdf76685e4cb5a8726e27b.md +++ b/curriculum/challenges/italian/blocks/workshop-calculator/66cdf76685e4cb5a8726e27b.md @@ -18,13 +18,17 @@ Sotto quel `console.log`, aggiungi un altro `console.log` che chiama la funzione Dovresti avere un `console.log` che chiama la funzione `calculateSum` con gli argomenti `10` e `10`. ```js -assert.match(code, /console\.log\(calculateSum\(10\s*,\s*10\)\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateSum(10,10))"; +assert.include(strippedCode, expectedStatement); ``` Dovresti avere un `console.log` che chiama la funzione `calculateSum` con gli argomenti `5` e `5`. ```js -assert.match(code, /console\.log\(calculateSum\(5\s*,\s*5\)\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateSum(5,5))"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/646c48df8674cf2b91020ecc.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/646c48df8674cf2b91020ecc.md index 399fa606901..05c779b9175 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/646c48df8674cf2b91020ecc.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/646c48df8674cf2b91020ecc.md @@ -35,12 +35,13 @@ assert.oneOf(href, ["./styles.css", "styles.css"]); ```html ---fcc-editable-region-- - - fCC Cat Painting - + + fCC Cat Painting --fcc-editable-region-- + +--fcc-editable-region-- + ``` diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/646c586be7180e40ddf74ff6.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/646c586be7180e40ddf74ff6.md index ef694ee1779..daa1c94b8bd 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/646c586be7180e40ddf74ff6.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/646c586be7180e40ddf74ff6.md @@ -31,9 +31,9 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('body')?.backgroundColor, - - fCC Cat Painting - + + fCC Cat Painting + @@ -48,3 +48,4 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('body')?.backgroundColor, --fcc-editable-region-- ``` + diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/646c59e942f35541923104bf.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/646c59e942f35541923104bf.md index 94f2ed9a053..082c5722c01 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/646c59e942f35541923104bf.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/646c59e942f35541923104bf.md @@ -43,13 +43,13 @@ assert.lengthOf(document.querySelectorAll('main div'), 1); - - fCC Cat Painting - + + fCC Cat Painting + --fcc-editable-region-- - + --fcc-editable-region-- diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/646c5ace05e4be4211407935.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/646c5ace05e4be4211407935.md index ff0291d186b..ef8b1560a58 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/646c5ace05e4be4211407935.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/646c5ace05e4be4211407935.md @@ -50,14 +50,14 @@ assert.equal(secondGradient,'(69,69,79)100%)'); - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
+
+
+
``` @@ -71,13 +71,13 @@ body { background-color: #c9d2fc; } ---fcc-editable-region-- .cat-head { +--fcc-editable-region-- + +--fcc-editable-region-- width: 205px; height: 180px; border: 1px solid #000; border-radius: 46%; - } ---fcc-editable-region-- ``` diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/646c5d7057c45f432fcdd46c.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/646c5d7057c45f432fcdd46c.md index d89f734e055..5395210f3c7 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/646c5d7057c45f432fcdd46c.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/646c5d7057c45f432fcdd46c.md @@ -7,7 +7,7 @@ dashedName: step-5 # --description-- -Usando un selettore di classe, assegna all'elemento `.cat-head` una larghezza di `205px` e un'altezza di `180px`. Inoltre, dagli un bordo di `1px solid #000` e un `border-radius` di `46%`. +Usando un selettore di classe, assegna all'elemento `.cat-head` una larghezza di `205px` e un'altezza di `180px`. Inoltre, dagli un bordo di `1px solid #000` e un `border-radius` di `46%`. # --hints-- @@ -50,13 +50,13 @@ assert.equal(new __helpers.CSSHelp(document)?.getStyle(".cat-head")?.borderRadiu - - fCC Cat Painting - + + fCC Cat Painting +
-
+
diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/646c5e727e56e743c9aed4a1.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/646c5e727e56e743c9aed4a1.md index da6e3d36f9e..8343fc5826b 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/646c5e727e56e743c9aed4a1.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/646c5e727e56e743c9aed4a1.md @@ -44,14 +44,14 @@ assert.equal(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.left, '100p - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
+
+
+
``` @@ -65,16 +65,14 @@ body { background-color: #c9d2fc; } ---fcc-editable-region-- .cat-head { - - +--fcc-editable-region-- +--fcc-editable-region-- background: linear-gradient(#5e5e5e 85%, #45454f 100%); width: 205px; height: 180px; border: 1px solid #000; border-radius: 46%; } ---fcc-editable-region-- ``` diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/646c5ffef5598d449b52ec12.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/646c5ffef5598d449b52ec12.md index 912dff60b1e..6769745a63f 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/646c5ffef5598d449b52ec12.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/646c5ffef5598d449b52ec12.md @@ -39,18 +39,18 @@ assert.equal(document.querySelectorAll('.cat-head div')[0]?.getAttribute('class' - - fCC Cat Painting - + + fCC Cat Painting + -
+
+
--fcc-editable-region-- -
- -
+ --fcc-editable-region-- -
+ +
``` diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/646ce8bb4b35544d501c7184.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/646ce8bb4b35544d501c7184.md index 64550371aa8..26c28c4514b 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/646ce8bb4b35544d501c7184.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/646ce8bb4b35544d501c7184.md @@ -43,20 +43,20 @@ assert.isTrue(document.querySelectorAll('.cat-ears div')[1]?.classList.contains( - - fCC Cat Painting - + + fCC Cat Painting + -
-
+
+
+
--fcc-editable-region-- -
- -
+ --fcc-editable-region--
-
+
+
``` diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/646ce9d790d2a44de5f99e04.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/646ce9d790d2a44de5f99e04.md index 6c5fa97e34f..f6f36df596e 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/646ce9d790d2a44de5f99e04.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/646ce9d790d2a44de5f99e04.md @@ -55,25 +55,25 @@ assert.isTrue(document.querySelectorAll('.cat-right-ear div')[0]?.classList.cont - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
- --fcc-editable-region-- -
- -
-
- -
- --fcc-editable-region-- +
+
+
+
+--fcc-editable-region-- + +
+
+ +--fcc-editable-region--
-
+
+
``` diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/646ceb843412c74edee27a79.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/646ceb843412c74edee27a79.md index 1e5371098eb..fac76dfab21 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/646ceb843412c74edee27a79.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/646ceb843412c74edee27a79.md @@ -67,23 +67,23 @@ assert.strictEqual(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.b - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/646cecc9eb5c4f4f73dafd07.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/646cecc9eb5c4f4f73dafd07.md index d4d0007c1f6..774c81b800a 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/646cecc9eb5c4f4f73dafd07.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/646cecc9eb5c4f4f73dafd07.md @@ -37,23 +37,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-ear')?.left, '- - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` @@ -81,12 +81,12 @@ body { border-radius: 46%; } ---fcc-editable-region-- .cat-left-ear { +--fcc-editable-region-- +--fcc-editable-region-- border-left: 35px solid transparent; border-right: 35px solid transparent; border-bottom: 70px solid #5e5e5e; } ---fcc-editable-region-- ``` diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/646cef0c2b98915094df7099.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/646cef0c2b98915094df7099.md index e715566cbee..384e147d33d 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/646cef0c2b98915094df7099.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/646cef0c2b98915094df7099.md @@ -31,23 +31,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-ear')?.borderTo - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/646cf1206cac5f51804f49cf.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/646cf1206cac5f51804f49cf.md index a49bce83b99..00bdb233442 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/646cf1206cac5f51804f49cf.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/646cf1206cac5f51804f49cf.md @@ -29,23 +29,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-ear')?.transfor - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/646cf2249f02ca5233d9af7c.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/646cf2249f02ca5233d9af7c.md index 08719f1f947..13b162f4d3a 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/646cf2249f02ca5233d9af7c.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/646cf2249f02ca5233d9af7c.md @@ -45,23 +45,23 @@ assert.strictEqual(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.b - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/646cf48d8f8e1f535a1821d3.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/646cf48d8f8e1f535a1821d3.md index 54e9672f90e..5aa42891a0d 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/646cf48d8f8e1f535a1821d3.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/646cf48d8f8e1f535a1821d3.md @@ -37,23 +37,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.left, ' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/646cf6cbca98e258da65c979.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/646cf6cbca98e258da65c979.md index 2926e1d7e44..e307e8baccd 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/646cf6cbca98e258da65c979.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/646cf6cbca98e258da65c979.md @@ -25,23 +25,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.transfo - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/646cf88aa884405a11ea5bcc.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/646cf88aa884405a11ea5bcc.md index 519c6f828b0..5a7af05392d 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/646cf88aa884405a11ea5bcc.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/646cf88aa884405a11ea5bcc.md @@ -31,23 +31,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.borderT - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/646cfc2b8e6fe95c20a819d5.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/646cfc2b8e6fe95c20a819d5.md index 2da18e852b1..abe432360a8 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/646cfc2b8e6fe95c20a819d5.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/646cfc2b8e6fe95c20a819d5.md @@ -29,23 +29,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-ear')?.zIndex, - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/646cfd853634255d02b64cc1.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/646cfd853634255d02b64cc1.md index c0954c43a58..01e36c5b3f0 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/646cfd853634255d02b64cc1.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/646cfd853634255d02b64cc1.md @@ -27,23 +27,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-ear')?.zIndex, - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/646cfde6ac612e5d60391f50.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/646cfde6ac612e5d60391f50.md index 2075dd7d912..f95aa34afd5 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/646cfde6ac612e5d60391f50.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/646cfde6ac612e5d60391f50.md @@ -25,23 +25,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.zIndex, - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/646dd556d524bc61c0139bd6.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/646dd556d524bc61c0139bd6.md index bc509ca7ac8..437e1295caa 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/646dd556d524bc61c0139bd6.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/646dd556d524bc61c0139bd6.md @@ -45,23 +45,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-inner-ear')?.bo - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/646dd6f9caa862627dd87772.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/646dd6f9caa862627dd87772.md index e5388797dff..ba95de26443 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/646dd6f9caa862627dd87772.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/646dd6f9caa862627dd87772.md @@ -37,23 +37,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-inner-ear')?.le - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/646dd7cfd0cfac630c1dd520.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/646dd7cfd0cfac630c1dd520.md index 5539046529a..09b923fbcab 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/646dd7cfd0cfac630c1dd520.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/646dd7cfd0cfac630c1dd520.md @@ -43,23 +43,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-inner-ear')?.bo - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/646dd8c79ec23463a3d0e356.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/646dd8c79ec23463a3d0e356.md index b2990c1aa49..c334a899a93 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/646dd8c79ec23463a3d0e356.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/646dd8c79ec23463a3d0e356.md @@ -43,23 +43,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-inner-ear')?.b - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/646dd9d9a729916460724f16.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/646dd9d9a729916460724f16.md index 7fb2a4d875b..6e0f8656891 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/646dd9d9a729916460724f16.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/646dd9d9a729916460724f16.md @@ -37,23 +37,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-inner-ear')?.l - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/646ddab8afd73764f5241bbf.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/646ddab8afd73764f5241bbf.md index 1239a53d508..72ab10ee10a 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/646ddab8afd73764f5241bbf.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/646ddab8afd73764f5241bbf.md @@ -43,23 +43,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-inner-ear')?.b - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/646ddb61ff08366570cc5902.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/646ddb61ff08366570cc5902.md index e562295f43c..050eb16e11c 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/646ddb61ff08366570cc5902.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/646ddb61ff08366570cc5902.md @@ -45,27 +45,27 @@ assert.isTrue(document.querySelectorAll('.cat-eyes div')[1].classList.contains(' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- - --fcc-editable-region-- - - --fcc-editable-region--
-
+ + --fcc-editable-region-- + + --fcc-editable-region-- +
+
``` diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/646ddd3f9f97a0667b964bdb.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/646ddd3f9f97a0667b964bdb.md index 5127a29b289..b0c9e3ac60f 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/646ddd3f9f97a0667b964bdb.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/646ddd3f9f97a0667b964bdb.md @@ -55,34 +55,34 @@ assert.isTrue(document.querySelectorAll('.cat-right-eye div')[0]?.classList.cont - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
- --fcc-editable-region-- -
- -
-
- -
- --fcc-editable-region-- -
-
+ +
+
+--fcc-editable-region-- + +
+
+ +--fcc-editable-region-- +
+
+
+
``` diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/646dde7dc20dc167489faa69.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/646dde7dc20dc167489faa69.md index 0efef1e444d..d9477a606a3 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/646dde7dc20dc167489faa69.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/646dde7dc20dc167489faa69.md @@ -43,32 +43,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-eye')?.backgrou - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/646ddf888632fa67f1180940.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/646ddf888632fa67f1180940.md index 79344b50f13..31316ef2ecb 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/646ddf888632fa67f1180940.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/646ddf888632fa67f1180940.md @@ -37,32 +37,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-eye')?.left, '3 - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/646de5dc8988076a1d992afd.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/646de5dc8988076a1d992afd.md index 33d729c5ee4..69dc939838d 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/646de5dc8988076a1d992afd.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/646de5dc8988076a1d992afd.md @@ -31,32 +31,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-eye')?.transfor - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/646de6a97b50a86ac487de86.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/646de6a97b50a86ac487de86.md index ccea90ec00b..cd4b878c445 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/646de6a97b50a86ac487de86.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/646de6a97b50a86ac487de86.md @@ -45,32 +45,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-eye')?.backgro - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/646de7b64467e96b7d35b5cd.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/646de7b64467e96b7d35b5cd.md index 27a974f528e..ce3bb453d69 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/646de7b64467e96b7d35b5cd.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/646de7b64467e96b7d35b5cd.md @@ -37,32 +37,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-eye')?.left, ' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/646de8478d6f796bfbdccfb2.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/646de8478d6f796bfbdccfb2.md index ced2907f21c..4b573e12020 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/646de8478d6f796bfbdccfb2.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/646de8478d6f796bfbdccfb2.md @@ -31,32 +31,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-eye')?.transfo - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/646de8d204a3426c7d184372.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/646de8d204a3426c7d184372.md index 4182f6065bf..6ac9e34975a 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/646de8d204a3426c7d184372.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/646de8d204a3426c7d184372.md @@ -45,32 +45,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-inner-eye')?.ba - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/646dea1c98c2426d43a705c3.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/646dea1c98c2426d43a705c3.md index cc3dd1fcd61..a79bea5ccac 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/646dea1c98c2426d43a705c3.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/646dea1c98c2426d43a705c3.md @@ -49,32 +49,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-inner-eye')?.tr - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/646deb169847f86df0f95bfc.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/646deb169847f86df0f95bfc.md index 115669de1d9..c9cf2748c1c 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/646deb169847f86df0f95bfc.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/646deb169847f86df0f95bfc.md @@ -43,32 +43,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-inner-eye')?.b - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/646dec359bef3b7811fba5a6.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/646dec359bef3b7811fba5a6.md index 41a045acf09..7e6ba07deb8 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/646dec359bef3b7811fba5a6.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/646dec359bef3b7811fba5a6.md @@ -49,32 +49,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-inner-eye')?.t - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/646dedbcba062079128b2ecc.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/646dedbcba062079128b2ecc.md index 2c23f98f0a9..3942a5fd3b9 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/646dedbcba062079128b2ecc.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/646dedbcba062079128b2ecc.md @@ -31,36 +31,36 @@ assert.isTrue(document.querySelectorAll('div')[11].classList.contains('cat-nose' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
- - --fcc-editable-region-- - - --fcc-editable-region--
-
+ + --fcc-editable-region-- + + --fcc-editable-region-- +
+
``` diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/646def5e863abf7a14501421.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/646def5e863abf7a14501421.md index 31ceb95b9e3..50e33ecf423 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/646def5e863abf7a14501421.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/646def5e863abf7a14501421.md @@ -43,34 +43,34 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-nose')?.borderBottom - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
- -
-
+ +
+
+
``` diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/646df03c8f79337ab46f148b.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/646df03c8f79337ab46f148b.md index 44a25fb0bba..447e902dd38 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/646df03c8f79337ab46f148b.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/646df03c8f79337ab46f148b.md @@ -37,34 +37,34 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-nose')?.left, '85px' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
- -
-
+ +
+
+
``` @@ -196,5 +196,4 @@ body { border-right: 15px solid transparent; border-bottom: 20px solid #442c2c; } - ``` diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/646df0cf26413a7b35e4b8b3.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/646df0cf26413a7b35e4b8b3.md index 01ca8a5ef4a..74e894dfd20 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/646df0cf26413a7b35e4b8b3.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/646df0cf26413a7b35e4b8b3.md @@ -49,34 +49,34 @@ assert.notMatch(code, /border-top-right-radius:\s*\d+%;/); - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
- -
-
+ +
+
+
``` @@ -211,5 +211,4 @@ body { border-right: 15px solid transparent; border-bottom: 20px solid #442c2c; } - ``` diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/646df1d1aa4ae57bdf1869c4.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/646df1d1aa4ae57bdf1869c4.md index 8b6f5bef096..8115d733fc8 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/646df1d1aa4ae57bdf1869c4.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/646df1d1aa4ae57bdf1869c4.md @@ -33,38 +33,38 @@ assert.isTrue(document.querySelectorAll('div')[12].classList.contains('cat-mouth - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
- --fcc-editable-region-- - - --fcc-editable-region-- +
+
+
+
+
+
+
-
+ +
+ + --fcc-editable-region-- + + --fcc-editable-region-- +
+
``` diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/646dffd8ce9ac77ec1906f2e.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/646dffd8ce9ac77ec1906f2e.md index 02c7b8904a9..c12921c6075 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/646dffd8ce9ac77ec1906f2e.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/646dffd8ce9ac77ec1906f2e.md @@ -43,41 +43,40 @@ assert.isTrue(document.querySelectorAll('.cat-mouth div')[1]?.classList.contains - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
- --fcc-editable-region-- -
- +
+
+
+
+
+
- --fcc-editable-region-- +
+ +
+
+--fcc-editable-region-- + +--fcc-editable-region--
-
+
+
``` @@ -213,5 +212,4 @@ body { border-right: 15px solid transparent; border-bottom: 20px solid #442c2c; } - ``` diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/646f0417322c0e04983a5149.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/646f0417322c0e04983a5149.md index 52dcb921ce0..c26218445c5 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/646f0417322c0e04983a5149.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/646f0417322c0e04983a5149.md @@ -43,40 +43,39 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-mouth-line-left')?.l - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
+
+
+
+
+ +
+
+
+
-
+
+
``` @@ -222,6 +221,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/646f08293804a30685533c6f.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/646f08293804a30685533c6f.md index d7a2f89cba0..3ca7dce29ab 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/646f08293804a30685533c6f.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/646f08293804a30685533c6f.md @@ -25,40 +25,39 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-mouth-line-left')?.t - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
+
+
+
+
+ +
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/646f09293eb3230723a62f77.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/646f09293eb3230723a62f77.md index e36be050c81..ec22a95086f 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/646f09293eb3230723a62f77.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/646f09293eb3230723a62f77.md @@ -43,40 +43,39 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-mouth-line-right')?. - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
+
+
+
+
+ +
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/646f0c9a1e3360092d1bbd33.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/646f0c9a1e3360092d1bbd33.md index 52752245f6f..156114ead5f 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/646f0c9a1e3360092d1bbd33.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/646f0c9a1e3360092d1bbd33.md @@ -25,40 +25,39 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-mouth-line-right')?. - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
+
+
+
+
+ +
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/646f0ce5737243098ad6e494.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/646f0ce5737243098ad6e494.md index ce6b88ccb26..4dac1f2e23d 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/646f0ce5737243098ad6e494.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/646f0ce5737243098ad6e494.md @@ -33,44 +33,43 @@ assert.isTrue(document.querySelectorAll('div')[15].classList.contains('cat-whisk - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
+
+
+
+
+ +
- --fcc-editable-region-- - - --fcc-editable-region-- - +
+
+
-
+ + --fcc-editable-region-- + + --fcc-editable-region-- +
+
``` diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/646f0ef13604420a8744f7d4.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/646f0ef13604420a8744f7d4.md index 6588d114d2e..fe1222eebbd 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/646f0ef13604420a8744f7d4.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/646f0ef13604420a8744f7d4.md @@ -43,46 +43,45 @@ assert.isTrue(document.querySelectorAll('.cat-whiskers div')[1].classList.contai - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- - --fcc-editable-region-- -
- +
+
- --fcc-editable-region-- +
+ +
+ +
+
+
+
+
+--fcc-editable-region-- + +--fcc-editable-region--
-
+
+
``` diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/646f0f7c5933560af8e7e380.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/646f0f7c5933560af8e7e380.md index 0822d2c91f0..7e97eaac848 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/646f0f7c5933560af8e7e380.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/646f0f7c5933560af8e7e380.md @@ -50,49 +50,48 @@ assert.isTrue(document.querySelectorAll('.cat-whiskers-left div')[2].classList.c - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
- --fcc-editable-region-- -
- -
- --fcc-editable-region-- -
+
+
+
+ +
+
+
+
+
+ +
+
+--fcc-editable-region-- + +--fcc-editable-region-- +
+
-
+
+
``` diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/646f102bf87b350b593baa72.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/646f102bf87b350b593baa72.md index aa44ed580d6..5a6ff86d74d 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/646f102bf87b350b593baa72.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/646f102bf87b350b593baa72.md @@ -49,53 +49,52 @@ assert.isTrue(document.querySelectorAll('.cat-whiskers-right div')[2].classList. - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
- --fcc-editable-region-- -
- -
- --fcc-editable-region-- +
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+--fcc-editable-region-- + +--fcc-editable-region-- +
-
+
+
``` diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/646f107abb89d00bb99f387a.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/646f107abb89d00bb99f387a.md index b8191b330c7..d9cedbf0721 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/646f107abb89d00bb99f387a.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/646f107abb89d00bb99f387a.md @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whiskers-left div')? - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/646f12da0b4c5d0ca162834a.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/646f12da0b4c5d0ca162834a.md index f168474d2c6..bd4f66a4b11 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/646f12da0b4c5d0ca162834a.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/646f12da0b4c5d0ca162834a.md @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-left-top')?. - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -261,6 +260,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/646f135eab69d90d0c6d4e9b.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/646f135eab69d90d0c6d4e9b.md index 1418f577d35..59d94f59e43 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/646f135eab69d90d0c6d4e9b.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/646f135eab69d90d0c6d4e9b.md @@ -25,53 +25,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-left-top')?. - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -250,5 +249,4 @@ body { --fcc-editable-region-- } - ``` diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/646f159b2cffb21150b927cb.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/646f159b2cffb21150b927cb.md index 3c6c1478127..06a801a1e44 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/646f159b2cffb21150b927cb.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/646f159b2cffb21150b927cb.md @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-left-middle' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -268,6 +267,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/646f164bf100dd11d226161f.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/646f164bf100dd11d226161f.md index af2c08212e8..afb276259b9 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/646f164bf100dd11d226161f.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/646f164bf100dd11d226161f.md @@ -25,53 +25,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-left-middle' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -254,7 +253,7 @@ body { top: 127px; left: 52px; --fcc-editable-region-- - + --fcc-editable-region-- } ``` diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/646f1764e2f1d212ba9785a7.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/646f1764e2f1d212ba9785a7.md index ecfe3ab0121..ba5cf0c2aac 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/646f1764e2f1d212ba9785a7.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/646f1764e2f1d212ba9785a7.md @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-left-bottom' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -275,6 +274,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/646f1802a09a171332e14630.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/646f1802a09a171332e14630.md index b3170e6c879..ddcf8992b9b 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/646f1802a09a171332e14630.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/646f1802a09a171332e14630.md @@ -25,53 +25,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-left-bottom' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/646f4d6c42dc5f214f4e7444.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/646f4d6c42dc5f214f4e7444.md index 38128e68c03..05fbd63367c 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/646f4d6c42dc5f214f4e7444.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/646f4d6c42dc5f214f4e7444.md @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-right-top')? - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -282,6 +281,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/646f4e46e81f7021d5fd9c1d.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/646f4e46e81f7021d5fd9c1d.md index 62aa7eade13..8fb73b1170e 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/646f4e46e81f7021d5fd9c1d.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/646f4e46e81f7021d5fd9c1d.md @@ -25,53 +25,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-right-top')? - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/646f4f6a14e3c522d130a0d2.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/646f4f6a14e3c522d130a0d2.md index ee6c90597c7..0553e81d092 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/646f4f6a14e3c522d130a0d2.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/646f4f6a14e3c522d130a0d2.md @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-right-middle - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -289,6 +288,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/646f4fe12b7985232bf475a5.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/646f4fe12b7985232bf475a5.md index 63e48e8a262..c32824c2b3e 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/646f4fe12b7985232bf475a5.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/646f4fe12b7985232bf475a5.md @@ -25,53 +25,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-right-middle - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/646f507e4d1cd323f17db4fc.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/646f507e4d1cd323f17db4fc.md index d0b2afb95c8..eab9f7bdd74 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/646f507e4d1cd323f17db4fc.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/646f507e4d1cd323f17db4fc.md @@ -44,53 +44,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-right-bottom - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -297,6 +296,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/646f516dbfc1342495515625.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/646f516dbfc1342495515625.md index d1514255af9..404bcbc717f 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/646f516dbfc1342495515625.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/646f516dbfc1342495515625.md @@ -27,53 +27,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-right-bottom - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -295,53 +294,53 @@ body { - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+ +
+
``` diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/6476f5c17f99146071ee884c.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/6476f5c17f99146071ee884c.md index 40cab68b244..623132044c4 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/6476f5c17f99146071ee884c.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/6476f5c17f99146071ee884c.md @@ -41,14 +41,14 @@ assert.equal(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.left, '100p - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
+
+
+
``` @@ -65,9 +65,9 @@ body { .cat-head { --fcc-editable-region-- position: static; +--fcc-editable-region-- top: 100px; left: 100px; ---fcc-editable-region-- background: linear-gradient(#5e5e5e 85%, #45454f 100%); width: 205px; height: 180px; diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/6476f7a4827bcc61682f2347.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/6476f7a4827bcc61682f2347.md index 34e43dfe771..4c91900602e 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/6476f7a4827bcc61682f2347.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/6476f7a4827bcc61682f2347.md @@ -9,9 +9,7 @@ dashedName: step-9 Quando usi il valore `absolute` per la proprietà `position`, l'elemento viene rimosso dal flusso normale del documento, e la sua posizione viene poi determinata dalle proprietà `top`, `right`, `bottom` e `left`. -Imposta la proprietà `position` del tuo elemento `.cat-head` su `absolute`, poi imposta le proprietà `top` e `left` su un qualsiasi valore positivo in pixel. - - +Imposta la proprietà `position` del tuo elemento `.cat-head` su `absolute`. # --hints-- @@ -43,14 +41,14 @@ assert.match(code, /left:\s*\d{1,4}px;/); - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
+
+
+
``` @@ -67,9 +65,9 @@ body { .cat-head { --fcc-editable-region-- position: relative; +--fcc-editable-region-- top: 100px; left: 100px; ---fcc-editable-region-- background: linear-gradient(#5e5e5e 85%, #45454f 100%); width: 205px; height: 180px; diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/6476fb7cbaafa36d65e9cf35.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/6476fb7cbaafa36d65e9cf35.md index 986bd6d8c76..5fbb63e2f9b 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/6476fb7cbaafa36d65e9cf35.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/6476fb7cbaafa36d65e9cf35.md @@ -33,17 +33,17 @@ assert.equal(document.querySelectorAll('div')[1]?.getAttribute('class'), 'box'); - - fCC Cat Painting - + + fCC Cat Painting + -
-
- --fcc-editable-region-- - - --fcc-editable-region-- -
+
+
+ --fcc-editable-region-- + + --fcc-editable-region-- +
``` @@ -59,8 +59,8 @@ body { .cat-head { position: absolute; - top: 300px; - left: 400px; + top: 100px; + left: 100px; background: linear-gradient(#5e5e5e 85%, #45454f 100%); width: 205px; height: 180px; diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/6476fc5cf14b276e6d04e82a.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/6476fc5cf14b276e6d04e82a.md index 0e0b22a5e4a..2b7a0e702ec 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/6476fc5cf14b276e6d04e82a.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/6476fc5cf14b276e6d04e82a.md @@ -7,7 +7,7 @@ dashedName: step-11 # --description-- -Usa un selettore di classe per dare al tuo elemento `.box` una larghezza di `200px`, un'altezza di `600px` e un colore di sfondo di `#000`. Inoltre, dagli un `position` di `absolute`, un `top` di `800px` e un `left` di `650px`. +Usa un selettore di classe per dare al tuo elemento `.box` una larghezza di `200px`, un'altezza di `600px` e un colore di sfondo di `#000`. Inoltre, dagli un `position` di `absolute`, un `top` di `800px` e un `left` di `650px`. # --hints-- @@ -61,15 +61,15 @@ assert.equal(new __helpers.CSSHelp(document)?.getStyle('.box')?.top, '800px'); - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
+
+
+
+
``` @@ -84,7 +84,7 @@ body { } .cat-head { - position: relative; + position: absolute; top: 100px; left: 100px; background: linear-gradient(#5e5e5e 85%, #45454f 100%); @@ -98,3 +98,4 @@ body { --fcc-editable-region-- ``` + diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/6476fd4213318f6ee211028a.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/6476fd4213318f6ee211028a.md index 0105f423e12..213b19eb1e8 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/6476fd4213318f6ee211028a.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/6476fd4213318f6ee211028a.md @@ -7,7 +7,7 @@ dashedName: step-12 # --description-- -Ora sostituisci il valore della proprietà `position` del tuo `.cat-head` con `fixed`. Lascia sia `top` sia `left` così come sono. +Ora sostituisci il valore della proprietà `position` del tuo `.cat-head` con `fixed`. Dopodiché, scorri su e giù per vedere come funziona il valore `fixed`. @@ -39,15 +39,15 @@ assert.equal(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.left, '100p - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
+
+
+
+
``` @@ -63,10 +63,10 @@ body { .cat-head { --fcc-editable-region-- - position: relative; + position: absolute; +--fcc-editable-region-- top: 100px; left: 100px; ---fcc-editable-region-- background: linear-gradient(#5e5e5e 85%, #45454f 100%); width: 205px; height: 180px; diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/64770351e8586671ec0911f0.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/64770351e8586671ec0911f0.md index b19aeff24f1..32ab4375620 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/64770351e8586671ec0911f0.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/64770351e8586671ec0911f0.md @@ -41,15 +41,15 @@ assert.notMatch(code, /left:\s*100px;?/); - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
+
+
+
+
``` diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/6477062778c85972eb648030.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/6477062778c85972eb648030.md index 1145fc5c11f..0be1337b1f6 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/6477062778c85972eb648030.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/6477062778c85972eb648030.md @@ -57,15 +57,15 @@ assert.equal(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.margin, 'au - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
+
+
+
+
``` @@ -82,8 +82,8 @@ body { .cat-head { --fcc-editable-region-- position: sticky; - top: 0; --fcc-editable-region-- + top: 0; background: linear-gradient(#5e5e5e 85%, #45454f 100%); width: 205px; height: 180px; @@ -92,7 +92,7 @@ body { } .box { - width: 400px; + width: 200px; height: 600px; background-color: #000; position: absolute; diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/647d821de0d97b3283c72b36.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/647d821de0d97b3283c72b36.md index 199de88d9fb..f1fa0b00024 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/647d821de0d97b3283c72b36.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/647d821de0d97b3283c72b36.md @@ -14,7 +14,7 @@ Rimuovi anche la regola CSS `.box` e le sue dichiarazioni perché non ti servono Dovresti rimuovere la regola CSS `.box` e tutti i suoi valori. ```js -assert.notMatch(code, /\.box\s*\{\s*width:\s*400px;\s*height:\s*600px;\s*background-color:\s*#000;\s*position:\s*absolute;\s*left:\s*650px;\s*top:\s*800px;?\s*\}\s*/) +assert.notMatch(code, /\.box\s*\{\s*width:\s*200px;\s*height:\s*600px;\s*background-color:\s*#000;\s*position:\s*absolute;\s*left:\s*650px;\s*top:\s*800px;?\s*\}\s*/) ``` # --seed-- @@ -25,14 +25,14 @@ assert.notMatch(code, /\.box\s*\{\s*width:\s*400px;\s*height:\s*600px;\s*backgro - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
+
+
+
``` @@ -62,7 +62,7 @@ body { --fcc-editable-region-- .box { - width: 400px; + width: 200px; height: 600px; background-color: #000; position: absolute; diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/647d855ac12cd436059acd39.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/647d855ac12cd436059acd39.md index da06d5263f6..0586967f305 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/647d855ac12cd436059acd39.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/647d855ac12cd436059acd39.md @@ -33,9 +33,9 @@ assert.strictEqual(new __helpers.CSSHelp(document).getStyle('*')?.boxSizing, 'bo - - fCC Cat Painting - + + fCC Cat Painting + diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/649353647c44ef4867ab4935.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/649353647c44ef4867ab4935.md index f69fa3ca22a..3501b287544 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/649353647c44ef4867ab4935.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/649353647c44ef4867ab4935.md @@ -25,17 +25,17 @@ assert.notMatch(code, /<\/div>/) - - fCC Cat Painting - + + fCC Cat Painting + -
-
- --fcc-editable-region-- -
- --fcc-editable-region-- -
+
+
+ --fcc-editable-region-- +
+ --fcc-editable-region-- +
``` @@ -64,7 +64,7 @@ body { } .box { - width: 400px; + width: 200px; height: 600px; background-color: #000; position: absolute; diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/64a2687ef267e5934a2f93e3.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/64a2687ef267e5934a2f93e3.md index 55b5144e547..201fd091a4a 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/64a2687ef267e5934a2f93e3.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/64a2687ef267e5934a2f93e3.md @@ -43,39 +43,39 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-mouth div')?.border, - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
- -
- -
-
-
+
+
-
+ +
+ +
+
+
+
+
+
``` diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/64a26ac5540c5493f4641f10.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/64a26ac5540c5493f4641f10.md index 465d64c20d2..876977d0ab8 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/64a26ac5540c5493f4641f10.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/64a26ac5540c5493f4641f10.md @@ -32,39 +32,39 @@ assert.match(code, /border-radius:\s*190%\/190px\s*150px\s*0\s*0\s*;?/) - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
- -
- -
-
-
+
+
-
+ +
+ +
+
+
+
+
+
``` diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/64a3bcbc83e574b58c8ed048.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/64a3bcbc83e574b58c8ed048.md index f80062e60bc..84a4fa61093 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/64a3bcbc83e574b58c8ed048.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/64a3bcbc83e574b58c8ed048.md @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whiskers-right div') - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/6676a8a8d9861319ee901a90.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/6676a8a8d9861319ee901a90.md index d181f19e323..6bba8259ec0 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/6676a8a8d9861319ee901a90.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/6676a8a8d9861319ee901a90.md @@ -103,23 +103,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-ear')?.borderBo - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/italian/blocks/workshop-cat-painting/6676a8b01e56ec1a1e07c202.md b/curriculum/challenges/italian/blocks/workshop-cat-painting/6676a8b01e56ec1a1e07c202.md index 7c222afc130..0d847c7f93a 100644 --- a/curriculum/challenges/italian/blocks/workshop-cat-painting/6676a8b01e56ec1a1e07c202.md +++ b/curriculum/challenges/italian/blocks/workshop-cat-painting/6676a8b01e56ec1a1e07c202.md @@ -73,23 +73,23 @@ assert.isEmpty(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.backg - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` @@ -117,15 +117,15 @@ body { border-radius: 46%; } ---fcc-editable-region-- .cat-right-ear { +--fcc-editable-region-- height: 100px; width: 100px; background-color: white; border-left: 35px solid blue; border-right: 35px solid blue; border-top: 35px solid red; +--fcc-editable-region-- border-bottom: 35px solid red; } ---fcc-editable-region-- ``` diff --git a/curriculum/challenges/italian/blocks/workshop-envelope-budget-app/69b2c970cb02ddaafff1c10d.md b/curriculum/challenges/italian/blocks/workshop-envelope-budget-app/69b2c970cb02ddaafff1c10d.md index c13426e0858..a9972e3dbe9 100644 --- a/curriculum/challenges/italian/blocks/workshop-envelope-budget-app/69b2c970cb02ddaafff1c10d.md +++ b/curriculum/challenges/italian/blocks/workshop-envelope-budget-app/69b2c970cb02ddaafff1c10d.md @@ -62,7 +62,7 @@ assert.notMatch(code, /<\/input>/); L'elemento `input` dovrebbe avere la chiusura `>`. ```js -assert.match(code, /HTMLString\s*=\s*`\n\s*Expense\s\$\{entryNumber\}\sName<\/label>\n\s*]*\/>/); +assert.match(code, /HTMLString\s*=\s*`\n\s*Expense\s\$\{entryNumber\}\sName<\/label>\n\s*]*>/); ``` # --seed-- diff --git a/curriculum/challenges/italian/blocks/workshop-fcc-authors-page/69e14a2fd8ecf9210c0739ee.md b/curriculum/challenges/italian/blocks/workshop-fcc-authors-page/69e14a2fd8ecf9210c0739ee.md index 295289808e5..0a59b1d801b 100644 --- a/curriculum/challenges/italian/blocks/workshop-fcc-authors-page/69e14a2fd8ecf9210c0739ee.md +++ b/curriculum/challenges/italian/blocks/workshop-fcc-authors-page/69e14a2fd8ecf9210c0739ee.md @@ -11,6 +11,12 @@ Quando chiami una funzione asincrona, puoi aspettare il valore di ritorno della Aggiungi una chiamata alla funzione `initialFetch` nello spazio indicato nell’editor. +# --before-all-- + +```js +window.fetch = () => Promise.resolve({json: () => Promise.resolve([{ author: 'Whoever', image: 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==', url: "http://not-a-real-url.nowhere/", bio: 'words go here' }])}); +``` + # --hints-- Dovresti chiamare `initialFetch` senza argomenti. diff --git a/curriculum/challenges/italian/blocks/workshop-fortune-teller-app/68ded620ab19272a3fa97592.md b/curriculum/challenges/italian/blocks/workshop-fortune-teller-app/68ded620ab19272a3fa97592.md index f90087acb92..342cf014631 100644 --- a/curriculum/challenges/italian/blocks/workshop-fortune-teller-app/68ded620ab19272a3fa97592.md +++ b/curriculum/challenges/italian/blocks/workshop-fortune-teller-app/68ded620ab19272a3fa97592.md @@ -73,10 +73,9 @@ assert.isTrue(renderCard.hasReturnAnnotation("string")); La tua funzione `renderCard` dovrebbe restituire un template literal. ```js -assert.match( - __helpers.removeJSComments(code), - /renderCard\s*=\s*\([^)]*\)\s*:\s*string\s*=>\s*(?:\{\s*return\s*)?`/ -); +const explorer = await __helpers.Explorer(code); +const { renderCard } = explorer.allFunctions; +assert.match(__helpers.removeJSComments(renderCard.toString()), /(?:return|=>)\s*`/); ``` # --seed-- diff --git a/curriculum/challenges/italian/blocks/workshop-fortune-teller-app/68ed4621677e86eeefa59fe6.md b/curriculum/challenges/italian/blocks/workshop-fortune-teller-app/68ed4621677e86eeefa59fe6.md index 4fcbfc6c07f..ef556c49f66 100644 --- a/curriculum/challenges/italian/blocks/workshop-fortune-teller-app/68ed4621677e86eeefa59fe6.md +++ b/curriculum/challenges/italian/blocks/workshop-fortune-teller-app/68ed4621677e86eeefa59fe6.md @@ -15,8 +15,8 @@ Il tuo metodo `initializeEventListeners` dovrebbe avere un tipo di ritorno `void ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.initializeEventListeners.toString(); -assert.match(method, /initializeEventListeners\s*\(\s*\)\s*:\s*void/); +const { initializeEventListeners } = explorer.classes.Game?.methods ?? {}; +assert.isTrue(initializeEventListeners?.hasReturnAnnotation("void")); ``` # --seed-- diff --git a/curriculum/challenges/italian/blocks/workshop-fortune-teller-app/68ee6c4b4c764b62d77df717.md b/curriculum/challenges/italian/blocks/workshop-fortune-teller-app/68ee6c4b4c764b62d77df717.md index 2ee43ae5082..d3331bd6aa7 100644 --- a/curriculum/challenges/italian/blocks/workshop-fortune-teller-app/68ee6c4b4c764b62d77df717.md +++ b/curriculum/challenges/italian/blocks/workshop-fortune-teller-app/68ee6c4b4c764b62d77df717.md @@ -17,16 +17,30 @@ Dovresti dichiarare una variabile chiamata `isReversed`. ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.singleCardSelected.toString(); -assert.match(method, /const\s+isReversed\s*=/); +const { singleCardSelected } = explorer.classes.Game?.methods ?? {}; +const { isReversed } = singleCardSelected?.variables ?? {}; +assert.exists(isReversed); ``` La tua variabile `isReversed` dovrebbe usare `Math.random()` per decidere casualmente se la carta è invertita. ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.singleCardSelected.toString(); -assert.match(method, /isReversed\s*=\s*Math\.random\s*\(\s*\)\s*<\s*0\.5/); +const { singleCardSelected } = explorer.classes.Game?.methods ?? {}; +const { isReversed } = singleCardSelected?.variables ?? {}; + +const validForms = [ + 'Math.random() < 0.5', + 'Math.random() > 0.5', + 'Math.random() <= 0.5', + 'Math.random() >= 0.5', + '0.5 < Math.random()', + '0.5 > Math.random()', + '0.5 <= Math.random()', + '0.5 >= Math.random()' +]; + +assert.isTrue(validForms.some((form) => isReversed?.value.matches(form))); ``` # --seed-- diff --git a/curriculum/challenges/italian/blocks/workshop-fortune-teller-app/68ee6c8c274515694ead0024.md b/curriculum/challenges/italian/blocks/workshop-fortune-teller-app/68ee6c8c274515694ead0024.md index 4269216a816..0523d6f43e9 100644 --- a/curriculum/challenges/italian/blocks/workshop-fortune-teller-app/68ee6c8c274515694ead0024.md +++ b/curriculum/challenges/italian/blocks/workshop-fortune-teller-app/68ee6c8c274515694ead0024.md @@ -7,7 +7,7 @@ dashedName: step-32 # --description-- -La fortuna deve essere casuale, quindi serve una funzione di supporto per selezionare una fortuna casuale. Dichiara una variabile chiamata `chosenCard` all'interno del metodo `singleCardSelected`. Usa il metodo `getRandomItem` per ottenere una carta casuale e passa `cards` come argomento. +La fortuna deve essere casuale, quindi serve una funzione di supporto per selezionare una fortuna casuale. Dichiara una variabile chiamata `chosenCard` all'interno del metodo `singleCardSelected`. Usa la funzione `getRandomItem` per ottenere una carta casuale e passa `this.cards` come argomento. # --hints-- @@ -15,22 +15,18 @@ Dovresti dichiarare una variabile chiamata `chosenCard` all'interno di `singleCa ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.singleCardSelected.toString(); -assert.match(method, /const\s+chosenCard\s*=/); +const { singleCardSelected } = explorer.classes.Game?.methods ?? {}; +const { chosenCard } = singleCardSelected?.variables ?? {}; +assert.exists(chosenCard); ``` La tua variabile `chosenCard` dovrebbe essere assegnata chiamando `getRandomItem(this.cards)`. ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.singleCardSelected.toString(); -assert.match(method, /chosenCard\s*=\s*getRandomItem\s*\(\s*this\.cards\s*\)/); -``` - -Dovresti passare `this.cards` come argomento a `getRandomItem`. - -```js -assert.match(__helpers.removeJSComments(code), /getRandomItem\s*\(\s*this\.cards\s*\)/); +const { singleCardSelected } = explorer.classes.Game?.methods ?? {}; +const { chosenCard } = singleCardSelected?.variables ?? {}; +assert.isTrue(chosenCard?.value.matches("getRandomItem(this.cards)")); ``` # --seed-- diff --git a/curriculum/challenges/italian/blocks/workshop-fortune-teller-app/68f1e43a5f890b51774d93c4.md b/curriculum/challenges/italian/blocks/workshop-fortune-teller-app/68f1e43a5f890b51774d93c4.md index 9609ae2217f..5bbc4f95932 100644 --- a/curriculum/challenges/italian/blocks/workshop-fortune-teller-app/68f1e43a5f890b51774d93c4.md +++ b/curriculum/challenges/italian/blocks/workshop-fortune-teller-app/68f1e43a5f890b51774d93c4.md @@ -15,22 +15,28 @@ Dovresti dichiarare una variabile chiamata `target` all'interno di `showFortune` ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /const\s+target\s*=/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { target } = showFortune?.variables ?? {}; +assert.exists(target); ``` La tua variabile `target` dovrebbe essere assegnata a `e.target`. ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /target\s*=\s*e\.target/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { target } = showFortune?.variables ?? {}; +assert.isTrue(target?.value.matches("e.target")); ``` Dovresti avere un'istruzione `if` vuota subito dopo la tua variabile `target`. ```js -assert.match(__helpers.removeJSComments(code), /showFortune\s*\([^)]*\)\s*\{[\s\S]*?if\s*\(\s*\)\s*\{\s*\}/); +const explorer = await __helpers.Explorer(code); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +assert.exists(showFortune); +const method = __helpers.removeJSComments(showFortune.toString()); +assert.match(method, /target\s*=\s*e\.target[\s\S]*?if\s*\(\s*\)\s*\{\s*\}/); ``` # --seed-- diff --git a/curriculum/challenges/italian/blocks/workshop-fortune-teller-app/68f1e6a98bc05e67cc2b85e6.md b/curriculum/challenges/italian/blocks/workshop-fortune-teller-app/68f1e6a98bc05e67cc2b85e6.md index 6fe0e52cfc7..4f49ef9dff5 100644 --- a/curriculum/challenges/italian/blocks/workshop-fortune-teller-app/68f1e6a98bc05e67cc2b85e6.md +++ b/curriculum/challenges/italian/blocks/workshop-fortune-teller-app/68f1e6a98bc05e67cc2b85e6.md @@ -15,22 +15,18 @@ Dovresti dichiarare una variabile chiamata `cardElement` all'interno di `showFor ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /const\s+cardElement\s*=/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { cardElement } = showFortune?.variables ?? {}; +assert.exists(cardElement); ``` La tua `cardElement` dovrebbe usare `target?.closest` per trovare l'elemento `.card_container`. ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /cardElement\s*=\s*target\?\.closest\s*\(\s*['"]\.card_container['"]\s*\)/); -``` - -Dovresti passare `.card_container` come argomento a `closest`. - -```js -assert.match(__helpers.removeJSComments(code), /\.closest\s*\(\s*['"]\.card_container['"]\s*\)/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { cardElement } = showFortune?.variables ?? {}; +assert.isTrue(cardElement?.value.matches("target?.closest('.card_container')")); ``` # --seed-- diff --git a/curriculum/challenges/italian/blocks/workshop-fortune-teller-app/68f1e852f705eb77f6bcb893.md b/curriculum/challenges/italian/blocks/workshop-fortune-teller-app/68f1e852f705eb77f6bcb893.md index 640d0e52366..bb02b9a402b 100644 --- a/curriculum/challenges/italian/blocks/workshop-fortune-teller-app/68f1e852f705eb77f6bcb893.md +++ b/curriculum/challenges/italian/blocks/workshop-fortune-teller-app/68f1e852f705eb77f6bcb893.md @@ -15,28 +15,18 @@ Dovresti dichiarare una variabile chiamata `cardId` all'interno di `showFortune` ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /const\s+cardId\s*=/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { cardId } = showFortune?.variables ?? {}; +assert.exists(cardId); ``` La tua variabile `cardId` dovrebbe essere assegnata chiamando `cardElement.getAttribute("data-id")`. ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /cardId\s*=\s*cardElement\.getAttribute\s*\(\s*['"]data-id['"]\s*\)/); -``` - -Dovresti usare il metodo `getAttribute` su `cardElement`. - -```js -assert.match(__helpers.removeJSComments(code), /cardElement\.getAttribute\s*\(/); -``` - -Dovresti passare `'data-id'` a `getAttribute`. - -```js -assert.match(__helpers.removeJSComments(code), /\.getAttribute\s*\(\s*['"]data-id['"]\s*\)/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { cardId } = showFortune?.variables ?? {}; +assert.isTrue(cardId?.value.matches('cardElement.getAttribute("data-id")')); ``` # --seed-- diff --git a/curriculum/challenges/italian/blocks/workshop-fortune-teller-app/68f1e8de2731b07d62e738d2.md b/curriculum/challenges/italian/blocks/workshop-fortune-teller-app/68f1e8de2731b07d62e738d2.md index 9edd6536dd7..e0760ef5f44 100644 --- a/curriculum/challenges/italian/blocks/workshop-fortune-teller-app/68f1e8de2731b07d62e738d2.md +++ b/curriculum/challenges/italian/blocks/workshop-fortune-teller-app/68f1e8de2731b07d62e738d2.md @@ -15,28 +15,38 @@ Dovresti dichiarare una variabile chiamata `foundCard` all'interno di `showFortu ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /const\s+foundCard\s*=/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { foundCard } = showFortune?.variables ?? {}; +assert.exists(foundCard); ``` -La tua `foundCard` dovrebbe essere assegnata chiamando `find` su `this.cards` con il callback corretto. +Il tuo `foundCard` dovrebbe essere assegnato chiamando `find` su `this.cards`, passando una callback che prende un parametro `card` e restituisce il risultato del confronto tra `card.name_short` e `cardId` usando l'uguaglianza stretta. ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /foundCard\s*=\s*this\.cards\.find\s*\(/); -``` - -Il callback `find` dovrebbe avere un parametro chiamato `card`. - -```js -assert.match(__helpers.removeJSComments(code), /cards\.find\s*\(\s*\(\s*card\s*\)\s*=>/); -``` - -All'interno del callback, `card.name_short` dovrebbe essere confrontato con `cardId`. - -```js -assert.match(__helpers.removeJSComments(code), /card\.name_short\s*===?\s*cardId/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { foundCard } = showFortune?.variables ?? {}; + +const validForms = [ + 'this.cards.find((card) => card.name_short === cardId)', + 'this.cards.find((card) => { return card.name_short === cardId; })', + 'this.cards.find((card) => cardId === card.name_short)', + 'this.cards.find((card) => { return cardId === card.name_short; })', + 'this.cards.find(card => card.name_short === cardId)', + 'this.cards.find(card => { return card.name_short === cardId; })', + 'this.cards.find(card => cardId === card.name_short)', + 'this.cards.find(card => { return cardId === card.name_short; })', + 'this.cards.find((card: Card) => card.name_short === cardId)', + 'this.cards.find((card: Card) => { return card.name_short === cardId; })', + 'this.cards.find((card: Card) => cardId === card.name_short)', + 'this.cards.find((card: Card) => { return cardId === card.name_short; })', + 'this.cards.find(function (card) { return card.name_short === cardId; })', + 'this.cards.find(function (card) { return cardId === card.name_short; })', + 'this.cards.find(function (card: Card) { return card.name_short === cardId; })', + 'this.cards.find(function (card: Card) { return cardId === card.name_short; })' +]; + +assert.isTrue(validForms.some((form) => foundCard?.value.matches(form))); ``` # --seed-- diff --git a/curriculum/challenges/italian/blocks/workshop-greeting-bot/66ad8ab945d266383f318cbf.md b/curriculum/challenges/italian/blocks/workshop-greeting-bot/66ad8ab945d266383f318cbf.md index f367e33d733..e4dd2d425a8 100644 --- a/curriculum/challenges/italian/blocks/workshop-greeting-bot/66ad8ab945d266383f318cbf.md +++ b/curriculum/challenges/italian/blocks/workshop-greeting-bot/66ad8ab945d266383f318cbf.md @@ -30,7 +30,11 @@ assert.lengthOf(logSpy.calls, 2); La tua istruzione `console` dovrebbe contenere il messaggio `"I am excited to talk to you."`. Non dimenticare le virgolette. ```js -assert.deepInclude(logSpy.calls, ["I am excited to talk to you."]); +assert.isTrue( + logSpy.calls.some( + (call) => /I\s+am\s+excited\s+to\s+talk\s+to\s+you\s*\./.test(call[0]) + ) +); ``` # --seed-- diff --git a/curriculum/challenges/italian/blocks/workshop-greeting-bot/66ad9c633fa26d3c1475eae3.md b/curriculum/challenges/italian/blocks/workshop-greeting-bot/66ad9c633fa26d3c1475eae3.md index a08ebff01b8..e4cc00beb60 100644 --- a/curriculum/challenges/italian/blocks/workshop-greeting-bot/66ad9c633fa26d3c1475eae3.md +++ b/curriculum/challenges/italian/blocks/workshop-greeting-bot/66ad9c633fa26d3c1475eae3.md @@ -28,7 +28,11 @@ assert.lengthOf(logSpy.calls, 3); La tua istruzione `console` dovrebbe contenere il messaggio `"Allow me to introduce myself."`. Non dimenticare le virgolette. ```js -assert.deepInclude(logSpy.calls, ["Allow me to introduce myself."]); +assert.isTrue( + logSpy.calls.some( + (call) => /Allow\s+me\s+to\s+introduce\s+myself\s*\./.test(call[0]) + ) +); ``` # --seed-- diff --git a/curriculum/challenges/italian/blocks/workshop-greeting-bot/66add47d27763c4862492c8c.md b/curriculum/challenges/italian/blocks/workshop-greeting-bot/66add47d27763c4862492c8c.md index 4f2fffafcfe..3b44101b6f2 100644 --- a/curriculum/challenges/italian/blocks/workshop-greeting-bot/66add47d27763c4862492c8c.md +++ b/curriculum/challenges/italian/blocks/workshop-greeting-bot/66add47d27763c4862492c8c.md @@ -76,12 +76,10 @@ console.log(favoriteSubjectSentence); ```js console.log("Hi there!"); console.log("I am excited to talk to you."); - let bot; -let botLocation; - bot = "teacherBot"; -botLocation = "the universe"; + +let botLocation = "the universe"; console.log("Allow me to introduce myself."); diff --git a/curriculum/challenges/italian/blocks/workshop-hotel-feedback-form/66a93bbe65a26169dbf3bc39.md b/curriculum/challenges/italian/blocks/workshop-hotel-feedback-form/66a93bbe65a26169dbf3bc39.md index 5f48e3dc481..cb10cda1fe5 100644 --- a/curriculum/challenges/italian/blocks/workshop-hotel-feedback-form/66a93bbe65a26169dbf3bc39.md +++ b/curriculum/challenges/italian/blocks/workshop-hotel-feedback-form/66a93bbe65a26169dbf3bc39.md @@ -13,7 +13,7 @@ Inizia aggiungendo un nuovo elemento `label` con il testo `Email address (requir # --hints-- -Dovresti avere un elemento `label`. +Dovresti avere un secondo elemento `label` all'interno del tuo `fieldset`. ```js assert.lengthOf(document.querySelectorAll('fieldset label'), 2); diff --git a/curriculum/challenges/italian/blocks/workshop-hotel-feedback-form/66a9401c9d660d6bb15993e2.md b/curriculum/challenges/italian/blocks/workshop-hotel-feedback-form/66a9401c9d660d6bb15993e2.md index 7f713d9e3e5..8a7a1a10e29 100644 --- a/curriculum/challenges/italian/blocks/workshop-hotel-feedback-form/66a9401c9d660d6bb15993e2.md +++ b/curriculum/challenges/italian/blocks/workshop-hotel-feedback-form/66a9401c9d660d6bb15993e2.md @@ -15,7 +15,7 @@ L'attributo `for` dovrebbe essere impostato su `"age"`. # --hints-- -Dovresti avere un elemento `label`. +Dovresti avere un terzo elemento `label` all'interno del tuo `fieldset`. ```js assert.lengthOf(document.querySelectorAll('fieldset label'), 3); diff --git a/curriculum/challenges/italian/blocks/workshop-hotel-feedback-form/66a9419e2d18476c645ce693.md b/curriculum/challenges/italian/blocks/workshop-hotel-feedback-form/66a9419e2d18476c645ce693.md index f8584a45922..e7792083606 100644 --- a/curriculum/challenges/italian/blocks/workshop-hotel-feedback-form/66a9419e2d18476c645ce693.md +++ b/curriculum/challenges/italian/blocks/workshop-hotel-feedback-form/66a9419e2d18476c645ce693.md @@ -17,9 +17,9 @@ Ecco un esempio di campo di input di tipo number: Gli attributi `min` e `max` servono a impostare i valori minimo e massimo che si possono inserire nel campo di input. -Sotto il tuo elemento `label`, aggiungi un input con l'attributo `type` impostato su `"number"` e un `id` di `"age"`. +Sotto il tuo elemento `label`, aggiungi un `input` con l'attributo `type` impostato su `"number"` e un `id` pari a `"age"`. -L'attributo `name` dovrebbe essere impostato su `"age"`, l'attributo `min` dovrebbe essere impostato su `"3"` e l'attributo `max` dovrebbe essere impostato su `"100"`. +L'attributo `name` dovrebbe essere impostato su `"age"`, l'attributo `min` su `"3"` e l'attributo `max` su `"100"`. # --hints-- @@ -29,13 +29,13 @@ Dovresti avere un `input` di tipo number sotto il tuo elemento `label`. assert.isNotNull(document.querySelector('label + input[type="number"]')); ``` -Il tuo `input` di tipo number dovrebbe avere un `id` di `age`. +Il tuo `input` di tipo numero dovrebbe avere un `id` pari a `"age"`. ```js assert.isNotNull(document.querySelector('label + input#age')); ``` -Il tuo `input` di tipo number dovrebbe avere un attributo `name` impostato su `age`. +Il tuo `input` di tipo numero dovrebbe avere un attributo `name` impostato su `"age"`. ```js assert.isNotNull(document.querySelector('label + input[name="age"]')); diff --git a/curriculum/challenges/italian/blocks/workshop-hotel-feedback-form/67a51d3a8a6fe123b77b0c6e.md b/curriculum/challenges/italian/blocks/workshop-hotel-feedback-form/67a51d3a8a6fe123b77b0c6e.md index 8062925b4d3..176f215050a 100644 --- a/curriculum/challenges/italian/blocks/workshop-hotel-feedback-form/67a51d3a8a6fe123b77b0c6e.md +++ b/curriculum/challenges/italian/blocks/workshop-hotel-feedback-form/67a51d3a8a6fe123b77b0c6e.md @@ -7,11 +7,11 @@ dashedName: step-12 # --description-- -Gli elementi `input` possono avere un attributo `size`. Questo attributo definisce il numero di caratteri che dovrebbero essere visibili mentre l’utente digita nell’input. Il valore di `size` dovrebbe essere un intero non negativo maggiore di zero. Se `size` non è specificato, o è specificato con un valore non valido, l’input avrà la larghezza predefinita impostata dal browser. +Gli elementi `input` possono avere un attributo `size`. Questo attributo definisce il numero di caratteri che dovrebbero essere visibili mentre l'utente digita nell'`input`. Il valore di `size` dovrebbe essere un numero intero positivo. Se `size` non è specificato, o è specificato con un valore non valido, l'`input` avrà la larghezza predefinita impostata dal browser. ```html - - + + ``` Dai agli input name e email un attributo `size` con valore `"20"`. diff --git a/curriculum/challenges/italian/blocks/workshop-plant-nursery-catalog/6734a772196245601e4b80e0.md b/curriculum/challenges/italian/blocks/workshop-plant-nursery-catalog/6734a772196245601e4b80e0.md index 20a1283851e..b947e901f39 100644 --- a/curriculum/challenges/italian/blocks/workshop-plant-nursery-catalog/6734a772196245601e4b80e0.md +++ b/curriculum/challenges/italian/blocks/workshop-plant-nursery-catalog/6734a772196245601e4b80e0.md @@ -22,7 +22,10 @@ assert.exists(getBallerina); La tua variabile `getBallerina` dovrebbe avere il valore di `catalog.get(ballerina)`. ```js -assert.match(__helpers.removeJSComments(code), /(const|let|var)\s+getBallerina\s*=\s*catalog\s*\.\s*get\s*\(\s*ballerina\s*\)/); +const explorer = await __helpers.Explorer(code); +const { getBallerina } = explorer.variables; +assert.isTrue(getBallerina?.value.matches('catalog.get(ballerina)') +); ``` Dovresti stampare la tua variabile `getBallerina` nella console. diff --git a/curriculum/challenges/italian/blocks/workshop-plant-nursery-catalog/6737a1a073a0d14c6544d301.md b/curriculum/challenges/italian/blocks/workshop-plant-nursery-catalog/6737a1a073a0d14c6544d301.md index c195fece181..4ee80462cf2 100644 --- a/curriculum/challenges/italian/blocks/workshop-plant-nursery-catalog/6737a1a073a0d14c6544d301.md +++ b/curriculum/challenges/italian/blocks/workshop-plant-nursery-catalog/6737a1a073a0d14c6544d301.md @@ -23,7 +23,9 @@ assert.exists(plantsSet); Dovresti chiamare `displayPlantsSet` e assegnarla a `plantsSet`. ```js -assert.match(__helpers.removeJSComments(code), /(const|let|var)\s+plantsSet\s*=\s*displayPlantsSet\s*\(\s*\)/) +const explorer = await __helpers.Explorer(code); +const { plantsSet } = explorer.variables; +assert.isTrue(plantsSet?.value.matches('displayPlantsSet()')); ``` Dovresti stampare `plantsSet` nella console. diff --git a/curriculum/challenges/italian/blocks/workshop-reusable-mega-navbar/6740495ba48aa94e5667b436.md b/curriculum/challenges/italian/blocks/workshop-reusable-mega-navbar/6740495ba48aa94e5667b436.md index 7605540e0f9..1302eafe478 100644 --- a/curriculum/challenges/italian/blocks/workshop-reusable-mega-navbar/6740495ba48aa94e5667b436.md +++ b/curriculum/challenges/italian/blocks/workshop-reusable-mega-navbar/6740495ba48aa94e5667b436.md @@ -10,7 +10,7 @@ demoType: onLoad In questo workshop, eserciterai l'uso dei componenti funzionali React costruendo una barra di navigazione riutilizzabile. -Tutto il CSS è già fornito, così puoi concentrarti sulla creazione della barra di navigazione. +Tutto il CSS è stato fornito per permetterti di concentrarti sulla creazione della barra di navigazione. Inizia definendo un componente funzionale `Navbar`. Nel passaggio successivo, inizierai a costruire il componente usando JSX. @@ -24,7 +24,7 @@ export function multiply(a, b) { } ``` -Inoltre, i componenti funzionali React devono iniziare con una lettera maiuscola perché è un modo per distinguerli dagli elementi HTML normali. +Inoltre, i componenti funzionali React devono iniziare con una lettera maiuscola perché è così che React li distingue dagli elementi HTML normali. # --hints-- diff --git a/curriculum/challenges/italian/blocks/workshop-reusable-mega-navbar/67457ff2dc531fbed928a0f0.md b/curriculum/challenges/italian/blocks/workshop-reusable-mega-navbar/67457ff2dc531fbed928a0f0.md index 3f470205134..677bc65a2c0 100644 --- a/curriculum/challenges/italian/blocks/workshop-reusable-mega-navbar/67457ff2dc531fbed928a0f0.md +++ b/curriculum/challenges/italian/blocks/workshop-reusable-mega-navbar/67457ff2dc531fbed928a0f0.md @@ -24,10 +24,9 @@ const App = () => { } ``` - All’interno del componente `Navbar`, restituisci un elemento `nav` che abbia un attributo `className` con valore `navbar`. -Il motivo per cui si usa `className` qui invece di `class` è che `class` è una parola riservata in JavaScript. Quindi, React usa `className` come modo per applicare classi agli elementi. +`className` è usato qui invece di `class` perché `class` è una parola riservata in JavaScript. Quindi, React usa `className` come modo per applicare classi agli elementi. # --hints-- @@ -37,7 +36,7 @@ Dovresti restituire un elemento `nav`. assert.exists(document.querySelector('nav')); ``` -Il tuo elemento `nav` dovrebbe avere un attributo `className` con valore `navbar`. +Il tuo elemento `nav` dovrebbe avere un `className` di `navbar`. ```js assert.equal(document.querySelector('nav')?.getAttribute('class'), 'navbar'); diff --git a/curriculum/challenges/italian/blocks/workshop-reusable-mega-navbar/6745c732dbeb7c04f346e6f7.md b/curriculum/challenges/italian/blocks/workshop-reusable-mega-navbar/6745c732dbeb7c04f346e6f7.md index d6e5864176b..932300d38f5 100644 --- a/curriculum/challenges/italian/blocks/workshop-reusable-mega-navbar/6745c732dbeb7c04f346e6f7.md +++ b/curriculum/challenges/italian/blocks/workshop-reusable-mega-navbar/6745c732dbeb7c04f346e6f7.md @@ -7,7 +7,7 @@ dashedName: step-3 # --description-- -Crea un elemento `ul` all'interno dell'elemento `nav`. All'interno di quell'elemento `ul`, crea tre elementi di lista. +Crea un elemento `ul` all'interno del tuo elemento `nav`. All'interno di quell'elemento `ul`, crea tre elementi `li`. # --hints-- diff --git a/curriculum/challenges/italian/blocks/workshop-reusable-mega-navbar/6745c89fba004707ded84453.md b/curriculum/challenges/italian/blocks/workshop-reusable-mega-navbar/6745c89fba004707ded84453.md index 7fd115cd40c..b96fadb40ab 100644 --- a/curriculum/challenges/italian/blocks/workshop-reusable-mega-navbar/6745c89fba004707ded84453.md +++ b/curriculum/challenges/italian/blocks/workshop-reusable-mega-navbar/6745c89fba004707ded84453.md @@ -7,17 +7,17 @@ dashedName: step-5 # --description-- -Crea un elemento àncora all'interno del primo elemento `li`. Dai all'elemento `a` un attributo `href` con valore `#` e il testo `Dashboard`. +Crea un elemento `a` all'interno del tuo primo elemento `li`. Imposta un attributo `href` su `#` e il testo `Dashboard`. # --hints-- -Dovresti creare un elemento `a` all'interno del primo elemento della lista. +Dovresti creare un elemento `a` all'interno del tuo primo elemento `li`. ```js assert.exists(document.querySelector('li a')); ``` -Il tuo elemento `a` dovrebbe avere l’attributo `href` impostato su `#`. +Il tuo elemento `a` dovrebbe avere un attributo `href` impostato su `#`. ```js assert.equal(document.querySelector('a')?.getAttribute('href'), '#'); diff --git a/curriculum/challenges/italian/blocks/workshop-reusable-mega-navbar/6745cebbf97ef2129f3b9bab.md b/curriculum/challenges/italian/blocks/workshop-reusable-mega-navbar/6745cebbf97ef2129f3b9bab.md index 984cf63004a..513915fa9c5 100644 --- a/curriculum/challenges/italian/blocks/workshop-reusable-mega-navbar/6745cebbf97ef2129f3b9bab.md +++ b/curriculum/challenges/italian/blocks/workshop-reusable-mega-navbar/6745cebbf97ef2129f3b9bab.md @@ -7,17 +7,17 @@ dashedName: step-6 # --description-- -Crea un altro elemento `a` all’interno del secondo elemento `li`. Dagli un attributo `href` con valore `#` e il testo `Widgets`. +Crea un altro elemento `a` all'interno del tuo secondo elemento `li`. Dagli un attributo `href` con valore `#` e il testo `Widgets`. # --hints-- -Dovresti creare un elemento `a` all’interno del secondo elemento della lista. +Dovresti creare un elemento `a` all'interno del tuo secondo elemento `li`. ```js assert.lengthOf(document.querySelectorAll('li a'), 2); ``` -Il tuo elemento `a` dovrebbe avere l’attributo `href` impostato su `#`. +Il tuo elemento `a` dovrebbe avere un attributo `href` con valore `#`. ```js assert.equal(document.querySelectorAll('a')[1]?.getAttribute('href'), '#'); diff --git a/curriculum/challenges/italian/blocks/workshop-reusable-mega-navbar/6745d799beeb822076a4da9d.md b/curriculum/challenges/italian/blocks/workshop-reusable-mega-navbar/6745d799beeb822076a4da9d.md index 1267208c621..a1de3f16f23 100644 --- a/curriculum/challenges/italian/blocks/workshop-reusable-mega-navbar/6745d799beeb822076a4da9d.md +++ b/curriculum/challenges/italian/blocks/workshop-reusable-mega-navbar/6745d799beeb822076a4da9d.md @@ -7,13 +7,13 @@ dashedName: step-7 # --description-- -All’interno del terzo elemento della lista, crea un elemento `button` con un attributo `aria-expanded` impostato su `false`. Inoltre, imposta il testo del `button` su `Apps`. +All'interno del tuo terzo elemento `li`, crea un elemento `button` con un attributo `aria-expanded` impostato su `false`. Inoltre, imposta il testo del `button` su `Apps`. L’attributo `aria-expanded` comunicherà agli utenti di lettori di schermo che il pulsante attiva un sottomenu espandibile. # --hints-- -Dovresti creare un elemento `button` all’interno del terzo elemento della lista. +Dovresti creare un elemento `button` all'interno del tuo terzo elemento `li`. ```js assert.exists(document.querySelector('li:nth-of-type(3) button')); diff --git a/curriculum/challenges/italian/blocks/workshop-reusable-mega-navbar/6745d9df333efe2543a1f457.md b/curriculum/challenges/italian/blocks/workshop-reusable-mega-navbar/6745d9df333efe2543a1f457.md index a188688d2a1..0c6689ada3f 100644 --- a/curriculum/challenges/italian/blocks/workshop-reusable-mega-navbar/6745d9df333efe2543a1f457.md +++ b/curriculum/challenges/italian/blocks/workshop-reusable-mega-navbar/6745d9df333efe2543a1f457.md @@ -7,7 +7,7 @@ dashedName: step-8 # --description-- -Ancora all’interno del terzo elemento `li`, crea un elemento `ul` per il popup. Dagli un `className` di `sub-menu` e un `aria-label` di `Apps`. +Sempre all'interno del tuo terzo elemento `li`, crea un elemento `ul` per il popup. Dagli un `className` di `sub-menu` e un `aria-label` di `Apps`. # --hints-- @@ -17,13 +17,13 @@ Dovresti creare un elemento `ul` all’interno del tuo terzo elemento `li`. assert.exists(document.querySelector('li ul')); ``` -Dovresti impostare l’attributo `className` del tuo elemento `ul` su `sub-menu`. +Il tuo elemento `ul` dovrebbe avere un `className` di `sub-menu`. ```js assert.equal(document.querySelector('li ul')?.getAttribute('class'), 'sub-menu'); ``` -Dovresti impostare l’attributo `aria-label` del tuo elemento `ul` su `Apps`. +Il tuo elemento `ul` dovrebbe avere un `aria-label` di `Apps`. ```js assert.equal(document.querySelector('li ul')?.getAttribute('aria-label'), 'Apps'); diff --git a/curriculum/challenges/italian/blocks/workshop-reusable-mega-navbar/6745dce846995b2a466594be.md b/curriculum/challenges/italian/blocks/workshop-reusable-mega-navbar/6745dce846995b2a466594be.md index 1b08586718e..e3b24f4be30 100644 --- a/curriculum/challenges/italian/blocks/workshop-reusable-mega-navbar/6745dce846995b2a466594be.md +++ b/curriculum/challenges/italian/blocks/workshop-reusable-mega-navbar/6745dce846995b2a466594be.md @@ -7,11 +7,11 @@ dashedName: step-9 # --description-- -Crea tre nuovi elementi di lista all'interno del tuo elemento `ul.sub-menu`. +Crea tre nuovi `li` elementi all'interno del tuo `ul` elemento con un `className` di `sub-menu`. # --hints-- -Dovresti creare tre nuovi elementi di lista all'interno del tuo elemento `ul` con il `className` di `sub-menu`. +Dovresti creare tre nuovi `li` elementi all'interno del tuo `ul` elemento con un `className` di `sub-menu`. ```js assert.lengthOf(document.querySelectorAll('.sub-menu li'), 3); diff --git a/curriculum/challenges/italian/blocks/workshop-reusable-mega-navbar/6745de9ce925b92d72df713a.md b/curriculum/challenges/italian/blocks/workshop-reusable-mega-navbar/6745de9ce925b92d72df713a.md index 59d778ea04f..8e2e2f1c19b 100644 --- a/curriculum/challenges/italian/blocks/workshop-reusable-mega-navbar/6745de9ce925b92d72df713a.md +++ b/curriculum/challenges/italian/blocks/workshop-reusable-mega-navbar/6745de9ce925b92d72df713a.md @@ -7,11 +7,11 @@ dashedName: step-10 # --description-- -All'interno di ogni elemento `li`, crea un elemento àncora con un attributo `href` impostato su `#`. +All'interno di ciascuno dei tre nuovi elementi `li`, crea un elemento `a` con un attributo `href` impostato su `#`. # --hints-- -Dovresti creare un nuovo elemento `a` all'interno di ogni elemento della lista e impostare il suo attributo `href` su `#`. +Dovresti creare un nuovo elemento `a` con un attributo `href` impostato su `#` all'interno di ciascuno dei tre nuovi elementi `li`. ```js assert.equal(document.querySelectorAll('li a')[2]?.getAttribute('href'), '#'); diff --git a/curriculum/challenges/italian/blocks/workshop-reusable-mega-navbar/6745e2aca895c935168e7d91.md b/curriculum/challenges/italian/blocks/workshop-reusable-mega-navbar/6745e2aca895c935168e7d91.md index b208adc8747..0ae931d9fe7 100644 --- a/curriculum/challenges/italian/blocks/workshop-reusable-mega-navbar/6745e2aca895c935168e7d91.md +++ b/curriculum/challenges/italian/blocks/workshop-reusable-mega-navbar/6745e2aca895c935168e7d91.md @@ -7,25 +7,25 @@ dashedName: step-11 # --description-- -Per concludere, imposta un testo di `Calendar` per il primo tag àncora, `Chat` per il secondo e `Email` per il terzo. +Per concludere, imposta il testo del primo elemento `a` su `Calendar`, il secondo su `Chat` e il terzo su `Email`. -Con questo, il tuo mega componente barra di navigazione è completo! +Con questo, il tuo componente `Navbar` è completo! # --hints-- -Dovresti impostare un testo di `Calendar` per il primo elemento àncora. +Dovresti impostare il testo del primo elemento `a` su `Calendar`. ```js assert.equal(document.querySelectorAll('li a')[2]?.textContent, 'Calendar'); ``` -Dovresti impostare un testo di `Chat` per il secondo elemento àncora. +Dovresti impostare il testo del secondo elemento `a` su `Chat`. ```js assert.equal(document.querySelectorAll('li a')[3]?.textContent, 'Chat'); ``` -Dovresti impostare un testo di `Email` per il terzo elemento àncora. +Dovresti impostare il testo del terzo elemento `a` su `Email`. ```js assert.equal(document.querySelectorAll('li a')[4]?.textContent, 'Email'); diff --git a/curriculum/challenges/italian/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165b.md b/curriculum/challenges/italian/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165b.md index 24cbc40c2ab..aa7e6ef7e23 100644 --- a/curriculum/challenges/italian/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165b.md +++ b/curriculum/challenges/italian/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165b.md @@ -7,7 +7,7 @@ dashedName: step-5 # --description-- -All’interno della tua istruzione return, sostituisci la stringa vuota con un elemento `div` con una proprietà `className` impostata su `flex-container`. +All'interno della `return` istruzione, sostituisci la stringa vuota con un elemento `div` con un `className` di `flex-container`. # --hints-- @@ -26,7 +26,7 @@ Il tuo componente `App` dovrebbe restituire un singolo elemento `div`. assert.lengthOf(testElem.children, 1); ``` -Il tuo `div` dovrebbe avere una proprietà `className` impostata su `flex-container`. +Il tuo `div` dovrebbe avere un `className` di `flex-container`. ```js const testElem = await __helpers.prepTestComponent(window.index.App); diff --git a/curriculum/challenges/italian/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165c.md b/curriculum/challenges/italian/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165c.md index e063d6ea315..f2f6dfcbaa9 100644 --- a/curriculum/challenges/italian/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165c.md +++ b/curriculum/challenges/italian/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165c.md @@ -7,7 +7,7 @@ dashedName: step-6 # --description-- -Ora, inserisci il componente `Card` nel tuo componente `App`. Imposta la prop `name` su `"Mark"`, la prop `title` su `"Front-End developer"` e la prop `bio` su `"I like to work with different front-end technologies and play video games."` +Ora, inserisci il componente `Card` nel tuo componente `App`. Dagli la prop `name` impostata su `"Mark"`, la prop `title` impostata su `"Front-End developer"` e la prop `bio` impostata su `"I like to work with different front-end technologies and play video games."` # --hints-- diff --git a/curriculum/challenges/italian/blocks/workshop-reusable-profile-card-component/68720c179cd34be6793bfdf6.md b/curriculum/challenges/italian/blocks/workshop-reusable-profile-card-component/68720c179cd34be6793bfdf6.md index 0cc7d86eac4..66270ca149f 100644 --- a/curriculum/challenges/italian/blocks/workshop-reusable-profile-card-component/68720c179cd34be6793bfdf6.md +++ b/curriculum/challenges/italian/blocks/workshop-reusable-profile-card-component/68720c179cd34be6793bfdf6.md @@ -9,7 +9,7 @@ dashedName: step-8 Anche se la tua applicazione funziona come previsto, di solito non aggiungeresti manualmente più componenti `Card` in questo modo. -Rimuovi i tre componenti `` all'interno dell'elemento `
`. Nei prossimi passaggi, creerai un array di dati e userai la funzione `map()` per renderizzare i componenti `Card`, che è l'approccio più comune in React. +Rimuovi i tre componenti `` all'interno dell'elemento `
`. Nei prossimi passaggi, creerai un array di dati e userai il metodo `map()` per renderizzare i componenti `Card`, che è l'approccio più comune in React. # --hints-- diff --git a/curriculum/challenges/italian/blocks/workshop-reusable-profile-card-component/68778af56eb5d980a4e2daed.md b/curriculum/challenges/italian/blocks/workshop-reusable-profile-card-component/68778af56eb5d980a4e2daed.md index 2c01a7c0b42..fc21b3b752b 100644 --- a/curriculum/challenges/italian/blocks/workshop-reusable-profile-card-component/68778af56eb5d980a4e2daed.md +++ b/curriculum/challenges/italian/blocks/workshop-reusable-profile-card-component/68778af56eb5d980a4e2daed.md @@ -30,7 +30,7 @@ const profilesVal = eval(profiles?.value.toString()); assert.isArray(profilesVal); ``` -Il tuo array profiles dovrebbe contenere un oggetto che include tutte le proprietà richieste: `id`, `name`, `title` e `bio`. +Il tuo array `profiles` dovrebbe contenere un oggetto che include tutte le prop richieste: `id`, `name`, `title` e `bio`. ```js const explorer = await __helpers.Explorer(code); diff --git a/curriculum/challenges/italian/blocks/workshop-reusable-profile-card-component/68779156bd3704b727ba5f38.md b/curriculum/challenges/italian/blocks/workshop-reusable-profile-card-component/68779156bd3704b727ba5f38.md index 292b63af0b4..bec8978c197 100644 --- a/curriculum/challenges/italian/blocks/workshop-reusable-profile-card-component/68779156bd3704b727ba5f38.md +++ b/curriculum/challenges/italian/blocks/workshop-reusable-profile-card-component/68779156bd3704b727ba5f38.md @@ -7,7 +7,7 @@ dashedName: step-10 # --description-- -Come ricordi dalle lezioni precedenti, puoi usare il metodo `map` per iterare su diversi oggetti e renderizzare i componenti dinamicamente in questo modo: +Come ricorderai dalle lezioni precedenti, puoi usare il metodo `map()` per iterare su diversi oggetti e renderizzare dinamicamente i componenti in questo modo: ```jsx export function App() { diff --git a/curriculum/challenges/italian/blocks/workshop-toggle-text-app/67cd46ec4ec904186ad52ba5.md b/curriculum/challenges/italian/blocks/workshop-toggle-text-app/67cd46ec4ec904186ad52ba5.md index 349b7e1c426..82aac8263f8 100644 --- a/curriculum/challenges/italian/blocks/workshop-toggle-text-app/67cd46ec4ec904186ad52ba5.md +++ b/curriculum/challenges/italian/blocks/workshop-toggle-text-app/67cd46ec4ec904186ad52ba5.md @@ -7,7 +7,7 @@ dashedName: step-3 # --description-- -Sotto il tuo elemento `button`, aggiungi un elemento paragrafo con un `id` di `message` e il testo `I love freeCodeCamp!`. +Sotto il tuo elemento `button`, aggiungi un elemento paragrafo con un `id` chiamato `message` e il testo `I love freeCodeCamp!`. # --hints-- @@ -17,7 +17,7 @@ Dovresti avere un elemento paragrafo. assert.exists(document.querySelector("p")); ``` -Il tuo elemento paragrafo dovrebbe avere un `id` di `message`. +Il tuo elemento paragrafo dovrebbe avere un `id` chiamato `message`. ```js assert.exists(document.getElementById("message")) diff --git a/curriculum/challenges/italian/blocks/workshop-toggle-text-app/67cd49e05693111a41771f29.md b/curriculum/challenges/italian/blocks/workshop-toggle-text-app/67cd49e05693111a41771f29.md index 16d6414d7d0..230eeceb02c 100644 --- a/curriculum/challenges/italian/blocks/workshop-toggle-text-app/67cd49e05693111a41771f29.md +++ b/curriculum/challenges/italian/blocks/workshop-toggle-text-app/67cd49e05693111a41771f29.md @@ -19,7 +19,7 @@ La convenzione per nominare le variabili di stato è usare il formato `example` Crea una nuova variabile di stato e una funzione set chiamate `isVisible` e `setIsVisible`. Ricorda di usare la sintassi di destrutturazione degli array come mostrato nell’esempio. -Poi assegna il hook `useState` con un valore iniziale di `false`. +Poi chiama il hook `useState` con un valore iniziale di `false`. # --hints-- diff --git a/curriculum/challenges/italian/blocks/workshop-toggle-text-app/67cd4fe67813f71c3479e64a.md b/curriculum/challenges/italian/blocks/workshop-toggle-text-app/67cd4fe67813f71c3479e64a.md index b1ff5b8b6af..a6152e311ea 100644 --- a/curriculum/challenges/italian/blocks/workshop-toggle-text-app/67cd4fe67813f71c3479e64a.md +++ b/curriculum/challenges/italian/blocks/workshop-toggle-text-app/67cd4fe67813f71c3479e64a.md @@ -9,7 +9,7 @@ dashedName: step-6 Un modo per mostrare il testo del paragrafo è cambiare il valore iniziale per il hook `useState`. -Cambia il valore attuale `useState` da `false` a `true` e dovresti vedere che il testo del paragrafo ora viene visualizzato sullo schermo. +Cambia il valore iniziale di `useState` da `false` a `true`. Se fatto correttamente, dovresti vedere che il testo del paragrafo viene ora visualizzato sullo schermo. # --hints-- diff --git a/curriculum/challenges/italian/blocks/workshop-toggle-text-app/67cd525b0e575b1e5abf4c03.md b/curriculum/challenges/italian/blocks/workshop-toggle-text-app/67cd525b0e575b1e5abf4c03.md index 641c3ecbd63..798f156346e 100644 --- a/curriculum/challenges/italian/blocks/workshop-toggle-text-app/67cd525b0e575b1e5abf4c03.md +++ b/curriculum/challenges/italian/blocks/workshop-toggle-text-app/67cd525b0e575b1e5abf4c03.md @@ -16,7 +16,7 @@ const [isUserLoggedIn, setIsUserLoggedIn] = useState(false); setIsUserLoggedIn(!isUserLoggedIn); ``` -L'esempio seguente usa la funzione set chiamata `setIsUserLoggedIn` per aggiornare lo stato di login dell'utente. È pratica comune usare l'operatore logico NOT (`!`) per alternare tra `true` e `false`. Poiché il valore iniziale è `false`, applicare l'operatore `!` lo cambierà in `true`. +L'esempio sopra utilizza la funzione set chiamata `setIsUserLoggedIn` per aggiornare lo stato di accesso dell'utente. È pratica comune usare l'operatore logico NOT (`!`) per alternare tra `true` e `false`. Poiché il valore iniziale è `false`, applicare l'operatore `!` lo cambierà in `true`. All'interno della funzione `handleToggleVisibility`, usa `setIsVisible` per aggiornare lo stato di visibilità usando l'operatore logico NOT (`!`). diff --git a/curriculum/challenges/italian/blocks/workshop-toggle-text-app/67cd57e96257ed1fabbe4879.md b/curriculum/challenges/italian/blocks/workshop-toggle-text-app/67cd57e96257ed1fabbe4879.md index 6bbc7e381fa..7ab4afacd15 100644 --- a/curriculum/challenges/italian/blocks/workshop-toggle-text-app/67cd57e96257ed1fabbe4879.md +++ b/curriculum/challenges/italian/blocks/workshop-toggle-text-app/67cd57e96257ed1fabbe4879.md @@ -27,7 +27,7 @@ Ora, quando clicchi sul pulsante, vedrai la visibilità del testo del paragrafo # --hints-- -Quando si clicca sul `toggle-button`, il messaggio `"I love freeCodeCamp!"` dovrebbe apparire sullo schermo. +Il tuo messaggio `I love freeCodeCamp!` dovrebbe apparire sullo schermo quando si clicca sul `toggle-button`. ```js const abuseState = __helpers.spyOn(React, "useState"); diff --git a/curriculum/challenges/italian/blocks/workshop-toggle-text-app/67cd59f6581d3a20c9cc6460.md b/curriculum/challenges/italian/blocks/workshop-toggle-text-app/67cd59f6581d3a20c9cc6460.md index b7a634068b9..9ab11de33a4 100644 --- a/curriculum/challenges/italian/blocks/workshop-toggle-text-app/67cd59f6581d3a20c9cc6460.md +++ b/curriculum/challenges/italian/blocks/workshop-toggle-text-app/67cd59f6581d3a20c9cc6460.md @@ -9,7 +9,7 @@ dashedName: step-11 Ora è un buon momento per vedere il valore `isVisible` aggiornato. -Sotto il `setIsVisible(!isVisible);`, registra la variabile di stato `isVisible` nella console. +Sotto `setIsVisible(!isVisible);`, registra la variabile di stato `isVisible` nella console. Apri la console e noterai che il valore non è quello che ti aspettavi. diff --git a/curriculum/challenges/italian/blocks/workshop-toggle-text-app/67cd5bace629fa219a70aa6d.md b/curriculum/challenges/italian/blocks/workshop-toggle-text-app/67cd5bace629fa219a70aa6d.md index b90dd07931e..fa1775203bf 100644 --- a/curriculum/challenges/italian/blocks/workshop-toggle-text-app/67cd5bace629fa219a70aa6d.md +++ b/curriculum/challenges/italian/blocks/workshop-toggle-text-app/67cd5bace629fa219a70aa6d.md @@ -9,7 +9,7 @@ dashedName: step-12 Se hai guardato la console, potresti essere rimasto sorpreso nel vedere il valore di `false` invece di `true`. Questo succede perché React non aggiorna immediatamente lo stato. Lo stato verrà aggiornato solo nel ciclo di render successivo. -È un errore comune per gli sviluppatori alle prime armi con React mettere istruzioni console subito dopo una funzione set. Quindi è qualcosa di cui tenere conto quando costruisci le tue applicazioni React. +È un errore comune per gli sviluppatori nuovi a React inserire istruzioni console subito dopo una funzione set. Quindi è qualcosa di cui essere consapevoli mentre costruisci le tue applicazioni React. Dato che `console.log()` non è più necessario, rimuovilo dalla tua funzione `handleToggleVisibility`. diff --git a/curriculum/challenges/italian/blocks/workshop-toggle-text-app/67cd61c24bfc0a240132fd2f.md b/curriculum/challenges/italian/blocks/workshop-toggle-text-app/67cd61c24bfc0a240132fd2f.md index aecc92db471..83315753f7d 100644 --- a/curriculum/challenges/italian/blocks/workshop-toggle-text-app/67cd61c24bfc0a240132fd2f.md +++ b/curriculum/challenges/italian/blocks/workshop-toggle-text-app/67cd61c24bfc0a240132fd2f.md @@ -23,14 +23,14 @@ E con quest'ultima modifica, il tuo workshop è completo! Prova il pulsante per # --hints-- -Quando `isVisible` è `false`, il testo del pulsante dovrebbe dire `Show Message`. +Il testo del tuo pulsante dovrebbe dire `Show Message` quando `isVisible` è `false`. ```js const btn = document.getElementById("toggle-button"); assert.equal(btn.textContent, "Show Message"); ``` -Quando `isVisible` è `true`, il testo del pulsante dovrebbe dire `Hide Message`. +Il testo del tuo pulsante dovrebbe dire `Hide Message` quando `isVisible` è `true`. ```js const abuseState = __helpers.spyOn(React, "useState"); @@ -246,7 +246,7 @@ export const ToggleApp = () => { const handleToggleVisibility = () => { setIsVisible(!isVisible); - } + }; return (
diff --git a/curriculum/challenges/italian/blocks/workshop-wildlife-tracker/6999ac171928136168654774.md b/curriculum/challenges/italian/blocks/workshop-wildlife-tracker/6999ac171928136168654774.md index c4da3872009..cac991a1ec3 100644 --- a/curriculum/challenges/italian/blocks/workshop-wildlife-tracker/6999ac171928136168654774.md +++ b/curriculum/challenges/italian/blocks/workshop-wildlife-tracker/6999ac171928136168654774.md @@ -42,8 +42,10 @@ assert.isFunction(getSpecies); La funzione `getSpecies` dovrebbe avere un solo parametro, `animal`. ```js -const regex = __helpers.functionRegex('getSpecies', ['animal']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { getSpecies } = explorer.allFunctions; +assert.equal(getSpecies?.parameters.length, 1); +assert.equal(getSpecies?.parameters[0].toString(), 'animal'); ``` Dovresti stampare `getSpecies(tiger)` nella console. diff --git a/curriculum/challenges/italian/blocks/workshop-wildlife-tracker/6999ad1cdc249e185aaeedbd.md b/curriculum/challenges/italian/blocks/workshop-wildlife-tracker/6999ad1cdc249e185aaeedbd.md index 7feaeb44396..c90247c42ac 100644 --- a/curriculum/challenges/italian/blocks/workshop-wildlife-tracker/6999ad1cdc249e185aaeedbd.md +++ b/curriculum/challenges/italian/blocks/workshop-wildlife-tracker/6999ad1cdc249e185aaeedbd.md @@ -49,8 +49,11 @@ assert.isFunction(addHabitat); La funzione `addHabitat` dovrebbe avere due parametri: `animal` e `habitat`. ```js -const regex = __helpers.functionRegex('addHabitat', ['animal', 'habitat']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { addHabitat } = explorer.allFunctions; +assert.equal(addHabitat?.parameters.length, 2); +assert.equal(addHabitat?.parameters[0].toString(), 'animal'); +assert.equal(addHabitat?.parameters[1].toString(), 'habitat'); ``` La funzione `addHabitat` dovrebbe restituire l'oggetto `animal` aggiornato. diff --git a/curriculum/challenges/italian/blocks/workshop-wildlife-tracker/6999adc72c02812a28c01e31.md b/curriculum/challenges/italian/blocks/workshop-wildlife-tracker/6999adc72c02812a28c01e31.md index 861567588eb..e61080659d3 100644 --- a/curriculum/challenges/italian/blocks/workshop-wildlife-tracker/6999adc72c02812a28c01e31.md +++ b/curriculum/challenges/italian/blocks/workshop-wildlife-tracker/6999adc72c02812a28c01e31.md @@ -43,8 +43,11 @@ assert.isFunction(updateAge); La funzione `updateAge` dovrebbe avere due parametri: `animal` e `newAge`. ```js -const regex = __helpers.functionRegex('updateAge', ['animal', 'newAge']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { updateAge } = explorer.allFunctions; +assert.equal(updateAge?.parameters.length, 2); +assert.equal(updateAge?.parameters[0].toString(), 'animal'); +assert.equal(updateAge?.parameters[1].toString(), 'newAge'); ``` La funzione `updateAge` dovrebbe ritornare l'oggetto `animal` aggiornato. diff --git a/curriculum/challenges/italian/blocks/workshop-wildlife-tracker/6999b0198d18d402c36cc5fe.md b/curriculum/challenges/italian/blocks/workshop-wildlife-tracker/6999b0198d18d402c36cc5fe.md index 891f16ff74b..9e2829ae73d 100644 --- a/curriculum/challenges/italian/blocks/workshop-wildlife-tracker/6999b0198d18d402c36cc5fe.md +++ b/curriculum/challenges/italian/blocks/workshop-wildlife-tracker/6999b0198d18d402c36cc5fe.md @@ -45,8 +45,10 @@ assert.isFunction(removeEndangeredStatus); La funzione `removeEndangeredStatus` dovrebbe avere un solo parametro, `animal`. ```js -const regex = __helpers.functionRegex('removeEndangeredStatus', ['animal']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { removeEndangeredStatus } = explorer.allFunctions; +assert.equal(removeEndangeredStatus?.parameters.length, 1); +assert.equal(removeEndangeredStatus?.parameters[0].toString(), 'animal'); ``` La funzione `removeEndangeredStatus` dovrebbe ritornare l'oggetto `animal` aggiornato. diff --git a/curriculum/challenges/italian/blocks/workshop-wildlife-tracker/6999b07c34c2cde21ee6e1d8.md b/curriculum/challenges/italian/blocks/workshop-wildlife-tracker/6999b07c34c2cde21ee6e1d8.md index 5350b62ccaa..924315448fa 100644 --- a/curriculum/challenges/italian/blocks/workshop-wildlife-tracker/6999b07c34c2cde21ee6e1d8.md +++ b/curriculum/challenges/italian/blocks/workshop-wildlife-tracker/6999b07c34c2cde21ee6e1d8.md @@ -49,8 +49,10 @@ assert.isFunction(hasHabitat); La funzione `hasHabitat` dovrebbe avere un solo parametro, `animal`. ```js -const regex = __helpers.functionRegex('hasHabitat', ['animal']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { hasHabitat } = explorer.allFunctions; +assert.equal(hasHabitat?.parameters.length, 1); +assert.equal(hasHabitat?.parameters[0].toString(), 'animal'); ``` `hasHabitat` dovrebbe usare il metodo `hasOwnProperty` per controllare la proprietà `habitat`. diff --git a/curriculum/challenges/italian/blocks/workshop-wildlife-tracker/6999b0d79ea938edcb032237.md b/curriculum/challenges/italian/blocks/workshop-wildlife-tracker/6999b0d79ea938edcb032237.md index d0b7ccccc42..2e00edcd49a 100644 --- a/curriculum/challenges/italian/blocks/workshop-wildlife-tracker/6999b0d79ea938edcb032237.md +++ b/curriculum/challenges/italian/blocks/workshop-wildlife-tracker/6999b0d79ea938edcb032237.md @@ -45,8 +45,11 @@ assert.isFunction(getProperty); La funzione `getProperty` dovrebbe avere due parametri: `animal` e `propertyName`. ```js -const regex = __helpers.functionRegex('getProperty', ['animal', 'propertyName']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { getProperty } = explorer.allFunctions; +assert.equal(getProperty?.parameters.length, 2); +assert.equal(getProperty?.parameters[0].toString(), 'animal'); +assert.equal(getProperty?.parameters[1].toString(), 'propertyName'); ``` `getProperty` dovrebbe usare la notazione a parentesi per consultare la proprietà. diff --git a/curriculum/challenges/italian/blocks/workshop-wildlife-tracker/699a00de9f564bb0effaa14d.md b/curriculum/challenges/italian/blocks/workshop-wildlife-tracker/699a00de9f564bb0effaa14d.md index c69ca690b95..c06a8f0fe0b 100644 --- a/curriculum/challenges/italian/blocks/workshop-wildlife-tracker/699a00de9f564bb0effaa14d.md +++ b/curriculum/challenges/italian/blocks/workshop-wildlife-tracker/699a00de9f564bb0effaa14d.md @@ -44,8 +44,10 @@ assert.isFunction(getAge); La funzione `getAge` dovrebbe avere un solo parametro, `animal`. ```js -const regex = __helpers.functionRegex('getAge', ['animal']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { getAge } = explorer.allFunctions; +assert.equal(getAge?.parameters.length, 1); +assert.equal(getAge?.parameters[0].toString(), 'animal'); ``` `getAge` dovrebbe consultare la proprietà `age` usando la notazione a punto. diff --git a/curriculum/challenges/japanese/blocks/back-end-development-and-apis-projects/bd7158d8c443edefaeb5bd0f.md b/curriculum/challenges/japanese/blocks/back-end-development-and-apis-projects/bd7158d8c443edefaeb5bd0f.md index 23bc7fb9f3a..444f5f1f3d1 100644 --- a/curriculum/challenges/japanese/blocks/back-end-development-and-apis-projects/bd7158d8c443edefaeb5bd0f.md +++ b/curriculum/challenges/japanese/blocks/back-end-development-and-apis-projects/bd7158d8c443edefaeb5bd0f.md @@ -19,7 +19,7 @@ dashedName: file-metadata-microservice # --hints-- -自分のプロジェクトを用意し、例のURLは使わないでください。 +独自のプロジェクトを用意してください。例のURLは使わないでください。 ```js assert( @@ -50,18 +50,22 @@ dashedName: file-metadata-microservice ファイルを提出すると、JSONレスポンス内でファイルの`name`、`type`、`size`(バイト単位)を受け取ります。 ```js - const formData = new FormData(); - const fileData = await fetch( - 'https://cdn.freecodecamp.org/weather-icons/01d.png' - ); - const file = await fileData.blob(); - formData.append('upfile', file, 'icon'); + const boundary = 'fccBoundary1234567890'; + const head = + `--${boundary}\r\n` + + 'Content-Disposition: form-data; name="upfile"; filename="icon"\r\n' + + 'Content-Type: image/png\r\n\r\n'; + const body = new Blob([head, new Uint8Array(70), `\r\n--${boundary}--\r\n`]); const data = await fetch(code + '/api/fileanalyse', { method: 'POST', - body: formData + headers: { + 'Content-Type': `multipart/form-data; boundary=${boundary}` + }, + body }); const parsed = await data.json(); assert.property(parsed, 'size'); assert.equal(parsed.name, 'icon'); assert.equal(parsed.type, 'image/png'); ``` + diff --git a/curriculum/challenges/japanese/blocks/daily-coding-challenges-javascript/6a26df3e2988bcdded204895.md b/curriculum/challenges/japanese/blocks/daily-coding-challenges-javascript/6a26df3e2988bcdded204895.md index 4864259f3c1..3714a79048b 100644 --- a/curriculum/challenges/japanese/blocks/daily-coding-challenges-javascript/6a26df3e2988bcdded204895.md +++ b/curriculum/challenges/japanese/blocks/daily-coding-challenges-javascript/6a26df3e2988bcdded204895.md @@ -25,10 +25,10 @@ assert.equal(calculateHandicap([72, 72, 72], [72, 72, 72]), 0); assert.equal(calculateHandicap([80, 76, 78, 78], [72, 72, 72, 72]), 6); ``` -`calculateHandicap([42, 45, 46, 44], [36, 36, 36, 36])` は `8.3` を返すべきです。 +`calculateHandicap([42, 45, 46, 45], [36, 36, 36, 36])` は `8.5` を返すべきです。 ```js -assert.equal(calculateHandicap([42, 45, 46, 44], [36, 36, 36, 36]), 8.3); +assert.equal(calculateHandicap([42, 45, 46, 45], [36, 36, 36, 36]), 8.5); ``` `calculateHandicap([85, 80, 76, 79, 82], [72, 72, 72, 71, 71])` は `8.8` を返すべきです。 diff --git a/curriculum/challenges/japanese/blocks/daily-coding-challenges-python/6a26df3e2988bcdded204895.md b/curriculum/challenges/japanese/blocks/daily-coding-challenges-python/6a26df3e2988bcdded204895.md index 5356ebd3617..c959bf3885a 100644 --- a/curriculum/challenges/japanese/blocks/daily-coding-challenges-python/6a26df3e2988bcdded204895.md +++ b/curriculum/challenges/japanese/blocks/daily-coding-challenges-python/6a26df3e2988bcdded204895.md @@ -31,12 +31,12 @@ TestCase().assertEqual(calculate_handicap([80, 76, 78, 78], [72, 72, 72, 72]), 6 }}) ``` -`calculate_handicap([42, 45, 46, 44], [36, 36, 36, 36])` は `8.3` を返すべきです。 +`calculate_handicap([42, 45, 46, 45], [36, 36, 36, 36])` は `8.5` を返すべきです。 ```js ({test: () => { runPython(` from unittest import TestCase -TestCase().assertEqual(calculate_handicap([42, 45, 46, 44], [36, 36, 36, 36]), 8.3)`) +TestCase().assertEqual(calculate_handicap([42, 45, 46, 45], [36, 36, 36, 36]), 8.5)`) }}) ``` diff --git a/curriculum/challenges/japanese/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb928.md b/curriculum/challenges/japanese/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb928.md index 261aa471722..43f8b556e76 100644 --- a/curriculum/challenges/japanese/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb928.md +++ b/curriculum/challenges/japanese/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb928.md @@ -8,7 +8,7 @@ dashedName: mean-variance-standard-deviation-calculator # --description-- -Onaのスターターコードを使ってこのプロジェクトに取り組みます。 +このプロジェクトはボイラープレートのコードを使って進めます。 Pythonカリキュラムのインタラクティブな指導部分はまだ開発中です。今のところ、このプロジェクトを完成させるために必要なことをすべて学べるfreeCodeCamp.orgのYouTubeチャンネルの動画をいくつか紹介します: @@ -52,15 +52,16 @@ Numpyを使って、3×3の行列の行、列、要素の平均、分散、標 ## 開発 -`mean_var_std.py`にコードを書いてください。開発中は`main.py`を使ってコードをテストできます。コードを実行するには、Onaのターミナルに`python3 main.py`と入力してEnterを押してください。これにより、付属のCPythonインタープリターが`main.py`ファイルを実行します。 +`mean_var_std.py` にコードを書いてください。開発中は `main.py` を使ってコードをテストできます。 +コードを実行するには、ターミナルで `python3 main.py` と入力して Enter キーを押してください。これにより、付属の CPython インタープリターが `main.py` ファイルを実行します。 ## テスト -このプロジェクトの単体テストは`test_module.py`にあります。利便性のために`test_module.py`から`main.py`にテストをインポートしています。 +このプロジェクトのユニットテストは`test_module.py`にあります。利便性のために`test_module.py`から`main.py`にテストをインポートしました。 ## 提出 -プロジェクトのURLをコピーしてfreeCodeCampに提出してください。 +プロジェクトのURLをコピーして freeCodeCamp に提出してください。 # --hints-- diff --git a/curriculum/challenges/japanese/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb929.md b/curriculum/challenges/japanese/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb929.md index 0059b7238b5..a3b8267782b 100644 --- a/curriculum/challenges/japanese/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb929.md +++ b/curriculum/challenges/japanese/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb929.md @@ -8,9 +8,9 @@ dashedName: demographic-data-analyzer # --description-- -このプロジェクトはOnaのスターターコードを使って進めます。 +このプロジェクトはスターターコードを使って進めます。 -Pythonカリキュラムのインタラクティブな指導部分はまだ開発中です。今のところ、このプロジェクトを完成させるために必要なことを学べるfreeCodeCamp.orgのYouTubeチャンネルの動画をいくつか紹介します: +Pythonカリキュラムのインタラクティブな指導部分はまだ開発中です。今のところ、このプロジェクトを完成させるために必要なことをすべて学べるfreeCodeCamp.orgのYouTubeチャンネルの動画をいくつか紹介します: - Python for Everybody ビデオコース(14時間) @@ -50,19 +50,19 @@ Pythonカリキュラムのインタラクティブな指導部分はまだ開 ## テスト -このプロジェクトの単体テストは`test_module.py` にあります。利便性のために`test_module.py` から`main.py` にテストをインポートしています。 +このプロジェクトのユニットテストは`test_module.py`にあります。利便性のために`test_module.py`から`main.py`にテストをインポートしました。 ## 提出 -プロジェクトのURLをコピーしてfreeCodeCampに提出してください。 +プロジェクトのURLをコピーして freeCodeCamp に提出してください。 ## データセットの出典 -Dua, D. and Graff, C. (2019). UCI Machine Learning Repository. Irvine, CA: University of California, School of Information and Computer Science. +すべてのPythonテストに合格するはずです。 # --hints-- -すべてのPythonテストに合格するはずです。 +すべてのPythonテストに合格する必要があります。 ```js diff --git a/curriculum/challenges/japanese/blocks/data-analysis-with-python-projects/5e46f7f8ac417301a38fb92a.md b/curriculum/challenges/japanese/blocks/data-analysis-with-python-projects/5e46f7f8ac417301a38fb92a.md index 7f995e39174..507d6ae97c9 100644 --- a/curriculum/challenges/japanese/blocks/data-analysis-with-python-projects/5e46f7f8ac417301a38fb92a.md +++ b/curriculum/challenges/japanese/blocks/data-analysis-with-python-projects/5e46f7f8ac417301a38fb92a.md @@ -8,9 +8,9 @@ dashedName: medical-data-visualizer # --description-- -このプロジェクトはOnaのスターターコードを使って進めます。 +このプロジェクトは私たちのスターターコードを使って進めていきます。 -Pythonカリキュラムのインタラクティブな指導部分はまだ開発中です。今のところ、このプロジェクトを完成させるために必要なことを学べるfreeCodeCamp.orgのYouTubeチャンネルの動画をいくつか紹介します: +Pythonカリキュラムのインタラクティブな指導部分はまだ開発中です。今のところ、このプロジェクトを完成させるために必要なことをすべて学べるfreeCodeCamp.orgのYouTubeチャンネルの動画をいくつか紹介します: - Python for Everybody ビデオコース(14時間) @@ -76,15 +76,15 @@ Pythonカリキュラムのインタラクティブな指導部分はまだ開 ## テスト -このプロジェクトのユニットテストは`test_module.py`にあります。利便性のために`test_module.py`から`main.py`までテストをインポートしました。 +このプロジェクトのユニットテストは`test_module.py`にあります。利便性のために`test_module.py`から`main.py`にテストをインポートしました。 ## 提出 -プロジェクトのURLをコピーしてfreeCodeCampに提出してください。 +プロジェクトのURLをコピーして freeCodeCamp に提出してください。 # --hints-- -すべてのPythonテストに合格するはずです。 +すべてのPythonテストに合格する必要があります。 ```js diff --git a/curriculum/challenges/japanese/blocks/data-analysis-with-python-projects/5e46f802ac417301a38fb92b.md b/curriculum/challenges/japanese/blocks/data-analysis-with-python-projects/5e46f802ac417301a38fb92b.md index 72a57f365b4..ee5f62d9a73 100644 --- a/curriculum/challenges/japanese/blocks/data-analysis-with-python-projects/5e46f802ac417301a38fb92b.md +++ b/curriculum/challenges/japanese/blocks/data-analysis-with-python-projects/5e46f802ac417301a38fb92b.md @@ -8,9 +8,9 @@ dashedName: page-view-time-series-visualizer # --description-- -このプロジェクトはOnaのスターターコードを使って進めます。 +こちらのスターターコードを使ってこのプロジェクトに取り組みます。 -Pythonカリキュラムのインタラクティブな指導部分はまだ開発中です。今のところ、このプロジェクトを完成させるために必要なことを学べるfreeCodeCamp.orgのYouTubeチャンネルの動画をいくつか紹介します: +Pythonカリキュラムのインタラクティブな指導部分はまだ開発中です。今のところ、このプロジェクトを完成させるために必要なことをすべて学べるfreeCodeCamp.orgのYouTubeチャンネルの動画をいくつか紹介します: - Python for Everybody ビデオコース(14時間) @@ -38,11 +38,11 @@ Pythonカリキュラムのインタラクティブな指導部分はまだ開 ## テスト -このプロジェクトのユニットテストは`test_module.py`にあります。利便性のために`test_module.py`から`main.py`までテストをインポートしています。 +このプロジェクトのユニットテストは`test_module.py`にあります。利便性のために`test_module.py`から`main.py`にテストをインポートしました。 ## 提出 -プロジェクトのURLをコピーしてfreeCodeCampに提出してください。 +プロジェクトのURLをコピーして freeCodeCamp に提出してください。 # --hints-- diff --git a/curriculum/challenges/japanese/blocks/data-analysis-with-python-projects/5e4f5c4b570f7e3a4949899f.md b/curriculum/challenges/japanese/blocks/data-analysis-with-python-projects/5e4f5c4b570f7e3a4949899f.md index 9df1097ea90..a7acb475fda 100644 --- a/curriculum/challenges/japanese/blocks/data-analysis-with-python-projects/5e4f5c4b570f7e3a4949899f.md +++ b/curriculum/challenges/japanese/blocks/data-analysis-with-python-projects/5e4f5c4b570f7e3a4949899f.md @@ -8,7 +8,7 @@ dashedName: sea-level-predictor # --description-- -このプロジェクトではOnaのスターターコードを使って作業します。 +このプロジェクトはスターターコードを使って進めます。 Pythonカリキュラムのインタラクティブな指導部分はまだ開発中です。今のところ、このプロジェクトを完成させるために必要なことをすべて学べるfreeCodeCamp.orgのYouTubeチャンネルの動画をいくつか紹介します: @@ -36,11 +36,11 @@ Pythonカリキュラムのインタラクティブな指導部分はまだ開 ## テスト -このプロジェクトのユニットテストは`test_module.py`にあります。利便性のために`test_module.py`から`main.py`にテストをインポートしています。 +このプロジェクトのユニットテストは`test_module.py`にあります。利便性のために`test_module.py`から`main.py`にテストをインポートしました。 ## 提出 -プロジェクトのURLをコピーしてfreeCodeCampに提出してください。 +プロジェクトのURLをコピーして freeCodeCamp に提出してください。 ## データソース 世界平均絶対海面変動、1880-2014年、米国環境保護庁、CSIRO 2015年、NOAA 2015年のデータを使用。 @@ -48,7 +48,7 @@ Pythonカリキュラムのインタラクティブな指導部分はまだ開 # --hints-- -すべてのPythonテストに合格するはずです。 +すべてのPythonテストに合格する必要があります。 ```js diff --git a/curriculum/challenges/japanese/blocks/information-security-projects/5e46f979ac417301a38fb932.md b/curriculum/challenges/japanese/blocks/information-security-projects/5e46f979ac417301a38fb932.md index ea4a1f6efe4..80cdd69d024 100644 --- a/curriculum/challenges/japanese/blocks/information-security-projects/5e46f979ac417301a38fb932.md +++ b/curriculum/challenges/japanese/blocks/information-security-projects/5e46f979ac417301a38fb932.md @@ -9,9 +9,9 @@ dashedName: port-scanner # --description-- -このプロジェクトはOnaのスターターコードを使って進めていきます。 +このプロジェクトはスターターコードを使って進めます。 -Pythonカリキュラムのインタラクティブな指導部分はまだ開発中です。今のところ、このプロジェクトを完成させるために必要なことを学べるfreeCodeCamp.orgのYouTubeチャンネルの動画をいくつか紹介します: +Pythonカリキュラムのインタラクティブな指導部分はまだ開発中です。今のところ、このプロジェクトを完成させるために必要なことをすべて学べるfreeCodeCamp.orgのYouTubeチャンネルの動画をいくつか紹介します: - Python for Everybody ビデオコース(14時間) @@ -68,17 +68,17 @@ PORT SERVICE `get_open_ports` 関数に渡されたIPアドレスが無効な場合、関数は "Error: Invalid IP address" という文字列を返す必要があります。 -## Development +## 開発 `port_scanner.py` にコードを書いてください。開発中は `main.py` を使ってコードをテストできます。 -## Testing +## テスト -このプロジェクトのユニットテストは `test_module.py` にあります。利便性のために `test_module.py` から `main.py` にテストをインポートしています。 +このプロジェクトのユニットテストは`test_module.py`にあります。利便性のために`test_module.py`から`main.py`にテストをインポートしました。 -## Submitting +## 提出 -プロジェクトのURLをコピーしてfreeCodeCampに提出してください。 +プロジェクトのURLをコピーして freeCodeCamp に提出してください。 # --hints-- diff --git a/curriculum/challenges/japanese/blocks/information-security-projects/5e46f983ac417301a38fb933.md b/curriculum/challenges/japanese/blocks/information-security-projects/5e46f983ac417301a38fb933.md index 98bea069020..8db3a767294 100644 --- a/curriculum/challenges/japanese/blocks/information-security-projects/5e46f983ac417301a38fb933.md +++ b/curriculum/challenges/japanese/blocks/information-security-projects/5e46f983ac417301a38fb933.md @@ -9,7 +9,7 @@ dashedName: sha-1-password-cracker # --description-- -このプロジェクトではOnaのスターターコードを使って作業します。 +このプロジェクトは私たちのボイラープレートコードを使って進めていきます。 Pythonカリキュラムのインタラクティブな指導部分はまだ開発中です。今のところ、このプロジェクトを完成させるために必要なことをすべて学べるfreeCodeCamp.orgのYouTubeチャンネルの動画をいくつか紹介します: @@ -45,21 +45,21 @@ SHA-1でハッシュ化されたパスワードを受け取り、そのパスワ `hashlib` ライブラリはすでにインポートされています。コード内での使用を検討してください。hashlibについてはこちらをご覧ください。 -## Development +## 開発 `password_cracker.py` にコードを書いてください。開発中は`main.py`を使ってコードをテストできます。 -## Testing +## テスト このプロジェクトのユニットテストは`test_module.py`にあります。利便性のために`test_module.py`から`main.py`にテストをインポートしました。 -## Submitting +## 提出 -プロジェクトのURLをコピーしてfreeCodeCampに提出してください。 +プロジェクトのURLをコピーして freeCodeCamp に提出してください。 # --hints-- -すべてのPythonテストに合格するはずです。 +すべてのPythonテストに合格する必要があります。 ```js diff --git a/curriculum/challenges/japanese/blocks/lab-availability-table/66b36358ed4f261d64840c24.md b/curriculum/challenges/japanese/blocks/lab-availability-table/66b36358ed4f261d64840c24.md index 3c6a263b820..26847a00cec 100644 --- a/curriculum/challenges/japanese/blocks/lab-availability-table/66b36358ed4f261d64840c24.md +++ b/curriculum/challenges/japanese/blocks/lab-availability-table/66b36358ed4f261d64840c24.md @@ -12,18 +12,18 @@ demoType: onClick **ユーザーストーリー:** -1. 少なくとも3列5行(ヘッダーを含む)のテーブルを作成してください。 -1. 最初の行のセルは曜日を含むテーブルヘッダーにしてください。 -1. 最初の列のセルは `class` が `time` のテーブルヘッダーにし、テキストとして時間の値を入れてください。 -1. すべてのデータセルには、その時間帯の利用可能人数を示す `class` として `available-#`(`#` は `0` から `5` の数字)を付けてください。 -1. テーブルには `caption` 要素を追加し、テキストは `Weekly Meeting Availability Schedule` にしてください。 -1. 最初の行(曜日)のすべてのテーブルヘッダーセルには、`scope` 属性に `col` を指定してください。 -1. 最初の列(時間セル)のすべてのテーブルヘッダーセルには、`scope` 属性に `row` を指定してください。 -1. 利用可能人数のクラスが付いたすべてのデータセルには、利用可能レベルを説明する `aria-label` 属性を付けてください(例:`available-0` セルには `0 available`、`available-1` セルには `1 available`、`available-5` セルには `5+ available` など)。 -1. `:root` セレクター内で、`--color#` という名前のCSS変数(`#` は `0` から `5` の数字)を6つ定義し、それぞれに色の値を代入してください。これらの変数を使って対応する `.available-#` 要素の背景色を設定してください。 -1. `:root` セレクター内で、`--solid-border` と `--dashed-border` というCSS変数も定義してください。これらの変数を使ってデータセルの下ボーダーを、行ごとに実線と破線で交互にスタイリングしてください。行には `sharp` または `half` のクラスを付けてスタイルを分けてください。 -1. `id` が `legend` の `div` 要素を作成してください。その中にテキストが `Availability` の `span` 要素と、`id` が `legend-gradient` の `div` 要素を含めてください。 -1. `#legend-gradient` 要素には、`--color0` から `--color5` までのすべての色が硬い境界で切り替わる線形グラデーションを設定してください。 +1. ヘッダーを含めて、少なくとも 3 列 5 行のテーブルが必要です。 +1. 最初の行には、曜日を含むテーブルヘッダーセルが必要です。 +1. 最初の列には、`time` という `class` を持ち、時刻の値をテキストとして含むテーブルヘッダーセルが必要です。 +1. すべてのデータセルには `available-#` という `class` が必要です。`#` は `0` から `5` までの数字で、その時間に空いている人数を表します。 +1. テーブルには、`Weekly Meeting Availability Schedule` というテキストを持つ `caption` 要素が必要です。 +1. 最初の行(曜日)のすべてのテーブルヘッダーセルには、値が `col` の `scope` 属性が必要です。 +1. 最初の列(時刻のセル)のすべてのテーブルヘッダーセルには、値が `row` の `scope` 属性が必要です。 +1. 空き状況のクラスを持つすべてのデータセルには、空き状況のレベルを説明する `aria-label` 属性が必要です (例えば、`available-0` のセルには `0 available`、`available-1` のセルには `1 available` など、`available-5` のセルには `5+ available`)。 +1. `:root` セレクターで、`--color#` という名前の CSS 変数を 6 つ定義し、それぞれに色の値を割り当ててください。`#` は `0` から `5` までの数字です。これらの変数を使って、対応する `.available-#` 要素の背景色を設定してください。 +1. `:root` セレクターで、`--solid-border` と `--dashed-border` という名前の CSS 変数を定義してください。これらの変数を使って、データセルの下の境界線を、行ごとに実線と破線が交互になるようにスタイル設定してください。行には `sharp` または `half` のクラスを付けてスタイル設定します。 +1. `legend` という `id` を持つ `div` 要素が必要です。その中には、`Availability` というテキストを持つ `span` 要素と、`legend-gradient` という `id` を持つ `div` 要素が必要です。 +1. `#legend-gradient` 要素には、`--color0` から `--color5` までのすべての色がはっきりとした境界で切り替わる線形グラデーションを設定してください。 **注意:** CSSを適用するために、HTMLにスタイルシートをリンクしてください。 @@ -389,7 +389,7 @@ headers.forEach(header => { 最初の列のすべてのテーブルヘッダーセルには、`scope` 属性を `row` に設定してください。 ```js -const timeHeaders = [...document.querySelectorAll('tr > th:first-child')]; +const timeHeaders = [...document.querySelectorAll('th.time')]; assert.isNotEmpty(timeHeaders); timeHeaders.forEach(header => { assert.equal(header.getAttribute('scope'), 'row'); diff --git a/curriculum/challenges/japanese/blocks/lab-cargo-manifest-validator/69a56b5069ca99f7317e6e19.md b/curriculum/challenges/japanese/blocks/lab-cargo-manifest-validator/69a56b5069ca99f7317e6e19.md index 0a9200a9360..6a6364e8441 100644 --- a/curriculum/challenges/japanese/blocks/lab-cargo-manifest-validator/69a56b5069ca99f7317e6e19.md +++ b/curriculum/challenges/japanese/blocks/lab-cargo-manifest-validator/69a56b5069ca99f7317e6e19.md @@ -11,11 +11,11 @@ dashedName: lab-cargo-manifest-validator 各カーゴマニフェストは以下のプロパティを持つオブジェクトとして表されます: -- `containerId`: 関連するカーゴコンテナを識別する正の整数。 -- `destination`: 空白をトリムした後の非空文字列で、貨物の目的地を示します。 -- `weight`: 貨物の重量を表す正の数。 -- `unit`: 貨物の重量の単位を表す文字列(キログラムの場合は`"kg"`、ポンドの場合は`"lb"`)。 -- `hazmat`: 危険物の取り扱いが必要かどうかを示すブール値。 +- `containerId`: 関連する貨物コンテナを識別する正の整数です。 +- `destination`: 空白をトリムした後の空でない文字列で、貨物の目的地を表します。 +- `weight`: 貨物の重量を表す正の数です。 +- `unit`: 貨物の `weight` プロパティの単位を表す文字列で、キログラムの場合は `"kg"`、ポンドの場合は `"lb"` です。 +- `hazmat`: 危険物の取り扱いが必要かどうかを示すブール値です。 カーゴマニフェストオブジェクトの例: @@ -33,14 +33,14 @@ dashedName: lab-cargo-manifest-validator **ユーザーストーリー:** -1. `normalizeUnits`というパラメータを持つ`manifest`という名前の関数を実装してください。 - - この関数は元のマニフェストオブジェクトを変更せず、常に`weight`がキログラムに正規化され、`unit`が`"kg"`に設定された新しいオブジェクトを返す必要があります。 - - マニフェストオブジェクトの重量がポンド(`unit: "lb"`)で表されている場合、約換算で1ポンド=0.45キログラムを使って`weight`をキログラムに変換し、`unit`を更新してください。 - - 重量がすでにキログラム(`unit: "kg"`)で表されている場合、`weight`と`unit`は変更しないでください。 -2. `validateManifest`というパラメータを持つ`manifest`という名前の関数を実装してください。 - - この関数は元のマニフェストオブジェクトを変更せず、常に新しいオブジェクトを返す必要があります。 - - 入力されたマニフェストが有効(欠落や無効なプロパティがない)であれば、空のオブジェクトを返してください。 - - 入力されたマニフェストが無効であれば、欠落または無効な各プロパティに対応するエントリーを含むオブジェクトを返してください。欠落したプロパティは`"Missing"`、無効なプロパティは`"Invalid"`の値を持ちます。 +1. `manifest` パラメータを持つ `normalizeUnits` という名前の関数を実装してください。 + - この関数は元の manifest オブジェクトを変更せず、常に `weight` がキログラムに正規化され、`unit` が `"kg"` に設定された新しいオブジェクトを返す必要があります。 + - manifest オブジェクトの `weight` がポンド(`unit: "lb"`)で表されている場合、関数はおよそ `1 lb = 0.45 kg` の換算を使って `weight` をキログラムに変換し、`unit` をそれに応じて更新してください。 + - すでに `weight` がキログラム(`unit: "kg"`)で表されている場合は、`weight` と `unit` は変更しないでください。 +2. `manifest` パラメータを持つ `validateManifest` という名前の関数を実装してください。 + - この関数は元の manifest オブジェクトを変更せず、常に新しいオブジェクトを返す必要があります。 + - 入力された manifest が有効(欠落や無効なプロパティがない)な場合、関数は空のオブジェクトを返してください。 + - 入力された manifest が無効な場合、欠落または無効な各プロパティに対してエントリーを含むオブジェクトを返してください。欠落したプロパティには値として `"Missing"` を、無効なプロパティには値として `"Invalid"` を設定してください。 入力オブジェクトが`destination`プロパティを欠落し、`weight`プロパティが無効な場合の戻り値の例: @@ -51,12 +51,13 @@ dashedName: lab-cargo-manifest-validator } ``` -3. `processManifest`というパラメータを持つ`manifest`という名前の関数を実装してください。この関数は以下をログに出力します: - - マニフェストオブジェクトが有効な場合、`Validation success: ${containerId}`とマニフェストの重量をキログラム単位で`Total weight: ${weight} kg`のようにログに出力します。この変換には`normalizeUnits()`を使ってください。 - - マニフェストオブジェクトが無効な場合、`Validation error: ${containerId}`と`validateManifest()`を呼び出して得られたオブジェクトをログに出力します。 - **注意:** これら2つのケースはそれぞれ2回の`console.log()`呼び出しがあります。 +3. `manifest` パラメータを持つ `processManifest` という名前の関数を実装してください。この関数は以下をログに出力します: + - manifest オブジェクトが有効な場合、`Validation success: ${containerId}` と、`normalizeUnits()` を使って変換したキログラム単位の `weight` を `Total weight: ${weight} kg` の形式でログに出力します。 + - manifest オブジェクトが有効でない場合、`Validation error: ${containerId}` と、`validateManifest()` を呼び出して得られたオブジェクトをログに出力します。 -**注意:** テストで再代入が必要なため、`normalizeUnits`、`validateManifest`、`processManifest` は `const` を使って宣言しないでください。 +**注意:** これらの2つのケースはそれぞれ2回の `console.log()` 呼び出しを含む必要があります。 + +**注意:** テストで再代入が必要なため、`normalizeUnits`、`validateManifest`、`processManifest` を `const` で宣言しないでください。 # --before-each-- @@ -120,7 +121,7 @@ console.log = () => {}; # --hints-- -`normalizeUnits`、`validateManifest`、`processManifest` はテストで再代入が必要なため、`const` を使って宣言しないでください。 +テストで再代入が必要なため、`normalizeUnits`、`validateManifest`、`processManifest` を `const` で宣言しないでください。 ```js assert.doesNotThrow(() => { @@ -140,12 +141,12 @@ assert.equal(params.length, 1); assert.equal(params[0].toString(), 'manifest'); ``` -`normalizeUnits()`を使って`{ containerId: 68, destination: "Salinas", weight: 101, unit: "lb", hazmat: true }`を呼び出すと、元の入力を変更せずに新しいオブジェクト`{ containerId: 68, destination: "Salinas", weight: 45.45, unit: "kg", hazmat: true }`が返されるはずです。 +`normalizeUnits` 関数は、元のオブジェクトを変更せずに、`{ containerId: 68, destination: "Salinas", weight: 45.45, unit: "kg", hazmat: true }` という新しいオブジェクトを返す必要があります。これは `{ containerId: 68, destination: "Salinas", weight: 101, unit: "lb", hazmat: true }` を引数に呼び出した場合です。 ```js const testObj = { containerId: 68, - destination: "Salinas", + destination: "Salinas", weight: 101, unit: "lb", hazmat: true @@ -161,7 +162,7 @@ const expected = { const copy = normalizeUnits(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "normalizeUnits() did not return the expected normalized object"); +assert.deepEqual(copy, expected, "normalizeUnits() did not return the expected normalized object."); assert.notStrictEqual(copy, testObj, "normalizeUnits() should return a new object."); assert.strictEqual(testObj.containerId, 68, "Original object should not be mutated."); assert.strictEqual(testObj.destination, "Salinas", "Original object should not be mutated."); @@ -171,13 +172,13 @@ assert.strictEqual(testObj.hazmat, true, "Original object should not be mutated. assert.equal(Object.keys(testObj).length, 5, "Original object should not be mutated."); ``` -`normalizeUnits`関数は、入力されたマニフェストオブジェクトのコピーを返し、その`weight`をキログラムに正規化し、`unit`を`"kg"`に設定してください。重量変換には約換算の`1 lb = 0.45 kg`を使ってください。 +`normalizeUnits` 関数は、入力された manifest オブジェクトのコピーを返し、その `weight` をキログラムに正規化し、`unit` を `"kg"` に設定してください。`weight` の変換には概算変換 `1 lb = 0.45 kg` を使います。 ```js _validManifests.forEach((obj, i) => { const result = normalizeUnits(obj); - assert.isObject(result, "normalizeUnits should return an object"); - assert.notStrictEqual(result, obj, "normalizeUnits must return a new object, not modify the original"); + assert.isObject(result, "normalizeUnits() should return an object."); + assert.notStrictEqual(result, obj, "normalizeUnits() should return a new object, not mutate the original."); const expectedWeight = obj.unit === "lb" ? obj.weight * 0.45 : obj.weight; const expected = { ...obj, @@ -188,12 +189,12 @@ _validManifests.forEach((obj, i) => { assert.deepEqual( result, expected, - `normalizeUnits did not return the expected normalized object for manifest at index ${i}` + `normalizeUnits() did not return the expected normalized object for manifest at index ${i}.` ); }); ``` -`normalizeUnits`関数は、元のオブジェクトを変更せずに入力された`manifest`オブジェクトの新しいコピーを返す必要があります。 +`normalizeUnits` 関数は、元のオブジェクトを変更せずに、入力された manifest オブジェクトの新しいコピーを返す必要があります。 ```js const original = { @@ -231,12 +232,12 @@ assert.equal(params.length, 1); assert.equal(params[0].toString(), 'manifest'); ``` -`validateManifest()`を使って`{ containerId: 1, destination: "Santa Cruz", weight: 304, unit: "kg", hazmat: false }`を呼び出すと、新しいオブジェクト`{}`が返されます。 +`validateManifest` 関数は、`{ containerId: 1, destination: "Santa Cruz", weight: 304, unit: "kg", hazmat: false }` を引数に呼び出した場合、新しい空のオブジェクト `{}` を返す必要があります。 ```js const testObj = { containerId: 1, - destination: "Santa Cruz", + destination: "Santa Cruz", weight: 304, unit: "kg", hazmat: false @@ -246,16 +247,16 @@ const expected = {}; const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for a valid manifest"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.strictEqual(testObj.containerId, 1, "Original object should not be mutated"); -assert.strictEqual(testObj.destination, "Santa Cruz", "Original object should not be mutated"); -assert.strictEqual(testObj.weight, 304, "Original object should not be mutated"); -assert.strictEqual(testObj.unit, "kg", "Original object should not be mutated"); -assert.strictEqual(testObj.hazmat, false, "Original object should not be mutated"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for a valid manifest."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.strictEqual(testObj.containerId, 1, "Original object should not be mutated."); +assert.strictEqual(testObj.destination, "Santa Cruz", "Original object should not be mutated."); +assert.strictEqual(testObj.weight, 304, "Original object should not be mutated."); +assert.strictEqual(testObj.unit, "kg", "Original object should not be mutated."); +assert.strictEqual(testObj.hazmat, false, "Original object should not be mutated."); ``` -入力されたマニフェストオブジェクトが有効な場合、`validateManifest`関数は空のオブジェクト`{}`を返すはずです。 +`validateManifest` 関数は、入力された manifest オブジェクトが有効な場合、空のオブジェクト `{}` を返す必要があります。 ```js const solution = {}; @@ -268,7 +269,7 @@ for (const obj of _validManifests) { } ``` -`validateManifest()`を使って`{}`を呼び出すと、元の入力を変更せずに新しいオブジェクト`{ containerId: "Missing", destination: "Missing", weight: "Missing", unit: "Missing", hazmat: "Missing" }`が返されます。 +`validateManifest` 関数は、`{}` を引数に呼び出した場合、元のオブジェクトを変更せずに、新しいオブジェクト `{ containerId: "Missing", destination: "Missing", weight: "Missing", unit: "Missing", hazmat: "Missing" }` を返す必要があります。 ```js const testObj = {}; @@ -283,12 +284,12 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for missing properties"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.equal(Object.keys(testObj).length, 0, "validateManifest() should return a new object, not mutate the original"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for missing properties."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.equal(Object.keys(testObj).length, 0, "validateManifest() should return a new object, not mutate the original."); ``` -`validateManifest()`を使って`{ containerId: null, destination: "Santa Cruz", weight: 304, unit: "kg", hazmat: false }`を呼び出すと、元の入力を変更せずに新しいオブジェクト`{ containerId: "Invalid" }`が返されます。 +`validateManifest` 関数は、`{ containerId: null, destination: "Santa Cruz", weight: 304, unit: "kg", hazmat: false }` を引数に呼び出した場合、元のオブジェクトを変更せずに、新しいオブジェクト `{ containerId: "Invalid" }` を返す必要があります。 ```js const testObj = { @@ -305,11 +306,11 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for null containerId"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for null containerId."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); ``` -`validateManifest()`を使って`{ containerId: 0, destination: 405, weight: -84, unit: "pounds", hazmat: "no" }`を呼び出すと、元の入力を変更せずに新しいオブジェクト`{ containerId: "Invalid", destination: "Invalid", weight: "Invalid", unit: "Invalid", hazmat: "Invalid" }`が返されます。 +`validateManifest` 関数は、`{ containerId: 0, destination: 405, weight: -84, unit: "pounds", hazmat: "no" }` を引数に呼び出した場合、元のオブジェクトを変更せずに、新しいオブジェクト `{ containerId: "Invalid", destination: "Invalid", weight: "Invalid", unit: "Invalid", hazmat: "Invalid" }` を返す必要があります。 ```js const testObj = { @@ -330,16 +331,16 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid properties"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.strictEqual(testObj.containerId, 0, "Original object should not be mutated"); -assert.strictEqual(testObj.destination, 405, "Original object should not be mutated"); -assert.strictEqual(testObj.weight, -84, "Original object should not be mutated"); -assert.strictEqual(testObj.unit, "pounds", "Original object should not be mutated"); -assert.strictEqual(testObj.hazmat, "no", "Original object should not be mutated"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid properties."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.strictEqual(testObj.containerId, 0, "Original object should not be mutated."); +assert.strictEqual(testObj.destination, 405, "Original object should not be mutated."); +assert.strictEqual(testObj.weight, -84, "Original object should not be mutated."); +assert.strictEqual(testObj.unit, "pounds", "Original object should not be mutated."); +assert.strictEqual(testObj.hazmat, "no", "Original object should not be mutated."); ``` -`validateManifest()`を使って`{ containerId: -2 }`を呼び出すと、元の入力を変更せずに新しいオブジェクト`{ containerId: "Invalid", destination: "Missing", weight: "Missing", unit: "Missing", hazmat: "Missing" }`が返されます。 +`validateManifest` 関数は、`{ containerId: -2 }` を引数に呼び出した場合、元のオブジェクトを変更せずに、新しいオブジェクト `{ containerId: "Invalid", destination: "Missing", weight: "Missing", unit: "Missing", hazmat: "Missing" }` を返す必要があります。 ```js const testObj = { @@ -356,13 +357,13 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.strictEqual(testObj.containerId, -2, "Original object should not be mutated"); -assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.strictEqual(testObj.containerId, -2, "Original object should not be mutated."); +assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated."); ``` -`validateManifest()`を使って`{ containerId: 3.50 }`を呼び出すと、元の入力を変更せずに新しいオブジェクト`{ containerId: "Invalid", destination: "Missing", weight: "Missing", unit: "Missing", hazmat: "Missing" }`が返されます。整数値の検証には`Number.isInteger()`を使えます。 +`validateManifest` 関数は、`{ containerId: 3.50 }` を引数に呼び出した場合、元のオブジェクトを変更せずに、新しいオブジェクト `{ containerId: "Invalid", destination: "Missing", weight: "Missing", unit: "Missing", hazmat: "Missing" }` を返す必要があります。整数値の検証には `Number.isInteger()` を使えます。 ```js const testObj = { @@ -379,13 +380,13 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.strictEqual(testObj.containerId, 3.50, "Original object should not be mutated"); -assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.strictEqual(testObj.containerId, 3.50, "Original object should not be mutated."); +assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated."); ``` -`validateManifest()`を使って`{ destination: " " }`を呼び出すと、元の入力を変更せずに新しいオブジェクト`{ containerId: "Missing", destination: "Invalid", weight: "Missing", unit: "Missing", hazmat: "Missing" }`が返されます。文字列の空白除去には`String.trim()`を使えます。 +`validateManifest` 関数は、`{ destination: " " }` を引数に呼び出した場合、元のオブジェクトを変更せずに、新しいオブジェクト `{ containerId: "Missing", destination: "Invalid", weight: "Missing", unit: "Missing", hazmat: "Missing" }` を返す必要があります。文字列の空白除去には `.trim()` を使えます。 ```js const testObj = { @@ -402,13 +403,13 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.strictEqual(testObj.destination, " ", "Original object should not be mutated"); -assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.strictEqual(testObj.destination, " ", "Original object should not be mutated."); +assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated."); ``` -`validateManifest()`を使って`{ weight: NaN }`を呼び出すと、元の入力を変更せずに新しいオブジェクト`{ containerId: "Missing", destination: "Missing", weight: "Invalid", unit: "Missing", hazmat: "Missing" }`が返されます。NaN値の検証には`Number.isNaN()`を使えます。 +`validateManifest` 関数は、`{ weight: NaN }` を引数に呼び出した場合、元のオブジェクトを変更せずに、新しいオブジェクト `{ containerId: "Missing", destination: "Missing", weight: "Invalid", unit: "Missing", hazmat: "Missing" }` を返す必要があります。`NaN` の検証には `Number.isNaN()` を使えます。 ```js const testObj = { @@ -425,13 +426,13 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.ok(Number.isNaN(testObj.weight), "Original object should not be mutated"); -assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.ok(Number.isNaN(testObj.weight), "Original object should not be mutated."); +assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated."); ``` -入力されたマニフェストオブジェクトが無効な場合、`validateManifest`関数は欠落および/または無効なプロパティを説明するオブジェクトを返すはずです。 +`validateManifest` 関数は、入力された manifest オブジェクトが有効でない場合、欠落および/または無効なプロパティを説明するオブジェクトを返す必要があります。 ```js const solutions = [ @@ -504,7 +505,7 @@ assert.equal(params.length, 1); assert.equal(params[0].toString(), 'manifest'); ``` -`processManifest()`を使って`{ containerId: 55, destination: "Carmel", weight: 400, unit: "lb", hazmat: false }`を呼び出すと、まず`"Validation success: 55"`がログに出力され、その後`"Total weight: 180 kg"`がログに出力されます。 +`processManifest` 関数は、`{ containerId: 55, destination: "Carmel", weight: 400, unit: "lb", hazmat: false }` を引数に呼び出した場合、最初に `Validation success: 55` をログに出力し、その後に `Total weight: 180 kg` をログに出力する必要があります。 ```js const testObj = { @@ -524,8 +525,8 @@ try { ["Validation success: 55"], ["Total weight: 180 kg"] ]; - assert.deepEqual(spy.calls[0], expectedCalls[0], "First log should be the validation success message"); - assert.deepEqual(spy.calls[1], expectedCalls[1], "Second log should be the normalized weight in kg"); + assert.deepEqual(spy.calls[0], expectedCalls[0], "First log should be the validation success message."); + assert.deepEqual(spy.calls[1], expectedCalls[1], "Second log should be the normalized weight in kg."); } catch (err) { assert.fail(err); @@ -534,7 +535,7 @@ try { } ``` -入力されたマニフェストオブジェクトが有効な場合、`processManifest`関数はまず成功メッセージ`Validation success: ${containerId}`をログに出力します。 +`processManifest` 関数は、入力された manifest オブジェクトが有効な場合、最初に成功メッセージ `Validation success: ${containerId}` をログに出力する必要があります。 ```js const testObj = { @@ -562,7 +563,7 @@ try { } ``` -入力されたマニフェストオブジェクトが有効な場合、`processManifest`関数は`normalizeUnits()`を使ってキログラムに正規化し、その後`Total weight: ${weight} kg`をログに出力します。 +`processManifest` 関数は、有効な入力 manifest オブジェクトを `normalizeUnits()` を使ってキログラムに正規化し、その後 `Total weight: ${weight} kg` をログに出力する必要があります。 ```js const testObj = { @@ -590,7 +591,7 @@ try { } ``` -入力されたマニフェストオブジェクトが有効な場合、`processManifest`関数はオブジェクトの`containerId`を含む成功メッセージをログに出力し、その後オブジェクトの`weight`をキログラム単位でログに出力します。変換には`normalizeUnits()`を使い、2回の`console.log()`呼び出しがあります。 +`processManifest` 関数は、入力された manifest オブジェクトが有効な場合、そのオブジェクトの `containerId` を含む成功メッセージをログに出力し、続けて `normalizeUnits()` を使って変換したキログラム単位の `weight` をログに出力する必要があります。これには2回の `console.log()` 呼び出しが含まれます。 ```js const originalNormalize = normalizeUnits; @@ -605,7 +606,7 @@ try { assert.isTrue( called, - "processManifest should call normalizeUnits() when the manifest is valid" + "processManifest() should call normalizeUnits() when the manifest is valid." ); } catch (err) { @@ -635,7 +636,7 @@ try { } ``` -`processManifest()`を使って`{ containerId: -88, destination: "Soledad", weight: NaN }`を呼び出すと、まず`Validation error: -88`がログに出力され、その後オブジェクト`{ containerId: "Invalid", weight: "Invalid", unit: "Missing", hazmat: "Missing" }`がログに出力されます。 +`processManifest` 関数は、`{ containerId: -88, destination: "Soledad", weight: NaN }` を引数に呼び出した場合、最初に `Validation error: -88` をログに出力し、その後 `{ containerId: "Invalid", weight: "Invalid", unit: "Missing", hazmat: "Missing" }` というオブジェクトをログに出力する必要があります。 ```js const testObj = { @@ -658,8 +659,8 @@ try { }] ]; - assert.deepEqual(spy.calls[0], expectedCalls[0], "First log should be the validation error message"); - assert.deepEqual(spy.calls[1], expectedCalls[1], "Second log should be the validation result object"); + assert.deepEqual(spy.calls[0], expectedCalls[0], "First log should be the validation error message."); + assert.deepEqual(spy.calls[1], expectedCalls[1], "Second log should be the validation result object."); } catch (err) { assert.fail(err); @@ -668,7 +669,7 @@ try { } ``` -`processManifest()`を使って`{ destination: "Watsonville", hazmat: true }`を呼び出すと、まず`Validation error: undefined`がログに出力され、その後オブジェクト`{ containerId: "Missing", weight: "Missing", unit: "Missing" }`がログに出力されます。 +`processManifest` 関数は、`{ destination: "Watsonville", hazmat: true }` を引数に呼び出した場合、最初に `Validation error: undefined` をログに出力し、その後 `{ containerId: "Missing", weight: "Missing", unit: "Missing" }` というオブジェクトをログに出力する必要があります。 ```js const testObj = { @@ -689,8 +690,8 @@ try { }] ]; - assert.deepEqual(spy.calls[0], expectedCalls[0], "First log should be the validation error message"); - assert.deepEqual(spy.calls[1], expectedCalls[1], "Second log should be the validation result object"); + assert.deepEqual(spy.calls[0], expectedCalls[0], "First log should be the validation error message."); + assert.deepEqual(spy.calls[1], expectedCalls[1], "Second log should be the validation result object."); } catch (err) { assert.fail(err); @@ -699,7 +700,7 @@ try { } ``` -入力されたマニフェストオブジェクトが無効な場合、`processManifest`関数はまずエラーメッセージ`Validation error: ${containerId}`をログに出力します。 +`processManifest` 関数は、入力された manifest オブジェクトが有効でない場合、最初にエラーメッセージ `Validation error: ${containerId}` をログに出力する必要があります。 ```js const spy = __helpers.spyOn(console, "log"); @@ -718,13 +719,13 @@ try { assert.deepEqual(spy.calls[0], expectedCalls[0]); } catch (err) { - assert.fail(err); + assert.fail(err); } finally { spy.restore(); } ``` -入力されたマニフェストオブジェクトが無効な場合、`processManifest`関数は元のマニフェストオブジェクトを使って`validateManifest()`を呼び出して得られたオブジェクトもログに出力します。戻り値のオブジェクトには直接`console.log()`を呼び出してください。 +`processManifest` 関数は、入力された manifest オブジェクトが有効でない場合、元の manifest オブジェクトを引数に `validateManifest()` を呼び出して得られたオブジェクトもログに出力する必要があります。返されたオブジェクトは直接 `console.log()` に渡してください。 ```js const originalValidate = validateManifest; @@ -740,7 +741,7 @@ try { assert.isTrue( called, - "processManifest should call validateManifest() when the manifest is invalid" + "processManifest() should call validateManifest() when the manifest is invalid." ); } catch (err) { @@ -765,13 +766,13 @@ try { assert.deepEqual(spy.calls[1], expectedCalls[1]); } catch (err) { - assert.fail(err); + assert.fail(err); } finally { spy.restore(); } ``` -入力されたマニフェストオブジェクトが無効な場合、`processManifest`関数はオブジェクトの`containerId`を含むエラーメッセージをログに出力し、その後入力オブジェクトを使って`validateManifest()`を呼び出して得られたオブジェクトをログに出力します。これには2回の`console.log()`呼び出しがあります。 +`processManifest` 関数は、入力された manifest オブジェクトが有効でない場合、そのオブジェクトの `containerId` を含むエラーメッセージをログに出力し、続けて入力オブジェクトを引数に `validateManifest()` を呼び出して得られたオブジェクトをログに出力する必要があります。これには2回の `console.log()` 呼び出しが含まれます。 ```js const originalValidate = validateManifest; @@ -787,7 +788,7 @@ try { assert.isTrue( called, - "processManifest should call validateManifest() when the manifest is invalid" + "processManifest() should call validateManifest() when the manifest is invalid." ); } catch (err) { @@ -812,7 +813,7 @@ try { assert.deepEqual(spy.calls, expectedCalls); } catch (err) { - assert.fail(err); + assert.fail(err); } finally { spy.restore(); } diff --git a/curriculum/challenges/japanese/blocks/lab-debug-pet-adoption-page/685239f0cad43c7a909cbd98.md b/curriculum/challenges/japanese/blocks/lab-debug-pet-adoption-page/685239f0cad43c7a909cbd98.md index 4ad099cabd9..c4527e44c4f 100644 --- a/curriculum/challenges/japanese/blocks/lab-debug-pet-adoption-page/685239f0cad43c7a909cbd98.md +++ b/curriculum/challenges/japanese/blocks/lab-debug-pet-adoption-page/685239f0cad43c7a909cbd98.md @@ -25,14 +25,14 @@ dashedName: lab-debug-pet-adoption-page # --hints-- -`img` 要素は `src` 属性ではなく `href` 属性を持つべきです。 +`img` 要素は `href` 属性ではなく `src` 属性を持つべきです。 ```js const imgEl = document.querySelector("img"); assert.isTrue(imgEl.hasAttribute("src")); ``` -`img` 要素は存在しない `alt` 属性ではなく `att` 属性を持つべきです。 +`img` 要素は存在しない `att` 属性ではなく `alt` 属性を持つべきです。 ```js const imgEl = document.querySelector("img"); @@ -45,7 +45,7 @@ assert.isTrue(imgEl.hasAttribute("alt")); assert.notMatch(code, /<\/img>/); ``` -テキストが `a` の `Visit cats page` 要素は `href` 属性ではなく `src` 属性を持つべきです。 +テキストが `Visit cats page` の `a` 要素は `src` 属性ではなく `href` 属性を持つ必要があります。 ```js const anchors = document.querySelectorAll("a"); @@ -54,7 +54,7 @@ assert.isDefined(catLink); assert.isTrue(catLink.hasAttribute("href")); ``` -テキストが `a` の `Visit dogs page` 要素は `href` 属性ではなく `src` 属性を持つべきです。 +テキストが `Visit dogs page` の `a` 要素は `src` 属性ではなく `href` 属性を持つ必要があります。 ```js const anchors = document.querySelectorAll("a"); diff --git a/curriculum/challenges/japanese/blocks/lab-digital-pet-game/68c362b379059c388d3874f2.md b/curriculum/challenges/japanese/blocks/lab-digital-pet-game/68c362b379059c388d3874f2.md index f6cf9952a32..7ae9aa22b7d 100644 --- a/curriculum/challenges/japanese/blocks/lab-digital-pet-game/68c362b379059c388d3874f2.md +++ b/curriculum/challenges/japanese/blocks/lab-digital-pet-game/68c362b379059c388d3874f2.md @@ -9,9 +9,9 @@ saveSubmissionToDB: true # --description-- -**目的:** 以下のユーザーストーリーを満たし、すべてのテストを通過してラボを完了してください。 +**目的:** 以下のユーザーストーリーを満たし、すべてのテストに合格してラボを完了してください。 -**ユーザーストーリー:** +**ユーザーストーリー:** アプリケーションは2つのビューを持つ必要があります。各ビューの要件は残りのユーザーストーリーに含まれています。 @@ -60,6 +60,7 @@ saveSubmissionToDB: true ```js globalThis._PET_NAME = 'Fitzgerald'; globalThis._clock = __FakeTimers.install(); +window.fetch = () => Promise.resolve({ json: () => Promise.resolve('Cats sleep for around 13 to 16 hours a day.') }); ``` # --after-all-- diff --git a/curriculum/challenges/japanese/blocks/lab-fcc-forum-leaderboard/673c91f0b934834bc4a3ecc2.md b/curriculum/challenges/japanese/blocks/lab-fcc-forum-leaderboard/673c91f0b934834bc4a3ecc2.md index 48f47583cb4..5f490937b04 100644 --- a/curriculum/challenges/japanese/blocks/lab-fcc-forum-leaderboard/673c91f0b934834bc4a3ecc2.md +++ b/curriculum/challenges/japanese/blocks/lab-fcc-forum-leaderboard/673c91f0b934834bc4a3ecc2.md @@ -1,6 +1,6 @@ --- id: 673c91f0b934834bc4a3ecc2 -title: fCCフォーラムリーダーボードを作成する +title: FCCフォーラムリーダーボードを作成する challengeType: 25 dashedName: build-an-fcc-forum-leaderboard demoType: onClick @@ -93,6 +93,68 @@ APIエンドポイントは以下の形のJSONを返します: 1. `fetchData` 関数は`forumLatest`からデータをリクエストし、レスポンスをJSONとして解析したものを`showLatestPosts`に渡して呼び出します。 1. データ取得時にエラーが発生した場合、`fetchData` 関数はエラーをコンソールに記録します。これには特に`console.log`を使用してください。 +# --before-all-- + +```js +const _testUsers = [ + { + avatar_template: '/user_avatar/QuincyLarson_{size}.png', + id: 6, + name: 'Quincy Larson', + username: 'QuincyLarson' + }, + { + avatar_template: '/user_avatar/jwilkins.oboe_{size}.png', + id: 285941, + name: 'Jessica Wilkins', + username: 'jwilkins.oboe' + }, + { + avatar_template: '/user_avatar/ilenia_{size}.png', + id: 170865, + name: 'Ilenia', + username: 'ilenia' + } +]; + +const _testPosters = [ + { user_id: 6 }, + { user_id: 285941 }, + { user_id: 170865 } +]; + +const _testData = { + users: _testUsers, + topic_list: { + topics: [ + { + bumped_at: '2024-04-15T16:01:26.403Z', + category_id: 1, + id: 684569, + posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], + posts_count: 8, + slug: 'the-freecodecamp-podcast-is-back-now-with-video', + title: 'The freeCodeCamp Podcast is back – now with video', + views: 542 + }, + { + bumped_at: '2024-04-19T13:52:03.523Z', + category_id: 421, + id: 686149, + posters: [{ user_id: 170865 }], + posts_count: 1, + slug: 'problem-with-making-changes-to-styles-js', + title: 'Problem with making changes to styles. (JS)', + views: 9 + } + ] + } +}; + +window.fetch = () => + Promise.resolve({ json: () => Promise.resolve(_testData) }); +``` + # --hints-- 単一の引数を取る`timeAgo`という名前の関数を作成してください。 @@ -297,31 +359,8 @@ assert.lengthOf(avatars, 2); `avatars` 関数は、ユーザー配列内の投稿者ごとに1つずつ`img`要素を結合した文字列を返すべきです。 ```js -const posters = [{ user_id: 6 }, { user_id: 285941 }, { user_id: 170865 }]; -const users = [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - }, - { id: 20 } -]; +const posters = _testPosters; +const users = [..._testUsers, { id: 20 }]; const actual = avatars(posters, users); const matches = actual.match(/<\s*img\s+.+?>/g); assert.lengthOf(matches, 3); @@ -330,31 +369,8 @@ assert.lengthOf(matches, 3); `avatars` 関数が返す文字列内の各`img`要素は、投稿者の`alt`プロパティの値を持つ`name`テキストを持つべきです。 ```js -const posters = [{ user_id: 6 }, { user_id: 285941 }, { user_id: 170865 }]; -const users = [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - }, - { id: 20 } -]; +const posters = _testPosters; +const users = [..._testUsers, { id: 20 }]; const actual = avatars(posters, users); const matches = actual.match(/<\s*img\s+.+?>/g); @@ -366,31 +382,8 @@ assert.match(matches[2], /alt=('|")Ilenia\1/); `avatars` 関数は、`avatar_template`プロパティにアクセスし、`{size}`を`30`に置き換えて各アバターのサイズを設定します。 ```js -const posters = [{ user_id: 6 }, { user_id: 285941 }, { user_id: 170865 }]; -const users = [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - }, - { id: 20 } -]; +const posters = _testPosters; +const users = [..._testUsers, { id: 20 }]; const actual = avatars(posters, users); assert.notMatch(actual, /\{size\}/); assert.lengthOf(actual.match(/_30/g), 3); @@ -399,31 +392,8 @@ assert.lengthOf(actual.match(/_30/g), 3); 各`img`要素は、マッチしたユーザーの`src`を設定した`avatar_template`属性を持つべきです。`avatar_template`が`/`で始まる場合は、`avatarUrl`を直接先頭に付けてください。 ```js -const posters = [{ user_id: 6 }, { user_id: 285941 }, { user_id: 170865 }]; -const users = [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - }, - { id: 20 } -]; +const posters = _testPosters; +const users = [..._testUsers, { id: 20 }]; const actual = avatars(posters, users); const matches = actual.match(/<\s*img\s+.+?>/g); @@ -458,19 +428,15 @@ assert.isFunction(fetchData); `fetchData` 関数は`https://cdn.freecodecamp.org/curriculum/forum-latest/latest.json`からデータをリクエストするべきです。 ```js -const testArr = []; -const temp = fetch; +const spy = __helpers.spyOn(window, 'fetch'); try { - fetch = source => { - testArr.push(source); - return temp(source); - }; fetchData(); - assert.deepEqual(testArr, [ + assert.include( + spy.calls.map(call => call[0]), 'https://cdn.freecodecamp.org/curriculum/forum-latest/latest.json' - ]); + ); } finally { - fetch = temp; + spy.restore(); } ``` @@ -521,55 +487,7 @@ async () => { `showLatestPosts` は、`#posts-container`の各アイテムに対して1つずつ`tr`要素を結合した文字列を`topics`のinner HTMLに設定します。 ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const pContainer = document.getElementById('posts-container'); pContainer.innerHTML = ''; showLatestPosts(data); @@ -579,55 +497,7 @@ assert.lengthOf(pContainer.querySelectorAll('tr'), 2); `tr` が返す文字列の各`showLatestPosts`要素は5つの`td`要素を含みます。 ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const pContainer = document.getElementById('posts-container'); pContainer.innerHTML = ''; showLatestPosts(data); @@ -638,55 +508,7 @@ assert.lengthOf(pContainer.querySelectorAll('tr:last-child>td'), 5); `td` が返す文字列の各テーブル行の最初の`showLatestPosts`要素は、2つのアンカー要素を含みます。1つ目は`post-title`クラス、`href`の`/`、``のアンカーテキストを持ち、2つ目は`forumCategory`を`category_id`で呼び出して得られたものです。 ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const pContainer = document.getElementById('posts-container'); pContainer.innerHTML = ''; showLatestPosts(data); @@ -731,55 +553,7 @@ assert.equal( `td` が返す文字列の各テーブル行の2番目の`showLatestPosts`要素は、`avatars`関数を`posters`と`users`の引数で呼び出して返された画像を、`avatar-container`クラスの`div`要素内にネストして含みます。 ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const pContainer = document.getElementById('posts-container'); pContainer.innerHTML = ''; showLatestPosts(data); @@ -820,55 +594,7 @@ assert.equal(imgs2[0].alt, 'Ilenia'); `td` が返す文字列の各テーブル行の3番目の`showLatestPosts`要素は投稿への返信数を含みます。_ヒント:_ `posts_count - 1`を使用してください。 ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const pContainer = document.getElementById('posts-container'); pContainer.innerHTML = ''; showLatestPosts(data); @@ -887,55 +613,7 @@ assert.equal( `td` が返す文字列の各テーブル行の4番目の`showLatestPosts`要素は投稿の閲覧数を含みます。 ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const pContainer = document.getElementById('posts-container'); pContainer.innerHTML = ''; showLatestPosts(data); @@ -954,55 +632,7 @@ assert.equal( `td` が返す文字列の各テーブル行の5番目の`showLatestPosts`要素は、`timeAgo`関数を使って生成された最後のアクティビティから経過した時間を含みます。 ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const calcTime = time => { const currentTime = new Date(); const lastPost = new Date(time); diff --git a/curriculum/challenges/japanese/blocks/lab-javascript-trivia-bot/66ed41f912d0bb1dc62da5dd.md b/curriculum/challenges/japanese/blocks/lab-javascript-trivia-bot/66ed41f912d0bb1dc62da5dd.md index 3997132701a..febebc2659e 100644 --- a/curriculum/challenges/japanese/blocks/lab-javascript-trivia-bot/66ed41f912d0bb1dc62da5dd.md +++ b/curriculum/challenges/japanese/blocks/lab-javascript-trivia-bot/66ed41f912d0bb1dc62da5dd.md @@ -11,17 +11,17 @@ dashedName: lab-javascript-trivia-bot **ユーザーストーリー:** -1. ユーザーへの挨拶メッセージとして`"Hello! I'm your coding fun fact guide!"`をコンソールにログ出力してください。 -1. ボットの名前、出身地、お気に入りのコーディング言語をそれぞれストアする`botName`、`botLocation`、`favoriteLanguage`の3つの変数を作成してください。 -1. `"My name is (botName) and I live on (botLocation)."`をコンソールにログ出力してください。 -1. `"My favorite programming language is (favoriteLanguage)."`をコンソールにログ出力してください。 -1. `let`を使って`codingFact`という変数を作成し、ボットのお気に入りのコーディング言語に関する面白い事実を文字列で代入し、`favoriteLanguage`変数を含めてください。 -1. `codingFact`をコンソールにログ出力してください。 -1. `codingFact`変数にボットのお気に入り言語に関する新しい事実を`favoriteLanguage`変数を使って再代入してください。 -1. `codingFact`を再度コンソールにログ出力してください。 -1. `codingFact`変数にもう一度、`favoriteLanguage`変数を使ってボットのお気に入り言語に関する別の新しい事実を再代入してください。 -1. `codingFact`を3回目のコンソールログとして出力してください。 -1. ボットからの別れの言葉として`"It was fun sharing these facts with you. Goodbye! - (botName) from (botLocation)."`をコンソールにログ出力してください。 +1. ユーザーへの挨拶メッセージとして、`"Hello! I'm your coding fun fact guide!"` をコンソールにログしてください。 +1. ボットの名前、出身地、およびお気に入りのプログラミング言語をそれぞれ保存する `botName`、`botLocation`、`favoriteLanguage` の3つの変数を作成してください。 +1. `"My name is (botName) and I live on (botLocation)."` をコンソールにログしてください。 +1. `"My favorite programming language is (favoriteLanguage)."` をコンソールにログしてください。 +1. `let` を使って `codingFact` という変数を作成し、`favoriteLanguage` 変数を使ってボットのお気に入りプログラミング言語に関する面白い事実を文字列で代入してください。 +1. `codingFact` をコンソールにログしてください。 +1. `codingFact` 変数に、再び `favoriteLanguage` 変数を使ってボットのお気に入りプログラミング言語に関する新しい事実を代入してください。 +1. `codingFact` をもう一度コンソールにログしてください。 +1. `codingFact` 変数に、3回目として再び `favoriteLanguage` 変数を使ってボットのお気に入りプログラミング言語に関する3つ目の事実を代入してください。 +1. `codingFact` を3回目としてコンソールにログしてください。 +1. ボットからの別れの言葉として、`"It was fun sharing these facts with you. Goodbye! - (botName) from (botLocation)."` をコンソールにログしてください。 # --before-each-- @@ -162,7 +162,7 @@ let codingFact = "Did you know that " + favoriteLanguage + " was created in just console.log(codingFact); -codingFact = "Another fun fact: " + favoriteLanguage + "was originally called Mocha!"; +codingFact = "Another fun fact: " + favoriteLanguage + " was originally called Mocha!"; console.log(codingFact); diff --git a/curriculum/challenges/japanese/blocks/lab-mood-board/673b3d6b7ef7318eef926d5a.md b/curriculum/challenges/japanese/blocks/lab-mood-board/673b3d6b7ef7318eef926d5a.md index 54e1b832c3b..79f2a137a67 100644 --- a/curriculum/challenges/japanese/blocks/lab-mood-board/673b3d6b7ef7318eef926d5a.md +++ b/curriculum/challenges/japanese/blocks/lab-mood-board/673b3d6b7ef7318eef926d5a.md @@ -16,16 +16,16 @@ demoType: onClick **ユーザーストーリー:** -1. 3つのプロップス、`MoodBoardItem`、`color`、`image`を受け取る`description`コンポーネントを作成してエクスポートしてください。 -2. `MoodBoardItem`コンポーネントは、トップレベル要素としてクラス`div`を持つ`mood-board-item`を返す必要があります。 -3. `.mood-board-item`要素の背景色を、インラインスタイルを使って`color`プロップの値に設定してください。 -4. `img`要素内に、クラス`mood-board-image`を持ち、`src`属性が`image`プロップの値に設定された`.mood-board-item`要素をレンダリングしてください。 -5. `h3`要素内に、クラス`mood-board-text`を持ち、テキストが`description`プロップの値である`.mood-board-item`要素をレンダリングしてください。 -6. `MoodBoard`を作成してエクスポートしてください。 -7. `MoodBoard`コンポーネントは、トップレベル要素として`div`を返す必要があります。 -8. `MoodBoard`コンポーネントは、クラス`h1`を持ち、テキストが`mood-board-heading`である`Destination Mood Board`要素をレンダリングしてください。 -9. `MoodBoard`コンポーネントは、クラス`div`を持つ`mood-board`をレンダリングしてください。 -10. `MoodBoard`コンポーネントは、`MoodBoardItem`要素内に少なくとも3つの`.mood-board`コンポーネントをレンダリングし、それぞれに有効な値の`color`、`image`、`description`プロップスを渡してください。 +1. `color`、`image`、`description` の3つのプロップを受け取る `MoodBoardItem` コンポーネントを作成してエクスポートしてください。 +2. `MoodBoardItem` コンポーネントは、トップレベルの要素としてクラス名が `mood-board-item` の `div` を返す必要があります。 +3. `.mood-board-item` 要素の背景色は、インラインスタイルを使って `color` プロップの値に設定してください。 +4. `.mood-board-item` 要素内に、クラス名が `mood-board-image` で `src` 属性が `image` プロップの値に設定された `img` 要素をレンダリングしてください。 +5. `.mood-board-item` 要素内に、クラス名が `mood-board-text` でテキストが `description` プロップの値に設定された `h3` 要素をレンダリングしてください。 +6. `MoodBoard` コンポーネントを作成してエクスポートしてください。 +7. `MoodBoard` コンポーネントは、トップレベルの要素として `div` を返す必要があります。 +8. `MoodBoard` コンポーネントは、クラス名が `mood-board-heading` でテキストが `Destination Mood Board` の `h1` 要素をレンダリングしてください。 +9. `MoodBoard` コンポーネントは、クラス名が `mood-board` の `div` をレンダリングしてください。 +10. `MoodBoard` コンポーネントは、`.mood-board` 要素内に少なくとも3つの `MoodBoardItem` コンポーネントをレンダリングし、それぞれに有効な値の `color`、`image`、`description` プロップを渡してください。 ムードボードで以下の画像を使うことができます: @@ -41,10 +41,10 @@ demoType: onClick `MoodBoardItem`コンポーネントをエクスポートしてください。 ```js -assert.isFunction(window.index.MoodBoardItem, 1); +assert.isFunction(window.index.MoodBoardItem); ``` -`MoodBoardItem`コンポーネントは、トップレベル要素としてクラス`div`を持つ`mood-board-item`を返す必要があります。 +あなたの `MoodBoardItem` コンポーネントは、トップレベルの要素として `mood-board-item` クラスの `div` を返す必要があります。 ```js const item = document.getElementsByClassName('mood-board-item')[0]; @@ -52,7 +52,7 @@ assert.exists(item); assert.equal(item.tagName, 'DIV'); ``` -`.mood-board-item`要素の背景色は、インラインスタイルを使って`color`プロップの値に設定してください。 +`.mood-board-item` 要素の背景色は、インラインスタイルを使って `color` プロップの値に設定してください。 ```js const container = await __helpers.prepTestComponent(window.index.MoodBoardItem, { color: "red" }); @@ -83,7 +83,7 @@ assert.equal(item.tagName, 'DIV'); `MoodBoard`コンポーネントをエクスポートしてください。 ```js -assert.isFunction(window.index.MoodBoard, 1); +assert.isFunction(window.index.MoodBoard); ``` `MoodBoard`コンポーネントは、トップレベル要素として`div`を返す必要があります。 @@ -102,7 +102,15 @@ assert.equal(heading.tagName, 'H1'); assert.equal(heading.textContent, 'Destination Mood Board'); ``` -`MoodBoard`コンポーネントは、少なくとも3つの`MoodBoardItem`コンポーネントをレンダリングし、それぞれに有効な値の`color`、`image`、`description`プロップスを渡してください。 +あなたの `MoodBoard` コンポーネントは、`mood-board` クラスの `div` をレンダリングする必要があります。 + +```js +const moodboard = document.getElementsByClassName('mood-board')[0]; +assert.exists(moodboard); +assert.equal(moodboard.tagName, 'DIV'); +``` + +あなたの `MoodBoard` コンポーネントは、`.mood-board` 要素内に少なくとも3つの `MoodBoardItem` コンポーネントをレンダリングし、それぞれに有効な値の `color`、`image`、`description` プロップスを渡す必要があります。 ```js const moodboard = document.getElementsByClassName('mood-board')[0]; diff --git a/curriculum/challenges/japanese/blocks/lab-motorcycle-shop/694175528a794a090ea0ba74.md b/curriculum/challenges/japanese/blocks/lab-motorcycle-shop/694175528a794a090ea0ba74.md index 1f8f183eb3c..b0f965bfef1 100644 --- a/curriculum/challenges/japanese/blocks/lab-motorcycle-shop/694175528a794a090ea0ba74.md +++ b/curriculum/challenges/japanese/blocks/lab-motorcycle-shop/694175528a794a090ea0ba74.md @@ -1,6 +1,6 @@ --- id: 694175528a794a090ea0ba74 -title: Build a Motorcycle Shop +title: バイクショップを作る challengeType: 25 dashedName: lab-motorcycle-shop demoType: onClick @@ -35,6 +35,291 @@ demoType: onClick 7. 表示される`Motorcycle`要素の数は、idが`results-number`の要素内に表示される必要があります。 8. フィルターは`input`イベントで更新される必要があります。 +# --before-all-- + +```js +const _testMotorcycles = [ + { + id: '1', + name: 'Ninja H2', + manufacturer: 'Kawasaki', + category: 'Sport', + price: 29000, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-vmoto-stash.jpg', + description: 'Supercharged hypersport with unmatched power', + year: 2024, + created_at: '2024-01-01T00:00:00Z' + }, + { + id: '2', + name: 'Street Triple RS', + manufacturer: 'Triumph', + category: 'Naked', + price: 13500, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-r3.png', + description: 'Agile naked bike with triple-cylinder perfection', + year: 2024, + created_at: '2024-01-02T00:00:00Z' + }, + { + id: '3', + name: 'R1250 GS Adventure', + manufacturer: 'BMW', + category: 'Adventure', + price: 21995, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-vmoto-stash.jpg', + description: 'The ultimate adventure touring machine', + year: 2024, + created_at: '2024-01-03T00:00:00Z' + }, + { + id: '4', + name: 'Panigale V4', + manufacturer: 'Ducati', + category: 'Sport', + price: 28395, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-kawasaki-zx10r.png', + description: 'Italian superbike engineering at its finest', + year: 2024, + created_at: '2024-01-04T00:00:00Z' + }, + { + id: '5', + name: 'Road Glide Special', + manufacturer: 'Harley-Davidson', + category: 'Cruiser', + price: 29999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-vmax.jpg', + description: 'Classic American touring with modern tech', + year: 2024, + created_at: '2024-01-05T00:00:00Z' + }, + { + id: '6', + name: 'MT-09', + manufacturer: 'Yamaha', + category: 'Naked', + price: 9999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-mt7.jpg', + description: 'Lightweight naked bike with crossplane power', + year: 2024, + created_at: '2024-01-06T00:00:00Z' + }, + { + id: '7', + name: 'Africa Twin', + manufacturer: 'Honda', + category: 'Adventure', + price: 14599, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-honda-africa.jpg', + description: 'Legendary adventure bike reborn for modern times', + year: 2024, + created_at: '2024-01-07T00:00:00Z' + }, + { + id: '8', + name: 'Super Duke R', + manufacturer: 'KTM', + category: 'Naked', + price: 18999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-suzuki-sv650.jpg', + description: 'The Beast returns with 180hp of raw power', + year: 2024, + created_at: '2024-01-08T00:00:00Z' + }, + { + id: '9', + name: 'GSX-R1000R', + manufacturer: 'Suzuki', + category: 'Sport', + price: 17199, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-suzuki-gsxr1000.jpg', + description: 'Track-ready sportbike with championship DNA', + year: 2024, + created_at: '2024-01-09T00:00:00Z' + }, + { + id: '10', + name: 'Street Glide', + manufacturer: 'Harley-Davidson', + category: 'Cruiser', + price: 21999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-vmax.jpg', + description: 'Milwaukee-Eight power in a sleek bagger', + year: 2024, + created_at: '2024-01-10T00:00:00Z' + }, + { + id: '11', + name: 'Z H2', + manufacturer: 'Kawasaki', + category: 'Naked', + price: 17000, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-kawasaki-zh2.jpg', + description: 'Supercharged naked bike mayhem', + year: 2024, + created_at: '2024-01-11T00:00:00Z' + }, + { + id: '12', + name: 'Multistrada V4', + manufacturer: 'Ducati', + category: 'Adventure', + price: 22995, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-mt3.jpg', + description: 'Italian style meets adventure capability', + year: 2024, + created_at: '2024-01-12T00:00:00Z' + }, + { + id: '13', + name: 'Speed Triple 1200', + manufacturer: 'Triumph', + category: 'Naked', + price: 16500, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-honda-transalp.jpg', + description: 'British muscle bike with cutting-edge tech', + year: 2024, + created_at: '2024-01-13T00:00:00Z' + }, + { + id: '14', + name: 'S1000RR', + manufacturer: 'BMW', + category: 'Sport', + price: 17295, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-kawasaki-z900a1.jpg', + description: 'German precision in a superbike package', + year: 2024, + created_at: '2024-01-14T00:00:00Z' + }, + { + id: '15', + name: 'MT-07', + manufacturer: 'Yamaha', + category: 'Naked', + price: 7999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-mt7.jpg', + description: 'Best-selling parallel twin for pure fun', + year: 2024, + created_at: '2024-01-15T00:00:00Z' + }, + { + id: '16', + name: 'V-Strom 1050', + manufacturer: 'Suzuki', + category: 'Adventure', + price: 13799, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-benelli-trk702.png', + description: 'Reliable adventure touring on a budget', + year: 2024, + created_at: '2024-01-16T00:00:00Z' + }, + { + id: '17', + name: 'Sportster S', + manufacturer: 'Harley-Davidson', + category: 'Cruiser', + price: 15999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-r3.png', + description: 'Revolution Max engine in a modern cruiser', + year: 2024, + created_at: '2024-01-17T00:00:00Z' + }, + { + id: '18', + name: 'CBR1000RR-R', + manufacturer: 'Honda', + category: 'Sport', + price: 28500, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-honda-cbr500.png', + description: 'Honda racing technology for the street', + year: 2024, + created_at: '2024-01-18T00:00:00Z' + }, + { + id: '19', + name: 'Tiger 900', + manufacturer: 'Triumph', + category: 'Adventure', + price: 14400, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-triumph-tiger900.png', + description: 'Middleweight adventure excellence', + year: 2024, + created_at: '2024-01-19T00:00:00Z' + }, + { + id: '20', + name: '890 Duke R', + manufacturer: 'KTM', + category: 'Naked', + price: 11999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-kawasaki-zx10r.png', + description: 'The Scalpel - precise handling perfection', + year: 2024, + created_at: '2024-01-20T00:00:00Z' + }, + { + id: '21', + name: 'Ninja 400', + manufacturer: 'Kawasaki', + category: 'Sport', + price: 5299, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-vmoto-stash.jpg', + description: 'Perfect entry-level sportbike', + year: 2024, + created_at: '2024-01-21T00:00:00Z' + }, + { + id: '22', + name: 'Scrambler 1200', + manufacturer: 'Triumph', + category: 'Adventure', + price: 13250, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-ducati-scrambler.jpg', + description: 'Modern classic with off-road capability', + year: 2024, + created_at: '2024-01-22T00:00:00Z' + }, + { + id: '23', + name: 'Monster Plus', + manufacturer: 'Ducati', + category: 'Naked', + price: 14295, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-kawasaki-zx10r.png', + description: 'Evolved Monster with V-twin soul', + year: 2024, + created_at: '2024-01-23T00:00:00Z' + }, + { + id: '24', + name: 'CB650R', + manufacturer: 'Honda', + category: 'Naked', + price: 9199, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-kawasaki-z900.png', + description: 'Neo Sports Café styling with inline-four power', + year: 2024, + created_at: '2024-01-24T00:00:00Z' + }, + { + id: '25', + name: 'Low Rider S', + manufacturer: 'Harley-Davidson', + category: 'Cruiser', + price: 17999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-suzuki-vstorm650.jpg', + description: 'Blacked-out cruiser with attitude', + year: 2024, + created_at: '2024-01-25T00:00:00Z' + } +]; + +window.fetch = () => + Promise.resolve({ json: () => Promise.resolve(_testMotorcycles) }); +``` + # --hints-- `Category`という名前の`type`を用意してください。 @@ -84,16 +369,24 @@ assert.isFunction(fetchMotorcycles); ```js const spy = __helpers.spyOn(window, 'fetch'); -const motorcycles = await fetchMotorcycles(); -assert.strictEqual(spy.calls[0][0].trim(),"https://cdn.freecodecamp.org/curriculum/labs/data/motorcycles.json"); +try { + await fetchMotorcycles(); + assert.strictEqual(spy.calls[0][0].trim(),"https://cdn.freecodecamp.org/curriculum/labs/data/motorcycles.json"); +} finally { + spy.restore(); +} ``` `fetchMotorcycles`から25個の`Motorcycle`オブジェクトのPromiseを返してください。 ```js const spy = __helpers.spyOn(window, 'fetch'); -const motorcycles = await fetchMotorcycles(); -assert.lengthOf(motorcycles,25); +try { + const motorcycles = await fetchMotorcycles(); + assert.lengthOf(motorcycles,25); +} finally { + spy.restore(); +} ``` `renderMotorcycleCard`という名前の関数を用意してください。 diff --git a/curriculum/challenges/japanese/blocks/lab-nth-fibonacci-number-js/7a97b79c096ecb000d03bd36.md b/curriculum/challenges/japanese/blocks/lab-nth-fibonacci-number-js/7a97b79c096ecb000d03bd36.md index 3ec3f58b4bc..d9a9e41aeba 100644 --- a/curriculum/challenges/japanese/blocks/lab-nth-fibonacci-number-js/7a97b79c096ecb000d03bd36.md +++ b/curriculum/challenges/japanese/blocks/lab-nth-fibonacci-number-js/7a97b79c096ecb000d03bd36.md @@ -7,9 +7,9 @@ dashedName: build-an-nth-fibonacci-number-calculator # --description-- -**目的:** 以下のユーザーストーリーを満たし、すべてのテストに合格してラボを完了させてください。 +**目的:** 以下のユーザーストーリーを満たし、すべてのテストに合格してラボを完了してください。 -**User Stories:** +**ユーザーストーリー:** 1. `fibonacci` という名前の関数を作成してください。 2. `sequence` 関数内に `fibonacci` という配列を定義し、`[0, 1]` の値で初期化してください。 @@ -22,59 +22,64 @@ dashedName: build-an-nth-fibonacci-number-calculator `fibonacci` という名前の関数を用意してください。 ```js -assert.isFunction(fibonacci); +const explorer = await __helpers.Explorer(code); +assert.exists(explorer.allFunctions.fibonacci); ``` `fibonacci` 関数は1つのパラメータを受け取る必要があります。 ```js -const params = __helpers.getFunctionParams(fibonacci.toString()); -assert.equal(params.length, 1); +const explorer = await __helpers.Explorer(code); +const { fibonacci } = explorer.allFunctions; +assert.equal(fibonacci?.parameters.length, 1); ``` `sequence` 関数内に `fibonacci` という配列を用意し、`[0, 1]` で初期化してください。 ```js -assert.match(__helpers.removeJSComments(fibonacci.toString()), /(const|let|var)\s+sequence\s*=\s*\[\s*0\s*,\s*1\s*\]/); +const explorer = await __helpers.Explorer(code); +const { fibonacci } = explorer.allFunctions; +const { sequence } = fibonacci?.variables ?? {}; +assert.isTrue(sequence?.value.matches('[0, 1]')); ``` -`fibonacci(0)` should return `0`. +`fibonacci(0)` は `0` を返す必要があります。 ```js assert.equal(fibonacci(0), 0); ``` -`fibonacci(1)` should return `1`. +`fibonacci(1)` は `1` を返す必要があります。 ```js assert.equal(fibonacci(1), 1); ``` -`fibonacci(2)` should return `1`. +`fibonacci(2)` は `1` を返す必要があります。 ```js assert.equal(fibonacci(2), 1); ``` -`fibonacci(3)` should return `2`. +`fibonacci(3)` は `2` を返す必要があります。 ```js assert.equal(fibonacci(3), 2); ``` -`fibonacci(5)` should return `5`. +`fibonacci(5)` は `5` を返す必要があります。 ```js assert.equal(fibonacci(5), 5); ``` -`fibonacci(10)` should return `55`. +`fibonacci(10)` は `55` を返す必要があります。 ```js assert.equal(fibonacci(10), 55); ``` -`fibonacci(15)` should return `610`. +`fibonacci(15)` は `610` を返す必要があります。 ```js assert.equal(fibonacci(15), 610); diff --git a/curriculum/challenges/japanese/blocks/lab-product-showcase/696920c0c98a1ed58eb86293.md b/curriculum/challenges/japanese/blocks/lab-product-showcase/696920c0c98a1ed58eb86293.md index de47e0f6671..2bad5dc7e50 100644 --- a/curriculum/challenges/japanese/blocks/lab-product-showcase/696920c0c98a1ed58eb86293.md +++ b/curriculum/challenges/japanese/blocks/lab-product-showcase/696920c0c98a1ed58eb86293.md @@ -421,6 +421,10 @@ assert.isFunction(showProducts); ```js const len = products.items.length; +const books = document.getElementById("books"); +const all = document.getElementById("all"); +const output = document.getElementById("output"); + assert.isAtLeast(len, 3); books.dispatchEvent(new Event("click", { bubbles: true })); all.dispatchEvent(new Event("click", { bubbles: true })); @@ -430,7 +434,11 @@ assert.lengthOf(output.querySelectorAll(".item"), len); `#books`ボタンをクリックすると、対応する商品セットが`#output`要素に表示されます。 ```js +const books = document.getElementById("books"); +const clothing = document.getElementById("clothing"); +const output = document.getElementById("output"); const len = products.items.length; + assert.isAtLeast(len, 3); let count = 0; products.items.forEach(i => { @@ -446,7 +454,11 @@ assert.lengthOf(output.querySelectorAll(".item"), count); `#electronics`ボタンをクリックすると、対応する商品セットが`#output`要素に表示されます。 ```js +const electronics = document.getElementById("electronics"); +const clothing = document.getElementById("clothing"); +const output = document.getElementById("output"); const len = products.items.length; + assert.isAtLeast(len, 3); let count = 0; products.items.forEach(i => { @@ -462,7 +474,11 @@ assert.lengthOf(output.querySelectorAll(".item"), count); `#clothing`ボタンをクリックすると、対応する商品セットが`#output`要素に表示されます。 ```js +const books = document.getElementById("books"); +const clothing = document.getElementById("clothing"); +const output = document.getElementById("output"); const len = products.items.length; + assert.isAtLeast(len, 3); let count = 0; products.items.forEach(i => { @@ -478,6 +494,7 @@ assert.lengthOf(output.querySelectorAll(".item"), count); ページ読み込み時には、デフォルトで全商品が表示されます。これを保証するには`DOMContentLoaded`イベントを使ってください。 ```js +const output = document.getElementById("output"); const len = products.items.length; assert.isAtLeast(len, 3); document.dispatchEvent(new Event("DOMContentLoaded")); diff --git a/curriculum/challenges/japanese/blocks/lab-reusable-footer/673b02b03134b04637bf7055.md b/curriculum/challenges/japanese/blocks/lab-reusable-footer/673b02b03134b04637bf7055.md index 8c178994900..48197db75a7 100644 --- a/curriculum/challenges/japanese/blocks/lab-reusable-footer/673b02b03134b04637bf7055.md +++ b/curriculum/challenges/japanese/blocks/lab-reusable-footer/673b02b03134b04637bf7055.md @@ -8,7 +8,7 @@ demoType: onClick # --description-- -**目的:** 以下のストーリーを満たし、すべてのテストに合格してラボを完了してください。 +**目的:** 以下のユーザーストーリーを満たし、すべてのテストに合格してラボを完了してください。 **ユーザーストーリー:** @@ -16,7 +16,7 @@ demoType: onClick 2. `Footer` コンポーネントは、他のすべての要素を含む `footer` 要素を返す必要があります。 3. `footer` 要素は以下を持つ必要があります: - - 少なくとも3つの番号なしリストがあり、それぞれに少なくとも2つのリストアイテムがあること。 +- 少なくとも3つの番号なしリストがあり、それぞれに少なくとも2つのリストアイテムがあること。 - 著作権の `©` シンボルを含む少なくとも1つの段落要素があること。 - `href` の値が `#` に設定され、リンクの内容がアイコンまたは任意のテキストであるリンクが少なくとも3つあること。 @@ -53,7 +53,7 @@ assert.lengthOf(document.getElementById('root').children, 1); assert.isAtLeast(document.querySelectorAll('ul').length, 3); ``` -各番号なしリストは少なくとも2つのリストアイテムを持つべきです。 +番号なしリストのそれぞれに少なくとも2つのリスト項目が必要です。 ```js const uls = [...document.querySelectorAll('ul')]; @@ -84,7 +84,7 @@ const links = document.querySelectorAll('a[href="#"]'); assert.isAtLeast(links.length, 3); ``` -リンクは空であってはいけません。 +リンクは空にしないでください。 ```js const links = [...document.querySelectorAll('a[href="#"]')]; diff --git a/curriculum/challenges/japanese/blocks/lab-sentence-maker/66c057041df6394ca796bf33.md b/curriculum/challenges/japanese/blocks/lab-sentence-maker/66c057041df6394ca796bf33.md index c85d3f6ef10..2ceab29491b 100644 --- a/curriculum/challenges/japanese/blocks/lab-sentence-maker/66c057041df6394ca796bf33.md +++ b/curriculum/challenges/japanese/blocks/lab-sentence-maker/66c057041df6394ca796bf33.md @@ -7,11 +7,11 @@ dashedName: build-a-sentence-maker # --description-- -このラボでは、文のテンプレートを使って2つの異なるストーリーを作成します。変数を使ってストーリーの異なる部分をストアし、その後ストーリーをコンソールに出力します。 +このラボでは、文のテンプレートを使って2つの異なるストーリーを作成します。変数を使ってストーリーのさまざまな部分をストアし、その後ストーリーをコンソールにログ出力します。 -**目的:** 以下のユーザーストーリーを満たし、すべてのテストに合格してラボを完了してください。 +**目的:** 以下のユーザーストーリーを満たし、すべてのテストに合格してラボを完了してください。 -**ユーザーストーリー:** +**ユーザーストーリー:** 1. 次の変数を`let`を使って宣言してください。 @@ -26,19 +26,26 @@ dashedName: build-a-sentence-maker 1. `firstStory`変数を宣言してください。 -1. 次のストーリーテンプレートを使って最初のストーリーを作成し、`firstStory`変数に代入してください: `"Once upon a time, there was a(n) [adjective] [noun] who loved to eat [noun2]. The [noun] lived in a [place] and had [adjective2] nostrils that blew fire when it was [verb]."`; +1. 次のストーリーテンプレートを使って最初のストーリーを作成し、`firstStory` 変数に代入してください:`"Once upon a time, there was a(n) [adjective] [noun] who loved to eat [noun2]. The [noun] lived in a [place] and had [adjective2] nostrils that blew fire when it was [verb]."` -1. 最初のストーリーを`"First story: [firstStory]"`というメッセージを使ってコンソールに出力してください。 +1. 最初のストーリーをコンソールに、メッセージ `"First story: [firstStory]"` を使ってログ出力してください。 1. `adjective`、`noun`、`verb`、`place`、`adjective2`、`noun2`の変数に新しい値を代入してください。 1. `secondStory`変数を宣言してください。 -1. 同じテンプレートを使って別のストーリーを作成し、`secondStory`変数に代入してください。 +1. 同じテンプレートを使って別のストーリーを作成し、`secondStory` 変数に代入してください。 -1. 2つ目のストーリーを`"Second story: [secondStory]"`というメッセージを使ってコンソールに出力してください。 +1. 2つ目のストーリーをコンソールに、メッセージ `"Second story: [secondStory]"` を使ってログ出力してください。 +# --before-each-- + +```js +const spy = __helpers.spyOn(console, 'log'); +const getLogs = () => spy.calls.map(call => call.join(' ')); +``` + # --hints-- `adjective`変数を宣言してください。 @@ -142,12 +149,10 @@ assert.match( ); ``` -`"First story: [firstStory]"`というメッセージを使って最初のストーリーをログに出力してください。 +最初のストーリーをコンソールに、メッセージ `"First story: [firstStory]"` を使ってログ出力してください。 ```js -const condition1 = /console\.log\(\s*["']First\s+story:\s+["']\s*\+\s*firstStory\s*\);?/gm.test(code); -const condition2 = /console\.log\(\s*`First\s+story:\s+\$\{firstStory\}`\s*\);?/gm.test(code); -assert.isTrue(condition1 || condition2); +assert.include(getLogs(), `First story: ${firstStory}`); ``` `secondStory`変数を宣言してください。 @@ -208,15 +213,13 @@ assert.match( ); ``` -`"Second story: [secondStory]"`というフォーマットを使って2つ目のストーリーをログに出力してください。 +2つ目のストーリーをコンソールに、メッセージ `"Second story: [secondStory]"` を使ってログ出力してください。 ```js -const condition1 = /console\.log\(\s*["']Second\s+story:\s+["']\s*\+\s*secondStory\s*\);?/gm.test(code); -const condition2 = /console\.log\(\s*`Second\s+story:\s+\$\{secondStory\}`\s*\);?/gm.test(code); -assert.isTrue(condition1 || condition2); +assert.include(getLogs(), `Second story: ${secondStory}`); ``` -`firstStory`は`secondStory`と同じであってはいけません。 +あなたの `firstStory` は `secondStory` と同じであってはいけません。 ```js assert.notEqual(firstStory, secondStory); @@ -255,3 +258,4 @@ const secondStory = `Once upon a time, there was a(n) ${adjective} ${noun} who l console.log("Second story: " + secondStory); ``` + diff --git a/curriculum/challenges/japanese/blocks/lab-weather-app/66f12a88741aeb16b9246c59.md b/curriculum/challenges/japanese/blocks/lab-weather-app/66f12a88741aeb16b9246c59.md index e0ef8b0fb2e..1b230c05c6a 100644 --- a/curriculum/challenges/japanese/blocks/lab-weather-app/66f12a88741aeb16b9246c59.md +++ b/curriculum/challenges/japanese/blocks/lab-weather-app/66f12a88741aeb16b9246c59.md @@ -333,7 +333,7 @@ assert.strictEqual( ); ``` -`select` 要素の中に、パリ、ロンドン、東京、ロサンゼルス、シカゴ、ニューヨークの6つの `option` 要素がある必要があります。 +空の最初のオプションに加えて、`select` 要素には次の6つの都市それぞれに対応する `option` 要素が含まれている必要があります:パリ、ロンドン、東京、ロサンゼルス、シカゴ、ニューヨーク。 ```js ['Paris', 'London', 'Tokyo', 'Los Angeles', 'Chicago', 'New York'].forEach( @@ -342,7 +342,7 @@ assert.strictEqual( `select > option[value="${city.toLowerCase()}"]` ); assert.exists(el); - assert.strictEqual(el.innerText.trim(), city); + assert.strictEqual(el.textContent.trim(), city); } ); ``` diff --git a/curriculum/challenges/japanese/blocks/learn-about-speculation-and-requests/67eff6af42e8c425d9ff28e3.md b/curriculum/challenges/japanese/blocks/learn-about-speculation-and-requests/67eff6af42e8c425d9ff28e3.md index 643b64412f9..8f435f22739 100644 --- a/curriculum/challenges/japanese/blocks/learn-about-speculation-and-requests/67eff6af42e8c425d9ff28e3.md +++ b/curriculum/challenges/japanese/blocks/learn-about-speculation-and-requests/67eff6af42e8c425d9ff28e3.md @@ -32,7 +32,7 @@ lang: en-US - `Your software is up to date.` - ソフトウェアがすべての最新の更新を含んでいます。 -- `Is your resume up to date?` - 彼らは履歴書にこの人の最新の経験が含まれているかどうかを尋ねています。 +- `Is your resume up to date?` - これは履歴書にその人の最新の経験が含まれているかどうかを尋ねています。 # --scene-- diff --git a/curriculum/challenges/japanese/blocks/learn-basic-css-by-building-a-cafe-menu/5f3ef6e03d719d5ac4738993.md b/curriculum/challenges/japanese/blocks/learn-basic-css-by-building-a-cafe-menu/5f3ef6e03d719d5ac4738993.md index db06df33324..3d4718d4422 100644 --- a/curriculum/challenges/japanese/blocks/learn-basic-css-by-building-a-cafe-menu/5f3ef6e03d719d5ac4738993.md +++ b/curriculum/challenges/japanese/blocks/learn-basic-css-by-building-a-cafe-menu/5f3ef6e03d719d5ac4738993.md @@ -7,7 +7,7 @@ dashedName: step-56 # --description-- -メニューの現在の幅は常に`body`要素の幅の80%を占めます。非常に広い画面では、コーヒーとデザートがそれぞれの価格から遠く離れて表示されます。 +メニューの現在の幅は常に`body`要素の幅の`80%`を占めます。非常に広い画面では、コーヒーやデザートが価格から離れて表示されます。 `menu`クラスに`max-width`プロパティを値`500px`で追加して、幅が広くなりすぎるのを防いでください。 @@ -117,3 +117,4 @@ h1, h2, p { width: 25%; } ``` + diff --git a/curriculum/challenges/japanese/blocks/learn-present-perfect-while-talking-about-accessibility/671b98e9b7c4854e93044e64.md b/curriculum/challenges/japanese/blocks/learn-present-perfect-while-talking-about-accessibility/671b98e9b7c4854e93044e64.md index e27c073656a..805e5a596f4 100644 --- a/curriculum/challenges/japanese/blocks/learn-present-perfect-while-talking-about-accessibility/671b98e9b7c4854e93044e64.md +++ b/curriculum/challenges/japanese/blocks/learn-present-perfect-while-talking-about-accessibility/671b98e9b7c4854e93044e64.md @@ -1,6 +1,6 @@ --- id: 671b98e9b7c4854e93044e64 -title: "Dialogue 2: Closed Captioning Challenges" +title: "ダイアログ 2: クローズドキャプションのチャレンジ" challengeType: 21 dashedName: dialogue-2-closed-captioning-challenges lang: en-US @@ -62,7 +62,7 @@ lang: en-US "startTime": 5.34, "finishTime": 9.26, "dialogue": { - "text": "Yes, for some reason it hasn't been displaying correctly for some users.", + "text": "Yes. For some reason, it hasn't been displaying correctly for some users.", "align": "right" } }, diff --git a/curriculum/challenges/japanese/blocks/learn-present-perfect-while-talking-about-accessibility/671f403c1d4e8a5e046065a0.md b/curriculum/challenges/japanese/blocks/learn-present-perfect-while-talking-about-accessibility/671f403c1d4e8a5e046065a0.md index 552f5ee19ca..69a5a71f183 100644 --- a/curriculum/challenges/japanese/blocks/learn-present-perfect-while-talking-about-accessibility/671f403c1d4e8a5e046065a0.md +++ b/curriculum/challenges/japanese/blocks/learn-present-perfect-while-talking-about-accessibility/671f403c1d4e8a5e046065a0.md @@ -1,22 +1,22 @@ --- id: 671f403c1d4e8a5e046065a0 -title: タスク 36 +title: タスク36 challengeType: 22 dashedName: task-36 lang: en-US --- -<!-- (Audio) James: Yes. For some reason, It hasn't been displaying correctly for some users. --> +<!-- (Audio) James: Yes. For some reason, it hasn't been displaying correctly for some users. --> # --instructions-- -音声を聞いて、下の文を完成させてください。 +音声を聞いて、以下の文を完成させてください。 # --fillInTheBlank-- ## --sentence-- -`Yes. For some reason, It BLANK BLANK BLANK correctly for some users.` +`Yes. For some reason, it BLANK BLANK BLANK correctly for some users.` ## --blanks-- @@ -83,7 +83,7 @@ lang: en-US "startTime": 1, "finishTime": 4.92, "dialogue": { - "text": "Yes, for some reason it hasn't been displaying correctly for some users.", + "text": "Yes. For some reason, it hasn't been displaying correctly for some users.", "align": "center" } }, diff --git a/curriculum/challenges/japanese/blocks/learn-present-perfect-while-talking-about-accessibility/671f456994635c6085054cbd.md b/curriculum/challenges/japanese/blocks/learn-present-perfect-while-talking-about-accessibility/671f456994635c6085054cbd.md index fbcd36424de..84489eca455 100644 --- a/curriculum/challenges/japanese/blocks/learn-present-perfect-while-talking-about-accessibility/671f456994635c6085054cbd.md +++ b/curriculum/challenges/japanese/blocks/learn-present-perfect-while-talking-about-accessibility/671f456994635c6085054cbd.md @@ -6,17 +6,17 @@ dashedName: task-37 lang: en-US --- -<!-- (Audio) James: Yes. For some reason, It hasn't been displaying correctly for some users. --> +<!-- (Audio) James: Yes. For some reason, it hasn't been displaying correctly for some users. --> # --instructions-- -音声を聞いて、下の文を完成させてください。 +音声を聞いて、以下の文を完成させてください。 # --fillInTheBlank-- ## --sentence-- -`Yes. For some reason, It hasn't been displaying BLANK for some BLANK.` +`Yes. For some reason, it hasn't been displaying BLANK for some BLANK.` ## --blanks-- @@ -79,7 +79,7 @@ lang: en-US "startTime": 1, "finishTime": 4.92, "dialogue": { - "text": "Yes, for some reason it hasn't been displaying correctly for some users.", + "text": "Yes. For some reason, it hasn't been displaying correctly for some users.", "align": "center" } }, diff --git a/curriculum/challenges/japanese/blocks/learn-present-perfect-while-talking-about-accessibility/6720cf38beae8c4f1d7af1c0.md b/curriculum/challenges/japanese/blocks/learn-present-perfect-while-talking-about-accessibility/6720cf38beae8c4f1d7af1c0.md index 1c81f770794..db0b3bc96f8 100644 --- a/curriculum/challenges/japanese/blocks/learn-present-perfect-while-talking-about-accessibility/6720cf38beae8c4f1d7af1c0.md +++ b/curriculum/challenges/japanese/blocks/learn-present-perfect-while-talking-about-accessibility/6720cf38beae8c4f1d7af1c0.md @@ -22,7 +22,7 @@ lang: en-US `Alice: James, have you heard about the BLANK on our video platform?` -`James: Yes. For some reason, It hasn't been BLANK for some users. The captions are misaligned and BLANK, which isn't good for accessibility.` +`James: Yes. For some reason, it hasn't been BLANK for some users. The captions are misaligned and BLANK, which isn't good for accessibility.` `Alice: Exactly. Do you know if it's been affecting all the videos or just a few?` diff --git a/curriculum/challenges/japanese/blocks/lecture-css-specificity-the-cascade-algorithm-and-inheritance/672aa62178d5ff57fe4f98e0.md b/curriculum/challenges/japanese/blocks/lecture-css-specificity-the-cascade-algorithm-and-inheritance/672aa62178d5ff57fe4f98e0.md index 45e7a41ff5d..ae9c4c92b92 100644 --- a/curriculum/challenges/japanese/blocks/lecture-css-specificity-the-cascade-algorithm-and-inheritance/672aa62178d5ff57fe4f98e0.md +++ b/curriculum/challenges/japanese/blocks/lecture-css-specificity-the-cascade-algorithm-and-inheritance/672aa62178d5ff57fe4f98e0.md @@ -43,14 +43,14 @@ p { ```html <link rel="stylesheet" href="styles.css"> -<p id="para">Red paragraph</p> +<p id="para-1">Red paragraph</p> <p>Other paragraph</p> <p>Another paragraph</p> <p>Yet another paragraph</p> ``` ```css -#para { +#para-1 { color: red; } @@ -67,24 +67,33 @@ p { **注意**:疑似クラスについては今後のレッスンで詳しく学びます。 -この例では、最初の段落はIDセレクターがクラスや型セレクターよりも高い特異性を持つため赤色になります。`.example-para` の要素は緑色になり、残りの段落要素は青色になります。 +この例では: + +- 最初の段落は、IDセレクターがクラスや型セレクターよりも特異性が高いため赤色になります。 +- 2番目の段落は、クラスセレクター `.example-para` が適用されて緑色になります。 +- 3番目の段落は、IDセレクター `#para-3` とクラスセレクター `.example-para` の両方が適用されて紫色になります。 +- 残りの段落要素は青色になります。 :::interactive_editor ```html <link rel="stylesheet" href="styles.css"> -<p id="para">Example paragraph</p> +<p id="para-1">Example paragraph</p> <p class="example-para">Other paragraph</p> -<p class="example-para">Another paragraph</p> +<p id="para-3" class="example-para">Another paragraph</p> <p>Yet another paragraph</p> ``` ```css -#para { +#para-1 { color: red; } +#para-3 { + color: purple; +} + .example-para { color: green; } @@ -105,13 +114,13 @@ p { ```html <link rel="stylesheet" href="styles.css"> -<p id="para">Example paragraph</p> +<p id="para-1">Example paragraph</p> <p>Other paragraph</p> <p>Yet another paragraph</p> ``` ```css -#para { +#para-1 { color: red; } @@ -130,7 +139,7 @@ p { ```html <link rel="stylesheet" href="styles.css"> -<p id="para">Example paragraph</p> +<p id="para-1">Example paragraph</p> <p>Other paragraph</p> <p>Yet another paragraph</p> ``` @@ -140,7 +149,7 @@ p { color: red; } -#para { +#para-1 { color: green; } diff --git a/curriculum/challenges/japanese/blocks/lecture-express-middleware/69f42d414b7626e21a922794.md b/curriculum/challenges/japanese/blocks/lecture-express-middleware/69f42d414b7626e21a922794.md index ca0df79e5e3..30cd4202bb7 100644 --- a/curriculum/challenges/japanese/blocks/lecture-express-middleware/69f42d414b7626e21a922794.md +++ b/curriculum/challenges/japanese/blocks/lecture-express-middleware/69f42d414b7626e21a922794.md @@ -9,9 +9,7 @@ dashedName: what-is-error-handling-middleware Expressのエラーハンドリングミドルウェアは、リクエストとレスポンスのサイクル中に発生したエラーを処理するための特別な種類のミドルウェアです。予期しないエラーをキャッチし、ログを記録し、クライアントに適切なレスポンスを返すために不可欠です。 -前のレッスンのエラーハンドリングの項目で見たように、Expressのエラーハンドリングミドルウェアは4つのパラメータを持ちます:`err`、`req`、`res`、および`next`です。このミドルウェアは、エラーが`next()`関数に渡されたときに呼び出されます。 - -構文をもう一度おさらいしましょう: +Expressのエラーハンドリングミドルウェアには4つのパラメータがあります:`err`、`req`、`res`、そして`next`です。このミドルウェアは、エラーが`next()`関数に渡されたときに呼び出されます。構文は次の通りです: ```js app.use((err, req, res, next) => { @@ -92,7 +90,7 @@ app.listen(3000, () => { ## --answers-- -`err`、`req`、`res`、`next`。 +`err`, `req`, `res`, `next`. --- diff --git a/curriculum/challenges/japanese/blocks/lecture-express-middleware/69f42d414b7626e21a922795.md b/curriculum/challenges/japanese/blocks/lecture-express-middleware/69f42d414b7626e21a922795.md index 33d8e22b0b4..fc91fb22a46 100644 --- a/curriculum/challenges/japanese/blocks/lecture-express-middleware/69f42d414b7626e21a922795.md +++ b/curriculum/challenges/japanese/blocks/lecture-express-middleware/69f42d414b7626e21a922795.md @@ -13,45 +13,45 @@ Express は、静的ファイルの配信や JSON リクエストボディのパ 1. `express.json()`: 受信した JSON ペイロードをパースする組み込みミドルウェアです。 -```js -app.use(express.json()) -``` + ```js + app.use(express.json()) + ``` 1. `express.static()`: 画像や CSS、JavaScript ファイルなどの静的ファイルを配信するためのミドルウェアです。 -```js -app.use(express.static('public')) -``` + ```js + app.use(express.static('public')) + ``` 1. `express.urlencoded()`: HTML フォームで送信される形式である URL エンコードされたペイロードをパースするミドルウェアです。パースされたデータは `req.body` で利用可能になります。 -```js -app.use(express.urlencoded({ extended: true })) -``` + ```js + app.use(express.urlencoded({ extended: true })) + ``` **次に、サードパーティミドルウェアの例を紹介します:** 1. `cors`: クロスオリジンリソースシェアリングを有効にする人気のサードパーティミドルウェアです。 -```bash -npm install cors -``` + ```bash + npm install cors + ``` -```js -const cors = require('cors') -app.use(cors()) -``` + ```js + const cors = require('cors') + app.use(cors()) + ``` 1. `morgan`: HTTP リクエストのログを記録するミドルウェアです。 -```bash -npm install morgan -``` + ```bash + npm install morgan + ``` -```js -const morgan = require('morgan') -app.use(morgan('tiny')) -``` + ```js + const morgan = require('morgan') + app.use(morgan('tiny')) + ``` では、組み込みミドルウェアとサードパーティミドルウェアの両方を使った例を見てみましょう: @@ -133,7 +133,7 @@ Express は JSON パースや静的ファイル配信などの一般的な処理 --- -HTTP リクエストのログを記録します。 +HTTPリクエストをログに記録する。 ### --feedback-- diff --git a/curriculum/challenges/japanese/blocks/lecture-importance-of-semantic-html/672990ecf71a852804ababe7.md b/curriculum/challenges/japanese/blocks/lecture-importance-of-semantic-html/672990ecf71a852804ababe7.md index 9573d159281..1f910b2156c 100644 --- a/curriculum/challenges/japanese/blocks/lecture-importance-of-semantic-html/672990ecf71a852804ababe7.md +++ b/curriculum/challenges/japanese/blocks/lecture-importance-of-semantic-html/672990ecf71a852804ababe7.md @@ -11,6 +11,10 @@ dashedName: what-is-the-difference-between-presentational-and-semantic-html 多くのプレゼンテーショナルHTML要素は非推奨となっており、これは時代遅れで推奨されなくなったことを意味します。同じ結果を得るためのより良い方法があります。ただし、それらが存在することを知っておくのは役立つので、いくつかの例を見てみましょう。 +## プレゼンテーションHTML要素 + +### `font` 要素 + `font`要素は、テキストのフォントサイズと色を設定するために使われた非推奨の要素です。以下は`font`要素の例です。 インタラクティブエディターを有効にして、サイズを5から7に変更するとフォントが大きくなるのがわかります。 @@ -27,6 +31,8 @@ dashedName: what-is-the-difference-between-presentational-and-semantic-html この要素はまだ動作しますが、フォントサイズと色は常にCSSで設定すべきであり、HTMLで設定すべきではありません。 +### `center` 要素 + `center`要素は、コンテナ内のコンテンツを水平方向に中央揃えにするために使われた別の非推奨要素です。以下はテキストと段落要素を含む`center`要素の例です。 インタラクティブエディターを有効にして、`center`タグを`<p>Another example text.</p>`の周りに追加すると、ページ上で中央に配置されるのがわかります。 @@ -44,6 +50,8 @@ dashedName: what-is-the-difference-between-presentational-and-semantic-html ::: +### `big` 要素 + 次に`big`要素があります。これは囲まれたテキストを周囲のテキストより1段階大きくする非推奨のプレゼンテーショナルHTML要素です。ここでは2つの部分からなる段落の例があります。 インタラクティブエディターを有効にして、`big`タグを`Some other text`の周りに追加し、プレビューウィンドウで変化を確認してください。 @@ -64,6 +72,8 @@ dashedName: what-is-the-difference-between-presentational-and-semantic-html これらはプレゼンテーショナルHTML要素の例でした。しかし、すべて非推奨で推奨されていません。では代わりに何を使うべきでしょうか?見てみましょう。 +## セマンティックHTML + セマンティックHTMLが現在推奨される方法です。これは要素の内容を表すので、読みやすく理解しやすく、保守もしやすいです。 セマンティックHTMLを使うと検索エンジンがウェブサイトを簡単に理解できます。また、スクリーンリーダーがウェブページの内容を説明するためにセマンティックな情報が必要なため、アクセシビリティにも役立ちます。 @@ -75,6 +85,8 @@ dashedName: what-is-the-difference-between-presentational-and-semantic-html - 関連情報をグループ化する`section`要素 - イラストや図を表す`figure`要素 +### セマンティックHTMLの例 + 以下はナビゲーションセクション要素を含む`header`要素の例です。 インタラクティブエディターを有効にして、`<a href="#">Products</a>`を`nav`の中に追加し、プレビューウィンドウで変化を確認してください。 @@ -97,6 +109,8 @@ dashedName: what-is-the-difference-between-presentational-and-semantic-html セマンティック要素はHTML構造内でその目的が明確に示されています。多くの異なるセマンティックHTML要素があり、プロジェクトのニーズに合うものが必ず見つかります。 +## まとめ + よくできました。これでプレゼンテーショナルHTMLとセマンティックHTMLの違いがわかりましたね。セマンティックHTMLは内容を表し、プレゼンテーショナルHTMLは見た目に焦点を当てています。 # --questions-- diff --git a/curriculum/challenges/japanese/blocks/lecture-introduction-to-javascript-libraries-and-frameworks/6734e88cc46e6dc679420040.md b/curriculum/challenges/japanese/blocks/lecture-introduction-to-javascript-libraries-and-frameworks/6734e88cc46e6dc679420040.md index 8d6ebdd3033..67e28160050 100644 --- a/curriculum/challenges/japanese/blocks/lecture-introduction-to-javascript-libraries-and-frameworks/6734e88cc46e6dc679420040.md +++ b/curriculum/challenges/japanese/blocks/lecture-introduction-to-javascript-libraries-and-frameworks/6734e88cc46e6dc679420040.md @@ -13,7 +13,7 @@ dashedName: what-is-vite-and-how-can-it-be-used-to-set-up-a-new-react-project Viteで新しいプロジェクトを作成するには、コマンドラインを使う必要があります。Windowsを使っている場合は、コマンドプロンプトかWindows PowerShellを使えます。Macの場合は、ターミナルアプリを使ってください。 -npmを動かすために必要なNode.jsがインストールされていない場合は、公式のNode.jsウェブページ(https://nodejs.org)へのリンクがあります。インストール手順に従い、その後ここに戻ってReactのインストールを続けてください。 +npmを動かすために必要なNode.jsがインストールされていない場合は、公式のNode.jsウェブページへのリンクがあります:[nodejs.org](https://nodejs.org)。インストール手順に従い、その後ここに戻ってReactのインストールを続けてください。 コマンドラインを開いたら、次のコマンドを使えます。 @@ -36,7 +36,7 @@ npm install `cd my-react-app`コマンドは、プロジェクトがある正しいディレクトリに移動することを確認します。 -`npm install`コマンドは、Reactプロジェクトを正しく動かすために必要な依存関係をインストールします。依存関係とは、React自体やReactDOM、その他の追加機能を提供するサードパーティのパッケージなど、Reactプロジェクトが正しく動作するために必要なライブラリやパッケージのことです。 +`npm install` コマンドは、Reactプロジェクトを正しく動かすために必要な依存関係をインストールするために使います。依存関係とは、React自体や `react-dom`、その他の追加機能を提供するサードパーティのパッケージなど、Reactプロジェクトが正常に機能するために必要なライブラリやパッケージのことです。 `npm install`を実行すると、プロジェクトディレクトリ内の`package.json`ファイルを読み込み、そこにリストされたすべての依存関係をインストールします。これにより、必要なコンポーネントが欠けることなくReactアプリをビルドして実行できます。 @@ -50,11 +50,11 @@ npm install Viteが用意したスターターテンプレートが表示されるはずです。 -ローカルサーバーを停止したい場合は、コマンドラインで`CTRL + C`を押してください。 +ローカルサーバーを停止する必要がある場合は、コマンドラインで `Ctrl + C` を押してください。 -このスターターテンプレートのコードを実際に見たい場合は、プロジェクト内の`src`フォルダーに入り、`App.jsx`ファイルを確認してください。 +このスターターテンプレートのコードを実際に見るには、プロジェクト内の `src` フォルダーを開くと、`App.jsx` ファイルが見つかります。 -そこからファイルを編集し、変更を保存すると、ブラウザに新しい変更が表示されます。 +そこからファイルを編集し、変更を保存すると、その内容がブラウザに反映されるのを確認できます。 これでReactアプリケーションの開発を始める準備が整いました! diff --git a/curriculum/challenges/japanese/blocks/lecture-introduction-to-javascript/672d49959621885e9d3e672c.md b/curriculum/challenges/japanese/blocks/lecture-introduction-to-javascript/672d49959621885e9d3e672c.md index 37421d54018..129040a72ed 100644 --- a/curriculum/challenges/japanese/blocks/lecture-introduction-to-javascript/672d49959621885e9d3e672c.md +++ b/curriculum/challenges/japanese/blocks/lecture-introduction-to-javascript/672d49959621885e9d3e672c.md @@ -72,6 +72,16 @@ console.log(age); // 25 ::: +`let`で宣言された変数は再代入できますが、再宣言はできません。同じ変数をもう一度`let`で宣言しようとすると、エラーが発生します。 + +```js +let age = 25; + +let age = 90; // SyntaxError: Identifier 'age' has already been declared +``` + +`const`にも同じことが当てはまります。`const`で宣言された変数も再宣言できません。 + `const` で宣言された変数は、宣言時に値を代入する必要があります。値を代入せずに `const` 変数を宣言しようとすると、エラーになります。 ```js diff --git a/curriculum/challenges/japanese/blocks/lecture-understanding-aria-expanded-aria-live-and-common-aria-states/672a54dff9dc439089f1a219.md b/curriculum/challenges/japanese/blocks/lecture-understanding-aria-expanded-aria-live-and-common-aria-states/672a54dff9dc439089f1a219.md index 565549bdc55..1bf4c5c1368 100644 --- a/curriculum/challenges/japanese/blocks/lecture-understanding-aria-expanded-aria-live-and-common-aria-states/672a54dff9dc439089f1a219.md +++ b/curriculum/challenges/japanese/blocks/lecture-understanding-aria-expanded-aria-live-and-common-aria-states/672a54dff9dc439089f1a219.md @@ -1,6 +1,6 @@ --- id: 672a54dff9dc439089f1a219 -title: aria-live属性とは何か、そしてどのように機能するのか? +title: Aria-live属性とは何か、そしてどのように機能するのか? challengeType: 19 dashedName: what-is-the-aria-live-attribute --- @@ -15,6 +15,8 @@ dashedName: what-is-the-aria-live-attribute この属性には、情報の優先度に基づいて3つの値があります。 +## `assertive` の値 + `aria-live`を`assertive`に設定すると、その更新は非常に重要であることを意味します。これは最も高い優先度であり、ユーザーに即座に通知されるべきです。 これはスクリーンリーダーが現在読み上げている内容を中断して、ライブリージョンのコンテンツ変化を読み上げることを意味します。このような中断は非常に煩わしいため、`assertive`の値は時間的に重要な通知や緊急の通知にのみ使うべきです。 @@ -81,6 +83,8 @@ document.addEventListener("DOMContentLoaded", () => { ::: +## `polite` の値 + 次に優先度が高い値は`polite`です。 この値は更新が緊急ではないことを意味し、スクリーンリーダーは現在の読み上げが終わるかユーザーが入力を止めるまで待ってから更新を読み上げます。ほとんどのライブリージョンは`polite`の値を使います。 @@ -147,10 +151,16 @@ document.addEventListener("DOMContentLoaded", () => { ::: +## `off` の値 + `aria-live`の最も低い優先度の値は`off`で、これは更新がキーボードフォーカスがある要素内のコンテンツでない限り読み上げられないことを意味します。実際には、この値はほとんど使われません。利用ケースが非常に限定的であり、スクリーンリーダー間で一貫して実装されていないためです(実装されている場合もありますが)。ライブリージョンが必要な場合は、緊急のメッセージに`polite`を使う以外はすべて`assertive`を使うことを計画してください。 +## ARIA 役割からのデフォルトのライブリージョン + また、更新された情報が`aria-live`、`alert`、`log`、`marquee`、または`status`のARIA役割を持つ要素に含まれている場合、`timer`属性は必須ではありません。これらの役割はすでにデフォルトの`aria-live`値を持っているためです。ただし、明示的に`aria-live`を要素に設定することでデフォルト値を変更できます。 +## 適切な値の選び方 + 適切な`aria-live`値の選択は、更新情報の優先度によります。 更新が緊急の場合は、`assertive`でユーザーに即座に通知してください。ただし、突然の中断はユーザーを混乱させ、ユーザー体験に影響を与える可能性があるため、本当に緊急の場合にのみ使うべきです。 @@ -205,7 +215,7 @@ document.addEventListener("DOMContentLoaded", () => { ## --answers-- -`true`、`false`、`off`。 +`true`, `false`, `off`. ### --feedback-- @@ -213,7 +223,7 @@ document.addEventListener("DOMContentLoaded", () => { --- -`visible`、`hidden`、`off`。 +`visible`, `hidden`, `off`. ### --feedback-- @@ -221,11 +231,11 @@ document.addEventListener("DOMContentLoaded", () => { --- -`assertive`、`polite`、`off`。 +`assertive`, `polite`, `off`. --- -`open`、`closed`、`off`。 +`open`, `closed`, `off`. ### --feedback-- diff --git a/curriculum/challenges/japanese/blocks/lecture-understanding-computer-internet-and-tooling-basics/672aa578a2129554d4675049.md b/curriculum/challenges/japanese/blocks/lecture-understanding-computer-internet-and-tooling-basics/672aa578a2129554d4675049.md index c6e24992ab0..b50b82bd6c8 100644 --- a/curriculum/challenges/japanese/blocks/lecture-understanding-computer-internet-and-tooling-basics/672aa578a2129554d4675049.md +++ b/curriculum/challenges/japanese/blocks/lecture-understanding-computer-internet-and-tooling-basics/672aa578a2129554d4675049.md @@ -11,13 +11,13 @@ dashedName: what-are-the-basic-parts-of-a-computer 開発者として、コンピューターの基本的な内部構造を理解することは重要です。 -コンピューターの最初の主要なコンポーネントはマザーボードです。マザーボードは、コンピューターを動かすために必要なすべてのメモリやコネクターを保持しています。コンピューターのメイン回路基板として機能します。 +コンピューターの最初の主要なコンポーネントはマザーボードです。マザーボードは、コンピューターを動かすために必要なすべてのメモリとコネクターを保持しています。コンピューターのメイン回路基板として機能します。 -マザーボードのコンピューターケースの中には、CPU(セントラルプロセッシングユニット)があります。CPUは命令を実行し計算を行うプロセッサーで、コンピューターの頭脳と呼ばれています。 +コンピューターケースの中、マザーボードに取り付けられているのがCPUで、Central Processing Unitの略です。CPUは命令を実行し計算を行うプロセッサーで、しばしばコンピューターの頭脳と呼ばれます。 -CPUは小さな正方形のチップで、マザーボードのCPUソケットに差し込まれます。CPUの処理速度はギガヘルツ(GHz)やメガヘルツ(MHz)で測定されます。ギガヘルツは1秒間に10億回のサイクル、メガヘルツは1秒間に100万回のサイクルを意味します。 +CPUはマザーボードのCPUソケットに差し込まれる小さな正方形のチップです。CPUの速度はギガヘルツ(GHz)とメガヘルツ(MHz)で測定されます。ギガヘルツは1秒間に10億サイクル、メガヘルツは1秒間に100万サイクルです。 -次に重要なコンポーネントはシステムの短期記憶です。これはRAM(ランダムアクセスメモリ)として知られています。RAMはコンピューターのCPUのための一時的な記憶場所です。コンピューターがデータに素早くアクセスする必要があるときは、RAMを使用します。 +次に重要なコンポーネントはシステムの短期記憶です。これはRAM、つまりRandom Access Memoryとして知られています。RAMはコンピューターのCPUのための一時的な記憶場所です。コンピューターがデータに素早くアクセスする必要があるときはいつでもRAMを使います。 コンピューターに搭載されているRAMが多いほど、動作は速くなり、同時に実行できるプログラムも増えます。RAMが不足すると、コンピューターの動作が遅くなり、パフォーマンスの違いを感じるでしょう。 @@ -27,13 +27,13 @@ RAMは揮発性メモリであることに注意してください。これは ハードドライブは回転するプラッターとアームで構成されています。プラッターはデータが保存される場所で、アームはプラッターにデータを読み書きするために使われます。高速なハードドライブを使うと、コンピューターの起動やプログラムの動作が速くなります。 -もう一つのデータ保存の種類はソリッドステートドライブ(SSD)です。SSDは不揮発性のフラッシュメモリで、ハードドライブの代わりに使えます。SSDはハードドライブよりも速くて小さいですが、ハードドライブは安価で容量が大きいです。 +もう一つのデータストレージの種類はソリッドステートドライブ、略してSSDです。SSDは不揮発性のフラッシュメモリで、ハードドライブの代わりに使うことができます。SSDはハードドライブよりも高速で小型ですが、ハードドライブは安価で容量が大きいです。 コンピューターのもう一つの重要なコンポーネントは電源ユニット(PSU)です。PSUは壁のコンセントからの電気をコンピューターが使える形に変換します。コンセントからマザーボード、CPU、その他のコンポーネントに電力を送ります。 -さらに重要なコンポーネントは拡張カードです。これらのカードはマザーボードに差し込まれ、コンピューターに追加機能を加えます。拡張カードの例としてはビデオカード、サウンドカード、ネットワークカードがあります。 +もう一つの重要なコンポーネントは拡張カードです。これらのカードはマザーボードに挿入され、コンピューターに追加の機能を加えます。拡張カードの例としてはビデオカード、サウンドカード、ネットワークカードがあります。 -ビデオカードはGPU(グラフィックスプロセッシングユニット)とも呼ばれ、コンピューター画面に映像をレンダリングする役割を持ちます。 +ビデオカードはGraphics Processing Unit、略してGPUとも呼ばれ、コンピューター画面に映像をレンダリングする役割を担っています。 サウンドカードはコンピューターのスピーカーで音を再生する役割を持ちます。 @@ -49,15 +49,15 @@ RAMとは何ですか? ## --answers-- -長期記憶。 +長期記憶です。 ### --feedback-- -短期データ保存について考えてみてください。 +短期データストレージについて考えてみてください。 --- -短期記憶。 +短期記憶です。 --- @@ -65,7 +65,7 @@ RAMとは何ですか? ### --feedback-- -短期データ保存について考えてみてください。 +短期データストレージについて考えてみてください。 --- @@ -73,7 +73,7 @@ RAMとは何ですか? ### --feedback-- -短期データ保存について考えてみてください。 +短期データストレージについて考えてみてください。 ## --video-solution-- @@ -141,7 +141,7 @@ CPUは何の略ですか? --- -短期記憶を保存する。 +短期記憶を保存することです。 ### --feedback-- diff --git a/curriculum/challenges/japanese/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab82c1a9bbd0e3aabc39d.md b/curriculum/challenges/japanese/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab82c1a9bbd0e3aabc39d.md index 5bddc1442fa..adb250861bc 100644 --- a/curriculum/challenges/japanese/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab82c1a9bbd0e3aabc39d.md +++ b/curriculum/challenges/japanese/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab82c1a9bbd0e3aabc39d.md @@ -7,11 +7,11 @@ dashedName: how-to-effectively-work-with-your-keyboard-mouse-and-other-pointing- # --description-- -多くの方は、ゲームをしたり、仕事の作業をしたり、ウェブを閲覧したりと、長年にわたってキーボードやマウスを使い慣れていると思います。 +多くの方は、ゲーム、仕事のタスク、ウェブの閲覧など、さまざまな活動で長年キーボードとマウスを使ってきました。 しかし、これらのデバイスを長時間誤った使い方をすると、将来的に深刻な健康問題を引き起こすことがあります。 -このレッスンでは、コンピューターのキーボードやマウスを健康的に使う方法について説明します。 +このレッスンでは、コンピューターのキーボードとマウスを健康的に使う方法を紹介します。 最初のポイントは、マウスの握り方に注意することです。仕事の重要な作業中や激しいゲームの最中には、ついマウスを強く握りがちです。しかし、これが手や手首の深刻な問題につながることがあります。これを防ぐためには、マウスを優しく持ち、指をリラックスさせておくことが大切です。 @@ -25,7 +25,7 @@ dashedName: how-to-effectively-work-with-your-keyboard-mouse-and-other-pointing- 良い姿勢を保つことは重要ですが、現代のエルゴノミクスでは動きや動的な座り方の重要性も強調されています。人間の体は動くようにできており、どんなにまっすぐな姿勢でも長時間同じ姿勢を続けると背骨に継続的な負担がかかります。定期的に休憩を取り、日中に姿勢を変え、手首を自然な位置に保つことで血行が良くなり、疲労が軽減され、背骨の健康を長期的に支えることができます。 -最後のポイントは、可能な限りキーボードショートカットを使ってタイピングを減らすことです。ウェブのナビゲーション、OSの操作、コードエディターでの作業など、多くのショートカットが利用できます。ですので、これらのキーボードショートカットを調べて、日々のコンピューター作業に取り入れていくことをお勧めします。 +最後のヒントは、可能な限りキーボードショートカットを使ってマウスを使う回数を減らすことです。ウェブの操作、OSのナビゲーション、コードエディターでの作業など、多くのタスクに使えるショートカットが数多くあります。ですので、これらのキーボードショートカットを調べて、日々のコンピューター使用に取り入れることをお勧めします。 今後のコーディングプロジェクトやその他の活動でマウスやキーボードを使い続ける際は、これらの健康に関するポイントを忘れないでください。 @@ -109,7 +109,7 @@ dashedName: how-to-effectively-work-with-your-keyboard-mouse-and-other-pointing- ## --answers-- -マウスはキーボードよりかなり高い位置にあるべき。 +マウスの高さは重要ではありません。 ### --feedback-- diff --git a/curriculum/challenges/japanese/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab83c4297910eade53c2e.md b/curriculum/challenges/japanese/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab83c4297910eade53c2e.md index 187fbcc4cb9..af55141a83a 100644 --- a/curriculum/challenges/japanese/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab83c4297910eade53c2e.md +++ b/curriculum/challenges/japanese/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab83c4297910eade53c2e.md @@ -7,17 +7,17 @@ dashedName: what-are-the-different-types-of-internet-service-providers # --description-- -まず、インターネットサービスプロバイダー(ISP)とは何でしょうか?簡単に言うと、世界中のインターネットネットワークへのアクセスを販売する会社のことです。そして、ISPには3つの異なる階層があります。 +まず、インターネットサービスプロバイダー(ISP)とは何でしょうか?基本的には、世界中のインターネットネットワークへのアクセスを販売する会社のことです。そして、ISPには3つの異なる階層があります。 -第一の階層は巨大なコングロマリット企業で、自社のネットワークトラフィックのほとんど(あるいはすべて)を独自に処理できるインフラを持っています。 +第1の階層は巨大な複合企業で、ほとんど(またはすべて)のネットワークトラフィックを独自に処理できるインフラを持っています。 -第二の階層は全国規模のプロバイダーで、時には第一階層のネットワークを借りることもありますが、かなり自立して運営できます。 +第2の階層は全国規模のプロバイダーで、時には第1階層のネットワークへのアクセスを借りることもありますが、かなり自立して運営できます。 -第三の階層は主に地域市場にインターネットを提供する小規模な会社で、インフラは大手ISPに依存しています。 +第3の階層は主に地域市場にインターネットを提供する小規模な会社で、インフラはより大きなISPに依存しています。 これらのプロバイダーは、異なる種類の接続も提供します。 -光ファイバー接続は、ガラスやプラスチックの繊維を使って光でデータを送信するため、非常に高速な接続速度とデータ交換が可能です。 +ファイバーオプティック接続は、ガラスまたはプラスチックの繊維を使って光でデータを伝送し、非常に高速な接続速度とデータ交換を実現します。 ケーブル接続はケーブルテレビのインフラを利用しており、多くの地域で利用しやすいのが特徴です。 @@ -25,7 +25,7 @@ DSL接続は固定電話サービスのインフラを使います。このイ ダイヤルアップも電話回線を使いますが、接続中は電話の利用ができなくなる排他的な接続が必要です。これはかなり古い技術で、現在はほとんど使われていません。 -衛星接続は地球を周回する複数の衛星を使って世界中のさまざまなデバイスをつなぎます。最後に、これに似た形で、5Gホームインターネットプロバイダーは携帯電話の基地局のインフラを使ってオンライン接続を維持します。 +衛星接続は、地球を周回する複数の衛星を使って世界中のさまざまなデバイスをつなぎます。そして最後に、それに似た形で、5Gホームインターネットプロバイダーは携帯電話の基地局インフラを使ってオンラインを維持します。 これで、どのような種類のインターネットサービスプロバイダーや接続があるかの基本的な概要がわかりましたね! @@ -69,7 +69,7 @@ DSL接続は固定電話サービスのインフラを使います。このイ ## --text-- -光でデータを送信するためにガラスやプラスチックの繊維を使うインターネット接続の種類はどれですか? +どのタイプのインターネット接続が、ガラスまたはプラスチックの繊維を使って光でデータを伝送しますか? ## --answers-- @@ -89,7 +89,7 @@ DSL接続。 --- -光ファイバー接続。 +ファイバーオプティック接続。 --- @@ -121,7 +121,7 @@ DSL接続。 --- -地球を周回する複数の衛星を使う。 +彼らは地球を周回する複数の衛星を使っています。 ### --feedback-- diff --git a/curriculum/challenges/japanese/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab8573f32480f192aaae1.md b/curriculum/challenges/japanese/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab8573f32480f192aaae1.md index 05f719913fa..af7d71f4327 100644 --- a/curriculum/challenges/japanese/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab8573f32480f192aaae1.md +++ b/curriculum/challenges/japanese/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab8573f32480f192aaae1.md @@ -9,7 +9,7 @@ dashedName: what-are-the-different-types-of-tools-professional-developers-use プロの開発者は、生産性とコードの品質を高めるためにさまざまなツールを使っています。ここでは、その中でも特に分かりやすいものを含めて学んでいきましょう。 -まず最初に挙げられるのはコンピューターです。コンピューターは主要な開発環境であり、Windows、macOS、LinuxのいずれかのOSを搭載したデスクトップやノートパソコンが使われます。 +最初のツールはコンピューターそのものです。コンピューターは主要な開発環境です。Windows、macOS、LinuxのいずれかのOSを搭載した、重いデスクトップか携帯可能なノートパソコンである場合があります。 プロの開発者は、処理能力が高く、リソースを多く使う作業に対応できる十分なRAMを備えたコンピューターを選ぶことが多いです。 @@ -21,7 +21,7 @@ Visual Studio Code(VS Code)は基本的にはコードエディターです その他のコードエディターにはSublime Text、Atom、Notepad++、Bracketsがあります。 -コードエディターやIDEでコードを書くときは、変更履歴を管理する必要があります。その変更を追跡できるツールがバージョン管理システムです。 +コードエディターやIDEでコードを書くとき、そのコードに加えた変更を追跡する必要があります。その変更を追跡できるツールがバージョン管理システムです。 Gitは開発コミュニティで最も広く使われているバージョン管理システムです。 @@ -31,8 +31,8 @@ GitHub、GitLab、Bitbucketなどのプラットフォームは、Gitリポジ 代表的なパッケージマネージャーの例は以下の通りです: -* JavaScript用のNPM、Yarn、PNPM -* Python用のPIP +* JavaScript用のnpm、Yarn、pnpm +* Python用のpip * PHP用のComposer * Java用のMaven @@ -147,7 +147,7 @@ Git。 --- -バージョン管理システム +バージョン管理システム。 ### --feedback-- diff --git a/curriculum/challenges/japanese/blocks/lecture-understanding-error-handling-and-health-checks/69f3046f4c0e76cbdd24858e.md b/curriculum/challenges/japanese/blocks/lecture-understanding-error-handling-and-health-checks/69f3046f4c0e76cbdd24858e.md index 918455be453..1beb4892f49 100644 --- a/curriculum/challenges/japanese/blocks/lecture-understanding-error-handling-and-health-checks/69f3046f4c0e76cbdd24858e.md +++ b/curriculum/challenges/japanese/blocks/lecture-understanding-error-handling-and-health-checks/69f3046f4c0e76cbdd24858e.md @@ -34,7 +34,7 @@ app.use((err, req, res, next) => { Expressは4つのパラメータがあるため、これはエラーハンドラだと認識します。通常の`err`、`req`、`res`に加えて、新しい`next`があるからです。 -今後のレッスンで、エラー処理ミドルウェアがExpressのミドルウェアスタック全体でどのように機能するかをさらに学びます。 +前のレッスンで見たように、エラー処理ミドルウェアはより広範なExpressミドルウェアスタックに組み込まれています。 ## 非同期エラーの処理方法 @@ -251,6 +251,7 @@ Expressはすべてのルートの後にしかチェックしません。 Expressはすべてのルートの後にしかチェックしません。 + ## --video-solution-- 3 diff --git a/curriculum/challenges/japanese/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/6733affc29df1304e2c97e88.md b/curriculum/challenges/japanese/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/6733affc29df1304e2c97e88.md index bf7fa056a55..d141971966c 100644 --- a/curriculum/challenges/japanese/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/6733affc29df1304e2c97e88.md +++ b/curriculum/challenges/japanese/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/6733affc29df1304e2c97e88.md @@ -31,6 +31,8 @@ class MyClassName { 波括弧の中身はクラス本体と呼ばれます。ここにコンストラクタやメソッドが入ります。 +## コンストラクタの定義 + コンストラクタは、新しいオブジェクトがクラスから作成されるときに自動的に呼び出される特別なメソッドです。通常、オブジェクトのプロパティを初期化するために使われます。 この例では、`Dog`クラスにコンストラクタがあるのがわかります。 @@ -45,6 +47,8 @@ class Dog { ここで`this`キーワードは、`Dog`クラスの現在のインスタンスを指すために使われており、作成されるオブジェクトに`name`プロパティを代入しています。`this`キーワードについては今後のレッスンで詳しく学びます。 +## メソッドの定義 + コンストラクタの下にはメソッドと呼ばれるものを置けます。メソッドはクラス内で定義された関数で、動作や処理を実行します。クラスのインスタンスが実行できる振る舞いを定義するために使われます。 ここでは`bark`クラスに`Dog`というメソッドを追加する例です。 @@ -63,6 +67,8 @@ class Dog { `bark`メソッドが呼び出されると、渡された実際の名前とともにメッセージがコンソールに出力されます。もし`Dog`という名前で`"Buddy"`インスタンスを作成し、そのインスタンスで`bark()`メソッドを呼び出すと、コンソールに`"Buddy says woof!"`が表示されます。 +## クラスのインスタンス化 + クラスを定義したら、`new`キーワード、クラス名、引数を使ってクラスのインスタンスを作成できます。 この例では、`Dog`という名前で新しい`Gino`インスタンスを作成し、それを変数`dog`に代入しています。 @@ -73,13 +79,15 @@ const dog = new Dog("Gino"); コード内で`new Dog("Gino")`と書くと、新しいオブジェクトが作成され、指定された引数でコンストラクタが自動的に呼び出されます。 -その後、ドット記法を使ってこのプロパティにアクセスできます。次のコード行でそれが確認できます。 +## プロパティとメソッドへのアクセス + +次のコードの行のように、ドット記法を使って`name`プロパティにアクセスできます。 ```js console.log(dog.name); ``` -こちらが完全な例です。 +完全な例はこちらです。 :::interactive_editor @@ -127,6 +135,8 @@ dog.bark(); ::: +## クラス式の使用 + 前述のように、クラスはクラス式としても定義できます。これはクラスが匿名で変数に代入される形です。 先ほどの例をクラス式で書くと次のようになります。 diff --git a/curriculum/challenges/japanese/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/673403ca2bb16658309e3632.md b/curriculum/challenges/japanese/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/673403ca2bb16658309e3632.md index 3888987259e..2938da09964 100644 --- a/curriculum/challenges/japanese/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/673403ca2bb16658309e3632.md +++ b/curriculum/challenges/japanese/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/673403ca2bb16658309e3632.md @@ -1,6 +1,6 @@ --- id: 673403ca2bb16658309e3632 -title: "this キーワードはどのように機能するのか?" +title: "This キーワードはどのように機能するのか?" challengeType: 19 dashedName: how-does-the-this-keyword-work --- @@ -11,6 +11,8 @@ dashedName: how-does-the-this-keyword-work これらの設計図には、コード内で作成、アクセス、または変更されている特定のオブジェクトを指す一般的な方法が必要です。まさにそれが `this` キーワードの役割です。これはコードが実行されるコンテキストを指します。メソッド内で使うと、`this` の値はそのメソッドに関連付けられたオブジェクトへの参照になります。こうすることで、クラス内のオブジェクトのプロパティやメソッドにアクセスでき、異なるオブジェクトでメソッドを再利用できます。 +## コンストラクタ + 例えば、ここに `Dessert` クラスがあります。今回は `hasPeanuts` プロパティを定義しています。 ```js @@ -33,6 +35,8 @@ this.hasPeanuts = hasPeanuts; これはコンストラクタのコンテキストですが、他のメソッド内でも `this` キーワードを使うことができます。 +## メソッド + こちらは少し変更を加えた `Dessert` クラスです。今は `name` と `price` の2つのプロパティがあります。 ```js @@ -64,7 +68,7 @@ const brownie = new Dessert("Brownie", 5.99); brownie.showPrice(); ``` -こちらが完全な例です: +完全な例はこちらです。 :::interactive_editor @@ -91,10 +95,16 @@ console.log(brownie); これは `this` キーワードのおかげで、クラス内で現在のオブジェクトを一般的に指す方法を提供しています。これにより、異なるオブジェクトでメソッドを再利用できます。 +## 関数とアロー関数 + これはオブジェクトメソッドのコンテキストでの話ですが、`this` キーワードは単独の関数やアロー関数内でも値を持ちます。 +### 通常の関数 + 単独の関数内での値は通常、グローバルオブジェクト(非厳格モードの場合)または `undefined`(厳格モードの場合)を指します。 +### アロー関数 + アロー関数内の `this` キーワードの値は少し異なります。アロー関数は定義された外側のスコープから `this` の値を継承します。自身の `this` バインディングを作成しません。つまり、`this` の値はアロー関数が呼び出される場所や方法ではなく、アロー関数が定義されたコンテキストに依存します。これにより、アロー関数はコールバックやコンテキストの保持に便利です。 しかし、このために `this` の値はオブジェクトメソッド内で現在のオブジェクトを指さないので、アロー関数を使う際にはこれを覚えておく必要があります。 @@ -183,7 +193,7 @@ JavaScriptのメソッド内での `this` に関して正しい記述はどれ ## --answers-- -関数を定義するとき。 +関数を定義するときに使います。 ### --feedback-- diff --git a/curriculum/challenges/japanese/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5160.md b/curriculum/challenges/japanese/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5160.md index 1c836b00fe4..9f9bee15877 100644 --- a/curriculum/challenges/japanese/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5160.md +++ b/curriculum/challenges/japanese/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5160.md @@ -14,17 +14,17 @@ dashedName: whats-the-process-for-creating-web-standards 1. ## ニーズの特定 標準は摩擦から始まります。例えば、開発者が壁にぶつかる、ブラウザが同じ動作を互換性のない方法で実装する、あるいはプラットフォームがまだサポートしていない新しい機能などです。どこかの誰かが十分にフラストレーションを感じて、それを書き留めます。その誰かは開発者、大きな会社の製品ニーズを持つ人、あるいはブラウザチームのエンジニアかもしれません。この段階で重要なのは権威ではなく、問題が本物かどうかの証拠と質問、そして十分な人数がその問題に直面しているかどうかで、ウェブプラットフォームの注目に値するかどうかです。 -1. **提案と初期議論** - アイデアはGitHubのissue、短いドキュメント、あるいは問題を説明し可能な解決策を描いたエクスプレイナーとして非公式に書かれます。この段階の目標は完成した仕様を作ることではなく、問題が共感を呼ぶかどうかを確かめることです。他の開発者はそれを認識しますか?ブラウザベンダーは興味を持ちますか?明らかな解決策はありますか、それとも複数の競合案がありますか?TC39ではこの初期段階はStage 0とStage 1に対応します。W3Cでは、正式なワーキンググループが設立される前にコミュニティグループで非公式に行われることが多いです。WHATWGはコアリポジトリのオープンなGitHubディスカッションで扱います。場所は異なりますが、機能は同じです。 +1. ## 提案と初期の議論 + アイデアはGitHubのissueや短いドキュメント、問題を説明し可能な解決策を概説したエクスプレイナーを通じて非公式に書き起こされます。この段階の目的は完成した仕様を作ることではなく、その問題が共感を呼ぶかどうかを確かめることです。他の開発者はそれを認識していますか?ブラウザベンダーは興味を持っていますか?明らかな解決策はありますか、それとも複数の競合する案がありますか?TC39ではこの初期段階がStage 0とStage 1に対応します。W3Cでは、正式なワーキンググループが設立される前にコミュニティグループで非公式に行われることが多いです。WHATWGはコアリポジトリのオープンなGitHubディスカッションを通じてこれを扱います。場所は異なりますが、機能は同じです。 -1. **仕様の作成** - 提案が支持を得ると、誰かまたは小さなチームが実際の仕様、つまりスペックを書かなければなりません。スペックはブログ投稿やチュートリアルではなく、機能があらゆる状況でどのように動作すべきかを正確かつ正式に記述した文書です。エッジケース、エラー条件、既存機能との相互作用、セキュリティの影響などすべてを考慮し、書き留める必要があります。 +1. ## 仕様の作成 + 提案が支持を得ると、誰かまたは小さなチームが実際の仕様書、つまりspecを書かなければなりません。仕様書はブログ記事やチュートリアルではなく、機能があらゆる状況でどのように動作すべきかを正確かつ正式に記述した文書です。エッジケース、エラー条件、既存の機能との相互作用、セキュリティの影響などすべてを考慮し書き留める必要があります。 -1. **レビュー、異議申し立て、反復** - 草案は公開され、他のブラウザベンダーも含めてレビューされます。ここで実際の作業の大部分が行われます。異議が出され、仕様は修正されます。主要なブラウザエンジンの1つが実装を拒否する機能は、技術的に優れていても標準になることはほとんどありません。この段階での合意形成には長い時間がかかることがあります。ベンダー間で設計の詳細を巡って何年も停滞する提案もあります。合意が得られないと明らかになれば、提案は完全に消滅します。 +1. ## レビュー、異議申し立て、反復 + 草案は公開され、他のブラウザベンダーによってレビューされます。ここで実際の作業の大部分が行われます。異議が出され、仕様は修正されます。主要なブラウザエンジンの1つが実装を拒否する機能は、技術的な価値があっても標準になることはほとんどありません。この段階での合意形成には長い時間がかかることがあります。ベンダー間で設計の詳細について交渉が続き、数年停滞する提案もあります。合意が得られないと明らかになれば、提案は完全に消滅します。 -1. **実装とテスト** - 仕様が十分に安定すると、ブラウザベンダーは実装を開始します。通常はまず機能フラグで始まり、既存ユーザーに影響を与えずにテストできます。実装中に仕様が予期していなかった問題が明らかになり、編集者に戻されて明確化されることがあります。共有テストスイートで各実装が同じ動作をするか検証します。Chrome、Firefox、Safariが同じテストに合格すれば仕様は機能しています。異なれば、仕様が不明瞭か、実装のどれかにバグがあります。 +1. ## 実装とテスト + 仕様が十分に安定すると、ブラウザベンダーは実装を開始します。通常はまず機能フラグから始め、既存のユーザーに影響を与えずにテストできるようにします。実装中に仕様が予期していなかった問題が明らかになり、それが編集者に戻されて明確化されることがあります。共有のテストスイートで、すべての実装が同じように動作するか検証します。Chrome、Firefox、Safariがすべて同じテストに合格すれば仕様は機能しています。もし結果が異なれば、仕様が不明瞭か、実装のどれかにバグがあります。 1. ## 最終化 複数の独立した実装が存在し、テストに合格し、コミュニティが満足すると標準は最終化されます。W3CではこれがRecommendationのステータスを得ることを意味します。TC39ではStage 4に到達し、その後の年次ECMAScriptリリースに機能が含まれます。WHATWGには単一の最終化の瞬間はなく、リビングスタンダードが現在の合意を反映し継続的に更新されます。このプロセス全体は、小さく論争のない追加なら数か月、複雑または政治的に難しいものなら10年以上かかることもあります。例えばCSS Gridは2011年に最初に提案され、すべての主要ブラウザで実装されるまで2017年までかかりました。良いアイデアと安定した普遍的にサポートされる標準の間のギャップこそが、オープンウェブの多くの作業が静かに行われる場所です。 @@ -109,7 +109,7 @@ dashedName: whats-the-process-for-creating-web-standards ## --answers-- -書かれた仕様の代わりに使うため。 +文書化された仕様の代わりに使うこと。 ### --feedback-- @@ -121,7 +121,7 @@ Chrome、Firefox、Safariが同じ動作をすることを保証するものに --- -マーケティング目的でブラウザの性能をランク付けするため。 +マーケティング目的でブラウザのパフォーマンスをランク付けすること。 ### --feedback-- diff --git a/curriculum/challenges/japanese/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5161.md b/curriculum/challenges/japanese/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5161.md index 271a457061b..fd52610a998 100644 --- a/curriculum/challenges/japanese/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5161.md +++ b/curriculum/challenges/japanese/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5161.md @@ -13,23 +13,23 @@ dashedName: what-does-the-lifecycle-of-web-standards-features-look-like このプロセスをルールブックと考え、ライフサイクルは実際にゲームをプレイするときに起こることだと思ってください。 -1. **提案** - すべての機能は、誰かが問題を真剣に書き留めたことから始まります。開発者、ブラウザエンジニア、または企業が、ウェブで現在できないこととその理由を説明するGitHubのissueや解説を提出します。この段階ではアイデアはまだ曖昧で、答えよりも疑問のほうが多いです。目的は、他に同じ問題を感じている人がいるかどうかを確認することだけです。 +1. ## 提案 + すべての機能は、誰かが問題を真剣に書き留めたことから始まります。開発者、ブラウザーエンジニア、または企業が、ウェブで現在できないこととその理由を説明するGitHubのissueや解説を提出します。この段階ではアイデアはまだ曖昧で、答えよりも疑問のほうが多いです。目的は単に他の誰かも同じ問題を認識しているかどうかを確認することです。 -1. **インキュベーション** - 提案が共感を得ると、オープンな議論と初期設計の期間に入ります。競合するアプローチが描かれ、ユースケースが集められ、コミュニティがそのアイデアをストレステストします。多くの提案はここで消えます。問題があまりにもニッチすぎたり、誰も満足できる解決策が見つからなかったりするためです。生き残ったものは、より明確な形を持ち、少なくともいくつかのブラウザベンダーの関心を得ています。 +1. ## インキュベーション + 提案が共感を得ると、オープンな議論と初期設計の期間に入ります。競合するアプローチがスケッチされ、ユースケースが集められ、コミュニティがそのアイデアをストレステストします。多くの提案はここで消えます。問題があまりにもニッチだったり、誰も満足できる解決策が見つからなかったりするためです。生き残ったものは、より明確な形を持ち、少なくともいくつかのブラウザベンダーの関心を得ています。 -1. **仕様化** - 生き残った提案は正式な仕様として書き起こされます。すべてのエッジケース、エラー条件、既存の機能との相互作用が明確に定義されなければなりません。ここで良いアイデアが現実に直面します。あいまいな概念は、2人の独立したエンジニアが同じように読んで実装できる正確なルールに変わらなければなりません。 +1. ## 仕様 + 生き残った提案は正式な仕様として書き起こされます。すべてのエッジケース、エラー条件、既存の機能との相互作用が明確に定義されなければなりません。ここが良いアイデアが現実に直面するポイントです。あいまいな概念は、2人の独立したエンジニアが同じように読んで実装できる正確なルールに変わらなければなりません。 -1. **相互運用性テスト** - 機能が安定と見なされる前に、すべてのブラウザで同じ動作をしなければなりません。W3C Web Platform Testsスイートはこれを検証する主なツールです。これはChrome、Firefox、Safariなどが自分たちの実装に対して実行する共通のテスト群です。結果が異なる場合は、仕様があいまいか、どこかにバグがあることを意味します。どちらも解決されなければ機能は先に進めません。 +1. ## 相互運用性テスト + 機能が安定と見なされる前に、すべてのブラウザで同じ動作をする必要があります。W3C Web Platform Testsスイートはこれを検証する主要なツールです。これはChrome、Firefox、Safariなどがそれぞれの実装に対して実行する共通のテスト群です。結果が異なる場合は、仕様があいまいか、どこかにバグがあることを意味します。どちらも解決されなければ機能は先に進めません。 -1. **最終化** - 複数の独立した実装がテストに合格すると、機能は最終化されます。W3Cでは勧告、TC39ではステージ4、WHATWGのリビングスタンダードでは安定版エントリーとなります。フラグが外され、機能がユーザーに提供されます。この時点で、それは基盤となるウェブプラットフォームの一部となり、すべての開発者が永続的に頼れるものになります。 +1. ## 最終化 + 複数の独立した実装がテストに合格すると、機能は最終化されます。W3Cでは推奨となり、TC39ではステージ4となり、WHATWGのリビングスタンダードに安定したエントリーとして加わります。フラグが外され、機能がユーザーに提供されます。この時点で、すべての開発者が永続的に頼れるベースラインのウェブプラットフォームの一部になります。 -1. **廃止** - すべての標準がうまく年を重ねるわけではありません。より良い機能に取って代わられたり、当時は明らかでなかったセキュリティやプライバシーの問題が判明したりします。機能を廃止する必要がある場合、正式に廃止されます。つまり、サポートはされますが、開発者は使うのをやめるべきとマークされます。最終的には仕様から削除されます。ブラウザからの削除はゆっくり慎重に行われます。なぜならウェブの核心的な約束は古いページが動き続けることだからです。廃止された機能は、後方互換性の義務のために何十年もブラウザに残ることがあります。 +1. ## 非推奨 + すべての標準がうまく年を重ねるわけではありません。より良い機能に取って代わられたり、当時は明らかでなかったセキュリティやプライバシーの問題が判明したりします。機能を廃止する必要がある場合、正式に非推奨となります。つまり、サポートはされますが、開発者が使うのをやめるべきものとしてマークされます。最終的には仕様から削除されます。ブラウザからの削除はゆっくり慎重に行われます。なぜならウェブの核心的な約束は古いページが動き続けることだからです。非推奨の機能は後方互換性の義務のために何十年もブラウザに残ることがあります。 # --questions-- @@ -83,7 +83,7 @@ Chrome、Firefox、Safariがすべて同じ動作をするかを検証するも --- -仕様書の代わりに使うため。 +文書化された仕様の代わりに使うこと。 ### --feedback-- diff --git a/curriculum/challenges/japanese/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5162.md b/curriculum/challenges/japanese/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5162.md index 7b56deaf75c..5301c0e280d 100644 --- a/curriculum/challenges/japanese/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5162.md +++ b/curriculum/challenges/japanese/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5162.md @@ -9,26 +9,26 @@ dashedName: what-are-the-key-principles-that-web-standards-are-built-on ウェブ標準は単なる技術文書ではなく、ウェブがどうあるべきか、誰のためにあるべきかという価値観を反映しています。これらの原則を理解することで、ウェブの仕組みだけでなく、なぜそのように作られたのかも見えてきます。では、その原則について説明しましょう。 -1. **オープンネス** - ウェブ標準はオープンに開発され、ロイヤリティフリーで実装されます。誰でも仕様を読むことができ、誰でもブラウザを作成でき、どの企業も標準を実装するためのライセンス料を請求できません。このオープンネスこそが、ウェブを独自プラットフォームと区別し、小規模なチームがゲートキーパーの許可を得ることなく何十億もの人々に届くツールを作れる理由です。 +1. ## オープンネス + ウェブ標準はオープンに開発され、ロイヤリティフリーで実装されます。誰でも仕様を読むことができ、誰でもブラウザーを作ることができ、標準を実装するために企業がライセンス料を請求することはできません。このオープンネスこそがウェブを独自プラットフォームと区別し、小規模なチームがゲートキーパーの許可を得ることなく何十億もの人々に届くツールを作れる理由です。 -1. **アクセシビリティ** - ウェブは能力に関係なく誰でも使えるように設計されています。アクセシビリティはウェブ標準の付加機能ではなく、HTML、CSS、ブラウザの動作設計に組み込まれています。W3CのWCAGガイドラインは、実際にアクセシブルであることの正式な基準を定めています。スクリーンリーダー、キーボードナビゲーション、支援技術を使う人にとって障壁を作る機能は、倫理的な問題だけでなく設計上の欠陥とみなされます。 +1. ## アクセシビリティ + ウェブは能力に関係なく誰でも使えるように設計されています。アクセシビリティはウェブ標準への追加機能ではなく、HTML、CSS、ブラウザーの動作設計に組み込まれています。W3CのWCAGガイドラインは、実際にアクセシブルであることの正式な基準を定めています。スクリーンリーダー、キーボードナビゲーション、支援技術を使う人に障壁を作る機能は、倫理的な問題だけでなく設計上の欠陥と見なされます。 -1. **相互運用性** - 最も基本的な原則は、ウェブがどこでも同じように動作すべきだということです。標準に準拠して作られたページは、Chrome、Firefox、Safari、そしてWindows、macOS、Linux、Android、iOSのどこでも同じように動作します。相互運用性がなければ、ウェブはブラウザごとに異なる体験の集合体になり、開発者は同じものを何度も書かなければなりません。すべての標準は、そのような事態を防ぐために存在しています。 +1. ## 相互運用性 + 最も基本的な原則は、ウェブがどこでも同じように動作するべきだということです。標準に沿って作られたページは、Chrome、Firefox、Safari、そしてWindows、macOS、Linux、Android、iOSのどこでも同じように動作します。相互運用性がなければ、ウェブはブラウザーごとに異なる体験の集合体になり、開発者は同じものを何度も書かなければなりません。すべての標準は、そのような事態を防ぐために存在しています。 -1. **後方互換性** - ウェブは古いものを壊さないことにほぼ絶対的なコミットメントを持っています。1999年に書かれたページは現代のブラウザでも表示されるべきであり、標準化団体は新機能を設計する際にこの義務を真剣に受け止めています。だからこそ、新しい機能は既存のものを置き換えるのではなく上に重ねられます。この制約は時にデザイナーを悩ませますが、ウェブが独自に耐久性のあるプラットフォームである理由でもあります。 +1. ## 後方互換性 + ウェブは古いものを壊さないことにほぼ絶対的なコミットメントを持っています。1999年に書かれたページでも最新のブラウザーで表示されるべきであり、標準化団体は新機能を設計する際にこの義務を真剣に受け止めています。だからこそ新しい機能は既存のものを置き換えるのではなく上に重ねられます。この制約は時にデザイナーを苛立たせますが、ウェブを独特に耐久性のあるプラットフォームにしている理由でもあります。 -1. **プライバシーとセキュリティ** - 現代の標準はリリース前にプライバシーとセキュリティの影響をレビューされます。ユーザーデータを公開したり追跡を可能にする新しいAPIは、標準化プロセスで厳しい審査を受けます。プラットフォームはデフォルトでユーザーを保護すべきであり、開発者の利便性がユーザーの安全を犠牲にしてはならないという原則です。 +1. ## プライバシーとセキュリティ + 最新の標準はリリース前にプライバシーとセキュリティの影響をレビューされます。ユーザーデータを公開したり追跡を可能にする新しいAPIは、標準化プロセスで厳しい審査を受けます。プラットフォームはデフォルトでユーザーを保護すべきであり、開発者の利便性がユーザーの安全を犠牲にしてはならないというのが原則です。 -1. **レイヤリング** - ウェブは明確に区分された構成可能なレイヤーで構築されています:構造のためのHTML、見た目のためのCSS、動作のためのJavaScript。標準はこれらの境界を尊重し、崩さないように設計されています。よくレイヤリングされた機能は段階的に採用できます。JavaScriptを使わないページも動作し、新しいCSSプロパティをサポートしないブラウザでも合理的にレンダリングされます。この関心の分離がウェブの強靭さを支えています。 +1. ## レイヤリング + ウェブは構造のためのHTML、見た目のためのCSS、動作のためのJavaScriptという明確で組み合わせ可能なレイヤーで構成されています。標準はこれらの境界を尊重し、崩さないように設計されています。よくレイヤリングされた機能は段階的に採用できます。JavaScriptを使わないページも動作し、新しいCSSプロパティをサポートしないブラウザーでも合理的にレンダリングされます。この関心の分離がウェブの強靭さを支えています。 -1. **プログレッシブエンハンスメント** - レイヤリングに密接に関連する考え方で、ウェブは誰にでも動作し、より高機能なブラウザやデバイスを持つユーザーにはより良くなるべきだということです。標準機能はサポートされていない場合でも完全に壊れるのではなく、グレースフルに劣化します。この原則は新しいCSSプロパティの仕様やJavaScript APIの欠落機能の扱い、そして標準化団体が世界中でまだ広く使われている古いブラウザと最新ブラウザのギャップを考える際に形作られています。 +1. ## プログレッシブエンハンスメント + レイヤリングに密接に関連するのが、ウェブは誰にでも動作し、より高機能なブラウザーやデバイスを持つ人にはより良くなるべきだという考え方です。標準機能はサポートされていない場合でも完全に壊れるのではなく、段階的に劣化すべきです。この原則は新しいCSSプロパティの仕様やJavaScript APIの欠落機能の扱い、そして標準化団体が最新ブラウザーと世界中でまだ広く使われている古いブラウザーのギャップをどう考えるかに影響を与えています。 # --questions-- diff --git a/curriculum/challenges/japanese/blocks/lecture-user-interface-design-fundamentals/672baa97f2990e6631d522e7.md b/curriculum/challenges/japanese/blocks/lecture-user-interface-design-fundamentals/672baa97f2990e6631d522e7.md index 24b09fc2873..7ec487e66af 100644 --- a/curriculum/challenges/japanese/blocks/lecture-user-interface-design-fundamentals/672baa97f2990e6631d522e7.md +++ b/curriculum/challenges/japanese/blocks/lecture-user-interface-design-fundamentals/672baa97f2990e6631d522e7.md @@ -7,7 +7,9 @@ dashedName: how-do-you-create-good-background-and-foreground-contrast-in-your-de # --interactive-- -**注意**: いくつかのインタラクティブな例では、まだ学んでいないCSSが使われている場合があります。コードのすべてを理解しようと心配しないでください。これらの例の目的は、デザインの概念をプレビューで示し、仕組みをよりよく理解してもらうことです。 +**注意**: いくつかのインタラクティブな例では、まだ学習していないCSSが使われている場合があります。コードのすべてを理解しようと心配しないでください。これらの例の目的は、デザインの概念をプレビューで示し、仕組みをよりよく理解してもらうことです。 + +## コントラストの理解 まず、コントラストに慣れておく必要があります。コントラストとは、2つの色の違い、つまり区別しやすさのことです。 @@ -53,6 +55,8 @@ dashedName: how-do-you-create-good-background-and-foreground-contrast-in-your-de ::: +### テキストへのコントラストの適用 + もちろん、これらの例ではレイアウトによって区別がわかりやすくなっているかもしれません。しかし、これらの色をテキストに適用したらどうでしょう?白い背景に黒いテキストの高コントラストと、青い背景に紫のテキストの低コントラストがあります。 :::interactive_editor @@ -96,6 +100,8 @@ dashedName: how-do-you-create-good-background-and-foreground-contrast-in-your-de ::: +### WCAGのコントラスト基準 + では、「十分に良い」コントラストはどうやって決めるのでしょうか?テキストの見た目だけで判断できません。ユーザーごとに体験が異なるからです。幸い、Webコンテンツアクセシビリティガイドライン(WCAG)が基準を提供しています。 コントラスト比が4.5:1のテキストはAA基準とされ、ほとんどのユーザーにアクセス可能な最低限の基準です。コントラスト比が7:1のテキストはAAA基準とされ、最高レベルのアクセシビリティを保証します。 @@ -141,6 +147,8 @@ dashedName: how-do-you-create-good-background-and-foreground-contrast-in-your-de ::: +### 高コントラスト比と低コントラスト比の比較 + 2つの色のコントラスト比をチェックできるウェブサイトはいくつかありますが、ほとんどのブラウザでは開発者ツールで直接確認できます。 コントラスト比の概念をよりよく理解するために、いくつかの例を見てみましょう。 @@ -221,8 +229,12 @@ dashedName: how-do-you-create-good-background-and-foreground-contrast-in-your-de この例のコントラスト比は1.48:1で、AA基準すら満たしていません。 +## 色の特性の調整 + どうすれば改善できるでしょうか?コントラスト比に影響する要素は3つあります。 +### 色相の調整 + 1つ目は色相(ヒュー)で、赤、青、オレンジなどの色の種類を表します。青から離れた色相に変えてみましょう。ここでは赤を使います。 :::interactive_editor @@ -267,6 +279,8 @@ dashedName: how-do-you-create-good-background-and-foreground-contrast-in-your-de ::: +### 彩度の調整 + 残念ながら、この変更でコントラスト比は1.49:1にしかなりません。次に彩度、つまり色の「量」を変える必要があります。テキストの赤の量を増やしましょう。これで3.54:1のコントラスト比となり、目標にかなり近づきました。 :::interactive_editor @@ -325,6 +339,8 @@ dashedName: how-do-you-create-good-background-and-foreground-contrast-in-your-de ::: +### 明度の調整 + しかし、最後の値である明度を変えることでさらに近づけることができます。明度は色に含まれる白の量を表します。 赤の明度を下げましょう。今は薄い青の背景に対してずっと暗い赤があり、コントラスト比は10.34:1になりました。 @@ -479,7 +495,7 @@ Webコンテンツアクセシビリティガイドライン(WCAG)による ## --answers-- -色相(ヒュー) +色相 ### --feedback-- diff --git a/curriculum/challenges/japanese/blocks/lecture-what-is-css/672acc100d59d24da7b4e09c.md b/curriculum/challenges/japanese/blocks/lecture-what-is-css/672acc100d59d24da7b4e09c.md index c30e3412196..f2ba660e8a7 100644 --- a/curriculum/challenges/japanese/blocks/lecture-what-is-css/672acc100d59d24da7b4e09c.md +++ b/curriculum/challenges/japanese/blocks/lecture-what-is-css/672acc100d59d24da7b4e09c.md @@ -7,10 +7,14 @@ dashedName: what-are-the-different-types-of-css-combinators # --interactive-- +## CSSコンビネーター + CSSのコンビネーターは、CSSのセレクター間の関係を定義するために使われます。これにより、他の要素との関係に基づいて要素を選択でき、より正確で効率的なスタイリングが可能になります。 ここでは、主なCSSコンビネーターとその使い方について説明します。まずは子孫コンビネーターから始めましょう。 +### 子孫コンビネーター + 子孫要素コンビネーターは、2番目のセレクターにマッチする要素が、1番目のセレクターにマッチする祖先要素の中にネストされている場合に、その要素をターゲットにするために使います。祖先要素は親要素、祖父母要素、またはドキュメントツリーのさらに上位の祖先要素である場合があります。 この仕組みを理解するために、例を見てみましょう。 @@ -42,6 +46,8 @@ figure img { もし`figure`要素の中に複数の画像があれば、子孫コンビネーターを使うことで、それぞれの画像に黒の実線ボーダーを適用するのに適しています。 +### 子コンビネーター + 次に紹介するのは子コンビネーターです。 CSSの子コンビネーター(`>`)は、指定した親要素の直接の子要素だけを選択するために使われます。 @@ -102,6 +108,8 @@ CSSの子コンビネーター(`>`)は、指定した親要素の直接の 他の2つの段落要素は`div`要素の中にネストされているため、`container`クラスの直接の子とはみなされず、青色のテキストカラーは適用されません。 +### 隣接兄弟コンビネーター + 次に紹介する一般的なコンビネーターは隣接兄弟コンビネーターです。 CSSの隣接兄弟コンビネーター(`+`)は、指定した兄弟要素の直後に続く要素を選択します。このコンビネーターは、ある要素のすぐ後に続く要素にスタイルを適用したい場合に便利で、兄弟要素の位置に基づいたターゲットスタイリングが可能です。 @@ -150,6 +158,8 @@ img + figcaption { この例では、隣接兄弟コンビネーター(`+`)が`figcaption`要素の直後に続く`img`要素を選択しています。適用されたCSSルールは`4px solid black border`の周りに`figcaption`を追加します。 +### 後続兄弟コンビネーター + もう一つの一般的なコンビネーターは後続兄弟コンビネーターです。 CSSの後続兄弟コンビネーター(`~`)は、指定した要素の後に続くすべての兄弟要素を選択します。 @@ -202,6 +212,8 @@ h2 ~ p { 後続兄弟コンビネーター(`~`)は、`h2`要素の後に現れるすべての段落兄弟要素をターゲットにします。直後の兄弟であるかどうかは問いません。 +## CSSコンビネーターが重要な理由 + まとめると、さまざまなCSSコンビネーターを理解し使いこなすことで、HTML要素に正確なスタイルを適用でき、デザインのコントロールと柔軟性が向上します。 これらのセレクターをマスターすれば、より洗練されターゲットを絞ったスタイルルールを作成でき、ウェブページの見た目と機能性の両方を改善できます。 diff --git a/curriculum/challenges/japanese/blocks/lecture-working-with-code-editors-and-ides/672d26269456511aa3db614d.md b/curriculum/challenges/japanese/blocks/lecture-working-with-code-editors-and-ides/672d26269456511aa3db614d.md index 1e420f228a0..fbc674f966b 100644 --- a/curriculum/challenges/japanese/blocks/lecture-working-with-code-editors-and-ides/672d26269456511aa3db614d.md +++ b/curriculum/challenges/japanese/blocks/lecture-working-with-code-editors-and-ides/672d26269456511aa3db614d.md @@ -7,23 +7,23 @@ dashedName: what-is-a-code-editor-and-ide # --description-- -これらは同じもののように思えるかもしれませんが、実は少し違います。コードエディターとは、コードファイルを編集できるアプリケーションのことです。IDE(統合開発環境)は、コードを編集しながらコンパイル、実行、デバッグができるフル機能のアプリケーションです。 +これらは同じものだと思うかもしれませんが、そうではありません。コードエディターとは、コードファイルを編集できるアプリケーションのことです。IDE(統合開発環境)は、コードを編集しながらコンパイル、実行、デバッグができるフル機能のアプリケーションです。 -いくつか例を挙げるとわかりやすいかもしれません。 +いくつか例を挙げてみましょう。 まず、人気のあるIDEをいくつか見てみましょう。Visual StudioはMicrosoftの統合開発環境で、さまざまなプラットフォーム向けのアプリケーションを構築、デバッグ、デプロイするための包括的なツール群を提供します。 -もう一つのIDEはXcodeです。XcodeはAppleの統合開発環境で、macOS、iOS、watchOS、tvOS向けのアプリケーションを作成、コーディング、デバッグするために設計されています。 +もう一つのIDEはXcodeです。XcodeはAppleによる統合開発環境で、macOS、iOS、watchOS、tvOS向けのアプリケーションを作成、コーディング、デバッグするために設計されています。 -さらにもう一つはAndroid Studioです。Android StudioはGoogleの統合開発環境で、Androidアプリケーションの構築、デバッグ、テストに特化しています。 +Googleが開発したAndroid Studioは、Androidアプリケーションの構築、デバッグ、テストに特化した統合開発環境です。 これらはIDEのほんの一例です。次に、人気のあるコードエディターをいくつか見てみましょう。 Visual Studio CodeはMicrosoftの軽量でオープンソースのコードエディターで、多くのプログラミング言語をサポートし、拡張機能を通じてデバッグ、構文ハイライト、バージョン管理などの機能を提供します。 -もう一つの人気エディターはSublime Textです。Sublime Textは高速で多機能なテキストエディターで、洗練されたインターフェースと強力な機能を持ち、カスタマイズ可能な構文ハイライトやプラグインを通じて多くのプログラミング言語をサポートします。 +高速で多用途な編集体験を求めるなら、Sublime Textは洗練されたインターフェースとカスタマイズ可能な構文ハイライトやプラグインを通じて幅広いプログラミング言語をサポートしています。 -さらにもう一つはNotepad++です。これはWindows向けの無料でオープンソースのテキストおよびソースコードエディターで、構文ハイライト、コード折りたたみ、生産性とカスタマイズを高めるさまざまなプラグインを提供します。 +WindowsユーザーはNotepad++も利用できます。これは無料のオープンソースのテキストおよびソースコードエディターで、構文ハイライト、コード折りたたみ、生産性とカスタマイズを高めるさまざまなプラグインを提供しています。 コードエディターは主にファイルのテキスト内容にフォーカスしているのに対し、IDEはコードを管理するためのさまざまなツールを公開していることに気づいたかもしれません。 @@ -35,11 +35,11 @@ Visual Studio CodeはMicrosoftの軽量でオープンソースのコードエ Replitはオンラインプラットフォームで、ユーザーがウェブブラウザーから直接さまざまなプログラミング言語でコードを書き、実行し、共有できる共同作業環境を提供します。 -もう一つの人気のクラウドベースエディターはGitHub Codespacesです。これはGitHubから直接完全に設定されたコードエディターと開発ツールに即座にアクセスできるクラウドベースの開発環境で、シームレスなコーディングと共同作業を可能にします。 +もう一つの人気のあるクラウドベースのエディターはGitHub Codespacesです。これはGitHubから直接、完全に構成されたコードエディターと開発ツールに即座にアクセスできるクラウドベースの開発環境で、シームレスなコーディングとコラボレーションを可能にします。 -さらにもう一つはOnaです。OnaはGitHubやGitLabと統合されたクラウドベースの開発環境で、ブラウザーから直接コーディング、構築、デバッグができる即時カスタマイズ可能な作業スペースを提供します。 +OnaはGitHubやGitLabと連携し、ブラウザから直接コーディング、ビルド、デバッグのための即時かつカスタマイズ可能な作業スペースを提供します。 -他にも多くの選択肢があります。Visual Studio Codeのように非常に拡張性が高く、複数の異なるプロジェクトタイプや言語に対応できるものもあります。ほかの選択肢は特定の言語やプロジェクトタイプの部分集合に特化している場合もあります。 +他にも多くの選択肢があります。Visual Studio Codeのように非常に拡張性が高く、多くのプロジェクトタイプや言語に対応できるオプションもあれば、特定の言語やプロジェクトタイプの部分集合に特化したオプションもあります。 特定のプロジェクトに応じて使うアプリケーションが異なる場合があります。自分のニーズに合うものを探してみてください。 diff --git a/curriculum/challenges/japanese/blocks/lecture-working-with-code-editors-and-ides/672d45583fd75a504136fbbb.md b/curriculum/challenges/japanese/blocks/lecture-working-with-code-editors-and-ides/672d45583fd75a504136fbbb.md index 791bcaf5fcc..6cb45ea36e7 100644 --- a/curriculum/challenges/japanese/blocks/lecture-working-with-code-editors-and-ides/672d45583fd75a504136fbbb.md +++ b/curriculum/challenges/japanese/blocks/lecture-working-with-code-editors-and-ides/672d45583fd75a504136fbbb.md @@ -7,11 +7,11 @@ dashedName: how-to-install-visual-studio-code-onto-your-computer # --description-- -VS Code をインストールするには、まずご自身のオペレーティングシステムに合ったインストーラーを入手するために公式ウェブサイトを訪問してください。Visual Studio のウェブサイトではなく、必ず VS Code のウェブサイトにアクセスしてください。 +VS Code をインストールするには、まずお使いのオペレーティングシステムに合ったインストーラーを入手するために VS Code のウェブサイトを訪問してください。Visual Studio のウェブサイトではなく、必ず VS Code のウェブサイトにアクセスしてください。 -Windows では、EXE インストーラーをダウンロードできます。ダウンロード後、そのファイルを実行するとセットアップウィザードがインストール手順を案内します。 +Windows では、EXE インストーラーをダウンロードできます。ダウンロードしたら、そのファイルを実行するとセットアップウィザードがインストール手順を案内します。 -Mac では、実行可能な `.app` を含む zip アーカイブをダウンロードできます。また、Homebrew を使って VS Code をインストールすることも可能です。 +Mac では、実行可能な `.app` を含む `.zip` アーカイブをダウンロードできます。また、Homebrew を使って VS Code をインストールすることもできます。 Mac の Terminal アプリを開き、次のコマンドを実行してください。 diff --git a/curriculum/challenges/japanese/blocks/lecture-working-with-code-editors-and-ides/672d45651d83b450801efb3a.md b/curriculum/challenges/japanese/blocks/lecture-working-with-code-editors-and-ides/672d45651d83b450801efb3a.md index 015741df412..cb78bca9a24 100644 --- a/curriculum/challenges/japanese/blocks/lecture-working-with-code-editors-and-ides/672d45651d83b450801efb3a.md +++ b/curriculum/challenges/japanese/blocks/lecture-working-with-code-editors-and-ides/672d45651d83b450801efb3a.md @@ -9,21 +9,21 @@ dashedName: how-to-create-a-project-and-run-your-code-locally-in-vs-code 始めるにあたって、VS Codeではプロジェクトを「ワークスペース」と見なしていることを知っておく必要があります。ワークスペースとは、VS Codeで開いたディレクトリのことです。 -まず、新しいプロジェクト用の新しいディレクトリを作成するために、コマンドラインインターフェースを使う必要があります。ディレクトリとはフォルダーの別名です。 +まず、コマンドラインインターフェースを使って新しいプロジェクト用の新しいディレクトリを作成する必要があります。ディレクトリはフォルダーの別名です。 -コマンドラインインターフェース、略してCLIは、テキストベースのコマンドを使ってオペレーティングシステムとやり取りするためのものです。これらのツールについては今後のレッスンで詳しく学びます。 +コマンドラインインターフェース、略してCLIは、テキストベースのコマンドを使ってオペレーティングシステムとやり取りできるツールです。これらのツールについては今後のレッスンでさらに学びます。 Windowsの場合は、コマンドプロンプトやPowerShellを使えます。Macの場合は、ターミナルアプリを開いてください。 -コマンドラインが開いたら、`cd ~` コマンドを入力してキーボードの `enter` を押し、ホームディレクトリに移動します。次に `mkdir my-project` コマンドを入力して `enter` を押します。`mkdir`、つまり「make directory」は新しいディレクトリを作成するためのコマンドです。その後、新しいディレクトリをVS Codeで開いてください。 +コマンドラインが開いたら、ホームディレクトリに移動してください。コマンドプロンプトでは `cd /d %USERPROFILE%` と入力してキーボードの `Enter` を押します。PowerShellやmacOSのターミナルでは `cd ~` と入力して `Enter` を押します。次に `mkdir my-project` コマンドを入力して `Enter` を押してください。`mkdir` は「make directory」の略で、新しいディレクトリを作成するコマンドです。その後、VS Codeで新しいディレクトリを開いてください。 -他にも新しいディレクトリを作成するグラフィカルな方法があります。 +VS Codeでディレクトリを開く他の方法もあります。 オペレーティングシステムによっては、ファイルエクスプローラーのコンテキストメニュー(右クリックメニュー)から直接VS Codeを開くオプションがあるかもしれません。または、VS Codeのアプリケーションをダブルクリックして開くこともできます。コマンドラインに慣れている場合は、`code /path/to/folder` コマンドを実行することもできます。 開くと、新しい空のワークスペースが表示されるはずです。 -新しいファイルを作成するには、左上の`File` メニューをクリックし、`New File...` を選択してください。次にファイル名を`index.html` として、`Save` をクリックします。 +新しいファイルを作成するには、左上の `File` メニューをクリックして `New File...` を選択してください。次にファイル名を `index.html` として `Save` をクリックします。 すると、エクスプローラータブに新しいファイルが表示されます。`index.html` ファイルにHTMLを追加してみましょう。 @@ -31,15 +31,15 @@ HTMLファイルを直接ブラウザで開きたくなるかもしれません 代わりに、HTMLファイルは適切なウェブサーバーの背後に置くべきです。これはコーディング初心者には難しく感じるかもしれませんが、実はVS Codeから簡単にできます。 -まず、マーケットプレイスで無料で入手できる_Live Server_拡張機能をインストールする必要があります。 +まず、マーケットプレイスで無料で入手できるLive Server拡張機能をインストールする必要があります。 -左下の拡張機能タブをクリックし、検索バーに`Live Server` と入力してください。 +左のサイドバーにある拡張機能タブをクリックし、検索バーに `Live Server` と入力してください。 -インストールが完了すると、ステータスバーに`Go live` ボタンが表示されます。HTMLファイルを開いた状態で、そのボタンをクリックしてください。 +インストールが完了すると、ステータスバーに `Go Live` ボタンが表示されます。HTMLファイルを開いた状態でそのボタンをクリックしてください。 -新しいページがブラウザの新しいタブで自動的に開くはずです。もし開かない場合は、直接`http://localhost:5500/` にアクセスしてください。 +新しいページがブラウザの新しいタブで自動的に開きます。もし開かない場合は、直接 `http://localhost:5500/` にアクセスしてください。 -おめでとうございます!これでVS Codeで自分のプロジェクトを設定し、ライブサーバーで変更を確認できるようになりました。 +おめでとうございます!これでVS Codeで自分のプロジェクトを設定し、Live Serverで変更を確認できるようになりました。 # --questions-- @@ -57,7 +57,7 @@ Visual Studio Codeは「ワークスペース」を何と考えていますか --- -VS Codeを開いたディレクトリ。 +VS Codeで開いたディレクトリです。 --- diff --git a/curriculum/challenges/japanese/blocks/lecture-working-with-code-editors-and-ides/672d456f4ac35950b300e93f.md b/curriculum/challenges/japanese/blocks/lecture-working-with-code-editors-and-ides/672d456f4ac35950b300e93f.md index 25663eba556..4a8b3cc5656 100644 --- a/curriculum/challenges/japanese/blocks/lecture-working-with-code-editors-and-ides/672d456f4ac35950b300e93f.md +++ b/curriculum/challenges/japanese/blocks/lecture-working-with-code-editors-and-ides/672d456f4ac35950b300e93f.md @@ -9,21 +9,21 @@ dashedName: what-are-several-useful-keyboard-shortcuts-for-maximizing-productivi 基本的なショートカットはすでにご存じかもしれませんが、これらはお使いのOSから引き継がれています。例えば、`Ctrl + S`で保存、`Ctrl + C`でコピー、`Ctrl + V`で貼り付けはVS Codeでも使えます。 -しかし、アプリケーション固有のショートカットもいくつかあり、生産性をさらに向上させることができます。これらのショートカットはOSによって異なる場合があることに注意してください。 +しかし、アプリケーション固有のショートカットもいくつかあり、生産性をさらに向上させることができます。これらのショートカットはオペレーティングシステムによって異なる場合があることに注意してください。 -例えば、`Shift + Alt + F`は現在開いているファイルに対して設定されたフォーマッター(JavaScriptプロジェクトならprettierなど)を実行します。 +例えば、`Shift + Alt + F` は現在開いているファイルに対して設定されたフォーマッター(JavaScriptのプロジェクトならPrettierなど)を実行します。 -また、`Ctrl + Shift + F`(Windows)や`Cmd + Shift + F`(Mac)でワークスペース内のすべてのファイルのテキスト内容を検索できます。さらに、`Ctrl + Shift + H`(Windows)や`Cmd + Shift + H`(Mac)で検索と置換を実行できます。 +ワークスペース内のすべてのファイルのテキスト内容を検索するには、`Ctrl + Shift + F`(Windows/Linux)または `Cmd + Shift + F`(macOS)を使います。置換を実行したい場合は、`Ctrl + Shift + H`(Windows/Linux)または `Cmd + Shift + H`(macOS)を使ってください。 -行を削除したい場合は、`Ctrl + Shift + K`(Windows)や`Cmd + Shift + K`(Mac)でその行を削除できます。 +行を削除したい場合は、`Ctrl + Shift + K`(Windows/Linux)または `Cmd + Shift + K`(macOS)で削除できます。 -コードを書くスペースをもっと確保したいなら、`Ctrl + B`(Windows)や`Cmd + B`(Mac)でファイルリストや拡張機能メニューがあるサイドバーを非表示にできます。 +コードの表示スペースを広げたいですか?`Ctrl + B`(Windows)または `Cmd + B`(Mac)で、ファイルリストや拡張機能メニューがあるサイドバーを非表示にできます。 -あるいは、コードが見づらい場合は、`Ctrl + plus`(Windows)や`Cmd + plus`(Mac)でエディターの拡大、`Ctrl + minus`(Windows)や`Cmd + minus`(Mac)で縮小ができます。 +コードが見づらい場合は、`Ctrl + Plus`(Windows)または `Cmd + Plus`(Mac)でエディターの拡大、`Ctrl + Minus`(Windows)または `Cmd + Minus`(Mac)で縮小ができます。 -VS Codeのもう一つの便利な機能は複数行編集で、複数の行に同時に変更を加えられます。例えば、`Ctrl + Alt + down`と`Ctrl + Alt + up`(Windows/Linux)、または`Option + Command + down`と`Option + Command + up`(Mac)で連続した行にカーソルを置けます。さらに、`Alt`(Windows/Linux)や`Option`(Mac)を押しながらクリックすると、必要な行に別々のカーソルを追加できます。カーソルが配置されると、入力や削除はすべての場所に同時に適用されるため、繰り返しのコード作業が大幅に効率化されます。 +VS Codeのもう一つ便利な機能は複数行編集で、複数の行にまたがって一度に変更できます。例えば、`Ctrl + Alt + Down` と `Ctrl + Alt + Up`(Windows/Linux)、または `Option + Cmd + Down` と `Option + Cmd + Up`(Mac)を使って連続した行にカーソルを置けます。また、`Alt`(Windows/Linux)または `Option`(Mac)を押しながらクリックすると、必要な場所の別々の行にカーソルを追加できます。カーソルが配置されると、入力や削除はすべての場所に同時に適用されるので、繰り返しのコード作業で大幅に時間を節約できます。 -最後に、これらのショートカットを忘れてしまった場合でも、`Ctrl + Shift + P`(Windows)や`Cmd + Shift + P`(Mac)でコマンドパレットを開き、必要なコマンドを選択できます。 +最後に、これらのショートカットを忘れてしまった場合でも、`Ctrl + Shift + P`(Windows/Linux)または `Cmd + Shift + P`(macOS)でコマンドパレットを開き、必要なコマンドを選択できます。 この知識と少しの練習で、VS Codeのパワーユーザーになる道が開けます。 diff --git a/curriculum/challenges/japanese/blocks/lecture-working-with-code-editors-and-ides/672d457bcdd8b350ec2b6254.md b/curriculum/challenges/japanese/blocks/lecture-working-with-code-editors-and-ides/672d457bcdd8b350ec2b6254.md index 09eb8550818..ecc56e0e54c 100644 --- a/curriculum/challenges/japanese/blocks/lecture-working-with-code-editors-and-ides/672d457bcdd8b350ec2b6254.md +++ b/curriculum/challenges/japanese/blocks/lecture-working-with-code-editors-and-ides/672d457bcdd8b350ec2b6254.md @@ -7,25 +7,25 @@ dashedName: what-are-some-good-vs-code-extensions-you-can-use-in-your-editor # --description-- -_Better Comments_ は特定のコードコメントに特別なハイライトを提供する拡張機能です。例えば、「TODO」コメントや質問や警告を示す構文を強調表示します。 +Better Commentsは、特定のコードコメントに特別なハイライトを提供する拡張機能です。例えば、「TODO」コメントや、質問や警告を示す構文を強調表示します。 -_Code Spell Checker_ はコード内のスペルミスを知らせてくれます。コードファイル向けに設計されているため、キャメルケースなども考慮します。 +Code Spell Checkerは、コード内のスペルミスを検出します。コードファイル向けに設計されているため、キャメルケースなども考慮します。 -_Error Lens_ はコード内のハイライトされたエラーを見逃さないように助けてくれます。VS Code がデフォルトで表示する下線に頼るのではなく、この拡張機能は行全体をハイライトし、エラーメッセージを表示します。 +Error Lensはコード内のエラーを見逃しにくくします。VS Codeがデフォルトで表示する下線に頼る代わりに、この拡張機能は行全体をハイライトし、エラーメッセージを表示します。 -_Indent Rainbow_ は異なるインデントレベルに色を付けます。VS Code のネイティブな括弧ペアの色分けと組み合わせると、コードがどのスコープにあるかを見分けるのに大いに役立ちます。 +Indent Rainbowは異なるインデントレベルに色を付けます。VS Codeのネイティブな括弧ペアの色分けと組み合わせることで、コードのスコープを識別しやすくなります。 -もっと実用的なものを探しているなら、_GitHub Copilot_ や _Tabnine_ のような AI アシスタントを検討してください。コードを書いている最中にインラインで提案をしてくれます。 +もっと実用的なものを探しているなら、GitHub CopilotやTabnineのようなAIアシスタントを検討してください。コードを書いている間にインラインで提案を提供してくれます。 -_VS Code Great Icons_ のようなアイコンパックは、ファイルツリーをよりすっきりさせ、一目でわかりやすくしてくれます。また、_Colorize_ のような拡張機能は CSS プロパティの値を理解するのに役立ちます。 +VS Code Great Iconsのようなアイコンパックは、ファイルツリーをより見やすく整理するのに役立ちます。また、Colorizeのような拡張機能はCSSプロパティの値を理解しやすくします。 -プロジェクトには言語固有の拡張機能も必要です。JavaScript を使っているなら、コードのリンティングとフォーマットに _ESLint_ と _Prettier_ を使うことをお勧めします。TypeScript を使っているなら、読みやすいメッセージのために _Pretty TypeScript Errors_ を使うかもしれません。 +プロジェクトには言語固有の拡張機能も必要です。JavaScriptを使っている場合は、コードのリントとフォーマットのためにESLintやPrettierを使うことが多いでしょう。TypeScriptを使っている場合は、メッセージを読みやすくするPretty TypeScript Errorsがお勧めです。 -最後に、エディターでちょっとした楽しみも持てます。_VS Code Pets_ はバグを潰している間に一緒にいてくれる設定可能なバーチャルペットを提供します。 +最後に、エディターで少し楽しむこともできます。VS Code Petsは、バグを潰している間に一緒にいてくれる設定可能なバーチャルペットを提供します。 -_Power Mode_ はコードを書いて「コンボ」が一定以上になると派手なエフェクトを作り出します。 +Power Modeは、コードを書いて一定の「コンボ」を達成すると派手なエフェクトを作り出します。 -_Discord Presence_ は作業中の内容を友達に見せることができます。 +Discord Presenceは、作業中の内容を友達に見せることができます。 他にもたくさんの拡張機能があります。拡張機能マーケットプレイスを自由に探索して、自分に合ったものを見つけてください。 @@ -33,7 +33,7 @@ _Discord Presence_ は作業中の内容を友達に見せることができま ## --text-- -VS Code の「Better Comments」拡張機能はどんな機能を提供していますか? +Better Comments拡張機能はVS Codeでどんな機能を提供しますか? ## --answers-- @@ -69,7 +69,7 @@ VS Code の「Better Comments」拡張機能はどんな機能を提供してい ## --text-- -コード内のハイライトされたエラーを行全体にエラーメッセージ付きで表示して見つけやすくする VS Code 拡張機能はどれですか? +どのVS Code拡張機能が、デフォルトの下線に頼る代わりに行全体をハイライトし、エラーメッセージをインラインで表示しますか? ## --answers-- @@ -105,7 +105,7 @@ VS Code のデフォルトの下線表示を超えてエラーの可視性を高 ## --text-- -「VS Code Pets」拡張機能のユニークな特徴は何ですか? +VS Code Pets拡張機能のユニークな機能は何ですか? ## --answers-- diff --git a/curriculum/challenges/japanese/blocks/lecture-working-with-css-flexbox/672aa7f7284b235f46f7d4e9.md b/curriculum/challenges/japanese/blocks/lecture-working-with-css-flexbox/672aa7f7284b235f46f7d4e9.md index ee723ed9394..bd5318e8e5d 100644 --- a/curriculum/challenges/japanese/blocks/lecture-working-with-css-flexbox/672aa7f7284b235f46f7d4e9.md +++ b/curriculum/challenges/japanese/blocks/lecture-working-with-css-flexbox/672aa7f7284b235f46f7d4e9.md @@ -319,7 +319,7 @@ flexboxが要素の配置や整列に使われることを考えてみてくだ ### --feedback-- -フレックスコンテナ内の要素の分配について考えてみてください。 +主軸と交差軸が互いにどのように配置されているかを考えてください。 --- @@ -327,7 +327,7 @@ flexboxが要素の配置や整列に使われることを考えてみてくだ ### --feedback-- -フレックスコンテナ内の要素の分配について考えてみてください。 +主軸と交差軸が互いにどのように配置されているかを考えてください。 --- @@ -339,7 +339,7 @@ flexboxが要素の配置や整列に使われることを考えてみてくだ ### --feedback-- -フレックスコンテナ内の要素の分配について考えてみてください。 +主軸と交差軸が互いにどのように配置されているかを考えてください。 ## --video-solution-- diff --git a/curriculum/challenges/japanese/blocks/lecture-working-with-css-flexbox/672bd658c0e190f674a5e057.md b/curriculum/challenges/japanese/blocks/lecture-working-with-css-flexbox/672bd658c0e190f674a5e057.md index cdbb6773e46..8bf7946d8da 100644 --- a/curriculum/challenges/japanese/blocks/lecture-working-with-css-flexbox/672bd658c0e190f674a5e057.md +++ b/curriculum/challenges/japanese/blocks/lecture-working-with-css-flexbox/672bd658c0e190f674a5e057.md @@ -7,11 +7,11 @@ dashedName: what-are-some-common-flex-properties # --interactive-- -フレックスプロパティは、フレックスコンテナに適用して子要素の配置を決定するためのプロパティです。ここでは、最もよく使われる `flex-wrap`、`justify-content`、`align-items` を紹介します。 +フレックスプロパティは、フレックスレイアウト内での要素の動作を制御します。コンテナレベルの配置からアイテムレベルの自己整列までカバーします。このレッスンでは、最もよく使われる `flex-wrap`、`flex-flow`、`justify-content`、`align-items`、`align-self` を取り上げます。 -まずは `flex-wrap` から始めましょう。このプロパティは、フレックスアイテムがフレックスコンテナ内で利用可能なスペースに合わせてどのように折り返されるかを決定します。`flex-wrap` は `nowrap`、`wrap`、`wrap-reverse` の3つの値を取ることができます。`nowrap` はデフォルト値で、フレックスアイテムは幅がコンテナの幅を超えても新しい行に折り返されません。 +`flex-wrap` から始めましょう。このプロパティは、フレックスアイテムがフレックスコンテナ内で利用可能なスペースに合わせてどのように折り返されるかを決定します。`flex-wrap` は `nowrap`、`wrap`、`wrap-reverse` の3つの値を取れます。`nowrap` はデフォルト値で、アイテムの幅がコンテナの幅を超えても新しい行に折り返されません。 -以下のコードでは、3つの `div` 要素があります。`width` に注目しましょう。赤いボーダーの `main` コンテナは `width` が `200px` に設定されており、その3つの子 `div` 要素の合計は `width` が `240px`(それぞれ `80px`)です。 +以下のコードには3つの`div`要素があります。`width`に注目しましょう。ボーダー付きの`main`コンテナは`width`が`200px`ですが、その3つの子`div`要素の合計の`width`は`240px`(それぞれ`80px`)です。 :::interactive_editor @@ -28,7 +28,7 @@ dashedName: what-are-some-common-flex-properties main { width: 200px; display: flex; - border: 2px solid red; + border: 2px solid #444; } div { @@ -51,7 +51,6 @@ div { ::: - `div` 要素の幅はコンテナの幅を超えていますが、デフォルトでは利用可能なスペースに合わせて縮小されます。もしコンテナの幅を超えたときに折り返したい場合は、フレックスコンテナに `flex-wrap: wrap` を設定してください。 :::interactive_editor @@ -70,7 +69,7 @@ main { width: 200px; display: flex; flex-wrap: wrap; - border: 2px solid red; + border: 2px solid #444; } div { @@ -109,9 +108,10 @@ div { ```css main { width: 200px; + height: 120px; display: flex; flex-flow: column wrap-reverse; - border: 2px solid red; + border: 2px solid #444; } div { @@ -151,7 +151,7 @@ div { main { display: flex; justify-content: flex-start; - border: 2px solid red; + border: 2px solid #444; } div { @@ -191,7 +191,7 @@ div { main { display: flex; justify-content: flex-end; - border: 2px solid red; + border: 2px solid #444; } div { @@ -231,7 +231,7 @@ div { main { display: flex; justify-content: center; - border: 2px solid red; + border: 2px solid #444; } div { @@ -254,7 +254,7 @@ div { ::: -主軸に沿って要素を均等に配置したい場合は `justify-content: space-between` を使います。必要に応じてフレックスアイテム間にスペースが追加されます。 +主軸に沿って要素を端にスペースを空けずに配置したい場合は、`justify-content: space-between` を使えます。最初のアイテムは主軸の開始位置に、最後のアイテムは主軸の終了位置に配置され、残りのスペースは隣接するアイテム間に均等に分配されます。 :::interactive_editor @@ -271,7 +271,7 @@ div { main { display: flex; justify-content: space-between; - border: 2px solid red; + border: 2px solid #444; } div { @@ -294,7 +294,7 @@ div { ::: -`justify-content: space-around` は主軸内でフレックスアイテムを均等に配置し、最初のアイテムの前と最後のアイテムの後にもスペースを追加します。この追加スペースは隣接するアイテム間のスペースの半分です。アイテムが1つだけの場合は中央に配置されます。 +`justify-content: space-around` は主軸に沿ってフレックスアイテムを均等に配置し、最初のアイテムの前と最後のアイテムの後にスペースを追加します。この追加スペースは隣接するアイテム間のスペースの半分です。アイテムが1つだけの場合は中央に配置されます。 :::interactive_editor @@ -311,7 +311,7 @@ div { main { display: flex; justify-content: space-around; - border: 2px solid red; + border: 2px solid #444; } div { @@ -334,8 +334,7 @@ div { ::: - -最後に `justify-content: space-evenly` があります。これは主軸に沿ってアイテムを均等に配置し、アイテム間のスペースと最初と最後の要素の前後のスペースがすべて同じになります。 +最後に、`justify-content: space-evenly` があります。これは主軸に沿ってアイテムを均等に配置し、アイテム間のスペースと最初と最後の要素の前後のスペースが完全に同じになります: :::interactive_editor @@ -352,7 +351,7 @@ div { main { display: flex; justify-content: space-evenly; - border: 2px solid red; + border: 2px solid #444; } div { @@ -390,10 +389,10 @@ div { ```css main { - height: 300px; display: flex; + height: 300px; align-items: center; - border: 2px solid red; + border: 2px solid #444; } div { @@ -431,10 +430,10 @@ div { ```css main { - height: 300px; display: flex; + height: 300px; align-items: flex-start; - border: 2px solid red; + border: 2px solid #444; } div { @@ -472,10 +471,10 @@ div { ```css main { - height: 300px; display: flex; + height: 300px; align-items: flex-end; - border: 2px solid red; + border: 2px solid #444; } div { @@ -498,33 +497,43 @@ div { ::: -交差軸に沿ってフレックスアイテムを伸ばしたい場合は `align-items: stretch` を使います。これは `width` や `height` が設定されていない自動サイズの要素や、最小 `width` や `height` のみ設定されている要素にも適用されます。フレックスアイテムは交差軸の方向にコンテナいっぱいに伸びます。 +交差軸に沿ってフレックスアイテムを伸ばしたい場合は、`align-items: stretch` を使えます。これは交差軸のサイズが `auto` のアイテムにのみ影響し、交差軸に明示的なサイズ(例えば行コンテナの設定された `height`)があるアイテムは伸びません。影響を受けるアイテムは交差軸の方向にコンテナを埋めます。 :::interactive_editor ```html <link rel="stylesheet" href="styles.css"> - -<div class="container"> - <div class="box">One</div> - <div class="box">Two</div> - <div class="box">Three</div> -</div> - +<main> + <div id="first-div"></div> + <div id="second-div"></div> + <div id="third-div"></div> +</main> ``` ```css -.container { +main { display: flex; - align-items: stretch; + height: 300px; + align-items: stretch; border: 2px solid #444; - height: 200px; } -.box { - width: 100px; - border: 1px solid #888; - background-color: lightblue; +div { + width: 80px; + height: 50px; +} + +#first-div { + background-color: #4d70b2; +} + +#second-div { + background-color: #5c4db2; +} + +#third-div { + background-color: #4da3b2; + height: auto; } ``` @@ -536,33 +545,37 @@ div { ```html <link rel="stylesheet" href="styles.css"> - -<div class="container"> - <div class="box">One</div> - <div class="box">Two</div> - <div class="box special">Three</div> -</div> - +<main> + <div id="first-div"></div> + <div id="second-div"></div> + <div id="third-div"></div> +</main> ``` ```css -.container { +main { display: flex; - align-items: flex-start; + height: 300px; + align-items: flex-start; border: 2px solid #444; - height: 200px; } -.box { - width: 100px; - border: 1px solid #888; - background-color: lightblue; - margin: 4px; +div { + width: 80px; + height: 50px; } -.special { - align-self: stretch; - background-color: lightcoral; +#first-div { + background-color: #4d70b2; +} + +#second-div { + background-color: #5c4db2; +} + +#third-div { + background-color: #4da3b2; + align-self: stretch; } ``` @@ -574,33 +587,37 @@ div { ```html <link rel="stylesheet" href="styles.css"> - -<div class="container"> - <div class="box">One</div> - <div class="box">Two</div> - <div class="box special">Three</div> -</div> - +<main> + <div id="first-div"></div> + <div id="second-div"></div> + <div id="third-div"></div> +</main> ``` ```css -.container { +main { display: flex; - align-items: flex-start; + height: 300px; + align-items: flex-start; border: 2px solid #444; - height: 200px; } -.box { - width: 100px; - border: 1px solid #888; - background-color: lightblue; - margin: 4px; +div { + width: 80px; + height: 50px; +} + +#first-div { + background-color: #4d70b2; +} + +#second-div { + background-color: #5c4db2; } -.special { - align-self: center; - background-color: lightcoral; +#third-div { + background-color: #4da3b2; + align-self: center; } ``` @@ -612,33 +629,37 @@ div { ```html <link rel="stylesheet" href="styles.css"> - -<div class="container"> - <div class="box">One</div> - <div class="box">Two</div> - <div class="box special">Three</div> -</div> - +<main> + <div id="first-div"></div> + <div id="second-div"></div> + <div id="third-div"></div> +</main> ``` ```css -.container { +main { display: flex; - align-items: flex-start; + height: 300px; + align-items: flex-start; border: 2px solid #444; - height: 200px; } -.box { - width: 100px; - border: 1px solid #888; - background-color: lightblue; - margin: 4px; +div { + width: 80px; + height: 50px; +} + +#first-div { + background-color: #4d70b2; } -.special { - align-self: flex-start; - background-color: lightcoral; +#second-div { + background-color: #5c4db2; +} + +#third-div { + background-color: #4da3b2; + align-self: flex-start; } ``` @@ -650,39 +671,43 @@ div { ```html <link rel="stylesheet" href="styles.css"> - -<div class="container"> - <div class="box">One</div> - <div class="box">Two</div> - <div class="box special">Three</div> -</div> - +<main> + <div id="first-div"></div> + <div id="second-div"></div> + <div id="third-div"></div> +</main> ``` ```css -.container { +main { display: flex; - align-items: flex-start; + height: 300px; + align-items: flex-start; border: 2px solid #444; - height: 200px; } -.box { - width: 100px; - border: 1px solid #888; - background-color: lightblue; - margin: 4px; +div { + width: 80px; + height: 50px; } -.special { - align-self: flex-end; - background-color: lightcoral; +#first-div { + background-color: #4d70b2; +} + +#second-div { + background-color: #5c4db2; +} + +#third-div { + background-color: #4da3b2; + align-self: flex-end; } ``` ::: -他にもレスポンシブなレイアウトを作るために選べるフレックスプロパティや値はありますが、これらが最もよく使われるものです。これらのCSSフレックスプロパティとCSSフレックスモデルの新しい知識を使って、デバイス間でスムーズで包括的なユーザー体験を作るレスポンシブレイアウトを作成し始めましょう。 +他にもレスポンシブなレイアウトを作成するために選べるフレックスプロパティや値がありますが、ここで紹介したものが最もよく使われるものです。これらのCSSフレックスプロパティとCSSフレックスモデルの新しい知識を使って、デバイス間でスムーズで包括的なユーザー体験を作るレスポンシブレイアウトを始められます。 # --questions-- @@ -764,7 +789,7 @@ div { ## --answers-- -`flex-direction` と `justify-content`。 +`flex-direction` と `justify-content` ### --feedback-- @@ -772,7 +797,7 @@ div { --- -`flex-direction` と `align-items`。 +`flex-direction` と `align-items` ### --feedback-- @@ -780,7 +805,7 @@ div { --- -`flex-direction` と `align-content`。 +`flex-direction` と `align-content` ### --feedback-- @@ -788,7 +813,7 @@ div { --- -`flex-direction` と `flex-wrap`。 +`flex-direction` と `flex-wrap` ## --video-solution-- diff --git a/curriculum/challenges/japanese/blocks/lecture-working-with-css-fonts/672bd814105a0ffcf36f9233.md b/curriculum/challenges/japanese/blocks/lecture-working-with-css-fonts/672bd814105a0ffcf36f9233.md index c9dd5518bdb..2a40831ed43 100644 --- a/curriculum/challenges/japanese/blocks/lecture-working-with-css-fonts/672bd814105a0ffcf36f9233.md +++ b/curriculum/challenges/japanese/blocks/lecture-working-with-css-fonts/672bd814105a0ffcf36f9233.md @@ -11,6 +11,8 @@ dashedName: what-are-font-families <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/what-are-font-families-and-how-do-they-work-1.png" alt="Diagram showing 'Arial' at the top with two blue arrows pointing down to 'Arial Bold' on the left and 'Arial Italic' on the right, illustrating font family variations" /> +## CSSでのフォントファミリーの設定 + CSSでは、`font-family` プロパティでフォントファミリーを設定できます。以下は段落のフォントを`Arial`に設定する例です。 :::interactive_editor @@ -29,6 +31,8 @@ CSSでは、`font-family` プロパティでフォントファミリーを設定 ::: +## フォールバックフォント + では、フォントファミリーが見つからなかった場合はどうなるでしょうか?優先度の高い順から低い順に複数のフォントファミリーをカンマで区切って指定できます。これらの代替フォントはフォールバックとして機能します。以下の例では、Arialが主要フォントでLatoが代替フォントです。 :::interactive_editor @@ -51,6 +55,8 @@ CSSでは、`font-family` プロパティでフォントファミリーを設定 この仕組みが裏でどのように動いているかも知っておくと良いでしょう。最初のフォントが利用可能でも選択はそこで止まりません。フォントファミリーは文字ごとに選ばれるため、特定の文字がフォントにない場合は優先度の低いフォントから探されます。面白いですね。 +## ジェネリックフォントファミリー + ウェブ開発の文脈では、総称フォントファミリーもよく使われます。これは非常に重要です。総称フォントファミリーとは、優先度の高いフォントが利用できない場合にウェブブラウザがレンダリングするデフォルトのフォントです。コンテンツの可読性を保つために、ブラウザは指定された総称フォントファミリーに基づいて最も適切なフォントに置き換えます。よく使われるものには以下があります: - セリフ @@ -81,6 +87,8 @@ Arialが最も優先されます。Arialが見つからなければブラウザ フォントファミリーリストの最後には必ず総称フォントファミリーを含めるべきです。総称フォントは元々デザインで想定したフォントとは見た目が異なる場合があるため、異なるブラウザでフォールバックフォントの見え方を確認するのが役立ちます。 +## ウェブセーフフォント + ユーザー体験をできるだけ一貫させるために、ウェブセーフフォントを使うこともお勧めします。これらのフォントファミリーはほとんどのデバイスにインストールされているため、多くのユーザーに対して正しくレンダリングされる可能性が高いです。次のレッスンで詳しく学びます。 フォントファミリーはウェブデザインの世界で欠かせません。font-family プロパティを使うことで、テキストの見た目や雰囲気を瞬時に変えることができます。 diff --git a/curriculum/challenges/japanese/blocks/lecture-working-with-css-fonts/672bd8453d1371fdb1510fe5.md b/curriculum/challenges/japanese/blocks/lecture-working-with-css-fonts/672bd8453d1371fdb1510fe5.md index 611614db0cf..54a4890de21 100644 --- a/curriculum/challenges/japanese/blocks/lecture-working-with-css-fonts/672bd8453d1371fdb1510fe5.md +++ b/curriculum/challenges/japanese/blocks/lecture-working-with-css-fonts/672bd8453d1371fdb1510fe5.md @@ -11,6 +11,8 @@ dashedName: how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fo Google FontsとFont Squirrelは、ウェブ開発で使える無料フォントを見つけて利用できる人気のオンラインリソースです。これらはプロジェクトに簡単に組み込めます。 +## Google Fonts(グーグルフォント) + まずはGoogle Fontsから始めましょう。これはGoogleが提供するサービスで、ウェブ開発向けに設計されたフォントを多く含むコレクションを提供しています。Google Fontsのユーザーインターフェースにはさまざまな要素があります。ひとつずつ見ていきましょう。左のサイドバーには以下があります: - フォントを見たり、探したり、フィルターをかけたりできるセクション @@ -18,6 +20,8 @@ Google FontsとFont Squirrelは、ウェブ開発で使える無料フォント - ウェブプロジェクト用のアイコンを見つけてダウンロードできるセクション - フォントやベストプラクティスについて学べるセクションとよくある質問 +## Google Fontsのプレビュー + Google Fontsをウェブサイトに追加するには、最初のセクション(Fonts)に行きます。左のサイドバーの「Preview」と書かれたところでプレビュー用のテキストをカスタマイズできます。見たいテキストを入力すると自動で更新されます。これはウェブサイトで使いたいテキストでフォントをプレビューするのに便利です。フォントサイズの調整やフォントの特徴によるフィルターもできます。 <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-1.png" alt="Google Fonts Fonts section showing a left sidebar with preview text set to 'freeCodeCamp' at 40px, filter options for Language, Technology, and Decorative stroke, and the main panel listing font families including Roboto, SUSE, and Sevillana each previewing 'freeCodeCamp'" /> @@ -28,12 +32,16 @@ Google Fontsをウェブサイトに追加するには、最初のセクショ <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-2.png" alt="Google Fonts Roboto Styles page with Specimen, Type tester, Glyphs, and About & license tabs, a blue Get font button, a preview text field showing 'freeCodeCamp' with a font size slider at 48px, and a list of styles including Thin 100, Thin 100 Italic, Light 300, and Light 300 Italic" /> +## Google Fontsの使い方 + フォントをプロジェクトに追加する準備ができたら、上部の青い「Get font」ボタンをクリックしてください。現在選択しているフォントの一覧が表示されるサマリーページに移動します。複数のフォントを同時に選択できます。 <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-3.png" alt="Google Fonts page showing '1 font family selected' with Roboto Static listed, Get embed code and Download all buttons on the right, and a How to use section with All, Design, Develop, and Google products tabs" /> 次に、フォントファイルをダウンロードしてローカルファイルとしてプロジェクトに追加するか、ユーザーがウェブサイトにアクセスしたときにGoogleのサーバーから外部フォントとして読み込むかを選びます。ダウンロードしたい場合は「Download all」をクリックし、Googleのサーバーから外部フォントとして使いたい場合は「Get embed code」をクリックしてください。「Get embed code」をクリックすると、外部フォントをプロジェクトに追加するための手順が表示されます。 +### Google Fontsをリンクで使う + ウェブ開発プロジェクトでは、`link`要素か`@import`のどちらかを使う選択肢があります。`link`要素を使う場合は、HTMLのスニペットとCSSルールをコピーしてプロジェクトに貼り付けます。HTMLファイルの`head`要素にコードを埋め込み、必要に応じてCSSルールを追加してください。 <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-4.png" alt="Google Fonts Embed code page with the link element option selected, showing three link tags for preconnect and the font stylesheet, a CSS classes section with .roboto-thin, .roboto-light, .roboto-regular, and .roboto-medium rules, and a left sidebar showing font style toggles" /> @@ -141,11 +149,13 @@ Google Fontsをウェブサイトに追加するには、最初のセクショ 各フォントスタイルに対応するCSSルールがあります。各ルールは、カスタムフォントが正しく読み込まれなかった場合に備えてフォールバックフォントを代入しています。 +### Google Fontsを@importで使う + `@import`オプションを選ぶ場合は、そのルールをCSSファイルに追加する必要があります。 <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-5.png" alt="Google Fonts Embed code page with the @import option selected, showing a style block containing the @import URL rule, a CSS classes section below, and the left sidebar with font style toggles" /> -例は以下の通りです: +例を示します: ```css @import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap'); @@ -159,10 +169,14 @@ CSSルールはまったく同じです。 これがGoogle Fontsの使い方です。ウェブ開発プロジェクトで無料かつオープンソースのフォントを見つける最も人気のある選択肢のひとつです。 +## Font Squirrel(フォントスクワレル) + もうひとつの優れた選択肢はFont Squirrelです。ここではデザインに合ったカスタムフォントを見つけてダウンロードできます。 <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-7.png" alt="Font Squirrel 'Free Font Utopia' page listing featured free fonts including Acherus Grotesque, Intro Rust, Source Sans Pro, Open Sans, and Questa, each shown with an alphabet specimen and a Download button" /> +## Font Squirrelのプレビュー + フォントを検索して結果をクリックすると、フォントの詳細が表示されます。サンプル、テストドライブ、グリフ、Webfontキットなどが見られます。 <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-8.png" alt="Font Squirrel search results for 'Roboto' showing three matches: Roboto, Roboto 2014, and Roboto Slab, each with an alphabet specimen and a Download TTF button" /> @@ -173,6 +187,8 @@ CSSルールはまったく同じです。 <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-10.png" alt="Font Squirrel Roboto Specimens section listing all styles with alphabet samples: Roboto Thin, Thin Italic, Light, Light Italic, Regular, Italic, Medium, Medium Italic, Bold, Bold Italic, and Black, each in its respective weight" /> +## Font Squirrelの使い方 + 使いたいフォントが決まったら、「Webfont Kit」タブに移動してください。ここで、そのフォントのライセンスが`@font-face`のCSS埋め込みでの使用を許可しているか確認できます。部分集合やフォーマットも選べます。 <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-11.png" alt="Font Squirrel Roboto Webfont Kit tab showing a license notice confirming @font-face embedding is allowed, a subset selector set to Western Latin, format checkboxes with WOFF selected, and a Download @font-face Kit button" /> @@ -221,7 +237,7 @@ Font SquirrelやGoogle Fontsのようなサービスから外部フォントを --- -ブラウザーの互換性が向上すること。 +ブラウザー互換性の向上。 ### --feedback-- diff --git a/curriculum/challenges/japanese/blocks/lecture-working-with-css-fonts/672bd853c985cdfdeb32f4f9.md b/curriculum/challenges/japanese/blocks/lecture-working-with-css-fonts/672bd853c985cdfdeb32f4f9.md index 6ffa79928fa..4772e7008cb 100644 --- a/curriculum/challenges/japanese/blocks/lecture-working-with-css-fonts/672bd853c985cdfdeb32f4f9.md +++ b/curriculum/challenges/japanese/blocks/lecture-working-with-css-fonts/672bd853c985cdfdeb32f4f9.md @@ -1,6 +1,6 @@ --- id: 672bd853c985cdfdeb32f4f9 -title: text-shadow プロパティとは何か、そしてどのように機能するのか? +title: Text-shadow プロパティとは何か、そしてどのように機能するのか? challengeType: 19 dashedName: what-is-the-text-shadow-property --- @@ -13,6 +13,8 @@ CSSはデフォルトではテキストに影を適用しません。これは text-shadow: /* Values */ ``` +## `X` と `Y` のオフセット値 + CSSでは、影を`X` オフセット、`Y` オフセット、ぼかし半径、色の組み合わせで表現できます。まず、影のテキストからの水平距離と垂直距離を表す`X` と`Y` オフセットを指定する必要があります。これらの値は必須です。 影に`X` と`Y` オフセットを適用する例を示します。`text-shadow` プロパティにxオフセットを`3px`、yオフセットを`2px` として適用します: @@ -32,7 +34,11 @@ p { ::: -ブラウザではテキストと影は似ていますが、影の色をオフセットの前または後に指定してカスタマイズできます。影の色を設定しましょう。ここでは16進数の色を使いますが、有効な色形式なら何でも使えます。 +ブラウザーでは、テキストと影は似た見た目になります。 + +## 影に色を追加する + +オフセットの前後に値を指定して影の色をカスタマイズすることもできます。影の色を設定しましょう。ここでは16進数の色を使いますが、有効な色の形式ならどれでも使えます。 :::interactive_editor @@ -66,7 +72,11 @@ p { ::: -ブラウザでは影に特定の色が付き、テキストと簡単に区別できます。影とテキストを区別できるようになったので、正の値と負の値が影のオフセットにどう影響するかも重要です。`X` オフセットと`Y` オフセットの正の値は影を右と下に移動させ、負の値は左と上に移動させます。以下は負の値を使った例です: +ブラウザーでは影に特定の色が付き、テキストと簡単に区別できます。 + +## 正と負のオフセット値 + +影とテキストを区別できるようになったので、正の値と負の値が影のオフセットにどう影響するかも見てみましょう。`X` オフセットと `Y` オフセットの正の値はそれぞれ影を右と下に動かし、負の値は影を左と上に動かします。代わりに負の値を使った例がこちらです: :::interactive_editor @@ -83,7 +93,11 @@ p { ::: -これで影はテキストに対して左上に移動します。いいですね。しかし影は元のテキストとまったく同じで後ろに置かれているだけなので、あまり見栄えがよくありません。もっと見栄えよくするには、3つ目の値であるぼかし半径を追加する必要があります。この値は任意ですが、影をより滑らかで控えめに見せます。ぼかし半径のデフォルト値は0です。値が大きいほどぼかしが強くなり、影が薄くなります。 +これで影はテキストに対して左上に動きます。いいですね。 + +## ぼかし半径 + +しかし影はあまりきれいに見えません。なぜなら元のテキストとまったく同じに見え、背後に置かれているだけだからです。もっときれいに見せるには、3つ目の値であるぼかし半径を追加する必要があります。この値は任意ですが、影をずっと滑らかで控えめに見せます。ぼかし半径のデフォルト値は0です。値が大きいほどぼかしが強くなり、影が薄くなります。 ここではぼかし半径を`3px` に設定し、オフセットは正の値に戻しています: @@ -104,6 +118,8 @@ p { これで影らしくなってきました。よりぼやけて控えめなので、メインのテキストにフォーカスしつつ影が背景でスタイルを加えています。ここからオフセット、色、ぼかし半径の値を少し調整して、ニーズに合う組み合わせを見つけましょう。 +## 複数の影を追加する + また、テキストは複数の影を持つことができます。同じ`text-shadow` プロパティにカンマで区切って書くだけです。影は前から後ろへレイヤーで適用され、最初の影が一番上になります。 以下は3つの影をレイヤーで適用した段落の例です。これらすべての影は同じ`text-shadow` プロパティにカンマで区切って定義されています: diff --git a/curriculum/challenges/japanese/blocks/lecture-working-with-css-transforms-overflow-and-filters/672bccc8ea33bad87abb3c56.md b/curriculum/challenges/japanese/blocks/lecture-working-with-css-transforms-overflow-and-filters/672bccc8ea33bad87abb3c56.md index 9047e48d923..4c36e3da519 100644 --- a/curriculum/challenges/japanese/blocks/lecture-working-with-css-transforms-overflow-and-filters/672bccc8ea33bad87abb3c56.md +++ b/curriculum/challenges/japanese/blocks/lecture-working-with-css-transforms-overflow-and-filters/672bccc8ea33bad87abb3c56.md @@ -1,6 +1,6 @@ --- id: 672bccc8ea33bad87abb3c56 -title: content-box と border-box の違いとは? +title: Content-box と border-box の違いとは? challengeType: 19 dashedName: what-is-the-difference-between-content-box-and-border-box --- @@ -19,6 +19,8 @@ dashedName: what-is-the-difference-between-content-box-and-border-box `box-sizing` プロパティの値はデフォルトでは `content-box` ですが、必要に応じて `border-box` を選ぶこともできます。まず `content-box` を見てから、`border-box` を説明します。 +## CSSボックスモデルのレビュー + モデルの仕組みを理解するには、CSSボックスモデルの4つの基本概念に慣れている必要があります。さっと復習しましょう。 - コンテンツエリアは要素の内容が占めるスペースです。 @@ -26,6 +28,8 @@ dashedName: what-is-the-difference-between-content-box-and-border-box - border はコンテンツエリアと padding を囲む枠線です。 - margin は border の外側にあり、要素と他の要素を分けるスペースです。 +## `content-box` の仕組み + `content-box` モデルでは、要素に設定した幅と高さはコンテンツエリアの寸法を決めますが、padding、border、margin は含まれません。コンテンツエリアを正確に制御したい場合は `content-box` を使います。`width` と `height` を設定すると、コンテンツ自体のサイズだけが決まります。 要素の合計幅を求めるには、左右の padding と左右の border を加算する必要があります。同様に、要素の合計高さはコンテンツの高さに上下の padding と上下の border を加えたものです。 @@ -52,10 +56,14 @@ div { この場合、`content-box` が使われるとコンテンツエリアは 300px × 200px になります。合計のレンダリングサイズには padding と border が含まれます。例えば、合計幅 = 300px(コンテンツ)+ 40px(padding)+ 8px(border)= 348px、合計高さも同様に計算されます。 +## `border-box` の仕組み + 素晴らしいです!次に `border-box` を見てみましょう。これは設定した幅と高さに要素のコンテンツ、padding、border が含まれます(margin は含まれません)。`border-box` は、padding や border が変わっても要素の合計サイズを固定したい場合に便利で、レスポンシブレイアウトでよく使われます。 `border-box` では、padding と border が要素の指定サイズ内に含まれます。設定した `width` と `height` が要素の合計寸法になります:コンテンツ + padding + border。margin は除外されます。 +## 2つのモデルの比較 + 次の例では、同じ寸法で `div` 要素が2つありますが、`box-sizing` の値が異なります。ブラウザで見ると合計サイズが異なることに注目してください。 :::interactive_editor diff --git a/curriculum/challenges/japanese/blocks/lecture-working-with-dates/6733aafb9c0802f66cc1e056.md b/curriculum/challenges/japanese/blocks/lecture-working-with-dates/6733aafb9c0802f66cc1e056.md index e78577d7cc2..b575c3e3fa3 100644 --- a/curriculum/challenges/japanese/blocks/lecture-working-with-dates/6733aafb9c0802f66cc1e056.md +++ b/curriculum/challenges/japanese/blocks/lecture-working-with-dates/6733aafb9c0802f66cc1e056.md @@ -34,21 +34,31 @@ console.log(now); 時間は24時間制で表されており、`14:30`は`2:30 PM`です。`GMT-0700`はタイムゾーンのオフセットで、`Pacific Daylight Time`はタイムゾーン名です。 -また、年、月、日、時、分、秒、ミリ秒の値を引数として渡すことで、特定の日付と時間を持つ`Date`オブジェクトを作成することもできます。 +特定の日時の文字列を使って新しい`Date`オブジェクトを作成する例を示します: -特定の日付と時間で新しい`Date`オブジェクトを作成する例は以下の通りです。 +:::interactive_editor + +```js +const dateFromString = new Date("July 4, 1776 12:00:00"); + +console.log(dateFromString); +``` + +::: + +年、月、日、時、分、秒、ミリ秒の値を引数として渡すことで、特定の日時を`Date`オブジェクトに指定することもできます: :::interactive_editor ```js -const specificDate = new Date("July 4, 1776 12:00:00"); +const dateFromArguments = new Date(1776, 6, 4, 12, 0, 0, 0); -console.log(specificDate); +console.log(dateFromArguments); ``` ::: -これは、現在の日付と時間ではなく特定の日付と時間を扱う必要がある場合に便利です。入力は常に文字列である必要があり、`Date`オブジェクトが認識できる形式でなければなりません。 +これは、現在の日時ではなく特定の日時を扱う必要がある場合に便利です。 現在の日付と時間を取得するには、`Date.now()`メソッドを使います。これは`January 1, 1970, 00:00:00 UTC`からのミリ秒数を返します。これをUnixエポック時間と呼びます。 diff --git a/curriculum/challenges/japanese/blocks/lecture-working-with-file-systems/672ac403a9ba7732b31c6480.md b/curriculum/challenges/japanese/blocks/lecture-working-with-file-systems/672ac403a9ba7732b31c6480.md index fbb1813432a..760de2bcbba 100644 --- a/curriculum/challenges/japanese/blocks/lecture-working-with-file-systems/672ac403a9ba7732b31c6480.md +++ b/curriculum/challenges/japanese/blocks/lecture-working-with-file-systems/672ac403a9ba7732b31c6480.md @@ -51,7 +51,7 @@ WOFF2はWOFFの後継で、さらに効率的な圧縮とパフォーマンス これらは通常、Markdownというファイル形式で書かれています。Markdownを使うと、見出し、小見出し、リンク、画像、リストなどを含む構造化された文書を作成できます。Markdownファイルの拡張子は`.md`または`.markdown`です。 -こちらはfreeCodeCampのGitHubリポジトリの`README`ファイルです:https://github.com/freeCodeCamp/freeCodeCamp/blob/main/README.md +こちらで freeCodeCamp の GitHub リポジトリの `README` ファイルを確認できます:`https://github.com/freeCodeCamp/freeCodeCamp/blob/main/README.md` Markdownを使ってこのような詳細な構造とフォーマットを作成できます。 diff --git a/curriculum/challenges/japanese/blocks/lecture-working-with-node-core-modules/695cc6a5eefd305381ec90bc.md b/curriculum/challenges/japanese/blocks/lecture-working-with-node-core-modules/695cc6a5eefd305381ec90bc.md index 1b87d42192f..915821b60dc 100644 --- a/curriculum/challenges/japanese/blocks/lecture-working-with-node-core-modules/695cc6a5eefd305381ec90bc.md +++ b/curriculum/challenges/japanese/blocks/lecture-working-with-node-core-modules/695cc6a5eefd305381ec90bc.md @@ -1,6 +1,6 @@ --- id: 695cc6a5eefd305381ec90bc -title: fsモジュールとは何か、そしてどのように動作するのか? +title: Fsモジュールとは何か、そしてどのように動作するのか? challengeType: 19 dashedName: what-is-the-fs-module-and-how-does-it-work --- @@ -148,7 +148,7 @@ async function readFileContent() { const fileContent = await fs.readFile("article.md", "utf8"); console.log("File content:", fileContent); } catch (err) { - console.log("File read successfully"); + console.error("Error reading file:", err); } } @@ -169,7 +169,7 @@ async function readFileContent() { const fileContent = await fs.readFile("article.md"); console.log("File content:", fileContent); } catch (err) { - console.log("File read successfully"); + console.error("Error reading file:", err); } } @@ -318,3 +318,4 @@ JSONパースを使う方法、例えば`fs.parseFile()`。 ## --video-solution-- 4 + diff --git a/curriculum/challenges/japanese/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d2f232c60f0fa68ef86.md b/curriculum/challenges/japanese/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d2f232c60f0fa68ef86.md index 3acab452144..081a40610f6 100644 --- a/curriculum/challenges/japanese/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d2f232c60f0fa68ef86.md +++ b/curriculum/challenges/japanese/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d2f232c60f0fa68ef86.md @@ -21,7 +21,7 @@ dashedName: what-is-node-and-what-are-some-differences-between-the-browser-and-n ウェブブラウザはJavaScriptコードを実行するために必要な環境を提供しており、JavaScriptエンジンも含まれています。また、Document Object Model(DOM)へのアクセスも提供しているため、コード内でHTML要素にアクセスできます。 -以前はブラウザの外でJavaScriptを実行することはできませんでしたが、今はNode.jsで可能になりました。 +長い間、JavaScriptはほぼブラウザ内でのみ使われてきましたが、Node.jsを使えばブラウザの外でも実行できます。 Node.jsはJavaScriptのランタイム環境です。公式には「オープンソースでクロスプラットフォームのJavaScriptランタイム環境」と定義されています。 @@ -43,7 +43,7 @@ Node.jsが何かがわかったところで、ブラウザとNodeランタイム 例えば、ブラウザからはDOM APIにアクセスできますが、ローカルファイルシステムへのアクセスには制限があります。対してNodeランタイム環境からはファイルシステムを含むほぼすべてのシステムリソースにアクセスできますが、DOMにはアクセスできません。 -両方のJavaScript環境はグローバルオブジェクトを提供します。ブラウザのJavaScriptランタイムではこれを`window`と呼びます。この`window`オブジェクトはDOM操作、クッキー管理、ブラウザイベント処理などブラウザ関連の機能にアクセスできます。Node.js環境ではこのグローバルオブジェクトは`global`と呼ばれます。`global`オブジェクトはローカルファイル操作、ネットワーク、オペレーティングシステムとの連携などNode.js固有の機能にアクセスできます。 +両方のJavaScript環境はグローバルオブジェクトを提供します。ブラウザのJavaScriptランタイムではこれを`window`と呼びます。この`window`オブジェクトは、DOM操作のメソッド、クッキー管理、ブラウザのイベント処理など、ブラウザ関連の機能にアクセスできます。Node.js環境ではこのグローバルオブジェクトを`global`と呼びます。`global`オブジェクトは、ローカルファイル操作、ネットワーキング、OSとのやり取りに使う組み込みモジュールなど、Node.js固有の機能にアクセスできます。 最後にもう一つ重要な違いは、サーバーで使うNode.jsのバージョンは選べますが、ユーザーがウェブサイトを訪れる際のブラウザ環境のバージョンは制御できません。 @@ -77,7 +77,7 @@ Node.jsでJavaScriptコードがどこでどのように実行されるかを考 --- -ユーザーインターフェースを構築するためのJavaScriptフレームワーク。 +ユーザーインターフェース構築のためのJavaScriptフレームワーク。 ### --feedback-- @@ -103,7 +103,7 @@ Node.jsでJavaScriptコードがどこでどのように実行されるかを考 --- -Nodeランタイム環境はグローバルオブジェクトとしてwindowオブジェクトを使い、ブラウザはglobalオブジェクトを使う。 +Nodeランタイム環境はグローバルオブジェクトとして`window`を使いますが、ブラウザは`global`オブジェクトを使います。 ### --feedback-- diff --git a/curriculum/challenges/japanese/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d372ad364f285f0522e.md b/curriculum/challenges/japanese/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d372ad364f285f0522e.md index 0ac93b8b634..d1fca76fa7b 100644 --- a/curriculum/challenges/japanese/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d372ad364f285f0522e.md +++ b/curriculum/challenges/japanese/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d372ad364f285f0522e.md @@ -11,7 +11,7 @@ Node.jsの大きな利点の一つは、ウェブアプリケーションのフ Nodeのアーキテクチャもまた利点です。Nodeはノンブロッキングでイベント駆動型のアーキテクチャを持ち、リアルタイムアプリケーションの開発に最適です。レスポンスの速さと効率性が良いユーザー体験を作るために不可欠だからです。 -ここで「スレッド」という概念が非常に重要になります。スレッドとは、プロセス内の実行経路のことで、現在動作しているコンピュータプログラムのようなものです。 +ここで「スレッド」という概念が非常に重要になります。スレッドとは、現在実行中のコンピュータプログラムであるプロセス内の実行経路のことです。 Nodeのアーキテクチャはシングルスレッドとイベントループに依存しており、多数の同時リクエストや入出力操作を効果的に処理できます。これにより、複数のリクエストを同時に処理する必要があるアプリケーションに最適です。 @@ -25,13 +25,13 @@ HTTPリクエストの処理、データベース操作、日時のフォーマ 一方で、Node.jsには知っておくべき欠点や制限もあります。 -ご存じの通り、Node.jsは一度に1つのスレッドしか動作しません。つまり、一度に1つの操作しか処理できません。アーキテクチャは同時(並行)リクエストの処理に効率的ですが、CPU負荷の高い処理はメインスレッドをブロックし、パフォーマンスの問題を引き起こす場合があります。 +ご存知のように、NodeはJavaScriptを単一のスレッドで実行するため、一度にコードの一部分しか実行できません。そのアーキテクチャは同時(並行)リクエストの処理に効率的ですが、CPU集約型のタスクはメインスレッドをブロックし、パフォーマンスの問題を引き起こす場合があります。 CPU負荷の高い処理の例としては、複雑な数学演算、画像や動画の処理、暗号化などがあります。これを回避する方法はありますが、通常はアプリケーションの複雑さが増します。 -Node.jsは非同期プログラミングにも依存しています。非同期プログラミングでは、時間のかかる処理を開始しても完了を待たずにメインプログラムが動き続け、非同期処理が並行して実行されます。処理が完了すると、その結果をプログラムが受け取ります。 +非同期プログラミングでは、実行に時間がかかる可能性のあるタスクを開始しますが、完了を待たずにメインプログラムは実行を続け、非同期タスクはバックグラウンドで動作します。 -この過程では「コールバック」と呼ばれる、非同期処理完了時に実行される関数がよく使われます。Node.jsの非同期性はコードの読みやすさ、理解、デバッグを難しくする場合があります。 +このプロセスにはしばしば「コールバック」と呼ばれる、非同期処理が完了したときに何が起こるかを定義する関数が関わります。Node.jsの非同期の性質は、コードの読みやすさ、理解しやすさ、デバッグの難しさを増す可能性があります。 最後に、`npm`(Nodeのパッケージマネージャー)からパッケージを選ぶ際には注意が必要です。中にはメンテナンスが十分でないものもあり、自分のアプリケーションに脆弱性をもたらす可能性があります。開発者として、各パッケージを慎重に評価し、品質やセキュリティのベストプラクティスに従っているか確認してください。 diff --git a/curriculum/challenges/japanese/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d39d7ed9ef36ff281f3.md b/curriculum/challenges/japanese/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d39d7ed9ef36ff281f3.md index 53f4661a763..6204c603192 100644 --- a/curriculum/challenges/japanese/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d39d7ed9ef36ff281f3.md +++ b/curriculum/challenges/japanese/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d39d7ed9ef36ff281f3.md @@ -1,6 +1,6 @@ --- id: 68ff6d39d7ed9ef36ff281f3 -title: コンピューターにNodeをインストールするには? +title: コンピューターにNodeをインストールする方法 challengeType: 19 dashedName: how-can-you-install-node-on-your-computer --- @@ -17,7 +17,7 @@ macOS/LinuxとWindowsでのNVMのインストール方法と、Node.jsのイン macOSとLinuxでは、シェルスクリプトを使って直接NVMをインストールできます。 -ただしmacOSの場合、NVMの公式ドキュメントには「インストールスクリプトを実行する前にXcodeコマンドラインツールを手動でインストールする必要があり、そうしないと失敗する」と記載されています。 +ただしmacOSの場合、NVMの公式ドキュメントには「インストールスクリプトを実行する前にXcodeコマンドラインツールを手動でインストールする必要があり、そうしないと失敗する」と記載されていますのでご注意ください。 macOSでは、ターミナルで次のコマンドを実行してXcodeコマンドラインツールをインストールできます。 @@ -41,7 +41,7 @@ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash ``` -この記事を読んでいる時点での最新のNVMバージョンを知りたい場合は、公式NVMドキュメントを参照してください:`https://github.com/nvm-sh/nvm?tab=readme-ov-file#install--update-script`。そこに最新バージョン番号を含むコマンドが記載されています。 +このレッスンを読んでいる時点での最新のNVMバージョンを入手するには、公式NVMドキュメント `https://github.com/nvm-sh/nvm?tab=readme-ov-file#install--update-script` を参照してください。そこに最新バージョン番号付きのコマンドが掲載されています。 処理が完了したら、新しいコマンドと設定を読み込むためにターミナルを再起動する必要がある場合があります。 @@ -95,13 +95,13 @@ nvm use 20 node -v ``` -## WindowsでのNVMのインストール方法 +## WindowsでNVMをインストールする方法 次に、WindowsでNVMをインストールして使う方法を見てみましょう。 公式のNVMは特定のケースでのみWindowsをサポートしています。もしWindows Subsystem for Linux(WSL)がセットアップされている場合は、上記のmacOS/Linuxのガイドに従ってNVMをインストールして使えます。 -しかし、Windows自体にはいくつかの代替手段があります。そのうちの一つが`nvm-windows`です。これはWindows用のNode.jsバージョン管理ユーティリティで、公式NVMプロジェクトとは完全に別のプロジェクトです。ただし、これらのツールの目的は同じで、同じデバイス上で複数のNode.jsバージョンを扱いやすくすることです。 +しかしWindows自体にはいくつかの代替手段があります。そのうちの一つがWindows用のNode.jsバージョン管理ユーティリティである`nvm-windows`です。これは公式NVMプロジェクトとは完全に別のプロジェクトですが、目的は同じで、同じデバイス上で複数のNode.jsバージョンを扱いやすくすることです。 `nvm-windows`をインストールする前に、公式リポジトリではNVM for Windowsをインストールする前に既存のNodeのインストールをアンインストールすることを推奨しています。初めてNode.jsをインストールする場合は問題ありませんが、すでに他のNode.jsバージョンがインストールされている場合は先にアンインストールすることをお勧めします。 @@ -155,7 +155,7 @@ nvm use 20 次のコマンドで現在のNode.jsバージョンを確認できます。 -```bash +```powershell node -v ``` @@ -165,25 +165,25 @@ NVMとNode.jsのインストール方法がわかったので、Node.jsとNVMを また、これらのコマンドはmacOS/LinuxにインストールされたNVM(WSLを含む)ではすべて動作しますが、`nvm-windows`では動作が異なるか、まったく動作しない場合があります。可能な限り`nvm-windows`用の代替コマンドも紹介します。 -### Powershellの実行ポリシーを調整する方法 +### PowerShellの実行ポリシーを調整する方法 -WindowsでPowershellと`nvm-windows`を使っている場合、Powershellの実行ポリシーを調整する必要があるかもしれません。Powershellのデフォルトの実行ポリシーは`Restricted`で、これはスクリプトの実行を防ぐセキュリティ対策です。 +WindowsでPowerShellと`nvm-windows`を使っている場合、PowerShellの実行ポリシーを調整する必要があるかもしれません。PowerShellのデフォルトの実行ポリシーは`Restricted`で、これはスクリプトの実行を防ぐセキュリティ対策です。 -まず、Powershellを管理者として起動します。Powershellを右クリックして「管理者として実行」をクリックしてください。 +まず、PowerShellを右クリックして「管理者として実行」をクリックし、管理者権限でPowerShellを起動してください。 -次に、現在のPowershellセッションの実行ポリシーを確認するには、次のコマンドを実行します。 +次に、現在のPowerShellセッションの実行ポリシーを確認するには、以下のコマンドを実行してください: ```powershell Get-ExecutionPolicy ``` -最後に、ローカルスクリプトと`RemoteSigned`の実行を許可する`npm`にPowershellの実行ポリシーを設定するには、次のコマンドを使います。 +最後に、ローカルスクリプトと`npm`の実行を許可する`RemoteSigned`にPowerShellの実行ポリシーを設定するには、以下のコマンドを使ってください: ```powershell Set-ExecutionPolicy RemoteSigned ``` -上記のコマンドを実行したら、管理者権限のPowershellウィンドウを閉じ、管理者権限なしのPowershellウィンドウを開いてください。 +上記のコマンドを実行したら、管理者権限のPowerShellウィンドウを閉じて、管理者権限なしのPowerShellウィンドウを開いてください。 ### すべてのバージョンを一覧表示する @@ -193,7 +193,7 @@ Set-ExecutionPolicy RemoteSigned nvm ls ``` -### デフォルトのNode.jsバージョンを設定する(macOS/LinuxのNVMのみ) +### デフォルトの Node.js バージョン設定(macOS/Linux の NVM のみ) このコマンドは、新しいターミナルセッションで使用されるNode.jsのデフォルトバージョンを設定します。 @@ -231,7 +231,7 @@ nvm use <new_name> nvm use new-api ``` -### Node.jsのバージョンを削除する +### Node.js バージョンの削除 Node.jsのバージョンを削除するには、次のコマンドを実行します。 @@ -271,7 +271,7 @@ node -v npm -v ``` -### JavaScriptファイルを実行する +### JavaScript ファイルの実行 このコマンドは、現在アクティブなNode.jsランタイムで指定したJavaScriptファイルを実行します。 @@ -285,7 +285,7 @@ node <file.js> node app.js ``` -### Node.jsプロジェクトを作成する +### Node.js プロジェクトの作成 このコマンドは、プロジェクトの詳細や依存関係を追跡する`package.json`ファイルを作成して、新しいNode.jsプロジェクトを作成します。 @@ -295,7 +295,7 @@ npm init `npm init`コマンドを実行すると、`package.json`ファイルの設定のための対話型CLIガイドが開始されます。プロジェクト名、説明、バージョンなどの質問がされます。デフォルトの`package.json`ファイルから始めたい場合は、`npm init -y`または`npm init --yes`コマンドを使えます。 -### パッケージをインストールする +### パッケージのインストール 特定のパッケージをインストールするには、次を実行します。 @@ -430,3 +430,4 @@ Node.jsアプリケーションを効率的にデバッグするため。 ## --video-solution-- 1 + diff --git a/curriculum/challenges/japanese/blocks/lecture-working-with-operator-behavior/6732719e2e3ad4d947410b65.md b/curriculum/challenges/japanese/blocks/lecture-working-with-operator-behavior/6732719e2e3ad4d947410b65.md index 862e0536ab9..4a814f1a41a 100644 --- a/curriculum/challenges/japanese/blocks/lecture-working-with-operator-behavior/6732719e2e3ad4d947410b65.md +++ b/curriculum/challenges/japanese/blocks/lecture-working-with-operator-behavior/6732719e2e3ad4d947410b65.md @@ -11,7 +11,13 @@ JavaScriptで複数の演算子を使った式を書くとき、どの演算子 演算子の優先順位は、式の中でどの操作が先に評価されるかを決めます。優先順位が高い演算子は、低い演算子より先に評価されます。数学で割り算や掛け算が足し算や引き算より先に行われるのと同じように考えてください。 -このルールを守らなければ、基本的な計算式でも間違った答えが出てしまいます。JavaScriptも同じ仕組みで、どの演算子が最初に、次に、という順番で評価されるか独自のルールがあります。例えば、次の式を見てください: +このルールに従わなければ、基本的な計算式でも間違った答えが出てしまいます。JavaScriptも同じように動作します。どの演算子が最初に、次に、という順番で評価されるか独自のルールを持っています。 + +## 算術式における優先順位 + +### 乗算の優先順位 + +例えば、以下の式を見てみましょう: :::interactive_editor @@ -25,36 +31,42 @@ console.log(result); // 14 もしJavaScriptがこの式を左から右に順番に評価したら、`2 + 3 = 5`の後に`5 * 4 = 20`になるはずです。しかし掛け算は足し算より優先順位が高いため、JavaScriptはまず`3 * 4`の部分を評価し、結果は`2 + 12 = 14`になります。 -時には優先順位に関係なく、式の特定の部分を先に評価したいことがあります。その場合は丸括弧、`()`を使います。丸括弧の中は必ず最初に評価されます。前の例で`2 + 3`の部分を先に評価させてみましょう: +### 除算の優先順位 + +割り算の演算子も足し算や引き算より優先順位が高いです: :::interactive_editor ```js -const result = (2 + 3) * 4; +const result = 2 + 6 / 3; -console.log(result); // 20 +console.log(result); // 4 ``` ::: -上の例では、丸括弧によってJavaScriptはまず`2 + 3`を評価し、その結果に`4`を掛けます。これにより`20`が得られ、`14`とは異なる結果になります。 +もしJavaScriptがこの式を左から右に評価したら、`2 + 6 = 8`の後に`8 / 3 = 2.67`になるはずです。しかし割り算は足し算より優先順位が高いため、JavaScriptはまず割り算を評価し:`6 / 3 = 2`、その後`2 + 2`を足して結果は`4`になります。 -割り算の演算子も足し算や引き算より優先順位が高いです: +### 丸括弧を使って優先順位をオーバーライドする + +時には、優先順位のルールに関係なく式の特定の部分を先に実行したい場合があります。丸括弧、`()` を使うとこれができます。丸括弧の中は何であれ最初に評価されます。乗算の例で `2 + 3` の部分を先に評価させてみましょう: :::interactive_editor ```js -const result = 2 + 6 / 3; +const result = (2 + 3) * 4; -console.log(result); // 4 +console.log(result); // 20 ``` ::: -もしJavaScriptがこの式を左から右に評価したら、`2 + 6 = 8`の後に`8 / 3 = 2.67`になるはずです。しかし割り算は足し算より優先順位が高いため、JavaScriptはまず割り算を評価し:`6 / 3 = 2`、その後`2 + 2`を足して結果は`4`になります。 +上の例では、丸括弧によってJavaScriptはまず`2 + 3`を評価し、その結果に`4`を掛けます。これにより`20`が得られ、`14`とは異なる結果になります。 つまり掛け算と割り算は、丸括弧で順序を変えない限り、足し算や引き算より先に必ず行われます。では、もし演算子の優先順位が同じ場合はどうなるでしょう?JavaScriptは結合規則を使って評価順を決めます。 +## 結合性の理解 + 結合規則は、演算子を左から右に評価するか右から左に評価するかをJavaScriptに指示します。足し算や掛け算のような多くの演算子は左から右の結合規則です。つまり、JavaScriptは式の左端から右へ処理します: :::interactive_editor @@ -84,6 +96,8 @@ console.log(a + b); // 10 上の例では、JavaScriptはまず`5`を`b`に代入し、その後`b`(今は`5`)を`a`に代入します。 +### べき乗演算子 + べき乗演算子も右から左の結合規則です: :::interactive_editor diff --git a/curriculum/challenges/japanese/blocks/lecture-working-with-regular-expressions/6733c5e54e3a154c8078ed48.md b/curriculum/challenges/japanese/blocks/lecture-working-with-regular-expressions/6733c5e54e3a154c8078ed48.md index c81c9736c0e..93040106fea 100644 --- a/curriculum/challenges/japanese/blocks/lecture-working-with-regular-expressions/6733c5e54e3a154c8078ed48.md +++ b/curriculum/challenges/japanese/blocks/lecture-working-with-regular-expressions/6733c5e54e3a154c8078ed48.md @@ -17,6 +17,8 @@ const regex = /^\d\d\d\d$/; これは確かに動作します:4つの数字文字にマッチします。しかし、同じクラスを何度も書く代わりに、量指定子を使うことができます。 +## 正確な量指定子 + 量指定子は波括弧(中括弧)で囲まれた1つか2つの数字で定義されます。パターンに量指定子を使ってみましょう。 ```js @@ -40,6 +42,8 @@ console.log(regex.test("1234567")); // false このパターンは、アンカーを使い量指定子が正確に4回の数字だけを許可しているため、ちょうど4桁の文字列にしかマッチしません。しかし、識別コードは4桁以上であればよい場合もあります。 +## 最小値と最大値の量指定子 + 4桁以上を許可するには、量指定子の数字の後にカンマを追加してください。 ```js @@ -84,6 +88,10 @@ console.log(regex.test("1234567")); // false この構文では最大値だけを設定することはできません:必ず最小値も設定する必要があります。ただし、最小値を`1`に設定すれば、実質的に同じ結果を得られます。 +## 省略形の量指定子 + +### 疑問符の量指定子(`?`) + ユーザーから更新された要件が届きました。識別子は任意で先頭に文字が付くことができます。すでにその文字クラスはわかっているので、正規表現に追加しましょう。 ```js @@ -122,6 +130,8 @@ console.log(regex.test("1234567")); // false このパターンは、1文字の任意の文字が任意で続き、その後に4~6桁の数字が続くことを許可します。 +### アスタリスクの量指定子(`*`) + 残念ながら、要件を誤読していたことに気づきました。数字の前に任意の数の文字を許可する必要があります。量指定子で最小値を`0` にし、最大値を設定しないこともできます。 ```js @@ -144,6 +154,8 @@ console.log(regex.test("1234567")); // false ::: +### プラスの量指定子(`+`) + これで、0文字以上の文字に続いて4~6桁の数字にマッチする識別子を正しくマッチできました。しかし、これがシステムをクラッシュさせてしまいました:実際には少なくとも1文字は必須です。 再び、最小値を1にして最大値を指定しない量指定子を使うか、または別の特別な構文であるプラス(`+`)記号を使うことができます: diff --git a/curriculum/challenges/japanese/blocks/lecture-working-with-the-dom-click-events-and-web-apis/673368ccf52205329b729378.md b/curriculum/challenges/japanese/blocks/lecture-working-with-the-dom-click-events-and-web-apis/673368ccf52205329b729378.md index 150239a3d8a..aaacfa10afa 100644 --- a/curriculum/challenges/japanese/blocks/lecture-working-with-the-dom-click-events-and-web-apis/673368ccf52205329b729378.md +++ b/curriculum/challenges/japanese/blocks/lecture-working-with-the-dom-click-events-and-web-apis/673368ccf52205329b729378.md @@ -1,18 +1,22 @@ --- id: 673368ccf52205329b729378 -title: innerText、textContent、innerHTMLの違いとは? +title: InnerText、textContent、innerHTMLの違いとは? challengeType: 19 dashedName: what-is-the-difference-between-innertext-textcontent-and-innerhtml --- # --interactive-- +## 概要 + `innerText`、`textContent`、`innerHTML`について学びましょう。 これらはJavaScriptでアクセスできるプロパティで、HTML要素の内容を取得したり変更したりできます。最初は非常に似ているように見えますが、重要な違いがあります。どれを選ぶかは具体的な用途によるので、詳しく見ていきましょう。 まずは`innerText`から始めます。 +## innerText の理解 + `innerText`はHTML要素とその子孫要素の可視テキスト内容を表します。このプロパティは非表示のテキストやHTMLタグは含まず、レンダリングされたテキストのみを含みます。 例えば、ここに2つの段落を含む`div`要素があります: @@ -109,6 +113,8 @@ container.innerText = "JavaScript is awesome!"; では、次に`textContent`について話しましょう。 +## textContent の理解 + `textContent`は要素のプレーンテキスト内容を返し、子孫要素内のすべてのテキストを含みます。 `innerText`と`textContent`の最も重要な違いは、`textContent`は要素とその子孫のテキスト内容を常に完全に返すことで、表示されているか非表示かは関係ありません。 @@ -181,6 +187,8 @@ container.textContent = "New content"; ::: +## innerHTML との比較 + 最後に、`textContent`と`innerText`が`innerHTML`とどう違うか話しましょう。 `innerHTML`を使うと要素の内部HTML内容を設定できます。これはDOMに新しいHTMLを動的に挿入するのに便利です。 @@ -189,6 +197,8 @@ container.textContent = "New content"; これを避けるために、プレーンテキストを挿入するには`textContent`プロパティを使うことをお勧めします。 +## 主要な違いのまとめ + JavaScriptの`innerText`、`textContent`、`innerHTML`プロパティは、HTML要素の内容にアクセスし操作する異なる方法を提供します。HTMLコンテンツをJavaScriptで効果的に扱うには、これらのプロパティの違いを理解することが重要です。 # --questions-- @@ -219,7 +229,7 @@ HTML要素の可視テキスト内容を返し、非表示のテキストや非 --- -すべての上記。 +上記のすべてです。 ### --feedback-- @@ -255,7 +265,7 @@ HTML要素の可視テキスト内容を返し、非表示のテキストや非 --- -上記のどれでもない。 +上記のどれでもありません。 ### --feedback-- @@ -291,7 +301,7 @@ HTML要素の可視テキスト内容を返し、非表示のテキストや非 --- -すべての上記。 +上記のすべてです。 ### --feedback-- diff --git a/curriculum/challenges/japanese/blocks/machine-learning-with-python-projects/5e46f8d6ac417301a38fb92d.md b/curriculum/challenges/japanese/blocks/machine-learning-with-python-projects/5e46f8d6ac417301a38fb92d.md index b0a8acc7cdb..48c717eadf2 100644 --- a/curriculum/challenges/japanese/blocks/machine-learning-with-python-projects/5e46f8d6ac417301a38fb92d.md +++ b/curriculum/challenges/japanese/blocks/machine-learning-with-python-projects/5e46f8d6ac417301a38fb92d.md @@ -10,7 +10,7 @@ dashedName: rock-paper-scissors このチャレンジでは、じゃんけんゲームをプレイするプログラムを作成します。ランダムに手を選ぶプログラムは通常50%の確率で勝ちます。このチャレンジをクリアするには、4つの異なるボットと対戦し、それぞれの対戦で少なくとも60%の勝率を達成する必要があります。 -<a href="https://app.ona.com/?autostart=true#https://github.com/freeCodeCamp/boilerplate-rock-paper-scissors/" target="_blank" rel="noopener noreferrer nofollow">Onaのスターターコード</a>を使ってこのプロジェクトに取り組みます。 +このプロジェクトは<a href="https://codespaces.new/freeCodeCamp/boilerplate-rock-paper-scissors/" target="_blank" rel="noopener noreferrer nofollow">スターターコードを使って進めます</a>。 機械学習カリキュラムのインタラクティブな指導部分はまだ開発中です。今のところ、このチャレンジをクリアするには他のリソースを使って学習してください。 diff --git a/curriculum/challenges/japanese/blocks/review-introduction-to-express/6a0354d43d4c00eca38561f7.md b/curriculum/challenges/japanese/blocks/review-introduction-to-express/6a0354d43d4c00eca38561f7.md index f72f52d47ce..c624f3825e1 100644 --- a/curriculum/challenges/japanese/blocks/review-introduction-to-express/6a0354d43d4c00eca38561f7.md +++ b/curriculum/challenges/japanese/blocks/review-introduction-to-express/6a0354d43d4c00eca38561f7.md @@ -7,53 +7,6 @@ dashedName: review-introduction-to-express # --description-- -## ウェブサービスとAPI - -- **API(アプリケーションプログラミングインターフェース)**:ソフトウェア同士が通信するための一般的な方法です。 -- **ウェブサービス**:HTTPなどのウェブ技術を使ってネットワーク上でデータを交換する特定のタイプのAPIです。すべてのウェブサービスはAPIですが、すべてのAPIがウェブサービスというわけではありません。 -- **ウェブサービスの主な特徴**:サーバー上で動作し、機械間通信を可能にし、言語やプラットフォームに依存せず、標準的なウェブプロトコル(HTTP/HTTPS、FTP、SMTP)を使用します。 -- **REST(表現状態転送)**:現在最も広く使われているウェブサービスのタイプです。`/users`や`/users/20`のようなURLパスで識別されるリソースを公開します。レスポンスは通常JSONですが、XMLやプレーンテキストの場合もあります。 -- **SOAP(シンプルオブジェクトアクセスプロトコル)**:XMLのみを使用します。より厳格な標準やセキュリティが必要な企業システムでよく使われます。 -- **XML-RPC**:リクエストとレスポンスをXMLでエンコードします。軽量ですがRESTより柔軟性は低いです。 -- **`Accept`ヘッダー**:クライアントがサーバーにどのレスポンス形式を望むかを伝えるために使います。例えば`Accept: application/json`です。 - -## RESTアーキテクチャ - -- **ステートレス**:すべてのリクエストはサーバーが処理に必要な情報をすべて含んでいなければなりません。サーバーは前のリクエストを記憶しません。 -- **リソース**:アクセスまたは変更できるデータの一部で、URL(例えば`/products/1`)で識別されます。 -- **RESTのHTTPメソッド**: - - `GET` — リソースを取得する - - `POST` — 新しいリソースを作成する - - `PUT` / `PATCH` — 既存のリソースを更新する - - `DELETE` — リソースを削除する - -## HTTPステータスコード - -リクエスト処理後、サーバーは結果を示す**ステータスコード**でレスポンスします: - -- `200` **(OK)**:リクエストは成功しました -- `201` **(Created)**:新しいリソースが作成されました -- `400` **(Bad Request)**:クライアントが無効なデータを送信しました -- `404` **(Not Found)**:要求されたリソースは存在しません -- `500` **(Internal Server Error)**:サーバーでエラーが発生しました - -### RESTリクエストの流れ - -1. クライアントがメソッド、URL、任意のヘッダーやボディを含むリクエストを送信します。 -2. サーバーがリクエストを検証し、リソースを特定します。 -3. サーバーがアクション(取得、作成、更新、削除)を実行します。 -4. サーバーがステータスコードと任意のボディ(通常はJSON)を含むレスポンスを作成します。 -5. サーバーがレスポンスを送信し、クライアントの状態は保存されません。 -6. クライアントがステータスコードを確認し、返されたデータを処理します。 - -## モノリスとマイクロサービス - -- **モノリス**:UI、データベース、APIがすべて一つの大きなコードベースにまとまっている構造です。小規模なアプリには適していますが、規模が大きくなると保守やスケールが難しくなります。 -- **マイクロサービス**:大きなアプリを小さく独立したサービスに分割するアーキテクチャです。各サービスは一つのビジネス機能(例えば商品、注文、支払い)を担当し、それぞれ独自のコードベース、データベース、チームを持つことができます。 -- **マイクロサービスの通信方法**:APIやメッセージベースのシステムを通じて行います。 -- **マイクロサービスの利点**:開発が速く、障害の影響範囲が限定され、サービスごとに異なる言語やフレームワークを使う自由があります。 -- **マイクロサービスの課題**:デバッグが複雑になり、インフラ管理が難しくなり、サービス間のネットワーク負荷が増えます。 - ## Express.jsとは? - **Express**:Node.js上に構築された最小限で柔軟なウェブフレームワークで、ウェブサーバーやAPIの構築を簡単にします。 diff --git a/curriculum/challenges/japanese/blocks/review-rest-api-and-web-services/6a7c78ad958a597ee788ad2a.md b/curriculum/challenges/japanese/blocks/review-rest-api-and-web-services/6a7c78ad958a597ee788ad2a.md new file mode 100644 index 00000000000..3d9117d4382 --- /dev/null +++ b/curriculum/challenges/japanese/blocks/review-rest-api-and-web-services/6a7c78ad958a597ee788ad2a.md @@ -0,0 +1,59 @@ +--- +id: 6a7c78ad958a597ee788ad2a +title: REST APIとウェブサービスのレビュー +challengeType: 31 +dashedName: review-rest-api-and-web-services +--- + +# --description-- + +## ウェブサービスとAPI + +- **API(アプリケーションプログラミングインターフェース)**:ソフトウェア同士が通信するための一般的な方法です。 +- **ウェブサービス**:HTTPなどのウェブ技術を使ってネットワーク上でデータを交換する特定のタイプのAPIです。すべてのウェブサービスはAPIですが、すべてのAPIがウェブサービスというわけではありません。 +- **ウェブサービスの主な特徴**:サーバー上で動作し、機械間通信を可能にし、言語やプラットフォームに依存せず、標準的なウェブプロトコル(HTTP/HTTPS、FTP、SMTP)を使用します。 +- **REST(表現状態転送)**:現在最も広く使われているウェブサービスのタイプです。`/users`や`/users/20`のようなURLパスで識別されるリソースを公開します。レスポンスは通常JSONですが、XMLやプレーンテキストの場合もあります。 +- **SOAP(シンプルオブジェクトアクセスプロトコル)**:XMLのみを使用します。より厳格な標準やセキュリティが必要な企業システムでよく使われます。 +- **XML-RPC**:リクエストとレスポンスをXMLでエンコードします。軽量ですがRESTより柔軟性は低いです。 +- **`Accept`ヘッダー**:クライアントがサーバーにどのレスポンス形式を望むかを伝えるために使います。例えば`Accept: application/json`です。 + +## RESTアーキテクチャ + +- **ステートレス**:すべてのリクエストはサーバーが処理に必要な情報をすべて含んでいなければなりません。サーバーは前のリクエストを記憶しません。 +- **リソース**:アクセスまたは変更できるデータの一部で、URL(例えば`/products/1`)で識別されます。 +- **RESTのHTTPメソッド**: + - `GET` — リソースを取得する + - `POST` — 新しいリソースを作成する + - `PUT` / `PATCH` — 既存のリソースを更新する + - `DELETE` — リソースを削除する + +## HTTPステータスコード + +リクエスト処理後、サーバーは結果を示す**ステータスコード**でレスポンスします: + +- `200` **(OK)**:リクエストは成功しました +- `201` **(Created)**:新しいリソースが作成されました +- `400` **(Bad Request)**:クライアントが無効なデータを送信しました +- `404` **(Not Found)**:要求されたリソースは存在しません +- `500` **(Internal Server Error)**:サーバーでエラーが発生しました + +### RESTリクエストの流れ + +1. クライアントがメソッド、URL、任意のヘッダーやボディを含むリクエストを送信します。 +2. サーバーがリクエストを検証し、リソースを特定します。 +3. サーバーがアクション(取得、作成、更新、削除)を実行します。 +4. サーバーがステータスコードと任意のボディ(通常はJSON)を含むレスポンスを作成します。 +5. サーバーがレスポンスを送信し、クライアントの状態は保存されません。 +6. クライアントがステータスコードを確認し、返されたデータを処理します。 + +## モノリスとマイクロサービス + +- **モノリス**:UI、データベース、APIがすべて一つの大きなコードベースにまとまっている構造です。小規模なアプリには適していますが、規模が大きくなると保守やスケールが難しくなります。 +- **マイクロサービス**:大きなアプリを小さく独立したサービスに分割するアーキテクチャです。各サービスは一つのビジネス機能(例えば商品、注文、支払い)を担当し、それぞれ独自のコードベース、データベース、チームを持つことができます。 +- **マイクロサービスの通信方法**:APIやメッセージベースのシステムを通じて行います。 +- **マイクロサービスの利点**:開発が速く、障害の影響範囲が限定され、サービスごとに異なる言語やフレームワークを使う自由があります。 +- **マイクロサービスの課題**:デバッグが複雑になり、インフラ管理が難しくなり、サービス間のネットワーク負荷が増えます。 + +# --assignment-- + +REST APIとウェブサービスのトピックと概念をレビューしてください。 diff --git a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e89d557d4b78bf83a02ae6.md b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e89d557d4b78bf83a02ae6.md index c6e42461804..9d58a41979d 100644 --- a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e89d557d4b78bf83a02ae6.md +++ b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e89d557d4b78bf83a02ae6.md @@ -396,10 +396,10 @@ body { const { useState } = React; export const FootballPlayerCard = () => { - return ( + return ( --fcc-editable-region-- - <h1 style={{ backgroundColor: '#fff' }}>Hello, TSX!</h1> + <h1 style={{ backgroundColor: "#fff" }}>Hello, TSX!</h1> --fcc-editable-region-- - ) + ); }; ``` diff --git a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb2.md b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb2.md index 2adefae5ae3..cd808453f55 100644 --- a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb2.md +++ b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb2.md @@ -29,12 +29,10 @@ assert.equal(element?.type, window.index.PlayerCard); <meta charset="utf-8"/> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Football Player Card Builder - - - + @@ -379,21 +377,18 @@ body { ```tsx const { useState } = React; -export function PlayerCard() { +export const PlayerCard = () => { return ( -
- -
+
); -} +}; export const FootballPlayerCard = () => { - + --fcc-editable-region-- return ( - --fcc-editable-region-- -

Football Card Builder

- --fcc-editable-region-- - ) +

Football Card Builder

+ ); + --fcc-editable-region-- }; ``` diff --git a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb3.md b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb3.md index 171bdb75115..42145f34457 100644 --- a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb3.md +++ b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb3.md @@ -382,15 +382,13 @@ export const PlayerCard = () => { return (
--fcc-editable-region-- - + --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { - return ( - - ); + return ; }; ``` diff --git a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb4.md b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb4.md index c691a3437cd..d95e5e1a1e5 100644 --- a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb4.md +++ b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb4.md @@ -381,12 +381,12 @@ export const PlayerCard = () => {
--fcc-editable-region-- - + --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb5.md b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb5.md index dea603322f7..c91072d061b 100644 --- a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb5.md +++ b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb5.md @@ -394,13 +394,13 @@ export const PlayerCard = () => {
--fcc-editable-region-- - + --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb6.md b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb6.md index 5b772f04fdd..e4b0439b524 100644 --- a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb6.md +++ b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb6.md @@ -390,14 +390,14 @@ export const PlayerCard = () => {
98
--fcc-editable-region-- - + --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb7.md b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb7.md index d9891cc4794..310f952c5c4 100644 --- a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb7.md +++ b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb7.md @@ -398,13 +398,13 @@ export const PlayerCard = () => {
ST
--fcc-editable-region-- - + --fcc-editable-region-- ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb8.md b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb8.md index d15a8bd0ae5..45e2d1bdc0b 100644 --- a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb8.md +++ b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb8.md @@ -394,14 +394,14 @@ export const PlayerCard = () => {
GOLD
--fcc-editable-region-- - + --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb9.md b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb9.md index ecf4c2457b6..e7e5f2ab3c2 100644 --- a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb9.md +++ b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb9.md @@ -393,12 +393,12 @@ export const PlayerCard = () => { --fcc-editable-region-- - + --fcc-editable-region-- ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bba.md b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bba.md index 639a84446c1..eb0ced98d61 100644 --- a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bba.md +++ b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bba.md @@ -1,6 +1,6 @@ --- id: 69e8b295388ebbd517692bba -title: ステップ 11 +title: ステップ11 challengeType: 0 dashedName: step-11 --- @@ -412,13 +412,13 @@ export const PlayerCard = () => {
--fcc-editable-region-- - + --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbb.md b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbb.md index 6b415cf6ebb..d41b3420c68 100644 --- a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbb.md +++ b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbb.md @@ -406,12 +406,12 @@ export const PlayerCard = () => { Edson Arantes do Nascimento (Pele) headshot --fcc-editable-region-- - + --fcc-editable-region-- ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbc.md b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbc.md index 54257e95fa5..d1e380cb0a4 100644 --- a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbc.md +++ b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbc.md @@ -409,12 +409,12 @@ export const PlayerCard = () => { PELE --fcc-editable-region-- - + --fcc-editable-region-- ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbd.md b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbd.md index f29a81e6a09..d578bfef635 100644 --- a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbd.md +++ b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbd.md @@ -427,13 +427,13 @@ export const PlayerCard = () => { --fcc-editable-region-- - + --fcc-editable-region-- ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbe.md b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbe.md index cb7068b5831..1d56607c225 100644 --- a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbe.md +++ b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbe.md @@ -465,7 +465,7 @@ export const PlayerCard = () => { ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbf.md b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbf.md index 127d4d8218b..75a79e7c7d8 100644 --- a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbf.md +++ b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbf.md @@ -420,7 +420,7 @@ interface PlayerData { position: string; club: string; --fcc-editable-region-- - + --fcc-editable-region-- } @@ -478,7 +478,7 @@ export const PlayerCard = () => { ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc0.md b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc0.md index 1b971d2add6..c840bd564ef 100644 --- a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc0.md +++ b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc0.md @@ -497,7 +497,7 @@ export const PlayerCard = () => { ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc1.md b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc1.md index ccbc787359c..5c7ccba8035 100644 --- a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc1.md +++ b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc1.md @@ -398,10 +398,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } --fcc-editable-region-- @@ -460,7 +460,7 @@ export const PlayerCard = () => { ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc2.md b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc2.md index 315f8319ad8..55e61be424b 100644 --- a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc2.md +++ b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc2.md @@ -40,12 +40,10 @@ assert.exists(document.querySelector('.card-wrapper.tier-elite')); Football Player Card Builder - - - + @@ -405,10 +403,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -467,9 +465,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc3.md b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc3.md index ccdc4104fa3..409dbd99820 100644 --- a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc3.md +++ b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc3.md @@ -399,10 +399,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -461,9 +461,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc4.md b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc4.md index bd480f347d3..fcd34f3cd2e 100644 --- a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc4.md +++ b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc4.md @@ -399,10 +399,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -461,9 +461,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc5.md b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc5.md index 1413d3f772e..bed9a15ddcd 100644 --- a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc5.md +++ b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc5.md @@ -392,10 +392,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -456,9 +456,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc6.md b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc6.md index c69675424bd..89805717c7a 100644 --- a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc6.md +++ b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc6.md @@ -401,10 +401,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -465,9 +465,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc7.md b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc7.md index f82ab5ed867..67bfc8d3805 100644 --- a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc7.md +++ b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc7.md @@ -391,10 +391,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -455,9 +455,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc8.md b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc8.md index 3e6f1aff562..4be00e25fdf 100644 --- a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc8.md +++ b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc8.md @@ -407,10 +407,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -436,9 +436,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { {player.name}
- --fcc-editable-region--
+ --fcc-editable-region-- 97 PAC
@@ -448,10 +448,10 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
83 + --fcc-editable-region-- PAS
- --fcc-editable-region--
@@ -471,9 +471,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc9.md b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc9.md index c03a720a2b6..973e37c2900 100644 --- a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc9.md +++ b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc9.md @@ -483,10 +483,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -545,13 +545,13 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
); -} +}; --fcc-editable-region-- --fcc-editable-region-- export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bca.md b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bca.md index bc531a70c68..c37f60e1423 100644 --- a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bca.md +++ b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bca.md @@ -419,10 +419,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -481,14 +481,14 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { - name: 'PELE', + name: "PELE", overallRating: 98, - position: 'ST', - club: 'Santos FC', - imageUrl: 'https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg', + position: "ST", + club: "Santos FC", + imageUrl: "https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg", pac: 97, sho: 98, pas: 83, diff --git a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcb.md b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcb.md index 6dc2eaaa63a..ad90a00b275 100644 --- a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcb.md +++ b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcb.md @@ -435,10 +435,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -497,14 +497,14 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { - name: 'PELE', + name: "PELE", overallRating: 98, - position: 'ST', - club: 'Santos FC', - imageUrl: 'https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg', + position: "ST", + club: "Santos FC", + imageUrl: "https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg", pac: 97, sho: 98, pas: 83, @@ -517,6 +517,7 @@ export const FootballPlayerCard = () => { const [player, setPlayer] = useState(defaultPlayer); return ( --fcc-editable-region-- + --fcc-editable-region-- ); diff --git a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcc.md b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcc.md index ff6522d90a8..aa3583484c5 100644 --- a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcc.md +++ b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcc.md @@ -477,7 +477,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -504,7 +504,9 @@ export const FootballPlayerCard = () => { --fcc-editable-region-- + + --fcc-editable-region-- ); diff --git a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcd.md b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcd.md index df9c21ec7ff..e0c174f4d9e 100644 --- a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcd.md +++ b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcd.md @@ -465,7 +465,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bce.md b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bce.md index 0e59a8495da..325758c0679 100644 --- a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bce.md +++ b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bce.md @@ -470,7 +470,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcf.md b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcf.md index adf103c2fdd..c01948de208 100644 --- a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcf.md +++ b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcf.md @@ -488,7 +488,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd0.md b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd0.md index 2689995502b..3741af0d626 100644 --- a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd0.md +++ b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd0.md @@ -471,7 +471,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd1.md b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd1.md index 4746cc895a2..49d55b7bca2 100644 --- a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd1.md +++ b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd1.md @@ -471,7 +471,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd2.md b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd2.md index 9950ca8cc41..bb4d8a137b5 100644 --- a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd2.md +++ b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd2.md @@ -471,7 +471,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -535,7 +535,7 @@ export const FootballPlayerCard = () => { - --fcc-editable-region-- + --fcc-editable-region-- --fcc-editable-region-- diff --git a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd3.md b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd3.md index 54e9f7bd089..89c214ca1c8 100644 --- a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd3.md +++ b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd3.md @@ -497,7 +497,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd4.md b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd4.md index c34da158f45..dc80649aa6f 100644 --- a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd4.md +++ b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd4.md @@ -497,7 +497,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd5.md b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd5.md index d13bcf252c9..13389c7b7e2 100644 --- a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd5.md +++ b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd5.md @@ -497,7 +497,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -609,3 +609,4 @@ export const FootballPlayerCard = () => { ); }; ``` + diff --git a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd6.md b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd6.md index 7831cef07ca..c41d7d3ac04 100644 --- a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd6.md +++ b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd6.md @@ -470,7 +470,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd7.md b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd7.md index aac4136b06b..6644aa25105 100644 --- a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd7.md +++ b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd7.md @@ -478,7 +478,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -609,3 +609,4 @@ export const FootballPlayerCard = () => { ); }; ``` + diff --git a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd8.md b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd8.md index a37de90f588..864b4be6bfb 100644 --- a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd8.md +++ b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd8.md @@ -410,7 +410,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -484,7 +484,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -538,8 +538,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd9.md b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd9.md index 97a3b1622f6..ace6dfababe 100644 --- a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd9.md +++ b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd9.md @@ -402,7 +402,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -476,7 +476,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -530,8 +530,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bda.md b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bda.md index 671320a6498..dbafb047519 100644 --- a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bda.md +++ b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bda.md @@ -402,7 +402,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -476,7 +476,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -530,8 +530,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( @@ -640,3 +641,4 @@ export const FootballPlayerCard = () => { ); }; ``` + diff --git a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdb.md b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdb.md index fdeb6815c2a..60472c35f7e 100644 --- a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdb.md +++ b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdb.md @@ -402,7 +402,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -476,7 +476,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -530,8 +530,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdc.md b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdc.md index d476006de85..5921dfe6a91 100644 --- a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdc.md +++ b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdc.md @@ -402,7 +402,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -476,7 +476,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -530,8 +530,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdd.md b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdd.md index 819dbca7fd3..9d756b2600a 100644 --- a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdd.md +++ b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdd.md @@ -402,7 +402,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -476,7 +476,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -530,8 +530,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bde.md b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bde.md index f4bcc9a680f..e529def8053 100644 --- a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bde.md +++ b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bde.md @@ -402,7 +402,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -414,10 +414,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -430,7 +430,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
{player.position}
-
{getPlayerTier(player.overallRating).toUpperCase()}
+
+ {getPlayerTier(player.overallRating).toUpperCase()} +
{player.club}
@@ -474,14 +476,14 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { - name: 'PELE', + name: "PELE", overallRating: 98, - position: 'ST', - club: 'Santos FC', - imageUrl: 'https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg', + position: "ST", + club: "Santos FC", + imageUrl: "https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg", pac: 97, sho: 98, pas: 83, @@ -506,8 +508,18 @@ export const FootballPlayerCard = () => {

Player Info

- - setPlayer({ ...player, name: e.target.value })} /> + + + setPlayer({ ...player, name: e.target.value }) + } + />
@@ -518,8 +530,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( @@ -531,46 +544,115 @@ export const FootballPlayerCard = () => {
- - setPlayer({ ...player, overallRating: Number(e.target.value) })} /> + + + setPlayer({ + ...player, + overallRating: Number(e.target.value), + }) + } + />
- - setPlayer({ ...player, club: e.target.value })} /> + + + setPlayer({ ...player, club: e.target.value }) + } + />
- - setPlayer({ ...player, imageUrl: e.target.value })} /> + + + setPlayer({ ...player, imageUrl: e.target.value }) + } + />

Player Stats

- - setPlayer({ ...player, pac: Number(e.target.value) })} /> + + + setPlayer({ ...player, pac: Number(e.target.value) }) + } + />
- - setPlayer({ ...player, sho: Number(e.target.value) })} /> + + + setPlayer({ ...player, sho: Number(e.target.value) }) + } + />
- - setPlayer({ ...player, pas: Number(e.target.value) })} /> + + + setPlayer({ ...player, pas: Number(e.target.value) }) + } + />
- + --fcc-editable-region-- --fcc-editable-region--
- +
- +
@@ -579,7 +661,9 @@ export const FootballPlayerCard = () => {

Live Preview

Updates as you type

-
+
@@ -589,3 +673,4 @@ export const FootballPlayerCard = () => { ); }; ``` + diff --git a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdf.md b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdf.md index 3f4519f1942..8ab44b735a7 100644 --- a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdf.md +++ b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdf.md @@ -421,7 +421,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -495,7 +495,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -549,8 +549,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( @@ -667,11 +668,11 @@ export const FootballPlayerCard = () => { } /> - --fcc-editable-region--
+ --fcc-editable-region--
@@ -679,8 +680,8 @@ export const FootballPlayerCard = () => { PHY -
--fcc-editable-region-- + diff --git a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8d1be04ed6aad1c955729.md b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8d1be04ed6aad1c955729.md index 30149e6fb8f..a53742888dd 100644 --- a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8d1be04ed6aad1c955729.md +++ b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69e8d1be04ed6aad1c955729.md @@ -391,8 +391,8 @@ const { useState } = React; --fcc-editable-region-- export const FootballPlayerCard = () => { - return ( -

Football Card Builder

- ) + return ( +

Football Card Builder

+ ); }; ``` diff --git a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69ea01c45b04f3e9de845036.md b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69ea01c45b04f3e9de845036.md index e1703a5ab6c..7ec0745b866 100644 --- a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69ea01c45b04f3e9de845036.md +++ b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69ea01c45b04f3e9de845036.md @@ -405,7 +405,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -483,7 +483,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -537,8 +537,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69ea02adff0fd528639ee23b.md b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69ea02adff0fd528639ee23b.md index aa67d813249..6e29e09c683 100644 --- a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69ea02adff0fd528639ee23b.md +++ b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69ea02adff0fd528639ee23b.md @@ -409,7 +409,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -485,7 +485,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -543,8 +543,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69ea0349f8305a99324465ff.md b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69ea0349f8305a99324465ff.md index 56d9950d63b..9953ffe612f 100644 --- a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69ea0349f8305a99324465ff.md +++ b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69ea0349f8305a99324465ff.md @@ -407,7 +407,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -483,7 +483,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -502,11 +502,9 @@ const defaultPlayer: PlayerData = { function loadPlayer(): PlayerData { try { --fcc-editable-region-- - - --fcc-editable-region-- - } catch (error) { - } + --fcc-editable-region-- + } catch (error) {} } export const FootballPlayerCard = () => { @@ -547,8 +545,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69ea044f8c93a5e7ce64214c.md b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69ea044f8c93a5e7ce64214c.md index c57e15b2935..770390b9e5a 100644 --- a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69ea044f8c93a5e7ce64214c.md +++ b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69ea044f8c93a5e7ce64214c.md @@ -395,7 +395,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -471,7 +471,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -492,12 +492,10 @@ function loadPlayer(): PlayerData { const saved = localStorage.getItem(STORAGE_KEY); if (saved) { --fcc-editable-region-- - + --fcc-editable-region-- - }; - } catch (error) { - - } + } + } catch (error) {} } export const FootballPlayerCard = () => { @@ -538,8 +536,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69ea0577f25e519489353f82.md b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69ea0577f25e519489353f82.md index 84b9aad8969..b56538f83fd 100644 --- a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69ea0577f25e519489353f82.md +++ b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69ea0577f25e519489353f82.md @@ -405,7 +405,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -418,7 +418,6 @@ interface PlayerData { const STORAGE_KEY = "football_player_card"; - export function getPlayerTier(rating: number): string { if (rating >= 92) return "elite"; if (rating >= 85) return "gold"; @@ -482,7 +481,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -505,14 +504,15 @@ function loadPlayer(): PlayerData { return { ...defaultPlayer, ...JSON.parse(saved) - } - }; ---fcc-editable-region-- + }; + } } catch (error) { +--fcc-editable-region-- } -} + --fcc-editable-region-- +} export const FootballPlayerCard = () => { const [player, setPlayer] = useState(defaultPlayer); @@ -552,8 +552,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69ea064edb0dcc46e1422cca.md b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69ea064edb0dcc46e1422cca.md index d8d0ec1e43c..674d0d0fb8b 100644 --- a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69ea064edb0dcc46e1422cca.md +++ b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69ea064edb0dcc46e1422cca.md @@ -401,7 +401,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -477,7 +477,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -500,8 +500,8 @@ function loadPlayer(): PlayerData { return { ...defaultPlayer, ...JSON.parse(saved) - } - }; + }; + } } catch (error) { console.log("Failed to load player data, using defaults:", error); } @@ -546,8 +546,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69ea0939f2f92cfc6c7a850d.md b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69ea0939f2f92cfc6c7a850d.md index 4e1f2b13074..8f7bd949002 100644 --- a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69ea0939f2f92cfc6c7a850d.md +++ b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69ea0939f2f92cfc6c7a850d.md @@ -46,12 +46,10 @@ assert.match(__helpers.removeJSComments(code), /useEffect\s*\(\(\)\s=>\s*\{\s*tr Football Player Card Builder - - - + @@ -415,7 +413,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -435,7 +433,7 @@ export function getPlayerTier(rating: number): string { return "bronze"; } -function PlayerCard({ player }: { player: PlayerData }) { +export const PlayerCard = ({ player }: { player: PlayerData }) => { return (
@@ -491,7 +489,7 @@ function PlayerCard({ player }: { player: PlayerData }) {
); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -514,8 +512,8 @@ function loadPlayer(): PlayerData { return { ...defaultPlayer, ...JSON.parse(saved) - } - }; + }; + } } catch (error) { console.log("Failed to load player data, using defaults:", error); } @@ -526,7 +524,7 @@ export const FootballPlayerCard = () => { const [player, setPlayer] = useState(defaultPlayer); --fcc-editable-region-- - + --fcc-editable-region-- return ( @@ -565,8 +563,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69ea0a89bd84cf2461b48ceb.md b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69ea0a89bd84cf2461b48ceb.md index 736d5b90b22..4426f1632aa 100644 --- a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69ea0a89bd84cf2461b48ceb.md +++ b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69ea0a89bd84cf2461b48ceb.md @@ -403,7 +403,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -479,7 +479,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -502,8 +502,8 @@ function loadPlayer(): PlayerData { return { ...defaultPlayer, ...JSON.parse(saved) - } - }; + }; + } } catch (error) { console.log("Failed to load player data, using defaults:", error); } @@ -513,15 +513,15 @@ function loadPlayer(): PlayerData { export const FootballPlayerCard = () => { const [player, setPlayer] = useState(defaultPlayer); ---fcc-editable-region-- useEffect(() => { try { +--fcc-editable-region-- } catch (error) { +--fcc-editable-region-- } }, [player]); ---fcc-editable-region-- return (
@@ -559,8 +559,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69ea0bb3e7000f44c207bb0e.md b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69ea0bb3e7000f44c207bb0e.md index 06d6352db0c..f4f2febfde3 100644 --- a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69ea0bb3e7000f44c207bb0e.md +++ b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69ea0bb3e7000f44c207bb0e.md @@ -401,7 +401,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -477,7 +477,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -500,8 +500,8 @@ function loadPlayer(): PlayerData { return { ...defaultPlayer, ...JSON.parse(saved) - } - }; + }; + } } catch (error) { console.log("Failed to load player data, using defaults:", error); } @@ -557,8 +557,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( @@ -1098,7 +1099,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -1174,7 +1175,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -1197,8 +1198,8 @@ function loadPlayer(): PlayerData { return { ...defaultPlayer, ...JSON.parse(saved) - } - }; + }; + } } catch (error) { console.log("Failed to load player data, using defaults:", error); } @@ -1252,8 +1253,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69ea1bb4a66dd6debb999c7f.md b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69ea1bb4a66dd6debb999c7f.md index bd12099b7b9..a9538426b0c 100644 --- a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69ea1bb4a66dd6debb999c7f.md +++ b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69ea1bb4a66dd6debb999c7f.md @@ -473,7 +473,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69ea1dd8e74976afa407bf22.md b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69ea1dd8e74976afa407bf22.md index 0fbeacdae7b..73fbe0b351b 100644 --- a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69ea1dd8e74976afa407bf22.md +++ b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69ea1dd8e74976afa407bf22.md @@ -479,7 +479,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69ea1ed1543a4db863564aac.md b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69ea1ed1543a4db863564aac.md index e9dcddbda5a..6c789482ed8 100644 --- a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69ea1ed1543a4db863564aac.md +++ b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69ea1ed1543a4db863564aac.md @@ -472,7 +472,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69ea21dcd8c4cb48c23a2c67.md b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69ea21dcd8c4cb48c23a2c67.md index e523898d95c..a4bd56e35e2 100644 --- a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69ea21dcd8c4cb48c23a2c67.md +++ b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69ea21dcd8c4cb48c23a2c67.md @@ -14,7 +14,7 @@ dashedName: step-53 あなたの位置 `select` には、`onChange` をスプレッドして `setPlayer` を呼び出し、`player` を更新する `position` ハンドラが必要です。 ```js -assert.match(__helpers.removeJSComments(code), /onChange.*setPlayer.*\.\.\.\s*player[\s\S]*position/); +assert.match(__helpers.removeJSComments(code), /onChange=\{[\s\S]*?position:\s*e\.target\.value\s+as\s+Position/); ``` # --seed-- @@ -469,7 +469,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69ea2378f3c6a60a57cc29c3.md b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69ea2378f3c6a60a57cc29c3.md index 440c9e7155b..34dae2b6a8a 100644 --- a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69ea2378f3c6a60a57cc29c3.md +++ b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69ea2378f3c6a60a57cc29c3.md @@ -483,7 +483,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -537,10 +537,12 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > --fcc-editable-region-- - + --fcc-editable-region-- diff --git a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69eb216380522cfc11aa408c.md b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69eb216380522cfc11aa408c.md index a14c06ea4a7..965ebaadc75 100644 --- a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69eb216380522cfc11aa408c.md +++ b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69eb216380522cfc11aa408c.md @@ -443,7 +443,7 @@ export const PlayerCard = () => { ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69eb23665c115447405343ac.md b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69eb23665c115447405343ac.md index 75e5abbf422..30c21294001 100644 --- a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69eb23665c115447405343ac.md +++ b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69eb23665c115447405343ac.md @@ -461,7 +461,7 @@ export const PlayerCard = () => { ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69eb2847cc8f5638e226e8ce.md b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69eb2847cc8f5638e226e8ce.md index 6fbc85c1c00..3e607864e87 100644 --- a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69eb2847cc8f5638e226e8ce.md +++ b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69eb2847cc8f5638e226e8ce.md @@ -483,10 +483,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -543,7 +543,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { --fcc-editable-region-- diff --git a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69ed3985819de69de27c4390.md b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69ed3985819de69de27c4390.md index 88dfcc19417..70e34eabd63 100644 --- a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69ed3985819de69de27c4390.md +++ b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69ed3985819de69de27c4390.md @@ -391,10 +391,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -453,14 +453,14 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { - name: 'PELE', + name: "PELE", overallRating: 98, - position: 'ST', - club: 'Santos FC', - imageUrl: 'https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg', + position: "ST", + club: "Santos FC", + imageUrl: "https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg", pac: 97, sho: 98, pas: 83, @@ -471,7 +471,7 @@ const defaultPlayer: PlayerData = { export const FootballPlayerCard = () => { --fcc-editable-region-- - return ; + return ; --fcc-editable-region-- }; ``` diff --git a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69f1a6f57dd2d4685822074a.md b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69f1a6f57dd2d4685822074a.md index 71f32f3b9d8..8739bb89d24 100644 --- a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69f1a6f57dd2d4685822074a.md +++ b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69f1a6f57dd2d4685822074a.md @@ -401,8 +401,8 @@ export const PlayerCard = () => {
- --fcc-editable-region--
+ --fcc-editable-region--
@@ -410,14 +410,14 @@ export const PlayerCard = () => {
-
--fcc-editable-region-- +
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69f1a9e19340f19b1fd051c6.md b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69f1a9e19340f19b1fd051c6.md index 9ba4d1f98ad..5be854a917d 100644 --- a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69f1a9e19340f19b1fd051c6.md +++ b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69f1a9e19340f19b1fd051c6.md @@ -416,9 +416,9 @@ export const PlayerCard = () => {
- --fcc-editable-region--
+ --fcc-editable-region--
@@ -426,14 +426,14 @@ export const PlayerCard = () => {
+ --fcc-editable-region--
- --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69f1af24b0860d13f0b295e5.md b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69f1af24b0860d13f0b295e5.md index b4e9ae046c9..8eb8886af58 100644 --- a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69f1af24b0860d13f0b295e5.md +++ b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69f1af24b0860d13f0b295e5.md @@ -407,10 +407,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -451,9 +451,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
- --fcc-editable-region--
+ --fcc-editable-region-- 99 DRI
@@ -463,17 +463,17 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
75 + --fcc-editable-region-- PHY
- --fcc-editable-region-- ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69f1b1fb36c6c0c80907e8e1.md b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69f1b1fb36c6c0c80907e8e1.md index f8b55897864..ea933f1cec9 100644 --- a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69f1b1fb36c6c0c80907e8e1.md +++ b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69f1b1fb36c6c0c80907e8e1.md @@ -483,7 +483,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -511,17 +511,15 @@ export const FootballPlayerCard = () => {
- --fcc-editable-region-- -
- -
+
+ --fcc-editable-region--
+ --fcc-editable-region--
- --fcc-editable-region-- ); }; diff --git a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69f1b591221851200c734eb4.md b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69f1b591221851200c734eb4.md index ea3b0375c50..4006c77dcd3 100644 --- a/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69f1b591221851200c734eb4.md +++ b/curriculum/challenges/japanese/blocks/workshop-build-a-football-player-card-builder/69f1b591221851200c734eb4.md @@ -472,7 +472,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f356ed6199b0cdef1d2be8f.md b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f356ed6199b0cdef1d2be8f.md index 703647fff41..a9d6200d3f6 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f356ed6199b0cdef1d2be8f.md +++ b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f356ed6199b0cdef1d2be8f.md @@ -13,11 +13,11 @@ dashedName: step-22 ```css .class-name { - styles + property: value; } ``` -既存の`#menu`セレクターを、`#menu`を`.menu`という名前のクラスに置き換えてクラスセレクターに変更してください。 +既存の`#menu`セレクターを、`#menu`をクラスセレクターの`.menu`に置き換えてクラスセレクターに変更してください。 # --hints-- diff --git a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f3cade99dda4e6071a85dfd.md b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f3cade99dda4e6071a85dfd.md index 66b8abc8abc..2a845913566 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f3cade99dda4e6071a85dfd.md +++ b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f3cade99dda4e6071a85dfd.md @@ -109,7 +109,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f3ef6e01f288a026d709587.md b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f3ef6e01f288a026d709587.md index bbeb6d41e96..cf9401c0f92 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f3ef6e01f288a026d709587.md +++ b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f3ef6e01f288a026d709587.md @@ -171,7 +171,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f3ef6e03d719d5ac4738993.md b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f3ef6e03d719d5ac4738993.md index f9274afe883..56e6f999bd2 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f3ef6e03d719d5ac4738993.md +++ b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f3ef6e03d719d5ac4738993.md @@ -115,7 +115,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f3ef6e04559b939080db057.md b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f3ef6e04559b939080db057.md index 01a5ae36a21..9f4f1962e08 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f3ef6e04559b939080db057.md +++ b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f3ef6e04559b939080db057.md @@ -139,7 +139,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f3ef6e050279c7a4a7101d3.md b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f3ef6e050279c7a4a7101d3.md index 1f50d8401d1..5411047baa2 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f3ef6e050279c7a4a7101d3.md +++ b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f3ef6e050279c7a4a7101d3.md @@ -137,7 +137,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f3ef6e05473f91f948724ab.md b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f3ef6e05473f91f948724ab.md index caeb5f2b28d..6ffc6737a4d 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f3ef6e05473f91f948724ab.md +++ b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f3ef6e05473f91f948724ab.md @@ -116,6 +116,6 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f3ef6e056bdde6ae6892ba2.md b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f3ef6e056bdde6ae6892ba2.md index 985b68d5386..409a6e2ff8a 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f3ef6e056bdde6ae6892ba2.md +++ b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f3ef6e056bdde6ae6892ba2.md @@ -9,7 +9,7 @@ dashedName: step-54 すべてのテキストが同じ`font-family`だと少し退屈です。テキストの大部分は`sans-serif`のままにして、`h1`と`h2`の要素だけを別のセレクターで異なるものにできます。 -`h1`と`h2`の両方の要素に単一のセレクターを使ってスタイルを適用し、これらの要素のテキストが`Impact`フォントを使うようにしてください。 +`h1` と `h2` の両方の要素を単一のセレクターリストでスタイル設定し、これらの要素のテキストが `Impact` フォントを使うようにしてください。 # --hints-- @@ -135,7 +135,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f3ef6e06d34faac0447fc44.md b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f3ef6e06d34faac0447fc44.md index 00dda9d4108..66f12a1dc57 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f3ef6e06d34faac0447fc44.md +++ b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f3ef6e06d34faac0447fc44.md @@ -127,7 +127,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f3ef6e07276f782bb46b93d.md b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f3ef6e07276f782bb46b93d.md index 7dcdd5e4be6..344331a349f 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f3ef6e07276f782bb46b93d.md +++ b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f3ef6e07276f782bb46b93d.md @@ -142,7 +142,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f3ef6e0819d4f23ca7285e6.md b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f3ef6e0819d4f23ca7285e6.md index 6fb3995c591..6f9ea4c8d49 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f3ef6e0819d4f23ca7285e6.md +++ b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f3ef6e0819d4f23ca7285e6.md @@ -104,7 +104,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f3ef6e087d56ed3ffdc36be.md b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f3ef6e087d56ed3ffdc36be.md index 7a10f668dbf..53a70519f39 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f3ef6e087d56ed3ffdc36be.md +++ b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f3ef6e087d56ed3ffdc36be.md @@ -129,6 +129,6 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f3ef6e0a81099d9a697b550.md b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f3ef6e0a81099d9a697b550.md index 888c415be80..737ec1fdbc8 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f3ef6e0a81099d9a697b550.md +++ b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f3ef6e0a81099d9a697b550.md @@ -167,7 +167,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f3ef6e0b431cc215bb16f55.md b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f3ef6e0b431cc215bb16f55.md index 7386fad35c0..6a454138d4e 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f3ef6e0b431cc215bb16f55.md +++ b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f3ef6e0b431cc215bb16f55.md @@ -141,7 +141,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f3ef6e0e0c3feaebcf647ad.md b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f3ef6e0e0c3feaebcf647ad.md index fdd96bc6050..4442a50810b 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f3ef6e0e0c3feaebcf647ad.md +++ b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f3ef6e0e0c3feaebcf647ad.md @@ -103,7 +103,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f3ef6e0e9629bad967cd71e.md b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f3ef6e0e9629bad967cd71e.md index 2ab5d0f6b71..d400687495c 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f3ef6e0e9629bad967cd71e.md +++ b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f3ef6e0e9629bad967cd71e.md @@ -7,7 +7,7 @@ dashedName: step-55 # --description-- -フォントファミリーにフォールバック値を追加するには、カンマで区切った別のフォント名を追加します。フォールバックは、最初のフォントが見つからないまたは利用できない場合に使われます。 +`font-family` に対して、カンマで区切った別のフォント名を追加することで、フォールバックの値を設定できます。フォールバックは、最初のフォントが利用できない場合に使われます。 `serif` フォントの後にフォールバックフォント `Impact` を追加してください。 @@ -113,7 +113,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f3ef6e0eaa7da26e3d34d78.md b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f3ef6e0eaa7da26e3d34d78.md index d56aee7b0fd..10e97826e0e 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f3ef6e0eaa7da26e3d34d78.md +++ b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f3ef6e0eaa7da26e3d34d78.md @@ -128,7 +128,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f3ef6e0f8c230bdd2349716.md b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f3ef6e0f8c230bdd2349716.md index 9e6cbc4ebf5..05b427a339a 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f3ef6e0f8c230bdd2349716.md +++ b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f3ef6e0f8c230bdd2349716.md @@ -140,6 +140,6 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f3f26fa39591db45e5cd7a0.md b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f3f26fa39591db45e5cd7a0.md index 9ccc9dbf955..c08faadb905 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f3f26fa39591db45e5cd7a0.md +++ b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f3f26fa39591db45e5cd7a0.md @@ -150,7 +150,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f459225127805351a6ad057.md b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f459225127805351a6ad057.md index cf7c41d8695..803d3ebf143 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f459225127805351a6ad057.md +++ b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f459225127805351a6ad057.md @@ -144,7 +144,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f459a7ceb8b5c446656d88b.md b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f459a7ceb8b5c446656d88b.md index 612c7aa2148..74b32988689 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f459a7ceb8b5c446656d88b.md +++ b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f459a7ceb8b5c446656d88b.md @@ -147,6 +147,6 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f459cf202c2a3472fae6a9f.md b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f459cf202c2a3472fae6a9f.md index 88c42c10638..ecfb8f1deb5 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f459cf202c2a3472fae6a9f.md +++ b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f459cf202c2a3472fae6a9f.md @@ -7,7 +7,7 @@ dashedName: step-67 # --description-- -線の太さが大きく見えるのに気づきましたか?`border-width`要素のすべての辺に対して、`1px`という名前のプロパティのデフォルト値は`hr`です。ボーダーの色を背景と同じ色に変えると、線の全体の高さは`5px`になります(`3px`に加えて、`1px`の上下のボーダー幅が含まれます)。 +線の太さが大きく見えるのに気づきましたか?`hr`要素のすべての端に対する`border-width`という名前のプロパティのデフォルト値は`1px`です。線の合計の高さは常に`5px`(`3px`に上下のボーダー幅の`1px`を加えたもの)でした。ボーダーに色を付けることで、その端が見えるようになりました。 `height`の`hr`プロパティを`2px`に変更して、全体の高さが`4px`になるようにしてください。 @@ -147,7 +147,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f459fd48bdc98491ca6d1a3.md b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f459fd48bdc98491ca6d1a3.md index 6e2b3817b3b..b876386e8f6 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f459fd48bdc98491ca6d1a3.md +++ b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f459fd48bdc98491ca6d1a3.md @@ -145,7 +145,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f45a05977e2fa49d9119437.md b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f45a05977e2fa49d9119437.md index b1f38a813fe..d8acee288f1 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f45a05977e2fa49d9119437.md +++ b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f45a05977e2fa49d9119437.md @@ -146,6 +146,6 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f45a276c093334f0f6e9df4.md b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f45a276c093334f0f6e9df4.md index 02df1619047..fea3db6f42c 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f45a276c093334f0f6e9df4.md +++ b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f45a276c093334f0f6e9df4.md @@ -185,7 +185,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f45a5a7c49a8251f0bdb527.md b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f45a5a7c49a8251f0bdb527.md index 5d54ef983f3..0fbf56a8d74 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f45a5a7c49a8251f0bdb527.md +++ b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f45a5a7c49a8251f0bdb527.md @@ -157,7 +157,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f45a66d4a2b0453301e5a26.md b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f45a66d4a2b0453301e5a26.md index 1863dffab0e..a124c7294e6 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f45a66d4a2b0453301e5a26.md +++ b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f45a66d4a2b0453301e5a26.md @@ -166,7 +166,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f45b0731d39e15d54df4dfc.md b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f45b0731d39e15d54df4dfc.md index 1220aa1fe20..450f4d22fef 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f45b0731d39e15d54df4dfc.md +++ b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f45b0731d39e15d54df4dfc.md @@ -161,7 +161,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f45b25e7ec2405f166b9de1.md b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f45b25e7ec2405f166b9de1.md index b0b1336a958..f9640cad1d0 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f45b25e7ec2405f166b9de1.md +++ b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f45b25e7ec2405f166b9de1.md @@ -9,7 +9,7 @@ dashedName: step-78 リンクが訪問済みの場合にリンクのプロパティを変更するには、`a:visited { propertyName: propertyValue; }` のような疑似セレクターを使います。 -ユーザーがリンクを訪問したときに、フッターの `Visit our website` リンクの色を `grey` に変更してください。 +ユーザーがリンクを訪れたときに、フッターの`Visit our website`リンクの色を`gray`に変更してください。 # --hints-- @@ -20,14 +20,14 @@ const aVisitedStyle = new __helpers.CSSHelp(document).getStyle('a:visited'); assert.exists(aVisitedStyle); ``` -`color` プロパティを `grey` に設定してください。 +`color`プロパティを`gray`に設定してください。 ```js const hasColor = new __helpers.CSSHelp(document).getCSSRules().some(x => (x.style.color === 'grey' || x.style.color === 'gray')); assert.isTrue(hasColor); ``` -`a:visited` は `color` が `grey` である必要があります。 +`a:visited`の`color`は`gray`にしてください。 ```js const aVisitedColor = new __helpers.CSSHelp(document).getStyle('a:visited')?.getPropertyValue('color'); @@ -161,7 +161,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f45b3c93c027860d9298dbd.md b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f45b3c93c027860d9298dbd.md index 13686eac231..c2a4f8e7db8 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f45b3c93c027860d9298dbd.md +++ b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f45b3c93c027860d9298dbd.md @@ -161,7 +161,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ @@ -179,7 +179,7 @@ a { } a:visited { - color: grey; + color: gray; } --fcc-editable-region-- diff --git a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f45b45d099f3e621fbbb256.md b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f45b45d099f3e621fbbb256.md index 0d5cc979fad..6e706e2d50b 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f45b45d099f3e621fbbb256.md +++ b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f45b45d099f3e621fbbb256.md @@ -161,7 +161,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ @@ -179,7 +179,7 @@ a { } a:visited { - color: grey; + color: gray; } a:hover { diff --git a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f45b4c81cea7763550e40df.md b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f45b4c81cea7763550e40df.md index 07fcb1047c1..c3f3d968f8b 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f45b4c81cea7763550e40df.md +++ b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f45b4c81cea7763550e40df.md @@ -152,7 +152,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ @@ -171,7 +171,7 @@ a { --fcc-editable-region-- a:visited { - color: grey; + color: gray; } a:hover { diff --git a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f45b715301bbf667badc04a.md b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f45b715301bbf667badc04a.md index b72ea1fd3d2..985e8e243e0 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f45b715301bbf667badc04a.md +++ b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f45b715301bbf667badc04a.md @@ -7,7 +7,7 @@ dashedName: step-82 # --description-- -メニューのテキスト `CAMPER CAFE` は、メニューの下部にある住所のスペースとは異なる上部のスペースがあります。これはブラウザが `h1` 要素にデフォルトの上マージンを設定しているためです。 +メニューのテキスト `CAMPER CAFE` の上のスペースが、メニューの下部にある住所の下のスペースと一致していません。これはブラウザーが `h1` 要素にデフォルトの上マージンを持っているためです。 `h1` 要素の上マージンを `0` に変更して、すべての上マージンを取り除いてください。 @@ -157,7 +157,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f46e270702a8456a664f0df.md b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f46e270702a8456a664f0df.md index 30c489944f2..946d48804e3 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f46e270702a8456a664f0df.md +++ b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f46e270702a8456a664f0df.md @@ -156,7 +156,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f46e36e745ead58487aabf2.md b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f46e36e745ead58487aabf2.md index d5defa33b34..bed043d9039 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f46e36e745ead58487aabf2.md +++ b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f46e36e745ead58487aabf2.md @@ -163,7 +163,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f46e7a4750dd05b5a673920.md b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f46e7a4750dd05b5a673920.md index 613c0a55ae2..01818761604 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f46e7a4750dd05b5a673920.md +++ b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f46e7a4750dd05b5a673920.md @@ -160,7 +160,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f46e8284aae155c83015dee.md b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f46e8284aae155c83015dee.md index 3fad3fe8fa7..1ff3248aff7 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f46e8284aae155c83015dee.md +++ b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f46e8284aae155c83015dee.md @@ -9,7 +9,7 @@ dashedName: step-86 メニューは見た目が良いですが、コーヒー豆の背景画像以外は主にテキストだけです。 -`Coffee` の見出しの下に、URL `https://cdn.freecodecamp.org/curriculum/css-cafe/coffee.jpg` を使って画像を追加してください。画像には `alt` 属性で `coffee icon` の値を付けてください。 +`Coffee` の見出しの下に、URL `https://cdn.freecodecamp.org/curriculum/css-cafe/coffee.jpg` を使って画像を追加してください。画像には `alt` 属性として `coffee icon` を設定してください。 # --hints-- @@ -105,6 +105,7 @@ assert.match(imageAltValue, /coffee icon/i);

123 Free Code Camp Drive

+ ``` @@ -171,7 +172,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f46ede1ff8fec5ba656b44c.md b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f46ede1ff8fec5ba656b44c.md index 76ab89e1025..bdf99e0fd64 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f46ede1ff8fec5ba656b44c.md +++ b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f46ede1ff8fec5ba656b44c.md @@ -144,7 +144,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } --fcc-editable-region-- diff --git a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f46fc57528aa1c4b5ea7c2e.md b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f46fc57528aa1c4b5ea7c2e.md index 4547da6e823..5f1f8e80fbb 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f46fc57528aa1c4b5ea7c2e.md +++ b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f46fc57528aa1c4b5ea7c2e.md @@ -161,7 +161,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f4701b942c824109626c3d8.md b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f4701b942c824109626c3d8.md index 078ae29eee2..f5eed6637d3 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f4701b942c824109626c3d8.md +++ b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f4701b942c824109626c3d8.md @@ -153,6 +153,6 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f475bb508746c16c9431d42.md b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f475bb508746c16c9431d42.md index 3f0176f46ae..229a1d5c08e 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f475bb508746c16c9431d42.md +++ b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f475bb508746c16c9431d42.md @@ -7,7 +7,7 @@ dashedName: step-87 # --description-- -追加した画像は、その上の`Coffee`見出しのように水平方向に中央揃えになっていません。`img`要素は「インライン要素のような」ものです。 +追加した画像は、その上の`Coffee`見出しのように水平方向に中央揃えされていません。`img`要素はインラインレベルの要素なので、テキストの流れの中に配置されます。 画像を見出しのようなブロックレベル要素のように振る舞わせるには、`img`型セレクターを作成してください。`display`プロパティを`block`に設定し、`margin-left`と`margin-right`プロパティを使って水平方向に中央揃えにします。 @@ -120,6 +120,7 @@ assert.equal(imgMarginRight, 'auto');

123 Free Code Camp Drive

+ ``` @@ -190,7 +191,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f475e1c7f71a61d913836c6.md b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f475e1c7f71a61d913836c6.md index 363cdb7f60f..30b4b8af5c1 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f475e1c7f71a61d913836c6.md +++ b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f475e1c7f71a61d913836c6.md @@ -97,6 +97,7 @@ assert.match(lastImage?.alt, /pie icon/i);

123 Free Code Camp Drive

+ ``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f47fe7e31980053a8d4403b.md b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f47fe7e31980053a8d4403b.md index 5abf7840afe..9e68e6ec1c2 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f47fe7e31980053a8d4403b.md +++ b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f47fe7e31980053a8d4403b.md @@ -7,7 +7,7 @@ dashedName: step-89 # --description-- -`h2` 要素とそれに関連するアイコンの間の縦のスペースがもう少し小さければいいですね。`h2` 要素にはデフォルトで上下のマージンがあるので、`h2` 要素の下マージンを `0` や他の数値に変更することができます。 +`h2`要素とそれに関連するアイコンの間の縦のスペースがもっと小さければいいですね。`h2`要素にはデフォルトで上下のマージンが設定されているので、`h2`要素の下マージンを`0`や他の値に変更することができます。 もっと簡単な方法としては、`img` 要素に負の上マージンを追加して、現在の位置から引き上げることです。負の値は値の前に `-` を付けて作成します。このワークショップを完了するには、`25px` 型セレクターで負の上マージン `img` を使ってください。 diff --git a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f716ad029ee4053c7027a7a.md b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f716ad029ee4053c7027a7a.md index 9d4f8e00d91..c94ef37a842 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f716ad029ee4053c7027a7a.md +++ b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f716ad029ee4053c7027a7a.md @@ -119,7 +119,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f716bee5838c354c728a7c5.md b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f716bee5838c354c728a7c5.md index 0bc5d7e2c41..109b702b4e5 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f716bee5838c354c728a7c5.md +++ b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f716bee5838c354c728a7c5.md @@ -158,6 +158,6 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f7b87422a560036fd03ccff.md b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f7b87422a560036fd03ccff.md index 15a6431cfad..16368f01da4 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f7b87422a560036fd03ccff.md +++ b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f7b87422a560036fd03ccff.md @@ -118,7 +118,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f7b88d37b1f98386f04edc0.md b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f7b88d37b1f98386f04edc0.md index 7ce3dcb88c5..8bdb5397ff7 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f7b88d37b1f98386f04edc0.md +++ b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/5f7b88d37b1f98386f04edc0.md @@ -97,6 +97,6 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/6780e8ef4153930b965cd7b7.md b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/6780e8ef4153930b965cd7b7.md index f91ed90d852..a097d1ab8f5 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/6780e8ef4153930b965cd7b7.md +++ b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/6780e8ef4153930b965cd7b7.md @@ -125,6 +125,6 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/6780f0d898362873ac425dc8.md b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/6780f0d898362873ac425dc8.md index c34969d9e56..9692326096a 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cafe-menu/6780f0d898362873ac425dc8.md +++ b/curriculum/challenges/japanese/blocks/workshop-cafe-menu/6780f0d898362873ac425dc8.md @@ -156,7 +156,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/japanese/blocks/workshop-calculator/66cc095dfe1682753d2ab030.md b/curriculum/challenges/japanese/blocks/workshop-calculator/66cc095dfe1682753d2ab030.md index 3c048348a79..5f1818c6b7f 100644 --- a/curriculum/challenges/japanese/blocks/workshop-calculator/66cc095dfe1682753d2ab030.md +++ b/curriculum/challenges/japanese/blocks/workshop-calculator/66cc095dfe1682753d2ab030.md @@ -7,7 +7,7 @@ dashedName: step-2 # --description-- -前のレッスンで学んだ概念の一つに、関数から戻り値を返す方法があります。 +前のレッスンで学んだ概念の一つは、関数から値を戻す方法でした。 関数から戻り値を返す方法をもう一度確認しましょう: @@ -30,7 +30,10 @@ assert.strictEqual(addTwoAndSeven(), 9); あなたの`addTwoAndSeven`関数は、`+`演算子を使って合計を返す必要があります。 ```js -assert.match(code, /return\s*(2\s*\+\s*7|7\s*\+\s*2)\s*;?/); +const explorer = await __helpers.Explorer(code); +const { addTwoAndSeven } = explorer.allFunctions; +const validExpressions = ["2 + 7", "7 + 2", "(2 + 7)", "(7 + 2)"]; +assert.isTrue(validExpressions.some(expr => addTwoAndSeven?.hasReturn(expr))); ``` # --seed-- diff --git a/curriculum/challenges/japanese/blocks/workshop-calculator/66cc0a9e06e00b75d6782be9.md b/curriculum/challenges/japanese/blocks/workshop-calculator/66cc0a9e06e00b75d6782be9.md index 62155a58f2d..0888104afcb 100644 --- a/curriculum/challenges/japanese/blocks/workshop-calculator/66cc0a9e06e00b75d6782be9.md +++ b/curriculum/challenges/japanese/blocks/workshop-calculator/66cc0a9e06e00b75d6782be9.md @@ -26,16 +26,12 @@ myFunction(); # --hints-- -コードの中に `console.log` があるはずです。 +`console.log` の中で `addTwoAndSeven` 関数を呼び出してください。 ```js -assert.match(code, /console\.log(.*)/); -``` - -`addTwoAndSeven` の中で `console.log` 関数を呼び出す必要があります。 - -```js -assert.match(code, /console\.log\(\s*addTwoAndSeven\(\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(addTwoAndSeven())"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/japanese/blocks/workshop-calculator/66cc0ba5881acb7692cfc4de.md b/curriculum/challenges/japanese/blocks/workshop-calculator/66cc0ba5881acb7692cfc4de.md index 584f63fc465..d7dcaa56da5 100644 --- a/curriculum/challenges/japanese/blocks/workshop-calculator/66cc0ba5881acb7692cfc4de.md +++ b/curriculum/challenges/japanese/blocks/workshop-calculator/66cc0ba5881acb7692cfc4de.md @@ -7,7 +7,7 @@ dashedName: step-4 # --description-- -次に、別の関数を追加する時間です。 +次の関数を追加する時間です。 `addThreeAndFour` という名前の関数を宣言し、`3` と `4` の合計を返してください。 @@ -24,22 +24,24 @@ assert.isFunction(addThreeAndFour); `addThreeAndFour` 関数は `3` と `4` の合計を返す必要があります。 ```js -assert.equal(addThreeAndFour(), 7); +assert.strictEqual(addThreeAndFour(), 7); ``` `addThreeAndFour` 関数は `+` 演算子を使って合計を返す必要があります。 ```js -const declarationStyle = /return\s*\(?\s*(3\s*\+\s*4|4\s*\+\s*3)\s*\)?\s*;?/; -const arrowStyle = /=>\s*\(?\s*(3\s*\+\s*4|4\s*\+\s*3)\s*\)?\s*;?/; -const combinedRegex = new RegExp(`(?:${declarationStyle.source})|(?:${arrowStyle.source})`); -assert.match(code, combinedRegex); +const explorer = await __helpers.Explorer(code); +const { addThreeAndFour } = explorer.allFunctions; +const validExpressions = ["3 + 4", "4 + 3", "(3 + 4)", "(4 + 3)"]; +assert.isTrue(validExpressions.some(expr => addThreeAndFour?.hasReturn(expr))); ``` `addThreeAndFour` 関数を `console.log` の中で呼び出してください。 ```js -assert.match(code, /console\.log\(\s*addThreeAndFour\(\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(addThreeAndFour())"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/japanese/blocks/workshop-calculator/66cc0de2920bec775f610424.md b/curriculum/challenges/japanese/blocks/workshop-calculator/66cc0de2920bec775f610424.md index 5246ba9c2cf..1d87999e40f 100644 --- a/curriculum/challenges/japanese/blocks/workshop-calculator/66cc0de2920bec775f610424.md +++ b/curriculum/challenges/japanese/blocks/workshop-calculator/66cc0de2920bec775f610424.md @@ -22,25 +22,33 @@ dashedName: step-5 `addTwoAndSeven` という名前の関数を作ってはいけません。 ```js -assert.notMatch(code, /function\s+addTwoAndSeven\s*\(\s*\)\s*{/); +const explorer = await __helpers.Explorer(code); +const { addTwoAndSeven } = explorer.allFunctions; +assert.notExists(addTwoAndSeven); ``` `addTwoAndSeven` という関数の呼び出しをしてはいけません。 ```js -assert.notMatch(code, /console\.log\(\s*addTwoAndSeven\(\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const unexpectedStatement = "console.log(addTwoAndSeven())"; +assert.notInclude(strippedCode, unexpectedStatement); ``` `addThreeAndFour` という名前の関数を作ってはいけません。 ```js -assert.notMatch(code, /function\s+addThreeAndFour\s*\(\s*\)\s*{/); +const explorer = await __helpers.Explorer(code); +const { addThreeAndFour } = explorer.allFunctions; +assert.notExists(addThreeAndFour); ``` `addThreeAndFour` という関数の呼び出しをしてはいけません。 ```js -assert.notMatch(code, /console\.log\(\s*addThreeAndFour\(\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const unexpectedStatement = "console.log(addThreeAndFour())"; +assert.notInclude(strippedCode, unexpectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/japanese/blocks/workshop-calculator/66cc0f1ae40802781b2ea972.md b/curriculum/challenges/japanese/blocks/workshop-calculator/66cc0f1ae40802781b2ea972.md index 933009fc46f..3ea090c8ff5 100644 --- a/curriculum/challenges/japanese/blocks/workshop-calculator/66cc0f1ae40802781b2ea972.md +++ b/curriculum/challenges/japanese/blocks/workshop-calculator/66cc0f1ae40802781b2ea972.md @@ -33,8 +33,11 @@ assert.isFunction(calculateSum); `calculateSum` 関数は `num1` と `num2` の2つのパラメータを受け取る必要があります。 ```js -const regex = __helpers.functionRegex('calculateSum', ['num1', 'num2']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { calculateSum } = explorer.allFunctions; +assert.lengthOf(calculateSum?.parameters, 2); +assert.equal(calculateSum?.parameters[0].toString(), "num1"); +assert.equal(calculateSum?.parameters[1].toString(), "num2"); ``` # --seed-- diff --git a/curriculum/challenges/japanese/blocks/workshop-calculator/66cc12fa504b0479dac479a0.md b/curriculum/challenges/japanese/blocks/workshop-calculator/66cc12fa504b0479dac479a0.md index 236d4ab99bd..81eeb4e1dfa 100644 --- a/curriculum/challenges/japanese/blocks/workshop-calculator/66cc12fa504b0479dac479a0.md +++ b/curriculum/challenges/japanese/blocks/workshop-calculator/66cc12fa504b0479dac479a0.md @@ -29,7 +29,9 @@ greetUser("Jane"); // "Hello Jane!" `console.log` が引数 `calculateSum` と `2` で `5` 関数を呼び出しているはずです。 ```js -assert.match(code, /console\.log\(calculateSum\(\s*2\s*,\s*5\)\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const validStatements = ["console.log(calculateSum(2,5))", "console.log(calculateSum(5,2))"]; +assert.isTrue(validStatements.some(stmt => strippedCode.includes(stmt))); ``` # --seed-- diff --git a/curriculum/challenges/japanese/blocks/workshop-calculator/66cc14ca14e65e7a9ebecb80.md b/curriculum/challenges/japanese/blocks/workshop-calculator/66cc14ca14e65e7a9ebecb80.md index d072849db1a..faef3318436 100644 --- a/curriculum/challenges/japanese/blocks/workshop-calculator/66cc14ca14e65e7a9ebecb80.md +++ b/curriculum/challenges/japanese/blocks/workshop-calculator/66cc14ca14e65e7a9ebecb80.md @@ -15,7 +15,7 @@ dashedName: step-10 # --hints-- -`calculateDifference` という名前の関数があるはずです。 +`calculateDifference` という関数を宣言してください。 ```js assert.isFunction(calculateDifference); @@ -24,8 +24,11 @@ assert.isFunction(calculateDifference); `calculateDifference` 関数は `num1` と `num2` という2つのパラメータを持つべきです。 ```js -const regex = __helpers.functionRegex('calculateDifference', ['num1', 'num2']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { calculateDifference } = explorer.allFunctions; +assert.lengthOf(calculateDifference?.parameters, 2); +assert.equal(calculateDifference?.parameters[0].toString(), "num1"); +assert.equal(calculateDifference?.parameters[1].toString(), "num2"); ``` `calculateDifference` 関数は2つのパラメータの差を返すべきです。 diff --git a/curriculum/challenges/japanese/blocks/workshop-calculator/66cc16abc30b367ba1d1f9ef.md b/curriculum/challenges/japanese/blocks/workshop-calculator/66cc16abc30b367ba1d1f9ef.md index f76c1221615..7752471be8d 100644 --- a/curriculum/challenges/japanese/blocks/workshop-calculator/66cc16abc30b367ba1d1f9ef.md +++ b/curriculum/challenges/japanese/blocks/workshop-calculator/66cc16abc30b367ba1d1f9ef.md @@ -1,6 +1,6 @@ --- id: 66cc16abc30b367ba1d1f9ef -title: ステップ 11 +title: ステップ11 challengeType: 1 dashedName: step-11 --- @@ -20,19 +20,25 @@ dashedName: step-11 `console.log`と`calculateDifference`を引数にして`22`関数を呼び出す`5`があるはずです。 ```js -assert.match(code, /console\.log\s*\(\s*calculateDifference\s*\(\s*22\s*,\s*5\s*\)\s*\)\s*;?/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateDifference(22,5))"; +assert.include(strippedCode, expectedStatement); ``` `console.log`と`calculateDifference`を引数にして`12`関数を呼び出す`1`があるはずです。 ```js -assert.match(code, /console\.log\s*\(\s*calculateDifference\s*\(\s*12\s*,\s*1\s*\)\s*\)\s*;?/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateDifference(12,1))"; +assert.include(strippedCode, expectedStatement); ``` `console.log`と`calculateDifference`を引数にして`17`関数を呼び出す`9`があるはずです。 ```js -assert.match(code, /console\.log\s*\(\s*calculateDifference\s*\(\s*17\s*,\s*9\s*\)\s*\)\s*;?/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateDifference(17,9))"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/japanese/blocks/workshop-calculator/66cc172af7159a7c67804544.md b/curriculum/challenges/japanese/blocks/workshop-calculator/66cc172af7159a7c67804544.md index 51c23969a02..fdd07513d05 100644 --- a/curriculum/challenges/japanese/blocks/workshop-calculator/66cc172af7159a7c67804544.md +++ b/curriculum/challenges/japanese/blocks/workshop-calculator/66cc172af7159a7c67804544.md @@ -17,7 +17,7 @@ dashedName: step-12 # --hints-- -`calculateProduct` という名前の関数があるはずです。 +`calculateProduct` という関数を宣言してください。 ```js assert.isFunction(calculateProduct); @@ -26,8 +26,11 @@ assert.isFunction(calculateProduct); `calculateProduct` 関数は `num1` と `num2` という2つのパラメータを持つべきです。 ```js -const regex = __helpers.functionRegex('calculateProduct', ['num1', 'num2']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { calculateProduct } = explorer.allFunctions; +assert.lengthOf(calculateProduct?.parameters, 2); +assert.equal(calculateProduct?.parameters[0].toString(), "num1"); +assert.equal(calculateProduct?.parameters[1].toString(), "num2"); ``` `calculateProduct` 関数は2つのパラメータの積を返すべきです。 @@ -40,7 +43,9 @@ assert.equal(calculateProduct(10, 5), 50); `console.log` が `calculateProduct` 関数を引数 `13` と `5` で呼び出しているはずです。 ```js -assert.match(code, /console\.log\s*\(\s*calculateProduct\s*\(\s*13\s*,\s*5\s*\)\s*\)\s*;?/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const validStatements = ["console.log(calculateProduct(13,5))", "console.log(calculateProduct(5,13))"]; +assert.isTrue(validStatements.some(stmt => strippedCode.includes(stmt))); ``` # --seed-- diff --git a/curriculum/challenges/japanese/blocks/workshop-calculator/66cc1a3a39aef47d6473cb2f.md b/curriculum/challenges/japanese/blocks/workshop-calculator/66cc1a3a39aef47d6473cb2f.md index c18ec188039..b74d71379fc 100644 --- a/curriculum/challenges/japanese/blocks/workshop-calculator/66cc1a3a39aef47d6473cb2f.md +++ b/curriculum/challenges/japanese/blocks/workshop-calculator/66cc1a3a39aef47d6473cb2f.md @@ -17,7 +17,7 @@ dashedName: step-13 # --hints-- -`calculateQuotient` という名前の関数があるはずです。 +`calculateQuotient` という関数を宣言してください。 ```js assert.isFunction(calculateQuotient); @@ -26,8 +26,11 @@ assert.isFunction(calculateQuotient); `calculateQuotient` 関数は `num1` と `num2` という2つのパラメータを持つべきです。 ```js -const regex = __helpers.functionRegex('calculateQuotient', ['num1', 'num2']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { calculateQuotient } = explorer.allFunctions; +assert.lengthOf(calculateQuotient?.parameters, 2); +assert.equal(calculateQuotient?.parameters[0].toString(), "num1"); +assert.equal(calculateQuotient?.parameters[1].toString(), "num2"); ``` `calculateQuotient` 関数は2つのパラメータの商を返すべきです。 @@ -40,7 +43,9 @@ assert.equal(calculateQuotient(100, 10), 10); `console.log` が `calculateQuotient` 関数を引数 `7` と `11` で呼び出しているはずです。 ```js -assert.match(code, /console\.log\s*\(\s*calculateQuotient\s*\(\s*7\s*,\s*11\s*\)\s*\)\s*;?/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateQuotient(7,11))"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/japanese/blocks/workshop-calculator/66cc1ccfefdd727e18c2ab20.md b/curriculum/challenges/japanese/blocks/workshop-calculator/66cc1ccfefdd727e18c2ab20.md index 52a2c7fa00a..d32062ba961 100644 --- a/curriculum/challenges/japanese/blocks/workshop-calculator/66cc1ccfefdd727e18c2ab20.md +++ b/curriculum/challenges/japanese/blocks/workshop-calculator/66cc1ccfefdd727e18c2ab20.md @@ -7,7 +7,7 @@ dashedName: step-14 # --description-- -あなたの`calculateQuotient`は正しく動作しているようですが、まだテストしていないケースがあります。 +あなたの `calculateQuotient` は正しく動作しているようですが、まだテストしていないケースが1つあります。 `console.log`を追加して、`calculateQuotient`関数を引数`3`と`0`で呼び出してください。 @@ -18,7 +18,9 @@ dashedName: step-14 `console.log`を用意して、`calculateQuotient`関数を引数`3`と`0`で呼び出す必要があります。 ```js -assert.match(code, /console\.log\s*\(\s*calculateQuotient\s*\(\s*3\s*,\s*0\s*\)\s*\)\s*;?/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateQuotient(3,0))"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/japanese/blocks/workshop-calculator/66cc1deb1f04647f2aabee2b.md b/curriculum/challenges/japanese/blocks/workshop-calculator/66cc1deb1f04647f2aabee2b.md index 4954ef5d7a0..d9b45099da5 100644 --- a/curriculum/challenges/japanese/blocks/workshop-calculator/66cc1deb1f04647f2aabee2b.md +++ b/curriculum/challenges/japanese/blocks/workshop-calculator/66cc1deb1f04647f2aabee2b.md @@ -20,8 +20,8 @@ dashedName: step-15 `calculateQuotient` 関数は、`"Error: Division by zero"` がゼロの場合に文字列 `num2` を返すべきです。 ```js -assert.strictEqual(calculateQuotient(10, 0), 'Error: Division by zero'); -assert.strictEqual(calculateQuotient(3, 0), 'Error: Division by zero'); +assert.strictEqual(calculateQuotient(10, 0), "Error: Division by zero"); +assert.strictEqual(calculateQuotient(3, 0), "Error: Division by zero"); ``` `calculateQuotient` 関数は、`num1` がゼロでない場合に `num2` を `num2` で割った結果を返すべきです。 diff --git a/curriculum/challenges/japanese/blocks/workshop-calculator/66cc21d23238dc8240a8a182.md b/curriculum/challenges/japanese/blocks/workshop-calculator/66cc21d23238dc8240a8a182.md index 0f7a611bfc2..dc8f5bafaff 100644 --- a/curriculum/challenges/japanese/blocks/workshop-calculator/66cc21d23238dc8240a8a182.md +++ b/curriculum/challenges/japanese/blocks/workshop-calculator/66cc21d23238dc8240a8a182.md @@ -28,7 +28,7 @@ Math.pow(5, 2); // 25 # --hints-- -`calculateSquare`という関数を用意してください。 +`calculateSquare` という関数を宣言してください。 ```js assert.isFunction(calculateSquare); @@ -37,8 +37,10 @@ assert.isFunction(calculateSquare); `calculateSquare`関数は`num`パラメータを取るべきです。 ```js -const regex = __helpers.functionRegex('calculateSquare', ['num']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { calculateSquare } = explorer.allFunctions; +assert.lengthOf(calculateSquare?.parameters, 1); +assert.equal(calculateSquare?.parameters[0].toString(), "num"); ``` `calculateSquare`関数は`num`の二乗を返すべきです。 diff --git a/curriculum/challenges/japanese/blocks/workshop-calculator/66cc26907ff6908402af0149.md b/curriculum/challenges/japanese/blocks/workshop-calculator/66cc26907ff6908402af0149.md index 34243f96375..f32d50f5f3f 100644 --- a/curriculum/challenges/japanese/blocks/workshop-calculator/66cc26907ff6908402af0149.md +++ b/curriculum/challenges/japanese/blocks/workshop-calculator/66cc26907ff6908402af0149.md @@ -18,13 +18,17 @@ dashedName: step-17 引数に `console.log` を渡して `calculateSquare` 関数を呼び出す `2` があるはずです。 ```js -assert.match(code, /console\.log\s*\(\s*calculateSquare\s*\(\s*2\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateSquare(2))"; +assert.include(strippedCode, expectedStatement); ``` 引数に `console.log` を渡して `calculateSquare` 関数を呼び出す `9` があるはずです。 ```js -assert.match(code, /console\.log\s*\(\s*calculateSquare\s*\(\s*9\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateSquare(9))"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/japanese/blocks/workshop-calculator/66cc2739f687e484d50bb6f1.md b/curriculum/challenges/japanese/blocks/workshop-calculator/66cc2739f687e484d50bb6f1.md index afaf2fe7460..7c8087c54d9 100644 --- a/curriculum/challenges/japanese/blocks/workshop-calculator/66cc2739f687e484d50bb6f1.md +++ b/curriculum/challenges/japanese/blocks/workshop-calculator/66cc2739f687e484d50bb6f1.md @@ -26,7 +26,7 @@ Math.sqrt(9); # --hints-- -`calculateSquareRoot` という名前の関数を作成してください。 +`calculateSquareRoot` という関数を宣言してください。 ```js assert.isFunction(calculateSquareRoot); @@ -35,8 +35,10 @@ assert.isFunction(calculateSquareRoot); `calculateSquareRoot` 関数は `num` というパラメータを受け取る必要があります。 ```js -const regex = __helpers.functionRegex('calculateSquareRoot', ['num']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { calculateSquareRoot } = explorer.allFunctions; +assert.lengthOf(calculateSquareRoot?.parameters, 1); +assert.equal(calculateSquareRoot?.parameters[0].toString(), "num"); ``` `calculateSquareRoot` 関数は `num` の平方根を返す必要があります。 diff --git a/curriculum/challenges/japanese/blocks/workshop-calculator/66cc281d687975858049fd8d.md b/curriculum/challenges/japanese/blocks/workshop-calculator/66cc281d687975858049fd8d.md index d1c04e5963c..97952d6cf4c 100644 --- a/curriculum/challenges/japanese/blocks/workshop-calculator/66cc281d687975858049fd8d.md +++ b/curriculum/challenges/japanese/blocks/workshop-calculator/66cc281d687975858049fd8d.md @@ -20,13 +20,17 @@ dashedName: step-19 `console.log` が `calculateSquareRoot` を引数にして `25` 関数を呼び出しているはずです。 ```js -assert.match(code, /console\.log\s*\(\s*calculateSquareRoot\s*\(\s*25\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateSquareRoot(25))"; +assert.include(strippedCode, expectedStatement); ``` `console.log` が `calculateSquareRoot` を引数にして `100` 関数を呼び出しているはずです。 ```js -assert.match(code, /console\.log\s*\(\s*calculateSquareRoot\s*\(\s*100\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateSquareRoot(100))"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/japanese/blocks/workshop-calculator/66cdf76685e4cb5a8726e27b.md b/curriculum/challenges/japanese/blocks/workshop-calculator/66cdf76685e4cb5a8726e27b.md index eff495da4da..c377f5e879a 100644 --- a/curriculum/challenges/japanese/blocks/workshop-calculator/66cdf76685e4cb5a8726e27b.md +++ b/curriculum/challenges/japanese/blocks/workshop-calculator/66cdf76685e4cb5a8726e27b.md @@ -18,13 +18,17 @@ dashedName: step-9 `console.log` が `calculateSum` 関数を引数 `10` と `10` で呼び出しているはずです。 ```js -assert.match(code, /console\.log\(calculateSum\(10\s*,\s*10\)\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateSum(10,10))"; +assert.include(strippedCode, expectedStatement); ``` `console.log` が `calculateSum` 関数を引数 `5` と `5` で呼び出しているはずです。 ```js -assert.match(code, /console\.log\(calculateSum\(5\s*,\s*5\)\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateSum(5,5))"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646c48df8674cf2b91020ecc.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646c48df8674cf2b91020ecc.md index f62269c284f..fff56e18cc1 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646c48df8674cf2b91020ecc.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646c48df8674cf2b91020ecc.md @@ -35,12 +35,13 @@ assert.oneOf(href, ["./styles.css", "styles.css"]); ```html ---fcc-editable-region-- - - fCC Cat Painting - + + fCC Cat Painting --fcc-editable-region-- + +--fcc-editable-region-- + ``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646c586be7180e40ddf74ff6.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646c586be7180e40ddf74ff6.md index 94a132f0203..303c5475659 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646c586be7180e40ddf74ff6.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646c586be7180e40ddf74ff6.md @@ -1,6 +1,6 @@ --- id: 646c586be7180e40ddf74ff6 -title: Step 3 +title: ステップ 3 challengeType: 0 dashedName: step-3 --- @@ -31,9 +31,9 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('body')?.backgroundColor, - - fCC Cat Painting - + + fCC Cat Painting + diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646c59e942f35541923104bf.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646c59e942f35541923104bf.md index af81b66a46e..2a9140d1646 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646c59e942f35541923104bf.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646c59e942f35541923104bf.md @@ -1,6 +1,6 @@ --- id: 646c59e942f35541923104bf -title: Step 4 +title: ステップ 4 challengeType: 0 dashedName: step-4 --- @@ -17,7 +17,7 @@ HTMLに戻り、`main` 要素を作成してください。その `main` 要素 assert.lengthOf(document.querySelectorAll('main'), 1); ``` -`div` 要素があるはずです。 +`div`要素が必要です。 ```js assert.lengthOf(document.querySelectorAll('div'), 1); @@ -43,13 +43,13 @@ assert.lengthOf(document.querySelectorAll('main div'), 1); - - fCC Cat Painting - + + fCC Cat Painting + --fcc-editable-region-- - + --fcc-editable-region-- diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646c5ace05e4be4211407935.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646c5ace05e4be4211407935.md index 52c73194e2f..e77283cdb94 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646c5ace05e4be4211407935.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646c5ace05e4be4211407935.md @@ -1,6 +1,6 @@ --- id: 646c5ace05e4be4211407935 -title: Step 6 +title: ステップ 6 challengeType: 0 dashedName: step-6 --- @@ -50,14 +50,14 @@ assert.equal(secondGradient,'(69,69,79)100%)'); - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
+
+
+
``` @@ -71,13 +71,13 @@ body { background-color: #c9d2fc; } ---fcc-editable-region-- .cat-head { +--fcc-editable-region-- + +--fcc-editable-region-- width: 205px; height: 180px; border: 1px solid #000; border-radius: 46%; - } ---fcc-editable-region-- ``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646c5d7057c45f432fcdd46c.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646c5d7057c45f432fcdd46c.md index deb44da845d..b0e7cd78c5f 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646c5d7057c45f432fcdd46c.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646c5d7057c45f432fcdd46c.md @@ -1,6 +1,6 @@ --- id: 646c5d7057c45f432fcdd46c -title: Step 5 +title: ステップ 5 challengeType: 0 dashedName: step-5 --- @@ -50,13 +50,13 @@ assert.equal(new __helpers.CSSHelp(document)?.getStyle(".cat-head")?.borderRadiu - - fCC Cat Painting - + + fCC Cat Painting +
-
+
diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646c5e727e56e743c9aed4a1.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646c5e727e56e743c9aed4a1.md index 751e7b2cae1..85b16a7bf9e 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646c5e727e56e743c9aed4a1.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646c5e727e56e743c9aed4a1.md @@ -1,6 +1,6 @@ --- id: 646c5e727e56e743c9aed4a1 -title: Step 7 +title: ステップ 7 challengeType: 0 dashedName: step-7 --- @@ -44,14 +44,14 @@ assert.equal(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.left, '100p - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
+
+
+
``` @@ -65,16 +65,14 @@ body { background-color: #c9d2fc; } ---fcc-editable-region-- .cat-head { - - +--fcc-editable-region-- +--fcc-editable-region-- background: linear-gradient(#5e5e5e 85%, #45454f 100%); width: 205px; height: 180px; border: 1px solid #000; border-radius: 46%; } ---fcc-editable-region-- ``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646c5ffef5598d449b52ec12.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646c5ffef5598d449b52ec12.md index 92cd9417eb6..82cd057a400 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646c5ffef5598d449b52ec12.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646c5ffef5598d449b52ec12.md @@ -1,6 +1,6 @@ --- id: 646c5ffef5598d449b52ec12 -title: Step 17 +title: ステップ 17 challengeType: 0 dashedName: step-17 --- @@ -39,18 +39,18 @@ assert.equal(document.querySelectorAll('.cat-head div')[0]?.getAttribute('class' - - fCC Cat Painting - + + fCC Cat Painting + -
+
+
--fcc-editable-region-- -
- -
+ --fcc-editable-region-- -
+ +
``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646ce8bb4b35544d501c7184.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646ce8bb4b35544d501c7184.md index 796501a3697..4158c5f6195 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646ce8bb4b35544d501c7184.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646ce8bb4b35544d501c7184.md @@ -1,6 +1,6 @@ --- id: 646ce8bb4b35544d501c7184 -title: Step 18 +title: ステップ 18 challengeType: 0 dashedName: step-18 --- @@ -43,20 +43,20 @@ assert.isTrue(document.querySelectorAll('.cat-ears div')[1]?.classList.contains( - - fCC Cat Painting - + + fCC Cat Painting + -
-
+
+
+
--fcc-editable-region-- -
- -
+ --fcc-editable-region--
-
+
+
``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646ce9d790d2a44de5f99e04.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646ce9d790d2a44de5f99e04.md index b18d07f4af4..5cfefdc593f 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646ce9d790d2a44de5f99e04.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646ce9d790d2a44de5f99e04.md @@ -1,6 +1,6 @@ --- id: 646ce9d790d2a44de5f99e04 -title: Step 19 +title: ステップ 19 challengeType: 0 dashedName: step-19 --- @@ -55,25 +55,25 @@ assert.isTrue(document.querySelectorAll('.cat-right-ear div')[0]?.classList.cont - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
- --fcc-editable-region-- -
- -
-
- -
- --fcc-editable-region-- +
+
+
+
+--fcc-editable-region-- + +
+
+ +--fcc-editable-region--
-
+
+
``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646ceb843412c74edee27a79.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646ceb843412c74edee27a79.md index 96dde419ca1..754700b74cf 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646ceb843412c74edee27a79.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646ceb843412c74edee27a79.md @@ -1,6 +1,6 @@ --- id: 646ceb843412c74edee27a79 -title: Step 20 +title: ステップ 20 challengeType: 0 dashedName: step-20 --- @@ -53,7 +53,7 @@ assert.strictEqual(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.b assert.strictEqual(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.borderTop, '35px solid red') ``` -`.cat-right-ear` セレクターには `border-bottom` プロパティが `35px solid red` に設定されているはずです。セミコロンを忘れないでください。 +`.cat-right-ear` セレクターには `border-bottom` プロパティを `35px solid red` に設定してください。セミコロンを忘れないでください。 ```js assert.strictEqual(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.borderBottom, '35px solid red') @@ -67,23 +67,23 @@ assert.strictEqual(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.b - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646cecc9eb5c4f4f73dafd07.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646cecc9eb5c4f4f73dafd07.md index 893845cd6a0..37004c4a737 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646cecc9eb5c4f4f73dafd07.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646cecc9eb5c4f4f73dafd07.md @@ -1,6 +1,6 @@ --- id: 646cecc9eb5c4f4f73dafd07 -title: Step 23 +title: ステップ 23 challengeType: 0 dashedName: step-23 --- @@ -37,23 +37,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-ear')?.left, '- - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` @@ -81,12 +81,12 @@ body { border-radius: 46%; } ---fcc-editable-region-- .cat-left-ear { +--fcc-editable-region-- +--fcc-editable-region-- border-left: 35px solid transparent; border-right: 35px solid transparent; border-bottom: 70px solid #5e5e5e; } ---fcc-editable-region-- ``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646cef0c2b98915094df7099.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646cef0c2b98915094df7099.md index ed8fdf7f31b..391bc63c02c 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646cef0c2b98915094df7099.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646cef0c2b98915094df7099.md @@ -1,6 +1,6 @@ --- id: 646cef0c2b98915094df7099 -title: Step 24 +title: ステップ 24 challengeType: 0 dashedName: step-24 --- @@ -31,23 +31,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-ear')?.borderTo - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646cf1206cac5f51804f49cf.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646cf1206cac5f51804f49cf.md index 7225d7981d0..7009a9f228b 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646cf1206cac5f51804f49cf.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646cf1206cac5f51804f49cf.md @@ -1,6 +1,6 @@ --- id: 646cf1206cac5f51804f49cf -title: Step 25 +title: ステップ 25 challengeType: 0 dashedName: step-25 --- @@ -29,23 +29,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-ear')?.transfor - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646cf2249f02ca5233d9af7c.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646cf2249f02ca5233d9af7c.md index 3ff1bd7c25c..9581a074946 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646cf2249f02ca5233d9af7c.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646cf2249f02ca5233d9af7c.md @@ -1,6 +1,6 @@ --- id: 646cf2249f02ca5233d9af7c -title: Step 26 +title: ステップ 26 challengeType: 0 dashedName: step-26 --- @@ -45,23 +45,23 @@ assert.strictEqual(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.b - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646cf48d8f8e1f535a1821d3.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646cf48d8f8e1f535a1821d3.md index 403ccd2db03..9c7c8666eed 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646cf48d8f8e1f535a1821d3.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646cf48d8f8e1f535a1821d3.md @@ -1,6 +1,6 @@ --- id: 646cf48d8f8e1f535a1821d3 -title: Step 27 +title: ステップ 27 challengeType: 0 dashedName: step-27 --- @@ -37,23 +37,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.left, ' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646cf6cbca98e258da65c979.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646cf6cbca98e258da65c979.md index 1ad65aac4ec..8ba3bec60a2 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646cf6cbca98e258da65c979.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646cf6cbca98e258da65c979.md @@ -1,6 +1,6 @@ --- id: 646cf6cbca98e258da65c979 -title: Step 28 +title: ステップ 28 challengeType: 0 dashedName: step-28 --- @@ -25,23 +25,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.transfo - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646cf88aa884405a11ea5bcc.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646cf88aa884405a11ea5bcc.md index c80d33d0da1..d04dc5bd48e 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646cf88aa884405a11ea5bcc.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646cf88aa884405a11ea5bcc.md @@ -1,6 +1,6 @@ --- id: 646cf88aa884405a11ea5bcc -title: Step 29 +title: ステップ 29 challengeType: 0 dashedName: step-29 --- @@ -31,23 +31,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.borderT - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646cfc2b8e6fe95c20a819d5.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646cfc2b8e6fe95c20a819d5.md index 719c852fb42..3820fc02857 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646cfc2b8e6fe95c20a819d5.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646cfc2b8e6fe95c20a819d5.md @@ -1,6 +1,6 @@ --- id: 646cfc2b8e6fe95c20a819d5 -title: Step 30 +title: ステップ 30 challengeType: 0 dashedName: step-30 --- @@ -29,23 +29,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-ear')?.zIndex, - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646cfd853634255d02b64cc1.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646cfd853634255d02b64cc1.md index 41e81e91085..bb690ee6a7e 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646cfd853634255d02b64cc1.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646cfd853634255d02b64cc1.md @@ -1,6 +1,6 @@ --- id: 646cfd853634255d02b64cc1 -title: Step 31 +title: ステップ 31 challengeType: 0 dashedName: step-31 --- @@ -27,23 +27,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-ear')?.zIndex, - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646cfde6ac612e5d60391f50.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646cfde6ac612e5d60391f50.md index eaba96c6acf..244ef671d45 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646cfde6ac612e5d60391f50.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646cfde6ac612e5d60391f50.md @@ -1,6 +1,6 @@ --- id: 646cfde6ac612e5d60391f50 -title: Step 32 +title: ステップ 32 challengeType: 0 dashedName: step-32 --- @@ -25,23 +25,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.zIndex, - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646dd556d524bc61c0139bd6.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646dd556d524bc61c0139bd6.md index 28f2071253d..97f080917db 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646dd556d524bc61c0139bd6.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646dd556d524bc61c0139bd6.md @@ -1,6 +1,6 @@ --- id: 646dd556d524bc61c0139bd6 -title: Step 33 +title: ステップ 33 challengeType: 0 dashedName: step-33 --- @@ -45,23 +45,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-inner-ear')?.bo - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646dd6f9caa862627dd87772.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646dd6f9caa862627dd87772.md index 54e4bc14162..84c6c0e5de9 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646dd6f9caa862627dd87772.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646dd6f9caa862627dd87772.md @@ -1,6 +1,6 @@ --- id: 646dd6f9caa862627dd87772 -title: Step 34 +title: ステップ 34 challengeType: 0 dashedName: step-34 --- @@ -37,23 +37,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-inner-ear')?.le - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646dd7cfd0cfac630c1dd520.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646dd7cfd0cfac630c1dd520.md index 6481a6eca85..e6bf5154702 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646dd7cfd0cfac630c1dd520.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646dd7cfd0cfac630c1dd520.md @@ -1,6 +1,6 @@ --- id: 646dd7cfd0cfac630c1dd520 -title: Step 35 +title: ステップ 35 challengeType: 0 dashedName: step-35 --- @@ -43,23 +43,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-inner-ear')?.bo - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646dd8c79ec23463a3d0e356.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646dd8c79ec23463a3d0e356.md index 599e8be769e..09497150738 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646dd8c79ec23463a3d0e356.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646dd8c79ec23463a3d0e356.md @@ -1,6 +1,6 @@ --- id: 646dd8c79ec23463a3d0e356 -title: Step 36 +title: ステップ 36 challengeType: 0 dashedName: step-36 --- @@ -43,23 +43,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-inner-ear')?.b - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646dd9d9a729916460724f16.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646dd9d9a729916460724f16.md index 9363fa49724..0fac039368c 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646dd9d9a729916460724f16.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646dd9d9a729916460724f16.md @@ -1,6 +1,6 @@ --- id: 646dd9d9a729916460724f16 -title: Step 37 +title: ステップ 37 challengeType: 0 dashedName: step-37 --- @@ -37,23 +37,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-inner-ear')?.l - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646ddab8afd73764f5241bbf.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646ddab8afd73764f5241bbf.md index 43ac6bf7b11..8429db9bdb0 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646ddab8afd73764f5241bbf.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646ddab8afd73764f5241bbf.md @@ -1,6 +1,6 @@ --- id: 646ddab8afd73764f5241bbf -title: Step 38 +title: ステップ 38 challengeType: 0 dashedName: step-38 --- @@ -43,23 +43,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-inner-ear')?.b - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646ddb61ff08366570cc5902.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646ddb61ff08366570cc5902.md index 9c4c49a2bb1..1149873cd69 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646ddb61ff08366570cc5902.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646ddb61ff08366570cc5902.md @@ -1,6 +1,6 @@ --- id: 646ddb61ff08366570cc5902 -title: Step 39 +title: ステップ 39 challengeType: 0 dashedName: step-39 --- @@ -45,27 +45,27 @@ assert.isTrue(document.querySelectorAll('.cat-eyes div')[1].classList.contains(' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- - --fcc-editable-region-- - - --fcc-editable-region--
-
+ + --fcc-editable-region-- + + --fcc-editable-region-- +
+
``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646ddd3f9f97a0667b964bdb.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646ddd3f9f97a0667b964bdb.md index 7855b0b94c5..60170b7a57b 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646ddd3f9f97a0667b964bdb.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646ddd3f9f97a0667b964bdb.md @@ -1,6 +1,6 @@ --- id: 646ddd3f9f97a0667b964bdb -title: Step 40 +title: ステップ 40 challengeType: 0 dashedName: step-40 --- @@ -55,34 +55,34 @@ assert.isTrue(document.querySelectorAll('.cat-right-eye div')[0]?.classList.cont - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
- --fcc-editable-region-- -
- -
-
- -
- --fcc-editable-region-- -
-
+ +
+
+--fcc-editable-region-- + +
+
+ +--fcc-editable-region-- +
+
+
+
``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646dde7dc20dc167489faa69.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646dde7dc20dc167489faa69.md index 3e2407f3f8b..1213c8c7b9c 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646dde7dc20dc167489faa69.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646dde7dc20dc167489faa69.md @@ -1,6 +1,6 @@ --- id: 646dde7dc20dc167489faa69 -title: Step 41 +title: ステップ 41 challengeType: 0 dashedName: step-41 --- @@ -43,32 +43,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-eye')?.backgrou - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646ddf888632fa67f1180940.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646ddf888632fa67f1180940.md index 942d0f11bc9..8144e362c03 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646ddf888632fa67f1180940.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646ddf888632fa67f1180940.md @@ -1,6 +1,6 @@ --- id: 646ddf888632fa67f1180940 -title: Step 42 +title: ステップ 42 challengeType: 0 dashedName: step-42 --- @@ -37,32 +37,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-eye')?.left, '3 - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646de5dc8988076a1d992afd.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646de5dc8988076a1d992afd.md index 3cb7cff349d..52962f05f4a 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646de5dc8988076a1d992afd.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646de5dc8988076a1d992afd.md @@ -1,6 +1,6 @@ --- id: 646de5dc8988076a1d992afd -title: Step 43 +title: ステップ 43 challengeType: 0 dashedName: step-43 --- @@ -31,32 +31,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-eye')?.transfor - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646de6a97b50a86ac487de86.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646de6a97b50a86ac487de86.md index bdf2d58ab80..9913e965a97 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646de6a97b50a86ac487de86.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646de6a97b50a86ac487de86.md @@ -1,6 +1,6 @@ --- id: 646de6a97b50a86ac487de86 -title: Step 44 +title: ステップ 44 challengeType: 0 dashedName: step-44 --- @@ -45,32 +45,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-eye')?.backgro - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646de7b64467e96b7d35b5cd.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646de7b64467e96b7d35b5cd.md index b26475a1fa4..2630db06964 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646de7b64467e96b7d35b5cd.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646de7b64467e96b7d35b5cd.md @@ -1,6 +1,6 @@ --- id: 646de7b64467e96b7d35b5cd -title: Step 45 +title: ステップ 45 challengeType: 0 dashedName: step-45 --- @@ -37,32 +37,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-eye')?.left, ' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646de8478d6f796bfbdccfb2.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646de8478d6f796bfbdccfb2.md index a7b7445877b..6601b8d3cbc 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646de8478d6f796bfbdccfb2.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646de8478d6f796bfbdccfb2.md @@ -1,6 +1,6 @@ --- id: 646de8478d6f796bfbdccfb2 -title: Step 46 +title: ステップ 46 challengeType: 0 dashedName: step-46 --- @@ -31,32 +31,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-eye')?.transfo - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646de8d204a3426c7d184372.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646de8d204a3426c7d184372.md index 5f4fc0c9cb5..d7b4ff675f5 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646de8d204a3426c7d184372.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646de8d204a3426c7d184372.md @@ -1,6 +1,6 @@ --- id: 646de8d204a3426c7d184372 -title: Step 47 +title: ステップ 47 challengeType: 0 dashedName: step-47 --- @@ -45,32 +45,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-inner-eye')?.ba - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646dea1c98c2426d43a705c3.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646dea1c98c2426d43a705c3.md index 68a8349d772..26abcf9e57e 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646dea1c98c2426d43a705c3.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646dea1c98c2426d43a705c3.md @@ -1,6 +1,6 @@ --- id: 646dea1c98c2426d43a705c3 -title: Step 48 +title: ステップ 48 challengeType: 0 dashedName: step-48 --- @@ -49,32 +49,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-inner-eye')?.tr - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646deb169847f86df0f95bfc.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646deb169847f86df0f95bfc.md index 06f20232a4c..e80309e8acd 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646deb169847f86df0f95bfc.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646deb169847f86df0f95bfc.md @@ -1,6 +1,6 @@ --- id: 646deb169847f86df0f95bfc -title: Step 49 +title: ステップ 49 challengeType: 0 dashedName: step-49 --- @@ -43,32 +43,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-inner-eye')?.b - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646dec359bef3b7811fba5a6.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646dec359bef3b7811fba5a6.md index e00c504999c..646d03a9cc9 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646dec359bef3b7811fba5a6.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646dec359bef3b7811fba5a6.md @@ -49,32 +49,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-inner-eye')?.t - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646dedbcba062079128b2ecc.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646dedbcba062079128b2ecc.md index e8e2d3b3b72..d8542896f0c 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646dedbcba062079128b2ecc.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646dedbcba062079128b2ecc.md @@ -1,6 +1,6 @@ --- id: 646dedbcba062079128b2ecc -title: Step 51 +title: ステップ 51 challengeType: 0 dashedName: step-51 --- @@ -11,7 +11,7 @@ dashedName: step-51 # --hints-- -`div`要素を作成してください。 +`div`要素を作成する必要があります。 ```js assert.lengthOf(document.querySelectorAll('div'), 12); @@ -31,36 +31,36 @@ assert.isTrue(document.querySelectorAll('div')[11].classList.contains('cat-nose' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
- - --fcc-editable-region-- - - --fcc-editable-region--
-
+ + --fcc-editable-region-- + + --fcc-editable-region-- +
+
``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646def5e863abf7a14501421.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646def5e863abf7a14501421.md index cc6d305f9cf..2c55fa079d0 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646def5e863abf7a14501421.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646def5e863abf7a14501421.md @@ -1,6 +1,6 @@ --- id: 646def5e863abf7a14501421 -title: Step 52 +title: ステップ 52 challengeType: 0 dashedName: step-52 --- @@ -43,34 +43,34 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-nose')?.borderBottom - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
- -
-
+ +
+
+
``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646df03c8f79337ab46f148b.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646df03c8f79337ab46f148b.md index 8ab9c83fa9b..15e791078ee 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646df03c8f79337ab46f148b.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646df03c8f79337ab46f148b.md @@ -1,6 +1,6 @@ --- id: 646df03c8f79337ab46f148b -title: Step 53 +title: ステップ 53 challengeType: 0 dashedName: step-53 --- @@ -37,34 +37,34 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-nose')?.left, '85px' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
- -
-
+ +
+
+
``` @@ -196,5 +196,4 @@ body { border-right: 15px solid transparent; border-bottom: 20px solid #442c2c; } - ``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646df0cf26413a7b35e4b8b3.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646df0cf26413a7b35e4b8b3.md index 09ab1363198..8781b38b03e 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646df0cf26413a7b35e4b8b3.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646df0cf26413a7b35e4b8b3.md @@ -1,6 +1,6 @@ --- id: 646df0cf26413a7b35e4b8b3 -title: Step 54 +title: ステップ 54 challengeType: 0 dashedName: step-54 --- @@ -49,34 +49,34 @@ assert.notMatch(code, /border-top-right-radius:\s*\d+%;/); - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
- -
-
+ +
+
+
``` @@ -211,5 +211,4 @@ body { border-right: 15px solid transparent; border-bottom: 20px solid #442c2c; } - ``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646df1d1aa4ae57bdf1869c4.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646df1d1aa4ae57bdf1869c4.md index 0522d7513bb..e4d1f87a838 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646df1d1aa4ae57bdf1869c4.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646df1d1aa4ae57bdf1869c4.md @@ -1,6 +1,6 @@ --- id: 646df1d1aa4ae57bdf1869c4 -title: Step 55 +title: ステップ 55 challengeType: 0 dashedName: step-55 --- @@ -13,7 +13,7 @@ dashedName: step-55 # --hints-- -`div`要素を作成してください。 +`div`要素を作成する必要があります。 ```js assert.lengthOf(document.querySelectorAll('div'), 13); @@ -33,38 +33,38 @@ assert.isTrue(document.querySelectorAll('div')[12].classList.contains('cat-mouth - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
- --fcc-editable-region-- - - --fcc-editable-region-- +
+
+
+
+
+
+
-
+ +
+ + --fcc-editable-region-- + + --fcc-editable-region-- +
+
``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646dffd8ce9ac77ec1906f2e.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646dffd8ce9ac77ec1906f2e.md index 88bf8ad296e..54b44a3b67b 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646dffd8ce9ac77ec1906f2e.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646dffd8ce9ac77ec1906f2e.md @@ -1,6 +1,6 @@ --- id: 646dffd8ce9ac77ec1906f2e -title: Step 56 +title: ステップ 56 challengeType: 0 dashedName: step-56 --- @@ -43,41 +43,40 @@ assert.isTrue(document.querySelectorAll('.cat-mouth div')[1]?.classList.contains - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
- --fcc-editable-region-- -
- +
+
+
+
+
+
- --fcc-editable-region-- +
+ +
+
+--fcc-editable-region-- + +--fcc-editable-region--
-
+
+
``` @@ -213,5 +212,4 @@ body { border-right: 15px solid transparent; border-bottom: 20px solid #442c2c; } - ``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f0417322c0e04983a5149.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f0417322c0e04983a5149.md index 25a5ba48eca..8c6645734c9 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f0417322c0e04983a5149.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f0417322c0e04983a5149.md @@ -1,6 +1,6 @@ --- id: 646f0417322c0e04983a5149 -title: Step 59 +title: ステップ 59 challengeType: 0 dashedName: step-59 --- @@ -43,40 +43,39 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-mouth-line-left')?.l - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
+
+
+
+
+ +
+
+
+
-
+
+
``` @@ -222,6 +221,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f08293804a30685533c6f.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f08293804a30685533c6f.md index 33b19130b02..829a56e5db6 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f08293804a30685533c6f.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f08293804a30685533c6f.md @@ -1,6 +1,6 @@ --- id: 646f08293804a30685533c6f -title: Step 60 +title: ステップ 60 challengeType: 0 dashedName: step-60 --- @@ -25,40 +25,39 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-mouth-line-left')?.t - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
+
+
+
+
+ +
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f09293eb3230723a62f77.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f09293eb3230723a62f77.md index b51cc7ea3b2..89e1a08f96c 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f09293eb3230723a62f77.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f09293eb3230723a62f77.md @@ -1,6 +1,6 @@ --- id: 646f09293eb3230723a62f77 -title: Step 61 +title: ステップ 61 challengeType: 0 dashedName: step-61 --- @@ -43,40 +43,39 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-mouth-line-right')?. - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
+
+
+
+
+ +
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f0c9a1e3360092d1bbd33.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f0c9a1e3360092d1bbd33.md index a3122abbca8..3e5d994e7ea 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f0c9a1e3360092d1bbd33.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f0c9a1e3360092d1bbd33.md @@ -1,6 +1,6 @@ --- id: 646f0c9a1e3360092d1bbd33 -title: Step 62 +title: ステップ 62 challengeType: 0 dashedName: step-62 --- @@ -25,40 +25,39 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-mouth-line-right')?. - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
+
+
+
+
+ +
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f0ce5737243098ad6e494.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f0ce5737243098ad6e494.md index f190008c6e0..bdc82c8e526 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f0ce5737243098ad6e494.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f0ce5737243098ad6e494.md @@ -1,6 +1,6 @@ --- id: 646f0ce5737243098ad6e494 -title: Step 63 +title: ステップ 63 challengeType: 0 dashedName: step-63 --- @@ -13,7 +13,7 @@ dashedName: step-63 # --hints-- -`div`要素を作成してください。 +`div`要素を作成する必要があります。 ```js assert.lengthOf(document.querySelectorAll('div'), 16); @@ -33,44 +33,43 @@ assert.isTrue(document.querySelectorAll('div')[15].classList.contains('cat-whisk - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
+
+
+
+
+ +
- --fcc-editable-region-- - - --fcc-editable-region-- - +
+
+
-
+ + --fcc-editable-region-- + + --fcc-editable-region-- +
+
``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f0ef13604420a8744f7d4.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f0ef13604420a8744f7d4.md index 4bdf2f602c1..027a5a3f360 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f0ef13604420a8744f7d4.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f0ef13604420a8744f7d4.md @@ -1,6 +1,6 @@ --- id: 646f0ef13604420a8744f7d4 -title: Step 64 +title: ステップ 64 challengeType: 0 dashedName: step-64 --- @@ -43,46 +43,45 @@ assert.isTrue(document.querySelectorAll('.cat-whiskers div')[1].classList.contai - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- - --fcc-editable-region-- -
- +
+
- --fcc-editable-region-- +
+ +
+ +
+
+
+
+
+--fcc-editable-region-- + +--fcc-editable-region--
-
+
+
``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f0f7c5933560af8e7e380.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f0f7c5933560af8e7e380.md index 2d9f3e78ead..10f50d49647 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f0f7c5933560af8e7e380.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f0f7c5933560af8e7e380.md @@ -1,6 +1,6 @@ --- id: 646f0f7c5933560af8e7e380 -title: Step 65 +title: ステップ 65 challengeType: 0 dashedName: step-65 --- @@ -50,49 +50,48 @@ assert.isTrue(document.querySelectorAll('.cat-whiskers-left div')[2].classList.c - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
- --fcc-editable-region-- -
- -
- --fcc-editable-region-- -
+
+
+
+ +
+
+
+
+
+ +
+
+--fcc-editable-region-- + +--fcc-editable-region-- +
+
-
+
+
``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f102bf87b350b593baa72.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f102bf87b350b593baa72.md index 29f32c027be..38d5737c250 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f102bf87b350b593baa72.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f102bf87b350b593baa72.md @@ -1,6 +1,6 @@ --- id: 646f102bf87b350b593baa72 -title: Step 66 +title: ステップ 66 challengeType: 0 dashedName: step-66 --- @@ -49,53 +49,52 @@ assert.isTrue(document.querySelectorAll('.cat-whiskers-right div')[2].classList. - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
- --fcc-editable-region-- -
- -
- --fcc-editable-region-- +
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+--fcc-editable-region-- + +--fcc-editable-region-- +
-
+
+
``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f107abb89d00bb99f387a.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f107abb89d00bb99f387a.md index 8b497c2b890..9e8de851584 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f107abb89d00bb99f387a.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f107abb89d00bb99f387a.md @@ -1,6 +1,6 @@ --- id: 646f107abb89d00bb99f387a -title: Step 67 +title: ステップ 67 challengeType: 0 dashedName: step-67 --- @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whiskers-left div')? - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f12da0b4c5d0ca162834a.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f12da0b4c5d0ca162834a.md index e133e92c9e2..09ae7b32866 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f12da0b4c5d0ca162834a.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f12da0b4c5d0ca162834a.md @@ -1,6 +1,6 @@ --- id: 646f12da0b4c5d0ca162834a -title: Step 69 +title: ステップ 69 challengeType: 0 dashedName: step-69 --- @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-left-top')?. - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -261,6 +260,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f135eab69d90d0c6d4e9b.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f135eab69d90d0c6d4e9b.md index 733ae80365f..69f0d471622 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f135eab69d90d0c6d4e9b.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f135eab69d90d0c6d4e9b.md @@ -1,6 +1,6 @@ --- id: 646f135eab69d90d0c6d4e9b -title: Step 70 +title: ステップ 70 challengeType: 0 dashedName: step-70 --- @@ -25,53 +25,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-left-top')?. - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -250,5 +249,4 @@ body { --fcc-editable-region-- } - ``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f159b2cffb21150b927cb.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f159b2cffb21150b927cb.md index e807171273e..fd1ad5eccd1 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f159b2cffb21150b927cb.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f159b2cffb21150b927cb.md @@ -1,6 +1,6 @@ --- id: 646f159b2cffb21150b927cb -title: Step 71 +title: ステップ 71 challengeType: 0 dashedName: step-71 --- @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-left-middle' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -268,6 +267,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f164bf100dd11d226161f.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f164bf100dd11d226161f.md index bdb744c263b..299110188a0 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f164bf100dd11d226161f.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f164bf100dd11d226161f.md @@ -1,6 +1,6 @@ --- id: 646f164bf100dd11d226161f -title: Step 72 +title: ステップ 72 challengeType: 0 dashedName: step-72 --- @@ -25,53 +25,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-left-middle' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -254,7 +253,7 @@ body { top: 127px; left: 52px; --fcc-editable-region-- - + --fcc-editable-region-- } ``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f1764e2f1d212ba9785a7.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f1764e2f1d212ba9785a7.md index 5d949983ce9..5c1f392ddb4 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f1764e2f1d212ba9785a7.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f1764e2f1d212ba9785a7.md @@ -1,6 +1,6 @@ --- id: 646f1764e2f1d212ba9785a7 -title: Step 73 +title: ステップ 73 challengeType: 0 dashedName: step-73 --- @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-left-bottom' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -275,6 +274,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f1802a09a171332e14630.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f1802a09a171332e14630.md index d54d59f5ec6..9588f5a2d4e 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f1802a09a171332e14630.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f1802a09a171332e14630.md @@ -1,6 +1,6 @@ --- id: 646f1802a09a171332e14630 -title: Step 74 +title: ステップ 74 challengeType: 0 dashedName: step-74 --- @@ -25,53 +25,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-left-bottom' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f4d6c42dc5f214f4e7444.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f4d6c42dc5f214f4e7444.md index b43a29465b6..874f9ec1546 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f4d6c42dc5f214f4e7444.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f4d6c42dc5f214f4e7444.md @@ -1,6 +1,6 @@ --- id: 646f4d6c42dc5f214f4e7444 -title: Step 75 +title: ステップ 75 challengeType: 0 dashedName: step-75 --- @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-right-top')? - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -282,6 +281,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f4e46e81f7021d5fd9c1d.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f4e46e81f7021d5fd9c1d.md index 3b6a086e26e..49dd411eea6 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f4e46e81f7021d5fd9c1d.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f4e46e81f7021d5fd9c1d.md @@ -1,6 +1,6 @@ --- id: 646f4e46e81f7021d5fd9c1d -title: Step 76 +title: ステップ 76 challengeType: 0 dashedName: step-76 --- @@ -25,53 +25,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-right-top')? - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f4f6a14e3c522d130a0d2.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f4f6a14e3c522d130a0d2.md index 2bd906c5569..b78d95cf3fd 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f4f6a14e3c522d130a0d2.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f4f6a14e3c522d130a0d2.md @@ -1,6 +1,6 @@ --- id: 646f4f6a14e3c522d130a0d2 -title: Step 77 +title: ステップ 77 challengeType: 0 dashedName: step-77 --- @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-right-middle - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -289,6 +288,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f4fe12b7985232bf475a5.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f4fe12b7985232bf475a5.md index 6ac13a725f6..89fa91e4666 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f4fe12b7985232bf475a5.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f4fe12b7985232bf475a5.md @@ -1,6 +1,6 @@ --- id: 646f4fe12b7985232bf475a5 -title: Step 78 +title: ステップ 78 challengeType: 0 dashedName: step-78 --- @@ -25,53 +25,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-right-middle - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f507e4d1cd323f17db4fc.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f507e4d1cd323f17db4fc.md index 7e174e953f2..115c99b44e4 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f507e4d1cd323f17db4fc.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f507e4d1cd323f17db4fc.md @@ -1,6 +1,6 @@ --- id: 646f507e4d1cd323f17db4fc -title: Step 79 +title: ステップ 79 challengeType: 0 dashedName: step-79 --- @@ -44,53 +44,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-right-bottom - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -297,6 +296,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f516dbfc1342495515625.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f516dbfc1342495515625.md index 57a8bd63f72..5f0cb5307f4 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f516dbfc1342495515625.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/646f516dbfc1342495515625.md @@ -1,6 +1,6 @@ --- id: 646f516dbfc1342495515625 -title: Step 80 +title: ステップ 80 challengeType: 0 dashedName: step-80 --- @@ -27,53 +27,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-right-bottom - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -295,53 +294,53 @@ body { - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+ +
+
``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/6476f5c17f99146071ee884c.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/6476f5c17f99146071ee884c.md index 8d4759fd59a..281b5bac6b0 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/6476f5c17f99146071ee884c.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/6476f5c17f99146071ee884c.md @@ -1,6 +1,6 @@ --- id: 6476f5c17f99146071ee884c -title: Step 8 +title: ステップ 8 challengeType: 0 dashedName: step-8 --- @@ -41,14 +41,14 @@ assert.equal(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.left, '100p - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
+
+
+
``` @@ -65,9 +65,9 @@ body { .cat-head { --fcc-editable-region-- position: static; +--fcc-editable-region-- top: 100px; left: 100px; ---fcc-editable-region-- background: linear-gradient(#5e5e5e 85%, #45454f 100%); width: 205px; height: 180px; diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/6476f7a4827bcc61682f2347.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/6476f7a4827bcc61682f2347.md index c7287da0d0d..bf4d1f29383 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/6476f7a4827bcc61682f2347.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/6476f7a4827bcc61682f2347.md @@ -9,13 +9,11 @@ dashedName: step-9 `absolute` プロパティに `position` の値を使うと、その要素は文書の通常の流れから外れ、位置は `top`、`right`、`bottom`、および `left` プロパティによって決まります。 -`.cat-head` 要素の `position` プロパティを `absolute` に設定し、次に `top` と `left` プロパティを任意の正のピクセル値に設定してください。 - - +`.cat-head` 要素の `position` プロパティを `absolute` に設定してください。 # --hints-- -`.cat-head` セレクターには `position` に設定された `absolute` プロパティが必要です。セミコロンを忘れずに追加してください。 +`.cat-head` セレクターには `position` プロパティを `absolute` に設定してください。セミコロンを忘れないようにしましょう。 ```js assert.equal(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.position, 'absolute'); @@ -43,14 +41,14 @@ assert.match(code, /left:\s*\d{1,4}px;/); - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
+
+
+
``` @@ -67,9 +65,9 @@ body { .cat-head { --fcc-editable-region-- position: relative; +--fcc-editable-region-- top: 100px; left: 100px; ---fcc-editable-region-- background: linear-gradient(#5e5e5e 85%, #45454f 100%); width: 205px; height: 180px; diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/6476fb7cbaafa36d65e9cf35.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/6476fb7cbaafa36d65e9cf35.md index 4476b9dfb58..93a2fff1c3a 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/6476fb7cbaafa36d65e9cf35.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/6476fb7cbaafa36d65e9cf35.md @@ -1,6 +1,6 @@ --- id: 6476fb7cbaafa36d65e9cf35 -title: Step 10 +title: ステップ 10 challengeType: 0 dashedName: step-10 --- @@ -13,7 +13,7 @@ dashedName: step-10 # --hints-- -`div` 要素があるはずです。 +`div`要素が必要です。 ```js assert.lengthOf(document.querySelectorAll('div'), 2); @@ -33,17 +33,17 @@ assert.equal(document.querySelectorAll('div')[1]?.getAttribute('class'), 'box'); - - fCC Cat Painting - + + fCC Cat Painting + -
-
- --fcc-editable-region-- - - --fcc-editable-region-- -
+
+
+ --fcc-editable-region-- + + --fcc-editable-region-- +
``` @@ -59,8 +59,8 @@ body { .cat-head { position: absolute; - top: 300px; - left: 400px; + top: 100px; + left: 100px; background: linear-gradient(#5e5e5e 85%, #45454f 100%); width: 205px; height: 180px; diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/6476fc5cf14b276e6d04e82a.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/6476fc5cf14b276e6d04e82a.md index a9e64feb40e..7d1db9b0b8b 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/6476fc5cf14b276e6d04e82a.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/6476fc5cf14b276e6d04e82a.md @@ -1,6 +1,6 @@ --- id: 6476fc5cf14b276e6d04e82a -title: Step 11 +title: ステップ11 challengeType: 0 dashedName: step-11 --- @@ -61,15 +61,15 @@ assert.equal(new __helpers.CSSHelp(document)?.getStyle('.box')?.top, '800px'); - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
+
+
+
+
``` @@ -84,7 +84,7 @@ body { } .cat-head { - position: relative; + position: absolute; top: 100px; left: 100px; background: linear-gradient(#5e5e5e 85%, #45454f 100%); diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/6476fd4213318f6ee211028a.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/6476fd4213318f6ee211028a.md index ef4f13273c3..88fa75d64e6 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/6476fd4213318f6ee211028a.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/6476fd4213318f6ee211028a.md @@ -1,13 +1,13 @@ --- id: 6476fd4213318f6ee211028a -title: Step 12 +title: ステップ 12 challengeType: 0 dashedName: step-12 --- # --description-- -今、`position` の `.cat-head` プロパティの値を `fixed` に置き換えてください。`top` と `left` はそのままにしてください。 +`.cat-head` の `position` プロパティの値を `fixed` に置き換えてください。 その後、上下にスクロールして `fixed` の値がどのように動作するか確認してください。 @@ -39,15 +39,15 @@ assert.equal(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.left, '100p - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
+
+
+
+
``` @@ -63,10 +63,10 @@ body { .cat-head { --fcc-editable-region-- - position: relative; + position: absolute; +--fcc-editable-region-- top: 100px; left: 100px; ---fcc-editable-region-- background: linear-gradient(#5e5e5e 85%, #45454f 100%); width: 205px; height: 180px; diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/64770351e8586671ec0911f0.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/64770351e8586671ec0911f0.md index 79014f127d8..f722eed80b6 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/64770351e8586671ec0911f0.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/64770351e8586671ec0911f0.md @@ -41,15 +41,15 @@ assert.notMatch(code, /left:\s*100px;?/); - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
+
+
+
+
``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/6477062778c85972eb648030.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/6477062778c85972eb648030.md index a968e68f6d9..9566744d656 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/6477062778c85972eb648030.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/6477062778c85972eb648030.md @@ -1,6 +1,6 @@ --- id: 6477062778c85972eb648030 -title: Step 14 +title: ステップ 14 challengeType: 0 dashedName: step-14 --- @@ -57,15 +57,15 @@ assert.equal(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.margin, 'au - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
+
+
+
+
``` @@ -82,8 +82,8 @@ body { .cat-head { --fcc-editable-region-- position: sticky; - top: 0; --fcc-editable-region-- + top: 0; background: linear-gradient(#5e5e5e 85%, #45454f 100%); width: 205px; height: 180px; @@ -92,7 +92,7 @@ body { } .box { - width: 400px; + width: 200px; height: 600px; background-color: #000; position: absolute; diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/647d821de0d97b3283c72b36.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/647d821de0d97b3283c72b36.md index 966624d41e2..a8d3e9f1ce0 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/647d821de0d97b3283c72b36.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/647d821de0d97b3283c72b36.md @@ -1,6 +1,6 @@ --- id: 647d821de0d97b3283c72b36 -title: Step 16 +title: ステップ 16 challengeType: 0 dashedName: step-16 --- @@ -14,7 +14,7 @@ dashedName: step-16 `.box` の CSS ルールとそのすべての値を削除してください。 ```js -assert.notMatch(code, /\.box\s*\{\s*width:\s*400px;\s*height:\s*600px;\s*background-color:\s*#000;\s*position:\s*absolute;\s*left:\s*650px;\s*top:\s*800px;?\s*\}\s*/) +assert.notMatch(code, /\.box\s*\{\s*width:\s*200px;\s*height:\s*600px;\s*background-color:\s*#000;\s*position:\s*absolute;\s*left:\s*650px;\s*top:\s*800px;?\s*\}\s*/) ``` # --seed-- @@ -25,14 +25,14 @@ assert.notMatch(code, /\.box\s*\{\s*width:\s*400px;\s*height:\s*600px;\s*backgro - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
+
+
+
``` @@ -62,7 +62,7 @@ body { --fcc-editable-region-- .box { - width: 400px; + width: 200px; height: 600px; background-color: #000; position: absolute; diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/647d855ac12cd436059acd39.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/647d855ac12cd436059acd39.md index 7c72108d646..d4be38df7a8 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/647d855ac12cd436059acd39.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/647d855ac12cd436059acd39.md @@ -1,6 +1,6 @@ --- id: 647d855ac12cd436059acd39 -title: Step 2 +title: ステップ 2 challengeType: 0 dashedName: step-2 --- @@ -33,9 +33,9 @@ assert.strictEqual(new __helpers.CSSHelp(document).getStyle('*')?.boxSizing, 'bo - - fCC Cat Painting - + + fCC Cat Painting + diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/649353647c44ef4867ab4935.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/649353647c44ef4867ab4935.md index b773009f86b..59b8e8dbcde 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/649353647c44ef4867ab4935.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/649353647c44ef4867ab4935.md @@ -1,6 +1,6 @@ --- id: 649353647c44ef4867ab4935 -title: Step 15 +title: ステップ 15 challengeType: 0 dashedName: step-15 --- @@ -25,17 +25,17 @@ assert.notMatch(code, /<\/div>/) - - fCC Cat Painting - + + fCC Cat Painting + -
-
- --fcc-editable-region-- -
- --fcc-editable-region-- -
+
+
+ --fcc-editable-region-- +
+ --fcc-editable-region-- +
``` @@ -64,7 +64,7 @@ body { } .box { - width: 400px; + width: 200px; height: 600px; background-color: #000; position: absolute; diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/64a2687ef267e5934a2f93e3.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/64a2687ef267e5934a2f93e3.md index 1b83e488826..2f8e6cbb042 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/64a2687ef267e5934a2f93e3.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/64a2687ef267e5934a2f93e3.md @@ -1,6 +1,6 @@ --- id: 64a2687ef267e5934a2f93e3 -title: Step 57 +title: ステップ 57 challengeType: 0 dashedName: step-57 --- @@ -43,39 +43,39 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-mouth div')?.border, - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
- -
- -
-
-
+
+
-
+ +
+ +
+
+
+
+
+
``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/64a26ac5540c5493f4641f10.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/64a26ac5540c5493f4641f10.md index 8ead02295b0..45c86167acb 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/64a26ac5540c5493f4641f10.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/64a26ac5540c5493f4641f10.md @@ -1,6 +1,6 @@ --- id: 64a26ac5540c5493f4641f10 -title: Step 58 +title: ステップ 58 challengeType: 0 dashedName: step-58 --- @@ -32,39 +32,39 @@ assert.match(code, /border-radius:\s*190%\/190px\s*150px\s*0\s*0\s*;?/) - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
- -
- -
-
-
+
+
-
+ +
+ +
+
+
+
+
+
``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/64a3bcbc83e574b58c8ed048.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/64a3bcbc83e574b58c8ed048.md index 047a4b7f5c4..de6c4f6084a 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/64a3bcbc83e574b58c8ed048.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/64a3bcbc83e574b58c8ed048.md @@ -1,6 +1,6 @@ --- id: 64a3bcbc83e574b58c8ed048 -title: Step 68 +title: ステップ 68 challengeType: 0 dashedName: step-68 --- @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whiskers-right div') - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/6676a8a8d9861319ee901a90.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/6676a8a8d9861319ee901a90.md index b2b961bf08e..369e86a1b35 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/6676a8a8d9861319ee901a90.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/6676a8a8d9861319ee901a90.md @@ -1,6 +1,6 @@ --- id: 6676a8a8d9861319ee901a90 -title: Step 22 +title: ステップ 22 challengeType: 0 dashedName: step-22 --- @@ -103,23 +103,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-ear')?.borderBo - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/japanese/blocks/workshop-cat-painting/6676a8b01e56ec1a1e07c202.md b/curriculum/challenges/japanese/blocks/workshop-cat-painting/6676a8b01e56ec1a1e07c202.md index 12677249887..c719ac726f6 100644 --- a/curriculum/challenges/japanese/blocks/workshop-cat-painting/6676a8b01e56ec1a1e07c202.md +++ b/curriculum/challenges/japanese/blocks/workshop-cat-painting/6676a8b01e56ec1a1e07c202.md @@ -73,23 +73,23 @@ assert.isEmpty(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.backg - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` @@ -117,15 +117,15 @@ body { border-radius: 46%; } ---fcc-editable-region-- .cat-right-ear { +--fcc-editable-region-- height: 100px; width: 100px; background-color: white; border-left: 35px solid blue; border-right: 35px solid blue; border-top: 35px solid red; +--fcc-editable-region-- border-bottom: 35px solid red; } ---fcc-editable-region-- ``` diff --git a/curriculum/challenges/japanese/blocks/workshop-envelope-budget-app/69b2c970cb02ddaafff1c10d.md b/curriculum/challenges/japanese/blocks/workshop-envelope-budget-app/69b2c970cb02ddaafff1c10d.md index 3163b9b6f1c..d906b5a1d74 100644 --- a/curriculum/challenges/japanese/blocks/workshop-envelope-budget-app/69b2c970cb02ddaafff1c10d.md +++ b/curriculum/challenges/japanese/blocks/workshop-envelope-budget-app/69b2c970cb02ddaafff1c10d.md @@ -62,7 +62,7 @@ assert.notMatch(code, /<\/input>/); `input` 要素には閉じる `>` が必要です。 ```js -assert.match(code, /HTMLString\s*=\s*`\n\s*Expense\s\$\{entryNumber\}\sName<\/label>\n\s*]*\/>/); +assert.match(code, /HTMLString\s*=\s*`\n\s*Expense\s\$\{entryNumber\}\sName<\/label>\n\s*]*>/); ``` # --seed-- diff --git a/curriculum/challenges/japanese/blocks/workshop-fcc-authors-page/69e14a2fd8ecf9210c0739ee.md b/curriculum/challenges/japanese/blocks/workshop-fcc-authors-page/69e14a2fd8ecf9210c0739ee.md index c43fb2b4d37..011175964f6 100644 --- a/curriculum/challenges/japanese/blocks/workshop-fcc-authors-page/69e14a2fd8ecf9210c0739ee.md +++ b/curriculum/challenges/japanese/blocks/workshop-fcc-authors-page/69e14a2fd8ecf9210c0739ee.md @@ -11,6 +11,12 @@ dashedName: step-26 エディターの指定された場所に`initialFetch`の関数呼び出しを追加してください。 +# --before-all-- + +```js +window.fetch = () => Promise.resolve({json: () => Promise.resolve([{ author: 'Whoever', image: 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==', url: "http://not-a-real-url.nowhere/", bio: 'words go here' }])}); +``` + # --hints-- `initialFetch`を引数なしで呼び出してください。 diff --git a/curriculum/challenges/japanese/blocks/workshop-fortune-teller-app/68ded620ab19272a3fa97592.md b/curriculum/challenges/japanese/blocks/workshop-fortune-teller-app/68ded620ab19272a3fa97592.md index e9d4a35f05c..3463a971931 100644 --- a/curriculum/challenges/japanese/blocks/workshop-fortune-teller-app/68ded620ab19272a3fa97592.md +++ b/curriculum/challenges/japanese/blocks/workshop-fortune-teller-app/68ded620ab19272a3fa97592.md @@ -73,10 +73,9 @@ assert.isTrue(renderCard.hasReturnAnnotation("string")); `renderCard`関数はテンプレートリテラルを返すべきです。 ```js -assert.match( - __helpers.removeJSComments(code), - /renderCard\s*=\s*\([^)]*\)\s*:\s*string\s*=>\s*(?:\{\s*return\s*)?`/ -); +const explorer = await __helpers.Explorer(code); +const { renderCard } = explorer.allFunctions; +assert.match(__helpers.removeJSComments(renderCard.toString()), /(?:return|=>)\s*`/); ``` # --seed-- diff --git a/curriculum/challenges/japanese/blocks/workshop-fortune-teller-app/68ed4621677e86eeefa59fe6.md b/curriculum/challenges/japanese/blocks/workshop-fortune-teller-app/68ed4621677e86eeefa59fe6.md index 8f9c66f8ff4..0949a46273b 100644 --- a/curriculum/challenges/japanese/blocks/workshop-fortune-teller-app/68ed4621677e86eeefa59fe6.md +++ b/curriculum/challenges/japanese/blocks/workshop-fortune-teller-app/68ed4621677e86eeefa59fe6.md @@ -15,8 +15,8 @@ dashedName: step-26 ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.initializeEventListeners.toString(); -assert.match(method, /initializeEventListeners\s*\(\s*\)\s*:\s*void/); +const { initializeEventListeners } = explorer.classes.Game?.methods ?? {}; +assert.isTrue(initializeEventListeners?.hasReturnAnnotation("void")); ``` # --seed-- diff --git a/curriculum/challenges/japanese/blocks/workshop-fortune-teller-app/68ee6c4b4c764b62d77df717.md b/curriculum/challenges/japanese/blocks/workshop-fortune-teller-app/68ee6c4b4c764b62d77df717.md index bc978e27b74..706eb2d3588 100644 --- a/curriculum/challenges/japanese/blocks/workshop-fortune-teller-app/68ee6c4b4c764b62d77df717.md +++ b/curriculum/challenges/japanese/blocks/workshop-fortune-teller-app/68ee6c4b4c764b62d77df717.md @@ -17,16 +17,30 @@ dashedName: step-31 ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.singleCardSelected.toString(); -assert.match(method, /const\s+isReversed\s*=/); +const { singleCardSelected } = explorer.classes.Game?.methods ?? {}; +const { isReversed } = singleCardSelected?.variables ?? {}; +assert.exists(isReversed); ``` `isReversed` 変数は、カードが裏向きかどうかをランダムに決めるために `Math.random()` を使うべきです。 ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.singleCardSelected.toString(); -assert.match(method, /isReversed\s*=\s*Math\.random\s*\(\s*\)\s*<\s*0\.5/); +const { singleCardSelected } = explorer.classes.Game?.methods ?? {}; +const { isReversed } = singleCardSelected?.variables ?? {}; + +const validForms = [ + 'Math.random() < 0.5', + 'Math.random() > 0.5', + 'Math.random() <= 0.5', + 'Math.random() >= 0.5', + '0.5 < Math.random()', + '0.5 > Math.random()', + '0.5 <= Math.random()', + '0.5 >= Math.random()' +]; + +assert.isTrue(validForms.some((form) => isReversed?.value.matches(form))); ``` # --seed-- diff --git a/curriculum/challenges/japanese/blocks/workshop-fortune-teller-app/68ee6c8c274515694ead0024.md b/curriculum/challenges/japanese/blocks/workshop-fortune-teller-app/68ee6c8c274515694ead0024.md index 36edde94be4..f7495666f47 100644 --- a/curriculum/challenges/japanese/blocks/workshop-fortune-teller-app/68ee6c8c274515694ead0024.md +++ b/curriculum/challenges/japanese/blocks/workshop-fortune-teller-app/68ee6c8c274515694ead0024.md @@ -7,7 +7,7 @@ dashedName: step-32 # --description-- -運勢はランダムでなければならないので、ランダムな運勢を選ぶためのヘルパー関数が必要です。`chosenCard` メソッドの中に `singleCardSelected` という名前の変数を宣言してください。`getRandomItem` メソッドを使ってランダムなカードを取得し、`cards` を引数として渡してください。 +運勢はランダムでなければならないので、ランダムな運勢を選ぶためのヘルパー関数が必要です。`singleCardSelected` メソッドの中に `chosenCard` という名前の変数を宣言してください。`getRandomItem` 関数を使ってランダムなカードを取得し、引数として `this.cards` を渡してください。 # --hints-- @@ -15,22 +15,18 @@ dashedName: step-32 ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.singleCardSelected.toString(); -assert.match(method, /const\s+chosenCard\s*=/); +const { singleCardSelected } = explorer.classes.Game?.methods ?? {}; +const { chosenCard } = singleCardSelected?.variables ?? {}; +assert.exists(chosenCard); ``` `chosenCard` 変数は `getRandomItem(this.cards)` を呼び出して代入されているべきです。 ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.singleCardSelected.toString(); -assert.match(method, /chosenCard\s*=\s*getRandomItem\s*\(\s*this\.cards\s*\)/); -``` - -`this.cards` に渡す引数として `getRandomItem` を使うべきです。 - -```js -assert.match(__helpers.removeJSComments(code), /getRandomItem\s*\(\s*this\.cards\s*\)/); +const { singleCardSelected } = explorer.classes.Game?.methods ?? {}; +const { chosenCard } = singleCardSelected?.variables ?? {}; +assert.isTrue(chosenCard?.value.matches("getRandomItem(this.cards)")); ``` # --seed-- diff --git a/curriculum/challenges/japanese/blocks/workshop-fortune-teller-app/68f1e43a5f890b51774d93c4.md b/curriculum/challenges/japanese/blocks/workshop-fortune-teller-app/68f1e43a5f890b51774d93c4.md index 644cc3abc04..cff0d076724 100644 --- a/curriculum/challenges/japanese/blocks/workshop-fortune-teller-app/68f1e43a5f890b51774d93c4.md +++ b/curriculum/challenges/japanese/blocks/workshop-fortune-teller-app/68f1e43a5f890b51774d93c4.md @@ -15,22 +15,28 @@ dashedName: step-43 ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /const\s+target\s*=/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { target } = showFortune?.variables ?? {}; +assert.exists(target); ``` `target` 変数には `e.target` を代入してください。 ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /target\s*=\s*e\.target/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { target } = showFortune?.variables ?? {}; +assert.isTrue(target?.value.matches("e.target")); ``` `if` 変数のすぐ後に空の `target` 文があるはずです。 ```js -assert.match(__helpers.removeJSComments(code), /showFortune\s*\([^)]*\)\s*\{[\s\S]*?if\s*\(\s*\)\s*\{\s*\}/); +const explorer = await __helpers.Explorer(code); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +assert.exists(showFortune); +const method = __helpers.removeJSComments(showFortune.toString()); +assert.match(method, /target\s*=\s*e\.target[\s\S]*?if\s*\(\s*\)\s*\{\s*\}/); ``` # --seed-- diff --git a/curriculum/challenges/japanese/blocks/workshop-fortune-teller-app/68f1e6a98bc05e67cc2b85e6.md b/curriculum/challenges/japanese/blocks/workshop-fortune-teller-app/68f1e6a98bc05e67cc2b85e6.md index dd6dca217ec..4e5a90b93ca 100644 --- a/curriculum/challenges/japanese/blocks/workshop-fortune-teller-app/68f1e6a98bc05e67cc2b85e6.md +++ b/curriculum/challenges/japanese/blocks/workshop-fortune-teller-app/68f1e6a98bc05e67cc2b85e6.md @@ -15,22 +15,18 @@ dashedName: step-45 ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /const\s+cardElement\s*=/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { cardElement } = showFortune?.variables ?? {}; +assert.exists(cardElement); ``` `cardElement` は `target?.closest` を使って `.card_container` を見つけるべきです。 ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /cardElement\s*=\s*target\?\.closest\s*\(\s*['"]\.card_container['"]\s*\)/); -``` - -`.card_container` に引数として `closest` を渡してください。 - -```js -assert.match(__helpers.removeJSComments(code), /\.closest\s*\(\s*['"]\.card_container['"]\s*\)/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { cardElement } = showFortune?.variables ?? {}; +assert.isTrue(cardElement?.value.matches("target?.closest('.card_container')")); ``` # --seed-- diff --git a/curriculum/challenges/japanese/blocks/workshop-fortune-teller-app/68f1e852f705eb77f6bcb893.md b/curriculum/challenges/japanese/blocks/workshop-fortune-teller-app/68f1e852f705eb77f6bcb893.md index 70871f4b040..5e2077d622f 100644 --- a/curriculum/challenges/japanese/blocks/workshop-fortune-teller-app/68f1e852f705eb77f6bcb893.md +++ b/curriculum/challenges/japanese/blocks/workshop-fortune-teller-app/68f1e852f705eb77f6bcb893.md @@ -15,28 +15,18 @@ dashedName: step-48 ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /const\s+cardId\s*=/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { cardId } = showFortune?.variables ?? {}; +assert.exists(cardId); ``` `cardId` 変数には `cardElement.getAttribute("data-id")` を呼び出して代入してください。 ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /cardId\s*=\s*cardElement\.getAttribute\s*\(\s*['"]data-id['"]\s*\)/); -``` - -`getAttribute` に対して `cardElement` メソッドを使う必要があります。 - -```js -assert.match(__helpers.removeJSComments(code), /cardElement\.getAttribute\s*\(/); -``` - -`'data-id'` に `getAttribute` を渡してください。 - -```js -assert.match(__helpers.removeJSComments(code), /\.getAttribute\s*\(\s*['"]data-id['"]\s*\)/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { cardId } = showFortune?.variables ?? {}; +assert.isTrue(cardId?.value.matches('cardElement.getAttribute("data-id")')); ``` # --seed-- diff --git a/curriculum/challenges/japanese/blocks/workshop-fortune-teller-app/68f1e8de2731b07d62e738d2.md b/curriculum/challenges/japanese/blocks/workshop-fortune-teller-app/68f1e8de2731b07d62e738d2.md index 3415ee26e35..99a22be364c 100644 --- a/curriculum/challenges/japanese/blocks/workshop-fortune-teller-app/68f1e8de2731b07d62e738d2.md +++ b/curriculum/challenges/japanese/blocks/workshop-fortune-teller-app/68f1e8de2731b07d62e738d2.md @@ -15,28 +15,38 @@ dashedName: step-49 ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /const\s+foundCard\s*=/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { foundCard } = showFortune?.variables ?? {}; +assert.exists(foundCard); ``` -`foundCard` は正しいコールバックを使って `find` の `this.cards` を呼び出した結果を代入してください。 +`foundCard` は `this.cards` の `find` を呼び出して代入してください。コールバックには `card` パラメータを受け取り、`card.name_short` と `cardId` を厳密等価演算子で比較した結果を返す関数を渡してください。 ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /foundCard\s*=\s*this\.cards\.find\s*\(/); -``` - -`find` のコールバックは `card` という名前のパラメータを持つべきです。 - -```js -assert.match(__helpers.removeJSComments(code), /cards\.find\s*\(\s*\(\s*card\s*\)\s*=>/); -``` - -コールバックの中で `card.name_short` と `cardId` を比較してください。 - -```js -assert.match(__helpers.removeJSComments(code), /card\.name_short\s*===?\s*cardId/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { foundCard } = showFortune?.variables ?? {}; + +const validForms = [ + 'this.cards.find((card) => card.name_short === cardId)', + 'this.cards.find((card) => { return card.name_short === cardId; })', + 'this.cards.find((card) => cardId === card.name_short)', + 'this.cards.find((card) => { return cardId === card.name_short; })', + 'this.cards.find(card => card.name_short === cardId)', + 'this.cards.find(card => { return card.name_short === cardId; })', + 'this.cards.find(card => cardId === card.name_short)', + 'this.cards.find(card => { return cardId === card.name_short; })', + 'this.cards.find((card: Card) => card.name_short === cardId)', + 'this.cards.find((card: Card) => { return card.name_short === cardId; })', + 'this.cards.find((card: Card) => cardId === card.name_short)', + 'this.cards.find((card: Card) => { return cardId === card.name_short; })', + 'this.cards.find(function (card) { return card.name_short === cardId; })', + 'this.cards.find(function (card) { return cardId === card.name_short; })', + 'this.cards.find(function (card: Card) { return card.name_short === cardId; })', + 'this.cards.find(function (card: Card) { return cardId === card.name_short; })' +]; + +assert.isTrue(validForms.some((form) => foundCard?.value.matches(form))); ``` # --seed-- diff --git a/curriculum/challenges/japanese/blocks/workshop-greeting-bot/66ad8ab945d266383f318cbf.md b/curriculum/challenges/japanese/blocks/workshop-greeting-bot/66ad8ab945d266383f318cbf.md index a8b4740c583..2c9d75b665f 100644 --- a/curriculum/challenges/japanese/blocks/workshop-greeting-bot/66ad8ab945d266383f318cbf.md +++ b/curriculum/challenges/japanese/blocks/workshop-greeting-bot/66ad8ab945d266383f318cbf.md @@ -30,7 +30,11 @@ assert.lengthOf(logSpy.calls, 2); `console`文にはメッセージ`"I am excited to talk to you."`を含めてください。引用符を忘れないでください。 ```js -assert.deepInclude(logSpy.calls, ["I am excited to talk to you."]); +assert.isTrue( + logSpy.calls.some( + (call) => /I\s+am\s+excited\s+to\s+talk\s+to\s+you\s*\./.test(call[0]) + ) +); ``` # --seed-- diff --git a/curriculum/challenges/japanese/blocks/workshop-greeting-bot/66ad9c633fa26d3c1475eae3.md b/curriculum/challenges/japanese/blocks/workshop-greeting-bot/66ad9c633fa26d3c1475eae3.md index 6bf7106f1fe..70f9586f449 100644 --- a/curriculum/challenges/japanese/blocks/workshop-greeting-bot/66ad9c633fa26d3c1475eae3.md +++ b/curriculum/challenges/japanese/blocks/workshop-greeting-bot/66ad9c633fa26d3c1475eae3.md @@ -28,7 +28,11 @@ assert.lengthOf(logSpy.calls, 3); `console`文にはメッセージ`"Allow me to introduce myself."`を含めてください。引用符を忘れないでください。 ```js -assert.deepInclude(logSpy.calls, ["Allow me to introduce myself."]); +assert.isTrue( + logSpy.calls.some( + (call) => /Allow\s+me\s+to\s+introduce\s+myself\s*\./.test(call[0]) + ) +); ``` # --seed-- diff --git a/curriculum/challenges/japanese/blocks/workshop-greeting-bot/66add47d27763c4862492c8c.md b/curriculum/challenges/japanese/blocks/workshop-greeting-bot/66add47d27763c4862492c8c.md index 8ada0aea861..7d746510770 100644 --- a/curriculum/challenges/japanese/blocks/workshop-greeting-bot/66add47d27763c4862492c8c.md +++ b/curriculum/challenges/japanese/blocks/workshop-greeting-bot/66add47d27763c4862492c8c.md @@ -76,12 +76,10 @@ console.log(favoriteSubjectSentence); ```js console.log("Hi there!"); console.log("I am excited to talk to you."); - let bot; -let botLocation; - bot = "teacherBot"; -botLocation = "the universe"; + +let botLocation = "the universe"; console.log("Allow me to introduce myself."); diff --git a/curriculum/challenges/japanese/blocks/workshop-hotel-feedback-form/66a93bbe65a26169dbf3bc39.md b/curriculum/challenges/japanese/blocks/workshop-hotel-feedback-form/66a93bbe65a26169dbf3bc39.md index d2e07f0f1fe..5c8fb24817f 100644 --- a/curriculum/challenges/japanese/blocks/workshop-hotel-feedback-form/66a93bbe65a26169dbf3bc39.md +++ b/curriculum/challenges/japanese/blocks/workshop-hotel-feedback-form/66a93bbe65a26169dbf3bc39.md @@ -13,7 +13,7 @@ dashedName: step-10 # --hints-- -`label` 要素があるはずです。 +`fieldset` の中に 2 つ目の `label` 要素を追加してください。 ```js assert.lengthOf(document.querySelectorAll('fieldset label'), 2); diff --git a/curriculum/challenges/japanese/blocks/workshop-hotel-feedback-form/66a9401c9d660d6bb15993e2.md b/curriculum/challenges/japanese/blocks/workshop-hotel-feedback-form/66a9401c9d660d6bb15993e2.md index 257bea85584..fa98af80f3b 100644 --- a/curriculum/challenges/japanese/blocks/workshop-hotel-feedback-form/66a9401c9d660d6bb15993e2.md +++ b/curriculum/challenges/japanese/blocks/workshop-hotel-feedback-form/66a9401c9d660d6bb15993e2.md @@ -15,7 +15,7 @@ dashedName: step-13 # --hints-- -`label` 要素が必要です。 +`fieldset` の中に3つ目の `label` 要素を追加してください。 ```js assert.lengthOf(document.querySelectorAll('fieldset label'), 3); diff --git a/curriculum/challenges/japanese/blocks/workshop-hotel-feedback-form/66a9419e2d18476c645ce693.md b/curriculum/challenges/japanese/blocks/workshop-hotel-feedback-form/66a9419e2d18476c645ce693.md index a05e9013d4b..e65d4211404 100644 --- a/curriculum/challenges/japanese/blocks/workshop-hotel-feedback-form/66a9419e2d18476c645ce693.md +++ b/curriculum/challenges/japanese/blocks/workshop-hotel-feedback-form/66a9419e2d18476c645ce693.md @@ -17,9 +17,9 @@ dashedName: step-14 `min` と `max` の属性は、入力フィールドに入力できる最小値と最大値を設定するために使われます。 -`label` 要素の下に、`type` 属性を `"number"` に設定し、`id` を `"age"` に設定した入力を追加してください。 +`label` 要素の下に、`type` 属性が `"number"` に設定され、`id` が `"age"` の `input` を追加してください。 -`name` 属性は `"age"` に設定し、`min` 属性は `"3"` に設定し、`max` 属性は `"100"` に設定してください。 +`name` 属性は `"age"` に、`min` 属性は `"3"` に、`max` 属性は `"100"` に設定してください。 # --hints-- @@ -29,13 +29,13 @@ dashedName: step-14 assert.isNotNull(document.querySelector('label + input[type="number"]')); ``` -数値の `input` は `id` の `age` を持っているはずです。 +数値の `input` には `id` が `"age"` である必要があります。 ```js assert.isNotNull(document.querySelector('label + input#age')); ``` -数値の `input` は `name` に設定された `age` 属性を持っているはずです。 +数値の `input` には `name` 属性が `"age"` に設定されている必要があります。 ```js assert.isNotNull(document.querySelector('label + input[name="age"]')); diff --git a/curriculum/challenges/japanese/blocks/workshop-hotel-feedback-form/67a51d3a8a6fe123b77b0c6e.md b/curriculum/challenges/japanese/blocks/workshop-hotel-feedback-form/67a51d3a8a6fe123b77b0c6e.md index 71b09694fdc..c75ef521fce 100644 --- a/curriculum/challenges/japanese/blocks/workshop-hotel-feedback-form/67a51d3a8a6fe123b77b0c6e.md +++ b/curriculum/challenges/japanese/blocks/workshop-hotel-feedback-form/67a51d3a8a6fe123b77b0c6e.md @@ -7,11 +7,11 @@ dashedName: step-12 # --description-- -`input` 要素は `size` 属性を持つことができます。この属性は、ユーザーが入力中に表示される文字数を定義します。`size` の値は 0 より大きい非負整数である必要があります。`size` が指定されていない場合、または無効な値が指定されている場合、入力はブラウザによって設定されたデフォルトの幅になります。 +`input` 要素は `size` 属性を持つことができます。この属性は、ユーザーが `input` に入力するときに表示される文字数を定義します。`size` の値は正の整数である必要があります。`size` が指定されていないか、無効な値が指定されている場合、`input` はブラウザーによって設定されたデフォルトの幅になります。 ```html - - + + ``` name と email の入力に `size` 属性を値 `"20"` で付けてください。 diff --git a/curriculum/challenges/japanese/blocks/workshop-plant-nursery-catalog/6734a772196245601e4b80e0.md b/curriculum/challenges/japanese/blocks/workshop-plant-nursery-catalog/6734a772196245601e4b80e0.md index 7cd43ab9047..1c639667ce3 100644 --- a/curriculum/challenges/japanese/blocks/workshop-plant-nursery-catalog/6734a772196245601e4b80e0.md +++ b/curriculum/challenges/japanese/blocks/workshop-plant-nursery-catalog/6734a772196245601e4b80e0.md @@ -9,7 +9,7 @@ dashedName: step-10 マップから要素を取得する必要があるときは、`get` メソッドを使えます。このメソッドはキーを引数に取り、関連付けられた値を返します。 -`get` メソッドを使ってカタログから `ballerina` キーの値を取得し、`getBallerina` という名前の変数に代入してください。その後、新しい変数をコンソールに出力してください。 +`get` メソッドを使ってカタログから `ballerina` キーの値を取得し、`getBallerina` という名前の変数に代入してください。その後、新しい変数をコンソールにログ出力してください。 # --hints-- @@ -22,7 +22,10 @@ assert.exists(getBallerina); `getBallerina` 変数には `catalog.get(ballerina)` の値が入っているはずです。 ```js -assert.match(__helpers.removeJSComments(code), /(const|let|var)\s+getBallerina\s*=\s*catalog\s*\.\s*get\s*\(\s*ballerina\s*\)/); +const explorer = await __helpers.Explorer(code); +const { getBallerina } = explorer.variables; +assert.isTrue(getBallerina?.value.matches('catalog.get(ballerina)') +); ``` `getBallerina` 変数をコンソールに出力してください。 diff --git a/curriculum/challenges/japanese/blocks/workshop-plant-nursery-catalog/6737a1a073a0d14c6544d301.md b/curriculum/challenges/japanese/blocks/workshop-plant-nursery-catalog/6737a1a073a0d14c6544d301.md index 6ff989c72cc..a8699fb6c00 100644 --- a/curriculum/challenges/japanese/blocks/workshop-plant-nursery-catalog/6737a1a073a0d14c6544d301.md +++ b/curriculum/challenges/japanese/blocks/workshop-plant-nursery-catalog/6737a1a073a0d14c6544d301.md @@ -23,7 +23,9 @@ assert.exists(plantsSet); `displayPlantsSet` を呼び出し、その結果を `plantsSet` に代入してください。 ```js -assert.match(__helpers.removeJSComments(code), /(const|let|var)\s+plantsSet\s*=\s*displayPlantsSet\s*\(\s*\)/) +const explorer = await __helpers.Explorer(code); +const { plantsSet } = explorer.variables; +assert.isTrue(plantsSet?.value.matches('displayPlantsSet()')); ``` `plantsSet` をコンソールに表示してください。 diff --git a/curriculum/challenges/japanese/blocks/workshop-reusable-mega-navbar/6740495ba48aa94e5667b436.md b/curriculum/challenges/japanese/blocks/workshop-reusable-mega-navbar/6740495ba48aa94e5667b436.md index edfc1f5e9cc..90a88ff7d0e 100644 --- a/curriculum/challenges/japanese/blocks/workshop-reusable-mega-navbar/6740495ba48aa94e5667b436.md +++ b/curriculum/challenges/japanese/blocks/workshop-reusable-mega-navbar/6740495ba48aa94e5667b436.md @@ -24,7 +24,7 @@ export function multiply(a, b) { } ``` -また、Reactの関数コンポーネントは通常のHTML要素と区別するために、必ず大文字で始める必要があります。 +また、Reactの関数コンポーネントは大文字で始める必要があります。これはReactが通常のHTML要素と区別する方法だからです。 # --hints-- diff --git a/curriculum/challenges/japanese/blocks/workshop-reusable-mega-navbar/67457ff2dc531fbed928a0f0.md b/curriculum/challenges/japanese/blocks/workshop-reusable-mega-navbar/67457ff2dc531fbed928a0f0.md index 3acc855216b..04daf91e7d1 100644 --- a/curriculum/challenges/japanese/blocks/workshop-reusable-mega-navbar/67457ff2dc531fbed928a0f0.md +++ b/curriculum/challenges/japanese/blocks/workshop-reusable-mega-navbar/67457ff2dc531fbed928a0f0.md @@ -24,10 +24,9 @@ const App = () => { } ``` - `Navbar`コンポーネント内で、`nav`が`className`の`navbar`要素を返してください。 -ここで`className`の代わりに`class`が使われる理由は、`class`がJavaScriptの予約語だからです。Reactでは要素にクラスを適用するために`className`を使います。 +`className` はここで `class` の代わりに使われています。なぜなら、`class` は JavaScript の予約語だからです。そのため、React では要素にクラスを適用する方法として `className` を使います。 # --hints-- @@ -37,7 +36,7 @@ const App = () => { assert.exists(document.querySelector('nav')); ``` -`nav`要素には、`className`属性を`navbar`の値で設定してください。 +あなたの `nav` 要素には `className` として `navbar` を設定してください。 ```js assert.equal(document.querySelector('nav')?.getAttribute('class'), 'navbar'); diff --git a/curriculum/challenges/japanese/blocks/workshop-reusable-mega-navbar/6745c732dbeb7c04f346e6f7.md b/curriculum/challenges/japanese/blocks/workshop-reusable-mega-navbar/6745c732dbeb7c04f346e6f7.md index cf78bb064d5..ddaee9d4cab 100644 --- a/curriculum/challenges/japanese/blocks/workshop-reusable-mega-navbar/6745c732dbeb7c04f346e6f7.md +++ b/curriculum/challenges/japanese/blocks/workshop-reusable-mega-navbar/6745c732dbeb7c04f346e6f7.md @@ -7,7 +7,7 @@ dashedName: step-3 # --description-- -`ul` 要素の中に `nav` 要素を作成してください。その `ul` 要素の中に3つのリスト項目を作成してください。 +`nav` 要素の中に `ul` 要素を作成してください。その `ul` 要素の中に、3つの `li` 要素を作成してください。 # --hints-- diff --git a/curriculum/challenges/japanese/blocks/workshop-reusable-mega-navbar/6745c89fba004707ded84453.md b/curriculum/challenges/japanese/blocks/workshop-reusable-mega-navbar/6745c89fba004707ded84453.md index 7dacf65775e..2509e8b1a30 100644 --- a/curriculum/challenges/japanese/blocks/workshop-reusable-mega-navbar/6745c89fba004707ded84453.md +++ b/curriculum/challenges/japanese/blocks/workshop-reusable-mega-navbar/6745c89fba004707ded84453.md @@ -7,17 +7,17 @@ dashedName: step-5 # --description-- -最初の `li` 要素の中にアンカー要素を作成してください。`a` 要素に `href` 属性を `#` に設定し、テキストを `Dashboard` にしてください。 +最初の`li`要素の中に`a`要素を作成してください。`href`属性に`#`を設定し、テキストは`Dashboard`にしてください。 # --hints-- -最初のリスト項目の中に `a` 要素を作成する必要があります。 +最初の`li`要素の中に`a`要素を作成してください。 ```js assert.exists(document.querySelector('li a')); ``` -`a`要素の`href`属性は`#`に設定してください。 +あなたの`a`要素には`href`属性として`#`を設定してください。 ```js assert.equal(document.querySelector('a')?.getAttribute('href'), '#'); diff --git a/curriculum/challenges/japanese/blocks/workshop-reusable-mega-navbar/6745cebbf97ef2129f3b9bab.md b/curriculum/challenges/japanese/blocks/workshop-reusable-mega-navbar/6745cebbf97ef2129f3b9bab.md index ff6c4fa56a1..cb887bd348d 100644 --- a/curriculum/challenges/japanese/blocks/workshop-reusable-mega-navbar/6745cebbf97ef2129f3b9bab.md +++ b/curriculum/challenges/japanese/blocks/workshop-reusable-mega-navbar/6745cebbf97ef2129f3b9bab.md @@ -7,17 +7,17 @@ dashedName: step-6 # --description-- -2番目の`a`要素の中に、別の`li`要素を作成してください。`href`という`#`属性を与え、テキストは`Widgets`にしてください。 +2番目の`li`要素の中にもう1つ`a`要素を作成してください。`href`属性に`#`を設定し、テキストは`Widgets`にしてください。 # --hints-- -2番目のリスト項目の中に`a`要素を作成する必要があります。 +2番目の`li`要素の中に`a`要素を作成してください。 ```js assert.lengthOf(document.querySelectorAll('li a'), 2); ``` -`a`要素の`href`属性は`#`に設定してください。 +作成した`a`要素には`href`属性として`#`を設定してください。 ```js assert.equal(document.querySelectorAll('a')[1]?.getAttribute('href'), '#'); diff --git a/curriculum/challenges/japanese/blocks/workshop-reusable-mega-navbar/6745d799beeb822076a4da9d.md b/curriculum/challenges/japanese/blocks/workshop-reusable-mega-navbar/6745d799beeb822076a4da9d.md index b5b5bb95531..c997edb4bca 100644 --- a/curriculum/challenges/japanese/blocks/workshop-reusable-mega-navbar/6745d799beeb822076a4da9d.md +++ b/curriculum/challenges/japanese/blocks/workshop-reusable-mega-navbar/6745d799beeb822076a4da9d.md @@ -7,19 +7,19 @@ dashedName: step-7 # --description-- -3番目のリスト項目の中に、`button` 要素を作成し、`aria-expanded` 属性を `false` に設定してください。また、`button` のテキストを `Apps` に設定してください。 +3番目の`li`要素の中に、`aria-expanded`属性が`false`の`button`要素を作成してください。また、`button`のテキストを`Apps`に設定してください。 `aria-expanded` 属性は、ボタンが展開可能なサブメニューを起動することをスクリーンリーダーのユーザーに伝えます。 # --hints-- -3番目のリスト項目の中に `button` 要素を作成してください。 +3番目の`li`要素の中に`button`要素を作成してください。 ```js assert.exists(document.querySelector('li:nth-of-type(3) button')); ``` -`button` 要素には `aria-expanded` 属性を `false` に設定してください。 +あなたの`button`要素には`aria-expanded`属性が`false`である必要があります。 ```js assert.equal( diff --git a/curriculum/challenges/japanese/blocks/workshop-reusable-mega-navbar/6745d9df333efe2543a1f457.md b/curriculum/challenges/japanese/blocks/workshop-reusable-mega-navbar/6745d9df333efe2543a1f457.md index cc10f9a37cf..d6f078cc29e 100644 --- a/curriculum/challenges/japanese/blocks/workshop-reusable-mega-navbar/6745d9df333efe2543a1f457.md +++ b/curriculum/challenges/japanese/blocks/workshop-reusable-mega-navbar/6745d9df333efe2543a1f457.md @@ -7,7 +7,7 @@ dashedName: step-8 # --description-- -3番目の`li`要素の中に、ポップアップ用の`ul`要素を作成してください。`className`の`sub-menu`と`aria-label`の`Apps`を設定してください。 +3番目の`li`要素の中にまだいて、ポップアップ用の`ul`要素を作成してください。`className`に`sub-menu`を、`aria-label`に`Apps`を設定してください。 # --hints-- @@ -17,13 +17,13 @@ dashedName: step-8 assert.exists(document.querySelector('li ul')); ``` -`ul`要素の`className`属性を`sub-menu`に設定してください。 +あなたの`ul`要素は`className`に`sub-menu`を持っている必要があります。 ```js assert.equal(document.querySelector('li ul')?.getAttribute('class'), 'sub-menu'); ``` -`ul`要素の`aria-label`属性を`Apps`に設定してください。 +あなたの`ul`要素は`aria-label`に`Apps`を持っている必要があります。 ```js assert.equal(document.querySelector('li ul')?.getAttribute('aria-label'), 'Apps'); diff --git a/curriculum/challenges/japanese/blocks/workshop-reusable-mega-navbar/6745dce846995b2a466594be.md b/curriculum/challenges/japanese/blocks/workshop-reusable-mega-navbar/6745dce846995b2a466594be.md index b8ee0f3d688..e007d5e82b1 100644 --- a/curriculum/challenges/japanese/blocks/workshop-reusable-mega-navbar/6745dce846995b2a466594be.md +++ b/curriculum/challenges/japanese/blocks/workshop-reusable-mega-navbar/6745dce846995b2a466594be.md @@ -7,11 +7,11 @@ dashedName: step-9 # --description-- -`ul.sub-menu` 要素の中に新しいリスト項目を3つ作成してください。 +`ul` 要素の中に `className` が `sub-menu` の新しい `li` 要素を3つ作成してください。 # --hints-- -`ul` 要素の中に、`className` の `sub-menu` を持つ新しいリスト項目を3つ作成してください。 +`ul` 要素の中に `className` が `sub-menu` の新しい `li` 要素を3つ作成してください。 ```js assert.lengthOf(document.querySelectorAll('.sub-menu li'), 3); diff --git a/curriculum/challenges/japanese/blocks/workshop-reusable-mega-navbar/6745de9ce925b92d72df713a.md b/curriculum/challenges/japanese/blocks/workshop-reusable-mega-navbar/6745de9ce925b92d72df713a.md index 1425fbb92bc..ed9c1cefacf 100644 --- a/curriculum/challenges/japanese/blocks/workshop-reusable-mega-navbar/6745de9ce925b92d72df713a.md +++ b/curriculum/challenges/japanese/blocks/workshop-reusable-mega-navbar/6745de9ce925b92d72df713a.md @@ -7,11 +7,11 @@ dashedName: step-10 # --description-- -各`li`要素の中に、`href`属性が`#`に設定されたアンカー要素を作成してください。 +3つの新しい`li`要素のそれぞれの中に、`href`属性が`#`の`a`要素を作成してください。 # --hints-- -各リスト項目の中に新しい`a`要素を作成し、その`href`属性を`#`に設定してください。 +3つの新しい`li`要素のそれぞれの中に、`href`属性が`#`の新しい`a`要素を作成してください。 ```js assert.equal(document.querySelectorAll('li a')[2]?.getAttribute('href'), '#'); diff --git a/curriculum/challenges/japanese/blocks/workshop-reusable-mega-navbar/6745e2aca895c935168e7d91.md b/curriculum/challenges/japanese/blocks/workshop-reusable-mega-navbar/6745e2aca895c935168e7d91.md index 64684305d0d..4af89d0a323 100644 --- a/curriculum/challenges/japanese/blocks/workshop-reusable-mega-navbar/6745e2aca895c935168e7d91.md +++ b/curriculum/challenges/japanese/blocks/workshop-reusable-mega-navbar/6745e2aca895c935168e7d91.md @@ -7,25 +7,25 @@ dashedName: step-11 # --description-- -最後に、最初のアンカー要素には`Calendar`のテキストを、2番目には`Chat`のテキストを、3番目には`Email`のテキストを設定してください。 +最後に、最初の`a`要素のテキストを`Calendar`に、2番目を`Chat`に、3番目を`Email`に設定してください。 -これで、あなたのメガナビゲーションバーコンポーネントが完成です! +これで、`Navbar`コンポーネントが完成です! # --hints-- -最初のアンカー要素には`Calendar`のテキストを設定してください。 +最初の`a`要素のテキストを`Calendar`に設定してください。 ```js assert.equal(document.querySelectorAll('li a')[2]?.textContent, 'Calendar'); ``` -2番目のアンカー要素には`Chat`のテキストを設定してください。 +2番目の`a`要素のテキストを`Chat`に設定してください。 ```js assert.equal(document.querySelectorAll('li a')[3]?.textContent, 'Chat'); ``` -3番目のアンカー要素には`Email`のテキストを設定してください。 +3番目の`a`要素のテキストを`Email`に設定してください。 ```js assert.equal(document.querySelectorAll('li a')[4]?.textContent, 'Email'); diff --git a/curriculum/challenges/japanese/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165b.md b/curriculum/challenges/japanese/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165b.md index 4f8889c1a47..843f275395f 100644 --- a/curriculum/challenges/japanese/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165b.md +++ b/curriculum/challenges/japanese/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165b.md @@ -7,7 +7,7 @@ dashedName: step-5 # --description-- -return文の中で、空の文字列を`div`要素に置き換え、そのdiv要素には`className`プロパティとして`flex-container`を設定してください。 +`return` 文の中で、空の文字列を `className` が `flex-container` の `div` 要素に置き換えてください。 # --hints-- @@ -26,7 +26,7 @@ return文の中で、空の文字列を`div`要素に置き換え、そのdiv要 assert.lengthOf(testElem.children, 1); ``` -`div`には`className`プロパティとして`flex-container`を設定してください。 +あなたの `div` は `className` が `flex-container` である必要があります。 ```js const testElem = await __helpers.prepTestComponent(window.index.App); diff --git a/curriculum/challenges/japanese/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165c.md b/curriculum/challenges/japanese/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165c.md index f49ea643896..5af3ff21298 100644 --- a/curriculum/challenges/japanese/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165c.md +++ b/curriculum/challenges/japanese/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165c.md @@ -7,7 +7,7 @@ dashedName: step-6 # --description-- -今度は、`Card` コンポーネントを `App` コンポーネントに入れてください。`name` プロップを `"Mark"` に、`title` プロップを `"Front-End developer"` に、そして `bio` を `"I like to work with different front-end technologies and play video games."` に設定してください。 +次に、`Card`コンポーネントを`App`コンポーネントに入れてください。`name`プロップには`"Mark"`、`title`プロップには`"Front-End developer"`、`bio`プロップには`"I like to work with different front-end technologies and play video games."`を設定してください。 # --hints-- diff --git a/curriculum/challenges/japanese/blocks/workshop-reusable-profile-card-component/68720c179cd34be6793bfdf6.md b/curriculum/challenges/japanese/blocks/workshop-reusable-profile-card-component/68720c179cd34be6793bfdf6.md index 53a906f3e0d..bfbe9b7b6af 100644 --- a/curriculum/challenges/japanese/blocks/workshop-reusable-profile-card-component/68720c179cd34be6793bfdf6.md +++ b/curriculum/challenges/japanese/blocks/workshop-reusable-profile-card-component/68720c179cd34be6793bfdf6.md @@ -9,7 +9,7 @@ dashedName: step-8 アプリケーションは期待通りに動作していますが、通常はこのように複数の`Card`コンポーネントを手動で追加することはありません。 -``要素内の3つの`
`コンポーネントを削除してください。次のいくつかのステップで、データの配列を作成し、`map()`関数を使って`Card`コンポーネントをレンダリングする方法を学びます。これはReactで一般的な方法です。 +`
` 要素内の3つの `` コンポーネントを削除してください。次のいくつかのステップで、データの配列を作成し、`map()` メソッドを使って `Card` コンポーネントをレンダリングします。これは React でより一般的な方法です。 # --hints-- diff --git a/curriculum/challenges/japanese/blocks/workshop-reusable-profile-card-component/68778af56eb5d980a4e2daed.md b/curriculum/challenges/japanese/blocks/workshop-reusable-profile-card-component/68778af56eb5d980a4e2daed.md index eff57f94115..5dc1f9a99ec 100644 --- a/curriculum/challenges/japanese/blocks/workshop-reusable-profile-card-component/68778af56eb5d980a4e2daed.md +++ b/curriculum/challenges/japanese/blocks/workshop-reusable-profile-card-component/68778af56eb5d980a4e2daed.md @@ -30,7 +30,7 @@ const profilesVal = eval(profiles?.value.toString()); assert.isArray(profilesVal); ``` -profiles配列には、必要なすべてのプロパティを含むオブジェクトが入っている必要があります:`id`、`name`、`title`、および`bio`。 +`profiles` 配列には、必須のプロパティである `id`、`name`、`title`、`bio` をすべて含むオブジェクトを入れてください。 ```js const explorer = await __helpers.Explorer(code); diff --git a/curriculum/challenges/japanese/blocks/workshop-reusable-profile-card-component/68779156bd3704b727ba5f38.md b/curriculum/challenges/japanese/blocks/workshop-reusable-profile-card-component/68779156bd3704b727ba5f38.md index d8aa465f1a8..4416ba3cffc 100644 --- a/curriculum/challenges/japanese/blocks/workshop-reusable-profile-card-component/68779156bd3704b727ba5f38.md +++ b/curriculum/challenges/japanese/blocks/workshop-reusable-profile-card-component/68779156bd3704b727ba5f38.md @@ -7,7 +7,7 @@ dashedName: step-10 # --description-- -これまでのレッスンで学んだように、`map` メソッドを使って異なるオブジェクトを繰り返し処理し、このようにコンポーネントを動的にレンダリングできます。 +前のレッスンで学んだように、`map()` メソッドを使って異なるオブジェクトを繰り返し処理し、このようにコンポーネントを動的にレンダリングできます。 ```jsx export function App() { diff --git a/curriculum/challenges/japanese/blocks/workshop-reusable-profile-card-component/687799aefd1f2af1704065d0.md b/curriculum/challenges/japanese/blocks/workshop-reusable-profile-card-component/687799aefd1f2af1704065d0.md index 9f4ab1060a1..055d4d4c7b7 100644 --- a/curriculum/challenges/japanese/blocks/workshop-reusable-profile-card-component/687799aefd1f2af1704065d0.md +++ b/curriculum/challenges/japanese/blocks/workshop-reusable-profile-card-component/687799aefd1f2af1704065d0.md @@ -23,7 +23,7 @@ dashedName: step-11
``` -`key` プロップは、Reactがどのアイテムが変更されたか、追加されたか、または削除されたかを識別するのに役立ちます。これによりパフォーマンスが向上し、より効率的な更新が可能になります。 +`key` プロップは、React がどのアイテムが変更され、追加され、または削除されたかを識別するのに役立ちます。これによりパフォーマンスが向上し、より効率的な更新が可能になります。 `Card` コンポーネントを更新して、`key` の値を持つ `profile.id` プロップを含めてください。 diff --git a/curriculum/challenges/japanese/blocks/workshop-toggle-text-app/67cd46ec4ec904186ad52ba5.md b/curriculum/challenges/japanese/blocks/workshop-toggle-text-app/67cd46ec4ec904186ad52ba5.md index fa94c18c411..61bf15e23d9 100644 --- a/curriculum/challenges/japanese/blocks/workshop-toggle-text-app/67cd46ec4ec904186ad52ba5.md +++ b/curriculum/challenges/japanese/blocks/workshop-toggle-text-app/67cd46ec4ec904186ad52ba5.md @@ -7,7 +7,7 @@ dashedName: step-3 # --description-- -`button` 要素の下に、`id` の `message` を持ち、テキストが `I love freeCodeCamp!` の段落要素を追加してください。 +`button` 要素の下に、`id` が `message` の段落要素を追加し、テキストは `I love freeCodeCamp!` にしてください。 # --hints-- @@ -17,7 +17,7 @@ dashedName: step-3 assert.exists(document.querySelector("p")); ``` -段落要素は `id` の `message` を持つべきです。 +段落要素には `id` が `message` である必要があります。 ```js assert.exists(document.getElementById("message")) diff --git a/curriculum/challenges/japanese/blocks/workshop-toggle-text-app/67cd49e05693111a41771f29.md b/curriculum/challenges/japanese/blocks/workshop-toggle-text-app/67cd49e05693111a41771f29.md index 38e97d16f60..a010e88b98b 100644 --- a/curriculum/challenges/japanese/blocks/workshop-toggle-text-app/67cd49e05693111a41771f29.md +++ b/curriculum/challenges/japanese/blocks/workshop-toggle-text-app/67cd49e05693111a41771f29.md @@ -19,7 +19,7 @@ const [user, setUser] = useState("Jessica"); 新しい状態変数とセット関数を `isVisible` と `setIsVisible` という名前で作成してください。例に示したように配列の分割代入構文を使うことを忘れないでください。 -そして、`useState` フックに初期値 `false` を代入してください。 +次に、初期値を `false` にして `useState` フックを呼び出してください。 # --hints-- diff --git a/curriculum/challenges/japanese/blocks/workshop-toggle-text-app/67cd4fe67813f71c3479e64a.md b/curriculum/challenges/japanese/blocks/workshop-toggle-text-app/67cd4fe67813f71c3479e64a.md index ce03ad11067..202538dfbd7 100644 --- a/curriculum/challenges/japanese/blocks/workshop-toggle-text-app/67cd4fe67813f71c3479e64a.md +++ b/curriculum/challenges/japanese/blocks/workshop-toggle-text-app/67cd4fe67813f71c3479e64a.md @@ -9,7 +9,7 @@ dashedName: step-6 段落テキストを表示する方法の一つは、`useState` フックの初期値を変更することです。 -現在の `useState` の値を `false` から `true` に変更すると、段落テキストが画面に表示されるはずです。 +`useState` の初期値を `false` から `true` に変更してください。正しくできると、段落のテキストが画面に表示されるようになります。 # --hints-- diff --git a/curriculum/challenges/japanese/blocks/workshop-toggle-text-app/67cd525b0e575b1e5abf4c03.md b/curriculum/challenges/japanese/blocks/workshop-toggle-text-app/67cd525b0e575b1e5abf4c03.md index b3420dd843e..c9c7a6fed4f 100644 --- a/curriculum/challenges/japanese/blocks/workshop-toggle-text-app/67cd525b0e575b1e5abf4c03.md +++ b/curriculum/challenges/japanese/blocks/workshop-toggle-text-app/67cd525b0e575b1e5abf4c03.md @@ -7,7 +7,7 @@ dashedName: step-9 # --description-- -前述のように、set 関数は状態を更新する役割があります。ブール値の状態を切り替える際によく使われる方法は、次のように状態を更新することです。 +前述のように、set関数は状態を更新する役割があります。ブール値の状態を切り替える際によく使われる方法は、このように状態を更新することです: ```js const [isUserLoggedIn, setIsUserLoggedIn] = useState(false); @@ -16,7 +16,7 @@ const [isUserLoggedIn, setIsUserLoggedIn] = useState(false); setIsUserLoggedIn(!isUserLoggedIn); ``` -次の例では、`setIsUserLoggedIn` と呼ばれる set 関数を使ってユーザーのログイン状態を更新しています。論理否定演算子(`!`)を使って `true` と `false` を切り替えるのが一般的です。初期値が `false` なので、`!` 演算子を適用すると `true` に変わります。 +上の例では、`setIsUserLoggedIn`というset関数を使ってユーザーのログイン状態を更新しています。`true`と`false`を切り替えるために論理NOT演算子(`!`)を使うのが一般的です。初期値が`false`なので、`!`演算子を適用すると`true`に変わります。 `handleToggleVisibility` 関数の中で、論理否定演算子(`setIsVisible`)を使って可視性の状態を更新するために `!` を使ってください。 diff --git a/curriculum/challenges/japanese/blocks/workshop-toggle-text-app/67cd57e96257ed1fabbe4879.md b/curriculum/challenges/japanese/blocks/workshop-toggle-text-app/67cd57e96257ed1fabbe4879.md index 83fd57cf23a..6ffbded39f1 100644 --- a/curriculum/challenges/japanese/blocks/workshop-toggle-text-app/67cd57e96257ed1fabbe4879.md +++ b/curriculum/challenges/japanese/blocks/workshop-toggle-text-app/67cd57e96257ed1fabbe4879.md @@ -27,7 +27,7 @@ function handleClick() { # --hints-- -`toggle-button` がクリックされると、メッセージ `"I love freeCodeCamp!"` が画面に表示されるはずです。 +`toggle-button` をクリックすると、メッセージの `I love freeCodeCamp!` が画面に表示されるはずです。 ```js const abuseState = __helpers.spyOn(React, "useState"); diff --git a/curriculum/challenges/japanese/blocks/workshop-toggle-text-app/67cd59f6581d3a20c9cc6460.md b/curriculum/challenges/japanese/blocks/workshop-toggle-text-app/67cd59f6581d3a20c9cc6460.md index 72a005003ea..543af411178 100644 --- a/curriculum/challenges/japanese/blocks/workshop-toggle-text-app/67cd59f6581d3a20c9cc6460.md +++ b/curriculum/challenges/japanese/blocks/workshop-toggle-text-app/67cd59f6581d3a20c9cc6460.md @@ -9,7 +9,7 @@ dashedName: step-11 今は更新された`isVisible`の値を確認する良いタイミングです。 -`setIsVisible(!isVisible);`の下に、`isVisible`状態変数をコンソールにログ出力してください。 +`setIsVisible(!isVisible);` の下に、`isVisible` ステート変数をコンソールにログしてください。 コンソールを開くと、値が期待したものとは異なっていることに気づくでしょう。 diff --git a/curriculum/challenges/japanese/blocks/workshop-toggle-text-app/67cd5bace629fa219a70aa6d.md b/curriculum/challenges/japanese/blocks/workshop-toggle-text-app/67cd5bace629fa219a70aa6d.md index e7c04dd1f53..e469874b176 100644 --- a/curriculum/challenges/japanese/blocks/workshop-toggle-text-app/67cd5bace629fa219a70aa6d.md +++ b/curriculum/challenges/japanese/blocks/workshop-toggle-text-app/67cd5bace629fa219a70aa6d.md @@ -9,7 +9,7 @@ dashedName: step-12 コンソールを見たときに、`false` の値が表示されて `true` ではなかったので驚いたかもしれません。これは、Reactが状態をすぐに更新しないために起こっています。状態は次のレンダリングサイクルでのみ更新されます。 -Reactに慣れていない開発者が、set関数の直後にコンソールの文を置いてしまうのはよくある間違いです。Reactのアプリケーションを作るときは、この点に注意してください。 +Reactに慣れていない開発者が、set関数の直後にコンソールの文を置いてしまうのはよくある間違いです。ですから、Reactアプリケーションを作成するときはこれに注意してください。 `console.log()` はもう必要ないので、`handleToggleVisibility` 関数から削除してください。 diff --git a/curriculum/challenges/japanese/blocks/workshop-toggle-text-app/67cd61c24bfc0a240132fd2f.md b/curriculum/challenges/japanese/blocks/workshop-toggle-text-app/67cd61c24bfc0a240132fd2f.md index 72e9ad90e11..b4f40812027 100644 --- a/curriculum/challenges/japanese/blocks/workshop-toggle-text-app/67cd61c24bfc0a240132fd2f.md +++ b/curriculum/challenges/japanese/blocks/workshop-toggle-text-app/67cd61c24bfc0a240132fd2f.md @@ -23,14 +23,14 @@ dashedName: step-13 # --hints-- -`isVisible` が `false` の場合、ボタンのテキストは `Show Message` と表示されるべきです。 +`isVisible` が `false` のとき、ボタンのテキストは `Show Message` と表示される必要があります。 ```js const btn = document.getElementById("toggle-button"); assert.equal(btn.textContent, "Show Message"); ``` -`isVisible` が `true` の場合、ボタンのテキストは `Hide Message` と表示されるべきです。 +`isVisible` が `true` のとき、ボタンのテキストは `Hide Message` と表示される必要があります。 ```js const abuseState = __helpers.spyOn(React, "useState"); @@ -246,7 +246,7 @@ export const ToggleApp = () => { const handleToggleVisibility = () => { setIsVisible(!isVisible); - } + }; return (
diff --git a/curriculum/challenges/japanese/blocks/workshop-wildlife-tracker/6999ac171928136168654774.md b/curriculum/challenges/japanese/blocks/workshop-wildlife-tracker/6999ac171928136168654774.md index 226f726abbf..ef532251db0 100644 --- a/curriculum/challenges/japanese/blocks/workshop-wildlife-tracker/6999ac171928136168654774.md +++ b/curriculum/challenges/japanese/blocks/workshop-wildlife-tracker/6999ac171928136168654774.md @@ -25,7 +25,7 @@ console.log(getAnimalSpecies(dog)); // Dog 次に、`getSpecies`という名前の関数を作成してください。 -関数は`animal`という名前のパラメータを1つ受け取る必要があります。 +関数は`animal`という名前のパラメータを1つ受け取ります。 ドット記法を使って`species`の`animal`プロパティを返してください。 @@ -42,8 +42,10 @@ assert.isFunction(getSpecies); `getSpecies`関数は`animal`という単一のパラメータを持つべきです。 ```js -const regex = __helpers.functionRegex('getSpecies', ['animal']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { getSpecies } = explorer.allFunctions; +assert.equal(getSpecies?.parameters.length, 1); +assert.equal(getSpecies?.parameters[0].toString(), 'animal'); ``` `getSpecies(tiger)`をコンソールにログ出力してください。 diff --git a/curriculum/challenges/japanese/blocks/workshop-wildlife-tracker/6999ad1cdc249e185aaeedbd.md b/curriculum/challenges/japanese/blocks/workshop-wildlife-tracker/6999ad1cdc249e185aaeedbd.md index cf0259ceb89..9ee3cd20ba8 100644 --- a/curriculum/challenges/japanese/blocks/workshop-wildlife-tracker/6999ad1cdc249e185aaeedbd.md +++ b/curriculum/challenges/japanese/blocks/workshop-wildlife-tracker/6999ad1cdc249e185aaeedbd.md @@ -49,8 +49,11 @@ assert.isFunction(addHabitat); `addHabitat` 関数は2つのパラメータ、`animal` と `habitat` を持つべきです。 ```js -const regex = __helpers.functionRegex('addHabitat', ['animal', 'habitat']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { addHabitat } = explorer.allFunctions; +assert.equal(addHabitat?.parameters.length, 2); +assert.equal(addHabitat?.parameters[0].toString(), 'animal'); +assert.equal(addHabitat?.parameters[1].toString(), 'habitat'); ``` `addHabitat` 関数は更新された `animal` オブジェクトを返すべきです。 diff --git a/curriculum/challenges/japanese/blocks/workshop-wildlife-tracker/6999adc72c02812a28c01e31.md b/curriculum/challenges/japanese/blocks/workshop-wildlife-tracker/6999adc72c02812a28c01e31.md index 09be950db32..ae1cd34650b 100644 --- a/curriculum/challenges/japanese/blocks/workshop-wildlife-tracker/6999adc72c02812a28c01e31.md +++ b/curriculum/challenges/japanese/blocks/workshop-wildlife-tracker/6999adc72c02812a28c01e31.md @@ -43,8 +43,11 @@ assert.isFunction(updateAge); `updateAge` 関数は2つのパラメータ、`animal` と `newAge` を持つ必要があります。 ```js -const regex = __helpers.functionRegex('updateAge', ['animal', 'newAge']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { updateAge } = explorer.allFunctions; +assert.equal(updateAge?.parameters.length, 2); +assert.equal(updateAge?.parameters[0].toString(), 'animal'); +assert.equal(updateAge?.parameters[1].toString(), 'newAge'); ``` `updateAge` 関数は更新された `animal` オブジェクトを返す必要があります。 diff --git a/curriculum/challenges/japanese/blocks/workshop-wildlife-tracker/6999b0198d18d402c36cc5fe.md b/curriculum/challenges/japanese/blocks/workshop-wildlife-tracker/6999b0198d18d402c36cc5fe.md index 153f7dff1b7..1de063190c3 100644 --- a/curriculum/challenges/japanese/blocks/workshop-wildlife-tracker/6999b0198d18d402c36cc5fe.md +++ b/curriculum/challenges/japanese/blocks/workshop-wildlife-tracker/6999b0198d18d402c36cc5fe.md @@ -45,8 +45,10 @@ assert.isFunction(removeEndangeredStatus); `removeEndangeredStatus` 関数は `animal` という単一のパラメータを持つべきです。 ```js -const regex = __helpers.functionRegex('removeEndangeredStatus', ['animal']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { removeEndangeredStatus } = explorer.allFunctions; +assert.equal(removeEndangeredStatus?.parameters.length, 1); +assert.equal(removeEndangeredStatus?.parameters[0].toString(), 'animal'); ``` `removeEndangeredStatus` 関数は更新された `animal` オブジェクトを返すべきです。 diff --git a/curriculum/challenges/japanese/blocks/workshop-wildlife-tracker/6999b07c34c2cde21ee6e1d8.md b/curriculum/challenges/japanese/blocks/workshop-wildlife-tracker/6999b07c34c2cde21ee6e1d8.md index 00b5aef1dc8..6986bedaa10 100644 --- a/curriculum/challenges/japanese/blocks/workshop-wildlife-tracker/6999b07c34c2cde21ee6e1d8.md +++ b/curriculum/challenges/japanese/blocks/workshop-wildlife-tracker/6999b07c34c2cde21ee6e1d8.md @@ -1,6 +1,6 @@ --- id: 6999b07c34c2cde21ee6e1d8 -title: ステップ 11 +title: ステップ11 challengeType: 1 dashedName: step-11 --- @@ -49,8 +49,10 @@ assert.isFunction(hasHabitat); `hasHabitat` 関数は `animal` という単一のパラメータを持つべきです。 ```js -const regex = __helpers.functionRegex('hasHabitat', ['animal']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { hasHabitat } = explorer.allFunctions; +assert.equal(hasHabitat?.parameters.length, 1); +assert.equal(hasHabitat?.parameters[0].toString(), 'animal'); ``` `hasHabitat` は `hasOwnProperty` メソッドを使って `habitat` プロパティをチェックするべきです。 diff --git a/curriculum/challenges/japanese/blocks/workshop-wildlife-tracker/6999b0d79ea938edcb032237.md b/curriculum/challenges/japanese/blocks/workshop-wildlife-tracker/6999b0d79ea938edcb032237.md index a4616f0307f..2e65d638030 100644 --- a/curriculum/challenges/japanese/blocks/workshop-wildlife-tracker/6999b0d79ea938edcb032237.md +++ b/curriculum/challenges/japanese/blocks/workshop-wildlife-tracker/6999b0d79ea938edcb032237.md @@ -45,8 +45,11 @@ assert.isFunction(getProperty); `getProperty`関数は2つのパラメータ、`animal`と`propertyName`を持つ必要があります。 ```js -const regex = __helpers.functionRegex('getProperty', ['animal', 'propertyName']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { getProperty } = explorer.allFunctions; +assert.equal(getProperty?.parameters.length, 2); +assert.equal(getProperty?.parameters[0].toString(), 'animal'); +assert.equal(getProperty?.parameters[1].toString(), 'propertyName'); ``` `getProperty`はブラケット記法を使ってプロパティにアクセスしてください。 diff --git a/curriculum/challenges/japanese/blocks/workshop-wildlife-tracker/699a00de9f564bb0effaa14d.md b/curriculum/challenges/japanese/blocks/workshop-wildlife-tracker/699a00de9f564bb0effaa14d.md index 05142a97a5c..a3999bc6926 100644 --- a/curriculum/challenges/japanese/blocks/workshop-wildlife-tracker/699a00de9f564bb0effaa14d.md +++ b/curriculum/challenges/japanese/blocks/workshop-wildlife-tracker/699a00de9f564bb0effaa14d.md @@ -44,8 +44,10 @@ assert.isFunction(getAge); `getAge`関数は、`animal`という単一のパラメータを持つべきです。 ```js -const regex = __helpers.functionRegex('getAge', ['animal']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { getAge } = explorer.allFunctions; +assert.equal(getAge?.parameters.length, 1); +assert.equal(getAge?.parameters[0].toString(), 'animal'); ``` `getAge`はドット記法を使って`age`プロパティにアクセスするべきです。 diff --git a/curriculum/challenges/korean/blocks/back-end-development-and-apis-projects/bd7158d8c443edefaeb5bd0f.md b/curriculum/challenges/korean/blocks/back-end-development-and-apis-projects/bd7158d8c443edefaeb5bd0f.md index f87ba33f5c5..8000a006d2b 100644 --- a/curriculum/challenges/korean/blocks/back-end-development-and-apis-projects/bd7158d8c443edefaeb5bd0f.md +++ b/curriculum/challenges/korean/blocks/back-end-development-and-apis-projects/bd7158d8c443edefaeb5bd0f.md @@ -19,7 +19,7 @@ dashedName: file-metadata-microservice # --hints-- -예시 URL이 아닌 직접 만든 프로젝트를 제출하세요. +자신만의 프로젝트를 제공해야 하며, 예시 URL을 사용하지 마세요. ```js assert( @@ -50,18 +50,22 @@ dashedName: file-metadata-microservice 파일을 제출하면 JSON 응답 내에서 파일 `name`, `type`, `size`가 바이트 단위로 반환됩니다. ```js - const formData = new FormData(); - const fileData = await fetch( - 'https://cdn.freecodecamp.org/weather-icons/01d.png' - ); - const file = await fileData.blob(); - formData.append('upfile', file, 'icon'); + const boundary = 'fccBoundary1234567890'; + const head = + `--${boundary}\r\n` + + 'Content-Disposition: form-data; name="upfile"; filename="icon"\r\n' + + 'Content-Type: image/png\r\n\r\n'; + const body = new Blob([head, new Uint8Array(70), `\r\n--${boundary}--\r\n`]); const data = await fetch(code + '/api/fileanalyse', { method: 'POST', - body: formData + headers: { + 'Content-Type': `multipart/form-data; boundary=${boundary}` + }, + body }); const parsed = await data.json(); assert.property(parsed, 'size'); assert.equal(parsed.name, 'icon'); assert.equal(parsed.type, 'image/png'); ``` + diff --git a/curriculum/challenges/korean/blocks/daily-coding-challenges-javascript/6a26df3e2988bcdded204895.md b/curriculum/challenges/korean/blocks/daily-coding-challenges-javascript/6a26df3e2988bcdded204895.md index 7f953ae14bd..712d36572d9 100644 --- a/curriculum/challenges/korean/blocks/daily-coding-challenges-javascript/6a26df3e2988bcdded204895.md +++ b/curriculum/challenges/korean/blocks/daily-coding-challenges-javascript/6a26df3e2988bcdded204895.md @@ -25,10 +25,10 @@ assert.equal(calculateHandicap([72, 72, 72], [72, 72, 72]), 0); assert.equal(calculateHandicap([80, 76, 78, 78], [72, 72, 72, 72]), 6); ``` -`calculateHandicap([42, 45, 46, 44], [36, 36, 36, 36])`는 `8.3`을 반환해야 합니다. +`calculateHandicap([42, 45, 46, 45], [36, 36, 36, 36])`는 `8.5`를 반환해야 합니다. ```js -assert.equal(calculateHandicap([42, 45, 46, 44], [36, 36, 36, 36]), 8.3); +assert.equal(calculateHandicap([42, 45, 46, 45], [36, 36, 36, 36]), 8.5); ``` `calculateHandicap([85, 80, 76, 79, 82], [72, 72, 72, 71, 71])`는 `8.8`을 반환해야 합니다. diff --git a/curriculum/challenges/korean/blocks/daily-coding-challenges-python/6a26df3e2988bcdded204895.md b/curriculum/challenges/korean/blocks/daily-coding-challenges-python/6a26df3e2988bcdded204895.md index f303c308215..b2a0b91a59a 100644 --- a/curriculum/challenges/korean/blocks/daily-coding-challenges-python/6a26df3e2988bcdded204895.md +++ b/curriculum/challenges/korean/blocks/daily-coding-challenges-python/6a26df3e2988bcdded204895.md @@ -31,12 +31,12 @@ TestCase().assertEqual(calculate_handicap([80, 76, 78, 78], [72, 72, 72, 72]), 6 }}) ``` -`calculate_handicap([42, 45, 46, 44], [36, 36, 36, 36])`는 `8.3`을 반환해야 합니다. +`calculate_handicap([42, 45, 46, 45], [36, 36, 36, 36])`는 `8.5`를 반환해야 합니다. ```js ({test: () => { runPython(` from unittest import TestCase -TestCase().assertEqual(calculate_handicap([42, 45, 46, 44], [36, 36, 36, 36]), 8.3)`) +TestCase().assertEqual(calculate_handicap([42, 45, 46, 45], [36, 36, 36, 36]), 8.5)`) }}) ``` diff --git a/curriculum/challenges/korean/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb928.md b/curriculum/challenges/korean/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb928.md index a3377408c8f..a4b4fbb1e54 100644 --- a/curriculum/challenges/korean/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb928.md +++ b/curriculum/challenges/korean/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb928.md @@ -8,13 +8,13 @@ dashedName: mean-variance-standard-deviation-calculator # --description-- -Ona 보일러플레이트 코드를 사용해 이 프로젝트를 진행할 것입니다. +이 프로젝트는 보일러플레이트 시작 코드를 사용해 작업하게 됩니다. -Python 커리큘럼의 대화형 수업 부분은 아직 개발 중입니다. 지금은 freeCodeCamp.org 유튜브 채널에 있는 다음 영상들이 이 프로젝트를 완료하는 데 필요한 모든 내용을 가르쳐 줄 것입니다: +Python 커리큘럼의 대화형 수업 부분은 아직 개발 중입니다. 지금은 freeCodeCamp.org 유튜브 채널의 다음 영상들이 이 프로젝트를 완료하는 데 필요한 모든 내용을 가르쳐 줄 것입니다: - Python for Everybody 비디오 강좌 (14시간) -- Python Pandas로 데이터 분석하는 방법 (10시간) +- Python Pandas로 데이터 분석하기 (10시간) # --instructions-- @@ -52,15 +52,16 @@ Numpy를 사용해 3 x 3 행렬의 행, 열, 요소별로 평균, 분산, 표준 ## 개발 -`mean_var_std.py`에 코드를 작성하세요. 개발 중에는 `main.py`를 사용해 코드를 테스트할 수 있습니다. 코드를 실행하려면 Ona 터미널에 `python3 main.py`를 입력하고 엔터를 누르세요. 그러면 포함된 CPython 인터프리터가 `main.py` 파일을 실행합니다. +`mean_var_std.py`에 코드를 작성하세요. 개발 중에는 `main.py`를 사용해 코드를 테스트할 수 있습니다. +코드를 실행하려면 터미널에 `python3 main.py`를 입력하고 엔터를 누르세요. 그러면 포함된 CPython 인터프리터가 `main.py` 파일을 실행합니다. ## 테스트 -이 프로젝트의 단위 테스트는 `test_module.py`에 있습니다. 편의를 위해 `test_module.py`에서 `main.py`으로 테스트를 가져왔습니다. +이 프로젝트의 단위 테스트는 `test_module.py`에 있습니다. 편의를 위해 `test_module.py`에서 `main.py`로 테스트를 가져왔습니다. ## 제출 -프로젝트 URL을 복사해 freeCodeCamp에 제출하세요. +프로젝트 URL을 복사하여 freeCodeCamp에 제출하세요. # --hints-- diff --git a/curriculum/challenges/korean/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb929.md b/curriculum/challenges/korean/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb929.md index e112c4e4995..64f609e6ad9 100644 --- a/curriculum/challenges/korean/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb929.md +++ b/curriculum/challenges/korean/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb929.md @@ -8,13 +8,13 @@ dashedName: demographic-data-analyzer # --description-- -Ona 보일러플레이트 코드를 사용하여 이 프로젝트를 진행할 것입니다. +이 프로젝트를 보일러플레이트 코드와 함께 진행하세요. -Python 커리큘럼의 대화형 수업 부분은 아직 개발 중입니다. 지금은 freeCodeCamp.org 유튜브 채널에 있는 다음 영상들이 이 프로젝트를 완료하는 데 필요한 모든 내용을 가르쳐 줄 것입니다: +Python 커리큘럼의 대화형 수업 부분은 아직 개발 중입니다. 지금은 freeCodeCamp.org 유튜브 채널의 다음 영상들이 이 프로젝트를 완료하는 데 필요한 모든 내용을 가르쳐 줄 것입니다: - Python for Everybody 비디오 강좌 (14시간) -- Python Pandas로 데이터 분석하는 방법 (10시간) +- Python Pandas로 데이터 분석하기 (10시간) # --instructions-- @@ -50,11 +50,11 @@ Python 커리큘럼의 대화형 수업 부분은 아직 개발 중입니다. ## 테스트 -이 프로젝트의 단위 테스트는 `test_module.py`에 있습니다. 편의를 위해 `test_module.py`에서 `main.py`까지 테스트를 가져왔습니다. +이 프로젝트의 단위 테스트는 `test_module.py`에 있습니다. 편의를 위해 `test_module.py`에서 `main.py`로 테스트를 가져왔습니다. ## 제출 -프로젝트 URL을 복사해 freeCodeCamp에 제출하세요. +프로젝트 URL을 복사하여 freeCodeCamp에 제출하세요. ## 데이터셋 출처 diff --git a/curriculum/challenges/korean/blocks/data-analysis-with-python-projects/5e46f7f8ac417301a38fb92a.md b/curriculum/challenges/korean/blocks/data-analysis-with-python-projects/5e46f7f8ac417301a38fb92a.md index 7dd9151c244..a7446057a36 100644 --- a/curriculum/challenges/korean/blocks/data-analysis-with-python-projects/5e46f7f8ac417301a38fb92a.md +++ b/curriculum/challenges/korean/blocks/data-analysis-with-python-projects/5e46f7f8ac417301a38fb92a.md @@ -8,9 +8,9 @@ dashedName: medical-data-visualizer # --description-- -Ona 시작 코드와 함께 이 프로젝트를 진행할 것입니다. +이 프로젝트를 보일러플레이트 코드와 함께 진행할 것입니다. -Python 커리큘럼의 대화형 강의 부분은 아직 개발 중입니다. 지금은 freeCodeCamp.org 유튜브 채널의 다음 영상들이 이 프로젝트를 완료하는 데 필요한 모든 내용을 가르쳐 줄 것입니다: +Python 커리큘럼의 대화형 수업 부분은 아직 개발 중입니다. 지금은 freeCodeCamp.org 유튜브 채널의 다음 영상들이 이 프로젝트를 완료하는 데 필요한 모든 내용을 가르쳐 줄 것입니다: - Python for Everybody 비디오 강좌 (14시간) @@ -76,11 +76,11 @@ Python 커리큘럼의 대화형 강의 부분은 아직 개발 중입니다. ## 테스트 -이 프로젝트의 단위 테스트는 `test_module.py`에 있습니다. 편의를 위해 `test_module.py`에서 `main.py`까지 테스트를 가져왔습니다. +이 프로젝트의 단위 테스트는 `test_module.py`에 있습니다. 편의를 위해 `test_module.py`에서 `main.py`로 테스트를 가져왔습니다. ## 제출 -프로젝트 URL을 복사해 freeCodeCamp에 제출하세요. +프로젝트 URL을 복사하여 freeCodeCamp에 제출하세요. # --hints-- diff --git a/curriculum/challenges/korean/blocks/data-analysis-with-python-projects/5e46f802ac417301a38fb92b.md b/curriculum/challenges/korean/blocks/data-analysis-with-python-projects/5e46f802ac417301a38fb92b.md index 27b5d8d893e..5060e105efd 100644 --- a/curriculum/challenges/korean/blocks/data-analysis-with-python-projects/5e46f802ac417301a38fb92b.md +++ b/curriculum/challenges/korean/blocks/data-analysis-with-python-projects/5e46f802ac417301a38fb92b.md @@ -8,9 +8,9 @@ dashedName: page-view-time-series-visualizer # --description-- -Ona 시작 보일러플레이트 코드를 사용해 이 프로젝트를 진행할 것입니다. +이 보일러플레이트 코드로 이 프로젝트를 진행할 것입니다. -Python 커리큘럼의 대화형 수업 부분은 아직 개발 중입니다. 지금은 freeCodeCamp.org 유튜브 채널에 있는 다음 영상들이 이 프로젝트를 완료하는 데 필요한 모든 내용을 가르쳐 줄 것입니다: +Python 커리큘럼의 대화형 수업 부분은 아직 개발 중입니다. 지금은 freeCodeCamp.org 유튜브 채널의 다음 영상들이 이 프로젝트를 완료하는 데 필요한 모든 내용을 가르쳐 줄 것입니다: - Python for Everybody 비디오 강좌 (14시간) @@ -20,7 +20,7 @@ Python 커리큘럼의 대화형 수업 부분은 아직 개발 중입니다. 이 프로젝트에서는 선 차트, 막대 그래프, 박스 플롯을 사용해 시계열 데이터를 시각화할 것입니다. Pandas, Matplotlib, Seaborn을 사용해 2016-05-09부터 2019-12-03까지 freeCodeCamp.org 포럼의 일별 페이지 조회수 데이터셋을 시각화합니다. 데이터 시각화는 방문 패턴을 이해하고 연간 및 월간 성장 추이를 파악하는 데 도움이 됩니다. -다음 작업을 데이터로 완료하세요: +다음 작업을 완료하기 위해 데이터를 사용하세요: - Pandas를 사용해 "fcc-forum-pageviews.csv"에서 데이터를 가져오세요. 인덱스는 `date` 열로 설정하세요. - 페이지 조회수가 데이터셋 상위 2.5% 또는 하위 2.5%인 날을 필터링해 데이터를 정리하세요. @@ -38,11 +38,11 @@ Python 커리큘럼의 대화형 수업 부분은 아직 개발 중입니다. ## 테스트 -이 프로젝트의 단위 테스트는 `test_module.py`에 있습니다. 편의를 위해 `test_module.py`에서 `main.py`까지 테스트를 가져왔습니다. +이 프로젝트의 단위 테스트는 `test_module.py`에 있습니다. 편의를 위해 `test_module.py`에서 `main.py`로 테스트를 가져왔습니다. ## 제출 -프로젝트 URL을 복사해 freeCodeCamp에 제출하세요. +프로젝트 URL을 복사하여 freeCodeCamp에 제출하세요. # --hints-- diff --git a/curriculum/challenges/korean/blocks/data-analysis-with-python-projects/5e4f5c4b570f7e3a4949899f.md b/curriculum/challenges/korean/blocks/data-analysis-with-python-projects/5e4f5c4b570f7e3a4949899f.md index 824cb02da69..e40da1faa57 100644 --- a/curriculum/challenges/korean/blocks/data-analysis-with-python-projects/5e4f5c4b570f7e3a4949899f.md +++ b/curriculum/challenges/korean/blocks/data-analysis-with-python-projects/5e4f5c4b570f7e3a4949899f.md @@ -8,7 +8,7 @@ dashedName: sea-level-predictor # --description-- -Ona 보일러플레이트 코드를 사용해 이 프로젝트를 진행할 것입니다. +이 프로젝트를 보일러플레이트 코드와 함께 진행하세요. Python 커리큘럼의 대화형 수업 부분은 아직 개발 중입니다. 지금은 freeCodeCamp.org 유튜브 채널의 다음 영상들이 이 프로젝트를 완료하는 데 필요한 모든 내용을 가르쳐 줄 것입니다: @@ -40,7 +40,7 @@ Python 커리큘럼의 대화형 수업 부분은 아직 개발 중입니다. ## 제출 -프로젝트 URL을 복사해 freeCodeCamp에 제출하세요. +프로젝트 URL을 복사하여 freeCodeCamp에 제출하세요. ## 데이터 출처 전 세계 평균 절대 해수면 변화, 1880-2014, 미국 환경보호청, CSIRO 2015년 데이터, NOAA 2015년 데이터 사용. diff --git a/curriculum/challenges/korean/blocks/information-security-projects/5e46f979ac417301a38fb932.md b/curriculum/challenges/korean/blocks/information-security-projects/5e46f979ac417301a38fb932.md index e94a64d8261..68e7b74e343 100644 --- a/curriculum/challenges/korean/blocks/information-security-projects/5e46f979ac417301a38fb932.md +++ b/curriculum/challenges/korean/blocks/information-security-projects/5e46f979ac417301a38fb932.md @@ -9,15 +9,15 @@ dashedName: port-scanner # --description-- -Ona 시작 코드를 사용해 이 프로젝트를 진행할 것입니다. +이 프로젝트를 보일러플레이트 코드와 함께 진행할 것입니다. -Python 커리큘럼의 대화형 수업 부분은 아직 개발 중입니다. 지금은 freeCodeCamp.org 유튜브 채널에 있는 다음 영상들이 이 프로젝트를 완료하는 데 필요한 모든 내용을 가르쳐 줄 것입니다: +Python 커리큘럼의 대화형 수업 부분은 아직 개발 중입니다. 지금은 freeCodeCamp.org 유튜브 채널의 다음 영상들이 이 프로젝트를 완료하는 데 필요한 모든 내용을 가르쳐 줄 것입니다: - Python for Everybody 비디오 강좌 (14시간) -- Python 기초 심층 학습 (4시간) +- Learn Python Basics in Depth (4시간) -- 중급 Python 강좌 (6시간) +- Intermediate Python Course (6시간) # --instructions-- @@ -78,7 +78,7 @@ PORT SERVICE ## 제출 -프로젝트 URL을 복사해 freeCodeCamp에 제출하세요. +프로젝트 URL을 복사하여 freeCodeCamp에 제출하세요. # --hints-- diff --git a/curriculum/challenges/korean/blocks/information-security-projects/5e46f983ac417301a38fb933.md b/curriculum/challenges/korean/blocks/information-security-projects/5e46f983ac417301a38fb933.md index 3292f22356a..a0ddaa88520 100644 --- a/curriculum/challenges/korean/blocks/information-security-projects/5e46f983ac417301a38fb933.md +++ b/curriculum/challenges/korean/blocks/information-security-projects/5e46f983ac417301a38fb933.md @@ -9,7 +9,7 @@ dashedName: sha-1-password-cracker # --description-- -Ona 시작 코드와 함께 이 프로젝트를 진행할 것입니다. +이 프로젝트를 보일러플레이트 코드와 함께 진행하세요. Python 커리큘럼의 대화형 수업 부분은 아직 개발 중입니다. 지금은 freeCodeCamp.org 유튜브 채널의 다음 영상들이 이 프로젝트를 완료하는 데 필요한 모든 내용을 가르쳐 줄 것입니다: @@ -55,7 +55,7 @@ SHA-1 해시된 비밀번호를 입력받아, 상위 10,000개 비밀번호 중 ## 제출 -프로젝트 URL을 복사해 freeCodeCamp에 제출하세요. +프로젝트 URL을 복사하여 freeCodeCamp에 제출하세요. # --hints-- diff --git a/curriculum/challenges/korean/blocks/lab-availability-table/66b36358ed4f261d64840c24.md b/curriculum/challenges/korean/blocks/lab-availability-table/66b36358ed4f261d64840c24.md index 5e73bc5c969..1acd16dcd9f 100644 --- a/curriculum/challenges/korean/blocks/lab-availability-table/66b36358ed4f261d64840c24.md +++ b/curriculum/challenges/korean/blocks/lab-availability-table/66b36358ed4f261d64840c24.md @@ -12,18 +12,18 @@ demoType: onClick **사용자 스토리:** -1. 최소 세 개의 열과 다섯 개의 행(헤더 포함)이 있는 표를 만들어야 해요. -1. 첫 번째 행의 셀은 요일이 들어 있는 표 헤더여야 해요. -1. 첫 번째 열의 셀은 `class`가 `time`이어야 하며, 셀의 텍스트로 시간 값을 포함해야 해요. -1. 모든 데이터 셀에는 `class`로 `available-#`가 있어야 하며, 여기서 `#`는 해당 시간에 가능한 인원 수를 나타내는 `0`부터 `5`까지의 숫자예요. -1. 표에는 `caption` 요소가 있어야 하고, 그 텍스트는 `Weekly Meeting Availability Schedule`이어야 해요. -1. 첫 번째 행(요일)의 모든 표 헤더 셀에는 값이 `col`인 `scope` 속성이 있어야 해요. -1. 첫 번째 열(시간 셀)의 모든 표 헤더 셀에는 값이 `row`인 `scope` 속성이 있어야 해요. -1. 가능한 인원 수를 나타내는 클래스를 가진 모든 데이터 셀에는 가용 수준을 설명하는 `aria-label` 속성이 있어야 해요(예: `available-0` 셀에는 `0 available`, `available-1` 셀에는 `1 available`, 그리고 `available-5` 셀에는 `5+ available` 등). -1. `:root` 선택자에서 `--color#`라는 이름의 CSS 변수를 여섯 개 정의해야 하며, 여기서 `#`는 `0`부터 `5`까지의 숫자예요. 각 변수에 색상 값을 할당하고, 해당 `.available-#` 요소의 배경색을 설정하는 데 이 변수를 사용하세요. -1. `:root` 선택자에서 `--solid-border`와 `--dashed-border`라는 CSS 변수를 정의해야 해요. 이 변수들을 사용해 데이터 셀의 아래쪽 테두리를 행마다 번갈아가며 실선과 점선으로 스타일링하세요. 각 행에는 `sharp` 또는 `half` 클래스를 부여해 스타일을 적용하세요. -1. `id`가 `legend`인 `div` 요소가 있어야 해요. 이 안에는 텍스트가 `Availability`인 `span` 요소와, `id`가 `legend-gradient`인 `div` 요소가 들어 있어야 해요. -1. `#legend-gradient` 요소에는 `--color0`부터 `--color5`까지 모든 색상이 딱딱하게 구분되어 전환되는 선형 그라디언트를 적용해야 해요. +1. 헤더를 포함하여 최소 세 개의 열과 다섯 개의 행이 있는 표를 만드세요. +1. 첫 번째 행에는 요일이 포함된 테이블 헤더 셀들이 있어야 합니다. +1. 첫 번째 열에는 `class`가 `time`인 테이블 헤더 셀들이 있어야 하며, 텍스트로 시간 값이 들어가야 합니다. +1. 모든 데이터 셀은 `class`가 `available-#`이어야 하며, 여기서 `#`은 해당 시간에 가능한 사람 수를 나타내는 `0`부터 `5`까지의 숫자입니다. +1. 표에는 `caption` 요소가 있어야 하며, 텍스트는 `Weekly Meeting Availability Schedule`이어야 합니다. +1. 첫 번째 행(요일)의 모든 테이블 헤더 셀에는 `scope` 속성이 `col` 값으로 할당되어야 합니다. +1. 첫 번째 열(시간)의 모든 테이블 헤더 셀에는 `scope` 속성이 `row` 값으로 할당되어야 합니다. +1. 가용성 클래스를 가진 모든 데이터 셀에는 가용성 수준을 설명하는 `aria-label` 속성이 있어야 합니다(예: `available-0` 셀에는 `0 available`, `available-1` 셀에는 `1 available`, `available-5` 셀에는 `5+ available` 등). +1. `:root` 선택자에서 `--color#`라는 이름의 CSS 변수를 6개 정의하세요. 여기서 `#`은 `0`부터 `5`까지 숫자이며, 각 변수에 색상 값을 할당하고 이 변수들을 사용해 해당하는 `.available-#` 요소들의 배경색을 설정하세요. +1. `:root` 선택자에서 `--solid-border`와 `--dashed-border`라는 CSS 변수를 정의하세요. 이 변수들을 사용해 데이터 셀의 하단 테두리를 스타일링하며, 행에 따라 실선과 점선을 번갈아 적용하세요. 행에는 `sharp` 또는 `half` 클래스가 할당되어야 합니다. +1. `id`가 `legend`인 `div` 요소를 만드세요. 이 안에는 텍스트가 `Availability`인 `span` 요소와 `id`가 `legend-gradient`인 `div` 요소가 포함되어야 합니다. +1. `#legend-gradient` 요소에는 `--color0`부터 `--color5`까지 모든 색상을 경계가 뚜렷한 선형 그라데이션으로 전환하는 배경 이미지를 설정하세요. **참고:** CSS를 적용하려면 HTML에 스타일시트를 꼭 연결하세요. @@ -389,7 +389,7 @@ headers.forEach(header => { 첫 번째 열의 모든 표 헤더 셀은 `scope` 속성이 `row`이어야 합니다. ```js -const timeHeaders = [...document.querySelectorAll('tr > th:first-child')]; +const timeHeaders = [...document.querySelectorAll('th.time')]; assert.isNotEmpty(timeHeaders); timeHeaders.forEach(header => { assert.equal(header.getAttribute('scope'), 'row'); diff --git a/curriculum/challenges/korean/blocks/lab-cargo-manifest-validator/69a56b5069ca99f7317e6e19.md b/curriculum/challenges/korean/blocks/lab-cargo-manifest-validator/69a56b5069ca99f7317e6e19.md index fcf45af2786..662c52cbfc8 100644 --- a/curriculum/challenges/korean/blocks/lab-cargo-manifest-validator/69a56b5069ca99f7317e6e19.md +++ b/curriculum/challenges/korean/blocks/lab-cargo-manifest-validator/69a56b5069ca99f7317e6e19.md @@ -14,8 +14,8 @@ dashedName: lab-cargo-manifest-validator - `containerId`: 관련 화물 컨테이너를 식별하는 양의 정수입니다. - `destination`: 화물의 목적지를 나타내는 공백을 제거한 후 비어 있지 않은 문자열입니다. - `weight`: 화물의 무게를 나타내는 양수입니다. -- `unit`: 화물 무게 속성의 단위를 설명하는 문자열로, `"kg"` (킬로그램) 또는 `"lb"` (파운드) 중 하나입니다. -- `hazmat`: 위험 물질 취급이 필요한지 여부를 나타내는 불리언 값입니다. +- `unit`: 화물의 `weight` 속성 단위를 설명하는 문자열로, 킬로그램은 `"kg"`, 파운드는 `"lb"`입니다. +- `hazmat`: 위험물 취급이 필요한지 여부를 나타내는 불리언 값입니다. 화물 명세서 객체 예시: @@ -33,14 +33,14 @@ dashedName: lab-cargo-manifest-validator **사용자 스토리:** -1. `normalizeUnits` 매개변수를 가진 `manifest`라는 이름의 함수를 구현하세요. - - 이 함수는 원본 명세서 객체를 변경하지 않고, `weight`가 킬로그램으로 표준화되고 `unit`이 `"kg"`로 설정된 새 객체를 항상 반환해야 합니다. - - 명세서 객체의 무게가 파운드(`unit: "lb"`)로 표현된 경우, 대략적인 변환 1 lb = 0.45 kg을 사용해 `weight`을 킬로그램으로 변환하고 `unit`를 적절히 업데이트해야 합니다. - - 무게가 이미 킬로그램(`unit: "kg"`)으로 표현된 경우, `weight`과 `unit`는 변경하지 않아야 합니다. -2. `validateManifest` 매개변수를 가진 `manifest`라는 이름의 함수를 구현하세요. - - 이 함수는 원본 명세서 객체를 변경하지 않고 항상 새 객체를 반환해야 합니다. - - 입력 명세서가 유효하면(누락되거나 잘못된 속성이 없으면) 빈 객체를 반환해야 합니다. - - 입력 명세서가 유효하지 않으면, 누락된 속성은 `"Missing"` 값을, 잘못된 속성은 `"Invalid"` 값을 가진 항목을 포함하는 객체를 반환해야 합니다. +1. `manifest` 매개변수를 가진 `normalizeUnits`라는 함수를 구현하세요. + - 이 함수는 원본 manifest 객체를 변경하지 않아야 하며, 항상 `weight`가 킬로그램으로 표준화되고 `unit`이 `"kg"`로 설정된 새 객체를 반환해야 합니다. + - manifest 객체의 `weight`가 파운드(`unit: "lb"`)로 표현된 경우, 대략적인 변환 `1 lb = 0.45 kg`을 사용해 `weight`를 킬로그램으로 변환하고 `unit`도 이에 맞게 업데이트해야 합니다. + - `weight`가 이미 킬로그램(`unit: "kg"`)으로 표현된 경우, `weight`와 `unit`은 변경하지 않아야 합니다. +2. `manifest` 매개변수를 가진 `validateManifest`라는 함수를 구현하세요. + - 이 함수는 원본 manifest 객체를 변경하지 않아야 하며, 항상 새 객체를 반환해야 합니다. + - 입력 manifest가 유효하면(누락되거나 잘못된 속성이 없으면) 빈 객체를 반환해야 합니다. + - 입력 manifest가 유효하지 않으면, 누락되거나 잘못된 각 속성에 대해 항목을 포함하는 객체를 반환해야 합니다. 누락된 속성은 값이 `"Missing"`이고, 잘못된 속성은 값이 `"Invalid"`여야 합니다. 입력 객체가 `destination` 속성이 누락되고 `weight` 속성이 잘못된 경우 반환 예시: @@ -51,10 +51,11 @@ dashedName: lab-cargo-manifest-validator } ``` -3. `processManifest` 매개변수를 가진 `manifest`라는 이름의 함수를 구현하세요. 이 함수는 다음을 출력해야 합니다: - - 명세서 객체가 유효하면 `Validation success: ${containerId}`를 출력한 후, 킬로그램 단위로 변환된 명세서 무게를 `Total weight: ${weight} kg` 형식으로 출력하세요. 이 변환에는 `normalizeUnits()`를 사용하세요. - - 명세서 객체가 유효하지 않으면 `Validation error: ${containerId}`를 출력한 후, `validateManifest()` 함수를 호출해 반환된 객체를 출력하세요. - **참고:** 두 경우 모두 `console.log()` 호출이 두 번 있어야 합니다. +3. `manifest` 매개변수를 가진 `processManifest`라는 함수를 구현하세요. 이 함수는 다음을 로그로 출력해야 합니다: + - manifest 객체가 유효하면, `Validation success: ${containerId}`를 출력한 후 `normalizeUnits()`를 사용해 킬로그램으로 변환한 manifest의 `weight`를 `Total weight: ${weight} kg` 형식으로 출력합니다. + - manifest 객체가 유효하지 않으면, `Validation error: ${containerId}`를 출력한 후 `validateManifest()`를 호출해 반환된 객체를 출력합니다. + +**참고:** 이 두 경우 모두 `console.log()` 호출이 두 번 있어야 합니다. **참고:** 테스트에서 재할당해야 하므로 `normalizeUnits`, `validateManifest`, `processManifest`를 `const`로 선언하지 마세요. @@ -140,12 +141,12 @@ assert.equal(params.length, 1); assert.equal(params[0].toString(), 'manifest'); ``` -`normalizeUnits()`를 인수로 `{ containerId: 68, destination: "Salinas", weight: 101, unit: "lb", hazmat: true }`를 호출하면 원본 입력을 변경하지 않고 새 객체 `{ containerId: 68, destination: "Salinas", weight: 45.45, unit: "kg", hazmat: true }`를 반환해야 합니다. +`normalizeUnits` 함수는 원본을 변경하지 않고 `{ containerId: 68, destination: "Salinas", weight: 45.45, unit: "kg", hazmat: true }`를 반환해야 하며, 호출 시 인수로 `{ containerId: 68, destination: "Salinas", weight: 101, unit: "lb", hazmat: true }`를 받습니다. ```js const testObj = { containerId: 68, - destination: "Salinas", + destination: "Salinas", weight: 101, unit: "lb", hazmat: true @@ -161,7 +162,7 @@ const expected = { const copy = normalizeUnits(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "normalizeUnits() did not return the expected normalized object"); +assert.deepEqual(copy, expected, "normalizeUnits() did not return the expected normalized object."); assert.notStrictEqual(copy, testObj, "normalizeUnits() should return a new object."); assert.strictEqual(testObj.containerId, 68, "Original object should not be mutated."); assert.strictEqual(testObj.destination, "Salinas", "Original object should not be mutated."); @@ -171,13 +172,13 @@ assert.strictEqual(testObj.hazmat, true, "Original object should not be mutated. assert.equal(Object.keys(testObj).length, 5, "Original object should not be mutated."); ``` -`normalizeUnits` 함수는 입력 명세서 객체의 복사본을 반환해야 하며, `weight`를 킬로그램으로 표준화하고 `unit`를 `"kg"`로 설정해야 합니다. 무게 변환에는 대략적인 변환 `1 lb = 0.45 kg`를 사용하세요. +`normalizeUnits` 함수는 입력 manifest 객체의 복사본을 반환해야 하며, `weight`는 킬로그램으로 표준화되고 `unit`은 `"kg"`로 설정되어야 합니다. `weight` 변환에는 대략적인 변환 `1 lb = 0.45 kg`을 사용하세요. ```js _validManifests.forEach((obj, i) => { const result = normalizeUnits(obj); - assert.isObject(result, "normalizeUnits should return an object"); - assert.notStrictEqual(result, obj, "normalizeUnits must return a new object, not modify the original"); + assert.isObject(result, "normalizeUnits() should return an object."); + assert.notStrictEqual(result, obj, "normalizeUnits() should return a new object, not mutate the original."); const expectedWeight = obj.unit === "lb" ? obj.weight * 0.45 : obj.weight; const expected = { ...obj, @@ -188,12 +189,12 @@ _validManifests.forEach((obj, i) => { assert.deepEqual( result, expected, - `normalizeUnits did not return the expected normalized object for manifest at index ${i}` + `normalizeUnits() did not return the expected normalized object for manifest at index ${i}.` ); }); ``` -`normalizeUnits` 함수는 원본을 변경하지 않고 입력 `manifest` 객체의 새 복사본을 반환해야 합니다. +`normalizeUnits` 함수는 원본을 변경하지 않고 입력 manifest 객체의 새 복사본을 반환해야 합니다. ```js const original = { @@ -231,12 +232,12 @@ assert.equal(params.length, 1); assert.equal(params[0].toString(), 'manifest'); ``` -`validateManifest()`를 인수로 `{ containerId: 1, destination: "Santa Cruz", weight: 304, unit: "kg", hazmat: false }`를 호출하면 새 객체 `{}`를 반환해야 합니다. +`validateManifest` 함수는 `{ containerId: 1, destination: "Santa Cruz", weight: 304, unit: "kg", hazmat: false }`를 인수로 호출할 때 새 빈 객체 `{}`를 반환해야 합니다. ```js const testObj = { containerId: 1, - destination: "Santa Cruz", + destination: "Santa Cruz", weight: 304, unit: "kg", hazmat: false @@ -246,16 +247,16 @@ const expected = {}; const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for a valid manifest"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.strictEqual(testObj.containerId, 1, "Original object should not be mutated"); -assert.strictEqual(testObj.destination, "Santa Cruz", "Original object should not be mutated"); -assert.strictEqual(testObj.weight, 304, "Original object should not be mutated"); -assert.strictEqual(testObj.unit, "kg", "Original object should not be mutated"); -assert.strictEqual(testObj.hazmat, false, "Original object should not be mutated"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for a valid manifest."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.strictEqual(testObj.containerId, 1, "Original object should not be mutated."); +assert.strictEqual(testObj.destination, "Santa Cruz", "Original object should not be mutated."); +assert.strictEqual(testObj.weight, 304, "Original object should not be mutated."); +assert.strictEqual(testObj.unit, "kg", "Original object should not be mutated."); +assert.strictEqual(testObj.hazmat, false, "Original object should not be mutated."); ``` -입력 명세서 객체가 유효하면 `validateManifest` 함수는 빈 객체 `{}`를 반환해야 합니다. +입력 manifest 객체가 유효하면 `validateManifest` 함수는 빈 객체 `{}`를 반환해야 합니다. ```js const solution = {}; @@ -268,7 +269,7 @@ for (const obj of _validManifests) { } ``` -`validateManifest()`를 인수로 `{}`를 호출하면 원본 입력을 변경하지 않고 새 객체 `{ containerId: "Missing", destination: "Missing", weight: "Missing", unit: "Missing", hazmat: "Missing" }`를 반환해야 합니다. +`validateManifest` 함수는 `{}`를 인수로 호출할 때 원본을 변경하지 않고 새 객체 `{ containerId: "Missing", destination: "Missing", weight: "Missing", unit: "Missing", hazmat: "Missing" }`를 반환해야 합니다. ```js const testObj = {}; @@ -283,12 +284,12 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for missing properties"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.equal(Object.keys(testObj).length, 0, "validateManifest() should return a new object, not mutate the original"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for missing properties."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.equal(Object.keys(testObj).length, 0, "validateManifest() should return a new object, not mutate the original."); ``` -`validateManifest()`를 인수로 `{ containerId: null, destination: "Santa Cruz", weight: 304, unit: "kg", hazmat: false }`를 호출하면 원본 입력을 변경하지 않고 새 객체 `{ containerId: "Invalid" }`를 반환해야 합니다. +`validateManifest` 함수는 `{ containerId: null, destination: "Santa Cruz", weight: 304, unit: "kg", hazmat: false }`를 인수로 호출할 때 원본을 변경하지 않고 새 객체 `{ containerId: "Invalid" }`를 반환해야 합니다. ```js const testObj = { @@ -305,11 +306,11 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for null containerId"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for null containerId."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); ``` -`validateManifest()`를 인수로 `{ containerId: 0, destination: 405, weight: -84, unit: "pounds", hazmat: "no" }`를 호출하면 원본 입력을 변경하지 않고 새 객체 `{ containerId: "Invalid", destination: "Invalid", weight: "Invalid", unit: "Invalid", hazmat: "Invalid" }`를 반환해야 합니다. +`validateManifest` 함수는 `{ containerId: 0, destination: 405, weight: -84, unit: "pounds", hazmat: "no" }`를 인수로 호출할 때 원본을 변경하지 않고 새 객체 `{ containerId: "Invalid", destination: "Invalid", weight: "Invalid", unit: "Invalid", hazmat: "Invalid" }`를 반환해야 합니다. ```js const testObj = { @@ -330,16 +331,16 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid properties"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.strictEqual(testObj.containerId, 0, "Original object should not be mutated"); -assert.strictEqual(testObj.destination, 405, "Original object should not be mutated"); -assert.strictEqual(testObj.weight, -84, "Original object should not be mutated"); -assert.strictEqual(testObj.unit, "pounds", "Original object should not be mutated"); -assert.strictEqual(testObj.hazmat, "no", "Original object should not be mutated"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid properties."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.strictEqual(testObj.containerId, 0, "Original object should not be mutated."); +assert.strictEqual(testObj.destination, 405, "Original object should not be mutated."); +assert.strictEqual(testObj.weight, -84, "Original object should not be mutated."); +assert.strictEqual(testObj.unit, "pounds", "Original object should not be mutated."); +assert.strictEqual(testObj.hazmat, "no", "Original object should not be mutated."); ``` -`validateManifest()`를 인수로 `{ containerId: -2 }`를 호출하면 원본 입력을 변경하지 않고 새 객체 `{ containerId: "Invalid", destination: "Missing", weight: "Missing", unit: "Missing", hazmat: "Missing" }`를 반환해야 합니다. +`validateManifest` 함수는 `{ containerId: -2 }`를 인수로 호출할 때 원본을 변경하지 않고 새 객체 `{ containerId: "Invalid", destination: "Missing", weight: "Missing", unit: "Missing", hazmat: "Missing" }`를 반환해야 합니다. ```js const testObj = { @@ -356,13 +357,13 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.strictEqual(testObj.containerId, -2, "Original object should not be mutated"); -assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.strictEqual(testObj.containerId, -2, "Original object should not be mutated."); +assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated."); ``` -`validateManifest()`를 인수로 `{ containerId: 3.50 }`를 호출하면 원본 입력을 변경하지 않고 새 객체 `{ containerId: "Invalid", destination: "Missing", weight: "Missing", unit: "Missing", hazmat: "Missing" }`를 반환해야 합니다. 정수 값을 검증하려면 `Number.isInteger()`를 사용할 수 있습니다. +`validateManifest` 함수는 `{ containerId: 3.50 }`를 인수로 호출할 때 원본을 변경하지 않고 새 객체 `{ containerId: "Invalid", destination: "Missing", weight: "Missing", unit: "Missing", hazmat: "Missing" }`를 반환해야 합니다. 정수 값 검증에는 `Number.isInteger()`를 사용할 수 있습니다. ```js const testObj = { @@ -379,13 +380,13 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.strictEqual(testObj.containerId, 3.50, "Original object should not be mutated"); -assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.strictEqual(testObj.containerId, 3.50, "Original object should not be mutated."); +assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated."); ``` -`validateManifest()`를 인수로 `{ destination: " " }`를 호출하면 원본 입력을 변경하지 않고 새 객체 `{ containerId: "Missing", destination: "Invalid", weight: "Missing", unit: "Missing", hazmat: "Missing" }`를 반환해야 합니다. 문자열에서 공백을 제거하려면 `String.trim()`를 사용할 수 있습니다. +`validateManifest` 함수는 `{ destination: " " }`를 인수로 호출할 때 원본을 변경하지 않고 새 객체 `{ containerId: "Missing", destination: "Invalid", weight: "Missing", unit: "Missing", hazmat: "Missing" }`를 반환해야 합니다. 문자열의 공백 제거에는 `.trim()`을 사용할 수 있습니다. ```js const testObj = { @@ -402,13 +403,13 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.strictEqual(testObj.destination, " ", "Original object should not be mutated"); -assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.strictEqual(testObj.destination, " ", "Original object should not be mutated."); +assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated."); ``` -`validateManifest()`를 인수로 `{ weight: NaN }`를 호출하면 원본 입력을 변경하지 않고 새 객체 `{ containerId: "Missing", destination: "Missing", weight: "Invalid", unit: "Missing", hazmat: "Missing" }`를 반환해야 합니다. NaN 값을 검증하려면 `Number.isNaN()`를 사용할 수 있습니다. +`validateManifest` 함수는 `{ weight: NaN }`를 인수로 호출할 때 원본을 변경하지 않고 새 객체 `{ containerId: "Missing", destination: "Missing", weight: "Invalid", unit: "Missing", hazmat: "Missing" }`를 반환해야 합니다. `NaN` 값 검증에는 `Number.isNaN()`를 사용할 수 있습니다. ```js const testObj = { @@ -425,13 +426,13 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.ok(Number.isNaN(testObj.weight), "Original object should not be mutated"); -assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.ok(Number.isNaN(testObj.weight), "Original object should not be mutated."); +assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated."); ``` -입력 명세서 객체가 유효하지 않으면 `validateManifest` 함수는 누락되거나 잘못된 속성을 설명하는 객체를 반환해야 합니다. +입력 manifest 객체가 유효하지 않으면 `validateManifest` 함수는 누락되거나 잘못된 속성을 설명하는 객체를 반환해야 합니다. ```js const solutions = [ @@ -504,7 +505,7 @@ assert.equal(params.length, 1); assert.equal(params[0].toString(), 'manifest'); ``` -`processManifest()`를 인수로 `{ containerId: 55, destination: "Carmel", weight: 400, unit: "lb", hazmat: false }`를 호출하면 먼저 `"Validation success: 55"`를 출력한 후 `"Total weight: 180 kg"`를 출력해야 합니다. +`processManifest` 함수는 `{ containerId: 55, destination: "Carmel", weight: 400, unit: "lb", hazmat: false }`를 인수로 호출할 때 먼저 `Validation success: 55`를 로그로 출력하고, 그다음 `Total weight: 180 kg`를 출력해야 합니다. ```js const testObj = { @@ -524,8 +525,8 @@ try { ["Validation success: 55"], ["Total weight: 180 kg"] ]; - assert.deepEqual(spy.calls[0], expectedCalls[0], "First log should be the validation success message"); - assert.deepEqual(spy.calls[1], expectedCalls[1], "Second log should be the normalized weight in kg"); + assert.deepEqual(spy.calls[0], expectedCalls[0], "First log should be the validation success message."); + assert.deepEqual(spy.calls[1], expectedCalls[1], "Second log should be the normalized weight in kg."); } catch (err) { assert.fail(err); @@ -534,7 +535,7 @@ try { } ``` -입력 명세서 객체가 유효하면 `processManifest` 함수는 먼저 성공 메시지 `Validation success: ${containerId}`를 출력해야 합니다. +입력 manifest 객체가 유효하면 `processManifest` 함수는 먼저 성공 메시지 `Validation success: ${containerId}`를 로그로 출력해야 합니다. ```js const testObj = { @@ -562,7 +563,7 @@ try { } ``` -입력 명세서 객체가 유효하면 `processManifest` 함수는 `normalizeUnits()`를 사용해 킬로그램으로 표준화한 후 `Total weight: ${weight} kg`를 출력해야 합니다. +`processManifest` 함수는 유효한 입력 manifest 객체를 `normalizeUnits()`를 사용해 킬로그램으로 표준화한 후 `Total weight: ${weight} kg`를 로그로 출력해야 합니다. ```js const testObj = { @@ -590,7 +591,7 @@ try { } ``` -입력 명세서 객체가 유효하면 `processManifest` 함수는 객체의 `containerId`와 함께 성공 메시지를 출력한 후, `weight`를 사용해 킬로그램 단위로 변환된 객체의 `normalizeUnits()`를 출력해야 합니다. `console.log()` 호출이 두 번 있어야 합니다. +입력 manifest 객체가 유효하면 `processManifest` 함수는 객체의 `containerId`로 성공 메시지를 로그로 출력하고, 이어서 객체의 `weight`를 킬로그램 단위로 로그로 출력해야 합니다. 변환에는 `normalizeUnits()`를 사용하며, 이 과정에서 `console.log()` 호출이 두 번 있어야 합니다. ```js const originalNormalize = normalizeUnits; @@ -605,7 +606,7 @@ try { assert.isTrue( called, - "processManifest should call normalizeUnits() when the manifest is valid" + "processManifest() should call normalizeUnits() when the manifest is valid." ); } catch (err) { @@ -635,7 +636,7 @@ try { } ``` -`processManifest()`를 인수로 `{ containerId: -88, destination: "Soledad", weight: NaN }`를 호출하면 먼저 `Validation error: -88`를 출력한 후 객체 `{ containerId: "Invalid", weight: "Invalid", unit: "Missing", hazmat: "Missing" }`를 출력해야 합니다. +`processManifest` 함수는 `{ containerId: -88, destination: "Soledad", weight: NaN }`를 인수로 호출할 때 먼저 `Validation error: -88`을 로그로 출력하고, 그다음 `{ containerId: "Invalid", weight: "Invalid", unit: "Missing", hazmat: "Missing" }` 객체를 로그로 출력해야 합니다. ```js const testObj = { @@ -658,8 +659,8 @@ try { }] ]; - assert.deepEqual(spy.calls[0], expectedCalls[0], "First log should be the validation error message"); - assert.deepEqual(spy.calls[1], expectedCalls[1], "Second log should be the validation result object"); + assert.deepEqual(spy.calls[0], expectedCalls[0], "First log should be the validation error message."); + assert.deepEqual(spy.calls[1], expectedCalls[1], "Second log should be the validation result object."); } catch (err) { assert.fail(err); @@ -668,7 +669,7 @@ try { } ``` -`processManifest()`를 인수로 `{ destination: "Watsonville", hazmat: true }`를 호출하면 먼저 `Validation error: undefined`를 출력한 후 객체 `{ containerId: "Missing", weight: "Missing", unit: "Missing" }`를 출력해야 합니다. +`processManifest` 함수는 `{ destination: "Watsonville", hazmat: true }`를 인수로 호출할 때 먼저 `Validation error: undefined`를 로그로 출력하고, 그다음 `{ containerId: "Missing", weight: "Missing", unit: "Missing" }` 객체를 로그로 출력해야 합니다. ```js const testObj = { @@ -689,8 +690,8 @@ try { }] ]; - assert.deepEqual(spy.calls[0], expectedCalls[0], "First log should be the validation error message"); - assert.deepEqual(spy.calls[1], expectedCalls[1], "Second log should be the validation result object"); + assert.deepEqual(spy.calls[0], expectedCalls[0], "First log should be the validation error message."); + assert.deepEqual(spy.calls[1], expectedCalls[1], "Second log should be the validation result object."); } catch (err) { assert.fail(err); @@ -699,7 +700,7 @@ try { } ``` -입력 명세서 객체가 유효하지 않으면 `processManifest` 함수는 먼저 오류 메시지 `Validation error: ${containerId}`를 출력해야 합니다. +입력 manifest 객체가 유효하지 않으면 `processManifest` 함수는 먼저 오류 메시지 `Validation error: ${containerId}`를 로그로 출력해야 합니다. ```js const spy = __helpers.spyOn(console, "log"); @@ -718,13 +719,13 @@ try { assert.deepEqual(spy.calls[0], expectedCalls[0]); } catch (err) { - assert.fail(err); + assert.fail(err); } finally { spy.restore(); } ``` -입력 명세서 객체가 유효하지 않으면 `processManifest` 함수는 원본 명세서 객체로 `validateManifest()`를 호출해 반환된 객체도 출력해야 합니다. `console.log()`를 반환된 객체에 직접 호출하세요. +입력 manifest 객체가 유효하지 않으면 `processManifest` 함수는 원본 manifest 객체를 인수로 `validateManifest()`를 호출해 반환된 객체도 로그로 출력해야 합니다. 반환된 객체는 `console.log()`에 직접 전달하세요. ```js const originalValidate = validateManifest; @@ -740,7 +741,7 @@ try { assert.isTrue( called, - "processManifest should call validateManifest() when the manifest is invalid" + "processManifest() should call validateManifest() when the manifest is invalid." ); } catch (err) { @@ -765,13 +766,13 @@ try { assert.deepEqual(spy.calls[1], expectedCalls[1]); } catch (err) { - assert.fail(err); + assert.fail(err); } finally { spy.restore(); } ``` -입력 명세서 객체가 유효하지 않으면 `processManifest` 함수는 객체의 `containerId`와 함께 오류 메시지를 출력한 후, 입력 객체로 `validateManifest()`를 호출해 반환된 객체를 출력해야 합니다. 이 과정에서 `console.log()` 호출이 두 번 있어야 합니다. +입력 manifest 객체가 유효하지 않으면 `processManifest` 함수는 객체의 `containerId`로 오류 메시지를 로그로 출력하고, 이어서 입력 객체를 인수로 `validateManifest()`를 호출해 반환된 객체를 로그로 출력해야 합니다. 이 과정에서 `console.log()` 호출이 두 번 있어야 합니다. ```js const originalValidate = validateManifest; @@ -787,7 +788,7 @@ try { assert.isTrue( called, - "processManifest should call validateManifest() when the manifest is invalid" + "processManifest() should call validateManifest() when the manifest is invalid." ); } catch (err) { @@ -812,7 +813,7 @@ try { assert.deepEqual(spy.calls, expectedCalls); } catch (err) { - assert.fail(err); + assert.fail(err); } finally { spy.restore(); } diff --git a/curriculum/challenges/korean/blocks/lab-debug-pet-adoption-page/685239f0cad43c7a909cbd98.md b/curriculum/challenges/korean/blocks/lab-debug-pet-adoption-page/685239f0cad43c7a909cbd98.md index d345a764fbc..00996f25bad 100644 --- a/curriculum/challenges/korean/blocks/lab-debug-pet-adoption-page/685239f0cad43c7a909cbd98.md +++ b/curriculum/challenges/korean/blocks/lab-debug-pet-adoption-page/685239f0cad43c7a909cbd98.md @@ -25,14 +25,14 @@ Sally가 페이지를 계속 만들 수 있도록 모든 오류를 고치세요. # --hints-- -`img` 요소는 `src` 속성 대신 `href` 속성을 가져야 합니다. +`img` 요소는 `href` 속성 대신 `src` 속성을 가져야 합니다. ```js const imgEl = document.querySelector("img"); assert.isTrue(imgEl.hasAttribute("src")); ``` -`img` 요소는 존재하지 않는 `alt` 속성 대신 `att` 속성을 가져야 합니다. +`img` 요소는 존재하지 않는 `att` 속성 대신 `alt` 속성을 가져야 합니다. ```js const imgEl = document.querySelector("img"); @@ -45,7 +45,7 @@ assert.isTrue(imgEl.hasAttribute("alt")); assert.notMatch(code, /<\/img>/); ``` -텍스트가 `a`인 `Visit cats page` 요소는 `href` 속성 대신 `src` 속성을 가져야 합니다. +텍스트가 `Visit cats page`인 `a` 요소는 `src` 속성 대신 `href` 속성을 가져야 합니다. ```js const anchors = document.querySelectorAll("a"); @@ -54,7 +54,7 @@ assert.isDefined(catLink); assert.isTrue(catLink.hasAttribute("href")); ``` -텍스트가 `a`인 `Visit dogs page` 요소는 `href` 속성 대신 `src` 속성을 가져야 합니다. +텍스트가 `Visit dogs page`인 `a` 요소는 `src` 속성 대신 `href` 속성을 가져야 합니다. ```js const anchors = document.querySelectorAll("a"); diff --git a/curriculum/challenges/korean/blocks/lab-digital-pet-game/68c362b379059c388d3874f2.md b/curriculum/challenges/korean/blocks/lab-digital-pet-game/68c362b379059c388d3874f2.md index aa9bc1b7d10..e28708a3fd2 100644 --- a/curriculum/challenges/korean/blocks/lab-digital-pet-game/68c362b379059c388d3874f2.md +++ b/curriculum/challenges/korean/blocks/lab-digital-pet-game/68c362b379059c388d3874f2.md @@ -9,7 +9,7 @@ saveSubmissionToDB: true # --description-- -**목표:** 아래 사용자 스토리를 완성하고 모든 테스트를 통과해 실습을 완료하세요. +**목표:** 아래 사용자 스토리를 충족하고 모든 테스트를 통과하여 실습을 완료하세요. **사용자 스토리:** @@ -60,6 +60,7 @@ saveSubmissionToDB: true ```js globalThis._PET_NAME = 'Fitzgerald'; globalThis._clock = __FakeTimers.install(); +window.fetch = () => Promise.resolve({ json: () => Promise.resolve('Cats sleep for around 13 to 16 hours a day.') }); ``` # --after-all-- diff --git a/curriculum/challenges/korean/blocks/lab-fcc-forum-leaderboard/673c91f0b934834bc4a3ecc2.md b/curriculum/challenges/korean/blocks/lab-fcc-forum-leaderboard/673c91f0b934834bc4a3ecc2.md index d501b646e9c..82bc51778c2 100644 --- a/curriculum/challenges/korean/blocks/lab-fcc-forum-leaderboard/673c91f0b934834bc4a3ecc2.md +++ b/curriculum/challenges/korean/blocks/lab-fcc-forum-leaderboard/673c91f0b934834bc4a3ecc2.md @@ -1,6 +1,6 @@ --- id: 673c91f0b934834bc4a3ecc2 -title: fCC 포럼 리더보드 만들기 +title: FCC 포럼 리더보드 만들기 challengeType: 25 dashedName: build-an-fcc-forum-leaderboard demoType: onClick @@ -50,7 +50,7 @@ API 엔드포인트는 다음과 같은 형태의 JSON을 반환합니다: `avatar_template` 값은 상대 경로임을 주의하세요: `/`로 시작하며 픽셀 크기로 교체해야 하는 `{size}` 자리 표시자를 포함합니다. `avatarUrl` 상수는 경로가 상대적일 때 앞에 붙일 기본 URL입니다. -**목표:** 아래 사용자 스토리를 모두 충족하고 모든 테스트를 통과하여 실습을 완료하세요. +**목표:** 아래 사용자 스토리를 충족하고 모든 테스트를 통과하여 실습을 완료하세요. **사용자 스토리:** @@ -93,6 +93,68 @@ API 엔드포인트는 다음과 같은 형태의 JSON을 반환합니다: 1. `fetchData` 함수는 `forumLatest`에서 데이터를 요청하고 응답을 JSON으로 파싱하여 `showLatestPosts`에 전달해야 합니다. 1. 데이터를 가져오는 중 오류가 발생하면 `fetchData` 함수가 콘솔에 오류를 기록해야 합니다. 이때 `console.log`를 사용하세요. +# --before-all-- + +```js +const _testUsers = [ + { + avatar_template: '/user_avatar/QuincyLarson_{size}.png', + id: 6, + name: 'Quincy Larson', + username: 'QuincyLarson' + }, + { + avatar_template: '/user_avatar/jwilkins.oboe_{size}.png', + id: 285941, + name: 'Jessica Wilkins', + username: 'jwilkins.oboe' + }, + { + avatar_template: '/user_avatar/ilenia_{size}.png', + id: 170865, + name: 'Ilenia', + username: 'ilenia' + } +]; + +const _testPosters = [ + { user_id: 6 }, + { user_id: 285941 }, + { user_id: 170865 } +]; + +const _testData = { + users: _testUsers, + topic_list: { + topics: [ + { + bumped_at: '2024-04-15T16:01:26.403Z', + category_id: 1, + id: 684569, + posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], + posts_count: 8, + slug: 'the-freecodecamp-podcast-is-back-now-with-video', + title: 'The freeCodeCamp Podcast is back – now with video', + views: 542 + }, + { + bumped_at: '2024-04-19T13:52:03.523Z', + category_id: 421, + id: 686149, + posters: [{ user_id: 170865 }], + posts_count: 1, + slug: 'problem-with-making-changes-to-styles-js', + title: 'Problem with making changes to styles. (JS)', + views: 9 + } + ] + } +}; + +window.fetch = () => + Promise.resolve({ json: () => Promise.resolve(_testData) }); +``` + # --hints-- 단일 인수를 받는 `timeAgo`라는 함수를 만들어야 합니다. @@ -297,31 +359,8 @@ assert.lengthOf(avatars, 2); `avatars` 함수는 사용자 배열에서 찾은 각 게시자에 대해 `img` 요소를 연결한 문자열을 반환해야 합니다. ```js -const posters = [{ user_id: 6 }, { user_id: 285941 }, { user_id: 170865 }]; -const users = [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - }, - { id: 20 } -]; +const posters = _testPosters; +const users = [..._testUsers, { id: 20 }]; const actual = avatars(posters, users); const matches = actual.match(/<\s*img\s+.+?>/g); assert.lengthOf(matches, 3); @@ -330,31 +369,8 @@ assert.lengthOf(matches, 3); `avatars` 함수가 반환한 문자열의 각 `img` 요소는 게시자의 `alt` 속성 값을 가진 `name` 텍스트를 가져야 합니다. ```js -const posters = [{ user_id: 6 }, { user_id: 285941 }, { user_id: 170865 }]; -const users = [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - }, - { id: 20 } -]; +const posters = _testPosters; +const users = [..._testUsers, { id: 20 }]; const actual = avatars(posters, users); const matches = actual.match(/<\s*img\s+.+?>/g); @@ -366,31 +382,8 @@ assert.match(matches[2], /alt=('|")Ilenia\1/); `avatars` 함수는 `avatar_template` 속성에 접근하여 `{size}`를 `30`로 교체하여 각 아바타 크기를 설정해야 합니다. ```js -const posters = [{ user_id: 6 }, { user_id: 285941 }, { user_id: 170865 }]; -const users = [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - }, - { id: 20 } -]; +const posters = _testPosters; +const users = [..._testUsers, { id: 20 }]; const actual = avatars(posters, users); assert.notMatch(actual, /\{size\}/); assert.lengthOf(actual.match(/_30/g), 3); @@ -399,31 +392,8 @@ assert.lengthOf(actual.match(/_30/g), 3); 각 `img` 요소는 일치하는 사용자의 `src` 값을 가진 `avatar_template` 속성을 가져야 합니다. `avatar_template`가 `/`로 시작하면 `avatarUrl`를 바로 앞에 붙이세요. ```js -const posters = [{ user_id: 6 }, { user_id: 285941 }, { user_id: 170865 }]; -const users = [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - }, - { id: 20 } -]; +const posters = _testPosters; +const users = [..._testUsers, { id: 20 }]; const actual = avatars(posters, users); const matches = actual.match(/<\s*img\s+.+?>/g); @@ -458,19 +428,15 @@ assert.isFunction(fetchData); `fetchData` 함수는 `https://cdn.freecodecamp.org/curriculum/forum-latest/latest.json`에서 데이터를 요청해야 합니다. ```js -const testArr = []; -const temp = fetch; +const spy = __helpers.spyOn(window, 'fetch'); try { - fetch = source => { - testArr.push(source); - return temp(source); - }; fetchData(); - assert.deepEqual(testArr, [ + assert.include( + spy.calls.map(call => call[0]), 'https://cdn.freecodecamp.org/curriculum/forum-latest/latest.json' - ]); + ); } finally { - fetch = temp; + spy.restore(); } ``` @@ -521,55 +487,7 @@ async () => { `showLatestPosts`는 `#posts-container`의 내부 HTML을 `tr`의 각 항목에 대해 `topics` 요소를 연결한 문자열로 설정해야 합니다. ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const pContainer = document.getElementById('posts-container'); pContainer.innerHTML = ''; showLatestPosts(data); @@ -579,55 +497,7 @@ assert.lengthOf(pContainer.querySelectorAll('tr'), 2); `tr`가 반환한 문자열의 각 `showLatestPosts` 요소는 다섯 개의 `td` 요소를 포함해야 합니다. ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const pContainer = document.getElementById('posts-container'); pContainer.innerHTML = ''; showLatestPosts(data); @@ -638,55 +508,7 @@ assert.lengthOf(pContainer.querySelectorAll('tr:last-child>td'), 5); `td`가 반환한 문자열의 각 표 행의 첫 번째 `showLatestPosts` 요소는 두 개의 앵커 요소를 포함해야 하며, 첫 번째는 `post-title` 클래스를 가지고 `href`의 `/`를 가지며 `` 앵커 텍스트를 갖고, 두 번째는 `forumCategory`을 `category_id`로 호출하여 얻은 것입니다. ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const pContainer = document.getElementById('posts-container'); pContainer.innerHTML = ''; showLatestPosts(data); @@ -731,55 +553,7 @@ assert.equal( `td`가 반환한 문자열의 각 표 행의 두 번째 `showLatestPosts` 요소는 `avatars` 함수가 `posters`과 `users`를 인수로 호출하여 반환한 이미지를 `avatar-container` 클래스를 가진 `div` 요소 안에 중첩하여 포함해야 합니다. ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const pContainer = document.getElementById('posts-container'); pContainer.innerHTML = ''; showLatestPosts(data); @@ -820,55 +594,7 @@ assert.equal(imgs2[0].alt, 'Ilenia'); `td`가 반환한 문자열의 각 표 행의 세 번째 `showLatestPosts` 요소는 게시물에 대한 답글 수를 포함해야 합니다. _힌트:_ `posts_count - 1`를 사용하세요. ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const pContainer = document.getElementById('posts-container'); pContainer.innerHTML = ''; showLatestPosts(data); @@ -887,55 +613,7 @@ assert.equal( `td`가 반환한 문자열의 각 표 행의 네 번째 `showLatestPosts` 요소는 게시물 조회 수를 포함해야 합니다. ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const pContainer = document.getElementById('posts-container'); pContainer.innerHTML = ''; showLatestPosts(data); @@ -954,55 +632,7 @@ assert.equal( `td`가 반환한 문자열의 각 표 행의 다섯 번째 `showLatestPosts` 요소는 `timeAgo` 함수를 사용해 생성한 마지막 활동 이후 경과 시간을 포함해야 합니다. ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const calcTime = time => { const currentTime = new Date(); const lastPost = new Date(time); diff --git a/curriculum/challenges/korean/blocks/lab-javascript-trivia-bot/66ed41f912d0bb1dc62da5dd.md b/curriculum/challenges/korean/blocks/lab-javascript-trivia-bot/66ed41f912d0bb1dc62da5dd.md index 1cade6a40e8..ed123e913eb 100644 --- a/curriculum/challenges/korean/blocks/lab-javascript-trivia-bot/66ed41f912d0bb1dc62da5dd.md +++ b/curriculum/challenges/korean/blocks/lab-javascript-trivia-bot/66ed41f912d0bb1dc62da5dd.md @@ -11,17 +11,17 @@ dashedName: lab-javascript-trivia-bot **사용자 스토리:** -1. 사용자에게 인사 메시지로 `"Hello! I'm your coding fun fact guide!"`를 콘솔에 출력해야 합니다. -1. 봇의 이름, 출신지, 가장 좋아하는 코딩 언어를 각각 저장하는 `botName`, `botLocation`, `favoriteLanguage` 세 변수를 만들어야 합니다. -1. `"My name is (botName) and I live on (botLocation)."`를 콘솔에 출력해야 합니다. -1. `"My favorite programming language is (favoriteLanguage)."`를 콘솔에 출력해야 합니다. -1. `let`를 사용해 `codingFact` 변수를 만들고, 봇이 가장 좋아하는 코딩 언어에 관한 재미있는 사실을 문자열로 할당하며 `favoriteLanguage` 변수를 포함해야 합니다. -1. `codingFact`를 콘솔에 출력해야 합니다. -1. `codingFact` 변수에 봇이 가장 좋아하는 언어에 관한 새로운 사실을 `favoriteLanguage` 변수를 사용해 다시 할당해야 합니다. -1. `codingFact`를 다시 콘솔에 출력해야 합니다. -1. `codingFact` 변수에 또 다른 새로운 사실을 `favoriteLanguage` 변수를 사용해 다시 할당해야 합니다. -1. `codingFact`를 세 번째로 콘솔에 출력해야 합니다. -1. 봇의 작별 인사로 `"It was fun sharing these facts with you. Goodbye! - (botName) from (botLocation)."`를 콘솔에 출력해야 합니다. +1. 사용자에게 인사 메시지로 `"Hello! I'm your coding fun fact guide!"`를 콘솔에 출력하세요. +1. 봇의 이름, 출신지, 그리고 가장 좋아하는 프로그래밍 언어를 각각 저장하는 `botName`, `botLocation`, `favoriteLanguage` 세 변수를 만드세요. +1. `"My name is (botName) and I live on (botLocation)."`를 콘솔에 출력하세요. +1. `"My favorite programming language is (favoriteLanguage)."`를 콘솔에 출력하세요. +1. `let`을 사용해 `codingFact` 변수를 만들고, `favoriteLanguage` 변수를 사용해 봇이 가장 좋아하는 프로그래밍 언어에 관한 재미있는 사실을 문자열로 할당하세요. +1. `codingFact`를 콘솔에 출력하세요. +1. `codingFact` 변수에 `favoriteLanguage` 변수를 다시 사용해 봇이 가장 좋아하는 프로그래밍 언어에 관한 새로운 사실을 할당하세요. +1. `codingFact`를 다시 콘솔에 출력하세요. +1. `codingFact` 변수에 `favoriteLanguage` 변수를 다시 사용해 세 번째 사실을 할당하세요. +1. `codingFact`를 세 번째로 콘솔에 출력하세요. +1. 봇의 작별 인사로 `"It was fun sharing these facts with you. Goodbye! - (botName) from (botLocation)."`를 콘솔에 출력하세요. # --before-each-- @@ -162,7 +162,7 @@ let codingFact = "Did you know that " + favoriteLanguage + " was created in just console.log(codingFact); -codingFact = "Another fun fact: " + favoriteLanguage + "was originally called Mocha!"; +codingFact = "Another fun fact: " + favoriteLanguage + " was originally called Mocha!"; console.log(codingFact); diff --git a/curriculum/challenges/korean/blocks/lab-mood-board/673b3d6b7ef7318eef926d5a.md b/curriculum/challenges/korean/blocks/lab-mood-board/673b3d6b7ef7318eef926d5a.md index 0b9b8889728..51e1d2cce8e 100644 --- a/curriculum/challenges/korean/blocks/lab-mood-board/673b3d6b7ef7318eef926d5a.md +++ b/curriculum/challenges/korean/blocks/lab-mood-board/673b3d6b7ef7318eef926d5a.md @@ -16,16 +16,16 @@ demoType: onClick **사용자 스토리:** -1. 세 개의 프로프 `MoodBoardItem`, `color`, `image`를 받는 `description` 컴포넌트를 생성하고 내보내야 합니다. -2. `MoodBoardItem` 컴포넌트는 최상위 요소로 클래스 `div`를 가진 `mood-board-item`를 반환해야 합니다. -3. `.mood-board-item` 요소의 배경색을 인라인 스타일로 `color` 프로프 값으로 설정해야 합니다. -4. `img` 요소 안에 클래스 `mood-board-image`를 가진 `src` 요소를 렌더링하고, `image` 속성은 `.mood-board-item` 프로프 값으로 설정해야 합니다. -5. `h3` 요소 안에 클래스 `mood-board-text`를 가진 `description` 요소를 렌더링하고, 텍스트는 `.mood-board-item` 프로프 값이어야 합니다. -6. `MoodBoard` 컴포넌트를 생성하고 내보내야 합니다. +1. 세 가지 프로프인 `color`, `image`, `description`을 받는 `MoodBoardItem` 컴포넌트를 생성하고 내보내세요. +2. `MoodBoardItem` 컴포넌트는 최상위 요소로 `mood-board-item` 클래스가 있는 `div`를 반환해야 합니다. +3. `.mood-board-item` 요소의 배경색을 인라인 스타일로 `color` 프로프 값으로 설정하세요. +4. `.mood-board-item` 요소 안에 `mood-board-image` 클래스가 있고 `src` 속성이 `image` 프로프 값으로 설정된 `img` 요소를 렌더링하세요. +5. `.mood-board-item` 요소 안에 `mood-board-text` 클래스가 있고 텍스트가 `description` 프로프 값인 `h3` 요소를 렌더링하세요. +6. `MoodBoard` 컴포넌트를 생성하고 내보내세요. 7. `MoodBoard` 컴포넌트는 최상위 요소로 `div`를 반환해야 합니다. -8. `MoodBoard` 컴포넌트는 클래스 `h1`를 가진 `mood-board-heading` 요소를 렌더링하고 텍스트는 `Destination Mood Board`이어야 합니다. -9. `MoodBoard` 컴포넌트는 클래스 `div`를 가진 `mood-board`를 렌더링해야 합니다. -10. `MoodBoard` 컴포넌트는 `MoodBoardItem` 요소 안에 최소 세 개의 `.mood-board` 컴포넌트를 렌더링해야 하며, 각각은 유효한 값의 `color`, `image`, `description` 프로프스를 전달해야 합니다. +8. `MoodBoard` 컴포넌트는 `mood-board-heading` 클래스가 있는 `h1` 요소를 렌더링하고 텍스트는 `Destination Mood Board`여야 합니다. +9. `MoodBoard` 컴포넌트는 `mood-board` 클래스가 있는 `div`를 렌더링해야 합니다. +10. `MoodBoard` 컴포넌트는 `.mood-board` 요소 안에 최소 세 개의 `MoodBoardItem` 컴포넌트를 렌더링해야 하며, 각각은 유효한 값의 `color`, `image`, `description` 프로프스를 전달해야 합니다. 원한다면 무드 보드에 다음 이미지를 사용할 수 있습니다: @@ -41,10 +41,10 @@ demoType: onClick `MoodBoardItem` 컴포넌트를 내보내야 합니다. ```js -assert.isFunction(window.index.MoodBoardItem, 1); +assert.isFunction(window.index.MoodBoardItem); ``` -`MoodBoardItem` 컴포넌트는 최상위 요소로 클래스 `div`를 가진 `mood-board-item`를 반환해야 합니다. +`MoodBoardItem` 컴포넌트는 최상위 요소로 `mood-board-item` 클래스가 있는 `div`를 반환해야 합니다. ```js const item = document.getElementsByClassName('mood-board-item')[0]; @@ -83,7 +83,7 @@ assert.equal(item.tagName, 'DIV'); `MoodBoard` 컴포넌트를 내보내야 합니다. ```js -assert.isFunction(window.index.MoodBoard, 1); +assert.isFunction(window.index.MoodBoard); ``` `MoodBoard` 컴포넌트는 최상위 요소로 `div`를 반환해야 합니다. @@ -102,7 +102,15 @@ assert.equal(heading.tagName, 'H1'); assert.equal(heading.textContent, 'Destination Mood Board'); ``` -`MoodBoard` 컴포넌트는 최소 세 개의 `MoodBoardItem` 컴포넌트를 렌더링해야 하며, 각각은 유효한 값의 `color`, `image`, `description` 프로프스를 전달해야 합니다. +`MoodBoard` 컴포넌트는 `mood-board` 클래스가 있는 `div`를 렌더링해야 합니다. + +```js +const moodboard = document.getElementsByClassName('mood-board')[0]; +assert.exists(moodboard); +assert.equal(moodboard.tagName, 'DIV'); +``` + +`MoodBoard` 컴포넌트는 `.mood-board` 요소 안에 최소 세 개의 `MoodBoardItem` 컴포넌트를 렌더링해야 하며, 각각은 유효한 값의 `color`, `image`, `description` 프로프스를 전달해야 합니다. ```js const moodboard = document.getElementsByClassName('mood-board')[0]; diff --git a/curriculum/challenges/korean/blocks/lab-motorcycle-shop/694175528a794a090ea0ba74.md b/curriculum/challenges/korean/blocks/lab-motorcycle-shop/694175528a794a090ea0ba74.md index 962968ab322..ed82e1bb920 100644 --- a/curriculum/challenges/korean/blocks/lab-motorcycle-shop/694175528a794a090ea0ba74.md +++ b/curriculum/challenges/korean/blocks/lab-motorcycle-shop/694175528a794a090ea0ba74.md @@ -1,6 +1,6 @@ --- id: 694175528a794a090ea0ba74 -title: Build a Motorcycle Shop +title: 오토바이 가게 만들기 challengeType: 25 dashedName: lab-motorcycle-shop demoType: onClick @@ -35,6 +35,291 @@ demoType: onClick 7. 표시되는 `Motorcycle` 요소의 수는 `results-number` 아이디를 가진 요소 안에 나열되어야 합니다. 8. 필터는 `input` 이벤트에서 업데이트되어야 합니다. +# --before-all-- + +```js +const _testMotorcycles = [ + { + id: '1', + name: 'Ninja H2', + manufacturer: 'Kawasaki', + category: 'Sport', + price: 29000, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-vmoto-stash.jpg', + description: 'Supercharged hypersport with unmatched power', + year: 2024, + created_at: '2024-01-01T00:00:00Z' + }, + { + id: '2', + name: 'Street Triple RS', + manufacturer: 'Triumph', + category: 'Naked', + price: 13500, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-r3.png', + description: 'Agile naked bike with triple-cylinder perfection', + year: 2024, + created_at: '2024-01-02T00:00:00Z' + }, + { + id: '3', + name: 'R1250 GS Adventure', + manufacturer: 'BMW', + category: 'Adventure', + price: 21995, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-vmoto-stash.jpg', + description: 'The ultimate adventure touring machine', + year: 2024, + created_at: '2024-01-03T00:00:00Z' + }, + { + id: '4', + name: 'Panigale V4', + manufacturer: 'Ducati', + category: 'Sport', + price: 28395, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-kawasaki-zx10r.png', + description: 'Italian superbike engineering at its finest', + year: 2024, + created_at: '2024-01-04T00:00:00Z' + }, + { + id: '5', + name: 'Road Glide Special', + manufacturer: 'Harley-Davidson', + category: 'Cruiser', + price: 29999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-vmax.jpg', + description: 'Classic American touring with modern tech', + year: 2024, + created_at: '2024-01-05T00:00:00Z' + }, + { + id: '6', + name: 'MT-09', + manufacturer: 'Yamaha', + category: 'Naked', + price: 9999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-mt7.jpg', + description: 'Lightweight naked bike with crossplane power', + year: 2024, + created_at: '2024-01-06T00:00:00Z' + }, + { + id: '7', + name: 'Africa Twin', + manufacturer: 'Honda', + category: 'Adventure', + price: 14599, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-honda-africa.jpg', + description: 'Legendary adventure bike reborn for modern times', + year: 2024, + created_at: '2024-01-07T00:00:00Z' + }, + { + id: '8', + name: 'Super Duke R', + manufacturer: 'KTM', + category: 'Naked', + price: 18999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-suzuki-sv650.jpg', + description: 'The Beast returns with 180hp of raw power', + year: 2024, + created_at: '2024-01-08T00:00:00Z' + }, + { + id: '9', + name: 'GSX-R1000R', + manufacturer: 'Suzuki', + category: 'Sport', + price: 17199, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-suzuki-gsxr1000.jpg', + description: 'Track-ready sportbike with championship DNA', + year: 2024, + created_at: '2024-01-09T00:00:00Z' + }, + { + id: '10', + name: 'Street Glide', + manufacturer: 'Harley-Davidson', + category: 'Cruiser', + price: 21999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-vmax.jpg', + description: 'Milwaukee-Eight power in a sleek bagger', + year: 2024, + created_at: '2024-01-10T00:00:00Z' + }, + { + id: '11', + name: 'Z H2', + manufacturer: 'Kawasaki', + category: 'Naked', + price: 17000, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-kawasaki-zh2.jpg', + description: 'Supercharged naked bike mayhem', + year: 2024, + created_at: '2024-01-11T00:00:00Z' + }, + { + id: '12', + name: 'Multistrada V4', + manufacturer: 'Ducati', + category: 'Adventure', + price: 22995, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-mt3.jpg', + description: 'Italian style meets adventure capability', + year: 2024, + created_at: '2024-01-12T00:00:00Z' + }, + { + id: '13', + name: 'Speed Triple 1200', + manufacturer: 'Triumph', + category: 'Naked', + price: 16500, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-honda-transalp.jpg', + description: 'British muscle bike with cutting-edge tech', + year: 2024, + created_at: '2024-01-13T00:00:00Z' + }, + { + id: '14', + name: 'S1000RR', + manufacturer: 'BMW', + category: 'Sport', + price: 17295, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-kawasaki-z900a1.jpg', + description: 'German precision in a superbike package', + year: 2024, + created_at: '2024-01-14T00:00:00Z' + }, + { + id: '15', + name: 'MT-07', + manufacturer: 'Yamaha', + category: 'Naked', + price: 7999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-mt7.jpg', + description: 'Best-selling parallel twin for pure fun', + year: 2024, + created_at: '2024-01-15T00:00:00Z' + }, + { + id: '16', + name: 'V-Strom 1050', + manufacturer: 'Suzuki', + category: 'Adventure', + price: 13799, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-benelli-trk702.png', + description: 'Reliable adventure touring on a budget', + year: 2024, + created_at: '2024-01-16T00:00:00Z' + }, + { + id: '17', + name: 'Sportster S', + manufacturer: 'Harley-Davidson', + category: 'Cruiser', + price: 15999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-r3.png', + description: 'Revolution Max engine in a modern cruiser', + year: 2024, + created_at: '2024-01-17T00:00:00Z' + }, + { + id: '18', + name: 'CBR1000RR-R', + manufacturer: 'Honda', + category: 'Sport', + price: 28500, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-honda-cbr500.png', + description: 'Honda racing technology for the street', + year: 2024, + created_at: '2024-01-18T00:00:00Z' + }, + { + id: '19', + name: 'Tiger 900', + manufacturer: 'Triumph', + category: 'Adventure', + price: 14400, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-triumph-tiger900.png', + description: 'Middleweight adventure excellence', + year: 2024, + created_at: '2024-01-19T00:00:00Z' + }, + { + id: '20', + name: '890 Duke R', + manufacturer: 'KTM', + category: 'Naked', + price: 11999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-kawasaki-zx10r.png', + description: 'The Scalpel - precise handling perfection', + year: 2024, + created_at: '2024-01-20T00:00:00Z' + }, + { + id: '21', + name: 'Ninja 400', + manufacturer: 'Kawasaki', + category: 'Sport', + price: 5299, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-vmoto-stash.jpg', + description: 'Perfect entry-level sportbike', + year: 2024, + created_at: '2024-01-21T00:00:00Z' + }, + { + id: '22', + name: 'Scrambler 1200', + manufacturer: 'Triumph', + category: 'Adventure', + price: 13250, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-ducati-scrambler.jpg', + description: 'Modern classic with off-road capability', + year: 2024, + created_at: '2024-01-22T00:00:00Z' + }, + { + id: '23', + name: 'Monster Plus', + manufacturer: 'Ducati', + category: 'Naked', + price: 14295, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-kawasaki-zx10r.png', + description: 'Evolved Monster with V-twin soul', + year: 2024, + created_at: '2024-01-23T00:00:00Z' + }, + { + id: '24', + name: 'CB650R', + manufacturer: 'Honda', + category: 'Naked', + price: 9199, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-kawasaki-z900.png', + description: 'Neo Sports Café styling with inline-four power', + year: 2024, + created_at: '2024-01-24T00:00:00Z' + }, + { + id: '25', + name: 'Low Rider S', + manufacturer: 'Harley-Davidson', + category: 'Cruiser', + price: 17999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-suzuki-vstorm650.jpg', + description: 'Blacked-out cruiser with attitude', + year: 2024, + created_at: '2024-01-25T00:00:00Z' + } +]; + +window.fetch = () => + Promise.resolve({ json: () => Promise.resolve(_testMotorcycles) }); +``` + # --hints-- `type`라는 `Category`가 있어야 합니다. @@ -84,16 +369,24 @@ assert.isFunction(fetchMotorcycles); ```js const spy = __helpers.spyOn(window, 'fetch'); -const motorcycles = await fetchMotorcycles(); -assert.strictEqual(spy.calls[0][0].trim(),"https://cdn.freecodecamp.org/curriculum/labs/data/motorcycles.json"); +try { + await fetchMotorcycles(); + assert.strictEqual(spy.calls[0][0].trim(),"https://cdn.freecodecamp.org/curriculum/labs/data/motorcycles.json"); +} finally { + spy.restore(); +} ``` `Motorcycle`에서 25개의 `fetchMotorcycles` 객체를 반환하는 프로미스를 반환해야 합니다. ```js const spy = __helpers.spyOn(window, 'fetch'); -const motorcycles = await fetchMotorcycles(); -assert.lengthOf(motorcycles,25); +try { + const motorcycles = await fetchMotorcycles(); + assert.lengthOf(motorcycles,25); +} finally { + spy.restore(); +} ``` `renderMotorcycleCard`라는 이름의 함수가 있어야 합니다. diff --git a/curriculum/challenges/korean/blocks/lab-nth-fibonacci-number-js/7a97b79c096ecb000d03bd36.md b/curriculum/challenges/korean/blocks/lab-nth-fibonacci-number-js/7a97b79c096ecb000d03bd36.md index 70f11740843..b3dea07513c 100644 --- a/curriculum/challenges/korean/blocks/lab-nth-fibonacci-number-js/7a97b79c096ecb000d03bd36.md +++ b/curriculum/challenges/korean/blocks/lab-nth-fibonacci-number-js/7a97b79c096ecb000d03bd36.md @@ -22,35 +22,40 @@ dashedName: build-an-nth-fibonacci-number-calculator `fibonacci`라는 이름의 함수가 있어야 합니다. ```js -assert.isFunction(fibonacci); +const explorer = await __helpers.Explorer(code); +assert.exists(explorer.allFunctions.fibonacci); ``` `fibonacci` 함수는 하나의 매개변수를 받아야 합니다. ```js -const params = __helpers.getFunctionParams(fibonacci.toString()); -assert.equal(params.length, 1); +const explorer = await __helpers.Explorer(code); +const { fibonacci } = explorer.allFunctions; +assert.equal(fibonacci?.parameters.length, 1); ``` `sequence` 함수 내에 `fibonacci`라는 배열이 있어야 하며, `[0, 1]`로 초기화되어야 합니다. ```js -assert.match(__helpers.removeJSComments(fibonacci.toString()), /(const|let|var)\s+sequence\s*=\s*\[\s*0\s*,\s*1\s*\]/); +const explorer = await __helpers.Explorer(code); +const { fibonacci } = explorer.allFunctions; +const { sequence } = fibonacci?.variables ?? {}; +assert.isTrue(sequence?.value.matches('[0, 1]')); ``` -`fibonacci(0)`는 `0`을 반환해야 합니다. +`fibonacci(0)`는 `0`를 반환해야 합니다. ```js assert.equal(fibonacci(0), 0); ``` -`fibonacci(1)`는 `1`을 반환해야 합니다. +`fibonacci(1)`는 `1`를 반환해야 합니다. ```js assert.equal(fibonacci(1), 1); ``` -`fibonacci(2)`는 `1`을 반환해야 합니다. +`fibonacci(2)`는 `1`를 반환해야 합니다. ```js assert.equal(fibonacci(2), 1); @@ -74,7 +79,7 @@ assert.equal(fibonacci(5), 5); assert.equal(fibonacci(10), 55); ``` -`fibonacci(15)`는 `610`을 반환해야 합니다. +`fibonacci(15)`는 `610`를 반환해야 합니다. ```js assert.equal(fibonacci(15), 610); diff --git a/curriculum/challenges/korean/blocks/lab-product-showcase/696920c0c98a1ed58eb86293.md b/curriculum/challenges/korean/blocks/lab-product-showcase/696920c0c98a1ed58eb86293.md index d5def8cea82..b44e4be18c6 100644 --- a/curriculum/challenges/korean/blocks/lab-product-showcase/696920c0c98a1ed58eb86293.md +++ b/curriculum/challenges/korean/blocks/lab-product-showcase/696920c0c98a1ed58eb86293.md @@ -421,6 +421,10 @@ assert.isFunction(showProducts); ```js const len = products.items.length; +const books = document.getElementById("books"); +const all = document.getElementById("all"); +const output = document.getElementById("output"); + assert.isAtLeast(len, 3); books.dispatchEvent(new Event("click", { bubbles: true })); all.dispatchEvent(new Event("click", { bubbles: true })); @@ -430,7 +434,11 @@ assert.lengthOf(output.querySelectorAll(".item"), len); `#books` 버튼을 클릭하면 `#output` 요소에 해당 제품 세트가 표시되어야 합니다. ```js +const books = document.getElementById("books"); +const clothing = document.getElementById("clothing"); +const output = document.getElementById("output"); const len = products.items.length; + assert.isAtLeast(len, 3); let count = 0; products.items.forEach(i => { @@ -446,7 +454,11 @@ assert.lengthOf(output.querySelectorAll(".item"), count); `#electronics` 버튼을 클릭하면 `#output` 요소에 해당 제품 세트가 표시되어야 합니다. ```js +const electronics = document.getElementById("electronics"); +const clothing = document.getElementById("clothing"); +const output = document.getElementById("output"); const len = products.items.length; + assert.isAtLeast(len, 3); let count = 0; products.items.forEach(i => { @@ -462,7 +474,11 @@ assert.lengthOf(output.querySelectorAll(".item"), count); `#clothing` 버튼을 클릭하면 `#output` 요소에 해당 제품 세트가 표시되어야 합니다. ```js +const books = document.getElementById("books"); +const clothing = document.getElementById("clothing"); +const output = document.getElementById("output"); const len = products.items.length; + assert.isAtLeast(len, 3); let count = 0; products.items.forEach(i => { @@ -478,6 +494,7 @@ assert.lengthOf(output.querySelectorAll(".item"), count); 페이지가 로드될 때 기본적으로 모든 제품이 보여야 합니다. 이를 위해 `DOMContentLoaded` 이벤트를 사용하세요. ```js +const output = document.getElementById("output"); const len = products.items.length; assert.isAtLeast(len, 3); document.dispatchEvent(new Event("DOMContentLoaded")); diff --git a/curriculum/challenges/korean/blocks/lab-reusable-footer/673b02b03134b04637bf7055.md b/curriculum/challenges/korean/blocks/lab-reusable-footer/673b02b03134b04637bf7055.md index 000a9d3b8c8..080a8d2ed91 100644 --- a/curriculum/challenges/korean/blocks/lab-reusable-footer/673b02b03134b04637bf7055.md +++ b/curriculum/challenges/korean/blocks/lab-reusable-footer/673b02b03134b04637bf7055.md @@ -8,7 +8,7 @@ demoType: onClick # --description-- -**목표:** 아래 사용자 스토리를 충족하고 모든 테스트를 통과하여 도전 과제를 완료하세요. +**목표:** 아래 사용자 스토리를 충족하고 모든 테스트를 통과하여 실습을 완료하세요. **사용자 스토리:** @@ -16,7 +16,7 @@ demoType: onClick 2. `Footer` 컴포넌트는 다른 모든 요소를 포함하는 `footer` 요소를 반환해야 합니다. 3. `footer` 요소는 다음을 포함해야 합니다: - - 각각 최소 두 개의 항목이 있는 순서 없는 목록이 세 개 이상. +- 각각 최소 두 개의 항목이 있는 순서 없는 목록이 세 개 이상. - 저작권 `©` 기호가 포함된 단락 요소가 최소 한 개 이상. - `href` 속성 값이 `#`로 설정되고, 링크 내용이 아이콘이나 원하는 텍스트인 링크가 세 개 이상. @@ -53,7 +53,7 @@ assert.lengthOf(document.getElementById('root').children, 1); assert.isAtLeast(document.querySelectorAll('ul').length, 3); ``` -각 순서 없는 목록은 최소 두 개의 항목을 가져야 합니다. +순서 없는 목록 각각에 최소 두 개의 목록 항목이 있어야 합니다. ```js const uls = [...document.querySelectorAll('ul')]; diff --git a/curriculum/challenges/korean/blocks/lab-sentence-maker/66c057041df6394ca796bf33.md b/curriculum/challenges/korean/blocks/lab-sentence-maker/66c057041df6394ca796bf33.md index 10aac8e676c..6947c851233 100644 --- a/curriculum/challenges/korean/blocks/lab-sentence-maker/66c057041df6394ca796bf33.md +++ b/curriculum/challenges/korean/blocks/lab-sentence-maker/66c057041df6394ca796bf33.md @@ -7,9 +7,9 @@ dashedName: build-a-sentence-maker # --description-- -이 실습에서는 문장 템플릿을 사용해 두 가지 다른 스토리를 만듭니다. 변수에 스토리의 여러 부분을 저장한 다음, 스토리를 콘솔에 출력하세요. +이 실습에서는 문장 템플릿을 사용해 서로 다른 두 개의 스토리를 만드세요. 변수에 스토리의 여러 부분을 저장한 후, 콘솔에 스토리를 출력하세요. -**목표:** 아래 사용자 스토리를 완성하고 모든 테스트를 통과해 실습을 완료하세요. +**목표:** 아래 사용자 스토리를 충족하고 모든 테스트를 통과하여 실습을 완료하세요. **사용자 스토리:** @@ -26,9 +26,9 @@ dashedName: build-a-sentence-maker 1. `firstStory` 변수를 선언하세요. -1. 다음 스토리 템플릿을 사용해 첫 번째 스토리를 만들고 `firstStory` 변수에 할당하세요: `"Once upon a time, there was a(n) [adjective] [noun] who loved to eat [noun2]. The [noun] lived in a [place] and had [adjective2] nostrils that blew fire when it was [verb]."`; +1. 다음 스토리 템플릿을 사용해 첫 번째 스토리를 만들고 `firstStory` 변수에 할당하세요: `"Once upon a time, there was a(n) [adjective] [noun] who loved to eat [noun2]. The [noun] lived in a [place] and had [adjective2] nostrils that blew fire when it was [verb]."` -1. 첫 번째 스토리를 `"First story: [firstStory]"` 메시지를 사용해 콘솔에 출력하세요. +1. 메시지 `"First story: [firstStory]"`를 사용해 첫 번째 스토리를 콘솔에 출력하세요. 1. `adjective`, `noun`, `verb`, `place`, `adjective2`, `noun2` 변수에 새 값을 할당하세요. @@ -36,9 +36,16 @@ dashedName: build-a-sentence-maker 1. 같은 템플릿을 사용해 다른 스토리를 만들고 `secondStory` 변수에 할당하세요. -1. 두 번째 스토리를 `"Second story: [secondStory]"` 메시지를 사용해 콘솔에 출력하세요. +1. 메시지 `"Second story: [secondStory]"`를 사용해 두 번째 스토리를 콘솔에 출력하세요. +# --before-each-- + +```js +const spy = __helpers.spyOn(console, 'log'); +const getLogs = () => spy.calls.map(call => call.join(' ')); +``` + # --hints-- `adjective` 변수를 선언하세요. @@ -142,12 +149,10 @@ assert.match( ); ``` -`"First story: [firstStory]"` 메시지를 사용해 첫 번째 스토리를 로그하세요. +메시지 `"First story: [firstStory]"`를 사용해 첫 번째 스토리를 콘솔에 출력하세요. ```js -const condition1 = /console\.log\(\s*["']First\s+story:\s+["']\s*\+\s*firstStory\s*\);?/gm.test(code); -const condition2 = /console\.log\(\s*`First\s+story:\s+\$\{firstStory\}`\s*\);?/gm.test(code); -assert.isTrue(condition1 || condition2); +assert.include(getLogs(), `First story: ${firstStory}`); ``` `secondStory` 변수를 선언하세요. @@ -208,12 +213,10 @@ assert.match( ); ``` -`"Second story: [secondStory]"` 형식을 사용해 두 번째 스토리를 로그하세요. +메시지 `"Second story: [secondStory]"`를 사용해 두 번째 스토리를 콘솔에 출력하세요. ```js -const condition1 = /console\.log\(\s*["']Second\s+story:\s+["']\s*\+\s*secondStory\s*\);?/gm.test(code); -const condition2 = /console\.log\(\s*`Second\s+story:\s+\$\{secondStory\}`\s*\);?/gm.test(code); -assert.isTrue(condition1 || condition2); +assert.include(getLogs(), `Second story: ${secondStory}`); ``` `firstStory`는 `secondStory`와 같으면 안 됩니다. @@ -255,3 +258,4 @@ const secondStory = `Once upon a time, there was a(n) ${adjective} ${noun} who l console.log("Second story: " + secondStory); ``` + diff --git a/curriculum/challenges/korean/blocks/lab-weather-app/66f12a88741aeb16b9246c59.md b/curriculum/challenges/korean/blocks/lab-weather-app/66f12a88741aeb16b9246c59.md index 28b8a108b94..84899ad227b 100644 --- a/curriculum/challenges/korean/blocks/lab-weather-app/66f12a88741aeb16b9246c59.md +++ b/curriculum/challenges/korean/blocks/lab-weather-app/66f12a88741aeb16b9246c59.md @@ -333,7 +333,7 @@ assert.strictEqual( ); ``` -`select` 요소 안에는 파리, 런던, 도쿄, 로스앤젤레스, 시카고, 뉴욕 각 도시에 해당하는 6개의 `option` 요소가 있어야 합니다. +빈 첫 번째 옵션 외에, `select` 요소에는 다음 도시 각각에 해당하는 6개의 `option` 요소가 포함되어야 합니다: Paris, London, Tokyo, Los Angeles, Chicago, New York. ```js ['Paris', 'London', 'Tokyo', 'Los Angeles', 'Chicago', 'New York'].forEach( @@ -342,7 +342,7 @@ assert.strictEqual( `select > option[value="${city.toLowerCase()}"]` ); assert.exists(el); - assert.strictEqual(el.innerText.trim(), city); + assert.strictEqual(el.textContent.trim(), city); } ); ``` diff --git a/curriculum/challenges/korean/blocks/learn-about-speculation-and-requests/67eff6af42e8c425d9ff28e3.md b/curriculum/challenges/korean/blocks/learn-about-speculation-and-requests/67eff6af42e8c425d9ff28e3.md index 350cd28a415..3ed2f32b91c 100644 --- a/curriculum/challenges/korean/blocks/learn-about-speculation-and-requests/67eff6af42e8c425d9ff28e3.md +++ b/curriculum/challenges/korean/blocks/learn-about-speculation-and-requests/67eff6af42e8c425d9ff28e3.md @@ -32,7 +32,7 @@ lang: en-US - `Your software is up to date.` - 소프트웨어가 모든 최신 업데이트를 포함하고 있습니다. -- `Is your resume up to date?` - 이력서에 이 사람의 가장 최근 경력이 포함되어 있는지 묻고 있습니다. +- `Is your resume up to date?` - 이 문장은 이력서에 그 사람의 가장 최근 경력이 포함되어 있는지 묻는 것입니다. # --scene-- diff --git a/curriculum/challenges/korean/blocks/learn-basic-css-by-building-a-cafe-menu/5f3ef6e03d719d5ac4738993.md b/curriculum/challenges/korean/blocks/learn-basic-css-by-building-a-cafe-menu/5f3ef6e03d719d5ac4738993.md index c6535935035..a12e00f4d73 100644 --- a/curriculum/challenges/korean/blocks/learn-basic-css-by-building-a-cafe-menu/5f3ef6e03d719d5ac4738993.md +++ b/curriculum/challenges/korean/blocks/learn-basic-css-by-building-a-cafe-menu/5f3ef6e03d719d5ac4738993.md @@ -7,7 +7,7 @@ dashedName: step-56 # --description-- -메뉴의 현재 너비는 항상 `body` 요소 너비의 80%를 차지합니다. 매우 넓은 화면에서는 커피와 디저트가 가격과 너무 멀리 떨어져 보입니다. +현재 메뉴의 너비는 항상 `body` 요소 너비의 `80%`를 차지합니다. 매우 넓은 화면에서는 커피와 디저트가 가격과 멀리 떨어져 보입니다. 너무 넓어지지 않도록 `menu` 클래스에 `max-width` 속성을 `500px` 값으로 추가하세요. @@ -117,3 +117,4 @@ h1, h2, p { width: 25%; } ``` + diff --git a/curriculum/challenges/korean/blocks/learn-how-to-plan-future-events/67531709d628ef047202e6ae.md b/curriculum/challenges/korean/blocks/learn-how-to-plan-future-events/67531709d628ef047202e6ae.md index 33d662cbf9d..7109c88f72f 100644 --- a/curriculum/challenges/korean/blocks/learn-how-to-plan-future-events/67531709d628ef047202e6ae.md +++ b/curriculum/challenges/korean/blocks/learn-how-to-plan-future-events/67531709d628ef047202e6ae.md @@ -12,7 +12,7 @@ lang: en-US # --assignment-- -영상을 시청하세요.. +영상을 시청하세요. # --scene-- diff --git a/curriculum/challenges/korean/blocks/learn-present-perfect-while-talking-about-accessibility/671b98e9b7c4854e93044e64.md b/curriculum/challenges/korean/blocks/learn-present-perfect-while-talking-about-accessibility/671b98e9b7c4854e93044e64.md index a59d9a1a2d2..ca56ddaa687 100644 --- a/curriculum/challenges/korean/blocks/learn-present-perfect-while-talking-about-accessibility/671b98e9b7c4854e93044e64.md +++ b/curriculum/challenges/korean/blocks/learn-present-perfect-while-talking-about-accessibility/671b98e9b7c4854e93044e64.md @@ -1,6 +1,6 @@ --- id: 671b98e9b7c4854e93044e64 -title: "Dialogue 2: Closed Captioning Challenges" +title: "대화 2: 폐쇄 캡션 도전 과제" challengeType: 21 dashedName: dialogue-2-closed-captioning-challenges lang: en-US @@ -62,7 +62,7 @@ lang: en-US "startTime": 5.34, "finishTime": 9.26, "dialogue": { - "text": "Yes, for some reason it hasn't been displaying correctly for some users.", + "text": "Yes. For some reason, it hasn't been displaying correctly for some users.", "align": "right" } }, diff --git a/curriculum/challenges/korean/blocks/learn-present-perfect-while-talking-about-accessibility/671f403c1d4e8a5e046065a0.md b/curriculum/challenges/korean/blocks/learn-present-perfect-while-talking-about-accessibility/671f403c1d4e8a5e046065a0.md index 8106f40bca5..b1edce6a104 100644 --- a/curriculum/challenges/korean/blocks/learn-present-perfect-while-talking-about-accessibility/671f403c1d4e8a5e046065a0.md +++ b/curriculum/challenges/korean/blocks/learn-present-perfect-while-talking-about-accessibility/671f403c1d4e8a5e046065a0.md @@ -6,7 +6,7 @@ dashedName: task-36 lang: en-US --- -<!-- (Audio) James: Yes. For some reason, It hasn't been displaying correctly for some users. --> +<!-- (Audio) James: Yes. For some reason, it hasn't been displaying correctly for some users. --> # --instructions-- @@ -16,7 +16,7 @@ lang: en-US ## --sentence-- -`Yes. For some reason, It BLANK BLANK BLANK correctly for some users.` +`Yes. For some reason, it BLANK BLANK BLANK correctly for some users.` ## --blanks-- @@ -83,7 +83,7 @@ lang: en-US "startTime": 1, "finishTime": 4.92, "dialogue": { - "text": "Yes, for some reason it hasn't been displaying correctly for some users.", + "text": "Yes. For some reason, it hasn't been displaying correctly for some users.", "align": "center" } }, diff --git a/curriculum/challenges/korean/blocks/learn-present-perfect-while-talking-about-accessibility/671f456994635c6085054cbd.md b/curriculum/challenges/korean/blocks/learn-present-perfect-while-talking-about-accessibility/671f456994635c6085054cbd.md index 04d01194eeb..db01fa5fbd1 100644 --- a/curriculum/challenges/korean/blocks/learn-present-perfect-while-talking-about-accessibility/671f456994635c6085054cbd.md +++ b/curriculum/challenges/korean/blocks/learn-present-perfect-while-talking-about-accessibility/671f456994635c6085054cbd.md @@ -1,12 +1,12 @@ --- id: 671f456994635c6085054cbd -title: 작업 37 +title: 도전 과제 37 challengeType: 22 dashedName: task-37 lang: en-US --- -<!-- (Audio) James: Yes. For some reason, It hasn't been displaying correctly for some users. --> +<!-- (Audio) James: Yes. For some reason, it hasn't been displaying correctly for some users. --> # --instructions-- @@ -16,7 +16,7 @@ lang: en-US ## --sentence-- -`Yes. For some reason, It hasn't been displaying BLANK for some BLANK.` +`Yes. For some reason, it hasn't been displaying BLANK for some BLANK.` ## --blanks-- @@ -79,7 +79,7 @@ lang: en-US "startTime": 1, "finishTime": 4.92, "dialogue": { - "text": "Yes, for some reason it hasn't been displaying correctly for some users.", + "text": "Yes. For some reason, it hasn't been displaying correctly for some users.", "align": "center" } }, diff --git a/curriculum/challenges/korean/blocks/learn-present-perfect-while-talking-about-accessibility/6720cf38beae8c4f1d7af1c0.md b/curriculum/challenges/korean/blocks/learn-present-perfect-while-talking-about-accessibility/6720cf38beae8c4f1d7af1c0.md index 731fed73521..e31356ad09c 100644 --- a/curriculum/challenges/korean/blocks/learn-present-perfect-while-talking-about-accessibility/6720cf38beae8c4f1d7af1c0.md +++ b/curriculum/challenges/korean/blocks/learn-present-perfect-while-talking-about-accessibility/6720cf38beae8c4f1d7af1c0.md @@ -1,6 +1,6 @@ --- id: 6720cf38beae8c4f1d7af1c0 -title: 도전 과제 55 +title: 작업 55 challengeType: 22 dashedName: task-55 lang: en-US @@ -22,7 +22,7 @@ lang: en-US `Alice: James, have you heard about the BLANK on our video platform?` -`James: Yes. For some reason, It hasn't been BLANK for some users. The captions are misaligned and BLANK, which isn't good for accessibility.` +`James: Yes. For some reason, it hasn't been BLANK for some users. The captions are misaligned and BLANK, which isn't good for accessibility.` `Alice: Exactly. Do you know if it's been affecting all the videos or just a few?` diff --git a/curriculum/challenges/korean/blocks/lecture-css-specificity-the-cascade-algorithm-and-inheritance/672aa62178d5ff57fe4f98e0.md b/curriculum/challenges/korean/blocks/lecture-css-specificity-the-cascade-algorithm-and-inheritance/672aa62178d5ff57fe4f98e0.md index cdcee97bafe..9a8bebee210 100644 --- a/curriculum/challenges/korean/blocks/lecture-css-specificity-the-cascade-algorithm-and-inheritance/672aa62178d5ff57fe4f98e0.md +++ b/curriculum/challenges/korean/blocks/lecture-css-specificity-the-cascade-algorithm-and-inheritance/672aa62178d5ff57fe4f98e0.md @@ -43,14 +43,14 @@ p { ```html <link rel="stylesheet" href="styles.css"> -<p id="para">Red paragraph</p> +<p id="para-1">Red paragraph</p> <p>Other paragraph</p> <p>Another paragraph</p> <p>Yet another paragraph</p> ``` ```css -#para { +#para-1 { color: red; } @@ -67,24 +67,33 @@ p { **참고**: 가상 클래스에 대해서는 앞으로 수업에서 더 배우게 됩니다. -이 예제에서 첫 번째 문단은 ID 선택자가 클래스와 타입 선택자보다 높은 특이성을 가지므로 빨간색이 됩니다. `.example-para` 요소들은 녹색으로 표시되고 나머지 문단 요소들은 파란색이 됩니다. +이 예시에서는: + +- 첫 번째 문단은 ID 선택자가 클래스와 타입 선택자보다 높은 특이성을 가지므로 빨간색이 됩니다. +- 두 번째 문단은 `.example-para` 클래스 선택자가 적용되어 녹색이 됩니다. +- 세 번째 문단은 `#para-3` ID 선택자와 `.example-para` 클래스 선택자가 모두 적용되어 보라색이 됩니다. +- 나머지 문단 요소는 파란색이 됩니다. :::interactive_editor ```html <link rel="stylesheet" href="styles.css"> -<p id="para">Example paragraph</p> +<p id="para-1">Example paragraph</p> <p class="example-para">Other paragraph</p> -<p class="example-para">Another paragraph</p> +<p id="para-3" class="example-para">Another paragraph</p> <p>Yet another paragraph</p> ``` ```css -#para { +#para-1 { color: red; } +#para-3 { + color: purple; +} + .example-para { color: green; } @@ -105,13 +114,13 @@ p { ```html <link rel="stylesheet" href="styles.css"> -<p id="para">Example paragraph</p> +<p id="para-1">Example paragraph</p> <p>Other paragraph</p> <p>Yet another paragraph</p> ``` ```css -#para { +#para-1 { color: red; } @@ -130,7 +139,7 @@ p { ```html <link rel="stylesheet" href="styles.css"> -<p id="para">Example paragraph</p> +<p id="para-1">Example paragraph</p> <p>Other paragraph</p> <p>Yet another paragraph</p> ``` @@ -140,7 +149,7 @@ p { color: red; } -#para { +#para-1 { color: green; } diff --git a/curriculum/challenges/korean/blocks/lecture-express-middleware/69f42d414b7626e21a922794.md b/curriculum/challenges/korean/blocks/lecture-express-middleware/69f42d414b7626e21a922794.md index c77717d0ac2..ec6e68ad136 100644 --- a/curriculum/challenges/korean/blocks/lecture-express-middleware/69f42d414b7626e21a922794.md +++ b/curriculum/challenges/korean/blocks/lecture-express-middleware/69f42d414b7626e21a922794.md @@ -9,9 +9,7 @@ dashedName: what-is-error-handling-middleware Express의 에러 핸들링 미들웨어는 요청-응답 주기 중에 발생하는 에러를 처리하는 특별한 유형의 미들웨어입니다. 예기치 않은 에러를 잡아내고, 기록하며, 클라이언트에 적절한 응답을 제공하는 데 필수적입니다. -이전 수업에서 에러 핸들링에 대해 배운 것처럼, Express 에러 핸들링 미들웨어는 네 개의 매개변수 `err`, `req`, `res`, `next`를 가집니다. 이 미들웨어는 에러가 `next()` 함수에 전달될 때 호출됩니다. - -다시 한 번 구문을 상기해 보세요: +Express 에러 처리 미들웨어는 네 개의 매개변수 `err`, `req`, `res`, `next`를 가집니다. 이 미들웨어는 에러가 `next()` 함수에 전달될 때 호출됩니다. 구문은 다음과 같습니다: ```js app.use((err, req, res, next) => { diff --git a/curriculum/challenges/korean/blocks/lecture-express-middleware/69f42d414b7626e21a922795.md b/curriculum/challenges/korean/blocks/lecture-express-middleware/69f42d414b7626e21a922795.md index 3b497d585fe..f64a7dee39c 100644 --- a/curriculum/challenges/korean/blocks/lecture-express-middleware/69f42d414b7626e21a922795.md +++ b/curriculum/challenges/korean/blocks/lecture-express-middleware/69f42d414b7626e21a922795.md @@ -13,45 +13,45 @@ Express는 정적 파일 제공, JSON 요청 본문 파싱 등 일반적인 작 1. `express.json()`: 들어오는 JSON 페이로드를 파싱하는 내장 미들웨어입니다. -```js -app.use(express.json()) -``` + ```js + app.use(express.json()) + ``` 1. `express.static()`: 이미지, CSS, JavaScript 파일과 같은 정적 파일을 제공하는 미들웨어입니다. -```js -app.use(express.static('public')) -``` + ```js + app.use(express.static('public')) + ``` 1. `express.urlencoded()`: HTML 폼에서 주로 보내는 URL 인코딩된 페이로드를 파싱하는 미들웨어입니다. 파싱된 데이터는 `req.body`에서 사용할 수 있습니다. -```js -app.use(express.urlencoded({ extended: true })) -``` + ```js + app.use(express.urlencoded({ extended: true })) + ``` **이제 서드파티 미들웨어의 몇 가지 예시를 살펴보겠습니다:** 1. `cors`: 교차 출처 리소스 공유(CORS)를 활성화하는 인기 있는 서드파티 미들웨어입니다. -```bash -npm install cors -``` + ```bash + npm install cors + ``` -```js -const cors = require('cors') -app.use(cors()) -``` + ```js + const cors = require('cors') + app.use(cors()) + ``` 1. `morgan`: HTTP 요청을 기록하는 로깅 미들웨어입니다. -```bash -npm install morgan -``` + ```bash + npm install morgan + ``` -```js -const morgan = require('morgan') -app.use(morgan('tiny')) -``` + ```js + const morgan = require('morgan') + app.use(morgan('tiny')) + ``` 이제 내장 미들웨어와 서드파티 미들웨어를 함께 사용하는 예시를 살펴보겠습니다: diff --git a/curriculum/challenges/korean/blocks/lecture-importance-of-semantic-html/672990ecf71a852804ababe7.md b/curriculum/challenges/korean/blocks/lecture-importance-of-semantic-html/672990ecf71a852804ababe7.md index 1c381f4bdf2..e4ac0ebb24e 100644 --- a/curriculum/challenges/korean/blocks/lecture-importance-of-semantic-html/672990ecf71a852804ababe7.md +++ b/curriculum/challenges/korean/blocks/lecture-importance-of-semantic-html/672990ecf71a852804ababe7.md @@ -11,6 +11,10 @@ dashedName: what-is-the-difference-between-presentational-and-semantic-html 많은 프레젠테이션 HTML 요소는 더 이상 권장되지 않는 폐기된 요소입니다. 같은 결과를 얻을 수 있는 더 나은 방법들이 있습니다. 하지만 이들이 존재한다는 것을 아는 것이 도움이 되므로 몇 가지 예를 살펴보겠습니다. +## 표현용 HTML 요소 + +### `font` 요소 + `font` 요소는 텍스트의 폰트 크기와 색상을 설정하는 데 사용되던 폐기된 요소입니다. 다음은 `font` 요소의 예입니다. 인터랙티브 편집기를 활성화하고 크기를 5에서 7로 변경하여 폰트가 커지는 것을 확인하세요. @@ -27,6 +31,8 @@ dashedName: what-is-the-difference-between-presentational-and-semantic-html 이 요소는 여전히 작동하지만, 폰트 크기와 색상은 항상 HTML이 아닌 CSS에서 설정해야 하므로 사용하지 않아야 합니다. +### `center` 요소 + `center` 요소는 컨테이너 내에서 콘텐츠를 수평으로 가운데 정렬하는 데 사용되던 또 다른 폐기된 요소입니다. 다음은 텍스트와 단락 요소를 포함하는 `center` 요소의 예입니다. 인터랙티브 편집기를 활성화하고 `center` 태그를 `<p>Another example text.</p>` 주위에 추가하여 페이지 중앙에 정렬되는 것을 확인하세요. @@ -44,6 +50,8 @@ dashedName: what-is-the-difference-between-presentational-and-semantic-html ::: +### `big` 요소 + 다음은 `big` 요소입니다. 이것도 폐기된 프레젠테이션 HTML 요소로, 감싸진 텍스트를 주변 텍스트보다 한 단계 크게 만듭니다. 여기 두 부분으로 나뉜 단락 예제가 있습니다. 인터랙티브 편집기를 활성화하고 `big` 태그를 `Some other text` 주위에 추가하여 미리보기 창에서 변화를 확인하세요. @@ -64,6 +72,8 @@ dashedName: what-is-the-difference-between-presentational-and-semantic-html 이들은 프레젠테이션 HTML 요소의 예시였습니다. 하지만 모두 폐기되어 더 이상 권장되지 않습니다. 그렇다면 대신 무엇을 사용해야 할까요? 살펴보겠습니다. +## 의미론적 HTML + 시맨틱 HTML이 이제 권장되는 방법입니다. 시맨틱 HTML은 요소의 콘텐츠를 설명하므로 읽고 이해하며 유지보수하기 훨씬 쉽습니다. 검색 엔진은 시맨틱 HTML을 사용하면 웹사이트를 쉽게 이해할 수 있습니다. 또한 화면 읽기 프로그램이 웹 페이지의 내용을 설명하는 데 시맨틱 정보가 필요하기 때문에 접근성 측면에서도 도움이 됩니다. @@ -75,6 +85,8 @@ dashedName: what-is-the-difference-between-presentational-and-semantic-html - 관련 정보를 그룹화하는 `section` 요소 - 삽화와 도표를 위한 `figure` 요소 +### 의미론적 HTML 예시 + 다음은 내비게이션 섹션 요소를 포함하는 `header` 요소의 예입니다. 인터랙티브 편집기를 활성화하고 `<a href="#">Products</a>`를 `nav` 안에 추가하여 미리보기 창에서 변화를 확인하세요. @@ -97,6 +109,8 @@ dashedName: what-is-the-difference-between-presentational-and-semantic-html 시맨틱 요소는 HTML 구조 내에서 그 목적을 명확히 나타냅니다. 다양한 시맨틱 HTML 요소가 있으니 프로젝트에 맞는 요소를 꼭 찾을 수 있을 것입니다. +## 요약 + 잘하셨습니다. 이제 프레젠테이션 HTML과 시맨틱 HTML의 차이를 알게 되었습니다: 시맨틱 HTML은 콘텐츠를 설명하고, 프레젠테이션 HTML은 외관에 중점을 둡니다. # --questions-- diff --git a/curriculum/challenges/korean/blocks/lecture-introduction-to-javascript-libraries-and-frameworks/6734e88cc46e6dc679420040.md b/curriculum/challenges/korean/blocks/lecture-introduction-to-javascript-libraries-and-frameworks/6734e88cc46e6dc679420040.md index 8525e518b7f..8e2c4190399 100644 --- a/curriculum/challenges/korean/blocks/lecture-introduction-to-javascript-libraries-and-frameworks/6734e88cc46e6dc679420040.md +++ b/curriculum/challenges/korean/blocks/lecture-introduction-to-javascript-libraries-and-frameworks/6734e88cc46e6dc679420040.md @@ -13,7 +13,7 @@ dashedName: what-is-vite-and-how-can-it-be-used-to-set-up-a-new-react-project Vite로 새 프로젝트를 만들려면 명령줄을 사용해야 합니다. Windows를 사용 중이라면 명령 프롬프트나 Windows PowerShell을 사용할 수 있습니다. Mac을 사용 중이라면 터미널 앱을 사용하세요. -npm이 작동하려면 필요한 Node.js가 설치되어 있지 않은 경우, 공식 Node.js 웹페이지 https://nodejs.org 링크가 있습니다. 설치 지침을 따라 설치한 후 여기로 돌아와 React 설치를 계속하세요. +npm가 작동하는 데 필요한 Node.js가 설치되어 있지 않다면, 공식 Node.js 웹페이지인 [nodejs.org](https://nodejs.org)로 이동하세요. 설치 지침을 따라 완료한 후 여기로 돌아와 React 설치를 계속하세요. 명령줄을 열었으면 다음 명령어를 사용할 수 있습니다: @@ -36,7 +36,7 @@ npm install `cd my-react-app` 명령어는 프로젝트가 위치한 올바른 디렉터리로 이동하는 것을 보장합니다. -`npm install` 명령어는 React 프로젝트를 제대로 실행하는 데 필요한 의존성을 설치하는 데 사용됩니다. 의존성은 React 자체, ReactDOM, 또는 추가 기능을 제공하는 다른 서드파티 패키지처럼 React 프로젝트가 제대로 작동하려면 필요한 라이브러리나 패키지입니다. +`npm install` 명령은 React 프로젝트를 제대로 실행하는 데 필요한 의존성을 설치하는 데 사용됩니다. 의존성은 React 자체, `react-dom` 또는 추가 기능을 제공하는 다른 서드파티 패키지처럼 React 프로젝트가 제대로 작동하려면 필요한 라이브러리나 패키지입니다. `npm install`을 실행하면 프로젝트 디렉터리 내 `package.json` 파일을 읽어 거기에 나열된 모든 의존성을 설치하여 필요한 구성 요소 없이 React 앱을 빌드하고 실행할 수 있게 합니다. @@ -50,11 +50,11 @@ npm install Vite가 제공한 시작 템플릿을 볼 수 있을 것입니다. -로컬 서버를 중지하려면 명령줄에서 `CTRL + C`를 누르세요. +로컬 서버를 중지해야 하면 명령줄에서 `Ctrl + C`를 누르세요. -이 시작 템플릿의 코드를 실제로 보려면 프로젝트 내 `src` 폴더로 들어가 `App.jsx` 파일을 확인하세요. +이 시작 템플릿의 코드를 실제로 보려면 프로젝트 내 `src` 폴더를 열면 `App.jsx` 파일을 볼 수 있습니다. -그다음 파일을 수정하고 저장하면 브라우저에서 변경된 내용을 바로 확인할 수 있습니다. +그곳에서 파일을 수정하고 변경 사항을 저장한 다음 브라우저에서 변경된 내용을 확인하세요. 이제 React 애플리케이션 개발을 시작할 준비가 되었습니다! diff --git a/curriculum/challenges/korean/blocks/lecture-introduction-to-javascript/672d49959621885e9d3e672c.md b/curriculum/challenges/korean/blocks/lecture-introduction-to-javascript/672d49959621885e9d3e672c.md index 07ad9939737..8a1f4fe13f1 100644 --- a/curriculum/challenges/korean/blocks/lecture-introduction-to-javascript/672d49959621885e9d3e672c.md +++ b/curriculum/challenges/korean/blocks/lecture-introduction-to-javascript/672d49959621885e9d3e672c.md @@ -72,6 +72,16 @@ console.log(age); // 25 ::: +`let`으로 선언한 변수는 재할당할 수 있지만, 재선언할 수는 없습니다. 같은 변수를 다시 `let`으로 선언하려고 하면 오류가 발생합니다: + +```js +let age = 25; + +let age = 90; // SyntaxError: Identifier 'age' has already been declared +``` + +`const`도 마찬가지입니다: `const`로 선언한 변수도 재선언할 수 없습니다. + `const`로 선언된 변수는 선언 시 반드시 값을 할당해야 합니다. 값을 할당하지 않고 `const` 변수를 선언하려 하면 오류가 발생합니다: ```js diff --git a/curriculum/challenges/korean/blocks/lecture-understanding-aria-expanded-aria-live-and-common-aria-states/672a54dff9dc439089f1a219.md b/curriculum/challenges/korean/blocks/lecture-understanding-aria-expanded-aria-live-and-common-aria-states/672a54dff9dc439089f1a219.md index 53c0ec408ae..e604150f20f 100644 --- a/curriculum/challenges/korean/blocks/lecture-understanding-aria-expanded-aria-live-and-common-aria-states/672a54dff9dc439089f1a219.md +++ b/curriculum/challenges/korean/blocks/lecture-understanding-aria-expanded-aria-live-and-common-aria-states/672a54dff9dc439089f1a219.md @@ -1,6 +1,6 @@ --- id: 672a54dff9dc439089f1a219 -title: aria-live 속성이란 무엇이며 어떻게 작동하나요? +title: Aria-live 속성이란 무엇이며 어떻게 작동하나요? challengeType: 19 dashedName: what-is-the-aria-live-attribute --- @@ -15,6 +15,8 @@ dashedName: what-is-the-aria-live-attribute 이 속성에는 정보의 우선순위에 따라 세 가지 가능한 값이 있습니다. +## `assertive` 값 + `aria-live`을 `assertive` 값으로 설정하면 업데이트가 매우 중요하다는 뜻입니다. 가장 높은 우선순위이므로 즉시 사용자에게 알림이 가야 합니다. 이 경우 화면 읽기 프로그램은 현재 진행 중인 안내를 중단하고 라이브 영역의 콘텐츠 변경을 알립니다. 이런 중단은 매우 방해가 될 수 있으므로 `assertive` 값은 시간에 민감하거나 중요한 알림에만 사용해야 합니다. @@ -81,6 +83,8 @@ document.addEventListener("DOMContentLoaded", () => { ::: +## `polite` 값 + 다음 우선순위 값은 `polite`입니다. 이 값은 업데이트가 긴급하지 않으므로 화면 읽기 프로그램이 현재 안내가 끝나거나 사용자가 입력을 멈출 때까지 기다렸다가 업데이트를 알릴 수 있음을 의미합니다. 대부분의 라이브 영역은 `polite` 값을 사용합니다. @@ -147,10 +151,16 @@ document.addEventListener("DOMContentLoaded", () => { ::: +## `off` 값 + `aria-live`의 가장 낮은 우선순위 값은 `off`으로, 업데이트가 키보드 포커스가 있는 요소에 있을 때만 알림이 간다는 뜻입니다. 현실적으로 이 값은 사용 사례가 매우 제한적이고 화면 읽기 프로그램마다 일관되게 구현되지 않아 거의 사용되지 않습니다. 라이브 영역이 필요하다면 중요한 메시지에 `polite`을 사용하는 경우를 제외하고는 모두 `assertive`을 사용할 계획을 세우세요. +## ARIA 역할에서 기본 라이브 영역 + 또한 업데이트된 정보가 `aria-live`, `alert`, `log`, `marquee`, `status` 역할을 가진 요소에 포함되어 있다면 `timer` 속성은 필수가 아닙니다. 이 역할들은 기본 `aria-live` 값을 이미 가지고 있기 때문입니다. 하지만 명시적으로 `aria-live`을 설정하여 기본값을 변경할 수 있습니다. +## 올바른 값 선택하기 + 적절한 `aria-live` 값을 선택하는 것은 업데이트 정보의 우선순위에 달려 있습니다. 업데이트가 긴급하다면 `assertive`으로 즉시 사용자에게 알림을 보내야 합니다. 하지만 갑작스러운 중단은 사용자를 혼란스럽게 하고 사용자 경험에 영향을 줄 수 있으므로 정말 긴급한 경우에만 사용하세요. diff --git a/curriculum/challenges/korean/blocks/lecture-understanding-computer-internet-and-tooling-basics/672aa578a2129554d4675049.md b/curriculum/challenges/korean/blocks/lecture-understanding-computer-internet-and-tooling-basics/672aa578a2129554d4675049.md index c716cb09c2d..46241e4c33a 100644 --- a/curriculum/challenges/korean/blocks/lecture-understanding-computer-internet-and-tooling-basics/672aa578a2129554d4675049.md +++ b/curriculum/challenges/korean/blocks/lecture-understanding-computer-internet-and-tooling-basics/672aa578a2129554d4675049.md @@ -11,13 +11,13 @@ dashedName: what-are-the-basic-parts-of-a-computer 개발자로서 컴퓨터의 기본 내부 작동 방식을 이해하는 것이 중요합니다. -컴퓨터의 첫 번째 주요 컴포넌트는 마더보드입니다. 마더보드는 컴퓨터를 작동하는 데 필요한 모든 메모리와 연결 장치를 담고 있습니다. 컴퓨터의 주요 회로 기판 역할을 합니다. +컴퓨터의 첫 번째 주요 컴포넌트는 마더보드입니다. 마더보드는 컴퓨터를 작동하는 데 필요한 모든 메모리와 커넥터를 담고 있습니다. 컴퓨터의 주요 회로 기판 역할을 합니다. -마더보드가 있는 컴퓨터 케이스 내부에는 CPU가 있습니다. CPU는 중앙 처리 장치(Central Processing Unit)를 의미합니다. CPU는 명령을 실행하고 계산을 수행하는 프로세서입니다. 흔히 컴퓨터의 두뇌라고 불립니다. +컴퓨터 케이스 안, 마더보드에 장착된 곳에서 CPU를 찾을 수 있습니다. CPU는 Central Processing Unit의 약자입니다. CPU는 명령을 실행하고 계산을 수행하는 프로세서로, 종종 컴퓨터의 두뇌라고 불립니다. -CPU는 마더보드의 CPU 소켓에 꽂히는 작은 정사각형 칩입니다. CPU 프로세서 속도는 기가헤르츠(GHz)와 메가헤르츠(MHz) 단위로 측정합니다. 기가헤르츠는 초당 10억 사이클, 메가헤르츠는 초당 100만 사이클을 의미합니다. +CPU는 마더보드의 CPU 소켓에 들어가는 작은 정사각형 칩입니다. CPU 속도는 기가헤르츠(GHz)와 메가헤르츠(MHz)로 측정합니다. 기가헤르츠는 초당 10억 사이클, 메가헤르츠는 초당 100만 사이클을 의미합니다. -컴퓨터의 다음 중요한 컴포넌트는 시스템의 단기 메모리입니다. 이것은 RAM 또는 임의 접근 메모리(Random Access Memory)라고 합니다. RAM은 컴퓨터 CPU가 임시로 데이터를 저장하는 장소입니다. 컴퓨터가 데이터를 빠르게 접근해야 할 때 RAM을 사용합니다. +컴퓨터의 다음 중요한 컴포넌트는 시스템의 단기 메모리입니다. 이것은 RAM, 즉 Random Access Memory로 알려져 있습니다. RAM은 컴퓨터 CPU가 임시로 데이터를 저장하는 장소입니다. 컴퓨터가 데이터를 빠르게 접근해야 할 때마다 RAM을 사용합니다. 컴퓨터에 RAM이 많을수록 더 빠르게 작동하고 동시에 더 많은 프로그램을 실행할 수 있습니다. RAM이 부족하면 컴퓨터가 느려지고 성능 차이를 느낄 수 있습니다. @@ -27,13 +27,13 @@ RAM은 휘발성 메모리라는 점을 기억하세요. 즉, 컴퓨터 전원 하드 드라이브는 회전하는 플래터와 암으로 구성됩니다. 플래터는 데이터가 저장되는 곳이고, 암은 플래터에 데이터를 읽고 쓰는 역할을 합니다. 하드 드라이브가 빠를수록 컴퓨터가 더 빨리 부팅되고 프로그램도 더 빠르게 실행됩니다. -또 다른 데이터 저장 장치로는 솔리드 스테이트 드라이브(SSD)가 있습니다. SSD는 비휘발성 플래시 메모리로 하드 드라이브 대신 사용할 수 있습니다. SSD는 하드 드라이브보다 빠르고 작지만, 하드 드라이브는 더 저렴하고 저장 용량이 더 큽니다. +또 다른 데이터 저장 장치는 Solid State Drive, 줄여서 SSD입니다. SSD는 비휘발성 플래시 메모리로 하드 드라이브 대신 사용할 수 있습니다. SSD는 하드 드라이브보다 빠르고 작지만, 하드 드라이브는 더 저렴하고 저장 용량이 더 큽니다. 컴퓨터의 또 다른 주요 컴포넌트는 전원 공급 장치(PSU)입니다. PSU는 벽면 콘센트에서 들어오는 전기를 컴퓨터가 사용할 수 있는 형태로 변환합니다. 전원을 콘센트에서 마더보드, CPU, 그리고 다른 컴포넌트로 전달합니다. -또 다른 주요 컴포넌트는 확장 카드입니다. 이 카드들은 마더보드에 꽂아 컴퓨터에 추가 기능을 더합니다. 확장 카드의 예로는 비디오 카드, 사운드 카드, 네트워크 카드가 있습니다. +또 다른 주요 컴포넌트는 확장 카드입니다. 이 카드들은 컴퓨터에 추가 기능을 더하기 위해 마더보드에 삽입됩니다. 확장 카드의 예로는 비디오 카드, 사운드 카드, 네트워크 카드가 있습니다. -비디오 카드, 즉 그래픽 처리 장치(GPU)는 컴퓨터 화면에 시각적 이미지를 렌더링하는 역할을 합니다. +비디오 카드, 또는 Graphics Processing Unit(GPU)은 컴퓨터 화면에 시각적 요소를 렌더링하는 역할을 합니다. 사운드 카드는 컴퓨터 스피커에서 소리를 재생하는 역할을 합니다. @@ -53,7 +53,7 @@ RAM이란 무엇인가요? ### --feedback-- -단기 데이터 저장소에 대해 생각해 보세요. +단기 데이터 저장을 생각해 보세요. --- @@ -65,7 +65,7 @@ RAM이란 무엇인가요? ### --feedback-- -단기 데이터 저장소에 대해 생각해 보세요. +단기 데이터 저장을 생각해 보세요. --- @@ -73,7 +73,7 @@ RAM이란 무엇인가요? ### --feedback-- -단기 데이터 저장소에 대해 생각해 보세요. +단기 데이터 저장을 생각해 보세요. ## --video-solution-- @@ -141,11 +141,11 @@ CPU는 무엇의 약자인가요? --- -단기 메모리를 저장합니다. +단기 메모리를 저장하는 것입니다. ### --feedback-- -수업 끝부분을 다시 검토하세요. +수업 마지막 부분을 검토하세요. ## --video-solution-- diff --git a/curriculum/challenges/korean/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab82c1a9bbd0e3aabc39d.md b/curriculum/challenges/korean/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab82c1a9bbd0e3aabc39d.md index cb438d61ebe..6b37a0eda6d 100644 --- a/curriculum/challenges/korean/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab82c1a9bbd0e3aabc39d.md +++ b/curriculum/challenges/korean/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab82c1a9bbd0e3aabc39d.md @@ -7,11 +7,11 @@ dashedName: how-to-effectively-work-with-your-keyboard-mouse-and-other-pointing- # --description-- -여러분 중 많은 분이 게임, 업무 수행, 웹 서핑 등 다양한 활동을 위해 수년간 키보드와 마우스를 사용해 왔을 것입니다. +여러분 중 많은 분이 게임, 업무 수행, 웹 서핑 등 다양한 활동을 위해 수년간 키보드와 마우스를 사용해 왔습니다. 하지만 이러한 장치를 장시간 잘못 사용하면 나중에 심각한 건강 문제로 이어질 수 있습니다. -이번 수업에서는 컴퓨터의 키보드와 마우스를 건강하게 사용하는 방법을 다룹니다. +이 수업에서는 컴퓨터의 키보드와 마우스를 건강하게 사용하는 방법을 다룹니다. 첫 번째 팁은 마우스 잡는 법에 주의하는 것입니다. 업무에 집중하거나 격렬한 게임을 할 때 마우스를 너무 세게 잡는 경향이 있을 수 있습니다. 하지만 이렇게 하면 손과 손목에 심각한 문제가 생길 수 있습니다. 이를 예방하려면 마우스를 부드럽게 잡고 손가락을 편안하게 유지하세요. @@ -25,7 +25,7 @@ dashedName: how-to-effectively-work-with-your-keyboard-mouse-and-other-pointing- 좋은 자세를 유지하는 것도 중요하지만, 현대 인체공학은 움직임과 역동적인 앉기를 강조합니다. 인체는 움직이도록 설계되었으며, 똑바른 자세라도 너무 오래 고정되어 있으면 척추에 지속적인 압력이 가해집니다. 규칙적으로 휴식을 취하고, 하루 동안 자세를 조절하며, 손목을 자연스러운 위치에 두면 혈액 순환이 개선되고 피로가 줄며 척추 건강을 유지하는 데 도움이 됩니다. -마지막 팁은 가능한 한 키보드 단축키를 사용해 타이핑을 최소화하는 것입니다. 웹 탐색, 운영체제 내비게이션, 코드 편집기 작업 등 다양한 작업에 수십 가지 단축키가 있습니다. 따라서 이러한 키보드 단축키를 조사하고 일상적인 컴퓨터 사용에 적용하는 것이 좋습니다. +마지막 팁은 가능한 한 키보드 단축키를 사용해 마우스를 잡는 횟수를 줄이는 것입니다. 웹 탐색, 운영 체제 내 이동, 코드 편집기 작업 등 다양한 작업에 사용할 수 있는 수십 가지 단축키가 있습니다. 따라서 이러한 키보드 단축키를 조사하고 일상적인 컴퓨터 사용에 적용하기 시작하는 것이 좋습니다. 앞으로 코딩 프로젝트와 기타 활동에 마우스와 키보드를 계속 사용할 때 이 건강 팁들을 기억하세요. @@ -109,7 +109,7 @@ dashedName: how-to-effectively-work-with-your-keyboard-mouse-and-other-pointing- ## --answers-- -마우스가 키보드보다 훨씬 높아야 합니다. +마우스 높이는 중요하지 않습니다. ### --feedback-- diff --git a/curriculum/challenges/korean/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab83c4297910eade53c2e.md b/curriculum/challenges/korean/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab83c4297910eade53c2e.md index 3346e078c82..dc563a937e5 100644 --- a/curriculum/challenges/korean/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab83c4297910eade53c2e.md +++ b/curriculum/challenges/korean/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab83c4297910eade53c2e.md @@ -7,13 +7,13 @@ dashedName: what-are-the-different-types-of-internet-service-providers # --description-- -먼저, 인터넷 서비스 제공자(ISP)란 무엇일까요? 기본적으로 전 세계 인터넷 네트워크에 대한 접근을 판매하는 회사입니다. 그리고 이들은 세 가지 다른 계층으로 나뉩니다. +먼저, 인터넷 서비스 제공자(ISP)란 무엇일까요? 기본적으로 전 세계 인터넷 네트워크에 대한 접근을 판매하는 회사입니다. 그리고 이들은 세 가지 다른 등급으로 나뉩니다. -첫 번째 계층은 대부분(또는 전부)의 네트워크 트래픽을 독립적으로 처리할 수 있는 인프라를 가진 거대 대기업입니다. +첫 번째 등급은 대부분(또는 전부)의 네트워크 트래픽을 독립적으로 처리할 수 있는 인프라를 가진 거대 대기업입니다. -두 번째 계층은 전국 단위 제공자로, 때로는 1계층 네트워크에 접근을 임대하지만 꽤 독자적으로 운영할 수 있습니다. +두 번째 등급은 전국 단위 제공자로, 때때로 1등급 네트워크에 대한 접근을 임대하지만 꽤 독자적으로 운영할 수 있습니다. -세 번째 계층은 주로 지역 시장에 인터넷을 제공하는 소규모 회사들로, 인프라는 더 큰 ISP에 의존합니다. +세 번째 등급은 주로 지역 시장에 인터넷을 제공하는 데 집중하며, 인프라를 제공하는 더 큰 ISP에 의존하는 소규모 회사입니다. 이 제공자들은 또한 다양한 유형의 연결 방식을 제공합니다. @@ -25,7 +25,7 @@ DSL 연결은 유선 전화 서비스 인프라를 사용합니다. 이 인프 다이얼업 연결도 전화선을 사용하지만, 인터넷에 연결되면 전화선 사용이 배타적으로 제한됩니다(전화 용도로 사용할 수 없음). 이 기술은 훨씬 오래된 것으로 현재는 거의 사용되지 않습니다. -위성 연결은 지구를 도는 여러 위성을 이용해 전 세계 다양한 장치를 연결합니다. 마지막으로, 이와 비슷하게 5G 가정용 인터넷 제공자는 기지국 인프라를 사용해 온라인 상태를 유지합니다. +위성 연결은 지구를 도는 여러 위성을 사용해 전 세계 다양한 장치를 연결합니다. 마지막으로, 이와 비슷하게 5G 가정용 인터넷 제공자는 기지국 인프라를 이용해 온라인 상태를 유지합니다. 이로써 인터넷 서비스 제공자와 인터넷 연결 유형에 대한 기본 개요를 알 수 있습니다! @@ -33,7 +33,7 @@ DSL 연결은 유선 전화 서비스 인프라를 사용합니다. 이 인프 ## --text-- -다음 중 인터넷 서비스 제공자(ISP)의 계층이 아닌 것은 무엇인가요? +다음 중 인터넷 서비스 제공자(ISP)의 등급이 아닌 것은 무엇인가요? ## --answers-- @@ -69,7 +69,7 @@ DSL 연결은 유선 전화 서비스 인프라를 사용합니다. 이 인프 ## --text-- -빛을 통해 데이터를 전송하는 데 유리 또는 플라스틱 섬유를 사용하는 인터넷 연결 유형은 무엇인가요? +어떤 유형의 인터넷 연결이 유리 또는 플라스틱 섬유를 통해 빛으로 데이터를 전송하나요? ## --answers-- @@ -121,7 +121,7 @@ DSL 연결. --- -지구를 도는 여러 위성을 사용한다. +이들은 지구를 도는 여러 위성을 사용합니다. ### --feedback-- diff --git a/curriculum/challenges/korean/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab8573f32480f192aaae1.md b/curriculum/challenges/korean/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab8573f32480f192aaae1.md index 7fd2cb5a826..46cbc5c15a4 100644 --- a/curriculum/challenges/korean/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab8573f32480f192aaae1.md +++ b/curriculum/challenges/korean/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab8573f32480f192aaae1.md @@ -9,7 +9,7 @@ dashedName: what-are-the-different-types-of-tools-professional-developers-use 전문 개발자는 생산성과 코드 품질을 높이기 위해 다양한 도구를 사용합니다. 아주 명확해 보이는 도구들도 포함해서 그런 도구들을 함께 알아보겠습니다. -도구 중 가장 먼저 꼽히는 것은 컴퓨터입니다. 컴퓨터는 기본 개발 환경입니다. 무거운 데스크톱일 수도 있고, Windows, macOS, Linux 운영체제를 사용하는 휴대용 노트북일 수도 있습니다. +첫 번째 도구는 컴퓨터 자체입니다. 컴퓨터는 기본 개발 환경입니다. 운영체제로 Windows, macOS, 또는 Linux가 설치된 무거운 데스크톱이나 휴대용 노트북일 수 있습니다. 전문 개발자는 자원 집약적인 작업을 처리하기 위해 빠른 처리 속도와 충분한 RAM을 갖춘 컴퓨터를 선호합니다. @@ -21,7 +21,7 @@ Visual Studio Code(VS Code)는 본질적으로 코드 편집기이지만, 풍부 다른 코드 편집기로는 Sublime Text, Atom, Notepad++, Brackets가 있습니다. -코드 편집기와 IDE로 코드를 작성할 때, 변경 사항을 추적해야 합니다. 변경 사항을 추적할 수 있게 해 주는 도구가 버전 관리 시스템입니다. +코드 편집기와 IDE로 코드를 작성할 때, 그 코드에 가한 변경 사항을 추적해야 합니다. 그 변경 사항을 추적할 수 있게 해주는 도구가 버전 관리 시스템입니다. Git은 개발 커뮤니티에서 가장 널리 사용되는 버전 관리 시스템입니다. @@ -31,8 +31,8 @@ GitHub, GitLab, Bitbucket 같은 플랫폼은 Git 저장소를 위한 클라우 인기 있는 패키지 관리자 예시는 다음과 같습니다: -* JavaScript용 NPM, Yarn, PNPM -* Python용 PIP +* JavaScript용 npm, Yarn, pnpm +* Python용 pip * PHP용 Composer * Java용 Maven @@ -147,7 +147,7 @@ Git입니다. --- -버전 관리 시스템입니다. +버전 관리 시스템. ### --feedback-- diff --git a/curriculum/challenges/korean/blocks/lecture-understanding-error-handling-and-health-checks/69f3046f4c0e76cbdd24858e.md b/curriculum/challenges/korean/blocks/lecture-understanding-error-handling-and-health-checks/69f3046f4c0e76cbdd24858e.md index e9d59444000..1e1259f698a 100644 --- a/curriculum/challenges/korean/blocks/lecture-understanding-error-handling-and-health-checks/69f3046f4c0e76cbdd24858e.md +++ b/curriculum/challenges/korean/blocks/lecture-understanding-error-handling-and-health-checks/69f3046f4c0e76cbdd24858e.md @@ -34,7 +34,7 @@ app.use((err, req, res, next) => { Express는 매개변수가 네 개인 것을 보고 오류 핸들러임을 인식합니다 — 일반 미들웨어 함수의 `err`, `req`, `res` 매개변수 외에 새 매개변수 `next`가 추가된 것입니다. -앞으로의 수업에서 오류 처리 미들웨어가 Express 미들웨어 스택에서 어떻게 작동하는지 더 배우게 될 것입니다. +이전 수업에서 보았듯이, 에러 처리 미들웨어는 더 넓은 Express 미들웨어 스택에 포함됩니다. ## 비동기 오류 처리 방법 @@ -251,6 +251,7 @@ Express는 모든 라우트 뒤에만 오류 처리 미들웨어를 확인합니 Express는 모든 라우트 뒤에만 오류 처리 미들웨어를 확인합니다. + ## --video-solution-- 3 diff --git a/curriculum/challenges/korean/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/6733affc29df1304e2c97e88.md b/curriculum/challenges/korean/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/6733affc29df1304e2c97e88.md index d98c4baffb0..13110afd916 100644 --- a/curriculum/challenges/korean/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/6733affc29df1304e2c97e88.md +++ b/curriculum/challenges/korean/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/6733affc29df1304e2c97e88.md @@ -31,6 +31,8 @@ class MyClassName { 중괄호 안의 내용은 클래스 본문이라고 하며, 생성자와 메서드가 들어가는 곳입니다. +## 생성자 정의하기 + 생성자는 클래스에서 새 객체가 만들어질 때 자동으로 호출되는 특별한 메서드입니다. 보통 객체의 속성을 초기화하는 데 사용합니다. 이 예제에서는 생성자가 있는 `Dog` 클래스를 볼 수 있습니다. @@ -45,6 +47,8 @@ class Dog { 여기서 `this` 키워드는 `Dog` 클래스의 현재 인스턴스를 가리키며, 생성 중인 객체에 `name` 속성을 할당할 수 있게 합니다. `this` 키워드에 대해서는 이후 수업에서 더 배우게 됩니다. +## 메서드 정의하기 + 생성자 아래에는 메서드라고 하는 것들이 있을 수 있습니다. 메서드는 클래스 내부에 정의된 함수로, 동작이나 작업을 수행합니다. 클래스 인스턴스가 수행할 수 있는 동작을 정의하는 데 사용합니다. 다음은 `bark` 클래스에 `Dog`라는 메서드를 추가한 예입니다. @@ -63,6 +67,8 @@ class Dog { `bark` 메서드가 호출되면, 전달된 실제 이름과 함께 메시지가 콘솔에 출력됩니다. 만약 `Dog`라는 이름으로 `"Buddy"` 인스턴스를 만들고, 그 인스턴스에서 `bark()` 메서드를 호출하면 `"Buddy says woof!"`가 콘솔에 출력됩니다. +## 클래스 인스턴스 생성하기 + 클래스를 정의한 후에는 `new` 키워드, 클래스 이름, 그리고 인수를 사용해 클래스 인스턴스를 만들 수 있습니다. 이 예제에서는 `Dog`라는 이름으로 새 `Gino` 인스턴스를 만들고, 이를 `dog` 변수에 할당합니다. @@ -73,13 +79,15 @@ const dog = new Dog("Gino"); 코드에 `new Dog("Gino")`를 작성하면 새 객체가 생성되고, 생성자가 주어진 인수와 함께 자동으로 호출됩니다. -그다음 점 표기법을 사용해 이 속성에 접근할 수 있습니다. 다음 코드 줄에서 볼 수 있습니다: +## 속성과 메서드 접근하기 + +그다음 점 표기법을 사용해 `name` 속성에 접근할 수 있습니다. 다음 코드 줄에서 확인하세요: ```js console.log(dog.name); ``` -전체 예제는 다음과 같습니다: +전체 예시는 다음과 같습니다: :::interactive_editor @@ -127,6 +135,8 @@ dog.bark(); ::: +## 클래스 표현식 사용하기 + 앞서 언급했듯이, 클래스는 클래스 표현식으로도 정의할 수 있습니다. 이 경우 클래스는 익명이며 변수에 할당됩니다. 앞서 예제를 클래스 표현식으로 바꾸면 다음과 같습니다: diff --git a/curriculum/challenges/korean/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/673403ca2bb16658309e3632.md b/curriculum/challenges/korean/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/673403ca2bb16658309e3632.md index ca0f341c1cc..8dbf7428647 100644 --- a/curriculum/challenges/korean/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/673403ca2bb16658309e3632.md +++ b/curriculum/challenges/korean/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/673403ca2bb16658309e3632.md @@ -1,6 +1,6 @@ --- id: 673403ca2bb16658309e3632 -title: this 키워드는 어떻게 작동할까요? +title: This 키워드는 어떻게 작동할까요? challengeType: 19 dashedName: how-does-the-this-keyword-work --- @@ -11,6 +11,8 @@ dashedName: how-does-the-this-keyword-work 이 청사진들은 코드 내에서 생성되거나 접근되거나 수정되는 특정 객체를 일반적으로 가리키는 방법이 필요합니다. 바로 `this` 키워드가 그런 역할을 합니다. 이 키워드는 코드가 실행되어야 하는 문맥을 가리킵니다. 메서드 내에서 사용하면 `this`의 값은 해당 메서드와 연결된 객체에 대한 참조가 됩니다. 이렇게 하면 클래스 내 객체의 속성과 메서드에 접근할 수 있고, 메서드를 여러 객체에서 재사용할 수 있습니다. +## 생성자 + 예를 들어, 여기 `Dessert` 클래스가 있습니다. 이번에는 `hasPeanuts` 속성을 정의하고 있습니다. ```js @@ -33,6 +35,8 @@ this.hasPeanuts = hasPeanuts; 이것은 생성자의 문맥에서의 예지만, `this` 키워드는 다른 메서드 내에서도 사용할 수 있습니다. +## 메서드 + 여기 약간 변경된 `Dessert` 클래스가 있습니다. 이제 두 개의 속성 `name`과 `price`가 있습니다. ```js @@ -64,7 +68,7 @@ const brownie = new Dessert("Brownie", 5.99); brownie.showPrice(); ``` -전체 예제는 다음과 같습니다: +전체 예시는 다음과 같습니다: :::interactive_editor @@ -91,10 +95,16 @@ console.log(brownie); 이 모든 것은 `this` 키워드 덕분입니다. 이 키워드는 클래스 내에서 현재 객체를 일반적으로 가리키는 방법을 제공합니다. 덕분에 메서드를 여러 객체에서 재사용할 수 있습니다. +## 함수와 화살표 함수 + 이것은 객체 메서드 문맥에서의 예지만, `this` 키워드는 독립 함수와 화살표 함수 내에서도 값을 가집니다. +### 일반 함수 + 독립 함수 내에서의 값은 일반적으로 전역 객체(비엄격 모드) 또는 `undefined`(엄격 모드)를 가리킵니다. +### 화살표 함수 + 화살표 함수 내에서 `this` 키워드의 값은 조금 다릅니다. 화살표 함수는 자신이 정의된 외부 범위에서 `this`의 값을 상속받습니다. 자체 `this` 바인딩을 만들지 않습니다. 즉, `this`의 값은 화살표 함수가 호출되는 위치나 방식이 아니라, 화살표 함수가 정의된 문맥에 따라 달라집니다. 이 때문에 화살표 함수는 콜백이나 문맥 보존에 유용합니다. 하지만 이 때문에 `this` 값은 객체 메서드 내에서 현재 객체를 가리키지 않으므로, 화살표 함수를 사용할 때 이 점을 유념해야 합니다. @@ -183,7 +193,7 @@ JavaScript 메서드 내에서 `this`에 대해 옳은 설명은 무엇인가요 ## --answers-- -함수를 정의할 때입니다. +함수를 정의할 때 사용합니다. ### --feedback-- diff --git a/curriculum/challenges/korean/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5160.md b/curriculum/challenges/korean/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5160.md index 2153f8c4e5c..fae09a30b50 100644 --- a/curriculum/challenges/korean/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5160.md +++ b/curriculum/challenges/korean/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5160.md @@ -14,17 +14,17 @@ dashedName: whats-the-process-for-creating-web-standards 1. ## 필요성 확인 표준은 개발자가 벽에 부딪히거나, 브라우저가 같은 동작을 호환 불가능한 방식으로 구현하거나, 플랫폼이 아직 지원하지 않는 새로운 기능 같은 마찰에서 시작합니다. 누군가가 충분히 답답함을 느껴 기록합니다. 그 누군가는 개발자일 수도 있고, 제품 필요가 있는 큰 회사일 수도 있으며, 브라우저 팀 내 엔지니어일 수도 있습니다. 이 단계에서 중요한 것은 권위가 아니라 문제의 실재 여부에 대한 증거와 질문, 그리고 충분한 사람이 이 문제를 겪어 웹 플랫폼의 관심을 받을 만한지 여부입니다. -1. **제안과 초기 논의** - 아이디어는 GitHub 이슈, 짧은 문서, 문제를 설명하고 가능한 해결책을 개략적으로 제시하는 설명서 형태로 비공식적으로 작성됩니다. 이 단계의 목표는 완성된 명세를 만드는 것이 아니라 문제가 공감되는지 알아보는 것입니다. 다른 개발자들이 인식하나요? 브라우저 공급업체들이 관심 있나요? 명확한 해결책이 있나요, 아니면 경쟁하는 여러 해결책이 있나요? TC39에서는 이 초기 단계가 Stage 0과 Stage 1에 해당합니다. W3C에서는 공식 워킹 그룹이 설립되기 전에 커뮤니티 그룹에서 비공식적으로 진행되는 경우가 많습니다. WHATWG는 핵심 저장소에서 공개 GitHub 토론을 통해 처리합니다. 장소는 다르지만 기능은 같습니다. +1. ## 제안과 초기 논의 + 아이디어는 GitHub 이슈, 짧은 문서, 또는 문제를 설명하고 가능한 해결책을 개략적으로 제시하는 설명서 형태로 비공식적으로 작성됩니다. 이 단계의 목표는 완성된 명세서를 만드는 것이 아니라 문제가 공감되는지 확인하는 것입니다. 다른 개발자들도 이를 인식하나요? 브라우저 공급업체들이 관심을 보이나요? 명확한 해결책이 있나요, 아니면 여러 경쟁하는 해결책이 있나요? TC39에서는 이 초기 단계가 Stage 0과 Stage 1에 해당합니다. W3C에서는 공식 작업 그룹이 설립되기 전에 커뮤니티 그룹에서 비공식적으로 이루어지는 경우가 많습니다. WHATWG는 핵심 저장소에서 공개 GitHub 토론을 통해 처리합니다. 장소는 다르지만 기능은 동일합니다. -1. **명세 작성** - 제안이 주목받으면 누군가 또는 소규모 팀이 실제 명세, 즉 스펙을 작성해야 합니다. 스펙은 블로그 게시물이나 튜토리얼이 아니라, 기능이 모든 가능한 상황에서 어떻게 동작해야 하는지 정확하고 공식적으로 설명하는 문서입니다. 예외 상황, 오류 조건, 기존 기능과의 상호작용, 보안 영향 등을 모두 고려해 작성해야 합니다. +1. ## 명세서 작성 + 제안이 관심을 끌면, 누군가 또는 소규모 팀이 실제 명세서, 즉 스펙을 작성해야 합니다. 스펙은 블로그 게시물이나 튜토리얼이 아니라, 기능이 모든 가능한 상황에서 어떻게 동작해야 하는지 정확하고 공식적으로 설명하는 문서입니다. 예외 상황, 오류 조건, 기존 기능과의 상호작용, 보안 영향 등을 모두 신중히 고려하고 기록해야 합니다. -1. **검토, 이의 제기, 반복** - 초안이 공개되고 다른 브라우저 공급업체들이 검토합니다. 여기서 대부분의 실제 작업이 이루어집니다. 이의가 제기되고 스펙이 수정됩니다. 주요 브라우저 엔진 하나라도 구현을 거부하면 기술적 장점이 있어도 표준이 되기 어렵습니다. 이 단계에서 합의 형성은 오래 걸릴 수 있습니다. 일부 제안은 수년간 디자인 세부사항을 두고 공급업체들이 협상하며 지체되기도 합니다. 합의가 불가능하다고 판단되면 완전히 폐기되기도 합니다. +1. ## 검토, 이의 제기, 그리고 반복 + 초안은 공개적으로 그리고 다른 브라우저 공급업체들에 의해 검토를 위해 게시됩니다. 여기서 대부분의 실제 작업이 이루어집니다. 이의가 제기되고 명세서는 수정됩니다. 주요 브라우저 엔진 하나라도 구현을 거부하는 기능은 기술적 장점이 있더라도 표준이 되기 어렵습니다. 이 단계에서 합의 형성은 오랜 시간이 걸릴 수 있습니다. 일부 제안은 공급업체들이 설계 세부사항을 협상하는 동안 수년간 지체되기도 합니다. 합의가 불가능하다는 것이 명확해지면 완전히 폐기되기도 합니다. -1. **구현 및 테스트** - 스펙이 충분히 안정되면 브라우저 공급업체들이 구현을 시작합니다. 보통 먼저 기능 플래그로 시작해 기존 사용자에 영향을 주지 않고 테스트할 수 있게 합니다. 구현 과정에서 스펙이 예상하지 못한 문제가 드러나면 편집자에게 다시 보내 명확히 합니다. 공유 테스트 스위트는 모든 구현이 실제로 동일하게 동작하는지 검증합니다. Chrome, Firefox, Safari가 모두 같은 테스트를 통과하면 스펙이 제대로 작동하는 것입니다. 다르면 스펙이 불명확하거나 구현 중 하나에 버그가 있는 것입니다. +1. ## 구현과 테스트 + 명세서가 충분히 안정되면 브라우저 공급업체들이 구현을 시작합니다. 보통 먼저 기능 플래그를 사용해 기존 사용자에게 영향을 주지 않고 테스트할 수 있게 합니다. 구현 과정에서 명세서가 예상하지 못한 문제가 드러나면 편집자에게 다시 보내져 명확히 합니다. 공유 테스트 스위트는 모든 구현이 실제로 동일하게 동작하는지 검증합니다. Chrome, Firefox, Safari가 모두 같은 테스트를 통과하면 명세서가 제대로 작동하는 것입니다. 만약 결과가 다르면 명세서가 불명확하거나 구현 중 하나에 버그가 있는 것입니다. 1. ## 최종 확정 여러 독립적인 구현이 존재하고 테스트를 통과하며 커뮤니티가 만족하면 표준이 최종 확정됩니다. W3C에서는 권고안(Recommendation) 상태에 도달하는 것을 의미합니다. TC39에서는 Stage 4에 도달해 다음 연간 ECMAScript 릴리스에 기능이 포함되는 것을 뜻합니다. WHATWG에는 단일 최종 확정 시점이 없으며, 라이빙 스탠다드가 현재 합의를 반영해 지속적으로 업데이트됩니다. 전체 과정은 작은 논란 없는 추가 기능은 몇 달, 복잡하거나 정치적으로 민감한 것은 10년 이상 걸릴 수 있습니다. 예를 들어 CSS Grid는 2011년에 처음 제안되어 2017년에 모든 주요 브라우저에 탑재되었습니다. 좋은 아이디어와 안정적이고 보편적으로 지원되는 표준 사이의 그 간극에서 오픈 웹의 대부분 작업이 조용히 이루어집니다. @@ -109,7 +109,7 @@ dashedName: whats-the-process-for-creating-web-standards ## --answers-- -작성된 명세를 대체하기 위해서. +문서화된 사양을 대체하기 위해서입니다. ### --feedback-- @@ -121,7 +121,7 @@ Chrome, Firefox, Safari가 동일하게 동작하는 것을 보장하는 것이 --- -마케팅 목적으로 브라우저 성능을 평가하기 위해서. +마케팅 목적으로 브라우저 성능 순위를 매기기 위해서입니다. ### --feedback-- diff --git a/curriculum/challenges/korean/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5161.md b/curriculum/challenges/korean/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5161.md index fb9d8e7a0df..98d347fec85 100644 --- a/curriculum/challenges/korean/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5161.md +++ b/curriculum/challenges/korean/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5161.md @@ -13,23 +13,23 @@ dashedName: what-does-the-lifecycle-of-web-standards-features-look-like 이 과정을 규칙집으로 생각하고, 수명 주기는 실제 게임을 할 때 일어나는 일로 생각하세요. -1. **제안** - 모든 기능은 누군가가 충분히 관심을 가지고 문제를 적는 것에서 시작합니다. 개발자, 브라우저 엔지니어, 또는 회사가 GitHub 이슈나 설명서를 작성해 웹이 현재 할 수 없는 것과 그 이유를 설명합니다. 이 단계에서는 아이디어가 느슨하며 질문이 답보다 많습니다. 목표는 단순히 다른 누군가도 같은 문제를 인식하는지 알아보는 것입니다. +1. ## 제안 + 모든 기능은 누군가가 충분히 관심을 가지고 적어둔 문제에서 시작합니다. 개발자, 브라우저 엔지니어, 또는 회사가 GitHub 이슈나 설명서를 작성하여 현재 웹에서 할 수 없는 것과 그 이유를 설명합니다. 이 단계에서는 아이디어가 느슨하며 질문이 답변보다 많습니다. 목표는 단순히 다른 누군가도 같은 문제를 인식하는지 알아보는 것입니다. -1. **인큐베이션** - 제안이 공감을 얻으면 공개 토론과 초기 설계 기간에 들어갑니다. 경쟁하는 접근법이 스케치되고, 사용 사례가 모이며, 커뮤니티가 아이디어를 스트레스 테스트합니다. 많은 제안이 여기서 사라지는데, 문제 자체가 너무 틈새이거나 모두를 만족시키는 해결책이 없기 때문일 수 있습니다. 살아남은 제안은 더 명확한 형태를 갖추고 적어도 일부 브라우저 공급자의 관심을 받습니다. +1. ## 인큐베이션 + 제안이 공감을 얻으면 공개 토론과 초기 설계 기간에 들어갑니다. 경쟁하는 접근법이 스케치되고, 사용 사례가 모이며, 커뮤니티가 아이디어를 스트레스 테스트합니다. 많은 제안이 여기서 사라지는데, 문제 자체가 너무 틈새이거나 모두를 만족시키는 해결책이 없기 때문일 수 있습니다. 살아남은 제안은 더 명확한 형태를 갖추고 적어도 일부 브라우저 공급업체의 관심을 받습니다. -1. **명세** - 살아남은 제안은 공식 명세로 작성됩니다. 모든 예외 상황, 오류 조건, 기존 기능과의 상호작용이 명확히 정의되어야 합니다. 이 단계는 좋은 아이디어가 현실과 마주하는 순간입니다. 모호한 개념은 두 명의 독립 엔지니어가 읽고 동일하게 구현할 수 있는 정확한 규칙이 되어야 합니다. +1. ## 명세 + 살아남은 제안은 공식 명세로 작성됩니다. 모든 예외 상황, 오류 조건, 기존 기능과의 상호작용이 명확히 정의되어야 합니다. 이 시점에서 좋은 아이디어가 현실과 마주합니다. 모호한 개념은 두 명의 독립된 엔지니어가 동일하게 읽고 구현할 수 있는 정확한 규칙이 되어야 합니다. -1. **상호운용성 테스트** - 기능이 안정적이라고 간주되려면 모든 브라우저에서 동일하게 동작해야 합니다. W3C 웹 플랫폼 테스트 스위트가 이를 검증하는 주요 도구입니다. Chrome, Firefox, Safari 등 모든 브라우저가 자신의 구현에 대해 이 공유된 테스트를 실행합니다. 결과가 다르면 명세가 모호하거나 누군가 버그가 있다는 뜻입니다. 기능이 진행되기 전에 반드시 해결해야 합니다. +1. ## 상호운용성 테스트 + 기능이 안정적이라고 간주되려면 모든 브라우저에서 동일하게 동작해야 합니다. W3C 웹 플랫폼 테스트 스위트가 이를 검증하는 주요 도구입니다. 크롬, 파이어폭스, 사파리 등 여러 브라우저가 자신의 구현에 대해 이 공유된 테스트 모음을 실행합니다. 결과가 다르면 명세가 모호하거나 누군가 버그가 있다는 뜻입니다. 기능이 진행되기 전에 반드시 해결해야 합니다. -1. **최종 확정** - 여러 독립 구현체가 테스트를 통과하면 기능이 최종 확정됩니다. W3C에서는 권고안, TC39에서는 4단계, WHATWG에서는 안정적인 라이브 스탠다드 항목이 됩니다. 플래그가 내려가고 기능이 사용자에게 제공됩니다. 이 시점부터 모든 개발자가 무기한 신뢰할 수 있는 기본 웹 플랫폼의 일부가 됩니다. +1. ## 최종 확정 + 여러 독립적인 구현이 테스트를 통과하면 기능이 최종 확정됩니다. W3C에서는 권고안, TC39에서는 4단계, WHATWG 라이빙 스탠다드에서는 안정적인 항목이 됩니다. 플래그가 내려가고 기능이 사용자에게 제공됩니다. 이 시점부터 모든 개발자가 무기한 신뢰할 수 있는 기본 웹 플랫폼의 일부가 됩니다. -1. **폐기** - 모든 표준이 잘 유지되는 것은 아닙니다. 어떤 기능은 더 나은 기능으로 대체되고, 다른 기능은 당시에는 드러나지 않았던 보안 또는 개인정보 문제를 갖기도 합니다. 기능을 없애야 할 때는 공식적으로 폐기됩니다. 즉, 지원은 하지만 개발자가 사용을 중단해야 한다고 표시됩니다. 결국 명세에서 제거됩니다. 브라우저에서 제거하는 과정은 느리고 신중한데, 웹의 핵심 약속은 오래된 페이지가 계속 작동한다는 것이기 때문입니다. 일부 폐기된 기능은 오로지 하위 호환성 의무 때문에 수십 년간 브라우저에 남아 있습니다. +1. ## 사용 중단 + 모든 표준이 잘 유지되는 것은 아닙니다. 어떤 기능은 더 나은 기능으로 대체되고, 다른 기능은 당시에는 드러나지 않았던 보안이나 개인정보 문제를 일으키기도 합니다. 기능을 중단해야 할 때는 공식적으로 사용 중단됩니다. 즉, 지원은 하지만 개발자가 사용을 중단해야 한다고 표시됩니다. 결국 명세에서 제거됩니다. 브라우저에서 제거하는 과정은 느리고 신중한데, 웹의 핵심 약속이 오래된 페이지가 계속 작동하는 것이기 때문입니다. 일부 사용 중단된 기능은 호환성 의무 때문에 수십 년간 브라우저에 남아 있습니다. # --questions-- @@ -83,7 +83,7 @@ Chrome, Firefox, Safari가 모두 동일하게 동작하는지 검증하는 도 --- -작성된 명세를 대체하기 위해서입니다. +문서화된 사양을 대체하기 위해서입니다. ### --feedback-- diff --git a/curriculum/challenges/korean/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5162.md b/curriculum/challenges/korean/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5162.md index d47347eafd8..06801f71ef1 100644 --- a/curriculum/challenges/korean/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5162.md +++ b/curriculum/challenges/korean/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5162.md @@ -9,26 +9,26 @@ dashedName: what-are-the-key-principles-that-web-standards-are-built-on 웹 표준은 단순한 기술 문서가 아니라, 웹이 무엇이어야 하고 누구를 위해 존재해야 하는지에 대한 가치관을 반영합니다. 이러한 원칙을 이해하면 웹이 어떻게 작동하는지뿐 아니라 왜 그렇게 만들어졌는지도 알 수 있습니다. 이제 그 원칙들을 살펴보겠습니다. -1. **개방성** - 웹 표준은 공개적으로 개발되고 로열티 없이 구현됩니다. 누구나 명세를 읽을 수 있고, 누구나 브라우저를 만들 수 있으며, 어떤 회사도 표준 구현에 대해 라이선스 비용을 청구할 수 없습니다. 이러한 개방성은 웹을 독점 플랫폼과 구별 짓고, 작은 팀이 허가 없이도 수십억 사용자에게 도달하는 도구를 만들 수 있게 합니다. +1. ## 개방성 + 웹 표준은 공개적으로 개발되고 로열티 없이 구현됩니다. 누구나 명세를 읽을 수 있고, 누구나 브라우저를 만들 수 있으며, 어떤 회사도 표준 구현에 대해 라이선스 비용을 청구할 수 없습니다. 이러한 개방성은 웹을 독점 플랫폼과 구별하는 요소이며, 소규모 팀이 허가 없이도 수십억 명에게 도달하는 도구를 만들 수 있게 합니다. -1. **접근성** - 웹은 능력에 상관없이 모두가 사용할 수 있도록 설계되었습니다. 접근성은 웹 표준에 덧붙여진 것이 아니라 HTML, CSS, 브라우저 동작 설계에 내재되어 있습니다. W3C의 WCAG 지침은 실제로 접근성이 무엇인지에 대한 공식 기준을 제시합니다. 화면 읽기 프로그램, 키보드 내비게이션, 보조 기술을 사용하는 사람들에게 장벽을 만드는 기능은 윤리적 문제뿐 아니라 설계상 결함으로 간주됩니다. +1. ## 접근성 + 웹은 능력에 관계없이 모두가 사용할 수 있도록 설계되었습니다. 접근성은 웹 표준에 덧붙여진 것이 아니라 HTML, CSS, 브라우저 동작 설계에 내재되어 있습니다. W3C의 WCAG 지침은 실제로 접근성이 무엇을 의미하는지에 대한 공식 기준을 제시합니다. 화면 읽기 프로그램, 키보드 내비게이션, 보조 기술을 사용하는 사람들에게 장벽을 만드는 기능은 윤리적 문제뿐 아니라 설계상 결함으로 간주됩니다. -1. **상호운용성** - 가장 근본적인 원칙은 웹이 어디서나 동일하게 작동해야 한다는 것입니다. 표준에 맞게 만들어진 페이지는 Chrome, Firefox, Safari에서, 그리고 Windows, macOS, Linux, Android, iOS에서 동일하게 동작해야 합니다. 상호운용성이 없으면 웹은 브라우저별로 분리된 경험의 집합이 되고, 개발자는 같은 내용을 여러 번 작성해야 합니다. 모든 표준은 본질적으로 이를 방지하기 위해 존재합니다. +1. ## 상호운용성 + 가장 근본적인 원칙은 웹이 어디서나 동일하게 작동해야 한다는 것입니다. 표준에 맞게 만들어진 페이지는 Chrome, Firefox, Safari뿐 아니라 Windows, macOS, Linux, Android, iOS에서도 동일하게 동작해야 합니다. 상호운용성이 없으면 웹은 브라우저별 경험의 집합으로 분열되고, 개발자는 같은 것을 여러 번 작성해야 합니다. 모든 표준은 본질적으로 이를 방지하기 위해 존재합니다. -1. **하위 호환성** - 웹은 오래된 것을 깨뜨리지 않겠다는 거의 절대적인 약속을 지킵니다. 1999년에 작성된 페이지도 최신 브라우저에서 여전히 렌더링되어야 하며, 표준 기구들은 새 기능을 설계할 때 이 의무를 엄중히 여깁니다. 그래서 새 기능은 기존 것을 대체하지 않고 위에 덧씌워집니다. 이 제약은 때로 디자이너를 답답하게 하지만, 웹을 독특하게 견고한 플랫폼으로 만드는 이유이기도 합니다. +1. ## 이전 버전 호환성 + 웹은 오래된 것을 깨뜨리지 않겠다는 거의 절대적인 약속을 지킵니다. 1999년에 작성된 페이지도 최신 브라우저에서 여전히 렌더링되어야 하며, 표준 기구들은 새로운 기능을 설계할 때 이 의무를 진지하게 받아들입니다. 그래서 새로운 기능은 기존 것을 대체하지 않고 위에 덧씌워집니다. 이는 때때로 디자이너를 답답하게 하지만, 웹을 독특하게 견고한 플랫폼으로 만드는 이유이기도 합니다. -1. **개인정보 보호와 보안** - 최신 표준은 출시 전에 개인정보 보호와 보안 영향을 검토합니다. 사용자 데이터를 노출하거나 추적을 가능하게 하는 새 API는 표준 절차에서 엄격한 검토를 받습니다. 플랫폼은 기본적으로 사용자를 보호해야 하며, 개발자의 편의가 사용자 안전을 희생해서는 안 된다는 원칙입니다. +1. ## 개인정보 보호 및 보안 + 최신 표준은 출시 전에 개인정보 보호와 보안 영향을 검토받습니다. 사용자 데이터를 노출하거나 추적을 가능하게 하는 새로운 API는 표준 과정에서 엄격한 검토를 받습니다. 원칙은 플랫폼이 기본적으로 사용자를 보호해야 하며, 개발자의 편의가 사용자 안전을 희생해서는 안 된다는 것입니다. -1. **계층화** - 웹은 명확하고 조합 가능한 계층으로 구축됩니다: 구조를 위한 HTML, 표현을 위한 CSS, 동작을 위한 JavaScript. 표준은 이 경계를 무너뜨리지 않고 존중하도록 설계됩니다. 잘 계층화된 기능은 점진적으로 도입할 수 있습니다. JavaScript를 사용하지 않는 페이지도 작동하고, 새 CSS 속성을 지원하지 않는 브라우저도 합리적으로 렌더링합니다. 이러한 관심사의 분리는 웹에 탄력성을 부여합니다. +1. ## 계층화 + 웹은 구조를 위한 HTML, 표현을 위한 CSS, 동작을 위한 JavaScript라는 뚜렷하고 조합 가능한 계층으로 구축됩니다. 표준은 이 경계를 무너뜨리지 않고 존중하도록 설계됩니다. 잘 계층화된 기능은 점진적으로 도입할 수 있습니다. JavaScript를 사용하지 않는 페이지도 작동하고, 새로운 CSS 속성을 지원하지 않는 브라우저도 합리적인 결과를 렌더링합니다. 이러한 관심사의 분리는 웹에 회복력을 부여합니다. -1. **점진적 향상** - 계층화와 밀접한 관련이 있는 이 원칙은 웹이 모두에게 작동하고, 더 능력 있는 브라우저나 기기를 가진 사용자에게는 더 나아져야 한다는 것입니다. 표준 기능은 지원하지 않을 때 완전히 깨지지 않고 단계적으로 성능 저하되어야 합니다. 이 원칙은 새 CSS 속성의 명세, JavaScript API의 누락 기능 처리, 그리고 표준 기구가 전 세계에서 여전히 널리 사용되는 구형 브라우저와 최신 브라우저 간 격차를 어떻게 생각하는지에 영향을 줍니다. +1. ## 점진적 향상 + 계층화와 밀접하게 관련된 개념으로, 웹은 모두에게 작동한 후 더 능력 있는 브라우저나 기기를 가진 사용자에게 더 나아져야 한다는 생각입니다. 표준 기능은 지원되지 않을 때 완전히 깨지지 않고 우아하게 저하되어야 합니다. 이 원칙은 새로운 CSS 속성의 명세 방식, JavaScript API가 누락된 기능을 처리하는 방법, 그리고 표준 기구가 최신 브라우저와 여전히 널리 사용되는 구형 브라우저 간의 격차를 어떻게 생각하는지에 영향을 줍니다. # --questions-- diff --git a/curriculum/challenges/korean/blocks/lecture-user-interface-design-fundamentals/672baa97f2990e6631d522e7.md b/curriculum/challenges/korean/blocks/lecture-user-interface-design-fundamentals/672baa97f2990e6631d522e7.md index 4412213ab71..1c05a9b6223 100644 --- a/curriculum/challenges/korean/blocks/lecture-user-interface-design-fundamentals/672baa97f2990e6631d522e7.md +++ b/curriculum/challenges/korean/blocks/lecture-user-interface-design-fundamentals/672baa97f2990e6631d522e7.md @@ -7,7 +7,9 @@ dashedName: how-do-you-create-good-background-and-foreground-contrast-in-your-de # --interactive-- -**참고**: 일부 인터랙티브 예제는 아직 배우지 않은 CSS를 사용할 수 있습니다. 모든 코드를 이해하려고 애쓰지 마세요. 이 예제들의 목적은 디자인 개념을 미리 보여줘서 작동 방식을 더 잘 이해하도록 돕는 것입니다. +**참고**: 일부 인터랙티브 예제는 아직 배우지 않은 CSS를 사용할 수 있습니다. 모든 코드를 이해하려고 걱정하지 마세요. 예제의 목적은 이러한 디자인 개념을 미리 보여주어 작동 방식을 더 잘 이해하도록 돕는 것입니다. + +## 명암 대비 이해하기 먼저, 명암 대비에 익숙해져야 할 수도 있습니다. 명암 대비는 두 색상 간의 차이, 즉 서로 구분하기 얼마나 쉬운지를 뜻합니다. @@ -53,6 +55,8 @@ dashedName: how-do-you-create-good-background-and-foreground-contrast-in-your-de ::: +### 텍스트에 명암 대비 적용하기 + 물론, 이 예제들에서는 레이아웃 덕분에 구분이 더 명확할 수 있습니다. 그렇다면 이 색상을 텍스트에 적용하면 어떨까요? 흰색 배경에 명암 대비가 높은 검정 텍스트를 사용할 수 있습니다. 그리고 파란 배경에 명암 대비가 낮은 보라색 텍스트도 가능합니다. :::interactive_editor @@ -96,6 +100,8 @@ dashedName: how-do-you-create-good-background-and-foreground-contrast-in-your-de ::: +### WCAG 명암 대비 기준 + 그렇다면 "충분히 좋은" 명암 대비를 어떻게 판단할까요? 텍스트가 눈에 어떻게 보이는지만으로 판단할 수 없습니다. 모든 사용자가 다르게 경험하기 때문입니다. 다행히도 웹 콘텐츠 접근성 지침(WCAG)이 이를 위한 기준을 제공합니다. 명암 대비율이 4.5:1인 텍스트는 AA 기준으로 간주되며, 대부분 사용자에게 접근 가능하도록 지켜야 하는 최소 기준입니다. 명암 대비율이 7:1인 텍스트는 AAA 기준으로 간주되어 최고의 접근성 수준을 보장합니다. @@ -141,6 +147,8 @@ dashedName: how-do-you-create-good-background-and-foreground-contrast-in-your-de ::: +### 높은 명암 대비율과 낮은 명암 대비율 비교하기 + 두 색상 간 명암 대비율을 확인할 수 있는 여러 웹사이트가 있지만, 대부분 브라우저는 개발자 도구에서 직접 확인할 수 있게 해줍니다. 명암 대비율 개념을 더 잘 이해하기 위해 몇 가지 예제를 더 살펴보겠습니다. @@ -221,8 +229,12 @@ dashedName: how-do-you-create-good-background-and-foreground-contrast-in-your-de 이 예제는 명암 대비율이 1.48:1로 AA 기준조차 충족하지 못합니다. +## 색상 속성 조정하기 + 어떻게 고칠 수 있을까요? 명암 대비율에 영향을 주는 세 가지 요소가 있습니다. +### 색상조정(색상환에서의 위치) 조정하기 + 첫 번째는 색상 유형인 색상환(hue)입니다. 빨강, 파랑, 주황 같은 일반적인 색상 유형을 나타냅니다. 파랑에서 더 멀리 떨어진 색상환으로 바꿔보겠습니다. 이번에는 빨강을 사용해 보겠습니다. :::interactive_editor @@ -267,6 +279,8 @@ dashedName: how-do-you-create-good-background-and-foreground-contrast-in-your-de ::: +### 채도 조정하기 + 안타깝게도 이 변경으로 명암 대비율은 1.49:1로 거의 변하지 않았습니다. 다음은 채도(saturation), 즉 색상의 "양"을 바꿔야 합니다. 텍스트의 빨강 양을 늘려보겠습니다. 그러면 명암 대비율이 3.54:1로 목표에 훨씬 가까워집니다. :::interactive_editor @@ -325,6 +339,8 @@ dashedName: how-do-you-create-good-background-and-foreground-contrast-in-your-de ::: +### 밝기 조정하기 + 하지만 마지막 값인 밝기(lightness)를 바꾸면 더 가까워질 수 있습니다. 밝기는 색상에 포함된 흰색의 양을 나타냅니다. 빨강의 밝기를 낮춰보겠습니다. 이제 연한 파란 배경에 훨씬 더 어두운 빨강이 있어 명암 대비율이 10.34:1이 됩니다. @@ -479,7 +495,7 @@ dashedName: how-do-you-create-good-background-and-foreground-contrast-in-your-de ## --answers-- -색상환(hue) +색상 ### --feedback-- @@ -487,7 +503,7 @@ dashedName: how-do-you-create-good-background-and-foreground-contrast-in-your-de --- -채도(saturation) +채도 ### --feedback-- @@ -495,7 +511,7 @@ dashedName: how-do-you-create-good-background-and-foreground-contrast-in-your-de --- -밝기(lightness) +밝기 ### --feedback-- @@ -503,7 +519,7 @@ dashedName: how-do-you-create-good-background-and-foreground-contrast-in-your-de --- -불투명도(opacity) +불투명도 ## --video-solution-- diff --git a/curriculum/challenges/korean/blocks/lecture-what-is-css/672acc100d59d24da7b4e09c.md b/curriculum/challenges/korean/blocks/lecture-what-is-css/672acc100d59d24da7b4e09c.md index 68058afaec7..d02e766de14 100644 --- a/curriculum/challenges/korean/blocks/lecture-what-is-css/672acc100d59d24da7b4e09c.md +++ b/curriculum/challenges/korean/blocks/lecture-what-is-css/672acc100d59d24da7b4e09c.md @@ -7,10 +7,14 @@ dashedName: what-are-the-different-types-of-css-combinators # --interactive-- +## CSS 결합자 + CSS 결합자는 CSS에서 선택자 간의 관계를 정의하는 데 사용됩니다. 이들은 다른 요소와의 관계를 기반으로 요소를 선택하는 데 도움을 주어 더 정확하고 효율적인 스타일링을 가능하게 합니다. 먼저 자손 결합자를 시작으로 주요 CSS 결합자와 그 사용 사례를 살펴보겠습니다. +### 자손 결합자 + 자손 요소 결합자는 첫 번째 선택자와 일치하는 조상 요소 안에 중첩된 경우 두 번째 선택자와 일치하는 요소를 선택하는 데 사용하세요. 조상 요소는 부모, 조부모 또는 문서 트리 상위의 어떤 조상도 될 수 있습니다. 이 작동 방식을 더 잘 이해하려면 예제를 살펴보겠습니다. @@ -42,6 +46,8 @@ figure img { 만약 `figure` 요소 안에 여러 이미지가 있다면, 자손 결합자를 사용해 각 이미지 주위에 검은색 실선 테두리를 적용하는 것이 좋습니다. +### 자식 결합자 + 다른 유형의 결합자는 자식 결합자입니다. CSS에서 자식 결합자(`>`)는 지정된 부모 요소의 직접 자식인 요소를 선택하는 데 사용됩니다. @@ -102,6 +108,8 @@ CSS에서 자식 결합자(`>`)는 지정된 부모 요소의 직접 자식인 다른 두 단락 요소는 `div` 요소 안에 중첩되어 있으므로 `container` 클래스의 직접 자식으로 간주되지 않아 파란색 텍스트 색상이 적용되지 않습니다. +### 다음 형제 결합자 + 또 다른 일반적인 결합자는 바로 다음 형제 결합자입니다. CSS에서 바로 다음 형제 결합자(`+`)는 지정된 형제 요소 바로 다음에 오는 요소를 선택합니다. 이 결합자는 한 요소 바로 다음에 오는 요소에 스타일을 적용할 때 유용하며, 형제 요소 간 위치에 따라 타깃팅된 스타일링을 가능하게 합니다. @@ -150,6 +158,8 @@ img + figcaption { 이 예제에서 바로 다음 형제 결합자(`+`)는 `figcaption` 요소 바로 다음에 오는 `img` 요소를 선택합니다. 적용된 CSS 규칙은 `4px solid black border` 주위에 `figcaption`를 추가합니다. +### 이후 형제 결합자 + 또 다른 일반적인 결합자는 이후 형제 결합자입니다. CSS에서 이후 형제 결합자(`~`)는 지정된 요소 다음에 오는 모든 형제 요소를 선택합니다. @@ -202,6 +212,8 @@ h2 ~ p { 이후 형제 결합자(`~`)는 `h2` 요소 다음에 나타나는 모든 단락 형제를 대상으로 하며, 즉시 다음 형제인지 여부는 상관하지 않습니다. +## CSS 결합자가 중요한 이유 + 결론적으로, 다양한 CSS 결합자를 이해하고 사용하면 HTML 요소에 정확한 스타일을 적용할 수 있어 디자인의 제어력과 유연성을 높일 수 있습니다. 이 선택자들을 숙달하면 웹 페이지의 외관과 기능을 모두 향상시키는 더 정교하고 타깃팅된 스타일 규칙을 만들 수 있습니다. diff --git a/curriculum/challenges/korean/blocks/lecture-working-with-code-editors-and-ides/672d26269456511aa3db614d.md b/curriculum/challenges/korean/blocks/lecture-working-with-code-editors-and-ides/672d26269456511aa3db614d.md index d2bb6e4f104..f04d5f2a485 100644 --- a/curriculum/challenges/korean/blocks/lecture-working-with-code-editors-and-ides/672d26269456511aa3db614d.md +++ b/curriculum/challenges/korean/blocks/lecture-working-with-code-editors-and-ides/672d26269456511aa3db614d.md @@ -7,25 +7,25 @@ dashedName: what-is-a-code-editor-and-ide # --description-- -이 둘이 같은 것이라고 생각할 수 있지만, 완전히 같지는 않습니다. 코드 편집기는 코드 파일을 편집할 수 있는 애플리케이션을 말합니다. IDE, 즉 통합 개발 환경은 코드를 편집하는 동안 컴파일, 실행, 디버그까지 할 수 있는 완전한 애플리케이션입니다. +이것들이 같은 것이라고 생각할 수 있지만, 그렇지 않습니다. 코드 에디터는 코드를 편집할 수 있는 모든 애플리케이션입니다. IDE, 즉 통합 개발 환경은 코드를 편집하는 동안 컴파일, 실행, 디버깅까지 할 수 있는 완전한 애플리케이션입니다. -몇 가지 예시가 도움이 될 수 있습니다. +몇 가지 예시가 도움이 될 것입니다. 먼저, 몇 가지 인기 있는 IDE를 살펴보겠습니다. Visual Studio는 마이크로소프트에서 제공하는 통합 개발 환경으로, 다양한 플랫폼에서 애플리케이션을 빌드하고 디버그하며 배포할 수 있는 종합 도구 모음을 제공합니다. -또 다른 IDE는 XCode입니다. Xcode는 애플에서 만든 통합 개발 환경으로, macOS, iOS, watchOS, tvOS용 애플리케이션을 만들고 코딩하며 디버그하는 데 사용됩니다. +또 다른 IDE는 Xcode입니다. Xcode는 Apple에서 만든 통합 개발 환경으로, macOS, iOS, watchOS, tvOS용 애플리케이션을 만들고, 코딩하며, 디버깅하도록 설계되었습니다. -그리고 또 다른 IDE는 Android Studio입니다. Android Studio는 구글에서 만든 통합 개발 환경으로, 안드로이드 애플리케이션을 빌드하고 디버그하며 테스트하는 데 특화되어 있습니다. +Google에서 개발한 Android Studio는 Android 애플리케이션을 빌드, 디버깅, 테스트하도록 특별히 설계된 통합 개발 환경입니다. 이들은 IDE의 몇 가지 예시일 뿐입니다. 이제 몇 가지 인기 있는 코드 편집기를 살펴보겠습니다. Visual Studio Code는 마이크로소프트에서 만든 가볍고 오픈 소스인 코드 편집기로, 다양한 프로그래밍 언어를 지원하며 확장 기능을 통해 디버깅, 구문 강조, 버전 관리 같은 기능을 제공합니다. -또 다른 인기 편집기는 Sublime Text입니다. Sublime Text는 세련된 인터페이스와 강력한 기능, 그리고 사용자 정의 가능한 구문 강조와 플러그인을 통해 다양한 프로그래밍 언어를 지원하는 빠르고 다재다능한 텍스트 편집기입니다. +빠르고 다재다능한 편집 경험을 위해 Sublime Text는 세련된 인터페이스와 맞춤형 구문 강조 및 플러그인을 통해 다양한 프로그래밍 언어를 지원합니다. -그리고 또 하나는 Notepad++입니다. 이것은 윈도우용 무료 오픈 소스 텍스트 및 소스 코드 편집기로, 구문 강조, 코드 접기, 생산성과 사용자 정의를 높이는 다양한 플러그인을 제공합니다. +Windows 사용자는 또한 무료 오픈소스 텍스트 및 소스 코드 에디터인 Notepad++를 사용할 수 있으며, 구문 강조, 코드 접기, 생산성 및 맞춤화를 향상하는 다양한 플러그인을 제공합니다. -코드 편집기는 주로 파일의 텍스트 내용에 집중하는 반면, IDE는 코드를 관리할 수 있는 다양한 도구를 노출한다는 점을 눈치챘을 것입니다. +코드 에디터가 주로 파일의 텍스트 내용에 집중하는 반면, IDE는 코드를 관리하는 다양한 도구를 노출한다는 점을 눈치챘을 것입니다. 이 예시들은 모두 컴퓨터에서 실행할 수 있는 로컬 프로그램이지만, 클라우드 기반 편집기도 있습니다. @@ -35,11 +35,11 @@ Visual Studio Code는 마이크로소프트에서 만든 가볍고 오픈 소스 Replit은 웹 브라우저에서 다양한 프로그래밍 언어로 코드를 작성, 실행, 공유할 수 있는 협업 환경을 제공하는 온라인 플랫폼입니다. -또 다른 인기 있는 클라우드 기반 편집기는 GitHub Codespaces입니다. 이것은 GitHub에서 바로 완전히 구성된 코드 편집기와 개발 도구에 즉시 접근할 수 있게 해주는 클라우드 기반 개발 환경으로, 원활한 코딩과 협업을 지원합니다. +또 다른 인기 있는 클라우드 기반 에디터는 GitHub Codespaces입니다. 이는 GitHub에서 바로 완전히 구성된 코드 에디터와 개발 도구에 즉시 접근할 수 있는 클라우드 기반 개발 환경으로, 원활한 코딩과 협업을 가능하게 합니다. -그리고 또 하나는 Ona입니다. Ona는 GitHub와 GitLab과 통합되어 브라우저에서 바로 코딩, 빌드, 디버깅할 수 있는 즉시 사용 가능한 맞춤형 작업 공간을 제공하는 클라우드 기반 개발 환경입니다. +Ona는 GitHub와 GitLab과 통합되어 브라우저에서 바로 코딩, 빌드, 디버깅을 위한 즉시 사용 가능한 맞춤형 작업 공간을 제공합니다. -이 외에도 많은 옵션이 있습니다. Visual Studio Code처럼 매우 확장성이 뛰어나 여러 프로젝트 유형과 언어를 지원하는 옵션도 있고, 특정 언어나 프로젝트 유형에 맞춰진 옵션도 있습니다. +그리고 더 많은 옵션이 있습니다. Visual Studio Code 같은 일부 옵션은 매우 확장 가능하여 다양한 프로젝트 유형과 언어를 지원할 수 있습니다. 다른 옵션은 특정 언어나 프로젝트 유형의 작은 부분집합에 맞춰져 있을 수 있습니다. 사용하는 애플리케이션은 특정 프로젝트에 따라 다를 수 있습니다. 필요에 맞는 최적의 옵션을 찾아보세요. @@ -111,7 +111,7 @@ Ona --- -Visual Studio Code +비주얼 스튜디오 코드 ## --video-solution-- diff --git a/curriculum/challenges/korean/blocks/lecture-working-with-code-editors-and-ides/672d45583fd75a504136fbbb.md b/curriculum/challenges/korean/blocks/lecture-working-with-code-editors-and-ides/672d45583fd75a504136fbbb.md index 982316569e1..029ad91f0b2 100644 --- a/curriculum/challenges/korean/blocks/lecture-working-with-code-editors-and-ides/672d45583fd75a504136fbbb.md +++ b/curriculum/challenges/korean/blocks/lecture-working-with-code-editors-and-ides/672d45583fd75a504136fbbb.md @@ -7,11 +7,11 @@ dashedName: how-to-install-visual-studio-code-onto-your-computer # --description-- -VS Code를 설치하려면 운영체제에 맞는 설치 프로그램을 받기 위해 공식 웹사이트를 방문하세요. Visual Studio 웹사이트가 아니라 VS Code 웹사이트에 방문하는지 꼭 확인하세요. +VS Code를 설치하려면 운영체제에 맞는 설치 프로그램을 받기 위해 VS Code 웹사이트를 방문하세요. Visual Studio 웹사이트가 아니라 VS Code 웹사이트에 방문하는지 꼭 확인하세요. -Windows에서는 EXE 설치 프로그램을 다운로드할 수 있습니다. 다운로드가 완료되면 파일을 실행하면 설치 마법사가 설치 과정을 안내합니다. +Windows에서는 EXE 설치 프로그램을 다운로드할 수 있습니다. 다운로드가 완료되면 파일을 실행하고 설치 마법사가 설치 과정을 안내할 것입니다. -Mac에서는 실행할 수 있는 `.app`가 포함된 zip 압축 파일을 다운로드할 수 있습니다. 또한 Homebrew를 통해 VS Code를 설치할 수도 있습니다. +Mac에서는 실행할 수 있는 `.app`이 포함된 `.zip` 압축 파일을 다운로드할 수 있습니다. 또한 Homebrew를 통해 VS Code를 설치할 수도 있습니다. Mac에서 터미널 앱을 열고 다음 명령어를 실행하세요: diff --git a/curriculum/challenges/korean/blocks/lecture-working-with-code-editors-and-ides/672d45651d83b450801efb3a.md b/curriculum/challenges/korean/blocks/lecture-working-with-code-editors-and-ides/672d45651d83b450801efb3a.md index 4eb793557b6..f428d4c6742 100644 --- a/curriculum/challenges/korean/blocks/lecture-working-with-code-editors-and-ides/672d45651d83b450801efb3a.md +++ b/curriculum/challenges/korean/blocks/lecture-working-with-code-editors-and-ides/672d45651d83b450801efb3a.md @@ -9,21 +9,21 @@ dashedName: how-to-create-a-project-and-run-your-code-locally-in-vs-code 시작하려면 VS Code가 프로젝트를 "워크스페이스"로 간주한다는 점을 알아야 합니다. 워크스페이스는 VS Code에서 연 디렉터리입니다. -먼저, 명령줄 인터페이스를 사용해 새 프로젝트용 새 디렉터리를 만들어야 합니다. 디렉터리는 폴더의 다른 이름입니다. +먼저, 명령줄 인터페이스를 사용해 새 프로젝트를 위한 새 디렉터리를 만들어야 합니다. 디렉터리는 폴더의 다른 이름입니다. -명령줄 인터페이스, 줄여서 CLI는 텍스트 기반 명령어로 운영체제와 상호작용할 수 있게 해줍니다. 앞으로 수업에서 이 도구들에 대해 더 배우게 됩니다. +명령줄 인터페이스, 줄여서 CLI는 텍스트 기반 명령어로 운영체제와 상호작용할 수 있게 해줍니다. 이러한 도구에 대해서는 앞으로 수업에서 더 배우게 됩니다. Windows를 사용한다면 명령 프롬프트나 PowerShell을 사용할 수 있습니다. Mac이라면 터미널 앱을 열면 됩니다. -명령줄이 열리면 `cd ~` 명령어를 입력하고 키보드에서 `enter`를 눌러 홈 디렉터리로 이동하세요. 그런 다음 `mkdir my-project` 명령어를 입력하고 `enter`를 누르세요. `mkdir`, 즉 "make directory"는 새 디렉터리를 만드는 명령어입니다. 그런 다음 VS Code로 새 디렉터리를 열어야 합니다. +명령줄이 열리면 홈 디렉터리로 이동하세요. 명령 프롬프트에서는 `cd /d %USERPROFILE%`를 입력하고 키보드에서 `Enter`를 누르세요. PowerShell이나 macOS 터미널에서는 `cd ~`를 입력하고 `Enter`를 누르세요. 그런 다음 `mkdir my-project` 명령어를 입력하고 `Enter`를 누르세요. `mkdir`은 "make directory"의 약자로 새 디렉터리를 만드는 명령어입니다. 그다음 VS Code로 새 디렉터리를 열어야 합니다. -새 디렉터리를 만드는 다른 그래픽 방식도 있습니다. +VS Code에서 디렉터리를 여는 다른 방법도 있습니다. 운영체제에 따라 파일 탐색기에서 바로 VS Code를 열 수 있는 컨텍스트 메뉴(또는 오른쪽 클릭 옵션)가 있을 수 있습니다. VS Code 애플리케이션을 더블클릭해 열 수도 있습니다. 명령줄에 익숙하다면 `code /path/to/folder` 명령어를 실행할 수도 있습니다. 열리면 새 빈 워크스페이스가 보일 것입니다. -새 파일을 만들려면 좌측 상단의 `File` 메뉴를 클릭하고 `New File...`를 선택하세요. 그런 다음 파일 이름을 `index.html`로 지정하고 `Save`를 클릭하세요. +새 파일을 만들려면 왼쪽 상단의 `File` 메뉴를 클릭하고 `New File...`을 선택하세요. 그런 다음 파일 이름을 `index.html`로 지정하고 `Save`를 클릭하세요. 이제 탐색기 탭에서 새 파일이 보일 것입니다. `index.html` 파일에 HTML을 추가해 보세요. @@ -31,15 +31,15 @@ Windows를 사용한다면 명령 프롬프트나 PowerShell을 사용할 수 대신 HTML 파일을 적절한 웹 서버 뒤에 두어야 합니다. 코딩 초보자에게는 겁나는 작업처럼 들릴 수 있지만, VS Code에서 바로 할 수 있는 방법이 있습니다. -먼저 마켓플레이스에서 무료로 제공되는 _Live Server_ 확장 기능을 설치해야 합니다. +먼저 Live Server 확장 기능을 설치해야 하는데, 마켓플레이스에서 무료로 제공됩니다. -왼쪽 모서리의 확장 탭을 클릭하고 검색창에 `Live Server`를 입력하세요. +왼쪽 사이드바의 확장 탭을 클릭하고 검색창에 `Live Server`를 입력하세요. -설치가 완료되면 상태 표시줄에 `Go live` 버튼이 보일 것입니다. HTML 파일을 연 상태에서 클릭하세요. +설치가 완료되면 상태 표시줄에 `Go Live` 버튼이 보일 것입니다. HTML 파일이 열려 있는지 확인한 후 그 버튼을 클릭하세요. -새 페이지가 브라우저의 새 탭에서 자동으로 열릴 것입니다. 열리지 않는다면 `http://localhost:5500/`로 직접 이동할 수 있습니다. +새 페이지가 브라우저의 새 탭에서 자동으로 열릴 것입니다. 열리지 않는다면 `http://localhost:5500/`로 직접 접속할 수 있습니다. -축하합니다! 이제 VS Code에서 자신만의 프로젝트를 설정했고 라이브 서버로 변경 사항을 실시간으로 확인할 수 있습니다. +축하합니다! 이제 VS Code에서 자신만의 프로젝트를 설정했고 Live Server로 변경 사항을 확인할 수 있습니다. # --questions-- @@ -57,7 +57,7 @@ Visual Studio Code가 "워크스페이스"로 간주하는 것은 무엇인가 --- -VS Code를 연 디렉터리입니다. +VS Code에서 연 디렉터리입니다. --- @@ -121,7 +121,7 @@ CSS가 제대로 로드되지 않는 등 예상치 못한 버그를 방지할 ## --answers-- -Web Server. +웹 서버. ### --feedback-- @@ -133,7 +133,7 @@ Live Server. --- -Local Host. +로컬 호스트. ### --feedback-- @@ -141,7 +141,7 @@ Local Host. --- -HTML Preview. +HTML 미리보기. ### --feedback-- diff --git a/curriculum/challenges/korean/blocks/lecture-working-with-code-editors-and-ides/672d456f4ac35950b300e93f.md b/curriculum/challenges/korean/blocks/lecture-working-with-code-editors-and-ides/672d456f4ac35950b300e93f.md index db0a1a6578d..3b5582b3543 100644 --- a/curriculum/challenges/korean/blocks/lecture-working-with-code-editors-and-ides/672d456f4ac35950b300e93f.md +++ b/curriculum/challenges/korean/blocks/lecture-working-with-code-editors-and-ides/672d456f4ac35950b300e93f.md @@ -9,21 +9,21 @@ dashedName: what-are-several-useful-keyboard-shortcuts-for-maximizing-productivi 기본 단축키 몇 가지는 이미 운영체제에서 물려받아 익숙할 것입니다. 예를 들어 `Ctrl + S`는 저장, `Ctrl + C`는 복사, `Ctrl + V`는 붙여넣기 단축키로 VS Code에서도 작동합니다. -하지만 애플리케이션별로 생산성을 높여주는 단축키도 몇 가지 있습니다. 운영체제에 따라 일부 단축키가 다를 수 있다는 점도 참고하세요. +하지만 애플리케이션별로 특정된 몇 가지 단축키가 있어 생산성을 크게 높일 수 있습니다. 운영체제에 따라 일부 단축키가 다를 수 있다는 점도 기억하세요. -예를 들어 `Shift + Alt + F`는 현재 열린 파일에 대해 설정된 포매터(예: JavaScript 프로젝트의 prettier)를 실행합니다. +예를 들어, `Shift + Alt + F`는 현재 열린 파일에 대해 구성된 포매터(예: JavaScript 프로젝트의 Prettier)를 실행합니다. -또는 `Ctrl + Shift + F` (Windows)나 `Cmd + Shift + F` (Mac)를 사용하면 작업 공간 내 모든 파일의 텍스트 내용을 검색할 수 있습니다. 그리고 `Ctrl + Shift + H` (Windows)나 `Cmd + Shift + H` (Mac)를 누르면 찾기 및 바꾸기를 실행할 수 있습니다. +작업 공간 내 모든 파일의 텍스트 내용을 검색하려면 `Ctrl + Shift + F`(Windows/Linux) 또는 `Cmd + Shift + F`(macOS)를 사용하세요. 그리고 찾기 및 바꾸기를 실행하려면 `Ctrl + Shift + H`(Windows/Linux) 또는 `Cmd + Shift + H`(macOS)를 사용하세요. -한 줄을 삭제해야 한다면 `Ctrl + Shift + K` (Windows)나 `Cmd + Shift + K` (Mac)를 사용하세요. +한 줄을 삭제해야 한다면 `Ctrl + Shift + K`(Windows/Linux) 또는 `Cmd + Shift + K`(macOS)를 누르세요. -코드를 위한 공간이 더 필요하다면 `Ctrl + B` (Windows)나 `Cmd + B` (Mac)를 눌러 파일 목록과 확장 메뉴가 있는 사이드바를 숨길 수 있습니다. +코드를 위한 공간이 더 필요하다면 `Ctrl + B`(Windows) 또는 `Cmd + B`(Mac)를 눌러 파일 목록과 확장 메뉴가 있는 사이드바를 숨기세요. -아니면 코드가 잘 안 보인다면 `Ctrl + plus` (Windows)나 `Cmd + plus` (Mac)를 눌러 편집기 확대를 하고, `Ctrl + minus` (Windows)나 `Cmd + minus` (Mac)를 눌러 축소할 수 있습니다. +코드가 잘 보이지 않는다면 `Ctrl + Plus`(Windows) 또는 `Cmd + Plus`(Mac)로 편집기 확대를, `Ctrl + Minus`(Windows) 또는 `Cmd + Minus`(Mac)로 축소를 조절하세요. -VS Code의 또 다른 유용한 기능은 여러 줄을 동시에 편집할 수 있는 멀티라인 편집입니다. 예를 들어 `Ctrl + Alt + down`와 `Ctrl + Alt + up` (Windows/Linux), 또는 `Option + Command + down`와 `Option + Command + up` (Mac)를 사용해 연속된 줄에 여러 커서를 배치할 수 있습니다. 또한 `Alt` (Windows/Linux)나 `Option` (Mac)를 누른 채 클릭하면 필요한 줄마다 별도의 커서를 추가할 수 있습니다. 커서가 배치되면 입력하거나 삭제하는 모든 작업이 동시에 적용되어 반복적인 코드를 다룰 때 많은 시간을 절약할 수 있습니다. +VS Code의 또 다른 유용한 기능은 여러 줄을 동시에 편집할 수 있는 멀티라인 편집입니다. 예를 들어, `Ctrl + Alt + Down`과 `Ctrl + Alt + Up`(Windows/Linux), 또는 `Option + Cmd + Down`과 `Option + Cmd + Up`(Mac)을 사용해 연속된 줄에 여러 커서를 배치할 수 있습니다. 또한 `Alt`(Windows/Linux) 또는 `Option`(Mac)를 누른 상태에서 클릭해 필요한 위치에 별도의 커서를 추가할 수도 있습니다. 커서가 배치되면 입력하거나 삭제하는 모든 내용이 동시에 적용되어 반복적인 코드를 다룰 때 많은 시간을 절약할 수 있습니다. -마지막으로, 단축키가 기억나지 않을 때는 언제든 `Ctrl + Shift + P` (Windows)나 `Cmd + Shift + P` (Mac)를 눌러 명령 팔레트를 열고 필요한 명령을 선택할 수 있습니다. +마지막으로, 단축키를 잊어버렸을 때는 언제든 `Ctrl + Shift + P`(Windows/Linux) 또는 `Cmd + Shift + P`(macOS)를 눌러 명령 팔레트를 열고 필요한 명령을 선택할 수 있습니다. 이 지식과 약간의 연습으로 VS Code 고수로 가는 길에 한 걸음 더 다가갈 수 있습니다. diff --git a/curriculum/challenges/korean/blocks/lecture-working-with-code-editors-and-ides/672d457bcdd8b350ec2b6254.md b/curriculum/challenges/korean/blocks/lecture-working-with-code-editors-and-ides/672d457bcdd8b350ec2b6254.md index b9384a30951..cc09311d305 100644 --- a/curriculum/challenges/korean/blocks/lecture-working-with-code-editors-and-ides/672d457bcdd8b350ec2b6254.md +++ b/curriculum/challenges/korean/blocks/lecture-working-with-code-editors-and-ides/672d457bcdd8b350ec2b6254.md @@ -7,25 +7,25 @@ dashedName: what-are-some-good-vs-code-extensions-you-can-use-in-your-editor # --description-- -_Better Comments_는 특정 코드 주석에 특별한 하이라이트를 제공하는 확장 기능입니다. 예를 들어, "TODO" 주석뿐만 아니라 질문이나 경고를 나타내는 구문도 강조합니다. +Better Comments는 특정 코드 주석에 특별한 하이라이트를 제공하는 확장입니다. 예를 들어, "TODO" 주석과 질문이나 경고를 나타내는 구문을 강조합니다. -_Code Spell Checker_는 코드에서 철자가 틀렸을 때 표시해 줍니다. 코드 파일용으로 설계되어 카멜 케이스 같은 것도 인식합니다. +Code Spell Checker는 코드에서 철자가 잘못된 단어를 표시합니다. 코드 파일용으로 설계되어 camel case 같은 것도 인식합니다. -_Error Lens_는 코드에서 하이라이트된 오류를 잡는 데 도움을 줍니다. VS Code가 기본적으로 보여주는 밑줄 대신, 이 확장은 전체 줄을 강조하고 오류 메시지를 표시합니다. +Error Lens는 코드의 오류를 놓치기 어렵게 만듭니다. VS Code가 기본적으로 보여주는 밑줄에 의존하는 대신, 이 확장은 전체 줄을 하이라이트하고 오류 메시지를 표시합니다. -_Indent Rainbow_는 들여쓰기 수준마다 색을 추가합니다. VS Code의 기본 괄호 쌍 색상화와 함께 사용하면 코드가 어떤 범위에 속하는지 훨씬 쉽게 파악할 수 있습니다. +Indent Rainbow는 들여쓰기 수준마다 색을 추가합니다. VS Code의 기본 괄호 쌍 색상화와 함께 사용하면 코드가 어떤 범위에 속하는지 훨씬 쉽게 파악할 수 있습니다. -좀 더 실용적인 것을 찾고 있다면, _GitHub Copilot_이나 _Tabnine_ 같은 AI 어시스턴트를 고려해 보세요. 코드를 작성하는 동안 인라인 제안을 제공합니다. +좀 더 실용적인 것을 찾고 있다면, GitHub Copilot이나 Tabnine 같은 AI 어시스턴트를 고려해 보세요. 코드를 작성하는 동안 인라인 제안을 제공합니다. -_ VS Code Great Icons_ 같은 아이콘 팩은 파일 트리를 더 깔끔하고 한눈에 보기 쉽게 만들어 줍니다. _Colorize_ 같은 확장은 CSS 속성의 값을 이해하는 데 도움을 줍니다. +VS Code Great Icons 같은 아이콘 팩은 파일 트리를 더 깔끔하고 한눈에 보기 쉽게 만듭니다. Colorize 같은 확장은 CSS 속성의 값을 이해하는 데 도움을 줍니다. -프로젝트에 맞는 언어별 확장 기능도 필요할 것입니다. JavaScript를 사용한다면, 코드를 린트하고 포맷하는 데 _ESLint_와 _Prettier_를 사용할 가능성이 큽니다. TypeScript를 사용한다면, 읽기 쉬운 메시지를 위한 _Pretty TypeScript Errors_를 원할 수 있습니다. +프로젝트에 맞는 언어별 확장도 필요합니다. JavaScript를 사용한다면 ESLint와 Prettier로 코드를 린트하고 포맷하는 것이 좋습니다. TypeScript를 사용한다면 Pretty TypeScript Errors로 메시지를 더 읽기 쉽게 만들 수 있습니다. -마지막으로, 에디터에서 약간의 재미를 느낄 수도 있습니다. _VS Code Pets_는 버그를 잡는 동안 함께할 수 있는 가상 애완동물을 제공합니다. +마지막으로, 에디터에서 약간의 재미도 느껴 보세요. VS Code Pets는 버그를 잡는 동안 함께할 수 있는 설정 가능한 가상 애완동물을 제공합니다. -_Power Mode_는 더 많은 코드를 작성해 "콤보"가 충분히 높아지면 화려한 효과를 만들어 냅니다. +Power Mode는 더 많은 코드를 작성해 충분히 높은 "콤보"를 달성하면 화려한 효과를 만들어 냅니다. -_Discord Presence_는 작업 중인 내용을 친구들에게 보여 줄 수 있게 해 줍니다. +Discord Presence는 작업 중인 내용을 친구들에게 자랑할 수 있게 해 줍니다. 그리고 훨씬 더 많은 확장 기능이 있습니다. 확장 마켓플레이스를 자유롭게 탐색하며 자신에게 가장 잘 맞는 것을 찾아보세요. @@ -33,7 +33,7 @@ _Discord Presence_는 작업 중인 내용을 친구들에게 보여 줄 수 있 ## --text-- -VS Code의 "Better Comments" 확장 기능은 어떤 기능을 제공하나요? +Better Comments 확장이 VS Code에서 제공하는 기능은 무엇인가요? ## --answers-- @@ -69,7 +69,7 @@ VS Code의 "Better Comments" 확장 기능은 어떤 기능을 제공하나요? ## --text-- -코드에서 하이라이트된 오류를 잡는 데 도움을 주며 전체 줄에 오류 메시지를 표시하는 VS Code 확장 기능은 무엇인가요? +기본 밑줄 대신 전체 줄을 하이라이트하고 오류 메시지를 인라인으로 표시하는 VS Code 확장은 무엇인가요? ## --answers-- @@ -105,7 +105,7 @@ ESLint ## --text-- -"VS Code Pets" 확장 기능이 제공하는 독특한 기능은 무엇인가요? +VS Code Pets 확장이 제공하는 독특한 기능은 무엇인가요? ## --answers-- diff --git a/curriculum/challenges/korean/blocks/lecture-working-with-css-flexbox/672aa7f7284b235f46f7d4e9.md b/curriculum/challenges/korean/blocks/lecture-working-with-css-flexbox/672aa7f7284b235f46f7d4e9.md index 2ca9a87f4d7..d612b1decf4 100644 --- a/curriculum/challenges/korean/blocks/lecture-working-with-css-flexbox/672aa7f7284b235f46f7d4e9.md +++ b/curriculum/challenges/korean/blocks/lecture-working-with-css-flexbox/672aa7f7284b235f46f7d4e9.md @@ -319,7 +319,7 @@ CSS flexbox의 주요 목적은 무엇인가요? ### --feedback-- -플렉스 컨테이너 내에서 요소들의 분배를 생각해 보세요. +주축과 교차 축이 서로 어떻게 위치하는지 생각해보세요. --- @@ -327,7 +327,7 @@ CSS flexbox의 주요 목적은 무엇인가요? ### --feedback-- -플렉스 컨테이너 내에서 요소들의 분배를 생각해 보세요. +주축과 교차 축이 서로 어떻게 위치하는지 생각해보세요. --- @@ -339,7 +339,7 @@ CSS flexbox의 주요 목적은 무엇인가요? ### --feedback-- -플렉스 컨테이너 내에서 요소들의 분배를 생각해 보세요. +주축과 교차 축이 서로 어떻게 위치하는지 생각해보세요. ## --video-solution-- diff --git a/curriculum/challenges/korean/blocks/lecture-working-with-css-flexbox/672bd658c0e190f674a5e057.md b/curriculum/challenges/korean/blocks/lecture-working-with-css-flexbox/672bd658c0e190f674a5e057.md index 92b52d275cf..90d67acebd8 100644 --- a/curriculum/challenges/korean/blocks/lecture-working-with-css-flexbox/672bd658c0e190f674a5e057.md +++ b/curriculum/challenges/korean/blocks/lecture-working-with-css-flexbox/672bd658c0e190f674a5e057.md @@ -7,11 +7,11 @@ dashedName: what-are-some-common-flex-properties # --interactive-- -플렉스 속성은 플렉스 컨테이너에 적용하여 자식 요소들의 분포를 결정하는 속성입니다. 가장 자주 사용하는 `flex-wrap`, `justify-content`, 그리고 `align-items`를 살펴보겠습니다. +플렉스 속성은 컨테이너 수준의 배치부터 항목 수준의 자체 정렬까지 플렉스 레이아웃 내에서 요소가 어떻게 동작하는지 제어합니다. 이 수업에서는 가장 자주 사용하는 `flex-wrap`, `flex-flow`, `justify-content`, `align-items`, `align-self`를 다룹니다. -먼저 `flex-wrap`부터 시작하겠습니다. 이 속성은 플렉스 항목들이 플렉스 컨테이너 내에서 사용 가능한 공간에 맞게 어떻게 감싸지는지를 결정합니다. `flex-wrap`는 세 가지 값, `nowrap`, `wrap`, 그리고 `wrap-reverse`을 가질 수 있습니다. `nowrap`가 기본값으로, 플렉스 항목들이 컨테이너 너비를 초과해도 새 줄로 감싸지지 않습니다. +`flex-wrap`부터 시작해 보겠습니다. 이 속성은 플렉스 항목이 플렉스 컨테이너 내에서 사용 가능한 공간에 맞게 어떻게 감싸지는지를 결정합니다. `flex-wrap`은 `nowrap`, `wrap`, `wrap-reverse` 세 가지 값을 가질 수 있습니다. 기본값은 `nowrap`으로, 플렉스 항목이 컨테이너 너비를 초과해도 새 줄로 감싸지지 않습니다. -아래 코드에는 세 개의 `div` 요소가 있습니다. `width`에 집중해 봅시다. 빨간 테두리로 표시된 `main` 컨테이너는 `width`가 `200px`이고, 세 개의 자식 `div` 요소들의 너비 합은 `width`가 `240px` (각각 `80px`)입니다: +아래 코드에는 세 개의 `div` 요소가 있습니다. `width`에 주목해 보세요. 테두리가 있는 `main` 컨테이너의 `width`는 `200px`이고, 세 개의 자식 `div` 요소의 `width` 합은 `240px`(`80px`씩)입니다: :::interactive_editor @@ -28,7 +28,7 @@ dashedName: what-are-some-common-flex-properties main { width: 200px; display: flex; - border: 2px solid red; + border: 2px solid #444; } div { @@ -51,7 +51,6 @@ div { ::: - `div` 요소들의 너비가 컨테이너 너비를 초과하지만, 기본적으로는 사용 가능한 공간에 맞게 축소됩니다. 만약 컨테이너 너비를 초과할 때 감싸기를 원한다면, 플렉스 컨테이너에 `flex-wrap: wrap`를 설정하세요: :::interactive_editor @@ -70,7 +69,7 @@ main { width: 200px; display: flex; flex-wrap: wrap; - border: 2px solid red; + border: 2px solid #444; } div { @@ -109,9 +108,10 @@ div { ```css main { width: 200px; + height: 120px; display: flex; flex-flow: column wrap-reverse; - border: 2px solid red; + border: 2px solid #444; } div { @@ -151,7 +151,7 @@ div { main { display: flex; justify-content: flex-start; - border: 2px solid red; + border: 2px solid #444; } div { @@ -191,7 +191,7 @@ div { main { display: flex; justify-content: flex-end; - border: 2px solid red; + border: 2px solid #444; } div { @@ -231,7 +231,7 @@ div { main { display: flex; justify-content: center; - border: 2px solid red; + border: 2px solid #444; } div { @@ -254,7 +254,7 @@ div { ::: -주축을 따라 요소들을 고르게 분배하려면 `justify-content: space-between`를 사용하세요. 필요하면 플렉스 항목들 사이에 공간이 추가됩니다. +주축을 따라 요소들을 가장자리 공간 없이 배치하려면 `justify-content: space-between`을 사용할 수 있습니다. 첫 번째 항목은 주축 시작에, 마지막 항목은 주축 끝에 위치하며, 나머지 공간은 인접한 항목들 사이에 분배됩니다. :::interactive_editor @@ -271,7 +271,7 @@ div { main { display: flex; justify-content: space-between; - border: 2px solid red; + border: 2px solid #444; } div { @@ -294,7 +294,7 @@ div { ::: -`justify-content: space-around`은 주축 내에서 플렉스 항목들을 고르게 분배하며, 첫 번째 항목 앞과 마지막 항목 뒤에 공간을 추가합니다. 이 추가 공간은 인접한 항목들 사이 공간의 절반입니다. 만약 분배할 항목이 하나뿐이라면 가운데 정렬됩니다. +`justify-content: space-around`는 플렉스 항목을 주축을 따라 고르게 분배하며, 첫 번째 항목 앞과 마지막 항목 뒤에 공간을 추가합니다. 이 추가 공간은 인접한 항목 쌍 사이 공간의 절반입니다. 만약 배치할 항목이 하나뿐이라면 중앙에 위치합니다. :::interactive_editor @@ -311,7 +311,7 @@ div { main { display: flex; justify-content: space-around; - border: 2px solid red; + border: 2px solid #444; } div { @@ -334,8 +334,7 @@ div { ::: - -마지막으로 `justify-content: space-evenly`이 있습니다. 이 속성은 주축을 따라 항목들을 고르게 분배하며, 항목들 사이 공간과 첫 번째 및 마지막 요소 앞뒤 공간이 정확히 같습니다: +마지막으로 `justify-content: space-evenly`는 항목들을 주축을 따라 균등하게 분배합니다. 항목들 사이 공간과 첫 번째 및 마지막 항목 앞뒤 공간이 정확히 동일합니다: :::interactive_editor @@ -352,7 +351,7 @@ div { main { display: flex; justify-content: space-evenly; - border: 2px solid red; + border: 2px solid #444; } div { @@ -390,10 +389,10 @@ div { ```css main { - height: 300px; display: flex; + height: 300px; align-items: center; - border: 2px solid red; + border: 2px solid #444; } div { @@ -431,10 +430,10 @@ div { ```css main { - height: 300px; display: flex; + height: 300px; align-items: flex-start; - border: 2px solid red; + border: 2px solid #444; } div { @@ -472,10 +471,10 @@ div { ```css main { - height: 300px; display: flex; + height: 300px; align-items: flex-end; - border: 2px solid red; + border: 2px solid #444; } div { @@ -498,33 +497,43 @@ div { ::: -교차 축을 따라 플렉스 항목들을 늘리려면 `align-items: stretch`를 사용하세요. 이 속성은 `width`이나 `height`가 설정되지 않았거나, 최솟값 `width`나 `height`만 있는 자동 크기 조절 요소에도 작동합니다. 플렉스 항목들은 교차 축 방향으로 컨테이너를 채우도록 늘어납니다. +플렉스 항목을 교차 축을 따라 늘리려면 `align-items: stretch`를 사용할 수 있습니다. 이 속성은 교차 축 크기가 `auto`인 항목에만 영향을 주며, 교차 축에 명시적 크기(예: 행 컨테이너에서 설정된 `height`)가 있는 항목은 늘어나지 않습니다. 영향을 받는 항목은 교차 축 방향으로 컨테이너를 채웁니다. :::interactive_editor ```html <link rel="stylesheet" href="styles.css"> - -<div class="container"> - <div class="box">One</div> - <div class="box">Two</div> - <div class="box">Three</div> -</div> - +<main> + <div id="first-div"></div> + <div id="second-div"></div> + <div id="third-div"></div> +</main> ``` ```css -.container { +main { display: flex; - align-items: stretch; + height: 300px; + align-items: stretch; border: 2px solid #444; - height: 200px; } -.box { - width: 100px; - border: 1px solid #888; - background-color: lightblue; +div { + width: 80px; + height: 50px; +} + +#first-div { + background-color: #4d70b2; +} + +#second-div { + background-color: #5c4db2; +} + +#third-div { + background-color: #4da3b2; + height: auto; } ``` @@ -536,33 +545,37 @@ div { ```html <link rel="stylesheet" href="styles.css"> - -<div class="container"> - <div class="box">One</div> - <div class="box">Two</div> - <div class="box special">Three</div> -</div> - +<main> + <div id="first-div"></div> + <div id="second-div"></div> + <div id="third-div"></div> +</main> ``` ```css -.container { +main { display: flex; - align-items: flex-start; + height: 300px; + align-items: flex-start; border: 2px solid #444; - height: 200px; } -.box { - width: 100px; - border: 1px solid #888; - background-color: lightblue; - margin: 4px; +div { + width: 80px; + height: 50px; } -.special { - align-self: stretch; - background-color: lightcoral; +#first-div { + background-color: #4d70b2; +} + +#second-div { + background-color: #5c4db2; +} + +#third-div { + background-color: #4da3b2; + align-self: stretch; } ``` @@ -574,33 +587,37 @@ div { ```html <link rel="stylesheet" href="styles.css"> - -<div class="container"> - <div class="box">One</div> - <div class="box">Two</div> - <div class="box special">Three</div> -</div> - +<main> + <div id="first-div"></div> + <div id="second-div"></div> + <div id="third-div"></div> +</main> ``` ```css -.container { +main { display: flex; - align-items: flex-start; + height: 300px; + align-items: flex-start; border: 2px solid #444; - height: 200px; } -.box { - width: 100px; - border: 1px solid #888; - background-color: lightblue; - margin: 4px; +div { + width: 80px; + height: 50px; +} + +#first-div { + background-color: #4d70b2; +} + +#second-div { + background-color: #5c4db2; } -.special { - align-self: center; - background-color: lightcoral; +#third-div { + background-color: #4da3b2; + align-self: center; } ``` @@ -612,33 +629,37 @@ div { ```html <link rel="stylesheet" href="styles.css"> - -<div class="container"> - <div class="box">One</div> - <div class="box">Two</div> - <div class="box special">Three</div> -</div> - +<main> + <div id="first-div"></div> + <div id="second-div"></div> + <div id="third-div"></div> +</main> ``` ```css -.container { +main { display: flex; - align-items: flex-start; + height: 300px; + align-items: flex-start; border: 2px solid #444; - height: 200px; } -.box { - width: 100px; - border: 1px solid #888; - background-color: lightblue; - margin: 4px; +div { + width: 80px; + height: 50px; +} + +#first-div { + background-color: #4d70b2; } -.special { - align-self: flex-start; - background-color: lightcoral; +#second-div { + background-color: #5c4db2; +} + +#third-div { + background-color: #4da3b2; + align-self: flex-start; } ``` @@ -650,39 +671,43 @@ div { ```html <link rel="stylesheet" href="styles.css"> - -<div class="container"> - <div class="box">One</div> - <div class="box">Two</div> - <div class="box special">Three</div> -</div> - +<main> + <div id="first-div"></div> + <div id="second-div"></div> + <div id="third-div"></div> +</main> ``` ```css -.container { +main { display: flex; - align-items: flex-start; + height: 300px; + align-items: flex-start; border: 2px solid #444; - height: 200px; } -.box { - width: 100px; - border: 1px solid #888; - background-color: lightblue; - margin: 4px; +div { + width: 80px; + height: 50px; } -.special { - align-self: flex-end; - background-color: lightcoral; +#first-div { + background-color: #4d70b2; +} + +#second-div { + background-color: #5c4db2; +} + +#third-div { + background-color: #4da3b2; + align-self: flex-end; } ``` ::: -반응형 레이아웃을 만들기 위해 선택할 수 있는 다른 플렉스 속성과 값들도 있지만, 이들이 가장 자주 사용되는 속성들입니다. 이 CSS 플렉스 속성과 CSS 플렉스 모델에 대한 새로운 지식을 바탕으로, 다양한 기기에서 부드럽고 포괄적인 사용자 경험을 위한 반응형 레이아웃을 만들기 시작할 수 있습니다. +원하는 반응형 레이아웃을 만들기 위해 선택할 수 있는 다른 플렉스 속성과 값도 있지만, 여기 소개한 것들이 가장 자주 사용됩니다. 이 CSS 플렉스 속성과 CSS 플렉스 모델에 대한 새 지식을 바탕으로, 다양한 기기에서 부드럽고 포괄적인 사용자 경험을 제공하는 반응형 레이아웃을 만들기 시작할 수 있습니다. # --questions-- @@ -764,7 +789,7 @@ div { ## --answers-- -`flex-direction` 그리고 `justify-content`. +`flex-direction`과 `justify-content` ### --feedback-- @@ -772,7 +797,7 @@ div { --- -`flex-direction` 그리고 `align-items`. +`flex-direction`과 `align-items` ### --feedback-- @@ -780,7 +805,7 @@ div { --- -`flex-direction` 그리고 `align-content`. +`flex-direction`과 `align-content` ### --feedback-- @@ -788,7 +813,7 @@ div { --- -`flex-direction` 그리고 `flex-wrap`. +`flex-direction`과 `flex-wrap` ## --video-solution-- diff --git a/curriculum/challenges/korean/blocks/lecture-working-with-css-fonts/672bd814105a0ffcf36f9233.md b/curriculum/challenges/korean/blocks/lecture-working-with-css-fonts/672bd814105a0ffcf36f9233.md index 53cb41539b3..c2a7fbe4eeb 100644 --- a/curriculum/challenges/korean/blocks/lecture-working-with-css-fonts/672bd814105a0ffcf36f9233.md +++ b/curriculum/challenges/korean/blocks/lecture-working-with-css-fonts/672bd814105a0ffcf36f9233.md @@ -11,6 +11,8 @@ dashedName: what-are-font-families <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/what-are-font-families-and-how-do-they-work-1.png" alt="Diagram showing 'Arial' at the top with two blue arrows pointing down to 'Arial Bold' on the left and 'Arial Italic' on the right, illustrating font family variations" /> +## CSS에서 폰트 패밀리 설정하기 + CSS에서는 `font-family` 속성으로 폰트 패밀리를 설정할 수 있습니다. 다음은 단락의 폰트를 `Arial`로 설정하는 예입니다: :::interactive_editor @@ -29,6 +31,8 @@ CSS에서는 `font-family` 속성으로 폰트 패밀리를 설정할 수 있습 ::: +## 대체 수단 폰트 + 그런데 폰트 패밀리를 찾지 못하면 어떻게 될까요? 우선순위가 높은 것부터 낮은 순서로 여러 폰트 패밀리를 쉼표로 구분해 지정할 수 있습니다. 이 대체 폰트들은 대체 수단 역할을 합니다. 이 예에서는 Arial이 기본 폰트이고 Lato가 대체 폰트입니다: :::interactive_editor @@ -51,6 +55,8 @@ CSS에서는 `font-family` 속성으로 폰트 패밀리를 설정할 수 있습 이 과정이 어떻게 작동하는지도 알아야 합니다. 첫 번째 폰트가 있으면 선택 과정이 멈추지 않습니다. 폰트 패밀리는 문자 하나씩 선택되므로, 특정 문자가 없으면 브라우저가 우선순위가 낮은 폰트에서 찾아 렌더링합니다. 흥미롭죠? +## 일반 폰트 패밀리 + 웹 개발 맥락에서는 일반 폰트 패밀리도 자주 사용합니다. 매우 중요합니다. 일반 폰트 패밀리는 우선순위가 높은 폰트가 없을 때 웹 브라우저가 기본으로 렌더링하는 폰트입니다. 콘텐츠가 읽기 쉽도록 브라우저가 지정된 일반 폰트 패밀리를 기준으로 가장 적합한 폰트로 원래 폰트를 대체합니다. 가장 흔히 쓰이는 일반 폰트 패밀리는 다음과 같습니다: - 세리프 @@ -81,6 +87,8 @@ Arial이 가장 우선순위가 높습니다. Arial이 없으면 브라우저가 폰트 패밀리 목록 끝에는 항상 일반 폰트 패밀리를 포함해야 합니다. 일반 폰트는 원래 디자인에서 의도한 폰트와 다르게 보일 수 있으니, 다양한 브라우저에서 대체 폰트가 어떻게 보이는지 확인하는 것이 좋습니다. +## 웹 안전 폰트 + 사용자 경험을 최대한 일관되게 하려면 웹 안전 폰트를 사용하는 것도 권장합니다. 이 폰트 패밀리는 대부분 기기에 설치되어 있어 대부분 사용자에게 올바르게 렌더링될 가능성이 높습니다. 다음 수업에서 더 자세히 배울 것입니다. 폰트 패밀리는 웹 디자인에서 필수적입니다. font-family 속성을 사용하면 텍스트의 모양과 느낌을 즉시 바꿀 수 있습니다. diff --git a/curriculum/challenges/korean/blocks/lecture-working-with-css-fonts/672bd8453d1371fdb1510fe5.md b/curriculum/challenges/korean/blocks/lecture-working-with-css-fonts/672bd8453d1371fdb1510fe5.md index c681fb7d6a6..7d30508abc6 100644 --- a/curriculum/challenges/korean/blocks/lecture-working-with-css-fonts/672bd8453d1371fdb1510fe5.md +++ b/curriculum/challenges/korean/blocks/lecture-working-with-css-fonts/672bd8453d1371fdb1510fe5.md @@ -11,6 +11,8 @@ dashedName: how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fo Google Fonts와 Font Squirrel은 웹 개발용 무료 폰트를 찾고 사용할 수 있는 인기 있는 온라인 자원입니다. 프로젝트에 아주 쉽게 통합할 수 있습니다. +## 구글 폰트 + 먼저 Google Fonts부터 시작해 보겠습니다. Google Fonts는 웹 개발용으로 특별히 디자인된 폰트를 많이 제공하는 Google 서비스입니다. Google Fonts 사용자 인터페이스에는 여러 가지 요소가 있습니다. 하나씩 살펴보겠습니다. 왼쪽 사이드바에는 다음이 있습니다: - 폰트를 보고, 찾고, 필터링할 수 있는 섹션 @@ -18,6 +20,8 @@ Google Fonts와 Font Squirrel은 웹 개발용 무료 폰트를 찾고 사용할 - 웹 프로젝트용 아이콘을 찾고 다운로드할 수 있는 섹션 - 폰트와 모범 사례에 대해 더 배우고 자주 묻는 질문을 볼 수 있는 섹션 +## 구글 폰트 미리보기 + 웹사이트에 Google Font를 추가하려면 첫 번째 섹션(Fonts)으로 가세요. 왼쪽 사이드바의 "Preview"라고 적힌 곳에서 미리보기 텍스트를 맞춤 설정할 수 있습니다. 보고 싶은 텍스트를 입력하면 자동으로 업데이트됩니다. 이는 웹사이트에 사용할 텍스트로 폰트를 미리 보는 데 유용합니다. 폰트 크기를 조절하거나 폰트 특성에 따라 필터링할 수도 있습니다. <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-1.png" alt="Google Fonts Fonts section showing a left sidebar with preview text set to 'freeCodeCamp' at 40px, filter options for Language, Technology, and Decorative stroke, and the main panel listing font families including Roboto, SUSE, and Sevillana each previewing 'freeCodeCamp'" /> @@ -28,12 +32,16 @@ Google Fonts와 Font Squirrel은 웹 개발용 무료 폰트를 찾고 사용할 <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-2.png" alt="Google Fonts Roboto Styles page with Specimen, Type tester, Glyphs, and About & license tabs, a blue Get font button, a preview text field showing 'freeCodeCamp' with a font size slider at 48px, and a list of styles including Thin 100, Thin 100 Italic, Light 300, and Light 300 Italic" /> +## 구글 폰트 사용하기 + 프로젝트에 폰트를 추가할 준비가 되면 상단의 파란색 "Get font" 버튼을 클릭하세요. 현재 선택한 폰트가 요약 페이지에 표시됩니다. 여러 폰트를 동시에 선택할 수 있습니다. <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-3.png" alt="Google Fonts page showing '1 font family selected' with Roboto Static listed, Get embed code and Download all buttons on the right, and a How to use section with All, Design, Develop, and Google products tabs" /> 다음으로, 폰트 파일을 다운로드하여 프로젝트에 로컬 파일로 추가할지, 아니면 외부 폰트로 사용하여 사용자가 웹사이트에 접속할 때 Google 서버에서 다운로드할지 선택해야 합니다. 다운로드하려면 "Download all"을 클릭하고, Google 서버에서 외부 폰트로 사용하려면 "Get embed code"를 클릭하세요. "Get embed code"를 클릭하면 프로젝트에 외부 폰트를 추가하는 방법에 대한 지침이 표시됩니다. +### 구글 폰트 링크 사용하기 + 웹 개발 프로젝트에서는 `link` 요소 또는 `@import` 두 가지 옵션이 있습니다. `link` 요소 옵션을 선택하면 HTML 코드 조각과 CSS 규칙을 복사해 프로젝트에 붙여넣을 수 있습니다. HTML 파일의 `head` 요소에 코드를 임베드하고 필요에 맞는 CSS 규칙을 추가하세요. <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-4.png" alt="Google Fonts Embed code page with the link element option selected, showing three link tags for preconnect and the font stylesheet, a CSS classes section with .roboto-thin, .roboto-light, .roboto-regular, and .roboto-medium rules, and a left sidebar showing font style toggles" /> @@ -141,6 +149,8 @@ Google Fonts와 Font Squirrel은 웹 개발용 무료 폰트를 찾고 사용할 각 폰트 스타일마다 CSS 규칙이 있습니다. 각 규칙은 커스텀 폰트가 제대로 로드되지 않을 경우를 대비해 대체 폰트를 할당합니다. +### 구글 폰트 가져오기 + `@import` 옵션을 선택하면 해당 규칙을 CSS 파일에 추가해야 합니다. <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-5.png" alt="Google Fonts Embed code page with the @import option selected, showing a style block containing the @import URL rule, a CSS classes section below, and the left sidebar with font style toggles" /> @@ -159,10 +169,14 @@ CSS 규칙은 완전히 동일합니다. 이것이 Google Fonts입니다. 웹 개발 프로젝트에 무료이면서 오픈 소스인 폰트를 찾는 가장 인기 있는 옵션 중 하나입니다. +## 폰트 스퀴럴 + 또 다른 훌륭한 옵션은 Font Squirrel입니다. 여기서 원하는 맞춤 폰트를 찾아 다운로드할 수 있습니다. <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-7.png" alt="Font Squirrel 'Free Font Utopia' page listing featured free fonts including Acherus Grotesque, Intro Rust, Source Sans Pro, Open Sans, and Questa, each shown with an alphabet specimen and a Download button" /> +## 폰트 스퀴럴 미리보기 + 폰트를 검색하고 결과를 클릭하면 폰트에 대한 자세한 정보, 샘플, 테스트 드라이브, 글리프, Webfont 키트를 볼 수 있습니다. <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-8.png" alt="Font Squirrel search results for 'Roboto' showing three matches: Roboto, Roboto 2014, and Roboto Slab, each with an alphabet specimen and a Download TTF button" /> @@ -173,6 +187,8 @@ CSS 규칙은 완전히 동일합니다. <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-10.png" alt="Font Squirrel Roboto Specimens section listing all styles with alphabet samples: Roboto Thin, Thin Italic, Light, Light Italic, Regular, Italic, Medium, Medium Italic, Bold, Bold Italic, and Black, each in its respective weight" /> +## 폰트 스퀴럴 사용하기 + 프로젝트에 사용할 폰트를 결정했으면 "Webfont Kit" 탭으로 가세요. 여기서 폰트 라이선스가 `@font-face` CSS 임베딩에 사용할 수 있는지 확인할 수 있습니다. 부분집합과 포맷도 선택할 수 있습니다. <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-11.png" alt="Font Squirrel Roboto Webfont Kit tab showing a license notice confirming @font-face embedding is allowed, a subset selector set to Western Latin, format checkboxes with WOFF selected, and a Download @font-face Kit button" /> diff --git a/curriculum/challenges/korean/blocks/lecture-working-with-css-fonts/672bd853c985cdfdeb32f4f9.md b/curriculum/challenges/korean/blocks/lecture-working-with-css-fonts/672bd853c985cdfdeb32f4f9.md index 06fa7fce259..f368c9496c7 100644 --- a/curriculum/challenges/korean/blocks/lecture-working-with-css-fonts/672bd853c985cdfdeb32f4f9.md +++ b/curriculum/challenges/korean/blocks/lecture-working-with-css-fonts/672bd853c985cdfdeb32f4f9.md @@ -1,6 +1,6 @@ --- id: 672bd853c985cdfdeb32f4f9 -title: text-shadow 속성이란 무엇이며 어떻게 작동하나요? +title: Text-shadow 속성이란 무엇이며 어떻게 작동하나요? challengeType: 19 dashedName: what-is-the-text-shadow-property --- @@ -13,6 +13,8 @@ CSS는 기본적으로 텍스트에 그림자를 적용하지 않습니다. 이 text-shadow: /* Values */ ``` +## `X`와 `Y` 오프셋 값 + CSS에서 그림자는 `X` 오프셋, `Y` 오프셋, 블러 반경, 그리고 색상의 조합으로 설명할 수 있습니다. 먼저 `X` 오프셋과 `Y` 오프셋을 지정해야 하는데, 이들은 각각 텍스트로부터 그림자의 수평 및 수직 거리를 나타내며 필수 값입니다. 그림자에 `X`와 `Y` 오프셋을 적용하는 예시입니다. `text-shadow` 속성을 x-오프셋 `3px`과 y-오프셋 `2px`로 적용합니다: @@ -32,7 +34,11 @@ p { ::: -브라우저에서는 텍스트와 그림자가 비슷하게 보이지만, 오프셋 앞이나 뒤에 값을 지정하여 그림자의 색상을 사용자 지정할 수도 있습니다. 그림자 색상을 설정해 보겠습니다. 여기서는 16진수 색상을 사용하지만, 유효한 어떤 색상 형식도 사용할 수 있습니다. +브라우저에서 텍스트와 그림자는 비슷하게 보일 거예요. + +## 그림자에 색상 추가하기 + +그림자의 색상도 오프셋 앞이나 뒤에 값을 지정해서 맞춤 설정할 수 있어요. 그림자 색상을 설정해 봅시다. 여기서는 16진수 색상을 사용하지만, 유효한 어떤 색상 형식도 사용할 수 있어요. :::interactive_editor @@ -66,7 +72,11 @@ p { ::: -브라우저에서 그림자는 특정 색상을 가지므로 텍스트와 쉽게 구분할 수 있습니다. 이제 그림자와 텍스트를 구분할 수 있게 되었으니, 양수와 음수 값이 그림자 오프셋에 어떻게 영향을 주는지 보는 것도 중요합니다. `X` 오프셋과 `Y` 오프셋의 양수 값은 각각 그림자를 오른쪽과 아래로 이동시키고, 음수 값은 왼쪽과 위로 이동시킵니다. 다음은 음수 값을 사용한 예시입니다: +브라우저에서 그림자는 특정 색상을 가지므로 텍스트와 쉽게 구분할 수 있어요. + +## 양수와 음수 오프셋 값 + +그림자와 텍스트를 구분할 수 있게 되었으니, 이제 양수와 음수 값이 그림자 오프셋에 어떻게 영향을 주는지 보는 것도 중요해요. `X` 오프셋과 `Y` 오프셋의 양수 값은 각각 그림자를 오른쪽과 아래로 이동시키고, 음수 값은 왼쪽과 위로 이동시켜요. 대신 음수 값을 사용하는 예시는 다음과 같아요: :::interactive_editor @@ -83,7 +93,11 @@ p { ::: -이제 그림자가 텍스트에 대해 왼쪽과 위로 이동합니다. 좋습니다. 하지만 그림자가 원본 텍스트와 똑같이 보이고 뒤에 배치되어 있어 보기 좋지 않습니다. 더 멋지게 보이려면 세 번째 값인 블러 반경을 추가해야 합니다. 이 값은 선택 사항이지만 그림자를 훨씬 부드럽고 은은하게 만듭니다. 블러 반경의 기본값은 0입니다. 값이 클수록 블러가 커져 그림자가 더 연해집니다. +이제 그림자가 텍스트에 대해 왼쪽과 위로 이동할 거예요. 좋아요. + +## 블러 반경 + +하지만 그림자가 원래 텍스트와 똑같이 보이고 뒤에 배치되어 있어서 별로 예쁘지 않아요. 더 예쁘게 보이려면 세 번째 값인 블러 반경을 추가해야 해요. 이 값은 선택 사항이지만 그림자를 훨씬 부드럽고 은은하게 만들어 줘요. 블러 반경의 기본값은 0이에요. 값이 클수록 블러가 커져서 그림자가 더 연해진다는 뜻이에요. 여기서는 블러 반경을 `3px`로 설정하고 오프셋은 다시 양수 값으로 지정했습니다: @@ -104,6 +118,8 @@ p { 이제 그림자처럼 보이기 시작합니다. 더 흐릿하고 은은해서 텍스트에 포커스를 맞추면서 그림자가 배경에 스타일을 더합니다. 여기서부터 오프셋, 색상, 블러 반경 값을 조금씩 조정해 필요에 맞는 조합을 찾을 수 있습니다. +## 여러 개의 그림자 추가하기 + 또한 텍스트에 그림자를 여러 개 적용할 수 있다는 점도 유용합니다. 같은 `text-shadow` 속성에 쉼표로 구분하여 작성하면 됩니다. 그림자는 앞에서 뒤로, 첫 번째 그림자가 가장 위에 있는 레이어로 적용됩니다. 다음은 세 개의 그림자가 레이어로 적용된 단락 예시입니다. 이 모든 그림자가 같은 `text-shadow` 속성에 쉼표로 구분되어 정의된 것을 확인하세요: diff --git a/curriculum/challenges/korean/blocks/lecture-working-with-css-transforms-overflow-and-filters/672bccc8ea33bad87abb3c56.md b/curriculum/challenges/korean/blocks/lecture-working-with-css-transforms-overflow-and-filters/672bccc8ea33bad87abb3c56.md index 055b08172b2..dd33275b081 100644 --- a/curriculum/challenges/korean/blocks/lecture-working-with-css-transforms-overflow-and-filters/672bccc8ea33bad87abb3c56.md +++ b/curriculum/challenges/korean/blocks/lecture-working-with-css-transforms-overflow-and-filters/672bccc8ea33bad87abb3c56.md @@ -1,6 +1,6 @@ --- id: 672bccc8ea33bad87abb3c56 -title: content-box와 border-box의 차이점은 무엇인가요? +title: Content-box와 border-box의 차이점은 무엇인가요? challengeType: 19 dashedName: what-is-the-difference-between-content-box-and-border-box --- @@ -19,6 +19,8 @@ dashedName: what-is-the-difference-between-content-box-and-border-box `box-sizing` 속성의 기본값은 `content-box`이지만, 필요에 따라 `border-box`를 선택할 수 있습니다. 먼저 `content-box`를 살펴보고 그다음 `border-box`를 알아보겠습니다. +## CSS 박스 모델 검토 + 모델이 어떻게 작동하는지 이해하려면 CSS 박스 모델의 네 가지 핵심 개념에 익숙해야 합니다. 빠르게 검토해 보겠습니다. - 콘텐츠 영역은 요소의 콘텐츠가 차지하는 공간입니다. @@ -26,6 +28,8 @@ dashedName: what-is-the-difference-between-content-box-and-border-box - border은 콘텐츠 영역과 padding을 둘러싼 윤곽선입니다. - margin은 border 바깥에 있어 요소와 다른 요소를 구분하는 공간입니다. +## `content-box` 작동 방식 + `content-box` 모델에서는 요소에 설정한 너비와 높이가 콘텐츠 영역의 크기를 결정하며 padding, border, margin는 포함하지 않습니다. 콘텐츠 영역을 정확히 제어해야 할 때 `content-box`을 사용하세요. `width`과 `height`를 설정하면 콘텐츠 자체 크기만 설정하는 것입니다. 요소의 전체 너비를 구하려면 좌우 padding과 좌우 border를 더해야 합니다. 마찬가지로 요소의 전체 높이는 콘텐츠 높이, 상하 padding, 상하 border를 더해서 구합니다. @@ -52,10 +56,14 @@ div { 이 경우 `content-box`를 사용하면 콘텐츠 영역은 300px x 200px입니다. 전체 렌더링 크기는 padding과 border를 포함합니다 — 예를 들어, 전체 너비 = 300px(콘텐츠) + 40px(padding) + 8px(border) = 348px; 전체 높이도 같은 방식으로 계산됩니다. +## `border-box` 작동 방식 + 좋아요! 이제 `border-box`를 살펴보겠습니다. 이 모델은 설정한 너비와 높이에 요소의 콘텐츠, padding, border가 포함됩니다(단, margin는 제외). `border-box`은 padding이나 border가 변경되어도 요소의 전체 크기를 고정하고 싶을 때 유용하며, 반응형 레이아웃에서 자주 사용됩니다. `border-box`에서는 padding과 border가 요소가 지정한 크기 안에 포함됩니다. 설정한 `width`과 `height`가 요소의 전체 크기(콘텐츠 + padding + border)가 되며, margin는 제외됩니다. +## 두 모델 비교 + 다음 예제에는 동일한 크기지만 `box-sizing` 값이 다른 두 `div` 요소가 있습니다. 브라우저에서 보면 전체 크기가 다르게 나타나는 것을 확인할 수 있습니다: :::interactive_editor diff --git a/curriculum/challenges/korean/blocks/lecture-working-with-dates/6733aafb9c0802f66cc1e056.md b/curriculum/challenges/korean/blocks/lecture-working-with-dates/6733aafb9c0802f66cc1e056.md index 863ba226654..604dfef971a 100644 --- a/curriculum/challenges/korean/blocks/lecture-working-with-dates/6733aafb9c0802f66cc1e056.md +++ b/curriculum/challenges/korean/blocks/lecture-working-with-dates/6733aafb9c0802f66cc1e056.md @@ -34,21 +34,31 @@ console.log(now); 시간은 24시간제 형식을 사용하므로 `14:30`은 `2:30 PM`입니다. `GMT-0700`는 시간대 오프셋이며, `Pacific Daylight Time`은 시간대 이름입니다. -또한 연도, 월, 일, 시, 분, 초, 밀리초 값을 인수로 제공하여 `Date` 객체에 특정 날짜와 시간을 전달할 수 있습니다. +특정 날짜 문자열로 새 `Date` 객체를 만드는 예시는 다음과 같습니다: -특정 날짜와 시간으로 새 `Date` 객체를 생성하는 예시는 다음과 같습니다: +:::interactive_editor + +```js +const dateFromString = new Date("July 4, 1776 12:00:00"); + +console.log(dateFromString); +``` + +::: + +`Date` 객체에 연도, 월, 일, 시, 분, 초, 밀리초 값을 인수로 전달하여 특정 날짜와 시간을 지정할 수도 있습니다: :::interactive_editor ```js -const specificDate = new Date("July 4, 1776 12:00:00"); +const dateFromArguments = new Date(1776, 6, 4, 12, 0, 0, 0); -console.log(specificDate); +console.log(dateFromArguments); ``` ::: -이는 현재 날짜와 시간 대신 특정 날짜와 시간을 다뤄야 할 때 유용합니다. 입력은 항상 문자열이어야 하며, `Date` 객체가 인식할 수 있는 형식이어야 합니다. +이는 현재 날짜와 시간이 아니라 특정 날짜와 시간으로 작업해야 할 때 유용합니다. 현재 날짜와 시간을 얻으려면 `Date.now()` 메서드를 사용할 수 있는데, 이 메서드는 `January 1, 1970, 00:00:00 UTC` 이후의 밀리초 수를 반환합니다. 이를 유닉스 에포크 시간이라고 합니다. diff --git a/curriculum/challenges/korean/blocks/lecture-working-with-file-systems/672ac403a9ba7732b31c6480.md b/curriculum/challenges/korean/blocks/lecture-working-with-file-systems/672ac403a9ba7732b31c6480.md index 252340d7512..4bacff87b3d 100644 --- a/curriculum/challenges/korean/blocks/lecture-working-with-file-systems/672ac403a9ba7732b31c6480.md +++ b/curriculum/challenges/korean/blocks/lecture-working-with-file-systems/672ac403a9ba7732b31c6480.md @@ -51,7 +51,7 @@ WOFF2는 WOFF의 후속 형식으로, 더 효율적인 압축과 성능을 제 이 문서들은 보통 마크다운이라는 파일 형식으로 작성됩니다. 마크다운을 사용하면 제목, 부제목, 링크, 이미지, 목록 등으로 구조화된 문서를 만들 수 있습니다. 마크다운 파일은 `.md` 또는 `.markdown` 확장자를 가집니다. -여기 freeCodeCamp GitHub 저장소의 `README` 파일이 있습니다: https://github.com/freeCodeCamp/freeCodeCamp/blob/main/README.md +여기에서 freeCodeCamp의 GitHub 저장소에 있는 `README` 파일을 찾을 수 있습니다: `https://github.com/freeCodeCamp/freeCodeCamp/blob/main/README.md` 마크다운을 사용해 이렇게 상세한 구조와 형식을 만들 수 있습니다. diff --git a/curriculum/challenges/korean/blocks/lecture-working-with-node-core-modules/695cc6a5eefd305381ec90bc.md b/curriculum/challenges/korean/blocks/lecture-working-with-node-core-modules/695cc6a5eefd305381ec90bc.md index 6dc42dcf7b9..f59230db9d7 100644 --- a/curriculum/challenges/korean/blocks/lecture-working-with-node-core-modules/695cc6a5eefd305381ec90bc.md +++ b/curriculum/challenges/korean/blocks/lecture-working-with-node-core-modules/695cc6a5eefd305381ec90bc.md @@ -1,6 +1,6 @@ --- id: 695cc6a5eefd305381ec90bc -title: fs 모듈이란 무엇이며 어떻게 작동하나요? +title: Fs 모듈이란 무엇이며 어떻게 작동하나요? challengeType: 19 dashedName: what-is-the-fs-module-and-how-does-it-work --- @@ -148,7 +148,7 @@ async function readFileContent() { const fileContent = await fs.readFile("article.md", "utf8"); console.log("File content:", fileContent); } catch (err) { - console.log("File read successfully"); + console.error("Error reading file:", err); } } @@ -169,7 +169,7 @@ async function readFileContent() { const fileContent = await fs.readFile("article.md"); console.log("File content:", fileContent); } catch (err) { - console.log("File read successfully"); + console.error("Error reading file:", err); } } @@ -318,3 +318,4 @@ JSON 파싱과 함께, 예를 들어 `fs.parseFile()`. ## --video-solution-- 4 + diff --git a/curriculum/challenges/korean/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d2f232c60f0fa68ef86.md b/curriculum/challenges/korean/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d2f232c60f0fa68ef86.md index d047b2e5de8..f348a98a92d 100644 --- a/curriculum/challenges/korean/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d2f232c60f0fa68ef86.md +++ b/curriculum/challenges/korean/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d2f232c60f0fa68ef86.md @@ -1,6 +1,6 @@ --- id: 68ff6d2f232c60f0fa68ef86 -title: Node란 무엇이며 브라우저와 Node 런타임 환경의 차이점은 무엇인가요? +title: Node란 무엇이며 브라우저와 Node 런타임 환경 간의 차이점은 무엇인가요? challengeType: 19 dashedName: what-is-node-and-what-are-some-differences-between-the-browser-and-node-runtime-environment --- @@ -19,11 +19,11 @@ dashedName: what-is-node-and-what-are-some-differences-between-the-browser-and-n 클라이언트 측 JavaScript가 이런 제한을 가지는 이유는 처음에 웹 브라우저에서만 실행되도록 설계되었기 때문입니다. -웹 브라우저는 JavaScript 코드를 실행하는 데 필요한 환경을 제공합니다. 여기에는 JavaScript 엔진도 포함됩니다. 또한 문서 객체 모델(DOM)에 접근할 수 있어 코드에서 HTML 요소에 접근할 수 있습니다. +웹 브라우저는 JavaScript 엔진을 포함해 JavaScript 코드를 실행하는 데 필요한 환경을 제공합니다. 또한 문서 객체 모델(DOM)에 접근할 수 있어 코드에서 HTML 요소에 접근할 수 있습니다. -이전에는 브라우저 외부에서 JavaScript를 실행할 수 없었지만, 이제는 Node.js로 가능합니다. +오랫동안 JavaScript는 거의 독점적으로 브라우저 내에서 사용되었지만, Node.js를 사용하면 브라우저 외부에서도 실행할 수 있습니다. -Node.js는 JavaScript 런타임 환경입니다. 공식적으로는 “오픈 소스이자 크로스 플랫폼 JavaScript 런타임 환경”으로 정의됩니다. +Node.js는 JavaScript 런타임 환경입니다. 공식적으로는 "오픈 소스이자 크로스 플랫폼 JavaScript 런타임 환경"으로 정의됩니다. 이것이 의미하는 바를 살펴보겠습니다: @@ -43,7 +43,7 @@ Node.js가 무엇인지 알았으니, 이제 브라우저와 Node 런타임 환 예를 들어, 브라우저에서는 DOM API에 접근할 수 있지만 로컬 파일 시스템 접근에는 제한이 있습니다. 반면 Node 런타임 환경에서는 파일 시스템을 포함한 거의 모든 시스템 자원에 접근할 수 있지만 DOM에는 접근할 수 없습니다. -두 JavaScript 환경 모두 전역 객체를 제공합니다. 브라우저 JavaScript 런타임에서는 이것을 `window`라고 부릅니다. 이 `window` 객체는 DOM 조작, 쿠키 관리, 브라우저 이벤트 처리 같은 브라우저 관련 기능에 접근할 수 있게 해줍니다. Node.js 환경에서는 이 전역 객체를 `global`라고 부릅니다. `global` 객체는 로컬 파일 작업, 네트워킹, 운영체제와 상호작용하는 내장 모듈 같은 Node.js 고유 기능에 접근할 수 있게 해줍니다. +두 JavaScript 환경 모두 전역 객체를 제공합니다. 브라우저 JavaScript 런타임에서는 이를 `window`라고 부릅니다. 이 `window` 객체는 DOM 조작, 쿠키 관리, 브라우저 이벤트 처리 메서드 등 브라우저 관련 기능에 접근할 수 있게 합니다. 반면 Node.js 환경에서는 이 전역 객체를 `global`이라고 부릅니다. `global` 객체는 로컬 파일 작업, 네트워킹, 운영 체제와 상호작용하는 내장 모듈 등 Node.js 고유 기능에 접근할 수 있게 합니다. 마지막으로 중요한 차이점은 서버에서 사용할 Node.js 버전을 선택할 수 있지만, 사용자가 웹사이트를 방문할 때 사용하는 브라우저 환경 버전은 제어할 수 없다는 점입니다. @@ -77,7 +77,7 @@ Node.js를 사용할 때 JavaScript 코드가 어디서 어떻게 실행되는 --- -사용자 인터페이스를 구축하기 위한 JavaScript 프레임워크입니다. +사용자 인터페이스를 구축하는 JavaScript 프레임워크입니다. ### --feedback-- @@ -103,7 +103,7 @@ Node.js를 사용할 때 JavaScript 코드가 어디서 어떻게 실행되는 --- -Node 런타임 환경은 전역 객체로 window 객체를 사용하지만, 브라우저는 global 객체를 사용합니다. +Node 런타임 환경은 전역 객체로 `window`를 사용하는 반면, 브라우저는 `global` 객체를 사용한다는 설명은 잘못되었습니다. ### --feedback-- diff --git a/curriculum/challenges/korean/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d372ad364f285f0522e.md b/curriculum/challenges/korean/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d372ad364f285f0522e.md index 944d2a27e85..ef82ed7eff3 100644 --- a/curriculum/challenges/korean/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d372ad364f285f0522e.md +++ b/curriculum/challenges/korean/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d372ad364f285f0522e.md @@ -11,7 +11,7 @@ Node.js의 큰 장점 중 하나는 웹 애플리케이션의 프론트엔드와 Node의 아키텍처도 또 다른 장점입니다. 비차단, 이벤트 기반 아키텍처를 가지고 있어 반응성과 효율성이 중요한 실시간 애플리케이션 개발에 매우 적합합니다. -여기서 “스레드”라는 개념이 매우 중요해집니다. 스레드는 현재 실행 중인 컴퓨터 프로그램과 같은 프로세스 내 실행 경로입니다. +여기서 "스레드" 개념이 매우 중요해집니다. 스레드는 현재 실행 중인 컴퓨터 프로그램인 프로세스 내에서 실행 경로를 의미합니다. Node의 아키텍처는 단일 스레드와 이벤트 루프에 의존하여 많은 수의 동시 요청과 입출력 작업을 효과적으로 처리할 수 있습니다. 이는 여러 요청을 동시에 처리해야 하는 애플리케이션에 완벽합니다. @@ -25,13 +25,13 @@ HTTP 요청 처리, 데이터베이스 작업, 날짜 및 시간 포맷, 코드 반면에 Node.js에는 알아야 할 몇 가지 단점이나 제한 사항도 있습니다. -앞서 배운 것처럼 한 번에 하나의 스레드만 실행되므로 한 번에 하나의 작업만 처리할 수 있습니다. 아키텍처 덕분에 동시(동시에 발생하는) 요청을 효율적으로 처리할 수 있지만, CPU 집약적인 작업은 메인 스레드를 차단해 성능 문제를 일으킬 수 있습니다. +알다시피, Node는 JavaScript를 단일 스레드에서 실행하므로 한 번에 코드 한 부분만 실행할 수 있습니다. 비록 그 아키텍처가 동시(동시다발적) 요청을 효율적으로 처리할 수 있게 하지만, CPU 집약적인 작업은 메인 스레드를 막아 성능 문제를 일으킬 수 있습니다. CPU 집약적인 작업 예로는 복잡한 수학 연산, 이미지 및 비디오 처리, 암호화가 있습니다. 이를 극복하는 방법도 있지만 보통 애플리케이션의 복잡성을 증가시킵니다. -Node.js는 또한 비동기 프로그래밍에 의존합니다. 비동기 프로그래밍에서는 실행하는 데 시간이 오래 걸릴 수 있는 작업을 시작하지만 완료될 때까지 기다리지 않고 메인 프로그램이 계속 실행되며 비동기 작업은 병렬로 실행됩니다. 작업이 완료되면 프로그램이 결과를 처리합니다. +비동기 프로그래밍에서는 실행하는 데 시간이 오래 걸릴 수 있는 작업이 시작되지만, 완료될 때까지 기다리지 않고 메인 프로그램은 계속 실행되며 비동기 작업은 백그라운드에서 실행됩니다. -이 과정은 종종 “콜백”으로 알려진, 비동기 작업이 완료되었을 때 실행할 내용을 정의하는 함수와 관련됩니다. Node.js의 비동기 특성은 코드를 읽고 이해하며 디버그하기 더 어렵게 만들 수 있습니다. +이 과정은 종종 "콜백"으로 알려진 함수들을 포함하는데, 이 함수들은 비동기 작업이 완료되었을 때 어떤 일이 일어나는지를 정의합니다. Node.js의 비동기 특성은 코드를 읽고 이해하며 디버그하기 더 어렵게 만들 수 있습니다. 마지막으로, `npm`인 Node 패키지 관리자의 패키지를 선택할 때 주의해야 합니다. 일부 패키지는 지속적으로 유지 관리되지 않아 애플리케이션에 취약점을 도입할 수 있기 때문입니다. 개발자로서 각 패키지를 신중히 평가하고 품질과 보안 모범 사례를 따르는지 확인해야 합니다. diff --git a/curriculum/challenges/korean/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d39d7ed9ef36ff281f3.md b/curriculum/challenges/korean/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d39d7ed9ef36ff281f3.md index b88085d9f34..80597138d23 100644 --- a/curriculum/challenges/korean/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d39d7ed9ef36ff281f3.md +++ b/curriculum/challenges/korean/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d39d7ed9ef36ff281f3.md @@ -17,7 +17,7 @@ macOS/Linux와 Windows에서 NVM을 설치하는 방법과 이를 사용해 Node macOS와 Linux에서는 셸 스크립트를 통해 직접 NVM을 설치할 수 있습니다. -하지만 macOS의 경우, NVM 공식 문서에 “설치 스크립트를 실행하기 전에 Xcode 명령줄 도구를 수동으로 설치해야 하며, 그렇지 않으면 실패할 수 있다”고 명시되어 있습니다. +하지만 macOS의 경우, NVM 공식 문서에서 "설치 스크립트를 실행하기 전에 Xcode 명령줄 도구를 수동으로 설치해야 하며, 그렇지 않으면 실패할 수 있다"고 명시하고 있음을 참고하세요. macOS에서는 터미널에서 다음 명령어를 실행해 Xcode 명령줄 도구를 설치할 수 있습니다: @@ -41,7 +41,7 @@ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash ``` -이 글을 읽는 시점에 최신 NVM 버전을 확인하려면 공식 NVM 문서 `https://github.com/nvm-sh/nvm?tab=readme-ov-file#install--update-script`를 참조하세요. 거기에서 최신 버전 번호가 포함된 명령어를 찾을 수 있습니다. +이 수업을 읽는 시점의 최신 NVM 버전을 확인하려면 공식 NVM 문서 `https://github.com/nvm-sh/nvm?tab=readme-ov-file#install--update-script`를 참조하세요. 거기에서 최신 버전 번호가 포함된 명령어를 찾을 수 있습니다. 설치가 완료되면 새 명령과 설정을 적용하기 위해 터미널을 재시작해야 할 수도 있습니다. @@ -53,7 +53,7 @@ nvm -v 출력에 NVM 버전이 표시되어야 합니다. -## macOS/Linux에서 NVM으로 Node.js 설치하기 +## macOS/Linux에서 NVM으로 Node.js 설치하는 방법 이제 macOS/Linux에 NVM이 설치되었으니 Node.js를 설치할 수 있습니다. @@ -95,13 +95,13 @@ nvm use 20 node -v ``` -## Windows에서 NVM 설치 방법 +## Windows에서 NVM 설치하는 방법 이제 Windows에서 NVM을 설치하고 사용하는 방법을 살펴보겠습니다. 공식 NVM 버전은 특정 경우에만 Windows를 지원합니다. 만약 Windows Subsystem for Linux(WSL)를 설정했다면, 위 macOS/Linux 가이드를 따라 NVM을 설치하고 사용할 수 있습니다. -하지만 Windows 자체에서는 몇 가지 대안이 있습니다. 그중 하나가 `nvm-windows`로, Windows용 Node.js 버전 관리 유틸리티입니다. 이 도구는 공식 NVM 프로젝트와는 완전히 별개의 프로젝트입니다. 하지만 목적은 동일합니다 — 같은 장치에서 여러 Node.js 버전을 쉽게 관리할 수 있도록 돕는 것입니다. +하지만 Windows 자체에서는 몇 가지 대안이 있습니다. 그중 하나가 Windows용 Node.js 버전 관리 도구인 `nvm-windows`입니다. 이 도구는 공식 NVM 프로젝트와 완전히 별개의 프로젝트입니다. 하지만 이 도구들의 목적은 동일합니다: 같은 장치에서 여러 Node.js 버전을 쉽게 관리할 수 있도록 돕는 것입니다. `nvm-windows`를 설치하기 전에, 공식 저장소에서는 NVM for Windows를 설치하기 전에 기존 Node 설치를 제거할 것을 권장합니다. 만약 처음 Node.js를 설치하는 것이라면 문제없지만, 이미 다른 버전이 설치되어 있다면 먼저 제거하는 것이 좋습니다. @@ -119,7 +119,7 @@ node -v nvm -v ``` -## Windows에서 NVM으로 Node.js 설치하기 +## Windows용 NVM으로 Node.js 설치하는 방법 이제 Windows에 `nvm-windows`가 설치되었으니 Node.js를 설치할 준비가 되었습니다. @@ -155,7 +155,7 @@ nvm use 20 현재 Node.js 버전을 확인하려면 다음 명령어를 사용하세요: -```bash +```powershell node -v ``` @@ -165,25 +165,25 @@ node -v 또한, 이 모든 명령어는 macOS/Linux에 설치된 NVM과 WSL에서는 작동하지만, `nvm-windows`에서는 다르게 작동하거나 전혀 작동하지 않을 수 있습니다. 가능한 경우 `nvm-windows`에 대한 대체 명령어도 알려드리겠습니다. -### Powershell 실행 정책 조정 방법 +### PowerShell 실행 정책 조정 방법 -Windows에서 Powershell과 `nvm-windows`를 사용 중이라면 Powershell 실행 정책을 조정해야 할 수도 있습니다. Powershell의 기본 실행 정책은 `Restricted`로, 스크립트 실행을 막는 보안 조치입니다. +Windows에서 PowerShell과 `nvm-windows`를 사용 중이라면 PowerShell 실행 정책을 조정해야 할 수 있습니다. PowerShell의 기본 실행 정책은 `Restricted`로, 이는 스크립트 실행을 막는 보안 조치입니다. -먼저, Powershell 아이콘을 마우스 오른쪽 버튼으로 클릭하고 “관리자 권한으로 실행”을 선택해 Powershell을 관리자 권한으로 실행하세요. +먼저, PowerShell 아이콘을 마우스 오른쪽 버튼으로 클릭하고 "관리자 권한으로 실행"을 선택해 PowerShell을 관리자 권한으로 실행하세요. -그다음 현재 Powershell 세션의 실행 정책을 확인하려면 다음 명령어를 실행하세요: +그다음, 현재 PowerShell 세션의 실행 정책을 확인하려면 다음 명령어를 실행하세요: ```powershell Get-ExecutionPolicy ``` -마지막으로, 로컬 스크립트와 `RemoteSigned` 실행을 허용하는 `npm` 실행 정책으로 설정하려면 다음 명령어를 사용하세요: +마지막으로, 로컬 스크립트와 `npm` 실행을 허용하는 `RemoteSigned`로 PowerShell 실행 정책을 설정하려면 다음 명령어를 사용하세요: ```powershell Set-ExecutionPolicy RemoteSigned ``` -위 명령어를 실행한 후에는 관리자 권한 Powershell 창을 닫고, 일반 권한 Powershell 창을 새로 열면 됩니다. +위 명령어를 실행한 후에는 관리자 권한 PowerShell 창을 닫고, 일반 권한 PowerShell 창을 새로 열면 됩니다. ### 설치된 모든 버전 목록 보기 @@ -193,7 +193,7 @@ Set-ExecutionPolicy RemoteSigned nvm ls ``` -### 기본 Node.js 버전 설정 (macOS/Linux의 NVM 전용) +### 기본 Node.js 버전 설정 (macOS/Linux NVM 전용) 이 명령어는 새 터미널 세션에서 사용할 기본 Node.js 버전을 설정합니다: @@ -231,7 +231,7 @@ nvm use <new_name> nvm use new-api ``` -### Node.js 버전 제거하기 +### Node.js 버전 제거 Node.js 버전을 제거하려면 다음 명령어를 실행하세요: @@ -271,7 +271,7 @@ node -v npm -v ``` -### JavaScript 파일 실행하기 +### JavaScript 파일 실행 이 명령어는 현재 활성화된 Node.js 런타임에서 지정한 JavaScript 파일을 실행합니다: @@ -285,7 +285,7 @@ node <file.js> node app.js ``` -### Node.js 프로젝트 생성하기 +### Node.js 프로젝트 생성 이 명령어는 프로젝트 세부 정보와 의존성을 추적하는 `package.json` 파일을 생성해 새 Node.js 프로젝트를 만듭니다. @@ -295,7 +295,7 @@ npm init `npm init` 명령어를 실행하면 `package.json` 파일 설정을 위한 대화형 명령줄 가이드가 시작됩니다. 프로젝트 이름, 설명, 버전 등을 묻습니다. 기본 `package.json` 파일로 시작하려면 `npm init -y` 또는 `npm init --yes` 명령어를 사용할 수 있습니다. -### 패키지 설치하기 +### 패키지 설치 특정 패키지를 설치하려면 다음 명령어를 실행하세요: @@ -430,3 +430,4 @@ Node.js 애플리케이션을 효율적으로 디버그하기 위해서입니다 ## --video-solution-- 1 + diff --git a/curriculum/challenges/korean/blocks/lecture-working-with-operator-behavior/6732719e2e3ad4d947410b65.md b/curriculum/challenges/korean/blocks/lecture-working-with-operator-behavior/6732719e2e3ad4d947410b65.md index eb1510b22ba..2d01b8988b2 100644 --- a/curriculum/challenges/korean/blocks/lecture-working-with-operator-behavior/6732719e2e3ad4d947410b65.md +++ b/curriculum/challenges/korean/blocks/lecture-working-with-operator-behavior/6732719e2e3ad4d947410b65.md @@ -11,7 +11,13 @@ JavaScript에서 여러 연산자가 포함된 표현식을 작성하면, JavaSc 연산자 우선순위는 표현식에서 연산이 평가되는 순서를 결정합니다. 우선순위가 높은 연산자가 낮은 연산자보다 먼저 평가됩니다. 수학에서 나누기와 곱셈이 덧셈과 뺄셈보다 먼저 일어나는 것과 비슷하게 생각하세요. -이 규칙을 따르지 않으면 기본적인 방정식도 잘못된 답을 내게 됩니다. JavaScript도 마찬가지입니다. 어떤 연산자가 먼저, 두 번째로, 그다음으로 오는지에 대한 자체 규칙이 있습니다. 예를 들어, 아래 표현식을 보세요: +이 규칙을 따르지 않으면 기본 방정식이 잘못된 답을 줄 수 있습니다. JavaScript도 마찬가지로 작동합니다. 어떤 연산자가 먼저, 두 번째로, 그다음에 오는지에 대한 자체 규칙이 있습니다. + +## 산술 표현식에서의 우선순위 + +### 곱셈 우선순위 + +예를 들어, 아래 표현식을 살펴보세요: :::interactive_editor @@ -25,36 +31,42 @@ console.log(result); // 14 JavaScript가 이 표현식을 왼쪽에서 오른쪽으로 평가한다면 `2 + 3 = 5`가 먼저, 그다음 `5 * 4 = 20`가 평가될 것으로 예상할 수 있습니다. 하지만 곱셈이 덧셈보다 우선순위가 높기 때문에 JavaScript는 `3 * 4` 부분을 먼저 평가하여 `2 + 12 = 14` 결과를 얻습니다. -때로는 우선순위 규칙과 상관없이 표현식의 특정 부분을 먼저 실행하고 싶을 수 있습니다. 이럴 때는 소괄호(`()`)를 사용하세요. 소괄호 안에 있는 내용은 무엇이든 우선적으로 평가됩니다. 이전 예제에서 `2 + 3` 부분을 먼저 평가하도록 만들어 보겠습니다: +### 나눗셈 우선순위 + +나누기 연산자도 덧셈이나 뺄셈보다 우선순위가 높습니다: :::interactive_editor ```js -const result = (2 + 3) * 4; +const result = 2 + 6 / 3; -console.log(result); // 20 +console.log(result); // 4 ``` ::: -위 예제에서 소괄호는 JavaScript가 `2 + 3`를 먼저 평가하도록 강제하고, 그 결과에 `4`를 곱하게 만듭니다. 그래서 `20` 대신 `14` 결과가 나옵니다. +JavaScript가 이 표현식을 왼쪽에서 오른쪽으로 평가한다면 `2 + 6 = 8`가 먼저, 그다음 `8 / 3 = 2.67`가 평가될 것으로 예상할 수 있습니다. 하지만 나누기가 덧셈보다 우선순위가 높기 때문에 JavaScript는 먼저 나누기를 평가하여 `6 / 3 = 2`를 계산하고, 그다음 `2 + 2`를 더해 `4` 결과를 얻습니다. -나누기 연산자도 덧셈이나 뺄셈보다 우선순위가 높습니다: +### 우선순위를 재정의하기 위해 소괄호 사용하기 + +때때로 우선순위 규칙과 상관없이 표현식의 특정 부분을 먼저 실행하고 싶을 수 있습니다. 이럴 때 소괄호 `()`를 사용하세요. 소괄호 안에 있는 것은 무엇이든 먼저 평가됩니다. 곱셈 예제에서 `2 + 3` 부분을 먼저 평가하게 만들어 봅시다: :::interactive_editor ```js -const result = 2 + 6 / 3; +const result = (2 + 3) * 4; -console.log(result); // 4 +console.log(result); // 20 ``` ::: -JavaScript가 이 표현식을 왼쪽에서 오른쪽으로 평가한다면 `2 + 6 = 8`가 먼저, 그다음 `8 / 3 = 2.67`가 평가될 것으로 예상할 수 있습니다. 하지만 나누기가 덧셈보다 우선순위가 높기 때문에 JavaScript는 먼저 나누기를 평가하여 `6 / 3 = 2`를 계산하고, 그다음 `2 + 2`를 더해 `4` 결과를 얻습니다. +위 예제에서 소괄호는 JavaScript가 `2 + 3`를 먼저 평가하도록 강제하고, 그 결과에 `4`를 곱하게 만듭니다. 그래서 `20` 대신 `14` 결과가 나옵니다. 따라서 곱셈과 나누기는 소괄호로 순서를 바꾸지 않는 한 항상 덧셈과 뺄셈보다 먼저 실행됩니다. 그렇다면 연산자들의 우선순위가 같으면 어떻게 될까요? JavaScript는 평가 순서를 결정하기 위해 결합법칙을 사용합니다. +## 결합법칙 이해하기 + 결합법칙은 JavaScript가 연산자를 왼쪽에서 오른쪽으로 평가할지, 오른쪽에서 왼쪽으로 평가할지 알려줍니다. 덧셈과 곱셈 같은 대부분 연산자는 왼쪽에서 오른쪽으로 결합합니다. 그래서 JavaScript는 표현식의 가장 왼쪽부터 오른쪽으로 처리합니다: :::interactive_editor @@ -84,6 +96,8 @@ console.log(a + b); // 10 위 예제에서 JavaScript는 먼저 `5`를 `b`에 할당하고, 그다음 `b` (현재 `5`)를 `a`에 할당합니다. +### 지수 연산자 + 거듭제곱 연산자도 오른쪽에서 왼쪽으로 결합합니다: :::interactive_editor diff --git a/curriculum/challenges/korean/blocks/lecture-working-with-regular-expressions/6733c5e54e3a154c8078ed48.md b/curriculum/challenges/korean/blocks/lecture-working-with-regular-expressions/6733c5e54e3a154c8078ed48.md index 2097c246953..a64ff677eab 100644 --- a/curriculum/challenges/korean/blocks/lecture-working-with-regular-expressions/6733c5e54e3a154c8078ed48.md +++ b/curriculum/challenges/korean/blocks/lecture-working-with-regular-expressions/6733c5e54e3a154c8078ed48.md @@ -17,6 +17,8 @@ const regex = /^\d\d\d\d$/; 이 방법은 작동합니다: 네 개의 숫자 문자를 일치시킵니다. 하지만 같은 클래스를 여러 번 작성하는 대신 수량자를 사용할 수 있습니다. +## 정확한 수량자 + 수량자는 중괄호 안에 한 개 또는 두 개의 숫자를 넣어 정의합니다. 패턴에 수량자를 사용해 보겠습니다: ```js @@ -40,6 +42,8 @@ console.log(regex.test("1234567")); // false 앵커를 사용했고 수량자가 정확히 네 개만 허용하므로, 이 패턴은 정확히 네 자리 숫자 문자열만 일치시킵니다. 하지만 식별 코드는 네 자리 이상이어야 할 수도 있습니다. +## 최솟값과 최댓값 수량자 + 네 자리 이상을 허용하려면 수량자 숫자 뒤에 쉼표를 추가하세요: ```js @@ -84,6 +88,10 @@ console.log(regex.test("1234567")); // false 이 구문은 최댓값만 설정할 수 없다는 점에 유의하세요: 항상 최솟값을 설정해야 합니다. 하지만 최솟값을 `1`로 설정하면 사실상 같은 결과를 얻을 수 있습니다. +## 축약 수량자 + +### 물음표 수량자 (`?`) + 사용자 요구사항이 업데이트되었습니다. 식별자는 이제 선택적으로 문자로 시작할 수 있습니다. 이미 해당 문자 클래스는 알고 있으니 정규식에 추가해 보겠습니다: ```js @@ -122,6 +130,8 @@ console.log(regex.test("1234567")); // false 이제 패턴은 한 개의 선택적 문자 다음에 네 자리에서 여섯 자리 숫자를 허용합니다. +### 별표 수량자 (`*`) + 불행히도 요구사항을 잘못 읽은 것을 방금 알았습니다. 숫자 앞에 아무 개수의 문자가 올 수 있어야 합니다. 최솟값이 `0`이고 최댓값이 없는 수량자를 사용할 수 있습니다: ```js @@ -144,6 +154,8 @@ console.log(regex.test("1234567")); // false ::: +### 더하기 수량자 (`+`) + 이제 0개 이상의 문자 다음에 4~6개의 숫자가 오는 모든 식별자를 성공적으로 일치시킵니다. 하지만 이게 시스템을 다운시키는 것으로 나타났습니다: 실제로는 최소한 한 글자는 반드시 필요합니다. 다시 말해, 최솟값 1에 최댓값이 없는 수량자를 사용할 수도 있고, 또 다른 특별한 구문인 더하기(`+`) 기호를 사용할 수도 있습니다: diff --git a/curriculum/challenges/korean/blocks/lecture-working-with-the-dom-click-events-and-web-apis/673368ccf52205329b729378.md b/curriculum/challenges/korean/blocks/lecture-working-with-the-dom-click-events-and-web-apis/673368ccf52205329b729378.md index 1b154c02a60..689b3ae4f88 100644 --- a/curriculum/challenges/korean/blocks/lecture-working-with-the-dom-click-events-and-web-apis/673368ccf52205329b729378.md +++ b/curriculum/challenges/korean/blocks/lecture-working-with-the-dom-click-events-and-web-apis/673368ccf52205329b729378.md @@ -1,18 +1,22 @@ --- id: 673368ccf52205329b729378 -title: "innerText, textContent, innerHTML의 차이점은 무엇인가요?" +title: "InnerText, textContent, innerHTML의 차이점은 무엇인가요?" challengeType: 19 dashedName: what-is-the-difference-between-innertext-textcontent-and-innerhtml --- # --interactive-- +## 개요 + `innerText`, `textContent`, `innerHTML`에 대해 배워봅시다. 이들은 JavaScript에서 HTML 요소의 내용을 가져오거나 변경할 때 접근할 수 있는 속성입니다. 처음에는 매우 비슷해 보일 수 있지만, 중요한 차이점이 있습니다. 어떤 것을 선택할지는 특정 사용 사례에 따라 다르니 자세히 살펴보겠습니다. 먼저 `innerText`부터 시작하겠습니다. +## innerText 이해하기 + `innerText`는 HTML 요소와 그 자손 요소의 보이는 텍스트 내용을 나타냅니다. 이 속성은 숨겨진 텍스트나 HTML 태그는 포함하지 않고, 렌더링된 텍스트만 포함합니다. 예를 들어, 여기 두 개의 단락을 포함한 `div` 요소가 있습니다: @@ -109,6 +113,8 @@ container.innerText = "JavaScript is awesome!"; 좋습니다. 이제 `textContent`에 대해 이야기해봅시다. +## textContent 이해하기 + `textContent`는 요소와 그 자손 내 모든 텍스트를 포함한 일반 텍스트 내용을 반환합니다. `innerText`와 `textContent`의 가장 중요한 차이점은 `textContent`는 보이든 숨겨져 있든 관계없이 항상 HTML 요소와 자손의 전체 텍스트 내용을 반환한다는 점입니다. @@ -181,6 +187,8 @@ container.textContent = "New content"; ::: +## innerHTML과 비교하기 + 마지막으로 `textContent`와 `innerText`가 `innerHTML`와 어떻게 다른지 알아봅시다. `innerHTML`를 사용하면 요소의 내부 HTML 내용을 설정할 수 있습니다. 이는 DOM에 새 HTML을 동적으로 삽입할 때 유용합니다. @@ -189,6 +197,8 @@ container.textContent = "New content"; 이를 피하려면 일반 텍스트를 삽입할 때 `textContent` 속성을 사용하는 것이 권장됩니다. +## 주요 차이점 요약 + JavaScript의 `innerText`, `textContent`, `innerHTML` 속성은 HTML 요소의 내용을 접근하고 조작하는 다양한 방법을 제공합니다. HTML 내용을 효과적으로 다루려면 이 속성들의 차이를 이해하는 것이 중요합니다. # --questions-- @@ -219,7 +229,7 @@ JavaScript의 `innerText`, `textContent`, `innerHTML` 속성은 HTML 요소의 --- -모두 해당됩니다. +위의 모든 이유입니다. ### --feedback-- @@ -255,7 +265,7 @@ JavaScript의 `innerText`, `textContent`, `innerHTML` 속성은 HTML 요소의 --- -해당 사항 없음. +위의 어느 것도 아닙니다. ### --feedback-- @@ -291,7 +301,7 @@ JavaScript의 `innerText`, `textContent`, `innerHTML` 속성은 HTML 요소의 --- -모두 해당됩니다. +위의 모든 이유입니다. ### --feedback-- diff --git a/curriculum/challenges/korean/blocks/machine-learning-with-python-projects/5e46f8d6ac417301a38fb92d.md b/curriculum/challenges/korean/blocks/machine-learning-with-python-projects/5e46f8d6ac417301a38fb92d.md index b558282775a..3ecd8dee6d1 100644 --- a/curriculum/challenges/korean/blocks/machine-learning-with-python-projects/5e46f8d6ac417301a38fb92d.md +++ b/curriculum/challenges/korean/blocks/machine-learning-with-python-projects/5e46f8d6ac417301a38fb92d.md @@ -10,7 +10,7 @@ dashedName: rock-paper-scissors 이번 도전 과제에서는 가위 바위 보 게임을 하는 프로그램을 만드세요. 무작위로 선택하는 프로그램은 보통 50%의 확률로 이깁니다. 이 도전 과제를 통과하려면 네 가지 다른 봇과 경기를 하여 각 경기에서 최소 60% 이상 이겨야 합니다. -<a href="https://app.ona.com/?autostart=true#https://github.com/freeCodeCamp/boilerplate-rock-paper-scissors/" target="_blank" rel="noopener noreferrer nofollow">Ona 시작 코드와 함께 이 프로젝트를 진행할 것입니다</a>. +이 <a href="https://codespaces.new/freeCodeCamp/boilerplate-rock-paper-scissors/" target="_blank" rel="noopener noreferrer nofollow">프로젝트는 보일러플레이트 코드와 함께 작업할 예정</a>입니다. 머신러닝 커리큘럼의 대화형 수업 부분은 아직 개발 중입니다. 지금은 이 도전 과제를 통과하는 방법을 배우려면 다른 자료를 참고해야 합니다. diff --git a/curriculum/challenges/korean/blocks/review-introduction-to-express/6a0354d43d4c00eca38561f7.md b/curriculum/challenges/korean/blocks/review-introduction-to-express/6a0354d43d4c00eca38561f7.md index 1107228f02b..f363d9eeac7 100644 --- a/curriculum/challenges/korean/blocks/review-introduction-to-express/6a0354d43d4c00eca38561f7.md +++ b/curriculum/challenges/korean/blocks/review-introduction-to-express/6a0354d43d4c00eca38561f7.md @@ -7,53 +7,6 @@ dashedName: review-introduction-to-express # --description-- -## 웹 서비스와 API - -- **API (애플리케이션 프로그래밍 인터페이스)**: 소프트웨어가 다른 소프트웨어와 소통하는 일반적인 방법입니다. -- **웹 서비스**: HTTP 같은 웹 기술을 사용해 네트워크를 통해 데이터를 교환하는 특정 유형의 API입니다. 모든 웹 서비스는 API이지만, 모든 API가 웹 서비스는 아닙니다. -- **웹 서비스의 주요 특징**: 서버에서 실행되고, 기계 간 통신을 가능하게 하며, 언어와 플랫폼에 구애받지 않고, 표준 웹 프로토콜(HTTP/HTTPS, FTP, SMTP)을 사용합니다. -- **REST (표현 상태 전송)**: 오늘날 가장 널리 사용되는 웹 서비스 유형입니다. `/users` 또는 `/users/20` 같은 URL 경로로 식별되는 리소스를 노출합니다. 응답은 보통 JSON이지만 XML이나 일반 텍스트일 수도 있습니다. -- **SOAP (간단 객체 접근 프로토콜)**: XML만 사용합니다. 더 엄격한 표준과 보안이 필요한 기업 시스템에서 흔히 사용됩니다. -- **XML-RPC**: 요청과 응답을 XML로 인코딩합니다. 가볍지만 REST보다 유연성이 떨어집니다. -- **`Accept` 헤더**: 클라이언트가 서버에 원하는 응답 형식을 알려줄 때 사용합니다. 예를 들어 `Accept: application/json`. - -## REST 아키텍처 - -- **무상태성**: 모든 요청은 서버가 처리하는 데 필요한 모든 정보를 포함해야 합니다. 서버는 이전 요청을 기억하지 않습니다. -- **리소스**: URL로 식별되는 접근하거나 수정할 수 있는 데이터 조각입니다(예: `/products/1`). -- **REST의 HTTP 메서드**: - - `GET` — 리소스 조회 - - `POST` — 새 리소스 생성 - - `PUT` / `PATCH` — 기존 리소스 수정 - - `DELETE` — 리소스 삭제 - -## HTTP 상태 코드 - -요청을 처리한 후 서버는 결과를 나타내는 **상태 코드**로 응답합니다: - -- `200` **(OK)**: 요청이 성공했습니다 -- `201` **(Created)**: 새 리소스가 생성되었습니다 -- `400` **(Bad Request)**: 클라이언트가 잘못된 데이터를 보냈습니다 -- `404` **(Not Found)**: 요청한 리소스가 존재하지 않습니다 -- `500` **(Internal Server Error)**: 서버에서 오류가 발생했습니다 - -### REST 요청 작동 방식 - -1. 클라이언트가 메서드, URL, 선택적 헤더, 선택적 본문과 함께 요청을 보냅니다. -2. 서버가 요청을 검증하고 리소스를 식별합니다. -3. 서버가 작업(조회, 생성, 수정, 삭제)을 수행합니다. -4. 서버가 상태 코드와 선택적 본문(보통 JSON)을 포함한 응답을 만듭니다. -5. 서버가 응답을 보내고 클라이언트 상태를 저장하지 않습니다. -6. 클라이언트가 상태 코드를 확인하고 반환된 데이터를 처리합니다. - -## 모놀리식 vs. 마이크로서비스 - -- **모놀리식**: UI, 데이터베이스, API가 모두 함께 있는 단일 대형 코드베이스입니다. 작은 앱에는 적합하지만, 규모가 커질수록 유지보수와 확장이 어려워집니다. -- **마이크로서비스**: 큰 앱을 더 작고 독립적인 서비스로 나누는 아키텍처입니다. 각 서비스는 하나의 비즈니스 기능(예: 제품, 주문, 결제)을 담당하며 자체 코드베이스, 데이터베이스, 팀을 가질 수 있습니다. -- **마이크로서비스 간 통신 방법**: API 또는 메시지 기반 시스템을 통해 이루어집니다. -- **마이크로서비스의 장점**: 개발 속도 향상, 장애 격리 개선, 서비스별로 다른 언어나 프레임워크 사용 가능. -- **마이크로서비스의 도전 과제**: 디버깅 복잡성 증가, 인프라 관리 어려움, 서비스 간 네트워크 오버헤드 증가. - ## Express.js란? - **Express**: Node.js 위에 구축된 최소한의 유연한 웹 프레임워크로, 웹 서버와 API를 쉽게 만들 수 있게 합니다. diff --git a/curriculum/challenges/korean/blocks/review-rest-api-and-web-services/6a7c78ad958a597ee788ad2a.md b/curriculum/challenges/korean/blocks/review-rest-api-and-web-services/6a7c78ad958a597ee788ad2a.md new file mode 100644 index 00000000000..d585d05a7e5 --- /dev/null +++ b/curriculum/challenges/korean/blocks/review-rest-api-and-web-services/6a7c78ad958a597ee788ad2a.md @@ -0,0 +1,59 @@ +--- +id: 6a7c78ad958a597ee788ad2a +title: REST API와 웹 서비스 검토 +challengeType: 31 +dashedName: review-rest-api-and-web-services +--- + +# --description-- + +## 웹 서비스와 API + +- **API (애플리케이션 프로그래밍 인터페이스)**: 소프트웨어가 다른 소프트웨어와 소통하는 일반적인 방법입니다. +- **웹 서비스**: HTTP 같은 웹 기술을 사용해 네트워크를 통해 데이터를 교환하는 특정 유형의 API입니다. 모든 웹 서비스는 API이지만, 모든 API가 웹 서비스는 아닙니다. +- **웹 서비스의 주요 특징**: 서버에서 실행되고, 기계 간 통신을 가능하게 하며, 언어와 플랫폼에 구애받지 않고, 표준 웹 프로토콜(HTTP/HTTPS, FTP, SMTP)을 사용합니다. +- **REST (표현 상태 전송)**: 오늘날 가장 널리 사용되는 웹 서비스 유형입니다. `/users` 또는 `/users/20` 같은 URL 경로로 식별되는 리소스를 노출합니다. 응답은 보통 JSON이지만 XML이나 일반 텍스트일 수도 있습니다. +- **SOAP (간단 객체 접근 프로토콜)**: XML만 사용합니다. 더 엄격한 표준과 보안이 필요한 기업 시스템에서 흔히 사용됩니다. +- **XML-RPC**: 요청과 응답을 XML로 인코딩합니다. 가볍지만 REST보다 유연성이 떨어집니다. +- **`Accept` 헤더**: 클라이언트가 서버에 원하는 응답 형식을 알려줄 때 사용합니다. 예를 들어 `Accept: application/json`. + +## REST 아키텍처 + +- **무상태성**: 모든 요청은 서버가 처리하는 데 필요한 모든 정보를 포함해야 합니다. 서버는 이전 요청을 기억하지 않습니다. +- **리소스**: URL로 식별되는 접근하거나 수정할 수 있는 데이터 조각입니다(예: `/products/1`). +- **REST의 HTTP 메서드**: + - `GET` — 리소스 조회 + - `POST` — 새 리소스 생성 + - `PUT` / `PATCH` — 기존 리소스 수정 + - `DELETE` — 리소스 삭제 + +## HTTP 상태 코드 + +요청을 처리한 후 서버는 결과를 나타내는 **상태 코드**로 응답합니다: + +- `200` **(OK)**: 요청이 성공했습니다 +- `201` **(Created)**: 새 리소스가 생성되었습니다 +- `400` **(Bad Request)**: 클라이언트가 잘못된 데이터를 보냈습니다 +- `404` **(Not Found)**: 요청한 리소스가 존재하지 않습니다 +- `500` **(Internal Server Error)**: 서버에서 오류가 발생했습니다 + +### REST 요청 작동 방식 + +1. 클라이언트가 메서드, URL, 선택적 헤더, 선택적 본문과 함께 요청을 보냅니다. +2. 서버가 요청을 검증하고 리소스를 식별합니다. +3. 서버가 작업(조회, 생성, 수정, 삭제)을 수행합니다. +4. 서버가 상태 코드와 선택적 본문(보통 JSON)을 포함한 응답을 만듭니다. +5. 서버가 응답을 보내고 클라이언트 상태를 저장하지 않습니다. +6. 클라이언트가 상태 코드를 확인하고 반환된 데이터를 처리합니다. + +## 모놀리식 vs. 마이크로서비스 + +- **모놀리식**: UI, 데이터베이스, API가 모두 함께 있는 단일 대형 코드베이스입니다. 작은 앱에는 적합하지만, 규모가 커질수록 유지보수와 확장이 어려워집니다. +- **마이크로서비스**: 큰 앱을 더 작고 독립적인 서비스로 나누는 아키텍처입니다. 각 서비스는 하나의 비즈니스 기능(예: 제품, 주문, 결제)을 담당하며 자체 코드베이스, 데이터베이스, 팀을 가질 수 있습니다. +- **마이크로서비스 간 통신 방법**: API 또는 메시지 기반 시스템을 통해 이루어집니다. +- **마이크로서비스의 장점**: 개발 속도 향상, 장애 격리 개선, 서비스별로 다른 언어나 프레임워크 사용 가능. +- **마이크로서비스의 도전 과제**: 디버깅 복잡성 증가, 인프라 관리 어려움, 서비스 간 네트워크 오버헤드 증가. + +# --assignment-- + +REST API와 웹 서비스 주제와 개념을 검토하세요. diff --git a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e89d557d4b78bf83a02ae6.md b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e89d557d4b78bf83a02ae6.md index cf4fa562e55..252aa76ba7f 100644 --- a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e89d557d4b78bf83a02ae6.md +++ b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e89d557d4b78bf83a02ae6.md @@ -396,10 +396,10 @@ body { const { useState } = React; export const FootballPlayerCard = () => { - return ( + return ( --fcc-editable-region-- - <h1 style={{ backgroundColor: '#fff' }}>Hello, TSX!</h1> + <h1 style={{ backgroundColor: "#fff" }}>Hello, TSX!</h1> --fcc-editable-region-- - ) + ); }; ``` diff --git a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb2.md b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb2.md index 104a8a17185..d790b72085d 100644 --- a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb2.md +++ b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb2.md @@ -29,12 +29,10 @@ assert.equal(element?.type, window.index.PlayerCard); <meta charset="utf-8"/> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Football Player Card Builder - - - + @@ -379,21 +377,18 @@ body { ```tsx const { useState } = React; -export function PlayerCard() { +export const PlayerCard = () => { return ( -
- -
+
); -} +}; export const FootballPlayerCard = () => { - + --fcc-editable-region-- return ( - --fcc-editable-region-- -

Football Card Builder

- --fcc-editable-region-- - ) +

Football Card Builder

+ ); + --fcc-editable-region-- }; ``` diff --git a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb3.md b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb3.md index e88b5323326..b29b978dfcb 100644 --- a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb3.md +++ b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb3.md @@ -382,15 +382,13 @@ export const PlayerCard = () => { return (
--fcc-editable-region-- - + --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { - return ( - - ); + return ; }; ``` diff --git a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb4.md b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb4.md index d534f6264ea..1c7aa9af209 100644 --- a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb4.md +++ b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb4.md @@ -381,12 +381,12 @@ export const PlayerCard = () => {
--fcc-editable-region-- - + --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb5.md b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb5.md index a1a916c42e1..1f670883ccc 100644 --- a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb5.md +++ b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb5.md @@ -394,13 +394,13 @@ export const PlayerCard = () => {
--fcc-editable-region-- - + --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb6.md b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb6.md index 58f5f0d9b68..8f7d86282b7 100644 --- a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb6.md +++ b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb6.md @@ -390,14 +390,14 @@ export const PlayerCard = () => {
98
--fcc-editable-region-- - + --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb7.md b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb7.md index 6ae9683307a..dbd8ad59959 100644 --- a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb7.md +++ b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb7.md @@ -398,13 +398,13 @@ export const PlayerCard = () => {
ST
--fcc-editable-region-- - + --fcc-editable-region-- ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb8.md b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb8.md index 10b807e5349..7ebc40f4ab3 100644 --- a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb8.md +++ b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb8.md @@ -394,14 +394,14 @@ export const PlayerCard = () => {
GOLD
--fcc-editable-region-- - + --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb9.md b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb9.md index 62215f00a7b..68ab9395aaa 100644 --- a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb9.md +++ b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb9.md @@ -393,12 +393,12 @@ export const PlayerCard = () => { --fcc-editable-region-- - + --fcc-editable-region-- ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bba.md b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bba.md index ba255aadd38..b07c12e424e 100644 --- a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bba.md +++ b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bba.md @@ -412,13 +412,13 @@ export const PlayerCard = () => {
--fcc-editable-region-- - + --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbb.md b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbb.md index aba122910fc..de00ed76c72 100644 --- a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbb.md +++ b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbb.md @@ -406,12 +406,12 @@ export const PlayerCard = () => { Edson Arantes do Nascimento (Pele) headshot --fcc-editable-region-- - + --fcc-editable-region-- ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbc.md b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbc.md index 13bee6d5d9d..c704939d078 100644 --- a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbc.md +++ b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbc.md @@ -409,12 +409,12 @@ export const PlayerCard = () => { PELE --fcc-editable-region-- - + --fcc-editable-region-- ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbd.md b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbd.md index 8fa082869cb..67558518cd4 100644 --- a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbd.md +++ b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbd.md @@ -427,13 +427,13 @@ export const PlayerCard = () => { --fcc-editable-region-- - + --fcc-editable-region-- ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbe.md b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbe.md index 31a9e48f76c..eea7fd1c453 100644 --- a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbe.md +++ b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbe.md @@ -465,7 +465,7 @@ export const PlayerCard = () => { ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbf.md b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbf.md index 581eb877625..298a18b6967 100644 --- a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbf.md +++ b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbf.md @@ -420,7 +420,7 @@ interface PlayerData { position: string; club: string; --fcc-editable-region-- - + --fcc-editable-region-- } @@ -478,7 +478,7 @@ export const PlayerCard = () => { ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc0.md b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc0.md index 99305d43ed6..15c33f0cc93 100644 --- a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc0.md +++ b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc0.md @@ -497,7 +497,7 @@ export const PlayerCard = () => { ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc1.md b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc1.md index a1d05d4e9f5..eb4d42ebb7c 100644 --- a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc1.md +++ b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc1.md @@ -398,10 +398,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } --fcc-editable-region-- @@ -460,7 +460,7 @@ export const PlayerCard = () => { ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc2.md b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc2.md index 804a58554f5..55b9f387723 100644 --- a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc2.md +++ b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc2.md @@ -40,12 +40,10 @@ assert.exists(document.querySelector('.card-wrapper.tier-elite')); Football Player Card Builder - - - + @@ -405,10 +403,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -467,9 +465,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc3.md b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc3.md index 0130a592d1d..b7ffc3e234d 100644 --- a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc3.md +++ b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc3.md @@ -399,10 +399,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -461,9 +461,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc4.md b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc4.md index 9f98c6ca330..c5aa344f3be 100644 --- a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc4.md +++ b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc4.md @@ -399,10 +399,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -461,9 +461,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc5.md b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc5.md index 3a41f014148..b8e7f08f6ae 100644 --- a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc5.md +++ b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc5.md @@ -392,10 +392,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -456,9 +456,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc6.md b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc6.md index c95e45c2b3c..881a901eb6e 100644 --- a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc6.md +++ b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc6.md @@ -401,10 +401,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -465,9 +465,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc7.md b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc7.md index f0cb56c2c2b..061731a3466 100644 --- a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc7.md +++ b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc7.md @@ -391,10 +391,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -455,9 +455,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc8.md b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc8.md index 2d391f52998..b47f3fd8fe7 100644 --- a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc8.md +++ b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc8.md @@ -407,10 +407,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -436,9 +436,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { {player.name}
- --fcc-editable-region--
+ --fcc-editable-region-- 97 PAC
@@ -448,10 +448,10 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
83 + --fcc-editable-region-- PAS
- --fcc-editable-region--
@@ -471,9 +471,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc9.md b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc9.md index f53b0d6ce8f..81ebbc20ea1 100644 --- a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc9.md +++ b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc9.md @@ -483,10 +483,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -545,13 +545,13 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
); -} +}; --fcc-editable-region-- --fcc-editable-region-- export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bca.md b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bca.md index 57b01fe3a5d..f634fa2ce90 100644 --- a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bca.md +++ b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bca.md @@ -419,10 +419,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -481,14 +481,14 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { - name: 'PELE', + name: "PELE", overallRating: 98, - position: 'ST', - club: 'Santos FC', - imageUrl: 'https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg', + position: "ST", + club: "Santos FC", + imageUrl: "https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg", pac: 97, sho: 98, pas: 83, diff --git a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcb.md b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcb.md index 839b17f0029..6a85a412b53 100644 --- a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcb.md +++ b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcb.md @@ -435,10 +435,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -497,14 +497,14 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { - name: 'PELE', + name: "PELE", overallRating: 98, - position: 'ST', - club: 'Santos FC', - imageUrl: 'https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg', + position: "ST", + club: "Santos FC", + imageUrl: "https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg", pac: 97, sho: 98, pas: 83, @@ -517,6 +517,7 @@ export const FootballPlayerCard = () => { const [player, setPlayer] = useState(defaultPlayer); return ( --fcc-editable-region-- + --fcc-editable-region-- ); diff --git a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcc.md b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcc.md index 74afb1e4377..d1fd90be06d 100644 --- a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcc.md +++ b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcc.md @@ -477,7 +477,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -504,7 +504,9 @@ export const FootballPlayerCard = () => { --fcc-editable-region-- + + --fcc-editable-region-- ); diff --git a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcd.md b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcd.md index 8e0df5b0e87..6fec56a6b28 100644 --- a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcd.md +++ b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcd.md @@ -465,7 +465,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bce.md b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bce.md index d13bde53bbe..554e8508c7e 100644 --- a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bce.md +++ b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bce.md @@ -470,7 +470,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcf.md b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcf.md index 05922d02676..f9394e613e3 100644 --- a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcf.md +++ b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcf.md @@ -488,7 +488,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd0.md b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd0.md index cab7960f9ff..e05545ab50b 100644 --- a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd0.md +++ b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd0.md @@ -471,7 +471,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd1.md b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd1.md index 97671221d4a..ec489188f77 100644 --- a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd1.md +++ b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd1.md @@ -471,7 +471,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd2.md b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd2.md index 63c409dee7c..eb628b69c14 100644 --- a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd2.md +++ b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd2.md @@ -471,7 +471,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -535,7 +535,7 @@ export const FootballPlayerCard = () => { - --fcc-editable-region-- + --fcc-editable-region-- --fcc-editable-region-- diff --git a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd3.md b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd3.md index e771a51f513..829dc9353ab 100644 --- a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd3.md +++ b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd3.md @@ -497,7 +497,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd4.md b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd4.md index 2e62f6ed016..6084562d7a9 100644 --- a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd4.md +++ b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd4.md @@ -497,7 +497,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd5.md b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd5.md index be1003bbfbc..22dfb4af2b9 100644 --- a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd5.md +++ b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd5.md @@ -497,7 +497,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd6.md b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd6.md index 35ddd0cb678..654d9286c7c 100644 --- a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd6.md +++ b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd6.md @@ -470,7 +470,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd7.md b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd7.md index 33427d789e8..c91e2665dc3 100644 --- a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd7.md +++ b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd7.md @@ -478,7 +478,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -609,3 +609,4 @@ export const FootballPlayerCard = () => { ); }; ``` + diff --git a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd8.md b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd8.md index 6f2b727ab26..31f47e52145 100644 --- a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd8.md +++ b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd8.md @@ -410,7 +410,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -484,7 +484,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -538,8 +538,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd9.md b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd9.md index dc4bb6935dd..bef347ff8b2 100644 --- a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd9.md +++ b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd9.md @@ -402,7 +402,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -476,7 +476,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -530,8 +530,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bda.md b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bda.md index e21463616b2..7cc130eff8b 100644 --- a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bda.md +++ b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bda.md @@ -402,7 +402,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -476,7 +476,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -530,8 +530,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( @@ -640,3 +641,4 @@ export const FootballPlayerCard = () => { ); }; ``` + diff --git a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdb.md b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdb.md index c481fe88cfc..de54980900e 100644 --- a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdb.md +++ b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdb.md @@ -402,7 +402,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -476,7 +476,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -530,8 +530,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdc.md b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdc.md index 118b0a51fe0..a48b132e951 100644 --- a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdc.md +++ b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdc.md @@ -402,7 +402,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -476,7 +476,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -530,8 +530,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdd.md b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdd.md index 73c9d3800bf..f893f32bbd1 100644 --- a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdd.md +++ b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdd.md @@ -402,7 +402,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -476,7 +476,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -530,8 +530,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bde.md b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bde.md index 0a44589c5c2..e8455416994 100644 --- a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bde.md +++ b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bde.md @@ -402,7 +402,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -414,10 +414,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -430,7 +430,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
{player.position}
-
{getPlayerTier(player.overallRating).toUpperCase()}
+
+ {getPlayerTier(player.overallRating).toUpperCase()} +
{player.club}
@@ -474,14 +476,14 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { - name: 'PELE', + name: "PELE", overallRating: 98, - position: 'ST', - club: 'Santos FC', - imageUrl: 'https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg', + position: "ST", + club: "Santos FC", + imageUrl: "https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg", pac: 97, sho: 98, pas: 83, @@ -506,8 +508,18 @@ export const FootballPlayerCard = () => {

Player Info

- - setPlayer({ ...player, name: e.target.value })} /> + + + setPlayer({ ...player, name: e.target.value }) + } + />
@@ -518,8 +530,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( @@ -531,46 +544,115 @@ export const FootballPlayerCard = () => {
- - setPlayer({ ...player, overallRating: Number(e.target.value) })} /> + + + setPlayer({ + ...player, + overallRating: Number(e.target.value), + }) + } + />
- - setPlayer({ ...player, club: e.target.value })} /> + + + setPlayer({ ...player, club: e.target.value }) + } + />
- - setPlayer({ ...player, imageUrl: e.target.value })} /> + + + setPlayer({ ...player, imageUrl: e.target.value }) + } + />

Player Stats

- - setPlayer({ ...player, pac: Number(e.target.value) })} /> + + + setPlayer({ ...player, pac: Number(e.target.value) }) + } + />
- - setPlayer({ ...player, sho: Number(e.target.value) })} /> + + + setPlayer({ ...player, sho: Number(e.target.value) }) + } + />
- - setPlayer({ ...player, pas: Number(e.target.value) })} /> + + + setPlayer({ ...player, pas: Number(e.target.value) }) + } + />
- + --fcc-editable-region-- --fcc-editable-region--
- +
- +
@@ -579,7 +661,9 @@ export const FootballPlayerCard = () => {

Live Preview

Updates as you type

-
+
@@ -589,3 +673,4 @@ export const FootballPlayerCard = () => { ); }; ``` + diff --git a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdf.md b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdf.md index 312168cf202..1e775bd8c09 100644 --- a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdf.md +++ b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdf.md @@ -421,7 +421,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -495,7 +495,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -549,8 +549,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( @@ -667,11 +668,11 @@ export const FootballPlayerCard = () => { } /> - --fcc-editable-region--
+ --fcc-editable-region--
@@ -679,8 +680,8 @@ export const FootballPlayerCard = () => { PHY -
--fcc-editable-region-- + diff --git a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8d1be04ed6aad1c955729.md b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8d1be04ed6aad1c955729.md index 0e0c66b4ce2..fb71d2e89e4 100644 --- a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8d1be04ed6aad1c955729.md +++ b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69e8d1be04ed6aad1c955729.md @@ -391,8 +391,8 @@ const { useState } = React; --fcc-editable-region-- export const FootballPlayerCard = () => { - return ( -

Football Card Builder

- ) + return ( +

Football Card Builder

+ ); }; ``` diff --git a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69ea01c45b04f3e9de845036.md b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69ea01c45b04f3e9de845036.md index 1c923a5a7bf..9317b8f96e2 100644 --- a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69ea01c45b04f3e9de845036.md +++ b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69ea01c45b04f3e9de845036.md @@ -405,7 +405,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -483,7 +483,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -537,8 +537,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69ea02adff0fd528639ee23b.md b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69ea02adff0fd528639ee23b.md index 562ebc3d278..f996cc5485c 100644 --- a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69ea02adff0fd528639ee23b.md +++ b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69ea02adff0fd528639ee23b.md @@ -409,7 +409,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -485,7 +485,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -543,8 +543,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69ea0349f8305a99324465ff.md b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69ea0349f8305a99324465ff.md index d030b6e53d7..37b8d132750 100644 --- a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69ea0349f8305a99324465ff.md +++ b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69ea0349f8305a99324465ff.md @@ -407,7 +407,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -483,7 +483,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -502,11 +502,9 @@ const defaultPlayer: PlayerData = { function loadPlayer(): PlayerData { try { --fcc-editable-region-- - - --fcc-editable-region-- - } catch (error) { - } + --fcc-editable-region-- + } catch (error) {} } export const FootballPlayerCard = () => { @@ -547,8 +545,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69ea044f8c93a5e7ce64214c.md b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69ea044f8c93a5e7ce64214c.md index df92faed81f..aa4fa2e5323 100644 --- a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69ea044f8c93a5e7ce64214c.md +++ b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69ea044f8c93a5e7ce64214c.md @@ -395,7 +395,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -471,7 +471,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -492,12 +492,10 @@ function loadPlayer(): PlayerData { const saved = localStorage.getItem(STORAGE_KEY); if (saved) { --fcc-editable-region-- - + --fcc-editable-region-- - }; - } catch (error) { - - } + } + } catch (error) {} } export const FootballPlayerCard = () => { @@ -538,8 +536,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69ea0577f25e519489353f82.md b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69ea0577f25e519489353f82.md index 063ebce8209..6e1bc034a1d 100644 --- a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69ea0577f25e519489353f82.md +++ b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69ea0577f25e519489353f82.md @@ -405,7 +405,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -418,7 +418,6 @@ interface PlayerData { const STORAGE_KEY = "football_player_card"; - export function getPlayerTier(rating: number): string { if (rating >= 92) return "elite"; if (rating >= 85) return "gold"; @@ -482,7 +481,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -505,14 +504,15 @@ function loadPlayer(): PlayerData { return { ...defaultPlayer, ...JSON.parse(saved) - } - }; ---fcc-editable-region-- + }; + } } catch (error) { +--fcc-editable-region-- } -} + --fcc-editable-region-- +} export const FootballPlayerCard = () => { const [player, setPlayer] = useState(defaultPlayer); @@ -552,8 +552,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69ea064edb0dcc46e1422cca.md b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69ea064edb0dcc46e1422cca.md index 9a239e6c70d..78e544be79a 100644 --- a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69ea064edb0dcc46e1422cca.md +++ b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69ea064edb0dcc46e1422cca.md @@ -401,7 +401,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -477,7 +477,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -500,8 +500,8 @@ function loadPlayer(): PlayerData { return { ...defaultPlayer, ...JSON.parse(saved) - } - }; + }; + } } catch (error) { console.log("Failed to load player data, using defaults:", error); } @@ -546,8 +546,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69ea0939f2f92cfc6c7a850d.md b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69ea0939f2f92cfc6c7a850d.md index 7cfe391f76d..5f364db8990 100644 --- a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69ea0939f2f92cfc6c7a850d.md +++ b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69ea0939f2f92cfc6c7a850d.md @@ -46,12 +46,10 @@ assert.match(__helpers.removeJSComments(code), /useEffect\s*\(\(\)\s=>\s*\{\s*tr Football Player Card Builder - - - + @@ -415,7 +413,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -435,7 +433,7 @@ export function getPlayerTier(rating: number): string { return "bronze"; } -function PlayerCard({ player }: { player: PlayerData }) { +export const PlayerCard = ({ player }: { player: PlayerData }) => { return (
@@ -491,7 +489,7 @@ function PlayerCard({ player }: { player: PlayerData }) {
); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -514,8 +512,8 @@ function loadPlayer(): PlayerData { return { ...defaultPlayer, ...JSON.parse(saved) - } - }; + }; + } } catch (error) { console.log("Failed to load player data, using defaults:", error); } @@ -526,7 +524,7 @@ export const FootballPlayerCard = () => { const [player, setPlayer] = useState(defaultPlayer); --fcc-editable-region-- - + --fcc-editable-region-- return ( @@ -565,8 +563,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69ea0a89bd84cf2461b48ceb.md b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69ea0a89bd84cf2461b48ceb.md index 78a01489ed8..486975acfb4 100644 --- a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69ea0a89bd84cf2461b48ceb.md +++ b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69ea0a89bd84cf2461b48ceb.md @@ -403,7 +403,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -479,7 +479,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -502,8 +502,8 @@ function loadPlayer(): PlayerData { return { ...defaultPlayer, ...JSON.parse(saved) - } - }; + }; + } } catch (error) { console.log("Failed to load player data, using defaults:", error); } @@ -513,15 +513,15 @@ function loadPlayer(): PlayerData { export const FootballPlayerCard = () => { const [player, setPlayer] = useState(defaultPlayer); ---fcc-editable-region-- useEffect(() => { try { +--fcc-editable-region-- } catch (error) { +--fcc-editable-region-- } }, [player]); ---fcc-editable-region-- return (
@@ -559,8 +559,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69ea0bb3e7000f44c207bb0e.md b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69ea0bb3e7000f44c207bb0e.md index 556893ae3db..90d48a6ef28 100644 --- a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69ea0bb3e7000f44c207bb0e.md +++ b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69ea0bb3e7000f44c207bb0e.md @@ -401,7 +401,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -477,7 +477,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -500,8 +500,8 @@ function loadPlayer(): PlayerData { return { ...defaultPlayer, ...JSON.parse(saved) - } - }; + }; + } } catch (error) { console.log("Failed to load player data, using defaults:", error); } @@ -557,8 +557,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( @@ -1098,7 +1099,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -1174,7 +1175,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -1197,8 +1198,8 @@ function loadPlayer(): PlayerData { return { ...defaultPlayer, ...JSON.parse(saved) - } - }; + }; + } } catch (error) { console.log("Failed to load player data, using defaults:", error); } @@ -1252,8 +1253,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69ea1bb4a66dd6debb999c7f.md b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69ea1bb4a66dd6debb999c7f.md index 3ecdf573730..edd9b243008 100644 --- a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69ea1bb4a66dd6debb999c7f.md +++ b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69ea1bb4a66dd6debb999c7f.md @@ -473,7 +473,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69ea1dd8e74976afa407bf22.md b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69ea1dd8e74976afa407bf22.md index 5fd71bbc0df..e0eed5a6460 100644 --- a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69ea1dd8e74976afa407bf22.md +++ b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69ea1dd8e74976afa407bf22.md @@ -479,7 +479,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69ea1ed1543a4db863564aac.md b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69ea1ed1543a4db863564aac.md index 7aa5137b383..c1f077b0ce6 100644 --- a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69ea1ed1543a4db863564aac.md +++ b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69ea1ed1543a4db863564aac.md @@ -472,7 +472,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69ea21dcd8c4cb48c23a2c67.md b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69ea21dcd8c4cb48c23a2c67.md index e29ecc71fa7..67ce87e9606 100644 --- a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69ea21dcd8c4cb48c23a2c67.md +++ b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69ea21dcd8c4cb48c23a2c67.md @@ -14,7 +14,7 @@ dashedName: step-53 `select` 위치에는 `onChange` 핸들러가 있어야 하며, 이 핸들러는 `setPlayer`을 펼쳐서 `player`를 호출하고 `position`을 업데이트해야 합니다. ```js -assert.match(__helpers.removeJSComments(code), /onChange.*setPlayer.*\.\.\.\s*player[\s\S]*position/); +assert.match(__helpers.removeJSComments(code), /onChange=\{[\s\S]*?position:\s*e\.target\.value\s+as\s+Position/); ``` # --seed-- @@ -469,7 +469,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69ea2378f3c6a60a57cc29c3.md b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69ea2378f3c6a60a57cc29c3.md index ed2466cc0cb..d1e794287bc 100644 --- a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69ea2378f3c6a60a57cc29c3.md +++ b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69ea2378f3c6a60a57cc29c3.md @@ -483,7 +483,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -537,10 +537,12 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > --fcc-editable-region-- - + --fcc-editable-region-- diff --git a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69eb216380522cfc11aa408c.md b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69eb216380522cfc11aa408c.md index e00d30967e8..f304e5ccb0a 100644 --- a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69eb216380522cfc11aa408c.md +++ b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69eb216380522cfc11aa408c.md @@ -443,7 +443,7 @@ export const PlayerCard = () => { ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69eb23665c115447405343ac.md b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69eb23665c115447405343ac.md index b2b0c5053da..35ea3f4c9b7 100644 --- a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69eb23665c115447405343ac.md +++ b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69eb23665c115447405343ac.md @@ -461,7 +461,7 @@ export const PlayerCard = () => { ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69eb2847cc8f5638e226e8ce.md b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69eb2847cc8f5638e226e8ce.md index 075aa14cc6f..9851a2930e4 100644 --- a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69eb2847cc8f5638e226e8ce.md +++ b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69eb2847cc8f5638e226e8ce.md @@ -483,10 +483,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -543,7 +543,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { --fcc-editable-region-- diff --git a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69ed3985819de69de27c4390.md b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69ed3985819de69de27c4390.md index 8d9aae18b2d..ce71986b58b 100644 --- a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69ed3985819de69de27c4390.md +++ b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69ed3985819de69de27c4390.md @@ -1,6 +1,6 @@ --- id: 69ed3985819de69de27c4390 -title: 33단계 +title: 단계 33 challengeType: 0 dashedName: step-33 --- @@ -391,10 +391,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -453,14 +453,14 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { - name: 'PELE', + name: "PELE", overallRating: 98, - position: 'ST', - club: 'Santos FC', - imageUrl: 'https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg', + position: "ST", + club: "Santos FC", + imageUrl: "https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg", pac: 97, sho: 98, pas: 83, @@ -471,7 +471,7 @@ const defaultPlayer: PlayerData = { export const FootballPlayerCard = () => { --fcc-editable-region-- - return ; + return ; --fcc-editable-region-- }; ``` diff --git a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69f1a6f57dd2d4685822074a.md b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69f1a6f57dd2d4685822074a.md index 6f62f55decf..598333dc26d 100644 --- a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69f1a6f57dd2d4685822074a.md +++ b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69f1a6f57dd2d4685822074a.md @@ -401,8 +401,8 @@ export const PlayerCard = () => {
- --fcc-editable-region--
+ --fcc-editable-region--
@@ -410,14 +410,14 @@ export const PlayerCard = () => {
-
--fcc-editable-region-- +
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69f1a9e19340f19b1fd051c6.md b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69f1a9e19340f19b1fd051c6.md index cdd15578662..973166c342c 100644 --- a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69f1a9e19340f19b1fd051c6.md +++ b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69f1a9e19340f19b1fd051c6.md @@ -416,9 +416,9 @@ export const PlayerCard = () => {
- --fcc-editable-region--
+ --fcc-editable-region--
@@ -426,14 +426,14 @@ export const PlayerCard = () => {
+ --fcc-editable-region--
- --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69f1af24b0860d13f0b295e5.md b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69f1af24b0860d13f0b295e5.md index ea608c810a1..516b7ad931a 100644 --- a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69f1af24b0860d13f0b295e5.md +++ b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69f1af24b0860d13f0b295e5.md @@ -407,10 +407,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -451,9 +451,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
- --fcc-editable-region--
+ --fcc-editable-region-- 99 DRI
@@ -463,17 +463,17 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
75 + --fcc-editable-region-- PHY
- --fcc-editable-region-- ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69f1b1fb36c6c0c80907e8e1.md b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69f1b1fb36c6c0c80907e8e1.md index 048a9c4bb29..ce049d2d521 100644 --- a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69f1b1fb36c6c0c80907e8e1.md +++ b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69f1b1fb36c6c0c80907e8e1.md @@ -483,7 +483,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -511,17 +511,15 @@ export const FootballPlayerCard = () => {
- --fcc-editable-region-- -
- -
+
+ --fcc-editable-region--
+ --fcc-editable-region--
- --fcc-editable-region-- ); }; diff --git a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69f1b591221851200c734eb4.md b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69f1b591221851200c734eb4.md index 2a2586b6e8c..9fe2c092cbf 100644 --- a/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69f1b591221851200c734eb4.md +++ b/curriculum/challenges/korean/blocks/workshop-build-a-football-player-card-builder/69f1b591221851200c734eb4.md @@ -472,7 +472,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f356ed6199b0cdef1d2be8f.md b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f356ed6199b0cdef1d2be8f.md index d368bdf7108..e09f6d8977b 100644 --- a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f356ed6199b0cdef1d2be8f.md +++ b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f356ed6199b0cdef1d2be8f.md @@ -13,11 +13,11 @@ dashedName: step-22 ```css .class-name { - styles + property: value; } ``` -기존 `#menu` 선택자를 `#menu` class 선택자로 바꾸고, `.menu`라는 이름의 클래스로 변경하세요. +기존의 `#menu` 선택자를 `#menu` 대신 클래스 선택자 `.menu`로 바꿔 클래스 선택자로 변경하세요. # --hints-- diff --git a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f3cade99dda4e6071a85dfd.md b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f3cade99dda4e6071a85dfd.md index 2d3e2c85b35..17b6d9d27bf 100644 --- a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f3cade99dda4e6071a85dfd.md +++ b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f3cade99dda4e6071a85dfd.md @@ -109,7 +109,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f3ef6e01f288a026d709587.md b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f3ef6e01f288a026d709587.md index 306130ba2fd..97b8d129f13 100644 --- a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f3ef6e01f288a026d709587.md +++ b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f3ef6e01f288a026d709587.md @@ -171,7 +171,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f3ef6e03d719d5ac4738993.md b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f3ef6e03d719d5ac4738993.md index 6d6b13525d1..2a052ad90d1 100644 --- a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f3ef6e03d719d5ac4738993.md +++ b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f3ef6e03d719d5ac4738993.md @@ -115,7 +115,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f3ef6e04559b939080db057.md b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f3ef6e04559b939080db057.md index faf0a8995b0..6b7894bf63b 100644 --- a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f3ef6e04559b939080db057.md +++ b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f3ef6e04559b939080db057.md @@ -139,7 +139,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f3ef6e050279c7a4a7101d3.md b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f3ef6e050279c7a4a7101d3.md index 218922f4a62..2f6f4c4cff0 100644 --- a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f3ef6e050279c7a4a7101d3.md +++ b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f3ef6e050279c7a4a7101d3.md @@ -137,7 +137,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f3ef6e05473f91f948724ab.md b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f3ef6e05473f91f948724ab.md index e1a64918f06..e4dc79f0a2e 100644 --- a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f3ef6e05473f91f948724ab.md +++ b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f3ef6e05473f91f948724ab.md @@ -116,6 +116,6 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f3ef6e056bdde6ae6892ba2.md b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f3ef6e056bdde6ae6892ba2.md index e745dcf1fbf..6f3df7c3605 100644 --- a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f3ef6e056bdde6ae6892ba2.md +++ b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f3ef6e056bdde6ae6892ba2.md @@ -9,7 +9,7 @@ dashedName: step-54 모든 텍스트가 같은 `font-family`를 사용하는 것은 조금 지루할 수 있습니다. 대부분의 텍스트는 `sans-serif`로 유지하면서 `h1`와 `h2` 요소만 다른 선택자를 사용해 다르게 만들 수 있습니다. -`h1`와 `h2` 요소 모두를 단일 선택자로 스타일링하여 이 요소들의 텍스트가 `Impact` 폰트를 사용하도록 하세요. +단일 선택자 목록을 사용해 `h1`과 `h2` 요소 모두에 스타일을 지정하여 이 요소들의 텍스트가 `Impact` 폰트를 사용하게 하세요. # --hints-- @@ -135,7 +135,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f3ef6e06d34faac0447fc44.md b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f3ef6e06d34faac0447fc44.md index 1f977ca8d46..467d5c855a5 100644 --- a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f3ef6e06d34faac0447fc44.md +++ b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f3ef6e06d34faac0447fc44.md @@ -127,7 +127,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f3ef6e07276f782bb46b93d.md b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f3ef6e07276f782bb46b93d.md index d3fc4462567..4a54edce4c2 100644 --- a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f3ef6e07276f782bb46b93d.md +++ b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f3ef6e07276f782bb46b93d.md @@ -142,7 +142,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f3ef6e0819d4f23ca7285e6.md b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f3ef6e0819d4f23ca7285e6.md index c175adc9eed..c72cfd01c1d 100644 --- a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f3ef6e0819d4f23ca7285e6.md +++ b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f3ef6e0819d4f23ca7285e6.md @@ -104,7 +104,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f3ef6e087d56ed3ffdc36be.md b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f3ef6e087d56ed3ffdc36be.md index c29aaefc7c3..eea38babdae 100644 --- a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f3ef6e087d56ed3ffdc36be.md +++ b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f3ef6e087d56ed3ffdc36be.md @@ -129,6 +129,6 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f3ef6e0a81099d9a697b550.md b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f3ef6e0a81099d9a697b550.md index c19de4c8a02..c52dd935fbb 100644 --- a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f3ef6e0a81099d9a697b550.md +++ b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f3ef6e0a81099d9a697b550.md @@ -167,7 +167,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f3ef6e0b431cc215bb16f55.md b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f3ef6e0b431cc215bb16f55.md index 1f0f3033bf2..daee76c20b6 100644 --- a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f3ef6e0b431cc215bb16f55.md +++ b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f3ef6e0b431cc215bb16f55.md @@ -141,7 +141,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f3ef6e0e0c3feaebcf647ad.md b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f3ef6e0e0c3feaebcf647ad.md index fd4db2b7caf..059407285e6 100644 --- a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f3ef6e0e0c3feaebcf647ad.md +++ b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f3ef6e0e0c3feaebcf647ad.md @@ -103,7 +103,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f3ef6e0e9629bad967cd71e.md b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f3ef6e0e9629bad967cd71e.md index 6e86e636c44..b20d3ef7296 100644 --- a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f3ef6e0e9629bad967cd71e.md +++ b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f3ef6e0e9629bad967cd71e.md @@ -7,7 +7,7 @@ dashedName: step-55 # --description-- -쉼표로 구분된 다른 폰트 이름을 추가하여 font-family에 대체 수단 값을 넣을 수 있습니다. 대체 수단은 처음 지정한 폰트를 찾을 수 없거나 사용할 수 없을 때 사용됩니다. +쉼표로 구분된 다른 폰트 이름을 추가하여 `font-family`에 대체 수단 값을 넣을 수 있습니다. 첫 번째 폰트를 사용할 수 없을 때 대체 수단이 사용됩니다. `serif` 폰트를 `Impact` 폰트 뒤에 대체 수단으로 추가하세요. @@ -113,7 +113,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f3ef6e0eaa7da26e3d34d78.md b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f3ef6e0eaa7da26e3d34d78.md index e6edc77b4a2..f0301ec4b62 100644 --- a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f3ef6e0eaa7da26e3d34d78.md +++ b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f3ef6e0eaa7da26e3d34d78.md @@ -128,7 +128,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f3ef6e0f8c230bdd2349716.md b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f3ef6e0f8c230bdd2349716.md index b4af0c13c4c..60c3362aa22 100644 --- a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f3ef6e0f8c230bdd2349716.md +++ b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f3ef6e0f8c230bdd2349716.md @@ -140,6 +140,6 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f3f26fa39591db45e5cd7a0.md b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f3f26fa39591db45e5cd7a0.md index 11a751f3f9a..9634ff4c341 100644 --- a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f3f26fa39591db45e5cd7a0.md +++ b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f3f26fa39591db45e5cd7a0.md @@ -150,7 +150,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f459225127805351a6ad057.md b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f459225127805351a6ad057.md index 87126fa448a..d309674b36f 100644 --- a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f459225127805351a6ad057.md +++ b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f459225127805351a6ad057.md @@ -144,7 +144,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f459a7ceb8b5c446656d88b.md b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f459a7ceb8b5c446656d88b.md index 1c641a75bb6..51db755d37f 100644 --- a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f459a7ceb8b5c446656d88b.md +++ b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f459a7ceb8b5c446656d88b.md @@ -147,6 +147,6 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f459cf202c2a3472fae6a9f.md b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f459cf202c2a3472fae6a9f.md index 97c44118530..2751e057a21 100644 --- a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f459cf202c2a3472fae6a9f.md +++ b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f459cf202c2a3472fae6a9f.md @@ -7,7 +7,7 @@ dashedName: step-67 # --description-- -선의 두께가 더 두꺼워 보이는 것을 확인하세요. `border-width` 요소의 모든 가장자리에는 `1px`라는 속성의 기본값이 `hr`입니다. 테두리를 배경과 같은 색으로 바꾸면 선의 전체 높이는 `5px`가 됩니다 (`3px`에 `1px`의 위쪽과 아래쪽 테두리 두께를 더한 값입니다). +선의 두께가 더 커 보이는 것을 알겠나요? `hr` 요소의 모든 가장자리에 대한 `border-width`라는 속성의 기본값은 `1px`입니다. 선의 전체 높이는 항상 `5px`였는데 (`3px`에 위아래 테두리 두께 `1px`를 더한 값), 테두리에 색을 칠하니 그 가장자리가 보이게 되었습니다. `height`의 `hr` 속성을 `2px`로 변경하여 전체 높이가 `4px`가 되도록 하세요. @@ -147,7 +147,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f459fd48bdc98491ca6d1a3.md b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f459fd48bdc98491ca6d1a3.md index 945bdaeaf14..261757d8f24 100644 --- a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f459fd48bdc98491ca6d1a3.md +++ b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f459fd48bdc98491ca6d1a3.md @@ -145,7 +145,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f45a05977e2fa49d9119437.md b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f45a05977e2fa49d9119437.md index 551b49aafb5..d9fbbb9a1b1 100644 --- a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f45a05977e2fa49d9119437.md +++ b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f45a05977e2fa49d9119437.md @@ -146,6 +146,6 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f45a276c093334f0f6e9df4.md b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f45a276c093334f0f6e9df4.md index cfed654815f..9a607826ae1 100644 --- a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f45a276c093334f0f6e9df4.md +++ b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f45a276c093334f0f6e9df4.md @@ -185,7 +185,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f45a5a7c49a8251f0bdb527.md b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f45a5a7c49a8251f0bdb527.md index 3a2be7aad68..c4a494c00bb 100644 --- a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f45a5a7c49a8251f0bdb527.md +++ b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f45a5a7c49a8251f0bdb527.md @@ -157,7 +157,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f45a66d4a2b0453301e5a26.md b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f45a66d4a2b0453301e5a26.md index 8b3bfbd9e9d..270858e47db 100644 --- a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f45a66d4a2b0453301e5a26.md +++ b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f45a66d4a2b0453301e5a26.md @@ -166,7 +166,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f45b0731d39e15d54df4dfc.md b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f45b0731d39e15d54df4dfc.md index c7687f3665e..517c8700277 100644 --- a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f45b0731d39e15d54df4dfc.md +++ b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f45b0731d39e15d54df4dfc.md @@ -161,7 +161,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f45b25e7ec2405f166b9de1.md b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f45b25e7ec2405f166b9de1.md index bdc667c078a..8a8ebc706ed 100644 --- a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f45b25e7ec2405f166b9de1.md +++ b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f45b25e7ec2405f166b9de1.md @@ -9,7 +9,7 @@ dashedName: step-78 링크가 방문된 경우 링크의 속성을 변경하려면 `a:visited { propertyName: propertyValue; }`처럼 생긴 의사 선택자를 사용하세요. -사용자가 방문한 경우 푸터 `Visit our website` 링크의 색상을 `grey`로 변경하세요. +사용자가 링크를 방문했을 때 푸터의 `Visit our website` 링크 색상을 `gray`로 변경하세요. # --hints-- @@ -20,14 +20,14 @@ const aVisitedStyle = new __helpers.CSSHelp(document).getStyle('a:visited'); assert.exists(aVisitedStyle); ``` -`color` 속성을 `grey`로 설정하세요. +`color` 속성을 `gray`로 설정하세요. ```js const hasColor = new __helpers.CSSHelp(document).getCSSRules().some(x => (x.style.color === 'grey' || x.style.color === 'gray')); assert.isTrue(hasColor); ``` -`a:visited`에 `color`가 `grey`인 것이 있어야 합니다. +`a:visited`는 `color`가 `gray`여야 합니다. ```js const aVisitedColor = new __helpers.CSSHelp(document).getStyle('a:visited')?.getPropertyValue('color'); @@ -161,7 +161,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f45b3c93c027860d9298dbd.md b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f45b3c93c027860d9298dbd.md index 51fc7a6f6fd..5ea503aa0ea 100644 --- a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f45b3c93c027860d9298dbd.md +++ b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f45b3c93c027860d9298dbd.md @@ -161,7 +161,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ @@ -179,7 +179,7 @@ a { } a:visited { - color: grey; + color: gray; } --fcc-editable-region-- diff --git a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f45b45d099f3e621fbbb256.md b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f45b45d099f3e621fbbb256.md index dc848aa0caf..e807c0a3442 100644 --- a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f45b45d099f3e621fbbb256.md +++ b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f45b45d099f3e621fbbb256.md @@ -161,7 +161,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ @@ -179,7 +179,7 @@ a { } a:visited { - color: grey; + color: gray; } a:hover { diff --git a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f45b4c81cea7763550e40df.md b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f45b4c81cea7763550e40df.md index b4ad3f958ed..4634e636ce1 100644 --- a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f45b4c81cea7763550e40df.md +++ b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f45b4c81cea7763550e40df.md @@ -152,7 +152,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ @@ -171,7 +171,7 @@ a { --fcc-editable-region-- a:visited { - color: grey; + color: gray; } a:hover { diff --git a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f45b715301bbf667badc04a.md b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f45b715301bbf667badc04a.md index 5831798c6ce..58f505b9c95 100644 --- a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f45b715301bbf667badc04a.md +++ b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f45b715301bbf667badc04a.md @@ -7,7 +7,7 @@ dashedName: step-82 # --description-- -메뉴 텍스트 `CAMPER CAFE`는 메뉴 하단의 주소 공간과 위쪽 공간이 다릅니다. 이는 브라우저가 `h1` 요소에 기본적으로 위쪽 여백을 설정하기 때문입니다. +메뉴 텍스트 `CAMPER CAFE` 위의 공간이 메뉴 하단 주소 아래의 공간과 일치하지 않습니다. 이는 브라우저가 `h1` 요소에 기본적으로 약간의 위쪽 여백을 가지고 있기 때문입니다. `h1` 요소의 위쪽 여백을 `0`로 변경하여 모든 위쪽 여백을 제거하세요. @@ -157,7 +157,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f46e270702a8456a664f0df.md b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f46e270702a8456a664f0df.md index b6563412192..7abe565637e 100644 --- a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f46e270702a8456a664f0df.md +++ b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f46e270702a8456a664f0df.md @@ -156,7 +156,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f46e36e745ead58487aabf2.md b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f46e36e745ead58487aabf2.md index 4ba8e7c741c..7b9b8146b0f 100644 --- a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f46e36e745ead58487aabf2.md +++ b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f46e36e745ead58487aabf2.md @@ -163,7 +163,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f46e7a4750dd05b5a673920.md b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f46e7a4750dd05b5a673920.md index b29a2c6a63a..f0453572995 100644 --- a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f46e7a4750dd05b5a673920.md +++ b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f46e7a4750dd05b5a673920.md @@ -160,7 +160,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f46e8284aae155c83015dee.md b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f46e8284aae155c83015dee.md index f9d7481eb62..7a798d6c89a 100644 --- a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f46e8284aae155c83015dee.md +++ b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f46e8284aae155c83015dee.md @@ -9,7 +9,7 @@ dashedName: step-86 메뉴는 좋아 보이지만, 커피 원두 배경 이미지 외에는 주로 텍스트로만 구성되어 있습니다. -`Coffee` 제목 아래에 `https://cdn.freecodecamp.org/curriculum/css-cafe/coffee.jpg` URL을 사용해 이미지를 추가하세요. 이미지에 `alt` 값을 가진 `coffee icon` 속성을 부여하세요. +`Coffee` 제목 아래에 URL `https://cdn.freecodecamp.org/curriculum/css-cafe/coffee.jpg`를 사용해 이미지를 추가하세요. 이미지에 `alt` 값으로 `coffee icon`을 지정하세요. # --hints-- @@ -105,6 +105,7 @@ assert.match(imageAltValue, /coffee icon/i);

123 Free Code Camp Drive

+ ``` @@ -171,7 +172,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f46ede1ff8fec5ba656b44c.md b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f46ede1ff8fec5ba656b44c.md index 46463dc565c..f28451b18ad 100644 --- a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f46ede1ff8fec5ba656b44c.md +++ b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f46ede1ff8fec5ba656b44c.md @@ -144,7 +144,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } --fcc-editable-region-- diff --git a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f46fc57528aa1c4b5ea7c2e.md b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f46fc57528aa1c4b5ea7c2e.md index 7ac94f7a2c5..9bdab974e70 100644 --- a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f46fc57528aa1c4b5ea7c2e.md +++ b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f46fc57528aa1c4b5ea7c2e.md @@ -161,7 +161,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f4701b942c824109626c3d8.md b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f4701b942c824109626c3d8.md index 247f9663cec..f194d7bc859 100644 --- a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f4701b942c824109626c3d8.md +++ b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f4701b942c824109626c3d8.md @@ -153,6 +153,6 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f475bb508746c16c9431d42.md b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f475bb508746c16c9431d42.md index 961b0f593f2..8607ba65bb9 100644 --- a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f475bb508746c16c9431d42.md +++ b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f475bb508746c16c9431d42.md @@ -7,9 +7,9 @@ dashedName: step-87 # --description-- -추가한 이미지는 위의 `Coffee` 제목처럼 수평으로 가운데 정렬되어 있지 않습니다. `img` 요소는 "인라인 요소"와 비슷합니다. +추가한 이미지는 위에 있는 `Coffee` 제목처럼 가로로 가운데 정렬되어 있지 않습니다. `img` 요소는 인라인 레벨 요소이므로 텍스트 흐름 안에 위치합니다. -이미지가 제목 같은 블록 레벨 요소처럼 동작하게 하려면 `img` 타입 선택자를 만드세요. `display` 속성을 `block`로 설정하고, `margin-left`와 `margin-right` 속성을 사용해 수평으로 가운데 정렬하세요. +이미지가 제목과 같은 블록 레벨 요소처럼 동작하게 하려면 `img` 타입 선택자를 만드세요. `display` 속성을 `block`으로 설정하고, `margin-left`와 `margin-right` 속성을 사용해 가로로 가운데 정렬하세요. # --hints-- @@ -120,6 +120,7 @@ assert.equal(imgMarginRight, 'auto');

123 Free Code Camp Drive

+ ``` @@ -190,7 +191,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f475e1c7f71a61d913836c6.md b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f475e1c7f71a61d913836c6.md index a0799b949c7..71812fa894a 100644 --- a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f475e1c7f71a61d913836c6.md +++ b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f475e1c7f71a61d913836c6.md @@ -97,6 +97,7 @@ assert.match(lastImage?.alt, /pie icon/i);

123 Free Code Camp Drive

+ ``` diff --git a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f47fe7e31980053a8d4403b.md b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f47fe7e31980053a8d4403b.md index f3a3b0fa302..bdf4bb3cb98 100644 --- a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f47fe7e31980053a8d4403b.md +++ b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f47fe7e31980053a8d4403b.md @@ -7,7 +7,7 @@ dashedName: step-89 # --description-- -`h2` 요소와 관련 아이콘 사이의 세로 공간이 더 작으면 좋겠습니다. `h2` 요소는 기본적으로 위쪽과 아래쪽에 여백이 있으므로 `h2` 요소의 아래쪽 여백을 `0` 또는 다른 숫자로 변경할 수 있습니다. +`h2` 요소와 관련된 아이콘 사이의 세로 간격이 더 작으면 좋겠습니다. `h2` 요소는 기본적으로 위아래 여백이 있으므로, `h2` 요소의 아래쪽 여백을 `0` 또는 다른 값으로 변경할 수 있습니다. 더 쉬운 방법이 있습니다. `img` 요소에 음수 위쪽 여백을 추가하여 현재 위치에서 위로 당기세요. 음수 값은 값 앞에 `-`를 붙여 만듭니다. 이 워크숍을 완료하려면 `25px` 타입 선택자에서 `img`의 음수 위쪽 여백을 사용하세요. diff --git a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f716ad029ee4053c7027a7a.md b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f716ad029ee4053c7027a7a.md index c4e1cd9d7fa..492eb06b9be 100644 --- a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f716ad029ee4053c7027a7a.md +++ b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f716ad029ee4053c7027a7a.md @@ -119,7 +119,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f716bee5838c354c728a7c5.md b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f716bee5838c354c728a7c5.md index c5a1cf93187..d8d14b12659 100644 --- a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f716bee5838c354c728a7c5.md +++ b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f716bee5838c354c728a7c5.md @@ -158,6 +158,6 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f7b87422a560036fd03ccff.md b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f7b87422a560036fd03ccff.md index 81c0149f8ab..9de1b0ad833 100644 --- a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f7b87422a560036fd03ccff.md +++ b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f7b87422a560036fd03ccff.md @@ -118,7 +118,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f7b88d37b1f98386f04edc0.md b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f7b88d37b1f98386f04edc0.md index 68ffcc29cd3..0a5417d83b9 100644 --- a/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f7b88d37b1f98386f04edc0.md +++ b/curriculum/challenges/korean/blocks/workshop-cafe-menu/5f7b88d37b1f98386f04edc0.md @@ -97,6 +97,6 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/korean/blocks/workshop-cafe-menu/6780e8ef4153930b965cd7b7.md b/curriculum/challenges/korean/blocks/workshop-cafe-menu/6780e8ef4153930b965cd7b7.md index 315dae811c4..db13550a04e 100644 --- a/curriculum/challenges/korean/blocks/workshop-cafe-menu/6780e8ef4153930b965cd7b7.md +++ b/curriculum/challenges/korean/blocks/workshop-cafe-menu/6780e8ef4153930b965cd7b7.md @@ -125,6 +125,6 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/korean/blocks/workshop-cafe-menu/6780f0d898362873ac425dc8.md b/curriculum/challenges/korean/blocks/workshop-cafe-menu/6780f0d898362873ac425dc8.md index bef3a014afc..f42a4e0d993 100644 --- a/curriculum/challenges/korean/blocks/workshop-cafe-menu/6780f0d898362873ac425dc8.md +++ b/curriculum/challenges/korean/blocks/workshop-cafe-menu/6780f0d898362873ac425dc8.md @@ -156,7 +156,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/korean/blocks/workshop-calculator/66cc095dfe1682753d2ab030.md b/curriculum/challenges/korean/blocks/workshop-calculator/66cc095dfe1682753d2ab030.md index bcbed6717f4..7a038450888 100644 --- a/curriculum/challenges/korean/blocks/workshop-calculator/66cc095dfe1682753d2ab030.md +++ b/curriculum/challenges/korean/blocks/workshop-calculator/66cc095dfe1682753d2ab030.md @@ -7,7 +7,7 @@ dashedName: step-2 # --description-- -이전 수업에서 배운 개념 중 하나는 함수에서 값을 반환하는 방법이었습니다. +이전 수업에서 배운 개념 중 하나는 함수에서 반환값을 돌려주는 방법이었습니다. 함수에서 값을 반환하는 방법을 다시 알려드립니다: @@ -30,7 +30,10 @@ assert.strictEqual(addTwoAndSeven(), 9); `addTwoAndSeven` 함수는 `+` 연산자를 사용해 합을 반환해야 합니다. ```js -assert.match(code, /return\s*(2\s*\+\s*7|7\s*\+\s*2)\s*;?/); +const explorer = await __helpers.Explorer(code); +const { addTwoAndSeven } = explorer.allFunctions; +const validExpressions = ["2 + 7", "7 + 2", "(2 + 7)", "(7 + 2)"]; +assert.isTrue(validExpressions.some(expr => addTwoAndSeven?.hasReturn(expr))); ``` # --seed-- diff --git a/curriculum/challenges/korean/blocks/workshop-calculator/66cc0a9e06e00b75d6782be9.md b/curriculum/challenges/korean/blocks/workshop-calculator/66cc0a9e06e00b75d6782be9.md index a8096f6d45a..a27ce804043 100644 --- a/curriculum/challenges/korean/blocks/workshop-calculator/66cc0a9e06e00b75d6782be9.md +++ b/curriculum/challenges/korean/blocks/workshop-calculator/66cc0a9e06e00b75d6782be9.md @@ -26,16 +26,12 @@ myFunction(); # --hints-- -코드에 `console.log`가 있어야 합니다. +`console.log` 안에서 `addTwoAndSeven` 함수를 호출하세요. ```js -assert.match(code, /console\.log(.*)/); -``` - -`addTwoAndSeven` 안에서 `console.log` 함수를 호출해야 합니다. - -```js -assert.match(code, /console\.log\(\s*addTwoAndSeven\(\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(addTwoAndSeven())"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/korean/blocks/workshop-calculator/66cc0ba5881acb7692cfc4de.md b/curriculum/challenges/korean/blocks/workshop-calculator/66cc0ba5881acb7692cfc4de.md index ee1f289a057..0c67b8263e7 100644 --- a/curriculum/challenges/korean/blocks/workshop-calculator/66cc0ba5881acb7692cfc4de.md +++ b/curriculum/challenges/korean/blocks/workshop-calculator/66cc0ba5881acb7692cfc4de.md @@ -24,22 +24,24 @@ assert.isFunction(addThreeAndFour); `addThreeAndFour` 함수는 `3`과 `4`의 합을 반환해야 합니다. ```js -assert.equal(addThreeAndFour(), 7); +assert.strictEqual(addThreeAndFour(), 7); ``` `addThreeAndFour` 함수는 `+` 연산자를 사용해 합을 반환해야 합니다. ```js -const declarationStyle = /return\s*\(?\s*(3\s*\+\s*4|4\s*\+\s*3)\s*\)?\s*;?/; -const arrowStyle = /=>\s*\(?\s*(3\s*\+\s*4|4\s*\+\s*3)\s*\)?\s*;?/; -const combinedRegex = new RegExp(`(?:${declarationStyle.source})|(?:${arrowStyle.source})`); -assert.match(code, combinedRegex); +const explorer = await __helpers.Explorer(code); +const { addThreeAndFour } = explorer.allFunctions; +const validExpressions = ["3 + 4", "4 + 3", "(3 + 4)", "(4 + 3)"]; +assert.isTrue(validExpressions.some(expr => addThreeAndFour?.hasReturn(expr))); ``` `addThreeAndFour` 함수를 `console.log` 안에서 호출해야 합니다. ```js -assert.match(code, /console\.log\(\s*addThreeAndFour\(\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(addThreeAndFour())"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/korean/blocks/workshop-calculator/66cc0de2920bec775f610424.md b/curriculum/challenges/korean/blocks/workshop-calculator/66cc0de2920bec775f610424.md index 89a998a0bec..f3152cc6fc0 100644 --- a/curriculum/challenges/korean/blocks/workshop-calculator/66cc0de2920bec775f610424.md +++ b/curriculum/challenges/korean/blocks/workshop-calculator/66cc0de2920bec775f610424.md @@ -22,25 +22,33 @@ dashedName: step-5 `addTwoAndSeven`라는 함수가 없어야 합니다. ```js -assert.notMatch(code, /function\s+addTwoAndSeven\s*\(\s*\)\s*{/); +const explorer = await __helpers.Explorer(code); +const { addTwoAndSeven } = explorer.allFunctions; +assert.notExists(addTwoAndSeven); ``` `addTwoAndSeven`에 대한 함수 호출이 없어야 합니다. ```js -assert.notMatch(code, /console\.log\(\s*addTwoAndSeven\(\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const unexpectedStatement = "console.log(addTwoAndSeven())"; +assert.notInclude(strippedCode, unexpectedStatement); ``` `addThreeAndFour`라는 함수가 없어야 합니다. ```js -assert.notMatch(code, /function\s+addThreeAndFour\s*\(\s*\)\s*{/); +const explorer = await __helpers.Explorer(code); +const { addThreeAndFour } = explorer.allFunctions; +assert.notExists(addThreeAndFour); ``` `addThreeAndFour`에 대한 함수 호출이 없어야 합니다. ```js -assert.notMatch(code, /console\.log\(\s*addThreeAndFour\(\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const unexpectedStatement = "console.log(addThreeAndFour())"; +assert.notInclude(strippedCode, unexpectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/korean/blocks/workshop-calculator/66cc0f1ae40802781b2ea972.md b/curriculum/challenges/korean/blocks/workshop-calculator/66cc0f1ae40802781b2ea972.md index 8cf3e86be1f..079145b7ae0 100644 --- a/curriculum/challenges/korean/blocks/workshop-calculator/66cc0f1ae40802781b2ea972.md +++ b/curriculum/challenges/korean/blocks/workshop-calculator/66cc0f1ae40802781b2ea972.md @@ -33,8 +33,11 @@ assert.isFunction(calculateSum); `calculateSum` 함수는 두 개의 매개변수 `num1`와 `num2`를 받아야 합니다. ```js -const regex = __helpers.functionRegex('calculateSum', ['num1', 'num2']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { calculateSum } = explorer.allFunctions; +assert.lengthOf(calculateSum?.parameters, 2); +assert.equal(calculateSum?.parameters[0].toString(), "num1"); +assert.equal(calculateSum?.parameters[1].toString(), "num2"); ``` # --seed-- diff --git a/curriculum/challenges/korean/blocks/workshop-calculator/66cc12fa504b0479dac479a0.md b/curriculum/challenges/korean/blocks/workshop-calculator/66cc12fa504b0479dac479a0.md index b5e9b309da1..29b3d84c83b 100644 --- a/curriculum/challenges/korean/blocks/workshop-calculator/66cc12fa504b0479dac479a0.md +++ b/curriculum/challenges/korean/blocks/workshop-calculator/66cc12fa504b0479dac479a0.md @@ -29,7 +29,9 @@ greetUser("Jane"); // "Hello Jane!" 인수 `console.log`와 `calculateSum`를 사용하여 `2` 함수를 호출하는 `5`가 있어야 합니다. ```js -assert.match(code, /console\.log\(calculateSum\(\s*2\s*,\s*5\)\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const validStatements = ["console.log(calculateSum(2,5))", "console.log(calculateSum(5,2))"]; +assert.isTrue(validStatements.some(stmt => strippedCode.includes(stmt))); ``` # --seed-- diff --git a/curriculum/challenges/korean/blocks/workshop-calculator/66cc14ca14e65e7a9ebecb80.md b/curriculum/challenges/korean/blocks/workshop-calculator/66cc14ca14e65e7a9ebecb80.md index d84e47a0c1e..9c100f9207c 100644 --- a/curriculum/challenges/korean/blocks/workshop-calculator/66cc14ca14e65e7a9ebecb80.md +++ b/curriculum/challenges/korean/blocks/workshop-calculator/66cc14ca14e65e7a9ebecb80.md @@ -15,7 +15,7 @@ dashedName: step-10 # --hints-- -`calculateDifference`라는 함수가 있어야 합니다. +`calculateDifference`라는 함수를 선언하세요. ```js assert.isFunction(calculateDifference); @@ -24,8 +24,11 @@ assert.isFunction(calculateDifference); `calculateDifference` 함수는 `num1`와 `num2`라는 두 매개변수를 가져야 합니다. ```js -const regex = __helpers.functionRegex('calculateDifference', ['num1', 'num2']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { calculateDifference } = explorer.allFunctions; +assert.lengthOf(calculateDifference?.parameters, 2); +assert.equal(calculateDifference?.parameters[0].toString(), "num1"); +assert.equal(calculateDifference?.parameters[1].toString(), "num2"); ``` `calculateDifference` 함수는 두 매개변수의 차이를 반환해야 합니다. diff --git a/curriculum/challenges/korean/blocks/workshop-calculator/66cc16abc30b367ba1d1f9ef.md b/curriculum/challenges/korean/blocks/workshop-calculator/66cc16abc30b367ba1d1f9ef.md index 89f313b7642..95f24b50c21 100644 --- a/curriculum/challenges/korean/blocks/workshop-calculator/66cc16abc30b367ba1d1f9ef.md +++ b/curriculum/challenges/korean/blocks/workshop-calculator/66cc16abc30b367ba1d1f9ef.md @@ -20,19 +20,25 @@ dashedName: step-11 `console.log`가 `calculateDifference` 함수를 인수 `22`와 `5`로 호출해야 합니다. ```js -assert.match(code, /console\.log\s*\(\s*calculateDifference\s*\(\s*22\s*,\s*5\s*\)\s*\)\s*;?/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateDifference(22,5))"; +assert.include(strippedCode, expectedStatement); ``` `console.log`가 `calculateDifference` 함수를 인수 `12`와 `1`로 호출해야 합니다. ```js -assert.match(code, /console\.log\s*\(\s*calculateDifference\s*\(\s*12\s*,\s*1\s*\)\s*\)\s*;?/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateDifference(12,1))"; +assert.include(strippedCode, expectedStatement); ``` `console.log`가 `calculateDifference` 함수를 인수 `17`와 `9`로 호출해야 합니다. ```js -assert.match(code, /console\.log\s*\(\s*calculateDifference\s*\(\s*17\s*,\s*9\s*\)\s*\)\s*;?/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateDifference(17,9))"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/korean/blocks/workshop-calculator/66cc172af7159a7c67804544.md b/curriculum/challenges/korean/blocks/workshop-calculator/66cc172af7159a7c67804544.md index d8f7ae2f37b..0f3c13ecd8e 100644 --- a/curriculum/challenges/korean/blocks/workshop-calculator/66cc172af7159a7c67804544.md +++ b/curriculum/challenges/korean/blocks/workshop-calculator/66cc172af7159a7c67804544.md @@ -17,7 +17,7 @@ dashedName: step-12 # --hints-- -`calculateProduct`라는 함수가 있어야 합니다. +`calculateProduct`라는 함수를 선언하세요. ```js assert.isFunction(calculateProduct); @@ -26,8 +26,11 @@ assert.isFunction(calculateProduct); `calculateProduct` 함수는 `num1`와 `num2`라는 두 매개변수를 가져야 합니다. ```js -const regex = __helpers.functionRegex('calculateProduct', ['num1', 'num2']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { calculateProduct } = explorer.allFunctions; +assert.lengthOf(calculateProduct?.parameters, 2); +assert.equal(calculateProduct?.parameters[0].toString(), "num1"); +assert.equal(calculateProduct?.parameters[1].toString(), "num2"); ``` `calculateProduct` 함수는 두 매개변수의 곱을 반환해야 합니다. @@ -40,7 +43,9 @@ assert.equal(calculateProduct(10, 5), 50); `console.log`가 `calculateProduct` 함수를 `13`와 `5` 인수로 호출해야 합니다. ```js -assert.match(code, /console\.log\s*\(\s*calculateProduct\s*\(\s*13\s*,\s*5\s*\)\s*\)\s*;?/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const validStatements = ["console.log(calculateProduct(13,5))", "console.log(calculateProduct(5,13))"]; +assert.isTrue(validStatements.some(stmt => strippedCode.includes(stmt))); ``` # --seed-- diff --git a/curriculum/challenges/korean/blocks/workshop-calculator/66cc1a3a39aef47d6473cb2f.md b/curriculum/challenges/korean/blocks/workshop-calculator/66cc1a3a39aef47d6473cb2f.md index 24339b625cd..ff3d51eb182 100644 --- a/curriculum/challenges/korean/blocks/workshop-calculator/66cc1a3a39aef47d6473cb2f.md +++ b/curriculum/challenges/korean/blocks/workshop-calculator/66cc1a3a39aef47d6473cb2f.md @@ -17,7 +17,7 @@ dashedName: step-13 # --hints-- -`calculateQuotient`라는 함수가 있어야 합니다. +`calculateQuotient`라는 함수를 선언하세요. ```js assert.isFunction(calculateQuotient); @@ -26,8 +26,11 @@ assert.isFunction(calculateQuotient); `calculateQuotient` 함수는 `num1`와 `num2`라는 두 개의 매개변수를 가져야 합니다. ```js -const regex = __helpers.functionRegex('calculateQuotient', ['num1', 'num2']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { calculateQuotient } = explorer.allFunctions; +assert.lengthOf(calculateQuotient?.parameters, 2); +assert.equal(calculateQuotient?.parameters[0].toString(), "num1"); +assert.equal(calculateQuotient?.parameters[1].toString(), "num2"); ``` `calculateQuotient` 함수는 두 매개변수의 몫을 반환해야 합니다. @@ -40,7 +43,9 @@ assert.equal(calculateQuotient(100, 10), 10); `console.log`가 `calculateQuotient`와 `7` 인수를 사용하여 `11` 함수를 호출해야 합니다. ```js -assert.match(code, /console\.log\s*\(\s*calculateQuotient\s*\(\s*7\s*,\s*11\s*\)\s*\)\s*;?/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateQuotient(7,11))"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/korean/blocks/workshop-calculator/66cc1ccfefdd727e18c2ab20.md b/curriculum/challenges/korean/blocks/workshop-calculator/66cc1ccfefdd727e18c2ab20.md index 66d6be21245..8a373a26458 100644 --- a/curriculum/challenges/korean/blocks/workshop-calculator/66cc1ccfefdd727e18c2ab20.md +++ b/curriculum/challenges/korean/blocks/workshop-calculator/66cc1ccfefdd727e18c2ab20.md @@ -7,7 +7,7 @@ dashedName: step-14 # --description-- -`calculateQuotient`가 제대로 작동하는 것 같지만 아직 테스트하지 않은 경우가 하나 있습니다. +`calculateQuotient` 함수가 제대로 작동하는 것 같지만, 아직 테스트하지 않은 경우가 하나 있습니다. `console.log`를 추가하여 `calculateQuotient` 함수를 인수 `3`과 `0`로 호출하세요. @@ -18,7 +18,9 @@ dashedName: step-14 `console.log`가 `calculateQuotient` 함수를 인수 `3`과 `0`로 호출해야 합니다. ```js -assert.match(code, /console\.log\s*\(\s*calculateQuotient\s*\(\s*3\s*,\s*0\s*\)\s*\)\s*;?/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateQuotient(3,0))"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/korean/blocks/workshop-calculator/66cc1deb1f04647f2aabee2b.md b/curriculum/challenges/korean/blocks/workshop-calculator/66cc1deb1f04647f2aabee2b.md index a9ef2bc6c11..2e244337d06 100644 --- a/curriculum/challenges/korean/blocks/workshop-calculator/66cc1deb1f04647f2aabee2b.md +++ b/curriculum/challenges/korean/blocks/workshop-calculator/66cc1deb1f04647f2aabee2b.md @@ -20,8 +20,8 @@ dashedName: step-15 `calculateQuotient` 함수는 `"Error: Division by zero"`이 0일 때 문자열 `num2`를 반환해야 합니다. ```js -assert.strictEqual(calculateQuotient(10, 0), 'Error: Division by zero'); -assert.strictEqual(calculateQuotient(3, 0), 'Error: Division by zero'); +assert.strictEqual(calculateQuotient(10, 0), "Error: Division by zero"); +assert.strictEqual(calculateQuotient(3, 0), "Error: Division by zero"); ``` `calculateQuotient` 함수는 `num1`이 0이 아닐 때 `num2`을 `num2`로 나눈 결과를 반환해야 합니다. diff --git a/curriculum/challenges/korean/blocks/workshop-calculator/66cc21d23238dc8240a8a182.md b/curriculum/challenges/korean/blocks/workshop-calculator/66cc21d23238dc8240a8a182.md index 180f3eaa0ec..5fea9ed8b09 100644 --- a/curriculum/challenges/korean/blocks/workshop-calculator/66cc21d23238dc8240a8a182.md +++ b/curriculum/challenges/korean/blocks/workshop-calculator/66cc21d23238dc8240a8a182.md @@ -28,7 +28,7 @@ Math.pow(5, 2); // 25 # --hints-- -`calculateSquare`라는 이름의 함수가 있어야 합니다. +`calculateSquare`라는 함수를 선언하세요. ```js assert.isFunction(calculateSquare); @@ -37,8 +37,10 @@ assert.isFunction(calculateSquare); `calculateSquare` 함수는 `num` 매개변수를 받아야 합니다. ```js -const regex = __helpers.functionRegex('calculateSquare', ['num']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { calculateSquare } = explorer.allFunctions; +assert.lengthOf(calculateSquare?.parameters, 1); +assert.equal(calculateSquare?.parameters[0].toString(), "num"); ``` `calculateSquare` 함수는 `num`의 제곱을 반환해야 합니다. diff --git a/curriculum/challenges/korean/blocks/workshop-calculator/66cc26907ff6908402af0149.md b/curriculum/challenges/korean/blocks/workshop-calculator/66cc26907ff6908402af0149.md index df8a9008396..e4a3f051ce4 100644 --- a/curriculum/challenges/korean/blocks/workshop-calculator/66cc26907ff6908402af0149.md +++ b/curriculum/challenges/korean/blocks/workshop-calculator/66cc26907ff6908402af0149.md @@ -18,13 +18,17 @@ dashedName: step-17 `console.log`가 `calculateSquare` 함수를 `2` 인수로 호출해야 합니다. ```js -assert.match(code, /console\.log\s*\(\s*calculateSquare\s*\(\s*2\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateSquare(2))"; +assert.include(strippedCode, expectedStatement); ``` `console.log`가 `calculateSquare` 함수를 `9` 인수로 호출해야 합니다. ```js -assert.match(code, /console\.log\s*\(\s*calculateSquare\s*\(\s*9\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateSquare(9))"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/korean/blocks/workshop-calculator/66cc2739f687e484d50bb6f1.md b/curriculum/challenges/korean/blocks/workshop-calculator/66cc2739f687e484d50bb6f1.md index eb875342c4b..83d4e964121 100644 --- a/curriculum/challenges/korean/blocks/workshop-calculator/66cc2739f687e484d50bb6f1.md +++ b/curriculum/challenges/korean/blocks/workshop-calculator/66cc2739f687e484d50bb6f1.md @@ -26,7 +26,7 @@ Math.sqrt(9); # --hints-- -`calculateSquareRoot`라는 함수가 있어야 합니다. +`calculateSquareRoot`라는 함수를 선언하세요. ```js assert.isFunction(calculateSquareRoot); @@ -35,8 +35,10 @@ assert.isFunction(calculateSquareRoot); `calculateSquareRoot` 함수는 `num` 매개변수를 받아야 합니다. ```js -const regex = __helpers.functionRegex('calculateSquareRoot', ['num']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { calculateSquareRoot } = explorer.allFunctions; +assert.lengthOf(calculateSquareRoot?.parameters, 1); +assert.equal(calculateSquareRoot?.parameters[0].toString(), "num"); ``` `calculateSquareRoot` 함수는 `num`의 제곱근을 반환해야 합니다. diff --git a/curriculum/challenges/korean/blocks/workshop-calculator/66cc281d687975858049fd8d.md b/curriculum/challenges/korean/blocks/workshop-calculator/66cc281d687975858049fd8d.md index b287f62eb4d..09df5e61974 100644 --- a/curriculum/challenges/korean/blocks/workshop-calculator/66cc281d687975858049fd8d.md +++ b/curriculum/challenges/korean/blocks/workshop-calculator/66cc281d687975858049fd8d.md @@ -20,13 +20,17 @@ dashedName: step-19 `console.log`가 `calculateSquareRoot` 함수를 `25` 인수와 함께 호출해야 합니다. ```js -assert.match(code, /console\.log\s*\(\s*calculateSquareRoot\s*\(\s*25\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateSquareRoot(25))"; +assert.include(strippedCode, expectedStatement); ``` `console.log`가 `calculateSquareRoot` 함수를 `100` 인수와 함께 호출해야 합니다. ```js -assert.match(code, /console\.log\s*\(\s*calculateSquareRoot\s*\(\s*100\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateSquareRoot(100))"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/korean/blocks/workshop-calculator/66cdf76685e4cb5a8726e27b.md b/curriculum/challenges/korean/blocks/workshop-calculator/66cdf76685e4cb5a8726e27b.md index c6fe518c9c7..653c215bedc 100644 --- a/curriculum/challenges/korean/blocks/workshop-calculator/66cdf76685e4cb5a8726e27b.md +++ b/curriculum/challenges/korean/blocks/workshop-calculator/66cdf76685e4cb5a8726e27b.md @@ -18,13 +18,17 @@ dashedName: step-9 `console.log`가 `calculateSum` 함수를 인수 `10`와 `10`로 호출해야 합니다. ```js -assert.match(code, /console\.log\(calculateSum\(10\s*,\s*10\)\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateSum(10,10))"; +assert.include(strippedCode, expectedStatement); ``` `console.log`가 `calculateSum` 함수를 인수 `5`와 `5`로 호출해야 합니다. ```js -assert.match(code, /console\.log\(calculateSum\(5\s*,\s*5\)\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateSum(5,5))"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/646c48df8674cf2b91020ecc.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/646c48df8674cf2b91020ecc.md index cae69c3da9d..9954749848a 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/646c48df8674cf2b91020ecc.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/646c48df8674cf2b91020ecc.md @@ -35,12 +35,13 @@ assert.oneOf(href, ["./styles.css", "styles.css"]); ```html ---fcc-editable-region-- - - fCC Cat Painting - + + fCC Cat Painting --fcc-editable-region-- + +--fcc-editable-region-- + ``` diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/646c586be7180e40ddf74ff6.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/646c586be7180e40ddf74ff6.md index 819bed404ad..3d33db2090a 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/646c586be7180e40ddf74ff6.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/646c586be7180e40ddf74ff6.md @@ -1,6 +1,6 @@ --- id: 646c586be7180e40ddf74ff6 -title: Step 3 +title: 3단계 challengeType: 0 dashedName: step-3 --- @@ -31,9 +31,9 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('body')?.backgroundColor, - - fCC Cat Painting - + + fCC Cat Painting + diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/646c59e942f35541923104bf.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/646c59e942f35541923104bf.md index cc35ec2c3d8..d5c97c42f92 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/646c59e942f35541923104bf.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/646c59e942f35541923104bf.md @@ -1,6 +1,6 @@ --- id: 646c59e942f35541923104bf -title: Step 4 +title: 4단계 challengeType: 0 dashedName: step-4 --- @@ -43,13 +43,13 @@ assert.lengthOf(document.querySelectorAll('main div'), 1); - - fCC Cat Painting - + + fCC Cat Painting + --fcc-editable-region-- - + --fcc-editable-region-- diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/646c5ace05e4be4211407935.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/646c5ace05e4be4211407935.md index f64b8e472f2..fd49af05bca 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/646c5ace05e4be4211407935.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/646c5ace05e4be4211407935.md @@ -1,6 +1,6 @@ --- id: 646c5ace05e4be4211407935 -title: Step 6 +title: 6단계 challengeType: 0 dashedName: step-6 --- @@ -50,14 +50,14 @@ assert.equal(secondGradient,'(69,69,79)100%)'); - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
+
+
+
``` @@ -71,13 +71,13 @@ body { background-color: #c9d2fc; } ---fcc-editable-region-- .cat-head { +--fcc-editable-region-- + +--fcc-editable-region-- width: 205px; height: 180px; border: 1px solid #000; border-radius: 46%; - } ---fcc-editable-region-- ``` diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/646c5d7057c45f432fcdd46c.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/646c5d7057c45f432fcdd46c.md index b53e5385047..bbf356a3d52 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/646c5d7057c45f432fcdd46c.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/646c5d7057c45f432fcdd46c.md @@ -1,6 +1,6 @@ --- id: 646c5d7057c45f432fcdd46c -title: Step 5 +title: 5단계 challengeType: 0 dashedName: step-5 --- @@ -50,13 +50,13 @@ assert.equal(new __helpers.CSSHelp(document)?.getStyle(".cat-head")?.borderRadiu - - fCC Cat Painting - + + fCC Cat Painting +
-
+
diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/646c5e727e56e743c9aed4a1.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/646c5e727e56e743c9aed4a1.md index 553fdc4ebc8..ed9cb022630 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/646c5e727e56e743c9aed4a1.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/646c5e727e56e743c9aed4a1.md @@ -1,6 +1,6 @@ --- id: 646c5e727e56e743c9aed4a1 -title: Step 7 +title: 7단계 challengeType: 0 dashedName: step-7 --- @@ -44,14 +44,14 @@ assert.equal(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.left, '100p - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
+
+
+
``` @@ -65,16 +65,14 @@ body { background-color: #c9d2fc; } ---fcc-editable-region-- .cat-head { - - +--fcc-editable-region-- +--fcc-editable-region-- background: linear-gradient(#5e5e5e 85%, #45454f 100%); width: 205px; height: 180px; border: 1px solid #000; border-radius: 46%; } ---fcc-editable-region-- ``` diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/646c5ffef5598d449b52ec12.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/646c5ffef5598d449b52ec12.md index e89b82fc989..f4c657ea1dc 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/646c5ffef5598d449b52ec12.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/646c5ffef5598d449b52ec12.md @@ -1,6 +1,6 @@ --- id: 646c5ffef5598d449b52ec12 -title: Step 17 +title: 17단계 challengeType: 0 dashedName: step-17 --- @@ -39,18 +39,18 @@ assert.equal(document.querySelectorAll('.cat-head div')[0]?.getAttribute('class' - - fCC Cat Painting - + + fCC Cat Painting + -
+
+
--fcc-editable-region-- -
- -
+ --fcc-editable-region-- -
+ +
``` diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/646ce8bb4b35544d501c7184.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/646ce8bb4b35544d501c7184.md index a5aebc219b4..6f17ce61a84 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/646ce8bb4b35544d501c7184.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/646ce8bb4b35544d501c7184.md @@ -1,6 +1,6 @@ --- id: 646ce8bb4b35544d501c7184 -title: Step 18 +title: 18단계 challengeType: 0 dashedName: step-18 --- @@ -43,20 +43,20 @@ assert.isTrue(document.querySelectorAll('.cat-ears div')[1]?.classList.contains( - - fCC Cat Painting - + + fCC Cat Painting + -
-
+
+
+
--fcc-editable-region-- -
- -
+ --fcc-editable-region--
-
+
+
``` diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/646ce9d790d2a44de5f99e04.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/646ce9d790d2a44de5f99e04.md index 24b3fe8670f..559f5f536d8 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/646ce9d790d2a44de5f99e04.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/646ce9d790d2a44de5f99e04.md @@ -1,6 +1,6 @@ --- id: 646ce9d790d2a44de5f99e04 -title: Step 19 +title: 19단계 challengeType: 0 dashedName: step-19 --- @@ -55,25 +55,25 @@ assert.isTrue(document.querySelectorAll('.cat-right-ear div')[0]?.classList.cont - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
- --fcc-editable-region-- -
- -
-
- -
- --fcc-editable-region-- +
+
+
+
+--fcc-editable-region-- + +
+
+ +--fcc-editable-region--
-
+
+
``` diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/646ceb843412c74edee27a79.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/646ceb843412c74edee27a79.md index 637983614db..85a6e74eb0b 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/646ceb843412c74edee27a79.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/646ceb843412c74edee27a79.md @@ -1,6 +1,6 @@ --- id: 646ceb843412c74edee27a79 -title: Step 20 +title: 20단계 challengeType: 0 dashedName: step-20 --- @@ -53,7 +53,7 @@ assert.strictEqual(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.b assert.strictEqual(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.borderTop, '35px solid red') ``` -`.cat-right-ear` 선택자에 `border-bottom` 속성이 `35px solid red`로 설정되어 있어야 합니다. 세미콜론을 잊지 마세요. +`.cat-right-ear` 선택자에는 `border-bottom` 속성이 `35px solid red`로 설정되어 있어야 합니다. 세미콜론을 잊지 마세요. ```js assert.strictEqual(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.borderBottom, '35px solid red') @@ -67,23 +67,23 @@ assert.strictEqual(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.b - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/646cecc9eb5c4f4f73dafd07.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/646cecc9eb5c4f4f73dafd07.md index 699fccd5e4f..68941712871 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/646cecc9eb5c4f4f73dafd07.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/646cecc9eb5c4f4f73dafd07.md @@ -1,6 +1,6 @@ --- id: 646cecc9eb5c4f4f73dafd07 -title: Step 23 +title: 23단계 challengeType: 0 dashedName: step-23 --- @@ -37,23 +37,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-ear')?.left, '- - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` @@ -81,12 +81,12 @@ body { border-radius: 46%; } ---fcc-editable-region-- .cat-left-ear { +--fcc-editable-region-- +--fcc-editable-region-- border-left: 35px solid transparent; border-right: 35px solid transparent; border-bottom: 70px solid #5e5e5e; } ---fcc-editable-region-- ``` diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/646cef0c2b98915094df7099.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/646cef0c2b98915094df7099.md index 51dacb9188b..7f79cfe6a5b 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/646cef0c2b98915094df7099.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/646cef0c2b98915094df7099.md @@ -1,6 +1,6 @@ --- id: 646cef0c2b98915094df7099 -title: Step 24 +title: 24단계 challengeType: 0 dashedName: step-24 --- @@ -31,23 +31,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-ear')?.borderTo - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/646cf1206cac5f51804f49cf.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/646cf1206cac5f51804f49cf.md index 259aad17cc5..b4b2156b676 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/646cf1206cac5f51804f49cf.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/646cf1206cac5f51804f49cf.md @@ -1,6 +1,6 @@ --- id: 646cf1206cac5f51804f49cf -title: Step 25 +title: 25단계 challengeType: 0 dashedName: step-25 --- @@ -29,23 +29,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-ear')?.transfor - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/646cf2249f02ca5233d9af7c.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/646cf2249f02ca5233d9af7c.md index d36e17193ef..c46cfaffb1a 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/646cf2249f02ca5233d9af7c.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/646cf2249f02ca5233d9af7c.md @@ -1,6 +1,6 @@ --- id: 646cf2249f02ca5233d9af7c -title: Step 26 +title: 26단계 challengeType: 0 dashedName: step-26 --- @@ -45,23 +45,23 @@ assert.strictEqual(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.b - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/646cf48d8f8e1f535a1821d3.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/646cf48d8f8e1f535a1821d3.md index 948ded84a20..b285dc903a4 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/646cf48d8f8e1f535a1821d3.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/646cf48d8f8e1f535a1821d3.md @@ -1,6 +1,6 @@ --- id: 646cf48d8f8e1f535a1821d3 -title: Step 27 +title: 27단계 challengeType: 0 dashedName: step-27 --- @@ -37,23 +37,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.left, ' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/646cf6cbca98e258da65c979.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/646cf6cbca98e258da65c979.md index e9504e13d8b..f6a70ba0866 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/646cf6cbca98e258da65c979.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/646cf6cbca98e258da65c979.md @@ -1,6 +1,6 @@ --- id: 646cf6cbca98e258da65c979 -title: Step 28 +title: 28단계 challengeType: 0 dashedName: step-28 --- @@ -25,23 +25,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.transfo - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/646cf88aa884405a11ea5bcc.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/646cf88aa884405a11ea5bcc.md index 7fb4a6a9f35..3ae70dcf220 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/646cf88aa884405a11ea5bcc.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/646cf88aa884405a11ea5bcc.md @@ -1,6 +1,6 @@ --- id: 646cf88aa884405a11ea5bcc -title: Step 29 +title: 29단계 challengeType: 0 dashedName: step-29 --- @@ -31,23 +31,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.borderT - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/646cfc2b8e6fe95c20a819d5.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/646cfc2b8e6fe95c20a819d5.md index 6f943435e56..aa5d744cf14 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/646cfc2b8e6fe95c20a819d5.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/646cfc2b8e6fe95c20a819d5.md @@ -1,6 +1,6 @@ --- id: 646cfc2b8e6fe95c20a819d5 -title: Step 30 +title: 30단계 challengeType: 0 dashedName: step-30 --- @@ -29,23 +29,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-ear')?.zIndex, - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/646cfd853634255d02b64cc1.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/646cfd853634255d02b64cc1.md index b1ec34a4373..165382eab71 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/646cfd853634255d02b64cc1.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/646cfd853634255d02b64cc1.md @@ -1,6 +1,6 @@ --- id: 646cfd853634255d02b64cc1 -title: Step 31 +title: 31단계 challengeType: 0 dashedName: step-31 --- @@ -27,23 +27,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-ear')?.zIndex, - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/646cfde6ac612e5d60391f50.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/646cfde6ac612e5d60391f50.md index 7918e0e0ef5..e8831dbb427 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/646cfde6ac612e5d60391f50.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/646cfde6ac612e5d60391f50.md @@ -1,6 +1,6 @@ --- id: 646cfde6ac612e5d60391f50 -title: Step 32 +title: 32단계 challengeType: 0 dashedName: step-32 --- @@ -25,23 +25,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.zIndex, - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/646dd556d524bc61c0139bd6.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/646dd556d524bc61c0139bd6.md index efc5f803596..16cda3446b6 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/646dd556d524bc61c0139bd6.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/646dd556d524bc61c0139bd6.md @@ -1,6 +1,6 @@ --- id: 646dd556d524bc61c0139bd6 -title: Step 33 +title: 단계 33 challengeType: 0 dashedName: step-33 --- @@ -45,23 +45,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-inner-ear')?.bo - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/646dd6f9caa862627dd87772.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/646dd6f9caa862627dd87772.md index 2deb2bfa628..d19cae4f152 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/646dd6f9caa862627dd87772.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/646dd6f9caa862627dd87772.md @@ -1,6 +1,6 @@ --- id: 646dd6f9caa862627dd87772 -title: Step 34 +title: 34단계 challengeType: 0 dashedName: step-34 --- @@ -37,23 +37,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-inner-ear')?.le - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/646dd7cfd0cfac630c1dd520.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/646dd7cfd0cfac630c1dd520.md index 43393633355..e95c5abbcc7 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/646dd7cfd0cfac630c1dd520.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/646dd7cfd0cfac630c1dd520.md @@ -1,6 +1,6 @@ --- id: 646dd7cfd0cfac630c1dd520 -title: Step 35 +title: 35단계 challengeType: 0 dashedName: step-35 --- @@ -43,23 +43,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-inner-ear')?.bo - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/646dd8c79ec23463a3d0e356.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/646dd8c79ec23463a3d0e356.md index 450ed9fa7ce..30880b7a8ef 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/646dd8c79ec23463a3d0e356.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/646dd8c79ec23463a3d0e356.md @@ -1,6 +1,6 @@ --- id: 646dd8c79ec23463a3d0e356 -title: Step 36 +title: 36단계 challengeType: 0 dashedName: step-36 --- @@ -43,23 +43,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-inner-ear')?.b - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/646dd9d9a729916460724f16.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/646dd9d9a729916460724f16.md index 5ea501be389..7752f7b38ac 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/646dd9d9a729916460724f16.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/646dd9d9a729916460724f16.md @@ -1,6 +1,6 @@ --- id: 646dd9d9a729916460724f16 -title: Step 37 +title: 37단계 challengeType: 0 dashedName: step-37 --- @@ -37,23 +37,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-inner-ear')?.l - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/646ddab8afd73764f5241bbf.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/646ddab8afd73764f5241bbf.md index 0f9f09a8a59..fb0f2758a2b 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/646ddab8afd73764f5241bbf.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/646ddab8afd73764f5241bbf.md @@ -1,6 +1,6 @@ --- id: 646ddab8afd73764f5241bbf -title: Step 38 +title: 38단계 challengeType: 0 dashedName: step-38 --- @@ -43,23 +43,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-inner-ear')?.b - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/646ddb61ff08366570cc5902.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/646ddb61ff08366570cc5902.md index b3cffa06b8d..2bbc3a9b2b1 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/646ddb61ff08366570cc5902.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/646ddb61ff08366570cc5902.md @@ -1,6 +1,6 @@ --- id: 646ddb61ff08366570cc5902 -title: Step 39 +title: 39단계 challengeType: 0 dashedName: step-39 --- @@ -45,27 +45,27 @@ assert.isTrue(document.querySelectorAll('.cat-eyes div')[1].classList.contains(' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- - --fcc-editable-region-- - - --fcc-editable-region--
-
+ + --fcc-editable-region-- + + --fcc-editable-region-- +
+
``` diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/646ddd3f9f97a0667b964bdb.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/646ddd3f9f97a0667b964bdb.md index afd29b8a83e..e63da8a7636 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/646ddd3f9f97a0667b964bdb.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/646ddd3f9f97a0667b964bdb.md @@ -1,6 +1,6 @@ --- id: 646ddd3f9f97a0667b964bdb -title: Step 40 +title: 40단계 challengeType: 0 dashedName: step-40 --- @@ -55,34 +55,34 @@ assert.isTrue(document.querySelectorAll('.cat-right-eye div')[0]?.classList.cont - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
- --fcc-editable-region-- -
- -
-
- -
- --fcc-editable-region-- -
-
+ +
+
+--fcc-editable-region-- + +
+
+ +--fcc-editable-region-- +
+
+
+
``` diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/646dde7dc20dc167489faa69.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/646dde7dc20dc167489faa69.md index 4ea9ca2aacc..e59b9725b6c 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/646dde7dc20dc167489faa69.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/646dde7dc20dc167489faa69.md @@ -1,6 +1,6 @@ --- id: 646dde7dc20dc167489faa69 -title: Step 41 +title: 41단계 challengeType: 0 dashedName: step-41 --- @@ -43,32 +43,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-eye')?.backgrou - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/646ddf888632fa67f1180940.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/646ddf888632fa67f1180940.md index f0cef13faa9..03f7be93e29 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/646ddf888632fa67f1180940.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/646ddf888632fa67f1180940.md @@ -1,6 +1,6 @@ --- id: 646ddf888632fa67f1180940 -title: Step 42 +title: 42단계 challengeType: 0 dashedName: step-42 --- @@ -37,32 +37,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-eye')?.left, '3 - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/646de5dc8988076a1d992afd.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/646de5dc8988076a1d992afd.md index 1610f62eb4e..5b0ed4815c6 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/646de5dc8988076a1d992afd.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/646de5dc8988076a1d992afd.md @@ -1,6 +1,6 @@ --- id: 646de5dc8988076a1d992afd -title: Step 43 +title: 43단계 challengeType: 0 dashedName: step-43 --- @@ -31,32 +31,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-eye')?.transfor - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/646de6a97b50a86ac487de86.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/646de6a97b50a86ac487de86.md index 638174dd456..522aa172a34 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/646de6a97b50a86ac487de86.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/646de6a97b50a86ac487de86.md @@ -1,6 +1,6 @@ --- id: 646de6a97b50a86ac487de86 -title: Step 44 +title: 44단계 challengeType: 0 dashedName: step-44 --- @@ -45,32 +45,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-eye')?.backgro - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/646de7b64467e96b7d35b5cd.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/646de7b64467e96b7d35b5cd.md index 443889f1091..5cffabb804b 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/646de7b64467e96b7d35b5cd.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/646de7b64467e96b7d35b5cd.md @@ -1,6 +1,6 @@ --- id: 646de7b64467e96b7d35b5cd -title: Step 45 +title: 45단계 challengeType: 0 dashedName: step-45 --- @@ -37,32 +37,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-eye')?.left, ' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/646de8478d6f796bfbdccfb2.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/646de8478d6f796bfbdccfb2.md index 41d83eaca1d..9cb28511c48 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/646de8478d6f796bfbdccfb2.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/646de8478d6f796bfbdccfb2.md @@ -1,6 +1,6 @@ --- id: 646de8478d6f796bfbdccfb2 -title: Step 46 +title: 46단계 challengeType: 0 dashedName: step-46 --- @@ -31,32 +31,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-eye')?.transfo - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/646de8d204a3426c7d184372.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/646de8d204a3426c7d184372.md index dd01ca04815..5e9814968f6 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/646de8d204a3426c7d184372.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/646de8d204a3426c7d184372.md @@ -1,6 +1,6 @@ --- id: 646de8d204a3426c7d184372 -title: Step 47 +title: 47단계 challengeType: 0 dashedName: step-47 --- @@ -45,32 +45,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-inner-eye')?.ba - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/646dea1c98c2426d43a705c3.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/646dea1c98c2426d43a705c3.md index 41a5bc8c725..207e3a2f506 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/646dea1c98c2426d43a705c3.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/646dea1c98c2426d43a705c3.md @@ -1,6 +1,6 @@ --- id: 646dea1c98c2426d43a705c3 -title: Step 48 +title: 48단계 challengeType: 0 dashedName: step-48 --- @@ -49,32 +49,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-inner-eye')?.tr - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/646deb169847f86df0f95bfc.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/646deb169847f86df0f95bfc.md index 3de681bacf3..908a23a17bf 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/646deb169847f86df0f95bfc.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/646deb169847f86df0f95bfc.md @@ -1,6 +1,6 @@ --- id: 646deb169847f86df0f95bfc -title: Step 49 +title: 49단계 challengeType: 0 dashedName: step-49 --- @@ -43,32 +43,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-inner-eye')?.b - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/646dec359bef3b7811fba5a6.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/646dec359bef3b7811fba5a6.md index bf70338690b..25609c48643 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/646dec359bef3b7811fba5a6.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/646dec359bef3b7811fba5a6.md @@ -49,32 +49,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-inner-eye')?.t - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/646dedbcba062079128b2ecc.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/646dedbcba062079128b2ecc.md index 085d8ebda00..8f9bd8d6581 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/646dedbcba062079128b2ecc.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/646dedbcba062079128b2ecc.md @@ -1,6 +1,6 @@ --- id: 646dedbcba062079128b2ecc -title: Step 51 +title: 51단계 challengeType: 0 dashedName: step-51 --- @@ -31,36 +31,36 @@ assert.isTrue(document.querySelectorAll('div')[11].classList.contains('cat-nose' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
- - --fcc-editable-region-- - - --fcc-editable-region--
-
+ + --fcc-editable-region-- + + --fcc-editable-region-- +
+
``` diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/646def5e863abf7a14501421.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/646def5e863abf7a14501421.md index 7ebebec8387..57ad58dbe18 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/646def5e863abf7a14501421.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/646def5e863abf7a14501421.md @@ -1,6 +1,6 @@ --- id: 646def5e863abf7a14501421 -title: Step 52 +title: 52단계 challengeType: 0 dashedName: step-52 --- @@ -43,34 +43,34 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-nose')?.borderBottom - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
- -
-
+ +
+
+
``` diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/646df03c8f79337ab46f148b.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/646df03c8f79337ab46f148b.md index 3b4f3ae39da..e67f0ea7d67 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/646df03c8f79337ab46f148b.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/646df03c8f79337ab46f148b.md @@ -1,6 +1,6 @@ --- id: 646df03c8f79337ab46f148b -title: Step 53 +title: 53단계 challengeType: 0 dashedName: step-53 --- @@ -37,34 +37,34 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-nose')?.left, '85px' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
- -
-
+ +
+
+
``` @@ -196,5 +196,4 @@ body { border-right: 15px solid transparent; border-bottom: 20px solid #442c2c; } - ``` diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/646df0cf26413a7b35e4b8b3.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/646df0cf26413a7b35e4b8b3.md index c697f225902..4733b3b6563 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/646df0cf26413a7b35e4b8b3.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/646df0cf26413a7b35e4b8b3.md @@ -1,6 +1,6 @@ --- id: 646df0cf26413a7b35e4b8b3 -title: Step 54 +title: 54단계 challengeType: 0 dashedName: step-54 --- @@ -49,34 +49,34 @@ assert.notMatch(code, /border-top-right-radius:\s*\d+%;/); - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
- -
-
+ +
+
+
``` @@ -211,5 +211,4 @@ body { border-right: 15px solid transparent; border-bottom: 20px solid #442c2c; } - ``` diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/646df1d1aa4ae57bdf1869c4.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/646df1d1aa4ae57bdf1869c4.md index a8c0636cc9b..8f58427a5de 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/646df1d1aa4ae57bdf1869c4.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/646df1d1aa4ae57bdf1869c4.md @@ -1,6 +1,6 @@ --- id: 646df1d1aa4ae57bdf1869c4 -title: Step 55 +title: 55단계 challengeType: 0 dashedName: step-55 --- @@ -33,38 +33,38 @@ assert.isTrue(document.querySelectorAll('div')[12].classList.contains('cat-mouth - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
- --fcc-editable-region-- - - --fcc-editable-region-- +
+
+
+
+
+
+
-
+ +
+ + --fcc-editable-region-- + + --fcc-editable-region-- +
+
``` diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/646dffd8ce9ac77ec1906f2e.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/646dffd8ce9ac77ec1906f2e.md index 7a1c5d3e8ac..e58b799b538 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/646dffd8ce9ac77ec1906f2e.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/646dffd8ce9ac77ec1906f2e.md @@ -1,6 +1,6 @@ --- id: 646dffd8ce9ac77ec1906f2e -title: Step 56 +title: 56단계 challengeType: 0 dashedName: step-56 --- @@ -43,41 +43,40 @@ assert.isTrue(document.querySelectorAll('.cat-mouth div')[1]?.classList.contains - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
- --fcc-editable-region-- -
- +
+
+
+
+
+
- --fcc-editable-region-- +
+ +
+
+--fcc-editable-region-- + +--fcc-editable-region--
-
+
+
``` @@ -213,5 +212,4 @@ body { border-right: 15px solid transparent; border-bottom: 20px solid #442c2c; } - ``` diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/646f0417322c0e04983a5149.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/646f0417322c0e04983a5149.md index cfd2ab930d9..0fad696dc36 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/646f0417322c0e04983a5149.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/646f0417322c0e04983a5149.md @@ -1,6 +1,6 @@ --- id: 646f0417322c0e04983a5149 -title: Step 59 +title: 59단계 challengeType: 0 dashedName: step-59 --- @@ -43,40 +43,39 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-mouth-line-left')?.l - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
+
+
+
+
+ +
+
+
+
-
+
+
``` @@ -222,6 +221,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/646f08293804a30685533c6f.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/646f08293804a30685533c6f.md index 6e6dab5e6aa..1a18fa6a9bf 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/646f08293804a30685533c6f.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/646f08293804a30685533c6f.md @@ -1,6 +1,6 @@ --- id: 646f08293804a30685533c6f -title: Step 60 +title: 60단계 challengeType: 0 dashedName: step-60 --- @@ -25,40 +25,39 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-mouth-line-left')?.t - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
+
+
+
+
+ +
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/646f09293eb3230723a62f77.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/646f09293eb3230723a62f77.md index ab7896f2f27..bb1d103ea64 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/646f09293eb3230723a62f77.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/646f09293eb3230723a62f77.md @@ -1,6 +1,6 @@ --- id: 646f09293eb3230723a62f77 -title: Step 61 +title: 61단계 challengeType: 0 dashedName: step-61 --- @@ -43,40 +43,39 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-mouth-line-right')?. - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
+
+
+
+
+ +
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/646f0c9a1e3360092d1bbd33.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/646f0c9a1e3360092d1bbd33.md index 1f3d6059e7c..09c8a3591e0 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/646f0c9a1e3360092d1bbd33.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/646f0c9a1e3360092d1bbd33.md @@ -1,6 +1,6 @@ --- id: 646f0c9a1e3360092d1bbd33 -title: Step 62 +title: 62단계 challengeType: 0 dashedName: step-62 --- @@ -25,40 +25,39 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-mouth-line-right')?. - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
+
+
+
+
+ +
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/646f0ce5737243098ad6e494.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/646f0ce5737243098ad6e494.md index d3fc58a415d..aa3a3b48161 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/646f0ce5737243098ad6e494.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/646f0ce5737243098ad6e494.md @@ -1,6 +1,6 @@ --- id: 646f0ce5737243098ad6e494 -title: Step 63 +title: 63단계 challengeType: 0 dashedName: step-63 --- @@ -33,44 +33,43 @@ assert.isTrue(document.querySelectorAll('div')[15].classList.contains('cat-whisk - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
+
+
+
+
+ +
- --fcc-editable-region-- - - --fcc-editable-region-- - +
+
+
-
+ + --fcc-editable-region-- + + --fcc-editable-region-- +
+
``` diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/646f0ef13604420a8744f7d4.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/646f0ef13604420a8744f7d4.md index 69207e6c3f3..d57ce126c95 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/646f0ef13604420a8744f7d4.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/646f0ef13604420a8744f7d4.md @@ -1,6 +1,6 @@ --- id: 646f0ef13604420a8744f7d4 -title: Step 64 +title: 64단계 challengeType: 0 dashedName: step-64 --- @@ -43,46 +43,45 @@ assert.isTrue(document.querySelectorAll('.cat-whiskers div')[1].classList.contai - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- - --fcc-editable-region-- -
- +
+
- --fcc-editable-region-- +
+ +
+ +
+
+
+
+
+--fcc-editable-region-- + +--fcc-editable-region--
-
+
+
``` diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/646f0f7c5933560af8e7e380.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/646f0f7c5933560af8e7e380.md index d4f4f1d53bf..761ee76a7a6 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/646f0f7c5933560af8e7e380.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/646f0f7c5933560af8e7e380.md @@ -1,6 +1,6 @@ --- id: 646f0f7c5933560af8e7e380 -title: Step 65 +title: 65단계 challengeType: 0 dashedName: step-65 --- @@ -50,49 +50,48 @@ assert.isTrue(document.querySelectorAll('.cat-whiskers-left div')[2].classList.c - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
- --fcc-editable-region-- -
- -
- --fcc-editable-region-- -
+
+
+
+ +
+
+
+
+
+ +
+
+--fcc-editable-region-- + +--fcc-editable-region-- +
+
-
+
+
``` diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/646f102bf87b350b593baa72.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/646f102bf87b350b593baa72.md index 46957aeaaa6..d849b09aa57 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/646f102bf87b350b593baa72.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/646f102bf87b350b593baa72.md @@ -1,6 +1,6 @@ --- id: 646f102bf87b350b593baa72 -title: Step 66 +title: 66단계 challengeType: 0 dashedName: step-66 --- @@ -49,53 +49,52 @@ assert.isTrue(document.querySelectorAll('.cat-whiskers-right div')[2].classList. - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
- --fcc-editable-region-- -
- -
- --fcc-editable-region-- +
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+--fcc-editable-region-- + +--fcc-editable-region-- +
-
+
+
``` diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/646f107abb89d00bb99f387a.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/646f107abb89d00bb99f387a.md index ee3a9b329d9..3c761cc2524 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/646f107abb89d00bb99f387a.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/646f107abb89d00bb99f387a.md @@ -1,6 +1,6 @@ --- id: 646f107abb89d00bb99f387a -title: Step 67 +title: 67단계 challengeType: 0 dashedName: step-67 --- @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whiskers-left div')? - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/646f12da0b4c5d0ca162834a.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/646f12da0b4c5d0ca162834a.md index bc96a32b778..78bb2e3e5df 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/646f12da0b4c5d0ca162834a.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/646f12da0b4c5d0ca162834a.md @@ -1,6 +1,6 @@ --- id: 646f12da0b4c5d0ca162834a -title: Step 69 +title: 69단계 challengeType: 0 dashedName: step-69 --- @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-left-top')?. - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -261,6 +260,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/646f135eab69d90d0c6d4e9b.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/646f135eab69d90d0c6d4e9b.md index cfeb544a053..e0e6218f0f0 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/646f135eab69d90d0c6d4e9b.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/646f135eab69d90d0c6d4e9b.md @@ -1,6 +1,6 @@ --- id: 646f135eab69d90d0c6d4e9b -title: Step 70 +title: 70단계 challengeType: 0 dashedName: step-70 --- @@ -25,53 +25,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-left-top')?. - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -250,5 +249,4 @@ body { --fcc-editable-region-- } - ``` diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/646f159b2cffb21150b927cb.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/646f159b2cffb21150b927cb.md index d39758a9723..1c8164f61f3 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/646f159b2cffb21150b927cb.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/646f159b2cffb21150b927cb.md @@ -1,6 +1,6 @@ --- id: 646f159b2cffb21150b927cb -title: Step 71 +title: 71단계 challengeType: 0 dashedName: step-71 --- @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-left-middle' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -268,6 +267,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/646f164bf100dd11d226161f.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/646f164bf100dd11d226161f.md index b46892e2791..d0973aab314 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/646f164bf100dd11d226161f.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/646f164bf100dd11d226161f.md @@ -1,6 +1,6 @@ --- id: 646f164bf100dd11d226161f -title: Step 72 +title: 72단계 challengeType: 0 dashedName: step-72 --- @@ -25,53 +25,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-left-middle' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -254,7 +253,7 @@ body { top: 127px; left: 52px; --fcc-editable-region-- - + --fcc-editable-region-- } ``` diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/646f1764e2f1d212ba9785a7.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/646f1764e2f1d212ba9785a7.md index 73beeb66ad2..f534055a372 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/646f1764e2f1d212ba9785a7.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/646f1764e2f1d212ba9785a7.md @@ -1,6 +1,6 @@ --- id: 646f1764e2f1d212ba9785a7 -title: Step 73 +title: 73단계 challengeType: 0 dashedName: step-73 --- @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-left-bottom' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -275,6 +274,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/646f1802a09a171332e14630.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/646f1802a09a171332e14630.md index a93c1723990..bca773f7eec 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/646f1802a09a171332e14630.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/646f1802a09a171332e14630.md @@ -1,6 +1,6 @@ --- id: 646f1802a09a171332e14630 -title: Step 74 +title: 74단계 challengeType: 0 dashedName: step-74 --- @@ -25,53 +25,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-left-bottom' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/646f4d6c42dc5f214f4e7444.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/646f4d6c42dc5f214f4e7444.md index 7a78a4a8b26..08dbe818c71 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/646f4d6c42dc5f214f4e7444.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/646f4d6c42dc5f214f4e7444.md @@ -1,6 +1,6 @@ --- id: 646f4d6c42dc5f214f4e7444 -title: Step 75 +title: 75단계 challengeType: 0 dashedName: step-75 --- @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-right-top')? - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -282,6 +281,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/646f4e46e81f7021d5fd9c1d.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/646f4e46e81f7021d5fd9c1d.md index 0c9095075e6..1911ac870bd 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/646f4e46e81f7021d5fd9c1d.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/646f4e46e81f7021d5fd9c1d.md @@ -1,6 +1,6 @@ --- id: 646f4e46e81f7021d5fd9c1d -title: Step 76 +title: 76단계 challengeType: 0 dashedName: step-76 --- @@ -25,53 +25,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-right-top')? - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/646f4f6a14e3c522d130a0d2.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/646f4f6a14e3c522d130a0d2.md index 75145cc11d1..5ac920da91c 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/646f4f6a14e3c522d130a0d2.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/646f4f6a14e3c522d130a0d2.md @@ -1,6 +1,6 @@ --- id: 646f4f6a14e3c522d130a0d2 -title: Step 77 +title: 77단계 challengeType: 0 dashedName: step-77 --- @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-right-middle - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -289,6 +288,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/646f4fe12b7985232bf475a5.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/646f4fe12b7985232bf475a5.md index 9d481aae26f..c1a82c593cb 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/646f4fe12b7985232bf475a5.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/646f4fe12b7985232bf475a5.md @@ -1,6 +1,6 @@ --- id: 646f4fe12b7985232bf475a5 -title: Step 78 +title: 78단계 challengeType: 0 dashedName: step-78 --- @@ -25,53 +25,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-right-middle - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/646f507e4d1cd323f17db4fc.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/646f507e4d1cd323f17db4fc.md index 8853a3052b6..5ab110e15e9 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/646f507e4d1cd323f17db4fc.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/646f507e4d1cd323f17db4fc.md @@ -1,6 +1,6 @@ --- id: 646f507e4d1cd323f17db4fc -title: Step 79 +title: 79단계 challengeType: 0 dashedName: step-79 --- @@ -44,53 +44,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-right-bottom - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -297,6 +296,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/646f516dbfc1342495515625.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/646f516dbfc1342495515625.md index ff322b68182..fdc3b507ffc 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/646f516dbfc1342495515625.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/646f516dbfc1342495515625.md @@ -1,6 +1,6 @@ --- id: 646f516dbfc1342495515625 -title: Step 80 +title: 80단계 challengeType: 0 dashedName: step-80 --- @@ -27,53 +27,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-right-bottom - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -295,53 +294,53 @@ body { - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+ +
+
``` diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/6476f5c17f99146071ee884c.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/6476f5c17f99146071ee884c.md index 0b9974e8308..5f76e638937 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/6476f5c17f99146071ee884c.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/6476f5c17f99146071ee884c.md @@ -1,6 +1,6 @@ --- id: 6476f5c17f99146071ee884c -title: Step 8 +title: 8단계 challengeType: 0 dashedName: step-8 --- @@ -41,14 +41,14 @@ assert.equal(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.left, '100p - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
+
+
+
``` @@ -65,9 +65,9 @@ body { .cat-head { --fcc-editable-region-- position: static; +--fcc-editable-region-- top: 100px; left: 100px; ---fcc-editable-region-- background: linear-gradient(#5e5e5e 85%, #45454f 100%); width: 205px; height: 180px; diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/6476f7a4827bcc61682f2347.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/6476f7a4827bcc61682f2347.md index 2c0c66d25ad..673898fdca9 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/6476f7a4827bcc61682f2347.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/6476f7a4827bcc61682f2347.md @@ -9,9 +9,7 @@ dashedName: step-9 `position` 속성에 `absolute` 값을 사용하면 요소가 문서의 일반 흐름에서 벗어나고, 그 위치는 `top`, `right`, `bottom`, `left` 속성에 의해 결정됩니다. -`.cat-head` 요소의 `position` 속성을 `absolute`로 설정한 다음, `top`와 `left` 속성을 임의의 양수 픽셀 값으로 설정하세요. - - +`.cat-head` 요소의 `position` 속성을 `absolute`로 설정하세요. # --hints-- @@ -43,14 +41,14 @@ assert.match(code, /left:\s*\d{1,4}px;/); - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
+
+
+
``` @@ -67,9 +65,9 @@ body { .cat-head { --fcc-editable-region-- position: relative; +--fcc-editable-region-- top: 100px; left: 100px; ---fcc-editable-region-- background: linear-gradient(#5e5e5e 85%, #45454f 100%); width: 205px; height: 180px; diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/6476fb7cbaafa36d65e9cf35.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/6476fb7cbaafa36d65e9cf35.md index 0db5ae0d101..96b5a562484 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/6476fb7cbaafa36d65e9cf35.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/6476fb7cbaafa36d65e9cf35.md @@ -1,6 +1,6 @@ --- id: 6476fb7cbaafa36d65e9cf35 -title: Step 10 +title: 10단계 challengeType: 0 dashedName: step-10 --- @@ -33,17 +33,17 @@ assert.equal(document.querySelectorAll('div')[1]?.getAttribute('class'), 'box'); - - fCC Cat Painting - + + fCC Cat Painting + -
-
- --fcc-editable-region-- - - --fcc-editable-region-- -
+
+
+ --fcc-editable-region-- + + --fcc-editable-region-- +
``` @@ -59,8 +59,8 @@ body { .cat-head { position: absolute; - top: 300px; - left: 400px; + top: 100px; + left: 100px; background: linear-gradient(#5e5e5e 85%, #45454f 100%); width: 205px; height: 180px; diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/6476fc5cf14b276e6d04e82a.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/6476fc5cf14b276e6d04e82a.md index 2b22b05353f..9016b028969 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/6476fc5cf14b276e6d04e82a.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/6476fc5cf14b276e6d04e82a.md @@ -1,6 +1,6 @@ --- id: 6476fc5cf14b276e6d04e82a -title: Step 11 +title: 11단계 challengeType: 0 dashedName: step-11 --- @@ -61,15 +61,15 @@ assert.equal(new __helpers.CSSHelp(document)?.getStyle('.box')?.top, '800px'); - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
+
+
+
+
``` @@ -84,7 +84,7 @@ body { } .cat-head { - position: relative; + position: absolute; top: 100px; left: 100px; background: linear-gradient(#5e5e5e 85%, #45454f 100%); diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/6476fd4213318f6ee211028a.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/6476fd4213318f6ee211028a.md index 722192b3f35..f2f4c9c76af 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/6476fd4213318f6ee211028a.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/6476fd4213318f6ee211028a.md @@ -1,13 +1,13 @@ --- id: 6476fd4213318f6ee211028a -title: Step 12 +title: 12단계 challengeType: 0 dashedName: step-12 --- # --description-- -이제 `position`의 `.cat-head` 속성 값을 `fixed`로 바꾸세요. `top`와 `left`는 그대로 두세요. +이제 `.cat-head`의 `position` 속성 값을 `fixed`로 바꾸세요. 그다음, 위아래로 스크롤하여 `fixed` 값이 어떻게 작동하는지 확인하세요. @@ -39,15 +39,15 @@ assert.equal(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.left, '100p - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
+
+
+
+
``` @@ -63,10 +63,10 @@ body { .cat-head { --fcc-editable-region-- - position: relative; + position: absolute; +--fcc-editable-region-- top: 100px; left: 100px; ---fcc-editable-region-- background: linear-gradient(#5e5e5e 85%, #45454f 100%); width: 205px; height: 180px; diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/64770351e8586671ec0911f0.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/64770351e8586671ec0911f0.md index 4d78659ee45..ac4ea83f6d5 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/64770351e8586671ec0911f0.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/64770351e8586671ec0911f0.md @@ -21,7 +21,7 @@ dashedName: step-13 assert.equal(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.position, 'sticky'); ``` -`.cat-head` 선택자에 `top` 속성을 `0`로 설정해야 합니다. 세미콜론을 꼭 추가하세요. +`.cat-head` 선택자에 `top` 속성을 `0`으로 설정해야 합니다. 세미콜론을 꼭 추가하세요. ```js assert.equal(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.top, '0px'); @@ -41,15 +41,15 @@ assert.notMatch(code, /left:\s*100px;?/); - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
+
+
+
+
``` diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/6477062778c85972eb648030.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/6477062778c85972eb648030.md index be03ad8e899..f87c1a07c79 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/6477062778c85972eb648030.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/6477062778c85972eb648030.md @@ -1,6 +1,6 @@ --- id: 6477062778c85972eb648030 -title: Step 14 +title: 14단계 challengeType: 0 dashedName: step-14 --- @@ -57,15 +57,15 @@ assert.equal(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.margin, 'au - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
+
+
+
+
``` @@ -82,8 +82,8 @@ body { .cat-head { --fcc-editable-region-- position: sticky; - top: 0; --fcc-editable-region-- + top: 0; background: linear-gradient(#5e5e5e 85%, #45454f 100%); width: 205px; height: 180px; @@ -92,7 +92,7 @@ body { } .box { - width: 400px; + width: 200px; height: 600px; background-color: #000; position: absolute; diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/647d821de0d97b3283c72b36.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/647d821de0d97b3283c72b36.md index 5a4db286c40..7146e8de882 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/647d821de0d97b3283c72b36.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/647d821de0d97b3283c72b36.md @@ -1,6 +1,6 @@ --- id: 647d821de0d97b3283c72b36 -title: Step 16 +title: 16단계 challengeType: 0 dashedName: step-16 --- @@ -14,7 +14,7 @@ dashedName: step-16 `.box` CSS 규칙과 모든 값을 제거해야 합니다. ```js -assert.notMatch(code, /\.box\s*\{\s*width:\s*400px;\s*height:\s*600px;\s*background-color:\s*#000;\s*position:\s*absolute;\s*left:\s*650px;\s*top:\s*800px;?\s*\}\s*/) +assert.notMatch(code, /\.box\s*\{\s*width:\s*200px;\s*height:\s*600px;\s*background-color:\s*#000;\s*position:\s*absolute;\s*left:\s*650px;\s*top:\s*800px;?\s*\}\s*/) ``` # --seed-- @@ -25,14 +25,14 @@ assert.notMatch(code, /\.box\s*\{\s*width:\s*400px;\s*height:\s*600px;\s*backgro - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
+
+
+
``` @@ -62,7 +62,7 @@ body { --fcc-editable-region-- .box { - width: 400px; + width: 200px; height: 600px; background-color: #000; position: absolute; diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/647d855ac12cd436059acd39.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/647d855ac12cd436059acd39.md index 5c5dc60221c..c1ac5674179 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/647d855ac12cd436059acd39.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/647d855ac12cd436059acd39.md @@ -1,6 +1,6 @@ --- id: 647d855ac12cd436059acd39 -title: Step 2 +title: 2단계 challengeType: 0 dashedName: step-2 --- @@ -33,9 +33,9 @@ assert.strictEqual(new __helpers.CSSHelp(document).getStyle('*')?.boxSizing, 'bo - - fCC Cat Painting - + + fCC Cat Painting + diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/649353647c44ef4867ab4935.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/649353647c44ef4867ab4935.md index 3ad39b8a347..67d67b4dc28 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/649353647c44ef4867ab4935.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/649353647c44ef4867ab4935.md @@ -1,6 +1,6 @@ --- id: 649353647c44ef4867ab4935 -title: Step 15 +title: 15단계 challengeType: 0 dashedName: step-15 --- @@ -25,17 +25,17 @@ assert.notMatch(code, /<\/div>/) - - fCC Cat Painting - + + fCC Cat Painting + -
-
- --fcc-editable-region-- -
- --fcc-editable-region-- -
+
+
+ --fcc-editable-region-- +
+ --fcc-editable-region-- +
``` @@ -64,7 +64,7 @@ body { } .box { - width: 400px; + width: 200px; height: 600px; background-color: #000; position: absolute; diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/64a2687ef267e5934a2f93e3.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/64a2687ef267e5934a2f93e3.md index 01e7be71d5c..d53c73f7fc2 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/64a2687ef267e5934a2f93e3.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/64a2687ef267e5934a2f93e3.md @@ -1,6 +1,6 @@ --- id: 64a2687ef267e5934a2f93e3 -title: Step 57 +title: 57단계 challengeType: 0 dashedName: step-57 --- @@ -43,39 +43,39 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-mouth div')?.border, - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
- -
- -
-
-
+
+
-
+ +
+ +
+
+
+
+
+
``` diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/64a26ac5540c5493f4641f10.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/64a26ac5540c5493f4641f10.md index 598e7eb5c39..529aa0228b4 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/64a26ac5540c5493f4641f10.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/64a26ac5540c5493f4641f10.md @@ -1,6 +1,6 @@ --- id: 64a26ac5540c5493f4641f10 -title: Step 58 +title: 58단계 challengeType: 0 dashedName: step-58 --- @@ -32,39 +32,39 @@ assert.match(code, /border-radius:\s*190%\/190px\s*150px\s*0\s*0\s*;?/) - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
- -
- -
-
-
+
+
-
+ +
+ +
+
+
+
+
+
``` diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/64a3bcbc83e574b58c8ed048.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/64a3bcbc83e574b58c8ed048.md index 90af1bc9de5..db93b969fac 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/64a3bcbc83e574b58c8ed048.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/64a3bcbc83e574b58c8ed048.md @@ -1,6 +1,6 @@ --- id: 64a3bcbc83e574b58c8ed048 -title: Step 68 +title: 68단계 challengeType: 0 dashedName: step-68 --- @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whiskers-right div') - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/6676a8a8d9861319ee901a90.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/6676a8a8d9861319ee901a90.md index a73272bfbe6..5db97166fe6 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/6676a8a8d9861319ee901a90.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/6676a8a8d9861319ee901a90.md @@ -1,6 +1,6 @@ --- id: 6676a8a8d9861319ee901a90 -title: Step 22 +title: 22단계 challengeType: 0 dashedName: step-22 --- @@ -103,23 +103,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-ear')?.borderBo - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/korean/blocks/workshop-cat-painting/6676a8b01e56ec1a1e07c202.md b/curriculum/challenges/korean/blocks/workshop-cat-painting/6676a8b01e56ec1a1e07c202.md index 3c5312063f4..0b62f644cfc 100644 --- a/curriculum/challenges/korean/blocks/workshop-cat-painting/6676a8b01e56ec1a1e07c202.md +++ b/curriculum/challenges/korean/blocks/workshop-cat-painting/6676a8b01e56ec1a1e07c202.md @@ -73,23 +73,23 @@ assert.isEmpty(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.backg - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` @@ -117,15 +117,15 @@ body { border-radius: 46%; } ---fcc-editable-region-- .cat-right-ear { +--fcc-editable-region-- height: 100px; width: 100px; background-color: white; border-left: 35px solid blue; border-right: 35px solid blue; border-top: 35px solid red; +--fcc-editable-region-- border-bottom: 35px solid red; } ---fcc-editable-region-- ``` diff --git a/curriculum/challenges/korean/blocks/workshop-envelope-budget-app/69b2c970cb02ddaafff1c10d.md b/curriculum/challenges/korean/blocks/workshop-envelope-budget-app/69b2c970cb02ddaafff1c10d.md index df937538845..e3827573bf6 100644 --- a/curriculum/challenges/korean/blocks/workshop-envelope-budget-app/69b2c970cb02ddaafff1c10d.md +++ b/curriculum/challenges/korean/blocks/workshop-envelope-budget-app/69b2c970cb02ddaafff1c10d.md @@ -62,7 +62,7 @@ assert.notMatch(code, /<\/input>/); `input` 요소는 닫는 `>`를 가져야 합니다. ```js -assert.match(code, /HTMLString\s*=\s*`\n\s*Expense\s\$\{entryNumber\}\sName<\/label>\n\s*]*\/>/); +assert.match(code, /HTMLString\s*=\s*`\n\s*Expense\s\$\{entryNumber\}\sName<\/label>\n\s*]*>/); ``` # --seed-- diff --git a/curriculum/challenges/korean/blocks/workshop-fcc-authors-page/69e14a2fd8ecf9210c0739ee.md b/curriculum/challenges/korean/blocks/workshop-fcc-authors-page/69e14a2fd8ecf9210c0739ee.md index a21f38caaae..c36756da0ef 100644 --- a/curriculum/challenges/korean/blocks/workshop-fcc-authors-page/69e14a2fd8ecf9210c0739ee.md +++ b/curriculum/challenges/korean/blocks/workshop-fcc-authors-page/69e14a2fd8ecf9210c0739ee.md @@ -11,6 +11,12 @@ dashedName: step-26 편집기에서 표시된 공간에 `initialFetch` 함수를 호출하는 코드를 추가하세요. +# --before-all-- + +```js +window.fetch = () => Promise.resolve({json: () => Promise.resolve([{ author: 'Whoever', image: 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==', url: "http://not-a-real-url.nowhere/", bio: 'words go here' }])}); +``` + # --hints-- 인수 없이 `initialFetch`를 호출해야 합니다. diff --git a/curriculum/challenges/korean/blocks/workshop-fortune-teller-app/68ded620ab19272a3fa97592.md b/curriculum/challenges/korean/blocks/workshop-fortune-teller-app/68ded620ab19272a3fa97592.md index 37b18a98d68..78ebb705c8c 100644 --- a/curriculum/challenges/korean/blocks/workshop-fortune-teller-app/68ded620ab19272a3fa97592.md +++ b/curriculum/challenges/korean/blocks/workshop-fortune-teller-app/68ded620ab19272a3fa97592.md @@ -73,10 +73,9 @@ assert.isTrue(renderCard.hasReturnAnnotation("string")); `renderCard` 함수는 템플릿 리터럴을 반환해야 합니다. ```js -assert.match( - __helpers.removeJSComments(code), - /renderCard\s*=\s*\([^)]*\)\s*:\s*string\s*=>\s*(?:\{\s*return\s*)?`/ -); +const explorer = await __helpers.Explorer(code); +const { renderCard } = explorer.allFunctions; +assert.match(__helpers.removeJSComments(renderCard.toString()), /(?:return|=>)\s*`/); ``` # --seed-- diff --git a/curriculum/challenges/korean/blocks/workshop-fortune-teller-app/68ed4621677e86eeefa59fe6.md b/curriculum/challenges/korean/blocks/workshop-fortune-teller-app/68ed4621677e86eeefa59fe6.md index d1d5a156fd3..d1c6b200fa5 100644 --- a/curriculum/challenges/korean/blocks/workshop-fortune-teller-app/68ed4621677e86eeefa59fe6.md +++ b/curriculum/challenges/korean/blocks/workshop-fortune-teller-app/68ed4621677e86eeefa59fe6.md @@ -15,8 +15,8 @@ dashedName: step-26 ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.initializeEventListeners.toString(); -assert.match(method, /initializeEventListeners\s*\(\s*\)\s*:\s*void/); +const { initializeEventListeners } = explorer.classes.Game?.methods ?? {}; +assert.isTrue(initializeEventListeners?.hasReturnAnnotation("void")); ``` # --seed-- diff --git a/curriculum/challenges/korean/blocks/workshop-fortune-teller-app/68ee6c4b4c764b62d77df717.md b/curriculum/challenges/korean/blocks/workshop-fortune-teller-app/68ee6c4b4c764b62d77df717.md index 91179075f61..ca991584cd1 100644 --- a/curriculum/challenges/korean/blocks/workshop-fortune-teller-app/68ee6c4b4c764b62d77df717.md +++ b/curriculum/challenges/korean/blocks/workshop-fortune-teller-app/68ee6c4b4c764b62d77df717.md @@ -17,16 +17,30 @@ dashedName: step-31 ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.singleCardSelected.toString(); -assert.match(method, /const\s+isReversed\s*=/); +const { singleCardSelected } = explorer.classes.Game?.methods ?? {}; +const { isReversed } = singleCardSelected?.variables ?? {}; +assert.exists(isReversed); ``` `isReversed` 변수는 카드가 뒤집혔는지 무작위로 결정하기 위해 `Math.random()`를 사용해야 합니다. ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.singleCardSelected.toString(); -assert.match(method, /isReversed\s*=\s*Math\.random\s*\(\s*\)\s*<\s*0\.5/); +const { singleCardSelected } = explorer.classes.Game?.methods ?? {}; +const { isReversed } = singleCardSelected?.variables ?? {}; + +const validForms = [ + 'Math.random() < 0.5', + 'Math.random() > 0.5', + 'Math.random() <= 0.5', + 'Math.random() >= 0.5', + '0.5 < Math.random()', + '0.5 > Math.random()', + '0.5 <= Math.random()', + '0.5 >= Math.random()' +]; + +assert.isTrue(validForms.some((form) => isReversed?.value.matches(form))); ``` # --seed-- diff --git a/curriculum/challenges/korean/blocks/workshop-fortune-teller-app/68ee6c8c274515694ead0024.md b/curriculum/challenges/korean/blocks/workshop-fortune-teller-app/68ee6c8c274515694ead0024.md index 98adf5f86f0..75c76ce7fe5 100644 --- a/curriculum/challenges/korean/blocks/workshop-fortune-teller-app/68ee6c8c274515694ead0024.md +++ b/curriculum/challenges/korean/blocks/workshop-fortune-teller-app/68ee6c8c274515694ead0024.md @@ -7,7 +7,7 @@ dashedName: step-32 # --description-- -운세는 무작위여야 하므로 무작위 운세를 선택하는 도우미 함수가 필요합니다. `chosenCard` 메서드 안에 `singleCardSelected`라는 변수를 선언하세요. `getRandomItem` 메서드를 사용해 무작위 카드를 얻고 `cards`를 인수로 전달하세요. +운세는 무작위여야 하므로 무작위 운세를 선택하는 도우미 함수가 필요합니다. `singleCardSelected` 메서드 안에 `chosenCard`라는 변수를 선언하세요. `getRandomItem` 함수를 사용해 무작위 카드를 얻고 `this.cards`를 인수로 전달하세요. # --hints-- @@ -15,22 +15,18 @@ dashedName: step-32 ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.singleCardSelected.toString(); -assert.match(method, /const\s+chosenCard\s*=/); +const { singleCardSelected } = explorer.classes.Game?.methods ?? {}; +const { chosenCard } = singleCardSelected?.variables ?? {}; +assert.exists(chosenCard); ``` `chosenCard` 변수는 `getRandomItem(this.cards)`를 호출하여 할당해야 합니다. ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.singleCardSelected.toString(); -assert.match(method, /chosenCard\s*=\s*getRandomItem\s*\(\s*this\.cards\s*\)/); -``` - -`this.cards`에 인수로 `getRandomItem`를 전달해야 합니다. - -```js -assert.match(__helpers.removeJSComments(code), /getRandomItem\s*\(\s*this\.cards\s*\)/); +const { singleCardSelected } = explorer.classes.Game?.methods ?? {}; +const { chosenCard } = singleCardSelected?.variables ?? {}; +assert.isTrue(chosenCard?.value.matches("getRandomItem(this.cards)")); ``` # --seed-- diff --git a/curriculum/challenges/korean/blocks/workshop-fortune-teller-app/68f1e43a5f890b51774d93c4.md b/curriculum/challenges/korean/blocks/workshop-fortune-teller-app/68f1e43a5f890b51774d93c4.md index ea1f454663d..0958f00bf2f 100644 --- a/curriculum/challenges/korean/blocks/workshop-fortune-teller-app/68f1e43a5f890b51774d93c4.md +++ b/curriculum/challenges/korean/blocks/workshop-fortune-teller-app/68f1e43a5f890b51774d93c4.md @@ -15,22 +15,28 @@ dashedName: step-43 ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /const\s+target\s*=/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { target } = showFortune?.variables ?? {}; +assert.exists(target); ``` `target` 변수에 `e.target`가 할당되어야 합니다. ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /target\s*=\s*e\.target/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { target } = showFortune?.variables ?? {}; +assert.isTrue(target?.value.matches("e.target")); ``` `if` 변수 바로 다음에 빈 `target` 문이 있어야 합니다. ```js -assert.match(__helpers.removeJSComments(code), /showFortune\s*\([^)]*\)\s*\{[\s\S]*?if\s*\(\s*\)\s*\{\s*\}/); +const explorer = await __helpers.Explorer(code); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +assert.exists(showFortune); +const method = __helpers.removeJSComments(showFortune.toString()); +assert.match(method, /target\s*=\s*e\.target[\s\S]*?if\s*\(\s*\)\s*\{\s*\}/); ``` # --seed-- diff --git a/curriculum/challenges/korean/blocks/workshop-fortune-teller-app/68f1e6a98bc05e67cc2b85e6.md b/curriculum/challenges/korean/blocks/workshop-fortune-teller-app/68f1e6a98bc05e67cc2b85e6.md index 4608450bc40..746d79f7240 100644 --- a/curriculum/challenges/korean/blocks/workshop-fortune-teller-app/68f1e6a98bc05e67cc2b85e6.md +++ b/curriculum/challenges/korean/blocks/workshop-fortune-teller-app/68f1e6a98bc05e67cc2b85e6.md @@ -15,22 +15,18 @@ dashedName: step-45 ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /const\s+cardElement\s*=/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { cardElement } = showFortune?.variables ?? {}; +assert.exists(cardElement); ``` `cardElement`는 `target?.closest`를 사용해 `.card_container`를 찾아야 합니다. ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /cardElement\s*=\s*target\?\.closest\s*\(\s*['"]\.card_container['"]\s*\)/); -``` - -`.card_container`를 `closest`의 인수로 전달하세요. - -```js -assert.match(__helpers.removeJSComments(code), /\.closest\s*\(\s*['"]\.card_container['"]\s*\)/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { cardElement } = showFortune?.variables ?? {}; +assert.isTrue(cardElement?.value.matches("target?.closest('.card_container')")); ``` # --seed-- diff --git a/curriculum/challenges/korean/blocks/workshop-fortune-teller-app/68f1e852f705eb77f6bcb893.md b/curriculum/challenges/korean/blocks/workshop-fortune-teller-app/68f1e852f705eb77f6bcb893.md index 3f8044a5899..a0578611e6c 100644 --- a/curriculum/challenges/korean/blocks/workshop-fortune-teller-app/68f1e852f705eb77f6bcb893.md +++ b/curriculum/challenges/korean/blocks/workshop-fortune-teller-app/68f1e852f705eb77f6bcb893.md @@ -15,28 +15,18 @@ dashedName: step-48 ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /const\s+cardId\s*=/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { cardId } = showFortune?.variables ?? {}; +assert.exists(cardId); ``` `cardId` 변수는 `cardElement.getAttribute("data-id")`를 호출하여 할당해야 합니다. ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /cardId\s*=\s*cardElement\.getAttribute\s*\(\s*['"]data-id['"]\s*\)/); -``` - -`getAttribute`에 `cardElement` 메서드를 사용하세요. - -```js -assert.match(__helpers.removeJSComments(code), /cardElement\.getAttribute\s*\(/); -``` - -`'data-id'`을 `getAttribute`에 전달해야 합니다. - -```js -assert.match(__helpers.removeJSComments(code), /\.getAttribute\s*\(\s*['"]data-id['"]\s*\)/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { cardId } = showFortune?.variables ?? {}; +assert.isTrue(cardId?.value.matches('cardElement.getAttribute("data-id")')); ``` # --seed-- diff --git a/curriculum/challenges/korean/blocks/workshop-fortune-teller-app/68f1e8de2731b07d62e738d2.md b/curriculum/challenges/korean/blocks/workshop-fortune-teller-app/68f1e8de2731b07d62e738d2.md index 8217a81391c..639ac950ec3 100644 --- a/curriculum/challenges/korean/blocks/workshop-fortune-teller-app/68f1e8de2731b07d62e738d2.md +++ b/curriculum/challenges/korean/blocks/workshop-fortune-teller-app/68f1e8de2731b07d62e738d2.md @@ -15,28 +15,38 @@ dashedName: step-49 ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /const\s+foundCard\s*=/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { foundCard } = showFortune?.variables ?? {}; +assert.exists(foundCard); ``` -`foundCard`는 올바른 콜백과 함께 `find`에서 `this.cards`를 호출한 결과를 할당해야 합니다. +`foundCard`는 `this.cards`에서 `find`를 호출하여 할당해야 하며, `card` 매개변수를 받는 콜백을 전달하고, 이 콜백은 `card.name_short`와 `cardId`를 엄격한 동등성으로 비교한 결과를 반환해야 합니다. ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /foundCard\s*=\s*this\.cards\.find\s*\(/); -``` - -`find` 콜백은 `card`라는 매개변수를 가져야 합니다. - -```js -assert.match(__helpers.removeJSComments(code), /cards\.find\s*\(\s*\(\s*card\s*\)\s*=>/); -``` - -콜백 내부에서 `card.name_short`과 `cardId`를 비교해야 합니다. - -```js -assert.match(__helpers.removeJSComments(code), /card\.name_short\s*===?\s*cardId/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { foundCard } = showFortune?.variables ?? {}; + +const validForms = [ + 'this.cards.find((card) => card.name_short === cardId)', + 'this.cards.find((card) => { return card.name_short === cardId; })', + 'this.cards.find((card) => cardId === card.name_short)', + 'this.cards.find((card) => { return cardId === card.name_short; })', + 'this.cards.find(card => card.name_short === cardId)', + 'this.cards.find(card => { return card.name_short === cardId; })', + 'this.cards.find(card => cardId === card.name_short)', + 'this.cards.find(card => { return cardId === card.name_short; })', + 'this.cards.find((card: Card) => card.name_short === cardId)', + 'this.cards.find((card: Card) => { return card.name_short === cardId; })', + 'this.cards.find((card: Card) => cardId === card.name_short)', + 'this.cards.find((card: Card) => { return cardId === card.name_short; })', + 'this.cards.find(function (card) { return card.name_short === cardId; })', + 'this.cards.find(function (card) { return cardId === card.name_short; })', + 'this.cards.find(function (card: Card) { return card.name_short === cardId; })', + 'this.cards.find(function (card: Card) { return cardId === card.name_short; })' +]; + +assert.isTrue(validForms.some((form) => foundCard?.value.matches(form))); ``` # --seed-- diff --git a/curriculum/challenges/korean/blocks/workshop-greeting-bot/66ad8ab945d266383f318cbf.md b/curriculum/challenges/korean/blocks/workshop-greeting-bot/66ad8ab945d266383f318cbf.md index 6d4f94b7024..3ad7e494208 100644 --- a/curriculum/challenges/korean/blocks/workshop-greeting-bot/66ad8ab945d266383f318cbf.md +++ b/curriculum/challenges/korean/blocks/workshop-greeting-bot/66ad8ab945d266383f318cbf.md @@ -30,7 +30,11 @@ assert.lengthOf(logSpy.calls, 2); `console` 문장에는 메시지 `"I am excited to talk to you."`가 있어야 합니다. 따옴표를 잊지 마세요. ```js -assert.deepInclude(logSpy.calls, ["I am excited to talk to you."]); +assert.isTrue( + logSpy.calls.some( + (call) => /I\s+am\s+excited\s+to\s+talk\s+to\s+you\s*\./.test(call[0]) + ) +); ``` # --seed-- diff --git a/curriculum/challenges/korean/blocks/workshop-greeting-bot/66ad9c633fa26d3c1475eae3.md b/curriculum/challenges/korean/blocks/workshop-greeting-bot/66ad9c633fa26d3c1475eae3.md index 74dcf56a953..4340c73c343 100644 --- a/curriculum/challenges/korean/blocks/workshop-greeting-bot/66ad9c633fa26d3c1475eae3.md +++ b/curriculum/challenges/korean/blocks/workshop-greeting-bot/66ad9c633fa26d3c1475eae3.md @@ -28,7 +28,11 @@ assert.lengthOf(logSpy.calls, 3); `console` 문장에는 메시지 `"Allow me to introduce myself."`가 있어야 합니다. 따옴표를 잊지 마세요. ```js -assert.deepInclude(logSpy.calls, ["Allow me to introduce myself."]); +assert.isTrue( + logSpy.calls.some( + (call) => /Allow\s+me\s+to\s+introduce\s+myself\s*\./.test(call[0]) + ) +); ``` # --seed-- diff --git a/curriculum/challenges/korean/blocks/workshop-greeting-bot/66add47d27763c4862492c8c.md b/curriculum/challenges/korean/blocks/workshop-greeting-bot/66add47d27763c4862492c8c.md index a792625109b..c352af21692 100644 --- a/curriculum/challenges/korean/blocks/workshop-greeting-bot/66add47d27763c4862492c8c.md +++ b/curriculum/challenges/korean/blocks/workshop-greeting-bot/66add47d27763c4862492c8c.md @@ -76,12 +76,10 @@ console.log(favoriteSubjectSentence); ```js console.log("Hi there!"); console.log("I am excited to talk to you."); - let bot; -let botLocation; - bot = "teacherBot"; -botLocation = "the universe"; + +let botLocation = "the universe"; console.log("Allow me to introduce myself."); diff --git a/curriculum/challenges/korean/blocks/workshop-hotel-feedback-form/66a93bbe65a26169dbf3bc39.md b/curriculum/challenges/korean/blocks/workshop-hotel-feedback-form/66a93bbe65a26169dbf3bc39.md index 62d483f35ba..e205fe4c056 100644 --- a/curriculum/challenges/korean/blocks/workshop-hotel-feedback-form/66a93bbe65a26169dbf3bc39.md +++ b/curriculum/challenges/korean/blocks/workshop-hotel-feedback-form/66a93bbe65a26169dbf3bc39.md @@ -13,7 +13,7 @@ dashedName: step-10 # --hints-- -`label` 요소가 있어야 합니다. +두 번째 `label` 요소를 `fieldset` 안에 포함하세요. ```js assert.lengthOf(document.querySelectorAll('fieldset label'), 2); diff --git a/curriculum/challenges/korean/blocks/workshop-hotel-feedback-form/66a9401c9d660d6bb15993e2.md b/curriculum/challenges/korean/blocks/workshop-hotel-feedback-form/66a9401c9d660d6bb15993e2.md index 1008da12544..b1ecef246fe 100644 --- a/curriculum/challenges/korean/blocks/workshop-hotel-feedback-form/66a9401c9d660d6bb15993e2.md +++ b/curriculum/challenges/korean/blocks/workshop-hotel-feedback-form/66a9401c9d660d6bb15993e2.md @@ -15,7 +15,7 @@ dashedName: step-13 # --hints-- -`label` 요소가 있어야 합니다. +당신의 `fieldset` 안에 세 번째 `label` 요소가 있어야 합니다. ```js assert.lengthOf(document.querySelectorAll('fieldset label'), 3); diff --git a/curriculum/challenges/korean/blocks/workshop-hotel-feedback-form/66a9419e2d18476c645ce693.md b/curriculum/challenges/korean/blocks/workshop-hotel-feedback-form/66a9419e2d18476c645ce693.md index 204d4d1869e..571e1e838ec 100644 --- a/curriculum/challenges/korean/blocks/workshop-hotel-feedback-form/66a9419e2d18476c645ce693.md +++ b/curriculum/challenges/korean/blocks/workshop-hotel-feedback-form/66a9419e2d18476c645ce693.md @@ -17,9 +17,9 @@ dashedName: step-14 `min`과 `max` 속성은 입력 필드에 입력할 수 있는 최솟값과 최댓값을 설정하는 데 사용합니다. -`label` 요소 아래에 `type` 속성이 `"number"`로 설정되고 `id`가 `"age"`인 입력을 추가하세요. +`label` 요소 아래에 `type` 속성이 `"number"`로 설정되고 `id`가 `"age"`인 `input`을 추가하세요. -`name` 속성은 `"age"`로, `min` 속성은 `"3"`로, `max` 속성은 `"100"`로 설정해야 합니다. +`name` 속성은 `"age"`로, `min` 속성은 `"3"`으로, `max` 속성은 `"100"`으로 설정하세요. # --hints-- @@ -29,13 +29,13 @@ dashedName: step-14 assert.isNotNull(document.querySelector('label + input[type="number"]')); ``` -숫자 `input`에는 `id`가 `age`로 설정되어야 합니다. +숫자 `input`에 `id`가 `"age"`로 있어야 합니다. ```js assert.isNotNull(document.querySelector('label + input#age')); ``` -숫자 `input`에는 `name` 속성이 `age`로 설정되어야 합니다. +숫자 `input`에 `name` 속성이 `"age"`로 설정되어야 합니다. ```js assert.isNotNull(document.querySelector('label + input[name="age"]')); diff --git a/curriculum/challenges/korean/blocks/workshop-hotel-feedback-form/67a51d3a8a6fe123b77b0c6e.md b/curriculum/challenges/korean/blocks/workshop-hotel-feedback-form/67a51d3a8a6fe123b77b0c6e.md index 79ef8f53183..2ecee53b10f 100644 --- a/curriculum/challenges/korean/blocks/workshop-hotel-feedback-form/67a51d3a8a6fe123b77b0c6e.md +++ b/curriculum/challenges/korean/blocks/workshop-hotel-feedback-form/67a51d3a8a6fe123b77b0c6e.md @@ -7,11 +7,11 @@ dashedName: step-12 # --description-- -`input` 요소는 `size` 속성을 가질 수 있습니다. 이 속성은 사용자가 입력할 때 보여야 하는 문자 수를 정의합니다. `size`의 값은 0보다 큰 음이 아닌 정수여야 합니다. `size`이 지정되지 않았거나 잘못된 값으로 지정된 경우, 입력은 브라우저가 설정한 기본 너비를 갖게 됩니다. +`input` 요소는 `size` 속성을 가질 수 있습니다. 이 속성은 사용자가 `input`에 입력할 때 보이도록 할 문자 수를 정의합니다. `size`의 값은 양의 정수여야 합니다. `size`가 지정되지 않았거나 잘못된 값으로 지정된 경우, `input`은 브라우저가 설정한 기본 너비를 갖습니다. ```html - - + + ``` name과 email 입력에 `size` 속성을 값 `"20"`로 지정하세요. diff --git a/curriculum/challenges/korean/blocks/workshop-plant-nursery-catalog/6734a772196245601e4b80e0.md b/curriculum/challenges/korean/blocks/workshop-plant-nursery-catalog/6734a772196245601e4b80e0.md index 6e8443af7ff..17c9ccc464b 100644 --- a/curriculum/challenges/korean/blocks/workshop-plant-nursery-catalog/6734a772196245601e4b80e0.md +++ b/curriculum/challenges/korean/blocks/workshop-plant-nursery-catalog/6734a772196245601e4b80e0.md @@ -9,7 +9,7 @@ dashedName: step-10 맵에서 요소를 가져와야 할 때는 `get` 메서드를 사용할 수 있습니다. 이 메서드는 키를 인수로 받아 연결된 값을 반환합니다. -`get` 메서드를 사용해 `ballerina` 키의 값을 카탈로그에서 가져와 `getBallerina`라는 변수에 할당하세요. 그런 다음 새 변수를 콘솔에 출력하세요. +`get` 메서드를 사용해 카탈로그에서 `ballerina` 키의 값을 가져와 `getBallerina`라는 변수에 할당하세요. 그런 다음 새 변수를 콘솔에 출력하세요. # --hints-- @@ -22,7 +22,10 @@ assert.exists(getBallerina); `getBallerina` 변수는 `catalog.get(ballerina)` 값을 가져야 합니다. ```js -assert.match(__helpers.removeJSComments(code), /(const|let|var)\s+getBallerina\s*=\s*catalog\s*\.\s*get\s*\(\s*ballerina\s*\)/); +const explorer = await __helpers.Explorer(code); +const { getBallerina } = explorer.variables; +assert.isTrue(getBallerina?.value.matches('catalog.get(ballerina)') +); ``` `getBallerina` 변수를 콘솔에 출력해야 합니다. diff --git a/curriculum/challenges/korean/blocks/workshop-plant-nursery-catalog/6737a1a073a0d14c6544d301.md b/curriculum/challenges/korean/blocks/workshop-plant-nursery-catalog/6737a1a073a0d14c6544d301.md index cbf5a450405..6e184fc9658 100644 --- a/curriculum/challenges/korean/blocks/workshop-plant-nursery-catalog/6737a1a073a0d14c6544d301.md +++ b/curriculum/challenges/korean/blocks/workshop-plant-nursery-catalog/6737a1a073a0d14c6544d301.md @@ -23,7 +23,9 @@ assert.exists(plantsSet); `displayPlantsSet`를 호출하고 `plantsSet`에 할당해야 합니다. ```js -assert.match(__helpers.removeJSComments(code), /(const|let|var)\s+plantsSet\s*=\s*displayPlantsSet\s*\(\s*\)/) +const explorer = await __helpers.Explorer(code); +const { plantsSet } = explorer.variables; +assert.isTrue(plantsSet?.value.matches('displayPlantsSet()')); ``` `plantsSet`를 콘솔에 출력해야 합니다. diff --git a/curriculum/challenges/korean/blocks/workshop-reusable-mega-navbar/6740495ba48aa94e5667b436.md b/curriculum/challenges/korean/blocks/workshop-reusable-mega-navbar/6740495ba48aa94e5667b436.md index 69c59beda3e..191201faacb 100644 --- a/curriculum/challenges/korean/blocks/workshop-reusable-mega-navbar/6740495ba48aa94e5667b436.md +++ b/curriculum/challenges/korean/blocks/workshop-reusable-mega-navbar/6740495ba48aa94e5667b436.md @@ -10,7 +10,7 @@ demoType: onLoad 이 워크숍에서는 재사용 가능한 내비게이션 바를 만들어 React 함수형 컴포넌트를 다루는 연습을 하세요. -내비게이션 바를 만드는 데 집중할 수 있도록 모든 CSS가 제공되어 있습니다. +내비게이션 바를 만드는 데 집중할 수 있도록 모든 CSS가 제공되었습니다. 먼저 `Navbar` 함수형 컴포넌트를 정의하세요. 다음 단계에서 JSX를 사용해 컴포넌트를 구축하기 시작할 것입니다. @@ -24,7 +24,7 @@ export function multiply(a, b) { } ``` -또한 React 함수형 컴포넌트는 일반 HTML 요소와 구분하기 위해 반드시 대문자로 시작해야 합니다. +또한, React 함수형 컴포넌트는 React가 일반 HTML 요소와 구분하는 방법이기 때문에 대문자로 시작해야 합니다. # --hints-- diff --git a/curriculum/challenges/korean/blocks/workshop-reusable-mega-navbar/67457ff2dc531fbed928a0f0.md b/curriculum/challenges/korean/blocks/workshop-reusable-mega-navbar/67457ff2dc531fbed928a0f0.md index 5d20526ae79..aa8fd2cfb8c 100644 --- a/curriculum/challenges/korean/blocks/workshop-reusable-mega-navbar/67457ff2dc531fbed928a0f0.md +++ b/curriculum/challenges/korean/blocks/workshop-reusable-mega-navbar/67457ff2dc531fbed928a0f0.md @@ -24,10 +24,9 @@ const App = () => { } ``` - `Navbar` 컴포넌트 안에서 `nav`가 `className`인 `navbar` 요소를 반환하세요. -여기서 `className` 대신 `class`를 사용하지 않는 이유는 `class`가 JavaScript에서 예약어이기 때문입니다. 그래서 React는 요소에 클래스를 적용할 때 `className`를 사용합니다. +여기서는 `class`가 JavaScript에서 예약어이기 때문에 `class` 대신 `className`을 사용합니다. 그래서 React에서는 요소에 클래스를 적용할 때 `className`을 사용합니다. # --hints-- @@ -37,7 +36,7 @@ const App = () => { assert.exists(document.querySelector('nav')); ``` -`nav` 요소에 `className` 속성이 있고 그 값이 `navbar`여야 합니다. +당신의 `nav` 요소는 `navbar`라는 `className`을 가져야 합니다. ```js assert.equal(document.querySelector('nav')?.getAttribute('class'), 'navbar'); diff --git a/curriculum/challenges/korean/blocks/workshop-reusable-mega-navbar/6745c732dbeb7c04f346e6f7.md b/curriculum/challenges/korean/blocks/workshop-reusable-mega-navbar/6745c732dbeb7c04f346e6f7.md index c792f67f47e..8c1ec930cf4 100644 --- a/curriculum/challenges/korean/blocks/workshop-reusable-mega-navbar/6745c732dbeb7c04f346e6f7.md +++ b/curriculum/challenges/korean/blocks/workshop-reusable-mega-navbar/6745c732dbeb7c04f346e6f7.md @@ -7,7 +7,7 @@ dashedName: step-3 # --description-- -`ul` 요소 안에 `nav` 요소를 만드세요. 그 `ul` 요소 안에 세 개의 목록 항목을 만드세요. +`nav` 요소 안에 `ul` 요소를 만드세요. 그 `ul` 요소 안에 세 개의 `li` 요소를 만드세요. # --hints-- diff --git a/curriculum/challenges/korean/blocks/workshop-reusable-mega-navbar/6745c89fba004707ded84453.md b/curriculum/challenges/korean/blocks/workshop-reusable-mega-navbar/6745c89fba004707ded84453.md index 5dccbdb2211..69819559cd1 100644 --- a/curriculum/challenges/korean/blocks/workshop-reusable-mega-navbar/6745c89fba004707ded84453.md +++ b/curriculum/challenges/korean/blocks/workshop-reusable-mega-navbar/6745c89fba004707ded84453.md @@ -7,17 +7,17 @@ dashedName: step-5 # --description-- -첫 번째 `li` 요소 안에 앵커 요소를 만드세요. `a` 요소에 `href` 속성을 `#` 값으로 주고, 텍스트는 `Dashboard`로 하세요. +첫 번째 `li` 요소 안에 `a` 요소를 만드세요. `href` 속성은 `#`로 지정하고 텍스트는 `Dashboard`로 하세요. # --hints-- -첫 번째 목록 항목 안에 `a` 요소를 만들어야 합니다. +첫 번째 `li` 요소 안에 `a` 요소를 만드세요. ```js assert.exists(document.querySelector('li a')); ``` -`a` 요소에 `href` 속성을 `#`로 설정하세요. +`a` 요소에 `href` 속성을 `#`로 지정하세요. ```js assert.equal(document.querySelector('a')?.getAttribute('href'), '#'); diff --git a/curriculum/challenges/korean/blocks/workshop-reusable-mega-navbar/6745cebbf97ef2129f3b9bab.md b/curriculum/challenges/korean/blocks/workshop-reusable-mega-navbar/6745cebbf97ef2129f3b9bab.md index e6c6a0ef624..47692b4793c 100644 --- a/curriculum/challenges/korean/blocks/workshop-reusable-mega-navbar/6745cebbf97ef2129f3b9bab.md +++ b/curriculum/challenges/korean/blocks/workshop-reusable-mega-navbar/6745cebbf97ef2129f3b9bab.md @@ -7,17 +7,17 @@ dashedName: step-6 # --description-- -두 번째 `a` 요소 안에 또 다른 `li` 요소를 만드세요. `href` 속성을 `#`로 주고 텍스트는 `Widgets`로 하세요. +두 번째 `li` 요소 안에 또 다른 `a` 요소를 만드세요. `href` 속성은 `#`로 지정하고 텍스트는 `Widgets`로 하세요. # --hints-- -두 번째 목록 항목 안에 `a` 요소를 만들어야 합니다. +두 번째 `li` 요소 안에 `a` 요소를 만들어야 합니다. ```js assert.lengthOf(document.querySelectorAll('li a'), 2); ``` -`a` 요소에 `href` 속성을 `#`로 설정하세요. +`a` 요소는 `href` 속성이 `#`이어야 합니다. ```js assert.equal(document.querySelectorAll('a')[1]?.getAttribute('href'), '#'); diff --git a/curriculum/challenges/korean/blocks/workshop-reusable-mega-navbar/6745d799beeb822076a4da9d.md b/curriculum/challenges/korean/blocks/workshop-reusable-mega-navbar/6745d799beeb822076a4da9d.md index 9c02cce0b13..c59607011a4 100644 --- a/curriculum/challenges/korean/blocks/workshop-reusable-mega-navbar/6745d799beeb822076a4da9d.md +++ b/curriculum/challenges/korean/blocks/workshop-reusable-mega-navbar/6745d799beeb822076a4da9d.md @@ -7,13 +7,13 @@ dashedName: step-7 # --description-- -세 번째 목록 항목 안에 `button` 요소를 만들고 `aria-expanded` 속성을 `false`로 설정하세요. 또한 `button`의 텍스트를 `Apps`로 설정하세요. +세 번째 `li` 요소 안에 `aria-expanded` 속성이 `false`인 `button` 요소를 만드세요. 그리고 `button`의 텍스트를 `Apps`로 설정하세요. `aria-expanded` 속성은 버튼이 확장 가능한 하위 메뉴를 작동시킨다는 것을 화면 읽기 프로그램 사용자에게 알립니다. # --hints-- -세 번째 목록 항목 안에 `button` 요소를 만들어야 합니다. +세 번째 `li` 요소 안에 `button` 요소를 만드세요. ```js assert.exists(document.querySelector('li:nth-of-type(3) button')); diff --git a/curriculum/challenges/korean/blocks/workshop-reusable-mega-navbar/6745d9df333efe2543a1f457.md b/curriculum/challenges/korean/blocks/workshop-reusable-mega-navbar/6745d9df333efe2543a1f457.md index 3e6da22f7dd..9246ccf8cce 100644 --- a/curriculum/challenges/korean/blocks/workshop-reusable-mega-navbar/6745d9df333efe2543a1f457.md +++ b/curriculum/challenges/korean/blocks/workshop-reusable-mega-navbar/6745d9df333efe2543a1f457.md @@ -7,7 +7,7 @@ dashedName: step-8 # --description-- -세 번째 `li` 요소 안에 계속해서 팝업용 `ul` 요소를 만드세요. `className`의 `sub-menu`와 `aria-label`의 `Apps`를 지정하세요. +세 번째 `li` 요소 안에 계속해서 팝업용 `ul` 요소를 만드세요. `className`을 `sub-menu`로, `aria-label`을 `Apps`로 지정하세요. # --hints-- @@ -17,13 +17,13 @@ dashedName: step-8 assert.exists(document.querySelector('li ul')); ``` -`ul` 요소의 `className` 속성을 `sub-menu`으로 설정해야 합니다. +만든 `ul` 요소는 `className`이 `sub-menu`여야 합니다. ```js assert.equal(document.querySelector('li ul')?.getAttribute('class'), 'sub-menu'); ``` -`ul` 요소의 `aria-label` 속성을 `Apps`으로 설정해야 합니다. +만든 `ul` 요소는 `aria-label`이 `Apps`여야 합니다. ```js assert.equal(document.querySelector('li ul')?.getAttribute('aria-label'), 'Apps'); diff --git a/curriculum/challenges/korean/blocks/workshop-reusable-mega-navbar/6745dce846995b2a466594be.md b/curriculum/challenges/korean/blocks/workshop-reusable-mega-navbar/6745dce846995b2a466594be.md index c487ca3be31..9011ebfb1bc 100644 --- a/curriculum/challenges/korean/blocks/workshop-reusable-mega-navbar/6745dce846995b2a466594be.md +++ b/curriculum/challenges/korean/blocks/workshop-reusable-mega-navbar/6745dce846995b2a466594be.md @@ -7,11 +7,11 @@ dashedName: step-9 # --description-- -`ul.sub-menu` 요소 안에 새 리스트 항목 세 개를 만드세요. +`ul` 요소 안에 `className`이 `sub-menu`인 새로운 `li` 요소 세 개를 만드세요. # --hints-- -`ul` 요소 안에 `className`의 `sub-menu`를 가진 새 리스트 항목 세 개를 만드세요. +`ul` 요소 안에 `className`이 `sub-menu`인 새로운 `li` 요소 세 개를 만들어야 합니다. ```js assert.lengthOf(document.querySelectorAll('.sub-menu li'), 3); diff --git a/curriculum/challenges/korean/blocks/workshop-reusable-mega-navbar/6745de9ce925b92d72df713a.md b/curriculum/challenges/korean/blocks/workshop-reusable-mega-navbar/6745de9ce925b92d72df713a.md index eb07fdbff71..57238f90d81 100644 --- a/curriculum/challenges/korean/blocks/workshop-reusable-mega-navbar/6745de9ce925b92d72df713a.md +++ b/curriculum/challenges/korean/blocks/workshop-reusable-mega-navbar/6745de9ce925b92d72df713a.md @@ -7,11 +7,11 @@ dashedName: step-10 # --description-- -각 `li` 요소 안에 `href` 속성이 `#`로 설정된 앵커 요소를 만드세요. +새로 추가된 세 개의 `li` 요소 각각 안에 `href` 속성이 `#`인 `a` 요소를 만드세요. # --hints-- -각 목록 항목 안에 새 `a` 요소를 만들고 그 `href` 속성을 `#`로 설정하세요. +새로 추가된 세 개의 `li` 요소 각각 안에 `href` 속성이 `#`인 새로운 `a` 요소를 만들어야 합니다. ```js assert.equal(document.querySelectorAll('li a')[2]?.getAttribute('href'), '#'); diff --git a/curriculum/challenges/korean/blocks/workshop-reusable-mega-navbar/6745e2aca895c935168e7d91.md b/curriculum/challenges/korean/blocks/workshop-reusable-mega-navbar/6745e2aca895c935168e7d91.md index 1cd2eee45f8..89535b2d064 100644 --- a/curriculum/challenges/korean/blocks/workshop-reusable-mega-navbar/6745e2aca895c935168e7d91.md +++ b/curriculum/challenges/korean/blocks/workshop-reusable-mega-navbar/6745e2aca895c935168e7d91.md @@ -7,25 +7,25 @@ dashedName: step-11 # --description-- -마지막으로, 첫 번째 앵커 태그에는 `Calendar` 텍스트를, 두 번째에는 `Chat` 텍스트를, 세 번째에는 `Email` 텍스트를 설정하세요. +마무리하려면 첫 번째 `a` 요소의 텍스트를 `Calendar`로, 두 번째는 `Chat`으로, 세 번째는 `Email`로 설정하세요. -이렇게 하면 mega 내비게이션 바 컴포넌트가 완성됩니다! +이렇게 하면 `Navbar` 컴포넌트가 완성됩니다! # --hints-- -첫 번째 앵커 요소에는 `Calendar` 텍스트를 설정해야 합니다. +첫 번째 `a` 요소의 텍스트를 `Calendar`로 설정하세요. ```js assert.equal(document.querySelectorAll('li a')[2]?.textContent, 'Calendar'); ``` -두 번째 앵커 요소에는 `Chat` 텍스트를 설정해야 합니다. +두 번째 `a` 요소의 텍스트를 `Chat`으로 설정하세요. ```js assert.equal(document.querySelectorAll('li a')[3]?.textContent, 'Chat'); ``` -세 번째 앵커 요소에는 `Email` 텍스트를 설정해야 합니다. +세 번째 `a` 요소의 텍스트를 `Email`로 설정하세요. ```js assert.equal(document.querySelectorAll('li a')[4]?.textContent, 'Email'); diff --git a/curriculum/challenges/korean/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165b.md b/curriculum/challenges/korean/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165b.md index d5d69e8172e..79b894912c2 100644 --- a/curriculum/challenges/korean/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165b.md +++ b/curriculum/challenges/korean/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165b.md @@ -7,7 +7,7 @@ dashedName: step-5 # --description-- -return 문 안에서 빈 문자열을 `div` 요소로 바꾸고, `className` 속성에 `flex-container` 값을 넣으세요. +`return` 문 안에서 빈 문자열을 `className`이 `flex-container`인 `div` 요소로 바꾸세요. # --hints-- @@ -26,7 +26,7 @@ return 문 안에서 빈 문자열을 `div` 요소로 바꾸고, `className` 속 assert.lengthOf(testElem.children, 1); ``` -`div` 컴포넌트는 `className` 속성에 `flex-container` 값을 가져야 합니다. +당신의 `div`는 `className`이 `flex-container`여야 합니다. ```js const testElem = await __helpers.prepTestComponent(window.index.App); diff --git a/curriculum/challenges/korean/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165c.md b/curriculum/challenges/korean/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165c.md index 93251a20d65..a8402b6d917 100644 --- a/curriculum/challenges/korean/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165c.md +++ b/curriculum/challenges/korean/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165c.md @@ -7,7 +7,7 @@ dashedName: step-6 # --description-- -이제 `Card` 컴포넌트를 `App` 컴포넌트 안에 넣으세요. `name` 프로프는 `"Mark"`로, `title` 프로프는 `"Front-End developer"`로, `bio`는 `"I like to work with different front-end technologies and play video games."`로 설정하세요. +이제 `Card` 컴포넌트를 `App` 컴포넌트 안에 넣으세요. `name` 프로프는 `"Mark"`로, `title` 프로프는 `"Front-End developer"`로, `bio` 프로프는 `"I like to work with different front-end technologies and play video games."`로 설정하세요. # --hints-- diff --git a/curriculum/challenges/korean/blocks/workshop-reusable-profile-card-component/68720c179cd34be6793bfdf6.md b/curriculum/challenges/korean/blocks/workshop-reusable-profile-card-component/68720c179cd34be6793bfdf6.md index 25494927534..49f532f48e8 100644 --- a/curriculum/challenges/korean/blocks/workshop-reusable-profile-card-component/68720c179cd34be6793bfdf6.md +++ b/curriculum/challenges/korean/blocks/workshop-reusable-profile-card-component/68720c179cd34be6793bfdf6.md @@ -9,7 +9,7 @@ dashedName: step-8 애플리케이션이 예상대로 작동하지만, 보통 이렇게 여러 `Card` 컴포넌트를 수동으로 추가하지는 않습니다. -`` 요소 안에 있는 세 개의 `
` 컴포넌트를 제거하세요. 다음 몇 단계에서 데이터 배열을 만들고 `map()` 함수를 사용해 `Card` 컴포넌트를 렌더링할 것입니다. 이것이 React에서 더 일반적인 방법입니다. +`
` 요소 안에 있는 세 개의 `` 컴포넌트를 제거하세요. 다음 몇 단계에서 데이터 배열을 만들고 `map()` 메서드를 사용해 `Card` 컴포넌트를 렌더링할 텐데, 이것이 React에서 더 일반적인 방법입니다. # --hints-- diff --git a/curriculum/challenges/korean/blocks/workshop-reusable-profile-card-component/68778af56eb5d980a4e2daed.md b/curriculum/challenges/korean/blocks/workshop-reusable-profile-card-component/68778af56eb5d980a4e2daed.md index 0b8286053ca..59b9f6432ff 100644 --- a/curriculum/challenges/korean/blocks/workshop-reusable-profile-card-component/68778af56eb5d980a4e2daed.md +++ b/curriculum/challenges/korean/blocks/workshop-reusable-profile-card-component/68778af56eb5d980a4e2daed.md @@ -30,7 +30,7 @@ const profilesVal = eval(profiles?.value.toString()); assert.isArray(profilesVal); ``` -프로필 배열에는 `id`, `name`, `title`, `bio` 모든 필수 프로퍼티를 포함하는 객체가 있어야 합니다. +당신의 `profiles` 배열에는 `id`, `name`, `title`, `bio`의 모든 필수 프로퍼티를 포함하는 객체가 있어야 합니다. ```js const explorer = await __helpers.Explorer(code); diff --git a/curriculum/challenges/korean/blocks/workshop-reusable-profile-card-component/68779156bd3704b727ba5f38.md b/curriculum/challenges/korean/blocks/workshop-reusable-profile-card-component/68779156bd3704b727ba5f38.md index 5e2edf6026f..db170ade13a 100644 --- a/curriculum/challenges/korean/blocks/workshop-reusable-profile-card-component/68779156bd3704b727ba5f38.md +++ b/curriculum/challenges/korean/blocks/workshop-reusable-profile-card-component/68779156bd3704b727ba5f38.md @@ -7,7 +7,7 @@ dashedName: step-10 # --description-- -이전 수업에서 기억하듯이, `map` 메서드를 사용해 다양한 객체를 순차적으로 반복하며 컴포넌트를 동적으로 렌더링할 수 있습니다: +이전 수업에서 기억하듯이, `map()` 메서드를 사용해 다양한 객체를 순차적으로 반복하고 컴포넌트를 동적으로 렌더링할 수 있습니다: ```jsx export function App() { diff --git a/curriculum/challenges/korean/blocks/workshop-reusable-profile-card-component/687799aefd1f2af1704065d0.md b/curriculum/challenges/korean/blocks/workshop-reusable-profile-card-component/687799aefd1f2af1704065d0.md index 2d40f32e06c..13c93cede37 100644 --- a/curriculum/challenges/korean/blocks/workshop-reusable-profile-card-component/687799aefd1f2af1704065d0.md +++ b/curriculum/challenges/korean/blocks/workshop-reusable-profile-card-component/687799aefd1f2af1704065d0.md @@ -23,7 +23,7 @@ dashedName: step-11
``` -`key` 프로프는 React가 어떤 항목이 변경되었고, 추가되었으며, 제거되었는지 식별하는 데 도움을 줍니다. 이는 성능을 향상시키고 더 효율적인 업데이트를 가능하게 합니다. +`key` 프로프는 React가 어떤 항목이 변경되었고, 추가되었으며, 제거되었는지 식별하는 데 도움을 줍니다. 이는 성능을 향상시키고 보다 효율적인 업데이트를 가능하게 합니다. `Card` 컴포넌트를 업데이트하여 `key` 값을 가진 `profile.id` 프로프를 포함하세요. diff --git a/curriculum/challenges/korean/blocks/workshop-toggle-text-app/67cd46ec4ec904186ad52ba5.md b/curriculum/challenges/korean/blocks/workshop-toggle-text-app/67cd46ec4ec904186ad52ba5.md index 917d4a37fad..511c5e2de3d 100644 --- a/curriculum/challenges/korean/blocks/workshop-toggle-text-app/67cd46ec4ec904186ad52ba5.md +++ b/curriculum/challenges/korean/blocks/workshop-toggle-text-app/67cd46ec4ec904186ad52ba5.md @@ -7,7 +7,7 @@ dashedName: step-3 # --description-- -`button` 요소 아래에 `id`의 `message`를 가진 단락 요소를 추가하고 텍스트는 `I love freeCodeCamp!`로 하세요. +`button` 요소 아래에 `id`가 `message`인 단락 요소를 추가하고 텍스트는 `I love freeCodeCamp!`로 하세요. # --hints-- @@ -17,7 +17,7 @@ dashedName: step-3 assert.exists(document.querySelector("p")); ``` -단락 요소는 `id`의 `message`를 가져야 합니다. +단락 요소에 `id`가 `message`여야 합니다. ```js assert.exists(document.getElementById("message")) diff --git a/curriculum/challenges/korean/blocks/workshop-toggle-text-app/67cd49e05693111a41771f29.md b/curriculum/challenges/korean/blocks/workshop-toggle-text-app/67cd49e05693111a41771f29.md index c515d7ea832..7c30c10cfac 100644 --- a/curriculum/challenges/korean/blocks/workshop-toggle-text-app/67cd49e05693111a41771f29.md +++ b/curriculum/challenges/korean/blocks/workshop-toggle-text-app/67cd49e05693111a41771f29.md @@ -19,7 +19,7 @@ const [user, setUser] = useState("Jessica"); 새 상태 변수와 설정 함수 이름을 각각 `isVisible`와 `setIsVisible`로 만드세요. 예제에 나온 배열 구조 분해 구문을 사용해야 합니다. -그다음 `useState` 훅에 초기값 `false`을 할당하세요. +그런 다음 초기값을 `false`로 하여 `useState` 훅을 호출하세요. # --hints-- diff --git a/curriculum/challenges/korean/blocks/workshop-toggle-text-app/67cd4fe67813f71c3479e64a.md b/curriculum/challenges/korean/blocks/workshop-toggle-text-app/67cd4fe67813f71c3479e64a.md index 9746a911cef..858a46022b1 100644 --- a/curriculum/challenges/korean/blocks/workshop-toggle-text-app/67cd4fe67813f71c3479e64a.md +++ b/curriculum/challenges/korean/blocks/workshop-toggle-text-app/67cd4fe67813f71c3479e64a.md @@ -9,7 +9,7 @@ dashedName: step-6 단락 텍스트를 표시하는 한 가지 방법은 `useState` 훅의 초기 값을 변경하는 것입니다. -현재 `useState` 값을 `false`에서 `true`으로 변경하면 단락 텍스트가 화면에 표시되는 것을 확인할 수 있습니다. +`useState`의 초기 값을 `false`에서 `true`로 변경하세요. 올바르게 하면 단락 텍스트가 화면에 표시되는 것을 볼 수 있습니다. # --hints-- diff --git a/curriculum/challenges/korean/blocks/workshop-toggle-text-app/67cd525b0e575b1e5abf4c03.md b/curriculum/challenges/korean/blocks/workshop-toggle-text-app/67cd525b0e575b1e5abf4c03.md index c57690ccc34..42a4b1360be 100644 --- a/curriculum/challenges/korean/blocks/workshop-toggle-text-app/67cd525b0e575b1e5abf4c03.md +++ b/curriculum/challenges/korean/blocks/workshop-toggle-text-app/67cd525b0e575b1e5abf4c03.md @@ -7,7 +7,7 @@ dashedName: step-9 # --description-- -앞서 언급했듯이, set 함수는 상태를 업데이트하는 역할을 합니다. 불리언 상태 값을 토글할 때 흔히 사용하는 방법은 다음과 같이 상태를 업데이트하는 것입니다: +앞서 언급했듯이, set 함수는 상태를 업데이트하는 역할을 합니다. 불리언 상태 값을 전환할 때 흔히 사용하는 방법은 다음과 같이 상태를 업데이트하는 것입니다: ```js const [isUserLoggedIn, setIsUserLoggedIn] = useState(false); @@ -16,7 +16,7 @@ const [isUserLoggedIn, setIsUserLoggedIn] = useState(false); setIsUserLoggedIn(!isUserLoggedIn); ``` -다음 예제는 `setIsUserLoggedIn`라는 set 함수를 사용해 사용자의 로그인 상태를 업데이트하고 있습니다. 불리언 값 `!`와 `true` 사이를 토글할 때 논리 부정 연산자(`false`)를 사용하는 것이 일반적인 관행입니다. 초기 값이 `false`이므로 `!` 연산자를 적용하면 `true`으로 변경됩니다. +위 예제는 `setIsUserLoggedIn`이라는 set 함수를 사용해 사용자의 로그인 상태를 업데이트하고 있습니다. `true`와 `false` 사이를 전환할 때 논리 NOT(`!`) 연산자를 사용하는 것이 일반적인 방법입니다. 초기 값이 `false`이므로 `!` 연산자를 적용하면 `true`로 바뀝니다. `handleToggleVisibility` 함수 내부에서 논리 부정 연산자(`setIsVisible`)를 사용해 가시성 상태를 업데이트하려면 `!`을 사용하세요. diff --git a/curriculum/challenges/korean/blocks/workshop-toggle-text-app/67cd57e96257ed1fabbe4879.md b/curriculum/challenges/korean/blocks/workshop-toggle-text-app/67cd57e96257ed1fabbe4879.md index b2f6957950b..bd1141a8c77 100644 --- a/curriculum/challenges/korean/blocks/workshop-toggle-text-app/67cd57e96257ed1fabbe4879.md +++ b/curriculum/challenges/korean/blocks/workshop-toggle-text-app/67cd57e96257ed1fabbe4879.md @@ -27,7 +27,7 @@ function handleClick() { # --hints-- -`toggle-button`를 클릭하면 화면에 `"I love freeCodeCamp!"` 메시지가 나타나야 합니다. +`toggle-button`을 클릭하면 화면에 `I love freeCodeCamp!` 메시지가 나타나야 합니다. ```js const abuseState = __helpers.spyOn(React, "useState"); diff --git a/curriculum/challenges/korean/blocks/workshop-toggle-text-app/67cd5bace629fa219a70aa6d.md b/curriculum/challenges/korean/blocks/workshop-toggle-text-app/67cd5bace629fa219a70aa6d.md index 3bbb0d6c777..8b84c250606 100644 --- a/curriculum/challenges/korean/blocks/workshop-toggle-text-app/67cd5bace629fa219a70aa6d.md +++ b/curriculum/challenges/korean/blocks/workshop-toggle-text-app/67cd5bace629fa219a70aa6d.md @@ -9,7 +9,7 @@ dashedName: step-12 콘솔을 확인했다면 `false` 대신 `true` 값이 나와서 놀랐을 수도 있습니다. 이는 React가 상태를 즉시 업데이트하지 않기 때문입니다. 상태는 다음 렌더링 주기에서만 업데이트됩니다. -React를 처음 접하는 개발자들이 set 함수 바로 뒤에 콘솔 문을 넣는 실수를 자주 합니다. React 애플리케이션을 만들 때 이 점을 유의하세요. +React에 익숙하지 않은 개발자가 set 함수 바로 뒤에 콘솔 문을 넣는 것은 흔한 실수입니다. 따라서 React 애플리케이션을 개발할 때 이 점을 유념하세요. `console.log()`가 더 이상 필요 없으니 `handleToggleVisibility` 함수에서 제거하세요. diff --git a/curriculum/challenges/korean/blocks/workshop-toggle-text-app/67cd61c24bfc0a240132fd2f.md b/curriculum/challenges/korean/blocks/workshop-toggle-text-app/67cd61c24bfc0a240132fd2f.md index bac5284666a..df8825388af 100644 --- a/curriculum/challenges/korean/blocks/workshop-toggle-text-app/67cd61c24bfc0a240132fd2f.md +++ b/curriculum/challenges/korean/blocks/workshop-toggle-text-app/67cd61c24bfc0a240132fd2f.md @@ -23,14 +23,14 @@ dashedName: step-13 # --hints-- -`isVisible`이 `false`일 때 버튼 텍스트는 `Show Message`여야 합니다. +`isVisible`이 `false`일 때 버튼 텍스트가 `Show Message`라고 표시되어야 합니다. ```js const btn = document.getElementById("toggle-button"); assert.equal(btn.textContent, "Show Message"); ``` -`isVisible`이 `true`일 때 버튼 텍스트는 `Hide Message`여야 합니다. +`isVisible`이 `true`일 때 버튼 텍스트가 `Hide Message`라고 표시되어야 합니다. ```js const abuseState = __helpers.spyOn(React, "useState"); @@ -246,7 +246,7 @@ export const ToggleApp = () => { const handleToggleVisibility = () => { setIsVisible(!isVisible); - } + }; return (
diff --git a/curriculum/challenges/korean/blocks/workshop-wildlife-tracker/6999ac171928136168654774.md b/curriculum/challenges/korean/blocks/workshop-wildlife-tracker/6999ac171928136168654774.md index 38df9b984ec..e2ad5d81c08 100644 --- a/curriculum/challenges/korean/blocks/workshop-wildlife-tracker/6999ac171928136168654774.md +++ b/curriculum/challenges/korean/blocks/workshop-wildlife-tracker/6999ac171928136168654774.md @@ -42,8 +42,10 @@ assert.isFunction(getSpecies); `getSpecies` 함수는 `animal`라는 단일 매개변수를 가져야 합니다. ```js -const regex = __helpers.functionRegex('getSpecies', ['animal']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { getSpecies } = explorer.allFunctions; +assert.equal(getSpecies?.parameters.length, 1); +assert.equal(getSpecies?.parameters[0].toString(), 'animal'); ``` `getSpecies(tiger)`를 콘솔에 출력해야 합니다. diff --git a/curriculum/challenges/korean/blocks/workshop-wildlife-tracker/6999ad1cdc249e185aaeedbd.md b/curriculum/challenges/korean/blocks/workshop-wildlife-tracker/6999ad1cdc249e185aaeedbd.md index 961682c74f8..5b6e5db6fa7 100644 --- a/curriculum/challenges/korean/blocks/workshop-wildlife-tracker/6999ad1cdc249e185aaeedbd.md +++ b/curriculum/challenges/korean/blocks/workshop-wildlife-tracker/6999ad1cdc249e185aaeedbd.md @@ -49,8 +49,11 @@ assert.isFunction(addHabitat); `addHabitat` 함수는 두 개의 매개변수 `animal`와 `habitat`를 가져야 합니다. ```js -const regex = __helpers.functionRegex('addHabitat', ['animal', 'habitat']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { addHabitat } = explorer.allFunctions; +assert.equal(addHabitat?.parameters.length, 2); +assert.equal(addHabitat?.parameters[0].toString(), 'animal'); +assert.equal(addHabitat?.parameters[1].toString(), 'habitat'); ``` `addHabitat` 함수는 업데이트된 `animal` 객체를 반환해야 합니다. diff --git a/curriculum/challenges/korean/blocks/workshop-wildlife-tracker/6999adc72c02812a28c01e31.md b/curriculum/challenges/korean/blocks/workshop-wildlife-tracker/6999adc72c02812a28c01e31.md index 97d5a06ad24..2dcf35ae1ed 100644 --- a/curriculum/challenges/korean/blocks/workshop-wildlife-tracker/6999adc72c02812a28c01e31.md +++ b/curriculum/challenges/korean/blocks/workshop-wildlife-tracker/6999adc72c02812a28c01e31.md @@ -43,8 +43,11 @@ assert.isFunction(updateAge); `updateAge` 함수는 두 개의 매개변수 `animal`와 `newAge`를 가져야 합니다. ```js -const regex = __helpers.functionRegex('updateAge', ['animal', 'newAge']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { updateAge } = explorer.allFunctions; +assert.equal(updateAge?.parameters.length, 2); +assert.equal(updateAge?.parameters[0].toString(), 'animal'); +assert.equal(updateAge?.parameters[1].toString(), 'newAge'); ``` `updateAge` 함수는 업데이트된 `animal` 객체를 반환해야 합니다. diff --git a/curriculum/challenges/korean/blocks/workshop-wildlife-tracker/6999b0198d18d402c36cc5fe.md b/curriculum/challenges/korean/blocks/workshop-wildlife-tracker/6999b0198d18d402c36cc5fe.md index 590daad597b..fba63119f9a 100644 --- a/curriculum/challenges/korean/blocks/workshop-wildlife-tracker/6999b0198d18d402c36cc5fe.md +++ b/curriculum/challenges/korean/blocks/workshop-wildlife-tracker/6999b0198d18d402c36cc5fe.md @@ -45,8 +45,10 @@ assert.isFunction(removeEndangeredStatus); `removeEndangeredStatus` 함수는 `animal`라는 매개변수 하나를 가져야 합니다. ```js -const regex = __helpers.functionRegex('removeEndangeredStatus', ['animal']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { removeEndangeredStatus } = explorer.allFunctions; +assert.equal(removeEndangeredStatus?.parameters.length, 1); +assert.equal(removeEndangeredStatus?.parameters[0].toString(), 'animal'); ``` `removeEndangeredStatus` 함수는 업데이트된 `animal` 객체를 반환해야 합니다. diff --git a/curriculum/challenges/korean/blocks/workshop-wildlife-tracker/6999b07c34c2cde21ee6e1d8.md b/curriculum/challenges/korean/blocks/workshop-wildlife-tracker/6999b07c34c2cde21ee6e1d8.md index 84659d47166..ac257b45053 100644 --- a/curriculum/challenges/korean/blocks/workshop-wildlife-tracker/6999b07c34c2cde21ee6e1d8.md +++ b/curriculum/challenges/korean/blocks/workshop-wildlife-tracker/6999b07c34c2cde21ee6e1d8.md @@ -49,8 +49,10 @@ assert.isFunction(hasHabitat); `hasHabitat` 함수는 `animal`라는 매개변수 하나를 가져야 합니다. ```js -const regex = __helpers.functionRegex('hasHabitat', ['animal']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { hasHabitat } = explorer.allFunctions; +assert.equal(hasHabitat?.parameters.length, 1); +assert.equal(hasHabitat?.parameters[0].toString(), 'animal'); ``` `hasHabitat`는 `hasOwnProperty` 메서드를 사용해 `habitat` 속성을 확인해야 합니다. diff --git a/curriculum/challenges/korean/blocks/workshop-wildlife-tracker/6999b0d79ea938edcb032237.md b/curriculum/challenges/korean/blocks/workshop-wildlife-tracker/6999b0d79ea938edcb032237.md index 3188a261a3d..48a90e52812 100644 --- a/curriculum/challenges/korean/blocks/workshop-wildlife-tracker/6999b0d79ea938edcb032237.md +++ b/curriculum/challenges/korean/blocks/workshop-wildlife-tracker/6999b0d79ea938edcb032237.md @@ -45,8 +45,11 @@ assert.isFunction(getProperty); `getProperty` 함수는 두 개의 매개변수 `animal`과 `propertyName`를 가져야 합니다. ```js -const regex = __helpers.functionRegex('getProperty', ['animal', 'propertyName']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { getProperty } = explorer.allFunctions; +assert.equal(getProperty?.parameters.length, 2); +assert.equal(getProperty?.parameters[0].toString(), 'animal'); +assert.equal(getProperty?.parameters[1].toString(), 'propertyName'); ``` `getProperty`은 대괄호 표기법을 사용해 속성에 접근해야 합니다. diff --git a/curriculum/challenges/korean/blocks/workshop-wildlife-tracker/699a00de9f564bb0effaa14d.md b/curriculum/challenges/korean/blocks/workshop-wildlife-tracker/699a00de9f564bb0effaa14d.md index 740e870f751..f71997efca1 100644 --- a/curriculum/challenges/korean/blocks/workshop-wildlife-tracker/699a00de9f564bb0effaa14d.md +++ b/curriculum/challenges/korean/blocks/workshop-wildlife-tracker/699a00de9f564bb0effaa14d.md @@ -44,8 +44,10 @@ assert.isFunction(getAge); `getAge` 함수는 `animal`이라는 단일 매개변수를 가져야 합니다. ```js -const regex = __helpers.functionRegex('getAge', ['animal']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { getAge } = explorer.allFunctions; +assert.equal(getAge?.parameters.length, 1); +assert.equal(getAge?.parameters[0].toString(), 'animal'); ``` `getAge`는 점 표기법을 사용해 `age` 속성에 접근해야 합니다. diff --git a/curriculum/challenges/portuguese/blocks/back-end-development-and-apis-projects/bd7158d8c443edefaeb5bd0f.md b/curriculum/challenges/portuguese/blocks/back-end-development-and-apis-projects/bd7158d8c443edefaeb5bd0f.md index 25352bf22ae..9314b90aca3 100644 --- a/curriculum/challenges/portuguese/blocks/back-end-development-and-apis-projects/bd7158d8c443edefaeb5bd0f.md +++ b/curriculum/challenges/portuguese/blocks/back-end-development-and-apis-projects/bd7158d8c443edefaeb5bd0f.md @@ -50,15 +50,18 @@ O campo entrada do arquivo de formulário tem o atributo `name` definido como `u Ao enviar um arquivo, você recebe `name` (nome), `type` (tipo) e `size` (tamanho, em bytes) do arquivo dentro da resposta em JSON. ```js - const formData = new FormData(); - const fileData = await fetch( - 'https://cdn.freecodecamp.org/weather-icons/01d.png' - ); - const file = await fileData.blob(); - formData.append('upfile', file, 'icon'); + const boundary = 'fccBoundary1234567890'; + const head = + `--${boundary}\r\n` + + 'Content-Disposition: form-data; name="upfile"; filename="icon"\r\n' + + 'Content-Type: image/png\r\n\r\n'; + const body = new Blob([head, new Uint8Array(70), `\r\n--${boundary}--\r\n`]); const data = await fetch(code + '/api/fileanalyse', { method: 'POST', - body: formData + headers: { + 'Content-Type': `multipart/form-data; boundary=${boundary}` + }, + body }); const parsed = await data.json(); assert.property(parsed, 'size'); diff --git a/curriculum/challenges/portuguese/blocks/daily-coding-challenges-javascript/6a26df3e2988bcdded204895.md b/curriculum/challenges/portuguese/blocks/daily-coding-challenges-javascript/6a26df3e2988bcdded204895.md index 9bab006165e..6bb7aa4e1c2 100644 --- a/curriculum/challenges/portuguese/blocks/daily-coding-challenges-javascript/6a26df3e2988bcdded204895.md +++ b/curriculum/challenges/portuguese/blocks/daily-coding-challenges-javascript/6a26df3e2988bcdded204895.md @@ -25,10 +25,10 @@ assert.equal(calculateHandicap([72, 72, 72], [72, 72, 72]), 0); assert.equal(calculateHandicap([80, 76, 78, 78], [72, 72, 72, 72]), 6); ``` -`calculateHandicap([42, 45, 46, 44], [36, 36, 36, 36])` deve retornar `8.3`. +`calculateHandicap([42, 45, 46, 45], [36, 36, 36, 36])` deve retornar `8.5`. ```js -assert.equal(calculateHandicap([42, 45, 46, 44], [36, 36, 36, 36]), 8.3); +assert.equal(calculateHandicap([42, 45, 46, 45], [36, 36, 36, 36]), 8.5); ``` `calculateHandicap([85, 80, 76, 79, 82], [72, 72, 72, 71, 71])` deve retornar `8.8`. diff --git a/curriculum/challenges/portuguese/blocks/daily-coding-challenges-python/6a26df3e2988bcdded204895.md b/curriculum/challenges/portuguese/blocks/daily-coding-challenges-python/6a26df3e2988bcdded204895.md index 374ea308834..fef55694ae4 100644 --- a/curriculum/challenges/portuguese/blocks/daily-coding-challenges-python/6a26df3e2988bcdded204895.md +++ b/curriculum/challenges/portuguese/blocks/daily-coding-challenges-python/6a26df3e2988bcdded204895.md @@ -31,12 +31,12 @@ TestCase().assertEqual(calculate_handicap([80, 76, 78, 78], [72, 72, 72, 72]), 6 }}) ``` -`calculate_handicap([42, 45, 46, 44], [36, 36, 36, 36])` deve retornar `8.3`. +`calculate_handicap([42, 45, 46, 45], [36, 36, 36, 36])` deve retornar `8.5`. ```js ({test: () => { runPython(` from unittest import TestCase -TestCase().assertEqual(calculate_handicap([42, 45, 46, 44], [36, 36, 36, 36]), 8.3)`) +TestCase().assertEqual(calculate_handicap([42, 45, 46, 45], [36, 36, 36, 36]), 8.5)`) }}) ``` diff --git a/curriculum/challenges/portuguese/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb928.md b/curriculum/challenges/portuguese/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb928.md index 7767b016af9..6daa3102db4 100644 --- a/curriculum/challenges/portuguese/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb928.md +++ b/curriculum/challenges/portuguese/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb928.md @@ -8,7 +8,7 @@ dashedName: mean-variance-standard-deviation-calculator # --description-- -Você estará trabalhando neste projeto com nosso código inicial Ona. +Você estará trabalhando neste projeto com nosso código inicial. Ainda estamos desenvolvendo a parte instrucional interativa do currículo Python. Por enquanto, aqui estão alguns vídeos no canal do freeCodeCamp.org do YouTube que ensinarão tudo o que você precisa saber para completar este projeto: @@ -52,8 +52,8 @@ Por exemplo, `calculate([0,1,2,3,4,5,6,7,8])` deve retornar: ## Desenvolvimento -Escreva seu código em `mean_var_std.py`. Para o desenvolvimento, você pode usar `main.py` para testar o seu código. In -order to run your code, type `python3 main.py` into the Ona terminal and hit enter. Isso fará com que o interpretador CPython incluído execute o arquivo `main.py`. +Escreva seu código em `mean_var_std.py`. Para desenvolvimento, você pode usar `main.py` para testar seu código. +Para executar seu código, digite `python3 main.py` no terminal e pressione enter. Isso fará o interpretador CPython incluído executar o arquivo `main.py`. ## Testes diff --git a/curriculum/challenges/portuguese/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb929.md b/curriculum/challenges/portuguese/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb929.md index e27863a6ee5..d3caff341df 100644 --- a/curriculum/challenges/portuguese/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb929.md +++ b/curriculum/challenges/portuguese/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb929.md @@ -8,7 +8,7 @@ dashedName: demographic-data-analyzer # --description-- -Você estará trabalhando neste projeto com nosso código inicial Ona. +Você estará trabalhando neste projeto com nosso código inicial. Ainda estamos desenvolvendo a parte instrucional interativa do currículo Python. Por enquanto, aqui estão alguns vídeos no canal do freeCodeCamp.org do YouTube que ensinarão tudo o que você precisa saber para completar este projeto: diff --git a/curriculum/challenges/portuguese/blocks/data-analysis-with-python-projects/5e46f7f8ac417301a38fb92a.md b/curriculum/challenges/portuguese/blocks/data-analysis-with-python-projects/5e46f7f8ac417301a38fb92a.md index cc63b5460f0..6bc05f850f0 100644 --- a/curriculum/challenges/portuguese/blocks/data-analysis-with-python-projects/5e46f7f8ac417301a38fb92a.md +++ b/curriculum/challenges/portuguese/blocks/data-analysis-with-python-projects/5e46f7f8ac417301a38fb92a.md @@ -8,7 +8,7 @@ dashedName: medical-data-visualizer # --description-- -Você estará trabalhando neste projeto com nosso código inicial Ona. +Você estará trabalhando neste projeto com nosso código inicial. Ainda estamos desenvolvendo a parte instrucional interativa do currículo Python. Por enquanto, aqui estão alguns vídeos no canal do freeCodeCamp.org do YouTube que ensinarão tudo o que você precisa saber para completar este projeto: @@ -26,20 +26,20 @@ As linhas do dataset representam os pacientes e as colunas representam informaç Nome do arquivo: medical_examination.csv -| Feature | Variable Type | Variable | Value Type | -|:-------:|:------------:|:-------------:|:----------:| -| Age | Objective Feature | `age` | int (days) | -| Height | Objective Feature | `height` | int (cm) | -| Weight | Objective Feature | `weight` | float (kg) | -| Gender | Objective Feature | `gender` | categorical code | -| Systolic blood pressure | Examination Feature | `ap_hi` | int | -| Diastolic blood pressure | Examination Feature | `ap_lo` | int | -| Cholesterol | Examination Feature | `cholesterol` | 1: normal, 2: above normal, 3: well above normal | -| Glucose | Examination Feature | `gluc` | 1: normal, 2: above normal, 3: well above normal | -| Smoking | Subjective Feature | `smoke` | binary | -| Alcohol intake | Subjective Feature | `alco` | binary | -| Physical activity | Subjective Feature | `active` | binary | -| Presence or absence of cardiovascular disease | Target Variable | `cardio` | binary | +| Recurso | Tipo de variável | Variável | Tipo de valor | +|:-------:|:----------------:|:-------------:|:-------------:| +| Idade | Recurso objetivo | `age` | int (dias) | +| Altura | Recurso objetivo | `height` | int (cm) | +| Peso | Recurso objetivo | `weight` | float (kg) | +| Gênero | Recurso objetivo | `gender` | código categórico | +| Pressão arterial sistólica | Recurso de exame | `ap_hi` | int | +| Pressão arterial diastólica | Recurso de exame | `ap_lo` | int | +| Colesterol | Recurso de exame | `cholesterol` | 1: normal, 2: acima do normal, 3: muito acima do normal | +| Glicose | Recurso de exame | `gluc` | 1: normal, 2: acima do normal, 3: muito acima do normal | +| Fumar | Recurso subjetivo | `smoke` | binário | +| Consumo de álcool | Recurso subjetivo | `alco` | binário | +| Atividade física | Recurso subjetivo | `active` | binário | +| Presença ou ausência de doença cardiovascular | Variável alvo | `cardio` | binário | ## Instruções diff --git a/curriculum/challenges/portuguese/blocks/data-analysis-with-python-projects/5e46f802ac417301a38fb92b.md b/curriculum/challenges/portuguese/blocks/data-analysis-with-python-projects/5e46f802ac417301a38fb92b.md index ecf731fefc6..d3c945a6af2 100644 --- a/curriculum/challenges/portuguese/blocks/data-analysis-with-python-projects/5e46f802ac417301a38fb92b.md +++ b/curriculum/challenges/portuguese/blocks/data-analysis-with-python-projects/5e46f802ac417301a38fb92b.md @@ -8,7 +8,7 @@ dashedName: page-view-time-series-visualizer # --description-- -Você estará trabalhando neste projeto com nosso código inicial Ona. +Você estará trabalhando neste projeto com nosso código inicial. Ainda estamos desenvolvendo a parte instrucional interativa do currículo Python. Por enquanto, aqui estão alguns vídeos no canal do freeCodeCamp.org do YouTube que ensinarão tudo o que você precisa saber para completar este projeto: diff --git a/curriculum/challenges/portuguese/blocks/data-analysis-with-python-projects/5e4f5c4b570f7e3a4949899f.md b/curriculum/challenges/portuguese/blocks/data-analysis-with-python-projects/5e4f5c4b570f7e3a4949899f.md index 7582c5c9c64..eaa38316a6d 100644 --- a/curriculum/challenges/portuguese/blocks/data-analysis-with-python-projects/5e4f5c4b570f7e3a4949899f.md +++ b/curriculum/challenges/portuguese/blocks/data-analysis-with-python-projects/5e4f5c4b570f7e3a4949899f.md @@ -8,7 +8,7 @@ dashedName: sea-level-predictor # --description-- -Você estará trabalhando neste projeto com nosso código inicial Ona. +Você estará trabalhando neste projeto com nosso código inicial. Ainda estamos desenvolvendo a parte instrucional interativa do currículo Python. Por enquanto, aqui estão alguns vídeos no canal do freeCodeCamp.org do YouTube que ensinarão tudo o que você precisa saber para completar este projeto: diff --git a/curriculum/challenges/portuguese/blocks/information-security-projects/5e46f979ac417301a38fb932.md b/curriculum/challenges/portuguese/blocks/information-security-projects/5e46f979ac417301a38fb932.md index e23cad3c592..34058260d08 100644 --- a/curriculum/challenges/portuguese/blocks/information-security-projects/5e46f979ac417301a38fb932.md +++ b/curriculum/challenges/portuguese/blocks/information-security-projects/5e46f979ac417301a38fb932.md @@ -9,7 +9,7 @@ dashedName: port-scanner # --description-- -Você estará trabalhando neste projeto com nosso código inicial Ona. +Você vai trabalhar neste projeto com nosso código inicial. Ainda estamos desenvolvendo a parte instrucional interativa do currículo Python. Por enquanto, aqui estão alguns vídeos no canal do freeCodeCamp.org do YouTube que ensinarão tudo o que você precisa saber para completar este projeto: diff --git a/curriculum/challenges/portuguese/blocks/information-security-projects/5e46f983ac417301a38fb933.md b/curriculum/challenges/portuguese/blocks/information-security-projects/5e46f983ac417301a38fb933.md index 07a3c25a295..194517104c9 100644 --- a/curriculum/challenges/portuguese/blocks/information-security-projects/5e46f983ac417301a38fb933.md +++ b/curriculum/challenges/portuguese/blocks/information-security-projects/5e46f983ac417301a38fb933.md @@ -9,7 +9,7 @@ dashedName: sha-1-password-cracker # --description-- -Você estará trabalhando neste projeto com nosso código inicial Ona. +Você vai trabalhar neste projeto com nosso código inicial. Ainda estamos desenvolvendo a parte instrucional interativa do currículo Python. Por enquanto, aqui estão alguns vídeos no canal do freeCodeCamp.org do YouTube que ensinarão tudo o que você precisa saber para completar este projeto: diff --git a/curriculum/challenges/portuguese/blocks/lab-availability-table/66b36358ed4f261d64840c24.md b/curriculum/challenges/portuguese/blocks/lab-availability-table/66b36358ed4f261d64840c24.md index 6ec98a78ceb..735d0277d8e 100644 --- a/curriculum/challenges/portuguese/blocks/lab-availability-table/66b36358ed4f261d64840c24.md +++ b/curriculum/challenges/portuguese/blocks/lab-availability-table/66b36358ed4f261d64840c24.md @@ -13,16 +13,16 @@ demoType: onClick **Histórias de Usuário:** 1. Você deve ter uma tabela com pelo menos três colunas e cinco linhas, incluindo os cabeçalhos. -1. As células na primeira linha devem ser cabeçalhos da tabela contendo os dias da semana. -1. As células na primeira coluna devem ser cabeçalhos da tabela com uma `class` de `time` e devem conter valores de horário como texto. -1. Todas as células de dados devem ter a `class` de `available-#`, onde `#` é um número de `0` a `5` que especifica o número de pessoas disponíveis naquele horário. +1. A primeira linha deve conter células de cabeçalho da tabela com os dias da semana. +1. A primeira coluna deve conter células de cabeçalho da tabela com a `class` `time` contendo valores de horário como texto. +1. Todas as células de dados devem ter a `class` `available-#`, onde `#` é um número de `0` a `5` que especifica o número de pessoas disponíveis naquele horário. 1. Sua tabela deve ter um elemento `caption` com o texto `Weekly Meeting Availability Schedule`. -1. Todas as células de cabeçalho da tabela na primeira linha (os dias da semana) devem ter um atributo `scope` com o valor `col`. -1. Todas as células de cabeçalho da tabela na primeira coluna (as células de horário) devem ter um atributo `scope` com o valor `row`. -1. Todas as células de dados com uma classe de disponibilidade devem ter um atributo `aria-label` que descreva o nível de disponibilidade (por exemplo, `0 available` para as células `available-0`, `1 available` para as células `available-1`, etc., e `5+ available` para as células `available-5`). +1. Todas as células de cabeçalho da primeira linha (os dias da semana) devem ter um atributo `scope` com o valor `col`. +1. Todas as células de cabeçalho da primeira coluna (as células de horário) devem ter um atributo `scope` com o valor `row`. +1. Todas as células de dados com uma classe de disponibilidade devem ter um atributo `aria-label` que descreva o nível de disponibilidade (por exemplo, `0 available` para as células `available-0`, `1 available` para as `available-1`, etc., e `5+ available` para as `available-5`). 1. No seu seletor `:root`, você deve definir seis variáveis CSS chamadas `--color#`, onde `#` é um número de `0` a `5`, e atribuir a cada uma um valor de cor. Use essas variáveis para definir a cor de fundo dos elementos `.available-#` correspondentes. 1. No seu seletor `:root`, você deve definir variáveis CSS chamadas `--solid-border` e `--dashed-border`. Use essas variáveis para estilizar as bordas inferiores das suas células de dados, alternando entre bordas sólidas e tracejadas dependendo da linha. Dê às linhas a classe `sharp` ou `half` para estilização. -1. Você deve ter um elemento `div` com o `id` de `legend`. Ele deve conter um elemento `span` com o texto `Availability` e um elemento `div` com o `id` de `legend-gradient`. +1. Você deve ter um elemento `div` com o `id` `legend`. Ele deve conter um elemento `span` com o texto `Availability` e um elemento `div` com o `id` `legend-gradient`. 1. Você deve aplicar ao elemento `#legend-gradient` um gradiente linear que transite entre todas as cores de `--color0` a `--color5` com linhas definidas. **Nota:** Certifique-se de vincular sua folha de estilos no seu HTML para aplicar seu CSS. @@ -389,7 +389,7 @@ headers.forEach(header => { Todas as células de cabeçalho da tabela na primeira coluna devem ter um atributo `scope` com o valor `row`. ```js -const timeHeaders = [...document.querySelectorAll('tr > th:first-child')]; +const timeHeaders = [...document.querySelectorAll('th.time')]; assert.isNotEmpty(timeHeaders); timeHeaders.forEach(header => { assert.equal(header.getAttribute('scope'), 'row'); diff --git a/curriculum/challenges/portuguese/blocks/lab-cargo-manifest-validator/69a56b5069ca99f7317e6e19.md b/curriculum/challenges/portuguese/blocks/lab-cargo-manifest-validator/69a56b5069ca99f7317e6e19.md index 12658fd4315..eba74b44fed 100644 --- a/curriculum/challenges/portuguese/blocks/lab-cargo-manifest-validator/69a56b5069ca99f7317e6e19.md +++ b/curriculum/challenges/portuguese/blocks/lab-cargo-manifest-validator/69a56b5069ca99f7317e6e19.md @@ -14,7 +14,7 @@ Cada manifesto de carga será representado como um objeto com as seguintes propr - `containerId`: um inteiro positivo que identifica o container de carga associado. - `destination`: uma string não vazia (após remover espaços em branco) que indica o destino alvo da carga. - `weight`: um número positivo que representa o peso da carga. -- `unit`: uma string que descreve as unidades para a propriedade de peso da carga (ou `"kg"` para quilogramas ou `"lb"` para libras). +- `unit`: uma string que descreve a unidade da propriedade `weight` da carga (ou `"kg"` para quilogramas ou `"lb"` para libras). - `hazmat`: um valor booleano que indica se é necessário manuseio de material perigoso. Exemplo de objeto manifesto de carga: @@ -34,13 +34,13 @@ Exemplo de objeto manifesto de carga: **Histórias de Usuário:** 1. Você deve implementar uma função chamada `normalizeUnits` com um parâmetro `manifest`. - - A função não deve modificar o objeto manifesto original e deve sempre retornar um novo objeto onde `weight` está normalizado para quilogramas e `unit` está definido como `"kg"`. - - Se o peso do objeto manifesto estiver expresso em libras (`unit: "lb"`), a função deve converter o `weight` para quilogramas usando a conversão aproximada, 1 lb = 0,45 kg, e atualizar o `unit` de acordo. - - Se o peso já estiver expresso em quilogramas (`unit: "kg"`), o `weight` e o `unit` devem permanecer inalterados. + - A função não deve modificar o objeto manifest original e deve sempre retornar um novo objeto onde o `weight` está normalizado para quilogramas e o `unit` está definido como `"kg"`. + - Se o `weight` do objeto manifest estiver expresso em libras (`unit: "lb"`), a função deve converter o `weight` para quilogramas usando a conversão aproximada `1 lb = 0.45 kg` e atualizar o `unit` de acordo. + - Se o `weight` já estiver expresso em quilogramas (`unit: "kg"`), o `weight` e o `unit` devem permanecer inalterados. 2. Você deve implementar uma função chamada `validateManifest` com um parâmetro `manifest`. - - A função não deve modificar o objeto manifesto original e deve sempre retornar um novo objeto. - - Se o manifesto de entrada for válido (sem propriedades faltando ou inválidas), a função deve retornar um objeto vazio. - - Se o manifesto de entrada não for válido, a função deve retornar um objeto contendo entradas para cada propriedade faltando ou inválida. Propriedades faltando devem ter o valor `"Missing"` e propriedades inválidas devem ter o valor `"Invalid"`. + - A função não deve modificar o objeto manifest original e deve sempre retornar um novo objeto. + - Se o manifest de entrada for válido (sem propriedades faltando ou inválidas), a função deve retornar um objeto vazio. + - Se o manifest de entrada não for válido, a função deve retornar um objeto contendo entradas para cada propriedade faltando ou inválida. Propriedades faltando devem ter o valor `"Missing"` e propriedades inválidas devem ter o valor `"Invalid"`. Exemplo de valor de retorno onde o objeto de entrada está faltando a propriedade `destination` e tem uma propriedade `weight` inválida: @@ -52,11 +52,12 @@ Exemplo de valor de retorno onde o objeto de entrada está faltando a propriedad ``` 3. Você deve implementar uma função chamada `processManifest` com um parâmetro `manifest`. A função deve registrar: - - Se o objeto manifesto for válido, `Validation success: ${containerId}` e então o peso do manifesto em quilogramas assim, `Total weight: ${weight} kg`. Use `normalizeUnits()` para essa conversão. - - Se o objeto manifesto não for válido, `Validation error: ${containerId}` e então o objeto retornado pela chamada de `validateManifest()` com o objeto manifesto. - **Nota:** cada um desses dois casos deve ter duas chamadas `console.log()`. + - Se o objeto manifest for válido, `Validation success: ${containerId}` e depois o `weight` do manifest em quilogramas, na forma `Total weight: ${weight} kg`. Use `normalizeUnits()` para essa conversão. + - Se o objeto manifest não for válido, `Validation error: ${containerId}` e depois o objeto retornado pela chamada de `validateManifest()` com o objeto manifest. -**Nota:** Nem `normalizeUnits`, nem `validateManifest`, nem `processManifest` devem ser declarados usando `const`, pois os testes precisam reatribuí-los. +**Nota:** Cada um desses dois casos deve ter duas chamadas `console.log()`. + +**Nota:** Não declare `normalizeUnits`, `validateManifest` ou `processManifest` usando `const`, pois os testes precisam reatribuí-las. # --before-each-- @@ -120,7 +121,7 @@ console.log = () => {}; # --hints-- -Nem `normalizeUnits`, nem `validateManifest`, nem `processManifest` devem ser declarados usando `const`, pois os testes precisam reatribuí-los. +Você não deve declarar `normalizeUnits`, `validateManifest` ou `processManifest` usando `const`, pois os testes precisam reatribuí-las. ```js assert.doesNotThrow(() => { @@ -140,12 +141,12 @@ assert.equal(params.length, 1); assert.equal(params[0].toString(), 'manifest'); ``` -Chamar `normalizeUnits()` com `{ containerId: 68, destination: "Salinas", weight: 101, unit: "lb", hazmat: true }` deve retornar o novo objeto `{ containerId: 68, destination: "Salinas", weight: 45.45, unit: "kg", hazmat: true }` sem modificar a entrada original. +Sua função `normalizeUnits` deve retornar o novo objeto `{ containerId: 68, destination: "Salinas", weight: 45.45, unit: "kg", hazmat: true }` quando chamada com `{ containerId: 68, destination: "Salinas", weight: 101, unit: "lb", hazmat: true }`, sem modificar o original. ```js const testObj = { containerId: 68, - destination: "Salinas", + destination: "Salinas", weight: 101, unit: "lb", hazmat: true @@ -161,7 +162,7 @@ const expected = { const copy = normalizeUnits(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "normalizeUnits() did not return the expected normalized object"); +assert.deepEqual(copy, expected, "normalizeUnits() did not return the expected normalized object."); assert.notStrictEqual(copy, testObj, "normalizeUnits() should return a new object."); assert.strictEqual(testObj.containerId, 68, "Original object should not be mutated."); assert.strictEqual(testObj.destination, "Salinas", "Original object should not be mutated."); @@ -171,13 +172,13 @@ assert.strictEqual(testObj.hazmat, true, "Original object should not be mutated. assert.equal(Object.keys(testObj).length, 5, "Original object should not be mutated."); ``` -Sua função `normalizeUnits` deve retornar uma cópia do objeto manifesto de entrada com seu `weight` normalizado para quilogramas e seu `unit` definido como `"kg"`. Use a conversão aproximada `1 lb = 0.45 kg` para a conversão do peso. +Sua função `normalizeUnits` deve retornar uma cópia do objeto manifest de entrada com seu `weight` normalizado para quilogramas e seu `unit` definido como `"kg"`. Use a conversão aproximada `1 lb = 0.45 kg` para a conversão do `weight`. ```js _validManifests.forEach((obj, i) => { const result = normalizeUnits(obj); - assert.isObject(result, "normalizeUnits should return an object"); - assert.notStrictEqual(result, obj, "normalizeUnits must return a new object, not modify the original"); + assert.isObject(result, "normalizeUnits() should return an object."); + assert.notStrictEqual(result, obj, "normalizeUnits() should return a new object, not mutate the original."); const expectedWeight = obj.unit === "lb" ? obj.weight * 0.45 : obj.weight; const expected = { ...obj, @@ -188,12 +189,12 @@ _validManifests.forEach((obj, i) => { assert.deepEqual( result, expected, - `normalizeUnits did not return the expected normalized object for manifest at index ${i}` + `normalizeUnits() did not return the expected normalized object for manifest at index ${i}.` ); }); ``` -Sua função `normalizeUnits` deve retornar uma nova cópia do objeto `manifest` de entrada sem modificar o original. +Sua função `normalizeUnits` deve retornar uma nova cópia do objeto manifest de entrada sem modificar o original. ```js const original = { @@ -231,12 +232,12 @@ assert.equal(params.length, 1); assert.equal(params[0].toString(), 'manifest'); ``` -Chamar `validateManifest()` com `{ containerId: 1, destination: "Santa Cruz", weight: 304, unit: "kg", hazmat: false }` deve retornar o novo objeto `{}`. +Sua função `validateManifest` deve retornar um novo objeto vazio `{}` quando chamada com `{ containerId: 1, destination: "Santa Cruz", weight: 304, unit: "kg", hazmat: false }`. ```js const testObj = { containerId: 1, - destination: "Santa Cruz", + destination: "Santa Cruz", weight: 304, unit: "kg", hazmat: false @@ -246,16 +247,16 @@ const expected = {}; const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for a valid manifest"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.strictEqual(testObj.containerId, 1, "Original object should not be mutated"); -assert.strictEqual(testObj.destination, "Santa Cruz", "Original object should not be mutated"); -assert.strictEqual(testObj.weight, 304, "Original object should not be mutated"); -assert.strictEqual(testObj.unit, "kg", "Original object should not be mutated"); -assert.strictEqual(testObj.hazmat, false, "Original object should not be mutated"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for a valid manifest."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.strictEqual(testObj.containerId, 1, "Original object should not be mutated."); +assert.strictEqual(testObj.destination, "Santa Cruz", "Original object should not be mutated."); +assert.strictEqual(testObj.weight, 304, "Original object should not be mutated."); +assert.strictEqual(testObj.unit, "kg", "Original object should not be mutated."); +assert.strictEqual(testObj.hazmat, false, "Original object should not be mutated."); ``` -Se o objeto manifesto de entrada for válido, sua função `validateManifest` deve retornar um objeto vazio `{}`. +Sua função `validateManifest` deve retornar um objeto vazio `{}` se o objeto manifest de entrada for válido. ```js const solution = {}; @@ -268,7 +269,7 @@ for (const obj of _validManifests) { } ``` -Chamar `validateManifest()` com `{}` deve retornar o novo objeto `{ containerId: "Missing", destination: "Missing", weight: "Missing", unit: "Missing", hazmat: "Missing" }` sem modificar a entrada original. +Sua função `validateManifest` deve retornar o novo objeto `{ containerId: "Missing", destination: "Missing", weight: "Missing", unit: "Missing", hazmat: "Missing" }` quando chamada com `{}`, sem modificar o original. ```js const testObj = {}; @@ -283,12 +284,12 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for missing properties"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.equal(Object.keys(testObj).length, 0, "validateManifest() should return a new object, not mutate the original"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for missing properties."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.equal(Object.keys(testObj).length, 0, "validateManifest() should return a new object, not mutate the original."); ``` -Chamar `validateManifest()` com `{ containerId: null, destination: "Santa Cruz", weight: 304, unit: "kg", hazmat: false }` deve retornar o novo objeto `{ containerId: "Invalid" }` sem modificar a entrada original. +Sua função `validateManifest` deve retornar o novo objeto `{ containerId: "Invalid" }` quando chamada com `{ containerId: null, destination: "Santa Cruz", weight: 304, unit: "kg", hazmat: false }`, sem modificar o original. ```js const testObj = { @@ -305,11 +306,11 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for null containerId"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for null containerId."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); ``` -Chamar `validateManifest()` com `{ containerId: 0, destination: 405, weight: -84, unit: "pounds", hazmat: "no" }` deve retornar o novo objeto `{ containerId: "Invalid", destination: "Invalid", weight: "Invalid", unit: "Invalid", hazmat: "Invalid" }` sem modificar a entrada original. +Sua função `validateManifest` deve retornar o novo objeto `{ containerId: "Invalid", destination: "Invalid", weight: "Invalid", unit: "Invalid", hazmat: "Invalid" }` quando chamada com `{ containerId: 0, destination: 405, weight: -84, unit: "pounds", hazmat: "no" }`, sem modificar o original. ```js const testObj = { @@ -330,16 +331,16 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid properties"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.strictEqual(testObj.containerId, 0, "Original object should not be mutated"); -assert.strictEqual(testObj.destination, 405, "Original object should not be mutated"); -assert.strictEqual(testObj.weight, -84, "Original object should not be mutated"); -assert.strictEqual(testObj.unit, "pounds", "Original object should not be mutated"); -assert.strictEqual(testObj.hazmat, "no", "Original object should not be mutated"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid properties."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.strictEqual(testObj.containerId, 0, "Original object should not be mutated."); +assert.strictEqual(testObj.destination, 405, "Original object should not be mutated."); +assert.strictEqual(testObj.weight, -84, "Original object should not be mutated."); +assert.strictEqual(testObj.unit, "pounds", "Original object should not be mutated."); +assert.strictEqual(testObj.hazmat, "no", "Original object should not be mutated."); ``` -Chamar `validateManifest()` com `{ containerId: -2 }` deve retornar o novo objeto `{ containerId: "Invalid", destination: "Missing", weight: "Missing", unit: "Missing", hazmat: "Missing" }` sem modificar a entrada original. +Sua função `validateManifest` deve retornar o novo objeto `{ containerId: "Invalid", destination: "Missing", weight: "Missing", unit: "Missing", hazmat: "Missing" }` quando chamada com `{ containerId: -2 }`, sem modificar o original. ```js const testObj = { @@ -356,13 +357,13 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.strictEqual(testObj.containerId, -2, "Original object should not be mutated"); -assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.strictEqual(testObj.containerId, -2, "Original object should not be mutated."); +assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated."); ``` -Chamar `validateManifest()` com `{ containerId: 3.50 }` deve retornar o novo objeto `{ containerId: "Invalid", destination: "Missing", weight: "Missing", unit: "Missing", hazmat: "Missing" }` sem modificar a entrada original. Você pode usar `Number.isInteger()` para validar valores inteiros. +Sua função `validateManifest` deve retornar o novo objeto `{ containerId: "Invalid", destination: "Missing", weight: "Missing", unit: "Missing", hazmat: "Missing" }` quando chamada com `{ containerId: 3.50 }`, sem modificar o original. Você pode usar `Number.isInteger()` para validar valores inteiros. ```js const testObj = { @@ -379,13 +380,13 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.strictEqual(testObj.containerId, 3.50, "Original object should not be mutated"); -assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.strictEqual(testObj.containerId, 3.50, "Original object should not be mutated."); +assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated."); ``` -Chamar `validateManifest()` com `{ destination: " " }` deve retornar o novo objeto `{ containerId: "Missing", destination: "Invalid", weight: "Missing", unit: "Missing", hazmat: "Missing" }` sem modificar a entrada original. Você pode usar `String.trim()` para remover espaços em branco de uma string. +Sua função `validateManifest` deve retornar o novo objeto `{ containerId: "Missing", destination: "Invalid", weight: "Missing", unit: "Missing", hazmat: "Missing" }` quando chamada com `{ destination: " " }`, sem modificar o original. Você pode usar `.trim()` para remover espaços em branco de uma string. ```js const testObj = { @@ -402,13 +403,13 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.strictEqual(testObj.destination, " ", "Original object should not be mutated"); -assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.strictEqual(testObj.destination, " ", "Original object should not be mutated."); +assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated."); ``` -Chamar `validateManifest()` com `{ weight: NaN }` deve retornar o novo objeto `{ containerId: "Missing", destination: "Missing", weight: "Invalid", unit: "Missing", hazmat: "Missing" }` sem modificar a entrada original. Você pode usar `Number.isNaN()` para validar valores NaN. +Sua função `validateManifest` deve retornar o novo objeto `{ containerId: "Missing", destination: "Missing", weight: "Invalid", unit: "Missing", hazmat: "Missing" }` quando chamada com `{ weight: NaN }`, sem modificar o original. Você pode usar `Number.isNaN()` para validar valores `NaN`. ```js const testObj = { @@ -425,13 +426,13 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.ok(Number.isNaN(testObj.weight), "Original object should not be mutated"); -assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.ok(Number.isNaN(testObj.weight), "Original object should not be mutated."); +assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated."); ``` -Se o objeto manifesto de entrada não for válido, sua função `validateManifest` deve retornar um objeto descrevendo propriedades faltando e/ou inválidas. +Sua função `validateManifest` deve retornar um objeto descrevendo propriedades faltando e/ou inválidas se o objeto manifest de entrada não for válido. ```js const solutions = [ @@ -504,7 +505,7 @@ assert.equal(params.length, 1); assert.equal(params[0].toString(), 'manifest'); ``` -Chamar `processManifest()` com `{ containerId: 55, destination: "Carmel", weight: 400, unit: "lb", hazmat: false }` deve primeiro registrar `"Validation success: 55"` e depois registrar `"Total weight: 180 kg"`. +Sua função `processManifest` deve primeiro registrar `Validation success: 55` e depois registrar `Total weight: 180 kg` quando chamada com `{ containerId: 55, destination: "Carmel", weight: 400, unit: "lb", hazmat: false }`. ```js const testObj = { @@ -524,8 +525,8 @@ try { ["Validation success: 55"], ["Total weight: 180 kg"] ]; - assert.deepEqual(spy.calls[0], expectedCalls[0], "First log should be the validation success message"); - assert.deepEqual(spy.calls[1], expectedCalls[1], "Second log should be the normalized weight in kg"); + assert.deepEqual(spy.calls[0], expectedCalls[0], "First log should be the validation success message."); + assert.deepEqual(spy.calls[1], expectedCalls[1], "Second log should be the normalized weight in kg."); } catch (err) { assert.fail(err); @@ -534,7 +535,7 @@ try { } ``` -Se o objeto manifesto de entrada for válido, sua função `processManifest` deve primeiro registrar a mensagem de sucesso, `Validation success: ${containerId}`. +Sua função `processManifest` deve primeiro registrar a mensagem de sucesso, `Validation success: ${containerId}`, se o objeto manifest de entrada for válido. ```js const testObj = { @@ -562,7 +563,7 @@ try { } ``` -Se o objeto manifesto de entrada for válido, sua função `processManifest` deve normalizá-lo para quilogramas usando `normalizeUnits()` e depois registrar: `Total weight: ${weight} kg`. +Sua função `processManifest` deve normalizar um objeto manifest de entrada válido para quilogramas usando `normalizeUnits()` e depois registrar `Total weight: ${weight} kg`. ```js const testObj = { @@ -590,7 +591,7 @@ try { } ``` -Se o objeto manifesto de entrada for válido, sua função `processManifest` deve registrar uma mensagem de sucesso com o `containerId` do objeto, e depois registrar o `weight` do objeto em quilogramas. Você deve usar `normalizeUnits()` para a conversão e ter duas chamadas `console.log()`. +Sua função `processManifest` deve registrar uma mensagem de sucesso com o `containerId` do objeto e depois registrar o `weight` do objeto em quilogramas, se o objeto manifest de entrada for válido. Você deve usar `normalizeUnits()` para a conversão, e isso deve envolver duas chamadas `console.log()`. ```js const originalNormalize = normalizeUnits; @@ -605,7 +606,7 @@ try { assert.isTrue( called, - "processManifest should call normalizeUnits() when the manifest is valid" + "processManifest() should call normalizeUnits() when the manifest is valid." ); } catch (err) { @@ -635,7 +636,7 @@ try { } ``` -Chamar `processManifest()` com `{ containerId: -88, destination: "Soledad", weight: NaN }` deve primeiro registrar `Validation error: -88` e depois registrar o objeto `{ containerId: "Invalid", weight: "Invalid", unit: "Missing", hazmat: "Missing" }`. +Sua função `processManifest` deve primeiro registrar `Validation error: -88` e depois registrar o objeto `{ containerId: "Invalid", weight: "Invalid", unit: "Missing", hazmat: "Missing" }` quando chamada com `{ containerId: -88, destination: "Soledad", weight: NaN }`. ```js const testObj = { @@ -658,8 +659,8 @@ try { }] ]; - assert.deepEqual(spy.calls[0], expectedCalls[0], "First log should be the validation error message"); - assert.deepEqual(spy.calls[1], expectedCalls[1], "Second log should be the validation result object"); + assert.deepEqual(spy.calls[0], expectedCalls[0], "First log should be the validation error message."); + assert.deepEqual(spy.calls[1], expectedCalls[1], "Second log should be the validation result object."); } catch (err) { assert.fail(err); @@ -668,7 +669,7 @@ try { } ``` -Chamar `processManifest()` com `{ destination: "Watsonville", hazmat: true }` deve primeiro registrar `Validation error: undefined` e depois registrar o objeto `{ containerId: "Missing", weight: "Missing", unit: "Missing" }`. +Sua função `processManifest` deve primeiro registrar `Validation error: undefined` e depois registrar o objeto `{ containerId: "Missing", weight: "Missing", unit: "Missing" }` quando chamada com `{ destination: "Watsonville", hazmat: true }`. ```js const testObj = { @@ -689,8 +690,8 @@ try { }] ]; - assert.deepEqual(spy.calls[0], expectedCalls[0], "First log should be the validation error message"); - assert.deepEqual(spy.calls[1], expectedCalls[1], "Second log should be the validation result object"); + assert.deepEqual(spy.calls[0], expectedCalls[0], "First log should be the validation error message."); + assert.deepEqual(spy.calls[1], expectedCalls[1], "Second log should be the validation result object."); } catch (err) { assert.fail(err); @@ -699,7 +700,7 @@ try { } ``` -Se o objeto manifesto de entrada não for válido, sua função `processManifest` deve primeiro registrar a mensagem de erro, `Validation error: ${containerId}`. +Sua função `processManifest` deve primeiro registrar a mensagem de erro, `Validation error: ${containerId}`, se o objeto manifest de entrada não for válido. ```js const spy = __helpers.spyOn(console, "log"); @@ -718,13 +719,13 @@ try { assert.deepEqual(spy.calls[0], expectedCalls[0]); } catch (err) { - assert.fail(err); + assert.fail(err); } finally { spy.restore(); } ``` -Se o objeto manifesto de entrada não for válido, sua função `processManifest` também deve registrar o objeto retornado pela chamada de `validateManifest()` com o objeto manifesto original. Chame `console.log()` diretamente com o objeto retornado. +Sua função `processManifest` também deve registrar o objeto retornado pela chamada de `validateManifest()` com o objeto manifest original se o objeto manifest de entrada não for válido. Chame `console.log()` diretamente com o objeto retornado. ```js const originalValidate = validateManifest; @@ -740,7 +741,7 @@ try { assert.isTrue( called, - "processManifest should call validateManifest() when the manifest is invalid" + "processManifest() should call validateManifest() when the manifest is invalid." ); } catch (err) { @@ -765,13 +766,13 @@ try { assert.deepEqual(spy.calls[1], expectedCalls[1]); } catch (err) { - assert.fail(err); + assert.fail(err); } finally { spy.restore(); } ``` -Se o objeto manifesto de entrada não for válido, sua função `processManifest` deve registrar uma mensagem de erro com o `containerId` do objeto, e depois registrar o objeto retornado pela chamada de `validateManifest()` com o objeto de entrada. Isso deve envolver duas chamadas `console.log()`. +Sua função `processManifest` deve registrar uma mensagem de erro com o `containerId` do objeto e depois registrar o objeto retornado pela chamada de `validateManifest()` com o objeto de entrada, se o objeto manifest de entrada não for válido. Isso deve envolver duas chamadas `console.log()`. ```js const originalValidate = validateManifest; @@ -787,7 +788,7 @@ try { assert.isTrue( called, - "processManifest should call validateManifest() when the manifest is invalid" + "processManifest() should call validateManifest() when the manifest is invalid." ); } catch (err) { @@ -812,7 +813,7 @@ try { assert.deepEqual(spy.calls, expectedCalls); } catch (err) { - assert.fail(err); + assert.fail(err); } finally { spy.restore(); } diff --git a/curriculum/challenges/portuguese/blocks/lab-digital-pet-game/68c362b379059c388d3874f2.md b/curriculum/challenges/portuguese/blocks/lab-digital-pet-game/68c362b379059c388d3874f2.md index 64d33742054..97747650952 100644 --- a/curriculum/challenges/portuguese/blocks/lab-digital-pet-game/68c362b379059c388d3874f2.md +++ b/curriculum/challenges/portuguese/blocks/lab-digital-pet-game/68c362b379059c388d3874f2.md @@ -1,6 +1,6 @@ --- id: 68c362b379059c388d3874f2 -title: construir um jogo de pet digital +title: Construir um jogo de pet digital challengeType: 25 dashedName: lab-digital-pet-game demoType: onClick @@ -9,9 +9,9 @@ saveSubmissionToDB: true # --description-- -**Objetivo:** Atender às user stories abaixo e fazer todos os testes passarem para completar o laboratório. +**Objetivo:** Cumprir as user stories abaixo e fazer todos os testes passarem para completar o laboratório. -**User stories:** +**Histórias de Usuário:** A aplicação deve ter duas views. Os requisitos para cada view estão englobados nas demais user stories: @@ -60,6 +60,7 @@ A segunda view: ```js globalThis._PET_NAME = 'Fitzgerald'; globalThis._clock = __FakeTimers.install(); +window.fetch = () => Promise.resolve({ json: () => Promise.resolve('Cats sleep for around 13 to 16 hours a day.') }); ``` # --after-all-- diff --git a/curriculum/challenges/portuguese/blocks/lab-fcc-forum-leaderboard/673c91f0b934834bc4a3ecc2.md b/curriculum/challenges/portuguese/blocks/lab-fcc-forum-leaderboard/673c91f0b934834bc4a3ecc2.md index da945f759da..83d65c11c9d 100644 --- a/curriculum/challenges/portuguese/blocks/lab-fcc-forum-leaderboard/673c91f0b934834bc4a3ecc2.md +++ b/curriculum/challenges/portuguese/blocks/lab-fcc-forum-leaderboard/673c91f0b934834bc4a3ecc2.md @@ -1,6 +1,6 @@ --- id: 673c91f0b934834bc4a3ecc2 -title: construir um ranking do fórum do fCC +title: Construir um ranking do fórum do fCC challengeType: 25 dashedName: build-an-fcc-forum-leaderboard demoType: onClick @@ -50,9 +50,9 @@ O endpoint da API retorna JSON na seguinte forma: Note que os valores `avatar_template` são caminhos relativos: eles começam com `/` e contêm um marcador de posição `{size}` que deve ser substituído por um tamanho em pixels. A constante `avatarUrl` contém a URL base para ser adicionada quando o caminho for relativo. -**Objetivo:** Atenda às user stories abaixo e faça todos os testes passarem para completar o laboratório. +**Objetivo:** Cumprir as user stories abaixo e fazer todos os testes passarem para completar o laboratório. -**User stories:** +**Histórias de Usuário:** 1. Você deve ter uma função chamada `timeAgo` que recebe um timestamp no formato ISO 8601 como argumento. 1. A função `timeAgo` deve calcular a diferença de tempo entre o horário passado como argumento e o horário atual e retornar: @@ -93,6 +93,68 @@ Note que os valores `avatar_template` são caminhos relativos: eles começam com 1. A função `fetchData` deve solicitar dados de `forumLatest` e chamar `showLatestPosts` passando a resposta analisada como JSON. 1. Se houver um erro ao buscar os dados, a função `fetchData` deve registrar o erro no console. Você deve usar especificamente `console.log` para isso. +# --before-all-- + +```js +const _testUsers = [ + { + avatar_template: '/user_avatar/QuincyLarson_{size}.png', + id: 6, + name: 'Quincy Larson', + username: 'QuincyLarson' + }, + { + avatar_template: '/user_avatar/jwilkins.oboe_{size}.png', + id: 285941, + name: 'Jessica Wilkins', + username: 'jwilkins.oboe' + }, + { + avatar_template: '/user_avatar/ilenia_{size}.png', + id: 170865, + name: 'Ilenia', + username: 'ilenia' + } +]; + +const _testPosters = [ + { user_id: 6 }, + { user_id: 285941 }, + { user_id: 170865 } +]; + +const _testData = { + users: _testUsers, + topic_list: { + topics: [ + { + bumped_at: '2024-04-15T16:01:26.403Z', + category_id: 1, + id: 684569, + posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], + posts_count: 8, + slug: 'the-freecodecamp-podcast-is-back-now-with-video', + title: 'The freeCodeCamp Podcast is back – now with video', + views: 542 + }, + { + bumped_at: '2024-04-19T13:52:03.523Z', + category_id: 421, + id: 686149, + posters: [{ user_id: 170865 }], + posts_count: 1, + slug: 'problem-with-making-changes-to-styles-js', + title: 'Problem with making changes to styles. (JS)', + views: 9 + } + ] + } +}; + +window.fetch = () => + Promise.resolve({ json: () => Promise.resolve(_testData) }); +``` + # --hints-- Você deve ter uma função chamada `timeAgo` que recebe um único argumento. @@ -297,31 +359,8 @@ assert.lengthOf(avatars, 2); A função `avatars` deve retornar uma string formada pela junção de `img` elementos, um para cada poster encontrado no array de usuários. ```js -const posters = [{ user_id: 6 }, { user_id: 285941 }, { user_id: 170865 }]; -const users = [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - }, - { id: 20 } -]; +const posters = _testPosters; +const users = [..._testUsers, { id: 20 }]; const actual = avatars(posters, users); const matches = actual.match(/<\s*img\s+.+?>/g); assert.lengthOf(matches, 3); @@ -330,31 +369,8 @@ assert.lengthOf(matches, 3); Cada elemento `img` na string retornada pela função `avatars` deve ter um texto `alt` com o valor da propriedade `name` do poster. ```js -const posters = [{ user_id: 6 }, { user_id: 285941 }, { user_id: 170865 }]; -const users = [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - }, - { id: 20 } -]; +const posters = _testPosters; +const users = [..._testUsers, { id: 20 }]; const actual = avatars(posters, users); const matches = actual.match(/<\s*img\s+.+?>/g); @@ -366,31 +382,8 @@ assert.match(matches[2], /alt=('|")Ilenia\1/); A função `avatars` deve definir o tamanho de cada avatar acessando a propriedade `avatar_template` e substituindo `{size}` por `30`. ```js -const posters = [{ user_id: 6 }, { user_id: 285941 }, { user_id: 170865 }]; -const users = [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - }, - { id: 20 } -]; +const posters = _testPosters; +const users = [..._testUsers, { id: 20 }]; const actual = avatars(posters, users); assert.notMatch(actual, /\{size\}/); assert.lengthOf(actual.match(/_30/g), 3); @@ -399,31 +392,8 @@ assert.lengthOf(actual.match(/_30/g), 3); Cada elemento `img` deve ter um atributo `src` definido para o `avatar_template` do usuário correspondente. Se `avatar_template` começar com `/`, adicione `avatarUrl` diretamente antes dele. ```js -const posters = [{ user_id: 6 }, { user_id: 285941 }, { user_id: 170865 }]; -const users = [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - }, - { id: 20 } -]; +const posters = _testPosters; +const users = [..._testUsers, { id: 20 }]; const actual = avatars(posters, users); const matches = actual.match(/<\s*img\s+.+?>/g); @@ -458,19 +428,15 @@ assert.isFunction(fetchData); Sua função `fetchData` deve solicitar dados de `https://cdn.freecodecamp.org/curriculum/forum-latest/latest.json`. ```js -const testArr = []; -const temp = fetch; +const spy = __helpers.spyOn(window, 'fetch'); try { - fetch = source => { - testArr.push(source); - return temp(source); - }; fetchData(); - assert.deepEqual(testArr, [ + assert.include( + spy.calls.map(call => call[0]), 'https://cdn.freecodecamp.org/curriculum/forum-latest/latest.json' - ]); + ); } finally { - fetch = temp; + spy.restore(); } ``` @@ -521,55 +487,7 @@ async () => { `showLatestPosts` deve definir o inner HTML de `#posts-container` para uma string formada pela junção de `tr` elementos, um para cada item em `topics`. ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const pContainer = document.getElementById('posts-container'); pContainer.innerHTML = ''; showLatestPosts(data); @@ -579,55 +497,7 @@ assert.lengthOf(pContainer.querySelectorAll('tr'), 2); Cada elemento `tr` da string retornada por `showLatestPosts` deve conter 5 elementos `td`. ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const pContainer = document.getElementById('posts-container'); pContainer.innerHTML = ''; showLatestPosts(data); @@ -638,55 +508,7 @@ assert.lengthOf(pContainer.querySelectorAll('tr:last-child>td'), 5); O primeiro elemento `td` de cada linha da tabela da string retornada por `showLatestPosts` deve conter dois elementos âncora, o primeiro com a classe `post-title`, um `href` de `/`, um texto âncora de ``, e o segundo obtido chamando `forumCategory` com `category_id`. ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const pContainer = document.getElementById('posts-container'); pContainer.innerHTML = ''; showLatestPosts(data); @@ -731,55 +553,7 @@ assert.equal( O segundo elemento `td` de cada linha da tabela da string retornada por `showLatestPosts` deve conter as imagens retornadas pela função `avatars` chamada com `posters` e `users` como argumentos, aninhadas dentro de um elemento `div` com a classe `avatar-container`. ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const pContainer = document.getElementById('posts-container'); pContainer.innerHTML = ''; showLatestPosts(data); @@ -820,55 +594,7 @@ assert.equal(imgs2[0].alt, 'Ilenia'); O terceiro elemento `td` de cada linha da tabela da string retornada por `showLatestPosts` deve conter o número de respostas ao post. _Dica:_ use `posts_count - 1`. ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const pContainer = document.getElementById('posts-container'); pContainer.innerHTML = ''; showLatestPosts(data); @@ -887,55 +613,7 @@ assert.equal( O quarto elemento `td` de cada linha da tabela da string retornada por `showLatestPosts` deve conter o número de visualizações do post. ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const pContainer = document.getElementById('posts-container'); pContainer.innerHTML = ''; showLatestPosts(data); @@ -954,55 +632,7 @@ assert.equal( O quinto elemento `td` de cada linha da tabela da string retornada por `showLatestPosts` deve conter o tempo passado desde a última atividade, gerado usando a função `timeAgo`. ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const calcTime = time => { const currentTime = new Date(); const lastPost = new Date(time); diff --git a/curriculum/challenges/portuguese/blocks/lab-javascript-trivia-bot/66ed41f912d0bb1dc62da5dd.md b/curriculum/challenges/portuguese/blocks/lab-javascript-trivia-bot/66ed41f912d0bb1dc62da5dd.md index 7d453178b93..e1880b98722 100644 --- a/curriculum/challenges/portuguese/blocks/lab-javascript-trivia-bot/66ed41f912d0bb1dc62da5dd.md +++ b/curriculum/challenges/portuguese/blocks/lab-javascript-trivia-bot/66ed41f912d0bb1dc62da5dd.md @@ -15,11 +15,11 @@ dashedName: lab-javascript-trivia-bot 1. Você deve criar três variáveis: `botName`, `botLocation` e `favoriteLanguage`, que armazenam o nome do bot, de onde ele é e sua linguagem de programação favorita, respectivamente. 1. Você deve registrar `"My name is (botName) and I live on (botLocation)."` no console. 1. Você deve registrar `"My favorite programming language is (favoriteLanguage)."` no console. -1. Você deve usar `let` para criar uma variável `codingFact` e atribuir a ela uma string que seja um fato divertido sobre a linguagem de programação favorita do seu bot e incluir o uso da variável `favoriteLanguage`. +1. Você deve usar `let` para criar uma variável `codingFact` e atribuir a ela uma string que seja um fato divertido sobre a linguagem de programação favorita do bot, usando a variável `favoriteLanguage`. 1. Você deve registrar o `codingFact` no console. -1. Você deve reatribuir a variável `codingFact` para um novo fato sobre a linguagem favorita do bot usando novamente a variável `favoriteLanguage`. +1. Você deve reatribuir a variável `codingFact` para um novo fato sobre a linguagem de programação favorita do bot usando novamente a variável `favoriteLanguage`. 1. Você deve registrar o `codingFact` no console novamente. -1. Você deve reatribuir a variável `codingFact` novamente para outro fato novo sobre a linguagem favorita do bot usando a variável `favoriteLanguage`. +1. Você deve reatribuir a variável `codingFact` para um terceiro fato sobre a linguagem de programação favorita do bot usando novamente a variável `favoriteLanguage`. 1. Você deve registrar o `codingFact` no console pela terceira vez. 1. Você deve registrar `"It was fun sharing these facts with you. Goodbye! - (botName) from (botLocation)."` no console como uma declaração de despedida do bot. @@ -162,7 +162,7 @@ let codingFact = "Did you know that " + favoriteLanguage + " was created in just console.log(codingFact); -codingFact = "Another fun fact: " + favoriteLanguage + "was originally called Mocha!"; +codingFact = "Another fun fact: " + favoriteLanguage + " was originally called Mocha!"; console.log(codingFact); diff --git a/curriculum/challenges/portuguese/blocks/lab-mood-board/673b3d6b7ef7318eef926d5a.md b/curriculum/challenges/portuguese/blocks/lab-mood-board/673b3d6b7ef7318eef926d5a.md index 22c09ca9179..2e8e5d436c1 100644 --- a/curriculum/challenges/portuguese/blocks/lab-mood-board/673b3d6b7ef7318eef926d5a.md +++ b/curriculum/challenges/portuguese/blocks/lab-mood-board/673b3d6b7ef7318eef926d5a.md @@ -16,16 +16,16 @@ Neste laboratório, você criará um mood board usando componentes React reutili **Histórias de Usuário:** -1. Você deve criar e exportar um componente `MoodBoardItem` que aceita três props: `color`, `image` e `description`. +1. Você deve criar e exportar um componente `MoodBoardItem` que aceite três props: `color`, `image` e `description`. 2. Seu componente `MoodBoardItem` deve retornar um `div` com a classe `mood-board-item` como seu elemento de nível superior. -3. Você deve definir a cor de fundo do elemento `.mood-board-item` para o valor da propriedade `color` usando estilos inline. -4. Você deve renderizar um elemento `img`, com uma classe `mood-board-image` e seu atributo `src` definido para o valor da prop `image`, dentro do elemento `.mood-board-item`. -5. Você deve renderizar um elemento `h3`, com a classe `mood-board-text` e seu texto sendo o valor da prop `description`, dentro do elemento `.mood-board-item`. -6. Você deve criar e exportar um `MoodBoard`. +3. Você deve definir a cor de fundo do elemento `.mood-board-item` para o valor da prop `color` usando estilos inline. +4. Você deve renderizar um elemento `img`, com a classe `mood-board-image` e seu atributo `src` definido para o valor da prop `image`, dentro do elemento `.mood-board-item`. +5. Você deve renderizar um elemento `h3`, com a classe `mood-board-text` e seu texto definido para o valor da prop `description`, dentro do elemento `.mood-board-item`. +6. Você deve criar e exportar um componente `MoodBoard`. 7. Seu componente `MoodBoard` deve retornar um `div` como seu elemento de nível superior. -8. Seu componente `MoodBoard` deve renderizar um elemento `h1` com uma classe `mood-board-heading` e o texto `Destination Mood Board`. -9. Seu componente `MoodBoard` deve renderizar uma `div` com uma classe `mood-board`. -10. Seu componente `MoodBoard` deve renderizar pelo menos três componentes `MoodBoardItem` dentro do elemento `.mood-board`, cada um deve passar as props `color`, `image` e `description` com valores válidos. +8. Seu componente `MoodBoard` deve renderizar um elemento `h1` com a classe `mood-board-heading` e o texto `Destination Mood Board`. +9. Seu componente `MoodBoard` deve renderizar um `div` com a classe `mood-board`. +10. Seu componente `MoodBoard` deve renderizar pelo menos três componentes `MoodBoardItem` dentro do elemento `.mood-board`, cada um dos quais deve passar as props `color`, `image` e `description` com valores válidos. Você pode usar as seguintes imagens no seu Mood Board se desejar: @@ -41,10 +41,10 @@ Você pode usar as seguintes imagens no seu Mood Board se desejar: Você deve exportar um componente `MoodBoardItem`. ```js -assert.isFunction(window.index.MoodBoardItem, 1); +assert.isFunction(window.index.MoodBoardItem); ``` -Seu componente `MoodBoardItem` deve retornar um `div` com a classe `mood-board-item` em seu elemento de nível superior. +Seu componente `MoodBoardItem` deve retornar um `div` com a classe `mood-board-item` como seu elemento de nível superior. ```js const item = document.getElementsByClassName('mood-board-item')[0]; @@ -52,7 +52,7 @@ assert.exists(item); assert.equal(item.tagName, 'DIV'); ``` -A cor de fundo do elemento `.mood-board-item` deve ser definida com o valor da propriedade `color` usando estilos inline. +A cor de fundo do seu elemento `.mood-board-item` deve ser definida para o valor da prop `color` usando estilos inline. ```js const container = await __helpers.prepTestComponent(window.index.MoodBoardItem, { color: "red" }); @@ -83,7 +83,7 @@ Seu componente `MoodBoardItem` deve renderizar um elemento `h3` com a classe `mo Você deve exportar um componente `MoodBoard`. ```js -assert.isFunction(window.index.MoodBoard, 1); +assert.isFunction(window.index.MoodBoard); ``` Seu componente `MoodBoard` deve retornar um `div` como seu elemento de nível superior. @@ -102,7 +102,15 @@ assert.equal(heading.tagName, 'H1'); assert.equal(heading.textContent, 'Destination Mood Board'); ``` -Seu componente `MoodBoard` deve renderizar pelo menos três componentes `MoodBoardItem`, cada um deve passar as props `color`, `image` e `description` com valores válidos. +Seu componente `MoodBoard` deve renderizar um `div` com a classe `mood-board`. + +```js +const moodboard = document.getElementsByClassName('mood-board')[0]; +assert.exists(moodboard); +assert.equal(moodboard.tagName, 'DIV'); +``` + +Seu componente `MoodBoard` deve renderizar pelo menos três componentes `MoodBoardItem` dentro do elemento `.mood-board`, cada um dos quais deve passar as props `color`, `image` e `description` com valores válidos. ```js const moodboard = document.getElementsByClassName('mood-board')[0]; diff --git a/curriculum/challenges/portuguese/blocks/lab-motorcycle-shop/694175528a794a090ea0ba74.md b/curriculum/challenges/portuguese/blocks/lab-motorcycle-shop/694175528a794a090ea0ba74.md index ba67c8f9803..4a0f1cdf244 100644 --- a/curriculum/challenges/portuguese/blocks/lab-motorcycle-shop/694175528a794a090ea0ba74.md +++ b/curriculum/challenges/portuguese/blocks/lab-motorcycle-shop/694175528a794a090ea0ba74.md @@ -35,6 +35,291 @@ Para este laboratório, você recebeu todo o HTML e CSS. Você vai usar TypeScri 7. O número de elementos `Motorcycle` exibidos deve ser listado dentro de um elemento com id `results-number`. 8. O filtro deve ser atualizado em um evento `input`. +# --before-all-- + +```js +const _testMotorcycles = [ + { + id: '1', + name: 'Ninja H2', + manufacturer: 'Kawasaki', + category: 'Sport', + price: 29000, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-vmoto-stash.jpg', + description: 'Supercharged hypersport with unmatched power', + year: 2024, + created_at: '2024-01-01T00:00:00Z' + }, + { + id: '2', + name: 'Street Triple RS', + manufacturer: 'Triumph', + category: 'Naked', + price: 13500, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-r3.png', + description: 'Agile naked bike with triple-cylinder perfection', + year: 2024, + created_at: '2024-01-02T00:00:00Z' + }, + { + id: '3', + name: 'R1250 GS Adventure', + manufacturer: 'BMW', + category: 'Adventure', + price: 21995, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-vmoto-stash.jpg', + description: 'The ultimate adventure touring machine', + year: 2024, + created_at: '2024-01-03T00:00:00Z' + }, + { + id: '4', + name: 'Panigale V4', + manufacturer: 'Ducati', + category: 'Sport', + price: 28395, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-kawasaki-zx10r.png', + description: 'Italian superbike engineering at its finest', + year: 2024, + created_at: '2024-01-04T00:00:00Z' + }, + { + id: '5', + name: 'Road Glide Special', + manufacturer: 'Harley-Davidson', + category: 'Cruiser', + price: 29999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-vmax.jpg', + description: 'Classic American touring with modern tech', + year: 2024, + created_at: '2024-01-05T00:00:00Z' + }, + { + id: '6', + name: 'MT-09', + manufacturer: 'Yamaha', + category: 'Naked', + price: 9999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-mt7.jpg', + description: 'Lightweight naked bike with crossplane power', + year: 2024, + created_at: '2024-01-06T00:00:00Z' + }, + { + id: '7', + name: 'Africa Twin', + manufacturer: 'Honda', + category: 'Adventure', + price: 14599, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-honda-africa.jpg', + description: 'Legendary adventure bike reborn for modern times', + year: 2024, + created_at: '2024-01-07T00:00:00Z' + }, + { + id: '8', + name: 'Super Duke R', + manufacturer: 'KTM', + category: 'Naked', + price: 18999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-suzuki-sv650.jpg', + description: 'The Beast returns with 180hp of raw power', + year: 2024, + created_at: '2024-01-08T00:00:00Z' + }, + { + id: '9', + name: 'GSX-R1000R', + manufacturer: 'Suzuki', + category: 'Sport', + price: 17199, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-suzuki-gsxr1000.jpg', + description: 'Track-ready sportbike with championship DNA', + year: 2024, + created_at: '2024-01-09T00:00:00Z' + }, + { + id: '10', + name: 'Street Glide', + manufacturer: 'Harley-Davidson', + category: 'Cruiser', + price: 21999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-vmax.jpg', + description: 'Milwaukee-Eight power in a sleek bagger', + year: 2024, + created_at: '2024-01-10T00:00:00Z' + }, + { + id: '11', + name: 'Z H2', + manufacturer: 'Kawasaki', + category: 'Naked', + price: 17000, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-kawasaki-zh2.jpg', + description: 'Supercharged naked bike mayhem', + year: 2024, + created_at: '2024-01-11T00:00:00Z' + }, + { + id: '12', + name: 'Multistrada V4', + manufacturer: 'Ducati', + category: 'Adventure', + price: 22995, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-mt3.jpg', + description: 'Italian style meets adventure capability', + year: 2024, + created_at: '2024-01-12T00:00:00Z' + }, + { + id: '13', + name: 'Speed Triple 1200', + manufacturer: 'Triumph', + category: 'Naked', + price: 16500, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-honda-transalp.jpg', + description: 'British muscle bike with cutting-edge tech', + year: 2024, + created_at: '2024-01-13T00:00:00Z' + }, + { + id: '14', + name: 'S1000RR', + manufacturer: 'BMW', + category: 'Sport', + price: 17295, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-kawasaki-z900a1.jpg', + description: 'German precision in a superbike package', + year: 2024, + created_at: '2024-01-14T00:00:00Z' + }, + { + id: '15', + name: 'MT-07', + manufacturer: 'Yamaha', + category: 'Naked', + price: 7999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-mt7.jpg', + description: 'Best-selling parallel twin for pure fun', + year: 2024, + created_at: '2024-01-15T00:00:00Z' + }, + { + id: '16', + name: 'V-Strom 1050', + manufacturer: 'Suzuki', + category: 'Adventure', + price: 13799, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-benelli-trk702.png', + description: 'Reliable adventure touring on a budget', + year: 2024, + created_at: '2024-01-16T00:00:00Z' + }, + { + id: '17', + name: 'Sportster S', + manufacturer: 'Harley-Davidson', + category: 'Cruiser', + price: 15999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-r3.png', + description: 'Revolution Max engine in a modern cruiser', + year: 2024, + created_at: '2024-01-17T00:00:00Z' + }, + { + id: '18', + name: 'CBR1000RR-R', + manufacturer: 'Honda', + category: 'Sport', + price: 28500, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-honda-cbr500.png', + description: 'Honda racing technology for the street', + year: 2024, + created_at: '2024-01-18T00:00:00Z' + }, + { + id: '19', + name: 'Tiger 900', + manufacturer: 'Triumph', + category: 'Adventure', + price: 14400, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-triumph-tiger900.png', + description: 'Middleweight adventure excellence', + year: 2024, + created_at: '2024-01-19T00:00:00Z' + }, + { + id: '20', + name: '890 Duke R', + manufacturer: 'KTM', + category: 'Naked', + price: 11999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-kawasaki-zx10r.png', + description: 'The Scalpel - precise handling perfection', + year: 2024, + created_at: '2024-01-20T00:00:00Z' + }, + { + id: '21', + name: 'Ninja 400', + manufacturer: 'Kawasaki', + category: 'Sport', + price: 5299, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-vmoto-stash.jpg', + description: 'Perfect entry-level sportbike', + year: 2024, + created_at: '2024-01-21T00:00:00Z' + }, + { + id: '22', + name: 'Scrambler 1200', + manufacturer: 'Triumph', + category: 'Adventure', + price: 13250, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-ducati-scrambler.jpg', + description: 'Modern classic with off-road capability', + year: 2024, + created_at: '2024-01-22T00:00:00Z' + }, + { + id: '23', + name: 'Monster Plus', + manufacturer: 'Ducati', + category: 'Naked', + price: 14295, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-kawasaki-zx10r.png', + description: 'Evolved Monster with V-twin soul', + year: 2024, + created_at: '2024-01-23T00:00:00Z' + }, + { + id: '24', + name: 'CB650R', + manufacturer: 'Honda', + category: 'Naked', + price: 9199, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-kawasaki-z900.png', + description: 'Neo Sports Café styling with inline-four power', + year: 2024, + created_at: '2024-01-24T00:00:00Z' + }, + { + id: '25', + name: 'Low Rider S', + manufacturer: 'Harley-Davidson', + category: 'Cruiser', + price: 17999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-suzuki-vstorm650.jpg', + description: 'Blacked-out cruiser with attitude', + year: 2024, + created_at: '2024-01-25T00:00:00Z' + } +]; + +window.fetch = () => + Promise.resolve({ json: () => Promise.resolve(_testMotorcycles) }); +``` + # --hints-- Você deve ter um `type` chamado `Category`. @@ -84,16 +369,24 @@ Você deve usar o endpoint `https://cdn.freecodecamp.org/curriculum/labs/data/mo ```js const spy = __helpers.spyOn(window, 'fetch'); -const motorcycles = await fetchMotorcycles(); -assert.strictEqual(spy.calls[0][0].trim(),"https://cdn.freecodecamp.org/curriculum/labs/data/motorcycles.json"); +try { + await fetchMotorcycles(); + assert.strictEqual(spy.calls[0][0].trim(),"https://cdn.freecodecamp.org/curriculum/labs/data/motorcycles.json"); +} finally { + spy.restore(); +} ``` Você deve retornar uma promise de 25 objetos `Motorcycle` de `fetchMotorcycles`. ```js const spy = __helpers.spyOn(window, 'fetch'); -const motorcycles = await fetchMotorcycles(); -assert.lengthOf(motorcycles,25); +try { + const motorcycles = await fetchMotorcycles(); + assert.lengthOf(motorcycles,25); +} finally { + spy.restore(); +} ``` Você deve ter uma função chamada `renderMotorcycleCard`. diff --git a/curriculum/challenges/portuguese/blocks/lab-nth-fibonacci-number-js/7a97b79c096ecb000d03bd36.md b/curriculum/challenges/portuguese/blocks/lab-nth-fibonacci-number-js/7a97b79c096ecb000d03bd36.md index 8faa6616860..8fa0a3a3301 100644 --- a/curriculum/challenges/portuguese/blocks/lab-nth-fibonacci-number-js/7a97b79c096ecb000d03bd36.md +++ b/curriculum/challenges/portuguese/blocks/lab-nth-fibonacci-number-js/7a97b79c096ecb000d03bd36.md @@ -1,15 +1,15 @@ --- id: 7a97b79c096ecb000d03bd36 -title: Construir um calculador do enésimo número de Fibonacci +title: Construa um calculador do n-ésimo número de Fibonacci challengeType: 26 dashedName: build-an-nth-fibonacci-number-calculator --- # --description-- -**Objetivo:** Atenda às user stories abaixo e faça todos os testes passarem para concluir o laboratório. +**Objetivo:** Cumprir as user stories abaixo e fazer todos os testes passarem para completar o laboratório. -**User Stories:** +**Histórias de Usuário:** 1. Você deve criar uma função chamada `fibonacci`. 2. Você deve definir um array chamado `sequence` dentro da função `fibonacci`, e ele deve ser inicializado com os valores `[0, 1]`. @@ -22,59 +22,64 @@ dashedName: build-an-nth-fibonacci-number-calculator Você deve ter uma função chamada `fibonacci`. ```js -assert.isFunction(fibonacci); +const explorer = await __helpers.Explorer(code); +assert.exists(explorer.allFunctions.fibonacci); ``` Sua função `fibonacci` deve receber um único parâmetro. ```js -const params = __helpers.getFunctionParams(fibonacci.toString()); -assert.equal(params.length, 1); +const explorer = await __helpers.Explorer(code); +const { fibonacci } = explorer.allFunctions; +assert.equal(fibonacci?.parameters.length, 1); ``` Você deve ter um array chamado `sequence` dentro da função `fibonacci` inicializado com `[0, 1]`. ```js -assert.match(__helpers.removeJSComments(fibonacci.toString()), /(const|let|var)\s+sequence\s*=\s*\[\s*0\s*,\s*1\s*\]/); +const explorer = await __helpers.Explorer(code); +const { fibonacci } = explorer.allFunctions; +const { sequence } = fibonacci?.variables ?? {}; +assert.isTrue(sequence?.value.matches('[0, 1]')); ``` -`fibonacci(0)` should return `0`. +`fibonacci(0)` deve retornar `0`. ```js assert.equal(fibonacci(0), 0); ``` -`fibonacci(1)` should return `1`. +`fibonacci(1)` deve retornar `1`. ```js assert.equal(fibonacci(1), 1); ``` -`fibonacci(2)` should return `1`. +`fibonacci(2)` deve retornar `1`. ```js assert.equal(fibonacci(2), 1); ``` -`fibonacci(3)` should return `2`. +`fibonacci(3)` deve retornar `2`. ```js assert.equal(fibonacci(3), 2); ``` -`fibonacci(5)` should return `5`. +`fibonacci(5)` deve retornar `5`. ```js assert.equal(fibonacci(5), 5); ``` -`fibonacci(10)` should return `55`. +`fibonacci(10)` deve retornar `55`. ```js assert.equal(fibonacci(10), 55); ``` -`fibonacci(15)` should return `610`. +`fibonacci(15)` deve retornar `610`. ```js assert.equal(fibonacci(15), 610); diff --git a/curriculum/challenges/portuguese/blocks/lab-product-showcase/696920c0c98a1ed58eb86293.md b/curriculum/challenges/portuguese/blocks/lab-product-showcase/696920c0c98a1ed58eb86293.md index 13c0493263f..c622e582e02 100644 --- a/curriculum/challenges/portuguese/blocks/lab-product-showcase/696920c0c98a1ed58eb86293.md +++ b/curriculum/challenges/portuguese/blocks/lab-product-showcase/696920c0c98a1ed58eb86293.md @@ -1,6 +1,6 @@ --- id: 696920c0c98a1ed58eb86293 -title: criar uma vitrine de produtos +title: Criar uma vitrine de produtos challengeType: 25 dashedName: lab-product-showcase demoType: onClick @@ -421,6 +421,10 @@ Clicar no botão `#all` deve exibir todos os produtos no elemento `#output`. ```js const len = products.items.length; +const books = document.getElementById("books"); +const all = document.getElementById("all"); +const output = document.getElementById("output"); + assert.isAtLeast(len, 3); books.dispatchEvent(new Event("click", { bubbles: true })); all.dispatchEvent(new Event("click", { bubbles: true })); @@ -430,7 +434,11 @@ assert.lengthOf(output.querySelectorAll(".item"), len); Clicar no botão `#books` deve exibir o conjunto correspondente de produtos no elemento `#output`. ```js +const books = document.getElementById("books"); +const clothing = document.getElementById("clothing"); +const output = document.getElementById("output"); const len = products.items.length; + assert.isAtLeast(len, 3); let count = 0; products.items.forEach(i => { @@ -446,7 +454,11 @@ assert.lengthOf(output.querySelectorAll(".item"), count); Clicar no botão `#electronics` deve exibir o conjunto correspondente de produtos no elemento `#output`. ```js +const electronics = document.getElementById("electronics"); +const clothing = document.getElementById("clothing"); +const output = document.getElementById("output"); const len = products.items.length; + assert.isAtLeast(len, 3); let count = 0; products.items.forEach(i => { @@ -462,7 +474,11 @@ assert.lengthOf(output.querySelectorAll(".item"), count); Clicar no botão `#clothing` deve exibir o conjunto correspondente de produtos no elemento `#output`. ```js +const books = document.getElementById("books"); +const clothing = document.getElementById("clothing"); +const output = document.getElementById("output"); const len = products.items.length; + assert.isAtLeast(len, 3); let count = 0; products.items.forEach(i => { @@ -478,6 +494,7 @@ assert.lengthOf(output.querySelectorAll(".item"), count); Todos os produtos devem estar visíveis por padrão quando a página carregar. Use o evento `DOMContentLoaded` para garantir isso. ```js +const output = document.getElementById("output"); const len = products.items.length; assert.isAtLeast(len, 3); document.dispatchEvent(new Event("DOMContentLoaded")); diff --git a/curriculum/challenges/portuguese/blocks/lab-reusable-footer/673b02b03134b04637bf7055.md b/curriculum/challenges/portuguese/blocks/lab-reusable-footer/673b02b03134b04637bf7055.md index 3781e93ded5..18e85973ec6 100644 --- a/curriculum/challenges/portuguese/blocks/lab-reusable-footer/673b02b03134b04637bf7055.md +++ b/curriculum/challenges/portuguese/blocks/lab-reusable-footer/673b02b03134b04637bf7055.md @@ -16,7 +16,7 @@ demoType: onClick 2. Seu componente `Footer` deve retornar um elemento `footer` que contenha todos os outros elementos. 3. Seu elemento `footer` deve conter: - - Pelo menos três listas não ordenadas, cada uma com pelo menos dois itens de lista. +- Pelo menos três listas não ordenadas, cada uma com pelo menos dois itens de lista. - Pelo menos um elemento de parágrafo com o símbolo de copyright `©`. - Pelo menos três links com o valor `href` definido como `#` e o conteúdo do link definido como um ícone ou texto de sua escolha. @@ -53,7 +53,7 @@ Seu elemento `footer` deve conter pelo menos três listas não ordenadas. assert.isAtLeast(document.querySelectorAll('ul').length, 3); ``` -Cada uma das suas listas não ordenadas deve conter pelo menos dois itens de lista. +Cada uma das suas listas não ordenadas deve ter pelo menos dois itens. ```js const uls = [...document.querySelectorAll('ul')]; @@ -84,7 +84,7 @@ const links = document.querySelectorAll('a[href="#"]'); assert.isAtLeast(links.length, 3); ``` -Nenhum dos seus links deve estar vazio. +Seus links não devem estar vazios. ```js const links = [...document.querySelectorAll('a[href="#"]')]; diff --git a/curriculum/challenges/portuguese/blocks/lab-sentence-maker/66c057041df6394ca796bf33.md b/curriculum/challenges/portuguese/blocks/lab-sentence-maker/66c057041df6394ca796bf33.md index a17eaede209..1671425b949 100644 --- a/curriculum/challenges/portuguese/blocks/lab-sentence-maker/66c057041df6394ca796bf33.md +++ b/curriculum/challenges/portuguese/blocks/lab-sentence-maker/66c057041df6394ca796bf33.md @@ -7,7 +7,7 @@ dashedName: build-a-sentence-maker # --description-- -Neste laboratório, você criará duas histórias diferentes usando um modelo de frase. Você usará variáveis para armazenar diferentes partes da história e, em seguida, exibirá as histórias no console. +Neste laboratório, você vai criar duas histórias diferentes usando um modelo de frase. Você vai usar variáveis para armazenar diferentes partes da história e depois registrar as histórias no console. **Objetivo:** Cumprir as user stories abaixo e fazer todos os testes passarem para completar o laboratório. @@ -26,19 +26,26 @@ Neste laboratório, você criará duas histórias diferentes usando um modelo de 1. Você deve declarar uma variável `firstStory`. -1. Você deve usar o seguinte modelo de história para criar a primeira história e atribuí-la à variável `firstStory`: `"Once upon a time, there was a(n) [adjective] [noun] who loved to eat [noun2]. The [noun] lived in a [place] and had [adjective2] nostrils that blew fire when it was [verb]."`; +1. Você deve usar o seguinte modelo de história para criar a primeira história e atribuí-la à variável `firstStory`: `"Once upon a time, there was a(n) [adjective] [noun] who loved to eat [noun2]. The [noun] lived in a [place] and had [adjective2] nostrils that blew fire when it was [verb]."` -1. Você deve exibir a primeira história no console usando a mensagem `"First story: [firstStory]"`. +1. Você deve registrar sua primeira história no console usando a mensagem `"First story: [firstStory]"`. 1. Você deve atribuir novos valores às variáveis `adjective`, `noun`, `verb`, `place`, `adjective2` e `noun2`. 1. Você deve declarar uma variável `secondStory`. -1. Crie outra história usando o mesmo modelo e atribua-a à variável `secondStory`. +1. Você deve criar outra história usando o mesmo modelo e atribuí-la à variável `secondStory`. -1. Você deve exibir a segunda história no console usando a mensagem `"Second story: [secondStory]"`. +1. Você deve registrar sua segunda história no console usando a mensagem `"Second story: [secondStory]"`. +# --before-each-- + +```js +const spy = __helpers.spyOn(console, 'log'); +const getLogs = () => spy.calls.map(call => call.join(' ')); +``` + # --hints-- Você deve declarar uma variável `adjective`. @@ -142,12 +149,10 @@ assert.match( ); ``` -Você deve registrar a primeira história usando a mensagem `"First story: [firstStory]"`. +Você deve registrar sua primeira história no console usando a mensagem `"First story: [firstStory]"`. ```js -const condition1 = /console\.log\(\s*["']First\s+story:\s+["']\s*\+\s*firstStory\s*\);?/gm.test(code); -const condition2 = /console\.log\(\s*`First\s+story:\s+\$\{firstStory\}`\s*\);?/gm.test(code); -assert.isTrue(condition1 || condition2); +assert.include(getLogs(), `First story: ${firstStory}`); ``` Você deve declarar uma variável `secondStory`. @@ -208,15 +213,13 @@ assert.match( ); ``` -Você deve registrar a segunda história usando o formato `"Second story: [secondStory]"`. +Você deve registrar sua segunda história no console usando a mensagem `"Second story: [secondStory]"`. ```js -const condition1 = /console\.log\(\s*["']Second\s+story:\s+["']\s*\+\s*secondStory\s*\);?/gm.test(code); -const condition2 = /console\.log\(\s*`Second\s+story:\s+\$\{secondStory\}`\s*\);?/gm.test(code); -assert.isTrue(condition1 || condition2); +assert.include(getLogs(), `Second story: ${secondStory}`); ``` -A `firstStory` não deve ser igual à `secondStory`. +Sua `firstStory` não deve ser igual à sua `secondStory`. ```js assert.notEqual(firstStory, secondStory); diff --git a/curriculum/challenges/portuguese/blocks/lab-weather-app/66f12a88741aeb16b9246c59.md b/curriculum/challenges/portuguese/blocks/lab-weather-app/66f12a88741aeb16b9246c59.md index 3fbf30804cf..316af6fe487 100644 --- a/curriculum/challenges/portuguese/blocks/lab-weather-app/66f12a88741aeb16b9246c59.md +++ b/curriculum/challenges/portuguese/blocks/lab-weather-app/66f12a88741aeb16b9246c59.md @@ -333,7 +333,7 @@ assert.strictEqual( ); ``` -Dentro do elemento `select` devem haver 6 elementos `option`, um para cada uma das seguintes cidades: Paris, Londres, Tóquio, Los Angeles, Chicago, Nova York. +Além da primeira opção vazia, o elemento `select` deve conter 6 elementos `option`, um para cada uma das seguintes cidades: Paris, Londres, Tóquio, Los Angeles, Chicago, Nova York. ```js ['Paris', 'London', 'Tokyo', 'Los Angeles', 'Chicago', 'New York'].forEach( @@ -342,7 +342,7 @@ Dentro do elemento `select` devem haver 6 elementos `option`, um para cada uma d `select > option[value="${city.toLowerCase()}"]` ); assert.exists(el); - assert.strictEqual(el.innerText.trim(), city); + assert.strictEqual(el.textContent.trim(), city); } ); ``` diff --git a/curriculum/challenges/portuguese/blocks/learn-basic-css-by-building-a-cafe-menu/5f3ef6e03d719d5ac4738993.md b/curriculum/challenges/portuguese/blocks/learn-basic-css-by-building-a-cafe-menu/5f3ef6e03d719d5ac4738993.md index 677f8c79cb0..e6460713816 100644 --- a/curriculum/challenges/portuguese/blocks/learn-basic-css-by-building-a-cafe-menu/5f3ef6e03d719d5ac4738993.md +++ b/curriculum/challenges/portuguese/blocks/learn-basic-css-by-building-a-cafe-menu/5f3ef6e03d719d5ac4738993.md @@ -7,7 +7,7 @@ dashedName: step-56 # --description-- -A largura atual do menu sempre ocupará 80% da largura do elemento `body`. Em uma tela muito ampla, o café e a sobremesa aparecem muito distantes de seus preços. +A largura atual do menu sempre ocupará `80%` da largura do elemento `body`. Em uma tela muito larga, os cafés e sobremesas aparecem muito distantes dos seus preços. Adicione uma propriedade `max-width` ao `menu` com um valor de `500px` para evitar esse distanciamento em excesso. diff --git a/curriculum/challenges/portuguese/blocks/learn-how-to-plan-future-events/67531709d628ef047202e6ae.md b/curriculum/challenges/portuguese/blocks/learn-how-to-plan-future-events/67531709d628ef047202e6ae.md index 9f9d0f4b9c5..9c477b50906 100644 --- a/curriculum/challenges/portuguese/blocks/learn-how-to-plan-future-events/67531709d628ef047202e6ae.md +++ b/curriculum/challenges/portuguese/blocks/learn-how-to-plan-future-events/67531709d628ef047202e6ae.md @@ -12,7 +12,7 @@ Assista ao vídeo para entender o contexto das próximas lições. # --assignment-- -Assista ao vídeo.. +Assista ao vídeo. # --scene-- diff --git a/curriculum/challenges/portuguese/blocks/learn-present-perfect-while-talking-about-accessibility/671b98e9b7c4854e93044e64.md b/curriculum/challenges/portuguese/blocks/learn-present-perfect-while-talking-about-accessibility/671b98e9b7c4854e93044e64.md index be482b9b5eb..7c106a56b72 100644 --- a/curriculum/challenges/portuguese/blocks/learn-present-perfect-while-talking-about-accessibility/671b98e9b7c4854e93044e64.md +++ b/curriculum/challenges/portuguese/blocks/learn-present-perfect-while-talking-about-accessibility/671b98e9b7c4854e93044e64.md @@ -62,7 +62,7 @@ Assista ao vídeo. "startTime": 5.34, "finishTime": 9.26, "dialogue": { - "text": "Yes, for some reason it hasn't been displaying correctly for some users.", + "text": "Yes. For some reason, it hasn't been displaying correctly for some users.", "align": "right" } }, diff --git a/curriculum/challenges/portuguese/blocks/learn-present-perfect-while-talking-about-accessibility/671f403c1d4e8a5e046065a0.md b/curriculum/challenges/portuguese/blocks/learn-present-perfect-while-talking-about-accessibility/671f403c1d4e8a5e046065a0.md index ba152baa7b2..0b356ba4667 100644 --- a/curriculum/challenges/portuguese/blocks/learn-present-perfect-while-talking-about-accessibility/671f403c1d4e8a5e046065a0.md +++ b/curriculum/challenges/portuguese/blocks/learn-present-perfect-while-talking-about-accessibility/671f403c1d4e8a5e046065a0.md @@ -6,7 +6,7 @@ dashedName: task-36 lang: en-US --- -<!-- (Audio) James: Yes. For some reason, It hasn't been displaying correctly for some users. --> +<!-- (Audio) James: Yes. For some reason, it hasn't been displaying correctly for some users. --> # --instructions-- @@ -16,7 +16,7 @@ Ouça o áudio para completar a frase abaixo. ## --sentence-- -`Yes. For some reason, It BLANK BLANK BLANK correctly for some users.` +`Yes. For some reason, it BLANK BLANK BLANK correctly for some users.` ## --blanks-- @@ -83,7 +83,7 @@ A frase está na forma negativa do tempo `Present Perfect Continuous`, que é co "startTime": 1, "finishTime": 4.92, "dialogue": { - "text": "Yes, for some reason it hasn't been displaying correctly for some users.", + "text": "Yes. For some reason, it hasn't been displaying correctly for some users.", "align": "center" } }, diff --git a/curriculum/challenges/portuguese/blocks/learn-present-perfect-while-talking-about-accessibility/671f456994635c6085054cbd.md b/curriculum/challenges/portuguese/blocks/learn-present-perfect-while-talking-about-accessibility/671f456994635c6085054cbd.md index b4e7ba9cb54..3bb6270307d 100644 --- a/curriculum/challenges/portuguese/blocks/learn-present-perfect-while-talking-about-accessibility/671f456994635c6085054cbd.md +++ b/curriculum/challenges/portuguese/blocks/learn-present-perfect-while-talking-about-accessibility/671f456994635c6085054cbd.md @@ -6,7 +6,7 @@ dashedName: task-37 lang: en-US --- -<!-- (Audio) James: Yes. For some reason, It hasn't been displaying correctly for some users. --> +<!-- (Audio) James: Yes. For some reason, it hasn't been displaying correctly for some users. --> # --instructions-- @@ -16,7 +16,7 @@ Ouça o áudio para completar a frase abaixo. ## --sentence-- -`Yes. For some reason, It hasn't been displaying BLANK for some BLANK.` +`Yes. For some reason, it hasn't been displaying BLANK for some BLANK.` ## --blanks-- @@ -79,7 +79,7 @@ Este substantivo no plural refere-se a pessoas que interagem com um produto ou s "startTime": 1, "finishTime": 4.92, "dialogue": { - "text": "Yes, for some reason it hasn't been displaying correctly for some users.", + "text": "Yes. For some reason, it hasn't been displaying correctly for some users.", "align": "center" } }, diff --git a/curriculum/challenges/portuguese/blocks/learn-present-perfect-while-talking-about-accessibility/6720cf38beae8c4f1d7af1c0.md b/curriculum/challenges/portuguese/blocks/learn-present-perfect-while-talking-about-accessibility/6720cf38beae8c4f1d7af1c0.md index 422aa990658..f202d65e6b4 100644 --- a/curriculum/challenges/portuguese/blocks/learn-present-perfect-while-talking-about-accessibility/6720cf38beae8c4f1d7af1c0.md +++ b/curriculum/challenges/portuguese/blocks/learn-present-perfect-while-talking-about-accessibility/6720cf38beae8c4f1d7af1c0.md @@ -22,7 +22,7 @@ Escreva as seguintes palavras ou frases no local correto: `rendering consistentl `Alice: James, have you heard about the BLANK on our video platform?` -`James: Yes. For some reason, It hasn't been BLANK for some users. The captions are misaligned and BLANK, which isn't good for accessibility.` +`James: Yes. For some reason, it hasn't been BLANK for some users. The captions are misaligned and BLANK, which isn't good for accessibility.` `Alice: Exactly. Do you know if it's been affecting all the videos or just a few?` diff --git a/curriculum/challenges/portuguese/blocks/lecture-css-specificity-the-cascade-algorithm-and-inheritance/672aa62178d5ff57fe4f98e0.md b/curriculum/challenges/portuguese/blocks/lecture-css-specificity-the-cascade-algorithm-and-inheritance/672aa62178d5ff57fe4f98e0.md index eae87a63280..14d604b4966 100644 --- a/curriculum/challenges/portuguese/blocks/lecture-css-specificity-the-cascade-algorithm-and-inheritance/672aa62178d5ff57fe4f98e0.md +++ b/curriculum/challenges/portuguese/blocks/lecture-css-specificity-the-cascade-algorithm-and-inheritance/672aa62178d5ff57fe4f98e0.md @@ -43,14 +43,14 @@ Em seguida, seletores de ID têm um alto nível de especificidade. ```html <link rel="stylesheet" href="styles.css"> -<p id="para">Red paragraph</p> +<p id="para-1">Red paragraph</p> <p>Other paragraph</p> <p>Another paragraph</p> <p>Yet another paragraph</p> ``` ```css -#para { +#para-1 { color: red; } @@ -67,24 +67,33 @@ Exemplos incluem seletores de classe como `.container` e `.button`, seletores de **NOTA**: Você aprenderá mais sobre pseudo-classes em lições futuras. -Neste exemplo, o primeiro parágrafo ficará vermelho porque um seletor de ID tem uma especificidade maior do que seletores de classes e de tipo. Os elementos `.example-para` terão a cor verde enquanto os demais elementos de parágrafo terão a cor azul. +Neste exemplo: + +- O primeiro parágrafo ficará vermelho porque um seletor de ID tem uma especificidade maior que classes e seletores de tipo. +- O segundo parágrafo com um seletor de classe `.example-para` terá a cor verde. +- O terceiro parágrafo com um seletor de ID `#para-3` e um seletor de classe `.example-para` terá a cor roxa. +- O parágrafo restante terá a cor azul. :::interactive_editor ```html <link rel="stylesheet" href="styles.css"> -<p id="para">Example paragraph</p> +<p id="para-1">Example paragraph</p> <p class="example-para">Other paragraph</p> -<p class="example-para">Another paragraph</p> +<p id="para-3" class="example-para">Another paragraph</p> <p>Yet another paragraph</p> ``` ```css -#para { +#para-1 { color: red; } +#para-3 { + color: purple; +} + .example-para { color: green; } @@ -105,13 +114,13 @@ Seletores de tipo, como `div` e `h1`, e pseudo-elementos como `::before` e `::af ```html <link rel="stylesheet" href="styles.css"> -<p id="para">Example paragraph</p> +<p id="para-1">Example paragraph</p> <p>Other paragraph</p> <p>Yet another paragraph</p> ``` ```css -#para { +#para-1 { color: red; } @@ -130,7 +139,7 @@ Aqui está um exemplo de definir a cor de todos os elementos para vermelho usand ```html <link rel="stylesheet" href="styles.css"> -<p id="para">Example paragraph</p> +<p id="para-1">Example paragraph</p> <p>Other paragraph</p> <p>Yet another paragraph</p> ``` @@ -140,7 +149,7 @@ Aqui está um exemplo de definir a cor de todos os elementos para vermelho usand color: red; } -#para { +#para-1 { color: green; } diff --git a/curriculum/challenges/portuguese/blocks/lecture-express-middleware/69f42d414b7626e21a922794.md b/curriculum/challenges/portuguese/blocks/lecture-express-middleware/69f42d414b7626e21a922794.md index 8f9e64d02e2..5fa5a63fb10 100644 --- a/curriculum/challenges/portuguese/blocks/lecture-express-middleware/69f42d414b7626e21a922794.md +++ b/curriculum/challenges/portuguese/blocks/lecture-express-middleware/69f42d414b7626e21a922794.md @@ -9,9 +9,7 @@ dashedName: what-is-error-handling-middleware Middleware para tratamento de erros no Express é um tipo especial de middleware usado para lidar com erros que ocorrem durante o ciclo de requisição-resposta. Ele é essencial para capturar erros inesperados, registrá-los e fornecer respostas apropriadas ao cliente. -Como você viu em uma lição anterior sobre tratamento de erros, o middleware de tratamento de erros do Express tem quatro parâmetros: `err`, `req`, `res` e `next`. Esse middleware é invocado quando um erro é passado para a função `next()`. - -Aqui está um lembrete da sintaxe mais uma vez: +O middleware de tratamento de erros do Express tem quatro parâmetros: `err`, `req`, `res` e `next`. Esse middleware é acionado quando um erro é passado para a função `next()`. Aqui está a sintaxe: ```js app.use((err, req, res, next) => { diff --git a/curriculum/challenges/portuguese/blocks/lecture-express-middleware/69f42d414b7626e21a922795.md b/curriculum/challenges/portuguese/blocks/lecture-express-middleware/69f42d414b7626e21a922795.md index 0a8fc83da8a..230daffc99e 100644 --- a/curriculum/challenges/portuguese/blocks/lecture-express-middleware/69f42d414b7626e21a922795.md +++ b/curriculum/challenges/portuguese/blocks/lecture-express-middleware/69f42d414b7626e21a922795.md @@ -13,45 +13,45 @@ O Express oferece uma variedade de funções de middleware embutidas que ajudam 1. `express.json()`: Um middleware embutido que analisa payloads JSON recebidos. -```js -app.use(express.json()) -``` + ```js + app.use(express.json()) + ``` 1. `express.static()`: Um middleware para servir arquivos estáticos como imagens, CSS e arquivos JavaScript. -```js -app.use(express.static('public')) -``` + ```js + app.use(express.static('public')) + ``` 1. `express.urlencoded()`: Um middleware que analisa requisições recebidas com payloads codificados em URL, o formato normalmente enviado por formulários HTML. Ele disponibiliza os dados analisados em `req.body`. -```js -app.use(express.urlencoded({ extended: true })) -``` + ```js + app.use(express.urlencoded({ extended: true })) + ``` **Agora, aqui estão alguns exemplos de middleware de terceiros:** 1. `cors`: Um middleware de terceiros popular para habilitar o compartilhamento de recursos entre origens diferentes (Cross-Origin Resource Sharing). -```bash -npm install cors -``` + ```bash + npm install cors + ``` -```js -const cors = require('cors') -app.use(cors()) -``` + ```js + const cors = require('cors') + app.use(cors()) + ``` 1. `morgan`: Um middleware de registro para requisições HTTP. -```bash -npm install morgan -``` + ```bash + npm install morgan + ``` -```js -const morgan = require('morgan') -app.use(morgan('tiny')) -``` + ```js + const morgan = require('morgan') + app.use(morgan('tiny')) + ``` Agora, vamos ver um exemplo de uso tanto de middleware embutido quanto de terceiros: diff --git a/curriculum/challenges/portuguese/blocks/lecture-importance-of-semantic-html/672990ecf71a852804ababe7.md b/curriculum/challenges/portuguese/blocks/lecture-importance-of-semantic-html/672990ecf71a852804ababe7.md index 5616e13a55f..203fbfaa40c 100644 --- a/curriculum/challenges/portuguese/blocks/lecture-importance-of-semantic-html/672990ecf71a852804ababe7.md +++ b/curriculum/challenges/portuguese/blocks/lecture-importance-of-semantic-html/672990ecf71a852804ababe7.md @@ -11,6 +11,10 @@ HTML de apresentação foca na aparência e estilo do conteúdo. Nos primeiros d Muitos elementos HTML de apresentação estão obsoletos, o que significa que eles estão desatualizados e não são mais recomendados. Existem maneiras melhores de obter os mesmos resultados. No entanto, é útil saber que eles existem, então vamos dar uma olhada em alguns exemplos. +## Elementos de HTML apresentacional + +### O elemento `font` + O elemento `font` é um elemento obsoleto usado para definir o tamanho e a cor da fonte do texto. Aqui está um exemplo de um elemento `font`. Ative o editor interativo e altere o tamanho de 5 para 7 para ver o aumento da fonte. @@ -27,6 +31,8 @@ Este exemplo define a cor do texto para `blue` e o tamanho para um valor de `5`. Embora este elemento ainda funcione, você não deve usá-lo porque o tamanho e a cor da fonte devem sempre ser definidos em CSS, não em HTML. +### O elemento `center` + O elemento `center` é outro elemento obsoleto que é usado para centralizar o conteúdo horizontalmente dentro do seu contêiner. Aqui está um exemplo do elemento `center` que contém texto e um elemento de parágrafo. Ative o editor interativo e adicione as tags `center` ao redor de `<p>Another example text.</p>` para vê-lo centralizado na página. @@ -44,6 +50,8 @@ Ative o editor interativo e adicione as tags `center` ao redor de `<p>Another ex ::: +### O elemento `big` + E a seguir, temos o elemento `big`. Este é outro elemento HTML de apresentação obsoleto que torna o texto incluído um nível maior do que o texto ao seu redor. Here we have an example that defines a paragraph with two parts. Ative o editor interativo e adicione tags `big` ao redor do `Some other text` e veja as mudanças na janela de visualização. @@ -64,6 +72,8 @@ Lembre-se de que o tamanho da fonte deve sempre ser definido com CSS, então voc Estes foram exemplos de elementos HTML de apresentação. Mas todos eles estão obsoletos e não são mais recomendados. Então, o que você deve usar em vez disso? Vamos ver. +## HTML semântico + HTML semântico é agora a prática recomendada. Ele descreve o conteúdo dos elementos, então é muito mais fácil de ler, entender e manter. Motores de busca podem entender facilmente seu site quando você usa HTML semântico. Também é útil para fins de acessibilidade, porque leitores de tela precisam de informações semânticas para descrever o que está na página da web. @@ -75,6 +85,8 @@ Exemplos de elementos HTML semânticos incluem: - O elemento `section` para agrupar informações relacionadas. - O elemento `figure` para ilustrações e diagramas. +### Exemplo de HTML semântico + Este é um exemplo de um elemento `header` que contém um elemento de seção de navegação. Ative o editor interativo e adicione um `<a href="#">Products</a>` dentro do `nav` e veja as alterações na janela de visualização. @@ -97,6 +109,8 @@ Ative o editor interativo e adicione um `<a href="#">Products</a>` dentro do `na Os elementos semânticos mostram claramente seu propósito dentro da estrutura HTML. Existem muitos elementos HTML semânticos diferentes. Você definitivamente encontrará um que atenda às necessidades do seu projeto. +## Resumo + Ótimo trabalho. Agora você sabe a diferença entre HTML apresentacional e semântico: o HTML semântico descreve o conteúdo, enquanto o HTML apresentacional foca na aparência. # --questions-- diff --git a/curriculum/challenges/portuguese/blocks/lecture-introduction-to-javascript-libraries-and-frameworks/6734e88cc46e6dc679420040.md b/curriculum/challenges/portuguese/blocks/lecture-introduction-to-javascript-libraries-and-frameworks/6734e88cc46e6dc679420040.md index cae039c3663..673bb1cf041 100644 --- a/curriculum/challenges/portuguese/blocks/lecture-introduction-to-javascript-libraries-and-frameworks/6734e88cc46e6dc679420040.md +++ b/curriculum/challenges/portuguese/blocks/lecture-introduction-to-javascript-libraries-and-frameworks/6734e88cc46e6dc679420040.md @@ -13,7 +13,7 @@ Uma das ferramentas mais populares para configurar projetos é o Vite. Vite, que Para criar um novo projeto com Vite, você precisará usar a linha de comando. Se estiver usando um computador com Windows, pode usar o Prompt de Comando ou o Windows PowerShell. Se estiver usando um Mac, pode usar o app Terminal. -Caso você não tenha o Node.js instalado, que é necessário para o npm funcionar, aqui está um link para a página oficial do Node.js: https://nodejs.org. Siga as instruções de instalação e depois volte aqui para continuar a instalação do React. +Caso você não tenha o Node.js instalado, que é necessário para o npm funcionar, aqui está um link para a página oficial do Node.js: [nodejs.org](https://nodejs.org). Siga as instruções de instalação e depois volte aqui para continuar a instalação do React. Uma vez que você tenha o terminal aberto, você pode usar o seguinte comando: @@ -36,7 +36,7 @@ npm install O comando `cd my-react-app` garante que você mude para o diretório correto onde seu projeto está localizado. -O comando `npm install` é usado para instalar as dependências necessárias para executar corretamente seu projeto React. Dependências são bibliotecas ou pacotes que seu projeto React requer para funcionar corretamente, como o próprio React, ReactDOM ou outros pacotes de terceiros que fornecem funcionalidades adicionais. +O comando `npm install` é usado para instalar as dependências necessárias para executar adequadamente seu projeto React. Dependências são bibliotecas ou pacotes que seu projeto React precisa para funcionar corretamente, como o próprio React, `react-dom` ou outros pacotes de terceiros que fornecem funcionalidades adicionais. Executar `npm install` irá ler o arquivo `package.json` no diretório do seu projeto e instalar todas as dependências listadas lá, permitindo que você construa e execute seu app React sem faltar nenhum componente necessário. @@ -50,11 +50,11 @@ Para executar seu projeto, execute o comando `npm run dev` e abra uma nova aba d Você deve ver o template inicial que o Vite forneceu para você. -Se você precisar parar o servidor local, pressione `CTRL + C` na linha de comando. +Se precisar parar o servidor local, pressione `Ctrl + C` na linha de comando. -Para realmente ver o código deste template inicial, você pode entrar no seu projeto dentro da pasta `src` e deverá ver o arquivo `App.jsx`. +Para realmente ver o código deste template inicial, você pode abrir a pasta `src` dentro do seu projeto, onde deverá encontrar o arquivo `App.jsx`. -A partir daí você pode começar a modificar o arquivo, salvar suas alterações e ver as novas mudanças exibidas no navegador. +A partir daí, você pode modificar o arquivo, salvar suas alterações e vê-las aparecer no navegador. E com isso, você está pronto para começar a construir sua aplicação React! diff --git a/curriculum/challenges/portuguese/blocks/lecture-introduction-to-javascript/672d49959621885e9d3e672c.md b/curriculum/challenges/portuguese/blocks/lecture-introduction-to-javascript/672d49959621885e9d3e672c.md index 2ec8f5bc223..3010334b3ae 100644 --- a/curriculum/challenges/portuguese/blocks/lecture-introduction-to-javascript/672d49959621885e9d3e672c.md +++ b/curriculum/challenges/portuguese/blocks/lecture-introduction-to-javascript/672d49959621885e9d3e672c.md @@ -72,6 +72,16 @@ console.log(age); // 25 ::: +Embora uma variável declarada com `let` possa ser reatribuída, ela não pode ser redeclarada. Se você tentar declarar a mesma variável novamente usando `let`, receberá um erro: + +```js +let age = 25; + +let age = 90; // SyntaxError: Identifier 'age' has already been declared +``` + +O mesmo vale para `const`: uma variável declarada com `const` também não pode ser redeclarada. + Variáveis declaradas com `const` devem ser atribuídas um valor no momento da declaração. Se você tentar declarar uma variável `const` sem atribuir um valor, você receberá um erro: ```js diff --git a/curriculum/challenges/portuguese/blocks/lecture-understanding-aria-expanded-aria-live-and-common-aria-states/672a54dff9dc439089f1a219.md b/curriculum/challenges/portuguese/blocks/lecture-understanding-aria-expanded-aria-live-and-common-aria-states/672a54dff9dc439089f1a219.md index 41702598f93..5b8e1d6a353 100644 --- a/curriculum/challenges/portuguese/blocks/lecture-understanding-aria-expanded-aria-live-and-common-aria-states/672a54dff9dc439089f1a219.md +++ b/curriculum/challenges/portuguese/blocks/lecture-understanding-aria-expanded-aria-live-and-common-aria-states/672a54dff9dc439089f1a219.md @@ -11,10 +11,12 @@ O atributo `aria-live` cria uma região dinâmica na sua página que pode ser us Usos comuns de live regions incluem mensagens que são exibidas após uma ação ter sido realizada (como uma mensagem de erro ou confirmação), conteúdo que é atualizado periodicamente (como um ticker, marquee ou countdown timer) ou mensagens gerais de status (como atualizações sobre um processo). -Como o foco de leitura para leitores de tela pode estar em apenas um lugar por vez, os usuários de leitores de tela não perceberão uma mudança de conteúdo se o foco deles estiver em outra parte da página. As regiões ao vivo permitem que usuários de leitores de tela sejam notificados automaticamente sobre mudanças que acontecem na página em tempo real. Sem uma região ao vivo, usuários de leitores de tela podem perder atualizações importantes de conteúdo disponíveis para usuários com visão, já que um usuário com visão tem a capacidade de escanear a página inteira. +Como o foco de leitura para leitores de tela pode estar em apenas um lugar por vez, os usuários de leitores de tela não perceberão uma mudança de conteúdo se o foco deles estiver em outra parte da página. As regiões ao vivo permitem que usuários de leitores de tela sejam notificados automaticamente sobre mudanças que acontecem na página em tempo real. Sem uma região ao vivo, usuários de leitores de tela podem perder atualizações importantes de conteúdo disponíveis para usuários com visão, já que um usuário com visão tem a capacidade de escanear a página inteira. Existem três valores possíveis para este atributo, baseados na prioridade da informação. +## O valor `assertive` + Se você definir `aria-live` com o valor `assertive` isso significa que a atualização é muito importante. Tem a maior prioridade, então o usuário deve ser notificado imediatamente. Isso significa que o leitor de tela interromperá qualquer anúncio que esteja fazendo no momento para anunciar a mudança de conteúdo na região ao vivo. Tais interrupções podem ser extremamente disruptivas, então o valor `assertive` deve ser usado apenas para notificações sensíveis ao tempo ou críticas. @@ -81,6 +83,8 @@ document.addEventListener("DOMContentLoaded", () => { ::: +## O valor `polite` + O próximo valor em ordem de prioridade é `polite`. Esse valor significa que a atualização não é urgente, então o leitor de tela pode esperar até que qualquer anúncio atual seja finalizado ou até que o usuário pare de digitar antes de anunciar a atualização. A maioria das regiões dinâmicas usará o valor `polite`. @@ -147,10 +151,16 @@ document.addEventListener("DOMContentLoaded", () => { ::: +## O valor `off` + O valor de prioridade mais baixo para `aria-live` é `off` que significa que a atualização não será anunciada a menos que o conteúdo esteja em um elemento que atualmente tenha o foco do teclado. Na prática, esse valor quase nunca é usado, pois o caso de uso é muito restrito e não é implementado de forma consistente (se é que é) em leitores de tela. Se você precisar de regiões ao vivo, planeje usar `polite` para tudo exceto mensagens críticas que precisam de `assertive`. +## Regiões ativas padrão dos papéis ARIA + Também é importante notar que o atributo `aria-live` não é obrigatório se a informação atualizada estiver contida em um elemento com uma função ARIA de `alert`, `log`, `marquee`, `status` ou `timer`, pois essas funções já possuem valores padrão de `aria-live`. Mas o valor padrão pode ser alterado definindo explicitamente `aria-live` no elemento. +## Escolhendo o valor certo + Escolher o valor correto de `aria-live` depende da prioridade da informação atualizada. Se as atualizações forem urgentes, você deve notificar o usuário imediatamente com `assertive`. Mas você deve usar isso somente se as atualizações forem realmente urgentes porque interrupções súbitas podem potencialmente desorientar os usuários e afetar a experiência do usuário. @@ -205,7 +215,7 @@ Quais dos seguintes valores podem ser usados para o atributo `aria-live`? ## --answers-- -`true`, `false` e `off`. +`true`, `false`, `off`. ### --feedback-- @@ -213,7 +223,7 @@ Pense nos diferentes níveis de urgência para anunciar mudanças em conteúdo d --- -`visible`, `hidden` e `off`. +`visible`, `hidden`, `off`. ### --feedback-- @@ -221,11 +231,11 @@ Pense nos diferentes níveis de urgência para anunciar mudanças em conteúdo d --- -`assertive`, `polite` e `off`. +`assertive`, `polite`, `off`. --- -`open`, `closed` e `off`. +`open`, `closed`, `off`. ### --feedback-- diff --git a/curriculum/challenges/portuguese/blocks/lecture-understanding-computer-internet-and-tooling-basics/672aa578a2129554d4675049.md b/curriculum/challenges/portuguese/blocks/lecture-understanding-computer-internet-and-tooling-basics/672aa578a2129554d4675049.md index 1a840da2a29..aca2926a620 100644 --- a/curriculum/challenges/portuguese/blocks/lecture-understanding-computer-internet-and-tooling-basics/672aa578a2129554d4675049.md +++ b/curriculum/challenges/portuguese/blocks/lecture-understanding-computer-internet-and-tooling-basics/672aa578a2129554d4675049.md @@ -11,13 +11,13 @@ Computadores são máquinas muito poderosas que realizam uma variedade de tarefa Como desenvolvedor, é importante entender o funcionamento básico interno de um computador. -O primeiro componente principal de um computador seria a placa-mãe. A placa-mãe contém toda a memória e os conectores que são necessários para executar o computador. Ele serve como a placa de circuito principal do computador. +O primeiro componente principal de um computador é a placa-mãe. A placa-mãe contém toda a memória e os conectores necessários para executar o computador. Ela serve como a placa de circuito principal do computador. -Dentro do gabinete do computador da placa-mãe, você encontrará a CPU que significa Central Processing Unit. A CPU é um processador responsável por executar instruções e realizar cálculos. Frequentemente é referido como o cérebro do computador. +Dentro do gabinete do computador, montado na placa-mãe, você encontrará a CPU, que significa Central Processing Unit. A CPU é um processador responsável por executar instruções e realizar cálculos. Ela é frequentemente chamada de cérebro do computador. -A CPU é um pequeno quadrado com um chip que vai no soquete da CPU da placa-mãe. A velocidade do processador CPU é medida em gigahertz (GHz) e mega-hertz (MHz). Gigahertz é um bilhão de ciclos por segundo e mega-hertz é um milhão de ciclos por segundo. +A CPU é um pequeno chip quadrado que se encaixa no soquete da CPU da placa-mãe. A velocidade da CPU é medida em gigahertz (GHz) e megahertz (MHz). Gigahertz corresponde a um bilhão de ciclos por segundo e megahertz a um milhão de ciclos por segundo. -O próximo componente crítico de um computador seria a memória de curto prazo do sistema. Isto é conhecido como RAM ou Random Access Memory. RAM é um local de armazenamento temporário para a CPU do computador. Sempre que o computador precisar acessar dados rapidamente, ele usará a RAM. +O próximo componente crítico de um computador é a memória de curto prazo do sistema. Isso é conhecido como RAM, ou Random Access Memory. A RAM é um local de armazenamento temporário para a CPU do computador. Sempre que o computador precisa acessar dados rapidamente, ele usa a RAM. Quanto mais RAM você tiver no seu computador, mais rápido ele funcionará e mais programas você poderá executar ao mesmo tempo. Se você estiver com pouca RAM, seu computador ficará mais lento e você notará a diferença no desempenho. @@ -27,13 +27,13 @@ Quando você salva seus arquivos, eles são armazenados no disco rígido. O disc O disco rígido é composto por um prato giratório e um braço. O prato é onde os dados são armazenados e o braço é usado para ler e gravar dados no prato. Quando você tem um disco rígido mais rápido, seu computador vai iniciar mais rápido e seus programas vão rodar mais rápido. -Outro tipo de armazenamento de dados seria o Solid State Drive, ou SSD para abreviar. SSD é uma memória flash não volátil e pode ser usada no lugar de um disco rígido. SSDs são mais rápidos e menores que discos rígidos, mas discos rígidos são mais baratos e têm mais capacidade de armazenamento. +Outro tipo de armazenamento de dados é o Solid State Drive, ou SSD para abreviar. O SSD é uma memória flash não volátil e pode ser usado no lugar de um disco rígido. Os SSDs são mais rápidos e menores que os discos rígidos, mas os discos rígidos são mais baratos e têm maior capacidade de armazenamento. Outro componente chave de um computador é a unidade de fonte de alimentação, ou PSU. A PSU é responsável por converter a eletricidade da tomada em uma forma que o computador possa usar. Ele envia a energia da tomada para a placa-mãe, CPU e outros componentes do computador. -Outro componente chave seriam as placas de expansão. Esses cartões são inseridos na placa-mãe para adicionar funcionalidade adicional ao computador. Exemplos de placas de expansão seriam a placa de vídeo, placa de som e placa de rede. +Outro componente chave é a placa de expansão. Essas placas são inseridas na placa-mãe para adicionar funcionalidades adicionais ao computador. Exemplos de placas de expansão são a placa de vídeo, a placa de som e a placa de rede. -A placa de vídeo, também conhecida como Graphics Processing Unit ou GPU, é responsável por renderizar visuais na tela do computador. +A placa de vídeo, também conhecida como Graphics Processing Unit, ou GPU, é responsável por renderizar os visuais na tela do computador. A placa de som é responsável por reproduzir o som nos alto-falantes do computador. @@ -53,7 +53,7 @@ Memória de longo prazo. ### --feedback-- -Pense no armazenamento de dados de curto prazo. +Pense em armazenamento de dados de curto prazo. --- @@ -65,7 +65,7 @@ A placa de circuito principal. ### --feedback-- -Pense no armazenamento de dados de curto prazo. +Pense em armazenamento de dados de curto prazo. --- @@ -73,7 +73,7 @@ Uma placa de vídeo. ### --feedback-- -Pense no armazenamento de dados de curto prazo. +Pense em armazenamento de dados de curto prazo. ## --video-solution-- @@ -145,7 +145,7 @@ Armazenando memória de curto prazo. ### --feedback-- -Revise o final da lição para a resposta +Revise o final da lição para a resposta. ## --video-solution-- diff --git a/curriculum/challenges/portuguese/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab82c1a9bbd0e3aabc39d.md b/curriculum/challenges/portuguese/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab82c1a9bbd0e3aabc39d.md index 588617df966..0554ef9e57c 100644 --- a/curriculum/challenges/portuguese/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab82c1a9bbd0e3aabc39d.md +++ b/curriculum/challenges/portuguese/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab82c1a9bbd0e3aabc39d.md @@ -7,11 +7,11 @@ dashedName: how-to-effectively-work-with-your-keyboard-mouse-and-other-pointing- # --description-- -Muitos de vocês estão acostumados a trabalhar com seu teclado e mouse por anos a fio para uma variedade de atividades como jogos, realização de tarefas para o trabalho ou navegação na web. +Muitos de vocês já trabalham com o teclado e o mouse há anos em várias atividades como jogos, tarefas de trabalho ou navegação na internet. Mas o uso prolongado indevido desses dispositivos pode levar a sérios problemas de saúde no futuro. -Nesta lição, abordaremos maneiras de trabalhar com o teclado e o mouse do seu computador de forma saudável. +Nesta lição, vamos abordar maneiras de usar o teclado e o mouse do seu computador de forma saudável. A primeira dica é estar atento à forma de segurar o mouse. Ao trabalhar em tarefas sérias para o trabalho ou durante momentos intensos de jogos, você pode acabar segurando o mouse com muita força. No entanto, isso pode levar a sérios problemas nas mãos e pulsos. Para evitar isso, você deve segurar o mouse suavemente e manter os dedos bem relaxados. @@ -25,7 +25,7 @@ Você também deve estar atento à sua postura geral ao sentar-se no computador Embora manter uma boa postura seja importante, a ergonomia moderna enfatiza a importância do movimento e da postura dinâmica. O corpo humano é projetado para o movimento e ficar em qualquer posição fixa, mesmo que reta, por muito tempo pode exercer pressão contínua na coluna vertebral. Fazer pausas regulares, ajustar sua posição ao longo do dia e manter uma posição natural do pulso pode ajudar a melhorar a circulação, reduzir a fadiga e apoiar a saúde da coluna a longo prazo. -A última dica seria usar atalhos de teclado sempre que possível para ajudar a minimizar a digitação. Existem dezenas de atalhos disponíveis para tarefas como navegar na web, navegar pelo seu sistema operacional, trabalhar dentro de um editor de código e mais. So, it’s best to research some of these keyboard shortcuts and start incorporating them into your daily computer usage. +A última dica é usar atalhos de teclado sempre que possível para reduzir o alcance do mouse. Existem dezenas de atalhos disponíveis para tarefas como navegar na web, navegar pelo sistema operacional, trabalhar em um editor de código e muito mais. Então, é melhor pesquisar alguns desses atalhos de teclado e começar a incorporá-los no seu uso diário do computador. À medida que você continua usando seu mouse e teclado para projetos de codificação futuros e outras atividades, lembre-se de manter essas dicas de saúde em mente. @@ -109,7 +109,7 @@ Qual é a recomendação para a altura do seu mouse em relação ao seu teclado? ## --answers-- -O mouse deve estar bem acima do teclado. +A altura do mouse não importa. ### --feedback-- diff --git a/curriculum/challenges/portuguese/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab83c4297910eade53c2e.md b/curriculum/challenges/portuguese/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab83c4297910eade53c2e.md index e404e410096..9112666d6a2 100644 --- a/curriculum/challenges/portuguese/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab83c4297910eade53c2e.md +++ b/curriculum/challenges/portuguese/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab83c4297910eade53c2e.md @@ -7,17 +7,17 @@ dashedName: what-are-the-different-types-of-internet-service-providers # --description-- -Primeiro, o que é um provedor de serviços de internet, ou ISP? É uma empresa que vende acesso à rede global de internet, essencialmente. E eles vêm em três níveis diferentes. +Primeiro, o que é um provedor de serviço de internet, ou ISP? Basicamente, é uma empresa que vende acesso à rede global da internet. E eles vêm em três níveis diferentes. -O primeiro nível são as gigantes conglomeradas, que possuem a infraestrutura para lidar com a maior parte (se não todo) do seu tráfego de rede de forma independente. +O primeiro nível são as grandes empresas conglomeradas, que têm a infraestrutura para lidar com a maior parte (se não todo) do tráfego da sua rede de forma independente. -O segundo nível são os provedores de âmbito nacional, que às vezes alugam acesso às redes de nível 1 mas podem se sustentar razoavelmente bem por conta própria. +O segundo nível são os provedores de âmbito nacional, que às vezes alugam acesso às redes de nível 1, mas conseguem se manter razoavelmente bem por conta própria. O terceiro nível são as pequenas empresas que focam principalmente em fornecer internet para mercados locais e dependem de ISPs maiores para fornecer sua infraestrutura. Esses provedores também oferecerão diferentes tipos de conexões. -Conexões de fibra óptica dependem de fibras de vidro ou plástico para transmitir dados via luz, resultando em velocidades de conexão muito altas e troca de dados. +As conexões de fibra óptica dependem de fibras de vidro ou plástico para transmitir dados via luz, resultando em velocidades de conexão e troca de dados muito altas. As conexões de cabo usam a mesma infraestrutura de um provedor de televisão a cabo, o que frequentemente as torna facilmente disponíveis em muitas regiões. @@ -25,7 +25,7 @@ As conexões DSL usam a infraestrutura que os serviços de telefone fixo usam. D Dial-up também usa as linhas telefônicas, mas requer conexão exclusiva (desabilitando o uso da linha para fins telefônicos quando conectado à internet). Esta é uma tecnologia muito mais antiga que caiu em desuso. -Conexões via satélite usam uma matriz de satélites orbitando a Terra para conectar vários dispositivos ao redor do mundo. E finalmente, de forma semelhante, um provedor de internet residencial 5G usa a infraestrutura das torres de celular para mantê-lo online. +As conexões via satélite usam um array de satélites orbitando a Terra para conectar vários dispositivos ao redor do mundo. E, finalmente, de forma semelhante, um provedor de internet residencial 5G usa a infraestrutura das torres de celular para manter você online. E isso deve lhe dar uma visão básica dos tipos de provedores de serviços de internet e conexões de internet que existem por aí! @@ -33,7 +33,7 @@ E isso deve lhe dar uma visão básica dos tipos de provedores de serviços de i ## --text-- -Qual dos seguintes NÃO é um nível de Provedor de Serviços de Internet (ISP)? +Qual dos seguintes NÃO é um nível de provedor de serviço de internet (ISP)? ## --answers-- @@ -121,7 +121,7 @@ Eles exigem o uso exclusivo da linha telefônica quando conectados. --- -Eles usam uma matriz de satélites orbitando a terra. +Eles usam um array de satélites orbitando a Terra. ### --feedback-- diff --git a/curriculum/challenges/portuguese/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab8573f32480f192aaae1.md b/curriculum/challenges/portuguese/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab8573f32480f192aaae1.md index 6270ec1550a..e3451db530c 100644 --- a/curriculum/challenges/portuguese/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab8573f32480f192aaae1.md +++ b/curriculum/challenges/portuguese/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab8573f32480f192aaae1.md @@ -9,7 +9,7 @@ dashedName: what-are-the-different-types-of-tools-professional-developers-use Desenvolvedores profissionais dependem de uma variedade de ferramentas para aumentar a produtividade e a qualidade do código. Vamos aprender sobre essas ferramentas, incluindo as que parecem muito óbvias. -O primeiro entre as ferramentas são os computadores. Um computador é o ambiente principal de desenvolvimento. Pode ser um desktop pesado ou um laptop portátil com Windows, macOS ou Linux como sistema operacional. +A primeira ferramenta é o próprio computador. Um computador é o ambiente principal de desenvolvimento. Pode ser um desktop pesado ou um laptop portátil com Windows, macOS ou Linux como sistema operacional. Desenvolvedores profissionais frequentemente optam por computadores com poder de processamento rápido e bastante RAM para lidar com tarefas que exigem muitos recursos. @@ -21,7 +21,7 @@ Visual Studio Code (VS Code) é essencialmente um editor de código, mas também Outros editores de código são Sublime Text, Atom, Notepad++ e Brackets. -Quando você escreve código com editores de código e IDEs, você precisa acompanhar as alterações que faz neles. A ferramenta que permite rastrear essas mudanças é um sistema de controle de versão. +Quando você escreve código com editores de código e IDEs, precisa acompanhar as mudanças feitas nesse código. A ferramenta que permite rastrear essas mudanças é um sistema de controle de versão. Git é o sistema de controle de versão mais utilizado na comunidade de desenvolvimento. @@ -31,8 +31,8 @@ Gerenciadores de pacotes são outra ferramenta crítica. Eles ajudam os desenvol Exemplos de gerenciadores de pacotes populares são: -* NPM, Yarn e PNPM para JavaScript -* PIP para Python +* npm, Yarn e pnpm para JavaScript +* pip para Python * Composer para PHP * Maven para Java @@ -147,7 +147,7 @@ Pense em ferramentas que executam verificações automatizadas no código. --- -Sistemas de controle de versão +Sistemas de controle de versão. ### --feedback-- diff --git a/curriculum/challenges/portuguese/blocks/lecture-understanding-error-handling-and-health-checks/69f3046f4c0e76cbdd24858e.md b/curriculum/challenges/portuguese/blocks/lecture-understanding-error-handling-and-health-checks/69f3046f4c0e76cbdd24858e.md index eab7c4d7dc3..858afae0ed9 100644 --- a/curriculum/challenges/portuguese/blocks/lecture-understanding-error-handling-and-health-checks/69f3046f4c0e76cbdd24858e.md +++ b/curriculum/challenges/portuguese/blocks/lecture-understanding-error-handling-and-health-checks/69f3046f4c0e76cbdd24858e.md @@ -34,7 +34,7 @@ Você define esse middleware no final da sua pilha de middleware. O Express sabe que é um manipulador de erros porque ele tem quatro parâmetros — o novo, `err`, além dos parâmetros típicos `req`, `res` e `next` usados por outras funções middleware. -Em uma lição futura, você vai aprender mais sobre middleware de tratamento de erros e como ele se encaixa na pilha maior de middleware do Express. +Como você viu em uma lição anterior, o middleware de tratamento de erros se encaixa na pilha mais ampla de middleware do Express. ## Como tratar erros assíncronos diff --git a/curriculum/challenges/portuguese/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/6733affc29df1304e2c97e88.md b/curriculum/challenges/portuguese/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/6733affc29df1304e2c97e88.md index 3b4439259c2..52d4384a078 100644 --- a/curriculum/challenges/portuguese/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/6733affc29df1304e2c97e88.md +++ b/curriculum/challenges/portuguese/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/6733affc29df1304e2c97e88.md @@ -31,6 +31,8 @@ Você começa escrevendo a palavra-chave `class` seguida do nome da classe. Ao n O conteúdo dentro das chaves é conhecido como o corpo da classe. Aqui é onde o construtor e os métodos irão. +## Definindo construtores + O construtor é um método especial que é chamado automaticamente quando um novo objeto é criado a partir da classe. Normalmente é usado para inicializar as propriedades do objeto. Neste exemplo, você pode ver uma classe `Dog` com um construtor. @@ -45,6 +47,8 @@ class Dog { A palavra-chave `this` é usada aqui para se referir à instância atual da classe `Dog`, permitindo que você atribua a propriedade `name` ao objeto que está sendo criado. Você aprenderá mais sobre a palavra-chave `this` em uma lição futura. +## Definindo métodos + Abaixo do construtor, você pode ter o que são chamados de métodos. Métodos são funções definidas dentro de uma classe que executam ações ou operações. Eles são usados para definir comportamentos que instâncias da classe podem executar. Aqui está um exemplo de como adicionar um método chamado `bark` à classe `Dog`. @@ -63,6 +67,8 @@ class Dog { Quando o método `bark` for chamado a mensagem será registrada no console com o nome real que foi passado para ele. Se você criar uma instância `Dog` com o nome `"Buddy"`, chamar o método `bark()` nessa instância imprimirá `"Buddy says woof!"` no console. +## Instanciando uma classe + Depois de definir sua classe, você pode criar uma instância da classe com a palavra-chave `new`, o nome da classe e seus argumentos. Neste exemplo, criamos uma nova instância `Dog` com o nome `Gino` e então a atribuimos à variável `dog`. @@ -73,7 +79,9 @@ const dog = new Dog("Gino"); Quando você escreve `new Dog("Gino")` no seu código, o novo objeto é criado e o construtor é chamado automaticamente com os argumentos fornecidos. -Você pode então acessar essa propriedade usando a notação de ponto, como você pode ver na seguinte linha de código: +## Acessando propriedades e métodos + +Você pode então acessar a propriedade `name` usando a notação de ponto, como pode ver na seguinte linha de código: ```js console.log(dog.name); @@ -127,6 +135,8 @@ dog.bark(); ::: +## Usando expressões de classe + Como mencionado anteriormente, você também pode definir classes como uma expressão de classe. Aqui é onde a classe é anônima e atribuída a uma variável. Aqui está como o exemplo anterior fica como uma expressão de classe: diff --git a/curriculum/challenges/portuguese/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/673403ca2bb16658309e3632.md b/curriculum/challenges/portuguese/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/673403ca2bb16658309e3632.md index 7533646fceb..6f0342bf764 100644 --- a/curriculum/challenges/portuguese/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/673403ca2bb16658309e3632.md +++ b/curriculum/challenges/portuguese/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/673403ca2bb16658309e3632.md @@ -11,6 +11,8 @@ Você aprendeu que classes são como plantas que você pode usar para criar obje Esses blueprints precisam de uma forma geral de se referir ao objeto específico que está sendo criado, acessado ou modificado dentro do código. É exatamente para isso que a palavra-chave `this` é usada. Refere-se ao contexto onde o código deve ser executado. Se você usá-lo dentro de um método, o valor de `this` será uma referência ao objeto associado àquele método. Dessa forma, você pode acessar as propriedades e métodos do objeto dentro da classe e reutilizar o método em diferentes objetos. +## Construtores + Por exemplo, aqui temos uma classe `Dessert`. Desta vez, estamos definindo uma propriedade `hasPeanuts`. ```js @@ -33,6 +35,8 @@ this.hasPeanuts = hasPeanuts; Isso está no contexto do construtor mas você também pode usar a palavra-chave `this` dentro de outros métodos. +## Métodos + Esta é a nossa classe `Dessert` com algumas mudanças. Agora temos duas propriedades: `name` e `price`. ```js @@ -91,10 +95,16 @@ O nome e o preço do objeto atual (`brownie`) são substituídos na string. Tudo isso é graças à palavra-chave `this`, que lhe dá uma forma geral de se referir ao objeto atual dentro da classe. Isso permite que você reutilize o método em diferentes objetos. +## Funções e arrow functions + Isso está no contexto de métodos de objeto mas a palavra-chave `this` também terá um valor em funções independentes e funções arrow. +### Funções regulares + Seu valor dentro de uma função independente normalmente se refere ao objeto global (no modo não estrito) ou `undefined` (no modo estrito). +### Arrow functions + O valor da palavra-chave `this` é um pouco diferente em funções arrow. Funções arrow herdam o valor de `this` do escopo envolvente onde são definidas. Eles não criam sua própria ligação de `this`. Isso significa que o valor de `this` depende do contexto onde a arrow function é definida, não de onde ou como a arrow function é chamada. Isso torna as funções arrow úteis para callbacks ou para preservar o contexto. No entanto, por causa disso, o valor de `this` não se referirá ao objeto atual em métodos de objeto, então isso é algo que você deve ter em mente ao trabalhar com funções arrow. diff --git a/curriculum/challenges/portuguese/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5160.md b/curriculum/challenges/portuguese/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5160.md index 7412d8c0539..a2238b0a8f7 100644 --- a/curriculum/challenges/portuguese/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5160.md +++ b/curriculum/challenges/portuguese/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5160.md @@ -14,17 +14,17 @@ No entanto, por trás dessas diferenças, o processo de transformar uma ideia em 1. ## Identificando uma necessidade Os padrões começam com um atrito, como desenvolvedores esbarrando em um obstáculo, navegadores implementando o mesmo comportamento de formas incompatíveis, ou uma nova capacidade que a plataforma simplesmente ainda não suporta. Alguém, em algum lugar, fica frustrado o suficiente para registrar isso. Essa pessoa pode ser qualquer um; um desenvolvedor, uma grande empresa com uma necessidade de produto, ou um engenheiro dentro de uma equipe de navegador. O que importa nessa etapa não é autoridade, mas evidências e perguntas sobre se o problema é real e se pessoas suficientes estão enfrentando-o para justificar a atenção da plataforma web. -1. **Proposta e discussão inicial** - A ideia é registrada informalmente por meio de uma issue no GitHub, um documento curto ou um explicador que descreve o problema e esboça uma possível solução. Nessa fase, o objetivo não é produzir uma especificação finalizada, mas descobrir se o problema ressoa. Outros desenvolvedores o reconhecem? Os fornecedores de navegadores estão interessados? Existe uma solução óbvia ou várias concorrentes? No TC39, essa fase inicial corresponde ao estágio 0 e estágio 1. No W3C, geralmente ocorre informalmente em um Grupo da Comunidade antes que um Grupo de Trabalho formal seja criado. O WHATWG trata disso por meio de discussões abertas no GitHub em seus repositórios principais. O local varia, mas a função é a mesma. +1. ## Proposta e discussão inicial + A ideia é escrita informalmente por meio de uma issue no GitHub, um documento curto ou um explainer que descreve o problema e esboça uma possível solução. Nesta fase, o objetivo não é produzir uma especificação finalizada, mas descobrir se o problema ressoa. Outros desenvolvedores o reconhecem? Os fornecedores de navegadores estão interessados? Existe uma solução óbvia ou várias concorrentes? No TC39, essa fase inicial corresponde ao estágio 0 e estágio 1. No W3C, isso geralmente acontece informalmente em um grupo da comunidade antes que um grupo de trabalho formal seja criado. O WHATWG lida com isso por meio de discussões abertas no GitHub em seus repositórios principais. O local varia, mas a função é a mesma. -1. **Escrevendo a especificação** - Se a proposta ganha força, alguém ou uma pequena equipe precisa escrever a especificação real, ou spec. Uma spec não é um post de blog ou tutorial, mas um documento preciso e formal que descreve exatamente como um recurso deve se comportar em todas as situações possíveis. Casos extremos, condições de erro, interações com recursos existentes e implicações de segurança precisam ser pensados e registrados. +1. ## Escrevendo a especificação + Se a proposta ganhar força, alguém ou uma pequena equipe precisa escrever a especificação real, ou spec. Uma spec não é um post de blog ou um tutorial, mas um documento preciso e formal que descreve exatamente como um recurso deve se comportar em toda situação possível. Casos extremos, condições de erro, interações com recursos existentes e implicações de segurança precisam ser pensados e documentados. -1. **Revisão, objeção e iteração** - O rascunho é publicado e revisado publicamente, e pelos outros fornecedores de navegadores. É aqui que a maior parte do trabalho real acontece. Objeções são levantadas e a spec é revisada. Um recurso que um motor de navegador importante se recusa a implementar raramente se torna padrão, independentemente de seus méritos técnicos. Construir consenso nessa etapa pode levar muito tempo. Algumas propostas ficam paradas por anos enquanto os fornecedores negociam detalhes de design. Outras morrem completamente quando fica claro que não há acordo possível. +1. ## Revisão, objeção e iteração + O rascunho é publicado e revisado publicamente, e pelos outros fornecedores de navegadores. É aqui que a maior parte do trabalho real acontece. Objeções são levantadas e a spec é revisada. Um recurso que um motor de navegador importante se recusa a implementar raramente se torna um padrão, independentemente de seus méritos técnicos. Construir consenso nessa fase pode levar muito tempo. Algumas propostas ficam paradas por anos enquanto os fornecedores negociam detalhes de design. Outras morrem completamente quando fica claro que nenhum acordo é possível. -1. **Implementação e testes** - Quando a spec está estável o suficiente, os fornecedores de navegadores começam a implementá-la. Geralmente isso começa com uma flag de recurso, para que possa ser testada sem afetar usuários existentes. A implementação frequentemente revela problemas que a spec não antecipou, que então são enviados de volta aos editores para esclarecimento. Um conjunto de testes compartilhado verifica se todas as implementações realmente se comportam da mesma forma. Se Chrome, Firefox e Safari passam nos mesmos testes, a spec está funcionando. Se divergem, ou a spec está confusa, ou uma das implementações tem um bug. +1. ## Implementação e testes + Quando uma spec está estável o suficiente, os fornecedores de navegadores começam a implementá-la. Geralmente isso começa com uma feature flag, para que possa ser testada sem afetar os usuários existentes. A implementação frequentemente revela problemas que a spec não antecipou, que então são enviados de volta aos editores para esclarecimento. Um conjunto de testes compartilhado verifica se todas as implementações realmente se comportam da mesma forma. Se Chrome, Firefox e Safari passam nos mesmos testes, a spec está funcionando. Se divergirem, ou a spec está confusa ou uma das implementações tem um bug. 1. ## Finalização Quando múltiplas implementações independentes existem, os testes passam e a comunidade está satisfeita, o padrão é finalizado. No W3C isso significa alcançar o status de Recomendação. No TC39, significa chegar ao estágio 4, após o qual o recurso é incluído na próxima versão anual do ECMAScript. No WHATWG, não há um momento único de finalização, o padrão vivo simplesmente reflete o consenso atual, atualizado continuamente. O processo todo pode levar desde alguns meses para uma adição pequena e sem controvérsias até mais de uma década para algo complexo ou politicamente delicado. O CSS Grid, por exemplo, foi proposto pela primeira vez em 2011 e só foi lançado em todos os principais navegadores em 2017. Essa lacuna entre uma boa ideia e um padrão estável e universalmente suportado é onde a maior parte do trabalho da web aberta acontece silenciosamente. @@ -109,7 +109,7 @@ Por que um conjunto de testes compartilhado é importante durante a etapa de imp ## --answers-- -Para substituir a necessidade de uma especificação escrita. +Substituir a necessidade de uma especificação escrita. ### --feedback-- @@ -121,7 +121,7 @@ Para verificar que todas as implementações dos navegadores se comportam da mes --- -Para classificar o desempenho dos navegadores para fins de marketing. +Classificar o desempenho dos navegadores para fins de marketing. ### --feedback-- diff --git a/curriculum/challenges/portuguese/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5161.md b/curriculum/challenges/portuguese/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5161.md index 1c7e3a66478..5b5718d9647 100644 --- a/curriculum/challenges/portuguese/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5161.md +++ b/curriculum/challenges/portuguese/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5161.md @@ -13,23 +13,23 @@ O ciclo de vida de um recurso de padrão web está relacionado, mas em uma escal Pense no processo como o manual de regras, e no ciclo de vida como o que realmente acontece quando você joga o jogo. -1. **Proposta** - Todo recurso começa com um problema que alguém se importou o suficiente para registrar. Um desenvolvedor, um engenheiro de navegador ou uma empresa abre uma issue no GitHub ou um explainer descrevendo o que a web não consegue fazer atualmente e por que deveria. Nesta fase, a ideia é vaga, com mais perguntas do que respostas. O objetivo é simplesmente descobrir se mais alguém reconhece a mesma dificuldade. +1. ## Proposta + Toda feature começa com um problema que alguém se importou o suficiente para registrar. Um desenvolvedor, um engenheiro de navegador ou uma empresa abre uma issue no GitHub ou um explicador descrevendo o que a web não consegue fazer atualmente e por que deveria. Nesta fase, a ideia é vaga, com mais perguntas do que respostas. O objetivo é simplesmente descobrir se mais alguém reconhece a mesma dor. -1. **Incubação** - Se a proposta ressoa, ela entra em um período de discussão aberta e design inicial. Abordagens concorrentes são esboçadas, casos de uso são reunidos e a comunidade testa a ideia sob pressão. Muitas propostas morrem aqui, possivelmente porque o problema é muito específico ou nenhuma solução agrada a todos. As que sobrevivem emergem com uma forma mais clara e pelo menos algum interesse de fornecedores de navegador. +1. ## Incubação + Se a proposta ressoa, ela entra em um período de discussão aberta e design inicial. Abordagens concorrentes são esboçadas, casos de uso são reunidos e a comunidade testa a ideia sob pressão. Muitas propostas morrem aqui, possivelmente porque o problema é muito específico ou nenhuma solução satisfaz a todos. As que sobrevivem surgem com uma forma mais clara e pelo menos algum interesse de fornecedores de navegador por trás delas. -1. **Especificação** - Uma proposta que sobrevive é formalizada como uma especificação. Cada caso extremo, condição de erro e interação com recursos existentes precisa ser definido claramente. Este é o momento em que uma boa ideia encontra a realidade dura. Conceitos vagos precisam virar regras exatas que dois engenheiros independentes possam ler e implementar de forma idêntica. +1. ## Especificação + Uma proposta que sobrevive é redigida como uma especificação formal. Cada caso extremo, condição de erro e interação com recursos existentes precisa ser definido claramente. Este é o ponto onde uma boa ideia encontra a dura realidade. Conceitos vagos precisam se tornar regras exatas que dois engenheiros independentes possam ler e implementar de forma idêntica. -1. **Testes de interoperabilidade** - Antes que um recurso possa ser considerado estável, ele precisa se comportar da mesma forma em todos os navegadores. O conjunto W3C Web Platform Tests é a principal ferramenta para verificar isso. É uma bateria compartilhada de testes que Chrome, Firefox, Safari e outros executam contra suas implementações. Resultados divergentes significam que a especificação é ambígua ou que alguém tem um bug. Qualquer um dos casos precisa ser resolvido antes que o recurso avance. +1. ## Teste de interoperabilidade + Antes que uma feature possa ser considerada estável, ela precisa se comportar da mesma forma em todos os navegadores. O conjunto de testes W3C Web Platform Tests é a principal ferramenta para verificar isso. É uma bateria compartilhada de testes que Chrome, Firefox, Safari e outros executam contra suas implementações. Resultados divergentes significam que a especificação é ambígua ou que alguém tem um bug. Qualquer um dos dois deve ser resolvido antes que a feature avance. -1. **Finalização** - Quando múltiplas implementações independentes passam nos testes, o recurso é finalizado. Para o W3C, é uma recomendação; para o TC39, é estágio 4; e é uma entrada estável no padrão vivo do WHATWG. As flags são removidas e o recurso é lançado para os usuários. A partir desse ponto, ele se torna parte da plataforma web básica, algo em que todo desenvolvedor pode confiar indefinidamente. +1. ## Finalização + Quando múltiplas implementações independentes passam nos testes, a feature é finalizada. Para o W3C, é uma recomendação, para o TC39, é estágio 4, e é uma entrada estável no padrão vivo do WHATWG. As flags são removidas e a feature é lançada para os usuários. A partir desse ponto, ela se torna parte da plataforma web básica, algo em que todo desenvolvedor pode confiar indefinidamente. -1. **Descontinuação** - Nem todo padrão envelhece bem. Alguns recursos são substituídos por outros melhores, outros revelam implicações de segurança ou privacidade que não eram aparentes na época. Quando um recurso precisa ser removido, ele é formalmente descontinuado. Ou seja, continua suportado, mas marcado como algo que os desenvolvedores devem parar de usar. Eventualmente, ele é removido da especificação. A remoção dos navegadores é lenta e cautelosa, porque a promessa central da web é que páginas antigas continuem funcionando. Alguns recursos descontinuados permanecem nos navegadores por décadas apenas para garantir compatibilidade retroativa. +1. ## Descontinuação + Nem todo padrão envelhece bem. Algumas features são substituídas por outras melhores, outras revelam implicações de segurança ou privacidade que não eram aparentes na época. Quando uma feature precisa ser removida, ela é formalmente descontinuada. Ou seja, continua suportada mas marcada como algo que os desenvolvedores devem parar de usar. Eventualmente, é removida da especificação. A remoção dos navegadores é lenta e cautelosa, porque a promessa central da web é que páginas antigas continuem funcionando. Algumas features descontinuadas permanecem nos navegadores por décadas apenas por obrigação de compatibilidade retroativa. # --questions-- diff --git a/curriculum/challenges/portuguese/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5162.md b/curriculum/challenges/portuguese/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5162.md index f704ac55509..6b86b2ae719 100644 --- a/curriculum/challenges/portuguese/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5162.md +++ b/curriculum/challenges/portuguese/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5162.md @@ -9,26 +9,26 @@ dashedName: what-are-the-key-principles-that-web-standards-are-built-on Os padrões web não são apenas documentos técnicos, eles refletem um conjunto de valores sobre o que a web deve ser e para quem ela deve servir. Entender esses princípios ajuda você a ver não apenas como a web funciona, mas por que ela foi construída dessa forma. Vamos discutir esses princípios. -1. **Abertura** - Os padrões web são desenvolvidos de forma aberta e implementados sem royalties. Qualquer pessoa pode ler as especificações, qualquer pessoa pode criar um navegador, e nenhuma empresa pode cobrar taxas de licenciamento para implementar um padrão. Essa abertura é o que distingue a web de plataformas proprietárias e o que permite que pequenas equipes criem ferramentas que alcançam bilhões de pessoas sem pedir permissão a um controlador. +1. ## Abertura + Os padrões web são desenvolvidos de forma aberta e implementados sem royalties. Qualquer pessoa pode ler as especificações, qualquer pessoa pode criar um navegador, e nenhuma empresa pode cobrar taxas de licença para implementar um padrão. Essa abertura é o que distingue a web de plataformas proprietárias e o que permite que pequenas equipes criem ferramentas que alcançam bilhões de pessoas sem pedir permissão a um guardião. -1. **Acessibilidade** - A web foi projetada para ser utilizável por todos, independentemente da habilidade. A acessibilidade não é um complemento aos padrões web, ela está incorporada no design do HTML, CSS e no comportamento dos navegadores. As diretrizes WCAG do W3C estabelecem o padrão formal para o que significa ser acessível na prática. Um recurso que cria barreiras para pessoas que usam leitores de tela, navegação por teclado ou tecnologia assistiva é considerado deficiente por design, não apenas por ética. +1. ## Acessibilidade + A web foi projetada para ser utilizável por todos, independentemente da habilidade. A acessibilidade não é um complemento aos padrões web, ela está incorporada no design do HTML, CSS e no comportamento dos navegadores. As diretrizes WCAG do W3C estabelecem o padrão formal para o que significa ser acessível na prática. Um recurso que cria barreiras para pessoas que usam leitor de tela, navegação por teclado ou tecnologia assistiva é considerado deficiente por design, não apenas por ética. -1. **Interoperabilidade** - O princípio mais fundamental é que a web deve funcionar da mesma forma em todos os lugares. Uma página construída conforme o padrão deve se comportar idêntica no Chrome, Firefox e Safari, e no Windows, macOS, Linux, Android e iOS. Sem interoperabilidade, a web se fragmenta em uma coleção de experiências específicas de navegador, e os desenvolvedores são forçados a escrever a mesma coisa várias vezes. Todo padrão existe, em sua essência, para evitar isso. +1. ## Interoperabilidade + O princípio mais fundamental é que a web deve funcionar da mesma forma em todos os lugares. Uma página construída conforme o padrão deve se comportar de forma idêntica no Chrome, Firefox e Safari, e no Windows, macOS, Linux, Android e iOS. Sem interoperabilidade, a web se fragmenta em uma coleção de experiências específicas de navegador, e os desenvolvedores são forçados a escrever a mesma coisa várias vezes. Todo padrão existe, em sua essência, para evitar isso. -1. **Compatibilidade retroativa** - A web tem um compromisso quase absoluto de não quebrar coisas antigas. Uma página escrita em 1999 ainda deve ser renderizada em um navegador moderno, e os órgãos de padrões levam essa obrigação a sério ao projetar novos recursos. Por isso, novas capacidades são adicionadas por cima em vez de substituir o que veio antes. É uma restrição que às vezes frustra designers, mas também é o que torna a web uma plataforma singularmente durável. +1. ## Compatibilidade com versões anteriores + A web tem um compromisso quase absoluto de não quebrar coisas antigas. Uma página escrita em 1999 ainda deve renderizar em um navegador moderno, e os órgãos de padrões levam essa obrigação a sério ao projetar novos recursos. Por isso, novas capacidades são adicionadas em camadas sobre as anteriores, em vez de substituí-las. É uma restrição que às vezes frustra os designers, mas também é o que torna a web uma plataforma singularmente durável. -1. **Privacidade e segurança** - Os padrões modernos são revisados quanto às implicações de privacidade e segurança antes de serem lançados. Novas APIs que podem expor dados do usuário ou permitir rastreamento enfrentam uma análise rigorosa no processo de padronização. O princípio é que a plataforma deve proteger os usuários por padrão, e que a conveniência para desenvolvedores nunca deve custar a segurança do usuário. +1. ## Privacidade e segurança + Os padrões modernos são revisados quanto às implicações de privacidade e segurança antes de serem lançados. Novas APIs que possam expor dados do usuário ou permitir rastreamento enfrentam uma análise rigorosa no processo de padrões. O princípio é que a plataforma deve proteger os usuários por padrão, e que a conveniência para os desenvolvedores nunca deve custar a segurança do usuário. -1. **Camadas** - A web é construída em camadas distintas e compostas: HTML para estrutura, CSS para apresentação e JavaScript para comportamento. Os padrões são projetados para respeitar esses limites em vez de colapsá-los. Um recurso bem estruturado em camadas pode ser adotado de forma incremental. Uma página que não usa JavaScript ainda funciona, e um navegador que não suporta uma nova propriedade CSS ainda renderiza algo razoável. Essa separação de responsabilidades é o que dá resiliência à web. +1. ## Camadas + A web é construída em camadas distintas e compostas: HTML para estrutura, CSS para apresentação e JavaScript para comportamento. Os padrões são projetados para respeitar esses limites em vez de colapsá-los. Um recurso bem estruturado em camadas pode ser adotado incrementalmente. Uma página que não usa JavaScript ainda funciona, e um navegador que não suporta uma nova propriedade CSS ainda renderiza algo razoável. Essa separação de responsabilidades é o que dá resiliência à web. -1. **Aprimoramento progressivo** - Relacionado à camada está a ideia de que a web deve funcionar para todos, e depois melhorar para aqueles com navegadores ou dispositivos mais capazes. Um recurso padrão deve degradar-se de forma graciosa quando não suportado, não quebrar completamente. Esse princípio molda como novas propriedades CSS são especificadas, como APIs JavaScript lidam com capacidades ausentes e como os órgãos de padrões pensam sobre a lacuna entre navegadores modernos e os mais antigos ainda amplamente usados no mundo. +1. ## Aprimoramento progressivo + Relacionado à ideia de camadas está o conceito de que a web deve funcionar para todos e depois melhorar para quem tem navegadores ou dispositivos mais capazes. Um recurso padrão deve degradar-se de forma elegante quando não suportado, não quebrar completamente. Esse princípio molda como novas propriedades CSS são especificadas, como as APIs JavaScript lidam com capacidades ausentes e como os órgãos de padrões pensam sobre o gap entre navegadores modernos e os mais antigos ainda amplamente usados no mundo. # --questions-- diff --git a/curriculum/challenges/portuguese/blocks/lecture-user-interface-design-fundamentals/672baa97f2990e6631d522e7.md b/curriculum/challenges/portuguese/blocks/lecture-user-interface-design-fundamentals/672baa97f2990e6631d522e7.md index 19c5c2269e6..2a14e315060 100644 --- a/curriculum/challenges/portuguese/blocks/lecture-user-interface-design-fundamentals/672baa97f2990e6631d522e7.md +++ b/curriculum/challenges/portuguese/blocks/lecture-user-interface-design-fundamentals/672baa97f2990e6631d522e7.md @@ -9,6 +9,8 @@ dashedName: how-do-you-create-good-background-and-foreground-contrast-in-your-de **NOTA**: Alguns dos exemplos interativos podem usar CSS que você ainda não aprendeu. Não se preocupe em tentar entender todo o código. O objetivo dos exemplos é mostrar prévias desses conceitos de design para que você entenda melhor como as coisas funcionam. +## Entendendo o contraste + Primeiro, você pode precisar se familiarizar com contraste. Contraste é a diferença entre duas cores - ou o quão fácil é distingui-las. Cores com maior contraste serão mais visualmente distintas, enquanto cores com menor contraste serão mais visualmente semelhantes. Por exemplo, preto e branco têm uma relação de contraste muito alta. Enquanto o azul claro e o roxo claro têm menos contraste. @@ -53,6 +55,8 @@ Cores com maior contraste serão mais visualmente distintas, enquanto cores com ::: +### Aplicando contraste ao texto + Claro, nesses exemplos a distinção pode ficar mais clara por causa do layout. Mas e quanto a aplicar essas cores ao texto? Você pode ter o texto preto de alto contraste em um fundo branco. E o texto roxo de baixo contraste em um fundo azul. :::interactive_editor @@ -96,7 +100,9 @@ Claro, nesses exemplos a distinção pode ficar mais clara por causa do layout. ::: -Mas como você determina o que é um contraste "bom o suficiente"? Você não pode basear isso apenas em como o texto parece para você, pois cada usuário terá uma experiência diferente. Felizmente, as Diretrizes de Acessibilidade para Conteúdo Web, ou WCAG, fornecem um padrão para isso. +### Padrões de contraste WCAG + +Mas como você determina o que é um contraste "bom o suficiente"? Você não pode basear isso apenas em como o texto parece para você, pois cada usuário terá uma experiência diferente. Felizmente, as Diretrizes de Acessibilidade para Conteúdo Web, ou WCAG, fornecem um padrão para isso. Texto com uma proporção de contraste de 4.5:1 é considerado o padrão AA, que é o mínimo necessário que você deve seguir para ser acessível para a maioria dos usuários. Texto com uma relação de contraste de 7:1 é considerado o padrão AAA e garante o melhor nível de acessibilidade. @@ -141,9 +147,11 @@ Texto com uma proporção de contraste de 4.5:1 é considerado o padrão AA, que ::: +### Comparando taxas de contraste altas e baixas + Existem vários sites que podem verificar a relação de contraste entre duas cores, mas a maioria dos navegadores permite que você faça isso diretamente nas ferramentas de desenvolvedor do seu site. -Vamos dar uma olhada em mais alguns exemplos de contrast ratio para entender melhor o conceito. +Vamos dar uma olhada em mais alguns exemplos de contrast ratio para entender melhor o conceito. Aqui está um exemplo de texto preto em um fundo branco que tem uma relação de contraste de 21:1. @@ -221,8 +229,12 @@ Este exemplo atende mais do que o padrão AAA. Agora, vamos dar uma olhada no te Este exemplo tem uma relação de contraste de 1.48:1 que nem sequer atende ao padrão AA. +## Ajustando propriedades de cor + Como você pode corrigir isso? Bem, há três aspectos que impactam a relação de contraste. +### Ajustando a matiz + O primeiro é o matiz, que representa o tipo geral de cor, como vermelho, azul e laranja. Vamos mudar para um matiz que esteja mais distante do azul. Neste caso, vamos usar vermelho. :::interactive_editor @@ -267,6 +279,8 @@ O primeiro é o matiz, que representa o tipo geral de cor, como vermelho, azul e ::: +### Ajustando a saturação + Infelizmente, essa alteração trouxe a relação de contraste apenas para 1,49:1, o que significa que você precisa alterar a saturação ou a "quantidade" de cor presente. Vamos aumentar a quantidade de vermelho no texto. Isso nos aproxima muito mais do objetivo, com uma relação de contraste de 3,54:1. :::interactive_editor @@ -325,6 +339,8 @@ Infelizmente, essa alteração trouxe a relação de contraste apenas para 1,49: ::: +### Ajustando a luminosidade + No entanto, você pode potencialmente chegar ainda mais perto alterando o último valor, que é lightness. A claridade representa a quantidade de branco presente na cor. Vamos diminuir a luminosidade do vermelho. Agora há um vermelho muito mais escuro contra o fundo azul claro, o que traz a relação de contraste para 10,34:1. @@ -439,7 +455,7 @@ Pense em como a lição define contraste em relação às cores. ## --text-- -De acordo com as Diretrizes de Acessibilidade para Conteúdo Web (WCAG), qual é a relação mínima de contraste para o texto atender ao padrão AA? +De acordo com as Diretrizes de Acessibilidade para Conteúdo Web (WCAG), qual é a relação mínima de contraste para o texto atender ao padrão AA? ## --answers-- @@ -475,11 +491,11 @@ Lembre-se dos números específicos mencionados para diferentes padrões de aces ## --text-- -Qual dos seguintes NÃO é mencionado como um aspecto que impacta a relação de contraste? +Qual dos seguintes NÃO é mencionado como um aspecto que impacta a relação de contraste? ## --answers-- -Hue +Matiz ### --feedback-- @@ -495,7 +511,7 @@ Lembre-se dos três aspectos discutidos na lição que podem ser ajustados para --- -Claridade +Luminosidade ### --feedback-- diff --git a/curriculum/challenges/portuguese/blocks/lecture-what-is-css/672acc100d59d24da7b4e09c.md b/curriculum/challenges/portuguese/blocks/lecture-what-is-css/672acc100d59d24da7b4e09c.md index 0d47c7f8066..57e445a988b 100644 --- a/curriculum/challenges/portuguese/blocks/lecture-what-is-css/672acc100d59d24da7b4e09c.md +++ b/curriculum/challenges/portuguese/blocks/lecture-what-is-css/672acc100d59d24da7b4e09c.md @@ -7,10 +7,14 @@ dashedName: what-are-the-different-types-of-css-combinators # --interactive-- +## Combinadores CSS + Combinadores CSS são usados para definir a relação entre seletores em CSS. Eles ajudam na seleção de elementos com base em sua relação com outros elementos, o que permite uma estilização mais precisa e eficiente. Discutiremos alguns combinadores CSS principais e seus casos de uso, começando com o combinador descendente. +### Combinador descendente + Um combinador descendente é usado para selecionar elementos correspondentes ao segundo seletor se eles estiverem aninhados dentro de um elemento ancestral que corresponde ao primeiro seletor. Um ancestral pode ser um pai, avô ou qualquer ancestral mais acima na árvore do documento. Para entender melhor como isso funciona, vamos dar uma olhada em um exemplo. @@ -42,6 +46,8 @@ Neste caso, o `figure` seria o pai e o `img` seria o filho. Se você tivesse várias imagens dentro de um elemento `figure`, usar o combinador descendente seria uma boa maneira de aplicar uma borda preta sólida ao redor de cada uma dessas imagens. +### Combinador filho + Outro tipo de combinador seria o combinador filho. O combinador filho (`>`) em CSS é usado para selecionar elementos que são filhos diretos de um elemento pai especificado. @@ -102,6 +108,8 @@ No exemplo acima, estamos direcionando apenas o filho direto da classe `containe Porque os outros dois elementos de parágrafo estão aninhados dentro de elementos `div`, eles não são considerados filhos diretos da classe `container` e não receberão a cor do texto azul. +### Combinador irmão imediato + Outro combinador comum seria o combinador de próximo-irmão. O combinador next-sibling (`+`) em CSS seleciona um elemento que segue imediatamente um elemento irmão especificado. Este combinador é útil quando você quer aplicar estilos a um elemento que segue diretamente outro elemento, permitindo uma estilização direcionada com base na posição do elemento em relação aos seus irmãos. @@ -150,6 +158,8 @@ img + figcaption { Neste exemplo, o combinador next-sibling (`+`) seleciona o elemento `figcaption` que segue imediatamente o elemento `img`. A regra CSS aplicada adiciona uma `4px solid black border` ao redor do `figcaption`. +### Combinador irmãos subsequentes + Outro combinador comum é o combinador subsequent-sibling. O combinador subsequent-sibling (`~`) em CSS seleciona todos os irmãos de um elemento especificado que vêm depois dele. @@ -202,6 +212,8 @@ Neste exemplo, todos os elementos de parágrafo que seguem o elemento `h2` terã O combinador subsequent-sibling (`~`) seleciona todos os irmãos parágrafos que aparecem após o elemento `h2`, independentemente de serem irmãos imediatos. +## Por que os combinadores CSS são importantes + Em conclusão, entender e usar vários combinadores CSS permite que você aplique estilos precisos aos seus elementos HTML, aumentando o controle e a flexibilidade do seu design. Dominando esses seletores, você pode criar regras de estilo mais sofisticadas e direcionadas que melhoram tanto a aparência quanto a funcionalidade das suas páginas web. diff --git a/curriculum/challenges/portuguese/blocks/lecture-working-with-code-editors-and-ides/672d26269456511aa3db614d.md b/curriculum/challenges/portuguese/blocks/lecture-working-with-code-editors-and-ides/672d26269456511aa3db614d.md index d153627e634..eb27534eaa2 100644 --- a/curriculum/challenges/portuguese/blocks/lecture-working-with-code-editors-and-ides/672d26269456511aa3db614d.md +++ b/curriculum/challenges/portuguese/blocks/lecture-working-with-code-editors-and-ides/672d26269456511aa3db614d.md @@ -7,25 +7,25 @@ dashedName: what-is-a-code-editor-and-ide # --description-- -Você pode pensar que essas são a mesma coisa, mas não exatamente. Um editor de código é qualquer aplicação que permite editar arquivos de código. Um IDE, ou Ambiente de Desenvolvimento Integrado, é uma aplicação completa que permite compilar, executar e depurar seu código enquanto você o edita. +Você pode pensar que são a mesma coisa, mas não é bem assim. Um editor de código é qualquer aplicação que permite editar arquivos de código. Um IDE, ou ambiente de desenvolvimento integrado, é uma aplicação completa que permite compilar, executar e depurar seu código enquanto você o edita. -Talvez alguns exemplos possam ser úteis. +Alguns exemplos vão ajudar. Primeiro, vamos considerar algumas IDEs populares. Visual Studio é um ambiente de desenvolvimento integrado da Microsoft que oferece um conjunto completo de ferramentas para construir, depurar e implantar aplicações em várias plataformas. -Outra IDE é XCode. Xcode é um ambiente de desenvolvimento integrado da Apple projetado para criar, codificar e depurar aplicações para macOS, iOS, watchOS e tvOS. +Outro IDE é o Xcode. O Xcode é um ambiente de desenvolvimento integrado da Apple projetado para criar, codificar e depurar aplicações para macOS, iOS, watchOS e tvOS. -E outra IDE seria o Android Studio. Android Studio é um ambiente de desenvolvimento integrado do Google especificamente projetado para construir, depurar e testar aplicações Android. +O Android Studio, desenvolvido pelo Google, é um ambiente de desenvolvimento integrado especificamente projetado para construir, depurar e testar aplicações Android. Esses são apenas alguns exemplos de IDEs. Agora, vamos dar uma olhada em alguns editores de código populares. Visual Studio Code é um editor de código leve e open-source da Microsoft que suporta uma ampla variedade de linguagens de programação e oferece recursos como depuração, realce de sintaxe e controle de versão por meio de extensões. -Outro editor popular seria o Sublime Text. Sublime Text é um editor de texto rápido e versátil conhecido por sua interface elegante, recursos poderosos e suporte para uma ampla variedade de linguagens de programação através de realce de sintaxe personalizável e plugins. +Para uma experiência de edição rápida e versátil, o Sublime Text oferece uma interface elegante e suporte para uma ampla variedade de linguagens de programação por meio de realce de sintaxe personalizável e plugins. -E outro é o Notepad++. Este é um editor gratuito, de código aberto, de texto e código-fonte para Windows que oferece realce de sintaxe, dobramento de código e uma variedade de plugins para aumentar a produtividade e a personalização. +Usuários do Windows também podem usar o Notepad++, um editor de texto e código fonte gratuito e de código aberto que oferece realce de sintaxe, dobramento de código e uma variedade de plugins para aumentar a produtividade e personalização. -Você pode ter notado como os editores de código focam principalmente no conteúdo de texto do arquivo, onde as IDEs expõem várias ferramentas para gerenciar seu código. +Você pode ter notado como os editores de código focam principalmente no conteúdo de texto do arquivo, enquanto os IDEs expõem várias ferramentas para gerenciar seu código. Estes exemplos são todos programas locais que você pode executar no seu computador, mas também existem editores baseados na nuvem que você pode usar. @@ -35,11 +35,11 @@ Vamos dar uma olhada em alguns editores baseados na nuvem. Replit é uma plataforma online que fornece um ambiente colaborativo para programação, permitindo que os usuários escrevam, executem e compartilhem código em várias linguagens de programação diretamente de um navegador web. -Outro editor popular baseado em nuvem é o GitHub Codespaces. Este é um ambiente de desenvolvimento baseado na nuvem que fornece acesso instantâneo a um editor de código totalmente configurado e ferramentas de desenvolvimento diretamente do GitHub, permitindo codificação e colaboração contínuas. +Outro editor popular baseado na nuvem é o GitHub Codespaces. Este é um ambiente de desenvolvimento na nuvem que fornece acesso instantâneo a um editor de código totalmente configurado e ferramentas de desenvolvimento diretamente do GitHub, permitindo codificação e colaboração sem interrupções. -E outro é o Ona. Ona é um ambiente de desenvolvimento baseado em nuvem que se integra com GitHub e GitLab, oferecendo espaços de trabalho instantâneos e personalizáveis para codificação, construção e depuração diretamente do seu navegador. +O Ona integra-se com GitHub e GitLab para fornecer espaços de trabalho instantâneos e personalizáveis para codificação, construção e depuração diretamente do seu navegador. -E há muitas outras opções. Algumas opções, como Visual Studio Code, são altamente extensíveis e podem trabalhar com vários tipos de projetos e linguagens diferentes. Outras opções podem ser especificamente adaptadas para um pequeno subconjunto de idiomas ou tipos de projeto. +E há muitas outras opções. Algumas opções, como o Visual Studio Code, são altamente extensíveis e podem funcionar com muitos tipos de projetos e linguagens. Outras opções podem ser especificamente adaptadas a um pequeno subconjunto de linguagens ou tipos de projetos. O aplicativo que você usa pode ser diferente para projetos específicos. Você deve explorar as opções para ver o que funcionará melhor para suas necessidades. diff --git a/curriculum/challenges/portuguese/blocks/lecture-working-with-code-editors-and-ides/672d45583fd75a504136fbbb.md b/curriculum/challenges/portuguese/blocks/lecture-working-with-code-editors-and-ides/672d45583fd75a504136fbbb.md index 0a4c633e315..9d887498ec7 100644 --- a/curriculum/challenges/portuguese/blocks/lecture-working-with-code-editors-and-ides/672d45583fd75a504136fbbb.md +++ b/curriculum/challenges/portuguese/blocks/lecture-working-with-code-editors-and-ides/672d45583fd75a504136fbbb.md @@ -1,17 +1,17 @@ --- id: 672d45583fd75a504136fbbb -title: Como Instalar o Visual Studio Code no Seu Computador +title: Como instalar o Visual Studio Code no seu computador challengeType: 19 dashedName: how-to-install-visual-studio-code-onto-your-computer --- # --description-- -Para instalar o VS Code, você deve visitar o site deles para obter o instalador apropriado para o seu sistema operacional. Certifique-se de visitar o site do VS Code e não o site do Visual Studio. +Para instalar o VS Code, você deve visitar o site do VS Code para obter o instalador apropriado para seu sistema operacional. Certifique-se de visitar o site do VS Code, e não o site do Visual Studio. -Para Windows, você pode baixar um instalador EXE. Depois de baixá-lo, execute o arquivo e o assistente de instalação irá guiá-lo pelo processo de instalação. +No Windows, você pode baixar um instalador EXE. Depois de baixá-lo, execute o arquivo, e o assistente de instalação vai guiá-lo pelo processo. -Para Mac, você pode baixar um arquivo zip que contém um `.app` que você pode executar. Você também pode instalar o VS Code via homebrew. +No Mac, você pode baixar um arquivo `.zip`, que contém um `.app` que você pode executar. Você também pode instalar o VS Code via Homebrew. Abra o app Terminal no seu Mac e execute o seguinte comando: diff --git a/curriculum/challenges/portuguese/blocks/lecture-working-with-code-editors-and-ides/672d45651d83b450801efb3a.md b/curriculum/challenges/portuguese/blocks/lecture-working-with-code-editors-and-ides/672d45651d83b450801efb3a.md index 8c73dda966e..80e25c37940 100644 --- a/curriculum/challenges/portuguese/blocks/lecture-working-with-code-editors-and-ides/672d45651d83b450801efb3a.md +++ b/curriculum/challenges/portuguese/blocks/lecture-working-with-code-editors-and-ides/672d45651d83b450801efb3a.md @@ -9,21 +9,21 @@ dashedName: how-to-create-a-project-and-run-your-code-locally-in-vs-code Para começar, você deve saber que o VS Code considera projetos como "workspaces". O workspace é qualquer diretório que você abriu no VS Code. -Para começar, você precisará usar uma interface de linha de comando para criar um novo diretório para o seu novo projeto. Um diretório é outro nome para a pasta. +Para começar, você precisará usar uma interface de linha de comando para criar uma nova pasta para seu novo projeto. Um diretório é outro nome para pasta. -Interfaces de linha de comando, ou CLI para abreviar, permitem que você interaja com seu sistema operacional por meio de comandos baseados em texto. Você aprenderá mais sobre essas ferramentas em lições futuras. +Interfaces de linha de comando, ou CLIs para abreviar, permitem que você interaja com seu sistema operacional por meio de comandos baseados em texto. Você aprenderá mais sobre essas ferramentas em lições futuras. Se você estiver no Windows, pode usar o Command Prompt ou PowerShell. Se você estiver em um Mac, pode abrir o aplicativo Terminal. -Uma vez que a linha de comando esteja aberta, navegue até o diretório home digitando o comando `cd ~` e pressionando `enter` no seu teclado. Então digite o comando `mkdir my-project` e pressione `enter`. `mkdir`, ou "make directory", é o comando usado para criar um novo diretório. Você deve então abrir seu novo diretório com o VS Code. +Uma vez que a linha de comando esteja aberta, navegue até seu diretório home. No Prompt de Comando, digite `cd /d %USERPROFILE%` e pressione `Enter` no seu teclado. No PowerShell ou no Terminal do macOS, digite `cd ~` e pressione `Enter`. Depois digite o comando `mkdir my-project` e pressione `Enter`. `mkdir`, ou "make directory", é o comando usado para criar um novo diretório. Você deve então abrir seu novo diretório com o VS Code. -Também existem algumas outras formas gráficas de criar um novo diretório. +Também existem outras formas de abrir um diretório no VS Code. Dependendo do seu sistema operacional, você pode ter um menu de contexto (ou opção de clique direito) para abrir o VS Code diretamente do seu explorador de arquivos. Você também pode optar por clicar duas vezes no aplicativo VS Code. Se você se sentir confortável com a linha de comando, pode executar o comando `code /path/to/folder`. Uma vez aberto, você deve ver uma nova área de trabalho em branco. -Para criar um novo arquivo, clique no menu `File` no canto superior esquerdo e selecione `New File...`. Então nomeie seu arquivo `index.html` e clique em `Save`. +Para criar um novo arquivo, clique no menu `File` no canto superior esquerdo e selecione `New File...`. Depois nomeie seu arquivo como `index.html` e clique em `Save`. Agora você deve ver seu novo arquivo na aba do explorador. Tente adicionar algum HTML ao seu arquivo `index.html`. @@ -31,15 +31,15 @@ Agora você pode estar tentado a abrir o arquivo HTML diretamente no seu navegad Em vez disso, você deve colocar seu arquivo HTML atrás de um servidor web adequado. Isso pode parecer uma tarefa intimidadora se você for novo em programação, mas na verdade existe uma maneira de fazer isso diretamente do VS Code. -Você precisará primeiro instalar a extensão *Live Server*, que está disponível gratuitamente no marketplace. +Você precisará primeiro instalar a extensão Live Server, que está disponível gratuitamente no marketplace. -Clique na aba de extensões no canto esquerdo e digite `Live Server` na barra de pesquisa. +Clique na aba Extensões na barra lateral esquerda e digite `Live Server` na barra de busca. -Depois de instalar isso, você deverá ver um botão `Go live` na sua barra de status. Certifique-se de que seu arquivo HTML esteja aberto e então clique nele. +Depois de instalar, você deve ver um botão `Go Live` na sua barra de status. Certifique-se de que seu arquivo HTML esteja aberto e então clique nele. -Sua nova página deve abrir automaticamente em uma nova aba no navegador. Se não funcionar, você pode ir diretamente para `http://localhost:5500/` +Sua nova página deve abrir automaticamente em uma nova aba no navegador. Se não abrir, você pode acessar diretamente `http://localhost:5500/`. -Parabéns! Você agora configurou seu próprio projeto no VS Code e pode visualizar suas alterações com live server. +Parabéns! Agora você configurou seu próprio projeto no VS Code e pode visualizar suas alterações com o Live Server. # --questions-- @@ -57,7 +57,7 @@ A lição menciona como o VS Code define um workspace em relação a diretórios --- -O diretório do qual você abriu o VS Code. +O diretório que você abriu no VS Code. --- diff --git a/curriculum/challenges/portuguese/blocks/lecture-working-with-code-editors-and-ides/672d456f4ac35950b300e93f.md b/curriculum/challenges/portuguese/blocks/lecture-working-with-code-editors-and-ides/672d456f4ac35950b300e93f.md index 07d195836d8..38152a89d57 100644 --- a/curriculum/challenges/portuguese/blocks/lecture-working-with-code-editors-and-ides/672d456f4ac35950b300e93f.md +++ b/curriculum/challenges/portuguese/blocks/lecture-working-with-code-editors-and-ides/672d456f4ac35950b300e93f.md @@ -9,21 +9,21 @@ dashedName: what-are-several-useful-keyboard-shortcuts-for-maximizing-productivi Você provavelmente já está familiarizado com alguns dos atalhos básicos, que são herdados do seu sistema operacional. Atalhos como `Ctrl + S` para salvar, `Ctrl + C` para copiar e `Ctrl + V` para colar funcionam todos no VS Code. -Mas há alguns que são específicos da aplicação e ainda podem aumentar sua produtividade. Vale notar que alguns desses atalhos podem variar conforme o sistema operacional. +Mas existem alguns que são específicos da aplicação e ainda podem aumentar sua produtividade. Vale lembrar que alguns desses atalhos podem variar conforme o sistema operacional. -Por exemplo, `Shift + Alt + F` executará seu formatador configurado (como prettier, para um projeto JavaScript) no arquivo atualmente aberto. +Por exemplo, `Shift + Alt + F` executa o formatador configurado (como o Prettier, para um projeto em JavaScript) no arquivo aberto no momento. -Ou `Ctrl + Shift + F` (Windows) ou `Cmd + Shift + F` (Mac) para pesquisar o conteúdo de texto de todos os arquivos no seu espaço de trabalho. Então `Ctrl + Shift + H` (Windows) ou `Cmd + Shift + H` (Mac), se você quiser executar uma busca e substituição. +Use `Ctrl + Shift + F` (Windows/Linux) ou `Cmd + Shift + F` (macOS) para buscar o conteúdo de texto de todos os arquivos no seu espaço de trabalho. Depois, use `Ctrl + Shift + H` (Windows/Linux) ou `Cmd + Shift + H` (macOS) se quiser executar um buscar e substituir. -Se você precisar remover uma linha, `Ctrl + Shift + K` (Windows) ou `Cmd + Shift + K` (Mac) irá deletá-la. +Se precisar excluir uma linha, `Ctrl + Shift + K` (Windows/Linux) ou `Cmd + Shift + K` (macOS) fará isso. -Precisa de mais espaço para todo o seu código? `Ctrl + B` (Windows) ou `Cmd + B` (Mac) ocultarão a barra lateral - que contém a lista de arquivos e o menu de extensões. +Quer mais espaço para todo seu código? `Ctrl + B` (Windows) ou `Cmd + B` (Mac) oculta a barra lateral, que contém a lista de arquivos e o menu de extensões. -Ou talvez você simplesmente não consiga ver seu código? `Ctrl + plus` (Windows) ou `Cmd + plus` (Mac) aumentará a escala do editor e `Ctrl + minus` (Windows) ou `Cmd + minus` (Mac) a diminuirá. +Ou talvez você não consiga ver seu código direito? `Ctrl + Plus` (Windows) ou `Cmd + Plus` (Mac) aumenta a escala do editor, e `Ctrl + Minus` (Windows) ou `Cmd + Minus` (Mac) diminui. -Outro recurso útil no VS Code é a edição em múltiplas linhas, que permite fazer alterações em várias linhas ao mesmo tempo. Por exemplo, você pode colocar múltiplos cursores usando `Ctrl + Alt + down` e `Ctrl + Alt + up` (Windows/Linux) ou `Option + Command + down` e `Option + Command + up` (Mac) para estender o cursor para linhas consecutivas. Você também pode pressionar e segurar `Alt` (Windows/Linux) ou `Option` (Mac) e clicar para adicionar cursores em linhas separadas onde precisar. Uma vez que os cursores estejam posicionados, tudo o que você digitar ou apagar será aplicado a todos esses locais simultaneamente — o que pode economizar muito tempo ao trabalhar com código repetitivo. +Outro recurso útil no VS Code é a edição em múltiplas linhas, que permite fazer alterações em várias linhas ao mesmo tempo. Por exemplo, você pode colocar múltiplos cursores usando `Ctrl + Alt + Down` e `Ctrl + Alt + Up` (Windows/Linux) ou `Option + Cmd + Down` e `Option + Cmd + Up` (Mac) para estender o cursor para linhas consecutivas. Também pode pressionar e segurar `Alt` (Windows/Linux) ou `Option` (Mac) e clicar para adicionar cursores em linhas separadas onde precisar. Depois que os cursores estiverem posicionados, tudo que você digitar ou excluir será aplicado simultaneamente em todos esses locais — o que pode economizar muito tempo ao trabalhar com código repetitivo. -Finalmente, se você esquecer qualquer um desses atalhos, você sempre tem `Ctrl + Shift + P` (Windows) ou `Cmd + Shift + P` (Mac), que abre a paleta de comandos para você selecionar o que precisar. +Por fim, se esquecer algum desses atalhos, você sempre pode usar `Ctrl + Shift + P` (Windows/Linux) ou `Cmd + Shift + P` (macOS), que abre a paleta de comandos para você selecionar o que precisar. Com esse conhecimento e talvez um pouco de prática, você está no caminho certo para se tornar um usuário avançado do VS Code. diff --git a/curriculum/challenges/portuguese/blocks/lecture-working-with-code-editors-and-ides/672d457bcdd8b350ec2b6254.md b/curriculum/challenges/portuguese/blocks/lecture-working-with-code-editors-and-ides/672d457bcdd8b350ec2b6254.md index 3299a72f34d..e41ab5433a4 100644 --- a/curriculum/challenges/portuguese/blocks/lecture-working-with-code-editors-and-ides/672d457bcdd8b350ec2b6254.md +++ b/curriculum/challenges/portuguese/blocks/lecture-working-with-code-editors-and-ides/672d457bcdd8b350ec2b6254.md @@ -7,25 +7,25 @@ dashedName: what-are-some-good-vs-code-extensions-you-can-use-in-your-editor # --description-- -*Better Comments* é uma extensão que oferece realce especial para comentários específicos no código. Por exemplo, ele destacará comentários "TODO", assim como a sintaxe para indicar perguntas ou avisos. +Better Comments é uma extensão que oferece destaque especial para comentários de código específicos. Por exemplo, ela destaca comentários "TODO", assim como sintaxe para indicar perguntas ou avisos. -*Code Spell Checker* oferece indicação quando você escreveu algo incorretamente no seu código. Porque foi projetado para arquivos de código, ele levará em conta coisas como camel case. +Code Spell Checker sinaliza palavras que estão escritas incorretamente no seu código. Como foi projetada para arquivos de código, ela leva em conta coisas como camel case. -*Error Lens* vai ajudar você a identificar quaisquer erros destacados no seu código. Ao invés de depender do sublinhado que o VS Code mostra por padrão, esta extensão destaca a linha inteira e exibe a mensagem de erro. +Error Lens torna os erros no seu código mais difíceis de passar despercebidos. Em vez de depender do sublinhado que o VS Code mostra por padrão, essa extensão destaca a linha inteira e exibe a mensagem de erro. -*Indent Rainbow* adiciona cor aos seus diferentes níveis de indentação. Em combinação com a coloração nativa de pares de colchetes do VS Code, isso pode ajudar dramaticamente a identificar em qual escopo seu código está. +Indent Rainbow adiciona cor aos seus diferentes níveis de indentação. Em combinação com a colorização nativa de pares de colchetes do VS Code, isso pode ajudar muito a identificar em qual escopo seu código está. -Ou talvez você esteja procurando algo um pouco mais prático? Considere um assistente de IA, como *GitHub Copilot* ou *Tabnine*, para oferecer sugestões inline enquanto você escreve seu código. +Ou talvez você esteja procurando algo um pouco mais prático? Considere um assistente de IA, como GitHub Copilot ou Tabnine, para oferecer sugestões inline enquanto você escreve seu código. -Um pacote de ícones, como *VS Code Great Icons*, pode ajudar a deixar sua árvore de arquivos mais limpa e fácil de interpretar rapidamente. E uma extensão como *Colorize* pode ajudar você a entender os valores nas suas propriedades CSS. +Um pacote de ícones, como VS Code Great Icons, pode ajudar a deixar sua árvore de arquivos mais limpa e fácil de analisar rapidamente. E uma extensão como Colorize pode ajudar você a entender os valores nas suas propriedades CSS. -Você também vai querer extensões específicas para cada linguagem para seus projetos. Se você está usando JavaScript, provavelmente vai querer *ESLint* e *Prettier* para lintar e formatar seu código. Se você estiver usando TypeScript, pode querer *Pretty TypeScript Errors* para mensagens mais fáceis de ler. +Você também vai querer extensões específicas para a linguagem dos seus projetos. Se estiver usando JavaScript, provavelmente vai querer ESLint e Prettier para lintar e formatar seu código. Se estiver usando TypeScript, pode querer Pretty TypeScript Errors para mensagens mais fáceis de ler. -Finalmente, você também pode se divertir um pouco com seu editor. *VS Code Pets* oferece animais virtuais configuráveis para fazer companhia enquanto você elimina alguns bugs. +Por fim, você também pode se divertir um pouco com seu editor. VS Code Pets oferece pets virtuais configuráveis para fazer companhia enquanto você elimina alguns bugs. -*Power Mode* criará efeitos chamativos quando você alcançar um "combo" alto o suficiente escrevendo mais código. +Power Mode cria efeitos chamativos quando você alcança um "combo" alto o suficiente escrevendo mais código. -*Discord Presence* permitirá que você mostre no que está trabalhando para todos os seus amigos. +Discord Presence permite que você mostre para todos os seus amigos no que está trabalhando. E há muitas outras extensões por aí. Sinta-se à vontade para explorar o marketplace de extensões e ver o que funciona melhor para você. @@ -33,7 +33,7 @@ E há muitas outras extensões por aí. Sinta-se à vontade para explorar o mark ## --text-- -Qual recurso a extensão "Better Comments" oferece no VS Code? +Que recurso a extensão Better Comments oferece no VS Code? ## --answers-- @@ -69,7 +69,7 @@ A lição menciona como esta extensão afeta certos tipos de comentários. ## --text-- -Qual extensão do VS Code é descrita como ajudando a capturar erros destacados no seu código exibindo a mensagem de erro em toda a linha? +Qual extensão do VS Code destaca a linha inteira e exibe a mensagem de erro inline, em vez de depender do sublinhado padrão? ## --answers-- @@ -105,7 +105,7 @@ A lição menciona uma extensão que melhora a visibilidade de erros além do su ## --text-- -Qual recurso exclusivo a extensão "VS Code Pets" oferece? +Que recurso único a extensão VS Code Pets oferece? ## --answers-- diff --git a/curriculum/challenges/portuguese/blocks/lecture-working-with-css-flexbox/672aa7f7284b235f46f7d4e9.md b/curriculum/challenges/portuguese/blocks/lecture-working-with-css-flexbox/672aa7f7284b235f46f7d4e9.md index 7bc0d81a3ec..17e67d2de71 100644 --- a/curriculum/challenges/portuguese/blocks/lecture-working-with-css-flexbox/672aa7f7284b235f46f7d4e9.md +++ b/curriculum/challenges/portuguese/blocks/lecture-working-with-css-flexbox/672aa7f7284b235f46f7d4e9.md @@ -319,7 +319,7 @@ O eixo principal é sempre horizontal, enquanto o eixo cruzado é sempre vertica ### --feedback-- -Pense na distribuição dos elementos dentro de um container flexível. +Pense em como o eixo principal e o eixo cruzado estão posicionados em relação um ao outro. --- @@ -327,7 +327,7 @@ O eixo principal é sempre vertical, enquanto o eixo cruzado é sempre horizonta ### --feedback-- -Pense na distribuição dos elementos dentro de um container flexível. +Pense em como o eixo principal e o eixo cruzado estão posicionados em relação um ao outro. --- @@ -339,7 +339,7 @@ O eixo principal e o eixo transversal estão sempre paralelos entre si. ### --feedback-- -Pense na distribuição dos elementos dentro de um container flexível. +Pense em como o eixo principal e o eixo cruzado estão posicionados em relação um ao outro. ## --video-solution-- diff --git a/curriculum/challenges/portuguese/blocks/lecture-working-with-css-flexbox/672bd658c0e190f674a5e057.md b/curriculum/challenges/portuguese/blocks/lecture-working-with-css-flexbox/672bd658c0e190f674a5e057.md index cf222dd750a..d7e6586871f 100644 --- a/curriculum/challenges/portuguese/blocks/lecture-working-with-css-flexbox/672bd658c0e190f674a5e057.md +++ b/curriculum/challenges/portuguese/blocks/lecture-working-with-css-flexbox/672bd658c0e190f674a5e057.md @@ -7,11 +7,11 @@ dashedName: what-are-some-common-flex-properties # --interactive-- -Propriedades flex são propriedades que você pode aplicar a contêineres flex para determinar a distribuição dos elementos filhos. Cobriremos alguns dos mais usados: `flex-wrap`, `justify-content` e `align-items`. +As propriedades flex controlam como os elementos se comportam dentro de um layout flex, desde a distribuição no nível do container até o autoalinhamento no nível do item. Vamos cobrir algumas das mais usadas nesta lição: `flex-wrap`, `flex-flow`, `justify-content`, `align-items` e `align-self`. -Vamos começar com `flex-wrap`. Esta propriedade determina como os itens flexíveis são quebrados dentro de um contêiner flexível para se ajustarem ao espaço disponível. `flex-wrap` pode assumir três valores possíveis: `nowrap`, `wrap` e `wrap-reverse`. `nowrap` é o valor padrão—os itens flexíveis não serão quebrados em uma nova linha, mesmo que sua largura exceda a largura do contêiner. +Vamos começar com `flex-wrap`. Essa propriedade determina como os itens flexíveis são quebrados dentro de um container flex para caber no espaço disponível. `flex-wrap` pode assumir três valores possíveis: `nowrap`, `wrap` e `wrap-reverse`. `nowrap` é o valor padrão: os itens flexíveis não serão quebrados em uma nova linha, mesmo que sua largura ultrapasse a largura do container. -No código abaixo, temos três elementos `div`. Vamos focar na `width`. O contêiner `main` com borda vermelha tem uma `width` de `200px`, enquanto seus três elementos filhos `div` combinados têm uma `width` de `240px` (`80px` cada): +No código abaixo, temos três elementos `div`. Vamos focar na `width`. O container `main` com borda tem uma `width` de `200px`, enquanto seus três elementos `div` filhos combinados têm uma `width` de `240px` (`80px` cada): :::interactive_editor @@ -28,7 +28,7 @@ No código abaixo, temos três elementos `div`. Vamos focar na `width`. O contê main { width: 200px; display: flex; - border: 2px solid red; + border: 2px solid #444; } div { @@ -51,7 +51,6 @@ div { ::: - A largura dos elementos `div` excede a largura do seu contêiner, mas por padrão eles serão reduzidos para caber no espaço disponível. Se você quiser quebrá-los quando excederem a largura do seu contêiner, pode definir `flex-wrap: wrap` no contêiner flex: :::interactive_editor @@ -70,7 +69,7 @@ main { width: 200px; display: flex; flex-wrap: wrap; - border: 2px solid red; + border: 2px solid #444; } div { @@ -109,9 +108,10 @@ Os elementos `div` serão reorganizados em linhas quando excederem a largura do ```css main { width: 200px; + height: 120px; display: flex; flex-flow: column wrap-reverse; - border: 2px solid red; + border: 2px solid #444; } div { @@ -151,7 +151,7 @@ Great. Agora vamos falar sobre `justify-content`. `justify-content` alinha os el main { display: flex; justify-content: flex-start; - border: 2px solid red; + border: 2px solid #444; } div { @@ -174,7 +174,7 @@ div { ::: -Com `justify-content: flex-end`, os itens flex são alinhados ao final do eixo principal, horizontalmente ou verticalmente. +Com `justify-content: flex-end`, os itens flex são alinhados ao final do eixo principal, horizontalmente ou verticalmente. :::interactive_editor @@ -191,7 +191,7 @@ Com `justify-content: flex-end`, os itens flex são alinhados ao final do eixo p main { display: flex; justify-content: flex-end; - border: 2px solid red; + border: 2px solid #444; } div { @@ -214,7 +214,7 @@ div { ::: -Para centralizar os itens flexíveis ao longo do eixo principal, você pode usar `justify-content: center`. +Para centralizar os itens flexíveis ao longo do eixo principal, você pode usar `justify-content: center`. :::interactive_editor @@ -231,7 +231,7 @@ Para centralizar os itens flexíveis ao longo do eixo principal, você pode usar main { display: flex; justify-content: center; - border: 2px solid red; + border: 2px solid #444; } div { @@ -254,7 +254,7 @@ div { ::: -Para distribuir os elementos uniformemente ao longo do eixo principal, você pode usar `justify-content: space-between`. Isso adicionará algum espaço entre os itens flexíveis se necessário. +Para distribuir os elementos ao longo do eixo principal sem espaço nas bordas, você pode usar `justify-content: space-between`. O primeiro item fica no início do eixo principal, o último item fica no final, e o espaço restante é distribuído entre os itens adjacentes. :::interactive_editor @@ -271,7 +271,7 @@ Para distribuir os elementos uniformemente ao longo do eixo principal, você pod main { display: flex; justify-content: space-between; - border: 2px solid red; + border: 2px solid #444; } div { @@ -294,7 +294,7 @@ div { ::: -`justify-content: space-around` distribui os itens flex de forma uniforme dentro do eixo principal, adicionando um espaço antes do primeiro item e depois do último item. Este espaço adicional é metade do espaço entre cada par de itens adjacentes. Se houver apenas um item para distribuir, ele será centralizado. +`justify-content: space-around` distribui os itens flexíveis uniformemente ao longo do eixo principal, adicionando um espaço antes do primeiro item e depois do último. Esse espaço adicional é metade do espaço entre cada par de itens adjacentes. Se houver apenas um item para distribuir, ele será centralizado. :::interactive_editor @@ -311,7 +311,7 @@ div { main { display: flex; justify-content: space-around; - border: 2px solid red; + border: 2px solid #444; } div { @@ -334,8 +334,7 @@ div { ::: - -E por último, mas não menos importante, temos `justify-content: space-evenly`, que distribui os itens uniformemente ao longo do eixo principal. O espaço entre os itens e o espaço antes e depois dos primeiros e últimos elementos são exatamente os mesmos: +E por último, mas não menos importante, temos `justify-content: space-evenly`, que distribui os itens uniformemente ao longo do eixo principal. O espaço entre os itens e o espaço antes e depois do primeiro e do último elemento são exatamente iguais: :::interactive_editor @@ -352,7 +351,7 @@ E por último, mas não menos importante, temos `justify-content: space-evenly`, main { display: flex; justify-content: space-evenly; - border: 2px solid red; + border: 2px solid #444; } div { @@ -375,7 +374,7 @@ div { ::: -Great. Agora você sabe como distribuir os itens flex ao longo do eixo principal. Mas você também pode querer distribuí-los ao longo do eixo transversal. Lembre-se de que o eixo cruzado é perpendicular ao eixo principal. Você pode fazer isso com a propriedade `align-items`. Para centralizar os itens ao longo do eixo cruzado, você só precisa adicionar `align-items: center` ao contêiner flex: +Great. Agora você sabe como distribuir os itens flex ao longo do eixo principal. Mas você também pode querer distribuí-los ao longo do eixo transversal. Lembre-se de que o eixo cruzado é perpendicular ao eixo principal. Você pode fazer isso com a propriedade `align-items`. Para centralizar os itens ao longo do eixo cruzado, você só precisa adicionar `align-items: center` ao contêiner flex: :::interactive_editor @@ -390,10 +389,10 @@ Great. Agora você sabe como distribuir os itens flex ao longo do eixo principal ```css main { - height: 300px; display: flex; + height: 300px; align-items: center; - border: 2px solid red; + border: 2px solid #444; } div { @@ -431,10 +430,10 @@ Neste exemplo, os itens flex estão centralizados ao longo do eixo cruzado, que ```css main { - height: 300px; display: flex; + height: 300px; align-items: flex-start; - border: 2px solid red; + border: 2px solid #444; } div { @@ -457,7 +456,7 @@ div { ::: -O oposto é `align-items: flex-end`. Isso alinhará os itens flex ao final do eixo cruzado, verticalmente ou horizontalmente. +O oposto é `align-items: flex-end`. Isso alinhará os itens flex ao final do eixo cruzado, verticalmente ou horizontalmente. :::interactive_editor @@ -472,10 +471,10 @@ O oposto é `align-items: flex-end`. Isso alinhará os itens flex ao final do ei ```css main { - height: 300px; display: flex; + height: 300px; align-items: flex-end; - border: 2px solid red; + border: 2px solid #444; } div { @@ -498,147 +497,169 @@ div { ::: -Para esticar os itens flexíveis ao longo do eixo cruzado, você pode usar `align-items: stretch`. Isso também funciona com elementos que são dimensionados automaticamente, como aqueles sem `width` ou `height` definidos, ou com apenas um `width` ou `height` mínimo. Os itens flexíveis irão se esticar para preencher o contêiner na direção do eixo cruzado. +Para esticar os itens flexíveis ao longo do eixo cruzado, você pode usar `align-items: stretch`. Isso afeta apenas os itens cujo tamanho no eixo cruzado é `auto`; itens com tamanho explícito no eixo cruzado (por exemplo, uma `height` definida em um container em linha) não serão esticados. Os itens afetados preencherão o container na direção do eixo cruzado. :::interactive_editor ```html <link rel="stylesheet" href="styles.css"> - -<div class="container"> - <div class="box">One</div> - <div class="box">Two</div> - <div class="box">Three</div> -</div> - +<main> + <div id="first-div"></div> + <div id="second-div"></div> + <div id="third-div"></div> +</main> ``` ```css -.container { +main { display: flex; - align-items: stretch; + height: 300px; + align-items: stretch; border: 2px solid #444; - height: 200px; } -.box { - width: 100px; - border: 1px solid #888; - background-color: lightblue; +div { + width: 80px; + height: 50px; +} + +#first-div { + background-color: #4d70b2; +} + +#second-div { + background-color: #5c4db2; +} + +#third-div { + background-color: #4da3b2; + height: auto; } ``` ::: -E finalmente, você pode usar a propriedade `align-self` para atribuir um alinhamento diferente no eixo cruzado a um item flex individual. Por exemplo, você pode esticá-lo com `align-self: stretch`. +E finalmente, você pode usar a propriedade `align-self` para atribuir um alinhamento diferente no eixo cruzado a um item flex individual. Por exemplo, você pode esticá-lo com `align-self: stretch`. :::interactive_editor ```html <link rel="stylesheet" href="styles.css"> - -<div class="container"> - <div class="box">One</div> - <div class="box">Two</div> - <div class="box special">Three</div> -</div> - +<main> + <div id="first-div"></div> + <div id="second-div"></div> + <div id="third-div"></div> +</main> ``` ```css -.container { +main { display: flex; - align-items: flex-start; + height: 300px; + align-items: flex-start; border: 2px solid #444; - height: 200px; } -.box { - width: 100px; - border: 1px solid #888; - background-color: lightblue; - margin: 4px; +div { + width: 80px; + height: 50px; } -.special { - align-self: stretch; - background-color: lightcoral; +#first-div { + background-color: #4d70b2; +} + +#second-div { + background-color: #5c4db2; +} + +#third-div { + background-color: #4da3b2; + align-self: stretch; } ``` ::: -Você pode centralizá-lo com `align-self: center`. +Você pode centralizá-lo com `align-self: center`. :::interactive_editor ```html <link rel="stylesheet" href="styles.css"> - -<div class="container"> - <div class="box">One</div> - <div class="box">Two</div> - <div class="box special">Three</div> -</div> - +<main> + <div id="first-div"></div> + <div id="second-div"></div> + <div id="third-div"></div> +</main> ``` ```css -.container { +main { display: flex; - align-items: flex-start; + height: 300px; + align-items: flex-start; border: 2px solid #444; - height: 200px; } -.box { - width: 100px; - border: 1px solid #888; - background-color: lightblue; - margin: 4px; +div { + width: 80px; + height: 50px; +} + +#first-div { + background-color: #4d70b2; +} + +#second-div { + background-color: #5c4db2; } -.special { - align-self: center; - background-color: lightcoral; +#third-div { + background-color: #4da3b2; + align-self: center; } ``` ::: -Você pode alinhá-lo ao início do eixo cruzado com `align-self: flex-start`. +Você pode alinhá-lo ao início do eixo cruzado com `align-self: flex-start`. :::interactive_editor ```html <link rel="stylesheet" href="styles.css"> - -<div class="container"> - <div class="box">One</div> - <div class="box">Two</div> - <div class="box special">Three</div> -</div> - +<main> + <div id="first-div"></div> + <div id="second-div"></div> + <div id="third-div"></div> +</main> ``` ```css -.container { +main { display: flex; - align-items: flex-start; + height: 300px; + align-items: flex-start; border: 2px solid #444; - height: 200px; } -.box { - width: 100px; - border: 1px solid #888; - background-color: lightblue; - margin: 4px; +div { + width: 80px; + height: 50px; +} + +#first-div { + background-color: #4d70b2; } -.special { - align-self: flex-start; - background-color: lightcoral; +#second-div { + background-color: #5c4db2; +} + +#third-div { + background-color: #4da3b2; + align-self: flex-start; } ``` @@ -650,39 +671,43 @@ Ou você pode alinhá-lo ao final do eixo cruzado com `align-self: flex-end`. ```html <link rel="stylesheet" href="styles.css"> - -<div class="container"> - <div class="box">One</div> - <div class="box">Two</div> - <div class="box special">Three</div> -</div> - +<main> + <div id="first-div"></div> + <div id="second-div"></div> + <div id="third-div"></div> +</main> ``` ```css -.container { +main { display: flex; - align-items: flex-start; + height: 300px; + align-items: flex-start; border: 2px solid #444; - height: 200px; } -.box { - width: 100px; - border: 1px solid #888; - background-color: lightblue; - margin: 4px; +div { + width: 80px; + height: 50px; } -.special { - align-self: flex-end; - background-color: lightcoral; +#first-div { + background-color: #4d70b2; +} + +#second-div { + background-color: #5c4db2; +} + +#third-div { + background-color: #4da3b2; + align-self: flex-end; } ``` ::: -Existem outras propriedades e valores de flex que você pode escolher para criar o layout responsivo que você imagina, mas estes são os mais usados. Com essas propriedades CSS flex e seu novo conhecimento do modelo CSS flex, você pode começar a criar layouts responsivos para proporcionar uma experiência de usuário fluida e inclusiva em vários dispositivos. +Existem outras propriedades e valores flex que você pode escolher para criar o layout responsivo que imagina, mas essas são as mais usadas. Com essas propriedades CSS flex e seu novo conhecimento do modelo flex CSS, você pode começar a criar layouts responsivos para proporcionar uma experiência de usuário fluida e inclusiva em diferentes dispositivos. # --questions-- @@ -764,7 +789,7 @@ Quais das seguintes propriedades podem ser combinadas na propriedade `flex-flow` ## --answers-- -`flex-direction` e `justify-content`. +`flex-direction` e `justify-content` ### --feedback-- @@ -772,7 +797,7 @@ Pense nos dois principais aspectos de como os itens flex são dispostos. --- -`flex-direction` e `align-items`. +`flex-direction` e `align-items` ### --feedback-- @@ -780,7 +805,7 @@ Pense nos dois principais aspectos de como os itens flex são dispostos. --- -`flex-direction` e `align-content`. +`flex-direction` e `align-content` ### --feedback-- @@ -788,7 +813,7 @@ Pense nos dois principais aspectos de como os itens flex são dispostos. --- -`flex-direction` e `flex-wrap`. +`flex-direction` e `flex-wrap` ## --video-solution-- diff --git a/curriculum/challenges/portuguese/blocks/lecture-working-with-css-fonts/672bd814105a0ffcf36f9233.md b/curriculum/challenges/portuguese/blocks/lecture-working-with-css-fonts/672bd814105a0ffcf36f9233.md index 491bf9a8d42..3c8637f1304 100644 --- a/curriculum/challenges/portuguese/blocks/lecture-working-with-css-fonts/672bd814105a0ffcf36f9233.md +++ b/curriculum/challenges/portuguese/blocks/lecture-working-with-css-fonts/672bd814105a0ffcf36f9233.md @@ -1,6 +1,6 @@ --- id: 672bd814105a0ffcf36f9233 -title: What Are Font Families and How Do They Work? +title: O que são famílias de fontes e como elas funcionam? challengeType: 19 dashedName: what-are-font-families --- @@ -11,6 +11,8 @@ Uma família de fontes é um grupo de fontes que compartilham um design comum. T <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/what-are-font-families-and-how-do-they-work-1.png" alt="Diagram showing 'Arial' at the top with two blue arrows pointing down to 'Arial Bold' on the left and 'Arial Italic' on the right, illustrating font family variations" /> +## Definindo famílias de fontes no CSS + No CSS, você pode definir a família da fonte com a propriedade `font-family`. Aqui está um exemplo de como definir a fonte do parágrafo para `Arial`: :::interactive_editor @@ -29,6 +31,8 @@ No CSS, você pode definir a família da fonte com a propriedade `font-family`. ::: +## Fontes fallback + Mas e se a família de fontes não for encontrada? Você pode especificar múltiplas famílias de fontes em ordem de prioridade, da mais alta para a mais baixa, separando-as por vírgulas. Essas fontes alternativas funcionarão como opções de fallback. Neste exemplo, Arial é uma fonte primária e Lato é uma fonte alternativa: :::interactive_editor @@ -51,6 +55,8 @@ O navegador irá renderizar a primeira fonte (Arial) se ela for encontrada no di Você também deve saber como esse processo funciona nos bastidores. O processo de seleção não para se a primeira fonte estiver disponível. A família de fontes é escolhida um caractere por vez, então se uma fonte não tiver um caractere específico, o navegador o procura nas fontes de prioridade inferior. Interessante, não é? +## Famílias de fontes genéricas + No contexto do desenvolvimento web, você também encontrará famílias genéricas de fontes. Eles são muito importantes. Uma família de fontes genérica é uma fonte padrão que os navegadores web irão renderizar quando as fontes de prioridade mais alta não estiverem disponíveis. Para garantir que o conteúdo ainda seja legível, o navegador substitui a fonte original pela fonte mais apropriada encontrada, com base na família de fontes genérica especificada. Alguns dos mais comumente usados são: - serifa @@ -81,6 +87,8 @@ Arial tem a maior prioridade. Se Arial não for encontrado, então o navegador t Você deve sempre incluir uma família de fontes genérica no final da lista de font-family. Tenha em mente que a fonte genérica pode parecer diferente da fonte que você originalmente imaginou no seu design, então é sempre útil verificar como essas fontes de fallback aparecem em diferentes navegadores. +## Fontes seguras para web + Para tornar a experiência do usuário o mais consistente possível, também é recomendado usar fontes web-safe. Essas famílias de fontes geralmente estão instaladas na maioria dos dispositivos, então é muito provável que sejam encontradas e renderizadas corretamente para a maioria dos usuários. You'll learn more about them in the next lessons. Famílias de fontes são essenciais no mundo do design web. Usando a propriedade font-family, você pode transformar instantaneamente a aparência e o estilo do seu texto. diff --git a/curriculum/challenges/portuguese/blocks/lecture-working-with-css-fonts/672bd8453d1371fdb1510fe5.md b/curriculum/challenges/portuguese/blocks/lecture-working-with-css-fonts/672bd8453d1371fdb1510fe5.md index 631b3159252..822d47d8871 100644 --- a/curriculum/challenges/portuguese/blocks/lecture-working-with-css-fonts/672bd8453d1371fdb1510fe5.md +++ b/curriculum/challenges/portuguese/blocks/lecture-working-with-css-fonts/672bd8453d1371fdb1510fe5.md @@ -11,6 +11,8 @@ Uma fonte externa é um arquivo de fonte que não está incluído diretamente no Google Fonts e Font Squirrel são recursos online populares para encontrar e usar fontes gratuitas para fins de desenvolvimento web. Você pode incorporá-los em seus projetos muito facilmente. +## Google Fonts + Vamos começar com Google Fonts. Este é um serviço do Google que oferece uma coleção de fontes, muitas das quais são projetadas especificamente para desenvolvimento web. Na interface do usuário do Google Fonts, você pode ver muitos elementos diferentes. Vamos analisá-los um por um. Na barra lateral esquerda, você encontrará: - Uma seção para ver, encontrar e filtrar fontes. @@ -18,6 +20,8 @@ Vamos começar com Google Fonts. Este é um serviço do Google que oferece uma c - Uma seção onde você pode encontrar e baixar ícones para seus projetos web. - Uma seção onde você pode aprender mais sobre fontes e suas melhores práticas seguida por perguntas frequentes. +## Visualizando Google Fonts + Para adicionar uma Google Font ao seu site, você deve ir para a primeira seção (Fonts). Você pode personalizar o texto de visualização na barra lateral esquerda, onde está escrito "Preview." Basta escrever o texto que você gostaria de ver e ele será atualizado automaticamente. Isso é útil para visualizar a fonte com o texto que você já tem em mente para o seu site. Você também pode ajustar o tamanho da fonte e filtrar as fontes com base em suas características. <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-1.png" alt="Google Fonts Fonts section showing a left sidebar with preview text set to 'freeCodeCamp' at 40px, filter options for Language, Technology, and Decorative stroke, and the main panel listing font families including Roboto, SUSE, and Sevillana each previewing 'freeCodeCamp'" /> @@ -28,12 +32,16 @@ Você pode personalizar o tamanho da fonte do texto de visualização com o cont <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-2.png" alt="Google Fonts Roboto Styles page with Specimen, Type tester, Glyphs, and About & license tabs, a blue Get font button, a preview text field showing 'freeCodeCamp' with a font size slider at 48px, and a list of styles including Thin 100, Thin 100 Italic, Light 300, and Light 300 Italic" /> +## Usando Google Fonts + Quando estiver pronto para adicionar a fonte ao seu projeto, clique no botão azul "Get font" no topo. Você será levado para uma página de resumo onde verá as fontes que você selecionou atualmente. Você pode ter várias fontes selecionadas simultaneamente. <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-3.png" alt="Google Fonts page showing '1 font family selected' with Roboto Static listed, Get embed code and Download all buttons on the right, and a How to use section with All, Design, Develop, and Google products tabs" /> Em seguida, você precisa escolher se deseja baixar os arquivos de fonte para adicioná-los ao seu projeto como arquivos locais ou se deseja usá-los como fontes externas e baixá-los dos servidores do Google quando um usuário acessar seu site. Clique em "Download all" se você quiser baixá-los mas se preferir usá-los como fontes externas nos servidores do Google, clique em "Get embed code." Se você clicar em "Get embed code," verá as instruções que deve seguir para adicionar essas fontes externas ao seu projeto. +### Link do Google Fonts + Para projetos de desenvolvimento web, você tem duas opções. Você pode usar um elemento `link` ou `@import`. Se você escolher a opção do elemento `link`, pode copiar e colar o trecho HTML e as regras CSS para adicioná-los ao seu projeto. Você deve incorporar o código no elemento `head` do seu arquivo HTML e adicionar as regras CSS que atendam às suas necessidades. <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-4.png" alt="Google Fonts Embed code page with the link element option selected, showing three link tags for preconnect and the font stylesheet, a CSS classes section with .roboto-thin, .roboto-light, .roboto-regular, and .roboto-medium rules, and a left sidebar showing font style toggles" /> @@ -141,6 +149,8 @@ Aqui está um exemplo de uso de todos os estilos Roboto: Existe uma regra CSS para cada estilo de fonte. Cada regra atribui as fontes personalizadas com fontes de fallback caso as fontes personalizadas não sejam carregadas corretamente. +### Importar Google Fonts + Se você escolher a opção `@import` em vez disso, precisará adicionar essa regra ao seu arquivo CSS. <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-5.png" alt="Google Fonts Embed code page with the @import option selected, showing a style block containing the @import URL rule, a CSS classes section below, and the left sidebar with font style toggles" /> @@ -159,10 +169,14 @@ Se você quiser incluir apenas estilos de fonte específicos, também tem a opç E este é o Google Fonts. É uma das opções mais populares para encontrar fontes gratuitas e de código aberto para projetos de desenvolvimento web. +## Font Squirrel + Outra ótima opção é o Font Squirrel, onde você pode encontrar e baixar as fontes personalizadas que você imagina para o seu design. <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-7.png" alt="Font Squirrel 'Free Font Utopia' page listing featured free fonts including Acherus Grotesque, Intro Rust, Source Sans Pro, Open Sans, and Questa, each shown with an alphabet specimen and a Download button" /> +## Visualizando Font Squirrel + Se você pesquisar uma fonte e clicar em um resultado, verá mais detalhes sobre a fonte, incluindo specimens, test drive, glyphs e Webfont kit. <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-8.png" alt="Font Squirrel search results for 'Roboto' showing three matches: Roboto, Roboto 2014, and Roboto Slab, each with an alphabet specimen and a Download TTF button" /> @@ -173,6 +187,8 @@ Você também pode ver exemplos dos diferentes estilos e variações da fonte, c <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-10.png" alt="Font Squirrel Roboto Specimens section listing all styles with alphabet samples: Roboto Thin, Thin Italic, Light, Light Italic, Regular, Italic, Medium, Medium Italic, Bold, Bold Italic, and Black, each in its respective weight" /> +## Usando Font Squirrel + Depois de decidir a fonte que você quer usar no seu projeto, vá para a aba "Webfont Kit". Aqui, você pode verificar se a licença da fonte permite que você a use em incorporações CSS `@font-face`. Você também pode escolher o subconjunto e o formato. <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-11.png" alt="Font Squirrel Roboto Webfont Kit tab showing a license notice confirming @font-face embedding is allowed, a subset selector set to Western Latin, format checkboxes with WOFF selected, and a Download @font-face Kit button" /> diff --git a/curriculum/challenges/portuguese/blocks/lecture-working-with-css-fonts/672bd853c985cdfdeb32f4f9.md b/curriculum/challenges/portuguese/blocks/lecture-working-with-css-fonts/672bd853c985cdfdeb32f4f9.md index 90f32328a30..f3ce2a5660e 100644 --- a/curriculum/challenges/portuguese/blocks/lecture-working-with-css-fonts/672bd853c985cdfdeb32f4f9.md +++ b/curriculum/challenges/portuguese/blocks/lecture-working-with-css-fonts/672bd853c985cdfdeb32f4f9.md @@ -13,6 +13,8 @@ O CSS não aplica nenhuma sombra ao texto por padrão. Este é um exemplo de um text-shadow: /* Values */ ``` +## Os valores de offset `X` e `Y` + No CSS, você pode descrever uma sombra através de uma combinação do seu deslocamento `X`, deslocamento `Y`, raio de desfoque e cor. Primeiro, você precisa especificar o deslocamento `X` e `Y`, que representam a distância horizontal e vertical da sombra em relação ao texto, respectivamente. Estes valores são obrigatórios. Aqui está um exemplo de como aplicar um deslocamento `X` e `Y` em uma sombra. Aplicamos a propriedade `text-shadow` com um deslocamento x de `3px` e um deslocamento y de `2px`: @@ -32,7 +34,11 @@ p { ::: -No navegador, o texto e a sombra terão aparência semelhante mas também podemos personalizar a cor da sombra especificando o valor antes ou depois do deslocamento. Vamos definir a cor da sombra. Usaremos uma cor hexadecimal aqui mas você pode usar qualquer formato de cor válido. +No navegador, o texto e a sombra vão parecer semelhantes. + +## Adicionando uma cor à sombra + +Também podemos personalizar a cor da sombra especificando o valor antes ou depois do offset. Vamos definir a cor da sombra. Usaremos uma cor hexadecimal aqui, mas você pode usar qualquer formato de cor válido. :::interactive_editor @@ -66,7 +72,11 @@ p { ::: -No navegador, a sombra terá uma cor específica, para que possamos distingui-la muito facilmente do texto. Agora que podemos diferenciar a sombra do texto, também é importante ver como valores positivos e negativos afetam o deslocamento da sombra. Valores positivos do deslocamento `X` e do deslocamento `Y` moverão a sombra para a direita e para baixo, respectivamente, enquanto valores negativos moverão a sombra para a esquerda e para cima. Aqui está um exemplo que usa valores negativos em vez disso: +No navegador, a sombra terá uma cor específica, então podemos distingui-la muito facilmente do texto. + +## Valores de offset positivos e negativos + +Agora que podemos diferenciar a sombra do texto, também é importante ver como valores positivos e negativos afetam o offset da sombra. Valores positivos do offset `X` e do offset `Y` vão mover a sombra para a direita e para baixo, respectivamente, enquanto valores negativos vão mover a sombra para a esquerda e para cima. Aqui está um exemplo que usa valores negativos em vez disso: :::interactive_editor @@ -83,7 +93,11 @@ p { ::: -Agora a sombra se moverá para a esquerda e para cima em relação ao texto. Great. Mas a sombra não está ficando muito boa, porque ela parece exatamente com o texto original mas colocada atrás dele. Para deixar mais bonito, precisamos adicionar um terceiro valor, o raio de desfoque. Este valor é opcional mas faz a sombra parecer muito mais suave e sutil. O valor padrão do radius blur é zero. Quanto maior o valor, maior o desfoque, o que significa que a sombra fica mais clara. +Agora a sombra vai se mover para a esquerda e para cima em relação ao texto. Ótimo. + +## O raio de desfoque + +Mas a sombra não está muito bonita, porque parece exatamente com o texto original, só que colocado atrás dele. Para deixá-la mais bonita, precisamos adicionar um terceiro valor, o raio de desfoque. Esse valor é opcional, mas faz a sombra parecer muito mais suave e sutil. O valor padrão do raio de desfoque é zero. Quanto maior o valor, maior o desfoque, o que significa que a sombra fica mais clara. Aqui, estamos definindo o raio do desfoque para `3px` e voltando a valores positivos para o deslocamento: @@ -104,6 +118,8 @@ p { Agora está começando a parecer uma sombra. É mais borrado e sutil, então podemos focar no texto principal enquanto a sombra adiciona um pouco de estilo ao fundo. A partir daqui, podemos ajustar os valores um pouco até encontrarmos uma combinação de offset, color e blur radius que atenda às nossas necessidades. +## Adicionando múltiplas sombras + Também é útil saber que o texto pode ter mais de uma sombra. Você só precisa escrevê-los na mesma propriedade `text-shadow` separados por vírgulas. Eles serão aplicados em camadas, da frente para trás, com a primeira sombra no topo. Aqui está um exemplo de um parágrafo com três sombras aplicadas em camadas. Observe que todas essas sombras são definidas na mesma propriedade `text-shadow` e separadas por vírgulas: diff --git a/curriculum/challenges/portuguese/blocks/lecture-working-with-css-transforms-overflow-and-filters/672bccc8ea33bad87abb3c56.md b/curriculum/challenges/portuguese/blocks/lecture-working-with-css-transforms-overflow-and-filters/672bccc8ea33bad87abb3c56.md index 009785bd89e..d75ef1f4bee 100644 --- a/curriculum/challenges/portuguese/blocks/lecture-working-with-css-transforms-overflow-and-filters/672bccc8ea33bad87abb3c56.md +++ b/curriculum/challenges/portuguese/blocks/lecture-working-with-css-transforms-overflow-and-filters/672bccc8ea33bad87abb3c56.md @@ -19,6 +19,8 @@ Esta propriedade pode ser definida no seletor universal (`*`) para aplicar a tod O valor da propriedade `box-sizing` é `content-box` por padrão, mas você pode escolher `border-box` se precisar. Exploraremos primeiro `content-box` e depois entraremos em `border-box`. +## Revisão do modelo de caixa CSS + Para entender como os modelos funcionam, você precisa estar familiarizado com os quatro conceitos principais do modelo de caixa CSS. Vamos revisá-los rapidamente. - A área de conteúdo é o espaço ocupado pelo conteúdo do elemento. @@ -26,11 +28,13 @@ Para entender como os modelos funcionam, você precisa estar familiarizado com o - A borda é o contorno que envolve a área de conteúdo e o padding. - A margem é o espaço fora da borda que separa o elemento de outros elementos. +## Como funciona o `content-box` + No modelo `content-box`, a largura e a altura que você define para um elemento determinam as dimensões da área de conteúdo, mas não incluem o padding, border ou margin. Use `content-box` quando precisar de controle preciso sobre a área de conteúdo. Quando você define `width` e `height`, está definindo apenas o tamanho do próprio conteúdo. Para encontrar a largura total do elemento, você precisará adicionar o padding esquerdo e direito e as bordas esquerda e direita. Da mesma forma, a altura total de um elemento pode ser encontrada adicionando a altura do conteúdo, o padding superior e inferior e as bordas superior e inferior. -Por exemplo, aqui temos um seletor de tipo CSS para todos os elementos `div`. +Por exemplo, aqui temos um seletor de tipo CSS para todos os elementos `div`. :::interactive_editor @@ -52,10 +56,14 @@ div { Neste caso, se `content-box` for usado a área de conteúdo será 300px por 200px. O tamanho total renderizado inclui padding e bordas — por exemplo, largura total = 300px (conteúdo) + 40px (padding) + 8px (bordas) = 348px; a altura total é calculada da mesma forma. +## Como funciona o `border-box` + Ótimo! Agora vamos explorar `border-box`. It's different because the width and height you set include the element's content, padding, and border (but not its margin). Use `border-box` when you want the element's total size to stay fixed even if padding or borders change — that's often helpful in responsive layouts. Com `border-box`, o padding e as bordas são incluídos dentro do tamanho especificado do elemento. O `width` e o `height` que você define se tornam as dimensões totais do elemento: conteúdo + padding + borda; as margens permanecem excluídas. +## Comparando os dois modelos + No exemplo a seguir, há dois elementos `div` com as mesmas dimensões mas valores diferentes de `box-sizing`. Observe como isso resulta em tamanhos totais diferentes quando visualizados no navegador: :::interactive_editor @@ -89,7 +97,7 @@ No exemplo a seguir, há dois elementos `div` com as mesmas dimensões mas valor ::: -Você pode ver que ambos têm o mesmo `width`, `height`, `padding`, `border` e `margin`. The only differences are in the colors and the value of the `box-sizing` property. Essa pequena diferença tem um impacto muito importante nas dimensões finais. +Você pode ver que ambos têm o mesmo `width`, `height`, `padding`, `border` e `margin`. The only differences are in the colors and the value of the `box-sizing` property. Essa pequena diferença tem um impacto muito importante nas dimensões finais. Escolher entre `content-box` e `border-box` realmente depende das necessidades específicas do seu projeto. Embora `border-box` esteja se tornando cada vez mais popular por sua simplicidade e flexibilidade, entender ambos os modelos é importante para implementar layouts CSS eficazes. diff --git a/curriculum/challenges/portuguese/blocks/lecture-working-with-dates/6733aafb9c0802f66cc1e056.md b/curriculum/challenges/portuguese/blocks/lecture-working-with-dates/6733aafb9c0802f66cc1e056.md index 91f58cda84b..c1aee6995dc 100644 --- a/curriculum/challenges/portuguese/blocks/lecture-working-with-dates/6733aafb9c0802f66cc1e056.md +++ b/curriculum/challenges/portuguese/blocks/lecture-working-with-dates/6733aafb9c0802f66cc1e056.md @@ -34,21 +34,31 @@ console.log(now); Por enquanto, está usando o formato de hora militar, então `14:30` é `2:30 PM`. `GMT-0700` é o deslocamento do fuso horário e `Pacific Daylight Time` é o nome do fuso horário. -Você também pode passar uma data e hora específicas para o objeto `Date` fornecendo os valores de ano, mês, dia, hora, minuto, segundo e milissegundo como argumentos. +Aqui está um exemplo de criação de um novo objeto `Date` com uma string de data específica: -Aqui está um exemplo de criação de um novo objeto `Date` com uma data e hora específicas: +:::interactive_editor + +```js +const dateFromString = new Date("July 4, 1776 12:00:00"); + +console.log(dateFromString); +``` + +::: + +Você também pode passar uma data e hora específicas para o objeto `Date` fornecendo os valores de ano, mês, dia, hora, minuto, segundo e milissegundo como argumentos: :::interactive_editor ```js -const specificDate = new Date("July 4, 1776 12:00:00"); +const dateFromArguments = new Date(1776, 6, 4, 12, 0, 0, 0); -console.log(specificDate); +console.log(dateFromArguments); ``` ::: -Isso é útil quando você precisa trabalhar com uma data e hora específicas em vez da data e hora atuais. A entrada sempre precisa ser uma string e o formato deve ser reconhecível pelo objeto `Date`. +Isso é útil quando você precisa trabalhar com uma data e hora específicas em vez da data e hora atuais. Para obter a data e hora atuais, você pode usar o método `Date.now()`, que retorna o número de milissegundos desde `January 1, 1970, 00:00:00 UTC`. Isto é conhecido como o tempo epoch do Unix. diff --git a/curriculum/challenges/portuguese/blocks/lecture-working-with-file-systems/672ac403a9ba7732b31c6480.md b/curriculum/challenges/portuguese/blocks/lecture-working-with-file-systems/672ac403a9ba7732b31c6480.md index 31aee9a2daf..95866473083 100644 --- a/curriculum/challenges/portuguese/blocks/lecture-working-with-file-systems/672ac403a9ba7732b31c6480.md +++ b/curriculum/challenges/portuguese/blocks/lecture-working-with-file-systems/672ac403a9ba7732b31c6480.md @@ -51,11 +51,11 @@ E finalmente, vamos falar sobre documentação. Em aplicações web, você geral Eles geralmente são escritos em um formato de arquivo chamado Markdown. Com Markdown, você pode criar documentos estruturados com títulos, subtítulos, links, imagens, listas e mais. Arquivos Markdown têm uma extensão `.md` ou `.markdown`. -Aqui você pode encontrar o arquivo `README` do repositório GitHub do freeCodeCamp: https://github.com/freeCodeCamp/freeCodeCamp/blob/main/README.md +Aqui você pode encontrar o arquivo `README` do repositório do freeCodeCamp no GitHub: `https://github.com/freeCodeCamp/freeCodeCamp/blob/main/README.md` Você pode criar essa estrutura detalhada e formato usando Markdown. -Você definitivamente vai ler e escrever muitos arquivos `README` ao longo da sua carreira. Aprender sobre esses tipos comuns de arquivo é essencial para o desenvolvimento web. +Você definitivamente vai ler e escrever muitos arquivos `README` ao longo da sua carreira. Aprender sobre esses tipos comuns de arquivo é essencial para o desenvolvimento web. Dos blocos de construção principais de HTML, CSS e JavaScript aos formatos de imagem, vídeo e áudio, todo tipo de arquivo tem um papel importante na criação de aplicações web interativas. diff --git a/curriculum/challenges/portuguese/blocks/lecture-working-with-node-core-modules/695cc6a5eefd305381ec90bc.md b/curriculum/challenges/portuguese/blocks/lecture-working-with-node-core-modules/695cc6a5eefd305381ec90bc.md index 6df21e6c7cf..d0631aa9896 100644 --- a/curriculum/challenges/portuguese/blocks/lecture-working-with-node-core-modules/695cc6a5eefd305381ec90bc.md +++ b/curriculum/challenges/portuguese/blocks/lecture-working-with-node-core-modules/695cc6a5eefd305381ec90bc.md @@ -84,7 +84,7 @@ Para scripts rápidos, projetos pequenos ou tarefas pontuais, métodos síncrono É por isso que métodos assíncronos existem. Eles permitem que o restante do seu programa continue rodando enquanto o Node lida com operações de arquivo em segundo plano. Tradicionalmente, isso usava callbacks, mas eles podem ficar confusos rapidamente conforme seu app cresce. -Promises e `async/await` resolvem esse problema. Eles ainda são não bloqueantes, mas o código é lido como código síncrono normal e é muito mais fácil de manter. +Promises e `async/await` resolvem esse problema. Eles ainda são não bloqueantes, mas o código é lido como código síncrono normal e é muito mais fácil de manter. Por essa razão, a abordagem baseada em promises é geralmente preferida hoje e é isso que usaremos no restante desta lição. @@ -148,7 +148,7 @@ async function readFileContent() { const fileContent = await fs.readFile("article.md", "utf8"); console.log("File content:", fileContent); } catch (err) { - console.log("File read successfully"); + console.error("Error reading file:", err); } } @@ -169,7 +169,7 @@ async function readFileContent() { const fileContent = await fs.readFile("article.md"); console.log("File content:", fileContent); } catch (err) { - console.log("File read successfully"); + console.error("Error reading file:", err); } } @@ -297,7 +297,7 @@ Dois são assíncronos, um é síncrono e um não existe. --- - Com promises, por exemplo `fs.promises.writeFile()`. +Com promises, por exemplo `fs.promises.writeFile()`. ### --feedback-- diff --git a/curriculum/challenges/portuguese/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d2f232c60f0fa68ef86.md b/curriculum/challenges/portuguese/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d2f232c60f0fa68ef86.md index 80a64c60de3..9b439523f23 100644 --- a/curriculum/challenges/portuguese/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d2f232c60f0fa68ef86.md +++ b/curriculum/challenges/portuguese/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d2f232c60f0fa68ef86.md @@ -1,6 +1,6 @@ --- id: 68ff6d2f232c60f0fa68ef86 -title: O que é Node e Quais são Algumas Diferenças Entre o Ambiente de Execução do Navegador e do Node? +title: O que é Node e quais são algumas diferenças entre o navegador e o ambiente de execução Node? challengeType: 19 dashedName: what-is-node-and-what-are-some-differences-between-the-browser-and-node-runtime-environment --- @@ -19,11 +19,11 @@ Por exemplo: O JavaScript do lado do cliente tem essas limitações porque foi inicialmente projetado para rodar exclusivamente em navegadores web. -Os navegadores web fornecem o ambiente necessário para executar código JavaScript, incluindo o JavaScript Engine. Eles também fornecem acesso ao Document Object Model (DOM), para que você possa acessar elementos HTML no seu código. +Os navegadores fornecem o ambiente necessário para executar código JavaScript, incluindo o motor JavaScript. Eles também fornecem acesso ao Document Object Model (DOM), para que você possa acessar elementos HTML no seu código. -Anteriormente, não podíamos executar JavaScript fora de um navegador, mas agora podemos com Node.js. +Por muito tempo, o JavaScript foi usado quase exclusivamente dentro dos navegadores, mas com o Node.js você pode executá-lo fora de um navegador também. -Node.js é um ambiente de execução JavaScript. É oficialmente definido como “um ambiente de execução JavaScript de código aberto e multiplataforma.” +Node.js é um ambiente de execução JavaScript. Ele é oficialmente definido como "um ambiente de execução JavaScript open-source e multiplataforma." Vamos ver o que isso significa: @@ -43,7 +43,7 @@ O ambiente do navegador é projetado principalmente para desenvolvimento web fro Por exemplo, do navegador, você pode acessar a API DOM, mas há restrições para acessar o sistema de arquivos local. Em contraste, do ambiente de execução Node, você pode acessar quase todos os recursos do sistema, incluindo o sistema de arquivos, mas não o DOM. -Ambos os ambientes JavaScript fornecem um objeto global. No runtime JavaScript do navegador, isso é chamado de `window`. Esse objeto `window` fornece acesso a funcionalidades relacionadas ao navegador, como acesso a métodos para manipular o DOM, gerenciar cookies e lidar com eventos do navegador. No ambiente Node.js, esse objeto global é chamado de `global`. O objeto `global` fornece acesso a funcionalidades específicas do Node.js, como módulos integrados para trabalhar com arquivos locais, redes e interagir com o sistema operacional. +Ambos os ambientes JavaScript fornecem um objeto global. No ambiente de execução JavaScript do navegador, ele é chamado de `window`. Esse objeto `window` fornece acesso a funcionalidades relacionadas ao navegador, como métodos para manipular o DOM, gerenciar cookies e lidar com eventos do navegador. No ambiente Node.js, esse objeto global é chamado de `global`. O objeto `global` fornece acesso a funcionalidades específicas do Node.js, como módulos embutidos para trabalhar com arquivos locais, rede e interação com o sistema operacional. Finalmente, outra diferença importante é que você pode escolher a versão do Node.js que deseja usar no seu servidor. No entanto, você não tem controle sobre a versão do ambiente do navegador que seus usuários usarão para visitar seu site. @@ -103,7 +103,7 @@ Pense sobre os papéis e o propósito de cada ambiente. --- -O ambiente de execução Node usa o objeto window como seu objeto global, enquanto os navegadores usam o objeto global. +O ambiente de execução Node usa o objeto `window` como seu objeto global, enquanto os navegadores usam o objeto `global`. ### --feedback-- diff --git a/curriculum/challenges/portuguese/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d372ad364f285f0522e.md b/curriculum/challenges/portuguese/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d372ad364f285f0522e.md index eb65b42b14c..d21c393899a 100644 --- a/curriculum/challenges/portuguese/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d372ad364f285f0522e.md +++ b/curriculum/challenges/portuguese/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d372ad364f285f0522e.md @@ -1,6 +1,6 @@ --- id: 68ff6d372ad364f285f0522e -title: "Quais são as Vantagens e Desvantagens de Usar Node no Back-End?" +title: Quais são as vantagens e desvantagens de usar Node no back-end? challengeType: 19 dashedName: what-are-the-advantages-and-disadvantages-to-using-node-on-the-back-end --- @@ -11,7 +11,7 @@ Uma das grandes vantagens do Node.js é que você pode implementar tanto o front A arquitetura do Node é outra vantagem. Ela possui uma arquitetura não bloqueante e orientada a eventos que é ótima para desenvolver aplicações em tempo real, onde a capacidade de resposta e a eficiência são essenciais para criar uma boa experiência do usuário. -É aqui que o conceito de “threads” se torna muito importante. Uma thread é um caminho de execução dentro de um processo, como um programa de computador que está sendo executado no momento. +É aqui que o conceito de "threads" se torna muito importante. Uma thread é um caminho de execução dentro de um processo, ou seja, um programa de computador que está sendo executado no momento. A arquitetura do Node depende de uma única thread e loop de eventos que pode lidar efetivamente com um grande número de requisições simultâneas e operações de entrada/saída. Isso o torna perfeito para aplicações que exigem o tratamento de múltiplas requisições simultaneamente. @@ -25,13 +25,13 @@ E finalmente, em termos de custos, o Node.js tem a grande vantagem de ser gratui Por outro lado, o Node.js tem certas desvantagens ou limitações das quais você deve estar ciente. -Como você aprendeu, ele executa apenas uma thread por vez, o que significa que só pode lidar com uma operação por vez. Embora sua arquitetura permita que seja eficiente para lidar com requisições concorrentes (simultâneas), tarefas intensivas em CPU podem bloquear a thread principal e resultar em problemas de desempenho. +Como você aprendeu, ele executa seu JavaScript em uma única thread, o que significa que só pode executar uma parte do seu código por vez. Embora sua arquitetura permita que seja eficiente para lidar com requisições concorrentes (simultâneas), tarefas intensivas em CPU podem bloquear a thread principal e causar problemas de desempenho. Exemplos de tarefas intensivas para CPU incluem operações matemáticas complexas, processamento de imagens e vídeos e criptografia. Existem maneiras de superar isso, mas geralmente aumentam a complexidade da aplicação. -Node.js também depende de programação assíncrona. Na programação assíncrona, uma tarefa que pode levar muito tempo para ser executada é iniciada, mas em vez de esperar até que ela seja concluída, o programa principal continua executando enquanto a tarefa assíncrona roda em paralelo. Quando a tarefa é concluída, o programa lida com o resultado. +Na programação assíncrona, uma tarefa que pode levar muito tempo para ser executada é iniciada, mas em vez de esperar até que ela termine, o programa principal continua executando enquanto a tarefa assíncrona roda em segundo plano. -Esse processo frequentemente envolve o que conhecemos como “callbacks,” que são funções que definem o que acontece quando as operações assíncronas são concluídas. A natureza assíncrona do Node.js pode potencialmente tornar o código mais difícil de ler, entender e depurar. +Esse processo frequentemente envolve o que conhecemos como "callbacks", que são funções que definem o que acontece quando as operações assíncronas são concluídas. A natureza assíncrona do Node.js pode tornar o código potencialmente mais difícil de ler, entender e depurar. E finalmente, você também deve ter cuidado ao escolher pacotes do `npm`, o gerenciador de pacotes do Node, porque alguns deles podem não ser mantidos constantemente, então podem introduzir vulnerabilidades na sua própria aplicação. Como desenvolvedor, você deve avaliar cada pacote cuidadosamente e verificar se ele segue as melhores práticas de qualidade e segurança. diff --git a/curriculum/challenges/portuguese/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d39d7ed9ef36ff281f3.md b/curriculum/challenges/portuguese/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d39d7ed9ef36ff281f3.md index 41e0c1680ef..b175526da78 100644 --- a/curriculum/challenges/portuguese/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d39d7ed9ef36ff281f3.md +++ b/curriculum/challenges/portuguese/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d39d7ed9ef36ff281f3.md @@ -17,7 +17,7 @@ Vamos ver como você pode instalar NVM no macOS/Linux e Windows e como você pod No macOS e Linux, você pode instalar o NVM diretamente através de um script shell. -Mas para macOS, note que a documentação oficial do NVM menciona que “você precisa instalar manualmente as ferramentas de linha de comando do Xcode antes de executar o script de instalação, caso contrário, ele falhará.” +Mas para macOS, note que a documentação oficial do NVM menciona que "você precisa instalar manualmente as ferramentas de linha de comando do Xcode antes de executar o script de instalação, caso contrário, ele falhará." No macOS, você pode instalar as ferramentas de linha de comando do Xcode executando este comando no seu terminal: @@ -41,7 +41,7 @@ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash ``` -Para obter a versão mais recente do NVM no momento em que você está lendo este artigo, consulte a documentação oficial do NVM: `https://github.com/nvm-sh/nvm?tab=readme-ov-file#install--update-script`. Lá, você encontrará esses comandos com o número da versão mais recente. +Para obter a versão mais recente do NVM no momento em que você está lendo esta lição, consulte a documentação oficial do NVM: `https://github.com/nvm-sh/nvm?tab=readme-ov-file#install--update-script`. Lá, você encontrará esses comandos com o número da versão mais recente. Pode ser necessário reiniciar seu terminal quando o processo for concluído para carregar o novo comando e a nova configuração. @@ -53,7 +53,7 @@ nvm -v Você deve ver sua versão do NVM na saída. -## Como instalar Node.js com NVM no macOS/Linux +## Como instalar o Node.js com NVM no macOS/Linux Agora que você tem o NVM instalado no macOS/Linux, você pode instalar o Node.js. @@ -101,7 +101,7 @@ Agora vamos ver como você pode instalar e usar o NVM no Windows. As versões oficiais do NVM suportam Windows apenas em casos específicos. Se você tiver o Windows Subsystem for Linux (WSL) configurado no seu dispositivo, pode seguir o guia para macOS/Linux acima para instalar e usar o NVM. -No entanto, para o próprio Windows, existem algumas alternativas. Uma delas é `nvm-windows`, uma ferramenta de gerenciamento de versões do Node.js para Windows. Este é um projeto completamente separado do projeto oficial do NVM. Mas o propósito dessas ferramentas é o mesmo — ajudar você a trabalhar com múltiplas versões do Node.js no mesmo dispositivo. +No entanto, para o próprio Windows, existem algumas alternativas. Uma delas é o `nvm-windows`, uma ferramenta de gerenciamento de versões do Node.js para Windows. Este é um projeto completamente separado do projeto oficial do NVM. Mas o propósito dessas ferramentas é o mesmo: ajudar você a trabalhar com múltiplas versões do Node.js no mesmo dispositivo. Antes de instalar o `nvm-windows`, você deve saber que o repositório oficial recomenda desinstalar qualquer instalação anterior do Node antes de instalar o NVM para Windows. Se esta for a sua primeira vez instalando o Node.js, você deve estar bem. Se você já tem outras versões do Node.js instaladas, é recomendado desinstalá-las primeiro. @@ -119,7 +119,7 @@ Você pode verificar se a instalação foi bem-sucedida e ver sua versão atual nvm -v ``` -## Como Instalar Node.js usando NVM para Windows +## Como instalar o Node.js usando o NVM para Windows Agora que você tem o `nvm-windows` instalado no Windows, você está pronto para instalar o Node.js. @@ -155,7 +155,7 @@ nvm use 20 Você também pode verificar sua versão atual do Node.js com este comando: -```bash +```powershell node -v ``` @@ -165,25 +165,25 @@ Agora que você sabe como instalar o NVM e o Node.js, vamos conferir alguns coma Além disso, embora todos esses comandos funcionem para NVM instalado no macOS/Linux, incluindo WSL, eles podem funcionar de forma diferente ou podem não funcionar para `nvm-windows`. Deixaremos comandos alternativos para `nvm-windows` sempre que possível. -### Como Ajustar a Política de Execução do Powershell +### Como ajustar a política de execução do PowerShell -Se você está usando Windows e acompanhando com Powershell e `nvm-windows`, pode ser necessário ajustar a política de execução do Powershell. A política de execução padrão do Powershell é `Restricted`, que é uma medida de segurança para impedir a execução de scripts. +Se você está usando Windows e acompanhando com PowerShell e `nvm-windows`, pode ser necessário ajustar a política de execução do PowerShell. A política de execução padrão do PowerShell é `Restricted`, que é uma medida de segurança para impedir a execução de scripts. -Primeiro, execute o Powershell como administrador clicando com o botão direito no Powershell e depois clicando em “Executar como Administrador“. +Primeiro, execute o PowerShell como administrador clicando com o botão direito no PowerShell e depois em "Executar como administrador". -Então, para ver a política de execução atual da sessão atual do Powershell, execute o seguinte comando: +Então, para ver a política de execução atual da sessão do PowerShell, execute o seguinte comando: ```powershell Get-ExecutionPolicy ``` -Finalmente, para definir a política de execução do Powershell para `RemoteSigned`, que permite que scripts locais e `npm` sejam executados, use o seguinte comando: +Finalmente, para definir a política de execução do PowerShell para `RemoteSigned`, que permite a execução de scripts locais e do `npm`, use o seguinte comando: ```powershell Set-ExecutionPolicy RemoteSigned ``` -Depois de executar o comando acima, você pode fechar a janela do administrador do Powershell e abrir uma janela do Powershell sem privilégios de administrador. +Depois de executar o comando acima, você pode fechar a janela do PowerShell em modo administrador e abrir uma janela do PowerShell sem privilégios de administrador. ### Listar Todas as Versões diff --git a/curriculum/challenges/portuguese/blocks/lecture-working-with-operator-behavior/6732719e2e3ad4d947410b65.md b/curriculum/challenges/portuguese/blocks/lecture-working-with-operator-behavior/6732719e2e3ad4d947410b65.md index af6d8322f7e..d12743d4943 100644 --- a/curriculum/challenges/portuguese/blocks/lecture-working-with-operator-behavior/6732719e2e3ad4d947410b65.md +++ b/curriculum/challenges/portuguese/blocks/lecture-working-with-operator-behavior/6732719e2e3ad4d947410b65.md @@ -11,7 +11,13 @@ Se você escrever uma expressão com vários operadores em JavaScript, como o Ja A precedência do operador determina a ordem em que as operações são avaliadas em uma expressão. Operadores com precedência mais alta são avaliados antes daqueles com precedência mais baixa. Pense na precedência de operadores como na matemática, onde divisão e multiplicação acontecem antes de adição e subtração. -Sem seguir esta regra, equações básicas lhe dariam a resposta errada. JavaScript funciona da mesma maneira. Ele tem suas próprias regras para quais operadores vêm primeiro, segundo e assim por diante. Por exemplo, dê uma olhada na expressão abaixo: +Sem seguir essa regra, equações básicas dariam respostas erradas. O JavaScript funciona da mesma forma. Ele tem suas próprias regras para quais operadores vêm primeiro, segundo e assim por diante. + +## Precedência em expressões aritméticas + +### Precedência da multiplicação + +Por exemplo, dê uma olhada na expressão abaixo: :::interactive_editor @@ -23,38 +29,44 @@ console.log(result); // 14 ::: -Se o JavaScript avaliasse essa expressão da esquerda para a direita, você esperaria `2 + 3 = 5` e depois `5 * 4 = 20`. Mas como a multiplicação tem precedência maior que a adição, o JavaScript avalia primeiro a parte `3 * 4`, resultando em `2 + 12 = 14`. +Se o JavaScript avaliasse essa expressão da esquerda para a direita, você esperaria `2 + 3 = 5` e depois `5 * 4 = 20`. Mas como a multiplicação tem precedência maior que a adição, o JavaScript avalia primeiro a parte `3 * 4`, resultando em `2 + 12 = 14`. -Às vezes, você pode querer que certas partes da sua expressão sejam executadas primeiro, independentemente das regras de precedência. Você pode usar parênteses, `()`, para fazer isso. Qualquer coisa dentro de parênteses é avaliada primeiro, não importa o que seja. Vamos fazer a parte `2 + 3` do exemplo anterior ser avaliada primeiro: +### Precedência da divisão + +O operador de divisão tem mais precedência do que adição ou subtração também: :::interactive_editor ```js -const result = (2 + 3) * 4; +const result = 2 + 6 / 3; -console.log(result); // 20 +console.log(result); // 4 ``` ::: -No exemplo acima, os parênteses forçam o JavaScript a avaliar `2 + 3` primeiro e depois multiplicar o resultado por `4`. Isto lhe dá `20` em vez de `14`. +Se o JavaScript avaliasse essa expressão da esquerda para a direita, você poderia esperar `2 + 6 = 8` e depois `8 / 3 = 2.67`. Mas como a divisão tem precedência maior que a adição, o JavaScript avalia a divisão primeiro: `6 / 3 = 2` e depois soma `2 + 2`, dando o resultado `4`. -O operador de divisão tem mais precedência do que adição ou subtração também: +### Usando parênteses para sobrescrever a precedência + +Às vezes, você pode querer que certas partes da sua expressão sejam executadas primeiro, independentemente das regras de precedência. Você pode usar parênteses, `()`, para isso. Tudo que estiver dentro dos parênteses é avaliado primeiro, não importa o que aconteça. Vamos fazer a parte `2 + 3` do exemplo da multiplicação ser avaliada primeiro: :::interactive_editor ```js -const result = 2 + 6 / 3; +const result = (2 + 3) * 4; -console.log(result); // 4 +console.log(result); // 20 ``` ::: -Se o JavaScript avaliasse essa expressão da esquerda para a direita, você poderia esperar `2 + 6 = 8` e depois `8 / 3 = 2.67`. Mas como a divisão tem precedência maior que a adição, o JavaScript avalia a divisão primeiro: `6 / 3 = 2` e depois soma `2 + 2`, dando o resultado `4`. +No exemplo acima, os parênteses forçam o JavaScript a avaliar `2 + 3` primeiro e depois multiplicar o resultado por `4`. Isto lhe dá `20` em vez de `14`. Então, tanto na multiplicação quanto na divisão, essas operações sempre ocorrerão antes da adição e subtração a menos que você use parênteses para alterar a ordem. O que acontece se os operadores tiverem a mesma precedência? JavaScript usa associatividade para determinar a ordem de avaliação deles. +## Entendendo a associatividade + Associatividade é o que diz ao JavaScript se deve avaliar os operadores da esquerda para a direita ou da direita para a esquerda. Para a maioria dos operadores como adição e multiplicação, a associatividade é da esquerda para a direita. Então, o JavaScript processa esses do lado mais à esquerda da expressão para o direito: :::interactive_editor @@ -84,6 +96,8 @@ console.log(a + b); // 10 No exemplo acima, JavaScript atribui `5` a `b` primeiro, depois atribui `b` (que agora é `5`) a `a`. +### O operador de expoente + O operador de exponenciação também é associativo da direita para a esquerda: :::interactive_editor @@ -96,7 +110,7 @@ console.log(result); // 512 ::: -Primeiro, JavaScript avalia `3 ** 2`, que é igual a `9`, depois, ele avalia `2 ** 9`, que é igual a `512`. Se o operador de exponenciação tivesse associatividade da esquerda para a direita, o JavaScript teria calculado `2 ** 3` primeiro para obter `8` e depois `8 ** 2` para obter `64`.  +Primeiro, JavaScript avalia `3 ** 2`, que é igual a `9`, depois, ele avalia `2 ** 9`, que é igual a `512`. Se o operador de exponenciação tivesse associatividade da esquerda para a direita, o JavaScript teria calculado `2 ** 3` primeiro para obter `8` e depois `8 ** 2` para obter `64`. # --questions-- diff --git a/curriculum/challenges/portuguese/blocks/lecture-working-with-regular-expressions/6733c5e54e3a154c8078ed48.md b/curriculum/challenges/portuguese/blocks/lecture-working-with-regular-expressions/6733c5e54e3a154c8078ed48.md index c85b7364fed..193e317a77e 100644 --- a/curriculum/challenges/portuguese/blocks/lecture-working-with-regular-expressions/6733c5e54e3a154c8078ed48.md +++ b/curriculum/challenges/portuguese/blocks/lecture-working-with-regular-expressions/6733c5e54e3a154c8078ed48.md @@ -17,6 +17,8 @@ const regex = /^\d\d\d\d$/; E isso funciona: vai corresponder a quatro caracteres numéricos. Mas em vez de ter que escrever a mesma classe várias vezes, você pode usar um quantificador. +## Quantificadores exatos + Quantificadores são definidos por chaves contendo um ou dois números. Vamos usar um quantificador no nosso padrão: ```js @@ -40,6 +42,8 @@ console.log(regex.test("1234567")); // false O padrão corresponde apenas à string com exatamente quatro dígitos, porque usamos os âncoras e nosso quantificador permite apenas exatamente quatro dígitos. Mas talvez o código de identificação precise ter no mínimo quatro dígitos. +## Quantificadores mínimo e máximo + Para permitir quatro ou mais dígitos, adicione uma vírgula após o número no seu quantificador: ```js @@ -84,6 +88,10 @@ console.log(regex.test("1234567")); // false Note que você não pode usar essa sintaxe para definir apenas um máximo: sempre deve definir um mínimo. Mas se definir o mínimo como `1`, pode efetivamente alcançar o mesmo resultado. +## Quantificadores abreviados + +### O quantificador de ponto de interrogação (`?`) + Recebemos requisitos atualizados dos nossos usuários. Identificadores agora podem opcionalmente começar com uma letra. Já sabemos a classe de caracteres para isso, então vamos adicioná-la à nossa expressão regular: ```js @@ -122,6 +130,8 @@ console.log(regex.test("1234567")); // false Nosso padrão agora permite uma única letra opcional, seguida por quatro a seis dígitos. +### O quantificador asterisco (`*`) + Infelizmente, acabamos de perceber que lemos os requisitos errado. Precisamos permitir qualquer número de letras antes dos números. Podemos usar nosso quantificador com um mínimo de `0` e sem máximo definido: ```js @@ -144,6 +154,8 @@ console.log(regex.test("1234567")); // false ::: +### O quantificador mais (`+`) + Agora correspondemos com sucesso a qualquer identificador com zero ou mais letras seguidas de quatro a seis números. Mas isso está travando nosso sistema: na verdade precisamos exigir pelo menos uma letra. Novamente, poderíamos usar um quantificador com mínimo um e sem máximo definido, ou poderíamos usar outra sintaxe especial, o símbolo mais (`+`): diff --git a/curriculum/challenges/portuguese/blocks/lecture-working-with-the-dom-click-events-and-web-apis/673368ccf52205329b729378.md b/curriculum/challenges/portuguese/blocks/lecture-working-with-the-dom-click-events-and-web-apis/673368ccf52205329b729378.md index d60ac0b50a7..dbb825f10d1 100644 --- a/curriculum/challenges/portuguese/blocks/lecture-working-with-the-dom-click-events-and-web-apis/673368ccf52205329b729378.md +++ b/curriculum/challenges/portuguese/blocks/lecture-working-with-the-dom-click-events-and-web-apis/673368ccf52205329b729378.md @@ -7,13 +7,17 @@ dashedName: what-is-the-difference-between-innertext-textcontent-and-innerhtml # --interactive-- +## Visão geral + Vamos aprender sobre `innerText`, `textContent` e `innerHTML`. Estas são propriedades que você pode acessar em JavaScript para obter ou alterar o conteúdo de um elemento HTML. Mesmo que possam parecer muito semelhantes à primeira vista, eles têm diferenças-chave. Escolher o correto depende do seu caso de uso específico, então vamos mergulhar nisso. Vamos começar com `innerText`. -`innerText` representa o conteúdo de texto visível do elemento HTML e seus descendentes. Esta propriedade não inclui texto oculto ou tags HTML, apenas texto renderizado. +## Entendendo o innerText + +`innerText` representa o conteúdo de texto visível do elemento HTML e seus descendentes. Esta propriedade não inclui texto oculto ou tags HTML, apenas texto renderizado. Por exemplo, aqui você pode ver um elemento `div` que contém dois parágrafos: @@ -107,7 +111,9 @@ container.innerText = "JavaScript is awesome!"; Como `innerText` leva em conta a visibilidade, obter seu valor aciona um processo chamado "reflow", que recalcula a posição de certos elementos no site. Este processo pode ser computacionalmente intensivo, então você deve evitar acioná-lo se possível. -Ótimo. Agora vamos falar sobre `textContent`. +Ótimo. Agora vamos falar sobre `textContent`. + +## Entendendo o textContent `textContent` retorna o conteúdo de texto simples de um elemento, incluindo todo o texto dentro de seus descendentes. @@ -181,6 +187,8 @@ container.textContent = "New content"; ::: +## Comparando com o innerHTML + E finalmente, vamos falar sobre como `textContent` e `innerText` diferem de `innerHTML`. Lembre-se que com `innerHTML` você pode definir o conteúdo HTML interno de um elemento. Isso é útil para injetar novo HTML no DOM dinamicamente. @@ -189,6 +197,8 @@ No entanto, lembre-se de que isso representa um risco de segurança se você nã Para evitar isso, é recomendado usar a propriedade `textContent` para inserir texto simples em vez disso. +## Recapitulação das principais diferenças + As propriedades `innerText`, `textContent` e `innerHTML` em JavaScript fornecem diferentes maneiras de acessar e manipular o conteúdo dos elementos HTML. Você deve entender as diferenças entre essas propriedades se seu objetivo for trabalhar com conteúdo HTML em JavaScript de forma eficaz. # --questions-- diff --git a/curriculum/challenges/portuguese/blocks/machine-learning-with-python-projects/5e46f8d6ac417301a38fb92d.md b/curriculum/challenges/portuguese/blocks/machine-learning-with-python-projects/5e46f8d6ac417301a38fb92d.md index 6a56ca541f3..b8b07151180 100644 --- a/curriculum/challenges/portuguese/blocks/machine-learning-with-python-projects/5e46f8d6ac417301a38fb92d.md +++ b/curriculum/challenges/portuguese/blocks/machine-learning-with-python-projects/5e46f8d6ac417301a38fb92d.md @@ -10,7 +10,7 @@ dashedName: rock-paper-scissors Neste desafio, você vai criar um programa para jogar Pedra, papel e tesoura. Um programa com decisões aleatórias tem uma taxa de vitória média de 50%. Para passar no desafio, seu programa vai enfrentar quatro robôs diferentes e deve vencer pelo menos 60% dos jogos contra cada um. -Você estará <a href="https://app.ona.com/?autostart=true#https://github.com/freeCodeCamp/boilerplate-rock-paper-scissors/" target="_blank" rel="noopener noreferrer nofollow">trabalhando neste projeto com nosso código inicial Ona</a>. +Você vai <a href="https://codespaces.new/freeCodeCamp/boilerplate-rock-paper-scissors/" target="_blank" rel="noopener noreferrer nofollow">trabalhar neste projeto com nosso código inicial</a>. Ainda estamos desenvolvendo a parte instrucional interativa do currículo de aprendizagem de máquina. Por enquanto, você terá que usar outros recursos para aprender a vencer este desafio. @@ -26,7 +26,7 @@ O arquivo `RPS.py` mostra uma função de exemplo que você precisará atualizar ## Desenvolvimento -Não modifique `RPS_game.py`. Escreva todo o seu código em `RPS.py`. Para o desenvolvimento, você pode usar `main.py` para testar o seu código. +Não modifique `RPS_game.py`. Escreva todo o seu código em `RPS.py`. Para o desenvolvimento, você pode usar `main.py` para testar o seu código. `main.py` importa a função do jogo e os bots de `RPS_game.py`. diff --git a/curriculum/challenges/portuguese/blocks/review-introduction-to-express/6a0354d43d4c00eca38561f7.md b/curriculum/challenges/portuguese/blocks/review-introduction-to-express/6a0354d43d4c00eca38561f7.md index 0e787972277..ee10a0ba567 100644 --- a/curriculum/challenges/portuguese/blocks/review-introduction-to-express/6a0354d43d4c00eca38561f7.md +++ b/curriculum/challenges/portuguese/blocks/review-introduction-to-express/6a0354d43d4c00eca38561f7.md @@ -7,53 +7,6 @@ dashedName: review-introduction-to-express # --description-- -## Serviços web e APIs - -- **API (interface de programação de aplicações)**: Uma forma geral de software se comunicar com outro software. -- **Serviço web**: Um tipo específico de API que usa tecnologias web como HTTP para trocar dados pela rede. Todo serviço web é uma API, mas nem toda API é um serviço web. -- **Características principais de um serviço web**: roda em um servidor, habilita comunicação máquina a máquina, é independente de linguagem, é independente de plataforma e usa protocolos web padrão (HTTP/HTTPS, FTP, SMTP). -- **REST (transferência de estado representacional)**: O tipo de serviço web mais usado hoje. Expõe recursos identificados por caminhos URL como `/users` ou `/users/20`. As respostas geralmente são em JSON, mas também podem ser XML ou texto simples. -- **SOAP (protocolo simples de acesso a objetos)**: Usa apenas XML. Comum em sistemas empresariais que precisam de padrões e segurança mais rigorosos. -- **XML-RPC**: Usa XML para codificar requisições e respostas. Leve, mas menos flexível que REST. -- **Cabeçalho `Accept`**: Usado por um cliente para informar ao servidor qual formato de resposta deseja, por exemplo `Accept: application/json`. - -## A arquitetura REST - -- **Sem estado**: Cada requisição deve incluir todas as informações que o servidor precisa para processá-la. O servidor não lembra requisições anteriores. -- **Recurso**: Um dado que pode ser acessado ou modificado, identificado por uma URL (por exemplo, `/products/1`). -- **Métodos HTTP no REST**: - - `GET` — recuperar um recurso - - `POST` — criar um novo recurso - - `PUT` / `PATCH` — atualizar um recurso existente - - `DELETE` — remover um recurso - -## Códigos de status HTTP - -Após processar uma requisição, o servidor responde com um **código de status** que indica o resultado: - -- `200` **(OK)**: A requisição foi bem-sucedida -- `201` **(Criado)**: Um novo recurso foi criado -- `400` **(Requisição inválida)**: O cliente enviou dados inválidos -- `404` **(Não encontrado)**: O recurso solicitado não existe -- `500` **(Erro interno do servidor)**: Ocorreu um erro no servidor - -### Como funciona uma requisição REST - -1. O cliente envia uma requisição com método, URL, cabeçalhos opcionais e corpo opcional. -2. O servidor valida a requisição e identifica o recurso. -3. O servidor executa a ação (obter, criar, atualizar ou excluir). -4. O servidor monta uma resposta com código de status e corpo opcional (geralmente JSON). -5. O servidor envia a resposta — nenhum estado do cliente é armazenado. -6. O cliente verifica o código de status e processa os dados retornados. - -## Monólitos vs. microsserviços - -- **Monólito**: Um único código grande onde a interface, banco de dados e API vivem juntos. Funciona bem para apps pequenos, mas fica mais difícil de manter e escalar conforme cresce. -- **Microsserviços**: Uma arquitetura onde um app grande é dividido em serviços menores e independentes. Cada serviço trata uma capacidade de negócio (por exemplo, produtos, pedidos, pagamentos) e pode ter seu próprio código, banco de dados e equipe. -- **Como microsserviços se comunicam**: Por APIs ou sistemas baseados em mensagens. -- **Vantagens dos microsserviços**: desenvolvimento mais rápido, melhor isolamento de falhas e liberdade para usar linguagens ou frameworks diferentes por serviço. -- **Desafios dos microsserviços**: depuração mais complexa, gestão de infraestrutura mais difícil e mais overhead de rede entre serviços. - ## O que é Express.js? - **Express**: Um framework web minimalista e flexível construído sobre Node.js que facilita criar servidores web e APIs. diff --git a/curriculum/challenges/portuguese/blocks/review-rest-api-and-web-services/6a7c78ad958a597ee788ad2a.md b/curriculum/challenges/portuguese/blocks/review-rest-api-and-web-services/6a7c78ad958a597ee788ad2a.md new file mode 100644 index 00000000000..ca499440fe2 --- /dev/null +++ b/curriculum/challenges/portuguese/blocks/review-rest-api-and-web-services/6a7c78ad958a597ee788ad2a.md @@ -0,0 +1,59 @@ +--- +id: 6a7c78ad958a597ee788ad2a +title: Revisão de API REST e serviços web +challengeType: 31 +dashedName: review-rest-api-and-web-services +--- + +# --description-- + +## Serviços web e APIs + +- **API (interface de programação de aplicações)**: Uma forma geral de software se comunicar com outro software. +- **Serviço web**: Um tipo específico de API que usa tecnologias web como HTTP para trocar dados pela rede. Todo serviço web é uma API, mas nem toda API é um serviço web. +- **Características principais de um serviço web**: roda em um servidor, habilita comunicação máquina a máquina, é independente de linguagem, é independente de plataforma e usa protocolos web padrão (HTTP/HTTPS, FTP, SMTP). +- **REST (transferência de estado representacional)**: O tipo de serviço web mais usado hoje. Expõe recursos identificados por caminhos URL como `/users` ou `/users/20`. As respostas geralmente são em JSON, mas também podem ser XML ou texto simples. +- **SOAP (protocolo simples de acesso a objetos)**: Usa apenas XML. Comum em sistemas empresariais que precisam de padrões e segurança mais rigorosos. +- **XML-RPC**: Usa XML para codificar requisições e respostas. Leve, mas menos flexível que REST. +- **Cabeçalho `Accept`**: Usado por um cliente para informar ao servidor qual formato de resposta deseja, por exemplo `Accept: application/json`. + +## A arquitetura REST + +- **Sem estado**: Cada requisição deve incluir todas as informações que o servidor precisa para processá-la. O servidor não lembra requisições anteriores. +- **Recurso**: Um dado que pode ser acessado ou modificado, identificado por uma URL (por exemplo, `/products/1`). +- **Métodos HTTP no REST**: + - `GET` — recuperar um recurso + - `POST` — criar um novo recurso + - `PUT` / `PATCH` — atualizar um recurso existente + - `DELETE` — remover um recurso + +## Códigos de status HTTP + +Após processar uma requisição, o servidor responde com um **código de status** que indica o resultado: + +- `200` **(OK)**: A requisição foi bem-sucedida +- `201` **(Criado)**: Um novo recurso foi criado +- `400` **(Requisição inválida)**: O cliente enviou dados inválidos +- `404` **(Não encontrado)**: O recurso solicitado não existe +- `500` **(Erro interno do servidor)**: Ocorreu um erro no servidor + +### Como funciona uma requisição REST + +1. O cliente envia uma requisição com método, URL, cabeçalhos opcionais e corpo opcional. +2. O servidor valida a requisição e identifica o recurso. +3. O servidor executa a ação (obter, criar, atualizar ou excluir). +4. O servidor monta uma resposta com código de status e corpo opcional (geralmente JSON). +5. O servidor envia a resposta — nenhum estado do cliente é armazenado. +6. O cliente verifica o código de status e processa os dados retornados. + +## Monólitos vs. microsserviços + +- **Monólito**: Um único código grande onde a interface, banco de dados e API vivem juntos. Funciona bem para apps pequenos, mas fica mais difícil de manter e escalar conforme cresce. +- **Microsserviços**: Uma arquitetura onde um app grande é dividido em serviços menores e independentes. Cada serviço trata uma capacidade de negócio (por exemplo, produtos, pedidos, pagamentos) e pode ter seu próprio código, banco de dados e equipe. +- **Como microsserviços se comunicam**: Por APIs ou sistemas baseados em mensagens. +- **Vantagens dos microsserviços**: desenvolvimento mais rápido, melhor isolamento de falhas e liberdade para usar linguagens ou frameworks diferentes por serviço. +- **Desafios dos microsserviços**: depuração mais complexa, gestão de infraestrutura mais difícil e mais overhead de rede entre serviços. + +# --assignment-- + +Revise os tópicos e conceitos de API REST e serviços web. diff --git a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e89d557d4b78bf83a02ae6.md b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e89d557d4b78bf83a02ae6.md index 756879106ef..304473b0070 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e89d557d4b78bf83a02ae6.md +++ b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e89d557d4b78bf83a02ae6.md @@ -396,10 +396,10 @@ body { const { useState } = React; export const FootballPlayerCard = () => { - return ( + return ( --fcc-editable-region-- - <h1 style={{ backgroundColor: '#fff' }}>Hello, TSX!</h1> + <h1 style={{ backgroundColor: "#fff" }}>Hello, TSX!</h1> --fcc-editable-region-- - ) + ); }; ``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb2.md b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb2.md index 33d4e5ddce6..811b53ffa67 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb2.md +++ b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb2.md @@ -29,12 +29,10 @@ assert.equal(element?.type, window.index.PlayerCard); <meta charset="utf-8"/> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Football Player Card Builder - - - + @@ -379,21 +377,18 @@ body { ```tsx const { useState } = React; -export function PlayerCard() { +export const PlayerCard = () => { return ( -
- -
+
); -} +}; export const FootballPlayerCard = () => { - + --fcc-editable-region-- return ( - --fcc-editable-region-- -

Football Card Builder

- --fcc-editable-region-- - ) +

Football Card Builder

+ ); + --fcc-editable-region-- }; ``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb3.md b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb3.md index 0cb6c200cfa..c5241a1858d 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb3.md +++ b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb3.md @@ -382,15 +382,13 @@ export const PlayerCard = () => { return (
--fcc-editable-region-- - + --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { - return ( - - ); + return ; }; ``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb4.md b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb4.md index 1509cfb9ff4..cc5f23ff206 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb4.md +++ b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb4.md @@ -381,12 +381,12 @@ export const PlayerCard = () => {
--fcc-editable-region-- - + --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb5.md b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb5.md index 2b5e45715c0..97ea1604de1 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb5.md +++ b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb5.md @@ -1,6 +1,6 @@ --- id: 69e8b295388ebbd517692bb5 -title: passo 6 +title: Passo 6 challengeType: 0 dashedName: step-6 --- @@ -394,13 +394,13 @@ export const PlayerCard = () => {
--fcc-editable-region-- - + --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb6.md b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb6.md index dfbc80de7e7..6a3576bfc1c 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb6.md +++ b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb6.md @@ -390,14 +390,14 @@ export const PlayerCard = () => {
98
--fcc-editable-region-- - + --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb7.md b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb7.md index 7dc4ce5851b..c38b5af14a2 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb7.md +++ b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb7.md @@ -398,13 +398,13 @@ export const PlayerCard = () => {
ST
--fcc-editable-region-- - + --fcc-editable-region-- ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb8.md b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb8.md index 4b66db88f65..3d510c448a4 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb8.md +++ b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb8.md @@ -394,14 +394,14 @@ export const PlayerCard = () => {
GOLD
--fcc-editable-region-- - + --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb9.md b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb9.md index f3229184a24..d5182832329 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb9.md +++ b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb9.md @@ -393,12 +393,12 @@ export const PlayerCard = () => { --fcc-editable-region-- - + --fcc-editable-region-- ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bba.md b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bba.md index bd34788d2ba..626e7e305c5 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bba.md +++ b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bba.md @@ -412,13 +412,13 @@ export const PlayerCard = () => {
--fcc-editable-region-- - + --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbb.md b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbb.md index 58e59597dfe..eb67e527050 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbb.md +++ b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbb.md @@ -406,12 +406,12 @@ export const PlayerCard = () => { Edson Arantes do Nascimento (Pele) headshot --fcc-editable-region-- - + --fcc-editable-region-- ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbc.md b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbc.md index 79a94dc3786..4c70a0d1f0a 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbc.md +++ b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbc.md @@ -409,12 +409,12 @@ export const PlayerCard = () => { PELE --fcc-editable-region-- - + --fcc-editable-region-- ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbd.md b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbd.md index a52ff702ec2..9e61bfc97b6 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbd.md +++ b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbd.md @@ -427,13 +427,13 @@ export const PlayerCard = () => { --fcc-editable-region-- - + --fcc-editable-region-- ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbe.md b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbe.md index 4ea2ec4777c..bfab24c47b1 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbe.md +++ b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbe.md @@ -465,7 +465,7 @@ export const PlayerCard = () => { ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbf.md b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbf.md index 7cc00ec6b9f..342fc2137a6 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbf.md +++ b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbf.md @@ -420,7 +420,7 @@ interface PlayerData { position: string; club: string; --fcc-editable-region-- - + --fcc-editable-region-- } @@ -478,7 +478,7 @@ export const PlayerCard = () => { ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc0.md b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc0.md index f004da6d4df..3bf1a978e47 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc0.md +++ b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc0.md @@ -497,7 +497,7 @@ export const PlayerCard = () => { ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc1.md b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc1.md index 2281752a6ba..40c1d337ea3 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc1.md +++ b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc1.md @@ -398,10 +398,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } --fcc-editable-region-- @@ -460,7 +460,7 @@ export const PlayerCard = () => { ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc2.md b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc2.md index 7f5b58754e3..24b5a4e71a3 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc2.md +++ b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc2.md @@ -40,12 +40,10 @@ assert.exists(document.querySelector('.card-wrapper.tier-elite')); Football Player Card Builder - - - + @@ -405,10 +403,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -467,9 +465,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc3.md b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc3.md index fd760f86e6e..c93754c8f47 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc3.md +++ b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc3.md @@ -399,10 +399,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -461,9 +461,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc4.md b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc4.md index 6fa316d1f32..e2717a4a389 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc4.md +++ b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc4.md @@ -399,10 +399,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -461,9 +461,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc5.md b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc5.md index 4116c0af1e9..b53bb316854 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc5.md +++ b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc5.md @@ -392,10 +392,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -456,9 +456,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc6.md b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc6.md index ed44bf68298..c082eb6bb80 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc6.md +++ b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc6.md @@ -401,10 +401,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -465,9 +465,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc7.md b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc7.md index 229df0e2a35..5d8c1f22aa7 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc7.md +++ b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc7.md @@ -391,10 +391,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -455,9 +455,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc8.md b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc8.md index 7f2d911807a..4ab46af9e91 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc8.md +++ b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc8.md @@ -407,10 +407,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -436,9 +436,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { {player.name}
- --fcc-editable-region--
+ --fcc-editable-region-- 97 PAC
@@ -448,10 +448,10 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
83 + --fcc-editable-region-- PAS
- --fcc-editable-region--
@@ -471,9 +471,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc9.md b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc9.md index 52e5049a965..1963a80c9aa 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc9.md +++ b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc9.md @@ -483,10 +483,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -545,13 +545,13 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
); -} +}; --fcc-editable-region-- --fcc-editable-region-- export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bca.md b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bca.md index 5db6de95a69..7a6d8d5d50a 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bca.md +++ b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bca.md @@ -419,10 +419,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -481,14 +481,14 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { - name: 'PELE', + name: "PELE", overallRating: 98, - position: 'ST', - club: 'Santos FC', - imageUrl: 'https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg', + position: "ST", + club: "Santos FC", + imageUrl: "https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg", pac: 97, sho: 98, pas: 83, diff --git a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcb.md b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcb.md index e0015f2c514..4dabbfe728a 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcb.md +++ b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcb.md @@ -435,10 +435,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -497,14 +497,14 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { - name: 'PELE', + name: "PELE", overallRating: 98, - position: 'ST', - club: 'Santos FC', - imageUrl: 'https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg', + position: "ST", + club: "Santos FC", + imageUrl: "https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg", pac: 97, sho: 98, pas: 83, @@ -517,6 +517,7 @@ export const FootballPlayerCard = () => { const [player, setPlayer] = useState(defaultPlayer); return ( --fcc-editable-region-- + --fcc-editable-region-- ); diff --git a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcc.md b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcc.md index 90b647b0a0f..e6eb06edeba 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcc.md +++ b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcc.md @@ -477,7 +477,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -504,7 +504,9 @@ export const FootballPlayerCard = () => { --fcc-editable-region-- + + --fcc-editable-region-- ); diff --git a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcd.md b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcd.md index 578599f85bc..d04b9cb21f4 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcd.md +++ b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcd.md @@ -465,7 +465,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bce.md b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bce.md index 7cc900ea60f..dbafd3396c5 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bce.md +++ b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bce.md @@ -470,7 +470,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcf.md b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcf.md index 9e349d599b7..f99ba431db2 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcf.md +++ b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcf.md @@ -488,7 +488,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd0.md b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd0.md index e70c764e82f..ee515e76b22 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd0.md +++ b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd0.md @@ -471,7 +471,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -542,3 +542,4 @@ export const FootballPlayerCard = () => { ); }; ``` + diff --git a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd1.md b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd1.md index 285211ebc43..9be20339f61 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd1.md +++ b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd1.md @@ -471,7 +471,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd2.md b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd2.md index b01ca128577..e23c2cbff53 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd2.md +++ b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd2.md @@ -471,7 +471,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -535,7 +535,7 @@ export const FootballPlayerCard = () => { - --fcc-editable-region-- + --fcc-editable-region-- --fcc-editable-region-- diff --git a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd3.md b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd3.md index da833157417..d214d0418b5 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd3.md +++ b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd3.md @@ -497,7 +497,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd4.md b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd4.md index d3ea269d77e..14b3337a66d 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd4.md +++ b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd4.md @@ -497,7 +497,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd5.md b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd5.md index 5c6a986fb6e..1309c8588c9 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd5.md +++ b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd5.md @@ -497,7 +497,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd6.md b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd6.md index 0f9c72b817d..13453af8cfe 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd6.md +++ b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd6.md @@ -470,7 +470,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd7.md b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd7.md index 826bd9b5a99..362a182a9c0 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd7.md +++ b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd7.md @@ -478,7 +478,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -609,3 +609,4 @@ export const FootballPlayerCard = () => { ); }; ``` + diff --git a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd8.md b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd8.md index 9f8d8f33d85..eef1f6cd2be 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd8.md +++ b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd8.md @@ -410,7 +410,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -484,7 +484,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -538,8 +538,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd9.md b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd9.md index a0b6c3abe9c..f69ca7729e3 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd9.md +++ b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd9.md @@ -402,7 +402,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -476,7 +476,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -530,8 +530,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bda.md b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bda.md index b0560256ad9..2ba1f5c8041 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bda.md +++ b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bda.md @@ -402,7 +402,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -476,7 +476,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -530,8 +530,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( @@ -640,3 +641,4 @@ export const FootballPlayerCard = () => { ); }; ``` + diff --git a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdb.md b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdb.md index 4b55c9ed959..83d67e6af69 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdb.md +++ b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdb.md @@ -402,7 +402,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -476,7 +476,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -530,8 +530,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdc.md b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdc.md index 642a788e197..db738a806ba 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdc.md +++ b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdc.md @@ -402,7 +402,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -476,7 +476,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -530,8 +530,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdd.md b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdd.md index c3f7eae2608..2cf881d8701 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdd.md +++ b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdd.md @@ -402,7 +402,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -476,7 +476,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -530,8 +530,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bde.md b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bde.md index 686f7edac38..df16c8f0e07 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bde.md +++ b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bde.md @@ -402,7 +402,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -414,10 +414,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -430,7 +430,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
{player.position}
-
{getPlayerTier(player.overallRating).toUpperCase()}
+
+ {getPlayerTier(player.overallRating).toUpperCase()} +
{player.club}
@@ -474,14 +476,14 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { - name: 'PELE', + name: "PELE", overallRating: 98, - position: 'ST', - club: 'Santos FC', - imageUrl: 'https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg', + position: "ST", + club: "Santos FC", + imageUrl: "https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg", pac: 97, sho: 98, pas: 83, @@ -506,8 +508,18 @@ export const FootballPlayerCard = () => {

Player Info

- - setPlayer({ ...player, name: e.target.value })} /> + + + setPlayer({ ...player, name: e.target.value }) + } + />
@@ -518,8 +530,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( @@ -531,46 +544,115 @@ export const FootballPlayerCard = () => {
- - setPlayer({ ...player, overallRating: Number(e.target.value) })} /> + + + setPlayer({ + ...player, + overallRating: Number(e.target.value), + }) + } + />
- - setPlayer({ ...player, club: e.target.value })} /> + + + setPlayer({ ...player, club: e.target.value }) + } + />
- - setPlayer({ ...player, imageUrl: e.target.value })} /> + + + setPlayer({ ...player, imageUrl: e.target.value }) + } + />

Player Stats

- - setPlayer({ ...player, pac: Number(e.target.value) })} /> + + + setPlayer({ ...player, pac: Number(e.target.value) }) + } + />
- - setPlayer({ ...player, sho: Number(e.target.value) })} /> + + + setPlayer({ ...player, sho: Number(e.target.value) }) + } + />
- - setPlayer({ ...player, pas: Number(e.target.value) })} /> + + + setPlayer({ ...player, pas: Number(e.target.value) }) + } + />
- + --fcc-editable-region-- --fcc-editable-region--
- +
- +
@@ -579,7 +661,9 @@ export const FootballPlayerCard = () => {

Live Preview

Updates as you type

-
+
@@ -589,3 +673,4 @@ export const FootballPlayerCard = () => { ); }; ``` + diff --git a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdf.md b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdf.md index f2d32764b89..7b0083b74da 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdf.md +++ b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdf.md @@ -421,7 +421,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -495,7 +495,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -549,8 +549,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( @@ -667,11 +668,11 @@ export const FootballPlayerCard = () => { } /> - --fcc-editable-region--
+ --fcc-editable-region--
@@ -679,8 +680,8 @@ export const FootballPlayerCard = () => { PHY -
--fcc-editable-region-- + diff --git a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8d1be04ed6aad1c955729.md b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8d1be04ed6aad1c955729.md index 068d177ba36..80db2cabf2f 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8d1be04ed6aad1c955729.md +++ b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69e8d1be04ed6aad1c955729.md @@ -391,8 +391,8 @@ const { useState } = React; --fcc-editable-region-- export const FootballPlayerCard = () => { - return ( -

Football Card Builder

- ) + return ( +

Football Card Builder

+ ); }; ``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69ea01c45b04f3e9de845036.md b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69ea01c45b04f3e9de845036.md index 57860cf1ea4..b9bbea462ba 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69ea01c45b04f3e9de845036.md +++ b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69ea01c45b04f3e9de845036.md @@ -405,7 +405,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -483,7 +483,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -537,8 +537,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69ea02adff0fd528639ee23b.md b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69ea02adff0fd528639ee23b.md index 6da70f17ec9..48ec08255df 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69ea02adff0fd528639ee23b.md +++ b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69ea02adff0fd528639ee23b.md @@ -409,7 +409,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -485,7 +485,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -543,8 +543,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69ea0349f8305a99324465ff.md b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69ea0349f8305a99324465ff.md index e839f771311..e6559c98ebe 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69ea0349f8305a99324465ff.md +++ b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69ea0349f8305a99324465ff.md @@ -407,7 +407,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -483,7 +483,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -502,11 +502,9 @@ const defaultPlayer: PlayerData = { function loadPlayer(): PlayerData { try { --fcc-editable-region-- - - --fcc-editable-region-- - } catch (error) { - } + --fcc-editable-region-- + } catch (error) {} } export const FootballPlayerCard = () => { @@ -547,8 +545,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69ea044f8c93a5e7ce64214c.md b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69ea044f8c93a5e7ce64214c.md index 150d05d57ad..587f12666d4 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69ea044f8c93a5e7ce64214c.md +++ b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69ea044f8c93a5e7ce64214c.md @@ -395,7 +395,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -471,7 +471,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -492,12 +492,10 @@ function loadPlayer(): PlayerData { const saved = localStorage.getItem(STORAGE_KEY); if (saved) { --fcc-editable-region-- - + --fcc-editable-region-- - }; - } catch (error) { - - } + } + } catch (error) {} } export const FootballPlayerCard = () => { @@ -538,8 +536,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69ea0577f25e519489353f82.md b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69ea0577f25e519489353f82.md index 86262ce402d..d7db575556a 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69ea0577f25e519489353f82.md +++ b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69ea0577f25e519489353f82.md @@ -405,7 +405,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -418,7 +418,6 @@ interface PlayerData { const STORAGE_KEY = "football_player_card"; - export function getPlayerTier(rating: number): string { if (rating >= 92) return "elite"; if (rating >= 85) return "gold"; @@ -482,7 +481,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -505,14 +504,15 @@ function loadPlayer(): PlayerData { return { ...defaultPlayer, ...JSON.parse(saved) - } - }; ---fcc-editable-region-- + }; + } } catch (error) { +--fcc-editable-region-- } -} + --fcc-editable-region-- +} export const FootballPlayerCard = () => { const [player, setPlayer] = useState(defaultPlayer); @@ -552,8 +552,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69ea064edb0dcc46e1422cca.md b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69ea064edb0dcc46e1422cca.md index 45bf15ec4a4..969c346025a 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69ea064edb0dcc46e1422cca.md +++ b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69ea064edb0dcc46e1422cca.md @@ -401,7 +401,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -477,7 +477,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -500,8 +500,8 @@ function loadPlayer(): PlayerData { return { ...defaultPlayer, ...JSON.parse(saved) - } - }; + }; + } } catch (error) { console.log("Failed to load player data, using defaults:", error); } @@ -546,8 +546,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69ea0939f2f92cfc6c7a850d.md b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69ea0939f2f92cfc6c7a850d.md index ec6305b9fb3..bdae61dc436 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69ea0939f2f92cfc6c7a850d.md +++ b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69ea0939f2f92cfc6c7a850d.md @@ -46,12 +46,10 @@ assert.match(__helpers.removeJSComments(code), /useEffect\s*\(\(\)\s=>\s*\{\s*tr Football Player Card Builder - - - + @@ -415,7 +413,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -435,7 +433,7 @@ export function getPlayerTier(rating: number): string { return "bronze"; } -function PlayerCard({ player }: { player: PlayerData }) { +export const PlayerCard = ({ player }: { player: PlayerData }) => { return (
@@ -491,7 +489,7 @@ function PlayerCard({ player }: { player: PlayerData }) {
); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -514,8 +512,8 @@ function loadPlayer(): PlayerData { return { ...defaultPlayer, ...JSON.parse(saved) - } - }; + }; + } } catch (error) { console.log("Failed to load player data, using defaults:", error); } @@ -526,7 +524,7 @@ export const FootballPlayerCard = () => { const [player, setPlayer] = useState(defaultPlayer); --fcc-editable-region-- - + --fcc-editable-region-- return ( @@ -565,8 +563,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69ea0a89bd84cf2461b48ceb.md b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69ea0a89bd84cf2461b48ceb.md index 9c43709cf71..cb28a0756aa 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69ea0a89bd84cf2461b48ceb.md +++ b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69ea0a89bd84cf2461b48ceb.md @@ -403,7 +403,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -479,7 +479,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -502,8 +502,8 @@ function loadPlayer(): PlayerData { return { ...defaultPlayer, ...JSON.parse(saved) - } - }; + }; + } } catch (error) { console.log("Failed to load player data, using defaults:", error); } @@ -513,15 +513,15 @@ function loadPlayer(): PlayerData { export const FootballPlayerCard = () => { const [player, setPlayer] = useState(defaultPlayer); ---fcc-editable-region-- useEffect(() => { try { +--fcc-editable-region-- } catch (error) { +--fcc-editable-region-- } }, [player]); ---fcc-editable-region-- return (
@@ -559,8 +559,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69ea0bb3e7000f44c207bb0e.md b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69ea0bb3e7000f44c207bb0e.md index 55ebc0d5a0a..e4455b57164 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69ea0bb3e7000f44c207bb0e.md +++ b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69ea0bb3e7000f44c207bb0e.md @@ -401,7 +401,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -477,7 +477,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -500,8 +500,8 @@ function loadPlayer(): PlayerData { return { ...defaultPlayer, ...JSON.parse(saved) - } - }; + }; + } } catch (error) { console.log("Failed to load player data, using defaults:", error); } @@ -557,8 +557,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( @@ -1098,7 +1099,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -1174,7 +1175,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -1197,8 +1198,8 @@ function loadPlayer(): PlayerData { return { ...defaultPlayer, ...JSON.parse(saved) - } - }; + }; + } } catch (error) { console.log("Failed to load player data, using defaults:", error); } @@ -1252,8 +1253,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69ea1bb4a66dd6debb999c7f.md b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69ea1bb4a66dd6debb999c7f.md index fc08c656c26..c5b66fe794a 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69ea1bb4a66dd6debb999c7f.md +++ b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69ea1bb4a66dd6debb999c7f.md @@ -473,7 +473,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69ea1dd8e74976afa407bf22.md b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69ea1dd8e74976afa407bf22.md index db1dd944389..c491d8a8a38 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69ea1dd8e74976afa407bf22.md +++ b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69ea1dd8e74976afa407bf22.md @@ -479,7 +479,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69ea1ed1543a4db863564aac.md b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69ea1ed1543a4db863564aac.md index 55e0a516616..bc5208949de 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69ea1ed1543a4db863564aac.md +++ b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69ea1ed1543a4db863564aac.md @@ -472,7 +472,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69ea21dcd8c4cb48c23a2c67.md b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69ea21dcd8c4cb48c23a2c67.md index fc758428f42..eea56d9b19f 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69ea21dcd8c4cb48c23a2c67.md +++ b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69ea21dcd8c4cb48c23a2c67.md @@ -14,7 +14,7 @@ Adicione um conjunto de atributos `onChange` para uma arrow function que recebe Sua posição `select` deve ter um manipulador `onChange` que faz uma chamada `setPlayer` com um spread de `player` e atualiza `position`. ```js -assert.match(__helpers.removeJSComments(code), /onChange.*setPlayer.*\.\.\.\s*player[\s\S]*position/); +assert.match(__helpers.removeJSComments(code), /onChange=\{[\s\S]*?position:\s*e\.target\.value\s+as\s+Position/); ``` # --seed-- @@ -469,7 +469,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69ea2378f3c6a60a57cc29c3.md b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69ea2378f3c6a60a57cc29c3.md index 0c09aec05d9..34e1e7da3a7 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69ea2378f3c6a60a57cc29c3.md +++ b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69ea2378f3c6a60a57cc29c3.md @@ -483,7 +483,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -537,10 +537,12 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > --fcc-editable-region-- - + --fcc-editable-region-- diff --git a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69eb216380522cfc11aa408c.md b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69eb216380522cfc11aa408c.md index ff2c88888d5..9cb48843a88 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69eb216380522cfc11aa408c.md +++ b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69eb216380522cfc11aa408c.md @@ -1,6 +1,6 @@ --- id: 69eb216380522cfc11aa408c -title: passo 15 +title: Passo 15 challengeType: 0 dashedName: step-15 --- @@ -443,7 +443,7 @@ export const PlayerCard = () => { ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69eb23665c115447405343ac.md b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69eb23665c115447405343ac.md index 6de96010af6..252759d6d4b 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69eb23665c115447405343ac.md +++ b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69eb23665c115447405343ac.md @@ -1,6 +1,6 @@ --- id: 69eb23665c115447405343ac -title: passo 18 +title: Passo 18 challengeType: 0 dashedName: step-18 --- @@ -461,7 +461,7 @@ export const PlayerCard = () => { ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69eb2847cc8f5638e226e8ce.md b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69eb2847cc8f5638e226e8ce.md index ad9cacc5f3b..0baf11fd40c 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69eb2847cc8f5638e226e8ce.md +++ b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69eb2847cc8f5638e226e8ce.md @@ -483,10 +483,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -543,7 +543,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { --fcc-editable-region-- diff --git a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69ed3985819de69de27c4390.md b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69ed3985819de69de27c4390.md index 2bceade5e6b..625f26d37cb 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69ed3985819de69de27c4390.md +++ b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69ed3985819de69de27c4390.md @@ -391,10 +391,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -453,14 +453,14 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { - name: 'PELE', + name: "PELE", overallRating: 98, - position: 'ST', - club: 'Santos FC', - imageUrl: 'https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg', + position: "ST", + club: "Santos FC", + imageUrl: "https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg", pac: 97, sho: 98, pas: 83, @@ -471,7 +471,7 @@ const defaultPlayer: PlayerData = { export const FootballPlayerCard = () => { --fcc-editable-region-- - return ; + return ; --fcc-editable-region-- }; ``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69f1a6f57dd2d4685822074a.md b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69f1a6f57dd2d4685822074a.md index ad588e2fc9f..efe2ea7592e 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69f1a6f57dd2d4685822074a.md +++ b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69f1a6f57dd2d4685822074a.md @@ -401,8 +401,8 @@ export const PlayerCard = () => {
- --fcc-editable-region--
+ --fcc-editable-region--
@@ -410,14 +410,14 @@ export const PlayerCard = () => {
-
--fcc-editable-region-- +
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69f1a9e19340f19b1fd051c6.md b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69f1a9e19340f19b1fd051c6.md index 505ecef6071..f8affc75e9c 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69f1a9e19340f19b1fd051c6.md +++ b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69f1a9e19340f19b1fd051c6.md @@ -416,9 +416,9 @@ export const PlayerCard = () => {
- --fcc-editable-region--
+ --fcc-editable-region--
@@ -426,14 +426,14 @@ export const PlayerCard = () => {
+ --fcc-editable-region--
- --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69f1af24b0860d13f0b295e5.md b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69f1af24b0860d13f0b295e5.md index e178af8c9bb..e56b8d8503c 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69f1af24b0860d13f0b295e5.md +++ b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69f1af24b0860d13f0b295e5.md @@ -407,10 +407,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -451,9 +451,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
- --fcc-editable-region--
+ --fcc-editable-region-- 99 DRI
@@ -463,17 +463,17 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
75 + --fcc-editable-region-- PHY
- --fcc-editable-region-- ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69f1b1fb36c6c0c80907e8e1.md b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69f1b1fb36c6c0c80907e8e1.md index 91235e4c3da..c0bf10a383d 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69f1b1fb36c6c0c80907e8e1.md +++ b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69f1b1fb36c6c0c80907e8e1.md @@ -483,7 +483,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -511,17 +511,15 @@ export const FootballPlayerCard = () => {
- --fcc-editable-region-- -
- -
+
+ --fcc-editable-region--
+ --fcc-editable-region--
- --fcc-editable-region-- ); }; diff --git a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69f1b591221851200c734eb4.md b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69f1b591221851200c734eb4.md index 173347340e3..b806851ed3e 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69f1b591221851200c734eb4.md +++ b/curriculum/challenges/portuguese/blocks/workshop-build-a-football-player-card-builder/69f1b591221851200c734eb4.md @@ -472,7 +472,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f356ed6199b0cdef1d2be8f.md b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f356ed6199b0cdef1d2be8f.md index 4e002211b86..2168eb94f5c 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f356ed6199b0cdef1d2be8f.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f356ed6199b0cdef1d2be8f.md @@ -13,11 +13,11 @@ Você aprendeu a trabalhar com seletores `class` em lições anteriores assim: ```css .class-name { - styles + property: value; } ``` -Altere o seletor `#menu` existente para um seletor de classe substituindo `#menu` por uma classe chamada `.menu`. +Altere o seletor `#menu` existente para um seletor de classe substituindo `#menu` pelo seletor de classe `.menu`. # --hints-- diff --git a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f3cade99dda4e6071a85dfd.md b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f3cade99dda4e6071a85dfd.md index 05e42ea3e4d..c0259fb99b3 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f3cade99dda4e6071a85dfd.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f3cade99dda4e6071a85dfd.md @@ -109,7 +109,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f3ef6e01f288a026d709587.md b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f3ef6e01f288a026d709587.md index 29c0251b448..ccf99b192e5 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f3ef6e01f288a026d709587.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f3ef6e01f288a026d709587.md @@ -171,7 +171,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f3ef6e03d719d5ac4738993.md b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f3ef6e03d719d5ac4738993.md index 3312957b131..454ac81f8ed 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f3ef6e03d719d5ac4738993.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f3ef6e03d719d5ac4738993.md @@ -115,7 +115,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f3ef6e04559b939080db057.md b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f3ef6e04559b939080db057.md index e3adff5a821..2c04a4235e0 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f3ef6e04559b939080db057.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f3ef6e04559b939080db057.md @@ -139,7 +139,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f3ef6e050279c7a4a7101d3.md b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f3ef6e050279c7a4a7101d3.md index e734157f10c..70332782071 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f3ef6e050279c7a4a7101d3.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f3ef6e050279c7a4a7101d3.md @@ -137,7 +137,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f3ef6e05473f91f948724ab.md b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f3ef6e05473f91f948724ab.md index 14a54b844cc..a93ca6d8aec 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f3ef6e05473f91f948724ab.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f3ef6e05473f91f948724ab.md @@ -116,6 +116,6 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f3ef6e056bdde6ae6892ba2.md b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f3ef6e056bdde6ae6892ba2.md index 2a9cd462635..3a9eca0cff5 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f3ef6e056bdde6ae6892ba2.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f3ef6e056bdde6ae6892ba2.md @@ -9,7 +9,7 @@ dashedName: step-54 É um pouco chato ler todo um texto com a mesma `font-family`. Você ainda pode ter a maioria do texto em `sans-serif` e fazer apenas os elementos `h1` e `h2` terem um seletor diferente. -Estilize ambos os elementos `h1` e `h2` usando um único seletor de modo que o texto desses elementos use a fonte `Impact`. +Estilize os elementos `h1` e `h2` usando uma única lista de seletores para que o texto desses elementos use a fonte `Impact`. # --hints-- @@ -135,7 +135,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f3ef6e06d34faac0447fc44.md b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f3ef6e06d34faac0447fc44.md index 9e0d01b5180..01e18445c6a 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f3ef6e06d34faac0447fc44.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f3ef6e06d34faac0447fc44.md @@ -127,7 +127,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f3ef6e07276f782bb46b93d.md b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f3ef6e07276f782bb46b93d.md index 00ba38ef707..d487337d982 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f3ef6e07276f782bb46b93d.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f3ef6e07276f782bb46b93d.md @@ -142,7 +142,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f3ef6e0819d4f23ca7285e6.md b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f3ef6e0819d4f23ca7285e6.md index 1cb16c22e16..06b6f43b366 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f3ef6e0819d4f23ca7285e6.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f3ef6e0819d4f23ca7285e6.md @@ -104,7 +104,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f3ef6e087d56ed3ffdc36be.md b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f3ef6e087d56ed3ffdc36be.md index 2acd0b55b75..74676369e3b 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f3ef6e087d56ed3ffdc36be.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f3ef6e087d56ed3ffdc36be.md @@ -129,6 +129,6 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f3ef6e0a81099d9a697b550.md b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f3ef6e0a81099d9a697b550.md index 4f8c5e4b57d..3db6cbe2217 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f3ef6e0a81099d9a697b550.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f3ef6e0a81099d9a697b550.md @@ -167,7 +167,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f3ef6e0b431cc215bb16f55.md b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f3ef6e0b431cc215bb16f55.md index 66c6ef04c06..3cef5b9f1e7 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f3ef6e0b431cc215bb16f55.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f3ef6e0b431cc215bb16f55.md @@ -141,7 +141,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f3ef6e0e0c3feaebcf647ad.md b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f3ef6e0e0c3feaebcf647ad.md index 6cf52036f84..f39e771c2a6 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f3ef6e0e0c3feaebcf647ad.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f3ef6e0e0c3feaebcf647ad.md @@ -103,7 +103,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f3ef6e0e9629bad967cd71e.md b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f3ef6e0e9629bad967cd71e.md index d31c297d506..10e325872c4 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f3ef6e0e9629bad967cd71e.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f3ef6e0e9629bad967cd71e.md @@ -7,7 +7,7 @@ dashedName: step-55 # --description-- -Você pode adicionar um valor de fallback para a font-family adicionando outro nome de fonte separado por uma vírgula. Os fallbacks são usados em instâncias onde a fonte inicial não é encontrada ou não está disponível. +Você pode adicionar um fallback para a `font-family` adicionando outro nome de fonte separado por vírgula. Um fallback é usado quando a primeira fonte não está disponível. Adicione a fonte de fallback `serif` após a fonte `Impact`. @@ -113,7 +113,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f3ef6e0eaa7da26e3d34d78.md b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f3ef6e0eaa7da26e3d34d78.md index d12924a9638..ccb21ffc9de 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f3ef6e0eaa7da26e3d34d78.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f3ef6e0eaa7da26e3d34d78.md @@ -128,7 +128,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f3ef6e0f8c230bdd2349716.md b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f3ef6e0f8c230bdd2349716.md index 97789984ef4..3f31a0b61dc 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f3ef6e0f8c230bdd2349716.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f3ef6e0f8c230bdd2349716.md @@ -140,6 +140,6 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f3f26fa39591db45e5cd7a0.md b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f3f26fa39591db45e5cd7a0.md index 665f5e75c33..34fb45aed07 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f3f26fa39591db45e5cd7a0.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f3f26fa39591db45e5cd7a0.md @@ -7,7 +7,7 @@ dashedName: step-64 # --description-- -As propriedades padrão de um elemento `hr` farão com que ele apareça como uma linha cinza claro fina. Você pode alterar a altura da linha especificando um valor para a propriedade `height`. +As propriedades padrão de um elemento `hr` farão com que ele apareça como uma linha fina cinza clara. Você pode alterar a altura da linha especificando um valor para a propriedade `height`. Altere a altura do elemento `hr` para `3px`. @@ -150,7 +150,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f459225127805351a6ad057.md b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f459225127805351a6ad057.md index 0007d5c9d33..40d11963c9b 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f459225127805351a6ad057.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f459225127805351a6ad057.md @@ -144,7 +144,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f459a7ceb8b5c446656d88b.md b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f459a7ceb8b5c446656d88b.md index 46d93fa2d7a..6027da3c206 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f459a7ceb8b5c446656d88b.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f459a7ceb8b5c446656d88b.md @@ -147,6 +147,6 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f459cf202c2a3472fae6a9f.md b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f459cf202c2a3472fae6a9f.md index fb9e8a98136..31a2706a00d 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f459cf202c2a3472fae6a9f.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f459cf202c2a3472fae6a9f.md @@ -7,7 +7,7 @@ dashedName: step-67 # --description-- -Percebeu como a espessura da linha parece maior? O valor padrão da propriedade `border-width` é de `1px` para todas as arestas dos elementos `hr`. Ao alterar a borda para a mesma cor do fundo, a altura total da linha é de `5px` (`3px` mais a largura superior e inferior da borda, de `1px`). +Percebe como a espessura da linha parece maior? O valor padrão de uma propriedade chamada `border-width` é `1px` para todas as bordas dos elementos `hr`. A altura total da linha sempre foi `5px` (`3px` mais a borda superior e inferior de `1px`); colorir a borda fez essas bordas ficarem visíveis. Altere a propriedade `height` do elemento `hr` para `2px`, então a altura total se tornará `4px`. @@ -147,7 +147,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f459fd48bdc98491ca6d1a3.md b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f459fd48bdc98491ca6d1a3.md index 09cde2266bf..b512a3a0a70 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f459fd48bdc98491ca6d1a3.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f459fd48bdc98491ca6d1a3.md @@ -145,7 +145,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f45a05977e2fa49d9119437.md b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f45a05977e2fa49d9119437.md index 480819341d5..be46cc70e0c 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f45a05977e2fa49d9119437.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f45a05977e2fa49d9119437.md @@ -146,6 +146,6 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f45a276c093334f0f6e9df4.md b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f45a276c093334f0f6e9df4.md index 43af0c4415a..ed29f6fac23 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f45a276c093334f0f6e9df4.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f45a276c093334f0f6e9df4.md @@ -185,7 +185,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f45a5a7c49a8251f0bdb527.md b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f45a5a7c49a8251f0bdb527.md index 66d43d1f3af..c7ff5312751 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f45a5a7c49a8251f0bdb527.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f45a5a7c49a8251f0bdb527.md @@ -157,7 +157,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f45a66d4a2b0453301e5a26.md b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f45a66d4a2b0453301e5a26.md index a2df739d21a..5297f19e1d3 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f45a66d4a2b0453301e5a26.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f45a66d4a2b0453301e5a26.md @@ -166,7 +166,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f45b0731d39e15d54df4dfc.md b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f45b0731d39e15d54df4dfc.md index 3d4e259979c..97384b56855 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f45b0731d39e15d54df4dfc.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f45b0731d39e15d54df4dfc.md @@ -161,7 +161,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f45b25e7ec2405f166b9de1.md b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f45b25e7ec2405f166b9de1.md index 3ce5b312afc..646956f5dd9 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f45b25e7ec2405f166b9de1.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f45b25e7ec2405f166b9de1.md @@ -9,7 +9,7 @@ dashedName: step-78 Você altera as propriedades de um link quando o link foi visitado usando um pseudo-selector que se parece com `a:visited { propertyName: propertyValue; }`. -Altere a cor do rodapé `Visit our website` para `grey` quando um usuário tiver visitado o link. +Altere a cor do link `Visit our website` no rodapé para `gray` quando o usuário tiver visitado o link. # --hints-- @@ -20,14 +20,14 @@ const aVisitedStyle = new __helpers.CSSHelp(document).getStyle('a:visited'); assert.exists(aVisitedStyle); ``` -Você deve definir a propriedade `color` para `grey`. +Você deve definir a propriedade `color` para `gray`. ```js const hasColor = new __helpers.CSSHelp(document).getCSSRules().some(x => (x.style.color === 'grey' || x.style.color === 'gray')); assert.isTrue(hasColor); ``` -O seletor `a:visited` deve ter o atributo `color` com o valor `grey`. +Seu `a:visited` deve ter a `color` `gray`. ```js const aVisitedColor = new __helpers.CSSHelp(document).getStyle('a:visited')?.getPropertyValue('color'); @@ -161,7 +161,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f45b3c93c027860d9298dbd.md b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f45b3c93c027860d9298dbd.md index bac5dc7541b..9111a4cb859 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f45b3c93c027860d9298dbd.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f45b3c93c027860d9298dbd.md @@ -161,7 +161,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ @@ -179,7 +179,7 @@ a { } a:visited { - color: grey; + color: gray; } --fcc-editable-region-- diff --git a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f45b45d099f3e621fbbb256.md b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f45b45d099f3e621fbbb256.md index fc22b2129f9..a30e23772af 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f45b45d099f3e621fbbb256.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f45b45d099f3e621fbbb256.md @@ -161,7 +161,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ @@ -179,7 +179,7 @@ a { } a:visited { - color: grey; + color: gray; } a:hover { diff --git a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f45b4c81cea7763550e40df.md b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f45b4c81cea7763550e40df.md index 250a5bf5096..6e85edf5e55 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f45b4c81cea7763550e40df.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f45b4c81cea7763550e40df.md @@ -152,7 +152,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ @@ -171,7 +171,7 @@ a { --fcc-editable-region-- a:visited { - color: grey; + color: gray; } a:hover { diff --git a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f45b715301bbf667badc04a.md b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f45b715301bbf667badc04a.md index b4abd0e3244..cb3f2677eb7 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f45b715301bbf667badc04a.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f45b715301bbf667badc04a.md @@ -7,7 +7,7 @@ dashedName: step-82 # --description-- -O texto do menu `CAMPER CAFE` tem um espaço diferente do topo do que o espaço do endereço na parte inferior do menu. Isso se deve ao navegador ter uma margem superior padrão para o elemento `h1`. +O espaço acima do texto do menu `CAMPER CAFE` não corresponde ao espaço abaixo do endereço na parte inferior do menu. Isso ocorre porque o navegador aplica uma margem superior padrão ao `h1` elemento. Altere a margem superior do elemento `h1` para `0` para remover toda a margem superior. @@ -157,7 +157,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f46e270702a8456a664f0df.md b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f46e270702a8456a664f0df.md index 7aa2d011eef..696fbf84d58 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f46e270702a8456a664f0df.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f46e270702a8456a664f0df.md @@ -156,7 +156,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f46e36e745ead58487aabf2.md b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f46e36e745ead58487aabf2.md index 6392e204e61..18e72dae2af 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f46e36e745ead58487aabf2.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f46e36e745ead58487aabf2.md @@ -163,7 +163,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f46e7a4750dd05b5a673920.md b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f46e7a4750dd05b5a673920.md index 53c05c85a9e..2c602600ac7 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f46e7a4750dd05b5a673920.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f46e7a4750dd05b5a673920.md @@ -160,7 +160,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f46e8284aae155c83015dee.md b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f46e8284aae155c83015dee.md index e098f8a0c7b..e27f766ae0b 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f46e8284aae155c83015dee.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f46e8284aae155c83015dee.md @@ -9,7 +9,7 @@ dashedName: step-86 O menu está com uma boa aparência, mas, excetuando a imagem de fundo dos grãos de café, ele é basicamente feito de texto. -Sob o título `Coffee`, adicione uma imagem usando o url `https://cdn.freecodecamp.org/curriculum/css-cafe/coffee.jpg`. Dê à imagem um valor `alt` de `coffee icon`. +Sob o título `Coffee`, adicione uma imagem usando a URL `https://cdn.freecodecamp.org/curriculum/css-cafe/coffee.jpg`. Dê à imagem um valor `alt` de `coffee icon`. # --hints-- @@ -105,6 +105,7 @@ assert.match(imageAltValue, /coffee icon/i);

123 Free Code Camp Drive

+ ``` @@ -171,7 +172,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f46ede1ff8fec5ba656b44c.md b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f46ede1ff8fec5ba656b44c.md index 2c2e0c6512a..61db40108b2 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f46ede1ff8fec5ba656b44c.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f46ede1ff8fec5ba656b44c.md @@ -144,7 +144,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } --fcc-editable-region-- diff --git a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f46fc57528aa1c4b5ea7c2e.md b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f46fc57528aa1c4b5ea7c2e.md index cc9cd1943ed..de36e130d11 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f46fc57528aa1c4b5ea7c2e.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f46fc57528aa1c4b5ea7c2e.md @@ -161,7 +161,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f4701b942c824109626c3d8.md b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f4701b942c824109626c3d8.md index 20cf170ad80..2cb15074b10 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f4701b942c824109626c3d8.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f4701b942c824109626c3d8.md @@ -153,6 +153,6 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f475bb508746c16c9431d42.md b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f475bb508746c16c9431d42.md index b0a2d48bc11..c0c71e8a4a7 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f475bb508746c16c9431d42.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f475bb508746c16c9431d42.md @@ -7,9 +7,9 @@ dashedName: step-87 # --description-- -A imagem que você adicionou não está centralizada horizontalmente como o título `Coffee` acima dela. Elementos `img` são "como" elementos inline. +A imagem que você adicionou não está centralizada horizontalmente como o título `Coffee` acima dela. Elementos `img` são elementos de nível inline, então eles ficam no fluxo do texto. -Para fazer a imagem se comportar como elementos de nível de bloco, como títulos, crie um seletor do tipo `img`. Defina a propriedade `display` para `block`, e use `margin-left` e `margin-right` para centralizá-la horizontalmente. +Para fazer a imagem se comportar como um elemento de nível bloco, como um título, crie um seletor de tipo `img`. Defina a propriedade `display` como `block` e use as propriedades `margin-left` e `margin-right` para centralizá-la horizontalmente. # --hints-- @@ -120,6 +120,7 @@ assert.equal(imgMarginRight, 'auto');

123 Free Code Camp Drive

+ ``` @@ -190,7 +191,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f475e1c7f71a61d913836c6.md b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f475e1c7f71a61d913836c6.md index 90cab0e9d3f..848cf4f7249 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f475e1c7f71a61d913836c6.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f475e1c7f71a61d913836c6.md @@ -97,6 +97,7 @@ assert.match(lastImage?.alt, /pie icon/i);

123 Free Code Camp Drive

+ ``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f47fe7e31980053a8d4403b.md b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f47fe7e31980053a8d4403b.md index e97b7430cc5..5c7e3ece0d1 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f47fe7e31980053a8d4403b.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f47fe7e31980053a8d4403b.md @@ -7,7 +7,7 @@ dashedName: step-89 # --description-- -Seria bom se o espaço vertical entre os elementos `h2` e seus ícones associados fosse menor. Os elementos `h2` têm o espaço de margem padrão superior e inferior, então você pode alterar a margem inferior dos elementos `h2` para `0` ou outro número. +Seria bom se o espaço vertical entre os elementos `h2` e seus ícones associados fosse menor. Os elementos `h2` têm margem superior e inferior padrão, então você pode alterar a margem inferior dos elementos `h2` para `0` ou algum outro valor. Existe uma maneira mais fácil, que é simplesmente adicionar uma margem superior negativa aos elementos `img` para puxá-los para cima de suas posições atuais. Valores negativos são criados usando `-` na frente do valor. Para completar este workshop, vá em frente e use uma margem superior negativa de `25px` no seletor do tipo `img`. diff --git a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f716ad029ee4053c7027a7a.md b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f716ad029ee4053c7027a7a.md index 34076b957a5..e0819a192b8 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f716ad029ee4053c7027a7a.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f716ad029ee4053c7027a7a.md @@ -119,7 +119,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f716bee5838c354c728a7c5.md b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f716bee5838c354c728a7c5.md index 7155b1b65f9..9a37cd08f96 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f716bee5838c354c728a7c5.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f716bee5838c354c728a7c5.md @@ -158,6 +158,6 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f7b87422a560036fd03ccff.md b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f7b87422a560036fd03ccff.md index 35c5303e9e5..457e1fad7ef 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f7b87422a560036fd03ccff.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f7b87422a560036fd03ccff.md @@ -118,7 +118,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f7b88d37b1f98386f04edc0.md b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f7b88d37b1f98386f04edc0.md index d6f026af009..0bc4f2289f5 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f7b88d37b1f98386f04edc0.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/5f7b88d37b1f98386f04edc0.md @@ -97,6 +97,6 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/6780e8ef4153930b965cd7b7.md b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/6780e8ef4153930b965cd7b7.md index ca65f38ce80..58be15d585f 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/6780e8ef4153930b965cd7b7.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/6780e8ef4153930b965cd7b7.md @@ -125,6 +125,6 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/6780f0d898362873ac425dc8.md b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/6780f0d898362873ac425dc8.md index 45c1284193c..d6b5258ba57 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/6780f0d898362873ac425dc8.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cafe-menu/6780f0d898362873ac425dc8.md @@ -156,7 +156,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/portuguese/blocks/workshop-calculator/66cc095dfe1682753d2ab030.md b/curriculum/challenges/portuguese/blocks/workshop-calculator/66cc095dfe1682753d2ab030.md index fb5c5b9f7b4..63ed2d7bc63 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-calculator/66cc095dfe1682753d2ab030.md +++ b/curriculum/challenges/portuguese/blocks/workshop-calculator/66cc095dfe1682753d2ab030.md @@ -7,7 +7,7 @@ dashedName: step-2 # --description-- -Um dos conceitos que você aprendeu nas lições anteriores foi como retornar valores de uma função. +Um dos conceitos que você aprendeu em lições anteriores foi como retornar valores de uma função. Aqui está um lembrete de como retornar um valor de uma função: @@ -30,7 +30,10 @@ assert.strictEqual(addTwoAndSeven(), 9); Sua função `addTwoAndSeven` deve retornar a soma usando o operador `+`. ```js -assert.match(code, /return\s*(2\s*\+\s*7|7\s*\+\s*2)\s*;?/); +const explorer = await __helpers.Explorer(code); +const { addTwoAndSeven } = explorer.allFunctions; +const validExpressions = ["2 + 7", "7 + 2", "(2 + 7)", "(7 + 2)"]; +assert.isTrue(validExpressions.some(expr => addTwoAndSeven?.hasReturn(expr))); ``` # --seed-- diff --git a/curriculum/challenges/portuguese/blocks/workshop-calculator/66cc0a9e06e00b75d6782be9.md b/curriculum/challenges/portuguese/blocks/workshop-calculator/66cc0a9e06e00b75d6782be9.md index ff94d18289d..6c6979dad4a 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-calculator/66cc0a9e06e00b75d6782be9.md +++ b/curriculum/challenges/portuguese/blocks/workshop-calculator/66cc0a9e06e00b75d6782be9.md @@ -26,16 +26,12 @@ Agora você deve ver a soma de `2` e `7` registrada no console. # --hints-- -Você deve ter um `console.log` no código. +Você deve chamar a função `addTwoAndSeven` dentro de um `console.log`. ```js -assert.match(code, /console\.log(.*)/); -``` - -Você deve chamar a função `addTwoAndSeven` dentro do `console.log`. - -```js -assert.match(code, /console\.log\(\s*addTwoAndSeven\(\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(addTwoAndSeven())"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/portuguese/blocks/workshop-calculator/66cc0ba5881acb7692cfc4de.md b/curriculum/challenges/portuguese/blocks/workshop-calculator/66cc0ba5881acb7692cfc4de.md index 118d90952bf..be626aa341f 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-calculator/66cc0ba5881acb7692cfc4de.md +++ b/curriculum/challenges/portuguese/blocks/workshop-calculator/66cc0ba5881acb7692cfc4de.md @@ -7,7 +7,7 @@ dashedName: step-4 # --description-- -Agora, é hora de adicionar outra função. +Agora é hora de adicionar outra função. Declare uma função chamada `addThreeAndFour` que retorne a soma de `3` e `4`. @@ -24,22 +24,24 @@ assert.isFunction(addThreeAndFour); A função `addThreeAndFour` deve retornar a soma de `3` e `4`. ```js -assert.equal(addThreeAndFour(), 7); +assert.strictEqual(addThreeAndFour(), 7); ``` Sua função `addThreeAndFour` deve retornar a soma usando o operador `+`. ```js -const declarationStyle = /return\s*\(?\s*(3\s*\+\s*4|4\s*\+\s*3)\s*\)?\s*;?/; -const arrowStyle = /=>\s*\(?\s*(3\s*\+\s*4|4\s*\+\s*3)\s*\)?\s*;?/; -const combinedRegex = new RegExp(`(?:${declarationStyle.source})|(?:${arrowStyle.source})`); -assert.match(code, combinedRegex); +const explorer = await __helpers.Explorer(code); +const { addThreeAndFour } = explorer.allFunctions; +const validExpressions = ["3 + 4", "4 + 3", "(3 + 4)", "(4 + 3)"]; +assert.isTrue(validExpressions.some(expr => addThreeAndFour?.hasReturn(expr))); ``` Você deve chamar a função `addThreeAndFour` dentro de um `console.log`. ```js -assert.match(code, /console\.log\(\s*addThreeAndFour\(\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(addThreeAndFour())"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/portuguese/blocks/workshop-calculator/66cc0de2920bec775f610424.md b/curriculum/challenges/portuguese/blocks/workshop-calculator/66cc0de2920bec775f610424.md index 979fa7b4f59..e93f5954cf0 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-calculator/66cc0de2920bec775f610424.md +++ b/curriculum/challenges/portuguese/blocks/workshop-calculator/66cc0de2920bec775f610424.md @@ -7,7 +7,7 @@ dashedName: step-5 # --description-- -Mesmo que as funções funcionem como esperado, há muita repetição no código. +Mesmo que as funções funcionem como esperado, há muita repetição no código. Por estar criando uma calculadora, você não quer ter que criar uma função para cada possível combinação de números que deseja somar. @@ -22,25 +22,33 @@ No próximo passo, você revisará como trabalhar com parâmetros e argumentos e Você não deve ter uma função chamada `addTwoAndSeven`. ```js -assert.notMatch(code, /function\s+addTwoAndSeven\s*\(\s*\)\s*{/); +const explorer = await __helpers.Explorer(code); +const { addTwoAndSeven } = explorer.allFunctions; +assert.notExists(addTwoAndSeven); ``` Você não deve ter uma chamada de função para `addTwoAndSeven`. ```js -assert.notMatch(code, /console\.log\(\s*addTwoAndSeven\(\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const unexpectedStatement = "console.log(addTwoAndSeven())"; +assert.notInclude(strippedCode, unexpectedStatement); ``` Você não deve ter uma função chamada `addThreeAndFour`. ```js -assert.notMatch(code, /function\s+addThreeAndFour\s*\(\s*\)\s*{/); +const explorer = await __helpers.Explorer(code); +const { addThreeAndFour } = explorer.allFunctions; +assert.notExists(addThreeAndFour); ``` Você não deve ter uma chamada de função para `addThreeAndFour`. ```js -assert.notMatch(code, /console\.log\(\s*addThreeAndFour\(\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const unexpectedStatement = "console.log(addThreeAndFour())"; +assert.notInclude(strippedCode, unexpectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/portuguese/blocks/workshop-calculator/66cc0f1ae40802781b2ea972.md b/curriculum/challenges/portuguese/blocks/workshop-calculator/66cc0f1ae40802781b2ea972.md index b00ac6c86ff..29c72519e98 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-calculator/66cc0f1ae40802781b2ea972.md +++ b/curriculum/challenges/portuguese/blocks/workshop-calculator/66cc0f1ae40802781b2ea972.md @@ -33,8 +33,11 @@ assert.isFunction(calculateSum); A função `calculateSum` deve receber dois parâmetros, `num1` e `num2`. ```js -const regex = __helpers.functionRegex('calculateSum', ['num1', 'num2']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { calculateSum } = explorer.allFunctions; +assert.lengthOf(calculateSum?.parameters, 2); +assert.equal(calculateSum?.parameters[0].toString(), "num1"); +assert.equal(calculateSum?.parameters[1].toString(), "num2"); ``` # --seed-- diff --git a/curriculum/challenges/portuguese/blocks/workshop-calculator/66cc12fa504b0479dac479a0.md b/curriculum/challenges/portuguese/blocks/workshop-calculator/66cc12fa504b0479dac479a0.md index 3ff0a2ccab8..6a6bdbb172e 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-calculator/66cc12fa504b0479dac479a0.md +++ b/curriculum/challenges/portuguese/blocks/workshop-calculator/66cc12fa504b0479dac479a0.md @@ -29,7 +29,9 @@ Adicione um `console.log` que chame a função `calculateSum` com os argumentos Você deve ter um `console.log` que chame a função `calculateSum` com os argumentos `2` e `5`. ```js -assert.match(code, /console\.log\(calculateSum\(\s*2\s*,\s*5\)\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const validStatements = ["console.log(calculateSum(2,5))", "console.log(calculateSum(5,2))"]; +assert.isTrue(validStatements.some(stmt => strippedCode.includes(stmt))); ``` # --seed-- diff --git a/curriculum/challenges/portuguese/blocks/workshop-calculator/66cc14ca14e65e7a9ebecb80.md b/curriculum/challenges/portuguese/blocks/workshop-calculator/66cc14ca14e65e7a9ebecb80.md index caa76e62a43..be22f867111 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-calculator/66cc14ca14e65e7a9ebecb80.md +++ b/curriculum/challenges/portuguese/blocks/workshop-calculator/66cc14ca14e65e7a9ebecb80.md @@ -15,7 +15,7 @@ Dentro da função, retorne a diferença entre os dois parâmetros. # --hints-- -Você deve ter uma função chamada `calculateDifference`. +Você deve declarar uma função chamada `calculateDifference`. ```js assert.isFunction(calculateDifference); @@ -24,8 +24,11 @@ assert.isFunction(calculateDifference); A função `calculateDifference` deve ter dois parâmetros chamados `num1` e `num2`. ```js -const regex = __helpers.functionRegex('calculateDifference', ['num1', 'num2']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { calculateDifference } = explorer.allFunctions; +assert.lengthOf(calculateDifference?.parameters, 2); +assert.equal(calculateDifference?.parameters[0].toString(), "num1"); +assert.equal(calculateDifference?.parameters[1].toString(), "num2"); ``` A função `calculateDifference` deve retornar a diferença entre os dois parâmetros. diff --git a/curriculum/challenges/portuguese/blocks/workshop-calculator/66cc16abc30b367ba1d1f9ef.md b/curriculum/challenges/portuguese/blocks/workshop-calculator/66cc16abc30b367ba1d1f9ef.md index 1ded7c2ff78..e5335a705e1 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-calculator/66cc16abc30b367ba1d1f9ef.md +++ b/curriculum/challenges/portuguese/blocks/workshop-calculator/66cc16abc30b367ba1d1f9ef.md @@ -20,19 +20,25 @@ Finalmente, adicione um terceiro `console.log` que chama a função `calculateDi Você deve ter um `console.log` que chama a função `calculateDifference` com os argumentos `22` e `5`. ```js -assert.match(code, /console\.log\s*\(\s*calculateDifference\s*\(\s*22\s*,\s*5\s*\)\s*\)\s*;?/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateDifference(22,5))"; +assert.include(strippedCode, expectedStatement); ``` Você deve ter um `console.log` que chama a função `calculateDifference` com os argumentos `12` e `1`. ```js -assert.match(code, /console\.log\s*\(\s*calculateDifference\s*\(\s*12\s*,\s*1\s*\)\s*\)\s*;?/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateDifference(12,1))"; +assert.include(strippedCode, expectedStatement); ``` Você deve ter um `console.log` que chama a função `calculateDifference` com os argumentos `17` e `9`. ```js -assert.match(code, /console\.log\s*\(\s*calculateDifference\s*\(\s*17\s*,\s*9\s*\)\s*\)\s*;?/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateDifference(17,9))"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/portuguese/blocks/workshop-calculator/66cc172af7159a7c67804544.md b/curriculum/challenges/portuguese/blocks/workshop-calculator/66cc172af7159a7c67804544.md index cea5bb8469f..17183a0e6c0 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-calculator/66cc172af7159a7c67804544.md +++ b/curriculum/challenges/portuguese/blocks/workshop-calculator/66cc172af7159a7c67804544.md @@ -17,7 +17,7 @@ Em seguida, adicione um `console.log` que chame a função `calculateProduct` co # --hints-- -Você deve ter uma função chamada `calculateProduct`. +Você deve declarar uma função chamada `calculateProduct`. ```js assert.isFunction(calculateProduct); @@ -26,8 +26,11 @@ assert.isFunction(calculateProduct); A função `calculateProduct` deve ter dois parâmetros chamados `num1` e `num2`. ```js -const regex = __helpers.functionRegex('calculateProduct', ['num1', 'num2']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { calculateProduct } = explorer.allFunctions; +assert.lengthOf(calculateProduct?.parameters, 2); +assert.equal(calculateProduct?.parameters[0].toString(), "num1"); +assert.equal(calculateProduct?.parameters[1].toString(), "num2"); ``` A função `calculateProduct` deve retornar o produto dos dois parâmetros. @@ -40,7 +43,9 @@ assert.equal(calculateProduct(10, 5), 50); Você deve ter um `console.log` que chame a função `calculateProduct` com os argumentos `13` e `5`. ```js -assert.match(code, /console\.log\s*\(\s*calculateProduct\s*\(\s*13\s*,\s*5\s*\)\s*\)\s*;?/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const validStatements = ["console.log(calculateProduct(13,5))", "console.log(calculateProduct(5,13))"]; +assert.isTrue(validStatements.some(stmt => strippedCode.includes(stmt))); ``` # --seed-- diff --git a/curriculum/challenges/portuguese/blocks/workshop-calculator/66cc1a3a39aef47d6473cb2f.md b/curriculum/challenges/portuguese/blocks/workshop-calculator/66cc1a3a39aef47d6473cb2f.md index 8cb182b0e98..58636667951 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-calculator/66cc1a3a39aef47d6473cb2f.md +++ b/curriculum/challenges/portuguese/blocks/workshop-calculator/66cc1a3a39aef47d6473cb2f.md @@ -17,7 +17,7 @@ Em seguida, adicione um `console.log` que chame a função `calculateQuotient` c # --hints-- -Você deve ter uma função chamada `calculateQuotient`. +Você deve declarar uma função chamada `calculateQuotient`. ```js assert.isFunction(calculateQuotient); @@ -26,8 +26,11 @@ assert.isFunction(calculateQuotient); A função `calculateQuotient` deve ter dois parâmetros chamados `num1` e `num2`. ```js -const regex = __helpers.functionRegex('calculateQuotient', ['num1', 'num2']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { calculateQuotient } = explorer.allFunctions; +assert.lengthOf(calculateQuotient?.parameters, 2); +assert.equal(calculateQuotient?.parameters[0].toString(), "num1"); +assert.equal(calculateQuotient?.parameters[1].toString(), "num2"); ``` A função `calculateQuotient` deve retornar o quociente dos dois parâmetros. @@ -40,7 +43,9 @@ assert.equal(calculateQuotient(100, 10), 10); Você deve ter um `console.log` que chame a função `calculateQuotient` com os argumentos `7` e `11`. ```js -assert.match(code, /console\.log\s*\(\s*calculateQuotient\s*\(\s*7\s*,\s*11\s*\)\s*\)\s*;?/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateQuotient(7,11))"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/portuguese/blocks/workshop-calculator/66cc1ccfefdd727e18c2ab20.md b/curriculum/challenges/portuguese/blocks/workshop-calculator/66cc1ccfefdd727e18c2ab20.md index 874053c8242..a1ab24b8587 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-calculator/66cc1ccfefdd727e18c2ab20.md +++ b/curriculum/challenges/portuguese/blocks/workshop-calculator/66cc1ccfefdd727e18c2ab20.md @@ -7,7 +7,7 @@ dashedName: step-14 # --description-- -Seu `calculateQuotient` parece estar funcionando corretamente mas há um caso que você ainda não testou. +Sua função `calculateQuotient` parece estar funcionando corretamente, mas há um caso que você ainda não testou. Adicione um `console.log` que chama a função `calculateQuotient` com os argumentos `3` e `0`. @@ -18,7 +18,9 @@ Certifique-se de examinar atentamente o resultado dessa chamada. Você deve ter um `console.log` que chama a função `calculateQuotient` com os argumentos `3` e `0`. ```js -assert.match(code, /console\.log\s*\(\s*calculateQuotient\s*\(\s*3\s*,\s*0\s*\)\s*\)\s*;?/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateQuotient(3,0))"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/portuguese/blocks/workshop-calculator/66cc1deb1f04647f2aabee2b.md b/curriculum/challenges/portuguese/blocks/workshop-calculator/66cc1deb1f04647f2aabee2b.md index 9b465517e59..5246e0c0b1d 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-calculator/66cc1deb1f04647f2aabee2b.md +++ b/curriculum/challenges/portuguese/blocks/workshop-calculator/66cc1deb1f04647f2aabee2b.md @@ -11,17 +11,17 @@ Se você olhar no console, verá o valor `Infinity`. `Infinity` é um valor espe A divisão por zero não é uma operação válida na matemática. -Para tratar este caso limite, você deve atualizar a função `calculateQuotient` para verificar se `num2` é zero. +Para tratar este caso limite, você deve atualizar a função `calculateQuotient` para verificar se `num2` é zero. Se for, a função deve retornar a string `"Error: Division by zero"`. Caso contrário, deve retornar o resultado da divisão de `num1` por `num2`. # --hints-- -Sua função `calculateQuotient` deve retornar a string `"Error: Division by zero"` se `num2` for zero. +Sua função `calculateQuotient` deve retornar a string `"Error: Division by zero"` se `num2` for zero. ```js -assert.strictEqual(calculateQuotient(10, 0), 'Error: Division by zero'); -assert.strictEqual(calculateQuotient(3, 0), 'Error: Division by zero'); +assert.strictEqual(calculateQuotient(10, 0), "Error: Division by zero"); +assert.strictEqual(calculateQuotient(3, 0), "Error: Division by zero"); ``` A função `calculateQuotient` deve retornar o resultado da divisão de `num1` por `num2` se `num2` não for zero. diff --git a/curriculum/challenges/portuguese/blocks/workshop-calculator/66cc21d23238dc8240a8a182.md b/curriculum/challenges/portuguese/blocks/workshop-calculator/66cc21d23238dc8240a8a182.md index 9d809ab9c58..43f95dc98c3 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-calculator/66cc21d23238dc8240a8a182.md +++ b/curriculum/challenges/portuguese/blocks/workshop-calculator/66cc21d23238dc8240a8a182.md @@ -28,7 +28,7 @@ Declare uma função chamada `calculateSquare` que aceita um parâmetro `num` e # --hints-- -Você deve ter uma função chamada `calculateSquare`. +Você deve declarar uma função chamada `calculateSquare`. ```js assert.isFunction(calculateSquare); @@ -37,8 +37,10 @@ assert.isFunction(calculateSquare); A função `calculateSquare` deve aceitar um parâmetro `num`. ```js -const regex = __helpers.functionRegex('calculateSquare', ['num']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { calculateSquare } = explorer.allFunctions; +assert.lengthOf(calculateSquare?.parameters, 1); +assert.equal(calculateSquare?.parameters[0].toString(), "num"); ``` A função `calculateSquare` deve retornar o quadrado de `num`. diff --git a/curriculum/challenges/portuguese/blocks/workshop-calculator/66cc26907ff6908402af0149.md b/curriculum/challenges/portuguese/blocks/workshop-calculator/66cc26907ff6908402af0149.md index 7866430b1e7..5c5b46f8fa2 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-calculator/66cc26907ff6908402af0149.md +++ b/curriculum/challenges/portuguese/blocks/workshop-calculator/66cc26907ff6908402af0149.md @@ -18,13 +18,17 @@ Em seguida, adicione outro `console.log` que chame a função `calculateSquare` Você deve ter um `console.log` que chame a função `calculateSquare` com o argumento de `2`. ```js -assert.match(code, /console\.log\s*\(\s*calculateSquare\s*\(\s*2\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateSquare(2))"; +assert.include(strippedCode, expectedStatement); ``` Você deve ter um `console.log` que chame a função `calculateSquare` com o argumento de `9`. ```js -assert.match(code, /console\.log\s*\(\s*calculateSquare\s*\(\s*9\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateSquare(9))"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/portuguese/blocks/workshop-calculator/66cc2739f687e484d50bb6f1.md b/curriculum/challenges/portuguese/blocks/workshop-calculator/66cc2739f687e484d50bb6f1.md index 42b23e2c1d2..912bb8dd93e 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-calculator/66cc2739f687e484d50bb6f1.md +++ b/curriculum/challenges/portuguese/blocks/workshop-calculator/66cc2739f687e484d50bb6f1.md @@ -26,7 +26,7 @@ Declare uma função chamada `calculateSquareRoot` que recebe um parâmetro `num # --hints-- -Você deve ter uma função chamada `calculateSquareRoot`. +Você deve declarar uma função chamada `calculateSquareRoot`. ```js assert.isFunction(calculateSquareRoot); @@ -35,8 +35,10 @@ assert.isFunction(calculateSquareRoot); A função `calculateSquareRoot` deve receber um parâmetro `num`. ```js -const regex = __helpers.functionRegex('calculateSquareRoot', ['num']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { calculateSquareRoot } = explorer.allFunctions; +assert.lengthOf(calculateSquareRoot?.parameters, 1); +assert.equal(calculateSquareRoot?.parameters[0].toString(), "num"); ``` A função `calculateSquareRoot` deve retornar a raiz quadrada de `num`. diff --git a/curriculum/challenges/portuguese/blocks/workshop-calculator/66cc281d687975858049fd8d.md b/curriculum/challenges/portuguese/blocks/workshop-calculator/66cc281d687975858049fd8d.md index 5eaac39fab7..158219b4030 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-calculator/66cc281d687975858049fd8d.md +++ b/curriculum/challenges/portuguese/blocks/workshop-calculator/66cc281d687975858049fd8d.md @@ -20,13 +20,17 @@ Com essas mudanças, a calculadora estará completa! Você deve ter um `console.log` que chama a função `calculateSquareRoot` com o argumento de `25`. ```js -assert.match(code, /console\.log\s*\(\s*calculateSquareRoot\s*\(\s*25\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateSquareRoot(25))"; +assert.include(strippedCode, expectedStatement); ``` Você deve ter um `console.log` que chama a função `calculateSquareRoot` com o argumento de `100`. ```js -assert.match(code, /console\.log\s*\(\s*calculateSquareRoot\s*\(\s*100\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateSquareRoot(100))"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/portuguese/blocks/workshop-calculator/66cdf76685e4cb5a8726e27b.md b/curriculum/challenges/portuguese/blocks/workshop-calculator/66cdf76685e4cb5a8726e27b.md index 8952580348d..6c4cbd5cd73 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-calculator/66cdf76685e4cb5a8726e27b.md +++ b/curriculum/challenges/portuguese/blocks/workshop-calculator/66cdf76685e4cb5a8726e27b.md @@ -18,13 +18,17 @@ Abaixo desse `console.log`, adicione outro `console.log` que chame a função `c Você deve ter um `console.log` que chama a função `calculateSum` com os argumentos `10` e `10`. ```js -assert.match(code, /console\.log\(calculateSum\(10\s*,\s*10\)\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateSum(10,10))"; +assert.include(strippedCode, expectedStatement); ``` Você deve ter um `console.log` que chama a função `calculateSum` com os argumentos `5` e `5`. ```js -assert.match(code, /console\.log\(calculateSum\(5\s*,\s*5\)\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateSum(5,5))"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646c48df8674cf2b91020ecc.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646c48df8674cf2b91020ecc.md index 9edbec1bc55..9eb0b58ffd8 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646c48df8674cf2b91020ecc.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646c48df8674cf2b91020ecc.md @@ -35,12 +35,13 @@ assert.oneOf(href, ["./styles.css", "styles.css"]); ```html ---fcc-editable-region-- - - fCC Cat Painting - + + fCC Cat Painting --fcc-editable-region-- + +--fcc-editable-region-- + ``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646c586be7180e40ddf74ff6.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646c586be7180e40ddf74ff6.md index 1e57d0a1179..b840baa7df4 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646c586be7180e40ddf74ff6.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646c586be7180e40ddf74ff6.md @@ -31,9 +31,9 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('body')?.backgroundColor, - - fCC Cat Painting - + + fCC Cat Painting + diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646c59e942f35541923104bf.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646c59e942f35541923104bf.md index 16f99b88f00..0bc849fe712 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646c59e942f35541923104bf.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646c59e942f35541923104bf.md @@ -43,13 +43,13 @@ assert.lengthOf(document.querySelectorAll('main div'), 1); - - fCC Cat Painting - + + fCC Cat Painting + --fcc-editable-region-- - + --fcc-editable-region-- diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646c5ace05e4be4211407935.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646c5ace05e4be4211407935.md index 07c4ee0afd9..4878d81b82b 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646c5ace05e4be4211407935.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646c5ace05e4be4211407935.md @@ -50,14 +50,14 @@ assert.equal(secondGradient,'(69,69,79)100%)'); - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
+
+
+
``` @@ -71,13 +71,13 @@ body { background-color: #c9d2fc; } ---fcc-editable-region-- .cat-head { +--fcc-editable-region-- + +--fcc-editable-region-- width: 205px; height: 180px; border: 1px solid #000; border-radius: 46%; - } ---fcc-editable-region-- ``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646c5d7057c45f432fcdd46c.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646c5d7057c45f432fcdd46c.md index 0d76110af30..59bfd8ea93c 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646c5d7057c45f432fcdd46c.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646c5d7057c45f432fcdd46c.md @@ -7,7 +7,7 @@ dashedName: step-5 # --description-- -Usando um seletor de classe, dê ao elemento `.cat-head` uma largura de `205px` e uma altura de `180px`. Além disso, dê a ele uma borda de `1px solid #000` e um `border-radius` de `46%`. +Usando um seletor de classe, dê ao elemento `.cat-head` uma largura de `205px` e uma altura de `180px`. Além disso, dê a ele uma borda de `1px solid #000` e um `border-radius` de `46%`. # --hints-- @@ -50,13 +50,13 @@ assert.equal(new __helpers.CSSHelp(document)?.getStyle(".cat-head")?.borderRadiu - - fCC Cat Painting - + + fCC Cat Painting +
-
+
diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646c5e727e56e743c9aed4a1.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646c5e727e56e743c9aed4a1.md index 95eb72d0313..f19d38e01a4 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646c5e727e56e743c9aed4a1.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646c5e727e56e743c9aed4a1.md @@ -44,14 +44,14 @@ assert.equal(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.left, '100p - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
+
+
+
``` @@ -65,16 +65,14 @@ body { background-color: #c9d2fc; } ---fcc-editable-region-- .cat-head { - - +--fcc-editable-region-- +--fcc-editable-region-- background: linear-gradient(#5e5e5e 85%, #45454f 100%); width: 205px; height: 180px; border: 1px solid #000; border-radius: 46%; } ---fcc-editable-region-- ``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646c5ffef5598d449b52ec12.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646c5ffef5598d449b52ec12.md index 844da0b4d15..93fa3b6956f 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646c5ffef5598d449b52ec12.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646c5ffef5598d449b52ec12.md @@ -39,18 +39,18 @@ assert.equal(document.querySelectorAll('.cat-head div')[0]?.getAttribute('class' - - fCC Cat Painting - + + fCC Cat Painting + -
+
+
--fcc-editable-region-- -
- -
+ --fcc-editable-region-- -
+ +
``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646ce8bb4b35544d501c7184.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646ce8bb4b35544d501c7184.md index 00c894cabae..8f5b529f965 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646ce8bb4b35544d501c7184.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646ce8bb4b35544d501c7184.md @@ -43,20 +43,20 @@ assert.isTrue(document.querySelectorAll('.cat-ears div')[1]?.classList.contains( - - fCC Cat Painting - + + fCC Cat Painting + -
-
+
+
+
--fcc-editable-region-- -
- -
+ --fcc-editable-region--
-
+
+
``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646ce9d790d2a44de5f99e04.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646ce9d790d2a44de5f99e04.md index c17c2cb3fee..902fe596845 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646ce9d790d2a44de5f99e04.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646ce9d790d2a44de5f99e04.md @@ -55,25 +55,25 @@ assert.isTrue(document.querySelectorAll('.cat-right-ear div')[0]?.classList.cont - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
- --fcc-editable-region-- -
- -
-
- -
- --fcc-editable-region-- +
+
+
+
+--fcc-editable-region-- + +
+
+ +--fcc-editable-region--
-
+
+
``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646ceb843412c74edee27a79.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646ceb843412c74edee27a79.md index 89753c01c66..9ca28382da8 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646ceb843412c74edee27a79.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646ceb843412c74edee27a79.md @@ -67,23 +67,23 @@ assert.strictEqual(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.b - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646cecc9eb5c4f4f73dafd07.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646cecc9eb5c4f4f73dafd07.md index 0bb7edb377b..2ee067428ea 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646cecc9eb5c4f4f73dafd07.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646cecc9eb5c4f4f73dafd07.md @@ -37,23 +37,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-ear')?.left, '- - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` @@ -81,12 +81,12 @@ body { border-radius: 46%; } ---fcc-editable-region-- .cat-left-ear { +--fcc-editable-region-- +--fcc-editable-region-- border-left: 35px solid transparent; border-right: 35px solid transparent; border-bottom: 70px solid #5e5e5e; } ---fcc-editable-region-- ``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646cef0c2b98915094df7099.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646cef0c2b98915094df7099.md index 8821d04ed49..8d37b8930a2 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646cef0c2b98915094df7099.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646cef0c2b98915094df7099.md @@ -31,23 +31,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-ear')?.borderTo - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646cf1206cac5f51804f49cf.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646cf1206cac5f51804f49cf.md index eacaffcc98c..b36149e7397 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646cf1206cac5f51804f49cf.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646cf1206cac5f51804f49cf.md @@ -29,23 +29,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-ear')?.transfor - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646cf2249f02ca5233d9af7c.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646cf2249f02ca5233d9af7c.md index 6306048d0fd..1619f0d4ed6 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646cf2249f02ca5233d9af7c.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646cf2249f02ca5233d9af7c.md @@ -45,23 +45,23 @@ assert.strictEqual(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.b - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646cf48d8f8e1f535a1821d3.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646cf48d8f8e1f535a1821d3.md index 70aca55d36a..e76a84dd47e 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646cf48d8f8e1f535a1821d3.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646cf48d8f8e1f535a1821d3.md @@ -37,23 +37,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.left, ' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646cf6cbca98e258da65c979.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646cf6cbca98e258da65c979.md index d62e2a5214f..d7e20c7699e 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646cf6cbca98e258da65c979.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646cf6cbca98e258da65c979.md @@ -25,23 +25,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.transfo - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646cf88aa884405a11ea5bcc.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646cf88aa884405a11ea5bcc.md index c18cee555f3..a9c22684e9b 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646cf88aa884405a11ea5bcc.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646cf88aa884405a11ea5bcc.md @@ -31,23 +31,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.borderT - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646cfc2b8e6fe95c20a819d5.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646cfc2b8e6fe95c20a819d5.md index 228562c6674..a8b7e76badf 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646cfc2b8e6fe95c20a819d5.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646cfc2b8e6fe95c20a819d5.md @@ -29,23 +29,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-ear')?.zIndex, - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646cfd853634255d02b64cc1.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646cfd853634255d02b64cc1.md index c34aa714e90..f8fb87ed45a 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646cfd853634255d02b64cc1.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646cfd853634255d02b64cc1.md @@ -27,23 +27,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-ear')?.zIndex, - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646cfde6ac612e5d60391f50.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646cfde6ac612e5d60391f50.md index 889a79c08a9..5856bdfb4db 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646cfde6ac612e5d60391f50.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646cfde6ac612e5d60391f50.md @@ -25,23 +25,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.zIndex, - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646dd556d524bc61c0139bd6.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646dd556d524bc61c0139bd6.md index 9b4b3de0596..6bdb594d3f3 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646dd556d524bc61c0139bd6.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646dd556d524bc61c0139bd6.md @@ -45,23 +45,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-inner-ear')?.bo - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646dd6f9caa862627dd87772.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646dd6f9caa862627dd87772.md index 8edd1ff06d9..a2f69581987 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646dd6f9caa862627dd87772.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646dd6f9caa862627dd87772.md @@ -37,23 +37,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-inner-ear')?.le - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646dd7cfd0cfac630c1dd520.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646dd7cfd0cfac630c1dd520.md index 35d30371649..5700426bd68 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646dd7cfd0cfac630c1dd520.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646dd7cfd0cfac630c1dd520.md @@ -43,23 +43,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-inner-ear')?.bo - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646dd8c79ec23463a3d0e356.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646dd8c79ec23463a3d0e356.md index 14c79250393..1316d4e0781 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646dd8c79ec23463a3d0e356.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646dd8c79ec23463a3d0e356.md @@ -43,23 +43,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-inner-ear')?.b - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646dd9d9a729916460724f16.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646dd9d9a729916460724f16.md index 7f8d0f2aee8..3a071245328 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646dd9d9a729916460724f16.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646dd9d9a729916460724f16.md @@ -37,23 +37,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-inner-ear')?.l - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646ddab8afd73764f5241bbf.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646ddab8afd73764f5241bbf.md index 6444e2e2446..39e7c1f6c67 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646ddab8afd73764f5241bbf.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646ddab8afd73764f5241bbf.md @@ -43,23 +43,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-inner-ear')?.b - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646ddb61ff08366570cc5902.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646ddb61ff08366570cc5902.md index d225fe19855..733b42b428a 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646ddb61ff08366570cc5902.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646ddb61ff08366570cc5902.md @@ -45,27 +45,27 @@ assert.isTrue(document.querySelectorAll('.cat-eyes div')[1].classList.contains(' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- - --fcc-editable-region-- - - --fcc-editable-region--
-
+ + --fcc-editable-region-- + + --fcc-editable-region-- +
+
``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646ddd3f9f97a0667b964bdb.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646ddd3f9f97a0667b964bdb.md index 8be854e2c6a..fe80458f21d 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646ddd3f9f97a0667b964bdb.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646ddd3f9f97a0667b964bdb.md @@ -55,34 +55,34 @@ assert.isTrue(document.querySelectorAll('.cat-right-eye div')[0]?.classList.cont - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
- --fcc-editable-region-- -
- -
-
- -
- --fcc-editable-region-- -
-
+ +
+
+--fcc-editable-region-- + +
+
+ +--fcc-editable-region-- +
+
+
+
``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646dde7dc20dc167489faa69.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646dde7dc20dc167489faa69.md index 9d6df553344..7fdfbc2c868 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646dde7dc20dc167489faa69.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646dde7dc20dc167489faa69.md @@ -43,32 +43,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-eye')?.backgrou - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646ddf888632fa67f1180940.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646ddf888632fa67f1180940.md index 2c20d6e6252..f226ea02e8d 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646ddf888632fa67f1180940.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646ddf888632fa67f1180940.md @@ -37,32 +37,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-eye')?.left, '3 - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646de5dc8988076a1d992afd.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646de5dc8988076a1d992afd.md index ed2c1f750a1..2f04748076b 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646de5dc8988076a1d992afd.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646de5dc8988076a1d992afd.md @@ -31,32 +31,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-eye')?.transfor - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646de6a97b50a86ac487de86.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646de6a97b50a86ac487de86.md index 4c91d0c593e..c0fd481a204 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646de6a97b50a86ac487de86.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646de6a97b50a86ac487de86.md @@ -45,32 +45,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-eye')?.backgro - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646de7b64467e96b7d35b5cd.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646de7b64467e96b7d35b5cd.md index 39c90beffc4..ed654550c12 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646de7b64467e96b7d35b5cd.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646de7b64467e96b7d35b5cd.md @@ -37,32 +37,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-eye')?.left, ' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646de8478d6f796bfbdccfb2.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646de8478d6f796bfbdccfb2.md index 38b7e34fe34..1e402e0e126 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646de8478d6f796bfbdccfb2.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646de8478d6f796bfbdccfb2.md @@ -31,32 +31,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-eye')?.transfo - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646de8d204a3426c7d184372.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646de8d204a3426c7d184372.md index 794a355e54c..a5982426e5c 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646de8d204a3426c7d184372.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646de8d204a3426c7d184372.md @@ -45,32 +45,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-inner-eye')?.ba - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646dea1c98c2426d43a705c3.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646dea1c98c2426d43a705c3.md index 5b2de602bcd..32bae09c6c9 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646dea1c98c2426d43a705c3.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646dea1c98c2426d43a705c3.md @@ -49,32 +49,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-inner-eye')?.tr - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646deb169847f86df0f95bfc.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646deb169847f86df0f95bfc.md index d2f1cdb59dc..1c29825ad01 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646deb169847f86df0f95bfc.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646deb169847f86df0f95bfc.md @@ -43,32 +43,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-inner-eye')?.b - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646dec359bef3b7811fba5a6.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646dec359bef3b7811fba5a6.md index f01d7176a1b..76c1d5b8150 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646dec359bef3b7811fba5a6.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646dec359bef3b7811fba5a6.md @@ -49,32 +49,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-inner-eye')?.t - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646dedbcba062079128b2ecc.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646dedbcba062079128b2ecc.md index a1c46a63d25..4fcc3a418ee 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646dedbcba062079128b2ecc.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646dedbcba062079128b2ecc.md @@ -31,36 +31,36 @@ assert.isTrue(document.querySelectorAll('div')[11].classList.contains('cat-nose' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
- - --fcc-editable-region-- - - --fcc-editable-region--
-
+ + --fcc-editable-region-- + + --fcc-editable-region-- +
+
``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646def5e863abf7a14501421.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646def5e863abf7a14501421.md index 764394b63f5..06b3322c07d 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646def5e863abf7a14501421.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646def5e863abf7a14501421.md @@ -43,34 +43,34 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-nose')?.borderBottom - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
- -
-
+ +
+
+
``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646df03c8f79337ab46f148b.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646df03c8f79337ab46f148b.md index a97bbd4dbcb..f4ca3b3dd96 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646df03c8f79337ab46f148b.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646df03c8f79337ab46f148b.md @@ -37,34 +37,34 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-nose')?.left, '85px' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
- -
-
+ +
+
+
``` @@ -196,5 +196,4 @@ body { border-right: 15px solid transparent; border-bottom: 20px solid #442c2c; } - ``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646df0cf26413a7b35e4b8b3.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646df0cf26413a7b35e4b8b3.md index 065bb2fcfbe..aad1165eb77 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646df0cf26413a7b35e4b8b3.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646df0cf26413a7b35e4b8b3.md @@ -49,34 +49,34 @@ assert.notMatch(code, /border-top-right-radius:\s*\d+%;/); - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
- -
-
+ +
+
+
``` @@ -211,5 +211,4 @@ body { border-right: 15px solid transparent; border-bottom: 20px solid #442c2c; } - ``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646df1d1aa4ae57bdf1869c4.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646df1d1aa4ae57bdf1869c4.md index 25fda884e45..a1f2879e6f8 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646df1d1aa4ae57bdf1869c4.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646df1d1aa4ae57bdf1869c4.md @@ -33,38 +33,38 @@ assert.isTrue(document.querySelectorAll('div')[12].classList.contains('cat-mouth - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
- --fcc-editable-region-- - - --fcc-editable-region-- +
+
+
+
+
+
+
-
+ +
+ + --fcc-editable-region-- + + --fcc-editable-region-- +
+
``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646dffd8ce9ac77ec1906f2e.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646dffd8ce9ac77ec1906f2e.md index 5f8c79071b8..8d5898e8e0c 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646dffd8ce9ac77ec1906f2e.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646dffd8ce9ac77ec1906f2e.md @@ -43,41 +43,40 @@ assert.isTrue(document.querySelectorAll('.cat-mouth div')[1]?.classList.contains - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
- --fcc-editable-region-- -
- +
+
+
+
+
+
- --fcc-editable-region-- +
+ +
+
+--fcc-editable-region-- + +--fcc-editable-region--
-
+
+
``` @@ -213,5 +212,4 @@ body { border-right: 15px solid transparent; border-bottom: 20px solid #442c2c; } - ``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f0417322c0e04983a5149.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f0417322c0e04983a5149.md index 1253d5bd049..dec919d6968 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f0417322c0e04983a5149.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f0417322c0e04983a5149.md @@ -43,40 +43,39 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-mouth-line-left')?.l - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
+
+
+
+
+ +
+
+
+
-
+
+
``` @@ -222,6 +221,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f08293804a30685533c6f.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f08293804a30685533c6f.md index 85fb5275afb..29911e2f562 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f08293804a30685533c6f.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f08293804a30685533c6f.md @@ -25,40 +25,39 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-mouth-line-left')?.t - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
+
+
+
+
+ +
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f09293eb3230723a62f77.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f09293eb3230723a62f77.md index 22ced9cbef0..0de360e3979 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f09293eb3230723a62f77.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f09293eb3230723a62f77.md @@ -43,40 +43,39 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-mouth-line-right')?. - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
+
+
+
+
+ +
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f0c9a1e3360092d1bbd33.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f0c9a1e3360092d1bbd33.md index d2e895c630d..f6d2aa6d111 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f0c9a1e3360092d1bbd33.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f0c9a1e3360092d1bbd33.md @@ -25,40 +25,39 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-mouth-line-right')?. - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
+
+
+
+
+ +
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f0ce5737243098ad6e494.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f0ce5737243098ad6e494.md index d1c395f426f..ff7e8c959b9 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f0ce5737243098ad6e494.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f0ce5737243098ad6e494.md @@ -33,44 +33,43 @@ assert.isTrue(document.querySelectorAll('div')[15].classList.contains('cat-whisk - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
+
+
+
+
+ +
- --fcc-editable-region-- - - --fcc-editable-region-- - +
+
+
-
+ + --fcc-editable-region-- + + --fcc-editable-region-- +
+
``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f0ef13604420a8744f7d4.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f0ef13604420a8744f7d4.md index 575ef88823d..ecbae5e6d05 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f0ef13604420a8744f7d4.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f0ef13604420a8744f7d4.md @@ -43,46 +43,45 @@ assert.isTrue(document.querySelectorAll('.cat-whiskers div')[1].classList.contai - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- - --fcc-editable-region-- -
- +
+
- --fcc-editable-region-- +
+ +
+ +
+
+
+
+
+--fcc-editable-region-- + +--fcc-editable-region--
-
+
+
``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f0f7c5933560af8e7e380.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f0f7c5933560af8e7e380.md index 455b5cc7221..fdcaa347d13 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f0f7c5933560af8e7e380.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f0f7c5933560af8e7e380.md @@ -50,49 +50,48 @@ assert.isTrue(document.querySelectorAll('.cat-whiskers-left div')[2].classList.c - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
- --fcc-editable-region-- -
- -
- --fcc-editable-region-- -
+
+
+
+ +
+
+
+
+
+ +
+
+--fcc-editable-region-- + +--fcc-editable-region-- +
+
-
+
+
``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f102bf87b350b593baa72.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f102bf87b350b593baa72.md index 87dfcbba894..e34188354ed 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f102bf87b350b593baa72.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f102bf87b350b593baa72.md @@ -49,53 +49,52 @@ assert.isTrue(document.querySelectorAll('.cat-whiskers-right div')[2].classList. - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
- --fcc-editable-region-- -
- -
- --fcc-editable-region-- +
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+--fcc-editable-region-- + +--fcc-editable-region-- +
-
+
+
``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f107abb89d00bb99f387a.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f107abb89d00bb99f387a.md index 2598e921b13..2bd78ca19b9 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f107abb89d00bb99f387a.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f107abb89d00bb99f387a.md @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whiskers-left div')? - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f12da0b4c5d0ca162834a.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f12da0b4c5d0ca162834a.md index 9df8745da72..3b7f0dea596 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f12da0b4c5d0ca162834a.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f12da0b4c5d0ca162834a.md @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-left-top')?. - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -261,6 +260,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f135eab69d90d0c6d4e9b.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f135eab69d90d0c6d4e9b.md index 28f438ee87d..1811b885dc0 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f135eab69d90d0c6d4e9b.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f135eab69d90d0c6d4e9b.md @@ -25,53 +25,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-left-top')?. - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -250,5 +249,4 @@ body { --fcc-editable-region-- } - ``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f159b2cffb21150b927cb.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f159b2cffb21150b927cb.md index e1e21c07a7f..716fbf3929f 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f159b2cffb21150b927cb.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f159b2cffb21150b927cb.md @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-left-middle' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -268,6 +267,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f164bf100dd11d226161f.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f164bf100dd11d226161f.md index 31b85f13ecb..8c567fe1b48 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f164bf100dd11d226161f.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f164bf100dd11d226161f.md @@ -25,53 +25,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-left-middle' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -254,7 +253,7 @@ body { top: 127px; left: 52px; --fcc-editable-region-- - + --fcc-editable-region-- } ``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f1764e2f1d212ba9785a7.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f1764e2f1d212ba9785a7.md index 535c2f0143d..f578b39e22a 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f1764e2f1d212ba9785a7.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f1764e2f1d212ba9785a7.md @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-left-bottom' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -275,6 +274,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f1802a09a171332e14630.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f1802a09a171332e14630.md index 956f275b867..c2a9158a7c9 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f1802a09a171332e14630.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f1802a09a171332e14630.md @@ -25,53 +25,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-left-bottom' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f4d6c42dc5f214f4e7444.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f4d6c42dc5f214f4e7444.md index dbb1bdce219..5a6d74034a5 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f4d6c42dc5f214f4e7444.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f4d6c42dc5f214f4e7444.md @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-right-top')? - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -282,6 +281,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f4e46e81f7021d5fd9c1d.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f4e46e81f7021d5fd9c1d.md index 35a6f0370c2..971cda48fc9 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f4e46e81f7021d5fd9c1d.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f4e46e81f7021d5fd9c1d.md @@ -25,53 +25,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-right-top')? - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f4f6a14e3c522d130a0d2.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f4f6a14e3c522d130a0d2.md index 204da68d8e5..2604c14e53c 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f4f6a14e3c522d130a0d2.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f4f6a14e3c522d130a0d2.md @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-right-middle - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -289,6 +288,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f4fe12b7985232bf475a5.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f4fe12b7985232bf475a5.md index ad5b02f4e0b..2e3509b39cf 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f4fe12b7985232bf475a5.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f4fe12b7985232bf475a5.md @@ -25,53 +25,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-right-middle - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f507e4d1cd323f17db4fc.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f507e4d1cd323f17db4fc.md index b9835950762..6ea8e4c82d0 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f507e4d1cd323f17db4fc.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f507e4d1cd323f17db4fc.md @@ -44,53 +44,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-right-bottom - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -297,6 +296,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f516dbfc1342495515625.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f516dbfc1342495515625.md index 375ad5ede5c..fdb255ad34b 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f516dbfc1342495515625.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/646f516dbfc1342495515625.md @@ -27,53 +27,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-right-bottom - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -295,53 +294,53 @@ body { - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+ +
+
``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/6476f5c17f99146071ee884c.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/6476f5c17f99146071ee884c.md index d579ea52027..801986230b0 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/6476f5c17f99146071ee884c.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/6476f5c17f99146071ee884c.md @@ -41,14 +41,14 @@ assert.equal(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.left, '100p - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
+
+
+
``` @@ -65,9 +65,9 @@ body { .cat-head { --fcc-editable-region-- position: static; +--fcc-editable-region-- top: 100px; left: 100px; ---fcc-editable-region-- background: linear-gradient(#5e5e5e 85%, #45454f 100%); width: 205px; height: 180px; diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/6476f7a4827bcc61682f2347.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/6476f7a4827bcc61682f2347.md index 46b3d9c1a18..a60da3acf71 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/6476f7a4827bcc61682f2347.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/6476f7a4827bcc61682f2347.md @@ -9,9 +9,7 @@ dashedName: step-9 Quando você usa o valor `absolute` para a propriedade `position`, o elemento é retirado do fluxo normal do documento. Então, a posição é determinada pelas propriedades `top`, `right`, `bottom` e `left`. -Defina a propriedade `position` do elemento `.cat-head` como `absolute`. Em seguida, defina as propriedades `top` e `left` com qualquer valor positivo em pixels. - - +Defina a propriedade `position` do seu elemento `.cat-head` como `absolute`. # --hints-- @@ -43,14 +41,14 @@ assert.match(code, /left:\s*\d{1,4}px;/); - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
+
+
+
``` @@ -67,9 +65,9 @@ body { .cat-head { --fcc-editable-region-- position: relative; +--fcc-editable-region-- top: 100px; left: 100px; ---fcc-editable-region-- background: linear-gradient(#5e5e5e 85%, #45454f 100%); width: 205px; height: 180px; diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/6476fb7cbaafa36d65e9cf35.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/6476fb7cbaafa36d65e9cf35.md index f831e7cb015..0127b8cfaf8 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/6476fb7cbaafa36d65e9cf35.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/6476fb7cbaafa36d65e9cf35.md @@ -33,17 +33,17 @@ assert.equal(document.querySelectorAll('div')[1]?.getAttribute('class'), 'box'); - - fCC Cat Painting - + + fCC Cat Painting + -
-
- --fcc-editable-region-- - - --fcc-editable-region-- -
+
+
+ --fcc-editable-region-- + + --fcc-editable-region-- +
``` @@ -59,8 +59,8 @@ body { .cat-head { position: absolute; - top: 300px; - left: 400px; + top: 100px; + left: 100px; background: linear-gradient(#5e5e5e 85%, #45454f 100%); width: 205px; height: 180px; diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/6476fc5cf14b276e6d04e82a.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/6476fc5cf14b276e6d04e82a.md index ddfb6e21be7..e571531857b 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/6476fc5cf14b276e6d04e82a.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/6476fc5cf14b276e6d04e82a.md @@ -7,7 +7,7 @@ dashedName: step-11 # --description-- -Use um seletor de classe para dar ao elemento `.box` uma largura de `200px`, uma altura de `600px` e uma cor de fundo de `#000`. Dê a ele, também, uma `position` `absolute`, um valor de `top` de `800px` e um valor de `left` de `650px`. +Use um seletor de classe para dar ao elemento `.box` uma largura de `200px`, uma altura de `600px` e uma cor de fundo de `#000`. Dê a ele, também, uma `position` `absolute`, um valor de `top` de `800px` e um valor de `left` de `650px`. # --hints-- @@ -61,15 +61,15 @@ assert.equal(new __helpers.CSSHelp(document)?.getStyle('.box')?.top, '800px'); - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
+
+
+
+
``` @@ -84,7 +84,7 @@ body { } .cat-head { - position: relative; + position: absolute; top: 100px; left: 100px; background: linear-gradient(#5e5e5e 85%, #45454f 100%); diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/6476fd4213318f6ee211028a.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/6476fd4213318f6ee211028a.md index a829864c343..a80b0c9dc56 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/6476fd4213318f6ee211028a.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/6476fd4213318f6ee211028a.md @@ -7,7 +7,7 @@ dashedName: step-12 # --description-- -Agora, substitua o valor da propriedade `position` em `.cat-head` por `fixed`. Deixe `top` e `left` como estão. +Agora substitua o valor da propriedade `position` do seu `.cat-head` por `fixed`. Depois disso, role para cima e para baixo para ver como o valor `fixed` funciona. @@ -39,15 +39,15 @@ assert.equal(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.left, '100p - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
+
+
+
+
``` @@ -63,10 +63,10 @@ body { .cat-head { --fcc-editable-region-- - position: relative; + position: absolute; +--fcc-editable-region-- top: 100px; left: 100px; ---fcc-editable-region-- background: linear-gradient(#5e5e5e 85%, #45454f 100%); width: 205px; height: 180px; diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/64770351e8586671ec0911f0.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/64770351e8586671ec0911f0.md index 1f04391d0a7..563f12f0750 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/64770351e8586671ec0911f0.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/64770351e8586671ec0911f0.md @@ -41,15 +41,15 @@ assert.notMatch(code, /left:\s*100px;?/); - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
+
+
+
+
``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/6477062778c85972eb648030.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/6477062778c85972eb648030.md index d33b2a35db0..4ed56db07a0 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/6477062778c85972eb648030.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/6477062778c85972eb648030.md @@ -7,7 +7,7 @@ dashedName: step-14 # --description-- -Você, agora, deve centralizar a cabeça do gato. +Você, agora, deve centralizar a cabeça do gato. Dê ao elemento `.cat-head` uma propriedade `position` definida como `absolute`. Defina um valor de `0` para as propriedades `right`, `left`, `top` e `bottom`. Em seguida, defina a propriedade `margin` de todos os lados como `auto`. Essa é uma maneira de centralizar um elemento verticalmente e horizontalmente usando posicionamento em CSS. @@ -57,15 +57,15 @@ assert.equal(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.margin, 'au - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
+
+
+
+
``` @@ -82,8 +82,8 @@ body { .cat-head { --fcc-editable-region-- position: sticky; - top: 0; --fcc-editable-region-- + top: 0; background: linear-gradient(#5e5e5e 85%, #45454f 100%); width: 205px; height: 180px; @@ -92,7 +92,7 @@ body { } .box { - width: 400px; + width: 200px; height: 600px; background-color: #000; position: absolute; diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/647d821de0d97b3283c72b36.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/647d821de0d97b3283c72b36.md index 59b5773c527..d7a7baeb062 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/647d821de0d97b3283c72b36.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/647d821de0d97b3283c72b36.md @@ -14,7 +14,7 @@ Além disso, remova a regra do CSS `.box` e suas declarações, pois você não Você deve remover a regra do CSS `.box` e todos os seus valores. ```js -assert.notMatch(code, /\.box\s*\{\s*width:\s*400px;\s*height:\s*600px;\s*background-color:\s*#000;\s*position:\s*absolute;\s*left:\s*650px;\s*top:\s*800px;?\s*\}\s*/) +assert.notMatch(code, /\.box\s*\{\s*width:\s*200px;\s*height:\s*600px;\s*background-color:\s*#000;\s*position:\s*absolute;\s*left:\s*650px;\s*top:\s*800px;?\s*\}\s*/) ``` # --seed-- @@ -25,14 +25,14 @@ assert.notMatch(code, /\.box\s*\{\s*width:\s*400px;\s*height:\s*600px;\s*backgro - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
+
+
+
``` @@ -62,7 +62,7 @@ body { --fcc-editable-region-- .box { - width: 400px; + width: 200px; height: 600px; background-color: #000; position: absolute; diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/647d855ac12cd436059acd39.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/647d855ac12cd436059acd39.md index 35919971c79..360c08eeec6 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/647d855ac12cd436059acd39.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/647d855ac12cd436059acd39.md @@ -33,9 +33,9 @@ assert.strictEqual(new __helpers.CSSHelp(document).getStyle('*')?.boxSizing, 'bo - - fCC Cat Painting - + + fCC Cat Painting + diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/649353647c44ef4867ab4935.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/649353647c44ef4867ab4935.md index aa45e675cff..e4f19587d86 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/649353647c44ef4867ab4935.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/649353647c44ef4867ab4935.md @@ -25,17 +25,17 @@ assert.notMatch(code, /<\/div>/) - - fCC Cat Painting - + + fCC Cat Painting + -
-
- --fcc-editable-region-- -
- --fcc-editable-region-- -
+
+
+ --fcc-editable-region-- +
+ --fcc-editable-region-- +
``` @@ -64,7 +64,7 @@ body { } .box { - width: 400px; + width: 200px; height: 600px; background-color: #000; position: absolute; diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/64a2687ef267e5934a2f93e3.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/64a2687ef267e5934a2f93e3.md index f9c3e7df142..78ae3c09da5 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/64a2687ef267e5934a2f93e3.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/64a2687ef267e5934a2f93e3.md @@ -43,39 +43,39 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-mouth div')?.border, - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
- -
- -
-
-
+
+
-
+ +
+ +
+
+
+
+
+
``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/64a26ac5540c5493f4641f10.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/64a26ac5540c5493f4641f10.md index 7362eaf9a55..af5e747f012 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/64a26ac5540c5493f4641f10.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/64a26ac5540c5493f4641f10.md @@ -32,39 +32,39 @@ assert.match(code, /border-radius:\s*190%\/190px\s*150px\s*0\s*0\s*;?/) - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
- -
- -
-
-
+
+
-
+ +
+ +
+
+
+
+
+
``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/64a3bcbc83e574b58c8ed048.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/64a3bcbc83e574b58c8ed048.md index bf5184ceae8..4b3b7ac6840 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/64a3bcbc83e574b58c8ed048.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/64a3bcbc83e574b58c8ed048.md @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whiskers-right div') - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/6676a8a8d9861319ee901a90.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/6676a8a8d9861319ee901a90.md index 63304e74a57..9aa453df91d 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/6676a8a8d9861319ee901a90.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/6676a8a8d9861319ee901a90.md @@ -103,23 +103,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-ear')?.borderBo - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/6676a8b01e56ec1a1e07c202.md b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/6676a8b01e56ec1a1e07c202.md index bb6b5531d1f..6e3669b8331 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-cat-painting/6676a8b01e56ec1a1e07c202.md +++ b/curriculum/challenges/portuguese/blocks/workshop-cat-painting/6676a8b01e56ec1a1e07c202.md @@ -73,23 +73,23 @@ assert.isEmpty(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.backg - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` @@ -117,15 +117,15 @@ body { border-radius: 46%; } ---fcc-editable-region-- .cat-right-ear { +--fcc-editable-region-- height: 100px; width: 100px; background-color: white; border-left: 35px solid blue; border-right: 35px solid blue; border-top: 35px solid red; +--fcc-editable-region-- border-bottom: 35px solid red; } ---fcc-editable-region-- ``` diff --git a/curriculum/challenges/portuguese/blocks/workshop-envelope-budget-app/69b2c970cb02ddaafff1c10d.md b/curriculum/challenges/portuguese/blocks/workshop-envelope-budget-app/69b2c970cb02ddaafff1c10d.md index 7df108d83e4..576c399186b 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-envelope-budget-app/69b2c970cb02ddaafff1c10d.md +++ b/curriculum/challenges/portuguese/blocks/workshop-envelope-budget-app/69b2c970cb02ddaafff1c10d.md @@ -62,7 +62,7 @@ assert.notMatch(code, /<\/input>/); O elemento `input` deve ter o `>` de fechamento. ```js -assert.match(code, /HTMLString\s*=\s*`\n\s*Expense\s\$\{entryNumber\}\sName<\/label>\n\s*]*\/>/); +assert.match(code, /HTMLString\s*=\s*`\n\s*Expense\s\$\{entryNumber\}\sName<\/label>\n\s*]*>/); ``` # --seed-- diff --git a/curriculum/challenges/portuguese/blocks/workshop-fcc-authors-page/69e14a2fd8ecf9210c0739ee.md b/curriculum/challenges/portuguese/blocks/workshop-fcc-authors-page/69e14a2fd8ecf9210c0739ee.md index eb0de80c726..717adb6ee8b 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-fcc-authors-page/69e14a2fd8ecf9210c0739ee.md +++ b/curriculum/challenges/portuguese/blocks/workshop-fcc-authors-page/69e14a2fd8ecf9210c0739ee.md @@ -11,6 +11,12 @@ Ao chamar uma função assíncrona, você pode aguardar o retorno da função ou Adicione uma chamada para a função `initialFetch` no espaço indicado no editor. +# --before-all-- + +```js +window.fetch = () => Promise.resolve({json: () => Promise.resolve([{ author: 'Whoever', image: 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==', url: "http://not-a-real-url.nowhere/", bio: 'words go here' }])}); +``` + # --hints-- Você deve chamar `initialFetch` sem argumentos. diff --git a/curriculum/challenges/portuguese/blocks/workshop-fortune-teller-app/68ded620ab19272a3fa97592.md b/curriculum/challenges/portuguese/blocks/workshop-fortune-teller-app/68ded620ab19272a3fa97592.md index 2de45b205ed..e5cb972bec7 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-fortune-teller-app/68ded620ab19272a3fa97592.md +++ b/curriculum/challenges/portuguese/blocks/workshop-fortune-teller-app/68ded620ab19272a3fa97592.md @@ -73,10 +73,9 @@ assert.isTrue(renderCard.hasReturnAnnotation("string")); Sua função `renderCard` deve retornar um template literal. ```js -assert.match( - __helpers.removeJSComments(code), - /renderCard\s*=\s*\([^)]*\)\s*:\s*string\s*=>\s*(?:\{\s*return\s*)?`/ -); +const explorer = await __helpers.Explorer(code); +const { renderCard } = explorer.allFunctions; +assert.match(__helpers.removeJSComments(renderCard.toString()), /(?:return|=>)\s*`/); ``` # --seed-- diff --git a/curriculum/challenges/portuguese/blocks/workshop-fortune-teller-app/68ed4621677e86eeefa59fe6.md b/curriculum/challenges/portuguese/blocks/workshop-fortune-teller-app/68ed4621677e86eeefa59fe6.md index f4e5ca49645..af0af5e521a 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-fortune-teller-app/68ed4621677e86eeefa59fe6.md +++ b/curriculum/challenges/portuguese/blocks/workshop-fortune-teller-app/68ed4621677e86eeefa59fe6.md @@ -15,8 +15,8 @@ Seu método `initializeEventListeners` deve ter um tipo de retorno `void`. ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.initializeEventListeners.toString(); -assert.match(method, /initializeEventListeners\s*\(\s*\)\s*:\s*void/); +const { initializeEventListeners } = explorer.classes.Game?.methods ?? {}; +assert.isTrue(initializeEventListeners?.hasReturnAnnotation("void")); ``` # --seed-- diff --git a/curriculum/challenges/portuguese/blocks/workshop-fortune-teller-app/68ee6c4b4c764b62d77df717.md b/curriculum/challenges/portuguese/blocks/workshop-fortune-teller-app/68ee6c4b4c764b62d77df717.md index ffa3c8d51da..ddc1bc937c8 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-fortune-teller-app/68ee6c4b4c764b62d77df717.md +++ b/curriculum/challenges/portuguese/blocks/workshop-fortune-teller-app/68ee6c4b4c764b62d77df717.md @@ -17,16 +17,30 @@ Você deve declarar uma variável chamada `isReversed`. ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.singleCardSelected.toString(); -assert.match(method, /const\s+isReversed\s*=/); +const { singleCardSelected } = explorer.classes.Game?.methods ?? {}; +const { isReversed } = singleCardSelected?.variables ?? {}; +assert.exists(isReversed); ``` Sua variável `isReversed` deve usar `Math.random()` para decidir aleatoriamente se o cartão está invertido. ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.singleCardSelected.toString(); -assert.match(method, /isReversed\s*=\s*Math\.random\s*\(\s*\)\s*<\s*0\.5/); +const { singleCardSelected } = explorer.classes.Game?.methods ?? {}; +const { isReversed } = singleCardSelected?.variables ?? {}; + +const validForms = [ + 'Math.random() < 0.5', + 'Math.random() > 0.5', + 'Math.random() <= 0.5', + 'Math.random() >= 0.5', + '0.5 < Math.random()', + '0.5 > Math.random()', + '0.5 <= Math.random()', + '0.5 >= Math.random()' +]; + +assert.isTrue(validForms.some((form) => isReversed?.value.matches(form))); ``` # --seed-- diff --git a/curriculum/challenges/portuguese/blocks/workshop-fortune-teller-app/68ee6c8c274515694ead0024.md b/curriculum/challenges/portuguese/blocks/workshop-fortune-teller-app/68ee6c8c274515694ead0024.md index 000aa4969d6..a7b0c78ca20 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-fortune-teller-app/68ee6c8c274515694ead0024.md +++ b/curriculum/challenges/portuguese/blocks/workshop-fortune-teller-app/68ee6c8c274515694ead0024.md @@ -7,7 +7,7 @@ dashedName: step-32 # --description-- -A sorte deve ser aleatória, então é necessário uma função auxiliar para selecionar uma sorte aleatória. Declare uma variável chamada `chosenCard` dentro do método `singleCardSelected`. Use o método `getRandomItem` para obter uma carta aleatória e passe `cards` como argumento. +A previsão deve ser aleatória, então é necessário uma função auxiliar para selecionar uma previsão aleatória. Declare uma variável chamada `chosenCard` dentro do método `singleCardSelected`. Use a função `getRandomItem` para obter um cartão aleatório e passe `this.cards` como argumento. # --hints-- @@ -15,22 +15,18 @@ Você deve declarar uma variável chamada `chosenCard` dentro de `singleCardSele ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.singleCardSelected.toString(); -assert.match(method, /const\s+chosenCard\s*=/); +const { singleCardSelected } = explorer.classes.Game?.methods ?? {}; +const { chosenCard } = singleCardSelected?.variables ?? {}; +assert.exists(chosenCard); ``` Sua variável `chosenCard` deve ser atribuída pela chamada de `getRandomItem(this.cards)`. ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.singleCardSelected.toString(); -assert.match(method, /chosenCard\s*=\s*getRandomItem\s*\(\s*this\.cards\s*\)/); -``` - -Você deve passar `this.cards` como argumento para `getRandomItem`. - -```js -assert.match(__helpers.removeJSComments(code), /getRandomItem\s*\(\s*this\.cards\s*\)/); +const { singleCardSelected } = explorer.classes.Game?.methods ?? {}; +const { chosenCard } = singleCardSelected?.variables ?? {}; +assert.isTrue(chosenCard?.value.matches("getRandomItem(this.cards)")); ``` # --seed-- diff --git a/curriculum/challenges/portuguese/blocks/workshop-fortune-teller-app/68f1e43a5f890b51774d93c4.md b/curriculum/challenges/portuguese/blocks/workshop-fortune-teller-app/68f1e43a5f890b51774d93c4.md index 83a626299ab..5951e2696fb 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-fortune-teller-app/68f1e43a5f890b51774d93c4.md +++ b/curriculum/challenges/portuguese/blocks/workshop-fortune-teller-app/68f1e43a5f890b51774d93c4.md @@ -15,22 +15,28 @@ Você deve declarar uma variável chamada `target` dentro do `showFortune`. ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /const\s+target\s*=/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { target } = showFortune?.variables ?? {}; +assert.exists(target); ``` Sua variável `target` deve ser atribuída a `e.target`. ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /target\s*=\s*e\.target/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { target } = showFortune?.variables ?? {}; +assert.isTrue(target?.value.matches("e.target")); ``` Você deve ter uma instrução `if` vazia logo após sua variável `target`. ```js -assert.match(__helpers.removeJSComments(code), /showFortune\s*\([^)]*\)\s*\{[\s\S]*?if\s*\(\s*\)\s*\{\s*\}/); +const explorer = await __helpers.Explorer(code); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +assert.exists(showFortune); +const method = __helpers.removeJSComments(showFortune.toString()); +assert.match(method, /target\s*=\s*e\.target[\s\S]*?if\s*\(\s*\)\s*\{\s*\}/); ``` # --seed-- diff --git a/curriculum/challenges/portuguese/blocks/workshop-fortune-teller-app/68f1e6a98bc05e67cc2b85e6.md b/curriculum/challenges/portuguese/blocks/workshop-fortune-teller-app/68f1e6a98bc05e67cc2b85e6.md index 9ddb1dd3fd9..a155fedac34 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-fortune-teller-app/68f1e6a98bc05e67cc2b85e6.md +++ b/curriculum/challenges/portuguese/blocks/workshop-fortune-teller-app/68f1e6a98bc05e67cc2b85e6.md @@ -15,22 +15,18 @@ Você deve declarar uma variável chamada `cardElement` dentro do `showFortune`. ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /const\s+cardElement\s*=/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { cardElement } = showFortune?.variables ?? {}; +assert.exists(cardElement); ``` Sua `cardElement` deve usar `target?.closest` para buscar o `.card_container`. ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /cardElement\s*=\s*target\?\.closest\s*\(\s*['"]\.card_container['"]\s*\)/); -``` - -Você deve passar `.card_container` como argumento para `closest`. - -```js -assert.match(__helpers.removeJSComments(code), /\.closest\s*\(\s*['"]\.card_container['"]\s*\)/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { cardElement } = showFortune?.variables ?? {}; +assert.isTrue(cardElement?.value.matches("target?.closest('.card_container')")); ``` # --seed-- diff --git a/curriculum/challenges/portuguese/blocks/workshop-fortune-teller-app/68f1e852f705eb77f6bcb893.md b/curriculum/challenges/portuguese/blocks/workshop-fortune-teller-app/68f1e852f705eb77f6bcb893.md index 460008b3e62..b1ea0fc8dc7 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-fortune-teller-app/68f1e852f705eb77f6bcb893.md +++ b/curriculum/challenges/portuguese/blocks/workshop-fortune-teller-app/68f1e852f705eb77f6bcb893.md @@ -15,28 +15,18 @@ Você deve declarar uma variável chamada `cardId` dentro de `showFortune`. ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /const\s+cardId\s*=/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { cardId } = showFortune?.variables ?? {}; +assert.exists(cardId); ``` Sua variável `cardId` deve ser atribuída chamando `cardElement.getAttribute("data-id")`. ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /cardId\s*=\s*cardElement\.getAttribute\s*\(\s*['"]data-id['"]\s*\)/); -``` - -Você deve usar o método `getAttribute` em `cardElement`. - -```js -assert.match(__helpers.removeJSComments(code), /cardElement\.getAttribute\s*\(/); -``` - -Você deve passar `'data-id'` para `getAttribute`. - -```js -assert.match(__helpers.removeJSComments(code), /\.getAttribute\s*\(\s*['"]data-id['"]\s*\)/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { cardId } = showFortune?.variables ?? {}; +assert.isTrue(cardId?.value.matches('cardElement.getAttribute("data-id")')); ``` # --seed-- diff --git a/curriculum/challenges/portuguese/blocks/workshop-fortune-teller-app/68f1e8de2731b07d62e738d2.md b/curriculum/challenges/portuguese/blocks/workshop-fortune-teller-app/68f1e8de2731b07d62e738d2.md index 3e78a64f748..036c5d6409e 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-fortune-teller-app/68f1e8de2731b07d62e738d2.md +++ b/curriculum/challenges/portuguese/blocks/workshop-fortune-teller-app/68f1e8de2731b07d62e738d2.md @@ -15,28 +15,38 @@ Você deve declarar uma variável chamada `foundCard` dentro de `showFortune`. ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /const\s+foundCard\s*=/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { foundCard } = showFortune?.variables ?? {}; +assert.exists(foundCard); ``` -Sua `foundCard` deve ser atribuída chamando `find` em `this.cards` com o callback correto. +Seu `foundCard` deve ser atribuído chamando `find` em `this.cards`, passando um callback que recebe um parâmetro `card` e retorna o resultado da comparação de `card.name_short` com `cardId` usando igualdade estrita. ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /foundCard\s*=\s*this\.cards\.find\s*\(/); -``` - -O callback `find` deve ter um parâmetro chamado `card`. - -```js -assert.match(__helpers.removeJSComments(code), /cards\.find\s*\(\s*\(\s*card\s*\)\s*=>/); -``` - -Dentro do callback, `card.name_short` deve ser comparado com `cardId`. - -```js -assert.match(__helpers.removeJSComments(code), /card\.name_short\s*===?\s*cardId/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { foundCard } = showFortune?.variables ?? {}; + +const validForms = [ + 'this.cards.find((card) => card.name_short === cardId)', + 'this.cards.find((card) => { return card.name_short === cardId; })', + 'this.cards.find((card) => cardId === card.name_short)', + 'this.cards.find((card) => { return cardId === card.name_short; })', + 'this.cards.find(card => card.name_short === cardId)', + 'this.cards.find(card => { return card.name_short === cardId; })', + 'this.cards.find(card => cardId === card.name_short)', + 'this.cards.find(card => { return cardId === card.name_short; })', + 'this.cards.find((card: Card) => card.name_short === cardId)', + 'this.cards.find((card: Card) => { return card.name_short === cardId; })', + 'this.cards.find((card: Card) => cardId === card.name_short)', + 'this.cards.find((card: Card) => { return cardId === card.name_short; })', + 'this.cards.find(function (card) { return card.name_short === cardId; })', + 'this.cards.find(function (card) { return cardId === card.name_short; })', + 'this.cards.find(function (card: Card) { return card.name_short === cardId; })', + 'this.cards.find(function (card: Card) { return cardId === card.name_short; })' +]; + +assert.isTrue(validForms.some((form) => foundCard?.value.matches(form))); ``` # --seed-- diff --git a/curriculum/challenges/portuguese/blocks/workshop-greeting-bot/66ad8ab945d266383f318cbf.md b/curriculum/challenges/portuguese/blocks/workshop-greeting-bot/66ad8ab945d266383f318cbf.md index 31754da7416..781b8258303 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-greeting-bot/66ad8ab945d266383f318cbf.md +++ b/curriculum/challenges/portuguese/blocks/workshop-greeting-bot/66ad8ab945d266383f318cbf.md @@ -30,7 +30,11 @@ assert.lengthOf(logSpy.calls, 2); A instrução `console` deve ter a mensagem `"I am excited to talk to you."`. Não se esqueça das aspas. ```js -assert.deepInclude(logSpy.calls, ["I am excited to talk to you."]); +assert.isTrue( + logSpy.calls.some( + (call) => /I\s+am\s+excited\s+to\s+talk\s+to\s+you\s*\./.test(call[0]) + ) +); ``` # --seed-- diff --git a/curriculum/challenges/portuguese/blocks/workshop-greeting-bot/66ad9c633fa26d3c1475eae3.md b/curriculum/challenges/portuguese/blocks/workshop-greeting-bot/66ad9c633fa26d3c1475eae3.md index e8b01d4af6a..f554bcb41e7 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-greeting-bot/66ad9c633fa26d3c1475eae3.md +++ b/curriculum/challenges/portuguese/blocks/workshop-greeting-bot/66ad9c633fa26d3c1475eae3.md @@ -28,7 +28,11 @@ assert.lengthOf(logSpy.calls, 3); A instrução de `console` deve ter a mensagem `"Allow me to introduce myself."`. Não se esqueça das aspas. ```js -assert.deepInclude(logSpy.calls, ["Allow me to introduce myself."]); +assert.isTrue( + logSpy.calls.some( + (call) => /Allow\s+me\s+to\s+introduce\s+myself\s*\./.test(call[0]) + ) +); ``` # --seed-- diff --git a/curriculum/challenges/portuguese/blocks/workshop-greeting-bot/66add47d27763c4862492c8c.md b/curriculum/challenges/portuguese/blocks/workshop-greeting-bot/66add47d27763c4862492c8c.md index ee77ca6bc19..8701e97e347 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-greeting-bot/66add47d27763c4862492c8c.md +++ b/curriculum/challenges/portuguese/blocks/workshop-greeting-bot/66add47d27763c4862492c8c.md @@ -76,12 +76,10 @@ console.log(favoriteSubjectSentence); ```js console.log("Hi there!"); console.log("I am excited to talk to you."); - let bot; -let botLocation; - bot = "teacherBot"; -botLocation = "the universe"; + +let botLocation = "the universe"; console.log("Allow me to introduce myself."); diff --git a/curriculum/challenges/portuguese/blocks/workshop-hotel-feedback-form/66a93bbe65a26169dbf3bc39.md b/curriculum/challenges/portuguese/blocks/workshop-hotel-feedback-form/66a93bbe65a26169dbf3bc39.md index 87729f39af1..ca5acbc7cec 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-hotel-feedback-form/66a93bbe65a26169dbf3bc39.md +++ b/curriculum/challenges/portuguese/blocks/workshop-hotel-feedback-form/66a93bbe65a26169dbf3bc39.md @@ -13,7 +13,7 @@ Comece adicionando um novo elemento `label` com o texto `Email address (required # --hints-- -Você deve ter um elemento `label`. +Você deve ter um segundo elemento `label` dentro do seu `fieldset`. ```js assert.lengthOf(document.querySelectorAll('fieldset label'), 2); diff --git a/curriculum/challenges/portuguese/blocks/workshop-hotel-feedback-form/66a9401c9d660d6bb15993e2.md b/curriculum/challenges/portuguese/blocks/workshop-hotel-feedback-form/66a9401c9d660d6bb15993e2.md index e74bd1d7e72..e14a9576913 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-hotel-feedback-form/66a9401c9d660d6bb15993e2.md +++ b/curriculum/challenges/portuguese/blocks/workshop-hotel-feedback-form/66a9401c9d660d6bb15993e2.md @@ -7,7 +7,7 @@ dashedName: step-13 # --description-- -O formulário de feedback de hotéis deve ter uma opção para os usuários adicionarem a sua idade. +O formulário de feedback de hotéis deve ter uma opção para os usuários adicionarem a sua idade. Comece adicionando um elemento `label` com o texto `Age (optional):` ao formulário. @@ -15,7 +15,7 @@ O atributo `for` deve estar definido como `"age"`. # --hints-- -Você deve ter um elemento `label`. +Você deve ter um terceiro elemento `label` dentro do seu `fieldset`. ```js assert.lengthOf(document.querySelectorAll('fieldset label'), 3); diff --git a/curriculum/challenges/portuguese/blocks/workshop-hotel-feedback-form/66a9419e2d18476c645ce693.md b/curriculum/challenges/portuguese/blocks/workshop-hotel-feedback-form/66a9419e2d18476c645ce693.md index de4fa90b20d..27ac10de681 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-hotel-feedback-form/66a9419e2d18476c645ce693.md +++ b/curriculum/challenges/portuguese/blocks/workshop-hotel-feedback-form/66a9419e2d18476c645ce693.md @@ -7,7 +7,7 @@ dashedName: step-14 # --description-- -O `input` de números é usado para criar um campo de entrada numérico. +O `input` de números é usado para criar um campo de entrada numérico. Aqui está um exemplo de um campo de entrada numérico: @@ -17,7 +17,7 @@ Aqui está um exemplo de um campo de entrada numérico: Os atributos `min` e `max` são usados para definir os valores mínimos e máximos que podem ser inseridos no campo de entrada. -Abaixo do elemento `label`, adicione uma entrada com o atributo `type` definido como `"number"` e um `id` de `"age"`. +Abaixo do seu elemento `label`, adicione uma `input` com o atributo `type` definido como `"number"` e um `id` igual a `"age"`. O atributo `name` deve ser definido como `"age"`, o atributo `min` deve ser definido como `"3"` e o atributo `max` deve ser definido como `"100"`. @@ -29,13 +29,13 @@ Você deve ter um `input` numérico abaixo do seu elemento `label`. assert.isNotNull(document.querySelector('label + input[type="number"]')); ``` -O `input` de números deve ter um `id` de `age`. +Sua `input` do tipo número deve ter um `id` igual a `"age"`. ```js assert.isNotNull(document.querySelector('label + input#age')); ``` -O `input` de números deve ter um atributo `name` definido como `age`. +Sua `input` do tipo número deve ter um atributo `name` definido como `"age"`. ```js assert.isNotNull(document.querySelector('label + input[name="age"]')); diff --git a/curriculum/challenges/portuguese/blocks/workshop-hotel-feedback-form/67a51d3a8a6fe123b77b0c6e.md b/curriculum/challenges/portuguese/blocks/workshop-hotel-feedback-form/67a51d3a8a6fe123b77b0c6e.md index 96d17649f2b..2737078b807 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-hotel-feedback-form/67a51d3a8a6fe123b77b0c6e.md +++ b/curriculum/challenges/portuguese/blocks/workshop-hotel-feedback-form/67a51d3a8a6fe123b77b0c6e.md @@ -7,11 +7,11 @@ dashedName: step-12 # --description-- -Elementos `input` podem ter um atributo `size`. Este atributo define o número de caracteres que devem estar visíveis enquanto o usuário digita no input. O valor de `size` deve ser um inteiro não negativo maior que zero. Se `size` não for especificado ou for especificado com um valor inválido, a entrada terá a largura padrão definida pelo navegador. +Elementos `input` podem ter um atributo `size`. Esse atributo define o número de caracteres que devem estar visíveis enquanto o usuário digita no `input`. O valor de `size` deve ser um inteiro positivo. Se `size` não for especificado ou for especificado com um valor inválido, o `input` terá a largura padrão definida pelo navegador. ```html - - + + ``` Dê aos inputs de nome e email um atributo `size` com valor `"20"`. diff --git a/curriculum/challenges/portuguese/blocks/workshop-plant-nursery-catalog/6734a772196245601e4b80e0.md b/curriculum/challenges/portuguese/blocks/workshop-plant-nursery-catalog/6734a772196245601e4b80e0.md index 40af0a9c0ff..2370213361e 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-plant-nursery-catalog/6734a772196245601e4b80e0.md +++ b/curriculum/challenges/portuguese/blocks/workshop-plant-nursery-catalog/6734a772196245601e4b80e0.md @@ -9,7 +9,7 @@ dashedName: step-10 Quando você precisar recuperar um elemento de um mapa, pode usar o método `get`. Ele recebe uma chave como argumento e retorna o valor associado. -Use o método `get` para recuperar o valor da chave `ballerina` do seu catálogo e atribuí-lo a uma variável chamada `getBallerina`. Então, registre sua nova variável no console. +Use o método `get` para recuperar o valor da chave `ballerina` do seu catálogo e atribua-o a uma variável chamada `getBallerina`. Depois, registre sua nova variável no console. # --hints-- @@ -22,7 +22,10 @@ assert.exists(getBallerina); Sua variável `getBallerina` deve ter o valor de `catalog.get(ballerina)`. ```js -assert.match(__helpers.removeJSComments(code), /(const|let|var)\s+getBallerina\s*=\s*catalog\s*\.\s*get\s*\(\s*ballerina\s*\)/); +const explorer = await __helpers.Explorer(code); +const { getBallerina } = explorer.variables; +assert.isTrue(getBallerina?.value.matches('catalog.get(ballerina)') +); ``` Você deve registrar sua variável `getBallerina` no console. diff --git a/curriculum/challenges/portuguese/blocks/workshop-plant-nursery-catalog/6737a1a073a0d14c6544d301.md b/curriculum/challenges/portuguese/blocks/workshop-plant-nursery-catalog/6737a1a073a0d14c6544d301.md index efddef8904a..c69d55547a4 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-plant-nursery-catalog/6737a1a073a0d14c6544d301.md +++ b/curriculum/challenges/portuguese/blocks/workshop-plant-nursery-catalog/6737a1a073a0d14c6544d301.md @@ -23,7 +23,9 @@ assert.exists(plantsSet); Você deve chamar `displayPlantsSet` e atribuí-lo a `plantsSet`. ```js -assert.match(__helpers.removeJSComments(code), /(const|let|var)\s+plantsSet\s*=\s*displayPlantsSet\s*\(\s*\)/) +const explorer = await __helpers.Explorer(code); +const { plantsSet } = explorer.variables; +assert.isTrue(plantsSet?.value.matches('displayPlantsSet()')); ``` Você deve registrar `plantsSet` no console. diff --git a/curriculum/challenges/portuguese/blocks/workshop-reusable-mega-navbar/6740495ba48aa94e5667b436.md b/curriculum/challenges/portuguese/blocks/workshop-reusable-mega-navbar/6740495ba48aa94e5667b436.md index 6643202cc68..075d0182f32 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-reusable-mega-navbar/6740495ba48aa94e5667b436.md +++ b/curriculum/challenges/portuguese/blocks/workshop-reusable-mega-navbar/6740495ba48aa94e5667b436.md @@ -24,7 +24,7 @@ export function multiply(a, b) { } ``` -Além disso, os componentes funcionais do React precisam começar com uma letra maiúscula porque é uma forma de diferenciar dos elementos HTML comuns. +Além disso, componentes funcionais do React precisam começar com letra maiúscula porque é assim que o React os diferencia dos elementos HTML comuns. # --hints-- diff --git a/curriculum/challenges/portuguese/blocks/workshop-reusable-mega-navbar/67457ff2dc531fbed928a0f0.md b/curriculum/challenges/portuguese/blocks/workshop-reusable-mega-navbar/67457ff2dc531fbed928a0f0.md index a0f95268d2e..178e8ff8a2d 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-reusable-mega-navbar/67457ff2dc531fbed928a0f0.md +++ b/curriculum/challenges/portuguese/blocks/workshop-reusable-mega-navbar/67457ff2dc531fbed928a0f0.md @@ -24,10 +24,9 @@ const App = () => { } ``` - Dentro do componente `Navbar`, retorne um elemento `nav` que tenha um `className` de `navbar`. -A razão pela qual `className` é usado aqui em vez de `class` é porque `class` é uma palavra-chave reservada em JavaScript. Então, o React usa `className` como uma forma de aplicar classes aos elementos. +`className` é usado aqui em vez de `class` porque `class` é uma palavra-chave reservada em JavaScript. Então, o React usa `className` como uma forma de aplicar classes aos elementos. # --hints-- @@ -37,7 +36,7 @@ Você deve retornar um elemento `nav`. assert.exists(document.querySelector('nav')); ``` -Seu elemento `nav` deve ter um atributo `className` com o valor `navbar`. +Seu elemento `nav` deve ter um `className` de `navbar`. ```js assert.equal(document.querySelector('nav')?.getAttribute('class'), 'navbar'); diff --git a/curriculum/challenges/portuguese/blocks/workshop-reusable-mega-navbar/6745c732dbeb7c04f346e6f7.md b/curriculum/challenges/portuguese/blocks/workshop-reusable-mega-navbar/6745c732dbeb7c04f346e6f7.md index f0555b48a6e..0f28ff2ee7f 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-reusable-mega-navbar/6745c732dbeb7c04f346e6f7.md +++ b/curriculum/challenges/portuguese/blocks/workshop-reusable-mega-navbar/6745c732dbeb7c04f346e6f7.md @@ -7,7 +7,7 @@ dashedName: step-3 # --description-- -Crie um elemento `ul` dentro do elemento `nav`. Dentro desse elemento `ul`, crie três itens de lista. +Crie um elemento `ul` dentro do seu elemento `nav`. Dentro desse elemento `ul`, crie três elementos `li`. # --hints-- diff --git a/curriculum/challenges/portuguese/blocks/workshop-reusable-mega-navbar/6745c89fba004707ded84453.md b/curriculum/challenges/portuguese/blocks/workshop-reusable-mega-navbar/6745c89fba004707ded84453.md index c8fb67076ae..771e94657d7 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-reusable-mega-navbar/6745c89fba004707ded84453.md +++ b/curriculum/challenges/portuguese/blocks/workshop-reusable-mega-navbar/6745c89fba004707ded84453.md @@ -7,17 +7,17 @@ dashedName: step-5 # --description-- -Crie um elemento anchor dentro do primeiro elemento `li`. Dê ao elemento `a` um atributo `href` com o valor `#` e o texto `Dashboard`. +Crie um elemento `a` dentro do seu primeiro elemento `li`. Dê a ele um atributo `href` com o valor `#` e o texto `Dashboard`. # --hints-- -Você deve criar um elemento `a` dentro do primeiro item da lista. +Você deve criar um elemento `a` dentro do seu primeiro elemento `li`. ```js assert.exists(document.querySelector('li a')); ``` -Seu elemento `a` deve ter seu atributo `href` definido como `#`. +Seu elemento `a` deve ter um atributo `href` com o valor `#`. ```js assert.equal(document.querySelector('a')?.getAttribute('href'), '#'); diff --git a/curriculum/challenges/portuguese/blocks/workshop-reusable-mega-navbar/6745cebbf97ef2129f3b9bab.md b/curriculum/challenges/portuguese/blocks/workshop-reusable-mega-navbar/6745cebbf97ef2129f3b9bab.md index 4e80db222a1..5d587312450 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-reusable-mega-navbar/6745cebbf97ef2129f3b9bab.md +++ b/curriculum/challenges/portuguese/blocks/workshop-reusable-mega-navbar/6745cebbf97ef2129f3b9bab.md @@ -7,17 +7,17 @@ dashedName: step-6 # --description-- -Crie outro elemento `a` dentro do segundo elemento `li`. Dê a ele um atributo `href` com valor `#` e o texto `Widgets`. +Crie outro elemento `a` dentro do seu segundo elemento `li`. Dê a ele um atributo `href` com o valor `#` e o texto `Widgets`. # --hints-- -Você deve criar um elemento `a` dentro do segundo item da lista. +Você deve criar um elemento `a` dentro do seu segundo elemento `li`. ```js assert.lengthOf(document.querySelectorAll('li a'), 2); ``` -Seu elemento `a` deve ter seu atributo `href` definido como `#`. +Seu elemento `a` deve ter um atributo `href` com o valor `#`. ```js assert.equal(document.querySelectorAll('a')[1]?.getAttribute('href'), '#'); diff --git a/curriculum/challenges/portuguese/blocks/workshop-reusable-mega-navbar/6745d799beeb822076a4da9d.md b/curriculum/challenges/portuguese/blocks/workshop-reusable-mega-navbar/6745d799beeb822076a4da9d.md index 7293346f62e..13ed8ecea38 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-reusable-mega-navbar/6745d799beeb822076a4da9d.md +++ b/curriculum/challenges/portuguese/blocks/workshop-reusable-mega-navbar/6745d799beeb822076a4da9d.md @@ -7,19 +7,19 @@ dashedName: step-7 # --description-- -Dentro do terceiro item da lista, crie um elemento `button` com um atributo `aria-expanded` definido como `false`. Além disso, defina o texto do `button` para `Apps`. +Dentro do seu terceiro elemento `li`, crie um elemento `button` com um atributo `aria-expanded` com valor `false`. Além disso, defina o texto do `button` como `Apps`. O atributo `aria-expanded` comunicará aos usuários de leitores de tela que o botão aciona um submenu expansível. # --hints-- -Você deve criar um elemento `button` dentro do terceiro item da lista. +Você deve criar um elemento `button` dentro do seu terceiro elemento `li`. ```js assert.exists(document.querySelector('li:nth-of-type(3) button')); ``` -Seu elemento `button` deve ter um atributo `aria-expanded` definido como `false`. +Seu elemento `button` deve ter um atributo `aria-expanded` com valor `false`. ```js assert.equal( diff --git a/curriculum/challenges/portuguese/blocks/workshop-reusable-mega-navbar/6745d9df333efe2543a1f457.md b/curriculum/challenges/portuguese/blocks/workshop-reusable-mega-navbar/6745d9df333efe2543a1f457.md index 81aaed178c0..e0a071afcee 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-reusable-mega-navbar/6745d9df333efe2543a1f457.md +++ b/curriculum/challenges/portuguese/blocks/workshop-reusable-mega-navbar/6745d9df333efe2543a1f457.md @@ -7,7 +7,7 @@ dashedName: step-8 # --description-- -Ainda dentro do terceiro elemento `li`, crie um elemento `ul` para o popup. Dê a ele um `className` de `sub-menu` e um `aria-label` de `Apps`. +Ainda dentro do seu terceiro `li` elemento, crie um `ul` elemento para o popup. Dê a ele um `className` de `sub-menu` e um `aria-label` de `Apps`. # --hints-- @@ -17,13 +17,13 @@ Você deve criar um elemento `ul` dentro do seu terceiro elemento `li`. assert.exists(document.querySelector('li ul')); ``` -Você deve definir o atributo `className` do seu elemento `ul` para `sub-menu`. +Seu `ul` elemento deve ter um `className` de `sub-menu`. ```js assert.equal(document.querySelector('li ul')?.getAttribute('class'), 'sub-menu'); ``` -Você deve definir o atributo `aria-label` do seu elemento `ul` para `Apps`. +Seu `ul` elemento deve ter um `aria-label` de `Apps`. ```js assert.equal(document.querySelector('li ul')?.getAttribute('aria-label'), 'Apps'); diff --git a/curriculum/challenges/portuguese/blocks/workshop-reusable-mega-navbar/6745dce846995b2a466594be.md b/curriculum/challenges/portuguese/blocks/workshop-reusable-mega-navbar/6745dce846995b2a466594be.md index 30f33b65573..292f76cbc04 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-reusable-mega-navbar/6745dce846995b2a466594be.md +++ b/curriculum/challenges/portuguese/blocks/workshop-reusable-mega-navbar/6745dce846995b2a466594be.md @@ -7,11 +7,11 @@ dashedName: step-9 # --description-- -Crie três novos itens de lista dentro do seu elemento `ul.sub-menu`. +Crie três novos elementos `li` dentro do seu elemento `ul` com um `className` de `sub-menu`. # --hints-- -Você deve criar três novos itens de lista dentro do seu elemento `ul` com o `className` de `sub-menu`. +Você deve criar três novos elementos `li` dentro do seu elemento `ul` com um `className` de `sub-menu`. ```js assert.lengthOf(document.querySelectorAll('.sub-menu li'), 3); diff --git a/curriculum/challenges/portuguese/blocks/workshop-reusable-mega-navbar/6745de9ce925b92d72df713a.md b/curriculum/challenges/portuguese/blocks/workshop-reusable-mega-navbar/6745de9ce925b92d72df713a.md index 96ba83277a7..760e57becd9 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-reusable-mega-navbar/6745de9ce925b92d72df713a.md +++ b/curriculum/challenges/portuguese/blocks/workshop-reusable-mega-navbar/6745de9ce925b92d72df713a.md @@ -7,11 +7,11 @@ dashedName: step-10 # --description-- -Dentro de cada elemento `li`, crie um elemento anchor com um atributo `href` definido como `#`. +Dentro de cada um dos três novos elementos `li`, crie um elemento `a` com um atributo `href` igual a `#`. # --hints-- -Você deve criar um novo elemento `a` dentro de cada item da lista e definir seu atributo `href` para `#`. +Você deve criar um novo elemento `a` com um atributo `href` igual a `#` dentro de cada um dos três novos elementos `li`. ```js assert.equal(document.querySelectorAll('li a')[2]?.getAttribute('href'), '#'); diff --git a/curriculum/challenges/portuguese/blocks/workshop-reusable-mega-navbar/6745e2aca895c935168e7d91.md b/curriculum/challenges/portuguese/blocks/workshop-reusable-mega-navbar/6745e2aca895c935168e7d91.md index 2e48def5302..7baa29ad04c 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-reusable-mega-navbar/6745e2aca895c935168e7d91.md +++ b/curriculum/challenges/portuguese/blocks/workshop-reusable-mega-navbar/6745e2aca895c935168e7d91.md @@ -7,25 +7,25 @@ dashedName: step-11 # --description-- -Para finalizar, defina um texto `Calendar` para a primeira tag anchor, `Chat` para a segunda e `Email` para a terceira. +Para finalizar, defina o texto do primeiro elemento `a` como `Calendar`, o segundo como `Chat` e o terceiro como `Email`. -Com isso, seu componente mega navbar está completo! +Com isso, seu componente `Navbar` está completo! # --hints-- -Você deve definir um texto de `Calendar` para o primeiro elemento anchor. +Você deve definir o texto do primeiro elemento `a` como `Calendar`. ```js assert.equal(document.querySelectorAll('li a')[2]?.textContent, 'Calendar'); ``` -Você deve definir um texto de `Chat` para o segundo elemento anchor. +Você deve definir o texto do segundo elemento `a` como `Chat`. ```js assert.equal(document.querySelectorAll('li a')[3]?.textContent, 'Chat'); ``` -Você deve definir um texto de `Email` para o terceiro elemento anchor. +Você deve definir o texto do terceiro elemento `a` como `Email`. ```js assert.equal(document.querySelectorAll('li a')[4]?.textContent, 'Email'); diff --git a/curriculum/challenges/portuguese/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165b.md b/curriculum/challenges/portuguese/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165b.md index 54a0186f0f0..1ab0ec3df31 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165b.md +++ b/curriculum/challenges/portuguese/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165b.md @@ -7,7 +7,7 @@ dashedName: step-5 # --description-- -Dentro da sua declaração de retorno, substitua a string vazia por um elemento `div` com uma propriedade `className` de `flex-container`. +Dentro da declaração `return`, substitua a string vazia por um elemento `div` com um `className` de `flex-container`. # --hints-- @@ -26,7 +26,7 @@ Seu componente `App` deve retornar um único elemento `div`. assert.lengthOf(testElem.children, 1); ``` -Seu `div` deve ter uma propriedade `className` com o valor `flex-container`. +Seu `div` deve ter um `className` de `flex-container`. ```js const testElem = await __helpers.prepTestComponent(window.index.App); diff --git a/curriculum/challenges/portuguese/blocks/workshop-reusable-profile-card-component/68720c179cd34be6793bfdf6.md b/curriculum/challenges/portuguese/blocks/workshop-reusable-profile-card-component/68720c179cd34be6793bfdf6.md index 1de0b0653b4..30de31d5693 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-reusable-profile-card-component/68720c179cd34be6793bfdf6.md +++ b/curriculum/challenges/portuguese/blocks/workshop-reusable-profile-card-component/68720c179cd34be6793bfdf6.md @@ -9,7 +9,7 @@ dashedName: step-8 Embora sua aplicação funcione como esperado, normalmente você não adicionaria vários componentes `Card` manualmente assim. -Remova os três componentes `` dentro do elemento `
`. Nos próximos passos, você criará um array de dados e usará a função `map()` para renderizar os componentes `Card` que é a abordagem mais comum no React. +Remova os três componentes `` dentro do elemento `
`. Nos próximos passos, você vai criar um array de dados e usar o método `map()` para renderizar os componentes `Card`, que é a abordagem mais comum no React. # --hints-- diff --git a/curriculum/challenges/portuguese/blocks/workshop-reusable-profile-card-component/68778af56eb5d980a4e2daed.md b/curriculum/challenges/portuguese/blocks/workshop-reusable-profile-card-component/68778af56eb5d980a4e2daed.md index 147c75096c6..616dde63791 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-reusable-profile-card-component/68778af56eb5d980a4e2daed.md +++ b/curriculum/challenges/portuguese/blocks/workshop-reusable-profile-card-component/68778af56eb5d980a4e2daed.md @@ -30,7 +30,7 @@ const profilesVal = eval(profiles?.value.toString()); assert.isArray(profilesVal); ``` -Seu array de profiles deve conter um objeto que inclua todas as propriedades necessárias: `id`, `name`, `title` e `bio`. +Seu array `profiles` deve conter um objeto que inclua todas as props necessárias: `id`, `name`, `title` e `bio`. ```js const explorer = await __helpers.Explorer(code); diff --git a/curriculum/challenges/portuguese/blocks/workshop-reusable-profile-card-component/68779156bd3704b727ba5f38.md b/curriculum/challenges/portuguese/blocks/workshop-reusable-profile-card-component/68779156bd3704b727ba5f38.md index 11824933a7d..e546080c1cc 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-reusable-profile-card-component/68779156bd3704b727ba5f38.md +++ b/curriculum/challenges/portuguese/blocks/workshop-reusable-profile-card-component/68779156bd3704b727ba5f38.md @@ -7,7 +7,7 @@ dashedName: step-10 # --description-- -Como você se lembra das lições anteriores, você pode usar o método `map` para iterar pelos diferentes objetos e renderizar os componentes dinamicamente assim: +Como você lembra das lições anteriores, pode usar o método `map()` para iterar através dos diferentes objetos e renderizar os componentes dinamicamente assim: ```jsx export function App() { diff --git a/curriculum/challenges/portuguese/blocks/workshop-toggle-text-app/67cd46ec4ec904186ad52ba5.md b/curriculum/challenges/portuguese/blocks/workshop-toggle-text-app/67cd46ec4ec904186ad52ba5.md index 84a749f3c8b..aeff3c8e867 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-toggle-text-app/67cd46ec4ec904186ad52ba5.md +++ b/curriculum/challenges/portuguese/blocks/workshop-toggle-text-app/67cd46ec4ec904186ad52ba5.md @@ -7,7 +7,7 @@ dashedName: step-3 # --description-- -Abaixo do seu elemento `button`, adicione um elemento de parágrafo com um `id` de `message` e o texto `I love freeCodeCamp!`. +Abaixo do seu elemento `button`, adicione um elemento de parágrafo com um `id` chamado `message` e o texto `I love freeCodeCamp!`. # --hints-- @@ -17,7 +17,7 @@ Você deve ter um elemento de parágrafo. assert.exists(document.querySelector("p")); ``` -Seu elemento de parágrafo deve ter um `id` de `message`. +Seu elemento de parágrafo deve ter um `id` chamado `message`. ```js assert.exists(document.getElementById("message")) diff --git a/curriculum/challenges/portuguese/blocks/workshop-toggle-text-app/67cd49e05693111a41771f29.md b/curriculum/challenges/portuguese/blocks/workshop-toggle-text-app/67cd49e05693111a41771f29.md index 8afcf5c20f7..dbf3bea5444 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-toggle-text-app/67cd49e05693111a41771f29.md +++ b/curriculum/challenges/portuguese/blocks/workshop-toggle-text-app/67cd49e05693111a41771f29.md @@ -19,7 +19,7 @@ A convenção para nomear variáveis de estado é usar o formato `example` e `se Crie uma nova variável de estado e função de definição chamadas `isVisible` e `setIsVisible`. Lembre-se de usar a sintaxe de desestruturação de array conforme mostrado no exemplo. -Então atribua o hook `useState` com um valor inicial de `false`. +Depois, faça a chamada do hook `useState` com um valor inicial de `false`. # --hints-- diff --git a/curriculum/challenges/portuguese/blocks/workshop-toggle-text-app/67cd4fe67813f71c3479e64a.md b/curriculum/challenges/portuguese/blocks/workshop-toggle-text-app/67cd4fe67813f71c3479e64a.md index 53ba9e266b2..6764bb55b32 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-toggle-text-app/67cd4fe67813f71c3479e64a.md +++ b/curriculum/challenges/portuguese/blocks/workshop-toggle-text-app/67cd4fe67813f71c3479e64a.md @@ -9,7 +9,7 @@ dashedName: step-6 Uma maneira de exibir o texto do parágrafo é alterar o valor inicial do hook `useState`. -Altere o valor atual de `useState` de `false` para `true` e você verá que o texto do parágrafo agora está sendo exibido na tela. +Altere o valor inicial do `useState` de `false` para `true`. Quando feito corretamente, você verá que o texto do parágrafo está agora sendo exibido na tela. # --hints-- diff --git a/curriculum/challenges/portuguese/blocks/workshop-toggle-text-app/67cd525b0e575b1e5abf4c03.md b/curriculum/challenges/portuguese/blocks/workshop-toggle-text-app/67cd525b0e575b1e5abf4c03.md index 56df2d237b6..d5c53afc69f 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-toggle-text-app/67cd525b0e575b1e5abf4c03.md +++ b/curriculum/challenges/portuguese/blocks/workshop-toggle-text-app/67cd525b0e575b1e5abf4c03.md @@ -7,7 +7,7 @@ dashedName: step-9 # --description-- -Como mencionado anteriormente, a função set é responsável por atualizar o estado. Uma abordagem comum ao alternar entre valores booleanos de estado é atualizar o estado desta forma: +Como mencionado anteriormente, a função set é responsável por atualizar o estado. Uma abordagem comum ao alternar entre valores booleanos do estado é atualizar o estado desta forma: ```js const [isUserLoggedIn, setIsUserLoggedIn] = useState(false); @@ -16,7 +16,7 @@ const [isUserLoggedIn, setIsUserLoggedIn] = useState(false); setIsUserLoggedIn(!isUserLoggedIn); ``` -O exemplo a seguir está usando a função set chamada `setIsUserLoggedIn` para atualizar o status de login do usuário. É prática comum usar o operador lógico NOT (`!`) para alternar entre `true` e `false`. Como o valor inicial é `false`, aplicar o operador `!` irá alterá-lo para `true`. +O exemplo acima está usando a função set chamada `setIsUserLoggedIn` para atualizar o status de login do usuário. É prática comum usar o operador lógico NOT (`!`) para alternar entre `true` e `false`. Como o valor inicial é `false`, aplicar o operador `!` vai mudá-lo para `true`. Dentro da função `handleToggleVisibility`, use `setIsVisible` para atualizar o estado de visibilidade usando o operador lógico NOT (`!`). diff --git a/curriculum/challenges/portuguese/blocks/workshop-toggle-text-app/67cd57e96257ed1fabbe4879.md b/curriculum/challenges/portuguese/blocks/workshop-toggle-text-app/67cd57e96257ed1fabbe4879.md index 264e9505a95..2c1edeae96d 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-toggle-text-app/67cd57e96257ed1fabbe4879.md +++ b/curriculum/challenges/portuguese/blocks/workshop-toggle-text-app/67cd57e96257ed1fabbe4879.md @@ -27,7 +27,7 @@ Agora, quando você clicar no botão, verá a visibilidade do texto do parágraf # --hints-- -Quando o `toggle-button` for clicado, a mensagem `"I love freeCodeCamp!"` deve aparecer na tela. +Sua mensagem `I love freeCodeCamp!` deve aparecer na tela quando o `toggle-button` for clicado. ```js const abuseState = __helpers.spyOn(React, "useState"); diff --git a/curriculum/challenges/portuguese/blocks/workshop-toggle-text-app/67cd59f6581d3a20c9cc6460.md b/curriculum/challenges/portuguese/blocks/workshop-toggle-text-app/67cd59f6581d3a20c9cc6460.md index ae1922d5517..e9e07ce5441 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-toggle-text-app/67cd59f6581d3a20c9cc6460.md +++ b/curriculum/challenges/portuguese/blocks/workshop-toggle-text-app/67cd59f6581d3a20c9cc6460.md @@ -9,7 +9,7 @@ dashedName: step-11 Agora seria um bom momento para ver o valor atualizado de `isVisible`. -Abaixo do `setIsVisible(!isVisible);`, registre a variável de estado `isVisible` no console. +Abaixo de `setIsVisible(!isVisible);`, registre a variável de estado `isVisible` no console. Abra o console e você notará que o valor não é o que você esperava. diff --git a/curriculum/challenges/portuguese/blocks/workshop-toggle-text-app/67cd5bace629fa219a70aa6d.md b/curriculum/challenges/portuguese/blocks/workshop-toggle-text-app/67cd5bace629fa219a70aa6d.md index f556d42aa03..95a2b871dea 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-toggle-text-app/67cd5bace629fa219a70aa6d.md +++ b/curriculum/challenges/portuguese/blocks/workshop-toggle-text-app/67cd5bace629fa219a70aa6d.md @@ -9,7 +9,7 @@ dashedName: step-12 Se você olhou para o console, pode ter se surpreendido ao ver o valor `false` em vez de `true`. Isso está acontecendo porque o React não atualiza o estado imediatamente. O estado será atualizado apenas no próximo ciclo de renderização. -É um erro comum para desenvolvedores novos em React colocar declarações de console logo após uma função set. Então isso é algo para estar ciente quando você estiver construindo suas aplicações React. +É um erro comum para desenvolvedores novos em React colocar declarações no console logo após uma função set. Então, isso é algo para ficar atento enquanto você desenvolve suas aplicações React. Como o `console.log()` não é mais necessário, remova-o da sua função `handleToggleVisibility`. diff --git a/curriculum/challenges/portuguese/blocks/workshop-toggle-text-app/67cd61c24bfc0a240132fd2f.md b/curriculum/challenges/portuguese/blocks/workshop-toggle-text-app/67cd61c24bfc0a240132fd2f.md index 1c04ed349ee..6e6100687fe 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-toggle-text-app/67cd61c24bfc0a240132fd2f.md +++ b/curriculum/challenges/portuguese/blocks/workshop-toggle-text-app/67cd61c24bfc0a240132fd2f.md @@ -23,14 +23,14 @@ E com essa última alteração, seu workshop está completo! Teste seu botão pa # --hints-- -Quando `isVisible` é `false`, o texto do botão deve dizer `Show Message`. +O texto do seu botão deve dizer `Show Message` quando `isVisible` for `false`. ```js const btn = document.getElementById("toggle-button"); assert.equal(btn.textContent, "Show Message"); ``` -Quando `isVisible` é `true`, o texto do botão deve dizer `Hide Message`. +O texto do seu botão deve dizer `Hide Message` quando `isVisible` for `true`. ```js const abuseState = __helpers.spyOn(React, "useState"); @@ -246,7 +246,7 @@ export const ToggleApp = () => { const handleToggleVisibility = () => { setIsVisible(!isVisible); - } + }; return (
diff --git a/curriculum/challenges/portuguese/blocks/workshop-wildlife-tracker/6999ac171928136168654774.md b/curriculum/challenges/portuguese/blocks/workshop-wildlife-tracker/6999ac171928136168654774.md index f279217f4d5..1de34d66441 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-wildlife-tracker/6999ac171928136168654774.md +++ b/curriculum/challenges/portuguese/blocks/workshop-wildlife-tracker/6999ac171928136168654774.md @@ -42,8 +42,10 @@ assert.isFunction(getSpecies); A função `getSpecies` deve ter um único parâmetro, `animal`. ```js -const regex = __helpers.functionRegex('getSpecies', ['animal']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { getSpecies } = explorer.allFunctions; +assert.equal(getSpecies?.parameters.length, 1); +assert.equal(getSpecies?.parameters[0].toString(), 'animal'); ``` Você deve registrar `getSpecies(tiger)` no console. diff --git a/curriculum/challenges/portuguese/blocks/workshop-wildlife-tracker/6999ad1cdc249e185aaeedbd.md b/curriculum/challenges/portuguese/blocks/workshop-wildlife-tracker/6999ad1cdc249e185aaeedbd.md index 7fd45296bd2..bf9eb94d863 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-wildlife-tracker/6999ad1cdc249e185aaeedbd.md +++ b/curriculum/challenges/portuguese/blocks/workshop-wildlife-tracker/6999ad1cdc249e185aaeedbd.md @@ -49,8 +49,11 @@ assert.isFunction(addHabitat); A função `addHabitat` deve ter dois parâmetros: `animal` e `habitat`. ```js -const regex = __helpers.functionRegex('addHabitat', ['animal', 'habitat']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { addHabitat } = explorer.allFunctions; +assert.equal(addHabitat?.parameters.length, 2); +assert.equal(addHabitat?.parameters[0].toString(), 'animal'); +assert.equal(addHabitat?.parameters[1].toString(), 'habitat'); ``` A função `addHabitat` deve retornar o objeto `animal` atualizado. diff --git a/curriculum/challenges/portuguese/blocks/workshop-wildlife-tracker/6999adc72c02812a28c01e31.md b/curriculum/challenges/portuguese/blocks/workshop-wildlife-tracker/6999adc72c02812a28c01e31.md index 1d51f72d865..3a9206bb898 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-wildlife-tracker/6999adc72c02812a28c01e31.md +++ b/curriculum/challenges/portuguese/blocks/workshop-wildlife-tracker/6999adc72c02812a28c01e31.md @@ -43,8 +43,11 @@ assert.isFunction(updateAge); A função `updateAge` deve ter dois parâmetros: `animal` e `newAge`. ```js -const regex = __helpers.functionRegex('updateAge', ['animal', 'newAge']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { updateAge } = explorer.allFunctions; +assert.equal(updateAge?.parameters.length, 2); +assert.equal(updateAge?.parameters[0].toString(), 'animal'); +assert.equal(updateAge?.parameters[1].toString(), 'newAge'); ``` A função `updateAge` deve retornar o objeto `animal` atualizado. diff --git a/curriculum/challenges/portuguese/blocks/workshop-wildlife-tracker/6999b0198d18d402c36cc5fe.md b/curriculum/challenges/portuguese/blocks/workshop-wildlife-tracker/6999b0198d18d402c36cc5fe.md index 7c4258887d1..d2420701343 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-wildlife-tracker/6999b0198d18d402c36cc5fe.md +++ b/curriculum/challenges/portuguese/blocks/workshop-wildlife-tracker/6999b0198d18d402c36cc5fe.md @@ -45,8 +45,10 @@ assert.isFunction(removeEndangeredStatus); A função `removeEndangeredStatus` deve ter um único parâmetro, `animal`. ```js -const regex = __helpers.functionRegex('removeEndangeredStatus', ['animal']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { removeEndangeredStatus } = explorer.allFunctions; +assert.equal(removeEndangeredStatus?.parameters.length, 1); +assert.equal(removeEndangeredStatus?.parameters[0].toString(), 'animal'); ``` A função `removeEndangeredStatus` deve retornar o objeto `animal` atualizado. diff --git a/curriculum/challenges/portuguese/blocks/workshop-wildlife-tracker/6999b07c34c2cde21ee6e1d8.md b/curriculum/challenges/portuguese/blocks/workshop-wildlife-tracker/6999b07c34c2cde21ee6e1d8.md index 91b38f315c2..3fed7e54f28 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-wildlife-tracker/6999b07c34c2cde21ee6e1d8.md +++ b/curriculum/challenges/portuguese/blocks/workshop-wildlife-tracker/6999b07c34c2cde21ee6e1d8.md @@ -49,8 +49,10 @@ assert.isFunction(hasHabitat); A função `hasHabitat` deve ter um único parâmetro, `animal`. ```js -const regex = __helpers.functionRegex('hasHabitat', ['animal']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { hasHabitat } = explorer.allFunctions; +assert.equal(hasHabitat?.parameters.length, 1); +assert.equal(hasHabitat?.parameters[0].toString(), 'animal'); ``` `hasHabitat` deve usar o método `hasOwnProperty` para verificar a propriedade `habitat`. diff --git a/curriculum/challenges/portuguese/blocks/workshop-wildlife-tracker/6999b0d79ea938edcb032237.md b/curriculum/challenges/portuguese/blocks/workshop-wildlife-tracker/6999b0d79ea938edcb032237.md index c6c3ca1a649..f5a00d43023 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-wildlife-tracker/6999b0d79ea938edcb032237.md +++ b/curriculum/challenges/portuguese/blocks/workshop-wildlife-tracker/6999b0d79ea938edcb032237.md @@ -45,8 +45,11 @@ assert.isFunction(getProperty); A função `getProperty` deve ter dois parâmetros: `animal` e `propertyName`. ```js -const regex = __helpers.functionRegex('getProperty', ['animal', 'propertyName']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { getProperty } = explorer.allFunctions; +assert.equal(getProperty?.parameters.length, 2); +assert.equal(getProperty?.parameters[0].toString(), 'animal'); +assert.equal(getProperty?.parameters[1].toString(), 'propertyName'); ``` `getProperty` deve usar notação por colchetes para acessar a propriedade. diff --git a/curriculum/challenges/portuguese/blocks/workshop-wildlife-tracker/699a00de9f564bb0effaa14d.md b/curriculum/challenges/portuguese/blocks/workshop-wildlife-tracker/699a00de9f564bb0effaa14d.md index d4439fc345d..4f1bf6eeff6 100644 --- a/curriculum/challenges/portuguese/blocks/workshop-wildlife-tracker/699a00de9f564bb0effaa14d.md +++ b/curriculum/challenges/portuguese/blocks/workshop-wildlife-tracker/699a00de9f564bb0effaa14d.md @@ -44,8 +44,10 @@ assert.isFunction(getAge); A função `getAge` deve ter um único parâmetro, `animal`. ```js -const regex = __helpers.functionRegex('getAge', ['animal']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { getAge } = explorer.allFunctions; +assert.equal(getAge?.parameters.length, 1); +assert.equal(getAge?.parameters[0].toString(), 'animal'); ``` `getAge` deve acessar a propriedade `age` usando notação de ponto. diff --git a/curriculum/challenges/swahili/blocks/back-end-development-and-apis-projects/bd7158d8c443edefaeb5bd0f.md b/curriculum/challenges/swahili/blocks/back-end-development-and-apis-projects/bd7158d8c443edefaeb5bd0f.md index f3c74630b3e..6841d8ce4df 100644 --- a/curriculum/challenges/swahili/blocks/back-end-development-and-apis-projects/bd7158d8c443edefaeb5bd0f.md +++ b/curriculum/challenges/swahili/blocks/back-end-development-and-apis-projects/bd7158d8c443edefaeb5bd0f.md @@ -50,18 +50,22 @@ Sehemu ya ingizo ya faili kwenye fomu ina sifa ya kipengele ya `name` iliyowekwa Unapowasilisha faili, unapata metadata ya faili `name`, `type`, na `size` kwa baiti ndani ya jibu la JSON. ```js - const formData = new FormData(); - const fileData = await fetch( - 'https://cdn.freecodecamp.org/weather-icons/01d.png' - ); - const file = await fileData.blob(); - formData.append('upfile', file, 'icon'); + const boundary = 'fccBoundary1234567890'; + const head = + `--${boundary}\r\n` + + 'Content-Disposition: form-data; name="upfile"; filename="icon"\r\n' + + 'Content-Type: image/png\r\n\r\n'; + const body = new Blob([head, new Uint8Array(70), `\r\n--${boundary}--\r\n`]); const data = await fetch(code + '/api/fileanalyse', { method: 'POST', - body: formData + headers: { + 'Content-Type': `multipart/form-data; boundary=${boundary}` + }, + body }); const parsed = await data.json(); assert.property(parsed, 'size'); assert.equal(parsed.name, 'icon'); assert.equal(parsed.type, 'image/png'); ``` + diff --git a/curriculum/challenges/swahili/blocks/daily-coding-challenges-javascript/6a26df3e2988bcdded204895.md b/curriculum/challenges/swahili/blocks/daily-coding-challenges-javascript/6a26df3e2988bcdded204895.md index b0bbecf8ac3..812c6ccbdae 100644 --- a/curriculum/challenges/swahili/blocks/daily-coding-challenges-javascript/6a26df3e2988bcdded204895.md +++ b/curriculum/challenges/swahili/blocks/daily-coding-challenges-javascript/6a26df3e2988bcdded204895.md @@ -25,10 +25,10 @@ assert.equal(calculateHandicap([72, 72, 72], [72, 72, 72]), 0); assert.equal(calculateHandicap([80, 76, 78, 78], [72, 72, 72, 72]), 6); ``` -`calculateHandicap([42, 45, 46, 44], [36, 36, 36, 36])` inapaswa kurudisha `8.3`. +`calculateHandicap([42, 45, 46, 45], [36, 36, 36, 36])` inapaswa kurudisha `8.5`. ```js -assert.equal(calculateHandicap([42, 45, 46, 44], [36, 36, 36, 36]), 8.3); +assert.equal(calculateHandicap([42, 45, 46, 45], [36, 36, 36, 36]), 8.5); ``` `calculateHandicap([85, 80, 76, 79, 82], [72, 72, 72, 71, 71])` inapaswa kurudisha `8.8`. diff --git a/curriculum/challenges/swahili/blocks/daily-coding-challenges-python/6a26df3e2988bcdded204895.md b/curriculum/challenges/swahili/blocks/daily-coding-challenges-python/6a26df3e2988bcdded204895.md index 06bff87701b..8536d0cb795 100644 --- a/curriculum/challenges/swahili/blocks/daily-coding-challenges-python/6a26df3e2988bcdded204895.md +++ b/curriculum/challenges/swahili/blocks/daily-coding-challenges-python/6a26df3e2988bcdded204895.md @@ -31,12 +31,12 @@ TestCase().assertEqual(calculate_handicap([80, 76, 78, 78], [72, 72, 72, 72]), 6 }}) ``` -`calculate_handicap([42, 45, 46, 44], [36, 36, 36, 36])` inapaswa kurudisha `8.3`. +`calculate_handicap([42, 45, 46, 45], [36, 36, 36, 36])` inapaswa kurudisha `8.5`. ```js ({test: () => { runPython(` from unittest import TestCase -TestCase().assertEqual(calculate_handicap([42, 45, 46, 44], [36, 36, 36, 36]), 8.3)`) +TestCase().assertEqual(calculate_handicap([42, 45, 46, 45], [36, 36, 36, 36]), 8.5)`) }}) ``` diff --git a/curriculum/challenges/swahili/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb928.md b/curriculum/challenges/swahili/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb928.md index 8cdbe998d40..35d81c2d2b0 100644 --- a/curriculum/challenges/swahili/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb928.md +++ b/curriculum/challenges/swahili/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb928.md @@ -8,11 +8,11 @@ dashedName: mean-variance-standard-deviation-calculator # --description-- -Utafanya kazi kwenye mradi huu kwa kutumia msimbo wa kuanzia wa Ona. +Utafanya kazi kwenye mradi huu kwa kutumia msimbo wetu wa msingi. -Bado tunauendeleza sehemu ya mafunzo ya kuingiliana ya mtaala wa Python. Kwa sasa, hapa kuna video kadhaa kwenye kituo cha YouTube cha freeCodeCamp.org zitakazokufundisha kila unachohitaji kujua ili kukamilisha mradi huu: +Bado tunaunda sehemu ya mafunzo ya kuingiliana ya mtaala wa Python. Kwa sasa, hapa kuna video kadhaa kwenye kituo cha YouTube cha freeCodeCamp.org zitakazokufundisha kila kitu unachohitaji kujua ili kumaliza mradi huu: -- Kozi ya video ya Python kwa kila mtu (masaa 14) +- Kozi ya video ya Python kwa kila mtu (saa 14) - Jinsi ya Kuchambua Data kwa Python Pandas (masaa 10) @@ -52,19 +52,20 @@ Kwa mfano, `calculate([0,1,2,3,4,5,6,7,8])` inapaswa kurudisha: ## Ukuzaji -Andika msimbo wako katika `mean_var_std.py`. Kwa ajili ya ukuzaji, unaweza kutumia `main.py` kujaribu msimbo wako. Ili kuendesha msimbo wako, andika `python3 main.py` kwenye terminal ya Ona kisha bonyeza enter. Hii itasababisha tafsiri ya CPython iliyojumuishwa kuendesha faili la `main.py`. +Andika msimbo wako katika `mean_var_std.py`. Kwa ajili ya ukuzaji, unaweza kutumia `main.py` kupima msimbo wako. +Ili kuendesha msimbo wako, andika `python3 main.py` kwenye terminali kisha bonyeza enter. Hii itasababisha tafsiri ya CPython iliyojumuishwa kuendesha faili la `main.py`. -## Upimaji +## Uhakiki Majaribio ya kitengo kwa mradi huu yako katika `test_module.py`. Tulileta majaribio kutoka `test_module.py` hadi `main.py` kwa urahisi wako. ## Kuwasilisha -Nakili URL ya mradi wako na uwasilishe kwenye freeCodeCamp. +Nakili URL ya mradi wako na uwasilishe kwa freeCodeCamp. # --hints-- -Inapaswa kupita majaribio yote ya Python. +Inapaswa kupita mitihani yote ya Python. ```js diff --git a/curriculum/challenges/swahili/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb929.md b/curriculum/challenges/swahili/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb929.md index 2ff6f0a263a..b975b75c78a 100644 --- a/curriculum/challenges/swahili/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb929.md +++ b/curriculum/challenges/swahili/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb929.md @@ -8,13 +8,13 @@ dashedName: demographic-data-analyzer # --description-- -Utafanya kazi kwenye mradi huu kwa kutumia msimbo wa msingi wa Ona. +Utafanya kazi kwenye mradi huu kwa kutumia muundo wetu wa msingi wa msimbo. -Bado tunauendeleza sehemu ya mafunzo ya mwingiliano ya mtaala wa Python. Kwa sasa, hapa kuna video kadhaa kwenye kituo cha YouTube cha freeCodeCamp.org zitakazokufundisha kila unachohitaji kujua ili kukamilisha mradi huu: +Bado tunaunda sehemu ya mafunzo ya kuingiliana ya mtaala wa Python. Kwa sasa, hapa kuna video kadhaa kwenye kituo cha YouTube cha freeCodeCamp.org zitakazokufundisha kila kitu unachohitaji kujua ili kumaliza mradi huu: -- Kozi ya video ya Python kwa kila mtu (masaa 14) +- Kozi ya video ya Python kwa kila mtu (saa 14) -- Jinsi ya Kuchambua Takwimu kwa Python Pandas (masaa 10) +- Jinsi ya Kuchambua Data kwa Python Pandas (masaa 10) # --instructions-- @@ -54,7 +54,7 @@ Majaribio ya kitengo kwa mradi huu yako katika `test_module.py`. Tulileta majari ## Kuwasilisha -Nakili URL ya mradi wako na uwasilishe kwenye freeCodeCamp. +Nakili URL ya mradi wako na uwasilishe kwa freeCodeCamp. ## Chanzo cha seti ya takwimu @@ -62,7 +62,7 @@ Dua, D. na Graff, C. (2019). mradi huu kwa kutumia msimbo wa msingi wa Ona. +Utafanya kazi kwenye mradi huu kwa kutumia muundo wetu wa msingi wa msimbo. -Bado tunauendeleza sehemu ya mafunzo ya kuingiliana ya mtaala wa Python. Kwa sasa, hapa kuna video kwenye kituo cha YouTube cha freeCodeCamp.org zitakazokufundisha kila unachohitaji kujua ili kukamilisha mradi huu: +Bado tunaunda sehemu ya mafunzo ya kuingiliana ya mtaala wa Python. Kwa sasa, hapa kuna video kadhaa kwenye kituo cha YouTube cha freeCodeCamp.org zitakazokufundisha kila kitu unachohitaji kujua ili kumaliza mradi huu: - Kozi ya video ya Python kwa kila mtu (saa 14) -- Jinsi ya kuchambua data kwa Python Pandas (saa 10) +- Jinsi ya Kuchambua Data kwa Python Pandas (masaa 10) # --instructions-- @@ -84,7 +84,7 @@ Nakili URL ya mradi wako na uwasilishe kwa freeCodeCamp. # --hints-- -Inapaswa kupita majaribio yote ya Python. +Inapaswa kupita mitihani yote ya Python. ```js diff --git a/curriculum/challenges/swahili/blocks/data-analysis-with-python-projects/5e46f802ac417301a38fb92b.md b/curriculum/challenges/swahili/blocks/data-analysis-with-python-projects/5e46f802ac417301a38fb92b.md index 977c644ec18..00e84c59919 100644 --- a/curriculum/challenges/swahili/blocks/data-analysis-with-python-projects/5e46f802ac417301a38fb92b.md +++ b/curriculum/challenges/swahili/blocks/data-analysis-with-python-projects/5e46f802ac417301a38fb92b.md @@ -8,19 +8,19 @@ dashedName: page-view-time-series-visualizer # --description-- -Utafanya kazi kwenye mradi huu kwa kutumia msimbo wa msingi wa Ona. +Utafanya kazi kwenye mradi huu kwa kutumia msimbo wetu wa msingi. -Bado tunauendeleza sehemu ya mafunzo ya mwingiliano ya mtaala wa Python. Kwa sasa, hapa kuna video kadhaa kwenye kituo cha YouTube cha freeCodeCamp.org zitakazokufundisha kila unachohitaji kujua ili kukamilisha mradi huu: +Bado tunaunda sehemu ya mafunzo ya kuingiliana ya mtaala wa Python. Kwa sasa, hapa kuna video kadhaa kwenye kituo cha YouTube cha freeCodeCamp.org zitakazokufundisha kila kitu unachohitaji kujua ili kumaliza mradi huu: -- Kozi ya video ya Python kwa kila mtu (masaa 14) +- Kozi ya video ya Python kwa kila mtu (saa 14) -- Jinsi ya kuchambua data kwa Python Pandas (masaa 10) +- Jinsi ya Kuchambua Data kwa Python Pandas (masaa 10) # --instructions-- Kwa mradi huu utaonyesha mfululizo wa data za muda kwa kutumia chati ya mstari, chati ya mstari, na michoro ya boksi. Uta tumia Pandas, Matplotlib, na Seaborn kuonyesha seti ya data inayojumuisha idadi ya maoni ya ukurasa kila siku kwenye jukwaa la freeCodeCamp.org kuanzia 2016-05-09 hadi 2019-12-03. Uwakilishi wa data kwa picha utakusaidia kuelewa mifumo ya ziara na kubaini ukuaji wa kila mwaka na kila mwezi. -Tumia data kukamilisha mazoezi yafuatayo: +Tumia data kukamilisha zifuatazo: - Tumia Pandas kuleta data kutoka "fcc-forum-pageviews.csv". Weka kielezo kwenye safu ya `date`. - Safisha data kwa kuchuja siku ambazo maoni ya ukurasa yalikuwa katika asilimia 2.5 za juu au asilimia 2.5 za chini ya seti ya data. @@ -46,7 +46,7 @@ Nakili URL ya mradi wako na uwasilishe kwa freeCodeCamp. # --hints-- -Inapaswa kupita majaribio yote ya Python. +Inapaswa kupita mitihani yote ya Python. ```js diff --git a/curriculum/challenges/swahili/blocks/data-analysis-with-python-projects/5e4f5c4b570f7e3a4949899f.md b/curriculum/challenges/swahili/blocks/data-analysis-with-python-projects/5e4f5c4b570f7e3a4949899f.md index adfce7de60e..4d4bc821367 100644 --- a/curriculum/challenges/swahili/blocks/data-analysis-with-python-projects/5e4f5c4b570f7e3a4949899f.md +++ b/curriculum/challenges/swahili/blocks/data-analysis-with-python-projects/5e4f5c4b570f7e3a4949899f.md @@ -8,11 +8,11 @@ dashedName: sea-level-predictor # --description-- -Utafanya kazi kwenye mradi huu kwa kutumia msimbo wa msingi wa Ona. +Utafanya kazi kwenye mradi huu kwa kutumia msimbo wetu wa msingi. -Bado tunaendelea na sehemu ya mafunzo ya mwingiliano katika mtaala wa Python. Kwa sasa, hapa kuna video kadhaa kwenye kituo cha YouTube cha freeCodeCamp.org zitakazokufundisha kila kitu unachohitaji kujua ili kukamilisha mradi huu: +Bado tunaunda sehemu ya mafunzo ya kuingiliana ya mtaala wa Python. Kwa sasa, hapa kuna video kadhaa kwenye kituo cha YouTube cha freeCodeCamp.org zitakazokufundisha kila kitu unachohitaji kujua ili kumaliza mradi huu: -- Kozi ya Video ya Python kwa Wote (masaa 14) +- Kozi ya video ya Python kwa kila mtu (saa 14) - Jinsi ya Kuchambua Data kwa Python Pandas (masaa 10) @@ -48,7 +48,7 @@ Nakili URL ya mradi wako na uwasilishe kwa freeCodeCamp. # --hints-- -Inapaswa kupita majaribio yote ya Python. +Inapaswa kupita mitihani yote ya Python. ```js diff --git a/curriculum/challenges/swahili/blocks/information-security-projects/5e46f979ac417301a38fb932.md b/curriculum/challenges/swahili/blocks/information-security-projects/5e46f979ac417301a38fb932.md index 84fdf62b317..dd7d060c6b3 100644 --- a/curriculum/challenges/swahili/blocks/information-security-projects/5e46f979ac417301a38fb932.md +++ b/curriculum/challenges/swahili/blocks/information-security-projects/5e46f979ac417301a38fb932.md @@ -9,15 +9,15 @@ dashedName: port-scanner # --description-- -Utafanya kazi kwenye mradi huu kwa kutumia msimbo wa msingi wa kuanzia wa Ona. +Utafanya kazi kwenye mradi huu kwa kutumia msimbo wetu wa kuanzia. -Bado tunauendeleza sehemu ya mafunzo ya mwingiliano ya mtaala wa Python. Kwa sasa, hapa kuna video kadhaa kwenye kituo cha YouTube cha freeCodeCamp.org zitakazokufundisha kila unachohitaji kujua ili kukamilisha mradi huu: +Bado tunaunda sehemu ya mafunzo ya kuingiliana ya mtaala wa Python. Kwa sasa, hapa kuna video kadhaa kwenye kituo cha YouTube cha freeCodeCamp.org zitakazokufundisha kila kitu unachohitaji kujua ili kumaliza mradi huu: -- Kozi ya video ya Python kwa kila mtu (masaa 14) +- Kozi ya video ya Python kwa kila mtu (saa 14) -- Jifunze misingi ya Python kwa kina (masaa 4) +- Jifunze misingi ya Python kwa kina (saa 4) -- Kozi ya Python ya kiwango cha kati (masaa 6) +- Kozi ya Python ya kiwango cha kati (saa 6) # --instructions-- @@ -82,7 +82,7 @@ Nakili URL ya mradi wako na uwasilishe kwa freeCodeCamp. # --hints-- -Inapaswa kupita majaribio yote ya Python. +Inapaswa kupita mitihani yote ya Python. ```js diff --git a/curriculum/challenges/swahili/blocks/information-security-projects/5e46f983ac417301a38fb933.md b/curriculum/challenges/swahili/blocks/information-security-projects/5e46f983ac417301a38fb933.md index fb8f79f2f2a..cbffee09fbf 100644 --- a/curriculum/challenges/swahili/blocks/information-security-projects/5e46f983ac417301a38fb933.md +++ b/curriculum/challenges/swahili/blocks/information-security-projects/5e46f983ac417301a38fb933.md @@ -9,7 +9,7 @@ dashedName: sha-1-password-cracker # --description-- -Utafanya kazi kwenye mradi huu kwa kutumia msimbo wa msingi wa Ona. +Utafanya kazi kwenye mradi huu kwa kutumia msimbo wetu wa msingi. Bado tunaunda sehemu ya mafunzo ya kuingiliana ya mtaala wa Python. Kwa sasa, hapa kuna video kadhaa kwenye kituo cha YouTube cha freeCodeCamp.org zitakazokufundisha kila kitu unachohitaji kujua ili kumaliza mradi huu: @@ -59,7 +59,7 @@ Nakili URL ya mradi wako na uwasilishe kwa freeCodeCamp. # --hints-- -Inapaswa kupita majaribio yote ya Python. +Inapaswa kupita mitihani yote ya Python. ```js diff --git a/curriculum/challenges/swahili/blocks/lab-availability-table/66b36358ed4f261d64840c24.md b/curriculum/challenges/swahili/blocks/lab-availability-table/66b36358ed4f261d64840c24.md index 8661d2c4a40..735263c1094 100644 --- a/curriculum/challenges/swahili/blocks/lab-availability-table/66b36358ed4f261d64840c24.md +++ b/curriculum/challenges/swahili/blocks/lab-availability-table/66b36358ed4f261d64840c24.md @@ -12,18 +12,18 @@ demoType: onClick **Hadithi za watumizi:** -1. Unapaswa kuwa na jedwali lenye angalau safu tatu na mistari mitano, ikiwa ni pamoja na vichwa. -1. Selu katika mstari wa kwanza zinapaswa kuwa vichwa vya jedwali vinavyoonyesha siku za wiki. -1. Selu katika safu ya kwanza zinapaswa kuwa vichwa vya jedwali vyenye `class` ya `time` na zinapaswa kuwa na thamani za wakati kama maandishi yao. -1. Selu zote za data zinapaswa kuwa na `class` ya `available-#`, ambapo `#` ni nambari kutoka `0` hadi `5` inayobainisha idadi ya watu waliopo wakati huo. +1. Unapaswa kuwa na jedwali lenye angalau safu tatu na mistari mitano, ikiwa na vichwa. +1. Safu ya kwanza inapaswa kuwa na seli za kichwa cha jedwali zenye siku za wiki. +1. Safu ya kwanza inapaswa kuwa na seli za kichwa cha jedwali zenye `class` ya `time` zenye thamani za muda kama maandishi yao. +1. Seli zote za data zinapaswa kuwa na `class` ya `available-#`, ambapo `#` ni nambari kutoka `0` hadi `5` inayobainisha idadi ya watu waliopo wakati huo. 1. Jedwali lako linapaswa kuwa na kipengele cha `caption` chenye maandishi `Weekly Meeting Availability Schedule`. -1. Selu zote za kichwa cha jedwali katika mstari wa kwanza (siku za wiki) zinapaswa kuwa na sifa ya `scope` yenye thamani `col`. -1. Selu zote za kichwa cha jedwali katika safu ya kwanza (selu za wakati) zinapaswa kuwa na sifa ya `scope` yenye thamani `row`. -1. Selu zote za data zenye darasa la upatikanaji zinapaswa kuwa na sifa ya `aria-label` inayobainisha kiwango cha upatikanaji (mfano, `0 available` kwa selu za `available-0`, `1 available` kwa selu za `available-1`, n.k., na `5+ available` kwa selu za `available-5`). -1. Katika kichaguzi chako cha `:root`, unapaswa kufafanua vigezo sita vya CSS vinavyoitwa `--color#`, ambapo `#` ni nambari kutoka `0` hadi `5`, na kuziweka thamani ya rangi kila moja. Tumia vigezo hivi kuweka rangi ya nyuma ya vipengele vinavyolingana vya `.available-#`. -1. Katika kichaguzi chako cha `:root`, unapaswa kufafanua vigezo vya CSS vinavyoitwa `--solid-border` na `--dashed-border`. Tumia vigezo hivi kuunda mipaka ya chini ya selu zako za data, ukibadilisha kati ya mipaka imara na mipaka yenye mistari ya doa kulingana na mstari. Toa mistari darasa la `sharp` au `half` ili kuipanga mitindo. +1. Seli zote za kichwa cha jedwali katika safu ya kwanza (siku za wiki) zinapaswa kuwa na sifa ya kipengele `scope` yenye thamani `col`. +1. Seli zote za kichwa cha jedwali katika safu ya kwanza (seli za muda) zinapaswa kuwa na sifa ya kipengele `scope` yenye thamani `row`. +1. Seli zote za data zenye darasa la upatikanaji zinapaswa kuwa na sifa ya kipengele `aria-label` inayobainisha kiwango cha upatikanaji (mfano, `0 available` kwa seli za `available-0`, `1 available` kwa seli za `available-1`, n.k., na `5+ available` kwa seli za `available-5`). +1. Katika kichaguzi chako cha `:root`, unapaswa kufafanua vigezo sita vya CSS vinavyoitwa `--color#`, ambapo `#` ni nambari kutoka `0` hadi `5`, na kuwawekea kila moja thamani ya rangi. Tumia vigezo hivi kuweka rangi ya nyuma ya vipengele vinavyolingana vya `.available-#`. +1. Katika kichaguzi chako cha `:root`, unapaswa kufafanua vigezo vya CSS vinavyoitwa `--solid-border` na `--dashed-border`. Tumia vigezo hivi kupamba mipaka ya chini ya seli zako za data, ukibadilisha kati ya mipaka imara na mipaka ya mistari ya nukta kulingana na safu. Toa safu hizo darasa la `sharp` au `half` kwa ajili ya kupamba. 1. Unapaswa kuwa na kipengele cha `div` chenye `id` ya `legend`. Kinapaswa kuwa na kipengele cha `span` chenye maandishi `Availability` na kipengele cha `div` chenye `id` ya `legend-gradient`. -1. Unapaswa kumpa kipengele cha `#legend-gradient` mwelekeo wa mchanganyiko wa rangi unaoendelea kati ya rangi zote kutoka `--color0` hadi `--color5` kwa mistari mikali. +1. Unapaswa kumpa kipengele cha `#legend-gradient` mwelekeo wa mchanganyiko wa rangi (linear gradient) unaobadilika kati ya rangi zote kutoka `--color0` hadi `--color5` kwa mistari mikali. **Kumbuka:** Hakikisha umeunganisha karatasi yako ya mtindo (stylesheet) katika HTML yako ili kutumia CSS yako. @@ -389,7 +389,7 @@ headers.forEach(header => { Seli zote za kichwa cha jedwali katika safu ya kwanza zinapaswa kuwa na sifa ya `scope` yenye thamani `row`. ```js -const timeHeaders = [...document.querySelectorAll('tr > th:first-child')]; +const timeHeaders = [...document.querySelectorAll('th.time')]; assert.isNotEmpty(timeHeaders); timeHeaders.forEach(header => { assert.equal(header.getAttribute('scope'), 'row'); diff --git a/curriculum/challenges/swahili/blocks/lab-cargo-manifest-validator/69a56b5069ca99f7317e6e19.md b/curriculum/challenges/swahili/blocks/lab-cargo-manifest-validator/69a56b5069ca99f7317e6e19.md index bb99aa6e6d7..127dc124a27 100644 --- a/curriculum/challenges/swahili/blocks/lab-cargo-manifest-validator/69a56b5069ca99f7317e6e19.md +++ b/curriculum/challenges/swahili/blocks/lab-cargo-manifest-validator/69a56b5069ca99f7317e6e19.md @@ -12,10 +12,10 @@ Katika maabara hii, utatumia JavaScript kawaisha na kukagua manifesti za mizigo. Kila manifesti ya mizigo itawakilishwa kama kitu chenye sifa zifuatazo: - `containerId`: nambari kamili chanya inayotambulisha kontena la mizigo linalohusiana. -- `destination`: mfuatano wa herufi usio tupu (baada ya kuondoa nafasi za ziada) unaoonyesha mahali pa mwisho pa mizigo. +- `destination`: mfuatano wa herufi usio tupu (baada ya kuondoa nafasi zisizohitajika) unaoonyesha mahali pa mwisho pa mizigo. - `weight`: nambari chanya inayowakilisha uzito wa mizigo. -- `unit`: mfuatano wa herufi unaoelezea vipimo vya sifa ya uzito wa mizigo (iwe `"kg"` kwa kilo au `"lb"` kwa pauni). -- `hazmat`: thamani ya kweli au siyo kweli inayoonyesha kama kushughulikia vitu hatarishi kunahitajika. +- `unit`: mfuatano wa herufi unaoelezea kitengo cha sifa ya `weight` ya mizigo (iwe ni `"kg"` kwa kilo au `"lb"` kwa pauni). +- `hazmat`: thamani ya kweli au siyo kweli inayoonyesha kama kuna hitaji la kushughulikia vifaa hatari. Mfano wa kitu cha manifesti ya mizigo: @@ -34,13 +34,13 @@ Mfano wa kitu cha manifesti ya mizigo: **Hadithi za watumizi:** 1. Unapaswa kutekeleza kitendakazi kinachoitwa `normalizeUnits` chenye kigezo `manifest`. - - Kitendakazi hakipaswi kubadilisha kitu cha manifesti asili na kila mara kinapaswa kurudisha kitu kipya ambacho `weight` kimekawaishwa kuwa kilo na `unit` kimewekwa kuwa `"kg"`. - - Ikiwa uzito wa kitu cha manifesti umeelezwa kwa pauni (`unit: "lb"`), kitendakazi kinapaswa kubadilisha `weight` kuwa kilo kwa kutumia ubadilishaji wa takriban, 1 lb = 0.45 kg, na kusahihisha `unit` ipasavyo. - - Ikiwa uzito tayari umeelezwa kwa kilo (`unit: "kg"`), `weight` na `unit` zinapaswa kubaki kama zilivyo. + - Kitendakazi hakipaswi kubadilisha kontena la asili la manifest na lazima kila mara kirudishe kontena jipya ambapo `weight` imekuwa kawaishwa kwa kilo na `unit` imewekwa kuwa `"kg"`. + - Ikiwa `weight` ya kontena la manifest imeelezwa kwa pauni (`unit: "lb"`), kitendakazi kinapaswa kubadilisha `weight` kuwa kilo kwa kutumia mabadiliko ya takriban `1 lb = 0.45 kg`, na kusahihisha `unit` ipasavyo. + - Ikiwa `weight` tayari imeelezwa kwa kilo (`unit: "kg"`), `weight` na `unit` zinapaswa kubaki kama zilivyo. 2. Unapaswa kutekeleza kitendakazi kinachoitwa `validateManifest` chenye kigezo `manifest`. - - Kitendakazi hakipaswi kubadilisha kitu cha manifesti asili na kila mara kinapaswa kurudisha kitu kipya. - - Ikiwa manifesti ya ingizo ni halali (hakuna sifa zilizokosekana au batili), kitendakazi kinapaswa kurudisha kitu tupu. - - Ikiwa manifesti ya ingizo si halali, kitendakazi kinapaswa kurudisha kitu chenye maingizo kwa kila sifa iliyokosekana au batili. Sifa zilizokosekana zinapaswa kuwa na thamani `"Missing"` na sifa batili ziwe na thamani `"Invalid"`. + - Kitendakazi hakipaswi kubadilisha kontena la asili la manifest na lazima kila mara kirudishe kontena jipya. + - Ikiwa manifest ya ingizo ni halali (hakuna sifa zilizokosekana au batili), kitendakazi kinapaswa kurudisha kontena tupu. + - Ikiwa manifest ya ingizo si halali, kitendakazi kinapaswa kurudisha kontena chenye maingizo kwa kila sifa iliyokosekana au batili. Sifa zilizokosekana zinapaswa kuwa na thamani `"Missing"` na sifa batili ziwe na thamani `"Invalid"`. Mfano wa thamani ya return ambapo kitu cha ingizo hakina sifa ya `destination` na kina sifa batili ya `weight`: @@ -51,12 +51,13 @@ Mfano wa thamani ya return ambapo kitu cha ingizo hakina sifa ya `destination` n } ``` -3. Unapaswa kutekeleza kitendakazi kinachoitwa `processManifest` chenye kigezo `manifest`. Kitendakazi kinapaswa kuandika: - - Ikiwa kitu cha manifesti ni halali, `Validation success: ${containerId}` na kisha uzito wa manifesti kwa kilo kama ifuatavyo, `Total weight: ${weight} kg`. Tumia `normalizeUnits()` kwa ubadilishaji huu. - - Ikiwa kitu cha manifesti si halali, `Validation error: ${containerId}` na kisha kitu kilichorejeshwa kwa kuita `validateManifest()` na kitu cha manifesti. - **Kumbuka:** kila mojawapo ya hali hizi mbili inapaswa kuwa na wito mbili za `console.log()`. +3. Unapaswa kutekeleza kitendakazi kinachoitwa `processManifest` chenye kigezo `manifest`. Kitendakazi hiki kinapaswa kuandika kwenye kumbukumbu: + - Ikiwa kitu cha manifest ni halali, andika `Validation success: ${containerId}` kisha uzingatie `weight` ya manifest kwa kilo, kwa muundo wa `Total weight: ${weight} kg`. Tumia `normalizeUnits()` kwa ajili ya uongofu huu. + - Ikiwa kitu cha manifest si halali, andika `Validation error: ${containerId}` kisha andika kitu kilichorejeshwa na wito wa `validateManifest()` ukiwa na kitu cha manifest. -**Kumbuka:** Hakuna kati ya `normalizeUnits`, `validateManifest`, wala `processManifest` inapaswa kutangazwa kwa kutumia `const`, kwa sababu majaribio yanahitaji kuziweka upya. +**Kumbuka:** Kila mojawapo ya hali hizi mbili inapaswa kuwa na wito mbili za `console.log()`. + +**Kumbuka:** Usitangaze `normalizeUnits`, `validateManifest`, au `processManifest` kwa kutumia `const`, kwa sababu majaribio yanahitaji kuyarekebisha. # --before-each-- @@ -120,7 +121,7 @@ console.log = () => {}; # --hints-- -Hakuna kati ya `normalizeUnits`, `validateManifest`, wala `processManifest` inapaswa kutangazwa kwa kutumia `const`, kwa sababu majaribio yanahitaji kuziweka upya. +Hupaswi kutangaza `normalizeUnits`, `validateManifest`, au `processManifest` kwa kutumia `const`, kwa sababu majaribio yanahitaji kuyarekebisha. ```js assert.doesNotThrow(() => { @@ -140,12 +141,12 @@ assert.equal(params.length, 1); assert.equal(params[0].toString(), 'manifest'); ``` -Kuita `normalizeUnits()` na `{ containerId: 68, destination: "Salinas", weight: 101, unit: "lb", hazmat: true }` kunapaswa kurudisha kitu kipya `{ containerId: 68, destination: "Salinas", weight: 45.45, unit: "kg", hazmat: true }` bila kubadilisha ingizo la chanzo. +Kitendakazi chako cha `normalizeUnits` kinapaswa kurudisha kontena jipya `{ containerId: 68, destination: "Salinas", weight: 45.45, unit: "kg", hazmat: true }` kinapoitwa na `{ containerId: 68, destination: "Salinas", weight: 101, unit: "lb", hazmat: true }`, bila kubadilisha kontena la asili. ```js const testObj = { containerId: 68, - destination: "Salinas", + destination: "Salinas", weight: 101, unit: "lb", hazmat: true @@ -161,7 +162,7 @@ const expected = { const copy = normalizeUnits(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "normalizeUnits() did not return the expected normalized object"); +assert.deepEqual(copy, expected, "normalizeUnits() did not return the expected normalized object."); assert.notStrictEqual(copy, testObj, "normalizeUnits() should return a new object."); assert.strictEqual(testObj.containerId, 68, "Original object should not be mutated."); assert.strictEqual(testObj.destination, "Salinas", "Original object should not be mutated."); @@ -171,13 +172,13 @@ assert.strictEqual(testObj.hazmat, true, "Original object should not be mutated. assert.equal(Object.keys(testObj).length, 5, "Original object should not be mutated."); ``` -Kitendakazi chako cha `normalizeUnits` kinapaswa kurudisha nakala ya kitu cha manifesti cha ingizo na `weight` yake ikawaisha kuwa kilo na `unit` kuwekwa kuwa `"kg"`. Tumia ubadilishaji wa takriban `1 lb = 0.45 kg` kwa ubadilishaji wa uzito. +Kitendakazi chako cha `normalizeUnits` kinapaswa kurudisha nakala ya kontena la manifest la ingizo na `weight` yake kawaishwa kwa kilo na `unit` yake kuwekwa kuwa `"kg"`. Tumia mabadiliko ya takriban `1 lb = 0.45 kg` kwa mabadiliko ya `weight`. ```js _validManifests.forEach((obj, i) => { const result = normalizeUnits(obj); - assert.isObject(result, "normalizeUnits should return an object"); - assert.notStrictEqual(result, obj, "normalizeUnits must return a new object, not modify the original"); + assert.isObject(result, "normalizeUnits() should return an object."); + assert.notStrictEqual(result, obj, "normalizeUnits() should return a new object, not mutate the original."); const expectedWeight = obj.unit === "lb" ? obj.weight * 0.45 : obj.weight; const expected = { ...obj, @@ -188,12 +189,12 @@ _validManifests.forEach((obj, i) => { assert.deepEqual( result, expected, - `normalizeUnits did not return the expected normalized object for manifest at index ${i}` + `normalizeUnits() did not return the expected normalized object for manifest at index ${i}.` ); }); ``` -Kitendakazi chako cha `normalizeUnits` kinapaswa kurudisha nakala mpya ya kitu cha ingizo cha `manifest` bila kubadilisha asili. +Kitendakazi chako cha `normalizeUnits` kinapaswa kurudisha nakala mpya ya kontena la manifest la ingizo bila kubadilisha kontena la asili. ```js const original = { @@ -231,12 +232,12 @@ assert.equal(params.length, 1); assert.equal(params[0].toString(), 'manifest'); ``` -Kuita `validateManifest()` na `{ containerId: 1, destination: "Santa Cruz", weight: 304, unit: "kg", hazmat: false }` kunapaswa kurudisha kitu kipya `{}`. +Kitendakazi chako cha `validateManifest` kinapaswa kurudisha kontena jipya, tupu `{}` kinapoitwa na `{ containerId: 1, destination: "Santa Cruz", weight: 304, unit: "kg", hazmat: false }`. ```js const testObj = { containerId: 1, - destination: "Santa Cruz", + destination: "Santa Cruz", weight: 304, unit: "kg", hazmat: false @@ -246,16 +247,16 @@ const expected = {}; const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for a valid manifest"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.strictEqual(testObj.containerId, 1, "Original object should not be mutated"); -assert.strictEqual(testObj.destination, "Santa Cruz", "Original object should not be mutated"); -assert.strictEqual(testObj.weight, 304, "Original object should not be mutated"); -assert.strictEqual(testObj.unit, "kg", "Original object should not be mutated"); -assert.strictEqual(testObj.hazmat, false, "Original object should not be mutated"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for a valid manifest."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.strictEqual(testObj.containerId, 1, "Original object should not be mutated."); +assert.strictEqual(testObj.destination, "Santa Cruz", "Original object should not be mutated."); +assert.strictEqual(testObj.weight, 304, "Original object should not be mutated."); +assert.strictEqual(testObj.unit, "kg", "Original object should not be mutated."); +assert.strictEqual(testObj.hazmat, false, "Original object should not be mutated."); ``` -Ikiwa kitu cha manifesti cha ingizo ni halali, kitendakazi chako cha `validateManifest` kinapaswa kurudisha kitu tupu `{}`. +Kitendakazi chako cha `validateManifest` kinapaswa kurudisha kontena tupu `{}` ikiwa kontena la manifest la ingizo ni halali. ```js const solution = {}; @@ -268,7 +269,7 @@ for (const obj of _validManifests) { } ``` -Kuita `validateManifest()` na `{}` kunapaswa kurudisha kitu kipya `{ containerId: "Missing", destination: "Missing", weight: "Missing", unit: "Missing", hazmat: "Missing" }` bila kubadilisha ingizo la chanzo. +Kitendakazi chako cha `validateManifest` kinapaswa kurudisha kontena jipya `{ containerId: "Missing", destination: "Missing", weight: "Missing", unit: "Missing", hazmat: "Missing" }` kinapoitwa na `{}`, bila kubadilisha kontena la asili. ```js const testObj = {}; @@ -283,12 +284,12 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for missing properties"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.equal(Object.keys(testObj).length, 0, "validateManifest() should return a new object, not mutate the original"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for missing properties."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.equal(Object.keys(testObj).length, 0, "validateManifest() should return a new object, not mutate the original."); ``` -Kuita `validateManifest()` na `{ containerId: null, destination: "Santa Cruz", weight: 304, unit: "kg", hazmat: false }` kunapaswa kurudisha kitu kipya `{ containerId: "Invalid" }` bila kubadilisha ingizo la chanzo. +Kitendakazi chako cha `validateManifest` kinapaswa kurudisha kontena jipya `{ containerId: "Invalid" }` kinapoitwa na `{ containerId: null, destination: "Santa Cruz", weight: 304, unit: "kg", hazmat: false }`, bila kubadilisha kontena la asili. ```js const testObj = { @@ -305,11 +306,11 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for null containerId"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for null containerId."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); ``` -Kuita `validateManifest()` na `{ containerId: 0, destination: 405, weight: -84, unit: "pounds", hazmat: "no" }` kunapaswa kurudisha kitu kipya `{ containerId: "Invalid", destination: "Invalid", weight: "Invalid", unit: "Invalid", hazmat: "Invalid" }` bila kubadilisha ingizo la chanzo. +Kitendakazi chako cha `validateManifest` kinapaswa kurudisha kontena jipya `{ containerId: "Invalid", destination: "Invalid", weight: "Invalid", unit: "Invalid", hazmat: "Invalid" }` kinapoitwa na `{ containerId: 0, destination: 405, weight: -84, unit: "pounds", hazmat: "no" }`, bila kubadilisha kontena la asili. ```js const testObj = { @@ -330,16 +331,16 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid properties"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.strictEqual(testObj.containerId, 0, "Original object should not be mutated"); -assert.strictEqual(testObj.destination, 405, "Original object should not be mutated"); -assert.strictEqual(testObj.weight, -84, "Original object should not be mutated"); -assert.strictEqual(testObj.unit, "pounds", "Original object should not be mutated"); -assert.strictEqual(testObj.hazmat, "no", "Original object should not be mutated"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid properties."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.strictEqual(testObj.containerId, 0, "Original object should not be mutated."); +assert.strictEqual(testObj.destination, 405, "Original object should not be mutated."); +assert.strictEqual(testObj.weight, -84, "Original object should not be mutated."); +assert.strictEqual(testObj.unit, "pounds", "Original object should not be mutated."); +assert.strictEqual(testObj.hazmat, "no", "Original object should not be mutated."); ``` -Kuita `validateManifest()` na `{ containerId: -2 }` kunapaswa kurudisha kitu kipya `{ containerId: "Invalid", destination: "Missing", weight: "Missing", unit: "Missing", hazmat: "Missing" }` bila kubadilisha ingizo la chanzo. +Kitendakazi chako cha `validateManifest` kinapaswa kurudisha kontena jipya `{ containerId: "Invalid", destination: "Missing", weight: "Missing", unit: "Missing", hazmat: "Missing" }` kinapoitwa na `{ containerId: -2 }`, bila kubadilisha kontena la asili. ```js const testObj = { @@ -356,13 +357,13 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.strictEqual(testObj.containerId, -2, "Original object should not be mutated"); -assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.strictEqual(testObj.containerId, -2, "Original object should not be mutated."); +assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated."); ``` -Kuita `validateManifest()` na `{ containerId: 3.50 }` kunapaswa kurudisha kitu kipya `{ containerId: "Invalid", destination: "Missing", weight: "Missing", unit: "Missing", hazmat: "Missing" }` bila kubadilisha ingizo la chanzo. Unaweza kutumia `Number.isInteger()` kuthibitisha thamani za nambari kamili. +Kitendakazi chako cha `validateManifest` kinapaswa kurudisha kontena jipya `{ containerId: "Invalid", destination: "Missing", weight: "Missing", unit: "Missing", hazmat: "Missing" }` kinapoitwa na `{ containerId: 3.50 }`, bila kubadilisha kontena la asili. Unaweza kutumia `Number.isInteger()` kuthibitisha thamani za nambari kamili. ```js const testObj = { @@ -379,13 +380,13 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.strictEqual(testObj.containerId, 3.50, "Original object should not be mutated"); -assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.strictEqual(testObj.containerId, 3.50, "Original object should not be mutated."); +assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated."); ``` -Kuita `validateManifest()` na `{ destination: " " }` kunapaswa kurudisha kitu kipya `{ containerId: "Missing", destination: "Invalid", weight: "Missing", unit: "Missing", hazmat: "Missing" }` bila kubadilisha ingizo la chanzo. Unaweza kutumia `String.trim()` kuondoa nafasi za ziada kutoka kwa mfuatano wa herufi. +Kitendakazi chako cha `validateManifest` kinapaswa kurudisha kontena jipya `{ containerId: "Missing", destination: "Invalid", weight: "Missing", unit: "Missing", hazmat: "Missing" }` kinapoitwa na `{ destination: " " }`, bila kubadilisha kontena la asili. Unaweza kutumia `.trim()` kuondoa nafasi zisizohitajika kutoka kwenye mfuatano wa herufi. ```js const testObj = { @@ -402,13 +403,13 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.strictEqual(testObj.destination, " ", "Original object should not be mutated"); -assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.strictEqual(testObj.destination, " ", "Original object should not be mutated."); +assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated."); ``` -Kuita `validateManifest()` na `{ weight: NaN }` kunapaswa kurudisha kitu kipya `{ containerId: "Missing", destination: "Missing", weight: "Invalid", unit: "Missing", hazmat: "Missing" }` bila kubadilisha ingizo la chanzo. Unaweza kutumia `Number.isNaN()` kuthibitisha thamani za NaN. +Kitendakazi chako cha `validateManifest` kinapaswa kurudisha kontena jipya `{ containerId: "Missing", destination: "Missing", weight: "Invalid", unit: "Missing", hazmat: "Missing" }` kinapoitwa na `{ weight: NaN }`, bila kubadilisha kontena la asili. Unaweza kutumia `Number.isNaN()` kuthibitisha thamani za `NaN`. ```js const testObj = { @@ -425,13 +426,13 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.ok(Number.isNaN(testObj.weight), "Original object should not be mutated"); -assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.ok(Number.isNaN(testObj.weight), "Original object should not be mutated."); +assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated."); ``` -Ikiwa kitu cha manifesti cha ingizo si halali, kitendakazi chako cha `validateManifest` kinapaswa kurudisha kitu kinachoelezea sifa zilizokosekana na/au batili. +Kitendakazi chako cha `validateManifest` kinapaswa kurudisha kontena kinachoelezea sifa zilizokosekana na/au batili ikiwa kontena la manifest la ingizo si halali. ```js const solutions = [ @@ -504,7 +505,7 @@ assert.equal(params.length, 1); assert.equal(params[0].toString(), 'manifest'); ``` -Kuita `processManifest()` na `{ containerId: 55, destination: "Carmel", weight: 400, unit: "lb", hazmat: false }` kunapaswa kwanza kuandika `"Validation success: 55"` na kisha kuandika `"Total weight: 180 kg"`. +Kitendakazi chako cha `processManifest` kinapaswa kwanza kuandika `Validation success: 55` kisha kuandika `Total weight: 180 kg` kinapoitwa na `{ containerId: 55, destination: "Carmel", weight: 400, unit: "lb", hazmat: false }`. ```js const testObj = { @@ -524,8 +525,8 @@ try { ["Validation success: 55"], ["Total weight: 180 kg"] ]; - assert.deepEqual(spy.calls[0], expectedCalls[0], "First log should be the validation success message"); - assert.deepEqual(spy.calls[1], expectedCalls[1], "Second log should be the normalized weight in kg"); + assert.deepEqual(spy.calls[0], expectedCalls[0], "First log should be the validation success message."); + assert.deepEqual(spy.calls[1], expectedCalls[1], "Second log should be the normalized weight in kg."); } catch (err) { assert.fail(err); @@ -534,7 +535,7 @@ try { } ``` -Ikiwa kitu cha manifesti cha ingizo ni halali, kitendakazi chako cha `processManifest` kinapaswa kwanza kuandika ujumbe wa mafanikio, `Validation success: ${containerId}`. +Kitendakazi chako cha `processManifest` kinapaswa kwanza kuandika ujumbe wa mafanikio, `Validation success: ${containerId}`, ikiwa kontena la manifest la ingizo ni halali. ```js const testObj = { @@ -562,7 +563,7 @@ try { } ``` -Ikiwa kitu cha manifesti cha ingizo ni halali, kitendakazi chako cha `processManifest` kinapaswa kukawaisha kuwa kilo kwa kutumia `normalizeUnits()` na kisha kuandika: `Total weight: ${weight} kg`. +Kitendakazi chako cha `processManifest` kinapaswa kawaisha kontena la manifest la ingizo lililo halali kuwa kilo kwa kutumia `normalizeUnits()` kisha kuandika `Total weight: ${weight} kg`. ```js const testObj = { @@ -590,7 +591,7 @@ try { } ``` -Ikiwa kitu cha manifesti cha ingizo ni halali, kitendakazi chako cha `processManifest` kinapaswa kuandika ujumbe wa mafanikio na `containerId` ya kitu, na kisha kuandika `weight` ya kitu kwa kilo. Unapaswa kutumia `normalizeUnits()` kwa ubadilishaji na kuwa na wito mbili za `console.log()`. +Kitendakazi chako cha `processManifest` kinapaswa kuchapisha ujumbe wa mafanikio ukiwa na `containerId` ya kitu, kisha kichapishe `weight` ya kitu hicho kwa kilogramu, ikiwa ingizo la manifest ni sahihi. Unapaswa kutumia `normalizeUnits()` kwa ajili ya uongofu huu, na hii inapaswa kujumuisha miito miwili ya `console.log()`. ```js const originalNormalize = normalizeUnits; @@ -605,7 +606,7 @@ try { assert.isTrue( called, - "processManifest should call normalizeUnits() when the manifest is valid" + "processManifest() should call normalizeUnits() when the manifest is valid." ); } catch (err) { @@ -635,7 +636,7 @@ try { } ``` -Kuita `processManifest()` na `{ containerId: -88, destination: "Soledad", weight: NaN }` kunapaswa kwanza kuandika `Validation error: -88` na kisha kuandika kitu `{ containerId: "Invalid", weight: "Invalid", unit: "Missing", hazmat: "Missing" }`. +Kitendakazi chako cha `processManifest` kinapaswa kwanza kuandika `Validation error: -88` kisha kuandika kontena `{ containerId: "Invalid", weight: "Invalid", unit: "Missing", hazmat: "Missing" }` kinapoitwa na `{ containerId: -88, destination: "Soledad", weight: NaN }`. ```js const testObj = { @@ -658,8 +659,8 @@ try { }] ]; - assert.deepEqual(spy.calls[0], expectedCalls[0], "First log should be the validation error message"); - assert.deepEqual(spy.calls[1], expectedCalls[1], "Second log should be the validation result object"); + assert.deepEqual(spy.calls[0], expectedCalls[0], "First log should be the validation error message."); + assert.deepEqual(spy.calls[1], expectedCalls[1], "Second log should be the validation result object."); } catch (err) { assert.fail(err); @@ -668,7 +669,7 @@ try { } ``` -Kuita `processManifest()` na `{ destination: "Watsonville", hazmat: true }` kunapaswa kwanza kuandika `Validation error: undefined` na kisha kuandika kitu `{ containerId: "Missing", weight: "Missing", unit: "Missing" }`. +Kitendakazi chako cha `processManifest` kinapaswa kwanza kuandika `Validation error: undefined` kisha kuandika kontena `{ containerId: "Missing", weight: "Missing", unit: "Missing" }` kinapoitwa na `{ destination: "Watsonville", hazmat: true }`. ```js const testObj = { @@ -689,8 +690,8 @@ try { }] ]; - assert.deepEqual(spy.calls[0], expectedCalls[0], "First log should be the validation error message"); - assert.deepEqual(spy.calls[1], expectedCalls[1], "Second log should be the validation result object"); + assert.deepEqual(spy.calls[0], expectedCalls[0], "First log should be the validation error message."); + assert.deepEqual(spy.calls[1], expectedCalls[1], "Second log should be the validation result object."); } catch (err) { assert.fail(err); @@ -699,7 +700,7 @@ try { } ``` -Ikiwa kitu cha manifesti cha ingizo si halali, kitendakazi chako cha `processManifest` kinapaswa kwanza kuandika ujumbe wa kosa, `Validation error: ${containerId}`. +Kitendakazi chako cha `processManifest` kinapaswa kwanza kuandika ujumbe wa kosa, `Validation error: ${containerId}`, ikiwa kontena la manifest la ingizo si halali. ```js const spy = __helpers.spyOn(console, "log"); @@ -718,13 +719,13 @@ try { assert.deepEqual(spy.calls[0], expectedCalls[0]); } catch (err) { - assert.fail(err); + assert.fail(err); } finally { spy.restore(); } ``` -Ikiwa kitu cha manifesti cha ingizo si halali, kitendakazi chako cha `processManifest` kinapaswa pia kuandika kitu kilichorejeshwa kwa kuita `validateManifest()` na kitu cha manifesti cha asili. Ita `console.log()` moja kwa moja na kitu kilichorejeshwa. +Kitendakazi chako cha `processManifest` kinapaswa pia kuandika kontena lililorudishwa na wito wa `validateManifest()` kwa kontena la manifest la asili ikiwa kontena la manifest la ingizo si halali. Piga `console.log()` moja kwa moja na kontena lililorudishwa. ```js const originalValidate = validateManifest; @@ -740,7 +741,7 @@ try { assert.isTrue( called, - "processManifest should call validateManifest() when the manifest is invalid" + "processManifest() should call validateManifest() when the manifest is invalid." ); } catch (err) { @@ -765,13 +766,13 @@ try { assert.deepEqual(spy.calls[1], expectedCalls[1]); } catch (err) { - assert.fail(err); + assert.fail(err); } finally { spy.restore(); } ``` -Ikiwa kitu cha manifesti cha ingizo si halali, kitendakazi chako cha `processManifest` kinapaswa kuandika ujumbe wa kosa na `containerId` ya kitu, na kisha kuandika kitu kilichorejeshwa kwa kuita `validateManifest()` na kitu cha ingizo. Hii inapaswa kuwa na wito mbili za `console.log()`. +Kitendakazi chako cha `processManifest` kinapaswa kuandika ujumbe wa kosa na `containerId` ya kontena, kisha kuandika kontena lililorudishwa na wito wa `validateManifest()` kwa kontena la ingizo, ikiwa kontena la manifest la ingizo si halali. Hii inapaswa kuhusisha wito mbili za `console.log()`. ```js const originalValidate = validateManifest; @@ -787,7 +788,7 @@ try { assert.isTrue( called, - "processManifest should call validateManifest() when the manifest is invalid" + "processManifest() should call validateManifest() when the manifest is invalid." ); } catch (err) { @@ -812,7 +813,7 @@ try { assert.deepEqual(spy.calls, expectedCalls); } catch (err) { - assert.fail(err); + assert.fail(err); } finally { spy.restore(); } diff --git a/curriculum/challenges/swahili/blocks/lab-digital-pet-game/68c362b379059c388d3874f2.md b/curriculum/challenges/swahili/blocks/lab-digital-pet-game/68c362b379059c388d3874f2.md index e035f6d6d3a..116008925cc 100644 --- a/curriculum/challenges/swahili/blocks/lab-digital-pet-game/68c362b379059c388d3874f2.md +++ b/curriculum/challenges/swahili/blocks/lab-digital-pet-game/68c362b379059c388d3874f2.md @@ -9,7 +9,7 @@ saveSubmissionToDB: true # --description-- -**Lengo:** Timiza hadithi za watumizi zilizo hapa chini na upite vipimo vyote ili kumaliza maabara hii. +**Lengo:** Timiza hadithi za watumizi zilizo hapa chini na upite vipimo vyote ili kumaliza maabara. **Hadithi za watumizi:** @@ -60,6 +60,7 @@ Onyesho la pili: ```js globalThis._PET_NAME = 'Fitzgerald'; globalThis._clock = __FakeTimers.install(); +window.fetch = () => Promise.resolve({ json: () => Promise.resolve('Cats sleep for around 13 to 16 hours a day.') }); ``` # --after-all-- diff --git a/curriculum/challenges/swahili/blocks/lab-fcc-forum-leaderboard/673c91f0b934834bc4a3ecc2.md b/curriculum/challenges/swahili/blocks/lab-fcc-forum-leaderboard/673c91f0b934834bc4a3ecc2.md index 984f0fb94e5..a35aa05b9cc 100644 --- a/curriculum/challenges/swahili/blocks/lab-fcc-forum-leaderboard/673c91f0b934834bc4a3ecc2.md +++ b/curriculum/challenges/swahili/blocks/lab-fcc-forum-leaderboard/673c91f0b934834bc4a3ecc2.md @@ -50,9 +50,9 @@ Kiishio cha API hurejesha JSON katika muundo ufuatao: Kumbuka kuwa thamani za `avatar_template` ni njia za jamaa: huanza na `/` na zina kiwakilishi cha `{size}` ambacho kinapaswa kubadilishwa na ukubwa wa pikseli. Kiasi cha `avatarUrl` kinashikilia URL msingi cha kuambatanisha wakati njia ni jamaa. -**Lengo:** Timiza hadithi za watumiaji zilizo hapa chini na upite vipimo vyote ili kumaliza maabara. +**Lengo:** Timiza hadithi za watumizi zilizo hapa chini na upite vipimo vyote ili kumaliza maabara. -**Hadithi za watumiaji:** +**Hadithi za watumizi:** 1. Unapaswa kuwa na kitendakazi kinachoitwa `timeAgo` kinachopokea alama ya wakati katika muundo wa ISO 8601 kama hoja. 1. Kitendakazi cha `timeAgo` kinapaswa kuhesabu tofauti ya wakati kati ya wakati uliotolewa kama hoja na wakati wa sasa na kurudisha: @@ -93,6 +93,68 @@ Kumbuka kuwa thamani za `avatar_template` ni njia za jamaa: huanza na `/` na zin 1. Kitendakazi cha `fetchData` kinapaswa kuomba data kutoka `forumLatest` na kuita `showLatestPosts` kikipeleka jibu lililochambuliwa kama JSON. 1. Ikiwa kuna kosa wakati wa kupata data, kitendakazi cha `fetchData` kinapaswa kuandika kosa kwenye konsoli. Tafadhali tumia `console.log` kwa hili. +# --before-all-- + +```js +const _testUsers = [ + { + avatar_template: '/user_avatar/QuincyLarson_{size}.png', + id: 6, + name: 'Quincy Larson', + username: 'QuincyLarson' + }, + { + avatar_template: '/user_avatar/jwilkins.oboe_{size}.png', + id: 285941, + name: 'Jessica Wilkins', + username: 'jwilkins.oboe' + }, + { + avatar_template: '/user_avatar/ilenia_{size}.png', + id: 170865, + name: 'Ilenia', + username: 'ilenia' + } +]; + +const _testPosters = [ + { user_id: 6 }, + { user_id: 285941 }, + { user_id: 170865 } +]; + +const _testData = { + users: _testUsers, + topic_list: { + topics: [ + { + bumped_at: '2024-04-15T16:01:26.403Z', + category_id: 1, + id: 684569, + posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], + posts_count: 8, + slug: 'the-freecodecamp-podcast-is-back-now-with-video', + title: 'The freeCodeCamp Podcast is back – now with video', + views: 542 + }, + { + bumped_at: '2024-04-19T13:52:03.523Z', + category_id: 421, + id: 686149, + posters: [{ user_id: 170865 }], + posts_count: 1, + slug: 'problem-with-making-changes-to-styles-js', + title: 'Problem with making changes to styles. (JS)', + views: 9 + } + ] + } +}; + +window.fetch = () => + Promise.resolve({ json: () => Promise.resolve(_testData) }); +``` + # --hints-- Unapaswa kuwa na kitendakazi kinachoitwa `timeAgo` kinachopokea hoja moja. @@ -297,31 +359,8 @@ assert.lengthOf(avatars, 2); Kitendakazi cha `avatars` kinapaswa kurudisha mfuatano wa herufi uliounganishwa na vipengele vya `img`, kimoja kwa kila mchapishaji aliyeonekana katika safu ya watumiaji. ```js -const posters = [{ user_id: 6 }, { user_id: 285941 }, { user_id: 170865 }]; -const users = [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - }, - { id: 20 } -]; +const posters = _testPosters; +const users = [..._testUsers, { id: 20 }]; const actual = avatars(posters, users); const matches = actual.match(/<\s*img\s+.+?>/g); assert.lengthOf(matches, 3); @@ -330,31 +369,8 @@ assert.lengthOf(matches, 3); Kila kipengele cha `img` katika mfuatano uliorejeshwa na kitendakazi cha `avatars` kinapaswa kuwa na maandishi ya `alt` yenye thamani ya sifa ya `name` ya mchapishaji. ```js -const posters = [{ user_id: 6 }, { user_id: 285941 }, { user_id: 170865 }]; -const users = [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - }, - { id: 20 } -]; +const posters = _testPosters; +const users = [..._testUsers, { id: 20 }]; const actual = avatars(posters, users); const matches = actual.match(/<\s*img\s+.+?>/g); @@ -366,31 +382,8 @@ assert.match(matches[2], /alt=('|")Ilenia\1/); Kitendakazi cha `avatars` kinapaswa kuweka ukubwa wa kila avatar kwa kupata sifa ya `avatar_template` na kubadilisha `{size}` na `30`. ```js -const posters = [{ user_id: 6 }, { user_id: 285941 }, { user_id: 170865 }]; -const users = [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - }, - { id: 20 } -]; +const posters = _testPosters; +const users = [..._testUsers, { id: 20 }]; const actual = avatars(posters, users); assert.notMatch(actual, /\{size\}/); assert.lengthOf(actual.match(/_30/g), 3); @@ -399,31 +392,8 @@ assert.lengthOf(actual.match(/_30/g), 3); Kila kipengele cha `img` kinapaswa kuwa na sifa ya `src` iliyowekwa kwa `avatar_template` ya mtumiaji aliyepatikana. Ikiwa `avatar_template` inaanza na `/`, ongeza `avatarUrl` moja kwa moja mbele yake. ```js -const posters = [{ user_id: 6 }, { user_id: 285941 }, { user_id: 170865 }]; -const users = [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - }, - { id: 20 } -]; +const posters = _testPosters; +const users = [..._testUsers, { id: 20 }]; const actual = avatars(posters, users); const matches = actual.match(/<\s*img\s+.+?>/g); @@ -458,19 +428,15 @@ assert.isFunction(fetchData); Kitendakazi chako cha `fetchData` kinapaswa kuomba data kutoka `https://cdn.freecodecamp.org/curriculum/forum-latest/latest.json`. ```js -const testArr = []; -const temp = fetch; +const spy = __helpers.spyOn(window, 'fetch'); try { - fetch = source => { - testArr.push(source); - return temp(source); - }; fetchData(); - assert.deepEqual(testArr, [ + assert.include( + spy.calls.map(call => call[0]), 'https://cdn.freecodecamp.org/curriculum/forum-latest/latest.json' - ]); + ); } finally { - fetch = temp; + spy.restore(); } ``` @@ -521,55 +487,7 @@ async () => { `showLatestPosts` inapaswa kuweka HTML ya ndani ya `#posts-container` kuwa mfuatano wa herufi uliounganishwa na vipengele vya `tr`, kimoja kwa kila kipengee katika `topics`. ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const pContainer = document.getElementById('posts-container'); pContainer.innerHTML = ''; showLatestPosts(data); @@ -579,55 +497,7 @@ assert.lengthOf(pContainer.querySelectorAll('tr'), 2); Kila kipengele cha `tr` kutoka kwa mfuatano uliorejeshwa na `showLatestPosts` kinapaswa kuwa na vipengele vitano vya `td`. ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const pContainer = document.getElementById('posts-container'); pContainer.innerHTML = ''; showLatestPosts(data); @@ -638,55 +508,7 @@ assert.lengthOf(pContainer.querySelectorAll('tr:last-child>td'), 5); Kipengele cha kwanza cha `td` cha kila safu ya jedwali kutoka kwa mfuatano uliorejeshwa na `showLatestPosts` kinapaswa kuwa na vipengele viwili vya nanga, cha kwanza chenye darasa la `post-title`, `href` ya `/`, maandishi ya nanga ya ``, na cha pili kinachopatikana kwa kuita `forumCategory` na `category_id`. ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const pContainer = document.getElementById('posts-container'); pContainer.innerHTML = ''; showLatestPosts(data); @@ -731,55 +553,7 @@ assert.equal( Kipengele cha pili cha `td` cha kila safu ya jedwali kutoka kwa mfuatano uliorejeshwa na `showLatestPosts` kinapaswa kuwa na picha zinazorejeshwa na kitendakazi cha `avatars` kinachoitwa na `posters` na `users` kama hoja, zikiwa zimepangwa ndani ya kipengele cha `div` chenye darasa la `avatar-container`. ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const pContainer = document.getElementById('posts-container'); pContainer.innerHTML = ''; showLatestPosts(data); @@ -820,55 +594,7 @@ assert.equal(imgs2[0].alt, 'Ilenia'); Kipengele cha tatu cha `td` cha kila safu ya jedwali kutoka kwa mfuatano uliorejeshwa na `showLatestPosts` kinapaswa kuwa na idadi ya majibu kwa chapisho. _Kibukisho:_ tumia `posts_count - 1`. ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const pContainer = document.getElementById('posts-container'); pContainer.innerHTML = ''; showLatestPosts(data); @@ -887,55 +613,7 @@ assert.equal( Kipengele cha nne cha `td` cha kila safu ya jedwali kutoka kwa mfuatano uliorejeshwa na `showLatestPosts` kinapaswa kuwa na idadi ya maoni ya chapisho. ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const pContainer = document.getElementById('posts-container'); pContainer.innerHTML = ''; showLatestPosts(data); @@ -954,55 +632,7 @@ assert.equal( Kipengele cha tano cha `td` cha kila safu ya jedwali kutoka kwa mfuatano uliorejeshwa na `showLatestPosts` kinapaswa kuwa na muda uliopita tangu shughuli ya mwisho, uliotengenezwa kwa kutumia kitendakazi cha `timeAgo`. ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const calcTime = time => { const currentTime = new Date(); const lastPost = new Date(time); diff --git a/curriculum/challenges/swahili/blocks/lab-javascript-trivia-bot/66ed41f912d0bb1dc62da5dd.md b/curriculum/challenges/swahili/blocks/lab-javascript-trivia-bot/66ed41f912d0bb1dc62da5dd.md index 1425c744b73..51c3601ed71 100644 --- a/curriculum/challenges/swahili/blocks/lab-javascript-trivia-bot/66ed41f912d0bb1dc62da5dd.md +++ b/curriculum/challenges/swahili/blocks/lab-javascript-trivia-bot/66ed41f912d0bb1dc62da5dd.md @@ -12,14 +12,14 @@ dashedName: lab-javascript-trivia-bot **Hadithi za watumizi:** 1. Unapaswa kuandika `"Hello! I'm your coding fun fact guide!"` kwenye konsoli kama ujumbe wa salamu kwa mtumizi. -1. Unapaswa kutangaza vigezo vitatu: `botName`, `botLocation`, na `favoriteLanguage`, vinavyohifadhi jina la bot, mahali anapotoka, na lugha yake ya kupenda ya kuandika programu, mtawalia. +1. Unapaswa kuunda vigezo vitatu: `botName`, `botLocation`, na `favoriteLanguage`, vinavyohifadhi jina la bot, mahali anapotoka, na lugha yake ya kupendelea ya programu, mtawalia. 1. Unapaswa kuandika `"My name is (botName) and I live on (botLocation)."` kwenye konsoli. 1. Unapaswa kuandika `"My favorite programming language is (favoriteLanguage)."` kwenye konsoli. -1. Unapaswa kutumia `let` kutangaza kigezo kipya `codingFact` na kuweka thamani ya mfuatano wa herufi unaohusu ukweli wa kufurahisha kuhusu lugha ya kupenda ya bot na ujumuishe matumizi ya kigezo `favoriteLanguage`. +1. Unapaswa kutumia `let` kuunda kigezo cha `codingFact` na kuweka thamani ya mfuatano wa herufi unaoelezea ukweli wa kufurahisha kuhusu lugha ya kupendelea ya programu ya bot, ukitumia kigezo cha `favoriteLanguage`. 1. Unapaswa kuandika `codingFact` kwenye konsoli. -1. Unapaswa kuweka thamani mpya kwa kigezo `codingFact` kuhusu ukweli mwingine wa lugha ya kupenda ya bot ukitumia tena kigezo `favoriteLanguage`. +1. Unapaswa kuweka thamani mpya kwa kigezo cha `codingFact` kuhusu ukweli mwingine wa lugha ya kupendelea ya programu ya bot ukitumia tena kigezo cha `favoriteLanguage`. 1. Unapaswa kuandika tena `codingFact` kwenye konsoli. -1. Unapaswa kuweka tena thamani mpya kwa kigezo `codingFact` kuhusu ukweli mwingine wa lugha ya kupenda ya bot ukitumia kigezo `favoriteLanguage`. +1. Unapaswa kuweka thamani ya tatu kwa kigezo cha `codingFact` kuhusu ukweli mwingine wa lugha ya kupendelea ya programu ya bot ukitumia tena kigezo cha `favoriteLanguage`. 1. Unapaswa kuandika `codingFact` kwenye konsoli mara ya tatu. 1. Unapaswa kuandika `"It was fun sharing these facts with you. Goodbye! - (botName) from (botLocation)."` kwenye konsoli kama taarifa ya kuaga kutoka kwa bot. @@ -162,7 +162,7 @@ let codingFact = "Did you know that " + favoriteLanguage + " was created in just console.log(codingFact); -codingFact = "Another fun fact: " + favoriteLanguage + "was originally called Mocha!"; +codingFact = "Another fun fact: " + favoriteLanguage + " was originally called Mocha!"; console.log(codingFact); diff --git a/curriculum/challenges/swahili/blocks/lab-mood-board/673b3d6b7ef7318eef926d5a.md b/curriculum/challenges/swahili/blocks/lab-mood-board/673b3d6b7ef7318eef926d5a.md index 50a9e1b5704..6613e0e3000 100644 --- a/curriculum/challenges/swahili/blocks/lab-mood-board/673b3d6b7ef7318eef926d5a.md +++ b/curriculum/challenges/swahili/blocks/lab-mood-board/673b3d6b7ef7318eef926d5a.md @@ -16,16 +16,16 @@ Katika maabara hii, utaunda bodi ya hisia ukitumia sehemu za React zinazoweza ku **Hadithi za watumizi:** -1. Unapaswa kuunda na kusafirisha sehemu ya `MoodBoardItem` inayokubali vigezo vinavyopitishwa vitatu: `color`, `image`, na `description`. -2. Sehemu yako ya `MoodBoardItem` inapaswa kurudisha `div` yenye darasa la `mood-board-item` kama kipengele chake cha ngazi ya juu. -3. Unapaswa kuweka rangi ya nyuma ya kipengele cha `.mood-board-item` kwa thamani ya kigezo cha `color` ukitumia mitindo ndani ya mstari. -4. Unapaswa kuonyesha kipengele cha `img`, chenye darasa la `mood-board-image` na sifa yake ya `src` kuwekwa kwa thamani ya kigezo cha `image`, ndani ya kipengele cha `.mood-board-item`. -5. Unapaswa kuonyesha kipengele cha `h3`, chenye darasa la `mood-board-text` na maandishi yake kuwa thamani ya kigezo cha `description`, ndani ya kipengele cha `.mood-board-item`. -6. Unapaswa kuunda na kusafirisha `MoodBoard`. -7. Sehemu yako ya `MoodBoard` inapaswa kurudisha `div` kama kipengele chake cha ngazi ya juu. -8. Sehemu yako ya `MoodBoard` inapaswa kuonyesha kipengele cha `h1` chenye darasa la `mood-board-heading` na maandishi `Destination Mood Board`. -9. Sehemu yako ya `MoodBoard` inapaswa kuonyesha `div` yenye darasa la `mood-board`. -10. Sehemu yako ya `MoodBoard` inapaswa kuonyesha angalau sehemu tatu za `MoodBoardItem` ndani ya kipengele cha `.mood-board`, kila moja ikipitisha vigezo vinavyopitishwa `color`, `image`, na `description` zenye thamani halali. +1. Unapaswa kuunda na kusafirisha sehemu ya `MoodBoardItem` inayokubali vigezo vitatu: `color`, `image`, na `description`. +2. Sehemu yako ya `MoodBoardItem` inapaswa kurudisha `div` yenye darasa la vitu `mood-board-item` kama kipengele chake cha juu. +3. Unapaswa kuweka rangi ya nyuma ya kipengele cha `.mood-board-item` kwa thamani ya vigezo `color` ukitumia mitindo ndani ya mstari. +4. Unapaswa onyesha kipengele cha `img`, chenye darasa la vitu `mood-board-image` na sifa yake ya `src` kuwekwa kwa thamani ya vigezo `image`, ndani ya kipengele cha `.mood-board-item`. +5. Unapaswa onyesha kipengele cha `h3`, chenye darasa la vitu `mood-board-text` na maandishi yake kuwekwa kwa thamani ya vigezo `description`, ndani ya kipengele cha `.mood-board-item`. +6. Unapaswa kuunda na kusafirisha sehemu ya `MoodBoard`. +7. Sehemu yako ya `MoodBoard` inapaswa kurudisha `div` kama kipengele chake cha juu. +8. Sehemu yako ya `MoodBoard` inapaswa onyesha kipengele cha `h1` chenye darasa la vitu `mood-board-heading` na maandishi `Destination Mood Board`. +9. Sehemu yako ya `MoodBoard` inapaswa onyesha `div` yenye darasa la vitu `mood-board`. +10. Sehemu yako ya `MoodBoard` inapaswa onyesha angalau sehemu tatu za `MoodBoardItem` ndani ya kipengele cha `.mood-board`, kila moja ikipitisha vigezo `color`, `image`, na `description` zenye thamani halali. Unaweza kutumia picha zifuatazo katika bodi yako ya hisia ikiwa unataka: @@ -41,10 +41,10 @@ Unaweza kutumia picha zifuatazo katika bodi yako ya hisia ikiwa unataka: Unapaswa kusafirisha sehemu ya `MoodBoardItem`. ```js -assert.isFunction(window.index.MoodBoardItem, 1); +assert.isFunction(window.index.MoodBoardItem); ``` -Sehemu yako ya `MoodBoardItem` inapaswa kurudisha `div` yenye darasa la `mood-board-item` kama kipengele chake cha ngazi ya juu. +Sehemu yako ya `MoodBoardItem` inapaswa kurudisha `div` yenye darasa la vitu `mood-board-item` kama kipengele chake cha juu. ```js const item = document.getElementsByClassName('mood-board-item')[0]; @@ -52,7 +52,7 @@ assert.exists(item); assert.equal(item.tagName, 'DIV'); ``` -Rangi ya nyuma ya kipengele cha `.mood-board-item` inapaswa kuwekwa kwa thamani ya kigezo cha `color` ukitumia mitindo ndani ya mstari. +Rangi ya nyuma ya kipengele cha `.mood-board-item` inapaswa kuwekwa kwa thamani ya vigezo `color` ukitumia mitindo ndani ya mstari. ```js const container = await __helpers.prepTestComponent(window.index.MoodBoardItem, { color: "red" }); @@ -83,7 +83,7 @@ Sehemu yako ya `MoodBoardItem` inapaswa kuonyesha kipengele cha `h3` chenye dara Unapaswa kusafirisha sehemu ya `MoodBoard`. ```js -assert.isFunction(window.index.MoodBoard, 1); +assert.isFunction(window.index.MoodBoard); ``` Sehemu yako ya `MoodBoard` inapaswa kurudisha `div` kama kipengele chake cha ngazi ya juu. @@ -102,7 +102,15 @@ assert.equal(heading.tagName, 'H1'); assert.equal(heading.textContent, 'Destination Mood Board'); ``` -Sehemu yako ya `MoodBoard` inapaswa kuonyesha angalau sehemu tatu za `MoodBoardItem`, kila moja ikipitisha vigezo vinavyopitishwa `color`, `image`, na `description` zenye thamani halali. +Sehemu yako ya `MoodBoard` inapaswa onyesha `div` yenye darasa la vitu `mood-board`. + +```js +const moodboard = document.getElementsByClassName('mood-board')[0]; +assert.exists(moodboard); +assert.equal(moodboard.tagName, 'DIV'); +``` + +Sehemu yako ya `MoodBoard` inapaswa onyesha angalau sehemu tatu za `MoodBoardItem` ndani ya kipengele cha `.mood-board`, kila moja ikipitisha vigezo `color`, `image`, na `description` zenye thamani halali. ```js const moodboard = document.getElementsByClassName('mood-board')[0]; diff --git a/curriculum/challenges/swahili/blocks/lab-motorcycle-shop/694175528a794a090ea0ba74.md b/curriculum/challenges/swahili/blocks/lab-motorcycle-shop/694175528a794a090ea0ba74.md index b71975c794b..ffaf205ef74 100644 --- a/curriculum/challenges/swahili/blocks/lab-motorcycle-shop/694175528a794a090ea0ba74.md +++ b/curriculum/challenges/swahili/blocks/lab-motorcycle-shop/694175528a794a090ea0ba74.md @@ -1,6 +1,6 @@ --- id: 694175528a794a090ea0ba74 -title: Build a Motorcycle Shop +title: Jenga Duka la Pikipiki challengeType: 25 dashedName: lab-motorcycle-shop demoType: onClick @@ -35,6 +35,291 @@ Kwa maabara hii, umepewa HTML na CSS zote. Utatumia TypeScript kukamilisha kazi 7. Idadi ya vipengele vya `Motorcycle` vinavyoonyeshwa inapaswa kuorodheshwa ndani ya kipengele chenye kitambulisho cha `results-number`. 8. Kichujio kinapaswa kusasishwa kwenye tukio la `input`. +# --before-all-- + +```js +const _testMotorcycles = [ + { + id: '1', + name: 'Ninja H2', + manufacturer: 'Kawasaki', + category: 'Sport', + price: 29000, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-vmoto-stash.jpg', + description: 'Supercharged hypersport with unmatched power', + year: 2024, + created_at: '2024-01-01T00:00:00Z' + }, + { + id: '2', + name: 'Street Triple RS', + manufacturer: 'Triumph', + category: 'Naked', + price: 13500, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-r3.png', + description: 'Agile naked bike with triple-cylinder perfection', + year: 2024, + created_at: '2024-01-02T00:00:00Z' + }, + { + id: '3', + name: 'R1250 GS Adventure', + manufacturer: 'BMW', + category: 'Adventure', + price: 21995, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-vmoto-stash.jpg', + description: 'The ultimate adventure touring machine', + year: 2024, + created_at: '2024-01-03T00:00:00Z' + }, + { + id: '4', + name: 'Panigale V4', + manufacturer: 'Ducati', + category: 'Sport', + price: 28395, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-kawasaki-zx10r.png', + description: 'Italian superbike engineering at its finest', + year: 2024, + created_at: '2024-01-04T00:00:00Z' + }, + { + id: '5', + name: 'Road Glide Special', + manufacturer: 'Harley-Davidson', + category: 'Cruiser', + price: 29999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-vmax.jpg', + description: 'Classic American touring with modern tech', + year: 2024, + created_at: '2024-01-05T00:00:00Z' + }, + { + id: '6', + name: 'MT-09', + manufacturer: 'Yamaha', + category: 'Naked', + price: 9999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-mt7.jpg', + description: 'Lightweight naked bike with crossplane power', + year: 2024, + created_at: '2024-01-06T00:00:00Z' + }, + { + id: '7', + name: 'Africa Twin', + manufacturer: 'Honda', + category: 'Adventure', + price: 14599, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-honda-africa.jpg', + description: 'Legendary adventure bike reborn for modern times', + year: 2024, + created_at: '2024-01-07T00:00:00Z' + }, + { + id: '8', + name: 'Super Duke R', + manufacturer: 'KTM', + category: 'Naked', + price: 18999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-suzuki-sv650.jpg', + description: 'The Beast returns with 180hp of raw power', + year: 2024, + created_at: '2024-01-08T00:00:00Z' + }, + { + id: '9', + name: 'GSX-R1000R', + manufacturer: 'Suzuki', + category: 'Sport', + price: 17199, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-suzuki-gsxr1000.jpg', + description: 'Track-ready sportbike with championship DNA', + year: 2024, + created_at: '2024-01-09T00:00:00Z' + }, + { + id: '10', + name: 'Street Glide', + manufacturer: 'Harley-Davidson', + category: 'Cruiser', + price: 21999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-vmax.jpg', + description: 'Milwaukee-Eight power in a sleek bagger', + year: 2024, + created_at: '2024-01-10T00:00:00Z' + }, + { + id: '11', + name: 'Z H2', + manufacturer: 'Kawasaki', + category: 'Naked', + price: 17000, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-kawasaki-zh2.jpg', + description: 'Supercharged naked bike mayhem', + year: 2024, + created_at: '2024-01-11T00:00:00Z' + }, + { + id: '12', + name: 'Multistrada V4', + manufacturer: 'Ducati', + category: 'Adventure', + price: 22995, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-mt3.jpg', + description: 'Italian style meets adventure capability', + year: 2024, + created_at: '2024-01-12T00:00:00Z' + }, + { + id: '13', + name: 'Speed Triple 1200', + manufacturer: 'Triumph', + category: 'Naked', + price: 16500, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-honda-transalp.jpg', + description: 'British muscle bike with cutting-edge tech', + year: 2024, + created_at: '2024-01-13T00:00:00Z' + }, + { + id: '14', + name: 'S1000RR', + manufacturer: 'BMW', + category: 'Sport', + price: 17295, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-kawasaki-z900a1.jpg', + description: 'German precision in a superbike package', + year: 2024, + created_at: '2024-01-14T00:00:00Z' + }, + { + id: '15', + name: 'MT-07', + manufacturer: 'Yamaha', + category: 'Naked', + price: 7999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-mt7.jpg', + description: 'Best-selling parallel twin for pure fun', + year: 2024, + created_at: '2024-01-15T00:00:00Z' + }, + { + id: '16', + name: 'V-Strom 1050', + manufacturer: 'Suzuki', + category: 'Adventure', + price: 13799, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-benelli-trk702.png', + description: 'Reliable adventure touring on a budget', + year: 2024, + created_at: '2024-01-16T00:00:00Z' + }, + { + id: '17', + name: 'Sportster S', + manufacturer: 'Harley-Davidson', + category: 'Cruiser', + price: 15999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-r3.png', + description: 'Revolution Max engine in a modern cruiser', + year: 2024, + created_at: '2024-01-17T00:00:00Z' + }, + { + id: '18', + name: 'CBR1000RR-R', + manufacturer: 'Honda', + category: 'Sport', + price: 28500, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-honda-cbr500.png', + description: 'Honda racing technology for the street', + year: 2024, + created_at: '2024-01-18T00:00:00Z' + }, + { + id: '19', + name: 'Tiger 900', + manufacturer: 'Triumph', + category: 'Adventure', + price: 14400, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-triumph-tiger900.png', + description: 'Middleweight adventure excellence', + year: 2024, + created_at: '2024-01-19T00:00:00Z' + }, + { + id: '20', + name: '890 Duke R', + manufacturer: 'KTM', + category: 'Naked', + price: 11999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-kawasaki-zx10r.png', + description: 'The Scalpel - precise handling perfection', + year: 2024, + created_at: '2024-01-20T00:00:00Z' + }, + { + id: '21', + name: 'Ninja 400', + manufacturer: 'Kawasaki', + category: 'Sport', + price: 5299, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-vmoto-stash.jpg', + description: 'Perfect entry-level sportbike', + year: 2024, + created_at: '2024-01-21T00:00:00Z' + }, + { + id: '22', + name: 'Scrambler 1200', + manufacturer: 'Triumph', + category: 'Adventure', + price: 13250, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-ducati-scrambler.jpg', + description: 'Modern classic with off-road capability', + year: 2024, + created_at: '2024-01-22T00:00:00Z' + }, + { + id: '23', + name: 'Monster Plus', + manufacturer: 'Ducati', + category: 'Naked', + price: 14295, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-kawasaki-zx10r.png', + description: 'Evolved Monster with V-twin soul', + year: 2024, + created_at: '2024-01-23T00:00:00Z' + }, + { + id: '24', + name: 'CB650R', + manufacturer: 'Honda', + category: 'Naked', + price: 9199, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-kawasaki-z900.png', + description: 'Neo Sports Café styling with inline-four power', + year: 2024, + created_at: '2024-01-24T00:00:00Z' + }, + { + id: '25', + name: 'Low Rider S', + manufacturer: 'Harley-Davidson', + category: 'Cruiser', + price: 17999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-suzuki-vstorm650.jpg', + description: 'Blacked-out cruiser with attitude', + year: 2024, + created_at: '2024-01-25T00:00:00Z' + } +]; + +window.fetch = () => + Promise.resolve({ json: () => Promise.resolve(_testMotorcycles) }); +``` + # --hints-- Unapaswa kuwa na `type` inayoitwa `Category`. @@ -84,16 +369,24 @@ Unapaswa kutumia kiishio cha `https://cdn.freecodecamp.org/curriculum/labs/data/ ```js const spy = __helpers.spyOn(window, 'fetch'); -const motorcycles = await fetchMotorcycles(); -assert.strictEqual(spy.calls[0][0].trim(),"https://cdn.freecodecamp.org/curriculum/labs/data/motorcycles.json"); +try { + await fetchMotorcycles(); + assert.strictEqual(spy.calls[0][0].trim(),"https://cdn.freecodecamp.org/curriculum/labs/data/motorcycles.json"); +} finally { + spy.restore(); +} ``` Unapaswa kurejesha ahadi ya vitu 25 vya `Motorcycle` kutoka `fetchMotorcycles`. ```js const spy = __helpers.spyOn(window, 'fetch'); -const motorcycles = await fetchMotorcycles(); -assert.lengthOf(motorcycles,25); +try { + const motorcycles = await fetchMotorcycles(); + assert.lengthOf(motorcycles,25); +} finally { + spy.restore(); +} ``` Unapaswa kuwa na kitendakazi kinachoitwa `renderMotorcycleCard`. diff --git a/curriculum/challenges/swahili/blocks/lab-nth-fibonacci-number-js/7a97b79c096ecb000d03bd36.md b/curriculum/challenges/swahili/blocks/lab-nth-fibonacci-number-js/7a97b79c096ecb000d03bd36.md index 375eb3ce0a8..a88cb9d9365 100644 --- a/curriculum/challenges/swahili/blocks/lab-nth-fibonacci-number-js/7a97b79c096ecb000d03bd36.md +++ b/curriculum/challenges/swahili/blocks/lab-nth-fibonacci-number-js/7a97b79c096ecb000d03bd36.md @@ -1,6 +1,6 @@ --- id: 7a97b79c096ecb000d03bd36 -title: Jenga kalkuleta ya nambari ya Nth Fibonacci +title: Tengeneza kalkuleta ya nambari ya Nth Fibonacci challengeType: 26 dashedName: build-an-nth-fibonacci-number-calculator --- @@ -19,23 +19,28 @@ dashedName: build-an-nth-fibonacci-number-calculator # --hints-- -Unapaswa kuwa na kitendakazi kinachoitwa `fibonacci`. +Unapaswa kuwa na kitendakazi chenye jina `fibonacci`. ```js -assert.isFunction(fibonacci); +const explorer = await __helpers.Explorer(code); +assert.exists(explorer.allFunctions.fibonacci); ``` Kitendakazi chako cha `fibonacci` kinapaswa kuchukua kigezo kimoja. ```js -const params = __helpers.getFunctionParams(fibonacci.toString()); -assert.equal(params.length, 1); +const explorer = await __helpers.Explorer(code); +const { fibonacci } = explorer.allFunctions; +assert.equal(fibonacci?.parameters.length, 1); ``` Unapaswa kuwa na safu ya data inayoitwa `sequence` ndani ya kitendakazi cha `fibonacci` iliyowekwa na `[0, 1]`. ```js -assert.match(__helpers.removeJSComments(fibonacci.toString()), /(const|let|var)\s+sequence\s*=\s*\[\s*0\s*,\s*1\s*\]/); +const explorer = await __helpers.Explorer(code); +const { fibonacci } = explorer.allFunctions; +const { sequence } = fibonacci?.variables ?? {}; +assert.isTrue(sequence?.value.matches('[0, 1]')); ``` `fibonacci(0)` inapaswa kurudisha `0`. diff --git a/curriculum/challenges/swahili/blocks/lab-product-showcase/696920c0c98a1ed58eb86293.md b/curriculum/challenges/swahili/blocks/lab-product-showcase/696920c0c98a1ed58eb86293.md index 63b7c5a12fd..145996b384c 100644 --- a/curriculum/challenges/swahili/blocks/lab-product-showcase/696920c0c98a1ed58eb86293.md +++ b/curriculum/challenges/swahili/blocks/lab-product-showcase/696920c0c98a1ed58eb86293.md @@ -421,6 +421,10 @@ Kubofya kitufe cha `#all` kunapaswa kuonyesha bidhaa zote katika kipengele cha ` ```js const len = products.items.length; +const books = document.getElementById("books"); +const all = document.getElementById("all"); +const output = document.getElementById("output"); + assert.isAtLeast(len, 3); books.dispatchEvent(new Event("click", { bubbles: true })); all.dispatchEvent(new Event("click", { bubbles: true })); @@ -430,7 +434,11 @@ assert.lengthOf(output.querySelectorAll(".item"), len); Kubofya kitufe cha `#books` kunapaswa kuonyesha seti husika ya bidhaa katika kipengele cha `#output`. ```js +const books = document.getElementById("books"); +const clothing = document.getElementById("clothing"); +const output = document.getElementById("output"); const len = products.items.length; + assert.isAtLeast(len, 3); let count = 0; products.items.forEach(i => { @@ -446,7 +454,11 @@ assert.lengthOf(output.querySelectorAll(".item"), count); Kubofya kitufe cha `#electronics` kunapaswa kuonyesha seti husika ya bidhaa katika kipengele cha `#output`. ```js +const electronics = document.getElementById("electronics"); +const clothing = document.getElementById("clothing"); +const output = document.getElementById("output"); const len = products.items.length; + assert.isAtLeast(len, 3); let count = 0; products.items.forEach(i => { @@ -462,7 +474,11 @@ assert.lengthOf(output.querySelectorAll(".item"), count); Kubofya kitufe cha `#clothing` kunapaswa kuonyesha seti husika ya bidhaa katika kipengele cha `#output`. ```js +const books = document.getElementById("books"); +const clothing = document.getElementById("clothing"); +const output = document.getElementById("output"); const len = products.items.length; + assert.isAtLeast(len, 3); let count = 0; products.items.forEach(i => { @@ -478,6 +494,7 @@ assert.lengthOf(output.querySelectorAll(".item"), count); Bidhaa zote zinapaswa kuonekana kwa chaguo-msingi wakati ukurasa unapopakia. Tumia tukio la `DOMContentLoaded` kuhakikisha hilo. ```js +const output = document.getElementById("output"); const len = products.items.length; assert.isAtLeast(len, 3); document.dispatchEvent(new Event("DOMContentLoaded")); diff --git a/curriculum/challenges/swahili/blocks/lab-reusable-footer/673b02b03134b04637bf7055.md b/curriculum/challenges/swahili/blocks/lab-reusable-footer/673b02b03134b04637bf7055.md index 9b3c2c84254..1e307142d70 100644 --- a/curriculum/challenges/swahili/blocks/lab-reusable-footer/673b02b03134b04637bf7055.md +++ b/curriculum/challenges/swahili/blocks/lab-reusable-footer/673b02b03134b04637bf7055.md @@ -8,7 +8,7 @@ demoType: onClick # --description-- -**Lengo:** Timiza hadithi za watumizi zilizo hapa chini na upite vipimo vyote ili kumaliza maabara hii. +**Lengo:** Timiza hadithi za watumizi zilizo hapa chini na upite vipimo vyote ili kumaliza maabara. **Hadithi za watumizi:** @@ -16,7 +16,7 @@ demoType: onClick 2. Sehemu yako ya `Footer` inapaswa kurudisha kipengele cha `footer` kinachojumuisha vipengele vyote vingine. 3. Kipengele chako cha `footer` kinapaswa kuwa na: - - Angalau orodha isiyopangwa tatu, kila moja ikiwa na angalau vitu viwili vya orodha. +- Angalau orodha isiyopangwa tatu, kila moja ikiwa na angalau vitu viwili vya orodha. - Angalau kipengele kimoja cha aya chenye alama ya hakimiliki `©`. - Angalau viungo vitatu vyenye thamani ya `href` imewekwa kuwa `#` na maudhui ya kiungo kuwa ikoni au maandishi unayochagua. @@ -53,7 +53,7 @@ Kipengele chako cha `footer` kinapaswa kuwa na angalau orodha isiyopangwa tatu. assert.isAtLeast(document.querySelectorAll('ul').length, 3); ``` -Kila orodha isiyopangwa inapaswa kuwa na angalau vitu viwili vya orodha. +Orodha zako zisizopangwa kila moja inapaswa kuwa na angalau vitu viwili vya orodha. ```js const uls = [...document.querySelectorAll('ul')]; @@ -84,7 +84,7 @@ const links = document.querySelectorAll('a[href="#"]'); assert.isAtLeast(links.length, 3); ``` -Hakuna kiungo chako kinapaswa kuwa tupu. +Viungo vyako havipaswi kuwa tupu. ```js const links = [...document.querySelectorAll('a[href="#"]')]; diff --git a/curriculum/challenges/swahili/blocks/lab-sentence-maker/66c057041df6394ca796bf33.md b/curriculum/challenges/swahili/blocks/lab-sentence-maker/66c057041df6394ca796bf33.md index d8821fd856f..c59f6440ab6 100644 --- a/curriculum/challenges/swahili/blocks/lab-sentence-maker/66c057041df6394ca796bf33.md +++ b/curriculum/challenges/swahili/blocks/lab-sentence-maker/66c057041df6394ca796bf33.md @@ -7,11 +7,11 @@ dashedName: build-a-sentence-maker # --description-- -Katika maabara hii, utaunda hadithi mbili tofauti kwa kutumia kiolezo cha sentensi. Utatumia vigezo kuhifadhi sehemu tofauti za hadithi kisha utoe hadithi hizo kwenye konsoli. +Katika maabara hii, utaunda hadithi mbili tofauti ukitumia kiolezo cha sentensi. Uta tumia vigezo kuhifadhi sehemu tofauti za hadithi kisha uandike hadithi hizo kwenye konsoli. -**Lengo:** Timiza hadithi za mtumizi zilizo hapa chini na upite vipimo vyote ili kumaliza maabara. +**Lengo:** Timiza hadithi za watumizi zilizo hapa chini na upite vipimo vyote ili kumaliza maabara. -**Hadithi za mtumizi:** +**Hadithi za watumizi:** 1. Unapaswa kutangaza vigezo vifuatavyo kwa kutumia `let`: @@ -26,19 +26,26 @@ Katika maabara hii, utaunda hadithi mbili tofauti kwa kutumia kiolezo cha senten 1. Unapaswa kutangaza kigezo cha `firstStory`. -1. Unapaswa kutumia kiolezo cha hadithi kilicho hapa chini kuunda hadithi ya kwanza na kuiweka kwenye kigezo cha `firstStory`: `"Once upon a time, there was a(n) [adjective] [noun] who loved to eat [noun2]. The [noun] lived in a [place] and had [adjective2] nostrils that blew fire when it was [verb]."`; +1. Unapaswa kutumia kiolezo cha hadithi kilicho hapa chini kuunda hadithi ya kwanza na kuiweka kwenye kigezo cha `firstStory`: `"Once upon a time, there was a(n) [adjective] [noun] who loved to eat [noun2]. The [noun] lived in a [place] and had [adjective2] nostrils that blew fire when it was [verb]."` -1. Unapaswa kutoa hadithi yako ya kwanza kwenye konsoli kwa kutumia ujumbe `"First story: [firstStory]"`. +1. Unapaswa kuandika hadithi yako ya kwanza kwenye konsoli ukitumia ujumbe `"First story: [firstStory]"`. 1. Unapaswa kuweka thamani mpya kwa vigezo vyako vya `adjective`, `noun`, `verb`, `place`, `adjective2`, na `noun2`. 1. Unapaswa kutangaza kigezo cha `secondStory`. -1. Unda hadithi nyingine kwa kutumia kiolezo kile kile na uiweke kwenye kigezo cha `secondStory`. +1. Unapaswa kuunda hadithi nyingine ukitumia kiolezo kile kile na kuiweka kwenye kigezo cha `secondStory`. -1. Unapaswa kutoa hadithi yako ya pili kwenye konsoli kwa kutumia ujumbe `"Second story: [secondStory]"`. +1. Unapaswa kuandika hadithi yako ya pili kwenye konsoli ukitumia ujumbe `"Second story: [secondStory]"`. +# --before-each-- + +```js +const spy = __helpers.spyOn(console, 'log'); +const getLogs = () => spy.calls.map(call => call.join(' ')); +``` + # --hints-- Unapaswa kutangaza kigezo cha `adjective`. @@ -142,12 +149,10 @@ assert.match( ); ``` -Unapaswa kuandika hadithi yako ya kwanza kwa kutumia ujumbe `"First story: [firstStory]"`. +Unapaswa kuandika hadithi yako ya kwanza kwenye konsoli ukitumia ujumbe `"First story: [firstStory]"`. ```js -const condition1 = /console\.log\(\s*["']First\s+story:\s+["']\s*\+\s*firstStory\s*\);?/gm.test(code); -const condition2 = /console\.log\(\s*`First\s+story:\s+\$\{firstStory\}`\s*\);?/gm.test(code); -assert.isTrue(condition1 || condition2); +assert.include(getLogs(), `First story: ${firstStory}`); ``` Unapaswa kutangaza kigezo cha `secondStory`. @@ -208,15 +213,13 @@ assert.match( ); ``` -Unapaswa kuandika hadithi yako ya pili kwa kutumia muundo `"Second story: [secondStory]"`. +Unapaswa kuandika hadithi yako ya pili kwenye konsoli ukitumia ujumbe `"Second story: [secondStory]"`. ```js -const condition1 = /console\.log\(\s*["']Second\s+story:\s+["']\s*\+\s*secondStory\s*\);?/gm.test(code); -const condition2 = /console\.log\(\s*`Second\s+story:\s+\$\{secondStory\}`\s*\);?/gm.test(code); -assert.isTrue(condition1 || condition2); +assert.include(getLogs(), `Second story: ${secondStory}`); ``` -`firstStory` haipaswi kuwa sawa na `secondStory`. +Hadithi yako ya `firstStory` haipaswi kuwa sawa na hadithi yako ya `secondStory`. ```js assert.notEqual(firstStory, secondStory); @@ -255,3 +258,4 @@ const secondStory = `Once upon a time, there was a(n) ${adjective} ${noun} who l console.log("Second story: " + secondStory); ``` + diff --git a/curriculum/challenges/swahili/blocks/lab-weather-app/66f12a88741aeb16b9246c59.md b/curriculum/challenges/swahili/blocks/lab-weather-app/66f12a88741aeb16b9246c59.md index f2803c90f6a..218936813af 100644 --- a/curriculum/challenges/swahili/blocks/lab-weather-app/66f12a88741aeb16b9246c59.md +++ b/curriculum/challenges/swahili/blocks/lab-weather-app/66f12a88741aeb16b9246c59.md @@ -333,7 +333,7 @@ assert.strictEqual( ); ``` -Ndani ya kipengele cha `select` kunapaswa kuwa na vipengele 6 vya `option`, kila kimoja kwa kila jiji lifuatayo: Paris, London, Tokyo, Los Angeles, Chicago, New York. +Mbali na chaguo la kwanza lisilo na maandishi, kipengele cha `select` kinapaswa kuwa na vipengele 6 vya `option`, kila kimoja kwa kila mojawapo ya miji ifuatayo: Paris, London, Tokyo, Los Angeles, Chicago, New York. ```js ['Paris', 'London', 'Tokyo', 'Los Angeles', 'Chicago', 'New York'].forEach( @@ -342,7 +342,7 @@ Ndani ya kipengele cha `select` kunapaswa kuwa na vipengele 6 vya `option`, kila `select > option[value="${city.toLowerCase()}"]` ); assert.exists(el); - assert.strictEqual(el.innerText.trim(), city); + assert.strictEqual(el.textContent.trim(), city); } ); ``` diff --git a/curriculum/challenges/swahili/blocks/learn-basic-css-by-building-a-cafe-menu/5f3ef6e03d719d5ac4738993.md b/curriculum/challenges/swahili/blocks/learn-basic-css-by-building-a-cafe-menu/5f3ef6e03d719d5ac4738993.md index ad9def87b67..8354eb34f6c 100644 --- a/curriculum/challenges/swahili/blocks/learn-basic-css-by-building-a-cafe-menu/5f3ef6e03d719d5ac4738993.md +++ b/curriculum/challenges/swahili/blocks/learn-basic-css-by-building-a-cafe-menu/5f3ef6e03d719d5ac4738993.md @@ -7,7 +7,7 @@ dashedName: step-56 # --description-- -Upana wa sasa wa menyu utaendelea kuchukua asilimia 80 ya upana wa kipengele cha `body`. Kwenye skrini pana sana, kahawa na dessert zinaonekana mbali sana na bei zao. +Upana wa sasa wa menyu utaendelea kuchukua `80%` ya upana wa kipengele cha `body`. Kwenye skrini pana sana, kahawa na vitafunwa vinaonekana kuwa mbali sana na bei zao. Ongeza sifa ya `max-width` kwa darasa la `menu` yenye thamani ya `500px` ili kuzuia isikue sana kwa upana. @@ -117,3 +117,4 @@ h1, h2, p { width: 25%; } ``` + diff --git a/curriculum/challenges/swahili/blocks/learn-how-to-plan-future-events/67531709d628ef047202e6ae.md b/curriculum/challenges/swahili/blocks/learn-how-to-plan-future-events/67531709d628ef047202e6ae.md index 9fa536bb0cc..86cf371dc94 100644 --- a/curriculum/challenges/swahili/blocks/learn-how-to-plan-future-events/67531709d628ef047202e6ae.md +++ b/curriculum/challenges/swahili/blocks/learn-how-to-plan-future-events/67531709d628ef047202e6ae.md @@ -12,7 +12,7 @@ Tazama video hapa chini ili kuelewa muktadha wa mafundisho yajayo. # --assignment-- -Tazama video.. +Tazama video. # --scene-- diff --git a/curriculum/challenges/swahili/blocks/learn-present-perfect-while-talking-about-accessibility/671b98e9b7c4854e93044e64.md b/curriculum/challenges/swahili/blocks/learn-present-perfect-while-talking-about-accessibility/671b98e9b7c4854e93044e64.md index 469ea5d7259..15c34c6a7c2 100644 --- a/curriculum/challenges/swahili/blocks/learn-present-perfect-while-talking-about-accessibility/671b98e9b7c4854e93044e64.md +++ b/curriculum/challenges/swahili/blocks/learn-present-perfect-while-talking-about-accessibility/671b98e9b7c4854e93044e64.md @@ -1,6 +1,6 @@ --- id: 671b98e9b7c4854e93044e64 -title: "Dialogue 2: Closed Captioning Challenges" +title: "Mazungumzo 2: Changamoto za Maelezo ya Picha Zilizofungwa" challengeType: 21 dashedName: dialogue-2-closed-captioning-challenges lang: en-US @@ -62,7 +62,7 @@ Tazama video. "startTime": 5.34, "finishTime": 9.26, "dialogue": { - "text": "Yes, for some reason it hasn't been displaying correctly for some users.", + "text": "Yes. For some reason, it hasn't been displaying correctly for some users.", "align": "right" } }, diff --git a/curriculum/challenges/swahili/blocks/learn-present-perfect-while-talking-about-accessibility/671f403c1d4e8a5e046065a0.md b/curriculum/challenges/swahili/blocks/learn-present-perfect-while-talking-about-accessibility/671f403c1d4e8a5e046065a0.md index 366eb17650a..58d45b267e5 100644 --- a/curriculum/challenges/swahili/blocks/learn-present-perfect-while-talking-about-accessibility/671f403c1d4e8a5e046065a0.md +++ b/curriculum/challenges/swahili/blocks/learn-present-perfect-while-talking-about-accessibility/671f403c1d4e8a5e046065a0.md @@ -6,7 +6,7 @@ dashedName: task-36 lang: en-US --- -<!-- (Audio) James: Yes. For some reason, It hasn't been displaying correctly for some users. --> +<!-- (Audio) James: Yes. For some reason, it hasn't been displaying correctly for some users. --> # --instructions-- @@ -16,7 +16,7 @@ Sikiliza sauti na ukamilishe sentensi ifuatayo. ## --sentence-- -`Yes. For some reason, It BLANK BLANK BLANK correctly for some users.` +`Yes. For some reason, it BLANK BLANK BLANK correctly for some users.` ## --blanks-- @@ -83,7 +83,7 @@ Sentensi iko katika aina hasi ya wakati wa `Present Perfect Continuous`, ambao h "startTime": 1, "finishTime": 4.92, "dialogue": { - "text": "Yes, for some reason it hasn't been displaying correctly for some users.", + "text": "Yes. For some reason, it hasn't been displaying correctly for some users.", "align": "center" } }, diff --git a/curriculum/challenges/swahili/blocks/learn-present-perfect-while-talking-about-accessibility/671f456994635c6085054cbd.md b/curriculum/challenges/swahili/blocks/learn-present-perfect-while-talking-about-accessibility/671f456994635c6085054cbd.md index 82e90bc7e24..d0f6c2689ab 100644 --- a/curriculum/challenges/swahili/blocks/learn-present-perfect-while-talking-about-accessibility/671f456994635c6085054cbd.md +++ b/curriculum/challenges/swahili/blocks/learn-present-perfect-while-talking-about-accessibility/671f456994635c6085054cbd.md @@ -6,7 +6,7 @@ dashedName: task-37 lang: en-US --- -<!-- (Audio) James: Yes. For some reason, It hasn't been displaying correctly for some users. --> +<!-- (Audio) James: Yes. For some reason, it hasn't been displaying correctly for some users. --> # --instructions-- @@ -16,7 +16,7 @@ Sikiliza sauti na ukamilishe sentensi ifuatayo. ## --sentence-- -`Yes. For some reason, It hasn't been displaying BLANK for some BLANK.` +`Yes. For some reason, it hasn't been displaying BLANK for some BLANK.` ## --blanks-- @@ -79,7 +79,7 @@ Nomino hii katika umbo la wingi inarejelea watu wanaoshirikiana na bidhaa au hud "startTime": 1, "finishTime": 4.92, "dialogue": { - "text": "Yes, for some reason it hasn't been displaying correctly for some users.", + "text": "Yes. For some reason, it hasn't been displaying correctly for some users.", "align": "center" } }, diff --git a/curriculum/challenges/swahili/blocks/learn-present-perfect-while-talking-about-accessibility/6720cf38beae8c4f1d7af1c0.md b/curriculum/challenges/swahili/blocks/learn-present-perfect-while-talking-about-accessibility/6720cf38beae8c4f1d7af1c0.md index e3ec407ea07..a0b055fe031 100644 --- a/curriculum/challenges/swahili/blocks/learn-present-perfect-while-talking-about-accessibility/6720cf38beae8c4f1d7af1c0.md +++ b/curriculum/challenges/swahili/blocks/learn-present-perfect-while-talking-about-accessibility/6720cf38beae8c4f1d7af1c0.md @@ -10,7 +10,7 @@ lang: en-US # --description-- -Huu ni uhakiki wa mazungumzo yote uliyoyasoma sasa hivi. +Hii ni ukaguzi wa mazungumzo yote uliyosoma hivi karibuni. # --instructions-- @@ -22,7 +22,7 @@ Andika maneno au misemo ifuatayo mahali sahihi: `rendering consistently`, `close `Alice: James, have you heard about the BLANK on our video platform?` -`James: Yes. For some reason, It hasn't been BLANK for some users. The captions are misaligned and BLANK, which isn't good for accessibility.` +`James: Yes. For some reason, it hasn't been BLANK for some users. The captions are misaligned and BLANK, which isn't good for accessibility.` `Alice: Exactly. Do you know if it's been affecting all the videos or just a few?` diff --git a/curriculum/challenges/swahili/blocks/lecture-css-specificity-the-cascade-algorithm-and-inheritance/672aa62178d5ff57fe4f98e0.md b/curriculum/challenges/swahili/blocks/lecture-css-specificity-the-cascade-algorithm-and-inheritance/672aa62178d5ff57fe4f98e0.md index e02094692d6..8f3ab0eac34 100644 --- a/curriculum/challenges/swahili/blocks/lecture-css-specificity-the-cascade-algorithm-and-inheritance/672aa62178d5ff57fe4f98e0.md +++ b/curriculum/challenges/swahili/blocks/lecture-css-specificity-the-cascade-algorithm-and-inheritance/672aa62178d5ff57fe4f98e0.md @@ -43,14 +43,14 @@ Baada ya hapo, vichaguzi vya ID vina kiwango cha juu cha kipaumbele. ```html <link rel="stylesheet" href="styles.css"> -<p id="para">Red paragraph</p> +<p id="para-1">Red paragraph</p> <p>Other paragraph</p> <p>Another paragraph</p> <p>Yet another paragraph</p> ``` ```css -#para { +#para-1 { color: red; } @@ -67,24 +67,33 @@ Mifano ni pamoja na vichaguzi vya darasa la vitu kama `.container` na `.button`, **KUMBUKA**: Utajifunza zaidi kuhusu darasa la bandia katika mafundisho yajayo. -Katika mfano huu, aya ya kwanza itakuwa nyekundu kwa sababu kichaguzi cha ID kina umahiri wa juu zaidi kuliko darasa la vitu na vichaguzi vya aina. Vipengele vya `.example-para` vitakuwa na rangi ya kijani wakati vipengele vingine vya aya vitakuwa na rangi ya bluu. +Katika mfano huu: + +- Aya ya kwanza itakuwa nyekundu kwa sababu kichaguzi cha ID kina umahiri zaidi kuliko darasa la vitu na vichaguzi vya aina. +- Aya ya pili yenye kichaguzi cha darasa la vitu `.example-para` itakuwa na rangi ya kijani. +- Aya ya tatu yenye vichaguzi vya ID `#para-3` na darasa la vitu `.example-para` itakuwa na rangi ya zambarau. +- Aya iliyobaki itakuwa na rangi ya bluu. :::interactive_editor ```html <link rel="stylesheet" href="styles.css"> -<p id="para">Example paragraph</p> +<p id="para-1">Example paragraph</p> <p class="example-para">Other paragraph</p> -<p class="example-para">Another paragraph</p> +<p id="para-3" class="example-para">Another paragraph</p> <p>Yet another paragraph</p> ``` ```css -#para { +#para-1 { color: red; } +#para-3 { + color: purple; +} + .example-para { color: green; } @@ -105,13 +114,13 @@ Vichaguzi vya aina, kama `div` na `h1`, na vipengele vya bandia kama `::before` ```html <link rel="stylesheet" href="styles.css"> -<p id="para">Example paragraph</p> +<p id="para-1">Example paragraph</p> <p>Other paragraph</p> <p>Yet another paragraph</p> ``` ```css -#para { +#para-1 { color: red; } @@ -130,7 +139,7 @@ Hapa kuna mfano wa kuweka rangi kwa vipengele vyote kuwa nyekundu kwa kutumia ki ```html <link rel="stylesheet" href="styles.css"> -<p id="para">Example paragraph</p> +<p id="para-1">Example paragraph</p> <p>Other paragraph</p> <p>Yet another paragraph</p> ``` @@ -140,7 +149,7 @@ Hapa kuna mfano wa kuweka rangi kwa vipengele vyote kuwa nyekundu kwa kutumia ki color: red; } -#para { +#para-1 { color: green; } diff --git a/curriculum/challenges/swahili/blocks/lecture-express-middleware/69f42d414b7626e21a922794.md b/curriculum/challenges/swahili/blocks/lecture-express-middleware/69f42d414b7626e21a922794.md index f3e497449da..4d787f89778 100644 --- a/curriculum/challenges/swahili/blocks/lecture-express-middleware/69f42d414b7626e21a922794.md +++ b/curriculum/challenges/swahili/blocks/lecture-express-middleware/69f42d414b7626e21a922794.md @@ -9,9 +9,7 @@ dashedName: what-is-error-handling-middleware Middleware ya kushughulikia makosa katika Express ni aina maalum ya programu ya kati inayotumika kushughulikia makosa yanayotokea wakati wa mzunguko wa ombi-jibu. Ni muhimu kwa kugundua makosa yasiyotegemewa, kuyarekodi, na kutoa majibu yanayofaa kwa mteja. -Kama ulivyoona katika funzo la awali kuhusu kushughulikia makosa, middleware ya kushughulikia makosa ya Express ina vigezo vinne: `err`, `req`, `res`, na `next`. Middleware hii huanzishwa wakati kosa linapotupwa kwa kitendakazi cha `next()`. - -Hapa kuna ukumbusho wa sintaksia tena: +Programu ya kati ya Express ya kushughulikia makosa ina vigezo vinne: `err`, `req`, `res`, na `next`. Programu hii ya kati huanzishwa wakati kosa linapopita kwa kitendakazi cha `next()`. Hapa kuna sintaksia: ```js app.use((err, req, res, next) => { diff --git a/curriculum/challenges/swahili/blocks/lecture-express-middleware/69f42d414b7626e21a922795.md b/curriculum/challenges/swahili/blocks/lecture-express-middleware/69f42d414b7626e21a922795.md index 97bf0909b2c..181855ea3c6 100644 --- a/curriculum/challenges/swahili/blocks/lecture-express-middleware/69f42d414b7626e21a922795.md +++ b/curriculum/challenges/swahili/blocks/lecture-express-middleware/69f42d414b7626e21a922795.md @@ -13,45 +13,45 @@ Express hutoa aina mbalimbali za vitendakazi vya programu ya kati iliyojengwa nd 1. `express.json()`: Programu ya kati iliyojengwa ndani inayochanganuzi mzigo wa data wa JSON unaoingia. -```js -app.use(express.json()) -``` + ```js + app.use(express.json()) + ``` 1. `express.static()`: Programu ya kati ya kuhudumia mafaili ya static kama picha, CSS, na mafaili ya JavaScript. -```js -app.use(express.static('public')) -``` + ```js + app.use(express.static('public')) + ``` 1. `express.urlencoded()`: Programu ya kati inayochanganuzi maombi yanayoingia yenye mzigo wa data wa URL-encoded, muundo unaotumwa kawaida na fomu za HTML. Hufanya data iliyochanganuliwa ipatikane kwenye `req.body`. -```js -app.use(express.urlencoded({ extended: true })) -``` + ```js + app.use(express.urlencoded({ extended: true })) + ``` **Sasa, hapa kuna baadhi ya mifano ya programu ya kati ya wahusika wa tatu:** 1. `cors`: Programu maarufu ya kati ya wahusika wa tatu kuwezesha Kushirikiana kwa Asili za Mbalimbali (Cross-Origin Resource Sharing). -```bash -npm install cors -``` + ```bash + npm install cors + ``` -```js -const cors = require('cors') -app.use(cors()) -``` + ```js + const cors = require('cors') + app.use(cors()) + ``` 1. `morgan`: Programu ya kati ya kurekodi maombi ya HTTP. -```bash -npm install morgan -``` + ```bash + npm install morgan + ``` -```js -const morgan = require('morgan') -app.use(morgan('tiny')) -``` + ```js + const morgan = require('morgan') + app.use(morgan('tiny')) + ``` Sasa, tuchunguze mfano wa kutumia programu ya kati iliyojengwa ndani na ya wahusika wa tatu pamoja: diff --git a/curriculum/challenges/swahili/blocks/lecture-importance-of-semantic-html/672990ecf71a852804ababe7.md b/curriculum/challenges/swahili/blocks/lecture-importance-of-semantic-html/672990ecf71a852804ababe7.md index da810bf9dfb..6f469ba0afa 100644 --- a/curriculum/challenges/swahili/blocks/lecture-importance-of-semantic-html/672990ecf71a852804ababe7.md +++ b/curriculum/challenges/swahili/blocks/lecture-importance-of-semantic-html/672990ecf71a852804ababe7.md @@ -11,6 +11,10 @@ HTML ya uwasilishaji inalenga muonekano na mtindo wa maudhui. Katika siku za mwa Vipengele vingi vya HTML vya uwasilishaji vimeachwa kutumika, ambayo inamaanisha kuwa vimepitwa na wakati na havipendekezwi tena. Kuna njia bora za kupata matokeo sawa. Hata hivyo, ni muhimu kujua kuwa vipo, kwa hivyo tutaangalia baadhi ya mifano. +## Vipengele vya HTML vya Uwasilishaji + +### Kipengele cha `font` + Kipengele cha `font` ni kipengele kilichoachwa kutumika kinachotumika kuweka ukubwa wa fonti na rangi ya maandishi. Hapa kuna mfano wa kipengele cha `font`. Washia mhariri wa kiingilizi na badilisha ukubwa kutoka 5 hadi 7 ili kuona fonti ikiongezeka. @@ -27,6 +31,8 @@ Mfano huu unaweka rangi ya maandishi kuwa `blue` na ukubwa kuwa thamani ya `5`. Ingawa kipengele hiki bado kinafanya kazi, haufai kukitumia kwa sababu ukubwa wa fonti na rangi vinapaswa kuwekwa kila mara katika CSS, si katika HTML. +### Kipengele cha `center` + Kipengele cha `center` ni kipengele kingine kilichoachwa kutumika kinachotumika kuweka maudhui katikati kwa usawa ndani ya kontena yake. Hapa kuna mfano wa kipengele cha `center` kinachoshikilia maandishi na kipengele cha aya. Washia mhariri wa kiingilizi na ongeza lebo za `center` kuzunguka `<p>Another example text.</p>` ili kuona imewekwa katikati ya ukurasa. @@ -44,6 +50,8 @@ Washia mhariri wa kiingilizi na ongeza lebo za `center` kuzunguka `<p>Another ex ::: +### Kipengele cha `big` + Na kisha, tuna kipengele cha `big`. Hiki ni kipengele kingine cha HTML cha uwasilishaji kilichoachwa kutumika kinachofanya maandishi yaliyofungwa kuwa na kiwango kimoja kikubwa zaidi kuliko maandishi yanayozunguka. Hapa tuna mfano unaoelezea aya yenye sehemu mbili. Washia mhariri wa kiingilizi na ongeza lebo za `big` kuzunguka `Some other text` na uone mabadiliko katika dirisha la mapitio. @@ -64,6 +72,8 @@ Kumbuka kuwa ukubwa wa fonti unapaswa kuwekwa kila mara kwa CSS, kwa hivyo haufa Haya yalikuwa mifano ya vipengele vya HTML vya uwasilishaji. Lakini vyote vimeachwa kutumika na havipendekezwi tena. Basi unapaswa kutumia nini badala yake? Tuchunguze. +## HTML ya Kimaana + HTML ya semantic sasa ni mbinu inayopendekezwa. Inaelezea maudhui ya vipengele, hivyo ni rahisi kusoma, kuelewa, na kutunza. Matafuta ya mtandao yanaweza kuelewa tovuti yako kwa urahisi unapotumia HTML ya semantic. Pia ni msaada kwa madhumuni ya ufikikaji, kwa sababu visomaji vya skrini vinahitaji taarifa za semantic kuelezea kilicho kwenye ukurasa wa mtandao. @@ -75,6 +85,8 @@ Mifano ya vipengele vya HTML vya semantic ni pamoja na: - Kipengele cha `section` kwa kuunganisha taarifa zinazohusiana. - Kipengele cha `figure` kwa michoro na michoro ya maelezo. +### Mfano wa HTML ya Kimaana + Huu ni mfano wa kipengele cha `header` kinachoshikilia kipengele cha sehemu ya urambazaji. Washia mhariri wa kiingilizi na ongeza `<a href="#">Products</a>` ndani ya `nav` na uone mabadiliko katika dirisha la mapitio. @@ -97,6 +109,8 @@ Washia mhariri wa kiingilizi na ongeza `<a href="#">Products</a>` ndani ya `nav` Vipengele vya semantic vinaonyesha wazi kusudi lao ndani ya muundo wa HTML. Kuna vipengele vingi tofauti vya HTML vya semantic. Hakika utapata kimoja kinachofaa mahitaji ya mradi wako. +## Muhtasari + Kazi nzuri. Sasa unajua tofauti kati ya HTML ya uwasilishaji na semantic: HTML ya semantic inaelezea maudhui, wakati HTML ya uwasilishaji inalenga muonekano. # --questions-- diff --git a/curriculum/challenges/swahili/blocks/lecture-introduction-to-javascript-libraries-and-frameworks/6734e88cc46e6dc679420040.md b/curriculum/challenges/swahili/blocks/lecture-introduction-to-javascript-libraries-and-frameworks/6734e88cc46e6dc679420040.md index 4ab2a806518..699416880dc 100644 --- a/curriculum/challenges/swahili/blocks/lecture-introduction-to-javascript-libraries-and-frameworks/6734e88cc46e6dc679420040.md +++ b/curriculum/challenges/swahili/blocks/lecture-introduction-to-javascript-libraries-and-frameworks/6734e88cc46e6dc679420040.md @@ -13,7 +13,7 @@ Moja ya zana maarufu za kusanidi miradi ni Vite. Vite, ambayo inamaanisha "harak Ili kuanzisha mradi mpya kwa kutumia Vite, utahitaji kutumia mstari wa amri. Ikiwa unatumia kompyuta ya Windows, basi unaweza tumia Command Prompt au Windows PowerShell. Ikiwa unatumia Mac, basi unaweza tumia programu ya Terminal. -Iwapo bado huna Node.js imewekwa, ambayo inahitajika ili npm ifanye kazi, hapa kuna unganisho wa tovuti rasmi ya Node.js: https://nodejs.org. Fuata maelekezo ya usakinishaji kisha rudi hapa kuendelea na usakinishaji wa React. +Ikiwa huna Node.js imewekwa, ambayo inahitajika ili npm ifanye kazi, hapa kuna unganisho wa tovuti rasmi ya Node.js: [nodejs.org](https://nodejs.org). Fuata maelekezo ya usakinishaji, kisha rudi hapa kuendelea na usakinishaji wa React. Mara mstari wa amri ukiwa wazi, unaweza kutumia amri ifuatayo: @@ -36,7 +36,7 @@ npm install Amri ya `cd my-react-app` inahakikisha unabadilisha hadi saraka sahihi ambapo mradi wako uko. -Amri ya `npm install` hutumika kusakinisha tegemezi zinazohitajika ili kuendesha mradi wako wa React ipasavyo. Tegemezi ni maktaba au vifurushi ambavyo mradi wako wa React unahitaji ili ufanye kazi vizuri, kama React yenyewe, ReactDOM, au vifurushi vingine vya watu wa tatu vinavyotoa utendaji zaidi. +Amri ya `npm install` hutumika kusakinisha vitegemezi vinavyohitajika ili kuendesha mradi wako wa React ipasavyo. Vitegemezi ni maktaba au vifurushi ambavyo mradi wako wa React unahitaji ili ufanye kazi vizuri, kama vile React yenyewe, `react-dom`, au vifurushi vingine vya wahusika wengine vinavyotoa utendaji zaidi. Kuendesha `npm install` kutasoma faili ya `package.json` katika saraka ya mradi wako na kusakinisha tegemezi zote zilizoorodheshwa hapo, ikikuwezesha kujenga na kuendesha programu yako ya React bila kukosa sehemu muhimu yoyote. @@ -50,11 +50,11 @@ Ili kuendesha mradi wako, tumia amri ya `npm run dev` kisha fungua kichupo kipya Utapata kuona templeti ya kuanzia ambayo Vite imetoa kwako. -Iwapo unahitaji kusitisha seva ya ndani, bonyeza `CTRL + C` kwenye mstari wa amri. +Ikiwa unahitaji kusitisha seva ya ndani, bonyeza `Ctrl + C` kwenye mstari wa amri. -Ili kuona msimbo wa templeti hii ya kuanzia, unaweza kuingia ndani ya mradi wako katika saraka ya `src` na utapata faili ya `App.jsx`. +Ili kuona msimbo wa kiolezo hiki cha kuanzia, unaweza kufungua folda ya `src` ndani ya mradi wako, ambapo unapaswa kuona faili la `App.jsx`. -Kutoka hapo unaweza kuanza kubadilisha faili, kuhifadhi mabadiliko yako na kuona mabadiliko mapya yanaonyeshwa kwenye kivinjari. +Kutoka hapo unaweza kubadilisha faili, kuhifadhi mabadiliko yako, na kuangalia yanavyoonekana kwenye kivinjari. Na kwa hayo, uko tayari kuanza kujenga programu yako ya React! diff --git a/curriculum/challenges/swahili/blocks/lecture-introduction-to-javascript/672d49959621885e9d3e672c.md b/curriculum/challenges/swahili/blocks/lecture-introduction-to-javascript/672d49959621885e9d3e672c.md index c0db11bc4b6..cb41797779f 100644 --- a/curriculum/challenges/swahili/blocks/lecture-introduction-to-javascript/672d49959621885e9d3e672c.md +++ b/curriculum/challenges/swahili/blocks/lecture-introduction-to-javascript/672d49959621885e9d3e672c.md @@ -72,6 +72,16 @@ console.log(age); // 25 ::: +Wakati variable iliyo tangazwa na `let` inaweza kupewa thamani tena, haiwezi kutangazwa tena. Ikiwa utajaribu kutangaza variable ile ile tena kwa kutumia `let`, utapata kosa: + +```js +let age = 25; + +let age = 90; // SyntaxError: Identifier 'age' has already been declared +``` + +Hali hiyo hiyo inahusu `const`: variable iliyo tangazwa na `const` haiwezi kutangazwa tena pia. + Vigezo vilivyotangazwa kwa `const` lazima viwe na thamani wakati wa tamko. Ikiwa utajaribu kutangaza kigezo cha `const` bila kupewa thamani, utapata kosa: ```js diff --git a/curriculum/challenges/swahili/blocks/lecture-understanding-aria-expanded-aria-live-and-common-aria-states/672a54dff9dc439089f1a219.md b/curriculum/challenges/swahili/blocks/lecture-understanding-aria-expanded-aria-live-and-common-aria-states/672a54dff9dc439089f1a219.md index 98a3b7d9fff..a6bb1589578 100644 --- a/curriculum/challenges/swahili/blocks/lecture-understanding-aria-expanded-aria-live-and-common-aria-states/672a54dff9dc439089f1a219.md +++ b/curriculum/challenges/swahili/blocks/lecture-understanding-aria-expanded-aria-live-and-common-aria-states/672a54dff9dc439089f1a219.md @@ -15,6 +15,8 @@ Kwa sababu makini ya kusoma kwa kisomaji cha skrini unaweza kuwa mahali pamoja k Kuna thamani tatu zinazowezekana kwa sifa hii, kulingana na kipaumbele cha taarifa. +## Thamani ya `assertive` + Ikiwa utaweka `aria-live` kwa thamani ya `assertive` hiyo ina maana kwamba sasisho ni muhimu sana. Ina kipaumbele cha juu kabisa, hivyo mtumiaji anapaswa kujulishwa mara moja. Hii ina maana kwamba kisomaji cha skrini kitakatisha matangazo yoyote kinayoyafanya kwa sasa ili kutangaza mabadiliko ya maudhui katika eneo la moja kwa moja. Kukatishwa kwa namna hii kunaweza kuwa na usumbufu mkubwa, kwa hivyo thamani ya `assertive` inapaswa kutumika tu kwa taarifa za haraka au muhimu sana. @@ -81,6 +83,8 @@ document.addEventListener("DOMContentLoaded", () => { ::: +## Thamani ya `polite` + Thamani inayofuata kwa kipaumbele ni `polite`. Thamani hii ina maana kwamba sasisho si la dharura, hivyo kisomaji cha skrini kinaweza kusubiri hadi matangazo yoyote ya sasa yatakapokamilika au mtumiaji atakapomaliza kuandika kabla ya kutangaza sasisho hilo. Maeneo mengi ya moja kwa moja yatatumia thamani ya `polite`. @@ -147,10 +151,16 @@ document.addEventListener("DOMContentLoaded", () => { ::: +## Thamani ya `off` + Thamani ya kipaumbele cha chini kabisa kwa `aria-live` ni `off` ambayo ina maana kwamba sasisho halitatangazwa isipokuwa maudhui yako katika kipengele ambacho kwa sasa kina makini ya kibodi. Kwa kweli, thamani hii karibu haitumiki kwa sababu matumizi yake ni nadra sana na haitekelezwi kwa usawa (ikiwa hata inatekelezwa) katika visomaji vya skrini. Ikiwa unahitaji maeneo ya moja kwa moja, panga kutumia `polite` kwa kila kitu isipokuwa ujumbe muhimu unaohitaji `assertive`. +## Maeneo ya moja kwa moja ya kawaida kutoka kwa majukumu ya ARIA + Pia ni muhimu kutambua kwamba sifa ya `aria-live` haidiwi ikiwa taarifa iliyosasishwa iko katika kipengele chenye jukumu la ARIA la `alert`, `log`, `marquee`, `status`, au `timer`, kwani majukumu haya tayari yana thamani za `aria-live` za msingi. Lakini thamani ya msingi inaweza kubadilishwa kwa kuweka wazi `aria-live` kwenye kipengele. +## Kuchagua thamani sahihi + Kuchagua thamani sahihi ya `aria-live` kunategemea kipaumbele cha taarifa iliyosasishwa. Ikiwa masasisho ni ya dharura, unapaswa kumjulisha mtumiaji mara moja kwa `assertive`. Lakini unapaswa kutumia hii tu ikiwa masasisho ni ya dharura kweli kwa sababu kukatishwa ghafla kunaweza kumchanganya mtumiaji na kuathiri uzoefu wa mtumiaji. diff --git a/curriculum/challenges/swahili/blocks/lecture-understanding-computer-internet-and-tooling-basics/672aa578a2129554d4675049.md b/curriculum/challenges/swahili/blocks/lecture-understanding-computer-internet-and-tooling-basics/672aa578a2129554d4675049.md index e005429e05e..d280aed6c74 100644 --- a/curriculum/challenges/swahili/blocks/lecture-understanding-computer-internet-and-tooling-basics/672aa578a2129554d4675049.md +++ b/curriculum/challenges/swahili/blocks/lecture-understanding-computer-internet-and-tooling-basics/672aa578a2129554d4675049.md @@ -11,13 +11,13 @@ Kompyuta ni mashine zenye nguvu sana zinazotekeleza aina mbalimbali za kazi kama Kama msanidi programu, ni muhimu kuelewa jinsi kompyuta inavyofanya kazi ndani yake kwa msingi. -Sehemu kubwa ya kwanza ya kompyuta ni motherboard. Motherboard huhifadhi kumbukumbu zote na viunganishi vinavyohitajika kuendesha kompyuta. Inatumika kama bodi kuu ya mzunguko wa kompyuta. +Sehemu kubwa ya kwanza ya kompyuta ni motherboard. Motherboard ina hifadhi zote na viunganishi vinavyohitajika kuendesha kompyuta. Inatumika kama bodi kuu ya mzunguko wa kompyuta. -Ndani ya kesi ya kompyuta ya motherboard, utapata CPU ambayo ni kifupi cha Central Processing Unit. CPU ni prosesa (CPU) inayohusika na kutekeleza maagizo na kufanya mahesabu. Mara nyingi huitwa ubongo wa kompyuta. +Ndani ya kesi ya kompyuta, iliyowekwa kwenye motherboard, utapata CPU, ambayo ni kifupi cha Central Processing Unit. CPU ni prosesa (CPU) inayohusika na kutekeleza maagizo na kufanya mahesabu. Mara nyingi huitwa ubongo wa kompyuta. -CPU ni mraba mdogo wenye chipu inayowekwa kwenye soketi ya CPU ya motherboard. Kasi ya prosesa ya CPU hupimwa kwa gigahertz (GHz) na mega-hertz (MHz). Gigahertz ni mizunguko bilioni kwa sekunde na mega-hertz ni mizunguko milioni kwa sekunde. +CPU ni chipu ndogo ya mraba inayowekwa kwenye soketi ya CPU ya motherboard. Kasi ya CPU hupimwa kwa gigahertz (GHz) na megahertz (MHz). Gigahertz ni mizunguko bilioni kwa sekunde na megahertz ni mizunguko milioni kwa sekunde. -Sehemu nyingine muhimu ya kompyuta ni kumbukumbu ya muda mfupi ya mfumo. Hii inajulikana kama RAM au Random Access Memory. RAM ni sehemu ya hifadhi ya muda kwa prosesa ya kompyuta. Kila wakati kompyuta inapotaka kupata data haraka, itatumia RAM. +Sehemu nyingine muhimu ya kompyuta ni kumbukumbu ya muda mfupi ya mfumo. Hii inajulikana kama RAM, au Random Access Memory. RAM ni sehemu ya kuhifadhi ya muda kwa prosesa (CPU) ya kompyuta. Kila wakati kompyuta inapotaka kupata data haraka, itatumia RAM. Kadri unavyokuwa na RAM zaidi kwenye kompyuta yako, ndivyo itakavyokimbia kwa kasi zaidi na programu zaidi unaweza kuendesha kwa wakati mmoja. Ikiwa RAM yako inapungua, kompyuta yako itakimbia polepole na utaona tofauti katika utendaji. @@ -27,13 +27,13 @@ Unapohifadhi mafaili yako, huhifadhiwa kwenye diski kuu. Diski kuu ya HDD ni seh Diski kuu ina sahani inayozunguka na mkono. Sahani ndiyo sehemu data huhifadhiwa na mkono hutumika kusoma na kuandika data kwenye sahani. Ukipata diski kuu yenye kasi zaidi, kompyuta yako itawaka haraka na programu zako zitakimbia kwa kasi zaidi. -Aina nyingine ya hifadhi ya data ni Solid State Drive, au SSD kwa kifupi. SSD ni kumbukumbu ya flash isiyo ya kudumu na inaweza kutumika badala ya diski kuu. SSD ni haraka na ndogo kuliko diski kuu lakini diski kuu ni nafuu na zina uwezo mkubwa wa kuhifadhi. +Aina nyingine ya kuhifadhi data ni Solid State Drive, au SSD kwa kifupi. SSD ni kumbukumbu ya flash isiyopotea na inaweza kutumika badala ya diski kuu. SSD ni haraka na ndogo kuliko diski kuu, lakini diski kuu ni nafuu na ina uwezo mkubwa wa kuhifadhi. Sehemu nyingine muhimu ya kompyuta ni kitengo cha usambazaji wa umeme, au PSU. PSU inahusika na kubadilisha umeme kutoka kwenye soketi ya ukutani kuwa aina inayoweza kutumiwa na kompyuta. Inatuma umeme kutoka soketi kwenda motherboard, CPU, na sehemu nyingine za kompyuta. -Sehemu nyingine muhimu ni kadi za upanuzi. Kadi hizi huingizwa kwenye motherboard kuongeza uwezo zaidi kwa kompyuta. Mifano ya kadi za upanuzi ni kadi ya video, kadi ya sauti, na kadi ya mtandao. +Sehemu nyingine muhimu ni kadi ya upanuzi. Kadi hizi huingizwa kwenye motherboard kuongeza utendaji zaidi kwa kompyuta. Mifano ya kadi za upanuzi ni kadi ya video, kadi ya sauti, na kadi ya mtandao. -Kadi ya video, pia inajulikana kama Graphics Processing Unit au GPU, inahusika na kuonyesha picha kwenye skrini ya kompyuta. +Kadi ya video, pia inajulikana kama Graphics Processing Unit, au GPU, inahusika na kuonyesha picha kwenye skrini ya kompyuta. Kadi ya sauti inahusika na kuonyesha sauti kwenye spika za kompyuta. @@ -53,7 +53,7 @@ Kumbukumbu ya muda mrefu. ### --feedback-- -Fikiria kuhusu hifadhi ya data ya muda mfupi. +Fikiria kuhusu kuhifadhi data ya muda mfupi. --- @@ -65,7 +65,7 @@ Bodi kuu ya mzunguko. ### --feedback-- -Fikiria kuhusu hifadhi ya data ya muda mfupi. +Fikiria kuhusu kuhifadhi data ya muda mfupi. --- @@ -73,7 +73,7 @@ Kadi ya video. ### --feedback-- -Fikiria kuhusu hifadhi ya data ya muda mfupi. +Fikiria kuhusu kuhifadhi data ya muda mfupi. ## --video-solution-- @@ -145,7 +145,7 @@ Kuhifadhi kumbukumbu ya muda mfupi. ### --feedback-- -Kagua mwisho wa funzo kwa jibu +Kagua mwisho wa funzo kwa jibu. ## --video-solution-- diff --git a/curriculum/challenges/swahili/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab82c1a9bbd0e3aabc39d.md b/curriculum/challenges/swahili/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab82c1a9bbd0e3aabc39d.md index 8627988585d..37257672b4c 100644 --- a/curriculum/challenges/swahili/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab82c1a9bbd0e3aabc39d.md +++ b/curriculum/challenges/swahili/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab82c1a9bbd0e3aabc39d.md @@ -7,11 +7,11 @@ dashedName: how-to-effectively-work-with-your-keyboard-mouse-and-other-pointing- # --description-- -Wengi wenu mmezoea kufanya kazi na kibodi na panya kwa miaka mingi kwa shughuli mbalimbali kama michezo, kutekeleza kazi za ofisini, au kuvinjari mtandao. +Wengi wenu mmekuwa mkifanya kazi na kibodi na panya kwa miaka mingi kwa shughuli mbalimbali kama michezo ya kubahatisha, kutekeleza majukumu ya kazi, au kuvinjari mtandao. Lakini matumizi mabaya ya muda mrefu ya vifaa hivi yanaweza kusababisha matatizo makubwa ya kiafya baadaye. -Katika funzo hili, tutazungumzia njia za kufanya kazi na kibodi na panya ya kompyuta yako kwa njia za kiafya. +Katika funzo hili, tutajadili njia za kutumia kibodi na panya ya kompyuta yako kwa njia za kiafya. Ushauri wa kwanza ni kuwa makini na jinsi unavyoshika panya. Unapofanya kazi za muhimu za ofisini au wakati wa michezo yenye msisimko mkubwa, unaweza kushika panya kwa nguvu sana. Hata hivyo, hili linaweza kusababisha matatizo makubwa ya mkono na kifundo cha mkono. Ili kuzuia hili, unapaswa kushika panya kwa upole na kuweka vidole vyako katika hali tulivu. @@ -25,7 +25,7 @@ Pia unapaswa kuwa makini na mkao wako kwa ujumla unapo kaa mbele ya kompyuta kwa Ingawa kudumisha mkao mzuri ni muhimu, ergonomics ya kisasa inasisitiza umuhimu wa mwendo na kukaa kwa mabadiliko. Mwili wa binadamu umeundwa kwa ajili ya mwendo, na kukaa katika mkao wowote wa kudumu, hata mkao wa moja kwa moja, kwa muda mrefu kunaweza kuweka shinikizo endelevu kwenye mgongo. Kuchukua mapumziko ya mara kwa mara, kubadilisha mkao wako siku nzima, na kudumisha mkao wa asili wa kifundo cha mkono kunaweza kusaidia kuboresha mzunguko wa damu, kupunguza uchovu, na kuunga mkono afya ya mgongo kwa muda mrefu. -Ushauri wa mwisho ni kutumia njia za mkato za kibodi inapowezekana kusaidia kupunguza kuandika. Kuna njia nyingi za mkato zinazopatikana kwa kazi kama kuvinjari mtandao, kuvinjari mfumo wako wa uendeshaji, kufanya kazi ndani ya mhariri wa msimbo, na zaidi. Kwa hivyo, ni vyema kufanya utafiti kuhusu baadhi ya njia hizi za mkato za kibodi na kuanza kuzitumia katika matumizi yako ya kila siku ya kompyuta. +Ushauri wa mwisho ni kutumia njia za mkato za kibodi pale inapowezekana ili kupunguza kufikia panya. Kuna njia nyingi za mkato zinazopatikana kwa kazi kama kuvinjari mtandao, kuvinjari mfumo wako wa uendeshaji, kufanya kazi ndani ya mhariri wa msimbo, na zaidi. Kwa hivyo, ni vyema kufanya utafiti kuhusu baadhi ya njia hizi za mkato za kibodi na kuanza kuzitumia katika matumizi yako ya kila siku ya kompyuta. Unapoendelea kutumia panya na kibodi yako kwa miradi ya uandishi wa msimbo na shughuli nyingine zijazo, kumbuka kuweka haya maelekezo ya kiafya akilini. @@ -109,7 +109,7 @@ Ni ushauri gani kuhusu urefu wa panya yako ikilinganishwa na kibodi? ## --answers-- -Panya inapaswa kuwa juu sana kuliko kibodi. +Urefu wa panya hauna umuhimu. ### --feedback-- diff --git a/curriculum/challenges/swahili/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab83c4297910eade53c2e.md b/curriculum/challenges/swahili/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab83c4297910eade53c2e.md index 63ce4c50989..667ad4d648e 100644 --- a/curriculum/challenges/swahili/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab83c4297910eade53c2e.md +++ b/curriculum/challenges/swahili/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab83c4297910eade53c2e.md @@ -7,17 +7,17 @@ dashedName: what-are-the-different-types-of-internet-service-providers # --description-- -Kwanza, ni nini mtoa huduma ya intaneti, au ISP? Ni kampuni inayouza upatikanaji wa mtandao wa intaneti wa dunia nzima, kwa msingi. Na wanakuja katika ngazi tatu tofauti. +Kwanza, ni nini mtoa huduma ya intaneti, au ISP? Ni kampuni inayouza upatikanaji wa mtandao wa intaneti wa dunia nzima. Na wanakuja katika ngazi tatu tofauti. -Ngazi ya kwanza ni makampuni makubwa ya mseto, ambayo yana miundombinu ya kushughulikia sehemu kubwa (ikiwa si yote) ya trafiki yao ya mtandao kwa kujitegemea. +Ngazi ya kwanza ni kampuni kubwa za mseto, ambazo zina miundombinu ya kushughulikia sehemu kubwa (ikiwa si yote) ya trafiki yao ya mtandao kwa uhuru. -Ngazi ya pili ni watoa huduma wa kitaifa, ambao wakati mwingine hujiri upatikanaji kutoka kwa mitandao ya ngazi ya kwanza lakini wanaweza kusimama vizuri wenyewe. +Ngazi ya pili ni watoa huduma wa kitaifa, ambao wakati mwingine hujiri upatikanaji wa mitandao ya ngazi ya 1 lakini wanaweza kusimama vizuri peke yao. -Ngazi ya tatu ni makampuni madogo yanayojikita hasa katika kutoa intaneti kwa masoko ya ndani, na hutegemea ISPs wakubwa kutoa miundombinu yao. +Ngazi ya tatu ni kampuni ndogo ambazo hasa zinazingatia kutoa intaneti kwa masoko ya ndani, na hutegemea ISPs kubwa kutoa miundombinu yao. Watoa huduma hawa pia hutoa aina tofauti za muunganisho. -Muunganisho wa nyuzi za macho hutegemea nyuzi za glasi au plastiki kusafirisha data kwa njia ya mwanga, na kusababisha kasi za muunganisho za juu sana na kubadilishana data. +Muunganisho wa fiber optic hutegemea nyuzi za kioo au plastiki kusafirisha data kwa njia ya mwanga, na kusababisha kasi za muunganisho za juu sana na kubadilishana data. Muunganisho wa kebo hutumia miundombinu ile ile ya mtoa huduma wa televisheni ya kebo, ambayo mara nyingi huwafanya kupatikana kwa urahisi katika maeneo mengi. @@ -25,7 +25,7 @@ Muunganisho wa DSL hutumia miundombinu inayotumika na huduma za simu za ardhi. K Dial-up pia hutumia mistari ya simu, lakini inahitaji muunganisho wa kipekee (kuzuia matumizi ya mstari kwa ajili ya simu wakati umeunganishwa kwenye intaneti). Hii ni teknolojia ya zamani sana ambayo imeachwa kutumika. -Muunganisho wa satelaiti hutumia safu ya satelaiti zinazozunguka dunia kuunganisha vifaa mbalimbali duniani kote. Na hatimaye, kama hiyo, mtoa huduma wa intaneti wa nyumbani wa 5G hutumia miundombinu ya minara ya simu kuweka mtandao kwako. +Muunganisho wa satelaiti hutumia safu ya satelaiti zinazozunguka Dunia kuunganisha vifaa mbalimbali kote duniani. Na hatimaye, kama hiyo, mtoa huduma wa intaneti wa nyumbani wa 5G hutumia miundombinu ya mnara wa simu kuweka wewe mtandaoni. Na hiyo inapaswa kukupa muhtasari wa aina gani za watoa huduma za intaneti na muunganisho wa intaneti zipo! @@ -33,7 +33,7 @@ Na hiyo inapaswa kukupa muhtasari wa aina gani za watoa huduma za intaneti na mu ## --text-- -Ni ipi kati ya zifuatazo SIyo ngazi ya mtoa huduma ya intaneti (ISP)? +Ni ipi kati ya zifuatazo SI ngazi ya mtoa huduma ya intaneti (ISP)? ## --answers-- @@ -69,7 +69,7 @@ Mashirika ya kimataifa yanayosimamia upatikanaji wa intaneti duniani. ## --text-- -Ni aina gani ya muunganisho wa intaneti hutumia nyuzi za glasi au plastiki kusafirisha data kwa mwanga? +Ni aina gani ya muunganisho wa intaneti hutumia nyuzi za kioo au plastiki kusafirisha data kwa mwanga? ## --answers-- @@ -89,7 +89,7 @@ Aina hii ya muunganisho inajulikana kwa kasi zake za juu sana kutokana na njia y --- -Muunganisho wa nyuzi za macho. +Muunganisho wa fiber optic. --- @@ -121,7 +121,7 @@ Zinahitaji matumizi ya kipekee ya mstari wa simu wakati umeunganishwa. --- -Hutumia safu ya satelaiti zinazozunguka dunia. +Hutumia safu ya satelaiti zinazozunguka Dunia. ### --feedback-- diff --git a/curriculum/challenges/swahili/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab8573f32480f192aaae1.md b/curriculum/challenges/swahili/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab8573f32480f192aaae1.md index 924c45bd91a..b3005a8294b 100644 --- a/curriculum/challenges/swahili/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab8573f32480f192aaae1.md +++ b/curriculum/challenges/swahili/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab8573f32480f192aaae1.md @@ -9,7 +9,7 @@ dashedName: what-are-the-different-types-of-tools-professional-developers-use Wasanidi programu wa kitaalamu hutegemea zana mbalimbali kuongeza ufanisi na ubora wa msimbo. Tujifunze kuhusu zana hizo, ikiwa ni pamoja na zile zinazoonekana wazi kabisa. -Kwanza kati ya zana hizo ni kompyuta. Kompyuta ni mazingira kuu ya ukuzaji. Inaweza kuwa desktop nzito au laptop inayobebeka yenye mfumo wa uendeshaji wa Windows, macOS, au Linux. +Chombo cha kwanza ni kompyuta yenyewe. Kompyuta ni mazingira kuu ya ukuzaji. Inaweza kuwa desktop nzito au laptop inayobebeka yenye Windows, macOS, au Linux kama mfumo wa uendeshaji. Wasanidi programu wa kitaalamu mara nyingi huchagua kompyuta zenye nguvu ya usindikaji haraka na RAM nyingi kushughulikia kazi zinazohitaji rasilimali nyingi. @@ -21,7 +21,7 @@ Visual Studio Code (VS Code) kwa msingi ni mhariri wa msimbo, lakini pia hutoa h Mahariri wengine wa msimbo ni Sublime Text, Atom, Notepad++, na Brackets. -Unapoandika msimbo kwa kutumia mahariri ya msimbo na IDE, unahitaji kufuatilia mabadiliko unayoyafanya. Zana inayokuwezesha kufuatilia mabadiliko hayo ni mfumo wa udhibiti wa toleo. +Unapoandika msimbo kwa kutumia wahariri wa msimbo na IDEs, unahitaji kufuatilia mabadiliko unayofanya kwenye msimbo huo. Chombo kinachokuwezesha kufuatilia mabadiliko hayo ni mfumo wa udhibiti wa toleo. Git ni mfumo wa udhibiti wa toleo unaotumika sana katika jamii ya ukuzaji. @@ -31,8 +31,8 @@ Wasimamizi wa vifurushi ni zana nyingine muhimu. Husaidia wasanidi programu kura Mifano ya wasimamizi maarufu wa vifurushi ni: -* NPM, Yarn, na PNPM kwa JavaScript -* PIP kwa Python +* npm, Yarn, na pnpm kwa JavaScript +* pip kwa Python * Composer kwa PHP * Maven kwa Java @@ -147,7 +147,7 @@ Fikiria kuhusu zana zinazofanya ukaguzi wa moja kwa moja wa msimbo. --- -Mifumo ya udhibiti wa toleo +Mifumo ya udhibiti wa toleo. ### --feedback-- diff --git a/curriculum/challenges/swahili/blocks/lecture-understanding-error-handling-and-health-checks/69f3046f4c0e76cbdd24858e.md b/curriculum/challenges/swahili/blocks/lecture-understanding-error-handling-and-health-checks/69f3046f4c0e76cbdd24858e.md index 37b3051123e..f859bba305d 100644 --- a/curriculum/challenges/swahili/blocks/lecture-understanding-error-handling-and-health-checks/69f3046f4c0e76cbdd24858e.md +++ b/curriculum/challenges/swahili/blocks/lecture-understanding-error-handling-and-health-checks/69f3046f4c0e76cbdd24858e.md @@ -34,7 +34,7 @@ Unaeleza programu hii ya kati mwishoni mwa safu yako ya programu ya kati. Express inajua ni mshughulikiaji wa hitilafu kwa sababu ina vigezo vinne — kipya, `err`, pamoja na vigezo vya kawaida vya `req`, `res`, na `next` kwa kazi nyingine za programu ya kati. -Katika funzo lijalo, utajifunza zaidi kuhusu programu ya kati ya mshughulikiaji wa hitilafu na jinsi inavyolingana na safu pana ya programu ya kati ya Express. +Kama ulivyoona katika funzo la awali, programu ya kati ya kushughulikia makosa inaendana na safu kubwa ya programu ya kati ya Express. ## Jinsi ya kushughulikia hitilafu zisizo za wakati mmoja diff --git a/curriculum/challenges/swahili/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/6733affc29df1304e2c97e88.md b/curriculum/challenges/swahili/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/6733affc29df1304e2c97e88.md index 341ce2743b8..04fe0a36a9f 100644 --- a/curriculum/challenges/swahili/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/6733affc29df1304e2c97e88.md +++ b/curriculum/challenges/swahili/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/6733affc29df1304e2c97e88.md @@ -31,6 +31,8 @@ Unaanza kwa kuandika neno kuu la `class` ikifuatiwa na jina la darasa la vitu. U Yaliyomo ndani ya mabano ya mviringo huitwa mwili wa darasa la vitu. Hapa ndipo kijenzi na njia zitakapoandikwa. +## Kuweka Kijenzi + Kijenzi ni njia maalum inayoitwa moja kwa moja wakati kitu kipya kinaundwa kutoka kwa darasa la vitu. Kwa kawaida hutumika kuanzisha sifa za kitu hicho. Katika mfano huu, unaweza kuona darasa la `Dog` lenye kijenzi. @@ -45,6 +47,8 @@ class Dog { Neno kuu la `this` linatumika hapa kurejelea mfano wa sasa wa darasa la `Dog`, likikuruhusu kuweka sifa ya `name` kwa kitu kinachoanzishwa. Utajifunza zaidi kuhusu neno kuu la `this` katika funzo lijalo. +## Kuweka Njia + Chini ya kijenzi, unaweza kuwa na njia zinazojulikana kama methods. Njia ni kitendakazi kilichofafanuliwa ndani ya darasa la vitu kinachofanya vitendo au operesheni. Zinatumika kufafanua tabia ambazo mifano ya darasa hilo inaweza kufanya. Hapa kuna mfano wa kuongeza njia inayoitwa `bark` kwa darasa la `Dog`. @@ -63,6 +67,8 @@ class Dog { Wakati njia ya `bark` inapoitwa, ujumbe utaandikwa kwenye konsoli ukiwa na jina halisi lililopitishwa ndani yake. Ikiwa utaunda mfano wa `Dog` wenye jina `"Buddy"`, kuitisha njia ya `bark()` kwenye mfano huo itachapisha `"Buddy says woof!"` kwenye konsoli. +## Kutengeneza Kielelezo cha Darasa la Vitu + Mara tu unapokuwa na darasa lako la vitu limefafanuliwa, unaweza kuunda mfano wa darasa hilo kwa kutumia neno kuu la `new`, jina la darasa, na hoja zake. Katika mfano huu, tunaunda mfano mpya wa `Dog` mwenye jina `Gino` kisha tunaweka thamani yake kwenye mabadiliko ya `dog`. @@ -73,13 +79,15 @@ const dog = new Dog("Gino"); Unapoandika `new Dog("Gino")` katika msimbo wako, kitu kipya kinaundwa na kijenzi kinaitwa moja kwa moja kwa hoja zilizotolewa. -Kisha unaweza kupata sifa hii kwa kutumia uandishi wa nukta, kama unavyoona katika mstari ufuatao wa msimbo: +## Kupata Sifa na Njia + +Baadaye unaweza kupata sifa ya `name` kwa kutumia uandishi wa nukta, kama unavyoona katika mstari ufuatao wa msimbo: ```js console.log(dog.name); ``` -Hapa kuna mfano kamili: +Hapa ni mfano kamili: :::interactive_editor @@ -127,6 +135,8 @@ dog.bark(); ::: +## Kutumia Usemi wa Darasa la Vitu + Kama ilivyotajwa awali, unaweza pia kufafanua madarasa ya vitu kama usemi wa darasa la vitu. Hii ni pale darasa la vitu linapokuwa lisilo na jina na limepewa thamani kwenye mabadiliko. Hivi ndivyo mfano wa awali unavyoonekana kama usemi wa darasa la vitu: diff --git a/curriculum/challenges/swahili/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/673403ca2bb16658309e3632.md b/curriculum/challenges/swahili/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/673403ca2bb16658309e3632.md index af678d4e863..98184cae12c 100644 --- a/curriculum/challenges/swahili/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/673403ca2bb16658309e3632.md +++ b/curriculum/challenges/swahili/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/673403ca2bb16658309e3632.md @@ -11,6 +11,8 @@ Umejifunza kwamba madarasa ni kama ramani za jumla unazoweza kutumia kuunda vitu Ramani hizi zinahitaji njia ya jumla ya kurejelea kitu maalum kinachoundwa, kinachofikiliwa, au kinachobadilishwa ndani ya msimbo. Hicho ndicho hasa neno la kifunguo `this` linapotumika. Linarejelea muktadha ambapo msimbo unapaswa kuendeshwa. Ukilitumia ndani ya njia, thamani ya `this` itakuwa rejea kwa kitu kinachohusiana na njia hiyo. Kwa njia hii, unaweza kufikia sifa na njia za kitu ndani ya darasa na kutumia tena njia hiyo kwa vitu tofauti. +## Kijenzi + Kwa mfano, hapa tuna darasa la `Dessert`. Wakati huu, tunafafanua sifa ya `hasPeanuts`. ```js @@ -33,6 +35,8 @@ this.hasPeanuts = hasPeanuts; Hiyo ni katika muktadha wa kijenzi lakini pia unaweza kutumia neno la kifunguo `this` ndani ya njia nyingine. +## Njia + Huu ni darasa letu la `Dessert` lenye mabadiliko machache. Sasa tuna sifa mbili: `name` na `price`. ```js @@ -91,10 +95,16 @@ Jina na bei ya kitu cha sasa (`brownie`) zimebadilishwa katika mfuatano wa heruf Hii yote ni shukrani kwa neno la kifunguo `this`, ambalo linakupa njia ya jumla ya kurejelea kitu cha sasa ndani ya darasa. Hii inakuwezesha kutumia tena njia hiyo kwa vitu tofauti. +## Kitendakazi na Kitendakazi cha Mshale + Hii ni katika muktadha wa njia za vitu lakini neno la kifunguo `this` pia litakuwa na thamani katika vitendakazi huru na vitendakazi vya mshale. +### Kitendakazi cha Kawaida + Thamani yake ndani ya kitendakazi huru kawaida hutaja kitu cha ulimwengu (katika hali isiyo kali) au `undefined` (katika hali kali). +### Kitendakazi cha Mshale + Thamani ya neno la kifunguo `this` ni tofauti kidogo katika vitendakazi vya mshale. Vitendakazi vya mshale vinarithi thamani ya `this` kutoka kwa wigo unaozunguka ambapo vimefafanuliwa. Havundwi na uhusiano wao wa `this`. Hii inamaanisha kwamba thamani ya `this` inategemea muktadha ambapo kitendakazi cha mshale kimefafanuliwa, si mahali au jinsi kitendakazi hicho kinavyotumika. Hii hufanya vitendakazi vya mshale kuwa na msaada kwa wito wa kurudisha au kuhifadhi muktadha. Hata hivyo, kwa sababu hii, thamani ya `this` haitarejelea kitu cha sasa katika njia za vitu, hivyo hili ni jambo unalopaswa kulizingatia unapotumia vitendakazi vya mshale. @@ -183,7 +193,7 @@ Katika mojawapo ya hali zifuatazo, ungeweza kutumia neno la kifunguo `this`? ## --answers-- -Wakati wa kufafanua vitendakazi. +Wakati wa kufafanua kitendakazi. ### --feedback-- diff --git a/curriculum/challenges/swahili/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5160.md b/curriculum/challenges/swahili/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5160.md index 11968d168d0..acf5031ea31 100644 --- a/curriculum/challenges/swahili/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5160.md +++ b/curriculum/challenges/swahili/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5160.md @@ -14,17 +14,17 @@ Hata hivyo, chini ya tofauti hizo, mchakato wa kubadilisha wazo kuwa kiwango cha 1. ## Kutambua hitaji Viwango huanza na mgongano, kama msanidi programu kukutana na kizuizi kigumu, vivinjari kutekeleza tabia ile ile kwa njia zisizolingana, au uwezo mpya ambao jukwaa halijaunga mkono bado. Mtu fulani, mahali fulani, hupata hasira za kutosha kuandika kuhusu hilo. Mtu huyo anaweza kuwa yeyote; msanidi programu, kampuni kubwa yenye hitaji la bidhaa, au mhandisi ndani ya timu ya kivinjari. Kinachojali katika hatua hii si mamlaka, bali ushahidi na maswali kama tatizo ni halisi, na kama watu wa kutosha wanakutana nalo ili kuhitaji umakini wa jukwaa la mtandao. -1. **Mapendekezo na majadiliano ya awali** - Wazo huandikwa kwa njia isiyo rasmi kupitia suala la GitHub, hati fupi, au maelezo yanayoelezea tatizo na kuchora suluhisho linalowezekana. Katika hatua hii, lengo si kutengeneza maelezo kamili bali kugundua kama tatizo linaendana na wengine. Je, wanasanidi programu wengine wanalitambua? Je, wauzaji wa vivinjari wana nia? Je, kuna suluhisho dhahiri, au suluhisho kadhaa zinazoshindana? Katika TC39, hatua hii ya awali inalingana na Hatua 0 na Hatua 1. Katika W3C, mara nyingi hufanyika kwa njia isiyo rasmi katika Kundi la Jamii kabla ya Kundi rasmi la Kazi kuanzishwa. WHATWG hushughulikia hili kupitia mijadala ya wazi ya GitHub kwenye hifadhidata zake kuu. Mahali pa kufanya hili hutofautiana, lakini kazi ni ile ile. +1. ## Pendekezo na majadiliano ya awali + Wazo linaandikwa kwa njia isiyo rasmi kupitia tatizo la GitHub, hati fupi, au maelezo yanayoelezea tatizo na kuchora suluhisho linalowezekana. Katika hatua hii, lengo si kutengeneza maelezo kamili bali kugundua kama tatizo linaendana na wengine. Je, wasanidi programu wengine wanalitambua? Je, wauzaji wa vivinjari wana nia? Je, kuna suluhisho dhahiri, au suluhisho kadhaa zinazoshindana? Katika TC39, hatua hii ya awali inalingana na Hatua 0 na Hatua 1. Katika W3C, mara nyingi hufanyika kwa njia isiyo rasmi katika Kikundi cha Jamii kabla ya Kikundi cha Kazi rasmi kuanzishwa. WHATWG hufanikisha hili kupitia mijadala wazi ya GitHub kwenye hifadhidata zake kuu. Mahali pa kufanya tofauti, lakini kazi ni ile ile. -1. **Kuandika maelezo ya kiwango** +1. ## Kuandika maelezo Ikiwa pendekezo linapata mvuto, mtu mmoja au timu ndogo lazima waandike maelezo halisi, au spec. Spec si chapisho la blogu au mafunzo, bali ni hati rasmi, sahihi inayobainisha jinsi kipengele kinapaswa kufanya kazi katika kila hali inayowezekana. Hali za kipekee, masharti ya hitilafu, mwingiliano na vipengele vilivyopo, na athari za usalama vyote vinapaswa kufikiriwa na kuandikwa. -1. **Kagua, pingamizi, na marekebisho** - Rasimu huchapishwa na kukaguliwa hadharani, na na wauzaji wengine wa vivinjari. Hapa ndipo kazi nyingi halisi hutokea. Pingamizi huibuliwa, na spec hubadilishwa. Kipengele ambacho injini moja kubwa ya kivinjari inakataa kutekeleza mara chache hutakuwa kiwango, bila kujali sifa zake za kiufundi. Kujenga makubaliano katika hatua hii kunaweza kuchukua muda mrefu. Baadhi ya mapendekezo hugonga mwamba kwa miaka wakati wauzaji wanapojadiliana kuhusu maelezo ya muundo. Mengine hukufa kabisa wakati inakuwa wazi kuwa hakuna makubaliano yanayoweza kufikiwa. +1. ## Ukaguzi, pingamizi, na mzunguko + Rasimu inachapishwa na kukaguliwa hadharani, na pia na wauzaji wengine wa vivinjari. Hapa ndipo kazi nyingi halisi hufanyika. Pingamizi huibuliwa, na spec huboreshwa. Kipengele ambacho injini moja kubwa ya kivinjari inakataa kutekeleza mara chache hutokea kuwa kiwango cha kawaida, bila kujali sifa zake za kiufundi. Kujenga makubaliano katika hatua hii kunaweza kuchukua muda mrefu. Baadhi ya mapendekezo hugonga mwamba kwa miaka wakati wauzaji wanapojadiliana kuhusu maelezo ya muundo. Mengine hukufa kabisa wakati inakuwa wazi kuwa hakuna makubaliano yanayoweza kufikiwa. -1. **Utekelezaji na upimaji** - Mara spec inakuwa thabiti vya kutosha, wauzaji wa vivinjari huanza kuitekeleza. Hii kawaida huanza na bendera ya kipengele kwanza, ili iweze kupimwa bila kuathiri watumiaji waliopo. Utekelezaji mara nyingi huibua matatizo ambayo spec haikuyaona, ambayo kisha hurudishwa kwa wahariri kwa ufafanuzi. Seti ya majaribio ya pamoja inathibitisha kuwa kila utekelezaji unafanya kazi kwa njia ile ile. Ikiwa Chrome, Firefox, na Safari zote zinapita majaribio yale yale, spec inafanya kazi. Ikiwa zinatofautiana, ama spec haijaeleweka, au moja ya utekelezaji ina hitilafu. +1. ## Utekelezaji na upimaji + Mara spec inapo kuwa thabiti vya kutosha, wauzaji wa vivinjari huanza kuitekeleza. Hii kawaida huanza na bendera ya kipengele kwanza, ili iweze kupimwa bila kuathiri watumiaji waliopo. Utekelezaji mara nyingi huibua matatizo ambayo spec haikuyaelewa, ambayo kisha hurudishwa kwa wahariri kwa ufafanuzi. Seti ya upimaji ya pamoja inathibitisha kuwa kila utekelezaji unafanya kazi kwa njia ile ile. Ikiwa Chrome, Firefox, na Safari wote hupita vipimo hivyo, spec inafanya kazi. Ikiwa wanatofautiana, ama spec haijaeleweka, au moja ya utekelezaji ina hitilafu. 1. ## Kukamilisha Wakati utekelezaji huru kadhaa upo, majaribio yanapita, na jamii inaridhika, kiwango kinakamilishwa. Katika W3C hii inamaanisha kufikia hadhi ya Mapendekezo. Katika TC39, inamaanisha kufikia Hatua 4, baada ya hapo kipengele kinaingizwa katika toleo lijalo la kila mwaka la ECMAScript. Katika WHATWG, hakuna wakati mmoja wa kukamilisha, kiwango kinachoendelea kinaonyesha makubaliano ya sasa, kinasasishwa kila mara. Mchakato mzima unaweza kuchukua kutoka miezi michache kwa nyongeza ndogo isiyo na utata hadi zaidi ya muongo kwa kitu kigumu au chenye siasa nyingi. CSS Grid, kwa mfano, ilipendekezwa kwanza mwaka 2011 na haikufika katika vivinjari vyote vikuu hadi 2017. Tofauti hiyo kati ya wazo zuri na kiwango thabiti, kinachoungwa mkono kwa wote ndiyo sehemu ambapo kazi nyingi za mtandao wa wazi hufanyika kimya kimya. @@ -109,7 +109,7 @@ Kwa nini seti ya majaribio ya pamoja ni muhimu wakati wa hatua ya utekelezaji wa ## --answers-- -Kubadilisha hitaji la maelezo yaliyoandikwa. +Kubadilisha haja ya vipimo vilivyoandikwa. ### --feedback-- diff --git a/curriculum/challenges/swahili/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5161.md b/curriculum/challenges/swahili/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5161.md index 279f5cfc6e9..d3347f3b1c2 100644 --- a/curriculum/challenges/swahili/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5161.md +++ b/curriculum/challenges/swahili/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5161.md @@ -13,23 +13,23 @@ Mzunguko wa maisha wa kipengele cha kiwango cha mtandao unahusiana, lakini kwa k Fikiria mchakato kama kitabu cha sheria, na mzunguko wa maisha kama kile kinachotokea kweli unapoanza kucheza mchezo. -1. **Mapendekezo** - Kila kipengele huanza na tatizo ambalo mtu alijali kiasi cha kuandika. Msanidi programu, mhandisi wa kivinjari, au kampuni huwasilisha hitilafu ya GitHub au maelezo yanayoelezea kile mtandao hauwezi kufanya kwa sasa na kwa nini inapaswa kufanya. Katika hatua hii, wazo ni la jumla, na maswali zaidi kuliko majibu. Lengo ni tu kugundua kama mtu mwingine anatambua maumivu sawa. +1. ## Pendekezo + Kila kipengele huanza na tatizo ambalo mtu alijali kiasi cha kuandika. Msanidi programu, mhandisi wa kivinjari, au kampuni huwasilisha suala la GitHub au maelezo yanayoelezea kile mtandao hauwezi kufanya kwa sasa na kwa nini inapaswa kufanya. Katika hatua hii, wazo ni la kawaida, likiwa na maswali zaidi kuliko majibu. Lengo ni tu kugundua kama kuna mtu mwingine anatambua maumivu sawa. -1. **Kukolea** - Ikiwa pendekezo linapokelewa, linaingia kipindi cha majadiliano ya wazi na usanifu wa awali. Njia zinazoshindana huandaliwa, matumizi yanakusanywa, na jamii hujaribu wazo hilo kwa nguvu. Mapendekezo mengi hukufa hapa, labda kwa sababu tatizo linajitokeza kuwa dogo sana, au hakuna suluhisho linaloweza kuridhisha kila mtu. Yale yanayobaki huibuka na umbo wazi na angalau mvuto kutoka kwa wauzaji wa vivinjari. +1. ## Ukuaji + Ikiwa pendekezo linapokelewa, linaingia katika kipindi cha majadiliano ya wazi na usanifu wa awali. Mbinu zinazoshindana huandaliwa, matumizi yanakusanywa, na jamii hujaribu wazo hilo kwa msongo. Mapendekezo mengi hukufa hapa, labda kwa sababu tatizo linajitokeza kuwa la kipekee sana, au hakuna suluhisho linaloweza kumridhisha kila mtu. Yale yanayobaki huibuka na umbo wazi zaidi na angalau mvuto fulani kutoka kwa wauzaji wa vivinjari nyuma yao. -1. **Maelezo ya kiufundi** - Pendekezo linaloendelea huandikwa kama maelezo rasmi. Kila kesi ya pembeni, hali ya hitilafu, na mwingiliano na vipengele vilivyopo lazima vifafanuliwe kwa uwazi. Hii ni hatua ambapo wazo zuri hukutana na ukweli mgumu. Dhana zisizo wazi lazima zigeuke sheria kamili ambazo wahandisi wawili huru wanaweza kusoma na kutekeleza kwa usawa. +1. ## Maelezo ya kiufundi + Pendekezo linaloishi huandikwa kama maelezo rasmi. Kila kesi ya pembezoni, hali ya hitilafu, na mwingiliano na vipengele vilivyopo lazima vifafanuliwe kwa uwazi. Huu ni wakati ambapo wazo zuri hukutana na ukweli mgumu. Dhana zisizo wazi lazima zigeuke kuwa sheria kamili ambazo wahandisi wawili huru wanaweza kusoma na kutekeleza kwa usawa. -1. **Kipimo cha ulinganifu** - Kabla kipengele kizingatiwe kuwa thabiti, lazima kitende kwa njia ile ile katika kivinjari kila kimoja. Kifurushi cha W3C Web Platform Tests ndicho chombo kikuu cha kuthibitisha hili. Ni seti ya pamoja ya vipimo ambavyo Chrome, Firefox, Safari, na wengine wote hufanya dhidi ya utekelezaji wao. Matokeo yanayotofautiana yanamaanisha ama maelezo ni ya kuchanganya, au mtu ana hitilafu. Yote haya lazima yatatuliwe kabla kipengele kuendelea. +1. ## Upimaji wa ushirikiano + Kabla kipengele kiweze kuchukuliwa kuwa thabiti, lazima kitende kwa njia ile ile katika kivinjari kila kimoja. Kifurushi cha W3C Web Platform Tests ndicho chombo kikuu cha kuthibitisha hili. Ni seti ya pamoja ya majaribio ambayo Chrome, Firefox, Safari, na wengine wote hufanya dhidi ya utekelezaji wao. Matokeo yanayotofautiana yanamaanisha ama maelezo ni ya kuchanganya, au mtu ana hitilafu. Moja kati ya hayo lazima itatuliwe kabla kipengele kiende mbele. -1. **Kukamilisha** - Mara utekelezaji huru kadhaa unapopita vipimo, kipengele hukamilishwa. Kwa W3C, ni mapendekezo, kwa TC39, ni hatua ya 4, na ni kipengele thabiti katika kiwango cha WHATWG kinachoendelea. Bendera huondolewa na kipengele husambazwa kwa watumiaji. Katika hatua hii, kinakuwa sehemu ya msingi ya jukwaa la mtandao, kitu ambacho kila msanidi programu anaweza kutegemea kwa muda usio na kikomo. +1. ## Kukamilisha + Mara utekelezaji huru kadhaa unapopita majaribio, kipengele hukamilishwa. Kwa W3C, ni mapendekezo, kwa TC39, ni hatua ya 4, na ni kipengele thabiti katika kiwango cha WHATWG kinachoishi. Bendera zinashushwa na kipengele kinapelekwa kwa watumiaji. Katika hatua hii, kinakuwa sehemu ya msingi ya jukwaa la mtandao, kitu ambacho kila msanidi programu anaweza kutegemea kwa muda usio na kikomo. -1. **Kuachwa rasmi** - Sio kila kiwango kinakua vizuri kwa muda. Vipengele vingine hubadilishwa na vipengele bora zaidi, vingine huonekana kuwa na athari za usalama au faragha ambazo hazikuonekana wakati huo. Kipengele kinapohitaji kuondolewa, huachwa rasmi. Hiyo ni kusema, kinasaidiwa lakini kimewekwa alama kama kitu ambacho wasanidi programu wanapaswa kuacha kutumia. Hatimaye, huondolewa katika maelezo. Kuondolewa katika vivinjari ni polepole na kwa tahadhari, kwa sababu ahadi kuu ya mtandao ni kwamba kurasa za zamani zinaendelea kufanya kazi. Vipengele vilivyoachwa rasmi hudumu katika vivinjari kwa miongo kadhaa kwa sababu ya wajibu wa kuendana na zamani. +1. ## Kuachishwa matumizi + Sio kila kiwango kinakua vizuri kwa muda. Vipengele vingine hubadilishwa na vipengele bora zaidi, vingine huonekana kuwa na athari za usalama au faragha ambazo hazikuonekana wakati huo. Kipengele kinapohitaji kuondolewa, huachishwa rasmi. Hiyo ni kusema, kinasaidiwa lakini kimewekwa alama kama kitu ambacho wasanidi programu wanapaswa kuacha kutumia. Hatimaye, huondolewa kwenye maelezo. Kuondolewa kutoka kwa vivinjari ni polepole na kwa tahadhari, kwa sababu ahadi kuu ya mtandao ni kwamba kurasa za zamani zinaendelea kufanya kazi. Vipengele vilivyoachishwa matumizi huendelea kuwepo katika vivinjari kwa miongo kadhaa kwa sababu ya wajibu wa kuendana na zamani. # --questions-- @@ -39,7 +39,7 @@ Katika hatua gani ya mzunguko wa maisha wa kipengele cha mtandao wazo hupimwa kw ## --answers-- -Kukolea +Kukuzwa --- @@ -83,7 +83,7 @@ Fikiria kile kinachothibitisha kuwa Chrome, Firefox, na Safari wote hufanya kazi --- -Kubadilisha hitaji la maelezo yaliyoandikwa. +Kubadilisha haja ya vipimo vilivyoandikwa. ### --feedback-- diff --git a/curriculum/challenges/swahili/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5162.md b/curriculum/challenges/swahili/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5162.md index f5f42d6c88b..09b06f3c555 100644 --- a/curriculum/challenges/swahili/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5162.md +++ b/curriculum/challenges/swahili/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5162.md @@ -9,26 +9,26 @@ dashedName: what-are-the-key-principles-that-web-standards-are-built-on Viwango vya mtandao si tu nyaraka za kiufundi, vinaakisi seti ya maadili kuhusu mtandao unavyopaswa kuwa na nani unapaswa kuhudumia. Kuelewa kanuni hizi kunakusaidia kuona si tu jinsi mtandao unavyofanya kazi, bali kwa nini ulijengwa kwa njia hiyo. Tujadili kanuni hizo. -1. **Uwazi** - Viwango vya mtandao vinatengenezwa kwa uwazi na kutekelezwa bila malipo ya leseni. Kila mtu anaweza kusoma vipimo, kila mtu anaweza kutengeneza kivinjari, na hakuna kampuni inayoweza kutoza ada za leseni kwa kutekeleza kiwango. Uwazi huu ndilo linatofautisha mtandao na majukwaa ya umiliki na linayoruhusu timu ndogo kutengeneza zana zinazofikia mabilioni ya watu bila kuomba ruhusa kwa mlinda lango. +1. ## Uwazi + Viwango vya mtandao vinatengenezwa kwa uwazi na kutekelezwa bila malipo ya leseni. Kila mtu anaweza kusoma vipimo, kila mtu anaweza kutengeneza kivinjari, na hakuna kampuni inayoweza kutoza ada za leseni kwa kutekeleza kiwango. Uwazi huu ndilo linalotofautisha mtandao na majukwaa ya umiliki na linayoruhusu timu ndogo kujenga zana zinazofikia mabilioni ya watu bila kuomba ruhusa kutoka kwa mlinda mlango. -1. **Ufikikaji** - Mtandao ulitengenezwa ili utumike na kila mtu, bila kujali uwezo. Ufikikaji si nyongeza kwa viwango vya mtandao, umejumuishwa katika muundo wa HTML, CSS, na tabia za kivinjari. Miongozo ya WCAG ya W3C huweka kiwango rasmi cha maana ya ufikikaji katika vitendo. Kipengele kinachounda vizingiti kwa watu wanaotumia visomaji vya skrini, urambazaji wa kibodi, au teknolojia saidizi kinachukuliwa kuwa na dosari kwa muundo, si tu kwa maadili. +1. ## Ufikikaji + Mtandao umetengenezwa ili utumike na kila mtu, bila kujali uwezo. Ufikikaji si nyongeza kwa viwango vya mtandao, umejumuishwa katika muundo wa HTML, CSS, na tabia ya kivinjari. Miongozo ya WCAG ya W3C huweka kiwango rasmi cha maana ya ufikikaji katika vitendo. Kipengele kinachounda vizingiti kwa watu wanaotumia kisomaji cha skrini, urambazaji wa kibodi, au teknolojia saidizi kinachukuliwa kuwa na dosari kwa muundo, si tu kwa maadili. -1. **Uendeshaji sambamba** - Kanuni msingi zaidi ni kwamba mtandao unapaswa kufanya kazi sawa kila mahali. Ukurasa uliotengenezwa kwa kiwango unapaswa kuonyesha tabia sawa katika Chrome, Firefox, na Safari, na kwenye Windows, macOS, Linux, Android, na iOS. Bila uendeshaji sambamba, mtandao unavunjika kuwa mkusanyiko wa uzoefu maalum kwa kivinjari, na wasanidi programu wanapaswa kuandika kitu kimoja mara nyingi. Kila kiwango kipo, kwa msingi wake, kuzuia hilo. +1. ## Uendeshaji sambamba + Kanuni msingi zaidi ni kwamba mtandao unapaswa kufanya kazi sawa kila mahali. Ukurasa uliotengenezwa kwa kiwango unapaswa kuonyesha tabia sawa katika Chrome, Firefox, na Safari, na kwenye Windows, macOS, Linux, Android, na iOS. Bila uendeshaji sambamba, mtandao unavunjika kuwa mkusanyiko wa uzoefu maalum wa kivinjari, na wasanidi programu wanapaswa kuandika kitu kimoja mara nyingi. Kila kiwango kipo, kwa msingi wake, kuzuia hilo. -1. **Ulinganifu wa nyuma** - Mtandao una ahadi karibu kamili ya kutovunja vitu vya zamani. Ukurasa uliandikwa mwaka 1999 unapaswa bado kuonyeshwa katika kivinjari cha kisasa, na taasisi za viwango zinachukua jukumu hili kwa umakini wanapobuni vipengele vipya. Hii ndiyo sababu uwezo mpya huongezwa juu badala ya kubadilisha kile kilichotangulia. Ni kizuizi kinachowachanganya wabunifu wakati mwingine, lakini pia ndicho kinachofanya mtandao kuwa jukwaa lenye uimara wa kipekee. +1. ## Ulinganifu wa nyuma + Mtandao una ahadi karibu kamili ya kutovunja vitu vya zamani. Ukurasa uliandikwa mwaka 1999 bado unapaswa kuonyeshwa katika kivinjari cha kisasa, na taasisi za viwango zinachukua jukumu hili kwa uzito wanapobuni vipengele vipya. Hii ndiyo sababu uwezo mpya huwekwa juu badala ya kubadilisha kile kilichotangulia. Ni kizuizi kinachowachosha wabunifu wakati mwingine, lakini pia ndicho kinachofanya mtandao kuwa jukwaa lenye uimara wa kipekee. -1. **Faragha na usalama** - Viwango vya kisasa hukaguliwa kwa athari za faragha na usalama kabla ya kutolewa. API mpya zinazoweza kuweka wazi data za watumiaji au kuwezesha ufuatiliaji hukumbwa na ukaguzi mkali katika mchakato wa viwango. Kanuni ni kwamba jukwaa linapaswa kulinda watumiaji kwa chaguo-msingi, na urahisi kwa wasanidi programu haupaswi kamwe kuja kwa gharama ya usalama wa mtumiaji. +1. ## Faragha na usalama + Viwango vya kisasa hukaguliwa kwa athari za faragha na usalama kabla ya kutolewa. API mpya zinazoweza kuweka wazi data za mtumizi au kuwezesha ufuatiliaji hukumbwa na ukaguzi mkubwa katika mchakato wa viwango. Kanuni ni kwamba jukwaa linapaswa kulinda watumizi kwa chaguo-msingi, na urahisi kwa wasanidi programu haupaswi kamwe kuja kwa gharama ya usalama wa mtumizi. -1. **Uwekaji tabaka** - Mtandao umejengwa kwa tabaka tofauti, zinazoweza kuunganishwa: HTML kwa muundo, CSS kwa uwasilishaji, na JavaScript kwa tabia. Viwango vimeundwa kuheshimu mipaka hii badala ya kuivunjia. Kipengele kilicho na tabaka vizuri kinaweza kuanzishwa hatua kwa hatua. Ukurasa usiotumia JavaScript bado hufanya kazi, na kivinjari kisichounga mkono sifa mpya ya CSS bado kinaonyesha kitu kinachokubalika. Tofauti hii ya masuala ndiyo inayompa mtandao uimara wake. +1. ## Tabaka + Mtandao umetengenezwa kwa tabaka tofauti, zinazoweza kuunganishwa: HTML kwa muundo, CSS kwa uwasilishaji, na JavaScript kwa tabia. Viwango vimeundwa kuheshimu mipaka hii badala ya kuibomoa. Kipengele kilicho na tabaka vizuri kinaweza kupokelewa hatua kwa hatua. Ukurasa usiotumia JavaScript bado unafanya kazi, na kivinjari kisichounga mkono sifa mpya ya CSS bado kinaonyesha kitu kinachokubalika. Tofauti hii ya masuala ndiyo inayompa mtandao uimara wake. -1. **Kuboresha hatua kwa hatua** - Inahusiana sana na uwekaji tabaka ni wazo kwamba mtandao unapaswa kufanya kazi kwa kila mtu, kisha kuboreshwa kwa wale wenye vivinjari au vifaa vyenye uwezo zaidi. Kipengele cha kiwango kinapaswa kupungua kwa heshima kinaposhindwa kuungwa mkono, si kuvunjika kabisa. Kanuni hii huathiri jinsi sifa mpya za CSS zinavyobainishwa, jinsi API za JavaScript zinavyoshughulikia uwezo usiopatikana, na jinsi taasisi za viwango zinavyofikiria kuhusu pengo kati ya vivinjari vya kisasa na vile vya zamani vinavyotumika sana duniani kote. +1. ## Uboreshaji wa hatua kwa hatua + Ambayo ni karibu na tabaka ni wazo kwamba mtandao unapaswa kufanya kazi kwa kila mtu, kisha uboreze kwa wale wenye vivinjari au vifaa vyenye uwezo zaidi. Kipengele cha kiwango kinapaswa kupungua kwa heshima wakati hakitumiwi, si kuvunjika kabisa. Kanuni hii huathiri jinsi sifa mpya za CSS zinavyobainishwa, jinsi API za JavaScript zinavyoshughulikia uwezo usiopatikana, na jinsi taasisi za viwango zinavyofikiria kuhusu pengo kati ya vivinjari vya kisasa na vile vya zamani vinavyotumika sana duniani kote. # --questions-- @@ -50,7 +50,7 @@ Ulinganifu wa nyuma. --- -Kuboresha hatua kwa hatua. +Uboreshaji wa hatua kwa hatua. ### --feedback-- diff --git a/curriculum/challenges/swahili/blocks/lecture-user-interface-design-fundamentals/672baa97f2990e6631d522e7.md b/curriculum/challenges/swahili/blocks/lecture-user-interface-design-fundamentals/672baa97f2990e6631d522e7.md index 26e241338b1..d78659d646c 100644 --- a/curriculum/challenges/swahili/blocks/lecture-user-interface-design-fundamentals/672baa97f2990e6631d522e7.md +++ b/curriculum/challenges/swahili/blocks/lecture-user-interface-design-fundamentals/672baa97f2990e6631d522e7.md @@ -9,6 +9,8 @@ dashedName: how-do-you-create-good-background-and-foreground-contrast-in-your-de **KUMBUKA**: Baadhi ya mifano ya mwingiliano inaweza kutumia CSS ambayo bado hujajifunza. Usijali kuhusu kuelewa msimbo wote. Lengo la mifano ni kukuonyesha mapitio ya dhana hizi za muundo ili uelewe vyema jinsi vitu vinavyofanya kazi. +## Kuelewa Utofauti wa Rangi + Kwanza, huenda unahitaji kujifunza kuhusu utofauti. Utofauti ni tofauti kati ya rangi mbili — au jinsi rahisi ya kuzitofautisha. Rangi zilizo na uwiano wa utofauti wa rangi mkubwa zitakuwa tofauti zaidi kwa macho, wakati rangi zilizo na uwiano mdogo zitakuwa karibu zaidi kwa muonekano. Kwa mfano, rangi nyeusi na nyeupe zina uwiano wa utofauti wa rangi mkubwa sana. Wakati rangi buluu nyepesi na zambarau nyepesi zina uwiano mdogo wa utofauti. @@ -53,6 +55,8 @@ Rangi zilizo na uwiano wa utofauti wa rangi mkubwa zitakuwa tofauti zaidi kwa ma ::: +### Kutumia Utofauti wa Rangi kwa Maandishi + Bila shaka, katika mifano hii tofauti inaweza kuonekana wazi zaidi kutokana na mpangilio. Lakini je, kuhusu kutumia rangi hizi kwenye maandishi? Unaweza kuwa na maandishi ya rangi nyeusi yenye utofauti mkubwa kwenye mandhari nyeupe. Na maandishi ya rangi zambarau yenye utofauti mdogo kwenye mandhari ya buluu. :::interactive_editor @@ -96,6 +100,8 @@ Bila shaka, katika mifano hii tofauti inaweza kuonekana wazi zaidi kutokana na m ::: +### Viwango vya Utofauti wa Rangi vya WCAG + Lakini unajua vipi ni uwiano gani wa utofauti unaofaa? Huwezi kuamua tu kwa jinsi maandishi yanavyoonekana kwako, kwa sababu kila mtumizi atakuwa na uzoefu tofauti. Kwa bahati nzuri, Miongozo ya Ufikikaji wa Maudhui ya Mtandao, au WCAG, hutoa kiwango cha kawaida kwa hili. Maandishi yenye uwiano wa utofauti wa 4.5:1 huchukuliwa kuwa kiwango cha AA, ambacho ni kiwango cha chini kabisa unachopaswa kufuata ili uweze kupatikana kwa watumizi wengi. Maandishi yenye uwiano wa utofauti wa 7:1 huchukuliwa kuwa kiwango cha AAA, na huhakikisha kiwango bora zaidi cha ufikikaji. @@ -141,6 +147,8 @@ Maandishi yenye uwiano wa utofauti wa 4.5:1 huchukuliwa kuwa kiwango cha AA, amb ::: +### Kulinganisha Uwiano wa Utofauti wa Rangi wa Juu na Chini + Kuna tovuti nyingi zinazoweza kukagua uwiano wa utofauti kati ya rangi mbili, lakini vivinjari vingi vitakuwezesha kufanya hivi moja kwa moja katika zana za msanidi programu kwenye tovuti yako. Tuchunguze mifano michache zaidi ya uwiano wa utofauti ili kuelewa dhana hii vyema. @@ -221,8 +229,12 @@ Mfano huu unazidi kufikia kiwango cha AAA. Sasa, tuchunguze maandishi ya rangi z Mfano huu una uwiano wa utofauti wa 1.48:1 ambao hata haukidhi kiwango cha AA. +## Kurekebisha Sifa za Rangi + Unawezaje kurekebisha hili? Vizuri, kuna mambo matatu yanayoathiri uwiano wa utofauti. +### Kurekebisha Hue + Kwanza ni hue, ambayo wakilisha aina ya rangi kwa ujumla, kama nyekundu, buluu, chungwa. Hebu tubadilishe hue kuwa ile ambayo iko mbali zaidi na buluu. Katika kesi hii, tumia nyekundu. :::interactive_editor @@ -267,6 +279,8 @@ Kwanza ni hue, ambayo wakilisha aina ya rangi kwa ujumla, kama nyekundu, buluu, ::: +### Kurekebisha Saturation + Kwa bahati mbaya, mabadiliko haya yalileta uwiano wa utofauti hadi 1.49:1 tu, ambayo ina maana unahitaji kubadilisha saturation, au "kiasi" cha rangi iliyopo. Hebu ongeza kiasi cha nyekundu kwenye maandishi. Hii inatufikisha karibu zaidi na lengo, kwa uwiano wa utofauti wa 3.54:1. :::interactive_editor @@ -325,6 +339,8 @@ Kwa bahati mbaya, mabadiliko haya yalileta uwiano wa utofauti hadi 1.49:1 tu, am ::: +### Kurekebisha Uangavu + Hata hivyo, unaweza kufikia karibu zaidi kwa kubadilisha thamani ya mwisho, ambayo ni lightness. Uangavu unawakilisha kiasi cha nyeupe kilichopo kwenye rangi. Hebu punguza uangavu wa nyekundu. Sasa kuna nyekundu mweusi zaidi dhidi ya mandhari ya buluu nyepesi, ambayo inaleta uwiano wa utofauti wa 10.34:1. diff --git a/curriculum/challenges/swahili/blocks/lecture-what-is-css/672acc100d59d24da7b4e09c.md b/curriculum/challenges/swahili/blocks/lecture-what-is-css/672acc100d59d24da7b4e09c.md index 2ceb5dea872..a941dcbe84f 100644 --- a/curriculum/challenges/swahili/blocks/lecture-what-is-css/672acc100d59d24da7b4e09c.md +++ b/curriculum/challenges/swahili/blocks/lecture-what-is-css/672acc100d59d24da7b4e09c.md @@ -7,10 +7,14 @@ dashedName: what-are-the-different-types-of-css-combinators # --interactive-- +## Mchanganyiko wa CSS + Mchanganyiko wa CSS hutumika kufafanua uhusiano kati ya wachaguzi katika CSS. Husaidia kuchagua vipengele kulingana na uhusiano wao na vipengele vingine, jambo linaloruhusu urembo sahihi na wenye ufanisi zaidi. Tutajadili baadhi ya mchanganyiko kuu wa CSS na matumizi yao, kuanzia na mchanganyiko wa mzao. +### Mchanganyiko wa Mzao + Kichanganuzi cha mzao hutumika kulenga vipengele vinavyolingana na kichaguzi cha pili ikiwa vimepangwa ndani ya kipengele mzao kinacholingana na kichaguzi cha kwanza. Mzao anaweza kuwa mzazi, babu, au mzazi yeyote aliye juu zaidi katika mti wa hati. Ili kuelewa vizuri jinsi hii inavyofanya kazi, tuchukulie mfano. @@ -42,6 +46,8 @@ Katika kesi hii, `figure` itakuwa mzazi na `img` itakuwa mtoto. Ikiwa ungekuwa na picha nyingi ndani ya kipengele cha `figure`, kutumia mchanganyiko wa mzao ingekuwa njia nzuri ya kuweka mpaka giza imara kuzunguka kila moja ya picha hizo. +### Mchanganyiko wa Mtoto + Aina nyingine ya mchanganyiko ni mchanganyiko wa mtoto. Mchanganyiko wa mtoto (`>`) katika CSS hutumika kuchagua vipengele ambavyo ni watoto wa moja kwa moja wa kipengele mzazi kilichobainishwa. @@ -102,6 +108,8 @@ Katika mfano huu hapo juu, tunalenga tu mtoto wa moja kwa moja wa darasa la `con Kwa kuwa vipengele viwili vya aya vimepangwa ndani ya vipengele vya `div`, havihesabiwi kuwa watoto wa moja kwa moja wa darasa la `container` na hivyo havitapokea rangi ya maandishi ya buluu. +### Mchanganyiko wa Ndugu wa Moja kwa Moja + Mchanganyiko mwingine wa kawaida ni mchanganyiko wa ndugu wa pili. Mchanganyiko wa ndugu wa pili (`+`) katika CSS huchagua kipengele kinachofuata mara moja kipengele cha ndugu kilichobainishwa. Mchanganyiko huu ni muhimu unapotaka kutumia mitindo kwa kipengele kinachofuata moja kwa moja kipengele kingine, na hivyo kuruhusu urembo uliolengwa kulingana na nafasi ya kipengele kati ya ndugu zake. @@ -150,6 +158,8 @@ img + figcaption { Katika mfano huu, mchanganyiko wa ndugu wa pili (`+`) huchagua kipengele cha `figcaption` kinachofuata mara moja kipengele cha `img`. Sheria ya CSS iliyotumika inaongeza `4px solid black border` kuzunguka `figcaption`. +### Mchanganyiko wa Ndugu wa Baadaye + Mchanganyiko mwingine wa kawaida ni mchanganyiko wa ndugu wa baadaye. Mchanganyiko wa ndugu wa baadaye (`~`) katika CSS huchagua ndugu wote wa kipengele kilichobainishwa ambao huja baada yake. @@ -202,6 +212,8 @@ Katika mfano huu, vipengele vyote vya aya vinavyofuata kipengele cha `h2` vitaku Mchanganyiko wa ndugu wa baadaye (`~`) unalenga ndugu wote wa aya wanaoonekana baada ya kipengele cha `h2`, bila kujali kama ni ndugu wa moja kwa moja au la. +## Kwa Nini Mchanganyiko wa CSS Ni Muhimu + Kwa kumalizia, kuelewa na kutumia mchanganyiko mbalimbali wa CSS kunakuwezesha kutumia mitindo sahihi kwa vipengele vyako vya HTML, na kuongeza udhibiti na uhuru wa muundo wako. Kwa kumiliki wachaguzi hawa, unaweza kuunda sheria za urembo zilizo ngumu zaidi na zilizo lengo, ambazo zinaboresha muonekano na utendaji wa kurasa zako za mtandao. diff --git a/curriculum/challenges/swahili/blocks/lecture-working-with-code-editors-and-ides/672d26269456511aa3db614d.md b/curriculum/challenges/swahili/blocks/lecture-working-with-code-editors-and-ides/672d26269456511aa3db614d.md index 633e8b359ba..3b0911b30ef 100644 --- a/curriculum/challenges/swahili/blocks/lecture-working-with-code-editors-and-ides/672d26269456511aa3db614d.md +++ b/curriculum/challenges/swahili/blocks/lecture-working-with-code-editors-and-ides/672d26269456511aa3db614d.md @@ -7,25 +7,25 @@ dashedName: what-is-a-code-editor-and-ide # --description-- -Unaweza kufikiri hizi ni vitu sawa, lakini si hivyo kabisa. Mhariri wa msimbo ni programu yoyote inayokuruhusu kuhariri mafaili ya msimbo. IDE, au Integrated Development Environment, ni programu kamili inayokuruhusu kukusanya, kuendesha, na kutafuta makosa kwenye msimbo wako wakati unaouhariri. +Unaweza kufikiri hizi ni vitu sawa, lakini si hivyo kabisa. Mhariri wa msimbo ni programu yoyote inayokuruhusu kuhariri mafaili ya msimbo. IDE, au mazingira ya ukuzaji yaliyojumuishwa, ni programu kamili inayokuruhusu kukusanya, kuendesha, na kutafuta makosa katika msimbo wako wakati unaouhariri. -Labda mifano kadhaa itasaidia. +Mifano kadhaa itasaidia. Kwanza, tuchukulie IDE maarufu chache. Visual Studio ni mazingira ya ukuzaji yaliyojumuishwa na Microsoft yanayotoa zana kamili za kujenga, kutafuta makosa, na kusambaza programu kwenye majukwaa mbalimbali. -IDE nyingine ni XCode. Xcode ni mazingira ya ukuzaji yaliyojumuishwa na Apple yaliyoundwa kwa ajili ya kuunda, kuandika msimbo, na kutafuta makosa kwenye programu za macOS, iOS, watchOS, na tvOS. +IDE nyingine ni Xcode. Xcode ni mazingira ya ukuzaji yaliyojumuishwa na Apple yaliyoundwa kwa ajili ya kuunda, kuandika msimbo, na kurekebisha makosa katika programu za macOS, iOS, watchOS, na tvOS. -Na IDE nyingine ni Android Studio. Android Studio ni mazingira ya ukuzaji yaliyojumuishwa na Google yaliyobuniwa mahsusi kwa ajili ya kujenga, kutafuta makosa, na kujaribu programu za Android. +Android Studio, iliyotengenezwa na Google, ni mazingira ya ukuzaji yaliyojumuishwa yaliyobuniwa mahsusi kwa ajili ya kujenga, kurekebisha makosa, na kupima programu za Android. Hizo ni mifano michache tu ya IDE. Sasa, tuchukulie baadhi ya wahariri wa msimbo maarufu. Visual Studio Code ni mhariri wa msimbo mwepesi, wa chanzo wazi kutoka Microsoft unaounga mkono lugha nyingi za programu na kutoa vipengele kama vile kutafuta makosa, kuangazia sintaksia, na udhibiti wa matoleo kupitia nyongeza. -Mhariri mwingine maarufu ni Sublime Text. Sublime Text ni mhariri wa maandishi wa haraka na wenye uwezo mkubwa unaojulikana kwa muonekano wake mzuri, vipengele vyenye nguvu, na msaada kwa lugha nyingi za programu kupitia kuangazia sintaksia inayoweza kubadilishwa na programu-jalizi. +Kwa uzoefu wa kuhariri haraka na unaobadilika, Sublime Text hutoa kiolesura kizuri na msaada kwa lugha nyingi za programu kupitia uangazaji wa sintaksia unaoweza kubadilishwa na programu-jalizi. -Na mwingine ni Notepad++. Huu ni mhariri wa bure, wa chanzo wazi wa maandishi na msimbo wa chanzo kwa Windows unaotoa kuangazia sintaksia, kufunga msimbo, na aina mbalimbali za programu-jalizi za kuongeza ufanisi na kubadilika. +Watumiaji wa Windows pia wanaweza kutumia Notepad++, mhariri wa bure, wa chanzo wazi wa maandishi na msimbo wa chanzo unaotoa uangazaji wa sintaksia, kufunga msimbo, na aina mbalimbali za programu-jalizi za kuongeza ufanisi na kubadilika. -Umeweza kuona jinsi wahariri wa msimbo wanazingatia hasa maudhui ya maandishi ya faili, wakati IDE zinaweka wazi zana mbalimbali za kusimamia msimbo wako. +Huenda umeona jinsi wahariri wa msimbo wanazingatia zaidi maudhui ya maandishi ya faili, wakati IDE zinapweka wazi zana mbalimbali za kusimamia msimbo wako. Mifano hii yote ni programu za ndani unazoweza kuendesha kwenye kompyuta yako, lakini pia kuna wahariri wa mtandao unaoweza kutumia. @@ -35,11 +35,11 @@ Tuchukulie baadhi ya wahariri wa mtandao. Replit ni jukwaa la mtandaoni linalotoa mazingira ya ushirikiano kwa ajili ya kuandika msimbo, likiwawezesha watumizi kuandika, kuendesha, na kushiriki msimbo katika lugha mbalimbali za programu moja kwa moja kutoka kwenye kivinjari cha mtandao. -Mhariri mwingine maarufu wa mtandao ni GitHub Codespaces. Hii ni mazingira ya ukuzaji ya mtandao yanayotoa upatikanaji wa papo hapo kwa mhariri wa msimbo wa kikamilifu na zana za ukuzaji moja kwa moja kutoka GitHub, kuwezesha kuandika msimbo na ushirikiano bila mshono. +Mhariri mwingine maarufu wa mtandao ni GitHub Codespaces. Hii ni mazingira ya ukuzaji ya mtandao yanayotoa upatikanaji wa papo hapo kwa mhariri wa msimbo uliowekwa kikamilifu na zana za ukuzaji moja kwa moja kutoka GitHub, kuwezesha kuandika msimbo na ushirikiano bila matatizo. -Na mwingine ni Ona. Ona ni mazingira ya ukuzaji ya mtandao yanayojumuisha na GitHub na GitLab, yakitoa maeneo ya kazi yanayoweza kubadilishwa papo hapo kwa ajili ya kuandika msimbo, kujenga, na kutafuta makosa moja kwa moja kutoka kwenye kivinjari chako. +Ona inaunganishwa na GitHub na GitLab kutoa maeneo ya kazi yanayoweza kubadilishwa papo hapo kwa ajili ya kuandika msimbo, kujenga, na kurekebisha makosa moja kwa moja kutoka kwa kivinjari chako. -Na kuna chaguzi nyingi zaidi. Baadhi ya chaguzi, kama Visual Studio Code, zinaweza kupanuliwa sana na zinaweza kufanya kazi na aina mbalimbali za miradi na lugha. Chaguzi nyingine zinaweza kuwa maalum kwa seti ndogo ya lugha au aina za miradi. +Na kuna chaguzi nyingi zaidi. Baadhi ya chaguzi, kama Visual Studio Code, zinaweza kupanuliwa sana na zinaweza kufanya kazi na aina nyingi za miradi na lugha. Chaguzi nyingine zinaweza kuwa zimebuniwa mahsusi kwa seti ndogo ya lugha au aina za miradi. Programu unayotumia inaweza kutofautiana kwa miradi maalum. Unapaswa kuchunguza chaguzi ili kuona ni ipi itakufaa zaidi kwa mahitaji yako. diff --git a/curriculum/challenges/swahili/blocks/lecture-working-with-code-editors-and-ides/672d45583fd75a504136fbbb.md b/curriculum/challenges/swahili/blocks/lecture-working-with-code-editors-and-ides/672d45583fd75a504136fbbb.md index d93bca540d8..e5d927095f4 100644 --- a/curriculum/challenges/swahili/blocks/lecture-working-with-code-editors-and-ides/672d45583fd75a504136fbbb.md +++ b/curriculum/challenges/swahili/blocks/lecture-working-with-code-editors-and-ides/672d45583fd75a504136fbbb.md @@ -7,11 +7,11 @@ dashedName: how-to-install-visual-studio-code-onto-your-computer # --description-- -Ili kusakinisha VS Code, utahitaji kutembelea tovuti yao ili kupata msakinishaji unaofaa kwa mfumo wako wa uendeshaji. Hakikisha unatembelea tovuti ya VS Code, siyo tovuti ya Visual Studio. +Ili kusakinisha VS Code, unahitaji kutembelea tovuti ya VS Code ili kupata msakinishaji unaofaa kwa mfumo wako wa uendeshaji. Hakikisha unatembelea tovuti ya VS Code, siyo tovuti ya Visual Studio. -Kwa Windows, unaweza kupakua msakinishaji wa EXE. Mara tu unapopakua, endesha faili hilo na mtaalamu wa usanidi atakuongoza kupitia mchakato wa usakinishaji. +Kwa Windows, unaweza kupakua msakinishaji wa EXE. Mara tu unapopakua, endesha faili hiyo, na mtaalamu wa usanidi atakuongoza kupitia mchakato wa usakinishaji. -Kwa Mac, unaweza kupakua faili la zip ambalo lina `.app` unaloweza kuendesha. Pia unaweza kusakinisha VS Code kupitia homebrew. +Kwa Mac, unaweza kupakua faili la `.zip` ambalo lina `.app` unaloweza kuendesha. Pia unaweza kusakinisha VS Code kupitia Homebrew. Fungua programu ya Terminal kwenye Mac yako na endesha amri ifuatayo: diff --git a/curriculum/challenges/swahili/blocks/lecture-working-with-code-editors-and-ides/672d45651d83b450801efb3a.md b/curriculum/challenges/swahili/blocks/lecture-working-with-code-editors-and-ides/672d45651d83b450801efb3a.md index ace21ef4195..59e74648371 100644 --- a/curriculum/challenges/swahili/blocks/lecture-working-with-code-editors-and-ides/672d45651d83b450801efb3a.md +++ b/curriculum/challenges/swahili/blocks/lecture-working-with-code-editors-and-ides/672d45651d83b450801efb3a.md @@ -9,21 +9,21 @@ dashedName: how-to-create-a-project-and-run-your-code-locally-in-vs-code Ili kuanza, unapaswa kujua kwamba VS Code huchukulia miradi kama "nafasi za kazi". Nafasi ya kazi ni saraka yoyote uliyofungua katika VS Code. -Kuanza, utahitaji kutumia kiolesura cha mstari wa amri kuunda saraka mpya kwa ajili ya mradi wako mpya. Saraka ni jina jingine la folda. +Kuanza, utahitaji kutumia kiolesura cha mstari wa amri kuunda kielezo kipya kwa ajili ya mradi wako mpya. Kielezo ni jina jingine la folda. Kiolesura cha mstari wa amri, au CLI kwa kifupi, hukuruhusu kuingiliana na mfumo wako wa uendeshaji kupitia amri za maandishi. Utajifunza zaidi kuhusu zana hizi katika mafundisho yajayo. Kama uko kwenye Windows, unaweza kutumia Command Prompt au PowerShell. Kama uko kwenye Mac, unaweza kufungua programu yako ya Terminal. -Mara kiolesura cha mstari wa amri kitakapo funguliwa, elekea kwenye saraka ya nyumbani kwa kuandika amri ya `cd ~` na kubonyeza `enter` kwenye kibodi yako. Kisha andika amri ya `mkdir my-project` na bonyeza `enter`. `mkdir`, au "make directory", ni amri inayotumika kuunda saraka mpya. Baadaye unapaswa kufungua saraka yako mpya na VS Code. +Mara kiolesura cha mstari wa amri kitakapo funguliwa, elekea kwenye kielezo chako cha nyumbani. Katika Command Prompt, andika `cd /d %USERPROFILE%` na bonyeza `Enter` kwenye kibodi yako. Katika PowerShell au Terminal ya macOS, andika `cd ~` na bonyeza `Enter`. Kisha andika amri ya `mkdir my-project` na bonyeza `Enter`. `mkdir`, au "make directory", ni amri inayotumika kuunda kielezo kipya. Baadaye fungua kielezo chako kipya na VS Code. -Pia kuna njia nyingine za picha za kuunda saraka mpya. +Kuna pia njia nyingine za kufungua kielezo katika VS Code. Kulingana na mfumo wako wa uendeshaji, unaweza kuwa na menyu ya muktadha (au chaguo la bofya kulia) kufungua VS Code moja kwa moja kutoka kwa mtafutaji wa mafaili. Pia unaweza kuchagua kubofya mara mbili kwenye programu ya VS Code. Ikiwa unajisikia vizuri na mstari wa amri unaweza kuendesha amri ya `code /path/to/folder`. Mara inapo funguliwa, unapaswa kuona nafasi mpya tupu ya kazi. -Ili kuunda faili mpya, bofya kwenye menyu ya `File` upande wa juu-kushoto na chagua `New File...`. Kisha ita faili yako `index.html` na bofya `Save`. +Ili kuunda faili mpya, bofya kwenye menyu ya `File` upande wa juu kushoto na chagua `New File...`. Kisha ita faili yako `index.html` na bofya `Save`. Sasa unapaswa kuona faili yako mpya kwenye kichupo cha mtafutaji. Jaribu kuongeza HTML kwenye faili yako ya `index.html`. @@ -31,15 +31,15 @@ Sasa huenda ukahisi hamu ya kufungua faili ya HTML moja kwa moja kwenye kivinjar Badala yake, unapaswa kuweka faili yako ya HTML nyuma ya seva halali ya mtandao. Hii inaweza kuonekana kama zoezi la kuogopesha kama wewe ni mpya katika kuandika msimbo, lakini kuna njia ya kufanya hivi moja kwa moja kutoka VS Code. -Utahitaji kwanza kupakua kiendelezi _Live Server_, ambacho kinapatikana bure katika soko la programu. +Utahitaji kwanza kupakua ugani wa Live Server, ambao upo bure katika soko la programu. -Bofya kwenye kichupo cha viendelezi upande wa kushoto na andika `Live Server` kwenye kisanduku cha utafutaji. +Bofya kwenye kichupo cha Extensions upande wa kushoto na andika `Live Server` kwenye kisanduku cha utafutaji. -Mara baada ya kusakinisha, unapaswa kuona kitufe cha `Go live` kwenye upau wa hali. Hakikisha faili yako ya HTML iko wazi, kisha bofya kitufe hicho. +Mara baada ya kuisakinisha, utapaswa kuona kitufe cha `Go Live` kwenye upau wa hali. Hakikisha faili yako ya HTML iko wazi, kisha bofya kitufe hicho. -Ukurasa wako mpya unapaswa kufunguka moja kwa moja kwenye kichupo kipya cha kivinjari. Ikiwa haitafunguka basi unaweza kwenda moja kwa moja kwenye `http://localhost:5500/` +Ukurasa wako mpya utafunguka moja kwa moja kwenye kichupo kipya cha kivinjari. Ikiwa hautafunguka, basi unaweza kwenda moja kwa moja kwenye `http://localhost:5500/`. -Hongera! Sasa umeanzisha mradi wako binafsi katika VS Code, na unaweza kuona mabadiliko yako kwa kutumia seva ya moja kwa moja. +Hongera! Sasa umeanzisha mradi wako binafsi katika VS Code, na unaweza kuona mabadiliko yako kwa kutumia Live Server. # --questions-- @@ -57,7 +57,7 @@ Funzo linataja jinsi VS Code inavyofafanua nafasi ya kazi kuhusiana na saraka. --- -Saraka uliyofungua VS Code kutoka kwake. +Kielezo ulichokifungua katika VS Code. --- @@ -121,7 +121,7 @@ Ni kiendelezi gani cha VS Code kinachopendekezwa kwa ajili ya kuanzisha seva ya ## --answers-- -Web Server. +Seva ya mtandao. ### --feedback-- @@ -133,7 +133,7 @@ Live Server. --- -Local Host. +Mwenyeji wa ndani. ### --feedback-- @@ -141,7 +141,7 @@ Funzo linataja kwa undani kusakinisha kiendelezi kutoka soko la programu ili kuh --- -HTML Preview. +Mapitio ya HTML. ### --feedback-- diff --git a/curriculum/challenges/swahili/blocks/lecture-working-with-code-editors-and-ides/672d456f4ac35950b300e93f.md b/curriculum/challenges/swahili/blocks/lecture-working-with-code-editors-and-ides/672d456f4ac35950b300e93f.md index 3b54a18861f..07f3d91119d 100644 --- a/curriculum/challenges/swahili/blocks/lecture-working-with-code-editors-and-ides/672d456f4ac35950b300e93f.md +++ b/curriculum/challenges/swahili/blocks/lecture-working-with-code-editors-and-ides/672d456f4ac35950b300e93f.md @@ -9,21 +9,21 @@ dashedName: what-are-several-useful-keyboard-shortcuts-for-maximizing-productivi Huenda tayari unafahamu baadhi ya njia za haraka za msingi, ambazo zimekuzwa kutoka kwa mfumo wako wa uendeshaji. Njia za haraka kama `Ctrl + S` kwa ajili ya kuhifadhi, `Ctrl + C` kwa kunakili, na `Ctrl + V` kwa kubandika zote hufanya kazi katika VS Code. -Lakini kuna chache ambazo ni maalum kwa programu hii na bado zinaweza kuongeza ufanisi wako. Ni vyema kutambua kwamba baadhi ya njia hizi za haraka zinaweza kutofautiana kulingana na mfumo wa uendeshaji. +Lakini kuna baadhi ambazo ni maalum kwa programu na bado zinaweza kuongeza ufanisi wako. Inafaa kutambua kwamba baadhi ya njia hizi za mkato zinaweza kutofautiana kulingana na mfumo wa uendeshaji. -Kwa mfano, `Shift + Alt + F` itatekeleza formatter uliyoipanga (kama prettier, kwa mradi wa JavaScript) kwenye faili iliyofunguliwa kwa sasa. +Kwa mfano, `Shift + Alt + F` itafanya formatter uliyoipanga (kama Prettier, kwa mradi wa JavaScript) kwenye faili iliyofunguliwa sasa hivi. -Au `Ctrl + Shift + F` (Windows), au `Cmd + Shift + F` (Mac), kutafuta maudhui ya maandishi katika mafaili yote ya eneo lako la kazi. Kisha `Ctrl + Shift + H` (Windows), au `Cmd + Shift + H` (Mac), ikiwa unataka kufanya utafutaji na uingizaji. +Tumia `Ctrl + Shift + F` (Windows/Linux) au `Cmd + Shift + F` (macOS) kutafuta maudhui ya maandishi katika mafaili yote ya eneo lako la kazi. Kisha tumia `Ctrl + Shift + H` (Windows/Linux) au `Cmd + Shift + H` (macOS) ikiwa unataka kufanya utafutaji na uingizaji badala. -Ikiwa unahitaji kufuta mstari, `Ctrl + Shift + K` (Windows), au `Cmd + Shift + K` (Mac), itaufuta. +Ikiwa unahitaji kufuta mstari, `Ctrl + Shift + K` (Windows/Linux) au `Cmd + Shift + K` (macOS) itaufuta. -Unahitaji nafasi zaidi kwa msimbo wako wote? `Ctrl + B` (Windows), au `Cmd + B` (Mac), itaficha upau wa pembeni - ambao una orodha ya mafaili na menyu ya nyongeza. +Unahitaji nafasi zaidi kwa msimbo wako wote? `Ctrl + B` (Windows), au `Cmd + B` (Mac), itaficha upau wa pembeni, ambao una orodha ya mafaili na menyu ya nyongeza. -Au labda huwezi kuona msimbo wako? `Ctrl + plus` (Windows), au `Cmd + plus` (Mac), itaongeza ukubwa wa mhariri, na `Ctrl + minus` (Windows), au `Cmd + minus` (Mac), itapunguza ukubwa wake. +Au labda huwezi kuona msimbo wako? `Ctrl + Plus` (Windows), au `Cmd + Plus` (Mac), itakuza ukubwa wa mhariri, na `Ctrl + Minus` (Windows), au `Cmd + Minus` (Mac), itapunguza ukubwa wake. -Kipengele kingine cha msaada katika VS Code ni uhariri wa mistari mingi, unaokuwezesha kufanya mabadiliko katika mistari kadhaa kwa wakati mmoja. Kwa mfano, unaweza kuweka vidokezo vingi kwa kutumia `Ctrl + Alt + down` na `Ctrl + Alt + up` (Windows/Linux), au `Option + Command + down` na `Option + Command + up` (Mac), kuongeza vidokezo kwa mistari inayofuata. Pia unaweza kubonyeza na kushikilia `Alt` (Windows/Linux) au `Option` (Mac) na kubofya kuongeza vidokezo kwenye mistari tofauti popote unapotaka. Mara vidokezo vimewekwa, chochote unachokiandika au kufuta kitaathiri maeneo yote hayo kwa wakati mmoja — jambo ambalo linaokoa muda mwingi unapotumia msimbo unaojirudia. +Kipengele kingine cha msaada katika VS Code ni uhariri wa mistari mingi, unaokuwezesha kufanya mabadiliko kwenye mistari kadhaa kwa wakati mmoja. Kwa mfano, unaweza kuweka vidokezo vingi kwa kutumia `Ctrl + Alt + Down` na `Ctrl + Alt + Up` (Windows/Linux), au `Option + Cmd + Down` na `Option + Cmd + Up` (Mac), kuongeza kidokezo kwenye mistari inayofuata. Pia unaweza kushikilia `Alt` (Windows/Linux) au `Option` (Mac) na kubofya kuongeza vidokezo kwenye mistari tofauti mahali popote unapotaka. Mara vidokezo vimewekwa, chochote unachokiandika au kufuta kitahusiana na maeneo yote hayo kwa wakati mmoja — jambo ambalo linaokoa muda mwingi unapotumia msimbo unaojirudia. -Mwishowe, ikiwa utasahau njia yoyote ya haraka, daima una `Ctrl + Shift + P` (Windows), au `Cmd + Shift + P` (Mac), ambayo hufungua orodha ya amri ili uchague unachohitaji. +Mwishowe, ikiwa utasahau njia yoyote ya mkato, daima una `Ctrl + Shift + P` (Windows/Linux) au `Cmd + Shift + P` (macOS), ambayo hufungua orodha ya amri ili uchague kile unachohitaji. Kwa maarifa haya, na labda mazoezi kidogo, uko njiani kuwa mtumiaji hodari wa VS Code. diff --git a/curriculum/challenges/swahili/blocks/lecture-working-with-code-editors-and-ides/672d457bcdd8b350ec2b6254.md b/curriculum/challenges/swahili/blocks/lecture-working-with-code-editors-and-ides/672d457bcdd8b350ec2b6254.md index a836abbbb6e..08fc1a8c7d8 100644 --- a/curriculum/challenges/swahili/blocks/lecture-working-with-code-editors-and-ides/672d457bcdd8b350ec2b6254.md +++ b/curriculum/challenges/swahili/blocks/lecture-working-with-code-editors-and-ides/672d457bcdd8b350ec2b6254.md @@ -7,25 +7,25 @@ dashedName: what-are-some-good-vs-code-extensions-you-can-use-in-your-editor # --description-- -_Better Comments_ ni kiongezi kinachotoa mwangaza maalum kwa maoni fulani ya msimbo. Kwa mfano, kitataja maoni ya "TODO", pamoja na sintaksia ya kuonyesha maswali au onyo. +Better Comments ni ugani unaotoa mwangaza maalum kwa maoni fulani ya msimbo. Kwa mfano, utaangazia maoni ya "TODO", pamoja na sintaksia ya kuonyesha maswali au onyo. -_Code Spell Checker_ hutoa dalili wakati umeandika neno vibaya katika msimbo wako. Kwa sababu imeundwa kwa mafaili ya msimbo, itazingatia mambo kama camel case. +Code Spell Checker inaonyesha maneno yaliyoandikwa vibaya katika msimbo wako. Kwa kuwa imeundwa kwa mafaili ya msimbo, itazingatia mambo kama camel case. -_Error Lens_ itakusaidia kugundua hitilafu zozote zilizoangaziwa katika msimbo wako. Badala ya kutegemea mstari wa chini unaoonyeshwa na VS Code kwa chaguo-msingi, kiongezi hiki kinaangazia mstari mzima na kuonyesha ujumbe wa hitilafu. +Error Lens hufanya hitilafu katika msimbo wako zisizoweza kupuuzwa kwa urahisi. Badala ya kutegemea mstari wa chini unaoonyeshwa na VS Code kwa chaguo-msingi, ugani huu unaangazia mstari mzima na kuonyesha ujumbe wa hitilafu ndani ya mstari. -_Indent Rainbow_ huongeza rangi kwa viwango tofauti vya uingizaji mstari wako. Kwa kushirikiana na rangi za jozi za mabano za asili za VS Code, hii inaweza kusaidia sana kutambua wigo wa msimbo wako. +Indent Rainbow huongeza rangi kwa ngazi zako tofauti za kuingiza mstari. Kwa kushirikiana na rangi za asili za VS Code kwa jozi za mabano, hii inaweza kusaidia sana kutambua wigo wa msimbo wako. -Au labda unatafuta kitu kidogo cha vitendo zaidi? Fikiria msaidizi wa AI, kama _GitHub Copilot_ au _Tabnine_, kutoa mapendekezo ndani ya mstari unapoandika msimbo wako. +Au labda unatafuta kitu kidogo cha vitendo zaidi? Fikiria msaidizi wa AI, kama GitHub Copilot au Tabnine, kutoa mapendekezo ndani ya mstari unapoandika msimbo wako. -Kifurushi cha alama, kama _VS Code Great Icons_, kinaweza kusaidia kufanya mpangilio wako wa faili kuwa safi na rahisi kusoma kwa mtazamo wa haraka. Na kiongezi kama _Colorize_ kinaweza kusaidia kuelewa thamani katika vigezo vyako vya CSS. +Kifurushi cha alama, kama VS Code Great Icons, kinaweza kusaidia kufanya mpangilio wa faili wako kuwa safi na rahisi kusoma kwa mtazamo wa haraka. Na ugani kama Colorize unaweza kusaidia kuelewa thamani katika vigezo vyako vya CSS. -Pia utahitaji viongezi maalum vya lugha kwa miradi yako. Ikiwa unatumia JavaScript, huenda ukahitaji _ESLint_ na _Prettier_ kwa kusafisha na kuunda msimbo wako. Ikiwa unatumia TypeScript, unaweza kutaka _Pretty TypeScript Errors_ kwa ujumbe rahisi kusoma. +Pia utahitaji ugani maalum wa lugha kwa miradi yako. Ikiwa unatumia JavaScript, huenda ukahitaji ESLint na Prettier kusahihisha na kupanga msimbo wako. Ikiwa unatumia TypeScript, unaweza kutaka Pretty TypeScript Errors kwa ujumbe rahisi kusoma. -Mwishowe, unaweza pia kufurahia kidogo na mhariri wako. _VS Code Pets_ hutoa wanyama wa kufikirika unaoweza kusanidiwa ili kukuweka pamoja wakati unapotafuta hitilafu. +Mwishowe, unaweza pia kufurahia kidogo na mhariri wako. VS Code Pets hutoa wanyama wa kufikirika wanaoweza kubadilishwa kukuweka pamoja wakati unapotatua hitilafu. -_Power Mode_ itaunda athari za kuvutia unapopata "combo" ya kutosha kwa kuandika msimbo zaidi. +Power Mode itaunda athari za kuvutia unapoandika msimbo zaidi na kufikia "combo" ya kutosha. -_Discord Presence_ itakuwezesha kuonyesha kile unachofanya kwa marafiki zako wote. +Discord Presence itakuwezesha kuonyesha kile unachofanya kwa marafiki zako wote. Na kuna viongezi vingi zaidi huko nje. Tafadhali jisikie huru kuchunguza soko la viongezi na kuona kinachokufaa zaidi. @@ -33,7 +33,7 @@ Na kuna viongezi vingi zaidi huko nje. Tafadhali jisikie huru kuchunguza soko la ## --text-- -Ni kipengele gani kinachotolewa na kiongezi cha "Better Comments" katika VS Code? +Ni kipengele gani ugani wa Better Comments hutoa katika VS Code? ## --answers-- @@ -69,7 +69,7 @@ Funzo linataja jinsi kiongezi hiki kinavyoathiri aina fulani za maoni. ## --text-- -Ni kiongezi gani cha VS Code kinachoelezwa kusaidia kugundua hitilafu zilizoangaziwa katika msimbo wako kwa kuonyesha ujumbe wa hitilafu kwenye mstari mzima? +Ni ugani gani wa VS Code unaoangazia mstari mzima na kuonyesha ujumbe wa hitilafu ndani ya mstari, badala ya kutegemea mstari wa chini wa chaguo-msingi? ## --answers-- @@ -105,7 +105,7 @@ Funzo linataja kiongezi kinachoongeza uonekano wa hitilafu zaidi ya mstari wa ch ## --text-- -Ni kipengele gani cha kipekee kinachotolewa na kiongezi cha "VS Code Pets"? +Ni kipengele gani cha kipekee ugani wa VS Code Pets hutoa? ## --answers-- diff --git a/curriculum/challenges/swahili/blocks/lecture-working-with-css-flexbox/672aa7f7284b235f46f7d4e9.md b/curriculum/challenges/swahili/blocks/lecture-working-with-css-flexbox/672aa7f7284b235f46f7d4e9.md index 47971726bf3..b18d6ef8115 100644 --- a/curriculum/challenges/swahili/blocks/lecture-working-with-css-flexbox/672aa7f7284b235f46f7d4e9.md +++ b/curriculum/challenges/swahili/blocks/lecture-working-with-css-flexbox/672aa7f7284b235f46f7d4e9.md @@ -319,7 +319,7 @@ Mhimili mkuu daima ni wa usawa, wakati mhimili wa msalaba daima ni wa wima. ### --feedback-- -Fikiria mgawanyo wa vipengele ndani ya kontena cha kubadilika. +Fikiria jinsi mhimili mkuu na mhimili wa msalaba wanavyopangwa kwa uhusiano na kila mmoja. --- @@ -327,7 +327,7 @@ Mhimili mkuu daima ni wa wima, wakati mhimili wa msalaba daima ni wa usawa. ### --feedback-- -Fikiria mgawanyo wa vipengele ndani ya kontena cha kubadilika. +Fikiria jinsi mhimili mkuu na mhimili wa msalaba wanavyopangwa kwa uhusiano na kila mmoja. --- @@ -339,7 +339,7 @@ Mhimili mkuu na mhimili wa msalaba daima ni sambamba kwa kila mmoja. ### --feedback-- -Fikiria mgawanyo wa vipengele ndani ya kontena cha kubadilika. +Fikiria jinsi mhimili mkuu na mhimili wa msalaba wanavyopangwa kwa uhusiano na kila mmoja. ## --video-solution-- diff --git a/curriculum/challenges/swahili/blocks/lecture-working-with-css-flexbox/672bd658c0e190f674a5e057.md b/curriculum/challenges/swahili/blocks/lecture-working-with-css-flexbox/672bd658c0e190f674a5e057.md index 44373a433cc..aed54f2e890 100644 --- a/curriculum/challenges/swahili/blocks/lecture-working-with-css-flexbox/672bd658c0e190f674a5e057.md +++ b/curriculum/challenges/swahili/blocks/lecture-working-with-css-flexbox/672bd658c0e190f674a5e057.md @@ -7,11 +7,11 @@ dashedName: what-are-some-common-flex-properties # --interactive-- -Sifa za flex ni sifa unazoweza kutumia kwenye vyombo vya kubadilika ili kuamua mgawanyo wa vipengele vidogo. Tutazungumzia baadhi ya sifa zinazotumika sana: `flex-wrap`, `justify-content`, na `align-items`. +Sifa za kubadilika (flex) hudhibiti jinsi vipengele vinavyojitendea ndani ya mpangilio wa kubadilika, kuanzia usambazaji wa ngazi ya kontena hadi ulinganifu wa kipande cha kubadilika kwa ajili ya kujipanga mwenyewe. Tutazungumzia baadhi ya sifa zinazotumika sana katika funzo hili: `flex-wrap`, `flex-flow`, `justify-content`, `align-items`, na `align-self`. -Tuanze na `flex-wrap`. Sifa hii inaamua jinsi vipande vya kubadilika vinavyopakiwa ndani ya chombo cha kubadilika ili kufaa nafasi iliyopo. `flex-wrap` inaweza kuchukua thamani tatu zinazowezekana: `nowrap`, `wrap`, na `wrap-reverse`. `nowrap` ni thamani ya chaguo-msingi—vipande vya kubadilika havitapakiwa kwenye mstari mpya, hata kama upana wao unazidi upana wa kontena. +Tuanze na `flex-wrap`. Sifa hii inaamua jinsi vipande vya kubadilika vinavyofunikwa ndani ya kontena cha kubadilika ili kufaa nafasi iliyopo. `flex-wrap` inaweza kuchukua thamani tatu zinazowezekana: `nowrap`, `wrap`, na `wrap-reverse`. `nowrap` ni thamani ya msingi: vipande vya kubadilika havitafunikwa kwenye mstari mpya, hata kama upana wao unazidi upana wa kontena. -Katika msimbo hapa chini, tuna vipande vitatu vya `div`. Tuwe makini na `width`. Kontena la `main` lililopakwa mpaka jekundu lina `width` ya `200px`, wakati vipande vitatu vya `div` vilivyo ndani yake vina `width` ya `240px` (`80px` kila kimoja): +Katika msimbo uliopo hapa chini, tuna vipengele vitatu vya `div`. Tuwe makini na `width`. Kontena kuu la `main` lenye mpaka lina `width` ya `200px`, wakati vipande vitatu vya `div` vya watoto wake kwa pamoja vina `width` ya `240px` (`80px` kila kimoja): :::interactive_editor @@ -28,7 +28,7 @@ Katika msimbo hapa chini, tuna vipande vitatu vya `div`. Tuwe makini na `width`. main { width: 200px; display: flex; - border: 2px solid red; + border: 2px solid #444; } div { @@ -51,7 +51,6 @@ div { ::: - Upana wa vipande vya `div` unazidi upana wa kontena lao, lakini kwa chaguo-msingi vitapunguzwa ili kufaa nafasi iliyopo. Ikiwa unataka vipande vipakwe mstari mpya wanapozidi upana wa kontena lao, unaweza kuweka `flex-wrap: wrap` kwenye chombo cha kubadilika: :::interactive_editor @@ -70,7 +69,7 @@ main { width: 200px; display: flex; flex-wrap: wrap; - border: 2px solid red; + border: 2px solid #444; } div { @@ -109,9 +108,10 @@ Vipande vya `div` vitapangwa upya kwa safu wanapozidi upana wa kontena lao. Unaw ```css main { width: 200px; + height: 120px; display: flex; flex-flow: column wrap-reverse; - border: 2px solid red; + border: 2px solid #444; } div { @@ -151,7 +151,7 @@ Nzuri. Sasa tuzungumzie `justify-content`. `justify-content` huweka vipengele vi main { display: flex; justify-content: flex-start; - border: 2px solid red; + border: 2px solid #444; } div { @@ -191,7 +191,7 @@ Kwa `justify-content: flex-end`, vipande vya kubadilika vinawekwa mwishoni mwa m main { display: flex; justify-content: flex-end; - border: 2px solid red; + border: 2px solid #444; } div { @@ -231,7 +231,7 @@ Ili kuweka vipande vya kubadilika katikati ya mhimili mkuu, unaweza kutumia `jus main { display: flex; justify-content: center; - border: 2px solid red; + border: 2px solid #444; } div { @@ -254,7 +254,7 @@ div { ::: -Ili kugawanya vipengele kwa usawa kwenye mhimili mkuu, unaweza kutumia `justify-content: space-between`. Hii itaongeza nafasi kati ya vipande vya kubadilika ikiwa itahitajika. +Ili kusambaza vipengele kando ya mhimili mkuu bila nafasi kwenye mipaka, unaweza kutumia `justify-content: space-between`. Kipande cha kwanza kimewekwa mwanzoni mwa mhimili mkuu, kipande cha mwisho kimewekwa mwishoni, na nafasi iliyobaki husambazwa kati ya vipande vinavyopakana. :::interactive_editor @@ -271,7 +271,7 @@ Ili kugawanya vipengele kwa usawa kwenye mhimili mkuu, unaweza kutumia `justify- main { display: flex; justify-content: space-between; - border: 2px solid red; + border: 2px solid #444; } div { @@ -294,7 +294,7 @@ div { ::: -`justify-content: space-around` hugawanya vipande vya kubadilika kwa usawa ndani ya mhimili mkuu, ikiongeza nafasi kabla ya kipande cha kwanza na baada ya kipande cha mwisho. Nafasi hii ya ziada ni nusu ya nafasi kati ya kila jozi ya vipande vinavyopakana. Ikiwa kuna kipande kimoja tu cha kugawa, kitawekwa katikati. +`justify-content: space-around` husambaza vipande vya kubadilika kwa usawa kando ya mhimili mkuu, ikiongeza nafasi kabla ya kipande cha kwanza na baada ya kipande cha mwisho. Nafasi hii ya ziada ni nusu ya nafasi kati ya kila jozi ya vipande vinavyopakana. Ikiwa kuna kipande kimoja tu cha kusambaza, kitakuwa katikati. :::interactive_editor @@ -311,7 +311,7 @@ div { main { display: flex; justify-content: space-around; - border: 2px solid red; + border: 2px solid #444; } div { @@ -334,8 +334,7 @@ div { ::: - -Na mwisho lakini sio wa chini, tuna `justify-content: space-evenly`, ambayo hugawanya vipande kwa usawa kwenye mhimili mkuu. Nafasi kati ya vipande na nafasi kabla na baada ya vipengele vya kwanza na vya mwisho ni sawa kabisa: +Na mwisho lakini si wa mwisho, tuna `justify-content: space-evenly`, ambayo husambaza vipande kwa usawa kando ya mhimili mkuu. Nafasi kati ya vipande na nafasi kabla na baada ya vipengele vya kwanza na vya mwisho ni sawa kabisa: :::interactive_editor @@ -352,7 +351,7 @@ Na mwisho lakini sio wa chini, tuna `justify-content: space-evenly`, ambayo huga main { display: flex; justify-content: space-evenly; - border: 2px solid red; + border: 2px solid #444; } div { @@ -390,10 +389,10 @@ Nzuri. Sasa unajua jinsi ya kugawanya vipande vya kubadilika kwenye mhimili mkuu ```css main { - height: 300px; display: flex; + height: 300px; align-items: center; - border: 2px solid red; + border: 2px solid #444; } div { @@ -431,10 +430,10 @@ Katika mfano huu, vipande vya kubadilika vimewekwa katikati ya mhimili wa msalab ```css main { - height: 300px; display: flex; + height: 300px; align-items: flex-start; - border: 2px solid red; + border: 2px solid #444; } div { @@ -472,10 +471,10 @@ Kinyume chake ni `align-items: flex-end`. Hii itaweka vipande vya kubadilika mwi ```css main { - height: 300px; display: flex; + height: 300px; align-items: flex-end; - border: 2px solid red; + border: 2px solid #444; } div { @@ -498,33 +497,43 @@ div { ::: -Ili kunyoosha vipande vya kubadilika kwenye mhimili wa msalaba, unaweza kutumia `align-items: stretch`. Hii pia hufanya kazi na vipengele vinavyopimwa kiotomatiki, kama vile visivyo na `width` au `height` vilivyowekwa, au vinavyopimwa kwa kiwango cha chini tu cha `width` au `height`. Vipande vya kubadilika vitanyoshwa kujaza kontena kwa mwelekeo wa mhimili wa msalaba. +Ili kunyoosha vipande vya kubadilika kando ya mhimili wa msalaba, unaweza kutumia `align-items: stretch`. Hii inaathiri tu vipande vyenye ukubwa wa mhimili wa msalaba ni `auto`; vipande vyenye ukubwa maalum wa mhimili wa msalaba (kwa mfano, `height` iliyowekwa katika kontena la safu) havitanyoshwa. Vipande vinavyoathiriwa vitajaza kontena kwa mwelekeo wa mhimili wa msalaba. :::interactive_editor ```html <link rel="stylesheet" href="styles.css"> - -<div class="container"> - <div class="box">One</div> - <div class="box">Two</div> - <div class="box">Three</div> -</div> - +<main> + <div id="first-div"></div> + <div id="second-div"></div> + <div id="third-div"></div> +</main> ``` ```css -.container { +main { display: flex; - align-items: stretch; + height: 300px; + align-items: stretch; border: 2px solid #444; - height: 200px; } -.box { - width: 100px; - border: 1px solid #888; - background-color: lightblue; +div { + width: 80px; + height: 50px; +} + +#first-div { + background-color: #4d70b2; +} + +#second-div { + background-color: #5c4db2; +} + +#third-div { + background-color: #4da3b2; + height: auto; } ``` @@ -536,33 +545,37 @@ Na mwisho kabisa, unaweza kutumia sifa ya `align-self` kuweka ulinganifu tofauti ```html <link rel="stylesheet" href="styles.css"> - -<div class="container"> - <div class="box">One</div> - <div class="box">Two</div> - <div class="box special">Three</div> -</div> - +<main> + <div id="first-div"></div> + <div id="second-div"></div> + <div id="third-div"></div> +</main> ``` ```css -.container { +main { display: flex; - align-items: flex-start; + height: 300px; + align-items: flex-start; border: 2px solid #444; - height: 200px; } -.box { - width: 100px; - border: 1px solid #888; - background-color: lightblue; - margin: 4px; +div { + width: 80px; + height: 50px; } -.special { - align-self: stretch; - background-color: lightcoral; +#first-div { + background-color: #4d70b2; +} + +#second-div { + background-color: #5c4db2; +} + +#third-div { + background-color: #4da3b2; + align-self: stretch; } ``` @@ -574,33 +587,37 @@ Unaweza kukiweka katikati kwa `align-self: center`. ```html <link rel="stylesheet" href="styles.css"> - -<div class="container"> - <div class="box">One</div> - <div class="box">Two</div> - <div class="box special">Three</div> -</div> - +<main> + <div id="first-div"></div> + <div id="second-div"></div> + <div id="third-div"></div> +</main> ``` ```css -.container { +main { display: flex; - align-items: flex-start; + height: 300px; + align-items: flex-start; border: 2px solid #444; - height: 200px; } -.box { - width: 100px; - border: 1px solid #888; - background-color: lightblue; - margin: 4px; +div { + width: 80px; + height: 50px; +} + +#first-div { + background-color: #4d70b2; +} + +#second-div { + background-color: #5c4db2; } -.special { - align-self: center; - background-color: lightcoral; +#third-div { + background-color: #4da3b2; + align-self: center; } ``` @@ -612,33 +629,37 @@ Unaweza kukiweka mwanzoni mwa mhimili wa msalaba kwa `align-self: flex-start`. ```html <link rel="stylesheet" href="styles.css"> - -<div class="container"> - <div class="box">One</div> - <div class="box">Two</div> - <div class="box special">Three</div> -</div> - +<main> + <div id="first-div"></div> + <div id="second-div"></div> + <div id="third-div"></div> +</main> ``` ```css -.container { +main { display: flex; - align-items: flex-start; + height: 300px; + align-items: flex-start; border: 2px solid #444; - height: 200px; } -.box { - width: 100px; - border: 1px solid #888; - background-color: lightblue; - margin: 4px; +div { + width: 80px; + height: 50px; +} + +#first-div { + background-color: #4d70b2; } -.special { - align-self: flex-start; - background-color: lightcoral; +#second-div { + background-color: #5c4db2; +} + +#third-div { + background-color: #4da3b2; + align-self: flex-start; } ``` @@ -650,39 +671,43 @@ Au unaweza kukiweka mwishoni mwa mhimili wa msalaba kwa `align-self: flex-end`. ```html <link rel="stylesheet" href="styles.css"> - -<div class="container"> - <div class="box">One</div> - <div class="box">Two</div> - <div class="box special">Three</div> -</div> - +<main> + <div id="first-div"></div> + <div id="second-div"></div> + <div id="third-div"></div> +</main> ``` ```css -.container { +main { display: flex; - align-items: flex-start; + height: 300px; + align-items: flex-start; border: 2px solid #444; - height: 200px; } -.box { - width: 100px; - border: 1px solid #888; - background-color: lightblue; - margin: 4px; +div { + width: 80px; + height: 50px; } -.special { - align-self: flex-end; - background-color: lightcoral; +#first-div { + background-color: #4d70b2; +} + +#second-div { + background-color: #5c4db2; +} + +#third-div { + background-color: #4da3b2; + align-self: flex-end; } ``` ::: -Kuna sifa na thamani nyingine za flex unazoweza kuchagua ili kuunda mpangilio unaojibadilisha kulingana na kifaa unaotaka, lakini hizi ndizo zinazotumika zaidi. Kwa sifa hizi za CSS flex na maarifa yako mapya ya mfano wa CSS flex, unaweza kuanza kuunda mipangilio inayojibadilisha kulingana na kifaa ili kuleta uzoefu laini na jumuishi kwa watumiaji kwenye vifaa mbalimbali. +Kuna sifa na thamani nyingine za kubadilika ambazo unaweza kuchagua kuunda mpangilio unaojibadilisha kulingana na kifaa unachotaka, lakini hizi ndizo zinazotumika zaidi. Kwa kutumia sifa hizi za CSS flex na maarifa yako mapya ya mfano wa CSS flex, unaweza kuanza kuunda mipangilio inayojibadilisha kulingana na kifaa ili kuleta uzoefu laini na jumuishi kwa watumiaji kwenye vifaa mbalimbali. # --questions-- @@ -764,7 +789,7 @@ Ni sifa gani kati ya hizi zinaweza kuunganishwa kuwa sifa ya `flex-flow`? ## --answers-- -`flex-direction` na `justify-content`. +`flex-direction` na `justify-content` ### --feedback-- @@ -772,7 +797,7 @@ Fikiria mambo mawili makuu ya jinsi vipande vya kubadilika vinavyopangwa. --- -`flex-direction` na `align-items`. +`flex-direction` na `align-items` ### --feedback-- @@ -780,7 +805,7 @@ Fikiria mambo mawili makuu ya jinsi vipande vya kubadilika vinavyopangwa. --- -`flex-direction` na `align-content`. +`flex-direction` na `align-content` ### --feedback-- @@ -788,7 +813,7 @@ Fikiria mambo mawili makuu ya jinsi vipande vya kubadilika vinavyopangwa. --- -`flex-direction` na `flex-wrap`. +`flex-direction` na `flex-wrap` ## --video-solution-- diff --git a/curriculum/challenges/swahili/blocks/lecture-working-with-css-fonts/672bd814105a0ffcf36f9233.md b/curriculum/challenges/swahili/blocks/lecture-working-with-css-fonts/672bd814105a0ffcf36f9233.md index 92933cf2948..345a09b74cf 100644 --- a/curriculum/challenges/swahili/blocks/lecture-working-with-css-fonts/672bd814105a0ffcf36f9233.md +++ b/curriculum/challenges/swahili/blocks/lecture-working-with-css-fonts/672bd814105a0ffcf36f9233.md @@ -11,6 +11,8 @@ Familia ya fonti ni kundi la fonti zinazoshiriki muundo wa pamoja. Fonti zote zi <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/what-are-font-families-and-how-do-they-work-1.png" alt="Diagram showing 'Arial' at the top with two blue arrows pointing down to 'Arial Bold' on the left and 'Arial Italic' on the right, illustrating font family variations" /> +## Kuweka Familia za Fonti katika CSS + Katika CSS, unaweza kuweka familia ya fonti kwa kutumia sifa ya `font-family`. Hapa kuna mfano wa kuweka fonti kwa aya kuwa `Arial`: :::interactive_editor @@ -29,6 +31,8 @@ Katika CSS, unaweza kuweka familia ya fonti kwa kutumia sifa ya `font-family`. H ::: +## Fonti za Njia Mbadala + Lakini vipi kama familia ya fonti haipatikani? Unaweza kubainisha familia nyingi za fonti kwa mpangilio wa kipaumbele, kutoka juu hadi chini, kwa kuzitenganisha kwa koma. Fonti hizi mbadala zitafanya kazi kama njia mbadala. Katika mfano huu, Arial ni fonti kuu na Lato ni fonti mbadala: :::interactive_editor @@ -51,13 +55,15 @@ Kivinjari kitaonyesha fonti ya kwanza (Arial) ikiwa itapatikana kwenye kifaa. Ik Unapaswa pia kujua jinsi mchakato huu unavyofanya kazi nyuma ya pazia. Mchakato wa kuchagua hauishi ikiwa fonti ya kwanza inapatikana. Familia ya fonti huchaguliwa herufi moja kwa moja, hivyo ikiwa fonti haijumuishi herufi fulani, kivinjari hutatiza kutafuta herufi hiyo katika fonti zilizo na kipaumbele cha chini. Inavutia, sivyo? +## Familia za Fonti za Kawaida + Katika muktadha wa ukuzaji wa mtandao, pia utapata familia za fonti za jumla. Ni muhimu sana. Familia ya fonti ya jumla ni fonti ya msingi ambayo vivinjari vya mtandao vitaonyesha wakati fonti zilizo na kipaumbele cha juu hazipatikani. Ili kuhakikisha maudhui bado yanasomeka, kivinjari hubadilisha fonti ya awali na fonti inayofaa zaidi inayopatikana, kulingana na familia ya fonti ya jumla iliyobainishwa. Baadhi ya familia zinazotumika sana ni: - serif - sans-serif - monospace - cursive -- fantasy +- fantasy Lakini kuna chaguzi zaidi za kuchagua. Katika msimbo hapa chini, tuna familia tatu mbadala za fonti: @@ -81,6 +87,8 @@ Arial ina kipaumbele cha juu zaidi. Ikiwa Arial haitapatikana, basi kivinjari ki Unapaswa kila mara kujumuisha familia ya fonti ya jumla mwishoni mwa orodha ya familia za fonti. Kumbuka kwamba fonti ya jumla inaweza kuonekana tofauti na fonti uliyokuwa umeipanga awali katika muundo wako, hivyo ni msaada kila mara kuangalia jinsi fonti hizi mbadala zinavyoonekana kwenye vivinjari tofauti. +## Fonti Salama za Mtandao + Ili kufanya uzoefu wa mtumiaji kuwa thabiti iwezekanavyo, pia inashauriwa kutumia fonti salama za mtandao. Familia hizi za fonti kawaida huwa zimewekwa kwenye vifaa vingi, hivyo kuna uwezekano mkubwa wa kupatikana na kuonyeshwa kwa usahihi kwa watumiaji wengi. Utajifunza zaidi kuhusu hizo katika mafundisho yajayo. Familia za fonti ni muhimu katika ulimwengu wa muundo wa mtandao. Kwa kutumia sifa ya font-family, unaweza kubadilisha mara moja muonekano na hisia za maandishi yako. diff --git a/curriculum/challenges/swahili/blocks/lecture-working-with-css-fonts/672bd8453d1371fdb1510fe5.md b/curriculum/challenges/swahili/blocks/lecture-working-with-css-fonts/672bd8453d1371fdb1510fe5.md index f1a26751fa6..734ae82c585 100644 --- a/curriculum/challenges/swahili/blocks/lecture-working-with-css-fonts/672bd8453d1371fdb1510fe5.md +++ b/curriculum/challenges/swahili/blocks/lecture-working-with-css-fonts/672bd8453d1371fdb1510fe5.md @@ -11,6 +11,8 @@ Fonti ya nje ni faili ya fonti ambayo haijajumuishwa moja kwa moja ndani ya mafa Google Fonts na Font Squirrel ni rasilimali maarufu mtandaoni za kupata na kutumia fonti za bure kwa madhumuni ya ukuzaji wa mtandao. Unaweza kuziingiza kwenye miradi yako kwa urahisi sana. +## Fonti za Google + Tuanze na Google Fonts. Hii ni huduma ya Google inayotoa mkusanyiko wa fonti, nyingi zikiwa zimeundwa mahsusi kwa ajili ya ukuzaji wa mtandao. Kwenye kiolesura cha mtumiaji cha Google Fonts, utaona vipengele vingi tofauti. Tuchunguze moja baada ya jingine. Kwenye upau wa kushoto, utapata: - Sehemu ya kuona, kutafuta, na kuchuja fonti. @@ -18,6 +20,8 @@ Tuanze na Google Fonts. Hii ni huduma ya Google inayotoa mkusanyiko wa fonti, ny - Sehemu ambapo unaweza kupata na kupakua alama za ikoni kwa miradi yako ya mtandao. - Sehemu ambapo unaweza kujifunza zaidi kuhusu fonti na mbinu bora za matumizi yake, ikifuatiwa na maswali yanayoulizwa mara kwa mara. +## Kuangalia awali fonti za Google + Ili kuongeza fonti ya Google kwenye tovuti yako, unapaswa kwenda kwenye sehemu ya kwanza (Fonts). Unaweza kubadilisha maandishi ya onyesho kwenye upau wa kushoto, ambapo kuna maandishi "Preview." Andika tu maandishi unayotaka kuona na yatarekebishwa moja kwa moja. Hii ni msaada kuona fonti na maandishi ambayo tayari una mawazo yake kwa ajili ya tovuti yako. Pia unaweza kurekebisha ukubwa wa fonti na kuchuja fonti kulingana na sifa zao. <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-1.png" alt="Google Fonts Fonts section showing a left sidebar with preview text set to 'freeCodeCamp' at 40px, filter options for Language, Technology, and Decorative stroke, and the main panel listing font families including Roboto, SUSE, and Sevillana each previewing 'freeCodeCamp'" /> @@ -28,12 +32,16 @@ Unaweza kubadilisha ukubwa wa maandishi ya onyesho kwa kutumia kipengele cha ran <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-2.png" alt="Google Fonts Roboto Styles page with Specimen, Type tester, Glyphs, and About & license tabs, a blue Get font button, a preview text field showing 'freeCodeCamp' with a font size slider at 48px, and a list of styles including Thin 100, Thin 100 Italic, Light 300, and Light 300 Italic" /> +## Kutumia fonti za Google + Ukijiandaa kuongeza fonti kwenye mradi wako, bofya kitufe cha bluu cha "Get font" juu. Utaelekezwa kwenye ukurasa wa muhtasari ambapo utaona fonti ulizochagua kwa sasa. Unaweza kuchagua fonti nyingi kwa wakati mmoja. <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-3.png" alt="Google Fonts page showing '1 font family selected' with Roboto Static listed, Get embed code and Download all buttons on the right, and a How to use section with All, Design, Develop, and Google products tabs" /> Kisha, unapaswa kuchagua kama ungependa kupakua mafaili ya fonti na kuyaongeza kwenye mradi wako kama mafaili ya ndani au ungependa kuyatumia kama fonti za nje na kuyapakua kutoka kwenye seva za Google wakati mtumizi anapoingia kwenye tovuti yako. Bofya "Download all" ikiwa unataka kuyapakua lakini kama unapendelea kuyatumia kama fonti za nje kwenye seva za Google, bofya "Get embed code." Ukibofya "Get embed code," utaona maelekezo unayopaswa kufuata ili kuongeza fonti hizi za nje kwenye mradi wako. +### Kuunganisha fonti za Google kwa kutumia link + Kwa miradi ya ukuzaji wa mtandao, una chaguzi mbili. Unaweza kutumia kipengele cha `link` au `@import`. Ukichagua chaguo la kipengele cha `link`, unaweza kunakili na kubandika kipande cha HTML na sheria za CSS ili kuziingiza kwenye mradi wako. Unapaswa kuingiza msimbo huo katika kipengele cha `head` cha faili yako ya HTML na kuongeza sheria za CSS zinazokidhi mahitaji yako. <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-4.png" alt="Google Fonts Embed code page with the link element option selected, showing three link tags for preconnect and the font stylesheet, a CSS classes section with .roboto-thin, .roboto-light, .roboto-regular, and .roboto-medium rules, and a left sidebar showing font style toggles" /> @@ -141,6 +149,8 @@ Hapa kuna mfano wa kutumia mitindo yote ya Roboto: Kuna sheria ya CSS kwa kila mtindo wa fonti. Kila sheria inaweka fonti maalum pamoja na fonti za njia mbadala ikiwa fonti maalum hazipakuliwi vizuri. +### Import fonti za Google + Ukichagua chaguo la `@import` badala yake, utahitaji kuongeza sheria hiyo kwenye faili yako ya CSS. <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-5.png" alt="Google Fonts Embed code page with the @import option selected, showing a style block containing the @import URL rule, a CSS classes section below, and the left sidebar with font style toggles" /> @@ -159,10 +169,14 @@ Ikiwa unataka tu kujumuisha mitindo maalum ya fonti, pia una chaguo la kuondoa m Na hii ni Google Fonts. Ni mojawapo ya chaguzi maarufu zaidi za kupata fonti za bure na chanzo huru kwa miradi ya ukuzaji wa mtandao. +## Font Squirrel + Chaguo jingine zuri ni Font Squirrel, ambapo unaweza kupata na kupakua fonti maalum unazoziona kwa ajili ya muundo wako. <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-7.png" alt="Font Squirrel 'Free Font Utopia' page listing featured free fonts including Acherus Grotesque, Intro Rust, Source Sans Pro, Open Sans, and Questa, each shown with an alphabet specimen and a Download button" /> +## Kuangalia awali Font Squirrel + Ukitafuta fonti na kubofya matokeo, utaona maelezo zaidi kuhusu fonti hiyo, ikiwa ni pamoja na sampuli, jaribio la kuendesha, alama, na kifurushi cha Webfont. <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-8.png" alt="Font Squirrel search results for 'Roboto' showing three matches: Roboto, Roboto 2014, and Roboto Slab, each with an alphabet specimen and a Download TTF button" /> @@ -173,6 +187,8 @@ Pia unaweza kuona sampuli za mitindo na mabadiliko tofauti ya fonti, kama nyemba <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-10.png" alt="Font Squirrel Roboto Specimens section listing all styles with alphabet samples: Roboto Thin, Thin Italic, Light, Light Italic, Regular, Italic, Medium, Medium Italic, Bold, Bold Italic, and Black, each in its respective weight" /> +## Kutumia Font Squirrel + Mara umeamua fonti unayotaka kutumia kwenye mradi wako, nenda kwenye kichupo cha "Webfont Kit." Hapa, unaweza kuangalia kama leseni ya fonti inakuruhusu kuitumia katika uingizaji wa `@font-face` CSS. Pia unaweza kuchagua seti ndogo na muundo. <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-11.png" alt="Font Squirrel Roboto Webfont Kit tab showing a license notice confirming @font-face embedding is allowed, a subset selector set to Western Latin, format checkboxes with WOFF selected, and a Download @font-face Kit button" /> @@ -221,7 +237,7 @@ Kuongeza uteuzi na aina za fonti. --- -Kuboresha ulinganifu wa kivinjari. +Kuboresha muafaka wa vivinjari. ### --feedback-- diff --git a/curriculum/challenges/swahili/blocks/lecture-working-with-css-fonts/672bd853c985cdfdeb32f4f9.md b/curriculum/challenges/swahili/blocks/lecture-working-with-css-fonts/672bd853c985cdfdeb32f4f9.md index 20c46b3690a..4a70e424591 100644 --- a/curriculum/challenges/swahili/blocks/lecture-working-with-css-fonts/672bd853c985cdfdeb32f4f9.md +++ b/curriculum/challenges/swahili/blocks/lecture-working-with-css-fonts/672bd853c985cdfdeb32f4f9.md @@ -13,6 +13,8 @@ CSS haifanyi vivuli vyovyote kwenye maandishi kwa chaguo-msingi. Hii ni mfano wa text-shadow: /* Values */ ``` +## Thamani za mbali za `X` na `Y` + Katika CSS, unaweza kuelezea kivuli kupitia mchanganyiko wa `X` mbali, `Y` mbali, mduara wa blur, na rangi. Kwanza, unahitaji kubainisha `X` na `Y` mbali, ambazo zinawakilisha umbali wa usawa na wima wa kivuli kutoka kwenye maandishi, mtawalia. Thamani hizi zinahitajika. Hapa kuna mfano wa jinsi ya kutumia `X` na `Y` mbali kwenye kivuli. Tunatumia sifa ya `text-shadow` na x-offset ya `3px` na y-offset ya `2px`: @@ -32,7 +34,11 @@ p { ::: -Kwenye kivinjari, maandishi na kivuli vitaonekana sawa lakini pia tunaweza kubinafsisha rangi ya kivuli kwa kubainisha thamani kabla au baada ya mbali. Hebu tuchague rangi ya kivuli. Tutatumia rangi ya hexadecimal hapa lakini unaweza kutumia aina yoyote halali ya rangi. +Kwenye kivinjari, maandishi na kivuli vitaonekana kufanana. + +## Kuongeza Rangi kwa Kivuli + +Tunaweza pia kubinafsisha rangi ya kivuli kwa kubainisha thamani kabla au baada ya mbali. Hebu tuchague rangi ya kivuli. Tutatumia rangi ya hexadecimal hapa lakini unaweza kutumia aina yoyote halali ya rangi. :::interactive_editor @@ -66,7 +72,11 @@ p { ::: -Kwenye kivinjari, kivuli kitakuwa na rangi maalum, hivyo tunaweza kukitofautisha kwa urahisi kutoka kwenye maandishi. Sasa tunapoweza kutofautisha kivuli kutoka kwenye maandishi, pia ni muhimu kuona jinsi thamani chanya na hasi zinavyoathiri mbali ya kivuli. Thamani chanya za `X` mbali na `Y` mbali zitahamisha kivuli kulia na chini, mtawalia, wakati thamani hasi zitahamisha kivuli kushoto na juu. Hapa kuna mfano unaotumia thamani hasi badala yake: +Kwenye kivinjari, kivuli kitakuwa na rangi maalum, hivyo tunaweza kukitofautisha kwa urahisi kutoka kwa maandishi. + +## Thamani Chanya na Hasi za Mbali + +Sasa tunapoweza kutofautisha kivuli kutoka kwa maandishi, pia ni muhimu kuona jinsi thamani chanya na hasi zinavyoathiri mbali ya kivuli. Thamani chanya za mbali za `X` na `Y` zitahamisha kivuli kulia na chini, mtawalia, wakati thamani hasi zitahamisha kivuli kushoto na juu. Hapa kuna mfano unaotumia thamani hasi badala yake: :::interactive_editor @@ -83,7 +93,11 @@ p { ::: -Sasa kivuli kitaenda kushoto na juu kuhusiana na maandishi. Nzuri. Lakini kivuli hakionekani vizuri sana, kwa sababu kinaonekana kama maandishi halisi tu yaliyowekwa nyuma yake. Ili kiweze kuonekana vizuri zaidi, tunahitaji kuongeza thamani ya tatu, mduara wa blur. Thamani hii ni hiari lakini hufanya kivuli kuonekana laini zaidi na kwa upole. Thamani ya chaguo-msingi ya mduara wa blur ni sifuri. Kadri thamani inavyoongezeka, ndivyo blur inavyokuwa kubwa, ambayo inamaanisha kivuli kinakuwa nyepesi. +Sasa kivuli kitaelea kushoto na juu kuhusiana na maandishi. Nzuri. + +## Mzunguko wa Blur + +Lakini kivuli hakionekani vizuri sana, kwa sababu kinafanana kabisa na maandishi ya asili lakini kimewekwa nyuma yake. Ili kuifanya ionekane nzuri zaidi, tunahitaji kuongeza thamani ya tatu, mzunguko wa blur. Thamani hii ni hiari lakini hufanya kivuli kuonekana laini zaidi na kwa upole zaidi. Thamani ya msingi ya mzunguko wa blur ni sifuri. Kadri thamani inavyoongezeka, ndivyo blur inavyokuwa kubwa zaidi, ambayo inamaanisha kuwa kivuli kinakuwa nyepesi. Hapa, tunaweka mduara wa blur kuwa `3px` na tunarudi kwenye thamani chanya za mbali: @@ -104,6 +118,8 @@ p { Sasa kinaanza kuonekana kama kivuli. Ni laini zaidi na kwa upole, hivyo tunaweza kuwa makini na maandishi kuu wakati kivuli kinaongeza mtindo nyuma yake. Kutoka hapa, tunaweza kubadilisha thamani kidogo hadi tupate mchanganyiko wa mbali, rangi, na mduara wa blur unaokidhi mahitaji yetu. +## Kuongeza Kivuli Nyingi + Pia ni msaada kujua kuwa maandishi yanaweza kuwa na vivuli zaidi ya kimoja. Unahitaji tu kuviandika katika sifa moja ya `text-shadow` zikigawanywa kwa koma. Vitawekwa kwa tabaka, kutoka mbele kwenda nyuma, na kivuli cha kwanza kiko juu. Hapa kuna mfano wa aya yenye vivuli vitatu vilivyotumika kwa tabaka. Angalia kuwa vivuli vyote hivi vimefafanuliwa katika sifa moja ya `text-shadow` na vimegawanywa kwa koma: diff --git a/curriculum/challenges/swahili/blocks/lecture-working-with-css-transforms-overflow-and-filters/672bccc8ea33bad87abb3c56.md b/curriculum/challenges/swahili/blocks/lecture-working-with-css-transforms-overflow-and-filters/672bccc8ea33bad87abb3c56.md index 2ba73680dd4..97f5615aeb6 100644 --- a/curriculum/challenges/swahili/blocks/lecture-working-with-css-transforms-overflow-and-filters/672bccc8ea33bad87abb3c56.md +++ b/curriculum/challenges/swahili/blocks/lecture-working-with-css-transforms-overflow-and-filters/672bccc8ea33bad87abb3c56.md @@ -19,6 +19,8 @@ Sifa hii inaweza kuwekwa kwenye kichaguzi cha ulimwengu (`*`) ili itumike kwa vi Thamani ya sifa ya `box-sizing` ni `content-box` kwa chaguo-msingi, lakini unaweza kuchagua `border-box` ikiwa unahitaji. Tutachunguza `content-box` kwanza kisha tutaingia kwenye `border-box`. +## Kukagua mfano wa kisanduku wa CSS + Ili kuelewa jinsi mifano inavyofanya kazi, unahitaji kufahamu dhana kuu nne kutoka kwa mfano wa boksi wa CSS. Hebu tukague haraka. - Eneo la maudhui ni nafasi inayochukuliwa na maudhui ya kipengele. @@ -26,6 +28,8 @@ Ili kuelewa jinsi mifano inavyofanya kazi, unahitaji kufahamu dhana kuu nne kuto - Mpaka ni mstari unaozunguka eneo la maudhui na nafasi ya ndani. - Ukingo ni nafasi nje ya mpaka inayotenganisha kipengele na vipengele vingine. +## Jinsi `content-box` inavyofanya kazi + Katika mfano wa `content-box`, upana na urefu unaoweka kwa kipengele huamua vipimo vya eneo la maudhui, lakini havijumuishi nafasi ya ndani, mpaka, au ukingo. Tumia `content-box` unapohitaji udhibiti sahihi wa eneo la maudhui. Unapoweka `width` na `height`, unakuwa umeweka ukubwa wa maudhui yenyewe tu. Ili kupata upana wa jumla wa kipengele, utahitaji kuongeza nafasi ya ndani ya kushoto na kulia, na mipaka ya kushoto na kulia. Vivyo hivyo, urefu wa jumla wa kipengele unaweza kupatikana kwa kuongeza urefu wa maudhui, nafasi ya ndani ya juu na chini, na mipaka ya juu na chini. @@ -52,10 +56,14 @@ div { Katika kesi hii, ikiwa `content-box` itatumika eneo la maudhui litakuwa 300px kwa 200px. Ukubwa wa jumla unaonyeshwa unajumuisha nafasi ya ndani na mipaka — kwa mfano, upana wa jumla = 300px (maudhui) + 40px (nafasi ya ndani) + 8px (mipaka) = 348px; urefu wa jumla unahesabiwa kwa njia ile ile. +## Jinsi `border-box` inavyofanya kazi + Nzuri! Sasa hebu tuchunguze `border-box`. Ni tofauti kwa sababu upana na urefu unaoweka unajumuisha maudhui ya kipengele, nafasi ya ndani, na mpaka (lakini si ukingo wake). Tumia `border-box` unapotaka ukubwa wa jumla wa kipengele ubaki thabiti hata kama nafasi ya ndani au mipaka itabadilika — hii mara nyingi husaidia katika mipangilio inayojibadilisha kulingana na kifaa. Kwa `border-box`, nafasi ya ndani na mipaka zinajumuishwa ndani ya ukubwa uliobainishwa wa kipengele. `width` na `height` unazoweka zinakuwa vipimo vya jumla vya kipengele: maudhui + nafasi ya ndani + mpaka; kingo hazijumuishwi. +## Kulinganisha mifano miwili + Katika mfano ufuatao, kuna vipengele viwili vya `div` vyenye vipimo sawa lakini thamani tofauti za `box-sizing`. Angalia jinsi hii inavyosababisha ukubwa tofauti wa jumla unapoangaliwa kwenye kivinjari: :::interactive_editor diff --git a/curriculum/challenges/swahili/blocks/lecture-working-with-dates/6733aafb9c0802f66cc1e056.md b/curriculum/challenges/swahili/blocks/lecture-working-with-dates/6733aafb9c0802f66cc1e056.md index f8cd2017dfd..bbf30c08d17 100644 --- a/curriculum/challenges/swahili/blocks/lecture-working-with-dates/6733aafb9c0802f66cc1e056.md +++ b/curriculum/challenges/swahili/blocks/lecture-working-with-dates/6733aafb9c0802f66cc1e056.md @@ -34,21 +34,31 @@ console.log(now); Kwa wakati, inatumia muundo wa saa za kijeshi, kwa hivyo `14:30` ni `2:30 PM`. `GMT-0700` ni mbali (offset) wa eneo la saa, na `Pacific Daylight Time` ni jina la eneo la saa. -Unaweza pia kuingiza tarehe na wakati maalum kwenye kitu cha `Date` kwa kutoa thamani za mwaka, mwezi, siku, saa, dakika, sekunde, na millisekunde kama hoja. +Hapa kuna mfano wa kuunda `Date` mpya kwa kutumia mfuatano wa herufi wa tarehe maalum: -Hapa kuna mfano wa kuunda kitu kipya cha `Date` na tarehe na wakati maalum: +:::interactive_editor + +```js +const dateFromString = new Date("July 4, 1776 12:00:00"); + +console.log(dateFromString); +``` + +::: + +Unaweza pia kuingiza tarehe na saa maalum kwa `Date` kwa kutoa thamani za mwaka, mwezi, siku, saa, dakika, sekunde, na millisekunde kama hoja: :::interactive_editor ```js -const specificDate = new Date("July 4, 1776 12:00:00"); +const dateFromArguments = new Date(1776, 6, 4, 12, 0, 0, 0); -console.log(specificDate); +console.log(dateFromArguments); ``` ::: -Hii ni muhimu unapohitaji kufanya kazi na tarehe na wakati maalum badala ya tarehe na wakati wa sasa. Ingizo lazima daima liwe mfuatano wa herufi, na muundo wake unapaswa kutambulika na kitu cha `Date`. +Hii ni muhimu unapohitaji kufanya kazi na tarehe na saa maalum badala ya tarehe na saa za sasa. Ili kupata tarehe na wakati wa sasa, unaweza kutumia njia ya `Date.now()` ambayo inarudisha idadi ya millisekunde tangu `January 1, 1970, 00:00:00 UTC`. Hii inajulikana kama wakati wa Unix epoch. diff --git a/curriculum/challenges/swahili/blocks/lecture-working-with-file-systems/672ac403a9ba7732b31c6480.md b/curriculum/challenges/swahili/blocks/lecture-working-with-file-systems/672ac403a9ba7732b31c6480.md index c587a1a9a58..94f82f94cc4 100644 --- a/curriculum/challenges/swahili/blocks/lecture-working-with-file-systems/672ac403a9ba7732b31c6480.md +++ b/curriculum/challenges/swahili/blocks/lecture-working-with-file-systems/672ac403a9ba7732b31c6480.md @@ -51,7 +51,7 @@ Na hatimaye, tuchunguze kuhusu nyaraka. Katika programu za mtandao, kawaida utap Kwa kawaida huandikwa katika muundo wa faili unaoitwa Markdown. Kwa Markdown, unaweza kuunda nyaraka zilizo na muundo wa kichwa cha sehemu, kichwa kidogo cha sehemu, viungo, picha, orodha, na zaidi. Mafaili ya Markdown yana kiambishi cha `.md` au `.markdown`. -Hapa unaweza kupata faili la `README` la hifadhi ya GitHub ya freeCodeCamp: https://github.com/freeCodeCamp/freeCodeCamp/blob/main/README.md +Hapa unaweza kupata faili ya `README` ya hifadhidata ya GitHub ya freeCodeCamp: `https://github.com/freeCodeCamp/freeCodeCamp/blob/main/README.md` Unaweza kuunda muundo huu wa kina na muundo kwa kutumia Markdown. diff --git a/curriculum/challenges/swahili/blocks/lecture-working-with-node-core-modules/695cc6a5eefd305381ec90bc.md b/curriculum/challenges/swahili/blocks/lecture-working-with-node-core-modules/695cc6a5eefd305381ec90bc.md index 93d5ed81341..85b2af7e3ca 100644 --- a/curriculum/challenges/swahili/blocks/lecture-working-with-node-core-modules/695cc6a5eefd305381ec90bc.md +++ b/curriculum/challenges/swahili/blocks/lecture-working-with-node-core-modules/695cc6a5eefd305381ec90bc.md @@ -148,7 +148,7 @@ async function readFileContent() { const fileContent = await fs.readFile("article.md", "utf8"); console.log("File content:", fileContent); } catch (err) { - console.log("File read successfully"); + console.error("Error reading file:", err); } } @@ -169,7 +169,7 @@ async function readFileContent() { const fileContent = await fs.readFile("article.md"); console.log("File content:", fileContent); } catch (err) { - console.log("File read successfully"); + console.error("Error reading file:", err); } } @@ -318,3 +318,4 @@ Kwa uchambuzi wa JSON, kwa mfano `fs.parseFile()`. ## --video-solution-- 4 + diff --git a/curriculum/challenges/swahili/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d2f232c60f0fa68ef86.md b/curriculum/challenges/swahili/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d2f232c60f0fa68ef86.md index 192b0786123..ad8b61a8d33 100644 --- a/curriculum/challenges/swahili/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d2f232c60f0fa68ef86.md +++ b/curriculum/challenges/swahili/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d2f232c60f0fa68ef86.md @@ -19,11 +19,11 @@ Kwa mfano: JavaScript ya upande wa mteja ina vikwazo hivi kwa sababu ilitengenezwa awali ili itekelezwe pekee kwenye vivinjari vya mtandao. -Vivinjari vya mtandao hutoa mazingira yanayohitajika kuendesha msimbo wa JavaScript, ikiwa ni pamoja na JavaScript Engine. Pia hutoa upatikanaji wa Document Object Model (DOM), hivyo unaweza kupata vipengele vya HTML katika msimbo wako. +Vivinjaru vya mtandao hutoa mazingira yanayohitajika kuendesha msimbo wa JavaScript, ikiwa ni pamoja na injini ya JavaScript. Pia hutoa upatikanaji wa Mfano wa Kitu cha Hati (DOM), hivyo unaweza kupata vipengele vya HTML katika msimbo wako. -Hapo awali, hatukuweza kuendesha JavaScript nje ya kivinjari, lakini sasa tunaweza kwa kutumia Node.js. +Kwa muda mrefu, JavaScript ilitumika karibu kabisa ndani ya vivinjari, lakini kwa Node.js unaweza kuendesha msimbo huo pia nje ya kivinjari. -Node.js ni mazingira ya utekelezaji ya JavaScript. Kimsingi hufafanuliwa kama “mazingira ya utekelezaji ya JavaScript ya chanzo huru na yenye kuendana na mifumo mingi.” +Node.js ni mazingira ya utekelezaji ya JavaScript. Kimsingi hufafanuliwa kama "mazingira ya utekelezaji ya JavaScript ya chanzo huria na yenye uwezo wa kuendeshwa kwenye mifumo mbalimbali." Tuchunguze maana yake: @@ -43,7 +43,7 @@ Mazingira ya kivinjari yameundwa hasa kwa ajili ya ukuzaji wa mbele wa mtandao, Kwa mfano, kutoka kivinjarini, unaweza kupata API ya DOM, lakini kuna vikwazo vya upatikanaji wa mfumo wa faili wa eneo la kompyuta. Kinyume chake, kutoka mazingira ya utekelezaji ya Node, unaweza kupata karibu rasilimali zote za mfumo, ikiwa ni pamoja na mfumo wa faili, lakini si DOM. -Mazingira yote mawili ya JavaScript hutoa kitu cha ulimwengu wote (global object). Katika mazingira ya utekelezaji ya JavaScript ya kivinjari, kinaitwa `window`. Kitu hiki cha `window` hutoa upatikanaji wa kazi zinazohusiana na kivinjari, kama vile upatikanaji wa njia za kusimamia DOM, kusimamia vidakuzi (cookies), na kushughulikia matukio ya kivinjari. Katika mazingira ya Node.js, kitu hiki cha ulimwengu wote kinaitwa `global`. Kitu cha `global` hutoa upatikanaji wa kazi maalum za Node.js, kama vile moduli zilizojengwa ndani za kufanya kazi na mafaili ya eneo la kompyuta, mitandao, na kuingiliana na mfumo wa uendeshaji. +Mazingira yote mawili ya JavaScript hutoa kitu cha ulimwengu. Katika mazingira ya utekelezaji ya JavaScript ya kivinjari, hiki huitwa `window`. Kitu hiki cha `window` hutoa upatikanaji wa kazi zinazohusiana na kivinjari, kama vile upatikanaji wa njia za kusimamia DOM, kusimamia vidakuzi, na kushughulikia matukio ya kivinjari. Katika mazingira ya Node.js, kitu hiki cha ulimwengu huitwa `global`. Kitu cha `global` hutoa upatikanaji wa kazi maalum za Node.js, kama vile moduli zilizojengwa ndani za kufanya kazi na mafaili ya ndani, mitandao, na kuingiliana na mfumo wa uendeshaji. Mwishowe, tofauti nyingine muhimu ni kwamba unaweza kuchagua toleo la Node.js unalotaka kutumia kwenye seva yako. Hata hivyo, huna udhibiti juu ya toleo la mazingira ya kivinjari ambalo watumiaji wako watatumia kutembelea tovuti yako. @@ -103,7 +103,7 @@ Fikiria majukumu na madhumuni ya kila mazingira. --- -Mazingira ya utekelezaji ya Node hutumia kitu cha window kama kitu chake cha ulimwengu wote, wakati vivinjari hutumia kitu cha global. +Mazingira ya utekelezaji ya Node hutumia kitu cha `window` kama kitu chake cha ulimwengu, wakati vivinjari hutumia kitu cha `global`. ### --feedback-- diff --git a/curriculum/challenges/swahili/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d372ad364f285f0522e.md b/curriculum/challenges/swahili/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d372ad364f285f0522e.md index df1de22e497..1cb77e17e78 100644 --- a/curriculum/challenges/swahili/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d372ad364f285f0522e.md +++ b/curriculum/challenges/swahili/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d372ad364f285f0522e.md @@ -1,6 +1,6 @@ --- id: 68ff6d372ad364f285f0522e -title: "Je, ni faida na hasara gani za kutumia Node kwenye upande wa nyuma?" +title: Faida na Hasara za Kutumia Node kwenye Sehemu ya Nyuma challengeType: 19 dashedName: what-are-the-advantages-and-disadvantages-to-using-node-on-the-back-end --- @@ -11,7 +11,7 @@ Moja ya faida kubwa za Node.js ni kwamba unaweza kutekeleza pande zote mbili za Muundo wa Node ni faida nyingine. Una muundo usiozuia, unaoendeshwa na matukio ambao ni mzuri kwa kuendeleza programu za wakati halisi, ambapo ujibu na ufanisi ni muhimu kwa kuunda uzoefu mzuri wa mtumizi. -Hapa ndipo dhana ya “nyuzi” inakuwa muhimu sana. Nyuzi ni njia ya utekelezaji ndani ya mchakato, kama programu ya kompyuta inayotumika kwa sasa. +Hapa ndipo dhana ya "nyuzi" inakuwa muhimu sana. Nyuzi ni njia ya utekelezaji ndani ya mchakato, yaani, programu ya kompyuta inayotekelezwa kwa sasa. Muundo wa Node unategemea nyuzi moja na mzunguko wa tukio ambao unaweza kushughulikia kwa ufanisi idadi kubwa ya maombi na shughuli za ingizo/utokaji kwa wakati mmoja. Hii inafanya iwe kamili kwa programu zinazohitaji kushughulikia maombi mengi kwa wakati mmoja. @@ -25,13 +25,13 @@ Na hatimaye, kwa upande wa gharama, Node.js ina faida kubwa ya kuwa bure na chan Kwa upande mwingine, Node.js pia ina hasara au vikwazo fulani ambavyo unapaswa kuyajua. -Kama ulivyojifunza, inaendesha nyuzi moja tu kwa wakati mmoja, ambayo inamaanisha inaweza kushughulikia operesheni moja tu kwa wakati mmoja. Ingawa muundo wake unaruhusu kuwa na ufanisi kwa kushughulikia maombi yanayofanyika kwa wakati mmoja, kazi zinazotumia nguvu nyingi za prosesa (CPU) zinaweza kuzuia nyuzi kuu na kusababisha matatizo ya utendaji. +Kama ulivyojifunza, inaendesha JavaScript yako kwenye nyuzi moja tu, ambayo inamaanisha inaweza kutekeleza kipande kimoja tu cha msimbo wako kwa wakati mmoja. Ingawa usanifu wake unaruhusu kuwa na ufanisi katika kushughulikia maombi yanayofanyika kwa wakati mmoja (simultaneous), kazi zinazochukua nguvu nyingi za prosesa (CPU-intensive) zinaweza kuzuia nyuzi kuu na kusababisha matatizo ya utendaji. Mifano ya kazi zinazotumia nguvu nyingi za prosesa ni pamoja na operesheni ngumu za kihesabu, usindikaji wa picha na video, na usimbaji fiche. Kuna njia za kushinda hili, lakini kawaida huongeza ugumu wa programu. -Node.js pia inategemea programu isiyo ya wakati mmoja (asynchronous programming). Katika programu isiyo ya wakati mmoja, zoezi ambalo linaweza kuchukua muda mrefu kuendesha linaanzishwa, lakini badala ya kusubiri hadi likamilike, programu kuu inaendelea kuendesha wakati zoezi isiyo ya wakati mmoja linaendelea sambamba. Wakati zoezi linapokamilika, programu hushughulikia matokeo. +Katika programu isiyo ya wakati mmoja (asynchronous), zoezi ambalo linaweza kuchukua muda mrefu kuendeshwa linaanzishwa, lakini badala ya kusubiri litakapokamilika, programu kuu inaendelea kuendesha wakati zoezi isiyo ya wakati mmoja linaendeshwa nyuma ya pazia. -Mchakato huu mara nyingi unahusisha kile tunachojua kama “wito wa kurudisha” (callbacks), ambazo ni vitendakazi vinavyoeleza kinachotokea wakati operesheni zisizo za wakati mmoja zinapokamilika. Asili isiyo ya wakati mmoja ya Node.js inaweza kufanya msimbo kuwa mgumu zaidi kusoma, kuelewa, na kutafuta makosa. +Mchakato huu mara nyingi unahusisha kile tunachojua kama "wito wa kurudisha" (callbacks), ambazo ni kitendakazi kinachoeleza kinachotokea wakati shughuli zisizo za wakati mmoja zinapokamilika. Asili isiyo ya wakati mmoja ya Node.js inaweza kufanya msimbo kuwa mgumu zaidi kusoma, kuelewa, na kutafuta makosa. Na hatimaye, unapaswa pia kuwa makini unachagua vifurushi kutoka `npm`, meneja wa vifurushi wa Node, kwa sababu baadhi yao huenda wasiendelezwe mara kwa mara, hivyo wanaweza kuleta hatari katika programu yako mwenyewe. Kama msanidi programu, unapaswa kutathmini kila kifurushi kwa makini na kuangalia kama kinazingatia mbinu bora za ubora na usalama. diff --git a/curriculum/challenges/swahili/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d39d7ed9ef36ff281f3.md b/curriculum/challenges/swahili/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d39d7ed9ef36ff281f3.md index 0650edb8812..d8246f25ca1 100644 --- a/curriculum/challenges/swahili/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d39d7ed9ef36ff281f3.md +++ b/curriculum/challenges/swahili/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d39d7ed9ef36ff281f3.md @@ -1,6 +1,6 @@ --- id: 68ff6d39d7ed9ef36ff281f3 -title: Jinsi ya kusakinisha Node kwenye kompyuta yako? +title: Jinsi ya Kufunga Node kwenye Kompyuta Yako? challengeType: 19 dashedName: how-can-you-install-node-on-your-computer --- @@ -17,7 +17,7 @@ Tuchunguze jinsi unavyoweza kusakinisha NVM kwenye macOS/Linux na Windows, na ji Kwenye macOS na Linux, unaweza kusakinisha NVM moja kwa moja kupitia script ya shell. -Lakini kwa macOS, kumbuka kuwa nyaraka rasmi za NVM zinaeleza kwamba “unahitaji kusakinisha zana za mstari wa amri za Xcode kwa mikono kabla ya kuendesha script ya usakinishaji, vinginevyo, itashindwa.” +Lakini kwa macOS, kumbuka kuwa nyaraka rasmi za NVM zinaeleza kwamba "unahitaji kusakinisha zana za mstari wa amri za Xcode kwa mikono kabla ya kuendesha script ya usakinishaji, vinginevyo, itashindwa." Kwenye macOS, unaweza kusakinisha zana za mstari wa amri za Xcode kwa kuendesha amri hii kwenye terminal yako: @@ -41,7 +41,7 @@ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash ``` -Ili kupata toleo la hivi karibuni la NVM wakati unaposoma makala hii, tafadhali rejea nyaraka rasmi za NVM: `https://github.com/nvm-sh/nvm?tab=readme-ov-file#install--update-script`. Huko, utapata amri hizi zikiwa na nambari ya toleo la hivi karibuni. +Ili kupata toleo jipya zaidi la NVM wakati unaposoma funzo hili, tafadhali rejea nyaraka rasmi za NVM: `https://github.com/nvm-sh/nvm?tab=readme-ov-file#install--update-script`. Huko, utapata amri hizi zikiwa na nambari ya toleo jipya zaidi. Huenda ukahitaji kuanzisha upya terminal yako baada ya mchakato kukamilika ili kupakia amri mpya na usanidi mpya. @@ -53,7 +53,7 @@ nvm -v Unapaswa kuona toleo lako la NVM kwenye matokeo. -## Jinsi ya kusakinisha Node.js kwa kutumia NVM kwenye macOS/Linux +## Jinsi ya Kufunga Node.js kwa kutumia NVM kwenye macOS/Linux Sasa umeweka NVM kwenye macOS/Linux, unaweza kusakinisha Node.js. @@ -95,13 +95,13 @@ Mwishowe, unaweza kuangalia toleo la sasa la Node.js kwa amri hii: node -v ``` -## Jinsi ya kusakinisha NVM kwenye Windows +## Jinsi ya Kufunga NVM kwenye Windows Sasa tuchunguze jinsi unavyoweza kusakinisha na kutumia NVM kwenye Windows. Matoleo rasmi ya NVM yanaunga mkono Windows katika hali maalum tu. Ikiwa umeweka Windows Subsystem for Linux (WSL) kwenye kifaa chako, unaweza kufuata mwongozo wa macOS/Linux ulio hapo juu kusakinisha na kutumia NVM. -Hata hivyo, kwa Windows yenyewe, kuna mbadala kadhaa. Moja yao ni `nvm-windows`, chombo cha usimamizi wa matoleo ya Node.js kwa Windows. Huu ni mradi tofauti kabisa na mradi rasmi wa NVM. Lakini madhumuni ya zana hizi ni sawa — kukusaidia kufanya kazi na matoleo mengi ya Node.js kwenye kifaa kimoja. +Hata hivyo, kwa Windows yenyewe, kuna mbadala kadhaa. Moja ya hayo ni `nvm-windows`, zana ya usimamizi wa toleo la Node.js kwa Windows. Huu ni mradi tofauti kabisa na mradi rasmi wa NVM. Lakini madhumuni ya zana hizi ni sawa: kusaidia kufanya kazi na matoleo mbalimbali ya Node.js kwenye kifaa kimoja. Kabla ya kusakinisha `nvm-windows`, unapaswa kujua kuwa hifadhi rasmi inapendekeza kuondoa usakinishaji wowote wa awali wa Node kabla ya kusakinisha NVM kwa Windows. Ikiwa hii ni mara yako ya kwanza kusakinisha Node.js, utakuwa sawa. Ikiwa tayari una matoleo mengine ya Node.js yaliyosakinishwa, inashauriwa kuyaondoa kwanza. @@ -119,7 +119,7 @@ Unaweza kuangalia kama usakinishaji ulifanikiwa na kuona toleo lako la sasa la ` nvm -v ``` -## Jinsi ya kusakinisha Node.js kwa kutumia NVM kwa Windows +## Jinsi ya Kufunga Node.js kwa kutumia NVM kwa Windows Sasa umeweka `nvm-windows` kwenye Windows, uko tayari kusakinisha Node.js. @@ -155,7 +155,7 @@ nvm use 20 Pia unaweza kuangalia toleo lako la sasa la Node.js kwa amri hii: -```bash +```powershell node -v ``` @@ -165,25 +165,25 @@ Sasa unajua jinsi ya kusakinisha NVM na Node.js, tuchunguze baadhi ya amri za ms Pia, ingawa amri hizi zote zitafanya kazi kwa NVM iliyosakinishwa kwenye macOS/Linux, pamoja na WSL, huenda zikafanya kazi tofauti au zisifanye kazi kabisa kwa `nvm-windows`. Tutaacha amri mbadala za `nvm-windows` pale inapowezekana. -### Jinsi ya kubadilisha sera ya utekelezaji ya Powershell +### Jinsi ya Kurekebisha Sera ya Utekelezaji ya PowerShell -Ikiwa unatumia Windows na unafuata pamoja na Powershell na `nvm-windows`, huenda ukahitaji kubadilisha sera ya utekelezaji ya Powershell. Sera ya utekelezaji ya chaguo-msingi kwa Powershell ni `Restricted`, ambayo ni hatua ya usalama kuzuia script zisifanye kazi. +Ikiwa unatumia Windows na unafuata pamoja na PowerShell na `nvm-windows`, huenda ukahitaji kurekebisha sera ya utekelezaji ya PowerShell. Sera ya utekelezaji ya chaguo-msingi ya PowerShell ni `Restricted`, ambayo ni hatua ya usalama kuzuia script kuendeshwa. -Kwanza, endesha Powershell kama msimamizi kwa kubofya kulia Powershell, kisha bofya “Run as Administrator“. +Kwanza, endesha PowerShell kama msimamizi kwa kubofya kulia PowerShell, kisha bofya "Run as Administrator". -Kisha, ili kuona sera ya sasa ya utekelezaji ya kikao cha sasa cha Powershell, endesha amri ifuatayo: +Kisha, ili kuona sera ya sasa ya utekelezaji ya kikao cha sasa cha PowerShell, endesha amri ifuatayo: ```powershell Get-ExecutionPolicy ``` -Mwishowe, kuweka sera ya utekelezaji ya Powershell kuwa `RemoteSigned`, ambayo inaruhusu script za ndani na `npm` kufanya kazi, tumia amri ifuatayo: +Mwishowe, ili kuweka sera ya utekelezaji ya PowerShell kuwa `RemoteSigned`, ambayo inaruhusu script za ndani na `npm` kuendeshwa, tumia amri ifuatayo: ```powershell Set-ExecutionPolicy RemoteSigned ``` -Mara baada ya kuendesha amri hapo juu, unaweza kufunga dirisha la msimamizi wa Powershell, na kufungua dirisha la Powershell lisilo la msimamizi. +Mara baada ya kuendesha amri hapo juu, unaweza kufunga dirisha la msimamizi wa PowerShell, na kufungua dirisha la PowerShell lisilo la msimamizi. ### Orodhesha matoleo yote @@ -193,7 +193,7 @@ Ili kuorodhesha matoleo yote ya Node.js yaliyosakinishwa na kuangalia toleo lina nvm ls ``` -### Weka toleo la chaguo-msingi la Node.js (NVM kwa macOS/Linux pekee) +### Weka toleo la chaguo-msingi la Node.js (NVM kwenye macOS/Linux pekee) Amri hii inaweka toleo la chaguo-msingi la Node.js litakalotumika kwa vikao vipya vya terminal: @@ -285,7 +285,7 @@ Kwa mfano: node app.js ``` -### Unda mradi wa Node.js +### Tengeneza mradi wa Node.js Amri hii inaunda mradi mpya wa Node.js kwa kuunda faili la `package.json` linalofuatilia maelezo na utegemezi wake. @@ -295,7 +295,7 @@ npm init Unapoendesha amri ya `npm init`, itakuongoza kupitia mwongozo wa kiolesura cha mstari wa amri kwa kuanzisha faili la `package.json`. Itakuuliza maswali kuhusu jina la mradi, maelezo, toleo, n.k. Ikiwa unataka kuanza na faili la `package.json` la chaguo-msingi, unaweza kutumia amri ya `npm init -y` au `npm init --yes`. -### Sakinisha pakiti +### Sakinisha kifurushi Ili kusakinisha pakiti maalum, endesha: @@ -430,3 +430,4 @@ Amri inapaswa kuunda faili msingi wa mradi kwa usimamizi wa pakiti. ## --video-solution-- 1 + diff --git a/curriculum/challenges/swahili/blocks/lecture-working-with-operator-behavior/6732719e2e3ad4d947410b65.md b/curriculum/challenges/swahili/blocks/lecture-working-with-operator-behavior/6732719e2e3ad4d947410b65.md index 82be3023698..5686013b6d8 100644 --- a/curriculum/challenges/swahili/blocks/lecture-working-with-operator-behavior/6732719e2e3ad4d947410b65.md +++ b/curriculum/challenges/swahili/blocks/lecture-working-with-operator-behavior/6732719e2e3ad4d947410b65.md @@ -11,7 +11,13 @@ Ikiwa unaandika usemi wa kihesabu wenye opereta kadhaa katika JavaScript, JavaSc Utaratibu wa kipaumbele cha opereta huamua mpangilio wa jinsi operesheni zinavyopimwa katika usemi wa kihesabu. Opereta zenye kipaumbele cha juu hupimwa kabla ya zile zenye kipaumbele cha chini. Fikiria utaratibu wa kipaumbele cha opereta kama ilivyo katika hesabu, ambapo mgawanyo na kuzidisha hufanyika kabla ya kuongeza na kutoa. -Bila kufuata kanuni hii, hesabu za msingi zingekupa jibu lisilo sahihi. JavaScript hufanya kazi kwa njia ile ile. Ina kanuni zake za ni opereta gani huja kwanza, pili, na kadhalika. Kwa mfano, tazama usemi ulio hapa chini: +Bila kufuata sheria hii, hesabu za msingi zingekupa jibu lisilo sahihi. JavaScript hufanya kazi kwa njia ile ile. Ina sheria zake za ni operator gani huja kwanza, pili, na kadhalika. + +## Kipaumbele katika usemi wa kihesabu + +### Kipaumbele cha kuzidisha + +Kwa mfano, tazama usemi ulio hapa chini: :::interactive_editor @@ -25,36 +31,42 @@ console.log(result); // 14 Ikiwa JavaScript ingepima usemi huu kutoka kushoto kwenda kulia, ungetarajia `2 + 3 = 5`, kisha `5 * 4 = 20`. Lakini kwa sababu kuzidisha kuna kipaumbele cha juu kuliko kuongeza, JavaScript hupima sehemu ya `3 * 4` kwanza, na kusababisha `2 + 12 = 14`. -Wakati mwingine, unaweza kutaka sehemu fulani za usemi wako zipimwe kwanza, bila kujali kanuni za kipaumbele. Unaweza kutumia mabano ya kawaida, `()`, kufanya hivi. Kila kitu kilicho ndani ya mabano ya kawaida hupimwa kwanza, bila kujali nini. Tufanye sehemu ya `2 + 3` ya mfano uliotangulia ipimwe kwanza: +### Kipaumbele cha kugawanya + +Opereta ya mgawanyo pia ina kipaumbele cha juu kuliko kuongeza au kutoa: :::interactive_editor ```js -const result = (2 + 3) * 4; +const result = 2 + 6 / 3; -console.log(result); // 20 +console.log(result); // 4 ``` ::: -Katika mfano uliotangulia, mabano ya kawaida yanamfanya JavaScript apime `2 + 3` kwanza, kisha azidishe matokeo na `4`. Hii inakupa `20` badala ya `14`. +Ikiwa JavaScript ingepima usemi huu kutoka kushoto kwenda kulia, ungeweza kutarajia `2 + 6 = 8`, kisha `8 / 3 = 2.67`. Lakini kwa kuwa mgawanyo una kipaumbele cha juu kuliko kuongeza, JavaScript hupima mgawanyo kwanza: `6 / 3 = 2`, kisha huongeza `2 + 2`, na kupata matokeo `4`. -Opereta ya mgawanyo pia ina kipaumbele cha juu kuliko kuongeza au kutoa: +### Kutumia mabano ya kawaida kughairi kipaumbele + +Wakati mwingine, unaweza kutaka sehemu fulani za usemi wako zifanyike kwanza, bila kujali sheria za kipaumbele. Unaweza kutumia mabano ya kawaida, `()`, kufanya hivyo. Kila kitu kilicho ndani ya mabano ya kawaida kinahesabiwa kwanza, bila kujali nini. Hebu tufanye sehemu ya `2 + 3` katika mfano wa kuzidisha ihesabiwe kwanza: :::interactive_editor ```js -const result = 2 + 6 / 3; +const result = (2 + 3) * 4; -console.log(result); // 4 +console.log(result); // 20 ``` ::: -Ikiwa JavaScript ingepima usemi huu kutoka kushoto kwenda kulia, ungeweza kutarajia `2 + 6 = 8`, kisha `8 / 3 = 2.67`. Lakini kwa kuwa mgawanyo una kipaumbele cha juu kuliko kuongeza, JavaScript hupima mgawanyo kwanza: `6 / 3 = 2`, kisha huongeza `2 + 2`, na kupata matokeo `4`. +Katika mfano uliotangulia, mabano ya kawaida yanamfanya JavaScript apime `2 + 3` kwanza, kisha azidishe matokeo na `4`. Hii inakupa `20` badala ya `14`. Hivyo, katika kuzidisha na mgawanyo, operesheni hizo daima hufanyika kabla ya kuongeza na kutoa isipokuwa utumie mabano ya kawaida kubadilisha mpangilio. Basi kinachotokea ikiwa opereta zina kipaumbele sawa? JavaScript hutumia uhusiano wa opereta (associativity) kuamua mpangilio wa kupima. +## Kuelewa ushirikiano wa mwelekeo + Uhusiano wa opereta ni kile kinachomwambia JavaScript kama apime opereta kutoka kushoto kwenda kulia au kutoka kulia kwenda kushoto. Kwa opereta nyingi kama kuongeza na kuzidisha, uhusiano ni kutoka kushoto kwenda kulia. Hivyo, JavaScript hufanya kazi hizi kutoka upande wa kushoto kabisa wa usemi kwenda kulia: :::interactive_editor @@ -84,6 +96,8 @@ console.log(a + b); // 10 Katika mfano uliotangulia, JavaScript huweka thamani ya `5` kwa `b` kwanza, kisha huweka `b` (ambayo sasa ni `5`) kwa `a`. +### Operator wa nguvu + Opereta ya nguvu pia ni wa uhusiano wa kulia kwenda kushoto: :::interactive_editor diff --git a/curriculum/challenges/swahili/blocks/lecture-working-with-regular-expressions/6733c5e54e3a154c8078ed48.md b/curriculum/challenges/swahili/blocks/lecture-working-with-regular-expressions/6733c5e54e3a154c8078ed48.md index bef9c3cefe9..0885c8e0dbc 100644 --- a/curriculum/challenges/swahili/blocks/lecture-working-with-regular-expressions/6733c5e54e3a154c8078ed48.md +++ b/curriculum/challenges/swahili/blocks/lecture-working-with-regular-expressions/6733c5e54e3a154c8078ed48.md @@ -17,6 +17,8 @@ const regex = /^\d\d\d\d$/; Na hii inafanya kazi: italinganisha herufi nne za nambari. Lakini badala ya kuandika darasa hilo mara nyingi, unaweza kuliwekea kihimarisha. +## Kihimarisha halisi + Vihimarisha huainishwa na mabano ya mviringo yenye nambari moja au mbili ndani. Tuchukue kihimarisha katika muundo wetu: ```js @@ -40,6 +42,8 @@ console.log(regex.test("1234567")); // false Muundo huu unalinganisha mfuatano wenye tarakimu nne tu, kwa sababu tumetumia tagi za nanga na kihimarisha chetu kinaruhusu tarakimu nne tu kabisa. Lakini labda msimbo wa utambulisho unahitaji kuwa na kiwango cha chini cha tarakimu nne. +## Kihimarisha cha kiwango cha chini na cha juu + Ili kuruhusu tarakimu nne au zaidi, ongeza koma baada ya nambari katika kihimarisha chako: ```js @@ -84,6 +88,10 @@ console.log(regex.test("1234567")); // false Kumbuka huwezi kutumia sintaksia hii kuweka kiwango cha juu pekee: lazima daima uweke kiwango cha chini. Lakini ukiacha kiwango cha chini kuwa `1`, unaweza kufanikisha matokeo sawa kwa ufanisi. +## Kihimarisha kifupi + +### Kihimarisha cha alama ya swali (`?`) + Tumepokea mahitaji yaliyosasishwa kutoka kwa watumizi wetu. Vitambulisho sasa vinaweza kuanza kwa hiari na herufi. Tayari tunajua darasa la tabia kwa hili, kwa hivyo tuongeze kwenye usemi wetu wa kawaida: ```js @@ -122,6 +130,8 @@ console.log(regex.test("1234567")); // false Muundo wetu sasa unaruhusu herufi moja hiari, ikifuatiwa na tarakimu nne hadi sita. +### Kihimarisha cha nyota (`*`) + Kwa bahati mbaya, tumegundua tulisoma mahitaji vibaya. Tunahitaji kuruhusu herufi yoyote idadi yoyote kabla ya nambari. Tunaweza kutumia kihimarisha chenye kiwango cha chini cha `0` na kutokuwa na kiwango cha juu kilichowekwa: ```js @@ -144,6 +154,8 @@ console.log(regex.test("1234567")); // false ::: +### Kihimarisha cha alama ya kuongeza (`+`) + Sasa tunafanikiwa kulinganisha kitambulisho chochote chenye herufi sifuri au zaidi ikifuatiwa na nambari nne hadi sita. Lakini imebainika hii inasababisha mfumo wetu kushindwa: lazima kweli tuhitaji angalau herufi moja. Tena, tunaweza kutumia kihimarisha chenye kiwango cha chini cha moja na kisicho na kiwango cha juu kilichowekwa, au tunaweza kutumia sintaksia nyingine maalum, alama ya kuongeza (`+`): diff --git a/curriculum/challenges/swahili/blocks/lecture-working-with-the-dom-click-events-and-web-apis/673368ccf52205329b729378.md b/curriculum/challenges/swahili/blocks/lecture-working-with-the-dom-click-events-and-web-apis/673368ccf52205329b729378.md index 950be3ee447..98a47421ea6 100644 --- a/curriculum/challenges/swahili/blocks/lecture-working-with-the-dom-click-events-and-web-apis/673368ccf52205329b729378.md +++ b/curriculum/challenges/swahili/blocks/lecture-working-with-the-dom-click-events-and-web-apis/673368ccf52205329b729378.md @@ -7,12 +7,16 @@ dashedName: what-is-the-difference-between-innertext-textcontent-and-innerhtml # --interactive-- +## Muhtasari + Tujifunze kuhusu `innerText`, `textContent`, na `innerHTML`. Hizi ni sifa ambazo unaweza kupata katika JavaScript ili kupata au kubadilisha yaliyomo ya kipengee cha HTML. Hata kama zinaweza kuonekana kama sawa mwanzoni, zina tofauti muhimu. Kuchagua sifa sahihi hutegemea matumizi yako maalum, kwa hivyo tuanze. Tuanze na `innerText`. +## Kuelewa innerText + `innerText` inawakilisha maudhui ya maandishi yanayoonekana ya kipengee cha HTML na mzao wake. Sifa hii haijumuishi maandishi yaliyofichwa au lebo za HTML, bali maandishi tu yaliyoonyeshwa. Kwa mfano, hapa unaweza kuona kipengee cha `div` chenye aya mbili: @@ -109,6 +113,8 @@ Kwa kuwa `innerText` inazingatia uonekano, kupata thamani yake husababisha mchak Nzuri. Sasa tuzungumzie `textContent`. +## Kuelewa textContent + `textContent` inarudisha maudhui ya maandishi ya kawaida ya kipengee, ikiwa ni pamoja na maandishi yote ndani ya mzao wake. Tofauti muhimu kati ya `innerText` na `textContent` ni kwamba `textContent` daima inarudisha maudhui yote ya maandishi ya kipengee cha HTML na mzao wake, bila kujali kama yanaonekana au yamefichwa. @@ -181,6 +187,8 @@ container.textContent = "New content"; ::: +## Kulinganisha na innerHTML + Na hatimaye, tuzungumzie jinsi `textContent` na `innerText` zinavyotofautiana na `innerHTML`. Kumbuka kwamba kwa `innerHTML` unaweza kuweka maudhui ya HTML ya ndani ya kipengee. Hii ni msaada kwa kuingiza HTML mpya kwenye DOM kwa njia ya mabadiliko. @@ -189,6 +197,8 @@ Hata hivyo, kumbuka kwamba hii inaleta hatari ya usalama ikiwa huna udhibiti juu Ili kuepuka hili, inashauriwa kutumia sifa ya `textContent` kuingiza maandishi ya kawaida badala yake. +## Muhtasari wa Tofauti Muhimu + Sifa za `innerText`, `textContent`, na `innerHTML` katika JavaScript hutoa njia tofauti za kupata na kudhibiti yaliyomo ya vipengee vya HTML. Unapaswa kuelewa tofauti kati ya sifa hizi ikiwa lengo lako ni kufanya kazi na maudhui ya HTML kwa ufanisi katika JavaScript. # --questions-- @@ -219,7 +229,7 @@ Fikiria jinsi sifa hizi zinavyoshughulikia maudhui yaliyofichwa. --- -Zote zilizo hapo juu. +Yote yaliyotajwa hapo juu. ### --feedback-- @@ -291,7 +301,7 @@ Fikiria jinsi sifa hizi zinavyoshughulikia maudhui yaliyofichwa. --- -Zote zilizo hapo juu. +Yote yaliyotajwa hapo juu. ### --feedback-- diff --git a/curriculum/challenges/swahili/blocks/machine-learning-with-python-projects/5e46f8d6ac417301a38fb92d.md b/curriculum/challenges/swahili/blocks/machine-learning-with-python-projects/5e46f8d6ac417301a38fb92d.md index eec68dd3c98..a8718334e80 100644 --- a/curriculum/challenges/swahili/blocks/machine-learning-with-python-projects/5e46f8d6ac417301a38fb92d.md +++ b/curriculum/challenges/swahili/blocks/machine-learning-with-python-projects/5e46f8d6ac417301a38fb92d.md @@ -10,7 +10,7 @@ dashedName: rock-paper-scissors Kwa changamoto hii, utaunda programu ya kucheza Jiwe, Karatasi, Mkasi. Programu inayochagua kwa bahati nasibu kawaida hushinda 50% ya wakati. Ili kupita changamoto hii, programu yako lazima icheze mechi dhidi ya roboti wanne tofauti, ikishinda angalau 60% ya michezo katika kila mechi. -Utafanya kazi <a href="https://app.ona.com/?autostart=true#https://github.com/freeCodeCamp/boilerplate-rock-paper-scissors/" target="_blank" rel="noopener noreferrer nofollow">kati ya muundo wa msingi wa Ona tulioandaa</a>. +Utafanya kazi kwenye mradi huu kwa kutumia <a href="https://codespaces.new/freeCodeCamp/boilerplate-rock-paper-scissors/" target="_blank" rel="noopener noreferrer nofollow">msimbo wetu wa msingi</a>. Bado tunaunda sehemu ya mafunzo ya kiutendaji ya mtaala wa kujifunza mashine. Kwa sasa, utahitaji kutumia rasilimali nyingine kujifunza jinsi ya kupita changamoto hii. @@ -56,7 +56,7 @@ Nakili URL ya mradi wako na uwasilishe kwa freeCodeCamp. # --hints-- -Inapaswa kupita majaribio yote ya Python. +Inapaswa kupita mitihani yote ya Python. ```js diff --git a/curriculum/challenges/swahili/blocks/review-introduction-to-express/6a0354d43d4c00eca38561f7.md b/curriculum/challenges/swahili/blocks/review-introduction-to-express/6a0354d43d4c00eca38561f7.md index f08cf54d4ff..c00d124aa36 100644 --- a/curriculum/challenges/swahili/blocks/review-introduction-to-express/6a0354d43d4c00eca38561f7.md +++ b/curriculum/challenges/swahili/blocks/review-introduction-to-express/6a0354d43d4c00eca38561f7.md @@ -7,53 +7,6 @@ dashedName: review-introduction-to-express # --description-- -## Huduma za mtandao na API - -- **API (Application Programming Interface)**: Njia ya jumla kwa programu kuwasiliana na programu nyingine. -- **Huduma ya mtandao**: Aina maalum ya API inayotumia teknolojia za mtandao kama HTTP kubadilishana data kupitia mtandao. Kila huduma ya mtandao ni API, lakini si kila API ni huduma ya mtandao. -- **Sifa kuu za huduma ya mtandao**: inaendeshwa kwenye seva, inaruhusu mawasiliano kati ya mashine, haitegemei lugha, haitegemei jukwaa, na inatumia itifaki za kawaida za mtandao (HTTP/HTTPS, FTP, SMTP). -- **REST (uhamishaji wa hali ya uwakilishi (REST))**: Aina inayotumika zaidi ya huduma ya mtandao leo. Weka wazi rasilimali zinazotambulika kwa njia za URL kama `/users` au `/users/20`. Majibu kawaida huwa katika JSON, lakini pia yanaweza kuwa XML au maandishi ya kawaida. -- **SOAP (Simple Object Access Protocol)**: Inatumia XML tu. Inapatikana sana katika mifumo ya makampuni inayohitaji viwango na usalama mkali zaidi. -- **XML-RPC**: Inatumia XML kuandika maombi na majibu. Ni nyepesi lakini haibadiliki kama REST. -- **`Accept` kichwa**: Inatumika na mteja kusema seva ni muundo gani wa jibu unayotaka, kwa mfano `Accept: application/json`. - -## Muundo wa REST - -- **Isiyo na hali**: Kila ombi lazima lijumuishe taarifa zote seva inazohitaji kulishughulikia. Seva haikumbuki maombi ya awali. -- **Rasilimali**: Kipande cha data kinachoweza kupatikana au kubadilishwa, kinachotambulika kwa URL (kwa mfano, `/products/1`). -- **Njia za HTTP katika REST**: - - `GET` — pata rasilimali - - `POST` — tengeneza rasilimali mpya - - `PUT` / `PATCH` — sasisha rasilimali iliyopo - - `DELETE` — ondoa rasilimali - -## Nambari za hali za HTTP - -Baada ya kushughulikia ombi, seva hujibu na **nambari ya hali** inayosema matokeo: - -- `200` **(OK)**: Ombi lilifanikiwa -- `201` **(Created)**: Rasilimali mpya ilitengenezwa -- `400` **(Bad Request)**: Mteja alituma data isiyo sahihi -- `404` **(Not Found)**: Rasilimali iliyotakiwa haipo -- `500` **(Internal Server Error)**: Hitilafu ilitokea kwenye seva - -### Jinsi ombi la REST linavyofanya kazi - -1. Mteja anatuma ombi lenye njia, URL, vichwa vya hiari, na mwili wa hiari. -2. Seva inathibitisha ombi na kutambua rasilimali. -3. Seva hufanya kitendo (pata, tengeneza, sasisha, au futa). -4. Seva huunda jibu lenye nambari ya hali na mwili wa hiari (kawaida JSON). -5. Seva hutuma jibu — hakuna hali ya mteja kuhifadhiwa. -6. Mteja anakagua nambari ya hali na kushughulikia data iliyorejeshwa. - -## Monoliths dhidi ya microservices - -- **Monolith**: Msimbo mkubwa mmoja ambapo UI, hifadhidata, na API viko pamoja. Hufanya kazi vizuri kwa programu ndogo lakini huwa ngumu kudumisha na kupanua kadri inavyokua. -- **Microservices**: Muundo ambapo programu kubwa hugawanywa kuwa huduma ndogo huru. Kila huduma hushughulikia uwezo mmoja wa biashara (kwa mfano, bidhaa, maagizo, malipo) na inaweza kuwa na msimbo wake, hifadhidata, na timu yake. -- **Jinsi microservices zinavyowasiliana**: Kupitia API au mifumo ya ujumbe. -- **Faida za microservices**: ukuaji wa haraka, kutenganisha hitilafu vizuri, na uhuru wa kutumia lugha au mifumo tofauti kwa kila huduma. -- **Changamoto za microservices**: kurekebisha hitilafu ngumu zaidi, usimamizi mgumu wa miundombinu, na mzigo mkubwa wa mtandao kati ya huduma. - ## Express.js ni nini? - **Express**: Mfumo wa kazi wa mtandao mdogo na rahisi unaojengwa juu ya Node.js unaorahisisha kujenga seva za mtandao na API. diff --git a/curriculum/challenges/swahili/blocks/review-rest-api-and-web-services/6a7c78ad958a597ee788ad2a.md b/curriculum/challenges/swahili/blocks/review-rest-api-and-web-services/6a7c78ad958a597ee788ad2a.md new file mode 100644 index 00000000000..da4aa9c621b --- /dev/null +++ b/curriculum/challenges/swahili/blocks/review-rest-api-and-web-services/6a7c78ad958a597ee788ad2a.md @@ -0,0 +1,59 @@ +--- +id: 6a7c78ad958a597ee788ad2a +title: Ukagua wa REST API na Huduma za Mtandao +challengeType: 31 +dashedName: review-rest-api-and-web-services +--- + +# --description-- + +## Huduma za mtandao na API + +- **API (Application Programming Interface)**: Njia ya jumla kwa programu kuwasiliana na programu nyingine. +- **Huduma ya mtandao**: Aina maalum ya API inayotumia teknolojia za mtandao kama HTTP kubadilishana data kupitia mtandao. Kila huduma ya mtandao ni API, lakini si kila API ni huduma ya mtandao. +- **Sifa kuu za huduma ya mtandao**: inaendeshwa kwenye seva, inaruhusu mawasiliano kati ya mashine, haitegemei lugha, haitegemei jukwaa, na inatumia itifaki za kawaida za mtandao (HTTP/HTTPS, FTP, SMTP). +- **REST (uhamishaji wa hali ya uwakilishi (REST))**: Aina inayotumika zaidi ya huduma ya mtandao leo. Weka wazi rasilimali zinazotambulika kwa njia za URL kama `/users` au `/users/20`. Majibu kawaida huwa katika JSON, lakini pia yanaweza kuwa XML au maandishi ya kawaida. +- **SOAP (Simple Object Access Protocol)**: Inatumia XML tu. Inapatikana sana katika mifumo ya makampuni inayohitaji viwango na usalama mkali zaidi. +- **XML-RPC**: Inatumia XML kuandika maombi na majibu. Ni nyepesi lakini haibadiliki kama REST. +- **`Accept` kichwa**: Inatumika na mteja kusema seva ni muundo gani wa jibu unayotaka, kwa mfano `Accept: application/json`. + +## Muundo wa REST + +- **Isiyo na hali**: Kila ombi lazima lijumuishe taarifa zote seva inazohitaji kulishughulikia. Seva haikumbuki maombi ya awali. +- **Rasilimali**: Kipande cha data kinachoweza kupatikana au kubadilishwa, kinachotambulika kwa URL (kwa mfano, `/products/1`). +- **Njia za HTTP katika REST**: + - `GET` — pata rasilimali + - `POST` — tengeneza rasilimali mpya + - `PUT` / `PATCH` — sasisha rasilimali iliyopo + - `DELETE` — ondoa rasilimali + +## Nambari za hali za HTTP + +Baada ya kushughulikia ombi, seva hujibu na **nambari ya hali** inayosema matokeo: + +- `200` **(OK)**: Ombi lilifanikiwa +- `201` **(Created)**: Rasilimali mpya ilitengenezwa +- `400` **(Bad Request)**: Mteja alituma data isiyo sahihi +- `404` **(Not Found)**: Rasilimali iliyotakiwa haipo +- `500` **(Internal Server Error)**: Hitilafu ilitokea kwenye seva + +### Jinsi ombi la REST linavyofanya kazi + +1. Mteja anatuma ombi lenye njia, URL, vichwa vya hiari, na mwili wa hiari. +2. Seva inathibitisha ombi na kutambua rasilimali. +3. Seva hufanya kitendo (pata, tengeneza, sasisha, au futa). +4. Seva huunda jibu lenye nambari ya hali na mwili wa hiari (kawaida JSON). +5. Seva hutuma jibu — hakuna hali ya mteja kuhifadhiwa. +6. Mteja anakagua nambari ya hali na kushughulikia data iliyorejeshwa. + +## Monoliths dhidi ya microservices + +- **Monolith**: Msimbo mkubwa mmoja ambapo UI, hifadhidata, na API viko pamoja. Hufanya kazi vizuri kwa programu ndogo lakini huwa ngumu kudumisha na kupanua kadri inavyokua. +- **Microservices**: Muundo ambapo programu kubwa hugawanywa kuwa huduma ndogo huru. Kila huduma hushughulikia uwezo mmoja wa biashara (kwa mfano, bidhaa, maagizo, malipo) na inaweza kuwa na msimbo wake, hifadhidata, na timu yake. +- **Jinsi microservices zinavyowasiliana**: Kupitia API au mifumo ya ujumbe. +- **Faida za microservices**: ukuaji wa haraka, kutenganisha hitilafu vizuri, na uhuru wa kutumia lugha au mifumo tofauti kwa kila huduma. +- **Changamoto za microservices**: kurekebisha hitilafu ngumu zaidi, usimamizi mgumu wa miundombinu, na mzigo mkubwa wa mtandao kati ya huduma. + +# --assignment-- + +Kagua mada na dhana za REST API na Huduma za Mtandao. diff --git a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e89d557d4b78bf83a02ae6.md b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e89d557d4b78bf83a02ae6.md index 1e7327d063a..6d38aaeabf2 100644 --- a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e89d557d4b78bf83a02ae6.md +++ b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e89d557d4b78bf83a02ae6.md @@ -396,10 +396,10 @@ body { const { useState } = React; export const FootballPlayerCard = () => { - return ( + return ( --fcc-editable-region-- - <h1 style={{ backgroundColor: '#fff' }}>Hello, TSX!</h1> + <h1 style={{ backgroundColor: "#fff" }}>Hello, TSX!</h1> --fcc-editable-region-- - ) + ); }; ``` diff --git a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb2.md b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb2.md index 0e615e7ff2b..5db8ae10307 100644 --- a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb2.md +++ b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb2.md @@ -29,12 +29,10 @@ assert.equal(element?.type, window.index.PlayerCard); <meta charset="utf-8"/> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Football Player Card Builder - - - + @@ -379,21 +377,18 @@ body { ```tsx const { useState } = React; -export function PlayerCard() { +export const PlayerCard = () => { return ( -
- -
+
); -} +}; export const FootballPlayerCard = () => { - + --fcc-editable-region-- return ( - --fcc-editable-region-- -

Football Card Builder

- --fcc-editable-region-- - ) +

Football Card Builder

+ ); + --fcc-editable-region-- }; ``` diff --git a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb3.md b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb3.md index 7797e33b4d4..b60811958c6 100644 --- a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb3.md +++ b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb3.md @@ -382,15 +382,13 @@ export const PlayerCard = () => { return (
--fcc-editable-region-- - + --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { - return ( - - ); + return ; }; ``` diff --git a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb4.md b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb4.md index 8df1072c024..30c9abf619d 100644 --- a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb4.md +++ b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb4.md @@ -381,12 +381,12 @@ export const PlayerCard = () => {
--fcc-editable-region-- - + --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb5.md b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb5.md index 0742b56455a..f8dd8357e45 100644 --- a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb5.md +++ b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb5.md @@ -394,13 +394,13 @@ export const PlayerCard = () => {
--fcc-editable-region-- - + --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb6.md b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb6.md index 11daae29cc0..c9670b4a12f 100644 --- a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb6.md +++ b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb6.md @@ -390,14 +390,14 @@ export const PlayerCard = () => {
98
--fcc-editable-region-- - + --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb7.md b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb7.md index 94683d5d890..fdbde4ec5dd 100644 --- a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb7.md +++ b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb7.md @@ -398,13 +398,13 @@ export const PlayerCard = () => {
ST
--fcc-editable-region-- - + --fcc-editable-region-- ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb8.md b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb8.md index 78c273f0d56..d88af7f4608 100644 --- a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb8.md +++ b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb8.md @@ -394,14 +394,14 @@ export const PlayerCard = () => {
GOLD
--fcc-editable-region-- - + --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb9.md b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb9.md index 7a311d6ca68..3703fe2076d 100644 --- a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb9.md +++ b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb9.md @@ -393,12 +393,12 @@ export const PlayerCard = () => { --fcc-editable-region-- - + --fcc-editable-region-- ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bba.md b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bba.md index a235e4346db..7aa28d38eb2 100644 --- a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bba.md +++ b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bba.md @@ -412,13 +412,13 @@ export const PlayerCard = () => {
--fcc-editable-region-- - + --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbb.md b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbb.md index ea8763010b5..fb044c2cb4c 100644 --- a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbb.md +++ b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbb.md @@ -406,12 +406,12 @@ export const PlayerCard = () => { Edson Arantes do Nascimento (Pele) headshot --fcc-editable-region-- - + --fcc-editable-region-- ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbc.md b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbc.md index 4a8433e15ec..3e4b926a12c 100644 --- a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbc.md +++ b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbc.md @@ -409,12 +409,12 @@ export const PlayerCard = () => { PELE --fcc-editable-region-- - + --fcc-editable-region-- ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbd.md b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbd.md index 70373b8e008..b5cac18f3da 100644 --- a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbd.md +++ b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbd.md @@ -427,13 +427,13 @@ export const PlayerCard = () => { --fcc-editable-region-- - + --fcc-editable-region-- ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbe.md b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbe.md index 72f958f3505..c7aeca6f235 100644 --- a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbe.md +++ b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbe.md @@ -465,7 +465,7 @@ export const PlayerCard = () => { ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbf.md b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbf.md index 0c99008ed44..9ba76e4eedf 100644 --- a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbf.md +++ b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbf.md @@ -420,7 +420,7 @@ interface PlayerData { position: string; club: string; --fcc-editable-region-- - + --fcc-editable-region-- } @@ -478,7 +478,7 @@ export const PlayerCard = () => { ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc0.md b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc0.md index 127b6366467..2f69cab1365 100644 --- a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc0.md +++ b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc0.md @@ -497,7 +497,7 @@ export const PlayerCard = () => { ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc1.md b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc1.md index af1fab4b3e9..f6772507429 100644 --- a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc1.md +++ b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc1.md @@ -398,10 +398,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } --fcc-editable-region-- @@ -460,7 +460,7 @@ export const PlayerCard = () => { ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc2.md b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc2.md index a3e4e77b70e..8a7cb6e7eaf 100644 --- a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc2.md +++ b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc2.md @@ -40,12 +40,10 @@ assert.exists(document.querySelector('.card-wrapper.tier-elite')); Football Player Card Builder - - - + @@ -405,10 +403,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -467,9 +465,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc3.md b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc3.md index 538cef97d2c..f431febdf69 100644 --- a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc3.md +++ b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc3.md @@ -399,10 +399,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -461,9 +461,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc4.md b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc4.md index f00203daeb1..01a5e61095d 100644 --- a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc4.md +++ b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc4.md @@ -399,10 +399,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -461,9 +461,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc5.md b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc5.md index f0b99b91427..da86cd6deac 100644 --- a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc5.md +++ b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc5.md @@ -392,10 +392,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -456,9 +456,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc6.md b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc6.md index ac42804e475..cc25838d826 100644 --- a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc6.md +++ b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc6.md @@ -401,10 +401,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -465,9 +465,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc7.md b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc7.md index def0bfc4301..2ebec266847 100644 --- a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc7.md +++ b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc7.md @@ -391,10 +391,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -455,9 +455,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc8.md b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc8.md index c00ff1e5e27..8ed4b802fd3 100644 --- a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc8.md +++ b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc8.md @@ -407,10 +407,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -436,9 +436,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { {player.name}
- --fcc-editable-region--
+ --fcc-editable-region-- 97 PAC
@@ -448,10 +448,10 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
83 + --fcc-editable-region-- PAS
- --fcc-editable-region--
@@ -471,9 +471,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc9.md b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc9.md index 3a1561b657d..7dd770dcfcf 100644 --- a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc9.md +++ b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc9.md @@ -483,10 +483,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -545,13 +545,13 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
); -} +}; --fcc-editable-region-- --fcc-editable-region-- export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bca.md b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bca.md index b07e619887e..f1617f1e705 100644 --- a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bca.md +++ b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bca.md @@ -419,10 +419,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -481,14 +481,14 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { - name: 'PELE', + name: "PELE", overallRating: 98, - position: 'ST', - club: 'Santos FC', - imageUrl: 'https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg', + position: "ST", + club: "Santos FC", + imageUrl: "https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg", pac: 97, sho: 98, pas: 83, diff --git a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcb.md b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcb.md index d1dc3676f44..cd02aefdbfc 100644 --- a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcb.md +++ b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcb.md @@ -435,10 +435,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -497,14 +497,14 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { - name: 'PELE', + name: "PELE", overallRating: 98, - position: 'ST', - club: 'Santos FC', - imageUrl: 'https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg', + position: "ST", + club: "Santos FC", + imageUrl: "https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg", pac: 97, sho: 98, pas: 83, @@ -517,6 +517,7 @@ export const FootballPlayerCard = () => { const [player, setPlayer] = useState(defaultPlayer); return ( --fcc-editable-region-- + --fcc-editable-region-- ); diff --git a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcc.md b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcc.md index d2e2701e0f2..9315cf01662 100644 --- a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcc.md +++ b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcc.md @@ -477,7 +477,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -504,7 +504,9 @@ export const FootballPlayerCard = () => { --fcc-editable-region-- + + --fcc-editable-region-- ); diff --git a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcd.md b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcd.md index 2f35d3149cb..4a6810efe25 100644 --- a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcd.md +++ b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcd.md @@ -465,7 +465,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bce.md b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bce.md index 3ec3789ed02..e1297379f2b 100644 --- a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bce.md +++ b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bce.md @@ -470,7 +470,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcf.md b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcf.md index af7ed4d26f0..17b7839e35f 100644 --- a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcf.md +++ b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcf.md @@ -488,7 +488,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd0.md b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd0.md index aa3df99695f..f11aefbe495 100644 --- a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd0.md +++ b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd0.md @@ -471,7 +471,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd1.md b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd1.md index af2304d7dbe..6324313272a 100644 --- a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd1.md +++ b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd1.md @@ -471,7 +471,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd2.md b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd2.md index 461ca571ff0..1c136ca0ecf 100644 --- a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd2.md +++ b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd2.md @@ -471,7 +471,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -535,7 +535,7 @@ export const FootballPlayerCard = () => { - --fcc-editable-region-- + --fcc-editable-region-- --fcc-editable-region-- diff --git a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd3.md b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd3.md index ae29d05694c..62f3cb57bec 100644 --- a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd3.md +++ b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd3.md @@ -497,7 +497,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd4.md b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd4.md index 07d2f8bed16..409043306c5 100644 --- a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd4.md +++ b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd4.md @@ -497,7 +497,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd5.md b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd5.md index e132d7c39c6..4df6e15395b 100644 --- a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd5.md +++ b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd5.md @@ -497,7 +497,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd6.md b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd6.md index 56c73643a28..1ed24afca50 100644 --- a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd6.md +++ b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd6.md @@ -470,7 +470,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd7.md b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd7.md index 74019ae005c..2a5e56ab0a1 100644 --- a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd7.md +++ b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd7.md @@ -478,7 +478,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -609,3 +609,4 @@ export const FootballPlayerCard = () => { ); }; ``` + diff --git a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd8.md b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd8.md index dac21e5d540..7076ced6bb5 100644 --- a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd8.md +++ b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd8.md @@ -410,7 +410,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -484,7 +484,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -538,8 +538,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd9.md b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd9.md index 861770b9992..4397eab09d5 100644 --- a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd9.md +++ b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd9.md @@ -402,7 +402,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -476,7 +476,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -530,8 +530,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bda.md b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bda.md index 8cd8fd6de9b..e20684856ef 100644 --- a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bda.md +++ b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bda.md @@ -402,7 +402,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -476,7 +476,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -530,8 +530,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( @@ -640,3 +641,4 @@ export const FootballPlayerCard = () => { ); }; ``` + diff --git a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdb.md b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdb.md index dd3249d94ad..a78f74af3bd 100644 --- a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdb.md +++ b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdb.md @@ -402,7 +402,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -476,7 +476,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -530,8 +530,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdc.md b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdc.md index fb802bd6b5a..b135ea68e3e 100644 --- a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdc.md +++ b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdc.md @@ -402,7 +402,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -476,7 +476,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -530,8 +530,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdd.md b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdd.md index 37ea023d2f4..63b797ce82d 100644 --- a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdd.md +++ b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdd.md @@ -402,7 +402,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -476,7 +476,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -530,8 +530,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bde.md b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bde.md index d619f21b799..d4006c2adc2 100644 --- a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bde.md +++ b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bde.md @@ -402,7 +402,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -414,10 +414,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -430,7 +430,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
{player.position}
-
{getPlayerTier(player.overallRating).toUpperCase()}
+
+ {getPlayerTier(player.overallRating).toUpperCase()} +
{player.club}
@@ -474,14 +476,14 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { - name: 'PELE', + name: "PELE", overallRating: 98, - position: 'ST', - club: 'Santos FC', - imageUrl: 'https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg', + position: "ST", + club: "Santos FC", + imageUrl: "https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg", pac: 97, sho: 98, pas: 83, @@ -506,8 +508,18 @@ export const FootballPlayerCard = () => {

Player Info

- - setPlayer({ ...player, name: e.target.value })} /> + + + setPlayer({ ...player, name: e.target.value }) + } + />
@@ -518,8 +530,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( @@ -531,46 +544,115 @@ export const FootballPlayerCard = () => {
- - setPlayer({ ...player, overallRating: Number(e.target.value) })} /> + + + setPlayer({ + ...player, + overallRating: Number(e.target.value), + }) + } + />
- - setPlayer({ ...player, club: e.target.value })} /> + + + setPlayer({ ...player, club: e.target.value }) + } + />
- - setPlayer({ ...player, imageUrl: e.target.value })} /> + + + setPlayer({ ...player, imageUrl: e.target.value }) + } + />

Player Stats

- - setPlayer({ ...player, pac: Number(e.target.value) })} /> + + + setPlayer({ ...player, pac: Number(e.target.value) }) + } + />
- - setPlayer({ ...player, sho: Number(e.target.value) })} /> + + + setPlayer({ ...player, sho: Number(e.target.value) }) + } + />
- - setPlayer({ ...player, pas: Number(e.target.value) })} /> + + + setPlayer({ ...player, pas: Number(e.target.value) }) + } + />
- + --fcc-editable-region-- --fcc-editable-region--
- +
- +
@@ -579,7 +661,9 @@ export const FootballPlayerCard = () => {

Live Preview

Updates as you type

-
+
@@ -589,3 +673,4 @@ export const FootballPlayerCard = () => { ); }; ``` + diff --git a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdf.md b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdf.md index d670500b688..c6b5d1358de 100644 --- a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdf.md +++ b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdf.md @@ -421,7 +421,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -495,7 +495,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -549,8 +549,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( @@ -667,11 +668,11 @@ export const FootballPlayerCard = () => { } /> - --fcc-editable-region--
+ --fcc-editable-region--
@@ -679,8 +680,8 @@ export const FootballPlayerCard = () => { PHY -
--fcc-editable-region-- + diff --git a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8d1be04ed6aad1c955729.md b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8d1be04ed6aad1c955729.md index 5fe2a164b49..bccbd2e1656 100644 --- a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8d1be04ed6aad1c955729.md +++ b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69e8d1be04ed6aad1c955729.md @@ -391,8 +391,8 @@ const { useState } = React; --fcc-editable-region-- export const FootballPlayerCard = () => { - return ( -

Football Card Builder

- ) + return ( +

Football Card Builder

+ ); }; ``` diff --git a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69ea01c45b04f3e9de845036.md b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69ea01c45b04f3e9de845036.md index 7e473068a80..29bc8283206 100644 --- a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69ea01c45b04f3e9de845036.md +++ b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69ea01c45b04f3e9de845036.md @@ -405,7 +405,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -483,7 +483,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -537,8 +537,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69ea02adff0fd528639ee23b.md b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69ea02adff0fd528639ee23b.md index 709db406068..3428b525531 100644 --- a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69ea02adff0fd528639ee23b.md +++ b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69ea02adff0fd528639ee23b.md @@ -409,7 +409,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -485,7 +485,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -543,8 +543,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69ea0349f8305a99324465ff.md b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69ea0349f8305a99324465ff.md index e5a45956e40..37a7801a825 100644 --- a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69ea0349f8305a99324465ff.md +++ b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69ea0349f8305a99324465ff.md @@ -407,7 +407,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -483,7 +483,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -502,11 +502,9 @@ const defaultPlayer: PlayerData = { function loadPlayer(): PlayerData { try { --fcc-editable-region-- - - --fcc-editable-region-- - } catch (error) { - } + --fcc-editable-region-- + } catch (error) {} } export const FootballPlayerCard = () => { @@ -547,8 +545,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69ea044f8c93a5e7ce64214c.md b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69ea044f8c93a5e7ce64214c.md index 60879001f96..f50a07aa129 100644 --- a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69ea044f8c93a5e7ce64214c.md +++ b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69ea044f8c93a5e7ce64214c.md @@ -395,7 +395,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -471,7 +471,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -492,12 +492,10 @@ function loadPlayer(): PlayerData { const saved = localStorage.getItem(STORAGE_KEY); if (saved) { --fcc-editable-region-- - + --fcc-editable-region-- - }; - } catch (error) { - - } + } + } catch (error) {} } export const FootballPlayerCard = () => { @@ -538,8 +536,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69ea0577f25e519489353f82.md b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69ea0577f25e519489353f82.md index 55845508c3c..a8cabd157f1 100644 --- a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69ea0577f25e519489353f82.md +++ b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69ea0577f25e519489353f82.md @@ -405,7 +405,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -418,7 +418,6 @@ interface PlayerData { const STORAGE_KEY = "football_player_card"; - export function getPlayerTier(rating: number): string { if (rating >= 92) return "elite"; if (rating >= 85) return "gold"; @@ -482,7 +481,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -505,14 +504,15 @@ function loadPlayer(): PlayerData { return { ...defaultPlayer, ...JSON.parse(saved) - } - }; ---fcc-editable-region-- + }; + } } catch (error) { +--fcc-editable-region-- } -} + --fcc-editable-region-- +} export const FootballPlayerCard = () => { const [player, setPlayer] = useState(defaultPlayer); @@ -552,8 +552,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69ea064edb0dcc46e1422cca.md b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69ea064edb0dcc46e1422cca.md index 199a9fabcd4..9abf01e55a2 100644 --- a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69ea064edb0dcc46e1422cca.md +++ b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69ea064edb0dcc46e1422cca.md @@ -7,7 +7,7 @@ dashedName: step-68 # --description-- -Sasa utaongeza mantiki ya kuhifadhi katika `localStorage` kwa kutumia `useEffect`. +Sasa utaongeza mantiki ya kuhifadhi katika `localStorage` kwa kutumia `useEffect`. Kupata au kuhifadhi data katika `localStorage` huchukuliwa kama athari ya pembeni katika React, kwa hivyo unapaswa kutumia `useEffect` kwa mantiki hii. @@ -401,7 +401,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -477,7 +477,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -500,8 +500,8 @@ function loadPlayer(): PlayerData { return { ...defaultPlayer, ...JSON.parse(saved) - } - }; + }; + } } catch (error) { console.log("Failed to load player data, using defaults:", error); } @@ -546,8 +546,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69ea0939f2f92cfc6c7a850d.md b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69ea0939f2f92cfc6c7a850d.md index 3d8f6f081a2..9b291291271 100644 --- a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69ea0939f2f92cfc6c7a850d.md +++ b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69ea0939f2f92cfc6c7a850d.md @@ -46,12 +46,10 @@ assert.match(__helpers.removeJSComments(code), /useEffect\s*\(\(\)\s=>\s*\{\s*tr Football Player Card Builder - - - + @@ -415,7 +413,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -435,7 +433,7 @@ export function getPlayerTier(rating: number): string { return "bronze"; } -function PlayerCard({ player }: { player: PlayerData }) { +export const PlayerCard = ({ player }: { player: PlayerData }) => { return (
@@ -491,7 +489,7 @@ function PlayerCard({ player }: { player: PlayerData }) {
); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -514,8 +512,8 @@ function loadPlayer(): PlayerData { return { ...defaultPlayer, ...JSON.parse(saved) - } - }; + }; + } } catch (error) { console.log("Failed to load player data, using defaults:", error); } @@ -526,7 +524,7 @@ export const FootballPlayerCard = () => { const [player, setPlayer] = useState(defaultPlayer); --fcc-editable-region-- - + --fcc-editable-region-- return ( @@ -565,8 +563,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69ea0a89bd84cf2461b48ceb.md b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69ea0a89bd84cf2461b48ceb.md index 072679a6f2b..497e170994e 100644 --- a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69ea0a89bd84cf2461b48ceb.md +++ b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69ea0a89bd84cf2461b48ceb.md @@ -403,7 +403,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -479,7 +479,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -502,8 +502,8 @@ function loadPlayer(): PlayerData { return { ...defaultPlayer, ...JSON.parse(saved) - } - }; + }; + } } catch (error) { console.log("Failed to load player data, using defaults:", error); } @@ -513,15 +513,15 @@ function loadPlayer(): PlayerData { export const FootballPlayerCard = () => { const [player, setPlayer] = useState(defaultPlayer); ---fcc-editable-region-- useEffect(() => { try { +--fcc-editable-region-- } catch (error) { +--fcc-editable-region-- } }, [player]); ---fcc-editable-region-- return (
@@ -559,8 +559,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69ea0bb3e7000f44c207bb0e.md b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69ea0bb3e7000f44c207bb0e.md index 2471e009649..0e580268390 100644 --- a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69ea0bb3e7000f44c207bb0e.md +++ b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69ea0bb3e7000f44c207bb0e.md @@ -401,7 +401,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -477,7 +477,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -500,8 +500,8 @@ function loadPlayer(): PlayerData { return { ...defaultPlayer, ...JSON.parse(saved) - } - }; + }; + } } catch (error) { console.log("Failed to load player data, using defaults:", error); } @@ -557,8 +557,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( @@ -1098,7 +1099,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -1174,7 +1175,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -1197,8 +1198,8 @@ function loadPlayer(): PlayerData { return { ...defaultPlayer, ...JSON.parse(saved) - } - }; + }; + } } catch (error) { console.log("Failed to load player data, using defaults:", error); } @@ -1252,8 +1253,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69ea1bb4a66dd6debb999c7f.md b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69ea1bb4a66dd6debb999c7f.md index 6caaca8f249..e8a661783a9 100644 --- a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69ea1bb4a66dd6debb999c7f.md +++ b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69ea1bb4a66dd6debb999c7f.md @@ -473,7 +473,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69ea1dd8e74976afa407bf22.md b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69ea1dd8e74976afa407bf22.md index f96f7f9dcb2..363d4977045 100644 --- a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69ea1dd8e74976afa407bf22.md +++ b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69ea1dd8e74976afa407bf22.md @@ -479,7 +479,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69ea1ed1543a4db863564aac.md b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69ea1ed1543a4db863564aac.md index fe1e212a7ab..6c3790ff80e 100644 --- a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69ea1ed1543a4db863564aac.md +++ b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69ea1ed1543a4db863564aac.md @@ -472,7 +472,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69ea21dcd8c4cb48c23a2c67.md b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69ea21dcd8c4cb48c23a2c67.md index 0c7d5504932..57d99480421 100644 --- a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69ea21dcd8c4cb48c23a2c67.md +++ b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69ea21dcd8c4cb48c23a2c67.md @@ -14,7 +14,7 @@ Ongeza sifa ya kipengele `onChange` iliyowekwa kuwa kitendakazi cha mshale kinac Nafasi yako `select` inapaswa kuwa na mshughulikiaji `onChange` anayefanya wito wa `setPlayer` kwa kueneza `player` na kusahihisha `position`. ```js -assert.match(__helpers.removeJSComments(code), /onChange.*setPlayer.*\.\.\.\s*player[\s\S]*position/); +assert.match(__helpers.removeJSComments(code), /onChange=\{[\s\S]*?position:\s*e\.target\.value\s+as\s+Position/); ``` # --seed-- @@ -469,7 +469,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69ea2378f3c6a60a57cc29c3.md b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69ea2378f3c6a60a57cc29c3.md index 5cb01422c50..e857a3d24a8 100644 --- a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69ea2378f3c6a60a57cc29c3.md +++ b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69ea2378f3c6a60a57cc29c3.md @@ -483,7 +483,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -537,10 +537,12 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > --fcc-editable-region-- - + --fcc-editable-region-- diff --git a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69eb216380522cfc11aa408c.md b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69eb216380522cfc11aa408c.md index 569b7828dd3..fd4f6179532 100644 --- a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69eb216380522cfc11aa408c.md +++ b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69eb216380522cfc11aa408c.md @@ -443,7 +443,7 @@ export const PlayerCard = () => { ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69eb23665c115447405343ac.md b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69eb23665c115447405343ac.md index 2c04ddb09f4..a7731ff4754 100644 --- a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69eb23665c115447405343ac.md +++ b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69eb23665c115447405343ac.md @@ -461,7 +461,7 @@ export const PlayerCard = () => { ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69eb2847cc8f5638e226e8ce.md b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69eb2847cc8f5638e226e8ce.md index 6980f901784..2295280109d 100644 --- a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69eb2847cc8f5638e226e8ce.md +++ b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69eb2847cc8f5638e226e8ce.md @@ -483,10 +483,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -543,7 +543,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { --fcc-editable-region-- diff --git a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69ed3985819de69de27c4390.md b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69ed3985819de69de27c4390.md index c4f3a54c815..e7516299e43 100644 --- a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69ed3985819de69de27c4390.md +++ b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69ed3985819de69de27c4390.md @@ -391,10 +391,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -453,14 +453,14 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { - name: 'PELE', + name: "PELE", overallRating: 98, - position: 'ST', - club: 'Santos FC', - imageUrl: 'https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg', + position: "ST", + club: "Santos FC", + imageUrl: "https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg", pac: 97, sho: 98, pas: 83, @@ -471,7 +471,7 @@ const defaultPlayer: PlayerData = { export const FootballPlayerCard = () => { --fcc-editable-region-- - return ; + return ; --fcc-editable-region-- }; ``` diff --git a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69f1a6f57dd2d4685822074a.md b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69f1a6f57dd2d4685822074a.md index 12a704a0957..3ce02d7623b 100644 --- a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69f1a6f57dd2d4685822074a.md +++ b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69f1a6f57dd2d4685822074a.md @@ -401,8 +401,8 @@ export const PlayerCard = () => {
- --fcc-editable-region--
+ --fcc-editable-region--
@@ -410,14 +410,14 @@ export const PlayerCard = () => {
-
--fcc-editable-region-- +
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69f1a9e19340f19b1fd051c6.md b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69f1a9e19340f19b1fd051c6.md index d22cd5d58af..d9f8ce185fd 100644 --- a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69f1a9e19340f19b1fd051c6.md +++ b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69f1a9e19340f19b1fd051c6.md @@ -416,9 +416,9 @@ export const PlayerCard = () => {
- --fcc-editable-region--
+ --fcc-editable-region--
@@ -426,14 +426,14 @@ export const PlayerCard = () => {
+ --fcc-editable-region--
- --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69f1af24b0860d13f0b295e5.md b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69f1af24b0860d13f0b295e5.md index 1b928bf6668..604dfa2f4f6 100644 --- a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69f1af24b0860d13f0b295e5.md +++ b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69f1af24b0860d13f0b295e5.md @@ -407,10 +407,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -451,9 +451,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
- --fcc-editable-region--
+ --fcc-editable-region-- 99 DRI
@@ -463,17 +463,17 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
75 + --fcc-editable-region-- PHY
- --fcc-editable-region-- ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69f1b1fb36c6c0c80907e8e1.md b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69f1b1fb36c6c0c80907e8e1.md index 6373149074d..ae2990821a4 100644 --- a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69f1b1fb36c6c0c80907e8e1.md +++ b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69f1b1fb36c6c0c80907e8e1.md @@ -483,7 +483,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -511,17 +511,15 @@ export const FootballPlayerCard = () => {
- --fcc-editable-region-- -
- -
+
+ --fcc-editable-region--
+ --fcc-editable-region--
- --fcc-editable-region-- ); }; diff --git a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69f1b591221851200c734eb4.md b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69f1b591221851200c734eb4.md index f5084d66821..f7b124351e5 100644 --- a/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69f1b591221851200c734eb4.md +++ b/curriculum/challenges/swahili/blocks/workshop-build-a-football-player-card-builder/69f1b591221851200c734eb4.md @@ -472,7 +472,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f356ed6199b0cdef1d2be8f.md b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f356ed6199b0cdef1d2be8f.md index 3a91a3cc685..d642fb6ee83 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f356ed6199b0cdef1d2be8f.md +++ b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f356ed6199b0cdef1d2be8f.md @@ -13,11 +13,11 @@ Umejifunza jinsi ya kufanya kazi na vichaguzi vya `class` katika mafundisho ya a ```css .class-name { - styles + property: value; } ``` -Badilisha kichaguzi cha `#menu` kilichopo kuwa kichaguzi cha darasa la vitu kwa kubadilisha `#menu` na darasa la vitu linaloitwa `.menu`. +Badilisha kichaguzi kilichopo cha `#menu` kuwa kichaguzi cha darasa la vitu kwa kubadilisha `#menu` na kichaguzi cha darasa la vitu `.menu`. # --hints-- diff --git a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f3cade99dda4e6071a85dfd.md b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f3cade99dda4e6071a85dfd.md index 4e420efed33..12556e9ea9a 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f3cade99dda4e6071a85dfd.md +++ b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f3cade99dda4e6071a85dfd.md @@ -109,7 +109,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f3ef6e01f288a026d709587.md b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f3ef6e01f288a026d709587.md index ef13ea2faf2..aff2aadb096 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f3ef6e01f288a026d709587.md +++ b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f3ef6e01f288a026d709587.md @@ -171,7 +171,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f3ef6e03d719d5ac4738993.md b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f3ef6e03d719d5ac4738993.md index 446983de144..3a8ed7be0af 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f3ef6e03d719d5ac4738993.md +++ b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f3ef6e03d719d5ac4738993.md @@ -115,7 +115,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f3ef6e04559b939080db057.md b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f3ef6e04559b939080db057.md index 5ac88714823..0c996d4abb2 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f3ef6e04559b939080db057.md +++ b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f3ef6e04559b939080db057.md @@ -139,7 +139,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f3ef6e050279c7a4a7101d3.md b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f3ef6e050279c7a4a7101d3.md index 94579b2bb3d..1994d40e480 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f3ef6e050279c7a4a7101d3.md +++ b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f3ef6e050279c7a4a7101d3.md @@ -137,7 +137,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f3ef6e05473f91f948724ab.md b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f3ef6e05473f91f948724ab.md index a3971045256..309494103c2 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f3ef6e05473f91f948724ab.md +++ b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f3ef6e05473f91f948724ab.md @@ -116,6 +116,6 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f3ef6e056bdde6ae6892ba2.md b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f3ef6e056bdde6ae6892ba2.md index 2146e4b025a..ab9626bdde1 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f3ef6e056bdde6ae6892ba2.md +++ b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f3ef6e056bdde6ae6892ba2.md @@ -9,7 +9,7 @@ dashedName: step-54 Ni kidogo kuchosha kwa maandishi yote kuwa na `font-family` sawa. Bado unaweza kuwa na sehemu kubwa ya maandishi `sans-serif` na kufanya tu vipengele vya `h1` na `h2` kuwa tofauti kwa kutumia kichaguzi tofauti. -Panga mtindo kwa vipengele vyote vya `h1` na `h2` kwa kutumia kichaguzi kimoja ili maandishi ya vipengele hivi yatumie fonti ya `Impact`. +Panga mtindo wa vipengele vyote vya `h1` na `h2` kwa kutumia orodha moja ya vichaguzi ili maandishi ya vipengele hivi yatumie fonti ya `Impact`. # --hints-- @@ -135,7 +135,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f3ef6e06d34faac0447fc44.md b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f3ef6e06d34faac0447fc44.md index 0e64546cbc1..0fed4b6393b 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f3ef6e06d34faac0447fc44.md +++ b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f3ef6e06d34faac0447fc44.md @@ -127,7 +127,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f3ef6e07276f782bb46b93d.md b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f3ef6e07276f782bb46b93d.md index ee39380b7b9..370d60ab248 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f3ef6e07276f782bb46b93d.md +++ b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f3ef6e07276f782bb46b93d.md @@ -142,7 +142,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f3ef6e0819d4f23ca7285e6.md b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f3ef6e0819d4f23ca7285e6.md index 5777c887641..4c85eb2472b 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f3ef6e0819d4f23ca7285e6.md +++ b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f3ef6e0819d4f23ca7285e6.md @@ -104,7 +104,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f3ef6e087d56ed3ffdc36be.md b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f3ef6e087d56ed3ffdc36be.md index 02da9ca0065..e04e6343fe4 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f3ef6e087d56ed3ffdc36be.md +++ b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f3ef6e087d56ed3ffdc36be.md @@ -129,6 +129,6 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f3ef6e0a81099d9a697b550.md b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f3ef6e0a81099d9a697b550.md index 2cd62689c4e..de642f9dc86 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f3ef6e0a81099d9a697b550.md +++ b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f3ef6e0a81099d9a697b550.md @@ -167,7 +167,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f3ef6e0b431cc215bb16f55.md b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f3ef6e0b431cc215bb16f55.md index 0923a7e2886..1d565d88d83 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f3ef6e0b431cc215bb16f55.md +++ b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f3ef6e0b431cc215bb16f55.md @@ -141,7 +141,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f3ef6e0e0c3feaebcf647ad.md b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f3ef6e0e0c3feaebcf647ad.md index b4ce9e99f09..7fef752ccbb 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f3ef6e0e0c3feaebcf647ad.md +++ b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f3ef6e0e0c3feaebcf647ad.md @@ -103,7 +103,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f3ef6e0e9629bad967cd71e.md b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f3ef6e0e9629bad967cd71e.md index 20d69e0ddd2..5d312949849 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f3ef6e0e9629bad967cd71e.md +++ b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f3ef6e0e9629bad967cd71e.md @@ -7,7 +7,7 @@ dashedName: step-55 # --description-- -Unaweza kuongeza thamani ya njia mbadala kwa familia ya fonti kwa kuongeza jina lingine la fonti lililozuiwa na koma. Njia mbadala hutumika katika hali ambapo fonti ya awali haipatikani. +Unaweza kuongeza thamani ya njia mbadala kwa `font-family` kwa kuongeza jina lingine la fonti lililotengwa na koma. Njia mbadala hutumika wakati fonti ya kwanza haipatikani. Ongeza fonti ya njia mbadala `serif` baada ya fonti ya `Impact`. @@ -113,7 +113,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f3ef6e0eaa7da26e3d34d78.md b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f3ef6e0eaa7da26e3d34d78.md index 325ec6c216c..a30d45778a3 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f3ef6e0eaa7da26e3d34d78.md +++ b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f3ef6e0eaa7da26e3d34d78.md @@ -128,7 +128,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f3ef6e0f8c230bdd2349716.md b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f3ef6e0f8c230bdd2349716.md index bbf7b2dedbb..520c3a21a6f 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f3ef6e0f8c230bdd2349716.md +++ b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f3ef6e0f8c230bdd2349716.md @@ -140,6 +140,6 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f3f26fa39591db45e5cd7a0.md b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f3f26fa39591db45e5cd7a0.md index 820fc5901d6..daf7a001e3c 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f3f26fa39591db45e5cd7a0.md +++ b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f3f26fa39591db45e5cd7a0.md @@ -7,7 +7,7 @@ dashedName: step-64 # --description-- -Sifa za msingi za kipengele cha `hr` zitafanya ionekane kama mstari mwembamba wa kijivu hafifu. Unaweza kubadilisha urefu wa mstari kwa kuweka thamani kwa sifa ya `height`. +Sifa za msingi za kipengele cha `hr` zitafanya ionekane kama mstari mwembamba wa rangi ya kijivu nyepesi. Unaweza kubadilisha urefu wa mstari kwa kuweka thamani kwa sifa ya `height`. Badilisha urefu wa kipengele cha `hr` kuwa `3px`. @@ -150,7 +150,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f459225127805351a6ad057.md b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f459225127805351a6ad057.md index 1b71d2743c8..cbafe700455 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f459225127805351a6ad057.md +++ b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f459225127805351a6ad057.md @@ -144,7 +144,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f459a7ceb8b5c446656d88b.md b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f459a7ceb8b5c446656d88b.md index 2e080cf6a07..3f73a86c80f 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f459a7ceb8b5c446656d88b.md +++ b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f459a7ceb8b5c446656d88b.md @@ -147,6 +147,6 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f459cf202c2a3472fae6a9f.md b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f459cf202c2a3472fae6a9f.md index c7b62037e86..aa44b92b93d 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f459cf202c2a3472fae6a9f.md +++ b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f459cf202c2a3472fae6a9f.md @@ -7,7 +7,7 @@ dashedName: step-67 # --description-- -Tazama jinsi unene wa mstari unavyoonekana mkubwa zaidi? Thamani ya msingi ya sifa inayoitwa `border-width` ni `1px` kwa mipaka yote ya vipengele vya `hr`. Kwa kubadilisha mpaka kuwa rangi ile ile kama ya mandhari, jumla ya urefu wa mstari ni `5px` (`3px` pamoja na upana wa mpaka wa juu na wa chini wa `1px`). +Umeona jinsi unene wa mstari unavyoonekana mkubwa zaidi? Thamani ya msingi ya sifa inayoitwa `border-width` ni `1px` kwa mipaka yote ya vipengele vya `hr`. Juu ya mstari huo daima imekuwa `5px` (`3px` pamoja na unene wa mipaka ya juu na chini ya `1px`); kupaka rangi mipaka kulifanya mipaka hiyo ionekane. Badilisha sifa ya `height` ya `hr` kuwa `2px`, ili jumla ya urefu wake iwe `4px`. @@ -147,7 +147,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f459fd48bdc98491ca6d1a3.md b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f459fd48bdc98491ca6d1a3.md index c558dc6a0af..2633e2b6187 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f459fd48bdc98491ca6d1a3.md +++ b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f459fd48bdc98491ca6d1a3.md @@ -145,7 +145,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f45a05977e2fa49d9119437.md b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f45a05977e2fa49d9119437.md index fa9a4258fcd..d4e6b5b1563 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f45a05977e2fa49d9119437.md +++ b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f45a05977e2fa49d9119437.md @@ -146,6 +146,6 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f45a276c093334f0f6e9df4.md b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f45a276c093334f0f6e9df4.md index 8cf9075ef3d..bb27b343ad3 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f45a276c093334f0f6e9df4.md +++ b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f45a276c093334f0f6e9df4.md @@ -185,7 +185,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f45a5a7c49a8251f0bdb527.md b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f45a5a7c49a8251f0bdb527.md index 82e1cf75b53..2b81c84ad90 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f45a5a7c49a8251f0bdb527.md +++ b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f45a5a7c49a8251f0bdb527.md @@ -157,7 +157,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f45a66d4a2b0453301e5a26.md b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f45a66d4a2b0453301e5a26.md index e20bea4cd0f..84387cf7638 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f45a66d4a2b0453301e5a26.md +++ b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f45a66d4a2b0453301e5a26.md @@ -166,7 +166,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f45b0731d39e15d54df4dfc.md b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f45b0731d39e15d54df4dfc.md index ec6fe0022dc..19d80d9f3a7 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f45b0731d39e15d54df4dfc.md +++ b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f45b0731d39e15d54df4dfc.md @@ -161,7 +161,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f45b25e7ec2405f166b9de1.md b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f45b25e7ec2405f166b9de1.md index a4752bdea8e..ad9f0b30946 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f45b25e7ec2405f166b9de1.md +++ b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f45b25e7ec2405f166b9de1.md @@ -9,7 +9,7 @@ dashedName: step-78 Unabadilisha sifa za kiunganisho wakati kiunganisho kimebainika kutembelewa kwa kutumia kichaguzi bandia kinachoonekana kama `a:visited { propertyName: propertyValue; }`. -Badilisha rangi ya kiunganisho cha kijachini `Visit our website` kuwa `grey` wakati mtumizi amebahatika kutembelea kiunganisho hicho. +Badilisha rangi ya kiungo cha kijachini `Visit our website` kuwa `gray` wakati mtumizi ameshatembelea kiungo hicho. # --hints-- @@ -20,14 +20,14 @@ const aVisitedStyle = new __helpers.CSSHelp(document).getStyle('a:visited'); assert.exists(aVisitedStyle); ``` -Unapaswa kuweka sifa ya `color` kuwa `grey`. +Unapaswa kuweka sifa ya `color` kuwa `gray`. ```js const hasColor = new __helpers.CSSHelp(document).getCSSRules().some(x => (x.style.color === 'grey' || x.style.color === 'gray')); assert.isTrue(hasColor); ``` -`a:visited` yako inapaswa kuwa na `color` ya `grey`. +`a:visited` yako inapaswa kuwa na `color` ya `gray`. ```js const aVisitedColor = new __helpers.CSSHelp(document).getStyle('a:visited')?.getPropertyValue('color'); @@ -161,7 +161,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f45b3c93c027860d9298dbd.md b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f45b3c93c027860d9298dbd.md index a6c142b0b53..fab72d89e93 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f45b3c93c027860d9298dbd.md +++ b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f45b3c93c027860d9298dbd.md @@ -161,7 +161,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ @@ -179,7 +179,7 @@ a { } a:visited { - color: grey; + color: gray; } --fcc-editable-region-- diff --git a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f45b45d099f3e621fbbb256.md b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f45b45d099f3e621fbbb256.md index 3ef78d65604..ea744101b5b 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f45b45d099f3e621fbbb256.md +++ b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f45b45d099f3e621fbbb256.md @@ -161,7 +161,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ @@ -179,7 +179,7 @@ a { } a:visited { - color: grey; + color: gray; } a:hover { diff --git a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f45b4c81cea7763550e40df.md b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f45b4c81cea7763550e40df.md index b2e9d10feed..c578f9a1002 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f45b4c81cea7763550e40df.md +++ b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f45b4c81cea7763550e40df.md @@ -152,7 +152,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ @@ -171,7 +171,7 @@ a { --fcc-editable-region-- a:visited { - color: grey; + color: gray; } a:hover { diff --git a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f45b715301bbf667badc04a.md b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f45b715301bbf667badc04a.md index 2e9fd481aec..2e49b6befc1 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f45b715301bbf667badc04a.md +++ b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f45b715301bbf667badc04a.md @@ -7,7 +7,7 @@ dashedName: step-82 # --description-- -Maandishi ya menyu `CAMPER CAFE` yana nafasi tofauti kutoka juu ikilinganishwa na nafasi ya anwani chini ya menyu. Hii ni kwa sababu kivinjari kina ukingo wa juu wa msingi kwa kipengele cha `h1`. +Nafasi juu ya maandishi ya menyu `CAMPER CAFE` haifananishi na nafasi chini ya anwani katika sehemu ya chini ya menyu. Hii ni kwa sababu kivinjari kina ukingo wa juu wa msingi kwa kipengele cha `h1`. Badilisha ukingo wa juu wa kipengele cha `h1` kuwa `0` ili kuondoa ukingo wote wa juu. @@ -157,7 +157,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f46e270702a8456a664f0df.md b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f46e270702a8456a664f0df.md index 29477a8031c..45a5c086dba 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f46e270702a8456a664f0df.md +++ b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f46e270702a8456a664f0df.md @@ -156,7 +156,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f46e36e745ead58487aabf2.md b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f46e36e745ead58487aabf2.md index 3d0854456c0..f7db6d743f3 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f46e36e745ead58487aabf2.md +++ b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f46e36e745ead58487aabf2.md @@ -163,7 +163,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f46e7a4750dd05b5a673920.md b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f46e7a4750dd05b5a673920.md index 222867f4f03..1d499ba921e 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f46e7a4750dd05b5a673920.md +++ b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f46e7a4750dd05b5a673920.md @@ -160,7 +160,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f46e8284aae155c83015dee.md b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f46e8284aae155c83015dee.md index d81f1f795cc..df8a2b3c434 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f46e8284aae155c83015dee.md +++ b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f46e8284aae155c83015dee.md @@ -9,7 +9,7 @@ dashedName: step-86 Menyu inaonekana nzuri, lakini mbali na picha ya mandhari ya maharagwe ya kahawa, kwa kawaida ni maandishi tu. -Chini ya kichwa cha sehemu `Coffee`, ongeza picha ukitumia url `https://cdn.freecodecamp.org/curriculum/css-cafe/coffee.jpg`. Mpe picha hiyo thamani ya sifa ya kipengele `alt` ya `coffee icon`. +Chini ya kichwa cha sehemu cha `Coffee`, ongeza picha ukitumia URL `https://cdn.freecodecamp.org/curriculum/css-cafe/coffee.jpg`. Toa picha hiyo thamani ya `alt` ya `coffee icon`. # --hints-- @@ -105,6 +105,7 @@ assert.match(imageAltValue, /coffee icon/i);

123 Free Code Camp Drive

+ ``` @@ -171,7 +172,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f46ede1ff8fec5ba656b44c.md b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f46ede1ff8fec5ba656b44c.md index d11d36de542..a275f877328 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f46ede1ff8fec5ba656b44c.md +++ b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f46ede1ff8fec5ba656b44c.md @@ -144,7 +144,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } --fcc-editable-region-- diff --git a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f46fc57528aa1c4b5ea7c2e.md b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f46fc57528aa1c4b5ea7c2e.md index c422b0c599a..cf1295cc91d 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f46fc57528aa1c4b5ea7c2e.md +++ b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f46fc57528aa1c4b5ea7c2e.md @@ -161,7 +161,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f4701b942c824109626c3d8.md b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f4701b942c824109626c3d8.md index 7fd4d2caabf..05cb8fec5b4 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f4701b942c824109626c3d8.md +++ b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f4701b942c824109626c3d8.md @@ -153,6 +153,6 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f475bb508746c16c9431d42.md b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f475bb508746c16c9431d42.md index 86b4f47a206..3e56db10546 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f475bb508746c16c9431d42.md +++ b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f475bb508746c16c9431d42.md @@ -7,9 +7,9 @@ dashedName: step-87 # --description-- -Picha uliyoongeza haiko katikati kwa usawa kama kichwa cha sehemu cha `Coffee` kilicho juu yake. Vipengele vya `img` ni "kama" vipengele vya mstari mmoja. +Picha uliyoongeza haiko katikati kwa usawa kama kichwa cha sehemu cha `Coffee` kilicho juu yake. Vipengele vya `img` ni vipengele vya ndani ya mstari, hivyo viko katika mtiririko wa maandishi. -Ili kufanya picha itende kazi kama vipengele vya ngazi ya block kama vile vichwa vya sehemu, tengeneza kichaguzi cha aina ya `img`. Weka sifa ya `display` kuwa `block`, na tumia sifa za `margin-left` na `margin-right` kuifanya iwe katikati kwa usawa. +Ili kufanya picha itende kama kipengele cha ngazi ya block kama kichwa cha sehemu, tengeneza kichaguzi cha aina ya `img`. Weka sifa ya `display` kuwa `block`, na tumia sifa za `margin-left` na `margin-right` kuiweka katikati kwa usawa. # --hints-- @@ -120,6 +120,7 @@ assert.equal(imgMarginRight, 'auto');

123 Free Code Camp Drive

+ ``` @@ -190,7 +191,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f475e1c7f71a61d913836c6.md b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f475e1c7f71a61d913836c6.md index 84650285106..e04a6e96fc1 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f475e1c7f71a61d913836c6.md +++ b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f475e1c7f71a61d913836c6.md @@ -97,6 +97,7 @@ assert.match(lastImage?.alt, /pie icon/i);

123 Free Code Camp Drive

+ ``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f47fe7e31980053a8d4403b.md b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f47fe7e31980053a8d4403b.md index 867a70dfec0..2bae02be514 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f47fe7e31980053a8d4403b.md +++ b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f47fe7e31980053a8d4403b.md @@ -7,7 +7,7 @@ dashedName: step-89 # --description-- -Itakuwa vizuri ikiwa nafasi ya wima kati ya vipengele vya `h2` na alama zao zinazohusiana itakuwa ndogo. Vipengele vya `h2` vina nafasi ya kawaida ya ukingo wa juu na chini, kwa hivyo unaweza kubadilisha ukingo wa chini wa vipengele vya `h2` kuwa `0` au nambari nyingine. +Itakuwa vizuri kama nafasi ya wima kati ya vipengele vya `h2` na alama zao zinazohusiana ingekuwa ndogo zaidi. Vipengele vya `h2` vina nafasi ya ukingo ya kawaida ya juu na chini, kwa hivyo unaweza kubadilisha ukingo wa chini wa vipengele vya `h2` kuwa `0` au thamani nyingine yoyote. Kuna njia rahisi zaidi, ongeza tu ukingo hasi wa juu kwa vipengele vya `img` ili kuvivuta juu kutoka kwenye nafasi zao za sasa. Thamani hasi huundwa kwa kutumia `-` mbele ya thamani. Ili kumaliza warsha hii, endelea na tumia ukingo hasi wa juu wa `25px` katika kichaguzi cha aina cha `img`. diff --git a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f716ad029ee4053c7027a7a.md b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f716ad029ee4053c7027a7a.md index af4369644f5..c1bf5dd0396 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f716ad029ee4053c7027a7a.md +++ b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f716ad029ee4053c7027a7a.md @@ -119,7 +119,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f716bee5838c354c728a7c5.md b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f716bee5838c354c728a7c5.md index a32892e9299..34862f49d60 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f716bee5838c354c728a7c5.md +++ b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f716bee5838c354c728a7c5.md @@ -158,6 +158,6 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f7b87422a560036fd03ccff.md b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f7b87422a560036fd03ccff.md index b7bab767bc1..bd125d63c3e 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f7b87422a560036fd03ccff.md +++ b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f7b87422a560036fd03ccff.md @@ -118,7 +118,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f7b88d37b1f98386f04edc0.md b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f7b88d37b1f98386f04edc0.md index fa64821b4e7..384a2a1a7ca 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f7b88d37b1f98386f04edc0.md +++ b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/5f7b88d37b1f98386f04edc0.md @@ -97,6 +97,6 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/6780e8ef4153930b965cd7b7.md b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/6780e8ef4153930b965cd7b7.md index c97665b3bd2..5c44a5fc361 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/6780e8ef4153930b965cd7b7.md +++ b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/6780e8ef4153930b965cd7b7.md @@ -125,6 +125,6 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/6780f0d898362873ac425dc8.md b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/6780f0d898362873ac425dc8.md index d928fdeb454..60276439cc6 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cafe-menu/6780f0d898362873ac425dc8.md +++ b/curriculum/challenges/swahili/blocks/workshop-cafe-menu/6780f0d898362873ac425dc8.md @@ -23,7 +23,7 @@ Kichaguzi cha `address` kinapaswa kuweka sifa ya `font-style`. assert.isNotEmpty(new __helpers.CSSHelp(document).getStyle('address').getPropVal('font-style')); ``` -Sifa ya `font-style` inapaswa kuwekwa kuwa `normal`. +Sifa ya `font-style` inapaswa kusetwa kuwa `normal`. ```js assert.equal(new __helpers.CSSHelp(document).getStyle('address').getPropVal('font-style'), 'normal'); @@ -156,7 +156,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/swahili/blocks/workshop-calculator/66cc095dfe1682753d2ab030.md b/curriculum/challenges/swahili/blocks/workshop-calculator/66cc095dfe1682753d2ab030.md index a15acdc7402..ef62edd3c79 100644 --- a/curriculum/challenges/swahili/blocks/workshop-calculator/66cc095dfe1682753d2ab030.md +++ b/curriculum/challenges/swahili/blocks/workshop-calculator/66cc095dfe1682753d2ab030.md @@ -7,7 +7,7 @@ dashedName: step-2 # --description-- -Moja ya dhana ulizojifunza katika mafundisho yaliyopita ilikuwa jinsi ya kurudisha thamani kutoka kwenye kitendakazi. +Moja ya dhana ulizojifunza katika mafundisho yaliyopita ilikuwa jinsi ya kurudisha thamani kutoka kwa kitendakazi. Hapa kuna ukumbusho wa jinsi ya kurudisha thamani kutoka kwenye kitendakazi: @@ -30,7 +30,10 @@ assert.strictEqual(addTwoAndSeven(), 9); Kitendakazi chako cha `addTwoAndSeven` kinapaswa kurudisha jumla kwa kutumia kiendeshaji cha `+`. ```js -assert.match(code, /return\s*(2\s*\+\s*7|7\s*\+\s*2)\s*;?/); +const explorer = await __helpers.Explorer(code); +const { addTwoAndSeven } = explorer.allFunctions; +const validExpressions = ["2 + 7", "7 + 2", "(2 + 7)", "(7 + 2)"]; +assert.isTrue(validExpressions.some(expr => addTwoAndSeven?.hasReturn(expr))); ``` # --seed-- diff --git a/curriculum/challenges/swahili/blocks/workshop-calculator/66cc0a9e06e00b75d6782be9.md b/curriculum/challenges/swahili/blocks/workshop-calculator/66cc0a9e06e00b75d6782be9.md index 0fb387df646..bd7da22a8f9 100644 --- a/curriculum/challenges/swahili/blocks/workshop-calculator/66cc0a9e06e00b75d6782be9.md +++ b/curriculum/challenges/swahili/blocks/workshop-calculator/66cc0a9e06e00b75d6782be9.md @@ -26,16 +26,12 @@ Sasa unapaswa kuona jumla ya `2` na `7` ikionyeshwa kwenye konsoli. # --hints-- -Unapaswa kuwa na `console.log` katika msimbo wako. - -```js -assert.match(code, /console\.log(.*)/); -``` - Unapaswa kuita kitendakazi cha `addTwoAndSeven` ndani ya `console.log`. ```js -assert.match(code, /console\.log\(\s*addTwoAndSeven\(\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(addTwoAndSeven())"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/swahili/blocks/workshop-calculator/66cc0ba5881acb7692cfc4de.md b/curriculum/challenges/swahili/blocks/workshop-calculator/66cc0ba5881acb7692cfc4de.md index a6f42f5b13d..811c2a7665f 100644 --- a/curriculum/challenges/swahili/blocks/workshop-calculator/66cc0ba5881acb7692cfc4de.md +++ b/curriculum/challenges/swahili/blocks/workshop-calculator/66cc0ba5881acb7692cfc4de.md @@ -7,7 +7,7 @@ dashedName: step-4 # --description-- -Sasa, ni wakati wa kuongeza kitendakazi kingine. +Sasa ni wakati wa kuongeza kitendakazi kingine. Tangaza kitendakazi kinachoitwa `addThreeAndFour` kinachorejesha jumla ya `3` na `4`. @@ -24,22 +24,24 @@ assert.isFunction(addThreeAndFour); Kitendakazi chako cha `addThreeAndFour` kinapaswa kurudisha jumla ya `3` na `4`. ```js -assert.equal(addThreeAndFour(), 7); +assert.strictEqual(addThreeAndFour(), 7); ``` Kitendakazi chako cha `addThreeAndFour` kinapaswa kurudisha jumla kwa kutumia mtaalamu wa `+`. ```js -const declarationStyle = /return\s*\(?\s*(3\s*\+\s*4|4\s*\+\s*3)\s*\)?\s*;?/; -const arrowStyle = /=>\s*\(?\s*(3\s*\+\s*4|4\s*\+\s*3)\s*\)?\s*;?/; -const combinedRegex = new RegExp(`(?:${declarationStyle.source})|(?:${arrowStyle.source})`); -assert.match(code, combinedRegex); +const explorer = await __helpers.Explorer(code); +const { addThreeAndFour } = explorer.allFunctions; +const validExpressions = ["3 + 4", "4 + 3", "(3 + 4)", "(4 + 3)"]; +assert.isTrue(validExpressions.some(expr => addThreeAndFour?.hasReturn(expr))); ``` Unapaswa kufanya wito wa kitendakazi cha `addThreeAndFour` ndani ya `console.log`. ```js -assert.match(code, /console\.log\(\s*addThreeAndFour\(\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(addThreeAndFour())"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/swahili/blocks/workshop-calculator/66cc0de2920bec775f610424.md b/curriculum/challenges/swahili/blocks/workshop-calculator/66cc0de2920bec775f610424.md index 3708dd83e14..c8ffe91a33d 100644 --- a/curriculum/challenges/swahili/blocks/workshop-calculator/66cc0de2920bec775f610424.md +++ b/curriculum/challenges/swahili/blocks/workshop-calculator/66cc0de2920bec775f610424.md @@ -22,25 +22,33 @@ Katika hatua inayofuata, utakagua jinsi ya kufanya kazi na vigezo na hoja katika Hautaki kuwa na kitendakazi kinachoitwa `addTwoAndSeven`. ```js -assert.notMatch(code, /function\s+addTwoAndSeven\s*\(\s*\)\s*{/); +const explorer = await __helpers.Explorer(code); +const { addTwoAndSeven } = explorer.allFunctions; +assert.notExists(addTwoAndSeven); ``` Hautaki kuwa na wito wa kitendakazi kwa `addTwoAndSeven`. ```js -assert.notMatch(code, /console\.log\(\s*addTwoAndSeven\(\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const unexpectedStatement = "console.log(addTwoAndSeven())"; +assert.notInclude(strippedCode, unexpectedStatement); ``` Hautaki kuwa na kitendakazi kinachoitwa `addThreeAndFour`. ```js -assert.notMatch(code, /function\s+addThreeAndFour\s*\(\s*\)\s*{/); +const explorer = await __helpers.Explorer(code); +const { addThreeAndFour } = explorer.allFunctions; +assert.notExists(addThreeAndFour); ``` Hautaki kuwa na wito wa kitendakazi kwa `addThreeAndFour`. ```js -assert.notMatch(code, /console\.log\(\s*addThreeAndFour\(\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const unexpectedStatement = "console.log(addThreeAndFour())"; +assert.notInclude(strippedCode, unexpectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/swahili/blocks/workshop-calculator/66cc0f1ae40802781b2ea972.md b/curriculum/challenges/swahili/blocks/workshop-calculator/66cc0f1ae40802781b2ea972.md index 785f7e56417..9e324be6435 100644 --- a/curriculum/challenges/swahili/blocks/workshop-calculator/66cc0f1ae40802781b2ea972.md +++ b/curriculum/challenges/swahili/blocks/workshop-calculator/66cc0f1ae40802781b2ea972.md @@ -33,8 +33,11 @@ assert.isFunction(calculateSum); Kitendakazi chako cha `calculateSum` kinapaswa kupokea vigezo viwili, `num1` na `num2`. ```js -const regex = __helpers.functionRegex('calculateSum', ['num1', 'num2']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { calculateSum } = explorer.allFunctions; +assert.lengthOf(calculateSum?.parameters, 2); +assert.equal(calculateSum?.parameters[0].toString(), "num1"); +assert.equal(calculateSum?.parameters[1].toString(), "num2"); ``` # --seed-- diff --git a/curriculum/challenges/swahili/blocks/workshop-calculator/66cc12fa504b0479dac479a0.md b/curriculum/challenges/swahili/blocks/workshop-calculator/66cc12fa504b0479dac479a0.md index e6e103b40d9..469c6340472 100644 --- a/curriculum/challenges/swahili/blocks/workshop-calculator/66cc12fa504b0479dac479a0.md +++ b/curriculum/challenges/swahili/blocks/workshop-calculator/66cc12fa504b0479dac479a0.md @@ -29,7 +29,9 @@ Ongeza `console.log` inayoitwa kitendakazi cha `calculateSum` na hoja `2` na `5` Unapaswa kuwa na `console.log` inayoitwa kitendakazi cha `calculateSum` na hoja `2` na `5`. ```js -assert.match(code, /console\.log\(calculateSum\(\s*2\s*,\s*5\)\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const validStatements = ["console.log(calculateSum(2,5))", "console.log(calculateSum(5,2))"]; +assert.isTrue(validStatements.some(stmt => strippedCode.includes(stmt))); ``` # --seed-- diff --git a/curriculum/challenges/swahili/blocks/workshop-calculator/66cc14ca14e65e7a9ebecb80.md b/curriculum/challenges/swahili/blocks/workshop-calculator/66cc14ca14e65e7a9ebecb80.md index 71c26aba5db..2d8bcf9c6f9 100644 --- a/curriculum/challenges/swahili/blocks/workshop-calculator/66cc14ca14e65e7a9ebecb80.md +++ b/curriculum/challenges/swahili/blocks/workshop-calculator/66cc14ca14e65e7a9ebecb80.md @@ -15,7 +15,7 @@ Ndani ya kitendakazi, rudisha tofauti kati ya vigezo viwili. # --hints-- -Unapaswa kuwa na kitendakazi kinachoitwa `calculateDifference`. +Unapaswa kutangaza kitendakazi kinachoitwa `calculateDifference`. ```js assert.isFunction(calculateDifference); @@ -24,8 +24,11 @@ assert.isFunction(calculateDifference); Kitendakazi chako cha `calculateDifference` kinapaswa kuwa na vigezo viwili vinavyoitwa `num1` na `num2`. ```js -const regex = __helpers.functionRegex('calculateDifference', ['num1', 'num2']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { calculateDifference } = explorer.allFunctions; +assert.lengthOf(calculateDifference?.parameters, 2); +assert.equal(calculateDifference?.parameters[0].toString(), "num1"); +assert.equal(calculateDifference?.parameters[1].toString(), "num2"); ``` Kitendakazi chako cha `calculateDifference` kinapaswa kurudisha tofauti kati ya vigezo viwili. diff --git a/curriculum/challenges/swahili/blocks/workshop-calculator/66cc16abc30b367ba1d1f9ef.md b/curriculum/challenges/swahili/blocks/workshop-calculator/66cc16abc30b367ba1d1f9ef.md index 19a4a38c9e2..044b4ba0d8a 100644 --- a/curriculum/challenges/swahili/blocks/workshop-calculator/66cc16abc30b367ba1d1f9ef.md +++ b/curriculum/challenges/swahili/blocks/workshop-calculator/66cc16abc30b367ba1d1f9ef.md @@ -20,19 +20,25 @@ Mwishowe, ongeza `console.log` ya tatu inayofanya wito wa kitendakazi cha `calcu Unapaswa kuwa na `console.log` inayofanya wito wa kitendakazi cha `calculateDifference` kwa hoja `22` na `5`. ```js -assert.match(code, /console\.log\s*\(\s*calculateDifference\s*\(\s*22\s*,\s*5\s*\)\s*\)\s*;?/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateDifference(22,5))"; +assert.include(strippedCode, expectedStatement); ``` Unapaswa kuwa na `console.log` inayofanya wito wa kitendakazi cha `calculateDifference` kwa hoja `12` na `1`. ```js -assert.match(code, /console\.log\s*\(\s*calculateDifference\s*\(\s*12\s*,\s*1\s*\)\s*\)\s*;?/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateDifference(12,1))"; +assert.include(strippedCode, expectedStatement); ``` Unapaswa kuwa na `console.log` inayofanya wito wa kitendakazi cha `calculateDifference` kwa hoja `17` na `9`. ```js -assert.match(code, /console\.log\s*\(\s*calculateDifference\s*\(\s*17\s*,\s*9\s*\)\s*\)\s*;?/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateDifference(17,9))"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/swahili/blocks/workshop-calculator/66cc172af7159a7c67804544.md b/curriculum/challenges/swahili/blocks/workshop-calculator/66cc172af7159a7c67804544.md index dab66817497..aaa2b4ea6be 100644 --- a/curriculum/challenges/swahili/blocks/workshop-calculator/66cc172af7159a7c67804544.md +++ b/curriculum/challenges/swahili/blocks/workshop-calculator/66cc172af7159a7c67804544.md @@ -17,7 +17,7 @@ Kisha, ongeza `console.log` inayofanya wito wa kitendakazi cha `calculateProduct # --hints-- -Unapaswa kuwa na kitendakazi kinachoitwa `calculateProduct`. +Unapaswa kutangaza kitendakazi kinachoitwa `calculateProduct`. ```js assert.isFunction(calculateProduct); @@ -26,8 +26,11 @@ assert.isFunction(calculateProduct); Kitendakazi chako cha `calculateProduct` kinapaswa kuwa na vigezo viwili vinavyoitwa `num1` na `num2`. ```js -const regex = __helpers.functionRegex('calculateProduct', ['num1', 'num2']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { calculateProduct } = explorer.allFunctions; +assert.lengthOf(calculateProduct?.parameters, 2); +assert.equal(calculateProduct?.parameters[0].toString(), "num1"); +assert.equal(calculateProduct?.parameters[1].toString(), "num2"); ``` Kitendakazi chako cha `calculateProduct` kinapaswa kurudisha bidhaa ya vigezo viwili. @@ -40,7 +43,9 @@ assert.equal(calculateProduct(10, 5), 50); Unapaswa kuwa na `console.log` inayofanya wito wa kitendakazi cha `calculateProduct` kwa hoja `13` na `5`. ```js -assert.match(code, /console\.log\s*\(\s*calculateProduct\s*\(\s*13\s*,\s*5\s*\)\s*\)\s*;?/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const validStatements = ["console.log(calculateProduct(13,5))", "console.log(calculateProduct(5,13))"]; +assert.isTrue(validStatements.some(stmt => strippedCode.includes(stmt))); ``` # --seed-- diff --git a/curriculum/challenges/swahili/blocks/workshop-calculator/66cc1a3a39aef47d6473cb2f.md b/curriculum/challenges/swahili/blocks/workshop-calculator/66cc1a3a39aef47d6473cb2f.md index ef5c0cf5984..fb88eebd641 100644 --- a/curriculum/challenges/swahili/blocks/workshop-calculator/66cc1a3a39aef47d6473cb2f.md +++ b/curriculum/challenges/swahili/blocks/workshop-calculator/66cc1a3a39aef47d6473cb2f.md @@ -17,7 +17,7 @@ Kisha, ongeza `console.log` inayofanya wito wa kitendakazi `calculateQuotient` k # --hints-- -Unapaswa kuwa na kitendakazi kinachoitwa `calculateQuotient`. +Unapaswa kutangaza kitendakazi kinachoitwa `calculateQuotient`. ```js assert.isFunction(calculateQuotient); @@ -26,8 +26,11 @@ assert.isFunction(calculateQuotient); Kitendakazi chako cha `calculateQuotient` kinapaswa kuwa na vigezo viwili vinavyoitwa `num1` na `num2`. ```js -const regex = __helpers.functionRegex('calculateQuotient', ['num1', 'num2']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { calculateQuotient } = explorer.allFunctions; +assert.lengthOf(calculateQuotient?.parameters, 2); +assert.equal(calculateQuotient?.parameters[0].toString(), "num1"); +assert.equal(calculateQuotient?.parameters[1].toString(), "num2"); ``` Kitendakazi chako cha `calculateQuotient` kinapaswa kurudisha gawio la vigezo viwili. @@ -40,7 +43,9 @@ assert.equal(calculateQuotient(100, 10), 10); Unapaswa kuwa na `console.log` inayofanya wito wa kitendakazi `calculateQuotient` kwa hoja `7` na `11`. ```js -assert.match(code, /console\.log\s*\(\s*calculateQuotient\s*\(\s*7\s*,\s*11\s*\)\s*\)\s*;?/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateQuotient(7,11))"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/swahili/blocks/workshop-calculator/66cc1ccfefdd727e18c2ab20.md b/curriculum/challenges/swahili/blocks/workshop-calculator/66cc1ccfefdd727e18c2ab20.md index 1185e4e4c6a..b56d0960bc1 100644 --- a/curriculum/challenges/swahili/blocks/workshop-calculator/66cc1ccfefdd727e18c2ab20.md +++ b/curriculum/challenges/swahili/blocks/workshop-calculator/66cc1ccfefdd727e18c2ab20.md @@ -7,7 +7,7 @@ dashedName: step-14 # --description-- -`calculateQuotient` yako inaonekana inafanya kazi vizuri lakini kuna kesi moja ambayo bado hujajaribu. +`calculateQuotient` yako inaonekana inafanya kazi vizuri, lakini kuna kesi moja ambayo bado hujajaribu. Ongeza `console.log` inayofanya wito wa kitendakazi cha `calculateQuotient` kwa hoja `3` na `0`. @@ -18,7 +18,9 @@ Hakikisha unatazama kwa makini matokeo ya wito huu. Unapaswa kuwa na `console.log` inayofanya wito wa kitendakazi cha `calculateQuotient` kwa hoja `3` na `0`. ```js -assert.match(code, /console\.log\s*\(\s*calculateQuotient\s*\(\s*3\s*,\s*0\s*\)\s*\)\s*;?/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateQuotient(3,0))"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/swahili/blocks/workshop-calculator/66cc1deb1f04647f2aabee2b.md b/curriculum/challenges/swahili/blocks/workshop-calculator/66cc1deb1f04647f2aabee2b.md index 1627354520f..561f09764b2 100644 --- a/curriculum/challenges/swahili/blocks/workshop-calculator/66cc1deb1f04647f2aabee2b.md +++ b/curriculum/challenges/swahili/blocks/workshop-calculator/66cc1deb1f04647f2aabee2b.md @@ -20,8 +20,8 @@ Kama ni hivyo, kitendakazi kinapaswa kurudisha mfuatano wa herufi `"Error: Divis Kitendakazi chako cha `calculateQuotient` kinapaswa kurudisha mfuatano wa herufi `"Error: Division by zero"` ikiwa `num2` ni sifuri. ```js -assert.strictEqual(calculateQuotient(10, 0), 'Error: Division by zero'); -assert.strictEqual(calculateQuotient(3, 0), 'Error: Division by zero'); +assert.strictEqual(calculateQuotient(10, 0), "Error: Division by zero"); +assert.strictEqual(calculateQuotient(3, 0), "Error: Division by zero"); ``` Kitendakazi chako cha `calculateQuotient` kinapaswa kurudisha matokeo ya kugawanya `num1` kwa `num2` ikiwa `num2` si sifuri. diff --git a/curriculum/challenges/swahili/blocks/workshop-calculator/66cc21d23238dc8240a8a182.md b/curriculum/challenges/swahili/blocks/workshop-calculator/66cc21d23238dc8240a8a182.md index 485c634b243..3f9e0851e9d 100644 --- a/curriculum/challenges/swahili/blocks/workshop-calculator/66cc21d23238dc8240a8a182.md +++ b/curriculum/challenges/swahili/blocks/workshop-calculator/66cc21d23238dc8240a8a182.md @@ -28,7 +28,7 @@ Tangaza kitendakazi kinachoitwa `calculateSquare` kinachochukua kigezo cha `num` # --hints-- -Unapaswa kuwa na kitendakazi kinachoitwa `calculateSquare`. +Unapaswa kutangaza kitendakazi kinachoitwa `calculateSquare`. ```js assert.isFunction(calculateSquare); @@ -37,8 +37,10 @@ assert.isFunction(calculateSquare); Kitendakazi chako cha `calculateSquare` kinapaswa kuchukua kigezo cha `num`. ```js -const regex = __helpers.functionRegex('calculateSquare', ['num']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { calculateSquare } = explorer.allFunctions; +assert.lengthOf(calculateSquare?.parameters, 1); +assert.equal(calculateSquare?.parameters[0].toString(), "num"); ``` Kitendakazi chako cha `calculateSquare` kinapaswa kurudisha mraba wa `num`. diff --git a/curriculum/challenges/swahili/blocks/workshop-calculator/66cc26907ff6908402af0149.md b/curriculum/challenges/swahili/blocks/workshop-calculator/66cc26907ff6908402af0149.md index 7288413b6cc..73ccffd40cf 100644 --- a/curriculum/challenges/swahili/blocks/workshop-calculator/66cc26907ff6908402af0149.md +++ b/curriculum/challenges/swahili/blocks/workshop-calculator/66cc26907ff6908402af0149.md @@ -18,13 +18,17 @@ Kisha, ongeza `console.log` nyingine inayoitisha kitendakazi cha `calculateSquar Unapaswa kuwa na `console.log` inayoitisha kitendakazi cha `calculateSquare` kwa hoja ya `2`. ```js -assert.match(code, /console\.log\s*\(\s*calculateSquare\s*\(\s*2\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateSquare(2))"; +assert.include(strippedCode, expectedStatement); ``` Unapaswa kuwa na `console.log` inayoitisha kitendakazi cha `calculateSquare` kwa hoja ya `9`. ```js -assert.match(code, /console\.log\s*\(\s*calculateSquare\s*\(\s*9\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateSquare(9))"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/swahili/blocks/workshop-calculator/66cc2739f687e484d50bb6f1.md b/curriculum/challenges/swahili/blocks/workshop-calculator/66cc2739f687e484d50bb6f1.md index da9e93ca7f2..7a2cad6ac0e 100644 --- a/curriculum/challenges/swahili/blocks/workshop-calculator/66cc2739f687e484d50bb6f1.md +++ b/curriculum/challenges/swahili/blocks/workshop-calculator/66cc2739f687e484d50bb6f1.md @@ -26,7 +26,7 @@ Tangaza kitendakazi kinachoitwa `calculateSquareRoot` kinachopokea kigezo cha `n # --hints-- -Unapaswa kuwa na kitendakazi kinachoitwa `calculateSquareRoot`. +Unapaswa kutangaza kitendakazi kinachoitwa `calculateSquareRoot`. ```js assert.isFunction(calculateSquareRoot); @@ -35,8 +35,10 @@ assert.isFunction(calculateSquareRoot); Kitendakazi chako cha `calculateSquareRoot` kinapaswa kupokea kigezo cha `num`. ```js -const regex = __helpers.functionRegex('calculateSquareRoot', ['num']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { calculateSquareRoot } = explorer.allFunctions; +assert.lengthOf(calculateSquareRoot?.parameters, 1); +assert.equal(calculateSquareRoot?.parameters[0].toString(), "num"); ``` Kitendakazi chako cha `calculateSquareRoot` kinapaswa kurudisha mzizi wa mraba wa `num`. diff --git a/curriculum/challenges/swahili/blocks/workshop-calculator/66cc281d687975858049fd8d.md b/curriculum/challenges/swahili/blocks/workshop-calculator/66cc281d687975858049fd8d.md index 88e165408d4..a3413f0138b 100644 --- a/curriculum/challenges/swahili/blocks/workshop-calculator/66cc281d687975858049fd8d.md +++ b/curriculum/challenges/swahili/blocks/workshop-calculator/66cc281d687975858049fd8d.md @@ -20,13 +20,17 @@ Na kwa mabadiliko hayo, programu yako ya kalkuleta itakuwa imekamilika! Unapaswa kuwa na `console.log` inayofanya wito wa kitendakazi cha `calculateSquareRoot` kwa hoja ya `25`. ```js -assert.match(code, /console\.log\s*\(\s*calculateSquareRoot\s*\(\s*25\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateSquareRoot(25))"; +assert.include(strippedCode, expectedStatement); ``` Unapaswa kuwa na `console.log` inayofanya wito wa kitendakazi cha `calculateSquareRoot` kwa hoja ya `100`. ```js -assert.match(code, /console\.log\s*\(\s*calculateSquareRoot\s*\(\s*100\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateSquareRoot(100))"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/swahili/blocks/workshop-calculator/66cdf76685e4cb5a8726e27b.md b/curriculum/challenges/swahili/blocks/workshop-calculator/66cdf76685e4cb5a8726e27b.md index 5e176164e89..6ee27d28366 100644 --- a/curriculum/challenges/swahili/blocks/workshop-calculator/66cdf76685e4cb5a8726e27b.md +++ b/curriculum/challenges/swahili/blocks/workshop-calculator/66cdf76685e4cb5a8726e27b.md @@ -18,13 +18,17 @@ Chini ya wito huo wa `console.log`, ongeza wito mwingine wa `console.log` unaoit Unapaswa kuwa na wito wa `console.log` unaoitisha kitendakazi cha `calculateSum` kwa hoja `10` na `10`. ```js -assert.match(code, /console\.log\(calculateSum\(10\s*,\s*10\)\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateSum(10,10))"; +assert.include(strippedCode, expectedStatement); ``` Unapaswa kuwa na wito wa `console.log` unaoitisha kitendakazi cha `calculateSum` kwa hoja `5` na `5`. ```js -assert.match(code, /console\.log\(calculateSum\(5\s*,\s*5\)\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateSum(5,5))"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646c48df8674cf2b91020ecc.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646c48df8674cf2b91020ecc.md index 903a6f26882..b6611cad2b7 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646c48df8674cf2b91020ecc.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646c48df8674cf2b91020ecc.md @@ -35,12 +35,13 @@ assert.oneOf(href, ["./styles.css", "styles.css"]); ```html ---fcc-editable-region-- - - fCC Cat Painting - + + fCC Cat Painting --fcc-editable-region-- + +--fcc-editable-region-- + ``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646c586be7180e40ddf74ff6.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646c586be7180e40ddf74ff6.md index 66f4e461fa8..8d7e530188f 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646c586be7180e40ddf74ff6.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646c586be7180e40ddf74ff6.md @@ -1,6 +1,6 @@ --- id: 646c586be7180e40ddf74ff6 -title: Step 3 +title: Hatua 3 challengeType: 0 dashedName: step-3 --- @@ -31,9 +31,9 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('body')?.backgroundColor, - - fCC Cat Painting - + + fCC Cat Painting + diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646c59e942f35541923104bf.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646c59e942f35541923104bf.md index e4a90b81922..ec50b47c775 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646c59e942f35541923104bf.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646c59e942f35541923104bf.md @@ -1,6 +1,6 @@ --- id: 646c59e942f35541923104bf -title: Step 4 +title: Hatua 4 challengeType: 0 dashedName: step-4 --- @@ -43,13 +43,13 @@ assert.lengthOf(document.querySelectorAll('main div'), 1); - - fCC Cat Painting - + + fCC Cat Painting + --fcc-editable-region-- - + --fcc-editable-region-- diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646c5ace05e4be4211407935.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646c5ace05e4be4211407935.md index 66caf5464fe..4743dca87f3 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646c5ace05e4be4211407935.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646c5ace05e4be4211407935.md @@ -1,6 +1,6 @@ --- id: 646c5ace05e4be4211407935 -title: Step 6 +title: Hatua 6 challengeType: 0 dashedName: step-6 --- @@ -50,14 +50,14 @@ assert.equal(secondGradient,'(69,69,79)100%)'); - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
+
+
+
``` @@ -71,13 +71,13 @@ body { background-color: #c9d2fc; } ---fcc-editable-region-- .cat-head { +--fcc-editable-region-- + +--fcc-editable-region-- width: 205px; height: 180px; border: 1px solid #000; border-radius: 46%; - } ---fcc-editable-region-- ``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646c5d7057c45f432fcdd46c.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646c5d7057c45f432fcdd46c.md index 03788b42345..c4afff6003d 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646c5d7057c45f432fcdd46c.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646c5d7057c45f432fcdd46c.md @@ -1,6 +1,6 @@ --- id: 646c5d7057c45f432fcdd46c -title: Step 5 +title: Hatua 5 challengeType: 0 dashedName: step-5 --- @@ -50,13 +50,13 @@ assert.equal(new __helpers.CSSHelp(document)?.getStyle(".cat-head")?.borderRadiu - - fCC Cat Painting - + + fCC Cat Painting +
-
+
diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646c5e727e56e743c9aed4a1.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646c5e727e56e743c9aed4a1.md index 4472a166a1b..cd89647db71 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646c5e727e56e743c9aed4a1.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646c5e727e56e743c9aed4a1.md @@ -1,6 +1,6 @@ --- id: 646c5e727e56e743c9aed4a1 -title: Step 7 +title: Hatua 7 challengeType: 0 dashedName: step-7 --- @@ -44,14 +44,14 @@ assert.equal(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.left, '100p - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
+
+
+
``` @@ -65,16 +65,14 @@ body { background-color: #c9d2fc; } ---fcc-editable-region-- .cat-head { - - +--fcc-editable-region-- +--fcc-editable-region-- background: linear-gradient(#5e5e5e 85%, #45454f 100%); width: 205px; height: 180px; border: 1px solid #000; border-radius: 46%; } ---fcc-editable-region-- ``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646c5ffef5598d449b52ec12.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646c5ffef5598d449b52ec12.md index 1d19f0f8da6..7f78cc98662 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646c5ffef5598d449b52ec12.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646c5ffef5598d449b52ec12.md @@ -1,6 +1,6 @@ --- id: 646c5ffef5598d449b52ec12 -title: Step 17 +title: Hatua 17 challengeType: 0 dashedName: step-17 --- @@ -39,18 +39,18 @@ assert.equal(document.querySelectorAll('.cat-head div')[0]?.getAttribute('class' - - fCC Cat Painting - + + fCC Cat Painting + -
+
+
--fcc-editable-region-- -
- -
+ --fcc-editable-region-- -
+ +
``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646ce8bb4b35544d501c7184.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646ce8bb4b35544d501c7184.md index dd34bf5afe5..857bbd546af 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646ce8bb4b35544d501c7184.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646ce8bb4b35544d501c7184.md @@ -1,6 +1,6 @@ --- id: 646ce8bb4b35544d501c7184 -title: Step 18 +title: Hatua 18 challengeType: 0 dashedName: step-18 --- @@ -43,20 +43,20 @@ assert.isTrue(document.querySelectorAll('.cat-ears div')[1]?.classList.contains( - - fCC Cat Painting - + + fCC Cat Painting + -
-
+
+
+
--fcc-editable-region-- -
- -
+ --fcc-editable-region--
-
+
+
``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646ce9d790d2a44de5f99e04.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646ce9d790d2a44de5f99e04.md index 43b857d9ee4..f0e941393da 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646ce9d790d2a44de5f99e04.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646ce9d790d2a44de5f99e04.md @@ -1,6 +1,6 @@ --- id: 646ce9d790d2a44de5f99e04 -title: Step 19 +title: Hatua 19 challengeType: 0 dashedName: step-19 --- @@ -55,25 +55,25 @@ assert.isTrue(document.querySelectorAll('.cat-right-ear div')[0]?.classList.cont - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
- --fcc-editable-region-- -
- -
-
- -
- --fcc-editable-region-- +
+
+
+
+--fcc-editable-region-- + +
+
+ +--fcc-editable-region--
-
+
+
``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646ceb843412c74edee27a79.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646ceb843412c74edee27a79.md index 65e2b522f8c..39f7dfab9f8 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646ceb843412c74edee27a79.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646ceb843412c74edee27a79.md @@ -1,6 +1,6 @@ --- id: 646ceb843412c74edee27a79 -title: Step 20 +title: Hatua 20 challengeType: 0 dashedName: step-20 --- @@ -67,23 +67,23 @@ assert.strictEqual(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.b - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646cecc9eb5c4f4f73dafd07.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646cecc9eb5c4f4f73dafd07.md index 89cfdc9fdc9..056d8680263 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646cecc9eb5c4f4f73dafd07.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646cecc9eb5c4f4f73dafd07.md @@ -1,6 +1,6 @@ --- id: 646cecc9eb5c4f4f73dafd07 -title: Step 23 +title: Hatua 23 challengeType: 0 dashedName: step-23 --- @@ -37,23 +37,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-ear')?.left, '- - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` @@ -81,12 +81,12 @@ body { border-radius: 46%; } ---fcc-editable-region-- .cat-left-ear { +--fcc-editable-region-- +--fcc-editable-region-- border-left: 35px solid transparent; border-right: 35px solid transparent; border-bottom: 70px solid #5e5e5e; } ---fcc-editable-region-- ``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646cef0c2b98915094df7099.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646cef0c2b98915094df7099.md index abd0b16c29c..e0426fafabd 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646cef0c2b98915094df7099.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646cef0c2b98915094df7099.md @@ -1,6 +1,6 @@ --- id: 646cef0c2b98915094df7099 -title: Step 24 +title: Hatua 24 challengeType: 0 dashedName: step-24 --- @@ -31,23 +31,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-ear')?.borderTo - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646cf1206cac5f51804f49cf.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646cf1206cac5f51804f49cf.md index a0fd24151e0..46cab71214f 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646cf1206cac5f51804f49cf.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646cf1206cac5f51804f49cf.md @@ -1,6 +1,6 @@ --- id: 646cf1206cac5f51804f49cf -title: Step 25 +title: Hatua 25 challengeType: 0 dashedName: step-25 --- @@ -29,23 +29,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-ear')?.transfor - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646cf2249f02ca5233d9af7c.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646cf2249f02ca5233d9af7c.md index 9981c90c886..eb568238a05 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646cf2249f02ca5233d9af7c.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646cf2249f02ca5233d9af7c.md @@ -1,6 +1,6 @@ --- id: 646cf2249f02ca5233d9af7c -title: Step 26 +title: Hatua 26 challengeType: 0 dashedName: step-26 --- @@ -45,23 +45,23 @@ assert.strictEqual(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.b - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646cf48d8f8e1f535a1821d3.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646cf48d8f8e1f535a1821d3.md index 67b0b751b77..f3efa8d7767 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646cf48d8f8e1f535a1821d3.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646cf48d8f8e1f535a1821d3.md @@ -1,6 +1,6 @@ --- id: 646cf48d8f8e1f535a1821d3 -title: Step 27 +title: Hatua 27 challengeType: 0 dashedName: step-27 --- @@ -37,23 +37,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.left, ' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646cf6cbca98e258da65c979.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646cf6cbca98e258da65c979.md index 53269e8b90b..1090a59d262 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646cf6cbca98e258da65c979.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646cf6cbca98e258da65c979.md @@ -1,6 +1,6 @@ --- id: 646cf6cbca98e258da65c979 -title: Step 28 +title: Hatua 28 challengeType: 0 dashedName: step-28 --- @@ -25,23 +25,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.transfo - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646cf88aa884405a11ea5bcc.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646cf88aa884405a11ea5bcc.md index 75cb33515c1..a10e0714a6c 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646cf88aa884405a11ea5bcc.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646cf88aa884405a11ea5bcc.md @@ -1,6 +1,6 @@ --- id: 646cf88aa884405a11ea5bcc -title: Step 29 +title: Hatua 29 challengeType: 0 dashedName: step-29 --- @@ -31,23 +31,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.borderT - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646cfc2b8e6fe95c20a819d5.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646cfc2b8e6fe95c20a819d5.md index 883d8dd44ad..c33f012cfb4 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646cfc2b8e6fe95c20a819d5.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646cfc2b8e6fe95c20a819d5.md @@ -1,6 +1,6 @@ --- id: 646cfc2b8e6fe95c20a819d5 -title: Step 30 +title: Hatua 30 challengeType: 0 dashedName: step-30 --- @@ -29,23 +29,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-ear')?.zIndex, - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646cfd853634255d02b64cc1.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646cfd853634255d02b64cc1.md index 450ccb4d985..c5fce9fa45a 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646cfd853634255d02b64cc1.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646cfd853634255d02b64cc1.md @@ -1,6 +1,6 @@ --- id: 646cfd853634255d02b64cc1 -title: Step 31 +title: Hatua 31 challengeType: 0 dashedName: step-31 --- @@ -27,23 +27,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-ear')?.zIndex, - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646cfde6ac612e5d60391f50.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646cfde6ac612e5d60391f50.md index ce1f4ac7035..38c4257d43e 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646cfde6ac612e5d60391f50.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646cfde6ac612e5d60391f50.md @@ -1,6 +1,6 @@ --- id: 646cfde6ac612e5d60391f50 -title: Step 32 +title: Hatua 32 challengeType: 0 dashedName: step-32 --- @@ -25,23 +25,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.zIndex, - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646dd556d524bc61c0139bd6.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646dd556d524bc61c0139bd6.md index 1a5584b6dd3..54f62fbd62f 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646dd556d524bc61c0139bd6.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646dd556d524bc61c0139bd6.md @@ -1,6 +1,6 @@ --- id: 646dd556d524bc61c0139bd6 -title: Step 33 +title: Hatua 33 challengeType: 0 dashedName: step-33 --- @@ -45,23 +45,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-inner-ear')?.bo - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646dd6f9caa862627dd87772.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646dd6f9caa862627dd87772.md index 8bca2b0bd7f..4d34c4425b0 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646dd6f9caa862627dd87772.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646dd6f9caa862627dd87772.md @@ -1,6 +1,6 @@ --- id: 646dd6f9caa862627dd87772 -title: Step 34 +title: Hatua 34 challengeType: 0 dashedName: step-34 --- @@ -37,23 +37,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-inner-ear')?.le - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646dd7cfd0cfac630c1dd520.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646dd7cfd0cfac630c1dd520.md index 2bd83df6893..3bdc64b13ca 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646dd7cfd0cfac630c1dd520.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646dd7cfd0cfac630c1dd520.md @@ -1,6 +1,6 @@ --- id: 646dd7cfd0cfac630c1dd520 -title: Step 35 +title: Hatua 35 challengeType: 0 dashedName: step-35 --- @@ -43,23 +43,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-inner-ear')?.bo - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646dd8c79ec23463a3d0e356.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646dd8c79ec23463a3d0e356.md index da024e7ed7d..06ec66c45d3 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646dd8c79ec23463a3d0e356.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646dd8c79ec23463a3d0e356.md @@ -1,6 +1,6 @@ --- id: 646dd8c79ec23463a3d0e356 -title: Step 36 +title: Hatua 36 challengeType: 0 dashedName: step-36 --- @@ -43,23 +43,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-inner-ear')?.b - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646dd9d9a729916460724f16.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646dd9d9a729916460724f16.md index 5d267d1171a..a4a8631d0f5 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646dd9d9a729916460724f16.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646dd9d9a729916460724f16.md @@ -1,6 +1,6 @@ --- id: 646dd9d9a729916460724f16 -title: Step 37 +title: Hatua 37 challengeType: 0 dashedName: step-37 --- @@ -37,23 +37,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-inner-ear')?.l - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646ddab8afd73764f5241bbf.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646ddab8afd73764f5241bbf.md index a037f55bf9f..7763ac7676c 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646ddab8afd73764f5241bbf.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646ddab8afd73764f5241bbf.md @@ -1,6 +1,6 @@ --- id: 646ddab8afd73764f5241bbf -title: Step 38 +title: Hatua 38 challengeType: 0 dashedName: step-38 --- @@ -43,23 +43,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-inner-ear')?.b - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646ddb61ff08366570cc5902.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646ddb61ff08366570cc5902.md index 9b74a4a9eef..aa29350b34c 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646ddb61ff08366570cc5902.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646ddb61ff08366570cc5902.md @@ -1,6 +1,6 @@ --- id: 646ddb61ff08366570cc5902 -title: Step 39 +title: Hatua 39 challengeType: 0 dashedName: step-39 --- @@ -45,27 +45,27 @@ assert.isTrue(document.querySelectorAll('.cat-eyes div')[1].classList.contains(' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- - --fcc-editable-region-- - - --fcc-editable-region--
-
+ + --fcc-editable-region-- + + --fcc-editable-region-- +
+
``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646ddd3f9f97a0667b964bdb.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646ddd3f9f97a0667b964bdb.md index dd8a90a9c2c..36e925667b7 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646ddd3f9f97a0667b964bdb.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646ddd3f9f97a0667b964bdb.md @@ -1,6 +1,6 @@ --- id: 646ddd3f9f97a0667b964bdb -title: Step 40 +title: Hatua 40 challengeType: 0 dashedName: step-40 --- @@ -55,34 +55,34 @@ assert.isTrue(document.querySelectorAll('.cat-right-eye div')[0]?.classList.cont - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
- --fcc-editable-region-- -
- -
-
- -
- --fcc-editable-region-- -
-
+ +
+
+--fcc-editable-region-- + +
+
+ +--fcc-editable-region-- +
+
+
+
``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646dde7dc20dc167489faa69.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646dde7dc20dc167489faa69.md index bb899f9c3db..bd6c740da96 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646dde7dc20dc167489faa69.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646dde7dc20dc167489faa69.md @@ -1,6 +1,6 @@ --- id: 646dde7dc20dc167489faa69 -title: Step 41 +title: Hatua 41 challengeType: 0 dashedName: step-41 --- @@ -43,32 +43,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-eye')?.backgrou - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646ddf888632fa67f1180940.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646ddf888632fa67f1180940.md index b18bdee67d6..e11cdaec186 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646ddf888632fa67f1180940.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646ddf888632fa67f1180940.md @@ -1,6 +1,6 @@ --- id: 646ddf888632fa67f1180940 -title: Step 42 +title: Hatua 42 challengeType: 0 dashedName: step-42 --- @@ -37,32 +37,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-eye')?.left, '3 - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646de5dc8988076a1d992afd.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646de5dc8988076a1d992afd.md index a8b4c45c10e..9895a6294a0 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646de5dc8988076a1d992afd.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646de5dc8988076a1d992afd.md @@ -1,6 +1,6 @@ --- id: 646de5dc8988076a1d992afd -title: Step 43 +title: Hatua 43 challengeType: 0 dashedName: step-43 --- @@ -31,32 +31,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-eye')?.transfor - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646de6a97b50a86ac487de86.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646de6a97b50a86ac487de86.md index ab481174cb4..aba7da81f01 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646de6a97b50a86ac487de86.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646de6a97b50a86ac487de86.md @@ -1,6 +1,6 @@ --- id: 646de6a97b50a86ac487de86 -title: Step 44 +title: Hatua 44 challengeType: 0 dashedName: step-44 --- @@ -45,32 +45,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-eye')?.backgro - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646de7b64467e96b7d35b5cd.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646de7b64467e96b7d35b5cd.md index bab06a0ab92..bb39a1f5f9b 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646de7b64467e96b7d35b5cd.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646de7b64467e96b7d35b5cd.md @@ -1,6 +1,6 @@ --- id: 646de7b64467e96b7d35b5cd -title: Step 45 +title: Hatua 45 challengeType: 0 dashedName: step-45 --- @@ -37,32 +37,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-eye')?.left, ' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646de8478d6f796bfbdccfb2.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646de8478d6f796bfbdccfb2.md index e697c3496f3..78fd6369abb 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646de8478d6f796bfbdccfb2.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646de8478d6f796bfbdccfb2.md @@ -1,6 +1,6 @@ --- id: 646de8478d6f796bfbdccfb2 -title: Step 46 +title: Hatua 46 challengeType: 0 dashedName: step-46 --- @@ -31,32 +31,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-eye')?.transfo - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646de8d204a3426c7d184372.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646de8d204a3426c7d184372.md index 0c139966434..3184c50e418 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646de8d204a3426c7d184372.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646de8d204a3426c7d184372.md @@ -1,6 +1,6 @@ --- id: 646de8d204a3426c7d184372 -title: Step 47 +title: Hatua 47 challengeType: 0 dashedName: step-47 --- @@ -45,32 +45,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-inner-eye')?.ba - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646dea1c98c2426d43a705c3.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646dea1c98c2426d43a705c3.md index d4c46ee4ae5..7ef284bdb2d 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646dea1c98c2426d43a705c3.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646dea1c98c2426d43a705c3.md @@ -1,6 +1,6 @@ --- id: 646dea1c98c2426d43a705c3 -title: Step 48 +title: Hatua 48 challengeType: 0 dashedName: step-48 --- @@ -49,32 +49,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-inner-eye')?.tr - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646deb169847f86df0f95bfc.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646deb169847f86df0f95bfc.md index 7e20bb0b167..da11b8bc39c 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646deb169847f86df0f95bfc.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646deb169847f86df0f95bfc.md @@ -1,6 +1,6 @@ --- id: 646deb169847f86df0f95bfc -title: Step 49 +title: Hatua 49 challengeType: 0 dashedName: step-49 --- @@ -43,32 +43,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-inner-eye')?.b - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646dec359bef3b7811fba5a6.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646dec359bef3b7811fba5a6.md index a396be330d6..25549df5de2 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646dec359bef3b7811fba5a6.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646dec359bef3b7811fba5a6.md @@ -49,32 +49,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-inner-eye')?.t - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646dedbcba062079128b2ecc.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646dedbcba062079128b2ecc.md index 1adefac7c7e..423a5885a7f 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646dedbcba062079128b2ecc.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646dedbcba062079128b2ecc.md @@ -1,6 +1,6 @@ --- id: 646dedbcba062079128b2ecc -title: Step 51 +title: Hatua 51 challengeType: 0 dashedName: step-51 --- @@ -31,36 +31,36 @@ assert.isTrue(document.querySelectorAll('div')[11].classList.contains('cat-nose' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
- - --fcc-editable-region-- - - --fcc-editable-region--
-
+ + --fcc-editable-region-- + + --fcc-editable-region-- +
+
``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646def5e863abf7a14501421.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646def5e863abf7a14501421.md index 3e22ad14d75..ada9ed916f6 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646def5e863abf7a14501421.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646def5e863abf7a14501421.md @@ -1,6 +1,6 @@ --- id: 646def5e863abf7a14501421 -title: Step 52 +title: Hatua 52 challengeType: 0 dashedName: step-52 --- @@ -43,34 +43,34 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-nose')?.borderBottom - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
- -
-
+ +
+
+
``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646df03c8f79337ab46f148b.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646df03c8f79337ab46f148b.md index 840285306ae..7b79374a5b0 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646df03c8f79337ab46f148b.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646df03c8f79337ab46f148b.md @@ -1,6 +1,6 @@ --- id: 646df03c8f79337ab46f148b -title: Step 53 +title: Hatua 53 challengeType: 0 dashedName: step-53 --- @@ -37,34 +37,34 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-nose')?.left, '85px' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
- -
-
+ +
+
+
``` @@ -196,5 +196,4 @@ body { border-right: 15px solid transparent; border-bottom: 20px solid #442c2c; } - ``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646df0cf26413a7b35e4b8b3.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646df0cf26413a7b35e4b8b3.md index de2e66b9883..83c8920f250 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646df0cf26413a7b35e4b8b3.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646df0cf26413a7b35e4b8b3.md @@ -1,6 +1,6 @@ --- id: 646df0cf26413a7b35e4b8b3 -title: Step 54 +title: Hatua 54 challengeType: 0 dashedName: step-54 --- @@ -49,34 +49,34 @@ assert.notMatch(code, /border-top-right-radius:\s*\d+%;/); - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
- -
-
+ +
+
+
``` @@ -211,5 +211,4 @@ body { border-right: 15px solid transparent; border-bottom: 20px solid #442c2c; } - ``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646df1d1aa4ae57bdf1869c4.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646df1d1aa4ae57bdf1869c4.md index 40682204114..4bb84916b85 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646df1d1aa4ae57bdf1869c4.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646df1d1aa4ae57bdf1869c4.md @@ -1,6 +1,6 @@ --- id: 646df1d1aa4ae57bdf1869c4 -title: Step 55 +title: Hatua 55 challengeType: 0 dashedName: step-55 --- @@ -33,38 +33,38 @@ assert.isTrue(document.querySelectorAll('div')[12].classList.contains('cat-mouth - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
- --fcc-editable-region-- - - --fcc-editable-region-- +
+
+
+
+
+
+
-
+ +
+ + --fcc-editable-region-- + + --fcc-editable-region-- +
+
``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646dffd8ce9ac77ec1906f2e.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646dffd8ce9ac77ec1906f2e.md index 1f7ea14b81d..6f6c385c879 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646dffd8ce9ac77ec1906f2e.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646dffd8ce9ac77ec1906f2e.md @@ -1,6 +1,6 @@ --- id: 646dffd8ce9ac77ec1906f2e -title: Step 56 +title: Hatua 56 challengeType: 0 dashedName: step-56 --- @@ -43,41 +43,40 @@ assert.isTrue(document.querySelectorAll('.cat-mouth div')[1]?.classList.contains - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
- --fcc-editable-region-- -
- +
+
+
+
+
+
- --fcc-editable-region-- +
+ +
+
+--fcc-editable-region-- + +--fcc-editable-region--
-
+
+
``` @@ -213,5 +212,4 @@ body { border-right: 15px solid transparent; border-bottom: 20px solid #442c2c; } - ``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f0417322c0e04983a5149.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f0417322c0e04983a5149.md index 0a6064a9ad7..7107db98242 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f0417322c0e04983a5149.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f0417322c0e04983a5149.md @@ -1,6 +1,6 @@ --- id: 646f0417322c0e04983a5149 -title: Step 59 +title: Hatua 59 challengeType: 0 dashedName: step-59 --- @@ -43,40 +43,39 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-mouth-line-left')?.l - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
+
+
+
+
+ +
+
+
+
-
+
+
``` @@ -222,6 +221,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f08293804a30685533c6f.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f08293804a30685533c6f.md index 53fbf51308f..35cce41bc28 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f08293804a30685533c6f.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f08293804a30685533c6f.md @@ -1,6 +1,6 @@ --- id: 646f08293804a30685533c6f -title: Step 60 +title: Hatua 60 challengeType: 0 dashedName: step-60 --- @@ -25,40 +25,39 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-mouth-line-left')?.t - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
+
+
+
+
+ +
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f09293eb3230723a62f77.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f09293eb3230723a62f77.md index 255585bc5ad..168e17c3806 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f09293eb3230723a62f77.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f09293eb3230723a62f77.md @@ -1,6 +1,6 @@ --- id: 646f09293eb3230723a62f77 -title: Step 61 +title: Hatua 61 challengeType: 0 dashedName: step-61 --- @@ -43,40 +43,39 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-mouth-line-right')?. - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
+
+
+
+
+ +
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f0c9a1e3360092d1bbd33.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f0c9a1e3360092d1bbd33.md index 26bf8a363ca..6ef11bc0d59 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f0c9a1e3360092d1bbd33.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f0c9a1e3360092d1bbd33.md @@ -1,6 +1,6 @@ --- id: 646f0c9a1e3360092d1bbd33 -title: Step 62 +title: Hatua 62 challengeType: 0 dashedName: step-62 --- @@ -25,40 +25,39 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-mouth-line-right')?. - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
+
+
+
+
+ +
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f0ce5737243098ad6e494.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f0ce5737243098ad6e494.md index 7c622e3b58e..82c459789d8 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f0ce5737243098ad6e494.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f0ce5737243098ad6e494.md @@ -1,6 +1,6 @@ --- id: 646f0ce5737243098ad6e494 -title: Step 63 +title: Hatua 63 challengeType: 0 dashedName: step-63 --- @@ -33,44 +33,43 @@ assert.isTrue(document.querySelectorAll('div')[15].classList.contains('cat-whisk - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
+
+
+
+
+ +
- --fcc-editable-region-- - - --fcc-editable-region-- - +
+
+
-
+ + --fcc-editable-region-- + + --fcc-editable-region-- +
+
``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f0ef13604420a8744f7d4.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f0ef13604420a8744f7d4.md index e4792cf5ccb..d47554502e7 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f0ef13604420a8744f7d4.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f0ef13604420a8744f7d4.md @@ -1,6 +1,6 @@ --- id: 646f0ef13604420a8744f7d4 -title: Step 64 +title: Hatua 64 challengeType: 0 dashedName: step-64 --- @@ -43,46 +43,45 @@ assert.isTrue(document.querySelectorAll('.cat-whiskers div')[1].classList.contai - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- - --fcc-editable-region-- -
- +
+
- --fcc-editable-region-- +
+ +
+ +
+
+
+
+
+--fcc-editable-region-- + +--fcc-editable-region--
-
+
+
``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f0f7c5933560af8e7e380.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f0f7c5933560af8e7e380.md index 8a4a704d35b..3c50ba8907e 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f0f7c5933560af8e7e380.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f0f7c5933560af8e7e380.md @@ -1,6 +1,6 @@ --- id: 646f0f7c5933560af8e7e380 -title: Step 65 +title: Hatua 65 challengeType: 0 dashedName: step-65 --- @@ -50,49 +50,48 @@ assert.isTrue(document.querySelectorAll('.cat-whiskers-left div')[2].classList.c - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
- --fcc-editable-region-- -
- -
- --fcc-editable-region-- -
+
+
+
+ +
+
+
+
+
+ +
+
+--fcc-editable-region-- + +--fcc-editable-region-- +
+
-
+
+
``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f102bf87b350b593baa72.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f102bf87b350b593baa72.md index 7af642f8433..66eaf6c33fc 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f102bf87b350b593baa72.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f102bf87b350b593baa72.md @@ -1,6 +1,6 @@ --- id: 646f102bf87b350b593baa72 -title: Step 66 +title: Hatua 66 challengeType: 0 dashedName: step-66 --- @@ -49,53 +49,52 @@ assert.isTrue(document.querySelectorAll('.cat-whiskers-right div')[2].classList. - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
- --fcc-editable-region-- -
- -
- --fcc-editable-region-- +
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+--fcc-editable-region-- + +--fcc-editable-region-- +
-
+
+
``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f107abb89d00bb99f387a.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f107abb89d00bb99f387a.md index ea81644e2a4..80deb5a7233 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f107abb89d00bb99f387a.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f107abb89d00bb99f387a.md @@ -1,6 +1,6 @@ --- id: 646f107abb89d00bb99f387a -title: Step 67 +title: Hatua 67 challengeType: 0 dashedName: step-67 --- @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whiskers-left div')? - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f12da0b4c5d0ca162834a.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f12da0b4c5d0ca162834a.md index 2f7bec47fe6..8c17935d69b 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f12da0b4c5d0ca162834a.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f12da0b4c5d0ca162834a.md @@ -1,6 +1,6 @@ --- id: 646f12da0b4c5d0ca162834a -title: Step 69 +title: Hatua 69 challengeType: 0 dashedName: step-69 --- @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-left-top')?. - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -261,6 +260,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f135eab69d90d0c6d4e9b.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f135eab69d90d0c6d4e9b.md index 4b7211b86c6..5054adf3fd4 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f135eab69d90d0c6d4e9b.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f135eab69d90d0c6d4e9b.md @@ -1,6 +1,6 @@ --- id: 646f135eab69d90d0c6d4e9b -title: Step 70 +title: Hatua 70 challengeType: 0 dashedName: step-70 --- @@ -25,53 +25,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-left-top')?. - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -250,5 +249,4 @@ body { --fcc-editable-region-- } - ``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f159b2cffb21150b927cb.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f159b2cffb21150b927cb.md index 42045892d3f..f08705ab992 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f159b2cffb21150b927cb.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f159b2cffb21150b927cb.md @@ -1,6 +1,6 @@ --- id: 646f159b2cffb21150b927cb -title: Step 71 +title: Hatua 71 challengeType: 0 dashedName: step-71 --- @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-left-middle' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -268,6 +267,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f164bf100dd11d226161f.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f164bf100dd11d226161f.md index 865387ad09c..953b7645ace 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f164bf100dd11d226161f.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f164bf100dd11d226161f.md @@ -1,6 +1,6 @@ --- id: 646f164bf100dd11d226161f -title: Step 72 +title: Hatua 72 challengeType: 0 dashedName: step-72 --- @@ -25,53 +25,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-left-middle' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -254,7 +253,7 @@ body { top: 127px; left: 52px; --fcc-editable-region-- - + --fcc-editable-region-- } ``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f1764e2f1d212ba9785a7.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f1764e2f1d212ba9785a7.md index 2955ba432d8..71b683c8fdb 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f1764e2f1d212ba9785a7.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f1764e2f1d212ba9785a7.md @@ -1,6 +1,6 @@ --- id: 646f1764e2f1d212ba9785a7 -title: Step 73 +title: Hatua 73 challengeType: 0 dashedName: step-73 --- @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-left-bottom' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -275,6 +274,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f1802a09a171332e14630.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f1802a09a171332e14630.md index 77513cf23ce..1a4232e01e9 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f1802a09a171332e14630.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f1802a09a171332e14630.md @@ -1,6 +1,6 @@ --- id: 646f1802a09a171332e14630 -title: Step 74 +title: Hatua 74 challengeType: 0 dashedName: step-74 --- @@ -25,53 +25,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-left-bottom' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f4d6c42dc5f214f4e7444.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f4d6c42dc5f214f4e7444.md index 880885754c9..d4695838762 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f4d6c42dc5f214f4e7444.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f4d6c42dc5f214f4e7444.md @@ -1,6 +1,6 @@ --- id: 646f4d6c42dc5f214f4e7444 -title: Step 75 +title: Hatua 75 challengeType: 0 dashedName: step-75 --- @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-right-top')? - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -282,6 +281,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f4e46e81f7021d5fd9c1d.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f4e46e81f7021d5fd9c1d.md index 456b5980b30..437025a5a82 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f4e46e81f7021d5fd9c1d.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f4e46e81f7021d5fd9c1d.md @@ -1,6 +1,6 @@ --- id: 646f4e46e81f7021d5fd9c1d -title: Step 76 +title: Hatua 76 challengeType: 0 dashedName: step-76 --- @@ -25,53 +25,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-right-top')? - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f4f6a14e3c522d130a0d2.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f4f6a14e3c522d130a0d2.md index 9d03b6c2aac..c510fc12919 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f4f6a14e3c522d130a0d2.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f4f6a14e3c522d130a0d2.md @@ -1,6 +1,6 @@ --- id: 646f4f6a14e3c522d130a0d2 -title: Step 77 +title: Hatua 77 challengeType: 0 dashedName: step-77 --- @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-right-middle - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -289,6 +288,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f4fe12b7985232bf475a5.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f4fe12b7985232bf475a5.md index c45d6f86c9d..3435530f154 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f4fe12b7985232bf475a5.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f4fe12b7985232bf475a5.md @@ -1,6 +1,6 @@ --- id: 646f4fe12b7985232bf475a5 -title: Step 78 +title: Hatua 78 challengeType: 0 dashedName: step-78 --- @@ -25,53 +25,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-right-middle - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f507e4d1cd323f17db4fc.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f507e4d1cd323f17db4fc.md index 78912fd3bfa..8d7a37d7812 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f507e4d1cd323f17db4fc.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f507e4d1cd323f17db4fc.md @@ -1,6 +1,6 @@ --- id: 646f507e4d1cd323f17db4fc -title: Step 79 +title: Hatua 79 challengeType: 0 dashedName: step-79 --- @@ -44,53 +44,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-right-bottom - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -297,6 +296,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f516dbfc1342495515625.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f516dbfc1342495515625.md index 8dd307b4cff..a966aedfc4b 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f516dbfc1342495515625.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/646f516dbfc1342495515625.md @@ -1,6 +1,6 @@ --- id: 646f516dbfc1342495515625 -title: Step 80 +title: Hatua 80 challengeType: 0 dashedName: step-80 --- @@ -27,53 +27,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-right-bottom - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -295,53 +294,53 @@ body { - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+ +
+
``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/6476f5c17f99146071ee884c.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/6476f5c17f99146071ee884c.md index bb8cfc75f50..72a87a0fecd 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/6476f5c17f99146071ee884c.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/6476f5c17f99146071ee884c.md @@ -1,6 +1,6 @@ --- id: 6476f5c17f99146071ee884c -title: Step 8 +title: Hatua 8 challengeType: 0 dashedName: step-8 --- @@ -41,14 +41,14 @@ assert.equal(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.left, '100p - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
+
+
+
``` @@ -65,9 +65,9 @@ body { .cat-head { --fcc-editable-region-- position: static; +--fcc-editable-region-- top: 100px; left: 100px; ---fcc-editable-region-- background: linear-gradient(#5e5e5e 85%, #45454f 100%); width: 205px; height: 180px; diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/6476f7a4827bcc61682f2347.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/6476f7a4827bcc61682f2347.md index db9438b682f..e036827a2f1 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/6476f7a4827bcc61682f2347.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/6476f7a4827bcc61682f2347.md @@ -9,9 +9,7 @@ dashedName: step-9 Unapotumia thamani ya `absolute` kwa sifa yako ya `position`, kipengele kinatolewa katika mtiririko wa kawaida wa hati, kisha nafasi yake huamuliwa na sifa za `top`, `right`, `bottom`, na `left`. -Weka sifa ya `position` ya kipengele chako cha `.cat-head` kuwa `absolute`, kisha weka sifa za `top` na `left` kwa thamani yoyote chanya ya pikseli. - - +Weka sifa ya `position` ya kipengee chako cha `.cat-head` kuwa `absolute`. # --hints-- @@ -43,14 +41,14 @@ assert.match(code, /left:\s*\d{1,4}px;/); - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
+
+
+
``` @@ -67,9 +65,9 @@ body { .cat-head { --fcc-editable-region-- position: relative; +--fcc-editable-region-- top: 100px; left: 100px; ---fcc-editable-region-- background: linear-gradient(#5e5e5e 85%, #45454f 100%); width: 205px; height: 180px; diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/6476fb7cbaafa36d65e9cf35.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/6476fb7cbaafa36d65e9cf35.md index 74191c2757d..6032bb3fe4a 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/6476fb7cbaafa36d65e9cf35.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/6476fb7cbaafa36d65e9cf35.md @@ -1,6 +1,6 @@ --- id: 6476fb7cbaafa36d65e9cf35 -title: Step 10 +title: Hatua 10 challengeType: 0 dashedName: step-10 --- @@ -33,17 +33,17 @@ assert.equal(document.querySelectorAll('div')[1]?.getAttribute('class'), 'box'); - - fCC Cat Painting - + + fCC Cat Painting + -
-
- --fcc-editable-region-- - - --fcc-editable-region-- -
+
+
+ --fcc-editable-region-- + + --fcc-editable-region-- +
``` @@ -59,8 +59,8 @@ body { .cat-head { position: absolute; - top: 300px; - left: 400px; + top: 100px; + left: 100px; background: linear-gradient(#5e5e5e 85%, #45454f 100%); width: 205px; height: 180px; diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/6476fc5cf14b276e6d04e82a.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/6476fc5cf14b276e6d04e82a.md index 71e790b37e2..d9e57eeccb1 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/6476fc5cf14b276e6d04e82a.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/6476fc5cf14b276e6d04e82a.md @@ -1,6 +1,6 @@ --- id: 6476fc5cf14b276e6d04e82a -title: Step 11 +title: Hatua 11 challengeType: 0 dashedName: step-11 --- @@ -61,15 +61,15 @@ assert.equal(new __helpers.CSSHelp(document)?.getStyle('.box')?.top, '800px'); - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
+
+
+
+
``` @@ -84,7 +84,7 @@ body { } .cat-head { - position: relative; + position: absolute; top: 100px; left: 100px; background: linear-gradient(#5e5e5e 85%, #45454f 100%); diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/6476fd4213318f6ee211028a.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/6476fd4213318f6ee211028a.md index 2427820d8a2..3835315d699 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/6476fd4213318f6ee211028a.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/6476fd4213318f6ee211028a.md @@ -1,13 +1,13 @@ --- id: 6476fd4213318f6ee211028a -title: Step 12 +title: Hatua 12 challengeType: 0 dashedName: step-12 --- # --description-- -Sasa badilisha thamani ya sifa ya `position` ya `.cat-head` kwa `fixed`. Acha `top` na `left` kama zilivyo. +Sasa badilisha thamani ya sifa ya `position` ya `.cat-head` yako kuwa `fixed`. Baada ya hapo, piga skrini juu na chini kuona jinsi thamani ya `fixed` inavyofanya kazi. @@ -39,15 +39,15 @@ assert.equal(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.left, '100p - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
+
+
+
+
``` @@ -63,10 +63,10 @@ body { .cat-head { --fcc-editable-region-- - position: relative; + position: absolute; +--fcc-editable-region-- top: 100px; left: 100px; ---fcc-editable-region-- background: linear-gradient(#5e5e5e 85%, #45454f 100%); width: 205px; height: 180px; diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/64770351e8586671ec0911f0.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/64770351e8586671ec0911f0.md index be9bac42f24..0bad4ad0aeb 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/64770351e8586671ec0911f0.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/64770351e8586671ec0911f0.md @@ -41,15 +41,15 @@ assert.notMatch(code, /left:\s*100px;?/); - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
+
+
+
+
``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/6477062778c85972eb648030.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/6477062778c85972eb648030.md index 2c6c996d64f..176ff424bc8 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/6477062778c85972eb648030.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/6477062778c85972eb648030.md @@ -1,6 +1,6 @@ --- id: 6477062778c85972eb648030 -title: Step 14 +title: Hatua 14 challengeType: 0 dashedName: step-14 --- @@ -57,15 +57,15 @@ assert.equal(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.margin, 'au - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
+
+
+
+
``` @@ -82,8 +82,8 @@ body { .cat-head { --fcc-editable-region-- position: sticky; - top: 0; --fcc-editable-region-- + top: 0; background: linear-gradient(#5e5e5e 85%, #45454f 100%); width: 205px; height: 180px; @@ -92,7 +92,7 @@ body { } .box { - width: 400px; + width: 200px; height: 600px; background-color: #000; position: absolute; diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/647d821de0d97b3283c72b36.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/647d821de0d97b3283c72b36.md index 966175d37bc..cb8c798b756 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/647d821de0d97b3283c72b36.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/647d821de0d97b3283c72b36.md @@ -1,6 +1,6 @@ --- id: 647d821de0d97b3283c72b36 -title: Step 16 +title: Hatua 16 challengeType: 0 dashedName: step-16 --- @@ -14,7 +14,7 @@ Pia, ondoa kanuni ya `.box` ya CSS na tamko zake kwa sababu huna tena haja ya hi Unapaswa kuondoa kanuni ya `.box` ya CSS na thamani zake zote. ```js -assert.notMatch(code, /\.box\s*\{\s*width:\s*400px;\s*height:\s*600px;\s*background-color:\s*#000;\s*position:\s*absolute;\s*left:\s*650px;\s*top:\s*800px;?\s*\}\s*/) +assert.notMatch(code, /\.box\s*\{\s*width:\s*200px;\s*height:\s*600px;\s*background-color:\s*#000;\s*position:\s*absolute;\s*left:\s*650px;\s*top:\s*800px;?\s*\}\s*/) ``` # --seed-- @@ -25,14 +25,14 @@ assert.notMatch(code, /\.box\s*\{\s*width:\s*400px;\s*height:\s*600px;\s*backgro - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
+
+
+
``` @@ -62,7 +62,7 @@ body { --fcc-editable-region-- .box { - width: 400px; + width: 200px; height: 600px; background-color: #000; position: absolute; diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/647d855ac12cd436059acd39.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/647d855ac12cd436059acd39.md index a9ba5347df1..7f3d028120f 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/647d855ac12cd436059acd39.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/647d855ac12cd436059acd39.md @@ -1,6 +1,6 @@ --- id: 647d855ac12cd436059acd39 -title: Step 2 +title: Hatua 2 challengeType: 0 dashedName: step-2 --- @@ -33,9 +33,9 @@ assert.strictEqual(new __helpers.CSSHelp(document).getStyle('*')?.boxSizing, 'bo - - fCC Cat Painting - + + fCC Cat Painting + diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/649353647c44ef4867ab4935.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/649353647c44ef4867ab4935.md index c7629e5f92e..152e16b287d 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/649353647c44ef4867ab4935.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/649353647c44ef4867ab4935.md @@ -1,6 +1,6 @@ --- id: 649353647c44ef4867ab4935 -title: Step 15 +title: Hatua 15 challengeType: 0 dashedName: step-15 --- @@ -25,17 +25,17 @@ assert.notMatch(code, /<\/div>/) - - fCC Cat Painting - + + fCC Cat Painting + -
-
- --fcc-editable-region-- -
- --fcc-editable-region-- -
+
+
+ --fcc-editable-region-- +
+ --fcc-editable-region-- +
``` @@ -64,7 +64,7 @@ body { } .box { - width: 400px; + width: 200px; height: 600px; background-color: #000; position: absolute; diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/64a2687ef267e5934a2f93e3.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/64a2687ef267e5934a2f93e3.md index 64a01d22ea7..fb84356e678 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/64a2687ef267e5934a2f93e3.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/64a2687ef267e5934a2f93e3.md @@ -1,6 +1,6 @@ --- id: 64a2687ef267e5934a2f93e3 -title: Step 57 +title: Hatua 57 challengeType: 0 dashedName: step-57 --- @@ -43,39 +43,39 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-mouth div')?.border, - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
- -
- -
-
-
+
+
-
+ +
+ +
+
+
+
+
+
``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/64a26ac5540c5493f4641f10.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/64a26ac5540c5493f4641f10.md index 1ccf8f80ad2..13bfd09bbe8 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/64a26ac5540c5493f4641f10.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/64a26ac5540c5493f4641f10.md @@ -1,6 +1,6 @@ --- id: 64a26ac5540c5493f4641f10 -title: Step 58 +title: Hatua 58 challengeType: 0 dashedName: step-58 --- @@ -32,39 +32,39 @@ assert.match(code, /border-radius:\s*190%\/190px\s*150px\s*0\s*0\s*;?/) - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
- -
- -
-
-
+
+
-
+ +
+ +
+
+
+
+
+
``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/64a3bcbc83e574b58c8ed048.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/64a3bcbc83e574b58c8ed048.md index 4e2954cdf05..b7e82dd75bc 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/64a3bcbc83e574b58c8ed048.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/64a3bcbc83e574b58c8ed048.md @@ -1,6 +1,6 @@ --- id: 64a3bcbc83e574b58c8ed048 -title: Step 68 +title: Hatua 68 challengeType: 0 dashedName: step-68 --- @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whiskers-right div') - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/6676a8a8d9861319ee901a90.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/6676a8a8d9861319ee901a90.md index 112af6ce27d..b156d95d86c 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/6676a8a8d9861319ee901a90.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/6676a8a8d9861319ee901a90.md @@ -1,6 +1,6 @@ --- id: 6676a8a8d9861319ee901a90 -title: Step 22 +title: Hatua 22 challengeType: 0 dashedName: step-22 --- @@ -103,23 +103,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-ear')?.borderBo - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/swahili/blocks/workshop-cat-painting/6676a8b01e56ec1a1e07c202.md b/curriculum/challenges/swahili/blocks/workshop-cat-painting/6676a8b01e56ec1a1e07c202.md index 87aa282224f..a3cdd842126 100644 --- a/curriculum/challenges/swahili/blocks/workshop-cat-painting/6676a8b01e56ec1a1e07c202.md +++ b/curriculum/challenges/swahili/blocks/workshop-cat-painting/6676a8b01e56ec1a1e07c202.md @@ -73,23 +73,23 @@ assert.isEmpty(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.backg - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` @@ -117,15 +117,15 @@ body { border-radius: 46%; } ---fcc-editable-region-- .cat-right-ear { +--fcc-editable-region-- height: 100px; width: 100px; background-color: white; border-left: 35px solid blue; border-right: 35px solid blue; border-top: 35px solid red; +--fcc-editable-region-- border-bottom: 35px solid red; } ---fcc-editable-region-- ``` diff --git a/curriculum/challenges/swahili/blocks/workshop-envelope-budget-app/69b2c970cb02ddaafff1c10d.md b/curriculum/challenges/swahili/blocks/workshop-envelope-budget-app/69b2c970cb02ddaafff1c10d.md index 77334df0b18..7deed4474de 100644 --- a/curriculum/challenges/swahili/blocks/workshop-envelope-budget-app/69b2c970cb02ddaafff1c10d.md +++ b/curriculum/challenges/swahili/blocks/workshop-envelope-budget-app/69b2c970cb02ddaafff1c10d.md @@ -62,7 +62,7 @@ assert.notMatch(code, /<\/input>/); Kipengele cha `input` kinapaswa kuwa na lebo ya kufunga ya `>`. ```js -assert.match(code, /HTMLString\s*=\s*`\n\s*Expense\s\$\{entryNumber\}\sName<\/label>\n\s*]*\/>/); +assert.match(code, /HTMLString\s*=\s*`\n\s*Expense\s\$\{entryNumber\}\sName<\/label>\n\s*]*>/); ``` # --seed-- diff --git a/curriculum/challenges/swahili/blocks/workshop-fcc-authors-page/69e14a2fd8ecf9210c0739ee.md b/curriculum/challenges/swahili/blocks/workshop-fcc-authors-page/69e14a2fd8ecf9210c0739ee.md index dac30cba654..f2942d312f4 100644 --- a/curriculum/challenges/swahili/blocks/workshop-fcc-authors-page/69e14a2fd8ecf9210c0739ee.md +++ b/curriculum/challenges/swahili/blocks/workshop-fcc-authors-page/69e14a2fd8ecf9210c0739ee.md @@ -11,6 +11,12 @@ Unapofanya wito wa kitendakazi isiyo ya wakati mmoja, unaweza kusubiri kurudi kw Ongeza wito wa kitendakazi `initialFetch` katika nafasi iliyotajwa katika mhariri. +# --before-all-- + +```js +window.fetch = () => Promise.resolve({json: () => Promise.resolve([{ author: 'Whoever', image: 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==', url: "http://not-a-real-url.nowhere/", bio: 'words go here' }])}); +``` + # --hints-- Unapaswa kuita `initialFetch` bila hoja yoyote. diff --git a/curriculum/challenges/swahili/blocks/workshop-fortune-teller-app/68ded620ab19272a3fa97592.md b/curriculum/challenges/swahili/blocks/workshop-fortune-teller-app/68ded620ab19272a3fa97592.md index b36cc5e31df..7a5fecafb56 100644 --- a/curriculum/challenges/swahili/blocks/workshop-fortune-teller-app/68ded620ab19272a3fa97592.md +++ b/curriculum/challenges/swahili/blocks/workshop-fortune-teller-app/68ded620ab19272a3fa97592.md @@ -73,10 +73,9 @@ assert.isTrue(renderCard.hasReturnAnnotation("string")); Kitendakazi chako cha `renderCard` kinapaswa kurudisha template literal. ```js -assert.match( - __helpers.removeJSComments(code), - /renderCard\s*=\s*\([^)]*\)\s*:\s*string\s*=>\s*(?:\{\s*return\s*)?`/ -); +const explorer = await __helpers.Explorer(code); +const { renderCard } = explorer.allFunctions; +assert.match(__helpers.removeJSComments(renderCard.toString()), /(?:return|=>)\s*`/); ``` # --seed-- diff --git a/curriculum/challenges/swahili/blocks/workshop-fortune-teller-app/68ed4621677e86eeefa59fe6.md b/curriculum/challenges/swahili/blocks/workshop-fortune-teller-app/68ed4621677e86eeefa59fe6.md index 516a7757072..e1b15b8f982 100644 --- a/curriculum/challenges/swahili/blocks/workshop-fortune-teller-app/68ed4621677e86eeefa59fe6.md +++ b/curriculum/challenges/swahili/blocks/workshop-fortune-teller-app/68ed4621677e86eeefa59fe6.md @@ -15,8 +15,8 @@ Njia yako ya `initializeEventListeners` inapaswa kuwa na aina ya kurudisha `void ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.initializeEventListeners.toString(); -assert.match(method, /initializeEventListeners\s*\(\s*\)\s*:\s*void/); +const { initializeEventListeners } = explorer.classes.Game?.methods ?? {}; +assert.isTrue(initializeEventListeners?.hasReturnAnnotation("void")); ``` # --seed-- diff --git a/curriculum/challenges/swahili/blocks/workshop-fortune-teller-app/68ee6c4b4c764b62d77df717.md b/curriculum/challenges/swahili/blocks/workshop-fortune-teller-app/68ee6c4b4c764b62d77df717.md index b5cda1ea53a..7acb7470bfe 100644 --- a/curriculum/challenges/swahili/blocks/workshop-fortune-teller-app/68ee6c4b4c764b62d77df717.md +++ b/curriculum/challenges/swahili/blocks/workshop-fortune-teller-app/68ee6c4b4c764b62d77df717.md @@ -17,16 +17,30 @@ Unapaswa kutangaza kinachoitwa `isReversed`. ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.singleCardSelected.toString(); -assert.match(method, /const\s+isReversed\s*=/); +const { singleCardSelected } = explorer.classes.Game?.methods ?? {}; +const { isReversed } = singleCardSelected?.variables ?? {}; +assert.exists(isReversed); ``` Kipengele chako cha `isReversed` kinapaswa kutumia `Math.random()` kuamua kwa nasibu kama kadi imegeuzwa. ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.singleCardSelected.toString(); -assert.match(method, /isReversed\s*=\s*Math\.random\s*\(\s*\)\s*<\s*0\.5/); +const { singleCardSelected } = explorer.classes.Game?.methods ?? {}; +const { isReversed } = singleCardSelected?.variables ?? {}; + +const validForms = [ + 'Math.random() < 0.5', + 'Math.random() > 0.5', + 'Math.random() <= 0.5', + 'Math.random() >= 0.5', + '0.5 < Math.random()', + '0.5 > Math.random()', + '0.5 <= Math.random()', + '0.5 >= Math.random()' +]; + +assert.isTrue(validForms.some((form) => isReversed?.value.matches(form))); ``` # --seed-- diff --git a/curriculum/challenges/swahili/blocks/workshop-fortune-teller-app/68ee6c8c274515694ead0024.md b/curriculum/challenges/swahili/blocks/workshop-fortune-teller-app/68ee6c8c274515694ead0024.md index 41f4219f114..16932ad782b 100644 --- a/curriculum/challenges/swahili/blocks/workshop-fortune-teller-app/68ee6c8c274515694ead0024.md +++ b/curriculum/challenges/swahili/blocks/workshop-fortune-teller-app/68ee6c8c274515694ead0024.md @@ -7,7 +7,7 @@ dashedName: step-32 # --description-- -Bahati lazima iwe ya bahati nasibu, kwa hivyo kitendakazi msaidizi kinahitajika kuchagua bahati nasibu. Tangaza kigezo kinachoitwa `chosenCard` ndani ya njia ya `singleCardSelected`. Tumia njia ya `getRandomItem` kupata kadi ya bahati nasibu na pita `cards` kama hoja. +Bahati lazima iwe ya bahati nasibu, kwa hivyo kitendakazi cha msaada kinahitajika kuchagua bahati ya bahati nasibu. Tangaza kigezo kinachoitwa `chosenCard` ndani ya njia ya `singleCardSelected`. Tumia kitendakazi cha `getRandomItem` kupata kadi ya bahati nasibu na pita `this.cards` kama hoja. # --hints-- @@ -15,22 +15,18 @@ Unapaswa kutangaza kigezo kinachoitwa `chosenCard` ndani ya `singleCardSelected` ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.singleCardSelected.toString(); -assert.match(method, /const\s+chosenCard\s*=/); +const { singleCardSelected } = explorer.classes.Game?.methods ?? {}; +const { chosenCard } = singleCardSelected?.variables ?? {}; +assert.exists(chosenCard); ``` Kigezo chako cha `chosenCard` kinapaswa kupewa thamani kwa kuita `getRandomItem(this.cards)`. ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.singleCardSelected.toString(); -assert.match(method, /chosenCard\s*=\s*getRandomItem\s*\(\s*this\.cards\s*\)/); -``` - -Unapaswa kupitisha `this.cards` kama hoja kwa `getRandomItem`. - -```js -assert.match(__helpers.removeJSComments(code), /getRandomItem\s*\(\s*this\.cards\s*\)/); +const { singleCardSelected } = explorer.classes.Game?.methods ?? {}; +const { chosenCard } = singleCardSelected?.variables ?? {}; +assert.isTrue(chosenCard?.value.matches("getRandomItem(this.cards)")); ``` # --seed-- diff --git a/curriculum/challenges/swahili/blocks/workshop-fortune-teller-app/68f1e43a5f890b51774d93c4.md b/curriculum/challenges/swahili/blocks/workshop-fortune-teller-app/68f1e43a5f890b51774d93c4.md index 0174012614a..b3f6bc267c2 100644 --- a/curriculum/challenges/swahili/blocks/workshop-fortune-teller-app/68f1e43a5f890b51774d93c4.md +++ b/curriculum/challenges/swahili/blocks/workshop-fortune-teller-app/68f1e43a5f890b51774d93c4.md @@ -15,22 +15,28 @@ Unapaswa kutangaza kigezo kinachoitwa `target` ndani ya `showFortune`. ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /const\s+target\s*=/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { target } = showFortune?.variables ?? {}; +assert.exists(target); ``` Kigezo chako cha `target` kinapaswa kupewa thamani ya `e.target`. ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /target\s*=\s*e\.target/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { target } = showFortune?.variables ?? {}; +assert.isTrue(target?.value.matches("e.target")); ``` Unapaswa kuwa na taarifa tupu ya `if` mara baada ya kigezo chako cha `target`. ```js -assert.match(__helpers.removeJSComments(code), /showFortune\s*\([^)]*\)\s*\{[\s\S]*?if\s*\(\s*\)\s*\{\s*\}/); +const explorer = await __helpers.Explorer(code); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +assert.exists(showFortune); +const method = __helpers.removeJSComments(showFortune.toString()); +assert.match(method, /target\s*=\s*e\.target[\s\S]*?if\s*\(\s*\)\s*\{\s*\}/); ``` # --seed-- diff --git a/curriculum/challenges/swahili/blocks/workshop-fortune-teller-app/68f1e6a98bc05e67cc2b85e6.md b/curriculum/challenges/swahili/blocks/workshop-fortune-teller-app/68f1e6a98bc05e67cc2b85e6.md index 336fa5d1276..27fbe389c69 100644 --- a/curriculum/challenges/swahili/blocks/workshop-fortune-teller-app/68f1e6a98bc05e67cc2b85e6.md +++ b/curriculum/challenges/swahili/blocks/workshop-fortune-teller-app/68f1e6a98bc05e67cc2b85e6.md @@ -15,22 +15,18 @@ Unapaswa kutangaza kigezo kinachoitwa `cardElement` ndani ya `showFortune`. ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /const\s+cardElement\s*=/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { cardElement } = showFortune?.variables ?? {}; +assert.exists(cardElement); ``` Kigezo chako cha `cardElement` kinapaswa kutumia `target?.closest` kupata `.card_container`. ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /cardElement\s*=\s*target\?\.closest\s*\(\s*['"]\.card_container['"]\s*\)/); -``` - -Unapaswa kupitisha `.card_container` kama hoja kwa `closest`. - -```js -assert.match(__helpers.removeJSComments(code), /\.closest\s*\(\s*['"]\.card_container['"]\s*\)/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { cardElement } = showFortune?.variables ?? {}; +assert.isTrue(cardElement?.value.matches("target?.closest('.card_container')")); ``` # --seed-- diff --git a/curriculum/challenges/swahili/blocks/workshop-fortune-teller-app/68f1e852f705eb77f6bcb893.md b/curriculum/challenges/swahili/blocks/workshop-fortune-teller-app/68f1e852f705eb77f6bcb893.md index d213aa4d13d..f78e4a71891 100644 --- a/curriculum/challenges/swahili/blocks/workshop-fortune-teller-app/68f1e852f705eb77f6bcb893.md +++ b/curriculum/challenges/swahili/blocks/workshop-fortune-teller-app/68f1e852f705eb77f6bcb893.md @@ -15,28 +15,18 @@ Unapaswa kutangaza kigezo kinachoitwa `cardId` ndani ya `showFortune`. ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /const\s+cardId\s*=/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { cardId } = showFortune?.variables ?? {}; +assert.exists(cardId); ``` Kigezo chako cha `cardId` kinapaswa kupewa thamani kwa kufanya wito wa `cardElement.getAttribute("data-id")`. ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /cardId\s*=\s*cardElement\.getAttribute\s*\(\s*['"]data-id['"]\s*\)/); -``` - -Unapaswa kutumia njia `getAttribute` kwenye `cardElement`. - -```js -assert.match(__helpers.removeJSComments(code), /cardElement\.getAttribute\s*\(/); -``` - -Unapaswa kupitisha `'data-id'` kwa `getAttribute`. - -```js -assert.match(__helpers.removeJSComments(code), /\.getAttribute\s*\(\s*['"]data-id['"]\s*\)/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { cardId } = showFortune?.variables ?? {}; +assert.isTrue(cardId?.value.matches('cardElement.getAttribute("data-id")')); ``` # --seed-- diff --git a/curriculum/challenges/swahili/blocks/workshop-fortune-teller-app/68f1e8de2731b07d62e738d2.md b/curriculum/challenges/swahili/blocks/workshop-fortune-teller-app/68f1e8de2731b07d62e738d2.md index e3afabe7b94..2b13beab9a9 100644 --- a/curriculum/challenges/swahili/blocks/workshop-fortune-teller-app/68f1e8de2731b07d62e738d2.md +++ b/curriculum/challenges/swahili/blocks/workshop-fortune-teller-app/68f1e8de2731b07d62e738d2.md @@ -15,28 +15,38 @@ Unapaswa kutangaza kigezo kinachoitwa `foundCard` ndani ya `showFortune`. ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /const\s+foundCard\s*=/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { foundCard } = showFortune?.variables ?? {}; +assert.exists(foundCard); ``` -Kigezo chako cha `foundCard` kinapaswa kupewa thamani kwa kuita `find` kwenye `this.cards` na wito wa kurudisha sahihi. +`foundCard` yako inapaswa kupewa thamani kwa kuita `find` kwenye `this.cards`, ukipitisha wito wa kurudisha unaochukua kigezo cha `card` na kurudisha matokeo ya kulinganisha `card.name_short` na `cardId` kwa kutumia usawa mkali. ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /foundCard\s*=\s*this\.cards\.find\s*\(/); -``` - -Wito wa kurudisha wa `find` unapaswa kuwa na kigezo kinachoitwa `card`. - -```js -assert.match(__helpers.removeJSComments(code), /cards\.find\s*\(\s*\(\s*card\s*\)\s*=>/); -``` - -Ndani ya wito wa kurudisha, `card.name_short` inapaswa kulinganishwa na `cardId`. - -```js -assert.match(__helpers.removeJSComments(code), /card\.name_short\s*===?\s*cardId/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { foundCard } = showFortune?.variables ?? {}; + +const validForms = [ + 'this.cards.find((card) => card.name_short === cardId)', + 'this.cards.find((card) => { return card.name_short === cardId; })', + 'this.cards.find((card) => cardId === card.name_short)', + 'this.cards.find((card) => { return cardId === card.name_short; })', + 'this.cards.find(card => card.name_short === cardId)', + 'this.cards.find(card => { return card.name_short === cardId; })', + 'this.cards.find(card => cardId === card.name_short)', + 'this.cards.find(card => { return cardId === card.name_short; })', + 'this.cards.find((card: Card) => card.name_short === cardId)', + 'this.cards.find((card: Card) => { return card.name_short === cardId; })', + 'this.cards.find((card: Card) => cardId === card.name_short)', + 'this.cards.find((card: Card) => { return cardId === card.name_short; })', + 'this.cards.find(function (card) { return card.name_short === cardId; })', + 'this.cards.find(function (card) { return cardId === card.name_short; })', + 'this.cards.find(function (card: Card) { return card.name_short === cardId; })', + 'this.cards.find(function (card: Card) { return cardId === card.name_short; })' +]; + +assert.isTrue(validForms.some((form) => foundCard?.value.matches(form))); ``` # --seed-- diff --git a/curriculum/challenges/swahili/blocks/workshop-greeting-bot/66ad8ab945d266383f318cbf.md b/curriculum/challenges/swahili/blocks/workshop-greeting-bot/66ad8ab945d266383f318cbf.md index ba999bbe5af..e2ae689ec58 100644 --- a/curriculum/challenges/swahili/blocks/workshop-greeting-bot/66ad8ab945d266383f318cbf.md +++ b/curriculum/challenges/swahili/blocks/workshop-greeting-bot/66ad8ab945d266383f318cbf.md @@ -30,7 +30,11 @@ assert.lengthOf(logSpy.calls, 2); Tamko lako la `console` linapaswa kuwa na ujumbe `"I am excited to talk to you."`. Usisahau alama za nukuu. ```js -assert.deepInclude(logSpy.calls, ["I am excited to talk to you."]); +assert.isTrue( + logSpy.calls.some( + (call) => /I\s+am\s+excited\s+to\s+talk\s+to\s+you\s*\./.test(call[0]) + ) +); ``` # --seed-- diff --git a/curriculum/challenges/swahili/blocks/workshop-greeting-bot/66ad9c633fa26d3c1475eae3.md b/curriculum/challenges/swahili/blocks/workshop-greeting-bot/66ad9c633fa26d3c1475eae3.md index 1b7e8e58c76..14878d7a88e 100644 --- a/curriculum/challenges/swahili/blocks/workshop-greeting-bot/66ad9c633fa26d3c1475eae3.md +++ b/curriculum/challenges/swahili/blocks/workshop-greeting-bot/66ad9c633fa26d3c1475eae3.md @@ -28,7 +28,11 @@ assert.lengthOf(logSpy.calls, 3); Tamko lako la `console` linapaswa kuwa na ujumbe `"Allow me to introduce myself."`. Usisahau alama za nukuu. ```js -assert.deepInclude(logSpy.calls, ["Allow me to introduce myself."]); +assert.isTrue( + logSpy.calls.some( + (call) => /Allow\s+me\s+to\s+introduce\s+myself\s*\./.test(call[0]) + ) +); ``` # --seed-- diff --git a/curriculum/challenges/swahili/blocks/workshop-greeting-bot/66add47d27763c4862492c8c.md b/curriculum/challenges/swahili/blocks/workshop-greeting-bot/66add47d27763c4862492c8c.md index a23d82b702b..93f3647df52 100644 --- a/curriculum/challenges/swahili/blocks/workshop-greeting-bot/66add47d27763c4862492c8c.md +++ b/curriculum/challenges/swahili/blocks/workshop-greeting-bot/66add47d27763c4862492c8c.md @@ -76,12 +76,10 @@ console.log(favoriteSubjectSentence); ```js console.log("Hi there!"); console.log("I am excited to talk to you."); - let bot; -let botLocation; - bot = "teacherBot"; -botLocation = "the universe"; + +let botLocation = "the universe"; console.log("Allow me to introduce myself."); diff --git a/curriculum/challenges/swahili/blocks/workshop-hotel-feedback-form/66a93bbe65a26169dbf3bc39.md b/curriculum/challenges/swahili/blocks/workshop-hotel-feedback-form/66a93bbe65a26169dbf3bc39.md index 46e95c61a62..f1f8d767389 100644 --- a/curriculum/challenges/swahili/blocks/workshop-hotel-feedback-form/66a93bbe65a26169dbf3bc39.md +++ b/curriculum/challenges/swahili/blocks/workshop-hotel-feedback-form/66a93bbe65a26169dbf3bc39.md @@ -13,7 +13,7 @@ Anza kwa kuongeza kipengele kipya cha `label` chenye maandishi ya `Email address # --hints-- -Unapaswa kuwa na kipengele cha `label`. +Unapaswa kuwa na kipengele cha pili cha `label` ndani ya `fieldset` yako. ```js assert.lengthOf(document.querySelectorAll('fieldset label'), 2); diff --git a/curriculum/challenges/swahili/blocks/workshop-hotel-feedback-form/66a9401c9d660d6bb15993e2.md b/curriculum/challenges/swahili/blocks/workshop-hotel-feedback-form/66a9401c9d660d6bb15993e2.md index 1e5d35bc904..3352a729d6a 100644 --- a/curriculum/challenges/swahili/blocks/workshop-hotel-feedback-form/66a9401c9d660d6bb15993e2.md +++ b/curriculum/challenges/swahili/blocks/workshop-hotel-feedback-form/66a9401c9d660d6bb15993e2.md @@ -15,7 +15,7 @@ Sifa ya kipengele ya `for` inapaswa kuwekwa kuwa `"age"`. # --hints-- -Unapaswa kuwa na kipengele cha `label`. +Unapaswa kuwa na kipengele cha tatu cha `label` ndani ya `fieldset` yako. ```js assert.lengthOf(document.querySelectorAll('fieldset label'), 3); diff --git a/curriculum/challenges/swahili/blocks/workshop-hotel-feedback-form/66a9419e2d18476c645ce693.md b/curriculum/challenges/swahili/blocks/workshop-hotel-feedback-form/66a9419e2d18476c645ce693.md index b0ceaf76b8c..8038aa4c59b 100644 --- a/curriculum/challenges/swahili/blocks/workshop-hotel-feedback-form/66a9419e2d18476c645ce693.md +++ b/curriculum/challenges/swahili/blocks/workshop-hotel-feedback-form/66a9419e2d18476c645ce693.md @@ -17,9 +17,9 @@ Hapa kuna mfano wa sehemu ya ingizo la nambari: Sifa za kipengele `min` na `max` hutumika kuweka kiwango cha chini na kiwango cha juu ambacho kinaweza kuingizwa katika sehemu ya ingizo. -Chini ya kipengele chako cha `label`, ongeza ingizo lenye sifa ya kipengele `type` iliyowekwa kuwa `"number"` na `id` ya `"age"`. +Chini ya kipengele chako cha `label`, ongeza `input` yenye sifa ya kipengele `type` iliyowekwa kuwa `"number"` na `id` ya `"age"`. -Sifa ya kipengele `name` inapaswa kuwekwa kuwa `"age"`, sifa ya kipengele `min` inapaswa kuwekwa kuwa `"3"` na sifa ya kipengele `max` inapaswa kuwekwa kuwa `"100"`. +Sifa ya kipengele `name` inapaswa kuwekwa kuwa `"age"`, sifa ya kipengele `min` iwe `"3"`, na sifa ya kipengele `max` iwe `"100"`. # --hints-- @@ -29,13 +29,13 @@ Unapaswa kuwa na sehemu ya ingizo la nambari `input` chini ya kipengele chako ch assert.isNotNull(document.querySelector('label + input[type="number"]')); ``` -Sehemu yako ya ingizo la nambari `input` inapaswa kuwa na `id` ya `age`. +Ingizo lako la nambari `input` linapaswa kuwa na `id` ya `"age"`. ```js assert.isNotNull(document.querySelector('label + input#age')); ``` -Sehemu yako ya ingizo la nambari `input` inapaswa kuwa na sifa ya kipengele `name` iliyowekwa kuwa `age`. +Ingizo lako la nambari `input` linapaswa kuwa na sifa ya kipengele `name` iliyowekwa kuwa `"age"`. ```js assert.isNotNull(document.querySelector('label + input[name="age"]')); diff --git a/curriculum/challenges/swahili/blocks/workshop-hotel-feedback-form/67a51d3a8a6fe123b77b0c6e.md b/curriculum/challenges/swahili/blocks/workshop-hotel-feedback-form/67a51d3a8a6fe123b77b0c6e.md index c319ec18df1..7ba9edc8e6a 100644 --- a/curriculum/challenges/swahili/blocks/workshop-hotel-feedback-form/67a51d3a8a6fe123b77b0c6e.md +++ b/curriculum/challenges/swahili/blocks/workshop-hotel-feedback-form/67a51d3a8a6fe123b77b0c6e.md @@ -7,11 +7,11 @@ dashedName: step-12 # --description-- -Vipengele vya `input` vinaweza kuwa na sifa ya kipengele ya `size`. Sifa hii ya kipengele inaelezea idadi ya herufi zinazopaswa kuonekana wakati mtumizi anapoandika katika ingizo. Thamani ya `size` inapaswa kuwa nambari kamili chanya isiyokuwa sifuri. Ikiwa `size` haijatolewa, au imetolewa na thamani isiyo halali, ingizo litakuwa na upana wa kawaida uliowekwa na kivinjari. +Vipengele vya `input` vinaweza kuwa na sifa ya kipengele ya `size`. Sifa hii ya kipengele inaeleza idadi ya herufi zinazopaswa kuonekana wakati mtumizi anapoandika kwenye `input`. Thamani ya `size` inapaswa kuwa nambari kamili chanya. Ikiwa `size` haijatajwa, au imetajwa na thamani isiyo halali, `input` itakuwa na upana wa kawaida uliowekwa na kivinjari. ```html - - + + ``` Toa sifa ya kipengele ya `size` kwa ingizo la jina na barua pepe na thamani ya `"20"`. diff --git a/curriculum/challenges/swahili/blocks/workshop-plant-nursery-catalog/6734a772196245601e4b80e0.md b/curriculum/challenges/swahili/blocks/workshop-plant-nursery-catalog/6734a772196245601e4b80e0.md index 16065bd5283..136fb198f28 100644 --- a/curriculum/challenges/swahili/blocks/workshop-plant-nursery-catalog/6734a772196245601e4b80e0.md +++ b/curriculum/challenges/swahili/blocks/workshop-plant-nursery-catalog/6734a772196245601e4b80e0.md @@ -9,7 +9,7 @@ dashedName: step-10 Unapohitaji kupata kipengele kutoka kwenye ramani, unaweza kutumia njia ya `get`. Inachukua ufunguo kama hoja yake, na inarudisha thamani inayohusiana. -Tumia njia ya `get` kupata thamani ya ufunguo wa `ballerina` kutoka kwenye katalogi yako na weka thamani hiyo kwenye kigezo kinachoitwa `getBallerina`. Kisha, andika kigezo chako kipya kwenye konsoli. +Tumia njia ya `get` kupata thamani ya ufunguo wa `ballerina` kutoka kwenye katalogi yako, na weka thamani hiyo kwenye kigezo kinachoitwa `getBallerina`. Kisha, andika kigezo chako kipya kwenye konsoli. # --hints-- @@ -22,7 +22,10 @@ assert.exists(getBallerina); Kigezo chako cha `getBallerina` kinapaswa kuwa na thamani ya `catalog.get(ballerina)`. ```js -assert.match(__helpers.removeJSComments(code), /(const|let|var)\s+getBallerina\s*=\s*catalog\s*\.\s*get\s*\(\s*ballerina\s*\)/); +const explorer = await __helpers.Explorer(code); +const { getBallerina } = explorer.variables; +assert.isTrue(getBallerina?.value.matches('catalog.get(ballerina)') +); ``` Unapaswa kuandika kigezo chako cha `getBallerina` kwenye konsoli. diff --git a/curriculum/challenges/swahili/blocks/workshop-plant-nursery-catalog/6737a1a073a0d14c6544d301.md b/curriculum/challenges/swahili/blocks/workshop-plant-nursery-catalog/6737a1a073a0d14c6544d301.md index ff7004c1cde..3bd2629cbba 100644 --- a/curriculum/challenges/swahili/blocks/workshop-plant-nursery-catalog/6737a1a073a0d14c6544d301.md +++ b/curriculum/challenges/swahili/blocks/workshop-plant-nursery-catalog/6737a1a073a0d14c6544d301.md @@ -23,7 +23,9 @@ assert.exists(plantsSet); Unapaswa kuita `displayPlantsSet` na kuwekea thamani `plantsSet`. ```js -assert.match(__helpers.removeJSComments(code), /(const|let|var)\s+plantsSet\s*=\s*displayPlantsSet\s*\(\s*\)/) +const explorer = await __helpers.Explorer(code); +const { plantsSet } = explorer.variables; +assert.isTrue(plantsSet?.value.matches('displayPlantsSet()')); ``` Unapaswa kuandika `plantsSet` kwenye konsoli. diff --git a/curriculum/challenges/swahili/blocks/workshop-reusable-mega-navbar/6740495ba48aa94e5667b436.md b/curriculum/challenges/swahili/blocks/workshop-reusable-mega-navbar/6740495ba48aa94e5667b436.md index 8e55c0bc2fd..ff853749d7b 100644 --- a/curriculum/challenges/swahili/blocks/workshop-reusable-mega-navbar/6740495ba48aa94e5667b436.md +++ b/curriculum/challenges/swahili/blocks/workshop-reusable-mega-navbar/6740495ba48aa94e5667b436.md @@ -10,7 +10,7 @@ demoType: onLoad Katika warsha hii, utazoea kufanya kazi na sehemu za kitendakazi za React kwa kujenga navbar inayoweza kutumika tena. -CSS zote zimekwisha tolewa ili uweze kuwa makini na kuunda navbar. +CSS yote imetolewa kwako ili uweze kuwa makini na kuunda navbar. Anza kwa kufafanua sehemu ya kitendakazi ya `Navbar`. Katika hatua inayofuata, utaanza kujenga sehemu hiyo kwa kutumia JSX. @@ -24,7 +24,7 @@ export function multiply(a, b) { } ``` -Pia, sehemu za kitendakazi za React zinapaswa kuanza na herufi kubwa kwa sababu hii ni njia ya kutofautisha na vipengele vya kawaida vya HTML. +Pia, sehemu za kitendakazi za React zinahitaji kuanza na herufi kubwa kwa sababu React hutofautisha hizo na vipengele vya kawaida vya HTML kwa njia hiyo. # --hints-- diff --git a/curriculum/challenges/swahili/blocks/workshop-reusable-mega-navbar/67457ff2dc531fbed928a0f0.md b/curriculum/challenges/swahili/blocks/workshop-reusable-mega-navbar/67457ff2dc531fbed928a0f0.md index 480cbbb6c5d..963922e6ff0 100644 --- a/curriculum/challenges/swahili/blocks/workshop-reusable-mega-navbar/67457ff2dc531fbed928a0f0.md +++ b/curriculum/challenges/swahili/blocks/workshop-reusable-mega-navbar/67457ff2dc531fbed928a0f0.md @@ -24,10 +24,9 @@ const App = () => { } ``` - Ndani ya sehemu ya `Navbar`, rudisha kipengele cha `nav` chenye sifa ya kipengele `className` yenye thamani `navbar`. -Sababu ya kutumia `className` hapa badala ya `class` ni kwamba `class` ni neno la kuhifadhiwa katika JavaScript. Kwa hivyo, React hutumia `className` kama njia ya kutumia madarasa ya vitu. +`className` inatumiwa hapa badala ya `class` kwa sababu `class` ni neno la kuhifadhiwa katika JavaScript. Hivyo, React inatumia `className` kama njia ya kutumia madarasa kwa vipengele. # --hints-- @@ -37,7 +36,7 @@ Unapaswa kurudisha kipengele cha `nav`. assert.exists(document.querySelector('nav')); ``` -Kipengele chako cha `nav` kinapaswa kuwa na sifa ya kipengele `className` yenye thamani `navbar`. +Kipengele chako cha `nav` kinapaswa kuwa na `className` ya `navbar`. ```js assert.equal(document.querySelector('nav')?.getAttribute('class'), 'navbar'); diff --git a/curriculum/challenges/swahili/blocks/workshop-reusable-mega-navbar/6745c732dbeb7c04f346e6f7.md b/curriculum/challenges/swahili/blocks/workshop-reusable-mega-navbar/6745c732dbeb7c04f346e6f7.md index ce8d55a5c4d..d1b6f77e747 100644 --- a/curriculum/challenges/swahili/blocks/workshop-reusable-mega-navbar/6745c732dbeb7c04f346e6f7.md +++ b/curriculum/challenges/swahili/blocks/workshop-reusable-mega-navbar/6745c732dbeb7c04f346e6f7.md @@ -7,7 +7,7 @@ dashedName: step-3 # --description-- -Unda kipengele cha `ul` ndani ya kipengele cha `nav`. Ndani ya kipengele hicho cha `ul`, unda vitu vitatu vya orodha. +Tengeneza kipengele cha `ul` ndani ya kipengele chako cha `nav`. Ndani ya kipengele hicho cha `ul`, tengeneza vipengele vitatu vya `li`. # --hints-- diff --git a/curriculum/challenges/swahili/blocks/workshop-reusable-mega-navbar/6745c89fba004707ded84453.md b/curriculum/challenges/swahili/blocks/workshop-reusable-mega-navbar/6745c89fba004707ded84453.md index f8d6697eeaf..b03ef48088e 100644 --- a/curriculum/challenges/swahili/blocks/workshop-reusable-mega-navbar/6745c89fba004707ded84453.md +++ b/curriculum/challenges/swahili/blocks/workshop-reusable-mega-navbar/6745c89fba004707ded84453.md @@ -7,17 +7,17 @@ dashedName: step-5 # --description-- -Tengeneza kipengele cha nanga ndani ya kipengele cha kwanza cha `li`. Toa sifa ya kipengele ya `href` yenye thamani ya `#` kwa kipengele cha `a` na maandishi ya `Dashboard`. +Tengeneza kipengele cha `a` ndani ya kipengele chako cha kwanza cha `li`. Mpe sifa ya kipengele `href` yenye thamani ya `#` na maandishi `Dashboard`. # --hints-- -Unapaswa kutengeneza kipengele cha `a` ndani ya kipengele cha kwanza cha orodha. +Unapaswa kutengeneza kipengele cha `a` ndani ya kipengele chako cha kwanza cha `li`. ```js assert.exists(document.querySelector('li a')); ``` -Kipengele chako cha `a` kinapaswa kuwa na sifa ya kipengele ya `href` iliyowekwa kuwa `#`. +Kipengele chako cha `a` kinapaswa kuwa na sifa ya kipengele `href` yenye thamani ya `#`. ```js assert.equal(document.querySelector('a')?.getAttribute('href'), '#'); diff --git a/curriculum/challenges/swahili/blocks/workshop-reusable-mega-navbar/6745cebbf97ef2129f3b9bab.md b/curriculum/challenges/swahili/blocks/workshop-reusable-mega-navbar/6745cebbf97ef2129f3b9bab.md index a52723c24b2..295c2b0322c 100644 --- a/curriculum/challenges/swahili/blocks/workshop-reusable-mega-navbar/6745cebbf97ef2129f3b9bab.md +++ b/curriculum/challenges/swahili/blocks/workshop-reusable-mega-navbar/6745cebbf97ef2129f3b9bab.md @@ -7,17 +7,17 @@ dashedName: step-6 # --description-- -Unda kipengele kingine cha `a` ndani ya kipengele cha pili cha `li`. Mpe sifa ya kipengele ya `href` yenye thamani ya `#` na maandishi ya `Widgets`. +Tengeneza kipengele kingine cha `a` ndani ya kipengele chako cha pili cha `li`. Mpe sifa ya kipengele ya `href` yenye thamani `#` na maandishi `Widgets`. # --hints-- -Unapaswa kuunda kipengele cha `a` ndani ya kipengele cha pili cha orodha. +Unapaswa kutengeneza kipengele cha `a` ndani ya kipengele chako cha pili cha `li`. ```js assert.lengthOf(document.querySelectorAll('li a'), 2); ``` -Kipengele chako cha `a` kinapaswa kuwa na sifa ya kipengele ya `href` iliyowekwa kuwa `#`. +Kipengele chako cha `a` kinapaswa kuwa na sifa ya kipengele ya `href` yenye thamani `#`. ```js assert.equal(document.querySelectorAll('a')[1]?.getAttribute('href'), '#'); diff --git a/curriculum/challenges/swahili/blocks/workshop-reusable-mega-navbar/6745d799beeb822076a4da9d.md b/curriculum/challenges/swahili/blocks/workshop-reusable-mega-navbar/6745d799beeb822076a4da9d.md index b7767dd91bc..cd7bbc559bf 100644 --- a/curriculum/challenges/swahili/blocks/workshop-reusable-mega-navbar/6745d799beeb822076a4da9d.md +++ b/curriculum/challenges/swahili/blocks/workshop-reusable-mega-navbar/6745d799beeb822076a4da9d.md @@ -7,19 +7,19 @@ dashedName: step-7 # --description-- -Ndani ya kipengele cha tatu cha orodha, tengeneza kipengele cha `button` chenye sifa ya kipengele ya `aria-expanded` iliyowekwa kuwa `false`. Pia, weka maandishi ya `button` kuwa `Apps`. +Ndani ya kipengele chako cha tatu cha `li`, tengeneza kipengele cha `button` chenye sifa ya kipengele `aria-expanded` yenye thamani `false`. Pia, weka maandishi ya `button` kuwa `Apps`. Sifa ya kipengele ya `aria-expanded` itawasilisha kwa watumiaji wa kisomaji cha skrini kwamba kitufe kinachochea menyu ndogo inayoweza kupanuliwa. # --hints-- -Unapaswa kutengeneza kipengele cha `button` ndani ya kipengele cha tatu cha orodha. +Unapaswa kutengeneza kipengele cha `button` ndani ya kipengele chako cha tatu cha `li`. ```js assert.exists(document.querySelector('li:nth-of-type(3) button')); ``` -Kipengele chako cha `button` kinapaswa kuwa na sifa ya kipengele ya `aria-expanded` iliyowekwa kuwa `false`. +Kipengele chako cha `button` kinapaswa kuwa na sifa ya kipengele `aria-expanded` yenye thamani `false`. ```js assert.equal( diff --git a/curriculum/challenges/swahili/blocks/workshop-reusable-mega-navbar/6745d9df333efe2543a1f457.md b/curriculum/challenges/swahili/blocks/workshop-reusable-mega-navbar/6745d9df333efe2543a1f457.md index a381d85fbbf..6253fe3abbd 100644 --- a/curriculum/challenges/swahili/blocks/workshop-reusable-mega-navbar/6745d9df333efe2543a1f457.md +++ b/curriculum/challenges/swahili/blocks/workshop-reusable-mega-navbar/6745d9df333efe2543a1f457.md @@ -7,7 +7,7 @@ dashedName: step-8 # --description-- -Bado ndani ya kipengele cha tatu cha `li`, tengeneza kipengele cha `ul` kwa ajili ya popup. Mpe `className` ya `sub-menu` na `aria-label` ya `Apps`. +Bado ndani ya kipengele chako cha tatu cha `li`, tengeneza kipengele cha `ul` kwa ajili ya popup. Mpe `className` ya `sub-menu` na `aria-label` ya `Apps`. # --hints-- @@ -17,13 +17,13 @@ Unapaswa kutengeneza kipengele cha `ul` ndani ya kipengele chako cha tatu cha `l assert.exists(document.querySelector('li ul')); ``` -Unapaswa kuweka sifa ya kipengele ya `className` ya kipengele chako cha `ul` kuwa `sub-menu`. +Kipengele chako cha `ul` kinapaswa kuwa na `className` ya `sub-menu`. ```js assert.equal(document.querySelector('li ul')?.getAttribute('class'), 'sub-menu'); ``` -Unapaswa kuweka sifa ya kipengele ya `aria-label` ya kipengele chako cha `ul` kuwa `Apps`. +Kipengele chako cha `ul` kinapaswa kuwa na `aria-label` ya `Apps`. ```js assert.equal(document.querySelector('li ul')?.getAttribute('aria-label'), 'Apps'); diff --git a/curriculum/challenges/swahili/blocks/workshop-reusable-mega-navbar/6745dce846995b2a466594be.md b/curriculum/challenges/swahili/blocks/workshop-reusable-mega-navbar/6745dce846995b2a466594be.md index 67228069699..97bb449acce 100644 --- a/curriculum/challenges/swahili/blocks/workshop-reusable-mega-navbar/6745dce846995b2a466594be.md +++ b/curriculum/challenges/swahili/blocks/workshop-reusable-mega-navbar/6745dce846995b2a466594be.md @@ -7,11 +7,11 @@ dashedName: step-9 # --description-- -Tengeneza vituo vitatu vipya vya orodha ndani ya kipengele chako cha `ul.sub-menu`. +Tengeneza vipengele vipya vitatu vya `li` ndani ya kipengele chako cha `ul` chenye `className` ya `sub-menu`. # --hints-- -Unapaswa kutengeneza vituo vitatu vipya vya orodha ndani ya kipengele chako cha `ul` kwa kutumia `className` ya `sub-menu`. +Unapaswa kutengeneza vipengele vipya vitatu vya `li` ndani ya kipengele chako cha `ul` chenye `className` ya `sub-menu`. ```js assert.lengthOf(document.querySelectorAll('.sub-menu li'), 3); diff --git a/curriculum/challenges/swahili/blocks/workshop-reusable-mega-navbar/6745de9ce925b92d72df713a.md b/curriculum/challenges/swahili/blocks/workshop-reusable-mega-navbar/6745de9ce925b92d72df713a.md index 60645f79cad..ec12684cf9e 100644 --- a/curriculum/challenges/swahili/blocks/workshop-reusable-mega-navbar/6745de9ce925b92d72df713a.md +++ b/curriculum/challenges/swahili/blocks/workshop-reusable-mega-navbar/6745de9ce925b92d72df713a.md @@ -7,11 +7,11 @@ dashedName: step-10 # --description-- -Ndani ya kila kipengele cha `li`, tengeneza kipengele cha nanga chenye sifa ya kipengele cha `href` iliyowekwa kuwa `#`. +Ndani ya kila moja ya vipengele vipya vitatu vya `li`, tengeneza kipengele cha `a` chenye sifa ya kipengele `href` yenye thamani `#`. # --hints-- -Unapaswa kutengeneza kipengele kipya cha `a` ndani ya kila kipengee cha orodha na kuweka sifa yake ya kipengele ya `href` kuwa `#`. +Unapaswa kutengeneza kipengele kipya cha `a` chenye sifa ya kipengele `href` yenye thamani `#` ndani ya kila moja ya vipengele vipya vitatu vya `li`. ```js assert.equal(document.querySelectorAll('li a')[2]?.getAttribute('href'), '#'); diff --git a/curriculum/challenges/swahili/blocks/workshop-reusable-mega-navbar/6745e2aca895c935168e7d91.md b/curriculum/challenges/swahili/blocks/workshop-reusable-mega-navbar/6745e2aca895c935168e7d91.md index 2bd169e68fa..b3b60fae511 100644 --- a/curriculum/challenges/swahili/blocks/workshop-reusable-mega-navbar/6745e2aca895c935168e7d91.md +++ b/curriculum/challenges/swahili/blocks/workshop-reusable-mega-navbar/6745e2aca895c935168e7d91.md @@ -7,25 +7,25 @@ dashedName: step-11 # --description-- -Ili kumaliza, weka maandishi ya `Calendar` kwa tagi ya nanga ya kwanza, `Chat` kwa ya pili, na `Email` kwa ya tatu. +Ili kumaliza, weka maandishi ya kipengele cha kwanza cha `a` kuwa `Calendar`, cha pili kuwa `Chat`, na cha tatu kuwa `Email`. -Kwa hivyo, sehemu yako kubwa ya navbar imekamilika! +Kwa hivyo, sehemu yako ya `Navbar` imekamilika! # --hints-- -Unapaswa kuweka maandishi ya `Calendar` kwa kipengele cha nanga cha kwanza. +Unapaswa kuweka maandishi ya kipengele cha kwanza cha `a` kuwa `Calendar`. ```js assert.equal(document.querySelectorAll('li a')[2]?.textContent, 'Calendar'); ``` -Unapaswa kuweka maandishi ya `Chat` kwa kipengele cha nanga cha pili. +Unapaswa kuweka maandishi ya kipengele cha pili cha `a` kuwa `Chat`. ```js assert.equal(document.querySelectorAll('li a')[3]?.textContent, 'Chat'); ``` -Unapaswa kuweka maandishi ya `Email` kwa kipengele cha nanga cha tatu. +Unapaswa kuweka maandishi ya kipengele cha tatu cha `a` kuwa `Email`. ```js assert.equal(document.querySelectorAll('li a')[4]?.textContent, 'Email'); diff --git a/curriculum/challenges/swahili/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165b.md b/curriculum/challenges/swahili/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165b.md index f934cb5bf5e..c251391f2b8 100644 --- a/curriculum/challenges/swahili/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165b.md +++ b/curriculum/challenges/swahili/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165b.md @@ -7,7 +7,7 @@ dashedName: step-5 # --description-- -Ndani ya taarifa yako ya return, badilisha mfuatano wa herufi tupu na sehemu ya `div` yenye sifa ya `className` ya `flex-container`. +Ndani ya usemi wa `return`, badilisha mfuatano wa herufi tupu na kipengele cha `div` chenye `className` ya `flex-container`. # --hints-- @@ -26,7 +26,7 @@ Sehemu yako ya `App` inapaswa kurudisha sehemu moja ya `div`. assert.lengthOf(testElem.children, 1); ``` -`div` inapaswa kuwa na sifa ya `className` ya `flex-container`. +`div` yako inapaswa kuwa na `className` ya `flex-container`. ```js const testElem = await __helpers.prepTestComponent(window.index.App); diff --git a/curriculum/challenges/swahili/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165c.md b/curriculum/challenges/swahili/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165c.md index 8c72048da13..bd27be90917 100644 --- a/curriculum/challenges/swahili/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165c.md +++ b/curriculum/challenges/swahili/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165c.md @@ -7,7 +7,7 @@ dashedName: step-6 # --description-- -Sasa, weka sehemu ya `Card` ndani ya sehemu yako ya `App`. Ipe vigezo vya `name` vilivyowekwa kuwa `"Mark"`, vigezo vya `title` vilivyowekwa kuwa `"Front-End developer"`, na vigezo vya `bio` vilivyowekwa kuwa `"I like to work with different front-end technologies and play video games."` +Sasa, weka sehemu ya `Card` ndani ya sehemu yako ya `App`. Ipe vigezo vya `name` vilivyowekwa kuwa `"Mark"`, `title` vilivyowekwa kuwa `"Front-End developer"`, na `bio` vilivyowekwa kuwa `"I like to work with different front-end technologies and play video games."` # --hints-- diff --git a/curriculum/challenges/swahili/blocks/workshop-reusable-profile-card-component/68720c179cd34be6793bfdf6.md b/curriculum/challenges/swahili/blocks/workshop-reusable-profile-card-component/68720c179cd34be6793bfdf6.md index af0618e0818..ddea7971391 100644 --- a/curriculum/challenges/swahili/blocks/workshop-reusable-profile-card-component/68720c179cd34be6793bfdf6.md +++ b/curriculum/challenges/swahili/blocks/workshop-reusable-profile-card-component/68720c179cd34be6793bfdf6.md @@ -9,7 +9,7 @@ dashedName: step-8 Ingawa programu yako inafanya kazi kama inavyotarajiwa, kawaida hutoi sehemu nyingi za `Card` kwa mkono kama hivi. -Ondoa sehemu tatu za `` ndani ya kipengele cha `
`. Katika hatua chache zijazo, utaunda safu ya data na utatumia kitendakazi cha `map()` kuonyesha sehemu za `Card` ambazo ni njia inayotumika zaidi katika React. +Ondoa sehemu tatu za `` ndani ya kipengele cha `
`. Katika hatua chache zijazo, utaunda safu ya data na utumie njia ya `map()` kuonyesha sehemu za `Card`, ambayo ni njia inayotumika zaidi katika React. # --hints-- diff --git a/curriculum/challenges/swahili/blocks/workshop-reusable-profile-card-component/68778af56eb5d980a4e2daed.md b/curriculum/challenges/swahili/blocks/workshop-reusable-profile-card-component/68778af56eb5d980a4e2daed.md index 57a5805f57e..cfba97ab2f0 100644 --- a/curriculum/challenges/swahili/blocks/workshop-reusable-profile-card-component/68778af56eb5d980a4e2daed.md +++ b/curriculum/challenges/swahili/blocks/workshop-reusable-profile-card-component/68778af56eb5d980a4e2daed.md @@ -30,7 +30,7 @@ const profilesVal = eval(profiles?.value.toString()); assert.isArray(profilesVal); ``` -Safu yako ya wasifu inapaswa kuwa na kitu kinachojumuisha vigezo vinavyohitajika vyote: `id`, `name`, `title`, na `bio`. +Safu yako ya data ya `profiles` inapaswa kuwa na kitu ambacho kinajumuisha mali zote zinazohitajika: `id`, `name`, `title`, na `bio`. ```js const explorer = await __helpers.Explorer(code); diff --git a/curriculum/challenges/swahili/blocks/workshop-reusable-profile-card-component/68779156bd3704b727ba5f38.md b/curriculum/challenges/swahili/blocks/workshop-reusable-profile-card-component/68779156bd3704b727ba5f38.md index e1ef42047d9..44a0de66da9 100644 --- a/curriculum/challenges/swahili/blocks/workshop-reusable-profile-card-component/68779156bd3704b727ba5f38.md +++ b/curriculum/challenges/swahili/blocks/workshop-reusable-profile-card-component/68779156bd3704b727ba5f38.md @@ -7,7 +7,7 @@ dashedName: step-10 # --description-- -Kama unavyokumbuka kutoka mafundoni ya awali, unaweza kutumia njia ya `map` kurudia kupitia vitu tofauti na kuonyesha sehemu kwa njia ya mabadiliko kama hii: +Kama unavyokumbuka kutoka kwa mafundisho ya awali, unaweza kutumia njia ya `map()` kupita kupitia vitu tofauti na kuonyesha sehemu hizo kwa njia ya mabadiliko kama hii: ```jsx export function App() { diff --git a/curriculum/challenges/swahili/blocks/workshop-reusable-profile-card-component/687799aefd1f2af1704065d0.md b/curriculum/challenges/swahili/blocks/workshop-reusable-profile-card-component/687799aefd1f2af1704065d0.md index 09fe078962d..2c226039d6d 100644 --- a/curriculum/challenges/swahili/blocks/workshop-reusable-profile-card-component/687799aefd1f2af1704065d0.md +++ b/curriculum/challenges/swahili/blocks/workshop-reusable-profile-card-component/687799aefd1f2af1704065d0.md @@ -23,7 +23,7 @@ Kama unavyokumbuka kutoka kwa mafundisho ya awali, ni mbinu bora kujumuisha kige
``` -Kigezo cha `key` husaidia React kutambua ni vitu gani vimebadilika, vimeongezwa, au vimeondolewa. Hii huongeza utendaji na kuruhusu masasisho yenye ufanisi zaidi. +Vigezo vya `key` husaidia React kutambua vitu ambavyo vimebadilika, vimeongezwa, au vimeondolewa. Hii huongeza utendaji na kuruhusu masasisho yenye ufanisi zaidi. Sahihisha sehemu ya `Card` ili ijumuishe kigezo cha `key` chenye thamani ya `profile.id`. diff --git a/curriculum/challenges/swahili/blocks/workshop-toggle-text-app/67cd46ec4ec904186ad52ba5.md b/curriculum/challenges/swahili/blocks/workshop-toggle-text-app/67cd46ec4ec904186ad52ba5.md index 78812b12b86..3e99ec1cc2f 100644 --- a/curriculum/challenges/swahili/blocks/workshop-toggle-text-app/67cd46ec4ec904186ad52ba5.md +++ b/curriculum/challenges/swahili/blocks/workshop-toggle-text-app/67cd46ec4ec904186ad52ba5.md @@ -7,7 +7,7 @@ dashedName: step-3 # --description-- -Chini ya kipengele chako cha `button`, ongeza kipengele cha aya chenye `id` ya `message` na maandishi ya `I love freeCodeCamp!`. +Chini ya kipengele chako cha `button`, ongeza kipengele cha aya chenye `id` inayoitwa `message` na maandishi `I love freeCodeCamp!`. # --hints-- @@ -17,7 +17,7 @@ Unapaswa kuwa na kipengele cha aya. assert.exists(document.querySelector("p")); ``` -Kipengele chako cha aya kinapaswa kuwa na `id` ya `message`. +Kipengele chako cha aya kinapaswa kuwa na `id` inayoitwa `message`. ```js assert.exists(document.getElementById("message")) diff --git a/curriculum/challenges/swahili/blocks/workshop-toggle-text-app/67cd49e05693111a41771f29.md b/curriculum/challenges/swahili/blocks/workshop-toggle-text-app/67cd49e05693111a41771f29.md index a2a4342da0a..9f5e4fa4d55 100644 --- a/curriculum/challenges/swahili/blocks/workshop-toggle-text-app/67cd49e05693111a41771f29.md +++ b/curriculum/challenges/swahili/blocks/workshop-toggle-text-app/67cd49e05693111a41771f29.md @@ -19,7 +19,7 @@ Mkataba wa kuitaja vigezo vya hali ni kutumia muundo wa `example` na `setExample Unda kigezo kipya cha hali na kitendakazi cha kuweka thamani kinachoitwa `isVisible` na `setIsVisible`. Kumbuka kutumia sintaksia ya ufumbuzi wa muundo wa safu ya data kama ilivyoonyeshwa katika mfano. -Kisha weka hook ya `useState` na thamani ya awali ya `false`. +Kisha fanya wito wa `useState` kwa thamani ya awali ya `false`. # --hints-- diff --git a/curriculum/challenges/swahili/blocks/workshop-toggle-text-app/67cd4fe67813f71c3479e64a.md b/curriculum/challenges/swahili/blocks/workshop-toggle-text-app/67cd4fe67813f71c3479e64a.md index 29d6aebad4a..93371c51d24 100644 --- a/curriculum/challenges/swahili/blocks/workshop-toggle-text-app/67cd4fe67813f71c3479e64a.md +++ b/curriculum/challenges/swahili/blocks/workshop-toggle-text-app/67cd4fe67813f71c3479e64a.md @@ -9,7 +9,7 @@ dashedName: step-6 Njia moja ya kuonyesha maandishi ya aya ni kubadilisha thamani ya awali ya kiungo cha `useState`. -Badilisha thamani ya sasa ya `useState` kutoka `false` hadi `true` na utaona kuwa maandishi ya aya sasa yanaonyeshwa kwenye skrini. +Badilisha thamani ya awali ya `useState` kutoka `false` kuwa `true`. Ukifanya hivyo kwa usahihi, utagundua kuwa maandishi ya aya sasa yanaonyeshwa kwenye skrini. # --hints-- diff --git a/curriculum/challenges/swahili/blocks/workshop-toggle-text-app/67cd525b0e575b1e5abf4c03.md b/curriculum/challenges/swahili/blocks/workshop-toggle-text-app/67cd525b0e575b1e5abf4c03.md index fa57d2485c8..83ac2f34a56 100644 --- a/curriculum/challenges/swahili/blocks/workshop-toggle-text-app/67cd525b0e575b1e5abf4c03.md +++ b/curriculum/challenges/swahili/blocks/workshop-toggle-text-app/67cd525b0e575b1e5abf4c03.md @@ -16,7 +16,7 @@ const [isUserLoggedIn, setIsUserLoggedIn] = useState(false); setIsUserLoggedIn(!isUserLoggedIn); ``` -Mfano ufuatao unatumia kitendakazi cha set kinachoitwa `setIsUserLoggedIn` kusahihisha hali ya kuingia kwa mtumizi. Ni desturi ya kawaida kutumia kielezi cha mantiki cha NOT (`!`) kubadilisha kati ya `true` na `false`. Kwa kuwa thamani ya awali ni `false`, kutumia kielezi cha `!` kutabadilisha kuwa `true`. +Mfano ulio juu unatumia kitendakazi cha set kinachoitwa `setIsUserLoggedIn` kusahihisha hali ya kuingia kwa mtumizi. Ni desturi ya kawaida kutumia kielezi cha mantiki NOT (`!`) kubadilisha kati ya `true` na `false`. Kwa kuwa thamani ya awali ni `false`, kutumia kielezi cha `!` kutabadilisha kuwa `true`. Ndani ya kitendakazi cha `handleToggleVisibility`, tumia `setIsVisible` kusahihisha hali ya uonekano kwa kutumia kielezi cha mantiki cha NOT (`!`). diff --git a/curriculum/challenges/swahili/blocks/workshop-toggle-text-app/67cd57e96257ed1fabbe4879.md b/curriculum/challenges/swahili/blocks/workshop-toggle-text-app/67cd57e96257ed1fabbe4879.md index 295a9af0c2c..7e99101a8bd 100644 --- a/curriculum/challenges/swahili/blocks/workshop-toggle-text-app/67cd57e96257ed1fabbe4879.md +++ b/curriculum/challenges/swahili/blocks/workshop-toggle-text-app/67cd57e96257ed1fabbe4879.md @@ -27,7 +27,7 @@ Sasa, unapo bofya kitufe, utaona uonekano wa maandishi ya aya kubadilika kati ya # --hints-- -Unapobofya `toggle-button`, ujumbe wa `"I love freeCodeCamp!"` unapaswa kuonekana kwenye skrini. +Ujumbe wako `I love freeCodeCamp!` unapaswa kuonekana kwenye skrini wakati `toggle-button` inabofya. ```js const abuseState = __helpers.spyOn(React, "useState"); diff --git a/curriculum/challenges/swahili/blocks/workshop-toggle-text-app/67cd59f6581d3a20c9cc6460.md b/curriculum/challenges/swahili/blocks/workshop-toggle-text-app/67cd59f6581d3a20c9cc6460.md index f9129035985..80576ab1301 100644 --- a/curriculum/challenges/swahili/blocks/workshop-toggle-text-app/67cd59f6581d3a20c9cc6460.md +++ b/curriculum/challenges/swahili/blocks/workshop-toggle-text-app/67cd59f6581d3a20c9cc6460.md @@ -9,7 +9,7 @@ dashedName: step-11 Sasa ni wakati mzuri kuona thamani iliyosasishwa ya `isVisible`. -Chini ya `setIsVisible(!isVisible);`, andika thamani ya hali ya `isVisible` kwenye konsoli. +Chini ya `setIsVisible(!isVisible);`, andika hali ya `isVisible` kwenye konsoli. Fungua konsoli na utaona kuwa thamani si ile uliyotarajia. diff --git a/curriculum/challenges/swahili/blocks/workshop-toggle-text-app/67cd5bace629fa219a70aa6d.md b/curriculum/challenges/swahili/blocks/workshop-toggle-text-app/67cd5bace629fa219a70aa6d.md index 7fd6cdced19..cd33cbd1fac 100644 --- a/curriculum/challenges/swahili/blocks/workshop-toggle-text-app/67cd5bace629fa219a70aa6d.md +++ b/curriculum/challenges/swahili/blocks/workshop-toggle-text-app/67cd5bace629fa219a70aa6d.md @@ -9,7 +9,7 @@ dashedName: step-12 Kama ulitazama konsoli, huenda ukashangaa kuona thamani ya `false` badala ya `true`. Hii inatokea kwa sababu React haisahishi mara moja hali (state). Hali itasasishwa tu katika mzunguko ujao wa kuonyesha (render). -Ni kosa la kawaida kwa wasanidi programu wapya wa React kuweka taarifa za konsoli mara moja baada ya kitendakazi cha set. Hivyo, hili ni jambo la kuzingatia unapotengeneza programu zako za React. +Ni kosa la kawaida kwa wasanidi programu wapya wa React kuweka taarifa za konsoli mara moja baada ya kitendakazi cha seti. Hivyo, hili ni jambo la kuzingatia unapoendelea kujenga programu zako za React. Kwa kuwa `console.log()` haibidi tena, iondoe kutoka kwenye kitendakazi chako cha `handleToggleVisibility`. diff --git a/curriculum/challenges/swahili/blocks/workshop-toggle-text-app/67cd61c24bfc0a240132fd2f.md b/curriculum/challenges/swahili/blocks/workshop-toggle-text-app/67cd61c24bfc0a240132fd2f.md index 90b6a294c0f..47f86da87bc 100644 --- a/curriculum/challenges/swahili/blocks/workshop-toggle-text-app/67cd61c24bfc0a240132fd2f.md +++ b/curriculum/challenges/swahili/blocks/workshop-toggle-text-app/67cd61c24bfc0a240132fd2f.md @@ -23,14 +23,14 @@ Na kwa mabadiliko hayo ya mwisho, warsha yako itakuwa imekamilika! Jaribu kitufe # --hints-- -Wakati `isVisible` ni `false`, maandishi ya kitufe yanapaswa kusema `Show Message`. +Maandishi ya kitufe chako yanapaswa kusema `Show Message` wakati `isVisible` ni `false`. ```js const btn = document.getElementById("toggle-button"); assert.equal(btn.textContent, "Show Message"); ``` -Wakati `isVisible` ni `true`, maandishi ya kitufe yanapaswa kusema `Hide Message`. +Maandishi ya kitufe chako yanapaswa kusema `Hide Message` wakati `isVisible` ni `true`. ```js const abuseState = __helpers.spyOn(React, "useState"); @@ -246,7 +246,7 @@ export const ToggleApp = () => { const handleToggleVisibility = () => { setIsVisible(!isVisible); - } + }; return (
diff --git a/curriculum/challenges/swahili/blocks/workshop-wildlife-tracker/6999ac171928136168654774.md b/curriculum/challenges/swahili/blocks/workshop-wildlife-tracker/6999ac171928136168654774.md index 308a63dab59..c8d61407819 100644 --- a/curriculum/challenges/swahili/blocks/workshop-wildlife-tracker/6999ac171928136168654774.md +++ b/curriculum/challenges/swahili/blocks/workshop-wildlife-tracker/6999ac171928136168654774.md @@ -42,8 +42,10 @@ assert.isFunction(getSpecies); Kitendakazi cha `getSpecies` kinapaswa kuwa na kigezo kimoja, `animal`. ```js -const regex = __helpers.functionRegex('getSpecies', ['animal']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { getSpecies } = explorer.allFunctions; +assert.equal(getSpecies?.parameters.length, 1); +assert.equal(getSpecies?.parameters[0].toString(), 'animal'); ``` Unapaswa kuandika `getSpecies(tiger)` kwenye konsoli. diff --git a/curriculum/challenges/swahili/blocks/workshop-wildlife-tracker/6999ad1cdc249e185aaeedbd.md b/curriculum/challenges/swahili/blocks/workshop-wildlife-tracker/6999ad1cdc249e185aaeedbd.md index 4e883569e2b..30b2d396c0d 100644 --- a/curriculum/challenges/swahili/blocks/workshop-wildlife-tracker/6999ad1cdc249e185aaeedbd.md +++ b/curriculum/challenges/swahili/blocks/workshop-wildlife-tracker/6999ad1cdc249e185aaeedbd.md @@ -49,8 +49,11 @@ assert.isFunction(addHabitat); Kitendakazi cha `addHabitat` kinapaswa kuwa na vigezo viwili: `animal` na `habitat`. ```js -const regex = __helpers.functionRegex('addHabitat', ['animal', 'habitat']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { addHabitat } = explorer.allFunctions; +assert.equal(addHabitat?.parameters.length, 2); +assert.equal(addHabitat?.parameters[0].toString(), 'animal'); +assert.equal(addHabitat?.parameters[1].toString(), 'habitat'); ``` Kitendakazi cha `addHabitat` kinapaswa kurudisha kitu cha `animal` kilichosasishwa. diff --git a/curriculum/challenges/swahili/blocks/workshop-wildlife-tracker/6999adc72c02812a28c01e31.md b/curriculum/challenges/swahili/blocks/workshop-wildlife-tracker/6999adc72c02812a28c01e31.md index 11fe0944e0d..5ec4dc6af97 100644 --- a/curriculum/challenges/swahili/blocks/workshop-wildlife-tracker/6999adc72c02812a28c01e31.md +++ b/curriculum/challenges/swahili/blocks/workshop-wildlife-tracker/6999adc72c02812a28c01e31.md @@ -43,8 +43,11 @@ assert.isFunction(updateAge); Kitendakazi cha `updateAge` kinapaswa kuwa na vigezo viwili: `animal` na `newAge`. ```js -const regex = __helpers.functionRegex('updateAge', ['animal', 'newAge']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { updateAge } = explorer.allFunctions; +assert.equal(updateAge?.parameters.length, 2); +assert.equal(updateAge?.parameters[0].toString(), 'animal'); +assert.equal(updateAge?.parameters[1].toString(), 'newAge'); ``` Kitendakazi cha `updateAge` kinapaswa kurudisha kitu cha `animal` kilichosasishwa. diff --git a/curriculum/challenges/swahili/blocks/workshop-wildlife-tracker/6999b0198d18d402c36cc5fe.md b/curriculum/challenges/swahili/blocks/workshop-wildlife-tracker/6999b0198d18d402c36cc5fe.md index 16f4a2d085d..7227c465b42 100644 --- a/curriculum/challenges/swahili/blocks/workshop-wildlife-tracker/6999b0198d18d402c36cc5fe.md +++ b/curriculum/challenges/swahili/blocks/workshop-wildlife-tracker/6999b0198d18d402c36cc5fe.md @@ -45,8 +45,10 @@ assert.isFunction(removeEndangeredStatus); Kitendakazi cha `removeEndangeredStatus` kinapaswa kuwa na kigezo kimoja, `animal`. ```js -const regex = __helpers.functionRegex('removeEndangeredStatus', ['animal']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { removeEndangeredStatus } = explorer.allFunctions; +assert.equal(removeEndangeredStatus?.parameters.length, 1); +assert.equal(removeEndangeredStatus?.parameters[0].toString(), 'animal'); ``` Kitendakazi cha `removeEndangeredStatus` kinapaswa kurudisha kitu cha `animal` kilichosasishwa. diff --git a/curriculum/challenges/swahili/blocks/workshop-wildlife-tracker/6999b07c34c2cde21ee6e1d8.md b/curriculum/challenges/swahili/blocks/workshop-wildlife-tracker/6999b07c34c2cde21ee6e1d8.md index 70a9a872896..049df0faf3a 100644 --- a/curriculum/challenges/swahili/blocks/workshop-wildlife-tracker/6999b07c34c2cde21ee6e1d8.md +++ b/curriculum/challenges/swahili/blocks/workshop-wildlife-tracker/6999b07c34c2cde21ee6e1d8.md @@ -49,8 +49,10 @@ assert.isFunction(hasHabitat); Kitendakazi cha `hasHabitat` kinapaswa kuwa na kigezo kimoja, `animal`. ```js -const regex = __helpers.functionRegex('hasHabitat', ['animal']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { hasHabitat } = explorer.allFunctions; +assert.equal(hasHabitat?.parameters.length, 1); +assert.equal(hasHabitat?.parameters[0].toString(), 'animal'); ``` `hasHabitat` inapaswa kutumia njia ya `hasOwnProperty` kukagua sifa ya `habitat`. diff --git a/curriculum/challenges/swahili/blocks/workshop-wildlife-tracker/6999b0d79ea938edcb032237.md b/curriculum/challenges/swahili/blocks/workshop-wildlife-tracker/6999b0d79ea938edcb032237.md index 389787dcc2a..2b2739fddb2 100644 --- a/curriculum/challenges/swahili/blocks/workshop-wildlife-tracker/6999b0d79ea938edcb032237.md +++ b/curriculum/challenges/swahili/blocks/workshop-wildlife-tracker/6999b0d79ea938edcb032237.md @@ -45,8 +45,11 @@ assert.isFunction(getProperty); Kitendakazi `getProperty` kinapaswa kuwa na vigezo viwili: `animal` na `propertyName`. ```js -const regex = __helpers.functionRegex('getProperty', ['animal', 'propertyName']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { getProperty } = explorer.allFunctions; +assert.equal(getProperty?.parameters.length, 2); +assert.equal(getProperty?.parameters[0].toString(), 'animal'); +assert.equal(getProperty?.parameters[1].toString(), 'propertyName'); ``` `getProperty` inapaswa kutumia uandishi wa mabano kupata sifa. diff --git a/curriculum/challenges/swahili/blocks/workshop-wildlife-tracker/699a00de9f564bb0effaa14d.md b/curriculum/challenges/swahili/blocks/workshop-wildlife-tracker/699a00de9f564bb0effaa14d.md index 32ffc0835e2..3b34846c3d0 100644 --- a/curriculum/challenges/swahili/blocks/workshop-wildlife-tracker/699a00de9f564bb0effaa14d.md +++ b/curriculum/challenges/swahili/blocks/workshop-wildlife-tracker/699a00de9f564bb0effaa14d.md @@ -44,8 +44,10 @@ assert.isFunction(getAge); Kitendakazi cha `getAge` kinapaswa kuwa na kigezo kimoja, `animal`. ```js -const regex = __helpers.functionRegex('getAge', ['animal']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { getAge } = explorer.allFunctions; +assert.equal(getAge?.parameters.length, 1); +assert.equal(getAge?.parameters[0].toString(), 'animal'); ``` `getAge` inapaswa kupata sifa ya `age` kwa kutumia uandishi wa nukta. diff --git a/curriculum/challenges/ukrainian/blocks/back-end-development-and-apis-projects/bd7158d8c443edefaeb5bd0f.md b/curriculum/challenges/ukrainian/blocks/back-end-development-and-apis-projects/bd7158d8c443edefaeb5bd0f.md index 95f95df5b91..4e3d3fc5ac5 100644 --- a/curriculum/challenges/ukrainian/blocks/back-end-development-and-apis-projects/bd7158d8c443edefaeb5bd0f.md +++ b/curriculum/challenges/ukrainian/blocks/back-end-development-and-apis-projects/bd7158d8c443edefaeb5bd0f.md @@ -19,7 +19,7 @@ dashedName: file-metadata-microservice # --hints-- -Ви повинні надати свій власний проєкт, а не приклад URL. +Ви маєте надати власний проєкт, а не приклад за URL. ```js assert( @@ -50,18 +50,22 @@ dashedName: file-metadata-microservice Коли ви відправляєте файл, отримуєте `name`, `type` і `size` файлу в байтах у JSON-відповіді. ```js - const formData = new FormData(); - const fileData = await fetch( - 'https://cdn.freecodecamp.org/weather-icons/01d.png' - ); - const file = await fileData.blob(); - formData.append('upfile', file, 'icon'); + const boundary = 'fccBoundary1234567890'; + const head = + `--${boundary}\r\n` + + 'Content-Disposition: form-data; name="upfile"; filename="icon"\r\n' + + 'Content-Type: image/png\r\n\r\n'; + const body = new Blob([head, new Uint8Array(70), `\r\n--${boundary}--\r\n`]); const data = await fetch(code + '/api/fileanalyse', { method: 'POST', - body: formData + headers: { + 'Content-Type': `multipart/form-data; boundary=${boundary}` + }, + body }); const parsed = await data.json(); assert.property(parsed, 'size'); assert.equal(parsed.name, 'icon'); assert.equal(parsed.type, 'image/png'); ``` + diff --git a/curriculum/challenges/ukrainian/blocks/daily-coding-challenges-javascript/6a26df3e2988bcdded204895.md b/curriculum/challenges/ukrainian/blocks/daily-coding-challenges-javascript/6a26df3e2988bcdded204895.md index d95e7765ded..5afb168d889 100644 --- a/curriculum/challenges/ukrainian/blocks/daily-coding-challenges-javascript/6a26df3e2988bcdded204895.md +++ b/curriculum/challenges/ukrainian/blocks/daily-coding-challenges-javascript/6a26df3e2988bcdded204895.md @@ -25,10 +25,10 @@ assert.equal(calculateHandicap([72, 72, 72], [72, 72, 72]), 0); assert.equal(calculateHandicap([80, 76, 78, 78], [72, 72, 72, 72]), 6); ``` -`calculateHandicap([42, 45, 46, 44], [36, 36, 36, 36])` має повернути `8.3`. +`calculateHandicap([42, 45, 46, 45], [36, 36, 36, 36])` має повернути `8.5`. ```js -assert.equal(calculateHandicap([42, 45, 46, 44], [36, 36, 36, 36]), 8.3); +assert.equal(calculateHandicap([42, 45, 46, 45], [36, 36, 36, 36]), 8.5); ``` `calculateHandicap([85, 80, 76, 79, 82], [72, 72, 72, 71, 71])` має повернути `8.8`. diff --git a/curriculum/challenges/ukrainian/blocks/daily-coding-challenges-python/6a26df3e2988bcdded204895.md b/curriculum/challenges/ukrainian/blocks/daily-coding-challenges-python/6a26df3e2988bcdded204895.md index 478d4e9e547..a7f2fc67f61 100644 --- a/curriculum/challenges/ukrainian/blocks/daily-coding-challenges-python/6a26df3e2988bcdded204895.md +++ b/curriculum/challenges/ukrainian/blocks/daily-coding-challenges-python/6a26df3e2988bcdded204895.md @@ -31,12 +31,12 @@ TestCase().assertEqual(calculate_handicap([80, 76, 78, 78], [72, 72, 72, 72]), 6 }}) ``` -`calculate_handicap([42, 45, 46, 44], [36, 36, 36, 36])` має повернути `8.3`. +`calculate_handicap([42, 45, 46, 45], [36, 36, 36, 36])` має повернути `8.5`. ```js ({test: () => { runPython(` from unittest import TestCase -TestCase().assertEqual(calculate_handicap([42, 45, 46, 44], [36, 36, 36, 36]), 8.3)`) +TestCase().assertEqual(calculate_handicap([42, 45, 46, 45], [36, 36, 36, 36]), 8.5)`) }}) ``` diff --git a/curriculum/challenges/ukrainian/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb928.md b/curriculum/challenges/ukrainian/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb928.md index 0bc25db1e8c..24b1843f0d7 100644 --- a/curriculum/challenges/ukrainian/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb928.md +++ b/curriculum/challenges/ukrainian/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb928.md @@ -1,6 +1,6 @@ --- id: 5e46f7e5ac417301a38fb928 -title: "калькулятор середнього, дисперсії та стандартного відхилення" +title: "Калькулятор середнього, дисперсії та стандартного відхилення" challengeType: 10 forumTopicId: 462366 dashedName: mean-variance-standard-deviation-calculator @@ -8,9 +8,9 @@ dashedName: mean-variance-standard-deviation-calculator # --description-- -Ви будете працювати над цим проєктом із нашим стартовим кодом Ona. +Ви будете працювати над цим проєктом із нашим шаблонним кодом. -Ми ще розробляємо інтерактивну навчальну частину навчальної програми з Python. Поки що ось кілька відео на каналі freeCodeCamp.org у YouTube, які навчать вас усьому, що потрібно знати для виконання цього проєкту: +Ми ще розробляємо інтерактивну навчальну частину навчальної програми з Python. Поки що ось кілька відео на каналі freeCodeCamp.org на YouTube, які навчать вас усьому, що потрібно знати для виконання цього проєкту: - Відеокурс Python для всіх (14 годин) @@ -52,7 +52,8 @@ dashedName: mean-variance-standard-deviation-calculator ## Розробка -Пишіть свій код у `mean_var_std.py`. Для розробки ви можете використовувати `main.py` для тестування свого коду. Щоб запустити код, введіть `python3 main.py` у терміналі Ona і натисніть Enter. Це призведе до запуску включеного інтерпретатора CPython для файлу `main.py`. +Напишіть свій код у `mean_var_std.py`. Для розробки ви можете використовувати `main.py` для тестування свого коду. +Щоб запустити код, введіть у терміналі `python3 main.py` і натисніть Enter. Це запустить файл `main.py` за допомогою вбудованого інтерпретатора CPython. ## Тестування @@ -60,11 +61,11 @@ dashedName: mean-variance-standard-deviation-calculator ## Відправлення -Скопіюйте URL свого проєкту і відправте його на freeCodeCamp. +Скопіюйте URL свого проєкту та відправте його на freeCodeCamp. # --hints-- -Вона має пройти всі тести Python. +Ваша модель має пройти всі тести на Python. ```js diff --git a/curriculum/challenges/ukrainian/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb929.md b/curriculum/challenges/ukrainian/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb929.md index 432c6659d77..f52cb0bd26b 100644 --- a/curriculum/challenges/ukrainian/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb929.md +++ b/curriculum/challenges/ukrainian/blocks/data-analysis-with-python-projects/5e46f7e5ac417301a38fb929.md @@ -8,9 +8,9 @@ dashedName: demographic-data-analyzer # --description-- -Ви будете працювати над цим проєктом із нашим стартовим кодом Ona. +Ви будете працювати над цим проєктом із нашим шаблонним кодом. -Ми ще розробляємо інтерактивну навчальну частину курсу з Python. Наразі ось кілька відео на каналі freeCodeCamp.org у YouTube, які навчать вас усьому, що потрібно знати для виконання цього проєкту: +Ми ще розробляємо інтерактивну навчальну частину навчальної програми з Python. Поки що ось кілька відео на каналі freeCodeCamp.org на YouTube, які навчать вас усьому, що потрібно знати для виконання цього проєкту: - Відеокурс Python для всіх (14 годин) @@ -54,15 +54,15 @@ dashedName: demographic-data-analyzer ## Відправлення -Скопіюйте URL свого проєкту та надішліть його на freeCodeCamp. +Скопіюйте URL свого проєкту та відправте його на freeCodeCamp. ## Джерело набору даних -Dua, D. and Graff, C. (2019). UCI Machine Learning Repository. Irvine, CA: University of California, School of Information and Computer Science. +Dua, D. та Graff, C. (2019). UCI Machine Learning Repository. Ірвайн, Каліфорнія: Університет Каліфорнії, Школа інформаційних технологій та комп’ютерних наук. # --hints-- -Він має пройти всі тести Python. +Ваша модель має пройти всі тести на Python. ```js diff --git a/curriculum/challenges/ukrainian/blocks/data-analysis-with-python-projects/5e46f7f8ac417301a38fb92a.md b/curriculum/challenges/ukrainian/blocks/data-analysis-with-python-projects/5e46f7f8ac417301a38fb92a.md index 278990a2a46..81cc4f6b4e4 100644 --- a/curriculum/challenges/ukrainian/blocks/data-analysis-with-python-projects/5e46f7f8ac417301a38fb92a.md +++ b/curriculum/challenges/ukrainian/blocks/data-analysis-with-python-projects/5e46f7f8ac417301a38fb92a.md @@ -8,9 +8,9 @@ dashedName: medical-data-visualizer # --description-- -Ви будете працювати над цим проєктом із нашим стартовим кодом Ona. +Ви будете працювати над цим проєктом із нашим шаблонним кодом. -Ми ще розробляємо інтерактивну навчальну частину навчальної програми з Python. Поки що ось кілька відео на каналі freeCodeCamp.org у YouTube, які навчать вас усьому необхідному для виконання цього проєкту: +Ми ще розробляємо інтерактивну навчальну частину навчальної програми з Python. Поки що ось кілька відео на каналі freeCodeCamp.org на YouTube, які навчать вас усьому, що потрібно знати для виконання цього проєкту: - Відеокурс Python для всіх (14 годин) @@ -80,11 +80,11 @@ dashedName: medical-data-visualizer ## Відправлення -Скопіюйте URL свого проєкту і відправте його на freeCodeCamp. +Скопіюйте URL свого проєкту та відправте його на freeCodeCamp. # --hints-- -Він має пройти всі тести Python. +Ваша модель має пройти всі тести на Python. ```js diff --git a/curriculum/challenges/ukrainian/blocks/data-analysis-with-python-projects/5e46f802ac417301a38fb92b.md b/curriculum/challenges/ukrainian/blocks/data-analysis-with-python-projects/5e46f802ac417301a38fb92b.md index 9e2173724f5..0d4d3d60857 100644 --- a/curriculum/challenges/ukrainian/blocks/data-analysis-with-python-projects/5e46f802ac417301a38fb92b.md +++ b/curriculum/challenges/ukrainian/blocks/data-analysis-with-python-projects/5e46f802ac417301a38fb92b.md @@ -8,9 +8,9 @@ dashedName: page-view-time-series-visualizer # --description-- -Ви будете працювати над цим проєктом із нашим стартовим кодом Ona. +Ви будете працювати над цим проєктом із нашим шаблонним кодом. -Ми ще розробляємо інтерактивну навчальну частину навчальної програми з Python. Наразі ось кілька відео на YouTube-каналі freeCodeCamp.org, які навчать вас усьому, що потрібно знати для виконання цього проєкту: +Ми ще розробляємо інтерактивну навчальну частину навчальної програми з Python. Поки що ось кілька відео на каналі freeCodeCamp.org на YouTube, які навчать вас усьому, що потрібно знати для виконання цього проєкту: - Відеокурс Python для всіх (14 годин) @@ -20,7 +20,7 @@ dashedName: page-view-time-series-visualizer Для цього проєкту ви візуалізуєте часові ряди даних за допомогою лінійної діаграми, гістограми та блокових діаграм. Ви використаєте Pandas, Matplotlib і Seaborn для візуалізації набору даних, що містить кількість переглядів сторінок щодня на форумі freeCodeCamp.org з 2016-05-09 по 2019-12-03. Візуалізації допоможуть вам зрозуміти шаблони відвідувань і визначити річний та місячний зріст. -Використайте дані, щоб виконати такі завдання: +Використайте дані для виконання таких завдань: - Використайте Pandas, щоб імпортувати дані з файлу "fcc-forum-pageviews.csv". Встановіть індекс у стовпець `date`. - Очистіть дані, відфільтрувавши дні, коли перегляди сторінок були у верхніх 2,5% або нижніх 2,5% набору даних. @@ -46,7 +46,7 @@ dashedName: page-view-time-series-visualizer # --hints-- -Він має пройти всі тести Python. +Ваша модель має пройти всі тести на Python. ```js diff --git a/curriculum/challenges/ukrainian/blocks/data-analysis-with-python-projects/5e4f5c4b570f7e3a4949899f.md b/curriculum/challenges/ukrainian/blocks/data-analysis-with-python-projects/5e4f5c4b570f7e3a4949899f.md index 72bfe3e0b55..2324e438725 100644 --- a/curriculum/challenges/ukrainian/blocks/data-analysis-with-python-projects/5e4f5c4b570f7e3a4949899f.md +++ b/curriculum/challenges/ukrainian/blocks/data-analysis-with-python-projects/5e4f5c4b570f7e3a4949899f.md @@ -8,9 +8,9 @@ dashedName: sea-level-predictor # --description-- -Ви будете працювати над цим проєктом із нашим стартовим кодом Ona. +Ви будете працювати над цим проєктом із нашим шаблонним кодом. -Ми ще розробляємо інтерактивну навчальну частину навчальної програми з Python. Наразі ось кілька відео на YouTube-каналі freeCodeCamp.org, які навчать вас усьому, що потрібно знати для виконання цього проєкту: +Ми ще розробляємо інтерактивну навчальну частину навчальної програми з Python. Поки що ось кілька відео на каналі freeCodeCamp.org на YouTube, які навчать вас усьому, що потрібно знати для виконання цього проєкту: - Відеокурс Python для всіх (14 годин) @@ -48,7 +48,7 @@ dashedName: sea-level-predictor # --hints-- -Він має пройти всі тести Python. +Ваша модель має пройти всі тести на Python. ```js diff --git a/curriculum/challenges/ukrainian/blocks/information-security-projects/5e46f979ac417301a38fb932.md b/curriculum/challenges/ukrainian/blocks/information-security-projects/5e46f979ac417301a38fb932.md index 643257364a9..c8babcc4020 100644 --- a/curriculum/challenges/ukrainian/blocks/information-security-projects/5e46f979ac417301a38fb932.md +++ b/curriculum/challenges/ukrainian/blocks/information-security-projects/5e46f979ac417301a38fb932.md @@ -1,6 +1,6 @@ --- id: 5e46f979ac417301a38fb932 -title: сканер портів +title: Сканер портів challengeType: 10 forumTopicId: 462372 helpCategory: Python @@ -9,15 +9,15 @@ dashedName: port-scanner # --description-- -Ви будете працювати над цим проєктом із нашим стартовим кодом Ona. +Ви будете працювати над цим проєктом із нашим шаблонним кодом. -Ми ще розробляємо інтерактивну навчальну частину навчальної програми з Python. Поки що ось кілька відео на каналі freeCodeCamp.org у YouTube, які навчать вас усьому, що потрібно знати для виконання цього проєкту: +Ми ще розробляємо інтерактивну навчальну частину навчальної програми з Python. Поки що ось кілька відео на каналі freeCodeCamp.org на YouTube, які навчать вас усьому, що потрібно знати для виконання цього проєкту: - Відеокурс Python для всіх (14 годин) -- Вивчайте основи Python детально (4 години) +- Вивчення основ Python детально (4 години) -- Курс з проміжного Python (6 годин) +- Курс з проміжного рівня Python (6 годин) # --instructions-- @@ -82,7 +82,7 @@ PORT SERVICE # --hints-- -Він має пройти всі тести Python. +Ваша модель має пройти всі тести на Python. ```js diff --git a/curriculum/challenges/ukrainian/blocks/information-security-projects/5e46f983ac417301a38fb933.md b/curriculum/challenges/ukrainian/blocks/information-security-projects/5e46f983ac417301a38fb933.md index 2c20059f7bc..0d0e9bf9cb7 100644 --- a/curriculum/challenges/ukrainian/blocks/information-security-projects/5e46f983ac417301a38fb933.md +++ b/curriculum/challenges/ukrainian/blocks/information-security-projects/5e46f983ac417301a38fb933.md @@ -9,7 +9,7 @@ dashedName: sha-1-password-cracker # --description-- -Ви будете працювати над цим проєктом із нашим стартовим кодом Ona. +Ви будете працювати над цим проєктом із нашим шаблонним кодом. Ми ще розробляємо інтерактивну навчальну частину навчальної програми з Python. Поки що ось кілька відео на каналі freeCodeCamp.org на YouTube, які навчать вас усьому, що потрібно знати для виконання цього проєкту: @@ -55,11 +55,11 @@ dashedName: sha-1-password-cracker ## Відправлення -Скопіюйте URL вашого проєкту і відправте його на freeCodeCamp. +Скопіюйте URL свого проєкту та відправте його на freeCodeCamp. # --hints-- -Він має пройти всі тести Python. +Ваша модель має пройти всі тести на Python. ```js diff --git a/curriculum/challenges/ukrainian/blocks/lab-availability-table/66b36358ed4f261d64840c24.md b/curriculum/challenges/ukrainian/blocks/lab-availability-table/66b36358ed4f261d64840c24.md index ab355f182ca..b424ef16f93 100644 --- a/curriculum/challenges/ukrainian/blocks/lab-availability-table/66b36358ed4f261d64840c24.md +++ b/curriculum/challenges/ukrainian/blocks/lab-availability-table/66b36358ed4f261d64840c24.md @@ -12,18 +12,18 @@ demoType: onClick **Історія користувача:** -1. У вас має бути таблиця щонайменше з трьома стовпцями та п’ятьма рядками, включно із заголовками. -1. Клітинки в першому рядку мають бути заголовками таблиці, що містять дні тижня. -1. Клітинки в першому стовпці мають бути заголовками таблиці з `class` рівним `time` і містити часові значення як текст. -1. Усі клітинки з даними мають мати `class` у форматі `available-#`, де `#` — число від `0` до `5`, що вказує кількість доступних людей у цей час. +1. У вас має бути таблиця з принаймні трьома стовпцями та п’ятьма рядками, включно із заголовками. +1. Перший рядок має містити клітинки заголовків таблиці з назвами днів тижня. +1. Перший стовпець має містити клітинки заголовків таблиці з `class` рівним `time`, які містять часові значення як текст. +1. Усі клітинки даних мають мати `class` у форматі `available-#`, де `#` — число від `0` до `5`, що вказує кількість доступних людей у цей час. 1. Ваша таблиця має містити елемент `caption` з текстом `Weekly Meeting Availability Schedule`. -1. Усі заголовки таблиці в першому рядку (дні тижня) мають мати атрибут `scope` зі значенням `col`. -1. Усі заголовки таблиці в першому стовпці (час) мають мати атрибут `scope` зі значенням `row`. -1. Усі клітинки з класом доступності мають мати атрибут `aria-label`, що описує рівень доступності (наприклад, `0 available` для клітинок з класом `available-0`, `1 available` для `available-1` тощо, і `5+ available` для `available-5`). -1. У вашому селекторі `:root` потрібно визначити шість CSS-змінних з іменами `--color#`, де `#` — число від `0` до `5`, і призначити їм кольорові значення. Використовуйте ці змінні, щоб встановити фон відповідних елементів `.available-#`. -1. У вашому селекторі `:root` потрібно визначити CSS-змінні `--solid-border` і `--dashed-border`. Використовуйте їх для стилізації нижніх кордонів клітинок з даними, чергуючи суцільні та пунктирні кордони залежно від рядка. Присвойте рядкам клас `sharp` або `half` для стилізації. +1. Усі клітинки заголовків таблиці в першому рядку (дні тижня) мають мати атрибут `scope` зі значенням `col`. +1. Усі клітинки заголовків таблиці в першому стовпці (часові клітинки) мають мати атрибут `scope` зі значенням `row`. +1. Усі клітинки даних із класом доступності мають мати атрибут `aria-label`, який описує рівень доступності (наприклад, `0 available` для клітинок `available-0`, `1 available` для `available-1` тощо, і `5+ available` для `available-5`). +1. У вашому селекторі `:root` потрібно визначити шість CSS-змінних з іменами `--color#`, де `#` — число від `0` до `5`, і призначити їм кольорові значення. Використовуйте ці змінні, щоб встановити колір фону відповідних елементів `.available-#`. +1. У вашому селекторі `:root` потрібно визначити CSS-змінні `--solid-border` і `--dashed-border`. Використовуйте ці змінні для стилізації нижніх кордонів клітинок даних, чергуючи суцільні та пунктирні кордони залежно від рядка. Призначте рядкам клас `sharp` або `half` для стилізації. 1. У вас має бути `div` з `id` рівним `legend`. Він має містити `span` з текстом `Availability` та `div` з `id` рівним `legend-gradient`. -1. Елементу `#legend-gradient` потрібно задати лінійний градієнт, що переходить між усіма кольорами від `--color0` до `--color5` з різкими межами. +1. Елементу `#legend-gradient` потрібно задати лінійний градієнт, який переходить між усіма кольорами від `--color0` до `--color5` з чіткими межами. **Примітка:** Обов’язково підключіть свій файл стилів у HTML, щоб застосувати CSS. @@ -389,7 +389,7 @@ headers.forEach(header => { Усі заголовки таблиці в першому стовпці мають мати атрибут `scope` зі значенням `row`. ```js -const timeHeaders = [...document.querySelectorAll('tr > th:first-child')]; +const timeHeaders = [...document.querySelectorAll('th.time')]; assert.isNotEmpty(timeHeaders); timeHeaders.forEach(header => { assert.equal(header.getAttribute('scope'), 'row'); diff --git a/curriculum/challenges/ukrainian/blocks/lab-cargo-manifest-validator/69a56b5069ca99f7317e6e19.md b/curriculum/challenges/ukrainian/blocks/lab-cargo-manifest-validator/69a56b5069ca99f7317e6e19.md index 0428c63409e..9ec5824079d 100644 --- a/curriculum/challenges/ukrainian/blocks/lab-cargo-manifest-validator/69a56b5069ca99f7317e6e19.md +++ b/curriculum/challenges/ukrainian/blocks/lab-cargo-manifest-validator/69a56b5069ca99f7317e6e19.md @@ -11,11 +11,11 @@ dashedName: lab-cargo-manifest-validator Кожен вантажний маніфест буде представлений як об’єкт із такими властивостями: -- `containerId`: додатне ціле число, що ідентифікує відповідний контейнер для вантажу. +- `containerId`: додатне ціле число, що ідентифікує відповідний контейнер з вантажем. - `destination`: непорожній рядок (після обрізання пробілів), що позначає цільове місце призначення вантажу. -- `weight`: додатне число, яке представляє вагу вантажу. -- `unit`: рядок, що описує одиниці виміру ваги вантажу (або `"kg"` для кілограмів, або `"lb"` для фунтів). -- `hazmat`: булеве значення, яке вказує, чи потрібна обробка небезпечних матеріалів. +- `weight`: додатне число, що представляє вагу вантажу. +- `unit`: рядок, який описує одиницю виміру властивості `weight` вантажу (або `"kg"` для кілограмів, або `"lb"` для фунтів). +- `hazmat`: булеве значення, що вказує, чи потрібне поводження з небезпечними матеріалами. Приклад об’єкта вантажного маніфесту: @@ -34,13 +34,13 @@ dashedName: lab-cargo-manifest-validator **Історія користувача:** 1. Ви повинні реалізувати функцію з назвою `normalizeUnits` з параметром `manifest`. - - Функція не повинна змінювати оригінальний об’єкт маніфесту і завжди має повертати новий об’єкт, де `weight` нормалізовано до кілограмів, а `unit` встановлено в `"kg"`. - - Якщо вага в об’єкті маніфесту виражена у фунтах (`unit: "lb"`), функція має конвертувати `weight` у кілограми за приблизним співвідношенням 1 lb = 0.45 kg і відповідно оновити `unit`. - - Якщо вага вже виражена в кілограмах (`unit: "kg"`), `weight` і `unit` мають залишатися без змін. + - Функція не повинна змінювати оригінальний об’єкт manifest і завжди має повертати новий об’єкт, де `weight` нормалізовано до кілограмів, а `unit` встановлено в `"kg"`. + - Якщо `weight` об’єкта manifest виражено у фунтах (`unit: "lb"`), функція має конвертувати `weight` у кілограми, використовуючи приблизне співвідношення `1 lb = 0.45 kg`, і відповідно оновити `unit`. + - Якщо `weight` вже виражено в кілограмах (`unit: "kg"`), `weight` і `unit` мають залишатися без змін. 2. Ви повинні реалізувати функцію з назвою `validateManifest` з параметром `manifest`. - - Функція не повинна змінювати оригінальний об’єкт маніфесту і завжди має повертати новий об’єкт. - - Якщо вхідний маніфест є валідним (немає відсутніх або недійсних властивостей), функція має повертати порожній об’єкт. - - Якщо вхідний маніфест невалідний, функція має повертати об’єкт, що містить записи для кожної відсутньої або недійсної властивості. Відсутні властивості мають значення `"Missing"`, а недійсні — `"Invalid"`. + - Функція не повинна змінювати оригінальний об’єкт manifest і завжди має повертати новий об’єкт. + - Якщо вхідний manifest є дійсним (немає відсутніх або недійсних властивостей), функція має повертати порожній об’єкт. + - Якщо вхідний manifest недійсний, функція має повертати об’єкт, що містить записи для кожної відсутньої або недійсної властивості. Відсутні властивості мають значення `"Missing"`, а недійсні — `"Invalid"`. Приклад поверненого значення, коли вхідний об’єкт не має властивості `destination` і має недійсну властивість `weight`: @@ -51,12 +51,13 @@ dashedName: lab-cargo-manifest-validator } ``` -3. Ви повинні реалізувати функцію з назвою `processManifest` з параметром `manifest`. Функція має виводити в консоль: - - Якщо об’єкт маніфесту валідний, `Validation success: ${containerId}` і потім вагу маніфесту в кілограмах у форматі `Total weight: ${weight} kg`. Для цього використовуйте `normalizeUnits()`. - - Якщо об’єкт маніфесту невалідний, `Validation error: ${containerId}` і потім об’єкт, який повертає виклик `validateManifest()` з об’єктом маніфесту. - **Примітка:** у кожному з цих двох випадків має бути два виклики `console.log()`. +3. Реалізуйте функцію з назвою `processManifest` і параметром `manifest`. Функція має виводити в консоль: + - Якщо об’єкт manifest є валідним, спочатку `Validation success: ${containerId}`, а потім значення `weight` у кілограмах у форматі `Total weight: ${weight} kg`. Для цього використовуйте `normalizeUnits()`. + - Якщо об’єкт manifest невалідний, спочатку `Validation error: ${containerId}`, а потім об’єкт, який повертає виклик `validateManifest()` з цим manifest. -**Примітка:** ні `normalizeUnits`, ні `validateManifest`, ні `processManifest` не слід оголошувати за допомогою `const`, оскільки тести потребують можливості переназначення цих функцій. +**Примітка:** Кожен із цих двох випадків має містити два виклики `console.log()`. + +**Примітка:** Не оголошуйте `normalizeUnits`, `validateManifest` або `processManifest` за допомогою `const`, оскільки тести потребують можливості переназначення цих функцій. # --before-each-- @@ -120,7 +121,7 @@ console.log = () => {}; # --hints-- -Ні `normalizeUnits`, ні `validateManifest`, ні `processManifest` не слід оголошувати за допомогою `const`, оскільки тести потребують можливості переназначення цих функцій. +Ви не повинні оголошувати `normalizeUnits`, `validateManifest` або `processManifest` за допомогою `const`, оскільки тести потребують можливості переназначення цих функцій. ```js assert.doesNotThrow(() => { @@ -140,12 +141,12 @@ assert.equal(params.length, 1); assert.equal(params[0].toString(), 'manifest'); ``` -Виклик `normalizeUnits()` з `{ containerId: 68, destination: "Salinas", weight: 101, unit: "lb", hazmat: true }` має повертати новий об’єкт `{ containerId: 68, destination: "Salinas", weight: 45.45, unit: "kg", hazmat: true }` без зміни вхідних даних. +Ваша функція `normalizeUnits` має повертати новий об’єкт `{ containerId: 68, destination: "Salinas", weight: 45.45, unit: "kg", hazmat: true }` при виклику з `{ containerId: 68, destination: "Salinas", weight: 101, unit: "lb", hazmat: true }`, не змінюючи оригінал. ```js const testObj = { containerId: 68, - destination: "Salinas", + destination: "Salinas", weight: 101, unit: "lb", hazmat: true @@ -161,7 +162,7 @@ const expected = { const copy = normalizeUnits(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "normalizeUnits() did not return the expected normalized object"); +assert.deepEqual(copy, expected, "normalizeUnits() did not return the expected normalized object."); assert.notStrictEqual(copy, testObj, "normalizeUnits() should return a new object."); assert.strictEqual(testObj.containerId, 68, "Original object should not be mutated."); assert.strictEqual(testObj.destination, "Salinas", "Original object should not be mutated."); @@ -171,13 +172,13 @@ assert.strictEqual(testObj.hazmat, true, "Original object should not be mutated. assert.equal(Object.keys(testObj).length, 5, "Original object should not be mutated."); ``` -Ваша функція `normalizeUnits` має повертати копію вхідного об’єкта маніфесту з нормалізованою `weight` до кілограмів і `unit`, встановленою в `"kg"`. Для конвертації ваги використовуйте приблизне співвідношення `1 lb = 0.45 kg`. +Ваша функція `normalizeUnits` має повертати копію вхідного об’єкта manifest із нормалізованою до кілограмів властивістю `weight` та встановленою властивістю `unit` у значення `"kg"`. Для конвертації `weight` використовуйте приблизне співвідношення `1 lb = 0.45 kg`. ```js _validManifests.forEach((obj, i) => { const result = normalizeUnits(obj); - assert.isObject(result, "normalizeUnits should return an object"); - assert.notStrictEqual(result, obj, "normalizeUnits must return a new object, not modify the original"); + assert.isObject(result, "normalizeUnits() should return an object."); + assert.notStrictEqual(result, obj, "normalizeUnits() should return a new object, not mutate the original."); const expectedWeight = obj.unit === "lb" ? obj.weight * 0.45 : obj.weight; const expected = { ...obj, @@ -188,12 +189,12 @@ _validManifests.forEach((obj, i) => { assert.deepEqual( result, expected, - `normalizeUnits did not return the expected normalized object for manifest at index ${i}` + `normalizeUnits() did not return the expected normalized object for manifest at index ${i}.` ); }); ``` -Ваша функція `normalizeUnits` має повертати нову копію вхідного об’єкта `manifest` без зміни оригіналу. +Ваша функція `normalizeUnits` має повертати нову копію вхідного об’єкта manifest, не змінюючи оригінал. ```js const original = { @@ -231,12 +232,12 @@ assert.equal(params.length, 1); assert.equal(params[0].toString(), 'manifest'); ``` -Виклик `validateManifest()` з `{ containerId: 1, destination: "Santa Cruz", weight: 304, unit: "kg", hazmat: false }` має повертати новий об’єкт `{}`. +Ваша функція `validateManifest` має повертати новий порожній об’єкт `{}` при виклику з `{ containerId: 1, destination: "Santa Cruz", weight: 304, unit: "kg", hazmat: false }`. ```js const testObj = { containerId: 1, - destination: "Santa Cruz", + destination: "Santa Cruz", weight: 304, unit: "kg", hazmat: false @@ -246,16 +247,16 @@ const expected = {}; const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for a valid manifest"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.strictEqual(testObj.containerId, 1, "Original object should not be mutated"); -assert.strictEqual(testObj.destination, "Santa Cruz", "Original object should not be mutated"); -assert.strictEqual(testObj.weight, 304, "Original object should not be mutated"); -assert.strictEqual(testObj.unit, "kg", "Original object should not be mutated"); -assert.strictEqual(testObj.hazmat, false, "Original object should not be mutated"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for a valid manifest."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.strictEqual(testObj.containerId, 1, "Original object should not be mutated."); +assert.strictEqual(testObj.destination, "Santa Cruz", "Original object should not be mutated."); +assert.strictEqual(testObj.weight, 304, "Original object should not be mutated."); +assert.strictEqual(testObj.unit, "kg", "Original object should not be mutated."); +assert.strictEqual(testObj.hazmat, false, "Original object should not be mutated."); ``` -Якщо вхідний об’єкт маніфесту валідний, ваша функція `validateManifest` має повертати порожній об’єкт `{}`. +Ваша функція `validateManifest` має повертати порожній об’єкт `{}`, якщо вхідний об’єкт manifest є дійсним. ```js const solution = {}; @@ -268,7 +269,7 @@ for (const obj of _validManifests) { } ``` -Виклик `validateManifest()` з `{}` має повертати новий об’єкт `{ containerId: "Missing", destination: "Missing", weight: "Missing", unit: "Missing", hazmat: "Missing" }` без зміни вхідних даних. +Ваша функція `validateManifest` має повертати новий об’єкт `{ containerId: "Missing", destination: "Missing", weight: "Missing", unit: "Missing", hazmat: "Missing" }` при виклику з `{}`, не змінюючи оригінал. ```js const testObj = {}; @@ -283,12 +284,12 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for missing properties"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.equal(Object.keys(testObj).length, 0, "validateManifest() should return a new object, not mutate the original"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for missing properties."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.equal(Object.keys(testObj).length, 0, "validateManifest() should return a new object, not mutate the original."); ``` -Виклик `validateManifest()` з `{ containerId: null, destination: "Santa Cruz", weight: 304, unit: "kg", hazmat: false }` має повертати новий об’єкт `{ containerId: "Invalid" }` без зміни вхідних даних. +Ваша функція `validateManifest` має повертати новий об’єкт `{ containerId: "Invalid" }` при виклику з `{ containerId: null, destination: "Santa Cruz", weight: 304, unit: "kg", hazmat: false }`, не змінюючи оригінал. ```js const testObj = { @@ -305,11 +306,11 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for null containerId"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for null containerId."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); ``` -Виклик `validateManifest()` з `{ containerId: 0, destination: 405, weight: -84, unit: "pounds", hazmat: "no" }` має повертати новий об’єкт `{ containerId: "Invalid", destination: "Invalid", weight: "Invalid", unit: "Invalid", hazmat: "Invalid" }` без зміни вхідних даних. +Ваша функція `validateManifest` має повертати новий об’єкт `{ containerId: "Invalid", destination: "Invalid", weight: "Invalid", unit: "Invalid", hazmat: "Invalid" }` при виклику з `{ containerId: 0, destination: 405, weight: -84, unit: "pounds", hazmat: "no" }`, не змінюючи оригінал. ```js const testObj = { @@ -330,16 +331,16 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid properties"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.strictEqual(testObj.containerId, 0, "Original object should not be mutated"); -assert.strictEqual(testObj.destination, 405, "Original object should not be mutated"); -assert.strictEqual(testObj.weight, -84, "Original object should not be mutated"); -assert.strictEqual(testObj.unit, "pounds", "Original object should not be mutated"); -assert.strictEqual(testObj.hazmat, "no", "Original object should not be mutated"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid properties."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.strictEqual(testObj.containerId, 0, "Original object should not be mutated."); +assert.strictEqual(testObj.destination, 405, "Original object should not be mutated."); +assert.strictEqual(testObj.weight, -84, "Original object should not be mutated."); +assert.strictEqual(testObj.unit, "pounds", "Original object should not be mutated."); +assert.strictEqual(testObj.hazmat, "no", "Original object should not be mutated."); ``` -Виклик `validateManifest()` з `{ containerId: -2 }` має повертати новий об’єкт `{ containerId: "Invalid", destination: "Missing", weight: "Missing", unit: "Missing", hazmat: "Missing" }` без зміни вхідних даних. +Ваша функція `validateManifest` має повертати новий об’єкт `{ containerId: "Invalid", destination: "Missing", weight: "Missing", unit: "Missing", hazmat: "Missing" }` при виклику з `{ containerId: -2 }`, не змінюючи оригінал. ```js const testObj = { @@ -356,13 +357,13 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.strictEqual(testObj.containerId, -2, "Original object should not be mutated"); -assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.strictEqual(testObj.containerId, -2, "Original object should not be mutated."); +assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated."); ``` -Виклик `validateManifest()` з `{ containerId: 3.50 }` має повертати новий об’єкт `{ containerId: "Invalid", destination: "Missing", weight: "Missing", unit: "Missing", hazmat: "Missing" }` без зміни вхідних даних. Ви можете використовувати `Number.isInteger()` для перевірки цілих чисел. +Ваша функція `validateManifest` має повертати новий об’єкт `{ containerId: "Invalid", destination: "Missing", weight: "Missing", unit: "Missing", hazmat: "Missing" }` при виклику з `{ containerId: 3.50 }`, не змінюючи оригінал. Ви можете використовувати `Number.isInteger()` для перевірки цілих чисел. ```js const testObj = { @@ -379,13 +380,13 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.strictEqual(testObj.containerId, 3.50, "Original object should not be mutated"); -assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.strictEqual(testObj.containerId, 3.50, "Original object should not be mutated."); +assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated."); ``` -Виклик `validateManifest()` з `{ destination: " " }` має повертати новий об’єкт `{ containerId: "Missing", destination: "Invalid", weight: "Missing", unit: "Missing", hazmat: "Missing" }` без зміни вхідних даних. Ви можете використовувати `String.trim()` для видалення пробілів із рядка. +Ваша функція `validateManifest` має повертати новий об’єкт `{ containerId: "Missing", destination: "Invalid", weight: "Missing", unit: "Missing", hazmat: "Missing" }` при виклику з `{ destination: " " }`, не змінюючи оригінал. Ви можете використовувати `.trim()` для видалення пробілів з рядка. ```js const testObj = { @@ -402,13 +403,13 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.strictEqual(testObj.destination, " ", "Original object should not be mutated"); -assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.strictEqual(testObj.destination, " ", "Original object should not be mutated."); +assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated."); ``` -Виклик `validateManifest()` з `{ weight: NaN }` має повертати новий об’єкт `{ containerId: "Missing", destination: "Missing", weight: "Invalid", unit: "Missing", hazmat: "Missing" }` без зміни вхідних даних. Ви можете використовувати `Number.isNaN()` для перевірки значень NaN. +Ваша функція `validateManifest` має повертати новий об’єкт `{ containerId: "Missing", destination: "Missing", weight: "Invalid", unit: "Missing", hazmat: "Missing" }` при виклику з `{ weight: NaN }`, не змінюючи оригінал. Ви можете використовувати `Number.isNaN()` для перевірки значень `NaN`. ```js const testObj = { @@ -425,13 +426,13 @@ const expected = { const copy = validateManifest(testObj); assert.isObject(copy); -assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties"); -assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original"); -assert.ok(Number.isNaN(testObj.weight), "Original object should not be mutated"); -assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated"); +assert.deepEqual(copy, expected, "validateManifest() did not return the expected object for invalid and missing properties."); +assert.notStrictEqual(copy, testObj, "validateManifest() should return a new object, not mutate the original."); +assert.ok(Number.isNaN(testObj.weight), "Original object should not be mutated."); +assert.equal(Object.keys(testObj).length, 1, "Original object should not be mutated."); ``` -Якщо вхідний об’єкт маніфесту невалідний, ваша функція `validateManifest` має повертати об’єкт, що описує відсутні та/або недійсні властивості. +Ваша функція `validateManifest` має повертати об’єкт, що описує відсутні та/або недійсні властивості, якщо вхідний об’єкт manifest недійсний. ```js const solutions = [ @@ -504,7 +505,7 @@ assert.equal(params.length, 1); assert.equal(params[0].toString(), 'manifest'); ``` -Виклик `processManifest()` з `{ containerId: 55, destination: "Carmel", weight: 400, unit: "lb", hazmat: false }` має спочатку вивести `"Validation success: 55"`, а потім `"Total weight: 180 kg"`. +Ваша функція `processManifest` має спочатку вивести в консоль `Validation success: 55`, а потім `Total weight: 180 kg` при виклику з `{ containerId: 55, destination: "Carmel", weight: 400, unit: "lb", hazmat: false }`. ```js const testObj = { @@ -524,8 +525,8 @@ try { ["Validation success: 55"], ["Total weight: 180 kg"] ]; - assert.deepEqual(spy.calls[0], expectedCalls[0], "First log should be the validation success message"); - assert.deepEqual(spy.calls[1], expectedCalls[1], "Second log should be the normalized weight in kg"); + assert.deepEqual(spy.calls[0], expectedCalls[0], "First log should be the validation success message."); + assert.deepEqual(spy.calls[1], expectedCalls[1], "Second log should be the normalized weight in kg."); } catch (err) { assert.fail(err); @@ -534,7 +535,7 @@ try { } ``` -Якщо вхідний об’єкт маніфесту валідний, ваша функція `processManifest` має спочатку вивести повідомлення про успіх `Validation success: ${containerId}`. +Ваша функція `processManifest` має спочатку вивести повідомлення про успіх, `Validation success: ${containerId}`, якщо вхідний об’єкт manifest є дійсним. ```js const testObj = { @@ -562,7 +563,7 @@ try { } ``` -Якщо вхідний об’єкт маніфесту валідний, ваша функція `processManifest` має нормалізувати його до кілограмів за допомогою `normalizeUnits()`, а потім вивести: `Total weight: ${weight} kg`. +Ваша функція `processManifest` має нормалізувати дійсний вхідний об’єкт manifest у кілограми за допомогою `normalizeUnits()` і потім вивести `Total weight: ${weight} kg`. ```js const testObj = { @@ -590,7 +591,7 @@ try { } ``` -Якщо вхідний об’єкт маніфесту валідний, ваша функція `processManifest` має вивести повідомлення про успіх із `containerId` об’єкта, а потім вивести `weight` об’єкта в кілограмах. Для конвертації використовуйте `normalizeUnits()` і зробіть два виклики `console.log()`. +Ваша функція `processManifest` повинна виводити повідомлення про успішну перевірку з `containerId` об’єкта, а потім виводити його `weight` у кілограмах, якщо вхідний об’єкт маніфесту є коректним. Для цього потрібно використовувати `normalizeUnits()`, і це має бути реалізовано двома викликами `console.log()`. ```js const originalNormalize = normalizeUnits; @@ -605,7 +606,7 @@ try { assert.isTrue( called, - "processManifest should call normalizeUnits() when the manifest is valid" + "processManifest() should call normalizeUnits() when the manifest is valid." ); } catch (err) { @@ -635,7 +636,7 @@ try { } ``` -Виклик `processManifest()` з `{ containerId: -88, destination: "Soledad", weight: NaN }` має спочатку вивести `Validation error: -88`, а потім об’єкт `{ containerId: "Invalid", weight: "Invalid", unit: "Missing", hazmat: "Missing" }`. +Ваша функція `processManifest` має спочатку вивести `Validation error: -88`, а потім об’єкт `{ containerId: "Invalid", weight: "Invalid", unit: "Missing", hazmat: "Missing" }` при виклику з `{ containerId: -88, destination: "Soledad", weight: NaN }`. ```js const testObj = { @@ -658,8 +659,8 @@ try { }] ]; - assert.deepEqual(spy.calls[0], expectedCalls[0], "First log should be the validation error message"); - assert.deepEqual(spy.calls[1], expectedCalls[1], "Second log should be the validation result object"); + assert.deepEqual(spy.calls[0], expectedCalls[0], "First log should be the validation error message."); + assert.deepEqual(spy.calls[1], expectedCalls[1], "Second log should be the validation result object."); } catch (err) { assert.fail(err); @@ -668,7 +669,7 @@ try { } ``` -Виклик `processManifest()` з `{ destination: "Watsonville", hazmat: true }` має спочатку вивести `Validation error: undefined`, а потім об’єкт `{ containerId: "Missing", weight: "Missing", unit: "Missing" }`. +Ваша функція `processManifest` має спочатку вивести `Validation error: undefined`, а потім об’єкт `{ containerId: "Missing", weight: "Missing", unit: "Missing" }` при виклику з `{ destination: "Watsonville", hazmat: true }`. ```js const testObj = { @@ -689,8 +690,8 @@ try { }] ]; - assert.deepEqual(spy.calls[0], expectedCalls[0], "First log should be the validation error message"); - assert.deepEqual(spy.calls[1], expectedCalls[1], "Second log should be the validation result object"); + assert.deepEqual(spy.calls[0], expectedCalls[0], "First log should be the validation error message."); + assert.deepEqual(spy.calls[1], expectedCalls[1], "Second log should be the validation result object."); } catch (err) { assert.fail(err); @@ -699,7 +700,7 @@ try { } ``` -Якщо вхідний об’єкт маніфесту невалідний, ваша функція `processManifest` має спочатку вивести повідомлення про помилку `Validation error: ${containerId}`. +Ваша функція `processManifest` має спочатку вивести повідомлення про помилку, `Validation error: ${containerId}`, якщо вхідний об’єкт manifest недійсний. ```js const spy = __helpers.spyOn(console, "log"); @@ -718,13 +719,13 @@ try { assert.deepEqual(spy.calls[0], expectedCalls[0]); } catch (err) { - assert.fail(err); + assert.fail(err); } finally { spy.restore(); } ``` -Якщо вхідний об’єкт маніфесту невалідний, ваша функція `processManifest` також має вивести об’єкт, який повертає виклик `validateManifest()` з оригінальним об’єктом маніфесту. Викликайте `console.log()` безпосередньо з отриманим об’єктом. +Ваша функція `processManifest` також має вивести об’єкт, який повертається викликом `validateManifest()` з оригінальним об’єктом manifest, якщо вхідний об’єкт manifest недійсний. Викликайте `console.log()` безпосередньо з поверненим об’єктом. ```js const originalValidate = validateManifest; @@ -740,7 +741,7 @@ try { assert.isTrue( called, - "processManifest should call validateManifest() when the manifest is invalid" + "processManifest() should call validateManifest() when the manifest is invalid." ); } catch (err) { @@ -765,13 +766,13 @@ try { assert.deepEqual(spy.calls[1], expectedCalls[1]); } catch (err) { - assert.fail(err); + assert.fail(err); } finally { spy.restore(); } ``` -Якщо вхідний об’єкт маніфесту невалідний, ваша функція `processManifest` має вивести повідомлення про помилку з `containerId` об’єкта, а потім вивести об’єкт, який повертає виклик `validateManifest()` з вхідним об’єктом. Це має включати два виклики `console.log()`. +Ваша функція `processManifest` має вивести повідомлення про помилку з `containerId` об’єкта, а потім вивести об’єкт, який повертається викликом `validateManifest()` з вхідним об’єктом, якщо вхідний об’єкт manifest недійсний. Це має включати два виклики `console.log()`. ```js const originalValidate = validateManifest; @@ -787,7 +788,7 @@ try { assert.isTrue( called, - "processManifest should call validateManifest() when the manifest is invalid" + "processManifest() should call validateManifest() when the manifest is invalid." ); } catch (err) { @@ -812,7 +813,7 @@ try { assert.deepEqual(spy.calls, expectedCalls); } catch (err) { - assert.fail(err); + assert.fail(err); } finally { spy.restore(); } diff --git a/curriculum/challenges/ukrainian/blocks/lab-digital-pet-game/68c362b379059c388d3874f2.md b/curriculum/challenges/ukrainian/blocks/lab-digital-pet-game/68c362b379059c388d3874f2.md index b05be38af74..fd73ef721b6 100644 --- a/curriculum/challenges/ukrainian/blocks/lab-digital-pet-game/68c362b379059c388d3874f2.md +++ b/curriculum/challenges/ukrainian/blocks/lab-digital-pet-game/68c362b379059c388d3874f2.md @@ -11,7 +11,7 @@ saveSubmissionToDB: true **Мета:** Виконайте наведені нижче історії користувача та пройдіть усі тести, щоб завершити лабораторну роботу. -**Історії користувача:** +**Історія користувача:** Застосунок має мати два вигляди. Вимоги до кожного вигляду охоплені рештою історій користувача: @@ -60,6 +60,7 @@ saveSubmissionToDB: true ```js globalThis._PET_NAME = 'Fitzgerald'; globalThis._clock = __FakeTimers.install(); +window.fetch = () => Promise.resolve({ json: () => Promise.resolve('Cats sleep for around 13 to 16 hours a day.') }); ``` # --after-all-- diff --git a/curriculum/challenges/ukrainian/blocks/lab-fcc-forum-leaderboard/673c91f0b934834bc4a3ecc2.md b/curriculum/challenges/ukrainian/blocks/lab-fcc-forum-leaderboard/673c91f0b934834bc4a3ecc2.md index 13cad965489..663d7bcc751 100644 --- a/curriculum/challenges/ukrainian/blocks/lab-fcc-forum-leaderboard/673c91f0b934834bc4a3ecc2.md +++ b/curriculum/challenges/ukrainian/blocks/lab-fcc-forum-leaderboard/673c91f0b934834bc4a3ecc2.md @@ -52,7 +52,7 @@ demoType: onClick **Мета:** Виконайте наведені нижче історії користувача та пройдіть усі тести, щоб завершити лабораторну роботу. -**Історії користувача:** +**Історія користувача:** 1. Ви повинні мати функцію з іменем `timeAgo`, яка приймає часову позначку у форматі ISO 8601 як аргумент. 1. Функція `timeAgo` повинна обчислювати різницю часу між переданим аргументом і поточним часом і повертати: @@ -93,6 +93,68 @@ demoType: onClick 1. Функція `fetchData` повинна робити запит даних із `forumLatest` і викликати `showLatestPosts`, передаючи їй відповідь, проаналізовану як JSON. 1. Якщо під час отримання даних виникає помилка, функція `fetchData` повинна вивести помилку в консоль. Для цього слід спеціально використовувати `console.log`. +# --before-all-- + +```js +const _testUsers = [ + { + avatar_template: '/user_avatar/QuincyLarson_{size}.png', + id: 6, + name: 'Quincy Larson', + username: 'QuincyLarson' + }, + { + avatar_template: '/user_avatar/jwilkins.oboe_{size}.png', + id: 285941, + name: 'Jessica Wilkins', + username: 'jwilkins.oboe' + }, + { + avatar_template: '/user_avatar/ilenia_{size}.png', + id: 170865, + name: 'Ilenia', + username: 'ilenia' + } +]; + +const _testPosters = [ + { user_id: 6 }, + { user_id: 285941 }, + { user_id: 170865 } +]; + +const _testData = { + users: _testUsers, + topic_list: { + topics: [ + { + bumped_at: '2024-04-15T16:01:26.403Z', + category_id: 1, + id: 684569, + posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], + posts_count: 8, + slug: 'the-freecodecamp-podcast-is-back-now-with-video', + title: 'The freeCodeCamp Podcast is back – now with video', + views: 542 + }, + { + bumped_at: '2024-04-19T13:52:03.523Z', + category_id: 421, + id: 686149, + posters: [{ user_id: 170865 }], + posts_count: 1, + slug: 'problem-with-making-changes-to-styles-js', + title: 'Problem with making changes to styles. (JS)', + views: 9 + } + ] + } +}; + +window.fetch = () => + Promise.resolve({ json: () => Promise.resolve(_testData) }); +``` + # --hints-- Ви повинні мати функцію з іменем `timeAgo`, яка приймає один аргумент. @@ -297,31 +359,8 @@ assert.lengthOf(avatars, 2); Функція `avatars` має повертати рядок, утворений об’єднанням `img` елементів, по одному для кожного дописувача, знайденого в масиві користувачів. ```js -const posters = [{ user_id: 6 }, { user_id: 285941 }, { user_id: 170865 }]; -const users = [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - }, - { id: 20 } -]; +const posters = _testPosters; +const users = [..._testUsers, { id: 20 }]; const actual = avatars(posters, users); const matches = actual.match(/<\s*img\s+.+?>/g); assert.lengthOf(matches, 3); @@ -330,31 +369,8 @@ assert.lengthOf(matches, 3); Кожен елемент `img` у рядку, поверненому функцією `avatars`, повинен мати текст `alt` зі значенням властивості `name` дописувача. ```js -const posters = [{ user_id: 6 }, { user_id: 285941 }, { user_id: 170865 }]; -const users = [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - }, - { id: 20 } -]; +const posters = _testPosters; +const users = [..._testUsers, { id: 20 }]; const actual = avatars(posters, users); const matches = actual.match(/<\s*img\s+.+?>/g); @@ -366,31 +382,8 @@ assert.match(matches[2], /alt=('|")Ilenia\1/); Функція `avatars` повинна встановити розмір кожного аватара, отримуючи доступ до властивості `avatar_template` і замінюючи `{size}` на `30`. ```js -const posters = [{ user_id: 6 }, { user_id: 285941 }, { user_id: 170865 }]; -const users = [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - }, - { id: 20 } -]; +const posters = _testPosters; +const users = [..._testUsers, { id: 20 }]; const actual = avatars(posters, users); assert.notMatch(actual, /\{size\}/); assert.lengthOf(actual.match(/_30/g), 3); @@ -399,31 +392,8 @@ assert.lengthOf(actual.match(/_30/g), 3); Кожен елемент `img` повинен мати атрибут `src`, встановлений у значення `avatar_template` відповідного користувача. Якщо `avatar_template` починається з `/`, додайте `avatarUrl` безпосередньо перед ним. ```js -const posters = [{ user_id: 6 }, { user_id: 285941 }, { user_id: 170865 }]; -const users = [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - }, - { id: 20 } -]; +const posters = _testPosters; +const users = [..._testUsers, { id: 20 }]; const actual = avatars(posters, users); const matches = actual.match(/<\s*img\s+.+?>/g); @@ -458,19 +428,15 @@ assert.isFunction(fetchData); Ваша функція `fetchData` повинна робити запит даних із `https://cdn.freecodecamp.org/curriculum/forum-latest/latest.json`. ```js -const testArr = []; -const temp = fetch; +const spy = __helpers.spyOn(window, 'fetch'); try { - fetch = source => { - testArr.push(source); - return temp(source); - }; fetchData(); - assert.deepEqual(testArr, [ + assert.include( + spy.calls.map(call => call[0]), 'https://cdn.freecodecamp.org/curriculum/forum-latest/latest.json' - ]); + ); } finally { - fetch = temp; + spy.restore(); } ``` @@ -521,55 +487,7 @@ async () => { `showLatestPosts` має встановити внутрішній HTML `#posts-container` у рядок, утворений об’єднанням `tr` елементів, по одному для кожного елемента в `topics`. ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const pContainer = document.getElementById('posts-container'); pContainer.innerHTML = ''; showLatestPosts(data); @@ -579,55 +497,7 @@ assert.lengthOf(pContainer.querySelectorAll('tr'), 2); Кожен елемент `tr` із рядка, поверненого функцією `showLatestPosts`, повинен містити 5 елементів `td`. ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const pContainer = document.getElementById('posts-container'); pContainer.innerHTML = ''; showLatestPosts(data); @@ -638,55 +508,7 @@ assert.lengthOf(pContainer.querySelectorAll('tr:last-child>td'), 5); Перший елемент `td` кожного рядка таблиці з рядка, поверненого функцією `showLatestPosts`, повинен містити два елементи посилання: перший із класом `post-title`, атрибутом `href` зі значенням `/`, текстом посилання ``, а другий отриманий викликом `forumCategory` з `category_id`. ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const pContainer = document.getElementById('posts-container'); pContainer.innerHTML = ''; showLatestPosts(data); @@ -731,55 +553,7 @@ assert.equal( Другий елемент `td` кожного рядка таблиці з рядка, поверненого функцією `showLatestPosts`, повинен містити зображення, повернені функцією `avatars`, викликаною з аргументами `posters` і `users`, вкладені в елемент `div` з класом `avatar-container`. ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const pContainer = document.getElementById('posts-container'); pContainer.innerHTML = ''; showLatestPosts(data); @@ -820,55 +594,7 @@ assert.equal(imgs2[0].alt, 'Ilenia'); Третій елемент `td` кожного рядка таблиці з рядка, поверненого функцією `showLatestPosts`, повинен містити кількість відповідей на допис. _Підказка:_ використовуйте `posts_count - 1`. ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const pContainer = document.getElementById('posts-container'); pContainer.innerHTML = ''; showLatestPosts(data); @@ -887,55 +613,7 @@ assert.equal( Четвертий елемент `td` кожного рядка таблиці з рядка, поверненого функцією `showLatestPosts`, повинен містити кількість переглядів допису. ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const pContainer = document.getElementById('posts-container'); pContainer.innerHTML = ''; showLatestPosts(data); @@ -954,55 +632,7 @@ assert.equal( П’ятий елемент `td` кожного рядка таблиці з рядка, поверненого функцією `showLatestPosts`, повинен містити час, що минув від останньої активності, згенерований за допомогою функції `timeAgo`. ```js -const data = { - users: [ - { - avatar_template: - '/user_avatar/QuincyLarson_{size}.png', - id: 6, - name: 'Quincy Larson', - username: 'QuincyLarson' - }, - { - avatar_template: - '/user_avatar/jwilkins.oboe_{size}.png', - id: 285941, - name: 'Jessica Wilkins', - username: 'jwilkins.oboe' - }, - { - avatar_template: - '/user_avatar/ilenia_{size}.png', - id: 170865, - name: 'Ilenia', - username: 'ilenia' - } - ], - topic_list: { - topics: [ - { - bumped_at: '2024-04-15T16:01:26.403Z', - category_id: 1, - id: 684569, - posters: [{ user_id: 6 }, { user_id: 170865 }, { user_id: 285941 }], - posts_count: 8, - slug: 'the-freecodecamp-podcast-is-back-now-with-video', - title: 'The freeCodeCamp Podcast is back – now with video', - views: 542 - }, - { - bumped_at: '2024-04-19T13:52:03.523Z', - category_id: 421, - id: 686149, - posters: [{ user_id: 170865 }], - posts_count: 1, - slug: 'problem-with-making-changes-to-styles-js', - title: 'Problem with making changes to styles. (JS)', - views: 9 - } - ] - } -}; +const data = _testData; const calcTime = time => { const currentTime = new Date(); const lastPost = new Date(time); diff --git a/curriculum/challenges/ukrainian/blocks/lab-javascript-trivia-bot/66ed41f912d0bb1dc62da5dd.md b/curriculum/challenges/ukrainian/blocks/lab-javascript-trivia-bot/66ed41f912d0bb1dc62da5dd.md index 77d547228dd..b32b14bf50f 100644 --- a/curriculum/challenges/ukrainian/blocks/lab-javascript-trivia-bot/66ed41f912d0bb1dc62da5dd.md +++ b/curriculum/challenges/ukrainian/blocks/lab-javascript-trivia-bot/66ed41f912d0bb1dc62da5dd.md @@ -11,17 +11,17 @@ dashedName: lab-javascript-trivia-bot **Історія користувача:** -1. Ви повинні вивести `"Hello! I'm your coding fun fact guide!"` у консоль як привітальне повідомлення для користувача. -1. Ви повинні оголосити три змінні: `botName`, `botLocation` і `favoriteLanguage`, які зберігатимуть ім’я бота, звідки він, а також його улюблену мову програмування відповідно. -1. Ви повинні вивести `"My name is (botName) and I live on (botLocation)."` у консоль. -1. Ви повинні вивести `"My favorite programming language is (favoriteLanguage)."` у консоль. -1. Ви повинні використати `let` для створення змінної `codingFact` і призначити їй рядок із цікавою інформацією про улюблену мову програмування вашого бота, включаючи використання змінної `favoriteLanguage`. -1. Ви повинні вивести `codingFact` у консоль. -1. Ви повинні повторно призначити змінну `codingFact` новим фактом про улюблену мову бота, знову використовуючи змінну `favoriteLanguage`. -1. Ви повинні знову вивести `codingFact` у консоль. -1. Ви повинні знову призначити змінну `codingFact` ще одним новим фактом про улюблену мову бота, використовуючи змінну `favoriteLanguage`. -1. Ви повинні втретє вивести `codingFact` у консоль. -1. Ви повинні вивести `"It was fun sharing these facts with you. Goodbye! - (botName) from (botLocation)."` у консоль як прощальне повідомлення від бота. +1. Ви повинні вивести в консоль повідомлення-привітання для користувача: `"Hello! I'm your coding fun fact guide!"`. +1. Ви повинні створити три змінні: `botName`, `botLocation` та `favoriteLanguage`, які зберігатимуть ім'я бота, звідки він, а також його улюблену мову програмування відповідно. +1. Ви повинні вивести в консоль рядок `"My name is (botName) and I live on (botLocation)."`. +1. Ви повинні вивести в консоль рядок `"My favorite programming language is (favoriteLanguage)."`. +1. Ви повинні використати `let` для створення змінної `codingFact` і призначити їй рядок із цікавою інформацією про улюблену мову програмування бота, використовуючи змінну `favoriteLanguage`. +1. Ви повинні вивести в консоль значення `codingFact`. +1. Ви повинні переназначити змінну `codingFact` на новий факт про улюблену мову програмування бота, знову використовуючи змінну `favoriteLanguage`. +1. Ви повинні знову вивести в консоль значення `codingFact`. +1. Ви повинні переназначити змінну `codingFact` на третій факт про улюблену мову програмування бота, знову використовуючи змінну `favoriteLanguage`. +1. Ви повинні втретє вивести в консоль значення `codingFact`. +1. Ви повинні вивести в консоль прощальне повідомлення від бота: `"It was fun sharing these facts with you. Goodbye! - (botName) from (botLocation)."`. # --before-each-- @@ -162,7 +162,7 @@ let codingFact = "Did you know that " + favoriteLanguage + " was created in just console.log(codingFact); -codingFact = "Another fun fact: " + favoriteLanguage + "was originally called Mocha!"; +codingFact = "Another fun fact: " + favoriteLanguage + " was originally called Mocha!"; console.log(codingFact); diff --git a/curriculum/challenges/ukrainian/blocks/lab-mood-board/673b3d6b7ef7318eef926d5a.md b/curriculum/challenges/ukrainian/blocks/lab-mood-board/673b3d6b7ef7318eef926d5a.md index bfa3eed0532..7574cd235fe 100644 --- a/curriculum/challenges/ukrainian/blocks/lab-mood-board/673b3d6b7ef7318eef926d5a.md +++ b/curriculum/challenges/ukrainian/blocks/lab-mood-board/673b3d6b7ef7318eef926d5a.md @@ -14,18 +14,18 @@ demoType: onClick **Мета:** Виконайте наведені нижче історії користувача та пройдіть усі тести, щоб завершити лабораторну роботу. -**Історії користувача:** +**Історія користувача:** -1. Ви повинні створити та експортувати компонент `MoodBoardItem`, який приймає три пропси: `color`, `image` і `description`. +1. Ви повинні створити та експортувати компонент `MoodBoardItem`, який приймає три пропси: `color`, `image` та `description`. 2. Ваш компонент `MoodBoardItem` має повертати `div` з класом `mood-board-item` як свій верхній елемент. -3. Ви повинні встановити колір фону елемента `.mood-board-item` у значення пропса `color` за допомогою рядкових стилів. -4. Ви повинні відтворити елемент `img` з класом `mood-board-image` і атрибутом `src`, встановленим у значення пропса `image`, всередині елемента `.mood-board-item`. -5. Ви повинні відтворити елемент `h3` з класом `mood-board-text` і текстом, що дорівнює значенню пропса `description`, всередині елемента `.mood-board-item`. -6. Ви повинні створити та експортувати `MoodBoard`. +3. Ви повинні встановити колір фону елемента `.mood-board-item` відповідно до значення пропса `color` за допомогою рядкових стилів. +4. Ви повинні відтворити елемент `img` з класом `mood-board-image` та атрибутом `src`, встановленим у значення пропса `image`, всередині елемента `.mood-board-item`. +5. Ви повинні відтворити елемент `h3` з класом `mood-board-text` та текстом, встановленим у значення пропса `description`, всередині елемента `.mood-board-item`. +6. Ви повинні створити та експортувати компонент `MoodBoard`. 7. Ваш компонент `MoodBoard` має повертати `div` як свій верхній елемент. -8. Ваш компонент `MoodBoard` має відтворювати елемент `h1` з класом `mood-board-heading` і текстом `Destination Mood Board`. +8. Ваш компонент `MoodBoard` має відтворювати елемент `h1` з класом `mood-board-heading` та текстом `Destination Mood Board`. 9. Ваш компонент `MoodBoard` має відтворювати `div` з класом `mood-board`. -10. Ваш компонент `MoodBoard` має відтворювати щонайменше три компоненти `MoodBoardItem` всередині елемента `.mood-board`, кожен із яких має передавати пропси `color`, `image` і `description` з дійсними значеннями. +10. Ваш компонент `MoodBoard` має відтворювати щонайменше три компоненти `MoodBoardItem` всередині елемента `.mood-board`, кожен з яких повинен передавати пропси `color`, `image` та `description` з дійсними значеннями. Ви можете використати такі зображення у своєму мудборді, якщо хочете: @@ -41,7 +41,7 @@ demoType: onClick Ви повинні експортувати компонент `MoodBoardItem`. ```js -assert.isFunction(window.index.MoodBoardItem, 1); +assert.isFunction(window.index.MoodBoardItem); ``` Ваш компонент `MoodBoardItem` має повертати `div` з класом `mood-board-item` як свій верхній елемент. @@ -52,7 +52,7 @@ assert.exists(item); assert.equal(item.tagName, 'DIV'); ``` -Колір фону елемента `.mood-board-item` має бути встановлений у значення пропса `color` за допомогою рядкових стилів. +Колір фону елемента `.mood-board-item` має бути встановлений відповідно до значення пропса `color` за допомогою рядкових стилів. ```js const container = await __helpers.prepTestComponent(window.index.MoodBoardItem, { color: "red" }); @@ -83,7 +83,7 @@ assert.equal(item.tagName, 'DIV'); Ви повинні експортувати компонент `MoodBoard`. ```js -assert.isFunction(window.index.MoodBoard, 1); +assert.isFunction(window.index.MoodBoard); ``` Ваш компонент `MoodBoard` має повертати `div` як свій верхній елемент. @@ -102,7 +102,15 @@ assert.equal(heading.tagName, 'H1'); assert.equal(heading.textContent, 'Destination Mood Board'); ``` -Ваш компонент `MoodBoard` має відтворювати щонайменше три компоненти `MoodBoardItem`, кожен із яких має передавати пропси `color`, `image` і `description` з дійсними значеннями. +Ваш компонент `MoodBoard` має відтворювати `div` з класом `mood-board`. + +```js +const moodboard = document.getElementsByClassName('mood-board')[0]; +assert.exists(moodboard); +assert.equal(moodboard.tagName, 'DIV'); +``` + +Ваш компонент `MoodBoard` має відтворювати щонайменше три компоненти `MoodBoardItem` всередині елемента `.mood-board`, кожен з яких повинен передавати пропси `color`, `image` та `description` з дійсними значеннями. ```js const moodboard = document.getElementsByClassName('mood-board')[0]; diff --git a/curriculum/challenges/ukrainian/blocks/lab-motorcycle-shop/694175528a794a090ea0ba74.md b/curriculum/challenges/ukrainian/blocks/lab-motorcycle-shop/694175528a794a090ea0ba74.md index 52a75d78f1c..ebce88ef2c1 100644 --- a/curriculum/challenges/ukrainian/blocks/lab-motorcycle-shop/694175528a794a090ea0ba74.md +++ b/curriculum/challenges/ukrainian/blocks/lab-motorcycle-shop/694175528a794a090ea0ba74.md @@ -1,6 +1,6 @@ --- id: 694175528a794a090ea0ba74 -title: Build a Motorcycle Shop +title: Побудуйте магазин мотоциклів challengeType: 25 dashedName: lab-motorcycle-shop demoType: onClick @@ -12,7 +12,7 @@ demoType: onClick **Мета:** Виконайте наведені нижче історії користувача та пройдіть усі тести, щоб завершити лабораторну роботу. -**Історії користувача:** +**Історія користувача:** 1. Ви повинні створити `type`, який називається `Category` і складається з таких можливих значень: `'Sport'`, `'Cruiser'`, `'Touring'`, `'Dirt'`, `'Adventure'`, `'Naked'`, `'Electric'`. 2. Ви повинні створити `interface`, який називається `Motorcycle` і має такі властивості: `id` типу `string`, `name` типу `string`, `manufacturer` типу `string`, `category` типу `Category`, `price` типу `number`, `image_url` типу `string`, властивість `created_at` типу `Date`, `description` типу `string` та рік типу `number`. @@ -35,6 +35,291 @@ demoType: onClick 7. Кількість відображених елементів `Motorcycle` повинна бути вказана всередині елемента з ідентифікатором `results-number`. 8. Фільтр повинен оновлюватися на подію `input`. +# --before-all-- + +```js +const _testMotorcycles = [ + { + id: '1', + name: 'Ninja H2', + manufacturer: 'Kawasaki', + category: 'Sport', + price: 29000, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-vmoto-stash.jpg', + description: 'Supercharged hypersport with unmatched power', + year: 2024, + created_at: '2024-01-01T00:00:00Z' + }, + { + id: '2', + name: 'Street Triple RS', + manufacturer: 'Triumph', + category: 'Naked', + price: 13500, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-r3.png', + description: 'Agile naked bike with triple-cylinder perfection', + year: 2024, + created_at: '2024-01-02T00:00:00Z' + }, + { + id: '3', + name: 'R1250 GS Adventure', + manufacturer: 'BMW', + category: 'Adventure', + price: 21995, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-vmoto-stash.jpg', + description: 'The ultimate adventure touring machine', + year: 2024, + created_at: '2024-01-03T00:00:00Z' + }, + { + id: '4', + name: 'Panigale V4', + manufacturer: 'Ducati', + category: 'Sport', + price: 28395, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-kawasaki-zx10r.png', + description: 'Italian superbike engineering at its finest', + year: 2024, + created_at: '2024-01-04T00:00:00Z' + }, + { + id: '5', + name: 'Road Glide Special', + manufacturer: 'Harley-Davidson', + category: 'Cruiser', + price: 29999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-vmax.jpg', + description: 'Classic American touring with modern tech', + year: 2024, + created_at: '2024-01-05T00:00:00Z' + }, + { + id: '6', + name: 'MT-09', + manufacturer: 'Yamaha', + category: 'Naked', + price: 9999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-mt7.jpg', + description: 'Lightweight naked bike with crossplane power', + year: 2024, + created_at: '2024-01-06T00:00:00Z' + }, + { + id: '7', + name: 'Africa Twin', + manufacturer: 'Honda', + category: 'Adventure', + price: 14599, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-honda-africa.jpg', + description: 'Legendary adventure bike reborn for modern times', + year: 2024, + created_at: '2024-01-07T00:00:00Z' + }, + { + id: '8', + name: 'Super Duke R', + manufacturer: 'KTM', + category: 'Naked', + price: 18999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-suzuki-sv650.jpg', + description: 'The Beast returns with 180hp of raw power', + year: 2024, + created_at: '2024-01-08T00:00:00Z' + }, + { + id: '9', + name: 'GSX-R1000R', + manufacturer: 'Suzuki', + category: 'Sport', + price: 17199, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-suzuki-gsxr1000.jpg', + description: 'Track-ready sportbike with championship DNA', + year: 2024, + created_at: '2024-01-09T00:00:00Z' + }, + { + id: '10', + name: 'Street Glide', + manufacturer: 'Harley-Davidson', + category: 'Cruiser', + price: 21999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-vmax.jpg', + description: 'Milwaukee-Eight power in a sleek bagger', + year: 2024, + created_at: '2024-01-10T00:00:00Z' + }, + { + id: '11', + name: 'Z H2', + manufacturer: 'Kawasaki', + category: 'Naked', + price: 17000, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-kawasaki-zh2.jpg', + description: 'Supercharged naked bike mayhem', + year: 2024, + created_at: '2024-01-11T00:00:00Z' + }, + { + id: '12', + name: 'Multistrada V4', + manufacturer: 'Ducati', + category: 'Adventure', + price: 22995, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-mt3.jpg', + description: 'Italian style meets adventure capability', + year: 2024, + created_at: '2024-01-12T00:00:00Z' + }, + { + id: '13', + name: 'Speed Triple 1200', + manufacturer: 'Triumph', + category: 'Naked', + price: 16500, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-honda-transalp.jpg', + description: 'British muscle bike with cutting-edge tech', + year: 2024, + created_at: '2024-01-13T00:00:00Z' + }, + { + id: '14', + name: 'S1000RR', + manufacturer: 'BMW', + category: 'Sport', + price: 17295, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-kawasaki-z900a1.jpg', + description: 'German precision in a superbike package', + year: 2024, + created_at: '2024-01-14T00:00:00Z' + }, + { + id: '15', + name: 'MT-07', + manufacturer: 'Yamaha', + category: 'Naked', + price: 7999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-mt7.jpg', + description: 'Best-selling parallel twin for pure fun', + year: 2024, + created_at: '2024-01-15T00:00:00Z' + }, + { + id: '16', + name: 'V-Strom 1050', + manufacturer: 'Suzuki', + category: 'Adventure', + price: 13799, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-benelli-trk702.png', + description: 'Reliable adventure touring on a budget', + year: 2024, + created_at: '2024-01-16T00:00:00Z' + }, + { + id: '17', + name: 'Sportster S', + manufacturer: 'Harley-Davidson', + category: 'Cruiser', + price: 15999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-yamaha-r3.png', + description: 'Revolution Max engine in a modern cruiser', + year: 2024, + created_at: '2024-01-17T00:00:00Z' + }, + { + id: '18', + name: 'CBR1000RR-R', + manufacturer: 'Honda', + category: 'Sport', + price: 28500, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-honda-cbr500.png', + description: 'Honda racing technology for the street', + year: 2024, + created_at: '2024-01-18T00:00:00Z' + }, + { + id: '19', + name: 'Tiger 900', + manufacturer: 'Triumph', + category: 'Adventure', + price: 14400, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-triumph-tiger900.png', + description: 'Middleweight adventure excellence', + year: 2024, + created_at: '2024-01-19T00:00:00Z' + }, + { + id: '20', + name: '890 Duke R', + manufacturer: 'KTM', + category: 'Naked', + price: 11999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-kawasaki-zx10r.png', + description: 'The Scalpel - precise handling perfection', + year: 2024, + created_at: '2024-01-20T00:00:00Z' + }, + { + id: '21', + name: 'Ninja 400', + manufacturer: 'Kawasaki', + category: 'Sport', + price: 5299, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-vmoto-stash.jpg', + description: 'Perfect entry-level sportbike', + year: 2024, + created_at: '2024-01-21T00:00:00Z' + }, + { + id: '22', + name: 'Scrambler 1200', + manufacturer: 'Triumph', + category: 'Adventure', + price: 13250, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-ducati-scrambler.jpg', + description: 'Modern classic with off-road capability', + year: 2024, + created_at: '2024-01-22T00:00:00Z' + }, + { + id: '23', + name: 'Monster Plus', + manufacturer: 'Ducati', + category: 'Naked', + price: 14295, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-kawasaki-zx10r.png', + description: 'Evolved Monster with V-twin soul', + year: 2024, + created_at: '2024-01-23T00:00:00Z' + }, + { + id: '24', + name: 'CB650R', + manufacturer: 'Honda', + category: 'Naked', + price: 9199, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-kawasaki-z900.png', + description: 'Neo Sports Café styling with inline-four power', + year: 2024, + created_at: '2024-01-24T00:00:00Z' + }, + { + id: '25', + name: 'Low Rider S', + manufacturer: 'Harley-Davidson', + category: 'Cruiser', + price: 17999, + image_url: 'https://cdn.freecodecamp.org/curriculum/labs/motorcycle-suzuki-vstorm650.jpg', + description: 'Blacked-out cruiser with attitude', + year: 2024, + created_at: '2024-01-25T00:00:00Z' + } +]; + +window.fetch = () => + Promise.resolve({ json: () => Promise.resolve(_testMotorcycles) }); +``` + # --hints-- Ви повинні мати `type` з назвою `Category`. @@ -84,16 +369,24 @@ assert.isFunction(fetchMotorcycles); ```js const spy = __helpers.spyOn(window, 'fetch'); -const motorcycles = await fetchMotorcycles(); -assert.strictEqual(spy.calls[0][0].trim(),"https://cdn.freecodecamp.org/curriculum/labs/data/motorcycles.json"); +try { + await fetchMotorcycles(); + assert.strictEqual(spy.calls[0][0].trim(),"https://cdn.freecodecamp.org/curriculum/labs/data/motorcycles.json"); +} finally { + spy.restore(); +} ``` Ви повинні повертати проміс з 25 об’єктів `Motorcycle` з `fetchMotorcycles`. ```js const spy = __helpers.spyOn(window, 'fetch'); -const motorcycles = await fetchMotorcycles(); -assert.lengthOf(motorcycles,25); +try { + const motorcycles = await fetchMotorcycles(); + assert.lengthOf(motorcycles,25); +} finally { + spy.restore(); +} ``` Ви повинні мати функцію з назвою `renderMotorcycleCard`. diff --git a/curriculum/challenges/ukrainian/blocks/lab-nth-fibonacci-number-js/7a97b79c096ecb000d03bd36.md b/curriculum/challenges/ukrainian/blocks/lab-nth-fibonacci-number-js/7a97b79c096ecb000d03bd36.md index b6a9470fbee..8491feb5f9c 100644 --- a/curriculum/challenges/ukrainian/blocks/lab-nth-fibonacci-number-js/7a97b79c096ecb000d03bd36.md +++ b/curriculum/challenges/ukrainian/blocks/lab-nth-fibonacci-number-js/7a97b79c096ecb000d03bd36.md @@ -1,6 +1,6 @@ --- id: 7a97b79c096ecb000d03bd36 -title: Побудуйте калькулятор n-го числа Фібоначчі +title: Побудувати калькулятор n-го числа Фібоначчі challengeType: 26 dashedName: build-an-nth-fibonacci-number-calculator --- @@ -9,7 +9,7 @@ dashedName: build-an-nth-fibonacci-number-calculator **Мета:** Виконайте наведені нижче історії користувача та пройдіть усі тести, щоб завершити лабораторну роботу. -**Історії користувача:** +**Історія користувача:** 1. Ви повинні створити функцію з назвою `fibonacci`. 2. Ви повинні визначити масив з назвою `sequence` всередині функції `fibonacci`, і він має бути ініціалізований значеннями `[0, 1]`. @@ -22,20 +22,25 @@ dashedName: build-an-nth-fibonacci-number-calculator Ви повинні мати функцію з назвою `fibonacci`. ```js -assert.isFunction(fibonacci); +const explorer = await __helpers.Explorer(code); +assert.exists(explorer.allFunctions.fibonacci); ``` Ваша функція `fibonacci` має приймати один параметр. ```js -const params = __helpers.getFunctionParams(fibonacci.toString()); -assert.equal(params.length, 1); +const explorer = await __helpers.Explorer(code); +const { fibonacci } = explorer.allFunctions; +assert.equal(fibonacci?.parameters.length, 1); ``` Ви повинні мати масив з назвою `sequence` всередині функції `fibonacci`, ініціалізований `[0, 1]`. ```js -assert.match(__helpers.removeJSComments(fibonacci.toString()), /(const|let|var)\s+sequence\s*=\s*\[\s*0\s*,\s*1\s*\]/); +const explorer = await __helpers.Explorer(code); +const { fibonacci } = explorer.allFunctions; +const { sequence } = fibonacci?.variables ?? {}; +assert.isTrue(sequence?.value.matches('[0, 1]')); ``` `fibonacci(0)` має повертати `0`. diff --git a/curriculum/challenges/ukrainian/blocks/lab-product-showcase/696920c0c98a1ed58eb86293.md b/curriculum/challenges/ukrainian/blocks/lab-product-showcase/696920c0c98a1ed58eb86293.md index 3b155736598..01167ceab39 100644 --- a/curriculum/challenges/ukrainian/blocks/lab-product-showcase/696920c0c98a1ed58eb86293.md +++ b/curriculum/challenges/ukrainian/blocks/lab-product-showcase/696920c0c98a1ed58eb86293.md @@ -12,7 +12,7 @@ demoType: onClick **Мета:** Виконайте наведені нижче історії користувача та пройдіть усі тести, щоб завершити лабораторну роботу. -**Історії користувача:** +**Історія користувача:** 1. Ви повинні створити інтерфейс з назвою `Item` з: - Властивістю `type`, яка може бути лише `"book"`, `"electronics"` або `"clothing"`. @@ -421,6 +421,10 @@ assert.isFunction(showProducts); ```js const len = products.items.length; +const books = document.getElementById("books"); +const all = document.getElementById("all"); +const output = document.getElementById("output"); + assert.isAtLeast(len, 3); books.dispatchEvent(new Event("click", { bubbles: true })); all.dispatchEvent(new Event("click", { bubbles: true })); @@ -430,7 +434,11 @@ assert.lengthOf(output.querySelectorAll(".item"), len); Натиснення кнопки `#books` має відображати відповідний набір продуктів у елементі `#output`. ```js +const books = document.getElementById("books"); +const clothing = document.getElementById("clothing"); +const output = document.getElementById("output"); const len = products.items.length; + assert.isAtLeast(len, 3); let count = 0; products.items.forEach(i => { @@ -446,7 +454,11 @@ assert.lengthOf(output.querySelectorAll(".item"), count); Натиснення кнопки `#electronics` має відображати відповідний набір продуктів у елементі `#output`. ```js +const electronics = document.getElementById("electronics"); +const clothing = document.getElementById("clothing"); +const output = document.getElementById("output"); const len = products.items.length; + assert.isAtLeast(len, 3); let count = 0; products.items.forEach(i => { @@ -462,7 +474,11 @@ assert.lengthOf(output.querySelectorAll(".item"), count); Натиснення кнопки `#clothing` має відображати відповідний набір продуктів у елементі `#output`. ```js +const books = document.getElementById("books"); +const clothing = document.getElementById("clothing"); +const output = document.getElementById("output"); const len = products.items.length; + assert.isAtLeast(len, 3); let count = 0; products.items.forEach(i => { @@ -478,6 +494,7 @@ assert.lengthOf(output.querySelectorAll(".item"), count); Усі продукти мають бути видимі за замовчуванням під час завантаження сторінки. Використайте подію `DOMContentLoaded`, щоб це забезпечити. ```js +const output = document.getElementById("output"); const len = products.items.length; assert.isAtLeast(len, 3); document.dispatchEvent(new Event("DOMContentLoaded")); diff --git a/curriculum/challenges/ukrainian/blocks/lab-reusable-footer/673b02b03134b04637bf7055.md b/curriculum/challenges/ukrainian/blocks/lab-reusable-footer/673b02b03134b04637bf7055.md index 23d9ef68e71..ea24e3d46c0 100644 --- a/curriculum/challenges/ukrainian/blocks/lab-reusable-footer/673b02b03134b04637bf7055.md +++ b/curriculum/challenges/ukrainian/blocks/lab-reusable-footer/673b02b03134b04637bf7055.md @@ -1,6 +1,6 @@ --- id: 673b02b03134b04637bf7055 -title: створіть багаторазовий нижній колонтитул +title: Створіть багаторазовий нижній колонтитул challengeType: 25 dashedName: build-a-reusable-footer demoType: onClick @@ -10,13 +10,13 @@ demoType: onClick **Мета:** Виконайте наведені нижче історії користувача та пройдіть усі тести, щоб завершити лабораторну роботу. -**Історії користувача:** +**Історія користувача:** 1. Ви повинні експортувати компонент `Footer`. 2. Ваш компонент `Footer` має повертати елемент `footer`, який містить усі інші елементи. 3. Ваш елемент `footer` повинен мати: - - Щонайменше три невпорядковані списки, кожен із яких має щонайменше два елементи списку. +- Щонайменше три невпорядковані списки, кожен із яких має щонайменше два елементи списку. - Щонайменше один абзац із символом авторського права `©`. - Щонайменше три посилання зі значенням `href`, встановленим на `#`, а вміст посилання має бути у вигляді іконки або тексту на ваш вибір. @@ -53,7 +53,7 @@ assert.lengthOf(document.getElementById('root').children, 1); assert.isAtLeast(document.querySelectorAll('ul').length, 3); ``` -Кожен із ваших невпорядкованих списків має містити щонайменше два елементи списку. +Кожен ваш невпорядкований список повинен містити щонайменше два елементи. ```js const uls = [...document.querySelectorAll('ul')]; @@ -84,7 +84,7 @@ const links = document.querySelectorAll('a[href="#"]'); assert.isAtLeast(links.length, 3); ``` -Жодне з ваших посилань не повинно бути порожнім. +Ваші посилання не повинні бути порожніми. ```js const links = [...document.querySelectorAll('a[href="#"]')]; diff --git a/curriculum/challenges/ukrainian/blocks/lab-sentence-maker/66c057041df6394ca796bf33.md b/curriculum/challenges/ukrainian/blocks/lab-sentence-maker/66c057041df6394ca796bf33.md index ee2fd38536e..f71e8dde3b3 100644 --- a/curriculum/challenges/ukrainian/blocks/lab-sentence-maker/66c057041df6394ca796bf33.md +++ b/curriculum/challenges/ukrainian/blocks/lab-sentence-maker/66c057041df6394ca796bf33.md @@ -7,7 +7,7 @@ dashedName: build-a-sentence-maker # --description-- -У цій лабораторній роботі ви створите дві різні історії, використовуючи шаблон речення. Ви будете використовувати змінні для збереження різних частин історії, а потім виводити історії в консоль. +У цій лабораторній роботі ви створите дві різні історії, використовуючи шаблон речення. Ви будете використовувати змінні для збереження різних частин історії, а потім виведете історії в консоль. **Мета:** Виконайте наведені нижче історії користувача та пройдіть усі тести, щоб завершити лабораторну роботу. @@ -26,19 +26,26 @@ dashedName: build-a-sentence-maker 1. Ви повинні оголосити змінну `firstStory`. -1. Ви повинні використати наведений шаблон історії для створення першої історії та призначити її змінній `firstStory`: `"Once upon a time, there was a(n) [adjective] [noun] who loved to eat [noun2]. The [noun] lived in a [place] and had [adjective2] nostrils that blew fire when it was [verb]."`; +1. Ви повинні використати наступний шаблон історії, щоб створити першу історію та призначити її змінній `firstStory`: `"Once upon a time, there was a(n) [adjective] [noun] who loved to eat [noun2]. The [noun] lived in a [place] and had [adjective2] nostrils that blew fire when it was [verb]."` -1. Ви повинні вивести вашу першу історію в консоль за допомогою повідомлення `"First story: [firstStory]"`. +1. Ви повинні вивести вашу першу історію в консоль з повідомленням `"First story: [firstStory]"`. 1. Ви повинні призначити нові значення змінним `adjective`, `noun`, `verb`, `place`, `adjective2` та `noun2`. 1. Ви повинні оголосити змінну `secondStory`. -1. Створіть іншу історію, використовуючи той самий шаблон, і призначте її змінній `secondStory`. +1. Ви повинні створити іншу історію, використовуючи той самий шаблон, і призначити її змінній `secondStory`. -1. Ви повинні вивести вашу другу історію в консоль за допомогою повідомлення `"Second story: [secondStory]"`. +1. Ви повинні вивести вашу другу історію в консоль з повідомленням `"Second story: [secondStory]"`. +# --before-each-- + +```js +const spy = __helpers.spyOn(console, 'log'); +const getLogs = () => spy.calls.map(call => call.join(' ')); +``` + # --hints-- Ви повинні оголосити змінну `adjective`. @@ -142,12 +149,10 @@ assert.match( ); ``` -Ви повинні вивести вашу першу історію, використовуючи повідомлення `"First story: [firstStory]"`. +Ви повинні вивести вашу першу історію в консоль з повідомленням `"First story: [firstStory]"`. ```js -const condition1 = /console\.log\(\s*["']First\s+story:\s+["']\s*\+\s*firstStory\s*\);?/gm.test(code); -const condition2 = /console\.log\(\s*`First\s+story:\s+\$\{firstStory\}`\s*\);?/gm.test(code); -assert.isTrue(condition1 || condition2); +assert.include(getLogs(), `First story: ${firstStory}`); ``` Ви повинні оголосити змінну `secondStory`. @@ -208,15 +213,13 @@ assert.match( ); ``` -Ви повинні вивести вашу другу історію, використовуючи формат `"Second story: [secondStory]"`. +Ви повинні вивести вашу другу історію в консоль з повідомленням `"Second story: [secondStory]"`. ```js -const condition1 = /console\.log\(\s*["']Second\s+story:\s+["']\s*\+\s*secondStory\s*\);?/gm.test(code); -const condition2 = /console\.log\(\s*`Second\s+story:\s+\$\{secondStory\}`\s*\);?/gm.test(code); -assert.isTrue(condition1 || condition2); +assert.include(getLogs(), `Second story: ${secondStory}`); ``` -`firstStory` не повинен бути таким самим, як `secondStory`. +Ваша `firstStory` не повинна бути такою ж, як і ваша `secondStory`. ```js assert.notEqual(firstStory, secondStory); @@ -255,3 +258,4 @@ const secondStory = `Once upon a time, there was a(n) ${adjective} ${noun} who l console.log("Second story: " + secondStory); ``` + diff --git a/curriculum/challenges/ukrainian/blocks/lab-weather-app/66f12a88741aeb16b9246c59.md b/curriculum/challenges/ukrainian/blocks/lab-weather-app/66f12a88741aeb16b9246c59.md index 168ddfbccf5..c819076805a 100644 --- a/curriculum/challenges/ukrainian/blocks/lab-weather-app/66f12a88741aeb16b9246c59.md +++ b/curriculum/challenges/ukrainian/blocks/lab-weather-app/66f12a88741aeb16b9246c59.md @@ -333,7 +333,7 @@ assert.strictEqual( ); ``` -Всередині елемента `select` має бути 6 елементів `option`, по одному для кожного з наступних міст: Paris, London, Tokyo, Los Angeles, Chicago, New York. +Окрім порожнього першого варіанту, елемент `select` повинен містити 6 елементів `option`, по одному для кожного з наступних міст: Париж, Лондон, Токіо, Лос-Анджелес, Чикаго, Нью-Йорк. ```js ['Paris', 'London', 'Tokyo', 'Los Angeles', 'Chicago', 'New York'].forEach( @@ -342,7 +342,7 @@ assert.strictEqual( `select > option[value="${city.toLowerCase()}"]` ); assert.exists(el); - assert.strictEqual(el.innerText.trim(), city); + assert.strictEqual(el.textContent.trim(), city); } ); ``` diff --git a/curriculum/challenges/ukrainian/blocks/learn-about-speculation-and-requests/67eff6af42e8c425d9ff28e3.md b/curriculum/challenges/ukrainian/blocks/learn-about-speculation-and-requests/67eff6af42e8c425d9ff28e3.md index 76ab1c41c77..8adeb60f9de 100644 --- a/curriculum/challenges/ukrainian/blocks/learn-about-speculation-and-requests/67eff6af42e8c425d9ff28e3.md +++ b/curriculum/challenges/ukrainian/blocks/learn-about-speculation-and-requests/67eff6af42e8c425d9ff28e3.md @@ -32,7 +32,7 @@ lang: en-US - `Your software is up to date.` - Програмне забезпечення має всі останні оновлення. -- `Is your resume up to date?` - Вони питають, чи резюме включає найновіший досвід цієї людини. +- `Is your resume up to date?` - Питають, чи містить резюме найновіший досвід цієї людини. # --scene-- diff --git a/curriculum/challenges/ukrainian/blocks/learn-basic-css-by-building-a-cafe-menu/5f3ef6e03d719d5ac4738993.md b/curriculum/challenges/ukrainian/blocks/learn-basic-css-by-building-a-cafe-menu/5f3ef6e03d719d5ac4738993.md index acc6e1feafe..195c7175406 100644 --- a/curriculum/challenges/ukrainian/blocks/learn-basic-css-by-building-a-cafe-menu/5f3ef6e03d719d5ac4738993.md +++ b/curriculum/challenges/ukrainian/blocks/learn-basic-css-by-building-a-cafe-menu/5f3ef6e03d719d5ac4738993.md @@ -7,9 +7,9 @@ dashedName: step-56 # --description-- -Поточна ширина меню завжди займатиме 80% ширини елемента `body`. На дуже широкому екрані кава та десерт розташовані далеко від своїх цін. +Поточна ширина меню завжди займатиме `80%` ширини елемента `body`. На дуже широкому екрані кави та десерти виглядають далеко від своїх цін. -Додайте властивість `max-width` до класу `menu` зі значенням `500px`, щоб запобігти надто великому розширенню. +Додайте властивість `max-width` до класу `menu` зі значенням `500px`, щоб запобігти надто широкому розширенню. # --hints-- @@ -117,3 +117,4 @@ h1, h2, p { width: 25%; } ``` + diff --git a/curriculum/challenges/ukrainian/blocks/learn-how-to-plan-future-events/67531709d628ef047202e6ae.md b/curriculum/challenges/ukrainian/blocks/learn-how-to-plan-future-events/67531709d628ef047202e6ae.md index 372ce248f39..39b042a1699 100644 --- a/curriculum/challenges/ukrainian/blocks/learn-how-to-plan-future-events/67531709d628ef047202e6ae.md +++ b/curriculum/challenges/ukrainian/blocks/learn-how-to-plan-future-events/67531709d628ef047202e6ae.md @@ -12,7 +12,7 @@ lang: en-US # --assignment-- -Перегляньте відео.. +Перегляньте відео. # --scene-- diff --git a/curriculum/challenges/ukrainian/blocks/learn-present-perfect-while-talking-about-accessibility/671b98e9b7c4854e93044e64.md b/curriculum/challenges/ukrainian/blocks/learn-present-perfect-while-talking-about-accessibility/671b98e9b7c4854e93044e64.md index e7a69d0fbe2..b7baca5f4af 100644 --- a/curriculum/challenges/ukrainian/blocks/learn-present-perfect-while-talking-about-accessibility/671b98e9b7c4854e93044e64.md +++ b/curriculum/challenges/ukrainian/blocks/learn-present-perfect-while-talking-about-accessibility/671b98e9b7c4854e93044e64.md @@ -62,7 +62,7 @@ lang: en-US "startTime": 5.34, "finishTime": 9.26, "dialogue": { - "text": "Yes, for some reason it hasn't been displaying correctly for some users.", + "text": "Yes. For some reason, it hasn't been displaying correctly for some users.", "align": "right" } }, diff --git a/curriculum/challenges/ukrainian/blocks/learn-present-perfect-while-talking-about-accessibility/671f403c1d4e8a5e046065a0.md b/curriculum/challenges/ukrainian/blocks/learn-present-perfect-while-talking-about-accessibility/671f403c1d4e8a5e046065a0.md index ea5f62ccd64..a61c25bbf3a 100644 --- a/curriculum/challenges/ukrainian/blocks/learn-present-perfect-while-talking-about-accessibility/671f403c1d4e8a5e046065a0.md +++ b/curriculum/challenges/ukrainian/blocks/learn-present-perfect-while-talking-about-accessibility/671f403c1d4e8a5e046065a0.md @@ -6,7 +6,7 @@ dashedName: task-36 lang: en-US --- -<!-- (Audio) James: Yes. For some reason, It hasn't been displaying correctly for some users. --> +<!-- (Audio) James: Yes. For some reason, it hasn't been displaying correctly for some users. --> # --instructions-- @@ -16,7 +16,7 @@ lang: en-US ## --sentence-- -`Yes. For some reason, It BLANK BLANK BLANK correctly for some users.` +`Yes. For some reason, it BLANK BLANK BLANK correctly for some users.` ## --blanks-- @@ -83,7 +83,7 @@ lang: en-US "startTime": 1, "finishTime": 4.92, "dialogue": { - "text": "Yes, for some reason it hasn't been displaying correctly for some users.", + "text": "Yes. For some reason, it hasn't been displaying correctly for some users.", "align": "center" } }, diff --git a/curriculum/challenges/ukrainian/blocks/learn-present-perfect-while-talking-about-accessibility/671f456994635c6085054cbd.md b/curriculum/challenges/ukrainian/blocks/learn-present-perfect-while-talking-about-accessibility/671f456994635c6085054cbd.md index b1461f0eb6f..7f62a2070c0 100644 --- a/curriculum/challenges/ukrainian/blocks/learn-present-perfect-while-talking-about-accessibility/671f456994635c6085054cbd.md +++ b/curriculum/challenges/ukrainian/blocks/learn-present-perfect-while-talking-about-accessibility/671f456994635c6085054cbd.md @@ -6,7 +6,7 @@ dashedName: task-37 lang: en-US --- -<!-- (Audio) James: Yes. For some reason, It hasn't been displaying correctly for some users. --> +<!-- (Audio) James: Yes. For some reason, it hasn't been displaying correctly for some users. --> # --instructions-- @@ -16,7 +16,7 @@ lang: en-US ## --sentence-- -`Yes. For some reason, It hasn't been displaying BLANK for some BLANK.` +`Yes. For some reason, it hasn't been displaying BLANK for some BLANK.` ## --blanks-- @@ -79,7 +79,7 @@ lang: en-US "startTime": 1, "finishTime": 4.92, "dialogue": { - "text": "Yes, for some reason it hasn't been displaying correctly for some users.", + "text": "Yes. For some reason, it hasn't been displaying correctly for some users.", "align": "center" } }, diff --git a/curriculum/challenges/ukrainian/blocks/learn-present-perfect-while-talking-about-accessibility/6720cf38beae8c4f1d7af1c0.md b/curriculum/challenges/ukrainian/blocks/learn-present-perfect-while-talking-about-accessibility/6720cf38beae8c4f1d7af1c0.md index b6e32d82cca..d11e83abfbe 100644 --- a/curriculum/challenges/ukrainian/blocks/learn-present-perfect-while-talking-about-accessibility/6720cf38beae8c4f1d7af1c0.md +++ b/curriculum/challenges/ukrainian/blocks/learn-present-perfect-while-talking-about-accessibility/6720cf38beae8c4f1d7af1c0.md @@ -22,7 +22,7 @@ lang: en-US `Alice: James, have you heard about the BLANK on our video platform?` -`James: Yes. For some reason, It hasn't been BLANK for some users. The captions are misaligned and BLANK, which isn't good for accessibility.` +`James: Yes. For some reason, it hasn't been BLANK for some users. The captions are misaligned and BLANK, which isn't good for accessibility.` `Alice: Exactly. Do you know if it's been affecting all the videos or just a few?` diff --git a/curriculum/challenges/ukrainian/blocks/lecture-css-specificity-the-cascade-algorithm-and-inheritance/672aa62178d5ff57fe4f98e0.md b/curriculum/challenges/ukrainian/blocks/lecture-css-specificity-the-cascade-algorithm-and-inheritance/672aa62178d5ff57fe4f98e0.md index e027f030991..18884406a79 100644 --- a/curriculum/challenges/ukrainian/blocks/lecture-css-specificity-the-cascade-algorithm-and-inheritance/672aa62178d5ff57fe4f98e0.md +++ b/curriculum/challenges/ukrainian/blocks/lecture-css-specificity-the-cascade-algorithm-and-inheritance/672aa62178d5ff57fe4f98e0.md @@ -43,14 +43,14 @@ p { ```html <link rel="stylesheet" href="styles.css"> -<p id="para">Red paragraph</p> +<p id="para-1">Red paragraph</p> <p>Other paragraph</p> <p>Another paragraph</p> <p>Yet another paragraph</p> ``` ```css -#para { +#para-1 { color: red; } @@ -67,24 +67,33 @@ p { **ПРИМІТКА**: Ви дізнаєтеся більше про псевдокласи у майбутніх уроках. -У цьому прикладі перший абзац буде червоним, тому що селектор з ідентифікатором має вищу специфічність, ніж класи та селектори типу. Елементи з класом `.example-para` матимуть зелений колір, тоді як решта абзаців буде синього кольору. +У цьому прикладі: + +- Перший абзац буде червоним, тому що селектор ідентифікатора має вищу специфічність, ніж класи та селектори типу. +- Другий абзац із селектором класу `.example-para` матиме зелений колір. +- Третій абзац із селектором ідентифікатора `#para-3` та селектором класу `.example-para` матиме фіолетовий колір. +- Решта абзаців матиме синій колір. :::interactive_editor ```html <link rel="stylesheet" href="styles.css"> -<p id="para">Example paragraph</p> +<p id="para-1">Example paragraph</p> <p class="example-para">Other paragraph</p> -<p class="example-para">Another paragraph</p> +<p id="para-3" class="example-para">Another paragraph</p> <p>Yet another paragraph</p> ``` ```css -#para { +#para-1 { color: red; } +#para-3 { + color: purple; +} + .example-para { color: green; } @@ -105,13 +114,13 @@ p { ```html <link rel="stylesheet" href="styles.css"> -<p id="para">Example paragraph</p> +<p id="para-1">Example paragraph</p> <p>Other paragraph</p> <p>Yet another paragraph</p> ``` ```css -#para { +#para-1 { color: red; } @@ -130,7 +139,7 @@ p { ```html <link rel="stylesheet" href="styles.css"> -<p id="para">Example paragraph</p> +<p id="para-1">Example paragraph</p> <p>Other paragraph</p> <p>Yet another paragraph</p> ``` @@ -140,7 +149,7 @@ p { color: red; } -#para { +#para-1 { color: green; } diff --git a/curriculum/challenges/ukrainian/blocks/lecture-express-middleware/69f42d414b7626e21a922794.md b/curriculum/challenges/ukrainian/blocks/lecture-express-middleware/69f42d414b7626e21a922794.md index 9e5d79e596d..2c187090eca 100644 --- a/curriculum/challenges/ukrainian/blocks/lecture-express-middleware/69f42d414b7626e21a922794.md +++ b/curriculum/challenges/ukrainian/blocks/lecture-express-middleware/69f42d414b7626e21a922794.md @@ -9,9 +9,7 @@ dashedName: what-is-error-handling-middleware Підпрограмне забезпечення для обробки помилок в Express — це особливий тип підпрограмного забезпечення, який використовується для обробки помилок, що виникають під час циклу запит-відповідь. Воно необхідне для виявлення несподіваних помилок, їх логування та надання відповідних відповідей клієнту. -Як ви бачили в попередньому уроці про обробку помилок, підпрограмне забезпечення для обробки помилок в Express має чотири параметри: `err`, `req`, `res` і `next`. Це підпрограмне забезпечення викликається, коли помилка передається функції `next()`. - -Ось нагадування синтаксису ще раз: +Підпрограмне забезпечення для обробки помилок у Express має чотири параметри: `err`, `req`, `res` і `next`. Це підпрограмне забезпечення викликається, коли помилка передається у функцію `next()`. Ось синтаксис: ```js app.use((err, req, res, next) => { diff --git a/curriculum/challenges/ukrainian/blocks/lecture-express-middleware/69f42d414b7626e21a922795.md b/curriculum/challenges/ukrainian/blocks/lecture-express-middleware/69f42d414b7626e21a922795.md index 485db71ecb5..9575153dd43 100644 --- a/curriculum/challenges/ukrainian/blocks/lecture-express-middleware/69f42d414b7626e21a922795.md +++ b/curriculum/challenges/ukrainian/blocks/lecture-express-middleware/69f42d414b7626e21a922795.md @@ -13,45 +13,45 @@ Express надає низку вбудованих функцій підпрог 1. `express.json()`: Вбудоване підпрограмне забезпечення, яке аналізує вхідні JSON-корисні навантаження. -```js -app.use(express.json()) -``` + ```js + app.use(express.json()) + ``` 1. `express.static()`: Підпрограмне забезпечення для обслуговування статичних файлів, таких як зображення, CSS і JavaScript-файли. -```js -app.use(express.static('public')) -``` + ```js + app.use(express.static('public')) + ``` 1. `express.urlencoded()`: Підпрограмне забезпечення, яке аналізує вхідні запити з URL-кодованими корисними навантаженнями, форматом, який зазвичай надсилають HTML-форми. Воно робить проаналізовані дані доступними на `req.body`. -```js -app.use(express.urlencoded({ extended: true })) -``` + ```js + app.use(express.urlencoded({ extended: true })) + ``` **Тепер ось кілька прикладів стороннього підпрограмного забезпечення:** 1. `cors`: Популярне стороннє підпрограмне забезпечення для увімкнення Cross-Origin Resource Sharing. -```bash -npm install cors -``` + ```bash + npm install cors + ``` -```js -const cors = require('cors') -app.use(cors()) -``` + ```js + const cors = require('cors') + app.use(cors()) + ``` 1. `morgan`: Підпрограмне забезпечення для логування HTTP-запитів. -```bash -npm install morgan -``` + ```bash + npm install morgan + ``` -```js -const morgan = require('morgan') -app.use(morgan('tiny')) -``` + ```js + const morgan = require('morgan') + app.use(morgan('tiny')) + ``` Тепер розглянемо приклад використання як вбудованого, так і стороннього підпрограмного забезпечення: @@ -133,7 +133,7 @@ Express надає необхідне вбудоване підпрограмн --- -Веде логування HTTP-запитів. +Логує HTTP-запити. ### --feedback-- diff --git a/curriculum/challenges/ukrainian/blocks/lecture-importance-of-semantic-html/672990ecf71a852804ababe7.md b/curriculum/challenges/ukrainian/blocks/lecture-importance-of-semantic-html/672990ecf71a852804ababe7.md index 362b07f9c90..fb0c8a20383 100644 --- a/curriculum/challenges/ukrainian/blocks/lecture-importance-of-semantic-html/672990ecf71a852804ababe7.md +++ b/curriculum/challenges/ukrainian/blocks/lecture-importance-of-semantic-html/672990ecf71a852804ababe7.md @@ -11,6 +11,10 @@ dashedName: what-is-the-difference-between-presentational-and-semantic-html Багато презентаційних HTML-елементів застаріли, тобто вони вийшли з ужитку і більше не рекомендуються. Існують кращі способи досягти тих самих результатів. Проте корисно знати, що вони існують, тому розглянемо кілька прикладів. +## Елементи презентаційного HTML + +### Елемент `font` + Елемент `font` — це застарілий елемент, який використовувався для встановлення розміру шрифту та кольору тексту. Ось приклад елемента `font`. Увімкніть інтерактивний редактор і змініть розмір з 5 на 7, щоб побачити збільшення шрифту. @@ -27,6 +31,8 @@ dashedName: what-is-the-difference-between-presentational-and-semantic-html Хоча цей елемент і досі працює, не слід його використовувати, бо розмір шрифту та колір завжди мають задаватися в CSS, а не в HTML. +### Елемент `center` + Елемент `center` — ще один застарілий елемент, який використовувався для горизонтального центрування вмісту в межах контейнера. Ось приклад елемента `center`, що містить текст і абзац. Увімкніть інтерактивний редактор і додайте теги `center` навколо `<p>Another example text.</p>`, щоб побачити, як він центрований на сторінці. @@ -44,6 +50,8 @@ dashedName: what-is-the-difference-between-presentational-and-semantic-html ::: +### Елемент `big` + Далі у нас є елемент `big`. Це ще один застарілий презентаційний HTML-елемент, який робить вкладений текст на один рівень більшим за навколишній текст. Ось приклад, де визначено абзац із двома частинами. Увімкніть інтерактивний редактор і додайте теги `big` навколо `Some other text`, щоб побачити зміни у вікні попереднього перегляду. @@ -64,6 +72,8 @@ dashedName: what-is-the-difference-between-presentational-and-semantic-html Це були приклади презентаційних HTML-елементів. Але всі вони застарілі і більше не рекомендуються. Тож що слід використовувати замість них? Давайте подивимося. +## Семантичний HTML + Семантичний HTML — це тепер рекомендована практика. Він описує вміст елементів, тому його набагато легше читати, розуміти і підтримувати. Пошукові системи легко розуміють ваш вебсайт, коли ви використовуєте семантичний HTML. Це також корисно для доступності, бо читачі екрана потребують семантичної інформації, щоб описати, що знаходиться на вебсторінці. @@ -75,6 +85,8 @@ dashedName: what-is-the-difference-between-presentational-and-semantic-html - Елемент `section` для групування пов’язаної інформації. - Елемент `figure` для ілюстрацій і діаграм. +### Приклад семантичного HTML + Ось приклад елемента `header`, що містить розділ навігації. Увімкніть інтерактивний редактор і додайте `<a href="#">Products</a>` всередині `nav`, щоб побачити зміни у вікні попереднього перегляду. @@ -97,6 +109,8 @@ dashedName: what-is-the-difference-between-presentational-and-semantic-html Семантичні елементи чітко показують своє призначення в структурі HTML. Існує багато різних семантичних HTML-елементів. Ви обов’язково знайдете той, що підходить для вашого проєкту. +## Підсумок + Чудова робота. Тепер ви знаєте різницю між презентаційним і семантичним HTML: семантичний HTML описує вміст, а презентаційний HTML зосереджується на зовнішньому вигляді. # --questions-- diff --git a/curriculum/challenges/ukrainian/blocks/lecture-introduction-to-javascript-libraries-and-frameworks/6734e88cc46e6dc679420040.md b/curriculum/challenges/ukrainian/blocks/lecture-introduction-to-javascript-libraries-and-frameworks/6734e88cc46e6dc679420040.md index cfde37454ec..fd752269699 100644 --- a/curriculum/challenges/ukrainian/blocks/lecture-introduction-to-javascript-libraries-and-frameworks/6734e88cc46e6dc679420040.md +++ b/curriculum/challenges/ukrainian/blocks/lecture-introduction-to-javascript-libraries-and-frameworks/6734e88cc46e6dc679420040.md @@ -13,7 +13,7 @@ dashedName: what-is-vite-and-how-can-it-be-used-to-set-up-a-new-react-project Щоб створити новий проєкт за допомогою Vite, вам потрібно буде скористатися командним рядком. Якщо ви працюєте на Windows, можете використовувати Command Prompt або Windows PowerShell. Якщо ви на Mac, скористайтеся застосунком Terminal. -Якщо у вас не встановлено Node.js, який потрібен для роботи npm, ось посилання на офіційну сторінку Node.js: https://nodejs.org. Дотримуйтесь інструкцій з встановлення, а потім поверніться сюди, щоб продовжити встановлення React. +Якщо у вас не встановлено Node.js, який потрібен для роботи npm, ось посилання на офіційну вебсторінку Node.js: [nodejs.org](https://nodejs.org). Дотримуйтесь інструкцій з встановлення, а потім поверніться сюди, щоб продовжити встановлення React. Коли командний рядок відкрито, ви можете використати таку команду: @@ -36,7 +36,7 @@ npm install Команда `cd my-react-app` гарантує, що ви перейшли до правильної папки, де знаходиться ваш проєкт. -Команда `npm install` використовується для встановлення залежностей, необхідних для правильного запуску вашого проєкту React. Залежності — це бібліотеки або пакунки, які потрібні вашому проєкту React для коректної роботи, наприклад, сам React, ReactDOM або інші сторонні пакунки, що додають додатковий функціонал. +Команда `npm install` використовується для встановлення залежностей, необхідних для правильного запуску вашого React проєкту. Залежності — це бібліотеки або пакети, які потрібні вашому React проєкту для коректної роботи, такі як сам React, `react-dom` або інші сторонні пакети, що надають додатковий функціонал. Виконання `npm install` прочитає файл `package.json` у папці вашого проєкту та встановить усі залежності, які там перераховані, що дозволить вам збирати та запускати ваш застосунок React без відсутніх компонентів. @@ -50,11 +50,11 @@ npm install Ви побачите стартовий шаблон, який Vite підготував для вас. -Якщо потрібно зупинити локальний сервер, натисніть `CTRL + C` у командному рядку. +Якщо потрібно зупинити локальний сервер, натисніть `Ctrl + C` у командному рядку. -Щоб побачити код цього стартового шаблону, зайдіть у ваш проєкт у папці `src`, і ви побачите файл `App.jsx`. +Щоб побачити код цього стартового шаблону, відкрийте папку `src` у вашому проєкті, де ви знайдете файл `App.jsx`. -Звідти ви можете почати змінювати файл, зберігати зміни і бачити оновлення у браузері. +Звідти ви можете змінювати файл, зберігати свої зміни та спостерігати, як вони з’являються у браузері. І з цим ви готові почати створювати свій застосунок React! diff --git a/curriculum/challenges/ukrainian/blocks/lecture-introduction-to-javascript/672d49959621885e9d3e672c.md b/curriculum/challenges/ukrainian/blocks/lecture-introduction-to-javascript/672d49959621885e9d3e672c.md index 2c7735cd166..5f2b06f213c 100644 --- a/curriculum/challenges/ukrainian/blocks/lecture-introduction-to-javascript/672d49959621885e9d3e672c.md +++ b/curriculum/challenges/ukrainian/blocks/lecture-introduction-to-javascript/672d49959621885e9d3e672c.md @@ -72,6 +72,16 @@ console.log(age); // 25 ::: +Хоча змінну, оголошену за допомогою `let`, можна переназначити, її не можна оголосити знову. Якщо ви спробуєте оголосити ту саму змінну знову за допомогою `let`, ви отримаєте помилку: + +```js +let age = 25; + +let age = 90; // SyntaxError: Identifier 'age' has already been declared +``` + +Те саме стосується і `const`: змінну, оголошену за допомогою `const`, також не можна оголосити повторно. + Змінні, оголошені з `const`, повинні отримувати значення під час оголошення. Якщо ви спробуєте оголосити змінну `const` без присвоєння значення, отримаєте помилку: ```js diff --git a/curriculum/challenges/ukrainian/blocks/lecture-understanding-aria-expanded-aria-live-and-common-aria-states/672a54dff9dc439089f1a219.md b/curriculum/challenges/ukrainian/blocks/lecture-understanding-aria-expanded-aria-live-and-common-aria-states/672a54dff9dc439089f1a219.md index 4103417c275..d4b86adbad0 100644 --- a/curriculum/challenges/ukrainian/blocks/lecture-understanding-aria-expanded-aria-live-and-common-aria-states/672a54dff9dc439089f1a219.md +++ b/curriculum/challenges/ukrainian/blocks/lecture-understanding-aria-expanded-aria-live-and-common-aria-states/672a54dff9dc439089f1a219.md @@ -15,6 +15,8 @@ dashedName: what-is-the-aria-live-attribute Існує три можливі значення цього атрибута, залежно від пріоритету інформації. +## Значення `assertive` + Якщо ви встановите `aria-live` у значення `assertive`, це означає, що оновлення дуже важливе. Воно має найвищий пріоритет, тому користувача слід повідомити негайно. Це означає, що читач екрана перерве будь-яке оголошення, яке він зараз робить, щоб оголосити зміну вмісту в live-регіоні. Такі переривання можуть бути надзвичайно дратівливими, тому значення `assertive` слід використовувати лише для повідомлень, що потребують негайної уваги або є критичними. @@ -81,6 +83,8 @@ document.addEventListener("DOMContentLoaded", () => { ::: +## Значення `polite` + Наступне за пріоритетом значення — `polite`. Це значення означає, що оновлення не є терміновим, тому читач екрана може почекати, поки поточне оголошення завершиться або користувач припинить вводити текст, перш ніж оголосити оновлення. Більшість live-регіонів використовують значення `polite`. @@ -147,10 +151,16 @@ document.addEventListener("DOMContentLoaded", () => { ::: +## Значення `off` + Найнижчим пріоритетом для `aria-live` є значення `off`, що означає, що оновлення не буде оголошене, якщо вміст не знаходиться в елементі, який наразі має фокус клавіатури. Реалістично це значення майже ніколи не використовується, оскільки випадок застосування дуже вузький і воно не реалізоване послідовно (якщо взагалі) у читачах екрана. Якщо вам потрібні live-регіони, плануйте використовувати `polite` для всього, крім критичних повідомлень, які потребують `assertive`. +## Регіони з живим оновленням за замовчуванням із ролей ARIA + Також важливо зазначити, що атрибут `aria-live` не є обов’язковим, якщо оновлена інформація міститься в елементі з ARIA-роллю `alert`, `log`, `marquee`, `status` або `timer`, оскільки ці ролі вже мають значення `aria-live` за замовчуванням. Але значення за замовчуванням можна змінити, явно встановивши `aria-live` на елементі. +## Вибір правильного значення + Вибір правильного значення `aria-live` залежить від пріоритету оновленої інформації. Якщо оновлення термінові, слід негайно повідомити користувача за допомогою `assertive`. Але це слід робити лише тоді, коли оновлення справді термінові, оскільки раптові переривання можуть дезорієнтувати користувачів і вплинути на досвід користування. diff --git a/curriculum/challenges/ukrainian/blocks/lecture-understanding-computer-internet-and-tooling-basics/672aa578a2129554d4675049.md b/curriculum/challenges/ukrainian/blocks/lecture-understanding-computer-internet-and-tooling-basics/672aa578a2129554d4675049.md index a6c8ad19b2a..c98eb78ec15 100644 --- a/curriculum/challenges/ukrainian/blocks/lecture-understanding-computer-internet-and-tooling-basics/672aa578a2129554d4675049.md +++ b/curriculum/challenges/ukrainian/blocks/lecture-understanding-computer-internet-and-tooling-basics/672aa578a2129554d4675049.md @@ -11,13 +11,13 @@ dashedName: what-are-the-basic-parts-of-a-computer Як розробнику, важливо розуміти базові внутрішні процеси комп’ютера. -Першим основним компонентом комп’ютера є материнська плата. Вона містить усю пам’ять і роз’єми, необхідні для роботи комп’ютера. Вона слугує головною друкованою платою комп’ютера. +Першим основним компонентом комп’ютера є материнська плата. Материнська плата містить усю пам’ять і роз’єми, необхідні для запуску комп’ютера. Вона слугує головною друкованою платою комп’ютера. -У корпусі комп’ютера на материнській платі ви знайдете CPU, що означає центральний процесор. CPU — це процесор, який відповідає за виконання інструкцій і проведення обчислень. Його часто називають мозком комп’ютера. +Всередині корпусу комп’ютера, встановлений на материнській платі, ви знайдете CPU, що означає Central Processing Unit. CPU — це процесор, який відповідає за виконання інструкцій і виконання обчислень. Його часто називають мозком комп’ютера. -CPU — це маленький квадрат із чіпом, який вставляється в роз’єм CPU на материнській платі. Швидкість процесора CPU вимірюється в гігагерцах (GHz) та мегагерцах (MHz). Гігагерц — це мільярд циклів за секунду, а мегагерц — мільйон циклів за секунду. +CPU — це маленький квадратний чіп, який вставляється в роз’єм CPU на материнській платі. Швидкість CPU вимірюється в гігагерцах (GHz) і мегагерцах (MHz). Гігагерц — це мільярд циклів за секунду, а мегагерц — мільйон циклів за секунду. -Наступним критично важливим компонентом комп’ютера є оперативна пам’ять. Вона відома як RAM або пам’ять із випадковим доступом. RAM — це тимчасове сховище для CPU комп’ютера. Коли комп’ютеру потрібно швидко отримати доступ до даних, він використовує RAM. +Наступним критично важливим компонентом комп’ютера є короткочасна пам’ять системи. Вона відома як RAM, або Random Access Memory. RAM — це тимчасове сховище для CPU комп’ютера. Коли комп’ютеру потрібно швидко отримати доступ до даних, він використовує RAM. Чим більше RAM у вашому комп’ютері, тим швидше він працюватиме і тим більше програм ви зможете запускати одночасно. Якщо RAM закінчується, комп’ютер працюватиме повільніше, і ви помітите різницю в продуктивності. @@ -27,13 +27,13 @@ CPU — це маленький квадрат із чіпом, який вст Жорсткий диск складається з обертового диска та важеля. Диск — це місце зберігання даних, а важіль використовується для читання та запису даних на диск. Якщо у вас швидший жорсткий диск, комп’ютер завантажуватиметься швидше, а програми працюватимуть швидше. -Іншим типом сховища даних є твердотільний накопичувач, або SSD. SSD — це енергонезалежна флеш-пам’ять, яку можна використовувати замість жорсткого диска. SSD швидші та менші за жорсткі диски, але жорсткі диски дешевші і мають більшу ємність. +Ще одним типом зберігання даних є твердотільний накопичувач, або SSD. SSD — це енергонезалежна флеш-пам’ять, яку можна використовувати замість жорсткого диска. SSD швидші й менші за жорсткі диски, але жорсткі диски дешевші і мають більшу ємність зберігання. Ще одним ключовим компонентом комп’ютера є блок живлення, або PSU. PSU відповідає за перетворення електрики з розетки у форму, яку комп’ютер може використовувати. Він подає живлення від розетки до материнської плати, CPU та інших компонентів комп’ютера. -Ще одним важливим компонентом є плати розширення. Ці плати вставляються в материнську плату, щоб додати додаткові функції комп’ютеру. Прикладами плат розширення є відеокарта, звукова карта та мережева карта. +Ще одним ключовим компонентом є плата розширення. Ці плати вставляються в материнську плату, щоб додати додаткову функціональність комп’ютеру. Прикладами плат розширення є відеокарта, звукова карта та мережева карта. -Відеокарта, також відома як графічний процесор або GPU, відповідає за відтворення зображень на екрані комп’ютера. +Відеокарта, також відома як Graphics Processing Unit, або GPU, відповідає за відтворення зображень на екрані комп’ютера. Звукова карта відповідає за відтворення звуку через динаміки комп’ютера. @@ -53,7 +53,7 @@ CPU — це маленький квадрат із чіпом, який вст ### --feedback-- -Подумайте про тимчасове зберігання даних. +Подумайте про короткочасне зберігання даних. --- @@ -65,7 +65,7 @@ CPU — це маленький квадрат із чіпом, який вст ### --feedback-- -Подумайте про тимчасове зберігання даних. +Подумайте про короткочасне зберігання даних. --- @@ -73,7 +73,7 @@ CPU — це маленький квадрат із чіпом, який вст ### --feedback-- -Подумайте про тимчасове зберігання даних. +Подумайте про короткочасне зберігання даних. ## --video-solution-- @@ -85,7 +85,7 @@ CPU — це маленький квадрат із чіпом, який вст ## --answers-- -Centered Protocol Unit. +Центральний процесорний блок. ### --feedback-- @@ -93,7 +93,7 @@ Centered Protocol Unit. --- -City Processing Unit. +Міський процесорний блок. ### --feedback-- @@ -101,11 +101,11 @@ City Processing Unit. --- -Central Processing Unit. +Центральний процесор. --- -Central Pixel Unit. +Центральний піксельний блок. ### --feedback-- @@ -125,7 +125,7 @@ Central Pixel Unit. ### --feedback-- -Перегляньте кінець уроку для відповіді. +Повторіть кінець уроку, щоб знайти відповідь. --- @@ -133,7 +133,7 @@ Central Pixel Unit. ### --feedback-- -Перегляньте кінець уроку для відповіді. +Повторіть кінець уроку, щоб знайти відповідь. --- @@ -145,7 +145,7 @@ Central Pixel Unit. ### --feedback-- -Перегляньте кінець уроку для відповіді +Повторіть кінець уроку, щоб знайти відповідь. ## --video-solution-- diff --git a/curriculum/challenges/ukrainian/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab82c1a9bbd0e3aabc39d.md b/curriculum/challenges/ukrainian/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab82c1a9bbd0e3aabc39d.md index 5ca20f3f7b5..a773f708a59 100644 --- a/curriculum/challenges/ukrainian/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab82c1a9bbd0e3aabc39d.md +++ b/curriculum/challenges/ukrainian/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab82c1a9bbd0e3aabc39d.md @@ -7,11 +7,11 @@ dashedName: how-to-effectively-work-with-your-keyboard-mouse-and-other-pointing- # --description-- -Багато хто з вас звик працювати з клавіатурою та мишею роками для різних завдань, таких як ігри, виконання робочих завдань або серфінг в інтернеті. +Багато хто з вас роками працює зі своїм клавіатурою та мишею для різних завдань, таких як ігри, виконання робочих завдань або серфінг в інтернеті. Але тривале неправильне використання цих пристроїв може призвести до серйозних проблем зі здоров’ям у майбутньому. -У цьому уроці ми розглянемо способи здорового використання клавіатури та миші вашого комп’ютера. +У цьому уроці ми розглянемо способи здорової роботи з клавіатурою та мишею вашого комп’ютера. Перша порада — звертайте увагу на хват миші. Під час серйозної роботи або інтенсивних ігрових моментів ви можете схильні сильно стискати мишу. Однак це може спричинити серйозні проблеми з руками та зап’ястями. Щоб цього уникнути, тримайте мишу ніжно і тримайте пальці розслабленими. @@ -25,7 +25,7 @@ dashedName: how-to-effectively-work-with-your-keyboard-mouse-and-other-pointing- Хоча підтримка правильної постави важлива, сучасна ергономіка підкреслює значення руху та динамічного сидіння. Людське тіло створене для руху, і тривале перебування в будь-якій фіксованій позі, навіть прямій, може створювати безперервний тиск на хребет. Регулярні перерви, зміна положення протягом дня та підтримка природного положення зап’ясть допоможуть покращити кровообіг, зменшити втому та підтримати здоров’я хребта в довгостроковій перспективі. -Остання порада — використовуйте клавіатурні скорочення, коли це можливо, щоб мінімізувати набір тексту. Існують десятки скорочень для навігації в інтернеті, операційній системі, роботі в редакторі коду та інших завданнях. Тож варто дослідити деякі з цих клавіатурних скорочень і почати застосовувати їх у щоденній роботі за комп’ютером. +Остання порада — використовувати клавіатурні скорочення, коли це можливо, щоб менше тягнутися до миші. Існують десятки скорочень для таких завдань, як навігація в інтернеті, робота з операційною системою, робота в редакторі коду та інше. Тож найкраще дослідити деякі з цих клавіатурних скорочень і почати впроваджувати їх у своє щоденне використання комп’ютера. Продовжуючи працювати з мишею та клавіатурою у майбутніх проєктах і інших завданнях, пам’ятайте про ці поради для збереження здоров’я. @@ -109,7 +109,7 @@ dashedName: how-to-effectively-work-with-your-keyboard-mouse-and-other-pointing- ## --answers-- -Миша має бути значно вище за клавіатуру. +Висота миші не має значення. ### --feedback-- diff --git a/curriculum/challenges/ukrainian/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab83c4297910eade53c2e.md b/curriculum/challenges/ukrainian/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab83c4297910eade53c2e.md index 6367f8ea4d0..99966c04257 100644 --- a/curriculum/challenges/ukrainian/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab83c4297910eade53c2e.md +++ b/curriculum/challenges/ukrainian/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab83c4297910eade53c2e.md @@ -7,17 +7,17 @@ dashedName: what-are-the-different-types-of-internet-service-providers # --description-- -По-перше, що таке провайдер інтернет-послуг, або ISP? Це компанія, яка продає доступ до глобальної мережі інтернету, по суті. І вони поділяються на три різні рівні. +По-перше, що таке інтернет-провайдер, або ISP? Це, по суті, компанія, яка продає доступ до глобальної інтернет-мережі. І вони поділяються на три різні рівні. Перший рівень — це великі конгломератні компанії, які мають інфраструктуру для самостійного оброблення більшої частини (якщо не всього) свого мережевого трафіку. -Другий рівень — це провайдери, що працюють на рівні країни, які іноді орендують доступ до мереж першого рівня, але можуть досить добре функціонувати самостійно. +Другий рівень — це провайдери на рівні країни, які іноді орендують доступ до мереж першого рівня, але можуть досить добре функціонувати самостійно. -Третій рівень — це невеликі компанії, які в основному зосереджені на наданні інтернету локальним ринкам і покладаються на більших ISP для забезпечення своєї інфраструктури. +Третій рівень — це невеликі компанії, які переважно зосереджені на наданні інтернету локальним ринкам і покладаються на більших ISP для забезпечення своєї інфраструктури. Ці провайдери також пропонують різні типи підключень. -Оптоволоконні підключення використовують скляні або пластикові волокна для передачі даних за допомогою світла, що забезпечує дуже високу швидкість з’єднання та обміну даними. +Волоконно-оптичні з’єднання використовують скляні або пластикові волокна для передачі даних за допомогою світла, що забезпечує дуже високі швидкості з’єднання та обміну даними. Кабельні підключення використовують ту ж інфраструктуру, що й провайдер кабельного телебачення, що часто робить їх доступними у багатьох регіонах. @@ -25,7 +25,7 @@ DSL-підключення використовують інфраструкту Діалап також використовує телефонні лінії, але вимагає виключного підключення (вимикаючи використання лінії для телефонних цілей під час підключення до інтернету). Це значно старіша технологія, яка вийшла з ужитку. -Супутникові підключення використовують масив супутників, що обертаються навколо Землі, для з’єднання різних пристроїв по всьому світу. І нарешті, подібно до цього, провайдер домашнього інтернету 5G використовує інфраструктуру стільникових веж, щоб тримати вас онлайн. +Супутникові з’єднання використовують масив супутників, що обертаються навколо Землі, для підключення різних пристроїв по всьому світу. І нарешті, подібно до цього, провайдер домашнього інтернету 5G використовує інфраструктуру стільникових веж, щоб тримати вас онлайн. І це має дати вам базове уявлення про типи провайдерів інтернет-послуг і типи інтернет-з’єднань, які існують! @@ -33,7 +33,7 @@ DSL-підключення використовують інфраструкту ## --text-- -Який із наведених варіантів НЕ є рівнем провайдера інтернет-послуг (ISP)? +Який із наведених варіантів НЕ є рівнем інтернет-провайдера (ISP)? ## --answers-- @@ -89,7 +89,7 @@ DSL-підключення. --- -Оптоволоконне підключення. +Волоконно-оптичне з’єднання. --- diff --git a/curriculum/challenges/ukrainian/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab8573f32480f192aaae1.md b/curriculum/challenges/ukrainian/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab8573f32480f192aaae1.md index 063a557fed5..8cb7c5f9022 100644 --- a/curriculum/challenges/ukrainian/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab8573f32480f192aaae1.md +++ b/curriculum/challenges/ukrainian/blocks/lecture-understanding-computer-internet-and-tooling-basics/672ab8573f32480f192aaae1.md @@ -9,7 +9,7 @@ dashedName: what-are-the-different-types-of-tools-professional-developers-use Професійні розробники покладаються на різноманітні інструменти, щоб підвищити продуктивність і якість коду. Давайте дізнаємося про ці інструменти, включно з тими, що здаються дуже очевидними. -Першим серед інструментів є комп’ютери. Комп’ютер — це основне середовище розробки. Це може бути потужний настільний комп’ютер або портативний ноутбук з операційною системою Windows, macOS або Linux. +Першим інструментом є сам комп’ютер. Комп’ютер — це основне середовище розробки. Це може бути потужний настільний комп’ютер або портативний ноутбук з операційною системою Windows, macOS або Linux. Професійні розробники часто обирають комп’ютери з високою швидкістю обробки та великою кількістю оперативної пам’яті, щоб справлятися з ресурсомісткими завданнями. @@ -21,7 +21,7 @@ Visual Studio Code (VS Code) фактично є редактором коду, Інші редактори коду — Sublime Text, Atom, Notepad++ і Brackets. -Коли ви пишете код за допомогою редакторів коду та IDE, потрібно відстежувати внесені зміни. Інструмент, який дозволяє відслідковувати ці зміни, — це система контролю версій. +Коли ви пишете код за допомогою редакторів коду та IDE, потрібно відстежувати зміни, які ви вносите в цей код. Інструмент, який дозволяє відстежувати ці зміни, — це система контролю версій. Git — найпоширеніша система контролю версій у спільноті розробників. @@ -31,8 +31,8 @@ Git — найпоширеніша система контролю версій Приклади популярних менеджерів пакетів: -* NPM, Yarn і PNPM для JavaScript -* PIP для Python +* npm, Yarn і pnpm для JavaScript +* pip для Python * Composer для PHP * Maven для Java diff --git a/curriculum/challenges/ukrainian/blocks/lecture-understanding-error-handling-and-health-checks/69f3046f4c0e76cbdd24858e.md b/curriculum/challenges/ukrainian/blocks/lecture-understanding-error-handling-and-health-checks/69f3046f4c0e76cbdd24858e.md index 57285ac5031..9048d058600 100644 --- a/curriculum/challenges/ukrainian/blocks/lecture-understanding-error-handling-and-health-checks/69f3046f4c0e76cbdd24858e.md +++ b/curriculum/challenges/ukrainian/blocks/lecture-understanding-error-handling-and-health-checks/69f3046f4c0e76cbdd24858e.md @@ -34,7 +34,7 @@ app.use((err, req, res, next) => { Express розпізнає його як обробник помилок, бо він має чотири параметри — новий `err`, крім звичних `req`, `res` та `next`, які є у звичайних функціях підпрограмного забезпечення. -У наступному уроці ви дізнаєтеся більше про обробники помилок і як вони вписуються у загальний стек підпрограм Express. +Як ви бачили в попередньому уроці, підпрограмне забезпечення для обробки помилок інтегрується у ширший стек підпрограмного забезпечення Express. ## Як обробляти асинхронні помилки @@ -251,6 +251,7 @@ Express перевіряє їх лише після всіх маршрутів. Express перевіряє їх лише після всіх маршрутів. + ## --video-solution-- 3 diff --git a/curriculum/challenges/ukrainian/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/6733affc29df1304e2c97e88.md b/curriculum/challenges/ukrainian/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/6733affc29df1304e2c97e88.md index c720385b008..7f19c1415f4 100644 --- a/curriculum/challenges/ukrainian/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/6733affc29df1304e2c97e88.md +++ b/curriculum/challenges/ukrainian/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/6733affc29df1304e2c97e88.md @@ -31,6 +31,8 @@ class MyClassName { Вміст у фігурних дужках називають тілом класу. Саме тут розміщуються конструктор і методи. +## Визначення конструкторів + Конструктор — це спеціальний метод, який викликається автоматично, коли створюється новий об’єкт із класу. Зазвичай його використовують для ініціалізації властивостей об’єкта. У цьому прикладі ви бачите клас `Dog` із конструктором. @@ -45,6 +47,8 @@ class Dog { Ключове слово `this` тут використовується для посилання на поточний екземпляр класу `Dog`, що дозволяє призначити властивість `name` об’єкту, який створюється. Ви дізнаєтеся більше про ключове слово `this` у майбутньому уроці. +## Визначення методів + Під конструктором можуть бути методи. Методи — це функції, визначені всередині класу, які виконують дії або операції. Вони використовуються для визначення поведінки, яку можуть виконувати екземпляри класу. Ось приклад додавання методу з назвою `bark` до класу `Dog`. @@ -63,6 +67,8 @@ class Dog { Коли викликається метод `bark`, повідомлення буде виведено в консоль із фактичним ім’ям, яке було передано. Якщо створити екземпляр `Dog` з ім’ям `"Buddy"`, виклик методу `bark()` на цьому екземплярі виведе в консоль `"Buddy says woof!"`. +## Створення екземпляра класу + Після визначення класу ви можете створити його екземпляр за допомогою ключового слова `new`, назви класу та його аргументів. У цьому прикладі ми створюємо новий екземпляр `Dog` з ім’ям `Gino` і призначаємо його змінній `dog`. @@ -73,7 +79,9 @@ const dog = new Dog("Gino"); Коли ви пишете `new Dog("Gino")` у коді, створюється новий об’єкт, і конструктор викликається автоматично з переданими аргументами. -Потім ви можете отримати доступ до цієї властивості, використовуючи точкову нотацію, як видно в наступному рядку коду: +## Доступ до властивостей і методів + +Потім ви можете отримати доступ до властивості `name`, використовуючи точкову нотацію, як показано в наступному рядку коду: ```js console.log(dog.name); @@ -127,6 +135,8 @@ dog.bark(); ::: +## Використання класових виразів + Як уже згадувалося, класи можна також визначати як вираз класу. Це коли клас анонімний і призначений змінній. Ось як виглядає попередній приклад у вигляді виразу класу: diff --git a/curriculum/challenges/ukrainian/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/673403ca2bb16658309e3632.md b/curriculum/challenges/ukrainian/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/673403ca2bb16658309e3632.md index fe48e2f7dd0..051a2049a30 100644 --- a/curriculum/challenges/ukrainian/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/673403ca2bb16658309e3632.md +++ b/curriculum/challenges/ukrainian/blocks/lecture-understanding-how-to-work-with-classes-in-javascript/673403ca2bb16658309e3632.md @@ -11,6 +11,8 @@ dashedName: how-does-the-this-keyword-work Ці шаблони потребують загального способу посилатися на конкретний об’єкт, який створюється, до якого здійснюється доступ або який змінюється в коді. Саме для цього використовується ключове слово `this`. Воно посилається на контекст, у якому має виконуватися код. Якщо ви використовуєте його всередині методу, значення `this` буде референсом на об’єкт, пов’язаний із цим методом. Таким чином ви можете отримати доступ до властивостей і методів об’єкта всередині класу та повторно використовувати метод для різних об’єктів. +## Конструктори + Наприклад, тут у нас є клас `Dessert`. Цього разу ми визначаємо властивість `hasPeanuts`. ```js @@ -33,6 +35,8 @@ this.hasPeanuts = hasPeanuts; Це в контексті конструктора, але ви також можете використовувати ключове слово `this` у інших методах. +## Методи + Ось наш клас `Dessert` з кількома змінами. Тепер у нас є дві властивості: `name` і `price`. ```js @@ -91,10 +95,16 @@ console.log(brownie); Все це завдяки ключовому слову `this`, яке дає загальний спосіб посилатися на поточний об’єкт всередині класу. Це дозволяє повторно використовувати метод для різних об’єктів. +## Функції та стрілкові функції + Це в контексті методів об’єктів, але ключове слово `this` також матиме значення у звичайних функціях і стрілкових функціях. +### Звичайні функції + Його значення у звичайній функції зазвичай посилається на глобальний об’єкт (у нестрогому режимі) або `undefined` (у строгому режимі). +### Стрілкові функції + Значення ключового слова `this` трохи відрізняється у стрілкових функціях. Стрілкові функції успадковують значення `this` із зовнішньої області видимості, де вони визначені. Вони не створюють власного зв’язку `this`. Це означає, що значення `this` залежить від контексту, у якому визначена стрілкова функція, а не від того, де або як вона викликається. Це робить стрілкові функції корисними для функцій зворотного виклику або для збереження контексту. Однак через це значення `this` не посилатиметься на поточний об’єкт у методах об’єктів, тож це слід враховувати при роботі зі стрілковими функціями. @@ -183,7 +193,7 @@ console.log(brownie); ## --answers-- -При визначенні функцій. +Під час визначення функцій. ### --feedback-- diff --git a/curriculum/challenges/ukrainian/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5160.md b/curriculum/challenges/ukrainian/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5160.md index 84ee1aa8146..b24c34b1957 100644 --- a/curriculum/challenges/ukrainian/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5160.md +++ b/curriculum/challenges/ukrainian/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5160.md @@ -14,17 +14,17 @@ dashedName: whats-the-process-for-creating-web-standards 1. ## Визначення потреби Стандарти починаються з тертя, наприклад, коли розробники стикаються з проблемою, браузери реалізують однакову поведінку по-різному і несумісно, або платформа просто не підтримує нову можливість. Хтось десь настільки розчаровується, що записує це. Ця людина може бути будь-хто: розробник, велика компанія з потребою у продукті або інженер у команді браузера. На цьому етапі важливі не повноваження, а докази та питання, чи є проблема реальною і чи достатньо людей з нею стикаються, щоб заслуговувати на увагу веб-платформи. -1. **Пропозиція та раннє обговорення** - Ідею неформально оформлюють через GitHub issue, короткий документ або пояснювальну записку, що описує проблему і накидає можливе рішення. Мета на цьому етапі — не створити готову специфікацію, а з’ясувати, чи резонує проблема. Чи визнають її інші розробники? Чи зацікавлені постачальники браузерів? Чи є очевидне рішення або кілька конкуруючих? У TC39 цей ранній етап відповідає Стадії 0 і Стадії 1. У W3C це часто відбувається неформально у Community Group перед створенням формальної робочої групи. WHATWG веде це через відкриті обговорення на GitHub у своїх основних репозиторіях. Місце відрізняється, але функція однакова. +1. ## Пропозиція та раннє обговорення + Ідею неформально оформлюють через GitHub issue, короткий документ або пояснювальну записку, яка описує проблему та окреслює можливе рішення. На цьому етапі мета не в тому, щоб створити готову специфікацію, а з’ясувати, чи резонує проблема. Чи визнають її інші розробники? Чи зацікавлені постачальники браузерів? Чи є очевидне рішення, або кілька конкуруючих? У TC39 цей ранній етап відповідає Стадії 0 і Стадії 1. У W3C це часто відбувається неформально в Community Group перед створенням офіційної Working Group. WHATWG опрацьовує це через відкриті обговорення на GitHub у своїх основних репозиторіях. Місце проведення різниться, але функція однакова. -1. **Написання специфікації** - Якщо пропозиція набирає обертів, хтось або невелика команда має написати власне специфікацію, або spec. Специфікація — це не блог чи навчальний посібник, а точний, формальний документ, що описує, як функція має поводитися у кожній можливій ситуації. Потрібно продумати і записати крайні випадки, умови помилок, взаємодії з існуючими функціями та наслідки для безпеки. +1. ## Написання специфікації + Якщо пропозиція набирає обертів, хтось або невелика команда має написати власне специфікацію, або spec. Специфікація — це не блог-пост чи навчальний посібник, а точний, формальний документ, який описує, як функція має поводитися в кожній можливій ситуації. Потрібно продумати і записати крайні випадки, умови помилок, взаємодії з існуючими функціями та наслідки для безпеки. -1. **Перегляд, заперечення та ітерації** - Чернетка публікується і переглядається публічно та іншими постачальниками браузерів. Тут відбувається більшість реальної роботи. Виникають заперечення, і специфікацію переглядають. Функція, яку один із основних рушіїв браузера відмовляється реалізовувати, рідко стає стандартом, незалежно від технічних переваг. Формування консенсусу на цьому етапі може зайняти багато часу. Деякі пропозиції затягуються на роки, поки постачальники домовляються про деталі дизайну. Інші зовсім відмирають, коли стає зрозуміло, що домовленість неможлива. +1. ## Повторення, заперечення та ітерація + Чернетка публікується і переглядається публічно, а також іншими постачальниками браузерів. Саме тут відбувається більшість реальної роботи. Висуваються заперечення, і специфікація переглядається. Функція, яку один із основних рушіїв браузера відмовляється реалізовувати, рідко стає стандартом, незалежно від її технічних переваг. Формування консенсусу на цьому етапі може зайняти багато часу. Деякі пропозиції затягуються на роки, поки постачальники домовляються про деталі дизайну. Інші повністю відмирають, коли стає зрозуміло, що досягти згоди неможливо. -1. **Реалізація та тестування** - Коли специфікація стає достатньо стабільною, постачальники браузерів починають її реалізовувати. Зазвичай це починається з прапорця функції, щоб її можна було протестувати, не впливаючи на існуючих користувачів. Реалізація часто виявляє проблеми, яких специфікація не передбачала, і тоді їх повертають редакторам для уточнення. Спільний набір тестів перевіряє, що кожна реалізація поводиться однаково. Якщо Chrome, Firefox і Safari проходять одні й ті ж тести, специфікація працює. Якщо вони розходяться, або специфікація нечітка, або одна з реалізацій має помилку. +1. ## Реалізація та тестування + Коли специфікація стає достатньо стабільною, постачальники браузерів починають її реалізовувати. Зазвичай це починається з прапорця функції, щоб її можна було протестувати, не впливаючи на існуючих користувачів. Реалізація часто виявляє проблеми, яких специфікація не передбачала, і тоді їх повертають редакторам для уточнення. Спільний набір тестів перевіряє, що кожна реалізація поводиться однаково. Якщо Chrome, Firefox і Safari проходять одні й ті ж тести, специфікація працює. Якщо вони розходяться, або специфікація нечітка, або одна з реалізацій містить помилку. 1. ## Фіналізація Коли існує кілька незалежних реалізацій, тести проходять, і спільнота задоволена, стандарт фіналізують. У W3C це означає отримання статусу Recommendation. У TC39 це означає досягнення Стадії 4, після чого функція включається до наступного щорічного випуску ECMAScript. У WHATWG немає єдиного моменту фіналізації, живий стандарт просто відображає поточний консенсус, оновлюючись безперервно. Весь процес може тривати від кількох місяців для невеликого, безспірного доповнення до понад десятиліття для чогось складного або політично суперечливого. Наприклад, CSS Grid вперше запропонували у 2011 році, а в усіх основних браузерах він з’явився лише у 2017. Цей розрив між гарною ідеєю та стабільним, універсально підтримуваним стандартом — це місце, де тихо відбувається більшість роботи відкритого вебу. @@ -109,7 +109,7 @@ dashedName: whats-the-process-for-creating-web-standards ## --answers-- -Щоб замінити потребу у письмовій специфікації. +Замінити потребу у письмовій специфікації. ### --feedback-- @@ -121,7 +121,7 @@ dashedName: whats-the-process-for-creating-web-standards --- -Щоб ранжувати продуктивність браузерів для маркетингових цілей. +Оцінити продуктивність браузерів для маркетингу. ### --feedback-- diff --git a/curriculum/challenges/ukrainian/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5161.md b/curriculum/challenges/ukrainian/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5161.md index 6478ad2ffbe..35fbb53bb7e 100644 --- a/curriculum/challenges/ukrainian/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5161.md +++ b/curriculum/challenges/ukrainian/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5161.md @@ -13,23 +13,23 @@ dashedName: what-does-the-lifecycle-of-web-standards-features-look-like Уявіть цей процес як правила гри, а життєвий цикл — як те, що насправді відбувається під час гри. -1. **Пропозиція** - Кожна функція починається з проблеми, яку хтось вважав достатньо важливою, щоб записати. Розробник, інженер браузера або компанія створюють GitHub issue або пояснювальний документ, у якому описують, що веб наразі не може зробити і чому це потрібно. На цьому етапі ідея є розпливчастою, з більше питаннями, ніж відповідями. Мета — просто з’ясувати, чи хтось ще відчуває ту саму проблему. +1. ## Пропозиція + Кожна функція починається з проблеми, яку хтось вважав достатньо важливою, щоб записати. Розробник, інженер браузера або компанія створюють GitHub issue або пояснювальний документ, у якому описують, що веб наразі не може зробити і чому це потрібно. На цьому етапі ідея є розпливчастою, з більше запитань, ніж відповідей. Мета — просто дізнатися, чи хтось ще відчуває ту саму проблему. -1. **Інкубація** - Якщо пропозиція знаходить відгук, вона переходить у період відкритого обговорення та раннього проєктування. Конкурентні підходи начерковуються, збираються варіанти використання, а спільнота перевіряє ідею на міцність. Багато пропозицій гинуть саме тут, можливо, через те, що проблема виявляється надто вузькоспеціалізованою або жодне рішення не задовольняє всіх. Ті, що виживають, виходять із чіткішою формою і принаймні з деяким інтересом з боку розробників браузерів. +1. ## Інкубація + Якщо пропозиція знаходить відгук, вона переходить у період відкритого обговорення та раннього дизайну. Конкурентні підходи начерковуються, збираються випадки використання, а спільнота перевіряє ідею на міцність. Багато пропозицій гинуть саме тут, можливо, тому що проблема виявляється занадто вузькоспеціалізованою або жодне рішення не може задовольнити всіх. Ті, що виживають, набувають чіткішої форми і отримують принаймні деякий інтерес з боку розробників браузерів. -1. **Специфікація** - Виживша пропозиція оформлюється у формальний стандарт. Кожен крайній випадок, умова помилки та взаємодія з існуючими функціями мають бути чітко визначені. Це момент, коли хороша ідея зустрічається з жорсткою реальністю. Розпливчасті концепції мають стати точними правилами, які два незалежні інженери можуть прочитати і реалізувати ідентично. +1. ## Специфікація + Вижила пропозиція оформлюється у формальну специфікацію. Кожен крайній випадок, умова помилки та взаємодія з існуючими функціями мають бути чітко визначені. Це момент, коли хороша ідея зустрічається з жорсткою реальністю. Розпливчасті концепції мають стати точними правилами, які два незалежні інженери можуть прочитати і реалізувати ідентично. -1. **Тестування сумісності** - Перш ніж функцію можна вважати стабільною, вона має працювати однаково у всіх браузерах. Основним інструментом для перевірки цього є набір тестів W3C Web Platform Tests. Це спільний набір тестів, які Chrome, Firefox, Safari та інші запускають проти своїх реалізацій. Різні результати означають, що або специфікація неоднозначна, або хтось має помилку. Обидва випадки потрібно вирішити, перш ніж функція рухатиметься далі. +1. ## Тестування сумісності + Перш ніж функцію можна вважати стабільною, вона має працювати однаково у кожному браузері. Набір тестів W3C Web Platform Tests — це основний інструмент для перевірки цього. Це спільний набір тестів, які Chrome, Firefox, Safari та інші запускають проти своїх реалізацій. Різні результати означають, що або специфікація неоднозначна, або в когось є помилка. Одне з цього потрібно вирішити, перш ніж функція рухатиметься далі. -1. **Фіналізація** - Коли кілька незалежних реалізацій проходять тести, функція фіналізується. Для W3C це рекомендація, для TC39 — стадія 4, а для WHATWG — стабільний запис у живому стандарті. Прапорці знімаються, і функція потрапляє до користувачів. У цей момент вона стає частиною базової веб-платформи, на яку кожен розробник може покладатися безстроково. +1. ## Фіналізація + Коли кілька незалежних реалізацій проходять тести, функція фіналізується. Для W3C це рекомендація, для TC39 — 4-й етап, а для WHATWG — стабільний запис у живому стандарті. Прапорці знімаються, і функція доставляється користувачам. У цей момент вона стає частиною базової веб-платформи, на яку кожен розробник може покладатися безстроково. -1. **Застарівання** - Не кожен стандарт добре старіє. Деякі функції замінюються кращими, інші виявляються такими, що мають проблеми з безпекою чи конфіденційністю, які не були очевидні раніше. Коли функцію потрібно прибрати, її офіційно позначають як застарілу. Тобто вона підтримується, але розробникам рекомендують припинити її використовувати. Зрештою її видаляють зі специфікації. Видалення з браузерів відбувається повільно і обережно, бо основна обіцянка вебу — старі сторінки мають працювати. Деякі застарілі функції залишаються в браузерах десятиліттями виключно через зобов’язання зворотної сумісності. +1. ## Депрекація + Не кожен стандарт добре старіє. Деякі функції замінюються кращими, інші виявляються такими, що мають проблеми з безпекою або конфіденційністю, які раніше не були очевидні. Коли функцію потрібно прибрати, її формально депрецюють. Тобто підтримують, але позначають як таку, що розробникам слід припинити використовувати. Згодом її видаляють зі специфікації. Видалення з браузерів відбувається повільно і обережно, бо основна обіцянка вебу — старі сторінки мають продовжувати працювати. Деякі застарілі функції залишаються в браузерах десятиліттями виключно через зобов’язання зворотної сумісності. # --questions-- @@ -83,7 +83,7 @@ dashedName: what-does-the-lifecycle-of-web-standards-features-look-like --- -Щоб замінити потребу у письмовій специфікації. +Замінити потребу у письмовій специфікації. ### --feedback-- diff --git a/curriculum/challenges/ukrainian/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5162.md b/curriculum/challenges/ukrainian/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5162.md index f218ee04bb7..db95bae36e1 100644 --- a/curriculum/challenges/ukrainian/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5162.md +++ b/curriculum/challenges/ukrainian/blocks/lecture-understanding-the-web-standards-model/69fc757399f4066e674a5162.md @@ -9,26 +9,26 @@ dashedName: what-are-the-key-principles-that-web-standards-are-built-on Веб-стандарти — це не просто технічні документи, вони відображають набір цінностей щодо того, яким має бути веб і кому він має служити. Розуміння цих принципів допомагає побачити не лише те, як працює веб, а й чому він був створений саме таким. Давайте обговоримо ці принципи. -1. **Відкритість** - Веб-стандарти розробляються відкрито і реалізуються без ліцензійних платежів. Будь-хто може читати специфікації, будь-хто може створити браузер, і жодна компанія не може стягувати плату за впровадження стандарту. Ця відкритість відрізняє веб від пропрієтарних платформ і дозволяє невеликим командам створювати інструменти, які охоплюють мільярди людей без дозволу від контролера доступу. +1. ## Відкритість + Веб-стандарти розробляються відкрито і реалізуються без ліцензійних платежів. Будь-хто може прочитати специфікації, будь-хто може створити браузер, і жодна компанія не може стягувати ліцензійні збори за впровадження стандарту. Ця відкритість відрізняє веб від пропрієтарних платформ і дозволяє невеликим командам створювати інструменти, які охоплюють мільярди людей без дозволу від контролера доступу. -1. **Доступність** - Веб був створений для того, щоб ним могли користуватися всі, незалежно від можливостей. Доступність — це не додаткова функція веб-стандартів, вона закладена у дизайн HTML, CSS і поведінки браузерів. Керівництво W3C WCAG встановлює офіційний стандарт того, що означає доступність на практиці. Функція, яка створює бар’єри для користувачів із читачами екрана, навігацією за допомогою клавіатури або допоміжними технологіями, вважається дефектною за дизайном, а не лише з етичних міркувань. +1. ## Доступність + Веб був створений для використання всіма, незалежно від їхніх можливостей. Доступність — це не додаткова функція до веб-стандартів, вона закладена у дизайн HTML, CSS і поведінку браузера. Керівництво W3C WCAG встановлює офіційний стандарт того, що означає доступність на практиці. Функція, яка створює бар’єри для людей, що користуються читачами екрана, навігацією з клавіатури або допоміжними технологіями, вважається дефектною за дизайном, а не лише з етичних міркувань. -1. **Інтероперабельність** - Найфундаментальніший принцип полягає в тому, що веб має працювати однаково всюди. Сторінка, створена за стандартом, має поводитися ідентично в Chrome, Firefox і Safari, а також на Windows, macOS, Linux, Android і iOS. Без інтероперабельності веб розпадається на набір браузерно-специфічних досвідів, і розробникам доводиться писати одне й те саме кілька разів. Кожен стандарт існує, перш за все, щоб цього уникнути. +1. ## Взаємодія + Найфундаментальніший принцип полягає в тому, що веб має працювати однаково всюди. Сторінка, створена за стандартом, має поводитися ідентично в Chrome, Firefox і Safari, а також на Windows, macOS, Linux, Android і iOS. Без взаємодії веб розпадається на набір браузерно-специфічних досвідів, і розробники змушені писати одне й те саме кілька разів. Кожен стандарт існує, у своїй основі, щоб цьому запобігти. -1. **Зворотна сумісність** - Веб має майже абсолютне зобов’язання не ламати старі речі. Сторінка, написана в 1999 році, має й досі відтворюватися в сучасному браузері, і організації, що розробляють стандарти, серйозно ставляться до цього зобов’язання при створенні нових функцій. Саме тому нові можливості додаються зверху, а не замінюють те, що було раніше. Це обмеження іноді дратує дизайнерів, але саме воно робить веб унікально стійкою платформою. +1. ## Зворотна сумісність + Веб має майже абсолютне зобов’язання не ламати старі речі. Сторінка, написана в 1999 році, має й досі відтворюватися в сучасному браузері, і організації зі стандартів серйозно ставляться до цього зобов’язання при розробці нових функцій. Саме тому нові можливості накладаються зверху, а не замінюють те, що було раніше. Це обмеження іноді дратує дизайнерів, але саме воно робить веб унікально стійкою платформою. -1. **Конфіденційність і безпека** - Сучасні стандарти проходять перевірку на вплив на конфіденційність і безпеку перед їх впровадженням. Нові API, які можуть відкривати доступ до даних користувачів або дозволяти відстеження, піддаються значній перевірці в процесі розробки стандартів. Принцип полягає в тому, що платформа має захищати користувачів за замовчуванням, а зручність для розробників ніколи не повинна ставитися вище безпеки користувачів. +1. ## Конфіденційність і безпека + Сучасні стандарти проходять перевірку на вплив на конфіденційність і безпеку перед їх впровадженням. Нові API, які можуть відкривати дані користувачів або дозволяти відстеження, піддаються значній перевірці в процесі стандартизації. Принцип полягає в тому, що платформа має захищати користувачів за замовчуванням, і зручність для розробників ніколи не повинна ставати ціною безпеки користувача. -1. **Шарування** - Веб побудований із чітких, складних шарів: HTML для структури, CSS для презентації та JavaScript для поведінки. Стандарти розроблені так, щоб поважати ці межі, а не руйнувати їх. Добре спроектована функція може впроваджуватися поступово. Сторінка, яка не використовує JavaScript, все одно працює, а браузер, який не підтримує нову властивість CSS, все одно відтворює щось прийнятне. Цей поділ обов’язків дає вебу його стійкість. +1. ## Шарування + Веб побудований із чітких, композиційних шарів: HTML для структури, CSS для презентації та JavaScript для поведінки. Стандарти розроблені так, щоб поважати ці межі, а не руйнувати їх. Добре спроектована функція може впроваджуватися поступово. Сторінка, яка не використовує JavaScript, все одно працює, а браузер, який не підтримує нову CSS-властивість, все одно відтворює щось прийнятне. Цей поділ обов’язків і дає вебу його стійкість. -1. **Поступове покращення** - Тісно пов’язане з шаруванням — ідея, що веб має працювати для всіх, а потім ставати кращим для користувачів із більш потужними браузерами або пристроями. Стандартна функція має поступово деградувати, якщо вона не підтримується, а не повністю ламатися. Цей принцип визначає, як описуються нові властивості CSS, як JavaScript API обробляють відсутність можливостей і як організації, що розробляють стандарти, думають про розрив між сучасними браузерами і старими, які досі широко використовуються у світі. +1. ## Прогресивне покращення + Тісно пов’язане з шаруванням є уявлення, що веб має працювати для всіх, а потім ставати кращим для користувачів із більш потужними браузерами чи пристроями. Стандартна функція має плавно деградувати, коли її не підтримують, а не повністю ламатися. Цей принцип формує, як нові CSS-властивості прописуються, як JavaScript API обробляють відсутність можливостей і як організації зі стандартів думають про розрив між сучасними браузерами та старими, які досі широко використовуються у світі. # --questions-- @@ -50,7 +50,7 @@ dashedName: what-are-the-key-principles-that-web-standards-are-built-on --- -Поступове покращення. +Прогресивне покращення. ### --feedback-- diff --git a/curriculum/challenges/ukrainian/blocks/lecture-user-interface-design-fundamentals/672baa97f2990e6631d522e7.md b/curriculum/challenges/ukrainian/blocks/lecture-user-interface-design-fundamentals/672baa97f2990e6631d522e7.md index a37c2d6f7aa..747e06d46f8 100644 --- a/curriculum/challenges/ukrainian/blocks/lecture-user-interface-design-fundamentals/672baa97f2990e6631d522e7.md +++ b/curriculum/challenges/ukrainian/blocks/lecture-user-interface-design-fundamentals/672baa97f2990e6631d522e7.md @@ -9,6 +9,8 @@ dashedName: how-do-you-create-good-background-and-foreground-contrast-in-your-de **ПРИМІТКА**: Деякі інтерактивні приклади можуть використовувати CSS, який ви ще не вивчали. Не хвилюйтеся, якщо не розумієте весь код. Мета прикладів — показати вам попередній перегляд цих концепцій дизайну, щоб ви краще зрозуміли, як усе працює. +## Розуміння контрасту + Спершу вам може знадобитися ознайомитися з поняттям контрасту. Контраст — це різниця між двома кольорами або наскільки легко їх розрізнити. Кольори з більшим контрастом будуть більш візуально відмінними, тоді як кольори з меншим контрастом будуть більш схожими. Наприклад, чорний і білий мають дуже високий коефіцієнт контрастності. А світло-синій і світло-фіолетовий мають менший контраст. @@ -53,6 +55,8 @@ dashedName: how-do-you-create-good-background-and-foreground-contrast-in-your-de ::: +### Застосування контрасту до тексту + Звісно, у цих прикладах розрізнення може бути чіткішим через макет. Але як щодо застосування цих кольорів до тексту? Ви можете мати текст чорного кольору з високим контрастом на білому фоні. І текст фіолетового кольору з низьким контрастом на синьому фоні. :::interactive_editor @@ -96,6 +100,8 @@ dashedName: how-do-you-create-good-background-and-foreground-contrast-in-your-de ::: +### Стандарти контрасту WCAG + Але як визначити, що контраст є «достатньо хорошим»? Не можна орієнтуватися лише на те, як текст виглядає для вас, адже кожен користувач матиме свій досвід. На щастя, Веб-керівництво з доступності вмісту (WCAG) встановлює стандарт для цього. Текст із коефіцієнтом контрастності 4.5:1 вважається стандартом AA, що є мінімумом, якого слід дотримуватися, щоб бути доступним для більшості користувачів. Текст із коефіцієнтом контрастності 7:1 вважається стандартом AAA і забезпечує найкращий рівень доступності. @@ -141,6 +147,8 @@ dashedName: how-do-you-create-good-background-and-foreground-contrast-in-your-de ::: +### Порівняння високих і низьких коефіцієнтів контрастності + Існує багато вебсайтів, які можуть перевірити коефіцієнт контрастності між двома кольорами, але більшість браузерів дозволяють зробити це безпосередньо у інструментах розробника на вашому сайті. Давайте розглянемо ще кілька прикладів коефіцієнта контрастності, щоб краще зрозуміти концепцію. @@ -221,8 +229,12 @@ dashedName: how-do-you-create-good-background-and-foreground-contrast-in-your-de Цей приклад має коефіцієнт контрастності 1.48:1, що навіть не відповідає стандарту AA. +## Налаштування властивостей кольору + Як це виправити? Є три аспекти, які впливають на коефіцієнт контрастності. +### Налаштування відтінку + Перший — це відтінок, який представляє загальний тип кольору, наприклад, червоний, синій, помаранчевий. Змінимо відтінок на той, що далі від синього. У цьому випадку використаємо червоний. :::interactive_editor @@ -267,6 +279,8 @@ dashedName: how-do-you-create-good-background-and-foreground-contrast-in-your-de ::: +### Налаштування насиченості + На жаль, ця зміна лише підняла коефіцієнт контрастності до 1.49:1, тому потрібно змінити насиченість, або «кількість» кольору. Збільшимо кількість червоного в тексті. Це набагато ближче до мети — коефіцієнт контрастності 3.54:1. :::interactive_editor @@ -325,6 +339,8 @@ dashedName: how-do-you-create-good-background-and-foreground-contrast-in-your-de ::: +### Налаштування світлості + Однак можна ще більше наблизитися, змінивши останнє значення — світлість. Світлість показує, скільки білого міститься в кольорі. Зменшимо світлість червоного. Тепер це набагато темніший червоний на світло-синьому фоні, що дає коефіцієнт контрастності 10.34:1. @@ -503,7 +519,7 @@ dashedName: how-do-you-create-good-background-and-foreground-contrast-in-your-de --- -Непрозорість +Прозорість ## --video-solution-- diff --git a/curriculum/challenges/ukrainian/blocks/lecture-what-is-css/672acc100d59d24da7b4e09c.md b/curriculum/challenges/ukrainian/blocks/lecture-what-is-css/672acc100d59d24da7b4e09c.md index a614d455422..5a1dd81c110 100644 --- a/curriculum/challenges/ukrainian/blocks/lecture-what-is-css/672acc100d59d24da7b4e09c.md +++ b/curriculum/challenges/ukrainian/blocks/lecture-what-is-css/672acc100d59d24da7b4e09c.md @@ -7,10 +7,14 @@ dashedName: what-are-the-different-types-of-css-combinators # --interactive-- +## Комбінатори CSS + CSS-комбінатори використовуються для визначення зв’язку між селекторами в CSS. Вони допомагають вибирати елементи на основі їхнього зв’язку з іншими елементами, що дозволяє створювати більш точне та ефективне стилізування. Ми розглянемо деякі основні CSS-комбінатори та їхні випадки використання, починаючи з комбінатора нащадка. +### Комбінатор нащадка + Комбінатор нащадка використовується для вибору елементів, які відповідають другому селектору, якщо вони вкладені в батьківський елемент, що відповідає першому селектору. Батьківським елементом може бути батько, дідусь або будь-який інший нащадок вище в дереві документа. Щоб краще зрозуміти, як це працює, давайте розглянемо приклад. @@ -42,6 +46,8 @@ figure img { Якщо у вас було б кілька зображень всередині `figure` елемента, використання комбінатора нащадка було б хорошим способом додати суцільний чорний кордон навколо кожного з цих зображень. +### Комбінатор дочірнього елемента + Іншим типом комбінатора є комбінатор дочірнього елемента. Комбінатор дочірнього елемента (`>`) у CSS використовується для вибору елементів, які є безпосередніми дітьми вказаного батьківського елемента. @@ -102,6 +108,8 @@ figure img { Оскільки інші два абзаци вкладені всередину `div` елементів, вони не вважаються безпосередніми дітьми класу `container` і не отримають синій колір тексту. +### Комбінатор наступного братського елемента + Ще одним поширеним комбінатором є комбінатор наступного братського елемента. Комбінатор наступного братського елемента (`+`) у CSS вибирає елемент, який безпосередньо слідує за вказаним братським елементом. Цей комбінатор корисний, коли потрібно застосувати стилі до елемента, що йде безпосередньо після іншого, дозволяючи цілеспрямоване стилізування залежно від позиції елемента відносно його братів. @@ -150,6 +158,8 @@ img + figcaption { У цьому прикладі комбінатор наступного братського елемента (`+`) вибирає `figcaption` елемент, який йде безпосередньо після `img` елемента. Застосоване CSS-правило додає `4px solid black border` навколо `figcaption`. +### Комбінатор наступних братських елементів + Ще одним поширеним комбінатором є комбінатор наступних братських елементів. Комбінатор наступних братських елементів (`~`) у CSS вибирає всі братські елементи вказаного елемента, які йдуть після нього. @@ -202,6 +212,8 @@ h2 ~ p { Комбінатор наступних братських елементів (`~`) націлений на всі братські абзаци, які з’являються після `h2` елемента, незалежно від того, чи є вони безпосередніми братами. +## Чому комбінатори CSS важливі + На завершення, розуміння та використання різних CSS-комбінаторів дозволяє застосовувати точні стилі до ваших HTML-елементів, підвищуючи контроль і гнучкість дизайну. Опанувавши ці селектори, ви зможете створювати більш складні та цілеспрямовані правила стилізування, що покращують як вигляд, так і функціональність ваших вебсторінок. diff --git a/curriculum/challenges/ukrainian/blocks/lecture-working-with-code-editors-and-ides/672d26269456511aa3db614d.md b/curriculum/challenges/ukrainian/blocks/lecture-working-with-code-editors-and-ides/672d26269456511aa3db614d.md index 8d52c5ba977..925217c72b6 100644 --- a/curriculum/challenges/ukrainian/blocks/lecture-working-with-code-editors-and-ides/672d26269456511aa3db614d.md +++ b/curriculum/challenges/ukrainian/blocks/lecture-working-with-code-editors-and-ides/672d26269456511aa3db614d.md @@ -9,23 +9,23 @@ dashedName: what-is-a-code-editor-and-ide Ви можете подумати, що це одне й те саме, але це не зовсім так. Редактор коду — це будь-який застосунок, який дозволяє редагувати файли з кодом. IDE, або інтегроване середовище розробки, — це повноцінний застосунок, який дозволяє компілювати, запускати та налагоджувати ваш код під час його редагування. -Можливо, кілька прикладів допоможуть краще зрозуміти. +Декілька прикладів допоможуть зрозуміти. Спершу розглянемо кілька популярних IDE. Visual Studio — це інтегроване середовище розробки від Microsoft, яке надає комплексний набір інструментів для створення, налагодження та розгортання застосунків на різних платформах. -Ще одним IDE є XCode. Xcode — це інтегроване середовище розробки від Apple, призначене для створення, кодування та налагодження застосунків для macOS, iOS, watchOS і tvOS. +Ще одним IDE є Xcode. Xcode — це інтегроване середовище розробки від Apple, призначене для створення, кодування та налагодження застосунків для macOS, iOS, watchOS і tvOS. -Іншим IDE є Android Studio. Android Studio — це інтегроване середовище розробки від Google, спеціально створене для розробки, налагодження та тестування Android-застосунків. +Android Studio, розроблений Google, — це інтегроване середовище розробки, спеціально створене для побудови, налагодження та тестування Android-застосунків. Це лише кілька прикладів IDE. Тепер давайте подивимося на кілька популярних редакторів коду. Visual Studio Code — це легкий, відкритий редактор коду від Microsoft, який підтримує широкий спектр мов програмування і надає функції, такі як налагодження, підсвічування синтаксису та контроль версій через розширення. -Ще одним популярним редактором є Sublime Text. Sublime Text — це швидкий, універсальний текстовий редактор, відомий своїм стильним інтерфейсом, потужними функціями та підтримкою багатьох мов програмування через налаштовуване підсвічування синтаксису та плагіни. +Для швидкого та універсального редагування Sublime Text пропонує стильний інтерфейс і підтримку широкого спектра мов програмування через налаштовуване підсвічування синтаксису та плагіни. -Іншим є Notepad++. Це безкоштовний, відкритий текстовий і редактор вихідного коду для Windows, який пропонує підсвічування синтаксису, згортання коду та різноманітні плагіни для підвищення продуктивності та кастомізації. +Користувачі Windows також можуть використовувати Notepad++ — безкоштовний, відкритий текстовий і редактор вихідного коду, який пропонує підсвічування синтаксису, згортання коду та різноманітні плагіни для підвищення продуктивності та кастомізації. -Ви могли помітити, що редактори коду зосереджені переважно на текстовому вмісті файлу, тоді як IDE відкривають доступ до різних інструментів для керування вашим кодом. +Ви, мабуть, помітили, що редактори коду зосереджені переважно на текстовому вмісті файлу, тоді як IDE відкривають доступ до різних інструментів для керування вашим кодом. Ці приклади — це всі локальні програми, які ви можете запускати на своєму комп’ютері, але також існують редактори на базі хмари, які ви можете використовувати. @@ -35,11 +35,11 @@ Visual Studio Code — це легкий, відкритий редактор к Replit — це онлайн-платформа, яка надає спільне середовище для кодування, дозволяючи користувачам писати, запускати та ділитися кодом різними мовами програмування безпосередньо з веббраузера. -Ще одним популярним редактором на базі хмари є GitHub Codespaces. Це хмарне середовище розробки, яке надає миттєвий доступ до повністю налаштованого редактора коду та інструментів розробки безпосередньо з GitHub, забезпечуючи безперебійне кодування та співпрацю. +Ще одним популярним хмарним редактором є GitHub Codespaces. Це хмарне середовище розробки, яке надає миттєвий доступ до повністю налаштованого редактора коду та інструментів розробки безпосередньо з GitHub, забезпечуючи безперебійне кодування та співпрацю. -Іншим є Ona. Ona — це хмарне середовище розробки, яке інтегрується з GitHub і GitLab, пропонуючи миттєві, налаштовувані робочі простори для кодування, створення та налагодження безпосередньо з вашого браузера. +Ona інтегрується з GitHub і GitLab, щоб надати миттєві, налаштовувані робочі простори для кодування, побудови та налагодження безпосередньо з вашого браузера. -Існує ще багато інших варіантів. Деякі, як Visual Studio Code, дуже розширювані і можуть працювати з різними типами проєктів і мовами. Інші можуть бути спеціально адаптовані для невеликої підмножини мов або типів проєктів. +Існує ще багато інших варіантів. Деякі, як Visual Studio Code, дуже розширювані і можуть працювати з багатьма типами проєктів і мовами. Інші можуть бути спеціально адаптовані до невеликої підмножини мов або типів проєктів. Застосунок, який ви використовуєте, може відрізнятися для конкретних проєктів. Варто дослідити варіанти, щоб побачити, що найкраще підходить для ваших потреб. diff --git a/curriculum/challenges/ukrainian/blocks/lecture-working-with-code-editors-and-ides/672d45583fd75a504136fbbb.md b/curriculum/challenges/ukrainian/blocks/lecture-working-with-code-editors-and-ides/672d45583fd75a504136fbbb.md index 0c68def7afa..7c30a4275db 100644 --- a/curriculum/challenges/ukrainian/blocks/lecture-working-with-code-editors-and-ides/672d45583fd75a504136fbbb.md +++ b/curriculum/challenges/ukrainian/blocks/lecture-working-with-code-editors-and-ides/672d45583fd75a504136fbbb.md @@ -7,11 +7,11 @@ dashedName: how-to-install-visual-studio-code-onto-your-computer # --description-- -Щоб встановити VS Code, вам потрібно відвідати їхній вебсайт, щоб отримати відповідний інсталятор для вашої операційної системи. Переконайтеся, що ви заходите на сайт VS Code, а не на сайт Visual Studio. +Щоб встановити VS Code, вам потрібно відвідати сайт VS Code, щоб отримати відповідний інсталятор для вашої операційної системи. Переконайтеся, що ви відвідуєте сайт VS Code, а не сайт Visual Studio. -Для Windows можна скачати інсталятор у форматі EXE. Після завантаження запустіть файл, і майстер налаштування проведе вас через процес встановлення. +Для Windows ви можете скачати інсталятор у форматі EXE. Після того, як ви його скачали, запустіть файл, і майстер налаштування проведе вас через процес встановлення. -Для Mac можна скачати zip-архів, який містить `.app`, який ви можете запустити. Також можна встановити VS Code через homebrew. +Для Mac ви можете скачати архів `.zip`, який містить `.app`, який можна запустити. Також ви можете встановити VS Code через Homebrew. Відкрийте застосунок Terminal на вашому Mac і виконайте таку команду: diff --git a/curriculum/challenges/ukrainian/blocks/lecture-working-with-code-editors-and-ides/672d45651d83b450801efb3a.md b/curriculum/challenges/ukrainian/blocks/lecture-working-with-code-editors-and-ides/672d45651d83b450801efb3a.md index 439d070a352..5bb0f885d32 100644 --- a/curriculum/challenges/ukrainian/blocks/lecture-working-with-code-editors-and-ides/672d45651d83b450801efb3a.md +++ b/curriculum/challenges/ukrainian/blocks/lecture-working-with-code-editors-and-ides/672d45651d83b450801efb3a.md @@ -11,19 +11,19 @@ dashedName: how-to-create-a-project-and-run-your-code-locally-in-vs-code Для початку вам потрібно буде використати інтерфейс командного рядка, щоб створити нову папку для вашого нового проєкту. Папка — це інша назва для директорії. -Інтерфейси командного рядка, або CLI, дозволяють взаємодіяти з операційною системою за допомогою текстових команд. Ви дізнаєтеся більше про ці інструменти у майбутніх уроках. +Інтерфейси командного рядка, або скорочено CLI, дозволяють вам взаємодіяти з операційною системою через текстові команди. Ви дізнаєтеся більше про ці інструменти в майбутніх уроках. Якщо ви користуєтеся Windows, можете використовувати Command Prompt або PowerShell. Якщо ви на Mac, відкрийте застосунок Terminal. -Коли інтерфейс командного рядка відкрито, перейдіть у домашню папку, ввівши команду `cd ~` і натиснувши `enter` на клавіатурі. Потім введіть команду `mkdir my-project` і натисніть `enter`. `mkdir`, або «make directory», — це команда для створення нової папки. Після цього відкрийте вашу нову папку у VS Code. +Коли інтерфейс командного рядка відкритий, перейдіть до своєї домашньої директорії. У Command Prompt введіть `cd /d %USERPROFILE%` і натисніть `Enter` на клавіатурі. У PowerShell або в Terminal на macOS введіть `cd ~` і натисніть `Enter`. Потім введіть команду `mkdir my-project` і натисніть `Enter`. `mkdir`, або «make directory», — це команда для створення нової директорії. Після цього відкрийте свою нову директорію у VS Code. -Існують також інші графічні способи створення нової папки. +Існують також інші способи відкрити директорію у VS Code. Залежно від вашої операційної системи, у вас може бути контекстне меню (або опція правого кліку), щоб відкрити VS Code безпосередньо з провідника файлів. Ви також можете двічі натиснути на застосунок VS Code. Якщо ви впевнені у роботі з командним рядком, можете виконати команду `code /path/to/folder`. Коли VS Code відкрито, ви побачите новий порожній робочий простір. -Щоб створити новий файл, натисніть на меню `File` у верхньому лівому куті і виберіть `New File...`. Потім назвіть файл `index.html` і натисніть `Save`. +Щоб створити новий файл, натисніть на меню `File` у верхньому лівому куті та виберіть `New File...`. Потім назвіть свій файл `index.html` і натисніть `Save`. Тепер ви побачите свій новий файл у вкладці провідника. Спробуйте додати трохи HTML у ваш файл `index.html`. @@ -31,15 +31,15 @@ dashedName: how-to-create-a-project-and-run-your-code-locally-in-vs-code Замість цього слід розмістити ваш HTML-файл за справжнім вебсервером. Це може здатися складним завданням, якщо ви новачок у програмуванні, але насправді це можна зробити прямо у VS Code. -Спершу потрібно встановити розширення _Live Server_, яке доступне безкоштовно в маркетплейсі. +Спочатку вам потрібно встановити розширення Live Server, яке доступне безкоштовно в маркетплейсі. -Натисніть на вкладку розширень у лівому куті і введіть `Live Server` у рядок пошуку. +Натисніть на вкладку Extensions у лівій бічній панелі та введіть `Live Server` у рядок пошуку. -Після встановлення ви побачите кнопку `Go live` у рядку стану. Переконайтеся, що ваш HTML-файл відкрито, і натисніть цю кнопку. +Після встановлення ви побачите кнопку `Go Live` у рядку стану. Переконайтеся, що у вас відкритий HTML-файл, і натисніть цю кнопку. -Ваша нова сторінка має автоматично відкритися у новій вкладці браузера. Якщо ні, ви можете перейти безпосередньо за адресою `http://localhost:5500/` +Ваша нова сторінка має автоматично відкритися у новій вкладці браузера. Якщо цього не сталося, ви можете перейти безпосередньо за адресою `http://localhost:5500/`. -Вітаємо! Тепер у вас налаштований власний проєкт у VS Code, і ви можете переглядати зміни за допомогою live server. +Вітаємо! Тепер ви налаштували власний проєкт у VS Code і можете переглядати свої зміни за допомогою Live Server. # --questions-- @@ -57,7 +57,7 @@ dashedName: how-to-create-a-project-and-run-your-code-locally-in-vs-code --- -Папка, яку ви відкрили у VS Code. +Директорія, яку ви відкрили у VS Code. --- diff --git a/curriculum/challenges/ukrainian/blocks/lecture-working-with-code-editors-and-ides/672d456f4ac35950b300e93f.md b/curriculum/challenges/ukrainian/blocks/lecture-working-with-code-editors-and-ides/672d456f4ac35950b300e93f.md index 8ea27ec874b..9669a066f91 100644 --- a/curriculum/challenges/ukrainian/blocks/lecture-working-with-code-editors-and-ides/672d456f4ac35950b300e93f.md +++ b/curriculum/challenges/ukrainian/blocks/lecture-working-with-code-editors-and-ides/672d456f4ac35950b300e93f.md @@ -9,21 +9,21 @@ dashedName: what-are-several-useful-keyboard-shortcuts-for-maximizing-productivi Ви, ймовірно, вже знайомі з деякими базовими комбінаціями клавіш, які успадковані від вашої операційної системи. Такі комбінації, як `Ctrl + S` для збереження, `Ctrl + C` для копіювання та `Ctrl + V` для вставлення, працюють у VS Code. -Але є кілька, які специфічні для застосунку і можуть значно підвищити вашу продуктивність. Варто зазначити, що деякі з цих комбінацій можуть відрізнятися залежно від операційної системи. +Але є кілька, які специфічні для застосунку і все одно можуть підвищити вашу продуктивність. Варто зазначити, що деякі з цих скорочень можуть відрізнятися залежно від операційної системи. -Наприклад, `Shift + Alt + F` запускає налаштований форматер (наприклад, prettier для проєкту на JavaScript) для відкритого зараз файлу. +Наприклад, `Shift + Alt + F` запустить налаштований форматер (наприклад, Prettier для проєкту на JavaScript) для відкритого зараз файлу. -Або `Ctrl + Shift + F` (Windows) чи `Cmd + Shift + F` (Mac) — для пошуку текстового вмісту у всіх файлах вашої робочої області. Потім `Ctrl + Shift + H` (Windows) або `Cmd + Shift + H` (Mac), якщо хочете виконати пошук і заміну. +Використовуйте `Ctrl + Shift + F` (Windows/Linux) або `Cmd + Shift + F` (macOS), щоб шукати текстовий вміст у всіх файлах вашого робочого простору. Потім використовуйте `Ctrl + Shift + H` (Windows/Linux) або `Cmd + Shift + H` (macOS), якщо хочете виконати пошук і заміну. -Якщо потрібно видалити рядок, `Ctrl + Shift + K` (Windows) або `Cmd + Shift + K` (Mac) його видалить. +Якщо потрібно видалити лінію, `Ctrl + Shift + K` (Windows/Linux) або `Cmd + Shift + K` (macOS) її видалить. -Потрібно більше місця для всього вашого коду? `Ctrl + B` (Windows) або `Cmd + B` (Mac) приховають бічну панель — де знаходиться список файлів і меню розширень. +Потрібно більше місця для всього вашого коду? `Ctrl + B` (Windows) або `Cmd + B` (Mac) приховає бічну панель, де знаходяться список файлів і меню розширень. -Або, можливо, ви просто не бачите свій код? `Ctrl + plus` (Windows) або `Cmd + plus` (Mac) збільшать масштаб редактора, а `Ctrl + minus` (Windows) або `Cmd + minus` (Mac) зменшать його. +Або, можливо, ви просто не бачите свій код? `Ctrl + Plus` (Windows) або `Cmd + Plus` (Mac) збільшить масштаб редактора, а `Ctrl + Minus` (Windows) або `Cmd + Minus` (Mac) зменшить його. -Ще одна корисна функція у VS Code — редагування кількох рядків одночасно, що дозволяє вносити зміни в кілька рядків одразу. Наприклад, ви можете розмістити кілька курсорів, використовуючи `Ctrl + Alt + down` і `Ctrl + Alt + up` (Windows/Linux) або `Option + Command + down` і `Option + Command + up` (Mac), щоб розширити курсор на послідовні рядки. Також можна натиснути і утримувати `Alt` (Windows/Linux) або `Option` (Mac) і натиснути, щоб додати курсори на окремих рядках там, де це потрібно. Після розміщення курсорів усе, що ви вводите або видаляєте, застосовується одночасно до всіх цих місць — це значно економить час при роботі з повторюваним кодом. +Ще одна корисна функція у VS Code — редагування кількох рядків одночасно, що дозволяє вносити зміни одразу в кілька рядків. Наприклад, ви можете розмістити кілька курсорів, використовуючи `Ctrl + Alt + Down` і `Ctrl + Alt + Up` (Windows/Linux) або `Option + Cmd + Down` і `Option + Cmd + Up` (Mac), щоб розширити курсор на послідовні рядки. Також можна натиснути і утримувати `Alt` (Windows/Linux) або `Option` (Mac) і клікнути, щоб додати курсори на окремих рядках там, де вони потрібні. Після розміщення курсорів все, що ви вводите або видаляєте, застосовується одночасно до всіх цих місць — це може значно заощадити час при роботі з повторюваним кодом. -Нарешті, якщо ви забудете будь-яку з цих комбінацій, завжди можна скористатися `Ctrl + Shift + P` (Windows) або `Cmd + Shift + P` (Mac), щоб відкрити палітру команд і вибрати те, що потрібно. +Нарешті, якщо ви забудете будь-яке з цих скорочень, завжди можна використати `Ctrl + Shift + P` (Windows/Linux) або `Cmd + Shift + P` (macOS), щоб відкрити палітру команд і вибрати все, що вам потрібно. З цими знаннями і, можливо, трохи практики, ви на шляху стати досвідченим користувачем VS Code. diff --git a/curriculum/challenges/ukrainian/blocks/lecture-working-with-code-editors-and-ides/672d457bcdd8b350ec2b6254.md b/curriculum/challenges/ukrainian/blocks/lecture-working-with-code-editors-and-ides/672d457bcdd8b350ec2b6254.md index c6c88d15e55..11bb1159c87 100644 --- a/curriculum/challenges/ukrainian/blocks/lecture-working-with-code-editors-and-ides/672d457bcdd8b350ec2b6254.md +++ b/curriculum/challenges/ukrainian/blocks/lecture-working-with-code-editors-and-ides/672d457bcdd8b350ec2b6254.md @@ -7,25 +7,25 @@ dashedName: what-are-some-good-vs-code-extensions-you-can-use-in-your-editor # --description-- -_Better Comments_ — це розширення, яке пропонує спеціальне підсвічування для певних коментарів у коді. Наприклад, воно виділяє коментарі "TODO", а також синтаксис для позначення питань або попереджень. +Better Comments — це розширення, яке пропонує спеціальне виділення для певних коментарів у коді. Наприклад, воно виділяє коментарі "TODO", а також синтаксис для позначення питань або попереджень. -_Code Spell Checker_ показує, коли ви неправильно написали слово у своєму коді. Оскільки воно призначене для файлів коду, воно враховує такі речі, як camel case. +Code Spell Checker позначає слова, які написані з помилками у вашому коді. Оскільки він призначений для файлів коду, він враховує такі речі, як camel case. -_Error Lens_ допомагає помічати будь-які виділені помилки у вашому коді. Замість того, щоб покладатися на підкреслення, яке VS Code показує за замовчуванням, це розширення підсвічує весь рядок і відображає повідомлення про помилку. +Error Lens робить помилки у вашому коді важчими для пропускання. Замість того, щоб покладатися на підкреслення, яке VS Code показує за замовчуванням, це розширення виділяє всю лінію і відображає повідомлення про помилку. -_Indent Rainbow_ додає кольори до різних рівнів відступів. У поєднанні з вбудованою в VS Code кольоровою підсвіткою пар дужок це значно допомагає визначити, у якій області видимості знаходиться ваш код. +Indent Rainbow додає колір до різних рівнів відступів. У поєднанні з вбудованою в VS Code кольоровою підсвіткою пар дужок це може значно допомогти визначити, в якій області видимості знаходиться ваш код. -А можливо, ви шукаєте щось більш практичне? Розгляньте AI-помічника, як-от _GitHub Copilot_ або _Tabnine_, які пропонують рядкові підказки під час написання коду. +А може, ви шукаєте щось більш практичне? Розгляньте можливість використання AI-помічника, такого як GitHub Copilot або Tabnine, щоб отримувати рядкові пропозиції під час написання коду. -Пакет іконок, наприклад _VS Code Great Icons_, допоможе зробити ваше дерево файлів чистішим і легшим для швидкого аналізу. А розширення, як _Colorize_, допоможе краще розуміти значення у ваших CSS-властивостях. +Пакет іконок, наприклад VS Code Great Icons, може допомогти зробити ваше дерево файлів чистішим і легшим для швидкого аналізу. А розширення, як Colorize, допоможе вам краще розуміти значення у ваших CSS-властивостях. -Також вам знадобляться розширення, специфічні для мови, у ваших проєктах. Якщо ви використовуєте JavaScript, ймовірно, вам знадобляться _ESLint_ і _Prettier_ для лінтингу та форматування коду. Якщо ви використовуєте TypeScript, можливо, вам сподобається _Pretty TypeScript Errors_ для легшого читання повідомлень. +Вам також знадобляться розширення, специфічні для мови, у ваших проєктах. Якщо ви використовуєте JavaScript, вам, ймовірно, знадобляться ESLint і Prettier для лінтингу та форматування коду. Якщо ви використовуєте TypeScript, можливо, вам сподобається Pretty TypeScript Errors для легшого читання повідомлень. -Нарешті, ви можете трохи розважитися з вашим редактором. _VS Code Pets_ пропонує налаштовуваних віртуальних домашніх тварин, які складуть вам компанію, поки ви виправляєте помилки. +Нарешті, ви також можете трохи розважитися з вашим редактором. VS Code Pets пропонує налаштовуваних віртуальних домашніх улюбленців, які складуть вам компанію, поки ви виправляєте помилки. -_Power Mode_ створює яскраві ефекти, коли ви досягаєте достатньо високого "комбо", пишучи більше коду. +Power Mode створює яскраві ефекти, коли ви досягаєте достатньо високого "комбо", пишучи більше коду. -_Discord Presence_ дозволяє показати всім своїм друзям, над чим ви працюєте. +Discord Presence дозволить вам показати всім своїм друзям, над чим ви працюєте. Існує ще безліч інших розширень. Не соромтеся досліджувати маркетплейс розширень і знаходити те, що найкраще підходить саме вам. @@ -33,7 +33,7 @@ _Discord Presence_ дозволяє показати всім своїм дру ## --text-- -Яку функцію надає розширення "Better Comments" у VS Code? +Яку функцію надає розширення Better Comments у VS Code? ## --answers-- @@ -69,7 +69,7 @@ _Discord Presence_ дозволяє показати всім своїм дру ## --text-- -Яке розширення VS Code описується як таке, що допомагає помічати виділені помилки у вашому коді, відображаючи повідомлення про помилку на всьому рядку? +Яке розширення VS Code виділяє всю лінію і відображає повідомлення про помилку рядково, замість того, щоб покладатися на підкреслення за замовчуванням? ## --answers-- @@ -105,7 +105,7 @@ ESLint ## --text-- -Яку унікальну функцію пропонує розширення "VS Code Pets"? +Яку унікальну функцію пропонує розширення VS Code Pets? ## --answers-- diff --git a/curriculum/challenges/ukrainian/blocks/lecture-working-with-css-flexbox/672aa7f7284b235f46f7d4e9.md b/curriculum/challenges/ukrainian/blocks/lecture-working-with-css-flexbox/672aa7f7284b235f46f7d4e9.md index 7cdd82fc98e..7e832eacbeb 100644 --- a/curriculum/challenges/ukrainian/blocks/lecture-working-with-css-flexbox/672aa7f7284b235f46f7d4e9.md +++ b/curriculum/challenges/ukrainian/blocks/lecture-working-with-css-flexbox/672aa7f7284b235f46f7d4e9.md @@ -319,7 +319,7 @@ CSS flexbox — це потужна модель макета, яка забез ### --feedback-- -Подумайте про розподіл елементів у гнучкому контейнері. +Подумайте, як головна вісь і поперечна вісь розташовані одна відносно одної. --- @@ -327,7 +327,7 @@ CSS flexbox — це потужна модель макета, яка забез ### --feedback-- -Подумайте про розподіл елементів у гнучкому контейнері. +Подумайте, як головна вісь і поперечна вісь розташовані одна відносно одної. --- @@ -339,7 +339,7 @@ CSS flexbox — це потужна модель макета, яка забез ### --feedback-- -Подумайте про розподіл елементів у гнучкому контейнері. +Подумайте, як головна вісь і поперечна вісь розташовані одна відносно одної. ## --video-solution-- diff --git a/curriculum/challenges/ukrainian/blocks/lecture-working-with-css-flexbox/672bd658c0e190f674a5e057.md b/curriculum/challenges/ukrainian/blocks/lecture-working-with-css-flexbox/672bd658c0e190f674a5e057.md index afb93e8470a..b26dd8d657d 100644 --- a/curriculum/challenges/ukrainian/blocks/lecture-working-with-css-flexbox/672bd658c0e190f674a5e057.md +++ b/curriculum/challenges/ukrainian/blocks/lecture-working-with-css-flexbox/672bd658c0e190f674a5e057.md @@ -7,11 +7,11 @@ dashedName: what-are-some-common-flex-properties # --interactive-- -Властивості flex — це властивості, які можна застосувати до контейнерів flex, щоб визначити розподіл дочірніх елементів. Ми розглянемо деякі з найпоширеніших: `flex-wrap`, `justify-content` і `align-items`. +Властивості flex керують тим, як елементи поводяться всередині гнучкого макета — від розподілу на рівні контейнера до самовирівнювання на рівні елемента. У цьому уроці ми розглянемо деякі з найпоширеніших: `flex-wrap`, `flex-flow`, `justify-content`, `align-items` та `align-self`. -Почнемо з `flex-wrap`. Ця властивість визначає, як гнучкі елементи обгортаються всередині контейнера flex, щоб поміститися у доступний простір. `flex-wrap` може приймати три можливі значення: `nowrap`, `wrap` і `wrap-reverse`. `nowrap` — це значення за замовчуванням: гнучкі елементи не будуть переноситися на новий рядок, навіть якщо їхня ширина перевищує ширину контейнера. +Почнемо з `flex-wrap`. Ця властивість визначає, як гнучкі елементи обгортаються всередині контейнера flex, щоб поміститися у доступний простір. `flex-wrap` може приймати три можливі значення: `nowrap`, `wrap` і `wrap-reverse`. `nowrap` — це значення за замовчуванням: гнучкі елементи не будуть переноситися на новий рядок, навіть якщо їх ширина перевищує ширину контейнера. -У наведеному нижче коді у нас є три `div` елементи. Зосередимося на `width`. Контейнер `main`, обведений червоним, має `width` зі значенням `200px`, тоді як його три дочірні `div` елементи разом мають `width` зі значенням `240px` (по `80px` кожен): +У наведеному нижче коді є три елементи `div`. Давайте звернемо увагу на `width`. Контейнер `main` з кордоном має `width` `200px`, а три дочірні елементи `div` разом мають `width` `240px` (по `80px` кожен): :::interactive_editor @@ -28,7 +28,7 @@ dashedName: what-are-some-common-flex-properties main { width: 200px; display: flex; - border: 2px solid red; + border: 2px solid #444; } div { @@ -51,7 +51,6 @@ div { ::: - Ширина `div` елементів перевищує ширину їхнього контейнера, але за замовчуванням вони будуть стиснені, щоб поміститися у доступний простір. Якщо ви хочете, щоб вони переносилися, коли перевищують ширину контейнера, ви можете встановити `flex-wrap: wrap` на контейнері flex: :::interactive_editor @@ -70,7 +69,7 @@ main { width: 200px; display: flex; flex-wrap: wrap; - border: 2px solid red; + border: 2px solid #444; } div { @@ -109,9 +108,10 @@ div { ```css main { width: 200px; + height: 120px; display: flex; flex-flow: column wrap-reverse; - border: 2px solid red; + border: 2px solid #444; } div { @@ -151,7 +151,7 @@ div { main { display: flex; justify-content: flex-start; - border: 2px solid red; + border: 2px solid #444; } div { @@ -191,7 +191,7 @@ div { main { display: flex; justify-content: flex-end; - border: 2px solid red; + border: 2px solid #444; } div { @@ -231,7 +231,7 @@ div { main { display: flex; justify-content: center; - border: 2px solid red; + border: 2px solid #444; } div { @@ -254,7 +254,7 @@ div { ::: -Щоб рівномірно розподілити елементи вздовж головної осі, можна використати `justify-content: space-between`. Це додасть пробіли між гнучкими елементами, якщо це потрібно. +Щоб розподілити елементи вздовж головної осі без пробілів на краях, можна використати `justify-content: space-between`. Перший елемент розташовується на початку головної осі, останній — в кінці, а решта простору розподіляється між сусідніми елементами. :::interactive_editor @@ -271,7 +271,7 @@ div { main { display: flex; justify-content: space-between; - border: 2px solid red; + border: 2px solid #444; } div { @@ -294,7 +294,7 @@ div { ::: -`justify-content: space-around` рівномірно розподіляє гнучкі елементи всередині головної осі, додаючи пробіл перед першим елементом і після останнього. Цей додатковий пробіл становить половину простору між кожною парою сусідніх елементів. Якщо є лише один елемент для розподілу, він буде центрований. +`justify-content: space-around` рівномірно розподіляє гнучкі елементи вздовж головної осі, додаючи пробіл перед першим і після останнього елемента. Цей додатковий пробіл становить половину простору між кожною парою сусідніх елементів. Якщо є лише один елемент для розподілу, він буде по центру. :::interactive_editor @@ -311,7 +311,7 @@ div { main { display: flex; justify-content: space-around; - border: 2px solid red; + border: 2px solid #444; } div { @@ -334,7 +334,6 @@ div { ::: - І нарешті, `justify-content: space-evenly` рівномірно розподіляє елементи вздовж головної осі. Пробіл між елементами та пробіли перед першим і після останнього елементів однакові: :::interactive_editor @@ -352,7 +351,7 @@ div { main { display: flex; justify-content: space-evenly; - border: 2px solid red; + border: 2px solid #444; } div { @@ -390,10 +389,10 @@ div { ```css main { - height: 300px; display: flex; + height: 300px; align-items: center; - border: 2px solid red; + border: 2px solid #444; } div { @@ -431,10 +430,10 @@ div { ```css main { - height: 300px; display: flex; + height: 300px; align-items: flex-start; - border: 2px solid red; + border: 2px solid #444; } div { @@ -472,10 +471,10 @@ div { ```css main { - height: 300px; display: flex; + height: 300px; align-items: flex-end; - border: 2px solid red; + border: 2px solid #444; } div { @@ -498,33 +497,43 @@ div { ::: -Щоб розтягнути гнучкі елементи вздовж поперечної осі, можна використати `align-items: stretch`. Це також працює з елементами, які автоматично підбирають розмір, наприклад, без встановленої `width` або `height`, або з мінімальним `width` чи `height`. Гнучкі елементи розтягнуться, щоб заповнити контейнер у напрямку поперечної осі. +Щоб розтягнути гнучкі елементи вздовж поперечної осі, можна використати `align-items: stretch`. Це впливає лише на елементи, розмір яких на поперечній осі встановлений як `auto`; елементи з явним розміром на поперечній осі (наприклад, заданою `height` у контейнері з рядками) не розтягуватимуться. Впливові елементи заповнять контейнер у напрямку поперечної осі. :::interactive_editor ```html <link rel="stylesheet" href="styles.css"> - -<div class="container"> - <div class="box">One</div> - <div class="box">Two</div> - <div class="box">Three</div> -</div> - +<main> + <div id="first-div"></div> + <div id="second-div"></div> + <div id="third-div"></div> +</main> ``` ```css -.container { +main { display: flex; - align-items: stretch; + height: 300px; + align-items: stretch; border: 2px solid #444; - height: 200px; } -.box { - width: 100px; - border: 1px solid #888; - background-color: lightblue; +div { + width: 80px; + height: 50px; +} + +#first-div { + background-color: #4d70b2; +} + +#second-div { + background-color: #5c4db2; +} + +#third-div { + background-color: #4da3b2; + height: auto; } ``` @@ -536,33 +545,37 @@ div { ```html <link rel="stylesheet" href="styles.css"> - -<div class="container"> - <div class="box">One</div> - <div class="box">Two</div> - <div class="box special">Three</div> -</div> - +<main> + <div id="first-div"></div> + <div id="second-div"></div> + <div id="third-div"></div> +</main> ``` ```css -.container { +main { display: flex; - align-items: flex-start; + height: 300px; + align-items: flex-start; border: 2px solid #444; - height: 200px; } -.box { - width: 100px; - border: 1px solid #888; - background-color: lightblue; - margin: 4px; +div { + width: 80px; + height: 50px; } -.special { - align-self: stretch; - background-color: lightcoral; +#first-div { + background-color: #4d70b2; +} + +#second-div { + background-color: #5c4db2; +} + +#third-div { + background-color: #4da3b2; + align-self: stretch; } ``` @@ -574,33 +587,37 @@ div { ```html <link rel="stylesheet" href="styles.css"> - -<div class="container"> - <div class="box">One</div> - <div class="box">Two</div> - <div class="box special">Three</div> -</div> - +<main> + <div id="first-div"></div> + <div id="second-div"></div> + <div id="third-div"></div> +</main> ``` ```css -.container { +main { display: flex; - align-items: flex-start; + height: 300px; + align-items: flex-start; border: 2px solid #444; - height: 200px; } -.box { - width: 100px; - border: 1px solid #888; - background-color: lightblue; - margin: 4px; +div { + width: 80px; + height: 50px; +} + +#first-div { + background-color: #4d70b2; +} + +#second-div { + background-color: #5c4db2; } -.special { - align-self: center; - background-color: lightcoral; +#third-div { + background-color: #4da3b2; + align-self: center; } ``` @@ -612,33 +629,37 @@ div { ```html <link rel="stylesheet" href="styles.css"> - -<div class="container"> - <div class="box">One</div> - <div class="box">Two</div> - <div class="box special">Three</div> -</div> - +<main> + <div id="first-div"></div> + <div id="second-div"></div> + <div id="third-div"></div> +</main> ``` ```css -.container { +main { display: flex; - align-items: flex-start; + height: 300px; + align-items: flex-start; border: 2px solid #444; - height: 200px; } -.box { - width: 100px; - border: 1px solid #888; - background-color: lightblue; - margin: 4px; +div { + width: 80px; + height: 50px; +} + +#first-div { + background-color: #4d70b2; } -.special { - align-self: flex-start; - background-color: lightcoral; +#second-div { + background-color: #5c4db2; +} + +#third-div { + background-color: #4da3b2; + align-self: flex-start; } ``` @@ -650,39 +671,43 @@ div { ```html <link rel="stylesheet" href="styles.css"> - -<div class="container"> - <div class="box">One</div> - <div class="box">Two</div> - <div class="box special">Three</div> -</div> - +<main> + <div id="first-div"></div> + <div id="second-div"></div> + <div id="third-div"></div> +</main> ``` ```css -.container { +main { display: flex; - align-items: flex-start; + height: 300px; + align-items: flex-start; border: 2px solid #444; - height: 200px; } -.box { - width: 100px; - border: 1px solid #888; - background-color: lightblue; - margin: 4px; +div { + width: 80px; + height: 50px; } -.special { - align-self: flex-end; - background-color: lightcoral; +#first-div { + background-color: #4d70b2; +} + +#second-div { + background-color: #5c4db2; +} + +#third-div { + background-color: #4da3b2; + align-self: flex-end; } ``` ::: -Існують інші властивості flex і значення, які ви можете обрати, щоб створити адаптивний макет, який ви уявляєте, але це найпоширеніші. З цими CSS-властивостями flex і вашими новими знаннями про модель CSS flex ви можете почати створювати адаптивні макети для плавного та інклюзивного користувацького досвіду на різних пристроях. +Існують інші властивості та значення flex, які ви можете обрати для створення адаптивного макета, який ви уявляєте, але ці — найпоширеніші. Використовуючи ці CSS-властивості flex і свої нові знання про модель CSS flex, ви можете почати створювати адаптивні макети для плавного та інклюзивного користувацького досвіду на різних пристроях. # --questions-- @@ -764,7 +789,7 @@ div { ## --answers-- -`flex-direction` і `justify-content`. +`flex-direction` і `justify-content` ### --feedback-- @@ -772,7 +797,7 @@ div { --- -`flex-direction` і `align-items`. +`flex-direction` і `align-items` ### --feedback-- @@ -780,7 +805,7 @@ div { --- -`flex-direction` і `align-content`. +`flex-direction` і `align-content` ### --feedback-- @@ -788,7 +813,7 @@ div { --- -`flex-direction` і `flex-wrap`. +`flex-direction` і `flex-wrap` ## --video-solution-- diff --git a/curriculum/challenges/ukrainian/blocks/lecture-working-with-css-fonts/672bd814105a0ffcf36f9233.md b/curriculum/challenges/ukrainian/blocks/lecture-working-with-css-fonts/672bd814105a0ffcf36f9233.md index 10131cfc9d4..769c153563a 100644 --- a/curriculum/challenges/ukrainian/blocks/lecture-working-with-css-fonts/672bd814105a0ffcf36f9233.md +++ b/curriculum/challenges/ukrainian/blocks/lecture-working-with-css-fonts/672bd814105a0ffcf36f9233.md @@ -1,6 +1,6 @@ --- id: 672bd814105a0ffcf36f9233 -title: What Are Font Families and How Do They Work? +title: Що таке множини шрифтів і як вони працюють? challengeType: 19 dashedName: what-are-font-families --- @@ -11,6 +11,8 @@ dashedName: what-are-font-families <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/what-are-font-families-and-how-do-they-work-1.png" alt="Diagram showing 'Arial' at the top with two blue arrows pointing down to 'Arial Bold' on the left and 'Arial Italic' on the right, illustrating font family variations" /> +## Встановлення множин шрифтів у CSS + У CSS ви можете встановити сімейство шрифтів за допомогою властивості `font-family`. Ось приклад встановлення шрифту для абзацу на `Arial`: :::interactive_editor @@ -29,6 +31,8 @@ dashedName: what-are-font-families ::: +## Запасні варіанти шрифтів + А що, якщо сімейство шрифтів не знайдено? Ви можете вказати кілька сімейств шрифтів у порядку пріоритету — від найвищого до найнижчого, розділяючи їх комами. Ці альтернативні шрифти будуть запасними варіантами. У цьому прикладі Arial — основний шрифт, а Lato — запасний: :::interactive_editor @@ -51,13 +55,15 @@ dashedName: what-are-font-families Варто також знати, як цей процес працює за лаштунками. Вибір не припиняється, якщо перший шрифт доступний. Сімейство шрифтів обирається по одному символу, тож якщо в шрифті бракує певного символу, браузер шукає його у шрифтах з нижчим пріоритетом. Цікаво, правда? +## Загальні множини шрифтів + У контексті веб-розробки ви також зустрінете загальні сімейства шрифтів. Вони дуже важливі. Загальне сімейство шрифтів — це шрифт за замовчуванням, який браузери відтворюють, коли шрифти з вищим пріоритетом недоступні. Щоб забезпечити читабельність вмісту, браузер замінює оригінальний шрифт на найбільш відповідний, виходячи із зазначеного загального сімейства шрифтів. Найпоширеніші з них: - serif - sans-serif -- monospace -- cursive -- fantasy +- моноширинний +- курсив +- фантазійний Але є й інші варіанти. У коді нижче наведено три альтернативні сімейства шрифтів: @@ -81,6 +87,8 @@ Arial має найвищий пріоритет. Якщо Arial не знайд Завжди слід включати загальне сімейство шрифтів наприкінці списку font-family. Пам’ятайте, що загальний шрифт може виглядати інакше, ніж шрифт, який ви спочатку задумали у дизайні, тому завжди корисно перевірити, як ці запасні шрифти виглядають у різних браузерах. +## Веб-безпечні шрифти + Щоб зробити користувацький досвід максимально послідовним, також рекомендується використовувати веб-безпечні шрифти. Ці сімейства шрифтів зазвичай встановлені на більшості пристроїв, тож їх дуже ймовірно знайти і відтворити правильно для більшості користувачів. Ви дізнаєтеся про них більше в наступних уроках. Сімейства шрифтів є важливими у світі веб-дизайну. Використовуючи властивість font-family, ви можете миттєво змінити вигляд і відчуття вашого тексту. diff --git a/curriculum/challenges/ukrainian/blocks/lecture-working-with-css-fonts/672bd8453d1371fdb1510fe5.md b/curriculum/challenges/ukrainian/blocks/lecture-working-with-css-fonts/672bd8453d1371fdb1510fe5.md index ae2e1cd4068..f92f59a75b1 100644 --- a/curriculum/challenges/ukrainian/blocks/lecture-working-with-css-fonts/672bd8453d1371fdb1510fe5.md +++ b/curriculum/challenges/ukrainian/blocks/lecture-working-with-css-fonts/672bd8453d1371fdb1510fe5.md @@ -11,6 +11,8 @@ dashedName: how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fo Google Fonts і Font Squirrel — популярні онлайн-ресурси для пошуку та використання безкоштовних шрифтів для веброзробки. Ви можете дуже легко інтегрувати їх у свої проєкти. +## Google Fonts + Почнемо з Google Fonts. Це сервіс Google, який пропонує колекцію шрифтів, багато з яких спеціально розроблені для веброзробки. У користувацькому інтерфейсі Google Fonts ви побачите багато різних елементів. Розглянемо їх по черзі. У лівій бічній панелі ви знайдете: - Розділ для перегляду, пошуку та фільтрації шрифтів. @@ -18,6 +20,8 @@ Google Fonts і Font Squirrel — популярні онлайн-ресурси - Розділ, де можна знайти та скачати іконки для ваших вебпроєктів. - Розділ, де можна дізнатися більше про шрифти та їх найкращі практики, а також відповіді на часті запитання. +## Перегляд Google Fonts + Щоб додати Google Font на свій вебсайт, перейдіть до першого розділу (Fonts). Ви можете налаштувати текст попереднього перегляду у лівій бічній панелі, де написано "Preview". Просто напишіть текст, який хочете побачити, і він оновиться автоматично. Це допоможе переглянути шрифт із текстом, який ви вже маєте на увазі для свого сайту. Також можна відрегулювати розмір шрифту та відфільтрувати шрифти за їхніми характеристиками. <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-1.png" alt="Google Fonts Fonts section showing a left sidebar with preview text set to 'freeCodeCamp' at 40px, filter options for Language, Technology, and Decorative stroke, and the main panel listing font families including Roboto, SUSE, and Sevillana each previewing 'freeCodeCamp'" /> @@ -28,12 +32,16 @@ Google Fonts і Font Squirrel — популярні онлайн-ресурси <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-2.png" alt="Google Fonts Roboto Styles page with Specimen, Type tester, Glyphs, and About & license tabs, a blue Get font button, a preview text field showing 'freeCodeCamp' with a font size slider at 48px, and a list of styles including Thin 100, Thin 100 Italic, Light 300, and Light 300 Italic" /> +## Використання Google Fonts + Коли будете готові додати шрифт до свого проєкту, натисніть на синю кнопку "Get font" зверху. Вас перенаправить на сторінку з підсумком, де ви побачите шрифти, які наразі вибрані. Можна вибрати кілька шрифтів одночасно. <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-3.png" alt="Google Fonts page showing '1 font family selected' with Roboto Static listed, Get embed code and Download all buttons on the right, and a How to use section with All, Design, Develop, and Google products tabs" /> Далі потрібно вибрати, чи хочете ви скачати файли шрифтів, щоб додати їх до проєкту як локальні файли, чи хочете використовувати їх як зовнішні шрифти і завантажувати з серверів Google, коли користувач заходить на ваш сайт. Натисніть "Download all", якщо хочете скачати, або "Get embed code", якщо віддаєте перевагу використовувати їх як зовнішні шрифти на серверах Google. Якщо натиснути "Get embed code", ви побачите інструкції, які потрібно виконати, щоб додати ці зовнішні шрифти до свого проєкту. +### Посилання на Google Fonts + Для веброзробки у вас є два варіанти. Ви можете використати елемент `link` або `@import`. Якщо оберете варіант з елементом `link`, ви можете скопіювати та вставити HTML-фрагмент і CSS-правила, щоб додати їх до свого проєкту. Код слід вставити у елемент `head` вашого HTML-файлу та додати CSS-правила, які відповідають вашим потребам. <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-4.png" alt="Google Fonts Embed code page with the link element option selected, showing three link tags for preconnect and the font stylesheet, a CSS classes section with .roboto-thin, .roboto-light, .roboto-regular, and .roboto-medium rules, and a left sidebar showing font style toggles" /> @@ -141,6 +149,8 @@ Google Fonts і Font Squirrel — популярні онлайн-ресурси Для кожного стилю шрифту є CSS-правило. Кожне правило призначає кастомні шрифти з запасними шрифтами на випадок, якщо кастомні шрифти не завантажаться правильно. +### Імпорт Google Fonts + Якщо ви оберете варіант `@import`, вам потрібно буде додати це правило до свого CSS-файлу. <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-5.png" alt="Google Fonts Embed code page with the @import option selected, showing a style block containing the @import URL rule, a CSS classes section below, and the left sidebar with font style toggles" /> @@ -159,10 +169,14 @@ CSS-правила абсолютно однакові. Ось що таке Google Fonts. Це один із найпопулярніших варіантів для пошуку безкоштовних і відкритих шрифтів для веброзробки. +## Font Squirrel + Ще один чудовий варіант — Font Squirrel, де можна знайти та скачати кастомні шрифти, які ви уявляєте для свого дизайну. <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-7.png" alt="Font Squirrel 'Free Font Utopia' page listing featured free fonts including Acherus Grotesque, Intro Rust, Source Sans Pro, Open Sans, and Questa, each shown with an alphabet specimen and a Download button" /> +## Перегляд Font Squirrel + Якщо ви шукаєте шрифт і натискаєте на результат, побачите більше деталей про шрифт, включно з зразками, тест-драйвом, гліфами та Webfont kit. <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-8.png" alt="Font Squirrel search results for 'Roboto' showing three matches: Roboto, Roboto 2014, and Roboto Slab, each with an alphabet specimen and a Download TTF button" /> @@ -173,6 +187,8 @@ CSS-правила абсолютно однакові. <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-10.png" alt="Font Squirrel Roboto Specimens section listing all styles with alphabet samples: Roboto Thin, Thin Italic, Light, Light Italic, Regular, Italic, Medium, Medium Italic, Bold, Bold Italic, and Black, each in its respective weight" /> +## Використання Font Squirrel + Коли ви визначилися зі шрифтом, який хочете використати у проєкті, перейдіть на вкладку "Webfont Kit". Тут можна перевірити, чи дозволяє ліцензія шрифту використовувати його у `@font-face` CSS-вставках. Також можна вибрати підмножину та формат. <img src="https://cdn.freecodecamp.org/curriculum/lecture-transcripts/how-do-you-work-with-external-fonts-like-font-squirrel-and-google-fonts-11.png" alt="Font Squirrel Roboto Webfont Kit tab showing a license notice confirming @font-face embedding is allowed, a subset selector set to Western Latin, format checkboxes with WOFF selected, and a Download @font-face Kit button" /> diff --git a/curriculum/challenges/ukrainian/blocks/lecture-working-with-css-fonts/672bd853c985cdfdeb32f4f9.md b/curriculum/challenges/ukrainian/blocks/lecture-working-with-css-fonts/672bd853c985cdfdeb32f4f9.md index 9c126e3daf2..c2fa4b0a040 100644 --- a/curriculum/challenges/ukrainian/blocks/lecture-working-with-css-fonts/672bd853c985cdfdeb32f4f9.md +++ b/curriculum/challenges/ukrainian/blocks/lecture-working-with-css-fonts/672bd853c985cdfdeb32f4f9.md @@ -13,6 +13,8 @@ CSS за замовчуванням не застосовує тіні до те text-shadow: /* Values */ ``` +## Значення компенсування `X` та `Y` + У CSS тінь можна описати через комбінацію її `X` зміщення, `Y` зміщення, радіуса розмиття та кольору. Спочатку потрібно вказати `X` та `Y` зміщення, які відповідно представляють горизонтальну та вертикальну відстань тіні від тексту. Ці значення є обов’язковими. Ось приклад, як застосувати `X` та `Y` зміщення для тіні. Ми застосовуємо властивість `text-shadow` з x-зміщенням `3px` та y-зміщенням `2px`: @@ -32,7 +34,11 @@ p { ::: -У браузері текст і тінь виглядатимуть схоже, але ми також можемо налаштувати колір тіні, вказавши значення перед або після зміщення. Давайте встановимо колір тіні. Тут ми використаємо шістнадцятковий колір, але ви можете використати будь-який дійсний формат кольору. +У браузері текст і тінь виглядатимуть схоже. + +## Додавання кольору до тіні + +Ми також можемо кастомізувати колір тіні, вказуючи значення до або після компенсування. Давайте встановимо колір тіні. Тут ми використаємо шістнадцятковий колір, але ви можете використати будь-який дійсний формат кольору. :::interactive_editor @@ -66,7 +72,11 @@ p { ::: -У браузері тінь матиме конкретний колір, тому ми легко відрізнимо її від тексту. Тепер, коли ми можемо розрізняти тінь і текст, також важливо побачити, як позитивні та від’ємні значення впливають на зміщення тіні. Позитивні значення `X` зміщення та `Y` зміщення відповідно перемістять тінь вправо та вниз, а від’ємні значення — вліво та вгору. Ось приклад із від’ємними значеннями: +У браузері тінь матиме певний колір, тому ми легко зможемо відрізнити її від тексту. + +## Позитивні та від’ємні значення компенсування + +Тепер, коли ми можемо відрізнити тінь від тексту, також важливо побачити, як позитивні та від’ємні значення впливають на компенсування тіні. Позитивні значення компенсування `X` та `Y` відповідно зміщують тінь вправо і вниз, тоді як від’ємні значення зміщують тінь вліво і вгору. Ось приклад, де замість цього використовуються від’ємні значення: :::interactive_editor @@ -83,7 +93,11 @@ p { ::: -Тепер тінь переміститься вліво та вгору відносно тексту. Чудово. Але тінь виглядає не дуже гарно, бо вона виглядає точно як оригінальний текст, але розташована позаду нього. Щоб зробити її приємнішою, потрібно додати третє значення — радіус розмиття. Це значення необов’язкове, але робить тінь більш плавною та делікатною. Значення радіуса розмиття за замовчуванням — нуль. Чим більше значення, тим більший розмиття, а отже тінь стає світлішою. +Тепер тінь зміститься вліво і вгору відносно тексту. Чудово. + +## Радіус розмиття + +Але тінь виглядає не дуже гарно, бо вона виглядає точно як оригінальний текст, але розташована позаду нього. Щоб зробити її приємнішою, потрібно додати третє значення — радіус розмиття. Це значення необов’язкове, але робить тінь набагато м’якшою і більш тонкою. Значення радіуса розмиття за замовчуванням — нуль. Чим більше значення, тим більшим стає розмиття, а це означає, що тінь стає світлішою. Тут ми встановлюємо радіус розмиття `3px` і повертаємося до позитивних значень зміщення: @@ -104,6 +118,8 @@ p { Тепер це починає виглядати як тінь. Вона більш розмита і делікатна, тому ми можемо зосередитися на основному тексті, а тінь додає стилю на фоні. Звідси ми можемо трохи підкоригувати значення, доки не знайдемо комбінацію зміщення, кольору та радіуса розмиття, яка підходить нам. +## Додавання кількох тіней + Також корисно знати, що текст може мати більше ніж одну тінь. Просто потрібно записати їх у тій самій властивості `text-shadow`, розділені комами. Вони застосовуватимуться шарами, спереду назад, причому перша тінь буде зверху. Ось приклад абзацу з трьома тінями, застосованими шарами. Зверніть увагу, що всі ці тіні визначені в одній властивості `text-shadow` і розділені комами: diff --git a/curriculum/challenges/ukrainian/blocks/lecture-working-with-css-transforms-overflow-and-filters/672bccc8ea33bad87abb3c56.md b/curriculum/challenges/ukrainian/blocks/lecture-working-with-css-transforms-overflow-and-filters/672bccc8ea33bad87abb3c56.md index 33540fc45ba..fea1b89d58e 100644 --- a/curriculum/challenges/ukrainian/blocks/lecture-working-with-css-transforms-overflow-and-filters/672bccc8ea33bad87abb3c56.md +++ b/curriculum/challenges/ukrainian/blocks/lecture-working-with-css-transforms-overflow-and-filters/672bccc8ea33bad87abb3c56.md @@ -19,6 +19,8 @@ dashedName: what-is-the-difference-between-content-box-and-border-box Значення властивості `box-sizing` за замовчуванням — `content-box`, але ви можете вибрати `border-box`, якщо це потрібно. Спочатку розглянемо `content-box`, а потім перейдемо до `border-box`. +## Повторення моделі CSS-блоку + Щоб зрозуміти, як працюють ці моделі, потрібно ознайомитися з чотирма основними поняттями моделі CSS-блоку. Давайте швидко їх повторимо. - Область вмісту — це простір, який займає вміст елемента. @@ -26,6 +28,8 @@ dashedName: what-is-the-difference-between-content-box-and-border-box - Кордон — це обрис, який оточує область вмісту та відступ. - Поле — це простір поза межами кордону, який відокремлює елемент від інших елементів. +## Як працює `content-box` + У моделі `content-box` ширина і висота, які ви задаєте для елемента, визначають розміри області вмісту, але не включають відступ, кордон або поле. Використовуйте `content-box`, коли потрібен точний контроль над областю вмісту. Коли ви встановлюєте `width` і `height`, ви задаєте лише розмір самого вмісту. Щоб знайти загальну ширину елемента, потрібно додати лівий і правий відступ, а також лівий і правий кордони. Аналогічно, загальну висоту елемента можна знайти, додавши висоту вмісту, верхній і нижній відступи, а також верхній і нижній кордони. @@ -52,10 +56,14 @@ div { У цьому випадку, якщо використовується `content-box`, область вмісту буде 300px на 200px. Загальний відтворений розмір включає відступи та кордони — наприклад, загальна ширина = 300px (вміст) + 40px (відступ) + 8px (кордони) = 348px; загальна висота обчислюється аналогічно. +## Як працює `border-box` + Чудово! Тепер розглянемо `border-box`. Вона відрізняється тим, що ширина і висота, які ви задаєте, включають вміст елемента, відступи та кордони (але не поле). Використовуйте `border-box`, коли хочете, щоб загальний розмір елемента залишався фіксованим, навіть якщо відступи або кордони змінюються — це часто корисно в адаптивних макетах. У `border-box` відступи та кордони включені всередину заданого розміру елемента. `width` і `height`, які ви встановлюєте, стають загальними розмірами елемента: вміст + відступ + кордон; поля залишаються виключеними. +## Порівняння двох моделей + У наступному прикладі є два елементи `div` з однаковими розмірами, але різними значеннями `box-sizing`. Зверніть увагу, як це призводить до різних загальних розмірів при перегляді у браузері: :::interactive_editor diff --git a/curriculum/challenges/ukrainian/blocks/lecture-working-with-dates/6733aafb9c0802f66cc1e056.md b/curriculum/challenges/ukrainian/blocks/lecture-working-with-dates/6733aafb9c0802f66cc1e056.md index ddb3c980d30..e1cf521b02e 100644 --- a/curriculum/challenges/ukrainian/blocks/lecture-working-with-dates/6733aafb9c0802f66cc1e056.md +++ b/curriculum/challenges/ukrainian/blocks/lecture-working-with-dates/6733aafb9c0802f66cc1e056.md @@ -34,21 +34,31 @@ console.log(now); Для часу використовується 24-годинний формат, тому `14:30` — це `2:30 PM`. `GMT-0700` — це зсув часової зони, а `Pacific Daylight Time` — назва часової зони. -Ви також можете передати конкретну дату та час у об’єкт `Date`, вказавши рік, місяць, день, годину, хвилину, секунду та мілісекунду як аргументи. +Ось приклад створення нового `Date` об’єкта з конкретним рядком дати: -Ось приклад створення нового об’єкта `Date` з конкретною датою та часом: +:::interactive_editor + +```js +const dateFromString = new Date("July 4, 1776 12:00:00"); + +console.log(dateFromString); +``` + +::: + +Ви також можете передати конкретну дату і час у `Date` об’єкт, вказавши рік, місяць, день, годину, хвилину, секунду та мілісекунду як аргументи: :::interactive_editor ```js -const specificDate = new Date("July 4, 1776 12:00:00"); +const dateFromArguments = new Date(1776, 6, 4, 12, 0, 0, 0); -console.log(specificDate); +console.log(dateFromArguments); ``` ::: -Це корисно, коли потрібно працювати з конкретною датою та часом, а не з поточними. Вхідні дані завжди мають бути рядком, а формат повинен бути розпізнаваним об’єктом `Date`. +Це корисно, коли потрібно працювати з конкретною датою і часом, а не з поточними датою і часом. Щоб отримати поточну дату та час, можна використати метод `Date.now()`, який повертає кількість мілісекунд, що минули з `January 1, 1970, 00:00:00 UTC`. Це відоме як час Unix epoch. diff --git a/curriculum/challenges/ukrainian/blocks/lecture-working-with-file-systems/672ac403a9ba7732b31c6480.md b/curriculum/challenges/ukrainian/blocks/lecture-working-with-file-systems/672ac403a9ba7732b31c6480.md index b0eb78d24f9..703d42da150 100644 --- a/curriculum/challenges/ukrainian/blocks/lecture-working-with-file-systems/672ac403a9ba7732b31c6480.md +++ b/curriculum/challenges/ukrainian/blocks/lecture-working-with-file-systems/672ac403a9ba7732b31c6480.md @@ -51,7 +51,7 @@ WOFF — сучасний формат шрифтів, спеціально ро Зазвичай вони написані у форматі файлу, який називається Markdown. За допомогою Markdown можна створювати структуровані документи з заголовками, підзаголовками, посиланнями, зображеннями, списками та іншим. Файли Markdown мають розширення `.md` або `.markdown`. -Ось тут ви можете знайти `README` файл репозиторію freeCodeCamp на GitHub: https://github.com/freeCodeCamp/freeCodeCamp/blob/main/README.md +Тут ви можете знайти `README` файл репозиторію freeCodeCamp на GitHub: `https://github.com/freeCodeCamp/freeCodeCamp/blob/main/README.md` Ви можете створити таку детальну структуру та формат за допомогою Markdown. diff --git a/curriculum/challenges/ukrainian/blocks/lecture-working-with-node-core-modules/695cc6a5eefd305381ec90bc.md b/curriculum/challenges/ukrainian/blocks/lecture-working-with-node-core-modules/695cc6a5eefd305381ec90bc.md index 6883db7660f..06e1602a109 100644 --- a/curriculum/challenges/ukrainian/blocks/lecture-working-with-node-core-modules/695cc6a5eefd305381ec90bc.md +++ b/curriculum/challenges/ukrainian/blocks/lecture-working-with-node-core-modules/695cc6a5eefd305381ec90bc.md @@ -148,7 +148,7 @@ async function readFileContent() { const fileContent = await fs.readFile("article.md", "utf8"); console.log("File content:", fileContent); } catch (err) { - console.log("File read successfully"); + console.error("Error reading file:", err); } } @@ -169,7 +169,7 @@ async function readFileContent() { const fileContent = await fs.readFile("article.md"); console.log("File content:", fileContent); } catch (err) { - console.log("File read successfully"); + console.error("Error reading file:", err); } } @@ -318,3 +318,4 @@ Error deleting file: Error: ENOENT: no such file or directory, unlink 'article.t ## --video-solution-- 4 + diff --git a/curriculum/challenges/ukrainian/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d2f232c60f0fa68ef86.md b/curriculum/challenges/ukrainian/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d2f232c60f0fa68ef86.md index 910a1abc644..9216783fe54 100644 --- a/curriculum/challenges/ukrainian/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d2f232c60f0fa68ef86.md +++ b/curriculum/challenges/ukrainian/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d2f232c60f0fa68ef86.md @@ -1,6 +1,6 @@ --- id: 68ff6d2f232c60f0fa68ef86 -title: Що таке Node і які відмінності між браузером і середовищем виконання Node? +title: Що таке Node і які відмінності між браузером та середовищем виконання Node? challengeType: 19 dashedName: what-is-node-and-what-are-some-differences-between-the-browser-and-node-runtime-environment --- @@ -19,11 +19,11 @@ JavaScript на стороні клієнта може бути дуже пот JavaScript на стороні клієнта має ці обмеження, бо спочатку був розроблений виключно для запуску у веббраузерах. -Веббраузери забезпечують середовище, необхідне для запуску JavaScript-коду, включно з JavaScript-двигуном. Вони також надають доступ до Document Object Model (DOM), щоб ви могли отримувати доступ до HTML-елементів у своєму коді. +Веб-браузери надають середовище, необхідне для запуску JavaScript-коду, включно з JavaScript-двигуном. Вони також забезпечують доступ до Document Object Model (DOM), щоб ви могли отримувати доступ до HTML-елементів у своєму коді. -Раніше ми не могли запускати JavaScript поза браузером, але тепер це можливо з Node.js. +Протягом тривалого часу JavaScript використовувався майже виключно всередині браузерів, але з Node.js ви можете запускати його і поза браузером. -Node.js — це середовище виконання JavaScript. Офіційно його визначають як «відкритий і кросплатформенний середовище виконання JavaScript». +Node.js — це середовище виконання JavaScript. Офіційно його визначають як «відкрите та кросплатформне середовище виконання JavaScript». Давайте розглянемо, що це означає: @@ -43,7 +43,7 @@ Node.js використовується у багатьох галузях. Р Наприклад, з браузера ви можете отримати доступ до DOM API, але існують обмеження на доступ до локальної файлової системи. Натомість у середовищі виконання Node ви можете отримати доступ майже до всіх системних ресурсів, включно з файловою системою, але не до DOM. -Обидва середовища JavaScript надають глобальний об’єкт. У браузерному середовищі виконання JavaScript він називається `window`. Цей об’єкт `window` надає доступ до функціональностей, пов’язаних із браузером, таких як методи для маніпуляції DOM, керування куками та обробки подій браузера. У середовищі Node.js цей глобальний об’єкт називається `global`. Об’єкт `global` надає доступ до специфічних для Node.js функціональностей, таких як вбудовані модулі для роботи з локальними файлами, мережею та взаємодії з операційною системою. +Обидва середовища виконання JavaScript надають глобальний об’єкт. У браузерному середовищі виконання JavaScript він називається `window`. Цей об’єкт `window` забезпечує доступ до функціональностей, пов’язаних із браузером, таких як методи для маніпулювання DOM, керування куками та обробки браузерних подій. У середовищі Node.js цей глобальний об’єкт називається `global`. Об’єкт `global` надає доступ до специфічних для Node.js функціональностей, таких як вбудовані модулі для роботи з локальними файлами, мережею та взаємодії з операційною системою. Нарешті, ще одна важлива відмінність полягає в тому, що ви можете обирати версію Node.js, яку хочете використовувати на своєму сервері. Однак ви не маєте контролю над версією браузерного середовища, яке використовують ваші користувачі для відвідування вашого сайту. @@ -103,7 +103,7 @@ Node.js став дуже важливим для розробників у вс --- -Середовище виконання Node використовує об’єкт window як свій глобальний об’єкт, а браузери — глобальний об’єкт. +Середовище виконання Node використовує об’єкт `window` як свій глобальний об’єкт, тоді як браузери використовують об’єкт `global`. ### --feedback-- diff --git a/curriculum/challenges/ukrainian/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d372ad364f285f0522e.md b/curriculum/challenges/ukrainian/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d372ad364f285f0522e.md index 10908786ca5..fbe85d520c9 100644 --- a/curriculum/challenges/ukrainian/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d372ad364f285f0522e.md +++ b/curriculum/challenges/ukrainian/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d372ad364f285f0522e.md @@ -11,7 +11,7 @@ dashedName: what-are-the-advantages-and-disadvantages-to-using-node-on-the-back- Архітектура Node — ще одна перевага. Вона має неблокуючу, подієво-орієнтовану архітектуру, яка чудово підходить для розробки реального часу застосунків, де адаптивність і ефективність є ключовими для створення гарного користувацького досвіду. -Саме тут концепція «потоків» стає дуже важливою. Потік — це шлях виконання в межах процесу, як комп’ютерна програма, що наразі працює. +Саме тут концепція «потоків» стає дуже важливою. Потік — це шлях виконання в межах процесу, тобто комп’ютерної програми, яка наразі працює. Архітектура Node базується на одному потоці та циклі подій, які ефективно обробляють велику кількість одночасних запитів і операцій вводу/виводу. Це робить його ідеальним для застосунків, які потребують одночасної обробки багатьох запитів. @@ -25,13 +25,13 @@ dashedName: what-are-the-advantages-and-disadvantages-to-using-node-on-the-back- З іншого боку, у Node.js є певні недоліки або обмеження, про які варто знати. -Як ви дізналися, він запускає лише один потік одночасно, що означає, що може обробляти лише одну операцію за раз. Хоча його архітектура дозволяє ефективно обробляти одночасні (паралельні) запити, задачі, що інтенсивно навантажують центральний процесор, можуть блокувати головний потік і спричиняти проблеми з продуктивністю. +Як ви дізналися, він запускає ваш JavaScript на одному потоці, що означає, що одночасно може виконувати лише одну частину вашого коду. Хоча його архітектура дозволяє ефективно обробляти одночасні (паралельні) запити, задачі, що інтенсивно використовують центральний процесор, можуть блокувати головний потік і спричиняти проблеми з продуктивністю. Прикладами таких задач є складні математичні операції, обробка зображень і відео, а також криптографія. Існують способи подолати це, але вони зазвичай ускладнюють застосунок. -Node.js також базується на асинхронному програмуванні. В асинхронному програмуванні задача, яка може зайняти багато часу, запускається, але замість того, щоб чекати на її завершення, головна програма продовжує працювати, поки асинхронна задача виконується паралельно. Коли задача завершується, програма обробляє результат. +В асинхронному програмуванні запускається задача, яка може тривати довго, але замість того, щоб чекати на її завершення, головна програма продовжує працювати, поки асинхронна задача виконується у фоновому режимі. -Цей процес часто включає те, що ми називаємо «функціями зворотного виклику», які визначають, що відбувається після завершення асинхронних операцій. Асинхронна природа Node.js потенційно може ускладнити читання, розуміння та налагодження коду. +Цей процес часто включає те, що ми називаємо «функціями зворотного виклику», які визначають, що відбувається після завершення асинхронних операцій. Асинхронна природа Node.js потенційно може ускладнювати читання, розуміння та налагодження коду. І нарешті, слід бути обережним при виборі пакетів з `npm`, менеджера пакетів Node, бо деякі з них можуть не підтримуватися постійно, що може призвести до вразливостей у вашому застосунку. Як розробник, ви повинні ретельно оцінювати кожен пакет і перевіряти, чи дотримується він найкращих практик якості та безпеки. diff --git a/curriculum/challenges/ukrainian/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d39d7ed9ef36ff281f3.md b/curriculum/challenges/ukrainian/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d39d7ed9ef36ff281f3.md index bb7957d68d7..3d1f505c2bc 100644 --- a/curriculum/challenges/ukrainian/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d39d7ed9ef36ff281f3.md +++ b/curriculum/challenges/ukrainian/blocks/lecture-working-with-nodejs-and-event-driven-architecture/68ff6d39d7ed9ef36ff281f3.md @@ -17,7 +17,7 @@ dashedName: how-can-you-install-node-on-your-computer На macOS і Linux ви можете встановити NVM безпосередньо через shell-скрипт. -Але для macOS зверніть увагу, що офіційна документація NVM зазначає: «потрібно вручну встановити інструменти командного рядка Xcode перед запуском скрипта встановлення, інакше він не спрацює». +Але для macOS зверніть увагу, що офіційна документація NVM зазначає: «вам потрібно вручну встановити інструменти командного рядка Xcode перед запуском скрипта встановлення, інакше він не спрацює». На macOS ви можете встановити інструменти командного рядка Xcode, виконавши цю команду у терміналі: @@ -41,7 +41,7 @@ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash ``` -Щоб отримати останню версію NVM на момент читання цієї статті, зверніться до офіційної документації NVM: `https://github.com/nvm-sh/nvm?tab=readme-ov-file#install--update-script`. Там ви знайдете ці команди з актуальним номером версії. +Щоб отримати останню версію NVM на момент читання цього уроку, зверніться до офіційної документації NVM: `https://github.com/nvm-sh/nvm?tab=readme-ov-file#install--update-script`. Там ви знайдете ці команди з актуальним номером версії. Можливо, вам доведеться перезапустити термінал після завершення процесу, щоб завантажити нову команду та конфігурацію. @@ -57,7 +57,7 @@ nvm -v Тепер, коли у вас встановлено NVM на macOS/Linux, ви можете встановити Node.js. -Щоб встановити останню версію з довготривалою підтримкою (LTS) Node.js, виконайте цю команду: +Щоб встановити останню версію Node.js з довготривалою підтримкою (LTS), виконайте цю команду: ```bash nvm install --lts @@ -101,7 +101,7 @@ node -v Офіційні версії NVM підтримують Windows лише в певних випадках. Якщо у вас налаштовано Windows Subsystem for Linux (WSL) на вашому пристрої, ви можете слідувати інструкціям для macOS/Linux вище, щоб встановити та використовувати NVM. -Однак для самої Windows існує кілька альтернатив. Одна з них — `nvm-windows`, утиліта для керування версіями Node.js на Windows. Це абсолютно окремий проєкт від офіційного NVM. Але мета цих інструментів одна — допомогти вам працювати з кількома версіями Node.js на одному пристрої. +Однак для самої Windows існує кілька альтернатив. Одна з них — `nvm-windows`, утиліта для керування версіями Node.js на Windows. Це повністю окремий проєкт від офіційного NVM. Але мета цих інструментів однакова: допомогти вам працювати з кількома версіями Node.js на одному пристрої. Перед встановленням `nvm-windows` слід знати, що офіційний репозиторій рекомендує видалити будь-які попередні встановлення Node перед встановленням NVM для Windows. Якщо ви вперше встановлюєте Node.js, це не проблема. Якщо у вас вже є інші версії Node.js, рекомендується спочатку їх видалити. @@ -155,7 +155,7 @@ nvm use 20 Також ви можете перевірити поточну версію Node.js цією командою: -```bash +```powershell node -v ``` @@ -165,25 +165,25 @@ node -v Також, хоча всі ці команди працюватимуть для NVM, встановленого на macOS/Linux, включно з WSL, вони можуть працювати інакше або не працювати зовсім для `nvm-windows`. Ми надамо альтернативні команди для `nvm-windows` там, де це можливо. -### Як налаштувати політику виконання Powershell +### Як налаштувати політику виконання PowerShell -Якщо ви працюєте на Windows і користуєтеся Powershell та `nvm-windows`, можливо, вам доведеться налаштувати політику виконання Powershell. Політика виконання за замовчуванням для Powershell — `Restricted`, що є заходом безпеки для запобігання запуску скриптів. +Якщо ви працюєте на Windows і користуєтеся PowerShell та `nvm-windows`, можливо, вам доведеться налаштувати політику виконання PowerShell. За замовчуванням політика виконання PowerShell — `Restricted`, що є заходом безпеки для запобігання запуску скриптів. -Спершу запустіть Powershell від імені адміністратора, клацнувши правою кнопкою на Powershell, а потім вибравши «Запустити від імені адміністратора». +Спочатку запустіть PowerShell від імені адміністратора, клацнувши правою кнопкою миші на PowerShell, а потім вибравши «Запустити від імені адміністратора». -Потім, щоб побачити поточну політику виконання для поточної сесії Powershell, виконайте таку команду: +Потім, щоб побачити поточну політику виконання поточної сесії PowerShell, виконайте таку команду: ```powershell Get-ExecutionPolicy ``` -Нарешті, щоб встановити політику виконання Powershell на `RemoteSigned`, що дозволяє запускати локальні скрипти та `npm`, використайте цю команду: +Нарешті, щоб встановити політику виконання PowerShell на `RemoteSigned`, що дозволяє запускати локальні скрипти та `npm`, використайте таку команду: ```powershell Set-ExecutionPolicy RemoteSigned ``` -Після виконання цієї команди ви можете закрити вікно Powershell адміністратора і відкрити звичайне вікно Powershell. +Після виконання наведеної вище команди ви можете закрити вікно PowerShell адміністратора і відкрити PowerShell без прав адміністратора. ### Переглянути всі версії @@ -193,7 +193,7 @@ Set-ExecutionPolicy RemoteSigned nvm ls ``` -### Встановити версію Node.js за замовчуванням (тільки NVM на macOS/Linux) +### Встановлення версії Node.js за замовчуванням (тільки NVM на macOS/Linux) Ця команда встановлює версію Node.js за замовчуванням, яка буде використовуватися у нових сесіях терміналу: @@ -231,7 +231,7 @@ nvm use <new_name> nvm use new-api ``` -### Видалити версію Node.js +### Видалення версії Node.js Щоб видалити версію Node.js, виконайте цю команду: @@ -271,7 +271,7 @@ node -v npm -v ``` -### Запустити JavaScript-файл +### Запуск JavaScript-файлу Ця команда запускає JavaScript-файл, який ви вкажете, у поточному активному середовищі виконання Node.js: @@ -285,7 +285,7 @@ node <file.js> node app.js ``` -### Створити проєкт Node.js +### Створення проєкту Node.js Ця команда створює новий проєкт Node.js, створюючи файл `package.json`, який відстежує його деталі та залежності. @@ -295,7 +295,7 @@ npm init Коли ви виконуєте команду `npm init`, вона проведе вас через інтерактивний інтерфейс командного рядка для налаштування файлу `package.json`. Вас запитають про назву проєкту, опис, версію тощо. Якщо хочете почати з файлу `package.json` за замовчуванням, можете використати команду `npm init -y` або `npm init --yes`. -### Встановити пакет +### Встановлення пакета Щоб встановити конкретний пакет, виконайте: @@ -430,3 +430,4 @@ npm install ## --video-solution-- 1 + diff --git a/curriculum/challenges/ukrainian/blocks/lecture-working-with-operator-behavior/6732719e2e3ad4d947410b65.md b/curriculum/challenges/ukrainian/blocks/lecture-working-with-operator-behavior/6732719e2e3ad4d947410b65.md index e0c9195f8df..18160aeb1be 100644 --- a/curriculum/challenges/ukrainian/blocks/lecture-working-with-operator-behavior/6732719e2e3ad4d947410b65.md +++ b/curriculum/challenges/ukrainian/blocks/lecture-working-with-operator-behavior/6732719e2e3ad4d947410b65.md @@ -11,7 +11,13 @@ dashedName: how-does-operator-precedence-work Пріоритет операторів визначає порядок, у якому обчислюються операції у виразі. Оператори з вищим пріоритетом обчислюються раніше за оператори з нижчим пріоритетом. Уявіть пріоритет операторів як у математиці, де ділення і множення відбуваються раніше за додавання і віднімання. -Без дотримання цього правила базові рівняння давали б неправильну відповідь. JavaScript працює так само. У нього є власні правила, які оператори йдуть першими, другими і так далі. Наприклад, подивіться на вираз нижче: +Якщо не дотримуватися цього правила, базові рівняння давали б неправильну відповідь. JavaScript працює так само. У нього є власні правила, які визначають, які оператори виконуються першими, другими і так далі. + +## Пріоритет у арифметичних виразах + +### Пріоритет множення + +Наприклад, подивіться на вираз нижче: :::interactive_editor @@ -25,36 +31,42 @@ console.log(result); // 14 Якби JavaScript обчислював цей вираз зліва направо, ви очікували б `2 + 3 = 5`, а потім `5 * 4 = 20`. Але оскільки множення має вищий пріоритет, ніж додавання, JavaScript спочатку обчислює частину `3 * 4`, що дає результат `2 + 12 = 14`. -Іноді ви хочете, щоб певні частини вашого виразу обчислювалися першими, незалежно від правил пріоритету. Ви можете використати круглі дужки, `()`, щоб це зробити. Все, що всередині круглих дужок, обчислюється першим, незалежно від усього. Давайте змусимо частину `2 + 3` з попереднього прикладу обчислитися першою: +### Пріоритет ділення + +Оператор ділення також має вищий пріоритет, ніж додавання чи віднімання: :::interactive_editor ```js -const result = (2 + 3) * 4; +const result = 2 + 6 / 3; -console.log(result); // 20 +console.log(result); // 4 ``` ::: -У наведеному прикладі круглі дужки змушують JavaScript спочатку обчислити `2 + 3`, а потім помножити результат на `4`. Це дає вам `20` замість `14`. +Якби JavaScript обчислював цей вираз зліва направо, ви могли б очікувати `2 + 6 = 8`, а потім `8 / 3 = 2.67`. Але оскільки ділення має вищий пріоритет, ніж додавання, JavaScript спочатку обчислює ділення: `6 / 3 = 2`, а потім додає `2 + 2`, отримуючи результат `4`. -Оператор ділення також має вищий пріоритет, ніж додавання чи віднімання: +### Використання круглих дужок для заміщення пріоритету + +Іноді ви можете захотіти, щоб певні частини вашого виразу виконувалися першими, незалежно від правил пріоритету. Для цього можна використовувати круглі дужки, `()`. Все, що знаходиться в дужках, обчислюється спочатку, незалежно від усього. Давайте змусимо частину `2 + 3` з прикладу множення обчислитися першою: :::interactive_editor ```js -const result = 2 + 6 / 3; +const result = (2 + 3) * 4; -console.log(result); // 4 +console.log(result); // 20 ``` ::: -Якби JavaScript обчислював цей вираз зліва направо, ви могли б очікувати `2 + 6 = 8`, а потім `8 / 3 = 2.67`. Але оскільки ділення має вищий пріоритет, ніж додавання, JavaScript спочатку обчислює ділення: `6 / 3 = 2`, а потім додає `2 + 2`, отримуючи результат `4`. +У наведеному прикладі круглі дужки змушують JavaScript спочатку обчислити `2 + 3`, а потім помножити результат на `4`. Це дає вам `20` замість `14`. Отже, і в множенні, і в діленні ці операції завжди відбуваються раніше за додавання і віднімання, якщо ви не використаєте круглі дужки, щоб змінити порядок. А що відбувається, якщо оператори мають однаковий пріоритет? JavaScript використовує асоціативність, щоб визначити порядок їх обчислення. +## Розуміння асоціативності + Асоціативність — це те, що каже JavaScript, чи обчислювати оператори зліва направо, чи справа наліво. Для більшості операторів, як додавання і множення, асоціативність — зліва направо. Тож JavaScript обробляє їх з лівого краю виразу до правого: :::interactive_editor @@ -84,6 +96,8 @@ console.log(a + b); // 10 У наведеному прикладі JavaScript спочатку призначає `5` `b`, а потім призначає `b` (яке тепер `5`) `a`. +### Оператор степеня + Оператор піднесення до степеня також має асоціативність справа наліво: :::interactive_editor diff --git a/curriculum/challenges/ukrainian/blocks/lecture-working-with-regular-expressions/6733c5e54e3a154c8078ed48.md b/curriculum/challenges/ukrainian/blocks/lecture-working-with-regular-expressions/6733c5e54e3a154c8078ed48.md index 28cd1a530f4..fc09526cc55 100644 --- a/curriculum/challenges/ukrainian/blocks/lecture-working-with-regular-expressions/6733c5e54e3a154c8078ed48.md +++ b/curriculum/challenges/ukrainian/blocks/lecture-working-with-regular-expressions/6733c5e54e3a154c8078ed48.md @@ -17,6 +17,8 @@ const regex = /^\d\d\d\d$/; І це працює: воно співпаде з чотирма числовими символами. Але замість того, щоб писати один і той самий клас кілька разів, ви можете задати для нього квантор. +## Точні квантори + Квантори визначаються фігурними дужками з одним або двома числами всередині. Давайте використаємо квантор у нашому шаблоні: ```js @@ -40,6 +42,8 @@ console.log(regex.test("1234567")); // false Шаблон співпадає лише з рядком, що містить рівно чотири цифри, бо ми використали анкери, а наш квантор дозволяє лише рівно чотири цифри. Але можливо, ідентифікаційний код повинен мати мінімум чотири цифри. +## Мінімальні та максимальні квантори + Щоб дозволити чотири або більше цифр, додайте кому після числа у кванторі: ```js @@ -84,6 +88,10 @@ console.log(regex.test("1234567")); // false Зверніть увагу, що ви не можете використовувати цей синтаксис, щоб встановити лише максимум: завжди потрібно вказувати мінімум. Але якщо встановити мінімум `1`, ви фактично досягнете того самого результату. +## Скорочені квантори + +### Квантор знака питання (`?`) + Ми отримали оновлені вимоги від користувачів. Тепер ідентифікатори можуть необов’язково починатися з літери. Ми вже знаємо клас символів для цього, тож додамо його до нашого регулярного виразу: ```js @@ -122,6 +130,8 @@ console.log(regex.test("1234567")); // false Тепер наш шаблон дозволяє один необов’язковий символ літери, за яким іде від чотирьох до шести цифр. +### Квантор зірочки (`*`) + На жаль, ми щойно зрозуміли, що неправильно прочитали вимоги. Потрібно дозволити будь-яку кількість літер перед цифрами. Ми можемо використати квантор з мінімумом `0` і без визначеного максимуму: ```js @@ -144,6 +154,8 @@ console.log(regex.test("1234567")); // false ::: +### Квантор плюса (`+`) + Тепер ми успішно співпадаємо з будь-яким ідентифікатором, що містить нуль або більше літер, за якими йде від чотирьох до шести чисел. Але виявилося, що це викликає збій у нашій системі: нам насправді потрібно вимагати принаймні одну літеру. Знову ж таки, ми могли б використати квантор з мінімумом один і без визначеного максимуму, або ж використати ще один спеціальний синтаксис — символ плюса (`+`): diff --git a/curriculum/challenges/ukrainian/blocks/lecture-working-with-the-dom-click-events-and-web-apis/673368ccf52205329b729378.md b/curriculum/challenges/ukrainian/blocks/lecture-working-with-the-dom-click-events-and-web-apis/673368ccf52205329b729378.md index 00a1e503e4f..5926927cad2 100644 --- a/curriculum/challenges/ukrainian/blocks/lecture-working-with-the-dom-click-events-and-web-apis/673368ccf52205329b729378.md +++ b/curriculum/challenges/ukrainian/blocks/lecture-working-with-the-dom-click-events-and-web-apis/673368ccf52205329b729378.md @@ -7,12 +7,16 @@ dashedName: what-is-the-difference-between-innertext-textcontent-and-innerhtml # --interactive-- +## Огляд + Давайте дізнаємося про `innerText`, `textContent` і `innerHTML`. Це властивості, до яких ви можете отримати доступ у JavaScript, щоб отримати або змінити вміст HTML-елемента. Хоча вони можуть виглядати дуже схожими на перший погляд, між ними є ключові відмінності. Вибір правильного залежить від вашого конкретного випадку, тож давайте розберемося. Почнемо з `innerText`. +## Розуміння innerText + `innerText` представляє видимий текстовий вміст HTML-елемента та його нащадків. Ця властивість не включає прихований текст або HTML-теги, лише відтворений текст. Наприклад, тут ви бачите `div` елемент, який містить два абзаци: @@ -109,6 +113,8 @@ container.innerText = "JavaScript is awesome!"; Чудово. Тепер поговоримо про `textContent`. +## Розуміння textContent + `textContent` повертає простий текстовий вміст елемента, включно з усім текстом у його нащадках. Найважливіша відмінність між `innerText` і `textContent` полягає в тому, що `textContent` завжди повертає повний текстовий вміст HTML-елемента та його нащадків, незалежно від того, чи він видимий, чи прихований. @@ -181,6 +187,8 @@ container.textContent = "New content"; ::: +## Порівняння з innerHTML + І нарешті, поговоримо про те, чим `textContent` і `innerText` відрізняються від `innerHTML`. Пам’ятайте, що за допомогою `innerHTML` ви можете встановити внутрішній HTML-вміст елемента. Це корисно для динамічного додавання нового HTML у DOM. @@ -189,6 +197,8 @@ container.textContent = "New content"; Щоб уникнути цього, рекомендується використовувати властивість `textContent` для вставки простого тексту. +## Підсумок ключових відмінностей + Властивості `innerText`, `textContent` і `innerHTML` у JavaScript надають різні способи доступу та маніпулювання вмістом HTML-елементів. Ви повинні розуміти відмінності між цими властивостями, якщо ваша мета — ефективно працювати з HTML-вмістом у JavaScript. # --questions-- @@ -219,7 +229,7 @@ container.textContent = "New content"; --- -Усі вищезазначені. +Всі вищезазначені причини. ### --feedback-- @@ -255,7 +265,7 @@ container.textContent = "New content"; --- -Жодна з наведених. +Жоден із наведених варіантів. ### --feedback-- @@ -291,7 +301,7 @@ container.textContent = "New content"; --- -Усі вищезазначені. +Всі вищезазначені причини. ### --feedback-- diff --git a/curriculum/challenges/ukrainian/blocks/machine-learning-with-python-projects/5e46f8d6ac417301a38fb92d.md b/curriculum/challenges/ukrainian/blocks/machine-learning-with-python-projects/5e46f8d6ac417301a38fb92d.md index 7d8c6a67a5f..9af8d595dac 100644 --- a/curriculum/challenges/ukrainian/blocks/machine-learning-with-python-projects/5e46f8d6ac417301a38fb92d.md +++ b/curriculum/challenges/ukrainian/blocks/machine-learning-with-python-projects/5e46f8d6ac417301a38fb92d.md @@ -1,6 +1,6 @@ --- id: 5e46f8d6ac417301a38fb92d -title: камінь ножиці папір +title: Камінь ножиці папір challengeType: 10 forumTopicId: 462376 dashedName: rock-paper-scissors @@ -10,7 +10,7 @@ dashedName: rock-paper-scissors Для цього завдання ви створите програму для гри в камінь, ножиці, папір. Програма, яка вибирає випадковий хід, зазвичай виграє 50% часу. Щоб пройти це завдання, ваша програма має грати матчі проти чотирьох різних ботів, виграючи принаймні 60% ігор у кожному матчі. -Ви будете <a href="https://app.ona.com/?autostart=true#https://github.com/freeCodeCamp/boilerplate-rock-paper-scissors/" target="_blank" rel="noopener noreferrer nofollow">працювати над цим проєктом із нашим стартовим кодом Ona</a>. +Ви будете <a href="https://codespaces.new/freeCodeCamp/boilerplate-rock-paper-scissors/" target="_blank" rel="noopener noreferrer nofollow">працювати над цим проєктом із нашим шаблонним кодом</a>. Ми все ще розробляємо інтерактивну навчальну частину навчальної програми з машинного навчання. Наразі вам доведеться використовувати інші ресурси, щоб навчитися проходити це завдання. @@ -56,7 +56,7 @@ play(player, quincy, 1000, verbose=True) # --hints-- -Він має пройти всі тести Python. +Ваша модель має пройти всі тести на Python. ```js diff --git a/curriculum/challenges/ukrainian/blocks/review-introduction-to-express/6a0354d43d4c00eca38561f7.md b/curriculum/challenges/ukrainian/blocks/review-introduction-to-express/6a0354d43d4c00eca38561f7.md index 91deef21dfe..29bb556ca57 100644 --- a/curriculum/challenges/ukrainian/blocks/review-introduction-to-express/6a0354d43d4c00eca38561f7.md +++ b/curriculum/challenges/ukrainian/blocks/review-introduction-to-express/6a0354d43d4c00eca38561f7.md @@ -7,53 +7,6 @@ dashedName: review-introduction-to-express # --description-- -## Веб-сервіси та API - -- **API (інтерфейс програмування застосунків)**: Загальний спосіб для програмного забезпечення спілкуватися з іншим програмним забезпеченням. -- **Веб-сервіс**: Конкретний тип API, який використовує веб-технології, такі як HTTP, для обміну даними через мережу. Кожен веб-сервіс є API, але не кожен API є веб-сервісом. -- **Ключові характеристики веб-сервісу**: працює на сервері, забезпечує взаємодію між машинами, не залежить від мови програмування, не залежить від платформи, використовує стандартні веб-протоколи (HTTP/HTTPS, FTP, SMTP). -- **REST (передача репрезентативного стану)**: Найпоширеніший тип веб-сервісу сьогодні. Відкриває доступ до ресурсів, ідентифікованих URL-шляхами, як `/users` або `/users/20`. Відповіді зазвичай у форматі JSON, але можуть бути також XML або простим текстом. -- **SOAP (протокол простого доступу до об’єктів)**: Використовує лише XML. Поширений у корпоративних системах, які потребують суворіших стандартів і безпеки. -- **XML-RPC**: Використовує XML для кодування запитів і відповідей. Легкий, але менш гнучкий, ніж REST. -- **`Accept` заголовок**: Використовується клієнтом, щоб повідомити серверу, у якому форматі він хоче отримати відповідь, наприклад `Accept: application/json`. - -## Архітектура REST - -- **Безстанність**: Кожен запит має містити всю інформацію, необхідну серверу для його обробки. Сервер не зберігає інформацію про попередні запити. -- **Ресурс**: Частина даних, до якої можна отримати доступ або змінити, ідентифікована URL (наприклад, `/products/1`). -- **HTTP-методи в REST**: - - `GET` — отримати ресурс - - `POST` — створити новий ресурс - - `PUT` / `PATCH` — оновити існуючий ресурс - - `DELETE` — видалити ресурс - -## HTTP-коди стану - -Після обробки запиту сервер відповідає **кодом стану**, який вказує на результат: - -- `200` **(OK)**: Запит успішний -- `201` **(Created)**: Створено новий ресурс -- `400` **(Bad Request)**: Клієнт надіслав некоректні дані -- `404` **(Not Found)**: Запитуваний ресурс не існує -- `500` **(Internal Server Error)**: На сервері сталася помилка - -### Як працює REST-запит - -1. Клієнт надсилає запит із методом, URL, необов’язковими заголовками та необов’язковим тілом. -2. Сервер перевіряє запит і визначає ресурс. -3. Сервер виконує дію (отримати, створити, оновити або видалити). -4. Сервер формує відповідь із кодом стану та необов’язковим тілом (зазвичай JSON). -5. Сервер надсилає відповідь — стан клієнта не зберігається. -6. Клієнт перевіряє код стану і обробляє отримані дані. - -## Моноліти проти мікросервісів - -- **Моноліт**: Один великий кодовий базис, де інтерфейс, база даних і API живуть разом. Добре підходить для невеликих застосунків, але з ростом стає складніше підтримувати і масштабувати. -- **Мікросервіси**: Архітектура, де великий застосунок розбивається на менші, незалежні сервіси. Кожен сервіс відповідає за одну бізнес-функцію (наприклад, продукти, замовлення, платежі) і може мати власний код, базу даних і команду. -- **Як мікросервіси спілкуються**: Через API або системи обміну повідомленнями. -- **Переваги мікросервісів**: Швидша розробка, краща ізоляція помилок, можливість використовувати різні мови або фреймворки для кожного сервісу. -- **Виклики мікросервісів**: Складніше налагодження, складніше керування інфраструктурою, більші мережеві витрати між сервісами. - ## Що таке Express.js? - **Express**: Мінімалістичний і гнучкий веб-фреймворк на базі Node.js, який полегшує створення веб-серверів і API. diff --git a/curriculum/challenges/ukrainian/blocks/review-rest-api-and-web-services/6a7c78ad958a597ee788ad2a.md b/curriculum/challenges/ukrainian/blocks/review-rest-api-and-web-services/6a7c78ad958a597ee788ad2a.md new file mode 100644 index 00000000000..4e3ec09d0f0 --- /dev/null +++ b/curriculum/challenges/ukrainian/blocks/review-rest-api-and-web-services/6a7c78ad958a597ee788ad2a.md @@ -0,0 +1,59 @@ +--- +id: 6a7c78ad958a597ee788ad2a +title: Повторення REST API та веб-сервісів +challengeType: 31 +dashedName: review-rest-api-and-web-services +--- + +# --description-- + +## Веб-сервіси та API + +- **API (інтерфейс програмування застосунків)**: Загальний спосіб для програмного забезпечення спілкуватися з іншим програмним забезпеченням. +- **Веб-сервіс**: Конкретний тип API, який використовує веб-технології, такі як HTTP, для обміну даними через мережу. Кожен веб-сервіс є API, але не кожен API є веб-сервісом. +- **Ключові характеристики веб-сервісу**: працює на сервері, забезпечує взаємодію між машинами, не залежить від мови програмування, не залежить від платформи, використовує стандартні веб-протоколи (HTTP/HTTPS, FTP, SMTP). +- **REST (передача репрезентативного стану)**: Найпоширеніший тип веб-сервісу сьогодні. Відкриває доступ до ресурсів, ідентифікованих URL-шляхами, як `/users` або `/users/20`. Відповіді зазвичай у форматі JSON, але можуть бути також XML або простим текстом. +- **SOAP (протокол простого доступу до об’єктів)**: Використовує лише XML. Поширений у корпоративних системах, які потребують суворіших стандартів і безпеки. +- **XML-RPC**: Використовує XML для кодування запитів і відповідей. Легкий, але менш гнучкий, ніж REST. +- **`Accept` заголовок**: Використовується клієнтом, щоб повідомити серверу, у якому форматі він хоче отримати відповідь, наприклад `Accept: application/json`. + +## Архітектура REST + +- **Безстанність**: Кожен запит має містити всю інформацію, необхідну серверу для його обробки. Сервер не зберігає інформацію про попередні запити. +- **Ресурс**: Частина даних, до якої можна отримати доступ або змінити, ідентифікована URL (наприклад, `/products/1`). +- **HTTP-методи в REST**: + - `GET` — отримати ресурс + - `POST` — створити новий ресурс + - `PUT` / `PATCH` — оновити існуючий ресурс + - `DELETE` — видалити ресурс + +## HTTP-коди стану + +Після обробки запиту сервер відповідає **кодом стану**, який вказує на результат: + +- `200` **(OK)**: Запит успішний +- `201` **(Created)**: Створено новий ресурс +- `400` **(Bad Request)**: Клієнт надіслав некоректні дані +- `404` **(Not Found)**: Запитуваний ресурс не існує +- `500` **(Internal Server Error)**: На сервері сталася помилка + +### Як працює REST-запит + +1. Клієнт надсилає запит із методом, URL, необов’язковими заголовками та необов’язковим тілом. +2. Сервер перевіряє запит і визначає ресурс. +3. Сервер виконує дію (отримати, створити, оновити або видалити). +4. Сервер формує відповідь із кодом стану та необов’язковим тілом (зазвичай JSON). +5. Сервер надсилає відповідь — стан клієнта не зберігається. +6. Клієнт перевіряє код стану і обробляє отримані дані. + +## Моноліти проти мікросервісів + +- **Моноліт**: Один великий кодовий базис, де інтерфейс, база даних і API живуть разом. Добре підходить для невеликих застосунків, але з ростом стає складніше підтримувати і масштабувати. +- **Мікросервіси**: Архітектура, де великий застосунок розбивається на менші, незалежні сервіси. Кожен сервіс відповідає за одну бізнес-функцію (наприклад, продукти, замовлення, платежі) і може мати власний код, базу даних і команду. +- **Як мікросервіси спілкуються**: Через API або системи обміну повідомленнями. +- **Переваги мікросервісів**: Швидша розробка, краща ізоляція помилок, можливість використовувати різні мови або фреймворки для кожного сервісу. +- **Виклики мікросервісів**: Складніше налагодження, складніше керування інфраструктурою, більші мережеві витрати між сервісами. + +# --assignment-- + +Повторіть теми та концепції REST API та веб-сервісів. diff --git a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e89d557d4b78bf83a02ae6.md b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e89d557d4b78bf83a02ae6.md index 0600f193e2c..8dae33d1212 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e89d557d4b78bf83a02ae6.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e89d557d4b78bf83a02ae6.md @@ -396,10 +396,10 @@ body { const { useState } = React; export const FootballPlayerCard = () => { - return ( + return ( --fcc-editable-region-- - <h1 style={{ backgroundColor: '#fff' }}>Hello, TSX!</h1> + <h1 style={{ backgroundColor: "#fff" }}>Hello, TSX!</h1> --fcc-editable-region-- - ) + ); }; ``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb2.md b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb2.md index d5683509b50..bb77eb4a0fd 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb2.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb2.md @@ -29,12 +29,10 @@ assert.equal(element?.type, window.index.PlayerCard); <meta charset="utf-8"/> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Football Player Card Builder - - - + @@ -379,21 +377,18 @@ body { ```tsx const { useState } = React; -export function PlayerCard() { +export const PlayerCard = () => { return ( -
- -
+
); -} +}; export const FootballPlayerCard = () => { - + --fcc-editable-region-- return ( - --fcc-editable-region-- -

Football Card Builder

- --fcc-editable-region-- - ) +

Football Card Builder

+ ); + --fcc-editable-region-- }; ``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb3.md b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb3.md index 29e4e1aed20..b02f4165b14 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb3.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb3.md @@ -382,15 +382,13 @@ export const PlayerCard = () => { return (
--fcc-editable-region-- - + --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { - return ( - - ); + return ; }; ``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb4.md b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb4.md index 9591797f95b..90b657e551c 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb4.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb4.md @@ -381,12 +381,12 @@ export const PlayerCard = () => {
--fcc-editable-region-- - + --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb5.md b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb5.md index f4e1d3abdcb..fb3d19e248d 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb5.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb5.md @@ -394,13 +394,13 @@ export const PlayerCard = () => {
--fcc-editable-region-- - + --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb6.md b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb6.md index e4715d116f4..0782e98b68c 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb6.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb6.md @@ -390,14 +390,14 @@ export const PlayerCard = () => {
98
--fcc-editable-region-- - + --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb7.md b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb7.md index 194660d0a34..8779f7a074b 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb7.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb7.md @@ -398,13 +398,13 @@ export const PlayerCard = () => {
ST
--fcc-editable-region-- - + --fcc-editable-region-- ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb8.md b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb8.md index 59ef040c0a1..a2e267ac494 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb8.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb8.md @@ -394,14 +394,14 @@ export const PlayerCard = () => {
GOLD
--fcc-editable-region-- - + --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb9.md b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb9.md index bcbc398f4e4..87fa3a8d238 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb9.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bb9.md @@ -393,12 +393,12 @@ export const PlayerCard = () => { --fcc-editable-region-- - + --fcc-editable-region-- ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bba.md b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bba.md index 4b40aadea8c..8e0713b7305 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bba.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bba.md @@ -412,13 +412,13 @@ export const PlayerCard = () => {
--fcc-editable-region-- - + --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbb.md b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbb.md index ab05790d6d7..38928824fff 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbb.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbb.md @@ -406,12 +406,12 @@ export const PlayerCard = () => { Edson Arantes do Nascimento (Pele) headshot --fcc-editable-region-- - + --fcc-editable-region-- ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbc.md b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbc.md index 65fd340ff69..1dd6752a880 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbc.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbc.md @@ -409,12 +409,12 @@ export const PlayerCard = () => { PELE --fcc-editable-region-- - + --fcc-editable-region-- ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbd.md b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbd.md index 2339b1fe0bd..6af4917a8f6 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbd.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbd.md @@ -427,13 +427,13 @@ export const PlayerCard = () => { --fcc-editable-region-- - + --fcc-editable-region-- ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbe.md b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbe.md index d105f6fb4fe..895043a8e5b 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbe.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbe.md @@ -465,7 +465,7 @@ export const PlayerCard = () => { ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbf.md b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbf.md index 4e9c29df56b..f204bb751c3 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbf.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bbf.md @@ -420,7 +420,7 @@ interface PlayerData { position: string; club: string; --fcc-editable-region-- - + --fcc-editable-region-- } @@ -478,7 +478,7 @@ export const PlayerCard = () => { ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc0.md b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc0.md index d080884f161..6c96f069c05 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc0.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc0.md @@ -497,7 +497,7 @@ export const PlayerCard = () => { ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc1.md b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc1.md index 51a79092650..dc1746bd5e3 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc1.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc1.md @@ -398,10 +398,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } --fcc-editable-region-- @@ -460,7 +460,7 @@ export const PlayerCard = () => { ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc2.md b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc2.md index 97327d6a247..5a221cde441 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc2.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc2.md @@ -40,12 +40,10 @@ assert.exists(document.querySelector('.card-wrapper.tier-elite')); Football Player Card Builder - - - + @@ -405,10 +403,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -467,9 +465,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc3.md b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc3.md index 56a3e913a44..78bd5c82824 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc3.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc3.md @@ -399,10 +399,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -461,9 +461,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc4.md b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc4.md index 09ebdb23dd8..875fcd09d4d 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc4.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc4.md @@ -399,10 +399,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -461,9 +461,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc5.md b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc5.md index 542d875c171..d289a4c3a0e 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc5.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc5.md @@ -392,10 +392,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -456,9 +456,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc6.md b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc6.md index c7041a10c8f..2be9f605128 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc6.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc6.md @@ -401,10 +401,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -465,9 +465,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc7.md b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc7.md index 313cf85d92b..897c3e4d600 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc7.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b295388ebbd517692bc7.md @@ -391,10 +391,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -455,9 +455,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc8.md b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc8.md index d9b7273aae9..52dafea0b7e 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc8.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc8.md @@ -407,10 +407,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -436,9 +436,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { {player.name}
- --fcc-editable-region--
+ --fcc-editable-region-- 97 PAC
@@ -448,10 +448,10 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
83 + --fcc-editable-region-- PAS
- --fcc-editable-region--
@@ -471,9 +471,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc9.md b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc9.md index 258a6b93a3f..937ed631d44 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc9.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bc9.md @@ -483,10 +483,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -545,13 +545,13 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
); -} +}; --fcc-editable-region-- --fcc-editable-region-- export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bca.md b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bca.md index c5a5892376e..247df12adee 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bca.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bca.md @@ -419,10 +419,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -481,14 +481,14 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { - name: 'PELE', + name: "PELE", overallRating: 98, - position: 'ST', - club: 'Santos FC', - imageUrl: 'https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg', + position: "ST", + club: "Santos FC", + imageUrl: "https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg", pac: 97, sho: 98, pas: 83, diff --git a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcb.md b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcb.md index 6f6197f637f..7e23a6246b8 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcb.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcb.md @@ -435,10 +435,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -497,14 +497,14 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { - name: 'PELE', + name: "PELE", overallRating: 98, - position: 'ST', - club: 'Santos FC', - imageUrl: 'https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg', + position: "ST", + club: "Santos FC", + imageUrl: "https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg", pac: 97, sho: 98, pas: 83, @@ -517,6 +517,7 @@ export const FootballPlayerCard = () => { const [player, setPlayer] = useState(defaultPlayer); return ( --fcc-editable-region-- + --fcc-editable-region-- ); diff --git a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcc.md b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcc.md index a1b1ab35446..a82e216dc69 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcc.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcc.md @@ -477,7 +477,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -504,7 +504,9 @@ export const FootballPlayerCard = () => { --fcc-editable-region-- + + --fcc-editable-region-- ); diff --git a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcd.md b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcd.md index d78f965af21..d37de23c281 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcd.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcd.md @@ -465,7 +465,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bce.md b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bce.md index 976d1094514..5fc64daeb24 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bce.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bce.md @@ -470,7 +470,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcf.md b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcf.md index c661ff8b7df..1c0de7b0b94 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcf.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bcf.md @@ -488,7 +488,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd0.md b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd0.md index d491098cca4..9335a326841 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd0.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd0.md @@ -471,7 +471,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd1.md b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd1.md index aecb53b7b95..82f39528890 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd1.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd1.md @@ -471,7 +471,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd2.md b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd2.md index 14409c4346f..53f883d87aa 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd2.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd2.md @@ -471,7 +471,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -535,7 +535,7 @@ export const FootballPlayerCard = () => { - --fcc-editable-region-- + --fcc-editable-region-- --fcc-editable-region-- diff --git a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd3.md b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd3.md index a80ea6c6810..eabf10a89ee 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd3.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd3.md @@ -497,7 +497,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd4.md b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd4.md index ba6933c5ee6..a6215e28035 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd4.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd4.md @@ -497,7 +497,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd5.md b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd5.md index afb011eebba..86a9b912eed 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd5.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd5.md @@ -497,7 +497,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd6.md b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd6.md index 8702da05cee..58c61277c9b 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd6.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd6.md @@ -470,7 +470,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd7.md b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd7.md index c0ba5dd75d0..c3938d5712d 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd7.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd7.md @@ -478,7 +478,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -609,3 +609,4 @@ export const FootballPlayerCard = () => { ); }; ``` + diff --git a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd8.md b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd8.md index b822841c429..676a756775e 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd8.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd8.md @@ -410,7 +410,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -484,7 +484,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -538,8 +538,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd9.md b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd9.md index 7c93ef77d45..2ac76a2aded 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd9.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bd9.md @@ -402,7 +402,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -476,7 +476,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -530,8 +530,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bda.md b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bda.md index 267ae6544aa..1b876791b64 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bda.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bda.md @@ -402,7 +402,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -476,7 +476,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -530,8 +530,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( @@ -640,3 +641,4 @@ export const FootballPlayerCard = () => { ); }; ``` + diff --git a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdb.md b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdb.md index 4b5530f052e..7a666802027 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdb.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdb.md @@ -402,7 +402,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -476,7 +476,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -530,8 +530,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdc.md b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdc.md index 93392f94a6e..dfad07b4a81 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdc.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdc.md @@ -402,7 +402,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -476,7 +476,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -530,8 +530,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdd.md b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdd.md index 06b2cfc384c..09e44d70eea 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdd.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdd.md @@ -402,7 +402,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -476,7 +476,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -530,8 +530,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bde.md b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bde.md index 170067c3a90..e96e9820965 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bde.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bde.md @@ -402,7 +402,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -414,10 +414,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -430,7 +430,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
{player.position}
-
{getPlayerTier(player.overallRating).toUpperCase()}
+
+ {getPlayerTier(player.overallRating).toUpperCase()} +
{player.club}
@@ -474,14 +476,14 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { - name: 'PELE', + name: "PELE", overallRating: 98, - position: 'ST', - club: 'Santos FC', - imageUrl: 'https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg', + position: "ST", + club: "Santos FC", + imageUrl: "https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg", pac: 97, sho: 98, pas: 83, @@ -506,8 +508,18 @@ export const FootballPlayerCard = () => {

Player Info

- - setPlayer({ ...player, name: e.target.value })} /> + + + setPlayer({ ...player, name: e.target.value }) + } + />
@@ -518,8 +530,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( @@ -531,46 +544,115 @@ export const FootballPlayerCard = () => {
- - setPlayer({ ...player, overallRating: Number(e.target.value) })} /> + + + setPlayer({ + ...player, + overallRating: Number(e.target.value), + }) + } + />
- - setPlayer({ ...player, club: e.target.value })} /> + + + setPlayer({ ...player, club: e.target.value }) + } + />
- - setPlayer({ ...player, imageUrl: e.target.value })} /> + + + setPlayer({ ...player, imageUrl: e.target.value }) + } + />

Player Stats

- - setPlayer({ ...player, pac: Number(e.target.value) })} /> + + + setPlayer({ ...player, pac: Number(e.target.value) }) + } + />
- - setPlayer({ ...player, sho: Number(e.target.value) })} /> + + + setPlayer({ ...player, sho: Number(e.target.value) }) + } + />
- - setPlayer({ ...player, pas: Number(e.target.value) })} /> + + + setPlayer({ ...player, pas: Number(e.target.value) }) + } + />
- + --fcc-editable-region-- --fcc-editable-region--
- +
- +
@@ -579,7 +661,9 @@ export const FootballPlayerCard = () => {

Live Preview

Updates as you type

-
+
@@ -589,3 +673,4 @@ export const FootballPlayerCard = () => { ); }; ``` + diff --git a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdf.md b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdf.md index afb83132b28..52b8d4b3e18 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdf.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8b296388ebbd517692bdf.md @@ -421,7 +421,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -495,7 +495,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -549,8 +549,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( @@ -667,11 +668,11 @@ export const FootballPlayerCard = () => { } /> - --fcc-editable-region--
+ --fcc-editable-region--
@@ -679,8 +680,8 @@ export const FootballPlayerCard = () => { PHY -
--fcc-editable-region-- + diff --git a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8d1be04ed6aad1c955729.md b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8d1be04ed6aad1c955729.md index 22f7ab1961c..06b0ac9a8a2 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8d1be04ed6aad1c955729.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69e8d1be04ed6aad1c955729.md @@ -391,8 +391,8 @@ const { useState } = React; --fcc-editable-region-- export const FootballPlayerCard = () => { - return ( -

Football Card Builder

- ) + return ( +

Football Card Builder

+ ); }; ``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69ea01c45b04f3e9de845036.md b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69ea01c45b04f3e9de845036.md index 75303d2d08b..21d92128a0f 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69ea01c45b04f3e9de845036.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69ea01c45b04f3e9de845036.md @@ -405,7 +405,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -483,7 +483,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -537,8 +537,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69ea02adff0fd528639ee23b.md b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69ea02adff0fd528639ee23b.md index 4db76b0743b..aa47f44a0d3 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69ea02adff0fd528639ee23b.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69ea02adff0fd528639ee23b.md @@ -409,7 +409,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -485,7 +485,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -543,8 +543,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69ea0349f8305a99324465ff.md b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69ea0349f8305a99324465ff.md index 9857b91990d..34763acdb8f 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69ea0349f8305a99324465ff.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69ea0349f8305a99324465ff.md @@ -407,7 +407,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -483,7 +483,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -502,11 +502,9 @@ const defaultPlayer: PlayerData = { function loadPlayer(): PlayerData { try { --fcc-editable-region-- - - --fcc-editable-region-- - } catch (error) { - } + --fcc-editable-region-- + } catch (error) {} } export const FootballPlayerCard = () => { @@ -547,8 +545,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69ea044f8c93a5e7ce64214c.md b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69ea044f8c93a5e7ce64214c.md index 7475518194e..667e9e53d5a 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69ea044f8c93a5e7ce64214c.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69ea044f8c93a5e7ce64214c.md @@ -395,7 +395,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -471,7 +471,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -492,12 +492,10 @@ function loadPlayer(): PlayerData { const saved = localStorage.getItem(STORAGE_KEY); if (saved) { --fcc-editable-region-- - + --fcc-editable-region-- - }; - } catch (error) { - - } + } + } catch (error) {} } export const FootballPlayerCard = () => { @@ -538,8 +536,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69ea0577f25e519489353f82.md b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69ea0577f25e519489353f82.md index 97bd3c66aec..7997e7bbb6a 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69ea0577f25e519489353f82.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69ea0577f25e519489353f82.md @@ -405,7 +405,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -418,7 +418,6 @@ interface PlayerData { const STORAGE_KEY = "football_player_card"; - export function getPlayerTier(rating: number): string { if (rating >= 92) return "elite"; if (rating >= 85) return "gold"; @@ -482,7 +481,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -505,14 +504,15 @@ function loadPlayer(): PlayerData { return { ...defaultPlayer, ...JSON.parse(saved) - } - }; ---fcc-editable-region-- + }; + } } catch (error) { +--fcc-editable-region-- } -} + --fcc-editable-region-- +} export const FootballPlayerCard = () => { const [player, setPlayer] = useState(defaultPlayer); @@ -552,8 +552,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69ea064edb0dcc46e1422cca.md b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69ea064edb0dcc46e1422cca.md index 63aeb28945b..3787c53b0c0 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69ea064edb0dcc46e1422cca.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69ea064edb0dcc46e1422cca.md @@ -401,7 +401,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -477,7 +477,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -500,8 +500,8 @@ function loadPlayer(): PlayerData { return { ...defaultPlayer, ...JSON.parse(saved) - } - }; + }; + } } catch (error) { console.log("Failed to load player data, using defaults:", error); } @@ -546,8 +546,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69ea0939f2f92cfc6c7a850d.md b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69ea0939f2f92cfc6c7a850d.md index 16ff16b8ba5..b68ce23a073 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69ea0939f2f92cfc6c7a850d.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69ea0939f2f92cfc6c7a850d.md @@ -46,12 +46,10 @@ assert.match(__helpers.removeJSComments(code), /useEffect\s*\(\(\)\s=>\s*\{\s*tr Football Player Card Builder - - - + @@ -415,7 +413,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -435,7 +433,7 @@ export function getPlayerTier(rating: number): string { return "bronze"; } -function PlayerCard({ player }: { player: PlayerData }) { +export const PlayerCard = ({ player }: { player: PlayerData }) => { return (
@@ -491,7 +489,7 @@ function PlayerCard({ player }: { player: PlayerData }) {
); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -514,8 +512,8 @@ function loadPlayer(): PlayerData { return { ...defaultPlayer, ...JSON.parse(saved) - } - }; + }; + } } catch (error) { console.log("Failed to load player data, using defaults:", error); } @@ -526,7 +524,7 @@ export const FootballPlayerCard = () => { const [player, setPlayer] = useState(defaultPlayer); --fcc-editable-region-- - + --fcc-editable-region-- return ( @@ -565,8 +563,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69ea0a89bd84cf2461b48ceb.md b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69ea0a89bd84cf2461b48ceb.md index 3840e82c854..70616770094 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69ea0a89bd84cf2461b48ceb.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69ea0a89bd84cf2461b48ceb.md @@ -403,7 +403,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -479,7 +479,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -502,8 +502,8 @@ function loadPlayer(): PlayerData { return { ...defaultPlayer, ...JSON.parse(saved) - } - }; + }; + } } catch (error) { console.log("Failed to load player data, using defaults:", error); } @@ -513,15 +513,15 @@ function loadPlayer(): PlayerData { export const FootballPlayerCard = () => { const [player, setPlayer] = useState(defaultPlayer); ---fcc-editable-region-- useEffect(() => { try { +--fcc-editable-region-- } catch (error) { +--fcc-editable-region-- } }, [player]); ---fcc-editable-region-- return (
@@ -559,8 +559,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69ea0bb3e7000f44c207bb0e.md b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69ea0bb3e7000f44c207bb0e.md index d709790dbda..171a4a135f6 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69ea0bb3e7000f44c207bb0e.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69ea0bb3e7000f44c207bb0e.md @@ -401,7 +401,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -477,7 +477,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -500,8 +500,8 @@ function loadPlayer(): PlayerData { return { ...defaultPlayer, ...JSON.parse(saved) - } - }; + }; + } } catch (error) { console.log("Failed to load player data, using defaults:", error); } @@ -557,8 +557,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( @@ -1098,7 +1099,7 @@ type Position = typeof POSITIONS[number]; interface PlayerData { name: string; overallRating: number; - position: string; + position: Position; club: string; imageUrl: string; pac: number; @@ -1174,7 +1175,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -1197,8 +1198,8 @@ function loadPlayer(): PlayerData { return { ...defaultPlayer, ...JSON.parse(saved) - } - }; + }; + } } catch (error) { console.log("Failed to load player data, using defaults:", error); } @@ -1252,8 +1253,9 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => - setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > {POSITIONS.map( (pos) => ( diff --git a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69ea1bb4a66dd6debb999c7f.md b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69ea1bb4a66dd6debb999c7f.md index a92c0a77668..ae332333c76 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69ea1bb4a66dd6debb999c7f.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69ea1bb4a66dd6debb999c7f.md @@ -473,7 +473,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69ea1dd8e74976afa407bf22.md b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69ea1dd8e74976afa407bf22.md index 506e9bca6c8..32cb445ea74 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69ea1dd8e74976afa407bf22.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69ea1dd8e74976afa407bf22.md @@ -479,7 +479,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69ea1ed1543a4db863564aac.md b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69ea1ed1543a4db863564aac.md index aefbfc65b48..32f316098b9 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69ea1ed1543a4db863564aac.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69ea1ed1543a4db863564aac.md @@ -472,7 +472,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69ea21dcd8c4cb48c23a2c67.md b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69ea21dcd8c4cb48c23a2c67.md index c58153d2d57..574c5bcadfb 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69ea21dcd8c4cb48c23a2c67.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69ea21dcd8c4cb48c23a2c67.md @@ -14,7 +14,7 @@ dashedName: step-53 Ваш позиційний `select` має мати обробник `onChange`, який викликає `setPlayer` з розгортанням `player` та оновлює `position`. ```js -assert.match(__helpers.removeJSComments(code), /onChange.*setPlayer.*\.\.\.\s*player[\s\S]*position/); +assert.match(__helpers.removeJSComments(code), /onChange=\{[\s\S]*?position:\s*e\.target\.value\s+as\s+Position/); ``` # --seed-- @@ -469,7 +469,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69ea2378f3c6a60a57cc29c3.md b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69ea2378f3c6a60a57cc29c3.md index 97d4b42cd9a..049af2a3623 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69ea2378f3c6a60a57cc29c3.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69ea2378f3c6a60a57cc29c3.md @@ -483,7 +483,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -537,10 +537,12 @@ export const FootballPlayerCard = () => { id="position" className="input" value={player.position} - onChange={(e) => setPlayer({ ...player, position: e.target.value as Position })} + onChange={(e) => + setPlayer({ ...player, position: e.target.value as Position }) + } > --fcc-editable-region-- - + --fcc-editable-region-- diff --git a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69eb216380522cfc11aa408c.md b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69eb216380522cfc11aa408c.md index 60c2d6efc4d..116faa6a02b 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69eb216380522cfc11aa408c.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69eb216380522cfc11aa408c.md @@ -443,7 +443,7 @@ export const PlayerCard = () => { ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69eb23665c115447405343ac.md b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69eb23665c115447405343ac.md index 0b6b2508553..b550e0fd0d5 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69eb23665c115447405343ac.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69eb23665c115447405343ac.md @@ -461,7 +461,7 @@ export const PlayerCard = () => { ); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69eb2847cc8f5638e226e8ce.md b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69eb2847cc8f5638e226e8ce.md index e97ab5dcfdf..5d8fc9c7691 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69eb2847cc8f5638e226e8ce.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69eb2847cc8f5638e226e8ce.md @@ -483,10 +483,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -543,7 +543,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; export const FootballPlayerCard = () => { --fcc-editable-region-- diff --git a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69ed3985819de69de27c4390.md b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69ed3985819de69de27c4390.md index 448bb5017dd..683f1012c26 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69ed3985819de69de27c4390.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69ed3985819de69de27c4390.md @@ -391,10 +391,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -453,14 +453,14 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { - name: 'PELE', + name: "PELE", overallRating: 98, - position: 'ST', - club: 'Santos FC', - imageUrl: 'https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg', + position: "ST", + club: "Santos FC", + imageUrl: "https://cdn.freecodecamp.org/curriculum/typescript/tsx-workshop/pele.jpg", pac: 97, sho: 98, pas: 83, @@ -471,7 +471,7 @@ const defaultPlayer: PlayerData = { export const FootballPlayerCard = () => { --fcc-editable-region-- - return ; + return ; --fcc-editable-region-- }; ``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69f1a6f57dd2d4685822074a.md b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69f1a6f57dd2d4685822074a.md index 886e9dc3bd3..bd23a8326ff 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69f1a6f57dd2d4685822074a.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69f1a6f57dd2d4685822074a.md @@ -401,8 +401,8 @@ export const PlayerCard = () => {
- --fcc-editable-region--
+ --fcc-editable-region--
@@ -410,14 +410,14 @@ export const PlayerCard = () => {
-
--fcc-editable-region-- +
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69f1a9e19340f19b1fd051c6.md b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69f1a9e19340f19b1fd051c6.md index edef87b0b7f..2e21a50c6c4 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69f1a9e19340f19b1fd051c6.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69f1a9e19340f19b1fd051c6.md @@ -416,9 +416,9 @@ export const PlayerCard = () => {
- --fcc-editable-region--
+ --fcc-editable-region--
@@ -426,14 +426,14 @@ export const PlayerCard = () => {
+ --fcc-editable-region--
- --fcc-editable-region--
); -} +}; export const FootballPlayerCard = () => { return ; diff --git a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69f1af24b0860d13f0b295e5.md b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69f1af24b0860d13f0b295e5.md index 167ef8fa68f..7e17e933364 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69f1af24b0860d13f0b295e5.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69f1af24b0860d13f0b295e5.md @@ -407,10 +407,10 @@ interface PlayerData { } export function getPlayerTier(rating: number): string { - if (rating >= 92) return 'elite'; - if (rating >= 85) return 'gold'; - if (rating >= 75) return 'silver'; - return 'bronze'; + if (rating >= 92) return "elite"; + if (rating >= 85) return "gold"; + if (rating >= 75) return "silver"; + return "bronze"; } export const PlayerCard = ({ player }: { player: PlayerData }) => { @@ -451,9 +451,9 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
- --fcc-editable-region--
+ --fcc-editable-region-- 99 DRI
@@ -463,17 +463,17 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => {
75 + --fcc-editable-region-- PHY
- --fcc-editable-region-- ); -} +}; export const FootballPlayerCard = () => { - return ; + return ; }; ``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69f1b1fb36c6c0c80907e8e1.md b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69f1b1fb36c6c0c80907e8e1.md index ef29eae1f31..9e873743638 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69f1b1fb36c6c0c80907e8e1.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69f1b1fb36c6c0c80907e8e1.md @@ -483,7 +483,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", @@ -511,17 +511,15 @@ export const FootballPlayerCard = () => {
- --fcc-editable-region-- -
- -
+
+ --fcc-editable-region--
+ --fcc-editable-region--
- --fcc-editable-region-- ); }; diff --git a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69f1b591221851200c734eb4.md b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69f1b591221851200c734eb4.md index 84956d0a304..9c7ee1dac6a 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69f1b591221851200c734eb4.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-build-a-football-player-card-builder/69f1b591221851200c734eb4.md @@ -472,7 +472,7 @@ export const PlayerCard = ({ player }: { player: PlayerData }) => { ); -} +}; const defaultPlayer: PlayerData = { name: "PELE", diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f356ed6199b0cdef1d2be8f.md b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f356ed6199b0cdef1d2be8f.md index c98100c6cf1..13f0f4717ad 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f356ed6199b0cdef1d2be8f.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f356ed6199b0cdef1d2be8f.md @@ -13,11 +13,11 @@ dashedName: step-22 ```css .class-name { - styles + property: value; } ``` -Змініть існуючий `#menu` селектор на селектор класу, замінивши `#menu` на клас із назвою `.menu`. +Змініть існуючий селектор `#menu` на селектор класу, замінивши `#menu` на селектор класу `.menu`. # --hints-- diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f3cade99dda4e6071a85dfd.md b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f3cade99dda4e6071a85dfd.md index 67a55bad66c..25a7086befd 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f3cade99dda4e6071a85dfd.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f3cade99dda4e6071a85dfd.md @@ -109,7 +109,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f3ef6e01f288a026d709587.md b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f3ef6e01f288a026d709587.md index bb8fab374f2..885bf9b7513 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f3ef6e01f288a026d709587.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f3ef6e01f288a026d709587.md @@ -171,7 +171,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f3ef6e03d719d5ac4738993.md b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f3ef6e03d719d5ac4738993.md index 333d08211c0..6be7b6876ef 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f3ef6e03d719d5ac4738993.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f3ef6e03d719d5ac4738993.md @@ -115,7 +115,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f3ef6e04559b939080db057.md b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f3ef6e04559b939080db057.md index 1d5c52997b6..2658c006b57 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f3ef6e04559b939080db057.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f3ef6e04559b939080db057.md @@ -139,7 +139,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f3ef6e050279c7a4a7101d3.md b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f3ef6e050279c7a4a7101d3.md index a825f237d94..6cf6f486a22 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f3ef6e050279c7a4a7101d3.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f3ef6e050279c7a4a7101d3.md @@ -137,7 +137,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f3ef6e05473f91f948724ab.md b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f3ef6e05473f91f948724ab.md index 9ce1879e8e3..56f6576a683 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f3ef6e05473f91f948724ab.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f3ef6e05473f91f948724ab.md @@ -116,6 +116,6 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f3ef6e056bdde6ae6892ba2.md b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f3ef6e056bdde6ae6892ba2.md index a94e705e785..43e89671139 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f3ef6e056bdde6ae6892ba2.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f3ef6e056bdde6ae6892ba2.md @@ -9,7 +9,7 @@ dashedName: step-54 Трохи нудно, коли весь текст має однаковий `font-family`. Ви все одно можете зробити більшість тексту `sans-serif` і змінити лише `h1` та `h2` елементи, використовуючи інший селектор. -Стилізуйте одночасно `h1` і `h2` елементи за допомогою одного селектора, щоб текст цих елементів використовував шрифт `Impact`. +Оформіть обидва елементи `h1` і `h2`, використовуючи один список селекторів, щоб текст цих елементів використовував шрифт `Impact`. # --hints-- @@ -135,7 +135,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f3ef6e06d34faac0447fc44.md b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f3ef6e06d34faac0447fc44.md index 79b80c972cc..3a0d17a5222 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f3ef6e06d34faac0447fc44.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f3ef6e06d34faac0447fc44.md @@ -127,7 +127,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f3ef6e07276f782bb46b93d.md b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f3ef6e07276f782bb46b93d.md index 562435df99e..b3a186ed838 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f3ef6e07276f782bb46b93d.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f3ef6e07276f782bb46b93d.md @@ -142,7 +142,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f3ef6e0819d4f23ca7285e6.md b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f3ef6e0819d4f23ca7285e6.md index 304e4466576..e403de3e189 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f3ef6e0819d4f23ca7285e6.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f3ef6e0819d4f23ca7285e6.md @@ -104,7 +104,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f3ef6e087d56ed3ffdc36be.md b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f3ef6e087d56ed3ffdc36be.md index 6cda9359e0d..6c0e22acc53 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f3ef6e087d56ed3ffdc36be.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f3ef6e087d56ed3ffdc36be.md @@ -129,6 +129,6 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f3ef6e0a81099d9a697b550.md b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f3ef6e0a81099d9a697b550.md index 06d6363309f..2b2ae29708a 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f3ef6e0a81099d9a697b550.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f3ef6e0a81099d9a697b550.md @@ -167,7 +167,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f3ef6e0b431cc215bb16f55.md b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f3ef6e0b431cc215bb16f55.md index 2af2cfbaea8..acc15896759 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f3ef6e0b431cc215bb16f55.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f3ef6e0b431cc215bb16f55.md @@ -141,7 +141,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f3ef6e0e0c3feaebcf647ad.md b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f3ef6e0e0c3feaebcf647ad.md index 6af13d027df..dfbf09416f2 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f3ef6e0e0c3feaebcf647ad.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f3ef6e0e0c3feaebcf647ad.md @@ -103,7 +103,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f3ef6e0e9629bad967cd71e.md b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f3ef6e0e9629bad967cd71e.md index 9b8380de072..68a6479472a 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f3ef6e0e9629bad967cd71e.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f3ef6e0e9629bad967cd71e.md @@ -7,7 +7,7 @@ dashedName: step-55 # --description-- -Ви можете додати запасний варіант для властивості font-family, додавши іншу назву шрифту, розділену комою. Запасні варіанти використовуються у випадках, коли ініціаль не знайдено або недоступна. +Ви можете додати запасний варіант для `font-family`, додавши іншу назву шрифту, розділену комою. Запасний варіант використовується, коли перший шрифт недоступний. Додайте запасний варіант шрифту `serif` після шрифту `Impact`. @@ -113,7 +113,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f3ef6e0eaa7da26e3d34d78.md b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f3ef6e0eaa7da26e3d34d78.md index 478c563c3e2..de6fe476e77 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f3ef6e0eaa7da26e3d34d78.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f3ef6e0eaa7da26e3d34d78.md @@ -128,7 +128,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f3ef6e0f8c230bdd2349716.md b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f3ef6e0f8c230bdd2349716.md index cd0a547f1f3..156eae06feb 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f3ef6e0f8c230bdd2349716.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f3ef6e0f8c230bdd2349716.md @@ -140,6 +140,6 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f3f26fa39591db45e5cd7a0.md b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f3f26fa39591db45e5cd7a0.md index c67691a4c00..a43b48c7fa8 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f3f26fa39591db45e5cd7a0.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f3f26fa39591db45e5cd7a0.md @@ -7,7 +7,7 @@ dashedName: step-64 # --description-- -Властивості за замовчуванням елемента `hr` зроблять його тонкою світло-сірою лінією. Ви можете змінити висоту лінії, вказавши значення для властивості `height`. +Властивості `hr` елемента за замовчуванням зроблять його тонкою світло-сірою лінією. Ви можете змінити висоту лінії, вказавши значення для властивості `height`. Змініть висоту елемента `hr` на `3px`. @@ -150,7 +150,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f459225127805351a6ad057.md b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f459225127805351a6ad057.md index c85c76f34b4..a7cdadb218a 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f459225127805351a6ad057.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f459225127805351a6ad057.md @@ -144,7 +144,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f459a7ceb8b5c446656d88b.md b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f459a7ceb8b5c446656d88b.md index 0fab5b1cd55..db3ce000718 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f459a7ceb8b5c446656d88b.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f459a7ceb8b5c446656d88b.md @@ -147,6 +147,6 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f459cf202c2a3472fae6a9f.md b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f459cf202c2a3472fae6a9f.md index 6bf4362591a..53fd4895835 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f459cf202c2a3472fae6a9f.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f459cf202c2a3472fae6a9f.md @@ -7,7 +7,7 @@ dashedName: step-67 # --description-- -Помітили, як товщина лінії здається більшою? Значення властивості з назвою `border-width` за замовчуванням дорівнює `1px` для всіх кордонів елементів `hr`. Змінивши кордон на той самий колір, що й фон, загальна висота лінії стає `5px` (`3px` плюс товщина верхнього та нижнього кордону `1px`). +Помічаєте, як товщина лінії здається більшою? Значення властивості з назвою `border-width` за замовчуванням становить `1px` для всіх країв елементів `hr`. Загальна висота лінії завжди була `5px` (`3px` плюс верхній і нижній кордон по `1px`); фарбування кордону зробило ці краї видимими. Змініть властивість `height` у `hr` на `2px`, щоб загальна висота стала `4px`. @@ -147,7 +147,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f459fd48bdc98491ca6d1a3.md b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f459fd48bdc98491ca6d1a3.md index 203b4e4e2ab..9c5c008c2d5 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f459fd48bdc98491ca6d1a3.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f459fd48bdc98491ca6d1a3.md @@ -145,7 +145,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f45a05977e2fa49d9119437.md b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f45a05977e2fa49d9119437.md index 125b0e2c158..0815156200a 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f45a05977e2fa49d9119437.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f45a05977e2fa49d9119437.md @@ -146,6 +146,6 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f45a276c093334f0f6e9df4.md b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f45a276c093334f0f6e9df4.md index 0af71729efa..b2454d9d3ab 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f45a276c093334f0f6e9df4.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f45a276c093334f0f6e9df4.md @@ -185,7 +185,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f45a5a7c49a8251f0bdb527.md b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f45a5a7c49a8251f0bdb527.md index b9131efa8a3..94615032fdd 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f45a5a7c49a8251f0bdb527.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f45a5a7c49a8251f0bdb527.md @@ -157,7 +157,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f45a66d4a2b0453301e5a26.md b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f45a66d4a2b0453301e5a26.md index 2547becfb33..fa1149a062a 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f45a66d4a2b0453301e5a26.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f45a66d4a2b0453301e5a26.md @@ -166,7 +166,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f45b0731d39e15d54df4dfc.md b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f45b0731d39e15d54df4dfc.md index d056a25fec5..e3a3dc7d11d 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f45b0731d39e15d54df4dfc.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f45b0731d39e15d54df4dfc.md @@ -161,7 +161,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f45b25e7ec2405f166b9de1.md b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f45b25e7ec2405f166b9de1.md index e07debd7e43..74cb2dee5cf 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f45b25e7ec2405f166b9de1.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f45b25e7ec2405f166b9de1.md @@ -9,7 +9,7 @@ dashedName: step-78 Ви змінюєте властивості посилання, коли воно було відвідане, використовуючи псевдоселектор, який виглядає як `a:visited { propertyName: propertyValue; }`. -Змініть колір посилання в нижньому колонтитулі `Visit our website` на `grey`, коли користувач відвідав це посилання. +Змініть колір посилання `Visit our website` у нижньому колонтитулі на `gray`, коли користувач відвідав це посилання. # --hints-- @@ -20,14 +20,14 @@ const aVisitedStyle = new __helpers.CSSHelp(document).getStyle('a:visited'); assert.exists(aVisitedStyle); ``` -Ви повинні встановити властивість `color` у значення `grey`. +Ви повинні встановити властивість `color` у значення `gray`. ```js const hasColor = new __helpers.CSSHelp(document).getCSSRules().some(x => (x.style.color === 'grey' || x.style.color === 'gray')); assert.isTrue(hasColor); ``` -Ваш `a:visited` має мати селектор `color` зі значенням `grey`. +Ваш `a:visited` має мати `color` зі значенням `gray`. ```js const aVisitedColor = new __helpers.CSSHelp(document).getStyle('a:visited')?.getPropertyValue('color'); @@ -161,7 +161,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f45b3c93c027860d9298dbd.md b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f45b3c93c027860d9298dbd.md index a51f50012c0..af6d0b14214 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f45b3c93c027860d9298dbd.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f45b3c93c027860d9298dbd.md @@ -161,7 +161,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ @@ -179,7 +179,7 @@ a { } a:visited { - color: grey; + color: gray; } --fcc-editable-region-- diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f45b45d099f3e621fbbb256.md b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f45b45d099f3e621fbbb256.md index de37f5a734d..db0a948f7d0 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f45b45d099f3e621fbbb256.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f45b45d099f3e621fbbb256.md @@ -161,7 +161,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ @@ -179,7 +179,7 @@ a { } a:visited { - color: grey; + color: gray; } a:hover { diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f45b4c81cea7763550e40df.md b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f45b4c81cea7763550e40df.md index f4d6674fffd..802ca50e717 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f45b4c81cea7763550e40df.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f45b4c81cea7763550e40df.md @@ -152,7 +152,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ @@ -171,7 +171,7 @@ a { --fcc-editable-region-- a:visited { - color: grey; + color: gray; } a:hover { diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f45b715301bbf667badc04a.md b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f45b715301bbf667badc04a.md index 76880b4829c..cf06f9d0c43 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f45b715301bbf667badc04a.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f45b715301bbf667badc04a.md @@ -7,7 +7,7 @@ dashedName: step-82 # --description-- -Текст меню `CAMPER CAFE` має інший пробіл зверху, ніж поле адреси внизу меню. Це через те, що браузер встановлює за замовчуванням верхнє поле для елемента `h1`. +Пробіл над текстом меню `CAMPER CAFE` не збігається з пробілом під адресою внизу меню. Це через те, що браузер має деяке поле зверху за замовчуванням для елемента `h1`. Змініть верхнє поле елемента `h1` на `0`, щоб повністю прибрати верхнє поле. @@ -157,7 +157,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f46e270702a8456a664f0df.md b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f46e270702a8456a664f0df.md index b8fb668c59c..b6f81ee4bac 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f46e270702a8456a664f0df.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f46e270702a8456a664f0df.md @@ -156,7 +156,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f46e36e745ead58487aabf2.md b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f46e36e745ead58487aabf2.md index 6e264b1fbbd..79f939d9bb3 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f46e36e745ead58487aabf2.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f46e36e745ead58487aabf2.md @@ -163,7 +163,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f46e7a4750dd05b5a673920.md b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f46e7a4750dd05b5a673920.md index 849650046fd..ea8d9fae362 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f46e7a4750dd05b5a673920.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f46e7a4750dd05b5a673920.md @@ -160,7 +160,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f46e8284aae155c83015dee.md b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f46e8284aae155c83015dee.md index c2139641867..b069609108d 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f46e8284aae155c83015dee.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f46e8284aae155c83015dee.md @@ -9,7 +9,7 @@ dashedName: step-86 Меню виглядає добре, але окрім фону з кавовими зернами, це переважно просто текст. -Під заголовком `Coffee` додайте зображення, використовуючи URL `https://cdn.freecodecamp.org/curriculum/css-cafe/coffee.jpg`. Дайте зображенню атрибут `alt` зі значенням `coffee icon`. +Під заголовком `Coffee` додайте зображення, використовуючи URL `https://cdn.freecodecamp.org/curriculum/css-cafe/coffee.jpg`. Додайте зображенню атрибут `alt` зі значенням `coffee icon`. # --hints-- @@ -105,6 +105,7 @@ assert.match(imageAltValue, /coffee icon/i);

123 Free Code Camp Drive

+ ``` @@ -171,7 +172,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f46ede1ff8fec5ba656b44c.md b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f46ede1ff8fec5ba656b44c.md index 65eed0253e4..0a505a6b1de 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f46ede1ff8fec5ba656b44c.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f46ede1ff8fec5ba656b44c.md @@ -144,7 +144,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } --fcc-editable-region-- diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f46fc57528aa1c4b5ea7c2e.md b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f46fc57528aa1c4b5ea7c2e.md index 2901a2c2976..016fb906aef 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f46fc57528aa1c4b5ea7c2e.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f46fc57528aa1c4b5ea7c2e.md @@ -161,7 +161,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f4701b942c824109626c3d8.md b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f4701b942c824109626c3d8.md index 5839d8fc85a..3bfcefd6f27 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f4701b942c824109626c3d8.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f4701b942c824109626c3d8.md @@ -153,6 +153,6 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f475bb508746c16c9431d42.md b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f475bb508746c16c9431d42.md index 25cd1ceb6db..9e1555fd8cd 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f475bb508746c16c9431d42.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f475bb508746c16c9431d42.md @@ -7,9 +7,9 @@ dashedName: step-87 # --description-- -Зображення, яке ви додали, не вирівняне по горизонталі по центру, як `Coffee` заголовок над ним. `img` елементи "подібні" до рядкових елементів. +Зображення, яке ви додали, не центроване по горизонталі, як заголовок `Coffee` над ним. Елементи `img` є рядковими елементами, тому вони розташовані в потоці тексту. -Щоб зробити зображення подібним до блочних елементів, таких як заголовки, створіть селектор типу `img`. Встановіть властивість `display` у значення `block`, а властивості `margin-left` і `margin-right` використайте для горизонтального центрування. +Щоб зробити зображення блоковим елементом, як заголовок, створіть селектор типу `img`. Встановіть властивість `display` у значення `block` і використайте властивості `margin-left` та `margin-right`, щоб центроване його по горизонталі. # --hints-- @@ -120,6 +120,7 @@ assert.equal(imgMarginRight, 'auto');

123 Free Code Camp Drive

+ ``` @@ -190,7 +191,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f475e1c7f71a61d913836c6.md b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f475e1c7f71a61d913836c6.md index 080be73ca9c..4e47a658350 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f475e1c7f71a61d913836c6.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f475e1c7f71a61d913836c6.md @@ -97,6 +97,7 @@ assert.match(lastImage?.alt, /pie icon/i);

123 Free Code Camp Drive

+ ``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f47fe7e31980053a8d4403b.md b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f47fe7e31980053a8d4403b.md index 7200a84ba70..f435abda306 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f47fe7e31980053a8d4403b.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f47fe7e31980053a8d4403b.md @@ -7,7 +7,7 @@ dashedName: step-89 # --description-- -Було б добре, якби вертикальний пробіл між елементами `h2` та їхніми відповідними іконками був меншим. Елементи `h2` мають за замовчуванням верхнє та нижнє поле, тому ви можете змінити нижнє поле елементів `h2` на `0` або інше число. +Було б добре, якби вертикальний простір між `h2` елементами та їхніми відповідними іконками був меншим. `h2` елементи мають поля зверху і знизу за замовчуванням, тож ви можете змінити нижнє поле `h2` елементів на `0` або інше значення. Існує простіший спосіб — просто додайте від’ємне верхнє поле елементам `img`, щоб підняти їх з поточних позицій. Від’ємні значення створюються за допомогою `-` перед значенням. Щоб завершити це практичне заняття, додайте від’ємне верхнє поле `25px` у селекторі типу `img`. diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f716ad029ee4053c7027a7a.md b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f716ad029ee4053c7027a7a.md index 8c333013730..3482614e5d5 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f716ad029ee4053c7027a7a.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f716ad029ee4053c7027a7a.md @@ -119,7 +119,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f716bee5838c354c728a7c5.md b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f716bee5838c354c728a7c5.md index 045822251b0..f091f0f93e7 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f716bee5838c354c728a7c5.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f716bee5838c354c728a7c5.md @@ -158,6 +158,6 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f7b87422a560036fd03ccff.md b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f7b87422a560036fd03ccff.md index 45bbebec187..81fd6960aa0 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f7b87422a560036fd03ccff.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f7b87422a560036fd03ccff.md @@ -118,7 +118,7 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f7b88d37b1f98386f04edc0.md b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f7b88d37b1f98386f04edc0.md index b4f284d2592..0243daaca22 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f7b88d37b1f98386f04edc0.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/5f7b88d37b1f98386f04edc0.md @@ -97,6 +97,6 @@ h1, h2, p { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/6780e8ef4153930b965cd7b7.md b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/6780e8ef4153930b965cd7b7.md index c8982fa4b74..de5a8e5565c 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/6780e8ef4153930b965cd7b7.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/6780e8ef4153930b965cd7b7.md @@ -125,6 +125,6 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } ``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/6780f0d898362873ac425dc8.md b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/6780f0d898362873ac425dc8.md index da9c200e1b7..5e8944ed740 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/6780f0d898362873ac425dc8.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cafe-menu/6780f0d898362873ac425dc8.md @@ -156,7 +156,7 @@ h1, h2 { .price { text-align: right; - width: 25% + width: 25%; } /* FOOTER */ diff --git a/curriculum/challenges/ukrainian/blocks/workshop-calculator/66cc095dfe1682753d2ab030.md b/curriculum/challenges/ukrainian/blocks/workshop-calculator/66cc095dfe1682753d2ab030.md index 26890addbcd..dfdb12a6c03 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-calculator/66cc095dfe1682753d2ab030.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-calculator/66cc095dfe1682753d2ab030.md @@ -7,7 +7,7 @@ dashedName: step-2 # --description-- -Однією з концепцій, яку ви вивчали в попередніх уроках, було те, як повертати значення з функції. +Одне з понять, яке ви вивчили в попередніх уроках, — це як повертати значення з функції. Ось нагадування про те, як повернути значення з функції: @@ -30,7 +30,10 @@ assert.strictEqual(addTwoAndSeven(), 9); Ваша `addTwoAndSeven` функція має повертати суму, використовуючи оператор `+`. ```js -assert.match(code, /return\s*(2\s*\+\s*7|7\s*\+\s*2)\s*;?/); +const explorer = await __helpers.Explorer(code); +const { addTwoAndSeven } = explorer.allFunctions; +const validExpressions = ["2 + 7", "7 + 2", "(2 + 7)", "(7 + 2)"]; +assert.isTrue(validExpressions.some(expr => addTwoAndSeven?.hasReturn(expr))); ``` # --seed-- diff --git a/curriculum/challenges/ukrainian/blocks/workshop-calculator/66cc0a9e06e00b75d6782be9.md b/curriculum/challenges/ukrainian/blocks/workshop-calculator/66cc0a9e06e00b75d6782be9.md index c0c37f0f55b..b24aa109da1 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-calculator/66cc0a9e06e00b75d6782be9.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-calculator/66cc0a9e06e00b75d6782be9.md @@ -26,16 +26,12 @@ myFunction(); # --hints-- -У вашому коді має бути `console.log`. - -```js -assert.match(code, /console\.log(.*)/); -``` - Ви повинні викликати функцію `addTwoAndSeven` всередині `console.log`. ```js -assert.match(code, /console\.log\(\s*addTwoAndSeven\(\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(addTwoAndSeven())"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/ukrainian/blocks/workshop-calculator/66cc0ba5881acb7692cfc4de.md b/curriculum/challenges/ukrainian/blocks/workshop-calculator/66cc0ba5881acb7692cfc4de.md index 908b3f89e80..70fc0bdaa1f 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-calculator/66cc0ba5881acb7692cfc4de.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-calculator/66cc0ba5881acb7692cfc4de.md @@ -7,7 +7,7 @@ dashedName: step-4 # --description-- -Тепер настав час додати ще одну функцію. +Тепер час додати ще одну функцію. Оголосіть функцію з назвою `addThreeAndFour`, яка повертає суму `3` і `4`. @@ -24,22 +24,24 @@ assert.isFunction(addThreeAndFour); Ваша функція `addThreeAndFour` має повертати суму `3` і `4`. ```js -assert.equal(addThreeAndFour(), 7); +assert.strictEqual(addThreeAndFour(), 7); ``` Ваша функція `addThreeAndFour` має повертати суму, використовуючи оператор `+`. ```js -const declarationStyle = /return\s*\(?\s*(3\s*\+\s*4|4\s*\+\s*3)\s*\)?\s*;?/; -const arrowStyle = /=>\s*\(?\s*(3\s*\+\s*4|4\s*\+\s*3)\s*\)?\s*;?/; -const combinedRegex = new RegExp(`(?:${declarationStyle.source})|(?:${arrowStyle.source})`); -assert.match(code, combinedRegex); +const explorer = await __helpers.Explorer(code); +const { addThreeAndFour } = explorer.allFunctions; +const validExpressions = ["3 + 4", "4 + 3", "(3 + 4)", "(4 + 3)"]; +assert.isTrue(validExpressions.some(expr => addThreeAndFour?.hasReturn(expr))); ``` Ви повинні викликати функцію `addThreeAndFour` всередині `console.log`. ```js -assert.match(code, /console\.log\(\s*addThreeAndFour\(\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(addThreeAndFour())"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/ukrainian/blocks/workshop-calculator/66cc0de2920bec775f610424.md b/curriculum/challenges/ukrainian/blocks/workshop-calculator/66cc0de2920bec775f610424.md index 764088e24a6..b414b033e2d 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-calculator/66cc0de2920bec775f610424.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-calculator/66cc0de2920bec775f610424.md @@ -22,25 +22,33 @@ dashedName: step-5 Вам не слід мати функцію з назвою `addTwoAndSeven`. ```js -assert.notMatch(code, /function\s+addTwoAndSeven\s*\(\s*\)\s*{/); +const explorer = await __helpers.Explorer(code); +const { addTwoAndSeven } = explorer.allFunctions; +assert.notExists(addTwoAndSeven); ``` Вам не слід мати виклик функції `addTwoAndSeven`. ```js -assert.notMatch(code, /console\.log\(\s*addTwoAndSeven\(\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const unexpectedStatement = "console.log(addTwoAndSeven())"; +assert.notInclude(strippedCode, unexpectedStatement); ``` Вам не слід мати функцію з назвою `addThreeAndFour`. ```js -assert.notMatch(code, /function\s+addThreeAndFour\s*\(\s*\)\s*{/); +const explorer = await __helpers.Explorer(code); +const { addThreeAndFour } = explorer.allFunctions; +assert.notExists(addThreeAndFour); ``` Вам не слід мати виклик функції `addThreeAndFour`. ```js -assert.notMatch(code, /console\.log\(\s*addThreeAndFour\(\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const unexpectedStatement = "console.log(addThreeAndFour())"; +assert.notInclude(strippedCode, unexpectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/ukrainian/blocks/workshop-calculator/66cc0f1ae40802781b2ea972.md b/curriculum/challenges/ukrainian/blocks/workshop-calculator/66cc0f1ae40802781b2ea972.md index f36f65e1fae..4c0a8fd81b9 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-calculator/66cc0f1ae40802781b2ea972.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-calculator/66cc0f1ae40802781b2ea972.md @@ -33,8 +33,11 @@ assert.isFunction(calculateSum); Ваша функція `calculateSum` має приймати два параметри, `num1` і `num2`. ```js -const regex = __helpers.functionRegex('calculateSum', ['num1', 'num2']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { calculateSum } = explorer.allFunctions; +assert.lengthOf(calculateSum?.parameters, 2); +assert.equal(calculateSum?.parameters[0].toString(), "num1"); +assert.equal(calculateSum?.parameters[1].toString(), "num2"); ``` # --seed-- diff --git a/curriculum/challenges/ukrainian/blocks/workshop-calculator/66cc12fa504b0479dac479a0.md b/curriculum/challenges/ukrainian/blocks/workshop-calculator/66cc12fa504b0479dac479a0.md index 468dfb90cff..dc5f08c2244 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-calculator/66cc12fa504b0479dac479a0.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-calculator/66cc12fa504b0479dac479a0.md @@ -29,7 +29,9 @@ greetUser("Jane"); // "Hello Jane!" У вас має бути `console.log`, який викликає функцію `calculateSum` з аргументами `2` та `5`. ```js -assert.match(code, /console\.log\(calculateSum\(\s*2\s*,\s*5\)\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const validStatements = ["console.log(calculateSum(2,5))", "console.log(calculateSum(5,2))"]; +assert.isTrue(validStatements.some(stmt => strippedCode.includes(stmt))); ``` # --seed-- diff --git a/curriculum/challenges/ukrainian/blocks/workshop-calculator/66cc14ca14e65e7a9ebecb80.md b/curriculum/challenges/ukrainian/blocks/workshop-calculator/66cc14ca14e65e7a9ebecb80.md index 5ebc7559d42..0e8d5fc511f 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-calculator/66cc14ca14e65e7a9ebecb80.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-calculator/66cc14ca14e65e7a9ebecb80.md @@ -15,7 +15,7 @@ dashedName: step-10 # --hints-- -Ви повинні мати функцію з назвою `calculateDifference`. +Ви повинні оголосити функцію з назвою `calculateDifference`. ```js assert.isFunction(calculateDifference); @@ -24,8 +24,11 @@ assert.isFunction(calculateDifference); Ваша функція `calculateDifference` має мати два параметри з іменами `num1` і `num2`. ```js -const regex = __helpers.functionRegex('calculateDifference', ['num1', 'num2']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { calculateDifference } = explorer.allFunctions; +assert.lengthOf(calculateDifference?.parameters, 2); +assert.equal(calculateDifference?.parameters[0].toString(), "num1"); +assert.equal(calculateDifference?.parameters[1].toString(), "num2"); ``` Ваша функція `calculateDifference` має повертати різницю між двома параметрами. diff --git a/curriculum/challenges/ukrainian/blocks/workshop-calculator/66cc16abc30b367ba1d1f9ef.md b/curriculum/challenges/ukrainian/blocks/workshop-calculator/66cc16abc30b367ba1d1f9ef.md index cfb4a538e09..11695225536 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-calculator/66cc16abc30b367ba1d1f9ef.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-calculator/66cc16abc30b367ba1d1f9ef.md @@ -20,19 +20,25 @@ dashedName: step-11 У вас має бути `console.log`, який викликає функцію `calculateDifference` з аргументами `22` та `5`. ```js -assert.match(code, /console\.log\s*\(\s*calculateDifference\s*\(\s*22\s*,\s*5\s*\)\s*\)\s*;?/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateDifference(22,5))"; +assert.include(strippedCode, expectedStatement); ``` У вас має бути `console.log`, який викликає функцію `calculateDifference` з аргументами `12` та `1`. ```js -assert.match(code, /console\.log\s*\(\s*calculateDifference\s*\(\s*12\s*,\s*1\s*\)\s*\)\s*;?/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateDifference(12,1))"; +assert.include(strippedCode, expectedStatement); ``` У вас має бути `console.log`, який викликає функцію `calculateDifference` з аргументами `17` та `9`. ```js -assert.match(code, /console\.log\s*\(\s*calculateDifference\s*\(\s*17\s*,\s*9\s*\)\s*\)\s*;?/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateDifference(17,9))"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/ukrainian/blocks/workshop-calculator/66cc172af7159a7c67804544.md b/curriculum/challenges/ukrainian/blocks/workshop-calculator/66cc172af7159a7c67804544.md index 53646319ca9..ae2273f8074 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-calculator/66cc172af7159a7c67804544.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-calculator/66cc172af7159a7c67804544.md @@ -17,7 +17,7 @@ dashedName: step-12 # --hints-- -У вас має бути функція з назвою `calculateProduct`. +Ви повинні оголосити функцію з назвою `calculateProduct`. ```js assert.isFunction(calculateProduct); @@ -26,8 +26,11 @@ assert.isFunction(calculateProduct); Ваша функція `calculateProduct` має мати два параметри з іменами `num1` та `num2`. ```js -const regex = __helpers.functionRegex('calculateProduct', ['num1', 'num2']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { calculateProduct } = explorer.allFunctions; +assert.lengthOf(calculateProduct?.parameters, 2); +assert.equal(calculateProduct?.parameters[0].toString(), "num1"); +assert.equal(calculateProduct?.parameters[1].toString(), "num2"); ``` Ваша функція `calculateProduct` має повертати добуток двох параметрів. @@ -40,7 +43,9 @@ assert.equal(calculateProduct(10, 5), 50); У вас має бути `console.log`, який викликає функцію `calculateProduct` з аргументами `13` та `5`. ```js -assert.match(code, /console\.log\s*\(\s*calculateProduct\s*\(\s*13\s*,\s*5\s*\)\s*\)\s*;?/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const validStatements = ["console.log(calculateProduct(13,5))", "console.log(calculateProduct(5,13))"]; +assert.isTrue(validStatements.some(stmt => strippedCode.includes(stmt))); ``` # --seed-- diff --git a/curriculum/challenges/ukrainian/blocks/workshop-calculator/66cc1a3a39aef47d6473cb2f.md b/curriculum/challenges/ukrainian/blocks/workshop-calculator/66cc1a3a39aef47d6473cb2f.md index 20fd81d405b..30ddcafbb2e 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-calculator/66cc1a3a39aef47d6473cb2f.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-calculator/66cc1a3a39aef47d6473cb2f.md @@ -17,7 +17,7 @@ dashedName: step-13 # --hints-- -У вас має бути функція з назвою `calculateQuotient`. +Ви повинні оголосити функцію з назвою `calculateQuotient`. ```js assert.isFunction(calculateQuotient); @@ -26,8 +26,11 @@ assert.isFunction(calculateQuotient); Ваша функція `calculateQuotient` має мати два параметри з іменами `num1` та `num2`. ```js -const regex = __helpers.functionRegex('calculateQuotient', ['num1', 'num2']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { calculateQuotient } = explorer.allFunctions; +assert.lengthOf(calculateQuotient?.parameters, 2); +assert.equal(calculateQuotient?.parameters[0].toString(), "num1"); +assert.equal(calculateQuotient?.parameters[1].toString(), "num2"); ``` Ваша функція `calculateQuotient` має повертати частку двох параметрів. @@ -40,7 +43,9 @@ assert.equal(calculateQuotient(100, 10), 10); У вас має бути `console.log`, який викликає функцію `calculateQuotient` з аргументами `7` та `11`. ```js -assert.match(code, /console\.log\s*\(\s*calculateQuotient\s*\(\s*7\s*,\s*11\s*\)\s*\)\s*;?/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateQuotient(7,11))"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/ukrainian/blocks/workshop-calculator/66cc1ccfefdd727e18c2ab20.md b/curriculum/challenges/ukrainian/blocks/workshop-calculator/66cc1ccfefdd727e18c2ab20.md index 90a6e4435fd..f8ea958b47c 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-calculator/66cc1ccfefdd727e18c2ab20.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-calculator/66cc1ccfefdd727e18c2ab20.md @@ -7,7 +7,7 @@ dashedName: step-14 # --description-- -Ваш `calculateQuotient`, здається, працює правильно, але є один випадок, який ви ще не перевірили. +Ваш `calculateQuotient`, здається, працює правильно, але є один випадок, який ви ще не протестували. Додайте `console.log`, який викликає функцію `calculateQuotient` з аргументами `3` та `0`. @@ -18,7 +18,9 @@ dashedName: step-14 У вас має бути `console.log`, який викликає функцію `calculateQuotient` з аргументами `3` та `0`. ```js -assert.match(code, /console\.log\s*\(\s*calculateQuotient\s*\(\s*3\s*,\s*0\s*\)\s*\)\s*;?/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateQuotient(3,0))"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/ukrainian/blocks/workshop-calculator/66cc1deb1f04647f2aabee2b.md b/curriculum/challenges/ukrainian/blocks/workshop-calculator/66cc1deb1f04647f2aabee2b.md index 85fa3778a1d..21432b8c415 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-calculator/66cc1deb1f04647f2aabee2b.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-calculator/66cc1deb1f04647f2aabee2b.md @@ -20,8 +20,8 @@ dashedName: step-15 Ваша функція `calculateQuotient` має повертати рядок `"Error: Division by zero"`, якщо `num2` дорівнює нулю. ```js -assert.strictEqual(calculateQuotient(10, 0), 'Error: Division by zero'); -assert.strictEqual(calculateQuotient(3, 0), 'Error: Division by zero'); +assert.strictEqual(calculateQuotient(10, 0), "Error: Division by zero"); +assert.strictEqual(calculateQuotient(3, 0), "Error: Division by zero"); ``` Ваша функція `calculateQuotient` має повертати результат ділення `num1` на `num2`, якщо `num2` не дорівнює нулю. diff --git a/curriculum/challenges/ukrainian/blocks/workshop-calculator/66cc21d23238dc8240a8a182.md b/curriculum/challenges/ukrainian/blocks/workshop-calculator/66cc21d23238dc8240a8a182.md index 97c5fc1a500..43bd9c2ad74 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-calculator/66cc21d23238dc8240a8a182.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-calculator/66cc21d23238dc8240a8a182.md @@ -28,7 +28,7 @@ Math.pow(5, 2); // 25 # --hints-- -У вас має бути функція з назвою `calculateSquare`. +Ви повинні оголосити функцію з назвою `calculateSquare`. ```js assert.isFunction(calculateSquare); @@ -37,8 +37,10 @@ assert.isFunction(calculateSquare); Ваша функція `calculateSquare` має приймати параметр `num`. ```js -const regex = __helpers.functionRegex('calculateSquare', ['num']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { calculateSquare } = explorer.allFunctions; +assert.lengthOf(calculateSquare?.parameters, 1); +assert.equal(calculateSquare?.parameters[0].toString(), "num"); ``` Ваша функція `calculateSquare` має повертати квадрат `num`. diff --git a/curriculum/challenges/ukrainian/blocks/workshop-calculator/66cc26907ff6908402af0149.md b/curriculum/challenges/ukrainian/blocks/workshop-calculator/66cc26907ff6908402af0149.md index daacf2461c1..e78d8061a57 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-calculator/66cc26907ff6908402af0149.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-calculator/66cc26907ff6908402af0149.md @@ -18,13 +18,17 @@ dashedName: step-17 У вас має бути `console.log`, який викликає функцію `calculateSquare` з аргументом `2`. ```js -assert.match(code, /console\.log\s*\(\s*calculateSquare\s*\(\s*2\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateSquare(2))"; +assert.include(strippedCode, expectedStatement); ``` У вас має бути `console.log`, який викликає функцію `calculateSquare` з аргументом `9`. ```js -assert.match(code, /console\.log\s*\(\s*calculateSquare\s*\(\s*9\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateSquare(9))"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/ukrainian/blocks/workshop-calculator/66cc2739f687e484d50bb6f1.md b/curriculum/challenges/ukrainian/blocks/workshop-calculator/66cc2739f687e484d50bb6f1.md index 5db00a528af..8dab8468566 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-calculator/66cc2739f687e484d50bb6f1.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-calculator/66cc2739f687e484d50bb6f1.md @@ -26,7 +26,7 @@ Math.sqrt(9); # --hints-- -У вас має бути функція з назвою `calculateSquareRoot`. +Ви повинні оголосити функцію з назвою `calculateSquareRoot`. ```js assert.isFunction(calculateSquareRoot); @@ -35,8 +35,10 @@ assert.isFunction(calculateSquareRoot); Ваша функція `calculateSquareRoot` має приймати параметр `num`. ```js -const regex = __helpers.functionRegex('calculateSquareRoot', ['num']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { calculateSquareRoot } = explorer.allFunctions; +assert.lengthOf(calculateSquareRoot?.parameters, 1); +assert.equal(calculateSquareRoot?.parameters[0].toString(), "num"); ``` Ваша функція `calculateSquareRoot` має повертати квадратний корінь з `num`. diff --git a/curriculum/challenges/ukrainian/blocks/workshop-calculator/66cc281d687975858049fd8d.md b/curriculum/challenges/ukrainian/blocks/workshop-calculator/66cc281d687975858049fd8d.md index 6f42a7ca45e..d6efe262668 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-calculator/66cc281d687975858049fd8d.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-calculator/66cc281d687975858049fd8d.md @@ -20,13 +20,17 @@ dashedName: step-19 У вас має бути виклик `console.log`, який викликає функцію `calculateSquareRoot` з аргументом `25`. ```js -assert.match(code, /console\.log\s*\(\s*calculateSquareRoot\s*\(\s*25\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateSquareRoot(25))"; +assert.include(strippedCode, expectedStatement); ``` У вас має бути виклик `console.log`, який викликає функцію `calculateSquareRoot` з аргументом `100`. ```js -assert.match(code, /console\.log\s*\(\s*calculateSquareRoot\s*\(\s*100\s*\)\s*\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateSquareRoot(100))"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/ukrainian/blocks/workshop-calculator/66cdf76685e4cb5a8726e27b.md b/curriculum/challenges/ukrainian/blocks/workshop-calculator/66cdf76685e4cb5a8726e27b.md index 612501a50f1..66892be1dea 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-calculator/66cdf76685e4cb5a8726e27b.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-calculator/66cdf76685e4cb5a8726e27b.md @@ -18,13 +18,17 @@ dashedName: step-9 У вас має бути `console.log`, який викликає функцію `calculateSum` з аргументами `10` та `10`. ```js -assert.match(code, /console\.log\(calculateSum\(10\s*,\s*10\)\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateSum(10,10))"; +assert.include(strippedCode, expectedStatement); ``` У вас має бути `console.log`, який викликає функцію `calculateSum` з аргументами `5` та `5`. ```js -assert.match(code, /console\.log\(calculateSum\(5\s*,\s*5\)\)/); +const strippedCode = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)); +const expectedStatement = "console.log(calculateSum(5,5))"; +assert.include(strippedCode, expectedStatement); ``` # --seed-- diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646c48df8674cf2b91020ecc.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646c48df8674cf2b91020ecc.md index 79461f0ac59..4d35fcf2cc4 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646c48df8674cf2b91020ecc.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646c48df8674cf2b91020ecc.md @@ -35,12 +35,13 @@ assert.oneOf(href, ["./styles.css", "styles.css"]); ```html ---fcc-editable-region-- - - fCC Cat Painting - + + fCC Cat Painting --fcc-editable-region-- + +--fcc-editable-region-- + ``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646c586be7180e40ddf74ff6.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646c586be7180e40ddf74ff6.md index 616b44c90fd..5a801ee3095 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646c586be7180e40ddf74ff6.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646c586be7180e40ddf74ff6.md @@ -31,9 +31,9 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('body')?.backgroundColor, - - fCC Cat Painting - + + fCC Cat Painting + @@ -48,3 +48,4 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('body')?.backgroundColor, --fcc-editable-region-- ``` + diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646c59e942f35541923104bf.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646c59e942f35541923104bf.md index 368cef998d2..e9935e02e32 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646c59e942f35541923104bf.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646c59e942f35541923104bf.md @@ -11,7 +11,7 @@ dashedName: step-4 # --hints-- -У вас має бути елемент `main`. +У вас має бути `main` елемент. ```js assert.lengthOf(document.querySelectorAll('main'), 1); @@ -43,13 +43,13 @@ assert.lengthOf(document.querySelectorAll('main div'), 1); - - fCC Cat Painting - + + fCC Cat Painting + --fcc-editable-region-- - + --fcc-editable-region-- diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646c5ace05e4be4211407935.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646c5ace05e4be4211407935.md index b105d68c48a..3449721ea9b 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646c5ace05e4be4211407935.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646c5ace05e4be4211407935.md @@ -50,14 +50,14 @@ assert.equal(secondGradient,'(69,69,79)100%)'); - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
+
+
+
``` @@ -71,13 +71,13 @@ body { background-color: #c9d2fc; } ---fcc-editable-region-- .cat-head { +--fcc-editable-region-- + +--fcc-editable-region-- width: 205px; height: 180px; border: 1px solid #000; border-radius: 46%; - } ---fcc-editable-region-- ``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646c5d7057c45f432fcdd46c.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646c5d7057c45f432fcdd46c.md index aee0e988a3c..50460eb1482 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646c5d7057c45f432fcdd46c.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646c5d7057c45f432fcdd46c.md @@ -7,7 +7,7 @@ dashedName: step-5 # --description-- -Використовуючи селектор класу, надайте елементу `.cat-head` ширину `205px` та висоту `180px`. Також додайте йому кордон `1px solid #000` і `border-radius` `46%`. +Використовуючи селектор класу, надайте елементу `.cat-head` ширину `205px` та висоту `180px`. Також додайте йому кордон `1px solid #000` і `border-radius` `46%`. # --hints-- @@ -50,13 +50,13 @@ assert.equal(new __helpers.CSSHelp(document)?.getStyle(".cat-head")?.borderRadiu - - fCC Cat Painting - + + fCC Cat Painting +
-
+
diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646c5e727e56e743c9aed4a1.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646c5e727e56e743c9aed4a1.md index e7af0b80778..4bb5c886f13 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646c5e727e56e743c9aed4a1.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646c5e727e56e743c9aed4a1.md @@ -44,14 +44,14 @@ assert.equal(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.left, '100p - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
+
+
+
``` @@ -65,16 +65,14 @@ body { background-color: #c9d2fc; } ---fcc-editable-region-- .cat-head { - - +--fcc-editable-region-- +--fcc-editable-region-- background: linear-gradient(#5e5e5e 85%, #45454f 100%); width: 205px; height: 180px; border: 1px solid #000; border-radius: 46%; } ---fcc-editable-region-- ``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646c5ffef5598d449b52ec12.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646c5ffef5598d449b52ec12.md index e1832bf208c..374dd33e705 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646c5ffef5598d449b52ec12.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646c5ffef5598d449b52ec12.md @@ -39,18 +39,18 @@ assert.equal(document.querySelectorAll('.cat-head div')[0]?.getAttribute('class' - - fCC Cat Painting - + + fCC Cat Painting + -
+
+
--fcc-editable-region-- -
- -
+ --fcc-editable-region-- -
+ +
``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646ce8bb4b35544d501c7184.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646ce8bb4b35544d501c7184.md index 88c45d11370..c3685ee972f 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646ce8bb4b35544d501c7184.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646ce8bb4b35544d501c7184.md @@ -43,20 +43,20 @@ assert.isTrue(document.querySelectorAll('.cat-ears div')[1]?.classList.contains( - - fCC Cat Painting - + + fCC Cat Painting + -
-
+
+
+
--fcc-editable-region-- -
- -
+ --fcc-editable-region--
-
+
+
``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646ce9d790d2a44de5f99e04.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646ce9d790d2a44de5f99e04.md index bef3a83bc44..7d9afb4fb3f 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646ce9d790d2a44de5f99e04.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646ce9d790d2a44de5f99e04.md @@ -55,25 +55,25 @@ assert.isTrue(document.querySelectorAll('.cat-right-ear div')[0]?.classList.cont - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
- --fcc-editable-region-- -
- -
-
- -
- --fcc-editable-region-- +
+
+
+
+--fcc-editable-region-- + +
+
+ +--fcc-editable-region--
-
+
+
``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646ceb843412c74edee27a79.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646ceb843412c74edee27a79.md index de543c1baac..d915e63f12c 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646ceb843412c74edee27a79.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646ceb843412c74edee27a79.md @@ -53,7 +53,7 @@ assert.strictEqual(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.b assert.strictEqual(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.borderTop, '35px solid red') ``` -Ваш селектор `.cat-right-ear` має мати властивість `border-bottom` зі значенням `35px solid red`. Не забудьте додати крапку з комою. +Ваш селектор `.cat-right-ear` має мати властивість `border-bottom`, встановлену в `35px solid red`. Не забудьте додати крапку з комою. ```js assert.strictEqual(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.borderBottom, '35px solid red') @@ -67,23 +67,23 @@ assert.strictEqual(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.b - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646cecc9eb5c4f4f73dafd07.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646cecc9eb5c4f4f73dafd07.md index 45d911f16a8..e53796f65f4 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646cecc9eb5c4f4f73dafd07.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646cecc9eb5c4f4f73dafd07.md @@ -37,23 +37,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-ear')?.left, '- - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` @@ -81,12 +81,12 @@ body { border-radius: 46%; } ---fcc-editable-region-- .cat-left-ear { +--fcc-editable-region-- +--fcc-editable-region-- border-left: 35px solid transparent; border-right: 35px solid transparent; border-bottom: 70px solid #5e5e5e; } ---fcc-editable-region-- ``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646cef0c2b98915094df7099.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646cef0c2b98915094df7099.md index 3023f1c1b86..88730755e6d 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646cef0c2b98915094df7099.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646cef0c2b98915094df7099.md @@ -31,23 +31,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-ear')?.borderTo - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646cf1206cac5f51804f49cf.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646cf1206cac5f51804f49cf.md index 4ea20d870fe..8d62b909cb0 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646cf1206cac5f51804f49cf.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646cf1206cac5f51804f49cf.md @@ -29,23 +29,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-ear')?.transfor - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646cf2249f02ca5233d9af7c.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646cf2249f02ca5233d9af7c.md index 5a24b08241b..c2409f5ae47 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646cf2249f02ca5233d9af7c.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646cf2249f02ca5233d9af7c.md @@ -13,7 +13,7 @@ dashedName: step-26 # --hints-- -Ви повинні мати селектор `.cat-right-ear`. +У вас має бути селектор `.cat-right-ear`. ```js assert.exists(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')) @@ -45,23 +45,23 @@ assert.strictEqual(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.b - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646cf48d8f8e1f535a1821d3.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646cf48d8f8e1f535a1821d3.md index 500b8a0c37e..8e85704ccea 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646cf48d8f8e1f535a1821d3.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646cf48d8f8e1f535a1821d3.md @@ -37,23 +37,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.left, ' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646cf6cbca98e258da65c979.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646cf6cbca98e258da65c979.md index aa26881eb77..299b74bc0d5 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646cf6cbca98e258da65c979.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646cf6cbca98e258da65c979.md @@ -25,23 +25,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.transfo - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646cf88aa884405a11ea5bcc.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646cf88aa884405a11ea5bcc.md index 2e759afeb98..aa69739377e 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646cf88aa884405a11ea5bcc.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646cf88aa884405a11ea5bcc.md @@ -31,23 +31,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.borderT - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646cfc2b8e6fe95c20a819d5.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646cfc2b8e6fe95c20a819d5.md index c120727fcf3..a462d050792 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646cfc2b8e6fe95c20a819d5.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646cfc2b8e6fe95c20a819d5.md @@ -29,23 +29,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-ear')?.zIndex, - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646cfd853634255d02b64cc1.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646cfd853634255d02b64cc1.md index 5b29920906b..d65da4df1de 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646cfd853634255d02b64cc1.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646cfd853634255d02b64cc1.md @@ -27,23 +27,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-ear')?.zIndex, - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646cfde6ac612e5d60391f50.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646cfde6ac612e5d60391f50.md index dc757da41a1..fd7c6c2c243 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646cfde6ac612e5d60391f50.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646cfde6ac612e5d60391f50.md @@ -25,23 +25,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.zIndex, - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646dd556d524bc61c0139bd6.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646dd556d524bc61c0139bd6.md index fa779d7160e..151594667a1 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646dd556d524bc61c0139bd6.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646dd556d524bc61c0139bd6.md @@ -45,23 +45,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-inner-ear')?.bo - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646dd6f9caa862627dd87772.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646dd6f9caa862627dd87772.md index 2007a229f12..2303c13e4ae 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646dd6f9caa862627dd87772.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646dd6f9caa862627dd87772.md @@ -37,23 +37,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-inner-ear')?.le - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646dd7cfd0cfac630c1dd520.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646dd7cfd0cfac630c1dd520.md index c7e3f70af18..d67a0e1a616 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646dd7cfd0cfac630c1dd520.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646dd7cfd0cfac630c1dd520.md @@ -43,23 +43,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-inner-ear')?.bo - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646dd8c79ec23463a3d0e356.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646dd8c79ec23463a3d0e356.md index df370090682..aa77b60b805 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646dd8c79ec23463a3d0e356.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646dd8c79ec23463a3d0e356.md @@ -43,23 +43,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-inner-ear')?.b - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646dd9d9a729916460724f16.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646dd9d9a729916460724f16.md index f9bddbaa68b..a6ffd053a42 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646dd9d9a729916460724f16.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646dd9d9a729916460724f16.md @@ -37,23 +37,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-inner-ear')?.l - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646ddab8afd73764f5241bbf.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646ddab8afd73764f5241bbf.md index f3747a35e17..839432ea6a6 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646ddab8afd73764f5241bbf.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646ddab8afd73764f5241bbf.md @@ -43,23 +43,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-inner-ear')?.b - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646ddb61ff08366570cc5902.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646ddb61ff08366570cc5902.md index 118128082bc..69edd9393c1 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646ddb61ff08366570cc5902.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646ddb61ff08366570cc5902.md @@ -45,27 +45,27 @@ assert.isTrue(document.querySelectorAll('.cat-eyes div')[1].classList.contains(' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- - --fcc-editable-region-- - - --fcc-editable-region--
-
+ + --fcc-editable-region-- + + --fcc-editable-region-- +
+
``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646ddd3f9f97a0667b964bdb.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646ddd3f9f97a0667b964bdb.md index 4557b1a9009..d80af5da92a 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646ddd3f9f97a0667b964bdb.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646ddd3f9f97a0667b964bdb.md @@ -55,34 +55,34 @@ assert.isTrue(document.querySelectorAll('.cat-right-eye div')[0]?.classList.cont - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
- --fcc-editable-region-- -
- -
-
- -
- --fcc-editable-region-- -
-
+ +
+
+--fcc-editable-region-- + +
+
+ +--fcc-editable-region-- +
+
+
+
``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646dde7dc20dc167489faa69.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646dde7dc20dc167489faa69.md index aa61a3c12ee..0346af11059 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646dde7dc20dc167489faa69.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646dde7dc20dc167489faa69.md @@ -43,32 +43,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-eye')?.backgrou - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646ddf888632fa67f1180940.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646ddf888632fa67f1180940.md index a93d146ad3e..7467c80da65 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646ddf888632fa67f1180940.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646ddf888632fa67f1180940.md @@ -37,32 +37,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-eye')?.left, '3 - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646de5dc8988076a1d992afd.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646de5dc8988076a1d992afd.md index 23278f3b1ba..dc2ed939a3c 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646de5dc8988076a1d992afd.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646de5dc8988076a1d992afd.md @@ -31,32 +31,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-eye')?.transfor - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646de6a97b50a86ac487de86.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646de6a97b50a86ac487de86.md index 702b1b475bb..c6f895bdc52 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646de6a97b50a86ac487de86.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646de6a97b50a86ac487de86.md @@ -45,32 +45,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-eye')?.backgro - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646de7b64467e96b7d35b5cd.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646de7b64467e96b7d35b5cd.md index 668947ffbcb..37d4af5a160 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646de7b64467e96b7d35b5cd.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646de7b64467e96b7d35b5cd.md @@ -37,32 +37,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-eye')?.left, ' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646de8478d6f796bfbdccfb2.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646de8478d6f796bfbdccfb2.md index 5033e635f6e..1df5e2a0686 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646de8478d6f796bfbdccfb2.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646de8478d6f796bfbdccfb2.md @@ -31,32 +31,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-eye')?.transfo - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646de8d204a3426c7d184372.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646de8d204a3426c7d184372.md index e4369333af2..fab449a66c9 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646de8d204a3426c7d184372.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646de8d204a3426c7d184372.md @@ -45,32 +45,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-inner-eye')?.ba - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646dea1c98c2426d43a705c3.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646dea1c98c2426d43a705c3.md index e6f6ce430cd..fba4acb4370 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646dea1c98c2426d43a705c3.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646dea1c98c2426d43a705c3.md @@ -49,32 +49,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-inner-eye')?.tr - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646deb169847f86df0f95bfc.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646deb169847f86df0f95bfc.md index 88f8d5d81e3..daf1a655dd2 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646deb169847f86df0f95bfc.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646deb169847f86df0f95bfc.md @@ -43,32 +43,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-inner-eye')?.b - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646dec359bef3b7811fba5a6.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646dec359bef3b7811fba5a6.md index e274f7425bc..3dfbb629980 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646dec359bef3b7811fba5a6.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646dec359bef3b7811fba5a6.md @@ -49,32 +49,32 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-right-inner-eye')?.t - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646dedbcba062079128b2ecc.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646dedbcba062079128b2ecc.md index 6b2bee78dff..de0c5b35917 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646dedbcba062079128b2ecc.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646dedbcba062079128b2ecc.md @@ -11,7 +11,7 @@ dashedName: step-51 # --hints-- -Ви маєте створити елемент `div`. +Ви повинні створити елемент `div`. ```js assert.lengthOf(document.querySelectorAll('div'), 12); @@ -31,36 +31,36 @@ assert.isTrue(document.querySelectorAll('div')[11].classList.contains('cat-nose' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
- - --fcc-editable-region-- - - --fcc-editable-region--
-
+ + --fcc-editable-region-- + + --fcc-editable-region-- +
+
``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646def5e863abf7a14501421.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646def5e863abf7a14501421.md index 1cf33ccb065..bb4dd79a184 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646def5e863abf7a14501421.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646def5e863abf7a14501421.md @@ -43,34 +43,34 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-nose')?.borderBottom - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
- -
-
+ +
+
+
``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646df03c8f79337ab46f148b.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646df03c8f79337ab46f148b.md index 0cd511341ae..69d5004a09f 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646df03c8f79337ab46f148b.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646df03c8f79337ab46f148b.md @@ -37,34 +37,34 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-nose')?.left, '85px' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
- -
-
+ +
+
+
``` @@ -196,5 +196,4 @@ body { border-right: 15px solid transparent; border-bottom: 20px solid #442c2c; } - ``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646df0cf26413a7b35e4b8b3.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646df0cf26413a7b35e4b8b3.md index 0bb9206222d..c17a9c5d8ca 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646df0cf26413a7b35e4b8b3.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646df0cf26413a7b35e4b8b3.md @@ -49,34 +49,34 @@ assert.notMatch(code, /border-top-right-radius:\s*\d+%;/); - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
- -
-
+ +
+
+
``` @@ -211,5 +211,4 @@ body { border-right: 15px solid transparent; border-bottom: 20px solid #442c2c; } - ``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646df1d1aa4ae57bdf1869c4.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646df1d1aa4ae57bdf1869c4.md index 1456663f95a..bad679d975e 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646df1d1aa4ae57bdf1869c4.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646df1d1aa4ae57bdf1869c4.md @@ -33,38 +33,38 @@ assert.isTrue(document.querySelectorAll('div')[12].classList.contains('cat-mouth - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
- --fcc-editable-region-- - - --fcc-editable-region-- +
+
+
+
+
+
+
-
+ +
+ + --fcc-editable-region-- + + --fcc-editable-region-- +
+
``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646dffd8ce9ac77ec1906f2e.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646dffd8ce9ac77ec1906f2e.md index 1a66706c27f..fbb1002cede 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646dffd8ce9ac77ec1906f2e.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646dffd8ce9ac77ec1906f2e.md @@ -43,41 +43,40 @@ assert.isTrue(document.querySelectorAll('.cat-mouth div')[1]?.classList.contains - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
- --fcc-editable-region-- -
- +
+
+
+
+
+
- --fcc-editable-region-- +
+ +
+
+--fcc-editable-region-- + +--fcc-editable-region--
-
+
+
``` @@ -213,5 +212,4 @@ body { border-right: 15px solid transparent; border-bottom: 20px solid #442c2c; } - ``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f0417322c0e04983a5149.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f0417322c0e04983a5149.md index 39922a63be1..d2bf432eeae 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f0417322c0e04983a5149.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f0417322c0e04983a5149.md @@ -43,40 +43,39 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-mouth-line-left')?.l - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
+
+
+
+
+ +
+
+
+
-
+
+
``` @@ -222,6 +221,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f08293804a30685533c6f.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f08293804a30685533c6f.md index 89c59ece49b..5de8b556db9 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f08293804a30685533c6f.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f08293804a30685533c6f.md @@ -25,40 +25,39 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-mouth-line-left')?.t - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
+
+
+
+
+ +
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f09293eb3230723a62f77.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f09293eb3230723a62f77.md index 0307657333d..e1ddae7ebc7 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f09293eb3230723a62f77.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f09293eb3230723a62f77.md @@ -43,40 +43,39 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-mouth-line-right')?. - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
+
+
+
+
+ +
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f0c9a1e3360092d1bbd33.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f0c9a1e3360092d1bbd33.md index 67ced902743..98ad4639a61 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f0c9a1e3360092d1bbd33.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f0c9a1e3360092d1bbd33.md @@ -25,40 +25,39 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-mouth-line-right')?. - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
+
+
+
+
+ +
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f0ce5737243098ad6e494.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f0ce5737243098ad6e494.md index 9d9000b239b..d194619e262 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f0ce5737243098ad6e494.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f0ce5737243098ad6e494.md @@ -13,7 +13,7 @@ dashedName: step-63 # --hints-- -Ви маєте створити елемент `div`. +Ви повинні створити елемент `div`. ```js assert.lengthOf(document.querySelectorAll('div'), 16); @@ -33,44 +33,43 @@ assert.isTrue(document.querySelectorAll('div')[15].classList.contains('cat-whisk - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
+
+
+
+
+ +
- --fcc-editable-region-- - - --fcc-editable-region-- - +
+
+
-
+ + --fcc-editable-region-- + + --fcc-editable-region-- +
+
``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f0ef13604420a8744f7d4.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f0ef13604420a8744f7d4.md index 82325babb30..e14872ff73c 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f0ef13604420a8744f7d4.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f0ef13604420a8744f7d4.md @@ -43,46 +43,45 @@ assert.isTrue(document.querySelectorAll('.cat-whiskers div')[1].classList.contai - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- - --fcc-editable-region-- -
- +
+
- --fcc-editable-region-- +
+ +
+ +
+
+
+
+
+--fcc-editable-region-- + +--fcc-editable-region--
-
+
+
``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f0f7c5933560af8e7e380.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f0f7c5933560af8e7e380.md index 843c1b19f3d..85f2f2db79a 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f0f7c5933560af8e7e380.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f0f7c5933560af8e7e380.md @@ -50,49 +50,48 @@ assert.isTrue(document.querySelectorAll('.cat-whiskers-left div')[2].classList.c - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
- --fcc-editable-region-- -
- -
- --fcc-editable-region-- -
+
+
+
+ +
+
+
+
+
+ +
+
+--fcc-editable-region-- + +--fcc-editable-region-- +
+
-
+
+
``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f102bf87b350b593baa72.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f102bf87b350b593baa72.md index d442102e657..a4e5fa079b9 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f102bf87b350b593baa72.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f102bf87b350b593baa72.md @@ -49,53 +49,52 @@ assert.isTrue(document.querySelectorAll('.cat-whiskers-right div')[2].classList. - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
- --fcc-editable-region-- -
- -
- --fcc-editable-region-- +
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+--fcc-editable-region-- + +--fcc-editable-region-- +
-
+
+
``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f107abb89d00bb99f387a.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f107abb89d00bb99f387a.md index a3cce367d44..6f128fcccab 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f107abb89d00bb99f387a.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f107abb89d00bb99f387a.md @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whiskers-left div')? - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f12da0b4c5d0ca162834a.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f12da0b4c5d0ca162834a.md index 919bedcdf26..22739443a70 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f12da0b4c5d0ca162834a.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f12da0b4c5d0ca162834a.md @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-left-top')?. - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -261,6 +260,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f135eab69d90d0c6d4e9b.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f135eab69d90d0c6d4e9b.md index d126df7b848..7649c82377a 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f135eab69d90d0c6d4e9b.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f135eab69d90d0c6d4e9b.md @@ -25,53 +25,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-left-top')?. - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -250,5 +249,4 @@ body { --fcc-editable-region-- } - ``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f159b2cffb21150b927cb.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f159b2cffb21150b927cb.md index 5f4edf62a95..870f8b8210f 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f159b2cffb21150b927cb.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f159b2cffb21150b927cb.md @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-left-middle' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -268,6 +267,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f164bf100dd11d226161f.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f164bf100dd11d226161f.md index 895e30c1693..560453b4c65 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f164bf100dd11d226161f.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f164bf100dd11d226161f.md @@ -25,53 +25,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-left-middle' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -254,7 +253,7 @@ body { top: 127px; left: 52px; --fcc-editable-region-- - + --fcc-editable-region-- } ``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f1764e2f1d212ba9785a7.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f1764e2f1d212ba9785a7.md index de5ab34f0a3..cbeb5444e25 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f1764e2f1d212ba9785a7.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f1764e2f1d212ba9785a7.md @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-left-bottom' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -275,6 +274,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f1802a09a171332e14630.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f1802a09a171332e14630.md index 80fc1103fd5..189d4d6dcac 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f1802a09a171332e14630.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f1802a09a171332e14630.md @@ -25,53 +25,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-left-bottom' - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f4d6c42dc5f214f4e7444.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f4d6c42dc5f214f4e7444.md index f2003f619fa..b2b43ad2285 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f4d6c42dc5f214f4e7444.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f4d6c42dc5f214f4e7444.md @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-right-top')? - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -282,6 +281,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f4e46e81f7021d5fd9c1d.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f4e46e81f7021d5fd9c1d.md index 02c280c3f9f..ced5ed4eb43 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f4e46e81f7021d5fd9c1d.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f4e46e81f7021d5fd9c1d.md @@ -25,53 +25,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-right-top')? - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f4f6a14e3c522d130a0d2.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f4f6a14e3c522d130a0d2.md index 9ba2cd7a0b9..c411d74da0f 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f4f6a14e3c522d130a0d2.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f4f6a14e3c522d130a0d2.md @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-right-middle - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -289,6 +288,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f4fe12b7985232bf475a5.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f4fe12b7985232bf475a5.md index 93792c722bf..bcd397c1b20 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f4fe12b7985232bf475a5.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f4fe12b7985232bf475a5.md @@ -25,53 +25,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-right-middle - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f507e4d1cd323f17db4fc.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f507e4d1cd323f17db4fc.md index 2933ab1a763..f847ad91c38 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f507e4d1cd323f17db4fc.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f507e4d1cd323f17db4fc.md @@ -44,53 +44,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-right-bottom - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -297,6 +296,6 @@ body { } --fcc-editable-region-- - + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f516dbfc1342495515625.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f516dbfc1342495515625.md index d92c97934a8..05f7c380e8f 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f516dbfc1342495515625.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/646f516dbfc1342495515625.md @@ -27,53 +27,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whisker-right-bottom - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -295,53 +294,53 @@ body { - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+ +
+
``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/6476f5c17f99146071ee884c.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/6476f5c17f99146071ee884c.md index de205154388..b4aad238cc5 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/6476f5c17f99146071ee884c.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/6476f5c17f99146071ee884c.md @@ -21,13 +21,13 @@ dashedName: step-8 assert.equal(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.position, 'relative'); ``` -Ваш селектор `.cat-head` повинен мати властивість `top`, встановлену в `100px`. Переконайтеся, що ви додали крапку з комою. +Ваш селектор `.cat-head` має мати властивість `top`, встановлену в `100px`. Переконайтеся, що ви додали крапку з комою. ```js assert.equal(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.top, '100px'); ``` -Ваш селектор `.cat-head` повинен мати властивість `left`, встановлену в `100px`. Переконайтеся, що ви додали крапку з комою. +Ваш селектор `.cat-head` має мати властивість `left`, встановлену в `100px`. Переконайтеся, що ви додали крапку з комою. ```js assert.equal(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.left, '100px'); @@ -41,14 +41,14 @@ assert.equal(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.left, '100p - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
+
+
+
``` @@ -65,9 +65,9 @@ body { .cat-head { --fcc-editable-region-- position: static; +--fcc-editable-region-- top: 100px; left: 100px; ---fcc-editable-region-- background: linear-gradient(#5e5e5e 85%, #45454f 100%); width: 205px; height: 180px; diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/6476f7a4827bcc61682f2347.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/6476f7a4827bcc61682f2347.md index 7b63e8626f1..87702f4fdb7 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/6476f7a4827bcc61682f2347.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/6476f7a4827bcc61682f2347.md @@ -9,13 +9,11 @@ dashedName: step-9 Коли ви використовуєте значення `absolute` для властивості `position`, елемент виводиться з нормального потоку документа, а його позиція визначається властивостями `top`, `right`, `bottom` і `left`. -Встановіть властивість `position` вашого елемента `.cat-head` у значення `absolute`, потім задайте властивості `top` і `left` будь-яким додатним піксельним значенням. - - +Встановіть властивість `position` вашого елемента `.cat-head` у значення `absolute`. # --hints-- -Ваш селектор `.cat-head` повинен мати властивість `position`, встановлену в `absolute`. Переконайтеся, що ви додали крапку з комою. +Ваш селектор `.cat-head` повинен мати властивість `position` зі значенням `absolute`. Переконайтеся, що додали крапку з комою. ```js assert.equal(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.position, 'absolute'); @@ -43,14 +41,14 @@ assert.match(code, /left:\s*\d{1,4}px;/); - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
+
+
+
``` @@ -67,9 +65,9 @@ body { .cat-head { --fcc-editable-region-- position: relative; +--fcc-editable-region-- top: 100px; left: 100px; ---fcc-editable-region-- background: linear-gradient(#5e5e5e 85%, #45454f 100%); width: 205px; height: 180px; diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/6476fb7cbaafa36d65e9cf35.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/6476fb7cbaafa36d65e9cf35.md index d87b706ca8d..22c80a496e2 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/6476fb7cbaafa36d65e9cf35.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/6476fb7cbaafa36d65e9cf35.md @@ -33,17 +33,17 @@ assert.equal(document.querySelectorAll('div')[1]?.getAttribute('class'), 'box'); - - fCC Cat Painting - + + fCC Cat Painting + -
-
- --fcc-editable-region-- - - --fcc-editable-region-- -
+
+
+ --fcc-editable-region-- + + --fcc-editable-region-- +
``` @@ -59,8 +59,8 @@ body { .cat-head { position: absolute; - top: 300px; - left: 400px; + top: 100px; + left: 100px; background: linear-gradient(#5e5e5e 85%, #45454f 100%); width: 205px; height: 180px; diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/6476fc5cf14b276e6d04e82a.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/6476fc5cf14b276e6d04e82a.md index 5cc5cf9ba60..44b59fc8a24 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/6476fc5cf14b276e6d04e82a.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/6476fc5cf14b276e6d04e82a.md @@ -7,7 +7,7 @@ dashedName: step-11 # --description-- -Використайте селектор класу, щоб задати вашому `.box` елементу ширину `200px`, висоту `600px` та колір фону `#000`. Також задайте йому `position` зі значенням `absolute`, `top` зі значенням `800px` і `left` зі значенням `650px`. +Використайте селектор класу, щоб задати вашому `.box` елементу ширину `200px`, висоту `600px` та колір фону `#000`. Також задайте йому `position` зі значенням `absolute`, `top` зі значенням `800px` і `left` зі значенням `650px`. # --hints-- @@ -61,15 +61,15 @@ assert.equal(new __helpers.CSSHelp(document)?.getStyle('.box')?.top, '800px'); - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
+
+
+
+
``` @@ -84,7 +84,7 @@ body { } .cat-head { - position: relative; + position: absolute; top: 100px; left: 100px; background: linear-gradient(#5e5e5e 85%, #45454f 100%); @@ -98,3 +98,4 @@ body { --fcc-editable-region-- ``` + diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/6476fd4213318f6ee211028a.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/6476fd4213318f6ee211028a.md index 92f5dafacb9..357187b82ef 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/6476fd4213318f6ee211028a.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/6476fd4213318f6ee211028a.md @@ -7,7 +7,7 @@ dashedName: step-12 # --description-- -Тепер замініть значення властивості `position` вашого `.cat-head` на `fixed`. Залиште `top` і `left` без змін. +Тепер замініть значення властивості `position` у вашому `.cat-head` на `fixed`. Після цього прокрутіть сторінку вгору і вниз, щоб побачити, як працює значення `fixed`. @@ -39,15 +39,15 @@ assert.equal(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.left, '100p - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
+
+
+
+
``` @@ -63,10 +63,10 @@ body { .cat-head { --fcc-editable-region-- - position: relative; + position: absolute; +--fcc-editable-region-- top: 100px; left: 100px; ---fcc-editable-region-- background: linear-gradient(#5e5e5e 85%, #45454f 100%); width: 205px; height: 180px; diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/64770351e8586671ec0911f0.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/64770351e8586671ec0911f0.md index f5e5b865e5b..a420889d6d6 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/64770351e8586671ec0911f0.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/64770351e8586671ec0911f0.md @@ -21,7 +21,7 @@ dashedName: step-13 assert.equal(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.position, 'sticky'); ``` -Ваш селектор `.cat-head` має мати властивість `top`, встановлену в `0`. Переконайтеся, що ви додали крапку з комою. +Ваш селектор `.cat-head` повинен мати властивість `top` зі значенням `0`. Переконайтеся, що додали крапку з комою. ```js assert.equal(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.top, '0px'); @@ -41,15 +41,15 @@ assert.notMatch(code, /left:\s*100px;?/); - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
+
+
+
+
``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/6477062778c85972eb648030.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/6477062778c85972eb648030.md index 542e9767fd1..886e2a27064 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/6477062778c85972eb648030.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/6477062778c85972eb648030.md @@ -57,15 +57,15 @@ assert.equal(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.margin, 'au - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
+
+
+
+
``` @@ -82,8 +82,8 @@ body { .cat-head { --fcc-editable-region-- position: sticky; - top: 0; --fcc-editable-region-- + top: 0; background: linear-gradient(#5e5e5e 85%, #45454f 100%); width: 205px; height: 180px; @@ -92,7 +92,7 @@ body { } .box { - width: 400px; + width: 200px; height: 600px; background-color: #000; position: absolute; diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/647d821de0d97b3283c72b36.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/647d821de0d97b3283c72b36.md index ce289601ab0..3364a01fb75 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/647d821de0d97b3283c72b36.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/647d821de0d97b3283c72b36.md @@ -14,7 +14,7 @@ dashedName: step-16 Ви маєте видалити правило css `.box` та всі його значення. ```js -assert.notMatch(code, /\.box\s*\{\s*width:\s*400px;\s*height:\s*600px;\s*background-color:\s*#000;\s*position:\s*absolute;\s*left:\s*650px;\s*top:\s*800px;?\s*\}\s*/) +assert.notMatch(code, /\.box\s*\{\s*width:\s*200px;\s*height:\s*600px;\s*background-color:\s*#000;\s*position:\s*absolute;\s*left:\s*650px;\s*top:\s*800px;?\s*\}\s*/) ``` # --seed-- @@ -25,14 +25,14 @@ assert.notMatch(code, /\.box\s*\{\s*width:\s*400px;\s*height:\s*600px;\s*backgro - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
+
+
+
``` @@ -62,7 +62,7 @@ body { --fcc-editable-region-- .box { - width: 400px; + width: 200px; height: 600px; background-color: #000; position: absolute; diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/647d855ac12cd436059acd39.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/647d855ac12cd436059acd39.md index 4e61661edcb..426c048a981 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/647d855ac12cd436059acd39.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/647d855ac12cd436059acd39.md @@ -33,9 +33,9 @@ assert.strictEqual(new __helpers.CSSHelp(document).getStyle('*')?.boxSizing, 'bo - - fCC Cat Painting - + + fCC Cat Painting + diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/649353647c44ef4867ab4935.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/649353647c44ef4867ab4935.md index 4f3d9e50326..4764f62431c 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/649353647c44ef4867ab4935.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/649353647c44ef4867ab4935.md @@ -25,17 +25,17 @@ assert.notMatch(code, /<\/div>/) - - fCC Cat Painting - + + fCC Cat Painting + -
-
- --fcc-editable-region-- -
- --fcc-editable-region-- -
+
+
+ --fcc-editable-region-- +
+ --fcc-editable-region-- +
``` @@ -64,7 +64,7 @@ body { } .box { - width: 400px; + width: 200px; height: 600px; background-color: #000; position: absolute; diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/64a2687ef267e5934a2f93e3.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/64a2687ef267e5934a2f93e3.md index 2705791dd6f..ec61b470af9 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/64a2687ef267e5934a2f93e3.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/64a2687ef267e5934a2f93e3.md @@ -43,39 +43,39 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-mouth div')?.border, - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
- -
- -
-
-
+
+
-
+ +
+ +
+
+
+
+
+
``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/64a26ac5540c5493f4641f10.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/64a26ac5540c5493f4641f10.md index f9bacf31f9a..e4916f8f877 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/64a26ac5540c5493f4641f10.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/64a26ac5540c5493f4641f10.md @@ -32,39 +32,39 @@ assert.match(code, /border-radius:\s*190%\/190px\s*150px\s*0\s*0\s*;?/) - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
- -
- -
-
-
+
+
-
+ +
+ +
+
+
+
+
+
``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/64a3bcbc83e574b58c8ed048.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/64a3bcbc83e574b58c8ed048.md index 65c542e91d3..a8470024824 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/64a3bcbc83e574b58c8ed048.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/64a3bcbc83e574b58c8ed048.md @@ -43,53 +43,52 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-whiskers-right div') - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
- -
-
-
-
-
-
-
+
+
- -
+
-
-
-
+
+
+
- -
-
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/6676a8a8d9861319ee901a90.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/6676a8a8d9861319ee901a90.md index 80b98a7bf80..eba556521a9 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/6676a8a8d9861319ee901a90.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/6676a8a8d9861319ee901a90.md @@ -103,23 +103,23 @@ assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-ear')?.borderBo - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/6676a8b01e56ec1a1e07c202.md b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/6676a8b01e56ec1a1e07c202.md index e84d3bb8595..0bb543f4321 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/6676a8b01e56ec1a1e07c202.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-cat-painting/6676a8b01e56ec1a1e07c202.md @@ -73,23 +73,23 @@ assert.isEmpty(new __helpers.CSSHelp(document).getStyle('.cat-right-ear')?.backg - - fCC Cat Painting - + + fCC Cat Painting + -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
``` @@ -117,15 +117,15 @@ body { border-radius: 46%; } ---fcc-editable-region-- .cat-right-ear { +--fcc-editable-region-- height: 100px; width: 100px; background-color: white; border-left: 35px solid blue; border-right: 35px solid blue; border-top: 35px solid red; +--fcc-editable-region-- border-bottom: 35px solid red; } ---fcc-editable-region-- ``` diff --git a/curriculum/challenges/ukrainian/blocks/workshop-envelope-budget-app/69b2c970cb02ddaafff1c10d.md b/curriculum/challenges/ukrainian/blocks/workshop-envelope-budget-app/69b2c970cb02ddaafff1c10d.md index 7b55cc73f1f..d8164f087ad 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-envelope-budget-app/69b2c970cb02ddaafff1c10d.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-envelope-budget-app/69b2c970cb02ddaafff1c10d.md @@ -62,7 +62,7 @@ assert.notMatch(code, /<\/input>/); Елемент `input` має мати закриваючий тег `>`. ```js -assert.match(code, /HTMLString\s*=\s*`\n\s*Expense\s\$\{entryNumber\}\sName<\/label>\n\s*]*\/>/); +assert.match(code, /HTMLString\s*=\s*`\n\s*Expense\s\$\{entryNumber\}\sName<\/label>\n\s*]*>/); ``` # --seed-- diff --git a/curriculum/challenges/ukrainian/blocks/workshop-fcc-authors-page/69e14a2fd8ecf9210c0739ee.md b/curriculum/challenges/ukrainian/blocks/workshop-fcc-authors-page/69e14a2fd8ecf9210c0739ee.md index 7888ebe404a..8ec1f7b599f 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-fcc-authors-page/69e14a2fd8ecf9210c0739ee.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-fcc-authors-page/69e14a2fd8ecf9210c0739ee.md @@ -11,6 +11,12 @@ dashedName: step-26 Додайте виклик функції `initialFetch` у вказаному місці в редакторі. +# --before-all-- + +```js +window.fetch = () => Promise.resolve({json: () => Promise.resolve([{ author: 'Whoever', image: 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==', url: "http://not-a-real-url.nowhere/", bio: 'words go here' }])}); +``` + # --hints-- Ви повинні викликати `initialFetch` без аргументів. diff --git a/curriculum/challenges/ukrainian/blocks/workshop-fortune-teller-app/68ded620ab19272a3fa97592.md b/curriculum/challenges/ukrainian/blocks/workshop-fortune-teller-app/68ded620ab19272a3fa97592.md index 4a341ee507b..480bf1416df 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-fortune-teller-app/68ded620ab19272a3fa97592.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-fortune-teller-app/68ded620ab19272a3fa97592.md @@ -73,10 +73,9 @@ assert.isTrue(renderCard.hasReturnAnnotation("string")); Ваша функція `renderCard` має повертати шаблонний літерал. ```js -assert.match( - __helpers.removeJSComments(code), - /renderCard\s*=\s*\([^)]*\)\s*:\s*string\s*=>\s*(?:\{\s*return\s*)?`/ -); +const explorer = await __helpers.Explorer(code); +const { renderCard } = explorer.allFunctions; +assert.match(__helpers.removeJSComments(renderCard.toString()), /(?:return|=>)\s*`/); ``` # --seed-- diff --git a/curriculum/challenges/ukrainian/blocks/workshop-fortune-teller-app/68ed4621677e86eeefa59fe6.md b/curriculum/challenges/ukrainian/blocks/workshop-fortune-teller-app/68ed4621677e86eeefa59fe6.md index cb81fa2bf01..9cb4e679424 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-fortune-teller-app/68ed4621677e86eeefa59fe6.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-fortune-teller-app/68ed4621677e86eeefa59fe6.md @@ -15,8 +15,8 @@ dashedName: step-26 ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.initializeEventListeners.toString(); -assert.match(method, /initializeEventListeners\s*\(\s*\)\s*:\s*void/); +const { initializeEventListeners } = explorer.classes.Game?.methods ?? {}; +assert.isTrue(initializeEventListeners?.hasReturnAnnotation("void")); ``` # --seed-- diff --git a/curriculum/challenges/ukrainian/blocks/workshop-fortune-teller-app/68ee6c4b4c764b62d77df717.md b/curriculum/challenges/ukrainian/blocks/workshop-fortune-teller-app/68ee6c4b4c764b62d77df717.md index a93fb5d1117..634e3fb761e 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-fortune-teller-app/68ee6c4b4c764b62d77df717.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-fortune-teller-app/68ee6c4b4c764b62d77df717.md @@ -17,16 +17,30 @@ dashedName: step-31 ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.singleCardSelected.toString(); -assert.match(method, /const\s+isReversed\s*=/); +const { singleCardSelected } = explorer.classes.Game?.methods ?? {}; +const { isReversed } = singleCardSelected?.variables ?? {}; +assert.exists(isReversed); ``` Ваша змінна `isReversed` має використовувати `Math.random()` для випадкового визначення, чи карта перевернута. ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.singleCardSelected.toString(); -assert.match(method, /isReversed\s*=\s*Math\.random\s*\(\s*\)\s*<\s*0\.5/); +const { singleCardSelected } = explorer.classes.Game?.methods ?? {}; +const { isReversed } = singleCardSelected?.variables ?? {}; + +const validForms = [ + 'Math.random() < 0.5', + 'Math.random() > 0.5', + 'Math.random() <= 0.5', + 'Math.random() >= 0.5', + '0.5 < Math.random()', + '0.5 > Math.random()', + '0.5 <= Math.random()', + '0.5 >= Math.random()' +]; + +assert.isTrue(validForms.some((form) => isReversed?.value.matches(form))); ``` # --seed-- diff --git a/curriculum/challenges/ukrainian/blocks/workshop-fortune-teller-app/68ee6c8c274515694ead0024.md b/curriculum/challenges/ukrainian/blocks/workshop-fortune-teller-app/68ee6c8c274515694ead0024.md index e2e457ae77f..df887c876c4 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-fortune-teller-app/68ee6c8c274515694ead0024.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-fortune-teller-app/68ee6c8c274515694ead0024.md @@ -7,7 +7,7 @@ dashedName: step-32 # --description-- -Прогноз має бути випадковим, тому потрібна допоміжна функція для вибору випадкового прогнозу. Оголосіть змінну з іменем `chosenCard` всередині методу `singleCardSelected`. Використайте метод `getRandomItem` для отримання випадкової карти та передайте `cards` як аргумент. +Прогноз має бути випадковим, тому потрібна допоміжна функція для вибору випадкового прогнозу. Оголосіть змінну з ім’ям `chosenCard` всередині методу `singleCardSelected`. Використайте функцію `getRandomItem`, щоб отримати випадкову карту, передавши `this.cards` як аргумент. # --hints-- @@ -15,22 +15,18 @@ dashedName: step-32 ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.singleCardSelected.toString(); -assert.match(method, /const\s+chosenCard\s*=/); +const { singleCardSelected } = explorer.classes.Game?.methods ?? {}; +const { chosenCard } = singleCardSelected?.variables ?? {}; +assert.exists(chosenCard); ``` Вашій змінній `chosenCard` має бути призначено значення через виклик `getRandomItem(this.cards)`. ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.singleCardSelected.toString(); -assert.match(method, /chosenCard\s*=\s*getRandomItem\s*\(\s*this\.cards\s*\)/); -``` - -Ви повинні передати `this.cards` як аргумент до `getRandomItem`. - -```js -assert.match(__helpers.removeJSComments(code), /getRandomItem\s*\(\s*this\.cards\s*\)/); +const { singleCardSelected } = explorer.classes.Game?.methods ?? {}; +const { chosenCard } = singleCardSelected?.variables ?? {}; +assert.isTrue(chosenCard?.value.matches("getRandomItem(this.cards)")); ``` # --seed-- diff --git a/curriculum/challenges/ukrainian/blocks/workshop-fortune-teller-app/68f1e43a5f890b51774d93c4.md b/curriculum/challenges/ukrainian/blocks/workshop-fortune-teller-app/68f1e43a5f890b51774d93c4.md index be12e2a3994..95db32215db 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-fortune-teller-app/68f1e43a5f890b51774d93c4.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-fortune-teller-app/68f1e43a5f890b51774d93c4.md @@ -15,22 +15,28 @@ dashedName: step-43 ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /const\s+target\s*=/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { target } = showFortune?.variables ?? {}; +assert.exists(target); ``` Вашій змінній `target` має бути призначене значення `e.target`. ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /target\s*=\s*e\.target/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { target } = showFortune?.variables ?? {}; +assert.isTrue(target?.value.matches("e.target")); ``` Після змінної `if` має бути порожня інструкція `target`. ```js -assert.match(__helpers.removeJSComments(code), /showFortune\s*\([^)]*\)\s*\{[\s\S]*?if\s*\(\s*\)\s*\{\s*\}/); +const explorer = await __helpers.Explorer(code); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +assert.exists(showFortune); +const method = __helpers.removeJSComments(showFortune.toString()); +assert.match(method, /target\s*=\s*e\.target[\s\S]*?if\s*\(\s*\)\s*\{\s*\}/); ``` # --seed-- diff --git a/curriculum/challenges/ukrainian/blocks/workshop-fortune-teller-app/68f1e6a98bc05e67cc2b85e6.md b/curriculum/challenges/ukrainian/blocks/workshop-fortune-teller-app/68f1e6a98bc05e67cc2b85e6.md index ca4d98d14cf..8663b7edc1f 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-fortune-teller-app/68f1e6a98bc05e67cc2b85e6.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-fortune-teller-app/68f1e6a98bc05e67cc2b85e6.md @@ -15,22 +15,18 @@ dashedName: step-45 ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /const\s+cardElement\s*=/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { cardElement } = showFortune?.variables ?? {}; +assert.exists(cardElement); ``` Ваш `cardElement` має використовувати `target?.closest`, щоб знайти `.card_container`. ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /cardElement\s*=\s*target\?\.closest\s*\(\s*['"]\.card_container['"]\s*\)/); -``` - -Ви повинні передати `.card_container` як аргумент до `closest`. - -```js -assert.match(__helpers.removeJSComments(code), /\.closest\s*\(\s*['"]\.card_container['"]\s*\)/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { cardElement } = showFortune?.variables ?? {}; +assert.isTrue(cardElement?.value.matches("target?.closest('.card_container')")); ``` # --seed-- diff --git a/curriculum/challenges/ukrainian/blocks/workshop-fortune-teller-app/68f1e852f705eb77f6bcb893.md b/curriculum/challenges/ukrainian/blocks/workshop-fortune-teller-app/68f1e852f705eb77f6bcb893.md index 84e74596b05..664b728174b 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-fortune-teller-app/68f1e852f705eb77f6bcb893.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-fortune-teller-app/68f1e852f705eb77f6bcb893.md @@ -15,28 +15,18 @@ dashedName: step-48 ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /const\s+cardId\s*=/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { cardId } = showFortune?.variables ?? {}; +assert.exists(cardId); ``` Вашій змінній `cardId` має бути призначене значення через виклик `cardElement.getAttribute("data-id")`. ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /cardId\s*=\s*cardElement\.getAttribute\s*\(\s*['"]data-id['"]\s*\)/); -``` - -Ви повинні використати метод `getAttribute` на `cardElement`. - -```js -assert.match(__helpers.removeJSComments(code), /cardElement\.getAttribute\s*\(/); -``` - -Ви повинні передати `'data-id'` у `getAttribute`. - -```js -assert.match(__helpers.removeJSComments(code), /\.getAttribute\s*\(\s*['"]data-id['"]\s*\)/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { cardId } = showFortune?.variables ?? {}; +assert.isTrue(cardId?.value.matches('cardElement.getAttribute("data-id")')); ``` # --seed-- diff --git a/curriculum/challenges/ukrainian/blocks/workshop-fortune-teller-app/68f1e8de2731b07d62e738d2.md b/curriculum/challenges/ukrainian/blocks/workshop-fortune-teller-app/68f1e8de2731b07d62e738d2.md index cc11eebfdfe..f0d6e9a7935 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-fortune-teller-app/68f1e8de2731b07d62e738d2.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-fortune-teller-app/68f1e8de2731b07d62e738d2.md @@ -15,28 +15,38 @@ dashedName: step-49 ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /const\s+foundCard\s*=/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { foundCard } = showFortune?.variables ?? {}; +assert.exists(foundCard); ``` -Вашій `foundCard` має бути призначено результат виклику `find` на `this.cards` з правильним параметром функції зворотного виклику. +Ваш `foundCard` має бути призначений шляхом виклику `find` на `this.cards`, передаючи функцію зворотного виклику, яка приймає параметр `card` і повертає результат порівняння `card.name_short` з `cardId` за допомогою суворої рівності. ```js const explorer = await __helpers.Explorer(code); -const method = explorer.classes.Game.methods.showFortune.toString(); -assert.match(method, /foundCard\s*=\s*this\.cards\.find\s*\(/); -``` - -Функція зворотного виклику `find` має мати параметр з іменем `card`. - -```js -assert.match(__helpers.removeJSComments(code), /cards\.find\s*\(\s*\(\s*card\s*\)\s*=>/); -``` - -Всередині функції зворотного виклику `card.name_short` має бути порівняно з `cardId`. - -```js -assert.match(__helpers.removeJSComments(code), /card\.name_short\s*===?\s*cardId/); +const { showFortune } = explorer.classes.Game?.methods ?? {}; +const { foundCard } = showFortune?.variables ?? {}; + +const validForms = [ + 'this.cards.find((card) => card.name_short === cardId)', + 'this.cards.find((card) => { return card.name_short === cardId; })', + 'this.cards.find((card) => cardId === card.name_short)', + 'this.cards.find((card) => { return cardId === card.name_short; })', + 'this.cards.find(card => card.name_short === cardId)', + 'this.cards.find(card => { return card.name_short === cardId; })', + 'this.cards.find(card => cardId === card.name_short)', + 'this.cards.find(card => { return cardId === card.name_short; })', + 'this.cards.find((card: Card) => card.name_short === cardId)', + 'this.cards.find((card: Card) => { return card.name_short === cardId; })', + 'this.cards.find((card: Card) => cardId === card.name_short)', + 'this.cards.find((card: Card) => { return cardId === card.name_short; })', + 'this.cards.find(function (card) { return card.name_short === cardId; })', + 'this.cards.find(function (card) { return cardId === card.name_short; })', + 'this.cards.find(function (card: Card) { return card.name_short === cardId; })', + 'this.cards.find(function (card: Card) { return cardId === card.name_short; })' +]; + +assert.isTrue(validForms.some((form) => foundCard?.value.matches(form))); ``` # --seed-- diff --git a/curriculum/challenges/ukrainian/blocks/workshop-greeting-bot/66ad8ab945d266383f318cbf.md b/curriculum/challenges/ukrainian/blocks/workshop-greeting-bot/66ad8ab945d266383f318cbf.md index 55d7a536a06..4f3cc2dacae 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-greeting-bot/66ad8ab945d266383f318cbf.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-greeting-bot/66ad8ab945d266383f318cbf.md @@ -30,7 +30,11 @@ assert.lengthOf(logSpy.calls, 2); Ваша інструкція `console` має містити повідомлення `"I am excited to talk to you."`. Не забудьте лапки. ```js -assert.deepInclude(logSpy.calls, ["I am excited to talk to you."]); +assert.isTrue( + logSpy.calls.some( + (call) => /I\s+am\s+excited\s+to\s+talk\s+to\s+you\s*\./.test(call[0]) + ) +); ``` # --seed-- diff --git a/curriculum/challenges/ukrainian/blocks/workshop-greeting-bot/66ad9c633fa26d3c1475eae3.md b/curriculum/challenges/ukrainian/blocks/workshop-greeting-bot/66ad9c633fa26d3c1475eae3.md index 8c023f1fcb9..2d9fae1f53c 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-greeting-bot/66ad9c633fa26d3c1475eae3.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-greeting-bot/66ad9c633fa26d3c1475eae3.md @@ -28,7 +28,11 @@ assert.lengthOf(logSpy.calls, 3); Ваша інструкція `console` має містити повідомлення `"Allow me to introduce myself."`. Не забудьте лапки. ```js -assert.deepInclude(logSpy.calls, ["Allow me to introduce myself."]); +assert.isTrue( + logSpy.calls.some( + (call) => /Allow\s+me\s+to\s+introduce\s+myself\s*\./.test(call[0]) + ) +); ``` # --seed-- diff --git a/curriculum/challenges/ukrainian/blocks/workshop-greeting-bot/66add47d27763c4862492c8c.md b/curriculum/challenges/ukrainian/blocks/workshop-greeting-bot/66add47d27763c4862492c8c.md index 5da06802e13..185aaeee603 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-greeting-bot/66add47d27763c4862492c8c.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-greeting-bot/66add47d27763c4862492c8c.md @@ -76,12 +76,10 @@ console.log(favoriteSubjectSentence); ```js console.log("Hi there!"); console.log("I am excited to talk to you."); - let bot; -let botLocation; - bot = "teacherBot"; -botLocation = "the universe"; + +let botLocation = "the universe"; console.log("Allow me to introduce myself."); diff --git a/curriculum/challenges/ukrainian/blocks/workshop-hotel-feedback-form/66a93bbe65a26169dbf3bc39.md b/curriculum/challenges/ukrainian/blocks/workshop-hotel-feedback-form/66a93bbe65a26169dbf3bc39.md index 29f83db6207..8151a1ddffa 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-hotel-feedback-form/66a93bbe65a26169dbf3bc39.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-hotel-feedback-form/66a93bbe65a26169dbf3bc39.md @@ -13,7 +13,7 @@ dashedName: step-10 # --hints-- -У вас має бути елемент `label`. +У вашому `fieldset` має бути другий `label` елемент. ```js assert.lengthOf(document.querySelectorAll('fieldset label'), 2); diff --git a/curriculum/challenges/ukrainian/blocks/workshop-hotel-feedback-form/66a9401c9d660d6bb15993e2.md b/curriculum/challenges/ukrainian/blocks/workshop-hotel-feedback-form/66a9401c9d660d6bb15993e2.md index 9c44fb77966..bcb80f14282 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-hotel-feedback-form/66a9401c9d660d6bb15993e2.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-hotel-feedback-form/66a9401c9d660d6bb15993e2.md @@ -15,7 +15,7 @@ dashedName: step-13 # --hints-- -У вас має бути елемент `label`. +У вашому `fieldset` має бути третій `label` елемент. ```js assert.lengthOf(document.querySelectorAll('fieldset label'), 3); diff --git a/curriculum/challenges/ukrainian/blocks/workshop-hotel-feedback-form/66a9419e2d18476c645ce693.md b/curriculum/challenges/ukrainian/blocks/workshop-hotel-feedback-form/66a9419e2d18476c645ce693.md index c0a557f3bd0..1fc36ba77f3 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-hotel-feedback-form/66a9419e2d18476c645ce693.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-hotel-feedback-form/66a9419e2d18476c645ce693.md @@ -17,7 +17,7 @@ dashedName: step-14 Атрибути `min` і `max` використовуються, щоб встановити мінімальне та максимальне значення, які можна ввести у поле введення. -Під вашим елементом `label` додайте поле введення з атрибутом `type`, встановленим у `"number"`, і ідентифікатором `id`, рівним `"age"`. +Під вашим елементом `label` додайте `input` з атрибутом `type`, встановленим у `"number"`, та `id` зі значенням `"age"`. Атрибут `name` має бути встановлений у `"age"`, атрибут `min` — у `"3"`, а атрибут `max` — у `"100"`. @@ -29,13 +29,13 @@ dashedName: step-14 assert.isNotNull(document.querySelector('label + input[type="number"]')); ``` -Ваше числове поле введення `input` має мати ідентифікатор `id`, рівний `age`. +Ваше числове `input` має мати `id` зі значенням `"age"`. ```js assert.isNotNull(document.querySelector('label + input#age')); ``` -Ваше числове поле введення `input` має мати атрибут `name`, встановлений у `age`. +Ваш числовий `input` має мати атрибут `name`, встановлений у `"age"`. ```js assert.isNotNull(document.querySelector('label + input[name="age"]')); diff --git a/curriculum/challenges/ukrainian/blocks/workshop-hotel-feedback-form/67a51d3a8a6fe123b77b0c6e.md b/curriculum/challenges/ukrainian/blocks/workshop-hotel-feedback-form/67a51d3a8a6fe123b77b0c6e.md index 96d0df98005..eae9e89fb9f 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-hotel-feedback-form/67a51d3a8a6fe123b77b0c6e.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-hotel-feedback-form/67a51d3a8a6fe123b77b0c6e.md @@ -7,11 +7,11 @@ dashedName: step-12 # --description-- -Елементи `input` можуть мати атрибут `size`. Цей атрибут визначає кількість символів, які мають бути видимими під час введення користувачем у поле вводу. Значення `size` має бути невід’ємним цілим числом більшим за нуль. Якщо `size` не вказано або вказано з некоректним значенням, ширина поля вводу буде встановлена за замовчуванням браузером. +`input` елементи можуть мати атрибут `size`. Цей атрибут визначає кількість символів, які мають бути видимими під час введення користувачем у `input`. Значення `size` має бути додатним цілим числом. Якщо `size` не вказано або вказано з недійсним значенням, `input` матиме ширину за замовчуванням, встановлену браузером. ```html - - + + ``` Додайте атрибут `size` з значенням `"20"` для полів введення імені та е-пошти. diff --git a/curriculum/challenges/ukrainian/blocks/workshop-plant-nursery-catalog/6734a772196245601e4b80e0.md b/curriculum/challenges/ukrainian/blocks/workshop-plant-nursery-catalog/6734a772196245601e4b80e0.md index 704dbacdd59..e78df2f20f1 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-plant-nursery-catalog/6734a772196245601e4b80e0.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-plant-nursery-catalog/6734a772196245601e4b80e0.md @@ -9,7 +9,7 @@ dashedName: step-10 Коли потрібно отримати елемент зі спроєктованої структури, ви можете використати метод `get`. Він приймає ключ як аргумент і повертає пов’язане значення. -Використайте метод `get`, щоб отримати значення ключа `ballerina` зі свого каталогу, призначте його змінній з ім’ям `getBallerina`. Потім виведіть цю нову змінну в консоль. +Використайте `get` метод, щоб отримати значення ключа `ballerina` з вашого каталогу, і призначте його змінній з ім'ям `getBallerina`. Потім виведіть вашу нову змінну в консоль. # --hints-- @@ -22,7 +22,10 @@ assert.exists(getBallerina); Значення вашої змінної `getBallerina` має бути `catalog.get(ballerina)`. ```js -assert.match(__helpers.removeJSComments(code), /(const|let|var)\s+getBallerina\s*=\s*catalog\s*\.\s*get\s*\(\s*ballerina\s*\)/); +const explorer = await __helpers.Explorer(code); +const { getBallerina } = explorer.variables; +assert.isTrue(getBallerina?.value.matches('catalog.get(ballerina)') +); ``` Виведіть у консоль змінну `getBallerina`. diff --git a/curriculum/challenges/ukrainian/blocks/workshop-plant-nursery-catalog/6737a1a073a0d14c6544d301.md b/curriculum/challenges/ukrainian/blocks/workshop-plant-nursery-catalog/6737a1a073a0d14c6544d301.md index dfe67f899f5..ed477f27468 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-plant-nursery-catalog/6737a1a073a0d14c6544d301.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-plant-nursery-catalog/6737a1a073a0d14c6544d301.md @@ -23,7 +23,9 @@ assert.exists(plantsSet); Ви маєте викликати `displayPlantsSet` і призначити це `plantsSet`. ```js -assert.match(__helpers.removeJSComments(code), /(const|let|var)\s+plantsSet\s*=\s*displayPlantsSet\s*\(\s*\)/) +const explorer = await __helpers.Explorer(code); +const { plantsSet } = explorer.variables; +assert.isTrue(plantsSet?.value.matches('displayPlantsSet()')); ``` Виведіть `plantsSet` у консоль. diff --git a/curriculum/challenges/ukrainian/blocks/workshop-reusable-mega-navbar/6740495ba48aa94e5667b436.md b/curriculum/challenges/ukrainian/blocks/workshop-reusable-mega-navbar/6740495ba48aa94e5667b436.md index 9bbc6f8f15c..d64b8d780be 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-reusable-mega-navbar/6740495ba48aa94e5667b436.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-reusable-mega-navbar/6740495ba48aa94e5667b436.md @@ -10,7 +10,7 @@ demoType: onLoad У цьому практичному занятті ви потренуєтеся працювати з функціональними компонентами React, створюючи багаторазову панель навігації. -Весь CSS уже наданий, тож ви можете зосередитися на створенні панелі навігації. +Весь CSS уже наданий, щоб ви могли зосередитися на створенні панелі навігації. Почніть із визначення функціонального компонента `Navbar`. На наступному кроці ви почнете будувати компонент за допомогою JSX. @@ -24,7 +24,7 @@ export function multiply(a, b) { } ``` -Також функціональні компоненти React повинні починатися з великої літери, бо це допомагає відрізнити їх від звичайних HTML-елементів. +Також функціональні компоненти React повинні починатися з великої літери, оскільки саме так React відрізняє їх від звичайних HTML-елементів. # --hints-- diff --git a/curriculum/challenges/ukrainian/blocks/workshop-reusable-mega-navbar/67457ff2dc531fbed928a0f0.md b/curriculum/challenges/ukrainian/blocks/workshop-reusable-mega-navbar/67457ff2dc531fbed928a0f0.md index 27df957733d..0a9186322ea 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-reusable-mega-navbar/67457ff2dc531fbed928a0f0.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-reusable-mega-navbar/67457ff2dc531fbed928a0f0.md @@ -24,10 +24,9 @@ const App = () => { } ``` - Всередині компонента `Navbar` поверніть елемент `nav`, який має атрибут `className` зі значенням `navbar`. -Причина, чому тут використовується `className` замість `class`, полягає в тому, що `class` — це зарезервоване ключове слово в JavaScript. Тому React використовує `className` як спосіб застосувати класи до елементів. +`className` використовується тут замість `class`, тому що `class` є ключовим словом у JavaScript. Тож React використовує `className` як спосіб застосувати класи до елементів. # --hints-- @@ -37,7 +36,7 @@ const App = () => { assert.exists(document.querySelector('nav')); ``` -Ваш елемент `nav` має мати атрибут `className` зі значенням `navbar`. +Ваш `nav` елемент повинен мати `className` зі значенням `navbar`. ```js assert.equal(document.querySelector('nav')?.getAttribute('class'), 'navbar'); diff --git a/curriculum/challenges/ukrainian/blocks/workshop-reusable-mega-navbar/6745c732dbeb7c04f346e6f7.md b/curriculum/challenges/ukrainian/blocks/workshop-reusable-mega-navbar/6745c732dbeb7c04f346e6f7.md index b45265331ae..c2842e2d4c5 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-reusable-mega-navbar/6745c732dbeb7c04f346e6f7.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-reusable-mega-navbar/6745c732dbeb7c04f346e6f7.md @@ -7,7 +7,7 @@ dashedName: step-3 # --description-- -Створіть елемент `ul` всередині елемента `nav`. Усередині цього елемента `ul` створіть три елементи списку. +Створіть `ul` елемент всередині вашого `nav` елемента. Всередині цього `ul` елемента створіть три `li` елементи. # --hints-- diff --git a/curriculum/challenges/ukrainian/blocks/workshop-reusable-mega-navbar/6745c89fba004707ded84453.md b/curriculum/challenges/ukrainian/blocks/workshop-reusable-mega-navbar/6745c89fba004707ded84453.md index 1014aaa490f..d2ff69ff514 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-reusable-mega-navbar/6745c89fba004707ded84453.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-reusable-mega-navbar/6745c89fba004707ded84453.md @@ -7,17 +7,17 @@ dashedName: step-5 # --description-- -Створіть елемент посилання всередині першого елемента `li`. Додайте елементу `a` атрибут `href` зі значенням `#` та текст `Dashboard`. +Створіть `a` елемент всередині вашого першого `li` елемента. Додайте йому атрибут `href` зі значенням `#` та текст `Dashboard`. # --hints-- -Ви повинні створити елемент `a` всередині першого елемента списку. +Ви повинні створити `a` елемент всередині вашого першого `li` елемента. ```js assert.exists(document.querySelector('li a')); ``` -Ваш елемент `a` має мати атрибут `href`, встановлений у `#`. +Ваш `a` елемент має мати атрибут `href` зі значенням `#`. ```js assert.equal(document.querySelector('a')?.getAttribute('href'), '#'); diff --git a/curriculum/challenges/ukrainian/blocks/workshop-reusable-mega-navbar/6745cebbf97ef2129f3b9bab.md b/curriculum/challenges/ukrainian/blocks/workshop-reusable-mega-navbar/6745cebbf97ef2129f3b9bab.md index dd9fb944835..edf9439475a 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-reusable-mega-navbar/6745cebbf97ef2129f3b9bab.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-reusable-mega-navbar/6745cebbf97ef2129f3b9bab.md @@ -7,17 +7,17 @@ dashedName: step-6 # --description-- -Створіть ще один елемент `a` всередині другого елемента `li`. Додайте йому атрибут `href` зі значенням `#` та текст `Widgets`. +Створіть ще один `a` елемент всередині другого `li` елемента. Додайте йому атрибут `href` зі значенням `#` і текст `Widgets`. # --hints-- -Ви повинні створити елемент `a` всередині другого елемента списку. +Ви повинні створити `a` елемент всередині другого `li` елемента. ```js assert.lengthOf(document.querySelectorAll('li a'), 2); ``` -Ваш елемент `a` має мати атрибут `href`, встановлений у `#`. +Ваш `a` елемент має мати атрибут `href` зі значенням `#`. ```js assert.equal(document.querySelectorAll('a')[1]?.getAttribute('href'), '#'); diff --git a/curriculum/challenges/ukrainian/blocks/workshop-reusable-mega-navbar/6745d799beeb822076a4da9d.md b/curriculum/challenges/ukrainian/blocks/workshop-reusable-mega-navbar/6745d799beeb822076a4da9d.md index 68d7bdc1825..a167214e185 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-reusable-mega-navbar/6745d799beeb822076a4da9d.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-reusable-mega-navbar/6745d799beeb822076a4da9d.md @@ -7,19 +7,19 @@ dashedName: step-7 # --description-- -Всередині третього елемента списку створіть елемент `button` з атрибутом `aria-expanded`, встановленим у `false`. Також встановіть текст `button` на `Apps`. +Всередині вашого третього `li` елемента створіть `button` елемент з атрибутом `aria-expanded`, значення якого — `false`. Також встановіть текст `button` на `Apps`. Атрибут `aria-expanded` повідомлятиме користувачам читачів екрана, що кнопка відкриває розгорнуте підменю. # --hints-- -Ви повинні створити елемент `button` всередині третього елемента списку. +Ви повинні створити `button` елемент всередині вашого третього `li` елемента. ```js assert.exists(document.querySelector('li:nth-of-type(3) button')); ``` -Ваш елемент `button` має мати атрибут `aria-expanded`, встановлений у `false`. +Ваш `button` елемент має мати атрибут `aria-expanded` зі значенням `false`. ```js assert.equal( diff --git a/curriculum/challenges/ukrainian/blocks/workshop-reusable-mega-navbar/6745d9df333efe2543a1f457.md b/curriculum/challenges/ukrainian/blocks/workshop-reusable-mega-navbar/6745d9df333efe2543a1f457.md index d0a1e146745..a175918080e 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-reusable-mega-navbar/6745d9df333efe2543a1f457.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-reusable-mega-navbar/6745d9df333efe2543a1f457.md @@ -7,7 +7,7 @@ dashedName: step-8 # --description-- -Ще всередині третього елемента `li` створіть елемент `ul` для спливаючого вікна. Дайте йому атрибут `className` зі значенням `sub-menu` та атрибут `aria-label` зі значенням `Apps`. +Все ще всередині вашого третього `li` елемента створіть `ul` елемент для спливаючого вікна. Дайте йому `className` зі значенням `sub-menu` та `aria-label` зі значенням `Apps`. # --hints-- @@ -17,13 +17,13 @@ dashedName: step-8 assert.exists(document.querySelector('li ul')); ``` -Ви повинні встановити атрибут `className` вашого елемента `ul` у значення `sub-menu`. +Ваш `ul` елемент повинен мати `className` зі значенням `sub-menu`. ```js assert.equal(document.querySelector('li ul')?.getAttribute('class'), 'sub-menu'); ``` -Ви повинні встановити атрибут `aria-label` вашого елемента `ul` у значення `Apps`. +Ваш `ul` елемент повинен мати `aria-label` зі значенням `Apps`. ```js assert.equal(document.querySelector('li ul')?.getAttribute('aria-label'), 'Apps'); diff --git a/curriculum/challenges/ukrainian/blocks/workshop-reusable-mega-navbar/6745dce846995b2a466594be.md b/curriculum/challenges/ukrainian/blocks/workshop-reusable-mega-navbar/6745dce846995b2a466594be.md index 9b0aa5b838d..b59173611a8 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-reusable-mega-navbar/6745dce846995b2a466594be.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-reusable-mega-navbar/6745dce846995b2a466594be.md @@ -7,11 +7,11 @@ dashedName: step-9 # --description-- -Створіть три нові елементи списку всередині вашого елемента `ul.sub-menu`. +Створіть три нові `li` елементи всередині вашого `ul` елемента з `className` рівним `sub-menu`. # --hints-- -Ви маєте створити три нові елементи списку всередині вашого елемента `ul` з `className` `sub-menu`. +Ви повинні створити три нові `li` елементи всередині вашого `ul` елемента з `className` рівним `sub-menu`. ```js assert.lengthOf(document.querySelectorAll('.sub-menu li'), 3); diff --git a/curriculum/challenges/ukrainian/blocks/workshop-reusable-mega-navbar/6745de9ce925b92d72df713a.md b/curriculum/challenges/ukrainian/blocks/workshop-reusable-mega-navbar/6745de9ce925b92d72df713a.md index 450c6bed2cc..04c76e4b351 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-reusable-mega-navbar/6745de9ce925b92d72df713a.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-reusable-mega-navbar/6745de9ce925b92d72df713a.md @@ -7,11 +7,11 @@ dashedName: step-10 # --description-- -Всередині кожного елемента `li` створіть елемент посилання з атрибутом `href`, встановленим у `#`. +Всередині кожного з трьох нових `li` елементів створіть `a` елемент з атрибутом `href`, значення якого — `#`. # --hints-- -Ви маєте створити новий елемент `a` всередині кожного елемента списку та встановити його атрибут `href` у `#`. +Ви маєте створити новий `a` елемент з атрибутом `href`, значення якого — `#`, всередині кожного з трьох нових `li` елементів. ```js assert.equal(document.querySelectorAll('li a')[2]?.getAttribute('href'), '#'); diff --git a/curriculum/challenges/ukrainian/blocks/workshop-reusable-mega-navbar/6745e2aca895c935168e7d91.md b/curriculum/challenges/ukrainian/blocks/workshop-reusable-mega-navbar/6745e2aca895c935168e7d91.md index 92ebd46026b..6f8f00e42e4 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-reusable-mega-navbar/6745e2aca895c935168e7d91.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-reusable-mega-navbar/6745e2aca895c935168e7d91.md @@ -7,25 +7,25 @@ dashedName: step-11 # --description-- -Щоб завершити, встановіть текст `Calendar` для першого елемента посилання, `Chat` для другого та `Email` для третього. +Щоб завершити, встановіть текст першого `a` елемента на `Calendar`, другого — на `Chat`, а третього — на `Email`. -Таким чином, ваш мегакомпонент панелі навігації готовий! +От і все, ваш компонент `Navbar` готовий! # --hints-- -Ви повинні встановити текст `Calendar` для першого елемента посилання. +Ви повинні встановити текст першого `a` елемента на `Calendar`. ```js assert.equal(document.querySelectorAll('li a')[2]?.textContent, 'Calendar'); ``` -Ви повинні встановити текст `Chat` для другого елемента посилання. +Ви повинні встановити текст другого `a` елемента на `Chat`. ```js assert.equal(document.querySelectorAll('li a')[3]?.textContent, 'Chat'); ``` -Ви повинні встановити текст `Email` для третього елемента посилання. +Ви повинні встановити текст третього `a` елемента на `Email`. ```js assert.equal(document.querySelectorAll('li a')[4]?.textContent, 'Email'); diff --git a/curriculum/challenges/ukrainian/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165b.md b/curriculum/challenges/ukrainian/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165b.md index ce35646777b..e79ae09664c 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165b.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165b.md @@ -7,7 +7,7 @@ dashedName: step-5 # --description-- -У вашому операторі return замініть порожній рядок на елемент `div` з властивістю `className`, значення якої `flex-container`. +Всередині інструкції `return` замініть порожній рядок на елемент `div` з `className` рівним `flex-container`. # --hints-- @@ -26,7 +26,7 @@ dashedName: step-5 assert.lengthOf(testElem.children, 1); ``` -Ваш `div` має мати властивість `className` зі значенням `flex-container`. +Ваш `div` має мати `className` зі значенням `flex-container`. ```js const testElem = await __helpers.prepTestComponent(window.index.App); diff --git a/curriculum/challenges/ukrainian/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165c.md b/curriculum/challenges/ukrainian/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165c.md index f8a26c792c4..7a571bd45ff 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165c.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-reusable-profile-card-component/674ef2d357676e50e469165c.md @@ -7,7 +7,7 @@ dashedName: step-6 # --description-- -Тепер вставте компонент `Card` у ваш компонент `App`. Передайте йому проп `name` зі значенням `"Mark"`, проп `title` зі значенням `"Front-End developer"` та проп `bio` зі значенням `"I like to work with different front-end technologies and play video games."` +Тепер додайте компонент `Card` у свій компонент `App`. Передайте йому проп `name` зі значенням `"Mark"`, проп `title` зі значенням `"Front-End developer"` та проп `bio` зі значенням `"I like to work with different front-end technologies and play video games."` # --hints-- diff --git a/curriculum/challenges/ukrainian/blocks/workshop-reusable-profile-card-component/68720c179cd34be6793bfdf6.md b/curriculum/challenges/ukrainian/blocks/workshop-reusable-profile-card-component/68720c179cd34be6793bfdf6.md index 53d7dfec6d2..def689c6367 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-reusable-profile-card-component/68720c179cd34be6793bfdf6.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-reusable-profile-card-component/68720c179cd34be6793bfdf6.md @@ -9,7 +9,7 @@ dashedName: step-8 Хоч ваш застосунок працює як очікувалося, зазвичай ви не додавали б кілька `Card` компонентів вручну таким чином. -Видаліть три `` компоненти всередині `
` елемента. У наступних кількох кроках ви створите масив даних і використаєте `map()` функцію, щоб відтворити `Card` компоненти — це більш поширений підхід у React. +Видаліть три компоненти `` всередині елемента `
`. У наступних кількох кроках ви створите масив даних і використаєте метод `map()` для відтворення компонентів `Card`, що є більш загальним підходом у React. # --hints-- diff --git a/curriculum/challenges/ukrainian/blocks/workshop-reusable-profile-card-component/68778af56eb5d980a4e2daed.md b/curriculum/challenges/ukrainian/blocks/workshop-reusable-profile-card-component/68778af56eb5d980a4e2daed.md index 83ed13bfae6..c6b43617e95 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-reusable-profile-card-component/68778af56eb5d980a4e2daed.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-reusable-profile-card-component/68778af56eb5d980a4e2daed.md @@ -30,7 +30,7 @@ const profilesVal = eval(profiles?.value.toString()); assert.isArray(profilesVal); ``` -Ваш масив profiles має містити об’єкт, який включає всі необхідні пропси: `id`, `name`, `title` і `bio`. +Ваш масив `profiles` має містити об’єкт, який включає всі необхідні пропи: `id`, `name`, `title` і `bio`. ```js const explorer = await __helpers.Explorer(code); diff --git a/curriculum/challenges/ukrainian/blocks/workshop-reusable-profile-card-component/68779156bd3704b727ba5f38.md b/curriculum/challenges/ukrainian/blocks/workshop-reusable-profile-card-component/68779156bd3704b727ba5f38.md index 9587a4ce976..2224f39fa4f 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-reusable-profile-card-component/68779156bd3704b727ba5f38.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-reusable-profile-card-component/68779156bd3704b727ba5f38.md @@ -7,7 +7,7 @@ dashedName: step-10 # --description-- -Як ви пам’ятаєте з попередніх уроків, ви можете використовувати метод `map` для ітерування по різних об’єктах і динамічного відтворення компонентів ось так: +Як ви пам’ятаєте з попередніх уроків, ви можете використовувати метод `map()` щоб ітерувати по різних об’єктах і динамічно відтворювати компоненти ось так: ```jsx export function App() { diff --git a/curriculum/challenges/ukrainian/blocks/workshop-reusable-profile-card-component/687799aefd1f2af1704065d0.md b/curriculum/challenges/ukrainian/blocks/workshop-reusable-profile-card-component/687799aefd1f2af1704065d0.md index ccf47ce52ee..02cbb642b2f 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-reusable-profile-card-component/687799aefd1f2af1704065d0.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-reusable-profile-card-component/687799aefd1f2af1704065d0.md @@ -23,7 +23,7 @@ dashedName: step-11
``` -Проп `key` допомагає React визначати, які елементи змінилися, додалися або були видалені. Це покращує продуктивність і дозволяє ефективніше оновлювати вміст. +Проп `key` допомагає React визначити, які елементи змінилися, були додані або видалені. Це покращує продуктивність і дозволяє ефективніше оновлювати компоненти. Оновіть компонент `Card`, додавши проп `key` зі значенням `profile.id`. diff --git a/curriculum/challenges/ukrainian/blocks/workshop-toggle-text-app/67cd46ec4ec904186ad52ba5.md b/curriculum/challenges/ukrainian/blocks/workshop-toggle-text-app/67cd46ec4ec904186ad52ba5.md index 617a3c9be1c..4765844e66d 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-toggle-text-app/67cd46ec4ec904186ad52ba5.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-toggle-text-app/67cd46ec4ec904186ad52ba5.md @@ -7,7 +7,7 @@ dashedName: step-3 # --description-- -Під вашим елементом `button` додайте абзац з ідентифікатором `id` зі значенням `message` і текстом `I love freeCodeCamp!`. +Під вашим `button` елементом додайте абзац з `id` під назвою `message` та текстом `I love freeCodeCamp!`. # --hints-- @@ -17,7 +17,7 @@ dashedName: step-3 assert.exists(document.querySelector("p")); ``` -Ваш абзац має мати ідентифікатор `id` зі значенням `message`. +Ваш абзац повинен мати `id` під назвою `message`. ```js assert.exists(document.getElementById("message")) diff --git a/curriculum/challenges/ukrainian/blocks/workshop-toggle-text-app/67cd49e05693111a41771f29.md b/curriculum/challenges/ukrainian/blocks/workshop-toggle-text-app/67cd49e05693111a41771f29.md index 15fa06421a9..be555410f09 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-toggle-text-app/67cd49e05693111a41771f29.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-toggle-text-app/67cd49e05693111a41771f29.md @@ -19,7 +19,7 @@ const [user, setUser] = useState("Jessica"); Створіть нову змінну стану та функцію множини з іменами `isVisible` і `setIsVisible`. Не забудьте використати синтаксис деструктуризації масиву, як показано в прикладі. -Потім призначте хук `useState` з ініціальним значенням `false`. +Потім викличте хук `useState` з ініціальним значенням `false`. # --hints-- diff --git a/curriculum/challenges/ukrainian/blocks/workshop-toggle-text-app/67cd4fe67813f71c3479e64a.md b/curriculum/challenges/ukrainian/blocks/workshop-toggle-text-app/67cd4fe67813f71c3479e64a.md index 6de96e18ce0..00287bd17ee 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-toggle-text-app/67cd4fe67813f71c3479e64a.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-toggle-text-app/67cd4fe67813f71c3479e64a.md @@ -9,7 +9,7 @@ dashedName: step-6 Один зі способів показати текст абзацу — змінити ініціальне значення для гака `useState`. -Змініть поточне значення `useState` з `false` на `true`, і ви побачите, що текст абзацу тепер відображається на екрані. +Змініть ініціальне значення для `useState` з `false` на `true`. Якщо зробити це правильно, ви побачите, що текст абзацу тепер відображається на екрані. # --hints-- diff --git a/curriculum/challenges/ukrainian/blocks/workshop-toggle-text-app/67cd525b0e575b1e5abf4c03.md b/curriculum/challenges/ukrainian/blocks/workshop-toggle-text-app/67cd525b0e575b1e5abf4c03.md index 023a638a3cd..fd241b4d629 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-toggle-text-app/67cd525b0e575b1e5abf4c03.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-toggle-text-app/67cd525b0e575b1e5abf4c03.md @@ -7,7 +7,7 @@ dashedName: step-9 # --description-- -Як згадувалося раніше, функція set відповідає за оновлення стану. Загальний підхід при перемиканні між булевими значеннями стану полягає в оновленні стану таким чином: +Як згадувалося раніше, функція set відповідає за оновлення стану. Загальним підходом при перемиканні між булевими значеннями стану є оновлення стану таким чином: ```js const [isUserLoggedIn, setIsUserLoggedIn] = useState(false); @@ -16,7 +16,7 @@ const [isUserLoggedIn, setIsUserLoggedIn] = useState(false); setIsUserLoggedIn(!isUserLoggedIn); ``` -У наведеному прикладі використовується функція set, яку названо `setIsUserLoggedIn`, щоб оновити статус входу користувача. Загальноприйнято використовувати логічний оператор NOT (`!`) для перемикання між `true` та `false`. Оскільки ініціальне значення — `false`, застосування оператора `!` змінить його на `true`. +У наведеному вище прикладі використовується функція set з назвою `setIsUserLoggedIn` для оновлення статусу входу користувача. Загальною практикою є використання логічного оператора НЕ (`!`) для перемикання між `true` і `false`. Оскільки ініціальне значення — `false`, застосування оператора `!` змінить його на `true`. Всередині функції `handleToggleVisibility` використайте `setIsVisible` для оновлення стану видимості за допомогою логічного оператора NOT (`!`). diff --git a/curriculum/challenges/ukrainian/blocks/workshop-toggle-text-app/67cd57e96257ed1fabbe4879.md b/curriculum/challenges/ukrainian/blocks/workshop-toggle-text-app/67cd57e96257ed1fabbe4879.md index 359879230b1..0c72c5bc7bc 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-toggle-text-app/67cd57e96257ed1fabbe4879.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-toggle-text-app/67cd57e96257ed1fabbe4879.md @@ -27,7 +27,7 @@ function handleClick() { # --hints-- -Коли натискають на `toggle-button`, на екрані має з’явитися повідомлення `"I love freeCodeCamp!"`. +Ваше повідомлення `I love freeCodeCamp!` має з’явитися на екрані, коли натиснути на `toggle-button`. ```js const abuseState = __helpers.spyOn(React, "useState"); diff --git a/curriculum/challenges/ukrainian/blocks/workshop-toggle-text-app/67cd59f6581d3a20c9cc6460.md b/curriculum/challenges/ukrainian/blocks/workshop-toggle-text-app/67cd59f6581d3a20c9cc6460.md index 342a1003190..d2f6944b741 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-toggle-text-app/67cd59f6581d3a20c9cc6460.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-toggle-text-app/67cd59f6581d3a20c9cc6460.md @@ -9,7 +9,7 @@ dashedName: step-11 Зараз саме час побачити оновлене значення `isVisible`. -Під `setIsVisible(!isVisible);` виведіть у консоль змінну стану `isVisible`. +Під рядком `setIsVisible(!isVisible);` виведіть у консоль змінну стану `isVisible`. Відкрийте консоль, і ви помітите, що значення не таке, як ви очікували. diff --git a/curriculum/challenges/ukrainian/blocks/workshop-toggle-text-app/67cd5bace629fa219a70aa6d.md b/curriculum/challenges/ukrainian/blocks/workshop-toggle-text-app/67cd5bace629fa219a70aa6d.md index 11faa928edf..abbcb6286f8 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-toggle-text-app/67cd5bace629fa219a70aa6d.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-toggle-text-app/67cd5bace629fa219a70aa6d.md @@ -9,7 +9,7 @@ dashedName: step-12 Якщо ви подивилися в консоль, то могли здивуватися, побачивши значення `false` замість `true`. Це відбувається тому, що React не оновлює стан одразу. Стан буде оновлено лише під час наступного циклу відтворення. -Це поширена помилка серед розробників, які тільки починають працювати з React — вони ставлять інструкції для консолі одразу після виклику функції оновлення стану. Тож варто пам’ятати про це, коли ви створюєте свої React-застосунки. +Для розробників, які тільки починають працювати з React, поширеною помилкою є розміщення інструкцій для консолі одразу після виклику функції оновлення стану. Тож це варто враховувати під час створення своїх React-застосунків. Оскільки `console.log()` більше не потрібен, видаліть його з вашої функції `handleToggleVisibility`. diff --git a/curriculum/challenges/ukrainian/blocks/workshop-toggle-text-app/67cd61c24bfc0a240132fd2f.md b/curriculum/challenges/ukrainian/blocks/workshop-toggle-text-app/67cd61c24bfc0a240132fd2f.md index 4bd7e5a57d6..af6e8333415 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-toggle-text-app/67cd61c24bfc0a240132fd2f.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-toggle-text-app/67cd61c24bfc0a240132fd2f.md @@ -23,14 +23,14 @@ dashedName: step-13 # --hints-- -Коли `isVisible` дорівнює `false`, текст кнопки має бути `Show Message`. +Текст вашої кнопки має показувати `Show Message`, коли `isVisible` дорівнює `false`. ```js const btn = document.getElementById("toggle-button"); assert.equal(btn.textContent, "Show Message"); ``` -Коли `isVisible` дорівнює `true`, текст кнопки має бути `Hide Message`. +Текст вашої кнопки має показувати `Hide Message`, коли `isVisible` дорівнює `true`. ```js const abuseState = __helpers.spyOn(React, "useState"); @@ -246,7 +246,7 @@ export const ToggleApp = () => { const handleToggleVisibility = () => { setIsVisible(!isVisible); - } + }; return (
diff --git a/curriculum/challenges/ukrainian/blocks/workshop-wildlife-tracker/6999ac171928136168654774.md b/curriculum/challenges/ukrainian/blocks/workshop-wildlife-tracker/6999ac171928136168654774.md index 824743c3994..2766da5f06a 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-wildlife-tracker/6999ac171928136168654774.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-wildlife-tracker/6999ac171928136168654774.md @@ -25,7 +25,7 @@ console.log(getAnimalSpecies(dog)); // Dog Тепер створіть функцію з назвою `getSpecies`. -Функція має приймати один параметр із назвою `animal`. +Функція має приймати один параметр з ім’ям `animal`. Поверніть властивість `species` об’єкта `animal` за допомогою точкової нотації. @@ -42,8 +42,10 @@ assert.isFunction(getSpecies); Функція `getSpecies` має мати один параметр, `animal`. ```js -const regex = __helpers.functionRegex('getSpecies', ['animal']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { getSpecies } = explorer.allFunctions; +assert.equal(getSpecies?.parameters.length, 1); +assert.equal(getSpecies?.parameters[0].toString(), 'animal'); ``` Ви маєте вивести `getSpecies(tiger)` у консоль. diff --git a/curriculum/challenges/ukrainian/blocks/workshop-wildlife-tracker/6999ad1cdc249e185aaeedbd.md b/curriculum/challenges/ukrainian/blocks/workshop-wildlife-tracker/6999ad1cdc249e185aaeedbd.md index 722a59a8242..ae50f4a3022 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-wildlife-tracker/6999ad1cdc249e185aaeedbd.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-wildlife-tracker/6999ad1cdc249e185aaeedbd.md @@ -49,8 +49,11 @@ assert.isFunction(addHabitat); Функція `addHabitat` має мати два параметри: `animal` і `habitat`. ```js -const regex = __helpers.functionRegex('addHabitat', ['animal', 'habitat']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { addHabitat } = explorer.allFunctions; +assert.equal(addHabitat?.parameters.length, 2); +assert.equal(addHabitat?.parameters[0].toString(), 'animal'); +assert.equal(addHabitat?.parameters[1].toString(), 'habitat'); ``` Функція `addHabitat` має повертати оновлений об’єкт `animal`. diff --git a/curriculum/challenges/ukrainian/blocks/workshop-wildlife-tracker/6999adc72c02812a28c01e31.md b/curriculum/challenges/ukrainian/blocks/workshop-wildlife-tracker/6999adc72c02812a28c01e31.md index c622e262a9d..aaba8fe42dc 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-wildlife-tracker/6999adc72c02812a28c01e31.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-wildlife-tracker/6999adc72c02812a28c01e31.md @@ -43,8 +43,11 @@ assert.isFunction(updateAge); Функція `updateAge` має мати два параметри: `animal` і `newAge`. ```js -const regex = __helpers.functionRegex('updateAge', ['animal', 'newAge']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { updateAge } = explorer.allFunctions; +assert.equal(updateAge?.parameters.length, 2); +assert.equal(updateAge?.parameters[0].toString(), 'animal'); +assert.equal(updateAge?.parameters[1].toString(), 'newAge'); ``` Функція `updateAge` має повертати оновлений об’єкт `animal`. diff --git a/curriculum/challenges/ukrainian/blocks/workshop-wildlife-tracker/6999b0198d18d402c36cc5fe.md b/curriculum/challenges/ukrainian/blocks/workshop-wildlife-tracker/6999b0198d18d402c36cc5fe.md index b2475d4b1cb..12c17d7b88c 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-wildlife-tracker/6999b0198d18d402c36cc5fe.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-wildlife-tracker/6999b0198d18d402c36cc5fe.md @@ -45,8 +45,10 @@ assert.isFunction(removeEndangeredStatus); Функція `removeEndangeredStatus` має мати один параметр, `animal`. ```js -const regex = __helpers.functionRegex('removeEndangeredStatus', ['animal']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { removeEndangeredStatus } = explorer.allFunctions; +assert.equal(removeEndangeredStatus?.parameters.length, 1); +assert.equal(removeEndangeredStatus?.parameters[0].toString(), 'animal'); ``` Функція `removeEndangeredStatus` має повертати оновлений об’єкт `animal`. diff --git a/curriculum/challenges/ukrainian/blocks/workshop-wildlife-tracker/6999b07c34c2cde21ee6e1d8.md b/curriculum/challenges/ukrainian/blocks/workshop-wildlife-tracker/6999b07c34c2cde21ee6e1d8.md index 3f01b9cbcc6..c5894c0f34d 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-wildlife-tracker/6999b07c34c2cde21ee6e1d8.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-wildlife-tracker/6999b07c34c2cde21ee6e1d8.md @@ -49,8 +49,10 @@ assert.isFunction(hasHabitat); Функція `hasHabitat` має мати один параметр, `animal`. ```js -const regex = __helpers.functionRegex('hasHabitat', ['animal']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { hasHabitat } = explorer.allFunctions; +assert.equal(hasHabitat?.parameters.length, 1); +assert.equal(hasHabitat?.parameters[0].toString(), 'animal'); ``` `hasHabitat` має використовувати метод `hasOwnProperty` для перевірки властивості `habitat`. diff --git a/curriculum/challenges/ukrainian/blocks/workshop-wildlife-tracker/6999b0d79ea938edcb032237.md b/curriculum/challenges/ukrainian/blocks/workshop-wildlife-tracker/6999b0d79ea938edcb032237.md index d4c5b819805..f29ae71bd9b 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-wildlife-tracker/6999b0d79ea938edcb032237.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-wildlife-tracker/6999b0d79ea938edcb032237.md @@ -45,8 +45,11 @@ assert.isFunction(getProperty); Функція `getProperty` має мати два параметри: `animal` і `propertyName`. ```js -const regex = __helpers.functionRegex('getProperty', ['animal', 'propertyName']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { getProperty } = explorer.allFunctions; +assert.equal(getProperty?.parameters.length, 2); +assert.equal(getProperty?.parameters[0].toString(), 'animal'); +assert.equal(getProperty?.parameters[1].toString(), 'propertyName'); ``` `getProperty` має використовувати дужкову нотацію для доступу до властивості. diff --git a/curriculum/challenges/ukrainian/blocks/workshop-wildlife-tracker/699a00de9f564bb0effaa14d.md b/curriculum/challenges/ukrainian/blocks/workshop-wildlife-tracker/699a00de9f564bb0effaa14d.md index a98743e8b9e..58d1aabcd5c 100644 --- a/curriculum/challenges/ukrainian/blocks/workshop-wildlife-tracker/699a00de9f564bb0effaa14d.md +++ b/curriculum/challenges/ukrainian/blocks/workshop-wildlife-tracker/699a00de9f564bb0effaa14d.md @@ -44,8 +44,10 @@ assert.isFunction(getAge); Функція `getAge` має мати один параметр, `animal`. ```js -const regex = __helpers.functionRegex('getAge', ['animal']); -assert.match(__helpers.removeJSComments(code), regex); +const explorer = await __helpers.Explorer(code); +const { getAge } = explorer.allFunctions; +assert.equal(getAge?.parameters.length, 1); +assert.equal(getAge?.parameters[0].toString(), 'animal'); ``` `getAge` має отримувати доступ до властивості `age` за допомогою точкової нотації.