All-or-nothing multiple choice question plugin for Moodle 2.0

All-or-nothing multiple choice question plugin for Moodle 2.0

Paul Beckett發表於
Number of replies: 8

I'm new to both PHP and Moodle, so please forgive me, and correct any of my observations which are incorrect.

We are wanting to use the all-or-nothing question plugin (written by Adriane Boyd) with Moodle 2.0, but the most recent version of this plugin seems to be 1.9.  It appears to me that the way Moodle handles question types has changed, and that it might not be trivial to update the all-or-nothing plugin. It also appears to me that the all-or-nothing plugin is a modified version of the standard multichoice question code.

Having been unable to find any trace of anyone working on this, I thought I'd have a look at seeing how easy it was to re-engineer the all-or-nothing functionality back into a copy of the current multichoice plugin. My first attempt (pre-alpha: very little testing)..... can be found at: http://www.uea.ac.uk/~s167/porf.tar .... as I said earlier I'm new to PHP and Moodle, so I'm not suggesting that this is by any means as good as the original all-or-nothing plugin.... but if anyone cares to comment, or write a better version that I can use that would be great.

Cheers,

Paul

評比平均分數: -
In reply to Paul Beckett

Re: All-or-nothing multiple choice question plugin for Moodle 2.0

Adriane Boyd發表於

Hi Paul,

I have plans to update all-or-nothing multiple choice (and most of my other question types) in the hopefully not-too-distant future.  (Given everything I have on my plate right now and the upcoming holidays, this will probably be pushed to sometime in January.)  There are quite a few changes that are necessary for 2.0 and testing everything properly takes some time and effort.

Since you mention being new here, I'd like to add a gentle reminder that in moodle, like in many open source projects, many people involved are volunteers with other jobs and commitments.  There's no reason to come to the conclusion that something has been abandoned by its developers after waiting barely 24 hours for a response to an email (or a forum post).  The final version of 2.0 has barely been available for two weeks, and there were lots of fairly major changes at the last minute that affect question types.

But, as you show nicely, there's nothing standing in your way if you'd like to write your own question types, and all-or-nothing multiple choice is fairly simple modification of multiple choice.  I would recommend comparing 1.9 multichoiceset to 1.9 multichoice, and then making the corresponding changes to 2.0 multichoice.  One of the differences between core question types and contrib question types (like all-or-nothing multiple choice) is that the the contrib questions need to include their own backup/restore and import/export functions, so be sure to take a look at that, too.  Actually, since this is one of the recent changes, I'm not even totally sure how to do backup/restore for contrib questions in 2.0 yet.  After a little poking around, I suspect that the new backup system just uses the XML import/export functions, but I could be mistaken.

-Adriane

Edited to add: if you do develop a working version of this question type for 2.0, please submit a patch (either to 1.9 multichoiceset or to 2.0 multichoice) in the contrib section of the tracker and I'd be happy to review it!

In reply to Adriane Boyd

Re: All-or-nothing multiple choice question plugin for Moodle 2.0

Tim Hunt發表於
Core developers的相片 Documentation writers的相片 Particularly helpful Moodlers的相片 Peer reviewers的相片 Plugin developers的相片

Adrianne, you are mistaken about backup/restore of 2.0 question types. It is still separate from import/export.

I don't really know how it works yet myself, since Eloy implemented it all, and I have not had to touch it yet.

Anyway, the code lives in places like question/type/match/backup/moodle2/backup_qtype_match_plugin.class.php

In reply to Adriane Boyd

Re: All-or-nothing multiple choice question plugin for Moodle 2.0

Paul Beckett發表於

Adriane,

Sorry I certainly hadn't meant to imply I thought development on this had been abandoned, merely that in searching the moodle site, I had not found anything to say anyone was working on a 2.0 version. Re-reading my original post (which was written in haste) I can see why it gave that impression though - please accept my sincere apologies. We greatly appreciate the all-or-nothing block you wrote; and that you've contributed this to the Moodle community. For us, this is an essential piece of functionality.

I thought someone (probably you), would re-write or update the plugin for 2.0 in due course. However, I needed a solution pretty much immediately.... so I decided to have a go myself. My approach was that which you've suggested.... I compared the code from the 1.9 multichoice and 1.9 multichoiceset, and then tried to make similar changes to a copy of the 2.0 multichoice question.

So far we haven't done very much testing with this - but our initial impression is that it's working: at least doing what we need. We haven't changed any of the backup code, but glancing at it... I didn't see anything that made me think the existing code 2.0 multichoice code wouldn't work with my modifications.

As I said, I'm new to PHP and Moodle, so I certainly don't want to suggest that my attempt at this is anywhere near as good as the original. I suspect that it's of limited value to you, as you could probably make the changes I've made and to a higher standard in very little time. It's certainly not as tidy or elegant as your 1.9 solution. I mainly just commented out the 'single' option, the partial feedback stuff, and added in a few language pack strings, your grading code and removed the excess partial feedback database columns.

I thought I'd post my attempt back (code included in my original post) to the community just in case it was of some use to you, or that someone else in the same situation as myself might find it a useful starting point.

Cheers,

Paul

In reply to Paul Beckett

Re: All-or-nothing multiple choice question plugin for Moodle 2.0

Adriane Boyd發表於

Given all the changes in 2.0, it's probably quickest to modify the 2.0 multichoice rather than updating the 1.9 version anyway, and I think it's great that you jumped in to add the functionality you needed and made it available for everyone.  The all-or-nothing option isn't a huge change, so if you make sure to test everything thoroughly, especially backup and restore, I think your new type will be just as good as the updates I would do.  Please submit it in the tracker!

In reply to Adriane Boyd

Re: All-or-nothing multiple choice question plugin for Moodle 2.0

Paul Beckett發表於

Hopefully we should have been able to give it a pretty good testing by next week. I'll try to post an update on here to let you know how it's going, and if the code is looking reliable I'll submit it to the tracker.

Currently I've called the question type porf rather than multichoiceset, on the rationale that I'd envisaged migrating back to the 'proper' version later. If it would be more useful, I could easily replace all the 'porf' references to be multichoiceset again.

Cheers,

Paul

In reply to Paul Beckett

Ats: Re: All-or-nothing multiple choice question plugin for Moodle 2.0

drift drift發表於

Multichoice plugin is very useful question type. It's hard to believe that this functionality was not add by default in 2.0

In reply to drift drift

Re: Ats: Re: All-or-nothing multiple choice question plugin for Moodle 2.0

Joseph Rézeau發表於
Core developers的相片 Particularly helpful Moodlers的相片 Plugin developers的相片 Testers的相片 Translators的相片

Expanding the number of question types available is on the roadmap of Moodle 2.1.