Unable to import question banks in Moodle 2.3.1+ (Build: 20120712)

Unable to import question banks in Moodle 2.3.1+ (Build: 20120712)

by Louis Fleming -
Number of replies: 60

Brand new install on clean server of Moodle 2.3.1+ (Build: 20120712)

Created a course - Created a Quiz - Created Category - went to upload file

Drag and drop does not work at all - tried repeated under Windows 7 Pro.

Tried uploading question bank in multiple formats.

  • Examview Version 4.08 - Exported as XML 
  • Blackboard V6

Was able to upload all day long in 1.9 - these are same type of file that I uploaded with the Examview as Blackboard type or Examview as Examview XML.

Now I am a month from school starting and more than 200 question banks to upload. 

No time to try and rework these into other formats as there are more than 20000 questions

Any ideas ?

 

 

 

 

 

Average of ratings: -
In reply to Louis Fleming

Re: Unable to import question banks in Moodle 2.3.1+ (Build: 20120712)

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Where have these questions come from?

Have you used them with Moodle before?

When you say Drag and drop, what exactly are you taking about? (Drag and drop is not a standard feature of Moodle. There are several different third-party drag and drop question types that do different sorts of draging and dropping.)

In reply to Tim Hunt

Re: Unable to import question banks in Moodle 2.3.1+ (Build: 20120712)

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers

Tim, Louis raises a very good question.  I have had problems doing the same thing, and I just haven't found time to post this as a bug in Tracker.  I'll describe the problem to you, from my perspective.

This semester, I got a new edition of one of my textbooks and I decided to recreate the quiz questions using the author's provided test questions, which started in MS Word format.  When I last did this, maybe 3 years ago, I kept very good notes about the entire process, so I thought this would be easy.  I too get these Word questions into Examview 4.0.2.  Then I export these to XML format, and when I tried importing these into Moodle 2.2.+, (picking import for Examview) it didn't work!

Well, I thought that it might be a problem with my XML file.  Fortunately, I still have my old Moodle 1.9 running, so I tried the EXACT import into Moodle 1.9, and it worked fine.  To solve my need, I then exported the question back from Moodle 1.9 as a Moodle XML file, then imported it into Moodle 2.2 as a Moodle XML file.  Guess what, this worked!

So, I concluded that Moodle 2.2 must have some problem with its "Import from Examview" routine.

I am attaching one of my Examview XML files (Ch02.xlm).  I don't know if you have the ability to try anything in 1.9, but I can assure you that this file imported fine in 1.9, but not in 2.2.

I am also attaching (the long named file), the XML export file from 1.9, which will import into Moodle 2.2, in my next post (can only attach one file here).

Based on your response, I might need to finally put this into the Tracker system, but I thought I would let you think about it now that you have two files.

In reply to Tim Hunt

Re: Unable to import question banks in Moodle 2.3.1+ (Build: 20120712)

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers

Here is the second file.  It was exported as Moodle XML in 1.9+, and then imported into Moodle 2.2.

(I never thought anyone would encounter the exact same problem!)

In reply to Rick Jerz

Re: Unable to import question banks in Moodle 2.3.1+ (Build: 20120712)

by Jean-Michel Védrine -

Hello Louis, Emma and Rick,

Yes Examview and BlackBoard imports are broken since Moodle 2.1 (maybe even 2.0 I don't remember exactly).

This is MDL-25492 and it's assigned to me.

I have a "work in progress" import code both for BlackBoard and for Examview. I plan to work on it during this Summer and release it during August.

I will try the examples files posted and see if it works (if it don't it will permit me to improve my code  !)

But if you are in a hurry I can send you the actual state of the code, provided you are aware this is still worked on and subject to bugs (but I promiss it has less bugs the BlackBoard and Examview imports formats wich are currently in Moodle 2.3.1)

Another solution is to use MoodleXMLBuilder from Nash Community College (Gary Blackburn) to convert Examview 6 exports to Moodle XML

In reply to Jean-Michel Védrine

Re: Unable to import question banks in Moodle 2.3.1+ (Build: 20120712)

by Jean-Michel Védrine -

Hello,

Sorry I was wrong, I was thinking your files were of the "Examwiew saved as Blackboard" type (the one I am currently working on) but they are of the (very) old Examview type (if I had looked at your files extension I would have known that, because the old type is .xml and the new one is .zip).

This kind of xml files is the one that was imported by the import/export format wich is in question/type/examview. As I said this format is broken since Moodle 2.0 or 2.1.

But I have done a little work on it and it seems now to import your sample files fine.

Here are the instructions if you want to give it a try to see if it solves your problems:

  • download the zip file attached to this message
  • unzip
  • replace the question/format/examview/format.php on your Moodle server with the one included in this zip file (if you are not the server's administrator, obviously you will need to ask your administrator to do this for you)
  • try to import your questions again
  • depending on the result enjoy smile or report the problems on this forum sad.

To Tim : this is just a quick work (adding mime_type, text_file, add_blank_combined_feedback methods and calling text_file where necessary) maybe it would be good to put this in all Moodle branchs currently supported ? Of course code checker report a lot of problems with this very old piece of code (but not in the lines I added I think wink)

In reply to Jean-Michel Védrine

Re: Unable to import question banks in Moodle 2.3.1+ (Build: 20120712)

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers

Jean-Michel,

Thanks for getting back to us about this.

I followed your instructions about using your format.php file in my Moodle 2.2.2+ (Build: 20120504), and IT WORKED!

Now, it might be just a matter of time before you can include this in Moodle 2.3x.

You are correct, I are dealing with Examview XML files, not Blackboard.  The reason that I use the 4.0.2 version of Examview (yes, old) is that it was somehow a free (or shareware) version of the product, and it worked better than any other product that I have tried.

What now might you plan to do?  Whatever fix you made should solve Louis's problem, if he can get his administrator to do the swap.  Do you think that I should be able to use your file for awhile, with 2.3 and future releases?

In reply to Rick Jerz

Re: Unable to import question banks in Moodle 2.3.1+ (Build: 20120712)

by Jean-Michel Védrine -

As this is only a (small) fix and not a new feature, I think that once Tim is satisfied with my change it can be included in all stable branches currently supported (sorry this probably means not Moodle 2.1)

I see no reason, unless a change is made in Moodle questions import export formats, for this file not working for a while. If you look at my changes you'll see my work was rather small.

 

 

In reply to Jean-Michel Védrine

Re: Unable to import question banks in Moodle 2.3.1+ (Build: 20120712)

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

I am really grateful to Jean-Michel for working on this. There seem to be many people who are happy to complain that it is not working, but he is the only one making a serious effort to fix it.

Jean-Michel, I am sure once your changes are done, we can get them onto all stable branches. If there are some parts of your changes that you think should go in now, then we can do that. Please just make it very clear exactly what the required changes are. Thanks.

In reply to Tim Hunt

Re: Unable to import question banks in Moodle 2.3.1+ (Build: 20120712)

by Jean-Michel Védrine -

Hello Tim,

Yes sorry as often I was not very clear.

My proposal here is to make as soon as possible a very limited change to fix the "Examview" import format because :

  • we only need to modify one file : question/import/examview/format.php
  • this file has not been modified since a very long time so the same changes apply to all supported branches (2.2, 2.3, dev) with absolutely no modifications. I have not checked but I think it would also apply to 2.1, but as 2.1 is no more supported I don't think it's an option to also apply to 2.1 ?
  • I was thinking that nobody was still using this very old format (it is only used by old versions of the Examview software) and I didn't care to fix it, but judging by the posts in this forum quite a lot of US teachers still use it, so this fix will be usefull for them. This old format uses a .xml file.
  • This is totally independant of MDL-25492 wich will enable import of recents BlackBoard, TestGen and Examview files all using a zip files (work still unfinished) and supporting images import.

The only bad thing I see in this fix is that I tried to only make changes required to repair the examview format, so the resulting file is still far away from Moodle quality code. The codechecker produce 63 errors and 17 warnings but the situation is not worse than it was before my changes ! Of course for MDL-25492 I will try to submit to you fully conformant files.

So that you can have a quick look at my (minimal) changes, I have done a patch file that I attach to this message. As you will see only obvious changes.

In reply to Jean-Michel Védrine

Re: Unable to import question banks in Moodle 2.3.1+ (Build: 20120712)

by Jean-Michel Védrine -

I forget to say that after that if you want at the same time fix most if not all coding style errors, I can of course provide another diff file but I think it is easier for you to first review the changes without all coding style changes.

In reply to Jean-Michel Védrine

Re: Unable to import question banks in Moodle 2.3.1+ (Build: 20120712)

by Jean-Michel Védrine -

Here is patch file between current Moodle and a version that make the codechecker happy. I hope I didn't break anything while fixing all coding styles errors. I tested and it still seems to work big grin.

In reply to Jean-Michel Védrine

Re: Unable to import question banks in Moodle 2.3.1+ (Build: 20120712)

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Thanks Jean-Michel. I have created MDL-34483 to track this, and I have converted your changes into a git branch.

You are absolutely right to separate out the changes into one change that alters the way the code works to fix the bug, and a separate change to fix the coding style. That makes it much easier to review.

In the tracker issue, I wrote:

Before this can be submitted for integration, we need:

1. Someone to upload an example Examview file that we can use to test this.

2. Jean-Michel, can you confirm that I have not messed anything up when I made your changes into a git branch.

In reply to Tim Hunt

Re: Unable to import question banks in Moodle 2.3.1+ (Build: 20120712)

by William Beazley -

Please let me add an attaboy to Jean-Michel as well.  I have to maintain two sets of 1,400 questions in Examview and Moodle because of limited two way transfer of questions.  Examview is much more specialized in exam preparation and its usefule features outweigh the extra work. I still find it easier to enter questions in Examview and import them into Moodle.

I some ideal world, it would be nice to maintain everything in Moodle and print exams with answer sheets in Examview's easy grade format (spaced on the sheet where the answer is on the paper page).

In reply to Tim Hunt

Re: Unable to import question banks in Moodle 2.3.1+ (Build: 20120712)

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers

Yep, thanks for working on this fix.  I hate to say this, but I wonder what this fix will do with newer (or the newest) version of Examview.  I don't have a new product, so I can't help on this one.  But I am always very pleased when newer versions of Moodle (in this case, 2.2 and 2.3) can do what older versions (1.9) could do.

Someday, having the Blackboard converter working might be nice, but I really don't have a need for this yet.  I do have access to Blackboard, so if you ever want me to do anything with it, let me know.

Also, I tried (and own) the Respondus product, and really don't care for it.

Thanks.

In reply to Rick Jerz

Re: Unable to import question banks in Moodle 2.3.1+ (Build: 20120712)

by Jean-Michel Védrine -

To answer your question Rick, newest versions of Examview software can save questions as a Blackboard zip file. The big advantage is that you can export images in questions wich was not possible with the old versions.

The format I am currently working on will enable to import these zip files in Moodle.

This is why it is important to have a BlackBoard import working in Moodle : not to import "real" BlackBoard files but to import Blackboard files generated by TestGen or Examview.

I must add that it is already possible to import these zip files in Moodle using MoodleXMLBuilder made by Gary Blackburn. MoodleXMLBuilder will convert the zipfile into a  Moodle XML file that can be imported in Moodle.

So as you see solutions exists for Examview and TestGen users.

In reply to Jean-Michel Védrine

Re: Unable to import question banks in Moodle 2.3.1+ (Build: 20120712)

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers

Okay, I now understand about the newer Examview and Blackboard.

Being able to import pictures would be a plus.

About a semester ago, I tried the Respondus direct import of publishers test banks into Moodle.  I was positive about it at first, but then found some problems with it.  Thant's why I returned to Examview.

I also understand how difficult these imports exports situations can be.  I appreciate your work and the work of others.  Thanks.

In reply to Rick Jerz

Re: Unable to import question banks in Moodle 2.3.1+ (Build: 20120712)

by Jean-Michel Védrine -

Hello Rick,

Can I ask you something ?

Can you use your Examview software to create an xml file with at least one example of each type of questions (match, multichoice, essay, numerical, truefalse, shortanswer) that this format is able to import so that it can be used to test this format.

If you can, what would be excellent would be to look at the questions in question/format/gift/tests/fixtures/question.gift.txt (this is a gift file that you can import into your Moodle if you want to see how these questions look like) and try to replicate (as much as you can) the exact sames questions in Examview. That would permit very precise tests and ensure that this format is not broken in future releases of Moodle.

In reply to Jean-Michel Védrine

Re: Unable to import question banks in Moodle 2.3.1+ (Build: 20120712)

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Yes please. I second that request.

In reply to Tim Hunt

Re: Unable to import question banks in Moodle 2.3.1+ (Build: 20120712)

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers

I am attaching a zip file that includes the XML file, the Examview 4.0.2 files, a PDF printout of the Examview test (so that you can see the questions), and a picture of the results of trying to import this into Moodle 1.9.  You might note that the essay questioin did not import.

Hope this helps.

In reply to Rick Jerz

Re: Unable to import question banks in Moodle 2.3.1+ (Build: 20120712)

by Jean-Michel Védrine -

Hello Rick,

Thanks a lot for contributing this. I will only be able to look at your file on Friday as I am spending some days in Chambéry far away from home and computer.

If I can I will also have a look at the essay question import problem.

In reply to Jean-Michel Védrine

Re: Unable to import question banks in Moodle 2.3.1+ (Build: 20120712)

by Rob Johnson -

I have begun testing upgrading my 2.1 site to 2.3, and I will report the Examview Blackboard plugins developed by Jean-Michel and Gerry Jenkins still work fine.   I no longer have access to Examview 4, but I thought it included a Blackboard export option.

In reply to Rick Jerz

Re: Unable to import question banks in Moodle 2.3.1+ (Build: 20120712)

by Jean-Michel Védrine -

Hello Rick,

Thanks a lot for your example file. It has permited me to detect and (I hope) fix additional problems including a mix between short answer and essay questions that was also present with Moodle 1.9 (short answers of type "sa" were imported as essay and essay type "es" were not imported at all). For Examview essay questions, the "answer" provided by Examview is now imported as "Information for graders" because I think it's the most appropriate field.

In reply to Jean-Michel Védrine

Re: Unable to import question banks in Moodle 2.3.1+ (Build: 20120712)

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers

Great work!  Really appreciated.

I know this is really challenging work.  However, the need is great, especially for people moving to Moodle from some other system.

In reply to Jean-Michel Védrine

Re: Unable to import question banks in Moodle 2.3.1+ (Build: 20120712)

by Susan Fleming -

Hello Jean-Michel

You can add us to the list with this issue.  I have a faculty member who has been importing test questions from Pearson Education TestGen as Blackboard V6+ on Moodle 1.9 but since we upgraded to 2.2.4 in mid-July she has been getting an error message (see attached).

Susan

Attachment DownloadError.png
In reply to Susan Fleming

Re: Unable to import question banks in Moodle 2.3.1+ (Build: 20120712)

by Susan Fleming -

I have passed on the solution you provided earlier in this discusson to our tech savvy Moodle webmaster and am hoping it will also resolve our issue but on the off-chance it doesn't the attached is an sample of the files our faculty member has been trying to import into the Moodle course question bank. 

In reply to Susan Fleming

Re: Unable to import question banks in Moodle 2.3.1+ (Build: 20120712)

by Jean-Michel Védrine -

Hello Susan,

I tested importing your 285ws5MCx.ZIP file with my work-in-progress Blackboard six import format, and I get 10 multichoices questions. And if I beleive my Excel knowledge they appear to be correctly imported big grin.

By the way while testing your file I discovered a typo that have been in Moodle Blackboard six import format for years and stay unnoticed until now : on lines 523 and 525 of question/format/blackboard_six/format.php there is $reponse and it should be $response. But as french is my native language it was particulary difficult for me to see this typo because reponse is a perfectly valid word in french so I have read this lines numerous times without seing the problem !! I wonder why no english speaking programmer did catch this typo before me ?

In reply to Susan Fleming

Re: Unable to import question banks in Moodle 2.3.1+ (Build: 20120712)

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Please set Debugging to DEVELOPER level, and then copy and paste the full error message here.

In reply to Tim Hunt

Re: Unable to import question banks in Moodle 2.3.1+ (Build: 20120712)

by Susan Fleming -
Hello Tim
 
It took me a little bit to figure out how to set the debugging but here is the results:
 
Parsing questions from import file.
Importing 10 questions from file

1. ________ functions enable evaluation and choices to be integrated into an Excel spreadsheet.

Debug info: Incorrect integer value: 'C' for column 'answerformat' at row 1
UPDATE mdl_cotr_question_answers SET question = ?,answer = ?,feedback = ?,answerformat = ?,fraction = ?,feedbackformat = ? WHERE id=?
[array (
0 => 1638285,
1 => 'C',
2 => 'i',
3 => 'C',
4 => 0,
5 => 'i',
6 => 4414207,
)]
Stack trace:
  • line 397 of /lib/dml/moodle_database.php: dml_write_exception thrown
  • line 999 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
  • line 1031 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->update_record_raw()
  • line 92 of /question/type/multichoice/questiontype.php: call to mysqli_native_moodle_database->update_record()
  • line 430 of /question/format.php: call to qtype_multichoice->save_question_options()
  • line 119 of /question/import.php: call to qformat_default->importprocess()
In reply to Susan Fleming

Re: Unable to import question banks in Moodle 2.3.1+ (Build: 20120712)

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

That is exactly the sort of information we need. Well, I say we, it is Jean-Michel who is working to fix these formats, and he is reading this thread.

In reply to Tim Hunt

Re: Unable to import question banks in Moodle 2.3.1+ (Build: 20120712)

by Jean-Michel Védrine -

Yes, I am reading this thread and the debugging info is quite meaningfull.

I would be very interested in your .dat file too, if you want, you can send it to me at vedrine _AT_ vedrine _DOT_ org.

In reply to Jean-Michel Védrine

Re: Unable to import question banks in Moodle 2.3.1+ (Build: 20120712)

by Jean-Michel Védrine -

Correction : in fact as Pearson Ed was kind enough to provide me with a licence for the TestGen software some months ago, I was able to use your .tst file, so I don't really need the .dat file.

In reply to Jean-Michel Védrine

Re: Unable to import question banks in Moodle 2.3.1+ (Build: 20120712)

by Susan Fleming -

Hello Jean-Michel

We upgraded to Moodle 2.2.4+ (Build: 20120809) last night and unfortunately I am still seeing the same error message when attempting to import the .zip file.  Here is the system output with debugging on:

Parsing questions from import file.
Importing 10 questions from file

1. ________ functions enable evaluation and choices to be integrated into an Excel spreadsheet.

Error writing to database

More information about this error

Debug info: Incorrect integer value: 'C' for column 'answerformat' at row 1
UPDATE mdl_cotr_question_answers SET question = ?,answer = ?,feedback = ?,answerformat = ?,fraction = ?,feedbackformat = ? WHERE id=?
[array (
0 => 1638296,
1 => 'C',
2 => 'i',
3 => 'C',
4 => 0,
5 => 'i',
6 => 4414250,
)]
Stack trace:
  • line 397 of /lib/dml/moodle_database.php: dml_write_exception thrown
  • line 1079 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
  • line 1111 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->update_record_raw()
  • line 92 of /question/type/multichoice/questiontype.php: call to mysqli_native_moodle_database->update_record()
  • line 430 of /question/format.php: call to qtype_multichoice->save_question_options()
  • line 119 of /question/import.php: call to qformat_default->importprocess()

Your help has been greatly appreciated,

Susan

In reply to Susan Fleming

Re: Unable to import question banks in Moodle 2.3.1+ (Build: 20120712)

by Jean-Michel Védrine -

Hello Susan,

I am currently working on this. If you want to follow the progresses you can look at MDL-25492.

As you see this issue is currently marked as "Unresolved" and status is "Development in progress". When it will be fixed you will see "Closed" and "Fixed". And in the fix versions item you will see in what versions the fix has been integrated.

This is why when people report in the forum they have a problem importing a file, I ask then if they can send me this file : to ensure my code works in all cases.

Until now this is the case and all files are correctly imported.

I understand people are impatient to have this working, but we must follow the integration process.

Currently I am nearly done submitting the code for another issue related to this one : MDL-34738. Tim review have been positive, and I hope next week it will be integrated, someone will test it and if tests are OK it will be part of future weekly releases.

Then I will concentrate on MDL-25492 wich is the issue you are interested in.  If you look at this issue, you will see that I already submitted code. This code is working (this is the code I use to test the files people send to me) but it needs to be polished before being ready, then like the other one, Tim will review it, and once he is satisfied, it will be integrated, tested, and finally be part of Moodle.

Average of ratings: Useful (1)
In reply to Jean-Michel Védrine

Re: Unable to import question banks in Moodle 2.3.1+ (Build: 20120712)

by Susan Fleming -

Thank you Jean-Michel

I appreciate the information and will monitor the MDL_25492 discussion. 

Susan

In reply to Susan Fleming

Re: UnError importing Blackboard question banks in Moodle 2.2.4+ (Build: 20120719)

by John Reese -

We too have encountered this error but on version 2.2.4+ July 19, 2012 build

 

Error writing to database
Debug info: Incorrect integer value: 'N' for column 'answerformat' at row 1
UPDATE mdl_question_answers SET question = ?,answer = ?,feedback = ?,answerformat = ?,fraction = ?,feedbackformat = ? WHERE id=?
[array (
0 => 802121,
1 => 'N',
2 => 'i',
3 => 'N',
4 => 0,
5 => 'i',
6 => 2172902,
)]
Stack trace:
  • line 397 of /lib/dml/moodle_database.php: dml_write_exception thrown
  • line 999 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
  • line 1031 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->update_record_raw()
  • line 92 of /question/type/multichoice/questiontype.php: call to mysqli_native_moodle_database->update_record()
  • line 430 of /question/format.php: call to qtype_multichoice->save_question_options()
  • line 119 of /question/import.php: call to qformat_default->importprocess()
 
 
In reply to John Reese

Re: UnError importing Blackboard question banks in Moodle 2.2.4+ (Build: 20120719)

by Jean-Michel Védrine -

hello john,

Thank for the report.

This is not exactly the very same error but something similar. I think this also is corrected in my code. If you want to be sure, just send me your file and I will tell you if I corrected this bug too.

The corrected code is currently reviewed by Tim hunt and once I will have made corrections based on his review, we will submit it for integration in Moodle 2.2 and 2.3 in the upcoming weeks I hope.

In reply to Jean-Michel Védrine

Re: UnError importing Blackboard question banks in Moodle 2.2.4+ (Build: 20120719)

by John Reese -

Hi jean-Michel,


Thank you for getting back to me. I tried and made the changes to both my 2.2.3+ (20120601) and my 2.2.4+ and unfortunately, both still returned as an error sad

More background about the problem and how it was encountered by one of our instructors

"... It is often necessary for our department to import Blackboard format test questions into Moodle.  The import function worked properly in our previous Moodle 1.9 instance, but does not work in current version.  When I try to import a file that worked before, the first question is imported then the process terminates with "Error writing to database".

If someone could please make the needed changes to the server and return the import quiz question functionality to Moodle I would greatly appreciate it! .."


How and where would you like me to to send you the zip file?

tried again and same error ...

=======

Error writing to database
Debug info: Incorrect integer value: 'N' for column 'answerformat' at row 1
UPDATE mdl_question_answers SET question = ?,answer = ?,feedback = ?,answerformat = ?,fraction = ?,feedbackformat = ? WHERE id=?
[array (
0 => 802122,
1 => 'N',
2 => 'i',
3 => 'N',
4 => 0,
5 => 'i',
6 => 2172903,
)]
Stack trace:
  • line 397 of /lib/dml/moodle_database.php: dml_write_exception thrown
  • line 999 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
  • line 1031 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->update_record_raw()
  • line 92 of /question/type/multichoice/questiontype.php: call to mysqli_native_moodle_database->update_record()
  • line 430 of /question/format.php: call to qtype_multichoice->save_question_options()
  • line 119 of /question/import.php: call to qformat_default->importprocess()

 

 

 

In reply to Jean-Michel Védrine

Re: UnError importing Blackboard question banks in Moodle 2.2.4+ (Build: 20120719)

by John Reese -

Hello Jean-Michel,

How is the implementation coming along? Our users are anxious for an update tongueout

In reply to John Reese

Re: UnError importing Blackboard question banks in Moodle 2.2.4+ (Build: 20120719)

by Jean-Michel Védrine -

Hello John,

I would say that things are going pretty well.

I am working on it each day, because I know courses are starting in 2 weeks, so I want this to be finished because after the begining of the new academic year, I know my time to work on this will be much reduced !!

The code is available on github, an I update it quite frequently, so you can in fact follow my progress. Just go to MDL-25492 and follow the "Pull Master Diff URL" link.

The code is now able to import any kind (this include the files made by both Examview and Testgen) of "Blackboard" file be it .dat or .zip (for .zip, images are imported too) .

The code also works for "undeployed" Blackboard quizes and archives with multiples questions ressources.

I have successfully used it to import files with thousands of questions (1950 questions in 13 ressources files in a .zip file in less than 120s).

What is needed now is that I finish some corrections (should be finished in a day or 2), submit it to Tim for peer-review so that he review it and suggest modifications and improvements, and once I have made the changes, we will be able to submit it for integration in Moodle.

In reply to Jean-Michel Védrine

Re: UnError importing Blackboard question banks in Moodle 2.2.4+ (Build: 20120719)

by John Reese -

Hi Jean-Michel,


Did you get my zip file for you to test? I sent it to your email. Let me know if you want me to resend it to you.

Thanks

In reply to John Reese

Re: UnError importing Blackboard question banks in Moodle 2.2.4+ (Build: 20120719)

by Jean-Michel Védrine -

hello John,

Sorry I didn't answer to your mail but I am spending a lot of time working on MDL-25492.

I received your file. Thanks a lot and I am happy to report that I am able to import it without any problem with the actual state of the code.

People following the tracker issue will see there is a lot of activity, and I must thank Tim Hunt for the time he spends to help me improve the code.

In reply to Jean-Michel Védrine

Re: UnError importing Blackboard question banks in Moodle 2.2.4+ (Build: 20120719)

by John Reese -

Wow that is exciting and no problem..

I'll look to make the changes and see what happens wink

In reply to Jean-Michel Védrine

Re: UnError importing Blackboard question banks in Moodle 2.2.4+ (Build: 20120719)

by John Reese -

Hi Jean-MIchel.

Good news. Thank you for all your hard word. Your patches and additions seem to have worked and our users are happy.

Thank you again

 

In reply to Jean-Michel Védrine

Re: UnError importing Blackboard question banks in Moodle 2.2.4+ (Build: 20120719)

by Joel Pheasant -

I apologize for my lack of understanding, but can you tell me what needs to be done to fix this?  I've looked at MDL-25492 and see lots of discussion and files, but I'm struggling to find the steps I need to take to fix our install.

In reply to Joel Pheasant

Re: UnError importing Blackboard question banks in Moodle 2.2.4+ (Build: 20120719)

by Jean-Michel Védrine -

Hello Joel,

All the discussions and files in the tracker are only interesting when people work on the fix and later for people interesting in how the bug was fixed. Moodle users are only interested in a little bit on the page :

Fix Version/s: 2.2.5 2.3.2

So this tells us the Moodle versions where the fix has been integrated and tells us that the best and easiest solution to get the fix is to upgrade your Moodle to version 2.2.5 or 2.3.2.

If you are now running Moodle 2.2.X and are in a middle of some courses I suggest to upgrade to 2.2.5 to have the smallest upgrade step. If you are running Moodle 2.3 or 2.3.1, I suggest to upgrade to 2.3.2.

If you are in the middle of an accademic year, and are running a Moodle version older than 2.2, I suggest not to take the risk of a big upgrade now, unless the problem of not being able to import BlackBoard/testGen/Examview quizes is very critical for you.

If you are not able to upgrade to 2.2.5 or 2.3.2 there is no easy way to get this fix in your Moodle, so your only solution is to use MoodleXMLBuilder to convert Blackboard/TestGen/Examview to Moodle XML format files that you can then import in Moodle question bank.

In reply to Susan Fleming

Re: Unable to import question banks in Moodle 2.3.1+ (Build: 20120712)

by Jean-Michel Védrine -

Good news : MDL-34483 is now closed and the fixed format is part of this week's release of Moodle 2.3.1+ and 2.2.4+

Hello Susan,

As you said "I have a faculty member who has been importing test questions from Pearson Education TestGen as Blackboard V6+" I can tell you that unfortunately the solution of MDL-34483 wil  not solve your problem.

This is because MDL-34483 deal with the "examview" import format and permit to import .xml files created by Examview 4.

Your files are of a different type (.zip) and use a different format, the one imported by the "blackboard_six" Moodle format.

You need to wait I finished my work on MDL-25492 to be able to import such files. I hope I will be able to finish repairing the blackboard_six format in the upcoming weeks. In the meantime if you can send me some examples of the files you are currently unable to import it would help.

In reply to Jean-Michel Védrine

Re: Unable to import question banks in Moodle 2.3.1+ (Build: 20120712)

by Susan Fleming -

Hello Jean-Michel

Unfortunately the faculty member who provided the file only provided the one and is now away on vacation until the 27th of August.  She did provide the file in two other formats and I am attaching the tst file on the off-chance it will help - unfortunately the .dat file is just over the 100kb limit so I can't attach it.

Susan

In reply to Susan Fleming

Re: Unable to import question banks in Moodle 2.3.1+ (Build: 20120712)

by Frank Fucile -

Susan

Here is a great web utility that allows you send to large files

http://www.filedropper.com/

cheers

frank

In reply to Frank Fucile

Re: Unable to import question banks in Moodle 2.3.1+ (Build: 20120712)

by Susan Fleming -

Thank you Frank

I have made a note for future use.

In reply to Louis Fleming

Re: Unable to import question banks in Moodle 2.3.1+ (Build: 20120712)

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Firstly, what kind of browser are you using?  Have you tried uploading without using the drag and drop?

And, I presume, you are going through the import process into question bank and selecting the right file type...for Examview, I think I used to export as Blackboard 6 and import into Moodle as regular Blackboard.

In reply to Emma Richardson

Re: Unable to import question banks in Moodle 2.3.1+ (Build: 20120712)

by Jared Chapman -

I can not get Moodle to upload these files with images. I have tried the latest 2.3 and 2.4 moodle installs.

What am I doing wrong? Any suggestions? I can only add one file at a time so I will add the rest in following posts.

In reply to Jared Chapman

Re: Unable to import question banks in Moodle 2.3.1+ (Build: 20120712)

by Jared Chapman -
In reply to Jared Chapman

Re: Unable to import question banks in Moodle 2.3.1+ (Build: 20120712)

by Jared Chapman -

File 3 - this is an Exam view file

In reply to Jared Chapman

Re: Unable to import question banks in Moodle 2.3.1+ (Build: 20120712)

by Jared Chapman -

File 4

In reply to Jared Chapman

Re: Unable to import question banks in Moodle 2.3.1+ (Build: 20120712)

by Jared Chapman -

Never mind, the file bb7.1 worked so I am good. I don't know why the other files don't work.

In reply to Jared Chapman

Re: Unable to import question banks in Moodle 2.3.1+ (Build: 20120712)

by Jean-Michel Védrine -

Hello,

I had a look at your webct.zip folder. This webct format was never supported by Moodle.

The webct import format in Moodle (currently broken, work is in progress in MDL-30001 ) can only import older webct files. Of course it would be nice to create a new question import format for this kind of file.

But the xml structure is not easy to parse.

 

In reply to Jean-Michel Védrine

Re: Unable to import question banks in Moodle 2.3.1+ (Build: 20120712)

by Jean-Michel Védrine -

I am able to import both your bb6.zip and your bb7.1.zip files, using the Blackboard V6+ import format with no problem using the latest versions of Moodle 2.2.6 2.3.3 and 2.4

The import of images is working for both files too.

 

 

In reply to Jean-Michel Védrine

Re: Unable to import question banks in Moodle 2.3.1+ (Build: 20120712)

by Jared Chapman -

Thanks,

Just out of curiosity, what about the ExamView file?

In reply to Jared Chapman

Re: Unable to import question banks in Moodle 2.3.1+ (Build: 20120712)

by Jean-Michel Védrine -

To my best knowledge examview bank (.bnk extension) is a proprietary binary format used only by the Examview software and I don't think that any documentation is available on this format. I  think no other software is able to use it. The Examview import format in Moodle is only able to process questions exported by examview but not .bnk or .tst files.