timApp.modules.pali package#

Submodules#

timApp.modules.pali.pali_main module#

TIM example plugin: a palindrome checker.

class timApp.modules.pali.pali_main.PaliAnswerModel(info: tim_common.pluginserver_flask.InfoModel, markup: PluginMarkup, state: Optional[PluginState], taskID: str, input: PluginInput)[source]#

Bases: tim_common.pluginserver_flask.GenericAnswerModel[timApp.modules.pali.pali_main.PaliInputModel, timApp.modules.pali.pali_main.PaliMarkupModel, timApp.modules.pali.pali_main.PaliStateModel]

class timApp.modules.pali.pali_main.PaliHtmlModel(info: tim_common.pluginserver_flask.InfoModel | None, markup: ~PluginMarkup, state: Optional[~PluginState], taskID: str, anonymous: bool, current_user_id: str, doLazy: tim_common.pluginserver_flask.Laziness, preview: bool, review: bool, targetFormat: str, taskIDExt: str, user_id: str, userPrint: bool, viewmode: bool, access: str | marshmallow.utils._Missing = <marshmallow.missing>)[source]#

Bases: tim_common.pluginserver_flask.GenericHtmlModel[timApp.modules.pali.pali_main.PaliInputModel, timApp.modules.pali.pali_main.PaliMarkupModel, timApp.modules.pali.pali_main.PaliStateModel]

get_component_html_name() str[source]#

Gets the name of the Angular component as it should be in HTML.

get_static_html() str[source]#

Renders a static version of the plugin.

This is meant to be a static lightweight lookalike version of the plugin.

class timApp.modules.pali.pali_main.PaliInputModel(userword: str, paliOK: bool | marshmallow.utils._Missing = <marshmallow.missing>, nosave: bool | marshmallow.utils._Missing = <marshmallow.missing>)[source]#

Bases: object

Model for the information that is sent from browser (plugin AngularJS component).

nosave: bool | marshmallow.utils._Missing = <marshmallow.missing>#
paliOK: bool | marshmallow.utils._Missing = <marshmallow.missing>#
userword: str#
validate_userword(word: str) None[source]#
class timApp.modules.pali.pali_main.PaliMarkupModel(accessDuration: int | None | marshmallow.utils._Missing = <marshmallow.missing>, accessEndText: str | None | marshmallow.utils._Missing = <marshmallow.missing>, anonymous: bool | None | marshmallow.utils._Missing = <marshmallow.missing>, answerLimit: int | None | marshmallow.utils._Missing = <marshmallow.missing>, automd: bool | None | marshmallow.utils._Missing = <marshmallow.missing>, buttonNewTask: str | None | marshmallow.utils._Missing = <marshmallow.missing>, cache: bool | None | marshmallow.utils._Missing = <marshmallow.missing>, deadline: Union[tim_common.markupmodels.PluginDateTime, datetime.datetime, NoneType, marshmallow.utils._Missing] = <marshmallow.missing>, fields: list[str] | None | marshmallow.utils._Missing = <marshmallow.missing>, floatHeader: str | None | marshmallow.utils._Missing = <marshmallow.missing>, floatSize: tuple[int, int] | None | marshmallow.utils._Missing = <marshmallow.missing>, header: str | None | marshmallow.utils._Missing = <marshmallow.missing>, headerText: str | None | marshmallow.utils._Missing = <marshmallow.missing>, hideBrowser: bool | marshmallow.utils._Missing | None = <marshmallow.missing>, initNewAnswer: str | None | marshmallow.utils._Missing = <marshmallow.missing>, lazy: bool | marshmallow.utils._Missing = <marshmallow.missing>, maxHeight: str | None | marshmallow.utils._Missing = <marshmallow.missing>, minHeight: str | None | marshmallow.utils._Missing = <marshmallow.missing>, pointsRule: tim_common.markupmodels.PointsRule | None | marshmallow.utils._Missing = <marshmallow.missing>, pointsText: str | None | marshmallow.utils._Missing = <marshmallow.missing>, postprogram: str | marshmallow.utils._Missing = <marshmallow.missing>, postoutput: str | marshmallow.utils._Missing = <marshmallow.missing>, showPoints: bool | None | marshmallow.utils._Missing = <marshmallow.missing>, starttime: Union[tim_common.markupmodels.PluginDateTime, datetime.datetime, NoneType, marshmallow.utils._Missing] = <marshmallow.missing>, showInView: bool | marshmallow.utils._Missing = <marshmallow.missing>, stem: str | None | marshmallow.utils._Missing = <marshmallow.missing>, triesText: str | None | marshmallow.utils._Missing = <marshmallow.missing>, useCurrentUser: bool | None | marshmallow.utils._Missing = <marshmallow.missing>, texafterprint: str | None | marshmallow.utils._Missing = <marshmallow.missing>, texbeforeprint: str | None | marshmallow.utils._Missing = <marshmallow.missing>, texprint: str | None | marshmallow.utils._Missing = <marshmallow.missing>, hidden_keys: list[str] | marshmallow.utils._Missing = <marshmallow.missing>, button: str | None | marshmallow.utils._Missing = <marshmallow.missing>, buttonText: str | None | marshmallow.utils._Missing = <marshmallow.missing>, allowUnsavedLeave: bool | marshmallow.utils._Missing | None = <marshmallow.missing>, disableUnchanged: bool | marshmallow.utils._Missing | None = <marshmallow.missing>, footer: str | marshmallow.utils._Missing = <marshmallow.missing>, forceBrowser: bool | marshmallow.utils._Missing | None = <marshmallow.missing>, globalField: bool | marshmallow.utils._Missing | None = <marshmallow.missing>, readonly: bool | marshmallow.utils._Missing | None = <marshmallow.missing>, lang: str | None | marshmallow.utils._Missing = <marshmallow.missing>, resetText: str | marshmallow.utils._Missing | None = <marshmallow.missing>, connectionErrorMessage: str | marshmallow.utils._Missing = <marshmallow.missing>, undo: tim_common.markupmodels.UndoInfo | marshmallow.utils._Missing | None = <marshmallow.missing>, points_array: list[list[float]] | marshmallow.utils._Missing = <marshmallow.missing>, inputstem: str | marshmallow.utils._Missing = <marshmallow.missing>, needed_len: int | marshmallow.utils._Missing = <marshmallow.missing>, initword: str | marshmallow.utils._Missing = <marshmallow.missing>, cols: int | marshmallow.utils._Missing = <marshmallow.missing>, inputplaceholder: str | marshmallow.utils._Missing = <marshmallow.missing>)[source]#

Bases: tim_common.markupmodels.GenericMarkupModel

cols: int | marshmallow.utils._Missing = <marshmallow.missing>#
initword: str | marshmallow.utils._Missing = <marshmallow.missing>#
inputplaceholder: str | marshmallow.utils._Missing = <marshmallow.missing>#
inputstem: str | marshmallow.utils._Missing = <marshmallow.missing>#
needed_len: int | marshmallow.utils._Missing = <marshmallow.missing>#
points_array: list[list[float]] | marshmallow.utils._Missing = <marshmallow.missing>#
validate_points_array(value: list[list[float]] | marshmallow.utils._Missing) None[source]#
class timApp.modules.pali.pali_main.PaliStateModel(userword: str)[source]#

Bases: object

Model for the information that is stored in TIM database for each answer.

userword: str#
timApp.modules.pali.pali_main.answer(args: timApp.modules.pali.pali_main.PaliAnswerModel) tim_common.pluginserver_flask.PluginAnswerResp[source]#
timApp.modules.pali.pali_main.check_letters(word: str, needed_len: int) bool[source]#

Checks if word has needed amount of chars.

Parameters
  • word – word to check

  • needed_len – how many letters needed

Returns

true if len match

timApp.modules.pali.pali_main.render_static_pali(m: timApp.modules.pali.pali_main.PaliHtmlModel) str[source]#
timApp.modules.pali.pali_main.reqs() tim_common.pluginserver_flask.PluginReqs[source]#

Module contents#