diff --git a/app/Http/Controllers/TestSessionsController.php b/app/Http/Controllers/TestSessionsController.php index 325981d..eecfc48 100644 --- a/app/Http/Controllers/TestSessionsController.php +++ b/app/Http/Controllers/TestSessionsController.php @@ -34,10 +34,14 @@ public function store(Request $request) $testSession = TestSessionsModel::create([ 'id_booking' => $request->id_booking, - 'status_session' => 0, // Set status awal sebagai "Belum Dimulai" + 'status_session' => '0', ]); - return redirect()->route('cek-status.show', $request->id_booking)->with('success', 'Sesi tes berhasil dibuat. Token: ' . $testSession->token_session); + return redirect()->route('tutorial-tes.index')->with([ + 'id_booking' => $testSession->id_booking, + 'id_test_sessions' => $testSession->id_test_sessions, + 'token_session' => $testSession->token_session, + ]); } /** diff --git a/app/Http/Controllers/TutorialTesController.php b/app/Http/Controllers/TutorialTesController.php new file mode 100644 index 0000000..9a45136 --- /dev/null +++ b/app/Http/Controllers/TutorialTesController.php @@ -0,0 +1,82 @@ +id_session != null) { + $id_session = $request->id_session; + } else { + return redirect()->route('cek-status.index')->with('error', 'Data sesi tes tidak ditemukan. Silakan mulai tes terlebih dahulu.'); + } + + $data_session = TestSessionsModel::where('id_test_sessions', $id_session)->first(); + if($data_session != null) { + if($data_session->status_session == '0') { + $data_session->update(['status_session' => '1']); + } + } else { + return redirect()->route('cek-status.index')->with('error', 'Data sesi tes tidak ditemukan. Silakan mulai tes terlebih dahulu.'); + } + return view('user.pages.tutorial_tes.index', compact('data_session')); + } + + /** + * Show the form for creating a new resource. + */ + public function create() + { + // + } + + /** + * Store a newly created resource in storage. + */ + public function store(Request $request) + { + // + } + + /** + * Display the specified resource. + */ + public function show(string $id) + { + // + } + + /** + * Show the form for editing the specified resource. + */ + public function edit(string $id) + { + // + } + + /** + * Update the specified resource in storage. + */ + public function update(Request $request, string $id) + { + // + } + + /** + * Remove the specified resource from storage. + */ + public function destroy(string $id) + { + // + } +} diff --git a/resources/views/user/pages/cek_status/index.blade.php b/resources/views/user/pages/cek_status/index.blade.php index ab1f36c..d4cbe84 100644 --- a/resources/views/user/pages/cek_status/index.blade.php +++ b/resources/views/user/pages/cek_status/index.blade.php @@ -100,6 +100,27 @@ + @if (session('error')) + + @endif +
Berikut adalah tutorial untuk menjalankan tes kecemasan dari sistem kami. Pastikan kamu sudah membaca dan memahami setiap langkah yang ada di bawah ini sebelum memulai tes.
+Jika kamu sudah siap untuk memulai tes, silakan klik tombol "Mulai Tes" di bawah ini. Semoga tes ini dapat membantu kamu dalam memahami kondisi kecemasanmu dan mendapatkan bantuan yang tepat!
+