@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | /** |
15 | 15 | * constructor of the class |
16 | 16 | */ |
17 | - public function __construct($get_questions=false,$get_answers=false) |
|
17 | + public function __construct($get_questions = false, $get_answers = false) |
|
18 | 18 | { |
19 | 19 | } |
20 | 20 | |
@@ -36,21 +36,21 @@ discard block |
||
36 | 36 | //titles |
37 | 37 | |
38 | 38 | foreach ($dato[0] as $header_col) { |
39 | - if(!empty($header_col)) { |
|
40 | - $data .= str_replace("\r\n",' ',api_html_entity_decode(strip_tags($header_col))).';'; |
|
39 | + if (!empty($header_col)) { |
|
40 | + $data .= str_replace("\r\n", ' ', api_html_entity_decode(strip_tags($header_col))).';'; |
|
41 | 41 | } |
42 | 42 | } |
43 | 43 | |
44 | - $data .="\r\n"; |
|
44 | + $data .= "\r\n"; |
|
45 | 45 | $cant_students = count($dato[1]); |
46 | 46 | //print_r($data); exit(); |
47 | 47 | |
48 | - for($i=0;$i<$cant_students;$i++) { |
|
48 | + for ($i = 0; $i < $cant_students; $i++) { |
|
49 | 49 | $column = 0; |
50 | - foreach($dato[1][$i] as $col_name) { |
|
51 | - $data .= str_replace("\r\n",' ',api_html_entity_decode(strip_tags($col_name))).';'; |
|
50 | + foreach ($dato[1][$i] as $col_name) { |
|
51 | + $data .= str_replace("\r\n", ' ', api_html_entity_decode(strip_tags($col_name))).';'; |
|
52 | 52 | } |
53 | - $data .="\r\n"; |
|
53 | + $data .= "\r\n"; |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | //output the results |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | for ($i = 0; $i < $cant_students; $i++) { |
102 | 102 | $column = 0; |
103 | 103 | foreach ($data[1][$i] as $col_name) { |
104 | - $worksheet->SetCellValueByColumnAndRow($line,$column, html_entity_decode(strip_tags($col_name))); |
|
104 | + $worksheet->SetCellValueByColumnAndRow($line, $column, html_entity_decode(strip_tags($col_name))); |
|
105 | 105 | $column++; |
106 | 106 | } |
107 | 107 | $line++; |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | */ |
122 | 122 | public function exportCompleteReportDOC($data) |
123 | 123 | { |
124 | - $filename = 'gradebook_results_'.api_get_local_time() . '.docx'; |
|
124 | + $filename = 'gradebook_results_'.api_get_local_time().'.docx'; |
|
125 | 125 | |
126 | 126 | $doc = new \PhpOffice\PhpWord\PhpWord(); |
127 | 127 | $section = $doc->addSection(['orientation' => 'landscape']); |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | } |
141 | 141 | } |
142 | 142 | |
143 | - $file = api_get_path(SYS_ARCHIVE_PATH) . api_replace_dangerous_char($filename); |
|
143 | + $file = api_get_path(SYS_ARCHIVE_PATH).api_replace_dangerous_char($filename); |
|
144 | 144 | $doc->save($file, 'Word2007'); |
145 | 145 | |
146 | 146 | DocumentManager::file_send_for_download($file, true, $filename); |