Overview

The schema for the entities that actually collect, store and retrieve Assesment data parallels the hierarchical structure of the Metadata Data Model. In the antecedent "complex survey" and "questionnaire" systems, this schema was simple two-level structure:

This suffices for one-shot surveys but doesn't support the fine granularity of user-action tracking, "save&resume" capabilities, and other requirements identified for the enhanced Assessment package. Consequently, we use a more extended hierarchy:

To support user modification of submitted data (of which "store&resume" is a special case), we base all these entities in the CR. In fact, we use both cr_items and cr_revisions in our schema, since for any given user's Assessment submission, there indeed is a "final" or "live" version. In contrast, recall that for any Assessment itself, different authors may be using different versions of the Assessment. While this situation may be unusual, the fact that it must be supported means that the semantics of cr_items don't fit the Assessment itself. They do fit the semantics of a given user's Assessment "session" however.

We distinguish here between "subjects" which are users whose information is the primary source of the Assessment's responses, and "users" which are real OpenACS users who can log into the system. Subjects may be completing the Assessment themselves or may have completed some paper form that is being transcribed by staff people who are users. We thus account for both the "real" and one or more "proxy" respondents via this mechanism. Note that subjects may or may not be OpenACS users who can log into the system running Assessment. Thus subject_id will be a foreign key to persons not users. If the responding user is completing the assessment for herself, the staff_id will be identical to the subject_id. But if the user completing the assessment is doing it by proxy for the "real" subject, then the staff_id will be hers while the subject_id will belong to the "real" subject.

We've simplified this subsection of Assessment considerably from earlier versions, and here is how and why:

While this doesn't impact the datamodel structure of this data collection subsystem per se, we do add an important innovation to Assessment that wasn't used in "complex survey" or questionnaire. When a user initiates an Assessment Session (either by requesting the assessment form to complete herself -- such as in an online survey -- or by an admin user "assigning" the assessment to be performed by -- or about -- a subject at some point in the future), an entire set of Assessment data collection objects is created (literally, rows are inserted into all the relevant tables -- as_section_data, as_item_data). Since these are CR-based entities, this means that a cr_item and the initial cr_revision record are created for each of these entities. Then when the user submits a form containing responses to one or more items in the assessment, the database action consists of updates in the CR, not insertions. This contrasts to the existing "survey" packages, in which "survey_response" or "survey_question_response" rows are only inserted once the user submits the html form.

Why is this a good idea? Here's the use case: for an educational course, a teacher plans a set of six exams that the students can complete at their own rate. The teacher wants Assessment to tell her at any moment the status -- at the individual item level -- the status of each student's progress through the exam series. In fact, the UI to do this should create a grid consisting of columns corresponding to the exams (and the individual exam questions in a drill-down) and rows consisting of each student. Each cell in this grid will be colored red if the item is unanswered, yellow if answered but not "confirmed" (ie the student has "saved&resumed" the exam and wants to revise it further), and green if "confirmed" ie "handed in".

If the data collection subsystem doesn't create a set of "empty" records, the only way that procedurally this kind of report can be generated is by repeatedly looping through the assessment's metadata and looking for the existence or nonexistence of corresponding records in the data collection entities for each of the students. This is the way the current survey and questionnaire packages have had to do it; it is ugly, error prone, and inefficient. We need to do it differently in Assessment!

Synopsis of Data-Collection Datamodel

Here's the schema for this subsystem:

Source Graffle file

Data Model

Specific Entities

This section addresses the attributes the most important entities have in the data-collection data model -- principally the various design issues and choices we've made. We omit here literal SQL snippets since that's what the web interface to CVS is for. ;-)