Page MenuHomePhabricator

Create new Python library to serialize Wikimedia Quiz format, GIFT quiz format, and allow round-trip conversions between the two formats.
Closed, DeclinedPublic

Description

Wikiversity uses a custom quiz format to construct quizzes, documented on pages like https://en.wikiversity.org/wiki/Help:Quiz , https://www.mediawiki.org/wiki/Extension:Quiz , etc.

There are many standardised quiz formats, including QTI https://en.wikipedia.org/wiki/QTI and GIFT https://en.wikipedia.org/wiki/GIFT_%28file_format%29. The canonical reference for GIFT is at https://docs.moodle.org/28/en/GIFT_format and Moodle's reference PHP GIFT parser is at https://github.com/moodle/moodle/tree/master/question/format/gift

A library is needed to import a Wikiversity quiz into Python classes, and allow the quiz to be exported to other formats.

https://pypi.python.org/pypi/quizzer , https://pypi.python.org/pypi/Products.ECQuiz, and https://github.com/mitocw/moodle2edx/blob/master/moodle2edx/main.py contain some suitable code, but they are not a generic library.

https://github.com/edx/edx-platform contains a lot of quiz code, and some of it might be able to be extracted into an independent library.

https://pypi.python.org/pypi/pyslet and https://code.google.com/p/qtimigration/ might be a suitable data structure library.

Support for Wikiversity Quiz format must be added to an existing packaged library, or the subclass to hold Wikiversity Quiz data must be extremely simple (e.g. adding only a few additional elements)

See also : T24475: GIFT format

Internship project details

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

My name is Yolande Amate from the University of Buea Cameroon. I would like to work on this project for the Google Summer of Code 2016 / Outreachy Round 12. I have a good understanding of the project, and I am proficient in C, C++, PHP and Python.
I would like know what is required to produce a successful proposal for the project and some starting points/issues to begin from.
Please I would need some clarification on the statement "Support for Wikiversity Quiz format must be added to an existing packaged library" as I did not understand it clearly.

Below is a link to github profile, which says more about my experience.
https://github.com/yland

@Yland_S please see https://en.wikiversity.org/wiki/Help:Quiz

@jayvdb if you can't find a co-mentor by the day before the deadline for it, please add me.

I would like know what is required to produce a successful proposal for the project and some starting points/issues to begin from.

See https://www.mediawiki.org/wiki/Outreach_programs/Life_of_a_successful_project#Coming_up_with_a_proposal
For some starting points, you can have a look at the mentioned microtasks, or else see https://www.mediawiki.org/wiki/Annoying_little_bugs to get familiar with MediaWiki in general.

Please I would need some clarification as to the objectives of this project. What I understand is that the project require importing Wikiversity quiz data into a python datastructure with the possibility of exporting this data into other standardized quiz formats.

But I did not get the following statement clearly " Support for Wikiversity Quiz format must be added to an existing packaged library, or the subclass to hold Wikiversity Quiz data must be extremely simple (e.g. adding only a few additional elements) "

@Yland_S , we want a Python package released on https://pypi.python.org that supports the Wikiversity Quiz data.

Ideally Wikiversity Quiz support is added to one of the existing Python package , so that it is maintained by group of developers after this project is complete.

So this project will include evaluation of the existing packages, and involves submitted code to one of those projects and working with their developers to get the code merged.

If they dont want to accept code for Wikiversity Quiz support, this project will release a new pypi packaged library that extends the existing pypi packaged library to add Wikiversity Quiz format.

@jayvdb, Thanks very much, for the clarifications. My doubts have been resolved.

@jayvdb do you want to continue the project for the current round of Outreachy-13( Dec 6 to March 6 ) as a mentor?

Yea, I am still happy to mentor this project.

@jayvdb nice! Moving to featured, it'd be great if we could find a co-mentor also.

I could probably co-mentor this one.

@jayvdb could you tell me why we wouldn't just add the ability to export the quiz format in these other standard formats in the extension itself? Is it just a matter of "extension doesn't have this, let's do this in pywikibot instead?"

Also what is a possible use cases for importing this quiz data into pywikibot?

I am interested in applying for this project as part of outreachy-13. Right now I'm getting myself familiarised with the Wikimedia platform. It would be great if someone could define the project task in a bit more detail, so that we prospective interns can know clearly what is expected of us. This will give a good starting point to begin exploring.

@Mvolz , even if the PHP extension supported a 'more' standardised format (e.g. T24475), AFAIK there is no generic python library that loads any standardised format.

All of the existing python code I can find is non-standard formats and "good enough" migration scripts, or readers that are part of a very large codebase with a data model designed for a specific website. If we need to design and build a generic data model in python, we may as well require that it can support the existing Wikiversity quiz concepts and serialization.

And unless the PHP extension also *imported* data from another format, any Python tool would still need to know how to serialise to the Quiz format in order to modify quiz on Wikiversity.

The MVP for this project is bi-directional support. Tools need to be able to parse and update Quiz data on Wikiversity. Almost every other embedded content in wikitext is in a format that has parsers and python libraries - this one doesnt.

One of the main use-cases I have heard of is people wanting to import quiz's from other systems into Wikiversity, usually to back-up their materials due to other mooc/quiz systems going offline, or being upgraded and they are told they will need to rebuild all their quiz, etc.

Another use-case is the ability to generate a custom/personalised quiz (in python) and push it to a Wikiversity user page.

Another area of possible use-cases is gamification of Wikimedia, using Python webapps deployed on the tool labs.

@jayvdb So as I understand it, this is to serialise quiz wikitext syntax, serialise GIFT format, and use the serialisation to perform round trip operations (GIFT to quiz syntax, quiz syntax to GIFT).

The use of the word "data" confused me initially because I assumed the data in question were the quiz *results*- as far as I have found, this can't be exported or imported anywhere. Might be a good (separate) project!

Correct. Serialise and deserialise for both formats. The data model should be generic, but it needs to retain style/token information so that the round trip has very few dirty diffs.

A earlytask (a microtask?) will be analysis to find features missing from each format, so we can work out acceptable modes of degraded exporting.

Mvolz renamed this task from Python library for quiz data, with serialisation to Create new Python library to serialize Wikimedia Quiz format, GIFT quiz format, and allow round-trip conversions between the two formats. .Sep 18 2016, 12:42 PM
Mvolz updated the task description. (Show Details)

@jayvdb @Mvolz I understand the project task better now. So, do you suggest I start working on the microtask. Also please suggest some bugs in I can work on to get a better idea of the python coding convention expected. Some guidance on how I can proceed ahead in the project would be great. Thanks.

hi @MayS , definitely start small tasks to become familiar with the Wikimedia dev tools, ideally on the MediaWiki-extensions-Quiz or Pywikibot project, but it could be in any project. You can find easy tasks by using the good first task tag in the Phabricator advanced search. e.g. https://phabricator.wikimedia.org/maniphest/query/83FiCVYkDzBc/#R

The microtask that is listed above is for the PHP extension project, and will involve CSS/JavaScript. If that isnt a combination of languages you are comfortable with, let us know your preference so we can find an easy task in a language you are already strong in.

I'm not sure I have any value I can add to the project at present, but if something comes up, please let me know.

Thanks!

Is this project not already in progress (T148074) as part of the Outreachy Round 13? If so, I will move it to a different column 'Outreachy-Round-13' on the Possible-Tech-Projects workboard.

Hello,

For very simple quiz, Aiken format is used by some Learning Management System (especially Moodle)
See https://docs.moodle.org/3x/fr/Format_Aiken

I wrote a (quite simple) python library to parse such a format
https://github.com/scls19fr/python-lms-tools

There is currently no support for GIFT format, neither Wikiversity custom quiz format

Feel free to take some code if you want.

Kind regards

@Miriya52: Hi! This task has been assigned to you a while ago. Could you maybe share an update? Do you still plan to work on this task?
If this task is not resolved and only if you do not plan to work on this task anymore: Please consider removing yourself as assignee (via Add Action...Assign / Claim in the dropdown menu): That would allow others to work on this (in theory), as others won't think that someone is already working on this. Thanks! :)

I am working on a version of this based on Tolchirp, not Wikimedia Quiz format or GIFT, at T166929.

No reply to T89761#5949630; hence resetting task assignee.

Xqt lowered the priority of this task from Medium to Low.Oct 12 2022, 6:58 AM
Xqt subscribed.

Is this extension really used?

Tacsipacsi subscribed.

Yes, it is: https://en.wikiversity.org/w/index.php?search=:insource%3Aquiz+insource%3A%2F\%3Cquiz%2F – 1 out of 15 content pages on enwikiversity contains a quiz.

Yes, it is: https://en.wikiversity.org/w/index.php?search=:insource%3Aquiz+insource%3A%2F\%3Cquiz%2F – 1 out of 15 content pages on enwikiversity contains a quiz.

Ok. What would be helpfull to implement at Pywikibot?

I don’t know, maybe we should ask the mentors, @jayvdb @Mvolz @Dave_Braunschweig. I just want this ticket not to be declined on the mere ground that the extension is unused, as it isn’t. I didn’t even notice that it’s about Pywikibot, as neither the title nor the description mention it (and I didn’t check the project tags).

Xqt lowered the priority of this task from Low to Lowest.Mar 6 2023, 3:17 PM

This task is orphaned for 7 years and I've not glue what to do with it.

I'm not sure there is a need for this from a Wikiversity perspective. It seems more like it was suggested as a student project vs. a community request. @jayvdb may have more information.