You are here: Re: Question Flow Control « All PHP « IT news, forums, messages
Re: Question Flow Control

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();

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация