Fix linter issues. Prepare version 1.19

This commit is contained in:
Jane Adelmann 2018-11-01 18:50:10 +02:00
parent 64b3c4e64e
commit 325aa87fa8
No known key found for this signature in database
GPG Key ID: 4CCF39DF30B8AF72
21 changed files with 109 additions and 35 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
.idea

50
.travis.yml Normal file
View File

@ -0,0 +1,50 @@
language: php
sudo: true
addons:
firefox: "47.0.1"
postgresql: "9.4"
apt:
packages:
- oracle-java8-installer
- oracle-java8-set-default
cache:
directories:
- $HOME/.composer/cache
- $HOME/.npm
php:
- 7.0
- 7.1
env:
global:
- MOODLE_BRANCH=MOODLE_35_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
- export PATH="$(cd ci/bin; pwd):$(cd ci/vendor/bin; pwd):$PATH"
install:
- moodle-plugin-ci install
script:
- 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 phpunit
- moodle-plugin-ci behat

View File

@ -1 +0,0 @@
define(["jquery"],function(a){return{checkReport:function(){window.console.log("loaded",a)}}});

View File

@ -1,5 +1,6 @@
<?php
class ApiProvider
{

View File

@ -1,5 +1,6 @@
<?php
class UrlGenerator
{
public function getCheckUrl($cmid, $fileid)

View File

@ -1,4 +1,5 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify

View File

@ -1,3 +1,4 @@
<?php
$observers = array();

View File

@ -1,4 +1,5 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify

View File

@ -1,8 +1,9 @@
<?php
class plagiarism_setup_form extends moodleform {
/// Define the form
// Define the form
function definition () {
global $CFG;

View File

@ -1,11 +1,11 @@
<?php
//moodleform is defined in formslib.php
// moodleform is defined in formslib.php
require_once("$CFG->libdir/formslib.php");
class send_text_form extends moodleform
{
//Add elements to form
// Add elements to form
public function definition()
{
global $CFG;
@ -21,9 +21,9 @@ class send_text_form extends moodleform
}
//Custom validation should be added here
// Custom validation should be added here
function validation($data, $files)
{
return array();
}
}
}

View File

@ -1,4 +1,5 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify

View File

@ -1,4 +1,5 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify

View File

@ -1,5 +1,6 @@
<?php
class ConfigModel
{
private $db;

View File

@ -1,5 +1,6 @@
<?php
class FileModel
{
private $db;

View File

@ -1,4 +1,5 @@
<?php
require_once(__DIR__ . '/../../../config.php');
require_once(__DIR__ . '/../lib.php');
require_once(__DIR__ . '/../form/send_text_form.php');

View File

@ -1,5 +1,6 @@
<?php
require_once(__DIR__ . '/../../../config.php');
require_once(__DIR__ . '/../lib.php');
require_once(__DIR__ . '/../form/send_text_form.php');
@ -39,7 +40,7 @@ if ('POST' === $_SERVER['REQUEST_METHOD']) {// form submission
$file = $fs->get_file_by_id($fileid);
if (!$file) {
//file not found
// file not found
die('404 not exists');
}
@ -74,7 +75,7 @@ if ('POST' === $_SERVER['REQUEST_METHOD']) {// form submission
$file = $fs->get_file_by_id($fileid);
if (!$file) {
//file not found
// file not found
die('404 not exists');
}

View File

@ -1,4 +1,5 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify

View File

@ -1,4 +1,5 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
@ -26,9 +27,9 @@ defined('MOODLE_INTERNAL') || die();
if (!isset($plugin)) {
$plugin = new stdClass();
}
$plugin->version = 2018103102;
$plugin->version = 2018110101;
$plugin->requires = 2017051501; // Requires Moodle 3.3 .
$plugin->release = 'v1.18';
$plugin->release = 'v1.19';
$plugin->maturity = MATURITY_STABLE;
$plugin->component = 'plagiarism_pchkorg';

View File

@ -1,5 +1,6 @@
<?php
echo $OUTPUT->header();
?>
<style>
@ -19,7 +20,10 @@ echo $OUTPUT->header();
</style>
<div>
<div id="plagcheck-loader" data-cmid="<?php echo intval($cmid)?>" data-file="<?php echo intval($fileid)?>" class="loader"></div>
<div id="plagcheck-loader" data-cmid="<?php
echo intval($cmid)?>" data-file="<?php
echo intval($fileid)?>" class="loader"></div>
</div>
<?php
echo $OUTPUT->footer();

View File

@ -1,4 +1,5 @@
<?php
$PAGE->requires->css('/plagiarism/pchkorg/assets/viewer/report-viewer.min.css');
echo $OUTPUT->header();
@ -6,32 +7,32 @@ echo $OUTPUT->header();
?>
<div class="pCheck-container"></div>
<div id="report-root"></div>
<?php
if (empty($error)) {
?>
<script src="/plagiarism/pchkorg/assets/viewer/report-viewer.min.js"></script>
<script>
(function(window, document, ReportViewer, localData) {
var element = document.getElementById('report-root');
var widget = ReportViewer.create();
widget.init({
element: element,
localData: localData
});
})(window, window.document, window.ReportViewer, <?php echo empty($data) ? '{}': $data ?>);
</script>
<?
} elseif (isset($error)) {
?>
<h2>Error: <?php echo $error ?></h2>
if (empty($error)) {
?>
<script src="/plagiarism/pchkorg/assets/viewer/report-viewer.min.js"></script>
<script>
(function (window, document, ReportViewer, localData) {
var element = document.getElementById('report-root');
var widget = ReportViewer.create();
<?
}
?>
widget.init({
element: element,
localData: localData
});
})(window, window.document, window.ReportViewer, <?php
echo empty($data) ? '{}' : $data ?>);
</script>
<?php
<?php
} elseif (isset($error)) {
?>
<h2>Error: <?php
echo $error ?></h2>
<?php
echo $OUTPUT->footer();
}
echo $OUTPUT->footer();

View File

@ -1,5 +1,6 @@
<?php
echo $OUTPUT->header();
?>
@ -17,13 +18,15 @@ echo $OUTPUT->header();
<br/>
<div class="plagiarism-preview-content">
<div class="plagiarism-preview-content-inner">
<?php echo nl2br(htmlspecialchars($content, ENT_COMPAT | ENT_HTML401, $encoding = 'UTF-8')) ?>
<?php
echo nl2br(htmlspecialchars($content, ENT_COMPAT | ENT_HTML401, $encoding = 'UTF-8')) ?>
</div>
</div>
<br/>
<div>
<?php
if ($isSupported) {
echo $form->display();
} else {
@ -32,4 +35,5 @@ echo $OUTPUT->header();
?>
</div>
<?php
echo $OUTPUT->footer();