How do you solve the puzzle of turning a half-hour sitcom into a 90-odd-minute feature film? From On the Buses in the 1970s to The Inbetweeners in the 2010s, British filmmakers have come up a reliable fix: send the characters on holiday.

That’s the time-honoured custom honoured by The Bad Education Movie, a spin-off from the BBC3 series created by and starring stand-up comedian Jack Whitehall, which dispatches Whitehall’s posh teacher and his comprehensive school pupils on a typically unruly trip to Cornwall.

Yet the sitcom’s core dynamic remains essentially unchanged. Whitehall’s Alfie Wickers is still the loveable buffoon, hopelessly inept, well meaning and desperate to be down with the kids. And he’s still re-enacting historic battles in class, an unorthodox teaching strategy that proves unexpectedly rewarding after he and his pupils get mixed up with the Cornish Liberation Army during their post-exams trip to the county.

As you might expect, the comedy is broad and the hijinks mostly puerile, with far too many episodes involving threats to and exposure of Alfie’s testicles. Other gags, however, are set up with impressive care.

One early scene finds Alfie, unwittingly high on magic mushrooms, ‘rescuing’ a dummy of Anne Frank from an exhibition in Amsterdam, a sequence that involves a canal-side bicycle chase and climaxes with a very neat E.T. spoof.

References to Alfie’s past as his school’s fencing champion are opportunities for sexual innuendo and a way of highlighting his poshness, but they lay the groundwork for a lively duel on the ramparts of a Cornish castle with Iain Glen’s fanatical local rebel that would leave Errol Flynn’s Robin Hood in stitches.

Certificate 15. Runtime 91 mins. Director Elliot Hegarty

The Bad Education Movie is available on Blu-ray & DVD from Entertainment in Video and debuts today on Sky Movies Premiere.