MARGARET TANZOSH: So what I'm going to do now, I'm going to talk a little bit about specifically how I do scaffolding for really struggling students. And you're going to actually do some work as well. So I'm going to talk about it for a few moments. Then I'm going to ask you, if you have a laptop, to take out your laptop, and we can do a little bit of pseudo coding together. We'll kind of talk about how we would do that. And then if you don't have a laptop, I have a printout for you. Got it? But if you have a laptop, do you take a laptop, take it out so that you can have that ready. We're not going to start. We'll do that later. I'm going to go through a few slides first. And then we'll give out all the handouts. So you don't need the printouts yet, right? I've just got to go through a few slides first, kind of introduce what I do, how I differentiate. And then we'll do a little bit of pseudo coding together. I'll share with you how I do it. And again, you don't have to do anything that I do. It's just to kind of give you an example of something you may want to consider. So what I was saying before, of course-- and I think many of you had the same concerns-- is that I have a very diverse set of students, right? Most of them have no computer science experience. Some of them struggle with abstract thinking. They struggle with algebra, some of them. I'll wait for a moment for everybody to get settled. Some students come in very advanced. Some students have no experience, but they pick it up very quickly, and they fall in love with it. Some students take a while to warm up to it, right? So it's kind of all over the place in terms of when I first meet my students every year. I had one student that started the class saying-- because I had 34 kids in the class-- that you never come over and help me, so I'm not going to pass anyway. So I'm not going to bother to do anything. He's now one of the best students in class. So it took a little time, but eventually it warmed up. He got it. He was able to kind of do the programs without any help from me at all. So he's doing great. So how do I keep everybody engaged? So I think engagement is obviously really important. I know myself, I was fortunate when I was in high school, I was a pretty good math student, maybe not as good in every other subject. But I was a good math student. And I always hated when I finished the problem and I was done. I always wanted more challenges. I didn't like being bored, right? And so I think it's really important for students to be able to be excited in class and not feel like, OK, I'm done. So I'm just going to open up the chess program on my computer and do something else or do work for another class. I want them to have something to keep learning, to go as far as they can, right? And then others need that extra support to get to the level that they can begin to be productive. So of course, differentiation, I do it on many different levels. So of course, we have the CS50 problem sets, where students can self select the problems they're going to work on, right? The materials are there that they can, if they're an advanced student and they come in-- or they kind of get into it really quickly. There's so much material online, right? There's the walkthroughs. There's the shorts. There's the lectures, right? There's notes. There's so much material online. There are sample codes that Professor Malan doesn't lecture that are available to you. So there are so many examples and so much material online for advanced students. They are often able to move ahead on their own. They sometimes never even ask me for help. Some, of course, ask me for help every day. So there's a large span, right? One thing I do do is that-- and it's kind of something that Professor Malan mentioned also. So for students that finish early, I'll keep a chart on the wall, a big poster for every problem that they work on. And if they're willing-- and every student is not up for it. But if they're willing, if they finish maybe Mario very quickly, they might become a class expert on Mario. So I'll put them on the expert list. They're going to be part of our experts for that problem. And now I make sure all the other students know they could look if they're working on Mario and they're struggling, and I'm busy working with a student over here, they could go to the student on that poster, right? I give them some extra credit for it. And of course, they have the prestige of being an expert, right? The extra credit usually helps a lot, too. They always like to get a little extra credit, right? So I'll ask them to do that and. That helps a lot to kind of keep the class going when I'm not able to be there to help every single student. And then again, we're going to take a look today at the scaffolding. And I often do allow struggling students extra time. And I know that's something different schools have different philosophies on that. But again, I don't want a student feeling so stressed because they have six other subjects they're working on, or this is just something they take more time-- they need more time to get used to understanding how to do this. I don't want them to feel so stressed on Thursday night that they have to debug their code to submit it by Friday, or they're going to fail. So I often will give them extra time. And I do let them know if they're struggling with a problem, of course, I don't want them to feel that pressure to copy a solution from a friend, right? And there's always that concern. I don't want them to feel if they have to get it in tomorrow-- they don't know what to do. The only thing they could do is copy it from a friend. So that's why I say, if you struggle, come to me, ask me, and in most cases, I give you the extra time to have-- I'll explain it to you. We'll break it down. We'll look at it again. And so I try to really stress that over and over again. At times-- and I don't do this for everything. But at the very, very end of the semester, when the problem sets are getting much harder, and I have a couple of students who just really have some issues-- and it might not even just be issues with computer science, but other issues with staying organized or other things going on in their lives. I will sometimes allow them to do an alternate writing assignment to replace a programming problem. But it would have to be something where they do research maybe a current issue in technology or writing about a particular new product so that it's still technology related, but that it's another way that they could get credit and not fear that they're going to fail the class-- get credit for it but maybe do something, an alternate assignment. Again, I don't do that for many problems. It's usually at the ends of the semester or at the end of the year when the difficulty ramps up, and they're just not really there yet, and the books are closing. I need to get the grades in. I might say, OK, I'll give them an alternative to do. Another thing I've created a couple of years ago-- I didn't use this year because I tried to use all the practice problems. But I'll make these available to you. They're not going to be available-- they may not be available after the summer because this is an older CS50 lab environment that is going to be going away. Maybe something will substitute. I'm not sure how it's going to work. But you can have them right now. I'll give you the whole list of all of these. I made these little skills-based CS50 labs. They look a little different. The terminal, when you compile, it gives you a message. So it doesn't look exactly the same. But you're welcome to use them if you want. So they're very specific on specific topics, like data types or how to use printout for different format codes or something like this, where maybe we're just looking at a sorting algorithm. I'll particular use the sorting and searching labs that I've created so that the students get a chance to develop these algorithms on their own. Because for me, I feel like it's important for them to understand how their work. And the best way to understand how they work is for them to be able to code them. So again, I have a whole list of these. They're actually already shared if you go to-- and don't do it right now. But a little later, if you go to the agenda, you'll see there's a link for all of these labs, right? And again, I'm not guaranteeing they're going to work past the summer. But if you want to see them or get ideas for them, you're welcome to do that. Now, I've had a couple of students on the other side that move so quickly through the curriculum. This year, I had one student-- this has never happened in eight years before-- who finished the entire CS50x curriculum in the first month of school. I don't know how he did that. He obviously came in with a lot of experience. I've never had anybody finish the whole curriculum in one month. So I had him go through the CS50 Python curriculum-- finished that the next month. Then I gave him the CS50 artificial intelligence curriculum. He finished that. And now. I think he's working on the CS50 game curriculum. So there's-- the nice thing is that there are other things there in the CS50 universe that students can do. So if you have that very rare student-- and again, 150 students over eight years, it doesn't happen often. Last year I did have a couple of students. And maybe they got very used to-- I think maybe when they were working remotely during COVID, there were a couple of students who just became very used to being able to work independently, look things up. So I had a couple of students that pretty much went through the curriculum, but it took a little longer. But they eventually got through the entire curriculum before the rest of the class. And so they also-- I gave them the Python curriculum to work on after that. So again, the goal is to always have students engaged. There's really so much material. They never really run out of something they could do. And the nice thing about staying in the CS50 universe is that there's a similar feeling and a similar workflow to how the programs work. You have a problem spec. You have a problem. You have a way of submitting it. And so it's a familiar environment. And it allows me to kind of keep them going as well. And then again, as I mentioned, I use the poster system for the CS50 TAs or experts, right? We call it the expert system. And so I do encourage students to help each other out. We talk a lot about how to help each other out with academic integrity. What does that look like, right? Ask good questions, give hints. You never let somebody look at your finished code, right? You never tell somebody exactly what to type in. And I tell them also, you're not allowed to touch their keyboard. I don't want an expert student going over, boop, boop, fixed it for you. And then the other student has no idea what happened, right? So we want to make sure that everybody is doing their own coding. So again, that helps a lot as well, particularly with large classes. So how do I use the scaffolding? So often what I'll do is that I'll bring a group-- I'll kind of keep track of who's doing what. I'll bring together a group of the students who are really struggling at a table in the front of the room. I may make other people move out of the way, right? So you're going to come to the front of the room. And then I'll have them bring their laptops with them. And we'll go through together, and we will do another walkthrough of the program, take a look at the problem spec, make sure where to show-- because sometimes students don't even know where to look to get-- where do I find the information about what I do? There's so much stuff here. So I'll make sure we go, we look at the specification. We make sure we understand what is expected for this particular problem, what's the goal here. Then we'll maybe just download the distribution code, which is usually just a main void at the beginning, right? And then we'll start to do a little pseudo coding together. And sometimes, if they're really, really struggling, we may even just begin to code the first couple of lines of the program. Maybe you do while loop to validate user input. You know what? I'll try to do it interactively with them, right? What are we going to test for? What kind of conditions should we have here? So we may do something like that. So what I wanted to do, I thought that we could try to do a little bit of this together. And then you can do this in groups. We'll do one program together, which is one of the practice problems. And then what you'll do is you'll go up to the rooms you were in yesterday, where you did the micro teaching. You'll meet with the same groups. If you have a laptop, take your laptop with you, right? And I have printouts. And I'll pass these around for students that don't have laptops. For the problem spec, I have an abbreviated version so it wasn't tons of paper to print out. But if you go to the agenda, if you go to the agenda-- you know the agenda for today, where you have the links for everything? Does everybody know where to find that? So under the presentation Differentiating, there's a bunch of links. So you'll see a link for-- the first link is called-- it's prime.c. And this is one of the practice problems that we're going to take a look at. So I'm going to pass these. Take one if you don't have a computer. Or just let me just give you maybe not quite as many. Hang on. So that I can pass them around. So pass them around and back if you don't have a computer. If you have a computer, you'll use that instead. So if you could pass these back. If you don't have a computer, you can take one of the printouts. AUDIENCE: [INAUDIBLE] MARGARET TANZOSH: Sure. Take what you need and pass them back, please. So if you do not have a computer, take a printout. If you don't have a computer, take a printout or just pass it back. Anyway. DAVID MALAN: [INAUDIBLE] MARGARET TANZOSH: Oh, OK. All right. Yeah. DAVID MALAN: [INAUDIBLE] MARGARET TANZOSH: Yeah, we can keep them in here. I wanted them to work together in groups. So they could just work on their tables with the people around them. That's fine. So if you don't have a computer, take it and hand it back. That's no problem. So we've actually got a little change of plan. We're not going to go to the groups from yesterday. We're going to work in groups here. It just makes it easier. They're coming back here. The printouts are coming back. If you don't have printouts, I have more here. Anybody still need printouts? Everybody have a printout that doesn't have a laptop? Yeah? OK. Everybody good? Here's a couple extras, in case anyone else [INAUDIBLE]. So if you go to the Agenda for today, when you come down here, Differentiate for [INAUDIBLE]. So you're going to see links here, right? And the first link, when you open it up, this is going to be one of the practice problems that we talked about. So it's just a simple-- the practice problems are just on single, little topics, one or two little topics. There's always learning goals on the top. This is to get some practice using for loops, also some practice using modulo, and some practice creating a Boolean function. So since this deals with for loops, it might be something that you want to use with students, get some practice, before starting Mario. Because Mario's going to depend on for loops, right? And then what I'm going to do is I'm actually going to open my code space as well, which I thought I had opened, but I guess it closed. So if you have a laptop, you could go to the problems back here. What I want to do is let's just walk through a little what this is going to do. There's a lot of code that is already supplied. And basically you're just completing a function. Has everybody that has a laptop able to find this link? AUDIENCE: Yeah. MARGARET TANZOSH: All right. So it's just a short, little program to generate prime numbers. And we have some distribution code here. And then we have our implementation details. So I always like to point out to students, let's take a look at the section under Implementation Details to kind of focus their eyes in a particular place on the problem specs. So I give a hint here, right? The easiest way to check if the number is prime is to try to divide it by every number from 2 up to but not including the number itself. If it divides with no remainder-- I guess that's a typo. If it divides with a remainder, it's not prime, right? So the main function has a for loop, right? So really, you're creating the inner for loop of two nested for loops. The main function is a for loop that looks at every number within a particular range. And then you're going to be completing a function that checks that number and returns true or false, depending on whether or not the number is prime. So what I'm going to do, I'm going to start with-- and you can do this if you have a laptop as well. Do it with me. Copy the line and then in the codespace, we're going to-- see, what happened to my codespace? What we're going to do is we'll start with the distribution code. Now, before you do this with students, you may want to have the solution printed out next to you so that you kind of remember exactly what you're going to do to get there. So here is the distribution code. So what I might do next is that I'll walk through with students, what exactly is this code doing because sometimes students are still just learning to, particularly if this is a unit one problem, understands some basic stuff, right? So I might just ask them, what is this? Why do we hash, include, cs50.h? What does that allow us to do? Why we including standard io.h, right? Mention this is the function prototype of the function you're going to create, right? Maybe ask some questions about it. We have our main function, right? We have a typical do while loop, where it's declaring a new variable, right? And then I might even mention to the students, why do I have to declare the variable before my do while loop just as a way of reviewing some key concepts. So basically we're just getting a minimum and a maximum value, where the minimum is going to be cannot be less than 1. And the maximum has to be at least as big as the so that we don't take some bad inputs up front. So then we have a for loop that's given to us. That starts at the minimum number, whatever that's given. And it iterates through the maximum inclusive. And then we execute this function. I might say that prime is going to return true or false. So I could also do this. And I might just show the student how I could just say, if prime, because that is true or false, or I could save prime equals with the input of i, equals equals true. And then I'll make sure to mention that we're going to be testing because the input for the function, the argument that's being passed to it is going to start where i starts, which is the minimum value input up here. It's going to iterate through the maximum value. And if necessary, I might remind them how a for loop works, right? We have the setup version of for loop, the setup portion that runs once the initialization phase-- our condition to determine if it's going to run. And then we have iteration, which executes after the loop is executed. So I'm going to be using the function here to determine if the number is true. And if it is true, we're going to print it out here. So far so good? So I'll make sure to explain it. So now what I might do, I might come down and start to work up some pseudo code. Now, I happen to secretly have the solution here so that I remember exactly what I need to do. So I'm going to keep this on the side someplace so I don't mess up my little thing, because I forget. When I did this with my class, I actually forgot that we need to return false if the number is 1. I forgot that part. So this way I remember. So then I might just say, OK, we're going to complete this function. You take that out. And then remind them, we're starting. If the input is 1, what do we know about 1? Is 1 a prime number? Do we want to divide something into 1, right? So we know of the top of our head that 1 is not prime, right? So I might put something like a check if number number is 1. If so, return false, something like that, which is what we're going to actually do over here. So I'm not going to give them the code. But I'll put some space on here so that they could actually then leave the comments in their code as actual comments. The pseudocode can stay and explain the code below it. So I might put something like that in here, right? Then I look at my solution. What else? So I need to start dividing everything. We don't want to divide 1, but from 2 up to but not including the number itself, right? We're going to try dividing that into the number that's given as the arguments appear. And if it turns out that, using modulo, we get a 0, that means that there's a remainder, right? Actually, yeah, if it goes-- there's no remainder is what I'm trying to say. If the number i divides into the argument with no remainder, it means it's a factor, right? If it's a factor, it's not prime. We return false. And then we're going to return true here. So I might say here something like, OK, so what are we going to do next? We have to look at every number starting at 2 up to that number. How do we do that? Maybe we need to use a loop, right? So maybe loop from 2 to number, number, not including number, number, right? So I might say something like that. And then say, OK when we're looping through it, we're going to test if i, if we're using i, something like that, i divides evenly into number, right? And then something like if so, it's a factor, return false, right, something like that. And then I'll say, so how do we know if it's not a factor, right? So this is actually-- I might even indent it like this because this is actually going to be part of my if statement, right? That's how my code would work. So then what might I say here? Who wants to help out? How would I-- because I would prompt the students. I want to keep the students involved, right? So how might I from here, let them know that? Because one of the things that students will often do, one of the mistakes might be to return true right over here, right? If the i didn't-- it was not a factor, so I'm going to return true, right? But what happens if I return true right over here? Does everybody see what I'm saying? Before the for loop concludes, if I return true, is this going to work? AUDIENCE: [INAUDIBLE] MARGARET TANZOSH: What? AUDIENCE: [INAUDIBLE] MARGARET TANZOSH: Sorry? AUDIENCE: [INAUDIBLE] except that [INAUDIBLE] including the [INAUDIBLE]. [INAUDIBLE] Every number-- MARGARET TANZOSH: Right. You need to test every number, you're saying. AUDIENCE: Every number that [INAUDIBLE] of number is [INAUDIBLE]. MARGARET TANZOSH: Right, that's right, but it always ends up being true, right? Because the first number that doesn't have a remainder, then you're automatically going to return true. And we don't want to do that. So we would want to make sure that we talk about that. So then we want to say, so this is a loop. So make sure they understand after loop finishes, if no factor, return false, something like that. And so then I'll say, OK, so now figure out how are you going to actually use the code to do this. Does that make sense? AUDIENCE: Yes. MARGARET TANZOSH: Yeah? So I would do something like this, right? And then I'll let them work on it for a little while. And then see how far they can get. So then I would turn it over to them. All right, so see what you can do. Try to make some sense of it. Sometimes they still struggle a little bit. So I might say-- if I come back, say, for instance, a little while later, they haven't made too much progress, I might even say something like, how do I check if this value of number. Is 1? How do I check that? I might want an if statement. So I might give them the first line of code equals 1. Then we're just going to put a comment here. This should be-- should return false. I might not give them the actual code yet, just a little line at a time, and then let them take it from there. So you could see that this is actually a code B, a nested four loop. You have one four loop here. And this is actually calling another four loop. So it might be something that could be useful to prepare students for Mario, where you're going to have nested four loops. So what I wanted you guys to do-- so you'll notice in the printouts and in the agenda over here, I have three other programs-- Mario, which would be maybe the one that comes after this, and then Password-- I'll show you Password. Password is another practice problem that I created last summer that students liked. The video doesn't work here. The video is actually a really silly video. It's a clip from a movie, an old movie called Spaceballs, where there's this person, his daughter is going to be-- they're going to chop off her nose or something if he doesn't give them the code for some secret thing. So they go over-- what's the code? OK, I'm going to give you the code. So he gives them the code. It's 1, and they write it down. 2, and then they write it down. 3, 4, 5. Oh, OK, so the code is what-- anyway, so it's very silly. So the whole point is just that it's important to have good passwords. So the program itself, again, we get a little bit of code to start with that we'll take a quick look at, but then I want you to think about how to do this. So the idea is-- and there's a little demo here also that I put in these so you can get a sense of how the program should work. So you're going to enter some password, but you need to check that the password has one uppercase letter, a lowercase letter, a number, and a symbol. So this program was really helpful to prepare students for readability, where they had to now use the ctype library to count letters, to count spaces, and to count certain punctuation. So this was what I did just before I got to readability. So here you can see we're trying it a few times. That's how it's going to work. So I'll take, again, the distro code, but I'm not going to work-- I'm going to let you work on these three. And I'm available to come around and if you have questions. But let me just open my terminal-- sorry. Oh, gosh, too many things going on here. There it is, OK. Password-- all right, so password, so again, we have a function that we're completing to give students ideas with functions. We already get-- the get string is given to us. Enter a password, and then we're just executing again another Boolean function to say if valid password, in other words if it returns true, your password is valid, else-- it returns false. So the idea is and the problem spec, we can come back here. There's some implementation details. And it's a lot of detail here already that you could-- how you have to find everything out. And there's a check 50 here, not a submit 50. But you can choose to use it however you want. So I give them a big hint over here. You might want to create a Boolean value for each condition, set it to false before you start iterating through the string. Because again, here we have an iteration through a string, which you need to do for readability as well and eventually for Caesar. And if you find that the number-- if you find a number, you set that Boolean to true. If all the Booleans are true at the end of the function, then all the criteria are met, the function would return true. So again, what I'm going to do now is turn it over to you and say, on your laptop, if you have a laptop, or if you don't have a laptop, you could write it on paper, I want you to-- rather than moving upstairs, which takes too much time, we'll lose all of it-- work with the group around you, the partner next to you or behind you, as much as you can, and together figure out how to scaffold this. You could talk to each other. You could even prompt each other. How do I create a Boolean variable? How about I do this? Let's put in some comments first, like that we're going to create these variables. You can even start to do a little coding together. But just start out with some pseudocode. How would I do that? I might need to define some Boolean variable, maybe set it to false. And you can put that in pseudocode to start. Question? You're good? OK, good. All right, does everybody know what to do? AUDIENCE: Yes. MARGARET TANZOSH: OK, good, so I'm going to turn it over to you. And then we can come back and we'll take, I guess-- I've totally lost track of the time, but we'll take a little bit of time, and I'll give you some time, and then we'll take a look, and we'll go over it together. OK? OK, good. All right, so let's bring it back together. I just typed in some sample pseudocode that I did with my own students, something like this. So I'm not going to give them all the code up front. The idea is that I want to work with them. I don't want to just tell them what to do. I want to keep them involved. And I want to just ask them, how do I get started? And then they don't know. So I might say, well, the problem spec-- and I might go back and even refer to it because I want them to also get used to reading the hints and reading the problem specification. All right, so over here it gives us some nice hints. We might want to create a Boolean variable for each upper, lower, whatever, and set it to false before you iterate through the string. So if I might say, great, that's how we're going to start. So maybe the first thing you're going to do is you're going to declare a Boolean variable has upper, set it to false. And then I put the comment there. I don't give them the code yet. I'm just releasing a little more information each time. All right, then I create a Boolean variable for has lower. Then maybe eventually I'll say iterate through the string password. How do we iterate through a string? And then someone might say we use a loop. Great, so you're going to use a loop. We've looked at loops before. You could watch the lecture video. We always have lots of examples of iterating through strings. Iterate through a string, and let's look at one character at a time. All right, then you're going to use the ctype library. You might want to include that on top. So the ctype library has a lot of really great functions. And you might want to use these for other programs as well, like when you get to readability. I would give them hints. And then if the password has a letter in it, like password square bracket IS uppercase, set has upper to true. I might not even finish this. I might just get them going like this. And then I might say at some point something like dot, dot, dot, like they can figure it out for themselves. And then maybe we want to put something like if all Booleans-- Booleans are true, then what does that mean? AUDIENCE: [INAUDIBLE] MARGARET TANZOSH: Right, so we're going to return true. And then do I want to put that in four loop or not in four loop? I might ask them that question. AUDIENCE: [INAUDIBLE] MARGARET TANZOSH: Well, if I find the first four letters is a letter an uppercase, a lowercase, a symbol, and a digit, do I still really want to go through the rest of the password? AUDIENCE: Yes. MARGARET TANZOSH: But why? Because we already know it has everything we need. AUDIENCE: [INAUDIBLE] MARGARET TANZOSH: All right, so we might want to short circuit the whole check and say, great, as soon as I find all four things are true, I can return true right away. I don't need to waste any more time. So I might give them those hints also, which are a little bit about design. Like if you have some kind of function and we know that function is good. Like if you're doing a linear search function, as soon as you find the match you can return true right away. You don't need to continue. And then maybe where are we going to actually know it's not valid? Do we want to do it inside the loop? So maybe we want to stress maybe after loop, loop not valid. So they could figure out what to do from there. So I'm going to actually say that's basically-- I'm hoping that you got something out of this. The idea is really just to get a little idea of how to get started scaffolding for students. You don't have to do it this way. This is just what I do. My students really like this. And I have to be careful with them because then sometimes they'll say, just give me the pseudocode up front. And it's like, no, no, no, no, no. I want you to work on it for a while, and then when you have questions, then we'll do a little at a time. All right, so thank you so much. I'm going to turn it back over to Professor Malan. DAVID MALAN: Thank you. MARGARET TANZOSH: And it was really great working with you. DAVID MALAN: Thank you. [APPLAUSE]