Skip to content

Instantly share code, notes, and snippets.

Last active Aug 17, 2018
What would you like to do?
GSoC 2017 Final Submission

Project :

Adding Custom features while upgrading and updating Quiz extension for Wikimedia Foundation

Introduction :

Quiz extension is currently used on several WMF projects, such as Wikiversity but had lot of bugs and limited features for users.By working on the project we have updated and upgraded MediaWiki Quiz extension while removing legacy code and adding new features to the extension.

Benefits of this project include stability and functionality to the extension and comprehensive features for users of various Wikis.Various custom features suggested by community were also added.

Initially one of the features that were supposed to be added was Data storage for quiz scores but it was declined for this project as decided with mentors and community.

The work can be divided into 4 major parts:

  • Importing and solving bugs
  • Removing legacy code and upgrading to MediaWiki standards
  • Providing Unit tests for the extension
  • Adding required features

Work Done

Note - All merged commits to github -

Month wise work is described as follows.

Month 1:

  • The initial task was to import bugs, suggestions and features from Wikipage to Phabricator.For this task 11 bugs/features were imported to phabricator and the pages were archived.
  • Merged Commits -
Gerrit Link Phabricator Link Description
356110 T165398 Fixing Background of feedback in Quiz
356983 T162803 Suppressing question numbering in a quiz when only one question
344726 T161318 Refractor legacy Html code of Answer in Question.php into mustache template.This task upgrades answers section to MediaWiki standards
358228 T167587 Follow up task to define all variables that are sent to process tepmlate
358227 T167588 Remove escaped HTML of < inside text field when field length shorter than answer
358068 T166926 Fixing the way correction for case insensitive textfields is displayed
358539 T166439 Enabling numeric input type questions to evaluate zero as valid input
  • Commits that weren't merged -
Gerrit Link
  • Other tasks -
    • Wrote documentation about {X}, {!X} and {/X} tags used in shuffle control on Wikiversity.
    • Edited documentation of shuffle feature on various Wikiversity pages (English, French, German etc).

Month 2:

  • The code was refactored add Unit tests were added in PhpUnit
  • The other major task was to finish removing legacy Html code and make the extension up to Mediawiki standards
  • Merged Commits -
Gerrit Link Phabricator Link Description
357781 T146392 Fixing Shuffle feature when there is only one question is in quiz
363635 T169529 Regression bug for settings box
364003 T170035 Regression bug for header options
359656 T161317 Refractor legacy Html code of Settings in Question.php into mustache template.This task upgrades the last section to MediaWiki standards
362264 T159691 Adding the relevant tests for the extension using phpunit.Marks the milestone for this month.It ensures the code to be more reliable and better
  • Commits that weren't merged -
Gerrit Link

Month 3:

  • Catered to required features as discussed by community.
  • Added more test and solved bugs.
  • Merged Commits -
Gerrit Link Phabricator Link Description
367327 T171154 Altering the settings by removing extra cell and adding tests
362793 T146370 Uploaded a patch set for resolving conflicts and test
368993 T170798 Changed the behaviour of shuffle feature by reassigning numbering to shuffled questions
369822 T172355 Regression bug to add class field to input type in Answer.mustache
371122 T170081 Resolved the bug that causes wrapping of quiz text around images on large display screens
372135 T173304 Fixed the CSS scheme for colouring in error class of quiz
371938 T165363 Added feature which provides the use of Interwiki and template links inside Quiz Categories
373310 T159952 Added feature of modifying the feedback behaviour for sysops admin.The admins can turn on/off unselected feedback by simply adding a line to common.css.
374035 T170799 Added new feature that adds a quiz parameter called shuffleanswers.If set to true, it creates shuffled answers and uses request to persist once submitted.
  • Commits that weren't merged -
Gerrit Link

Next Steps :

Some new parameters have been added to Quiz, these provide custom functionality for users setting the quiz.More Additional parameters can be added to the Quiz extension.This requires community consensus and based on the requirements.

More Info

Phabricator task for weekly reports - T164645

Personal Blog contaning weekly and bi-weekly blogs - Harjot Singh's Blog

Final Note - I would like to thank my mentor Marielle Volz (@mvolz) for her guidance and help while working on the project.My GSoC project has been a learning experience.I'd also like to thank other community members of Wikimedia Foundation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment