MDL-40096 assign: Prevent js error because uniqid() is not unique.
MDL-40096 assign: Prevent js error because uniqid() is not unique.

Use html_writer::random_id instead because it incorporates a static counter.

dilawar/moodle