Click here to Skip to main content
15,889,176 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
multiple choice test management application that will be used by both lecturers and learners. and a Lecture can only set the question by directly typing on the form and saving the questions and the memo to a text file and mean while a student can take that test by longing in and taking the test and receiving their results

What I have tried:

i have implemented the basics but im stuck when i have to create arrays for the questions and how to make the student see their marks after the test.
Posted
Updated 30-Apr-17 3:59am
Comments
CHill60 30-Apr-17 9:49am    
And I am stuck trying to work out what your question is.

1 solution

AS far as the arrays go, I'd store the questions and answers in a file - to make them a lot easier to edit. If you store them as one question and answers per line, and separate them with a character that can't be in the question or answers such as '|' then it becomes really easy to work with. Make the first line of the file the number of questions.
Question|CorrectAnswerNumber|First answer|Second answer|Third answer
For example:
2
What colour is a banana?|2|Blue|Yellow|Green
Which is the odd one out?|3|Tomato|Apple|Lettuce
In your code, create a struct which reflects each question and answer set, and includes question and answer pointers, the correct answer number, and the student answer.
Then write a function which takes a line of text and a pointer to a struct and fwhich fills it in.
Read the file and get the number of questions, then create an array of the struct with that number of values. Read each of the lines in a loop, use the function to convert it.
The array is then easy to use, and you can use the array to work out the student final mark at the end, just by looking through at the answer number they gave.

Make sense?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900