Welcome, Guest
Username: Password:
  • Page:
  • 1
  • 2

TOPIC: Evaluative Space Grid - once again...

Evaluative Space Grid - once again... 4 years 6 months ago #67672

  • Mazi
  • Mazi's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5914
  • Thank you received: 357
  • Karma: 262
As always: thanks a million!

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
Last Edit: 4 years 6 months ago by Mazi.
The administrator has disabled public write access.

Evaluative Space Grid - once again... 2 years 2 months ago #105760

  • jeick
  • jeick's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 3
  • Karma: 0
Hi there,

I have just tried to implement an evaluative grid following the instructions. Everything worked out fine, only now it is not possible to select a cell in the grid and have Java Script insert the X and Y fields. It is only possible to insert values into these two fields manually.

I guess it must be a mistake somewhere in the process of entering the code into the template.js file because that's where this process is coded, right?

Does anyone have an idea what the problem is and how to solve it? I'm not much of an IT savant and already totally proud to have come this far on my own B)

Any help is much appreciated!
The administrator has disabled public write access.

Evaluative Space Grid - once again... 2 years 2 months ago #105761

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5759
  • Thank you received: 1250
  • Karma: 512
Can you activate a test survey so we can see the source and any JavaScript errors?
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The administrator has disabled public write access.

Evaluative Space Grid - once again... 2 years 2 months ago #105763

  • jeick
  • jeick's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 3
  • Karma: 0
Not sure this is what you need, but maybe have a look at this:
www.sinnovativ.de/limesurvey/index.php/s...82/newtest/Y/lang/de

It's in German, but the principle is exactly the same.

The code for the question is this:

Wie haben Sie sich heute gefühlt?
<table class="spaceGrid">
<tbody>
<tr>
<td class="yAxisLabel" rowspan="5">
Wie stark haben Sie heute NEGATIVE<br />
Gefühle<br />
erlebt?</td>
<td class="yLabel">
Sehr stark</td>
<td class="gridCell">
 </td>
<td class="gridCell">
 </td>
<td class="gridCell">
 </td>
<td class="gridCell">
 </td>
<td class="gridCell">
 </td>
</tr>
<tr>
<td class="yLabel">
Ziemlich</td>
<td class="gridCell">
 </td>
<td class="gridCell">
 </td>
<td class="gridCell">
 </td>
<td class="gridCell">
 </td>
<td class="gridCell">
 </td>
</tr>
<tr>
<td class="yLabel">
Mittelmäßig</td>
<td class="gridCell">
 </td>
<td class="gridCell">
 </td>
<td class="gridCell">
 </td>
<td class="gridCell">
 </td>
<td class="gridCell">
 </td>
</tr>
<tr>
<td class="yLabel">
Ein bisschen</td>
<td class="gridCell">
 </td>
<td class="gridCell">
 </td>
<td class="gridCell">
 </td>
<td class="gridCell">
 </td>
<td class="gridCell">
 </td>
</tr>
<tr>
<td class="yLabel">
Gar nicht</td>
<td class="gridCell">
 </td>
<td class="gridCell">
 </td>
<td class="gridCell">
 </td>
<td class="gridCell">
 </td>
<td class="gridCell">
 </td>
</tr>
<tr>
<td class="blankCell">
 </td>
<td class="blankCell">
 </td>
<td class="xLabel">
Gar nicht</td>
<td class="xLabel">
<span class="yLabel">Ein bisschen</span></td>
<td class="xLabel">
<span class="yLabel">Mittelmäßig</span></td>
<td class="xLabel">
<span class="yLabel">Ziemlich</span></td>
<td class="xLabel">
<span class="yLabel">Sehr stark</span></td>
</tr>
<tr>
<td class="blankCell">
 </td>
<td class="blankCell">
 </td>
<td class="xAxisLabel" colspan="5">
Wie stark haben Sie heute POSITIVE Gefühle erlebt?</td>
</tr>
</tbody>
</table>


Can you work with this or do you need something else? I basically just copied the code from the manual into the respective places...
The administrator has disabled public write access.

Evaluative Space Grid - once again... 2 years 2 months ago #105765

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5759
  • Thank you received: 1250
  • Karma: 512
You have an error in the correctPNG() function in template.js. This function is no longer required. Remove everything in template.js except the following code and retest.
	$(document).ready(function() {
 
    	// Listener on the grid cells
		$('.gridCell').click(function(){
 
			// Define some vars
			var parentQ = $(this).parents('div[id^="question"]:eq(0)');
			var parentTable = $(this).parents('table.spaceGrid:eq(0)');
			var parentRow = $(this).parent();
			var numGridCell = $('.gridCell').length;
			var numCols = $('.gridCell', parentRow).length;
			var numRows = numGridCell/numCols;
 
			// Add class to checked cell
			$('.checkedCell', parentQ).removeClass('checkedCell');			
			$(this).addClass('checkedCell');
 
			// Find the cell coordinates
			var reverseRowIndex = (numRows - $('tr', parentTable).index($(parentRow)));
			var colIndex = $('.gridCell', parentRow).index($(this)) + 1;
 
			// Load coordinates into inputs
			$('input.text:eq(0)', parentQ).val(colIndex);
			$('input.text:eq(1)', parentQ).val(reverseRowIndex);
		});
 
	});
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The administrator has disabled public write access.
The following user(s) said Thank You: jeick

Evaluative Space Grid - once again... 2 years 2 months ago #105766

  • jeick
  • jeick's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 3
  • Karma: 0
Perfect, this works!!!

(The test survey doesn't anymore, but the actual one works perfectly now, which is all that counts!)
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Moderators: ITEd
Time to create page: 0.206 seconds