☰ خطة العام · تكنولوجيا المعلومات والاتصالات (بالإنجليزية)

Dynamic pages, a quiz and a game

الأسبوع 14 · الوحدة ١٣ «الذكاء الاصطناعي التوليدي» (٢): الصفحات الديناميكية، عرض الموقع، تطبيق اختبار، لعبة كسر الكتل ومراجعة ما بنيناه · 3 دروس
Answers are for parents and teachers.
1
The counter handler adds 3 instead of 1 (count = count + 3). What does the page show after 4 clicks?
2
A quiz has 4 questions and the pupil gets 3 right. Write what the page shows at the end.
3
Trace the ball for four steps from x = 90 with dx = 5 (the same rules as in the lesson). Write x and dx after each step.
JavaScript
1let x = 80;
2let dx = 5;
3function step() {
4  x = x + dx;
5  if (x >= 100 || x <= 0) {
6    dx = -dx;
7  }
8}
4
This handler does not show the name. Find the mistake and write the fixed line.
JavaScript
1const box = document.getElementById("name");
2const out = document.getElementById("out");
3document.getElementById("hello").onclick = () => {
4  out.textContent = "Hello " + box.text;
5};
5
Write the debugging routine in four steps, and say which one you do first.