Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 50 additions & 2 deletions tools/exporters/data_dictionary_builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,10 @@

case "header":
break;

//for HTML_QuickForm versions of standard HTML Form Elements...
case "jsondata":
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jeffersoncasimir did we have other headers toignore here?

case "norules":
break;
//for HTML_QuickForm versions of standard HTML Form Elements...
default:
//continue; // jump straight to validity for debugging
if (isset($bits[1]) && preg_match("/^Examiner/", $bits[1])) {
Expand Down Expand Up @@ -338,6 +340,52 @@
"ParameterTypeCategoryID" => $catId,
]
);

// INSTRUMENT DATA ENTRY
print "\tInserting data entry for $testname\n";
$Name = $testname . "_Data_entry";
if (in_array($Name, $parameterNames, true)) {
// this specific table_Data_entry combination
// was already inserted, skip.
continue;
}

$_type_enum = "enum('Complete', 'In Progress')";
$query_params = [
"Name" => $Name,
"Type" => $_type_enum,
"Description" => "Data Entry for $testname",
"SourceField" => "Data_entry",
"SourceFrom" => $testname,
"Queryable" => "1",
];

if (array_key_exists($Name, $parameter_types)) {
$ParameterTypeID = $parameter_types[$Name];
$query_params["ParameterTypeID"] = $ParameterTypeID;
} else {
$ParameterTypeID = "";
}

$DB->insert(
"parameter_type",
$query_params
);

if ($ParameterTypeID === "") {
$paramId = $DB->lastInsertID;
} else {
$paramId = $ParameterTypeID;
}

$parameterNames[$paramId] = $query_params["Name"];
$DB->insert(
"parameter_type_category_rel",
[
"ParameterTypeID" => $paramId,
"ParameterTypeCategoryID" => $catId,
]
);
}

//Copies the modified descriptions from the parameter_type_override to parameter_type
Expand Down
2 changes: 1 addition & 1 deletion tools/lorisform_parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
if (empty($output)) {
echo "Nothing to output, 'ip_output.txt' not created\n";
} else {
$fp =fopen("ip_output.txt", "w");
$fp =fopen(__DIR__ ."/ip_output.txt", "w");
fwrite($fp, $output);
fclose($fp);
}
Expand Down
Loading