feat: Lernapp mit Mathe/Deutsch/Englisch, Münzsystem und Belohnungen
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user