An interactive questionnaire in TiddlyWiki

574 views
Skip to first unread message

Jeremy Ruston

unread,
Jul 14, 2021, 6:46:02 AM7/14/21
to tiddl...@googlegroups.com
I’ve recently completed a small project for the Anna Freud National Centre for Children and Families in London (see https://annafreud.org/) to make an interactive questionnaire that has some interesting features:

  • Fairly sophisticated scoring of the answers to multiple choice questions
  • Generating spreadsheet files that can be downloaded and opened in Excel, and .DOC files that open in Microsoft Word
  • Copying spreadsheet data to the clipboard for pasting directly into Excel

In its current form, the questionnaire is not directly reusable for other purposes, but I hope some of the techniques will prove useful to others.

The context for this work is that the AFNCCF trains teams of care workers in Britain and around the world to work with the most troubled, hard to reach young people and their families.  For more than a decade, they have been working on the Adolescent Integrative Measure (AIM) to help care workers make a systematic, objective record of the problems affecting a particular young person, and to make suggestions of the interventions that are indicated by the answers. By repeating the questionnaire after an interval of months, workers can track a young persons progress. For the last few years, the questionnaire has been filled out on paper but there has long been a desire to simplify the process by moving it online.

You can try out the questionnaire in a demo here:

You can also see the questionnaire in AFNNCF's own site here:


The code is on GitHub:

AIM is a series of multiple choice questions that measure the severity of a particular problem. The spectrum of responses is a heartbreaking reminder of the difficulties that young people can go through, and I’m very happy that our collective work on TiddlyWiki is helping people help people in these situations.


Workers can also mark up to 6 of the questions as being “key problems” to indicate that they need particular attention:



There is a simple visualisation of progress through the questionnaire as questions are answered:


The questions are presented sequentially, with “next” and “previous” buttons to move between them, and a dropdown that enables jumping directly to a particular question. It also provides feedback of which questions have been completed, and which have been marked as key problems:


Until all the questions are answered, the results are blocked:


Note that if you scroll down you’ll find a button that answers all the questions instantly, making it easier to see the results.


Once all the questions have been answered, the results are displayed in several different tabs:

  • Focal: Each suggested intervention is ranked in order of how severe the set of problems are (their averaged AIM scores) that indicate that particular intervention. This is good for focusing on the most severe problems
  • Global: Each suggested intervention is ranked according to how many different problems (that is AIM items scoring greater than 2) the young person has which that particular intervention is relevant for. This is good for covering the whole set of problems and causes
  • Limit: Limit suggested interventions only to those relevant for items identified as key problems

The underlying calculations are probably the most complex that I have attempted in TiddlyWiki (particularly the global ranking), making extensive use of the mathematics operators and the ‘reduce’ and ‘filter’ operators. 


(Note that the suggested interventions link to missing tiddlers in the demo).

The questions comprising the questionnaire and the user interface that presents them can all be translated into other languages which are automatically engaged when TiddlyWiki’s core language is switched:


Answers are stored in temporary tiddlers that are not saved to the server, so several ways are provided to downloaded/exported them:
  • As a .DOC file that can be read by Microsoft Word
  • As a .CSV file that can be read by Microsoft Excel
  • Via the clipboard in a format that can be pasted directly into Microsoft Excel
The technique used to generate a .DOC file is notable: it turns out that Microsoft Word will happily open HTML files if they have the extension .DOC. This makes generating a Word document just be a matter of exporting a static HTML file and giving it the correct extension for the download.


The code is published as a plugin so it’s easy to see the component parts:


Note that some of the new arithmetic features of v5.2.0 are used to calculate the results, but everything else should work on prior versions.

Questions and comments welcome,

Best wishes

Jeremy.


TW Tones

unread,
Jul 14, 2021, 7:30:38 AM7/14/21
to TiddlyWiki
Jeremy,

Thanks for sharing a really practical application, for a good cause and with a very professional presentation.
  • Its great to see your language settings.
  • It would be nice if one day we can save the results of such surveys to the host even as separate files, json bundles etc...
  • That is a great tip on saving a html file as doc.
  • Such a document could also be attached to an email, sent from the wiki to a nominated address using a sophisticated mailto, for which many people have a email program that responds to such links.
  • It would also be possible to open a tiddler in print ready view and print the results directly to a printer including a PDF printer.
Did you take any steps to insert page breaks in the generated document, or do you leave this to the user once the document is created?

Very impressive.

Thanks again
Tony

Jeremy Ruston

unread,
Jul 14, 2021, 7:37:19 AM7/14/21
to tiddl...@googlegroups.com
Thanks Tones!


On 14 Jul 2021, at 12:30, TW Tones <anthony...@gmail.com> wrote:

Did you take any steps to insert page breaks in the generated document, or do you leave this to the user once the document is created?

No, I didn’t try anything like that, it would be interesting to experiment more to discover how much HTML is actually understood by Microsoft Word.

Best wishes

Jeremy

Joshua Fontany

unread,
Jul 14, 2021, 6:19:44 PM7/14/21
to TiddlyWiki
Wow, that is an impressive set of new tools/techniques and a good cause. Thanks for sharing!

Best,
Joshua F

TiddlyTweeter

unread,
Jul 15, 2021, 2:32:00 AM7/15/21
to TiddlyWiki
Ciao Jeremy

Very interesting to see! Thanks.
I ran through the whole thing and completed all questions. It is a seriously real application! :-)

As a side note: The Anna Freud people designed the questions really well. It is extremely difficult to design such questionnaires in a way that makes sense in normal English AND can produce operational,  quantitative, meaningful, results.  Hats off to them!

Best wishes
TT

Jeremy Ruston

unread,
Jul 15, 2021, 4:39:57 AM7/15/21
to tiddl...@googlegroups.com
Hi TT

Thank you – I was hoping you might find the translation mechanism interesting too, does it fit your needs discussed in that other thread?

You can try out the translation mechanism in the demo by switching the language to "Spanish" in the sidebar tab; you'll get gobbledegook that isn't Spanish, but it illustrates the difference. (Note that in the demo only the UI is translated, the questions themselves there are only in English).

Best wishes

Jeremy.

--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/cbd3d123-f65b-4205-8672-ba737c501acfn%40googlegroups.com.

clutterstack

unread,
Jul 15, 2021, 8:54:34 AM7/15/21
to TiddlyWiki
Wow, what a package of work! Nice to see such a comprehensive functional application.

Best,
Chris

TiddlyTweeter

unread,
Jul 16, 2021, 3:14:00 AM7/16/21
to TiddlyWiki
Ciao Jeremy

Thanks for that! It helps clarify what I am trying to do!

I will post an update note in the original thread about how I look at the issue now.

Best wishes
TT

Message has been deleted

elizabeth...@googlemail.com

unread,
Aug 3, 2021, 1:00:55 PM8/3/21
to TiddlyWiki
Hi all, I'm reposting this because my first reply got deleted (spam filter, I assume!)

I wanted to add some reflections from the Anna Freud centre. We are very excited about this development, for two main reasons: 

1. It helps us to directly connect outcomes measurement to the evidence base for what works for different types of problem. 

The interactive AIM sits within our tiddlywiki treatment manual, which means that the suggested interventions list generated by the questionnaire links directly into content on how to deliver the most appropriate evidence-based intervention. We will easily be able to update this as the evidence-base evolves. 

2. It helps us to overcome a major barrier to using outcomes measures in practice: feasibility/ practically 

Generally outcome measures like this are valued by health and social care workers in principle, but the impracticality of scoring and recording the data often results in low use of the measures in practice. 

We want to encourage services working with young people to use the AIM to plan care and assess outcome for individual young people, but also to to collate the data to evaluate their service as a whole. Here is a paper evaluating outcomes of a young person's substance use service that looks at a series of pre- and post-treatment AIM scores for 100 young people: https://journals.sagepub.com/doi/abs/10.1177/1359104521994875?journalCode=ccpa 

Jeremy's interactive AIM, with its different options for saving the results, makes it easy for workers to save the results for multiple purposes - perhaps saving the .doc file to the young person's health record, then copying the data into a spreadsheet capturing the whole team's outcomes. 

Thanks, Jeremy!

Liz

TW Tones

unread,
Aug 3, 2021, 6:48:52 PM8/3/21
to TiddlyWiki
Liz,

Thanks for sharing. Its great to get such insights.

Toneas

maki aea

unread,
Sep 27, 2021, 5:32:10 AM9/27/21
to TiddlyWiki
the link on the AFNNCF's own site has changed: (you can access it from the AIM menu on https://manuals.annafreud.org/ambit/ )
Reply all
Reply to author
Forward
0 new messages