Half of the main page links here are stateless. Towards these pages, requests are sent without carrying extra information and then such static page contents are rendered and returned. For the others, a user is required to login before approaching. As for the data retrieval block on Profile, user’s corresponding username is required to match the history data. For the testing block on Test, a data collecting and processing process is started for the feedback shown on Result page. This process is started by sending an asynchronous request using Ajax in order to maintain the original webpage for video playing and elapsed time counting. Details of the implementations are shown in the following flowcharts.
Signup & Login Module
Signup and Login functionality for this web application is implemented based on Flask-Login module and Flask SQLAlchemy as the storage of user information. This extension allows us to work with python objects instead of managing data tables. Thus, user as an object is stored in or read from the database. Moreover, a login session would be maintained with in local proxy of the browser to keep the login state for the user.
Request Routing
Web framework Flask is used for routing the requests sent from the frontend. Requests are decomposed into fractions to route correctly and pass necessary parameters. In addition, to prevent anonymous users from accessing key pages, the decorator @login_requiredis applied.