- TestMgr added

This commit is contained in:
Wiesner András 2024-09-25 09:23:52 +02:00
parent b34045a89d
commit dbed288e2d

39
class/TestMgr.php Normal file
View File

@ -0,0 +1,39 @@
<?php
require_once "globals.php";
class TestSummary
{
public int $challengeN; // Number of challenges
public int $correctAnswerN; // Number of correct answers
}
class Test
{
public int $_id; // ID
public string $gameId; // ID of associated game
public string $gameName; // Name of the associated game
public string $state; // State of the test (ongoing/concluded)
public bool $timeLimited; // The user is allowed to submit the test in a given period of time.
public int $startTime; // Start time (UNIX timestamp)
public int $endTime; // End time (UNIX timestamp)
public int $endLimitTime; // Time limit on test submission (UNIX timestamp)
public TestSummary $summary; // Summmary, if game has ended
public array $challenges; // Test challenges
}
class TestMgr
{
private \SleekDB\Store $db; // test database
function __construct()
{
$this->db = new \SleekDB\Store(TESTDB, DATADIR, ["timeout" => false]);
}
// Get test by ID.
function getTest(string $testid): Test|null
{
}
}