NZTA\SDLT\Model\Questionnaire
Class Questionnaire
This class represents multiple "kinds" of questionnaire.
A Risk Questionnaire allows administrators to populate a submission's answers
with with risks and based on the answers given, allocate a weighting that covers
both the answer and the risk.
Risks & Weights are only applicable to multi-choice answers where >=1 is able to be associated with each multi-choice answer.
Example:
- An answer comprises the following multiple choices: "A","B","C"
- One or more risks can be associated with "A", "B" and/or "C"
- Once assigned a risk, an admin can then add a "Weighting" (Range 0-100) to
each answer+risk combination.
Synopsis
class Questionnaire
extends DataObject
implements
ScaffoldingProvider,PermissionProvider
{
- // members
- private static string $table_name = 'Questionnaire';
- private static integer $expiry_days = 14;
- private static integer $min_expiry_days = 5;
- private static boolean $show_overwrite_for_json_import = true;
- private static array $db = ;
- private static array $extensions = ;
- private static array $defaults = ;
- private static array $has_one = ;
- private static array $has_many = ;
- private static array $many_many = ;
- private static array $snapshot_relation_tracking = ;
- private static array $summary_fields = ;
- // methods
- public array searchableFields()
- public string getType()
- public FieldList getCMSFields()
- public SchemaScaffolder provideGraphQLScaffolding()
- public boolean isRiskType()
- public string getQuestionaireEmailLink()
- public void requireDefaultRecords()
- public void createDefaultSDLTMemberGroups()
- public array getQuestionsData()
- public Int getExpireAfterDays()
- public void onBeforeWrite()
- public string getLink()
- public ValidationResult validate()
- public boolean isBypassApproval()
- public static void create_record_from_json()
- public static object|null get_by_name()
- public array providePermissions()
- public boolean canImport()
- public boolean canExport()
- public static string export_record()
- // Inherited methods from SDLTModelPermissions
- public bool canView()
- public bool canCreate()
- public bool canEdit()
- public bool canDelete()
- // Inherited methods from SDLTRiskCalc
- public RiskFormula riskFactory()
Hierarchy
Extends
- SilverStripe\ORM\DataObject
Uses
Implements
- SilverStripe\GraphQL\Scaffolding\Interfaces\ScaffoldingProvider
- SilverStripe\Security\PermissionProvider
Members
private
- $db — array
- $defaults — array
- $expiry_days — integer
- $extensions — array
- $has_many — array
- $has_one — array
- $many_many — array
- $min_expiry_days — integer
- $show_overwrite_for_json_import — boolean
- $snapshot_relation_tracking — array
- $summary_fields — array
- $table_name — string
Methods
public
- canExport() — Only ADMIN users and user with export permission should be able to export Questionnaire.
- canImport() — Only ADMIN users and user with import permission should be able to import Questionnaire.
- createDefaultSDLTMemberGroups() — Generate default security groups for the SDLT application
- create_record_from_json() — create questionnaire from json import
- export_record() — export questionnaire
- getCMSFields() — CMS Fields.
- getExpireAfterDays()
- getLink() — get current object link in model admin
- getQuestionaireEmailLink()
- getQuestionsData()
- getType() — Legacy questionnaires will not have a "Type" field for display in e.g.
- get_by_name() — get questionnaire by name
- isBypassApproval() — get BypassApproval
- isRiskType()
- onBeforeWrite() — Deal with pre-write processes.
- provideGraphQLScaffolding()
- providePermissions() — permission-provider to import Questionnaire
- requireDefaultRecords() — Generate default security groups for the SDLT application
- searchableFields() — Defines a customised list of filters for the search context
- validate()
Inherited from NZTA\SDLT\Traits\SDLTModelPermissions
public
- canCreate() — Allow logged-in user to create an instance of the model
- canDelete() — Allow logged-in user to delete an instance of the model
- canEdit() — Allow logged-in user to edit an instance of the model
- canView() — Allow logged-in user to access the model
Inherited from NZTA\SDLT\Traits\SDLTRiskCalc
public
- riskFactory() — Returns an instance of the appropriate {@link RiskFormula}.