Skip to content

Commit

Permalink
Implement review (only placehorder) for each classroom
Browse files Browse the repository at this point in the history
  • Loading branch information
danivideda committed Dec 3, 2020
1 parent 1b94ddf commit 5bed973
Show file tree
Hide file tree
Showing 15 changed files with 72 additions and 73 deletions.
4 changes: 2 additions & 2 deletions app/Http/Controllers/AssignmentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function storeQuiz(Request $request, Classroom $classroom) {
'is_task' => false
]);

return redirect()->route('assignment', $classroom->id);
return redirect()->route('teacher.assignment', $classroom->id);
}

public function input(Classroom $classroom, Assignment $assignment) {
Expand Down Expand Up @@ -85,7 +85,7 @@ public function storeInput(Request $request, $classroom, $assignment) {
$assignment->questions = $questions;
$assignment->save();

return redirect()->route('assignment', [$classroom]);
return redirect()->route('teacher.assignment', [$classroom]);
}

public function show(Classroom $classroom) {
Expand Down
15 changes: 15 additions & 0 deletions app/Http/Controllers/ReviewController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

namespace App\Http\Controllers;

use App\Models\Classroom;
use Illuminate\Http\Request;

class ReviewController extends Controller
{
public function index(Classroom $classroom) {
return view('teacher.course.review', [
'classroom' => $classroom
]);
}
}
2 changes: 1 addition & 1 deletion app/Http/Controllers/SubjectMatterController.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ public function store(Classroom $classroom, Request $request) {
'content' => $request->content
]);

return redirect()->route('subjectmatter', $classroom->id);
return redirect()->route('teacher.subjectmatter', $classroom->id);
}
}
2 changes: 1 addition & 1 deletion resources/views/layouts/class.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<div class="container mx-auto flex justify-between">
<ul class="flex items-center">
<li>
<a href="/" class="text-gray-400 hover:text-black">
<a href="{{ route('teacher.subjectmatter', [$classroom->id]) }}" class="text-gray-400 hover:text-black">
Back to Class
</a>
</li>
Expand Down
2 changes: 1 addition & 1 deletion resources/views/layouts/teacherhome.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</div>
<div class="text-center mb-8">
<button class="py-1 px-9 bg-blue-500 text-white rounded hover:bg-blue-700">
<a href="{{ route('classroom.create') }}">Create a class</a>
<a href="{{ route('teacher.classroom.create') }}">Create a class</a>
</button>
</div>
<div class="text-center border-r-2 border-blue-500">
Expand Down
10 changes: 5 additions & 5 deletions resources/views/teacher/class/createassignment.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
@section('nav')
<div class="text-center my-2">
<button class="py-1 px-9 bg-white text-gray-300 rounded">
<a href="{{ route('subjectmatter', $classroom->id) }}" class="text-sm">Subject Matter</a>
<a href="{{ route('teacher.subjectmatter', $classroom->id) }}" class="text-sm">Subject Matter</a>
</button>
</div>
<div class="text-center my-2 border-r-2 border-blue-500">
<button class="py-1 px-9 bg-white text-black rounded">
<a href="{{ route('assignment', $classroom->id) }}" class="text-sm">Assignment</a>
<a href="{{ route('teacher.assignment', $classroom->id) }}" class="text-sm">Assignment</a>
</button>
</div>
<div class="text-center my-2">
<button class="py-1 px-9 bg-white text-gray-300 rounded">
<a href="{{ route('subjectmatter', $classroom->id) }}" class="text-sm">Review</a>
<a href="{{ route('teacher.review', $classroom->id) }}" class="text-sm">Review</a>
</button>
</div>
@endsection
Expand All @@ -36,12 +36,12 @@
</div>

<div class="container flex flex-nowrap justify-center gap-8">
<a href="{{ route('assignment.create.quiz', $classroom->id) }}">
<a href="{{ route('teacher.assignment.create.quiz', $classroom->id) }}">
<div class="bg-white my-6 rounded flex col justify-center items-center bg-blue-100 hover:bg-blue-300" style="width: 20rem; height: 20rem;">
<h1 class="text-black text-small font-bold">Quiz / Test</h1>
</div>
</a>
<a href="{{ route('assignment.create.task', $classroom->id) }}">
<a href="{{ route('teacher.assignment.create.task', $classroom->id) }}">
<div class="bg-white my-6 rounded flex col justify-center items-center bg-green-100 hover:bg-green-300" style="width: 20rem; height: 20rem;">
<h1 class="text-black text-small font-bold">Task</h1>
</div>
Expand Down
8 changes: 4 additions & 4 deletions resources/views/teacher/class/createquiztest.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
@section('nav')
<div class="text-center my-2">
<button class="py-1 px-9 bg-white text-gray-300 rounded">
<a href="#" class="text-sm">Subject Matter</a>
<a href="{{ route('teacher.subjectmatter', $classroom->id) }}" class="text-sm">Subject Matter</a>
</button>
</div>
<div class="text-center my-2 border-r-2 border-blue-500">
<button class="py-1 px-9 bg-white text-black rounded">
<a href="#" class="text-sm">Assignment</a>
<a href="{{ route('teacher.assignment', $classroom->id) }}" class="text-sm">Assignment</a>
</button>
</div>
<div class="text-center my-2">
<button class="py-1 px-9 bg-white text-gray-300 rounded">
<a href="#" class="text-sm">Review</a>
<a href="{{ route('teacher.review', $classroom->id) }}" class="text-sm">Review</a>
</button>
</div>
@endsection
Expand All @@ -26,7 +26,7 @@

<div class="container">
<div class="flex flex-wrap flex-col md:flex-row items-center my-8 pl-12 mx-auto rounded-lg">
<form action="{{ route('assignment.create.quiz', $classroom->id) }}" method="POST">
<form action="{{ route('teacher.assignment.create.quiz', $classroom->id) }}" method="POST">
@csrf
<div>
<label for="title" class="tracking-wide text-gray text-base font-bold pb-4">Title :</label>
Expand Down
8 changes: 4 additions & 4 deletions resources/views/teacher/class/createsubjectmatter.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
@section('nav')
<div class="text-center my-2 border-r-2 border-blue-500">
<button class="py-1 px-9 bg-white text-black rounded">
<a href="{{ route('subjectmatter', $classroom->id) }}" class="text-sm">Subject Matter</a>
<a href="{{ route('teacher.subjectmatter', $classroom->id) }}" class="text-sm">Subject Matter</a>
</button>
</div>
<div class="text-center my-2">
<button class="py-1 px-9 bg-white text-gray-300 rounded">
<a href="#" class="text-sm">Assignment</a>
<a href="{{ route('teacher.assignment', $classroom->id) }}" class="text-sm">Assignment</a>
</button>
</div>
<div class="text-center my-2">
<button class="py-1 px-9 bg-white text-gray-300 rounded">
<a href="#" class="text-sm">Review</a>
<a href="{{ route('teacher.review', $classroom->id) }}" class="text-sm">Review</a>
</button>
</div>
@endsection
Expand All @@ -25,7 +25,7 @@
</div>
<div class="container">
<div class="flex flex-wrap flex-col md:flex-row items-center my-8 pl-12 mx-auto rounded-lg">
<form action="{{ route('subjectmatter.create', $classroom->id) }}" method="POST">
<form action="{{ route('teacher.subjectmatter.create', $classroom->id) }}" method="POST">
@csrf
<div>
<label for="title" class="tracking-wide text-gray text-base font-bold pb-4">Title :</label>
Expand Down
16 changes: 8 additions & 8 deletions resources/views/teacher/class/createtask.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
@section('nav')
<div class="text-center my-2">
<button class="py-1 px-9 bg-white text-gray-300 rounded">
<a href="#" class="text-sm">Subject Matter</a>
<a href="{{ route('teacher.subjectmatter', $classroom->id) }}" class="text-sm">Subject Matter</a>
</button>
</div>
<div class="text-center my-2 border-r-2 border-blue-500">
<button class="py-1 px-9 bg-white text-black rounded">
<a href="#" class="text-sm">Assignment</a>
<a href="{{ route('teacher.assignment', $classroom->id) }}" class="text-sm">Assignment</a>
</button>
</div>
<div class="text-center my-2">
<button class="py-1 px-9 bg-white text-gray-300 rounded">
<a href="#" class="text-sm">Review</a>
<a href="{{ route('teacher.review', $classroom->id) }}" class="text-sm">Review</a>
</button>
</div>
@endsection
Expand All @@ -23,7 +23,7 @@
<div class="my-4 text-black text-3xl font-bold mx-auto pl-12">
<h1> Create new Task :</h1>
</div>

<div class="container">
<div class="flex flex-wrap flex-col md:flex-row items-center my-8 pl-12 mx-auto rounded-lg">
<form action="" method="POST">
Expand All @@ -34,7 +34,7 @@
<div class="mb-4">
<input type="text" name="classname" id="classname" placeholder="Input title for this task"
class="bg-gray-100 border-2 border-blue-400 mt-4 py-4 px-4 rounded-lg @error('classname') border-red-500 @enderror" value="{{ old('classname') }}" style="width: 32rem">

@error('classname')
<div class="text-red-500 mt-2 text-base">
{{ $message }}
Expand All @@ -48,7 +48,7 @@ class="bg-gray-100 border-2 border-blue-400 mt-4 py-4 px-4 rounded-lg @error('cl
<div class="mb-4">
<input type="number" name="mc" id="mc" placeholder="maximum: 10"
class="bg-gray-100 border-2 border-blue-400 mt-4 py-4 px-4 rounded-lg @error('mc') border-red-500 @enderror" value="{{ old('mc') }}" style="width: 32rem">

@error('mc')
<div class="text-red-500 mt-2 text-base">
{{ $message }}
Expand All @@ -62,14 +62,14 @@ class="bg-gray-100 border-2 border-blue-400 mt-4 py-4 px-4 rounded-lg @error('mc
<div class="mb-4">
<input type="number" name="essay" id="essay" placeholder="maximum: 10"
class="bg-gray-100 border-2 border-blue-400 mt-4 py-4 px-4 rounded-lg @error('essay') border-red-500 @enderror" value="{{ old('essay') }}" style="width: 32rem">

@error('essay')
<div class="text-red-500 mt-2 text-base">
{{ $message }}
</div>
@enderror
</div>

<div>
<button type="submit" class="bg-green-400 text-white px-4 py-3 rounded font-medium w-20 hover:bg-green-500">Create</button>
</div>
Expand Down
4 changes: 2 additions & 2 deletions resources/views/teacher/class/inputtask.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<div class="flex flex-col container w-5/6 mx-auto my-4 py-8 px-16 border-2 border-gray-100 gap-4">
<div class="text-center">
<h1 class="text-2xl bg-gray-50 font-bold mx-auto py-4">Task1</h1>
<h1 class="text-2xl bg-gray-50 font-bold mx-auto py-4">{{ $assignment->title }}</h1>
</div>
<div class="flex flex-row gap-4">
<div class="bg-gray-50 w-1/3 h-full">
Expand All @@ -22,7 +22,7 @@
<h1 class="text-xl font-bold">Input the question:</h1>
</div>
<div class="mx-auto px-6">
<form action="{{ route('assignment.input', [$classroom->id, $assignment->id]) }}" method="POST">
<form action="{{ route('teacher.assignment.input', [$classroom->id, $assignment->id]) }}" method="POST">
@csrf
<div class="mb-4">
<textarea name="question" id="question" cols="70" rows="10" class="bg-gray-50 border-2 border-gray-300 py-4 px-4 rounded-lg @error('question') border-red-500 @enderror" value="{{ old('question') }}">
Expand Down
10 changes: 5 additions & 5 deletions resources/views/teacher/course/assignment.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
@section('nav')
<div class="text-center my-2">
<button class="py-1 px-9 bg-white text-gray-300 rounded">
<a href="{{ route('subjectmatter', $classroom->id) }}" class="text-sm">Subject Matter</a>
<a href="{{ route('teacher.subjectmatter', $classroom->id) }}" class="text-sm">Subject Matter</a>
</button>
</div>
<div class="text-center my-2 border-r-2 border-blue-500">
<button class="py-1 px-9 bg-white text-black rounded">
<a href="{{ route('assignment', $classroom->id) }}" class="text-sm">Assignment</a>
<a href="{{ route('teacher.assignment', $classroom->id) }}" class="text-sm">Assignment</a>
</button>
</div>
<div class="text-center my-2">
<button class="py-1 px-9 bg-white text-gray-300 rounded">
<a href="{{ route('subjectmatter', $classroom->id) }}" class="text-sm">Review</a>
<a href="{{ route('teacher.review', $classroom->id) }}" class="text-sm">Review</a>
</button>
</div>
@endsection
Expand All @@ -31,7 +31,7 @@
</div>
</div>
<div class="container w-full">
<a href="{{ route('assignment.create', $classroom->id) }}">
<a href="{{ route('teacher.assignment.create', $classroom->id) }}">
<div class="bg-white w-4/12 mx-auto my-6 rounded flex bg-gray-200 hover:bg-gray-300">
<h1 class="text-black text-base w-10/12 px-4 py-4">Create New Assignment</h1>
<h1 class="text-black text-base italic font-extrabold w-2/12 px-4 py-4">+</h1>
Expand All @@ -43,7 +43,7 @@
</div>

@foreach ($assignments as $assignment)
<a href="{{ route('assignment.input', [$classroom->id, $assignment->id]) }}">
<a href="{{ route('teacher.assignment.input', [$classroom->id, $assignment->id]) }}">
<div class="bg-white w-9/12 mx-auto px-4 py-4 my-6 rounded border-2 hover:border-gray-600">
<h1 class="text-black text-base">{{ $assignment->title }}</h1>
</div>
Expand Down
14 changes: 7 additions & 7 deletions resources/views/teacher/course/review.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
@section('nav')
<div class="text-center my-2">
<button class="py-1 px-9 bg-white text-gray-300 rounded">
<a href="#" class="text-sm">Subject Matter</a>
<a href="{{ route('teacher.subjectmatter', $classroom->id) }}" class="text-sm">Subject Matter</a>
</button>
</div>
<div class="text-center my-2">
<button class="py-1 px-9 bg-white text-gray-300 rounded">
<a href="#" class="text-sm">Assignment</a>
<a href="{{ route('teacher.assignment', $classroom->id) }}" class="text-sm">Assignment</a>
</button>
</div>
<div class="text-center my-2 border-r-2 border-blue-500">
<button class="py-1 px-9 bg-white text-black rounded">
<a href="#" class="text-sm">Review</a>
<a href="{{ route('teacher.review', $classroom->id) }}" class="text-sm">Review</a>
</button>
</div>
@endsection
Expand All @@ -22,9 +22,9 @@
<div class="container">
<div class="flex flex-wrap flex-col md:flex-row items-center bg-white mt-2 mb-10 w-9/12 mx-auto rounded-lg">
<div class="flex flex-col xl:w-2/5 overflow-y-hidden lg:items-start pl-4">
<h1 class="text-xl text-black text-left mb-4">Pemrograman</h1>
<h1 class="text-sm text-blacktext-left">Melati</h1>
<p class="text-sm text-left">SMAN 8 Jogja</p>
<h1 class="text-xl text-black text-left mb-4">{{ $classroom->class_name }}</h1>
<h1 class="text-sm text-blacktext-left">{{ $classroom->teacher->name }}</h1>
<p class="text-sm text-left">{{ $classroom->teacher->school_name }}</p>
</div>
<div class="xl:w-3/5 overflow-y-hidden rounded-lg">
<img class="w-full rounded-lg" src="{{asset('img/logo.PNG')}}">
Expand All @@ -38,7 +38,7 @@
<div class="bg-white w-9/12 mx-auto my-6 rounded flex border-2 hover:border-gray-600">
<h1 class="text-black text-base w-9/12 px-4 py-4">Task1</h1>
<h1 class="text-black text-small italic font-bold w-3/12 bg-green-200 px-4 py-4">Ongoing</h1>
</div>
</div>
</a>
</div>
</div>
Expand Down
10 changes: 5 additions & 5 deletions resources/views/teacher/course/subjectmatter.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
@section('nav')
<div class="text-center my-2 border-r-2 border-blue-500">
<button class="py-1 px-9 bg-white text-black rounded">
<a href="{{ route('subjectmatter', $classroom->id) }}" class="text-sm">Subject Matter</a>
<a href="{{ route('teacher.subjectmatter', $classroom->id) }}" class="text-sm">Subject Matter</a>
</button>
</div>
<div class="text-center my-2">
<button class="py-1 px-9 bg-white text-gray-300 rounded">
<a href="{{ route('assignment', $classroom->id) }}" class="text-sm">Assignment</a>
<a href="{{ route('teacher.assignment', $classroom->id) }}" class="text-sm">Assignment</a>
</button>
</div>
<div class="text-center my-2">
<button class="py-1 px-9 bg-white text-gray-300 rounded">
<a href="{{ route('subjectmatter', $classroom->id) }}" class="text-sm">Review</a>
<a href="{{ route('teacher.review', $classroom->id) }}" class="text-sm">Review</a>
</button>
</div>
@endsection
Expand All @@ -31,7 +31,7 @@
</div>
</div>
<div class="container w-full">
<a href="{{ route('subjectmatter.create', $classroom->id) }}">
<a href="{{ route('teacher.subjectmatter.create', $classroom->id) }}">
<div class="bg-white w-4/12 mx-auto my-6 rounded flex bg-gray-200 hover:bg-gray-300">
<h1 class="text-black text-base w-10/12 px-4 py-4">Create New Subject Matter</h1>
<h1 class="text-black text-base italic font-extrabold w-2/12 px-4 py-4">+</h1>
Expand All @@ -43,7 +43,7 @@
</div>

@foreach ($subjects as $subject)
<a href="{{ route('subjectmatter.show', [$classroom->id, $subject->id]) }}">
<a href="{{ route('teacher.subjectmatter.show', [$classroom->id, $subject->id]) }}">
<div class="bg-white w-9/12 mx-auto px-4 py-4 my-6 rounded border-2 hover:border-gray-600">
<h1 class="text-black text-base italic">{{ $subject->title }}</h1>
</div>
Expand Down
2 changes: 1 addition & 1 deletion resources/views/teacher/home/createclass.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</div>
<div class="container">
<div class="flex flex-wrap flex-col md:flex-row items-center my-8 pl-12 mx-auto rounded-lg">
<form action="{{ route('classroom.create') }}" method="POST">
<form action="{{ route('teacher.classroom.create') }}" method="POST">
@csrf
<div>
<label for="class_name" class="tracking-wide text-gray text-base font-bold pb-4">Class Name :</label>
Expand Down
Loading

0 comments on commit 5bed973

Please sign in to comment.