I am a math teacher and would like to personalize math tests to prevent excessive copying
Is there a way to use field variables within formulas?
Thanks for help,
Walter.
Code: Select all
int from -5 to 10 {{x^b} over {1-x^a} dx} =Code: Select all
Sub my_ModifyEquation
dim oDoc as object
dim My_math as object
dim My_formula, a_str, b_str as string
odoc = Thiscomponent
'define the range of constants (a and b) and convert them to string format
a_str = CStr(Int((5 * Rnd)+2))
b_str = CStr(Int((5 * Rnd)+2))
'set the formula string:
My_formula = "int from -5 to 10 {{x^" & b_str & "} over {1-x^" & a_str & "} dx} ={}"
My_Math = oDoc.EmbeddedObjects.GetByName("Object1")
My_Math.model.formula = My_formula
end sub