Here's why:
* Direct Object: The direct object is the thing being acted upon. In this case, it's the "letter" because Gena is writing it.
* Indirect Object: The indirect object is the recipient of the direct object. Gena is writing the letter *for* her boyfriend, making him the indirect object.
You can also test this by rephrasing the sentence: "Gena was writing a letter *to* her boyfriend during English class." This makes the indirect object more explicit.