Proton Scattering by partonic Photon interaction In my experimental introductory course about Particle-Physics we discussed the deep inelastic scattering of an electron with a proton, where the electron interacts with a parton within the proton by electromagnetic interaction (by "exchanging" a photon).
I am recently studying a process where the parton which is interacting is a photon, so I assumed the photon can't be "real" or on-shell, since inside the proton it is a virtual particle (which I understand as it being off-shell). So I thought that $Q^2 = -q^2 \neq 0$. Now my professor said that the photon is on-shell but the $Q^2$ is not vanishing, which to me is confusing since if the photon is on-shell the square of its four-momentum should vanish. Furthermore he said $Q^2$ is more of a scale variable.
Can someone elaborate on this?
To be more precise, since I might not understand the meaning of $Q^2$ yet, can somebody explain the meaning of this quantity? And why should that partonic photon be on-shell?
 A: One calculates interactions in elementary particles using Feynman diagrams, which have strict one to one correspondence with mathematical integrals.

this is a simple diagram but  the concepts hold for all.
The solid lines describe real particles,i.e. on mass shell. The exchanged line is a virtual photon in this case. The integral is defined by the incoming energy and momentum.
The four vector of the exchanged particle is off mass shell because it is within the variable limits of an integration.

the parton which is interacting is a photon, so i assumed the photon cant be "real" or on-shell, since inside the proton it is a virtual particle

assumption wrong , the photon interacting with the proton does not see the proton, by construction of the model its energy should be enough to distinguish the indivitual partons. It has to be one of the real incoming particles, and is similar to Compton scattering except the photon hits a charged parton and not an electron.

in this diagram the virtual particle is an electron, i.e. it is off mass shell within the integral.
As you do not give a link for the Q variable you are asking about I suppose it is the variable over which the integration happens , and which is in the propagator of the virtual particle, see this for example.
A: The electron in the beam with $k^{\mu}$ four-momentum scatters into a detector with $k'^{\mu}$ four-momentum, the associated virtual photon has four-momentum:
$$ q^{\mu} = k^{\mu} - k'^{\mu} = (E, 0, 0, E) - (E', E'\sin{\theta}, 0, E'\cos{\theta} )$$
where the electron energies $E$ and $E'$ are much greater than $m_ec^2$ and $\theta$ is the lab angle.
Note that:
$$ q^2 = (E-E')^2 -E'^2\sin^2\theta -(E-E'\cos\theta)^2=-4EE'\sin^2{\frac{\theta} 2} < 0$$
so the virtual photon is always space-like, and we use:
$$Q^2 \equiv -q^2 > 0$$
to discuss the (invariant) four momentum transfer.
There is a reference frame, called the Brett-Frame or brick-wall frame, in which no energy is transferred ($E_{BF}=E_{BF}'$). Here:
$$ q_{BF}^{\mu} = (0, \vec q)$$
which probes length scales of $|| \vec q|| = (Q^2)^{\frac 1 2}$.
I do not know how that virtual photon would couple to a real photon, or how a real photon exists in the Parton model. In the reaction:
$$ p(e, e'\gamma)X $$
I would consider it a radiative correction to $ p(e, e')X $.
