Learning Lernanta: The Code that Runs P2PU


This post is by Dirk Uys, our newest staffer and tech team guru. Dirk is exploring the inner workings of Lernanta and sharing his experiences with the community. He recently gave new life to Contributing to Lernanta, an onboarding challenge for volunteer developers started a year ago by community member Jessica Ledbetter.

I recently took a dive into the source code of a project called Lernanta. Lernanta is the Django based software platform that is used by Peer 2 Peer University to facilitate peer learning on the web! You can see it in action at p2pu.org

While trying to figure out how the code base comes together to form the final web application, I was presented with many challenges. One of those challenges was that I didn’t know about everything that Lernanta does. Another challenge was (and still is) that terminology used in the source code differs from the terminology used on p2pu.org.

In this post I intend to outline the relevant top level entities of Lernanta. I will also try to explain how these entities corresponds to the source code.

Users

Users are probably the most important entity on P2PU. Without users no peer learning will be possible and everyone working on P2PU will probably get very lonely and depressed.

Lernanta uses django.contrib.auth for authentication and profiles are managed by the users app.

Courses

On the P2PU website a course may be know as either a course, challenge or a study group. Courses, challenges and study groups provides different ways for users to interact with learning material, but they have a lot of features and functionality in common.

On the source code side of things we have projects. Projects stores the category of the course. The category indicates if a given project is a course, challenge or a study group.

Users can participate in a project. If the project is a course or challenge the uses is taking the challenge and if it’s a study group, the user joins the group.

Users can also follow a project. In this case the user does not participate, but rather observers.

One or more users will also be course facilitators. These users are responsible for running the course.

On the software side of things participation is indicated by a Participation entity. Participation is also used to indicate if a participant is also a course facilitator using the organizing property.

Users following courses are indicated using a Relationship entity. A relationship entity is automatically create for an participant, thus a participant is also a follower.

Course content is created by adding tasks to a course. In the source code tasks are represented by Pages that are part of the content application in Lernanta. Pages are versioned to preserve their history.

Schools

Schools are used to group together courses that are about a similar topic. Currently there are the School of Webcraft, the School of Education, the School of Social Innovation and the School of Mathematical Future. As I am speaking, the School of Data is being launched!

Schools each have a dedicated page with more information about the school and sets of courses associated with the school. Schools can also have specific sets of courses that they want to be displayed on their landing page.

In Lernanta, schools are implemented using the schools app. Courses can be associated with a school using the school property. Sets of courses are managed by schools.models.ProjectSet. Users doesn’t need to belong to a school in order to participate in a course offered by a school.

Badges

Users can earn badges to show what they have learned. Badges are OBI compliant and users can push a badge to their Open Badge Backpack.

On p2pu.org there are several different types of badges. The first type of badge is a project completion badge. This badge gets automatically awarded to a user whenever they complete the challenge associated with a badge.

Another type of badge is a skill badge. To get this badge, a user must apply for the badge and submit proof that they satisfied all the criteria for the badge. The submission then needs to be reviewed by other users and assessed according to the rubrics associated with the badge. Once enough users assessed the submission, the badge can be awarded to the applicant

Finally there are community badges. Community badges can be awarded by any user doing a course by another user doing the course.

In Lernanta, the badges application is used to implement the above mentioned badges. Badges are represented by badges.models.Badge. Associated with a badge is badges.models.Rubrics and badges.models.Logic. Rubrics are used to indicate what rubrics should be considered for a skill badge, while Logic indicates how many assessments are necessary and what the average rating for a rubric should be.

The relevant entities for badges

When a user apply for a badge, badges.models.Submission is used. When a user reviews a badge, badges.models.Assessment is used. badges.models.Rating is associated with an assessment and a rubric to indicate the rating that the user gave corresponding to the assessment and the rubric.

A final word

If you would like to get involved with the development of Lernanta, I recommend that you proceed by setting up your development environment by following this guide.



Back to Blog home