Combined Question and Drag and Drop Onto Image

Combined Question and Drag and Drop Onto Image

by Dipo A -
Number of replies: 8

I am looking to add Drag and Drop Question type to Combined Question type. This is to be able to set questions on Pie Chart. Student can calculate the required angle, then drag and drop images to the background Circle to correspond to the calculated angle. 

Moodle version: Moodle 3.4.3 (Build: 20180517)

I have tried the instruction on the http://www.open.edu/openlearncreate/mod/oucontent/view.php?id=52747&section=2.4.1.  (to add more question type)

What i've done so far:

1. Copied the 'gapselect' folder and renamed it as 'Drag and Drop Onto Image'

2. I renamed the 'gapselect' text to 'Drag and Drop Onto Image'   in both combinable.php and renderer.php

3. I uploaded the 'Drag and Drop Onto Image' folder to the 'question/type/combined/combinable'.

This does not work and I am sure I have not done this correctly/missed something.

Shall be very grateful if pointed on the right direction.

Many thanks.

Average of ratings: -
In reply to Dipo A

Re: Combined Question and Drag and Drop Onto Image

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

I think that at step 2. just renaming things in the code is probably not enough. You need to understand what this code is doing, and make all the necesary changes to make it work with the different question types.

Average of ratings: Useful (1)
In reply to Tim Hunt

Re: Combined Question and Drag and Drop Onto Image

by Dipo A -

Thanks so much Tim. I'm a bit new to Moodle and programming. Will study this if I can make anything out of it. But if anyone has better way(s) to to this better/quicker, will deeply appreciate.

In reply to Dipo A

Re: Combined Question and Drag and Drop Onto Image

by Marcus Green -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Could you explain why you want to make it part of the combined question type? I can see that generally it would be good to have more stuff as a combined question type, but what is your specific requirement in terms of the questions?

In reply to Marcus Green

Re: Combined Question and Drag and Drop Onto Image

by Dipo A -

Thanks so much Marcus.

What I actually want to achieve is to have  Pie Chart Questions. Pls see Example Below:

SubjectFrequencyAngle
Mathematics7Calculated (840)
English3Calculated|(210)
Science15Calculated(1800)
Geography5Calculated(350)
Total30Calculated(3600)


Once the above is completed,  student then drag and drop lines (provided as options) to match the corresponding angle from start and continue clockwise. Final image will be as if the Pie chart is drawn manually and marked.

Using online protractor to draw this will be the ideal thing, but not sure if there is anything like it already.

Thanks.

In reply to Dipo A

Re: Combined Question and Drag and Drop Onto Image

by Marcus Green -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Why do you want it to be an option for the combined question type? It would be nice to have additional types usable in combined and I looked into adding my own question types into it, but I am wondering what specific benefit you are looking for.

In reply to Marcus Green

Re: Combined Question and Drag and Drop Onto Image

by Dipo A -

Thanks again. Now, my understanding about Combined is that I can add more than 1 question type. 

With Drag and Drop only, I will not be able to add the 'calculating the angles, or total' and marked correctly by student typing the answer.

Although I can use drag and drop for  the above also. I feel it increase the guessing opportunity rather than working the angles/total out and typing the answer in the answer box. Mine Combined already comes with Numeric question type, which allows student to type in the answer as required.

Also, I am  considering the use of cloze (adding it) as well, just to have a robust Combined question type with various functions to handle questions in Mathematics.

In reply to Dipo A

Re: Combined Question and Drag and Drop Onto Image

by AL Rachels -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

From past experiments in trying to copy and rename a plugin, such as gapselect, you need to go through EVERY file in your renamed version, and change EVERY reference to gapselect to your new name. Once that is done, verify that you NEW renamed version works like the original. Only then can you try to combine it the way you want with any hope that it might work.

Average of ratings: Useful (1)
In reply to AL Rachels

Re: Combined Question and Drag and Drop Onto Image

by Dipo A -

Thanks.

I have actually done this using text 'find and replace' and everything changed. I think I need to fully understand and  how the files work.