How to host a web page for a Moodle course

An interactive page uploaded into a course frequently renders as inert text, and the teacher finds out from a student who cannot make it work.

Interactive material uploaded into a learning platform often does not run. Hosting the page separately and linking to it from the course keeps both halves doing what they are good at.

A course page with a link out to an interactive activity that opens in its own tab.
A course page with a link out to an interactive activity that opens in its own tab.

This guide covers why uploads fail, what to keep in the platform, and the framing question.

Why the upload does not run

Learning platforms accept file uploads and then decline to execute what is in them.

Scripts are stripped, or the content is served from a sandboxed context with execution blocked. This is deliberate: a platform serving arbitrary uploaded code to hundreds of students has a genuine problem to solve, and blocking it is the reasonable answer.

The consequence for a teacher is that a page which works perfectly on their own machine becomes inert text inside the course, and they usually discover this from a student.

Test it once, with one page, before building a term's worth of material on the assumption that it works.

The page you are reading Sandboxed frame the pasted HTML runs here it cannot reach anything outside this box
Pasted markup runs inside a frame that cannot reach the page around it.

Split the job

Keep in the platform what the platform is for: enrolment, structure, deadlines, grades, completion tracking, the record of who did what.

Host at an address what needs to actually run: the simulation, the interactive diagram, the practice tool, the calculator.

The course page links to it. The student taps, the activity works, and they come back. Nothing about the course structure changes.

Uploaded into the course Hosted at an address
Scripts run Often not Yes
Grading In the platform Stays in the platform
Works on a phone In a frame Full screen
Open to students without accounts No Yes
Teacher can fix it quickly Re-upload Edit the page

The temptation is to embed the hosted page in a frame so it appears inside the course.

It produces a scroll inside a scroll. On a desktop that is mildly irritating; on a phone it is genuinely hard to use, and students get stuck in the inner frame unable to reach the rest of the page.

Link it, and let it open in its own tab. The student sees the activity full screen, which is what it was designed for.

An interactive activity opened full screen on a phone from a course link.
An interactive activity opened full screen on a phone from a course link.

Grading stays where it is

If the activity must be graded, do not try to move grading out of the platform.

Keep the graded part as a platform quiz, and use the hosted page for the practice, the exploration or the simulation that has to run. Students do the interactive work, then answer the graded questions in the course.

Completion tracking for the link itself is usually available in the platform, which is enough to know who opened it.

Access, honestly

A hosted page is open to anyone holding the address.

For open educational material that is a feature. For assessment material, model answers, or anything licensed to the institution, it is not.

Use an unguessable address for cohort-only material, and be realistic: students share links. Anything that genuinely must not leave the cohort belongs inside the platform, running or not.

Closely related: Free HTML file hosting, compared, and How to share a file without making anyone log in for the adjacent problem.

Put it at an address

Test whether scripts run before committing to uploads, host interactive pages separately, link rather than embed, keep grading in the platform, and choose the address accordingly.

Then the activity works when a student opens it at eleven at night.

Questions people ask

Why does my uploaded page not run?

Learning platforms commonly strip scripts from uploaded content, or serve it in a sandbox that blocks execution. It is a security decision rather than a fault, and it cannot be overridden by a teacher.

What is the alternative?

Host the page at its own address and link to it from the course. The platform keeps the structure and grading; the page keeps working.

Should the page open in a new tab?

Yes. Embedding it in a frame inside the course adds a scroll inside a scroll, and on a phone that combination is genuinely difficult to use.

Can students still be tracked?

Completion tracking stays in the platform. If the activity itself must be graded, keep it as a platform quiz and use the hosted page for the parts that need to actually run.

Will students without accounts be able to open it?

Yes, which is useful for open material and something to think about for anything that should stay within the cohort. Use an unguessable address if it matters.

Keep reading