"The teacher' gotta give out a whole lot of gold stars after this one," grinned Earl Weaver after his Baltimore Orioles escaped today with one of their most exhilarating victories of the year, 4-1, over Cleveland.

The stage was all set for an ugly end to a beautiful pennant race in the bottom of the eighth of a 1-1 pitchers' duel between the O's Jim Palmer and sidearming Dennis Eckersley.

The young Indian Eckersley who already has a no-hitter this year - had been overpowering with a dozen strikeouts alreadyz, while Palmer, battling an awkwardly sloping mound, had struggled every inning.

And in this dismal eighth the bedraggled, almost dispirited Birds started kicking away the game. Palmer walked the leadoff man, sin of sins. Then he completely botched a sacrifice bunt for his first error in two years. Then he broke off the mound toward first base and had no play on another sacrifice bunt toward third. Misery, ignominy. Bases loaded, none out.

Surely this was the end for the O's, who already trailed th New York Yankees by 2 1/2 lengths before the game.

In this hideous old Municipal Stadium, in the presence of 30,000 empty seats and a thousand gopher holes in the infield, the Orioles could go out like klutzes after months of teamwork and sweat.

But Palmer is not an ordinary fellow. He summoned his considerable dignity and ruffled pride and appraised the situation. "Only popups or strikeouts will do," he thought.

So, Andre Thornton, slugging .553, third in the league, was delivered a high fastball that he popped up.

Oriole eyebrows were raised. Could suehan escape be possible?Up stepped the Indians' top hitter, Bruce Bochte, a .307 swinger. Palmer had struck out only one man thus far. "I didn't have very good stuff all day," he admitted.

But he had too much for Bochte. Seven fast balls later the stylish lefty had struck out. Only old Rico Carty, the most favored Indian, remained.

And well he should have been feared. He smashed the second Palmer pitch over the center-field fence.

Well, not quite.

Center fielder Al Bumbry's glove was also a few inches above the 8 1/2-foot fence. The heroes Palmer and Bumbry, was engulfed as they reached the dugout. An Oriole team that seemed to have had its heart stopped the night before by a 3-2 loss here, suddenly found its spunk again.

Eckersley got Pat Kelly, who had driven in the only O's run in the sixth, to ground out. But he fell behind, 3-1, to Ken Singleton.

"He hadn't made a mistake to me all day," said Singleton, who was on the verge of being kept off base for only the second game in the last 60. But Singleton took care of that.

The ball stopped bouncing deep in the empty right-field bleachers about the time Singleton promenaded home with the winning run.

The Birds were jubilant, and so, surprisingly, was part of the crowd. Standing behind the visitors' dugout leading the "O-R-I-O-L-E-S" chant was bearded Wild Bill Hagy. He is the gent in the white cowboy hat who uses his whole body to spell out the letters of that cheer in the upper deck in Baltimore's Memorial Stadium.

No sooner had the spelling lessons ended - a dozen Birds leaning over the top of the dugout laughing along with Wild Bill - than young Eddie Murray chased an Eckersley fast ball almost as far as Singleton's, this one also clearing the right-field fence.

But the O's were greedy. The back-to-back shots, the 23rd and 24th homers for Singleton and Murray, respectively, were not enough. Before the inning was over two more singles, a ground out and one of the oldest sucker plays in baseball had produced another run.

With men on the corners, two outs and two strikes on ninth hitter Dave Skaggs. Mark Belanger broke for second - the ancient double-run-down, man-scores-from-third-before-the last-out play. High school stuff.

But Indian reliever Jim Bibby balked. Palmer could only shake his head. "It's our desperation play," he said. We practically announced it when Weaver whistled to the ump to watch for a balk. But they still fell for it."