<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://tsgdoc.socsci.ru.nl/index.php?action=history&amp;feed=atom&amp;title=Radcloud_Datahandler_script</id>
	<title>Radcloud Datahandler script - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://tsgdoc.socsci.ru.nl/index.php?action=history&amp;feed=atom&amp;title=Radcloud_Datahandler_script"/>
	<link rel="alternate" type="text/html" href="http://tsgdoc.socsci.ru.nl/index.php?title=Radcloud_Datahandler_script&amp;action=history"/>
	<updated>2026-07-07T03:30:59Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.4</generator>
	<entry>
		<id>http://tsgdoc.socsci.ru.nl/index.php?title=Radcloud_Datahandler_script&amp;diff=5890&amp;oldid=prev</id>
		<title>Wiki-admin at 09:36, 11 February 2025</title>
		<link rel="alternate" type="text/html" href="http://tsgdoc.socsci.ru.nl/index.php?title=Radcloud_Datahandler_script&amp;diff=5890&amp;oldid=prev"/>
		<updated>2025-02-11T09:36:31Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 09:36, 11 February 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l95&quot; &gt;Line 95:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 95:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;A successful call to the upload endpoint will return the following response.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;A successful call to the upload endpoint will return the following response.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;It means your task is scheduled and will be processed soon.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;It means your task is scheduled and will be processed soon.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[File:screenshot11111.png]]&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Handling the Response in Your Code ===&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Handling the Response in Your Code ===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Wiki-admin</name></author>
	</entry>
	<entry>
		<id>http://tsgdoc.socsci.ru.nl/index.php?title=Radcloud_Datahandler_script&amp;diff=5886&amp;oldid=prev</id>
		<title>Wiki-admin: Created page with &quot;== Datahandler Script ==  === Introduction === The data handler script is designed to facilitate the upload of data to the Radcloud upload API endpoint. This script streamline...&quot;</title>
		<link rel="alternate" type="text/html" href="http://tsgdoc.socsci.ru.nl/index.php?title=Radcloud_Datahandler_script&amp;diff=5886&amp;oldid=prev"/>
		<updated>2025-02-11T09:26:41Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;== Datahandler Script ==  === Introduction === The data handler script is designed to facilitate the upload of data to the Radcloud upload API endpoint. This script streamline...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Datahandler Script ==&lt;br /&gt;
&lt;br /&gt;
=== Introduction ===&lt;br /&gt;
The data handler script is designed to facilitate the upload of data to the Radcloud upload API endpoint.&lt;br /&gt;
This script streamlines the process of transferring data from local systems to the remote server,&lt;br /&gt;
ensuring that the data is accurately and efficiently uploaded to the intended API endpoint.&lt;br /&gt;
&lt;br /&gt;
This page demonstrates the data handler script usage with an example.&lt;br /&gt;
&lt;br /&gt;
=== Resources ===&lt;br /&gt;
The Data handler code is available in SocSci GitLab: [https://gitlab.socsci.ru.nl/tsg/radcloud-datahandler Data handler in GitLab]&lt;br /&gt;
&lt;br /&gt;
Packaged versions of the script can be downloaded with tag 'Generic' from the [https://gitlab.socsci.ru.nl/tsg/radcloud-datahandler/-/packages/ datahandler GitLab package registry].&lt;br /&gt;
&lt;br /&gt;
=== Implementation Examples ===&lt;br /&gt;
Example projects that show how you can integrate the data handler into your project:&lt;br /&gt;
* [https://gitlab.socsci.ru.nl/tsg/jspsych-radcloud-simple-example JsPsych radcloud example: I want the simplest possible setup]&lt;br /&gt;
* [https://gitlab.socsci.ru.nl/tsg/jspsych-radcloud-esmodule JsPsych radcloud example: I want to use modern JavaScript tooling]&lt;br /&gt;
&lt;br /&gt;
== Choose Your Own Setup ==&lt;br /&gt;
Download the datahandler script and make it part of your project.&lt;br /&gt;
There are three different ways that you can add the Datahandler to your project.&lt;br /&gt;
Which approach you choose will depend on what your goals are.&lt;br /&gt;
&lt;br /&gt;
=== I Want the Simplest Possible Setup ===&lt;br /&gt;
You do not need to install anything to start using the datahandler. For most experiments, this approach will be sufficient.&lt;br /&gt;
&lt;br /&gt;
# Go to the following page: [https://www.socsci.ru.nl/tsg/radcloud-datahandler/]&lt;br /&gt;
# Copy the link of the version you want (latest or another pinned version).&lt;br /&gt;
# Include the following line in your &amp;lt;code&amp;gt;index.html&amp;lt;/code&amp;gt; file pointing to the socsci hosted URL.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;amp;lt;script src=&amp;quot;https://www.socsci.ru.nl/tsg/radcloud-datahandler/1.5.7/datahandler.1.5.7.js&amp;quot;&amp;amp;gt;&amp;amp;lt;/script&amp;amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Call the function from JavaScript:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
datahandler.saveData(radcloudApiKey, ppn, mydata);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Note:''' Example project: [https://gitlab.socsci.ru.nl/tsg/jspsych-radcloud-simple-example JsPsych radcloud example: I want the simplest possible setup]&lt;br /&gt;
&lt;br /&gt;
=== I Want to Download the Script and Host It with My Experiment ===&lt;br /&gt;
This approach involves using scripts that you can download from Socsci GitLab.&lt;br /&gt;
&lt;br /&gt;
# Login to GitLab and go to: [https://gitlab.socsci.ru.nl/tsg/radcloud-datahandler/-/packages]&lt;br /&gt;
# Get the latest version of the datahandler by downloading the file under 'datahandler - Generic'.&lt;br /&gt;
# Add the script to your JavaScript project.&lt;br /&gt;
# Include the following line in your &amp;lt;code&amp;gt;index.html&amp;lt;/code&amp;gt; file pointing to the file:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;amp;lt;script src=&amp;quot;datahandler.1.5.7.js&amp;quot;&amp;amp;gt;&amp;amp;lt;/script&amp;amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Call the function from JavaScript:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
datahandler.saveData(radcloudApiKey, ppn, mydata);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Note:''' Example project: [https://gitlab.socsci.ru.nl/tsg/jspsych-radcloud-example JsPsych radcloud example]&lt;br /&gt;
&lt;br /&gt;
=== I Want to Use Modern JavaScript Tooling ===&lt;br /&gt;
Tooling like npm and import statements. You can install the datahandler from Socsci GitLab package registry.&lt;br /&gt;
This approach allows you to integrate the datahandler into your favorite JavaScript frameworks.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
echo @tsg:registry=https://gitlab.socsci.ru.nl/api/v4/projects/2989/packages/npm/ &amp;gt;&amp;gt; .npmrc&lt;br /&gt;
npm i @tsg/datahandler&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Which installs the latest version of the datahandler.&lt;br /&gt;
Follow up by adding the following import to your ES code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import {saveData} from '@tsg/datahandler';&lt;br /&gt;
saveData(radcloudApiKey, ppn, mydata);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Note:''' Example project: [https://gitlab.socsci.ru.nl/tsg/jspsych-radcloud-esmodule JsPsych radcloud example: I want to use modern JavaScript tooling]&lt;br /&gt;
&lt;br /&gt;
== Save Data Parameters ==&lt;br /&gt;
The datahandler script accepts three parameters.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
datahandler.saveData(radcloudApiKey, ppn, mydata);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
# '''api_key''': String containing the API key from your Radcloud experiment.&lt;br /&gt;
# '''ppn''': The participant number as a string. If not supplied, the save will continue, and data will be added to your experiment under participant '''0'''.&lt;br /&gt;
# '''data''': The JavaScript object containing the data.&lt;br /&gt;
Example JSON object:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
let mydata = {&lt;br /&gt;
    &amp;quot;data&amp;quot;: {&lt;br /&gt;
        &amp;quot;id&amp;quot;: &amp;quot;801744&amp;quot;,&lt;br /&gt;
        &amp;quot;experiment_id&amp;quot;: &amp;quot;1176&amp;quot;,&lt;br /&gt;
        &amp;quot;number&amp;quot;: 2,&lt;br /&gt;
        &amp;quot;responseTime&amp;quot;: null,&lt;br /&gt;
        &amp;quot;buttonResponse&amp;quot;: null,&lt;br /&gt;
        &amp;quot;buttonPressed&amp;quot;: 2,&lt;br /&gt;
        &amp;quot;stimulus&amp;quot;: &amp;quot;stimuli/image/unlock.jpg&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Response ==&lt;br /&gt;
A successful call to the upload endpoint will return the following response.&lt;br /&gt;
It means your task is scheduled and will be processed soon.&lt;br /&gt;
[[File:screenshot11111.png]]&lt;br /&gt;
&lt;br /&gt;
=== Handling the Response in Your Code ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
datahandler.saveData(radcloudApiKey, mydata.ppn, mydata)&lt;br /&gt;
    .then(response =&amp;gt; {&lt;br /&gt;
        if (!response.ok) {&lt;br /&gt;
            message = `Warning: failed saving data (${response.message})`;&lt;br /&gt;
        }&lt;br /&gt;
    });&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== JsPsych Radcloud Example ==&lt;br /&gt;
Git checkout project: [https://gitlab.socsci.ru.nl/tsg/jspsych-radcloud-example JsPsych radcloud example]&lt;br /&gt;
&lt;br /&gt;
== Migrating from Radcloud-mini ==&lt;br /&gt;
# Create a new experiment in Radcloud.&lt;br /&gt;
# Copy the new experiment API key into your script.&lt;br /&gt;
# Add the latest datahandler script to your experiment codebase.&lt;br /&gt;
# Modify the calls from &amp;lt;code&amp;gt;saveData(&amp;lt;/code&amp;gt; into &amp;lt;code&amp;gt;datahandler.saveData(&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Check the response handling and ensure proper error checking.&lt;br /&gt;
'''Warning:''' Data migration from radcloud-mini to radcloud is not supported.&lt;br /&gt;
&lt;br /&gt;
== Support ==&lt;br /&gt;
If you have any questions, suggestions, or feedback, please feel free to reach out to us via email at tsg@ru.nl.&lt;br /&gt;
We'd love to hear from you and are always open to improving this project based on your input.&lt;/div&gt;</summary>
		<author><name>Wiki-admin</name></author>
	</entry>
</feed>