Factors associated with educational quality at primary level