Calculate total phases and display #27

Merged
mattbk merged 1 commits from calculate-total-phases into master 2015-11-02 11:44:31 -06:00
2 changed files with 4 additions and 3 deletions

View File

@ -66,9 +66,10 @@ switch ($mode) {
break;
case 'phase':
$template = 'change.html.twig';
$variables['imageWithElement'] = 'img/'.$phase.'-with.png';
$variables['imageWithoutElement'] = 'img/'.$phase.'-without.png';
$variables['imageWithElement'] = 'img/'.$phase.'-with.jpg';
$variables['imageWithoutElement'] = 'img/'.$phase.'-without.jpg';
$variables['step_count'] = $index;
$variables['step_total'] = count($settings->phases);
// Store the participant ID with some simple validation to prevent SQL injection
if (isset($_POST['participantid'])) {
$_SESSION['participantid'] = preg_replace('/[^A-Za-z0-9\. -]/', '', $_POST['participantid']);

View File

@ -2,7 +2,7 @@
{% block content %}
<header class="page-header">
<h1>Change blindness test (step {{ step_count }} of 3)</h1>
<h1>Change blindness test (step {{ step_count }} of {{ step_total }})</h1>
</header>
<div id="placeholder" class="well">
<p>Please wait while the images are loaded.</p>