siakad-itm/app/Http/Requests/Admin/AcademicClasses/GradeSubmissionRequest.php
Yoga Pangestu 4980ad95b3 Refactor assignment management system
- Updated the PermissionCatalog to remove unnecessary permissions for assignment submissions.
- Modified RolePermissionSeeder to align with the updated permissions.
- Enhanced useServerTable hook to support resetKeys for Inertia's reset visit option.
- Removed obsolete columns.tsx file related to assignment columns.
- Revamped assignment index page to utilize InfiniteScroll and improved UI components.
- Introduced new assignment status management with enums and updated database schema.
- Created GradeSubmissionRequest for validation of submission grading.
- Implemented score editing functionality in submission index with real-time updates.
- Added accordion component for better UI organization in assignment descriptions.
2026-09-03 09:51:27 +07:00

32 lines
704 B
PHP

<?php
namespace App\Http\Requests\Admin\AcademicClasses;
use Illuminate\Foundation\Http\FormRequest;
class GradeSubmissionRequest extends FormRequest
{
public function authorize(): bool
{
if (! $this->user()->can('update-assignment-submissions')) {
return false;
}
$user = $this->user();
$assignment = $this->route('assignment');
if ($user->hasRole('dosen') && $assignment?->courseClass?->lecturer_id !== $user->lecturer?->id) {
return false;
}
return true;
}
public function rules(): array
{
return [
'score' => ['nullable', 'numeric', 'min:0', 'max:100'],
];
}
}