Welcome, Guest
Username: Password: Remember me

TOPIC: Public statistics on the survey list page

Public statistics on the survey list page 2 years 11 months ago #66723

  • grahamc
  • grahamc's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 1
  • Karma: 0
I have public statistics switched on.
I'd like to restrict viewing of statistics to those who have completed the survey and not have the statistics available from the survey list page.
It seems I cannot separate the survey list from the statistics link in the survey list template page.
The only way I've found is by altering the index.php code so that the statistics link is not generated as part of the survey list.
However, I didn't really want to do this considering it might be lost when I next upgrade.

Can anyone help?
Thanks.
The administrator has disabled public write access.

Re: Public statistics on the survey list page 2 years 11 months ago #66725

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4195
  • Thank you received: 789
  • Karma: 359
Well, if you don't want to hack the core code (which I agree with), you can do the following to hide the link in the survey list page.

It should be noted that this will not make the public statistics totally inaccessable, but merely hide the links. If a user finds the URL from the page source (or elswhere) they will be able to see the statistics.

This workaround assumes that you are using the default template for the admin interface.

1) Create a copy of the default template.

2) In Global settings --> General, set the "Default template" to your new template.

3) Add the following to the end of template.js in your new template:
$(document).ready(function(){
 
	$('.survey-list li').each(function(){
		$('a:eq(1)', this).hide();
	});
});
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.100 seconds
Donation Image