# HG changeset patch # User bsw # Date 1641303061 -3600 # Node ID 2d4136357989098073880eed5bafb3abf79c3930 # Parent 757a87af4c8350a81773503dceaf533669deced1 Final version of survey diff -r 757a87af4c83 -r 2d4136357989 app/main/survey/_action/participate.lua --- a/app/main/survey/_action/participate.lua Mon Dec 13 11:57:35 2021 +0100 +++ b/app/main/survey/_action/participate.lua Tue Jan 04 14:31:01 2022 +0100 @@ -40,6 +40,15 @@ local answer_set = SurveyAnswerSet:new() answer_set.ident = random_string() answer_set.survey_id = survey.id + local verification = Verification:new_selector() + :add_where{ "verified_member_id = ?", app.session.member_id } + :optional_object_mode() + :exec() + if verification then + answer_set.data = verification.request_data + answer_set.data.name = nil + answer_set.data.email = nil + end answer_set:save() survey_member.survey_answer_set_ident = answer_set.ident end diff -r 757a87af4c83 -r 2d4136357989 db/survey.sql --- a/db/survey.sql Mon Dec 13 11:57:35 2021 +0100 +++ b/db/survey.sql Tue Jan 04 14:31:01 2022 +0100 @@ -21,7 +21,8 @@ CREATE TABLE survey_answer_set ( ident TEXT NOT NULL PRIMARY KEY, - survey_id INT4 NOT NULL REFERENCES survey(id) + survey_id INT4 NOT NULL REFERENCES survey(id), + data JSON ); CREATE TABLE survey_answer (