You can actually view the coding in your medal_data.py file of the game.
# Level 7:
Master Sgt.- (7, 'rank', f_and(
has_rank(6),
f_plus (global_stat ('scor'), player_score ('score'), 20000))),
First Sgt.- (Notice how it checks for those medals) (8, 'rank', f_and(
has_rank(6),
f_plus (global_stat ('scor'), player_score ('score'), 20000),
has_medal('1031406_1'), #knife
has_medal('1031619_1'), #pistol
has_medal('1031119_1'), #assault
has_medal('1031120_1'), #AT
has_medal('1031109_1'), #Sniper
has_medal('1031115_1'), #spec op
has_medal('1031121_1'), #Support
has_medal('1031105_1'), #Eng
has_medal('1031113_1') #medic
)),
# Level 8:
Master Gunnery- (9, 'rank', f_and(
f_or(has_rank(7), has_rank(8)),
f_plus (global_stat ('scor'), player_score ('score'), 50000))),
Sgt. Major- (10,'rank', f_and(
f_or(has_rank(7), has_rank(8)),
f_plus (global_stat ('scor'), player_score ('score'), 50000),
has_medal('1220118_1'), # armour
has_medal('1222016_1'), # transport
has_medal('1220803_1'), # helicopter
has_medal('1220122_1'), # aviator
has_medal('1220104_1'), # Air defence
has_medal('1031923_1') # Ground Defence
)),
So, before it gives you Sgt. Major it will check to first make sure you have either Master Sgt. or First Sgt and 50000 points. Then, it will check to make sure you have the armor, transport, heli, plane, air defense and ground defense badges.