Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/context/physical_quantity.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ def less_than_node(criterion, parameters, label=None):

def less_than_or_equal_node(criterion, parameters, label=None):
# TODO: Add nodes for the equal case
graph = comparison_base_graph(criterion, parameters, comparison_operator=">=", label=label)
graph = comparison_base_graph(criterion, parameters, comparison_operator="<=", label=label)
return graph


Expand Down
27 changes: 27 additions & 0 deletions app/tests/physical_quantity_evaluation_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,33 @@ def test_quantity_with_multiple_of_positive_value(self):
result = evaluation_function(res, ans, params, include_test_data=True)
assert result["is_correct"] is True

@pytest.mark.parametrize(
"response, answer, order_operator, value",
[
("10 Hz", "5 Hz", ">", True),
("5 Hz", "10 Hz", ">", False),
("10 Hz", "10 Hz", ">", False),
("10 Hz", "5 Hz", "<", False),
("5 Hz", "10 Hz", "<", True),
("10 Hz", "10 Hz", "<", False),
("10 Hz", "5 Hz", ">=", True),
("5 Hz", "10 Hz", ">=", False),
("10 Hz", "10 Hz", ">=", True),
("10 Hz", "5 Hz", "<=", False),
("5 Hz", "10 Hz", "<=", True),
("10 Hz", "10 Hz", "<=", True),
]
)
def test_order_operators(self, response, answer, order_operator, value):
params = {
"strict_syntax": False,
"physical_quantity": True,
"elementary functions": True,
"criteria": "response "+order_operator+" answer"
}
result = evaluation_function(response, answer, params, include_test_data=True)
assert result["is_correct"] is value

def test_radians_to_frequency(self):
ans = "2*pi*f radian/second"
res = "f Hz"
Expand Down
Loading