Early Days- Assessment
- gregbeutler
- Jul 25, 2022
- 4 min read
This is less of a lesson, but more of a quick assessment for incoming students, who have taken a semester or more of python. I allow 30 minutes to finish. And the student can use any and all resources, inclusive of google.com.
The problem is pretty straightforward, have the students code a simple calculator, but in reverse
It is checking the answers to the 10 addition problems displayed 1 at a time to the students and then scored for total correctness.
This problem assumes that the student is familiar with coding and in particular the concepts of
1. input types ( alpha and int)
2. storing them into variables
3. basic programming structure
4. print statements
5. if / else conditional
6. Random function ( and range)
7. looping ( 10x)
8. casts ( str and int)
9. initializing variables
There is also a stretch goal section for the quick students
Extra credit for
1. stretch goals
2. using a function for random integer
3. good variable names vs. x1 and x2
---it could easily be turned into a lesson, whereby the teacher and class solve this problem together. I would present the problem and give the students about 10 minutes to solve it and then share what they have learned and partially solved with their partners.
Then we go through what people know and don’t know ( questions they still have on how to solve this problem)
E.g. how to get a 2 digit random number or how to input either an integer or alpha value and not crash and yet print out the EEE for the alpha or incorrect answer as well as continuing on with correct answers.
We all code together and work on it together. It’s a good deal slower, but it surfaces a good discussion on how we solve coding problems. As many students, will want to just start coding without much thought as it’s just addition and they feel that it's a very simple problem to code. It is and it isn’t . There are a few dozen nuances that they may have forgotten how to implement properly.
Some student’s coding solution may just prompt for an input; check if it's right, else spit out ’EEE’ to the console and declare it finished. And they have a lot working but it’s not a finished program. How much of the concepts 1-9 above that are used properly will tell me how good of a coder they really are.
And as a class, we work with majority votes, and may go down an erroneous path or 2, that’s fine for this problem. And I do it later when we do FRQs as we need to check our assumptions and problem solving process.
so here's the problem on repl.it

As you can tell at a glance, I've given them two libraries, random is all they really need to use the random number generator, Sys library is to prettify the outputs.
I give them a hint on line 13 to use a function, but for many it could be a good bit too vague, especially with time pressures
I also give them a reminder of the str cast to print out the proper value of score and that hopefully jogs their memory that theirs also int casts to be used.
So I will follow up in a few weeks after I use this assessment on my incoming class and see how well it works in practice.
But for now, you can use it to see if they know *any* coding and you might get something like

At first glance this looks very reasonable and readable ( thanks Python), they took the hint and made use of the function header, figured out how to create a user prompt, an If else construct and added 1 to the score for a correct answer. This shows a ton of understanding, and will be interpreted properly and still not give the right answer.... yes, what is wrong here still?
Hopefully you found it.. on line 13, variable answer is a STRING, but we are comparing that STRING to the math operation in line 15 where we are adding our operands to ascertain if we have the right sum or not.
If there's time to run it, obviously ask them why the score is not incrementing even if you enter the proper answer. If they still don't know ask them what is the value of answer.
and have them try to print it and then the type..
e.g.
print (answer)
print(type(answer))
and hopefully that will get them thinking. as to what to do next.
| points |
1. input types ( alpha and int) | 1 |
2. storing inputs into variables | 2 |
3. Basic programming structure | 2 |
4. print statements | 2 |
5. if / else conditional | 2 |
6. Random function ( and range) | 2 |
7. looping ( 10 times) | 0 |
8. casts ( str and int) | 0 |
9. initializing variables | 1 |
12 points for the code above.. pretty much a passing grade. yes they missed the looping and casts, but they know enough to be admitted to my class. As it is time limited and for many a lot of content that they have since forgotten how to do. But I'm impressed that they remembered or googled how to make a function and how to use randint() to get a 2 digit value

of course, this isn't perfect, as it should really read randint(0,99), but they're getting the idea. Again, its a screening assessment, nothing more. If they review with me and can fix it, I'll add on points to their score.
I hope this simple example has been helpful.
Send me comments if you please to
टिप्पणियां