TakeSurvey
TakeSurvey PHP Methods
static checkContinueSurvey(\WMT\Container $container, \WMT\SQL\Survey\Survey $survey, bool $isFinished) v5
Redirects to continue survey URL is the user didn't finish the survey
PARAMETERS:
$container = object
$survey = object
$isFinished = bool, True if the survey is finished, false otherwise
RETURN VALUE:
voidstatic createContact(\WMT\Container $container, \WMT\SQL\Visit\Visitor $visitor, \WMT\SQL\Survey\Survey $survey, int $referID) v5
Create contact for the survey user
PARAMETERS:
$container = object
$visitor = object
$survey = object
$referID = int, Referrer member ID
RETURN VALUE:
voidstatic getDeleteWhere(\WMT\SQL\Survey\SurveyUser $surveyUser, \WMT\SQL\Survey\SurveyQuestion $surveyQuestion, string $deleteQuery) v5
Gets SQL query statement to delete a survey question
PARAMETERS:
$surveyUser = object
$surveyQuestion = object
$deleteQuery = string, SQL statement where query to delete a question
RETURN VALUE:
string = SQL query statement to delete a survey questionstatic getHeaderImage(\WMT\Container $container, int $surveyID) v5
Gets survey header image
PARAMETERS:
$container = object
$surveyID = int, Survey ID
RETURN VALUE:
string = Survey header image as HTMLstatic getJavascript($qtArr, $questionID, $resRow) v5
Gets survey javascript content
PARAMETERS:
$qtArr = array, Survey questions array.
$questionID = int, question ID to check
$resRow = array, survey questions and answers array
RETURN VALUE:
string = survey javascript contentstatic getMessageContent(\WMT\MySQL $mysqli, \WMT\SQL\Survey\Survey $survey, \WMT\SQL\Survey\SurveyUser $surveyUser, \WMT\SQL\Survey\SurveyQuestions $surveyQuestions, int &$correctCount, int &$wrongCount) v5
Gets complete survey message body content
PARAMETERS:
$mysqli = object
$survey = object
$surveyUser = object
$surveyQuestions = object
$correctCount = int, Number of correct answers
$wrongCount = int, Number of wrong answers
RETURN VALUE:
string = complete survey message body contentstatic getMessageSubject(\WMT\SQL\Survey\Survey $survey, \WMT\SQL\Visit\Visitor $visitor) v5
Gets complete survey message subject
PARAMETERS:
$survey = object
$visitor = object
RETURN VALUE:
string = complete survey message subjectstatic getPercentCount($wrongCount, $correctCount) v5
gets correct answers percentage
PARAMETERS:
$wrongCount = int, Number of wrong answers
$correctCount = int, Number of correct answers
RETURN VALUE:
float = correct answers percentagestatic getRedirectURL(\WMT\Container $container, \WMT\SQL\Survey\Survey $survey, int $referID, int $totalScore) v5
Gets survey redirect URL
PARAMETERS:
$container = object
$survey = object
$referID = int, Survey referrer ID
$totalScore = int, Survey score
RETURN VALUE:
string = survey redirect URLstatic getReferrerID($survey, \WMT\Container $container) v5
gets survey referrer ID
PARAMETERS:
$survey = object
$container = object
RETURN VALUE:
int = survey referrer IDstatic getSurveyUser(\WMT\Container $container, \WMT\SQL\Visit\Visitor $visitor, \WMT\SQL\Survey\Survey $survey, int $referID) v5
Get survey user object
PARAMETERS:
$container = object
$visitor = object
$survey = object
$referID = int, Survey referrer ID
RETURN VALUE:
object = \WMT\SQL\Survey\SurveyUserstatic getSurveyUserID(\WMT\SQL\Visit\Visitor $visitor, $survey, \WMT\MySQL $mysqli) v5
Gets survey user ID
PARAMETERS:
$mysqli = object
$visitor = object
$survey = object
RETURN VALUE:
int = Survey user IDstatic insertSurveyResults(\WMT\MySQL $mysqli, array $sqlQueryArray) v5
Process survey results and save them to database
PARAMETERS:
$mysqli = object
$sqlQueryArray = array, list of survey results values including (surveyuser, surveyquestion, answer, surveyanswer, iscorrect)
RETURN VALUE:
voidstatic isSurveyFinished(\WMT\MySQL $mysqli, int $surveyUserID) v5
Checks if a survey user has finished his survey
PARAMETERS:
$mysqli = object
$surveyUserID = int, Survey User ID
RETURN VALUE:
bool = True if the user finished the survey, false otherwisestatic markLessonComplete(int $surveyID, int $lessonAssignmentID, \WMT\Container $container, \WMT\SQL\Visit\Visitor $visitor) v5
Mark a lesson assigned to a survey as complete
PARAMETERS:
$surveyID = int, Survey ID
$lessonAssignmentID = int, Lesson assignment ID
$container = object
$visitor = object
RETURN VALUE:
voidstatic processSurvey($answer, $surveyQuestion, int $surveyUserID, $surveyQuestions, \WMT\MySQL $mysqli) v5
process survey answers
PARAMETERS:
$answer = string, Question answer
$surveyQuestion = object
$surveyUserID = int, Survey user ID
$surveyQuestions = object
$mysqli = object
RETURN VALUE:
array = list of survey answers details like total score, email etcstatic sendContactEmail(\WMT\Container $container, \WMT\SQL\Survey\Survey $survey, \WMT\SQL\Visit\Visitor $visitor, int $correct, int $wrong, int $totalScore, string $mrCont) v5
Send conact email on survey completion
PARAMETERS:
$container = object
$survey = object
$visitor = object
$correct = int, Number of correct answers
$wrong = int, Number of wrong answers
$totalScore = int, Survey results total score
$mrCont = string, Survey answers content
RETURN VALUE:
voidstatic sendEmail($addtlEmailContent, $survey, $contact, \WMT\Container $container) v5
Send survey emails
PARAMETERS:
$addtlEmailContent = string, email body content
$survey = object
$contact = object
$container = object
RETURN VALUE:
voidstatic sendNotifications(\WMT\Container $container, \WMT\SQL\Survey\Survey $survey, \WMT\SQL\Visit\Visitor $visitor, int $referID, int $totalScore, string $mrCont) v5
Send survey on complete notifications
PARAMETERS:
$container = object
$survey = object
$visitor = object
$referID = int, Survey referrer member ID
$totalScore = int, Survey result total score
$mrCont = string, Survey answers content
RETURN VALUE:
voidTakeSurvey PHP Variables
🔎︎ %l4610%