Skip to content

Commit

Permalink
Merge pull request #36 from turnitin/develop
Browse files Browse the repository at this point in the history
Release v2017041701
  • Loading branch information
dwinn authored Apr 17, 2020
2 parents 2194cae + 62117c2 commit b838744
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 9 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.idea/*
tests/behat
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
### Date: 2020-April-17
### Release: v2020041701

#### :wrench: Fixes and enhancements

---

#### Plugin successfully installs via zip file.

We have fixed an issue where the plugin may not install if downloaded from the Moodle plugin directory due to it containing an empty behat directory.

---

### Date: 2020-April-15
### Release: v2020041501

Expand Down
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,17 @@ To configure the plugin go to `"Site administration" > "Plugins" > "Plagiarism"

Testing
-
This plugin contains a full suite of PHPUnit and behat tests which can be run against your moodle installation.
This plugin contains a full suite of PHPUnit tests which can be run against your Moodle installation.

Provided your environment is already configured to run PHPUnit tests, then run the following command from the Moodle root directory:

`vendor/bin/phpunit --testsuite plagiarism_turnitinsim_testsuite`

Provided your environment is already configured to run Behat tests, then run the following command from the Moodle root directory:
Provided your environment is already configured to run Behat tests, you can download and install our behat tests from their repository by running the following command from the plugin root directory:

`git clone https://github.com/turnitin/moodle-plagiarism-turnitinsim-behat.git tests/behat`

Then run the following command from the Moodle root directory:

`php admin/tool/behat/cli/run.php --tags=@plagiarism_turnitinsim`

Expand Down
3 changes: 2 additions & 1 deletion classes/submission.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,8 @@ public function handle_similarity_response($params) {

break;
default:
// File contents have been uploaded and the submission is being processed. TURNITINSIM_SUBMISSION_STATUS_PROCESSING.
// File contents have been uploaded and the submission is being processed.
// Status of TURNITINSIM_SUBMISSION_STATUS_PROCESSING.
// Or get_submission_info() returns no response. Allow another try in an hour.
$this->settiiattempts($this->gettiiattempts() + 1);
$this->settiiretrytime(time() + ($this->gettiiattempts() * TURNITINSIM_REPORT_GEN_RETRY_WAIT_SECONDS));
Expand Down
7 changes: 6 additions & 1 deletion classes/task.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,12 @@ public function send_queued_submissions() {
// Get Submissions to send.
$submissions = $DB->get_records_select('plagiarism_turnitinsim_sub',
'(status = ? OR status = ?) AND tiiattempts < ? AND tiiretrytime < ?',
array(TURNITINSIM_SUBMISSION_STATUS_QUEUED, TURNITINSIM_SUBMISSION_STATUS_CREATED, TURNITINSIM_SUBMISSION_MAX_SEND_ATTEMPTS, time()),
array(
TURNITINSIM_SUBMISSION_STATUS_QUEUED,
TURNITINSIM_SUBMISSION_STATUS_CREATED,
TURNITINSIM_SUBMISSION_MAX_SEND_ATTEMPTS,
time()
),
'', '*', 0,
TURNITINSIM_SUBMISSION_SEND_LIMIT);

Expand Down
1 change: 0 additions & 1 deletion tests/behat
Submodule behat deleted from 264dce
15 changes: 15 additions & 0 deletions tests/classes/tssubmission_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -1692,6 +1692,9 @@ public function test_similarity_overrides_are_false() {
$this->assertFalse($overrides['view_settings']['save_changes']);
}

/**
* Test that the similarity response status sets correct values if status is COMPLETE.
*/
public function test_handle_similarity_response_status_sets_correct_values_if_status_is_complete() {
global $DB;

Expand Down Expand Up @@ -1720,6 +1723,9 @@ public function test_handle_similarity_response_status_sets_correct_values_if_st
$this->assertEquals(50, $record->overallscore);
}

/**
* Test that the similarity response status sets correct values if status is CREATED.
*/
public function test_handle_similarity_response_status_sets_correct_values_if_status_is_created() {
global $DB;

Expand Down Expand Up @@ -1761,6 +1767,9 @@ public function test_handle_similarity_response_status_sets_correct_values_if_st
$this->assertEquals(self::TEST_ERROR_MESSAGE_2, $record->errormessage);
}

/**
* Test that the similarity response status sets correct values if status is ERROR.
*/
public function test_handle_similarity_response_status_sets_correct_values_if_status_is_error() {
global $DB;

Expand Down Expand Up @@ -1802,6 +1811,9 @@ public function test_handle_similarity_response_status_sets_correct_values_if_st
$this->assertEquals(self::TEST_ERROR_MESSAGE_1, $record->errormessage);
}

/**
* Test that the similarity response status sets correct values if status is PROCESSING.
*/
public function test_handle_similarity_response_status_sets_correct_values_if_status_is_processing() {
global $DB;

Expand Down Expand Up @@ -1841,6 +1853,9 @@ public function test_handle_similarity_response_status_sets_correct_values_if_st
$this->assertGreaterThan(time(), $record->tiiretrytime);
}

/**
* Test that the similarity response status sets correct values if the request fails.
*/
public function test_handle_similarity_response_status_sets_correct_values_if_request_fails() {
global $DB;

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 = 2020041501;
$plugin->version = 2020041701;
$plugin->release = "v1.1";
$plugin->requires = 2017051500;
$plugin->component = 'plagiarism_turnitinsim';
Expand Down

0 comments on commit b838744

Please sign in to comment.