LM-Light Standard : Creating Courses : Starting a Test
When you start a test, you should tell the LMS so that it can update its record of test attempts. The LMS may also want to check whether the student has exceeded a specified maximum number of test attempts. This is very easily done by embedding the following LM-Light statement somewhere in the course - usually on the same page as the first question:
<?php LMregisterTestAttempt(); ?>
Note: Some developers prefer to register the test attempt after all the questions have been answered but just before the test is graded. There is nothing in the LM-Light standard to prevent this - simply include the LMregisterTestAttempt tag on the page where the test is graded.
Here is a simple example:
<?php require "LM-Light.php"; ?> <?php LMregisterTestAttempt(); ?> <html> <head> <title>Question 1</title> </head> <body bgcolor="#ffffff"> <p>This is the first question. </body> </html>
Note that the page is not bookmarked. Although this is not a requirement of the LM-Light standard, this is generally the case for mastery test questions to prevent the student 'jumping' back into a course part way through.