Difference between revisions of "Drag drop dartboard question view"

From Catglobe Wiki
Jump to: navigation, search
m (Created page with '==Drag drop dartboard question view== The Drag drop dartboard question view transforms a scale grid question into a vertical scale where sub questions, which must be specified as…')
 
m (Drag drop dartboard question view)
Line 15: Line 15:
 
# Create a folder called 'Question views' below the folder 'Common resources' if it doesn't exist already, leave inheritance on, leave inheritance on
 
# Create a folder called 'Question views' below the folder 'Common resources' if it doesn't exist already, leave inheritance on, leave inheritance on
 
# Create a folder called 'Drag drop dartboard' below the folder 'Question views' if it doesn't exist already, leave inheritance on
 
# Create a folder called 'Drag drop dartboard' below the folder 'Question views' if it doesn't exist already, leave inheritance on
# Open the attachment tab of the 'Drag drop dartboard' folder and upload the two files DragSlider.js and DragSlider.swf, make sure to keep the names including the file extension, it will make it easier to recognize the files in the next step
+
# Open the attachment tab of the 'Drag drop dartboard' folder and upload the two files DragDropDartboard.js and DragDropDartboard.swf, make sure to keep the names including the file extension, it will make it easier to recognize the files in the next step
 
# Go to 'tools > Projects and folders > Attachments'
 
# Go to 'tools > Projects and folders > Attachments'
# Search by name for 'DragSlider' anywhere in name, given that you named the attachments according to the suggested naming in the step above
+
# Search by name for 'DragDropDartboard' anywhere in name, given that you named the attachments according to the suggested naming in the step above
 
# Make sure to include the Link column in the attachment resource list, you'll need it for getting the GUID of the two attachments
 
# Make sure to include the Link column in the attachment resource list, you'll need it for getting the GUID of the two attachments
# The link column for the files will look something like this:<br>http://vnsurvey.catglobe.com/Attachments/GetAttachment.aspx?rid=20eb9e88-69cc-4b03-bbe0-b0dbda53d285 (DragSlider.js)<br>http://vnsurvey.catglobe.com/Attachments/GetAttachment.aspx?rid=e8397d22-22cd-439b-932b-e36fe68b88c4 (DragSlider.swf)
+
# The link column for the files will look something like this:<br>http://vnsurvey.catglobe.com/Attachments/GetAttachment.aspx?rid=20eb9e88-69cc-4b03-bbe0-b0dbda53d285 (DragDropDartboard.js)<br>http://vnsurvey.catglobe.com/Attachments/GetAttachment.aspx?rid=e8397d22-22cd-439b-932b-e36fe68b88c4 (DragDropDartboard.swf)
# You should extract the GUIDs only, note them down now together with their filename, you will need it for setting up the question:<br>DragSlider.js: 20eb9e88-69cc-4b03-bbe0-b0dbda53d285<br>DragSlider.swf: e8397d22-22cd-439b-932b-e36fe68b88c4
+
# You should extract the GUIDs only, note them down now together with their filename, you will need it for setting up the question:<br>DragDropDartboard.js: 20eb9e88-69cc-4b03-bbe0-b0dbda53d285<br>DragDropDartboard.swf: e8397d22-22cd-439b-932b-e36fe68b88c4
 
# Create a group called 'Drag drop dartboard access' under the folder 'Drag drop dartboard'
 
# Create a group called 'Drag drop dartboard access' under the folder 'Drag drop dartboard'
 
# Give the group 'Drag drop dartboard access' observer access to the folder 'Drag drop dartboard'
 
# Give the group 'Drag drop dartboard access' observer access to the folder 'Drag drop dartboard'
 
# Add the user with username 'anonymous' to the group 'Drag drop dartboard access', this is necessary for test links and anonymous access to work
 
# Add the user with username 'anonymous' to the group 'Drag drop dartboard access', this is necessary for test links and anonymous access to work
# All respondents participating in questionnaires using the DragSlider must be added to the group 'Drag drop dartboard access' else they will not be able to see the Drag drop dartboard when answering the questionnaire
+
# All respondents participating in questionnaires using the DragDropDartboard must be added to the group 'Drag drop dartboard access' else they will not be able to see the Drag drop dartboard when answering the questionnaire
  
 
Respondents can be added to the 'Drag drop dartboard access' group dynamically through a dummy question in the beginning of the questionnaire to avoid adding respondents unecessarily to the group.
 
Respondents can be added to the 'Drag drop dartboard access' group dynamically through a dummy question in the beginning of the questionnaire to avoid adding respondents unecessarily to the group.
Line 45: Line 45:
 
[
 
[
 
HTML=true;
 
HTML=true;
 +
CLOSE_BUTTON_VISIBLE = false;
 
NEXT_BUTTON_VISIBLE = true;
 
NEXT_BUTTON_VISIBLE = true;
 +
REQUIRED = true;
 +
RESET_BUTTON_VISIBLE = false;
 
BACK_BUTTON_VISIBLE = true;
 
BACK_BUTTON_VISIBLE = true;
REQUIRED = true;
 
 
]
 
]
  
QUESTION DragSlider SCALEGRID
+
QUESTION DartboardDragDrop SCALEGRID
 
[
 
[
JAVA_SCRIPT = "
+
JAVA_SCRIPT = "// Enter the GUID for the JavaScript attachment
// Enter the GUID for the JavaScript attachment
+
var javaScriptGuid = 'c0d002a9-056f-4fdc-ba65-401bddea9e9d';
var javaScriptGuid = 'JavaScript GUID';
 
  
 
// Enter the GUID for the Flash attachment
 
// Enter the GUID for the Flash attachment
var flashGuid = 'Flash GUID';
+
var flashGuid = '216db971-5f3a-4179-9999-bd4831e160a4';
  
 
// Modify the question after the DOM has finished loading to get jQuery access
 
// Modify the question after the DOM has finished loading to get jQuery access
Line 67: Line 68:
 
       function()
 
       function()
 
       {
 
       {
         // Create an instance of the Drag drop dartboard
+
         // Create an instance of the drag slider
         var myDragSlider = new DragSlider(quest, flashGuid);
+
         var myDragDropDartboard = new DragDropDartboard(quest, flashGuid, 'D_ImagePositions', [{{D_ImagePositions}}]);
 
          
 
          
        // Do some configuration
+
        // Do some configuration
        myDragSlider.config.scale.fontColor = 'FF0000';
+
myDragDropDartboard.config.dartboard.fontColor = '000000';
        myDragSlider.config.scale.fontSize = '12';
+
myDragDropDartboard.config.dartboard.fontSize = '15';
 +
myDragDropDartboard.config.dartboard.fontText = 'Arial';
 +
myDragDropDartboard.config.dartboard.oddColor = '865000';
 +
myDragDropDartboard.config.dartboard.evenColor = 'FFAA00';
 +
myDragDropDartboard.config.dartboard.borderColor = '000000';  
 
        
 
        
         // Initalize the Drag drop dartboard
+
         // Initalize the drag slider
         myDragSlider.init();
+
         myDragDropDartboard.init();
 
       }
 
       }
 
   );
 
   );
 
};";
 
};";
 
]
 
]
How do you feel about these brands?
+
<p> How do you feel about these brands? </p>
SQ: [
+
SQ:[
 
REVERSE = false;
 
REVERSE = false;
MAX_TEXT = "Positive trend";
+
MAX_TEXT = "Like";
MIN_TEXT = "Negative trend";
+
MIN_TEXT = "Hate";
 
MIN_VALUE = 1;
 
MIN_VALUE = 1;
MAX_VALUE = 10;
+
MAX_VALUE = 8;
 
DISCRETE = false;
 
DISCRETE = false;
 
STEP = 1;
 
STEP = 1;
] <img height="62" src="path to image 1" style="border: 0" width="61">
+
REQUIRED = true;
SQ: [
+
]<img width="61" height="62" style="border: 0" src="../../Images/GetImage.aspx?rid=a4cdc124-b643-4418-9b29-317954071c1f">
 +
SQ:[
 
REVERSE = false;
 
REVERSE = false;
MAX_TEXT = "Positive trend";
 
MIN_TEXT = "Negative trend";
 
 
MIN_VALUE = 1;
 
MIN_VALUE = 1;
MAX_VALUE = 10;
+
MAX_VALUE = 8;
 
DISCRETE = false;
 
DISCRETE = false;
 
STEP = 1;
 
STEP = 1;
] <img height="62" src="path to image 2" style="border: 0" width="61">
+
]<img width="61" height="62" style="border: 0" src="../../Images/GetImage.aspx?rid=e8e7bc9c-ca9d-497f-9fc7-abf4f8fd2421">
SQ: [
+
SQ:[
 
REVERSE = false;
 
REVERSE = false;
MAX_TEXT = "Positive trend";
 
MIN_TEXT = "Negative trend";
 
 
MIN_VALUE = 1;
 
MIN_VALUE = 1;
MAX_VALUE = 10;
+
MAX_VALUE = 8;
 
DISCRETE = false;
 
DISCRETE = false;
 
STEP = 1;
 
STEP = 1;
] <img height="62" src="path to image 3" style="border: 0" width="61">
+
REQUIRED = true;
SQ: [
+
]<img width="61" height="62" style="border: 0" src="../../Images/GetImage.aspx?rid=8d90a277-b8aa-44ae-a2bf-85f4297612c2">
 +
SQ:[
 
REVERSE = false;
 
REVERSE = false;
MAX_TEXT = "Positive trend";
 
MIN_TEXT = "Negative trend";
 
 
MIN_VALUE = 1;
 
MIN_VALUE = 1;
MAX_VALUE = 10;
+
MAX_VALUE = 8;
 
DISCRETE = false;
 
DISCRETE = false;
 
STEP = 1;
 
STEP = 1;
] <img height="62" src="path to image 4" style="border: 0" width="61">
+
]<img width="61" height="62" style="border: 0" src="../../Images/GetImage.aspx?rid=49f55180-0521-44d6-af17-86fe0efc5fb7">
SQ: [
+
SQ:[
 
REVERSE = false;
 
REVERSE = false;
MAX_TEXT = "Positive trend";
 
MIN_TEXT = "Negative trend";
 
 
MIN_VALUE = 1;
 
MIN_VALUE = 1;
MAX_VALUE = 10;
+
MAX_VALUE = 8;
 
DISCRETE = false;
 
DISCRETE = false;
STEP = 1;
+
STEP = 1;]<img width="61" height="62" style="border: 0" src="../../Images/GetImage.aspx?rid=1e245119-905c-4a47-ae17-588ea2aa91b3">
] <img height="62" src="path to image 5" style="border: 0" width="61">
+
 
 
</source>
 
</source>
  

Revision as of 11:56, 10 May 2010

Drag drop dartboard question view

The Drag drop dartboard question view transforms a scale grid question into a vertical scale where sub questions, which must be specified as images, can be dragged up or down to the level of the scale.

Setting up the resources

The Drag drop dartboard needs two attachments in order to work, a Flash-file which creates the question view and a JavaScript-file which wraps the Flash-file to simplify the usage in question script.

The following step-by-step guide describes a best practice for placing question views, it will walk you through setting up the Drag drop dartboard on your Catglobe site.

The guide assumes that it is the first question view you are adding to the site, so some steps can be skipped if the basic structure has already been established.

Before you start, you must have the necessary navigation and resource access, talk with your site administrator about that, she might have to give you additional permissions to complete the steps below.

  1. Go to 'folders'
  2. Create a folder called 'Common resources' below 'SYSTEM' if it doesn't exist already, leave inheritance on
  3. Create a folder called 'Question views' below the folder 'Common resources' if it doesn't exist already, leave inheritance on, leave inheritance on
  4. Create a folder called 'Drag drop dartboard' below the folder 'Question views' if it doesn't exist already, leave inheritance on
  5. Open the attachment tab of the 'Drag drop dartboard' folder and upload the two files DragDropDartboard.js and DragDropDartboard.swf, make sure to keep the names including the file extension, it will make it easier to recognize the files in the next step
  6. Go to 'tools > Projects and folders > Attachments'
  7. Search by name for 'DragDropDartboard' anywhere in name, given that you named the attachments according to the suggested naming in the step above
  8. Make sure to include the Link column in the attachment resource list, you'll need it for getting the GUID of the two attachments
  9. The link column for the files will look something like this:
    http://vnsurvey.catglobe.com/Attachments/GetAttachment.aspx?rid=20eb9e88-69cc-4b03-bbe0-b0dbda53d285 (DragDropDartboard.js)
    http://vnsurvey.catglobe.com/Attachments/GetAttachment.aspx?rid=e8397d22-22cd-439b-932b-e36fe68b88c4 (DragDropDartboard.swf)
  10. You should extract the GUIDs only, note them down now together with their filename, you will need it for setting up the question:
    DragDropDartboard.js: 20eb9e88-69cc-4b03-bbe0-b0dbda53d285
    DragDropDartboard.swf: e8397d22-22cd-439b-932b-e36fe68b88c4
  11. Create a group called 'Drag drop dartboard access' under the folder 'Drag drop dartboard'
  12. Give the group 'Drag drop dartboard access' observer access to the folder 'Drag drop dartboard'
  13. Add the user with username 'anonymous' to the group 'Drag drop dartboard access', this is necessary for test links and anonymous access to work
  14. All respondents participating in questionnaires using the DragDropDartboard must be added to the group 'Drag drop dartboard access' else they will not be able to see the Drag drop dartboard when answering the questionnaire

Respondents can be added to the 'Drag drop dartboard access' group dynamically through a dummy question in the beginning of the questionnaire to avoid adding respondents unecessarily to the group.

We have the necessary resources setup, and the GUIDs we need to configure the question script in the next section.

Configuration of the question

The Drag drop dartboard must be configured for a scale grid, where each sub question must contain an img tag pointing to the picture which should be displayed.

Since there is only one scale the minimum and maximum values for the first sub question are used to define the extremeties of the scale, likewise the first sub question is also used to define the minimum and maximum text.

The other sub questions should still contain minimum and maximum values since the navigation engine validates the inputted values, and minimum and maximum text should also be added, as i makes it easier to process collected data afterwards.

Below is shown an example in QSL of a scale grid question configured with the Drag drop dartboard question view, it's ready to be imported to your questionnaire and modified to fit your needs.

When using this example you must remember to replace 'JavaScript GUID', and 'Flash GUID' with those GUIDs you found in the previous section, keep the quotes. You can insert the images from the questionnaire editor, they should be uploaded to the questionnaire template then inserted into the sub questions.

QUESTIONNAIRE
[
	HTML=true;
	CLOSE_BUTTON_VISIBLE = false;
	NEXT_BUTTON_VISIBLE = true;
	REQUIRED = true;
	RESET_BUTTON_VISIBLE = false;
	BACK_BUTTON_VISIBLE = true;
]

QUESTION DartboardDragDrop SCALEGRID
[
	JAVA_SCRIPT = "// Enter the GUID for the JavaScript attachment
var javaScriptGuid = 'c0d002a9-056f-4fdc-ba65-401bddea9e9d';

// Enter the GUID for the Flash attachment
var flashGuid = '216db971-5f3a-4179-9999-bd4831e160a4';

// Modify the question after the DOM has finished loading to get jQuery access
quest.onInit = function()
{
   // Load the JavaScript attachment
   $.getScript(
      '../../Attachments/GetAttachment.aspx?rid=' + javaScriptGuid,
      function()
      {
         // Create an instance of the drag slider
         var myDragDropDartboard = new DragDropDartboard(quest, flashGuid, 'D_ImagePositions', [{{D_ImagePositions}}]);
         
        // Do some configuration
		myDragDropDartboard.config.dartboard.fontColor = '000000';
		myDragDropDartboard.config.dartboard.fontSize = '15';
		myDragDropDartboard.config.dartboard.fontText = 'Arial';
		myDragDropDartboard.config.dartboard.oddColor = '865000';
		myDragDropDartboard.config.dartboard.evenColor = 'FFAA00';
		myDragDropDartboard.config.dartboard.borderColor = '000000'; 
      
         // Initalize the drag slider
         myDragDropDartboard.init();
      }
   );
};";
]
<p> How do you feel about these brands? </p>
SQ:[
REVERSE = false;
MAX_TEXT = "Like";
MIN_TEXT = "Hate";
MIN_VALUE = 1;
MAX_VALUE = 8;
DISCRETE = false;
STEP = 1;
REQUIRED = true;
]<img width="61" height="62" style="border: 0" src="../../Images/GetImage.aspx?rid=a4cdc124-b643-4418-9b29-317954071c1f">
SQ:[
REVERSE = false;
MIN_VALUE = 1;
MAX_VALUE = 8;
DISCRETE = false;
STEP = 1;
]<img width="61" height="62" style="border: 0" src="../../Images/GetImage.aspx?rid=e8e7bc9c-ca9d-497f-9fc7-abf4f8fd2421">
SQ:[
REVERSE = false;
MIN_VALUE = 1;
MAX_VALUE = 8;
DISCRETE = false;
STEP = 1;
REQUIRED = true;
]<img width="61" height="62" style="border: 0" src="../../Images/GetImage.aspx?rid=8d90a277-b8aa-44ae-a2bf-85f4297612c2">
SQ:[
REVERSE = false;
MIN_VALUE = 1;
MAX_VALUE = 8;
DISCRETE = false;
STEP = 1;
]<img width="61" height="62" style="border: 0" src="../../Images/GetImage.aspx?rid=49f55180-0521-44d6-af17-86fe0efc5fb7">
SQ:[
REVERSE = false;
MIN_VALUE = 1;
MAX_VALUE = 8;
DISCRETE = false;
STEP = 1;]<img width="61" height="62" style="border: 0" src="../../Images/GetImage.aspx?rid=1e245119-905c-4a47-ae17-588ea2aa91b3">

The image path will look something like the following:

../../Images/GetImage.aspx?rid=8b8121cc-5ae5-4679-857b-12302efe70aa

If you already have a scale grid question which you want to apply the Drag drop dartboard question view to, then you just copy and paste the following JavaScript into the question script property for the question:

// Enter the GUID for the JavaScript attachment
var javaScriptGuid = 'c0d002a9-056f-4fdc-ba65-401bddea9e9d';

// Enter the GUID for the Flash attachment
var flashGuid = '216db971-5f3a-4179-9999-bd4831e160a4';

// Modify the question after the DOM has finished loading to get jQuery access
quest.onInit = function()
{
   // Load the JavaScript attachment
   $.getScript(
      '../../Attachments/GetAttachment.aspx?rid=' + javaScriptGuid,
      function()
      {
         // Create an instance of the drag slider
         var myDragDropDartboard = new DragDropDartboard(quest, flashGuid, 'D_ImagePositions', [{{D_ImagePositions}}]);
         
        // Do some configuration
		myDragDropDartboard.config.dartboard.fontColor = '000000';
		myDragDropDartboard.config.dartboard.fontSize = '15';
		myDragDropDartboard.config.dartboard.fontText = 'Arial';
		myDragDropDartboard.config.dartboard.oddColor = '865000';
		myDragDropDartboard.config.dartboard.evenColor = 'FFAA00';
		myDragDropDartboard.config.dartboard.borderColor = '000000'; 
      
         // Initalize the drag slider
         myDragDropDartboard.init();
      }
   );
};

Limitations

In the current implementation it's not possible to use permutations on the sub questions, doing so will lead to bad data, since the chosen values will be coded to sub questions randomly.