How to teach Codea to a school class - ideas please

Having demonstrated Codea at my local high school, I now have the opportunity to help a class of about twenty 16 year olds, learn Codea as an introduction to programming. I would like your help, if you have ideas or suggestions.

This term (semester if you prefer) is half over, so there is about 5 weeks left, with about 10-15 lessons available in total, of one hour each. Then there are only a couple of weeks in the next term before exams, which is another 5-10 lessons.

While this is clearly too short a time to learn anything too complex, the same students will be studying programming next year, and if Codea is successful in the next few weeks, it could be used for all of next year, and for other classes, too. So you might say the next few weeks are a trial.

While some of the students have home access to iPads, and will be able to work on those if they prefer, the school will provide iPads during class for anyone who doesn’t have one.

Before giving my thoughts, I’ll just list a couple of practical issues I’ll need to deal with.

LIMITED ACCESS

One is dealing with the limited access to iPads (in class only, for most of them). This limits practice time for students. Maybe they can go and work on one in the library out of class, but I don’t know.

The other limit is that there is only one of me to run around in the class, helping 20 students. Before long, I expect some students will be helping others, but it could be tough, early on.

BACKUP AND RESTORE

Another is how to get projects backed up after each class and reloaded for the next class (because they won’t get the same iPad every time). I’m thinking maybe a shared gist account (internet access permitting). I will probably have to restrict image use to the built in libraries because it will be too difficult to back up and restore images via a school network.

CONTENT AND APPROACH

But the main problem is how to get to do something the students will find interesting, in the time available. I think most of us agree that to learn Codea, you need to start with Lua, which has no exciting graphics. Too much of this, though, and they will get bored.

Fortunately, they have been learning a somewhat similar language, Visual Basic. That is my background too, and I found a lot of similarities with the look and feel of Lua. So I think I can start almost straight away with simple graphical projects, such as bouncing balls, using simple Lua code, but no tables initially. I’m sure I can get across the basic Codea drawing approach, and the basic Lua commands like for and if, at the same time as trying out relatively simple projects, even very early on.

I can also give them copies of the Lua and Codea ebooks I wrote (and any other useful material), and ask them to read them out of class.

I also need to provide opportunities for individual students to show some flair and do something themselves. I think we all feel the same way - we may be programming something that’s been done before, but we want to do it our way.

I should also allow for the fact that not all students may be mad keen on programming, even if this is a programming class.

So how about this approach.

I won’t teach (most of the) Lua and Codea basics by standing at the front of the class, instead I’ll ask them to read the ebooks (and other material) and bring questions to class. So the ebooks help me “flip” the classroom - the students learn new stuff as homework, and get to apply it in class (instead of learning in class and applying it with homework). This is important because I only have a handful of hours to work with.

I provide them with a project with several tabs, ranging from extremely basic to more challenging. They can work through the tabs at their own pace in class, with me walking around and troubleshooting.

The first tab might be a handful of lines that bounces a ball round the screen, with an if test to reverse direction (and teach them “if”).

The next tab might add more balls (I’d like to include a “for” loop, but that is difficult without tables - unless I introduce a very simple table type).

And maybe a whole lot more tabs. I don’t mind how many there are, as long as each one teaches something new. I’m wondering if the final tab shouldn’t go as far as physics objects, as a stretch goal for the enthusiasts.

The students have to complete a minimum number of tabs before continuing. And then on to a more complex project.

Providing code like this may seem like spoon feeding, but the idea would be to provide fairly basic code in each tab, that teaches some Lua or Codea technique, then ask them to change it to do X or Y, to show they understand it. So each tab provides something new, and asks them to apply it to some objective, with room to try something of their own.

I would like to get as far as a simple game by the end (early next term, after 7-8 weeks) - again with room for individual flair - but I haven’t thought what that might be.

And yes, I do know we have some game templates in our forum, like FoggyBummer and Lander, which might be useful for teaching, and I will look at those. But I need to start with much simpler stuff.

I think this is an exciting opportunity to confirm Codea’s suitability as a teaching platform, which is why I want to get it right. I also realise that what I’ve set out above is quite ambitious, and there’s quite a lot still to figure out, so maybe I’ll stop there, and see what you think.

If any of you would like to be involved in any way, please let me know.

@Ignatz - sounds like a fantastic idea, but a LOT of work.

Are you a teacher or do you have experience teaching? If not, hopefully you have access to a teacher who can provide feedback on your proposed course. Being enthusiastic about a subject is great, but dealing with 20 students with different expectations can be hard.

My thoughts:

a) Provide all the media resources for the students as a baseline - you don’t want to put a student off because they feel they are crap at drawing. Also if you provide decent quality media then what the students produce can look quite polished.
b) Allow the students to customise the media - those that want to include their own art should be encouraged to do so
c) Leading on from this, allow the student to personalise the code in some way. A simple one would be displaying the students name on the screen. A more advanced way would be allowing the student to take a picture with the ipad and include it in the program (maybe take a picture of their face and use it as the main character sprite)
d) Keep the main objectives simple and achievable - you don’t want to put off students who struggle (though you want to bore the capable students)
e) If you are on your own, consider getting them to work together in groups of 3-4 (all with their own iPad, but working collectively). This (hopefully) provides immediate support for the weaker students.
f) Addressing the tables issue - give them an exercise where they have to place a sprite on the screen at a given location. Then add a second one (same image) at another location. Then a third, forth and fifth. Ask then how they would add 100
Show them the commonality between all five (the only things that should change are the x and y values). Put these in table and use a loop to cycle through the table (you may want to limit to just the x value initially, keeping y constant) - linking these two concepts (loops and tables) makes sense to me.
g) Students will NOT read the material before the class and bring questions. Trust me! If they did, it would be great, and make teaching so much easier, but it just won’t happen.
h) A “show and tell” approach might work - a short presentation at the start explaining the concepts and demonstrating the output. This would be accompanied by code and tutorial questions for the students to work through at their own pace.

Of course, I would encourage you to look at my lander tutorial - this is the type of audience I was aiming at and my take on how I would approach it (though I’ve not had much feedback on how successful it is).
I think you’ll find it follows the approach you are after and is very simple to start with (for example all Step 1 does is to place a sprite on the screen at a predefined point, nothing more. Step 2 introduces an x and y variable for the ship position instead of hard coding, Step 3 introduces the HEIGHT and WIDTH constants, Step 4 introduces movement by updating the y value and so on).

Spaceships tend to appeal more to boys, so you may want to think about a more gender neutral theme, or providing alternative themes (a bird instead of a spaceship that flaps its wings instead of thrust (though this might things more difficult)

This approach is a “learn by being shown the code, then play with an adapt yourself” one which gets the students producing stuff quite quickly. There will be others who would advocate learn the fundamental concepts first before touching a keyboard (what is a loop, an if statement, a variable, a pointer, etc). Codea will implement loops slightly differently from other languages and I guess the argument here is that you are learning to program in Codea, rather than learning to program in general.

Good luck and keep us up to date with progress.

thanks @West, I’ll read your comments carefully

Let’s make some games :slight_smile:

If you want them to have fun, teach them how to create a game, first drawing in paper and then take captures with the camera (or paint with Harmony tool :slight_smile: ), use this graphics for the game and so on…i think that must be the best way

If you’re thinking of a shared gist account for backup/restore, then maybe a shared Dropbox account would work to allow them to import their own images. Sync every iPad being used to this Dropbox account and every student will have access to every other students’ uploaded images. I suggest using a backup tool like mybackupbox.com or mover.io to sync the student Dropbox to another source just in case one student deletes or alters an image another student uploaded.

Really cool ! I think Codea is one of must idea to teach programming for students.

For me that I’ve only start programming for 2 years and is still student, I think about first things i’ve programming : “Rock Paper Cut” that you can make with no graphics, just print and parameter.action in a first time, for manipulate functions, if statement. And “Battleship” game, that you can make with graphics with line,rect and text, for manipulate tables, indices, and in a second time, replace rect with sprites.

For Backup and restore, Slashin8r have a good idea, make one Dropbox account. But if you want, you can make one directory per student for are sure to not overwrite images of others students. You can use too for saveProject or data of students.

If you need help for anything, you can send me a message, i expect have a sufficient amount of time for help you.

In all case, this is really interesting ^^

I’ve roughed out some initial code I want to use to help teach some basic Lua coding, before getting into Codea and graphics.

https://gist.github.com/dermotbalson/6318887
(use a long press to get it into tabs)

The idea is that the students work at their own pace through the tabs, from left to right (except for Main, which manages the tabs). The parameter remembers which tab they’ve selected, and runs just that tab.

I probably should include some tasks/exercises in the first few tabs so they get used to writing code and working with these concepts, but this is just a first draft.

After going through this, I intend to take them to West’s Lander game and work through all his tabs - and maybe more.

So if anyone has time to look at it and comment, I’d be grateful.

@Ignatz, for some reason it won’t let me see that gist. I checked your 3D town gist as well and now that code is unavailable too (even though I was able to get it yesterday).

I think github has a problem. Try this instead

https://www.dropbox.com/s/wqw9ej6hmmitmss/school.txt

Here is my advice (I’m a teacher too): to prevent some yawns, be just a bit like Daniel Shiffman. :smiley:

Just a note, I would put spaces between things, for example: a=3 would be a = 3, b*63/5 would be b * 63 / 5, and always indent if statements and so on. This makes the code a lot cleaner and easier to read in my opinion

I was thinking that, too…

@quezadav - I think Daniel Shiffman is in a class of his own when it comes to awkward presentations! X_X

I looked at the first couple screens worth and had some immediate questions. If I’ve never done any programming before, I might wonder, what’s a “variable”, “type”, “integer” vs. “non-integer”, “case-sensitive”. Expressions like “d=(a-2)^bob” are assignments, not equations (remember, they’ve done algebra, not programming). Presumably you’ll explain these things in person during their first session, otherwise they might be hopelessly lost right at the start.

@starblue I noticed that too, but if you had read a bit further you would see they already know some Visual Basic, so they know some of the core things of programming languages already.

Yeah, they know a little VB, fortunately

@Ignatz Very cool and the best of luck to you! it is by no means a simple undertaking :slight_smile: Heres a few ideas which are based on my own experience of trying to teach (with minimal teaching experience) and the things i learnt based on the students blank faces :smiley:

Start off very simple and slowly but because your time is limited try and get the basics out the way in the first lesson. Perhaps for the initial learning curve, taking inspiration from the “learn lua in 15 minutes more or less” page (http://tylerneylon.com/a/learn-lua/), you could create a more Codea specific version of this, with also perhaps the VB/VB.net equivalent of some things (where appropriate) provided for reference as this may help some pick things up in lua faster from what they allready know in VB.

I would then suggest following lessons each have a (visible) goal for the end of the lesson. I suggest avoid splitting exercises over multiple lessons to prevent any time being wasted by having to pick up from where they left off in the previous lesson, but each lesson still building upon previous lessons.

Perhaps in early classes after the basics start off with very simple mini-games with an almost “coding by numbers” approach, except instead of providing numbed peices of code to place in particular places, provide empty functions (with parameters where applicable) which need to be filled in. You provide the structure of how they fit together to create the end of lesson result (provided the functions are implemented correctly by the student).

You could perhaps start off by providing more code completed for them initially, which the more adept can perhaps modify anyway and the less confident dont have to worry about. Then as their skills progress keep upping the anti by giving exercises which have less and less code/structure provided so there’s more to complete on their own but it can still be finished by the end of class.

I would also be temepted not to rely too much on homework as given their age that sort of thing may not be top priority for some :wink: but you could perhaps have some complementing tasks which build upon the lesson just gone and prepare them for the next lesson perhaps even reveal what they will be doing next class and encourage them to plan/think about how they would go about creating it from scratch.

Ultimately I would recommend keep it fun, light hearted and engaging with a clear purpose or goal for the exercises you set. Encourage more able class members to support less able and take particular care of those that are struggling, perhaps hold a mini “support group” with yourself for those students (and any others that want too join) in the middle of the class for 5-15 minutes to give some more structured teaching but still allowing you to wander round giving pointers, answering questions or letting students show off what they’ve done so far :slight_smile:

Very interesting project. As a former teacher i’d love to hear how it goes.

A few tips:
I think you should set clear learning goals for the class.
What do you want them to have learned at the end?
e.g. basic programming stuff like loops, if-then, variables etc
or
The language Lua ( at beginner level)
or
A specific type of algorithm (such as sorting, pathfinding or whatever)
or
how much fun it is to program

Setting the goal like this will allow you to define the scope and then the content.

Parallel to that you should determine your “teaching style”. Are you :
going to instruct them → this is how to do it , now you try
or
going to let them figure it all out → Here’s a problem to solve, find a way to do it.

The first path means you need to provide lectures and excersizes.
Pro’s: you are in control, very structured, easy to exam.
Con’s: differences in students not accounted for, lot of artificial textbook situations

The second part will put you as a coach. A very well thought out problem to solve needs to be found, that fits the level of the students.
Pro’s: Students in control, very good for teamwork, lot’s of room for self-development and personalisation
Con’s: Hard to control achieved level of learning, time management as a coach is difficult, matching the difficulty of the problem to the students is tricky.

Personally I’d go for option 2, letting them solve a real problem. I’ve done that in my Science classes. Pick a real and urgent problem, or at least a very fun one.
Make sure they feel the problem. E.g. have them develop a game that teaches basic traffic rules to kids.
Stick them in teams of 4, provide pointers to literature, have lots of discussions.
Don’t answer their questions, instead point them to where the answer can be found.
Examination can be done by having them turn over intermediate results and a final presentation of the finished product.

Hope this helps!

P.S. don’t be surprised how much they can learn from a dificult problem, as long as the motivation is there.

Thanks @XanDDemoX, PTN, great advice, thanks! I appreciate learning from your experience.

I’m fortunate in that they have covered their syllabus so the main requirement is to challenge and inspire them, so no exams on this stuff. I also want to maximise iPad time because they don’t have access outside of class. So I don’t think I’ll use group discussions that are of any length.

And I need to get them to a point where they forget any preconceptions they may have (eg Apple is evil, don’t like iPad keyboard, etc etc) and get them to see the pure fun of Codea.

So I’m taking your advice on making it fun, XanDDemoX, and looking at your second option, PTN, because I want this to be fun. I have the small advantage that they’ve done a little VB, so they have some concepts - and Lua reads a lot like VB.

I’m starting with two projects, the first to teach some Lua, and the second to create a lunar lander game (based on West’s staged tutorial). If any push beyond this (a couple know Lua, so that is a possibility), I will share some of the actual Codea projects seen on the forum or some of the ideas - or let them go look for themselves. We’ll see.

I’ll tell them the first project is just to give them a little Lua. The quicker they can get through it, the quicker they can get on to real graphics.

With the lander project, I’m thinking of

  1. giving them more to do (as it stands, all the code is pre-written)
  2. increasing the graphical elements - they are not terribly exciting at the moment
  3. extending it further to include physics gravity, but first I’ll see how fast they go.

Each of the 2 initial projects has a number of tabs they work through left to right progressively, and they can use a parameter to control which code tab runs. This allows them to learn at their own pace.

They will have to backup and restore their code in each lesson, we are using Evernote for that.

The two projects are here if you’re interested. (Multiple tabs, so long press). I will do quite a bit more work on the lander before the first lesson next Thursday.
https://gist.github.com/dermotbalson/6327956
https://gist.github.com/dermotbalson/6327961

I’ll provide feedback as I go, because I’m hoping we get see Codea used in more classrooms, and the more we can learn about doing it well, the better.

Thanks again!

Are the students doing this only on the iPad? Any access to Bluetooth keyboards?