Learning Lernanta


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.

backing up your delicious bookmarks

As some may have heard, delicious is being acquired by AVOS. You can transfer your bookmarks, but I decided to make a backup of my bookmarks, just in case.

The quickest way I could think of, was using the RSS feed.

Log into your account on the web and get the URL for the "Private RSS Feed" at the bottom of the page. Change the last part of the URL to be larger than the number of bookmarks you have saved on delicious.

Ex. change
"http://feeds.delicious.com/v2/rss/user_bob?count=15"
to
"http://feeds.delicious.com/v2/rss/user_bob?count=1000"
in the URL.

You can safe the page your browser displays when you enter the URL, or you can use wget or another utility to download the feed.

The data is now in your hands and it's up to you to keep it safe.

High resolution dependency graph

I generated a high resolution Gentoo Linux package dependency graph.

Packages are ordered according to their complete Gentoo package name. The result is that the graph shows groupings of packages with lots of dependencies or reverse dependencies. These groupings typically fall under dev-*, kde-*, gnome-*, x11-libs or media-*.

Text labels are only generated for packages with more that 10 dependencies or reverse dependencies. The numbers in brackets after the package name, is the number of dependencies followed by the number of reverse dependencies.

Packages grouped by categories (1600x1600)

A package of particular interest is app-text/sword. It has a total of 165 reverse dependencies!! This is very large number of packages that depends on app-text/sword! All of the packages that depends on app-text/sword seems to be different modules specifically for sword.

A nice picture of (dependency) hell

"Dependency hell" refers the difficulty that arise when installing a software package that requires a lot of other software packages to be installed. The required software packages (or dependencies) may themselves require other software packages to be installed.

To give a better idea of why this can be difficult, I created the following graph.
circle graph of software dependencies
63988 Dependencies between 14319 software packages
This graph shows the dependencies between software packages in the Gentoo Linux operating system. In total there are 14319 packages with 63988 dependencies between them!

Packages are drawn on the circumference of the circle and a dependency is indicated by a line draw from one package to another. The color of a package is randomly generated, while the color of a line is determined by the package that is required by the other packages.

Every package has a line starting on the rim of the circle drawn radially outwards. The length of the line is determined by the amount of other packages that depend on the package.

Here is a closeup of a small part of the graph:
circle graph of software dependenciesThe most common dependencies are development tools. This is a list of the 15 packages with the most reverse dependencies:

Package# of reverse dependencies
dev-lang/perl1559
dev-util/pkgconfig1195
dev-lang/python1047
x11-libs/gtk+1042
sys-devel/libtool950
app-arch/unzip878
sys-devel/automake818
sys-devel/autoconf766
dev-libs/glib652
x11-libs/qt-gui612
virtual/jdk588
sys-apps/sed575
x11-libs/libX11545
app-admin/eselect-python496
dev-util/cmake455

The graph was created with data obtained from the Gentoo Portage tree and drawn using the Python Image Libray (PIL).

Working towards software quality

Software quality remains to be an illusive topic. It's hard to define, measure or enforce.

One way to to define software quality is how well functional and non functional requirements are met. This implies that requirements exists and are accurate. It also implies that the quality of the software changes whenever the requirements change! This is typically the type of software quality that will keep your manager and your client happy, for the time being...

For software that will be used and modified after the initial requirements have been satisfied (most software fall into this category), quality needs to be measured on a deeper level. Aspects like maintainability, changeability, testing, etc comes into play. This however remains hard to measure and enforce.

There are however certain things that contributes to software quality that aren't that hard to measure or implement. Here is a list with some of those things:
  • Requirements
  • Software design
  • Coding standards
  • Version control
  • Bug tracking
  • Source code documentation
  • Code reviews
  • Automated clean builds
  • Automated testing
  • Code analysis tools
  • Config management
  • User interaction

It may be worthwhile to elaborate on topics such as requirements, design and documentation. These are things that can cause considerable overhead when done incorrectly. It a good idea to approach requirements, designs and documentation as tools that are used to arrive at a certain point. As such they contribute to the quality of the software, but does not necessarily represents the system in its current state.

Having all of the above mentioned things in place will not equate to high quality software. It still remains something that needs to be propagated and pursued by all involved parties.