Class automaticChecklistItem

Implemention of a checklist item which evaluates whether its conditions are met.

It uses a callback for the evaluation so that it can be utilized for different cases. The checklist item is completed automatically if the conditions are met.

See also:

Info:

  • Copyright: 2022 Patrick Lang
  • Author: Patrick Lang

Methods

automaticChecklistItem:new (challengeText, responseText, challengeKey, evaluateFunction) Creates a checklist item, which will be completed automatically if the conditions are met.
automaticChecklistItem:getChallengeText () Gets the challenge text of the checklist item.
automaticChecklistItem:getResponseText () Gets the response text of the checklist item.
automaticChecklistItem:getChallengeKey () Gets the key of the challenge sound.
automaticChecklistItem:getResponseKey () Gets the key of the response sound.
automaticChecklistItem:hasResponse () Checks whether the checklist item has a response.
automaticChecklistItem:evaluate () Checks whether the conditions of the checklist items are met.


Methods

automaticChecklistItem:new (challengeText, responseText, challengeKey, evaluateFunction)
Creates a checklist item, which will be completed automatically if the conditions are met.

Parameters:

  • challengeText string The challenge text of the checklist item.
  • responseText string The response text of the checklist item, which is also used as the key of the response sound.
  • challengeKey string The key of the challenge sound..
  • evaluateFunction func The function to evaluate whether the conditions for the checklist item are met. If the function returns any value other than true, the conditions are considered as not met.

Returns:

    automaticChecklistItem The created checklist item.
automaticChecklistItem:getChallengeText ()
Gets the challenge text of the checklist item.

Returns:

    string The challenge text of the checklist item.
automaticChecklistItem:getResponseText ()
Gets the response text of the checklist item.

Returns:

    string The response text of the checklist item.
automaticChecklistItem:getChallengeKey ()
Gets the key of the challenge sound.

Returns:

    string The key of the challenge sound.
automaticChecklistItem:getResponseKey ()
Gets the key of the response sound. The response text is used as the key of the response sound.

Returns:

    string The response text of the response sound.
automaticChecklistItem:hasResponse ()
Checks whether the checklist item has a response.

Returns:

    bool Always true.
automaticChecklistItem:evaluate ()
Checks whether the conditions of the checklist items are met.

Returns:

    bool True if the evaluation callback returns true, otherwise false.
generated by LDoc 1.4.6 Last updated 2022-05-28 12:58:52