Error on Gift Question Import

Re: Error on Gift Question Import

د Jean-Michel Védrine لخوا -
د ځوابونو شمیر: 0

Hello Joseph,

You are right, this file can't be imported as it doesn't contains questions in a valid GIFT syntax. There is something wrong in the way it has been generated.

But as the same time as lesson is "stealing" question imports formats from the question component, it should define a proper error method so that errors are correctly reported to users, don't you think so ?

The problem is not in gift format it is in mod/lesson/format.php in the qformat_default  class where something like:

    /**
     * Handle parsing error
     */
    protected function error($message, $text='', $questionname='') {
        $importerrorquestion = get_string('importerrorquestion', 'question');

        echo "<div class=\"importerror\">\n";
        echo "<strong>$importerrorquestion $questionname</strong>";
        if (!empty($text)) {
            $text = s($text);
            echo "<blockquote>$text</blockquote>\n";
        }
        echo "<strong>$message</strong>\n";
        echo "</div>";
    }

should be added.