fix: Restore all files lost during destructive rebase
A previous `git pull --rebase origin main` dropped 177 local commits,
losing 3400+ files across admin-v2, backend, studio-v2, website,
klausur-service, and many other services. The partial restore attempt
(660295e2) only recovered some files.
This commit restores all missing files from pre-rebase ref 98933f5e
while preserving post-rebase additions (night-scheduler, night-mode UI,
NightModeWidget dashboard integration).
Restored features include:
- AI Module Sidebar (FAB), OCR Labeling, OCR Compare
- GPU Dashboard, RAG Pipeline, Magic Help
- Klausur-Korrektur (8 files), Abitur-Archiv (5+ files)
- Companion, Zeugnisse-Crawler, Screen Flow
- Full backend, studio-v2, website, klausur-service
- All compliance SDKs, agent-core, voice-service
- CI/CD configs, documentation, scripts
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
330
h5p-service/editors/memory-editor.html
Normal file
330
h5p-service/editors/memory-editor.html
Normal file
@@ -0,0 +1,330 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Memory Game Editor - BreakPilot H5P</title>
|
||||
<style>
|
||||
* { margin: 0; padding: 0; box-sizing: border-box; }
|
||||
body {
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
|
||||
background: #f5f5f5;
|
||||
padding: 20px;
|
||||
}
|
||||
.container {
|
||||
background: white;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 2px 8px rgba(0,0,0,0.1);
|
||||
padding: 30px;
|
||||
max-width: 900px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
h1 {
|
||||
color: #333;
|
||||
margin-bottom: 24px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
}
|
||||
.info-box {
|
||||
background: #f0f9ff;
|
||||
border-left: 4px solid #3b82f6;
|
||||
padding: 16px;
|
||||
margin-bottom: 24px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
.form-group {
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
label {
|
||||
display: block;
|
||||
font-weight: 600;
|
||||
color: #374151;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
input[type="text"], textarea {
|
||||
width: 100%;
|
||||
padding: 10px 14px;
|
||||
border: 2px solid #e5e7eb;
|
||||
border-radius: 6px;
|
||||
font-size: 14px;
|
||||
font-family: inherit;
|
||||
transition: border-color 0.2s;
|
||||
}
|
||||
input[type="text"]:focus, textarea:focus {
|
||||
outline: none;
|
||||
border-color: #667eea;
|
||||
}
|
||||
.pair-card {
|
||||
background: #f9fafb;
|
||||
border: 2px solid #e5e7eb;
|
||||
border-radius: 8px;
|
||||
padding: 20px;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
.pair-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
.pair-number {
|
||||
font-weight: 600;
|
||||
color: #667eea;
|
||||
font-size: 16px;
|
||||
}
|
||||
.pair-inputs {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 16px;
|
||||
}
|
||||
.pair-input {
|
||||
background: white;
|
||||
padding: 12px;
|
||||
border-radius: 6px;
|
||||
border: 2px solid #e5e7eb;
|
||||
}
|
||||
.pair-input h4 {
|
||||
color: #6b7280;
|
||||
font-size: 12px;
|
||||
text-transform: uppercase;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
.btn {
|
||||
padding: 10px 20px;
|
||||
border: none;
|
||||
border-radius: 6px;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
font-size: 14px;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
.btn-primary {
|
||||
background: #667eea;
|
||||
color: white;
|
||||
}
|
||||
.btn-primary:hover {
|
||||
background: #5568d3;
|
||||
}
|
||||
.btn-secondary {
|
||||
background: #e5e7eb;
|
||||
color: #374151;
|
||||
}
|
||||
.btn-secondary:hover {
|
||||
background: #d1d5db;
|
||||
}
|
||||
.btn-danger {
|
||||
background: #ef4444;
|
||||
color: white;
|
||||
}
|
||||
.btn-danger:hover {
|
||||
background: #dc2626;
|
||||
}
|
||||
.btn-group {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
margin-top: 24px;
|
||||
}
|
||||
.add-pair-btn {
|
||||
width: 100%;
|
||||
padding: 16px;
|
||||
border: 2px dashed #9ca3af;
|
||||
background: transparent;
|
||||
color: #6b7280;
|
||||
border-radius: 8px;
|
||||
cursor: pointer;
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
.add-pair-btn:hover {
|
||||
border-color: #667eea;
|
||||
color: #667eea;
|
||||
background: #f9fafb;
|
||||
}
|
||||
.success-message {
|
||||
background: #d1fae5;
|
||||
border: 2px solid #10b981;
|
||||
color: #065f46;
|
||||
padding: 16px;
|
||||
border-radius: 6px;
|
||||
margin-bottom: 20px;
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1>
|
||||
<span>🧠</span>
|
||||
Memory Game Editor
|
||||
</h1>
|
||||
|
||||
<div class="success-message" id="successMessage">
|
||||
✅ Memory Game erfolgreich gespeichert!
|
||||
</div>
|
||||
|
||||
<div class="info-box">
|
||||
<h3 style="color: #1e40af; margin-bottom: 8px; font-size: 14px;">💡 Wie funktioniert Memory?</h3>
|
||||
<p style="color: #475569; font-size: 14px; line-height: 1.6;">
|
||||
Erstelle Kartenpaare. Die Lernenden müssen die zusammengehörenden Karten finden.
|
||||
Jedes Paar besteht aus zwei Karten mit verschiedenen Inhalten (z.B. Wort ↔ Übersetzung, Begriff ↔ Definition).
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="title">Titel des Memory-Spiels</label>
|
||||
<input type="text" id="title" placeholder="z.B. Englisch Vokabeln - Tiere">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="description">Beschreibung (optional)</label>
|
||||
<input type="text" id="description" placeholder="Kurze Beschreibung...">
|
||||
</div>
|
||||
|
||||
<div id="pairsContainer"></div>
|
||||
|
||||
<button class="add-pair-btn" onclick="addPair()">
|
||||
+ Neues Kartenpaar hinzufügen
|
||||
</button>
|
||||
|
||||
<div class="btn-group">
|
||||
<button class="btn btn-primary" onclick="saveMemory()">💾 Speichern</button>
|
||||
<button class="btn btn-secondary" onclick="previewMemory()">🎮 Spielen</button>
|
||||
<button class="btn btn-secondary" onclick="window.history.back()">← Zurück</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
let pairs = [];
|
||||
|
||||
function addPair() {
|
||||
const pairId = Date.now();
|
||||
pairs.push({
|
||||
id: pairId,
|
||||
card1: '',
|
||||
card2: ''
|
||||
});
|
||||
renderPairs();
|
||||
}
|
||||
|
||||
function removePair(pairId) {
|
||||
if (confirm('Paar wirklich löschen?')) {
|
||||
pairs = pairs.filter(p => p.id !== pairId);
|
||||
renderPairs();
|
||||
}
|
||||
}
|
||||
|
||||
function updatePair(pairId, card, value) {
|
||||
const pair = pairs.find(p => p.id === pairId);
|
||||
if (pair) {
|
||||
pair[card] = value;
|
||||
}
|
||||
}
|
||||
|
||||
function renderPairs() {
|
||||
const container = document.getElementById('pairsContainer');
|
||||
container.innerHTML = '';
|
||||
|
||||
pairs.forEach((pair, index) => {
|
||||
const pairEl = document.createElement('div');
|
||||
pairEl.className = 'pair-card';
|
||||
pairEl.innerHTML = `
|
||||
<div class="pair-header">
|
||||
<span class="pair-number">Paar ${index + 1}</span>
|
||||
<button class="btn btn-danger" onclick="removePair(${pair.id})">🗑️ Löschen</button>
|
||||
</div>
|
||||
<div class="pair-inputs">
|
||||
<div class="pair-input">
|
||||
<h4>Karte 1</h4>
|
||||
<input type="text"
|
||||
value="${pair.card1}"
|
||||
onchange="updatePair(${pair.id}, 'card1', this.value)"
|
||||
placeholder="z.B. 'Cat'">
|
||||
</div>
|
||||
<div class="pair-input">
|
||||
<h4>Karte 2</h4>
|
||||
<input type="text"
|
||||
value="${pair.card2}"
|
||||
onchange="updatePair(${pair.id}, 'card2', this.value)"
|
||||
placeholder="z.B. 'Katze'">
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
container.appendChild(pairEl);
|
||||
});
|
||||
}
|
||||
|
||||
function saveMemory() {
|
||||
const title = document.getElementById('title').value;
|
||||
const description = document.getElementById('description').value;
|
||||
|
||||
if (!title) {
|
||||
alert('Bitte gib einen Titel ein!');
|
||||
return;
|
||||
}
|
||||
|
||||
if (pairs.length < 3) {
|
||||
alert('Bitte füge mindestens 3 Kartenpaare hinzu!');
|
||||
return;
|
||||
}
|
||||
|
||||
for (let i = 0; i < pairs.length; i++) {
|
||||
if (!pairs[i].card1 || !pairs[i].card2) {
|
||||
alert(`Paar ${i + 1} ist nicht vollständig ausgefüllt!`);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
const memoryData = {
|
||||
type: 'memory',
|
||||
title,
|
||||
description,
|
||||
pairs,
|
||||
created: new Date().toISOString()
|
||||
};
|
||||
|
||||
const contentId = 'memory_' + Date.now();
|
||||
localStorage.setItem(contentId, JSON.stringify(memoryData));
|
||||
|
||||
const successMsg = document.getElementById('successMessage');
|
||||
successMsg.style.display = 'block';
|
||||
setTimeout(() => {
|
||||
successMsg.style.display = 'none';
|
||||
}, 3000);
|
||||
|
||||
console.log('Memory gespeichert:', memoryData);
|
||||
}
|
||||
|
||||
function previewMemory() {
|
||||
const title = document.getElementById('title').value;
|
||||
|
||||
if (!title || pairs.length < 3) {
|
||||
alert('Bitte fülle erst den Titel und mindestens 3 Paare aus!');
|
||||
return;
|
||||
}
|
||||
|
||||
for (let i = 0; i < pairs.length; i++) {
|
||||
if (!pairs[i].card1 || !pairs[i].card2) {
|
||||
alert(`Paar ${i + 1} ist nicht vollständig ausgefüllt!`);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
const previewData = encodeURIComponent(JSON.stringify({
|
||||
title,
|
||||
description: document.getElementById('description').value,
|
||||
pairs
|
||||
}));
|
||||
|
||||
window.open(`/h5p/player/memory?data=${previewData}`, '_blank');
|
||||
}
|
||||
|
||||
// Initialize with 4 pairs
|
||||
addPair();
|
||||
addPair();
|
||||
addPair();
|
||||
addPair();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user