I'm trying to mkae a simple association test in which people have to fill in their own association to 2 stimuli (presented together), the association (a few words) is then written to the database (MySQL) and will be used for testing later on.
I've gotten it to display everything I want but the association people should fill in is deleted every time and doesn't get written to the database, while the stimulus stays the same (doesn't go the next item where it should).
I pasted the code for the task, and the process page here:
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Exp Test 2</title>
if ($subject_id == "")
{
echo "Subject ID is a required field";
exit(1);
}
else if ($hint == array())
{
echo "There are no elaborations to save";
exit(1);
}
else
{
$data = array(
'subject_id' => $subject_id,
'hint' => json_encode($hint) // convert to text string
);
Anyone see what I'm doing wrong? I'm totally new at JS, dojo or php and have to learn from trial and error, so I'm curious as to what mistakes I am making.
Thanks!
02-25-2011, 07:29 AM
Kor
You should isolate your problem. Too much code which is not related with your problem. What that dojo.js external file does? Is it related with your problem?
In fact: make clear what you want and want doe not work. Clear.
02-25-2011, 07:40 AM
NotANumber
Okay, I'd say this is the most important part of the code where the problem might be.
It does not give any errors, just blanks out the answer bar again and does not load the next image. So it seems like it doesn't even get to the save() function.
Code:
var elaborate =
{
hint: [], // LONGTEXT string in the DB, called 'hint'
subject_id: "group1", // TEXT string in the DB.
}