Skip to content

Commit 97f3517

Browse files
committed
Merge branch '3061' into 1.11.x
2 parents eb22b4c + 920677a commit 97f3517

File tree

4 files changed

+30
-19
lines changed

4 files changed

+30
-19
lines changed

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
]
3434
},
3535
"require": {
36-
"aferrandini/phpqrcode": "1.0.1",
36+
"angelfqc/vimeo-api": "2.0.6",
3737
"apereo/phpcas": "^1.3",
3838
"brumann/polyfill-unserialize": "^1.0",
3939
"chamilo/chash": "0.1.1",
@@ -46,6 +46,7 @@
4646
"doctrine/migrations": "~1.0@dev",
4747
"doctrine/orm": "~2.4",
4848
"emojione/emojione": "1.3.0",
49+
"endroid/qr-code": "2.5.*",
4950
"essence/essence": "2.6.1",
5051
"ext-curl": "*",
5152
"ext-dom": "*",
@@ -117,8 +118,7 @@
117118
"zendframework/zend-config": "~2.6|^3.0",
118119
"zendframework/zend-feed": "~2.6|^3.0",
119120
"zendframework/zend-http": "~2.6|^3.0",
120-
"zendframework/zend-soap": "~2.6|^3.0",
121-
"angelfqc/vimeo-api": "2.0.6"
121+
"zendframework/zend-soap": "~2.6|^3.0"
122122
},
123123
"require-dev": {
124124
"behat/behat": "3.5.0",

main/gradebook/gradebook_display_summary.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@
177177
if (count($userList) == 0) {
178178
echo Display::return_message(get_lang('NoResultsAvailable'), 'warning');
179179
} else {
180-
echo '<br /><br /><table class="data_table">';
180+
echo '<br /><br /><div class="table-responsive"><table class=" table table-bordered data_table">';
181181
echo '<tr><th>';
182182
echo get_lang('Student');
183183
echo '</th>';
@@ -208,7 +208,7 @@
208208
echo $link;
209209
echo '</td></tr>';
210210
}
211-
echo '</table>';
211+
echo '</table></div>';
212212
}
213213

214214
Display::display_footer();

main/gradebook/lib/fe/evalform.class.php

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,9 @@ protected function build_all_results_edit_form()
163163
$renderer = &$this->defaultRenderer();
164164
// set new form template
165165
$form_template = '<form{attributes}>
166-
<table class="data_table" border="0" cellpadding="5" cellspacing="5">{content}
167-
</table>
166+
<div class="table-responsive">
167+
<table class="data_table" border="0" cellpadding="5" cellspacing="5">{content}</table>
168+
</div>
168169
</form>';
169170
$renderer->setFormTemplate($form_template);
170171

@@ -224,7 +225,7 @@ protected function build_all_results_edit_form()
224225
<td align="left" >'.$user['official_code'].'</td>
225226
<td align="left" >'.$user['username'].'</td>
226227
'.$user_info.'
227-
<td align="left">{element} / '.$this->evaluation_object->get_max().'
228+
<td align="left">{element} / '.$this->evaluation_object->get_max().'
228229
<!-- BEGIN error --><br /><span style="color: #ff0000;font-size:10px">{error}</span><!-- END error -->
229230
</td>
230231
</tr>';
@@ -309,10 +310,12 @@ protected function build_result_add_form()
309310
$renderer = &$this->defaultRenderer();
310311
$renderer->setFormTemplate(
311312
'<form{attributes}>
312-
<table class="data_table">
313-
{content}
314-
</table>
315-
</form>'
313+
<div class="table-responsive">
314+
<table class="data_table">
315+
{content}
316+
</table>
317+
</div>
318+
</form>'
316319
);
317320

318321
$users = GradebookUtils::get_users_in_course($this->evaluation_object->get_course_code());
@@ -330,7 +333,7 @@ protected function build_result_add_form()
330333
<th>'.get_lang('FirstName').'</th>
331334
<th>'.get_lang('LastName').'</th>
332335
<th>'.get_lang('Qualify').'</th>
333-
</tr>'
336+
</tr>'
334337
);
335338
} else {
336339
$renderer->setHeaderTemplate(
@@ -340,7 +343,7 @@ protected function build_result_add_form()
340343
<th>'.get_lang('LastName').'</th>
341344
<th>'.get_lang('FirstName').'</th>
342345
<th>'.get_lang('Qualify').'</th>
343-
</tr>'
346+
</tr>'
344347
);
345348
}
346349

main/inc/lib/certificate.lib.php

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php
22
/* For licensing terms, see /license.txt */
3-
3+
use Endroid\QrCode\ErrorCorrectionLevel;
4+
use Endroid\QrCode\QrCode;
45
/**
56
* Certificate Class
67
* Generate certificates based in the gradebook tool.
@@ -510,12 +511,19 @@ public function isHtmlFileGenerated()
510511
*/
511512
public function generateQRImage($text, $path)
512513
{
513-
// Make sure HTML certificate is generated
514514
if (!empty($text) && !empty($path)) {
515-
//L low, M - Medium, L large error correction
516-
return PHPQRCode\QRcode::png($text, $path, 'M', 2, 2);
515+
$qrCode = new QrCode($text);
516+
//$qrCode->setEncoding('UTF-8');
517+
$qrCode->setSize(120);
518+
$qrCode->setMargin(5);
519+
$qrCode->setWriterByName('png');
520+
$qrCode->setErrorCorrectionLevel(ErrorCorrectionLevel::MEDIUM());
521+
$qrCode->setForegroundColor(['r' => 0, 'g' => 0, 'b' => 0, 'a' => 0]);
522+
$qrCode->setBackgroundColor(['r' => 255, 'g' => 255, 'b' => 255, 'a' => 0]);
523+
$qrCode->setValidateResult(false);
524+
$qrCode->writeFile($path);
525+
return true;
517526
}
518-
519527
return false;
520528
}
521529

0 commit comments

Comments
 (0)