How to submit your programming projects
Your projects will be submitted and automatically tested via the web. You will use the online submission system at http://csi-info.baylor.edu/upload/. The system currently only works properly with Internet Explorer; so please use that browser when submitting and testing your programs.
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.
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. Note that if you make any changes to your code, you will need to upload the code again to the server for the server to notice the change.
You can submit each file as many times as you wish, until the deadline for that project. There is no penalty for multiple submissions.
Your goal is to submit a program which successfully compiles, runs, and gives the correct output for my hidden test cases. When you pass the online submission system, you are done. You will know you passed when you test your code and the system responds with "YES. Your code passes and will be graded for style and implementation."
Your code could fail to pass the system for several reasons. If your code doesn't pass, the system will tell you "NO" and give you a reason why. The reasons are:
- You have not submitted all the necessary files.
- Your code does not compile.
- Your output does not match my output on the same input.
- Your program crashed on an assert during execution (you will be given the assert information).
- Your program crashed during execution.
- Your program leaked too much memory during execution.
- Your program wrote to or read from memory it did not own.
- Your program required too much time to execute.
Remember that if you do not pass the online submission, you will not receive a grade for the project. So it is extremely important that you start early and work hard on your projects.
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
In order to verify that your output is exactly the same as my 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.
- Open the Options control panel (Edit -> Options)
- Set the options to be "Compare whitespace" and set "Sensitive to EOL" to be true.
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, I have seen that CodeWarrior will (by default) ignore differences in newlines, so that is a problem. I recommend using WinMerge.
Here are some important tips to make sure you are comparing files correctly:
- Do not use copy and paste for input or output. Copy and paste can introduce extra newlines, and perhaps other things, that aren't part of the original file you are copying from.
- To get input/output files that I have provided for you off the web properly, right-click on the link and use "Save target as..." (for internet explorer) or "Save link as..." (for Mozilla). This will make sure the file that is on the website is exactly the file that is on your hard drive.
- To get input to your program directly from the file, use input
redirection. In DOS and UNIX (Linux), you can redirect a file to be the
standard input to your program (instead of from the keyboard). The syntax
c:\my_folder> my_program.exe < input_file
- Similar to input redirection, use output redirection to save your
output to a file, exactly as it comes out of your program. Here we use
">" and a file name:
c:\my_folder> my_program.exe > my_output
- Putting it all together, we would use input and output redirection at
the same time:
c:\my_folder> my_program.exe < input_file > my_output
Other than comparing your output with my 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 your IDE's debugger.
If you use an assert() in your code, and your program stops on an assert() during my judging script, the judging script will give you the information of that assert. That includes the file name and line number of the assert() that failed. This can be very useful for debugging. The output may look something like this:
NO. Your program crashed on assert() during execution. Here is the assert output: test.cpp:5: int main(int, char**): Assertion `myPtr != NULL' failed.
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. After the deadline, I will look at your program for style and implementation, and your grade for the project will be based on these things. So, for example, if your code passes but is not well-formatted, you should re-submit the code when you have it formatted properly.
If the submission system is not working properly, it could be due to several reasons.
- You get a message like: "The submission system for this project is not yet ready (code 1)". In this case, the system is not ready to grade that project. Generally, I (Dr. Hamerly) will know about this, and you don't need to worry. I just need to finish getting it ready.
- You get a message like: "NO. You have not submitted all the necessary files.". In this case, the system thinks you have not submitted each file you need to submit, and it will not test your project until you do.
- Make sure that you allow cookies from the webserver.
- If something else is wrong (you can't log in, the system doesn't respond, etc.) please write me an email explaining carefully what the problem is and any output that the system is giving you.
- If I have any news or updates on problems with the submission system for a particular project I will post them on Blackboard.
Many thanks to Bill Booth for providing the uploading system.