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...
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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".


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.