You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
|
|
|
|
|
|
class PreguntaAsignada extends Model
|
|
|
|
|
{
|
|
|
|
|
protected $table = 'preguntas_asignadas';
|
|
|
|
|
|
|
|
|
|
protected $fillable = [
|
|
|
|
|
'examen_id',
|
|
|
|
|
'pregunta_id',
|
|
|
|
|
'orden',
|
|
|
|
|
'respuesta_usuario',
|
|
|
|
|
'es_correcta',
|
|
|
|
|
'estado',
|
|
|
|
|
'puntaje',
|
|
|
|
|
'respondida_at'
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
protected $casts = [
|
|
|
|
|
'es_correcta' => 'integer',
|
|
|
|
|
'puntaje' => 'decimal:2'
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
protected $dates = ['respondida_at'];
|
|
|
|
|
|
|
|
|
|
public function examen(): BelongsTo
|
|
|
|
|
{
|
|
|
|
|
return $this->belongsTo(Examen::class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function pregunta(): BelongsTo
|
|
|
|
|
{
|
|
|
|
|
return $this->belongsTo(Pregunta::class);
|
|
|
|
|
}
|
|
|
|
|
}
|