Periode Pembelajaran
This commit is contained in:
parent
7a82c8df64
commit
0d37d931cd
|
@ -0,0 +1,81 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\AdminBackend;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Periode;
|
||||
use App\Models\PilihPeriode;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class AdminPeriodController extends Controller
|
||||
{
|
||||
|
||||
public function index()
|
||||
{
|
||||
$periods = Periode::get();
|
||||
$selectPeriod = PilihPeriode::first();
|
||||
if (!$selectPeriod->id_periode) {
|
||||
$selectPeriod->id_periode = 'Belum Ditambahkan';
|
||||
} else {
|
||||
$checkPeriod = Periode::findOrFail($selectPeriod->id_periode);
|
||||
if ($checkPeriod->semester == 1) {
|
||||
$checkPeriod->semester = 'Ganjil';
|
||||
} else {
|
||||
$checkPeriod->semester = 'Genap';
|
||||
}
|
||||
$selectPeriod->id_periode = $checkPeriod->semester . ' ' . $checkPeriod->tahun;
|
||||
}
|
||||
|
||||
return view('admin_backend.admin_period', compact('periods', 'selectPeriod'));
|
||||
}
|
||||
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$semester = $request->semester;
|
||||
$tahunAwal = $request->tahun_awal;
|
||||
$tahunAkhir = $request->tahun_akhir;
|
||||
$tahun = $tahunAwal . '/' . $tahunAkhir;
|
||||
$checkPeriod = Periode::where('semester', $semester)->where('tahun', $tahun)->count();
|
||||
if ($checkPeriod > 0) {
|
||||
return redirect()->route('adminPeriod.index')->with('error', 'Gagal, periode yang anda buat sudah ada');
|
||||
}
|
||||
if ($tahunAkhir - $tahunAwal != 1) {
|
||||
return redirect()->route('adminPeriod.index')->with('error', 'Gagal, tahun yang anda masukkan tidak valid');
|
||||
}
|
||||
Periode::create([
|
||||
'semester' => $request->semester,
|
||||
'tahun' => $tahun
|
||||
]);
|
||||
return redirect()->route('adminPeriod.index')->with('success', 'Periode semester baru berhasil dibuat');
|
||||
}
|
||||
|
||||
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
$semester = $request->semester;
|
||||
$tahunAwal = $request->tahun_awal;
|
||||
$tahunAkhir = $request->tahun_akhir;
|
||||
$tahun = $tahunAwal . '/' . $tahunAkhir;
|
||||
$checkPeriod = Periode::where('semester', $semester)->where('tahun', $tahun)->count();
|
||||
if ($checkPeriod > 0) {
|
||||
return redirect()->route('adminPeriod.index')->with('error', 'Gagal, periode yang anda buat sudah ada');
|
||||
}
|
||||
if ($tahunAkhir - $tahunAwal != 1) {
|
||||
return redirect()->route('adminPeriod.index')->with('error', 'Gagal, tahun yang anda masukkan tidak valid');
|
||||
}
|
||||
$period = Periode::findOrFail($id);
|
||||
$period->semester = $semester;
|
||||
$period->tahun = $tahun;
|
||||
$period->update();
|
||||
return redirect()->route('adminPeriod.index')->with('success', 'Periode tersebut telah diubah');
|
||||
}
|
||||
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
$period = Periode::findOrFail($id);
|
||||
$period->delete();
|
||||
return redirect()->route('adminPeriod.index')->with('success', 'Periode tersebut telah dihapus');
|
||||
}
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\AdminBackend;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class AdminResultController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
return view('admin_backend.admin_result');
|
||||
}
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\AdminBackend;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\PilihPeriode;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class SelectPeriodController extends Controller
|
||||
{
|
||||
|
||||
public function update(Request $request)
|
||||
{
|
||||
$id = $request->id_periode;
|
||||
$pilihPeriode = PilihPeriode::first();
|
||||
$pilihPeriode->id_periode = $id;
|
||||
$pilihPeriode->aktif = '1';
|
||||
$pilihPeriode->update();
|
||||
return redirect()->route('adminPeriod.index')->with('success', 'Periode kuesioner telah diubah');
|
||||
}
|
||||
}
|
|
@ -3,12 +3,91 @@
|
|||
namespace App\Http\Controllers\Backend;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Hasil;
|
||||
use App\Models\Kuesioner;
|
||||
use App\Models\Periode;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class QuestionnaireController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
return view('backend.users_questionnaire');
|
||||
$kuesioners = Kuesioner::get();
|
||||
return view('backend.users_questionnaire', compact('kuesioners'));
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$idUser = auth()->user()->id;
|
||||
|
||||
$lastPeriode = Periode::latest()->first();
|
||||
$periode = Hasil::where('id_user', $idUser)->where('id_periode', $lastPeriode)->count();
|
||||
if ($periode > 0) {
|
||||
return redirect()->route('user.checkFilled')->with('error', 'Gagal, anda sudah pernah mengisikan kuesioner');
|
||||
}
|
||||
$answer = []; // Array yang berisi data jawaban
|
||||
|
||||
foreach ($request->id as $index => $id) {
|
||||
$value = $request->input('optionsGroup' . $id);
|
||||
$kategori = $request->input('kategori')[$index];
|
||||
|
||||
// Membuat array asosiatif dengan kategori
|
||||
$answerItem = [
|
||||
'id' => $id,
|
||||
'answer' => $value,
|
||||
'kategori' => $kategori,
|
||||
];
|
||||
|
||||
// Menambahkan array asosiatif ke dalam array $answer
|
||||
$answer[] = $answerItem;
|
||||
}
|
||||
|
||||
// Menginisialisasi array untuk menyimpan total jawaban per kategori
|
||||
$totalsPerGroup = array_fill(1, 8, 0);
|
||||
|
||||
// Menghitung total jawaban untuk setiap kategori
|
||||
foreach ($answer as $item) {
|
||||
$kategori = $item['kategori'];
|
||||
$totalsPerGroup[$kategori] += $item['answer'];
|
||||
}
|
||||
|
||||
$kmTotal = $totalsPerGroup[1] + $totalsPerGroup[2] + $totalsPerGroup[3];
|
||||
$kmClass = null;
|
||||
if ($kmTotal >= 63) {
|
||||
$kmClass = 'Tinggi';
|
||||
} else if ($kmTotal >= 42) {
|
||||
$kmClass = 'Sedang';
|
||||
} else {
|
||||
$kmClass = 'Rendah';
|
||||
}
|
||||
|
||||
$rmTotal = $totalsPerGroup[4] + $totalsPerGroup[5] + $totalsPerGroup[6] + $totalsPerGroup[7] + $totalsPerGroup[8];
|
||||
$rmClass = null;
|
||||
if ($rmTotal >= 63) {
|
||||
$rmClass = 'Tinggi';
|
||||
} else if ($rmTotal >= 42) {
|
||||
$rmClass = 'Sedang';
|
||||
} else {
|
||||
$rmClass = 'Rendah';
|
||||
}
|
||||
|
||||
Hasil::create([
|
||||
'id_user' => $idUser,
|
||||
'id_periode' => 1,
|
||||
'declarative_knowledge' => $totalsPerGroup[1],
|
||||
'procedural_knowledge' => $totalsPerGroup[2],
|
||||
'conditional_knowledge' => $totalsPerGroup[3],
|
||||
'km_total' => $kmTotal,
|
||||
'km_class' => $kmClass,
|
||||
'planning' => $totalsPerGroup[4],
|
||||
'information_management' => $totalsPerGroup[5],
|
||||
'monitoring' => $totalsPerGroup[6],
|
||||
'debugging' => $totalsPerGroup[7],
|
||||
'evaluation' => $totalsPerGroup[8],
|
||||
'rm_total' => $rmTotal,
|
||||
'rm_class' => $rmClass,
|
||||
]);
|
||||
|
||||
return $idUser;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Hasil extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
protected $table = 'hasil';
|
||||
protected $fillable = [
|
||||
'id_user',
|
||||
'id_periode',
|
||||
'declarative_knowledge',
|
||||
'procedural_knowledge',
|
||||
'conditional_knowledge',
|
||||
'km_total',
|
||||
'km_class',
|
||||
'planning',
|
||||
'information_management',
|
||||
'monitoring',
|
||||
'debugging',
|
||||
'evaluation',
|
||||
'rm_total',
|
||||
'rm_class'
|
||||
];
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Periode extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
protected $table = 'periode';
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'semester',
|
||||
'tahun'
|
||||
];
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class PilihPeriode extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
protected $table = 'pilih_periode';
|
||||
public $timestamps = false;
|
||||
protected $fillable = [
|
||||
'id_periode',
|
||||
'aktif',
|
||||
];
|
||||
}
|
|
@ -14,8 +14,9 @@ class CreateHasil extends Migration
|
|||
public function up()
|
||||
{
|
||||
Schema::create('hasil', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->integer('id', true);
|
||||
$table->integer('id_user');
|
||||
$table->integer('id_periode');
|
||||
$table->integer('declarative_knowledge');
|
||||
$table->integer('procedural_knowledge');
|
||||
$table->integer('conditional_knowledge');
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreatePeriode extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
Schema::create('periode', function (Blueprint $table) {
|
||||
$table->id(); // Kolom ID dengan tipe data INT dan Auto Increment
|
||||
$table->enum('semester', ['1', '2'])->notNullable(); // Kolom ENUM untuk semester (1 atau 2)
|
||||
$table->char('tahun', 9)->notNullable(); // Kolom CHAR untuk tahun (misalnya, "2021/2023")
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('periode');
|
||||
}
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddIdPeriodeToHasil extends Migration
|
||||
{
|
||||
|
||||
public function up()
|
||||
{
|
||||
Schema::table('hasil', function (Blueprint $table) {
|
||||
$table->foreign('id_periode')->references('id')->on('periode');
|
||||
$table->foreign(['id_periode'], 'produk_ibfk_2')
|
||||
->references(['id'])
|
||||
->on('periode')
|
||||
->onUpdate('CASCADE')
|
||||
->onDelete('CASCADE');
|
||||
});
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
// Schema::table('hasil', function (Blueprint $table) {
|
||||
// $table->dropForeign(['id_periode']); // Menghapus foreign key
|
||||
// $table->dropColumn('id_periode'); // Menghapus kolom foreign key
|
||||
// });
|
||||
}
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreatePilihPeriodeTable extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
Schema::create('pilih_periode', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->unsignedBigInteger('id_periode');
|
||||
$table->enum('aktif', ['0', '1']);
|
||||
|
||||
// Menambahkan foreign key constraint ke tabel periode
|
||||
$table->foreign('id_periode')->references('id')->on('periode');
|
||||
});
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('pilih_periode');
|
||||
}
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 59 KiB |
|
@ -0,0 +1,220 @@
|
|||
@extends('admin_backend/layouts.template')
|
||||
@section('content')
|
||||
<main id="main" class="main">
|
||||
<div class="bg-white p-3">
|
||||
{{--! start header --}}
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-9">
|
||||
<h3 style="font-weight: bold">Periode Tahun Ajar</h3>
|
||||
<p class="text-secondary">Tambahkan periode pengajaran untuk membuka kembali kuesioner semester baru.</p>
|
||||
</div>
|
||||
<div class="mb-2 col-12 col-md-3 text-md-end align-center text-center">
|
||||
<button class="btn btn-primary ellipsis" data-bs-toggle="modal" data-bs-target="#exampleModal">+ Tambah Periode</button>
|
||||
</div>
|
||||
</div>
|
||||
{{--! end header --}}
|
||||
|
||||
<div class="d-flex justify-content-center">
|
||||
<div class="border border-2 rounded p-2 text-center">
|
||||
<h6>Periode Terpilih</h6>
|
||||
<div class="pt-2 border-bottom"><h6 style="font-weight: bold">{{ $selectPeriod->id_periode }}</h6></div>
|
||||
<div class="pt-2">
|
||||
<input value="0" type="radio" class="form-check-input ms-2" id="radioTutup" name="optionsGroup" required>
|
||||
<label class="form-check-label ps-1 pe-2" for="radioTutup">Tutup Kuesioner</label>
|
||||
<input value="1" type="radio" class="form-check-input ms-2" id="radioBuka" name="optionsGroup">
|
||||
<label class="form-check-label me-2 ps-1" for="radioBuka">Buka Kuesioner</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{--! start table --}}
|
||||
<div class="my-3 mt-4">
|
||||
<div class="table-responsive">
|
||||
<table class="table">
|
||||
<thead class="table-light">
|
||||
<th class="text-secondary">NO</th>
|
||||
<th class="text-secondary">SEMESTER</th>
|
||||
<th class="text-secondary">TAHUN</th>
|
||||
<th class="text-secondary">ACTION</th>
|
||||
<th class="text-secondary">PERIODE</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($periods as $index => $period)
|
||||
<tr>
|
||||
<td>{{ $index+1 }}</td>
|
||||
<td>{{ $period->semester == 1 ? 'Ganjil' : 'Genap' }}</td>
|
||||
<td>{{ $period->tahun }}</td>
|
||||
<td>
|
||||
<button class="btn btn-outline-dark btn-sm edit-button" data-bs-toggle="modal" data-bs-target="#editModal" data-period='{{ json_encode($period) }}'>
|
||||
<i class="bi bi-pencil"></i> Edit
|
||||
</button>
|
||||
<span class="p-1"></span>
|
||||
<form action="{{ route('adminPeriod.destroy', ['admin_period'=>$period->id]) }}" class="d-inline delete-form" method="POST">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<button class="btn btn-outline-danger btn-sm mt-1 mt-sm-0"><i class="bi bi-trash"></i>Hapus</button>
|
||||
</form>
|
||||
</td>
|
||||
<td>
|
||||
<form action="{{ route('adminSelectPeriod') }}" method="POST" class="edit-periode">
|
||||
@csrf
|
||||
<input type="text" class="form-control d-none" name="id_periode" value="{{ $period->id }}">
|
||||
<button type="submit" class="btn btn-primary btn-sm"><i class="bi bi-alarm"></i> Pilih</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{{--! end table --}}
|
||||
|
||||
{{--! start modal create --}}
|
||||
<form action="{{ route('adminPeriod.store') }}" method="POST" class="needs-validation" novalidate>
|
||||
@csrf
|
||||
<div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="exampleModalLabel">Buat Periode Semester</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="mb-3">
|
||||
<label for="create-semester" class="col-form-label">Kategori soal:</label>
|
||||
<select class="form-select" name="semester" id="create-semester">
|
||||
<option value="1">1. Ganjil</option>
|
||||
<option value="2">2. Genap</option>
|
||||
</select>
|
||||
</div>
|
||||
@php
|
||||
$thisYear = date("Y"); // Mengambil tahun saat ini
|
||||
$nextYear = $thisYear + 1;
|
||||
@endphp
|
||||
<div class="form-group mb-4">
|
||||
<label class="col-form-label" for="create-tahun_awal">Tahun awal:</label>
|
||||
<input type="number" class="form-control" id="create-tahun_awal" name="tahun_awal" min="2000" max="2050" value="{{ $thisYear }}">
|
||||
<div class="invalid-feedback"><i class="bi bi-exclamation-circle-fill"></i> Tahun tidak valid</div>
|
||||
</div>
|
||||
<div class="form-group mb-4">
|
||||
<label class="col-form-label" for="create-tahun_akhir">Tahun akhir:</label>
|
||||
<input type="number" class="form-control" id="create-tahun_akhir" name="tahun_akhir" min="2000" max="2050" value="{{ $nextYear }}">
|
||||
<div class="invalid-feedback"><i class="bi bi-exclamation-circle-fill"></i> Tahun tidak valid</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Tutup</button>
|
||||
<button type="submit" class="btn btn-primary">Simpan</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{{--! end modal create --}}
|
||||
|
||||
{{--! start edit modal --}}
|
||||
<form method="POST" id="edit-form" action="{{ route('adminPeriod.update', ['admin_period' => '0']) }}" class="needs-validation" novalidate>
|
||||
@csrf
|
||||
@method('PUT')
|
||||
<div class="modal fade" id="editModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="exampleModalLabel">Buat Periode Semester</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="mb-3">
|
||||
<label for="edit-semester" class="col-form-label">Kategori soal:</label>
|
||||
<select class="form-select" name="semester" id="edit-semester">
|
||||
<option value="1">1. Ganjil</option>
|
||||
<option value="2">2. Genap</option>
|
||||
</select>
|
||||
</div>
|
||||
@php
|
||||
$thisYear = date("Y"); // Mengambil tahun saat ini
|
||||
$nextYear = $thisYear + 1;
|
||||
@endphp
|
||||
<div class="form-group mb-4">
|
||||
<label class="col-form-label" for="edit-tahun_awal">Tahun awal:</label>
|
||||
<input type="number" class="form-control" id="edit-tahun_awal" name="tahun_awal" min="2000" max="2050">
|
||||
<div class="invalid-feedback"><i class="bi bi-exclamation-circle-fill"></i> Tahun tidak valid</div>
|
||||
</div>
|
||||
<div class="form-group mb-4">
|
||||
<label class="col-form-label" for="edit-tahun_akhir">Tahun akhir:</label>
|
||||
<input type="number" class="form-control" id="edit-tahun_akhir" name="tahun_akhir" min="2000" max="2050" >
|
||||
<div class="invalid-feedback"><i class="bi bi-exclamation-circle-fill"></i> Tahun tidak valid</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Tutup</button>
|
||||
<button type="submit" class="btn btn-primary">Simpan</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{{--! end edit modal --}}
|
||||
</div>
|
||||
</main>
|
||||
@endsection
|
||||
|
||||
@section('script')
|
||||
<script>
|
||||
|
||||
let selectPeriod = {{ $selectPeriod->aktif }};
|
||||
if(selectPeriod==0){
|
||||
$("#radioTutup").prop("checked", true);
|
||||
}else{
|
||||
$("#radioBuka").prop("checked", true);
|
||||
}
|
||||
|
||||
$('.edit-button').click(function () {
|
||||
let period = $(this).data('period');
|
||||
$('#edit-semester').val(period.semester);
|
||||
$('#edit-tahun_awal').val(period.tahun.substring(0,4));
|
||||
$('#edit-tahun_akhir').val(period.tahun.substring(5,9));
|
||||
let formAction = "{{ route('adminPeriod.update', ['admin_period' => 'masuk_sini']) }}".replace('masuk_sini', period.id);
|
||||
$('#edit-form').attr('action', formAction);
|
||||
});
|
||||
|
||||
$('.delete-form').click(function(event){
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Yakin untuk dihapus?',
|
||||
text: "Kamu tidak akan bisa mengembalikan ini!",
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#dc3545',
|
||||
cancelButtonColor: '#6c757d',
|
||||
confirmButtonText: 'Ya, hapus ini!',
|
||||
cancelButtonText: 'Batalkan',
|
||||
reverseButtons: true
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$(this).submit();
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
$('.edit-periode').click(function(event){
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Ganti Periode?',
|
||||
text: "Periode baru akan dibuka, ini akan membuat user bisa mengisi kuesioner baru!",
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#ffc107',
|
||||
cancelButtonColor: '#6c757d',
|
||||
confirmButtonText: 'Ya, ubah periode!',
|
||||
cancelButtonText: 'Batalkan',
|
||||
reverseButtons: true
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$(this).submit();
|
||||
}
|
||||
})
|
||||
});
|
||||
</script>
|
||||
@endsection
|
|
@ -15,7 +15,7 @@
|
|||
{{--! end header --}}
|
||||
|
||||
{{--! start table --}}
|
||||
<div class="my-3">
|
||||
<div class="my-3 table-responsive">
|
||||
<table class="table">
|
||||
<thead class="table-light">
|
||||
<th class="text-secondary col-1 col-md-1">NOMOR</th>
|
||||
|
@ -61,14 +61,14 @@
|
|||
<div class="mb-3">
|
||||
<label for="create-kategori" class="col-form-label">Kategori soal:</label>
|
||||
<select class="form-select" name="create_kategori" id="create-kategori">
|
||||
<option value="1">1</option>
|
||||
<option value="2">2</option>
|
||||
<option value="3">3</option>
|
||||
<option value="4">4</option>
|
||||
<option value="5">5</option>
|
||||
<option value="6">6</option>
|
||||
<option value="7">7</option>
|
||||
<option value="8">8</option>
|
||||
<option value="1">1. Declarative knowledge</option>
|
||||
<option value="2">2. Procedural knowledge</option>
|
||||
<option value="3">3. Conditional knowledge</option>
|
||||
<option value="4">4. Planning</option>
|
||||
<option value="5">5. Information Management</option>
|
||||
<option value="6">6. Monitoring</option>
|
||||
<option value="7">7. Debugging</option>
|
||||
<option value="8">8. Evaluation</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
|
@ -104,14 +104,14 @@
|
|||
<div class="mb-3">
|
||||
<label for="edit-kategori" class="col-form-label">Kategori soal:</label>
|
||||
<select class="form-select" name="edit_kategori" id="edit-kategori">
|
||||
<option value="1">1</option>
|
||||
<option value="2">2</option>
|
||||
<option value="3">3</option>
|
||||
<option value="4">4</option>
|
||||
<option value="5">5</option>
|
||||
<option value="6">6</option>
|
||||
<option value="7">7</option>
|
||||
<option value="8">8</option>
|
||||
<option value="1">1. Declarative knowledge</option>
|
||||
<option value="2">2. Procedural knowledge</option>
|
||||
<option value="3">3. Conditional knowledge</option>
|
||||
<option value="4">4. Planning</option>
|
||||
<option value="5">5. Information Management</option>
|
||||
<option value="6">6. Monitoring</option>
|
||||
<option value="7">7. Debugging</option>
|
||||
<option value="8">8. Evaluation</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
|
@ -149,13 +149,14 @@
|
|||
$('.delete-form').click(function(event){
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: "You won't be able to revert this!",
|
||||
title: 'Yakin untuk dihapus?',
|
||||
text: "Kamu tidak akan bisa mengembalikan ini!",
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#dc3545',
|
||||
cancelButtonColor: '#6c757d',
|
||||
confirmButtonText: 'Yes, delete it!',
|
||||
confirmButtonText: 'Ya, hapus ini!',
|
||||
cancelButtonText: 'Batalkan',
|
||||
reverseButtons: true
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
@extends('admin_backend/layouts.template')
|
||||
@section('content')
|
||||
<main id="main" class="main bg-white">
|
||||
<div>
|
||||
<h4 style="font-weight: bold">Hasil Kategori Metakognitif</h4>
|
||||
<p class="text-secondary fs-6">Lorem ipsum dolor sit amet consectetur, adipisicing elit. Explicabo, tempora.</p>
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table class="table">
|
||||
<thead class="table-light">
|
||||
<th>NAMA</th>
|
||||
<th>ANGKATAN</th>
|
||||
<th>TANGGAL</th>
|
||||
<th>HASIL</th>
|
||||
<th>ACTION</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="font-weight: bold">Fajar Gunawan</td>
|
||||
<td>2021</td>
|
||||
<td>Apr 23, 2023</td>
|
||||
<td>lorem ipsum</td>
|
||||
<td><button class="btn btn-primary btn-sm">Download</button></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</main>
|
||||
@endsection
|
||||
|
||||
@section('script')
|
||||
|
||||
@endsection
|
|
@ -20,12 +20,19 @@
|
|||
</li><!-- End Kuesioner Page Nav -->
|
||||
|
||||
<li class="nav-item">
|
||||
<a class="nav-link collapsed" href="{{ asset('admin_backend/user-profile.html')}}">
|
||||
<a class="nav-link collapsed" href="{{ route('adminResult.index')}}">
|
||||
<i class="bi bi-book"></i>
|
||||
<span>Hasil</span>
|
||||
</a>
|
||||
</li><!-- End Profile Page Nav -->
|
||||
|
||||
<li class="nav-item">
|
||||
<a class="nav-link collapsed" href="{{ route('adminPeriod.index')}}">
|
||||
<i class="bi bi-calendar4"></i>
|
||||
<span>Periode</span>
|
||||
</a>
|
||||
</li><!-- End Profile Page Nav -->
|
||||
|
||||
<li class="nav-item">
|
||||
<a class="nav-link collapsed" data-bs-target="#users-nav" data-bs-toggle="collapse" href="/admin">
|
||||
<i class="bi bi-person"></i><span>User</span><i class="bi bi-chevron-down ms-auto"></i>
|
||||
|
|
|
@ -29,9 +29,7 @@
|
|||
<!-- Template Main CSS File -->
|
||||
<link href="{{ asset('admin_backend/assets/css/style.css')}}" rel="stylesheet">
|
||||
<!--
|
||||
Include SweetAlert2 CSS -->
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sweetalert2@11.0.18/dist/sweetalert2.min.css">
|
||||
|
||||
|
||||
|
||||
<!-- =======================================================
|
||||
* Template Name: NiceAdmin
|
||||
|
@ -201,6 +199,26 @@
|
|||
</script>
|
||||
@endif
|
||||
|
||||
@if (session('error'))
|
||||
<script>
|
||||
const Toast = Swal.mixin({
|
||||
toast: true,
|
||||
position: 'top-end',
|
||||
showConfirmButton: false,
|
||||
timer: 3000,
|
||||
timerProgressBar: true,
|
||||
didOpen: (toast) => {
|
||||
toast.addEventListener('mouseenter', Swal.stopTimer)
|
||||
toast.addEventListener('mouseleave', Swal.resumeTimer)
|
||||
}
|
||||
});
|
||||
|
||||
Toast.fire({
|
||||
icon: 'error',
|
||||
title: '{{ session('error') }}'
|
||||
});
|
||||
</script>
|
||||
@endif
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -17,7 +17,7 @@
|
|||
</li><!-- End Dashboard Nav -->
|
||||
|
||||
<li class="nav-item">
|
||||
<a class="nav-link collapsed" href="{{ route('user.instruction')}}">
|
||||
<a class="nav-link collapsed" href="{{ route('user.checkFilled')}}">
|
||||
<i class="bi bi-pencil"></i>
|
||||
<span>Kuesioner</span>
|
||||
</a>
|
||||
|
|
|
@ -171,6 +171,49 @@
|
|||
|
||||
<!-- Template Main JS File -->
|
||||
<script src="{{ asset('backend/assets/js/main.js')}}"></script>
|
||||
<script src="{{ asset('css/sweealert2.all.min.js')}}"></script>
|
||||
|
||||
@if (session('success'))
|
||||
<script>
|
||||
const Toast = Swal.mixin({
|
||||
toast: true,
|
||||
position: 'top-end',
|
||||
showConfirmButton: false,
|
||||
timer: 3000,
|
||||
timerProgressBar: true,
|
||||
didOpen: (toast) => {
|
||||
toast.addEventListener('mouseenter', Swal.stopTimer)
|
||||
toast.addEventListener('mouseleave', Swal.resumeTimer)
|
||||
}
|
||||
});
|
||||
|
||||
Toast.fire({
|
||||
icon: 'success',
|
||||
title: '{{ session('success') }}'
|
||||
});
|
||||
</script>
|
||||
@endif
|
||||
|
||||
@if (session('error'))
|
||||
<script>
|
||||
const Toast = Swal.mixin({
|
||||
toast: true,
|
||||
position: 'top-end',
|
||||
showConfirmButton: false,
|
||||
timer: 3000,
|
||||
timerProgressBar: true,
|
||||
didOpen: (toast) => {
|
||||
toast.addEventListener('mouseenter', Swal.stopTimer)
|
||||
toast.addEventListener('mouseleave', Swal.resumeTimer)
|
||||
}
|
||||
});
|
||||
|
||||
Toast.fire({
|
||||
icon: 'error',
|
||||
title: '{{ session('error') }}'
|
||||
});
|
||||
</script>
|
||||
@endif
|
||||
|
||||
</body>
|
||||
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
@extends('backend/layouts.template')
|
||||
@section('content')
|
||||
<main id="main" class="main bg-white">
|
||||
<div class="bg-white p-3 text-center">
|
||||
<img src="{{ asset('admin_backend/assets/img/not_filled.png') }}" alt="" style="max-height: 50vh">
|
||||
<h4 class="font-bold pt-4">Ups! Kamu belum mengisi Kuisioner!</h4>
|
||||
<p class="pt-1 text-secondary">Sebelum dapat mengakses materi pemebelajaran, kamu harus mengisi kuisioner dan melakukan pretest. Hasil dari pretest akan digunakan untuk menentukan materi pembelajaran yang cocok untuk kamu nantinya </p>
|
||||
|
||||
|
||||
<div class="mt-4 mb-1 text-center">
|
||||
<a href="{{ route('user.instruction') }}" class="btn btn-primary">Mulai Isi Kuesioner <i class="bi bi-arrow-right"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
@endsection
|
|
@ -12,36 +12,43 @@
|
|||
</div>
|
||||
|
||||
{{--! start fill --}}
|
||||
<form action="" class="needs-validation" novalidate>
|
||||
<div class="bg-light rounded p-3 mt-3">
|
||||
<div class="d-flex flex-row">
|
||||
<p class="me-1">1.</p>
|
||||
<div>
|
||||
<p>Saya bertanya kepada diri sendiri, ”Apakah saya sudah mencapai tujuan saya?”, ketika sedang berupaya mencapai tujuan secara intensif.</p>
|
||||
|
||||
<form action="{{ route('userQuestionnaire.store') }}" method="POST" class="needs-validation" novalidate>
|
||||
@csrf
|
||||
@foreach ($kuesioners as $index => $kuesioner)
|
||||
<div class="mb-3 visually-hidden">
|
||||
<input type="text" class="form-control" name="id[]" value="{{ $kuesioner->id }}">
|
||||
<input type="text" class="form-control" name="kategori[]" value="{{ $kuesioner->kategori_soal }}">
|
||||
</div>
|
||||
<div class="bg-light rounded p-3 mt-3">
|
||||
<div class="d-flex flex-row">
|
||||
<p class="me-1">{{ $index + 1 }}.</p>
|
||||
<div class="w-100">
|
||||
<p>{{ $kuesioner->soal }}</p>
|
||||
|
||||
<input type="radio" class="form-check-input" id="flexRadio1" name="optionsGroup" required>
|
||||
<label class="form-check-label pe-1 pe-sm-5 ps-1" for="flexRadio1">1</label>
|
||||
|
||||
<input type="radio" class="form-check-input" id="flexRadio2" name="optionsGroup">
|
||||
<label class="form-check-label pe-1 pe-sm-5 ps-1" for="flexRadio2">2</label>
|
||||
|
||||
<input type="radio" class="form-check-input" id="flexRadio3" name="optionsGroup">
|
||||
<label class="form-check-label pe-1 pe-sm-5 ps-1" for="flexRadio3">3</label>
|
||||
|
||||
<input type="radio" class="form-check-input" id="flexRadio4" name="optionsGroup">
|
||||
<label class="form-check-label pe-1 pe-sm-5 ps-1" for="flexRadio4">4</label>
|
||||
|
||||
<input type="radio" class="form-check-input" id="flexRadio5" name="optionsGroup">
|
||||
<label class="form-check-label pe-1 pe-sm-5 ps-1" for="flexRadio5">5</label>
|
||||
|
||||
<div class="invalid-feedback mt-3 text-end">
|
||||
<i class="bi bi-exclamation-circle-fill"></i> Pertanyaan belum dijawab!
|
||||
<input value="0" type="radio" class="form-check-input" id="radio0{{ $kuesioner->id }}" name="optionsGroup{{ $kuesioner->id }}" required>
|
||||
<label class="form-check-label pe-1 pe-sm-5 ps-1" for="radio0{{ $kuesioner->id }}">0</label>
|
||||
|
||||
<input value="1" type="radio" class="form-check-input" id="radio1{{ $kuesioner->id }}" name="optionsGroup{{ $kuesioner->id }}">
|
||||
<label class="form-check-label pe-1 pe-sm-5 ps-1" for="radio1{{ $kuesioner->id }}">1</label>
|
||||
|
||||
<input value="2" type="radio" class="form-check-input" id="radio2{{ $kuesioner->id }}" name="optionsGroup{{ $kuesioner->id }}">
|
||||
<label class="form-check-label pe-1 pe-sm-5 ps-1" for="radio2{{ $kuesioner->id }}">2</label>
|
||||
|
||||
<input value="3" type="radio" class="form-check-input" id="radio3{{ $kuesioner->id }}" name="optionsGroup{{ $kuesioner->id }}">
|
||||
<label class="form-check-label pe-1 pe-sm-5 ps-1" for="radio3{{ $kuesioner->id }}">3</label>
|
||||
|
||||
<input value="4" type="radio" class="form-check-input" id="radio4{{ $kuesioner->id }}" name="optionsGroup{{ $kuesioner->id }}">
|
||||
<label class="form-check-label pe-1 pe-sm-5 ps-1" for="radio4{{ $kuesioner->id }}">4</label>
|
||||
|
||||
<div class="invalid-feedback mt-3 text-end w-100">
|
||||
<i class="bi bi-exclamation-circle-fill"></i> Pertanyaan belum dijawab!
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
@endforeach
|
||||
<div class="pt-5">
|
||||
<button type="submit" class="btn btn-primary px-5">Submit</button>
|
||||
</div>
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
<?php
|
||||
|
||||
// use App\Http\Controllers\AdminBackend\SelectPeriodController;
|
||||
|
||||
use App\Http\Controllers\AdminBackend\SelectPeriodController;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
|
@ -32,9 +35,13 @@
|
|||
Route::resource('profile', 'ProfileController');
|
||||
Route::resource('questionnaire', 'QuestionnaireController')->names('userQuestionnaire');
|
||||
|
||||
// hanya tampilan
|
||||
Route::get('instruction', function () {
|
||||
return view('backend.questionnaire_instructions');
|
||||
})->name('user.instruction');
|
||||
Route::get('check-questionnaire', function () {
|
||||
return view('backend.not_filled_questionnaire');
|
||||
})->name('user.checkFilled');
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -46,6 +53,10 @@
|
|||
Route::resource('listuser', 'ListUserController')->names('adminListUser');
|
||||
Route::resource('listadmin', 'ListAdminController')->names('adminListAdmin');
|
||||
Route::resource('admin-questionnaire', 'AdminQuestionnaireController')->names('adminQuestionnaire');
|
||||
Route::resource('admin-result', 'AdminResultController')->names('adminResult');
|
||||
Route::resource('admin-period', 'AdminPeriodController')->names('adminPeriod');
|
||||
|
||||
Route::post('/select-period', [SelectPeriodController::class, 'update'])->name('adminSelectPeriod');
|
||||
// Route::post('listuser', [UserController::class, 'store']);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue