qa
class qa
And now to something completely different. Let's make a captcha without extending the abstract class.
QA CAPTCHA sample implementation
Properties
$confirm_id | |||
$answer | |||
$question_ids | |||
$question_text | |||
$question_lang | |||
$question_strict | |||
$attempts | |||
$type | |||
$solved | |||
protected | $table_captcha_questions | ||
protected | $table_captcha_answers | ||
protected | $table_qa_confirm | ||
protected string | $service_name |
Methods
Constructor
No description
See if the captcha has created its tables.
API function - for the captcha to be available, it must have installed itself and there has to be at least one question in the board's default lang
API function
API function
No description
Set the name of the plugin
API function - not needed as we don't display an image
API function - not needed as we don't display an image
API function - send the question to the template
API function - we just display a mockup so that the captcha doesn't need to be installed
API function
API function
API function - we don't drop the tables here, as that would cause the loss of all entered questions.
API function - set up shop
API function - see what has to be done to validate
Select a question
New Question, if desired.
Wrong answer, so we increase the attempts and use a different question.
See if there is already an entry for the current session.
Look up everything we need and populate the instance variables.
The actual validation
API function
API function
API function
API function - The ACP backend, this marks the end of the easy methods
This handles the list overview
Grab a question and bring it into a format the editor understands
Grab a question from input and bring it into a format the editor understands
Update a question.
Insert a question.
Insert the answers.
Delete a question.
Check if the entered data can be inserted/used param mixed $data : an array as created from acp_get_question_input or acp_get_question_data
List the installed language packs
See if there is a question other than the one we have
Details
at line 49
__construct(string $table_captcha_questions, string $table_captcha_answers, string $table_qa_confirm)
Constructor
at line 59
init(int $type)
No description
at line 135
is_installed()
See if the captcha has created its tables.
at line 147
is_available()
API function - for the captcha to be available, it must have installed itself and there has to be at least one question in the board's default lang
at line 172
has_config()
API function
at line 180
static
get_name()
API function
at line 188
string
get_service_name()
No description
at line 198
set_name(string $name)
Set the name of the plugin
at line 206
execute_demo()
API function - not needed as we don't display an image
at line 213
execute()
API function - not needed as we don't display an image
at line 220
get_template()
API function - send the question to the template
at line 250
get_demo_template()
API function - we just display a mockup so that the captcha doesn't need to be installed
at line 274
get_hidden_fields()
API function
at line 291
garbage_collect($type = 0)
API function
at line 326
uninstall()
API function - we don't drop the tables here, as that would cause the loss of all entered questions.
at line 334
install()
API function - set up shop
at line 391
validate()
API function - see what has to be done to validate
at line 437
select_question()
Select a question
at line 463
reselect_question()
New Question, if desired.
at line 487
new_attempt()
Wrong answer, so we increase the attempts and use a different question.
at line 509
load_confirm_id()
See if there is already an entry for the current session.
at line 534
load_answer()
Look up everything we need and populate the instance variables.
at line 571
check_answer()
The actual validation
at line 601
get_attempt_count()
API function
at line 609
reset()
API function
at line 625
is_solved()
API function
at line 640
acp_page($id, $module)
API function - The ACP backend, this marks the end of the easy methods
at line 778
acp_question_list($module)
This handles the list overview
at line 808
acp_get_question_data($question_id)
Grab a question and bring it into a format the editor understands
at line 848
acp_get_question_input()
Grab a question from input and bring it into a format the editor understands
at line 875
acp_update_question($data, $question_id)
Update a question.
param mixed $data : an array as created from acp_get_question_input or acp_get_question_data
at line 902
acp_add_question($data)
Insert a question.
param mixed $data : an array as created from acp_get_question_input or acp_get_question_data
at line 926
acp_insert_answers($data, $question_id)
Insert the answers.
param mixed $data : an array as created from acp_get_question_input or acp_get_question_data
at line 947
acp_delete_question($question_id)
Delete a question.
at line 967
validate_input($question_data)
Check if the entered data can be inserted/used param mixed $data : an array as created from acp_get_question_input or acp_get_question_data
at line 993
get_languages()
List the installed language packs
at line 1019
acp_is_last($question_id)
See if there is a question other than the one we have