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
I'm going on the assumption
I'm going on the assumption that 'worksheet' really means Question Bank and that you are trying to find the results for a particular Question in one of your Question Banks.
In the answwersheetitem table, there are a number of ways of referencing questions.
questionindex represents the order that the quesitons were given for an instance of an assignment.
questiongroup and questionref combine to reference a question within an assignment.
topic and question combine to reference a question held in a Question Bank. tblocation points to the .qu file that holds the question. Whenever you edit a Question Bank, a new .qu file is created with a version number. This allows one to look-up instances of a question that was taken prior to that question being changed.
so an answersheetitem row like the following
tblocation: classstem\Local_Tests\Bank001.qu
topic: 1
question: 4
questiongroup: 1
questionref: 2
questionindex 3
assignementid: x
means:
This was the third question that the student saw when they took the test.
The question belongs to the 2nd questiongroup in the assignment (0-indexed) and it was the 3rd question in that group (0-indexed)
The actual quesiton is the 5th question in the 2nd topic of the Question Bank corresponding to the bank at the loation given in tblocation
Suppose you know the topic and number of a Question in a Question Bank and also know which .qu files represenf that bank (banks are indexed based on the last 3 digits of the file name - 000, 001, 002 etc)
let's say the question is the first question in the first topic of the bank represented by Bank002.qu
you could find all of the grades for that question by querying with the where condition:
topic=0 and question=0 and tblocation like 'your_stem\Local_Tests\Bank%.qu'.
This clause could also be used to find the corresponding question group and question ref for assignments.
I hope this sheds some light on how answersheetitems represent their data.
Jason Cornish
Developer, Maple T.A.
Update in v5.0?
Actually by 'worksheet', I meant 'assignment', which adds a step to your explanation, which was still very helpful! However (given the time that has passed), I wondered if any changes have been introduced in version 5 of Maple TA? We upgraded in September, and when I look in the field answersheetitem.tblocation now, it only seems to contain the string 'db'.
Does this mean (oh joy!) that the question banks are now held in the database, and can be linked in to my sql queries?
Any details appreciated.
Regards,
Liz
abstracting student answers from database
Can anyone please explain how to abstract all student responses to a particular assignment or question eg. text response to an essay type question? I appreciate that this is not possible simply using TA but, with access to the server folders and postgrel, is there a fairly simple recipe for someone unfamiliar with querying databases?
Many thanks
The Item Statistics section
The Item Statistics section of the Gradebook allows you to view all of the responses to an essay Questions
Viewing all reponses for a Question of another type requires querying the database. Exactly what query to use depens on exactly what you are after.
Assuming that you are after the responses to a Question in a Question Bank. The easiest way (assuming you know the topic, question and tblocation) would be
select searchableresponse from answersheetitem where topic=XX and question=YY and tblocation like 'your_stem\Local_Tests\Bank%.qu'
Jason Cornish
Developer, Maple T.A.
Many thanks, Jason. Hadn't
Many thanks, Jason. Hadn't picked up the point about the item stats and essay questions