x

主要章节

  1. Get started
  2. Workspace
  3. Editor
  4. Question types
  5. Share
  6. Results
  7. Configuration
  8. Installation and updates
  9. Profile and personal settings
  10. Account and billing
  11. FAQs
  12. Development
 Actions

公开注册

From LimeSurvey Manual

您还可以利用使用邀請碼时提供的受访者控制类型,向公众开放您的调查。为此,请初始化您的调查参与者表,并在调查的主要设置中选择允许公开注册。在没有邀請碼的情况下访问您调查 URL 的人将有机会进行注册。(此设置以后可以在调查设置菜单中的参与者设置部分进行更改。)

如果参与者提供的电子邮件地址不在当前数据库中,系统将在调查参与者表中创建一个条目,并向其发送包含其唯一邀請碼的邀请电子邮件。

公开注册中的驗證碼

为了保护您的调查免受机器人注册,可以对所有注册、保存和加载表单启用驗證碼功能。有关详细信息,请阅读我们的 wiki:参与者设置。


如何将所有公开注册字段都设为必填?

如果您使用调查参与者表并同时允许公开注册,想要参与的人需要填写一份包含名、姓和电子邮件地址的注册表单。其中只有电子邮件地址是必填的:


公开注册表单:名和姓为选填,仅电子邮件带星号标记为必填,另有“立即注册”按钮


要将名和姓也设为必填,请编辑您的调查主题的注册表单。对于 Fruity TwentyThree,请先扩展主题,为该副本打开主题编辑器,然后编辑文件 views/subviews/registration/register_form.twig。电子邮件字段展示了必填字段的构建方式:

        {# Participants email #}
        <div class='{{ aSurveyInfo.class.registerformcolrowc }} row mb-3' {{ aSurveyInfo.attr.registerformcolrowc }}>
            <label {{ aSurveyInfo.attr.registerformcolrowclabel }} class='{{ aSurveyInfo.class.registerformcolrowclabel }}  control-label'> {{ gT("E-mail") }} {{ include('./subviews/registration/required.twig') }}</label>
            <div {{ aSurveyInfo.attr.registerformcolrowcdiv }}  >
                {{ C.Html.emailField('register_email', aSurveyInfo.sEmail, ({'id' : 'register_email','class' : 'form-control ls-important-field','required' : true, 'placeholder' : gT('Enter e-mail address', 'unescaped')})) }}
            </div>
        </div>

以同样的方式修改名和姓字段:

  • 将 {{ include('./subviews/registration/required.twig') }} 添加到标签中。这样会显示星号。
  • 将 'required' : true 添加到文本字段的选项中。这样会使该字段成为必填。

编辑后的字段应如下所示(示例来自 LimeSurvey 7.x;在 6.x 中,占位文本不带 'unescaped'):

            {# Participants first name #}
            <div class='{{ aSurveyInfo.class.registerformcolrow }} col-md-6 col-12 mb-3 mb-md-0' {{ aSurveyInfo.attr.registerformcolrow }}>
                <label for='register_firstname' class='{{ aSurveyInfo.class.registerformcolrowlabel }} control-label '>{{ gT("First name") }} {{ include('./subviews/registration/required.twig') }}</label> {# extra label #}
                <div class="">
                    {{ C.Html.textField('register_firstname', aSurveyInfo.sFirstName, ({'id' : 'register_firstname','class' : 'form-control ls-important-field', 'required' : true, 'placeholder' : gT('Enter your first name', 'unescaped') })) }} {# mandatory field #}
                </div>
            </div>

            {# Participants last name #}
            <div class='{{ aSurveyInfo.class.registerformcolrowb }} col-md-6 col-12' {{ aSurveyInfo.attr.registerformcolrowb }}>
                <label {{ aSurveyInfo.attr.registerformcolrowblabel }}  class='{{ aSurveyInfo.class.registerformcolrowblabel }} control-label '>{{ gT("Last name") }} {{ include('./subviews/registration/required.twig') }}</label> {# extra label #}
                <div {{ aSurveyInfo.attr.registerformcolrowbdiv }} >
                    {{ C.Html.textField('register_lastname', aSurveyInfo.sLastName, ({'id' : 'register_lastname', 'class' : 'form-control ls-important-field', 'required' : true, 'placeholder' : gT('Enter your last name', 'unescaped')})) }} {# mandatory field #}
                </div>
            </div>


点击复制为本地主题并保存更改。然后为您的调查选择该主题(参见在调查中使用您的主题),并测试注册表单。

现在,公开注册表单中的全部三个字段都显示为必填:


公开注册表单:名、姓和电子邮件均带星号标记为必填,另有“立即注册”按钮


另请参阅

本页面可能为机器翻译,可能包含错误。 查看英文原文 · 改进此翻译