You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi all,
A month back, I worked on an experiment where a set of participants completed a multi-attribute-choice project. On each trial, participants saw two options and chose which one they would prefer. In the next part of my experiment, I want to present each of the previous participants' choices to a new participant. In order to achieve that, I want to save the new participants' data to a database and retrieve their row numbers. Row number would further match my previous database.
I am able to save the database. I am stuck at getting row number as variable in my jsPsych script.
Here is what I am thinking of doing:
Add get_data function to utilities.js:
function get_data(){
var xmlhttp;
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
var response =xmlhttp.responseText;
}
}
xmlhttp.open("GET","getData.php",true);
xmlhttp.send();
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
A month back, I worked on an experiment where a set of participants completed a multi-attribute-choice project. On each trial, participants saw two options and chose which one they would prefer. In the next part of my experiment, I want to present each of the previous participants' choices to a new participant. In order to achieve that, I want to save the new participants' data to a database and retrieve their row numbers. Row number would further match my previous database.
I am able to save the database. I am stuck at getting row number as variable in my jsPsych script.
Here is what I am thinking of doing:
Add get_data function to utilities.js:
This is my getData.php:
Clearly, this isn't working. Can anyone help with this or suggest any other approach, please? Thank you.!
Beta Was this translation helpful? Give feedback.
All reactions