Bearbeitung von Formeln verbessert

This commit is contained in:
Matthias Grief
2025-01-06 21:53:49 +01:00
parent 004de1ebf2
commit c56e667fe4
2 changed files with 172 additions and 0 deletions

View File

@@ -263,6 +263,7 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
integrity="sha384-RdymN7NRJ+XoyeRY4185zXaxq9QWOOx3O7beyyrRK4KQZrPlCDQQpCu95FoCGPAE"
crossorigin="anonymous"></script>
<script src="assets/js/katex_autorender_mod.js"></script>
<script src="assets/js/formula.js"></script>
</head>
<body class="min-h-screen bg-gray-50">
@@ -341,6 +342,7 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
</div>
<input type="hidden" id="selectedIcon" name="icon" value="<?php echo $defaultValues['icon']; ?>">
</div>
<div>
<label for="relatedTopicSelect" class="block text-sm font-medium text-gray-700 mb-2">Verwandte Themen (IDs, kommagetrennt)</label>
<input type="text"
@@ -380,7 +382,18 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
id="formulas"
class="w-full px-4 py-3 border rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 text-lg enabled:hover:border-gray-400"
placeholder="Format: aufgabentext1;;a::2,5;;b::3;;;;aufgabentext2;;a::1"
hidden="hidden"
value="<?php echo $defaultValues['formulas']; ?>">
<div id="formulaInputs">
</div>
<button class="bg-blue-500 text-white w-full px-4 py-2 rounded-lg hover:bg-[var(--accent-color)] transition duration-300 flex items-center"
onclick="createFormulaWithVariable()"
type="button">
<span>Neue Aufgabe</span>
</button>
</div>
</div>
@@ -444,6 +457,7 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
});
}
createFormulasFromString(document.querySelector('#formulas').value);
renderFormulas();
const quill = new Quill('#quillEditor', {