Choose the most grammatically correct sentence:

A. Students will be subjected to continuous comprehensive evaluation instead of having to write exams, while those who want to switch schools can test them by taking an optional online test.

B. Students will be subjected to continuous comprehensive evaluation instead of their having to write exams, while those who want to switch schools can test themselves by taking an optional online test.

C. Students will be subjected to continuous comprehensive evaluation instead of written exams, while those who want to switch schools can test them by giving an optional online test.

D. Students will be subject to continuous comprehensive evaluation instead of having to write exams, while those who want to switch schools can test themselves by taking an optional online test.

E. Students will be subjected to continuous comprehensive evaluation instead of written exams, while those who want to switch schools can test themselves by taking an optional online test.