Database Activity adding a "entry number field" (Moodle 3.2+)

Database Activity adding a "entry number field" (Moodle 3.2+)

by Samuel Diaz Clegg -
Number of replies: 2

Hello,

I have been trying to add an entry number field to my moodle database activity which automatically increases as a user adds entries to the database, is there any way of doing this?

Thanks


Sam

(Edited by William Lu - original submission Sunday, 12 February 2017, 10:40 AM

Copied from Sam's another post:

I am looking to add an "Entry Number" field to my database that starts at 1 when the first entry is submitted and increases by 1 every time a user creates an entry on the database. Is there any way of doing this in a simple way?
Thanks
Sam

)

Average of ratings: -
In reply to Samuel Diaz Clegg

Re: Database Activity adding a "entry number field" (Moodle 3.2+)

by Jon Bolton -
Picture of Particularly helpful Moodlers Picture of Testers

Probably better asked in the Database forum smile

But the Database activity does it automatically - each record has an incremental rid number.

Or did you mean to display in a view? There's no field that does that, but you could do a JavaScript count - see https://docs.moodle.org/en/Database_templates#Javascript_template for tips or AL Rachels suggests using a generico filter - see https://moodle.org/mod/forum/discuss.php?d=333755#p1369883

In reply to Jon Bolton

Re: Database Activity adding a "entry number field" (Moodle 3.2+)

by Samuel Diaz Clegg -

thanks Jon I will look at what you sent me