<?php
use \Psr\Http\Message\ResponseInterface as Response;
use \Psr\Http\Message\ServerRequestInterface as Request;




$app->get('/getclasstestbystudent', function (Request $request, Response $response, $args) {

    require __DIR__ . '/../../bootstrap.php';

    $token = $request->getAttribute("token");
    $student_id = $token['sub']->id;

    $data = $entityManager->getRepository('Classtest')->getClassTestByStudent($student_id);

    return $response->withJson($data, 200);
});
