@problem@
	@config@
		roundednote=false
		keepfloat=true
	@;config@
	@problemtype@
		embedded
	@;problemtype@
	@name@
		tutorial_15_tasks
	@endname@
	@preamble@
		y = randint(1,42)
		solutions = [sqrt(y), y*y, y*y*y]
	@;preamble@
	@content@
		@intro@
		Some problems are composed of different tasks, only some of which might be included in a single exam. Such problems can be implemented by using multiple 'task*' blocks in a problem file.
		@pb;@
		When a problem file with multiple tasks is compiled, the preamble is executed only once. Since different (sub-)tasks refer to some common values or given functions, all random values assigned in the preamble wil remain the same throughout all tasks.
		@pb;@
		After compilation, the content of the 'intro' block is shown (once) as the first part of the problem. After that, a number of tasks are presented in random order; if more than one task is included, they will be shown in an ordered list (i.e. numbered), while a single task will be displayed on its own.
		@pb;@
		By default, the number of tasks is equal to the number different tasks specified in the problem file (i.e. each task is used exactly once), which is particularly useful for debugging purposes. The number of tasks for each problem included in an exam can be specified later on in the exam file (cf. Tutorial A0).
		@pb;@
		All parts of the content which are neither contained in the 'intro' or a 'task*' block will be shown (repeatedly) for each task. Within the content, the constant 'TASKS' will always be evaluated to the total number of tasks selected for the current compilation, while within each 'task*' block, the variable 'TASK' provides the current task number during compilation. This information can be used, for example, to determine whether more than one task will be shown or to prevent repeating some expressions used in all tasks, as shown in the following problem:
		@pb;@
		For $y=@y@$, solve the following problem@case(TASKS>1,"s","")@:
		@;intro@
		Compute
		@task1@
			$2y=$ @numericalans(100,2*y)@ and $\sqrt{y}=$
		@;task1@
		@task2@
			$3y=$ @numericalans(100,3*y)@ and  $y^2=$
		@;task2@
		@task3@
			$4y=$ @numericalans(100,4*y)@ and $y^3=$
		@;task3@
		@numericalans(100,solutions[TASK-1])@
	@;content@
@;problem@