30 lines
784 B
Python
30 lines
784 B
Python
import dash_core_components as dcc
|
|
import dash_html_components as html
|
|
from dash.dependencies import Input, Output
|
|
|
|
from .app import app
|
|
from .exam_analysis import app as exam_analysis
|
|
from .create_exam import app as create_exam
|
|
from .student_analysis import app as student_analysis
|
|
|
|
|
|
app.layout = html.Div(
|
|
[dcc.Location(id="url", refresh=False), html.Div(id="page-content")]
|
|
)
|
|
|
|
|
|
@app.callback(Output("page-content", "children"), Input("url", "pathname"))
|
|
def display_page(pathname):
|
|
if pathname == "/":
|
|
return exam_analysis.layout
|
|
elif pathname == "/create-exam":
|
|
return create_exam.layout
|
|
elif pathname == "/students":
|
|
return student_analysis.layout
|
|
else:
|
|
return "404"
|
|
|
|
|
|
if __name__ == "__main__":
|
|
app.run_server(debug=True)
|