cancel
Showing results for 
Search instead for 
Did you mean: 
blaise_mitsutam
Community Member

How do I find the module_item_id?

I inherited a course in which lectures are offered in five formats: video, audio, handout, slides, and transcript. Unfortunately, this means I don't know exactly how some elements of the course were created.

The image below shows how the links are displayed for Module 4 Lecture b. 

Screenshot showing the selection buttons for the five formats_ video, audio, handouts, slides, and transcript.

For some reason, some of the buttons link to the wrong files. For example, the Audio, Handout, Slides, and Transcript buttons link to the content for Lecture a instead of Lecture b. 

An example of the HTML code for the Audio button is:

<td style="padding-right: 1em;"><a class="btn btn-lg btn-info" href="https://bcconted.instructure.com/courses/13/modules/items/3256" target="_blank" rel="noopener noreferrer">Audio</a></td>

I believe that "3256" refers to the audio file that will be played when the button is selected. 

I have tried inserting the desired file into a new Page. When I view the HTML code, the link shows 

.../13/files/15888/... which is a different number and also references "/files/" and not "/modules/items/."

I have opened the module and clicked on the Audio button as a test. When I check the URL in the browser address bar, I see:

https://bcconted.instructure.com/courses/13/files/15893?module_item_id=3256.

This is the correct item ID, but it seems that I'd have to launch the item by going to the module, opening the page, and clicking on the item link. Since it's the wrong item, however, I wouldn't get the item ID that I want (which isn't linked on the page).

Does anyone know where I can find the module_item_id when the item isn't linked to the page?

I hope my question isn't too confusing. I'm stumped.

Thanks!!

Blaise

Tags (2)
7 Replies
kevinw
Community Member

This is just kind of a wild thought but since no one else has answered, maybe something is better than nothing. Have you tried right clicking and then selecting "inspect"? 

243776_pastedImage_1.png

When I do it on this page at the "@ Mention" button it gives me some additional information about that particular part of the page that I normally wouldn't find. It's proved useful for me in the past in working with modules through the API. 

Hi, Kevin,

I had tried "inspect." I should have mentioned that. However, I didn't find anything that was obviously the module_item_id. 

I did notice that the module_item_id numbers appear to be sequential, and the first item in the list is the correct item (i.e., the Narrated Video item is the correct item for the module). So I replaced the module_item_id numbers for the remaining items by incrementing them by 1. For example, if the Narrated Video module_item_id is 3260, I edited the Audio module_item_id to be 3261, the Handout module_item_id to be 3262, etc. This works!

However, I don't know why it works, or what I would do if I didn't have that initial item with the correct module_item_id.

After I've corrected the issue in the course, and re-verified all the other links, I'll submit a ticket to Canvas support and will post their response here.

Thanks!

Blaise

chriscas
Adventurer II

It looks to me like those are really "pages" from Canvas, not Canvas built-in "modules" (just to be clear, so nobody is confused by the terminology).  That being said, the links were more than likely created using the sidebar on the right hand side of the page.  When you use the sidebar to find content, it will automatically create the correct link on the left.  I don't think the id numbers are anything you're really supposed to know offhand, except possibly for API work.

Thanks, Christopher.

I had tried that and included that in my original message when I wrote:

I have tried inserting the desired file into a new Page. When I view the HTML code, the link shows 

.../13/files/15888/... which is a different number and also references "/files/" and not "/modules/items/."

But I can see that my description wasn't clearly written.

I should also have mentioned that the item ID generated when I insert the file using the sidebar on the right hand side doesn't work when I add it to the hand-modified code in the original HTML. It refers to the same file, but when I save the page and click the link I get an' error message.

The solution I have works currently, and I hope to figure out the rest soon.

Robbie_Grant
Community Coach
Community Coach

 @blaise_mitsutam ‌,

Were you able to find an answer to your question? I am going to go ahead and mark this question as answered because there hasn't been any more activity in a while so I assume that you have the information that you need. If you still have a question about this or if you have information that you would like to share with the community, by all means, please do come back and leave a comment.  Also, if this question has been answered by one of the previous replies, please feel free to mark that answer as correct.

 

Robbie

 @Robbie_Grant  

I didn't get a response that helped me understand how to find the module_item_id number. However, as described in one of my responses above, I was able to resolve my issue because the other module_item_id numbers that linked to items on the Page are sequential:

I did notice that the module_item_id numbers appear to be sequential, and the first item in the list is the correct item (i.e., the Narrated Video item is the correct item for the module). So I replaced the module_item_id numbers for the remaining items by incrementing them by 1. For example, if the Narrated Video module_item_id is 3260, I edited the Audio module_item_id to be 3261, the Handout module_item_id to be 3262, etc. This works!

 

So this issue has been resolved. I'm still mystified regarding how to locate the module_item_id number for an element of the course, but I have everything working now.

Thanks for following up.

Blaise

An even more important question now that the new RCE embraces a flat file system with no way connect files with links.

It is, in my humble opinion as a programmer and web designer for many years, to make assumptions of the internal file sequencing number, as their may be files inserted in another directory. Yikes.

However, my issue: I no longer have the ability to specify the module name (just the id, with no obvious mapping) and unable to correlate between the file name in "files" and the fileid that is linked. This is a really, really bad idea.

Steve