Skip to content

Commit 1859714

Browse files
Merge pull request #534 from turnitin/develop
Release 2020072201
2 parents 7e87d36 + 53d8436 commit 1859714

File tree

4 files changed

+18
-7
lines changed

4 files changed

+18
-7
lines changed

CHANGELOG.md

+10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
### Date: 2020-July-22
2+
### Release: 2020072201
3+
4+
#### :wrench: Fixes and enhancements
5+
6+
#### Plagiarism Plugin settings will only appear once
7+
8+
A bug had caused the Plagiarism Plugin settings to display twice when creating an assignment in Moodle versions prior to 3.9. This has been fixed for all supported Moodle versions.
9+
10+
---
111
### Date: 2020-July-07
212
### Release: 2020070801
313

db/upgrade.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ function xmldb_plagiarism_turnitin_upgrade($oldversion) {
417417
}
418418

419419
if ($oldversion < 2020070801) {
420-
// Convert plugin _use settings as they are bring deprecated.
420+
// Convert plugin _use settings as they are being deprecated.
421421
$data = get_config('plagiarism');
422422
$value = (empty($data->turnitin_use)) ? 0 : 1;
423423
set_config('enabled', $value, 'plagiarism_turnitin');

lib.php

+6-5
Original file line numberDiff line numberDiff line change
@@ -272,13 +272,14 @@ public function save_form_elements($data) {
272272
* @param object $context
273273
* @return type
274274
*/
275-
public function get_form_elements_module($mform, $context, $modulename = "", $source = "") {
276-
global $CFG, $DB, $PAGE, $COURSE;
275+
public function get_form_elements_module($mform, $context, $modulename = "") {
276+
global $DB, $PAGE, $COURSE;
277277

278278
// This is a bit of a hack and untidy way to ensure the form elements aren't displayed
279279
// twice. This won't be needed once this method goes away.
280280
// TODO: Remove once this method goes away.
281-
if ($source != "new_method" && $CFG->branch >= 39) {
281+
static $settingsdisplayed;
282+
if ($settingsdisplayed) {
282283
return;
283284
}
284285

@@ -327,6 +328,7 @@ public function get_form_elements_module($mform, $context, $modulename = "", $so
327328
$course = $this->get_course_data($cmid, $COURSE->id);
328329
$turnitinview->add_elements_to_settings_form($mform, $course, "activity", $modulename, $cmid, $plagiarismvalues["plagiarism_rubric"]);
329330
}
331+
$settingsdisplayed = true;
330332

331333
// Disable all plagiarism elements if turnitin is not enabled.
332334
foreach ($plagiarismelements as $element) {
@@ -2840,8 +2842,7 @@ function plagiarism_turnitin_coursemodule_standard_elements($formwrapper, $mform
28402842
$pluginturnitin->get_form_elements_module(
28412843
$mform,
28422844
$context,
2843-
isset($formwrapper->get_current()->modulename) ? 'mod_'.$formwrapper->get_current()->modulename : '',
2844-
"new_method");
2845+
isset($formwrapper->get_current()->modulename) ? 'mod_'.$formwrapper->get_current()->modulename : '');
28452846
}
28462847

28472848
/**

version.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
* @copyright 2012 iParadigms LLC
2020
*/
2121

22-
$plugin->version = 2020070801;
22+
$plugin->version = 2020072201;
2323
$plugin->release = "3.5+";
2424
$plugin->requires = 2018051700;
2525
$plugin->component = 'plagiarism_turnitin';

0 commit comments

Comments
 (0)