%3 ::xowiki::formfield::TestItemField ::xowiki::formfield::TestItemField QM attachments_widget comp_correct_when_from_value correct_when_spec correct_when_widget form_markup text_attachments twocol_layout ::xowiki::formfield::FormGeneratorField ::xowiki::formfield::FormGeneratorField pretty_value render_input ::xowiki::formfield::TestItemField->::xowiki::formfield::FormGeneratorField ::xowiki::formfield::CompoundField ::xowiki::formfield::CompoundField ::xowiki::formfield::FormGeneratorField->::xowiki::formfield::CompoundField ::xowiki::formfield::upload_interaction ::xowiki::formfield::upload_interaction convert_to_internal initialize ::xowiki::formfield::upload_interaction->::xowiki::formfield::TestItemField

Class ::xowiki::formfield::upload_interaction

::xowiki::formfield::upload_interaction[i] create ...

Class Relations

  • class: ::xotcl::Class[i]
  • superclass: ::xowiki::formfield::TestItemField[i]
::xotcl::Class create ::xowiki::formfield::upload_interaction \
     -superclass ::xowiki::formfield::TestItemField

Methods (to be applied on instances)

  • convert_to_internal (scripted)

    next
    set intro_text [:get_named_sub_component_value text]
    set max_nr_submission_files [${:parent_field} get_named_sub_component_value max_nr_submission_files]
    #dict set file_dict choose_file_label "Datei hochladen"
    
    set file_dict {_name answer _type file}
    if {$max_nr_submission_files > 1} {
      dict set file_dict repeat 1..$max_nr_submission_files
      dict set file_dict repeat_add_label #xowiki.form-repeatable-add-another-file#
      dict set file_dict label #xowf.online-exam-submission_files#
    } else {
      dict set file_dict label #xowf.online-exam-submission_file#
    }
    
    append intro_text [:text_attachments]
    set form [:form_markup -interaction upload -intro_text $intro_text -body @answer@]
    lappend fc  @categories:off @cr_fields:hidden  [:dict_to_spec $file_dict]
    
    ${:object} set_property -new 1 form $form
    ${:object} set_property -new 1 form_constraints $fc
    set anon_instances true ;# TODO make me configurable
    ${:object} set_property -new 1 anon_instances $anon_instances
    ${:object} set_property -new 1 auto_correct [[self class] set closed_question_type]
    ${:object} set_property -new 1 has_solution false
  • initialize (scripted)

    if {${:__state} ne "after_specs"} {
      return
    }
    set widget [test_item set richtextWidget]
    :create_components [subst {
      {text        {$widget,height=150px,label=#xowf.exercise-text#,plugins=OacsFs}}
      {attachments {[:attachments_widget ${:nr_attachments}]}}
    }]
    
    set :__initialized 1