Aufgaben (Task) Schnittstelle eingabaut

This commit is contained in:
Matthias Grief
2024-12-13 22:41:18 +01:00
parent e8a2c641fd
commit 83d74fc252
4 changed files with 111 additions and 1 deletions

41
webseite/classes/Task.php Normal file
View File

@@ -0,0 +1,41 @@
<?php
class Task
{
/**
* @var string Aufgabentext kann z.B. auch LaTeX-Notation enthalten
*/
private string $text;
/**
* @var array Alle verwendeten Variablen mit key als Variable und value als richtigen Wert
*/
private array $variables;
/**
* Erstellt eine neue Aufgabe
* @param string $text Aufgabentext, kann z.B. auch LaTeX-Notation enthalten
* @param array $variables Assoziatives Array mit Variable → Richtiger Wert
*/
public function __construct(string $text, array $variables)
{
$this->text = $text;
$this->variables = $variables;
}
/**
* @return string Aufgabentext
*/
public function getText(): string
{
return $this->text;
}
/**
* @return array Assoziatives Array mit Variable → Richtiger Wert
*/
public function getVariables(): array
{
return $this->variables;
}
}