Skip to content

Commit

Permalink
Removed internal check on rubref.php file
Browse files Browse the repository at this point in the history
See #30
Credit to Kevin Hipwell
  • Loading branch information
marcusgreen committed Oct 13, 2024
1 parent a7b9195 commit 73e0b22
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 27 deletions.
47 changes: 25 additions & 22 deletions .github/workflows/moodle-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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() }}
Expand Down Expand Up @@ -99,14 +98,18 @@ jobs:
if: ${{ always() }}
run: moodle-plugin-ci savepoints

- name: Grunt
- name: Mustache Lint
if: ${{ always() }}
run: moodle-plugin-ci grunt --max-lint-warnings 0
run: moodle-plugin-ci mustache

- name: Grunt
if: ${{ matrix.moodle-branch == 'master' }}
run: moodle-plugin-ci grunt

- name: PHPUnit tests
if: ${{ always() }}
run: moodle-plugin-ci phpunit

- name: Behat features
if: ${{ always() }}
run: moodle-plugin-ci behat --profile chrome
run: moodle-plugin-ci behat --profile chrome
2 changes: 1 addition & 1 deletion classes/rubref.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion classes/rubric.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 1 addition & 3 deletions rubref.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit 73e0b22

Please sign in to comment.