Coder Social home page Coder Social logo

bradunov / shkola Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 18.26 MB

Shkola is a web framework for math exercises for primary school kids.

Home Page: https://www.tatamata.org/

License: Other

Python 9.89% Lua 54.46% Rust 4.92% RenderScript 0.38% Shell 0.14% JavaScript 0.04% Dockerfile 0.01% Jinja 23.35% Slash 6.82%
cherrypy portal mathematics education primary-school math-questions lua-scripts school-kids layout-language

shkola's People

Contributors

bradunov avatar iminic avatar vladap2013 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

shkola's Issues

Convert GET requests to POST

Currently, all requests are GET, which is problematic for e.g. bookmarking as some state is stored in them. It is cleaner to convert all GETs to POSTs. However, this requires some redesign as one needs to add a hidden form for that.

Backend auth: implement user cookie

Currently, after session cookie expires (user closes the browser), the user needs to login again.
We should add persistent cookie to keep user logged in for a longer period.
The value of the cookie must be randomly generated and corresponding value stored in the user table.

Backend logout mechanism

Logout mechanism should be implemented:

  • Session / user cookie should be deleted.
  • session record should be marked as invalid.

Implement session caching

Currently, user sessions are not being cached in memory and are always pulled from a table. Implement local session state caching and also store precalculated scores there to speed up new question generation.

Make enter work as Go

Make Enter submit a form when working on a question. However, this doesn't seem very easy to do by default.

Page generation time measurements

The code should measure time it takes to generate the page from the enry point to exit point of azure.

  • The values should be grouped by "key" (probably op parameter).
  • The values should be periodically stored in the azure table.

Backend: better page generation mechanism

Currently page is constructed by appending strings to a string value which is very inneficient.
We should use some more efficient mechanism.
Also, it probably would be better to have page body object in the context and not passed as a return value from functions.

Refactor session state

Currently session state stores the entire page_param object, which contains parts of the page params that are not part of the state, but of each request (e.g. root, op). This should be refactored so that we store in the session only parts that are necessary for the state. We should refactor page_params into page_params.session and page_params.request.

Add automatic testing of solutions and checks

Whenever a question in rendered in JS, it has both check and solution. Add automatic test of solution in check and submit an error to the table if they don't match, to catch potential errors caused by random values at users' browsers.

Session caching

In order to avoid table query for each request, session caching should be implemented.
A mechanism (probably cookie based) is needed to guarantee consistency in case session requests are coming to different hosts.

Skipping a question generates two reports, should be reduced to one

Skipping a question generates the following two requests (example):

Line 38:       MAIN ARGS ASYNC: {'q_id': 'numbers/q00028', 'l_id': '1_brojevi.rs', 'language': 'rs', 'test_id': 1598174968603, 'test_order': 1, 'start': '1598174968', 'now': '1598174975', 'attempt': '1', 'shown_solutions': False, 'detailed': {'q_res0': 'false', 'q_res1': 'false', 'q_res2': 'false', 'q_res3': 'false', 'q_res4': 'false'}, 'response_type': 'SKIP', 'op': 'register', 'root': 'main'}
Line 92:       MAIN ARGS ASYNC: {'q_id': 'numbers/q00028', 'l_id': '1_brojevi.rs', 'language': 'rs', 'test_id': 1598174968603, 'test_order': 1, 'start': '1598174968', 'now': '1598174975', 'attempt': '0', 'shown_solutions': False, 'detailed': {'q_res0': 'false', 'q_res1': 'false', 'q_res2': 'false', 'q_res3': 'false', 'q_res4': 'false'}, 'response_type': 'SUBMIT', 'op': 'register', 'root': 'main'}

There should only be a SKIP one, not a SUBMIT one, as both have enough info.

Improve logging

  • Remove irrelevant Azure Functions log messages
  • Print module name and other relevant info
  • Perhaps use Opencensus to get simpler and better searchable logs in LogAnalytics
  • Add extra log analytics JSON fields for better filtering

Remove SQLite backend

Azurlite works well as a local backend so no need to keep SQLite backend up to date. Remove it from the current calls and make sure that edit option works without it.

Add log to Azure table when JS fails

We currently have an exception handler for uncaught errors but it only displays an error message in dev mode. We need to log it in a table for wider deployments.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.