MDL-79226 questions: check for UTF-8 encoding of the import file

This commit is contained in:
Luca Bösch 2023-09-06 23:21:14 +02:00 committed by Ilya Tregubov
parent 748814dc61
commit 767e147dac
No known key found for this signature in database
GPG Key ID: 0F58186F748E55C1

View File

@ -61,6 +61,18 @@ class qformat_aiken extends qformat_default {
return true;
}
/**
* Validate the given file.
*
* For more expensive or detailed integrity checks.
*
* @param stored_file $file the file to check
* @return string the error message that occurred while validating the given file
*/
public function validate_file(stored_file $file): string {
return $this->validate_is_utf8_file($file);
}
public function readquestions($lines) {
$questions = array();
$question = null;