       (unapproved-problem-page)
       (flash-error "You cannot access this page" "/problems"))))
 
-
 (def-page problem-submission-page []
   [:div.instructions
     [:p "Thanks for choosing to submit a problem. Please make sure that you own the rights to the code you are submitting and that you wouldn't mind having us use the code as a 4clojure problem."]]

              [:br]
       [:p#instruct "Code which fills in the blank: "]
       (text-area {:id "code-box"
`                   :spellcheck "false"}
                  :code (session/flash-get :code))
       [:div#golfgraph
        (render-golf-chart)]

  [title tags description code id author]
  (let [user (session/session-get :user)]
    (if (can-submit? user)
      (let [prob-id (or id
                        (:seq (fetch-and-modify
                               :seqs
                               {:_id "problems"}
                               {:$inc {:seq 1}})))]

        (update! :problems
                 {:_id prob-id}
                 {:_id prob-id
                  :title title
                  :times-solved 0
                  :description description
                  :tags (s/split tags #"\s+")
                  :tests (s/split-lines code)
                  :user (if (empty? author) user author)
                  :approved false})
        (flash-msg "Thank you for submitting a problem! Be sure to check back to see it posted." "/problems"))
      (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)]
    (doseq [[k v] {:prob-id id
                   :author user
                   :title title
                   :tags (s/join " " tags)
                   :description description
                   :tests (s/join "\n" tests)}]
      (session/flash-put! k v))
    (response/redirect "/problems/submit")))

(defn approve-problem [id]
