Skip to content

Instantly share code, notes, and snippets.

@BillFoster
Created August 13, 2011 10:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save BillFoster/1143713 to your computer and use it in GitHub Desktop.
Save BillFoster/1143713 to your computer and use it in GitHub Desktop.
Complex numbers and display/simplification
{
name: testcom
questions: [
{
name: Complex Test
statement: """Express the following in the form $a+bi$ where $a$ and $b$ are real. """
variables: {
a4: "s4*random(1..9)"
b4: "s1*random(1..9)"
a5: "s4*random(1..9)"
b5: "s1*random(1..9)"
s4: "random(1,-1)"
s1: "random(1,-1)"
}
parts:[
{
type: GapFill
prompt: """$\simplify{({a4}+{b4}*i)/({a5}+{b5}*i)}$=[[0]]."""
gaps: [
{type: jme
answer: "({a4+b4*i})/({a5+b5*i})"
answersimplification:"1111111111111111"
marks: 1
checkingType: AbsDiff
}
]
}
]
}
]
}
@BillFoster
Copy link
Author

Switch the collectNumbers (7th switch) off and one and reveal answer in both cases. Clearly a problem when switched off. Also as 16th bit is switched on was expecting fraction display.

@christianp
Copy link

I'm confused. Why isn't this using the new syntax?

@BillFoster
Copy link
Author

Don't know! Seems to be a problem with the answer display only in this particular mode for complex numbers in the answer ({a4+b4_i})/({a5+b5_i}).
In the main body (prompt and statement) all is displayed correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment