BillBojangeles2000 commited on
Commit
f7ceb58
·
1 Parent(s): 67f41fe

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -106,9 +106,10 @@ for i in questions:
106
  res = Quiz.text_input(f'{i}')
107
  ans.append(res)
108
 
109
- Quiz.form_submit_button("Submit")
110
- grade_quiz = st.button("Grade Quiz!")
111
- if grade_quiz:
 
112
  for i, q in enumerate(questions): # This line was missing the enumeration
113
  result = client.predict(
114
  f'What would you rate this answer to the question: "{q}" as a percentage? Here is the answer: {ans[i]}. Make sure to write your answer as "Score" and then write your score of the response.',
@@ -129,7 +130,6 @@ if grade_quiz:
129
  scores.append(f'N/A')
130
 
131
  x = 0
132
- new_scores = []
133
  for score in scores:
134
  if score == 'N/A':
135
  scores.pop(x)
@@ -146,4 +146,4 @@ if grade_quiz:
146
  average = total / len(numbers)
147
  return average
148
 
149
- st.subheader(f'Your average score for the answers is {calculate_average(scores)}')
 
106
  res = Quiz.text_input(f'{i}')
107
  ans.append(res)
108
 
109
+ submit_button = Quiz.form_submit_button("Submit")
110
+
111
+
112
+ if submit_button:
113
  for i, q in enumerate(questions): # This line was missing the enumeration
114
  result = client.predict(
115
  f'What would you rate this answer to the question: "{q}" as a percentage? Here is the answer: {ans[i]}. Make sure to write your answer as "Score" and then write your score of the response.',
 
130
  scores.append(f'N/A')
131
 
132
  x = 0
 
133
  for score in scores:
134
  if score == 'N/A':
135
  scores.pop(x)
 
146
  average = total / len(numbers)
147
  return average
148
 
149
+ st.subheader(f'Your average score for the answers is {calculate_average(scores)}')