Ok, I can help you here!
I will have some code ready in about 24hours.
I will explain how I will do it;
I will have to create a function on the second page and some sort of code generator on the third.

Thanks for askining this question(I love helping people)!

    sirlemons wrote:

    Ok, I can help you here!
    I will have some code ready in about 24hours.
    I will explain how I will do it;
    I will have to create a function on the second page and some sort of code generator on the third.

    Thanks for askining this question(I love helping people)!

    Its taking me longer than expected, may take up to 72hours.
    I will post when I am done!

      do you have msn as i have done some elements of this which we could maybe combine together?

      Regards,

        j2008 wrote:

        do you have msn as i have done some elements of this which we could maybe combine together?

        Regards,

        Yes, I do, It is sirlemons(at)live.com.au

          Hey J2008,

          This is fairly easy to create. If you are a beginner, I would suggest to start of with 3 basic pages. When you a comfortable with what they do, you put them together in one page, and use a hidden formfield to decide which section of the process you occupy.

          The pages below are an example of how something like this might be done, and should get you started. If you need a processing page for your final form, have a look at page 3, and follow that logic. Of course these are barebone examples, which you might want to expand a bit to do more thorough data verification.

          page 1: The first question:

          <html>
          <body>
          <h1>How many options?</h1>
          <form action="page2.php" method="post">
          <select name="ocount">
            <option>Select number of options per questions</option>
            <option value="1">1</option>
            <option value="2">2</option>
            <option value="3">3</option>
          </select>
          <select name="qcount">
            <option>Select number of questions</option>
            <option value="1">1</option>
            <option value="2">2</option>
            <option value="3">3</option>
          </select>
          <input type="submit">
          </form>
          

          page2: generating the input form:

          if(is_numeric($_POST['ocount']) && is_numeric($_POST['qcount']))
            { 
            echo "<form action=\"page3.php\" method=\"post\">";
            for($i=0; $i< $_POST['qcount'])
              {
               echo "Question ".$i;
               for($j=0; $j< $_POST['ocount'])
                 {
                  echo "<input type=\"text\" name=\"question[".$i."][]\"><br />";
                 }
              }
            echo "
            <input type=\"submit\">
            </form>";
          }
          

          page 3; the generation of the form to be saved:

          if(isset($_POST['question']) && is_array($_POST['question']))
            {
            echo "<form action=\"page3.php\" method=\"post\">";
            foreach($_POST['question'] as $i=> $qs)
              {
              foreach($qs as $thisanswer)
                {
                echo "<input type=\"radio\" name=\"answer[".$i."][]\">".$thisanswer;
                }
              }
            echo "
            <input type=\"submit\">
            </form>";
            }
          
            leatherback wrote:

            Hey J2008,

            This is fairly easy to create. If you are a beginner, I would suggest to start of with 3 basic pages. When you a comfortable with what they do, you put them together in one page, and use a hidden formfield to decide which section of the process you occupy.

            The pages below are an example of how something like this might be done, and should get you started. If you need a processing page for your final form, have a look at page 3, and follow that logic. Of course these are barebone examples, which you might want to expand a bit to do more thorough data verification.

            I am already dealing with this situation and am working with the user to make it better and just as they request.

              sirlemons wrote:

              I am already dealing with this situation and am working with the user to make it better and just as they request.

              ok, wasn't sure whether you were up to it, as you mentioned it was going to take three days to do for you, after which there were no more posts.

              Please make sure you post back the code/solutions, as in the end this forum is also about providing a resource for people to find solutions. If you just move off the forum with people, this site would be filled with questions, and no solutions.

              Cheers,
              J

                I will now report you in my progress;
                I have created a form to allow customisation of number of questions/answers,
                I have created a form to allow customisation of quiz title, questions and answers(still adding final touches to this),
                I have begun to create a way to export the quiz into an XML document and have also begun the proccess of outputting the resulting HTML code for a quiz

                  I will now report an approximate time to go;
                  I have approximately an additional 48hours to go.

                    Sirlemons thanks for the update, if you could add me to MSN Messenger as im unable to send you a PM my email is j e e v 8 6 @ h o t m a i l . com just remove the spaces.

                    Regards,

                      What ideally i would require is the questionnaire to be built and then be able to collate the results from the multiple choice answers within a mysql database

                      So say if for example 6 people completed the questionnaire and all answered yes to the following question

                      Do you like football?

                      Yes [SELECTED] NO []

                      Mysql table for that question above would show the numeric value 6.

                      Obviously i would need this for multiple questions......

                      What ive done is managed to create a table called

                      responses

                      this basically allows the person who is creating the questionnaire to select the method of response....

                      So they can choose from the following types of response

                      Yes/No
                      Excellent (through to) Poor
                      1 (through to) 10
                      Strongly Agree (through to) Strongly Disagree.

                      They can also add their own type of response an rectifying exisiting responses.

                      I have also create a table called questions

                      this contains the following

                      questionid

                      qnumber_1
                      qnumber_2
                      qnumber_3... through to
                      qnumber_25
                      qdesc - Questionnaire Description
                      rid - Links to Response ID in the responses table

                      all of the question_X fields will contain the question name.... but im wandering should i create a separate table to store the response results..... or is there a simpler method this is another point at which im really stuck.... :s

                      Many Thanks J

                        j2008 wrote:

                        What ideally i would require is the questionnaire to be built and then be able to collate the results from the multiple choice answers within a mysql database

                        So say if for example 6 people completed the questionnaire and all answered yes to the following question

                        Do you like football?

                        Yes [SELECTED] NO []

                        Mysql table for that question above would show the numeric value 6.

                        Obviously i would need this for multiple questions......

                        What ive done is managed to create a table called

                        responses

                        this basically allows the person who is creating the questionnaire to select the method of response....

                        So they can choose from the following types of response

                        Yes/No
                        Excellent (through to) Poor
                        1 (through to) 10
                        Strongly Agree (through to) Strongly Disagree.

                        They can also add their own type of response an rectifying exisiting responses.

                        I have also create a table called questions

                        this contains the following

                        questionid

                        qnumber_1
                        qnumber_2
                        qnumber_3... through to
                        qnumber_25
                        qdesc - Questionnaire Description
                        rid - Links to Response ID in the responses table

                        all of the question_X fields will contain the question name.... but im wandering should i create a separate table to store the response results..... or is there a simpler method this is another point at which im really stuck.... :s

                        Many Thanks J

                        Its sounds like you are wanting a poll? Am I correct? If so, do you still want a quiz maker?

                          sirlemons wrote:

                          Its sounds like you are wanting a poll? Am I correct? If so, do you still want a quiz maker?

                          What i need essentially is a method of building the Questionnaire / Quiz. Then a method of collecting the results....... then outputting the statistics in numerical figures for analysis. Then perhaps using something like the google charts API to show the results in a graphical format such as a pie chart.

                          So for example if 60 out of 100 users answer the following question

                          Do you love chocolate?

                          Yes = 60 no = 40

                          So this to appear in a table with the results from all the other questions contained within the same questionnaire and also an option so it can be viewed as a chart like the one below:

                          http://chart.apis.google.com/chart?chs=250x100&chd=t:60,40&cht=p3&chl=Yes|No

                          im really baffled on how to combine all the elements together i understand some areas but not others :S

                            j2008 wrote:

                            What i need essentially is a method of building the Questionnaire / Quiz. Then a method of collecting the results....... then outputting the statistics in numerical figures for analysis. Then perhaps using something like the google charts API to show the results in a graphical format such as a pie chart.

                            So for example if 60 out of 100 users answer the following question

                            Do you love chocolate?

                            Yes = 60 no = 40

                            So this to appear in a table with the results from all the other questions contained within the same questionnaire and also an option so it can be viewed as a chart like the one below:

                            http://chart.apis.google.com/chart?chs=250x100&chd=t:60,40&cht=p3&chl=Yes|No

                            im really baffled on how to combine all the elements together i understand some areas but not others :S

                            Ok, since you do not need a quiz maker, I cannot help you there as I have little experience to put a MySQL database with a google Chart. Try posting a new thread with a more desciptive title saying that you need help with a MySQL databse and a google chart to make a poll.

                              Write a Reply...