Class ::xowf::test_item::Renaming_form_loader

::xowf::test_item::Renaming_form_loader[i] create ...

Form loader that renames "generic" form-field-names as provided by the test-item form-field classes (@answer@) into names based on the form name, such that multiple of these form names can be processed together without name clashes. - answer_attributes - answer_for_form - answers_for_form - form_name_based_attribute_stem - name_to_question_obj_dict - rename_attributes
Defined in packages/xowf/tcl/test-item-procs.tcl

Class Relations

  • class: ::nx::Class[i]
  • superclass: ::xowf::test_item::AssessmentInterface[i]

Methods (to be applied on instances)

  • answer_attributes (scripted, public)

     <instance of xowf::test_item::Renaming_form_loader[i]> answer_attributes \
        instance_attributes

    Return all form-loader specific attributes from instance_attributes.

    Parameters:
    instance_attributes (required)

    Testcases:
    No testcase defined.
  • answer_for_form (scripted, public)

     <instance of xowf::test_item::Renaming_form_loader[i]> answer_for_form \
        formName instance_attributes

    Return answer for the provided formName from instance_attributes of a single object.

    Parameters:
    formName (required)
    instance_attributes (required)

    Testcases:
    No testcase defined.
  • answers_for_form (scripted, public)

     <instance of xowf::test_item::Renaming_form_loader[i]> answers_for_form \
        formName answers

    Return a list of dicts for the provided formName from the answers (as returned from [answer_manager get_answer_attributes ...]).

    Parameters:
    formName (required)
    answers (required)

    Testcases:
    No testcase defined.
  • form_name_based_attribute_stem (scripted, public)

     <instance of xowf::test_item::Renaming_form_loader[i]> form_name_based_attribute_stem \
        formName

    Produce from the provided 'formName' an attribute stem for the input fields of this form.

    Parameters:
    formName (required)

    Testcases:
    No testcase defined.
  • name_to_question_obj_dict (scripted, public)

     <instance of xowf::test_item::Renaming_form_loader[i]> name_to_question_obj_dict \
        question_objs

    Produce a dict for attribute name to question_obj

    Parameters:
    question_objs (required)

    Testcases:
    No testcase defined.
  • rename_attributes (scripted, public)

     <instance of xowf::test_item::Renaming_form_loader[i]> rename_attributes \
        form_obj

    Perform attribute renaming in the provided form_obj and return this form_obj. In essence, this changes the generic "@answer@" value in the form and in the form constraints to a name based on the form name.

    Parameters:
    form_obj (required, object)

    Testcases:
    No testcase defined.