A strange thing happened with a simple check on a FSM graph: students are not allowed to drag edge labels or the default Python template will fail with error:
***Error*** Traceback (most recent call last): File "__tester__.python3", line 23, in <module> for id0, id1, edge_label in graph_rep['edges']: ValueError: too many values to unpack (expected 3)
Is there a way to fix this? "Validate on Save" also fails if the answer box has edge labels with non-default Z-Y values.
Thanks for pointing out this bug (a regression introduced in V3.7.9).
The fix is to change the line
for id0, id1, edge_label in graph_rep['edges']:
for id0, id1, edge_label, *loc in graph_rep['edges']:
BUILT_IN_PROTOTYPE_undirected_graph. You need to have Moodle admin rights to edit those prototypes, which are in the CR_PROTOTYPES category at the system level in the question bank.
Alternatively you can customise the question or define your own derived question type with the same fix.
I've pushed the fix to github and it will appear in the next version released to the Moodle question type repository.