If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Mixing different types of question

Please can some one help me to mix my quiz questions in this format: fill in the blank, true or false, multiple answers, matching and the rest. please all my questions are stored on the database. any time that I display my question they come in a radio button format.
here is my code:

The only time when your code has the option of changing how questions are presented is commented out and the if-statement is incorrectly written. It should be if($row[2] == 1) {...} assuming that each element in the $row array (retrieved from the MySQL database) will actually equal a number.

To randomly present the questions in different formats, you could write a function that calculates a random number between a certain range. Using if-else statements or a switch, you can populate it with the question retrieved from your database.

There are a few other concerns and problems with your code. First, what is the purpose of the function, questionTypeNameParseObject, which takes in a parameter that it doesn't use and outputs a variable that has no value. Second, mysql_ functions are going to be out of date, so you should use either mysqli or PDO functions to interact with your MySQL database.