             ))
 
 ;; Sample data
-(def class-results [{:class-name "Disco Freestyle B-klass J Po"
-                     :result {:round "S"
-                              :adjudicators [{:number 2}
-                                             {:number 4}
-                                             {:number 5}]
-                              :dances [{:name "X-Quick Forward"}
-                                       {:name "Quick"}]
-                              :result-array [{:dancer-number 30
-                                              :marks [true false true]}
-                                             {:dancer-number 31
-                                              :marks [true true true]}
-                                             {:dancer-number 32
-                                              :marks [false false true]}]}}
+(defn class-results[]
+  [{:class-name              "Disco Freestyle B-klass J Po"
+    :result {:round        "S"
+             :adjudicators [{:number 2}
+                            {:number 4}
+                            {:number 5}]
+             :dances       [{:name "X-Quick Forward"}
+                            {:name "Quick"}]
+             :result-array [{:dancer-number 30
+                             :marks         [true false true]}
+                            {:dancer-number 31
+                             :marks         [true true true]}
+                            {:dancer-number 32
+                             :marks         [false false true]}]}}
                     ])
 
-(def activities-with-result 
+(defn activities-with-result []
 [{:activity/name "Hiphop Singel Guld J1",
   :round/name "Semifinal",
   :round/panel

    {:adjudicator/number 5}]},
  :round/dances [{:dance/name "Medium"} {:dance/name "Medium"}]}])

(def activity-result (first activities-with-result))

activity-result

(defn short-round-name [round-name]
  (condp = round-name

    (-> out .getWriter .toString)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; API
(defn export-results [activities-with-result export-path]
  (log/info (str "Export Results to " export-path " with " activities-with-result))
  (let [in-xml (get-xml-from-file export-path)
        class-results (map activity-result->class-result activities-with-result)
        out-xml (reduce add-results-to-dp-xml in-xml class-results)]
    (make-copy-with-timestamp export-path)
    (spit export-path (ppxml (xml/emit-str out-xml)))))

(map activity-result->class-result activities-with-result)
(activity-result->class-result activities-with-result)

(defn smoke-test [] (export-results (activities-with-result) "dp.xml"))

(smoke-test)

