diff --git a/app/docs/criteria_graphs/physical_quantity_matches.svg b/app/docs/criteria_graphs/physical_quantity_matches.svg index 1cd8bd2..ddce35f 100644 --- a/app/docs/criteria_graphs/physical_quantity_matches.svg +++ b/app/docs/criteria_graphs/physical_quantity_matches.svg @@ -1,278 +1,278 @@ - - + G - + evaluation_0 - -response matches answer -Converts QUANTITY: response tags: {} and -QUANTITY: answer tags: {} match to a common -set of base units and compares their values. + +response matches answer +Converts QUANTITY: response tags: {} and +QUANTITY: answer tags: {} match to a common +set of base units and compares their values. criterion_0 - -response matches answer_TRUE -The quantities QUANTITY: response tags: {} -and QUANTITY: answer tags: {} match. + +response matches answer_TRUE +The quantities QUANTITY: response tags: {} +and QUANTITY: answer tags: {} match. evaluation_0->criterion_0 - - + + criterion_1 - -response matches answer_FALSE -The quantities QUANTITY: response tags: {} -and QUANTITY: answer tags: {} does not match. + +response matches answer_FALSE +The quantities QUANTITY: response tags: {} +and QUANTITY: answer tags: {} does not match. evaluation_0->criterion_1 - - + + criterion_2 - -response matches answer_MISSING_VALUE -The response is missing a value. + +response matches answer_MISSING_VALUE +The response is missing a value. evaluation_0->criterion_2 - - + + criterion_3 - -response matches answer_UNEXPECTED_VALUE -The response is expected only have unit(s), -no value. + +response matches answer_UNEXPECTED_VALUE +The response is expected only have unit(s), +no value. evaluation_0->criterion_3 - - + + criterion_4 - -response matches answer_MISSING_UNIT -The response is missing unit(s). + +response matches answer_MISSING_UNIT +The response is missing unit(s). evaluation_0->criterion_4 - - + + criterion_5 - -response matches answer_UNEXPECTED_UNIT -The response is expected to be a value -without unit(s). + +response matches answer_UNEXPECTED_UNIT +The response is expected to be a value +without unit(s). evaluation_0->criterion_5 - - + + evaluation_1 - -response matches answer_DIMENSION_MATCH -Do the dimensions of QUANTITY: response tags: -{} and QUANTITY: answer tags: {} match? + +response matches answer_DIMENSION_MATCH +Do the dimensions of QUANTITY: response tags: +{} and QUANTITY: answer tags: {} match? criterion_6 - -response matches answer_DIMENSION_MATCH_TRUE -The quantities QUANTITY: response tags: {} -and QUANTITY: answer tags: {} have the same -dimensions. + +response matches answer_DIMENSION_MATCH_TRUE +The quantities QUANTITY: response tags: {} +and QUANTITY: answer tags: {} have the same +dimensions. evaluation_1->criterion_6 - - + + criterion_7 - -response matches answer_DIMENSION_MATCH_FALSE -The quantities QUANTITY: response tags: {} -and QUANTITY: answer tags: {} have different -dimensions. + +response matches answer_DIMENSION_MATCH_FALSE +The quantities QUANTITY: response tags: {} +and QUANTITY: answer tags: {} have different +dimensions. evaluation_1->criterion_7 - - + + evaluation_2 - -response matches answer_UNIT_COMPARISON -Compares how similar the units of QUANTITY: -response tags: {} and QUANTITY: answer tags: -{} are. + +response matches answer_UNIT_COMPARISON +Compares how similar the units of QUANTITY: +response tags: {} and QUANTITY: answer tags: +{} are. criterion_8 - -response matches answer_UNIT_COMPARISON_IDENTICAL -The units of quantities QUANTITY: response -tags: {} and QUANTITY: answer tags: {} are -identical. + +response matches answer_UNIT_COMPARISON_IDENTICAL +The units of quantities QUANTITY: response +tags: {} and QUANTITY: answer tags: {} are +identical. evaluation_2->criterion_8 - - + + criterion_9 - -response matches answer_UNIT_COMPARISON_SIMILAR -The units of quantities QUANTITY: response -tags: {} and QUANTITY: answer tags: {} are -similar. + +response matches answer_UNIT_COMPARISON_SIMILAR +The units of quantities QUANTITY: response +tags: {} and QUANTITY: answer tags: {} are +similar. evaluation_2->criterion_9 - - + + criterion_10 - -response matches answer_UNIT_COMPARISON_PREFIX_IS_LARGE -The units of QUANTITY: response tags: {} are -at least 1000 times greater than the units of -QUANTITY: answer tags: {}. + +response matches answer_UNIT_COMPARISON_PREFIX_IS_LARGE +The units of QUANTITY: response tags: {} are +at least 1000 times greater than the units of +QUANTITY: answer tags: {}. evaluation_2->criterion_10 - - + + criterion_11 - -response matches answer_UNIT_COMPARISON_PREFIX_IS_SMALL -The units of QUANTITY: response tags: {} are -at least 1000 times smaller than the units of -QUANTITY: answer tags: {}. + +response matches answer_UNIT_COMPARISON_PREFIX_IS_SMALL +The units of QUANTITY: response tags: {} are +at least 1000 times smaller than the units of +QUANTITY: answer tags: {}. evaluation_2->criterion_11 - - + + criterion_0->evaluation_2 - - + + criterion_1->evaluation_1 - - + + output_0 - -END -Evaluation completed. + +END +Evaluation completed. criterion_2->output_0 - - + + criterion_3->output_0 - - + + criterion_4->output_0 - - + + criterion_5->output_0 - - + + criterion_6->output_0 - - + + criterion_7->output_0 - - + + criterion_10->output_0 - - + + criterion_11->output_0 - - + + diff --git a/app/docs/criteria_graphs/physical_quantity_matches_mermaid.svg b/app/docs/criteria_graphs/physical_quantity_matches_mermaid.svg index 98d6775..1e9050a 100644 --- a/app/docs/criteria_graphs/physical_quantity_matches_mermaid.svg +++ b/app/docs/criteria_graphs/physical_quantity_matches_mermaid.svg @@ -1 +1 @@ -

response matches answer
---
Converts QUANTITY: response tags: {} and QUANTITY: answer tags: {} match to a common set of base units and compares their values.

response matches answer_DIMENSION_MATCH
---
Do the dimensions of QUANTITY: response tags: {} and QUANTITY: answer tags: {} match?

response matches answer_UNIT_COMPARISON
---
Compares how similar the units of QUANTITY: response tags: {} and QUANTITY: answer tags: {} are.

response matches answer_TRUE
---
The quantities QUANTITY: response tags: {} and QUANTITY: answer tags: {} match.

response matches answer_FALSE
---
The quantities QUANTITY: response tags: {} and QUANTITY: answer tags: {} does not match.

response matches answer_MISSING_VALUE
---
The response is missing a value.

response matches answer_UNEXPECTED_VALUE
---
The response is expected only have unit(s), no value.

response matches answer_MISSING_UNIT
---
The response is missing unit(s).

response matches answer_UNEXPECTED_UNIT
---
The response is expected to be a value without unit(s).

response matches answer_DIMENSION_MATCH_TRUE
---
The quantities QUANTITY: response tags: {} and QUANTITY: answer tags: {} have the same dimensions.

response matches answer_DIMENSION_MATCH_FALSE
---
The quantities QUANTITY: response tags: {} and QUANTITY: answer tags: {} have different dimensions.

response matches answer_UNIT_COMPARISON_IDENTICAL
---
The units of quantities QUANTITY: response tags: {} and QUANTITY: answer tags: {} are identical.

response matches answer_UNIT_COMPARISON_SIMILAR
---
The units of quantities QUANTITY: response tags: {} and QUANTITY: answer tags: {} are similar.

response matches answer_UNIT_COMPARISON_PREFIX_IS_LARGE
---
The units of QUANTITY: response tags: {} are at least 1000 times greater than the units of QUANTITY: answer tags: {}.

response matches answer_UNIT_COMPARISON_PREFIX_IS_SMALL
---
The units of QUANTITY: response tags: {} are at least 1000 times smaller than the units of QUANTITY: answer tags: {}.

END
---
Evaluation completed.

+

response matches answer
---
Converts QUANTITY: response tags: {} and QUANTITY: answer tags: {} match to a common set of base units and compares their values.

response matches answer_DIMENSION_MATCH
---
Do the dimensions of QUANTITY: response tags: {} and QUANTITY: answer tags: {} match?

response matches answer_UNIT_COMPARISON
---
Compares how similar the units of QUANTITY: response tags: {} and QUANTITY: answer tags: {} are.

response matches answer_TRUE
---
The quantities QUANTITY: response tags: {} and QUANTITY: answer tags: {} match.

response matches answer_FALSE
---
The quantities QUANTITY: response tags: {} and QUANTITY: answer tags: {} does not match.

response matches answer_MISSING_VALUE
---
The response is missing a value.

response matches answer_UNEXPECTED_VALUE
---
The response is expected only have unit(s), no value.

response matches answer_MISSING_UNIT
---
The response is missing unit(s).

response matches answer_UNEXPECTED_UNIT
---
The response is expected to be a value without unit(s).

response matches answer_DIMENSION_MATCH_TRUE
---
The quantities QUANTITY: response tags: {} and QUANTITY: answer tags: {} have the same dimensions.

response matches answer_DIMENSION_MATCH_FALSE
---
The quantities QUANTITY: response tags: {} and QUANTITY: answer tags: {} have different dimensions.

response matches answer_UNIT_COMPARISON_IDENTICAL
---
The units of quantities QUANTITY: response tags: {} and QUANTITY: answer tags: {} are identical.

response matches answer_UNIT_COMPARISON_SIMILAR
---
The units of quantities QUANTITY: response tags: {} and QUANTITY: answer tags: {} are similar.

response matches answer_UNIT_COMPARISON_PREFIX_IS_LARGE
---
The units of QUANTITY: response tags: {} are at least 1000 times greater than the units of QUANTITY: answer tags: {}.

response matches answer_UNIT_COMPARISON_PREFIX_IS_SMALL
---
The units of QUANTITY: response tags: {} are at least 1000 times smaller than the units of QUANTITY: answer tags: {}.

END
---
Evaluation completed.

\ No newline at end of file diff --git a/app/docs/criteria_graphs/physical_quantity_order.svg b/app/docs/criteria_graphs/physical_quantity_order.svg index 04488c6..c6e78b2 100644 --- a/app/docs/criteria_graphs/physical_quantity_order.svg +++ b/app/docs/criteria_graphs/physical_quantity_order.svg @@ -1,68 +1,68 @@ - - + G - + evaluation_0 - -response > answer -checks if QUANTITY: response tags: {} > -QUANTITY: answer tags: {}. + +response > answer +checks if QUANTITY: response tags: {} > +QUANTITY: answer tags: {}. criterion_0 - -response > answer_TRUE -QUANTITY: response tags: {} > QUANTITY: -answer tags: {} is true. + +response > answer_TRUE +QUANTITY: response tags: {} > QUANTITY: +answer tags: {} is true. evaluation_0->criterion_0 - - + + criterion_1 - -response > answer_FALSE -QUANTITY: response tags: {} > QUANTITY: -answer tags: {} is false. + +response > answer_FALSE +QUANTITY: response tags: {} > QUANTITY: +answer tags: {} is false. evaluation_0->criterion_1 - - + + output_0 - -END -Evaluation completed. + +END +Evaluation completed. criterion_0->output_0 - - + + criterion_1->output_0 - - + + diff --git a/app/docs/criteria_graphs/physical_quantity_order_mermaid.svg b/app/docs/criteria_graphs/physical_quantity_order_mermaid.svg index 5a60f36..3173a94 100644 --- a/app/docs/criteria_graphs/physical_quantity_order_mermaid.svg +++ b/app/docs/criteria_graphs/physical_quantity_order_mermaid.svg @@ -1 +1 @@ -

response > answer
---
checks if QUANTITY: response tags: {} > QUANTITY: answer tags: {}.

response > answer_TRUE
---
QUANTITY: response tags: {} > QUANTITY: answer tags: {} is true.

response > answer_FALSE
---
QUANTITY: response tags: {} > QUANTITY: answer tags: {} is false.

END
---
Evaluation completed.

+

response > answer
---
checks if QUANTITY: response tags: {} > QUANTITY: answer tags: {}.

response > answer_TRUE
---
QUANTITY: response tags: {} > QUANTITY: answer tags: {} is true.

response > answer_FALSE
---
QUANTITY: response tags: {} > QUANTITY: answer tags: {} is false.

END
---
Evaluation completed.

\ No newline at end of file diff --git a/app/docs/criteria_graphs/symbolic_equality.svg b/app/docs/criteria_graphs/symbolic_equality.svg index c9b0a51..ce9d8ff 100644 --- a/app/docs/criteria_graphs/symbolic_equality.svg +++ b/app/docs/criteria_graphs/symbolic_equality.svg @@ -1,133 +1,133 @@ - - + G - + evaluation_0 - -response = answer -Checks if response=answer. + +response = answer +Checks if response=answer. criterion_0 - -response = answer_TRUE -response is equal to answer. + +response = answer_TRUE +response is equal to answer. evaluation_0->criterion_0 - - + + criterion_3 - -response = answer_FALSE -response is not equal toanswer. + +response = answer_FALSE +response is not equal toanswer. evaluation_0->criterion_3 - - + + criterion_4 - -response = answer_UNKNOWN -Cannot detrmine if response is equal to -answer. + +response = answer_UNKNOWN +Cannot detrmine if response is equal to +answer. evaluation_0->criterion_4 - - + + evaluation_1 - -response = answer_SAME_SYMBOLS -response has the same (free) symbols as -answer. + +response = answer_SAME_SYMBOLS +response has the same (free) symbols as +answer. criterion_1 - -response = answer_SAME_SYMBOLS_TRUE -response has the same (free) symbols as -answer. + +response = answer_SAME_SYMBOLS_TRUE +response has the same (free) symbols as +answer. evaluation_1->criterion_1 - - + + criterion_2 - -response = answer_SAME_SYMBOLS_FALSE -response does note have the same (free) -symbols as answer. + +response = answer_SAME_SYMBOLS_FALSE +response does note have the same (free) +symbols as answer. evaluation_1->criterion_2 - - + + criterion_0->evaluation_1 - - + + output_0 - -END -Evaluation completed. + +END +Evaluation completed. criterion_1->output_0 - - + + criterion_2->output_0 - - + + criterion_3->output_0 - - + + criterion_4->output_0 - - + + diff --git a/app/docs/criteria_graphs/symbolic_equality_mermaid.svg b/app/docs/criteria_graphs/symbolic_equality_mermaid.svg index 3abefe8..2a426d6 100644 --- a/app/docs/criteria_graphs/symbolic_equality_mermaid.svg +++ b/app/docs/criteria_graphs/symbolic_equality_mermaid.svg @@ -1 +1 @@ -

response = answer
---
Checks if response=answer.

response = answer_SAME_SYMBOLS
---
response has the same (free) symbols as answer.

response = answer_TRUE
---
response is equal to answer.

response = answer_SAME_SYMBOLS_TRUE
---
response has the same (free) symbols as answer.

response = answer_SAME_SYMBOLS_FALSE
---
response does note have the same (free) symbols as answer.

response = answer_FALSE
---
response is not equal toanswer.

response = answer_UNKNOWN
---
Cannot detrmine if response is equal to answer.

END
---
Evaluation completed.

+

response = answer
---
Checks if response=answer.

response = answer_SAME_SYMBOLS
---
response has the same (free) symbols as answer.

response = answer_TRUE
---
response is equal to answer.

response = answer_SAME_SYMBOLS_TRUE
---
response has the same (free) symbols as answer.

response = answer_SAME_SYMBOLS_FALSE
---
response does note have the same (free) symbols as answer.

response = answer_FALSE
---
response is not equal toanswer.

response = answer_UNKNOWN
---
Cannot detrmine if response is equal to answer.

END
---
Evaluation completed.

\ No newline at end of file diff --git a/app/docs/criteria_graphs/symbolic_equality_of_equations.svg b/app/docs/criteria_graphs/symbolic_equality_of_equations.svg index 46453a0..c3b5d67 100644 --- a/app/docs/criteria_graphs/symbolic_equality_of_equations.svg +++ b/app/docs/criteria_graphs/symbolic_equality_of_equations.svg @@ -1,123 +1,123 @@ - - + G - + evaluation_0 - -response = answer -Checks if response is equivalent to answer. + +response = answer +Checks if response is equivalent to answer. criterion_0 - -response = answer_UNKNOWN -Cannot determine if response is equivalent to -answer. + +response = answer_UNKNOWN +Cannot determine if response is equivalent to +answer. evaluation_0->criterion_0 - - + + criterion_1 - -response = answer_TRUE -response is equivalent to answer. + +response = answer_TRUE +response is equivalent to answer. evaluation_0->criterion_1 - - + + criterion_2 - -response = answer_FALSE -response is not equivalent to answer. + +response = answer_FALSE +response is not equivalent to answer. evaluation_0->criterion_2 - - + + criterion_3 - -response = answer_EXPRESSION_NOT_EQUALITY -response is an expression, not an equality. + +response = answer_EXPRESSION_NOT_EQUALITY +response is an expression, not an equality. evaluation_0->criterion_3 - - + + criterion_4 - -response = answer_EQUALITY_NOT_EXPRESSION -response is an equality, not an expression. + +response = answer_EQUALITY_NOT_EXPRESSION +response is an equality, not an expression. evaluation_0->criterion_4 - - + + output_0 - -END -Evaluation completed. + +END +Evaluation completed. criterion_0->output_0 - - + + criterion_1->output_0 - - + + criterion_2->output_0 - - + + criterion_3->output_0 - - + + criterion_4->output_0 - - + + diff --git a/app/docs/criteria_graphs/symbolic_equality_of_equations_mermaid.svg b/app/docs/criteria_graphs/symbolic_equality_of_equations_mermaid.svg index 0b9acaa..c4dbea8 100644 --- a/app/docs/criteria_graphs/symbolic_equality_of_equations_mermaid.svg +++ b/app/docs/criteria_graphs/symbolic_equality_of_equations_mermaid.svg @@ -1 +1 @@ -

response = answer
---
Checks if response is equivalent to answer.

response = answer_UNKNOWN
---
Cannot determine if response is equivalent to answer.

response = answer_TRUE
---
response is equivalent to answer.

response = answer_FALSE
---
response is not equivalent to answer.

response = answer_EXPRESSION_NOT_EQUALITY
---
response is an expression, not an equality.

response = answer_EQUALITY_NOT_EXPRESSION
---
response is an equality, not an expression.

END
---
Evaluation completed.

+

response = answer
---
Checks if response is equivalent to answer.

response = answer_UNKNOWN
---
Cannot determine if response is equivalent to answer.

response = answer_TRUE
---
response is equivalent to answer.

response = answer_FALSE
---
response is not equivalent to answer.

response = answer_EXPRESSION_NOT_EQUALITY
---
response is an expression, not an equality.

response = answer_EQUALITY_NOT_EXPRESSION
---
response is an equality, not an expression.

END
---
Evaluation completed.

\ No newline at end of file diff --git a/app/docs/criteria_graphs/symbolic_equality_of_sets.svg b/app/docs/criteria_graphs/symbolic_equality_of_sets.svg index c61d209..b439df2 100644 --- a/app/docs/criteria_graphs/symbolic_equality_of_sets.svg +++ b/app/docs/criteria_graphs/symbolic_equality_of_sets.svg @@ -1,99 +1,99 @@ - - + G - + evaluation_0 - -response = answer -Checks if response=answer. + +response = answer +Checks if response=answer. criterion_0 - -response = answer_TRUE -response is equal to answer. + +response = answer_TRUE +response is equal to answer. evaluation_0->criterion_0 - - + + criterion_1 - -response = answer_MULTIPLE_ANSWER_FAIL_ALL -At least one answer or response was -incorrect. + +response = answer_MULTIPLE_ANSWER_FAIL_ALL +At least one answer or response was +incorrect. evaluation_0->criterion_1 - - + + criterion_2 - -response = answer_MULTIPLE_ANSWER_FAIL_RESPONSE -At least one response was incorrect. + +response = answer_MULTIPLE_ANSWER_FAIL_RESPONSE +At least one response was incorrect. evaluation_0->criterion_2 - - + + criterion_3 - -response = answer_MULTIPLE_ANSWER_FAIL_ANSWER -At least one answer is missing in the -response. + +response = answer_MULTIPLE_ANSWER_FAIL_ANSWER +At least one answer is missing in the +response. evaluation_0->criterion_3 - - + + output_0 - -END -Evaluation completed. + +END +Evaluation completed. criterion_1->output_0 - - + + criterion_2->output_0 - - + + criterion_3->output_0 - - + + diff --git a/app/docs/criteria_graphs/symbolic_equality_of_sets_mermaid.svg b/app/docs/criteria_graphs/symbolic_equality_of_sets_mermaid.svg index a341538..3002290 100644 --- a/app/docs/criteria_graphs/symbolic_equality_of_sets_mermaid.svg +++ b/app/docs/criteria_graphs/symbolic_equality_of_sets_mermaid.svg @@ -1 +1 @@ -

response = answer
---
Checks if response=answer.

response = answer_TRUE
---
response is equal to answer.

response = answer_MULTIPLE_ANSWER_FAIL_ALL
---
At least one answer or response was incorrect.

response = answer_MULTIPLE_ANSWER_FAIL_RESPONSE
---
At least one response was incorrect.

response = answer_MULTIPLE_ANSWER_FAIL_ANSWER
---
At least one answer is missing in the response.

END
---
Evaluation completed.

+

response = answer
---
Checks if response=answer.

response = answer_TRUE
---
response is equal to answer.

response = answer_MULTIPLE_ANSWER_FAIL_ALL
---
At least one answer or response was incorrect.

response = answer_MULTIPLE_ANSWER_FAIL_RESPONSE
---
At least one response was incorrect.

response = answer_MULTIPLE_ANSWER_FAIL_ANSWER
---
At least one answer is missing in the response.

END
---
Evaluation completed.

\ No newline at end of file diff --git a/app/docs/criteria_graphs/symbolic_other.svg b/app/docs/criteria_graphs/symbolic_other.svg index d253e72..a2d23f2 100644 --- a/app/docs/criteria_graphs/symbolic_other.svg +++ b/app/docs/criteria_graphs/symbolic_other.svg @@ -1,84 +1,84 @@ - - + G - + evaluation_0 - -response contains x -Checks if response contains x is true. + +response contains x +Checks if response contains x is true. criterion_0 - -response contains x_TRUE -response contains x is true. + +response contains x_TRUE +response contains x is true. evaluation_0->criterion_0 - - + + criterion_1 - -response contains x_FALSE -response contains x is false. + +response contains x_FALSE +response contains x is false. evaluation_0->criterion_1 - - + + criterion_2 - -response contains x_UNKNOWN -response contains x is false. + +response contains x_UNKNOWN +response contains x is false. evaluation_0->criterion_2 - - + + output_0 - -END -Evaluation completed. + +END +Evaluation completed. criterion_0->output_0 - - + + criterion_1->output_0 - - + + criterion_2->output_0 - - + + diff --git a/app/docs/criteria_graphs/symbolic_other_mermaid.svg b/app/docs/criteria_graphs/symbolic_other_mermaid.svg index da291d2..09c5695 100644 --- a/app/docs/criteria_graphs/symbolic_other_mermaid.svg +++ b/app/docs/criteria_graphs/symbolic_other_mermaid.svg @@ -1 +1 @@ -

response contains x
---
Checks if response contains x is true.

response contains x_TRUE
---
response contains x is true.

response contains x_FALSE
---
response contains x is false.

response contains x_UNKNOWN
---
response contains x is false.

END
---
Evaluation completed.

+

response contains x
---
Checks if response contains x is true.

response contains x_TRUE
---
response contains x is true.

response contains x_FALSE
---
response contains x is false.

response contains x_UNKNOWN
---
response contains x is false.

END
---
Evaluation completed.

\ No newline at end of file diff --git a/app/docs/criteria_graphs/symbolic_where.svg b/app/docs/criteria_graphs/symbolic_where.svg index 89bd77a..291d925 100644 --- a/app/docs/criteria_graphs/symbolic_where.svg +++ b/app/docs/criteria_graphs/symbolic_where.svg @@ -1,59 +1,59 @@ - - + G - + evaluation_0 - -response = answer where x = 0 -Checks if response = answer where x = 0. + +response = answer where x = 0 +Checks if response = answer where x = 0. criterion_0 - -response = answer where x = 0_TRUE -response = answer where x = 0is true. + +response = answer where x = 0_TRUE +response = answer where x = 0is true. evaluation_0->criterion_0 - - + + criterion_1 - -response = answer where x = 0_FALSE -response = answer is not true when x = 0. + +response = answer where x = 0_FALSE +response = answer is not true when x = 0. evaluation_0->criterion_1 - - + + output_0 - -END -Evaluation completed. + +END +Evaluation completed. criterion_0->output_0 - - + + diff --git a/app/docs/criteria_graphs/symbolic_where_mermaid.svg b/app/docs/criteria_graphs/symbolic_where_mermaid.svg index 8b6d8ee..fae74e5 100644 --- a/app/docs/criteria_graphs/symbolic_where_mermaid.svg +++ b/app/docs/criteria_graphs/symbolic_where_mermaid.svg @@ -1 +1 @@ -

response = answer where x = 0
---
Checks if response = answer where x = 0.

response = answer where x = 0_TRUE
---
response = answer where x = 0is true.

response = answer where x = 0_FALSE
---
response = answer is not true when x = 0.

END
---
Evaluation completed.

+

response = answer where x = 0
---
Checks if response = answer where x = 0.

response = answer where x = 0_TRUE
---
response = answer where x = 0is true.

response = answer where x = 0_FALSE
---
response = answer is not true when x = 0.

END
---
Evaluation completed.

\ No newline at end of file diff --git a/app/docs/criteria_graphs/symbolic_written_as.svg b/app/docs/criteria_graphs/symbolic_written_as.svg index dca47d6..90a887f 100644 --- a/app/docs/criteria_graphs/symbolic_written_as.svg +++ b/app/docs/criteria_graphs/symbolic_written_as.svg @@ -1,221 +1,221 @@ - - + G - + evaluation_0 - -answer_WRITTEN_AS_KNOWN_FORM -Checks if answer is written in a known form. + +answer_WRITTEN_AS_KNOWN_FORM +Checks if answer is written in a known form. criterion_0 - -answer_WRITTEN_AS_UNKNOWN -answer is not written in a known form. + +answer_WRITTEN_AS_UNKNOWN +answer is not written in a known form. evaluation_0->criterion_0 - - + + criterion_3 - -answer_WRITTEN_AS_NUMBER -answer in written in simplified number form. + +answer_WRITTEN_AS_NUMBER +answer in written in simplified number form. evaluation_0->criterion_3 - - + + criterion_4 - -answer_WRITTEN_AS_CARTESIAN -answer in written in cartesian form. + +answer_WRITTEN_AS_CARTESIAN +answer in written in cartesian form. evaluation_0->criterion_4 - - + + criterion_5 - -answer_WRITTEN_AS_EXPONENTIAL -answer in written in exponential form. + +answer_WRITTEN_AS_EXPONENTIAL +answer in written in exponential form. evaluation_0->criterion_5 - - + + evaluation_1 - -response written as answer -Checks if response is written in the same -form as answer. + +response written as answer +Checks if response is written in the same +form as answer. evaluation_1->criterion_0 - - + + criterion_1 - -response written as answer_TRUE -answer written in the same form as answer. + +response written as answer_TRUE +answer written in the same form as answer. evaluation_1->criterion_1 - - + + criterion_2 - -response written as answer_FALSE -answer written in the same form as answer. + +response written as answer_FALSE +answer written in the same form as answer. evaluation_1->criterion_2 - - + + evaluation_2 - -response_COMPARE_FORM_TO_NUMBER -Checks if response is written in simplified -number form. + +response_COMPARE_FORM_TO_NUMBER +Checks if response is written in simplified +number form. evaluation_2->criterion_1 - - + + evaluation_2->criterion_2 - - + + evaluation_2->criterion_3 - - + + evaluation_3 - -response_COMPARE_FORM_TO_CARTESIAN -Checks if response is written in cartesian -form. + +response_COMPARE_FORM_TO_CARTESIAN +Checks if response is written in cartesian +form. evaluation_3->criterion_1 - - + + evaluation_3->criterion_2 - - + + evaluation_3->criterion_4 - - + + evaluation_4 - -response_COMPARE_FORM_TO_EXPONENTIAL -Checks if response is written in exponential -form. + +response_COMPARE_FORM_TO_EXPONENTIAL +Checks if response is written in exponential +form. evaluation_4->criterion_1 - - + + evaluation_4->criterion_2 - - + + evaluation_4->criterion_5 - - + + criterion_0->evaluation_1 - - + + criterion_3->evaluation_2 - - + + criterion_4->evaluation_3 - - + + criterion_5->evaluation_4 - - + + output_0 - -END -Evaluation completed. + +END +Evaluation completed. diff --git a/app/docs/criteria_graphs/symbolic_written_as_mermaid.svg b/app/docs/criteria_graphs/symbolic_written_as_mermaid.svg index f869019..ac45124 100644 --- a/app/docs/criteria_graphs/symbolic_written_as_mermaid.svg +++ b/app/docs/criteria_graphs/symbolic_written_as_mermaid.svg @@ -1 +1 @@ -

answer_WRITTEN_AS_KNOWN_FORM
---
Checks if answer is written in a known form.

response written as answer
---
Checks if response is written in the same form as answer.

response_COMPARE_FORM_TO_NUMBER
---
Checks if response is written in simplified number form.

response_COMPARE_FORM_TO_CARTESIAN
---
Checks if response is written in cartesian form.

response_COMPARE_FORM_TO_EXPONENTIAL
---
Checks if response is written in exponential form.

answer_WRITTEN_AS_UNKNOWN
---
answer is not written in a known form.

response written as answer_TRUE
---
answer written in the same form as answer.

response written as answer_FALSE
---
answer written in the same form as answer.

answer_WRITTEN_AS_NUMBER
---
answer in written in simplified number form.

answer_WRITTEN_AS_CARTESIAN
---
answer in written in cartesian form.

answer_WRITTEN_AS_EXPONENTIAL
---
answer in written in exponential form.

END
---
Evaluation completed.

+

answer_WRITTEN_AS_KNOWN_FORM
---
Checks if answer is written in a known form.

response written as answer
---
Checks if response is written in the same form as answer.

response_COMPARE_FORM_TO_NUMBER
---
Checks if response is written in simplified number form.

response_COMPARE_FORM_TO_CARTESIAN
---
Checks if response is written in cartesian form.

response_COMPARE_FORM_TO_EXPONENTIAL
---
Checks if response is written in exponential form.

answer_WRITTEN_AS_UNKNOWN
---
answer is not written in a known form.

response written as answer_TRUE
---
answer written in the same form as answer.

response written as answer_FALSE
---
answer written in the same form as answer.

answer_WRITTEN_AS_NUMBER
---
answer in written in simplified number form.

answer_WRITTEN_AS_CARTESIAN
---
answer in written in cartesian form.

answer_WRITTEN_AS_EXPONENTIAL
---
answer in written in exponential form.

END
---
Evaluation completed.

\ No newline at end of file diff --git a/app/docs/process_graphs/process_physical_quantity.svg b/app/docs/process_graphs/process_physical_quantity.svg index 9342799..d9e9dff 100644 --- a/app/docs/process_graphs/process_physical_quantity.svg +++ b/app/docs/process_graphs/process_physical_quantity.svg @@ -1,421 +1,421 @@ - - - + + G - + cluster_criteria_0 - -Criteria graph: response matches answer + +Criteria graph: response matches answer stage_0 - -setup -Copies the tolerance aliases to rtol and atol -and creates the EvaluationResult. + +setup +Copies the tolerance aliases to rtol and atol +and creates the EvaluationResult. stage_1 - -determine_context -Chooses the physical_quantity context and -adds its default parameters and criteria. + +determine_context +Chooses the physical_quantity context and +adds its default parameters and criteria. stage_0->stage_1 - - + + stage_2 - -parse_latex -Not run: is_latex is not set. + +parse_latex +Not run: is_latex is not set. stage_1->stage_2 - - + + stage_3 - -parse_reserved_expressions -Preprocesses and parses the response and -answer. + +parse_reserved_expressions +Preprocesses and parses the response and +answer. stage_2->stage_3 - - + + stage_4 - -preview -Sets the LaTeX and simplified forms of the -response. + +preview +Sets the LaTeX and simplified forms of the +response. stage_3->stage_4 - - + + stage_5 - -parse_criteria -Parses the criteria: `response matches -answer`. + +parse_criteria +Parses the criteria: `response matches +answer`. stage_4->stage_5 - - + + stage_6 - -generate_feedback_procedures -Builds the criteria graph for each criterion. + +generate_feedback_procedures +Builds the criteria graph for each criterion. stage_5->stage_6 - - + + stage_7 - -generate_feedback -Runs each criteria graph on the response; the -path it took is highlighted. + +generate_feedback +Runs each criteria graph on the response; the +path it took is highlighted. stage_6->stage_7 - - + + stage_8 - -serialise -Serialises the result. + +serialise +Serialises the result. stage_7->stage_8 - - + + criteria_0_evaluation_0 - -response matches answer -Converts QUANTITY: response tags: {} and -QUANTITY: answer tags: {} match to a common -set of base units and compares their values. + +response matches answer +Converts QUANTITY: response tags: {} and +QUANTITY: answer tags: {} match to a common +set of base units and compares their values. stage_7->criteria_0_evaluation_0 - - + + result - -Result -is_correct: True; tags: response matches -answer_TRUE, response matches -answer_UNIT_COMPARISON_SIMILAR + +Result +is_correct: True; tags: response matches +answer_TRUE, response matches +answer_UNIT_COMPARISON_SIMILAR stage_8->result - - + + criteria_0_criterion_0 - -response matches answer_TRUE -The quantities QUANTITY: response tags: {} -and QUANTITY: answer tags: {} match. + +response matches answer_TRUE +The quantities QUANTITY: response tags: {} +and QUANTITY: answer tags: {} match. criteria_0_evaluation_0->criteria_0_criterion_0 - - + + criteria_0_criterion_1 - -response matches answer_FALSE -The quantities QUANTITY: response tags: {} -and QUANTITY: answer tags: {} does not match. + +response matches answer_FALSE +The quantities QUANTITY: response tags: {} +and QUANTITY: answer tags: {} does not match. criteria_0_evaluation_0->criteria_0_criterion_1 - - + + criteria_0_criterion_2 - -response matches answer_MISSING_VALUE -The response is missing a value. + +response matches answer_MISSING_VALUE +The response is missing a value. criteria_0_evaluation_0->criteria_0_criterion_2 - - + + criteria_0_criterion_3 - -response matches answer_UNEXPECTED_VALUE -The response is expected only have unit(s), -no value. + +response matches answer_UNEXPECTED_VALUE +The response is expected only have unit(s), +no value. criteria_0_evaluation_0->criteria_0_criterion_3 - - + + criteria_0_criterion_4 - -response matches answer_MISSING_UNIT -The response is missing unit(s). + +response matches answer_MISSING_UNIT +The response is missing unit(s). criteria_0_evaluation_0->criteria_0_criterion_4 - - + + criteria_0_criterion_5 - -response matches answer_UNEXPECTED_UNIT -The response is expected to be a value -without unit(s). + +response matches answer_UNEXPECTED_UNIT +The response is expected to be a value +without unit(s). criteria_0_evaluation_0->criteria_0_criterion_5 - - + + criteria_0_evaluation_1 - -response matches answer_DIMENSION_MATCH -Do the dimensions of QUANTITY: response tags: -{} and QUANTITY: answer tags: {} match? + +response matches answer_DIMENSION_MATCH +Do the dimensions of QUANTITY: response tags: +{} and QUANTITY: answer tags: {} match? criteria_0_criterion_6 - -response matches answer_DIMENSION_MATCH_TRUE -The quantities QUANTITY: response tags: {} -and QUANTITY: answer tags: {} have the same -dimensions. + +response matches answer_DIMENSION_MATCH_TRUE +The quantities QUANTITY: response tags: {} +and QUANTITY: answer tags: {} have the same +dimensions. criteria_0_evaluation_1->criteria_0_criterion_6 - - + + criteria_0_criterion_7 - -response matches answer_DIMENSION_MATCH_FALSE -The quantities QUANTITY: response tags: {} -and QUANTITY: answer tags: {} have different -dimensions. + +response matches answer_DIMENSION_MATCH_FALSE +The quantities QUANTITY: response tags: {} +and QUANTITY: answer tags: {} have different +dimensions. criteria_0_evaluation_1->criteria_0_criterion_7 - - + + criteria_0_evaluation_2 - -response matches answer_UNIT_COMPARISON -Compares how similar the units of QUANTITY: -response tags: {} and QUANTITY: answer tags: -{} are. + +response matches answer_UNIT_COMPARISON +Compares how similar the units of QUANTITY: +response tags: {} and QUANTITY: answer tags: +{} are. criteria_0_criterion_8 - -response matches answer_UNIT_COMPARISON_IDENTICAL -The units of quantities QUANTITY: response -tags: {} and QUANTITY: answer tags: {} are -identical. + +response matches answer_UNIT_COMPARISON_IDENTICAL +The units of quantities QUANTITY: response +tags: {} and QUANTITY: answer tags: {} are +identical. criteria_0_evaluation_2->criteria_0_criterion_8 - - + + criteria_0_criterion_9 - -response matches answer_UNIT_COMPARISON_SIMILAR -The units of quantities QUANTITY: response -tags: {} and QUANTITY: answer tags: {} are -similar. + +response matches answer_UNIT_COMPARISON_SIMILAR +The units of quantities QUANTITY: response +tags: {} and QUANTITY: answer tags: {} are +similar. criteria_0_evaluation_2->criteria_0_criterion_9 - - + + criteria_0_criterion_10 - -response matches answer_UNIT_COMPARISON_PREFIX_IS_LARGE -The units of QUANTITY: response tags: {} are -at least 1000 times greater than the units of -QUANTITY: answer tags: {}. + +response matches answer_UNIT_COMPARISON_PREFIX_IS_LARGE +The units of QUANTITY: response tags: {} are +at least 1000 times greater than the units of +QUANTITY: answer tags: {}. criteria_0_evaluation_2->criteria_0_criterion_10 - - + + criteria_0_criterion_11 - -response matches answer_UNIT_COMPARISON_PREFIX_IS_SMALL -The units of QUANTITY: response tags: {} are -at least 1000 times smaller than the units of -QUANTITY: answer tags: {}. + +response matches answer_UNIT_COMPARISON_PREFIX_IS_SMALL +The units of QUANTITY: response tags: {} are +at least 1000 times smaller than the units of +QUANTITY: answer tags: {}. criteria_0_evaluation_2->criteria_0_criterion_11 - - + + criteria_0_criterion_0->criteria_0_evaluation_2 - - + + criteria_0_criterion_1->criteria_0_evaluation_1 - - + + criteria_0_output_0 - -END -Evaluation completed. + +END +Evaluation completed. criteria_0_criterion_2->criteria_0_output_0 - - + + criteria_0_criterion_3->criteria_0_output_0 - - + + criteria_0_criterion_4->criteria_0_output_0 - - + + criteria_0_criterion_5->criteria_0_output_0 - - + + criteria_0_criterion_6->criteria_0_output_0 - - + + criteria_0_criterion_7->criteria_0_output_0 - - + + criteria_0_criterion_10->criteria_0_output_0 - - + + criteria_0_criterion_11->criteria_0_output_0 - - + + diff --git a/app/docs/process_graphs/process_physical_quantity_calls.svg b/app/docs/process_graphs/process_physical_quantity_calls.svg index 99a79ef..45c074b 100644 --- a/app/docs/process_graphs/process_physical_quantity_calls.svg +++ b/app/docs/process_graphs/process_physical_quantity_calls.svg @@ -1,671 +1,671 @@ - - + G - + cluster_stage_cluster_0 - + cluster_stage_cluster_1 - + cluster_stage_cluster_3 - + cluster_stage_cluster_4 - + cluster_stage_cluster_5 - + cluster_stage_cluster_6 - + cluster_stage_cluster_7 - + cluster_stage_cluster_8 - + stage_0 - -setup -Copies the tolerance aliases to rtol and atol -and creates the EvaluationResult. + +setup +Copies the tolerance aliases to rtol and atol +and creates the EvaluationResult. stage_1 - -determine_context -Chooses the physical_quantity context and -adds its default parameters and criteria. + +determine_context +Chooses the physical_quantity context and +adds its default parameters and criteria. stage_0->stage_1 - - + + call_0 - -_apply_tolerance_aliases -app.evaluation + +_apply_tolerance_aliases +app.evaluation stage_0->call_0 - - + + call_1 - -EvaluationResult.__init__ -app.result + +EvaluationResult.__init__ +app.result stage_0->call_1 - - + + stage_2 - -parse_latex -Not run: is_latex is not set. + +parse_latex +Not run: is_latex is not set. stage_1->stage_2 - - + + call_2 - -select_context -app.evaluation + +select_context +app.evaluation stage_1->call_2 - - + + call_3 - -_build_parameters -app.evaluation + +_build_parameters +app.evaluation stage_1->call_3 - - + + call_6 - -_add_notation_warnings -app.evaluation + +_add_notation_warnings +app.evaluation stage_1->call_6 - - + + stage_3 - -parse_reserved_expressions -Preprocesses and parses the response and -answer. + +parse_reserved_expressions +Preprocesses and parses the response and +answer. stage_2->stage_3 - - + + stage_4 - -preview -Sets the LaTeX and simplified forms of the -response. + +preview +Sets the LaTeX and simplified forms of the +response. stage_3->stage_4 - - + + call_8 - -parse_reserved_expressions -app.evaluation + +parse_reserved_expressions +app.evaluation stage_3->call_8 - - + + stage_5 - -parse_criteria -Parses the criteria: `response matches -answer`. + +parse_criteria +Parses the criteria: `response matches +answer`. stage_4->stage_5 - - + + call_14 - -_set_preview_fields -app.evaluation + +_set_preview_fields +app.evaluation stage_4->call_14 - - + + stage_6 - -generate_feedback_procedures -Builds the criteria graph for each criterion. + +generate_feedback_procedures +Builds the criteria graph for each criterion. stage_5->stage_6 - - + + call_18 - -build_quantity_criteria_parser -lambdafeedback.criteria.quantity_grammar + +build_quantity_criteria_parser +lambdafeedback.criteria.quantity_grammar stage_5->call_18 - - + + call_20 - -create_criteria_dict -app.evaluation + +create_criteria_dict +app.evaluation stage_5->call_20 - - + + call_27 - -_build_evaluation_parameters -app.evaluation + +_build_evaluation_parameters +app.evaluation stage_5->call_27 - - + + stage_7 - -generate_feedback -Runs each criteria graph on the response; the -path it took is highlighted. + +generate_feedback +Runs each criteria graph on the response; the +path it took is highlighted. stage_6->stage_7 - - + + call_28 - -feedback_procedure_generator -app.context.physical_quantity + +feedback_procedure_generator +app.context.physical_quantity stage_6->call_28 - - + + call_30 - -_disable_evaluation_nodes -app.evaluation + +_disable_evaluation_nodes +app.evaluation stage_6->call_30 - - + + stage_8 - -serialise -Serialises the result. + +serialise +Serialises the result. stage_7->stage_8 - - + + call_31 - -generate_feedback -app.evaluation + +generate_feedback +app.evaluation stage_7->call_31 - - + + result - -Result -is_correct: True; tags: response matches -answer_TRUE, response matches -answer_UNIT_COMPARISON_SIMILAR + +Result +is_correct: True; tags: response matches +answer_TRUE, response matches +answer_UNIT_COMPARISON_SIMILAR stage_8->result - - + + call_34 - -EvaluationResult.serialise -app.result + +EvaluationResult.serialise +app.result stage_8->call_34 - - + + call_4 - -_reserved_keywords -app.evaluation + +_reserved_keywords +app.evaluation call_3->call_4 - - + + call_5 - -parsing_parameters_generator -app.context.physical_quantity + +parsing_parameters_generator +app.context.physical_quantity call_3->call_5 - - + + call_7 - -notation_warnings -lambdafeedback.expression_parsing.notation + +notation_warnings +lambdafeedback.expression_parsing.notation call_6->call_7 - - + + call_9 - -ExpressionParams.__getstate__ ×2 -lambdafeedback.expression_parsing.params + +ExpressionParams.__getstate__ ×2 +lambdafeedback.expression_parsing.params call_8->call_9 - - + + call_10 - -ExpressionParams.__setstate__ ×2 -lambdafeedback.expression_parsing.params + +ExpressionParams.__setstate__ ×2 +lambdafeedback.expression_parsing.params call_8->call_10 - - + + call_11 - -expression_preprocess ×2 -app.context.physical_quantity + +expression_preprocess ×2 +app.context.physical_quantity call_8->call_11 - - + + call_12 - -parse_quantity ×2 -app.context.physical_quantity.parsing + +parse_quantity ×2 +app.context.physical_quantity.parsing call_8->call_12 - - + + call_13 - -is_inequality_or_boolean -app.context.symbolic.comparison + +is_inequality_or_boolean +app.context.symbolic.comparison call_8->call_13 - - + + call_15 - -ExpressionParams.__getstate__ ×2 -lambdafeedback.expression_parsing.params + +ExpressionParams.__getstate__ ×2 +lambdafeedback.expression_parsing.params call_14->call_15 - - + + call_16 - -ExpressionParams.__setstate__ ×2 -lambdafeedback.expression_parsing.params + +ExpressionParams.__setstate__ ×2 +lambdafeedback.expression_parsing.params call_14->call_16 - - + + call_17 - -preview_function -app.preview.physical_quantity + +preview_function +app.preview.physical_quantity call_14->call_17 - - + + call_19 - -SLRParser.__init__ -lambdafeedback.slr_parsing.parser + +SLRParser.__init__ +lambdafeedback.slr_parsing.parser call_18->call_19 - - + + call_21 - -get_criteria_string -app.evaluation + +get_criteria_string +app.evaluation call_20->call_21 - - + + call_22 - -expression_preprocess -app.context.physical_quantity + +expression_preprocess +app.context.physical_quantity call_20->call_22 - - + + call_23 - -split_criteria -lambdafeedback.criteria.split + +split_criteria +lambdafeedback.criteria.split call_20->call_23 - - + + call_24 - -SLRParser.scan -lambdafeedback.slr_parsing.parser + +SLRParser.scan +lambdafeedback.slr_parsing.parser call_20->call_24 - - + + call_25 - -SLRParser.parse -lambdafeedback.slr_parsing.parser + +SLRParser.parse +lambdafeedback.slr_parsing.parser call_20->call_25 - - + + call_26 - -ExprNode.content_string ×2 -lambdafeedback.slr_parsing.tokens + +ExprNode.content_string ×2 +lambdafeedback.slr_parsing.tokens call_20->call_26 - - + + call_29 - -criterion_match_node -app.context.physical_quantity.graphs.match + +criterion_match_node +app.context.physical_quantity.graphs.match call_28->call_29 - - + + call_32 - -CriteriaGraph.generate_feedback -lambdafeedback.criteria.graph + +CriteriaGraph.generate_feedback +lambdafeedback.criteria.graph call_31->call_32 - - + + call_33 - -CriteriaGraph.export_feedback -lambdafeedback.criteria.graph + +CriteriaGraph.export_feedback +lambdafeedback.criteria.graph call_31->call_33 - - + + call_35 - -EvaluationResult._serialise_feedback -app.result + +EvaluationResult._serialise_feedback +app.result call_34->call_35 - - + + call_36 - -EvaluationResult.tags -app.result + +EvaluationResult.tags +app.result call_34->call_36 - - + + call_37 - -CriteriaGraph.test_data -lambdafeedback.criteria.graph + +CriteriaGraph.test_data +lambdafeedback.criteria.graph call_34->call_37 - - + + diff --git a/app/docs/process_graphs/process_symbolic.svg b/app/docs/process_graphs/process_symbolic.svg index 0c55463..97ad80f 100644 --- a/app/docs/process_graphs/process_symbolic.svg +++ b/app/docs/process_graphs/process_symbolic.svg @@ -1,275 +1,275 @@ - - - + + G - + cluster_criteria_0 - -Criteria graph: response = answer + +Criteria graph: response = answer stage_0 - -setup -Copies the tolerance aliases to rtol and atol -and creates the EvaluationResult. + +setup +Copies the tolerance aliases to rtol and atol +and creates the EvaluationResult. stage_1 - -determine_context -Chooses the symbolic context and adds its -default parameters and criteria. + +determine_context +Chooses the symbolic context and adds its +default parameters and criteria. stage_0->stage_1 - - + + stage_2 - -parse_latex -Not run: is_latex is not set. + +parse_latex +Not run: is_latex is not set. stage_1->stage_2 - - + + stage_3 - -parse_reserved_expressions -Preprocesses and parses the response and -answer. + +parse_reserved_expressions +Preprocesses and parses the response and +answer. stage_2->stage_3 - - + + stage_4 - -preview -Sets the LaTeX and simplified forms of the -response. + +preview +Sets the LaTeX and simplified forms of the +response. stage_3->stage_4 - - + + stage_5 - -parse_criteria -Parses the criteria: `response = answer`. + +parse_criteria +Parses the criteria: `response = answer`. stage_4->stage_5 - - + + stage_6 - -generate_feedback_procedures -Builds the criteria graph for each criterion. + +generate_feedback_procedures +Builds the criteria graph for each criterion. stage_5->stage_6 - - + + stage_7 - -generate_feedback -Runs each criteria graph on the response; the -path it took is highlighted. + +generate_feedback +Runs each criteria graph on the response; the +path it took is highlighted. stage_6->stage_7 - - + + stage_8 - -serialise -Serialises the result. + +serialise +Serialises the result. stage_7->stage_8 - - + + criteria_0_evaluation_0 - -response = answer -Checks if response=answer. + +response = answer +Checks if response=answer. stage_7->criteria_0_evaluation_0 - - + + result - -Result -is_correct: True; tags: response = -answer_TRUE, response = -answer_SAME_SYMBOLS_TRUE + +Result +is_correct: True; tags: response = +answer_TRUE, response = +answer_SAME_SYMBOLS_TRUE stage_8->result - - + + criteria_0_criterion_0 - -response = answer_TRUE -response is equal to answer. + +response = answer_TRUE +response is equal to answer. criteria_0_evaluation_0->criteria_0_criterion_0 - - + + criteria_0_criterion_3 - -response = answer_FALSE -response is not equal toanswer. + +response = answer_FALSE +response is not equal toanswer. criteria_0_evaluation_0->criteria_0_criterion_3 - - + + criteria_0_criterion_4 - -response = answer_UNKNOWN -Cannot detrmine if response is equal to -answer. + +response = answer_UNKNOWN +Cannot detrmine if response is equal to +answer. criteria_0_evaluation_0->criteria_0_criterion_4 - - + + criteria_0_evaluation_1 - -response = answer_SAME_SYMBOLS -response has the same (free) symbols as -answer. + +response = answer_SAME_SYMBOLS +response has the same (free) symbols as +answer. criteria_0_criterion_1 - -response = answer_SAME_SYMBOLS_TRUE -response has the same (free) symbols as -answer. + +response = answer_SAME_SYMBOLS_TRUE +response has the same (free) symbols as +answer. criteria_0_evaluation_1->criteria_0_criterion_1 - - + + criteria_0_criterion_2 - -response = answer_SAME_SYMBOLS_FALSE -response does note have the same (free) -symbols as answer. + +response = answer_SAME_SYMBOLS_FALSE +response does note have the same (free) +symbols as answer. criteria_0_evaluation_1->criteria_0_criterion_2 - - + + criteria_0_criterion_0->criteria_0_evaluation_1 - - + + criteria_0_output_0 - -END -Evaluation completed. + +END +Evaluation completed. criteria_0_criterion_1->criteria_0_output_0 - - + + criteria_0_criterion_2->criteria_0_output_0 - - + + criteria_0_criterion_3->criteria_0_output_0 - - + + criteria_0_criterion_4->criteria_0_output_0 - - + + diff --git a/app/docs/process_graphs/process_symbolic_calls.svg b/app/docs/process_graphs/process_symbolic_calls.svg index 648c8ce..7dda09e 100644 --- a/app/docs/process_graphs/process_symbolic_calls.svg +++ b/app/docs/process_graphs/process_symbolic_calls.svg @@ -1,670 +1,670 @@ - - + G - + cluster_stage_cluster_0 - + cluster_stage_cluster_1 - + cluster_stage_cluster_3 - + cluster_stage_cluster_4 - + cluster_stage_cluster_5 - + cluster_stage_cluster_6 - + cluster_stage_cluster_7 - + cluster_stage_cluster_8 - + stage_0 - -setup -Copies the tolerance aliases to rtol and atol -and creates the EvaluationResult. + +setup +Copies the tolerance aliases to rtol and atol +and creates the EvaluationResult. stage_1 - -determine_context -Chooses the symbolic context and adds its -default parameters and criteria. + +determine_context +Chooses the symbolic context and adds its +default parameters and criteria. stage_0->stage_1 - - + + call_0 - -_apply_tolerance_aliases -app.evaluation + +_apply_tolerance_aliases +app.evaluation stage_0->call_0 - - + + call_1 - -EvaluationResult.__init__ -app.result + +EvaluationResult.__init__ +app.result stage_0->call_1 - - + + stage_2 - -parse_latex -Not run: is_latex is not set. + +parse_latex +Not run: is_latex is not set. stage_1->stage_2 - - + + call_2 - -select_context -app.evaluation + +select_context +app.evaluation stage_1->call_2 - - + + call_3 - -_build_parameters -app.evaluation + +_build_parameters +app.evaluation stage_1->call_3 - - + + call_6 - -_add_notation_warnings -app.evaluation + +_add_notation_warnings +app.evaluation stage_1->call_6 - - + + stage_3 - -parse_reserved_expressions -Preprocesses and parses the response and -answer. + +parse_reserved_expressions +Preprocesses and parses the response and +answer. stage_2->stage_3 - - + + stage_4 - -preview -Sets the LaTeX and simplified forms of the -response. + +preview +Sets the LaTeX and simplified forms of the +response. stage_3->stage_4 - - + + call_8 - -parse_reserved_expressions -app.evaluation + +parse_reserved_expressions +app.evaluation stage_3->call_8 - - + + stage_5 - -parse_criteria -Parses the criteria: `response = answer`. + +parse_criteria +Parses the criteria: `response = answer`. stage_4->stage_5 - - + + call_14 - -_set_preview_fields -app.evaluation + +_set_preview_fields +app.evaluation stage_4->call_14 - - + + stage_6 - -generate_feedback_procedures -Builds the criteria graph for each criterion. + +generate_feedback_procedures +Builds the criteria graph for each criterion. stage_5->stage_6 - - + + call_18 - -build_criteria_parser -lambdafeedback.criteria.grammar + +build_criteria_parser +lambdafeedback.criteria.grammar stage_5->call_18 - - + + call_20 - -create_criteria_dict -app.evaluation + +create_criteria_dict +app.evaluation stage_5->call_20 - - + + call_27 - -_build_evaluation_parameters -app.evaluation + +_build_evaluation_parameters +app.evaluation stage_5->call_27 - - + + stage_7 - -generate_feedback -Runs each criteria graph on the response; the -path it took is highlighted. + +generate_feedback +Runs each criteria graph on the response; the +path it took is highlighted. stage_6->stage_7 - - + + call_28 - -feedback_procedure_generator -app.context.symbolic + +feedback_procedure_generator +app.context.symbolic stage_6->call_28 - - + + call_30 - -_disable_evaluation_nodes -app.evaluation + +_disable_evaluation_nodes +app.evaluation stage_6->call_30 - - + + stage_8 - -serialise -Serialises the result. + +serialise +Serialises the result. stage_7->stage_8 - - + + call_31 - -generate_feedback -app.evaluation + +generate_feedback +app.evaluation stage_7->call_31 - - + + result - -Result -is_correct: True; tags: response = -answer_TRUE, response = -answer_SAME_SYMBOLS_TRUE + +Result +is_correct: True; tags: response = +answer_TRUE, response = +answer_SAME_SYMBOLS_TRUE stage_8->result - - + + call_34 - -EvaluationResult.serialise -app.result + +EvaluationResult.serialise +app.result stage_8->call_34 - - + + call_4 - -_reserved_keywords -app.evaluation + +_reserved_keywords +app.evaluation call_3->call_4 - - + + call_5 - -parsing_parameters_generator -app.context.symbolic + +parsing_parameters_generator +app.context.symbolic call_3->call_5 - - + + call_7 - -notation_warnings -lambdafeedback.expression_parsing.notation + +notation_warnings +lambdafeedback.expression_parsing.notation call_6->call_7 - - + + call_9 - -ExpressionParams.__getstate__ -lambdafeedback.expression_parsing.params + +ExpressionParams.__getstate__ +lambdafeedback.expression_parsing.params call_8->call_9 - - + + call_10 - -ExpressionParams.__setstate__ -lambdafeedback.expression_parsing.params + +ExpressionParams.__setstate__ +lambdafeedback.expression_parsing.params call_8->call_10 - - + + call_11 - -expression_preprocess ×2 -app.context.symbolic + +expression_preprocess ×2 +app.context.symbolic call_8->call_11 - - + + call_12 - -expression_parse ×2 -app.context.symbolic + +expression_parse ×2 +app.context.symbolic call_8->call_12 - - + + call_13 - -is_inequality_or_boolean -app.context.symbolic.comparison + +is_inequality_or_boolean +app.context.symbolic.comparison call_8->call_13 - - + + call_15 - -ExpressionParams.__getstate__ -lambdafeedback.expression_parsing.params + +ExpressionParams.__getstate__ +lambdafeedback.expression_parsing.params call_14->call_15 - - + + call_16 - -ExpressionParams.__setstate__ -lambdafeedback.expression_parsing.params + +ExpressionParams.__setstate__ +lambdafeedback.expression_parsing.params call_14->call_16 - - + + call_17 - -preview_function -app.preview.symbolic + +preview_function +app.preview.symbolic call_14->call_17 - - + + call_19 - -SLRParser.__init__ -lambdafeedback.slr_parsing.parser + +SLRParser.__init__ +lambdafeedback.slr_parsing.parser call_18->call_19 - - + + call_21 - -get_criteria_string -app.evaluation + +get_criteria_string +app.evaluation call_20->call_21 - - + + call_22 - -expression_preprocess -app.context.symbolic + +expression_preprocess +app.context.symbolic call_20->call_22 - - + + call_23 - -split_criteria -lambdafeedback.criteria.split + +split_criteria +lambdafeedback.criteria.split call_20->call_23 - - + + call_24 - -SLRParser.scan -lambdafeedback.slr_parsing.parser + +SLRParser.scan +lambdafeedback.slr_parsing.parser call_20->call_24 - - + + call_25 - -SLRParser.parse -lambdafeedback.slr_parsing.parser + +SLRParser.parse +lambdafeedback.slr_parsing.parser call_20->call_25 - - + + call_26 - -ExprNode.content_string ×2 -lambdafeedback.slr_parsing.tokens + +ExprNode.content_string ×2 +lambdafeedback.slr_parsing.tokens call_20->call_26 - - + + call_29 - -criterion_equality_node -app.context.symbolic.graphs.equivalence + +criterion_equality_node +app.context.symbolic.graphs.equivalence call_28->call_29 - - + + call_32 - -CriteriaGraph.generate_feedback -lambdafeedback.criteria.graph + +CriteriaGraph.generate_feedback +lambdafeedback.criteria.graph call_31->call_32 - - + + call_33 - -CriteriaGraph.export_feedback -lambdafeedback.criteria.graph + +CriteriaGraph.export_feedback +lambdafeedback.criteria.graph call_31->call_33 - - + + call_35 - -EvaluationResult._serialise_feedback -app.result + +EvaluationResult._serialise_feedback +app.result call_34->call_35 - - + + call_36 - -EvaluationResult.tags -app.result + +EvaluationResult.tags +app.result call_34->call_36 - - + + call_37 - -CriteriaGraph.test_data -lambdafeedback.criteria.graph + +CriteriaGraph.test_data +lambdafeedback.criteria.graph call_34->call_37 - - + + diff --git a/app/docs/process_graphs/process_symbolic_parse_error.svg b/app/docs/process_graphs/process_symbolic_parse_error.svg index 02c0659..91ecc20 100644 --- a/app/docs/process_graphs/process_symbolic_parse_error.svg +++ b/app/docs/process_graphs/process_symbolic_parse_error.svg @@ -1,141 +1,141 @@ - - + G - + stage_0 - -setup -Copies the tolerance aliases to rtol and atol -and creates the EvaluationResult. + +setup +Copies the tolerance aliases to rtol and atol +and creates the EvaluationResult. stage_1 - -determine_context -Chooses the symbolic context and adds its -default parameters and criteria. + +determine_context +Chooses the symbolic context and adds its +default parameters and criteria. stage_0->stage_1 - - + + stage_2 - -parse_latex -Not run: is_latex is not set. + +parse_latex +Not run: is_latex is not set. stage_1->stage_2 - - + + stage_3 - -parse_reserved_expressions -Preprocesses and parses the response and -answer. The response could not be parsed, so -the result is returned with its feedback. + +parse_reserved_expressions +Preprocesses and parses the response and +answer. The response could not be parsed, so +the result is returned with its feedback. stage_2->stage_3 - - + + stage_4 - -preview -Not run: the response could not be parsed. + +preview +Not run: the response could not be parsed. stage_3->stage_4 - - + + stage_5 - -parse_criteria -Not run: the response could not be parsed. + +parse_criteria +Not run: the response could not be parsed. stage_4->stage_5 - - + + stage_6 - -generate_feedback_procedures -Not run: the response could not be parsed. + +generate_feedback_procedures +Not run: the response could not be parsed. stage_5->stage_6 - - + + stage_7 - -generate_feedback -Not run: the response could not be parsed. + +generate_feedback +Not run: the response could not be parsed. stage_6->stage_7 - - + + stage_8 - -serialise -Not run: the response could not be parsed. + +serialise +Not run: the response could not be parsed. stage_7->stage_8 - - + + result - -Result -is_correct: False; tags: PARSE_ERROR_response + +Result +is_correct: False; tags: PARSE_ERROR_response stage_8->result - - + + diff --git a/app/docs/process_graphs/process_symbolic_parse_error_calls.svg b/app/docs/process_graphs/process_symbolic_parse_error_calls.svg index 5c70152..9d0c415 100644 --- a/app/docs/process_graphs/process_symbolic_parse_error_calls.svg +++ b/app/docs/process_graphs/process_symbolic_parse_error_calls.svg @@ -1,400 +1,400 @@ - - + G - + cluster_stage_cluster_0 - + cluster_stage_cluster_1 - + cluster_stage_cluster_3 - + stage_0 - -setup -Copies the tolerance aliases to rtol and atol -and creates the EvaluationResult. + +setup +Copies the tolerance aliases to rtol and atol +and creates the EvaluationResult. stage_1 - -determine_context -Chooses the symbolic context and adds its -default parameters and criteria. + +determine_context +Chooses the symbolic context and adds its +default parameters and criteria. stage_0->stage_1 - - + + call_0 - -_apply_tolerance_aliases -app.evaluation + +_apply_tolerance_aliases +app.evaluation stage_0->call_0 - - + + call_1 - -EvaluationResult.__init__ -app.result + +EvaluationResult.__init__ +app.result stage_0->call_1 - - + + stage_2 - -parse_latex -Not run: is_latex is not set. + +parse_latex +Not run: is_latex is not set. stage_1->stage_2 - - + + call_2 - -select_context -app.evaluation + +select_context +app.evaluation stage_1->call_2 - - + + call_3 - -_build_parameters -app.evaluation + +_build_parameters +app.evaluation stage_1->call_3 - - + + call_6 - -_add_notation_warnings -app.evaluation + +_add_notation_warnings +app.evaluation stage_1->call_6 - - + + stage_3 - -parse_reserved_expressions -Preprocesses and parses the response and -answer. The response could not be parsed, so -the result is returned with its feedback. + +parse_reserved_expressions +Preprocesses and parses the response and +answer. The response could not be parsed, so +the result is returned with its feedback. stage_2->stage_3 - - + + stage_4 - -preview -Not run: the response could not be parsed. + +preview +Not run: the response could not be parsed. stage_3->stage_4 - - + + call_8 - -parse_reserved_expressions -app.evaluation + +parse_reserved_expressions +app.evaluation stage_3->call_8 - - + + call_15 - -EvaluationResult.serialise -app.result + +EvaluationResult.serialise +app.result stage_3->call_15 - - + + stage_5 - -parse_criteria -Not run: the response could not be parsed. + +parse_criteria +Not run: the response could not be parsed. stage_4->stage_5 - - + + stage_6 - -generate_feedback_procedures -Not run: the response could not be parsed. + +generate_feedback_procedures +Not run: the response could not be parsed. stage_5->stage_6 - - + + stage_7 - -generate_feedback -Not run: the response could not be parsed. + +generate_feedback +Not run: the response could not be parsed. stage_6->stage_7 - - + + stage_8 - -serialise -Not run: the response could not be parsed. + +serialise +Not run: the response could not be parsed. stage_7->stage_8 - - + + result - -Result -is_correct: False; tags: PARSE_ERROR_response + +Result +is_correct: False; tags: PARSE_ERROR_response stage_8->result - - + + call_4 - -_reserved_keywords -app.evaluation + +_reserved_keywords +app.evaluation call_3->call_4 - - + + call_5 - -parsing_parameters_generator -app.context.symbolic + +parsing_parameters_generator +app.context.symbolic call_3->call_5 - - + + call_7 - -notation_warnings -lambdafeedback.expression_parsing.notation + +notation_warnings +lambdafeedback.expression_parsing.notation call_6->call_7 - - + + call_9 - -ExpressionParams.__getstate__ -lambdafeedback.expression_parsing.params + +ExpressionParams.__getstate__ +lambdafeedback.expression_parsing.params call_8->call_9 - - + + call_10 - -ExpressionParams.__setstate__ -lambdafeedback.expression_parsing.params + +ExpressionParams.__setstate__ +lambdafeedback.expression_parsing.params call_8->call_10 - - + + call_11 - -expression_preprocess ×2 -app.context.symbolic + +expression_preprocess ×2 +app.context.symbolic call_8->call_11 - - + + call_12 - -expression_parse ×2 -app.context.symbolic + +expression_parse ×2 +app.context.symbolic call_8->call_12 - - + + call_13 - -_report -app.evaluation + +_report +app.evaluation call_8->call_13 - - + + call_14 - -is_inequality_or_boolean -app.context.symbolic.comparison + +is_inequality_or_boolean +app.context.symbolic.comparison call_8->call_14 - - + + call_16 - -EvaluationResult._serialise_feedback -app.result + +EvaluationResult._serialise_feedback +app.result call_15->call_16 - - + + call_17 - -EvaluationResult.tags -app.result + +EvaluationResult.tags +app.result call_15->call_17 - - + + call_18 - -CriteriaGraph.test_data -lambdafeedback.criteria.graph + +CriteriaGraph.test_data +lambdafeedback.criteria.graph call_15->call_18 - - + + diff --git a/app/docs/user.md b/app/docs/user.md index 83c929b..20b7a65 100644 --- a/app/docs/user.md +++ b/app/docs/user.md @@ -17,6 +17,8 @@ Sets the absolute tolerance, $e_a$, i.e. if the answer, $x$, and response, $\til If you want to use `I` for the imaginary constant, set the grading parameter `complexNumbers` to True. +With `complexNumbers` set to True, a number directly followed by `j` or `J` (e.g. `2j`) is also read as an imaginary number, `2*I`. Otherwise `2j` is read like `2i`: as `2*j` (or as a syntax error with `strict_syntax`), see [Entering vectors as `3i+2j+6k`](#entering-vectors-as-3i2j6k). + #### `convention` Changes the implicit multiplication convention. If unset it will default to `equal_precedence`. @@ -505,6 +507,12 @@ Any response that is mathematically equivalent $2+i$ to will be accepted, e.g. ` **Note:** If the particular way that the answer is written matter, e.g. only answers on cartesian form should be accepted, then that requires further configuration, see the example *Syntactical comparison*. +#### Entering vectors as `3i+2j+6k` + +With `complexNumbers` unset (or `false`), `i`, `j` and `k` are ordinary symbols, so a vector can be written using the unit vectors $\mathbf{i}$, $\mathbf{j}$ and $\mathbf{k}$. If the answer is `3*i+2*j+6*k`, the responses `3i+2j+6k` and `3*i+2*j+6*k` are both accepted. A number directly followed by `j` or `J` is read as a multiplication, `2j` as `2*j`, in the same way as `2i` and `2k`. Input symbols for `i`, `j` and `k` can be added to show them as $\mathbf{i}$, $\mathbf{j}$ and $\mathbf{k}$ in the preview. + +With `strict_syntax` set to `true`, implicit multiplication is not allowed, so the response must be written `3*i+2*j+6*k`. Do not set `complexNumbers` to `true` for such a question: then `2j` is read as the imaginary number $2i$. + #### Using `constant` and `function` assumptions Examples of how to use the `constant` and `function` assumptions for symbols. diff --git a/app/requirements.txt b/app/requirements.txt index a093968..5250aab 100644 --- a/app/requirements.txt +++ b/app/requirements.txt @@ -2,10 +2,11 @@ pydot mpmath==1.3.0 sympy==1.14 # Parsing, units and criteria packages extracted from this function -# (https://github.com/lambda-feedback/lambda-feedback-packages), pinned to the -# v0.3.0-rc.5 release candidate (0.3.0rc5). All four are listed: they depend on -# each other by name and aren't published on PyPI. -lambdafeedback-slr-parsing @ git+https://github.com/lambda-feedback/lambda-feedback-packages.git@v0.3.0-rc.5#subdirectory=slr_parsing -lambdafeedback-criteria @ git+https://github.com/lambda-feedback/lambda-feedback-packages.git@v0.3.0-rc.5#subdirectory=criteria -lambdafeedback-expression-parsing @ git+https://github.com/lambda-feedback/lambda-feedback-packages.git@v0.3.0-rc.5#subdirectory=expression_parsing -lambdafeedback-physical-quantities @ git+https://github.com/lambda-feedback/lambda-feedback-packages.git@v0.3.0-rc.5#subdirectory=physical_quantities +# (https://github.com/lambda-feedback/lambda-feedback-packages). TEMPORARY: pinned +# to commit 7006a92 (lambda-feedback-packages#33, still 0.3.0rc5) for the `2j` fix; +# repin to the next release tag before merging. All four are listed: they depend +# on each other by name and aren't published on PyPI. +lambdafeedback-slr-parsing @ git+https://github.com/lambda-feedback/lambda-feedback-packages.git@7006a92d4a17396aa4984f4297149d7d508b2acd#subdirectory=slr_parsing +lambdafeedback-criteria @ git+https://github.com/lambda-feedback/lambda-feedback-packages.git@7006a92d4a17396aa4984f4297149d7d508b2acd#subdirectory=criteria +lambdafeedback-expression-parsing @ git+https://github.com/lambda-feedback/lambda-feedback-packages.git@7006a92d4a17396aa4984f4297149d7d508b2acd#subdirectory=expression_parsing +lambdafeedback-physical-quantities @ git+https://github.com/lambda-feedback/lambda-feedback-packages.git@7006a92d4a17396aa4984f4297149d7d508b2acd#subdirectory=physical_quantities diff --git a/app/tests/symbolic_evaluation_test.py b/app/tests/symbolic_evaluation_test.py index 486b797..afd1480 100644 --- a/app/tests/symbolic_evaluation_test.py +++ b/app/tests/symbolic_evaluation_test.py @@ -2297,3 +2297,82 @@ def test_greek_letters_in_expressions(self, unicode_expr, letter_expr): } result = evaluation_function(response, answer, params) assert result["is_correct"] is True + + vector_symbols = { + "i": {"aliases": [], "latex": r"\(\mathbf{i}\)"}, + "j": {"aliases": [], "latex": r"\(\mathbf{j}\)"}, + "k": {"aliases": [], "latex": r"\(\mathbf{k}\)"}, + } + + @pytest.mark.parametrize("symbols", [None, vector_symbols]) + @pytest.mark.parametrize( + "response,answer", + generate_input_variations(response="3*i+2*j+6*k", answer="3*i+2*j+6*k") + ) + def test_number_followed_by_j_is_multiplication(self, response, answer, symbols): + # Python reads `2j` as a complex literal, it should be read as `2*j` here + params = {"strict_syntax": False, "elementary_functions": True} + if symbols is not None: + params["symbols"] = symbols + result = evaluation_function(response, answer, params) + assert result["is_correct"] is True + + @pytest.mark.parametrize("symbols", [None, vector_symbols]) + @pytest.mark.parametrize( + "response,answer", + [ + ("3i+2j+5k", "3*i+2*j+6*k"), + ("3i+2j+6k", "3*i+2*I+6*k"), + ("2j", "2*I"), + ("x_2j", "x_2*j"), # `x_2j` is a single symbol + ] + ) + def test_number_followed_by_j_is_multiplication_incorrect(self, response, answer, symbols): + params = {"strict_syntax": False, "elementary_functions": True} + if symbols is not None: + params["symbols"] = symbols + result = evaluation_function(response, answer, params) + assert result["is_correct"] is False + + @pytest.mark.parametrize( + "response,answer", + [ + ("2.5j", "2.5*j"), + ("2J", "2*J"), + ("2.5J+x", "x+2.5*J"), + (".5j", "j/2"), + ("sin(2j)", "sin(2*j)"), + ("3*i+2*j", "3i+2j"), + ("x2j", "x2*j"), + ("abc2j", "abc2*j"), + ] + ) + def test_number_followed_by_j_variations(self, response, answer): + params = {"strict_syntax": False, "elementary_functions": True} + result = evaluation_function(response, answer, params) + assert result["is_correct"] is True + + def test_number_followed_by_j_in_identifier_with_symbols(self): + # `x2j` is a name, its digits are not a number followed by `j` + params = { + "strict_syntax": False, + "symbols": {"x2j": {"aliases": [], "latex": r"\(x_{2j}\)"}}, + } + assert evaluation_function("3x2j", "3*x2j", params)["is_correct"] is True + assert evaluation_function("3x2j", "3*x2*j", params)["is_correct"] is False + + @pytest.mark.parametrize("response", ["2j", "2J", "2*I"]) + def test_number_followed_by_j_with_complex_numbers(self, response): + # With `complexNumbers` a number followed by `j` is still the imaginary number + params = {"complexNumbers": True, "strict_syntax": False, "elementary_functions": True} + result = evaluation_function(response, "2*I", params) + assert result["is_correct"] is True + assert evaluation_function(response, "2*j", params)["is_correct"] is False + + @pytest.mark.parametrize("response", ["2j", "2J", "3i+2j+6k"]) + def test_number_followed_by_j_with_strict_syntax(self, response): + # With strict syntax a number followed by `j` is rejected, like `2i` + params = {"strict_syntax": True, "elementary_functions": True} + for answer in ["2*j", "2*J", "3*i+2*j+6*k", "2*I"]: + assert evaluation_function(response, answer, params)["is_correct"] is False + assert evaluation_function("2i", "2*i", params)["is_correct"] is False diff --git a/app/tests/symbolic_preview_test.py b/app/tests/symbolic_preview_test.py index bdde208..1789ad2 100644 --- a/app/tests/symbolic_preview_test.py +++ b/app/tests/symbolic_preview_test.py @@ -362,3 +362,18 @@ def test_curly_brace_multiple_answers_still_works(self, strict_syntax): result = preview_function("{1, 2}", params) assert result["preview"]["latex"] == "\\left\\{1,~2\\right\\}" assert result["preview"]["sympy"] == "{1, 2}" + + @pytest.mark.parametrize( + "response,latex,sympy", + [ + ("3i+2j+6k", r"3 \cdot i + 2 \cdot j + 6 \cdot k", "3i+2j+6k"), + ("2.5J", r"2.5 \cdot J", "2.5J"), + ("x2j", r"x \cdot 2 \cdot j", "x2j"), + ("x_2j", r"x_{2j}", "x_2j"), + ] + ) + def test_number_followed_by_j_is_multiplication(self, response, latex, sympy): + params = {"is_latex": False, "strict_syntax": False, "elementary_functions": True} + result = preview_function(response, params) + assert result["preview"]["latex"] == latex + assert result["preview"]["sympy"] == sympy