Change allow_changes to true, else a new survey could not be added questions

This commit is contained in:
AliasAlreadyTaken 2024-10-05 11:32:25 +02:00
parent b0aaebf437
commit f2ec7825ce
2 changed files with 3 additions and 2 deletions

View File

@ -70,7 +70,8 @@ Creates a survey owned by `owner`. `title`, `description` are strings, `allow_na
* description: string, optional, defaults to "". This is displayed on the front page of the survey
* allow_names: boolean, optional, default true. If true, respondents can choose whether to answer with their name recorded. If false, respondents cannot answer with their name recorded.
* allow_anonymous: boolean, optional, default true. If true, respondents can choose whether to answer anonymously. If false, respondents cannot answer anonymously.
* allow_changes: boolean, optional, default false. If true, the respondent may change his answers anytime before the deadline. If false, the answers are fixed once answered.
* allow_changes: boolean, optional, default true. If true, the survey may be altered. If false, the survey and its questions are fixed.
* allow_reconsider : boolean, optional, default false. If true, the respondent may change his answers anytime before the deadline. If false, the answers are fixed once answered.
* timestamp_start: positive integer, optional, default nil. Timestamp beyond which the survey can be answered.
* timestamp_end: positive integer, optional, default nil. Timestamp beyond which the survey can no longer be answered.

View File

@ -124,7 +124,7 @@ local function create_survey(owner, title, description, allow_names, allow_anony
if (type(allow_anonymous) ~= "boolean") then
return false, yl_survey.t("allow_anonymous must be boolean")
end
if (allow_changes == nil) then allow_changes = false end -- set default
if (allow_changes == nil) then allow_changes = true end -- set default
if (type(allow_changes) ~= "boolean") then
return false, yl_survey.t("allow_changes must be boolean")
end