Database for a quiz app

Hi everyone!! I’m new to glide. I wan’t to create a quiz app. So I create the database like this.
1 sheet for users.(profile)
1 sheet for categories.(GK,Maths,History etc)
1 sheet for levels(Level 1, Level 2, Level 3 etc)
and I sheet for Questions.

Questions

  1. First I added some questions in question sheet for history and I added a categorie in categories sheet it’s history and added 2 levels in levels sheet.
    So when I add questions how do I know It’s for history categorie and what is the level for the question?
1 Like

In your Questions sheet, include a column for CategoryID. Use that to link to your Categories sheet.
A separate sheet for Levels is probably overkill, unless you have lots of additional Level attributes. If not, then you could just include a “Level” column in your Questions sheet.

Thanks @Darren_Murphy . I wan’t to add like 20, 30 levels for a category. So for that what should I do?

Does a level have any other attributes besides a number?

Each level has 5 questions.

woah, slow down a little bit. You haven’t even got your basic structure sorted out yet, and you’re already jumping into scoreboards.

I see that you asked a bunch of related questions a few days ago, and @Jeff_Hager gave you some very good advice in response. Please go back and re-read what Jeff had to say. Instead of trying to build the whole app in one go, just focus on one part of it at a time.

Now, you asked me about levels, and I asked a follow up clarifying question:

… which you haven’t answered. So I’ll ask it again. Is each level just a number, or does it have other attributes such as a name, description, etc? If levels are just numbers, I’d just include a level number in your Questions table. Otherwise, you may need a separate table and then include a LevelID column in your questions table.

And again, as Jeff said, lots of us here will be willing to help you - but if you start throwing a dozen different questions out at once, and don’t bother answering questions or following advice that you’re given, then that will most likely turn people off.

1 Like

No.

I apologize for asking many questions from you @Darren_Murphy. Thanks

That’s fine. So, Levels are just numbers. Therefore my advice will be to just include a Level number in your Questions sheet. And as I mentioned in my first reply, you can link Questions to Categories by including a CategoryID in your Questions sheet.

Thanks @Darren_Murphy. I create like that and It works.

@Darren_Murphy how do I give them points for each question?

Will all questions be worth the same number of points, or will some questions be worth more?
If the number of points differs for some questions, then you would need to include a Points column in your Questions sheet. Then when a user answers a question correctly, you just allocate the number of points associated with that question.

One thing you should think about - will each user complete the quiz just once, or could they do it multiple times?

@Darren_Murphy points are changing. Not the same.

If the user completes the 1st level he can’t do again the 1st level. Like inside a category there are 30 or 50 levels and when the user completes the first level he can’t do again 1st level. when the user completes
the 1st level and when he tried again to retake the 1st level and he clicked level 1 show a message you are completed this level. like this.

Okay.
What I would probably do is include a User Specific boolean column in the Questions table. Then as a user completes each question, you set that column to true. You can then use that as a filter so that each user only sees questions that they haven’t completed yet.

Hi @Darren_Murphy !! I created the column.
boolean
Then what should I have to do? :blush: :blush:

What do you think you should have to do next?

1 Like

What @Darren_Murphy mentioned after the creation of the column largely depends on how YOU currently have your app flow set up or how YOU want it to flow.

  • How do YOU want that column to populate?
  • What kind of user interaction would YOU want to cause that question to be marked as finished and completed?
  • Does the user click a button?
  • What should that button do?
  • Does it need to first verify if the question is correct first?
  • If correct, should it add that questions points to a user’s total points and mark that question as finished?
  • Should it do anything else?
  • Do you want to filter the question so it’s no longer visible, or just do you want to let them view it, but not answer again?
  • What have you set up as far as screens?
  • How are you displaying Categories, Levels, Questions in your app?
  • How are you moving from one question to the next?

There’s millions of ways to approach a problem and a million more ways to solve them.

  • Have you planned out how you want the app to flow?
  • Do you have a plan for how each part of should connect and interact with other parts of the app?
  • Do you have a basic app structure already set up?

To be honest, I think we are covering some very basic concepts here and I think to reach your goal will first take some basic understanding of how glide works. Otherwise this could become a very large, time consuming, and drawn out thread if we need to walk through each individual step of building an entire app. Have you taken the time to go through the Glide documentation or any of the tutorials?

Glide also has some very good step by step walkthroughs to help you get started at building apps. Some of the documentation and videos show an old version of glide, so it may be a bit confusing, but the general concepts are still the same.

Some basic key things you’ll need to understand are the following. It’s only brief list, but will go a long ways to understanding how to structure and build your app.

What I usually do is start with a very basic layout of the app and get some basic tables set up with some sample data. Then I get a rough version of my screens set up and connected if one table need to relate to another table. Then I usually start to add extra features and columns to tables as needed. Sometimes I later discover that I may need to restructure my tables and make changes. Once you have the basic layout, then you can move on to the extras. It might be worth it to first see if you can create something basic where you simply answer questions. Later you can worry about points and how to accumulate them. If you do get stuck, then it helps us a lot if you include screenshots or videos that describe what you are attempting to do and what may not be working.

3 Likes

Thanks @Jeff_Hager . I watched these tutorials and I worked with them .So I created the database and I insert some questions. now I’m doing the level part. So I want to create the levels like a user completes a level then the completed level is locked and when the user clicks that level to retake the level show a message that you have completed this level. So First I want to create this one and then I’m creating the question display part. So how can I create this level display part?

Assuming that you will always have 5 questions in a level, you could use a relation to link the level to the questions (which you should already have), then use a rollup that uses the relation and counts the number of true (completed) questions from the Boolean column you created above. Then create an IF column that will compare that completed question count for the level and compare it to the number 5. If the rollup count equals 5 then return ‘true’. Then you can create a custom action on the level list that contains an If statement and will check that IF column value in the table to see if its ‘true’. If it’s true then the level is complete and you can show a notification. Else you can have an action to Show the Details screen of that level.

Hi @Jeff_Hager . Thanks . Can you explain this from screenshots? If you can. Because I didn’t get it yet. :confused: