text = $text; $this->variables = array(); foreach ($variables as $variable => $value) { if(!is_string($value)) { continue; } $this->variables[$variable] = $value; } } /** * @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; } }