-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path1_1367_vektoren_in_r3.html
194 lines (177 loc) · 6.88 KB
/
1_1367_vektoren_in_r3.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Multiple-Choice-Test: Vektoren in R³</title>
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
background-color: #f4f4f9;
color: #333;
}
.container {
max-width: 600px;
margin: 20px auto;
padding: 20px;
background: white;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
h1 {
text-align: center;
color: #4CAF50;
}
.question {
margin: 20px 0;
}
label {
display: block;
padding: 10px;
background: #f9f9f9;
margin-bottom: 10px;
border: 1px solid #ddd;
border-radius: 4px;
cursor: pointer;
transition: background 0.3s ease;
}
label:hover {
background: #e0f7fa;
}
input[type="checkbox"] {
display: none;
}
input[type="checkbox"]:checked + label {
background: #c8e6c9;
border-color: #4CAF50;
}
button {
display: block;
width: 100%;
padding: 10px;
background: #4CAF50;
color: white;
border: none;
border-radius: 4px;
font-size: 16px;
cursor: pointer;
transition: background 0.3s ease;
}
button:hover {
background: #45a049;
}
.result {
margin-top: 20px;
text-align: center;
font-weight: bold;
}
.explanation {
display: none;
margin-top: 10px;
font-size: 0.9em;
background: #fff3e0;
padding: 10px;
border-left: 4px solid #ff9800;
}
.math {
font-size: 1.2em;
}
.quizFormAnswer {
margin-bottom: 10px;
}
</style>
</head>
<body>
<div class="container">
<h1>Vektoren in \(\mathbb{R}^3\)</h1>
<div class="question">
<p><strong>Aufgabe:</strong></p>
<p class="math">
Gegeben sind die drei Vektoren \(\mathbf{a} = (a_1, a_2, a_3)\), \(\mathbf{b} = (b_1, b_2, b_3)\) und \(\mathbf{n} = (n_1, n_2, n_3)\) in \(\mathbb{R}^3\), die sich vom Nullvektor unterscheiden.<br>
Es gilt:
<ul>
<li>Der Vektor \(\mathbf{n}\) steht sowohl auf den Vektor \(\mathbf{a}\) als auch auf den Vektor \(\mathbf{b}\) normal.</li>
<li>Die Vektoren \(\mathbf{a}\) und \(\mathbf{b}\) stehen nicht aufeinander normal.</li>
<li>Die Vektoren \(\mathbf{a}\) und \(\mathbf{b}\) sind nicht zueinander parallel.</li>
</ul>
<p>
Kreuzen Sie die beiden Aussagen an, die auf jeden Fall zutreffen.
</p>
<form id="quizForm">
<div class="quizFormAnswer">
<input type="checkbox" id="option1" name="option">
<label for="option1">\(a \cdot b = b \cdot n\)</label>
<div class="explanation" id="explanation1">
\(a \cdot b = b \cdot n\) ist falsch, da \(n\) normal auf \(a\) und \(b\) steht. Das Skalarprodukt von \(b\) und \(n\) ist daher immer null.
</div>
</div>
<div class="quizFormAnswer">
<input type="checkbox" id="option2" name="option">
<label for="option2">\((a + b) \cdot n = 0\)</label>
<div class="explanation" id="explanation2">
\((a + b) \cdot n = 0\) ist korrekt, da \(n\) normal auf \(a\) und \(b\) steht, somit auch auf deren Summe.
</div>
</div>
<div class="quizFormAnswer">
<input type="checkbox" id="option3" name="option">
<label for="option3">\(a_1 \cdot n_1 + a_2 \cdot n_2 + a_3 \cdot n_3 = 0\)</label>
<div class="explanation" id="explanation3">
\(a_1 \cdot n_1 + a_2 \cdot n_2 + a_3 \cdot n_3 = 0\) ist korrekt, da dies der Ausdruck für das Skalarprodukt \(a \cdot n\) ist, welches null ergibt.
</div>
</div>
<div class="quizFormAnswer">
<input type="checkbox" id="option4" name="option">
<label for="option4">Es gibt eine Zahl \(k \in \mathbb{R}\), sodass gilt: \(a + b = k \cdot n\)</label>
<div class="explanation" id="explanation4">
Es gibt keine allgemeine Zahl \(k\), sodass \(a + b = k \cdot n\), da \(a + b\) im Allgemeinen nicht parallel zu \(n\) ist.
</div>
</div>
<div class="quizFormAnswer">
<input type="checkbox" id="option5" name="option">
<label for="option5">Es gibt eine Zahl \(k \in \mathbb{R}\), sodass gilt: \(a = k \cdot b\)</label>
<div class="explanation" id="explanation5">
\(a = k \cdot b\) ist falsch, da \(a\) und \(b\) weder parallel noch orthogonal sind.
</div>
</div>
<button type="button" onclick="checkAnswers()">Antworten überprüfen</button>
</form>
<div id="result" class="result"></div>
</div>
</div>
<script>
function checkAnswers() {
const correctAnswers = ["option2", "option3"];
const explanations = {
"option1": "explanation1",
"option2": "explanation2",
"option3": "explanation3",
"option4": "explanation4",
"option5": "explanation5"
};
const selected = Array.from(document.querySelectorAll('input[name="option"]:checked')).map(input => input.id);
const resultDiv = document.getElementById('result');
let isCorrect = true;
for (const option of Object.keys(explanations)) {
const explanation = document.getElementById(explanations[option]);
if (selected.includes(option)) {
explanation.style.display = 'block';
isCorrect = false;
} else {
explanation.style.display = 'none';
}
}
if (selected.length === 2 && selected.every(option => correctAnswers.includes(option))) {
resultDiv.textContent = "Richtig! Gut gemacht!";
resultDiv.className = "result correct";
} else {
resultDiv.textContent = "Leider falsch. Bitte überprüfen Sie die Erklärungen.";
resultDiv.className = "result incorrect";
}
}
</script>
</body>
</html>