41 lines
941 B
PHP
41 lines
941 B
PHP
<?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;
|
|
}
|
|
} |