-
Notifications
You must be signed in to change notification settings - Fork 3
fb_HAG
mkraska edited this page Apr 9, 2022
·
1 revision
fb_HAG(H, A, G)
-
H
hypothenuse -
A
,G
kathetes
Returns a string with feedback text, to be displayed in a feedback branch, where the variables have been checked already using fb_vars.
The values are displayed using float()
and any stars *
are replaced by small spaces. It is not recommended to have more than one symbolic variable in the expressions. This variable must have a declared sign (e.g. assume(a>0)
).
fb_HAG(%_H, %_A, %_G):=block([fpprintprec:3,txt:""],
if %_H <= max(%_G, %_A) then txt: sconcat(
" Die Hypotenuse (\\(", float(%_H),
"\\)) muss größer als die größte der beiden Katheten (\\(",
float(%_A), ", ", float(%_G),"\\)) sein."),
if %_H >= %_G+%_A then txt: sconcat(
" Die Hypotenuse (\\(", float(%_H),
"\\)) muss kleiner als die Summe der beiden Katheten (\\(",
float(%_A), "+", float(%_G),"=",float(%_G+%_A),"\\)) sein."),
ssubst("\\,", "*", txt)
);
If you don't need the result of the test elsewhere, then you just put the function call where you want the feedback.
{@fb_HAG(H, A, G)@}
In order to try code snippets in jsfiddle,
- copy the code from the wiki page to the clipboard
- follow the link for the JSXGraph version you want to try
- Replace the code in the HTML section (contents of
<p hidden id="init">
) with the content of the clipboard