Files
mindflux/src/main/java/com/example/mindflux/dto/SyntaxSagaStoryView.java
T
AliceDarkest 4599dd12b8 Syntax Saga: neues Spiel (server-autoritativ) + 34 Seed-Missionen
Drittes Mindflux-Spiel: interaktive IT-Geschichten, in denen man den
fehlenden Code (Schlüsselwörter, Operatoren, ganze Zeilen) in eine kleine
Story tippt. Freitext-Eingabe, drei wählbare Stufen (Junior/Professional/
Senior), mehrere Lücken je Codeblock und mehrere gültige Antworten je Lücke
(optional case-insensitive). Prüfung und Score ausschließlich serverseitig –
die Lösungen verlassen nie das Backend (Anti-Cheat wie TechTacular/MindMatch).
Fehler-Mechanik: bis zu 3 Versuche mit Hinweis, dann Auflösung; kein Game-Over.

Inhalte DB-gestützt und im Admin pflegbar (/admin/syntaxsaga); 34 Seed-
Missionen (Java/SQL/Bash/Git/HTML/Python) aus syntaxsaga/content.json.

- Entities SyntaxSagaMission/Gap/Solution + Flyway V7__syntax_saga.sql
- SyntaxSagaService (Story ohne Lösung / serverseitige Prüfung / Score-Recompute)
- API /api/syntaxsaga (CSRF-ausgenommen) + Admin-CRUD
- Frontend syntaxsaga.html/js/css (Prefix ss-, theme.css-Tokens)
- Dashboard-Kachel aktiv (vorher "coming soon")

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-30 12:13:37 +02:00

83 lines
2.9 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package com.example.mindflux.dto;
import java.util.List;
/**
* Die Missionen einer Schwierigkeitsstufe fürs Frontend. Bewusst OHNE Lösungen –
* geprüft und gewertet wird ausschließlich serverseitig.
*/
public class SyntaxSagaStoryView {
private final String difficulty;
private final List<Mission> missions;
private final int maxScore;
private final int totalGaps;
public SyntaxSagaStoryView(String difficulty, List<Mission> missions, int maxScore, int totalGaps) {
this.difficulty = difficulty;
this.missions = missions;
this.maxScore = maxScore;
this.totalGaps = totalGaps;
}
public String getDifficulty() { return difficulty; }
public List<Mission> getMissions() { return missions; }
public int getMaxScore() { return maxScore; }
public int getTotalGaps() { return totalGaps; }
public static class Mission {
private final Long missionId;
private final String title;
private final String difficulty;
private final String language;
private final String narrative;
private final String dialog;
private final String codeTemplate;
private final String successText;
private final List<Gap> gaps;
public Mission(Long missionId, String title, String difficulty, String language,
String narrative, String dialog, String codeTemplate,
String successText, List<Gap> gaps) {
this.missionId = missionId;
this.title = title;
this.difficulty = difficulty;
this.language = language;
this.narrative = narrative;
this.dialog = dialog;
this.codeTemplate = codeTemplate;
this.successText = successText;
this.gaps = gaps;
}
public Long getMissionId() { return missionId; }
public String getTitle() { return title; }
public String getDifficulty() { return difficulty; }
public String getLanguage() { return language; }
public String getNarrative() { return narrative; }
public String getDialog() { return dialog; }
public String getCodeTemplate() { return codeTemplate; }
public String getSuccessText() { return successText; }
public List<Gap> getGaps() { return gaps; }
}
public static class Gap {
private final int position;
private final int points;
private final String hint;
private final String placeholder;
public Gap(int position, int points, String hint, String placeholder) {
this.position = position;
this.points = points;
this.hint = hint;
this.placeholder = placeholder;
}
public int getPosition() { return position; }
public int getPoints() { return points; }
public String getHint() { return hint; }
public String getPlaceholder() { return placeholder; }
}
}