Merge pull request #27 from mattbk/calculate-total-phases
Calculate total phases and display
This commit is contained in:
@ -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']);
|
||||
|
@ -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>
|
||||
|
Reference in New Issue
Block a user