Details

    • Type: Sub-task Sub-task
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1, 2.2
    • Fix Version/s: STABLE backlog
    • Component/s: Questions
    • Labels:
    • Affected Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE
    • Rank:
      38787

      Description

      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

        Issue Links

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: