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

Collated CSV Reports: Added the column "TestCondition" to the collated CSV...

Collated CSV Reports: Added the column "TestCondition" to the collated CSV files. Also, any previously-generated collated report was updated with this change and placed in the newly created "collated" sub-directory under the "user-data-files" folder.
parent 137dc288
......@@ -334,6 +334,7 @@ if(isset($_POST['csv_filenames'])) {
// Since PHP is awesome, we can create the array to index it as it shows up in the GlobalTrialCounter
// data for the 2nd CSV. This way, $php_array_raw1[42] and $php_array_raw2[42] will refer to the same letter! :-)
// Specifically, we'll have this raw2 array stored in the format of:
//
// GlobalTrialCounter = ov_participant_response_time
// ------------------ -----------------------------
// $php_array_raw2[42] = 1522270448181
......@@ -364,7 +365,8 @@ if(isset($_POST['csv_filenames'])) {
// * RT: Response Time (ms) of the participant. This value is > 0 if a user responded. For both the Target and Distractor.
// * Correct: If the participant responds to the letter "O" in less than one second, this value is 1. It's 0 if they guess wrong or don't respond in time.
$title_headings = [
"SID",
"SubjectID",
"TestCondition",
"TimeStamp",
"Type",
"Block",
......@@ -382,6 +384,9 @@ if(isset($_POST['csv_filenames'])) {
// Subject ID from the validated filename information.
$subject_id = $portion_2a;
// Same thing for Test Condition #
$test_condition = $portion_4a;
for($i = 1; $i < count($php_array_raw1); $i++) {
// GlobalTrialCounter
$global_trial_counter = $php_array_raw1[$i][0];
......@@ -389,7 +394,6 @@ if(isset($_POST['csv_filenames'])) {
// TimeStamp in milliseconds.
$time_stamp = $php_array_raw1[$i][2];
// ov_random_letter_is_o
$ov_random_letter_is_o = $php_array_raw1[$i][5];
......@@ -445,6 +449,7 @@ if(isset($_POST['csv_filenames'])) {
$collated_row = [
$subject_id, // SID
$test_condition, // Test Condition #
$time_stamp_output, // TimeStamp
$php_array_raw1[$i][3], // Type
$php_array_raw1[$i][4], // Block
......@@ -462,7 +467,8 @@ if(isset($_POST['csv_filenames'])) {
// ------------------------------------------------------------------------------------------------------------
// Creates the single, collated CSV file report and stores it on the web server.
//
$filepath = "../user-data-files/collated/";
// Filename Prefix: E.g., "ov_subject_14_condition_3_on_20180330_1340_EDT"
$filename_prefix = substr($raw1_csv_filename_random_letter_times, 0, $portion_11_start);
$filename_suffix = "_collated_file_report.csv";
......@@ -489,11 +495,10 @@ if(isset($_POST['csv_filenames'])) {
// Sets the file to be read-only to indicate that no data should ever be modified directly later on!
chmod($filepath . $filename, 0444);
// Success!
output_json_response(true, "New collated CSV file created!!!", var_export($php_array_collated, true));
return;
}
catch(\Exception $e) {
......
......@@ -49,6 +49,16 @@
</li>
</ol>
<p class="version_info">Version 1.10.1 (2018-04-05):</p>
<p><em>Estimated labor time: <span id="hours_logged_for_update_23">1</span> hours.</em></p>
<ul>
<li>
Collated CSV Reports: Added the column "TestCondition" to the collated CSV files. Also, any previously-generated
collated report was updated with this change and placed in the newly created "collated" sub-directory under the
"user-data-files" folder.
</li>
</ul>
<p class="version_info">Version 1.10.0 (2018-03-29 to 2018-04-01):</p>
<p><em>Estimated labor time: <span id="hours_logged_for_update_22">12</span> hours.</em></p>
<ul>
......@@ -322,7 +332,8 @@
parseFloat($("#hours_logged_for_update_19").html()) +
parseFloat($("#hours_logged_for_update_20").html()) +
parseFloat($("#hours_logged_for_update_21").html()) +
parseFloat($("#hours_logged_for_update_22").html());
parseFloat($("#hours_logged_for_update_22").html()) +
parseFloat($("#hours_logged_for_update_23").html());
// Displays the total labor hours at the top of the page.
$("#total_labor_hours").html(calculated_labor_time);
......
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