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

Modified how a number of functions operate to accommodate different break...

Modified how a number of functions operate to accommodate different break messages, such as in-between the practice and real test and then again in-between two real 12-min tasks.
parent 5907aba9
......@@ -50,6 +50,16 @@
is an <em>optional</em> feature [Estimate: 0-2 hours]</li>
</ol>
<p class="version_info">Version 1.8.1 (2018-03-22):</p>
<p><em>Estimated labor time: <span id="hours_logged_for_update_18">0.5</span> hours.</em></p>
<ul>
<li>
Modified how a number of functions operate to accommodate different break messages so that the mini-break between
the practice test and the real test can have its own title and descriptive text labels during the break, while
the larger 4-minute break between two 12-minute vigilance tasks can have its own break text labels.
</li>
</ul>
<p class="version_info">Version 1.8.0 (2018-03-21):</p>
<p><em>Estimated labor time: <span id="hours_logged_for_update_17">4.5</span> hours.</em></p>
<ul>
......@@ -240,7 +250,8 @@
parseFloat($("#hours_logged_for_update_14").html()) +
parseFloat($("#hours_logged_for_update_15").html()) +
parseFloat($("#hours_logged_for_update_16").html()) +
parseFloat($("#hours_logged_for_update_17").html());
parseFloat($("#hours_logged_for_update_17").html()) +
parseFloat($("#hours_logged_for_update_18").html());
// Displays the total labor hours at the top of the page.
$("#total_labor_hours").html(calculated_labor_time);
......
......@@ -272,7 +272,7 @@ var ov_participant_response_time = -1;
}
// Hides the vigilance test (small background circles and flashing random letters) when needed.
function hideVigilanceDisplay(banner_text = "") {
function hideVigilanceDisplay(banner_text = "", extra_text = "") {
// Let's the primary keydown() script know that any space bar presses should NOT be counted in the user activity array.
ov_record_user_activity = false;
......@@ -281,10 +281,16 @@ var ov_participant_response_time = -1;
// Outputs the "Break" banner when needed.
if(banner_text !== "") {
// Default message between a break. Typically used for the larger 4-min break in-between two 12-min tasks.
// But, it was requested to provide a different message in-between the Practice Test and the Actual Test.
if(extra_text === "") {
extra_text = "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.";
}
$("#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.");
$("#vigilance_display_extra_text").html(extra_text);
}
else {
......@@ -456,7 +462,7 @@ var ov_participant_response_time = -1;
// Success! Let's end the participant's test.
else {
$("#vigilance_display_banner_text").html("Test Complete");
$("#vigilance_display_extra_text").html("We know this test was difficult, so we thank you very much for participating!");
$("#vigilance_display_extra_text").html("Thank you very much for participating!");
// Shows the participant's "Sign Out" button to allow another participant to sign-in on the same computer.
$("#user_sign_out").removeClass("hidden");
......@@ -486,9 +492,8 @@ var ov_participant_response_time = -1;
$("#login_welcome_msg").remove();
$("#StartTestButton").remove();
// Records when the time actually began in the format of: "3/4/2018 19:11:12:565 (the "565" is the milliseconds)
//ov_test_began_datetime = getCurrentDatetime()[0];
ov_test_began_datetime = Date.now(); // Time in ms since the Unix epoch time
// Records when the time actually began the test. Time in ms since the Unix epoch.
ov_test_began_datetime = Date.now();
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.
......@@ -504,8 +509,15 @@ var ov_participant_response_time = -1;
// Begins the 30-second practice test regardless of which condition is used.
showVigilanceDisplay("Practice Test");
// Custom break message that will be used as the `extra_text' argument for the hideVigilanceDisplay() function
// that is shown to the user in-between the practice and the actual tests.
var descriptive_text_between_practice_and_real_tests =
"The test will automatically begin shortly. 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.";
// Stops the practice test and gives the user a 30-second mini-break.
setTimeout(hideVigilanceDisplay, practice_time_in_ms, "Break: <span id=\"ov_timer_minutes\"></span><span id=\"ov_timer_minutes_label\"></span><span id=\"ov_timer_seconds\">30</span> seconds");
setTimeout(hideVigilanceDisplay, practice_time_in_ms, "Test Begins In: <span id=\"ov_timer_minutes\"></span><span id=\"ov_timer_minutes_label\"></span><span id=\"ov_timer_seconds\">30</span> seconds", descriptive_text_between_practice_and_real_tests);
setTimeout(countdownTimer, practice_time_in_ms, 30);
// Starts the real test after the 30-second mini-break.
......
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