Piotr Banaszkiewicz

Peer instruction: update 9 - the end of Summer

On Monday 11 Aug, 2014

This summer was great. I’m really glad I had the chance to work with Mozilla Science Lab on bringing a new teaching tool.

Here are a few of my thoughts about the good, the bad parts about GSoC 2014 and the future of my project.

What’s cool about this summer

This summer was special for a variety of reasons.

I was working on a bleeding edge technology with a language I didn’t really understand previously. It gave me op­por­tu­ni­ty to not only dig into software ar­chi­tec­tures I haven’t known before (like pub/sub) but also to learn how pro­fes­sion­als write JavaScript.

I met quite a few people interested in my project (despite very low number of stars or watchers on GitHub) and spent fruitful time with my mentors on dis­cus­sions about the project.

What’s not cool about this summer

A few things that come to my mind that could’ve been done better.

First, at the beginning of this project I pivoted a little. The actual codebase and ar­chi­tec­ture (pub/sub) is, I think, third or even fifth iteration.

I was promised a community hosting for my project at Mozilla but didn’t get one, even though I went through some lengthy procedures. Instead, my mentor had to allow me on his private server.

I’m also a little sad that my project doesn’t bring as much attention and excitement as it excites me. Hopefully I will be able to present it during MozFest and it will spark some interest.

Con­clu­sions

JavaScript’s poor object-pro­gram­ming design causes pro­gram­mers to write things in many different ways. There’s actually no one good way to write JavaScript. I found some really well-written JavaScript libraries but I was unable to write pretty code myself. Python for browsers anyone?

Note

Cof­fee­Script or Dart were crossed out at the beginning. In April, during PyCon in Montreal, actually. Reason: too fresh, too unstable and with little support, even though they may provide a better language experience.

Running multiple camera streams within browser is very resource-heavy.

I’m pretty happy that I end the summer with a working ap­pli­ca­tion that still can fit multiple features, ehance­ments and im­prove­ments. There’s even place for something that wasn’t done before, I think.

Peer in­struc­tion teaching tool features

I “end” this project with these specific features im­ple­ment­ed:

  • broad­cast­ing mode
  • dis­cus­sions in small groups mode
  • really quick switching between these modes
  • countdown with audio aid before disabling dis­cus­sions mode
  • variable small group sizes
  • better interface for tablets
  • basic text chat

It might seem like not that much, but I spend whole summer on this and I think I did pretty good :)

In near future I want to see these features im­ple­ment­ed:

  • better chat
  • better interface
  • better backend and frontend code structure
  • sharing files
  • con­nec­tions routing / mesh

Ac­knowl­edge­ments

I want to highlight and thank Greg Wilson and Mike Hoye - my mentors during this summer. Their efforts and continuous work and long meetings with me… I call this summer a success; it wouldn’t be without your help. Thank you! :)

Peer instruction: update 8

On Tuesday 05 Aug, 2014

Google Summer of Code is coming to an end.

There’s still so much work to do on Pitt I’m sure I’ll be working on it after the GSoC 2014 is done.

Before the soft pencils-down date I want to release one last version, v0.5.0 (this week) and then work on doc­u­men­ta­tion im­prove­ments (probably will release additional v0.5.1 then).

Features not coming into Pitt this Summer

Sadly, there’s only so much I can do… A few features won’t make it into Pitt this GSoC:

  1. Hard: better broad­cast­ing mesh (students act like relays / proxies), read more at https://github.com/pbanaszkiewicz/pitt/issues/22
  2. Etherpad in­te­gra­tion – Greg Wilson told me that Etherpad right now is not in best condition so this one is postponed (https://github.com/pbanaszkiewicz/pitt/issues/23)
  3. Peer2Peer file sharing – something exactly like ShareFest (https://github.com/pbanaszkiewicz/pitt/issues/21)

Features coming into Pitt

  1. Mobile-friendly interface (at least for tablets) and fixes for non-full-HD devices (https://github.com/pbanaszkiewicz/pitt/issues/18)
  2. Voice-only con­nec­tions im­prove­ments – as long as I’m able to test them (https://github.com/pbanaszkiewicz/pitt/issues/19)
  3. Chat (https://github.com/pbanaszkiewicz/pitt/issues/20)

I won’t write summary post until after the firm pencils-down date. But let me say that this Summer was truly awesome :)

Peer instruction: update 7

On Sunday 27 Jul, 2014

I’m feeling terrible - I forgot to blog post last week. Again. I’ll try to make up for it…

Software Carpentry sprint summary

The sprint lasted two days (22-23 July 2014) and it was a blast! Poland had wonderful rep­re­sen­ta­tion in Kraków, where I’m living.

Most of the group worked on Data Carpentry lessons:

  • writing new in Excel or Python+Pandas
  • checking existing in Bash

As far as I know, everything was merged in! That’s what I call a success.

I was the only person working on a different project, ie. on my Pitt.

Most of the time I was working alone, but once or twice we’ve got together with Mozilla Paris to test some things.

I want to kindly thank Rémi Emonet and Raniere Silva for their help! These guys not only con­tributed feedback and bug reports, but also took part in co­or­di­nat­ed calls with me. Thank you!

Having tested Pitt with Paris, I’m now more certain that the signalling part of my ap­pli­ca­tion is now very close to being bug-free. Or maybe it is already. I’m really liking how easy it is to add new features and still be certain, that the ap­pli­ca­tion won’t break ac­ci­den­tal­ly.

Pitt progress during sprint

Here’s the list of everything that was achieved during the sprint:

  • five hundred lines of doc­u­men­ta­tion have been written
  • fixed too high volume for the warning beep
  • forced low video resolution
  • dropped _pubsub part from di­rec­to­ries or file names
  • turned on TURN server for testing – and suc­cess­ful­ly tested with Mozilla Paris

Exciting features coming

For the next big update, I’m thinking about setting some huge goals.

  1. Mobile-friendly interface (at least for tablets) and fixes for non-full-HD devices (https://github.com/pbanaszkiewicz/pitt/issues/18)
  2. Testing (and fixing in case of errors) voice-only con­nec­tions – that’s something I didn’t get to test during the sprint (https://github.com/pbanaszkiewicz/pitt/issues/19)
  3. Etherpad in­te­gra­tion – as far as I am concerned, Etherpad doesn’t provide any way to share chat with other sites. That’s a bummer. While I don’t need Etherpad’s content in­te­gra­tion, shared chat would be extra nice. This needs futher in­vesita­gion (https://github.com/pbanaszkiewicz/pitt/issues/23)
  4. Chat: if not possible to integrate with Etherpad, write our own (https://github.com/pbanaszkiewicz/pitt/issues/20)
  5. Peer2Peer file sharing – something exactly like ShareFest (https://github.com/pbanaszkiewicz/pitt/issues/21)
  6. Hard: better broad­cast­ing mesh (students act like relays / proxies), read more at https://github.com/pbanaszkiewicz/pitt/issues/22

I think the end of Google Summer of Code is nearing, but I like this project a lot, and I definitely will continue working on it.

Peer instruction: update 6

On Monday 14 Jul, 2014

I missed one post last week and this one is already delayed by two days (compared to my typical writings that appeared on Saturdays).

For­tu­nate­ly, I have good excuses.

First, I wanted to get something done. Second, I was buried under real-life super exhausting stuff like post-exams leisure. ;)

Progress

Okay, good news: Pitt has new interface:

Pitt's fresh interface

Pitt’s fresh interface.

And I’m in the middle of rewriting JavaScript code (again…). Now the code uses good JavaScript patterns (and I don’t consider myself a JS newbie anymore).

I separated ap­pli­ca­tion logic code from ap­pli­ca­tion appearance code. Overall, the code should be easier to understand for newcomers and a lot easier to maintain.

The list of issues is updated and available here.

I’m also starting to think about Software Carpentry Sprint that takes place on July 22-23. I’ll post some update soon…

Peer instruction: update 5

On Sunday 29 Jun, 2014

This is gonna be a short one. Because of exams, I have to study a lot. And because there was not much progress on Pitt during this week.

Current release

Current version is v0.3.1, and it’s tagged in git repository. I’m in­cor­po­rat­ing git-flow model.

What I wanted to get in was two major features:

  1. countdown before switch from group split to broad­cast­ing mode,
  2. small groups of students of variable-defined size.

I can tell that I was successful and these features are now part of v0.3.1 release.

Bugs

While testing with Greg and Mike at their office and me here in Kraków, I couldn’t connect to them and vice versa. Con­nec­tions between Mike and Greg worked as intended.

This was strange, because I didn’t change the code so much that it’d break. More so: last week while testing with Greg alone it worked!

So I conducted few more tests:

  1. Pitt: Kraków ↔ Kraków
  2. Pitt: Kraków ↔ Toronto Mozilla Office
  3. Pitt older version: Kraków ↔ Toronto Mozilla Office
  4. Other WebRTC ap­pli­ca­tion: Kraków ↔ Toronto Mozilla Office

In the previous week, I’m guessing Greg worked from his home. We wanted to try Pitt in this con­fig­u­ra­tion (Kraków ↔ Greg’s home), but due to holidays in Canada we were not able to.

From what I can tell, the issue lies in the client IP addresses resolution. Here’s a lengthy article about how hard it is to do WebRTC properly: http://www.html5rocks.com/en/tutorials/webrtc/basics/#toc-signaling

Anyway, I hopefully will be able to easily overcome this issue.

Peer instruction: update 4

On Sunday 22 Jun, 2014

This week me and Greg Wilson, my mentor, we decided to test run Pitt. It was a success and, while revealing some annoying bugs, it made Greg really excited.

Current release

Current version is v0.3, altough I might have tagged it wrong in git. For­tu­nate­ly it seems that tag was not published to the GitHub repository.

Current features

This is a quick recap on what Pitt is capable of right now.

  1. Users coming in and quitting: thanks to signalling, as soon as someone appears online, they’re being logged in and everyone can see them.
  2. Quick switch mode: the instructor can easily and very quickly switch modes from broad­cast­ing (to all students) to work in small groups (students are split into pairs or groups of 3).

The code is decent. I presume there are some bugs with saved state of the ap­pli­ca­tion. For example, what to do if the instructor is broad­cast­ing and someone joins in? What if another instructor joins in? What if there are two in­struc­tors and one starts broad­cast­ing, should other in­struc­tors see their stream too?

These kind of questions will be addressed for the v0.4 release. Right now I’m working to get v0.3.1 release by Friday, 27.06.2014.

Exposed bugs

During my test run with Greg we quickly found out one super annoying bug.

There’s a very in­ter­est­ing human behavior: people slow down their talk when they hear themselves with small delay. It’s really hard to overcome this basic reflex.

Back to the bug: we found out that local stream video (ie. the one where you can see yourself, because browser plays the video from your webcam) is not muted by default. Add the playback delay to the mix and as a result Greg was struggling to speak.

This bug was really easy to fix (in HTML5: <video src=”…” muted=”muted”>) and the fix is included in the recent code.

There was also issue with the state of the ap­pli­ca­tion - it somehow broke for Greg (when he was a student). I have yet to discover the actual bug.

Missing features

Greg wants me to add these two new features to the upcoming release:

  1. Countdown. The instructor presses “back to broadcast mode” button and the switch doesn’t happen im­me­di­ate­ly. First there’s 30 seconds countdown so that no students are in­ter­rupt­ed in the middle of the sentence.
  2. Variable group size. The instructor can specify if the students are split into pairs or groups of 3, or groups of 6. This task is more chal­leng­ing than it seems: I have to ensure that no students are left alone (what is often the case when there’s odd number of students).

Next release

I’m planning to release next version, v0.3.1, on Friday 27.06.2014 or earlier.

I have 3 exams before Friday and 2 after it. Ouch…

Peer instruction: update 3

On Saturday 14 Jun, 2014

The decision has been made, and I switched to a different codebase.

I had one exam this week (Aparatura Au­tomatyza­cji, eng. Automation Systems) and five more in next 2-3 weeks, so it is quite chal­leng­ing for me to find time for peer in­struc­tion right now.

I did, however, spend most of this weekend trying to make Pitt broad­cast­ing mode for in­struc­tors.

It works! Proof below:

Me as instructor and two students.

Having dual monitor setup helps getting this kind of screen­shots.

As you can see, the layout and design in general is very rough. And so is the code.

This code is mostly based upon multiple events being propagated through sockets.

But I really don’t like the design of these events, and, frankly speaking, I much more prefer a “pub/sub” (pub­li­ca­tion - sub­scrip­tion) ar­chi­tec­ture.

At this moment, when the instructor triggers an event, the server has to re­prop­a­gate it to every student.

In “pub/sub” arch, however, there’s no re­prop­a­ga­tion in between.

Some people use redis for pub/sub, but I found some really cool protocol: WAMP (don’t confuse it with Windows, Apache, MySQL, PHP stack!).

WAMP authors clearly explain why it is good so please go there and read. Let me just point out a few cool features of WAMP:

  • WAMP is not a NodeJS module, it’s a protocol
  • it can be (and indeed is!) im­ple­ment­ed in various languages
  • therefore it’s a solid foundation for a quickly changing service.

What I dislike about WAMP is that at the moment there’s only one leading im­ple­men­ta­tion: Autobahn. And I’m not yet sure if I want to drop NodeJS backend in the future, but if so, then there’s already fast Au­to­bah­n|Python.

Peer instruction: update 2

On Saturday 07 Jun, 2014

In this week’s video­con­fer­ence between my mentors, Greg Wilson and Mike Hoye, Software Carpentry‘s instructor David Rio, and me, we decided to tem­porar­i­ly drop my current codebase and what I’ve done with Licode and Erizo.

Instead, my current efforts will be focused on developing and enhancing David’s excellent work that uses PeerJS.

This has some in­ter­est­ing con­se­quences.

Firstly, we can’t have broad­cast­ing using MCU in teacher’s mode. Instead, in this mode, we’ll have to open P2P con­nec­tions, what’s probably going to be quite chal­leng­ing for teacher’s internet connection.

Note

In teacher’s mode, the teacher broadcasts his stream to all of their students.

In student’s mode, students are split into smaller groups (6 people per group in real life, at most 4 people via Internet - more is less efficient) and talk with each other.

But for now we want to ship first version as soon as possible, so we’ll care about that later.

Secondly, we’ll have a lot clearer and “closer to the metal” code. Opening sockets and handling all data transfers will be much easier, and I like that fact a lot!

On my personal side of news, I’m currently preparing for exams (first one: next Thursday), which leaves me very little time for GSOC #sadface

Peer instruction: update 1

On Friday 30 May, 2014

I always avoided JavaScript. With my long exposure to Python, JS never appealed to me. And yet my whole Google Summer of Code project consists mainly of JS.

Let me quickly rein­tro­duce basic ideas and plans for Peer In­struc­tion project.

Peer in­struc­tion concepts

The most important feature of Peer In­struc­tion is the ability to, from the technical point of view, quickly switch between teacher and student modes.

Teacher’s mode

Teacher mode is basicly a broadcast sent to every student in a classroom. This might be quite chal­leng­ing: you can have many direct con­nec­tions and suffer from capped bandwidth and high CPU usage.

Teacher broadcasts their stream to multiple students

Teacher broadcasts their stream to multiple students.

The solution is to introduce additional server that helps to “spread” the stream to multiple students. It es­sen­tial­ly looks like this:

Teacher broadcasts their stream to multiple students through Multipoint Control Unit

Teacher broadcasts their stream to multiple students through Multipoint Control Unit.

What’s really good about this design? There’s an excellent open-source MCU available: Licode. I must admit Licode is a little too com­pli­cat­ed to set up, but authors’ support and continuous de­vel­op­ment make it a great option if someone wants, for example, to host their own al­ter­na­tive to Google Hangouts or Skype.

Me testing teacher's mode

Me testing teacher’s mode. (I was suprised it worked!)

As you can see above, the interface is pretty simple, but it works (at least for 1 student). I have yet to test it for more students, but I haven’t received a server account at Mozilla to do so.

Student’s mode

This is the second mode of broad­cast­ing. A very crucial from the point of science of peer in­struc­tion.

In this mode students are split into smaller groups so that they can talk with each other.

Right now I’m thinking how to implement this mode. One of the ideas is to create one Erizo Room for every group of students.

The way events are propagated within Erizo makes it really easy to subscribe to other students’ streams within one particular room. Using multiple rooms also helps manage all these smaller groups.

I should also mention that Erizo can create “full MCU” rooms - ie. rooms where streams are going through the server - and Peer-to-Peer rooms, where the server only handles sessions, signalling and events, but the streams are actually trans­ferred between the room par­tic­i­pants.

I think for small groups of 2-4 students it’s a good idea to use P2P rooms and save resources on the server.

Un­for­tu­nate­ly, this solution has some drawbacks, too. I found out that Erizo can only handle so much rooms at once (it’s specified in con­fig­u­ra­tion, but I don’t know the retionale behind it).

Current issues

My main focus for next week(s) is working PoC of students mode. Right now I’m working on a protocol used by Licode events.

It’s possible to send data through Erizo streams. I want to use this “channel” to com­mu­ni­cate with students’ browsers.

For now I’ll only send data like “join room ABC for small group discussion” and “leave room ABC”. In future Peer In­struc­tion might be more advanced - quite important feature is chat, and I will likely leverage the existing protocol for that.

Anyway, that’s the update status on my project. I highly welcome any con­tri­bu­tion or comments.

Here’s project GIT repository: https://github.com/pbanaszkiewicz/peer-in­struc­tion

Peer instruction - a summer project for Mozilla

On Thursday 24 Apr, 2014

I was accepted for Google Summer of Code 2014. My project is called “Peer in­struc­tion”, and I’m doing it under the wings of Mozilla foundation (or, more specif­i­cal­ly, Software Carpentry).

Peer in­struc­tion

Science tells us that students in groups learn more ef­fec­tive­ly [1]. This concept is widely used in peer in­struc­tion.

Peer in­struc­tion is a teaching method­ol­o­gy developed over 20 years ago. It’s different from typical learning classes in today’s colleges or uni­ver­si­ties. The basic workflow goes more or less like this:

  1. Teacher asks a question.
  2. Students in­di­vid­u­al­ly answer it.
  3. Students are split into small groups to discuss their answers.
  4. Teacher reveals the good answer.

The key feature of this method­ol­o­gy is splitting students into small groups.

[1]Peer tutoring is ranked as having 0.55 influence on student’s achieve­ment, while 0.0 is none.

Summer project

If you take an online classes by Udacity, Coursera, Khan Academy or whoever there is, you may notice they don’t deploy peer in­struc­tion.

But with web tech­nolo­gies of today, it is possible to create a virtual classroom that leverages this promising teaching method­ol­o­gy! And my task is to do it.

The minimum outcome

No, I don’t want to create a “full-stack” virtual classroom. The minimum viable product of my work will be a proof-of-concept working web service that lets you quickly switch from broad­cast­ing (or “teacher mode”) to many few-to-few mul­ti­plexed broadcasts (or “small-groups-talk mode”).

Of course, if I can, I’ll implement as many additional features as possible.

The obstacles

The only two dif­fi­cul­ties I foresee right now are:

  1. The lack of fast MCU technology.
  2. The lack of fast internet.

MCU stands for “Multipoint Control Unit”, a software or hardware used to bridge media trans­mis­sions.

The only one open source software MCU for WebRTC (technology used for media trans­mis­sion in modern browsers) I found so far is Erizo. I may have to implement an Erizo API module for Python if I decide to stick to Python.

So that’s the only issue I can somehow overcome. I cannot fix the internet speeds, though…

Possible features

If I have enough time and knowledge, I’ll implement:

  • whiteboard
  • voting system
  • quizes
  • trans­la­tions

It’s going to be exciting summer. I’m looking forward to it! :)

Con­tribut­ing

I welcome and highly appreciate any feedback, ideas, sug­ges­tions, or complaints. I released publicly my proposal, so you can comment it or even fork and make a better one.

I also want to share the link to the Git repository, where my work will reside. Feel free to send pull requests :)