-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Course management system - Release 2.0.0 (#157)
- Loading branch information
Showing
103 changed files
with
25,198 additions
and
477 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -13,6 +13,9 @@ SEED_NEWS_EDITOR_PASSWORD="news_editor" | |
SEED_EVENT_EDITOR_EMAIL="[email protected]" | ||
SEED_EVENT_EDITOR_PASSWORD="events_editor" | ||
|
||
SEED_COURSE_MANAGER_EMAIL="[email protected]" | ||
SEED_COURSE_MANAGER_PASSWORD="course_manager" | ||
|
||
SEED_USER_EMAIL=[email protected] | ||
SEED_USER_PASSWORD=regular_user | ||
|
||
|
@@ -22,6 +25,7 @@ APP_READ_ONLY_LOGIN=true | |
DEBUGBAR_ENABLED=false | ||
LOG_CHANNEL=daily | ||
LOG_LEVEL=debug | ||
LOG_DISCORD_WEBHOOK_URL= | ||
|
||
# Drivers | ||
DB_CONNECTION=mysql | ||
|
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 |
---|---|---|
|
@@ -24,7 +24,6 @@ Homestead.json | |
.phpunit.result.cache | ||
|
||
package-lock.json | ||
composer.lock | ||
|
||
/.idea | ||
_ide_helper.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
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,38 @@ | ||
<?php | ||
|
||
namespace App\Domains\AcademicProgram; | ||
|
||
use Illuminate\Database\Eloquent\Factories\HasFactory; | ||
use Illuminate\Database\Eloquent\Model; | ||
|
||
class AcademicProgram extends Model | ||
{ | ||
use HasFactory; | ||
|
||
public static function getAcademicPrograms(): array | ||
{ | ||
return [ | ||
'undergraduate' => 'Undergraduate', | ||
'postgraduate' => 'Postgraduate' | ||
]; | ||
} | ||
|
||
public static function getVersions(): array | ||
{ | ||
// TODO integrate with Taxonomies | ||
return [ | ||
1 => 'Current Curriculum', | ||
2 => 'Curriculum - Effective from E22' | ||
]; | ||
} | ||
|
||
public static function getTypes(): array | ||
{ | ||
return [ | ||
'Found' => 'Foundation', | ||
'Core' => 'Core', | ||
'GE' => 'General Elective', | ||
'TE' => 'Technical Elective' | ||
]; | ||
} | ||
} |
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,136 @@ | ||
<?php | ||
|
||
namespace App\Domains\AcademicProgram\Course\Models; | ||
|
||
use App\Domains\Auth\Models\User; | ||
use App\Domains\AcademicProgram\AcademicProgram; | ||
use App\Domains\AcademicProgram\Course\Models\Traits\Scope\CourseScope; | ||
use App\Domains\AcademicProgram\Semester\Models\Semester; | ||
use Database\Factories\CourseFactory; | ||
use Illuminate\Database\Eloquent\Factories\HasFactory; | ||
use Spatie\Activitylog\Traits\LogsActivity; | ||
|
||
/** | ||
* Class Course. | ||
*/ | ||
class Course extends AcademicProgram | ||
{ | ||
use CourseScope, | ||
HasFactory, | ||
LogsActivity; | ||
|
||
protected static $logFillable = true; | ||
protected static $logOnlyDirty = true; | ||
|
||
protected $table = 'courses'; | ||
|
||
/** | ||
* @var string[] | ||
*/ | ||
protected $fillable = [ | ||
'code', | ||
'semester_id', | ||
'academic_program', | ||
'version', | ||
'name', | ||
'credits', | ||
'type', | ||
'content', | ||
'objectives', | ||
'time_allocation', | ||
'marks_allocation', | ||
'ilos', | ||
'references', | ||
'created_by', | ||
'updated_by', | ||
'created_at', | ||
'updated_at', | ||
]; | ||
|
||
/** | ||
* @var string[] | ||
*/ | ||
protected $casts = [ | ||
'academic_program' => 'string', | ||
'type' => 'string', | ||
'objectives' => 'json', | ||
'time_allocation' => 'json', | ||
'marks_allocation' => 'json', | ||
'ilos' => 'json', | ||
'references' => 'json', | ||
'created_at' => 'datetime', | ||
'updated_at' => 'datetime', | ||
]; | ||
|
||
public static function getILOTemplate(): array | ||
{ | ||
// TODO Get the list from Taxonomies | ||
return [ | ||
'general' => [], | ||
'knowledge' => [], | ||
'skills' => [], | ||
'attitudes' => [], | ||
]; | ||
} | ||
public static function getMarksAllocation(): array | ||
{ | ||
// TODO Get the list from Taxonomies | ||
return [ | ||
'practicals' => null, | ||
'tutorials' => null, | ||
'quizzes' => null, | ||
'projects' => null, | ||
'participation' => null, | ||
'mid_exam' => null, | ||
'end_exam' => null, | ||
]; | ||
} | ||
|
||
public static function getTimeAllocation(): array | ||
{ | ||
// TODO Get the list from Taxonomies | ||
return [ | ||
'lecture' => null, | ||
'tutorial' => null, | ||
'practical' => null, | ||
'design' => null, | ||
'assignment' => null, | ||
'independent_learning' => null | ||
]; | ||
} | ||
|
||
public function academicProgram() | ||
{ | ||
return $this->getAcademicPrograms()[$this->academic_program]; | ||
} | ||
|
||
public function createdUser() | ||
{ | ||
return $this->belongsTo(User::class, 'created_by'); | ||
} | ||
|
||
public function updatedUser() | ||
{ | ||
return $this->belongsTo(User::class, 'updated_by'); | ||
} | ||
|
||
public function semester() | ||
{ | ||
return $this->belongsTo(Semester::class, 'semester_id'); | ||
} | ||
|
||
public function version() | ||
{ | ||
return $this->getVersions()[$this->version]; | ||
} | ||
|
||
public function modules() | ||
{ | ||
return $this->hasMany(CourseModule::class); | ||
} | ||
|
||
protected static function newFactory() | ||
{ | ||
return CourseFactory::new(); | ||
} | ||
} |
56 changes: 56 additions & 0 deletions
56
app/Domains/AcademicProgram/Course/Models/CourseModule.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,56 @@ | ||
<?php | ||
|
||
namespace App\Domains\AcademicProgram\Course\Models; | ||
|
||
use App\Domains\AcademicProgram\Course\Models\Traits\Scope\CourseScope; | ||
use Illuminate\Database\Eloquent\Factories\HasFactory; | ||
use Illuminate\Database\Eloquent\Model; | ||
use Spatie\Activitylog\Traits\LogsActivity; | ||
|
||
/** | ||
* Class CourseModule. | ||
*/ | ||
class CourseModule extends Model | ||
{ | ||
use CourseScope, | ||
HasFactory, | ||
LogsActivity; | ||
|
||
protected static $logFillable = true; | ||
protected static $logOnlyDirty = true; | ||
|
||
protected $table = 'course_modules'; | ||
|
||
/** | ||
* @var string[] | ||
*/ | ||
protected $fillable = [ | ||
'course_id', | ||
'topic', | ||
'description', | ||
'time_allocation', | ||
'created_by', | ||
'updated_by', | ||
'created_at', | ||
'updated_at', | ||
]; | ||
|
||
/** | ||
* @var string[] | ||
*/ | ||
protected $casts = [ | ||
'course_id' => 'integer', | ||
'topic' => 'string', | ||
'description' => 'string', | ||
'time_allocation' => 'json', | ||
'created_at' => 'datetime', | ||
'updated_at' => 'datetime', | ||
'created_by' => 'integer', | ||
'updated_by' => 'integer', | ||
]; | ||
|
||
public function course() | ||
{ | ||
return $this->belongsTo(Course::class); | ||
} | ||
} |
Oops, something went wrong.