Skip to content

Instantly share code, notes, and snippets.

@knowuh
Created July 10, 2012 14:56
Show Gist options
  • Select an option

  • Save knowuh/3083844 to your computer and use it in GitHub Desktop.

Select an option

Save knowuh/3083844 to your computer and use it in GitHub Desktop.
converter tool branching error?
"steps": [
{
"url": "/shared/activity-with-a-line-construction-tool/page/1-this-is-the-first-page/step/1",
"activityPage": "/shared/activity-with-a-line-construction-tool/page/1-this-is-the-first-page",
"beforeText": "Construct a line with y-interept 0.0, with slope 1.0",
"...":"...",
"submitButtonTitle": "Check My Answer",
"defaultBranch": "/shared/activity-with-a-line-construction-tool/page/1-this-is-the-first-page/step/5",
"...":"...",
"responseBranches": [
{
"criterion": [
"and",
[
"withinAbsTolerance",
1,
[
"lineSlope",
"freehand-sketch-1",
"1"
],
0.1
],
[
"withinAbsTolerance",
0,
[
"yIntercept",
"freehand-sketch-1",
"1"
],
0.1
]
],
"step": "/shared/activity-with-a-line-construction-tool/page/1-this-is-the-first-page/step/2"
},
"...":"..." }]
},
{
"url": "/shared/activity-with-a-line-construction-tool/page/1-this-is-the-first-page/step/2",
"activityPage": "/shared/activity-with-a-line-construction-tool/page/1-this-is-the-first-page",
"beforeText": "<b>Incorrect. Try again.</b><p>Construct a line with y-interept 0.0, with slope 1.0</p>",
"...":"..."
}]
@knowuh

knowuh commented Jul 10, 2012

Copy link
Copy Markdown
Author

It seems like all of the response branches need a "not" operator on them. For example in the gist above:

I would expect if:
( withinAbsTolerance (1, ('lineslope', 'freehand-sketch-1', '1'), 0.1) && withinAbsTolerance (0,('yIntercept', 'freehand-sketch-1', '1'), 0.1))

Evaluated to true, we would go the correct page. But instead we go to the 'everything wrong' page...

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