Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Programming beginner- advice with designing a web app

I do a bit of HTML/CSS for fun but I am looking at picking up some programming skills.

I have been reading up on PHP and MySQL. So far I have not found it too hard understanding the concepts such as loops, condition statements etc but I want to get stuck in and start developing an app before I get too bored reading and giving up completely.

My idea...

I happen to be studying for an exam at the moment and have these practice exams on paper. I thought why not put this into an app so I can take the exam on the computer.

Features:

  • The app can hold multiple exams
  • It can randomise questions or display them in order
  • Have the option to display answer for each question
  • Time the duration to complete the exam
  • Admin page to add new exams and questions/answers

Ok, you guys can stop laughing now, I know this is one step above Hello World but thought I'd make a start somewhere!

I will develop this in PHP/MYSQL or maybe RoR if you guys think its better for a beginner. I think I will be ok reading/writing to the DB but I'm not so sure on site structure, DB design and generally best to way to do it.

If I have an exam made up of 50 questions, each given an ID. If I delete one question how do I update the rest with new IDs? I.e. if I delete question 3, all following questions need to shift their ID back by 1.

EDIT:

How would I represent an instance of one exam in my database schema? The exam and question relationship will be one to many, since questions will be unique to a single exam. But since I am aiming to have multiple exams, how do I represent that?


How would I represent an instance of one exam in my database schema? The exam and question relationship will be one to many, since questions will be unique to a single exam. But since I am aiming to have multiple exams, how do I represent that?

like image 749
Fred Avatar asked Aug 23 '09 13:08

Fred


People also ask

What should I learn to make web applications?

To become a Web Developer, you should have an understanding of HTML, CSS, and JavaScript. It's also recommended to learn about CSS and CSS frameworks. Developing these fundamental web development skills will give you the foundation and logic for communicating with programming languages.

What programming language is used for web applications?

Java. Java is one of the most popular programming languages. It is used to develop website content, games, apps, and software. Java is used in the production of most Android apps.


1 Answers

OK, first of all, welcome :) Second of all: yours is not a stupid idea at all, in fact, you have chosen the best way to learn how to program: do something useful and fun.

To get to your question: why do you need consecutive IDs for the questions? Database-wise, you just need to have different IDs per row.

If it is a display requirement, why don't you assign a number over a loop during display? So, for example when you do a foreach to display the questions you can keep an index variable which you increment at each loop, and use that to display the ordinal.

Hope this is what you are looking for, good luck!

like image 72
Sklivvz Avatar answered Oct 17 '22 16:10

Sklivvz