WeBWorK Main Forum

help with an error message while exporting a course

help with an error message while exporting a course

by Dave Meng -
Number of replies: 7
I tried to export the course material of a course that I set up for an instructor this summer with the "wwdb" command. I got the following error message
 "Code point \u0004 is not a valid character in XML at /opt/webwork/webwork2/lib/WeBWorK/Utils/DBImportExport.pm line 320"

I do not know what to do to correct it. Any help will be appreciated it.

Thanks,

Dave




In reply to Dave Meng

Re: help with an error message while exporting a course

by D. Brian Walton -
I had an issue with this as well using WeBWorK v2.5. In my case, it appeared that some student answer entries in the course database tables had non-printable characters that had been saved in the answer entry.

The code is written with a generic export routine that throws an exception when there are non-printable characters. I got around the problem by modifying the Import/Export code to eliminate any such characters. It appears that the newest version of the code has a correction that should avoid this error.


(See lines 320-323)

What version of WeBWorK are you using? Do you have the latest version of DBImportExport.pm?

- Brian
In reply to D. Brian Walton

Re: help with an error message while exporting a course

by Dave Meng -
Thanks Brian. We are indeed using v2.5.0. Our IT person set  up  WebWork for us using a virtual machine. I'll contact the IT person to fix this. Do you know if I can just export the course material without student data?  Thanks.

Dave

In reply to Dave Meng

Re: help with an error message while exporting a course

by Michael Gage -
If you want to recreate the homework in the current course for a new course on the same machine you can do the following:

1. export all of the homework sets from course1. This exports the data knowledge about the contents of the homework sets to set definition files stored in course1/templates.
2. create course2 using course1 as the "template" instead of using modelCourse (this has to be done from the admin page of webwork -- a mere instructor can not do this.) This copies over all the files in the templates and html directories in course1 but not the database (that's why you have to export the homework sets first)
3. go to course2 and import homework set definitions (you can import them 
all at once) 

-- you are now set for the next semester.

In newer versions of WeBWorK there is an Archive link on the FileManager page
that lets you create a snapshot of your course -- all student data included.  This can be downloaded for backup or to transfer the course to a machine or to use it again in two years.  The .tgz file is created in the template directory and you can download it to your desktop using FileManager.


In reply to Michael Gage

Re: help with an error message while exporting a course

by Dave Meng -
Hi Michael,

Thank you very much for your help. My problem is that I can not export the course that I wanted to copy because of that error. The instructor made some changes in the course, but not the model course. So I need to export that course. I think the problem that I had is exactly what Brian pointed out. We need to update DBImportExport.pm on our site. How did I find out what options that I can use when I use wwdb to export or import?

Thanks again,

Dave
In reply to Dave Meng

Re: help with an error message while exporting a course

by Michael Gage -
The kind of export I am talking about is exporting homework sets from the homework set editor. Are we talking about the same operation?

It doesn't involve command line operations or wwdb

Wwdb and wwsh are utility scripts so they don't have much in the way of documentation. If you know the code in DB.pm you can use it to hook in to the code.
In reply to Michael Gage

Re: help with an error message while exporting a course

by Dave Meng -
No. I was just using wwdb. I just tried your way and it worked. Thanks.