MDL-34841 error importing questions with long names.

The problem was with the non-UTF-8-safe way that a question name
was being constructed from the question text.

I have done a proper fix with methods in the base class to
carefully construct a question name that is reasonable, and
which will fit in the database column. Then I have changed all
importers to use the new methods.

I also remembered not to break the lesson in the process.
This commit is contained in:
Tim Hunt
2012-09-11 15:04:00 +01:00
parent 935c3d5ed2
commit cacb8fa08a
15 changed files with 154 additions and 59 deletions
+1 -1
View File
@@ -89,7 +89,7 @@ class qformat_missingword extends qformat_default {
/// Save the new question text
$question->questiontext = substr_replace($text, "_____", $answerstart, $answerlength+1);
$question->name = $question->questiontext;
$question->name = $this->create_default_question_name($question->questiontext, get_string('questionname', 'question'));
/// Parse the answers