📄 النص الكامل للصفحة
برمجة زر تحويل النص إلى كلام
Programming the Text-To-Speech Button
سينشئ هذا الزر نصا من محتويات جميع مكونات النص على الشاشة والتي سيتم توفيرها لمكون TextToSpeech (تحويل النص إلى كلام) لإنتاج الرسالة المنطوقة.
--- SECTION: برمجة زر تحويل النص إلى كلام ---
حدد حدث Click (الضغط) لمكون text_to_speech_button ليكون (زر_تحويل_النص_إلى_كلام). 1
حدد الأمر Speak message (رسالة صوتية) لمكون text_to_speech (تحويل النص إلى كلام). 2
حدد الأمر Join (ربط) من مجموعة Text (النص) لربط النصوص معًا. 3
أضف خاصية Text (النص) لمكون discover_label (اكتشف_التسمية) إلى المدخل الأول لأمر Join (الربط). 4
كرر العملية المذكورة أعلاه للمكونات النصية الأخرى. 5
وزارة التعليم
Ministry of Education
2025 - 1447
212
--- VISUAL CONTEXT ---
**DIAGRAM**: MIT App Inventor Blocks for Text-to-Speech Button Click Event
Description: A screenshot of the MIT App Inventor interface showing the 'Blocks' editor. The left panel lists components and block categories (Colors, Variables, Procedures, Math, Text, Lists, Dictionaries, Control, Logic, Any component). Under 'Any component', specific UI elements like 'VerticalArrangement1', 'discover_label', 'image', 'description_label', 'zoomout_button', 'text_to_speech_button', 'map1', 'text_to_speech' are listed. The main 'Viewer' area displays several event blocks for 'text_to_speech_button': '.Click', '.GotFocus', '.LongClick', '.LostFocus', '.TouchDown'. An arrow points from the '.Click' block in the main view to an enlarged, isolated 'when text_to_speech_button .Click do' block, labeled with the number '1'.
Data: Illustrates the first step of programming: selecting the 'Click' event for the 'text_to_speech_button'.
Key Values: Visit_SA_App, Blocks, Viewer, when text_to_speech_button .Click do, when text_to_speech_button .GotFocus do, when text_to_speech_button .LongClick do, when text_to_speech_button .LostFocus do, when text_to_speech_button .TouchDown do, MIT App Inventor, Projects, Connect, Build, Settings, Help, Media, Colors, Variables, Procedures, Math, Text, Lists, Dictionaries, Control, Logic, Any component, VerticalArrangement1, discover_label, image, description_label, zoomout_button, text_to_speech_button, map1, text_to_speech, Rename, Delete
Context: This diagram shows how to initiate the programming sequence by selecting the 'Click' event for a button in MIT App Inventor, corresponding to instruction 1 in the text.
**DIAGRAM**: MIT App Inventor Blocks for Text-to-Speech Speak Message
Description: A second screenshot of the MIT App Inventor interface. The 'Viewer' area shows 'when text_to_speech AfterSpeaking result do' and 'when text_to_speech BeforeSpeaking do' blocks. Below these, a 'call text_to_speech .Speak message' block is visible, along with 'text_to_speech .AvailableCountries', 'text_to_speech .AvailableLanguages', and 'text_to_speech .Country' blocks. An arrow indicates that the 'call text_to_speech .Speak message' block is to be nested within the 'when text_to_speech_button .Click do' block. An enlarged version of the combined block, 'when text_to_speech_button .Click do' containing 'call text_to_speech .Speak message', is shown separately and labeled with the number '2'.
Data: Illustrates the second step of programming: calling the 'Speak message' function of the 'text_to_speech' component and nesting it within the button's click event.
Key Values: Visit_SA_App, Blocks, Viewer, when text_to_speech AfterSpeaking result do, when text_to_speech BeforeSpeaking do, call text_to_speech .Speak message, message, text_to_speech .AvailableCountries, text_to_speech .AvailableLanguages, text_to_speech .Country, when text_to_speech_button .Click do, MIT App Inventor, Projects, Connect, Build, Settings, Help, Media, Colors, Variables, Procedures, Math, Text, Lists, Dictionaries, Control, Logic, Any component, VerticalArrangement1, discover_label, image, description_label, zoomout_button, text_to_speech_button, map1, text_to_speech, Rename, Delete
Context: This diagram demonstrates how to implement the 'Speak' action using the 'text_to_speech' component, nested within the button's click event, corresponding to instruction 2 in the text.
🎴 بطاقات تعليمية للمراجعة
عدد البطاقات: 7 بطاقة لهذه الصفحة
كيف يتم تزويد أمر Join بالنص الأول الذي سيتم دمجه؟
الإجابة: بإضافة خاصية Text (النص) لمكون discover_label (اكتشف_التسمية) إلى المدخل الأول لأمر Join.
الشرح: يتم سحب قيمة النص (Text Property) من أحد مكونات واجهة المستخدم (مثل التسمية) ووضعها كمعطى (Argument) في كتلة Join.
تلميح: تذكر أن الخطوة الرابعة تبدأ بكلمة 'أضف' وتتعلق بمكون نصي محدد.
التصنيف: صيغة/خطوات | المستوى: متوسط
ما الذي يجب فعله بعد إضافة نص المكون الأول إلى أمر Join؟
الإجابة: تكرار العملية نفسها للمكونات النصية الأخرى في التطبيق.
الشرح: لإنشاء رسالة كلامية كاملة، يجب جمع النصوص من جميع التسميات أو المكونات النصية ذات الصلة في واجهة التطبيق.
تلميح: انظر إلى التعليمات بعد الخطوة الرابعة مباشرة.
التصنيف: مفهوم جوهري | المستوى: سهل
ما هو الأمر المستخدم في MIT App Inventor لدمج (ربط) نصوص من مكونات واجهة مختلفة؟
الإجابة: أمر Join (ربط) من مجموعة Text (النص).
الشرح: يُستخدم أمر Join لإنشاء نص واحد طويل من عدة نصوص فرعية، وهو ضروري لتجميع محتويات التسميات (Labels) المختلفة قبل تحويلها إلى كلام.
تلميح: ابحث في النص عن الكلمة الإنجليزية التي تعني 'ربط' أو 'دمج'.
التصنيف: تعريف | المستوى: متوسط
ما هو الغرض من زر تحويل النص إلى كلام (Text-To-Speech Button) في تطبيق MIT App Inventor؟
الإجابة: ينشئ نصاً من محتويات جميع مكونات النص على الشاشة ويوفرها لمكون TextToSpeech لإنتاج رسالة منطوقة.
الشرح: يتمثل دور الزر في تجميع النصوص المعروضة على واجهة التطبيق وتحويلها إلى كلام مسموع، مما يحسن إمكانية الوصول.
تلميح: فكر في الوظيفة الأساسية التي يقدمها هذا الزر للمستخدمين.
التصنيف: تعريف | المستوى: سهل
ما هي الخطوة الأولى في برمجة حدث النقر (Click) لزر تحويل النص إلى كلام في MIT App Inventor؟
الإجابة: تحديد حدث Click (الضغط) لمكون text_to_speech_button.
الشرح: يجب أولاً ربط الحدث (Event) الذي سيؤدي إلى تنفيذ الوظيفة، وهو في هذه الحالة نقر المستخدم على الزر.
تلميح: راجع الخطوة الأولى في القائمة المرقمة في النص.
التصنيف: صيغة/خطوات | المستوى: سهل
ما هي الخطوة الثانية في برمجة زر تحويل النص إلى كلام بعد تحديد حدث النقر؟
الإجابة: تحديد الأمر Speak message (رسالة صوتية) لمكون text_to_speech (تحويل النص إلى كلام).
الشرح: بعد ربط الحدث، يجب تحديد الإجراء (Action) الذي سيتم تنفيذه، وهو طلب من مكون TextToSpeech التحدث برسالة ما.
تلميح: تأتي هذه الخطوة مباشرة بعد تحديد الحدث، وهي تتعلق بالمكون المسؤول عن توليد الصوت.
التصنيف: صيغة/خطوات | المستوى: سهل
ما هو التسلسل المنطقي الصحيح لكتل البرمجة في MIT App Inventor لإنشاء زر تحويل النص إلى كلام؟
الإجابة: 1. حدث نقر الزر (when ... Click). 2. أمر Speak message داخل حدث النقر. 3. أمر Join لتجميع النصوص داخل معطى Speak message. 4. إضافة خصائص Text للمكونات إلى أمر Join.
الشرح: يتبع بناء التطبيق منطقاً هرمياً: يبدأ بالحدث (النقر) الذي يطلق سلسلة من الإجراءات المتداخلة، حيث يكون الإجراء النهائي (التحدث) معتمداً على نتيجة الإجراءات التحضيرية (تجميع النص).
تلميح: فكر في التسلسل الهرمي: الحدث (Event) يحتوي على الإجراء (Action)، والإجراء يحتوي على الدوال (Functions) الأخرى.
التصنيف: مفهوم جوهري | المستوى: صعب