Posted by .:[ ikciu ]:. on 10/03/06 16:03
Zebrawszy mysli MS <MS@nospam.com> wyklepal:
> What I am asking is if anybody has designed such a system that is all
> database driven (so I am not writing conditions for each question) or
> anybody got any ideas of the database structure.
1. No sense to load each question from db whole time. If this quiz has less
then 30 questions try to load all same time. Then just make table with quiz
structure and use session to store it.
2. when you will add question to table do it in show order
3. at the beggining
$_SESSION['currentQuestion'] = 0;
$_SESSION['currentQuestion']++;
... code which will show question
($quizArray[$_SESSION['currentQuestion']])
if(isset($_POST['something']) && $_POST['something'] == 'Y' ||
isset($_GET['nq'])){
...next question from array...
}else{
show link '<a href="?nq=1">next question</a>';
}
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Ikciu | gg: 718845 | www: www.e-irsa.pl
2be || !2be $this => mysql_query();
[Back to original message]
|