Ab sofort ist der Login auf der Weboberfläche von git.fh-muenster.de bevorzugt über FH Muenster SSO möglich.

Commit 69a4087c authored by Bruno Burke's avatar Bruno Burke 😁

Merge branch '13-option-anzahl-antworten-fur-aufzahlungsaufgabe' into 'master'

Resolve "Option "Anzahl Antworten" für Aufzählungsaufgabe"

Closes #13

See merge request lehrmeister/components!13
parents ac1675b3 5a5099fa
Pipeline #2388 passed with stages
in 3 minutes and 44 seconds
(defproject lernmeister.components "0.1.12"
(defproject lernmeister.components "0.1.13"
:dependencies [[org.clojure/clojure "1.9.0-beta2"]
[org.clojure/clojurescript "1.9.946"]
[reagent "0.7.0"]
......
......@@ -75,9 +75,26 @@
:type "checkbox"
:checked (:case-sensitive @exercise)
:on-change #(swap! exercise assoc :case-sensitive (-> % .-target .-checked))}]
[:label {:for "chb-case-sensitivity"} "Groß-/kleinschreibung beachten"]]]
]
]))}))
[:label {:for "chb-case-sensitivity"} "Groß-/kleinschreibung beachten"]]
[:div.col.s12.m6.l12
[:input {:id "chb-element-count"
:type "checkbox"
:disabled true
:checked (pos? (:element-count @exercise))}]
[:label {:for "txt-element-count"} "Anzahl der Elemente vorgeben: "
[:input {:id "txt-element-count"
:type "text"
:value (:element-count @exercise)
:on-change #(let [value (-> %
.-target
.-value)
numberval (js/parseInt value)]
(if (= value "")
(swap! exercise assoc :element-count nil)
(when (pos? value)
(swap! exercise assoc :element-count numberval))))
}]]]]]])
)}))
(defn additional-forms [exercise]
[new-exercise-form (reagent/cursor exercise [:answers]) @exercise])
......@@ -45,7 +45,8 @@
(or (first (filter #(= (:text %) a) (:answers result))) {:text a :correct false})))])
answer)]
[:div.row
(when-not result [:a.btn.col.s12.blue.waves-effect.waves-light {:on-click #(on-change-fn (into [] (conj answer "")))} "+"])]]))
(when-not result [:a.btn.col.s12.blue.waves-effect.waves-light
{:on-click #(on-change-fn (into [] (conj answer "")))} "+"])]]))
(defn print-list-exercise [exercise & {:keys [result answer on-change-fn]}]
(fn [exercise & {:keys [result answer on-change-fn]}]
......@@ -62,6 +63,9 @@
(doall (for [ce (:task-description exercise)]
^{:key (:id ce)}[(content-manager/get-renderer (:type ce)) ce]))
[:br ]
(when (pos? (:element-count exercise))
[:strong (str "(" (:element-count exercise) " Antworten)")])
[:br ]
[answers exercise :result result :answer answer :on-change-fn on-change-fn]
(when result
[:span.secondary-content [:b (str (:points result) "P")]])
......
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