Skip to content

Check of Sign

mkraska edited this page Jul 19, 2022 · 3 revisions

Procedure based on this forum discussion.

This check is implemented in the feedback function fb_unit.

Question variables

ra(x,y):=stack_units_nums(stack_unit_si_to_si_base(x))/stack_units_nums(stack_unit_si_to_si_base(y));

When checking the sign of symbolic expressions, you might want to assume that any variable in the expression is positive.

map(lambda ([x], assume(x>0)),listofvars(expression));

PRT

This example is in the context of a unitless question design but input with units.

Field Value
Answer test AlgEquiv
SAns is(ra(S_A, A)>0) Answer S_A is made unitless by dividing it by the model solution
TAns true
true feedback Das Vorzeichen stimmt.

Tryout Space

In order to try code snippets in jsfiddle,

  1. copy the code from the wiki page to the clipboard
  2. follow the link for the JSXGraph version you want to try
  3. Replace the code in the HTML section (contents of <p hidden id="init">) with the content of the clipboard
Clone this wiki locally