I have been trying to create an PHP ACE_gapfill example. I have read through the other ACE_gapfill examples and it seems that the key is doing some json decoding on {{ STUDENT_ANSWER }} within the template, but I cannot work out the exact details. Can anyone give me a clue?
I'm not sure what examples you've looked at, but the python3_gapfiller_demo example in the Ace Gapfiller UI section on this site would be the best starting point. You should be able to switch it to run PHP instead by making just a couple of changes:
- In the run_one_test function, change the file you write to prog.php instead of prog.py and in the subsequence subprocess.run call, change the command to ["php", "prog.php"]
- In the Advanced customisation section change the Ace language to php.
Post back if that doesn't work.