Here is the item again:
Once class was over,
(A) Maria
used to meet her lab partner Chris at the diner near
campus (B)
until she discovered that Chris
preferred,
(C) to flirt
with the waitresses instead of discussing the chemistry homework.
You realized that the comma after preferred is wrong. To flirt with the waitresses ... is an infinitive phrase. When you attach an infinitive phrase to the end of a sentence, you need no punctuation.
To fix this problem, you chose to do this:
Once class was over, Maria used to meet her
lab partner Chris at the diner near campus until she discovered that Chris
preferred to flirt with the waitresses instead
of discussing the chemistry homework.
You have correctly employed Punctuation Rule 5:
Main Clause + Ø + Infinitive Phrase.
Excellent choice!