Nowadays, the concept of gamification is successfully applied to a variety of different contexts. However, a scarce number of studies have addressed this topic in web-based fields. In this paper, our aim is to promote gamification and its capabilities and also provide an overall architecture for the web environments. First of all, we introduce the "gamification" concept and then we clarify its differences with the "game" concept. Moreover, we mention related activities in this field, and detail important elements of gamification. Finally, we present a novel architecture for web-based gamification environments; and address its applications and challenges. As a case study, we review gamification of electronic tests and discuss on "how gamification can change a stressful exam environment to a joyful and yet instructive one?".