Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Project] Course management system #92

Merged
merged 84 commits into from
Oct 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
dc6aeeb
Create livewire component for Corse create and reference component
IsharaEkanayaka Aug 22, 2024
360f59f
update local Storage Management for addItem component
IsharaEkanayaka Aug 22, 2024
8f423f5
Switch from localStorage to sessionStorage for temporary item persist…
IsharaEkanayaka Aug 23, 2024
81199cd
add 2 features to addItem blade component
IsharaEkanayaka Aug 23, 2024
234e168
Create course model,controller and routes
kusaljayawardhana Aug 24, 2024
f7364a5
Update create-courses.blade.php
Hasan10100 Aug 24, 2024
50ba6df
Create dummy controller, model and route for semesters
IsharaEkanayaka Aug 25, 2024
89890a1
Add reusable ItemAdder Livewire component
IsharaEkanayaka Aug 26, 2024
f89ff4c
Merge remote-tracking branch 'origin/35-ui-create-component-for-cours…
supundulara Aug 26, 2024
e5b181a
added ILOs and Objectives
supundulara Aug 26, 2024
523e1a9
move academic program options into the Model level
IsharaEkanayaka Aug 26, 2024
b04c9ad
pull request review changes
IsharaEkanayaka Aug 27, 2024
cddd6a9
Pull request review changes
kusaljayawardhana Aug 28, 2024
dc314f8
Merge remote-tracking branch 'origin/32-be-create-dummy-controller-mo…
IsharaEkanayaka Aug 28, 2024
6cd9571
merge 31-be-create-dummy-controllers-models-and-route-for-courses in …
IsharaEkanayaka Aug 28, 2024
bf8ad41
fix route issue in courses
IsharaEkanayaka Aug 28, 2024
cfd1be3
Update create-courses.blade.php
Hasan10100 Aug 28, 2024
4cdcd1a
Course management temp (#56)
NuwanJ Aug 30, 2024
1127cf3
Update page with correct elements (#47)
Hasan10100 Aug 30, 2024
6a86b44
fix Academic Program in sidebar and courses breadcrumb
IsharaEkanayaka Aug 30, 2024
b39a537
Merge pull request #57 from cepdnaclk/51-ui-be-integrate-the-function…
IsharaEkanayaka Aug 30, 2024
248e2b3
add course create route
IsharaEkanayaka Aug 30, 2024
60692d6
Merge pull request #58 from cepdnaclk/51-ui-be-integrate-the-function…
IsharaEkanayaka Aug 30, 2024
00fc454
Add popper.js for correct functionality
Hasan10100 Aug 31, 2024
627db4a
add functionality to course create
IsharaEkanayaka Sep 2, 2024
a14d2ed
Refactor Enum use with Model based definition (#59)
kusaljayawardhana Sep 2, 2024
ead767d
Create Add Module Component (#60)
Hasan10100 Sep 3, 2024
11dc312
create separate migrate files for courses and course_modules
IsharaEkanayaka Sep 3, 2024
0a6fc9c
update UI for BE
IsharaEkanayaka Sep 3, 2024
af2bfe6
integrate module component to course create form and complete course …
IsharaEkanayaka Sep 3, 2024
29e3a02
modify validation for course create
IsharaEkanayaka Sep 3, 2024
85dd557
Merge remote-tracking branch 'origin/51-ui-be-integrate-the-functiona…
IsharaEkanayaka Sep 3, 2024
cd074d9
created index page for Semester (#62)
supundulara Sep 4, 2024
d6e1839
Delete gitignored files
NuwanJ Sep 4, 2024
7e77c51
Changes to update node files
NuwanJ Sep 4, 2024
bc179a8
31 be create dummy controllers models and route for courses (#54)
kusaljayawardhana Sep 4, 2024
17d0d7b
50 be integrate and complete the index pages for courses (#65)
Hasan10100 Sep 4, 2024
bbdb2c1
add functionalities for course edit and delete (#68)
IsharaEkanayaka Sep 4, 2024
cf223b1
Migration file review
NuwanJ Sep 4, 2024
41cf60c
Unit test update
NuwanJ Sep 4, 2024
038ce8c
Integrate the functionalities of create, update and delete for semest…
kusaljayawardhana Sep 5, 2024
0a0b901
[Project] CO200 Manage News and Events (#17)
NuwanJ Sep 7, 2024
d20e346
Unit tests in news and events (#85)
NuwanJ Sep 7, 2024
329ebc2
Merge remote-tracking branch 'origin/main' into release-1.0.0
NuwanJ Sep 7, 2024
8858095
Merge remote-tracking branch 'origin/main' into course-management-system
NuwanJ Sep 7, 2024
bc963c8
A few small changes
NuwanJ Sep 7, 2024
cb79443
created 'CourseManager' role (#64)
supundulara Sep 7, 2024
988f5a1
Event unit test fix
NuwanJ Sep 8, 2024
93c06a4
Merge branch 'release-1.0.0' into course-management-system
NuwanJ Sep 8, 2024
c8ea43b
Merge remote-tracking branch 'origin/main' into course-management-system
NuwanJ Sep 8, 2024
d7fec0d
76 UI add units into time and mark allocations (#90)
Hasan10100 Sep 8, 2024
ef0ff3b
70 UI be update semester link (#91)
supundulara Sep 8, 2024
ceb6172
UI changes on semester index page (#93)
kusaljayawardhana Sep 8, 2024
53de980
Migration changes reverted to avoid unittest fails
NuwanJ Sep 9, 2024
d7cbb17
seed semester and course data (#95)
supundulara Sep 10, 2024
aa3da45
Merge pull request #96 from cepdnaclk/reset-migration
IsharaEkanayaka Sep 10, 2024
fa4cd22
72 be semester url should not nullable (#103)
Hasan10100 Sep 10, 2024
b577dde
Create basic APIs for undergraduate courses (#105)
kusaljayawardhana Sep 11, 2024
e18823f
Add validation logics to Time and Marks Allocation (#104)
IsharaEkanayaka Sep 11, 2024
7079ff2
79 UI course edit (#110)
IsharaEkanayaka Sep 12, 2024
e2d3ae2
Add course created message (#109)
Hasan10100 Sep 12, 2024
6e9a8dd
fix course code not updating in course edit (#108)
IsharaEkanayaka Sep 12, 2024
8f5fd33
add validation errors for rich text boxes (#106)
supundulara Sep 12, 2024
6288ba7
Implement role based access for the course related pages (#107)
kusaljayawardhana Sep 12, 2024
52bac42
redesign itemAdder (#114)
IsharaEkanayaka Sep 15, 2024
8aac8ff
fix a bug in item adder (#121)
IsharaEkanayaka Sep 15, 2024
d188745
115 UI course page 3 (#139)
IsharaEkanayaka Sep 21, 2024
8d2831b
Integrate debug logs on controller actions + discord webhook integrat…
kusaljayawardhana Sep 21, 2024
4485572
unit tests for semesters (#117)
supundulara Sep 21, 2024
91e711e
updated semester delete (#116)
supundulara Sep 21, 2024
f7144bb
Implement unit tests for courses (#142)
kusaljayawardhana Sep 21, 2024
281203d
Release 1.2.0 (#99)
NuwanJ Sep 21, 2024
23a9d8d
Merge remote-tracking branch 'origin/main' into course-management-system
NuwanJ Sep 21, 2024
103e5e3
73 UI course create page 1 (#135)
Hasan10100 Sep 22, 2024
55842f6
Packages and ReadMe updates
NuwanJ Sep 22, 2024
3cad7be
fix ilos seed issue for courses (#146)
IsharaEkanayaka Sep 23, 2024
ed8eee6
changes to quill editor and add dynamic image preview in the forms (#…
IsharaEkanayaka Sep 24, 2024
8f7d497
[Review] Course management system (#154)
NuwanJ Sep 29, 2024
dda3472
Basic UI and BE support for the new requirements in new Curriculum (#…
NuwanJ Oct 5, 2024
0002021
[Feature] Deployment scripts (#144)
NuwanJ Oct 5, 2024
23ceb97
A few small improvements
NuwanJ Oct 5, 2024
5a8ed0c
Sortable changes
NuwanJ Oct 5, 2024
6d8d14e
Small fixes
NuwanJ Oct 5, 2024
33c5a6b
Type fix
NuwanJ Oct 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,15 @@ APP_URL=http://localhost
[email protected]
SEED_ADMIN_PASSWORD=admin_user

SEED_NEWS_EDITOR_EMAIL="[email protected]"
SEED_NEWS_EDITOR_EMAIL="user+[email protected]"
SEED_NEWS_EDITOR_PASSWORD="news_editor"

SEED_EVENT_EDITOR_EMAIL="[email protected]"
SEED_EVENT_EDITOR_EMAIL="user+[email protected]"
SEED_EVENT_EDITOR_PASSWORD="events_editor"

SEED_COURSE_MANAGER_EMAIL="[email protected]"
SEED_COURSE_MANAGER_PASSWORD="course_manager"

[email protected]
SEED_USER_PASSWORD=regular_user

Expand All @@ -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
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/laravel_push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Laravel Push Test

on: [push]

jobs:
laravel-tests:
runs-on: ubuntu-latest

steps:
- uses: shivammathur/setup-php@15c43e89cdef867065b0213be354c2841860869e
with:
php-version: '8.0'
- uses: actions/checkout@v2
- name: Copy .env
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
- name: Install Dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
- name: Generate key
run: php artisan key:generate
- name: Directory Permissions
run: chmod -R 777 storage bootstrap/cache
- name: Create Database
run: |
mkdir -p database
touch database/database.sqlite
- name: Execute tests (Unit and Feature tests) via PHPUnit
env:
DB_CONNECTION: sqlite
DB_DATABASE: database/database.sqlite
run: |
php artisan test -p --colors --debug
33 changes: 21 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@ Please make sure you already created a Database and a Database User Account.

#### Install Dependencies

```
```bash
// Install PHP dependencies
composer install

// Install Node dependencies (development mode)
npm install
npm run dev
// Install Node dependencies (development mode, can use `npm` as well, but recommended to use `pnpm` here)
pnpm install
pnpm run dev
```

##### Additional useful commands

```
```bash
// If you received mmap() error, use this command
php -d memory_limit=-1 /usr/local/bin/composer install

Expand All @@ -42,7 +42,7 @@ First you need to copy `.env.example` and save as `.env` in the root folder, and

Next follow the below commands

```
```bash
// Prepare the public link for storage
php artisan storage:link

Expand All @@ -56,20 +56,20 @@ git config --local core.hooksPath .githooks

#### Serve in the Local environment

```
```bash
// Serve PHP web server
php artisan serve

// Serve PHP web server, in a specific IP & port
php artisan serve --host=0.0.0.0 --port=8000

// To work with Vue components, you need to run this in parallel
npm run watch
// To work with Vue components, you need to run this in parallel (can use `npm` as well, but recommended to use `pnpm` here)
pnpm run watch
```

#### Cache and optimization

```
```bash
// Remove dev dependencies
composer install --optimize-autoloader --no-dev

Expand All @@ -84,14 +84,14 @@ php artisan view:clear

#### Maintenance related commands

```
```bash
php artisan down --message="{Message}" --retry=60
php artisan up
```

#### Other useful instructions

```
```bash
// Create Model, Controller and Database Seeder
php artisan make:model {name} --migration --controller --seed

Expand All @@ -106,6 +106,15 @@ php artisan test

```

#### Maintenance Scripts

Can be found under `./scripts.` folder. In the production environment, scripts need to be run with `sudo` from the base directory to work correctly.

Ex:
```bash
sudo sh ./scripts/deploy-prod.sh
```

#### Resource Routes - Standardard Pattern

| Verb | URI | Action | Route Name |
Expand Down
38 changes: 38 additions & 0 deletions app/Domains/AcademicProgram/AcademicProgram.php
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'
];
}
}
136 changes: 136 additions & 0 deletions app/Domains/AcademicProgram/Course/Models/Course.php
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 app/Domains/AcademicProgram/Course/Models/CourseModule.php
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);
}
}
Loading
Loading