       (flash-error "You are not authorized to submit a problem." "/problems"))))
 
 (defn edit-problem [id]
-  (let [{:keys [title user tags description tests]} (get-problem id)]
+  (let [{:keys [title user tags restricted description tests]} (get-problem id)]
     (doseq [[k v] {:prob-id id
                    :author user
                    :title title
                    :tags (s/join " " tags)
+                   :restricted (s/join " " restricted)
                    :description description
                    :tests (s/join "\n" tests)}]
       (session/flash-put! k v))

  (GET "/problems" [] (problem-page))
  (GET "/problem/:id" [id] (code-box id))
  (GET "/problems/submit" [] (problem-submission-page))
  (POST "/problems/submit" [prob-id author title tags description code]
    (create-problem title tags description code (when (not= "" prob-id) (Integer. prob-id)) author))
  (GET "/problems/unapproved" [] (unapproved-problems))
  (POST "/problem/edit" [id]
    (edit-problem (Integer. id)))


(defn create-problem
  "create a user submitted problem"
  [title tags restricted description code id author]
  (let [user (session/session-get :user)]
    (if (can-submit? user)
      (let [prob-id (or id
