You get medals by completing any level in less than a certain number of deaths. From memory, it's something like no deaths for platinum, one death for gold, 2-5 for silver and 5-10 for bronze. Better medals are worth more points at the end too...
Try this bug out... Go on keyboard mode, set three balls, begin, right click, press play, the balls stay. Repeat to get more than 3 balls. No, this does not give you more points, it just makes it MUCH harder...