you can get all the data with the Moodle API (or with some queries)
$modinfo = get_fast_modinfo($course); $cm = $modinfo->get_cm($cmid);
To keep it uptodate even after a section or an activity is added or removed. You can do it with ajax .
I mean each time the user click on a drop down you call the Moodle api by an ajax call and fill the drop down again.
(with jquery is easy. But don't forget the security)
Hope it's help.