-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
52 changed files
with
1,150 additions
and
26 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
app/Http/Controllers/Teacher/QuestionBank/QuestionBankController.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers\Teacher\QuestionBank; | ||
|
||
use App\Http\Controllers\Controller; | ||
use Illuminate\Http\Request; | ||
use Illuminate\View\View; | ||
|
||
class QuestionBankController extends Controller | ||
{ | ||
public function index(): View | ||
{ | ||
return view('teacher.question-bank.index'); | ||
} | ||
} |
91 changes: 91 additions & 0 deletions
91
app/Http/Controllers/Teacher/QuestionBank/QuestionPrototypeController.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers\Teacher\QuestionBank; | ||
|
||
use App\Http\Controllers\Controller; | ||
use App\Models\QuestionPrototype; | ||
use App\Models\Subject; | ||
use Illuminate\Http\Request; | ||
|
||
class QuestionPrototypeController extends Controller | ||
{ | ||
/** | ||
* Display a listing of the resource. | ||
* | ||
* @return \Illuminate\Http\Response | ||
*/ | ||
public function index() | ||
{ | ||
return view('teacher.question-bank.question.index', [ | ||
'questions' => QuestionPrototype::all() | ||
]); | ||
} | ||
|
||
/** | ||
* Show the form for creating a new resource. | ||
* | ||
* @return \Illuminate\Http\Response | ||
*/ | ||
public function create() | ||
{ | ||
return view('teacher.question-bank.question.create', [ | ||
'subjects' => Subject::all(), | ||
]); | ||
} | ||
|
||
/** | ||
* Store a newly created resource in storage. | ||
* | ||
* @param \Illuminate\Http\Request $request | ||
* @return \Illuminate\Http\Response | ||
*/ | ||
public function store(Request $request) | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Display the specified resource. | ||
* | ||
* @param \App\Models\QuestionPrototype $questionPrototype | ||
* @return \Illuminate\Http\Response | ||
*/ | ||
public function show(QuestionPrototype $questionPrototype) | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Show the form for editing the specified resource. | ||
* | ||
* @param \App\Models\QuestionPrototype $questionPrototype | ||
* @return \Illuminate\Http\Response | ||
*/ | ||
public function edit(QuestionPrototype $questionPrototype) | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Update the specified resource in storage. | ||
* | ||
* @param \Illuminate\Http\Request $request | ||
* @param \App\Models\QuestionPrototype $questionPrototype | ||
* @return \Illuminate\Http\Response | ||
*/ | ||
public function update(Request $request, QuestionPrototype $questionPrototype) | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Remove the specified resource from storage. | ||
* | ||
* @param \App\Models\QuestionPrototype $questionPrototype | ||
* @return \Illuminate\Http\Response | ||
*/ | ||
public function destroy(QuestionPrototype $questionPrototype) | ||
{ | ||
// | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
|
||
namespace App\Models; | ||
|
||
use Illuminate\Database\Eloquent\Factories\HasFactory; | ||
use Illuminate\Database\Eloquent\Model; | ||
|
||
/** | ||
* App\Models\QuestionPrototype | ||
* | ||
* @property int $id | ||
* @property int $subject_id | ||
* @property \Illuminate\Support\Carbon|null $created_at | ||
* @property \Illuminate\Support\Carbon|null $updated_at | ||
* @property-read \App\Models\QuestionPrototypeVersion|null $latest | ||
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\QuestionPrototypeVersion[] $versions | ||
* @property-read int|null $versions_count | ||
* @method static \Database\Factories\QuestionPrototypeFactory factory(...$parameters) | ||
* @method static \Illuminate\Database\Eloquent\Builder|QuestionPrototype newModelQuery() | ||
* @method static \Illuminate\Database\Eloquent\Builder|QuestionPrototype newQuery() | ||
* @method static \Illuminate\Database\Eloquent\Builder|QuestionPrototype query() | ||
* @method static \Illuminate\Database\Eloquent\Builder|QuestionPrototype whereCreatedAt($value) | ||
* @method static \Illuminate\Database\Eloquent\Builder|QuestionPrototype whereId($value) | ||
* @method static \Illuminate\Database\Eloquent\Builder|QuestionPrototype whereSubjectId($value) | ||
* @method static \Illuminate\Database\Eloquent\Builder|QuestionPrototype whereUpdatedAt($value) | ||
* @mixin \Eloquent | ||
*/ | ||
class QuestionPrototype extends Model | ||
{ | ||
use HasFactory; | ||
|
||
public function versions() | ||
{ | ||
return $this->hasMany(QuestionPrototypeVersion::class); | ||
} | ||
|
||
public function latest() | ||
{ | ||
return $this->hasOne(QuestionPrototypeVersion::class)->latestOfMany(); | ||
} | ||
|
||
public function subject() | ||
{ | ||
return $this->belongsTo(Subject::class); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
|
||
namespace App\Models; | ||
|
||
use Illuminate\Database\Eloquent\Factories\HasFactory; | ||
use Illuminate\Database\Eloquent\Model; | ||
|
||
/** | ||
* App\Models\QuestionPrototypeVersion | ||
* | ||
* @property int $id | ||
* @property string $name | ||
* @property string|null $description | ||
* @property string $body | ||
* @property int $question_prototype_id | ||
* @property \Illuminate\Support\Carbon|null $created_at | ||
* @property \Illuminate\Support\Carbon|null $updated_at | ||
* @method static \Database\Factories\QuestionPrototypeVersionFactory factory(...$parameters) | ||
* @method static \Illuminate\Database\Eloquent\Builder|QuestionPrototypeVersion newModelQuery() | ||
* @method static \Illuminate\Database\Eloquent\Builder|QuestionPrototypeVersion newQuery() | ||
* @method static \Illuminate\Database\Eloquent\Builder|QuestionPrototypeVersion query() | ||
* @method static \Illuminate\Database\Eloquent\Builder|QuestionPrototypeVersion whereBody($value) | ||
* @method static \Illuminate\Database\Eloquent\Builder|QuestionPrototypeVersion whereCreatedAt($value) | ||
* @method static \Illuminate\Database\Eloquent\Builder|QuestionPrototypeVersion whereDescription($value) | ||
* @method static \Illuminate\Database\Eloquent\Builder|QuestionPrototypeVersion whereId($value) | ||
* @method static \Illuminate\Database\Eloquent\Builder|QuestionPrototypeVersion whereName($value) | ||
* @method static \Illuminate\Database\Eloquent\Builder|QuestionPrototypeVersion whereQuestionPrototypeId($value) | ||
* @method static \Illuminate\Database\Eloquent\Builder|QuestionPrototypeVersion whereUpdatedAt($value) | ||
* @mixin \Eloquent | ||
*/ | ||
class QuestionPrototypeVersion extends Model | ||
{ | ||
use HasFactory; | ||
|
||
protected $fillable = [ | ||
'name', | ||
'description', | ||
'body', | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
namespace App\Models; | ||
|
||
use Illuminate\Database\Eloquent\Factories\HasFactory; | ||
use Illuminate\Database\Eloquent\Model; | ||
|
||
/** | ||
* App\Models\QuestionnairePrototype | ||
* | ||
* @property int $id | ||
* @property int $subject_id | ||
* @property \Illuminate\Support\Carbon|null $created_at | ||
* @property \Illuminate\Support\Carbon|null $updated_at | ||
* @method static \Database\Factories\QuestionnairePrototypeFactory factory(...$parameters) | ||
* @method static \Illuminate\Database\Eloquent\Builder|QuestionnairePrototype newModelQuery() | ||
* @method static \Illuminate\Database\Eloquent\Builder|QuestionnairePrototype newQuery() | ||
* @method static \Illuminate\Database\Eloquent\Builder|QuestionnairePrototype query() | ||
* @method static \Illuminate\Database\Eloquent\Builder|QuestionnairePrototype whereCreatedAt($value) | ||
* @method static \Illuminate\Database\Eloquent\Builder|QuestionnairePrototype whereId($value) | ||
* @method static \Illuminate\Database\Eloquent\Builder|QuestionnairePrototype whereSubjectId($value) | ||
* @method static \Illuminate\Database\Eloquent\Builder|QuestionnairePrototype whereUpdatedAt($value) | ||
* @mixin \Eloquent | ||
*/ | ||
class QuestionnairePrototype extends Model | ||
{ | ||
use HasFactory; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
namespace App\Models; | ||
|
||
use Illuminate\Database\Eloquent\Factories\HasFactory; | ||
use Illuminate\Database\Eloquent\Model; | ||
|
||
/** | ||
* App\Models\QuestionnairePrototypeVersion | ||
* | ||
* @property int $id | ||
* @property string $name | ||
* @property string|null $description | ||
* @property int $questionnaire_prototype_id | ||
* @property \Illuminate\Support\Carbon|null $created_at | ||
* @property \Illuminate\Support\Carbon|null $updated_at | ||
* @method static \Database\Factories\QuestionnairePrototypeVersionFactory factory(...$parameters) | ||
* @method static \Illuminate\Database\Eloquent\Builder|QuestionnairePrototypeVersion newModelQuery() | ||
* @method static \Illuminate\Database\Eloquent\Builder|QuestionnairePrototypeVersion newQuery() | ||
* @method static \Illuminate\Database\Eloquent\Builder|QuestionnairePrototypeVersion query() | ||
* @method static \Illuminate\Database\Eloquent\Builder|QuestionnairePrototypeVersion whereCreatedAt($value) | ||
* @method static \Illuminate\Database\Eloquent\Builder|QuestionnairePrototypeVersion whereDescription($value) | ||
* @method static \Illuminate\Database\Eloquent\Builder|QuestionnairePrototypeVersion whereId($value) | ||
* @method static \Illuminate\Database\Eloquent\Builder|QuestionnairePrototypeVersion whereName($value) | ||
* @method static \Illuminate\Database\Eloquent\Builder|QuestionnairePrototypeVersion whereQuestionnairePrototypeId($value) | ||
* @method static \Illuminate\Database\Eloquent\Builder|QuestionnairePrototypeVersion whereUpdatedAt($value) | ||
* @mixin \Eloquent | ||
*/ | ||
class QuestionnairePrototypeVersion extends Model | ||
{ | ||
use HasFactory; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
namespace App\Models; | ||
|
||
use Illuminate\Database\Eloquent\Factories\HasFactory; | ||
use Illuminate\Database\Eloquent\Model; | ||
|
||
/** | ||
* App\Models\QuestionnaireQuestionPrototype | ||
* | ||
* @property int $id | ||
* @property int $questionnaire_prototype_version_id | ||
* @property int $question_prototype_version_id | ||
* @property \Illuminate\Support\Carbon|null $created_at | ||
* @property \Illuminate\Support\Carbon|null $updated_at | ||
* @method static \Illuminate\Database\Eloquent\Builder|QuestionnaireQuestionPrototype newModelQuery() | ||
* @method static \Illuminate\Database\Eloquent\Builder|QuestionnaireQuestionPrototype newQuery() | ||
* @method static \Illuminate\Database\Eloquent\Builder|QuestionnaireQuestionPrototype query() | ||
* @method static \Illuminate\Database\Eloquent\Builder|QuestionnaireQuestionPrototype whereCreatedAt($value) | ||
* @method static \Illuminate\Database\Eloquent\Builder|QuestionnaireQuestionPrototype whereId($value) | ||
* @method static \Illuminate\Database\Eloquent\Builder|QuestionnaireQuestionPrototype whereQuestionPrototypeVersionId($value) | ||
* @method static \Illuminate\Database\Eloquent\Builder|QuestionnaireQuestionPrototype whereQuestionnairePrototypeVersionId($value) | ||
* @method static \Illuminate\Database\Eloquent\Builder|QuestionnaireQuestionPrototype whereUpdatedAt($value) | ||
* @mixin \Eloquent | ||
*/ | ||
class QuestionnaireQuestionPrototype extends Model | ||
{ | ||
use HasFactory; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#! /bin/bash | ||
|
||
# Run this command just after cloning the repo | ||
# Run this command before start development | ||
|
||
set -e | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
namespace Database\Factories; | ||
|
||
use App\Models\Subject; | ||
use Illuminate\Database\Eloquent\Factories\Factory; | ||
|
||
/** | ||
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\QuestionPrototype> | ||
*/ | ||
class QuestionPrototypeFactory extends Factory | ||
{ | ||
/** | ||
* Define the model's default state. | ||
* | ||
* @return array<string, mixed> | ||
*/ | ||
public function definition() | ||
{ | ||
return [ | ||
'subject_id' => Subject::factory(), | ||
]; | ||
} | ||
} |
Oops, something went wrong.