Constructions of optimal variable-weight OOCs via quadratic residues