Difference between revisions of "Submitting Java Programs to Moodle"
(2 intermediate revisions by the same user not shown) | |||
Line 35: | Line 35: | ||
<center>[[Image:212_moodle_6.png|600px]]</center> | <center>[[Image:212_moodle_6.png|600px]]</center> | ||
<br /> | <br /> | ||
− | <br /><br /><br /><br /><br /><br /><br /><br /><br /> | + | * Normally, there won't be a limit on the number of submissions, so feel free to go back to the program, edit it, and re-evaluate it. If nothing works, you may want to go back to beowulf2 and work there. |
+ | <br /> | ||
+ | |||
+ | ==Be Careful of Extra Space Characters!== | ||
+ | <br /> | ||
+ | Look at the evaluation results below. It is for a program written in assembly language, not Java, but you could get the exact same problem in Java: | ||
+ | <br /> | ||
+ | <center>[[Image:MoodleSubmission5.png|400px]]</center> | ||
+ | <br /> | ||
+ | It seems that the output of the program matches the expected output, but for some reason, Moodle rejects the program... Why? | ||
+ | <br /> | ||
+ | Take a closer look at the image to see if you see the problem... | ||
+ | <br /> | ||
+ | The answer is illustrated in the image below: | ||
+ | <br /> | ||
+ | <center>[[Image:MoodleSubmission6.png|400px]]</center> | ||
+ | <br /> | ||
+ | The program '''outputs an extra blank line.''' Very likely it has an extra number ''System.out.println()'' statement somewhere Removing it will solve the problem and make the program pass, with a 100/100 grade. | ||
+ | <br /> | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | <br /> | ||
+ | <br /> | ||
+ | <br /> | ||
+ | <br /> | ||
+ | <br /> | ||
+ | <br /> | ||
+ | <br /> | ||
+ | <br /> | ||
+ | <br /> | ||
+ | <br /> | ||
+ | |||
+ | |||
+ | <br /><br /><br /><br /><br /><br /><br /><br /> | ||
<br /><br /><br /><br /> | <br /><br /><br /><br /> | ||
[[Category:CSC212]][[Category:Moodle]] | [[Category:CSC212]][[Category:Moodle]] |
Latest revision as of 20:29, 10 September 2014
--D. Thiebaut (talk) 12:02, 9 September 2014 (EDT)
- Login to Moodle and pick the CSC212 link
- Locate the Lab 2 activity in Week 2, Click on it.
- Note the information about the submission, and in particular the deadline (usually a week after you start on it).
- Click on the Edit Tab and copy/paste or type in your Java solution for the Lab. Make sure the name of the class is the same as the name of the file containing it. So, for this example, the class name is Lab2 (with an uppercase L), and the file name is Lab2.java.
- Click on Save to save your program in Moodle
- Click on Run to verify that your program runs correctly. A console window will open and show the program output.
- If you have errors, correct them and repeat the previous 2 steps
- Once you are satisfied your program runs correctly, close the console window and click on Evaluate:
- If everything ran smoothly, your program output matches that of the solution program, and you get a 100/100 grade, and a message indicating that your program passed 1 test out of 1. (In the future, your program may get tested with several different inputs).
- If your program output is not correct, then the Virtual Programming Lab module of Moodle will give you some indications:
- The grade is 0/100
- The correct output is shown
- The output of your program is shown (and we can see the problem: a dash instead of a space)
- A message indicating that your program failed 1 test out of 1.
- Normally, there won't be a limit on the number of submissions, so feel free to go back to the program, edit it, and re-evaluate it. If nothing works, you may want to go back to beowulf2 and work there.
Be Careful of Extra Space Characters!
Look at the evaluation results below. It is for a program written in assembly language, not Java, but you could get the exact same problem in Java:
It seems that the output of the program matches the expected output, but for some reason, Moodle rejects the program... Why?
Take a closer look at the image to see if you see the problem...
The answer is illustrated in the image below:
The program outputs an extra blank line. Very likely it has an extra number System.out.println() statement somewhere Removing it will solve the problem and make the program pass, with a 100/100 grade.