I asked my friend whether the direct and indirect quote (that I wrote above) had the same meaning, and whether I’d need the quotation marks in the direct quote.
Here is her answer:
You need to put quotation marks, like「勉強しなさい」と言われた。勉強するように言われた is, someone told you to study, but you don’t know how he or she said it, so it’s an indirect expression. Maybe very strict, or maybe very soft, so it’s almost the same as “「勉強しなさい」と言われた”, but not exactly the same, I think.
So you were right about the quotation marks, thanks for pointing that out!