Skip to content

fb_system()

mkraska edited this page Nov 21, 2024 · 4 revisions

[txt, OK]: fb_system(names, sys, env, hint)

  • names list from the names input field
  • sys list of indices of elements which belong to the system (to be active)
  • env list of indices of elements which belong to the environment and have to be deactivated and replaced by reactions
  • hint text, problem-specific hint if the system boundaries aren't correct.

Templates

Question variables: Define the lists

i_sys: [....];
i_env: [....];

Question text

[[feedback:System]]

Feedback variables

obj: stackjson_parse(objects);
[txt, OK]: fb_system(names, i_sys, i_env, "");

Feedback:

Field Value
sans OK
tans true
feedback true {@txt@}
feedback false {@txt@}

Activation/Deactivation

names[n]="show" is true if element with index n is activated and false if not.

This can be used to check if all supports or distributed loads are de-activated.

The following snippet from the Feedback variables sets OK to true if the object with number i_beam are activated and the objects i_S1, i_S2 and i_S3 are not.

i_beam: 2; i_S1: 5; i_S2: 6; i_S3: 7; 
OK: is(
  names[i_S1]   # "show" and 
  names[i_S2]   # "show" and 
  names[i_S3]   # "show" and 
  names[i_beam] = "show");
txt: if OK then " Die Systemgrenzen stimmen." 
  else " Die Systemgrenzen stimmen nicht. Nur der Balken gehört zum System. Mindestens die Stäbe müssen entfernt (deaktiviert) werden.";

Use AlgEquiv question test with OK as sans and true as tans.

In both branches, say

{@txt@}

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