“I’m sick of people who try to suck the fun out of childhood,” a kid says at one point in “Middle School: The Worst Years of My Life.” The same sentiment might be expressed about movies that do so, and this is one of them. Based on one in the series of kids’ books co-authored by James Patterson, who’s turned himself into a publishing juggernaut by parceling out the writing to a small army of collaborators and has also been trying to establish a foothold in the movie business with his own production company (and, unless I’m mistaken, has a brief cameo here as an angry restaurant owner), the picture is a pretty dismal retread of territory already covered in the three “Diary of a Wimpy Kid” movies, which were hardly great shakes but were nevertheless better than this.

Our young hero is Rafe Khatchadorian (Griffin Gluck). He’s a talented kid, of course—an artist who fills his sketchbook with imaginative drawings that come to life in his imagination (or here, in crude animation). But he’s still grieving the death of his younger brother (cancer), and his little sister Georgia (Alexa Nisenson) torments him as best she can. The siblings are united, however, in their detestation of Carl (Rob Riggle, who seems to convey obnoxiousness all too easily), the odious boyfriend that their mother Jules (bland Lauren Graham), a loving parent but an incredibly dumb one, has let into their lives. (There’s no mention of her former husband—dead, presumably.)

Rafe’s already been kicked out of two schools for acting out (trouble dealing with his brother’s death, no doubt), and has transferred to Hills Village Middle School as his last chance. It’s ruled by tyrannical but utterly stupid Principal Dwight (Andy Daly) and his oversized assistant Ida Stricker (Retta)—both portrayed as officious oafs. Their only interest is in maintaining absolute order and upholding the school’s first-place ranking on an upcoming standardized test, which the “remedials” in the class taught by gregarious Mr. Teller (Adam Pally), to which Rafe is of course assigned, threaten to undermine.

Rafe makes one new campus friend—bright, idealistic Jeanne (Isabela Moner)—and he’s been accompanied to the new place by another troublesome student, Leo (Thomas Barbusca), but he also becomes the target of class bully Miller (Jacob Hopkins), and it doesn’t take him long to take up Leo’s suggestion that they break every stinking rule in Principal Dwight’s student handbook—anonymously—so as to foment campus rebellion. Much of the picture is devoted to watching his elaborate schemes to fight the establishment unfold. (Apparently he has no trouble at all sneaking into the place night after night to set up his incredibly complicated strategies, one of which involves literally thousands of post-it notes.)

Of course there are consequences. Rafe winds up getting his entire class suspended and himself expelled; at home his mother accepts a ring from Carl, who’s plotting to send him away to military school. But he, Georgia and Jeanne organize a rebellion among the students that will lead to the happy resolution of his problems both on campus and in the family.

Perhaps the source material, which has been well received, possesses some redeeming qualities, but the movie has few. Apart from portraying all the adults but one (Mr. Teller, who’s sort of a laid-back hippie) as cruel or moronic (and mostly both), the plot presents as perfectly acceptable behavior things like a ten-year old driving a car. It does make one point that everybody can agree with—the insanity of standardized testing as the be-all of student achievement; but the way in which it addresses the matter of how a twelve-year old might deal with a sibling’s death is a little creepy.

Overall, “Middle School” has the feel of one of the many mediocre telefilms made for the Disney Channel or Nickelodeon. Visually bright (courtesy of cinematographer Julio Muscat) and populated by a reasonably pleasant young cast, it’s nevertheless anemically written and directed (by Steve Carr, of “Paul Blart: Mall Cop”), and the mugging of the adults is well-nigh grotesque, with Daly and Retta apparently trying to duplicate the sort of rapport Jeffrey Jones and Edie McClurg managed for John Hughes and failing miserably.

A few undemanding pre-teens might get a charge out of this curiously flat adolescent revenge comedy, but most kids in that age group won’t, and in any event you’d better hope they don’t get any ideas from it.