Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-30001 WEBCT Import does not work for 2,0
  3. MDL-32086

Extend WebCT question import to support Essay questions

XMLWordPrintable

    • MOODLE_21_STABLE, MOODLE_22_STABLE

      The webct question importer does not currently support essay questions

      To support importing of this question type: we need to change the preg match on line 447 from:

       
                  if (preg_match("~^:TYPE:P~i",$line)) {
                      // Paragraph Question
                      $warnings[] = get_string("paragraphquestion", "qformat_webct", $nLineCounter);
                      unset($question);
                      $ignore_rest_of_question = TRUE;         // Question Type not handled by Moodle
                      continue;
                  }

      to:

                  if (preg_match("~^:TYPE:P~i",$line)) {
                      // Paragraph Question
                      // $warnings[] = get_string("paragraphquestion", "qformat_webct", $nLineCounter);
                      $question = $this->defaultquestion();
                      $question->qtype = ESSAY;
                      $question->responseformat = 'editor';
                      $question->responsefieldlines = 15;
                      $question->attachments = 0;
                      $question->graderinfo = array(
                              'text' => '', 'format' => FORMAT_HTML, 'files' => array());
       
                      $question->feedback = array();
                      $question->generalfeedback = array();
                      $question->questiontextformat = FORMAT_PLAIN;
                      $ignore_rest_of_question = FALSE;
       
                      // To make us pass the end-of-question sanity checks
                      $question->answer = array('dummy');
                      $question->fraction = array('1.0');
                      continue;
                  }

        1. questions-CHI1780_T40-export webct-20120412-2112.xml
          0.9 kB
          Pierre Pichet

            jmvedrine Jean-Michel Vedrine
            sbourget Stephen Bourget
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.