This means final fantasy tactics itself, right? Final fantasy tactics advance and advance 2 are completely different games that the original. Share the same world according to the lore but the setting is way different.
I don't think I ever played the advanced ones. Tactics 2 is the one with the book and the kid in detention and the ending is basically it was all dream.
The one with the kid in detention is Final Fantasy Tactics A2: Grimoire of the Rift. It's the sequel (in gameplay style) to Final Fantasy Tactics Advance, but it was shortened to "A2" because it didn't actually come out on the GBA.
That's Final Fantasy Tactics Advanc for GBA. It has a sequel too. The original Final Fantasy Tactics didn't have a proper sequel. It was rereleased for PSP as Final Fantasy Tactics War of the Lions, which optimised some elements and added voiced and animated cut scenes. It removed the incantations for magic though.
EDIT: Detention is probably the A2 as ryven mentioned. Advance started with a snowball fight where one kid was bullied.