12

Here are some of the most frequently asked questions about check50.

  • What is check50?
  • What is an ID?
  • How to run check50?
  • How to know if my program is correct?
  • Does check50 record my scores in CS50's gradebook?
  • What are other errors that check50 might give?
11
  • Ummm, Kareem, this was well explained in pset1 specifications and also in the CS50 Live, Episode 001, so, I don't think we need this here as well
    – Nib
    Jun 20, 2014 at 10:55
  • 1
    @Nib is right, I don't personally think SE is meant for such posts, maybe you can put it up on Facebook or somewhere
    – user007
    Jun 20, 2014 at 11:19
  • 1
    No need to be so harsh on our friend, @user007. I'm pretty sure he didn't mean to unhelpful, he's a really great guy, and he made the question only to help ppl like me and you :)
    – Nib
    Jun 20, 2014 at 11:25
  • 1
    @Nib as you know, I'm a fan of the facebook group. These questions are all over the place there even though they're explained. I thought it'd be a good idea if we have them collected together in on place and explaine the answers in such a way as simple as we can. Many of the answers down here are quoted from pset1 specifications page though! Anyway, thanks for your feedback! :)
    – kzidane
    Jun 20, 2014 at 11:31
  • 1
    @user007 do you really think so? Thought I'm having a number of bullet pointed questions and I could answer each of them specifically! :) It's up to you to do whatever you want for sure! But I don't think I broke any of the rules :)
    – kzidane
    Jun 20, 2014 at 11:36

1 Answer 1

19

What is check50?

check50 is a command-line program included in the CS50 Appliance with which you can check the correctness of (some of) your programs.

What is an ID?

Each program that is checkable with check50 has a unique ID that identifies it. You can find this ID in your pset specifications page. For example, the ID for hello - pset1 is 2014/x/pset1/hello.

How to run check50?

The easiest to run check50 involves 2 main steps:

  1. To be within the directory where your program's source code file (the .c file).
  2. To know the ID for the program you want to check its correctness (included in the pset specifications page).

Assuming the .c source code file for hello - pset1 exists in ~/Dropbox/pset1/hello. And from the pset specification page, the ID for hello is 2014/x/pset1/hello and the source code file is named hello.c

  1. Open up the terminal.
  2. Navigate your way to ~/Dropbox/pset1/hello by executing cd ~/Dropbox/pset1/hello.
  3. Execute the command check50 2014/x/pset1/hello hello.c.

Notice that we passed the file name (i.e., hello.c) after the ID in the command above.

Some psets require passing more than a single source code file. Please follow the instructions in your pset specifications page!

How to know if my program is correct?

Assuming your program is correct, you should then see output like

check50's output for hello

where each green smiley means your program passed a check (i.e., test). You may also see a URL at the bottom of check50's output that contains more details.

If you instead see yellow or red smileys, it means your something is not correct! For instance, suppose you instead see the below.

check50's output for hello

Because check50 doesn’t think hello.c exists, as per the red smiley, odds are you uploaded the wrong file or misnamed your file. The other smileys, meanwhile, are yellow because those checks are dependent on hello.c existing, and so they weren’t even run.

Suppose instead you see the below.

check50's output for hello

Odds are, in this case, you printed something other than hello, world\n, per the spec’s expectations. In particular, the above suggests you printed hello, world, without a trailing newline (\n). So, your output must exactly match the required output per the specifications page.

Does check50 record my scores in CS50's gradebook?

Know that check50 won’t actually record your scores in CS50’s gradebook. Rather, it lets you check your work’s correctness before you submit your work. Once you actually submit your work (per the directions at this spec’s end), CS50’s staff will use check50 to evaluate your work’s correctness officially.

What are other errors that check50 might give?

check50 might throw some errors when running it. For example, if you see an error like this

Checking....... server responded with status code 400. Try again later!

You should run the following command in the terminal and try again

update50

If you instead see an error like this

Checking.......... invalid ID

You should make sure your ID (e.g., 2014/x/pset1/hello) is correct! Check the previous questions and answers for more information!

6
  • "CS50’s staff will use check50 to evaluate your work’s correctness officially." --- Can you please explain that? Does that mean that they will not read our code?
    – Kartik
    Aug 30, 2014 at 16:00
  • @Kartik if you're taking the course through edX, then I'm afraid not. The solutions to the psets and the final project are graded automatically.
    – kzidane
    Aug 30, 2014 at 16:01
  • How does it grade the final project automatically? AFAIK, we have to upload a video instead of the source.
    – Kartik
    Aug 30, 2014 at 16:04
  • @Kartik if you submit, then you'll take the grade.
    – kzidane
    Aug 30, 2014 at 16:07
  • can check50 be imported outside of the appliance environment?
    – phillipsk
    Jun 27, 2015 at 14:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .