I have a simple php template that I've used to make quizzes like this one:
<[login to view URL]>
[login to view URL] in attachment.
It works well. However, all the data has to be typed into that particular file.
I now am trying to change it so that students can search for a quiz (by quiz ID), and the amount of questions they want, and those questions will be selected randomly from a table in a database.
I've started work on this here:
<[login to view URL]>
There's only one quiz id in the database so far - 1. Search using this and you'll be taken to
<[login to view URL]>
This is the file that I need the work done to for this project:
Essentially I want it to operate in the same way as the 10 x tables quiz in terms of feedback given in terms of score, ticks and crosses displayed, etc.
## Deliverables
I now want the [login to view URL] file to work in a similar fashion to the [login to view URL] file in terms of response to student answers.
Ie: There should be functionality given to the text box for student response in the "Question" column of the table, to the right of the actual question ($question) .
Then, in the 'Answer' column, the student's answer for each question should be echoed once the 'Submit' button is pressed.
If the answer the student submits = the answer for the corresponding question in the quizzes table in the database (ie: if student answer = $answer), then the tick should appear in the feedback column. (ie: echo '<img src="images/feedback/[login to view URL]" alt="Ccorrect" />'; )
If student answer != $answer, then the cross should appear.
Ie: echo '<img src="images/feedback/[login to view URL]" alt="Incorrect" />';
The scores should be tallied in the same way as they are in the [login to view URL] file, and the feedback given in exactly the same manner.
(NOTE: $num_rows gives the amount of questions. A percentage has to be worked out on the basis of answers correct / $num_rows * 100.)
Ie: The student should be given feedback based on the name they enter.
Also, if they score 100%, they should recieve the same message that appears in the [login to view URL] file.
Ie:
echo "<strong>That's a perfect score $name. You might like to try another test now that you've conquered this one. Keep coming back to revise though. You don't want to forget all the things you've learnt!</strong>";