Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'hotfix/1.3.0.1'

  • Loading branch information...
commit 6fd1c7e4ad6fb5d795bc54735866b8f6a2212e0c 2 parents 7abcce8 + 8b67479
@amalloy amalloy authored
Showing with 6 additions and 5 deletions.
  1. +1 −1  project.clj
  2. +5 −4 src/foreclojure/problems.clj
View
2  project.clj
@@ -1,4 +1,4 @@
-(defproject foreclojure "1.3.0"
+(defproject foreclojure "1.3.0.1"
:description "4clojure - a website for lisp beginners"
:dependencies [[clojure "1.2.1"]
[clojure-contrib "1.2.0"]
View
9 src/foreclojure/problems.clj
@@ -468,9 +468,10 @@ Return a map, {:message, :error, :url, :num-tests-passed}."
{:$inc {:seq 1}})))
edit-url (str "https://4clojure.com/problem/"
id)
- approved (true? (:approved (fetch-one :problems
- :where {:_id id}
- :only [:approved])))]
+ existing-problem (fetch-one :problems
+ :where {:_id id}
+ :only [:approved :times-solved])
+ approved (true? (:approved existing-problem))]
(when (empty? author) ; newly submitted, not a moderator tweak
(try
@@ -490,7 +491,7 @@ Return a map, {:message, :error, :url, :num-tests-passed}."
{:_id id
:title title
:difficulty difficulty
- :times-solved 0
+ :times-solved (or (:times-solved existing-problem) 0)
:description description
:tags (re-seq #"\S+" tags)
:restricted (re-seq #"\S+" restricted)
Please sign in to comment.
Something went wrong with that request. Please try again.