Skip to content

Bug: Swapped correct/incorrect feedback in check_loralab_answer.py #15

Description

@Yassir-249

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions