Google Summer of Code with Oppia
My Project
The project that I had chosen was ‘Add Functionality for Skills’, which in the beginning was to add a new global Skills structure to the Oppia codebase, which could be used when required to help a learner stuck at a exploration or in general practice sessions.
But, through further discussion, this was modified to create 3 new global structures called Topics, Stories and Skills, and also to build upon and modify the Questions construct.
So, this project lays the foundation by adding all the necessary functionalities to the codebase to implement this.
Skills
A skill would be the most basic unit of learning in Oppia. It consists of a single concept card, some worked examples and a list of misconceptions associated with the skill.
This would be used to:
- Replace the existing refresher exploration structure: This was because, refresher explorations were created to help a learner stuck at a card in an exploration. But for this minor purpose, a full fledged exploration had to be created. Instead of this, if that answer group in the exploration were linked to a skill, then when the learner enters such an answer, the concept card of the linked skill could be shown as part of normal exploration play, and thus make the learner’s experience seamless.
- Link to questions: Skills can be linked to one or more questions. A use case for this is in stories. For an exploration in a story, prerequisite skills can be set. So, when the exploration is encountered in the story, the questions linked to these prerequisite skills would be fetched and displayed to the user, on completion of which, the exploration would be started.
Stories
This is very similar to, and would subsequently replace, collections. A story consists of a set of linked explorations. The linkage can be linear or non-linear. Each exploration would have a set of prerequisite skills (as explained above) and acquired skills. These would be used to validate the story.
Stories cannot be created independently, but would be linked to Topics (explained below).
Topic
A topic would be the highest level construct. These would teach, on the whole, general topics, like fractions. A topic by itself would just have a name and description. It’s main usage is that it encapsulates all stories and skills that teach a single topic in a single location so as to make it easier for the learner to find the material to learn. A topic would consist of:
- Stories: The list of stories that teach the topic would be available in the topic landing page.
- Subtopic: To the learner these would be surfaced as a ‘Skills Practice’ section. Internally, a subtopic consists of a list of similar skills, and a subtopic page that explains what it teaches. So, in the topic landing page, in a separate Skills Practice session, these subtopics would be listed. Selecting any, would open a Practice session consisting of questions linked to the skills in the subtopic.
A new topic can only be created by those with ‘admin’ roles. Once a topic is created, specific topic managers can be assigned to it, who can then edit the topic (except its name).
Milestone 1
In the first milestone, all the backend models, domain objects and services required for the basic functionalities of a model (like create, update, delete etc.) were done. Also added were the validations for the various structures and tests for all added filed.
Related PRs:
- The backend storage models were created, along with story domain objects and services: https://github.com/oppia/oppia/pull/4953
- Topic domain objects and services created: https://github.com/oppia/oppia/pull/4981
- Skill domain objects and services created: https://github.com/oppia/oppia/pull/4983
- Added update and delete for stories: https://github.com/oppia/oppia/pull/4988
- Added update and delete for topics: https://github.com/oppia/oppia/pull/4991
- Added update and delete for skills: https://github.com/oppia/oppia/pull/4992
- Added controllers for topics, stories and skills: https://github.com/oppia/oppia/pull/5013
- Added subtopic page model: https://github.com/oppia/oppia/pull/5053
Other modifications and migrations:
- https://github.com/oppia/oppia/pull/5049
- https://github.com/oppia/oppia/pull/5038
- https://github.com/oppia/oppia/pull/5035
- https://github.com/oppia/oppia/pull/5031
At the end of this milestoone, all the basic services and models were completed in the backend.
Milestone 2
This milestone, almost exclusively, dealt with creating the UI for creating, updating and deleting topics and stories.
Other work done here include adding an untriaged skills section to topics and skills dashboard and adding the functionality to link an answer group of an exploration with a skill.
Related PRs
Topic Editor
- Add frontend domain objects: https://github.com/oppia/oppia/pull/5090
- Create topics and skills dashboard: https://github.com/oppia/oppia/pull/5094
- Create editor UI: https://github.com/oppia/oppia/pull/5112
- Update ‘Edit Topic’: https://github.com/oppia/oppia/pull/5119
- Add subtopic page editor: https://github.com/oppia/oppia/pull/5142
- Add skill id management for subtopics: https://github.com/oppia/oppia/pull/5166
- Add validations to topic editor: https://github.com/oppia/oppia/pull/5178
Story Editor
- Add frontend domain objects: https://github.com/oppia/oppia/pull/5131
- Add create and delete story: https://github.com/oppia/oppia/pull/5148
- Create story editor UI: https://github.com/oppia/oppia/pull/5152
- Create story node editor: https://github.com/oppia/oppia/pull/5159
- Add validations to story editor: https://github.com/oppia/oppia/pull/5195
Other PRs.
- Moved story and topic validations to domain objects: https://github.com/oppia/oppia/pull/5211
- Add untriaged skills section to topics and skills dashboard: https://github.com/oppia/oppia/pull/5219
- Tag prerequisite skill to exploration answer group: https://github.com/oppia/oppia/pull/5238
At the end of this milestone, the UI for the topic and story editor were done.
Milestone 3
This milestone dealt with linking questions to a skill in a topic, creating a question editor and a pretest player (for explorations in a story).
For this to be done, though, an almost complete refactor was done to the state editor to remove all dependence of exploration specific properties from all its constituent directives so that the same directives that are used for explorations can also be used for creating questions, and as such a reusable question editor directive was created, which would take the question data as an attribute and display the editor using the data in it. To test its working, the exploration editor itself was modified to use this new state editor directive.
After that, to implement the pretest player, a refactor of the exploration player was also required, which has almost been completed. This was done to remove state name dependence from most calls (as this is something that is exploration specific). Also, as a part of this, the controlling service for the player was modified to ExplorationEngineService, along with which a PretestEngineService was also created to handle explorations or pretests respectively.
Related PRs.
- Added concept card viewer to exploration player: https://github.com/oppia/oppia/pull/5265
- Modified questions backend: https://github.com/oppia/oppia/pull/5293
Exploration editor refactor and question editor
- Add domain objects for question editor frontend: https://github.com/oppia/oppia/pull/5309
- Create backend controllers for question editor: https://github.com/oppia/oppia/pull/5321
- Replace jinja templates with directives in state editor: https://github.com/oppia/oppia/pull/5353
- Create reusable question editor directive: https://github.com/oppia/oppia/pull/5367 & https://github.com/oppia/oppia/pull/5406
Exploration Pretests:
- Create backend services and controllers for exploration pretests: https://github.com/oppia/oppia/pull/5418
- Refactor exploration player: https://github.com/oppia/oppia/pull/5437
- Add functionality for pretests for explorations in a story: https://github.com/oppia/oppia/pull/5479
At the end of this milestone, the question editor, linking question to skill and exploration pretest functionality were done.
Conclusion
The whole GSoC experience was really enriching and I had a great learning experience along the way. I would like to thank my mentor Sean Lip who guided me throughout the journey and also helped me review other contributor’s work and thus improve, not only my ability to write clean and bug free code, but also to guide and lead others.
The last milestone was especially fruitful as the refactor of the state editor and player involved a lot of concepts related to general application development which was really an enriching experience.
This project sets the basis for further work to improve and add even more functionalities to all the new structures created.
Overall, I really enjoyed the GSoC experience and would continue to contribute to Oppia.