feat: Lernapp mit Mathe/Deutsch/Englisch, Münzsystem und Belohnungen

This commit is contained in:
root
2026-05-05 14:41:09 +00:00
parent 21e40cd2da
commit bd1640994c
45 changed files with 1522 additions and 58 deletions
+13
View File
@@ -0,0 +1,13 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Question extends Model {
protected $fillable = ['subject_id','question_text','type','difficulty','points_value','active'];
protected $casts = ['active' => 'boolean'];
public function subject() { return $this->belongsTo(Subject::class); }
public function answerOptions() { return $this->hasMany(AnswerOption::class)->orderBy('sort_order'); }
public function attempts() { return $this->hasMany(QuestionAttempt::class); }
public function difficultyStars(): string {
return str_repeat('⭐', $this->difficulty);
}
}