Export hard-copy overview of questions (including answer options)

As supporting materials for enumerators I’d like to prepare a hard-copy version of the questionnaire. It does not need to be usable as a questionnaire to fill in questions, but it should be able to give a good overview.

Has onyone done that is there a tool or any recommendation how to approach this?

Hi @Simon_Hess!

I’m attaching an example of how I do this – we essentially build a linked excel questionnaire as a series of comment columns to the left of the programming on the survey sheet. This takes some initial setup of formulas and very diligent cross-referencing in excel, but then it is fairly easy to format and print the comment columns to use for training, etc. In really big projects with lots of files and sections I actually get Stata to automate some of this, can share a do file if you’re a Stata user. c212d94bf04de16353bfd56289b2bb983028de10.xlsx (55.2 KB)

Thanks for sharingProcessing: Untitled.ipynb…
this. I ended up writing my own jupyter notebook for this, which works well too. Sadly I cannot upload the notebook here, so i’m just pasting the essential bits of the code.


import json
import re
with open("formDef.json") as f:
    formDef = json.load(f)

spec = formDef['specification']['sections']['survey']['prompts']
for x in spec:
    if ('display' in x.keys()):
        if 'required' in x.keys():
            rest = str(x['required']).replace("data('consent') === 1","").replace(" ? true : false","").replace("data('comId') === \"\"","")
            if "data('hhHead') === 1" in rest:
                rest = "[IF HOUSEHOLD HEAD]: "
            elif "data('hhHead') === 0" in rest:
                rest = "[IF NOT HEAD]: "
            else:
                rest =""
        print(rest+ re.sub("<.?b>","",x['display']['prompt']['text'].replace("{{data.comName}}","{village}")).replace("<p>","\n").replace("</p>","\n").replace("</br>","\n"))
        print("\t"+x['type'].replace("note","").replace("select_one_dropdown","select one:").replace("select_one_integer","select one:").replace("select_one","select one:"), end=" ")
        if 'values_list' in x.keys():
            try:
                choices = formDef['specification']['choices'][x['values_list']]
                print("; ".join([zz['display']['title']['text'] for zz in choices]), end="")
            except:
                print(x['values_list'], "")
        print("")
    else:
        print("========")

it’s not pretty but it works

2 Likes

I really would love a do file to automate this. Would really appreciate if you can share. Also, I wonder if there is a tool similar to ‘ODKmeta’ to convert CSV exports to Stata file with clean-ups and labels? Thanks.

1 Like

Hi @Mandy_Sin! Sure, sharing the do file:
SLMPS questionnaire sharing v3.do.zip (2.3 KB)
All of our tables were named quest* and there is a bit of an explanation at the start for how to setup the folders. We were combining into a household questionnaire file and an individual file.
I am attaching an example form xlsx as well so you can see the order of tabs and columns, since this is important and needs to be consistent for the loops to work.
quest2_08_2.xlsx (39.5 KB)

You can also use ODKmeta to convert exports with clean-up and labels, but you have to modify your csvs to be the same format as ODK is used to.

2 Likes

Thank you! This is really helpful.

2 Likes