Skip to main content

Posts

Featured

Selecting all the files along with their paths of a course in moodle

i am trying to write a query to get the name and path of files of a course in Moodle but it seems like i am never be able to do it. Here is what i have done uptill now , any help with this is highly appreciated :) SELECT SOURCE file, course, contenthash path FROM mdl_files INNER JOIN mdl_context ON mdl_files.contextid = mdl_context.id JOIN mdl_resource ON instanceid = mdl_resource.id WHERE course= (SELECT id FROM mdl_course WHERE fullname="XXXX") Solved There is no column called "file" in any of those Moodle tables. Are you actually referring to the "mdl_files.filename" column? If so try this query: SELECT mdl_files.source, mdl_files.filename, mdl_files.contenthash, mdl_context.path, mdl_resource.course, mdl_resource.name, mdl_course.fullname, mdl_course.shortname FROM mdl_files INNER JOIN mdl_context ON mdl_files.contextid = mdl_context.id INNER JOIN mdl_resource...

Latest Posts

Python 2.7: check if default argument passed with a decorator

So confused on how to use Spring boot logging

Core Data -existingObjectWithID:error: causes error 133000