App help - solved

Please help make the following variations to the quiz app that I am working on modifying.

  1. Instead of an image hint for each question, I would like to add a sound clip. Example: Question 1 is a question about Roosevelt, there is an image of Roosevelt. For question 2 I would like to have a sound file, and then have a question regarding the sound file.
  2. How do I modify the blocks of code so more than one correct answer is accepted (i.e. fifty or 50, three or 3, magic or Magic) would all work as the correct answer?

You probably will need a List of sounds. Question are images? How can a question be an image? You will probably need to use a button to play a sound to ask someone to identify it as bird, dog barking, oldies music, baby crying etc.
Provide an example of how you intend to 'ask the question'

Option A
It assumes someone needs to type the answer into a TextBox. If so use the upcase / downcase Block and apply it to the TextBox text so the answer for magic or Magic is always MAGIC.

Option B

Use complex Logic blocks and if else if Blocks.

Read Programming Your App to Make Decisions and learn how to use complex conditional statements. An or block seems appropriate to allow multiple answers.

To allow for all these options, your question and answer structures will have to be more flexible, stored as JSON text and translated into dictionaries for the quiz player.

Here's one dictionary structure to try:

Test = list of question dictionaries

question dictionary =
attribute question_sound_clips = list of audio files (0- 1 items allowed),
attribute question_pictures = list of picture files (0 - 1 items allowed)
attribute question_text = possibly blank text
attribute question_multiple_choice_texts = list of text selection choices (0 - many allowed)
attribute question_multiple_choice_pictures = list of picture selection choices (0 - many allowed)
attribute question_multiple_choice_sounds = list of sound selection choices (0 - many allowed)
attribute acceptable_text_answers = list of acceptable text responses
attribute acceptable_picture_answers = list of acceptable picture choice responses
attribute acceptable_sound_answers = list of acceptable sound choice responses

You can find JSON editors online, and the Web component can be used to turn JSON into dictionaries.

You can keep the JSON as text files in the Media folder.

This scheme would not cover captchas, like Click on All the pictures with Motorcycles.

Each question has an image attached with it. Example: A question regarding president Roosevelt, has an image of Roosevelt. Instead of an image on one of the questions I would like to add a .mp3 or .wav file.

Can you present blocks of code showing how to effectively use the upcase / downcase block in my blocks of code please?

Yeah, I'm not entirely sure how to do all of that quite yet. If possible, looking for a fix with blocks of code. Thank you for your recommendation.

If there will be only one choice of question presentation (sound, text, or image per question), you could use an if/then test on the question text before presenting it, using the Text Contains block.

If the question contains '.mp3' then
play the mp3 file
else if the question containg '.png' then
display the image
else
show the text in a Label

What if I changed the entire format of the quiz to all buttons with an attached image and whenever the button is clicked a sound file plays. Example: Question 1. A button with an image of Roosevelt (when clicked plays a recording of his speech). Question: "Which famous speech of Roosevelt's is this sound recording?"

Whatever in the TextBox is 'uppercased'

upcase

Use a Button (or a clickable Image) and a Sound or Player component using code similar to
sound

President's Quiz might be helpful for your questions

1 Like

Here's an old project of mine (Got Your Nose) with image based questions:

1 Like

I am rebuilding the app based off of the presidents quiz.
What I don't understand is when you connect to the app and the first image and question is of Roosevelt and then it proceeds to question 2 how do I make the clickable image (and sound) only appear for question 2, and then not appear for the rest of the questions in the quiz?


I am rebuilding my quiz designed after the presidents quiz. Instead of question 2 just being an image, how would I edit my blocks of code to also make it play a sound of a spider crawling.

examples are always the most helpful, so thank you for providing your previous app design.

Do you have the sound of a spider crawling?

I do have it uploaded to my app.

(Canned Reply: ABG- Export & Upload .aia)
Export your .aia file and upload it here.
export_and_upload_aia

how to add clickable to a single image in President's Quiz


add the Blocks circled in green, add your mp3 to Media and you are good to go. :wink:

This code will play the sound file ONLY on the roosChurch.gif image when it is displayed.

how to make the entry insensitive to case (accepts magic or Magic etc. as a correct answer.

1 Like

Thank you very much for your due diligence! It is appreciated.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.