Commit 540dae1b authored by Joachim Schunk's avatar Joachim Schunk

fix java-cast-error

parent 82fe8cfc
Pipeline #47612 failed with stages
in 2 minutes and 18 seconds
(ns lernmeister.components.exercise-types.calculation.check
(:require [lernmeister.components.exercise-types.calculation.migrate-answer
(:require [clojure.tools.reader.edn :as edn]
[lernmeister.components.exercise-types.calculation.migrate-answer
:refer
[answer-scheme-version migrate-answer]]
[lernmeister.components.exercise-types.check :as e-check]
......@@ -19,7 +20,8 @@
(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) (int (:error-relative ex-obj)))]
is-correct? (tolerable-error? (:calculation-error phys-val-check-res)
(edn/read-string (:error-relative ex-obj)))]
(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