コード例 #1
0
" class="zoomInput" hidden/>   <!-- Jquery puts modified zoom value here and it is submitted when shuffle button is pressed-->
    <span id="zoomVal" class="hidden"><?php 
echo $val;
?>
</span>                                               <!-- keeps the zoom value most recently submitted -->
    <form id="shuffleFile" action="" method="get"></form>                   <!-- the form that submits the selctions made on this page -->

<?php 
if ($store['loc'] !== '' && inString('.csv', $store['loc']) == true) {
    $before = GetFromFile($store['loc']);
    // grab file to shuffle
    $timer = microtime(true);
    // start a timer
    $after = multiLevelShuffle($before);
    // run basic shuffles
    $after = shuffle2dArray($after);
    // run advanced shuffles
    $timer = microtime(true) - $timer;
    // calculate difference since start
    $timer = round($timer * 1000000, 0);
    // multiply by 1,000,000 and round
    $tableTimer = microtime(true);
    // show the before shuffling version
    echo '<div class="before"><div id="RF"><h2>Before</h2>';
    display2dArray($before);
    echo '</div></div>';
    // show the after shuffling version
    echo '<div class="after"><h2>After</h2>';
    display2dArray($after);
    echo '</div>';
    $tableTimer = round((microtime(true) - $tableTimer) * 1000000, 0);
コード例 #2
0
$addColumns = array('Text');
foreach ($addColumns as $add) {
    foreach ($trialTypeColumns as $number => $colName) {
        // check all trial type levels we found
        if ($number == 0) {
            $prefix = '';
        } else {
            $prefix = 'Post' . ' ' . $number . ' ';
        }
        $column = $prefix . $add;
        addColumn($cleanProcedure, $column);
        // this will only add columns if they don't already exist; nothing is overwritten
    }
}
$procedure = multiLevelShuffle($cleanProcedure);
$procedure = shuffle2dArray($procedure, $_CONFIG->stop_at_login);
$_SESSION['Procedure'] = $procedure;
// Load entire experiment into $Trials[1-X] where X is the number of trials
$Trials = array(0 => 0);
$procedureLength = count($procedure);
for ($count = 2; $count < $procedureLength; $count++) {
    // $Trials[$count-1] = makeTrial($procedure[$count]['Item']);
    $items = rangeToArray($procedure[$count]['Item']);
    $stim = array();
    foreach ($items as $item) {
        if (isset($stimuli[$item]) and is_array($stimuli[$item])) {
            foreach ($stimuli[$item] as $column => $value) {
                $stim[$column][] = $value;
            }
        }
    }