Skip to content
This repository has been archived by the owner on Aug 18, 2020. It is now read-only.

Commit

Permalink
Color Partial Credit
Browse files Browse the repository at this point in the history
  • Loading branch information
sshh12 committed May 17, 2019
1 parent 980f0e5 commit cd782bc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/test_targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,12 @@ def _test_targets(actual_targets, expected_targets):


def _correct_color(target_a, target_b):
return (target_a.background_color == target_b.background_color and
target_a.alphanumeric_color == target_b.alphanumeric_color)
score = 0
if target_a.background_color == target_b.background_color:
score += 0.5
if target_a.alphanumeric_color == target_b.alphanumeric_color:
score += 0.5
return score


def _correct_shape(target_a, target_b):
Expand Down

0 comments on commit cd782bc

Please sign in to comment.