

I would argue that, without the punctuation, it’s not technically correct. The references to James and John saying “had had,” at least, should be in quotes. Additionally, unless broken up with a semicolon or a period before the final four “hads,” it’s a run-on sentence.
If you change the “hads” that mean provided/said in the context of the sentence (excluding the quoted ones), you could write it as:
James, while John had [said] “had”, had [said] “had had”; “had had” had [provided] a better effect on the teacher.
And though it doesn’t flow right to me to have James and his action verb split by a phrase about John, I’m not sure that’s incorrect. Phrasing it to fix the flow, for me, would be:
While John had [said] “had”, James had [said] “had had”; “had had” had [provided] a better effect on the teacher.






Pretending to choke on Trump’s tiny penis whenever the press sec isn’t doing it. Also pretending to be the Attorney General, but I don’t think she’s doing as good a job at that.