escolalms / courses
Escola Headless LMS Courses
Installs: 21 052
Dependents: 24
Suggesters: 5
Security: 0
Stars: 5
Watchers: 2
Forks: 1
Open Issues: 0
Type:package
Requires
- php: >=7.4
- davidbadura/faker-markdown-generator: ^1.1
- devianl2/laravel-scorm: >=2.0
- escolalms/auth: ^0
- escolalms/categories: ^0
- escolalms/core: ^1
- escolalms/files: ^0
- escolalms/model-fields: ^0
- escolalms/scorm: ^0
- escolalms/settings: ^0
- escolalms/tags: ^0
- laravel/framework: >=8.0
- spatie/laravel-responsecache: ^7.4
Requires (Dev)
- nunomaduro/larastan: ^2.0
- orchestra/testbench: >=5.0
- phpunit/phpunit: ^9.0
- dev-main
- 0.4.41
- 0.4.40
- 0.4.39
- 0.4.38
- 0.4.37
- 0.4.36
- 0.4.35
- 0.4.34
- 0.4.33
- 0.4.32
- 0.4.31
- 0.4.30
- 0.4.29
- 0.4.28
- 0.4.27
- 0.4.26
- 0.4.25
- 0.4.24
- 0.4.23
- 0.4.22
- 0.4.21
- 0.4.20
- 0.4.19
- 0.4.18
- 0.4.17
- 0.4.16
- 0.4.15
- 0.4.14
- 0.4.13
- 0.4.12
- 0.4.11
- 0.4.10
- 0.4.9
- 0.4.8
- 0.4.7
- 0.4.6
- 0.4.5
- 0.4.4
- 0.4.3
- 0.4.2
- 0.4.1
- 0.4.0
- 0.3.73
- 0.3.72
- 0.3.71
- 0.3.70
- 0.3.69
- 0.3.68
- 0.3.67
- 0.3.66
- 0.3.65
- 0.3.64
- 0.3.63
- 0.3.62
- 0.3.61
- 0.3.60
- 0.3.59
- 0.3.58
- 0.3.57
- 0.3.56
- 0.3.55
- 0.3.54
- 0.3.53
- 0.3.52
- 0.3.51
- 0.3.50
- 0.3.49
- 0.3.48
- 0.3.47
- 0.3.46
- 0.3.45
- 0.3.44
- 0.3.43
- 0.3.42
- 0.3.41
- 0.3.40
- 0.3.39
- 0.3.38
- 0.3.37
- 0.3.36
- 0.3.35
- 0.3.34
- 0.3.33
- 0.3.32
- 0.3.31
- 0.3.30
- 0.3.29
- 0.3.28
- 0.3.27
- 0.3.26
- 0.3.25
- 0.3.24
- 0.3.23
- 0.3.22
- 0.3.21
- 0.3.20
- 0.3.19
- 0.3.18
- 0.3.17
- 0.3.16
- 0.3.15
- 0.3.14
- 0.3.13
- 0.3.12
- 0.3.11
- 0.3.10
- 0.3.9
- 0.3.8
- 0.3.7
- 0.3.6
- 0.3.5
- 0.3.3
- 0.3.2
- 0.3.1
- 0.3.0
- 0.2.x-dev
- 0.2.26
- 0.2.24
- 0.2.23
- 0.2.22
- 0.2.21
- 0.2.20
- 0.2.19
- 0.2.18
- 0.2.17
- 0.2.16
- 0.2.15
- 0.2.14
- 0.2.13
- 0.2.12
- 0.2.11
- 0.2.10
- 0.2.9
- 0.2.8
- 0.2.7
- 0.2.6
- 0.2.5
- 0.2.4
- 0.2.3
- 0.2.2
- 0.2.1
- 0.2.0
- 0.1.54
- 0.1.53
- 0.1.52
- 0.1.51
- 0.1.50
- 0.1.49
- 0.1.48
- 0.1.47
- 0.1.46
- 0.1.45
- 0.1.44
- 0.1.43
- 0.1.42
- 0.1.41
- 0.1.40
- 0.1.39
- 0.1.38
- 0.1.37
- 0.1.36
- 0.1.35
- 0.1.34
- 0.1.33
- 0.1.32
- 0.1.31
- 0.1.30
- 0.1.29
- 0.1.28
- 0.1.27
- 0.1.26
- 0.1.25
- 0.1.24
- 0.1.23
- 0.1.22
- 0.1.21
- 0.1.20
- 0.1.19
- 0.1.18
- 0.1.17
- 0.1.16
- 0.1.15
- 0.1.14
- 0.1.13
- 0.1.12
- 0.1.11
- 0.0.10
- 0.0.9
- 0.0.8
- 0.0.7
- 0.0.6
- 0.0.5
- 0.0.4
- 0.0.3
- 0.0.2
- 0.0.1
- dev-feature/cache-fix
- dev-feature/lesson-model-fields
- dev-feature/lara-stan
- dev-feature/SUD-240
- dev-feature/filtering-user-courses
- dev-reverting-race-conditions-changes
- dev-fix/race-condition-for-topic-progress
- dev-ArtKob-patch-1
This package is auto-updated.
Last update: 2024-11-03 11:04:47 UTC
README
Courses and content package
What does it do
This package is used for creating Course for EscolaLms.
Installing
composer require escolalms/courses
php artisan migrate
php artisan db:seed --class="EscolaLms\Courses\Database\Seeders\CoursesPermissionSeeder"
Schedule
- Schedules are available in ScheduleServiceProvider
$schedule->job(CheckForDeadlines::class)->hourly()
- executed every hours$schedule->job(ActivateCourseJob::class)->daily()
- executed every days
Endpoints
All the endpoints are defined in
Tests
Run ./vendor/bin/phpunit --filter 'EscolaLms\\Courses\\Tests'
to run tests. See tests folder as it's quite good staring point as documentation appendix.
Events
EscolaLms\Courses\Events\CourseAccessFinished
=> Event is dispatched when users lost access to course.EscolaLms\Courses\Events\CourseAccessStarted
=> Event is dispatched when users received access to course.EscolaLms\Courses\Events\CourseAssigned
=> Event is dispatched when admin assigned access user.EscolaLms\Courses\Events\CourseDeadlineSoon
=> Event is dispatched when course deadline is coming out.EscolaLms\Courses\Events\CoursedPublished
=> Event is dispatched when course is published.EscolaLms\Courses\Events\CourseFinished
=> Event is dispatched when course is ended.EscolaLms\Courses\Events\CourseStarted
=> Event is dispatched when course is started.EscolaLms\Courses\Events\CourseStatusChanged
=> Event is dispatched when course has a status change.EscolaLms\Courses\Events\CourseTutorAssigned
=> Event is dispatched when tutor is assigned to course.EscolaLms\Courses\Events\CourseTutorUnassigned
=> Event is dispatched when tutor is unassigned to course.EscolaLms\Courses\Events\CourseUnassigned
=> Event is dispatched when user is unassigned to course.EscolaLms\Courses\Events\TopicFinished
=> Event is dispatched when course topic is finished.
Permissions
Permissions are defined in seeder
Model relation
The model user must be extended with the class HasCourses :
class User extends EscolaLms\Core\Models\User
{
use HasCourses;
Database relation
There is simple relation. see docs for diagram
Course
general category of the courseLesson
grouped by CourseTopic
grouped by Lesson
Course 1 -> n Lesson
Lesson 1 -> n Topic
Topic 1 -> 1 TopicContent
TopicContent
is an abstract model, this package contains some sample implementatio eg, RichText
, Audio
, Video
, H5P
and Image
You create any of the Content model by post to the same Topic endponit (create and update), see docs examples
Note that /api/topics
is using form-data
- this is due to PHP nature of posting files
List of possible TopicContent
s is availabe in the endpoint /api/topics/types
Curriculum/Sylabus/Program
App user access the course by fetching GET /api/courses/{id}/program
endpoint. This is after user purchase or has other access to the course. this endpoints renders tree of Course, Lessons, Topic with Contents essential to render whole course.
Adding new TopicContent
type
In the ServiceProvider register your class like
use Illuminate\Support\ServiceProvider; use EscolaLms\Courses\Facades\Topic; class CustomServiceProvider extends ServiceProvider { //... public function register() { Topic::registerContentClass(TopicContentCustom::class); // or Topic::registerContentClasses([TopicContentCustom::class, TopicAnotherContentCustom::class]); // also register JSON Resource for a type Topic::registerResourceClasses(Audio::class, [ 'client' => ClientAudioResource::class, 'admin' => AdminAudioResource::class, 'export' => ExportAudioResource::class, ]); } }
see EscolaLmsCourseServiceProvider.php as reference as well as Models/TopicContent
Content
Package comes with seeder that create course with lessons and topics
php artisan db:seed --class="\EscolaLms\Courses\Database\Seeders\CoursesSeeder"