The European Union Aviation Safety Agency (EASA) drafts and maintains the EU drone rules. It is EASA that publishes the consolidated Easy Access Rules for UAS — the regulations, acceptable means of compliance (AMC) and guidance material (GM) in one document — along with further explanatory material.
EASA writes the rules but does not enforce them on the ground: that is done by the national aviation authorities, in Latvia the Civil Aviation Agency (CAA). So the legal basis behind every exam question comes from EASA documents, while registration and exams happen at the CAA.