What I think is being tested here is your understanding as to how (with avoir) the past participle needs to concur with the previous direct object placed before the verb.
La lettre is the direct object appearing before écrire so the past participle écrit becomes écrite to reflect the feminine direct object La lettre.
Just to expand a little -- had more than one letter been written then the construction involving que would have required the past participle to be written
Hope this helps.
La lettre que j'ai écrite
Sign in to submit your answer
Don't have an account yet? Join today
Test your French to the CEFR standard