Make a Math Competition Grader
Pyth, 53 51

?&amp;!-sJ.z+d&lt;G5&amp;FqR30lMJ+sm?qFd4_1CJ/eJd"Invalid test


Try it online

The checks are done by seeing if the entire input contains any characters when all of the spaces and a-e are removed, and by checking if both strings have length 30.

The score calculation is done by zipping the two lines together, then by mapping each pair to: (letters are equal) ? 4 : -1. Then simply summing the values, and adding the number of spaces in the second line back to the score.