The total work done is
$$W = \int_\gamma \vec F \cdot d \vec r $$
where $d\vec r$ is the infinitesimal, tangential line element along some path $\gamma$.
We need to figure out the path we'd like to take, and the associated parameterization we would like to use. One possible choice (which mirrors what your instructor used) is the following:
$$\vec r(t) = \langle x(t),y(t) \rangle = \langle t,0\rangle \\ t\in [0,5]$$
so
$$ \vec F = \langle 3x(t),4y(t)\rangle = \langle 3t,0\rangle$$
$$ d \vec r = \langle 1, 0 \rangle dt$$
and the integral becomes
$$\int_0^5 3t \ dt = \left.\frac{3}{2}t^2\right|^5_0 = \frac{75}{2}$$
Your instructor chose to parameterize the path by one of its coordinates. That's a perfectly good choice for that particular path, but it isn't always possible to do this - in particular, if the path has a squiggle or a loop such that it no longer passes the so-called "vertical line test", you can't use the $x$ coordinate as a valid parameter. Similarly, if the path doesn't pass the "horizontal line test", then you can't use the $y$ coordinate as a valid parameter. I like to use a totally separate parameter $t$ which circumvents these issues and makes the parameterization clearer.
For a bit of enrichment, notice that we could have chosen a totally different path. What if we picked a crazy, loopy path like this?
$$\vec r(t) = \langle t+\cos(2\pi t)-1,\sin(2\pi t)\rangle \\ t \in [0,5]$$
Notice that this beast does not pass the horizontal or vertical line tests, so I certainly cannot parameterize this path by $x$ or $y$. However, I can use my parameter $t$ and everything works out just as before. It's a bit messy, but if you work it out you'll find that you get the same answer as before, and for good reason.
An arbitrary line integral needs to be equipped with a path along which the integration is taking place. However, for a special class of integrands, the value of the integral is independent of the path chosen. This is true whenever $\vec F$ can be written as the gradient of a scalar function,
$$ \vec F = -\nabla U$$
where the minus sign is just a convention commonly used in physics. In such cases, $\vec F$ is called a conservative vector field, and
$$ \int_A^B \vec F \cdot d \vec r = U(A)-U(B)$$
regardless of the path chosen. For your $\vec F$, we could pick
$$U=-\frac{3}{2}x^2 - 2y^2$$
You can check to see that this yields the correct answer. When $\vec F$ is interpreted as a force, we call an associated function $U$ a potential energy function corresponding to that force.
But once again, vector fields are not generally conservative. When they are not, a line integral is not even defined until you've chosen a path (though you can parameterize that path in essentially whatever way you choose).