Fehler beim Speichern von Erklärtexten behoben
This commit is contained in:
@@ -47,7 +47,7 @@ class TopicData
|
||||
/**
|
||||
* @var string Der gesamte Erklärungstext zum Thema, enthält fertiges HTML und LATEX Formelsyntax für MathJax https://docs.mathjax.org/en/latest/basic/mathematics.html
|
||||
*/
|
||||
public string $article;
|
||||
private string $article;
|
||||
|
||||
/**
|
||||
* @var array Alle zugehörigen Formelaufgaben als Task
|
||||
@@ -200,7 +200,7 @@ class TopicData
|
||||
if (!isset($article)) {
|
||||
$article = "Kein Erklärtext vorhanden";
|
||||
}
|
||||
$result->article = str_replace('$TOPICPATH', Config::getTopicDirectory($subjectId, $topicId) . "images", $article);
|
||||
$result->article = $article;
|
||||
|
||||
$taskJson = Util::readFileContent(Config::getTopicDirectory($subjectId, $topicId) . "tasks.json");
|
||||
$result->tasks = array();
|
||||
@@ -241,7 +241,6 @@ class TopicData
|
||||
$data["icon"] = $this->icon;
|
||||
$data["description"] = $this->description;
|
||||
$data["relatedTopics"] = $this->relatedTopics;
|
||||
$data["files"] = $this->files;
|
||||
|
||||
$json = json_encode($data, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
|
||||
if (!$json) {
|
||||
@@ -508,6 +507,15 @@ class TopicData
|
||||
$this->files = $files;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gibt anders als getArticle() Bildpfade richtig aus
|
||||
* @return string HTML Quelltext für den Erklärtext
|
||||
*/
|
||||
public function getFinishedArticle(): string
|
||||
{
|
||||
return str_replace('$TOPICPATH', Config::getTopicDirectory($this->subjectId, $this->id) . "images", $this->article);
|
||||
}
|
||||
|
||||
public function getArticle(): string
|
||||
{
|
||||
return $this->article;
|
||||
|
||||
Reference in New Issue
Block a user