How to submit your programming projects

Your projects for this course will be submitted and automatically tested via the web. You will use the online submission system at

Using the system the first time

Please do the following as soon as possible. The system uses a username/password system so you can log in to submit and test your code. The username is your Bear ID (such as "John_Doe"), and your password is initially "baylor" (without quotes). The first time you log in you should use this password, and the system should immediately ask you to choose a new password. Once you have changed your password, you will be sent back to the login page, where you can log in with your Bear ID and your new password. Note that the login mechanism is case-sensitive (even for your Bear ID).

Submitting your code

When you log in, find the project which you want to submit. There will be submission fields for each file you should submit for that project. You should use the "Browse" button to locate each file you want to submit, and then click "Upload" for each file to send that file to the server. After you have submitted all of your files, you can click "Test Program" to compile and test your program on the server. Of course, if you change your code on your computer, you will need to upload the code again to the server for the server to notice the change.

You may submit and test as many times as you like; there is no penalty for multiple submisisons. Only the last submission you make will be graded. When you submit your solution (clicking "Test"), the submission system will test it on hidden test cases. You will receive a response about whether your program's output matched the correct output on the test inputs. If your program does not produce identical output to the correct solution on the test cases (character for character), or if you do not follow the style guidelines, or your project has some flaw that was not discovered by the testing system, then your project does not yet pass or receive credit.

In addition, your program should not leak any memory. The upload site will test your code for leaks using valgrind.

Your goal

For each project, you should accomplish two high-level goals:

  1. Submit a program which successfully compiles, runs, and gives the correct output for hidden test cases. When you pass this part, you will receive a message from the judging robot which says "YES. Your code passes the tests, and will be considered for style and implementation."
  2. Your code should comply with the style guidelines. After you have gotten a YES from the upload site, you will recieve an email from me (or the TA) telling you that your code does pass the style check (in which case you are done), or does not pass (in which case you must re-submit to the judging robot).
Remember that completing a project requires passing both of these goals.

Your code could fail to pass the judging robot for several reasons. If your code doesn't pass, the system will tell you "NO" and give you a reason why. The reasons are:

  1. You have not submitted all the necessary files.
  2. Your code does not compile.
  3. Your output does not match my output on the same input.
  4. Your program crashed on an assert during execution (you will be given the assert information).
  5. Your program crashed during execution.
  6. Your program leaked too much memory during execution.
  7. Your program wrote to or read from memory it did not own.
  8. Your program required too much time to execute.
For reasons 1-2, you can always immediately re-test your project. For other problems, there is a delay built in that will prevent you from testing your program too frequently. This delay is present so you will spend time thinking carefully about the problem and testing on your own computer.

Note that there is a column on your test screen named "SOLUTION OUTPUT:", but it will always be empty. You can ignore this column.

Testing your program

First of all, you should be testing your program on YOUR OWN COMPUTER. You should not using the upload website as a testing/debugging/development platform. The upload website is for GRADING your program, but you should TEST your program on your own computer. For each project you will be provided a sample executable (which is the professor's compiled solution) which you can use to run on your own computer.

In order to verify that your output is exactly the same as the professor's output, you should use a diff utility. Sometimes files look exactly the same to the naked eye, but they are different because of spaces and newlines (or some other hidden characters). Diff utilities will catch these differences you can't see.

I recommend using WinMerge (if you are using Windows). Here is a link to download WinMerge directly. When you run WinMerge for the first time, make sure you do the following:

Setting these options will make sure that WinMerge catches every difference.

Metrowerks CodeWarrior also allows you to compare two files (see menu Search, option "Compare Files"). However, CodeWarrior will (by default) ignore differences in newlines, so that is a problem.

Here are some important tips to make sure you are comparing files correctly:

Other than comparing your output with the professor's output, you should use your debugging skills to find problems in your programs. Use print statements, and check them for behavior that you expect. Use assert() (see below). Use your IDE's debugger.

Don't use exceptions

You should never use exception handling in projects for this class. Exception handling is a poor substitute for correct logic in a program, and it doesn't work the same on all computers and all compilers.

Exception handling is a mechanism for error handling, not normal program function. Don't use it for this class.

Using assert()

The C/C++ function assert() allows you to tell the program "make sure this is true, and if it isn't, crash the program and tell me about it". To use this in C++, just #include <cassert>.

Assert can give you very useful feedback about where your program is going wrong. You pass to assert a condition that should evaluate to true or false. If it is true, then nothing happens. If it's false, then assert crashes your program and prints an informative error about where the program crashed.

Here is an example:

char *my_string = new char[1024];
assert(my_string != NULL);
If this memory allocation fails, then the pointer my_string will be NULL, and the program will crash when it gets into the assert. It will print something like this:
example.cpp:7: failed assertion `my_string != NULL'

If you use an assert() in your code, and your program stops on an assert() during the upload site evaluation, the upload site will give you the information about that assert. That includes the file name and line number of the assert() that failed, similar to the above example. This can be very useful for debugging.

If you use them wisely, asserts can be very useful for tracking down bugs in your code.

After you get a YES

If your code passes the online tests, then you are almost done. Make sure that your code follows the style guidelines, and that you are using the data structures in a correct manner for the project. You must have proper style to pass the project. So, for example, if your code passes but is not well-formatted, you should re-submit the code when you have it formatted properly.

Having problems?

If the submission system is not working properly, it could be due to several reasons.


Many thanks to Bill Booth for providing the uploading system.

Copyright © 2006 Greg Hamerly.
Computer Science Department
Baylor University

valid html and css