• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 222
  • Last Modified:

How Should I Set This Up

Hi, I have been working on a site for a while now and I am completely stuck on a certain section.

The site allows parents to create small e-learning activities for young children, such as:

01 - pick out a certain color crayon from a bunch of crayons (1 additional step required - choose the color crayon that you want the child to pick out)
02 - pick out a certain animal from a bunch of animals (1 additional step required - choose the animal which you want the child to pick out)
03 - move the square object into the square hole (NO additional steps required)

+ many more...

If the parent chooses the first activity from the activity drop down menu when they are building the e-learning activity, they will then need to complete another step and enter in the color of the crayon... The same applies if they choose the second activity, as they will need to enter the animal name, HOWEVER, if the parent chooses the 3rd activity, no further steps / details are required.

I'm trying to figure out how to store the activities into the database and i am confused about how to do this as there are 3 groups of content which need to be saved in the database:

a - there are various different types of activities, which all have various different amounts of steps / settings required when building them which need to be displayed on the front end
b - then there is the chosen settings itself which have been applied / entered for each activity type (such as a chosen color or chosen animal) when an activity type has been chosen
c - and finally, there is the overall info itself that needs to be saved for each individual activity that is added to the site, such as child's name and parents name which are associated with each activity that has been created.

I am very confused as to how I can store all of this info and link it all together in a database and also, how the front end will know how many settings need to be applied / displayed when a user selects an activity type from the drop down at the start.

Thanks for reading all of the above, and a bigger thanks if you can provide any help on this...
2 Solutions
well... for starters...

i'd probably create an activities table... for all the various activities..
create an options table, for all the possible options and have a foreign key referring back to the activities table to specify which activity that particular option is valid for... they options table will probably require option types so that you can specify in the activities table how many of each option type is required before you have a valid selection...
create an activity-option-selection table that has a unique id, and a foreign referring back to the activities table and the options table to keep track of a "selected combination"
create an user-activity-options table that has a unique id and a foreign key back to the activity-option-selected table that refers to which combination they selected

it would really help to draw all this out...  do you use MySQL Workbench?  If not you probably should.

Do you understand how to define Foreign Key relationships?  If not, you probably should.  MySQL Workbench will help you define all that.

That's a pretty big animal.  Definitely something I would spend a few hours "white-boarding".

Ray PaseurCommented:
There are so many moving parts here that it is not really a question with any succinct answer, but a need for computer science education and application design and development.  Here are some concepts that you need to know about.


Normalization (both art and science).

Design Patterns.

That's the tip of the iceberg, but at least some exploration of those concepts will help you get started.  Best of luck with it, ~Ray
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now