They don't use inline assembly. They hardcode the preassembled syscall function in a char array, mmap an anonymous write+execute memory page, copy the bytes from the array to the newly mapped page, store the address of the page in a char pointer type punned to a function pointer using union shenanigans to avoid compiler warnings, and call the function through the function pointer (which is obviously nonportable, but presumably valid implementation-defined behavior since it doesn't elicit a warning when compiled with -Wpedantic).
The school could presumably plug this particular hole by locking down mmap and mprotect at the syscall level with seccomp.
The full proof of concept code[1] is in the linked GitHub repo.
[1] https://github.com/mrnossiom/learning-asm/blob/802b8374e24bd...