Add option to enable or disable ai-check

This commit is contained in:
Jane Adelmann 2023-06-08 12:17:51 +03:00
parent 8c3f615f7d
commit dd15b4983d
No known key found for this signature in database
GPG Key ID: 4CCF39DF30B8AF72
3 changed files with 16 additions and 5 deletions

View File

@ -58,6 +58,7 @@ $string['pchkorg_debug_status_error'] = 'Some error for this file';
$string['pchkorg_debug_student_not_allowed_see_widget'] = 'Students can not see a similarity score';
$string['pchkorg_student_can_see_widget'] = 'Students can see a similarity score';
$string['pchkorg_student_can_see_report'] = 'Students can access a similarity report';
$string['pchkorg_check_ai'] = 'Enable AI Detector';
$string['pchkorg_disclosure'] = 'Submission will be sent to <a target="_blank" href="https://plagiarismcheck.org/">PlagiarismCheck.org</a> for check.
<br />
By submitting assignment I agree with <a target="_blank" href="https://plagiarismcheck.org/terms-of-service/">Terms &amp; Conditions</a>

16
lib.php
View File

@ -173,7 +173,6 @@ function plagiarism_pchkorg_coursemodule_standard_elements($formwrapper, $mform)
array(get_string('no'), get_string('yes'))
);
$mform->addElement(
'select',
'pchkorg_student_can_see_widget',
@ -187,6 +186,14 @@ function plagiarism_pchkorg_coursemodule_standard_elements($formwrapper, $mform)
get_string('pchkorg_student_can_see_report', 'plagiarism_pchkorg'),
array(get_string('no'), get_string('yes'))
);
$mform->addElement(
'select',
'pchkorg_check_ai',
get_string('pchkorg_check_ai', 'plagiarism_pchkorg'),
array(get_string('no'), get_string('yes'))
);
$mform->setDefault('pchkorg_check_ai', 1);
}
}
@ -208,7 +215,8 @@ function plagiarism_pchkorg_coursemodule_edit_post_actions($data, $course)
'pchkorg_include_referenced',
'pchkorg_exclude_self_plagiarism',
'pchkorg_student_can_see_widget',
'pchkorg_student_can_see_report'
'pchkorg_student_can_see_report',
'pchkorg_check_ai'
);
$records = $DB->get_records('plagiarism_pchkorg_config', array(
@ -420,7 +428,9 @@ class plagiarism_plugin_pchkorg extends plagiarism_plugin {
$action = $apiprovider->get_report_action($filerecord->textid);
$reporttoken = $apiprovider->generate_api_token();
$score = $filerecord->score;
if (isset($filerecord->scoreai)) {
$isaienabled = '1' === $pchkorgconfigmodel->get_filter_for_module($cmid, 'pchkorg_check_ai');
if (isset($filerecord->scoreai) && $isaienabled) {
$title = sprintf(
get_string('pchkorg_label_title_ai', 'plagiarism_pchkorg'),
$filerecord->textid,

View File

@ -26,9 +26,9 @@ defined('MOODLE_INTERNAL') || die();
if (!isset($plugin)) {
$plugin = new stdClass();
}
$plugin->version = 2023060713;
$plugin->version = 2023060812;
$plugin->requires = 2020061501; // Requires Moodle 3.9 .
$plugin->release = 'v3.14.1';
$plugin->release = 'v3.14.2';
$plugin->component = 'plagiarism_pchkorg';
$plugin->maturity = MATURITY_STABLE;
$plugin->dependencies = array(