Assignment ID numbers don't match with database contents ?

Assignment ID numbers don't match with database contents ?

Stephen Digby發表於
Number of replies: 8
On my browser it reads:
http://infonet.cheltsec.vic.edu.au/mod/assignment/view.php?id=256

But when I go to mdl_assignment table, there is no such ID
I fnd the assignment and it has ID 89

When I check the mdl_assignment_submissions table the entry is there referring to ID 89

Where does the 256 come from.  It si stable everytime I go to the assignment (i.e. NOT a session number) ???

I need to easily identify, the assignments by number so that I can extract summarys of assignments directly from the database.

Anyone know anything ???

評比平均分數: -
In reply to Stephen Digby

Re: Assignment ID numbers don't match with database contents ?

Jan Dierckx發表於

The id=256 refers to the id field of the table course_modules.

In this table you will find a module number and an instance field.

All of the assignments have the same module number. I can't tell you upfront which number this is. It could differ from installation to installation.

The instance field has the number you want: 89. You can use this number to look up student submissions in the assignment_submissions table. The instance number refers to the id in this table.

HTH

評比平均分數:Useful (1)
In reply to Jan Dierckx

Re: Assignment ID numbers don't match with database contents ?

Martin Dougiamas發表於
Core developers的相片 Documentation writers的相片 Moodle HQ的相片 Particularly helpful Moodlers的相片 Plugin developers的相片 Testers的相片
If you just go to the Assignment index page for that course, then all the links there should use the other format of a=xx (this is the actual assignment id). The view.php of most modules can take either the course module id or the module's actual id.
In reply to Martin Dougiamas

Re: Assignment ID numbers don't match with database contents ?

Stephen Digby發表於
On the assignment index page the link to this assignment is:
http://infonet.cheltsec.vic.edu.au/mod/assignment/view.php?id=256

The view all assignments link is:
http://infonet.cheltsec.vic.edu.au/mod/assignment/submissions.php?id=256

Yet when I insert some unique data in an assignment and search the SQL database, the assignment id is 34 ???

mdl_assignment_submissions mdl_assignment_submissions id assignment userid timecreated timemodified numfiles data1 data2 grade comment format teacher timemarked mailed 9 34 6 1130154553 1146716263 0

This is my ideaskjasdflkja sdflkja lsdf

1 0
1 0 0 0
Could this be realted to the fact that I have backed up and restored thsi course ... and the old assignment id's are somehow being translated to the new assignments id's ??
I was looking for a lookup table or something.

(PS thanks for taking the time to reply. I don't know how you do it all at once....)
In reply to Stephen Digby

Re: Assignment ID numbers don't match with database contents ?

Stephen Digby發表於
Problems solved.... I think.
In reply to Stephen Digby

Re: Assignment ID numbers don't match with database contents ?

Sarah Dutcher發表於
Hi Stephen,
I know this is an OLD post, but my assignment IDs don't match up with the folder numbers in moddata either.

I am using Moodle 1.9.2.

My URL refers to ID 31006 when I am viewing the assignment submissions, but all the folder numbers for assignments in moddata are 4 digit numbers.

https://mymoodlesite.com/mod/assignment/submissions.php?id=31006

The student id numbers seem to match up okay, it's only the assignment ID numbers that don't.

Any help? Any chance that someone will still be checking this forum?

Thanks!


Sarah M
In reply to Sarah Dutcher

Re: Assignment ID numbers don't match with database contents ?

Lisa Placke發表於

Hi Sarah, I know this is from several years ago, but did you ever get an answer.  I also trying to figure out to relate the assignment number back to the assignment

In reply to Lisa Placke

Re: Assignment ID numbers don't match with database contents ?

Richard Jones發表於
Plugin developers的相片 Testers的相片

Hi Lisa

I am looking at recovering assignment details, due dates, courses and teacher info from Moodle in order to produce a summary page for parents.

Are you working on something similar?

The tables are quite hard to understand!

Richard