Exemplo n.º 1
0
        $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));
}
Exemplo n.º 2
0
<?php

include 'header.php';
//process a report
if ($_POST['report']) {
    $quests = new Questions();
    $quests->report_question($_POST['Qid'], $_POST['reportText'], $user->data['user_id']);
    echo '<a href="index.php">Report Fixed, return to the home page</a>';
    die;
}
$event = 0;
if (is_numeric($_GET['event'])) {
    $event = $_GET['event'];
}
$question = new Questions();
$name = $question->get_event($event);
$number = $question->get_number($event);
$questionTotal = $question->get_number($event);
$status = '3';
$incorrect = '';
$number_attempts = 0;
if ($_POST['giveUp']) {
    $status = 3;
    if ($_POST['type'] == 1 || $_POST['type'] == 3) {
        $incorrect = $question->get_answer_mc($_POST['idval']);
    } else {
        if ($_POST['type'] == 2 || $_POST['type'] == 4) {
            $incorrect = $question->get_answer_short($_POST['idval']);
        }
    }
    $number_attempts = $_POST['attempts'];