<?php

session_start();
include_once '../config/properties.php';
include_once "../resources/EncryptDecrypt.php";
require_once('../config/database.php');
include_once "../resources/assessment.php";
ini_set('display_errors', 1);
error_reporting(E_ALL);
if (isset($_POST['oid'])) {
    require("../resources/manageusers.php");

    $oid = $_POST['oid'];
    $ano = $_POST['ano'];
    $aid = $_POST['aid'];

    $assessment = new Assessment();

    $assessment->offering_id = $oid;
    $assessment->user_id = $_SESSION['uid'];
    $assessment->attempt_no = $ano;
    $assessment->assessment_id = $aid;
    $times = array();
    $stmt = $assessment->get_quiz_time();
    while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
        array_push($times, $row['time']);
    }
}
echo json_encode($times);
?>

