
Empowering Learners with WebR, Pyodide, and Quarto (Ted Laderas, Fred Hutch) | posit::conf(2025)
Empowering Learners with WebR, Pyodide, and Quarto Speaker(s): Ted Laderas Abstract: WebR, Pyodide, and Quarto are powerful technologies that let you run code exercises in the Web browser. Because of this, WebR exercises can be integrated into data science lessons within RevealJS slides and Quarto websites. In this talk, I want to emphasize some considerations for using WebR/Pyodide for active learning in the classroom. Careful exercise design with WebR/Pyodide can make the difference between empowering learners and demotivating them. With our R-Bootcamp and other exercises as examples, I show scaffolding methods for teaching data science concepts gradually, as well as other design considerations. I'll finish up with showing you how to set up WebR up in your slides and websites for your Data Science Learners. Slides - https://laderast.github.io/degrees_of_freedom Repo - https://github.com/laderast/degrees_of_freedom posit::conf(2025) Subscribe to posit::conf updates: https://posit.co/about/subscription-management/
image: thumbnail.jpg
Transcript#
This transcript was generated automatically and may contain errors.
Okay, so I do workforce training, so if any of you know about this, it's a slightly different audience than like university students. They get frustrated very easily. You know, one of the very first sessions, this has worked millions of times for me, but like, you know, I just encountered a learner was just really overwhelmed by RStudio, and unfortunately they quit the course.
So this is one of those things that, you know, sometimes you have to go back to the drawing board and kind of understand, like, you know, how you can make the experience better.
So thanks, Klaus, for introducing WebR and Pyodide. So if you want, so I am also going against the live demo thing, but, you know, it's, this is something that I feel like is just so important to show that you can really. So I've got two examples here. So one is in R and one is in Python, but you can see that this runs in your browser. So I just loaded in some data and I asked for some information. It just works in your browser. It runs on learners' computers, so you don't have to do, like, shiny hosting or anything like that.
Use cases for WebR and Pyodide
So really, part of my goal for today is to really kind of highlight some use cases for WebR and Pyodide that you might not have thought about. So my first very use case is really about lowering cognitive load, and we'll talk more about that in a second. And then, you know, I think one of the things we always want is to give learners freedom, but I think you need to give them just enough freedom, like, when they're starting out, and so encouraging active learning. And then, you know, this is a use case that, like, you know, we found that has been unexpectedly useful is, like, actually using WebR to increase social learning and workshops.
So like I said, with each of these kinds of steps, you're going to increase learner autonomy and freedom. So I think this is actually a really wonderful technology to think about using in your lessons.
Lowering cognitive load
Okay, so let's talk about lowering cognitive load. If you don't know what cognitive load is, here's an illustration. So let's talk about, like, you know, a learner as they are kind of sitting there and watching you teach. So they're thinking about things like, what is R? What's a variable? They're also thinking about things like, oh, I need to finish that report, or I need to pick up my daughter.
But there's also some extra, extra things, thoughts that are kind of unproductive, like, am I doing this right? RStudio, like that learner I was talking about, they just didn't get it. They got, they basically freaked out and panicked. So all of these thoughts in a learner's head is what's called cognitive load.
So what can we help with? There are certain things, like, you know, for example, like finishing the report and picking up your daughter, like, we can't help with that. But I think, you know, really, you know, these kinds of fear-based thoughts that can prevent people from really moving forward and actually learning, we can do a lot of good work with.
So I am going to posit that fear is part of cognitive load. This feeling of, am I doing this right? I always get learners who ask, like, you know, what would happen if I did this? And my response is always, like, why don't you try it? But honestly, like, when you're first starting out, there's that fear of doing something wrong, of breaking R. And so anything that we can do to kind of alleviate fear and reduce this fear, the less cognitive load your learners are going to have.
So I am going to posit that fear is part of cognitive load. And so anything that we can do to kind of alleviate fear and reduce this fear, the less cognitive load your learners are going to have.
So as an example, like, you know, this is where my learner was, you know, we showed them RStudio, and, like, very, when you're a brand-new learner to, like, programming and everything, this can be very overwhelming. Where do you pay attention? Like why are there so many windows? I mean, we all have gotten used to this, but, you know, especially for people who are just kind of approaching this, this can be a lot. So we can really lower this friction for new learners.
So I'm going to show you an example of an exercise. So again, putting ourself in, like, the learner's shoes of, like, someone brand-new, and, you know, being able to give feedback, you know, in terms of these interactive exercises. Okay, so here's my exercise. So just reading it out loud, filter penguins, so it only shows penguins from the island of Bisco, and I give a hint, you'll have to use the island variable, and you want to assign it to Bisco penguins.
So here's the corresponding exercise. So I'm actually using something called grade this in the background, but if I run this code, it's going to give them immediate feedback. So you didn't do anything, you need to fill in this. So what if I change this? I'm not going to try to spell Torgasen live, because it is a difficult word to spell, but, like, say I tried the dream island here. So this is a little hard to read, but it says, so we did a filtering, but we used kind of the wrong word. So, but if we change this to Bisco, they immediately get feedback.
So all of these exercises, there's code in this GitHub repo, and there's also a link to the talk here, so all of this, there's examples on how you actually implement all of these things.
Designing in-class exercises
So let's talk a little bit about using WebR and Pyodide for in-class exercises. I'm a big fan of not making people look up things that were five slides before, so I always try to have all of the information that a learner needs available, like, right in the exercise. Really, you know, it's part, I think WebR is really, and Pyodide is really great at reducing friction when practicing.
I think a lot of us are educational designers, and really the idea of using faded exercise design, like, the technology is not the solution, right? We have to actually use pedagogical principles to design these exercises. So you know, first you kind of have the fill in the blank, and then you slowly give them more freedom, and more freedom to actually write their own code.
And then this is something, if you have used LearnR, or grade this, like, you know, there's an option to kind of use these custom grading functions to evaluate code blocks. Just a little bit about custom grading functions. So this is really the core of, like, you know, using this for effective instructional design and learning, is anticipating the possible mistakes and answers, and having a response for each. So you know, someone might not, their mental model might not be 100% correct, but they are able to, giving them kind of specific feedback about that can be really helpful.
So I don't really have kind of working code here, but there is, these are some examples that George has in his Quarto Live documentation. So here you can, like, you'd see, you can evaluate kind of results that learners have kind of evaluated, and give them specific feedback here.
As an example, I'm not saying this is the best example, but this is something that we've worked on for years and years. It's called our R boot camp. There's a link right there, and the GitHub repo. But you know, this has gone through many iterations, many technologies, and I think with WebR, this is kind of where we're going, where we're ending up. So again, the GitHub repo is there in case you want to take a look at it.
Increasing active learning
Okay, so we talked about cognitive load. So let's talk about increasing active learning. So if you don't know what active learning is, it's learning by doing, and you know, basically providing activities that cement knowledge by application. So you know, it's one thing for us to kind of lecture at people, but when they actually try things out, they see, they actually cement the knowledge. So I'm going to specifically talk about the idea of meta-learning, which I think is just so important for any learners of data science. Learning how to learn.
Okay, so here's an example I'm going to show is about helping learners explore documentation. Okay, so look at the documentation for the arrange function. So I have it linked here. And you can take a look at it. I'm not going to. I think all of us know how to do that. And then how do we change the below code to sort by descending order?
So, okay, I'm not going to spend too much time on this, but if you know, you know, have to use the DESC function. And yeah, so that that looks great. The feedback is not visible, but you get the idea.
Okay, so for active learning, I just think this is like the use case for WebR and Pyodide. And like Klaus mentioned, you know, he uses it in his interactive exercises. I actually use them in slides, just like I've been showing you. And that's just like a great opportunity for people to kind of immediately jump into something that you've shown them.
Increasing social learning
Okay, so this is the last use case I'm going to talk about, which is like increasing social learning. This is something we hadn't even thought about, but like kind of once we did it, we were like very excited about this application. So if you don't know what social learning is, really this is a very dry pedagogical definition. Like it's a cognitive, learning is a cognitive process with social context. But really, like it can be summed as we learn better when we learn together and we talk about things. And that can include discussion with your neighbor.
So I'm going to show you kind of an example that we use WebR, Pyodide for social learning. These are some examples, and then I'm going to show you a specific example. So first is paired programming exercises. There is something magical to this in that like, you know, giving learners roles and then like having them discuss things seems to increase learning. But the one I'm going to show you is really about how you can, about design decisions and how design is in the eye of the beholder.
So this is a workshop that we've done called Better Tables. And then I'll talk a little bit about this website that we've kind of put together called Data Snacks. And we use basically WebR and Pyodide for all of these.
Okay. So when I first encountered ggplot2, I was like, this is exactly like a paper doll. Probably dating myself. But you know, paper dolls, you can like dress them up in different outfits. And I really thought this was a really kind of nice approach to explaining ggplot. And again, like, you know, we can talk about design best practices. But in the case, I think it's really important for people to discuss what works and what doesn't work for them. And then, you know, just the ability to share styling code with each other kind of live is like really pretty amazing.
So here's a better plots workshop. So we have a TV dataset. I'm not showing the plotting code. But like, for example, if we run this code here, I've added some annotations. And this is a TV shows dataset. And all of these kind of different shows. And kind of part of the reason I use this for teaching is everyone has an opinion about TV shows. So it was just kind of a nice thing to kind of include.
But I also kind of give people the option to kind of add their own annotations to help guide people through the visualization. I know that this is not a 100% great visualization. But just as a demonstration purposes, like, you know, so we've got an annotation for the walking dead. And like you can see the ratings drop. So it's just like, you know, thinking about ways that you can use to like to kind of share with people.
I think one of the things that I did with this workshop was really encouraging people to like have a comment about like one of the TV shows and kind of share it. So this was like unexpectedly really very kind of powerful. Because I think it immediately had people kind of sharing code with each other. And like, you know, sharing their own kind of fun annotations on the dataset.
So this was like unexpectedly really very kind of powerful. Because I think it immediately had people kind of sharing code with each other. And like, you know, sharing their own kind of fun annotations on the dataset.
So I don't have time to talk too much about this. But this is something we've been playing with at the Hutch. So they're called data snacks. Here's an example of like working with parquet files. So these are things that we just share with our learners. If someone is curious about something, like parquet, we'll write up a data snack for them and they can try things out.
So really you do want to emphasize that WebR and Pyodide as part of the technology spectrum don't like replace things. Like, you know, for example, like, you know, we start out with WebR and Pyodide, but then we have a followup session. So it's a little less overwhelming. We work on PositCloud with Quarto, probably very similar to what Klaus does. And then, you know, we use WebR and Pyodide for in-class exercises.
So this was actually brought up as a question. And I chatted with George a little bit about this. Part of the problem is, you know, people want to do tests and assessment with it. The problem is that you can see all of the code if you know a little, like, JavaScript or how to look into the browser. So it is technically difficult to really kind of hide the code and the answers. That like I said, if you know anything about a console, you can actually get the answers out. George did say if you are interested in this, you can come talk to him. It is a possibility, but it is more difficult than just kind of what the current technology can do.
Conclusion
So in conclusion, so WebR and Pyodide is really powerful. And like we talked about these various use cases, reducing cognitive load, increasing active learning, and increasing social learning. And as you give students more and more freedom, they become stronger learners. So thanks, everyone. Again, especially thank you to George Stagg for all of his work on WebR and Quarto Live and for the chat, kind of discussing, like, what it's good at. Helped me a lot. This is my email address. I am part of what's called the Data Science Lab at Fred Hutch. We basically do all sorts of courses in education, and there are other members of the Data Science Lab here. I'm not going to make you raise your hand, but thanks all for being here. Other links, website, this talk, and all of these kinds of resources that I've talked about. And that's all I have. Thank you.
