A university student completed courses worth 3 credits and some courses worth 4 credits. The student earned a total of 54 credits after completing 15 courses. How many courses worth 4 credits did the student complete?

9
6
20
32

Let's say the student completed x courses worth 3 credits.

Therefore, the number of courses worth 4 credits that the student completed is 15 - x.
The total number of credits earned from the courses worth 3 credits is 3x.
The total number of credits earned from the courses worth 4 credits is 4(15 - x).
The total number of credits earned from all the courses is 3x + 4(15 - x) = 54.
Expanding the equation, we get 3x + 60 - 4x = 54.
Combining like terms, we get -x + 60 = 54.
Subtracting 60 from both sides, we get -x = 54 - 60.
Simplifying the right side, we get -x = -6.
Dividing both sides by -1, we get x = 6.
Therefore, the student completed 6 courses worth 4 credits. Answer: \boxed{6}.