How would you guys rate a programming exam? (Java)

ndee

Lifer
Jul 18, 2000
12,680
1
0
I'm wondering: How would you guys rate a programming exam? The teachers gives you 5 problems, and you solve all of them(displaying the right result), does it matter HOW you got there?
 

nakedfrog

No Lifer
Apr 3, 2001
62,897
19,126
136
I think it matters to an extent. For example, if you're using really sloppy workarounds that are prone to causing problems when you could use built-in functionality, that would reflect poorly on the grade. I don't think you're supposed to just be learning the language, you're learning to use it efficiently.
But that's just my two cents.
 

JayHu

Senior member
Mar 19, 2001
412
0
0
it depends on what the course's goal is.
If you're taking a course where there are ideas taught but you don't utilize them (like OO design for example) then you will not get full marks, regardless of whether you are correct or not.
 

Drakkon

Diamond Member
Aug 14, 2001
8,401
1
0
^agree with above

I took OOP principals in AP Data Structs in high school and when i came to college i tried to use a stack on my first test (as apposed to an array) and i was marked down for that. You usually have to use whatever the teacher is using in that chapter.
 

MartyMcFly3

Lifer
Jan 18, 2003
11,436
29
91
www.youtube.com
I think if the programs the student writes out work and do what was asked, they should get full credit. The professor should write something like "This does work, but itd be much more efficient if you did it this way"

After all they did answer the question. Now if the professor said "Using arrays, blah blah blah" in the question, and the student didnt, then Id mark it wrong. It all depends on what was asked.
 

Gibson486

Lifer
Aug 9, 2000
18,378
2
0
well, if you get there, you get there. If you did java w/o OOP, then yeah, i would mark it wrong.
 

Jzero

Lifer
Oct 10, 1999
18,834
1
0
Originally posted by: ndee
I'm wondering: How would you guys rate a programming exam? The teachers gives you 5 problems, and you solve all of them(displaying the right result), does it matter HOW you got there?

IMO the key to programming lies not in producing the correct output, but in getting there as efficiently as possible. I think you should get 75% for getting the correct output, but the other 25% should come from using good logic and technique to arrive at the output.
 
Nov 7, 2000
16,403
3
81
depends on the class

if its an alogrithm class and you write something O(2^n) when it could be written better, you should not get full credit
 

TuxDave

Lifer
Oct 8, 2002
10,571
3
71
I wouldn't give full marks if they did an idiotic way of getting the same results. Kinda like if someone was asked to populate a matrix with some numbers and instead of doing a for loop you manually request and insert each number line by line... then no full points.
 

MartyMcFly3

Lifer
Jan 18, 2003
11,436
29
91
www.youtube.com
Originally posted by: Jzero
Originally posted by: ndee
I'm wondering: How would you guys rate a programming exam? The teachers gives you 5 problems, and you solve all of them(displaying the right result), does it matter HOW you got there?

IMO the key to programming lies not in producing the correct output, but in getting there as efficiently as possible. I think you should get 75% for getting the correct output, but the other 25% should come from using good logic and technique to arrive at the output.

Again I believe that it depends how the question is asked.

Think of it like a math problem. Say you are given 2 numbers and told to divide them and write the answer on the paper. You could punch it in your calculator (much more efficient) and just write the answer. Or you could do it by hand and fill the page up with work. It's more time consuming but you still get the right answer.
 

ndee

Lifer
Jul 18, 2000
12,680
1
0
Originally posted by: MartyMcFly3
I think if the programs the student writes out work and do what was asked, they should get full credit. The professor should write something like "This does work, but itd be much more efficient if you did it this way"

After all they did answer the question. Now if the professor said "Using arrays, blah blah blah" in the question, and the student didnt, then Id mark it wrong. It all depends on what was asked.

That was also my point. Simplified, we had to draw a ruler in Java. We had to use loops and I used for-loops.

It would look like this:
http://www.gb.nrao.edu/~rmaddale/Education/Wvsta'98/Ruler.jpg (just copy the whole line, FS breaks it up)
I made 3 different for-loops, the first one drew the longest lines, then all the little ones and then all numbers. Well the teacher just used one for loop and made the Long lines, the little lines and then the numbers(in one loop). I got 66% of the points for that code. He corrected the test like this: Used his solution and about each line of his gave a point, if you didn't have the same line, you didn't get the point.
 

Jzero

Lifer
Oct 10, 1999
18,834
1
0
Originally posted by: MartyMcFly3
Think of it like a math problem. Say you are given 2 numbers and told to divide them and write the answer on the paper. You could punch it in your calculator (much more efficient) and just write the answer. Or you could do it by hand and fill the page up with work. It's more time consuming but you still get the right answer.

Except in this case the calculator does the exact same thing.
But if you are asked to write a simple program that divides two numbers and outputs the quotient you could do some think like:
input p;
input q;
result = p/q;
return result;

Or you could do something like:
input p; //divisor
input q; //dividend
i = 1
z = first i digits of q;
while p < z {increment i;}
q1 = z/p;
z = z - (p * q1)
if any digits left, append i+1 digit of q to z
...and so on

Who should get full credit?
 

Jzero

Lifer
Oct 10, 1999
18,834
1
0
Originally posted by: ndee
I got 66% of the points for that code. He corrected the test like this: Used his solution and about each line of his gave a point, if you didn't have the same line, you didn't get the point.

Well, I agree that that is crappy. You should get more than 66% and the grade should not be based on a line-by-line comparison with some "master" code.
 

cronos

Diamond Member
Nov 7, 2001
9,380
26
101
Originally posted by: ndee
Originally posted by: MartyMcFly3
I think if the programs the student writes out work and do what was asked, they should get full credit. The professor should write something like "This does work, but itd be much more efficient if you did it this way"

After all they did answer the question. Now if the professor said "Using arrays, blah blah blah" in the question, and the student didnt, then Id mark it wrong. It all depends on what was asked.

That was also my point. Simplified, we had to draw a ruler in Java. We had to use loops and I used for-loops.

It would look like this:
http://www.gb.nrao.edu/~rmaddale/Education/Wvsta'98/Ruler.jpg (just copy the whole line, FS breaks it up)
I made 3 different for-loops, the first one drew the longest lines, then all the little ones and then all numbers. Well the teacher just used one for loop and made the Long lines, the little lines and then the numbers. I got 66% of the points for that code. He corrected the test like this: Used his solution and about each line of his gave a point, if you didn't have the same line, you didn't get the point.

i can see how you get points off because you should be able to do it more efficiently. but i think that is a stupid way to grade code.
 

ndee

Lifer
Jul 18, 2000
12,680
1
0
Originally posted by: saxguy
Originally posted by: ndee
Originally posted by: MartyMcFly3
I think if the programs the student writes out work and do what was asked, they should get full credit. The professor should write something like "This does work, but itd be much more efficient if you did it this way"

After all they did answer the question. Now if the professor said "Using arrays, blah blah blah" in the question, and the student didnt, then Id mark it wrong. It all depends on what was asked.

That was also my point. Simplified, we had to draw a ruler in Java. We had to use loops and I used for-loops.

It would look like this:
http://www.gb.nrao.edu/~rmaddale/Education/Wvsta'98/Ruler.jpg (just copy the whole line, FS breaks it up)
I made 3 different for-loops, the first one drew the longest lines, then all the little ones and then all numbers. Well the teacher just used one for loop and made the Long lines, the little lines and then the numbers. I got 66% of the points for that code. He corrected the test like this: Used his solution and about each line of his gave a point, if you didn't have the same line, you didn't get the point.

i can see how you get points off because you should be able to do it more efficiently. but i think that is a stupid way to grade code.

And there was also a discussion from a student because he used while-loops instead of for-loops.
 

MartyMcFly3

Lifer
Jan 18, 2003
11,436
29
91
www.youtube.com
Originally posted by: Jzero
Originally posted by: MartyMcFly3
Think of it like a math problem. Say you are given 2 numbers and told to divide them and write the answer on the paper. You could punch it in your calculator (much more efficient) and just write the answer. Or you could do it by hand and fill the page up with work. It's more time consuming but you still get the right answer.

Except in this case the calculator does the exact same thing.
But if you are asked to write a simple program that divides two numbers and outputs the quotient you could do some think like:
input p;
input q;
result = p/q;
return result;

Or you could do something like:
input p; //divisor
input q; //dividend
i = 1
z = first i digits of q;
while p < z {increment i;}
q1 = z/p;
z = z - (p * q1)
if any digits left, append i+1 digit of q to z
...and so on

Who should get full credit?

Technically both. However since you said "simple" I would imagine the first one would be the correct one. I dunno, I guess im just a little more lenient because I know how difficult Java can be for people (including myself). I just think if it produces the correct results, and the person did all that was asked of them, it should be correct.

In ndee's case, I dont think he should be penalized at all, and I agree with you that using a "master code" to compare it to is a real sh!tty thing to do. No one programs exactly the same as everyone else.
 

ndee

Lifer
Jul 18, 2000
12,680
1
0
Originally posted by: MartyMcFly3
Originally posted by: Jzero
Originally posted by: MartyMcFly3
Think of it like a math problem. Say you are given 2 numbers and told to divide them and write the answer on the paper. You could punch it in your calculator (much more efficient) and just write the answer. Or you could do it by hand and fill the page up with work. It's more time consuming but you still get the right answer.

Except in this case the calculator does the exact same thing.
But if you are asked to write a simple program that divides two numbers and outputs the quotient you could do some think like:
input p;
input q;
result = p/q;
return result;

Or you could do something like:
input p; //divisor
input q; //dividend
i = 1
z = first i digits of q;
while p < z {increment i;}
q1 = z/p;
z = z - (p * q1)
if any digits left, append i+1 digit of q to z
...and so on

Who should get full credit?

Technically both. However since you said "simple" I would imagine the first one would be the correct one. I dunno, I guess im just a little more lenient because I know how difficult Java can be for people (including myself). I just think if it produces the correct results, and the person did all that was asked of them, it should be correct.

In ndee's case, I dont think he should be penalized at all, and I agree with you that using a "master code" to compare it to is a real sh!tty thing to do. No one programs exactly the same as everyone else.

of course, the variable names could've been different but nothing else. I just didn't get that. What if someone wrote the exact Master code but also 1000 lines of trash in between?
 

cronos

Diamond Member
Nov 7, 2001
9,380
26
101
Originally posted by: ndee
Originally posted by: saxguy
i can see how you get points off because you should be able to do it more efficiently. but i think that is a stupid way to grade code.

And there was also a discussion from a student because he used while-loops instead of for-loops.

that's exactly why it's stupid. programming is an 'art' to some extent, and with creativity you can find numerous solutions for a single problem. it is ridiculous to grade a code line by line comparing it to a 'solution' code.

but then again, as a teacher, if he mentioned before the test that it will be graded that way and all of the students are aware of it, then he didn't do anything essentially 'wrong'.
 

nakedfrog

No Lifer
Apr 3, 2001
62,897
19,126
136
I definitely don't think line-by-line is a good way to grade in programming. I suppose he's just wanting some concrete grading method rather than abstract, but that seems silly.
 

Reel

Diamond Member
Jul 14, 2001
4,484
0
76
Run his and yours with a timer that times the whole running of each. I'd estimate both solutions are similar though his may actually be slower depending on how each of you did the checks. If yours is faster, prove it to him and tell him that you did a better solution. Alternately, count the number of compares in yours and his and prove that yours is lower (if it is).