Documentation ¶
Index ¶
- Constants
- func ComputeConfidentialIDForParticipant(study studyTypes.Study, participantID string) (string, error)
- func ComputeParticipantIDs(study studyTypes.Study, profileID string) (string, string, error)
- func EvalCustomExpressionForParticipant(instanceID, studyKey, participantID string, expression studyTypes.Expression) (val interface{}, err error)
- func Init(studyDB *studydb.StudyDBService, gSecret string, ...)
- func OnCustomStudyEvent(instanceID string, studyKey string, profileID string, eventKey string, ...) (result []studyTypes.AssignedSurvey, err error)
- func OnEnterStudy(instanceID string, studyKey string, profileID string) (result []studyTypes.AssignedSurvey, err error)
- func OnLeaveStudy(instanceID string, studyKey string, profileID string) (result []studyTypes.AssignedSurvey, err error)
- func OnMergeTempParticipant(instanceID string, studyKey string, profileID string, ...) (result []studyTypes.AssignedSurvey, err error)
- func OnProfileDeleted(instanceID, profileID string, exitSurveyResp *studyTypes.SurveyResponse)
- func OnRegisterTempParticipant(instanceID string, studyKey string) (pState *studyTypes.Participant, err error)
- func OnStudyTimer(instanceID string, study *studyTypes.Study)
- func OnSubmitResponse(instanceID string, studyKey string, profileID string, ...) (result []studyTypes.AssignedSurvey, err error)
- func OnSubmitResponseForTempParticipant(instanceID string, studyKey string, participantID string, ...) (result []studyTypes.AssignedSurvey, err error)
- type AssignedSurveyWithContext
- func GetAssignedSurveyWithContext(instanceID string, studyKey string, surveyKey string, profileID string) (surveyWithContent AssignedSurveyWithContext, err error)
- func GetSurveyWithContextForTempParticipant(instanceID string, studyKey string, surveyKey string, tempParticipantID string) (surveyWithContent AssignedSurveyWithContext, err error)
- type AssignedSurveysWithInfos
- type RunStudyActionProgressFn
- type RunStudyActionReq
- type RunStudyActionResult
- type SubmissionEntry
- type SubmissionHistory
- type SurveyContext
- type SurveyInfo
Constants ¶
View Source
const (
TEMPORARY_PARTICIPANT_TAKEOVER_PERIOD = 24 * 60 * 60 // seconds - after this period, the temporary participant is considered to be inactive and cannot be used anymore
)
Variables ¶
This section is empty.
Functions ¶
func ComputeConfidentialIDForParticipant ¶
func ComputeConfidentialIDForParticipant(study studyTypes.Study, participantID string) (string, error)
func ComputeParticipantIDs ¶
func EvalCustomExpressionForParticipant ¶
func EvalCustomExpressionForParticipant(instanceID, studyKey, participantID string, expression studyTypes.Expression) (val interface{}, err error)
func Init ¶
func Init( studyDB *studydb.StudyDBService, gSecret string, externalServices []studyengine.ExternalService, )
func OnCustomStudyEvent ¶
func OnCustomStudyEvent(instanceID string, studyKey string, profileID string, eventKey string, payload map[string]interface{}) (result []studyTypes.AssignedSurvey, err error)
func OnEnterStudy ¶
func OnEnterStudy(instanceID string, studyKey string, profileID string) (result []studyTypes.AssignedSurvey, err error)
func OnLeaveStudy ¶
func OnLeaveStudy(instanceID string, studyKey string, profileID string) (result []studyTypes.AssignedSurvey, err error)
func OnMergeTempParticipant ¶
func OnMergeTempParticipant(instanceID string, studyKey string, profileID string, temporaryParticipantID string) (result []studyTypes.AssignedSurvey, err error)
func OnProfileDeleted ¶
func OnProfileDeleted(instanceID, profileID string, exitSurveyResp *studyTypes.SurveyResponse)
func OnRegisterTempParticipant ¶
func OnRegisterTempParticipant(instanceID string, studyKey string) (pState *studyTypes.Participant, err error)
func OnStudyTimer ¶
func OnStudyTimer(instanceID string, study *studyTypes.Study)
Run study timer event for participants
func OnSubmitResponse ¶
func OnSubmitResponse(instanceID string, studyKey string, profileID string, response studyTypes.SurveyResponse) (result []studyTypes.AssignedSurvey, err error)
func OnSubmitResponseForTempParticipant ¶
func OnSubmitResponseForTempParticipant(instanceID string, studyKey string, participantID string, response studyTypes.SurveyResponse) (result []studyTypes.AssignedSurvey, err error)
Types ¶
type AssignedSurveyWithContext ¶
type AssignedSurveyWithContext struct { Survey *studyTypes.Survey `json:"survey"` Context *SurveyContext `json:"context,omitempty" ` Prefill *studyTypes.SurveyResponse `json:"prefill,omitempty"` }
type AssignedSurveysWithInfos ¶
type AssignedSurveysWithInfos struct { Surveys []studyTypes.AssignedSurvey `json:"surveys"` SurveyInfos []*SurveyInfo `json:"surveyInfos"` }
func GetAssignedSurveys ¶
func GetAssignedSurveys(instanceID string, studyKey string, profileIDs []string) (surveysWithInfos AssignedSurveysWithInfos, err error)
func GetAssignedSurveysForTempParticipant ¶
func GetAssignedSurveysForTempParticipant(instanceID string, studyKey string, participantID string) (surveysWithInfos AssignedSurveysWithInfos, err error)
type RunStudyActionReq ¶
type RunStudyActionReq struct { InstanceID string StudyKey string OnlyForParticipantID string Rules []types.Expression OnProgressFn RunStudyActionProgressFn }
type RunStudyActionResult ¶
type RunStudyActionResult struct { ParticipantCount int64 ParticipantStateChangedPerRule []int64 Duration int64 }
func OnRunStudyAction ¶
func OnRunStudyAction(req RunStudyActionReq) (*RunStudyActionResult, error)
func OnRunStudyActionForPreviousResponses ¶
func OnRunStudyActionForPreviousResponses(req RunStudyActionReq, surveyKeys []string, from int64, to int64) (*RunStudyActionResult, error)
type SubmissionEntry ¶
type SubmissionHistory ¶
type SubmissionHistory struct { Submissions []SubmissionEntry `json:"submissions"` SurveyInfos []*SurveyInfo `json:"surveyInfos"` }
func GetSubmissionHistory ¶
type SurveyContext ¶
type SurveyContext struct { Mode string `json:"mode,omitempty"` PreviousResponses []studyTypes.SurveyResponse `json:"previousResponses,omitempty"` ParticipantFlags map[string]string `json:"participantFlags,omitempty"` }
type SurveyInfo ¶
type SurveyInfo struct { SurveyKey string `json:"surveyKey"` StudyKey string `json:"studyKey"` Name []studyTypes.LocalisedObject `json:"name"` Description []studyTypes.LocalisedObject `json:"description"` TypicalDuration []studyTypes.LocalisedObject `json:"typicalDuration"` VersionID string `json:"versionID"` }
Click to show internal directories.
Click to hide internal directories.