Skip to content

Conversation

@23f3001526
Copy link

📌 What does this PR do?

Implements negative marking in the quiz score calculation.
Users are now awarded:

  • +1 for each correct answer
  • -0.25 for each incorrect answer
  • 0 for unanswered questions

🔗 Related Issue

Fixes #39 : Allow negative marking for wrong answers

🔧 Type of Change

  • Bug fix (non-breaking change)
  • New feature
  • Breaking change
  • Documentation update

✅ How Has This Been Tested?

  • Tested locally by running the HTML file using Live Server in VSCode
  • Selected combinations of correct, incorrect, and unanswered questions to verify logic
  • Example test: 2 correct, 1 wrong, 7 unanswered = Total score: 1.75 (working as expected)

Environment:

  • OS: Windows 10
  • Browser: Chrome 116
  • Node: Not applicable (pure frontend change)

📸 Screenshots (if UI changed): showing a score of 1.75/10 for two correct answers and one wrong answer and rest unanswered out of 10 questions

image image

📊 Impact / Performance

  • No new dependencies introduced
  • Minimal impact, as logic change is confined to a single JavaScript function (script.js)

✅ Checklist

  • I have followed the code style guidelines.
  • I have self-reviewed my code.
  • I have commented on complex parts of the code.
  • I have updated or added documentation where necessary.
  • All tests pass locally.
  • No new warnings have been introduced.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow negative marking in quiz scoring

2 participants