Each of the five students - Andy, Danny, Ellen, Janice and Sammy received different marks in a mathematics quiz which was held last week. Students who made correct statements had obtained higher scores than those who made incorrect statements.

The following are the statements made by the five students:

*Sammy*: Andy and Ellen gained the top two places.

*Janice*: No, what Sammy just said is incorrect.

*Danny*: I was ranked in between Sammy and Janice.

*Andy*: Janice came second.

*Janice*: I had obtained a lower score than Ellen.

*Ellen*: Exactly three of the previous five statements are correct.

Determine the order in which the five students finished.

Well, Janice contradicts Sammy, so one of them made a true statement.

So who was in first place?

Whoever it was made a true statement.

It cannot be Sammy or Janice or Danny, since they each ruled themselves out as first.

So it must by Andy or Ellen who was first.

If Andy is first, then based on his statement Janice is second.

But Janice claims that Ellen scored higher than her, so Andy is not first.

Therefore Ellen is 1st.

So who was in 2nd place?

Based on Ellen's statement, we are sure that the second and third place students both made correct statements.

By his own statement, therefore, Andy is not second.

Which means that Sammy's statement is false, so Sammy is not 2nd either.

And Danny cannot be 2nd, by his statement.

So Janice must be 2nd.

So who is in 3rd?

Janice's statements are both individually true. (She might have made one true and one false, but this is not the case.)

Which means that the top three all made correct statements, and the bottom two made incorrect statements.

Andy's statement is true, so Andy is 3rd.

So who is in 4th place?

3rd and 4th both made incorrect statements, so Danny cannot be 4th, since that would make his statement true.

So Sammy is 4th and Danny 5th.

Recapping, there is only one solution:

1st Ellen (Correct)

2nd Janice (Correct, Correct)

3rd Andy (Correct)

4th Sammy (Incorrect)

5th Danny (Incorrect)