Mercurial > hg > webaudioevaluationtool
annotate php/pseudo.php @ 3141:335bc77627e0 tip
fixing discrete interface to allow labels to display
author | Dave Moffat <me@davemoffat.com> |
---|---|
date | Mon, 26 Jul 2021 12:15:24 +0100 |
parents | c7de85e03321 |
children |
rev | line source |
---|---|
nicholas@2224 | 1 <?php |
nicholas@3123 | 2 include_once("config.php"); |
nicholas@3114 | 3 header('Access-Control-Allow-Origin: *'); |
nicholas@3114 | 4 header("Content-type: text/xml"); |
nicholas@3114 | 5 header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0"); |
nicholas@3114 | 6 header("Cache-Control: post-check=0, pre-check=0", false); |
nicholas@3114 | 7 header("Pragma: no-cache"); |
nicholas@2224 | 8 |
nicholas@3114 | 9 if (isset($_GET["prefix"]) == FALSE) { |
nicholas@3116 | 10 $prefix = ""; |
nicholas@3114 | 11 } else { |
nicholas@3114 | 12 $prefix = $_GET["prefix"]; |
nicholas@3114 | 13 } |
nicholas@2224 | 14 |
nicholas@3114 | 15 if (isset($_GET["dir"]) == FALSE) { |
nicholas@3117 | 16 $dir = ""; |
nicholas@3114 | 17 } else { |
nicholas@3117 | 18 $dir = $_GET["dir"]; |
nicholas@3114 | 19 } |
nicholas@3120 | 20 $saveLocation = getSaveLocation(); |
nicholas@3120 | 21 $files = glob($saveLocation . $prefix . '*.xml'); |
nicholas@3114 | 22 $numsaves = 0; |
nicholas@3114 | 23 if ( $files !== false ) |
nicholas@3114 | 24 { |
nicholas@3114 | 25 $numsaves = count( $files ); |
nicholas@3114 | 26 } |
nicholas@3114 | 27 |
nicholas@3120 | 28 $testLocation = getTestLocation(); |
nicholas@3120 | 29 $files = glob($testLocation . $dir . '*.xml'); |
nicholas@3114 | 30 $numtests = 0; |
nicholas@3114 | 31 |
nicholas@3114 | 32 if ( $numtests !== false ) |
nicholas@3114 | 33 { |
nicholas@3114 | 34 $numtests = count( $files ); |
nicholas@3114 | 35 } |
nicholas@3114 | 36 |
nicholas@3114 | 37 $testID = ($numsaves % $numtests); |
nicholas@3114 | 38 readfile($files[$testID]); |
nicholas@2457 | 39 ?> |