MDL-46212 questions: add {} whenver vars are put into "" strings
Having had one subtle bug cased be this, I decided to do a search and fix all of these.
This commit is contained in:
+9
-9
@@ -222,12 +222,12 @@ class qformat_default {
|
||||
$importerrorquestion = get_string('importerrorquestion', 'question');
|
||||
|
||||
echo "<div class=\"importerror\">\n";
|
||||
echo "<strong>$importerrorquestion $questionname</strong>";
|
||||
echo "<strong>{$importerrorquestion} {$questionname}</strong>";
|
||||
if (!empty($text)) {
|
||||
$text = s($text);
|
||||
echo "<blockquote>$text</blockquote>\n";
|
||||
echo "<blockquote>{$text}</blockquote>\n";
|
||||
}
|
||||
echo "<strong>$message</strong>\n";
|
||||
echo "<strong>{$message}</strong>\n";
|
||||
echo "</div>";
|
||||
|
||||
$this->importerrors++;
|
||||
@@ -247,7 +247,7 @@ class qformat_default {
|
||||
|
||||
// work out what format we are using
|
||||
$formatname = substr(get_class($this), strlen('qformat_'));
|
||||
$methodname = "import_from_$formatname";
|
||||
$methodname = "import_from_{$formatname}";
|
||||
|
||||
//first try importing using a hint from format
|
||||
if (!empty($qtypehint)) {
|
||||
@@ -377,7 +377,7 @@ class qformat_default {
|
||||
|
||||
$count++;
|
||||
|
||||
echo "<hr /><p><b>$count</b>. ".$this->format_question_text($question)."</p>";
|
||||
echo "<hr /><p><b>{$count}</b>. ".$this->format_question_text($question)."</p>";
|
||||
|
||||
$question->category = $this->category->id;
|
||||
$question->stamp = make_unique_id_code(); // Set the unique code (not to be changed)
|
||||
@@ -691,7 +691,7 @@ class qformat_default {
|
||||
protected function readquestion($lines) {
|
||||
|
||||
$formatnotimplemented = get_string('formatnotimplemented', 'question');
|
||||
echo "<p>$formatnotimplemented</p>";
|
||||
echo "<p>{$formatnotimplemented}</p>";
|
||||
|
||||
return null;
|
||||
}
|
||||
@@ -719,7 +719,7 @@ class qformat_default {
|
||||
protected function try_exporting_using_qtypes($name, $question, $extra=null) {
|
||||
// work out the name of format in use
|
||||
$formatname = substr(get_class($this), strlen('qformat_'));
|
||||
$methodname = "export_to_$formatname";
|
||||
$methodname = "export_to_{$formatname}";
|
||||
|
||||
$qtype = question_bank::get_qtype($name, false);
|
||||
if (method_exists($qtype, $methodname)) {
|
||||
@@ -819,7 +819,7 @@ class qformat_default {
|
||||
|
||||
// continue path for following error checks
|
||||
$course = $this->course;
|
||||
$continuepath = "$CFG->wwwroot/question/export.php?courseid=$course->id";
|
||||
$continuepath = "{$CFG->wwwroot}/question/export.php?courseid={$course->id}";
|
||||
|
||||
// did we actually process anything
|
||||
if ($count==0) {
|
||||
@@ -924,7 +924,7 @@ class qformat_default {
|
||||
protected function writequestion($question) {
|
||||
// if not overidden, then this is an error.
|
||||
$formatnotimplemented = get_string('formatnotimplemented', 'question');
|
||||
echo "<p>$formatnotimplemented</p>";
|
||||
echo "<p>{$formatnotimplemented}</p>";
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user