Commit 90a0873a authored by Stephane Glondu's avatar Stephane Glondu Committed by Stéphane Glondu

Add a warning in NH reply screens

parent d41522e7
Pipeline #101129 passed with stages
in 26 minutes and 15 seconds
...@@ -253,10 +253,10 @@ let rec createQuestionNode sk params question_div num_questions i prev (q, answe ...@@ -253,10 +253,10 @@ let rec createQuestionNode sk params question_div num_questions i prev (q, answe
answers)] point to the current question. [List.rev prev @ [q, answers)] point to the current question. [List.rev prev @ [q,
answers] @ next] is the list of all questions. *) answers] @ next] is the list of all questions. *)
let div = Dom_html.createDiv document in let div = Dom_html.createDiv document in
let check_constraints = let nh, check_constraints =
match q with match q with
| Question.Homomorphic q -> appendHomomorphicQuestion div num_questions i q answers | Question.Homomorphic q -> false, appendHomomorphicQuestion div num_questions i q answers
| Question.NonHomomorphic q -> appendNonHomomorphicQuestion div q answers | Question.NonHomomorphic q -> true, appendNonHomomorphicQuestion div q answers
in in
let () = let () =
(* previous button *) (* previous button *)
...@@ -329,6 +329,14 @@ let rec createQuestionNode sk params question_div num_questions i prev (q, answe ...@@ -329,6 +329,14 @@ let rec createQuestionNode sk params question_div num_questions i prev (q, answe
in in
Dom.appendChild div btns Dom.appendChild div btns
in in
let () =
if nh then (
let d = Dom_html.createDiv document in
d##.style##.marginTop := Js.string "1em";
Dom.appendChild div d;
Dom.appendChild d (document##createTextNode (Js.string "Warning: the system will accept any integer between 0 and 255 but, according to the election rules, invalid ballots (score too high or candidates not properly ranked) will be rejected at the end of the election."))
)
in
div div
let addQuestions sk params qs = let addQuestions sk params qs =
......
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