-
Notifications
You must be signed in to change notification settings - Fork 56
Notebooks
This project aims to create a Notebook functionality similar to Jupyter Notebooks in Source Academy for students and lecturers. This involves resolving the issues that the current ‘Stories’ has.
The aim of the backend improvements are:
- Move 'Stories' golang backend to 'Source Academy' elixir backend
- Combine authentication and other functionality with the main ‘Source Academy’ backend
- Allow auto save of notebook cells
Frontend - PR 3121 see frontend wiki for more information Backend - PR 1246
Stories Backend These are the tables in the stories backend that correspond to the source academy backend
| SA backend | Stories |
|---|---|
| users | users |
| courses | groups |
| groups (for studio groups) | na |
| course_reg | user_groups |
| id | id |
| id | course_groups (maps SA id of courses to stories id) |
Note: The stories table in SA is for games and not the same as the stories-backend stories, which is why we renamed to notebooks
While we combine the backends, we have to change the way stories are stored. The previous stories-backend implementation simply stored stories as a long string, as users have to edit and then save the markdown. However, the new implementation, Notebooks, allows creating notebook cells with a better UI, just like in jupyter notebooks. This results in three tables instead of one: Notebooks, Cells, Environment.

Notebooks: config: The yaml portion of stories that stores things like the environment (what version of source is being used) etc.
Cells: index vs id: Autosaving of cells (when the user edits a cell, call the backend to update the cell) and being able to delete and reorder cells to any index is a new feature, different from stories. So, there is the index of cells which will be updated rather than using the id. The index can then be extracted in ascending order when building the notebook again. The logic for changing the indexes is currently in the frontend.
Note for the retrieval of notebooks, it is separated into two functions: Published notebooks - everyone can see this, and admin for the course should be able to edit this while others can only view Own notebooks - retrieves student's own notebooks/ unpublished course notebooks for admins
Changelog
- Database migration
- Table schemas
- CRUD functionalities
Outstanding tasks
- CRUD may not work properly as not tested yet. Would be good to check the functionality for different users i.e. professors/students/TA
- The routes for the CRUD functionalities are not done - so the frontend has not been connected to the backend yet.
- Frontend has not updated the page that displays all the notebooks - may want to split the page into published and own notebooks
- Decide on a way to store the default notebook with a tutorial on how to use it - currently it is stored on the frontend, may want to move to backend
Other possible improvements: Sessions, share links, managing share permissions