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

This commit is contained in:
Luca Bösch
2023-09-15 17:35:33 +08:00
committed by Ilya Tregubov
parent 748814dc61
commit 767e147dac
+12
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;