Commit 5d42c96f authored by Plugins bot's avatar Plugins bot

PLUGIN-22972 plagiarism_turnitin: cibot precheck request

parent 03e32198
language: php
sudo: false
cache:
directories:
- $HOME/.composer/cache
php:
- 7.1
- 7.2
services:
- mysql
- postgresql
env:
global:
- IGNORE_PATHS=sdk/,pix/,vendor/
- IGNORE_NAMES=jquery*,styles.css,autoload_static.php
matrix:
- DB=pgsql MOODLE_BRANCH=MOODLE_36_STABLE
- DB=mysqli MOODLE_BRANCH=MOODLE_36_STABLE
- DB=pgsql MOODLE_BRANCH=MOODLE_37_STABLE
- DB=mysqli MOODLE_BRANCH=MOODLE_37_STABLE
- DB=pgsql MOODLE_BRANCH=MOODLE_38_STABLE
- DB=mysqli MOODLE_BRANCH=MOODLE_38_STABLE
before_install:
- phpenv config-rm xdebug.ini
- cd ../..
- composer selfupdate
- composer create-project -n --no-dev --prefer-dist blackboard-open-source/moodle-plugin-ci ci ^1
- 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 phpmd
- moodle-plugin-ci csslint
- moodle-plugin-ci shifter
- moodle-plugin-ci validate
- moodle-plugin-ci phpunit
\ No newline at end of file
This diff is collapsed.
PLagiarism Plugin Contributions
------------------------------
We welcome contributions to all elements of the plugin. Since launch we've had a number of users provide us with fixes and enhancements through either pull request or commits linked to from the issues page. If you are interested in contributing enhancements, or would like to solve an issue raised by another user, please feel free to make a pull request against the develop branch.
Some users also contribute code that while not appropriate for every user may help them solve issues where their workflow is different from that of Turnitin. We'll link to them from this page if appropriate. Please note that we have not tested this code so we don't endorse it, we only provide a link to it here as other users feel someone else may find it useful.
------------------------------
tonyjbutler provided via [ISSUE 137](https://github.com/jmcgettrick/MoodleDirectV2/issues/137) - This will reduce the maximum file size of submissions to a Turnitin enabled Moodle assignment.
\ No newline at end of file
Turnitin Plagiarism plugin for Moodle
=====================================
Please be aware that the **Develop** branch should not be considered production ready, although it contains the latest fixes and features it may contain bugs. It should be avoided in favour of the **Master** branch which is the latest available branch that has been through the QA process. Please make any pull requests you would like to make to the develop branch.
For running behat tests in Moodle 3.9 and above, please use the behat_39+ branch. There are some deprecated form settings methods in Moodle that throw warnings during behat test runs causing failures, unfortunately this is the only way around this issue as we don't want have different plugin branches per Moodle version.
To see what has changed in recent versions of the plagiarism plugin, see the [CHANGELOG](https://github.com/turnitin/moodle-plagiarism_turnitin/blob/master/CHANGELOG.md).
If you would like to contribute to the plugin please see our [CONTRIBUTIONS](https://github.com/turnitin/moodle-plagiarism_turnitin/blob/master/CONTRIBUTIONS.md) page.
If you are having issues, please consult our [TROUBLE SHOOTING](https://github.com/turnitin/moodle-plagiarism_turnitin/blob/master/TROUBLESHOOTING.md) page.
Installation
------------
Before installing this plugin firstly make sure you are logged in as an Administrator and that you are using Moodle 3.5 or higher.
The Plagiarism Plugin can be used within the following Moodle modules:
- Assignments
- Forums
- Quiz *
- Workshops
\* This is currently only essay type answers and is also reliant on Moodle merging [this code patch](https://github.com/moodle/moodle/commit/7a8e3ec4b13408d18734ab46bdb03b2da55f317d) into their core offering. For more information see: [MDL-32226](https://tracker.moodle.org/browse/MDL-32226).
To install, you need to copy all the files into the plagiarism/turnitin directory in your Moodle installation. You should then go to `"Site Administration" > "Notifications"` where you should follow the on screen instructions.
Plagiarism plugins also need to be enabled before this plugin can be used. You can do this by going to `"Site Administration" > "Advanced Features"` and ticking the "Enable plagiarism plugins" box before saving.
You can set default values and whether the plugin is enabled within Moodle modules by going to `"Site Administration" > "Plugins" > "Plagiarism prevention" > "Turnitin plagiarism plugin"`.
To create/update assignments, process submissions and update grades your moodle environment will need to have cron job running regularly. For information on how to do this please consult https://docs.moodle.org/37/en/Cron.
#Turnitin Plagiarism Plugin Troubleshooting
1) You may need to ensure that within your designated moodledata directory; the plagiarism_turnitin subdirectory and the subsequent logs subdirectory have the correct permissions to be able to create directories and files.
2) Pop-ups will need to be enabled on the browser being used if access to the Turnitin Document Viewer is required.
3) There have been very isolated reports of the settings not showing for the Plagiarism plugin despite it being enabled, this is due to it not showing in Moodle cache. The solution is for an administrator to purge all caches and it should then appear.
##Required PHP Extensions
In order for the module to work correctly you must enable the following PHP extensions:
**cURL**
>You must enable support for cURL in your php.ini file. To do this locate the following line in your php.ini file:
>;extension=php_curl.dll
>OR
>;extension=php_curl.so
>Remove the semi-colon at the start of the line to activate the php cURL extension. Once you have done this you will need to restart your web server service.
>More information on cURL and more detailed instructions for installing it can be found here: http://uk3.php.net/curl
**XMLWriter**
>This is normally enabled by default but if PHP was compiled with --disable-xmlreader set then you will need to recompile PHP without --disable-xmlreader set.
**MBstring**
>You may be able to enable this setting by uncommenting the extension listing in your php.ini file:
>;extension=php_mbstring.dll
>Remove the semi-colon at the start of the line to activate the MBstring extension. Once you have done this you will need to restart your web server service.
>If you can't find this line in your php.ini file then you may need to install the php-mbstring first. For further information see: http://php.net/manual/en/mbstring.installation.php
**fileinfo**
>This extension is enabled by default as of PHP 5.3.0. Windows users must include the bundled php_fileinfo.dll DLL file in php.ini to enable this extension.
>For further information see http://php.net/manual/en/fileinfo.installation.php.
##cURL Connectivity
If you encounter connectivity issues (error: Turnitin API Base URL incorrect or unavailable) this could be related to a CA certificate being unavailable to cURL.
If cURL has an out of date (or no) CA certificates, the interaction with Turnitin will fail due to cURL performing peer SSL certificate verification and not being able to verify the Turnitin SSL certificate.
Until cURL 7.18.0 some CA certificates were provided, but after 7.18.0 no cs certificates have been provided at all. Because of this, the Moodle server administrator would need to ensure that an up to date CA certificate bundle is used. To be clear, Moodle doesn't need an SSL certificate, however, it needs to have the certificate bundle in place so cURL can recognize the SSL certificates of Turnitin.
Information on how to install a certificate bundle is available via the URLs below. Note that the URLs are third party sites and not affiliated with Turnitin or iParadigms in any way:
Information for Linux environments: http://docs.moodle.org/26/en/SSL_certificate_for_moodle.org
Information for Windows environments: http://curl.haxx.se/docs/sslcerts.html
##WSDL
We have had reported issues with users not being able to parse the WSDL files that the API requires. The relevant error message starts “PHP Fatal error: SOAP-ERROR: Parsing WSDL: ….”
From version 2014012405 onwards we have bundled the WSDL files with the plugin download, however the issue does still occur for some users. This is due to a PHP bug with libxml_disable_entity_loader() being set to true and preventing external entities from being loaded. If this is set by a PHP script then PHP uses this value for all processes on the server. For further information see: https://bugs.php.net/bug.php?id=64938.
To fix this, you need to add the following line to your to your moodle config.php:
libxml_disable_entity_loader(false);
Thanks to Dan Marsden for the information and solution.
This diff is collapsed.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
/**
* Javascript controller for launching the EULA modal.
*
* @package turnitin
* @copyright Turnitin
* @author 2019 David Winn <dwinn@turnitin.com>
* @module plagiarism_turnitin/eulaLaunch
*/
define(['jquery',
'core/templates',
'core/modal_factory',
'core/modal_events',
'plagiarism_turnitin/modal_eula_launch'
],
function($, Templates, ModalFactory, ModalEvents, ModalEulaLaunch) {
return {
eulaLaunch: function() {
var turnitinEulaClass = $(".pp_turnitin_eula");
turnitinEulaClass.show();
$(document).on('click', '.pp_turnitin_eula_link', function() {
ModalFactory.create({
type: ModalEulaLaunch.TYPE,
templateContext: {
cmid: $('input[name="coursemodule"]').val(),
wwwroot: M.cfg.wwwroot
},
large: true
})
.then(function (modal) {
modal.show();
modal.getRoot().find('.modal').addClass('tii_pp_modal_eula');
modal.getRoot().find('.modal-content').addClass('tii_pp_modal_eula_content');
});
});
// Hide the submission form if the user has never accepted or declined the Turnitin EULA.
if ($(".pp_turnitin_eula_ignored").length > 0) {
if ($('.editsubmissionform').length > 0) {
$('.editsubmissionform').hide();
}
if (turnitinEulaClass.siblings('.mform').length > 0) {
turnitinEulaClass.siblings('.mform').hide();
}
}
}
};
});
\ No newline at end of file
/**
* Javascript controller for Eula launcher
*
* @package turnitin
* @copyright Turnitin
* @author 2019 David Winn <dwinn@turnitin.com>
* @module plagiarism_turnitin/modal_eula_launch
*/
define(
[
'jquery',
'core/ajax',
'core/notification',
'core/custom_interaction_events',
'core/modal',
'core/modal_registry',
'core/modal_events'
],
function($, Ajax, Notification, CustomEvents, Modal, ModalRegistry, ModalEvents) {
var registered = false;
var SELECTORS = {
HIDE_BUTTON: '[data-action="hide"]',
MODAL: '[data-region="modal"]'
};
/**
* Constructor for the Modal.
*
* @param {object} root The root jQuery element for the modal
*/
var ModalEulaLaunch = function(root) {
Modal.call(this, root);
};
ModalEulaLaunch.TYPE = 'plagiarism_turnitin-modal_eula_launch';
ModalEulaLaunch.prototype = Object.create(Modal.prototype);
ModalEulaLaunch.prototype.constructor = ModalEulaLaunch;
/**
* Set up all of the event handling for the modal.
*
* @method registerEventListeners
*/
ModalEulaLaunch.prototype.registerEventListeners = function() {
// Apply parent event listeners.
Modal.prototype.registerEventListeners.call(this);
processEula();
// On clicking the X, then hide the modal.
this.getModal().on(CustomEvents.events.activate, SELECTORS.HIDE_BUTTON, function(e, data) {
var cancelEvent = $.Event(ModalEvents.cancel);
this.getRoot().trigger(cancelEvent, this);
if (!cancelEvent.isDefaultPrevented()) {
this.hide();
data.originalEvent.preventDefault();
}
}.bind(this));
};
// Get the rubrics belonging to a user from Turnitin and refresh menu accordingly.
function processEula() {
$(window).on("message", function(ev) {
var message = typeof ev.data === 'undefined' ? ev.originalEvent.data : ev.data;
// Only make ajax request if message is one of the expected responses.
if (message === 'turnitin_eula_declined' || message === 'turnitin_eula_accepted') {
$.ajax({
type: "POST",
url: M.cfg.wwwroot + "/plagiarism/turnitin/ajax.php",
dataType: "json",
data: {
action: "actionuseragreement",
message: message,
sesskey: M.cfg.sesskey
},
success: function() {
window.location.reload();
},
error: function() {
window.location.reload();
}
});
}
});
}
// Automatically register with the modal registry the first time this module is imported so that
// you can create modals of this type using the modal factory.
if (!registered) {
ModalRegistry.register(ModalEulaLaunch.TYPE, ModalEulaLaunch, 'plagiarism_turnitin/modal_eula_launch');
registered = true;
}
return ModalEulaLaunch;
}
);
\ No newline at end of file
/**
* Javascript controller for the Peermark Manager launcher
*
* @package turnitin
* @copyright Turnitin
* @author 2019 David Winn <dwinn@turnitin.com>
* @module plagiarism_turnitin/modal_peermark_manager_launch
*/
define(
[
'jquery',
'core/ajax',
'core/notification',
'core/custom_interaction_events',
'core/modal',
'core/modal_registry',
'core/modal_events'
],
function($, Ajax, Notification, CustomEvents, Modal, ModalRegistry, ModalEvents) {
var registered = false;
var SELECTORS = {
HIDE_BUTTON: '[data-action="hide"]',
MODAL: '[data-region="modal"]'
};
/**
* Constructor for the Modal.
*
* @param {object} root The root jQuery element for the modal
*/
var ModalPeermarkManagerLaunch = function(root) {
Modal.call(this, root);
};
ModalPeermarkManagerLaunch.TYPE = 'plagiarism_turnitin-modal_peermark_manager_launch';
ModalPeermarkManagerLaunch.prototype = Object.create(Modal.prototype);
ModalPeermarkManagerLaunch.prototype.constructor = ModalPeermarkManagerLaunch;
/**
* Set up all of the event handling for the modal.
*
* @method registerEventListeners
*/
ModalPeermarkManagerLaunch.prototype.registerEventListeners = function() {
// Apply parent event listeners.
Modal.prototype.registerEventListeners.call(this);
// On cancel, then hide the modal.
this.getModal().on(CustomEvents.events.activate, SELECTORS.HIDE_BUTTON, function(e, data) {
var cancelEvent = $.Event(ModalEvents.cancel);
this.getRoot().trigger(cancelEvent, this);
if (!cancelEvent.isDefaultPrevented()) {
this.hide();
data.originalEvent.preventDefault();
refreshPeermarkAssignments();
}
}.bind(this));
// On clicking outside the modal, refresh the Peermark assignments.
this.getRoot().click(function(e) {
if (!$(e.target).closest(SELECTORS.MODAL).length) {
refreshPeermarkAssignments();
}
}.bind(this));
};
function refreshPeermarkAssignments() {
$.ajax({
type: "POST",
url: M.cfg.wwwroot + "/plagiarism/turnitin/ajax.php",
dataType: "json",
data: {
action: "refresh_peermark_assignments",
cmid: $('input[name="coursemodule"]').val(),
sesskey: M.cfg.sesskey
}
});
}
// Automatically register with the modal registry the first time this module is imported so that
// you can create modals of this type using the modal factory.
if (!registered) {
ModalRegistry.register(ModalPeermarkManagerLaunch.TYPE,
ModalPeermarkManagerLaunch,
'plagiarism_turnitin/modal_peermark_manager_launch');
registered = true;
}
return ModalPeermarkManagerLaunch;
}
);
\ No newline at end of file
/**
* Javascript controller for Peermark Reviews launcher
*
* @package turnitin
* @copyright Turnitin
* @author 2019 David Winn <dwinn@turnitin.com>
* @module plagiarism_turnitin/modal_peermark_reviews_launch
*/
define(
[
'jquery',
'core/ajax',
'core/notification',
'core/custom_interaction_events',
'core/modal',
'core/modal_registry',
'core/modal_events'
],
function($, Ajax, Notification, CustomEvents, Modal, ModalRegistry, ModalEvents) {
var registered = false;
var SELECTORS = {
HIDE_BUTTON: '[data-action="hide"]',
MODAL: '[data-region="modal"]'
};
/**
* Constructor for the Modal.
*
* @param {object} root The root jQuery element for the modal
*/
var ModalPeermarkReviewsLaunch = function(root) {
Modal.call(this, root);
};
ModalPeermarkReviewsLaunch.TYPE = 'plagiarism_turnitin-modal_peermark_reviews_launch';
ModalPeermarkReviewsLaunch.prototype = Object.create(Modal.prototype);
ModalPeermarkReviewsLaunch.prototype.constructor = ModalPeermarkReviewsLaunch;
/**
* Set up all of the event handling for the modal.
*
* @method registerEventListeners
*/
ModalPeermarkReviewsLaunch.prototype.registerEventListeners = function() {
// Apply parent event listeners.
Modal.prototype.registerEventListeners.call(this);
// On cancel, then hide the modal.
this.getModal().on(CustomEvents.events.activate, SELECTORS.HIDE_BUTTON, function(e, data) {
var cancelEvent = $.Event(ModalEvents.cancel);
this.getRoot().trigger(cancelEvent, this);
if (!cancelEvent.isDefaultPrevented()) {
this.hide();
data.originalEvent.preventDefault();
}
}.bind(this));
};
// Automatically register with the modal registry the first time this module is imported so that
// you can create modals of this type using the modal factory.
if (!registered) {
ModalRegistry.register(ModalPeermarkReviewsLaunch.TYPE,
ModalPeermarkReviewsLaunch,
'plagiarism_turnitin/modal_peermark_reviews_launch');
registered = true;
}
return ModalPeermarkReviewsLaunch;
}
);
\ No newline at end of file
/**
* Javascript controller for Quickmark launcher
*
* @package turnitin
* @copyright Turnitin
* @author 2019 David Winn <dwinn@turnitin.com>
* @module plagiarism_turnitin/modal_quickmark_launch
*/
define(
[
'jquery',
'core/ajax',
'core/notification',
'core/custom_interaction_events',
'core/modal',
'core/modal_registry',
'core/modal_events'
],
function($, Ajax, Notification, CustomEvents, Modal, ModalRegistry, ModalEvents) {
var registered = false;
var SELECTORS = {
HIDE_BUTTON: '[data-action="hide"]',
MODAL: '[data-region="modal"]'
};
/**
* Constructor for the Modal.
*
* @param {object} root The root jQuery element for the modal
*/
var ModalQuickmarkLaunch = function(root) {
Modal.call(this, root);
};
ModalQuickmarkLaunch.TYPE = 'plagiarism_turnitin-modal_quickmark_launch';
ModalQuickmarkLaunch.prototype = Object.create(Modal.prototype);
ModalQuickmarkLaunch.prototype.constructor = ModalQuickmarkLaunch;
/**
* Set up all of the event handling for the modal.
*
* @method registerEventListeners
*/
ModalQuickmarkLaunch.prototype.registerEventListeners = function() {
// Apply parent event listeners.
Modal.prototype.registerEventListeners.call(this);
// On cancel, then hide the modal.
this.getModal().on(CustomEvents.events.activate, SELECTORS.HIDE_BUTTON, function(e, data) {
var cancelEvent = $.Event(ModalEvents.cancel);
this.getRoot().trigger(cancelEvent, this);
if (!cancelEvent.isDefaultPrevented()) {
this.hide();
data.originalEvent.preventDefault();
}
}.bind(this));
};
// Automatically register with the modal registry the first time this module is imported so that
// you can create modals of this type using the modal factory.
if (!registered) {