From: Vincent Vanwaelscappel Date: Wed, 16 Aug 2023 13:21:56 +0000 (+0200) Subject: wip #6195 @0.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=90e70f44c51e4ce3f471a194e8df14a58f53d418;p=fluidbook-toolbox.git wip #6195 @0.5 --- diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index 515c9c33f..a20a100b2 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -42,6 +42,7 @@ class Kernel extends \Cubist\Backpack\Console\Kernel $schedule->command('job:dispatch ProcessTotals')->everyTwoHours(); $schedule->command('fluidbook:player:updatesources')->everyTwoHours(); + $schedule->command('quiz:player:updatesources')->everyTwoHours(); $schedule->command('job:dispatchNow \\\\Cubedesigners\\\\UserDatabase\\\\Jobs\\\\ApplyPermissionsToUsers')->everyTwoHours(); $schedule->command('fluidbook:farm:ping')->everyMinute(); diff --git a/app/Elearning/QuizCompiler.php b/app/Elearning/QuizCompiler.php index ce5e43fa0..9b399d5dc 100644 --- a/app/Elearning/QuizCompiler.php +++ b/app/Elearning/QuizCompiler.php @@ -13,6 +13,7 @@ use Cubist\Util\CommandLine\Npx; use Cubist\Util\Data; use Cubist\Util\Files\Files; use Cubist\Util\Files\VirtualDirectory; +use RyanChandler\Blade\Blade; class QuizCompiler extends Base { @@ -68,7 +69,8 @@ class QuizCompiler extends Base $vdir->copyDirectory($this->compilePath . '/dist/js', 'js'); $vdir->copyDirectory($this->compilePath . '/dist/assets', 'assets'); - $html = view('quizv2.index', ['data' => $this->data, 'quiz' => $this->quiz, 'theme' => $this->theme])->render(); + $blade = new Blade($this->_resourcesPath() . '/views', $this->_resourcesPath() . '/cache'); + $html = $blade->make('index', ['data' => $this->data, 'quiz' => $this->quiz, 'theme' => $this->theme])->render(); $vdir->file_put_contents('index.html', $html); @@ -170,11 +172,18 @@ class QuizCompiler extends Base protected function copyFilesFromResources($vdir) { // Copy base files from resources - $vdir->copyDirectory(resource_path('quizv2/js'), 'js'); - $vdir->copyDirectory(resource_path('quizv2/style'), 'style'); + $resourcePath = $this->_resourcesPath(); + $vdir->copyDirectory($resourcePath . '/js', 'js'); + $vdir->copyDirectory($resourcePath . '/style', 'style'); $this->writeAnimations(); } + protected function _resourcesPath() + { + list($branch, $dir) = explode('|', $this->quiz->dev_version); + return resource_path('quiz/player/' . ($dir === 'local' ? 'local' : 'branches') . '/' . $branch); + } + protected function runWebpack($dev = false) { diff --git a/app/Elearning/QuizCompiler/Animations.php b/app/Elearning/QuizCompiler/Animations.php index 39a616794..be1b67eb8 100644 --- a/app/Elearning/QuizCompiler/Animations.php +++ b/app/Elearning/QuizCompiler/Animations.php @@ -34,7 +34,7 @@ trait Animations $animationReplace['Source Sans Pro'] = trim($font['font_family'], '"'); $animations = []; - foreach (Files::getDirectoryIterator(resource_path('quizv2/animations')) as $file) { + foreach (Files::getDirectoryIterator($this->_resourcesPath().'/animations/') as $file) { if (!$file->isFile() || $file->getExtension() !== 'json') { continue; } diff --git a/composer.json b/composer.json index 9d378f5c2..d35b259a7 100644 --- a/composer.json +++ b/composer.json @@ -52,7 +52,7 @@ "rickselby/laravel-gate-cache": "^3.6", "rodneyrehm/plist": "^2.0", "rustici-software/scormcloud-api-v2-client-php": "^2.1.0", - "simplesoftwareio/simple-qrcode": "^4.2", + "ryangjchandler/standalone-blade": "^0.2.0", "symfony/http-client": "^v6.3.0" }, "require-dev": { @@ -83,9 +83,6 @@ "classmap": [ "database/seeds", "database/factories" - ], - "files": [ - "app/helpers.php" ] }, "autoload-dev": { diff --git a/composer.lock b/composer.lock index bc8a13e54..52535b5ce 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "36298aad6903b79b720e855da3abd1b6", + "content-hash": "d8d2f6a21a78fbe888828219e4844480", "packages": [ { "name": "archtechx/enums", @@ -492,60 +492,6 @@ }, "time": "2023-02-12T09:09:37+00:00" }, - { - "name": "bacon/bacon-qr-code", - "version": "2.0.8", - "source": { - "type": "git", - "url": "https://github.com/Bacon/BaconQrCode.git", - "reference": "8674e51bb65af933a5ffaf1c308a660387c35c22" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Bacon/BaconQrCode/zipball/8674e51bb65af933a5ffaf1c308a660387c35c22", - "reference": "8674e51bb65af933a5ffaf1c308a660387c35c22", - "shasum": "" - }, - "require": { - "dasprid/enum": "^1.0.3", - "ext-iconv": "*", - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "phly/keep-a-changelog": "^2.1", - "phpunit/phpunit": "^7 | ^8 | ^9", - "spatie/phpunit-snapshot-assertions": "^4.2.9", - "squizlabs/php_codesniffer": "^3.4" - }, - "suggest": { - "ext-imagick": "to generate QR code images" - }, - "type": "library", - "autoload": { - "psr-4": { - "BaconQrCode\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-2-Clause" - ], - "authors": [ - { - "name": "Ben Scholzen 'DASPRiD'", - "email": "mail@dasprids.de", - "homepage": "https://dasprids.de/", - "role": "Developer" - } - ], - "description": "BaconQrCode is a QR code generator for PHP.", - "homepage": "https://github.com/Bacon/BaconQrCode", - "support": { - "issues": "https://github.com/Bacon/BaconQrCode/issues", - "source": "https://github.com/Bacon/BaconQrCode/tree/2.0.8" - }, - "time": "2022-12-07T17:46:57+00:00" - }, { "name": "barryvdh/laravel-debugbar", "version": "v3.8.1", @@ -1507,13 +1453,13 @@ "source": { "type": "git", "url": "git://git.cubedesigners.com/cubist_cms-back.git", - "reference": "bb86b6e8055bda05e532dd9c0c71d8abd9acdde5" + "reference": "c4817377e423fb9ce5efd5d0727dcf38d92f20b8" }, "dist": { "type": "tar", - "url": "https://composer.cubedesigners.com/dist/cubist/cms-back/cubist-cms-back-dev-backpack5-2c6aee.tar", - "reference": "bb86b6e8055bda05e532dd9c0c71d8abd9acdde5", - "shasum": "91b965a0be0d8747fed8d1f186fa362bc5ee6afe" + "url": "https://composer.cubedesigners.com/dist/cubist/cms-back/cubist-cms-back-dev-backpack5-1ba5ce.tar", + "reference": "c4817377e423fb9ce5efd5d0727dcf38d92f20b8", + "shasum": "eb9c118a1acb0182db94f621d060f431f8327c83" }, "require": { "backpack/backupmanager": "^v3.0.9", @@ -1592,7 +1538,7 @@ } ], "description": "Cubist Backpack extension", - "time": "2023-07-21T15:51:26+00:00" + "time": "2023-07-21T17:57:41+00:00" }, { "name": "cubist/cms-front", @@ -2207,56 +2153,6 @@ "abandoned": "mailerlite/laravel-elasticsearch", "time": "2023-06-12T20:55:39+00:00" }, - { - "name": "dasprid/enum", - "version": "1.0.4", - "source": { - "type": "git", - "url": "https://github.com/DASPRiD/Enum.git", - "reference": "8e6b6ea76eabbf19ea2bf5b67b98e1860474012f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/DASPRiD/Enum/zipball/8e6b6ea76eabbf19ea2bf5b67b98e1860474012f", - "reference": "8e6b6ea76eabbf19ea2bf5b67b98e1860474012f", - "shasum": "" - }, - "require": { - "php": ">=7.1 <9.0" - }, - "require-dev": { - "phpunit/phpunit": "^7 | ^8 | ^9", - "squizlabs/php_codesniffer": "*" - }, - "type": "library", - "autoload": { - "psr-4": { - "DASPRiD\\Enum\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-2-Clause" - ], - "authors": [ - { - "name": "Ben Scholzen 'DASPRiD'", - "email": "mail@dasprids.de", - "homepage": "https://dasprids.de/", - "role": "Developer" - } - ], - "description": "PHP 7.1 enum implementation", - "keywords": [ - "enum", - "map" - ], - "support": { - "issues": "https://github.com/DASPRiD/Enum/issues", - "source": "https://github.com/DASPRiD/Enum/tree/1.0.4" - }, - "time": "2023-03-01T18:44:03+00:00" - }, { "name": "dflydev/dot-access-data", "version": "v3.0.2", @@ -2546,16 +2442,16 @@ }, { "name": "doctrine/dbal", - "version": "3.6.4", + "version": "3.6.5", "source": { "type": "git", "url": "https://github.com/doctrine/dbal.git", - "reference": "19f0dec95edd6a3c3c5ff1d188ea94c6b7fc903f" + "reference": "96d5a70fd91efdcec81fc46316efc5bf3da17ddf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/dbal/zipball/19f0dec95edd6a3c3c5ff1d188ea94c6b7fc903f", - "reference": "19f0dec95edd6a3c3c5ff1d188ea94c6b7fc903f", + "url": "https://api.github.com/repos/doctrine/dbal/zipball/96d5a70fd91efdcec81fc46316efc5bf3da17ddf", + "reference": "96d5a70fd91efdcec81fc46316efc5bf3da17ddf", "shasum": "" }, "require": { @@ -2570,10 +2466,10 @@ "require-dev": { "doctrine/coding-standard": "12.0.0", "fig/log-test": "^1", - "jetbrains/phpstorm-stubs": "2022.3", - "phpstan/phpstan": "1.10.14", + "jetbrains/phpstorm-stubs": "2023.1", + "phpstan/phpstan": "1.10.21", "phpstan/phpstan-strict-rules": "^1.5", - "phpunit/phpunit": "9.6.7", + "phpunit/phpunit": "9.6.9", "psalm/plugin-phpunit": "0.18.4", "squizlabs/php_codesniffer": "3.7.2", "symfony/cache": "^5.4|^6.0", @@ -2638,7 +2534,7 @@ ], "support": { "issues": "https://github.com/doctrine/dbal/issues", - "source": "https://github.com/doctrine/dbal/tree/3.6.4" + "source": "https://github.com/doctrine/dbal/tree/3.6.5" }, "funding": [ { @@ -2654,7 +2550,7 @@ "type": "tidelift" } ], - "time": "2023-06-15T07:40:12+00:00" + "time": "2023-07-17T09:15:50+00:00" }, { "name": "doctrine/deprecations", @@ -8874,46 +8770,34 @@ "time": "2022-09-27T16:11:03+00:00" }, { - "name": "simplesoftwareio/simple-qrcode", - "version": "4.2.0", + "name": "ryangjchandler/standalone-blade", + "version": "v0.2.0", "source": { "type": "git", - "url": "https://github.com/SimpleSoftwareIO/simple-qrcode.git", - "reference": "916db7948ca6772d54bb617259c768c9cdc8d537" + "url": "https://github.com/ryangjchandler/standalone-blade.git", + "reference": "a146e1b82461c942aec7486df7a0bf7ad62f8078" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/SimpleSoftwareIO/simple-qrcode/zipball/916db7948ca6772d54bb617259c768c9cdc8d537", - "reference": "916db7948ca6772d54bb617259c768c9cdc8d537", + "url": "https://api.github.com/repos/ryangjchandler/standalone-blade/zipball/a146e1b82461c942aec7486df7a0bf7ad62f8078", + "reference": "a146e1b82461c942aec7486df7a0bf7ad62f8078", "shasum": "" }, "require": { - "bacon/bacon-qr-code": "^2.0", - "ext-gd": "*", - "php": ">=7.2|^8.0" + "illuminate/config": "^10.0", + "illuminate/support": "^10.0", + "illuminate/view": "^10.0", + "php": "^8.1" }, "require-dev": { - "mockery/mockery": "~1", - "phpunit/phpunit": "~9" - }, - "suggest": { - "ext-imagick": "Allows the generation of PNG QrCodes.", - "illuminate/support": "Allows for use within Laravel." + "friendsofphp/php-cs-fixer": "^3.0", + "pestphp/pest": "^1.20", + "spatie/ray": "^1.28" }, "type": "library", - "extra": { - "laravel": { - "providers": [ - "SimpleSoftwareIO\\QrCode\\QrCodeServiceProvider" - ], - "aliases": { - "QrCode": "SimpleSoftwareIO\\QrCode\\Facades\\QrCode" - } - } - }, "autoload": { "psr-4": { - "SimpleSoftwareIO\\QrCode\\": "src" + "RyanChandler\\Blade\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -8922,24 +8806,28 @@ ], "authors": [ { - "name": "Simple Software LLC", - "email": "support@simplesoftware.io" + "name": "Ryan Chandler", + "email": "support@ryangjchandler.co.uk", + "role": "Developer" } ], - "description": "Simple QrCode is a QR code generator made for Laravel.", - "homepage": "https://www.simplesoftware.io/#/docs/simple-qrcode", + "description": "Use Laravel's Blade templating engine outside of Laravel.", + "homepage": "https://github.com/ryangjchandler/standalone-blade", "keywords": [ - "Simple", - "generator", - "laravel", - "qrcode", - "wrapper" + "ryangjchandler", + "standalone-blade" ], "support": { - "issues": "https://github.com/SimpleSoftwareIO/simple-qrcode/issues", - "source": "https://github.com/SimpleSoftwareIO/simple-qrcode/tree/4.2.0" + "issues": "https://github.com/ryangjchandler/standalone-blade/issues", + "source": "https://github.com/ryangjchandler/standalone-blade/tree/v0.2.0" }, - "time": "2021-02-08T20:43:55+00:00" + "funding": [ + { + "url": "https://github.com/ryangjchandler", + "type": "github" + } + ], + "time": "2023-02-24T15:16:34+00:00" }, { "name": "spatie/db-dumper", @@ -9006,16 +8894,16 @@ }, { "name": "spatie/image", - "version": "2.2.6", + "version": "2.2.7", "source": { "type": "git", "url": "https://github.com/spatie/image.git", - "reference": "f72ca52acd77ca03b7843a0f86e2411ce90aecfc" + "reference": "2f802853aab017aa615224daae1588054b5ab20e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/image/zipball/f72ca52acd77ca03b7843a0f86e2411ce90aecfc", - "reference": "f72ca52acd77ca03b7843a0f86e2411ce90aecfc", + "url": "https://api.github.com/repos/spatie/image/zipball/2f802853aab017aa615224daae1588054b5ab20e", + "reference": "2f802853aab017aa615224daae1588054b5ab20e", "shasum": "" }, "require": { @@ -9024,7 +8912,7 @@ "ext-mbstring": "*", "league/glide": "^2.2.2", "php": "^8.0", - "spatie/image-optimizer": "^1.1", + "spatie/image-optimizer": "^1.7", "spatie/temporary-directory": "^1.0|^2.0", "symfony/process": "^3.0|^4.0|^5.0|^6.0" }, @@ -9059,7 +8947,7 @@ "spatie" ], "support": { - "source": "https://github.com/spatie/image/tree/2.2.6" + "source": "https://github.com/spatie/image/tree/2.2.7" }, "funding": [ { @@ -9071,20 +8959,20 @@ "type": "github" } ], - "time": "2023-05-06T10:20:33+00:00" + "time": "2023-07-24T13:54:13+00:00" }, { "name": "spatie/image-optimizer", - "version": "1.6.4", + "version": "1.7.0", "source": { "type": "git", "url": "https://github.com/spatie/image-optimizer.git", - "reference": "d997e01ba980b2769ddca2f00badd3b80c2a2512" + "reference": "9551e2df936656bda3567901a033579345d52e88" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/image-optimizer/zipball/d997e01ba980b2769ddca2f00badd3b80c2a2512", - "reference": "d997e01ba980b2769ddca2f00badd3b80c2a2512", + "url": "https://api.github.com/repos/spatie/image-optimizer/zipball/9551e2df936656bda3567901a033579345d52e88", + "reference": "9551e2df936656bda3567901a033579345d52e88", "shasum": "" }, "require": { @@ -9124,9 +9012,9 @@ ], "support": { "issues": "https://github.com/spatie/image-optimizer/issues", - "source": "https://github.com/spatie/image-optimizer/tree/1.6.4" + "source": "https://github.com/spatie/image-optimizer/tree/1.7.0" }, - "time": "2023-03-10T08:43:19+00:00" + "time": "2023-07-22T16:28:37+00:00" }, { "name": "spatie/laravel-backup", @@ -9373,16 +9261,16 @@ }, { "name": "spatie/laravel-medialibrary", - "version": "10.10.1", + "version": "10.11.0", "source": { "type": "git", "url": "https://github.com/spatie/laravel-medialibrary.git", - "reference": "84f7bb253bc7b9498ff2cd0d74f82e88d299c517" + "reference": "83e902ed0d4204a217e19e7a764b33236c1d4526" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/laravel-medialibrary/zipball/84f7bb253bc7b9498ff2cd0d74f82e88d299c517", - "reference": "84f7bb253bc7b9498ff2cd0d74f82e88d299c517", + "url": "https://api.github.com/repos/spatie/laravel-medialibrary/zipball/83e902ed0d4204a217e19e7a764b33236c1d4526", + "reference": "83e902ed0d4204a217e19e7a764b33236c1d4526", "shasum": "" }, "require": { @@ -9398,7 +9286,7 @@ "intervention/image": "^2.7", "maennchen/zipstream-php": "^2.0|^3.0", "php": "^8.0", - "spatie/image": "^2.2.2", + "spatie/image": "^2.2.7", "spatie/temporary-directory": "^2.0", "symfony/console": "^6.0" }, @@ -9466,7 +9354,7 @@ ], "support": { "issues": "https://github.com/spatie/laravel-medialibrary/issues", - "source": "https://github.com/spatie/laravel-medialibrary/tree/10.10.1" + "source": "https://github.com/spatie/laravel-medialibrary/tree/10.11.0" }, "funding": [ { @@ -9478,7 +9366,7 @@ "type": "github" } ], - "time": "2023-06-29T07:18:20+00:00" + "time": "2023-07-24T13:59:14+00:00" }, { "name": "spatie/laravel-package-tools", @@ -10076,16 +9964,16 @@ }, { "name": "swayok/alternative-laravel-cache", - "version": "6.1.11", + "version": "6.1.12", "source": { "type": "git", "url": "https://github.com/swayok/alternative-laravel-cache.git", - "reference": "ad4b02e2cce48c4eea9d9bd5fb298904c2fd60e8" + "reference": "cca5d418bbd2b8180e80bf7bafd4fce881d2c386" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/swayok/alternative-laravel-cache/zipball/ad4b02e2cce48c4eea9d9bd5fb298904c2fd60e8", - "reference": "ad4b02e2cce48c4eea9d9bd5fb298904c2fd60e8", + "url": "https://api.github.com/repos/swayok/alternative-laravel-cache/zipball/cca5d418bbd2b8180e80bf7bafd4fce881d2c386", + "reference": "cca5d418bbd2b8180e80bf7bafd4fce881d2c386", "shasum": "" }, "require": { @@ -10140,9 +10028,9 @@ ], "support": { "issues": "https://github.com/swayok/alternative-laravel-cache/issues", - "source": "https://github.com/swayok/alternative-laravel-cache/tree/6.1.11" + "source": "https://github.com/swayok/alternative-laravel-cache/tree/6.1.12" }, - "time": "2023-05-08T13:23:39+00:00" + "time": "2023-07-24T06:34:07+00:00" }, { "name": "symfony/cache", @@ -15035,16 +14923,16 @@ }, { "name": "phpstan/phpdoc-parser", - "version": "1.22.1", + "version": "1.23.0", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "65c39594fbd8c67abfc68bb323f86447bab79cc0" + "reference": "a2b24135c35852b348894320d47b3902a94bc494" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/65c39594fbd8c67abfc68bb323f86447bab79cc0", - "reference": "65c39594fbd8c67abfc68bb323f86447bab79cc0", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/a2b24135c35852b348894320d47b3902a94bc494", + "reference": "a2b24135c35852b348894320d47b3902a94bc494", "shasum": "" }, "require": { @@ -15076,9 +14964,9 @@ "description": "PHPDoc parser with support for nullable, intersection and generic types", "support": { "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/1.22.1" + "source": "https://github.com/phpstan/phpdoc-parser/tree/1.23.0" }, - "time": "2023-06-29T20:46:06+00:00" + "time": "2023-07-23T22:17:56+00:00" }, { "name": "phpunit/php-code-coverage", @@ -16928,5 +16816,5 @@ "ext-zlib": "*" }, "platform-dev": [], - "plugin-api-version": "2.1.0" + "plugin-api-version": "2.3.0" }