Project

General

Profile

Actions

Feature #1244

open

Change all course literal codes to course integer ID's

Added by Yannick Warnier over 13 years ago. Updated over 7 years ago.

Status:
Needs testing
Priority:
Normal
Assignee:
-
Category:
Database & API changes
Target version:
Start date:
05/05/2010
Due date:
% Done:

100%

Estimated time:
100:00 h
Spent time:
Complexity:
Wizard-level
SCRUM pts - complexity:
100

Description

This is a MAJOR restructuring task. Because the literal course codes are such a performance-killer and a hazardous resource when it comes to deal with international strings*, we want to move to pure-integer identifiers for courses. This effectively means updating all tables and creating a new field course_id that will hold the course ID, then removing the course_code field.

All functions using the course code will have to be modified as well. I suggest doing this in three steps:
  • Adding the new field
  • Modifying the functions
  • Removing the old field

It is very important that the person working on this can work alone and has high time availability and a previous experience in Chamilo/Dokeos development.

  • This should be minimized by Ivan Tcholakov's changes to UTF-8 management

Related issues 1 (1 open0 closed)

Related to Chamilo LMS - Feature #7935: Migration from 1.10.x to 2.0 [master]Needs testing02/11/2015

Actions
Actions #1

Updated by Yannick Warnier about 13 years ago

  • Target version changed from 1.8.7.1 to 1.8.8 stable
Actions #2

Updated by Ivan Tcholakov about 13 years ago

Even after restructuring, I think course_code should stay, because it may serve as an external key for exact course identification in other information systems, and in documentation archives. Also, these non-numeric course codes (that may be generated by a convention) should be mentioned in the certificates issued.

By the way, in the certificates also user's official codes should be written, because user identification only by first and last names is incomplete, it is not enough.

Actions #3

Updated by Yannick Warnier over 12 years ago

  • Target version changed from 1.8.8 stable to 1.9 Stable
Actions #4

Updated by Julio Montoya over 11 years ago

  • Status changed from New to Needs more info
  • % Done changed from 0 to 10

all course tables now have a c_id (course id) which is an int value see #3910

this improvement will be good to replace all literal code to a int but it's a lot of work ...

Actions #5

Updated by Yannick Warnier over 11 years ago

  • Target version changed from 1.9 Stable to 1.9 RC1
Actions #6

Updated by Yannick Warnier about 11 years ago

  • Status changed from Needs more info to New
  • Target version changed from 1.9 RC1 to 2.0

Moving the rest to 1.10. Nice work so far.

Actions #7

Updated by Yannick Warnier over 7 years ago

  • Category set to Database & API changes
  • Status changed from New to Assigned
  • Assignee set to Angel Quiroz
  • % Done changed from 10 to 50

When changing course_code to c_id, it is important to remember to add the corresponding indexes to the tables (the ones that are present with course code should now exist with c_id).

It is also important to remember to check all possible uses of the field. Not only in queries that use the table name directly or the constant directly, but also in queries where the constant is first set into a variable (like $tCourseRelClass for example) and then used into the query.

Remaining course codes in:
  • course_rel_class.course_code
  • gradebook_category.course_code
  • gradebook_evaluation.course_code
  • gradebook_link.course_code
  • personal_agenda.course (not sure, check what's in there because it's a varchar(255))
  • search_engine_ref.course_code
  • shared_survey.course_code
  • specific_field.course_code
  • templates.course_code
  • track_e_attempt.course_code (this field can probably be completely removed now - after changing the corresponding PHP code - considering another c_id field is present)
  • track_e_hotspot.hotspot_course_code (this field can probably be completely removed now - after changing the corresponding PHP code - considering another c_id field is present)

Also, change language.dokeos_folder into language.folder please.

Actions #8

Updated by Angel Quiroz over 7 years ago

  • % Done changed from 50 to 70

Changing the course_code, on entities and class methods
I have some issues with gradebook_category (category.class.php) and its course_code
I still do not write migrations

Actions #9

Updated by Angel Quiroz over 7 years ago

  • % Done changed from 70 to 60

Cambiando a c_id con gradebook_category, tengo que cambiar también algunos parámetros que genera api_get_cidreq porque algunos course_code son pasados como parámetros a url, estoy en eso.

También estoy aprovechando para cambiar las consultas SQL por métodos con entidades

Actions #10

Updated by Angel Quiroz over 7 years ago

Reemplazos para track_e_attempt

Actions #11

Updated by Angel Quiroz over 7 years ago

Reemplazados los course_code de templates

Actions #12

Updated by Angel Quiroz over 7 years ago

Reemplazados los course_code de specific_field_values

Actions #13

Updated by Angel Quiroz over 7 years ago

Reemplazados los course_code de shared_survey
Estoy reemplzando (por la mitad) los de search_engine_ref

Actions #14

Updated by Angel Quiroz over 7 years ago

Reemplazados los course_code de gradebook_link

Actions #15

Updated by Angel Quiroz over 7 years ago

Reemplazando gradebook_category

Actions #16

Updated by Angel Quiroz over 7 years ago

Tengo problemas al probar los cambios en master. Por no poder instalar master

Actions #17

Updated by Angel Quiroz over 7 years ago

Pude instalar la rama master. Pero encuentro errores, aunque no sé si son por los cambios
Estoy agregando relaciones entre las tablas para obtener entidades en ves de cId

$gradebookCategory->getCourse()->getCode()

Actions #18

Updated by Angel Quiroz over 7 years ago

En personal_agenda hay un campo course pero he revisado (en los usos de TABLE_PERSONAL_AGENDA y los lugares en donde se usan las funciones que usan TABLE_PERSONAL_AGENDA) y no encuentro alguna línea en la cual se inserte un course_code o c_id.
He quitado ese campo de la entidad

Actions #19

Updated by Angel Quiroz over 7 years ago

Logré instalando la rama C1244
Estoy probando los cambios

Actions #20

Updated by Angel Quiroz over 7 years ago

  • % Done changed from 60 to 80

Probé los cambios en las herramientas, en algunas encuentro errores por código que no he modificado como en c_notebook que falta un c_id (en 1.10.x sí tiene)

También hice cambios usando Criteria::create() para filtrar entre repositorios, pero no me funcionó. Así que los cambié por createQueryBuilder, y funcionó.

Me falta hacer las migraciones desde 1.10.x

Actions #21

Updated by Angel Quiroz over 7 years ago

  • Status changed from Assigned to Needs testing
  • Assignee deleted (Angel Quiroz)
  • % Done changed from 80 to 100

Envié los cambios a la rama master

Actions

Also available in: Atom PDF