On direct representations of quasi-injectives and quasi-projectives