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

      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;
                  }

        Gliffy Diagrams

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

          Issue Links

            Activity

            Hide
            Jean-Michel Vedrine added a comment -

            Adding Pierre Pichet as a watcher as he is currently working on this format.

            Show
            Jean-Michel Vedrine added a comment - Adding Pierre Pichet as a watcher as he is currently working on this format.
            Hide
            Tim Hunt added a comment -

            Removing the patch label, since I assume that this will get incorporated into Pierre's work, and therefore, there is not a current patch that needs to be reviewed.

            Show
            Tim Hunt added a comment - Removing the patch label, since I assume that this will get incorporated into Pierre's work, and therefore, there is not a current patch that needs to be reviewed.
            Hide
            Pierre Pichet added a comment -

            Tim,
            It is OK to incorporate it in MDL-30001.
            However MDL-30001 is somehow stopped as we (Jean-Michel) are waiting for your comments about common functions between similar import format and the handling of the files in the moodledata directory.

            Show
            Pierre Pichet added a comment - Tim, It is OK to incorporate it in MDL-30001 . However MDL-30001 is somehow stopped as we (Jean-Michel) are waiting for your comments about common functions between similar import format and the handling of the files in the moodledata directory.
            Hide
            Tim Hunt added a comment -

            Well, it is also OK if you want to submit a specific fix for this issue, without waiting for MDL-30001. I just need a branch in git to review if you want to go that way.

            Show
            Tim Hunt added a comment - Well, it is also OK if you want to submit a specific fix for this issue, without waiting for MDL-30001 . I just need a branch in git to review if you want to go that way.
            Hide
            Pierre Pichet added a comment -

            The code has been incorporated in MDL-30001 working files.

            So the work on this will be continued in MDL-30001.

            Show
            Pierre Pichet added a comment - The code has been incorporated in MDL-30001 working files. So the work on this will be continued in MDL-30001 .
            Hide
            Pierre Pichet added a comment -

            Jean-Michel,
            Do you have examples of WebCT files with essay questions ?

            Show
            Pierre Pichet added a comment - Jean-Michel, Do you have examples of WebCT files with essay questions ?
            Hide
            Jean-Michel Vedrine added a comment -

            Hello Pierre,
            I am not quite sure but maybe you can look at the file named Examview_export_WebCT CE 4-6-Vista 3-4.zip posted by Daryle Niedermayer in issue MDL-25492. Daryle has tried to export the same questions in all export formats availables in Examview.
            If this file is similar to the ones in Blackboard formats then it should contain some essay questions.
            But as I don't really know WebCT formats maybe it's not what you are looking for ?

            Show
            Jean-Michel Vedrine added a comment - Hello Pierre, I am not quite sure but maybe you can look at the file named Examview_export_WebCT CE 4-6-Vista 3-4.zip posted by Daryle Niedermayer in issue MDL-25492 . Daryle has tried to export the same questions in all export formats availables in Examview. If this file is similar to the ones in Blackboard formats then it should contain some essay questions. But as I don't really know WebCT formats maybe it's not what you are looking for ?
            Hide
            Stephen Bourget added a comment -

            Attached is a sample WebCT3 Essay question exported from examview.

            Show
            Stephen Bourget added a comment - Attached is a sample WebCT3 Essay question exported from examview.
            Hide
            Pierre Pichet added a comment -

            Thanks Stephen, your .txt sample of essay type is loaded correctly.

            :QUESTION:H:60:5
            What are some of the benefits to using an open source application such as Moodle over a closed source application?
            :ANSWER:H
            1. Moodle is Free, so no yearly costs<br>2. You can customize Moodle to fit your needs<br>3. You have the ability to fix bugs rather than waiting for a company that may / may not address them.
            :CAT:SAMPLE EXPORT
            

            the question text is OK but what is the following text ("1. Moodle is Free, so no yearly costs<br>2. You can... on WebCT?

            A general feedback ?

            Thanks Jean-Michel for the reference however at this stage I cannot handle the format used for exporting the quiz.

            Show
            Pierre Pichet added a comment - Thanks Stephen, your .txt sample of essay type is loaded correctly. :QUESTION:H:60:5 What are some of the benefits to using an open source application such as Moodle over a closed source application? :ANSWER:H 1. Moodle is Free, so no yearly costs<br>2. You can customize Moodle to fit your needs<br>3. You have the ability to fix bugs rather than waiting for a company that may / may not address them. :CAT:SAMPLE EXPORT the question text is OK but what is the following text ("1. Moodle is Free, so no yearly costs<br>2. You can... on WebCT? A general feedback ? Thanks Jean-Michel for the reference however at this stage I cannot handle the format used for exporting the quiz.
            Hide
            Stephen Bourget added a comment -

            In examview that field was labeled "Answer", I would assume that the closest field in the Moodle Essay question would be the information for graders field.

            Show
            Stephen Bourget added a comment - In examview that field was labeled "Answer", I would assume that the closest field in the Moodle Essay question would be the information for graders field.
            Hide
            Pierre Pichet added a comment -

            Thanks as effectively there is such a parameter
            $options->graderinfo = $this->import_or_save_files($formdata->graderinfo,
            $context, 'qtype_essay', 'graderinfo', $formdata->id);
            $options->graderinfoformat = $formdata->graderinfo['format'];
            Let's try this...

            Show
            Pierre Pichet added a comment - Thanks as effectively there is such a parameter $options->graderinfo = $this->import_or_save_files($formdata->graderinfo, $context, 'qtype_essay', 'graderinfo', $formdata->id); $options->graderinfoformat = $formdata->graderinfo ['format'] ; Let's try this...
            Hide
            Pierre Pichet added a comment -

            Done.

            Show
            Pierre Pichet added a comment - Done.
            Hide
            Pierre Pichet added a comment -

            A moodle xml export of the essay question from Stephen webct file imported in moodle master.

            Show
            Pierre Pichet added a comment - A moodle xml export of the essay question from Stephen webct file imported in moodle master.
            Hide
            Tim Hunt added a comment -

            Jean-Michel, did you fix this over the summer?

            Show
            Tim Hunt added a comment - Jean-Michel, did you fix this over the summer?
            Hide
            Jean-Michel Vedrine added a comment -

            Hello Tim,
            No I didn't fixed it, but I was thinking that Pierre has done some code to fix this and the other issue of the Webct import format(MDL-30001).
            Pierre did you want me to have a look at your code ? If it is not finished maybe we can try to finish it you and me ?
            I am on holidays all the upcoming week so I can find some time to work on this (I also plan to work on MDL-35103 and MDL-33424)

            Show
            Jean-Michel Vedrine added a comment - Hello Tim, No I didn't fixed it, but I was thinking that Pierre has done some code to fix this and the other issue of the Webct import format( MDL-30001 ). Pierre did you want me to have a look at your code ? If it is not finished maybe we can try to finish it you and me ? I am on holidays all the upcoming week so I can find some time to work on this (I also plan to work on MDL-35103 and MDL-33424 )
            Hide
            Jean-Michel Vedrine added a comment - - edited

            As Pierre's code is included in the one for MDL-30001, marked that this issue will be resolved by MDL-30001

            Show
            Jean-Michel Vedrine added a comment - - edited As Pierre's code is included in the one for MDL-30001 , marked that this issue will be resolved by MDL-30001
            Hide
            Jean-Michel Vedrine added a comment -

            This will be fixed as part of MDL-30001

            Show
            Jean-Michel Vedrine added a comment - This will be fixed as part of MDL-30001

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: