Commit ba4e378d authored by William Paul Liggett's avatar William Paul Liggett

Test Condition #4 now works!

parent 7d4343de
......@@ -38,8 +38,8 @@
<p class="version_info"><strong>TO DO:</strong></p>
<ol>
<li>Test Conditions #3, and 4: Visually show the correct durations for the tasks and break depending on the test
condition. This includes embedding a nature video for test condition #3. [Estimate: 3 hours]</li>
<li>Test Conditions #3: Visually show the correct durations for the tasks and break depending on the test
condition. This includes embedding a nature video for test condition #3. [Estimate: 2 hours]</li>
<li>Log Data to CSV: Using the two raw CSV files, build a single, collated CSV to produce a data analysis report.
[Estimate: 2 hours remaining]</li>
......@@ -51,11 +51,11 @@
</ol>
<p class="version_info">Version 1.8.0 (2018-03-21):</p>
<p><em>Estimated labor time: <span id="hours_logged_for_update_17">2</span> hours.</em></p>
<p><em>Estimated labor time: <span id="hours_logged_for_update_17">4.5</span> hours.</em></p>
<ul>
<li>
Test Conditions #1: This condition now works and flows as expected! So, this means that conditions #1 and #2
are good to go.
Test Conditions #1 and #4: These conditions now work and flow as expected! So, this means that conditions #1, #2,
and #4 are good to go.
</li>
<li>
Participant Login Management: Fixed a glitch with regards to different users logging onto the same computer
......
......@@ -51,7 +51,9 @@ h2 {
#vigilance_display_extra_text {
width: 80%;
display: block;
margin: auto;
margin-left: auto;
margin-right: auto;
margin-bottom: 1rem;
text-align: center;
}
......
......@@ -232,20 +232,30 @@ var ov_participant_response_time = -1;
}
// Shows the vigilance test (small background circles and flashing random letters) when needed.
function showVigilanceDisplay(banner_text = "", each_test_block_duration = 0, record_activity = true) {
function showVigilanceDisplay(banner_text = "", each_test_block_duration = 0) {
// Let's the primary keydown() script know that any space bar presses should be counted in the user activity array.
// The only reason this should be set to `false' is for Test Condition #4 as the break still shows random letter,
// but we're not supposed to record the user's activity in this instance.
ov_record_user_activity = record_activity;
ov_record_user_activity = true;
// Outputs the "Practice Test" banner.
if(banner_text !== "") {
if(banner_text === "Practice Test") {
$("#vigilance_display_banner_text").html(banner_text); // This is a Practice Test.
$("#vigilance_display_extra_text").html("&nbsp;");
ov_test_type = "P"; // Practice Test. Included as part of the user's activity array.
ov_test_block = 0; // The practice test block is always 0.
}
// Test Condition #4: We want the random letters to display, but we don't want to record the user's activity!
// The `banner_text' will say... Break: X minutes and Y seconds remaining
else if(banner_text !== "") {
ov_record_user_activity = false;
$("#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 " +
"<strong>O</strong>, not for any other letter.");
}
// This is a real test/experiment.
else {
$("#vigilance_display_banner_text").html("&nbsp;");
......@@ -257,6 +267,7 @@ var ov_participant_response_time = -1;
ov_test_block_timer_id = setInterval(function() {++ov_test_block; }, OV_TEST_BLOCK_EACH_DURATION);
}
// Shows the flashing random letters and small background circles to the user.
$("#VigilanceDisplay").removeClass("hidden");
}
......@@ -281,6 +292,7 @@ var ov_participant_response_time = -1;
$("#vigilance_display_extra_text").html("&nbsp;");
}
// Hides the flashing random letters and small background circles to the user.
$("#VigilanceDisplay").addClass("hidden");
}
......@@ -481,14 +493,13 @@ var ov_participant_response_time = -1;
var thirty_seconds_in_ms = parseFloat(30000); // 30 seconds = 30,000 ms [Used between the practice and the real test.]
var practice_time_in_ms = thirty_seconds_in_ms; // Practice Test is only 30 seconds for now.
//var twelve_minutes_in_ms = parseFloat(720000); // 12 minutes = 720,000 ms
//var four_minutes_in_ms = parseFloat(240000); // 4 minutes = 240,000 ms
var four_minutes_in_ms = parseFloat(240000); // 4 minutes = 240,000 ms
// Inaccurate... TESTING VALUES.
var twelve_minutes_in_ms = thirty_seconds_in_ms;
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;
//var four_minutes_in_ms = thirty_seconds_in_ms;
//var twelve_minutes_in_ms = parseFloat(360000); // 6 minutes = 360,000 ms
//var four_minutes_in_ms = parseFloat(240000); // 4 minutes = 240,000 ms
// Begins the 30-second practice test regardless of which condition is used.
showVigilanceDisplay("Practice Test");
......@@ -531,10 +542,17 @@ var ov_participant_response_time = -1;
else {
// Test Condition #4
// Hides the initial OV display after 12 minutes, and then shows another iteration of it during the Break.
// Although, this `showVigilanceDisplay()' will NOT record the user's activity.
setTimeout(showVigilanceDisplay, (practice_time_in_ms + thirty_seconds_in_ms + twelve_minutes_in_ms), "Break: <span id=\"ov_timer_minutes\">4</span><span id=\"ov_timer_minutes_label\"> minutes and </span><span id=\"ov_timer_seconds\">0</span> seconds");
setTimeout(countdownTimer, (practice_time_in_ms + thirty_seconds_in_ms + twelve_minutes_in_ms), 240); // 240 seconds = 4 minutes
// Shows the OV display again after the 4 minute break.
setTimeout(showVigilanceDisplay, (practice_time_in_ms + thirty_seconds_in_ms + twelve_minutes_in_ms + four_minutes_in_ms));
// Concludes the test once 28 minutes have passed (12 min + 4 min + 12 min).
setTimeout(concludeTest, (practice_time_in_ms + thirty_seconds_in_ms + twelve_minutes_in_ms * 2 + four_minutes_in_ms));
}
$("#VigilanceDisplay").removeClass("hidden");
});
});
......
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