I’m currently working on a site which allows students to make tests. These tests have a ‘ready’, ‘start’ and ‘finish’ page and there are 3 types of tests (‘intake’, ‘normal’, and ‘final’). A lot of the functionality of these different kind of tests overlap. Each type of test has its own table, its own questions (intakequestions, normal questions and end questions) and results.
Currently I have implemented them as seperate controllers, but this is getting unhandy scalability-wise. What would be the best approach from a high level point of view?
I’m thinking about this:
TestModule with ready, start and finish actions (+ functions)
ResultModule with different views (results/group, results/user, results/test)
QuestionWidget to generate the questions of the Tests?
Thank you for your reply. The idea for using a general TestController makes sense. Could you describe when it would be better to make a TestModule over a general TestController with intake/normal/finalController?
And what would be included in the CreateTestModule?
Edit: The different Tests do also use common views (which have an overlap of about 90%). I feel like module is more logical then, or am I totally wrong about that?
I an fairly new to all of this too, but here are my thoughts.
I think a module comes in when you may need to use the same functionality in another app. Modules, from what I’ve read, are basically a web app in and of themselves. I have also seen a tutorial (somewhere) that talks about making a standard WebApp into a module, so if later you need this testing app on another site then…
You ‘common views’ comment leads me to think a controller would be a better idea also. In the views folder you could have numerous sub views that all relate to testing. You could make an entry view that then calls renerPartial() all the other parts (see update/create in the skeleton app). I am working on a site that has users login info in 1 table and profile info in another.
To view thier info, the controller sets up the $models, and calls render(‘view’, array(…)). The view.php file: