Breaking a spaghetti in a weird random way

Choose p (by sliding P) and q (slider) between 0 and 1. Then break the spaghetti in M and N either randomly (button) or by sliding the points but M is in [0,p] and N at most in fraction q of the remaining segment [MI]. The pink zone shows the possible area to make a triangle with sides red, blue, green.

From James Tanton

To answer James Tanton's problem put M on P and N on P'.