Merge branch 'dev' of git_opytex:/lafrite/recopytex into dev

This commit is contained in:
Bertrand Benjamin 2021-01-21 09:38:58 +01:00
commit e15119605f
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
from .. import flat_df_students, pp_q_scores
from ..config import NO_ST_COLUMNS
from ..scripts.getconfig import config, CONFIGPATH
from ... import flat_df_students, pp_q_scores
from ...config import NO_ST_COLUMNS
from ...scripts.getconfig import config, CONFIGPATH
from ..app import app
COLORS = {
".": "black",
@ -26,11 +27,7 @@ COLORS = {
3: "#68D42F",
}
# external_stylesheets = ["https://codepen.io/chriddyp/pen/bWLwgP.css"]
# app = dash.Dash(__name__, external_stylesheets=external_stylesheets)
app = dash.Dash(__name__)
app.layout = html.Div(
layout = html.Div(
children=[
html.Header(
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 numpy as np
from math import ceil, floor
from .config import COLUMNS, VALIDSCORE
from .config import COLUMNS
"""
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 ..config import NO_ST_COLUMNS
from .exam import Exam
from ..dashboard.exam import app as exam_app
from ..dashboard.index import app as dash
@click.group()
@ -89,7 +89,7 @@ def new_exam():
@cli.command()
@click.option("--debug", default=0, help="Debug mode for dash")
def exam_analysis(debug):
exam_app.run_server(debug=bool(debug))
dash.run_server(debug=bool(debug))
@cli.command()