Spaces:
Runtime error
Runtime error
IsaacKerson
commited on
Commit
•
f493504
1
Parent(s):
67066c1
add view page
Browse files- app.py +1 -1
- pages/quiz.py +0 -6
- pages/view.py +14 -0
app.py
CHANGED
@@ -6,7 +6,6 @@ import datetime
|
|
6 |
# Custom imports
|
7 |
from multipage import MultiPage
|
8 |
from pages import quiz, upload
|
9 |
-
# from pages.utils import add_blanks, chunker, random_session_id, check_answer
|
10 |
|
11 |
# Create an instance of the app
|
12 |
app = MultiPage()
|
@@ -17,6 +16,7 @@ st.markdown("# Quiz Maker")
|
|
17 |
# Add all your application here
|
18 |
app.add_page("Quiz", quiz.app)
|
19 |
app.add_page("Upload", upload.app)
|
|
|
20 |
|
21 |
# The main app
|
22 |
app.run()
|
|
|
6 |
# Custom imports
|
7 |
from multipage import MultiPage
|
8 |
from pages import quiz, upload
|
|
|
9 |
|
10 |
# Create an instance of the app
|
11 |
app = MultiPage()
|
|
|
16 |
# Add all your application here
|
17 |
app.add_page("Quiz", quiz.app)
|
18 |
app.add_page("Upload", upload.app)
|
19 |
+
app.add_page("View", view.app)
|
20 |
|
21 |
# The main app
|
22 |
app.run()
|
pages/quiz.py
CHANGED
@@ -5,18 +5,12 @@ import random
|
|
5 |
import datetime
|
6 |
|
7 |
# Custom imports
|
8 |
-
from multipage import MultiPage
|
9 |
from pages.utils import add_blanks, chunker, random_session_id, check_answer, db_connect
|
10 |
|
11 |
def app():
|
12 |
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
|
13 |
DATABASE = os.path.join(BASE_DIR, 'vocabulary_current.db')
|
14 |
|
15 |
-
# def db_connect(database):
|
16 |
-
# conn = sqlite3.connect(database)
|
17 |
-
# c = conn.cursor()
|
18 |
-
# return c, conn
|
19 |
-
|
20 |
def form_callback(questions):
|
21 |
st.session_state.form_submit = True
|
22 |
num_correct = 0
|
|
|
5 |
import datetime
|
6 |
|
7 |
# Custom imports
|
|
|
8 |
from pages.utils import add_blanks, chunker, random_session_id, check_answer, db_connect
|
9 |
|
10 |
def app():
|
11 |
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
|
12 |
DATABASE = os.path.join(BASE_DIR, 'vocabulary_current.db')
|
13 |
|
|
|
|
|
|
|
|
|
|
|
14 |
def form_callback(questions):
|
15 |
st.session_state.form_submit = True
|
16 |
num_correct = 0
|
pages/view.py
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
import os.path
|
3 |
+
import sqlite3
|
4 |
+
|
5 |
+
# Custom imports
|
6 |
+
from pages.utils import db_connect
|
7 |
+
|
8 |
+
def app():
|
9 |
+
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
|
10 |
+
DATABASE = os.path.join(BASE_DIR, 'vocabulary_current.db')
|
11 |
+
|
12 |
+
c, conn = db_connect(DATABASE)
|
13 |
+
|
14 |
+
query = st.text_input("Query", placeholder="Type answer here")
|