Who ever it was that originally wrote the CMIS Facility Admin / ePortal database must have only completed half (no maybe a quarter) of the Basic SQL database course and they also had probably never heard of Codd’s Law. There are so many issues with the way that the CMIS database is construced with repeating data in many different places, it is amazing that it works as well as it does. And on the whole – it does work well.
It is obvious to me that much of the data processing done within Facility Admin is done progromatically at the application level with very little actually being done on the SQL Server. I suspect that the situation will remain this way for a considerable amount of time to come.
This blog covers the process of extracting Assessment data from the CMIS database. It involves querying the following tables:-
- NSTURESULTS
- CRITERIA
- ASSESSCRITERIA
- CRITERVALUES
- STURESCOMM
Any assessment data entered through ePortal is eventually storred in NSTURESULTS (table description)
[SetId] [varchar](10)
[StudentId] [varchar](10)
[RecordNum] [int] NULL,
[ExamId] [varchar](10)
[GroupId] [int] NULL,
[AssessId] [varchar](10)
[DeptId] [varchar](10)
[ModuleId] [varchar](10)
[LineNum] [int] NULL,
[CriteriaData] [varchar](40)
[CommentId] [int] NULL,
[StudyLevel] [varchar](10)
[ModuleUnit] [varchar](10)
[RefItemId] [varchar](10)
[CourseId] [varchar](10)
[CrsYear] [int] NULL,
[InstId] [int] NULL,
[SemId] [int] NULL,
[QualUnitId] [int] NULL,
[ACKey] [varchar](43)
[ACUser] [varchar](40)
[DateChanged] [varchar](12)
[SemRank] [int] NULL
The important columns here are the first 10.
SetId, StudentId, RecordNum, ExamId, GroupId, AssessId, DeptId, ModuleId, LineNum, CriteriaData
Any Assessment data entered through ePortal adds a minimum of 1 (one) row to this table with entries in the above 10 columns.
The SetId, StudentId, ExamId, GroupId, AssessId, DeptId and ModuleId are straight forward entries and need little explanation. The CriteriaData and LineNum entries need some explanation.
Assessment data is storred in the CriteriaData column in two values separated by a char(10) - carriage return . The first value is the MapValue of the Criteria as taken from the Assesscriteria table (table description)
[AssessId] [varchar](10)
[CriterId] [varchar](10)
[OrderNum] [int] NULL,
[MapValue] [int] NULL,
[CritLabel] [varchar](10)
[ModuleUnit] [varchar](10)
[CritArray] [char](1)
[FixedSize] [int] NULL,
[ItemNum] [int] NULL,
[CriterType] [varchar](1)
[Expr] [varchar](50)
[LowerLimit] [int] NULL,
[UpperLimit] [int] NULL,
[AllComponents] [char](1)
[CritStatus] [int] NULL,
[AssElemId] [int] NULL,
[ForGPA] [int] NULL,
[CriteriaType] [varchar](10)
[NeedAllForCalc] [char](1)
[AssignMax] [char](1)
[CWeighting] [float] NULL,
[LogChanges] [char](1)
[LogStartDate] [varchar](8)
[CritComp] [varchar](10)
[LinkLabel] [varchar](10)
Using this value the CritLabel can be identified. The second value of the pair relates to the actual data being storred. This can be one of several types and will result in the actual data being entered into the NSTURESULTS-CriteriaData column or as a key to another table where the data is storred as is the case with Comments which are storred in the STURESCOMM table (table description)
[SetId] [varchar](10)
[StudentId] [varchar](10)
[CommentId] [int] NULL,
[LineNum] [int] NULL,
[CommData] [varchar](80)
How you identify how the data is storred is by looking at the CriterType value in the Criteria table (table description)
[CriterId] [varchar](10)
[ItemNum] [int] NULL,
[Name] [varchar](30)
[CriterType] [varchar](1)
[LowerLimit] [int] NULL,
[UpperLimit] [int] NULL,
[CriterLabel] [varchar](10)
[Expr] [varchar](50)
[CritStatus] [int] NULL,
[AssElemId] [int] NULL,
[ForGPA] [int] NULL,
[ModuleUnit] [varchar](10)
[CriteriaType] [varchar](10)
[NeedAllForCalc] [char](1)
[AssignMax] [char](1)
[CWeighting] [float] NULL,
[LogChanges] [char](1)
[LogStartDate] [varchar](8)
[CritComp] [varchar](10)
[DeptId] [varchar](10)
[LinkLabel] [varchar](10)
[Disabled] [char](1)
If the CriterType is a ’5′ then the value storred as the second value of the data pair in the NSTURESULTS table will refer to the CommentId in the STURESCOM table, which if the Comment length is greater than 80 characters will also require merging all rows with the same CommentId, ordered by LineNum.
If necessary once the the CriteriaId has been identified, the CriteriaValues table (description below) can also be queried to return the CriterCode or CriterValue values depending upon requirement.
[CriterId] [varchar](10)
[ValueNum] [int] NULL,
[ItemNum] [int] NULL,
[CriterCode] [varchar](10)
[CriterValue] [varchar](100)
[AssessId] [varchar](10)
[CritLabel] [varchar](10)
[GradePoints] [float] NULL,
[GradePtsPre04] [float] NULL
This is part one of a series of Blogs which explains how to work with this data. Part two will go on to explain how to use SQL to extract information and also how to merge multiple rown into a single value, which is necessary reconstitute the CriteriaData into a single stream of data.
I