Skip to content

Commit

Permalink
Merge pull request #100 from turnitin/release_v2021011801
Browse files Browse the repository at this point in the history
Release 2021011801
  • Loading branch information
dwinn authored Jan 18, 2021
2 parents a1aca97 + e1e548c commit f6035b4
Show file tree
Hide file tree
Showing 11 changed files with 103 additions and 42 deletions.
55 changes: 55 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,58 @@
### Date: 2021-January-18
### Release: v2021011801

#### :zap: What's new

---

#### Support for Moodle 3.10

You can now confidently use Turnitin with Moodle 3.10.

#### Improved loading screen for the Turnitin Integrity Viewer

We’ve improved the loading screen you see when you launch the Turnitin Integrity viewer. The new loading screen includes an animation to indicate that the viewer is still opening and will be ready soon.

You can use this new animation to tell if something may have gone wrong and needs to be investigated.

#### Styling and workflow improvements to the Turnitin EULA

We haven’t made any changes to the EULA itself, but we have adjusted the styling of the box that is shown to ask you to review and accept it when a user first uses Turnitin. We’ve also taken the opportunity to fix a few bugs that could interrupt the intended EULA workflow

#### Get Help in all of Turnitin’s supported languages

Did you know we offer full step-by-step guidance for all Turnitin features? You’ll find direct links to the pages relevant for the language you view the Turnitin Integrity plugin in.

#### Use Turnitin with older submissions

If you enable Turnitin for an assignment after submissions have already been made, we will now queue these for report generation the next time you view the inbox in Moodle. These files will have the QUEUED status. If a student has not accepted the Turnitin EULA yet, we will instead show Awaiting EULA and will only process the file after the student has accepted it.

#### :wrench: Fixes and enhancements

---

#### Assignment settings have the correct spacing

The Turnitin settings configured when creating a Moodle assignment could have odd spacing. We’ve cleaned this up so the settings flow as they should.

#### Feedback and Intro files will no longer be checked for similarity

We no longer check any feedback or intro files you attach to an assignment for your students for similarity.

#### Deleting a course module will now also delete any attached Turnitin submissions

If a course module is deleted, along with its Moodle Assignments, we will now also delete any relevant Turnitin settings or entries in our database.

#### dateformat now uses the correct format

Thanks to our friends at OpenLMS who let us know that the download_as_dataformat() method was deprecated in Moodle 3.9. We’ve now updated this to the latest code to ensure everything works correctly for all users.

#### Accept the Turnitin EULA once for all assignment types

The EULA could show multiple times for each type of Moodle assignment. Now users only have to accept it once and we will remember this choice when generating Similarity Reports for Moodle Assignments, Workshops, Forums, and quizzes.

---

### Date: 2020-September-23
### Release: v2020092301

Expand Down
2 changes: 1 addition & 1 deletion classes/callback.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public function create_webhook() {
set_config('turnitin_webhook_secret', $secret, 'plagiarism_turnitinsim');

mtrace(get_string('taskoutputwebhookcreated', 'plagiarism_turnitinsim', TURNITINSIM_CALLBACK_URL));
} elseif ($responsedata->httpstatus === TURNITINSIM_HTTP_CANNOT_EXTRACT_TEXT) {
} else if ($responsedata->httpstatus === TURNITINSIM_HTTP_CANNOT_EXTRACT_TEXT) {
// Webhook for this URL already exists in Turnitin, but not Moodle. Get webhooks.
$response = $this->tsrequest->send_request(TURNITINSIM_ENDPOINT_WEBHOOKS, json_encode(array()), 'GET');
$webhooks = json_decode($response);
Expand Down
2 changes: 1 addition & 1 deletion lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,7 @@ public function queue_files($cm, $eventdata, $sendtoturnitin, $features, $quizan
$submission = $DB->get_record_select('plagiarism_turnitinsim_sub', $query, $params);
$filedetails = $tssubmission->get_file_details();

// Do not submit feedback or into files
// Do not submit feedback or into files.
if ($filedetails) {
$filearea = $filedetails->get_filearea();
$nonsubmittingareas = array("feedback_files", "introattachment");
Expand Down
2 changes: 1 addition & 1 deletion tests/classes/defaults_form_class_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,6 @@ public function test_display() {
$form = new plagiarism_turnitinsim_defaults_form();
$output = $form->display();

handle_deprecation::assertContains($this, '</form>', $output);
handle_deprecation::assertcontains($this, '</form>', $output);
}
}
9 changes: 6 additions & 3 deletions tests/classes/eula.class_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,10 @@ public function test_get_eula_status_for_student() {
$tseula = new plagiarism_turnitinsim_eula();
$result = $tseula->get_eula_status($cm->id, 'file');

handle_deprecation::assertContains($this, get_string('eulalink', 'plagiarism_turnitinsim', '?lang=en-US'), $result['eula-confirm']);
handle_deprecation::assertContains($this, get_string('submissiondisplayerror:eulanotaccepted_help', 'plagiarism_turnitinsim'), $result['eula-status']);
handle_deprecation::assertcontains($this,
get_string('eulalink', 'plagiarism_turnitinsim', '?lang=en-US'), $result['eula-confirm']);
handle_deprecation::assertcontains($this,
get_string('submissiondisplayerror:eulanotaccepted_help', 'plagiarism_turnitinsim'), $result['eula-status']);
}

/**
Expand Down Expand Up @@ -289,6 +291,7 @@ public function test_get_eula_status_for_instructor() {
$result = $tseula->get_eula_status($cm->id, 'file');

$this->assertEmpty($result['eula-confirm']);
handle_deprecation::assertContains($this, get_string('submissiondisplayerror:eulanotaccepted_help', 'plagiarism_turnitinsim'), $result['eula-status']);
handle_deprecation::assertcontains($this,
get_string('submissiondisplayerror:eulanotaccepted_help', 'plagiarism_turnitinsim'), $result['eula-status']);
}
}
6 changes: 3 additions & 3 deletions tests/classes/setup_form_class_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,10 @@ public function test_display() {
$form = new plagiarism_turnitinsim_setup_form();
$output = $form->display();

handle_deprecation::assertContains($this, '</form>', $output);
handle_deprecation::assertcontains($this, '</form>', $output);

// Verify that FERPA statement is present.
handle_deprecation::assertContains($this, get_string('viewerpermissionferpa', 'plagiarism_turnitinsim'), $output);
handle_deprecation::assertcontains($this, get_string('viewerpermissionferpa', 'plagiarism_turnitinsim'), $output);
}

/**
Expand Down Expand Up @@ -171,6 +171,6 @@ public function test_display_features_features_stored() {
$form = new plagiarism_turnitinsim_setup_form();
$output = $form->display_features();

handle_deprecation::assertContains($this, get_string('turnitinfeatures::moreinfo', 'plagiarism_turnitinsim'), $output);
handle_deprecation::assertcontains($this, get_string('turnitinfeatures::moreinfo', 'plagiarism_turnitinsim'), $output);
}
}
20 changes: 10 additions & 10 deletions tests/classes/submission_class_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public function test_update() {
$tssubmission->update();

// Submission id should now be set.
handle_deprecation::assertInternalTypeInt($this, $tssubmission->getid());
handle_deprecation::assertinternaltypeint($this, $tssubmission->getid());

// Check an id that doesn't exist doesn't return an object.
$submission = $DB->get_record('plagiarism_turnitinsim_sub', array('id' => 0));
Expand Down Expand Up @@ -253,15 +253,15 @@ public function test_create_owners_metadata_returns_all_group_member_details_as_
$tsuser2 = new plagiarism_turnitinsim_user($this->student2->id);

// Check user array returns correct details.
handle_deprecation::assertContains($this, $this->student1->lastname, $owners[0]['family_name']);
handle_deprecation::assertContains($this, $this->student1->firstname, $owners[0]['given_name']);
handle_deprecation::assertContains($this, $this->student1->email, $owners[0]['email']);
handle_deprecation::assertContains($this, $tsuser1->get_turnitinid(), $owners[0]['id']);

handle_deprecation::assertContains($this, $this->student2->lastname, $owners[1]['family_name']);
handle_deprecation::assertContains($this, $this->student2->firstname, $owners[1]['given_name']);
handle_deprecation::assertContains($this, $this->student2->email, $owners[1]['email']);
handle_deprecation::assertContains($this, $tsuser2->get_turnitinid(), $owners[1]['id']);
handle_deprecation::assertcontains($this, $this->student1->lastname, $owners[0]['family_name']);
handle_deprecation::assertcontains($this, $this->student1->firstname, $owners[0]['given_name']);
handle_deprecation::assertcontains($this, $this->student1->email, $owners[0]['email']);
handle_deprecation::assertcontains($this, $tsuser1->get_turnitinid(), $owners[0]['id']);

handle_deprecation::assertcontains($this, $this->student2->lastname, $owners[1]['family_name']);
handle_deprecation::assertcontains($this, $this->student2->firstname, $owners[1]['given_name']);
handle_deprecation::assertcontains($this, $this->student2->email, $owners[1]['email']);
handle_deprecation::assertcontains($this, $tsuser2->get_turnitinid(), $owners[1]['id']);
}

/**
Expand Down
38 changes: 20 additions & 18 deletions tests/lib_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -278,32 +278,32 @@ public function test_get_links_with_submission() {
// The HTML returned should contain the queued status and a Tii icon.
$plagiarismturnitinsim = new plagiarism_plugin_turnitinsim();

handle_deprecation::assertContains($this,
handle_deprecation::assertcontains($this,
'<span>'.get_string( 'submissiondisplaystatus:queued', 'plagiarism_turnitinsim').'</span>',
$plagiarismturnitinsim->get_links($linkarray)
);
handle_deprecation::assertContains($this, 'tii_icon', $plagiarismturnitinsim->get_links($linkarray));
handle_deprecation::assertcontains($this, 'tii_icon', $plagiarismturnitinsim->get_links($linkarray));

// Change submission status to Uploaded and verify that pending is displayed.
$tssubmission->setstatus(TURNITINSIM_SUBMISSION_STATUS_UPLOADED);
$tssubmission->update();
handle_deprecation::assertContains($this,
handle_deprecation::assertcontains($this,
'<span>'.get_string( 'submissiondisplaystatus:pending', 'plagiarism_turnitinsim').'</span>',
$plagiarismturnitinsim->get_links($linkarray)
);

// Change submission status to Uploaded and verify that not sent is displayed.
$tssubmission->setstatus(TURNITINSIM_SUBMISSION_STATUS_NOT_SENT);
$tssubmission->update();
handle_deprecation::assertContains($this,
handle_deprecation::assertcontains($this,
'<span>'.get_string( 'submissiondisplaystatus:notsent', 'plagiarism_turnitinsim').'</span>',
$plagiarismturnitinsim->get_links($linkarray)
);

// Change submission status to Requested and verify that pending is displayed.
$tssubmission->setstatus(TURNITINSIM_SUBMISSION_STATUS_REQUESTED);
$tssubmission->update();
handle_deprecation::assertContains($this,
handle_deprecation::assertcontains($this,
'<span>'.get_string( 'submissiondisplaystatus:pending', 'plagiarism_turnitinsim').'</span>',
$plagiarismturnitinsim->get_links($linkarray)
);
Expand All @@ -313,48 +313,48 @@ public function test_get_links_with_submission() {
$tssubmission->update();
$output = $plagiarismturnitinsim->get_links($linkarray);

handle_deprecation::assertContains($this,
handle_deprecation::assertcontains($this,
get_string('submissiondisplaystatus:awaitingeula', 'plagiarism_turnitinsim'),
$output
);
handle_deprecation::assertContains($this,
handle_deprecation::assertcontains($this,
get_string('submissiondisplayerror:eulanotaccepted_help', 'plagiarism_turnitinsim'),
$output
);
// Log instructor in and check they do not see a resubmit link.
$this->setUser($this->instructor);
handle_deprecation::assertNotContains($this,
handle_deprecation::assertnotcontains($this,
get_string('resubmittoturnitin', 'plagiarism_turnitinsim'),
$output
);

// Change submission status to a non constant and verify that the default is displayed.
$tssubmission->setstatus('nonconstantstring');
$tssubmission->update();
handle_deprecation::assertContains($this,
handle_deprecation::assertcontains($this,
get_string( 'submissiondisplaystatus:unknown', 'plagiarism_turnitinsim'),
$plagiarismturnitinsim->get_links($linkarray));

// Change submission status to Error and verify that the error message is displayed.
$tssubmission->setstatus(TURNITINSIM_SUBMISSION_STATUS_ERROR);
$tssubmission->seterrormessage(TURNITINSIM_SUBMISSION_STATUS_TOO_MUCH_TEXT);
$tssubmission->update();
handle_deprecation::assertContains($this,
handle_deprecation::assertcontains($this,
get_string( 'submissiondisplayerror:toomuchtext', 'plagiarism_turnitinsim'),
$plagiarismturnitinsim->get_links($linkarray)
);

// Change error message to generic and verify that it is displayed.
$tssubmission->seterrormessage('random_string_that_is_not_a_constant');
$tssubmission->update();
handle_deprecation::assertContains($this,
handle_deprecation::assertcontains($this,
get_string( 'submissiondisplayerror:generic', 'plagiarism_turnitinsim'),
$plagiarismturnitinsim->get_links($linkarray)
);

// Log instructor in and check they see a resubmit link.
$this->setUser($this->instructor);
handle_deprecation::assertContains($this,
handle_deprecation::assertcontains($this,
get_string( 'resubmittoturnitin', 'plagiarism_turnitinsim'),
$plagiarismturnitinsim->get_links($linkarray)
);
Expand All @@ -364,8 +364,9 @@ public function test_get_links_with_submission() {
$tssubmission->setstatus(TURNITINSIM_SUBMISSION_STATUS_COMPLETE);
$tssubmission->setoverallscore($score);
$tssubmission->update();
handle_deprecation::assertContains($this, $score.'%', $plagiarismturnitinsim->get_links($linkarray));
handle_deprecation::assertContains($this, 'or_score_colour_' . round($score, -1), $plagiarismturnitinsim->get_links($linkarray));
handle_deprecation::assertcontains($this, $score.'%', $plagiarismturnitinsim->get_links($linkarray));
handle_deprecation::assertcontains($this,
'or_score_colour_' . round($score, -1), $plagiarismturnitinsim->get_links($linkarray));
}

/**
Expand All @@ -376,7 +377,8 @@ public function test_render_resubmit_link() {

$plagiarismturnitinsim = new plagiarism_plugin_turnitinsim();
$submissionid = 1;
handle_deprecation::assertContains($this, 'pp_resubmit_id_'.$submissionid, $plagiarismturnitinsim->render_resubmit_link($submissionid));
handle_deprecation::assertcontains($this,
'pp_resubmit_id_'.$submissionid, $plagiarismturnitinsim->render_resubmit_link($submissionid));
}

/**
Expand Down Expand Up @@ -491,7 +493,7 @@ public function test_print_disclosure_display_latest() {

// Verify EULA is output.
$plagiarismturnitinsim = new plagiarism_plugin_turnitinsim();
handle_deprecation::assertContains($this,
handle_deprecation::assertcontains($this,
get_string('eulalink', 'plagiarism_turnitinsim', $eulaurl),
$plagiarismturnitinsim->print_disclosure($this->cm->id)
);
Expand Down Expand Up @@ -527,7 +529,7 @@ public function test_print_disclosure_not_display_latest() {

// Verify EULA is not output.
$plagiarismturnitinsim = new plagiarism_plugin_turnitinsim();
handle_deprecation::assertContains($this,
handle_deprecation::assertcontains($this,
get_string('eulaalreadyaccepted', 'plagiarism_turnitinsim'),
$plagiarismturnitinsim->print_disclosure($this->cm->id));
}
Expand Down Expand Up @@ -559,7 +561,7 @@ public function test_print_disclosure_eula_not_displayed_if_not_required() {

// Verify EULA is not output.
$plagiarismturnitinsim = new plagiarism_plugin_turnitinsim();
handle_deprecation::assertContains($this,
handle_deprecation::assertcontains($this,
get_string('eulanotrequired', 'plagiarism_turnitinsim'),
$plagiarismturnitinsim->print_disclosure($this->cm->id));
}
Expand Down
1 change: 1 addition & 0 deletions tests/turnitinsim_generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ public function create_assign_with_student_and_teacher($params = array()) {
* Create a Turnitin submission.
*
* @param int $numsubmissions The number of submissions to create.
* @param string $status The Turnitin status for this submission.
* @return array
* @throws coding_exception
* @throws dml_exception
Expand Down
8 changes: 4 additions & 4 deletions utilities/handle_deprecation.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public static function get_plugin_enabled() {
* In Moodle 3.9, download_as_dataformat() was deprecated and \core\dataformat::download_data() was introduced.
* This method handles our support for multiple Moodle versions.
*
* @param string $filename The name of the dile to download.
* @param string $exportfile The name of the file to download.
* @param string $dataformat The format of the file.
* @param array $columns The names of the columns.
* @param string $data The data to download.
Expand All @@ -123,7 +123,7 @@ public static function download_data($exportfile, $dataformat, $columns, $data)
* @param string $needle The string we want to find.
* @param string $haystack The string we are searching within.
*/
public static function assertContains($object, $needle, $haystack) {
public static function assertcontains($object, $needle, $haystack) {
global $CFG;

$CFG->branch >= 37 ? $object->assertStringContainsString($needle, $haystack)
Expand All @@ -139,7 +139,7 @@ public static function assertContains($object, $needle, $haystack) {
* @param string $needle The string we want to find.
* @param string $haystack The string we are searching within.
*/
public static function assertNotContains($object, $needle, $haystack) {
public static function assertnotcontains($object, $needle, $haystack) {
global $CFG;

$CFG->branch >= 37 ? $object->assertStringNotContainsString($needle, $haystack)
Expand All @@ -154,7 +154,7 @@ public static function assertNotContains($object, $needle, $haystack) {
* @param object $object The test class object.
* @param string $value The value we are looking for.
*/
public static function assertInternalTypeInt($object, $value) {
public static function assertinternaltypeint($object, $value) {
global $CFG;

$CFG->branch >= 37 ? $object->assertIsInt($value) : $object->assertInternalType("int", $value);
Expand Down
2 changes: 1 addition & 1 deletion version.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

defined('MOODLE_INTERNAL') || die();

$plugin->version = 2020111201;
$plugin->version = 2021011801;
$plugin->release = "v1.2";
$plugin->requires = 2017051500;
$plugin->component = 'plagiarism_turnitinsim';
Expand Down

0 comments on commit f6035b4

Please sign in to comment.