giuliomoro@0
|
1 <?php
|
giuliomoro@0
|
2 // need to generate an array $tests containing the tests in the order they should be executed
|
giuliomoro@0
|
3 $lang='';
|
giuliomoro@3
|
4 $baseUrl = 'index.html?url=hammond/tests'.$lang.'/';
|
giuliomoro@0
|
5 $preSurvey = $defaultTestEntry;
|
giuliomoro@0
|
6 $preSurvey['url'] = $baseUrl.'pre_survey.xml';
|
giuliomoro@11
|
7 $preSurvey['string'] = 'Survey';
|
giuliomoro@0
|
8
|
giuliomoro@0
|
9 $trainingVideo = $defaultTestEntry;
|
giuliomoro@0
|
10 $trainingVideo['url'] = 'embedded_player.php?v=kcRtyvQxbgU';
|
giuliomoro@0
|
11 $trainingVideo['string'] = 'Training video';
|
giuliomoro@0
|
12
|
giuliomoro@0
|
13 $trainingSamples = $defaultTestEntry;
|
giuliomoro@0
|
14 $trainingSamples['url'] = $baseUrl.'training.xml';
|
giuliomoro@0
|
15 $trainingSamples['string'] = 'Training samples';
|
giuliomoro@0
|
16
|
giuliomoro@0
|
17 $postSurvey = $defaultTestEntry;
|
giuliomoro@0
|
18 $postSurvey['url'] = $baseUrl.'post_survey.xml';
|
giuliomoro@0
|
19 $postSurvey['string'] = 'Post-survey';
|
giuliomoro@0
|
20
|
giuliomoro@3
|
21 $abTests = Array($defaultTestEntry, $defaultTestEntry, $defaultTestEntry);
|
giuliomoro@3
|
22 $abTests[0]['url'] = $baseUrl.'AB-p-s.xml';
|
giuliomoro@3
|
23 $abTests[0]['string'] = 'A/B pressed/struck';
|
giuliomoro@3
|
24 $abTests[1]['url'] = $baseUrl.'AB-ps-pf.xml';
|
giuliomoro@3
|
25 $abTests[1]['string'] = 'A/B fast/slow pressed';
|
giuliomoro@3
|
26 $abTests[2]['url'] = $baseUrl.'AB-ss-sf.xml';
|
giuliomoro@3
|
27 $abTests[2]['string'] = 'A/B fast/slow struck';
|
giuliomoro@0
|
28
|
giuliomoro@0
|
29 $likertTest = $defaultTestEntry;
|
giuliomoro@0
|
30 $likertTest['url'] = $baseUrl.'labelling.xml';
|
giuliomoro@0
|
31 $likertTest['string'] = 'Labelling';
|
giuliomoro@0
|
32 // the shuffling of the elements is bound to the last 8 characters of $id
|
giuliomoro@0
|
33 $seed = hexdec(substr($id, -8));
|
giuliomoro@0
|
34 //shuffling only the order of the ABtests
|
giuliomoro@0
|
35 fisherYatesShuffle($abTests, $seed);
|
giuliomoro@11
|
36 $tests = array_merge(Array($preSurvey), Array($trainingVideo), Array($trainingSamples), $abTests, Array($likertTest));
|
giuliomoro@0
|
37
|