📄 النص الكامل للصفحة
--- SECTION: Reference to Logic Blocks ---
The blue circle labeled '1' points to the 'and' and 'or' logic blocks, as well as the equality comparison block, within the conditional statement of the 'riyadh_list.AfterPicking' event handler in the first App Inventor screenshot.
--- SECTION: Reference to Variable Blocks ---
The blue circle labeled '2' highlights the 'get' block, used for retrieving a variable's value, shown alongside other variable initialization and assignment blocks in the second App Inventor screenshot.
--- SECTION: Page Footer ---
وزارة التعليم
Ministry of Education
2023 - 1447
166
--- VISUAL CONTEXT ---
**DIAGRAM**: MIT App Inventor Interface: Logic Blocks and Conditional Statement
Description: A screenshot of the MIT App Inventor 'Blocks' editor. The top bar shows 'Projects', 'Connect', 'Build', 'Settings', 'Help'. The app title is 'Visit_SA_App' with buttons 'Cities', 'Add Screen', 'Remove Screen', 'Publish to Gallery'. The left panel, labeled 'Blocks', lists 'Built-in' categories: 'Control', 'Logic', 'Math', 'Text', 'Lists', 'Dictionaries', 'Colors', 'Variables', 'Procedures'. Below 'Built-in', the 'Cities' component category is shown with 'discover_label', 'VerticalArrangement1', 'cities_label', 'riyadh_list', 'jeddah_list'. The right panel, labeled 'Viewer', displays several logic blocks: 'true', 'false', 'not', an equality comparison block '=', 'and', and 'or'. A larger code block is visible, starting with 'when riyadh_list . AfterPicking do'. Inside, it contains 'set global selection to riyadh_list . Selection', followed by an 'if' block. The 'if' condition includes an 'or' block, which contains two 'get global selection =' blocks. The 'then' part of the 'if' block is empty. A blue circle with the number '1' points to the 'and' and 'or' blocks.
Table Structure:
Headers: N/A
Data: The visual elements demonstrate the graphical block-based programming environment of MIT App Inventor, specifically focusing on logical operations and conditional flow control within an event handler.
Key Values: MIT APP INVENTOR, Visit_SA_App, Blocks, Viewer, Built-in, Logic, true, false, not, =, and, or, when riyadh_list . AfterPicking, set global selection to riyadh_list . Selection, if, then, get global selection
Context: This diagram illustrates how to construct conditional logic using 'if-then' statements and boolean operators ('and', 'or', 'not', '=') in MIT App Inventor to respond to user interactions, such as selecting an item from a list ('riyadh_list.AfterPicking').
**DIAGRAM**: MIT App Inventor Interface: Variable Initialization and Assignment Blocks
Description: A second screenshot of the MIT App Inventor 'Blocks' editor. The top bar shows 'Projects', 'Connect', 'Build', 'Settings', 'Help'. The app title is 'Visit_SA_App' with buttons 'Cities', 'Add Screen', 'Remove Screen', 'Publish to Gallery'. The left panel, labeled 'Blocks', lists 'Built-in' categories: 'Control', 'Logic', 'Math', 'Text', 'Lists', 'Dictionaries', 'Colors', 'Variables', 'Procedures'. Below 'Built-in', the 'Cities' component category is shown. The right panel, labeled 'Viewer', displays blocks related to variable handling: 'initialize global name to', 'get', 'set to', and 'initialize local name to in'. A blue circle with the number '2' points to the 'get' block.
Table Structure:
Headers: N/A
Data: The visual elements demonstrate blocks for declaring and manipulating variables in MIT App Inventor.
Key Values: MIT APP INVENTOR, Visit_SA_App, Blocks, Viewer, Built-in, Variables, initialize global name to, get, set to, initialize local name to in
Context: This diagram demonstrates the fundamental blocks for defining global and local variables, retrieving their current values ('get'), and assigning new values ('set') within the MIT App Inventor programming environment.
**DIAGRAM**: MIT App Inventor: 'AfterPicking' Event Handler (Partial)
Description: A standalone code block, identical to the larger code block shown in the first screenshot. It represents an event handler: 'when riyadh_list . AfterPicking do'. Inside, it sets a global variable: 'set global selection to riyadh_list . Selection'. This is followed by an 'if' block containing an 'or' condition, which checks if 'get global selection =' (twice). The 'then' part of the 'if' block is empty.
Table Structure:
Headers: N/A
Data: This block shows a specific event handler with variable assignment and conditional logic.
Key Values: when riyadh_list . AfterPicking, do, set global selection to riyadh_list . Selection, if, or, get global selection =, then
Context: This block serves as a detailed example of how to implement an event-driven action in MIT App Inventor, specifically handling the selection of an item from a list and applying conditional logic based on that selection.
🎴 بطاقات تعليمية للمراجعة
عدد البطاقات: 5 بطاقة لهذه الصفحة
ما هي وظيفة كتلة 'and' وكتلة 'or' في MIT App Inventor؟
الإجابة: كتلة 'and' وكتلة 'or' هي كتل منطقية (Logic blocks) تُستخدم لبناء الشروط المنطقية المركبة داخل العبارات الشرطية (conditional statements).
الشرح: هذه الكتل تسمح للمبرمج بدمج شروط منطقية متعددة داخل شرط واحد، حيث 'and' تتطلب تحقق جميع الشروط، و 'or' تتطلب تحقق شرط واحد على الأقل.
تلميح: فكر في نوع الكتل الموجودة ضمن فئة 'Logic' في App Inventor وكيفية استخدامها لدمج شروط متعددة.
التصنيف: تعريف | المستوى: سهل
ما هي وظيفة كتلة 'get' في MIT App Inventor؟
الإجابة: كتلة 'get' هي كتلة تُستخدم لاسترجاع قيمة متغير (variable) مخزنة مسبقاً.
الشرح: تتيح كتلة 'get' الوصول إلى البيانات المخزنة في متغير محلي أو عام لاستخدامها في أجزاء أخرى من البرنامج، مثل الشروط أو العمليات الحسابية.
تلميح: تذكر أن الكتل المتعلقة بالمتغيرات تسمح لك بتخزين واستدعاء البيانات.
التصنيف: تعريف | المستوى: سهل
ما هو الحدث (Event) الذي يتم التعامل معه في الكود 'when riyadh_list . AfterPicking do'؟
الإجابة: الحدث هو 'AfterPicking' للمكون 'riyadh_list'، وهو يحدث بعد أن يقوم المستخدم باختيار عنصر من القائمة (List).
الشرح: معالجات الأحداث (Event Handlers) مثل 'AfterPicking' تسمح للبرنامج بالاستجابة لتفاعلات المستخدم. في هذه الحالة، يتم تشغيل الكود الموجود داخل هذه الكتلة بعد أن يختار المستخدم عنصراً من قائمة 'riyadh_list'.
تلميح: ركز على اسم الكتلة 'when' وما يليها مباشرة. ما هو الإجراء الذي يستدعي تنفيذ الكود الموجود داخلها؟
التصنيف: مفهوم جوهري | المستوى: متوسط
ما هي الخطوة التي يتم تنفيذها داخل معالج الحدث 'riyadh_list.AfterPicking' قبل الشروط المنطقية؟
الإجابة: يتم تعيين قيمة المتغير العام 'selection' إلى العنصر الذي اختاره المستخدم من القائمة، باستخدام الكتلة: 'set global selection to riyadh_list . Selection'.
الشرح: هذه الخطوة ضرورية لحفظ اختيار المستخدم في متغير يمكن الرجوع إليه لاحقاً في الشروط المنطقية أو العمليات الأخرى داخل البرنامج.
تلميح: ابحث عن أول كتلة تنفيذية داخل كتلة 'when...do'. ما هي العملية التي تحفظ نتيجة تفاعل المستخدم؟
التصنيف: صيغة/خطوات | المستوى: متوسط
ما هي الكتل الأساسية المتعلقة بإدارة المتغيرات (Variables) في App Inventor؟
الإجابة: الكتل الأساسية لإدارة المتغيرات هي: 'initialize global name to' (تهيئة متغير عام)، 'get' (استرجاع القيمة)، 'set to' (تعيين قيمة)، و 'initialize local name to in' (تهيئة متغير محلي).
الشرح: تغطي هذه الكتل دورة حياة المتغير الكاملة: الإنشاء (التهيئة)، وتحديث القيمة (التعيين)، والقراءة (الاسترجاع).
تلميح: انظر إلى الكتل المعروضة في الصورة الثانية تحت فئة 'Variables'. ما هي العمليات الأساسية التي يمكنك القيام بها على المتغير؟
التصنيف: مفهوم جوهري | المستوى: متوسط