module apps.qcm.qcm_app
¶
Short summary¶
module mathenjeu.apps.qcm.qcm_app
Starts an application.
Classes¶
class |
truncated documentation |
---|---|
Implements routes for a web application. |
Methods¶
method |
truncated documentation |
---|---|
Captures an answer. |
|
Cleans up. |
|
This route does not return anything interesting except a blank page, but it logs |
|
Defines the last page. |
|
Defines the main page. |
|
Returns an HTTP 404 page. |
|
An example error. |
|
Returns the page context before applying any template. |
|
Defines the main page. |
|
Returns an HTTP 500 page. |
|
Startups. |
|
Returns an answer for somebody looking to access the questions without being authentified. |
|
Returns an answer for somebody looking to access the questions without being authentified. |
Documentation¶
Starts an application.
- class mathenjeu.apps.qcm.qcm_app.QCMApp(secret_log=None, folder='.', max_age=1209600, cookie_key=None, cookie_name='mathenjeu', cookie_domain='127.0.0.1', cookie_path='/', title='Web Application MathEnJeu', short_title='MathEnJeu', page_doc='http://www.xavierdupre.fr/app/mathenjeu/helpsphinx/', secure=False, display=None, fct_game=None, games=None, middles=None, debug=False, userpwd=None)¶
Bases :
mathenjeu.apps.common.log_app.LogApp
,mathenjeu.apps.common.auth_app.AuthentificationAnswers
Implements routes for a web application.
Which server to server starlette application?
starlette does not implement a webserver, it only provides a way to map urls to answers and to interect with the user. To launch a server serving starlette applications, there is module uvicorn but it does not implement a secured connection. There is hypercorn which should support it. Other alternatives are described on starlette/installation.
- Paramètres
secret_log – to encrypt log (None to ignore)
folder – folder where to write the logs (None to disable the logging)
max_age – cookie’s duration in seconds
cookie_key – to encrypt information in the cookie (cannot be None)
cookie_name – name of the session cookie
cookie_domain – cookie is valid for this path only, also defines the domain of the web app (its url)
cookie_path – path of the cookie once storeds
secure – use secured connection for cookies
title – title
short_title – short application title
page_doc – documentation page
display – display such as
DisplayQuestionChoiceHTML
(default value)fct_game – function lambda name:
ActivityGroup
games – defines which games is available as a dictionary
{ game_id: (game name, first page id) }
middles – middles ware, list of couple
[(class, **kwargs)]
where kwargs are the parameter constructoruserpwd – users are authentified with any alias but a common password
debug – display debug information (starlette option)
- __init__(secret_log=None, folder='.', max_age=1209600, cookie_key=None, cookie_name='mathenjeu', cookie_domain='127.0.0.1', cookie_path='/', title='Web Application MathEnJeu', short_title='MathEnJeu', page_doc='http://www.xavierdupre.fr/app/mathenjeu/helpsphinx/', secure=False, display=None, fct_game=None, games=None, middles=None, debug=False, userpwd=None)¶
- Paramètres
secret_log – to encrypt log (None to ignore)
folder – folder where to write the logs (None to disable the logging)
max_age – cookie’s duration in seconds
cookie_key – to encrypt information in the cookie (cannot be None)
cookie_name – name of the session cookie
cookie_domain – cookie is valid for this path only, also defines the domain of the web app (its url)
cookie_path – path of the cookie once storeds
secure – use secured connection for cookies
title – title
short_title – short application title
page_doc – documentation page
display – display such as
DisplayQuestionChoiceHTML
(default value)fct_game – function lambda name:
ActivityGroup
games – defines which games is available as a dictionary
{ game_id: (game name, first page id) }
middles – middles ware, list of couple
[(class, **kwargs)]
where kwargs are the parameter constructoruserpwd – users are authentified with any alias but a common password
debug – display debug information (starlette option)
- async answer(request)¶
Captures an answer.
@param request request @return response
- cleanup()¶
Cleans up.
- async event(request)¶
This route does not return anything interesting except a blank page, but it logs
- async lastpage(request)¶
Defines the last page.
- async main(request)¶
Defines the main page.
- async on_error(request)¶
An example error.
- page_context(**kwargs)¶
Returns the page context before applying any template.
- Paramètres
kwargs – arguments
- Renvoie
parameters
- async qcm(request)¶
Defines the main page.
- startup()¶
Startups.
- unknown_game(request, session)¶
Returns an answer for somebody looking to access the questions without being authentified.
- unlogged_response(request, session)¶
Returns an answer for somebody looking to access the questions without being authentified.