Changeset

4049:78f1de5301fc

mod_adhoc_dataforms_demo: Fix duplicate field prevention It's supposed to only include each type of form field once per form at most but it didn't note which fields it had added already. No idea what the probability was anyways, probably pretty low.
author Kim Alvefur <zash@zash.se>
date Tue, 23 Jun 2020 19:40:55 +0200
parents 4048:64b7daa6c42c
children 4050:1eb2b9483081
files mod_adhoc_dataforms_demo/mod_adhoc_dataforms_demo.lua
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mod_adhoc_dataforms_demo/mod_adhoc_dataforms_demo.lua	Mon Jun 22 21:35:57 2020 +0200
+++ b/mod_adhoc_dataforms_demo/mod_adhoc_dataforms_demo.lua	Tue Jun 23 19:40:55 2020 +0200
@@ -154,6 +154,7 @@
 			repeat
 				random = math.random(2, #form);
 			until not already_selected[random]
+			already_selected[random] = true;
 			table.insert(current_form, form[random]);
 		end
 		state.forms[state.step] = dataforms.new(current_form);