//explode a string by the delimitor to array
 $question = array();
 for ($i = 0; $i < $_POST['questionCount']; $i++) {
     if (isset($_POST['question_' . $i])) {
         if (isset($_POST['uq' . $i])) {
             // uq:updateQuestion
             $question_id = $quiz->updateQuestion($_POST['question_' . $i], $_POST['uq' . $i], $member->id);
         } else {
             $question_id = $quiz->addQuestion($_POST['question_' . $i], $member->id);
         }
     }
     if ($mode == "simple") {
         for ($j = 0; $j < $questionArray[$i]; $j++) {
             if (isset($_POST['q' . $i . 'o' . $j]) && isset($_POST['q' . $i . 'r' . $j])) {
                 if (isset($_POST['uq' . $i . 'o' . $j])) {
                     $quiz->updateOptionMulti($_POST['q' . $i . 'o' . $j], $_POST['q' . $i . 'r' . $j], 1, $_POST['uq' . $i . 'o' . $j], $member->id);
                     //default of weightage = 1
                 }
                 if (!isset($_POST['uq' . $i . 'o' . $j])) {
                     //function from quiz.php: addOptionMulti($option, $result, $weightage, $question, $memberID)
                     $quiz->addOptionMulti($_POST['q' . $i . 'o' . $j], $_POST['q' . $i . 'r' . $j], 1, $question_id, $member->id);
                     //default of weightage = 1
                 }
             }
         }
     }
     // end if quiz mode = simple
     if ($mode == "accurate") {
         for ($j = 0; $j < $questionArray[$i]; $j++) {
             if (isset($_POST['q' . $i . 'o' . $j])) {
                 for ($k = 0; $k < $numResults; $k++) {