Learning Math Reasoning from Self-Sampled Correct and Partially-Correct Solutions