INSERT INTO SAM_TYPE_T (TYPEID,AUTHORITY,DOMAIN, KEYWORD, 
	DESCRIPTION,  
	STATUS, CREATEDBY, CREATEDDATE, LASTMODIFIEDBY, 
	LASTMODIFIEDDATE ) 
	VALUES (13 , 'stanford.edu' ,'assessment.item' ,'Matrix Choices Survey' ,NULL ,1 ,1 ,
	'2010-01-01 12:00:00',1 ,'2010-01-01 12:00:00');
	
-- SAM-1255 	
Update SAM_ASSESSEVALUATION_T 
Set ANONYMOUSGRADING = 2
WHERE ASSESSMENTID = (Select ID from SAM_ASSESSMENTBASE_T where TITLE='Default Assessment Type' AND TYPEID='142' AND ISTEMPLATE=1);

-- SAM-1205
INSERT INTO SAM_ASSESSMETADATA_T (ASSESSMENTMETADATAID, ASSESSMENTID, LABEL,
    ENTRY)
    VALUES(NULL, 1, 'lockedBrowser_isInstructorEditable', 'true')
;

INSERT INTO SAM_ASSESSMETADATA_T (ASSESSMENTMETADATAID, ASSESSMENTID, LABEL,
    ENTRY)
    VALUES(NULL, (SELECT ID FROM SAM_ASSESSMENTBASE_T WHERE TITLE='Test'
     AND TYPEID='142' AND ISTEMPLATE=1),
      'lockedBrowser_isInstructorEditable', 'true')
;

INSERT INTO SAM_ASSESSMETADATA_T (ASSESSMENTMETADATAID, ASSESSMENTID, LABEL,
    ENTRY)
    VALUES(NULL, (SELECT ID FROM SAM_ASSESSMENTBASE_T WHERE TITLE='Timed Test'
     AND TYPEID='142' AND ISTEMPLATE=1),
      'lockedBrowser_isInstructorEditable', 'true')
;

-- SAK-17243
alter table SAM_ATTACHMENT_T add ITEMTEXTID bigint(20) DEFAULT NULL;
alter table SAM_ITEMTEXT_T add REQUIRED_OPTIONS_COUNT int(11) DEFAULT NULL;
alter table SAM_ITEM_T add ANSWER_OPTIONS_RICH_COUNT int(11) DEFAULT NULL;
alter table SAM_ITEM_T add ANSWER_OPTIONS_SIMPLE_OR_RICH int(11) DEFAULT NULL;

create index SAM_ATTACH_ITEMTEXTID_I ON SAM_ATTACHMENT_T (ITEMTEXTID);
alter table SAM_ATTACHMENT_T add CONSTRAINT FOREIGN KEY (ITEMTEXTID) REFERENCES SAM_ITEMTEXT_T (ITEMTEXTID);

alter table SAM_PUBLISHEDATTACHMENT_T add ITEMTEXTID bigint(20) DEFAULT NULL;
alter table SAM_PUBLISHEDITEMTEXT_T add REQUIRED_OPTIONS_COUNT int(11) DEFAULT NULL;
alter table SAM_PUBLISHEDITEM_T add ANSWER_OPTIONS_RICH_COUNT int(11) DEFAULT NULL;
alter table SAM_PUBLISHEDITEM_T add ANSWER_OPTIONS_SIMPLE_OR_RICH int(11) DEFAULT NULL;

create index SAM_PUBATTACH_ITEMTEXTID_I ON SAM_PUBLISHEDATTACHMENT_T (ITEMTEXTID);
alter table SAM_PUBLISHEDATTACHMENT_T add CONSTRAINT FOREIGN KEY (ITEMTEXTID) REFERENCES SAM_PUBLISHEDITEMTEXT_T (ITEMTEXTID);

INSERT INTO SAM_TYPE_T (TYPEID ,AUTHORITY ,DOMAIN, KEYWORD, DESCRIPTION,
    STATUS, CREATEDBY, CREATEDDATE, LASTMODIFIEDBY, LASTMODIFIEDDATE )
    VALUES (14 , 'stanford.edu' ,'assessment.item' ,'Extended Matching Items' ,NULL ,1 ,1 ,
    '2009-11-23 12:00:00',1 ,'2009-11-23 12:00:00');