Andrea Deme
|
|
Group: Forum Members
Posts: 16,
Visits: 34
|
oh, you looked it up! great!!! thanks a lot!! :)
|
|
|
Andrea Deme
|
|
Group: Forum Members
Posts: 16,
Visits: 34
|
yes, you are absolutely right about the multiple heads and tails, and that I shouldn't worry about this... I tried math.floor implementation again and multiple (5 or 6) odd numbers in a raw also occurred. than i tried ceil and seemed a tiny bit more balanced (but still, it was just 6 or 7 trials that is very impressionistic), anyway, i'll stick to that and thank you again for your time and effort! it was a huge help you just gave me!! :)
|
|
|
Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 107K
|
Hmm, weird. (1) It is, of course, perfectly possible to receive multiple even ids in a row. Same thing as tossing a coin -- nothing prevents in from landing heads multiple times in a row. Over the long run, though, the expectation is approx. 50% heads and 50% tails, or as here: 50% odd and 50% even numbers. (2) It might be that your browser's JavaScript engine has a bug or bias in its Math.random() or Math.floor() implementation. Would be interesting to know if the same happens across different browsers or if changing the function to e.g.
function GetSubjectNumber() { return (Math.round(Math.random() * 1000000000)); }
or
function GetSubjectNumber() { return (Math.ceil(Math.random() * 1000000000)); }
makes any (systematic) difference.
EDITED TO ADD: It is usually not advisable to use Math.round() because it will lead to the resulting distribution being non-uniform.
|
|
|
Andrea Deme
|
|
Group: Forum Members
Posts: 16,
Visits: 34
|
The puzzling thing is that I do get different numbers as IDs, but all of them just seems to be even numbers (see attached), and I have no idea, why :( The script must be okay, I think, as if I run it on the PC with odd and even numbers as IDs it changes the block order... (And I modified the launch page just as you instructed me to, but according to the huge numbers, it is working properly, i think...)
|
|
|
Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 107K
|
Either the condition assignment in your script is faulty, or you have not properly replaced the GetSubjectNumber() in the launch page's source or you're not refreshing the launch page between runs (which you need to do to get a new id).
|
|
|
Andrea Deme
|
|
Group: Forum Members
Posts: 16,
Visits: 34
|
You are great, thanks a lot!!!
And now I faced another problem :) My script, as it is usual, should give compatible-incompatible and incompatible-compatible block orders for different participants (based on their IDs), but the way I introduced random ID selection in the jawa script keeps giving them even numbers all the time, so I don't have a balanced distribution of the 2 differemt orders above. I run 12 tests and I got incompatible-compatible order all the time (and even numbers as subj ID). Is there a way I could affect the distribution of odd and even numbers?
|
|
|
Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 107K
|
Instead of
<survey mysurvey> / pages = [1=page1; 2=page2; ...] .... </survey>
you do
<block mysurvey> / trials = [1=page1; page2; ...] ... </block>
In the <block> that runs the <surveypage>s, set the /screencolor attribute to what you want / need.
|
|
|
Andrea Deme
|
|
Group: Forum Members
Posts: 16,
Visits: 34
|
I did include all the blocks and trials in the main script (attached) but the problem is that he options on the survey pages appear in black (on black background) so they are invisible. On which level could/should I change the font color?
The second comment is also great, thanks! But I am afraid that I am not sure what you mean by running surveypages via block elements. Should every surveypage be included/embedded in a block element or should I reconstruct the <surveypage> elemnts to trials and the <survey> to <block> by transforming the synatx of these?
|
|
|
Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 107K
|
One more thing: If you want to end up with all the data in a single file per subject, you must avoid using <survey> elements (those will always generate a separate output file). Instead, run any surveypages via <block> elements.
|
|
|
Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 107K
|
You don't need to use <include>. In fact, putting the elements directly into a single "main" script is probably easier -- all <include> does is paste the contents of one file into another, so it amounts to the same thing anyway.
|
|
|