Billie/resources/views/android/admin/topic/learning.blade.php

391 lines
46 KiB
PHP
Raw Normal View History

2025-05-06 02:47:26 +00:00
@extends('android.admin.admin')
@section('content')
<script src="{{asset('lte/plugins/jquery/jquery.min.js')}}"></script>
<script src="https://bootstrap-tagsinput.github.io/bootstrap-tagsinput/dist/bootstrap-tagsinput.min.js"></script>
<script src="https://unpkg.com/@yaireo/tagify"></script>
<script src="https://unpkg.com/@yaireo/tagify@3.1.0/dist/tagify.polyfills.min.js"></script>
<div class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1 class="m-0">Learning Topik Android</h1>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="#">Home</a></li>
<li class="breadcrumb-item active">Dashboard v1</li>
</ol>
</div>
</div>
</div>
</div>
<section class="content">
<div class="container-fluid">
<div class="row justify-content-center">
<div class="col-md-12">
<div class="card card-body">
<div class="row">
<div class="col-md-8">
<small class="text-bold">Learning Topik yang diubah</small>
<h4>{{ $topic->title }}</h4>
</div>
<div class="col-md-3 text-right">
{{-- <button class="btn btn-primary btn-sm pulse" data-toggle="modal" data-target="#modal-xl"><i class="fas fa-plus"></i> Tambah Materi</button><br> --}}
<button class="btn btn-primary btn-sm pulse" data-toggle="modal" data-target="#modal-option"><i class="fas fa-plus"></i> Tambah Materi</button><br>
<small>Klik untuk menambahkan materi</small>
</div>
</div>
<div class="modal fade" id="modal-option">
<div class="modal-dialog modal-dialog-centered modal-lg">
<div class="modal-content">
<div class="modal-body">
<div class="row">
<div class="col-md-6">
<div class="text-center">
@php echo svg_task() @endphp
<h3>Tambah Materi</h3>
<p>Materi pemrogaman, topik yang akan dipelajari, serta lampiran materi dalam bentuk PDF</p>
<button class="btn btn-primary btn-sm pulse" id="on-modal-xl"><i class="fas fa-plus"></i> Tambah Materi</button>
</div>
</div>
<div class="col-md-6">
<div class="text-center">
@php echo svg_materi() @endphp
<h3>Tambah Submission Area</h3>
<p>Area untuk menambahkan tugas dari setiap learning yang telah dipelajari</p>
<button class="btn btn-warning btn-sm pulse" id="on-modal-submission"><i class="fas fa-plus"></i> Tambah Submission</button>
</div>
</div>
</div>
</div>
<div class="modal-footer justify-content-between">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="modal-xl">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<form action="{{ url('android23/topic/learning/add/'. $topic->id.'/material' ) }}" method="post" enctype="multipart/form-data">
@csrf
<div class="modal-body">
<h4 style="margin: 0px">Tambah Learning Topik Android</h4>
<p>Isi form dibawah ini untuk menambahkan topik android</p>
<div class="form-group">
<label for="">Title</label>
<input type="text" name="title" class="form-control" placeholder="Masukkan judul learning . . ." required="">
<small>Berisi judul learning topik materi android</small>
</div>
<div class="form-group">
<label for="">Caption (Opsional)</label>
<input type="text" name="caption" class="form-control" placeholder="Masukkan caption learning . . .">
<small>Berisi caption learning topik materi android</small>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label for="">Urutan Materi</label>
<input type="number" name="task_no" class="form-control" placeholder="Urutan materi . . .">
<small>Urutan materi learning topik android</small>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="">PDF</label>
<input type="file" name="material" required="">
<small>Berisi file PDF materi android</small>
</div>
</div>
</div>
<div class="form-group">
<input name="tags" type="hidden" value='checkActivityName()' class="form-control" id="form-a">
</div>
</div>
<div class="modal-footer justify-content-between">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="submit" class="btn btn-primary">Tambahkan</button>
</div>
</form>
</div>
</div>
</div>
<div class="modal fade" id="modal-submission">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<form action="{{ url('android23/topic/learning/add/'. $topic->id.'/submission') }}" method="post" enctype="multipart/form-data">
@csrf
<div class="modal-body">
<h4 style="margin: 0px">Tambah Submission Topik Android</h4>
<p>Isi form dibawah ini untuk menambahkan topik android</p>
<div class="form-group">
<label for="">Title</label>
<input type="text" name="title" class="form-control" placeholder="Masukkan judul learning . . ." required="">
<small>Berisi judul learning topik materi android</small>
</div>
<div class="form-group">
<label for="">Caption (Opsional)</label>
<input type="text" name="caption" class="form-control" placeholder="Masukkan caption learning . . .">
<small>Berisi caption learning topik materi android</small>
</div>
<div class="row">
<div class="col-md-12">
<div class="form-group">
<label for="">Urutan Materi</label>
<input type="number" name="task_no" class="form-control" placeholder="Urutan materi . . .">
<small>Urutan materi learning topik android</small>
</div>
</div>
</div>
<div class="form-group">
<label for="">Test Case</label>
<input name="tags" value='checkActivityName()' class="form-control" id="form-b">
</div>
</div>
<div class="modal-footer justify-content-between">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="submit" class="btn btn-primary">Tambahkan</button>
</div>
</form>
</div>
</div>
</div>
<hr>
<table class="table" id="datatable">
<thead>
<tr>
<th>Task.No</th>
<th>Info</th>
<th>Name</th>
<th>Caption</th>
<th>File</th>
<th>Option</th>
</tr>
</thead>
<tbody>
@forelse ($task as $index => $isi)
<tr>
<td>Urutan - {{ $isi->task_no }}<br><small>{{ $isi->tipe }}</small></td>
<td><b class="text-success">
@if( $isi->tipe == "submission" )
{{ $isi->testcase->count() }} Testcase
@endif
</b></td>
<td>{{ $isi->task_name }}</td>
<td>{{ $isi->caption }}</td>
<td>
@php
$direktori = "android23/document/$topic->folder_path/$isi->material";
@endphp
<a href="{{ url($direktori) }}">{{ $isi->material }}</a>
</td>
<td>
<a style="font-size: 10px" href="javascript:;" class="btn btn-sm btn-secondary" onclick="doSettingTestcase('{{ $index }}')">
<i class="fas fa-edit"></i>
Testcase
</a>
<a style="font-size: 10px" href="javascript:;" class="btn btn-sm btn-warning" onclick="doUpdate('{{ $index }}')">
<i class="fas fa-edit"></i>
</a>
<a style="font-size: 10px" onclick="return confirm('Apakah anda ingin menghapus learning topik ini ?')" href="{{ url('android23/topic/learning/delete/'. $topic->id.'/'.$isi->id) }}" class="btn btn-sm btn-outline-danger">
<i class="fas fa-trash"></i>
</a>
<div class="modal fade" id="modal-update-{{ $index }}">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<form action="{{ url('android23/topic/learning/update/'. $topic->id.'/'.$isi->id) }}" method="post" enctype="multipart/form-data">
@csrf
<div class="modal-body">
<h4 style="margin: 0px">Sunting Learning Topik Android</h4>
<p>Isi form dibawah ini untuk menambahkan topik android</p>
<div class="form-group">
<label for="">Title</label>
<input type="text" name="title" class="form-control" value="{{ $isi->task_name }}" placeholder="Masukkan judul learning . . ." required="">
<small>Berisi judul learning topik materi android</small>
</div>
<div class="form-group">
<label for="">Caption (Opsional)</label>
<input type="text" name="caption" value="{{ $isi->caption }}" class="form-control" placeholder="Masukkan caption learning . . .">
<small>Berisi caption learning topik materi android</small>
</div>
@if ( $isi->tipe == "submission" )
<div class="row">
<div class="col-md-12">
<div class="form-group">
<label for="">Urutan Materi</label>
<input type="number" name="task_no" value="{{ $isi->task_no }}" class="form-control" placeholder="Urutan materi . . .">
<small>Urutan materi learning topik android</small>
</div>
</div>
</div>
@else
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label for="">Urutan Materi</label>
<input type="number" name="task_no" value="{{ $isi->task_no }}" class="form-control" placeholder="Urutan materi . . .">
<small>Urutan materi learning topik android</small>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label for="">PDF</label>
<input type="file" name="material">
<small>Berisi file PDF materi android</small>
</div>
</div>
</div>
@endif
</div>
<div class="modal-footer justify-content-between">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="submit" class="btn btn-primary">Tambahkan</button>
</div>
</form>
</div>
</div>
</div>
<!-- Modal -->
<div class="modal fade" id="display-testcase-{{ $index }}" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
@if ( $isi->testcase->count() > 0 )
<form action="{{ url('android23/topic/update-testcase') }}" method="POST">
@else
<form action="{{ url('android23/topic/add-testcase/'. $isi->android_topic_id.'/'. $isi->id) }}" method="POST">
@endif
<div class="modal-body">
<h4 style="margin: 0px">Daftar Testcase</h4>
<p>Pengaturan pembobotan per-testcase</p>
<hr>
@csrf
<input type="hidden" name="task_id" value="{{ $isi->id }}">
<input type="hidden" name="topic_id" value="{{ $isi->android_topic_id }}">
@if ( $isi->testcase->count() > 0 )
@foreach ( $isi->testcase AS $det_tc )
<div class="row form-group">
<div class="col-md-2">
<a onclick="return confirm('Apakah anda ingin menghapus testcase {{ $det_tc->case }}')" href="{{ url('android23/topic/remove-testcase/'. $isi->android_topic_id.'/'. $det_tc->id) }}" class="btn btn-sm btn-default" style="font-size: 12px; color: red;"><i class="fas fa-times"></i></a>
</div>
<div class="col-md-7">
<small>Materi Testcase</small><br>
<b>{{ $det_tc->case }}</b>
</div>
<div class="col-md-3">
<input type="hidden" name="case[]" value="{{ $det_tc->case }}">
<input type="text" name="score[]" class="form-control" value="{{ $det_tc->score }}" required="">
</div>
</div>
@endforeach
@else
<div class="form-group">
<label for="">Test Case</label>
<input name="tags" value='checkActivityName()' class="form-control" id="form-{{ $index}}">
</div>
@endif
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Batal</button>
<a onclick="return confirm('Apakah anda ingin mereset testcase dari task {{ $isi->task_name }}')" href="{{ url('android23/topic/reset/'. $isi->android_topic_id.'/'. $isi->id) }}" class="btn btn-secondary">Reset</a>
<button type="submit" class="btn btn-primary">Save changes</button>
</div>
</form>
</div>
</div>
</div>
</td>
</tr>
@empty
<tr>
<td colspan="6" class="text-center">
<b>Kosong</b>
<small>Anda belum menambahkan learning topik</small>
</td>
</tr>
@endforelse
</tbody>
</table>
</div>
</div>
</div>
</div>
</section>
@php
function svg_materi() {
return '<svg style="width: 200px; height: 200px" xmlns="http://www.w3.org/2000/svg" data-name="Layer 1" viewBox="0 0 794.23533 458.82848" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M569.645,655.81836a6.78564,6.78564,0,0,1-3.34668-.88574L372.80225,545.53711a6.828,6.828,0,0,1-2.58008-9.293L522.625,266.67822a6.81755,6.81755,0,0,1,9.29248-2.58008L725.41309,373.49365a6.82785,6.82785,0,0,1,2.58105,9.29248L575.59082,652.35156a6.776,6.776,0,0,1-4.11182,3.21582A6.85621,6.85621,0,0,1,569.645,655.81836Z" transform="translate(-202.88234 -220.58576)" fill="#e6e6e6"/><rect x="618.29869" y="218.2757" width="1.57992" height="234.91839" transform="translate(-180.74045 488.83783) rotate(-60.51777)" fill="#fff"/><rect x="604.30254" y="243.03172" width="1.57992" height="234.91839" transform="translate(-209.39867 489.22631) rotate(-60.51777)" fill="#fff"/><rect x="590.30639" y="267.78775" width="1.57992" height="234.91839" transform="translate(-238.05689 489.6148) rotate(-60.51777)" fill="#fff"/><rect x="576.31024" y="292.54377" width="1.57992" height="234.91839" transform="translate(-266.71511 490.00329) rotate(-60.51777)" fill="#fff"/><rect x="562.31408" y="317.29979" width="1.57992" height="234.91839" transform="translate(-295.37333 490.39178) rotate(-60.51777)" fill="#fff"/><rect x="548.31793" y="342.05581" width="1.57992" height="234.91839" transform="translate(-324.03155 490.78027) rotate(-60.51777)" fill="#fff"/><rect x="534.32178" y="366.81184" width="1.57992" height="234.91839" transform="translate(-352.68977 491.16876) rotate(-60.51777)" fill="#fff"/><rect x="520.32563" y="391.56786" width="1.57992" height="234.91839" transform="translate(-381.34799 491.55725) rotate(-60.51777)" fill="#fff"/><rect x="506.32948" y="416.32388" width="1.57992" height="234.91839" transform="translate(-410.00621 491.94574) rotate(-60.51777)" fill="#fff"/><rect x="492.33333" y="441.07991" width="1.57992" height="234.91839" transform="translate(-438.66442 492.33423) rotate(-60.51777)" fill="#fff"/><rect x="478.33717" y="465.83593" width="1.57992" height="234.91839" transform="translate(-467.32264 492.72272) rotate(-60.51777)" fill="#fff"/><path d="M551.645,614.81836a6.78564,6.78564,0,0,1-3.34668-.88574L354.80225,504.53711a6.828,6.828,0,0,1-2.58008-9.293L504.625,225.67822a6.81755,6.81755,0,0,1,9.29248-2.58008L707.41309,332.49365a6.82785,6.82785,0,0,1,2.58105,9.29248L557.59082,611.35156a6.776,6.776,0,0,1-4.11182,3.21582A6.85621,6.85621,0,0,1,551.645,614.81836Z" transform="translate(-202.88234 -220.58576)" fill="#f2f2f2"/><rect x="600.29869" y="177.2757" width="1.57992" height="234.91839" transform="translate(-154.19084 452.34697) rotate(-60.51777)" fill="#fff"/><rect x="586.30254" y="202.03172" width="1.57992" height="234.91839" transform="translate(-182.84906 452.73546) rotate(-60.51777)" fill="#fff"/><rect x="572.30639" y="226.78775" width="1.57992" height="234.91839" transform="translate(-211.50728 453.12395) rotate(-60.51777)" fill="#fff"/><rect x="558.31024" y="251.54377" width="1.57992" height="234.91839" transform="translate(-240.1655 453.51244) rotate(-60.51777)" fill="#fff"/><rect x="544.31408" y="276.29979" width="1.57992" height="234.91839" transform="translate(-268.82372 453.90093) rotate(-60.51777)" fill="#fff"/><rect x="530.31793" y="301.05581" width="1.57992" height="234.91839" transform="translate(-297.48194 454.28942) rotate(-60.51777)" fill="#fff"/><rect x="516.32178" y="325.81184" width="1.57992" height="234.91839" transform="translate(-326.14016 454.67791) rotate(-60.51777)" fill="#fff"/><rect x="502.32563" y="350.56786" width="1.57992" height="234.91839" transform="translate(-354.79838 455.0664) rotate(-60.51777)" fill="#fff"/><rect x="488.32948" y="375.32388" width="1.57992" height="234.91839" transform="translate(-383.4566 455.45489) rotate(-60.51777)" fill="#fff"/><rect x="474.33333" y="400.07991" width="1.57992" height="234.91839" transform="translate(-412.11482 455.84338) rotate(-60.51777)" fill="#fff"/><rect x="460.33717" y="424.83593" width="1.57992" height="234.91839" transform="translate(-440.77304 456.23187)
}
function svg_task() {
return '<svg style="width: 200px; height: 200px" xmlns="http://www.w3.org/2000/svg" data-name="Layer 1" viewBox="0 0 952 586" xmlns:xlink="http://www.w3.org/1999/xlink"><path id="a163713d-a7fc-4807-a77b-111ad75719e9-200" data-name="Path 133" d="M170.63353,697.233a158.3937,158.3937,0,0,0,7.4,43.785c.1.329.211.653.319.982h27.613c-.029-.295-.059-.624-.088-.982-1.841-21.166,8.677-148.453,21.369-170.483C226.13454,572.322,168.49254,629.979,170.63353,697.233Z" transform="translate(-124 -157)" fill="#f1f1f1"/><path id="a1d5a274-7181-45f3-aae5-db776f20014a-201" data-name="Path 134" d="M172.70558,741.018c.231.329.471.658.717.982h20.716c-.157-.28-.339-.609-.55-.982-3.422-6.176-13.551-24.642-22.953-43.785-10.1-20.572-19.374-41.924-18.593-49.652C151.80058,649.323,144.80861,702.457,172.70558,741.018Z" transform="translate(-124 -157)" fill="#f1f1f1"/><path d="M775.29126,277.577a14.42246,14.42246,0,0,0,21.04127,6.80778l39.97977,32.06957,2.47488-26.51836-38.34489-26.38825a14.50066,14.50066,0,0,0-25.151,14.02926Z" transform="translate(-124 -157)" fill="#9f616a"/><polygon points="713.205 130.446 698.283 119.903 681.358 139.458 701.046 151.126 713.205 130.446" fill="#00b0ff"/><path d="M833.93681,280.29582l50.28691,19.349L932.63291,267.947a24.62075,24.62075,0,0,1,31.79547,37.06016l-.433.48083-74.454,39.9183-81.32649-37.15291Z" transform="translate(-124 -157)" fill="#3f3d56"/><polygon points="695.76 583 171.76 583 190.76 212 272.76 212 348.374 265 714.76 265 695.76 583" fill="#e5e5e5"/><path d="M691.4891,626.86286,388.6242,502.13469a4.32609,4.32609,0,0,1-2.35009-5.64107L523.508,163.26232a4.3261,4.3261,0,0,1,5.64107-2.35009L832.014,285.6404a4.32609,4.32609,0,0,1,2.35009,5.64107L697.13017,624.51277A4.32609,4.32609,0,0,1,691.4891,626.86286Z" transform="translate(-124 -157)" fill="#fff"/><path d="M691.4891,626.86286,388.6242,502.13469a4.32609,4.32609,0,0,1-2.35009-5.64107L523.508,163.26232a4.3261,4.3261,0,0,1,5.64107-2.35009L832.014,285.6404a4.32609,4.32609,0,0,1,2.35009,5.64107L697.13017,624.51277A4.32609,4.32609,0,0,1,691.4891,626.86286ZM528.49088,162.51046a2.59553,2.59553,0,0,0-3.38465,1.41006L387.87234,497.15182a2.59552,2.59552,0,0,0,1.41005,3.38464l302.8649,124.72817a2.59553,2.59553,0,0,0,3.38465-1.41L832.76583,290.62327a2.59552,2.59552,0,0,0-1.41005-3.38464Z" transform="translate(-124 -157)" fill="#3f3d56"/><path d="M614.03119,325.86654,538.9143,294.93132a4.32609,4.32609,0,0,1-2.35009-5.64107l30.93522-75.11689a4.3261,4.3261,0,0,1,5.64107-2.35009l75.11689,30.93522a4.3261,4.3261,0,0,1,2.35009,5.64107l-30.93522,75.11689A4.3261,4.3261,0,0,1,614.03119,325.86654ZM572.4823,213.4215a2.59553,2.59553,0,0,0-3.38464,1.41006l-30.93522,75.11689a2.59553,2.59553,0,0,0,1.41006,3.38464l75.11688,30.93522a2.59553,2.59553,0,0,0,3.38465-1.41006l30.93521-75.11689a2.59551,2.59551,0,0,0-1.41-3.38464Z" transform="translate(-124 -157)" fill="#f2f2f2"/><path d="M588.67043,326.17072,513.55354,295.2355a3.89342,3.89342,0,0,1-2.11508-5.077l30.93522-75.11689a3.89343,3.89343,0,0,1,5.077-2.11508l75.11688,30.93522a3.89341,3.89341,0,0,1,2.11508,5.077l-30.93522,75.11689A3.89341,3.89341,0,0,1,588.67043,326.17072Z" transform="translate(-124 -157)" fill="#00b0ff"/><path d="M733.35509,428.74966,498.415,331.99483a3.889,3.889,0,1,1,2.96189-7.192L736.317,421.55762a3.889,3.889,0,0,1-2.96188,7.192Z" transform="translate(-124 -157)" fill="#ccc"/><path d="M666.41582,430.15629,488.213,356.76742a3.889,3.889,0,1,1,2.96188-7.192l178.20284,73.38887a3.889,3.889,0,1,1-2.96189,7.192Z" transform="translate(-124 -157)" fill="#ccc"/><path d="M770.07315,337.32136,666.18809,294.53861a3.889,3.889,0,1,1,2.96189-7.192l103.885,42.78275a3.889,3.889,0,0,1-2.96188,7.192Z" transform="translate(-124 -157)" fill="#ccc"/><path d="M733.94491,351.41683,655.98605,319.3112a3.889,3.889,0,1,1,2.96189-7.192l77.95886,32.10562a3.889,3.889,0,0,1-2.96189,7.192Z" transform="translate(-124 -157)" fill="#ccc"/><path d="M712.951,478.29485,478.011,381.54a3.889,3.889,0,1,1,2.96188-7.192L715.91289,471.1028a3.889,3.889,0,0,1-2.96188,7.192Z" transform="translate(-124 -157)" fill="#ccc"/><path d="M646.01174,479.70147,467.80
}
@endphp
@endsection