Revert "- TestMgr foundations"
This reverts commit 60e040245551d820a5dfcee538188c1058532e54.
This commit is contained in:
		
							parent
							
								
									60e0402455
								
							
						
					
					
						commit
						1504c483fc
					
				@ -1,7 +1,5 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
require_once "globals.php";
 | 
			
		||||
 | 
			
		||||
class Game
 | 
			
		||||
{
 | 
			
		||||
    public const DEFAULT_GAME_PROPERTIES = [
 | 
			
		||||
@ -44,7 +42,7 @@ class Game
 | 
			
		||||
    // Store modifications.
 | 
			
		||||
    function storeMods(): void
 | 
			
		||||
    {
 | 
			
		||||
        //$this->patchUpGameDate();
 | 
			
		||||
        $this->patchUpGameDate();
 | 
			
		||||
        $this->gameMgr->updateGame($this);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,7 +1,5 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
require_once "globals.php";
 | 
			
		||||
 | 
			
		||||
class Group
 | 
			
		||||
{
 | 
			
		||||
    private int $_id; // Group's ID (assigned by SleekDB)
 | 
			
		||||
 | 
			
		||||
@ -1,39 +0,0 @@
 | 
			
		||||
<?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
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user