برمجة ميزات قابلية الوصول في تطبيق MIT App Inventor - كتاب هندسة البرمجيات - الصف 12 - الفصل 1 - المملكة العربية السعودية

الكتاب: كتاب هندسة البرمجيات - الصف 12 - الفصل 1 | المادة: هندسة البرمجيات | المرحلة: الصف 12 | الفصل الدراسي: 1

الدولة: المملكة العربية السعودية | المنهج: المنهج السعودي - وزارة التعليم

الدرس: البرنامج كاملاً بميزات قابلية الوصول في الشاشة الثالثة (المصمك)

📚 معلومات الصفحة

الكتاب: كتاب هندسة البرمجيات - الصف 12 - الفصل 1 | المادة: هندسة البرمجيات | المرحلة: الصف 12 | الفصل الدراسي: 1

الدولة: المملكة العربية السعودية | المنهج: المنهج السعودي - وزارة التعليم

نوع المحتوى: example

الفصل: 4

مستوى الصعوبة: متوسط

📝 ملخص الصفحة

تقدم هذه الصفحة مثالاً تطبيقياً لبرمجة ميزات قابلية الوصول في تطبيق "Visit_SA_App" باستخدام MIT App Inventor. يوضح المحتوى كيفية استخدام البرمجة المرئية القائمة على الكتل لتنفيذ وظائف تحسين إمكانية الوصول، مثل تغيير حجم الخطوط والتحويل من نص إلى كلام وتعديل ألوان الواجهة.

يتم عرض كتل برمجية متعددة تتعامل مع أحداث المستخدم، مثل النقر والنقر المطول، على أزرار محددة مثل زر اللون. على سبيل المثال، يظهر كتلة حدث "when color_button .LongClick do" التي تغير خلفية ولون النص لعناصر واجهة المستخدم إلى ألوان داكنة لتحسين الوضوح.

يتضمن المثال أيضاً وظائف التكبير والتصغير للنصوص من خلال أزرار مخصصة، حيث تزيد أو تنقص حجم خطوط العناوين والنصوص ديناميكياً. بالإضافة إلى ذلك، يتم عرض كتلة لزر تحويل النص إلى كلام تقوم بقراءة محتوى النصوص على الشاشة باستخدام مكون TextToSpeech.

يهدف هذا الدرس إلى تعليم الطلاب كيفية تصميم تطبيقات متاحة للجميع، مع التركيز على البرمجة الموجهة بالأحداث وتخصيص واجهة المستخدم لتحسين تجربة المستخدمين ذوي الاحتياجات الخاصة.

📄 النص الكامل للصفحة

MIT APP INVENTOR Projects Connect Build Settings Help Visit_SA_App Blocks Viewer AlMasmak Add Screen Remove Screen Publish to Gallery Variables Procedures AlMasmak discover_label VerticalArrangement1 title_label image description_label HorizontalArrangement1 zoom_in_button zoom_out_button text_to_speech_button color_button map_button Map1 text_to_speech Any component Rename Delete --- SECTION: شكل 4.14 --- شكل 4.14: برمجة زر تنسيق اللون البرنامج كاملاً بميزات قابلية الوصول في الشاشة الثالثة (المصمك) The Complete Code for the Accessibility Features on the Third Screen (Al Masmak) وزارة التعليم Ministry of Education 217 2025 - 1447 --- VISUAL CONTEXT --- **DIAGRAM**: MIT App Inventor Blocks for Visit_SA_App Description: A screenshot of the MIT App Inventor 'Blocks' editor for a project named 'Visit_SA_App'. The left panel, labeled 'Blocks', lists components and categories: 'Variables', 'Procedures', 'AlMasmak', 'discover_label', 'VerticalArrangement1', 'title_label', 'image', 'description_label', 'HorizontalArrangement1', 'zoom_in_button', 'zoom_out_button', 'text_to_speech_button', 'color_button', 'map_button', 'Map1', 'text_to_speech', and 'Any component' with 'Rename' and 'Delete' options. The right panel, labeled 'Viewer', displays five event handler blocks for a 'color_button': 'when color_button .Click do', 'when color_button .GotFocus do', 'when color_button .LongClick do', 'when color_button .LostFocus do', and 'when color_button .TouchDown do'. A specific 'when color_button .LongClick do' block is visually highlighted with the number 6, and a dashed arrow points from it to a more detailed, expanded version of this block (labeled 7) positioned below the main screenshot. The detailed block (7) shows the 'when color_button .LongClick do' event block containing five nested 'set' blocks: 'set VerticalArrangement1 .BackgroundColor to [dark green color block]', 'set discover_label .BackgroundColor to [dark green color block]', 'set discover_label .TextColor to [white color block]', 'set title_label .TextColor to [white color block]', 'set description_label .TextColor to [white color block]'. Context: Illustrates the event-driven programming paradigm in MIT App Inventor, showing how different user interactions (click, focus, long click, lost focus, touch down) with a 'color_button' can trigger specific actions. The detailed block (7) demonstrates how to change UI element properties like background and text colors. **DIAGRAM**: Complete Code for Accessibility Features Description: A collection of MIT App Inventor blocks demonstrating the complete code for accessibility features. * **Zoom In Functionality:** A 'when zoom_in_button .Click do' block contains three 'set' blocks: 'set discover_label .FontSize to (discover_label .FontSize + 1)', 'set title_label .FontSize to (title_label .FontSize + 1)', and 'set description_label .FontSize to (description_label .FontSize + 1)'. * **Zoom Out Functionality:** A 'when zoom_out_button .Click do' block contains three 'set' blocks: 'set discover_label .FontSize to (discover_label .FontSize - 1)', 'set title_label .FontSize to (title_label .FontSize - 1)', and 'set description_label .FontSize to (description_label .FontSize - 1)'. * **Text-to-Speech Functionality:** A 'when text_to_speech_button .Click do' block contains a 'call text_to_speech .Speak message' block. The 'message' input is connected to a 'join' block that concatenates the text from 'discover_label .Text', 'title_label .Text', and 'description_label .Text'. * **Color Scheme 1 (Click):** A 'when color_button .Click do' block contains four 'set' blocks: 'set VerticalArrangement1 .BackgroundColor to [dark green color block]', 'set discover_label .BackgroundColor to [dark green color block]', 'set title_label .TextColor to [white color block]', and 'set description_label .TextColor to [white color block]'. * **Color Scheme 2 (Long Click):** A 'when color_button .LongClick do' block contains four 'set' blocks: 'set VerticalArrangement1 .BackgroundColor to [black color block]', 'set discover_label .BackgroundColor to [black color block]', 'set title_label .TextColor to [white color block]', and 'set description_label .TextColor to [white color block]'. Context: Demonstrates how to implement common accessibility features in an app, such as dynamically adjusting font sizes, converting on-screen text to speech, and switching between different color themes (dark green background with white text, or black background with white text) based on button clicks and long clicks.

🎴 بطاقات تعليمية للمراجعة

عدد البطاقات: 5 بطاقة لهذه الصفحة

ما هي الأحداث (Events) المختلفة التي يمكن لزر (color_button) في MIT App Inventor الاستجابة لها كما هو موضح؟

الإجابة: يمكن لزر color_button الاستجابة للأحداث التالية: .Click (نقر)، .GotFocus (الحصول على التركيز)، .LongClick (نقر مطول)، .LostFocus (فقدان التركيز)، و .TouchDown (لمس الشاشة).

الشرح: يُظهر الجزء العلوي من الشكل خمس كتل برمجية من نوع 'when...do' لكل حدث من هذه الأحداث، مما يوضح نموذج البرمجة القائمة على الأحداث في MIT App Inventor.

تلميح: انظر إلى أسماء الكتل البرمجية في لوحة المشاهد (Viewer) في الشكل.

التصنيف: تعريف | المستوى: متوسط

ما الذي يحدث عند النقر المطول (LongClick) على زر تنسيق اللون في الكود المفصل (الكتلة 7)؟

الإجابة: عند النقر المطول على زر تنسيق اللون، يتم تنفيذ الكتلة البرمجية 'when color_button .LongClick do' التي تقوم بتعيين لون خلفية الترتيب العمودي (VerticalArrangement1) والتسمية (discover_label) إلى اللون الأخضر الداكن، وتعيين لون نص التسمية (discover_label) والعنوان (title_label) والوصف (description_label) إلى اللون الأبيض.

الشرح: يُظهر الشكل تفصيلاً للكتلة البرمجية المسؤولة عن حدث النقر المطول، حيث تحتوي على خمس كتل 'set' لتعديل خصائص الألوان لعناصر واجهة المستخدم المحددة.

تلميح: ركز على الكتل الخمس المتداخلة داخل كتلة الحدث 'when color_button .LongClick do'.

التصنيف: صيغة/خطوات | المستوى: متوسط

كيف يتم تنفيذ ميزة تكبير النص (Zoom In) في تطبيق Visit_SA_App؟

الإجابة: يتم تنفيذ ميزة تكبير النص من خلال كتلة برمجية تستجيب للنقر على زر التكبير (zoom_in_button). تحتوي هذه الكتلة على ثلاث كتل 'set' تزيد حجم خط النص (FontSize) لكل من التسمية (discover_label) والعنوان (title_label) والوصف (description_label) بواحد.

الشرح: يُظهر قسم 'Zoom In Functionality' في وصف الكود الكامل كتلة 'when zoom_in_button .Click do' التي تستخدم عامل الجمع (+) لزيادة قيمة خاصية حجم الخط.

تلميح: تذكر أن الزيادة تكون في خاصية FontSize.

التصنيف: صيغة/خطوات | المستوى: سهل

كيف تعمل ميزة تحويل النص إلى كلام (Text-to-Speech) في الكود الموضح؟

الإجابة: تعمل الميزة من خلال كتلة برمجية تستجيب للنقر على زر تحويل النص إلى كلام (text_to_speech_button). تحتوي هذه الكتلة على كتلة 'call' تستدعي مكون text_to_speech ووظيفة .Speak. يتم إدخال الرسالة (message) إليه عن طريق كتلة 'join' تدمج النصوص من التسمية (discover_label) والعنوان (title_label) والوصف (description_label).

الشرح: يُظهر هذا مثالاً عملياً على استخدام مكونات MIT App Inventor الجاهزة (مثل TextToSpeech) ووظائف معالجة النصوص (join) لإنشاء ميزة إمكانية وصول مهمة.

تلميح: فكر في كيفية جمع النصوص من عناصر واجهة المستخدم المختلفة قبل تحويلها إلى صوت.

التصنيف: صيغة/خطوات | المستوى: صعب

ما الفرق بين سلوك زر تنسيق اللون عند النقر العادي (Click) وعند النقر المطول (LongClick) حسب الكود الكامل؟

الإجابة: الفرق الرئيسي هو لون الخلفية الذي يتم تعيينه. عند النقر العادي (Click)، يتم تعيين خلفية VerticalArrangement1 و discover_label إلى اللون الأخضر الداكن. بينما عند النقر المطول (LongClick)، يتم تعيين خلفية نفس العنصرين إلى اللون الأسود. في كلا الحالتين، يتم تعيين لون النص للعناوين إلى الأبيض.

الشرح: يوفر هذا التصميم سمتين مختلفتين للألوان للمستخدم: سمة خضراء داكنة وسمة سوداء، مما يزيد من خيارات إمكانية الوصول والتفضيل الشخصي.

تلميح: قارن بين قيم خاصية .BackgroundColor في كتلة الـ Click وكتلة الـ LongClick.

التصنيف: فرق بين مفهومين | المستوى: متوسط