Skip to content

Commit

Permalink
Merge pull request #36 from wiris/v4.5
Browse files Browse the repository at this point in the history
V4.5
  • Loading branch information
ptorrent-at-wiris authored Jun 15, 2022
2 parents a35e185 + 5c079c9 commit 01d747a
Show file tree
Hide file tree
Showing 9 changed files with 76 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Moodle Plugin CI

on: [push, pull_request]
on: [push, pull_request, workflow_dispatch]

jobs:
test:
Expand Down
66 changes: 66 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
#
# Whenever a new tag starting with "v" is pushed, add the tagged version
# to the Moodle Plugins directory at https://moodle.org/plugins
#
# revision: 2021070201
#
name: Releasing in the Plugins directory

on:
push:
tags:
- v*

workflow_dispatch:
inputs:
tag:
description: 'Tag to be released'
required: true

defaults:
run:
shell: bash

jobs:
release-at-moodle-org:
runs-on: ubuntu-latest
env:
PLUGIN: qtype_essaywiris
CURL: curl -s
ENDPOINT: https://moodle.org/webservice/rest/server.php
TOKEN: ${{ secrets.MOODLE_ORG_TOKEN }}
FUNCTION: local_plugins_add_version

steps:
- name: Call the service function
id: add-version
run: |
if [[ ! -z "${{ github.event.inputs.tag }}" ]]; then
TAGNAME="${{ github.event.inputs.tag }}"
elif [[ $GITHUB_REF = refs/tags/* ]]; then
TAGNAME="${GITHUB_REF##*/}"
fi
if [[ -z "${TAGNAME}" ]]; then
echo "No tag name has been provided!"
exit 1
fi
ZIPURL="https://api.github.com/repos/${{ github.repository }}/zipball/${TAGNAME}"
RESPONSE=$(${CURL} ${ENDPOINT} --data-urlencode "wstoken=${TOKEN}" \
--data-urlencode "wsfunction=${FUNCTION}" \
--data-urlencode "moodlewsrestformat=json" \
--data-urlencode "frankenstyle=${PLUGIN}" \
--data-urlencode "zipurl=${ZIPURL}" \
--data-urlencode "vcssystem=git" \
--data-urlencode "vcsrepositoryurl=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}" \
--data-urlencode "vcstag=${TAGNAME}" \
--data-urlencode "changelogurl=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/commits/${TAGNAME}" \
--data-urlencode "altdownloadurl=${ZIPURL}")
echo "::set-output name=response::${RESPONSE}"
- name: Evaluate the response
id: evaluate-response
env:
RESPONSE: ${{ steps.add-version.outputs.response }}
run: |
jq <<< ${RESPONSE}
jq --exit-status ".id" <<< ${RESPONSE} > /dev/null
3 changes: 0 additions & 3 deletions backup/moodle2/backup_qtype_essaywiris_plugin.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

defined('MOODLE_INTERNAL') || die();


/**
* Provides the information to backup essay questions
*
Expand Down
3 changes: 0 additions & 3 deletions backup/moodle2/restore_qtype_essaywiris_plugin.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

defined('MOODLE_INTERNAL') || die();


/**
* restore plugin class that provides the necessary information
* needed to restore one essay qtype plugin
Expand Down
8 changes: 2 additions & 6 deletions classes/privacy/provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,8 @@

namespace qtype_essaywiris\privacy;

defined('MOODLE_INTERNAL') || die();

class provider implements
// This plugin does not store any personal user data.
\core_privacy\local\metadata\null_provider
{
// This plugin does not store any personal user data.
class provider implements \core_privacy\local\metadata\null_provider {
use \core_privacy\local\legacy_polyfill;

/**
Expand Down
2 changes: 1 addition & 1 deletion renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
require_once($CFG->dirroot . '/question/type/essay/renderer.php');


class qtype_essaywiris_renderer extends qtype_wq_renderer {
class qtype_essaywiris_renderer extends qtype_wq_renderer {
public function __construct(moodle_page $page, $target) {
parent::__construct(new qtype_essay_renderer($page, $target), $page, $target);
}
Expand Down
3 changes: 2 additions & 1 deletion tests/behat/auxiliar_text.feature
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ Feature: A teacher can add and preview an auxiliar text field in a Science Essay
And I open Wiris Quizzes Studio
And I click on "Input options" "text"
And I click on "Display auxiliary text field" "text"
And I click on "//*[@id='wrsUI_quizzesStudioHomeSaveButton']" "xpath_element"
And I go back in Wiris Quizzes Studio
And I save Wiris Quizzes Studio
And I click on "//input[@name='submitbutton']" "xpath_element"
And I click on "Preview question" "link"
And I switch to "questionpreview" window
Expand Down
10 changes: 0 additions & 10 deletions tests/helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/


defined('MOODLE_INTERNAL') || die();


/**
* Test helper class for the Wiris Essay question type.
*
* @copyright 2013 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class qtype_essaywiris_test_helper extends question_test_helper {
public function get_test_questions() {
return array('scienceessay');
Expand Down
8 changes: 4 additions & 4 deletions version.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@

defined('MOODLE_INTERNAL') || die();

$plugin->version = 2022040800;
$plugin->release = '4.4.3';
$plugin->requires = 2011060313;
$plugin->version = 2022061500;
$plugin->requires = 2015111600; // Moodle 3.0.
$plugin->release = '4.5.0';
$plugin->maturity = MATURITY_STABLE;
$plugin->component = 'qtype_essaywiris';
$plugin->dependencies = array (
'qtype_wq' => 2022040800
'qtype_wq' => 2022061500
);

0 comments on commit 01d747a

Please sign in to comment.