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;
|
||||
|
||||
@@ -23,7 +23,7 @@ foreach ($subjects as $subject) {
|
||||
strpos(strtolower($subject->displayName), $query) !== false ||
|
||||
strpos(strtolower($topic->displayName), $query) !== false ||
|
||||
strpos(strtolower($topic->description), $query) !== false ||
|
||||
strpos(strtolower($topic->article), $query) !== false
|
||||
strpos(strtolower($topic->getFinishedArticle()), $query) !== false
|
||||
) {
|
||||
$results[] = [
|
||||
'type' => 'topic',
|
||||
|
||||
@@ -89,7 +89,7 @@ if (!isset($topicData)) {
|
||||
<?php echo($topicData->description); ?>
|
||||
</p>
|
||||
<p class="content-text article-section">
|
||||
<?php echo($topicData->article); ?>
|
||||
<?php echo($topicData->getFinishedArticle()); ?>
|
||||
</p>
|
||||
|
||||
<div class="exercise-section bg-gray-100">
|
||||
|
||||
Reference in New Issue
Block a user