Adaptiven A1-Kurs und statistisches Aussprachetraining integrieren
Direkte DeepSeek- und Mistral-Anbindung mit versionierten Aktionsprofilen, Budgetreservierung, Tokenabrechnung und administrativen Qualitätsprüfungen ersetzen die Flowise-Abhängigkeit im regulären Betrieb. 840 geprüfte A1-Aufgaben mit geschützter Testauswertung und konkreten offenen Arbeitsaufträgen ergänzen den Kurs. Inhalts- und Sprachbewertung bleiben von Azure-Aussprachewerten getrennt; historische Aufgaben und Antworten bleiben erhalten. Echte Wort- und Phonemmessungen werden mit Herkunft, Aktualität und Nachweisdichte gebündelt. Go bestimmt Trainingsziele und Wiederholungen, das Modell formuliert dazu passende Nachsprechübungen. Profilansicht und Auswahlgründe werden angezeigt. Validierung: Go-Race-Tests mit lokaler PostgreSQL-Integration, go vet, Web-Build, Audit aller 840 Aufgaben und drei Browser-Smokes mit lokalen Modell-/Speech-Fixtures bestanden. Keine Produktionsänderungen oder Live-Aufrufe.
This commit is contained in:
@@ -0,0 +1,167 @@
|
||||
package domain
|
||||
|
||||
import "time"
|
||||
|
||||
const CourseVersion = "a1-v2"
|
||||
|
||||
var CourseSkills = []string{"grammar", "vocabulary", "listening", "reading", "speaking", "writing"}
|
||||
|
||||
type AdaptiveModule struct {
|
||||
ID string `json:"id"`
|
||||
Key string `json:"key"`
|
||||
Title string `json:"title"`
|
||||
Description string `json:"description"`
|
||||
TargetLanguage string `json:"target_language"`
|
||||
CourseVersion string `json:"course_version"`
|
||||
Goals []string `json:"goals"`
|
||||
Order int `json:"order"`
|
||||
}
|
||||
type CoursePack struct {
|
||||
TargetLanguage string `json:"target_language"`
|
||||
CourseVersion string `json:"course_version"`
|
||||
Modules []AdaptiveModule `json:"modules"`
|
||||
Reserves []AdaptiveTask `json:"reserves"`
|
||||
}
|
||||
type TaskOption struct {
|
||||
ID string `json:"id"`
|
||||
Label string `json:"label"`
|
||||
}
|
||||
type TaskKey struct {
|
||||
CorrectOptionID string `json:"correct_option_id,omitempty"`
|
||||
ReferenceAnswer string `json:"reference_answer,omitempty"`
|
||||
Rubric []string `json:"rubric"`
|
||||
Explanation string `json:"explanation"`
|
||||
}
|
||||
type AdaptiveTask struct {
|
||||
SchemaVersion int `json:"schema_version"`
|
||||
ID string `json:"id,omitempty"`
|
||||
ModuleID string `json:"module_id"`
|
||||
OriginModuleKey string `json:"origin_module_key,omitempty"`
|
||||
TargetLanguage string `json:"target_language"`
|
||||
CourseVersion string `json:"course_version"`
|
||||
CEFRLevel string `json:"cefr_level"`
|
||||
Skill string `json:"skill"`
|
||||
Kind string `json:"kind"`
|
||||
Prompt string `json:"prompt"`
|
||||
Passage string `json:"passage,omitempty"`
|
||||
Options []TaskOption `json:"options,omitempty"`
|
||||
ReferenceText string `json:"reference_text,omitempty"`
|
||||
AudioText string `json:"audio_text,omitempty"`
|
||||
AnswerKey *TaskKey `json:"answer_key,omitempty"`
|
||||
Source string `json:"source,omitempty"`
|
||||
BriefID string `json:"brief_id,omitempty"`
|
||||
ExamID string `json:"exam_id,omitempty"`
|
||||
Review bool `json:"review,omitempty"`
|
||||
CreatedAt time.Time `json:"created_at,omitempty"`
|
||||
}
|
||||
|
||||
func (t AdaptiveTask) Public(reveal bool) AdaptiveTask {
|
||||
if !reveal {
|
||||
t.AnswerKey = nil
|
||||
t.AudioText = ""
|
||||
}
|
||||
return t
|
||||
}
|
||||
|
||||
type CourseEvaluation struct {
|
||||
Score float64 `json:"score"`
|
||||
Verdict string `json:"verdict"`
|
||||
Feedback string `json:"feedback"`
|
||||
Issues []string `json:"issues"`
|
||||
}
|
||||
type AdaptiveAttempt struct {
|
||||
ID string `json:"id"`
|
||||
TaskID string `json:"task_id"`
|
||||
ModuleID string `json:"module_id"`
|
||||
TargetLanguage string `json:"target_language"`
|
||||
Skill string `json:"skill"`
|
||||
Answer string `json:"answer"`
|
||||
Status string `json:"status"`
|
||||
Evaluation *CourseEvaluation `json:"evaluation,omitempty"`
|
||||
Speech *PronunciationResult `json:"speech,omitempty"`
|
||||
ExamID string `json:"exam_id,omitempty"`
|
||||
Demo bool `json:"demo"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
}
|
||||
type SkillProgress struct {
|
||||
ModuleID string `json:"module_id"`
|
||||
Skill string `json:"skill"`
|
||||
Attempts int `json:"attempts"`
|
||||
DistinctTasks int `json:"distinct_tasks"`
|
||||
AverageScore float64 `json:"average_score"`
|
||||
EvidenceID string `json:"evidence_id"`
|
||||
}
|
||||
type ModuleAnalysis struct {
|
||||
ModuleID string `json:"module_id"`
|
||||
Strengths []string `json:"strengths"`
|
||||
Weaknesses []string `json:"weaknesses"`
|
||||
Recommendation string `json:"recommendation"`
|
||||
Reason string `json:"reason"`
|
||||
EvidenceIDs []string `json:"evidence_ids"`
|
||||
ReadyForCompletion bool `json:"ready_for_completion"`
|
||||
}
|
||||
type CourseAnalysis struct {
|
||||
SchemaVersion int `json:"schema_version"`
|
||||
TargetLanguage string `json:"target_language"`
|
||||
CourseVersion string `json:"course_version"`
|
||||
FactsVersion int64 `json:"facts_version"`
|
||||
Summary string `json:"summary"`
|
||||
RecommendedModuleID string `json:"recommended_module_id"`
|
||||
Modules []ModuleAnalysis `json:"modules"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
}
|
||||
type CourseSnapshot struct {
|
||||
TargetLanguage string `json:"target_language"`
|
||||
CourseVersion string `json:"course_version"`
|
||||
CEFRLevel string `json:"cefr_level"`
|
||||
UILanguage string `json:"ui_language"`
|
||||
FactsVersion int64 `json:"facts_version"`
|
||||
Modules []AdaptiveModule `json:"curriculum"`
|
||||
Progress []SkillProgress `json:"progress"`
|
||||
RecentTasks []AdaptiveTask `json:"recent_tasks"`
|
||||
RecentAttempts []AdaptiveAttempt `json:"recent_attempts"`
|
||||
PreviousAnalysis *CourseAnalysis `json:"previous_analysis,omitempty"`
|
||||
RecentPrompts []string `json:"recent_prompts"`
|
||||
}
|
||||
type CourseBrief struct {
|
||||
SchemaVersion int `json:"schema_version"`
|
||||
ID string `json:"id,omitempty"`
|
||||
ModuleID string `json:"module_id"`
|
||||
TargetLanguage string `json:"target_language"`
|
||||
CourseVersion string `json:"course_version"`
|
||||
Skill string `json:"skill"`
|
||||
Kind string `json:"kind"`
|
||||
Objective string `json:"objective"`
|
||||
Difficulty string `json:"difficulty"`
|
||||
Reason string `json:"reason"`
|
||||
}
|
||||
type CourseJob struct {
|
||||
AIRevision int `json:"-"`
|
||||
ID string `json:"id"`
|
||||
UserID string `json:"-"`
|
||||
Language string `json:"target_language"`
|
||||
Kind string `json:"kind"`
|
||||
ModuleID string `json:"module_id"`
|
||||
Skill string `json:"skill,omitempty"`
|
||||
SubjectID string `json:"subject_id,omitempty"`
|
||||
Status string `json:"status"`
|
||||
Stage string `json:"stage"`
|
||||
TaskID string `json:"task_id,omitempty"`
|
||||
Source string `json:"source,omitempty"`
|
||||
Review bool `json:"review,omitempty"`
|
||||
Error string `json:"error,omitempty"`
|
||||
Lease string `json:"-"`
|
||||
}
|
||||
type AdaptiveExam struct {
|
||||
PreparationJobID string `json:"preparation_job_id,omitempty"`
|
||||
SummaryStatus string `json:"summary_status,omitempty"`
|
||||
SummaryJobID string `json:"summary_job_id,omitempty"`
|
||||
ID string `json:"id"`
|
||||
TargetLanguage string `json:"target_language"`
|
||||
Status string `json:"status"`
|
||||
Tasks []AdaptiveTask `json:"tasks"`
|
||||
Attempts []AdaptiveAttempt `json:"attempts"`
|
||||
Scores map[string]float64 `json:"scores,omitempty"`
|
||||
Score *float64 `json:"score,omitempty"`
|
||||
Summary string `json:"summary,omitempty"`
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
package domain
|
||||
|
||||
import "time"
|
||||
|
||||
var AIActions = []string{"analyze_course_progress", "plan_course_task", "author_course_task", "review_course_task", "author_course_exam", "review_course_exam", "evaluate_course_attempt", "summarize_course_exam", "next_exercise"}
|
||||
|
||||
type AIProfile struct {
|
||||
Action string `json:"action"`
|
||||
Version int64 `json:"version"`
|
||||
Enabled bool `json:"enabled"`
|
||||
Provider string `json:"provider"`
|
||||
Model string `json:"model"`
|
||||
Temperature *float64 `json:"temperature"`
|
||||
ReasoningEffort string `json:"reasoning_effort"`
|
||||
MaxTokens int64 `json:"max_tokens"`
|
||||
ContextTokens int64 `json:"context_tokens"`
|
||||
TimeoutSeconds int `json:"timeout_seconds"`
|
||||
JSONSchema bool `json:"json_schema"`
|
||||
PricingSet bool `json:"pricing_set"`
|
||||
InputPrice int64 `json:"input_microusd_per_million"`
|
||||
CachedInputPrice int64 `json:"cached_input_microusd_per_million"`
|
||||
OutputPrice int64 `json:"output_microusd_per_million"`
|
||||
}
|
||||
type AIBudget struct {
|
||||
MonthlyLimit int64 `json:"monthly_limit_microusd"`
|
||||
DailyLimit int64 `json:"daily_limit_microusd"`
|
||||
MonthCommitted int64 `json:"month_committed_microusd"`
|
||||
DayCommitted int64 `json:"day_committed_microusd"`
|
||||
OpenReservations int64 `json:"open_reservations_microusd"`
|
||||
Warning bool `json:"warning"`
|
||||
Currency string `json:"currency"`
|
||||
}
|
||||
type AIOperation struct {
|
||||
ID string `json:"id"`
|
||||
UserID string `json:"user_id"`
|
||||
Test bool `json:"test"`
|
||||
Profiles map[string]AIProfile `json:"profiles"`
|
||||
Prompts map[string]string `json:"prompts"`
|
||||
Schemas map[string]string `json:"schemas"`
|
||||
PromptVersion string `json:"prompt_version"`
|
||||
}
|
||||
type AIUsage struct {
|
||||
InputTokens int64 `json:"input_tokens"`
|
||||
OutputTokens int64 `json:"output_tokens"`
|
||||
CachedTokens *int64 `json:"cached_tokens,omitempty"`
|
||||
ReasoningTokens *int64 `json:"reasoning_tokens,omitempty"`
|
||||
}
|
||||
type AICall struct {
|
||||
ID string `json:"id"`
|
||||
OperationID string `json:"operation_id"`
|
||||
UserID string `json:"user_id"`
|
||||
Action string `json:"action"`
|
||||
Provider string `json:"provider"`
|
||||
Model string `json:"model"`
|
||||
Profile AIProfile `json:"profile"`
|
||||
PromptVersion string `json:"prompt_version"`
|
||||
InputHash string `json:"input_hash"`
|
||||
Attempt int `json:"attempt"`
|
||||
Status string `json:"status"`
|
||||
Reserved int64 `json:"reserved_microusd"`
|
||||
Cost *int64 `json:"cost_microusd,omitempty"`
|
||||
Usage *AIUsage `json:"usage,omitempty"`
|
||||
Input string `json:"input,omitempty"`
|
||||
Output string `json:"output,omitempty"`
|
||||
Error string `json:"error,omitempty"`
|
||||
DurationMS int64 `json:"duration_ms"`
|
||||
Test bool `json:"test"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
}
|
||||
type AIUsageFilter struct {
|
||||
From, To, Provider, Model, User, Action string
|
||||
Offset int
|
||||
}
|
||||
type AIUsageReport struct {
|
||||
Calls []AICall `json:"calls"`
|
||||
Total int64 `json:"total"`
|
||||
InputTokens int64 `json:"input_tokens"`
|
||||
OutputTokens int64 `json:"output_tokens"`
|
||||
Unknown int64 `json:"unknown_usage_calls"`
|
||||
EstimatedCost int64 `json:"estimated_cost_microusd"`
|
||||
Reserved int64 `json:"reserved_microusd"`
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package domain
|
||||
|
||||
// BankEntry is editorial metadata; public exercises retain the v2 task format.
|
||||
type BankEntry struct {
|
||||
ID string `json:"id"`
|
||||
Revision string `json:"revision"`
|
||||
Goal string `json:"learning_goal_id"`
|
||||
Difficulty int `json:"difficulty"`
|
||||
Reviewed bool `json:"reviewed"`
|
||||
Task AdaptiveTask `json:"task"`
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package domain
|
||||
|
||||
// CourseGoal is a server-owned, versioned learning objective. SeedTaskID is never
|
||||
// sent to Flowise; it provides a reviewed fallback and maps existing attempts.
|
||||
type CourseGoal struct {
|
||||
ID string `json:"id"`
|
||||
Description string `json:"description"`
|
||||
PromptTemplate string `json:"prompt_template"`
|
||||
AllowedForms []string `json:"allowed_forms"`
|
||||
Skill string `json:"-"`
|
||||
SeedTaskID string `json:"-"`
|
||||
}
|
||||
|
||||
func IntroductionGoals() []CourseGoal {
|
||||
return []CourseGoal{
|
||||
{ID: "introductions.name", Description: "Bedeutung von name als Name einer Person erkennen; Lösung Name", PromptTemplate: "Was bedeutet „name“ in „My name is <Name>“?", AllowedForms: []string{"Name", "Wohnort", "Alter"}, Skill: "vocabulary", SeedTaskID: "a1i_v1_vocab_1"},
|
||||
{ID: "introductions.from", Description: "Bedeutung ausschließlich des Wortes from bei Herkunft erkennen; Lösung aus", PromptTemplate: "Was bedeutet „from“ in „I am from <Ort>“?", AllowedForms: []string{"aus", "mit", "bei"}, Skill: "vocabulary", SeedTaskID: "a1i_v1_vocab_2"},
|
||||
{ID: "introductions.be_i", Description: "am nach I bei der Vorstellung mit Namen oder Herkunft verwenden", PromptTemplate: "Ergänze: I ___ from <Ort>.", AllowedForms: []string{"am", "is", "are"}, Skill: "grammar", SeedTaskID: "a1i_v1_grammar_1"},
|
||||
{ID: "introductions.be_name", Description: "is nach My name verwenden", PromptTemplate: "Ergänze: My name ___ <Name>.", AllowedForms: []string{"am", "is", "are"}, Skill: "grammar", SeedTaskID: "a1i_v1_grammar_2"},
|
||||
}
|
||||
}
|
||||
|
||||
type CourseLearningState struct {
|
||||
GoalAttemptCount int `json:"goal_attempt_count"`
|
||||
GoalCorrectCount int `json:"goal_correct_count"`
|
||||
RecentResults []bool `json:"recent_results"` // Oldest to newest, at most five.
|
||||
}
|
||||
|
||||
type GenerateCourseTaskRequest struct {
|
||||
Task string `json:"task"`
|
||||
SchemaVersion int `json:"schema_version"`
|
||||
TargetLanguage string `json:"target_language"`
|
||||
CEFRLevel string `json:"cefr_level"`
|
||||
UILanguage string `json:"ui_language"`
|
||||
ModuleID string `json:"module_id"`
|
||||
Skill string `json:"skill"`
|
||||
Kind string `json:"kind"`
|
||||
LearningGoal CourseGoal `json:"learning_goal"`
|
||||
LearningState CourseLearningState `json:"learning_state"`
|
||||
AvoidPrompts []string `json:"avoid_prompts"`
|
||||
Rules string `json:"rules"`
|
||||
RetryInstruction string `json:"retry_instruction,omitempty"`
|
||||
}
|
||||
|
||||
type GeneratedCourseTask struct {
|
||||
SchemaVersion int `json:"schema_version"`
|
||||
TargetLanguage string `json:"target_language"`
|
||||
CEFRLevel string `json:"cefr_level"`
|
||||
ModuleID string `json:"module_id"`
|
||||
LearningGoalID string `json:"learning_goal_id"`
|
||||
Skill string `json:"skill"`
|
||||
Kind string `json:"kind"`
|
||||
Prompt string `json:"prompt"`
|
||||
Options []string `json:"options"`
|
||||
Solution string `json:"solution"`
|
||||
Explanation string `json:"explanation"`
|
||||
}
|
||||
|
||||
type CoursePracticeSelection struct {
|
||||
Goal CourseGoal
|
||||
State CourseLearningState
|
||||
AvoidPrompts []string
|
||||
}
|
||||
|
||||
type CoursePracticeResult struct {
|
||||
Task CourseTask `json:"task"`
|
||||
Source string `json:"source"`
|
||||
}
|
||||
@@ -62,27 +62,31 @@ type Lesson struct {
|
||||
}
|
||||
|
||||
type Exercise struct {
|
||||
ID string `json:"id"`
|
||||
LessonID string `json:"lesson_id"`
|
||||
TargetLanguage string `json:"target_language"`
|
||||
CEFRLevel string `json:"cefr_level"`
|
||||
Type string `json:"type"`
|
||||
PromptText string `json:"prompt_text"`
|
||||
TargetText string `json:"target_text"`
|
||||
Difficulty int `json:"difficulty"`
|
||||
Source string `json:"source,omitempty"`
|
||||
TrainingReason string `json:"training_reason,omitempty"`
|
||||
TrainingCategory string `json:"training_category,omitempty"`
|
||||
ID string `json:"id"`
|
||||
LessonID string `json:"lesson_id"`
|
||||
TargetLanguage string `json:"target_language"`
|
||||
CEFRLevel string `json:"cefr_level"`
|
||||
Type string `json:"type"`
|
||||
PromptText string `json:"prompt_text"`
|
||||
TargetText string `json:"target_text"`
|
||||
Difficulty int `json:"difficulty"`
|
||||
Source string `json:"source,omitempty"`
|
||||
}
|
||||
|
||||
type WordScore struct {
|
||||
Word string `json:"word"`
|
||||
Accuracy float64 `json:"accuracy"`
|
||||
ErrorType string `json:"error_type,omitempty"`
|
||||
Phonemes []string `json:"phonemes,omitempty"`
|
||||
PhonemeScores []PhonemeScore `json:"phoneme_scores,omitempty"`
|
||||
Highlight string `json:"highlight"`
|
||||
AccuracyMeasured *bool `json:"accuracy_measured,omitempty"`
|
||||
Word string `json:"word"`
|
||||
Accuracy float64 `json:"accuracy"`
|
||||
ErrorType string `json:"error_type,omitempty"`
|
||||
Phonemes []string `json:"phonemes,omitempty"`
|
||||
PhonemeScores []PhonemeScore `json:"phoneme_scores,omitempty"`
|
||||
Highlight string `json:"highlight"`
|
||||
}
|
||||
|
||||
type PhonemeScore struct {
|
||||
Position *int `json:"position,omitempty"`
|
||||
Phoneme string `json:"phoneme"`
|
||||
Accuracy float64 `json:"accuracy"`
|
||||
Highlight string `json:"highlight"`
|
||||
@@ -95,30 +99,36 @@ type WeakPhoneme struct {
|
||||
}
|
||||
|
||||
type PronunciationResult struct {
|
||||
RecognizedText string `json:"recognized_text"`
|
||||
OverallScore float64 `json:"overall_score"`
|
||||
AccuracyScore float64 `json:"accuracy_score"`
|
||||
FluencyScore float64 `json:"fluency_score"`
|
||||
CompletenessScore float64 `json:"completeness_score"`
|
||||
ProsodyScore float64 `json:"prosody_score"`
|
||||
WordScores []WordScore `json:"word_scores"`
|
||||
Provider string `json:"provider"`
|
||||
Locale string `json:"locale,omitempty"`
|
||||
Alphabet string `json:"alphabet,omitempty"`
|
||||
Method string `json:"method,omitempty"`
|
||||
MeasurementVersion string `json:"measurement_version,omitempty"`
|
||||
RecognizedText string `json:"recognized_text"`
|
||||
OverallScore float64 `json:"overall_score"`
|
||||
AccuracyScore float64 `json:"accuracy_score"`
|
||||
FluencyScore float64 `json:"fluency_score"`
|
||||
CompletenessScore float64 `json:"completeness_score"`
|
||||
ProsodyScore float64 `json:"prosody_score"`
|
||||
WordScores []WordScore `json:"word_scores"`
|
||||
Provider string `json:"provider"`
|
||||
}
|
||||
|
||||
type Attempt struct {
|
||||
ID string `json:"id"`
|
||||
UserID string `json:"user_id"`
|
||||
ExerciseID string `json:"exercise_id"`
|
||||
TargetLanguage string `json:"target_language"`
|
||||
RecognizedText string `json:"recognized_text"`
|
||||
OverallScore float64 `json:"overall_score"`
|
||||
AccuracyScore float64 `json:"accuracy_score"`
|
||||
FluencyScore float64 `json:"fluency_score"`
|
||||
CompletenessScore float64 `json:"completeness_score"`
|
||||
ProsodyScore float64 `json:"prosody_score"`
|
||||
WordScores []WordScore `json:"word_scores"`
|
||||
TeacherFeedback string `json:"teacher_feedback"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
Provider string `json:"provider,omitempty"`
|
||||
Measurement *PronunciationResult `json:"-"`
|
||||
ID string `json:"id"`
|
||||
UserID string `json:"user_id"`
|
||||
ExerciseID string `json:"exercise_id"`
|
||||
TargetLanguage string `json:"target_language"`
|
||||
RecognizedText string `json:"recognized_text"`
|
||||
OverallScore float64 `json:"overall_score"`
|
||||
AccuracyScore float64 `json:"accuracy_score"`
|
||||
FluencyScore float64 `json:"fluency_score"`
|
||||
CompletenessScore float64 `json:"completeness_score"`
|
||||
ProsodyScore float64 `json:"prosody_score"`
|
||||
WordScores []WordScore `json:"word_scores"`
|
||||
TeacherFeedback string `json:"teacher_feedback"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
}
|
||||
|
||||
type ProgressSummary struct {
|
||||
@@ -131,31 +141,34 @@ type ProgressSummary struct {
|
||||
}
|
||||
|
||||
type GeneratedExerciseRequest struct {
|
||||
UserID string `json:"user_id"`
|
||||
Profile LearnerProfile `json:"profile"`
|
||||
Progress ProgressSummary `json:"progress"`
|
||||
TargetLanguage string `json:"target_language"`
|
||||
CEFRLevel string `json:"cefr_level"`
|
||||
UILanguage string `json:"ui_language"`
|
||||
SessionID string `json:"session_id"`
|
||||
RecentWeakWords []WordScore `json:"recent_weak_words"`
|
||||
PreferredType string `json:"preferred_type"`
|
||||
AvoidReferenceText string `json:"avoid_reference_text,omitempty"`
|
||||
AvoidReferenceTexts []string `json:"avoid_reference_texts,omitempty"`
|
||||
TrainingPlan *PronunciationPlan `json:"training_plan,omitempty"`
|
||||
UserID string `json:"user_id"`
|
||||
Profile LearnerProfile `json:"profile"`
|
||||
Progress ProgressSummary `json:"progress"`
|
||||
TargetLanguage string `json:"target_language"`
|
||||
CEFRLevel string `json:"cefr_level"`
|
||||
UILanguage string `json:"ui_language"`
|
||||
SessionID string `json:"session_id"`
|
||||
RecentWeakWords []WordScore `json:"recent_weak_words"`
|
||||
PreferredType string `json:"preferred_type"`
|
||||
AvoidReferenceText string `json:"avoid_reference_text,omitempty"`
|
||||
AvoidReferenceTexts []string `json:"avoid_reference_texts,omitempty"`
|
||||
}
|
||||
|
||||
type GeneratedExercise struct {
|
||||
ID string `json:"exercise_id"`
|
||||
ExerciseType string `json:"exercise_type"`
|
||||
TargetLanguage string `json:"target_language"`
|
||||
CEFRLevel string `json:"cefr_level"`
|
||||
ReferenceText string `json:"reference_text"`
|
||||
DisplayPrompt string `json:"display_prompt"`
|
||||
TTSText string `json:"tts_text"`
|
||||
FocusPoints []string `json:"focus_points"`
|
||||
SuccessCriteria []string `json:"success_criteria"`
|
||||
ReasonForChoice string `json:"reason_for_choice"`
|
||||
Source string `json:"source"`
|
||||
TrainingPlan *PronunciationPlan `json:"-"`
|
||||
CandidateWord string `json:"candidate_word,omitempty"`
|
||||
ID string `json:"exercise_id"`
|
||||
ExerciseType string `json:"exercise_type"`
|
||||
TargetLanguage string `json:"target_language"`
|
||||
CEFRLevel string `json:"cefr_level"`
|
||||
ReferenceText string `json:"reference_text"`
|
||||
DisplayPrompt string `json:"display_prompt"`
|
||||
TTSText string `json:"tts_text"`
|
||||
FocusPoints []string `json:"focus_points"`
|
||||
SuccessCriteria []string `json:"success_criteria"`
|
||||
ReasonForChoice string `json:"reason_for_choice"`
|
||||
Source string `json:"source"`
|
||||
}
|
||||
|
||||
type Dashboard struct {
|
||||
@@ -200,3 +213,54 @@ type DebugDBStatus struct {
|
||||
SeedExerciseCount int `json:"seed_exercise_count"`
|
||||
Error string `json:"error,omitempty"`
|
||||
}
|
||||
|
||||
type CourseModule struct {
|
||||
ID string `json:"id"`
|
||||
Title string `json:"title"`
|
||||
Description string `json:"description"`
|
||||
TargetLanguage string `json:"target_language"`
|
||||
CEFRLevel string `json:"cefr_level"`
|
||||
Version int `json:"version"`
|
||||
TaskCount int `json:"task_count"`
|
||||
AttemptedCount int `json:"attempted_count"`
|
||||
CorrectCount int `json:"correct_count"`
|
||||
}
|
||||
|
||||
type CourseTask struct {
|
||||
Source string `json:"source,omitempty"`
|
||||
ID string `json:"id"`
|
||||
ModuleID string `json:"module_id"`
|
||||
Skill string `json:"skill"`
|
||||
Kind string `json:"kind"`
|
||||
Prompt string `json:"prompt"`
|
||||
Passage string `json:"passage,omitempty"`
|
||||
Options []string `json:"options,omitempty"`
|
||||
PronunciationExercise *Exercise `json:"pronunciation_exercise,omitempty"`
|
||||
Attempted bool `json:"attempted"`
|
||||
Correct bool `json:"correct"`
|
||||
}
|
||||
|
||||
type CourseModuleDetail struct {
|
||||
Module CourseModule `json:"module"`
|
||||
Tasks []CourseTask `json:"tasks"`
|
||||
}
|
||||
|
||||
type CourseTaskKey struct {
|
||||
ID string
|
||||
ModuleID string
|
||||
Skill string
|
||||
Kind string
|
||||
AudioText string
|
||||
AcceptedAnswers []string
|
||||
Solution string
|
||||
Explanation string
|
||||
}
|
||||
|
||||
type CourseAttemptResult struct {
|
||||
ID string `json:"id"`
|
||||
TaskID string `json:"task_id"`
|
||||
Correct bool `json:"correct"`
|
||||
Solution string `json:"solution"`
|
||||
Explanation string `json:"explanation"`
|
||||
Transcript string `json:"transcript,omitempty"`
|
||||
}
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
package domain
|
||||
|
||||
import "time"
|
||||
|
||||
const PronunciationAlgorithm = "pronunciation-v1"
|
||||
|
||||
type PronunciationObservation struct {
|
||||
AssessmentID string `json:"assessment_id"`
|
||||
ExerciseID string `json:"exercise_id"`
|
||||
Language string `json:"language"`
|
||||
Locale string `json:"locale"`
|
||||
Alphabet string `json:"alphabet"`
|
||||
Kind string `json:"kind"`
|
||||
Symbol string `json:"symbol"`
|
||||
Word string `json:"word"`
|
||||
WordIndex int `json:"word_index"`
|
||||
PhonemeIndex int `json:"phoneme_index"`
|
||||
Accuracy float64 `json:"accuracy"`
|
||||
At time.Time `json:"at"`
|
||||
}
|
||||
|
||||
type PronunciationExample struct {
|
||||
Word string `json:"word"`
|
||||
Mean float64 `json:"mean"`
|
||||
Samples int `json:"samples"`
|
||||
}
|
||||
|
||||
type PronunciationTarget struct {
|
||||
Key string `json:"key"`
|
||||
Kind string `json:"kind"`
|
||||
Locale string `json:"locale"`
|
||||
Alphabet string `json:"alphabet"`
|
||||
Symbol string `json:"symbol"`
|
||||
Mean float64 `json:"mean"`
|
||||
WeakRate float64 `json:"weak_rate"`
|
||||
Observations int `json:"observations"`
|
||||
Samples int `json:"samples"`
|
||||
Recordings int `json:"recordings"`
|
||||
Tasks int `json:"tasks"`
|
||||
Words int `json:"words"`
|
||||
State string `json:"state"`
|
||||
Trend string `json:"trend"`
|
||||
LastSeen time.Time `json:"last_seen"`
|
||||
NextReview *time.Time `json:"next_review,omitempty"`
|
||||
ReviewDue bool `json:"review_due"`
|
||||
Examples []PronunciationExample `json:"examples"`
|
||||
Priority float64 `json:"priority"`
|
||||
}
|
||||
|
||||
type PronunciationProfile struct {
|
||||
Algorithm string `json:"algorithm"`
|
||||
Language string `json:"language"`
|
||||
AsOf time.Time `json:"as_of"`
|
||||
WindowDays int `json:"window_days"`
|
||||
ConfirmedRecordings int `json:"confirmed_recordings"`
|
||||
UnverifiedHistory int `json:"unverified_history"`
|
||||
Targets []PronunciationTarget `json:"targets"`
|
||||
}
|
||||
|
||||
type PronunciationPlan struct {
|
||||
ID string `json:"id"`
|
||||
Algorithm string `json:"algorithm"`
|
||||
Language string `json:"language"`
|
||||
Category string `json:"category"`
|
||||
Mode string `json:"mode"`
|
||||
Reason string `json:"reason"`
|
||||
Target *PronunciationTarget `json:"target,omitempty"`
|
||||
RequiredWords []string `json:"required_practice_words"`
|
||||
KnownWords []string `json:"known_words"`
|
||||
CandidateWord string `json:"candidate_word,omitempty"`
|
||||
TransferStatus string `json:"transfer_status,omitempty"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
}
|
||||
Reference in New Issue
Block a user