Skip to content

Commit

Permalink
#3 Prepare for add of fetch folder list op to dependent library
Browse files Browse the repository at this point in the history
  • Loading branch information
asmecher committed Dec 8, 2018
1 parent c458456 commit cd4096d
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 31 deletions.
24 changes: 14 additions & 10 deletions PlagiarismPlugin.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,21 +80,25 @@ public function callback($hookName, $args) {
if (!($groupId = array_search($contextName, $groupList))) {
// No folder group found for the context; create one.
$groupId = $ithenticate->createGroup($contextName);
if (!$groupId) {
if (!$groupId) {
error_log('Could not create folder group for context ' . $contextName . ' on iThenticate.');
return false;
}
}

// Create a folder for this submission.
if (!($folderId = $ithenticate->createFolder(
'Submission_' . $submission->getId(),
'Submission_' . $submission->getId() . ': ' . $submission->getLocalizedTitle($submission->getLocale()),
$groupId,
1
))) {
error_log('Could not create folder for submission ID ' . $submission->getId() . ' on iThenticate.');
return false;
$folderName = 'Submission_' . $submission->getId();
$folderList = $ithenticate->fetchFolderList();
if (!($folderId = array_search($folderName, $folderList))) {
// Create a folder for this submission.
if (!($folderId = $ithenticate->createFolder(
$folderName,
'Submission_' . $submission->getId() . ': ' . $submission->getLocalizedTitle($submission->getLocale()),
$groupId,
1
))) {
error_log('Could not create folder for submission ID ' . $submission->getId() . ' on iThenticate.');
return false;
}
}

$submissionFileDao = DAORegistry::getDAO('SubmissionFileDAO');
Expand Down
8 changes: 1 addition & 7 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/asmecher/ithenticate"
}
],
"require": {
"bsobbe/ithenticate": "dev-add_folder_group_ops"
"bsobbe/ithenticate": "*"
}
}
24 changes: 10 additions & 14 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit cd4096d

Please sign in to comment.