Skip to content

Commit

Permalink
Merge pull request #65 from KQMATH/release/1.0.1
Browse files Browse the repository at this point in the history
Release/1.0.1
  • Loading branch information
hgeorgsch committed Feb 5, 2021
2 parents aa4899a + e401f94 commit 42cb07b
Show file tree
Hide file tree
Showing 10 changed files with 207 additions and 139 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Wiki sync

on: [gollum]

jobs:
copycat:
name: Copycat
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Copycat KQMATH
uses: andstor/[email protected]
env:
DST_BRANCH: master
DST_OWNER: KQMATH
DST_REPO_NAME: kqmath.github.io
DST_PATH: /docs/jazzquiz/
GH_PAT: ${{ secrets.GH_PAT }}
SRC_BRANCH: master
SRC_PATH: /.
SRC_WIKI: "true"
USERNAME: nutsbot
EMAIL: [email protected]
104 changes: 104 additions & 0 deletions .github/workflows/moodle-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
name: build

on: [push, pull_request]

jobs:
test:
runs-on: ubuntu-18.04

services:
postgres:
image: postgres:9.6
env:
POSTGRES_USER: 'postgres'
POSTGRES_HOST_AUTH_METHOD: 'trust'
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 3
mariadb:
image: mariadb:10
env:
MYSQL_USER: 'root'
MYSQL_ALLOW_EMPTY_PASSWORD: "true"
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval 10s --health-timeout 5s --health-retries 3

strategy:
fail-fast: false
matrix:
php: ['7.2', '7.3', '7.4']
moodle-branch: ['MOODLE_310_STABLE', 'MOODLE_39_STABLE']
database: [pgsql, mariadb]

steps:
- name: Check out repository code
uses: actions/checkout@v2
with:
path: plugin

- name: Setup PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none

- name: Initialise moodle-plugin-ci
run: |
composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci ^3
echo $(cd ci/bin; pwd) >> $GITHUB_PATH
echo $(cd ci/vendor/bin; pwd) >> $GITHUB_PATH
sudo locale-gen en_AU.UTF-8
- name: Install moodle-plugin-ci
run: |
moodle-plugin-ci install --plugin ./plugin --db-host=127.0.0.1
env:
DB: ${{ matrix.database }}
MOODLE_BRANCH: ${{ matrix.moodle-branch }}

- name: PHP Lint
if: ${{ always() }}
run: moodle-plugin-ci phplint

- name: PHP Copy/Paste Detector
continue-on-error: true # This step will show errors but will not fail
if: ${{ always() }}
run: moodle-plugin-ci phpcpd

- name: PHP Mess Detector
continue-on-error: true # This step will show errors but will not fail
if: ${{ always() }}
run: moodle-plugin-ci phpmd

- name: Moodle Code Checker
if: ${{ always() }}
run: moodle-plugin-ci codechecker --max-warnings 0

- name: Moodle PHPDoc Checker
if: ${{ always() }}
run: moodle-plugin-ci phpdoc

- name: Validating
if: ${{ always() }}
run: moodle-plugin-ci validate

- name: Check upgrade savepoints
if: ${{ always() }}
run: moodle-plugin-ci savepoints

- name: Mustache Lint
if: ${{ always() }}
run: moodle-plugin-ci mustache

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

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

- name: Behat features
if: ${{ always() }}
run: moodle-plugin-ci behat --profile chrome
128 changes: 27 additions & 101 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,125 +1,51 @@
language: php

sudo: true

addons:
firefox: "47.0.1"
postgresql: "9.4"
apt:
packages:
- openjdk-8-jre-headless
postgresql: "9.5"

services:
- mysql
- postgresql
- docker

cache:
directories:
- $HOME/.composer/cache
- $HOME/.npm

php:
- 7.0
- 7.1
- 7.2
- 7.2
- 7.3
- 7.4

env:
fast_finish: true
matrix:
# Moodle 3.1 needs "moodle-plugin-ci ci ^1"
#- DB=pgsql MOODLE_BRANCH=MOODLE_31_STABLE
#- DB=mysqli MOODLE_BRANCH=MOODLE_31_STABLE

- DB=pgsql MOODLE_BRANCH=MOODLE_32_STABLE
- DB=mysqli MOODLE_BRANCH=MOODLE_32_STABLE

- DB=pgsql MOODLE_BRANCH=MOODLE_33_STABLE
- DB=mysqli MOODLE_BRANCH=MOODLE_33_STABLE

- DB=pgsql MOODLE_BRANCH=MOODLE_34_STABLE
- DB=mysqli MOODLE_BRANCH=MOODLE_34_STABLE

- DB=pgsql MOODLE_BRANCH=MOODLE_35_STABLE
- DB=mysqli MOODLE_BRANCH=MOODLE_35_STABLE

- DB=pgsql MOODLE_BRANCH=MOODLE_36_STABLE
- DB=mysqli MOODLE_BRANCH=MOODLE_36_STABLE

- DB=pgsql MOODLE_BRANCH=master
- DB=mysqli MOODLE_BRANCH=master

allow_failures:
- DB=pgsql MOODLE_BRANCH=master
- DB=mysqli MOODLE_BRANCH=master
global:
- MOODLE_BRANCH=MOODLE_39_STABLE
matrix:
- DB=pgsql
- DB=mysqli

before_install:
- phpenv config-rm xdebug.ini
- nvm install 8.9
- nvm use 8.9
- cd ../..
- composer create-project -n --no-dev --prefer-dist blackboard-open-source/moodle-plugin-ci ci ^2
- composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci ^3
- export PATH="$(cd ci/bin; pwd):$(cd ci/vendor/bin; pwd):$PATH"

jobs:
include:
# Prechecks against latest Moodle stable only. Testing against PHP 7.0, 7.1 and 7.2.
# pgsql
- stage: develop
php: 7.0
env: DB=pgsql MOODLE_BRANCH=MOODLE_36_STABLE
install:
- moodle-plugin-ci install
script:
- bash $TRAVIS_BUILD_DIR/.travis/script.sh

- stage: develop
php: 7.1
env: DB=pgsql MOODLE_BRANCH=MOODLE_36_STABLE
install:
- moodle-plugin-ci install
script:
- bash $TRAVIS_BUILD_DIR/.travis/script.sh

- stage: develop
php: 7.2
env: DB=pgsql MOODLE_BRANCH=MOODLE_36_STABLE
install:
- moodle-plugin-ci install
script:
- bash $TRAVIS_BUILD_DIR/.travis/script.sh

# mysql
- stage: develop
php: 7.0
env: DB=mysqli MOODLE_BRANCH=MOODLE_36_STABLE
install:
- moodle-plugin-ci install
script:
- bash $TRAVIS_BUILD_DIR/.travis/script.sh

- stage: develop
php: 7.1
env: DB=mysqli MOODLE_BRANCH=MOODLE_36_STABLE
install:
- moodle-plugin-ci install
script:
- bash $TRAVIS_BUILD_DIR/.travis/script.sh

- stage: develop
php: 7.2
env: DB=mysqli MOODLE_BRANCH=MOODLE_36_STABLE
install:
- moodle-plugin-ci install
script:
- bash $TRAVIS_BUILD_DIR/.travis/script.sh

# Default 'test' stage: All tests against full matrix.
install:
- moodle-plugin-ci install

script:
- bash $TRAVIS_BUILD_DIR/.travis/script.sh
- moodle-plugin-ci phplint
- moodle-plugin-ci phpcpd
- moodle-plugin-ci phpmd
- moodle-plugin-ci codechecker
- moodle-plugin-ci validate
- moodle-plugin-ci savepoints
- moodle-plugin-ci mustache
- moodle-plugin-ci grunt
- moodle-plugin-ci phpdoc
- moodle-plugin-ci phpunit --coverage-clover
- moodle-plugin-ci behat

after_success:
- moodle-plugin-ci coveralls-upload

stages:
- name: develop
if: branch != master
- name: test
if: branch = master
16 changes: 0 additions & 16 deletions .travis/script.sh

This file was deleted.

26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org).

## [Unreleased]
### Changed
-

## [1.0.1] - 2021-02-05

- Tested and approved for Moodle 3.9 and 3.10

### Changed

- Continuous integration with github workflows
- Minor fixes to comply with moodle style requirements

## [1.0.0] - 2019-07-30

First version considered ready for field trial.

[Unreleased]: https://github.com/KQMATH/moodle-mod_jazzquiz/compare/v1.0.1...HEAD
[1.0.1]: https://github.com/KQMATH/moodle-qtype_mod_jazzquiz/compare/v1.0.0...v1.0.1
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# JazzQuiz

![Build Status](https://github.com/KQMATH/moodle-mod_jazzquiz/workflows/build/badge.svg?branch=master)
[![Coverage Status](https://coveralls.io/repos/github/KQMATH/moodle-mod_jazzquiz/badge.svg?branch=master)](https://coveralls.io/github/KQMATH/moodle-mod_jazzquiz?branch=master)

Moodle activity module, letting the teacher run a preplanned quiz with the power of improvisation

## What is it?
JazzQuiz is designed to be used in face-to-face lessons.
The teacher may plan questions in advance, but can also easily improvise on the fly.
Expand Down
21 changes: 14 additions & 7 deletions backup/moodle2/restore_jazzquiz_stepslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,21 @@ protected function define_structure() {
$userinfo = $this->get_setting_value('userinfo');
$paths = [];
$paths[] = new restore_path_element('jazzquiz', '/activity/jazzquiz');
$paths[] = new restore_path_element('jazzquiz_question', '/activity/jazzquiz/questions/question');
$paths[] = new restore_path_element('jazzquiz_question',
'/activity/jazzquiz/questions/question');
if ($userinfo) {
$paths[] = new restore_path_element('jazzquiz_session', '/activity/jazzquiz/sessions/session');
$paths[] = new restore_path_element('jazzquiz_session_question', '/activity/jazzquiz/sessions/session/sessionquestions/sessionquestion');
$paths[] = new restore_path_element('jazzquiz_merge', '/activity/jazzquiz/sessions/session/merges/merge');
$paths[] = new restore_path_element('jazzquiz_vote', '/activity/jazzquiz/sessions/session/votes/vote');
$paths[] = new restore_path_element('jazzquiz_attendance', '/activity/jazzquiz/sessions/session/attendances/attendance');
$attempt = new restore_path_element('jazzquiz_attempt', '/activity/jazzquiz/sessions/session/attempts/attempt');
$paths[] = new restore_path_element('jazzquiz_session',
'/activity/jazzquiz/sessions/session');
$paths[] = new restore_path_element('jazzquiz_session_question',
'/activity/jazzquiz/sessions/session/sessionquestions/sessionquestion');
$paths[] = new restore_path_element('jazzquiz_merge',
'/activity/jazzquiz/sessions/session/merges/merge');
$paths[] = new restore_path_element('jazzquiz_vote',
'/activity/jazzquiz/sessions/session/votes/vote');
$paths[] = new restore_path_element('jazzquiz_attendance',
'/activity/jazzquiz/sessions/session/attendances/attendance');
$attempt = new restore_path_element('jazzquiz_attempt',
'/activity/jazzquiz/sessions/session/attempts/attempt');
$paths[] = $attempt;
$this->add_question_usages($attempt, $paths);
}
Expand Down
Loading

0 comments on commit 42cb07b

Please sign in to comment.