$questionArray = explode("_", $_POST['optionCounts']);
     $question = array();
     for ($i = 0; $i < $_POST['questionCount']; $i++) {
         if (isset($_POST['question_' . $i])) {
             if (isset($_POST['uq' . $i])) {
                 $question_id = $quiz->updateQuestion($_POST['question_' . $i], $_POST['uq' . $i], $member->id);
             } else {
                 $question_id = $quiz->addQuestion($_POST['question_' . $i], $member->id);
             }
         }
         //EDITED BY YL 2sep removed weightage for test
         // Quiz Options
         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->updateOptionTest($_POST['q' . $i . 'o' . $j], $_POST['q' . $i . 'r' . $j], $_POST['uq' . $i . 'o' . $j], $member->id);
                 } else {
                     $quiz->addOptionTest($_POST['q' . $i . 'o' . $j], $_POST['q' . $i . 'r' . $j], $question_id, $member->id);
                 }
             } elseif (isset($_POST['q' . $i . 'o' . $j])) {
                 if (isset($_POST['uq' . $i . 'o' . $j])) {
                     $quiz->updateOptionTest($_POST['q' . $i . 'o' . $j], 0, $_POST['uq' . $i . 'o' . $j], $member->id);
                 } else {
                     $quiz->addOptionTest($_POST['q' . $i . 'o' . $j], 0, $question_id, $member->id);
                 }
             }
             //end else
         }
         //end for loop
     }
 }