Electronic learning resource, online courses are widely applied in a learning process. As a rule, they obligatory include knowledge control block, which should contain sufficient quantity of tasks. Filling in tasks’ databases of such resources takes a considerable amount of time. Therefore it is a crucial task to explore ways of automatic generation of learning tasks. The article describes the techniques for generating tasks based on enumeration, based on information about the values of properties of objects and information about the relationship between objects, and based on information provided in the form of formulas and graphs. The properties of objects were stored in the databases. Algorithms for compiling questions to control knowledge in history, geography, and computer science have been developed. The obtained algorithms can be used for preparing the control measuring materials for such disciplines as chemistry, information theory. Value of given examples is in their possibility to replicate, extend to areas of other subjects. This allows inclusion into tasks databases of online courses sufficient number of tasks. Given algorithm can be used in composition of real time training tasks, without preservation of tasks wording in database.Keywords: training tasks generation, knowledge control, e-learning, online courses, databases.