163 lines
7.8 KiB
PHP
163 lines
7.8 KiB
PHP
@php
|
|
$project = App\Models\Lesson::where('id', request()->route()->parameter('id'))->firstOrFail();
|
|
|
|
$submission = DB::table('project_submissions')
|
|
->where('lesson_id', $project->id)
|
|
->where('user_id', auth()->id())
|
|
->first();
|
|
@endphp
|
|
|
|
<style>
|
|
/* Mengatur agar list dan blockquote tidak memakan banyak ruang */
|
|
.description blockquote{
|
|
margin: 5px 0 !important;
|
|
padding: 0 10px !important;
|
|
}
|
|
|
|
.description ul, ul {
|
|
list-style-type: disc !important;
|
|
list-style-position: inside !important;
|
|
margin-left: 10px !important;
|
|
display: block !important;
|
|
}
|
|
|
|
.description li {
|
|
display: list-item !important;
|
|
}
|
|
</style>
|
|
|
|
<div class="row px-4">
|
|
<div class="col-12">
|
|
<h4 class="quiz-title text-center mt-4 fw-bold">
|
|
<i class="fas fa-project-diagram me-2"></i> {{ $project->title }}
|
|
</h4>
|
|
<hr>
|
|
|
|
<div class="row mb-5">
|
|
<div class="col-12 mb-2">
|
|
<div class="card shadow-sm border-0">
|
|
<div class="card-body">
|
|
<h5 class="card-title text-primary mb-3">
|
|
<i class="fas fa-file-alt me-2"></i>{{ get_phrase('Project Details') }}
|
|
</h5>
|
|
<div class="description text-secondary">
|
|
{!! $project->description !!}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-12">
|
|
<div class="card shadow-sm border-0 bg-light">
|
|
<div class="card-body">
|
|
<h5 class="card-title text-danger mb-3">
|
|
<i class="fas fa-clipboard-check me-2"></i>{{ get_phrase('Assessment criteria') }}
|
|
</h5>
|
|
<div class="description small text-muted">
|
|
{!! $project->attachment !!}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="submission-area p-4 border rounded mb-5">
|
|
<h5 class="mb-3">{{ get_phrase('Submit Assignment') }}</h5>
|
|
|
|
{{-- KONDISI 1: JIKA BELUM PERNAH SUBMIT --}}
|
|
@if(!$submission)
|
|
<div class="alert alert-info">
|
|
<i class="fas fa-info-circle me-1"></i> {{ get_phrase('Please enter your project link below to be assessed.') }}
|
|
</div>
|
|
|
|
<form action="{{ route('student.project.submit') }}" method="POST">
|
|
@csrf
|
|
<input type="hidden" name="lesson_id" value="{{ $project->id }}">
|
|
<div class="mb-3">
|
|
<label for="project_link" class="form-label fw-bold">{{ get_phrase('Project Link (Google Drive/Github/Website)') }}</label>
|
|
<input type="url" class="form-control" id="project_link" name="submission_link" placeholder="https://..." required>
|
|
<div class="form-text">{{ get_phrase('Make sure the link is accessible to the instructor (Public/Anyone with link).') }}</div>
|
|
</div>
|
|
|
|
<button type="submit" class="eBtn gradient border-0">
|
|
<i class="fas fa-paper-plane me-1"></i> {{ get_phrase('Submit Project') }}
|
|
</button>
|
|
</form>
|
|
|
|
{{-- KONDISI 2: JIKA SUDAH PERNAH SUBMIT --}}
|
|
@else
|
|
|
|
{{-- STATUS 0: MENUNGGU DIPERIKSA --}}
|
|
@if($submission->status == 0)
|
|
<div class="text-center p-5 border rounded bg-light">
|
|
<i class="fas fa-clock fa-3x text-warning mb-3"></i>
|
|
<h5 class="fw-bold">{{ get_phrase('Project is Being Reviewed') }}</h5>
|
|
<p class="text-muted">
|
|
{{ get_phrase('Thank you! We have received your project and it is currently in the instructor\'s review queue.') }}
|
|
</p>
|
|
<div class="mt-3">
|
|
<span class="text-secondary small">{{ get_phrase('Link that you submitted :') }} </span><br>
|
|
<a href="{{ $submission->drive_link }}" target="_blank" class="eBtn gradient border-0 btn-sm mt-1">
|
|
<i class="fas fa-external-link-alt me-1"></i> {{ get_phrase('View Your Project') }}
|
|
</a>
|
|
</div>
|
|
</div>
|
|
|
|
{{-- STATUS 2: PERLU REVISI --}}
|
|
@elseif($submission->status == 2)
|
|
<div class="alert alert-danger border-danger">
|
|
<h5 class="alert-heading fw-bold">
|
|
<i class="fas fa-exclamation-circle me-2"></i>{{ get_phrase('Project Needs Revision') }}
|
|
</h5>
|
|
<p>{{ get_phrase('The instructor has reviewed your project and provided feedback for improvement.') }}</p>
|
|
|
|
<hr>
|
|
|
|
{{-- Menampilkan Komentar Instruktur --}}
|
|
<div class="mb-3">
|
|
<label class="fw-bold text-danger">{{ get_phrase('Instructor\'s Notes / Feedback:') }}</label>
|
|
<div class="bg-white p-3 rounded border border-danger text-dark mt-1">
|
|
{!! $submission->comment !!}
|
|
</div>
|
|
</div>
|
|
|
|
{{-- Form Resubmit --}}
|
|
<div class="mt-4">
|
|
<h6 class="fw-bold">{{ get_phrase('Submit Revision:') }}</h6>
|
|
<form action="{{ route('student.project.submit') }}" method="POST">
|
|
@csrf
|
|
<input type="hidden" name="lesson_id" value="{{ $project->id }}">
|
|
|
|
<div class="input-group">
|
|
{{-- PERBAIKAN: name diubah jadi submission_link --}}
|
|
<input type="url" class="form-control" name="submission_link" placeholder="Masukkan link projek yang sudah diperbaiki..." required>
|
|
|
|
<button class="btn btn-danger" type="submit">
|
|
<i class="fas fa-redo me-1"></i> {{ get_phrase('Submit Revisions') }}
|
|
</button>
|
|
</div>
|
|
<div class="form-text text-danger">{{ get_phrase('Make sure the new link includes the requested fix.') }} </div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
{{-- STATUS 1: DITERIMA / LULUS --}}
|
|
@elseif($submission->status == 1)
|
|
<div class="text-center p-5 border rounded bg-white border-success">
|
|
<i class="fas fa-check-circle fa-3x text-success mb-3"></i>
|
|
<h5 class="fw-bold text-success">{{ get_phrase('Congratulations! Project Accepted') }}</h5>
|
|
<p class="text-muted">
|
|
{{ get_phrase('Good work! Your project has met the assessment criteria.') }}
|
|
</p>
|
|
@if($submission->comment)
|
|
<div class="alert alert-success d-inline-block text-start mt-2">
|
|
<strong>{{ get_phrase('Instructor\'s Comment:') }}</strong> <br> {{ $submission->comment }}
|
|
</div>
|
|
@endif
|
|
</div>
|
|
@endif
|
|
|
|
@endif
|
|
</div>
|
|
</div>
|
|
</div> |