Skip to content

Commit

Permalink
fix: convert_library and table mode layout
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohamed-Hacene committed Sep 6, 2024
1 parent f132ad0 commit 414c0e0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion backend/library/libraries/cmmc-2.0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ copyright: "Copyright 2020, 2021 Carnegie Mellon University and The Johns Hopkin
\ ANY KIND WITH RESPECT TO FREEDOM FROM PATENT,\nTRADEMARK, OR COPYRIGHT INFRINGEMENT.\n\
[DISTRIBUTION STATEMENT A] Approved for public release.\nThis work is licensed to\
\ the public under the Creative Commons Attribution 4.0 International\nLicense."
version: 2
version: 3
provider: DoD
packager: intuitem
objects:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,18 +126,17 @@
</RadioGroup>
</div>
</div>
<div class="flex flex-col w-full items-center">
<p class="flex items-center font-semibold justify-center">{m.description()}</p>
<div class="flex flex-col w-full">
<p class="flex font-semibold">{m.description()}</p>
{requirementAssessment.description}
</div>
<div class="flex flex-col w-full">
{#if Object.keys(requirementAssessment.answer).length !== 0}
<p class="flex items-center font-semibold justify-center">{m.answer()}</p>
{#each requirementAssessment.answer.questions as question}
<li class="flex justify-evenly items-center border rounded-xl p-2">
{question.text}
<li class="flex flex-col space-y-2 rounded-xl">
<p class="font-semibold">{question.text}</p>
{#if question.type === 'unique_choice'}
<RadioGroup active="variant-filled-primary" hover="hover:variant-soft-primary">
<RadioGroup class="w-fit" active="variant-filled-primary" hover="hover:variant-soft-primary">
{#each question.options as option}
<RadioItem
bind:group={question.answer}
Expand Down
11 changes: 6 additions & 5 deletions tools/convert_library.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,11 +328,12 @@ def get_color(wb, cell):
def get_question(tab):
print("processing answers")
found_answers = {}

header = read_header(tab[0])
assert "id" in header

for row in tab[1:]:
is_header = True
for row in tab:
if is_header:
header = read_header(row)
is_header = False
assert "id" in header
if any(c.value for c in row):
row_id = str(row[header["id"]].value).strip() if row[header["id"]].value else None
question_type = row[header.get("question_type")].value if "question_type" in header else None
Expand Down

0 comments on commit 414c0e0

Please sign in to comment.