Let students hand in links in Moodle assignments

Moodle assignments take files and online text. Our free assignsubmission_link takes links to GitHub, Google Docs or Figma, limited to the sites you allow.

Drawing of a blue chain link on a sheet of paper with a small tick mark beside it.

Short answer: a Moodle assignment accepts file uploads and online text. When the work lives online (a GitHub repository, a Google Doc, a Figma file, a Canva design, a live website), students paste the link into the online text box, and teachers end up checking for typos and links to the wrong site. Our free plugin, assignsubmission_link, adds a proper link submission type: one field per link, only web links accepted, and only to the sites the teacher allows.

This is the fourteenth plugin in our series: one plugin for each Moodle plugin type, each one teaching DevLMS Studio, our AI plugin builder, how that type works. We checked the Moodle plugins directory first: it lists 36 assignment submission plugins, and none of them takes plain links.

How to use it

  1. In the assignment settings, under Submission types, tick Links.
  2. Choose Links per submission, from 1 to 10. Two is common: the code and a live demo.
  3. Optionally, fill in Allowed sites, for example github.com, docs.google.com. A site also allows its subdomains, so github.com allows gist.github.com. Leave it empty to accept any web link.

Students see one field per link. If a link goes to another site, they see which sites are allowed and nothing is saved until every link is right. Teachers see the links in the submissions table and in the grader, and “Download all submissions” includes a links page for each student. It supports Moodle 4.5 LTS to 5.3. The code is on GitHub.

One limit to know: Moodle stores the link, not the page. If a student edits the document after the deadline, the link shows the edited version. When that matters, ask for a link to a fixed version, such as a GitHub commit or release.

How a submission plugin works

From Moodle 5.3’s own online text submission:

  1. A submission plugin is one class that the assignment calls at each step: draw the settings, draw the student’s fields, save, show, copy to a new attempt, remove and delete.
  2. The assignment form has no validation hook for plugins. Each link field gets its own rule instead, and the save step checks again, because the Moodle app and other web service clients skip the form.
  3. Moodle checks for an empty submission before it calls the plugins. A submission with only blank fields is refused with Moodle’s own “nothing was submitted” message.
  4. A link like https://github.com@other.site/ really goes to other.site. The plugin refuses links with a user name in them, so a link cannot pretend to be on an allowed site.
  5. Links open in a new tab without telling the other site which Moodle page they came from.

We tested it with PHPUnit (21 tests, including a submission through the web service, a course backup and restore, and privacy export and deletion) and with browser tests in which a teacher sets the allowed sites and a student hands in links.

Need a plugin like this for your own Moodle?

Describe it in DevLMS Studio and watch it built and tested in a real Moodle, or ask our team for a fixed price.

Open DevLMS Studio