Re: Improving the import of WebCT questions:the format.php case

Re: Improving the import of WebCT questions:the format.php case

by Pierre Pichet -
Number of replies: 12

Hi Howard,

Here is a first version which was applied to 1.6 STABLE

The modifications are the following

  1. remove the odl quiz_qtype_calculate lines 397-400
  2. adding utf8_encode_array as the files output from WebCt are not utf8 and the moodle user should be able to use the WebCT file directly.
  3. correcting the code flow by removing  $question = $this->defaultquestion(); before the loop (actually I just put it as a comment but it should be remove) and adding it everytime a new question is detected.

The resulting format.php import some questiontypes but not calculated ones.

Other improvements will follow.

The included .zip file contained the new format.php, a diff info from CVS Tortoise and a 4 question exportfile from WebCT with some french accents (é,È) to confirm that the utf8 is working properly.

It is installed on http://132.208.141.198/moodle/ user(teacher) :moodle ,pw:moodle

Pierre

Average of ratings: -
In reply to Pierre Pichet

Re: Improving the import of WebCT questions:the format.php case

by Bob Nickle -
Hello,
I am trying to export a quiz from TestGen 7.3 into Moodle 1.4 using the standard import tools. TestGen can generate any of the following 4 formats:
Blackboard (version 5,6,7)
WebCT3
WebCT4
WebCTCE6

Attempts with using the Blackboard format are on hold until our host provider can update Blackboard/format.php. (We do not have programmer resources at our college). Meanwhile, I am trying the WebCT formats, with the following results:

WebCT3 .txt imported as WebCT format:

1 error(s) detected, Too few :ANSWER, :Lx, :Rx statements for question line 0. You must define at last 2 possible answers 1 warning(s) detectedMissing question label after line 0

WebCT4 .txt imported as WebCT format:
Same error as above

WebCTCE6:
No .txt file in zip. This structure looks too complex for Moodle 1.6 import.

As an end-user, Is there anything I can do other than wait for Moodle system updates?

Thanks,
Bob

In reply to Bob Nickle

Re: Improving the import of WebCT questions:the format.php case

by Pierre Pichet -

Hi Bob,

My first suggestion is to migrate to a newer version than Moodle 1.4 .

My second suggestion is to go to a Moodle 1.5 site

http://www.chimie.uqam.ca/moodle/ 

You log ( as a teacher) with user: moodle   pw: moodle

If your files load correctly then replace the

quiz/format/webct/format.php by the attach file. It could work 

Pierre

P.S. If this not works, attach your 1.4 file .

In reply to Pierre Pichet

Re: Improving the import of WebCT questions:the format.php case

by Bob Nickle -
Pierre,
Whoops. I mean Moodle 1.6.
Bob
In reply to Pierre Pichet

Re: Improving the import of WebCT questions:the format.php case

by Bob Nickle -
Pierre,
Great! I was able to import both WedCT3 and WebCT4 formats to your test Moodle 1.5 site. Now, I need to figure out how to replace files on my server. I imagine that a 1.7 php file would be more appropriate for my 1.6 system?
Thanks,
Bob
In reply to Bob Nickle

Re: Improving the import of WebCT questions:the format.php case

by Pierre Pichet -
Bob,
You cannot just replace one file, you have to do a complete upgrade and given all the actual possibilities of moodle 1.6 you could stay on 1.6 for a time. We at UQAM (40 000students, >700 courses) are actually migrating from Webct 4 to Moodle and will stay on 1.6 at least for another year because there are noticeable interface differences after 1.7 and peoples won't follow if we change it to 1.8 after one session.
I have a solution for 1.6 also that I am retesting before using it on Moodle_UQAM 1.6.3. I will post here the necessary tested files in a few days.

Pierre
P.S. Which version of 1.6 do you use (look at the administration notifications)
In reply to Pierre Pichet

Re: Improving the import of WebCT questions:the format.php case

by Bob Nickle -
Pierre,
I am waiting for a response from my campus administrator on what is our our specific version. For now, let' assume it is 1.6.3. Meanwhile, I am confused on the Moodle bug fix procedure. I do not understand your statement that I cannot just replace one file. From reading this forum, I understand that my problem can be fixed simply by copying the updated .php file to a specific location on the server. As a non-programming end-user, I am searching my campus for someone who has that capability. Is my assumption regarding copying the .php file correct?
Thanks,
Bob
In reply to Bob Nickle

Re: Improving the import of WebCT questions:the format.php case

by Pierre Pichet -

Hi Bob,

At this time, this version has not been CVS to Moodle official site so your campus admministrator cannot obtain it from Moodle.

So just put the file in the correct  directory after doing a backup of the existing file, will do the job.

Pierre

In reply to Bob Nickle

Re: Improving the import of WebCT questions:the format.php case

by Pierre Pichet -
Here is a zip file that contains a question/format/webct/format.php file that is somewhat different from the one at the upper part of the discussion.
I have tested it on 1.6.3, and it works correctly.
The resulting format.php import some questiontypes but not calculated ones.
there is a small txt file with french text to test the utf-8.
You unzip the package and replace the file on your site with this one and try it.

Pierre
P.S. It imports correctly the matchin question as long as they are defined as short.short i.e. with a select element but not the table view.
The REASON is not imported. On my to-do list...

In reply to Pierre Pichet

Re: Improving the import of WebCT questions:the format.php case

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Ok,

Thanks Pierre. I've been a bit busy but I'll take a look asap. Couple of points though:

* I'm not sure why this is diff'ed against 1.6, would not 1.8 or HEAD be a better idea?
* Do you know for certain the encoding of webct files, regardless of their origin. If you are wrong, someone will probably be stuffed!
In reply to Howard Miller

Re: Improving the import of WebCT questions:the format.php case

by Pierre Pichet -
Hi Howard,
I can assure that my coding will work for WebCT 3 and 4 text files obtained when a WebCT user select some normal text questions from a category and ask WebCT to create an export text file.
If the WebCT user ask for all the quiz from a course, another kind of XML file is created and there are other tools to use.
One problem that is not correctly solved is that WebCT tolerate 2 answers in matching question but not Moodle and the feedback in WebCT is more a general feedback that do not exist in Moodle 1.6. One solution we use in the course transfer at UQÀM is to add the WebCt feedback to all feedback elements.
At a simple course level, this can be manually corrected in the case that the feedback is heavily used which is quite rare.

Pierre
In reply to Howard Miller

Re: Improving the import of WebCT questions:the format.php case

by Pierre Pichet -
Hi Howard,
A first check on the Moodle Head recent webct/format.php and some of my more complex WebCt files show that only multiple choice WebCt questions have a feedback for each answer, this feedback being called REASON. It is not recognized by the actual code.
There is a new bug related to the work of Tim on multiple choice question with his new choice of units to index the items. A default field will have to be added to each multiple choice imported question.
I think you have there a new homeworksad.

Pierre