Compare commits

...

2 Commits

Author SHA1 Message Date
84fcee625d Feat: split dashboard 2021-01-20 20:54:59 +01:00
f62c898162 Fix: remove unecessary import 2021-01-20 20:51:22 +01:00
6 changed files with 36 additions and 11 deletions

View File

@ -0,0 +1,5 @@
import dash
app = dash.Dash(__name__, suppress_callback_exceptions=True)
# app = dash.Dash(__name__)
server = app.server

View File

@ -14,9 +14,10 @@ import numpy as np
import dash_bootstrap_components as dbc import dash_bootstrap_components as dbc
from .. import flat_df_students, pp_q_scores from ... import flat_df_students, pp_q_scores
from ..config import NO_ST_COLUMNS from ...config import NO_ST_COLUMNS
from ..scripts.getconfig import config, CONFIGPATH from ...scripts.getconfig import config, CONFIGPATH
from ..app import app
COLORS = { COLORS = {
".": "black", ".": "black",
@ -26,11 +27,7 @@ COLORS = {
3: "#68D42F", 3: "#68D42F",
} }
# external_stylesheets = ["https://codepen.io/chriddyp/pen/bWLwgP.css"] layout = html.Div(
# app = dash.Dash(__name__, external_stylesheets=external_stylesheets)
app = dash.Dash(__name__)
app.layout = html.Div(
children=[ children=[
html.Header( html.Header(
children=[ children=[

View File

@ -0,0 +1,23 @@
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
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
else:
return "404"
if __name__ == "__main__":
app.run_server(debug=True)

View File

@ -4,7 +4,7 @@
import pandas as pd import pandas as pd
import numpy as np import numpy as np
from math import ceil, floor from math import ceil, floor
from .config import COLUMNS, VALIDSCORE from .config import COLUMNS
""" """
Functions for manipulate score dataframes Functions for manipulate score dataframes

View File

@ -13,7 +13,7 @@ from .getconfig import config, CONFIGPATH
from .prompts import prompt_exam, prompt_exercise, prompt_validate from .prompts import prompt_exam, prompt_exercise, prompt_validate
from ..config import NO_ST_COLUMNS from ..config import NO_ST_COLUMNS
from .exam import Exam from .exam import Exam
from ..dashboard.exam import app as exam_app from ..dashboard.index import app as dash
@click.group() @click.group()
@ -89,7 +89,7 @@ def new_exam():
@cli.command() @cli.command()
@click.option("--debug", default=0, help="Debug mode for dash") @click.option("--debug", default=0, help="Debug mode for dash")
def exam_analysis(debug): def exam_analysis(debug):
exam_app.run_server(debug=bool(debug)) dash.run_server(debug=bool(debug))
@cli.command() @cli.command()