Announcing the Dokuwiki Survey Plugin
A fellow asked the other day, wether Dokuwiki supports surveys. He was thinking of a way to guide our firstlevel to a series of questions to either solve a user problem or get enough information for second level.
I told him, that I didn’t know it and looked in the [[http://www.dokuwiki.org/plugins|massive Dokuwiki plugin directory]]. But I didn’t find something he thought about.
So I did it myself.
Announcing the Dokuwiki Survey Plugin. You can find it over at [[http://www.dokuwiki.org/plugin:survey|the Dokuwiki plugin page]] or at [[http://github.com/dploeger/dokuwiki-plugin-survey/tarball/master|Github]].
It’s in a pre-alpha-alpha-alpha state, but it already works. It takes a tree of questions and answers (I used Dokuwiki’s unordered list syntax for that) and transforms it into a Javascript-based questionnaire.
Let’s create an example, shall we?
===== Finding a social network for you (in Germany) =====
* How old are you?
* 12 to 18
* [[http://www.schuelervz.net|Schüler-VZ]]
* 18 to 26
* [[http://www.studivz.net|Studi-VZ]]
* 26 to 40
* Are you working in the field of IT?
* Yes
* [[http://plus.google.com|Google+]]
* No
* [[http://www.facebook.com|Facebook]]
* over forty
* Really?
* Yes
* Erm… Really?
* Yes
* [[http://www.facebook.com|Facebook]] (I guess)
* No
* Than press the „back“-Button
* No
* Than press the „back“-Button
===== Syntax used =====
This survey was made up using this syntax:
* How old are you?
* 12 to 18
* [[http://www.schuelervz.net|Schüler-VZ]]
* 18 to 26
* [[http://www.studivz.net|Studi-VZ]]
* 26 to 40
* Are you working in the field of IT?
* Yes
* [[http://plus.google.com|Google+]]
* No
* [[http://www.facebook.com|Facebook]]
* over forty
* Really?
* Yes
* Erm... Really?
* Yes
* [[http://www.facebook.com|Facebook]] (I guess)
* No
* Than press the "back"-Button
* No
* Than press the "back"-Button
===== Syntax explained =====
So we’re using the unordered list syntax of Dokuwiki to create a tree of questions and answers. At the topmost level is exactly one item and that’s the first, or „root“ question. After that are several answers to that question. Underneath an answer can be another question, then again answers and so on.
As you can see, we’re supporting external links (and internal links) using the standard link syntax of Dokuwiki.
===== Please help! =====
I honestly think, my code is rubbish. I got a hard time finding out the right algorithm for the conversion of the syntax to a machine readable hash. And the way I jump through the array using pointers here and there kinda feels wrong. So I’ll be glad, if somebody could give me a hand over at github to clean up the code a little.
Calendar
M | D | M | D | F | S | S |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 |
Archive
- Januar 2024
- Dezember 2023
- April 2021
- März 2021
- September 2020
- Dezember 2019
- November 2019
- Oktober 2019
- Juli 2019
- Juni 2019
- Mai 2019
- April 2019
- März 2019
- September 2018
- August 2018
- Juli 2018
- März 2018
- Januar 2018
- Dezember 2017
- September 2017
- März 2017
- Februar 2017
- Januar 2017
- August 2016
- Mai 2016
- Dezember 2015
- November 2015
- August 2015
- März 2015
- Dezember 2014
- September 2014
- August 2014
- Juli 2014
- Februar 2014
- Oktober 2013
- September 2013
- August 2013
- Juli 2013
- Juni 2013
- Mai 2013
- April 2013
- November 2012
- Oktober 2012
- September 2012
- August 2012
- Juni 2012
- Mai 2012
- März 2012
- Februar 2012
- Januar 2012
- November 2011
- Juli 2011
- Juni 2011
- März 2011
- Februar 2011
- Januar 2011
- Dezember 2010
- November 2010
- April 2010
- Februar 2010