To start with I would talk to the teacher, asking why certain solutions are not accepted.
For the inequality
$$x^2-5x+6 <0\tag{1}$$
it is easier to factorise $x^2-5x+6$ first. That is we look for two numbers $A$ and $B$ such that $x^2-5x+6=A\cdot B$, because solving
$$A\cdot B <0\tag{2}$$
is easy: (2) can only happen when both $A<0$ and $B>0$, or both $A>0$ and $B<0$.
Now, to factorise $x^2-5x+6$ we first complete the square
\begin{eqnarray}x^2-5x+6& =& \left(x - \frac{5}{2}\right)^2 -\left(\frac{5}{2}\right)^2+6\\
&=& \left(x - \frac{5}{2}\right)^2 -\frac{25}{4}+6\\
&=& \left(x - \frac{5}{2}\right)^2 -\frac{25}{4}+\frac{6\cdot4}{4}\\
&=& \left(x - \frac{5}{2}\right)^2 -\frac{25}{4}+\frac{24}{4}
&=& \left(x - \frac{5}{2}\right)^2 -\frac{1}{4}
\end{eqnarray}
and use the conjugation rule $a^2-b^2 = (a+b)(a-b)$, so that
\begin{eqnarray}
x^2-5x+6 &=& \left(x - \frac{5}{2}\right)^2 -\frac{1}{4} \\&=& \left(x - \frac{5}{2} +\frac12\right)\left(x - \frac{5}{2} -\frac12\right)\\
&=& \left(x - 2\right)\left(x - 3\right)
\end{eqnarray}
Now, for (1) we get the inequalities (or rather system of inequalities)
$$\left(x - 2\right)<0 \text{ and }\left(x - 3\right)>0\tag{3}$$
and
$$\left(x - 2\right)>0 \text{ and }\left(x - 3\right)<0\tag{4}$$
which are linear and can be "solved using number line" (or by the algebraic method of adding a number to both sides of the inequalities).
Note that (3) has no solution, while (4) is the line segment you found.