Skip to content

Commit 5f67be2

Browse files
Added exemption automation to form
Signed-off-by: Natalia Luzuriaga <natalia.luzuriaga@cms.hhs.gov>
1 parent 6a604ff commit 5f67be2

File tree

3 files changed

+31
-19
lines changed

3 files changed

+31
-19
lines changed

index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,14 @@ <h4 id="quiz-subheading"> Answer the series of questions below to determine if y
6969
<fieldset class="usa-fieldset">
7070
<div class="usa-checkbox">
7171
<input class="usa-checkbox__input" id="check-national-security-systems" type="checkbox"
72-
name="exemption-condition" value="exemptedByNationalSecurity">
72+
name="exemption-condition" value="exemptByNationalSecurity">
7373
<label class="usa-checkbox__label" for="check-national-security-systems">
7474
Is the project primarily for use in national security systems, as defined in Section 11103
7575
of title 40, USC?</label>
7676
</div>
7777
<div class="usa-checkbox">
7878
<input class="usa-checkbox__input" id="check-intelligence-community" type="checkbox"
79-
name="exemption-condition" value="exemptedByIntelligence">
79+
name="exemption-condition" value="exemptByIntelligence">
8080
<label class="usa-checkbox__label" for="check-intelligence-community">Is the project created by
8181
an agency or part of an agency that is an element of the intelligence community, as defined
8282
in section 3(4) of the National Security Act of 1947?</label>
@@ -102,7 +102,7 @@ <h4 id="quiz-subheading"> Answer the series of questions below to determine if y
102102
</div>
103103
<div class="usa-checkbox">
104104
<input class="usa-checkbox__input" id="check-TSA" type="checkbox" name="exemption-condition"
105-
value="exemptedByTSA">
105+
value="exemptByTSA">
106106
<label class="usa-checkbox__label" for="check-TSA">Is the project prohibited under Regulations
107107
of the Transportation Security Administration related to the protection of sensitive
108108
information?

js/exemptionQuizHandler.js

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ function determineExemptions() {
44
const resultsContainer = document.querySelector(".results");
55
const exemptionResult = document.querySelector(".exemption-result");
66

7-
const checkedValues = Array.from(
8-
document.querySelectorAll("input[name='exemption-condition']:checked")
9-
).map((input) => input.value);
7+
const checkedValues = Array.from(document.querySelectorAll("input[name='exemption-condition']:checked")).map((input) => input.value);
108

119
console.log("Selected answers:", checkedValues);
1210

@@ -16,6 +14,7 @@ function determineExemptions() {
1614
quizContainer.style.display = "none";
1715
resultsContainer.style.display = "block";
1816
exemptionResult.innerHTML = results;
17+
1918
}
2019

2120
function determineResults(checkedValues) {
@@ -36,10 +35,18 @@ function determineResults(checkedValues) {
3635
<p>Based on your selections, your project is exempted from the SHARE IT Act ❌</p>
3736
<p>We've marked this in the form below for you as: <strong>${selections}</strong></p>
3837
<p>Be sure to include a 1–2 sentence justification in the <code>exemptionText</code> field to support the exemption determination.</p>`;
38+
39+
// Applies value to usageType on form
40+
try {
41+
const form = window.formIOInstance
42+
form.getComponent('usageType').setValue(checkedValues);
43+
}
44+
catch {
45+
console.error("Form fill error:", error);
46+
}
3947
}
4048

4149
return text;
42-
4350
}
4451

4552
function uncheckAllCheckboxes() {

schemas/gov/schema.json

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -57,18 +57,23 @@
5757
}
5858
},
5959
"usageType": {
60-
"type": "string",
60+
"type": "array",
61+
"items": {
62+
"type": "string",
63+
"enum": [
64+
"openSource",
65+
"governmentWideReuse",
66+
"exemptByNationalSecurity",
67+
"exemptByIntelligence",
68+
"exemptByFOIA",
69+
"exemptByEAR",
70+
"exemptByITAR",
71+
"exemptByTSA",
72+
"exemptByClassifiedInformation",
73+
"exemptByPrivacyRisk"
74+
]
75+
},
6176
"description": "A list of enumerated values which describes the usage permissions for the release: (1) openSource: Open source; (2) governmentWideReuse: Government-wide reuse; (3) exemptByLaw: The sharing of the source code is restricted by law or regulation, including—but not limited to—patent or intellectual property law, the Export Asset Regulations, the International Traffic in Arms Regulation, and the Federal laws and regulations governing classified information; (4) exemptByNationalSecurity: The sharing of the source code would create an identifiable risk to the detriment of national security, confidentiality of Government information, or individual privacy; (5) exemptByAgencySystem: The sharing of the source code would create an identifiable risk to the stability, security, or integrity of the agency’s systems or personnel, (6) exemptByAgencyMission: The sharing of the source code would create an identifiable risk to agency mission, programs, or operations; (7) exemptByCIO: The CIO believes it is in the national interest to exempt sharing the source code; (8) exemptByPolicyDate: The release was created prior to the M-16-21 policy (August 8, 2016)",
62-
"enum": [
63-
"openSource",
64-
"governmentWideReuse",
65-
"exemptByLaw",
66-
"exemptByNationalSecurity",
67-
"exemptByAgencySystem",
68-
"exemptByAgencyMission",
69-
"exemptByCIO",
70-
"exemptByPolicyDate"
71-
],
7277
"additionalProperties": false
7378
},
7479
"exemptionText": {
@@ -182,4 +187,4 @@
182187
"AIUseCaseInventory"
183188
],
184189
"additionalProperties": false
185-
}
190+
}

0 commit comments

Comments
 (0)