Commit 689ce145 authored by William Paul Liggett's avatar William Paul Liggett

Test Condition #4: Fixed a minor glitch. Also, other code was refactored slightly.

parent 9b38ad3c
......@@ -9,7 +9,7 @@
}
?>
<!DOCTYPE html>
<html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>OpenVigilance Task: Admin Page</title>
......@@ -87,6 +87,8 @@
$rows = $statement->fetchAll(); // Grabs all of the rows.
// Section heading.
echo "<p class=\"center\" style=\"font-size: 11pt;\"><strong>Captured User Test Data:</strong> <a href=\"../user-data-files\" target=\"_blank\">CSV (Comma-Separated Values) Files</a><br />" . PHP_EOL;
echo "Tip: Removing a scheduled test will <em>not</em> delete any previously-recorded CSV data files.</p>" . PHP_EOL;
echo "<h2>Scheduled Tests</h2>" . PHP_EOL;
// Creates the main <form> to enable the add, edit, and remove button functionalities.
......
<!DOCTYPE html>
<html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>OpenVigilance Task: Change Log</title>
......@@ -47,19 +47,36 @@
is an <em>optional</em> feature [Estimate: 0-2 hours]</li>
</ol>
<p class="version_info">Version 1.9.2 (2018-03-28):</p>
<p><em>Estimated labor time: <span id="hours_logged_for_update_21">1</span> hours.</em></p>
<ul>
<li>
Test Condition #4: Fixed a glitch on how the test block values were recorded. Also, I corrected any
previously-created raw CSV files for participants that had taken condition #4 recently. The corrected CSV files
are still valid as the test block values that were amended were minor and obvious to spot. Furthermore, the
original inaccurate values had no impact on the more important timing (millisecond time stamps) or similar
values which were recorded in the raw CSV files. So, to be clear, there was no data loss, just a minor data
revision. All is well!
</li>
</ul>
<p class="version_info">Version 1.9.1 (2018-03-27):</p>
<p><em>Estimated labor time: <span id="hours_logged_for_update_20">3</span> hours.</em></p>
<ul>
<li>
Test Condition #4: Created an image to be used to pop-up and remind the user that a break is in session to
help them relax. This feature was requested as condition #4 has a short break but will continue to flash the
random letters on the screen. So, some participants were not aware that a break had started.
<br /><br />
The pop-up now shows whenever a user presses the space bar during the break. The reminder currently stays on
the screen for 3.5 seconds and has a nice fade-out animation.
<br /><br />
Also, I forced this reminder image to download before a participant for condition #4 can begin the test,
since we want the image available in case a user gets disconnected while taking the the test.
random letters on the screen. So, some participants were not aware that a break had started.<br /><br />
<ul>
<li>
The pop-up now shows whenever a user presses the space bar during the break. The reminder currently
stays on the screen for 3.5 seconds and has a nice fade-out animation.
</li>
<li>
Also, I forced this reminder image to download before a participant for condition #4 can begin the
test, since we want the image available in case a user gets disconnected while taking the the test.
</li>
</ul>
</li>
</ul>
......@@ -290,7 +307,8 @@
parseFloat($("#hours_logged_for_update_17").html()) +
parseFloat($("#hours_logged_for_update_18").html()) +
parseFloat($("#hours_logged_for_update_19").html()) +
parseFloat($("#hours_logged_for_update_20").html());
parseFloat($("#hours_logged_for_update_20").html()) +
parseFloat($("#hours_logged_for_update_21").html());
// Displays the total labor hours at the top of the page.
$("#total_labor_hours").html(calculated_labor_time);
......
......@@ -9,7 +9,7 @@
}
?>
<!DOCTYPE html>
<html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>OpenVigilance Task</title>
......@@ -54,6 +54,11 @@
// Displays the HTML login <form>.
// There should be no error on first load, but this keeps the form layout in the same position.
echo $h1_page_title;
// MAINTENANCE MODE: Uncomment the line below and comment out the NO MAINTENANCE lines to disable logins.
//echo "<p class=\"center\">Sorry, the system is under maintenance. Please come back later.</p>" . PHP_EOL;
// NO MAINTENANCE (Default) -- Uncomment the two lines to enable a participant's login capability.
echo "<p class='error_msg'>$error_msg</p>";
echo $login_form;
}
......
......@@ -137,10 +137,10 @@ var ov_participant_response_time = -1;
return Math.floor(Math.random() * Math.floor(max));
}
// The chosen random letter is first determined and then, eventually,
// the letter will be displayed to the user in a later code block.
// Note: The `chosen_letter' var will matche the CSS class ID in the HTML,
// as we'll use this later for the duration the letter is displayed.
// changeRandomLetter(): Displays a random letter and then logs the timing data of when it was displayed to an array.
// The chosen random letter is first determined and then, eventually, the letter will be displayed to the user in a
// later code block. Note: The `chosen_letter' var will match the CSS class ID in the HTML, as we'll use this later
// for the duration the letter is displayed.
function changeRandomLetter() {
var random_int = getRandomInt(3);
var chosen_letter = "";
......@@ -231,6 +231,10 @@ var ov_participant_response_time = -1;
}
}
// Sets a continual timer to change the random letter displayed.
// An event is a random letter change set to the rate of EVENTS_PER_MINUTE.
setInterval(changeRandomLetter, EVENTS_PER_MINUTE);
// Shows the vigilance test (small background circles and flashing random letters) when needed.
function showVigilanceDisplay(banner_text = "", hide_nature_video = false) {
// Let's the primary keydown() script know that any space bar presses should be counted in the user activity array.
......@@ -250,6 +254,10 @@ var ov_participant_response_time = -1;
// The `banner_text' will say... Break: X minutes and Y seconds remaining
else if(banner_text !== "") {
ov_record_user_activity = false;
// Stops incrementing the test block number every 2-min until a showVigilanceDisplay() without a break is called again.
clearInterval(ov_test_block_timer_id);
$("#vigilance_display_banner_text").html(banner_text);
$("#vigilance_display_extra_text").html("The test will automatically begin after the break. Please be ready.<br />" +
"Again, press the <strong>space bar</strong> only when you see the letter " +
......@@ -484,9 +492,6 @@ var ov_participant_response_time = -1;
}
}
// An event is a random letter change set to the rate of EVENTS_PER_MINUTE.
setInterval(changeRandomLetter, EVENTS_PER_MINUTE);
$(document).ready(function() {
// For: Test Condition #3. Ensures that the entire nature video is downloaded, since a user may get disconnected!
if(ov_test_condition === 3) {
......@@ -496,7 +501,8 @@ var ov_participant_response_time = -1;
var req = new XMLHttpRequest();
// The video clip is from: https://www.youtube.com/watch?v=MjCorj48dEw (Creative Commons Attribution)
// The video clip is from: https://www.youtube.com/watch?v=MjCorj48dEw
// License: Creative Commons Attribution
// Clip title: National Geographic 2018 | The Most Peaceful Places on Earth | New Documentary 2018
// YouTube Channel: Breakthrough GO (https://www.youtube.com/channel/UCYuVc2_bO0HAWpqVvF2Mr-A)
// Published on YouTube: January 1st, 2018
......@@ -505,13 +511,12 @@ var ov_participant_response_time = -1;
req.responseType = 'blob';
req.onload = function() {
// Onload is triggered even on 404
// so we need to check the status code
// `onload' is triggered even on 404. So, we need to check the status code.
if(this.status === 200) {
var videoBlob = this.response;
var vid = URL.createObjectURL(videoBlob); // IE10+
// Video is now downloaded
// and we can set it as source on the video element
// Video is now downloaded! We can set it as source on the video element.
var nature_video = $("#nature_video").get(0);
nature_video.src = vid;
......@@ -541,13 +546,12 @@ var ov_participant_response_time = -1;
req.responseType = 'blob';
req.onload = function() {
// Onload is triggered even on 404
// so we need to check the status code
// `onload' is triggered even on 404. So, we need to check the status code.
if(this.status === 200) {
var imageBlob = this.response;
var image = URL.createObjectURL(imageBlob); // IE10+
// Video is now downloaded
// and we can set it as source on the video element
// Image is now downloaded! We'll now add it to the DOM.
$("#break_reminder_popup").append("<img id=\"break_reminder_popup_image\" src=\"media/break_reminder_for_test_condition_4.png\" alt=\"Break Reminder Pop-Up\" />");
break_reminder_download_complete = true;
......@@ -573,7 +577,7 @@ var ov_participant_response_time = -1;
ov_user_activity_log.push([ov_global_trial_counter, ov_participant_response_time]);
}
// Test Condition #4: Reminders the participant that a break is occurring by showing a pop-up image.
// Test Condition #4: Reminds the participant that a break is occurring by showing a pop-up image.
else if((event.which === 32) && (ov_test_condition === 4) &&
(ov_record_user_activity === false) && (ov_test_block > 0)) {
......@@ -610,7 +614,7 @@ var ov_participant_response_time = -1;
var twelve_minutes_in_ms = parseFloat(720000); // 12 minutes = 720,000 ms
var four_minutes_in_ms = parseFloat(240000); // 4 minutes = 240,000 ms
// Inaccurate... TESTING VALUES.
// Inaccurate... ALPHA TESTING VALUES.
//var twelve_minutes_in_ms = parseFloat(15000); // 15 seconds = 15,000 ms
//var twelve_minutes_in_ms = parseFloat(120000); // 2 minutes = 120,000 ms
//var four_minutes_in_ms = thirty_seconds_in_ms;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment