Bug Description
In ai_foundations/feedback/course_5/lora/check_loralab_answer.py, the feedback messages for correct and incorrect answers are swapped.
What happens
- Lines 55-64 (
elif branch): The condition checks whether the student's answer is within tolerance of a correct value (answer_without_bias or answer_with_bias), but prints the failure message: "Your answer is not correct."
- Lines 65-72 (
else branch): This catches all answers that do not match any correct value, but prints the success message: "Nice! Your answer looks correct."
As a result, every correct answer is rejected, and every wrong answer is praised.
Steps to reproduce
from ai_foundations.feedback.course_5.lora.check_loralab_answer import check_loralab_answer
# Correct answer (should print success, but prints failure)
check_loralab_answer(2 * 8 / 512)
# Wrong answer (should print failure, but prints success)
check_loralab_answer(0.999)
Suggested fix
Swap the print blocks between the elif and else branches so that the correct-answer branch prints the success message and the wrong-answer branch prints the failure message.
Bug Description
In
ai_foundations/feedback/course_5/lora/check_loralab_answer.py, the feedback messages for correct and incorrect answers are swapped.What happens
elifbranch): The condition checks whether the student's answer is within tolerance of a correct value (answer_without_biasoranswer_with_bias), but prints the failure message: "Your answer is not correct."elsebranch): This catches all answers that do not match any correct value, but prints the success message: "Nice! Your answer looks correct."As a result, every correct answer is rejected, and every wrong answer is praised.
Steps to reproduce
Suggested fix
Swap the print blocks between the
elifandelsebranches so that the correct-answer branch prints the success message and the wrong-answer branch prints the failure message.