Learning mathematics in different mastery environments