<?xml version="1.0" encoding="UTF-8"?>
<chapter>
  <title>Data Model</title>

  <para>The following data model stores the relevant information that can be
  in an IMS-LD file. The tables are the ones needed to store the interesting
  part of the information from IMS-LD specification that we consider is
  necessary in order to play the unit of learning correctly.</para>

  <para>At present, the data model does not have into account the interaction
  with the rest of the .LRN packages, because the tables needed for that
  interaction will be defined in the development phase. Also, the tables might
  change during the development phase, because we can find better ways to
  structure the information, but the final data model, in our opinion, will
  not be too different from the one presented here.</para>

  <para>The complete data model is presented in an Entity-Relationship (ER)
  diagram that is divided in three blocks, each one related to a level of the
  IMS-LD specification. The tables of the .LRN model for supporting IMS-LD of
  a level are not independent from the other levels, and the relationships of
  the three diagrams have been represented. In the tables of the E-R diagrams
  are presented only the primary keys and foreign keys. This is in order to
  achieve clarity and simplicity because the diagram is too big. Nevertheless,
  all the fields of the proposed diagram are presented and explained next,
  divided by the three levels of IMS-LD.</para>

  <para>Next, each table of the data model is described divided in the three
  levels of the IMS-LD specification</para>

  <para>IMPORTANT NOTE: The present Data Model will be normalize in the near
  time in order to improve its understanding.</para>

  <section>
    <title>Level A</title>

    <para>Next, the tables necessary for Level A are draw in the form of an
    E-R diagram</para>

    <para><ulink url="resources/imsld_diagram_A.GIF"><inlinemediaobject>
        <imageobject>
          <imagedata fileref="resources/imsld_diagram_A.GIF" />
        </imageobject>
      </inlinemediaobject></ulink></para>

    <para><itemizedlist>
        <listitem>
          <para>imsld_imslds: This table is used to store all the units of
          learning. This is the high level in the hierarchy. Each IMS-LD file
          loaded in .LRN will generate a row in this table. This table
          contains all the different units of learning. Each unit of learning
          will contain global information and also references to other tables,
          in order to represent completely the information represented by the
          unit of learning.</para>

          <itemizedlist>
            <listitem>
              <para>imsld_id - identifier</para>
            </listitem>

            <listitem>
              <para>version - version number</para>
            </listitem>

            <listitem>
              <para>level - A, B or C. It is the level of the IMS-LD file that
              arrive</para>
            </listitem>

            <listitem>
              <para>sequence_used_p - sequence used, true or false. True means
              simple sequencing is being used. Defaults to false</para>
            </listitem>

            <listitem>
              <para>learning_objective_itemmodel_id - references
              imsld_itemmodels and contains the objectives of the unit of
              learning</para>
            </listitem>

            <listitem>
              <para>title</para>
            </listitem>

            <listitem>
              <para>method_id - references imsld_methods</para>
            </listitem>

            <listitem>
              <para>prerequisite_itemmodel_id - references imsld_itemmodels
              and contains the prerequisites for the unit of learning</para>
            </listitem>

            <listitem>
              <para>component_id - references imsld_components</para>
            </listitem>

            <listitem>
              <para>when_property_value_is_set** - references
              imsld_when_property_value_is_set. Treated with more detail in
              level B</para>
            </listitem>
          </itemizedlist>
        </listitem>

        <listitem>
          <para>imsld_components: Used to store all the components of the
          IMS-LD (which are: roles, acitivities and environments. The
          activities references this table)</para>

          <itemizedlist>
            <listitem>
              <para>component_id</para>
            </listitem>

            <listitem>
              <para>role_id - references imsld_roles</para>
            </listitem>

            <listitem>
              <para>environment_id - references imsld_environments</para>
            </listitem>

            <listitem>
              <para>property_id ** - references imsld_properties</para>
            </listitem>
          </itemizedlist>
        </listitem>

        <listitem>
          <para>imsld_roles. This table contains all the defined roles</para>

          <itemizedlist>
            <listitem>
              <para>role_id - references imsld_roles</para>
            </listitem>

            <listitem>
              <para>role_type</para>
            </listitem>

            <listitem>
              <para>create_new_p - multopleoccurrences of this role may be
              created during runtime?</para>
            </listitem>

            <listitem>
              <para>match_persons - exclusively-in-roles,
              not-exclusively</para>
            </listitem>

            <listitem>
              <para>max_persons. Maximum number of persons for this
              role</para>
            </listitem>

            <listitem>
              <para>min_persons. Minimum number of persons for this
              role</para>
            </listitem>

            <listitem>
              <para>role_name. The name of the role</para>
            </listitem>

            <listitem>
              <para>information_itemmodel_id - references imsld_items</para>
            </listitem>

            <listitem>
              <para>parent_role_id. The parent role. This allows a hierarchy
              of roles. The root of the hierarchy are learner and stuff, which
              has not a parent role</para>
            </listitem>
          </itemizedlist>
        </listitem>

        <listitem>
          <para>imsld_learning_activities. This table stores all the learning
          activities of IMS-LD</para>

          <itemizedlist>
            <listitem>
              <para>learning_activity_id - references imsld_activities</para>
            </listitem>

            <listitem>
              <para>title</para>
            </listitem>

            <listitem>
              <para>component_id - references imsld_components</para>
            </listitem>

            <listitem>
              <para>isvisible_p - initial visibility attribute. Initial value:
              true</para>
            </listitem>

            <listitem>
              <para>learning_objective_itemmodel_id - references
              imsld_itemmodels</para>
            </listitem>

            <listitem>
              <para>time_limit_id - references imsld_time_limits</para>
            </listitem>

            <listitem>
              <para>prerequisite_itemmodel_id - references
              imsld_itemmodels</para>
            </listitem>

            <listitem>
              <para>parameter_value</para>
            </listitem>

            <listitem>
              <para>activity_description_itemmodel_id - references
              imsld_itemmodels</para>
            </listitem>

            <listitem>
              <para>on_completion_id - references imsld_on_completions</para>
            </listitem>

            <listitem>
              <para>identifier - unique identifier of the activity</para>
            </listitem>
          </itemizedlist>
        </listitem>

        <listitem>
          <para>imsld_support_activities. This table stores all the support
          activities of IMS-LD</para>

          <itemizedlist>
            <listitem>
              <para>support_activity_id - references imsld_activities</para>
            </listitem>

            <listitem>
              <para>component_id - references imsld_components</para>
            </listitem>

            <listitem>
              <para>isvisible_p - initial visibility attribute. Initial value:
              true</para>
            </listitem>

            <listitem>
              <para>title. The name of the support activity</para>
            </listitem>

            <listitem>
              <para>parameter_value</para>
            </listitem>

            <listitem>
              <para>activity_description_itemmodel_id - references
              imsld_itemmodels</para>
            </listitem>

            <listitem>
              <para>user_choice - The user decides when the activity is
              completed</para>
            </listitem>

            <listitem>
              <para>time_limit_id - If user_choice is null, the activity will
              be completed until the time referenced by this id has been
              expired.</para>
            </listitem>

            <listitem>
              <para>on_completion_id - references imsld_on_completions</para>
            </listitem>

            <listitem>
              <para>identifier - unique identifier of the acrivity</para>
            </listitem>
          </itemizedlist>
        </listitem>

        <listitem>
          <para>imsld_activity_structures. This table contains all the
          activity structures of IMS-LD. Each entry is one activity
          structure.</para>

          <itemizedlist>
            <listitem>
              <para>activity_structure_id - references imsld_activities</para>
            </listitem>

            <listitem>
              <para>component_id - references imsld_components</para>
            </listitem>

            <listitem>
              <para>number_to_select - if not null, the activity structure is
              completed when the number of activities completed equals the
              number set</para>
            </listitem>

            <listitem>
              <para>sort - possible values: as-is, visibility-order</para>
            </listitem>

            <listitem>
              <para>structure_type - sequence or selection</para>
            </listitem>

            <listitem>
              <para>title. The name of the activity structure</para>
            </listitem>

            <listitem>
              <para>information_itemmodel_id - references
              imsld_itemmodels</para>
            </listitem>

            <listitem>
              <para>identifier</para>
            </listitem>
          </itemizedlist>
        </listitem>

        <listitem>
          <para>imsld_environments. This table contains the environments of
          the unit of learning. An environment consists of learning objects,
          services and other environments, and it can be referentiated by some
          other tables too.</para>

          <itemizedlist>
            <listitem>
              <para>environment_id</para>
            </listitem>

            <listitem>
              <para>parent_environment_id</para>
            </listitem>

            <listitem>
              <para>title</para>
            </listitem>
          </itemizedlist>
        </listitem>

        <listitem>
          <para>imsld_learning_objects</para>

          <itemizedlist>
            <listitem>
              <para>learning_object_id</para>
            </listitem>

            <listitem>
              <para>class</para>
            </listitem>

            <listitem>
              <para>isvisible_p - the user decides when the activity is
              completed?</para>
            </listitem>

            <listitem>
              <para>parameter_value</para>
            </listitem>

            <listitem>
              <para>type - knowledge-object, tool-object, test-object, etc.
              (learning resource type from the IEEE LTSC LOM)</para>
            </listitem>

            <listitem>
              <para>environment_id - references imsld_environments</para>
            </listitem>

            <listitem>
              <para>schema_version</para>
            </listitem>
          </itemizedlist>
        </listitem>

        <listitem>
          <para>imsld_email_services. It describes all the email
          services</para>

          <itemizedlist>
            <listitem>
              <para>email_service_id</para>
            </listitem>

            <listitem>
              <para>select - all-persons-in-role, persons-in-role</para>
            </listitem>

            <listitem>
              <para>title</para>
            </listitem>

            <listitem>
              <para>is_visible_p</para>
            </listitem>
          </itemizedlist>
        </listitem>

        <listitem>
          <para>imsld_email_data</para>

          <itemizedlist>
            <listitem>
              <para>sendmail_service_id - references
              imsld_email_services</para>
            </listitem>

            <listitem>
              <para>role_id - references imsld_roles</para>
            </listitem>

            <listitem>
              <para>email_data</para>
            </listitem>

            <listitem>
              <para>email_property_id - references imsld_properties **</para>
            </listitem>

            <listitem>
              <para>username_property_id - references imsld_properties
              **</para>
            </listitem>
          </itemizedlist>
        </listitem>

        <listitem>
          <para>imsld_conference_services</para>

          <itemizedlist>
            <listitem>
              <para>conference_id</para>
            </listitem>

            <listitem>
              <para>conference_type - synchronous, asynchronous or
              announcement</para>
            </listitem>

            <listitem>
              <para>title</para>
            </listitem>

            <listitem>
              <para>item_id - references imsld_items</para>
            </listitem>

            <listitem>
              <para>is_visible_p</para>
            </listitem>
          </itemizedlist>
        </listitem>

        <listitem>
          <para>imsld_index_search_services</para>

          <itemizedlist>
            <listitem>
              <para>search_service_id</para>
            </listitem>

            <listitem>
              <para>title</para>
            </listitem>

            <listitem>
              <para>index_class - this element selects the calss to make the
              index on</para>
            </listitem>

            <listitem>
              <para>index_element - this element selects the element to make
              the index on</para>
            </listitem>

            <listitem>
              <para>index_type_of_element - type of element to index on</para>
            </listitem>

            <listitem>
              <para>search_type - type of search facility that is expected at
              runtime: free-text-search, index-with-reference,
              index-without-reference</para>
            </listitem>

            <listitem>
              <para>is_visible_p</para>
            </listitem>
          </itemizedlist>
        </listitem>

        <listitem>
          <para>imsld_methods</para>

          <itemizedlist>
            <listitem>
              <para>method_id</para>
            </listitem>

            <listitem>
              <para>time_limit_id - references imsld_time_limits. If not null,
              the method is completed when this time has been completed,
              otherwise, the method is completed when all the plays mapped to
              this method through the imsld_plays_to_complete_method are
              completed</para>
            </listitem>

            <listitem>
              <para>on_completion_id - references imsld_on_completions</para>
            </listitem>

            <listitem>
              <para>condition_id ** - references imsld_conditions</para>
            </listitem>
          </itemizedlist>
        </listitem>

        <listitem>
          <para>imsld_plays</para>

          <itemizedlist>
            <listitem>
              <para>play_id</para>
            </listitem>

            <listitem>
              <para>method_id - references imsld_methods</para>
            </listitem>

            <listitem>
              <para>is_visible_p - the user decides when the activity is
              completed?</para>
            </listitem>

            <listitem>
              <para>title</para>
            </listitem>

            <listitem>
              <para>when_last_act_completed the play is completed until the
              act referenced by this field is completed</para>
            </listitem>

            <listitem>
              <para>time_limit_id - references time_limits. If
              when_last_act_completed is null, the play is completed when the
              time indicated here has been completed</para>
            </listitem>

            <listitem>
              <para>on_completion_id - references imsld_on_completions</para>
            </listitem>
          </itemizedlist>
        </listitem>

        <listitem>
          <para>imsld_acts</para>

          <itemizedlist>
            <listitem>
              <para>act_id</para>
            </listitem>

            <listitem>
              <para>play_id - references imsld_plays</para>
            </listitem>

            <listitem>
              <para>title</para>
            </listitem>

            <listitem>
              <para>time_limit_id - if there are no role_parts mapped to this
              act throug the mapping table (explained later), the act is
              completed until the the time indicated here has been
              completed</para>
            </listitem>

            <listitem>
              <para>on_completion_id - references on_completion</para>
            </listitem>

            <listitem>
              <para>when_property_value_is_set ** - references
              imsld_when_property_value_is_set</para>
            </listitem>
          </itemizedlist>
        </listitem>

        <listitem>
          <para>imsld_role_parts</para>

          <itemizedlist>
            <listitem>
              <para>role_part_id - references imsld_part_id</para>
            </listitem>

            <listitem>
              <para>act_id - references imsld_acts</para>
            </listitem>

            <listitem>
              <para>role_id</para>
            </listitem>

            <listitem>
              <para>unit_of_learning_id - references imsld_imslds</para>
            </listitem>

            <listitem>
              <para>environment_id - references imsld_environments</para>
            </listitem>
          </itemizedlist>
        </listitem>

        <listitem>
          <para>imsld_on_completion</para>

          <itemizedlist>
            <listitem>
              <para>on_completion_id</para>
            </listitem>

            <listitem>
              <para>feedback_description_id - references
              imsld_itemmodels</para>
            </listitem>

            <listitem>
              <para>change_property_value_id ** - references
              imsld_change_property_value</para>
            </listitem>

            <listitem>
              <para>notification_id - references imsld_notifications
              ***</para>
            </listitem>
          </itemizedlist>
        </listitem>

        <listitem>
          <para>imsld_itemmodels. This is a table that contains a text and an
          id. In conjunction with the tables imsld_itemmodel and
          imsld_itemmodel_items_map allow to associate several items to the
          same itemmodel.</para>

          <itemizedlist>
            <listitem>
              <para>title</para>
            </listitem>

            <listitem>
              <para>itemmodel_id</para>
            </listitem>
          </itemizedlist>
        </listitem>

        <listitem>
          <para>imsld_items. Items are used for multiple purposes in other
          tables. For example it can describe objectives, prerequisites,
          references to files, etc.</para>

          <itemizedlist>
            <listitem>
              <para>item_id</para>
            </listitem>

            <listitem>
              <para>identifier. Unique identifier for the IMS-LD</para>
            </listitem>

            <listitem>
              <para>is_visible_p</para>
            </listitem>

            <listitem>
              <para>title: A text that can represent a prerequisite, an
              objective, the name of a file, etc.</para>
            </listitem>
          </itemizedlist>
        </listitem>

        <listitem>
          <para>imsld_time_limits</para>

          <itemizedlist>
            <listitem>
              <para>time_limit_id</para>
            </listitem>

            <listitem>
              <para>time_limit - amount of time in a specific format</para>
            </listitem>

            <listitem>
              <para>property_id ** - references imsld_properties</para>
            </listitem>
          </itemizedlist>
        </listitem>

        <listitem>
          <para>imsld_parameters</para>

          <itemizedlist>
            <listitem>
              <para>parameter_id</para>
            </listitem>

            <listitem>
              <para>parameter_value</para>
            </listitem>
          </itemizedlist>
        </listitem>

        <listitem>
          <para>imsld_imsld_objects_map. This is a very importan table in this
          data model, because it is used to map almost every imsld_* to every
          imsld_*. For instance, the activities that are part of a component
          are mapped by this table, and the acts to complete play are also
          mapped using this table. This is just a representation of the
          acs_rels table, because at the implementation phase, acs_rels will
          be used with different rel_types</para>

          <itemizedlist>
            <listitem>
              <para>imsld_object_one_id - references imsld_*
              (acs_objects)</para>
            </listitem>

            <listitem>
              <para>imsld_object_one_type - wich can be: learning_object,
              imsld_item, imsld_role, support_activity, etc</para>
            </listitem>

            <listitem>
              <para>imsld_object_two_id - references imsld_*
              (acs_objects)</para>
            </listitem>

            <listitem>
              <para>imsld_object_two_type - same as
              imsld_object_one_type</para>
            </listitem>
          </itemizedlist>
        </listitem>
      </itemizedlist></para>

    <para>IMPORTANT NOTES:</para>

    <orderedlist>
      <listitem>
        <para>The last table will use acs_rels. The rel_types will be
        completely defined in the implementation phase. By now we can think
        of: parent_item_rel, role_parts_activites_rel, component_service_rels,
        service_roles_rel, learning_object_item_rel,
        plays_to_complete_method_rel and role_parts_to_complete_act.</para>
      </listitem>

      <listitem>
        <para>There are some important IMS-LD tags (learning objectives, for
        instance) that does not have a table for themselves, but this is
        because such tags consist only of a reference to a itemmodel or
        another table, so there is no need to create a table just for
        that.</para>
      </listitem>

      <listitem>
        <para>This data model can (and it is 99% sure) change in the
        implementation phase, but we will base the development on this data
        model.</para>
      </listitem>

      <listitem>
        <para>There are some tables in this data model that will be related to
        some others of other .LRN packages. For instance, the table
        imsld_conferences will be used to store the synchronous type (forums)
        and asynchronous type (chats) of conferences. Also, we will use
        acs_objects for the imslds, activities, services, learning_objects,
        components, and for every case we find it useful. We can make use of
        the cr_items too. But that is something that we will know better in
        the implementation phase.</para>
      </listitem>
    </orderedlist>
  </section>

  <section>
    <title>Level B</title>

    <para>Level B extends the table email_data and add: username_property_id
    and email_property_id (**) Next is shown the E-R diagram for these
    tables</para>

    <para><ulink url="resources/imsld_diagram_B.GIF"><inlinemediaobject>
        <imageobject>
          <imagedata fileref="resources/imsld_diagram_B.GIF" />
        </imageobject>
      </inlinemediaobject></ulink></para>

    <itemizedlist>
      <listitem>
        <para>imsld_properties (add a reference to properties from
        imsld_components and time_limits **)</para>

        <itemizedlist>
          <listitem>
            <para>property_id</para>
          </listitem>
        </itemizedlist>
      </listitem>

      <listitem>
        <para>imsld_loc_locpers_locrole_properties: Combined table for the
        loc, locpers and locrole properties</para>

        <itemizedlist>
          <listitem>
            <para>property_id - references imsld_properties</para>
          </listitem>

          <listitem>
            <para>title. The name of the property</para>
          </listitem>

          <listitem>
            <para>datatype - references imsld_datatypes</para>
          </listitem>

          <listitem>
            <para>initial_value</para>
          </listitem>
        </itemizedlist>
      </listitem>

      <listitem>
        <para>imsld_globpers_glob_property: Combined table for the glob and
        globpers properties</para>

        <itemizedlist>
          <listitem>
            <para>property_id - references imsld_properties</para>
          </listitem>

          <listitem>
            <para>global_definition_id - references
            imsld_global_definitions</para>
          </listitem>

          <listitem>
            <para>existing</para>
          </listitem>
        </itemizedlist>
      </listitem>

      <listitem>
        <para>imsld_global_definitions</para>

        <itemizedlist>
          <listitem>
            <para>property_id - references imsld_properties</para>
          </listitem>

          <listitem>
            <para>uri</para>
          </listitem>

          <listitem>
            <para>title</para>
          </listitem>

          <listitem>
            <para>global_definition</para>
          </listitem>

          <listitem>
            <para>datatype_id</para>
          </listitem>

          <listitem>
            <para>initial_value</para>
          </listitem>
        </itemizedlist>
      </listitem>

      <listitem>
        <para>imsld_property_groups</para>

        <itemizedlist>
          <listitem>
            <para>property_group_id</para>
          </listitem>

          <listitem>
            <para>property_id - references imsld_properties</para>
          </listitem>

          <listitem>
            <para>title</para>
          </listitem>
        </itemizedlist>
      </listitem>

      <listitem>
        <para>imsld_group_property_choices</para>

        <itemizedlist>
          <listitem>
            <para>choice_id</para>
          </listitem>

          <listitem>
            <para>property_id - references imsld_properties</para>
          </listitem>

          <listitem>
            <para>proerty_group_id - references imsld_property_groups</para>
          </listitem>
        </itemizedlist>
      </listitem>

      <listitem>
        <para>imsld_restrictions</para>

        <itemizedlist>
          <listitem>
            <para>restriction_id</para>
          </listitem>

          <listitem>
            <para>restriction_type - minExclusive, minInclusive, maxExclusive,
            maxInclusive, totalDigits, fractionDigits, length, minLength,
            maxLength, enumeration, whiteSpace, pattern</para>
          </listitem>

          <listitem>
            <para>restriction</para>
          </listitem>
        </itemizedlist>
      </listitem>

      <listitem>
        <para>imsld_property_restrictions_map</para>

        <itemizedlist>
          <listitem>
            <para>restriction_id - references imsld_restrictions</para>
          </listitem>

          <listitem>
            <para>property_id - references imsld_properties</para>
          </listitem>
        </itemizedlist>
      </listitem>

      <listitem>
        <para>imsld_datatypes</para>

        <itemizedlist>
          <listitem>
            <para>datatype_id</para>
          </listitem>

          <listitem>
            <para>datatype - string, boolean, integer, uri, datetime, file,
            real, tet, duration, other</para>
          </listitem>
        </itemizedlist>
      </listitem>

      <listitem>
        <para>imsld_when_property_value_is_set (add a reference to this table
        from the tables: complete_activities, complete_act, complete_play and
        complete_unit_of_learning **)</para>

        <itemizedlist>
          <listitem>
            <para>when_property_value_is_set_id</para>
          </listitem>

          <listitem>
            <para>property_id - references imsld_properties</para>
          </listitem>

          <listitem>
            <para>property_value_id - references property_values</para>
          </listitem>
        </itemizedlist>
      </listitem>

      <listitem>
        <para>imsld_property_values</para>

        <itemizedlist>
          <listitem>
            <para>property_value_id</para>
          </listitem>

          <listitem>
            <para>langstring</para>
          </listitem>

          <listitem>
            <para>calculate_id - references imsld_calculates</para>
          </listitem>

          <listitem>
            <para>property_id - references imsld_properties</para>
          </listitem>
        </itemizedlist>
      </listitem>

      <listitem>
        <para>imsld_change_property_values: A reference to this table must be
        added from the imsld_on_completion table in level A</para>

        <itemizedlist>
          <listitem>
            <para>change_property_value_id</para>
          </listitem>

          <listitem>
            <para>property_id - references imsld_properties</para>
          </listitem>

          <listitem>
            <para>property_value_id - references property_values</para>
          </listitem>
        </itemizedlist>
      </listitem>

      <listitem>
        <para>imsld_monitors</para>

        <itemizedlist>
          <listitem>
            <para>monitor_id</para>
          </listitem>

          <listitem>
            <para>service_id - references imsld_services</para>
          </listitem>

          <listitem>
            <para>monitor_choice_id - references imsld_monitor_choices</para>
          </listitem>
        </itemizedlist>
      </listitem>

      <listitem>
        <para>imsld_monitor_choices</para>

        <itemizedlist>
          <listitem>
            <para>choice_id</para>
          </listitem>

          <listitem>
            <para>role_id - references imsld_roles</para>
          </listitem>

          <listitem>
            <para>self - references imsld_roles</para>
          </listitem>
        </itemizedlist>
      </listitem>

      <listitem>
        <para>imsld_conditions: A reference to this table must be added from
        the table imsld_methods in level A</para>

        <itemizedlist>
          <listitem>
            <para>condition_id</para>
          </listitem>

          <listitem>
            <para>title</para>
          </listitem>
        </itemizedlist>
      </listitem>

      <listitem>
        <para>imsld_sequences</para>

        <itemizedlist>
          <listitem>
            <para>sequence_id</para>
          </listitem>

          <listitem>
            <para>condition_id - references imsld_conditions</para>
          </listitem>

          <listitem>
            <para>sequence_sort - to know how to evaluate the condition</para>
          </listitem>

          <listitem>
            <para>if_id - references imsld_ifs</para>
          </listitem>
        </itemizedlist>
      </listitem>

      <listitem>
        <para>imsld_then_model</para>

        <itemizedlist>
          <listitem>
            <para>then_model_id</para>
          </listitem>

          <listitem>
            <para>show_id - references imsld_show_hide</para>
          </listitem>

          <listitem>
            <para>hide_id - references imsld_show_hide</para>
          </listitem>

          <listitem>
            <para>change_property_value</para>
          </listitem>
        </itemizedlist>
      </listitem>

      <listitem>
        <para>imsld_ifs</para>

        <itemizedlist>
          <listitem>
            <para>if_id</para>
          </listitem>

          <listitem>
            <para>expression_id - references imsld_expressions</para>
          </listitem>

          <listitem>
            <para>true_thenmodel_id - 'then', evaluated if the expression is
            true. References imsld_then_model</para>
          </listitem>

          <listitem>
            <para>false_thenmodel_id - 'else', evaluated if the expression is
            false. References imsld_then_model</para>
          </listitem>
        </itemizedlist>
      </listitem>

      <listitem>
        <para>imsld_expressions - table holding the expressions. Instead of
        making a table for each type of expression, we store the
        expression_type and according to that value we know what other
        attributes in the table have to be stored in order to use them</para>

        <itemizedlist>
          <listitem>
            <para>expression_id</para>
          </listitem>

          <listitem>
            <para>expression_type - is-member-of-role, is, is-not, and, or,
            sum, subtract, multiply, divide, greater-than, less-than,
            users-in-role, no-value, time-unit-of-learning-started,
            datetime-activity-started, current-datetime, complete, not</para>
          </listitem>

          <listitem>
            <para>expression_id - references imsld_expressions</para>
          </listitem>

          <listitem>
            <para>calculate_id - references imsld_calculates</para>
          </listitem>

          <listitem>
            <para>expression_one_id - references imsld_expressions</para>
          </listitem>

          <listitem>
            <para>expression_two_id - references imsld_expressions</para>
          </listitem>

          <listitem>
            <para>role_id - references imsld_roles</para>
          </listitem>

          <listitem>
            <para>property_id - references imsld_properties</para>
          </listitem>

          <listitem>
            <para>time_unit_of_learning_started</para>
          </listitem>

          <listitem>
            <para>datetime_activity_started</para>
          </listitem>

          <listitem>
            <para>current_datetime</para>
          </listitem>
        </itemizedlist>
      </listitem>

      <listitem>
        <para>imsld_calculates</para>

        <itemizedlist>
          <listitem>
            <para>calculate_id</para>
          </listitem>

          <listitem>
            <para>right_operand - references imsld_operands</para>
          </listitem>

          <listitem>
            <para>left_operand - references imsld_operands</para>
          </listitem>
        </itemizedlist>
      </listitem>

      <listitem>
        <para>imsld_operands</para>

        <itemizedlist>
          <listitem>
            <para>operand_id</para>
          </listitem>

          <listitem>
            <para>property_id - references imsld_properties</para>
          </listitem>

          <listitem>
            <para>property_value - references imsld_property_values</para>
          </listitem>

          <listitem>
            <para>expression_id - references imsld_expressions</para>
          </listitem>
        </itemizedlist>
      </listitem>

      <listitem>
        <para>imsld_when_condition_true (add a reference from the
        imsld_complete_acts table **)</para>

        <itemizedlist>
          <listitem>
            <para>when_condition_true_id</para>
          </listitem>

          <listitem>
            <para>role_id - references imsld_roles</para>
          </listitem>

          <listitem>
            <para>expression_id - references imsld_expressions</para>
          </listitem>
        </itemizedlist>
      </listitem>

      <listitem>
        <para>imsld_show_hide</para>

        <itemizedlist>
          <listitem>
            <para>show_hide_id</para>
          </listitem>

          <listitem>
            <para>class</para>
          </listitem>

          <listitem>
            <para>item_id - references imsld_items</para>
          </listitem>

          <listitem>
            <para>environment_id - references imsld_environments</para>
          </listitem>

          <listitem>
            <para>learning_activity_id - references
            imsld_learning_activities</para>
          </listitem>

          <listitem>
            <para>support_activity_id - references
            imsld_support_activities</para>
          </listitem>

          <listitem>
            <para>activity_structure_id - references
            imsld_activity_structures</para>
          </listitem>

          <listitem>
            <para>play_id - references imsld_plays</para>
          </listitem>

          <listitem>
            <para>unit_of_learning_id - references imsld_imslds</para>
          </listitem>
        </itemizedlist>
      </listitem>

      <listitem>
        <para>imsld_global_elements</para>

        <itemizedlist>
          <listitem>
            <para>global_element_id</para>
          </listitem>

          <listitem>
            <para>view_set_property_id - references view_set_properties</para>
          </listitem>
        </itemizedlist>
      </listitem>

      <listitem>
        <para>imsld_view_set_properties</para>

        <itemizedlist>
          <listitem>
            <para>view_set_property_id</para>
          </listitem>

          <listitem>
            <para>type - view-property, view-property-group, set-property,
            set-property-group</para>
          </listitem>

          <listitem>
            <para>href</para>
          </listitem>

          <listitem>
            <para>property_of - self or supporter-person</para>
          </listitem>

          <listitem>
            <para>ref</para>
          </listitem>

          <listitem>
            <para>view - value or title-value</para>
          </listitem>

          <listitem>
            <para>max_transactions</para>
          </listitem>

          <listitem>
            <para>transaction_type</para>
          </listitem>

          <listitem>
            <para>notification_id - references imsld_notifications ***</para>
          </listitem>
        </itemizedlist>
      </listitem>
    </itemizedlist>
  </section>

  <section>
    <title>Level C</title>

    <para>Modify the imsld_email_data (***), add a reference to
    imsld_notifications table from imsld_on_completion, imsld_thens and
    imsld_view_set_properties table (***). Next is shown the E-R diagram that
    adds Level C</para>

    <para><ulink url="resources/imsld_diagram_C.GIF"><inlinemediaobject>
        <imageobject>
          <imagedata fileref="resources/imsld_diagram_C.GIF" />
        </imageobject>
      </inlinemediaobject></ulink></para>

    <itemizedlist>
      <listitem>
        <para>imsld_notifications</para>

        <itemizedlist>
          <listitem>
            <para>notification_id</para>
          </listitem>

          <listitem>
            <para>choice_id - references imsld_notifications_choice</para>
          </listitem>

          <listitem>
            <para>subject</para>
          </listitem>
        </itemizedlist>
      </listitem>

      <listitem>
        <para>imsld_notification_emails_data_map</para>

        <itemizedlist>
          <listitem>
            <para>notification_id - references imsld_notifications</para>
          </listitem>

          <listitem>
            <para>email_data_id - references imsld_email_data</para>
          </listitem>
        </itemizedlist>
      </listitem>

      <listitem>
        <para>imsld_notifications_choice</para>

        <itemizedlist>
          <listitem>
            <para>choice_id</para>
          </listitem>

          <listitem>
            <para>learning_activity_id - references
            imsld_learning_activities</para>
          </listitem>

          <listitem>
            <para>support_activity_id - references
            imsld_support_activities</para>
          </listitem>
        </itemizedlist>
      </listitem>
    </itemizedlist>
  </section>

  <section>
    <title>Run Tables</title>

    <para>The previous tables are referred to the IMS-LD specifications level
    A, B and C. They have all the information necessary to map an XML
    compliant IMS-LD document to the tables in the .LRN platform. But also,
    for the ims-ld package to interact with real users, we need additional
    tables. These new tables are necessary for the execution of the player
    where the information is sequenced to the student. These tables are
    described in this Section. Next is shown the E-R diagram for these
    tables</para>

    <para><ulink
    url="resources/imsld_diagram_run_tables.GIF"><inlinemediaobject>
        <imageobject>
          <imagedata fileref="resources/imsld_diagram_run_tables.GIF" />
        </imageobject>
      </inlinemediaobject></ulink></para>

    <itemizedlist>
      <listitem>
        <para>imsld_party_roles_map. This table maps parties of a .LRN course
        to the roles defined in the IMS-LD document. A party can be either a
        user or a group. One party can belong to several roles.</para>

        <itemizedlist>
          <listitem>
            <para>party_id references parties</para>
          </listitem>

          <listitem>
            <para>role_id references imsld_roles</para>
          </listitem>
        </itemizedlist>
      </listitem>

      <listitem>
        <para>imsld_parties_property_values_map. This table maps parties of a
        .LRN course to the properties defined in the IMS-LD document. One
        party can have several property values to establish. The properties
        can be local or global.</para>

        <itemizedlist>
          <listitem>
            <para>party_id references parties</para>
          </listitem>

          <listitem>
            <para>property_id references imsld_properties</para>
          </listitem>

          <listitem>
            <para>property_value. This is the value of the property for the
            party in a current moment. The value can change during the
            delivering of the unit of learning</para>
          </listitem>
        </itemizedlist>
      </listitem>

      <listitem>
        <para>imsld_roles_property_values_map. This table maps roles of the
        IMS-LD document to the properties of the IMS-LD document. One role can
        have several property values to establish. The properties can only be
        local.</para>

        <itemizedlist>
          <listitem>
            <para>roles_id references imsld_roles</para>
          </listitem>

          <listitem>
            <para>property_id references imsld_properties</para>
          </listitem>

          <listitem>
            <para>property_value. This is the value of the property for the
            role in a current moment. The value can change during the
            delivering of the unit of learning</para>
          </listitem>
        </itemizedlist>
      </listitem>

      <listitem>
        <para>imsld_property_values. This table stores the values of the
        properties that are common for all the users of the the IMS-LD
        document. There can be several property values to establish. The
        properties can be local or global.</para>

        <itemizedlist>
          <listitem>
            <para>property_id references imsld_properties</para>
          </listitem>
        </itemizedlist>

        <itemizedlist>
          <listitem>
            <para>property_value. This is the value of the property for the
            role in a current moment. The value can change during the
            delivering of the unit of learning</para>
          </listitem>
        </itemizedlist>
      </listitem>
    </itemizedlist>

    <itemizedlist>
      <listitem>
        <para>imsld_parties_activities_audit. This table stores all the .LRN
        parties information about the IMS-LD delivering that is of interest.
        related to activities At present we have defined only a little
        information, but in the future this information may be expanded. Each
        entry of the table has an activity that has been realized by a
        party.</para>

        <itemizedlist>
          <listitem>
            <para>party_id references parties</para>
          </listitem>

          <listitem>
            <para>activity_id references imsld_activity</para>
          </listitem>

          <listitem>
            <para>delivering_order. It represents the order of visualization
            of the activity in the sequence of activities</para>
          </listitem>

          <listitem>
            <para>selected_p. It is true if the party select by himself the
            activity. It is false if the activity was sequenced to the
            party</para>
          </listitem>

          <listitem>
            <para>start_time. The start time of the activity</para>
          </listitem>

          <listitem>
            <para>end_time. The end time of the activity</para>
          </listitem>

          <listitem>
            <para>done_p. It is true if the activity is complete</para>
          </listitem>

          <listitem>
            <para>act_id references ismld_parties_acts_audit</para>
          </listitem>
        </itemizedlist>
      </listitem>
    </itemizedlist>

    <itemizedlist>
      <listitem>
        <para>imsld_parties_acts_audit. This table stores all the .LRN parties
        information about the IMS-LD delivering that is of interest related to
        acts. At present we have defined only a little information, but in the
        future this information may be expanded. Each entry of the table has
        an act that has been realized by a party.</para>

        <itemizedlist>
          <listitem>
            <para>party_id references parties</para>
          </listitem>
        </itemizedlist>

        <itemizedlist>
          <listitem>
            <para>act_id references imsld_acts</para>
          </listitem>
        </itemizedlist>

        <itemizedlist>
          <listitem>
            <para>start_time. The start time of the act</para>
          </listitem>
        </itemizedlist>

        <itemizedlist>
          <listitem>
            <para>end_time. The end time of the activity</para>
          </listitem>

          <listitem>
            <para>done_p. It is true if the act is complete</para>
          </listitem>
        </itemizedlist>
      </listitem>

      <listitem>
        <para>imsld_parties_plays_audit. This table stores all the .LRN
        parties information about the IMS-LD delivering that is of interest
        related to plays. At present we have defined only a little
        information, but in the future this information may be expanded. Each
        entry of the table has an act that has been realized by a
        party.</para>

        <itemizedlist>
          <listitem>
            <para>party_id references parties</para>
          </listitem>
        </itemizedlist>

        <itemizedlist>
          <listitem>
            <para>play_id references imsld_plays</para>
          </listitem>
        </itemizedlist>

        <itemizedlist>
          <listitem>
            <para>start_time.The start time of the act</para>
          </listitem>
        </itemizedlist>

        <itemizedlist>
          <listitem>
            <para>end_time. The end time of the activity</para>
          </listitem>

          <listitem>
            <para>done_p. It is true if the act is complete</para>
          </listitem>
        </itemizedlist>
      </listitem>
    </itemizedlist>
  </section>
</chapter>