Skip to content

Commit

Permalink
MDL-67872 lib: fix code compliance with guidelines.
Browse files Browse the repository at this point in the history
  • Loading branch information
danmarsden committed Feb 12, 2020
1 parent de8d91c commit c61619f
Showing 1 changed file with 12 additions and 15 deletions.
27 changes: 12 additions & 15 deletions lib/plagiarismlib.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
Expand All @@ -19,16 +18,14 @@
* plagiarismlib.php - Contains core Plagiarism related functions.
*
* @since Moodle 2.0
* @package moodlecore
* @package core
* @subpackage plagiarism
* @copyright 2010 Dan Marsden http://danmarsden.com
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

///// GENERIC PLAGIARISM FUNCTIONS ////////////////////////////////////////////////////

if (!defined('MOODLE_INTERNAL')) {
die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
die('Direct access to this script is forbidden.');
}

/**
Expand All @@ -44,7 +41,7 @@ function plagiarism_get_links($linkarray) {
}
$plagiarismplugins = plagiarism_load_available_plugins();
$output = '';
foreach($plagiarismplugins as $plugin => $dir) {
foreach ($plagiarismplugins as $plugin => $dir) {
require_once($dir.'/lib.php');
$plagiarismclass = "plagiarism_plugin_$plugin";
$plagiarismplugin = new $plagiarismclass;
Expand All @@ -69,7 +66,7 @@ function plagiarism_get_file_results($cmid, $userid, $file) {
return $allresults;
}
$plagiarismplugins = plagiarism_load_available_plugins();
foreach($plagiarismplugins as $plugin => $dir) {
foreach ($plagiarismplugins as $plugin => $dir) {
require_once($dir.'/lib.php');
$plagiarismclass = "plagiarism_plugin_$plugin";
$plagiarismplugin = new $plagiarismclass;
Expand All @@ -91,7 +88,7 @@ function plagiarism_save_form_elements($data) {
return '';
}
$plagiarismplugins = plagiarism_load_available_plugins();
foreach($plagiarismplugins as $plugin => $dir) {
foreach ($plagiarismplugins as $plugin => $dir) {
require_once($dir.'/lib.php');
$plagiarismclass = "plagiarism_plugin_$plugin";
$plagiarismplugin = new $plagiarismclass;
Expand Down Expand Up @@ -122,7 +119,7 @@ function plagiarism_get_form_elements_module($mform, $context, $modulename = "")
return '';
}
$plagiarismplugins = plagiarism_load_available_plugins();
foreach($plagiarismplugins as $plugin => $dir) {
foreach ($plagiarismplugins as $plugin => $dir) {
require_once($dir.'/lib.php');
$plagiarismclass = "plagiarism_plugin_$plugin";
$plagiarismplugin = new $plagiarismclass;
Expand Down Expand Up @@ -151,7 +148,7 @@ function plagiarism_update_status($course, $cm) {
}
$plagiarismplugins = plagiarism_load_available_plugins();
$output = '';
foreach($plagiarismplugins as $plugin => $dir) {
foreach ($plagiarismplugins as $plugin => $dir) {
require_once($dir.'/lib.php');
$plagiarismclass = "plagiarism_plugin_$plugin";
$plagiarismplugin = new $plagiarismclass;
Expand All @@ -161,18 +158,18 @@ function plagiarism_update_status($course, $cm) {
}

/**
* Function that prints the student disclosure notifying that the files will be checked for plagiarism
* @param integer $cmid - the cmid of this module
* @return string
*/
* Function that prints the student disclosure notifying that the files will be checked for plagiarism
* @param integer $cmid - the cmid of this module
* @return string
*/
function plagiarism_print_disclosure($cmid) {
global $CFG;
if (empty($CFG->enableplagiarism)) {
return '';
}
$plagiarismplugins = plagiarism_load_available_plugins();
$output = '';
foreach($plagiarismplugins as $plugin => $dir) {
foreach ($plagiarismplugins as $plugin => $dir) {
require_once($dir.'/lib.php');
$plagiarismclass = "plagiarism_plugin_$plugin";
$plagiarismplugin = new $plagiarismclass;
Expand Down

0 comments on commit c61619f

Please sign in to comment.