Have a Test model which as a unique identifier (BigAutoField). Get a Questions model with a foreign key to a test and a charfield for the question itself (you can add BrinIndex for optimization). You can add a booleanfield if the question is optional and whatever else you need (like the correct answer letter). Get an Answers model with a foreign key to a specific question. This is the most efficient.
You say you don’t need authentication, but it looks like students need some kind of it... BUT there is an alternative. If the student doesn’t have to fill out their name, then, using paths, you can show the student a URL that is connected to a record on another model. It could look like this: example.com/test/3?completed=846 With the path of completed=846, a view can query this new model, we’ll call Completed, that has the following attributes (columns): id (BigAutoField) and Your_Answers (ArrayField/JSONField Both PostgreSQL only). The view does a query on the test (test 3) to show and now also has data from the Completed table at the row with id=846. Just to open your mind up to another world WHICH IS NOT EFFICIENT AND NOT PRETTY TO IMPLEMENT SO PLEASE DO NOT DO IT... You could also try it with PostgreSQL’s JSON attribute. Just make a test model which includes a unique identifier and a json field. The JSON field would just have keys be the question number (1-10) and then a... nvm here’s an example of a piece of json. { 1: {“question”: “What is your name?”, “answers”: [“blah1”, “blah2”, “blah3”] } 2: {“question”: “What is your ethnicity?”, “answers”: [“blah1”, “blah2”, “blah3”] } } You could also try it NoSQL style with MongoDB. Each document is a test with a unique identifier Good luck! On Wednesday, November 20, 2019 at 12:21:38 AM UTC-5, Amitesh Sahay wrote: > Hello Members, > > > I have below requirements for a project where I need to develop the model > based on "multiple Choice Questions". Below are the criteria:- > > > > Admin can create/edit/delete(soft delete only) a "Test" in the form of > MCQs.Admin can then create/edit/delete a "Question" > to each test. Each question contains the actual question, the correct > answer and 3 incorrect answers. An admin can mark a question as mandatory or > optional. An optional question can be skipped by the student.Admin can also > set the marks for each questionStudent > can view a testStudent can attempt a test. Every test can be attempted > multiple times. Each attempt is scored and saved separately. Since the > questions are in MCQ format, the students answers are auto-evaluated by the > application. > > > This is something very new for me. So, I am little reluctant on how to create > the model for the above requirement. Here I do not need to develop any > authentication environment. > > > > Any help would be highly appreciated. > > > > > > > > Regards, > Amitesh -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/8c6eb210-dfe4-42e4-8d16-71aa78ebceb5%40googlegroups.com.