r/PHPhelp • • Jul 20 '20

Seeking advice on developing functionality for a web app

I’m still a novice, but I need to develop a web app for school children to use for home learning. (It doesn’t have to be a complete application, but just have some good functionality.) So far I have a homepage, a login for the pupils, a separate login for the teacher, and a logged-in page for each. I’d really appreciate some advice please, about the following ideas, if they’re doable with PHP and MySQL, and if you have any suggestions on the best way I could go about this? I’ve got lots of ideas but feel overwhelmed and unsure about where to even begin. Thank you so much!

I’m thinking of having a multiple choice quiz for the pupils and for their results to be stored in a MySQL database. I’d like for the logged in pupil to be able to view their own results, and for the logged in teacher to be able to view all pupils’ results.

I also thought it would be good if I could somehow generate a ‘class average’ based on all pupils’ results for the teacher. And would it be possible for it to show what pupils have and have not completed the quiz?

7 Upvotes

10 comments sorted by

4

u/Atulin Jul 20 '20

Everything you mentioned is perfectly doable.

2

u/nealio82 Jul 20 '20

As other replies have said, this is a perfectly plausible use-case for PHP & MySQL.

If this is an application which is going to be used by people other than yourself (ie, it's going into production somewhere and not just living as a proof-of-concept on your own computer), I would definitely suggest looking at using a framework to help you. Frameworks take care of things like application security, password hashing, logging in / out, database connections, organising your code (such as separating your logic from your templates), and sometimes even creates the database tables for you.

Frameworks take care of the implementation details and help you focus on building your ideas.

I would suggest looking at:

  1. CodeIgniter - super simple framework, and the tutorial videos for CI v3 were excellent

  2. Laravel - not my favourite framework, but is extremely popular, quick to get going with, and does a lot of the hard work for you

  3. Symfony - my personal favourite, but has a steeper learning curve

2

u/halfercode Jul 20 '20

If you are able to show any of your existing code, please do - sign-in and password handling are two quite difficult topics.

1

u/alex_3410 Jul 20 '20

yes its perfectly possible

what you need to do is create a table for the quiz to store the users answers in, then add a column to the table for userID which you can then use to link to a users ID in the users database

you can then query it along the lines of:

give me all quiz results for the user with the ID of X

1

u/keithmifsud Jul 21 '20

I would suggest you take a look at the Laravel framework as it will get you up and running in a few days. The login etc..would have not required you any work.

I'm not an advocate on any framework but I am sure that it will help you with all the listed requirements and you're still able to extend the home learning app in the future.

3

u/[deleted] Jul 20 '20

[removed] — view removed comment

1

u/ClearAlternative Jul 20 '20

Thanks, I mean I’d like for the quiz to be available in the pupil’s webpage, and then for the various results to be on the pupils and teachers’ profile pages, it’s something I’ve never done before. I still haven’t made a quiz yet.

1

u/g105b Jul 21 '20

First set yourself some extremely simple projects and complete them, document them and put them online for people like us to comment on.

Start with the infamous to-do list app, then try things like a hangman game and address book.

Try to learn to build these yourself rather than finding tutorials specifically for those projects.

3

u/[deleted] Jul 20 '20

[removed] — view removed comment

2

u/albierto Jul 20 '20

You are limiting the test to 4 answers. If OP wants something that can scale in the future I would make another table like answers with: ID, TEST_ID, TYPE (checkbox,radio,text), TEXT, POINTS, IS_CORRECT.

This can handle a complete quiz