/*
Dán các route này vào bên trong Route::middleware(['auth'])->group(function () { ... });
Nếu đã copy đè routes/web.php từ package thì không cần dán thủ công.
*/

Route::get('/quizzes', [QuizController::class, 'index'])->name('quizzes.index');
Route::get('/quizzes/create', [QuizController::class, 'create'])->name('quizzes.create');
Route::post('/quizzes', [QuizController::class, 'store'])->name('quizzes.store');
Route::get('/quizzes/{quiz}', [QuizController::class, 'show'])->name('quizzes.show');
Route::get('/quizzes/{quiz}/edit', [QuizController::class, 'edit'])->name('quizzes.edit');
Route::put('/quizzes/{quiz}', [QuizController::class, 'update'])->name('quizzes.update');
Route::delete('/quizzes/{quiz}', [QuizController::class, 'destroy'])->name('quizzes.destroy');

Route::get('/quizzes/{quiz}/questions', [QuizController::class, 'questions'])->name('quizzes.questions.index');
Route::get('/quizzes/{quiz}/questions/create', [QuizController::class, 'createQuestion'])->name('quizzes.questions.create');
Route::post('/quizzes/{quiz}/questions', [QuizController::class, 'storeQuestion'])->name('quizzes.questions.store');
Route::get('/quiz-questions/{question}/edit', [QuizController::class, 'editQuestion'])->name('quizzes.questions.edit');
Route::put('/quiz-questions/{question}', [QuizController::class, 'updateQuestion'])->name('quizzes.questions.update');
Route::delete('/quiz-questions/{question}', [QuizController::class, 'destroyQuestion'])->name('quizzes.questions.destroy');
