Project

General

Profile

Feature #1244

Change all course literal codes to course integer ID's

Added by Yannick Warnier about 9 years ago. Updated over 3 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

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

Actions

Associated revisions

Revision 6482e33e (diff)
Added by Angel Fernando Quiroz Campos over 3 years ago

course_code replacements in gradebook_category - refs #1244

Revision 0376d607 (diff)
Added by Angel Fernando Quiroz Campos over 3 years ago

course_code replacements in course_rel_class - refs #1244

Revision 6b60f83a (diff)
Added by Angel Fernando Quiroz Campos over 3 years ago

course_code replacements in gradebook_evaluation - refs #1244

Revision 29980608 (diff)
Added by Angel Fernando Quiroz Campos over 3 years ago

course_code replacements in gradebook_link - refs #1244

Conflicts:
main/inc/lib/attendance.lib.php

Revision 51efdeaa (diff)
Added by Angel Fernando Quiroz Campos over 3 years ago

course_code replacements in track_e_hotspot - refs #1244

Revision 23679516 (diff)
Added by Angel Fernando Quiroz Campos over 3 years ago

course_code replacements in track_e_attempt - refs #1244

Revision ff1b1bc0 (diff)
Added by Angel Fernando Quiroz Campos over 3 years ago

course_code replacements in search_engine_ref - refs #1244

Conflicts:
main/newscorm/scorm.class.php

Revision 15b80d6c (diff)
Added by Angel Fernando Quiroz Campos over 3 years ago

course_code replacements in templates - refs #1244

Revision 0292ccc6 (diff)
Added by Angel Fernando Quiroz Campos over 3 years ago

course_code replacements in specific_field_values - refs #1244

Revision d28c501b (diff)
Added by Angel Fernando Quiroz Campos over 3 years ago

course_code replacements in shared_survey - refs #1244

Revision 26e7f237 (diff)
Added by Angel Fernando Quiroz Campos over 3 years ago

Fix GradebookLink and Course entities - refs #1244

Revision a3d397f8 (diff)
Added by Angel Fernando Quiroz Campos over 3 years ago

removing course_code in personal_agenda - refs #1244

Revision 6c2a0bbe (diff)
Added by Angel Fernando Quiroz Campos over 3 years ago

Fix entities - refs #1244

Revision 90adb50e (diff)
Added by Angel Fernando Quiroz Campos over 3 years ago

Fix tools by bad entities - refs #1244

Revision bbf2dd83 (diff)
Added by Angel Fernando Quiroz Campos over 3 years ago

Fix personal agenda - refs #1244

Revision ccedbb7d (diff)
Added by Angel Fernando Quiroz Campos over 3 years ago

Allow data migration from course_code to c_id - refs #1244

Revision 16a0622b
Added by Angel Fernando Quiroz Campos over 3 years ago

Merge pull request #1002 from AngelFQC/C1244

Change all course literal codes to course integer ID's - refs #1244

History

#1

Updated by Yannick Warnier almost 9 years ago

  • Target version changed from 1.8.7.1 to 1.8.8 stable
#2

Updated by Ivan Tcholakov almost 9 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.

#3

Updated by Yannick Warnier over 8 years ago

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

Updated by Julio Montoya over 7 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 ...

#5

Updated by Yannick Warnier about 7 years ago

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

Updated by Yannick Warnier almost 7 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.

#7

Updated by Yannick Warnier over 3 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.

#8

Updated by Angel Quiroz over 3 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

#9

Updated by Angel Quiroz over 3 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

#10

Updated by Angel Quiroz over 3 years ago

Reemplazos para track_e_attempt

#11

Updated by Angel Quiroz over 3 years ago

Reemplazados los course_code de templates

#12

Updated by Angel Quiroz over 3 years ago

Reemplazados los course_code de specific_field_values

#13

Updated by Angel Quiroz over 3 years ago

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

#14

Updated by Angel Quiroz over 3 years ago

Reemplazados los course_code de gradebook_link

#15

Updated by Angel Quiroz over 3 years ago

Reemplazando gradebook_category

#16

Updated by Angel Quiroz over 3 years ago

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

#17

Updated by Angel Quiroz over 3 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()

#18

Updated by Angel Quiroz over 3 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

#19

Updated by Angel Quiroz over 3 years ago

Logré instalando la rama C1244
Estoy probando los cambios

#20

Updated by Angel Quiroz over 3 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

#21

Updated by Angel Quiroz over 3 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

Also available in: Atom PDF