From 318a61e1ec14e6fb92bdf569ac021ebed8e7f0b8 Mon Sep 17 00:00:00 2001 From: teabyte Date: Mon, 26 Feb 2024 21:04:50 +0300 Subject: [PATCH] Fixing some courses --- courses/functions/global-scope.md | 2 +- courses/functions/intro.md | 2 ++ courses/numbers/decimals.md | 2 +- courses/numbers/intro.md | 4 ++-- ...essing-object-properties-with-variables.md | 2 +- .../objects/accessing-object-properties.md | 12 ++++++---- .../objects/delete-properties-from-object.md | 2 +- courses/objects/intro.md | 11 +++++---- courses/objects/updating-object-properties.md | 3 +-- courses/variables/uninitialized-variables.md | 2 +- precodes/functions/intro.js | 3 +++ precodes/numbers/intro.js | 1 + ...essing-object-properties-with-variables.js | 1 + precodes/objects/intro.js | 3 +++ testcases/functions/intro.js | 7 +++--- .../objects/delete-properties-from-object.js | 2 +- .../objects/updating-object-properties.js | 23 ++++++++----------- 17 files changed, 46 insertions(+), 36 deletions(-) create mode 100644 precodes/functions/intro.js create mode 100644 precodes/objects/intro.js diff --git a/courses/functions/global-scope.md b/courses/functions/global-scope.md index 43f5826..d29613c 100644 --- a/courses/functions/global-scope.md +++ b/courses/functions/global-scope.md @@ -28,5 +28,5 @@ console.log(x); ```
-لا يوجد اختبار لهذا الدرس. +نعتذر عن عدم وجود اختبار لهذا الدرس حالياً. نحن نعمل بجد لإعداد اختبارات لجميع الدروس وسنقوم بتوفيرها في أقرب وقت ممكن.
diff --git a/courses/functions/intro.md b/courses/functions/intro.md index 96cd1ec..f201559 100644 --- a/courses/functions/intro.md +++ b/courses/functions/intro.md @@ -81,4 +81,6 @@ const answer = plusThree(5);
قم بكتابة دالة اسمها area تأخذ وسيطتين width و height وترجع مساحة المستطيل +
+ان علمت ان قانون المساحه هو width * height.
diff --git a/courses/numbers/decimals.md b/courses/numbers/decimals.md index c8428e0..4423f20 100644 --- a/courses/numbers/decimals.md +++ b/courses/numbers/decimals.md @@ -27,5 +27,5 @@ console.log(div); // 0.5
1. اكتب كود جافاسكربت يخزّن الرقم العشري 3.14 في متغير يسمّى myDecimal.
2. ثم اكتب كودًا يضرب myDecimal في 4 ويخزّن النتيجة في متغير يسمّى product.
-3. اطبع قيمةproduct إلى وحدة التحكم.
+3. اطبع قيمة product إلى وحدة التحكم.
diff --git a/courses/numbers/intro.md b/courses/numbers/intro.md index a99a973..c879b56 100644 --- a/courses/numbers/intro.md +++ b/courses/numbers/intro.md @@ -83,7 +83,7 @@ i--; // اصبح i = -1 ```
-1- قم بحساب مساحة مستطيل بطول 5 وعرض 10.
+1- قم بحساب مساحة مستطيل بطول 5 وعرض 10. ان علمت ان مساحه المسطيل هي length * width.
2- يجب عليك أن تخزن الطول في متغير length والعرض في متغير width ونتيجة الضرب في متغير area.
-3- يجب أن تطبع النتيجة في الكونسول. +3- يجب أن تطبع النتيجة في وحده التحكم.
diff --git a/courses/objects/accessing-object-properties-with-variables.md b/courses/objects/accessing-object-properties-with-variables.md index 01589c5..101eb6a 100644 --- a/courses/objects/accessing-object-properties-with-variables.md +++ b/courses/objects/accessing-object-properties-with-variables.md @@ -29,5 +29,5 @@ console.log(myBreed);
-قم بطاعة خاصية الدولة من الكائن country بستخدام المتغير المُخزنCountry. +قم بطاعة خاصية الدولة (country) من الكائن fighter بأستحدام المتغير المُخزن Country في وحده التحكم.
diff --git a/courses/objects/accessing-object-properties.md b/courses/objects/accessing-object-properties.md index 466a458..333d219 100644 --- a/courses/objects/accessing-object-properties.md +++ b/courses/objects/accessing-object-properties.md @@ -60,11 +60,13 @@ myObj["NoSpace"];
-عندك كائن اسمه fighter ولديه الخصائص التالية: -name، country، speed، maxAltitude، وmaxAltitudeUnit. -قم بالوصول لأقصى إرتفاع يمكن للطائرة الحربية fighter الوصول إليه من ثم قم بتحول الوحدة من ft إلى m. +لديك الكائن fighter ولديه الخصائص التالية: +name، country، speed، maxAltitude، و maxAltitudeUnit.
-يعني حول الرقم من قدم إلى متر. 1 قدم = 0.3048 متر. +قم بالوصول لأقصى إرتفاع يمكن للطائرة الحربية fighter الوصول إليه.
-يجب عليك طباعة النتيجة. +من ثم قم بتحول الوحدة من ft إلى m +اي حول الرقم من قدم (ft) إلى متر (m). ان علمت ان 1 قدم = 0.3048 متر +
+يجب عليك طباعة النتيجة في وحده التحكم!.
diff --git a/courses/objects/delete-properties-from-object.md b/courses/objects/delete-properties-from-object.md index be023b8..21d7a38 100644 --- a/courses/objects/delete-properties-from-object.md +++ b/courses/objects/delete-properties-from-object.md @@ -36,5 +36,5 @@ delete ourDog.bark; ```
-إحذف خاصية operator فقط. +إحذف خاصية operator من الكائن fighter.
diff --git a/courses/objects/intro.md b/courses/objects/intro.md index 28410cc..e733ade 100644 --- a/courses/objects/intro.md +++ b/courses/objects/intro.md @@ -40,8 +40,11 @@ const anotherObject = { جافاسكربت تلقائيًا بكتابتها كسلاسل.
-قم بإنشاء كائن يمثل السيارة "car"، ويحتوي على الخصائص التالية:
-- الصانع: "Toyota"
-- النموذج: "Corolla"
-إستخدم اللغة الإنجليزية لأسماء الخصائص. ترجمة الصانع إلى العربية هي "manufacturer"، وترجمة النموذج إلى العربية هي "model". +قم بإنشاء كائن يمثل السيارة car، ويحتوي على الخصائص التالية:
+- الصانع: Toyota
+- النموذج: Corolla
+
+⚠️ إستخدم اللغة الإنجليزية لأسماء الخصائص. +
+ترجمة الصانع إلى العربية هي manufacturer، وترجمة النموذج إلى العربية هي model.
diff --git a/courses/objects/updating-object-properties.md b/courses/objects/updating-object-properties.md index 70b9127..9d416d0 100644 --- a/courses/objects/updating-object-properties.md +++ b/courses/objects/updating-object-properties.md @@ -60,7 +60,6 @@ const ourDog = { ourDog.bark = "bow-wow"; ``` -
-قم بحول الكائن fighter إلى كائن يحتوي على خاصية speed بقيمة 2450 ووحدة قياسها km/h +قم بتحديث الكائن fighter إلى كائن يحتوي على خاصية speed بقيمة 2450.
diff --git a/courses/variables/uninitialized-variables.md b/courses/variables/uninitialized-variables.md index ba77d51..c2b9a06 100644 --- a/courses/variables/uninitialized-variables.md +++ b/courses/variables/uninitialized-variables.md @@ -31,5 +31,5 @@ console.log(c); // "undefined String!"
-قم بتعريف أي متغير ثم غير قيمته إلى عربي. +قم بتعريف أي متغير ثم غير قيمته إلى كلمه عربي.
diff --git a/precodes/functions/intro.js b/precodes/functions/intro.js new file mode 100644 index 0000000..0d7f85f --- /dev/null +++ b/precodes/functions/intro.js @@ -0,0 +1,3 @@ +function area() { + return null; +} \ No newline at end of file diff --git a/precodes/numbers/intro.js b/precodes/numbers/intro.js index e69de29..9ffb4fa 100644 --- a/precodes/numbers/intro.js +++ b/precodes/numbers/intro.js @@ -0,0 +1 @@ +const length = 5; \ No newline at end of file diff --git a/precodes/objects/accessing-object-properties-with-variables.js b/precodes/objects/accessing-object-properties-with-variables.js index 09f6233..b70ebf3 100644 --- a/precodes/objects/accessing-object-properties-with-variables.js +++ b/precodes/objects/accessing-object-properties-with-variables.js @@ -5,4 +5,5 @@ const fighter = { maxAltitude: 65000, maxAltitudeUnit: 'ft', } + const Country = 'country'; \ No newline at end of file diff --git a/precodes/objects/intro.js b/precodes/objects/intro.js new file mode 100644 index 0000000..d90e5b5 --- /dev/null +++ b/precodes/objects/intro.js @@ -0,0 +1,3 @@ +let car = { + // ... +} \ No newline at end of file diff --git a/testcases/functions/intro.js b/testcases/functions/intro.js index 570a3d0..c699832 100644 --- a/testcases/functions/intro.js +++ b/testcases/functions/intro.js @@ -22,14 +22,15 @@ function handleCodeRun(code) { return `${error}`; } } -code += "\nconsole.log(area(5, 5));" +code += "\nconsole.log(area(5, 75));" const output = handleCodeRun(code); +console.log(output); if (output) { - if (output === "25") { + if (output.includes("375")) { isPass = true; msg = "مبروك الحل صحيح" } else { isPass = false; - msg = "هناك خطاء ما" + msg = "هناك خطاء ما تأكد من شروط الاختبار" } } \ No newline at end of file diff --git a/testcases/objects/delete-properties-from-object.js b/testcases/objects/delete-properties-from-object.js index 4284d96..3918432 100644 --- a/testcases/objects/delete-properties-from-object.js +++ b/testcases/objects/delete-properties-from-object.js @@ -1,5 +1,5 @@ // if code contain `delete fighter.operator` then isPass = true -if (code.includes("delete fighter.operator")) { +if (code.includes("delete") && code.includes("operator") && code.includes("fighter")) { isPass = true; } else { isPass = false; diff --git a/testcases/objects/updating-object-properties.js b/testcases/objects/updating-object-properties.js index 8b11620..6998206 100644 --- a/testcases/objects/updating-object-properties.js +++ b/testcases/objects/updating-object-properties.js @@ -27,18 +27,13 @@ function handleCodeRun(code) { return `${error}`; } } -// if the code contain console.log() write message -if (code.includes("console.log(")) { - isPass = false; - msg = "اكتب الجواب بدون استخدام console.log"; + +code += "\nconsole.log(fighter.speed+fighter.speedUnit)" +const output = handleCodeRun(code); +const expectedOutput = "2450"; +if (output.includes(expectedOutput)) { + isPass = true; } else { - code += "\nconsole.log(fighter.speed+fighter.speedUnit)" - const output = handleCodeRun(code); - const expectedOutput = "2450km/h"; - if (output == expectedOutput) { - isPass = true; - } else { - isPass = false; - msg = "الله يبارك فيك ركز شوية وحاول مره ثانية" - } -} \ No newline at end of file + isPass = false; + msg = "الله يبارك فيك ركز شوية وحاول مره ثانية" +}