Skip to content

How to use formr with Psyweb

Ruben C. Arslan edited this page Jul 27, 2018 · 1 revision

Psyweb is a German platform where you can recruit participants. To make sure that participants received via Psyweb are correctly identifiable and to let Psyweb know how many participants from Psyweb have finished the study, use the following Run-JSON. All you need to do is put your own study components between position 10 and 100, and potentially customise the feedback at position 110.

The Survey unit at position 10 is not a real survey, users will never see it. It will only serve as a receptacle for the Psyweb query parameter. Psyweb will send people to https://yourstudy.formr.org/?psyweb=PARTICIPANTID. formr.org needs to receive and store this PARTICIPANTID.

The External unit at position 100 sends a web request to the Psyweb finishing page, so that Psyweb knows that the study was completed. Finally, in the feedback page you can show dynamic feedback, but also give users the opportunity to go back to Psyweb.

{
    "name": "psyweb",
    "units": [
        {
            "type": "Survey",
            "description": "Psyweb receptacle: get the query parameter ?psyweb",
            "position": 10,
            "special": "",
            "survey_data": {
                "name": "psyweb_receptacle",
                "items": [
                    {
                        "type": "get",
                        "choice_list": null,
                        "type_options": "psyweb",
                        "name": "psyweb",
                        "label": "",
                        "label_parsed": "",
                        "optional": 1,
                        "class": "",
                        "showif": "",
                        "value": "",
                        "block_order": "",
                        "item_order": 1
                    }
                ],
                "settings": {
                    "maximum_number_displayed": 0,
                    "displayed_percentage_maximum": 100,
                    "add_percentage_points": 0,
                    "enable_instant_validation": 0,
                    "expire_after": 0,
                    "google_file_id": "1oGyyx63O1_jai02TuiBCZjEOBqLAhP-NrP2RJc_Id0o",
                    "unlinked": 0,
                    "expire_invitation_after": 0,
                    "expire_invitation_grace": 0,
                    "hide_results": 0,
                    "use_paging": 0
                },
                "google_sheet": "https:\/\/docs.google.com\/spreadsheets\/d\/1oGyyx63O1_jai02TuiBCZjEOBqLAhP-NrP2RJc_Id0o\/edit"
            }
        },
        {
            "type": "External",
            "description": "Phone home to Psyweb to finish, then show feedback",
            "position": 100,
            "special": "",
            "external_link": "if (!is.na(psyweb_receptacle$psyweb)) {\r\n    httr::GET(paste0(\"https:\/\/psyweb.uni-muenster.de\/participations\/\",psyweb_receptacle$psyweb,\"\/finish\")) # phone home\r\n} \r\nFALSE # always continue",
            "api_end": 0,
            "expire_after": 0
        },
        {
            "type": "Endpage",
            "description": "Feedback",
            "position": 110,
            "special": "",
            "body": "# Abschluss\r\n\r\nVielen Dank für Ihre Teilnahme an unserer Studie! Es folgt Ihre personalisierte Rückmeldung.\r\n\r\n`r ifelse(!is.na(psyweb_receptacle$psyweb) && psyweb_receptacle$psyweb != \"\", paste0(\"Um zurück zu Psyweb zu gelangen, klicken Sie bitte auf den folgenden Link:  https:\/\/psyweb.uni-muenster.de\/participations\/\",psyweb_receptacle$psyweb,\"\/finish\"),'')`.\r\n\r\n"
        }
    ]
}