A judiciary spokesman says the judge , Massoud Moghaddasi , was shot Tuesday while he was leaving his office in Tehran .