The Gemara says:
והאמר רב גידל אמר רב כל תלמיד חכם שיושב לפני רבו ואין שפתותיו נוטפות מר תכוינה שנאמר שפתותיו שושנים נוטפות מור עובר אל תקרי מור עובר אלא מר עובר אל תקרי שושנים אלא ששונים לא קשיא הא ברבה והא בתלמיד ואיבעית אימא הא והא ברבה ולא קשיא הא מקמי דלפתח הא לבתר דפתח כי הא דרבה מקמי דפתח להו לרבנן אמר מילתא דבדיחותא ובדחי רבנן לסוף יתיב באימתא ופתח בשמעתא
In short, there seems to be a contradiction if one should learn Torah from joy or from fear. The Gemara gives answers:
- The teacher must be joyful but the student must be in fear
- Both are in the teacher. Before starting to teach he must be joyful but them when he begins teaching he must be serious.
The Gemara says that Rabbah would say a joke, all the students would laugh and then they would sit in fear and Rabba would teach. The Gemara says that this is according to the second answer.
Now the second answer doesn't mention students. Both joy and fear are for the teacher (and not the students).
Why are the students laughing and then sitting in fear? Either be in fear the whole time or be happy the whole time.