Add Quiz feature: 10-question quizzes with progressive scoring (max 40 pts)
- Quizzes table with questions, answer options, attempts, answers - Question types: multiple_choice, exclusion, true_false, free_text - Progressive scoring: [1,1,2,2,3,3,4,6,8,10] = max 40 per quiz - Alpine.js countdown timer per question with auto-submit on timeout - Admin: CRUD for quizzes + per-question editor, JSON export/import - Child: quiz overview with best scores, question view, result breakdown - Nav: Quiz link in child header and admin sidebar
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
namespace App\Models;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
class QuizAttemptAnswer extends Model {
|
||||
protected $fillable = ['quiz_attempt_id','quiz_question_id','answer_given','is_correct','points_earned'];
|
||||
public function attempt() { return $this->belongsTo(QuizAttempt::class,'quiz_attempt_id'); }
|
||||
public function question() { return $this->belongsTo(QuizQuestion::class,'quiz_question_id'); }
|
||||
}
|
||||
Reference in New Issue
Block a user