Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 52... Línea 52...
52
    }
52
    }
53
    return '';
53
    return '';
54
}
54
}
Línea 55... Línea 55...
55
 
55
 
56
/**
-
 
57
 * returns array of plagiarism details about specified file
-
 
58
 *
-
 
59
 * @deprecated Since Moodle 4.0. - this function was a placeholder and not used in core.
-
 
60
 * @todo MDL-71326 This is to be moved from here to deprecatedlib.php in Moodle 4.4
-
 
61
 * @param int $cmid
-
 
62
 * @param int $userid
-
 
63
 * @param object $file moodle file object
-
 
64
 * @return array - sets of details about specified file, one array of details per plagiarism plugin
-
 
65
 *  - each set contains at least 'analyzed', 'score', 'reporturl'
-
 
66
 */
-
 
67
function plagiarism_get_file_results($cmid, $userid, $file) {
-
 
68
    global $CFG;
-
 
69
    $text = 'plagiarism_get_file_results is deprecated, please use plagiarism_get_links() or plugin specific functions.';
-
 
70
    debugging($text, DEBUG_DEVELOPER);
-
 
71
    $allresults = array();
-
 
72
    if (empty($CFG->enableplagiarism)) {
-
 
73
        return $allresults;
-
 
74
    }
-
 
75
    $plagiarismplugins = plagiarism_load_available_plugins();
-
 
76
    foreach ($plagiarismplugins as $plugin => $dir) {
-
 
77
        require_once($dir.'/lib.php');
-
 
78
        $plagiarismclass = "plagiarism_plugin_$plugin";
-
 
79
        $plagiarismplugin = new $plagiarismclass;
-
 
80
        $allresults[] = $plagiarismplugin->get_file_results($cmid, $userid, $file);
-
 
81
    }
-
 
82
    return $allresults;
-
 
83
}
-
 
84
 
-
 
85
/**
-
 
86
 * Allows a plagiarism plugin to print a button/link at the top of activity overview report pages.
-
 
87
 *
-
 
88
 * @deprecated Since Moodle 4.0 - Please use {plugin name}_before_standard_top_of_body_html instead.
-
 
89
 * @todo MDL-71326 Remove this method.
-
 
90
 * @param object $course - full Course object
-
 
91
 * @param object $cm - full cm object
-
 
92
 * @return string
-
 
93
 */
-
 
94
function plagiarism_update_status($course, $cm) {
-
 
95
    global $CFG;
-
 
96
    if (empty($CFG->enableplagiarism)) {
-
 
97
        return '';
-
 
98
    }
-
 
99
    $plagiarismplugins = plagiarism_load_available_plugins();
-
 
100
    $output = '';
-
 
101
    foreach ($plagiarismplugins as $plugin => $dir) {
-
 
102
        require_once($dir.'/lib.php');
-
 
103
        $plagiarismclass = "plagiarism_plugin_$plugin";
-
 
104
        $plagiarismplugin = new $plagiarismclass;
-
 
105
 
-
 
106
        $reflectionmethod = new ReflectionMethod($plagiarismplugin, 'update_status');
-
 
107
        if ($reflectionmethod->getDeclaringClass()->getName() == get_class($plagiarismplugin)) {
-
 
108
            $text = 'plagiarism_plugin::update_status() is deprecated.';
-
 
109
            $text .= ' Use plagiarism_' . $plugin . '_before_standard_top_of_body_html() instead';
-
 
110
            debugging($text, DEBUG_DEVELOPER);
-
 
111
        }
-
 
112
        $output .= $plagiarismplugin->update_status($course, $cm);
-
 
113
    }
-
 
114
    return $output;
-
 
115
}
-
 
116
 
-
 
117
/**
56
/**
118
 * Function that prints the student disclosure notifying that the files will be checked for plagiarism
57
 * Function that prints the student disclosure notifying that the files will be checked for plagiarism
119
 * @param integer $cmid - the cmid of this module
58
 * @param integer $cmid - the cmid of this module
120
 * @return string
59
 * @return string
121
 */
60
 */