forked from drlippman/IMathAS
-
Notifications
You must be signed in to change notification settings - Fork 1
/
upgrade.txt
731 lines (564 loc) · 27.4 KB
/
upgrade.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
Upgrade Notes
*********************
** IMathAS 1.8 **
*********************
All database changes are now in upgrade.php. Run that file to apply updates
to the database.
SimpleLTI has been deprecated and replaced with BasicLTI. If you have
$enablesimplelti in your config.php, change it to enablebasiclti.
If you do not have either currently in your config.php and want to allow
imathas to act as a BasicLTI producer, add $enablebasiclti = true to config.php
*********************
** IMathAS 1.7 **
*********************
*** Database Changes ***
All database changes are now in upgrade.php. Run that file to apply updates
to the database.
*********************
** IMathAS 1.6 **
*********************
*** config.php changes - Reference config.php.dist for changes. ***
$freetypeinstalled no longer needed - autodetected
Added $enablesimplelti
Added $mathchaturl
*** Loginpage Changes ***
Reference loginpage.php.dist for changes.
*** Database Changes ***
ALTER TABLE `imas_msgs` ADD `parent` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0' ,
ADD `baseid` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0' ;
ALTER TABLE `imas_msgs` ADD INDEX ( `baseid` ) ;
CREATE TABLE `mc_sessions` (
`userid` INT( 10 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`sessionid` VARCHAR( 32 ) NOT NULL ,
`name` VARCHAR( 254 ) NOT NULL ,
`room` INT( 10 ) NOT NULL ,
`lastping` INT( 10 ) UNSIGNED NOT NULL,
`mathdisp` TINYINT( 1 ) NOT NULL ,
`graphdisp` TINYINT( 1 ) NOT NULL,
INDEX ( `sessionid` ), INDEX( `room` ), INDEX( `lastping` )
) TYPE = innodb;
CREATE TABLE `mc_msgs` (
`id` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`userid` INT( 10 ) UNSIGNED NOT NULL ,
`msg` TEXT NOT NULL ,
`time` INT( 10 ) UNSIGNED NOT NULL ,
INDEX ( `userid` ), INDEX ( `time` )
) TYPE = innodb;
ALTER TABLE `imas_courses` ADD `chatset` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `imas_assessments` ADD `ltisecret` VARCHAR( 10 ) NOT NULL ;
ALTER TABLE `imas_courses` ADD `ltisecret` VARCHAR( 10 ) NOT NULL ;
CREATE TABLE `imas_ltiusers` (
`id` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`org` VARCHAR( 32 ) NOT NULL ,
`ltiuserid` VARCHAR( 32 ) NOT NULL ,
`userid` INT( 10 ) UNSIGNED NOT NULL
) TYPE = innodb;
CREATE TABLE `imas_ltiaccess` (
`id` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`password` VARCHAR( 32 ) NOT NULL ,
`userid` INT( 10 ) UNSIGNED NOT NULL ,
`itemid` INT( 10 ) UNSIGNED NOT NULL ,
`itemtype` TINYINT( 1 ) UNSIGNED NOT NULL ,
`created` INT( 10 ) UNSIGNED NOT NULL
) TYPE = innodb;
CREATE TABLE `imas_ltinonces` (
`id` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`nonce` TEXT NOT NULL ,
`time` INT( 10 ) UNSIGNED NOT NULL
) TYPE = innodb;
ALTER TABLE `imas_assessments` CHANGE `timelimit` `timelimit` INT( 10 ) NOT NULL DEFAULT '0' ;
ALTER TABLE `imas_assessment_sessions` ADD `reattempting` VARCHAR( 255 ) NOT NULL ;
ALTER TABLE `imas_assessment_sessions` ADD `reviewreattempting` VARCHAR( 255 ) NOT NULL ;
ALTER TABLE `imas_users` ADD `remoteaccess` VARCHAR( 10 ) NOT NULL ;
ALTER TABLE `imas_diags` ADD `forceregen` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `imas_diags` CHANGE `entryformat` `entryformat` CHAR( 3 ) NOT NULL DEFAULT 'C0' ;
ALTER TABLE `imas_students` ADD `gbinstrcomment` TEXT NOT NULL ;
ALTER TABLE `imas_forums` ADD INDEX ( `grpaid` );
ALTER TABLE `imas_forum_posts` ADD INDEX ( `postdate` );
ALTER TABLE `imas_inlinetext` ADD `oncal` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '0',
ADD `caltag` CHAR( 1 ) NOT NULL DEFAULT '!';
ALTER TABLE `imas_inlinetext` ADD INDEX ( `oncal` ) ;
ALTER TABLE `imas_linkedtext` ADD `oncal` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '0',
ADD `caltag` CHAR( 1 ) NOT NULL DEFAULT '!';
ALTER TABLE `imas_linkedtext` ADD INDEX ( `oncal` ) ;
CREATE TABLE `imas_calitems` (
`id` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`courseid` INT( 10 ) UNSIGNED NOT NULL ,
`date` INT( 10 ) UNSIGNED NOT NULL ,
`title` VARCHAR( 254 ) NOT NULL ,
`tag` CHAR( 1 ) NOT NULL ,
INDEX ( `courseid` ), INDEX(`date`)
) TYPE = innodb COMMENT = 'Calendar Items';
ALTER TABLE `imas_courses` ADD `picicons` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `imas_courses` ADD INDEX ( `name` );
ALTER TABLE `imas_courses` ADD INDEX ( `available` );
ALTER TABLE `imas_assessments` ADD INDEX ( `avail` );
ALTER TABLE `imas_assessments` ADD INDEX ( `reviewdate` ) ;
ALTER TABLE `imas_inlinetext` ADD INDEX ( `avail` ) ;
ALTER TABLE `imas_inlinetext` ADD INDEX ( `startdate` ) ;
ALTER TABLE `imas_inlinetext` ADD INDEX ( `enddate` ) ;
ALTER TABLE `imas_linkedtext` ADD INDEX ( `avail` ) ;
ALTER TABLE `imas_linkedtext` ADD INDEX ( `startdate` );
ALTER TABLE `imas_linkedtext` ADD INDEX ( `enddate` ) ;
ALTER TABLE `imas_forums` ADD INDEX ( `avail` ) ;
ALTER TABLE `imas_forums` ADD INDEX ( `startdate` ) ;
ALTER TABLE `imas_forums` ADD INDEX ( `enddate` ) ;
ALTER TABLE `imas_forums` ADD INDEX ( `replyby` ) ;
ALTER TABLE `imas_forums` ADD INDEX ( `postby` ) ;
*********************
** IMathAS 1.5 **
*********************
*** Database Changes ***
ALTER TABLE `imas_sessions` ADD INDEX ( `time` ) ;
ALTER TABLE `imas_users` ADD INDEX ( `rights` );
ALTER TABLE `imas_grades` CHANGE `score` `score` DECIMAL( 6, 1 ) UNSIGNED NULL DEFAULT '0.0';
ALTER TABLE `imas_students` ADD `lastaccess` INT( 10 ) UNSIGNED NOT NULL ;
UPDATE imas_students,imas_users SET imas_students.lastaccess=imas_users.lastaccess WHERE imas_students.userid=imas_users.id;
ALTER TABLE `imas_gbscheme` CHANGE `defgbmode` `defgbmode` SMALLINT( 4 ) UNSIGNED NOT NULL DEFAULT '21' ;
UPDATE `imas_assessments` SET cntingb =3 WHERE deffeedback LIKE 'Practice%';
ALTER TABLE `imas_assessments` ADD `exceptionpenalty` TINYINT( 2 ) NOT NULL DEFAULT '0';
ALTER TABLE `imas_students` ADD `latepass` TINYINT( 2 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `imas_assessments` ADD `allowlate` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '1';
ALTER TABLE `imas_courses` ADD `latepasshrs` SMALLINT( 4 ) UNSIGNED NOT NULL DEFAULT '24';
ALTER TABLE `imas_questionset` ADD `ancestors` TEXT NOT NULL ;
ALTER TABLE `imas_gbscheme` ADD `usersort` TINYINT( 1 ) NOT NULL DEFAULT '0';
ALTER TABLE `imas_assessments` ADD `groupmax` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '6';
ALTER TABLE `imas_courses` ADD `theme` VARCHAR( 32 ) NOT NULL DEFAULT 'default.css';
UPDATE imas_courses SET msgset=msgset+1 WHERE msgset>1;
ALTER TABLE `imas_questions` ADD `withdrawn` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `imas_inlinetext` ADD `avail` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '1';
ALTER TABLE `imas_assessments` ADD `avail` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '1';
ALTER TABLE `imas_forums` ADD `avail` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '1';
ALTER TABLE `imas_linkedtext` ADD `avail` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '1';
*** Run PHP code after Database Changes ***
<?php
require("validate.php");
$query = "SELECT id,defgbmode FROM imas_gbscheme";
$result = mysql_query($query) or die("Query failed : " . mysql_error());
while (list($id,$gbmodet) = mysql_fetch_row($result)) {
$gbmode = 2;
if (($gbmodet&8)==8) { $gbmode += 1000;}
if (($gbmodet&16)==16) {$gbmode += 20;}
if (($gbmodet&4)==4) {$gbmode -= 1;}
if (($gbmodet&1)==1) {$gbmode += 100;}
$query = "UPDATE imas_gbscheme SET defgbmode='$gbmode' WHERE id='$id'";
mysql_query($query) or die("Query failed : " . mysql_error());
}
echo "DONE";
?>
*********************
** IMathAS 1.4 **
*********************
*** Database Changes ***
ALTER TABLE `imas_diags` ADD `entryformat` VARCHAR( 2 ) NOT NULL DEFAULT 'C0';
ALTER TABLE `imas_users` ADD `deflib` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0',
ADD `usedeflib` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `imas_assessments` ADD `noprint` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `imas_forum_views` ADD `tagged` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `imas_forum_posts` ADD `points` SMALLINT ( 5 ) NULL ;
ALTER TABLE `imas_forums` ADD `points` SMALLINT( 5 ) NOT NULL DEFAULT '0',
ADD `gbcategory` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0';
*********************
** IMathAS 1.3 **
*********************
*** Database Changes ***
#R56
ALTER TABLE `imas_assessment_sessions` ADD `reviewseeds` TEXT NOT NULL ,
ADD `reviewattempts` TEXT NOT NULL ,
ADD `reviewscores` TEXT NOT NULL ,
ADD `reviewlastanswers` TEXT NOT NULL ;
UPDATE imas_assessment_sessions SET reviewseeds=seeds,reviewattempts=attempts,reviewscores=scores,reviewlastanswers=lastanswers;
#R51
ALTER TABLE `imas_users` ADD `qrightsdef` TINYINT( 1 ) NOT NULL DEFAULT '0';
#R41
ALTER TABLE `imas_questions` ADD `regen` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `imas_questions` ADD `showans` VARCHAR( 1 ) NOT NULL DEFAULT '0';
#R36
ALTER TABLE `imas_assessments` ADD `reqscoreaid` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0',
ADD `reqscore` SMALLINT( 4 ) UNSIGNED NOT NULL DEFAULT '0';
UPDATE imas_assessments SET timelimit = timelimit*60 WHERE timelimit>0;
*********************
** IMathAS 1.2 **
*********************
*** Config.php Changes ***
$installname = "Your install name";
$smallheaderlogo = "Text or image tag";
*** Database Changes ***
Required changes.
ALTER TABLE `imas_assessments` ADD `showcat` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `imas_assessments` ADD `isgroup` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `imas_assessments` CHANGE `defpenalty` `defpenalty` VARCHAR( 6 ) NOT NULL DEFAULT '0';
ALTER TABLE `imas_questions` CHANGE `penalty` `penalty` VARCHAR( 6 ) NOT NULL DEFAULT '9999';
ALTER TABLE `imas_assessments` ADD `showhints` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '1' AFTER `showcat` ;
ALTER TABLE `imas_forums` ADD `grpaid` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `imas_assessment_sessions` ADD `agroupid` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `imas_courses` ADD `available` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '0',
ADD `lockaid` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `imas_assessment_sessions` ADD `feedback` TEXT NOT NULL ;
ALTER TABLE `imas_students` ADD `gbcomment` TEXT NOT NULL ;
ALTER TABLE `imas_grades` ADD `feedback` TEXT NOT NULL ;
*********************
** IMathAS 1.1 **
*********************
*** Database Changes ***
Required changes.
ALTER TABLE `imas_assessments` CHANGE `shuffle` `shuffle` TINYINT( 2 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `imas_courses` ADD `blockcnt` INT( 10 ) UNSIGNED NOT NULL DEFAULT '1';
CREATE TABLE `imas_msgs` (
`id` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`courseid` INT( 10 ) UNSIGNED NOT NULL ,
`title` VARCHAR( 254 ) NOT NULL ,
`message` TEXT NOT NULL ,
`msgto` INT( 10 ) NOT NULL ,
`msgfrom` INT( 10 ) NOT NULL ,
`senddate` INT( 10 ) NOT NULL ,
`isread` TINYINT( 1 ) NOT NULL
) TYPE = innodb COMMENT = 'Internal messages';
ALTER TABLE `imas_students` ADD `section` VARCHAR( 10 ) NULL ,
ADD `code` INT( 4 ) UNSIGNED NULL ;
ALTER TABLE `imas_forums` ADD `defdisplay` INT( 1 ) UNSIGNED NOT NULL ,
ADD `replyby` INT( 10 ) UNSIGNED NOT NULL DEFAULT '2000000000',
ADD `postby` INT( 10 ) UNSIGNED NOT NULL DEFAULT '2000000000';
ALTER TABLE `imas_forum_posts` ADD `replyby` INT( 10 ) UNSIGNED NULL ;
CREATE TABLE `imas_forum_subscriptions` (
`id` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`forumid` INT( 10 ) UNSIGNED NOT NULL ,
`userid` INT( 10 ) UNSIGNED NOT NULL ,
INDEX ( `forumid` , `userid` )
) TYPE = innodb COMMENT = 'Forum subscriptions';
CREATE TABLE `imas_gbscheme` (
`id` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`courseid` INT( 10 ) UNSIGNED NOT NULL ,
`useweights` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '0',
`orderby` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '0',
`defaultcat` VARCHAR( 254 ) NOT NULL DEFAULT '0,0,1,0,-1'
) TYPE = innodb COMMENT = 'Gradebook scheme';
ALTER TABLE `imas_assessments` ADD `gbcategory` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0';
CREATE TABLE `imas_gbitems` (
`id` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`courseid` INT( 10 ) UNSIGNED NOT NULL ,
`name` VARCHAR( 50 ) NOT NULL ,
`points` SMALLINT( 4 ) NOT NULL DEFAULT '0',
`showdate` INT( 10 ) UNSIGNED NOT NULL ,
`gbcategory` INT( 10 ) UNSIGNED NOT NULL ,
INDEX ( `courseid` , `showdate` )
) TYPE = innodb COMMENT = 'Gradebook offline items';
CREATE TABLE `imas_grades` (
`id` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`gbitemid` INT( 10 ) UNSIGNED NOT NULL ,
`userid` INT( 10 ) UNSIGNED NOT NULL ,
`score` DECIMAL( 6, 1 ) UNSIGNED NOT NULL ,
INDEX ( `userid` )
) TYPE = innodb COMMENT = 'Offline grades';
CREATE TABLE `imas_gbcats` (
`id` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`name` VARCHAR( 50 ) NOT NULL ,
`courseid` INT( 10 ) UNSIGNED NOT NULL ,
`scale` SMALLINT( 4 ) UNSIGNED NOT NULL DEFAULT '0',
`scaletype` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '0',
`chop` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '1',
`dropn` TINYINT( 2 ) NOT NULL DEFAULT '0',
`weight` SMALLINT( 4 ) NOT NULL DEFAULT '-1',
INDEX ( `courseid` )
) TYPE = innodb COMMENT = 'Gradebook Categories';
ALTER TABLE `imas_assessments` ADD `password` VARCHAR( 15 ) NOT NULL ;
ALTER TABLE `imas_users` ADD `msgnotify` TINYINT( 1 ) NOT NULL DEFAULT '0';
ALTER TABLE `imas_forums` CHANGE `description` `description` TEXT NOT NULL;
ALTER TABLE `imas_courses` ADD `msgset` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `imas_gbscheme` ADD `defgbmode` TINYINT( 2 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `imas_assessments` ADD `cntingb` TINYINT( 1 ) NOT NULL DEFAULT '1';
ALTER TABLE `imas_gbitems` ADD `cntingb` TINYINT( 1 ) NOT NULL DEFAULT '1';
ALTER TABLE `imas_courses` ADD `topbar` VARCHAR( 32 ) NOT NULL DEFAULT '|';
UPDATE imas_forums SET replyby=0 WHERE settings=2 OR settings=3;
UPDATE imas_forums SET settings=3 WHERE settings=1;
UPDATE imas_forums SET settings=2 WHERE settings=0;
ALTER TABLE `imas_msgs` ADD INDEX ( `msgto` );
ALTER TABLE `imas_msgs` ADD INDEX ( `isread` );
ALTER TABLE `imas_exceptions` ADD INDEX ( `assessmentid` );
ALTER TABLE `imas_items` ADD INDEX ( `typeid` ) ;
ALTER TABLE `imas_items` ADD INDEX ( `itemtype` );
ALTER TABLE `imas_assessments` ADD INDEX ( `startdate` );
ALTER TABLE `imas_assessments` ADD INDEX ( `enddate` ) ;
ALTER TABLE `imas_forum_posts` ADD INDEX ( `threadid` ) ;
ALTER TABLE `imas_forum_views` ADD INDEX ( `threadid` ) ;
ALTER TABLE `imas_assessment_sessions` ADD INDEX ( `assessmentid` );
ALTER TABLE `imas_assessments` ADD INDEX ( `cntingb` );
ALTER TABLE `imas_courses` ADD INDEX ( `ownerid` );
ALTER TABLE `imas_diags` ADD INDEX (`cid`);
ALTER TABLE `imas_grades` ADD INDEX ( `gbitemid` );
ALTER TABLE `imas_assessments` ADD `minscore` SMALLINT( 4 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `imas_courses` ADD `cploc` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `imas_gbscheme` ADD INDEX ( `courseid` )
ALTER TABLE `imas_assessments` CHANGE `defpoints` `defpoints` SMALLINT( 4 ) UNSIGNED NOT NULL DEFAULT '10',
CHANGE `defattempts` `defattempts` SMALLINT( 4 ) UNSIGNED NOT NULL DEFAULT '1';
ALTER TABLE `imas_courses` CHANGE `hideicons` `hideicons` TINYINT( 2 ) UNSIGNED NOT NULL DEFAULT '0',
CHANGE `allowunenroll` `allowunenroll` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '0',
CHANGE `copyrights` `copyrights` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `imas_diags` CHANGE `public` `public` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '1';
ALTER TABLE `imas_forum_posts` CHANGE `posttype` `posttype` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '0',
CHANGE `isanon` `isanon` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `imas_forums` CHANGE `settings` `settings` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '0',
CHANGE `defdisplay` `defdisplay` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `imas_libraries` CHANGE `userights` `userights` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '8';
ALTER TABLE `imas_msgs` CHANGE `isread` `isread` TINYINT( 1 ) NOT NULL DEFAULT '0';
ALTER TABLE `imas_questions` CHANGE `points` `points` SMALLINT( 4 ) UNSIGNED NOT NULL DEFAULT '9999',
CHANGE `attempts` `attempts` SMALLINT( 4 ) UNSIGNED NOT NULL DEFAULT '9999';
ALTER TABLE `imas_questionset` CHANGE `userights` `userights` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '2',
CHANGE `hasimg` `hasimg` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `imas_sessions` CHANGE `tzoffset` `tzoffset` SMALLINT( 4 ) NOT NULL DEFAULT '0';
ALTER TABLE `imas_students` CHANGE `code` `code` SMALLINT( 4 ) UNSIGNED NULL DEFAULT NULL ;
ALTER TABLE `imas_users` CHANGE `rights` `rights` SMALLINT( 4 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `imas_msgs` ADD `replied` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '0';
Use the code block below to update your existing courses to the new block format.
<?php
require("validate.php");
$query = "SELECT id,itemorder,blockcnt FROM imas_courses";
$result = mysql_query($query) or die("Query failed : " . mysql_error());
while ($row = mysql_fetch_row($result)) {
$blockcnt = $row[2];
$newarray = array();
$items = explode(',',$row[1]);
foreach ($items as $item) {
if (strpos($item,'~')===FALSE) {
$newarray[] = $item;
} else {
$sub = explode('~',$item);
$newblock = array();
$newblock['name'] = $sub[0];
$newblock['id'] = $blockcnt;
$blockcnt++;
$newblock['startdate'] = $sub[1];
$newblock['enddate'] = $sub[2];
$newblock['SH'] = $sub[3];
for ($i=4;$i<count($sub);$i++) {
$newblock['items'][] = $sub[$i];
}
$newarray[] = $newblock;
}
}
$newitemorder = addslashes(serialize($newarray));
$query = "UPDATE imas_courses SET itemorder='$newitemorder',blockcnt='$blockcnt' WHERE id='{$row[0]}'";
mysql_query($query) or die("Query failed : " . mysql_error());
}
echo "Done";
?>
*********************
** IMathAS 1.0 **
*********************
Create subdirectory "qimages" in "assessment" directory. Set permissions to
allow server to write to this directory.
*** Database Changes ***
Required changes.
CREATE TABLE `imas_qimages` (
`id` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`qsetid` INT( 10 ) UNSIGNED NOT NULL ,
`var` VARCHAR( 50 ) NOT NULL ,
`filename` VARCHAR( 100 ) NOT NULL ,
`alttext` VARCHAR( 254 ) NOT NULL ,
INDEX ( `qsetid` )
);
ALTER TABLE `imas_questionset` ADD `hasimg` INT( 1 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `imas_forum_posts` ADD `isanon` INT( 1 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `imas_forums` ADD `settings` INT( 1 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `imas_courses` ADD `hideicons` INT( 2 ) UNSIGNED NOT NULL DEFAULT '0';
CREATE TABLE `imas_instr_files` (
`id` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`description` VARCHAR( 254 ) NOT NULL ,
`filename` VARCHAR( 100 ) NOT NULL ,
`itemid` INT( 10 ) UNSIGNED NOT NULL ,
INDEX ( `itemid` )
) TYPE = innodb;
ALTER TABLE `imas_inlinetext` ADD `fileorder` TEXT NOT NULL ;
ALTER TABLE `imas_courses` ADD `allowunenroll` INT( 1 ) UNSIGNED NOT NULL DEFAULT '0',
ADD `copyrights` INT( 1 ) UNSIGNED NOT NULL DEFAULT '0';
*********************
** IMathAS 1.0RC1 **
*********************
*** Database Changes ***
Required changes.
ALTER TABLE `imas_assessment_sessions`
ADD `bestseeds` TEXT NOT NULL ,
ADD `bestattempts` TEXT NOT NULL ,
ADD `bestscores` TEXT NOT NULL ,
ADD `bestlastanswers` TEXT NOT NULL ;
ALTER TABLE `imas_assessments` ADD `reviewdate` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0' AFTER `enddate` ;
UPDATE `imas_assessment_sessions` SET bestseeds=seeds,bestattempts=attempts,bestscores=scores,bestlastanswers=lastanswers;
ALTER TABLE `imas_assessments` CHANGE `defpenalty` `defpenalty` VARCHAR( 5 ) NOT NULL DEFAULT '0';
ALTER TABLE `imas_questions` CHANGE `penalty` `penalty` VARCHAR( 5 ) NOT NULL DEFAULT '9999';
*********************
** IMathAS 1beta16 **
*********************
*** Database Changes ***
Required change.
CREATE TABLE `imas_diags` (
`id` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`ownerid` INT( 10 ) UNSIGNED NOT NULL ,
`name` VARCHAR( 254 ) NOT NULL ,
`term` VARCHAR( 10 ) NOT NULL ,
`public` INT( 1 ) UNSIGNED NOT NULL DEFAULT '1',
`cid` INT( 10 ) UNSIGNED NOT NULL ,
`idprompt` VARCHAR( 254 ) NOT NULL ,
`ips` TEXT NOT NULL ,
`pws` TEXT NOT NULL ,
`sel1name` VARCHAR( 254 ) NOT NULL ,
`sel1list` TEXT NOT NULL ,
`aidlist` TEXT NOT NULL ,
`sel2name` VARCHAR( 254 ) NOT NULL ,
`sel2list` TEXT NOT NULL ,
INDEX ( `ownerid` , `public` )
) TYPE = innodb;
*********************
** IMathAS 1beta15 **
*********************
*** Database Changes ***
None
*** config.php Changes ***
//absolute path or full url to Mimetex CGI, for math image fallback
//if you do not have a local install, feel free to use:
// $mathimgurl = "http://www.imathas.com/cgi-bin/mimetex.cgi"
$mathimgurl = "/mimetex/mimetex.exe";
//set to true if you have FreeType library installed
$freetypeinstalled = true;
*********************
** IMathAS 1beta14 **
*********************
CourseCreator rights level was removed. Any existing CourseCreators need to have
rights reassigned before upgrading.
*** Database Changes ***
Required changes.
CREATE TABLE `imas_groups` (
`id` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`name` VARCHAR( 255 ) NOT NULL
);
ALTER TABLE `imas_users` ADD `groupid` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `imas_libraries` ADD `groupid` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `imas_libraries` CHANGE `userights` `userights` INT( 1 ) UNSIGNED NOT NULL DEFAULT '8';
UPDATE `imas_libraries` SET userights=8 WHERE userights=2;
UPDATE `imas_libraries` SET userights=4 WHERE userights=1;
ALTER TABLE `imas_questions` ADD `category` VARCHAR( 255 ) NOT NULL DEFAULT '0';
*** Config.php Changes ***
Required changes. Add to config.php:
//should non-admins be allowed to create new non-group libraries?
//on a single-school install, set to true; for larger installs that plan to
//use the Groups features, set to false
$allownongrouplibs = false;
//should anyone be allowed to import/export questions and libraries from the
//course page? Intended for easy sharing between systems, but the course page
//is cleaner if turned off.
$allowcourseimport = false;
*********************
** IMathAS 1beta13 **
*********************
*** Database Changes ***
Required changes.
ALTER TABLE `imas_sessions` ADD `sessiondata` TEXT NOT NULL ;
*********************
** IMathAS 1beta12 **
*********************
*** Database Changes ***
Recommended changes (to allow assessments with more than ~50 questions)
ALTER TABLE `imas_assessment_sessions` CHANGE `scores` `scores` TEXT NOT NULL;
ALTER TABLE `imas_assessment_sessions` CHANGE `questions` `questions` TEXT NOT NULL;
Required changes.
ALTER TABLE `imas_library_items` ADD `ownerid` INT( 10 ) UNSIGNED NOT NULL;
if you have existing questions, use this to assign owners to the library assignments:
(cut and paste into a .php file, put in main imathas directory, and run it)
<?php
require("validate.php");
$query = "SELECT id,ownerid FROM imas_questionset";
$result = mysql_query($query) or die("Query failed : " . mysql_error());
while ($row = mysql_fetch_row($result)) {
$query = "UPDATE imas_library_items SET ownerid='{$row[1]}' WHERE qsetid='{$row[0]}'";
mysql_query($query) or die("Query failed : " . mysql_error());
}
echo "DONE";
?>
*********************
** IMathAS 1beta11 **
*********************
No changes required
*********************
** IMathAS 1beta10 **
*********************
*** Database Changes ***
Required changes.
ALTER TABLE `imas_users` ADD `lastaccess` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `imas_users` ADD INDEX ( `lastaccess` ) ;
ALTER TABLE `imas_questionset` ADD `uniqueid` BIGINT( 16 ) UNSIGNED NOT NULL AFTER `id` ;
ALTER TABLE `imas_libraries` ADD `uniqueid` BIGINT( 16 ) UNSIGNED NOT NULL AFTER `id` ;
ALTER TABLE `imas_questionset` ADD `adddate` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0' AFTER `uniqueid` ,
ADD `lastmoddate` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0' AFTER `adddate` ;
ALTER TABLE `imas_libraries` ADD `adddate` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0' AFTER `uniqueid` ,
ADD `lastmoddate` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0' AFTER `adddate` ;
if you have existing questions/libraries you wish to assign unique ids to, use this:
(cut and paste into a .php file, put in main imathas directory, and run it)
<?php
require("validate.php");
$query = "SELECT id FROM imas_questionset";
$result = mysql_query($query) or die("Query failed : " . mysql_error());
$mt = microtime();
$now = time();
while ($row = mysql_fetch_row($result)) {
$uid = substr($mt,11).substr($mt,2,2).$row[0];
$query = "UPDATE imas_questionset SET uniqueid=$uid,adddate=$now,lastmoddate=$now WHERE id={$row[0]}";
mysql_query($query) or die("Query failed : " . mysql_error());
}
$query = "SELECT id FROM imas_libraries";
$result = mysql_query($query) or die("Query failed : " . mysql_error());
$mt = microtime();
while ($row = mysql_fetch_row($result)) {
$uid = substr($mt,11).substr($mt,2,2).$row[0];
$query = "UPDATE imas_libraries SET uniqueid=$uid,adddate=$now,lastmoddate=$now WHERE id={$row[0]}";
mysql_query($query) or die("Query failed : " . mysql_error());
}
?>
*** Config.php changes ***
Added $sessionpath. No change required if things are working fine already.
********************
** IMathAS 1beta9 **
********************
*** Database Changes ****
First change is required. New tables are needed if you want to use forums.
ALTER TABLE `imas_sessions` ADD `tzoffset` INT( 4 ) NOT NULL DEFAULT '0';
CREATE TABLE `imas_forums` (
`id` int(10) unsigned NOT NULL auto_increment,
`name` varchar(50) NOT NULL default '',
`description` varchar(254) NOT NULL default '',
`courseid` int(10) unsigned NOT NULL default '0',
`startdate` int(10) unsigned NOT NULL default '0',
`enddate` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`id`),
KEY `courseid` (`courseid`)
);
CREATE TABLE `imas_forum_views` (
`id` int(10) unsigned NOT NULL auto_increment,
`userid` int(10) unsigned NOT NULL default '0',
`threadid` int(10) unsigned NOT NULL default '0',
`lastview` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`id`),
KEY `userid` (`userid`,`threadid`)
);
CREATE TABLE `imas_forum_posts` (
`id` int(10) unsigned NOT NULL auto_increment,
`forumid` int(10) unsigned NOT NULL default '0',
`threadid` int(10) NOT NULL default '0',
`userid` int(10) unsigned NOT NULL default '0',
`postdate` int(10) unsigned NOT NULL default '0',
`views` int(10) unsigned NOT NULL default '0',
`parent` int(10) unsigned NOT NULL default '0',
`posttype` int(1) unsigned NOT NULL default '0',
`subject` varchar(100) NOT NULL default '',
`message` text NOT NULL,
PRIMARY KEY (`id`),
KEY `forumid` (`forumid`)
);
*** Config.php changes *** (not required)
Remove $TZ setting, and "if (isset($TZ)) {putenv("TZ=$TZ");}" line.
Generalized database name. No changed needed for existing installs.
********************
** IMathAS 1beta8 **
********************
*** Database changes: (required, backwards compatible) ***
ALTER TABLE `imas_libraries` ADD `parent` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `imas_questionset` ADD `author` VARCHAR( 254 ) NOT NULL DEFAULT 'unknown' AFTER `ownerid` ;
*** No changes to config.php ***