@@ -182,10 +182,11 @@ |
||
| 182 | 182 | echo "<td style='padding-left : 40px;' valign='top'>" . $beautifulDateTime . "</td>"; |
| 183 | 183 | echo"</tr>"; |
| 184 | 184 | // $limit is used to select only results between $results[$j] (current login) and next one |
| 185 | - if ($j == ( sizeof($results) - 1 )) |
|
| 186 | - $limit = date("Y-m-d H:i:s", $nextReqDate); |
|
| 187 | - else |
|
| 188 | - $limit = $results[$j + 1]; |
|
| 185 | + if ($j == ( sizeof($results) - 1 )) { |
|
| 186 | + $limit = date("Y-m-d H:i:s", $nextReqDate); |
|
| 187 | + } else { |
|
| 188 | + $limit = $results[$j + 1]; |
|
| 189 | + } |
|
| 189 | 190 | // select all access to tool between displayed date and next displayed date or now() if |
| 190 | 191 | // displayed date is the last login date |
| 191 | 192 | $sql = "SELECT access_tool, count(access_tool) |
@@ -38,20 +38,27 @@ discard block |
||
| 38 | 38 | |
| 39 | 39 | $view = $_REQUEST['view']; |
| 40 | 40 | |
| 41 | -if ($view == "0000001") |
|
| 41 | +if ($view == "0000001") { |
|
| 42 | 42 | $nameTools = get_lang('SynthesisView'); |
| 43 | -if ($view == "1000000") |
|
| 43 | +} |
|
| 44 | +if ($view == "1000000") { |
|
| 44 | 45 | $nameTools = get_lang('CourseStats'); |
| 45 | -if ($view == "0100000") |
|
| 46 | +} |
|
| 47 | +if ($view == "0100000") { |
|
| 46 | 48 | $nameTools = get_lang('CourseAccess'); |
| 47 | -if ($view == "0010000") |
|
| 49 | +} |
|
| 50 | +if ($view == "0010000") { |
|
| 48 | 51 | $nameTools = get_lang('ToolsAccess'); |
| 49 | -if ($view == "0001000") |
|
| 52 | +} |
|
| 53 | +if ($view == "0001000") { |
|
| 50 | 54 | $nameTools = get_lang('LinksAccess'); |
| 51 | -if ($view == "0000100") |
|
| 55 | +} |
|
| 56 | +if ($view == "0000100") { |
|
| 52 | 57 | $nameTools = get_lang('DocumentsAccess'); |
| 53 | -if ($view == "00000010") |
|
| 58 | +} |
|
| 59 | +if ($view == "00000010") { |
|
| 54 | 60 | $nameTools = get_lang('ScormAccess'); |
| 61 | +} |
|
| 55 | 62 | |
| 56 | 63 | $interbreadcrumb[] = array("url" => api_get_self() . "?view=0000000", "name" => get_lang('ToolName')); |
| 57 | 64 | |
@@ -79,8 +86,9 @@ discard block |
||
| 79 | 86 | </div><br> |
| 80 | 87 | "; */ |
| 81 | 88 | |
| 82 | - if (!isset($view)) |
|
| 83 | - $view = "0000000"; |
|
| 89 | + if (!isset($view)) { |
|
| 90 | + $view = "0000000"; |
|
| 91 | + } |
|
| 84 | 92 | |
| 85 | 93 | |
| 86 | 94 | /* Reporting */ |
@@ -47,8 +47,16 @@ |
||
| 47 | 47 | $form->addElement('select', 'session_id', get_lang('Sessions'), $my_session_list); |
| 48 | 48 | $form->addButtonFilter(get_lang('Filter')); |
| 49 | 49 | |
| 50 | -if (!empty($_REQUEST['score'])) $filter_score = intval($_REQUEST['score']); else $filter_score = 70; |
|
| 51 | -if (!empty($_REQUEST['session_id'])) $session_id = intval($_REQUEST['session_id']); else $session_id = 0; |
|
| 50 | +if (!empty($_REQUEST['score'])) { |
|
| 51 | + $filter_score = intval($_REQUEST['score']); |
|
| 52 | +} else { |
|
| 53 | + $filter_score = 70; |
|
| 54 | +} |
|
| 55 | +if (!empty($_REQUEST['session_id'])) { |
|
| 56 | + $session_id = intval($_REQUEST['session_id']); |
|
| 57 | +} else { |
|
| 58 | + $session_id = 0; |
|
| 59 | +} |
|
| 52 | 60 | |
| 53 | 61 | if (empty($session_id)) { |
| 54 | 62 | $session_id = key($my_session_list); |
@@ -445,7 +445,10 @@ |
||
| 445 | 445 | } |
| 446 | 446 | } |
| 447 | 447 | ?> |
| 448 | - <input type="hidden" name="updatePath" value="<?php if (!$badUpdatePath) echo api_htmlentities($proposedUpdatePath, ENT_QUOTES); ?>" /> |
|
| 448 | + <input type="hidden" name="updatePath" value="<?php if (!$badUpdatePath) { |
|
| 449 | + echo api_htmlentities($proposedUpdatePath, ENT_QUOTES); |
|
| 450 | +} |
|
| 451 | +?>" /> |
|
| 449 | 452 | <input type="hidden" name="urlAppendPath" value="<?php echo api_htmlentities($urlAppendPath, ENT_QUOTES); ?>" /> |
| 450 | 453 | <input type="hidden" name="pathForm" value="<?php echo api_htmlentities($pathForm, ENT_QUOTES); ?>" /> |
| 451 | 454 | <input type="hidden" name="urlForm" value="<?php echo api_htmlentities($urlForm, ENT_QUOTES); ?>" /> |
@@ -149,8 +149,7 @@ discard block |
||
| 149 | 149 | <?php |
| 150 | 150 | if ($session['access_start_date'] == '00-00-0000' && $session['access_end_date']== '00-00-0000' ) { |
| 151 | 151 | echo get_lang('NoTimeLimits'); |
| 152 | - } |
|
| 153 | - else { |
|
| 152 | + } else { |
|
| 154 | 153 | if ($session['access_start_date'] != '00-00-0000') { |
| 155 | 154 | //$session['date_start'] = Display::tag('i', get_lang('NoTimeLimits')); |
| 156 | 155 | $session['access_start_date'] = get_lang('From').' '.$session['access_start_date']; |
@@ -189,12 +188,18 @@ discard block |
||
| 189 | 188 | <?php echo api_ucfirst(get_lang('SessionVisibility')) ?> : |
| 190 | 189 | </td> |
| 191 | 190 | <td> |
| 192 | - <?php if ($session['visibility']==1) echo get_lang('ReadOnly'); elseif($session['visibility']==2) echo get_lang('Visible');elseif($session['visibility']==3) echo api_ucfirst(get_lang('Invisible')) ?> |
|
| 191 | + <?php if ($session['visibility']==1) { |
|
| 192 | + echo get_lang('ReadOnly'); |
|
| 193 | +} elseif($session['visibility']==2) { |
|
| 194 | + echo get_lang('Visible'); |
|
| 195 | +} elseif($session['visibility']==3) { |
|
| 196 | + echo api_ucfirst(get_lang('Invisible')) ?> |
|
| 193 | 197 | </td> |
| 194 | 198 | </tr> |
| 195 | 199 | <?php |
| 196 | 200 | |
| 197 | 201 | $multiple_url_is_on = api_get_multiple_access_url(); |
| 202 | +} |
|
| 198 | 203 | if ($multiple_url_is_on) { |
| 199 | 204 | echo '<tr><td>'; |
| 200 | 205 | echo 'URL'; |
@@ -76,7 +76,9 @@ |
||
| 76 | 76 | |
| 77 | 77 | foreach($this->getItems() as $item) { |
| 78 | 78 | /** @var $item MenuItemInterface */ |
| 79 | - if($item->isActive()) return $item; |
|
| 79 | + if($item->isActive()) { |
|
| 80 | + return $item; |
|
| 81 | + } |
|
| 80 | 82 | } |
| 81 | 83 | return null; |
| 82 | 84 | } |
@@ -434,8 +434,7 @@ |
||
| 434 | 434 | } else { |
| 435 | 435 | echo $question->options[2]; |
| 436 | 436 | } |
| 437 | - } |
|
| 438 | - else { |
|
| 437 | + } else { |
|
| 439 | 438 | echo '-'; |
| 440 | 439 | } |
| 441 | 440 | ?> |
@@ -15,9 +15,10 @@ discard block |
||
| 15 | 15 | // load templates |
| 16 | 16 | function reports_loadTemplates() { |
| 17 | 17 | global $reports_enabled_templates, $reports_template; |
| 18 | - foreach ($reports_enabled_templates as $t) |
|
| 19 | - require_once 'templates/'.$t.'.reports.php'; |
|
| 20 | -} |
|
| 18 | + foreach ($reports_enabled_templates as $t) { |
|
| 19 | + require_once 'templates/'.$t.'.reports.php'; |
|
| 20 | + } |
|
| 21 | + } |
|
| 21 | 22 | |
| 22 | 23 | |
| 23 | 24 | // clear all reporting data |
@@ -150,11 +151,12 @@ discard block |
||
| 150 | 151 | // return tools ID (parametre is a constant from main_api |
| 151 | 152 | function reports_getToolId($tool) { |
| 152 | 153 | $tools = array_flip(api_get_tools_lists()); |
| 153 | - if (array_key_exists($tool, $tools)) |
|
| 154 | - return $tools[$tool]; |
|
| 155 | - else |
|
| 156 | - return null; |
|
| 157 | -} |
|
| 154 | + if (array_key_exists($tool, $tools)) { |
|
| 155 | + return $tools[$tool]; |
|
| 156 | + } else { |
|
| 157 | + return null; |
|
| 158 | + } |
|
| 159 | + } |
|
| 158 | 160 | |
| 159 | 161 | // return a sql clause returning triplet of (course, $session, $uid) the |
| 160 | 162 | // current user is authorized to reed |
@@ -65,8 +65,10 @@ discard block |
||
| 65 | 65 | $bords = array_fill(0, $bord_lenght, array()); // building this array |
| 66 | 66 | |
| 67 | 67 | /* adding the first point of the polygone */ |
| 68 | - if (is_array($bords[$poly[0]['y']])) //avoid warning |
|
| 68 | + if (is_array($bords[$poly[0]['y']])) { |
|
| 69 | + //avoid warning |
|
| 69 | 70 | array_push($bords[$poly[0]['y']], $poly[0]['x']); |
| 71 | + } |
|
| 70 | 72 | |
| 71 | 73 | $i = 1; // we re-use $i and $old_pente bellow the loop |
| 72 | 74 | $old_pente=0; |
@@ -75,11 +77,14 @@ discard block |
||
| 75 | 77 | |
| 76 | 78 | /* special cases */ |
| 77 | 79 | if ($poly[$i-1]['y'] == $poly[$i]['y']) { |
| 78 | - if ($poly[$i-1]['x'] == $poly[$i]['x']) |
|
| 79 | - continue; // twice the same point |
|
| 80 | + if ($poly[$i-1]['x'] == $poly[$i]['x']) { |
|
| 81 | + continue; |
|
| 82 | + } |
|
| 83 | + // twice the same point |
|
| 80 | 84 | else { // infinite elevation of the edge |
| 81 | - if (is_array($bords[$poly[$i]['y']])) |
|
| 82 | - array_push($bords[$poly[$i]['y']],$poly[$i]['x']); |
|
| 85 | + if (is_array($bords[$poly[$i]['y']])) { |
|
| 86 | + array_push($bords[$poly[$i]['y']],$poly[$i]['x']); |
|
| 87 | + } |
|
| 83 | 88 | $old_pente=0; |
| 84 | 89 | continue; |
| 85 | 90 | } |
@@ -87,9 +92,13 @@ discard block |
||
| 87 | 92 | |
| 88 | 93 | //echo 'point:'.$poly[$i]['y']; bug here |
| 89 | 94 | // adding the point as a part of an edge |
| 90 | - if (is_array($bords[$poly[$i]['y']])) //avoid warning |
|
| 95 | + if (is_array($bords[$poly[$i]['y']])) { |
|
| 96 | + //avoid warning |
|
| 91 | 97 | array_push($bords[$poly[$i]['y']], $poly[$i]['x']); |
| 92 | - if (DEBUG) echo '('.$poly[$i]['x'].';'.$poly[$i]['y'].') '; |
|
| 98 | + } |
|
| 99 | + if (DEBUG) { |
|
| 100 | + echo '('.$poly[$i]['x'].';'.$poly[$i]['y'].') '; |
|
| 101 | + } |
|
| 93 | 102 | |
| 94 | 103 | /* computing the elevation of the edge going */ |
| 95 | 104 | // from $poly[$i-1] to $poly[$i] |
@@ -99,15 +108,17 @@ discard block |
||
| 99 | 108 | // if the sign of the elevation change from the one of the |
| 100 | 109 | // previous edge, the point must be added a second time inside |
| 101 | 110 | // $bords |
| 102 | - if ($i>1) |
|
| 103 | - if (($old_pente<0 && $pente>0) |
|
| 111 | + if ($i>1) { |
|
| 112 | + if (($old_pente<0 && $pente>0) |
|
| 104 | 113 | || ($old_pente>0 && $pente<0)) { |
| 105 | 114 | if (is_array($bords[$poly[$i]['y']])) //avoid warning |
| 106 | 115 | array_push($bords[$poly[$i]['y']],$poly[$i]['x']); |
| 116 | + } |
|
| 107 | 117 | |
| 108 | - if (DEBUG) |
|
| 109 | - echo '*('.$poly[$i]['x']. |
|
| 118 | + if (DEBUG) { |
|
| 119 | + echo '*('.$poly[$i]['x']. |
|
| 110 | 120 | ';'.$poly[$i]['y'].') '; |
| 121 | + } |
|
| 111 | 122 | } |
| 112 | 123 | |
| 113 | 124 | /* detect the direction of the elevation in Y */ |
@@ -136,10 +147,11 @@ discard block |
||
| 136 | 147 | |
| 137 | 148 | // elevation between $poly[0]['x'] and $poly[1]['x']) |
| 138 | 149 | $rest = $poly[0]['y']-$poly[1]['y']; |
| 139 | - if ($rest!=0) |
|
| 140 | - $pente1 = ($poly[0]['x']-$poly[1]['x'])/($rest); |
|
| 141 | - else |
|
| 142 | - $pente1 = 0; |
|
| 150 | + if ($rest!=0) { |
|
| 151 | + $pente1 = ($poly[0]['x']-$poly[1]['x'])/($rest); |
|
| 152 | + } else { |
|
| 153 | + $pente1 = 0; |
|
| 154 | + } |
|
| 143 | 155 | |
| 144 | 156 | // elevation between $poly[$i-1]['x'] and $poly[0]['x']) |
| 145 | 157 | $pente = ($poly[$i-1]['x']-$poly[0]['x'])/ |
@@ -151,14 +163,17 @@ discard block |
||
| 151 | 163 | |
| 152 | 164 | // doubling the first point if needed (see above) |
| 153 | 165 | if (($pente1<0 && $pente>0) || ($pente1>0 && $pente<0)) { |
| 154 | - if (is_array($bords[$poly[$i - 1]['y']])) |
|
| 155 | - array_push($bords[$poly[$i - 1]['y']], round($poly[$i - 1]['x'])); |
|
| 166 | + if (is_array($bords[$poly[$i - 1]['y']])) { |
|
| 167 | + array_push($bords[$poly[$i - 1]['y']], round($poly[$i - 1]['x'])); |
|
| 168 | + } |
|
| 156 | 169 | //if (DEBUG) echo '('.$poly[$i-1]['x'].';'.$poly[$i-1]['y'].') '; |
| 157 | 170 | } |
| 158 | 171 | // doubling the last point if neededd |
| 159 | 172 | if (($old_pente<0 && $pente>0) || ($old_pente>0 && $pente<0)) { |
| 160 | - if (is_array($bords[$poly[$i-1]['y']])) //avoid warning |
|
| 173 | + if (is_array($bords[$poly[$i-1]['y']])) { |
|
| 174 | + //avoid warning |
|
| 161 | 175 | array_push($bords[$poly[$i-1]['y']], round($poly[$i-1]['x'])); |
| 176 | + } |
|
| 162 | 177 | //if (DEBUG) echo '*('.$poly[$i-1]['x'].';'.$poly[$i-1]['y'].') '; |
| 163 | 178 | } |
| 164 | 179 | |
@@ -227,11 +242,13 @@ discard block |
||
| 227 | 242 | $s = "<div style='font-size: 8px; line-height:3px'><pre>\n"; |
| 228 | 243 | } |
| 229 | 244 | for ($i=0; $i<$max['y']; $i++) { |
| 230 | - for($j=0; $j<$max['x']; $j++) |
|
| 231 | - if($poly[$j][$i] == TRUE) |
|
| 245 | + for($j=0; $j<$max['x']; $j++) { |
|
| 246 | + if($poly[$j][$i] == TRUE) |
|
| 232 | 247 | $s .= ($format=='html'?"<b>1</b>":'1'); |
| 233 | - else |
|
| 234 | - $s .= "0"; |
|
| 248 | + } |
|
| 249 | + else { |
|
| 250 | + $s .= "0"; |
|
| 251 | + } |
|
| 235 | 252 | $s .= ($format=='html'?"<br />\n":"\n"); |
| 236 | 253 | } |
| 237 | 254 | $s .= ($format=='html'?"</pre></div>\n":"\n"); |
@@ -252,15 +269,19 @@ discard block |
||
| 252 | 269 | $surfaceOf1 = 0; |
| 253 | 270 | $surfaceOf2 = 0; |
| 254 | 271 | |
| 255 | - for ($i=0; $i<$max['x']; $i++) |
|
| 256 | - for($j=0; $j<$max['y']; $j++) { |
|
| 272 | + for ($i=0; $i<$max['x']; $i++) { |
|
| 273 | + for($j=0; |
|
| 274 | + } |
|
| 275 | + $j<$max['y']; $j++) { |
|
| 257 | 276 | if (isset($poly1[$i][$j]) && ($poly1[$i][$j] == TRUE)) { |
| 258 | 277 | $surfaceOf1++; |
| 259 | - if (isset($poly2[$i][$j]) && ($poly2[$i][$j] == FALSE)) |
|
| 260 | - $onlyIn1++; |
|
| 278 | + if (isset($poly2[$i][$j]) && ($poly2[$i][$j] == FALSE)) { |
|
| 279 | + $onlyIn1++; |
|
| 280 | + } |
|
| 281 | + } |
|
| 282 | + if (isset($poly2[$i][$j]) && ($poly2[$i][$j] == TRUE)) { |
|
| 283 | + $surfaceOf2++; |
|
| 261 | 284 | } |
| 262 | - if (isset($poly2[$i][$j]) && ($poly2[$i][$j] == TRUE)) |
|
| 263 | - $surfaceOf2++; |
|
| 264 | 285 | } |
| 265 | 286 | |
| 266 | 287 | return array ( |