MDL-31226: quiz: Display the correct message for attempts built on previou.

At the moment, when attempt is built on the last one, "not yet answered"
message is shown, which confuses many people. This patch modifies the state to
"complete" for attempt based on previous and modifies the output string.
Proposed code.