$adminQuestions->updateMCQuestion($_POST['textChange'], $_POST['response1'], $_POST['response2'], $_POST['response3'], $_POST['response4'], $_POST['response5'], $_POST['correct_answer'], $_POST['idval']); } if ($_POST['updateFRQ']) { $adminQuestions->updateFRQ($_POST['textChange'], $_POST['keywords'], $_POST['idval']); } if ($_POST['resetNumbering']) { $adminQuestions->resetNumbering($_POST['event']); } if ($_POST['questionSubmission']) { //questionSubmission is two radio boxes, one approval, one rejection. //update question approval status if set if ($_POST['approval'] == 'approve') { $adminQuestions->questionsApprove($_POST['eventId'], $_POST['questionId']); } elseif ($_POST['approval'] == 'reject') { $adminQuestions->questionsReject($_POST['questionId']); } } if ($_POST['fixall']) { //need to rename the fixall button to something logical $adminQuestions->resetAllEvents(); } $NameStatus = 0; $reported = $adminQuestions->pullReports(); $questions = $adminQuestions->queryQuestions(); $eventList = $question->return_all_events(); if ($questions[0]['eventid'] > 0) { $NameStatus = $questions[0]['eventid']; $EventName = $question->get_event($questions[0]['eventid']); } echo $twig->render('adminHTML.html', array('ReportArray' => $reported, 'ApprovalArray' => $questions, 'EventName' => $EventName, 'Event' => $NameStatus, 'EventList' => $eventList)); }
if ($Question->add_question($_POST['event'], $input, NULL, NULL, NULL, NULL, NULL, NULL, $imageLocation, 4, $_POST['keywords'], $usID)) { echo 'Question Added'; } else { echo 'There was an error'; } } else { if (strlen($_POST['URL']) > 1) { $file = new files(); $imageLocation = $file->pull_image($_POST['URL']); // add_question($eventId,$question, $a, $b, $c, $d, $e, $correct,$image, $type, $keywords, $userID) if ($Question->add_question($_POST['event'], $input, NULL, NULL, NULL, NULL, NULL, NULL, $imageLocation, 4, $_POST['keywords'], $usID)) { echo 'Question Added'; } else { echo 'There was an error'; } } else { if ($Question->add_question($_POST['event'], $input, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 2, $_POST['keywords'], $usID)) { echo 'Question Added'; } else { echo 'There was an error'; } } } } if ($loggedIn) { $question = new Questions(); $events = $question->return_all_events(); echo $twig->render('question_entry.html', array('EventList' => $events)); } else { echo '<br/><a href="../ucp.php?mode=login">Please Login to add Questions</a>'; }