Actually can you help we with the steps on this?
You mean explain the formulae? Sure!
The IF statement says ignore this row if the ID is "Teacher" or null (as we don't want to highlight Teacher or empty rows).
The AGGREGATE(15,6 is a multipurpose function but the 15 option invokes the SMALL function, 6 means ignore errors within the function and the ",1)" at the end says we're looking for the SMALLest but in fact we only want the first.
The "ROW($A$2:$A$9999)-ROW($A$1)" says we're not looking for the SMALLest number but we're going through rows 2 to 9999 minus 1. This is then divided by the rest of the formula. If the rest of the formula is TRUE (logical 1) then whatever row number we're at is divided by the logical 1 and we get the row number returned, which is treated as a TRUE by the Conditional Format and it gets highlit.
The comparisons to the right of the divide sign are multiplied together so only if all are logical 1 will a logical 1 be returned. If any are logical 0 then that generates a zero, which when divided into the current row of AGGREGATE generates a #DIV/0! error, but our "6" option ignores it.
Let's look at an example of cell D7.
"carrott" isn't "Teacher" or null so the IF falls into the AGGREGATE.
The comparison logic in the Conditional Format will be (($A$2:$A$9999=A7)*($B$2:$B$9999=B7)*($C$2:$C$9999="Teacher")*($D$2:$D$9999<>D7)) so it's checking for column A=1, column B=3, column C="Teacher" and column D<> (not equal) to "carrott" so it find row 4 with 1, 3, "Teacher" and "carrot" is indeed not equal to "carrott" so all are true, so 1*1*1*1=1 which divided into the row we're looking at returns a 3. Conditional Formatting treats that number as a TRUE and "carrott" is highlit.
If no rows satisfy the checks then AGGREGATE returns a #NUM error which is treated by Conditional Formatting as a FALSE so it is not highlit.
The "Answer Doc 2" column E is the same thing with slight column reference changes.
You can check the Conditional Format formulae by actually entering them into some columns. You'll se a FALSE if it satisfies the IF statement, a #NUM if the student answer is correct (i.e. the Teacher answer is equal to the student answer) or the row number of the Teacher answer if it did not match the student answer.