FBD Generic Validation Feedback - mkraska/meclib GitHub Wiki
(conceptual test, use the more specific tests in Feedback for Free Body Diagrams)
This feedback is to indicate the recognized replacement relations in free body diagrams. All de-activated objects are checked for forces or moments close to them.
In order to identify the replaced items for the user, a list of textual descriptions has to be provided.
Loads (forces and moments) are tested against proximity to de-activated targets (supports, connectors, other system elements).
Forces are tested for proximity of start and end points, moments are tested for proximity of the center point.
Here we define the description list by copying the initdata and replacing the required entries( objects with "hide" or "show" state)
/* iMecLib objects */
pA: [0,0]; pB: [3,0]; pC: [5, -1];
initdata: [
[ "grid", "", "", -1.5, 6.5, -2.5, 4, 40],
[ "forceGen", "F_1", [-0.5,3.5]],
[ "momentGen", "M_1", [1.5,3.5]],
[ "beam", "", pA, pB, 0.15],
[ "bar", "", pB, pC, "show" ],
[ "fix12", "A", pA, 0, "show" ],
[ "fix12", "C", pC, 0, "show" ],
[ "label", "\\(B\\)", pB+[-0.2,-0.5] ],
[ "q", "", "q_0", pA+[0,0.3], pB+[0,0.3], 0.7,0.7,0, "show"]
];
init: stackjson_stringify(float(initdata));
description: initdata;
description[5]: "Stab BC";
description[6]: "Festlager bei A";
description[7]: "Festlager bei C";
description[9]: "Streckenlast zwischen A und B";
Feedback variables
text:"";
for i:1 thru length(names) do
if is( listp(names[i]) ) then (
text: sconcat(text, "<li>", description[i], " durch "),
for j:1 thru length(names[i]) do
text: sconcat(text, "\\(", ssubst("\\;", "*", string(names[ names[i][j]+1 ])), "\\), "),
text: sconcat(substring(text,1,slength(text)-1), "</li>" ));
if is(slength(text)=0) then text: "Es wurden keine Elemente ersetzt." else
text: sconcat("Ersetzungen: <ul> ", text, "</ul>" ) ;
PRT feedback style: Formative
Answer test: AlgebraicEquivalence, SAns:1, TAns:1
true feedback: {@text@}