From 94fe66350d17d25bf689a50e17e605fd5da3a77e Mon Sep 17 00:00:00 2001 From: Marcus Green Date: Sun, 13 Oct 2024 17:06:31 +0100 Subject: [PATCH] Removed internal check on rubref.php file See https://github.com/marcusgreen/moodle-report_advancedgrading/issues/30 Credit to Kevin Hipwell --- .github/workflows/moodle-ci.yml | 43 ++++++++++++++++----------------- changelog.md | 5 ++++ classes/rubref.php | 2 +- classes/rubric.php | 2 +- rubref.php | 4 +-- 5 files changed, 29 insertions(+), 27 deletions(-) diff --git a/.github/workflows/moodle-ci.yml b/.github/workflows/moodle-ci.yml index 6cfc22d..9375dee 100644 --- a/.github/workflows/moodle-ci.yml +++ b/.github/workflows/moodle-ci.yml @@ -30,44 +30,43 @@ jobs: fail-fast: false matrix: include: - - php: '8.2' - moodle-branch: 'MOODLE_404_STABLE' - database: 'mariadb' + # - php: '8.2' + # moodle-branch: 'MOODLE_402_STABLE' + # database: 'mariadb' + - php: '8.3' + moodle-branch: 'MOODLE_405_STABLE' + database: 'pgsql' steps: - - name: Check out repository code - uses: actions/checkout@v2 + - name: Checkout + uses: actions/checkout@v3 with: path: plugin - - name: Setup PHP ${{ matrix.php }} + - name: Setup PHP uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} extensions: ${{ matrix.extensions }} ini-values: max_input_vars=5000 + # none to use phpdbg fallback. Specify pcov (Moodle 3.10 and up) or xdebug to use them instead. coverage: none - - name: Install NVM and Node - run: | - curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash - export NVM_DIR="$HOME/.nvm" - [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" - nvm install 20 - nvm use 20 - - name: Initialise moodle-plugin-ci + + - name: Deploy moodle-plugin-ci run: | composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci ^3 + # Add dirs to $PATH echo $(cd ci/bin; pwd) >> $GITHUB_PATH echo $(cd ci/vendor/bin; pwd) >> $GITHUB_PATH + # PHPUnit depends on en_AU.UTF-8 locale sudo locale-gen en_AU.UTF-8 - echo "NVM_DIR=$HOME/.nvm" >> $GITHUB_ENV - - name: Install moodle-plugin-ci - run: | - moodle-plugin-ci add-plugin --branch MOODLE_402_STABLE catalyst/moodle-gradingform_rubric_ranges - moodle-plugin-ci install --plugin ./plugin --db-host=127.0.0.1 + - name: Install Moodle + # Need explicit IP to stop mysql client fail on attempt to use unix socket. + run: moodle-plugin-ci install --plugin ./plugin --db-host=127.0.0.1 env: DB: ${{ matrix.database }} MOODLE_BRANCH: ${{ matrix.moodle-branch }} + IGNORE_PATHS: 'templates/local/mobile' - name: PHP Lint if: ${{ always() }} @@ -100,8 +99,8 @@ jobs: run: moodle-plugin-ci savepoints - name: Grunt - if: ${{ always() }} - run: moodle-plugin-ci grunt --max-lint-warnings 0 + if: ${{ matrix.moodle-branch == 'master' }} + run: moodle-plugin-ci grunt - name: PHPUnit tests if: ${{ always() }} @@ -109,4 +108,4 @@ jobs: - name: Behat features if: ${{ always() }} - run: moodle-plugin-ci behat --profile chrome + run: moodle-plugin-ci behat --profile chrome \ No newline at end of file diff --git a/changelog.md b/changelog.md index a5e16ef..c9fe56f 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,8 @@ +### Version 1.01 Oct 2024 +Confirmed compatibility with Moodle 4.5 and PHP 8.3 +Thanks to Kevin Hipwell and Enovation for contribution to rubref (rubric refined also known as rubric flex) +https://github.com/marcusgreen/moodle-report_advancedgrading/issues/30 + ### Version 1.0 May 2024 Added behat test compatibility to work with Moodle 4.4. Thanks to Monash university Australia and thanks to Dmitrii Metelkin of diff --git a/classes/rubref.php b/classes/rubref.php index 13b1ab1..b88c31e 100644 --- a/classes/rubref.php +++ b/classes/rubref.php @@ -73,7 +73,7 @@ public function get_rows(array $data): string { * @param \cm_info $cm * @return array */ - public function get_data(\assign $assign, \cm_info $cm) : array { + public function get_data(\assign $assign, \cm_info $cm): array { global $DB; $sql = "SELECT grf.id as grfid, cm.course, asg.name as assignment,asg.grade as gradeoutof, diff --git a/classes/rubric.php b/classes/rubric.php index 4b07655..193bf63 100644 --- a/classes/rubric.php +++ b/classes/rubric.php @@ -73,7 +73,7 @@ public function get_rows(array $data): string { * @param \cm_info $cm * @return array */ - public function get_data(\assign $assign, \cm_info $cm) : array { + public function get_data(\assign $assign, \cm_info $cm): array { global $DB; $sql = "SELECT grf.id as grfid, cm.course, asg.name as assignment,asg.grade as gradeoutof, diff --git a/rubref.php b/rubref.php index a8b29f9..00fc4cc 100644 --- a/rubref.php +++ b/rubref.php @@ -18,12 +18,10 @@ * Exports an Excel spreadsheet of the grades in a rubref-graded assignment. * * @package report_advancedgrading - * @copyright 2022 Marcus Green + * @copyright 2024 Marcus Green * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ - defined('MOODLE_INTERNAL') || die(); - require(__DIR__ . '../../../config.php'); require_once(__DIR__ . '/../../report/advancedgrading/locallib.php'); require_once(__DIR__ . '/../../lib/excellib.class.php');