fix: quiz questions not showing - reload quiz freshly in show(), fix v-if guard in QuizInterface
This commit is contained in:
@@ -76,11 +76,15 @@ class AttemptController extends Controller
|
||||
$candidate->update(['status' => 'en_cours']);
|
||||
}
|
||||
|
||||
$quiz->load(['questions.options']);
|
||||
// Reload quiz with questions FRESHLY (avoid any cached state from model binding)
|
||||
$quizData = Quiz::with(['questions' => function($q) {
|
||||
$q->orderBy('id')->with('options');
|
||||
}])
|
||||
->find($quiz->id);
|
||||
|
||||
return Inertia::render('Candidate/QuizInterface', [
|
||||
'quiz' => $quiz,
|
||||
'attempt' => $attempt->load('answers')
|
||||
'quiz' => $quizData,
|
||||
'attempt' => $attempt->load('answers'),
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user