Android Question IMAGE quiz help (1 img question + 4 img answers)

softimagerx

New Member
Hello Everybody :)

First of all, Thanks Basic4android team for your great piece of software :) ... I have decided to make image quiz app - 1 Image question and 4 image answers. I'm pretty new to Basic4android... There are many examples in the forum of Quiz apps with Text answers only...

Pourpose of the game will be to click on the right answer to get to the next level that shows another possibly Randomized image question with 4 answers.

Will you help me and make a little b4a example project with 2 levels? I think that you'll say that SQL skills are required but I don't have any yet.

My version with Not randomized question is something like this:

B4X:
Sub ImageView1_Click
   
    RadioButton1.Checked = True
   
    If RadioButton1.Checked = True Then
    If Label1.Text = "Level 2" Then
        Msgbox("CORRECT", "GREAT")
            ImageView1.Bitmap = LoadBitmap(File.DirAssets, "5.png")
            ImageView2.Bitmap = LoadBitmap(File.DirAssets, "6.png")
            ImageView3.Bitmap = LoadBitmap(File.DirAssets, "7.png")
            ImageView4.Bitmap = LoadBitmap(File.DirAssets, "8.png")
            RadioButton1.Checked = False
            Label1.Text = "Level 3"
          Else 
        End If
  End If
End Sub

I know it's bad way to code this kind of app and that's why I need help from you.

I don't mind paying few euro/dollars to your paypal/bank account for help! ;)

Thank you!
how_to_question_answer_images.jpg
 

Beja

Expert
Licensed User
Longtime User
I would reuse the same images, and dynamically change the answer text according to the questions.
then will redraw the imageview that holds the correct answer with the a very slight change in color that can not be recognized by the eye.
This way you will have endless number of levels. you will only need to randomize the images' locations.
Don't worry about the payment!
 
Last edited:
Upvote 0

softimagerx

New Member
I would reuse the same images, and dynamically change the answer text according to the questions.
then will redraw the imageview that holds the correct answer with the a very slight change in color that can not be recognized by the eye.
This way you will have endless number of levels. you will only need to randomize the images' locations.
Don't worry about the payment!

Thank you for the answer, but there will be no answer text... Just images :) :
how_to_question_answer_images2.jpg

I think I need somehow to put image names in the database... 4 answers + 1 question for each level... Then display new each time user chooses correct answer. Both images and answers are PNG's... Hmm? Any other solution for a novice user? :)
 
Upvote 0

strat

Active Member
Licensed User
Longtime User
You don't need database. You only need a text file and true image names.
You can use such a method:
Put all images in a folder and rename images according to level number
Image+levelno+1.jpg
Image+levelno+2.jpg
Image+levelno+3.jpg
Image+levelno+4.jpg
Image+levelno+5.jpg

Create a text file and put only true answer at each line. For example,
2
1
2
4
3
1
Then, in game, load images to imageviews.
Get text file into a List object. Produce a number between 1-4 at imageview's onclick event. If player click true imageview, increase the level.
 
Upvote 0

Beja

Expert
Licensed User
Longtime User
Like start said, you don't need a database.. but I would say you even don't need a text file..
give the same name to the question and its correct answer images with 1 letter difference at the end of the question name.
then compare the question image name (minus that letter), with the answer. If true go to next level.
 
Upvote 0
Top