Skip to content

Commit

Permalink
Add quiz question about number/intro
Browse files Browse the repository at this point in the history
  • Loading branch information
m7medVision committed Jan 18, 2024
1 parent 1455b19 commit a52a454
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions courses/numbers/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,6 @@ i--; // اصبح i = -1

// i-- مساوي تماما الى ( i = i - 1; );
```
<div class="quiz">
قم بكتابة الكود اللازم لإنشاء متغير يحتوي على القيمة 5 وقم بإضافة 10 إليه.
</div>
1 change: 1 addition & 0 deletions precodes/numbers/intro.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// قم بكتابة الكود اللازم لإنشاء متغير يحتوي على القيمة 5 وقم بإضافة 10 إليه.
8 changes: 8 additions & 0 deletions testcases/numbers/intro.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const regex = /\b(?:let|var)\s+(\w+)\s*=\s*\d+\s*(?:;)?\s*\1\s*=\s*\1\s*\+\s*\d+\s*\b(?:;)?/;
if (regex.test(code)) {
isPass = true;
msg = 'Good job!';
} else {
isPass = false;
msg = "تحقق من الشروط المطلوبة"
}

0 comments on commit a52a454

Please sign in to comment.