%3 ::xowiki::formfield::grade_boundary ::xowiki::formfield::grade_boundary render_input ::xowiki::formfield::number ::xowiki::formfield::number initialize render_input ::xowiki::formfield::grade_boundary->::xowiki::formfield::number ::xowiki::formfield::FormField ::xowiki::formfield::FormField → fc_decode → fc_encode → get_from_name → get_single_spec → interprete_condition CSSclass_list_add add_statistics answer_check=AND answer_check=answer_words answer_check=btwn answer_check=contains answer_check=contains-not answer_check=eq answer_check=ge answer_check=gt answer_check=in answer_check=le answer_check=lt answer_check=match answer_is_correct asWidgetSpec behavior booleanAttributes config_from_spec convert_to_external convert_to_internal describe dict_to_fc dict_to_spec dict_value escape_message_keys field_value handle_transmit_always has_instance_variable init initialize interprete_single_spec is_disabled is_repeat_template_p leaf_components localize make_correct pretty_image pretty_value process_correct_when_modifier remove_omit render render_answer_statistics render_collapsed render_disabled_as_div render_error_msg render_form_widget render_help_text render_input render_item render_localizer render_modal render_result_statistics render_word_statistics repeat repeat_add_label resetBooleanAttributes reset_on_validation_error reset_parameter same_value set_disabled set_feedback set_is_repeat_template stats_record_count validate validation_check value_if_nothing_is_returned_from_form word_statistics ::xowiki::formfield::number->::xowiki::formfield::FormField ::xo::tdom::Object ::xo::tdom::Object ::xowiki::formfield::FormField->::xo::tdom::Object

Class ::xowiki::formfield::grade_boundary

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

Class Relations

  • class: ::xotcl::Class[i]
  • superclass: ::xowiki::formfield::number[i]
::xotcl::Class create ::xowiki::formfield::grade_boundary \
     -superclass ::xowiki::formfield::number

Methods (to be applied on instances)

  • render_input (scripted)

    #
    # The definition of this validator assumes 4 grade boundaries with
    # exactly these naming conventions. The corresponding form is
    # defined in edit-grading-scheme.wf.
    #
    next
    template::add_event_listener -event input -id ${:id} -script {
      const inputField = event.target;
      const form = inputField.parentNode.parentNode;
      //console.log('check descending values');
      const grade1 = form.elements["grade1"];
      const grade2 = form.elements["grade2"];
      const grade3 = form.elements["grade3"];
      const grade4 = form.elements["grade4"];
      if (grade1.value < grade2.value) {
        console.log('error grade 1');
        grade2.setCustomValidity('percentage for grade 1 must by larger than grade 2');
      } else {
        grade2.setCustomValidity('');
      }
      if (grade2.value < grade3.value) {
        console.log('error grade 2');
        grade3.setCustomValidity('percentage for grade 2 must by larger than grade 3');
      } else {
        grade3.setCustomValidity('');
      }
      if (grade3.value < grade4.value) {
        console.log('error grade 3');
        grade4.setCustomValidity('percentage for grade 3 must by larger than grade 4');
      } else {
        grade4.setCustomValidity('');
      }
    }