barrybrown,
I would cancel your "it's broken" support ticket. It's more of a "I didn't understand the proper format because your documentation is lacking."
I created a formula question and obtained it with a GET statement. I wrapped the whole thing in a { "question" : ... } wrapper, removed the quiz_id and id (and assessment_id for good measure, although that may not have been necessary).
When I PUT it back, it lost the formulas.
When I looked at what Canvas sends (with a GET), it has this for the formulas property.
"formulas":[
{
"formula":"w=x-y"
},
{
"formula":"z=2*x+y"
},
{
"formula":"x+y"
}
]
When I look at the information sent to Canvas from the GUI, it has
question[formulas][]: w=x-y
question[formulas][]: z=2*x+y
question[formulas][]: x+y
Notice the difference? The POST/PUT is looking for an array of strings, not an array of objects, which is what the GET returns. With this in mind, I changed my formulas property to be this and it accepted the formulas.
"formulas":[
"w=x-y",
"z=2*x+y",
"x+y"
]
All of that is still wrapped inside the { "question" : ... }
Also, I think you need to send back all of the information for formulas and answers, not just the stuff that needs updating. There is no way for Canvas to know that you just want to update one of the formulas, so it replaces the formulas with the complete contents of the array. The same thing for answers.