The sessions feature


The easiest way to understand sessions is to consider it a development of university semesters: it is
  • a set of (0 to n) courses
  • assigned to a group of (0 to n) students
  • within a period of time (from one start date to an end date)
  • with a general session coordinator (1)
  • with (0 to n) tutor/assistant/coach (the name has not been completely agreed on) for each course inside this session

A large list of additional features has been developed on top of this concept, like filtered tracking for assistants, copy of sessions, removal of one student from just one course, assignment of student classes to sessions, etc

Sessions can be considered a "window" to the course content (much like if the course was a "non-central" repository). As such, the content that is built inside the courses (that are included inside the sessions) cannot be removed from the sessions (although it can be hidden there if considered). Additional content can be added to the course in one session, in which case it will not be visible in any other session.


This is the current database structure for sessions in Chamilo 1.9

CREATE TABLE session (
  id smallint unsigned NOT NULL auto_increment,
  id_coach int unsigned NOT NULL default '0',
  name char(50) NOT NULL default '',
  nbr_courses smallint unsigned NOT NULL default '0',
  nbr_users mediumint unsigned NOT NULL default '0',
  nbr_classes mediumint unsigned NOT NULL default '0',
  date_start date NOT NULL default '0000-00-00',
  date_end date NOT NULL default '0000-00-00',
  nb_days_access_before_beginning TINYINT UNSIGNED NULL default '0',
  nb_days_access_after_end TINYINT UNSIGNED NULL default '0',
  session_admin_id INT UNSIGNED NOT NULL,
  visibility int NOT NULL default 1,
  session_category_id int NOT NULL,
  promotion_id INT NOT NULL,
  PRIMARY KEY  (id),
  INDEX (session_admin_id),
  UNIQUE KEY name (name)
DROP TABLE IF EXISTS session_rel_course;
CREATE TABLE session_rel_course (
  id_session smallint unsigned NOT NULL default '0',
  course_code char(40) NOT NULL default '',
  nbr_users smallint unsigned NOT NULL default '0',
  PRIMARY KEY  (id_session,course_code),
  KEY course_code (course_code)
DROP TABLE IF EXISTS session_rel_course_rel_user;
CREATE TABLE session_rel_course_rel_user (
  id_session smallint unsigned NOT NULL default '0',
  course_code char(40) NOT NULL default '',
  id_user int unsigned NOT NULL default '0',
  visibility int NOT NULL default 1,
  status int NOT NULL default 0,
  legal_agreement INTEGER DEFAULT 0,
  PRIMARY KEY  (id_session,course_code,id_user),
  KEY id_user (id_user),
  KEY course_code (course_code)
DROP TABLE IF EXISTS session_rel_user;
CREATE TABLE session_rel_user (
  id_session mediumint unsigned NOT NULL default '0',
  id_user mediumint unsigned NOT NULL default '0',
  relation_type int default 0,
  PRIMARY KEY (id_session, id_user, relation_type)
DROP TABLE IF EXISTS session_field;
CREATE TABLE session_field (
    id  int NOT NULL auto_increment,
    field_type int NOT NULL default 1,
    field_variable  varchar(64) NOT NULL,
    field_display_text  varchar(64),
    field_default_value text,
    field_order int,
    field_visible tinyint default 0,
    field_changeable tinyint default 0,
    field_filter tinyint default 0,
    tms DATETIME NOT NULL default '0000-00-00 00:00:00',
DROP TABLE IF EXISTS session_field_values;
CREATE TABLE session_field_values(
    id  int NOT NULL auto_increment,
    session_id int NOT NULL,
    field_id int NOT NULL,
    field_value text,
    tms DATETIME NOT NULL default '0000-00-00 00:00:00',
DROP TABLE IF EXISTS access_url_rel_session;
CREATE TABLE access_url_rel_session (
  access_url_id int unsigned NOT NULL,
  session_id int unsigned NOT NULL,
  PRIMARY KEY (access_url_id, session_id)
DROP TABLE IF EXISTS session_category;
CREATE TABLE session_category (
    id int NOT NULL auto_increment,
    name varchar(100) default NULL,
    date_start date default NULL,
    date_end date default NULL,
        access_url_id INT NOT NULL default 1,
CREATE TABLE usergroup_rel_session (
    usergroup_id INT NOT NULL,
    session_id  INT NOT NULL

LOCK TABLES settings_current WRITE;
INSERT INTO settings_current
(variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable)
('use_session_mode', NULL, 'radio','Platform','true', 'UseSessionModeTitle','UseSessionModeComment', NULL, NULL, 0),
('show_session_coach', NULL, 'radio','Platform','false', 'ShowSessionCoachTitle','ShowSessionCoachComment', NULL, NULL, 0),
('show_session_data', NULL, 'radio', 'Course', 'false', 'ShowSessionDataTitle', 'ShowSessionDataComment', NULL, NULL, 1),
('allow_coach_to_edit_course_session',NULL,'radio','Course','true','AllowCoachsToEditInsideTrainingSessions','AllowCoachsToEditInsideTrainingSessionsComment',NULL,NULL, 0),
('hide_courses_in_sessions',NULL,'radio', 'Platform','false','HideCoursesInSessionsTitle',      'HideCoursesInSessionsComment','platform',NULL, 1),
('sessionadmin_page_after_login', NULL, 'textfield', 'Platform', '', 'SessionAdminPageAfterLoginTitle', 'SessionAdminPageAfterLoginComment', NULL, NULL, 0),
('sessionadmin_autosubscribe', NULL, 'textfield', 'Platform', '', 'SessionadminAutosubscribeTitle', 'SessionadminAutosubscribeComment', NULL, NULL, 0),

Sessions-courses relations

Sessions-users relations

Subscribing a student to a session

Unsubscribing a student from a session

Unsubsribing a student from only one course inside a session

Subscribing a users class to a session

In Chamilo, we added the possibility to form users groups and register them to a session. In this case, a relationship between the students and the session is directly added to the session_rel_user table, and the subsequent possible removal of the users group from the session generates a removal of all the students from the session in session_rel_user table.

Specific privileges

Sessions admin

The session admin is an administrator that only has access to the administration panel for the following:
  • registration of new users on the platform
  • registration of platform users into his sessions
  • CRUD of sessions
  • assignment of session coordinator to existing sessions
  • tracking (control panel) of specific users from his sessions (assigned by him or a global admin)

It is a specific role that shouldn't (in 1.9) be used as a normal teacher or student

Session coordinator

The session coordinator is assigned by a global or session administrator. He is responsible for coordinating between all course tutors inside the session, and is a general contact point for students with specific queries about their session.
As a coordinator, he is considered equal to the combination of all tutors inside his session.

One coordinator can be assigned to more than one session at the same time, but a session can only have a maximum of one coordinator.

Session-course assistant/tutor/coach

A session-course tutor is considered the "teacher" (or assistant) for a specific course inside a session. As in universities, a special expert in the course topic designed the course and is teaching th theory, but he is not the one to give the students their exercises and generally "coaches" them during the semester. As such, other teachers, called "tutors" or "assistants" or even "coaches" in the corporate world are assigned the following up of all students. This is what this role is about.

The subtilty is that the tutor can add content to his own session and track the progress of the students in his session, but he can't see anything about the same course in another session, or the same students in another course, nor about another course in the same session.

Editing inside a session

Tutors have a (configurable) access to edit content inside their course: they can hide main content (only valid for their session) or they can add content and subsequently remove the content they (or their students) have added.

Web services

In order to enable the synchronization with other business systems, the sessions tables include the session_field and session_field_values table, which hold extra data about the unique identifier of the session in the external system, so it can easily be retrieved afterwards (to check the difference and synchronize). Web services about the sessions can be found in main/web_services/registration.php