|
|
|
@ -463,50 +463,30 @@ class Compilatio |
|
|
|
/** |
|
|
|
/** |
|
|
|
* Method for display the PomprseuilmankBar (% de plagiat). |
|
|
|
* Method for display the PomprseuilmankBar (% de plagiat). |
|
|
|
* |
|
|
|
* |
|
|
|
* @param $percentagePumping |
|
|
|
* @param $index |
|
|
|
* @param $weakThreshold |
|
|
|
* @param $weakThreshold |
|
|
|
* @param $highThreshold |
|
|
|
* @param $highThreshold |
|
|
|
* @param $chemin_images |
|
|
|
|
|
|
|
* @param $text : array includes the extract from the text |
|
|
|
|
|
|
|
* |
|
|
|
* |
|
|
|
* @return string |
|
|
|
* @return string |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public static function getPomprankBarv31( |
|
|
|
public static function getPomprankBarv31( |
|
|
|
$pourcentagePompage, |
|
|
|
$index, |
|
|
|
$weakThreshold, |
|
|
|
$weakThreshold, |
|
|
|
$highThreshold, |
|
|
|
$highThreshold |
|
|
|
$chemin_images = '', |
|
|
|
|
|
|
|
$texte = '' |
|
|
|
|
|
|
|
) { |
|
|
|
) { |
|
|
|
$pourcentagePompage = round($pourcentagePompage); |
|
|
|
$index = round($index); |
|
|
|
$pour = round((50 * $pourcentagePompage) / 100); |
|
|
|
$pour = round((50 * $index) / 100); |
|
|
|
$return = ''; |
|
|
|
$return = ''; |
|
|
|
if ($pourcentagePompage < $weakThreshold) { |
|
|
|
$class = 'error'; |
|
|
|
$couleur = 'vert'; |
|
|
|
if ($index < $weakThreshold) { |
|
|
|
|
|
|
|
$class = 'success'; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
if ($pourcentagePompage >= $weakThreshold && $pourcentagePompage < $highThreshold) { |
|
|
|
if ($index >= $weakThreshold && $index < $highThreshold) { |
|
|
|
$couleur = 'orange'; |
|
|
|
$class = 'warning'; |
|
|
|
} else { |
|
|
|
|
|
|
|
$couleur = 'rouge'; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
$return .= "<div style='float:left;margin-right:2px;'><img src='" |
|
|
|
|
|
|
|
.$chemin_images."mini-drapeau_$couleur.png' title='" |
|
|
|
$return .= Display::label($index.'% - '.$pour, $class); |
|
|
|
.$texte['result'] |
|
|
|
|
|
|
|
."' alt='faible' width='15' height='15' /></div>"; |
|
|
|
|
|
|
|
$return .= "<div style='float:left; margin-right:5px;width:45px;text-align:right;'>" |
|
|
|
|
|
|
|
.$pourcentagePompage |
|
|
|
|
|
|
|
." %</div>"; |
|
|
|
|
|
|
|
$return .= "<div style='float:left;background:transparent url(" |
|
|
|
|
|
|
|
.$chemin_images |
|
|
|
|
|
|
|
."mini-jauge_fond.png) no-repeat scroll 0;height:12px;margin-top:5px;padding:0 0 0 2px;width:55px;'>"; |
|
|
|
|
|
|
|
$return .= "<div style='float:left;background:transparent url(" |
|
|
|
|
|
|
|
.$chemin_images |
|
|
|
|
|
|
|
."mini-jauge_" |
|
|
|
|
|
|
|
.$couleur |
|
|
|
|
|
|
|
.".png) no-repeat scroll 0;height:12px;width:" |
|
|
|
|
|
|
|
.$pour |
|
|
|
|
|
|
|
."px'></div></div>"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return $return; |
|
|
|
return $return; |
|
|
|
} |
|
|
|
} |
|
|
|
@ -553,7 +533,6 @@ class Compilatio |
|
|
|
{ |
|
|
|
{ |
|
|
|
$documentId = (int) $documentId; |
|
|
|
$documentId = (int) $documentId; |
|
|
|
$courseId = (int) $courseId; |
|
|
|
$courseId = (int) $courseId; |
|
|
|
$compilatioId = (int) $compilatioId; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$table = Database::get_course_table(TABLE_PLAGIARISM); |
|
|
|
$table = Database::get_course_table(TABLE_PLAGIARISM); |
|
|
|
$params = [ |
|
|
|
$params = [ |
|
|
|
@ -565,31 +544,31 @@ class Compilatio |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @param int $itemId |
|
|
|
* @param int $documentId |
|
|
|
* @param int $courseId |
|
|
|
* @param int $courseId |
|
|
|
* |
|
|
|
* |
|
|
|
* @return int |
|
|
|
* @return string md5 value |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public function getCompilatioId($itemId, $courseId) |
|
|
|
public function getCompilatioId($documentId, $courseId) |
|
|
|
{ |
|
|
|
{ |
|
|
|
$itemId = (int) $itemId; |
|
|
|
$documentId = (int) $documentId; |
|
|
|
$courseId = (int) $courseId; |
|
|
|
$courseId = (int) $courseId; |
|
|
|
|
|
|
|
|
|
|
|
$table = Database::get_course_table(TABLE_PLAGIARISM); |
|
|
|
$table = Database::get_course_table(TABLE_PLAGIARISM); |
|
|
|
$sql = "SELECT compilatio_id FROM $table |
|
|
|
$sql = "SELECT compilatio_id FROM $table |
|
|
|
WHERE document_id = $itemId AND c_id= $courseId"; |
|
|
|
WHERE document_id = $documentId AND c_id= $courseId"; |
|
|
|
$compiSqlResult = Database::query($sql); |
|
|
|
$result = Database::query($sql); |
|
|
|
$result = Database::fetch_object($compiSqlResult); |
|
|
|
$result = Database::fetch_object($result); |
|
|
|
|
|
|
|
|
|
|
|
if ($result) { |
|
|
|
if ($result) { |
|
|
|
return (int) $result->compilatio_id; |
|
|
|
return (string) $result->compilatio_id; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return 0; |
|
|
|
return 0; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @param $workId |
|
|
|
* @param int $workId |
|
|
|
* |
|
|
|
* |
|
|
|
* @return string |
|
|
|
* @return string |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@ -624,12 +603,10 @@ class Compilatio |
|
|
|
$actionCompilatio .= self::getPomprankBarv31( |
|
|
|
$actionCompilatio .= self::getPomprankBarv31( |
|
|
|
$soapRes->documentStatus->indice, |
|
|
|
$soapRes->documentStatus->indice, |
|
|
|
10, |
|
|
|
10, |
|
|
|
35, |
|
|
|
35 |
|
|
|
$compilatioImgFolder, |
|
|
|
|
|
|
|
$text |
|
|
|
|
|
|
|
) |
|
|
|
) |
|
|
|
."<br/><a href='".$urlRapport."' target='_blank'>" |
|
|
|
."<br/><a href='".$urlRapport."' target='_blank'>" |
|
|
|
.get_lang('compilatioSeeReport') |
|
|
|
.get_lang('CompilatioAnalysis') |
|
|
|
."</a>"; |
|
|
|
."</a>"; |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 'ANALYSE_PROCESSING': |
|
|
|
case 'ANALYSE_PROCESSING': |
|
|
|
@ -651,11 +628,11 @@ class Compilatio |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 'ANALYSE_IN_QUEUE': |
|
|
|
case 'ANALYSE_IN_QUEUE': |
|
|
|
$loading = Display::returnFontAwesomeIcon('spinner', null, true, 'fa-spin'); |
|
|
|
$loading = Display::returnFontAwesomeIcon('spinner', null, true, 'fa-spin'); |
|
|
|
$actionCompilatio .= $loading.' '.get_lang('compilatioAwaitingAnalysis'); |
|
|
|
$actionCompilatio .= $loading.' '.get_lang('CompilatioAwaitingAnalysis'); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 'BAD_FILETYPE': |
|
|
|
case 'BAD_FILETYPE': |
|
|
|
$actionCompilatio .= get_lang('CompilatioFileIsNotSupported') |
|
|
|
$actionCompilatio .= get_lang('CompilatioFileIsNotSupported') |
|
|
|
."<br/>" |
|
|
|
.'<br/>' |
|
|
|
.get_lang('CompilatioProtectedPdfVerification'); |
|
|
|
.get_lang('CompilatioProtectedPdfVerification'); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 'BAD_FILESIZE': |
|
|
|
case 'BAD_FILESIZE': |
|
|
|
|