Copyright © 2010-2020 Marc Worrell
Behaviours: zotonic_model.
Authors: Marc Worrell (marc@worrell.nl).
answer_user/2 | |
delete_result/3 | Delete a specific survey results. |
delete_result/4 | Delete all survey results for a user or persistent id. |
delete_results/2 | Delete all survey results. |
get_handlers/1 | Return the list of known survey handlers. |
get_questions/2 | get prepared questions from the blocks. |
insert_survey_submission/3 | Save a survey, connect to the current user (if any). |
insert_survey_submission/5 | Save or replace a survey, resetting the created if needed. |
is_allowed_results_download/2 | |
is_answer_user/2 | |
is_answer_user/3 | |
list_results/2 | |
m_get/3 | Fetch the value for the key from a model source. |
persistent_id/1 | |
replace_survey_submission/4 | Replace a survey answer. |
rsc_merge/3 | Move all answers of a to-be-deleted user to another user. |
single_result/3 | |
single_result/4 | Retrieve the latest survey result for a user or persistent id. |
survey_results/3 | Return all results of a survey. |
survey_results_prompts/3 | Return all results of a survey with separate names, prompts and data. |
survey_results_sorted/3 | Get survey results, sorted by the given sort column. |
survey_stats/2 | Fetch the aggregate answers of a survey. |
answer_user(AnsId::integer(), Context::z:context()) -> integer() | undefined
delete_result(SurveyId, ResultId, Context) -> any()
Delete a specific survey results
delete_result(SurveyId, UserId, PersistentId, Context) -> any()
Delete all survey results for a user or persistent id.
delete_results(SurveyId, Context) -> any()
Delete all survey results
get_handlers(Context::z:context()) -> [{atom(), binary()}]
Return the list of known survey handlers
get_questions(SurveyId::m_rsc:resource_id(), Context::z:context()) -> [{BlockName::binary(), map()}] | undefined
get prepared questions from the blocks
insert_survey_submission(SurveyId::m_rsc:resource_id(), Answers::list(), Context::z:context()) -> {ok, pos_integer()} | {error, any()}
Save a survey, connect to the current user (if any)
insert_survey_submission(SurveyId, UserId, PersistentId, Answers, Context) -> any()
Save or replace a survey, resetting the created if needed.
is_allowed_results_download(Id::m_rsc:resource_id(), Context::z:context()) -> boolean()
is_answer_user(AnsId::integer(), Context::z:context()) -> boolean()
is_answer_user(AnsId::integer(), UserId::integer(), Context::z:context()) -> boolean()
list_results(SurveyId::integer(), Context::z:context()) -> list()
m_get(Rest::list(), Msg::zotonic_model:opt_msg(), Context::z:context()) -> zotonic_model:return()
Fetch the value for the key from a model source
persistent_id(Context::z:context()) -> {binary() | undefined, z:context()}
replace_survey_submission(SurveyId::integer(), AnswerId::{user, m_rsc:resource_id()} | integer(), Answers::list(), Context::z:context()) -> {ok, integer()} | {error, term()}
Replace a survey answer
rsc_merge(WinnerId, LoserId, Context) -> any()
Move all answers of a to-be-deleted user to another user.
single_result(SurveyId::integer(), AnswerId::integer(), Context::z:context()) -> list()
single_result(SurveyId, UserId, PersistentId, Context) -> any()
Retrieve the latest survey result for a user or persistent id.
survey_results(SurveyId, IsAnonymous, Context) -> any()
Return all results of a survey
survey_results_prompts(SurveyId, IsForceAnonymous, Context) -> any()
Return all results of a survey with separate names, prompts and data
survey_results_sorted(SurveyId, SortColumn, Context) -> any()
Get survey results, sorted by the given sort column.
survey_stats(SurveyId::m_rsc:resource_id(), Context::z:context()) -> [{Block::binary(), [{QName::binary(), [{Answer::binary(), Count::integer()}]}]}]
Fetch the aggregate answers of a survey.
Generated by EDoc