31 خطوط
795 B
PHP
31 خطوط
795 B
PHP
<?php
|
|
|
|
namespace App\Modules\Assessments\Domain;
|
|
|
|
use Illuminate\Database\Eloquent\Concerns\HasUlids;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
|
|
class AssessmentAttempt extends Model
|
|
{
|
|
use HasUlids;
|
|
|
|
protected $fillable = [
|
|
'organization_id', 'learner_id', 'course_version_id', 'assessment_id',
|
|
'attempt_number', 'status', 'score', 'started_at', 'completed_at',
|
|
];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'attempt_number' => 'integer', 'score' => 'decimal:4',
|
|
'started_at' => 'immutable_datetime', 'completed_at' => 'immutable_datetime',
|
|
];
|
|
}
|
|
|
|
public function questionResults(): HasMany
|
|
{
|
|
return $this->hasMany(QuestionResult::class);
|
|
}
|
|
}
|