# Inverse operation instead of solution

Is it possible to adapt this code by Kurt Salisbury for repeated practice solving 1-step equations into repeated practice using inverse operations? I know that is a very broad question, but if some one can help me start with the initial code, I can make it work for all… like
if expVis1 = “x+{r1}={min}”, then value = numericValue(-{r1}) if expVis3 = "{r1}x={min}", then value = numericValue(\\div{r1})

in = input1

r = randomGenerator(firstDefinedValue(in.submitCount))
r1 = r.int(1,10)
r2 = r.int(-10,-1)
r3 = r.int(1,10)
r4 = r.int(1,10)
r5 = r.int(-10,-1)
r6 = r.int(-10,-1)
min = r.int(10,100)
sub = r.int(2,8)
exp = r.int(2,4)
div = numericValue("{sub}*{r4}")
express = r.int(1,9)

expression =
when express = 1 exp1
when express = 2 exp2
when express = 3 exp3
when express = 4 exp4
when express = 5 exp5
when express = 6 exp6
when express = 7 exp7
when express = 8 exp8
otherwise exp9

expressVis =
when express = 1 expVis1
when express = 2 expVis2
when express = 3 expVis3
when express = 4 expVis4
when express = 5 expVis5
when express = 6 expVis6
when express = 7 expVis7
when express = 8 expVis8
otherwise expVis9

exp1 = “{{min}-{r1}}”
exp2 = “{{min}-{r2}}”
exp3 = “{{min}/{r1}}”
exp4 = “{{min}/{r2}}”
exp5 = “{{min}+{r1}}”
exp6 = “{-{min}/{r1}}”
exp7 = “{-{min}/{r2}}”
exp8 = “{{sub}*{r1}}”
exp9 = “{{sub}*{r2}}”

expVis1 = “x+{r1}={min}”
expVis2 = “{r2}+x={min}”
expVis3 = “{r1}x={min}”
expVis4 = “{r2}x={min}”
expVis5 = “x-{r1}={min}”
expVis6 = “{r1}x=-{min}”
expVis7 = “{r2}x=-{min}”
expVis8 = “x\div\${r1}={sub}" expVis9 = "x\\div{r2}=\${sub}”

value = numericValue(expression)
content:
when in.timeSinceSubmit() > 0 “{result}\n\n\Click to try another." otherwise "What will you do to both sides of this equation to isolate x?\n\n\`{expressVis}`”

result = when in.lastValue(“correct”) = 1 “\n\Question: `\${question}`\n\n\Solution: `\${in.lastValue("value")}`\n\n\Correct! ” otherwise “\n\Question: `\${question}`\n\n\Solution: `\${in.lastValue("value")}`\n\n\Incorrect. 