Ejemplo n.º 1
0
     header("Location: ../webroot/modifyQuiz.php?step=2&id=" . $quiz_id);
     break;
 case 2:
     // save the quiz results
     // get the id from the form
     $quiz_id = $_POST['id'];
     // save the results from step 2
     $quiz = new Quiz($quiz_id);
     // Quiz Results
     for ($i = 0; $i < $_POST['resultCount']; $i++) {
         if (isset($_POST['result_title_' . $i]) && isset($_POST['result_description_' . $i]) && isset($_POST['result_picture_' . $i])) {
             $result_title = $_POST['result_title_' . $i];
             $result_description = $_POST['result_description_' . $i];
             $result_picture = $_POST['result_picture_' . $i] != "" ? $_POST['result_picture_' . $i] : "none.gif";
             if (isset($_POST['ur' . $i])) {
                 $quiz->updateResult($result_title, $result_description, $result_picture, $_POST['ur' . $i], $member->id);
             } else {
                 $quiz->addResult($result_title, $result_description, $result_picture, $member->id);
             }
         }
     }
     // check the direction to go
     if ($_POST['save'] == "Previous Part") {
         header("Location: ../webroot/modifyQuiz.php?step=1&id=" . $quiz_id);
     } else {
         header("Location: ../webroot/modifyQuiz.php?step=3&id=" . $quiz_id);
     }
     break;
 case 3:
     // get the id from the form
     $quiz_id = $_POST['id'];