Is there a way to restrict editing attendance once it is marked? We do not want teachers to go back and change attendance which is already marked.
yes - there are 2 capabilities that control this (both are given to the editingteacher role by default)
mod/attendance:takeattendances - this allows the initial attendance to be taken
mod/attendance:changeattendances - this allows the attendance to be updated after it is initially taken.
You could remove the "mod/attendance:changeattendances" capability from your editingteacher role which would prevent them from being able to do this.
I haven't tested this myself though - it's functionality that was built into the attendance plugin before I took over maintenance. Let us know here if you find it works for you.