devianl2 / laravel-scorm

Laravel scorm package
MIT License
38 stars 20 forks source link

Improve SCORM disk storage handler #7

Closed KhaledLela closed 2 years ago

KhaledLela commented 2 years ago
haithamrdina commented 2 years ago

hello khalid , u had an example using this bundle please if u can a doc to use this package thank u

Le lun. 7 févr. 2022, 10:49, Khaled Mohamed @.***> a écrit :

  • refactor(manager): fix manager duplicated storage code, make it depend on ScormDist helper
  • add scorm dist to manage scorm storage disk operation
  • code format and same UUID but under laravel support helper
  • add extra doc on scorm config file including example for explanation
  • update README with step 3 of update config cache, and add optional step to describe scorm disk handler with example.
  • fix scorm update archive with updateOrCreated, drop old scorm package when already exists.

You can view, comment on, or merge this pull request online at:

https://github.com/devianl2/laravel-scorm/pull/7 Commit Summary

File Changes

(5 files https://github.com/devianl2/laravel-scorm/pull/7/files)

Patch Links:

— Reply to this email directly, view it on GitHub https://github.com/devianl2/laravel-scorm/pull/7, or unsubscribe https://github.com/notifications/unsubscribe-auth/AULC2YAU4HM6DXPGBYRQX4TUZ6IRVANCNFSM5NW5ZJDQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

KhaledLela commented 2 years ago

FYI:

// config/scorm.php
<?php

return [

    'table_names' =>  [
        'user_table'   =>  'users',
        'scorm_table'   =>  'scorm',
        'scorm_sco_table'   =>  'scorm_sco',
        'scorm_sco_tracking_table'   =>  'scorm_sco_tracking',
    ],
    /**
     * Scorm directory. You may create a custom path in file system
     * Define Scorm disk under @see config/filesystems.php
     */
    'disk'  =>  's3-scorm',
];
// config/filesystems
    'disks' => [

        'local' => [
            'driver' => 'local',
            'root'   => storage_path('app'),
        ],

        'public' => [
            'driver'     => 'local',
            'root'       => storage_path('app/public'),
            'visibility' => 'public',
        ],

        's3' => [
            'driver' => 's3',
            'key'    => env('AWS_ACCESS_KEY_ID'),
            'secret' => env('AWS_SECRET_ACCESS_KEY'),
            'region' => env('AWS_DEFAULT_REGION'),
            'bucket' => env('AWS_BUCKET'),
        ],

        's3-scorm' => [
            'driver' => 's3',
            'root'   => env('SCORM_ROOT_DIR'),
            'key'    => env('AWS_ACCESS_KEY_ID'),
            'secret' => env('AWS_SECRET_ACCESS_KEY'),
            'region' => env('AWS_DEFAULT_REGION'),
            'bucket' => env('AWS_SCORM_BUCKET'),
        ],
    ],

Hopefully this will help you,

haithamrdina commented 2 years ago

thank u so much it so helpful for any update i will ask u thank u so much for my educationnal project i need to create simple lms with scorm integration and tracking students sco if u have any informations u can share it with me thank you sir

KhaledLela commented 2 years ago

ScormModel::whereOriginFile()

From Laravel doc despite old version still supported. Dynamic Where Clauses You may even use "dynamic" where statements to fluently build where statements using magic methods:

$admin = DB::table('users')->whereId(1)->first();

$john = DB::table('users')
                    ->whereIdAndEmail(2, 'john@doe.com')
                    ->first();

$jane = DB::table('users')
                    ->whereNameOrAge('Jane', 22)
                    ->first();

Update

/**
     * Handle dynamic method calls into the method.
     *
     * @param  string  $method
     * @param  array  $parameters
     * @return mixed
     *
     * @throws \BadMethodCallException
     */
    public function __call($method, $parameters)
    {
        if (static::hasMacro($method)) {
            return $this->macroCall($method, $parameters);
        }

        if (str_starts_with($method, 'where')) {
            return $this->dynamicWhere($method, $parameters);
        }

        static::throwBadMethodCallException($method);
    }
haithamrdina commented 1 year ago

hi @devianl2/laravel-scorm @.***> , there are no examples for saving progress ? if you can make an example to see how do it thanks

Le mar. 29 mars 2022 à 08:21, devianl2 @.***> a écrit :

3.0.7 https://github.com/devianl2/laravel-scorm/releases/tag/3.0.7

Repository: devianl2/laravel-scorm https://github.com/devianl2/laravel-scorm · Tag: 3.0.7 https://github.com/devianl2/laravel-scorm/tree/3.0.7 · Commit: 7a5bad1 https://github.com/devianl2/laravel-scorm/commit/7a5bad1198e4ffd4509b22fa255ba2e768a8fe6e · Released by: devianl2 https://github.com/devianl2

Updated scorm 1.2 to read score.raw as progression Refer to: https://stackoverflow.com/a/52789082

Full Changelog: 3.0.6...3.0.7 https://github.com/devianl2/laravel-scorm/compare/3.0.6...3.0.7

This release has 2 assets:

  • Source code (zip)
  • Source code (tar.gz)

Visit the release page https://github.com/devianl2/laravel-scorm/releases/tag/3.0.7 to download them.

— You are receiving this because you are watching this repository. View it on GitHub https://github.com/devianl2/laravel-scorm/releases/tag/3.0.7 or unsubscribe https://github.com/devianl2/laravel-scorm/unsubscribe_via_email/AULC2YEBPMQRNSY5BY663JLVCK4PZANCNFSM4FL4FIUA from all notifications for this repository.