Chris Ching explains that starting at timestamp 3:50 in the lesson.
If you are not understanding that then I recommend you go back and watch that lesson again.
Each question generally has 4 possible answers and only one of them is correct. The first thing the user does is choose which answer they think is correct and when that occurs the code stores that as the selectedIndex. It then redraws the view and goes through the array of questions and changes the style of each question to reflect which one the user has selected. It sets the foreground color for the one that is selected to gray because in that case the index is in fact the same as the selectedIndex and the others to white because in each of those cases, the index is not the same as the selectedIndex.
We can read this in plain English as:
"Show a RectangleCard here for each possible answer to the question above, and its colour depends on whether it is the selected answer or not. If it is the selected answer, show a RactangleCard with a gray colour; otherwise, show a RectangleCard with a white colour.
If you need to know what the code does when broken down into smaller parts, I would suggest you read @Chris_Parker answer above, as he did a very good job explaining what a ternary operator does.