vendredi 26 mai 2017

Randomizing Questions In Online Exam System

Good day, i am a php programmer i got a contract of developing an online exam management system. I am having a problem of generating random questions for each student so that no two student will have then same questions. I used the MySql RAND() function but it is not giving the desired result. It shows a random question when a student clicks on the NEXT button and another random question when the student clicks on the PREVIOUS button thereby causing a flaw in the system. I will be grateful if someone helps me through this hard times.

The MySql implementation i used

$FetchQuestion=executeQuery("select * from question where testid=".$_SESSION['testid']." and qnid>=RAND()*(SELECT MAX(qnid)FROM question);");




Aucun commentaire:

Enregistrer un commentaire