database.sql 195 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608
  1. --
  2. -- Don't modify this file. Edit the entities located in:
  3. -- src/Chamilo/CoreBundle/Entity
  4. -- src/Chamilo/CourseBundle/Entity
  5. -- src/Chamilo/UserBundle/Entity
  6. DROP TABLE IF EXISTS user;
  7. CREATE TABLE IF NOT EXISTS user (
  8. id int unsigned NOT NULL auto_increment,
  9. user_id int unsigned default NULL,
  10. lastname varchar(60) default NULL,
  11. firstname varchar(60) default NULL,
  12. username varchar(100) NOT NULL default '',
  13. password varchar(50) NOT NULL default '',
  14. auth_source varchar(50) default 'platform',
  15. email varchar(100) default NULL,
  16. status tinyint NOT NULL default '5',
  17. official_code varchar(40) default NULL,
  18. phone varchar(30) default NULL,
  19. picture_uri varchar(250) default NULL,
  20. creator_id int unsigned default NULL,
  21. competences text,
  22. diplomas text,
  23. openarea text,
  24. teach text,
  25. productions varchar(250) default NULL,
  26. chatcall_user_id int unsigned default '0',
  27. chatcall_date datetime default NULL,
  28. chatcall_text varchar(50) default NULL,
  29. language varchar(40) default NULL,
  30. registration_date datetime NOT NULL,
  31. expiration_date datetime default NULL,
  32. active tinyint unsigned NOT NULL default 1,
  33. openid varchar(255) DEFAULT NULL,
  34. theme varchar(255) DEFAULT NULL,
  35. hr_dept_id smallint unsigned NOT NULL default 0,
  36. last_login datetime default NULL,
  37. PRIMARY KEY (id),
  38. UNIQUE KEY username (username)
  39. );
  40. ALTER TABLE user ADD INDEX (status);
  41. --
  42. -- Dumping data for table user
  43. --
  44. /*!40000 ALTER TABLE user DISABLE KEYS */;
  45. LOCK TABLES user WRITE;
  46. INSERT INTO user (user_id, lastname, firstname, username, password, auth_source, email, status, official_code,phone, creator_id, registration_date, expiration_date,active,openid,language) VALUES (1, '{ADMINLASTNAME}','{ADMINFIRSTNAME}','{ADMINLOGIN}','{ADMINPASSWORD}','{PLATFORM_AUTH_SOURCE}','{ADMINEMAIL}',1,'ADMIN','{ADMINPHONE}',1,NOW(),NULL,'1',NULL,'{ADMINLANGUAGE}');
  47. -- Insert anonymous user
  48. INSERT INTO user (user_id, lastname, firstname, username, password, auth_source, email, status, official_code, creator_id, registration_date, expiration_date,active,openid,language) VALUES (2, 'Anonymous', 'Joe', '', '', 'platform', 'anonymous@localhost', 6, 'anonymous', 1, NOW(), NULL, 1,NULL,'{ADMINLANGUAGE}');
  49. UNLOCK TABLES;
  50. /*!40000 ALTER TABLE user ENABLE KEYS */;
  51. --
  52. -- Table structure for table admin
  53. --
  54. DROP TABLE IF EXISTS admin;
  55. CREATE TABLE IF NOT EXISTS admin (
  56. id INT PRIMARY KEY NOT NULL AUTO_INCREMENT,
  57. user_id int unsigned NOT NULL default '0',
  58. UNIQUE KEY user_id (user_id)
  59. );
  60. --
  61. -- Dumping data for table admin
  62. --
  63. /*!40000 ALTER TABLE admin DISABLE KEYS */;
  64. LOCK TABLES admin WRITE;
  65. INSERT INTO admin VALUES (1, 1);
  66. UNLOCK TABLES;
  67. /*!40000 ALTER TABLE admin ENABLE KEYS */;
  68. --
  69. -- Table structure for table class
  70. --
  71. DROP TABLE IF EXISTS class;
  72. CREATE TABLE IF NOT EXISTS class (
  73. id mediumint unsigned NOT NULL auto_increment,
  74. code varchar(40) default '',
  75. name text NOT NULL,
  76. PRIMARY KEY (id)
  77. );
  78. --
  79. -- Dumping data for table class
  80. --
  81. /*!40000 ALTER TABLE class DISABLE KEYS */;
  82. LOCK TABLES class WRITE;
  83. UNLOCK TABLES;
  84. /*!40000 ALTER TABLE class ENABLE KEYS */;
  85. --
  86. -- Table structure for table class_user
  87. --
  88. DROP TABLE IF EXISTS class_user;
  89. CREATE TABLE IF NOT EXISTS class_user (
  90. class_id mediumint unsigned NOT NULL default '0',
  91. user_id int unsigned NOT NULL default '0',
  92. PRIMARY KEY (class_id,user_id)
  93. );
  94. --
  95. -- Dumping data for table class_user
  96. --
  97. /*!40000 ALTER TABLE class_user DISABLE KEYS */;
  98. LOCK TABLES class_user WRITE;
  99. UNLOCK TABLES;
  100. /*!40000 ALTER TABLE class_user ENABLE KEYS */;
  101. --
  102. -- Table structure for table course
  103. --
  104. DROP TABLE IF EXISTS course;
  105. CREATE TABLE IF NOT EXISTS course (
  106. id int auto_increment,
  107. code varchar(40) NOT NULL,
  108. directory varchar(40) default NULL,
  109. db_name varchar(40) default NULL,
  110. course_language varchar(20) default NULL,
  111. title varchar(250) default NULL,
  112. description text,
  113. category_code varchar(40) default NULL,
  114. visibility tinyint default '0',
  115. show_score int NOT NULL default '1',
  116. tutor_name varchar(200) default NULL,
  117. visual_code varchar(40) default NULL,
  118. department_name varchar(30) default NULL,
  119. department_url varchar(180) default NULL,
  120. disk_quota bigint unsigned default NULL,
  121. last_visit datetime default NULL,
  122. last_edit datetime default NULL,
  123. creation_date datetime default NULL,
  124. expiration_date datetime default NULL,
  125. subscribe tinyint NOT NULL default '1',
  126. unsubscribe tinyint NOT NULL default '1',
  127. registration_code varchar(255) NOT NULL default '',
  128. legal TEXT NOT NULL,
  129. activate_legal INT NOT NULL DEFAULT 0,
  130. add_teachers_to_sessions_courses tinyint NOT NULL default 0,
  131. PRIMARY KEY (id),
  132. UNIQUE KEY code (code)
  133. );
  134. ALTER TABLE course ADD INDEX idx_course_category_code (category_code);
  135. ALTER TABLE course ADD INDEX idx_course_directory (directory(10));
  136. --
  137. -- Dumping data for table course
  138. --
  139. /*!40000 ALTER TABLE course DISABLE KEYS */;
  140. LOCK TABLES course WRITE;
  141. UNLOCK TABLES;
  142. /*!40000 ALTER TABLE course ENABLE KEYS */;
  143. --
  144. -- Table structure for table course_category
  145. --
  146. DROP TABLE IF EXISTS course_category;
  147. CREATE TABLE IF NOT EXISTS course_category (
  148. id int unsigned NOT NULL auto_increment,
  149. name varchar(100) NOT NULL default '',
  150. code varchar(40) NOT NULL default '',
  151. parent_id varchar(40) default NULL,
  152. tree_pos int unsigned default NULL,
  153. children_count smallint default NULL,
  154. auth_course_child varchar(40) default 'TRUE',
  155. auth_cat_child varchar(40) default 'TRUE',
  156. PRIMARY KEY (id),
  157. UNIQUE KEY code (code),
  158. KEY parent_id (parent_id),
  159. KEY tree_pos (tree_pos)
  160. );
  161. --
  162. -- Dumping data for table course_category
  163. --
  164. /*!40000 ALTER TABLE course_category DISABLE KEYS */;
  165. LOCK TABLES course_category WRITE;
  166. INSERT INTO course_category VALUES (1,'Language skills','LANG',NULL,1,0,'TRUE','TRUE'),(2,'PC Skills','PC',NULL,2,0,'TRUE','TRUE'),(3,'Projects','PROJ',NULL,3,0,'TRUE','TRUE');
  167. UNLOCK TABLES;
  168. /*!40000 ALTER TABLE course_category ENABLE KEYS */;
  169. --
  170. -- Table structure for table course_field
  171. --
  172. DROP TABLE IF EXISTS course_field;
  173. CREATE TABLE IF NOT EXISTS course_field (
  174. id int NOT NULL auto_increment,
  175. field_type int NOT NULL default 1,
  176. field_variable varchar(64) NOT NULL,
  177. field_display_text varchar(64),
  178. field_default_value text,
  179. field_order int,
  180. field_visible tinyint default 0,
  181. field_changeable tinyint default 0,
  182. field_filter tinyint default 0,
  183. tms DATETIME NOT NULL default '0000-00-00 00:00:00',
  184. PRIMARY KEY(id)
  185. );
  186. --
  187. -- Table structure for table course_field_values
  188. --
  189. DROP TABLE IF EXISTS course_field_values;
  190. CREATE TABLE IF NOT EXISTS course_field_values(
  191. id int NOT NULL auto_increment,
  192. course_code varchar(40) NOT NULL,
  193. field_id int NOT NULL,
  194. field_value text,
  195. tms DATETIME NOT NULL default '0000-00-00 00:00:00',
  196. PRIMARY KEY(id)
  197. );
  198. --
  199. -- Table structure for table course_module
  200. --
  201. DROP TABLE IF EXISTS course_module;
  202. CREATE TABLE IF NOT EXISTS course_module (
  203. id int unsigned NOT NULL auto_increment,
  204. name varchar(255) NOT NULL,
  205. link varchar(255) NOT NULL,
  206. image varchar(100) default NULL,
  207. `row` int unsigned NOT NULL default '0',
  208. `column` int unsigned NOT NULL default '0',
  209. position varchar(20) NOT NULL default 'basic',
  210. PRIMARY KEY (id)
  211. );
  212. --
  213. -- Dumping data for table course_module
  214. --
  215. /*!40000 ALTER TABLE course_module DISABLE KEYS */;
  216. LOCK TABLES course_module WRITE;
  217. INSERT INTO course_module VALUES
  218. (1,'calendar_event','calendar/agenda.php','agenda.gif',1,1,'basic'),
  219. (2,'link','link/link.php','links.gif',4,1,'basic'),
  220. (3,'document','document/document.php','documents.gif',3,1,'basic'),
  221. (4,'student_publication','work/work.php','works.gif',3,2,'basic'),
  222. (5,'announcement','announcements/announcements.php','valves.gif',2,1,'basic'),
  223. (6,'user','user/user.php','members.gif',2,3,'basic'),
  224. (7,'forum','forum/index.php','forum.gif',1,2,'basic'),
  225. (8,'quiz','exercice/exercice.php','quiz.gif',2,2,'basic'),
  226. (9,'group','group/group.php','group.gif',3,3,'basic'),
  227. (10,'course_description','course_description/','info.gif',1,3,'basic'),
  228. (11,'chat','chat/chat.php','chat.gif',0,0,'external'),
  229. (12,'dropbox','dropbox/index.php','dropbox.gif',4,2,'basic'),
  230. (13,'tracking','tracking/courseLog.php','statistics.gif',1,3,'courseadmin'),
  231. (14,'homepage_link','link/link.php?action=addlink','npage.gif',1,1,'courseadmin'),
  232. (15,'course_setting','course_info/infocours.php','reference.gif',1,1,'courseadmin'),
  233. (16,'External','','external.gif',0,0,'external'),
  234. (17,'AddedLearnpath','','scormbuilder.gif',0,0,'external'),
  235. (18,'conference','conference/index.php?type=conference','conf.gif',0,0,'external'),
  236. (19,'conference','conference/index.php?type=classroom','conf.gif',0,0,'external'),
  237. (20,'learnpath','newscorm/lp_controller.php','scorms.gif',5,1,'basic'),
  238. (21,'blog','blog/blog.php','blog.gif',1,2,'basic'),
  239. (22,'blog_management','blog/blog_admin.php','blog_admin.gif',1,2,'courseadmin'),
  240. (23,'course_maintenance','course_info/maintenance.php','backup.gif',2,3,'courseadmin'),
  241. (24,'survey','survey/survey_list.php','survey.gif',2,1,'basic'),
  242. (25,'wiki','wiki/index.php','wiki.gif',2,3,'basic'),
  243. (26,'gradebook','gradebook/index.php','gradebook.gif',2,2,'basic'),
  244. (27,'glossary','glossary/index.php','glossary.gif',2,1,'basic'),
  245. (28,'notebook','notebook/index.php','notebook.gif',2,1,'basic'),
  246. (29,'attendance','attendance/index.php','attendance.gif',2,1,'basic'),
  247. (30,'course_progress','course_progress/index.php','course_progress.gif',2,1,'basic');
  248. UNLOCK TABLES;
  249. /*!40000 ALTER TABLE course_module ENABLE KEYS */;
  250. --
  251. -- Table structure for table course_rel_class
  252. --
  253. DROP TABLE IF EXISTS course_rel_class;
  254. CREATE TABLE IF NOT EXISTS course_rel_class (
  255. course_code char(40) NOT NULL,
  256. class_id mediumint unsigned NOT NULL,
  257. PRIMARY KEY (course_code,class_id)
  258. );
  259. --
  260. -- Dumping data for table course_rel_class
  261. --
  262. /*!40000 ALTER TABLE course_rel_class DISABLE KEYS */;
  263. LOCK TABLES course_rel_class WRITE;
  264. UNLOCK TABLES;
  265. /*!40000 ALTER TABLE course_rel_class ENABLE KEYS */;
  266. --
  267. -- Table structure for table course_rel_user
  268. --
  269. DROP TABLE IF EXISTS course_rel_user;
  270. CREATE TABLE IF NOT EXISTS course_rel_user (
  271. course_code varchar(40) NOT NULL,
  272. user_id int unsigned NOT NULL default '0',
  273. status tinyint NOT NULL default '5',
  274. role varchar(60) default NULL,
  275. tutor_id int unsigned NOT NULL default '0',
  276. sort int default NULL,
  277. user_course_cat int default '0',
  278. relation_type int default 0,
  279. legal_agreement INTEGER DEFAULT 0,
  280. PRIMARY KEY (course_code,user_id,relation_type)
  281. );
  282. ALTER TABLE course_rel_user ADD INDEX (user_id);
  283. --
  284. -- Dumping data for table course_rel_user
  285. --
  286. /*!40000 ALTER TABLE course_rel_user DISABLE KEYS */;
  287. LOCK TABLES course_rel_user WRITE;
  288. UNLOCK TABLES;
  289. /*!40000 ALTER TABLE course_rel_user ENABLE KEYS */;
  290. --
  291. -- Table structure for table language
  292. --
  293. DROP TABLE IF EXISTS language;
  294. CREATE TABLE IF NOT EXISTS language (
  295. id tinyint unsigned NOT NULL auto_increment,
  296. original_name varchar(255) default NULL,
  297. english_name varchar(255) default NULL,
  298. isocode varchar(10) default NULL,
  299. dokeos_folder varchar(250) default NULL,
  300. available tinyint NOT NULL default 1,
  301. parent_id tinyint unsigned,
  302. PRIMARY KEY (id)
  303. );
  304. ALTER TABLE language ADD INDEX idx_language_dokeos_folder(dokeos_folder);
  305. --
  306. -- Dumping data for table language
  307. --
  308. /*!40000 ALTER TABLE language DISABLE KEYS */;
  309. LOCK TABLES language WRITE;
  310. INSERT INTO language (original_name, english_name, isocode, dokeos_folder, available) VALUES
  311. ('العربية','arabic','ar','arabic',0),
  312. ('Asturianu','asturian','ast','asturian',0),
  313. ('Euskara','basque','eu','basque',1),
  314. ('বাংলা','bengali','bn','bengali',0),
  315. ('Bosanski','bosnian','bs','bosnian',1),
  316. ('Português do Brasil','brazilian','pt-BR','brazilian',1),
  317. ('Български','bulgarian','bg','bulgarian',1),
  318. ('Català','catalan','ca','catalan',0),
  319. ('Hrvatski','croatian','hr','croatian',0),
  320. ('Česky','czech','cs','czech',0),
  321. ('Dansk','danish','da','danish',0),
  322. ('دری','dari','prs','dari',0),
  323. ('Nederlands','dutch','nl','dutch',1),
  324. ('English','english','en','english',1),
  325. ('Esperanto','esperanto','eo','esperanto',0),
  326. ('Føroyskt', 'faroese', 'fo', 'faroese', 0),
  327. ('Suomi','finnish','fi','finnish',0),
  328. ('Français','french','fr','french',1),
  329. ('Furlan','friulian','fur','friulian',0),
  330. ('Galego','galician','gl','galician',1),
  331. ('ქართული','georgian','ka','georgian',0),
  332. ('Deutsch','german','de','german',1),
  333. ('Ελληνικά','greek','el','greek',1),
  334. ('עברית','hebrew','he','hebrew',0),
  335. ('हिन्दी','hindi','hi','hindi',0),
  336. ('Magyar','hungarian','hu','hungarian',1),
  337. ('Bahasa Indonesia','indonesian','id','indonesian',1),
  338. ('Italiano','italian','it','italian',1),
  339. ('日本語','japanese','ja','japanese',0),
  340. ('한국어','korean','ko','korean',0),
  341. ('Latviešu','latvian','lv','latvian',1),
  342. ('Lietuvių','lithuanian','lt','lithuanian',0),
  343. ('Македонски','macedonian','mk','macedonian',0),
  344. ('Bahasa Melayu','malay','ms','malay',0),
  345. ('Norsk','norwegian','no','norwegian',0),
  346. ('Occitan','occitan','oc','occitan',0),
  347. ('پښتو','pashto','ps','pashto',0),
  348. ('فارسی','persian','fa','persian',0),
  349. ('Polski','polish','pl','polish',1),
  350. ('Português europeu','portuguese','pt','portuguese',1),
  351. ('Runasimi','quechua_cusco','qu','quechua_cusco',0),
  352. ('Română','romanian','ro','romanian',0),
  353. ('Русский','russian','ru','russian',0),
  354. ('Srpski','serbian','sr','serbian',0),
  355. ('中文(简体)','simpl_chinese','zh','simpl_chinese',0),
  356. ('Slovenčina','slovak','sk','slovak',1),
  357. ('Slovenščina','slovenian','sl','slovenian',1),
  358. ('الصومالية','somali','so','somali',0),
  359. ('Español','spanish','es','spanish',1),
  360. ('Kiswahili','swahili','sw','swahili',0),
  361. ('Svenska','swedish','sv','swedish',0),
  362. ('Tagalog', 'tagalog', 'tl', 'tagalog',1),
  363. ('ไทย','thai','th','thai',0),
  364. ('Tibetan', 'tibetan', 'bo', 'tibetan', 0),
  365. ('繁體中文','trad_chinese','zh-TW','trad_chinese',0),
  366. ('Türkçe','turkish','tr','turkish',0),
  367. ('Українська','ukrainian','uk','ukrainian',0),
  368. ('Tiếng Việt','vietnamese','vi','vietnamese',0),
  369. ('isiXhosa', 'xhosa', 'xh', 'xhosa', 0),
  370. ('Yorùbá','yoruba','yo','yoruba',0);
  371. -- The chosen during the installation platform language should be enabled.
  372. UPDATE language SET available=1 WHERE dokeos_folder = '{PLATFORMLANGUAGE}';
  373. UNLOCK TABLES;
  374. /*!40000 ALTER TABLE language ENABLE KEYS */;
  375. --
  376. -- Table structure for table php_session
  377. --
  378. DROP TABLE IF EXISTS php_session;
  379. CREATE TABLE IF NOT EXISTS php_session (
  380. session_id varchar(32) NOT NULL default '',
  381. session_name varchar(10) NOT NULL default '',
  382. session_time int NOT NULL default '0',
  383. session_start int NOT NULL default '0',
  384. session_value mediumtext NOT NULL,
  385. PRIMARY KEY (session_id)
  386. );
  387. --
  388. -- Table structure for table session
  389. --
  390. DROP TABLE IF EXISTS session;
  391. CREATE TABLE IF NOT EXISTS session (
  392. id smallint unsigned NOT NULL auto_increment,
  393. id_coach int unsigned NOT NULL default '0',
  394. name char(100) NOT NULL default '',
  395. nbr_courses smallint unsigned NOT NULL default '0',
  396. nbr_users mediumint unsigned NOT NULL default '0',
  397. nbr_classes mediumint unsigned NOT NULL default '0',
  398. date_start date NOT NULL default '0000-00-00',
  399. date_end date NOT NULL default '0000-00-00',
  400. nb_days_access_before_beginning TINYINT UNSIGNED NULL default '0',
  401. nb_days_access_after_end TINYINT UNSIGNED NULL default '0',
  402. session_admin_id INT UNSIGNED NOT NULL,
  403. visibility int NOT NULL default 1,
  404. session_category_id int NOT NULL,
  405. promotion_id INT NOT NULL,
  406. description TEXT DEFAULT NULL,
  407. show_description TINYINT UNSIGNED DEFAULT 0,
  408. duration int,
  409. PRIMARY KEY (id),
  410. INDEX (session_admin_id),
  411. UNIQUE KEY name (name)
  412. );
  413. -- --------------------------------------------------------
  414. --
  415. -- Table structure for table session_rel_course
  416. --
  417. DROP TABLE IF EXISTS session_rel_course;
  418. CREATE TABLE IF NOT EXISTS session_rel_course (
  419. id_session smallint unsigned NOT NULL default 0,
  420. course_code char(40) NOT NULL default '',
  421. nbr_users smallint unsigned NOT NULL default 0,
  422. position int unsigned NOT NULL default 0,
  423. category varchar(255) default '',
  424. PRIMARY KEY (id_session,course_code),
  425. KEY course_code (course_code)
  426. );
  427. -- --------------------------------------------------------
  428. --
  429. -- Table structure for table session_rel_course_rel_user
  430. --
  431. DROP TABLE IF EXISTS session_rel_course_rel_user;
  432. CREATE TABLE IF NOT EXISTS session_rel_course_rel_user (
  433. id_session smallint unsigned NOT NULL default '0',
  434. course_code char(40) NOT NULL default '',
  435. id_user int unsigned NOT NULL default '0',
  436. visibility int NOT NULL default 1,
  437. status int NOT NULL default 0,
  438. legal_agreement INTEGER DEFAULT 0,
  439. PRIMARY KEY (id_session,course_code,id_user),
  440. KEY id_user (id_user),
  441. KEY course_code (course_code)
  442. );
  443. -- --------------------------------------------------------
  444. --
  445. -- Table structure for table session_rel_user
  446. --
  447. DROP TABLE IF EXISTS session_rel_user;
  448. CREATE TABLE IF NOT EXISTS session_rel_user (
  449. id_session mediumint unsigned NOT NULL default '0',
  450. id_user mediumint unsigned NOT NULL default '0',
  451. relation_type int default 0,
  452. duration int,
  453. registered_at DATETIME not null,
  454. PRIMARY KEY (id_session, id_user, relation_type)
  455. );
  456. DROP TABLE IF EXISTS session_field;
  457. CREATE TABLE IF NOT EXISTS session_field (
  458. id int NOT NULL auto_increment,
  459. field_type int NOT NULL default 1,
  460. field_variable varchar(64) NOT NULL,
  461. field_display_text varchar(64),
  462. field_default_value text,
  463. field_order int,
  464. field_visible tinyint default 0,
  465. field_changeable tinyint default 0,
  466. field_filter tinyint default 0,
  467. tms DATETIME NOT NULL default '0000-00-00 00:00:00',
  468. PRIMARY KEY(id)
  469. );
  470. DROP TABLE IF EXISTS session_field_values;
  471. CREATE TABLE IF NOT EXISTS session_field_values(
  472. id int NOT NULL auto_increment,
  473. session_id int NOT NULL,
  474. field_id int NOT NULL,
  475. field_value text,
  476. tms DATETIME NOT NULL default '0000-00-00 00:00:00',
  477. PRIMARY KEY(id)
  478. );
  479. --
  480. -- Table structure for table settings_current
  481. --
  482. DROP TABLE IF EXISTS settings_current;
  483. CREATE TABLE IF NOT EXISTS settings_current (
  484. id int unsigned NOT NULL auto_increment,
  485. variable varchar(255) default NULL,
  486. subkey varchar(255) default NULL,
  487. type varchar(255) default NULL,
  488. category varchar(255) default NULL,
  489. selected_value varchar(255) default NULL,
  490. title varchar(255) NOT NULL default '',
  491. comment varchar(255) default NULL,
  492. scope varchar(50) default NULL,
  493. subkeytext varchar(255) default NULL,
  494. access_url int unsigned not null default 1,
  495. access_url_changeable int unsigned not null default 0,
  496. access_url_locked int not null default 0,
  497. PRIMARY KEY id (id),
  498. INDEX (access_url)
  499. );
  500. ALTER TABLE settings_current ADD UNIQUE unique_setting (variable(110), subkey(110), category(110), access_url);
  501. --
  502. -- Dumping data for table settings_current
  503. --
  504. /*!40000 ALTER TABLE settings_current DISABLE KEYS */;
  505. LOCK TABLES settings_current WRITE;
  506. INSERT INTO settings_current
  507. (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable)
  508. VALUES
  509. ('Institution',NULL,'textfield','Platform','{ORGANISATIONNAME}','InstitutionTitle','InstitutionComment','platform',NULL, 1),
  510. ('InstitutionUrl',NULL,'textfield','Platform','{ORGANISATIONURL}','InstitutionUrlTitle','InstitutionUrlComment',NULL,NULL, 1),
  511. ('siteName',NULL,'textfield','Platform','{CAMPUSNAME}','SiteNameTitle','SiteNameComment',NULL,NULL, 1),
  512. ('emailAdministrator',NULL,'textfield','Platform','{ADMINEMAIL}','emailAdministratorTitle','emailAdministratorComment',NULL,NULL, 1),
  513. ('administratorSurname',NULL,'textfield','Platform','{ADMINLASTNAME}','administratorSurnameTitle','administratorSurnameComment',NULL,NULL, 1),
  514. ('administratorName',NULL,'textfield','Platform','{ADMINFIRSTNAME}','administratorNameTitle','administratorNameComment',NULL,NULL, 1),
  515. ('show_administrator_data',NULL,'radio','Platform','true','ShowAdministratorDataTitle','ShowAdministratorDataComment',NULL,NULL, 1),
  516. ('show_tutor_data',NULL,'radio','Session','true','ShowTutorDataTitle','ShowTutorDataComment',NULL,NULL, 1),
  517. ('show_teacher_data',NULL,'radio','Platform','true','ShowTeacherDataTitle','ShowTeacherDataComment',NULL,NULL, 1),
  518. ('homepage_view',NULL,'radio','Course','activity_big','HomepageViewTitle','HomepageViewComment',NULL,NULL, 1),
  519. ('show_toolshortcuts',NULL,'radio','Course','false','ShowToolShortcutsTitle','ShowToolShortcutsComment',NULL,NULL, 0),
  520. ('allow_group_categories',NULL,'radio','Course','false','AllowGroupCategories','AllowGroupCategoriesComment',NULL,NULL, 0),
  521. ('server_type',NULL,'radio','Platform','production','ServerStatusTitle','ServerStatusComment',NULL,NULL, 0),
  522. ('platformLanguage',NULL,'link','Languages','{PLATFORMLANGUAGE}','PlatformLanguageTitle','PlatformLanguageComment',NULL,NULL, 0),
  523. ('showonline','world','checkbox','Platform','true','ShowOnlineTitle','ShowOnlineComment',NULL,'ShowOnlineWorld', 0),
  524. ('showonline','users','checkbox','Platform','true','ShowOnlineTitle','ShowOnlineComment',NULL,'ShowOnlineUsers', 0),
  525. ('showonline','course','checkbox','Platform','true','ShowOnlineTitle','ShowOnlineComment',NULL,'ShowOnlineCourse', 0),
  526. ('profile','name','checkbox','User','false','ProfileChangesTitle','ProfileChangesComment',NULL,'name', 0),
  527. ('profile','officialcode','checkbox','User','false','ProfileChangesTitle','ProfileChangesComment',NULL,'officialcode', 0),
  528. ('profile','email','checkbox','User','false','ProfileChangesTitle','ProfileChangesComment',NULL,'Email', 0),
  529. ('profile','picture','checkbox','User','true','ProfileChangesTitle','ProfileChangesComment',NULL,'UserPicture', 0),
  530. ('profile','login','checkbox','User','false','ProfileChangesTitle','ProfileChangesComment',NULL,'Login', 0),
  531. ('profile','password','checkbox','User','true','ProfileChangesTitle','ProfileChangesComment',NULL,'UserPassword', 0),
  532. ('profile','language','checkbox','User','true','ProfileChangesTitle','ProfileChangesComment',NULL,'Language', 0),
  533. ('default_document_quotum',NULL,'textfield','Course','100000000','DefaultDocumentQuotumTitle','DefaultDocumentQuotumComment',NULL,NULL, 0),
  534. ('registration','officialcode','checkbox','User','false','RegistrationRequiredFormsTitle','RegistrationRequiredFormsComment',NULL,'OfficialCode', 0),
  535. ('registration','email','checkbox','User','true','RegistrationRequiredFormsTitle','RegistrationRequiredFormsComment',NULL,'Email', 0),
  536. ('registration','language','checkbox','User','true','RegistrationRequiredFormsTitle','RegistrationRequiredFormsComment',NULL,'Language', 0),
  537. ('default_group_quotum',NULL,'textfield','Course','5000000','DefaultGroupQuotumTitle','DefaultGroupQuotumComment',NULL,NULL, 0),
  538. ('allow_registration',NULL,'radio','Platform','{ALLOWSELFREGISTRATION}','AllowRegistrationTitle','AllowRegistrationComment',NULL,NULL, 0),
  539. ('allow_registration_as_teacher',NULL,'radio','Platform','{ALLOWTEACHERSELFREGISTRATION}','AllowRegistrationAsTeacherTitle','AllowRegistrationAsTeacherComment',NULL,NULL, 0),
  540. ('allow_lostpassword',NULL,'radio','Platform','true','AllowLostPasswordTitle','AllowLostPasswordComment',NULL,NULL, 0),
  541. ('allow_user_headings',NULL,'radio','Course','false','AllowUserHeadings','AllowUserHeadingsComment',NULL,NULL, 0),
  542. ('course_create_active_tools','course_description','checkbox','Tools','true','CourseCreateActiveToolsTitle','CourseCreateActiveToolsComment',NULL,'CourseDescription', 0),
  543. ('course_create_active_tools','agenda','checkbox','Tools','true','CourseCreateActiveToolsTitle','CourseCreateActiveToolsComment',NULL,'Agenda', 0),
  544. ('course_create_active_tools','documents','checkbox','Tools','true','CourseCreateActiveToolsTitle','CourseCreateActiveToolsComment',NULL,'Documents', 0),
  545. ('course_create_active_tools','learning_path','checkbox','Tools','true','CourseCreateActiveToolsTitle','CourseCreateActiveToolsComment',NULL,'LearningPath', 0),
  546. ('course_create_active_tools','links','checkbox','Tools','true','CourseCreateActiveToolsTitle','CourseCreateActiveToolsComment',NULL,'Links', 0),
  547. ('course_create_active_tools','announcements','checkbox','Tools','true','CourseCreateActiveToolsTitle','CourseCreateActiveToolsComment',NULL,'Announcements', 0),
  548. ('course_create_active_tools','forums','checkbox','Tools','true','CourseCreateActiveToolsTitle','CourseCreateActiveToolsComment',NULL,'Forums', 0),
  549. ('course_create_active_tools','dropbox','checkbox','Tools','true','CourseCreateActiveToolsTitle','CourseCreateActiveToolsComment',NULL,'Dropbox', 0),
  550. ('course_create_active_tools','quiz','checkbox','Tools','true','CourseCreateActiveToolsTitle','CourseCreateActiveToolsComment',NULL,'Quiz', 0),
  551. ('course_create_active_tools','users','checkbox','Tools','true','CourseCreateActiveToolsTitle','CourseCreateActiveToolsComment',NULL,'Users', 0),
  552. ('course_create_active_tools','groups','checkbox','Tools','true','CourseCreateActiveToolsTitle','CourseCreateActiveToolsComment',NULL,'Groups', 0),
  553. ('course_create_active_tools','chat','checkbox','Tools','true','CourseCreateActiveToolsTitle','CourseCreateActiveToolsComment',NULL,'Chat', 0),
  554. ('course_create_active_tools','online_conference','checkbox','Tools','true','CourseCreateActiveToolsTitle','CourseCreateActiveToolsComment',NULL,'OnlineConference', 0),
  555. ('course_create_active_tools','student_publications','checkbox','Tools','true','CourseCreateActiveToolsTitle','CourseCreateActiveToolsComment',NULL,'StudentPublications', 0),
  556. ('allow_personal_agenda',NULL,'radio','User','true','AllowPersonalAgendaTitle','AllowPersonalAgendaComment',NULL,NULL, 0),
  557. ('display_coursecode_in_courselist',NULL,'radio','Platform','false','DisplayCourseCodeInCourselistTitle','DisplayCourseCodeInCourselistComment',NULL,NULL, 0),
  558. ('display_teacher_in_courselist',NULL,'radio','Platform','true','DisplayTeacherInCourselistTitle','DisplayTeacherInCourselistComment',NULL,NULL, 0),
  559. ('permanently_remove_deleted_files',NULL,'radio','Tools','false','PermanentlyRemoveFilesTitle','PermanentlyRemoveFilesComment',NULL,NULL, 0),
  560. ('dropbox_allow_overwrite',NULL,'radio','Tools','true','DropboxAllowOverwriteTitle','DropboxAllowOverwriteComment',NULL,NULL, 0),
  561. ('dropbox_max_filesize',NULL,'textfield','Tools','100000000','DropboxMaxFilesizeTitle','DropboxMaxFilesizeComment',NULL,NULL, 0),
  562. ('dropbox_allow_just_upload',NULL,'radio','Tools','true','DropboxAllowJustUploadTitle','DropboxAllowJustUploadComment',NULL,NULL, 0),
  563. ('dropbox_allow_student_to_student',NULL,'radio','Tools','true','DropboxAllowStudentToStudentTitle','DropboxAllowStudentToStudentComment',NULL,NULL, 0),
  564. ('dropbox_allow_group',NULL,'radio','Tools','true','DropboxAllowGroupTitle','DropboxAllowGroupComment',NULL,NULL, 0),
  565. ('dropbox_allow_mailing',NULL,'radio','Tools','false','DropboxAllowMailingTitle','DropboxAllowMailingComment',NULL,NULL, 0),
  566. ('administratorTelephone',NULL,'textfield','Platform','(000) 001 02 03','administratorTelephoneTitle','administratorTelephoneComment',NULL,NULL, 1),
  567. ('extended_profile',NULL,'radio','User','false','ExtendedProfileTitle','ExtendedProfileComment',NULL,NULL, 0),
  568. ('student_view_enabled',NULL,'radio','Platform','true','StudentViewEnabledTitle','StudentViewEnabledComment',NULL,NULL, 0),
  569. ('show_navigation_menu',NULL,'radio','Course','false','ShowNavigationMenuTitle','ShowNavigationMenuComment',NULL,NULL, 0),
  570. ('enable_tool_introduction',NULL,'radio','course','false','EnableToolIntroductionTitle','EnableToolIntroductionComment',NULL,NULL, 0),
  571. ('page_after_login', NULL, 'radio','Platform','user_portal.php', 'PageAfterLoginTitle','PageAfterLoginComment', NULL, NULL, 0),
  572. ('time_limit_whosonline', NULL, 'textfield','Platform','30', 'TimeLimitWhosonlineTitle','TimeLimitWhosonlineComment', NULL, NULL, 0),
  573. ('breadcrumbs_course_homepage', NULL, 'radio','Course','course_title', 'BreadCrumbsCourseHomepageTitle','BreadCrumbsCourseHomepageComment', NULL, NULL, 0),
  574. ('example_material_course_creation', NULL, 'radio','Platform','true', 'ExampleMaterialCourseCreationTitle','ExampleMaterialCourseCreationComment', NULL, NULL, 0),
  575. ('account_valid_duration',NULL, 'textfield','Platform','3660', 'AccountValidDurationTitle','AccountValidDurationComment', NULL, NULL, 0),
  576. ('use_session_mode', NULL, 'radio','Session','true', 'UseSessionModeTitle','UseSessionModeComment', NULL, NULL, 0),
  577. ('allow_email_editor', NULL, 'radio', 'Tools', 'false', 'AllowEmailEditorTitle', 'AllowEmailEditorComment', NULL, NULL, 0),
  578. ('registered', NULL, 'textfield', NULL, 'false', NULL, NULL, NULL, NULL, 0),
  579. ('donotlistcampus', NULL, 'textfield', NULL, 'false', NULL, NULL, NULL, NULL,0 ),
  580. ('show_email_addresses', NULL,'radio','Platform','false','ShowEmailAddresses','ShowEmailAddressesComment',NULL,NULL, 1),
  581. ('profile','phone','checkbox','User','false','ProfileChangesTitle','ProfileChangesComment',NULL,'phone', 0),
  582. ('service_visio', 'active', 'radio',NULL,'false', 'VisioEnable','', NULL, NULL, 0),
  583. ('service_visio', 'visio_host', 'textfield',NULL,'', 'VisioHost','', NULL, NULL, 0),
  584. ('service_visio', 'visio_port', 'textfield',NULL,'1935', 'VisioPort','', NULL, NULL, 0),
  585. ('service_visio', 'visio_pass', 'textfield',NULL,'', 'VisioPassword','', NULL, NULL, 0),
  586. ('service_ppt2lp', 'active', 'radio',NULL,'false', 'ppt2lp_actived','', NULL, NULL, 0),
  587. ('service_ppt2lp', 'host', 'textfield', NULL, NULL, 'Host', NULL, NULL, NULL, 0),
  588. ('service_ppt2lp', 'port', 'textfield', NULL, 2002, 'Port', NULL, NULL, NULL, 0),
  589. ('service_ppt2lp', 'user', 'textfield', NULL, NULL, 'UserOnHost', NULL, NULL, NULL, 0),
  590. ('service_ppt2lp', 'ftp_password', 'textfield', NULL, NULL, 'FtpPassword', NULL, NULL, NULL, 0),
  591. ('service_ppt2lp', 'path_to_lzx', 'textfield', NULL, NULL, '', NULL, NULL, NULL, 0),
  592. ('service_ppt2lp', 'size', 'radio', NULL, '720x540', '', NULL, NULL, NULL, 0),
  593. ('stylesheets', NULL, 'textfield','stylesheets','chamilo','',NULL, NULL, NULL, 1),
  594. ('upload_extensions_list_type', NULL, 'radio', 'Security', 'blacklist', 'UploadExtensionsListType', 'UploadExtensionsListTypeComment', NULL, NULL, 0),
  595. ('upload_extensions_blacklist', NULL, 'textfield', 'Security', '', 'UploadExtensionsBlacklist', 'UploadExtensionsBlacklistComment', NULL, NULL, 0),
  596. ('upload_extensions_whitelist', NULL, 'textfield', 'Security', 'htm;html;jpg;jpeg;gif;png;swf;avi;mpg;mpeg;mov;flv;doc;docx;xls;xlsx;ppt;pptx;odt;odp;ods;pdf', 'UploadExtensionsWhitelist', 'UploadExtensionsWhitelistComment', NULL, NULL, 0),
  597. ('upload_extensions_skip', NULL, 'radio', 'Security', 'true', 'UploadExtensionsSkip', 'UploadExtensionsSkipComment', NULL, NULL, 0),
  598. ('upload_extensions_replace_by', NULL, 'textfield', 'Security', 'dangerous', 'UploadExtensionsReplaceBy', 'UploadExtensionsReplaceByComment', NULL, NULL, 0),
  599. ('show_number_of_courses', NULL, 'radio','Platform','false', 'ShowNumberOfCourses','ShowNumberOfCoursesComment', NULL, NULL, 0),
  600. ('show_empty_course_categories', NULL, 'radio','Platform','true', 'ShowEmptyCourseCategories','ShowEmptyCourseCategoriesComment', NULL, NULL, 0),
  601. ('show_back_link_on_top_of_tree', NULL, 'radio','Platform','false', 'ShowBackLinkOnTopOfCourseTree','ShowBackLinkOnTopOfCourseTreeComment', NULL, NULL, 0),
  602. ('show_different_course_language', NULL, 'radio','Platform','true', 'ShowDifferentCourseLanguage','ShowDifferentCourseLanguageComment', NULL, NULL, 1),
  603. ('split_users_upload_directory', NULL, 'radio','Tuning','true', 'SplitUsersUploadDirectory','SplitUsersUploadDirectoryComment', NULL, NULL, 0),
  604. ('hide_dltt_markup', NULL, 'radio','Languages','true', 'HideDLTTMarkup','HideDLTTMarkupComment', NULL, NULL, 0),
  605. ('display_categories_on_homepage',NULL,'radio','Platform','false','DisplayCategoriesOnHomepageTitle','DisplayCategoriesOnHomepageComment',NULL,NULL, 1),
  606. ('permissions_for_new_directories', NULL, 'textfield', 'Security', '0777', 'PermissionsForNewDirs', 'PermissionsForNewDirsComment', NULL, NULL, 0),
  607. ('permissions_for_new_files', NULL, 'textfield', 'Security', '0666', 'PermissionsForNewFiles', 'PermissionsForNewFilesComment', NULL, NULL, 0),
  608. ('show_tabs', 'campus_homepage', 'checkbox', 'Platform', 'true', 'ShowTabsTitle','ShowTabsComment',NULL,'TabsCampusHomepage', 1),
  609. ('show_tabs', 'my_courses', 'checkbox', 'Platform', 'true', 'ShowTabsTitle','ShowTabsComment',NULL,'TabsMyCourses', 1),
  610. ('show_tabs', 'reporting', 'checkbox', 'Platform', 'true', 'ShowTabsTitle','ShowTabsComment',NULL,'TabsReporting', 1),
  611. ('show_tabs', 'platform_administration', 'checkbox', 'Platform', 'true', 'ShowTabsTitle','ShowTabsComment',NULL,'TabsPlatformAdministration', 1),
  612. ('show_tabs', 'my_agenda', 'checkbox', 'Platform', 'true', 'ShowTabsTitle','ShowTabsComment',NULL,'TabsMyAgenda', 1),
  613. ('show_tabs', 'my_profile', 'checkbox', 'Platform', 'true', 'ShowTabsTitle','ShowTabsComment',NULL,'TabsMyProfile', 1),
  614. ('default_forum_view', NULL, 'radio', 'Course', 'flat', 'DefaultForumViewTitle','DefaultForumViewComment',NULL,NULL, 0),
  615. ('platform_charset',NULL,'textfield','Languages','UTF-8','PlatformCharsetTitle','PlatformCharsetComment','platform',NULL, 0),
  616. ('noreply_email_address', '', 'textfield', 'Platform', '', 'NoReplyEmailAddress', 'NoReplyEmailAddressComment', NULL, NULL, 0),
  617. ('survey_email_sender_noreply', '', 'radio', 'Course', 'coach', 'SurveyEmailSenderNoReply', 'SurveyEmailSenderNoReplyComment', NULL, NULL, 0),
  618. ('openid_authentication',NULL,'radio','Security','false','OpenIdAuthentication','OpenIdAuthenticationComment',NULL,NULL, 0),
  619. ('profile','openid','checkbox','User','false','ProfileChangesTitle','ProfileChangesComment',NULL,'OpenIDURL', 0),
  620. ('gradebook_enable',NULL,'radio','Gradebook','false','GradebookActivation','GradebookActivationComment',NULL,NULL, 0),
  621. ('show_tabs','my_gradebook','checkbox','Platform','true','ShowTabsTitle','ShowTabsComment',NULL,'TabsMyGradebook', 1),
  622. ('gradebook_score_display_coloring','my_display_coloring','checkbox','Gradebook','false','GradebookScoreDisplayColoring','GradebookScoreDisplayColoringComment',NULL,'TabsGradebookEnableColoring', 0),
  623. ('gradebook_score_display_custom','my_display_custom','checkbox','Gradebook','false','GradebookScoreDisplayCustom','GradebookScoreDisplayCustomComment',NULL,'TabsGradebookEnableCustom', 0),
  624. ('gradebook_score_display_colorsplit',NULL,'textfield','Gradebook','50','GradebookScoreDisplayColorSplit','GradebookScoreDisplayColorSplitComment',NULL,NULL, 0),
  625. ('gradebook_score_display_upperlimit','my_display_upperlimit','checkbox','Gradebook','false','GradebookScoreDisplayUpperLimit','GradebookScoreDisplayUpperLimitComment',NULL,'TabsGradebookEnableUpperLimit', 0),
  626. ('gradebook_number_decimals', NULL, 'select', 'Gradebook', '0', 'GradebookNumberDecimals', 'GradebookNumberDecimalsComment', NULL, NULL, 0),
  627. ('user_selected_theme',NULL,'radio','Platform','false','UserThemeSelection','UserThemeSelectionComment',NULL,NULL, 0),
  628. ('profile','theme','checkbox','User','false','ProfileChangesTitle','ProfileChangesComment',NULL,'UserTheme', 0),
  629. ('allow_course_theme',NULL,'radio','Course','true','AllowCourseThemeTitle','AllowCourseThemeComment',NULL,NULL, 0),
  630. ('display_mini_month_calendar',NULL,'radio','Tools', 'true', 'DisplayMiniMonthCalendarTitle', 'DisplayMiniMonthCalendarComment', NULL, NULL, 0),
  631. ('display_upcoming_events',NULL,'radio','Tools','true','DisplayUpcomingEventsTitle','DisplayUpcomingEventsComment',NULL,NULL, 0),
  632. ('number_of_upcoming_events',NULL,'textfield','Tools','1','NumberOfUpcomingEventsTitle','NumberOfUpcomingEventsComment',NULL,NULL, 0),
  633. ('show_closed_courses',NULL,'radio','Platform','false','ShowClosedCoursesTitle','ShowClosedCoursesComment',NULL,NULL, 0),
  634. ('service_visio', 'visio_use_rtmpt', 'radio',null,'false', 'VisioUseRtmptTitle','VisioUseRtmptComment', NULL, NULL, 0),
  635. ('extendedprofile_registration', 'mycomptetences', 'checkbox','User','false', 'ExtendedProfileRegistrationTitle','ExtendedProfileRegistrationComment', NULL, 'MyCompetences', 0),
  636. ('extendedprofile_registration', 'mydiplomas', 'checkbox','User','false', 'ExtendedProfileRegistrationTitle','ExtendedProfileRegistrationComment', NULL, 'MyDiplomas', 0),
  637. ('extendedprofile_registration', 'myteach', 'checkbox','User','false', 'ExtendedProfileRegistrationTitle','ExtendedProfileRegistrationComment', NULL, 'MyTeach', 0),
  638. ('extendedprofile_registration', 'mypersonalopenarea', 'checkbox','User','false', 'ExtendedProfileRegistrationTitle','ExtendedProfileRegistrationComment', NULL, 'MyPersonalOpenArea', 0),
  639. ('extendedprofile_registrationrequired', 'mycomptetences', 'checkbox','User','false', 'ExtendedProfileRegistrationRequiredTitle','ExtendedProfileRegistrationRequiredComment', NULL, 'MyCompetences', 0),
  640. ('extendedprofile_registrationrequired', 'mydiplomas', 'checkbox','User','false', 'ExtendedProfileRegistrationRequiredTitle','ExtendedProfileRegistrationRequiredComment', NULL, 'MyDiplomas', 0),
  641. ('extendedprofile_registrationrequired', 'myteach', 'checkbox','User','false', 'ExtendedProfileRegistrationRequiredTitle','ExtendedProfileRegistrationRequiredComment', NULL, 'MyTeach', 0),
  642. ('extendedprofile_registrationrequired', 'mypersonalopenarea', 'checkbox','User','false', 'ExtendedProfileRegistrationRequiredTitle','ExtendedProfileRegistrationRequiredComment', NULL, 'MyPersonalOpenArea', 0),
  643. ('registration','phone','textfield','User','false','RegistrationRequiredFormsTitle','RegistrationRequiredFormsComment',NULL,'Phone', 0),
  644. ('add_users_by_coach',NULL,'radio','Session','false','AddUsersByCoachTitle','AddUsersByCoachComment',NULL,NULL, 0),
  645. ('extend_rights_for_coach',NULL,'radio','Security','false','ExtendRightsForCoachTitle','ExtendRightsForCoachComment',NULL,NULL, 0),
  646. ('extend_rights_for_coach_on_survey',NULL,'radio','Security','true','ExtendRightsForCoachOnSurveyTitle','ExtendRightsForCoachOnSurveyComment',NULL,NULL, 0),
  647. ('course_create_active_tools','wiki','checkbox','Tools','true','CourseCreateActiveToolsTitle','CourseCreateActiveToolsComment',NULL,'Wiki', 0),
  648. ('show_session_coach', NULL, 'radio','Session','false', 'ShowSessionCoachTitle','ShowSessionCoachComment', NULL, NULL, 0),
  649. ('course_create_active_tools','gradebook','checkbox','Tools','true','CourseCreateActiveToolsTitle','CourseCreateActiveToolsComment',NULL,'Gradebook', 0),
  650. ('allow_users_to_create_courses',NULL,'radio','Platform','true','AllowUsersToCreateCoursesTitle','AllowUsersToCreateCoursesComment',NULL,NULL, 0),
  651. ('course_create_active_tools','survey','checkbox','Tools','true','CourseCreateActiveToolsTitle','CourseCreateActiveToolsComment',NULL,'Survey', 0),
  652. ('course_create_active_tools','glossary','checkbox','Tools','true','CourseCreateActiveToolsTitle','CourseCreateActiveToolsComment',NULL,'Glossary', 0),
  653. ('course_create_active_tools','notebook','checkbox','Tools','true','CourseCreateActiveToolsTitle','CourseCreateActiveToolsComment',NULL,'Notebook', 0),
  654. ('course_create_active_tools','attendances','checkbox','Tools','false','CourseCreateActiveToolsTitle','CourseCreateActiveToolsComment',NULL,'Attendances', 0),
  655. ('course_create_active_tools','course_progress','checkbox','Tools','false','CourseCreateActiveToolsTitle','CourseCreateActiveToolsComment',NULL,'CourseProgress', 0),
  656. ('allow_reservation', NULL, 'radio', 'Tools', 'false', 'AllowReservationTitle', 'AllowReservationComment', NULL, NULL, 0),
  657. ('profile','apikeys','checkbox','User','false','ProfileChangesTitle','ProfileChangesComment',NULL,'ApiKeys', 0),
  658. ('allow_message_tool', NULL, 'radio', 'Tools', 'true', 'AllowMessageToolTitle', 'AllowMessageToolComment', NULL, NULL,1),
  659. ('allow_social_tool', NULL, 'radio', 'Tools', 'true', 'AllowSocialToolTitle', 'AllowSocialToolComment', NULL, NULL,1),
  660. ('allow_students_to_browse_courses',NULL,'radio','Platform','true','AllowStudentsToBrowseCoursesTitle','AllowStudentsToBrowseCoursesComment',NULL,NULL, 1),
  661. ('show_session_data', NULL, 'radio', 'Session', 'false', 'ShowSessionDataTitle', 'ShowSessionDataComment', NULL, NULL, 1),
  662. ('allow_use_sub_language', NULL, 'radio', 'Languages', 'false', 'AllowUseSubLanguageTitle', 'AllowUseSubLanguageComment', NULL, NULL,0),
  663. ('show_glossary_in_documents', NULL, 'radio', 'Course', 'none', 'ShowGlossaryInDocumentsTitle', 'ShowGlossaryInDocumentsComment', NULL, NULL,1),
  664. ('allow_terms_conditions', NULL, 'radio', 'Platform', 'false', 'AllowTermsAndConditionsTitle', 'AllowTermsAndConditionsComment', NULL, NULL,0),
  665. ('course_create_active_tools','enable_search','checkbox','Tools','false','CourseCreateActiveToolsTitle','CourseCreateActiveToolsComment',NULL,'Search',0),
  666. ('search_enabled',NULL,'radio','Search','false','EnableSearchTitle','EnableSearchComment',NULL,NULL,1),
  667. ('search_prefilter_prefix',NULL, NULL,'Search','','SearchPrefilterPrefix','SearchPrefilterPrefixComment',NULL,NULL,0),
  668. ('search_show_unlinked_results',NULL,'radio','Search','true','SearchShowUnlinkedResultsTitle','SearchShowUnlinkedResultsComment',NULL,NULL,1),
  669. ('show_courses_descriptions_in_catalog', NULL, 'radio', 'Course', 'true', 'ShowCoursesDescriptionsInCatalogTitle', 'ShowCoursesDescriptionsInCatalogComment', NULL, NULL, 1),
  670. ('allow_coach_to_edit_course_session',NULL,'radio','Session','true','AllowCoachsToEditInsideTrainingSessions','AllowCoachsToEditInsideTrainingSessionsComment',NULL,NULL, 0),
  671. ('show_glossary_in_extra_tools', NULL, 'radio', 'Course', 'none', 'ShowGlossaryInExtraToolsTitle', 'ShowGlossaryInExtraToolsComment', NULL, NULL,1),
  672. ('send_email_to_admin_when_create_course',NULL,'radio','Platform','false','SendEmailToAdminTitle','SendEmailToAdminComment',NULL,NULL, 1),
  673. ('go_to_course_after_login',NULL,'radio','Course','false','GoToCourseAfterLoginTitle','GoToCourseAfterLoginComment',NULL,NULL, 0),
  674. ('math_mimetex',NULL,'radio','Editor','false','MathMimetexTitle','MathMimetexComment',NULL,NULL, 0),
  675. ('math_asciimathML',NULL,'radio','Editor','false','MathASCIImathMLTitle','MathASCIImathMLComment',NULL,NULL, 0),
  676. ('enabled_asciisvg',NULL,'radio','Editor','false','AsciiSvgTitle','AsciiSvgComment',NULL,NULL, 0),
  677. ('include_asciimathml_script',NULL,'radio','Editor','false','IncludeAsciiMathMlTitle','IncludeAsciiMathMlComment',NULL,NULL, 0),
  678. ('youtube_for_students',NULL,'radio','Editor','true','YoutubeForStudentsTitle','YoutubeForStudentsComment',NULL,NULL, 0),
  679. ('block_copy_paste_for_students',NULL,'radio','Editor','false','BlockCopyPasteForStudentsTitle','BlockCopyPasteForStudentsComment',NULL,NULL, 0),
  680. ('more_buttons_maximized_mode',NULL,'radio','Editor','true','MoreButtonsForMaximizedModeTitle','MoreButtonsForMaximizedModeComment',NULL,NULL, 0),
  681. ('students_download_folders',NULL,'radio','Tools','true','AllowStudentsDownloadFoldersTitle','AllowStudentsDownloadFoldersComment',NULL,NULL, 0),
  682. ('users_copy_files',NULL,'radio','Tools','true','AllowUsersCopyFilesTitle','AllowUsersCopyFilesComment',NULL,NULL, 1),
  683. ('show_tabs', 'social', 'checkbox', 'Platform', 'true', 'ShowTabsTitle','ShowTabsComment',NULL,'TabsSocial', 0),
  684. ('allow_students_to_create_groups_in_social',NULL,'radio','Tools','false','AllowStudentsToCreateGroupsInSocialTitle','AllowStudentsToCreateGroupsInSocialComment',NULL,NULL, 0),
  685. ('allow_send_message_to_all_platform_users',NULL,'radio','Tools','true','AllowSendMessageToAllPlatformUsersTitle','AllowSendMessageToAllPlatformUsersComment',NULL,NULL, 0),
  686. ('message_max_upload_filesize',NULL,'textfield','Tools','20971520','MessageMaxUploadFilesizeTitle','MessageMaxUploadFilesizeComment',NULL,NULL, 0),
  687. ('show_tabs', 'dashboard', 'checkbox', 'Platform', 'true', 'ShowTabsTitle', 'ShowTabsComment', NULL, 'TabsDashboard', 1),
  688. ('use_users_timezone', 'timezones', 'radio', 'Timezones', 'true', 'UseUsersTimezoneTitle','UseUsersTimezoneComment',NULL,'Timezones', 1),
  689. ('timezone_value', 'timezones', 'select', 'Timezones', '', 'TimezoneValueTitle','TimezoneValueComment',NULL,'Timezones', 1),
  690. ('allow_user_course_subscription_by_course_admin', NULL, 'radio', 'Security', 'true', 'AllowUserCourseSubscriptionByCourseAdminTitle', 'AllowUserCourseSubscriptionByCourseAdminComment', NULL, NULL, 1),
  691. ('show_link_bug_notification', NULL, 'radio', 'Platform', 'true', 'ShowLinkBugNotificationTitle', 'ShowLinkBugNotificationComment', NULL, NULL, 0),
  692. ('course_validation', NULL, 'radio', 'Platform', 'false', 'EnableCourseValidation', 'EnableCourseValidationComment', NULL, NULL, 1),
  693. ('course_validation_terms_and_conditions_url', NULL, 'textfield', 'Platform', '', 'CourseValidationTermsAndConditionsLink', 'CourseValidationTermsAndConditionsLinkComment', NULL, NULL, 1),
  694. ('sso_authentication',NULL,'radio','Security','false','EnableSSOTitle','EnableSSOComment',NULL,NULL,1),
  695. ('sso_authentication_domain',NULL,'textfield','Security','','SSOServerDomainTitle','SSOServerDomainComment',NULL,NULL,1),
  696. ('sso_authentication_auth_uri',NULL,'textfield','Security','/?q=user','SSOServerAuthURITitle','SSOServerAuthURIComment',NULL,NULL,1),
  697. ('sso_authentication_unauth_uri',NULL,'textfield','Security','/?q=logout','SSOServerUnAuthURITitle','SSOServerUnAuthURIComment',NULL,NULL,1),
  698. ('sso_authentication_protocol',NULL,'radio','Security','http://','SSOServerProtocolTitle','SSOServerProtocolComment',NULL,NULL,1),
  699. ('enabled_wiris',NULL,'radio','Editor','false','EnabledWirisTitle','EnabledWirisComment',NULL,NULL, 0),
  700. ('allow_spellcheck',NULL,'radio','Editor','false','AllowSpellCheckTitle','AllowSpellCheckComment',NULL,NULL, 0),
  701. ('force_wiki_paste_as_plain_text',NULL,'radio','Editor','false','ForceWikiPasteAsPlainTextTitle','ForceWikiPasteAsPlainTextComment',NULL,NULL, 0),
  702. ('enabled_googlemaps',NULL,'radio','Editor','false','EnabledGooglemapsTitle','EnabledGooglemapsComment',NULL,NULL, 0),
  703. ('enabled_imgmap',NULL,'radio','Editor','true','EnabledImageMapsTitle','EnabledImageMapsComment',NULL,NULL, 0),
  704. ('enabled_support_svg', NULL,'radio', 'Tools', 'true', 'EnabledSVGTitle','EnabledSVGComment',NULL,NULL, 0),
  705. ('pdf_export_watermark_enable', NULL,'radio', 'Platform', 'false','PDFExportWatermarkEnableTitle', 'PDFExportWatermarkEnableComment', 'platform',NULL, 1),
  706. ('pdf_export_watermark_by_course', NULL,'radio', 'Platform', 'false','PDFExportWatermarkByCourseTitle', 'PDFExportWatermarkByCourseComment','platform',NULL, 1),
  707. ('pdf_export_watermark_text', NULL,'textfield', 'Platform', '', 'PDFExportWatermarkTextTitle', 'PDFExportWatermarkTextComment', 'platform',NULL, 1),
  708. ('enabled_insertHtml', NULL,'radio', 'Editor', 'true','EnabledInsertHtmlTitle', 'EnabledInsertHtmlComment',NULL,NULL, 0),
  709. ('students_export2pdf', NULL,'radio', 'Tools', 'true', 'EnabledStudentExport2PDFTitle', 'EnabledStudentExport2PDFComment',NULL,NULL, 0),
  710. ('exercise_min_score', NULL,'textfield', 'Course', '', 'ExerciseMinScoreTitle', 'ExerciseMinScoreComment','platform',NULL, 1),
  711. ('exercise_max_score', NULL,'textfield', 'Course', '', 'ExerciseMaxScoreTitle', 'ExerciseMaxScoreComment','platform',NULL, 1),
  712. ('show_users_folders', NULL,'radio', 'Tools', 'true', 'ShowUsersFoldersTitle','ShowUsersFoldersComment',NULL,NULL, 0),
  713. ('show_default_folders', NULL,'radio', 'Tools', 'true', 'ShowDefaultFoldersTitle','ShowDefaultFoldersComment',NULL,NULL, 0),
  714. ('show_chat_folder', NULL,'radio', 'Tools', 'true', 'ShowChatFolderTitle','ShowChatFolderComment',NULL,NULL, 0),
  715. ('enabled_text2audio', NULL,'radio', 'Tools', 'false', 'Text2AudioTitle','Text2AudioComment',NULL,NULL, 0),
  716. ('course_hide_tools','course_description','checkbox','Tools','false','CourseHideToolsTitle','CourseHideToolsComment',NULL,'CourseDescription', 1),
  717. ('course_hide_tools','calendar_event','checkbox','Tools','false','CourseHideToolsTitle','CourseHideToolsComment',NULL,'Agenda', 1),
  718. ('course_hide_tools','document','checkbox','Tools','false','CourseHideToolsTitle','CourseHideToolsComment',NULL,'Documents', 1),
  719. ('course_hide_tools','learnpath','checkbox','Tools','false','CourseHideToolsTitle','CourseHideToolsComment',NULL,'LearningPath', 1),
  720. ('course_hide_tools','link','checkbox','Tools','false','CourseHideToolsTitle','CourseHideToolsComment',NULL,'Links', 1),
  721. ('course_hide_tools','announcement','checkbox','Tools','false','CourseHideToolsTitle','CourseHideToolsComment',NULL,'Announcements', 1),
  722. ('course_hide_tools','forum','checkbox','Tools','false','CourseHideToolsTitle','CourseHideToolsComment',NULL,'Forums', 1),
  723. ('course_hide_tools','dropbox','checkbox','Tools','false','CourseHideToolsTitle','CourseHideToolsComment',NULL,'Dropbox', 1),
  724. ('course_hide_tools','quiz','checkbox','Tools','false','CourseHideToolsTitle','CourseHideToolsComment',NULL,'Quiz', 1),
  725. ('course_hide_tools','user','checkbox','Tools','false','CourseHideToolsTitle','CourseHideToolsComment',NULL,'Users', 1),
  726. ('course_hide_tools','group','checkbox','Tools','false','CourseHideToolsTitle','CourseHideToolsComment',NULL,'Groups', 1),
  727. ('course_hide_tools','chat','checkbox','Tools','false','CourseHideToolsTitle','CourseHideToolsComment',NULL,'Chat', 1),
  728. ('course_hide_tools','student_publication','checkbox','Tools','false','CourseHideToolsTitle','CourseHideToolsComment',NULL,'StudentPublications', 1),
  729. ('course_hide_tools','wiki','checkbox','Tools','false','CourseHideToolsTitle','CourseHideToolsComment',NULL,'Wiki', 1),
  730. ('course_hide_tools','gradebook','checkbox','Tools','false','CourseHideToolsTitle','CourseHideToolsComment',NULL,'Gradebook', 1),
  731. ('course_hide_tools','survey','checkbox','Tools','false','CourseHideToolsTitle','CourseHideToolsComment',NULL,'Survey', 1),
  732. ('course_hide_tools','glossary','checkbox','Tools','false','CourseHideToolsTitle','CourseHideToolsComment',NULL,'Glossary', 1),
  733. ('course_hide_tools','notebook','checkbox','Tools','false','CourseHideToolsTitle','CourseHideToolsComment',NULL,'Notebook', 1),
  734. ('course_hide_tools','attendance','checkbox','Tools','false','CourseHideToolsTitle','CourseHideToolsComment',NULL,'Attendances', 1),
  735. ('course_hide_tools','course_progress','checkbox','Tools','false','CourseHideToolsTitle','CourseHideToolsComment',NULL,'CourseProgress', 1),
  736. ('course_hide_tools','blog_management','checkbox','Tools','false','CourseHideToolsTitle','CourseHideToolsComment',NULL,'Blog',1),
  737. ('course_hide_tools','tracking','checkbox','Tools','false','CourseHideToolsTitle','CourseHideToolsComment',NULL,'Stats',1),
  738. ('course_hide_tools','course_maintenance','checkbox','Tools','false','CourseHideToolsTitle','CourseHideToolsComment',NULL,'Maintenance',1),
  739. ('course_hide_tools','course_setting','checkbox','Tools','false','CourseHideToolsTitle','CourseHideToolsComment',NULL,'CourseSettings',1),
  740. ('enabled_support_pixlr',NULL,'radio','Tools','false','EnabledPixlrTitle','EnabledPixlrComment',NULL,NULL, 0),
  741. ('show_groups_to_users',NULL,'radio','Session','false','ShowGroupsToUsersTitle','ShowGroupsToUsersComment',NULL,NULL, 0),
  742. ('accessibility_font_resize',NULL,'radio','Platform','false','EnableAccessibilityFontResizeTitle','EnableAccessibilityFontResizeComment',NULL,NULL, 1),
  743. ('hide_courses_in_sessions',NULL,'radio', 'Session','false','HideCoursesInSessionsTitle', 'HideCoursesInSessionsComment','platform',NULL, 1),
  744. ('enable_quiz_scenario', NULL,'radio','Course','false','EnableQuizScenarioTitle','EnableQuizScenarioComment',NULL,NULL, 1),
  745. ('enable_nanogong',NULL,'radio','Tools','false','EnableNanogongTitle','EnableNanogongComment',NULL,NULL, 0),
  746. ('filter_terms',NULL,'textarea','Security','','FilterTermsTitle','FilterTermsComment',NULL,NULL, 0),
  747. ('header_extra_content', NULL, 'textarea', 'Tracking', '', 'HeaderExtraContentTitle', 'HeaderExtraContentComment', NULL, NULL, 1),
  748. ('footer_extra_content', NULL, 'textarea', 'Tracking', '', 'FooterExtraContentTitle', 'FooterExtraContentComment', NULL, NULL, 1),
  749. ('show_documents_preview', NULL, 'radio', 'Tools', 'false', 'ShowDocumentPreviewTitle', 'ShowDocumentPreviewComment', NULL, NULL, 1),
  750. ('htmlpurifier_wiki', NULL, 'radio', 'Editor', 'false', 'HtmlPurifierWikiTitle', 'HtmlPurifierWikiComment', NULL, NULL, 0),
  751. ('cas_activate', NULL, 'radio', 'CAS', 'false', 'CasMainActivateTitle', 'CasMainActivateComment', NULL, NULL, 0),
  752. ('cas_server', NULL, 'textfield', 'CAS', '', 'CasMainServerTitle', 'CasMainServerComment', NULL, NULL, 0),
  753. ('cas_server_uri', NULL, 'textfield', 'CAS', '', 'CasMainServerURITitle', 'CasMainServerURIComment', NULL, NULL, 0),
  754. ('cas_port', NULL, 'textfield', 'CAS', '', 'CasMainPortTitle', 'CasMainPortComment', NULL, NULL, 0),
  755. ('cas_protocol', NULL, 'radio', 'CAS', '', 'CasMainProtocolTitle', 'CasMainProtocolComment', NULL, NULL, 0),
  756. ('cas_add_user_activate', NULL, 'radio', 'CAS', 'false', 'CasUserAddActivateTitle', 'CasUserAddActivateComment', NULL, NULL, 0),
  757. ('update_user_info_cas_with_ldap', NULL, 'radio', 'CAS', 'true', 'UpdateUserInfoCasWithLdapTitle', 'UpdateUserInfoCasWithLdapComment', NULL, NULL, 0),
  758. ('student_page_after_login', NULL, 'textfield', 'Platform', '', 'StudentPageAfterLoginTitle', 'StudentPageAfterLoginComment', NULL, NULL, 0),
  759. ('teacher_page_after_login', NULL, 'textfield', 'Platform', '', 'TeacherPageAfterLoginTitle', 'TeacherPageAfterLoginComment', NULL, NULL, 0),
  760. ('drh_page_after_login', NULL, 'textfield', 'Platform', '', 'DRHPageAfterLoginTitle', 'DRHPageAfterLoginComment', NULL, NULL, 0),
  761. ('sessionadmin_page_after_login', NULL, 'textfield', 'Session', '', 'SessionAdminPageAfterLoginTitle', 'SessionAdminPageAfterLoginComment', NULL, NULL, 0),
  762. ('student_autosubscribe', NULL, 'textfield', 'Platform', '', 'StudentAutosubscribeTitle', 'StudentAutosubscribeComment', NULL, NULL, 0),
  763. ('teacher_autosubscribe', NULL, 'textfield', 'Platform', '', 'TeacherAutosubscribeTitle', 'TeacherAutosubscribeComment', NULL, NULL, 0),
  764. ('drh_autosubscribe', NULL, 'textfield', 'Platform', '', 'DRHAutosubscribeTitle', 'DRHAutosubscribeComment', NULL, NULL, 0),
  765. ('sessionadmin_autosubscribe', NULL, 'textfield', 'Session', '', 'SessionadminAutosubscribeTitle', 'SessionadminAutosubscribeComment', NULL, NULL, 0),
  766. ('scorm_cumulative_session_time', NULL, 'radio', 'Course', 'true', 'ScormCumulativeSessionTimeTitle', 'ScormCumulativeSessionTimeComment', NULL, NULL, 0),
  767. ('allow_hr_skills_management', NULL, 'radio', 'Gradebook', 'true', 'AllowHRSkillsManagementTitle', 'AllowHRSkillsManagementComment', NULL, NULL, 1),
  768. ('enable_help_link', NULL, 'radio', 'Platform', 'true', 'EnableHelpLinkTitle', 'EnableHelpLinkComment', NULL, NULL, 0),
  769. ('teachers_can_change_score_settings', NULL, 'radio', 'Gradebook', 'true', 'TeachersCanChangeScoreSettingsTitle', 'TeachersCanChangeScoreSettingsComment', NULL, NULL, 1),
  770. ('allow_users_to_change_email_with_no_password', NULL, 'radio', 'User', 'false', 'AllowUsersToChangeEmailWithNoPasswordTitle', 'AllowUsersToChangeEmailWithNoPasswordComment', NULL, NULL, 0),
  771. ('show_admin_toolbar', NULL, 'radio', 'Platform', 'show_to_admin', 'ShowAdminToolbarTitle', 'ShowAdminToolbarComment', NULL, NULL, 1),
  772. ('allow_global_chat', NULL, 'radio', 'Platform', 'true', 'AllowGlobalChatTitle', 'AllowGlobalChatComment', NULL, NULL, 1),
  773. ('languagePriority1', NULL, 'radio', 'Languages', 'course_lang', 'LanguagePriority1Title', 'LanguagePriority1Comment', NULL, NULL, 0),
  774. ('languagePriority2', NULL, 'radio', 'Languages','user_profil_lang', 'LanguagePriority2Title', 'LanguagePriority2Comment', NULL, NULL, 0),
  775. ('languagePriority3', NULL, 'radio', 'Languages','user_selected_lang', 'LanguagePriority3Title', 'LanguagePriority3Comment', NULL, NULL, 0),
  776. ('languagePriority4', NULL, 'radio', 'Languages', 'platform_lang','LanguagePriority4Title', 'LanguagePriority4Comment', NULL, NULL, 0),
  777. ('login_is_email', NULL, 'radio', 'Platform', 'false', 'LoginIsEmailTitle', 'LoginIsEmailComment', NULL, NULL, 0),
  778. ('courses_default_creation_visibility', NULL, 'radio', 'Course', '2', 'CoursesDefaultCreationVisibilityTitle', 'CoursesDefaultCreationVisibilityComment', NULL, NULL, 1),
  779. ('allow_browser_sniffer', NULL, 'radio', 'Tuning', 'false', 'AllowBrowserSnifferTitle', 'AllowBrowserSnifferComment', NULL, NULL, 0),
  780. ('enable_wami_record',NULL,'radio','Tools','false','EnableWamiRecordTitle','EnableWamiRecordComment',NULL,NULL, 0),
  781. ('gradebook_enable_grade_model', NULL, 'radio', 'Gradebook', 'false', 'GradebookEnableGradeModelTitle', 'GradebookEnableGradeModelComment', NULL, NULL, 1),
  782. ('teachers_can_change_grade_model_settings', NULL, 'radio', 'Gradebook', 'true', 'TeachersCanChangeGradeModelSettingsTitle', 'TeachersCanChangeGradeModelSettingsComment', NULL, NULL, 1),
  783. ('gradebook_default_weight', NULL, 'textfield', 'Gradebook', '100', 'GradebookDefaultWeightTitle', 'GradebookDefaultWeightComment', NULL, NULL, 0),
  784. ('ldap_description', NULL, 'radio', 'LDAP', NULL, 'LdapDescriptionTitle', 'LdapDescriptionComment', NULL, NULL, 0),
  785. ('shibboleth_description', NULL, 'radio', 'Shibboleth', 'false', 'ShibbolethMainActivateTitle', 'ShibbolethMainActivateComment', NULL, NULL, 0),
  786. ('facebook_description', NULL, 'radio', 'Facebook', 'false', 'FacebookMainActivateTitle', 'FacebookMainActivateComment', NULL, NULL, 0),
  787. ('gradebook_locking_enabled', NULL, 'radio', 'Gradebook', 'false', 'GradebookEnableLockingTitle', 'GradebookEnableLockingComment', NULL, NULL, 0),
  788. ('gradebook_default_grade_model_id', NULL, 'select', 'Gradebook', '', 'GradebookDefaultGradeModelTitle', 'GradebookDefaultGradeModelComment', NULL, NULL, 1),
  789. ('allow_session_admins_to_manage_all_sessions', NULL, 'radio', 'Session', 'false', 'AllowSessionAdminsToSeeAllSessionsTitle', 'AllowSessionAdminsToSeeAllSessionsComment', NULL, NULL, 1),
  790. ('allow_skills_tool', NULL, 'radio', 'Platform', 'false', 'AllowSkillsToolTitle', 'AllowSkillsToolComment', NULL, NULL, 1),
  791. ('allow_public_certificates', NULL, 'radio', 'Course', 'false', 'AllowPublicCertificatesTitle', 'AllowPublicCertificatesComment', NULL, NULL, 1),
  792. ('platform_unsubscribe_allowed', NULL, 'radio', 'Platform', 'false', 'PlatformUnsubscribeTitle', 'PlatformUnsubscribeComment', NULL, NULL, 1),
  793. ('activate_email_template', NULL, 'radio', 'Platform', 'false', 'ActivateEmailTemplateTitle', 'ActivateEmailTemplateComment', NULL, NULL, 0),
  794. ('enable_iframe_inclusion', NULL, 'radio', 'Editor', 'false', 'EnableIframeInclusionTitle', 'EnableIframeInclusionComment', NULL, NULL, 1),
  795. ('show_hot_courses', NULL, 'radio', 'Platform', 'true', 'ShowHotCoursesTitle', 'ShowHotCoursesComment', NULL, NULL, 1),
  796. ('enable_webcam_clip',NULL,'radio','Tools','false','EnableWebCamClipTitle','EnableWebCamClipComment',NULL,NULL, 0),
  797. ('use_custom_pages', NULL, 'radio','Platform','false','UseCustomPagesTitle','UseCustomPagesComment', NULL, NULL, 1),
  798. ('tool_visible_by_default_at_creation','documents','checkbox','Tools','true','ToolVisibleByDefaultAtCreationTitle','ToolVisibleByDefaultAtCreationComment',NULL,'Documents', 1),
  799. ('tool_visible_by_default_at_creation','learning_path','checkbox','Tools','true','ToolVisibleByDefaultAtCreationTitle','ToolVisibleByDefaultAtCreationComment',NULL,'LearningPath', 1),
  800. ('tool_visible_by_default_at_creation','links','checkbox','Tools','true','ToolVisibleByDefaultAtCreationTitle','ToolVisibleByDefaultAtCreationComment',NULL,'Links', 1),
  801. ('tool_visible_by_default_at_creation','announcements','checkbox','Tools','true','ToolVisibleByDefaultAtCreationTitle','ToolVisibleByDefaultAtCreationComment',NULL,'Announcements', 1),
  802. ('tool_visible_by_default_at_creation','forums','checkbox','Tools','true','ToolVisibleByDefaultAtCreationTitle','ToolVisibleByDefaultAtCreationComment',NULL,'Forums', 1),
  803. ('tool_visible_by_default_at_creation','quiz','checkbox','Tools','true','ToolVisibleByDefaultAtCreationTitle','ToolVisibleByDefaultAtCreationComment',NULL,'Quiz', 1),
  804. ('tool_visible_by_default_at_creation','gradebook','checkbox','Tools','true','ToolVisibleByDefaultAtCreationTitle','ToolVisibleByDefaultAtCreationComment',NULL,'Gradebook', 1),
  805. ('prevent_session_admins_to_manage_all_users', NULL, 'radio', 'Session', 'false', 'PreventSessionAdminsToManageAllUsersTitle', 'PreventSessionAdminsToManageAllUsersComment', NULL, NULL, 1),
  806. ('documents_default_visibility_defined_in_course', NULL,'radio','Tools','false','DocumentsDefaultVisibilityDefinedInCourseTitle','DocumentsDefaultVisibilityDefinedInCourseComment',NULL, NULL, 1),
  807. ('enabled_mathjax', NULL, 'radio', 'Editor', 'false', 'EnableMathJaxTitle', 'EnableMathJaxComment', NULL, NULL, 0),
  808. ('meta_twitter_site', NULL, 'textfield', 'Tracking', '', 'MetaTwitterSiteTitle', 'MetaTwitterSiteComment', NULL, NULL, 1),
  809. ('meta_twitter_creator', NULL, 'textfield', 'Tracking', '', 'MetaTwitterCreatorTitle', 'MetaTwitterCreatorComment', NULL, NULL, 1),
  810. ('meta_title', NULL, 'textfield', 'Tracking', '', 'MetaTitleTitle', 'MetaTitleComment', NULL, NULL, 1),
  811. ('meta_description', NULL, 'textfield', 'Tracking', '', 'MetaDescriptionTitle', 'MetaDescriptionComment', NULL, NULL, 1),
  812. ('meta_image_path', NULL, 'textfield', 'Tracking', '', 'MetaImagePathTitle', 'MetaImagePathComment', NULL, NULL, 1),
  813. ('chamilo_database_version', NULL, 'textfield',NULL, '0', 'DatabaseVersion','', NULL, NULL, 0);
  814. UNLOCK TABLES;
  815. /*!40000 ALTER TABLE settings_current ENABLE KEYS */;
  816. --
  817. -- Table structure for table settings_options
  818. --
  819. DROP TABLE IF EXISTS settings_options;
  820. CREATE TABLE IF NOT EXISTS settings_options (
  821. id int unsigned NOT NULL auto_increment,
  822. variable varchar(255) default NULL,
  823. value varchar(255) default NULL,
  824. display_text varchar(255) NOT NULL default '',
  825. PRIMARY KEY (id),
  826. UNIQUE KEY id (id)
  827. );
  828. ALTER TABLE settings_options ADD UNIQUE unique_setting_option (variable(165), value(165));
  829. --
  830. -- Dumping data for table settings_options
  831. --
  832. /*!40000 ALTER TABLE settings_options DISABLE KEYS */;
  833. LOCK TABLES settings_options WRITE;
  834. INSERT INTO settings_options (variable, value, display_text)
  835. VALUES
  836. ('show_administrator_data','true','Yes'),
  837. ('show_administrator_data','false','No'),
  838. ('show_tutor_data','true','Yes'),
  839. ('show_tutor_data','false','No'),
  840. ('show_teacher_data','true','Yes'),
  841. ('show_teacher_data','false','No'),
  842. ('homepage_view','activity','HomepageViewActivity'),
  843. ('homepage_view','2column','HomepageView2column'),
  844. ('homepage_view','3column','HomepageView3column'),
  845. ('homepage_view','vertical_activity','HomepageViewVerticalActivity'),
  846. ('homepage_view','activity_big','HomepageViewActivityBig'),
  847. ('show_toolshortcuts','true','Yes'),
  848. ('show_toolshortcuts','false','No'),
  849. ('allow_group_categories','true','Yes'),
  850. ('allow_group_categories','false','No'),
  851. ('server_type','production','ProductionServer'),
  852. ('server_type','test','TestServer'),
  853. ('allow_name_change','true','Yes'),
  854. ('allow_name_change','false','No'),
  855. ('allow_officialcode_change','true','Yes'),
  856. ('allow_officialcode_change','false','No'),
  857. ('allow_registration','true','Yes'),
  858. ('allow_registration','false','No'),
  859. ('allow_registration','approval','AfterApproval'),
  860. ('allow_registration_as_teacher','true','Yes'),
  861. ('allow_registration_as_teacher','false','No'),
  862. ('allow_lostpassword','true','Yes'),
  863. ('allow_lostpassword','false','No'),
  864. ('allow_user_headings','true','Yes'),
  865. ('allow_user_headings','false','No'),
  866. ('allow_personal_agenda','true','Yes'),
  867. ('allow_personal_agenda','false','No'),
  868. ('display_coursecode_in_courselist','true','Yes'),
  869. ('display_coursecode_in_courselist','false','No'),
  870. ('display_teacher_in_courselist','true','Yes'),
  871. ('display_teacher_in_courselist','false','No'),
  872. ('permanently_remove_deleted_files','true','YesWillDeletePermanently'),
  873. ('permanently_remove_deleted_files','false','NoWillDeletePermanently'),
  874. ('dropbox_allow_overwrite','true','Yes'),
  875. ('dropbox_allow_overwrite','false','No'),
  876. ('dropbox_allow_just_upload','true','Yes'),
  877. ('dropbox_allow_just_upload','false','No'),
  878. ('dropbox_allow_student_to_student','true','Yes'),
  879. ('dropbox_allow_student_to_student','false','No'),
  880. ('dropbox_allow_group','true','Yes'),
  881. ('dropbox_allow_group','false','No'),
  882. ('dropbox_allow_mailing','true','Yes'),
  883. ('dropbox_allow_mailing','false','No'),
  884. ('extended_profile','true','Yes'),
  885. ('extended_profile','false','No'),
  886. ('student_view_enabled','true','Yes'),
  887. ('student_view_enabled','false','No'),
  888. ('show_navigation_menu','false','No'),
  889. ('show_navigation_menu','icons','IconsOnly'),
  890. ('show_navigation_menu','text','TextOnly'),
  891. ('show_navigation_menu','iconstext','IconsText'),
  892. ('enable_tool_introduction','true','Yes'),
  893. ('enable_tool_introduction','false','No'),
  894. ('page_after_login', 'index.php', 'CampusHomepage'),
  895. ('page_after_login', 'user_portal.php', 'MyCourses'),
  896. ('page_after_login', 'main/auth/courses.php', 'CourseCatalog'),
  897. ('breadcrumbs_course_homepage', 'get_lang', 'CourseHomepage'),
  898. ('breadcrumbs_course_homepage', 'course_code', 'CourseCode'),
  899. ('breadcrumbs_course_homepage', 'course_title', 'CourseTitle'),
  900. ('example_material_course_creation', 'true', 'Yes'),
  901. ('example_material_course_creation', 'false', 'No'),
  902. ('use_session_mode', 'true', 'Yes'),
  903. ('use_session_mode', 'false', 'No'),
  904. ('allow_email_editor', 'true' ,'Yes'),
  905. ('allow_email_editor', 'false', 'No'),
  906. ('show_email_addresses','true','Yes'),
  907. ('show_email_addresses','false','No'),
  908. ('upload_extensions_list_type', 'blacklist', 'Blacklist'),
  909. ('upload_extensions_list_type', 'whitelist', 'Whitelist'),
  910. ('upload_extensions_skip', 'true', 'Remove'),
  911. ('upload_extensions_skip', 'false', 'Rename'),
  912. ('show_number_of_courses', 'true', 'Yes'),
  913. ('show_number_of_courses', 'false', 'No'),
  914. ('show_empty_course_categories', 'true', 'Yes'),
  915. ('show_empty_course_categories', 'false', 'No'),
  916. ('show_back_link_on_top_of_tree', 'true', 'Yes'),
  917. ('show_back_link_on_top_of_tree', 'false', 'No'),
  918. ('show_different_course_language', 'true', 'Yes'),
  919. ('show_different_course_language', 'false', 'No'),
  920. ('split_users_upload_directory', 'true', 'Yes'),
  921. ('split_users_upload_directory', 'false', 'No'),
  922. ('hide_dltt_markup', 'false', 'No'),
  923. ('hide_dltt_markup', 'true', 'Yes'),
  924. ('display_categories_on_homepage','true','Yes'),
  925. ('display_categories_on_homepage','false','No'),
  926. ('default_forum_view', 'flat', 'Flat'),
  927. ('default_forum_view', 'threaded', 'Threaded'),
  928. ('default_forum_view', 'nested', 'Nested'),
  929. ('survey_email_sender_noreply', 'coach', 'CourseCoachEmailSender'),
  930. ('survey_email_sender_noreply', 'noreply', 'NoReplyEmailSender'),
  931. ('openid_authentication','true','Yes'),
  932. ('openid_authentication','false','No'),
  933. ('gradebook_enable','true','Yes'),
  934. ('gradebook_enable','false','No'),
  935. ('user_selected_theme','true','Yes'),
  936. ('user_selected_theme','false','No'),
  937. ('allow_course_theme','true','Yes'),
  938. ('allow_course_theme','false','No'),
  939. ('display_mini_month_calendar', 'true', 'Yes'),
  940. ('display_mini_month_calendar', 'false', 'No'),
  941. ('display_upcoming_events', 'true', 'Yes'),
  942. ('display_upcoming_events', 'false', 'No'),
  943. ('show_closed_courses', 'true', 'Yes'),
  944. ('show_closed_courses', 'false', 'No'),
  945. ('ldap_version', '2', 'LDAPVersion2'),
  946. ('ldap_version', '3', 'LDAPVersion3'),
  947. ('visio_use_rtmpt','true','Yes'),
  948. ('visio_use_rtmpt','false','No'),
  949. ('add_users_by_coach', 'true', 'Yes'),
  950. ('add_users_by_coach', 'false', 'No'),
  951. ('extend_rights_for_coach', 'true', 'Yes'),
  952. ('extend_rights_for_coach', 'false', 'No'),
  953. ('extend_rights_for_coach_on_survey', 'true', 'Yes'),
  954. ('extend_rights_for_coach_on_survey', 'false', 'No'),
  955. ('show_session_coach', 'true', 'Yes'),
  956. ('show_session_coach', 'false', 'No'),
  957. ('allow_users_to_create_courses','true','Yes'),
  958. ('allow_users_to_create_courses','false','No'),
  959. ('breadcrumbs_course_homepage', 'session_name_and_course_title', 'SessionNameAndCourseTitle'),
  960. ('allow_reservation', 'true', 'Yes'),
  961. ('allow_reservation', 'false', 'No'),
  962. ('allow_message_tool', 'true', 'Yes'),
  963. ('allow_message_tool', 'false', 'No'),
  964. ('allow_social_tool', 'true', 'Yes'),
  965. ('allow_social_tool', 'false', 'No'),
  966. ('allow_students_to_browse_courses','true','Yes'),
  967. ('allow_students_to_browse_courses','false','No'),
  968. ('show_email_of_teacher_or_tutor ', 'true', 'Yes'),
  969. ('show_email_of_teacher_or_tutor ', 'false', 'No'),
  970. ('show_session_data ', 'true', 'Yes'),
  971. ('show_session_data ', 'false', 'No'),
  972. ('allow_use_sub_language', 'true', 'Yes'),
  973. ('allow_use_sub_language', 'false', 'No'),
  974. ('show_glossary_in_documents', 'none', 'ShowGlossaryInDocumentsIsNone'),
  975. ('show_glossary_in_documents', 'ismanual', 'ShowGlossaryInDocumentsIsManual'),
  976. ('show_glossary_in_documents', 'isautomatic', 'ShowGlossaryInDocumentsIsAutomatic'),
  977. ('allow_terms_conditions', 'true', 'Yes'),
  978. ('allow_terms_conditions', 'false', 'No'),
  979. ('search_enabled', 'true', 'Yes'),
  980. ('search_enabled', 'false', 'No'),
  981. ('search_show_unlinked_results', 'true', 'SearchShowUnlinkedResults'),
  982. ('search_show_unlinked_results', 'false', 'SearchHideUnlinkedResults'),
  983. ('show_courses_descriptions_in_catalog', 'true', 'Yes'),
  984. ('show_courses_descriptions_in_catalog', 'false', 'No'),
  985. ('allow_coach_to_edit_course_session','true','Yes'),
  986. ('allow_coach_to_edit_course_session','false','No'),
  987. ('show_glossary_in_extra_tools', 'none', 'None'),
  988. ('show_glossary_in_extra_tools', 'exercise', 'Exercise'),
  989. ('show_glossary_in_extra_tools', 'lp', 'Learning path'),
  990. ('show_glossary_in_extra_tools', 'exercise_and_lp', 'ExerciseAndLearningPath'),
  991. ('send_email_to_admin_when_create_course','true','Yes'),
  992. ('send_email_to_admin_when_create_course','false','No'),
  993. ('go_to_course_after_login','true','Yes'),
  994. ('go_to_course_after_login','false','No'),
  995. ('math_mimetex','true','Yes'),
  996. ('math_mimetex','false','No'),
  997. ('math_asciimathML','true','Yes'),
  998. ('math_asciimathML','false','No'),
  999. ('enabled_asciisvg','true','Yes'),
  1000. ('enabled_asciisvg','false','No'),
  1001. ('include_asciimathml_script','true','Yes'),
  1002. ('include_asciimathml_script','false','No'),
  1003. ('youtube_for_students','true','Yes'),
  1004. ('youtube_for_students','false','No'),
  1005. ('block_copy_paste_for_students','true','Yes'),
  1006. ('block_copy_paste_for_students','false','No'),
  1007. ('more_buttons_maximized_mode','true','Yes'),
  1008. ('more_buttons_maximized_mode','false','No'),
  1009. ('students_download_folders','true','Yes'),
  1010. ('students_download_folders','false','No'),
  1011. ('users_copy_files','true','Yes'),
  1012. ('users_copy_files','false','No'),
  1013. ('allow_students_to_create_groups_in_social','true','Yes'),
  1014. ('allow_students_to_create_groups_in_social','false','No'),
  1015. ('allow_send_message_to_all_platform_users','true','Yes'),
  1016. ('allow_send_message_to_all_platform_users','false','No'),
  1017. ('use_users_timezone', 'true', 'Yes'),
  1018. ('use_users_timezone', 'false', 'No'),
  1019. ('allow_user_course_subscription_by_course_admin', 'true', 'Yes'),
  1020. ('allow_user_course_subscription_by_course_admin', 'false', 'No'),
  1021. ('show_link_bug_notification', 'true', 'Yes'),
  1022. ('show_link_bug_notification', 'false', 'No'),
  1023. ('course_validation', 'true', 'Yes'),
  1024. ('course_validation', 'false', 'No'),
  1025. ('sso_authentication', 'true', 'Yes'),
  1026. ('sso_authentication', 'false', 'No'),
  1027. ('sso_authentication_protocol', 'http://', 'http://'),
  1028. ('sso_authentication_protocol', 'https://', 'https://'),
  1029. ('enabled_wiris','true','Yes'),
  1030. ('enabled_wiris','false','No'),
  1031. ('allow_spellcheck','true','Yes'),
  1032. ('allow_spellcheck','false','No'),
  1033. ('force_wiki_paste_as_plain_text','true','Yes'),
  1034. ('force_wiki_paste_as_plain_text','false','No'),
  1035. ('enabled_googlemaps','true','Yes'),
  1036. ('enabled_googlemaps','false','No'),
  1037. ('enabled_imgmap','true','Yes'),
  1038. ('enabled_imgmap','false','No'),
  1039. ('enabled_support_svg','true','Yes'),
  1040. ('enabled_support_svg','false','No'),
  1041. ('pdf_export_watermark_enable','true','Yes'),
  1042. ('pdf_export_watermark_enable','false','No'),
  1043. ('pdf_export_watermark_by_course','true','Yes'),
  1044. ('pdf_export_watermark_by_course','false','No'),
  1045. ('enabled_insertHtml','true','Yes'),
  1046. ('enabled_insertHtml','false','No'),
  1047. ('students_export2pdf','true','Yes'),
  1048. ('students_export2pdf','false','No'),
  1049. ('show_users_folders','true','Yes'),
  1050. ('show_users_folders','false','No'),
  1051. ('show_default_folders','true','Yes'),
  1052. ('show_default_folders','false','No'),
  1053. ('show_chat_folder','true','Yes'),
  1054. ('show_chat_folder','false','No'),
  1055. ('enabled_text2audio','true','Yes'),
  1056. ('enabled_text2audio','false','No'),
  1057. ('enabled_support_pixlr','true','Yes'),
  1058. ('enabled_support_pixlr','false','No'),
  1059. ('show_groups_to_users','true','Yes'),
  1060. ('show_groups_to_users','false','No'),
  1061. ('accessibility_font_resize', 'true', 'Yes'),
  1062. ('accessibility_font_resize', 'false', 'No'),
  1063. ('hide_courses_in_sessions','true','Yes'),
  1064. ('hide_courses_in_sessions','false','No'),
  1065. ('enable_quiz_scenario', 'true', 'Yes'),
  1066. ('enable_quiz_scenario', 'false', 'No'),
  1067. ('enable_nanogong','true','Yes'),
  1068. ('enable_nanogong','false','No'),
  1069. ('show_documents_preview', 'true', 'Yes'),
  1070. ('show_documents_preview', 'false', 'No'),
  1071. ('htmlpurifier_wiki', 'true', 'Yes'),
  1072. ('htmlpurifier_wiki', 'false', 'No'),
  1073. ('cas_activate', 'true', 'Yes'),
  1074. ('cas_activate', 'false', 'No'),
  1075. ('cas_protocol', 'CAS1', 'CAS1Text'),
  1076. ('cas_protocol', 'CAS2', 'CAS2Text'),
  1077. ('cas_protocol', 'SAML', 'SAMLText'),
  1078. ('cas_add_user_activate', 'false', 'No'),
  1079. ('cas_add_user_activate', 'platform', 'casAddUserActivatePlatform'),
  1080. ('cas_add_user_activate', 'extldap', 'casAddUserActivateLDAP'),
  1081. ('update_user_info_cas_with_ldap', 'true', 'Yes'),
  1082. ('update_user_info_cas_with_ldap', 'false', 'No'),
  1083. ('scorm_cumulative_session_time','true','Yes'),
  1084. ('scorm_cumulative_session_time','false','No'),
  1085. ('allow_hr_skills_management', 'true', 'Yes'),
  1086. ('allow_hr_skills_management', 'false', 'No'),
  1087. ('enable_help_link', 'true', 'Yes'),
  1088. ('enable_help_link', 'false', 'No'),
  1089. ('allow_users_to_change_email_with_no_password', 'true', 'Yes'),
  1090. ('allow_users_to_change_email_with_no_password', 'false', 'No'),
  1091. ('show_admin_toolbar', 'do_not_show', 'DoNotShow'),
  1092. ('show_admin_toolbar', 'show_to_admin', 'ShowToAdminsOnly'),
  1093. ('show_admin_toolbar', 'show_to_admin_and_teachers', 'ShowToAdminsAndTeachers'),
  1094. ('show_admin_toolbar', 'show_to_all', 'ShowToAllUsers'),
  1095. ('use_custom_pages','true','Yes'),
  1096. ('use_custom_pages','false','No'),
  1097. ('languagePriority1','platform_lang','PlatformLanguage'),
  1098. ('languagePriority1','user_profil_lang','UserLanguage'),
  1099. ('languagePriority1','user_selected_lang','UserSelectedLanguage'),
  1100. ('languagePriority1','course_lang','CourseLanguage'),
  1101. ('languagePriority2','platform_lang','PlatformLanguage'),
  1102. ('languagePriority2','user_profil_lang','UserLanguage'),
  1103. ('languagePriority2','user_selected_lang','UserSelectedLanguage'),
  1104. ('languagePriority2','course_lang','CourseLanguage'),
  1105. ('languagePriority3','platform_lang','PlatformLanguage'),
  1106. ('languagePriority3','user_profil_lang','UserLanguage'),
  1107. ('languagePriority3','user_selected_lang','UserSelectedLanguage'),
  1108. ('languagePriority3','course_lang','CourseLanguage'),
  1109. ('languagePriority4','platform_lang','PlatformLanguage'),
  1110. ('languagePriority4','user_profil_lang','UserLanguage'),
  1111. ('languagePriority4','user_selected_lang','UserSelectedLanguage'),
  1112. ('languagePriority4','course_lang','CourseLanguage'),
  1113. ('allow_global_chat', 'true', 'Yes'),
  1114. ('allow_global_chat', 'false', 'No'),
  1115. ('login_is_email','true','Yes'),
  1116. ('login_is_email','false','No'),
  1117. ('courses_default_creation_visibility', '3', 'OpenToTheWorld'),
  1118. ('courses_default_creation_visibility', '2', 'OpenToThePlatform'),
  1119. ('courses_default_creation_visibility', '1', 'Private'),
  1120. ('courses_default_creation_visibility', '0', 'CourseVisibilityClosed'),
  1121. ('allow_browser_sniffer', 'true', 'Yes'),
  1122. ('allow_browser_sniffer', 'false', 'No'),
  1123. ('enable_wami_record', 'true', 'Yes'),
  1124. ('enable_wami_record', 'false', 'No'),
  1125. ('teachers_can_change_score_settings', 'true', 'Yes'),
  1126. ('teachers_can_change_score_settings', 'false', 'No'),
  1127. ('teachers_can_change_grade_model_settings', 'true', 'Yes'),
  1128. ('teachers_can_change_grade_model_settings', 'false', 'No'),
  1129. ('gradebook_locking_enabled', 'true', 'Yes'),
  1130. ('gradebook_locking_enabled', 'false', 'No'),
  1131. ('gradebook_enable_grade_model', 'true', 'Yes'),
  1132. ('gradebook_enable_grade_model', 'false', 'No'),
  1133. ('allow_session_admins_to_manage_all_sessions', 'true', 'Yes'),
  1134. ('allow_session_admins_to_manage_all_sessions', 'false', 'No'),
  1135. ('allow_skills_tool', 'true', 'Yes'),
  1136. ('allow_skills_tool', 'false', 'No'),
  1137. ('allow_public_certificates', 'true', 'Yes'),
  1138. ('allow_public_certificates', 'false', 'No'),
  1139. ('platform_unsubscribe_allowed', 'true', 'Yes'),
  1140. ('platform_unsubscribe_allowed', 'false', 'No'),
  1141. ('activate_email_template', 'true', 'Yes'),
  1142. ('activate_email_template', 'false', 'No'),
  1143. ('enable_iframe_inclusion', 'true', 'Yes'),
  1144. ('enable_iframe_inclusion', 'false', 'No'),
  1145. ('show_hot_courses', 'true', 'Yes'),
  1146. ('show_hot_courses', 'false', 'No'),
  1147. ('enable_webcam_clip', 'true', 'Yes'),
  1148. ('enable_webcam_clip', 'false', 'No'),
  1149. ('prevent_session_admins_to_manage_all_users', 'true', 'Yes'),
  1150. ('prevent_session_admins_to_manage_all_users', 'false', 'No'),
  1151. ('documents_default_visibility_defined_in_course', 'true', 'Yes'),
  1152. ('documents_default_visibility_defined_in_course', 'false', 'No'),
  1153. ('enabled_mathjax','true','Yes'),
  1154. ('enabled_mathjax','false','No');
  1155. UNLOCK TABLES;
  1156. /*!40000 ALTER TABLE settings_options ENABLE KEYS */;
  1157. --
  1158. -- Table structure for table sys_announcement
  1159. --
  1160. DROP TABLE IF EXISTS sys_announcement;
  1161. CREATE TABLE IF NOT EXISTS sys_announcement (
  1162. id int unsigned NOT NULL auto_increment,
  1163. date_start datetime NOT NULL default '0000-00-00 00:00:00',
  1164. date_end datetime NOT NULL default '0000-00-00 00:00:00',
  1165. visible_teacher tinyint NOT NULL default 0,
  1166. visible_student tinyint NOT NULL default 0,
  1167. visible_guest tinyint NOT NULL default 0,
  1168. title varchar(250) NOT NULL default '',
  1169. content text NOT NULL,
  1170. lang varchar(70) NULL default NULL,
  1171. access_url_id INT NOT NULL default 1,
  1172. PRIMARY KEY (id)
  1173. );
  1174. --
  1175. -- Table structure for shared_survey
  1176. --
  1177. DROP TABLE IF EXISTS shared_survey;
  1178. CREATE TABLE IF NOT EXISTS shared_survey (
  1179. survey_id int unsigned NOT NULL auto_increment,
  1180. code varchar(20) default NULL,
  1181. title text default NULL,
  1182. subtitle text default NULL,
  1183. author varchar(250) default NULL,
  1184. lang varchar(20) default NULL,
  1185. template varchar(20) default NULL,
  1186. intro text,
  1187. surveythanks text,
  1188. creation_date datetime NOT NULL default '0000-00-00 00:00:00',
  1189. course_code varchar(40) NOT NULL default '',
  1190. PRIMARY KEY (survey_id),
  1191. UNIQUE KEY id (survey_id)
  1192. );
  1193. -- --------------------------------------------------------
  1194. --
  1195. -- Table structure for shared_survey_question
  1196. --
  1197. DROP TABLE IF EXISTS shared_survey_question;
  1198. CREATE TABLE IF NOT EXISTS shared_survey_question (
  1199. question_id int NOT NULL auto_increment,
  1200. survey_id int NOT NULL default '0',
  1201. survey_question text NOT NULL,
  1202. survey_question_comment text NOT NULL,
  1203. type varchar(250) NOT NULL default '',
  1204. display varchar(10) NOT NULL default '',
  1205. sort int NOT NULL default '0',
  1206. code varchar(40) NOT NULL default '',
  1207. max_value int NOT NULL,
  1208. PRIMARY KEY (question_id)
  1209. );
  1210. -- --------------------------------------------------------
  1211. --
  1212. -- Table structure for shared_survey_question_option
  1213. --
  1214. DROP TABLE IF EXISTS shared_survey_question_option;
  1215. CREATE TABLE IF NOT EXISTS shared_survey_question_option (
  1216. question_option_id int NOT NULL auto_increment,
  1217. question_id int NOT NULL default '0',
  1218. survey_id int NOT NULL default '0',
  1219. option_text text NOT NULL,
  1220. sort int NOT NULL default '0',
  1221. PRIMARY KEY (question_option_id)
  1222. );
  1223. -- --------------------------------------------------------
  1224. --
  1225. -- Table structure for templates (User's FCKEditor templates)
  1226. --
  1227. DROP TABLE IF EXISTS templates;
  1228. CREATE TABLE IF NOT EXISTS templates (
  1229. id int NOT NULL auto_increment,
  1230. title varchar(100) NOT NULL,
  1231. description varchar(250) NOT NULL,
  1232. course_code varchar(40) NOT NULL,
  1233. user_id int NOT NULL,
  1234. ref_doc int NOT NULL,
  1235. image varchar(250) NOT NULL,
  1236. PRIMARY KEY (id)
  1237. );
  1238. --
  1239. -- --------------------------------------------------------
  1240. --
  1241. -- Table structure of openid_association (keep info on openid servers)
  1242. --
  1243. DROP TABLE IF EXISTS openid_association;
  1244. CREATE TABLE IF NOT EXISTS openid_association (
  1245. id int NOT NULL auto_increment,
  1246. idp_endpoint_uri text NOT NULL,
  1247. session_type varchar(30) NOT NULL,
  1248. assoc_handle text NOT NULL,
  1249. assoc_type text NOT NULL,
  1250. expires_in bigint NOT NULL,
  1251. mac_key text NOT NULL,
  1252. created bigint NOT NULL,
  1253. PRIMARY KEY (id)
  1254. );
  1255. --
  1256. -- --------------------------------------------------------
  1257. --
  1258. -- Tables for gradebook
  1259. --
  1260. DROP TABLE IF EXISTS gradebook_category;
  1261. CREATE TABLE IF NOT EXISTS gradebook_category (
  1262. id int NOT NULL auto_increment,
  1263. name text NOT NULL,
  1264. description text,
  1265. user_id int NOT NULL,
  1266. course_code varchar(40) default NULL,
  1267. parent_id int default NULL,
  1268. weight float NOT NULL,
  1269. visible tinyint NOT NULL,
  1270. certif_min_score int DEFAULT NULL,
  1271. session_id int DEFAULT NULL,
  1272. document_id int unsigned DEFAULT NULL,
  1273. locked int NOT NULL DEFAULT 0,
  1274. default_lowest_eval_exclude TINYINT default null,
  1275. generate_certificates TINYINT NOT NULL DEFAULT 0,
  1276. PRIMARY KEY (id)
  1277. );
  1278. DROP TABLE IF EXISTS gradebook_evaluation;
  1279. CREATE TABLE IF NOT EXISTS gradebook_evaluation (
  1280. id int unsigned NOT NULL auto_increment,
  1281. name text NOT NULL,
  1282. description text,
  1283. user_id int NOT NULL,
  1284. course_code varchar(40) default NULL,
  1285. category_id int default NULL,
  1286. created_at DATETIME NOT NULL default '0000-00-00 00:00:00',
  1287. weight FLOAT NOT NULL,
  1288. max float unsigned NOT NULL,
  1289. visible int NOT NULL,
  1290. type varchar(40) NOT NULL default 'evaluation',
  1291. locked int NOT NULL DEFAULT 0,
  1292. PRIMARY KEY (id)
  1293. );
  1294. DROP TABLE IF EXISTS gradebook_link;
  1295. CREATE TABLE IF NOT EXISTS gradebook_link (
  1296. id int NOT NULL auto_increment,
  1297. type int NOT NULL,
  1298. ref_id int NOT NULL,
  1299. user_id int NOT NULL,
  1300. course_code varchar(40) NOT NULL,
  1301. category_id int NOT NULL,
  1302. created_at DATETIME NOT NULL default '0000-00-00 00:00:00',
  1303. weight float NOT NULL,
  1304. visible int NOT NULL,
  1305. locked int NOT NULL DEFAULT 0,
  1306. PRIMARY KEY (id)
  1307. );
  1308. DROP TABLE IF EXISTS gradebook_result;
  1309. CREATE TABLE IF NOT EXISTS gradebook_result (
  1310. id int NOT NULL auto_increment,
  1311. user_id int NOT NULL,
  1312. evaluation_id int NOT NULL,
  1313. created_at DATETIME NOT NULL default '0000-00-00 00:00:00',
  1314. score float unsigned default NULL,
  1315. PRIMARY KEY (id)
  1316. );
  1317. DROP TABLE IF EXISTS gradebook_score_display;
  1318. CREATE TABLE IF NOT EXISTS gradebook_score_display (
  1319. id int NOT NULL auto_increment,
  1320. score float unsigned NOT NULL,
  1321. display varchar(40) NOT NULL,
  1322. category_id int NOT NULL default 0,
  1323. score_color_percent float unsigned NOT NULL default 0,
  1324. PRIMARY KEY (id)
  1325. );
  1326. ALTER TABLE gradebook_score_display ADD INDEX(category_id);
  1327. DROP TABLE IF EXISTS user_field;
  1328. CREATE TABLE IF NOT EXISTS user_field (
  1329. id INT NOT NULL auto_increment,
  1330. field_type int NOT NULL DEFAULT 1,
  1331. field_variable varchar(64) NOT NULL,
  1332. field_display_text varchar(64),
  1333. field_default_value text,
  1334. field_order int,
  1335. field_visible tinyint default 0,
  1336. field_changeable tinyint default 0,
  1337. field_filter tinyint default 0,
  1338. tms DATETIME NOT NULL default '0000-00-00 00:00:00',
  1339. PRIMARY KEY(id)
  1340. );
  1341. DROP TABLE IF EXISTS user_field_options;
  1342. CREATE TABLE IF NOT EXISTS user_field_options (
  1343. id int NOT NULL auto_increment,
  1344. field_id int NOT NULL,
  1345. option_value text,
  1346. option_display_text varchar(64),
  1347. option_order int,
  1348. tms DATETIME NOT NULL default '0000-00-00 00:00:00',
  1349. PRIMARY KEY (id)
  1350. );
  1351. DROP TABLE IF EXISTS user_field_values;
  1352. CREATE TABLE IF NOT EXISTS user_field_values(
  1353. id bigint NOT NULL auto_increment,
  1354. user_id int unsigned NOT NULL,
  1355. field_id int NOT NULL,
  1356. field_value text,
  1357. tms DATETIME NOT NULL default '0000-00-00 00:00:00',
  1358. PRIMARY KEY(id)
  1359. );
  1360. ALTER TABLE user_field_values ADD INDEX (user_id, field_id);
  1361. INSERT INTO user_field (field_type, field_variable, field_display_text, field_visible, field_changeable) VALUES (1, 'legal_accept','Legal',0,0);
  1362. INSERT INTO user_field (field_type, field_variable, field_display_text, field_visible, field_changeable) VALUES (1, 'already_logged_in','Already logged in',0,0);
  1363. INSERT INTO user_field (field_type, field_variable, field_display_text, field_visible, field_changeable) VALUES (1, 'update_type','Update script type',0,0);
  1364. INSERT INTO user_field (field_type, field_variable, field_display_text, field_visible, field_changeable) VALUES (10, 'tags','tags',0,0);
  1365. INSERT INTO user_field (field_type, field_variable, field_display_text, field_visible, field_changeable) VALUES (1, 'rssfeeds','RSS',0,0);
  1366. INSERT INTO user_field (field_type, field_variable, field_display_text, field_visible, field_changeable) VALUES (1, 'dashboard', 'Dashboard', 0, 0);
  1367. INSERT INTO user_field (field_type, field_variable, field_display_text, field_visible, field_changeable) VALUES (11, 'timezone', 'Timezone', 0, 0);
  1368. INSERT INTO user_field (field_type, field_variable, field_display_text, field_visible, field_changeable, field_default_value) values (4, 'mail_notify_invitation', 'MailNotifyInvitation',1,1,'1');
  1369. INSERT INTO user_field (field_type, field_variable, field_display_text, field_visible, field_changeable, field_default_value) values (4, 'mail_notify_message', 'MailNotifyMessage',1,1,'1');
  1370. INSERT INTO user_field (field_type, field_variable, field_display_text, field_visible, field_changeable, field_default_value) values (4, 'mail_notify_group_message','MailNotifyGroupMessage',1,1,'1');
  1371. INSERT INTO user_field (field_type, field_variable, field_display_text, field_visible, field_changeable) VALUES (1, 'user_chat_status','User chat status',0,0);
  1372. INSERT INTO user_field (field_type, field_variable, field_display_text, field_visible, field_changeable) VALUES (1, 'google_calendar_url','Google Calendar URL',0,0);
  1373. INSERT INTO user_field_options (field_id, option_value, option_display_text, option_order) values (8, '1', 'AtOnce',1);
  1374. INSERT INTO user_field_options (field_id, option_value, option_display_text, option_order) values (8, '8', 'Daily',2);
  1375. INSERT INTO user_field_options (field_id, option_value, option_display_text, option_order) values (8, '0', 'No',3);
  1376. INSERT INTO user_field_options (field_id, option_value, option_display_text, option_order) values (9, '1', 'AtOnce',1);
  1377. INSERT INTO user_field_options (field_id, option_value, option_display_text, option_order) values (9, '8', 'Daily',2);
  1378. INSERT INTO user_field_options (field_id, option_value, option_display_text, option_order) values (9, '0', 'No',3);
  1379. INSERT INTO user_field_options (field_id, option_value, option_display_text, option_order) values (10, '1', 'AtOnce',1);
  1380. INSERT INTO user_field_options (field_id, option_value, option_display_text, option_order) values (10, '8', 'Daily',2);
  1381. INSERT INTO user_field_options (field_id, option_value, option_display_text, option_order) values (10, '0', 'No',3);
  1382. DROP TABLE IF EXISTS gradebook_result_log;
  1383. CREATE TABLE IF NOT EXISTS gradebook_result_log (
  1384. id int NOT NULL auto_increment,
  1385. id_result int NOT NULL,
  1386. user_id int NOT NULL,
  1387. evaluation_id int NOT NULL,
  1388. created_at DATETIME NOT NULL default '0000-00-00 00:00:00',
  1389. score float unsigned default NULL,
  1390. PRIMARY KEY(id)
  1391. );
  1392. DROP TABLE IF EXISTS gradebook_linkeval_log;
  1393. CREATE TABLE IF NOT EXISTS gradebook_linkeval_log (
  1394. id int NOT NULL auto_increment,
  1395. id_linkeval_log int NOT NULL,
  1396. name text,
  1397. description text,
  1398. created_at DATETIME NOT NULL default '0000-00-00 00:00:00',
  1399. weight smallint default NULL,
  1400. visible tinyint default NULL,
  1401. type varchar(20) NOT NULL,
  1402. user_id_log int NOT NULL,
  1403. PRIMARY KEY (id)
  1404. );
  1405. --
  1406. -- --------------------------------------------------------
  1407. --
  1408. -- Tables for the access URL feature
  1409. --
  1410. DROP TABLE IF EXISTS access_url;
  1411. CREATE TABLE IF NOT EXISTS access_url(
  1412. id int unsigned NOT NULL auto_increment,
  1413. url varchar(255) NOT NULL,
  1414. description text,
  1415. active int unsigned not null default 0,
  1416. created_by int not null,
  1417. tms DATETIME NOT NULL default '0000-00-00 00:00:00',
  1418. PRIMARY KEY (id)
  1419. );
  1420. INSERT INTO access_url(url, description, active, created_by) VALUES ('http://localhost/',' ',1,1);
  1421. DROP TABLE IF EXISTS access_url_rel_user;
  1422. CREATE TABLE IF NOT EXISTS access_url_rel_user (
  1423. access_url_id int unsigned NOT NULL,
  1424. user_id int unsigned NOT NULL,
  1425. PRIMARY KEY (access_url_id, user_id)
  1426. );
  1427. ALTER TABLE access_url_rel_user ADD INDEX idx_access_url_rel_user_user (user_id);
  1428. ALTER TABLE access_url_rel_user ADD INDEX idx_access_url_rel_user_access_url(access_url_id);
  1429. ALTER TABLE access_url_rel_user ADD INDEX idx_access_url_rel_user_access_url_user (user_id,access_url_id);
  1430. -- Adding admin to the first portal
  1431. INSERT INTO access_url_rel_user VALUES(1, 1);
  1432. DROP TABLE IF EXISTS access_url_rel_course;
  1433. CREATE TABLE IF NOT EXISTS access_url_rel_course (
  1434. access_url_id int unsigned NOT NULL,
  1435. course_code char(40) NOT NULL,
  1436. PRIMARY KEY (access_url_id, course_code)
  1437. );
  1438. DROP TABLE IF EXISTS access_url_rel_session;
  1439. CREATE TABLE IF NOT EXISTS access_url_rel_session (
  1440. access_url_id int unsigned NOT NULL,
  1441. session_id int unsigned NOT NULL,
  1442. PRIMARY KEY (access_url_id, session_id)
  1443. );
  1444. --
  1445. -- Table structure for table sys_calendar
  1446. --
  1447. DROP TABLE IF EXISTS sys_calendar;
  1448. CREATE TABLE IF NOT EXISTS sys_calendar (
  1449. id int unsigned NOT NULL auto_increment,
  1450. title varchar(255) NOT NULL,
  1451. content text,
  1452. start_date datetime NOT NULL default '0000-00-00 00:00:00',
  1453. end_date datetime NOT NULL default '0000-00-00 00:00:00',
  1454. access_url_id INT NOT NULL default 1,
  1455. all_day INT NOT NULL DEFAULT 0,
  1456. PRIMARY KEY (id)
  1457. );
  1458. DROP TABLE IF EXISTS system_template;
  1459. CREATE TABLE IF NOT EXISTS system_template (
  1460. id int UNSIGNED NOT NULL auto_increment,
  1461. title varchar(250) NOT NULL,
  1462. comment text NOT NULL,
  1463. image varchar(250) NOT NULL,
  1464. content text NOT NULL,
  1465. PRIMARY KEY (id)
  1466. );
  1467. -- Adding the platform templates
  1468. INSERT INTO system_template (title, comment, image, content) VALUES
  1469. ('TemplateTitleCourseTitle', 'TemplateTitleCourseTitleDescription', 'coursetitle.gif', '
  1470. <head>
  1471. {CSS}
  1472. <style type="text/css">
  1473. .gris_title {
  1474. color: silver;
  1475. }
  1476. h1
  1477. {
  1478. text-align: right;
  1479. }
  1480. </style>
  1481. </head>
  1482. <body>
  1483. <table style="background: transparent url({IMG_DIR}faded_blue_horizontal.png) repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; text-align: left; width: 720px; height: 400px;" border="0" cellpadding="15" cellspacing="6">
  1484. <tbody>
  1485. <tr>
  1486. <td style="vertical-align: middle; width: 50%;" colspan="1" rowspan="1">
  1487. <h1>TITULUS 1<br>
  1488. <span class="gris_title">TITULUS 2</span><br>
  1489. </h1>
  1490. </td>
  1491. <td style="width: 50%;">
  1492. <img style="width: 100px; height: 100px;" alt="Chamilo logo" src="{COURSE_DIR}images/logo_chamilo.png"></td>
  1493. </tr>
  1494. </tbody>
  1495. </table>
  1496. <p><br>
  1497. <br>
  1498. </p>
  1499. </body>
  1500. ');
  1501. /*
  1502. INSERT INTO system_template (title, comment, image, content) VALUES
  1503. ('TemplateTitleCheckList', 'TemplateTitleCheckListDescription', 'checklist.gif', '
  1504. <head>
  1505. {CSS}
  1506. </head>
  1507. <body>
  1508. <table style="background: transparent url({IMG_DIR}faded_blue_horizontal.png) repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; text-align: left; width: 720px; height: 400px;" border="0" cellpadding="15" cellspacing="6">
  1509. <tbody>
  1510. <tr>
  1511. <td style="vertical-align: top; width: 66%;">
  1512. <h3>Lorem ipsum dolor sit amet</h3>
  1513. <ul>
  1514. <li>consectetur adipisicing elit</li>
  1515. <li>sed do eiusmod tempor incididunt</li>
  1516. <li>ut labore et dolore magna aliqua</li>
  1517. </ul>
  1518. <h3>Ut enim ad minim veniam</h3>
  1519. <ul>
  1520. <li>quis nostrud exercitation ullamco</li>
  1521. <li>laboris nisi ut aliquip ex ea commodo consequat</li>
  1522. <li>Excepteur sint occaecat cupidatat non proident</li>
  1523. </ul>
  1524. <h3>Sed ut perspiciatis unde omnis</h3>
  1525. <ul>
  1526. <li>iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam</li>
  1527. <li>eaque ipsa quae ab illo inventore veritatis</li>
  1528. <li>et quasi architecto beatae vitae dicta sunt explicabo.&nbsp;</li>
  1529. </ul>
  1530. </td>
  1531. <td style="background: transparent url({IMG_DIR}postit.png ) repeat scroll center top; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; width: 33%; text-align: center; vertical-align: bottom;">
  1532. <h3>Ut enim ad minima</h3>
  1533. Veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur.<br>
  1534. <h3>
  1535. <img style="width: 180px; height: 144px;" alt="trainer" src="{COURSE_DIR}images/trainer/trainer_smile.png "><br></h3>
  1536. </td>
  1537. </tr>
  1538. </tbody>
  1539. </table>
  1540. <p><br>
  1541. <br>
  1542. </p>
  1543. </body>
  1544. ');
  1545. */
  1546. INSERT INTO system_template (title, comment, image, content) VALUES
  1547. ('TemplateTitleTeacher', 'TemplateTitleTeacherDescription', 'yourinstructor.gif', '
  1548. <head>
  1549. {CSS}
  1550. <style type="text/css">
  1551. .text
  1552. {
  1553. font-weight: normal;
  1554. }
  1555. </style>
  1556. </head>
  1557. <body>
  1558. <table style="background: transparent url({IMG_DIR}faded_blue_horizontal.png ) repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; text-align: left; width: 720px; height: 400px;" border="0" cellpadding="15" cellspacing="6">
  1559. <tbody>
  1560. <tr>
  1561. <td></td>
  1562. <td style="height: 33%;"></td>
  1563. <td></td>
  1564. </tr>
  1565. <tr>
  1566. <td style="width: 25%;"></td>
  1567. <td style="background: transparent url({IMG_DIR}faded_grey.png ) repeat scroll center top; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; vertical-align: top; width: 33%; text-align: right; font-weight: bold;" colspan="1" rowspan="1">
  1568. <span class="text">
  1569. <br>
  1570. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Duis pellentesque.</span>
  1571. </td>
  1572. <td style="width: 25%; font-weight: bold;">
  1573. <img style="width: 180px; height: 241px;" alt="trainer" src="{COURSE_DIR}images/trainer/trainer_case.png "></td>
  1574. </tr>
  1575. </tbody>
  1576. </table>
  1577. <p><br>
  1578. <br>
  1579. </p>
  1580. </body>
  1581. ');
  1582. INSERT INTO system_template (title, comment, image, content) VALUES
  1583. ('TemplateTitleLeftList', 'TemplateTitleListLeftListDescription', 'leftlist.gif', '
  1584. <head>
  1585. {CSS}
  1586. </head>
  1587. <body>
  1588. <table style="background: transparent url({IMG_DIR}faded_blue_horizontal.png ) repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; text-align: left; width: 720px; height: 400px;" border="0" cellpadding="15" cellspacing="6">
  1589. <tbody>
  1590. <tr>
  1591. <td style="width: 66%;"></td>
  1592. <td style="vertical-align: bottom; width: 33%;" colspan="1" rowspan="4">&nbsp;<img style="width: 180px; height: 248px;" alt="trainer" src="{COURSE_DIR}images/trainer/trainer_reads.png "><br>
  1593. </td>
  1594. </tr>
  1595. <tr align="right">
  1596. <td style="background: transparent url({IMG_DIR}faded_grey.png ) repeat scroll center top; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; vertical-align: top; width: 66%;">Lorem
  1597. ipsum dolor sit amet.
  1598. </td>
  1599. </tr>
  1600. <tr align="right">
  1601. <td style="background: transparent url({IMG_DIR}faded_grey.png ) repeat scroll center top; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; vertical-align: top; width: 66%;">
  1602. Vivamus
  1603. a quam.&nbsp;<br>
  1604. </td>
  1605. </tr>
  1606. <tr align="right">
  1607. <td style="background: transparent url({IMG_DIR}faded_grey.png ) repeat scroll center top; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; vertical-align: top; width: 66%;">
  1608. Proin
  1609. a est stibulum ante ipsum.</td>
  1610. </tr>
  1611. </tbody>
  1612. </table>
  1613. <p><br>
  1614. <br>
  1615. </p>
  1616. </body>
  1617. ');
  1618. INSERT INTO system_template (title, comment, image, content) VALUES
  1619. ('TemplateTitleLeftRightList', 'TemplateTitleLeftRightListDescription', 'leftrightlist.gif', '
  1620. <head>
  1621. {CSS}
  1622. </head>
  1623. <body>
  1624. <table style="background: transparent url({IMG_DIR}faded_blue_horizontal.png ) repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; text-align: left; height: 400px; width: 720px;" border="0" cellpadding="15" cellspacing="6">
  1625. <tbody>
  1626. <tr>
  1627. <td></td>
  1628. <td style="vertical-align: top;" colspan="1" rowspan="4">&nbsp;<img style="width: 180px; height: 294px;" alt="Trainer" src="{COURSE_DIR}images/trainer/trainer_join_hands.png "><br>
  1629. </td>
  1630. <td></td>
  1631. </tr>
  1632. <tr>
  1633. <td style="background: transparent url({IMG_DIR}faded_grey.png ) repeat scroll center top; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; vertical-align: top; width: 33%; text-align: right;">Lorem
  1634. ipsum dolor sit amet.
  1635. </td>
  1636. <td style="background: transparent url({IMG_DIR}faded_grey.png ) repeat scroll center top; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; vertical-align: top; width: 33%; text-align: left;">
  1637. Convallis
  1638. ut.&nbsp;Cras dui magna.</td>
  1639. </tr>
  1640. <tr>
  1641. <td style="background: transparent url({IMG_DIR}faded_grey.png ) repeat scroll center top; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; vertical-align: top; width: 33%; text-align: right;">
  1642. Vivamus
  1643. a quam.&nbsp;<br>
  1644. </td>
  1645. <td style="background: transparent url({IMG_DIR}faded_grey.png ) repeat scroll center top; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; vertical-align: top; width: 33%; text-align: left;">
  1646. Etiam
  1647. lacinia stibulum ante.<br>
  1648. </td>
  1649. </tr>
  1650. <tr>
  1651. <td style="background: transparent url({IMG_DIR}faded_grey.png ) repeat scroll center top; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; vertical-align: top; width: 33%; text-align: right;">
  1652. Proin
  1653. a est stibulum ante ipsum.</td>
  1654. <td style="background: transparent url({IMG_DIR}faded_grey.png ) repeat scroll center top; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; vertical-align: top; width: 33%; text-align: left;">
  1655. Consectetuer
  1656. adipiscing elit. <br>
  1657. </td>
  1658. </tr>
  1659. </tbody>
  1660. </table>
  1661. <p><br>
  1662. <br>
  1663. </p>
  1664. </body>
  1665. ');
  1666. INSERT INTO system_template (title, comment, image, content) VALUES
  1667. ('TemplateTitleRightList', 'TemplateTitleRightListDescription', 'rightlist.gif', '
  1668. <head>
  1669. {CSS}
  1670. </head>
  1671. <body style="direction: ltr;">
  1672. <table style="background: transparent url({IMG_DIR}faded_blue_horizontal.png ) repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; text-align: left; width: 720px; height: 400px;" border="0" cellpadding="15" cellspacing="6">
  1673. <tbody>
  1674. <tr>
  1675. <td style="vertical-align: bottom; width: 50%;" colspan="1" rowspan="4"><img style="width: 300px; height: 199px;" alt="trainer" src="{COURSE_DIR}images/trainer/trainer_points_right.png"><br>
  1676. </td>
  1677. <td style="width: 50%;"></td>
  1678. </tr>
  1679. <tr>
  1680. <td style="background: transparent url({IMG_DIR}faded_grey.png ) repeat scroll center top; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; vertical-align: top; text-align: left; width: 50%;">
  1681. Convallis
  1682. ut.&nbsp;Cras dui magna.</td>
  1683. </tr>
  1684. <tr>
  1685. <td style="background: transparent url({IMG_DIR}faded_grey.png ) repeat scroll center top; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; vertical-align: top; text-align: left; width: 50%;">
  1686. Etiam
  1687. lacinia.<br>
  1688. </td>
  1689. </tr>
  1690. <tr>
  1691. <td style="background: transparent url({IMG_DIR}faded_grey.png ) repeat scroll center top; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; vertical-align: top; text-align: left; width: 50%;">
  1692. Consectetuer
  1693. adipiscing elit. <br>
  1694. </td>
  1695. </tr>
  1696. </tbody>
  1697. </table>
  1698. <p><br>
  1699. <br>
  1700. </p>
  1701. </body>
  1702. ');
  1703. /*
  1704. INSERT INTO system_template (title, comment, image, content) VALUES
  1705. ('TemplateTitleComparison', 'TemplateTitleComparisonDescription', 'compare.gif', '
  1706. <head>
  1707. {CSS}
  1708. </head>
  1709. <body>
  1710. <table style="background: transparent url({IMG_DIR}faded_blue_horizontal.png ) repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; text-align: left; width: 720px; height: 400px;" border="0" cellpadding="15" cellspacing="6">
  1711. <tr>
  1712. <td style="height: 10%; width: 33%;"></td>
  1713. <td style="vertical-align: top; width: 33%;" colspan="1" rowspan="2">&nbsp;<img style="width: 180px; height: 271px;" alt="trainer" src="{COURSE_DIR}images/trainer/trainer_standing.png "><br>
  1714. </td>
  1715. <td style="height: 10%; width: 33%;"></td>
  1716. </tr>
  1717. <tr>
  1718. <td style="background: transparent url({IMG_DIR}faded_grey.png ) repeat scroll center top; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; vertical-align: top; width: 33%; text-align: right;">
  1719. Lorem ipsum dolor sit amet.
  1720. </td>
  1721. <td style="background: transparent url({IMG_DIR}faded_grey.png ) repeat scroll center top; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; vertical-align: top; text-align: left; width: 33%;">
  1722. Convallis
  1723. ut.&nbsp;Cras dui magna.</td>
  1724. </tr>
  1725. </body>
  1726. ');
  1727. */
  1728. INSERT INTO system_template (title, comment, image, content) VALUES
  1729. ('TemplateTitleDiagram', 'TemplateTitleDiagramDescription', 'diagram.gif', '
  1730. <head>
  1731. {CSS}
  1732. </head>
  1733. <body>
  1734. <table style="background: transparent url({IMG_DIR}faded_blue_horizontal.png ) repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; text-align: left; width: 720px; height: 400px;" border="0" cellpadding="15" cellspacing="6">
  1735. <tbody>
  1736. <tr>
  1737. <td style="background: transparent url({IMG_DIR}faded_grey.png ) repeat scroll center top; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; vertical-align: top; text-align: left; height: 33%; width: 33%;">
  1738. <br>
  1739. Etiam
  1740. lacinia stibulum ante.
  1741. Convallis
  1742. ut.&nbsp;Cras dui magna.</td>
  1743. <td colspan="1" rowspan="3">
  1744. <img style="width: 350px; height: 267px;" alt="Alaska chart" src="{COURSE_DIR}images/diagrams/alaska_chart.png "></td>
  1745. </tr>
  1746. <tr>
  1747. <td colspan="1" rowspan="1">
  1748. <img style="width: 300px; height: 199px;" alt="trainer" src="{COURSE_DIR}images/trainer/trainer_points_right.png "></td>
  1749. </tr>
  1750. <tr>
  1751. </tr>
  1752. </tbody>
  1753. </table>
  1754. <p><br>
  1755. <br>
  1756. </p>
  1757. </body>
  1758. ');
  1759. INSERT INTO system_template (title, comment, image, content) VALUES
  1760. ('TemplateTitleDesc', 'TemplateTitleCheckListDescription', 'description.gif', '
  1761. <head>
  1762. {CSS}
  1763. </head>
  1764. <body>
  1765. <table style="background: transparent url({IMG_DIR}faded_blue_horizontal.png ) repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; text-align: left; width: 720px; height: 400px;" border="0" cellpadding="15" cellspacing="6">
  1766. <tbody>
  1767. <tr>
  1768. <td style="width: 50%; vertical-align: top;">
  1769. <img style="width: 48px; height: 49px; float: left;" alt="01" src="{COURSE_DIR}images/small/01.png " hspace="5"><br>Lorem ipsum dolor sit amet<br><br><br>
  1770. <img style="width: 48px; height: 49px; float: left;" alt="02" src="{COURSE_DIR}images/small/02.png " hspace="5">
  1771. <br>Ut enim ad minim veniam<br><br><br>
  1772. <img style="width: 48px; height: 49px; float: left;" alt="03" src="{COURSE_DIR}images/small/03.png " hspace="5">Duis aute irure dolor in reprehenderit<br><br><br>
  1773. <img style="width: 48px; height: 49px; float: left;" alt="04" src="{COURSE_DIR}images/small/04.png " hspace="5">Neque porro quisquam est</td>
  1774. <td style="vertical-align: top; width: 50%; text-align: right;" colspan="1" rowspan="1">
  1775. <img style="width: 300px; height: 291px;" alt="Gearbox" src="{COURSE_DIR}images/diagrams/gearbox.jpg "><br></td>
  1776. </tr><tr></tr>
  1777. </tbody>
  1778. </table>
  1779. <p><br>
  1780. <br>
  1781. </p>
  1782. </body>
  1783. ');
  1784. /*
  1785. INSERT INTO system_template (title, comment, image, content) VALUES
  1786. ('TemplateTitleObjectives', 'TemplateTitleObjectivesDescription', 'courseobjectives.gif', '
  1787. <head>
  1788. {CSS}
  1789. </head>
  1790. <body>
  1791. <table style="background: transparent url({IMG_DIR}faded_blue_horizontal.png ) repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; text-align: left; width: 720px; height: 400px;" border="0" cellpadding="15" cellspacing="6">
  1792. <tbody>
  1793. <tr>
  1794. <td style="vertical-align: bottom; width: 33%;" colspan="1" rowspan="2">
  1795. <img style="width: 180px; height: 271px;" alt="trainer" src="{COURSE_DIR}images/trainer/trainer_chair.png "><br>
  1796. </td>
  1797. <td style="height: 10%; width: 66%;"></td>
  1798. </tr>
  1799. <tr>
  1800. <td style="background: transparent url({IMG_DIR}faded_grey.png ) repeat scroll center top; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; vertical-align: top; text-align: left; width: 66%;">
  1801. <h3>Lorem ipsum dolor sit amet</h3>
  1802. <ul>
  1803. <li>consectetur adipisicing elit</li>
  1804. <li>sed do eiusmod tempor incididunt</li>
  1805. <li>ut labore et dolore magna aliqua</li>
  1806. </ul>
  1807. <h3>Ut enim ad minim veniam</h3>
  1808. <ul>
  1809. <li>quis nostrud exercitation ullamco</li>
  1810. <li>laboris nisi ut aliquip ex ea commodo consequat</li>
  1811. <li>Excepteur sint occaecat cupidatat non proident</li>
  1812. </ul>
  1813. </td>
  1814. </tr>
  1815. </tbody>
  1816. </table>
  1817. <p><br>
  1818. <br>
  1819. </p>
  1820. </body>
  1821. ');
  1822. */
  1823. INSERT INTO system_template (title, comment, image, content) VALUES
  1824. ('TemplateTitleCycle', 'TemplateTitleCycleDescription', 'cyclechart.gif', '
  1825. <head>
  1826. {CSS}
  1827. <style>
  1828. .title
  1829. {
  1830. color: white; font-weight: bold;
  1831. }
  1832. </style>
  1833. </head>
  1834. <body>
  1835. <table style="background: transparent url({IMG_DIR}faded_blue_horizontal.png ) repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; text-align: left; width: 720px; height: 400px;" border="0" cellpadding="8" cellspacing="6">
  1836. <tbody>
  1837. <tr>
  1838. <td style="text-align: center; vertical-align: bottom; height: 10%;" colspan="3" rowspan="1">
  1839. <img style="width: 250px; height: 76px;" alt="arrow" src="{COURSE_DIR}images/diagrams/top_arrow.png ">
  1840. </td>
  1841. </tr>
  1842. <tr>
  1843. <td style="height: 5%; width: 45%; vertical-align: top; background-color: rgb(153, 153, 153); text-align: center;">
  1844. <span class="title">Lorem ipsum</span>
  1845. </td>
  1846. <td style="height: 5%; width: 10%;"></td>
  1847. <td style="height: 5%; vertical-align: top; background-color: rgb(153, 153, 153); text-align: center;">
  1848. <span class="title">Sed ut perspiciatis</span>
  1849. </td>
  1850. </tr>
  1851. <tr>
  1852. <td style="background-color: rgb(204, 204, 255); width: 45%; vertical-align: top;">
  1853. <ul>
  1854. <li>dolor sit amet</li>
  1855. <li>consectetur adipisicing elit</li>
  1856. <li>sed do eiusmod tempor&nbsp;</li>
  1857. <li>adipisci velit, sed quia non numquam</li>
  1858. <li>eius modi tempora incidunt ut labore et dolore magnam</li>
  1859. </ul>
  1860. </td>
  1861. <td style="width: 10%;"></td>
  1862. <td style="background-color: rgb(204, 204, 255); width: 45%; vertical-align: top;">
  1863. <ul>
  1864. <li>ut enim ad minim veniam</li>
  1865. <li>quis nostrud exercitation</li><li>ullamco laboris nisi ut</li>
  1866. <li> Quis autem vel eum iure reprehenderit qui in ea</li>
  1867. <li>voluptate velit esse quam nihil molestiae consequatur,</li>
  1868. </ul>
  1869. </td>
  1870. </tr>
  1871. <tr align="center">
  1872. <td style="height: 10%; vertical-align: top;" colspan="3" rowspan="1">
  1873. <img style="width: 250px; height: 76px;" alt="arrow" src="{COURSE_DIR}images/diagrams/bottom_arrow.png ">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;
  1874. </td>
  1875. </tr>
  1876. </tbody>
  1877. </table>
  1878. <p><br>
  1879. <br>
  1880. </p>
  1881. </body>
  1882. ');
  1883. /*
  1884. INSERT INTO system_template (title, comment, image, content) VALUES
  1885. ('TemplateTitleLearnerWonder', 'TemplateTitleLearnerWonderDescription', 'learnerwonder.gif', '
  1886. <head>
  1887. {CSS}
  1888. </head>
  1889. <body>
  1890. <table style="background: transparent url({IMG_DIR}faded_blue_horizontal.png ) repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; text-align: left; width: 720px; height: 400px;" border="0" cellpadding="15" cellspacing="6">
  1891. <tbody>
  1892. <tr>
  1893. <td style="width: 33%;" colspan="1" rowspan="4">
  1894. <img style="width: 120px; height: 348px;" alt="learner wonders" src="{COURSE_DIR}images/silhouette.png "><br>
  1895. </td>
  1896. <td style="width: 66%;"></td>
  1897. </tr>
  1898. <tr align="center">
  1899. <td style="background: transparent url({IMG_DIR}faded_grey.png ) repeat scroll center top; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; vertical-align: top; width: 66%;">
  1900. Convallis
  1901. ut.&nbsp;Cras dui magna.</td>
  1902. </tr>
  1903. <tr align="center">
  1904. <td style="background: transparent url({IMG_DIR}faded_grey.png ) repeat scroll center top; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; vertical-align: top; width: 66%;">
  1905. Etiam
  1906. lacinia stibulum ante.<br>
  1907. </td>
  1908. </tr>
  1909. <tr align="center">
  1910. <td style="background: transparent url({IMG_DIR}faded_grey.png ) repeat scroll center top; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; vertical-align: top; width: 66%;">
  1911. Consectetuer
  1912. adipiscing elit. <br>
  1913. </td>
  1914. </tr>
  1915. </tbody>
  1916. </table>
  1917. <p><br>
  1918. <br>
  1919. </p>
  1920. </body>
  1921. ');
  1922. */
  1923. INSERT INTO system_template (title, comment, image, content) VALUES
  1924. ('TemplateTitleTimeline', 'TemplateTitleTimelineDescription', 'phasetimeline.gif', '
  1925. <head>
  1926. {CSS}
  1927. <style>
  1928. .title
  1929. {
  1930. font-weight: bold; text-align: center;
  1931. }
  1932. </style>
  1933. </head>
  1934. <body>
  1935. <table style="background: transparent url({IMG_DIR}faded_blue_horizontal.png ) repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; text-align: left; width: 720px; height: 400px;" border="0" cellpadding="8" cellspacing="5">
  1936. <tbody>
  1937. <tr class="title">
  1938. <td style="vertical-align: top; height: 3%; background-color: rgb(224, 224, 224);">Lorem ipsum</td>
  1939. <td style="height: 3%;"></td>
  1940. <td style="vertical-align: top; height: 3%; background-color: rgb(237, 237, 237);">Perspiciatis</td>
  1941. <td style="height: 3%;"></td>
  1942. <td style="vertical-align: top; height: 3%; background-color: rgb(245, 245, 245);">Nemo enim</td>
  1943. </tr>
  1944. <tr>
  1945. <td style="vertical-align: top; width: 30%; background-color: rgb(224, 224, 224);">
  1946. <ul>
  1947. <li>dolor sit amet</li>
  1948. <li>consectetur</li>
  1949. <li>adipisicing elit</li>
  1950. </ul>
  1951. <br>
  1952. </td>
  1953. <td>
  1954. <img style="width: 32px; height: 32px;" alt="arrow" src="{COURSE_DIR}images/small/arrow.png ">
  1955. </td>
  1956. <td style="vertical-align: top; width: 30%; background-color: rgb(237, 237, 237);">
  1957. <ul>
  1958. <li>ut labore</li>
  1959. <li>et dolore</li>
  1960. <li>magni dolores</li>
  1961. </ul>
  1962. </td>
  1963. <td>
  1964. <img style="width: 32px; height: 32px;" alt="arrow" src="{COURSE_DIR}images/small/arrow.png ">
  1965. </td>
  1966. <td style="vertical-align: top; background-color: rgb(245, 245, 245); width: 30%;">
  1967. <ul>
  1968. <li>neque porro</li>
  1969. <li>quisquam est</li>
  1970. <li>qui dolorem&nbsp;&nbsp;</li>
  1971. </ul>
  1972. <br><br>
  1973. </td>
  1974. </tr>
  1975. </tbody>
  1976. </table>
  1977. <p><br>
  1978. <br>
  1979. </p>
  1980. </body>
  1981. ');
  1982. /*
  1983. INSERT INTO system_template (title, comment, image, content) VALUES
  1984. ('TemplateTitleStopAndThink', 'TemplateTitleStopAndThinkDescription', 'stopthink.gif', '
  1985. <head>
  1986. {CSS}
  1987. </head>
  1988. <body>
  1989. <table style="background: transparent url({IMG_DIR}faded_blue_horizontal.png ) repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; text-align: left; width: 720px; height: 400px;" border="0" cellpadding="15" cellspacing="6">
  1990. <tbody>
  1991. <tr>
  1992. <td style="vertical-align: bottom; width: 33%;" colspan="1" rowspan="2">
  1993. <img style="width: 180px; height: 169px;" alt="trainer" src="{COURSE_DIR}images/trainer/trainer_staring.png ">
  1994. <br>
  1995. </td>
  1996. <td style="height: 10%; width: 66%;"></td>
  1997. </tr>
  1998. <tr>
  1999. <td style="background: transparent url({IMG_DIR}postit.png ) repeat scroll center top; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; width: 66%; vertical-align: middle; text-align: center;">
  2000. <h3>Attentio sectetur adipisicing elit</h3>
  2001. <ul>
  2002. <li>sed do eiusmod tempor incididunt</li>
  2003. <li>ut labore et dolore magna aliqua</li>
  2004. <li>quis nostrud exercitation ullamco</li>
  2005. </ul><br></td>
  2006. </tr>
  2007. </tbody>
  2008. </table>
  2009. <p><br>
  2010. <br>
  2011. </p>
  2012. </body>
  2013. ');
  2014. */
  2015. INSERT INTO system_template (title, comment, image, content) VALUES
  2016. ('TemplateTitleTable', 'TemplateTitleCheckListDescription', 'table.gif', '
  2017. <head>
  2018. {CSS}
  2019. <style type="text/css">
  2020. .title
  2021. {
  2022. font-weight: bold; text-align: center;
  2023. }
  2024. .items
  2025. {
  2026. text-align: right;
  2027. }
  2028. </style>
  2029. </head>
  2030. <body>
  2031. <br />
  2032. <h2>A table</h2>
  2033. <table style="background: transparent url({IMG_DIR}faded_blue_horizontal.png ) repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; text-align: left; width: 720px;" border="1" cellpadding="5" cellspacing="0">
  2034. <tbody>
  2035. <tr class="title">
  2036. <td>City</td>
  2037. <td>2005</td>
  2038. <td>2006</td>
  2039. <td>2007</td>
  2040. <td>2008</td>
  2041. </tr>
  2042. <tr class="items">
  2043. <td>Lima</td>
  2044. <td>10,40</td>
  2045. <td>8,95</td>
  2046. <td>9,19</td>
  2047. <td>9,76</td>
  2048. </tr>
  2049. <tr class="items">
  2050. <td>New York</td>
  2051. <td>18,39</td>
  2052. <td>17,52</td>
  2053. <td>16,57</td>
  2054. <td>16,60</td>
  2055. </tr>
  2056. <tr class="items">
  2057. <td>Barcelona</td>
  2058. <td>0,10</td>
  2059. <td>0,10</td>
  2060. <td>0,05</td>
  2061. <td>0,05</td>
  2062. </tr>
  2063. <tr class="items">
  2064. <td>Paris</td>
  2065. <td>3,38</td>
  2066. <td >3,63</td>
  2067. <td>3,63</td>
  2068. <td>3,54</td>
  2069. </tr>
  2070. </tbody>
  2071. </table>
  2072. <br>
  2073. </body>
  2074. ');
  2075. INSERT INTO system_template (title, comment, image, content) VALUES
  2076. ('TemplateTitleAudio', 'TemplateTitleAudioDescription', 'audiocomment.gif', '
  2077. <head>
  2078. {CSS}
  2079. </head>
  2080. <body>
  2081. <table style="background: transparent url({IMG_DIR}faded_blue_horizontal.png ) repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; text-align: left; width: 720px; height: 400px;" border="0" cellpadding="15" cellspacing="6">
  2082. <tbody>
  2083. <tr>
  2084. <td>
  2085. <div align="center">
  2086. <span style="text-align: center;">
  2087. <embed type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" width="300" height="20" bgcolor="#FFFFFF" src="{REL_PATH}main/inc/lib/mediaplayer/player.swf" allowfullscreen="false" allowscriptaccess="always" flashvars="file={COURSE_DIR}audio/ListeningComprehension.mp3&amp;autostart=true"></embed>
  2088. </span></div>
  2089. <br>
  2090. </td>
  2091. <td colspan="1" rowspan="3"><br>
  2092. <img style="width: 300px; height: 341px; float: right;" alt="image" src="{COURSE_DIR}images/diagrams/head_olfactory_nerve.png "><br></td>
  2093. </tr>
  2094. <tr>
  2095. <td colspan="1" rowspan="1">
  2096. <img style="width: 180px; height: 271px;" alt="trainer" src="{COURSE_DIR}images/trainer/trainer_glasses.png"><br></td>
  2097. </tr>
  2098. <tr>
  2099. </tr>
  2100. </tbody>
  2101. </table>
  2102. <p><br>
  2103. <br>
  2104. </p>
  2105. </body>
  2106. ');
  2107. INSERT INTO system_template (title, comment, image, content) VALUES
  2108. ('TemplateTitleVideo', 'TemplateTitleVideoDescription', 'video.gif', '
  2109. <head>
  2110. {CSS}
  2111. </head>
  2112. <body>
  2113. <table style="background: transparent url({IMG_DIR}faded_blue_horizontal.png ) repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; text-align: left; width: 720px; height: 400px;" border="0" cellpadding="15" cellspacing="6">
  2114. <tbody>
  2115. <tr>
  2116. <td style="width: 50%; vertical-align: top;">
  2117. <div style="text-align: center;" id="player810625-parent">
  2118. <div style="border-style: none; overflow: hidden; width: 320px; height: 240px; background-color: rgb(220, 220, 220);">
  2119. <div id="player810625">
  2120. <div id="player810625-config" style="overflow: hidden; display: none; visibility: hidden; width: 0px; height: 0px;">url={REL_PATH}main/default_course_document/video/flv/example.flv width=320 height=240 loop=false play=false downloadable=false fullscreen=true displayNavigation=true displayDigits=true align=left dispPlaylist=none playlistThumbs=false</div>
  2121. </div>
  2122. <embed
  2123. type="application/x-shockwave-flash"
  2124. src="{REL_PATH}main/inc/lib/mediaplayer/player.swf"
  2125. width="320"
  2126. height="240"
  2127. id="single"
  2128. name="single"
  2129. quality="high"
  2130. allowfullscreen="true"
  2131. flashvars="width=320&height=240&autostart=false&file={REL_PATH}main/default_course_document/video/flv/example.flv&repeat=false&image=&showdownload=false&link={REL_PATH}main/default_course_document/video/flv/example.flv&showdigits=true&shownavigation=true&logo="
  2132. />
  2133. </div>
  2134. </div>
  2135. </td>
  2136. <td style="background: transparent url({IMG_DIR}faded_grey.png) repeat scroll center top; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; vertical-align: top; width: 50%;">
  2137. <h3><br>
  2138. </h3>
  2139. <h3>Lorem ipsum dolor sit amet</h3>
  2140. <ul>
  2141. <li>consectetur adipisicing elit</li>
  2142. <li>sed do eiusmod tempor incididunt</li>
  2143. <li>ut labore et dolore magna aliqua</li>
  2144. </ul>
  2145. <h3>Ut enim ad minim veniam</h3>
  2146. <ul>
  2147. <li>quis nostrud exercitation ullamco</li>
  2148. <li>laboris nisi ut aliquip ex ea commodo consequat</li>
  2149. <li>Excepteur sint occaecat cupidatat non proident</li>
  2150. </ul>
  2151. </td>
  2152. </tr>
  2153. </tbody>
  2154. </table>
  2155. <p><br>
  2156. <br>
  2157. </p>
  2158. <style type="text/css">body{}</style><!-- to fix a strange bug appearing with firefox when editing this template -->
  2159. </body>
  2160. ');
  2161. INSERT INTO system_template (title, comment, image, content) VALUES
  2162. ('TemplateTitleFlash', 'TemplateTitleFlashDescription', 'flash.gif', '
  2163. <head>
  2164. {CSS}
  2165. </head>
  2166. <body>
  2167. <center>
  2168. <table style="background: transparent url({IMG_DIR}faded_blue_horizontal.png ) repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; text-align: left; width: 100%; height: 400px;" border="0" cellpadding="15" cellspacing="6">
  2169. <tbody>
  2170. <tr>
  2171. <td align="center">
  2172. <embed width="700" height="300" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" src="{COURSE_DIR}flash/SpinEchoSequence.swf" play="true" loop="true" menu="true"></embed></span><br />
  2173. </td>
  2174. </tr>
  2175. </tbody>
  2176. </table>
  2177. <p><br>
  2178. <br>
  2179. </p>
  2180. </center>
  2181. </body>
  2182. ');
  2183. --
  2184. -- Table structure for table user_rel_user
  2185. --
  2186. DROP TABLE IF EXISTS user_rel_user;
  2187. CREATE TABLE IF NOT EXISTS user_rel_user (
  2188. id bigint unsigned not null auto_increment,
  2189. user_id int unsigned not null,
  2190. friend_user_id int unsigned not null,
  2191. relation_type int not null default 0,
  2192. last_edit DATETIME,
  2193. PRIMARY KEY(id)
  2194. );
  2195. ALTER TABLE user_rel_user ADD INDEX idx_user_rel_user__user (user_id);
  2196. ALTER TABLE user_rel_user ADD INDEX idx_user_rel_user__friend_user(friend_user_id);
  2197. ALTER TABLE user_rel_user ADD INDEX idx_user_rel_user__user_friend_user(user_id,friend_user_id);
  2198. --
  2199. -- Table structure for table user_friend_relation_type
  2200. --
  2201. DROP TABLE IF EXISTS user_friend_relation_type;
  2202. CREATE TABLE IF NOT EXISTS user_friend_relation_type(
  2203. id int unsigned not null auto_increment,
  2204. title char(20),
  2205. PRIMARY KEY(id)
  2206. );
  2207. --
  2208. -- Table structure for MD5 API keys for users
  2209. --
  2210. DROP TABLE IF EXISTS user_api_key;
  2211. CREATE TABLE IF NOT EXISTS user_api_key (
  2212. id int unsigned NOT NULL auto_increment,
  2213. user_id int unsigned NOT NULL,
  2214. api_key char(32) NOT NULL,
  2215. api_service char(10) NOT NULL default 'dokeos',
  2216. api_end_point text DEFAULT NULL,
  2217. created_date datetime DEFAULT NULL,
  2218. validity_start_date datetime DEFAULT NULL,
  2219. validity_end_date datetime DEFAULT NULL,
  2220. description text DEFAULT NULL,
  2221. PRIMARY KEY (id)
  2222. );
  2223. ALTER TABLE user_api_key ADD INDEX idx_user_api_keys_user (user_id);
  2224. --
  2225. -- Table structure for table message
  2226. --
  2227. DROP TABLE IF EXISTS message;
  2228. CREATE TABLE IF NOT EXISTS message(
  2229. id bigint unsigned not null auto_increment,
  2230. user_sender_id int unsigned not null,
  2231. user_receiver_id int unsigned not null,
  2232. msg_status tinyint unsigned not null default 0, -- 0 read, 1 unread, 3 deleted, 5 pending invitation, 6 accepted invitation, 7 invitation denied
  2233. send_date datetime not null default '0000-00-00 00:00:00',
  2234. title varchar(255) not null,
  2235. content text not null,
  2236. group_id int unsigned not null default 0,
  2237. parent_id int unsigned not null default 0,
  2238. update_date datetime not null default '0000-00-00 00:00:00',
  2239. PRIMARY KEY(id)
  2240. );
  2241. ALTER TABLE message ADD INDEX idx_message_user_sender(user_sender_id);
  2242. ALTER TABLE message ADD INDEX idx_message_user_receiver(user_receiver_id);
  2243. ALTER TABLE message ADD INDEX idx_message_user_sender_user_receiver(user_sender_id,user_receiver_id);
  2244. ALTER TABLE message ADD INDEX idx_message_group(group_id);
  2245. ALTER TABLE message ADD INDEX idx_message_parent(parent_id);
  2246. INSERT INTO user_friend_relation_type (id,title)
  2247. VALUES
  2248. (1,'SocialUnknow'),
  2249. (2,'SocialParent'),
  2250. (3,'SocialFriend'),
  2251. (4,'SocialGoodFriend'),
  2252. (5,'SocialEnemy'),
  2253. (6,'SocialDeleted');
  2254. --
  2255. -- Table structure for table legal (Terms & Conditions)
  2256. --
  2257. DROP TABLE IF EXISTS legal;
  2258. CREATE TABLE IF NOT EXISTS legal (
  2259. legal_id int NOT NULL auto_increment,
  2260. language_id int NOT NULL,
  2261. date int NOT NULL default 0,
  2262. content text,
  2263. type int NOT NULL,
  2264. changes text NOT NULL,
  2265. version int,
  2266. PRIMARY KEY (legal_id,language_id)
  2267. );
  2268. --
  2269. -- Table structure for certificate with gradebook
  2270. --
  2271. DROP TABLE IF EXISTS gradebook_certificate;
  2272. CREATE TABLE IF NOT EXISTS gradebook_certificate (
  2273. id bigint unsigned not null auto_increment,
  2274. cat_id int unsigned not null,
  2275. user_id int unsigned not null,
  2276. score_certificate float unsigned not null default 0,
  2277. created_at DATETIME NOT NULL default '0000-00-00 00:00:00',
  2278. path_certificate text null,
  2279. PRIMARY KEY(id)
  2280. );
  2281. ALTER TABLE gradebook_certificate ADD INDEX idx_gradebook_certificate_category_id(cat_id);
  2282. ALTER TABLE gradebook_certificate ADD INDEX idx_gradebook_certificate_user_id(user_id);
  2283. ALTER TABLE gradebook_certificate ADD INDEX idx_gradebook_certificate_category_id_user_id(cat_id,user_id);
  2284. --
  2285. -- Tables structure for search tool
  2286. --
  2287. -- specific fields tables
  2288. DROP TABLE IF EXISTS specific_field;
  2289. CREATE TABLE IF NOT EXISTS specific_field (
  2290. id INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
  2291. code char(1) NOT NULL,
  2292. name VARCHAR(200) NOT NULL
  2293. );
  2294. DROP TABLE IF EXISTS specific_field_values;
  2295. CREATE TABLE IF NOT EXISTS specific_field_values (
  2296. id INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
  2297. course_code VARCHAR(40) NOT NULL ,
  2298. tool_id VARCHAR(100) NOT NULL ,
  2299. ref_id INT NOT NULL ,
  2300. field_id INT NOT NULL ,
  2301. value VARCHAR(200) NOT NULL
  2302. );
  2303. ALTER TABLE specific_field ADD CONSTRAINT unique_specific_field__code UNIQUE (code);
  2304. -- search engine references to map dokeos resources
  2305. DROP TABLE IF EXISTS search_engine_ref;
  2306. CREATE TABLE IF NOT EXISTS search_engine_ref (
  2307. id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
  2308. course_code VARCHAR( 40 ) NOT NULL,
  2309. tool_id VARCHAR( 100 ) NOT NULL,
  2310. ref_id_high_level INT NOT NULL,
  2311. ref_id_second_level INT NULL,
  2312. search_did INT NOT NULL
  2313. );
  2314. --
  2315. -- Table structure for table sessions categories
  2316. --
  2317. DROP TABLE IF EXISTS session_category;
  2318. CREATE TABLE IF NOT EXISTS session_category (
  2319. id int NOT NULL auto_increment,
  2320. name varchar(100) default NULL,
  2321. date_start date default NULL,
  2322. date_end date default NULL,
  2323. access_url_id INT NOT NULL default 1,
  2324. PRIMARY KEY (id)
  2325. );
  2326. --
  2327. -- Table structure for table user tag
  2328. --
  2329. DROP TABLE IF EXISTS tag;
  2330. CREATE TABLE IF NOT EXISTS tag (
  2331. id int NOT NULL auto_increment,
  2332. tag char(255) NOT NULL,
  2333. field_id int NOT NULL,
  2334. count int NOT NULL,
  2335. PRIMARY KEY (id)
  2336. );
  2337. DROP TABLE IF EXISTS user_rel_tag;
  2338. CREATE TABLE IF NOT EXISTS user_rel_tag (
  2339. id int NOT NULL auto_increment,
  2340. user_id int NOT NULL,
  2341. tag_id int NOT NULL,
  2342. PRIMARY KEY (id)
  2343. );
  2344. --
  2345. -- Table structure for user platform groups
  2346. --
  2347. DROP TABLE IF EXISTS groups;
  2348. CREATE TABLE IF NOT EXISTS groups (
  2349. id int NOT NULL AUTO_INCREMENT,
  2350. name varchar(255) NOT NULL,
  2351. description varchar(255) NOT NULL,
  2352. picture_uri varchar(255) NOT NULL,
  2353. url varchar(255) NOT NULL,
  2354. visibility int NOT NULL,
  2355. updated_on varchar(255) NOT NULL,
  2356. created_on varchar(255) NOT NULL,
  2357. PRIMARY KEY (id)
  2358. );
  2359. DROP TABLE IF EXISTS group_rel_tag;
  2360. CREATE TABLE IF NOT EXISTS group_rel_tag (
  2361. id int NOT NULL AUTO_INCREMENT,
  2362. tag_id int NOT NULL,
  2363. group_id int NOT NULL,
  2364. PRIMARY KEY (id)
  2365. );
  2366. ALTER TABLE group_rel_tag ADD INDEX ( group_id );
  2367. ALTER TABLE group_rel_tag ADD INDEX ( tag_id );
  2368. # DROP TABLE IF EXISTS group_rel_user;
  2369. # CREATE TABLE IF NOT EXISTS group_rel_user (
  2370. # id int NOT NULL AUTO_INCREMENT,
  2371. # group_id int NOT NULL,
  2372. # user_id int NOT NULL,
  2373. # relation_type int NOT NULL,
  2374. # PRIMARY KEY (id)
  2375. # );
  2376. # ALTER TABLE group_rel_user ADD INDEX ( group_id );
  2377. # ALTER TABLE group_rel_user ADD INDEX ( user_id );
  2378. # ALTER TABLE group_rel_user ADD INDEX ( relation_type );
  2379. #
  2380. # DROP TABLE IF EXISTS group_rel_group;
  2381. # CREATE TABLE IF NOT EXISTS group_rel_group (
  2382. # id int NOT NULL AUTO_INCREMENT,
  2383. # group_id int NOT NULL,
  2384. # subgroup_id int NOT NULL,
  2385. # relation_type int NOT NULL,
  2386. # PRIMARY KEY (id)
  2387. # );
  2388. # ALTER TABLE group_rel_group ADD INDEX ( group_id );
  2389. # ALTER TABLE group_rel_group ADD INDEX ( subgroup_id );
  2390. # ALTER TABLE group_rel_group ADD INDEX ( relation_type );
  2391. DROP TABLE IF EXISTS announcement_rel_group;
  2392. CREATE TABLE IF NOT EXISTS announcement_rel_group (
  2393. group_id int NOT NULL,
  2394. announcement_id int NOT NULL,
  2395. PRIMARY KEY (group_id, announcement_id)
  2396. );
  2397. --
  2398. -- Table structure for table message attachment
  2399. --
  2400. DROP TABLE IF EXISTS message_attachment;
  2401. CREATE TABLE IF NOT EXISTS message_attachment (
  2402. id int NOT NULL AUTO_INCREMENT,
  2403. path varchar(255) NOT NULL,
  2404. comment text,
  2405. size int NOT NULL default 0,
  2406. message_id int NOT NULL,
  2407. filename varchar(255) NOT NULL,
  2408. PRIMARY KEY (id)
  2409. );
  2410. INSERT INTO course_field (field_type, field_variable, field_display_text, field_default_value, field_visible, field_changeable) values (1, 'special_course', 'Special course', '', 1 , 1);
  2411. --
  2412. -- Table structure for table block
  2413. --
  2414. DROP TABLE IF EXISTS block;
  2415. CREATE TABLE IF NOT EXISTS block (
  2416. id INT NOT NULL AUTO_INCREMENT,
  2417. name VARCHAR(255) NULL,
  2418. description TEXT NULL,
  2419. path VARCHAR(255) NOT NULL,
  2420. controller VARCHAR(100) NOT NULL,
  2421. active TINYINT NOT NULL DEFAULT 1,
  2422. PRIMARY KEY(id)
  2423. );
  2424. ALTER TABLE block ADD UNIQUE(path);
  2425. --
  2426. -- Structure for table 'course_request' ("Course validation" feature)
  2427. --
  2428. DROP TABLE IF EXISTS course_request;
  2429. CREATE TABLE IF NOT EXISTS course_request (
  2430. id int NOT NULL AUTO_INCREMENT,
  2431. code varchar(40) NOT NULL,
  2432. user_id int unsigned NOT NULL default '0',
  2433. directory varchar(40) DEFAULT NULL,
  2434. db_name varchar(40) DEFAULT NULL,
  2435. course_language varchar(20) DEFAULT NULL,
  2436. title varchar(250) DEFAULT NULL,
  2437. description text,
  2438. category_code varchar(40) DEFAULT NULL,
  2439. tutor_name varchar(200) DEFAULT NULL,
  2440. visual_code varchar(40) DEFAULT NULL,
  2441. request_date datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  2442. objetives text,
  2443. target_audience text,
  2444. status int unsigned NOT NULL default '0',
  2445. info int unsigned NOT NULL default '0',
  2446. exemplary_content int unsigned NOT NULL default '0',
  2447. PRIMARY KEY (id),
  2448. UNIQUE KEY code (code)
  2449. );
  2450. --
  2451. -- Structure for Careers, Promotions and Usergroups
  2452. --
  2453. DROP TABLE IF EXISTS career;
  2454. CREATE TABLE IF NOT EXISTS career (
  2455. id INT NOT NULL AUTO_INCREMENT,
  2456. name VARCHAR(255) NOT NULL ,
  2457. description TEXT NOT NULL,
  2458. status INT NOT NULL default '0',
  2459. created_at datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  2460. updated_at datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  2461. PRIMARY KEY (id)
  2462. );
  2463. DROP TABLE IF EXISTS promotion;
  2464. CREATE TABLE IF NOT EXISTS promotion (
  2465. id INT NOT NULL AUTO_INCREMENT,
  2466. name VARCHAR(255) NOT NULL ,
  2467. description TEXT NOT NULL,
  2468. career_id INT NOT NULL,
  2469. status INT NOT NULL default '0',
  2470. created_at datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  2471. updated_at datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  2472. PRIMARY KEY(id)
  2473. );
  2474. DROP TABLE IF EXISTS usergroup;
  2475. CREATE TABLE IF NOT EXISTS usergroup (
  2476. id INT NOT NULL AUTO_INCREMENT,
  2477. name VARCHAR(255) NOT NULL,
  2478. description TEXT NOT NULL,
  2479. PRIMARY KEY (id)
  2480. );
  2481. DROP TABLE IF EXISTS usergroup_rel_user;
  2482. CREATE TABLE IF NOT EXISTS usergroup_rel_user (
  2483. id INT PRIMARY KEY NOT NULL AUTO_INCREMENT,
  2484. usergroup_id INT NOT NULL,
  2485. user_id INT NOT NULL
  2486. );
  2487. DROP TABLE IF EXISTS usergroup_rel_course;
  2488. CREATE TABLE IF NOT EXISTS usergroup_rel_course (
  2489. id INT PRIMARY KEY NOT NULL AUTO_INCREMENT,
  2490. usergroup_id INT NOT NULL,
  2491. course_id INT NOT NULL
  2492. );
  2493. DROP TABLE IF EXISTS usergroup_rel_session;
  2494. CREATE TABLE IF NOT EXISTS usergroup_rel_session (
  2495. id INT PRIMARY KEY NOT NULL AUTO_INCREMENT,
  2496. usergroup_id INT NOT NULL,
  2497. session_id INT NOT NULL
  2498. );
  2499. --
  2500. -- Structure for Mail notifications
  2501. --
  2502. DROP TABLE IF EXISTS notification;
  2503. CREATE TABLE IF NOT EXISTS notification (
  2504. id BIGINT PRIMARY KEY NOT NULL AUTO_INCREMENT,
  2505. dest_user_id INT NOT NULL,
  2506. dest_mail CHAR(255),
  2507. title CHAR(255),
  2508. content CHAR(255),
  2509. send_freq SMALLINT DEFAULT 1,
  2510. created_at DATETIME NOT NULL,
  2511. sent_at DATETIME NULL
  2512. );
  2513. ALTER TABLE notification ADD index mail_notify_sent_index (sent_at);
  2514. ALTER TABLE notification ADD index mail_notify_freq_index (sent_at, send_freq, created_at);
  2515. -- Skills management
  2516. DROP TABLE IF EXISTS skill;
  2517. CREATE TABLE IF NOT EXISTS skill (
  2518. id int NOT NULL AUTO_INCREMENT,
  2519. name varchar(255) NOT NULL,
  2520. short_code varchar(100) NOT NULL,
  2521. description TEXT NOT NULL,
  2522. access_url_id int NOT NULL,
  2523. icon varchar(255) NOT NULL,
  2524. criteria text DEFAULT '',
  2525. PRIMARY KEY (id)
  2526. );
  2527. INSERT INTO skill (name) VALUES ('Root');
  2528. DROP TABLE IF EXISTS skill_rel_gradebook;
  2529. CREATE TABLE IF NOT EXISTS skill_rel_gradebook (
  2530. id int NOT NULL AUTO_INCREMENT,
  2531. gradebook_id int NOT NULL,
  2532. skill_id int NOT NULL,
  2533. type varchar(10) NOT NULL,
  2534. PRIMARY KEY (id)
  2535. );
  2536. DROP TABLE IF EXISTS skill_rel_skill;
  2537. CREATE TABLE IF NOT EXISTS skill_rel_skill (
  2538. id int NOT NULL AUTO_INCREMENT,
  2539. skill_id int NOT NULL,
  2540. parent_id int NOT NULL,
  2541. relation_type int NOT NULL,
  2542. level int NOT NULL,
  2543. PRIMARY KEY (id)
  2544. );
  2545. INSERT INTO skill_rel_skill VALUES(1, 1, 0, 0, 0);
  2546. DROP TABLE IF EXISTS skill_rel_user;
  2547. CREATE TABLE IF NOT EXISTS skill_rel_user (
  2548. id int NOT NULL AUTO_INCREMENT,
  2549. user_id int NOT NULL,
  2550. skill_id int NOT NULL,
  2551. acquired_skill_at datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  2552. assigned_by int NOT NULL,
  2553. course_id INT NOT NULL DEFAULT 0,
  2554. session_id INT NOT NULL DEFAULT 0,
  2555. PRIMARY KEY (id)
  2556. );
  2557. ALTER TABLE skill_rel_user ADD INDEX idx_select_cs (course_id, session_id);
  2558. DROP TABLE IF EXISTS skill_profile;
  2559. CREATE TABLE IF NOT EXISTS skill_profile (
  2560. id INTEGER NOT NULL AUTO_INCREMENT,
  2561. name VARCHAR(255) NOT NULL,
  2562. description TEXT NOT NULL,
  2563. PRIMARY KEY (id)
  2564. );
  2565. DROP TABLE IF EXISTS skill_rel_profile;
  2566. CREATE TABLE IF NOT EXISTS skill_rel_profile (
  2567. id INTEGER NOT NULL AUTO_INCREMENT,
  2568. skill_id INTEGER NOT NULL,
  2569. profile_id INTEGER NOT NULL,
  2570. PRIMARY KEY (id)
  2571. );
  2572. --
  2573. -- Table structure for event email sending
  2574. --
  2575. DROP TABLE IF EXISTS event_email_template;
  2576. CREATE TABLE event_email_template (
  2577. id int NOT NULL AUTO_INCREMENT,
  2578. message text,
  2579. subject varchar(255) DEFAULT NULL,
  2580. event_type_name varchar(255) DEFAULT NULL,
  2581. activated tinyint NOT NULL DEFAULT '0',
  2582. language_id int DEFAULT NULL,
  2583. PRIMARY KEY (id)
  2584. );
  2585. ALTER TABLE event_email_template ADD INDEX event_name_index (event_type_name);
  2586. DROP TABLE IF EXISTS event_sent;
  2587. CREATE TABLE event_sent (
  2588. id int NOT NULL AUTO_INCREMENT,
  2589. user_from int NOT NULL,
  2590. user_to int DEFAULT NULL,
  2591. event_type_name varchar(100) DEFAULT NULL,
  2592. PRIMARY KEY (id)
  2593. );
  2594. ALTER TABLE event_sent ADD INDEX event_name_index (event_type_name);
  2595. DROP TABLE IF EXISTS user_rel_event_type;
  2596. CREATE TABLE user_rel_event_type (
  2597. id int NOT NULL AUTO_INCREMENT,
  2598. user_id int NOT NULL,
  2599. event_type_name varchar(255) NOT NULL,
  2600. PRIMARY KEY (id)
  2601. );
  2602. ALTER TABLE user_rel_event_type ADD INDEX event_name_index (event_type_name);
  2603. -- Course ranking
  2604. DROP TABLE IF EXISTS track_course_ranking;
  2605. CREATE TABLE IF NOT EXISTS track_course_ranking (
  2606. id int unsigned not null PRIMARY KEY AUTO_INCREMENT,
  2607. c_id int unsigned not null,
  2608. session_id int unsigned not null default 0,
  2609. url_id int unsigned not null default 0,
  2610. accesses int unsigned not null default 0,
  2611. total_score int unsigned not null default 0,
  2612. users int unsigned not null default 0,
  2613. creation_date datetime not null
  2614. );
  2615. ALTER TABLE track_course_ranking ADD INDEX idx_tcc_cid (c_id);
  2616. ALTER TABLE track_course_ranking ADD INDEX idx_tcc_sid (session_id);
  2617. ALTER TABLE track_course_ranking ADD INDEX idx_tcc_urlid (url_id);
  2618. ALTER TABLE track_course_ranking ADD INDEX idx_tcc_creation_date (creation_date);
  2619. DROP TABLE IF EXISTS user_rel_course_vote;
  2620. CREATE TABLE IF NOT EXISTS user_rel_course_vote (
  2621. id int unsigned not null AUTO_INCREMENT PRIMARY KEY,
  2622. c_id int unsigned not null,
  2623. user_id int unsigned not null,
  2624. session_id int unsigned not null default 0,
  2625. url_id int unsigned not null default 0,
  2626. vote int unsigned not null default 0
  2627. );
  2628. ALTER TABLE user_rel_course_vote ADD INDEX idx_ucv_cid (c_id);
  2629. ALTER TABLE user_rel_course_vote ADD INDEX idx_ucv_uid (user_id);
  2630. ALTER TABLE user_rel_course_vote ADD INDEX idx_ucv_cuid (user_id, c_id);
  2631. -- Global chat
  2632. DROP TABLE IF EXISTS chat;
  2633. CREATE TABLE IF NOT EXISTS chat (
  2634. id INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
  2635. from_user INTEGER,
  2636. to_user INTEGER,
  2637. message TEXT NOT NULL,
  2638. sent DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
  2639. recd INTEGER UNSIGNED NOT NULL DEFAULT 0,
  2640. PRIMARY KEY (id)
  2641. );
  2642. ALTER TABLE chat ADD INDEX idx_chat_to_user (to_user);
  2643. ALTER TABLE chat ADD INDEX idx_chat_from_user (from_user);
  2644. -- Grade Model
  2645. DROP TABLE IF EXISTS grade_model;
  2646. CREATE TABLE grade_model (
  2647. id INTEGER NOT NULL AUTO_INCREMENT,
  2648. name VARCHAR(255) NOT NULL,
  2649. description TEXT,
  2650. default_lowest_eval_exclude TINYINT default null,
  2651. default_external_eval TINYINT default null,
  2652. default_external_eval_prefix VARCHAR(140) default null,
  2653. PRIMARY KEY (id)
  2654. );
  2655. DROP TABLE IF EXISTS grade_components;
  2656. CREATE TABLE grade_components (
  2657. id INTEGER NOT NULL AUTO_INCREMENT,
  2658. percentage VARCHAR(255) NOT NULL,
  2659. title VARCHAR(255) NOT NULL,
  2660. acronym VARCHAR(255) NOT NULL,
  2661. grade_model_id INTEGER NOT NULL,
  2662. PRIMARY KEY (id)
  2663. );
  2664. ALTER TABLE gradebook_category ADD COLUMN grade_model_id INT DEFAULT 0;
  2665. DROP TABLE IF EXISTS course_type;
  2666. CREATE TABLE course_type (
  2667. id int unsigned not null auto_increment primary key,
  2668. name varchar(50) not null,
  2669. translation_var char(40) default 'UndefinedCourseTypeLabel',
  2670. description TEXT default '',
  2671. props text default ''
  2672. );
  2673. INSERT INTO course_type (id, name) VALUES (1, 'All tools');
  2674. INSERT INTO course_type (id, name) VALUES (2, 'Entry exam');
  2675. ALTER TABLE course add course_type_id int unsigned default 1;
  2676. DROP TABLE IF EXISTS usergroup_rel_question;
  2677. CREATE TABLE usergroup_rel_question (
  2678. id int unsigned not null auto_increment primary key,
  2679. c_id int unsigned not null,
  2680. question_id int unsigned not null,
  2681. usergroup_id int unsigned not null,
  2682. coefficient float(6,2)
  2683. );
  2684. -- 1.10.x-specific, non-course-related, database changes
  2685. -- some changes to previous structure might have been applied to the tables
  2686. -- creation statements above to increase efficiency
  2687. -- Hook tables
  2688. CREATE TABLE IF NOT EXISTS hook_observer(
  2689. id int UNSIGNED NOT NULL AUTO_INCREMENT,
  2690. class_name varchar(255) UNIQUE,
  2691. path varchar(255) NOT NULL,
  2692. plugin_name varchar(255) NULL,
  2693. PRIMARY KEY PK_hook_management_hook_observer(id)
  2694. );
  2695. CREATE TABLE IF NOT EXISTS hook_event(
  2696. id int UNSIGNED NOT NULL AUTO_INCREMENT,
  2697. class_name varchar(255) UNIQUE,
  2698. description varchar(255),
  2699. PRIMARY KEY PK_hook_management_hook_event(id)
  2700. );
  2701. CREATE TABLE IF NOT EXISTS hook_call(
  2702. id int UNSIGNED NOT NULL AUTO_INCREMENT,
  2703. hook_event_id int UNSIGNED NOT NULL,
  2704. hook_observer_id int UNSIGNED NOT NULL,
  2705. type tinyint NOT NULL,
  2706. hook_order int UNSIGNED NOT NULL,
  2707. enabled tinyint NOT NULL,
  2708. PRIMARY KEY PK_hook_management_hook_call(id)
  2709. );
  2710. --
  2711. -- Table structure for table course_field_options
  2712. --
  2713. CREATE TABLE course_field_options (
  2714. id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
  2715. field_id INT NOT NULL,
  2716. option_value TEXT,
  2717. option_display_text VARCHAR(64),
  2718. option_order INT,
  2719. tms DATETIME
  2720. );
  2721. --
  2722. -- Table structure for table session_field_options
  2723. --
  2724. CREATE TABLE session_field_options (
  2725. id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
  2726. field_id INT NOT NULL,
  2727. option_value TEXT,
  2728. option_display_text VARCHAR(64),
  2729. option_order INT,
  2730. tms DATETIME
  2731. );
  2732. DROP TABLE IF EXISTS personal_agenda;
  2733. CREATE TABLE personal_agenda (
  2734. id int NOT NULL auto_increment,
  2735. user int unsigned,
  2736. title text,
  2737. `text` text,
  2738. `date` datetime DEFAULT NULL,
  2739. enddate datetime DEFAULT NULL,
  2740. course varchar(255),
  2741. parent_event_id int NULL,
  2742. all_day int NOT NULL DEFAULT 0,
  2743. PRIMARY KEY id (id)
  2744. );
  2745. DROP TABLE IF EXISTS personal_agenda_repeat;
  2746. CREATE TABLE personal_agenda_repeat (
  2747. cal_id INT DEFAULT 0 NOT NULL,
  2748. cal_type VARCHAR(20),
  2749. cal_end INT,
  2750. cal_frequency INT DEFAULT 1,
  2751. cal_days CHAR(7),
  2752. PRIMARY KEY (cal_id)
  2753. );
  2754. DROP TABLE IF EXISTS personal_agenda_repeat_not;
  2755. CREATE TABLE personal_agenda_repeat_not (
  2756. cal_id INT NOT NULL,
  2757. cal_date INT NOT NULL,
  2758. PRIMARY KEY ( cal_id, cal_date )
  2759. );
  2760. DROP TABLE IF EXISTS user_course_category;
  2761. CREATE TABLE user_course_category (
  2762. id int unsigned NOT NULL auto_increment,
  2763. user_id int unsigned NOT NULL default 0,
  2764. title text NOT NULL,
  2765. sort int,
  2766. PRIMARY KEY (id)
  2767. );
  2768. ALTER TABLE personal_agenda ADD INDEX idx_personal_agenda_user (user);
  2769. ALTER TABLE personal_agenda ADD INDEX idx_personal_agenda_parent (parent_event_id);
  2770. ALTER TABLE user_course_category ADD INDEX idx_user_c_cat_uid (user_id);
  2771. DROP TABLE IF EXISTS track_c_browsers;
  2772. CREATE TABLE track_c_browsers (
  2773. id int NOT NULL auto_increment,
  2774. browser varchar(255) NOT NULL default '',
  2775. counter int NOT NULL default 0,
  2776. PRIMARY KEY (id)
  2777. );
  2778. DROP TABLE IF EXISTS track_c_countries;
  2779. CREATE TABLE track_c_countries (
  2780. id int NOT NULL auto_increment,
  2781. code varchar(40) NOT NULL default '',
  2782. country varchar(50) NOT NULL default '',
  2783. counter int NOT NULL default 0,
  2784. PRIMARY KEY (id)
  2785. );
  2786. DROP TABLE IF EXISTS track_c_os;
  2787. CREATE TABLE track_c_os (
  2788. id int NOT NULL auto_increment,
  2789. os varchar(255) NOT NULL default '',
  2790. counter int NOT NULL default 0,
  2791. PRIMARY KEY (id)
  2792. );
  2793. DROP TABLE IF EXISTS track_c_providers;
  2794. CREATE TABLE track_c_providers (
  2795. id int NOT NULL auto_increment,
  2796. provider varchar(255) NOT NULL default '',
  2797. counter int NOT NULL default 0,
  2798. PRIMARY KEY (id)
  2799. );
  2800. DROP TABLE IF EXISTS track_c_referers;
  2801. CREATE TABLE track_c_referers (
  2802. id int NOT NULL auto_increment,
  2803. referer varchar(255) NOT NULL default '',
  2804. counter int NOT NULL default 0,
  2805. PRIMARY KEY (id)
  2806. );
  2807. DROP TABLE IF EXISTS track_e_access;
  2808. CREATE TABLE track_e_access (
  2809. access_id int NOT NULL auto_increment,
  2810. access_user_id int unsigned default NULL,
  2811. access_date datetime NOT NULL,
  2812. c_id int not null,
  2813. access_tool varchar(30) default NULL,
  2814. access_session_id int NOT NULL default 0,
  2815. user_ip varchar(39) NOT NULL default '',
  2816. PRIMARY KEY (access_id),
  2817. KEY access_user_id (access_user_id),
  2818. KEY access_c_id (c_id)
  2819. );
  2820. DROP TABLE IF EXISTS track_e_lastaccess;
  2821. CREATE TABLE track_e_lastaccess (
  2822. access_id bigint NOT NULL auto_increment,
  2823. access_user_id int unsigned default NULL,
  2824. access_date datetime NOT NULL,
  2825. c_id int not null,
  2826. access_tool varchar(30) default NULL,
  2827. access_session_id int unsigned default NULL,
  2828. PRIMARY KEY (access_id),
  2829. KEY access_user_id (access_user_id),
  2830. KEY access_c_id (c_id),
  2831. KEY access_session_id (access_session_id)
  2832. );
  2833. DROP TABLE IF EXISTS track_e_default;
  2834. CREATE TABLE track_e_default (
  2835. default_id int NOT NULL auto_increment,
  2836. default_user_id int unsigned NOT NULL default 0,
  2837. c_id int default NULL,
  2838. default_date datetime NOT NULL,
  2839. default_event_type varchar(20) NOT NULL default '',
  2840. default_value_type varchar(20) NOT NULL default '',
  2841. default_value text NOT NULL,
  2842. session_id INT DEFAULT NULL,
  2843. PRIMARY KEY (default_id)
  2844. );
  2845. DROP TABLE IF EXISTS track_e_downloads;
  2846. CREATE TABLE track_e_downloads (
  2847. down_id int NOT NULL auto_increment,
  2848. down_user_id int unsigned default NULL,
  2849. down_date datetime NOT NULL,
  2850. c_id int NOT NULL,
  2851. down_doc_path varchar(255) NOT NULL default '',
  2852. down_session_id INT NOT NULL DEFAULT 0,
  2853. PRIMARY KEY (down_id),
  2854. KEY idx_ted_user_id (down_user_id),
  2855. KEY idx_ted_c_id (c_id)
  2856. );
  2857. DROP TABLE IF EXISTS track_e_exercises;
  2858. CREATE TABLE track_e_exercises (
  2859. exe_id int NOT NULL auto_increment,
  2860. exe_user_id int unsigned default NULL,
  2861. exe_date datetime NOT NULL default '0000-00-00 00:00:00',
  2862. c_id int NOT NULL,
  2863. exe_exo_id mediumint unsigned NOT NULL default 0,
  2864. exe_result float(6,2) NOT NULL default 0,
  2865. exe_weighting float(6,2) NOT NULL default 0,
  2866. user_ip varchar(39) NOT NULL default '',
  2867. PRIMARY KEY (exe_id),
  2868. KEY idx_tee_user_id (exe_user_id),
  2869. KEY idx_tee_c_id (c_id)
  2870. );
  2871. ALTER TABLE track_e_exercises ADD status varchar(20) NOT NULL default '';
  2872. ALTER TABLE track_e_exercises ADD data_tracking text NOT NULL default '';
  2873. ALTER TABLE track_e_exercises ADD start_date datetime NOT NULL default '0000-00-00 00:00:00';
  2874. ALTER TABLE track_e_exercises ADD steps_counter SMALLINT UNSIGNED NOT NULL default 0;
  2875. ALTER TABLE track_e_exercises ADD session_id SMALLINT UNSIGNED NOT NULL default 0;
  2876. ALTER TABLE track_e_exercises ADD INDEX ( session_id ) ;
  2877. ALTER TABLE track_e_exercises ADD orig_lp_id int NOT NULL default 0;
  2878. ALTER TABLE track_e_exercises ADD orig_lp_item_id int NOT NULL default 0;
  2879. ALTER TABLE track_e_exercises ADD exe_duration int UNSIGNED NOT NULL default 0;
  2880. ALTER TABLE track_e_exercises ADD COLUMN expired_time_control datetime NOT NULL DEFAULT '0000-00-00 00:00:00';
  2881. ALTER TABLE track_e_exercises ADD COLUMN orig_lp_item_view_id INT NOT NULL DEFAULT 0;
  2882. ALTER TABLE track_e_exercises ADD COLUMN questions_to_check TEXT NOT NULL DEFAULT '';
  2883. DROP TABLE IF EXISTS track_e_attempt;
  2884. CREATE TABLE track_e_attempt (
  2885. id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
  2886. exe_id int default NULL,
  2887. user_id int NOT NULL default 0,
  2888. question_id int NOT NULL default 0,
  2889. answer text NOT NULL,
  2890. teacher_comment text NOT NULL,
  2891. marks float(6,2) NOT NULL default 0,
  2892. course_code varchar(40) NOT NULL default '',
  2893. c_id int NOT NULL,
  2894. position int default 0,
  2895. tms datetime NOT NULL default '0000-00-00 00:00:00',
  2896. session_id INT NOT NULL DEFAULT 0,
  2897. filename VARCHAR(255) DEFAULT NULL
  2898. );
  2899. ALTER TABLE track_e_attempt ADD INDEX (exe_id);
  2900. ALTER TABLE track_e_attempt ADD INDEX (user_id);
  2901. ALTER TABLE track_e_attempt ADD INDEX (question_id);
  2902. ALTER TABLE track_e_attempt ADD INDEX (session_id);
  2903. DROP TABLE IF EXISTS track_e_attempt_recording;
  2904. CREATE TABLE track_e_attempt_recording (
  2905. id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
  2906. exe_id int unsigned NOT NULL,
  2907. question_id int unsigned NOT NULL,
  2908. marks int NOT NULL,
  2909. insert_date datetime NOT NULL default '0000-00-00 00:00:00',
  2910. author int unsigned NOT NULL,
  2911. teacher_comment text NOT NULL,
  2912. session_id INT NOT NULL DEFAULT 0
  2913. );
  2914. ALTER TABLE track_e_attempt_recording ADD INDEX (exe_id);
  2915. ALTER TABLE track_e_attempt_recording ADD INDEX (question_id);
  2916. ALTER TABLE track_e_attempt_recording ADD INDEX (session_id);
  2917. DROP TABLE IF EXISTS track_e_hotpotatoes;
  2918. CREATE TABLE track_e_hotpotatoes (
  2919. id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
  2920. exe_name VARCHAR( 255 ) NOT NULL ,
  2921. exe_user_id int unsigned DEFAULT NULL ,
  2922. exe_date DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL ,
  2923. c_id int NOT NULL,
  2924. exe_result smallint default 0 NOT NULL ,
  2925. exe_weighting smallint default 0 NOT NULL,
  2926. KEY idx_tehp_user_id (exe_user_id),
  2927. KEY idx_tehp_c_id (c_id)
  2928. );
  2929. DROP TABLE IF EXISTS track_e_links;
  2930. CREATE TABLE track_e_links (
  2931. links_id int NOT NULL auto_increment,
  2932. links_user_id int unsigned default NULL,
  2933. links_date datetime NOT NULL default '0000-00-00 00:00:00',
  2934. c_id int NOT NULL,
  2935. links_link_id int NOT NULL default 0,
  2936. links_session_id INT NOT NULL DEFAULT 0,
  2937. PRIMARY KEY (links_id),
  2938. KEY idx_tel_c_id (c_id),
  2939. KEY idx_tel_user_id (links_user_id)
  2940. );
  2941. DROP TABLE IF EXISTS track_e_login;
  2942. CREATE TABLE track_e_login (
  2943. login_id int NOT NULL auto_increment,
  2944. login_user_id int unsigned NOT NULL default 0,
  2945. login_date datetime NOT NULL default '0000-00-00 00:00:00',
  2946. user_ip varchar(39) NOT NULL default '',
  2947. logout_date datetime NULL default NULL,
  2948. PRIMARY KEY (login_id),
  2949. KEY login_user_id (login_user_id)
  2950. );
  2951. DROP TABLE IF EXISTS track_e_online;
  2952. CREATE TABLE track_e_online (
  2953. login_id int NOT NULL auto_increment,
  2954. login_user_id int unsigned NOT NULL default 0,
  2955. login_date datetime NOT NULL default '0000-00-00 00:00:00',
  2956. user_ip varchar(39) NOT NULL default '',
  2957. c_id int NOT NULL,
  2958. session_id INT NOT NULL DEFAULT 0,
  2959. access_url_id INT NOT NULL DEFAULT 1,
  2960. PRIMARY KEY (login_id),
  2961. KEY login_user_id (login_user_id)
  2962. );
  2963. DROP TABLE IF EXISTS track_e_open;
  2964. CREATE TABLE track_e_open (
  2965. open_id int NOT NULL auto_increment,
  2966. open_remote_host tinytext NOT NULL,
  2967. open_agent tinytext NOT NULL,
  2968. open_referer tinytext NOT NULL,
  2969. open_date datetime NOT NULL default '0000-00-00 00:00:00',
  2970. PRIMARY KEY (open_id)
  2971. );
  2972. DROP TABLE IF EXISTS track_e_uploads;
  2973. CREATE TABLE track_e_uploads (
  2974. upload_id int NOT NULL auto_increment,
  2975. upload_user_id int unsigned default NULL,
  2976. upload_date datetime NOT NULL default '0000-00-00 00:00:00',
  2977. upload_cours_id varchar(40) NOT NULL default '',
  2978. c_id int unsigned default NULL,
  2979. upload_work_id int NOT NULL default 0,
  2980. upload_session_id INT NOT NULL DEFAULT 0,
  2981. PRIMARY KEY (upload_id),
  2982. KEY upload_user_id (upload_user_id),
  2983. KEY upload_cours_id (upload_cours_id)
  2984. );
  2985. DROP TABLE IF EXISTS track_e_course_access;
  2986. CREATE TABLE track_e_course_access (
  2987. course_access_id int NOT NULL auto_increment,
  2988. c_id int NOT NULL,
  2989. user_id int NOT NULL,
  2990. login_course_date datetime NOT NULL default '0000-00-00 00:00:00',
  2991. logout_course_date datetime default NULL,
  2992. counter int NOT NULL,
  2993. session_id int NOT NULL default 0,
  2994. user_ip varchar(39) NOT NULL default '',
  2995. PRIMARY KEY (course_access_id)
  2996. );
  2997. DROP TABLE IF EXISTS track_e_hotspot;
  2998. CREATE TABLE track_e_hotspot (
  2999. hotspot_id int NOT NULL auto_increment,
  3000. hotspot_user_id int NOT NULL,
  3001. hotspot_course_code varchar(50) NOT NULL,
  3002. c_id int unsigned default NULL,
  3003. hotspot_exe_id int NOT NULL,
  3004. hotspot_question_id int NOT NULL,
  3005. hotspot_answer_id int NOT NULL,
  3006. hotspot_correct tinyint(3) unsigned NOT NULL,
  3007. hotspot_coordinate text NOT NULL,
  3008. PRIMARY KEY (hotspot_id),
  3009. KEY hotspot_course_code (hotspot_course_code),
  3010. KEY hotspot_user_id (hotspot_user_id),
  3011. KEY hotspot_exe_id (hotspot_exe_id),
  3012. KEY hotspot_question_id (hotspot_question_id)
  3013. );
  3014. DROP TABLE IF EXISTS track_e_item_property;
  3015. CREATE TABLE track_e_item_property (
  3016. id int NOT NULL auto_increment PRIMARY KEY,
  3017. course_id int NOT NULL,
  3018. item_property_id int NOT NULL,
  3019. title varchar(255),
  3020. content text,
  3021. progress int NOT NULL default 0,
  3022. lastedit_date datetime NOT NULL default '0000-00-00 00:00:00',
  3023. lastedit_user_id int NOT NULL,
  3024. session_id int NOT NULL default 0
  3025. );
  3026. ALTER TABLE track_e_course_access ADD INDEX (user_id);
  3027. ALTER TABLE track_e_course_access ADD INDEX (login_course_date);
  3028. ALTER TABLE track_e_course_access ADD INDEX (session_id);
  3029. ALTER TABLE track_e_access ADD INDEX (access_session_id);
  3030. ALTER TABLE track_e_online ADD INDEX (session_id);
  3031. ALTER TABLE track_e_item_property ADD INDEX (course_id, item_property_id, session_id);
  3032. ALTER TABLE track_e_downloads ADD INDEX (down_session_id);
  3033. ALTER TABLE track_e_links ADD INDEX (links_session_id);
  3034. ALTER TABLE track_e_uploads ADD INDEX (upload_session_id);
  3035. --
  3036. -- Table structure for LP custom storage API
  3037. --
  3038. DROP TABLE IF EXISTS track_stored_values;
  3039. CREATE TABLE IF NOT EXISTS track_stored_values (
  3040. id int unsigned not null AUTO_INCREMENT PRIMARY KEY,
  3041. user_id INT NOT NULL,
  3042. sco_id INT NOT NULL,
  3043. course_id CHAR(40) NOT NULL,
  3044. sv_key CHAR(64) NOT NULL,
  3045. sv_value TEXT NOT NULL
  3046. );
  3047. ALTER TABLE track_stored_values ADD KEY (user_id, sco_id, course_id, sv_key);
  3048. ALTER TABLE track_stored_values ADD UNIQUE (user_id, sco_id, course_id, sv_key);
  3049. DROP TABLE IF EXISTS track_stored_value_stack;
  3050. CREATE TABLE IF NOT EXISTS track_stored_values_stack (
  3051. id int unsigned not null AUTO_INCREMENT PRIMARY KEY,
  3052. user_id INT NOT NULL,
  3053. sco_id INT NOT NULL,
  3054. stack_order INT NOT NULL,
  3055. course_id CHAR(40) NOT NULL,
  3056. sv_key CHAR(64) NOT NULL,
  3057. sv_value TEXT NOT NULL
  3058. );
  3059. ALTER TABLE track_stored_values_stack ADD KEY (user_id, sco_id, course_id, sv_key, stack_order);
  3060. ALTER TABLE track_stored_values_stack ADD UNIQUE (user_id, sco_id, course_id, sv_key, stack_order);
  3061. DROP TABLE IF EXISTS track_e_attempt_coeff;
  3062. CREATE TABLE track_e_attempt_coeff (
  3063. id int unsigned not null auto_increment primary key,
  3064. attempt_id INT NOT NULL,
  3065. marks_coeff float(6,2)
  3066. );
  3067. -- Course
  3068. CREATE TABLE c_announcement(
  3069. id int unsigned NOT NULL auto_increment,
  3070. c_id INT NOT NULL,
  3071. title text,
  3072. content mediumtext,
  3073. end_date date default NULL,
  3074. display_order mediumint NOT NULL default 0,
  3075. email_sent tinyint default 0,
  3076. session_id int default 0,
  3077. PRIMARY KEY (id, c_id)
  3078. );
  3079. ALTER TABLE c_announcement ADD INDEX ( session_id );
  3080. CREATE TABLE c_announcement_attachment (
  3081. id int NOT NULL auto_increment,
  3082. c_id INT NOT NULL,
  3083. path varchar(255) NOT NULL,
  3084. comment text,
  3085. size int NOT NULL default 0,
  3086. announcement_id int NOT NULL,
  3087. filename varchar(255) NOT NULL,
  3088. PRIMARY KEY (id, c_id)
  3089. );
  3090. CREATE TABLE c_resource (
  3091. id int unsigned NOT NULL auto_increment,
  3092. c_id INT NOT NULL,
  3093. source_type varchar(50) default NULL,
  3094. source_id int unsigned default NULL,
  3095. resource_type varchar(50) default NULL,
  3096. resource_id int unsigned default NULL,
  3097. PRIMARY KEY (id, c_id)
  3098. );
  3099. CREATE TABLE c_userinfo_content (
  3100. id int unsigned NOT NULL auto_increment,
  3101. c_id INT NOT NULL,
  3102. user_id int unsigned NOT NULL,
  3103. definition_id int unsigned NOT NULL,
  3104. editor_ip varchar(39) default NULL,
  3105. edition_time datetime default NULL,
  3106. content text NOT NULL,
  3107. PRIMARY KEY (id, c_id),
  3108. KEY user_id (user_id)
  3109. );
  3110. CREATE TABLE c_userinfo_def (
  3111. id int unsigned NOT NULL auto_increment,
  3112. c_id INT NOT NULL,
  3113. title varchar(80) NOT NULL default '',
  3114. comment text,
  3115. line_count tinyint unsigned NOT NULL default 5,
  3116. rank tinyint unsigned NOT NULL default 0,
  3117. PRIMARY KEY (id, c_id)
  3118. );
  3119. CREATE TABLE c_forum_category(
  3120. cat_id int NOT NULL auto_increment,
  3121. c_id INT NOT NULL,
  3122. cat_title varchar(255) NOT NULL default '',
  3123. cat_comment text,
  3124. cat_order int NOT NULL default 0,
  3125. locked int NOT NULL default 0,
  3126. session_id int unsigned NOT NULL default 0,
  3127. PRIMARY KEY (cat_id, c_id)
  3128. );
  3129. ALTER TABLE c_forum_category ADD INDEX ( session_id );
  3130. CREATE TABLE c_forum_forum(
  3131. forum_id int NOT NULL auto_increment,
  3132. c_id INT NOT NULL,
  3133. forum_title varchar(255) NOT NULL default '',
  3134. forum_comment text,
  3135. forum_threads int default 0,
  3136. forum_posts int default 0,
  3137. forum_last_post int default 0,
  3138. forum_category int default NULL,
  3139. allow_anonymous int default NULL,
  3140. allow_edit int default NULL,
  3141. approval_direct_post varchar(20) default NULL,
  3142. allow_attachments int default NULL,
  3143. allow_new_threads int default NULL,
  3144. default_view varchar(20) default NULL,
  3145. forum_of_group varchar(20) default NULL,
  3146. forum_group_public_private varchar(20) default 'public',
  3147. forum_order int default NULL,
  3148. locked int NOT NULL default 0,
  3149. session_id int NOT NULL default 0,
  3150. forum_image varchar(255) NOT NULL default '',
  3151. start_time datetime NOT NULL default '0000-00-00 00:00:00',
  3152. end_time datetime NOT NULL default '0000-00-00 00:00:00',
  3153. PRIMARY KEY (forum_id, c_id)
  3154. );
  3155. CREATE TABLE c_forum_thread (
  3156. thread_id int NOT NULL auto_increment,
  3157. c_id INT NOT NULL,
  3158. thread_title varchar(255) default NULL,
  3159. forum_id int default NULL,
  3160. thread_replies int UNSIGNED default 0,
  3161. thread_poster_id int default NULL,
  3162. thread_poster_name varchar(100) default '',
  3163. thread_views int UNSIGNED default 0,
  3164. thread_last_post int default NULL,
  3165. thread_date datetime default '0000-00-00 00:00:00',
  3166. thread_sticky tinyint unsigned default 0,
  3167. locked int NOT NULL default 0,
  3168. session_id int unsigned default NULL,
  3169. thread_title_qualify varchar(255) default '',
  3170. thread_qualify_max float(6,2) UNSIGNED NOT NULL default 0,
  3171. thread_close_date datetime default '0000-00-00 00:00:00',
  3172. thread_weight float(6,2) UNSIGNED NOT NULL default 0,
  3173. PRIMARY KEY (thread_id, c_id)
  3174. );
  3175. ALTER TABLE c_forum_thread ADD INDEX idx_forum_thread_forum_id (forum_id);
  3176. CREATE TABLE c_forum_post (
  3177. post_id int NOT NULL auto_increment,
  3178. c_id INT NOT NULL,
  3179. post_title varchar(250) default NULL,
  3180. post_text text,
  3181. thread_id int default 0,
  3182. forum_id int default 0,
  3183. poster_id int default 0,
  3184. poster_name varchar(100) default '',
  3185. post_date datetime default '0000-00-00 00:00:00',
  3186. post_notification tinyint default 0,
  3187. post_parent_id int default 0,
  3188. visible tinyint default 1,
  3189. PRIMARY KEY (post_id, c_id),
  3190. KEY poster_id (poster_id),
  3191. KEY forum_id (forum_id)
  3192. );
  3193. ALTER TABLE c_forum_post ADD INDEX idx_forum_post_thread_id (thread_id);
  3194. ALTER TABLE c_forum_post ADD INDEX idx_forum_post_visible (visible);
  3195. CREATE TABLE c_forum_mailcue (
  3196. id int NOT NULL auto_increment,
  3197. c_id INT NOT NULL,
  3198. user_id int default NULL,
  3199. thread_id int default NULL,
  3200. post_id int default NULL,
  3201. PRIMARY KEY (id, c_id, thread_id, user_id, post_id )
  3202. );
  3203. CREATE TABLE c_forum_attachment (
  3204. id int NOT NULL auto_increment,
  3205. c_id INT NOT NULL,
  3206. path varchar(255) NOT NULL,
  3207. comment text,
  3208. size int NOT NULL default 0,
  3209. post_id int NOT NULL,
  3210. filename varchar(255) NOT NULL,
  3211. PRIMARY KEY (id, c_id)
  3212. );
  3213. CREATE TABLE c_forum_notification(
  3214. id int NOT NULL auto_increment,
  3215. c_id INT NOT NULL,
  3216. user_id int,
  3217. forum_id int,
  3218. thread_id int,
  3219. post_id int,
  3220. KEY user_id (user_id),
  3221. KEY forum_id (forum_id),
  3222. PRIMARY KEY (id, c_id, user_id, forum_id, thread_id, post_id )
  3223. );
  3224. CREATE TABLE c_forum_thread_qualify (
  3225. id int unsigned AUTO_INCREMENT,
  3226. c_id INT NOT NULL,
  3227. user_id int unsigned NOT NULL,
  3228. thread_id int NOT NULL,
  3229. qualify float(6,2) NOT NULL default 0,
  3230. qualify_user_id int default NULL,
  3231. qualify_time datetime default '0000-00-00 00:00:00',
  3232. session_id int default NULL,
  3233. PRIMARY KEY (id, c_id)
  3234. );
  3235. ALTER TABLE c_forum_thread_qualify ADD INDEX (user_id, thread_id);
  3236. CREATE TABLE c_forum_thread_qualify_log (
  3237. id int unsigned AUTO_INCREMENT,
  3238. c_id INT NOT NULL,
  3239. user_id int unsigned NOT NULL,
  3240. thread_id int NOT NULL,
  3241. qualify float(6,2) NOT NULL default 0,
  3242. qualify_user_id int default NULL,
  3243. qualify_time datetime default '0000-00-00 00:00:00',
  3244. session_id int default NULL,
  3245. PRIMARY KEY (id, c_id)
  3246. );
  3247. ALTER TABLE c_forum_thread_qualify_log ADD INDEX (user_id, thread_id);
  3248. CREATE TABLE c_quiz (
  3249. id int unsigned NOT NULL auto_increment,
  3250. c_id INT NOT NULL,
  3251. title varchar(255) NOT NULL,
  3252. description text default NULL,
  3253. sound varchar(255) default NULL,
  3254. type tinyint unsigned NOT NULL default 1,
  3255. random int NOT NULL default 0,
  3256. random_answers tinyint unsigned NOT NULL default 0,
  3257. active tinyint NOT NULL default 0,
  3258. results_disabled INT UNSIGNED NOT NULL DEFAULT 0,
  3259. access_condition TEXT DEFAULT NULL,
  3260. max_attempt int NOT NULL default 0,
  3261. start_time datetime NOT NULL default '0000-00-00 00:00:00',
  3262. end_time datetime NOT NULL default '0000-00-00 00:00:00',
  3263. feedback_type int NOT NULL default 0,
  3264. expired_time int NOT NULL default '0',
  3265. session_id int default 0,
  3266. propagate_neg INT NOT NULL DEFAULT 0,
  3267. review_answers INT NOT NULL DEFAULT 0,
  3268. random_by_category INT NOT NULL DEFAULT 0,
  3269. text_when_finished TEXT default NULL,
  3270. display_category_name INT NOT NULL DEFAULT 1,
  3271. pass_percentage INT DEFAULT NULL,
  3272. PRIMARY KEY (id, c_id)
  3273. );
  3274. ALTER TABLE c_quiz ADD INDEX ( session_id );
  3275. CREATE TABLE c_quiz_question(
  3276. id int unsigned NOT NULL auto_increment,
  3277. question TEXT NOT NULL,
  3278. description text default NULL,
  3279. ponderation float(6,2) NOT NULL default 0,
  3280. position mediumint unsigned NOT NULL default 1,
  3281. type tinyint unsigned NOT NULL default 2,
  3282. picture varchar(50) default NULL,
  3283. level int unsigned NOT NULL default 0,
  3284. extra varchar(255) default NULL,
  3285. question_code char(10) default '',
  3286. c_id INT NOT NULL,
  3287. PRIMARY KEY (id, c_id)
  3288. );
  3289. ALTER TABLE c_quiz_question ADD INDEX (position);
  3290. CREATE TABLE c_quiz_answer(
  3291. id int unsigned NOT NULL,
  3292. c_id INT NOT NULL,
  3293. id_auto int NOT NULL AUTO_INCREMENT,
  3294. question_id int unsigned NOT NULL,
  3295. answer text NOT NULL,
  3296. correct mediumint unsigned default NULL,
  3297. comment text default NULL,
  3298. ponderation float(6,2) NOT NULL default 0,
  3299. position mediumint unsigned NOT NULL default 1,
  3300. hotspot_coordinates text,
  3301. hotspot_type varchar(40) default NULL,
  3302. destination text NOT NULL,
  3303. answer_code char(10) default '',
  3304. PRIMARY KEY (id_auto, c_id)
  3305. );
  3306. CREATE TABLE c_quiz_question_option (
  3307. id int NOT NULL auto_increment,
  3308. c_id INT NOT NULL,
  3309. question_id int NOT NULL,
  3310. name varchar(255),
  3311. position int unsigned NOT NULL,
  3312. PRIMARY KEY (id, c_id)
  3313. );
  3314. CREATE TABLE c_quiz_rel_question (
  3315. c_id INT NOT NULL,
  3316. question_id int unsigned NOT NULL,
  3317. exercice_id int unsigned NOT NULL,
  3318. question_order int unsigned NOT NULL default 1,
  3319. PRIMARY KEY (c_id, question_id, exercice_id)
  3320. );
  3321. CREATE TABLE c_quiz_question_category (
  3322. id int NOT NULL AUTO_INCREMENT,
  3323. c_id INT NOT NULL,
  3324. title varchar(255) NOT NULL,
  3325. description text NOT NULL,
  3326. PRIMARY KEY (id, c_id)
  3327. );
  3328. CREATE TABLE c_quiz_question_rel_category (
  3329. c_id INT NOT NULL,
  3330. question_id int NOT NULL,
  3331. category_id int NOT NULL,
  3332. PRIMARY KEY (c_id,question_id)
  3333. );
  3334. CREATE TABLE c_course_description(
  3335. id int UNSIGNED NOT NULL auto_increment,
  3336. c_id INT NOT NULL,
  3337. title VARCHAR(255),
  3338. content TEXT,
  3339. session_id int default 0,
  3340. description_type tinyint unsigned NOT NULL default 0,
  3341. progress INT NOT NULL default 0,
  3342. PRIMARY KEY (id, c_id)
  3343. );
  3344. ALTER TABLE c_course_description ADD INDEX ( session_id );
  3345. CREATE TABLE c_tool(
  3346. id int unsigned NOT NULL auto_increment,
  3347. c_id INT NOT NULL,
  3348. name varchar(255) NOT NULL,
  3349. link varchar(255) NOT NULL,
  3350. image varchar(255) default NULL,
  3351. visibility tinyint unsigned default 0,
  3352. admin varchar(255) default NULL,
  3353. address varchar(255) default NULL,
  3354. added_tool tinyint unsigned default 1,
  3355. target varchar(20) NOT NULL default '_self',
  3356. category varchar(20) not null default 'authoring',
  3357. session_id int default 0,
  3358. PRIMARY KEY (id, c_id)
  3359. );
  3360. ALTER TABLE c_tool ADD INDEX ( session_id );
  3361. CREATE TABLE c_calendar_event(
  3362. id int unsigned NOT NULL auto_increment,
  3363. c_id INT NOT NULL,
  3364. title varchar(255) NOT NULL,
  3365. content text,
  3366. start_date datetime NOT NULL default '0000-00-00 00:00:00',
  3367. end_date datetime NOT NULL default '0000-00-00 00:00:00',
  3368. parent_event_id INT NULL,
  3369. session_id int unsigned NOT NULL default 0,
  3370. all_day INT NOT NULL DEFAULT 0,
  3371. comment TEXT,
  3372. PRIMARY KEY (id, c_id)
  3373. );
  3374. ALTER TABLE c_calendar_event ADD INDEX ( session_id );
  3375. CREATE TABLE c_calendar_event_repeat(
  3376. c_id INT NOT NULL,
  3377. cal_id INT DEFAULT 0 NOT NULL,
  3378. cal_type VARCHAR(20),
  3379. cal_end INT,
  3380. cal_frequency INT DEFAULT 1,
  3381. cal_days CHAR(7),
  3382. PRIMARY KEY (c_id, cal_id)
  3383. );
  3384. CREATE TABLE c_calendar_event_repeat_not (
  3385. c_id INT NOT NULL,
  3386. cal_id INT NOT NULL,
  3387. cal_date INT NOT NULL,
  3388. PRIMARY KEY (c_id, cal_id, cal_date )
  3389. );
  3390. CREATE TABLE c_calendar_event_attachment (
  3391. id int NOT NULL auto_increment,
  3392. c_id INT NOT NULL,
  3393. path varchar(255) NOT NULL,
  3394. comment text,
  3395. size int NOT NULL default 0,
  3396. agenda_id int NOT NULL,
  3397. filename varchar(255) NOT NULL,
  3398. PRIMARY KEY (id, c_id)
  3399. );
  3400. CREATE TABLE c_document (
  3401. id int unsigned NOT NULL auto_increment,
  3402. c_id INT NOT NULL,
  3403. path varchar(255) NOT NULL default '',
  3404. comment text,
  3405. title varchar(255) default NULL,
  3406. filetype set('file','folder') NOT NULL default 'file',
  3407. size int NOT NULL default 0,
  3408. readonly TINYINT UNSIGNED NOT NULL,
  3409. session_id int UNSIGNED NOT NULL default 0,
  3410. PRIMARY KEY (id, c_id)
  3411. );
  3412. CREATE TABLE c_student_publication (
  3413. id int unsigned NOT NULL auto_increment,
  3414. c_id INT NOT NULL,
  3415. url varchar(255) default NULL,
  3416. title varchar(255) default NULL,
  3417. description text default NULL,
  3418. author varchar(255) default NULL,
  3419. active tinyint default NULL,
  3420. accepted tinyint default 0,
  3421. post_group_id int DEFAULT 0 NOT NULL,
  3422. sent_date datetime NOT NULL default '0000-00-00 00:00:00',
  3423. filetype set('file','folder') NOT NULL default 'file',
  3424. has_properties int UNSIGNED NOT NULL DEFAULT 0,
  3425. view_properties tinyint NULL,
  3426. qualification float(6,2) UNSIGNED NOT NULL DEFAULT 0,
  3427. date_of_qualification datetime NOT NULL default '0000-00-00 00:00:00',
  3428. parent_id INT UNSIGNED NOT NULL DEFAULT 0,
  3429. qualificator_id INT UNSIGNED NOT NULL DEFAULT 0,
  3430. weight float(6,2) UNSIGNED NOT NULL default 0,
  3431. session_id INT UNSIGNED NOT NULL default 0,
  3432. user_id INTEGER NOT NULL,
  3433. allow_text_assignment INTEGER NOT NULL DEFAULT 0,
  3434. contains_file INTEGER NOT NULL DEFAULT 0,
  3435. PRIMARY KEY (id, c_id)
  3436. );
  3437. CREATE TABLE c_student_publication_assignment(
  3438. id int NOT NULL auto_increment,
  3439. c_id INT NOT NULL,
  3440. expires_on datetime NOT NULL default '0000-00-00 00:00:00',
  3441. ends_on datetime NOT NULL default '0000-00-00 00:00:00',
  3442. add_to_calendar tinyint NOT NULL,
  3443. enable_qualification tinyint NOT NULL,
  3444. publication_id int NOT NULL,
  3445. PRIMARY KEY (id, c_id)
  3446. );
  3447. ALTER TABLE c_student_publication ADD INDEX ( session_id );
  3448. CREATE TABLE c_link(
  3449. id int unsigned NOT NULL auto_increment,
  3450. c_id INT NOT NULL,
  3451. url TEXT NOT NULL,
  3452. title varchar(150) default NULL,
  3453. description text,
  3454. category_id int unsigned default NULL,
  3455. display_order int unsigned NOT NULL default 0,
  3456. on_homepage char(10) NOT NULL default '0',
  3457. target char(10) default '_self',
  3458. session_id int default 0,
  3459. PRIMARY KEY (id, c_id)
  3460. );
  3461. ALTER TABLE c_link ADD INDEX ( session_id );
  3462. CREATE TABLE c_link_category (
  3463. id int unsigned NOT NULL auto_increment,
  3464. c_id INT NOT NULL,
  3465. category_title varchar(255) NOT NULL,
  3466. description text,
  3467. display_order mediumint unsigned NOT NULL default 0,
  3468. session_id int default 0,
  3469. PRIMARY KEY (id, c_id)
  3470. );
  3471. ALTER TABLE c_link_category ADD INDEX ( session_id );
  3472. CREATE TABLE c_wiki(
  3473. id int NOT NULL auto_increment,
  3474. c_id INT NOT NULL,
  3475. page_id int NOT NULL default 0,
  3476. reflink varchar(255) NOT NULL default 'index',
  3477. title varchar(255) NOT NULL,
  3478. content mediumtext NOT NULL,
  3479. user_id int NOT NULL default 0,
  3480. group_id int DEFAULT NULL,
  3481. dtime datetime NOT NULL default '0000-00-00 00:00:00',
  3482. addlock int NOT NULL default 1,
  3483. editlock int NOT NULL default 0,
  3484. visibility int NOT NULL default 1,
  3485. addlock_disc int NOT NULL default 1,
  3486. visibility_disc int NOT NULL default 1,
  3487. ratinglock_disc int NOT NULL default 1,
  3488. assignment int NOT NULL default 0,
  3489. comment text NOT NULL,
  3490. progress text NOT NULL,
  3491. score int NULL default 0,
  3492. version int default NULL,
  3493. is_editing int NOT NULL default 0,
  3494. time_edit datetime NOT NULL default '0000-00-00 00:00:00',
  3495. hits int default 0,
  3496. linksto text NOT NULL,
  3497. tag text NOT NULL,
  3498. user_ip varchar(39) NOT NULL,
  3499. session_id int default 0,
  3500. PRIMARY KEY (id, c_id),
  3501. KEY reflink (reflink),
  3502. KEY group_id (group_id),
  3503. KEY page_id (page_id),
  3504. KEY session_id (session_id)
  3505. );
  3506. CREATE TABLE c_wiki_conf (
  3507. c_id INT NOT NULL,
  3508. page_id int NOT NULL default 0,
  3509. task text NOT NULL,
  3510. feedback1 text NOT NULL,
  3511. feedback2 text NOT NULL,
  3512. feedback3 text NOT NULL,
  3513. fprogress1 varchar(3) NOT NULL,
  3514. fprogress2 varchar(3) NOT NULL,
  3515. fprogress3 varchar(3) NOT NULL,
  3516. max_size int default NULL,
  3517. max_text int default NULL,
  3518. max_version int default NULL,
  3519. startdate_assig datetime NOT NULL default '0000-00-00 00:00:00',
  3520. enddate_assig datetime NOT NULL default '0000-00-00 00:00:00',
  3521. delayedsubmit int NOT NULL default 0,
  3522. KEY page_id (page_id),
  3523. PRIMARY KEY ( c_id, page_id )
  3524. );
  3525. CREATE TABLE c_wiki_discuss (
  3526. id int NOT NULL auto_increment,
  3527. c_id INT NOT NULL,
  3528. publication_id int NOT NULL default 0,
  3529. userc_id int NOT NULL default 0,
  3530. comment text NOT NULL,
  3531. p_score varchar(255) default NULL,
  3532. dtime datetime NOT NULL default '0000-00-00 00:00:00',
  3533. PRIMARY KEY (id, c_id)
  3534. );
  3535. CREATE TABLE c_wiki_mailcue (
  3536. c_id INT NOT NULL,
  3537. id int NOT NULL,
  3538. user_id int NOT NULL,
  3539. type text NOT NULL,
  3540. group_id int DEFAULT NULL,
  3541. session_id int default 0,
  3542. KEY (c_id, id),
  3543. PRIMARY KEY ( c_id, id, user_id )
  3544. );
  3545. CREATE TABLE c_online_connected (
  3546. c_id INT NOT NULL,
  3547. user_id int unsigned NOT NULL,
  3548. last_connection datetime NOT NULL default '0000-00-00 00:00:00',
  3549. PRIMARY KEY (c_id, user_id)
  3550. );
  3551. CREATE TABLE c_online_link (
  3552. id int unsigned NOT NULL auto_increment,
  3553. c_id INT NOT NULL,
  3554. name char(50) NOT NULL default '',
  3555. url char(100) NOT NULL,
  3556. PRIMARY KEY (id, c_id)
  3557. );
  3558. CREATE TABLE c_chat_connected (
  3559. id int unsigned NOT NULL auto_increment,
  3560. c_id INT NOT NULL,
  3561. user_id int unsigned NOT NULL default '0',
  3562. last_connection datetime NOT NULL default '0000-00-00 00:00:00',
  3563. session_id INT NOT NULL default 0,
  3564. to_group_id INT NOT NULL default 0,
  3565. PRIMARY KEY (id, c_id, user_id, last_connection)
  3566. );
  3567. ALTER TABLE c_chat_connected ADD INDEX char_connected_index(user_id, session_id, to_group_id);
  3568. CREATE TABLE c_group_info(
  3569. id int unsigned NOT NULL auto_increment,
  3570. c_id INT NOT NULL,
  3571. name varchar(100) default NULL,
  3572. status tinyint DEFAULT 1,
  3573. category_id int unsigned NOT NULL default 0,
  3574. description text,
  3575. max_student int unsigned NOT NULL default 8,
  3576. doc_state tinyint unsigned NOT NULL default 1,
  3577. calendar_state tinyint unsigned NOT NULL default 0,
  3578. work_state tinyint unsigned NOT NULL default 0,
  3579. announcements_state tinyint unsigned NOT NULL default 0,
  3580. forum_state tinyint unsigned NOT NULL default 0,
  3581. wiki_state tinyint unsigned NOT NULL default 1,
  3582. chat_state tinyint unsigned NOT NULL default 1,
  3583. secret_directory varchar(255) default NULL,
  3584. self_registration_allowed tinyint unsigned NOT NULL default '0',
  3585. self_unregistration_allowed tinyint unsigned NOT NULL default '0',
  3586. session_id int unsigned NOT NULL default 0,
  3587. PRIMARY KEY (id, c_id)
  3588. );
  3589. ALTER TABLE c_group_info ADD INDEX ( session_id );
  3590. CREATE TABLE c_group_category(
  3591. id int unsigned NOT NULL auto_increment,
  3592. c_id INT NOT NULL,
  3593. title varchar(255) NOT NULL default '',
  3594. description text NOT NULL,
  3595. doc_state tinyint unsigned NOT NULL default 1,
  3596. calendar_state tinyint unsigned NOT NULL default 1,
  3597. work_state tinyint unsigned NOT NULL default 1,
  3598. announcements_state tinyint unsigned NOT NULL default 1,
  3599. forum_state tinyint unsigned NOT NULL default 1,
  3600. wiki_state tinyint unsigned NOT NULL default 1,
  3601. chat_state tinyint unsigned NOT NULL default 1,
  3602. max_student int unsigned NOT NULL default 8,
  3603. self_reg_allowed tinyint unsigned NOT NULL default 0,
  3604. self_unreg_allowed tinyint unsigned NOT NULL default 0,
  3605. groups_per_user int unsigned NOT NULL default 0,
  3606. display_order int unsigned NOT NULL default 0,
  3607. PRIMARY KEY (id, c_id)
  3608. );
  3609. CREATE TABLE c_group_rel_user(
  3610. id int unsigned NOT NULL auto_increment,
  3611. c_id INT NOT NULL,
  3612. user_id int unsigned NOT NULL,
  3613. group_id int unsigned NOT NULL default 0,
  3614. status int NOT NULL default 0,
  3615. role char(50) NOT NULL,
  3616. PRIMARY KEY (id, c_id)
  3617. );
  3618. CREATE TABLE c_group_rel_tutor(
  3619. id int NOT NULL auto_increment,
  3620. c_id INT NOT NULL,
  3621. user_id int NOT NULL,
  3622. group_id int NOT NULL default 0,
  3623. PRIMARY KEY (id, c_id)
  3624. );
  3625. CREATE TABLE c_item_property(
  3626. id int NOT NULL auto_increment,
  3627. c_id INT NOT NULL,
  3628. tool varchar(100) NOT NULL default '',
  3629. insert_user_id int unsigned NOT NULL default '0',
  3630. insert_date datetime NOT NULL default '0000-00-00 00:00:00',
  3631. lastedit_date datetime NOT NULL default '0000-00-00 00:00:00',
  3632. ref int NOT NULL default '0',
  3633. lastedit_type varchar(100) NOT NULL default '',
  3634. lastedit_user_id int unsigned NOT NULL default '0',
  3635. to_group_id int unsigned default NULL,
  3636. to_user_id int unsigned default NULL,
  3637. visibility tinyint NOT NULL default '1',
  3638. start_visible datetime NOT NULL default '0000-00-00 00:00:00',
  3639. end_visible datetime NOT NULL default '0000-00-00 00:00:00',
  3640. id_session INT NOT NULL DEFAULT 0,
  3641. PRIMARY KEY (id, c_id)
  3642. );
  3643. ALTER TABLE c_item_property ADD INDEX idx_item_property_toolref (tool,ref);
  3644. CREATE TABLE c_tool_intro(
  3645. id varchar(50) NOT NULL,
  3646. c_id INT NOT NULL,
  3647. intro_text MEDIUMTEXT NOT NULL,
  3648. session_id INT NOT NULL DEFAULT 0,
  3649. PRIMARY KEY (id, c_id, session_id)
  3650. );
  3651. CREATE TABLE c_dropbox_file (
  3652. id int unsigned NOT NULL auto_increment,
  3653. c_id INT NOT NULL,
  3654. uploader_id int unsigned NOT NULL default 0,
  3655. filename varchar(250) NOT NULL default '',
  3656. filesize int unsigned NOT NULL,
  3657. title varchar(250) default '',
  3658. description varchar(250) default '',
  3659. author varchar(250) default '',
  3660. upload_date datetime NOT NULL default '0000-00-00 00:00:00',
  3661. last_upload_date datetime NOT NULL default '0000-00-00 00:00:00',
  3662. cat_id int NOT NULL default 0,
  3663. session_id int UNSIGNED NOT NULL,
  3664. PRIMARY KEY (id, c_id),
  3665. UNIQUE KEY UN_filename (filename)
  3666. );
  3667. ALTER TABLE c_dropbox_file ADD INDEX ( session_id );
  3668. CREATE TABLE c_dropbox_post (
  3669. c_id INT NOT NULL,
  3670. file_id int unsigned NOT NULL,
  3671. dest_user_id int unsigned NOT NULL default 0,
  3672. feedback_date datetime NOT NULL default '0000-00-00 00:00:00',
  3673. feedback text default '',
  3674. cat_id int NOT NULL default 0,
  3675. session_id int UNSIGNED NOT NULL,
  3676. PRIMARY KEY (c_id, file_id, dest_user_id)
  3677. );
  3678. ALTER TABLE c_dropbox_post ADD INDEX ( session_id );
  3679. CREATE TABLE c_dropbox_person (
  3680. c_id INT NOT NULL,
  3681. file_id int unsigned NOT NULL,
  3682. user_id int unsigned NOT NULL default 0,
  3683. PRIMARY KEY (c_id, file_id, user_id)
  3684. );
  3685. CREATE TABLE c_dropbox_category (
  3686. cat_id int NOT NULL auto_increment,
  3687. c_id INT NOT NULL,
  3688. cat_name text NOT NULL,
  3689. received tinyint unsigned NOT NULL default 0,
  3690. sent tinyint unsigned NOT NULL default 0,
  3691. user_id int NOT NULL default 0,
  3692. session_id int NOT NULL default 0,
  3693. PRIMARY KEY(cat_id, c_id)
  3694. );
  3695. ALTER TABLE c_dropbox_category ADD INDEX ( session_id );
  3696. CREATE TABLE c_dropbox_feedback (
  3697. feedback_id int NOT NULL auto_increment,
  3698. c_id INT NOT NULL,
  3699. file_id int NOT NULL default 0,
  3700. author_user_id int NOT NULL default 0,
  3701. feedback text NOT NULL,
  3702. feedback_date datetime NOT NULL default '0000-00-00 00:00:00',
  3703. PRIMARY KEY (feedback_id, c_id),
  3704. KEY file_id (file_id),
  3705. KEY author_user_id (author_user_id)
  3706. );
  3707. CREATE TABLE IF NOT EXISTS c_lp (
  3708. id int unsigned auto_increment,
  3709. c_id INT NOT NULL,
  3710. lp_type int unsigned not null,
  3711. name varchar(255) not null,
  3712. ref tinytext null,
  3713. description text null,
  3714. path text not null,
  3715. force_commit tinyint unsigned not null default 0,
  3716. default_view_mod char(32) not null default 'embedded',
  3717. default_encoding char(32) not null default 'UTF-8',
  3718. display_order int unsigned not null default 0,
  3719. content_maker tinytext not null default '',
  3720. content_local varchar(32) not null default 'local',
  3721. content_license text not null default '',
  3722. prevent_reinit tinyint unsigned not null default 1,
  3723. js_lib tinytext not null default '',
  3724. debug tinyint unsigned not null default 0,
  3725. theme varchar(255) not null default '',
  3726. preview_image varchar(255) not null default '',
  3727. author varchar(255) not null default '',
  3728. session_id int unsigned not null default 0,
  3729. prerequisite int unsigned not null default 0,
  3730. hide_toc_frame tinyint NOT NULL DEFAULT 0,
  3731. seriousgame_mode tinyint NOT NULL DEFAULT 0,
  3732. use_max_score int unsigned not null default 1,
  3733. autolunch int unsigned not null default 0,
  3734. created_on DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
  3735. modified_on DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
  3736. publicated_on DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
  3737. expired_on DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
  3738. PRIMARY KEY (id, c_id)
  3739. );
  3740. CREATE TABLE IF NOT EXISTS c_lp_view (
  3741. id int unsigned auto_increment,
  3742. c_id INT NOT NULL,
  3743. lp_id int unsigned not null,
  3744. user_id int unsigned not null,
  3745. view_count int unsigned not null default 0,
  3746. last_item int unsigned not null default 0,
  3747. progress int unsigned default 0,
  3748. session_id int not null default 0,
  3749. PRIMARY KEY (id, c_id)
  3750. );
  3751. ALTER TABLE c_lp_view ADD INDEX (lp_id);
  3752. ALTER TABLE c_lp_view ADD INDEX (user_id);
  3753. ALTER TABLE c_lp_view ADD INDEX (session_id);
  3754. CREATE TABLE IF NOT EXISTS c_lp_item (
  3755. id int unsigned auto_increment,
  3756. c_id INT NOT NULL,
  3757. lp_id int unsigned not null,
  3758. item_type char(32) not null default 'dokeos_document',
  3759. ref tinytext not null default '',
  3760. title varchar(511) not null,
  3761. description varchar(511) default '',
  3762. path text not null,
  3763. min_score float unsigned not null default 0,
  3764. max_score float unsigned default 100,
  3765. mastery_score float unsigned null,
  3766. parent_item_id int unsigned not null default 0,
  3767. previous_item_id int unsigned not null default 0,
  3768. next_item_id int unsigned not null default 0,
  3769. display_order int unsigned not null default 0,
  3770. prerequisite text null default null,
  3771. parameters text null,
  3772. launch_data text not null default '',
  3773. max_time_allowed char(13) NULL default '',
  3774. terms TEXT NULL,
  3775. search_did INT NULL,
  3776. audio VARCHAR(250),
  3777. prerequisite_min_score float,
  3778. prerequisite_max_score float,
  3779. PRIMARY KEY (id, c_id)
  3780. );
  3781. ALTER TABLE c_lp_item ADD INDEX (lp_id);
  3782. ALTER TABLE c_lp_item ADD INDEX idx_c_lp_item_cid_lp_id (c_id, lp_id);
  3783. CREATE TABLE IF NOT EXISTS c_lp_item_view (
  3784. id bigint unsigned auto_increment,
  3785. c_id INT NOT NULL,
  3786. lp_item_id int unsigned not null,
  3787. lp_view_id int unsigned not null,
  3788. view_count int unsigned not null default 0,
  3789. start_time int unsigned not null,
  3790. total_time int unsigned not null default 0,
  3791. score float unsigned not null default 0,
  3792. status char(32) not null default 'not attempted',
  3793. suspend_data longtext null default '',
  3794. lesson_location text null default '',
  3795. core_exit varchar(32) not null default 'none',
  3796. max_score varchar(8) default '',
  3797. PRIMARY KEY (id, c_id)
  3798. );
  3799. ALTER TABLE c_lp_item_view ADD INDEX (lp_item_id);
  3800. ALTER TABLE c_lp_item_view ADD INDEX (lp_view_id);
  3801. ALTER TABLE c_lp_item_view ADD INDEX idx_c_lp_item_view_cid_lp_view_id_lp_item_id (c_id, lp_view_id, lp_item_id);
  3802. CREATE TABLE IF NOT EXISTS c_lp_iv_interaction(
  3803. id bigint unsigned auto_increment,
  3804. c_id INT NOT NULL,
  3805. order_id int unsigned not null default 0,
  3806. lp_iv_id bigint unsigned not null,
  3807. interaction_id varchar(255) not null default '',
  3808. interaction_type varchar(255) not null default '',
  3809. weighting double not null default 0,
  3810. completion_time varchar(16) not null default '',
  3811. correct_responses text not null default '',
  3812. student_response text not null default '',
  3813. result varchar(255) not null default '',
  3814. latency varchar(16) not null default '',
  3815. PRIMARY KEY (id, c_id)
  3816. );
  3817. ALTER TABLE c_lp_iv_interaction ADD INDEX (lp_iv_id);
  3818. CREATE TABLE IF NOT EXISTS c_lp_iv_objective(
  3819. id bigint unsigned auto_increment,
  3820. c_id INT NOT NULL,
  3821. lp_iv_id bigint unsigned not null,
  3822. order_id int unsigned not null default 0,
  3823. objective_id varchar(255) not null default '',
  3824. score_raw float unsigned not null default 0,
  3825. score_max float unsigned not null default 0,
  3826. score_min float unsigned not null default 0,
  3827. status char(32) not null default 'not attempted',
  3828. PRIMARY KEY (id, c_id)
  3829. );
  3830. ALTER TABLE c_lp_iv_objective ADD INDEX (lp_iv_id);
  3831. CREATE TABLE c_blog (
  3832. blog_id int NOT NULL AUTO_INCREMENT ,
  3833. c_id INT NOT NULL,
  3834. blog_name varchar( 250 ) NOT NULL default '',
  3835. blog_subtitle varchar( 250 ) default NULL ,
  3836. date_creation datetime NOT NULL default '0000-00-00 00:00:00',
  3837. visibility tinyint unsigned NOT NULL default 0,
  3838. session_id int default 0,
  3839. PRIMARY KEY (blog_id, c_id)
  3840. );
  3841. ALTER TABLE c_blog ADD INDEX ( session_id );
  3842. CREATE TABLE c_blog_comment (
  3843. comment_id int NOT NULL AUTO_INCREMENT ,
  3844. c_id INT NOT NULL,
  3845. title varchar( 250 ) NOT NULL default '',
  3846. comment longtext NOT NULL ,
  3847. author_id int NOT NULL default 0,
  3848. date_creation datetime NOT NULL default '0000-00-00 00:00:00',
  3849. blog_id int NOT NULL default 0,
  3850. post_id int NOT NULL default 0,
  3851. task_id int default NULL ,
  3852. parent_comment_id int NOT NULL default 0,
  3853. PRIMARY KEY (comment_id, c_id)
  3854. );
  3855. CREATE TABLE c_blog_post(
  3856. post_id int NOT NULL AUTO_INCREMENT ,
  3857. c_id INT NOT NULL,
  3858. title varchar( 250 ) NOT NULL default '',
  3859. full_text longtext NOT NULL ,
  3860. date_creation datetime NOT NULL default '0000-00-00 00:00:00',
  3861. blog_id int NOT NULL default 0,
  3862. author_id int NOT NULL default 0,
  3863. PRIMARY KEY (post_id, c_id)
  3864. );
  3865. CREATE TABLE c_blog_rating(
  3866. rating_id int NOT NULL AUTO_INCREMENT ,
  3867. c_id INT NOT NULL,
  3868. blog_id int NOT NULL default 0,
  3869. rating_type char(40) NOT NULL default 'post',
  3870. item_id int NOT NULL default 0,
  3871. user_id int NOT NULL default 0,
  3872. rating int NOT NULL default 0,
  3873. PRIMARY KEY (rating_id, c_id)
  3874. );
  3875. CREATE TABLE c_blog_rel_user(
  3876. c_id INT NOT NULL,
  3877. blog_id int NOT NULL default 0,
  3878. user_id int NOT NULL default 0,
  3879. PRIMARY KEY (c_id, blog_id , user_id )
  3880. );
  3881. CREATE TABLE c_blog_task(
  3882. task_id int NOT NULL AUTO_INCREMENT ,
  3883. c_id INT NOT NULL,
  3884. blog_id int NOT NULL default 0,
  3885. title varchar( 250 ) NOT NULL default '',
  3886. description text NOT NULL ,
  3887. color varchar( 10 ) NOT NULL default '',
  3888. system_task tinyint unsigned NOT NULL default 0,
  3889. PRIMARY KEY (task_id, c_id)
  3890. );
  3891. CREATE TABLE c_blog_task_rel_user (
  3892. c_id INT NOT NULL,
  3893. blog_id int NOT NULL default 0,
  3894. user_id int NOT NULL default 0,
  3895. task_id int NOT NULL default 0,
  3896. target_date date NOT NULL default '0000-00-00',
  3897. PRIMARY KEY (c_id, blog_id , user_id , task_id )
  3898. );
  3899. CREATE TABLE c_blog_attachment (
  3900. id int unsigned NOT NULL auto_increment,
  3901. c_id INT NOT NULL,
  3902. path varchar(255) NOT NULL COMMENT 'the real filename',
  3903. comment text,
  3904. size int NOT NULL default '0',
  3905. post_id int NOT NULL,
  3906. filename varchar(255) NOT NULL COMMENT 'the user s file name',
  3907. blog_id int NOT NULL,
  3908. comment_id int NOT NULL default '0',
  3909. PRIMARY KEY (id, c_id)
  3910. );
  3911. CREATE TABLE c_permission_group (
  3912. id int NOT NULL AUTO_INCREMENT,
  3913. c_id INT NOT NULL,
  3914. group_id int NOT NULL default 0,
  3915. tool varchar( 250 ) NOT NULL default '',
  3916. action varchar( 250 ) NOT NULL default '',
  3917. PRIMARY KEY (id, c_id)
  3918. );
  3919. CREATE TABLE c_permission_user (
  3920. id int NOT NULL AUTO_INCREMENT ,
  3921. c_id INT NOT NULL,
  3922. user_id int NOT NULL default 0,
  3923. tool varchar( 250 ) NOT NULL default '',
  3924. action varchar( 250 ) NOT NULL default '',
  3925. PRIMARY KEY (id, c_id)
  3926. );
  3927. CREATE TABLE c_permission_task(
  3928. id int NOT NULL AUTO_INCREMENT,
  3929. c_id INT NOT NULL,
  3930. task_id int NOT NULL default 0,
  3931. tool varchar( 250 ) NOT NULL default '',
  3932. action varchar( 250 ) NOT NULL default '',
  3933. PRIMARY KEY (id, c_id)
  3934. );
  3935. CREATE TABLE c_role(
  3936. role_id int NOT NULL AUTO_INCREMENT,
  3937. c_id INT NOT NULL,
  3938. role_name varchar( 250 ) NOT NULL default '',
  3939. role_comment text,
  3940. default_role tinyint default 0,
  3941. PRIMARY KEY (role_id, c_id)
  3942. );
  3943. CREATE TABLE c_role_group(
  3944. id int NOT NULL AUTO_INCREMENT,
  3945. c_id INT NOT NULL,
  3946. role_id int NOT NULL default 0,
  3947. scope varchar( 20 ) NOT NULL default 'course',
  3948. group_id int NOT NULL default 0,
  3949. PRIMARY KEY (id, c_id, group_id )
  3950. );
  3951. CREATE TABLE c_role_permissions(
  3952. id int NOT NULL AUTO_INCREMENT,
  3953. c_id INT NOT NULL,
  3954. role_id int NOT NULL default 0,
  3955. tool varchar( 250 ) NOT NULL default '',
  3956. action varchar( 50 ) NOT NULL default '',
  3957. default_perm tinyint NOT NULL default 0,
  3958. PRIMARY KEY (id, c_id, role_id, tool, action )
  3959. );
  3960. CREATE TABLE c_role_user (
  3961. c_id INT NOT NULL,
  3962. role_id int NOT NULL default 0,
  3963. scope varchar( 20 ) NOT NULL default 'course',
  3964. user_id int NOT NULL default 0,
  3965. PRIMARY KEY ( c_id, role_id, user_id )
  3966. );
  3967. CREATE TABLE c_course_setting (
  3968. id int unsigned NOT NULL auto_increment,
  3969. c_id INT NOT NULL,
  3970. variable varchar(255) NOT NULL default '',
  3971. subkey varchar(255) default NULL,
  3972. type varchar(255) default NULL,
  3973. category varchar(255) default NULL,
  3974. value varchar(255) default '',
  3975. title varchar(255) NOT NULL default '',
  3976. comment varchar(255) default NULL,
  3977. subkeytext varchar(255) default NULL,
  3978. PRIMARY KEY (id, c_id)
  3979. );
  3980. CREATE TABLE c_survey (
  3981. survey_id int unsigned NOT NULL auto_increment,
  3982. c_id INT NOT NULL,
  3983. code varchar(20) default NULL,
  3984. title text default NULL,
  3985. subtitle text default NULL,
  3986. author varchar(20) default NULL,
  3987. lang varchar(20) default NULL,
  3988. avail_from date default NULL,
  3989. avail_till date default NULL,
  3990. is_shared char(1) default '1',
  3991. template varchar(20) default NULL,
  3992. intro text,
  3993. surveythanks text,
  3994. creation_date datetime NOT NULL default '0000-00-00 00:00:00',
  3995. invited int NOT NULL,
  3996. answered int NOT NULL,
  3997. invite_mail text NOT NULL,
  3998. reminder_mail text NOT NULL,
  3999. mail_subject VARCHAR( 255 ) NOT NULL,
  4000. anonymous char(10) NOT NULL default '0',
  4001. access_condition TEXT DEFAULT NULL,
  4002. shuffle bool NOT NULL default '0',
  4003. one_question_per_page bool NOT NULL default '0',
  4004. survey_version varchar(255) NOT NULL default '',
  4005. parent_id int unsigned NOT NULL,
  4006. survey_type int NOT NULL default 0,
  4007. show_form_profile int NOT NULL default 0,
  4008. form_fields TEXT NOT NULL,
  4009. session_id int unsigned NOT NULL default 0,
  4010. visible_results int unsigned DEFAULT 0,
  4011. PRIMARY KEY (survey_id, c_id)
  4012. );
  4013. ALTER TABLE c_survey ADD INDEX ( session_id );
  4014. CREATE TABLE c_survey_invitation(
  4015. survey_invitation_id int unsigned NOT NULL auto_increment,
  4016. c_id INT NOT NULL,
  4017. survey_code varchar(20) NOT NULL,
  4018. user varchar(250) NOT NULL,
  4019. invitation_code varchar(250) NOT NULL,
  4020. invitation_date datetime NOT NULL,
  4021. reminder_date datetime NOT NULL,
  4022. answered int NOT NULL default 0,
  4023. session_id int UNSIGNED NOT NULL default 0,
  4024. group_id INT NOT NULL,
  4025. PRIMARY KEY (survey_invitation_id, c_id)
  4026. );
  4027. CREATE TABLE c_survey_question (
  4028. question_id int unsigned NOT NULL auto_increment,
  4029. c_id INT NOT NULL,
  4030. survey_id int unsigned NOT NULL,
  4031. survey_question text NOT NULL,
  4032. survey_question_comment text NOT NULL,
  4033. type varchar(250) NOT NULL,
  4034. display varchar(10) NOT NULL,
  4035. sort int NOT NULL,
  4036. shared_question_id int,
  4037. max_value int,
  4038. survey_group_pri int unsigned NOT NULL default '0',
  4039. survey_group_sec1 int unsigned NOT NULL default '0',
  4040. survey_group_sec2 int unsigned NOT NULL default '0',
  4041. PRIMARY KEY (question_id, c_id)
  4042. );
  4043. CREATE TABLE c_survey_question_option (
  4044. question_option_id int unsigned NOT NULL auto_increment,
  4045. c_id INT NOT NULL,
  4046. question_id int unsigned NOT NULL,
  4047. survey_id int unsigned NOT NULL,
  4048. option_text text NOT NULL,
  4049. sort int NOT NULL,
  4050. value int NOT NULL default '0',
  4051. PRIMARY KEY (question_option_id, c_id)
  4052. );
  4053. CREATE TABLE c_survey_answer (
  4054. answer_id int unsigned NOT NULL auto_increment,
  4055. c_id INT NOT NULL,
  4056. survey_id int unsigned NOT NULL,
  4057. question_id int unsigned NOT NULL,
  4058. option_id TEXT NOT NULL,
  4059. value int unsigned NOT NULL,
  4060. user varchar(250) NOT NULL,
  4061. PRIMARY KEY (answer_id, c_id)
  4062. );
  4063. CREATE TABLE c_survey_group(
  4064. id int unsigned NOT NULL auto_increment,
  4065. c_id INT NOT NULL,
  4066. name varchar(20) NOT NULL,
  4067. description varchar(255) NOT NULL,
  4068. survey_id int unsigned NOT NULL,
  4069. PRIMARY KEY (id, c_id)
  4070. );
  4071. CREATE TABLE c_glossary(
  4072. glossary_id int unsigned NOT NULL auto_increment,
  4073. c_id INT NOT NULL,
  4074. name varchar(255) NOT NULL,
  4075. description text not null,
  4076. display_order int,
  4077. session_id int default 0,
  4078. PRIMARY KEY (glossary_id, c_id)
  4079. );
  4080. ALTER TABLE c_glossary ADD INDEX ( session_id );
  4081. CREATE TABLE c_notebook (
  4082. notebook_id int unsigned NOT NULL auto_increment,
  4083. c_id INT NOT NULL,
  4084. user_id int unsigned NOT NULL,
  4085. course varchar(40) not null,
  4086. session_id int NOT NULL default 0,
  4087. title varchar(255) NOT NULL,
  4088. description text NOT NULL,
  4089. creation_date datetime NOT NULL default '0000-00-00 00:00:00',
  4090. update_date datetime NOT NULL default '0000-00-00 00:00:00',
  4091. status int,
  4092. PRIMARY KEY (notebook_id, c_id)
  4093. );
  4094. CREATE TABLE c_attendance(
  4095. id int NOT NULL auto_increment,
  4096. c_id INT NOT NULL,
  4097. name text NOT NULL,
  4098. description TEXT NULL,
  4099. active tinyint NOT NULL default 1,
  4100. attendance_qualify_title varchar(255) NULL,
  4101. attendance_qualify_max int NOT NULL default 0,
  4102. attendance_weight float(6,2) NOT NULL default '0.0',
  4103. session_id int NOT NULL default 0,
  4104. locked int NOT NULL default 0,
  4105. PRIMARY KEY (id, c_id)
  4106. );
  4107. ALTER TABLE c_attendance ADD INDEX (session_id);
  4108. ALTER TABLE c_attendance ADD INDEX (active);
  4109. CREATE TABLE c_attendance_sheet (
  4110. c_id INT NOT NULL,
  4111. user_id int NOT NULL,
  4112. attendance_calendar_id int NOT NULL,
  4113. presence tinyint NOT NULL DEFAULT 0,
  4114. PRIMARY KEY(c_id, user_id, attendance_calendar_id)
  4115. );
  4116. ALTER TABLE c_attendance_sheet ADD INDEX (presence);
  4117. CREATE TABLE c_attendance_calendar(
  4118. id int NOT NULL auto_increment,
  4119. c_id INT NOT NULL,
  4120. attendance_id int NOT NULL ,
  4121. date_time datetime NOT NULL default '0000-00-00 00:00:00',
  4122. done_attendance tinyint NOT NULL default 0,
  4123. PRIMARY KEY(id, c_id)
  4124. );
  4125. ALTER TABLE c_attendance_calendar ADD INDEX (attendance_id);
  4126. ALTER TABLE c_attendance_calendar ADD INDEX (done_attendance);
  4127. CREATE TABLE c_attendance_result(
  4128. id int NOT NULL auto_increment,
  4129. c_id INT NOT NULL,
  4130. user_id int NOT NULL,
  4131. attendance_id int NOT NULL,
  4132. score int NOT NULL DEFAULT 0,
  4133. PRIMARY KEY (id, c_id)
  4134. );
  4135. ALTER TABLE c_attendance_result ADD INDEX (attendance_id);
  4136. ALTER TABLE c_attendance_result ADD INDEX (user_id);
  4137. CREATE TABLE c_attendance_sheet_log(
  4138. id int NOT NULL auto_increment,
  4139. c_id INT NOT NULL,
  4140. attendance_id int NOT NULL DEFAULT 0,
  4141. lastedit_date datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  4142. lastedit_type varchar(200) NOT NULL,
  4143. lastedit_user_id int NOT NULL DEFAULT 0,
  4144. calendar_date_value datetime NULL,
  4145. PRIMARY KEY (id, c_id)
  4146. );
  4147. CREATE TABLE c_thematic(
  4148. id int NOT NULL auto_increment,
  4149. c_id INT NOT NULL,
  4150. title varchar(255) NOT NULL,
  4151. content text NULL,
  4152. display_order int unsigned NOT NULL DEFAULT 0,
  4153. active tinyint NOT NULL DEFAULT 0,
  4154. session_id int NOT NULL DEFAULT 0,
  4155. PRIMARY KEY (id, c_id)
  4156. );
  4157. ALTER TABLE c_thematic ADD INDEX (active, session_id);
  4158. CREATE TABLE c_thematic_plan(
  4159. id int NOT NULL auto_increment,
  4160. c_id INT NOT NULL,
  4161. thematic_id int NOT NULL,
  4162. title varchar(255) NOT NULL,
  4163. description text NULL,
  4164. description_type int NOT NULL,
  4165. PRIMARY KEY (id, c_id)
  4166. );
  4167. ALTER TABLE c_thematic_plan ADD INDEX (thematic_id, description_type);
  4168. CREATE TABLE c_thematic_advance(
  4169. id int NOT NULL auto_increment,
  4170. c_id INT NOT NULL,
  4171. thematic_id int NOT NULL,
  4172. attendance_id int NOT NULL DEFAULT 0,
  4173. content text NULL,
  4174. start_date datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  4175. duration int NOT NULL DEFAULT 0,
  4176. done_advance tinyint NOT NULL DEFAULT 0,
  4177. PRIMARY KEY (id, c_id)
  4178. );
  4179. ALTER TABLE c_thematic_advance ADD INDEX (thematic_id);
  4180. DROP TABLE IF EXISTS c_student_publication_rel_document;
  4181. CREATE TABLE IF NOT EXISTS c_student_publication_rel_document (id INT PRIMARY KEY NOT NULL AUTO_INCREMENT, work_id INT NOT NULL, document_id INT NOT NULL, c_id INT NOT NULL);
  4182. DROP TABLE IF EXISTS c_student_publication_rel_user;
  4183. CREATE TABLE IF NOT EXISTS c_student_publication_rel_user ( id INT PRIMARY KEY NOT NULL AUTO_INCREMENT, work_id INT NOT NULL, user_id INT NOT NULL, c_id INT NOT NULL);
  4184. DROP TABLE IF EXISTS c_student_publication_comment;
  4185. CREATE TABLE IF NOT EXISTS c_student_publication_comment ( id INT PRIMARY KEY NOT NULL AUTO_INCREMENT, work_id INT NOT NULL, c_id INT NOT NULL, comment text, file VARCHAR(255), user_id int NOT NULL, sent_at datetime NOT NULL);
  4186. DROP TABLE IF EXISTS c_attendance_calendar_rel_group;
  4187. CREATE TABLE c_attendance_calendar_rel_group (
  4188. id int NOT NULL auto_increment PRIMARY KEY,
  4189. c_id INT NOT NULL,
  4190. group_id INT NOT NULL,
  4191. calendar_id INT NOT NULL
  4192. );
  4193. -- Version
  4194. LOCK TABLES settings_current WRITE;
  4195. UPDATE settings_current SET selected_value = '1.10.0.43' WHERE variable = 'chamilo_database_version';
  4196. UNLOCK TABLES;