Moodle's Median of Grades aggregation method takes the middle grade (or the mean of the two middle grades) when grades are arranged in order from least to greatest. Look at the formula to see the actual arithmetic employed.
Grade 1: 18/20 = 90%
Grade 2: 70/100 = 70%
Grade 3: 5/10 = 50%
Total grade equals = 50%, 70%, 90% = 70% or 70/100