Commit 9722f0e8 authored by Stephane Glondu's avatar Stephane Glondu
Browse files

Bugfix: check constraints for last question

parent 0a032d3d
...@@ -202,6 +202,7 @@ let rec createQuestionNode sk params question_div num_questions i prev (q, answe ...@@ -202,6 +202,7 @@ let rec createQuestionNode sk params question_div num_questions i prev (q, answe
let b = document##createElement (Js.string "button") in let b = document##createElement (Js.string "button") in
let t = document##createTextNode (Js.string "Proceed") in let t = document##createTextNode (Js.string "Proceed") in
b##onclick <- Dom_html.handler (fun _ -> b##onclick <- Dom_html.handler (fun _ ->
if check_constraints () then (
let all = (q, answers) :: prev in let all = (q, answers) :: prev in
let all_answers = List.rev_map snd all |> Array.of_list in let all_answers = List.rev_map snd all |> Array.of_list in
let all_questions = List.rev_map fst all |> Array.of_list in let all_questions = List.rev_map fst all |> Array.of_list in
...@@ -229,6 +230,7 @@ let rec createQuestionNode sk params question_div num_questions i prev (q, answe ...@@ -229,6 +230,7 @@ let rec createQuestionNode sk params question_div num_questions i prev (q, answe
Lwt_js_events.async (encryptBallot params sk all_answers); Lwt_js_events.async (encryptBallot params sk all_answers);
setDisplayById "plaintext_div" "block"; setDisplayById "plaintext_div" "block";
Js._false Js._false
) else Js._false
); );
Dom.appendChild b t; Dom.appendChild b t;
Dom.appendChild btns b Dom.appendChild btns b
......
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