Grants:IEG/Rewrite Extension:QPoll to provide polls and quizes with Lua backend.

status: withdrawn

Individual Engagement Grants
Individual Engagement Grants
Review grant submissions
review
grant submissions
Visit IdeaLab submissions
visit
IdeaLab submissions
eligibility and selection criteria

project:

Rewrite Extension:QPoll to provide polls and quizes with Lua backend.


project contact:

questpc256@gmail.com or questpc@rambler.ru

participants:




summary:

Improve quiz / poll functionality of MediaWiki.

engagement target:

Wikiversity, MediaWiki

strategic priority:

Improving Quality

total amount requested:

5000 USD


2013 round 2

Project idea

edit

Extension:Quiz used for Wikiversity has very simple correct answer checking abilities without real server-side scripting backend. Also it has no statistical special pages to display user submitted results. I developed Extension:QPoll as a fork of Quiz, but it was never really finished. Before Extension:Scribunto was released, my extension has PHP-based server-side scripting for polls. Example of form definition:

<qpoll id="личные_данные" interpretation="personal_data" max_attempts="99" layout="tabular">
{Личные данные (* - поля обязательные для заполнения)
|type="text" emptytext="yes" name="person"}
:|name="age" emptytext="no"|Возраст* <<::width=2>>
:|name="sex" emptytext="no"|Пол* <<мужской|женский>>
:|name="nationality" emptytext="no" catreq=1|Национальность* <<Русские|Татары|Украинцы|Башкиры|Чуваши|Чеченцы|Армяне|Мордва|Аварцы|Белорусы|Казахи|Удмурты|Азербайджанцы|Марийцы|Немцы|Кабардинцы|Осетины|Даргинцы|Буряты|Якуты>> либо другая: <<>>
:|birthplace|Место рождения <<>>
:|livingplace|Место постоянного проживания <<>>
:|education|Образование <<>>
:|qualification|Профессия <<>>
:|workplace|Место работы <<>>
:|occupance|Должность <<>>
</qpoll>

Example of interpretation script:

<qpinterpret lang="php">
# we have only one question; this is a shortcut
$q = $answer['person'];
qp_debug('person',$q);

$result = array(
  'options' => array( 'store_erroneous' => false ),
  # possible qpc errors. 'person' is question name (we have only one question)
  'error' => array( 'person' => array() ),
  'structured' => array(
    'age' => $q['age'][0],
    'sex' => $q['sex'][0],
    'birthplace' => $q['birthplace'][0],
    'livingplace' => $q['livingplace'][0],
    'education' => $q['education'][0],
    'qualification' => $q['qualification'][0],
    'workplace' => $q['workplace'][0],
    'occupance' => $q['occupance'][0]
  )
);

# age must be a number from 18 to 100
$min_age = 18;
$max_age = 120;
if ( !ctype_digit( $q['age'][0] ) ||
     $q['age'][0] < $min_age || $q['age'][0] > $max_age ) {
  $result['error']['person']['age'] = 'Возраст должен быть числом от ' . $min_age . ' до ' . $max_age;
}

# we assume that one person may have only one nationality
if ( count( $q['nationality'] ) > 1 ) {
  $result['error']['person']['nationality'] = 'Национальность может быть только одна';
} else {
  $result['structured']['nationality'] = isset( $q['nationality'][0] ) ? $q['nationality'][0] : $q['nationality'][1];
}

# do not display any result to end user
$result['long'] = '';

return $result;
</qpinterpret>

Pages handling could be rewritten using ContentHandler (to make polls not being dependent on Parser cache). Lua should be used to check submitted quiz / polls.


Project goals

edit

Visual layout of forms and their interpretation logic can be defined. In theory that could enable advanced functionality for Wikiversity. I had an idea of creating my own psychology tests and language education site using Extension:QPoll, however I was forced to stop developing due to major financial and family troubles.


Part 2: The Project Plan

edit

Project plan

edit

Scope:

edit

Scope and activities

edit

I am very short on money, thus cannot spend the whole day on the project. Depending on final time schedule, I probably can develop an alpha or beta version of the project, working 3-4 hours per day.

Tools, technologies, and techniques

edit

The core is LAMP, however to interpret the user-submitted results it should also use recently introduced (still unchecked though) Extension:Scribunto possibilities to add new Lua / Parser bindings (hooks).

Budget:

edit

$5000

Total amount requested

edit

$5000, preferrable in Russian roubles (RUR).

Budget breakdown

edit

Basically I use these for living and maybe extra to upgrade my hardware (notebook or tablet). Travelling is too expensive to me.

Intended impact:

edit

Target audience

edit

Maybe it can be used at Wikiversity. But of course I am not sure that my coding level is good enough for deployment. I still do not write unit tests for PHP / Javascript, because it sufficiently slows the development. Usually I test via debug logging or temporarily patching the code. If there is the need for 100% code coverage and tests that would slow down the development sufficiently, especially because I am the sole developer. However I saw the worse extensions than mine.

Fit with strategy

edit

Language education and psychology tests can be much more flexible when used together with server-side scripting.

Sustainability

edit

Extensions sometimes has to be updated to keep them compatible to new versions of core, bugfixing and so on. Even non-Wikimedia deployed extensions.

Measures of success

edit

Number of extension installations, number of user requests at extension's statistical page(s).

Participant(s)

edit

I am Dmitriy Sintsov the sole possible participant of this project. I worked with MediaWiki sites at Yaroslavl Demidov University in Russia since 2009, then with former Psychologos wiki (www.psychologos.ru, now switched to another framework) and another wiki sites such as sportswiki.ru, wikimoscow.org. Extensions, skins, shell administration for MediaWiki.

Discussion

edit

Community Notification:

edit

Please paste a link to where the relevant communities have been notified of this proposal, and to any other relevant community discussions, here.

Endorsements:

edit

Do you think this project should be selected for an Individual Engagement Grant? Please add your name and rationale for endorsing this project in the list below. Other feedback, questions or concerns from community members are also highly valued, but please post them on the talk page of this proposal.

  • Community member: add your name and rationale here.