Minor - flint fixes

pull/2970/head
Julio Montoya 6 years ago
parent 106100a53d
commit e13c12ed89
  1. 22
      main/inc/ajax/model.ajax.php
  2. 76
      main/inc/lib/Compilatio.php
  3. 39
      main/plagiarism/compilatio/compiladmin.php
  4. 6
      main/plagiarism/compilatio/upload.php
  5. 2
      main/work/work.lib.php
  6. 24
      main/work/work_list_all.php

@ -1226,8 +1226,8 @@ switch ($action) {
'qualification',
'sent_date',
'qualificator_id',
'correction',
];
'correction',
];
$columns = array_merge($columns, $plagiarismColumns);
$columns[] = 'actions';
} else {
@ -1236,10 +1236,10 @@ switch ($action) {
'title',
'qualification',
'sent_date',
'correction',
'correction',
];
$columns = array_merge($columns, $plagiarismColumns);
$columns[] = 'actions';
$columns[] = 'actions';
}
$whereCondition = " AND $whereCondition ";
@ -1263,10 +1263,10 @@ switch ($action) {
$columns = [
'type', 'firstname', 'lastname', 'title', 'qualification', 'sent_date', 'qualificator_id',
];
$columns = array_merge($columns, $plagiarismColumns);
$columns = array_merge($columns, $plagiarismColumns);
$columns[] = 'actions';
} else {
$columns = array('type', 'firstname', 'lastname', 'title', 'sent_date');
} else {
$columns = ['type', 'firstname', 'lastname', 'title', 'sent_date'];
$columns = array_merge($columns, $plagiarismColumns);
$columns[] = 'actions';
}
@ -1291,15 +1291,15 @@ switch ($action) {
$plagiarismColumns = ['compilatio'];
}
if (isset($_GET['type']) && $_GET['type'] == 'simple') {
$columns = [
'type', 'title', 'qualification', 'sent_date', 'qualificator_id'
$columns = [
'type', 'title', 'qualification', 'sent_date', 'qualificator_id',
];
$columns = array_merge($columns, $plagiarismColumns);
$columns[] = 'actions';
} else {
} else {
$columns = ['type', 'title', 'qualification', 'sent_date'];
$columns = array_merge($columns, $plagiarismColumns);
$columns[] = 'actions';
$columns[] = 'actions';
}
$documents = getAllDocumentToWork($work_id, api_get_course_int_id());

@ -3,12 +3,12 @@
/**
* Build the comunication with the SOAP server Compilatio.net
* call severals methods for the file management in Compilatio.net
* call severals methods for the file management in Compilatio.net.
*
* Date: 26/05/16
*
* @version:1.0
*/
class Compilatio
{
/** Identification key for the Compilatio account*/
@ -25,7 +25,6 @@ class Compilatio
/**
* Compilatio constructor.
*
*/
public function __construct()
{
@ -59,19 +58,19 @@ class Compilatio
$this->key = $key;
if (!empty($urlsoap)) {
if (!empty($proxyHost)) {
$param = array(
$param = [
'trace' => false,
'soap_version' => $soapVersion,
'exceptions' => true,
'proxy_host' => '"'.$proxyHost.'"',
'proxy_port' => $proxyPort,
);
];
} else {
$param = array(
$param = [
'trace' => false,
'soap_version' => $soapVersion,
'exceptions' => true,
);
];
}
$this->soapcli = new SoapClient($urlsoap, $param);
} else {
@ -248,7 +247,7 @@ class Compilatio
}
/**
* Method for the file load
* Method for the file load.
*
* @param $title
* @param $description
@ -266,24 +265,24 @@ class Compilatio
}
$idDocument = $this->soapcli->__call(
'addDocumentBase64',
array(
[
$this->key,
utf8_encode(urlencode($title)),
utf8_encode(urlencode($description)),
utf8_encode(urlencode($filename)),
utf8_encode($mimeType),
base64_encode($content),
)
]
);
return $idDocument;
} catch (SoapFault $fault) {
return ("Erreur sendDoc()".$fault->faultcode." ".$fault->faultstring);
return "Erreur sendDoc()".$fault->faultcode." ".$fault->faultstring;
}
}
/**
* Method for recover a document's information
* Method for recover a document's information.
*
* @param $compiHash
*
@ -293,19 +292,19 @@ class Compilatio
{
try {
if (!is_object($this->soapcli)) {
return ("Error in constructor compilatio() ".$this->soapcli);
return "Error in constructor compilatio() ".$this->soapcli;
}
$param = array($this->key, $compiHash);
$param = [$this->key, $compiHash];
$idDocument = $this->soapcli->__call('getDocument', $param);
return $idDocument;
} catch (SoapFault $fault) {
return ("Erreur getDoc()".$fault->faultcode." ".$fault->faultstring);
return "Erreur getDoc()".$fault->faultcode." ".$fault->faultstring;
}
}
/**
* method for recover an url document's report
* method for recover an url document's report.
*
* @param $compiHash
*
@ -315,19 +314,19 @@ class Compilatio
{
try {
if (!is_object($this->soapcli)) {
return ("Error in constructor compilatio() ".$this->soapcli);
return "Error in constructor compilatio() ".$this->soapcli;
}
$param = array($this->key, $compiHash);
$param = [$this->key, $compiHash];
$idDocument = $this->soapcli->__call('getDocumentReportUrl', $param);
return $idDocument;
} catch (SoapFault $fault) {
return ("Erreur getReportUrl()".$fault->faultcode." ".$fault->faultstring);
return "Erreur getReportUrl()".$fault->faultcode." ".$fault->faultstring;
}
}
/**
* Method for deleting a Compialtio's account document
* Method for deleting a Compialtio's account document.
*
* @param $compiHash
*
@ -337,17 +336,17 @@ class Compilatio
{
try {
if (!is_object($this->soapcli)) {
return ("Error in constructor compilatio() ".$this->soapcli);
return "Error in constructor compilatio() ".$this->soapcli;
}
$param = array($this->key, $compiHash);
$param = [$this->key, $compiHash];
$this->soapcli->__call('deleteDocument', $param);
} catch (SoapFault $fault) {
return ("Erreur deldoc()".$fault->faultcode." ".$fault->faultstring);
return "Erreur deldoc()".$fault->faultcode." ".$fault->faultstring;
}
}
/**
* Method for start the analysis for a document
* Method for start the analysis for a document.
*
* @param $compiHash
*
@ -357,36 +356,37 @@ class Compilatio
{
try {
if (!is_object($this->soapcli)) {
return ("Error in constructor compilatio() ".$this->soapcli);
return "Error in constructor compilatio() ".$this->soapcli;
}
$param = array($this->key, $compiHash);
$param = [$this->key, $compiHash];
$this->soapcli->__call('startDocumentAnalyse', $param);
} catch (SoapFault $fault) {
return ("Erreur startAnalyse()".$fault->faultcode." ".$fault->faultstring);
return "Erreur startAnalyse()".$fault->faultcode." ".$fault->faultstring;
}
}
/**
* Method for recover the account's quota
* Method for recover the account's quota.
*
* @return string
*/
public function getQuotas()
{
try {
if (!is_object($this->soapcli)) {
return ("Error in constructor compilatio() ".$this->soapcli);
return "Error in constructor compilatio() ".$this->soapcli;
}
$param = array($this->key);
$param = [$this->key];
$resultat = $this->soapcli->__call('getAccountQuotas', $param);
return $resultat;
} catch (SoapFault $fault) {
return ("Erreur getQuotas()".$fault->faultcode." ".$fault->faultstring);
return "Erreur getQuotas()".$fault->faultcode." ".$fault->faultstring;
}
}
/**
* Method for identify a file extension and the possibility that the document can be managed by Compilatio
* Method for identify a file extension and the possibility that the document can be managed by Compilatio.
*
* @param $filename
*
@ -402,12 +402,12 @@ class Compilatio
}
/**
* Fonction affichage de la barre de progression d'analyse version 3.1
* Fonction affichage de la barre de progression d'analyse version 3.1.
*
* @param string $status From the document
* @param $pour
* @param string $imagesPath
* @param array $text Array includes the extract from the text
* @param array $text Array includes the extract from the text
*
* @return string
*/
@ -461,7 +461,7 @@ class Compilatio
}
/**
* Method for display the PomprseuilmankBar (% de plagiat)
* Method for display the PomprseuilmankBar (% de plagiat).
*
* @param $percentagePumping
* @param $weakThreshold
@ -512,11 +512,11 @@ class Compilatio
}
/**
* Method for validation of hash
* Method for validation of hash.
*
* @param string $hash
*
* @return bool
*
*/
public static function isMd5($hash)
{
@ -524,7 +524,7 @@ class Compilatio
}
/**
* function for delete a document of the compilatio table if plagiarismTool is Compilatio
* function for delete a document of the compilatio table if plagiarismTool is Compilatio.
*
* @param int $courseId
* @param int $itemId

@ -26,39 +26,38 @@ echo "<b>"
?>
<br><br>
<?
if (!isset($_GET['action']))
{
?>
<?php
if (!isset($_GET['action'])) {
?>
<body style="margin:0px;padding:0px">
<form style="margin:0px;" method="GET">
<input type="submit" name="action" value="Test de Connexion SOAP">
</form>
<?
<?php
} else {
echo get_lang('compilatioConnectionTestSoap')."<br>";
echo "1) ".get_lang('compilatioServerConnection')."<br>";
$compilatio = new Compilatio();
if ($compilatio) {
echo get_lang('compilatioConnectionAccomplished')."<br>";
echo "2) ".get_lang('compilatioSendTextToServer')."<br>";
$text = get_lang('compilatioTestSendText').$compilatio->getKey();
$id_compi = $compilatio->SendDoc(
echo get_lang('compilatioConnectionTestSoap')."<br>";
echo "1) ".get_lang('compilatioServerConnection')."<br>";
$compilatio = new Compilatio();
if ($compilatio) {
echo get_lang('compilatioConnectionAccomplished')."<br>";
echo "2) ".get_lang('compilatioSendTextToServer')."<br>";
$text = get_lang('compilatioTestSendText').$compilatio->getKey();
$id_compi = $compilatio->SendDoc(
'Doc de test',
'test',
'test',
'text/plain',
$text
);
if (Compilatio::isMd5($id_compi)) {
echo get_lang('compilatioSuccessfulTransfer')."<br>";
if (Compilatio::isMd5($id_compi)) {
echo get_lang('compilatioSuccessfulTransfer')."<br>";
} else {
echo get_lang('compilatioFailedTransfer')."<br>";
}
} else {
echo get_lang('compilatioFailedTransfer')."<br>";
echo get_lang('compilatioNotConnection')."<br>";
echo get_lang('compilatioParamVerification')."<br>";
}
} else {
echo get_lang('compilatioNotConnection')."<br>";
echo get_lang('compilatioParamVerification')."<br>";
}
}
?>
</body>

@ -31,7 +31,7 @@ if (isset($_REQUEST['type']) && $_REQUEST['type'] === 'multi') {
/**
* File problem in the url field that no longer have the file extension,
* Compilatio's server refuse the files
* we renames in the FS and the database with the file extension that is found in the title field
* we renames in the FS and the database with the file extension that is found in the title field.
*/
compilatioUpdateWorkDocument($documentId, $courseId);
@ -87,7 +87,7 @@ if (isset($_REQUEST['type']) && $_REQUEST['type'] === 'multi') {
}
}
} else {
$documentId = isset($_GET['doc']) ? $_GET['doc']: 0;
$documentId = isset($_GET['doc']) ? $_GET['doc'] : 0;
sendDocument($documentId, $courseInfo);
}
@ -137,7 +137,7 @@ function sendDocument($documentId, $courseInfo)
}
/**
* function for show and recovery the extension from a file
* function for show and recovery the extension from a file.
*
* @param $docId
* @param $courseId

@ -2260,7 +2260,7 @@ function get_work_user_list(
}
$work['compilatio'] = $actionCompilatio;
}
$works[] = $work;
$works[] = $work;
}
}

@ -216,13 +216,13 @@ if ($allowAntiPlagiarism) {
$plagiarismListJqgridColumn = ['Compilatio'];
$plagiarismListJqgridLine = [
[
'name'=>'compilatio',
'index'=>'compilatio',
'width'=>'40',
'align'=>'left',
'name' => 'compilatio',
'index' => 'compilatio',
'width' => '40',
'align' => 'left',
'search' => 'false',
'sortable'=>'false'
]
'sortable' => 'false',
],
];
}
@ -250,7 +250,7 @@ if (!empty($work_data['enable_qualification']) &&
get_lang('Score'),
get_lang('Date'),
get_lang('Status'),
get_lang('UploadCorrection'),
get_lang('UploadCorrection'),
];
$columns = array_merge($columns, $plagiarismListJqgridColumn);
$columns[] = get_lang('Actions');
@ -539,9 +539,7 @@ if ($allowAntiPlagiarism) {
if (in_array($data['id'], $listCompilatioDocId)) {
$javascriptWorkId .= $data['id'].'a';
}
}
?>
} ?>
<!--
Lets display the javascript AJAX tools for refreshing datas that needed to be refreshed
Only document with state ANALYSE_IN_QUEUE or ANALYSE_PROCESSING need to ask server
@ -554,9 +552,9 @@ if ($allowAntiPlagiarism) {
var analyseProcessing = "ANALYSE_PROCESSING";
var analyseInQueue = "ANALYSE_IN_QUEUE";
var refreshDelaisAfter = 30000;
var allWorkId = "<?php echo $javascriptWorkId ?>";
var allWorkId = "<?php echo $javascriptWorkId; ?>";
var workFolderId = "<?php echo $workId; ?>";
var compilationWebUrl = "<?php echo api_get_path(WEB_CODE_PATH).'plagiarism/compilatio/' ?>";
var compilationWebUrl = "<?php echo api_get_path(WEB_CODE_PATH).'plagiarism/compilatio/'; ?>";
var divExisteTimer = null;
var msgWaitJS = '<?php echo Display::return_message(get_lang('PleaseWaitThisCouldTakeAWhile')); ?>';
var div = document.createElement('div');
@ -695,7 +693,7 @@ if ($allowAntiPlagiarism) {
type: "get",
dataType: "html",
error: function () {
showData("<?php echo get_lang('CompilatioComunicationAjaxImpossible');?>");
showData("<?php echo get_lang('CompilatioComunicationAjaxImpossible'); ?>");
},
success: function (strData) {
showData(strData);

Loading…
Cancel
Save