                     ; Update select2 box.
                     ; NOTE: This does a quadratic amount of work but I do not
                     ;       have a workaround.
-                    (select2/select2-box-set-val
-                      select2/$Select2-Box
-                      (get-selected-module-codes-as-js-array))))
+                    (select2-box-update-modules)))
 
               ; Only lesson types with more than 1 option of lesson group
               ; will be draggable

  "Appends a module to `ModulesSelectedOrder`"
  [moduleCode]
  (set! ModulesSelectedOrder (conj ModulesSelectedOrder moduleCode)))

(def ^{:doc     "Converts a short form lesson type string to its long form"
       :private true}

  (timetable-create!)
  (set! ModulesSelected {})
  (set! ModulesSelectedOrder [])
  (select2-box-update-modules)
  (set-document-location-hash! ""))
