Manikandan-Alagu commited on
Commit
b31255a
·
verified ·
1 Parent(s): 307971f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -17
app.py CHANGED
@@ -18,7 +18,7 @@ with open('Response.json', 'r') as file:
18
  st.title("MCQs Creator Application")
19
 
20
  def download(df):
21
- col1, col2 = st.columns(2)
22
 
23
  if button:
24
  if col1.button("Download CSV"):
@@ -27,29 +27,22 @@ def download(df):
27
  file_name="generated_mcqs.csv",
28
  key="csv-download",
29
  help="Click to download as CSV"
30
- )
31
 
32
  if col2.button("Download as PDF"):
33
  pdf_data = df.to_html().encode("utf-8")
34
  st.download_button( data=pdf_data,
35
- file_name="generated_mcqs.pdf",
36
- key="pdf-download",
37
- help="Click to download as PDF"
38
- )
39
-
40
-
41
-
42
-
43
 
44
-
45
-
46
  with st.form("user_inputs"):
47
  uploader_file = st.file_uploader("Upload a PDF or Txt file")
48
  mcq_count = st.text_input("No. of MCQS")
49
  subject = st.text_input("Insert subject", max_chars=20)
50
  tone = st.text_input("Complexity Level of Questions", max_chars=20, placeholder="Simple")
51
  button = st.form_submit_button("Create MCQs")
52
-
53
 
54
  if button and uploader_file is not None and mcq_count and subject and tone:
55
  with st.spinner("loading..."):
@@ -87,11 +80,7 @@ with st.form("user_inputs"):
87
  # Display the review in a text box as well
88
  st.text_area(label="Review", value=response["review"])
89
  # Call the download function
90
-
91
  else:
92
  st.error("Error in the table data")
93
  else:
94
  st.write(response)
95
-
96
-
97
-
 
18
  st.title("MCQs Creator Application")
19
 
20
  def download(df):
21
+ col1, col2 = st.columns(2)
22
 
23
  if button:
24
  if col1.button("Download CSV"):
 
27
  file_name="generated_mcqs.csv",
28
  key="csv-download",
29
  help="Click to download as CSV"
30
+ )
31
 
32
  if col2.button("Download as PDF"):
33
  pdf_data = df.to_html().encode("utf-8")
34
  st.download_button( data=pdf_data,
35
+ file_name="generated_mcqs.pdf",
36
+ key="pdf-download",
37
+ help="Click to download as PDF"
38
+ )
 
 
 
 
39
 
 
 
40
  with st.form("user_inputs"):
41
  uploader_file = st.file_uploader("Upload a PDF or Txt file")
42
  mcq_count = st.text_input("No. of MCQS")
43
  subject = st.text_input("Insert subject", max_chars=20)
44
  tone = st.text_input("Complexity Level of Questions", max_chars=20, placeholder="Simple")
45
  button = st.form_submit_button("Create MCQs")
 
46
 
47
  if button and uploader_file is not None and mcq_count and subject and tone:
48
  with st.spinner("loading..."):
 
80
  # Display the review in a text box as well
81
  st.text_area(label="Review", value=response["review"])
82
  # Call the download function
 
83
  else:
84
  st.error("Error in the table data")
85
  else:
86
  st.write(response)