$\textsf{Neuer Rauminhalt}$

$\textsf{Zeige Umrechnung}$

Neustart

\textsf{100}

\textsf{10}

\textsf{10}

\textsf{10}

questionCount = 1 (slider from 0 to 20, step 1)
units: {"hl", "L", "dl", "cl", "ml"}
unitInd = Random(1, Length[units])
header: {"\vphantom{\frac{1}{2}}km", "m", "dm", "cm", "mm"}
row2: {"\vphantom{\large{\frac{1}{2}}}\hspace{4cm}", "\hspace{4cm}", "\hspace{4cm}", "\hspace{4cm}", "\hspace{4cm}"}
allowedPos: {(1.02, 0.1), (2.57, 0.1), (3.47, 0.1), (4.37, 0.1), (5.27, 0.1)}
A = Point(allowedPos)
unit: "" + (units(unitInd)) + ""
a: round(RandomUniform[0, 9.99], 2)
val = If(questionCount ≟ 1, 5, If[questionCount > 1 ∧ unitInd ≟ 1, round(RandomUniform[0, 10], 2), questionCount > 1 ∧ unitInd ≟ 2, round(RandomUniform[0, 10], 1), questionCount > 1 ∧ unitInd ≟ 3, round(RandomUniform[0, 100], 2), questionCount > 1 ∧ unitInd ≟ 4, round(RandomUniform[0, 1000], 1), questionCount > 1 ∧ unitInd ≟ 5, round(RandomUniform[0, 10000], 0)])
text3: "\textsf{" + (LaTeX[NumberSeparationComma[val]]) + "}"
factors: {If[unitInd ≟ 1, 1, unitInd ≟ 2, 1 / 100, unitInd ≟ 3, 1 / 1000, unitInd ≟ 4, 1 / 10000, unitInd ≟ 5, 1 / 100000], If[unitInd ≟ 1, 100, unitInd ≟ 2, 1, unitInd ≟ 3, 1 / 10, unitInd ≟ 4, 1 / 100, unitInd ≟ 5, 1 / 1000], If[unitInd ≟ 1, 1000, unitInd ≟ 2, 10, unitInd ≟ 3, 1, unitInd ≟ 4, 1 / 10, unitInd ≟ 5, 1 / 100], If[unitInd ≟ 1, 10000, unitInd ≟ 2, 100, unitInd ≟ 3, 10, unitInd ≟ 4, 1, unitInd ≟ 5, 1 / 10], If[unitInd ≟ 1, 100000, unitInd ≟ 2, 1000, unitInd ≟ 3, 100, unitInd ≟ 4, 10, unitInd ≟ 5, 1]}
indexCurrentPos = IndexOf(A, allowedPos)
valNew: (val * factors(indexCurrentPos))
b = true
l1: {(1.15, 1.3), (2.7, 1.3), (3.6, 1.3), (4.5, 1.3), (5.4, 1.3)}
l2 = Sequence(Semicircle[l1(i), l1(i + 1)], i, 1, Length[l1] - 1)
dy = 0.56 (slider from -5 to 5, step 0.01)
l3 = Sequence(Text[(("$\textsf{" * If[i ≟ 1, 1000, 10]) * "}$"), Midpoint[l1(i), l1(i + 1)] + (0, dy), true, true, 0], i, 1, Length[l1] - 1)
text5: "\textsf{" + (LaTeX[text3]) + " " + (LaTeX[unit]) + " = " + (LaTeX[NumberSeparationComma[valNew]]) + " " + (LaTeX[units(indexCurrentPos)]) + "}"
Ms = Sequence(Midpoint[l1(i), l1(i + 1)] - (0, 0.4), i, 1, Length[l1] - 1)
l4 = Sequence(CircleArc[Ms(i), l1(i + 1), l1(i)], i, 1, Length[Ms])
text1 = TableText({"\vphantom{\frac{1}{2}}\qquad \quad hl", "\qquad \quad \, L", "dl", "cl", "ml"}, {"\vphantom{\large{\frac{1}{2}}}\hspace{4cm}", "\hspace{4cm}", "\hspace{2cm}", "\hspace{2cm}", "\hspace{2cm}"}, "c_|h")
smallLinesM: {Segment[(0.75, 0), (0.75, 0.3)], Segment[(2.35, 0), (2.35, 0.3)]}
text4 = Text(ReplaceAll[(("\textsf{" * NumberSeparationComma[valNew]) * "}"), ".", ","], A + (0.18, 0.36), true, true, 0)
text6 = Text(text5, (3.1 - (x(Corner[text5, 2]) - x(Corner[text5, 1])) / 2, -0.4), true, true)
rectangleWater: {Polygon[A, A + (0.3, 0), A + (0.3, 0.35), A + (0, 0.35)]}
text2: "\textsf{Es ist ein Gefäß mit einem Rauminhalt von " + (LaTeX[text3 + " " + unit]) + " gegeben.\\
Ziehe das Gefäß und beobachte, was mit dem gegebenen Rauminhalt geschieht.
}"

Tool: NumberSeparationComma
NumberSeparationComma[ <Zahl> ]
Input: inputnumber
Output: outputtext

inputnumber: -1234.5678
inputtext: "" + inputnumber + ""
inputlist = Sequence(Take[inputtext, i, i], i, 1, Length[inputtext])
negativ: First[inputlist] ≟ {"-"}
comma = Defined(IndexOf[".", inputlist])
point = If(comma ≟ true, IndexOf[".", inputlist], Length[inputlist] + 1)
dezimal = Take(inputlist, point + 1)
prepend = Take(inputlist, If[negativ ≟ true, 2, 1], point - 1)
prependsep = Reverse(Join[Sequence[If[Mod[Length[prepend] - 2 - i, 3] ≟ 0, Append[Take[prepend, i, i], " "], Take[prepend, i, i]], i, Length[prepend], 1, -1]])
outputlist = RemoveUndefined(Join[{If[negativ ≟ true, {"-"}], If[First[prependsep] ≟ {" "}, Take[prependsep, 2], prependsep], If[comma ≟ true, Append[",", dezimal]]}])
outputtext = Take(Sum[Zip[f, f, outputlist]], 1)