0

As part of a study, I'm designing a basic recognition memory experiment in JavaScript, in which participants are first presented with a series of pictures to learn, and then are shown a larger set of images, and have to identify which of those they have seen before.

While I would usually use the EPrime package, or Python (Experiment) for this kind of task, I've been writing it in JavaScript so that I can test in large groups (I only have EPrime on 6 computers, and currently Python on only my own).

As a JS/html noob, my problem is I can't figure out a way of collecting the data for analysis (i.e. sending it to myself, or saving it to a server somewhere). Can anyone help me out on this please?

JasonMArcher
  • 14,195
  • 22
  • 56
  • 52
Eoin
  • 565
  • 3
  • 14

2 Answers2

2

You can just submit the result using the standard GET/POST requests to a PHP server. The PHP server can than save the submitted result into a database.

You can look at a starter guide at http://www.ajaxprojects.com/ajax/tutorialdetails.php?itemid=510

Jeremy
  • 4,797
  • 1
  • 18
  • 26
1

First of all, Welcome to stackoverflow!

It's common (and by the way describe in FAQ) to ask more direct and objective questions here, like:

How method X works on framework Y and why it's not working ?

Questions like:

How can I build an entire system X to acomplish Y?

Are somewhat beyond the scope of this site.

HOWEVER

I'll try to provide a general guidance on how you can achieve what you are trying to do. Since your question was pretty generic (Lack of proper details, like code, targeted public, environment) my answer unfortunately will be as generic.

Javascript

As you may know, javascript is a client side technology, it was made to provide simple and dynamic interaction for the user. You hardly will achieve what you are trying to do using solely javascript. You see, even if there are ways for javascript communicate with the server to store and handle the information you will likely to use another server-side technology, like php and maybe a database like mysql

Memory Game

Let's divide the problem in smaller tasks so you can ask individually how:

  • You need several images to accomplish what you are trying to do.
  • You will need need at least two phases:The one where you show the first images and the one you will present all the images to the users
  • You will need some random function to pick what images you should show in which phase. This can be easily accomplished with php and more or less easy with javascript (or jQuery).
  • You will need to use javascript to submit to the server which images the user picked
  • You will need to provide a php script to handle those submits and then store it in someplace for some analysis. Also, this step require to give a certain output to the user.
  • And to finish, you need to show this result for the users.

So now you can start to think what you already have and you will ask here. Next time come with a snippet of code. If you are trying to learn HTML/Javascript/CSS/PHP/MYSQL (I don't know if you don't) you may check w3schools for nice and complete tutorials and of course, do some research here at stack overflow.

I hope it helped you somehow. Cheers

Bruno Vieira
  • 3,884
  • 1
  • 23
  • 35