• Importing data into Moodle using VB9

    We’ve been developing a new Quiz engine on and off over the last few years. The original quiz was written by me in ASP, and does the job, though the interface for authors to enter new questions proved a bit too clunky, and is probably why it was never used very much.

    Enter ASP.NET and a chance to start from scratch and have another go. Except that it turns out writing a quiz engine (complete with some kind of question bank) is not that trivial.

    It looks like we may never get to finish the ASP.NET version, as we are now starting a trial of the quiz that comes with Moodle. It appears to have pretty much all the features we require, and someone else has done the hard work already!

    Last year we were running some trials of the ASP.NET application, and we wanted to migrate the questions that had already been entered over to Moodle so that they could be re-used.

    As of version 1.8, Moodle supports the following formats for importing questions:

    • GIFT
    • Missing Word
    • Blackboard <=5
    • Blackboard 6+
    • WebCT
    • Course Test Manager
    • Cloze
    • Learnwise
    • Examview
    • Moodle XML

    A surprising omission from that list is the IMS QTI format (thought Moodle does support this for exporting). If you’ve ever done quiz development, you should be aware of IMS and their Question and Test Interoperability specifications.

    Seeing as the migration tool will only have a limited lifetime I chose Moodle XML. The format is very simple and is mostly documented. The best way to find out the syntax though is to manually enter in some questions into Moodle, then do an Export.

    So now to build the tool. I planned to use .NET, and then I realised this was a good opportunity to try out some of the XML support built into VB9.

    In the end it I wrote the tool in a day, and the XML support made it very easy.

    Dim Doc As XDocument = \_
    <?xml version="1.0" encoding="utf-8" standalone="yes"?>
        <question type="category"\>
            <category><%= t.TEST.TEST\_TITLE %></category>

    This example shows how you can insert values into the XML really easily. I do like the fact that the XML looks like XML, not wrapped up inside strings.

    I did play around with enforcing an XML schema. There isn’t an official one defined by Moodle, so I tried rolling my own. This then lead to problems with the XML getting lots of xmlns attributes which I didn’t want, so in the end I just did without it.

  • Importing Excel 2007 into Windows SharePoint Services 2

    In WSS 2.0, there’s an option to create a new list by importing an Excel Spreadsheet.

    I’ve got Excel 2007 installed, and so after selecting the cell range of an .xls file I got this error message:

    Method ‘Post’ of object ‘IOWSPostData’ failed

    Searching for this gave me a possible solution

    Because this particular SharePoint is still version 2.0, I figured that lVer = 2 was appropriate, and the good news is it worked.

  • Your Account is deleted (part 2)

    Looks like it wasn’t just us affected by having our website deleted. This is the response I got to my email:

    Dear Mr. David,

    We really apologize for this issue. Our developer has been accidentally released the wrong version of the billing system that deleted your account.

    Our support team is now working to restore your website and emails. They have setup your account as active so you can login to your control panel to raise support ticket while we are restoring your application. Due to high traffic of restoring task, please give us another 24-48 hours to bring your website up again. If you have your own backup at your side, you are pleased to restore it on your own to speed up the time.

    Also, you are pleased to create support ticket to ask for your website restoring status.

    Please let me know if you still face any issue. Best Regards James Sullivan SeekDotNet Sales Team

    Well James, I’m not pleased to create a support ticket, but since my site is still not restored, I think I will anyway.

    Someone really needs to proofread their emails :-(