According to previous studies, traditional laboratory safety courses are delivered in a classroom setting where the instructor teaches and the students listen and read the course materials passively. The course content is also uninspiring and dull. Additionally, the teaching period is spread out, which adds to the instructor's workload. As a result, students become less motivated to learn. In contrast, artificially intelligent educational robots (AIERs), help students learn while lessening the workload on instructors by enhancing teaching strategies, using robots to substitute for teachers, giving students access to a variety of instructional content, and improving interaction with students through the use of intelligent voice interactions and Q&A systems to promote student engagement in learning. If the robot is used for a long time for learning, it may lead to a decrease in students' interest in learning. Therefore, this study introduces the GAFCC model (the theory-driven gamification goal, access, feedback, challenge, collaboration design model) as an instructional design model to guide the development of a gamified AIER system, aiming to improve students' motivation and learning effectiveness for laboratory safety courses. To test the effectiveness of the system, this study conducted an experimental study at a university in China in the summer of 2022. 53 participants participated in the research, with a random sample taken from each group. Each participant was able to choose the time of their free time to engage in the experiment. There were 18, 19, and 16 participants in experimental group 1, experimental group 2, and the traditional group, respectively. Students in experimental group 1 learned using the gamified AIER system, students in experimental group 2 learned on a general anthropomorphic robot system and the control group received traditional classroom learning. The experimental results showed that compared to the other two groups, the gamified AIER system guided by the GAFCC model significantly improved students' learning achievement and enhanced their learning motivation, flow experience, and problem-solving tendency. In addition, students who adopted this approach exhibited more positive behaviors and reduced cognitive load in the learning process.