kleine Design Anpassungen im Aufgabenbereich
Zwischenstand beim Einpflegen der Bsp Aufgaben vom Kunden
This commit is contained in:
@@ -267,3 +267,19 @@ body {
|
||||
color: white;
|
||||
font-size: 18px; /* Größere Schriftgröße */
|
||||
}
|
||||
|
||||
|
||||
.task-container {
|
||||
border-radius: 20px;
|
||||
padding: 2rem;
|
||||
margin-bottom: 2rem;
|
||||
/*box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);*/
|
||||
box-shadow: 2px 4px 6px 2px rgba(0, 0, 0, 0.1);
|
||||
transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
|
||||
}
|
||||
|
||||
.variable-input{
|
||||
border: 2px solid;
|
||||
border-radius: 8px;
|
||||
text-align: center;
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
<?php
|
||||
require_once "classes/task.php";
|
||||
header('Content-Type: application/json');
|
||||
|
||||
// Sicherheitsüberprüfungen hier (z.B. Authentifizierung)
|
||||
|
||||
// Eingaben validieren
|
||||
$taskId = isset($_POST['task_id']) ? intval($_POST['task_id']) : null;
|
||||
$variableIndex = isset($_POST['variable_index']) ? intval($_POST['variable_index']) : null;
|
||||
$userAnswer = isset($_POST['user_answer']) ? trim($_POST['user_answer']) : '';
|
||||
|
||||
if ($taskId === null || $variableIndex === null || $userAnswer === '') {
|
||||
echo json_encode(['success' => false, 'message' => 'Ungültige Eingaben.']);
|
||||
exit;
|
||||
}
|
||||
|
||||
// Laden Sie die Aufgaben und Variablen entsprechend Ihrer Datenstruktur
|
||||
$tasks = $topicData->getTasks();
|
||||
|
||||
if (!isset($tasks[$taskId])) {
|
||||
echo json_encode(['success' => false, 'message' => 'Aufgabe nicht gefunden.']);
|
||||
exit;
|
||||
}
|
||||
|
||||
$variables = $tasks[$taskId]->getVariables();
|
||||
|
||||
if (!isset($variables[$variableIndex])) {
|
||||
echo json_encode(['success' => false, 'message' => 'Variable nicht gefunden.']);
|
||||
exit;
|
||||
}
|
||||
|
||||
$correctAnswer = strtolower(trim($variables[$variableIndex]->getCorrectAnswer()));
|
||||
$userAnswerLower = strtolower($userAnswer);
|
||||
|
||||
if ($userAnswerLower === $correctAnswer) {
|
||||
echo json_encode(['success' => true, 'message' => 'Richtig!']);
|
||||
} else {
|
||||
echo json_encode(['success' => false, 'message' => 'Falsch.']);
|
||||
}
|
||||
@@ -1,24 +1,26 @@
|
||||
[
|
||||
{
|
||||
"text": "34 + 26 = ?",
|
||||
"text": "$$\\frac{3}{5} + \\frac{1}{5} = ? $$",
|
||||
"vars": {
|
||||
"?": "60",
|
||||
"x": "5",
|
||||
"y": "2"
|
||||
"?": "1/5"
|
||||
}
|
||||
},
|
||||
{
|
||||
"text": "$$\\frac{2}{6} + \\frac{3}{6} = ? $$",
|
||||
"text": "$$\\frac{4}{7} - \\frac{2}{7} = ? $$",
|
||||
"vars": {
|
||||
"a": "1",
|
||||
"b": "2",
|
||||
"c": "4"
|
||||
"?": "2/7"
|
||||
}
|
||||
},
|
||||
{
|
||||
"text": "Wie schreibt man nähmlich richtig?",
|
||||
"text": "Kürze $$\\frac{6}{9}$$",
|
||||
"vars": {
|
||||
"?": "nämlich"
|
||||
"?": "1/3"
|
||||
}
|
||||
},
|
||||
{
|
||||
"text": "Erweitere $$\\frac{1}{3}$$ mit 5",
|
||||
"vars": {
|
||||
"?": "5/15"
|
||||
}
|
||||
}
|
||||
]
|
||||
16
webseite/config/subjects/mathe/topics/geometrie/article.html
Normal file
16
webseite/config/subjects/mathe/topics/geometrie/article.html
Normal file
@@ -0,0 +1,16 @@
|
||||
Erklaerung: Die Flaeche eines Rechtecks oder Quadrats berechnet sich durch Laenge x Breite.
|
||||
Formel: A = l x b
|
||||
Beispiel: Rechteck mit l = 5 cm und b = 3 cm: A = 5 x 3 = 15 cm2
|
||||
<br> <br>
|
||||
|
||||
Thema: Berechnung des Umfangs von Rechtecken und Quadraten
|
||||
Formel: U = 2 x (l + b)
|
||||
Beispiel: Rechteck mit l = 5 cm und b = 3 cm: U = 2 x (5 + 3) = 16 cm
|
||||
<br> <br>
|
||||
|
||||
|
||||
Thema: Flaechenberechnung bei Dreiecken
|
||||
Formel: A = (1/2) x Grundlinie x Hoehe
|
||||
Beispiel: Ein Dreieck mit einer Grundlinie von 6 cm und einer Hoehe von 4 cm: A = (1/2) x 6 x 4 = 12
|
||||
cm2
|
||||
Uebungsa
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"displayName": "Geometrie",
|
||||
"icon": "fa-chart-pie",
|
||||
"description": "",
|
||||
"relatedTopics": [
|
||||
"schriftliches-multiplizieren",
|
||||
"schriftliches-dividieren",
|
||||
"punkt-vor-strichrechnung",
|
||||
"rechnen-mit-klammern"
|
||||
]
|
||||
}
|
||||
38
webseite/config/subjects/mathe/topics/geometrie/tasks.json
Normal file
38
webseite/config/subjects/mathe/topics/geometrie/tasks.json
Normal file
@@ -0,0 +1,38 @@
|
||||
[
|
||||
{
|
||||
"text": "Ein Quadrat mit Seitenlänge $$a = 4 cm$$ berechne die Fläche",
|
||||
"vars": {
|
||||
"Fläche in cm^2": "16"
|
||||
}
|
||||
},
|
||||
{
|
||||
"text": "Ein Rechteck mit $$l = 7 cm$$ und $$b = 2 cm$$ berechne die Fläche",
|
||||
"vars": {
|
||||
"Fläche in cm^2": "14"
|
||||
}
|
||||
},
|
||||
{
|
||||
"text": "Berechne den Umfang $$U$$ eines Quadrats mit $$a = 6 cm$$",
|
||||
"vars": {
|
||||
"U in cm": "24"
|
||||
}
|
||||
},
|
||||
{
|
||||
"text": "Berechne den Umfang $$U$$ eines Rechteck mit $$l = 8 cm$$ und $$b = 4 cm$$",
|
||||
"vars": {
|
||||
"?": "5/15"
|
||||
}
|
||||
},
|
||||
{
|
||||
"text": "Ein Dreieck mit der Grundlinie $$G = 8cm$$ und einer Höhe $$h= 5cm$$ berechne die Fläche",
|
||||
"vars": {
|
||||
"Fläche in cm^2": "20"
|
||||
}
|
||||
},
|
||||
{
|
||||
"text": "Ein Dreieck mit der Grundlinie $$G = 10cm$$ und einer Höhe $$h= 7cm$$ berechne die Fläche",
|
||||
"vars": {
|
||||
"Fläche in cm^2": "35"
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1 @@
|
||||
Lorem Ipsum
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"displayName": "schriftliche Addition und Subtraktion",
|
||||
"icon": "fa-chart-pie",
|
||||
"description": "Die Bruchrechnung ist ein Teil der Mathematik, der das Rechnen mit Brüchen beinhaltet, also das Teilen eines Ganzen in gleich große Teile, und umfasst Operationen wie Addition, Subtraktion, Multiplikation und Division von Brüchen.",
|
||||
"relatedTopics": [
|
||||
"schriftliches-multiplizieren",
|
||||
"schriftliches-dividieren",
|
||||
"punkt-vor-strichrechnung",
|
||||
"rechnen-mit-klammern"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
[
|
||||
{
|
||||
"text": "$$6342 + 9873 = ?$$",
|
||||
"vars": {
|
||||
"?": "16215"
|
||||
}
|
||||
},
|
||||
{
|
||||
"text": "$$4521 - 1234 = ?$$",
|
||||
"vars": {
|
||||
"?": "3287"
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -1 +1,8 @@
|
||||
[]
|
||||
[
|
||||
{
|
||||
"text": "$$560 : 7 = ?$$",
|
||||
"vars": {
|
||||
"?": "80"
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -1 +1,8 @@
|
||||
[]
|
||||
[
|
||||
{
|
||||
"text": "$$432 \\times 23 = ?$$",
|
||||
"vars": {
|
||||
"?": "9936"
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -1,33 +0,0 @@
|
||||
<?php
|
||||
require_once "classes/task.php";
|
||||
header('Content-Type: application/json');
|
||||
|
||||
// Sicherheitsüberprüfungen hier (z.B. Authentifizierung)
|
||||
|
||||
// Eingaben validieren
|
||||
$taskId = isset($_POST['task_id']) ? intval($_POST['task_id']) : null;
|
||||
$variableIndex = isset($_POST['variable_index']) ? intval($_POST['variable_index']) : null;
|
||||
|
||||
if ($taskId === null || $variableIndex === null) {
|
||||
echo json_encode(['success' => false, 'message' => 'Ungültige Eingaben.']);
|
||||
exit;
|
||||
}
|
||||
|
||||
// Laden Sie die Aufgaben und Variablen entsprechend Ihrer Datenstruktur
|
||||
$tasks = $topicData->getTasks();
|
||||
|
||||
if (!isset($tasks[$taskId])) {
|
||||
echo json_encode(['success' => false, 'message' => 'Aufgabe nicht gefunden.']);
|
||||
exit;
|
||||
}
|
||||
|
||||
$variables = $tasks[$taskId]->getVariables();
|
||||
|
||||
if (!isset($variables[$variableIndex])) {
|
||||
echo json_encode(['success' => false, 'message' => 'Variable nicht gefunden.']);
|
||||
exit;
|
||||
}
|
||||
|
||||
$correctAnswer = $variables[$variableIndex]->getCorrectAnswer();
|
||||
|
||||
echo json_encode(['success' => true, 'correct_answer' => $correctAnswer]);
|
||||
@@ -124,7 +124,7 @@ if (!isset($topicData)) {
|
||||
?>
|
||||
<div class="content-card mt-[8px]">
|
||||
<h1 class="content-title">Aufgaben</h1>
|
||||
<div style="display: flex; flex-direction: column; gap: 0.5rem;">
|
||||
<div style="display: flex; flex-wrap: wrap; gap: 0.5rem;">
|
||||
<?php
|
||||
foreach ($tasks as $taskIndex => $task) {
|
||||
$taskId = $taskIndex;
|
||||
@@ -142,8 +142,8 @@ if (!isset($topicData)) {
|
||||
?>
|
||||
<div class="variable-container" style="display: flex; flex-wrap: wrap; gap: 0.5rem; ">
|
||||
<label for="answer<?php echo $taskId . '_' . $variableIndex; ?>"></label>
|
||||
<input id="answer<?php echo $taskId . '_' . $variableIndex; ?>" type="text"
|
||||
placeholder="Ihre Antwort" data-correct-answer="<?php echo $correctAnswer; ?>"/>
|
||||
<input class="variable-input border-2 border-[var(--primary-color)]" id="answer<?php echo $taskId . '_' . $variableIndex; ?>" type="text"
|
||||
placeholder="<?php echo $variableIndex; ?>" data-correct-answer="<?php echo $correctAnswer; ?>"/>
|
||||
<button class="check-answer bg-white text-[var(--primary-color)] border-2 border-[var(--primary-color)] w-10 h-10 flex items-center justify-center rounded-lg hover:bg-[var(--primary-color)] hover:text-white transition duration-300">
|
||||
<i class="fa-solid fa-check"></i>
|
||||
</button>
|
||||
|
||||
Reference in New Issue
Block a user