Hello, everyone. Welcome to the section 19 challenge 2 project.
In this project, what I'd like you to do is
write an automated grader.
Let me explain what that is. We want to write a program that reads a file,
and this file is called responses.txt which I'm providing for you.
That file contains the answer key for a quiz that some students have taken
as well as the responses from the students for that quiz.
The structure of the file is really simple.
The first item in the file is the answer key,
and it's just a simple string with a bunch of letters in it.
Then you've got student pairs. As far as student response,
student response and so forth so. Here's a sample file.
You'll see right here on line 17 is the very first line of the file.
That's the answer key. So in other words, the correct answers to this quiz are a
b c and d.
Now we've got student response pairs here.
As you can see there are five students here.
Frank's answers are abcd and e. So Frank got a 5 out of 5.
Larry got abc a and c. So we only got the abc part right.
So Larry got a 3 out of 5. Moe got the
bcde, so he's got a 4 out of 5.
Curly's got the b and the e, so he's got a 2 out of 5.
And Michael's got all but the first one, so he's got a 4 out of 5.
That's it so what you have to do is basically read this file,
process the data and then display the output.
The output display is pretty straightforward. You can format it, so it looks nice.
But it'll look something like this.
So it'll say student and score. It'll display the student, it'll display the score that they got out of 5.
And then at the very end, you'll have a little footer that shows the average score, in this case,
3.6. You can assume that the data file is properly formatted.
You're always going to have pairs. You're not going to have missing data.
And you'll always have at least one student in there.
Okay. So let me give a sample run so you can see what it looks like.
So there's a sample run given this data right here.
And as you can see here, I've got the student, the score
Frank Larry Moe Curly and Michael.
And there's a score out of 5. And the average in this case is the 3.6.
So here you'll get a chance to read a file to do some processing.
And you'll get a chance to use your manipulators to line this up, so it looks nice.
Let me show you the file itself. It's called responses.txt.
And there it is. You can add data to this, and test it all you like.
There is no test case right now with a 0, so you might want to add that as well.
And that's about it. You can find it in the section 19 workspace,
in the challenge_2 project.
There's also a challenge_2_solution project,
which is the one we're going to talk about in the next video,
where I'll show you my solution. So have fun.
Add fields to it, if you like. Change the the length of the answers.
Right now the quiz is only 5 questions. You can change that around if you like.
Like I said, do the base challenge, and then just have fun and learn from it.
All right. So I'll see you in the next video, and I'll show you a solution.