Question: Can anyone explain how assignments are stored in the database?

Although I am relatively new to Maple, Maple TA and postgreSQL, I am technically literate, but cannot find the answer to this question.  What I would like to do is pull off a SQL query that shows the answers given by all the students to one particular question, say worksheet 7 question 5.

However, a particular question seems to be held in the database as, say, answersheetitem.question=3 and answersheetitem.questiongroup=4, as in my current query, shown here:

****begin sql

select answersheetitem.question, answersheetitem.questiongroup,
answersheetitem_grade.modified,
answersheetitem.questiontype, answersheetitem.id,
answersheetitem_grade.userid,
user_profiles.uid, user_profiles.givenname, user_profiles.sn,
answersheetitem.searchableresponsestring, answersheetitem.serializedresponse, answersheetitem.grade, answersheetitem.comment
from answersheetitem, answersheetitem_grade, user_profiles

where answersheetitem.id=answersheetitem_grade.answersheetitemid
and answersheetitem_grade.userid=user_profiles.id

and answersheetitem.question=3
and answersheetitem.questiongroup=4

****end sql

How and where would I find the ralationship that says worksheet 7 question 5 corresponds to question 3 in questiongroup 4?  Currently I do this by writing a query that pulls out a record with a particular value that I know a student has entered in the field searchableresponsestring, then pick up the values of question and questiongroup from that, but it is less than satisfactory.

Any help appreciated, thanks for reading!

Liz

This has been branched into the following page(s):
Please Wait...