Drag the Words

Hi, 

I`am trying to use Drag the Words content type. My purpose of using this plugin is to create code trainer. For example, I want my users can drag code snippets to appropriate boxes with right sequence like this:

def fact(n):

    if n<=1:

          return 1

    else: 

          return n*fact(n-1)

fact(5)

120

My question is that, how can I store this code snippets between "*"s with right indentation. Why this indentation important, because of the demand of programming language. How can I do this? or is there any other options to make trainers like mine.

The second question relates to amount of questions. How can I make multiple questions like above code with "Next" button. And of course showing the results at the end.

Thanks in advance

BV52's picture

Hi Mahir,

This is not possible not unless you make changes to the code. It is however, in theory possible by using Drag and Drop. It needs a bit of trial and error to get the position of the drop zones but it can be done. For multiple questions you can use Course Presentation to have multiple questions. I created a simple example here.

-BV52