Admin: manual scoring for open-ended questions

This commit is contained in:
jeremy bayse
2026-03-22 22:06:12 +01:00
parent 732d9416f4
commit 2df0d6def0
5 changed files with 105 additions and 20 deletions

View File

@@ -8,11 +8,15 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Attributes\Fillable;
use Illuminate\Database\Eloquent\Factories\HasFactory;
#[Fillable(['attempt_id', 'question_id', 'option_id', 'text_content'])]
#[Fillable(['attempt_id', 'question_id', 'option_id', 'text_content', 'score'])]
class Answer extends Model
{
use HasFactory;
protected $casts = [
'score' => 'float',
];
public function attempt(): BelongsTo
{
return $this->belongsTo(Attempt::class);