Beispiel #1
0
<?php

/**
 * Gets results for an pair-experiment.
 * @return experimentsresults or 0 if none exist.
 */
require_once '../../db.php';
require_once '../../functions.php';
if (!isset($_SESSION['user'])) {
    header("Location: ../../login.php");
}
try {
    $experimentId = $_POST['experimentId'];
    $result = getExperimentResults($experimentId, $db, 0);
    echo json_encode($result);
} catch (PDOException $excpt) {
    echo json_encode(0);
}
Beispiel #2
0
require_once 'ChromePhp.php';
//Gets experimentresults and initializes variables
$id = $_GET['id'];
$ex = getExperimentById($id, $db);
$results;
$images = array();
$experimentOrders = array();
$observers;
$instructions;
$resultRows;
//If no results/user didn't own experiment, redirects to index
if ($ex == 0) {
    header('Location: index.php');
}
//Gets results for experiment
$results = getExperimentResults($id, $db, isset($_GET['complete']) ? 1 : 0);
//Saves experimentOrders
$experimentOrders = $results[1];
//Stuff which are different on methods
switch ($ex['experimentType']) {
    case '1':
        $resultRows = $results[3];
        break;
    case '2':
        $resultRows = $results[3];
        break;
    case '3':
        $resultRows = splitToExperimentOrder(getExperimentRawData($id, $db, 3, isset($_GET['complete']) ? 1 : 0), $results['experimentOrders']);
        break;
}
//Add all images to one array