Ok, in a concrete case with three students ordered with probabilities of passing of $p_1 = 0.1, p_2 = 0.5$ and $p_3 = 0.2$ together with times of $T_1 = 3$, $T_2 = 7$ and $T_3 = 9$, then the expected total time by similar logic is
$$E[t] = Pr(\text{ Student #1 fails })T_1 + Pr(\text{ Student #1 passes but #2 fails })(T_1 + T_2) $$ $$+ Pr(\text{ Students #1 and #2 pass })(T_1 + T_2 + T_3) $$ $$ = (1-p_1)T_1 + p_1(1-p_2)(T_1 + T_2) + p_1p_2(T_1 + T_2 + T_3)$$ $$ = \ ...$$