-
Notifications
You must be signed in to change notification settings - Fork 3
fb_name
mkraska edited this page Feb 19, 2024
·
3 revisions
-
OK
boolean variable indicating pass of the test -
text
feedback text in case that the test is not passed. -
n
the meclibnames
list -
i
index of the object, which is replaced by the reaction -
lon
list of allowed names
If there are multiple reactions at object i
the first one is checked.
fb_name(n,i,lon):=block([name,txt],
name: none,
if listp(n[i]) then
if not emptyp(n[i]) then name: n[n[i][1]],
if member(name,lon) then return( ["",true]) else return([castext("\\({@name@} \\) ist kein passender Name für die Lagerreaktion."), false])
);
Usage example: The reaction at object with index i_SB
is checked. The only correct name is B
.
obj: stackjson_parse(objects);
[text, isOK]: fb_unidir(obj, names, i_SB, "Pendelstütze B: ");
[textn, isOKn]: fb_name(names,i_SB,[B]);
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