I have got a problem very similar to Loop within STACK question in moodle using jsxgraph. That is, I tried to just copy the source code for the star shape in ITEMS: JSXGraph