@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -require_once(api_get_path(LIBRARY_PATH) . "api.lib.php"); |
|
3 | +require_once(api_get_path(LIBRARY_PATH)."api.lib.php"); |
|
4 | 4 | |
5 | 5 | /*Compilatio's key*/ |
6 | 6 | $compilatioParameter['key'] = api_get_setting("compilatioParamKey"); |
@@ -27,5 +27,5 @@ discard block |
||
27 | 27 | $compilatioParameter['wget_password'] = ""; |
28 | 28 | |
29 | 29 | /*Document's maximum size*/ |
30 | -$compilatioParameter['max_filesize'] = 10000000; // 10Mo |
|
30 | +$compilatioParameter['max_filesize'] = 10000000; // 10Mo |
|
31 | 31 |
@@ -5,10 +5,10 @@ discard block |
||
5 | 5 | |
6 | 6 | if (isset($_GET['workid'])) { |
7 | 7 | $compTable = Database::get_course_table("plagiarism_compilatio_docs"); |
8 | - $workIdList = $_GET['workid']; // list of workid separate by the : |
|
8 | + $workIdList = $_GET['workid']; // list of workid separate by the : |
|
9 | 9 | $result = ""; |
10 | - $tabWorkId = split("a", $workIdList); |
|
11 | - for ($i=0; $i < count($tabWorkId); $i++) { |
|
10 | + $tabWorkId = split("a", $workIdList); |
|
11 | + for ($i = 0; $i < count($tabWorkId); $i++) { |
|
12 | 12 | if (is_numeric($tabWorkId[$i])) { |
13 | 13 | $result .= giveWorkIdState($tabWorkId[$i]); |
14 | 14 | } |
@@ -41,17 +41,17 @@ discard block |
||
41 | 41 | $compi = Database::fetch_object($compiSqlResult); |
42 | 42 | if (isset($compi->compilatio_id)) { |
43 | 43 | $actionCompilatio = ""; |
44 | - if(isMd5($compi->compilatio_id)) { |
|
44 | + if (isMd5($compi->compilatio_id)) { |
|
45 | 45 | // if compilatio_id is a hash md5, we call the function of the compilatio's webservice who return the document's status |
46 | 46 | |
47 | 47 | $soapRes = $compilatio->getDoc($compi->compilatio_id); |
48 | 48 | $status = ''; |
49 | - if(isset($soapRes->documentStatus)) { |
|
49 | + if (isset($soapRes->documentStatus)) { |
|
50 | 50 | $status = $soapRes->documentStatus->status; |
51 | 51 | } |
52 | 52 | } else { |
53 | 53 | // if the compilatio's hash is not a valide hash md5, we return à specific status (cf : IsInCompilatio() ) |
54 | - $status="NOT_IN_COMPILATIO"; |
|
54 | + $status = "NOT_IN_COMPILATIO"; |
|
55 | 55 | $actionCompilatio = "<div style='font-style:italic'>" |
56 | 56 | . get_lang('compilatioDocumentTextNotImage') |
57 | 57 | . "<br/>" |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | $urlRapport = $compilatio->getReportUrl($compi->compilatio_id); |
64 | 64 | $actionCompilatio .= getPomprankBarv31( |
65 | 65 | $soapRes->documentStatus->indice, |
66 | - 10 , |
|
66 | + 10, |
|
67 | 67 | 35, |
68 | 68 | $compilatioImgFolder, |
69 | 69 | $text |
@@ -91,29 +91,29 @@ discard block |
||
91 | 91 | ); |
92 | 92 | } |
93 | 93 | elseif ($status == "ANALYSE_IN_QUEUE") { |
94 | - $actionCompilatio.="<img src='" |
|
94 | + $actionCompilatio .= "<img src='" |
|
95 | 95 | . $compilatioImgFolder |
96 | 96 | . "/ajax-loader2.gif' style='margin-right:10px;' />" |
97 | 97 | . get_lang('compilatioAwaitingAnalysis'); |
98 | 98 | } elseif ($status == "BAD_FILETYPE") { |
99 | - $actionCompilatio.= "<div style='font-style:italic'>" |
|
99 | + $actionCompilatio .= "<div style='font-style:italic'>" |
|
100 | 100 | . get_lang('compilatioFileisnotsupported') |
101 | 101 | . "<br/>" |
102 | 102 | . get_lang('compilatioProtectedPdfVerification') |
103 | 103 | . "</div>"; |
104 | 104 | } elseif ($status == "BAD_FILESIZE") { |
105 | - $actionCompilatio.= "<div style='font-style:italic'>" |
|
105 | + $actionCompilatio .= "<div style='font-style:italic'>" |
|
106 | 106 | . get_lang('compilatioTooHeavyDocument') |
107 | 107 | . "</div>"; |
108 | 108 | } elseif ($status != "NOT_IN_COMPILATIO") { |
109 | - $actionCompilatio.= "<div style='font-style:italic'>" |
|
109 | + $actionCompilatio .= "<div style='font-style:italic'>" |
|
110 | 110 | . get_lang('compilatioMomentarilyUnavailableResult') |
111 | 111 | . " : [ " |
112 | 112 | . $status |
113 | 113 | . "].</div>"; |
114 | 114 | } |
115 | 115 | } |
116 | - $result = $workId . "|" . $actionCompilatio . "|" . $status . "|"; |
|
116 | + $result = $workId."|".$actionCompilatio."|".$status."|"; |
|
117 | 117 | |
118 | 118 | return $result; |
119 | 119 | } |
@@ -89,8 +89,7 @@ |
||
89 | 89 | $compilatioImgFolder, |
90 | 90 | $text |
91 | 91 | ); |
92 | - } |
|
93 | - elseif ($status == "ANALYSE_IN_QUEUE") { |
|
92 | + } elseif ($status == "ANALYSE_IN_QUEUE") { |
|
94 | 93 | $actionCompilatio.="<img src='" |
95 | 94 | . $compilatioImgFolder |
96 | 95 | . "/ajax-loader2.gif' style='margin-right:10px;' />" |