diff --git a/app/Http/Controllers/FinishUjianController.php b/app/Http/Controllers/FinishUjianController.php new file mode 100644 index 0000000..df0a64d --- /dev/null +++ b/app/Http/Controllers/FinishUjianController.php @@ -0,0 +1,99 @@ +id_test_sessions != null) { + $id_session = $request->id_test_sessions; + } 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 != '1') { + return redirect()->route('cek-status.index')->with('error', 'Data sesi tes belum dimulai atau telah usai. Silahkan cek status dengan kode untuk informasi lebih lanjut.'); + } else if($data_session->status_session == '1') { + // $data_session->update([ + // 'status_session' => '2', + // 'is_active' => '0' + // ]); + $detail_test = DetailTestModel::where('id_test_sessions', $id_session)->get(); + $data_ujian = []; + foreach($detail_test as $detail) { + $data_soal = DataSoalModel::where('id_soal', $detail->id_soal)->first(); + $data_ujian[] = [ + 'id_soal' => $detail->id_soal, + 'jawaban' => $detail->jawaban, + 'soal' => $data_soal ? $data_soal->soal : null + ]; + } + return view('user.pages.finish_ujian.index', compact('data_ujian', 'id_session')); + } + } else { + return redirect()->route('cek-status.index')->with('error', 'Data sesi tes tidak ditemukan.'); + } + } + + /** + * 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/finish_ujian/index.blade.php b/resources/views/user/pages/finish_ujian/index.blade.php new file mode 100644 index 0000000..dae4831 --- /dev/null +++ b/resources/views/user/pages/finish_ujian/index.blade.php @@ -0,0 +1,63 @@ +@section('title', 'Hasil Tes') +@extends('user.layouts.index') +@section('content') + +
+ Cek hasil tes kamu dari sini ya, jika kamu sudah mendapatkan kode dari email setelah melakukan booking, kamu bisa melihat hasil tes disini dengan kode tadi. +
+