Minor correction that I didn't actually get around to explaining in the episode: this wasn't the first task, this was Hagrid cheating and showing Harry what the first task will be. Probably seemed more like an actual task because, well, gameplay. In the book/film they just go to the dragon pens and Harry's like "yep those certainly are dragons".