It depends on the latest policy of your school. Generally, if you fail the exam, you need to apply for an extension of graduation, and then take the exam again according to the arrangement of the school. This is an idealized result. Since the college entrance examination will be cancelled next year, you'd better pay attention to your school policy now or communicate directly with the instructor or the academic affairs office. As for spending money to do things, your school is not very clear, but it is difficult to modify the general grades as long as they are entered into the system. If you can do it with very little money, you'd better not postpone graduation.
I hope I can help you!