Commit 4ca80256 authored by Joachim Schunk's avatar Joachim Schunk

fix error-relative treatment as string

parent 79b637aa
(ns lernmeister.components.exercise-types.calculation.check
(:require [clojure.tools.reader.edn :as edn]
[lernmeister.components.exercise-types.calculation.migrate-answer
(:require [lernmeister.components.exercise-types.calculation.migrate-answer
:refer
[answer-scheme-version migrate-answer]]
[lernmeister.components.exercise-types.check :as e-check]
......@@ -21,7 +20,7 @@
(defn check-calculation [id ans-obj ex-obj res-map with-oom with-units]
(let [phys-val-check-res (check-phys-vals ex-obj ans-obj :with-oom with-oom :with-units with-units)
is-correct? (tolerable-error? (:calculation-error phys-val-check-res)
(edn/read-string (:error-relative ex-obj)))]
(or (:error-relative ex-obj) 1))]
(assoc res-map id {:correct is-correct?
:points (if is-correct? (:correct-points ex-obj) (:incorrect-points ex-obj))
:points-max (:correct-points ex-obj)})))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment