view new/test_list.php @ 15:853caf8cd74b

Update
author Giulio Moro <giuliomoro@yahoo.it>
date Wed, 04 May 2016 17:25:19 +0100
parents
children 01608b20a12d
line wrap: on
line source
<?php
// make sure $seed exists before including this script. $seed is used to shuffle the order of the tests.
// make sure $defaultTestEntry is defined
// need to generate an array $tests containing the tests in the order they should be executed
  $lang='';
  $baseUrl = 'test.html?url=hammond/tests'.$lang.'/';
  $preSurvey = $defaultTestEntry;
  // $preSurvey['url'] = $baseUrl.'pre_survey.xml';
  $preSurvey['url'] = "survey.php?";
  $preSurvey['string'] = 'Survey';
  
  $trainingVideo = $defaultTestEntry;
  $trainingVideo['url'] = 'embedded_player.php?v=kcRtyvQxbgU';
  $trainingVideo['string'] = 'Training video';
  $trainingVideo['alwaysAccessible'] = true;

  $trainingSamples = $defaultTestEntry;
  $trainingSamples['url'] = $baseUrl.'training.xml';
  $trainingSamples['string'] = 'Training samples';
  $trainingSamples['alwaysAccessible'] = true;
  
  $abxTest = $defaultTestEntry;
  $abxTest['url'] = $baseUrl.'ABX.xml';
  $abxTest['string'] = 'A/B/X';

  $abTests = Array($defaultTestEntry, $defaultTestEntry, $defaultTestEntry);
  $abTests[0]['url'] = $baseUrl.'AB-p-s.xml';
  $abTests[0]['string'] = 'A/B pressed/struck';
  $abTests[1]['url'] = $baseUrl.'AB-ps-pf.xml';
  $abTests[1]['string'] = 'A/B fast/slow pressed';
  $abTests[2]['url'] = $baseUrl.'AB-ss-sf.xml';
  $abTests[2]['string'] = 'A/B fast/slow struck';

  $likertTest = $defaultTestEntry;
  $likertTest['url'] = $baseUrl.'labelling.xml';
  $likertTest['string'] = 'Labelling';
  // the shuffling of the elements is bound to the last 8 characters of $id
  $seed = hexdec(substr($id, -8)); 
  //shuffling only the order of the ABtests
  fisherYatesShuffle($abTests, $seed);
  $tests = array_merge(Array($preSurvey), Array($trainingVideo), Array($trainingSamples), Array($abxTest), $abTests);