awacke1 commited on
Commit
d0cf89f
1 Parent(s): 415e3b3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -1
app.py CHANGED
@@ -73,10 +73,27 @@ with st.expander("Search by Common Terms 📚"):
73
  st.dataframe(filtered_data)
74
  if not filtered_data.empty:
75
  html_blocks = []
 
 
76
  for idx, row in filtered_data.iterrows():
77
- question_text = row.get("question", "No question field")
 
 
 
 
 
 
 
 
 
 
 
 
78
  documentHTML5 = generate_html_with_textarea(question_text)
79
  html_blocks.append(documentHTML5)
 
 
 
80
  all_html = ''.join(html_blocks)
81
  components.html(all_html, width=1280, height=1024)
82
 
 
73
  st.dataframe(filtered_data)
74
  if not filtered_data.empty:
75
  html_blocks = []
76
+
77
+
78
  for idx, row in filtered_data.iterrows():
79
+ # Extracting specific columns and assigning labels
80
+ question_number = row.iloc[0] # Column 1
81
+ question = row.iloc[1] # Column 2
82
+ options = row.iloc[3] # Column 4
83
+ answer = row.iloc[2] # Column 3
84
+
85
+ # Concatenating with labels
86
+ question_text = (f"QuestionNumber: {question_number}<br>"
87
+ f"Question: {question}<br>"
88
+ f"Options: {options}<br>"
89
+ f"Answer: {answer}")
90
+
91
+ # Generating HTML content
92
  documentHTML5 = generate_html_with_textarea(question_text)
93
  html_blocks.append(documentHTML5)
94
+
95
+
96
+
97
  all_html = ''.join(html_blocks)
98
  components.html(all_html, width=1280, height=1024)
99