Commit ba899c82 authored by lrargerich's avatar lrargerich

Surveys modifications

parent b4c94f54
......@@ -542,6 +542,7 @@ tiki/templates/tiki-list_games.tpl -text
tiki/templates/tiki-list_posts.tpl -text
tiki/templates/tiki-list_quizzes.tpl -text
tiki/templates/tiki-list_submissions.tpl -text
tiki/templates/tiki-list_surveys.tpl -text
tiki/templates/tiki-list_trackers.tpl -text
tiki/templates/tiki-listpages.tpl -text
tiki/templates/tiki-objectpermissions.tpl -text
......@@ -583,7 +584,10 @@ tiki/templates/tiki-slideshow.tpl -text
tiki/templates/tiki-special_chars.html -text
tiki/templates/tiki-special_chars.php -text
tiki/templates/tiki-stats.tpl -text
tiki/templates/tiki-survey_stats.tpl -text
tiki/templates/tiki-survey_stats_survey.tpl -text
tiki/templates/tiki-take_quiz.tpl -text
tiki/templates/tiki-take_survey.tpl -text
tiki/templates/tiki-top_bar.tpl -text
tiki/templates/tiki-upload_file.tpl -text
tiki/templates/tiki-upload_image.tpl -text
......@@ -704,6 +708,7 @@ tiki/tiki-list_games.php -text
tiki/tiki-list_posts.php -text
tiki/tiki-list_quizzes.php -text
tiki/tiki-list_submissions.php -text
tiki/tiki-list_surveys.php -text
tiki/tiki-list_trackers.php -text
tiki/tiki-listpages.php -text
tiki/tiki-login.php -text
......@@ -748,7 +753,10 @@ tiki/tiki-setup_base.php -text
tiki/tiki-shoutbox.php -text
tiki/tiki-slideshow.php -text
tiki/tiki-stats.php -text
tiki/tiki-survey_stats.php -text
tiki/tiki-survey_stats_survey.php -text
tiki/tiki-take_quiz.php -text
tiki/tiki-take_survey.php -text
tiki/tiki-upload_file.php -text
tiki/tiki-upload_image.php -text
tiki/tiki-usage_chart -text
......
......@@ -25,6 +25,7 @@ create table tiki_survey_questions (
position integer(5),
votes integer(10),
value integer(10),
average decimal(4,2),
primary key(questionId)
);
......
......@@ -22,6 +22,68 @@ class TikiLib {
}
/* Surveys */
function add_survey_hit($surveyId)
{
$now=date("U");
$query = "update tiki_surveys set taken=taken+1, lastTaken=$now where surveyId=$surveyId";
$result = $this->db->query($query);
if(DB::isError($result)) $this->sql_error($query, $result);
}
function register_survey_text_option_vote($questionId,$value)
{
$value=addslashes($value);
$cant = $this->db->getOne("select count(*) from tiki_survey_question_options where qoption='$value'");
if($cant) {
$query = "update tiki_survey_question_options set votes=votes+1 where questionId=$questionId and qoption='$value'";
} else {
$query = "insert into tiki_survey_question_options(questionId,qoption,votes)
values($questionId,'$value',1)";
}
$result = $this->db->query($query);
if(DB::isError($result)) $this->sql_error($query, $result);
}
function register_survey_rate_vote($questionId,$rate)
{
$query = "update tiki_survey_questions set votes=votes+1, value=value+$rate where questionId=$questionId";
$result = $this->db->query($query);
if(DB::isError($result)) $this->sql_error($query, $result);
$query = "update tiki_survey_questions set average=value/votes where questionId=$questionId";
$result = $this->db->query($query);
if(DB::isError($result)) $this->sql_error($query, $result);
}
function register_survey_option_vote($questionId,$optionId)
{
$query = "update tiki_survey_question_options set votes=votes+1 where questionId=$questionId and optionId=$optionId";
$result = $this->db->query($query);
if(DB::isError($result)) $this->sql_error($query, $result);
}
function clear_survey_stats($surveyId)
{
$query = "update tiki_surveys set taken=0 where surveyId=$surveyId";
$result = $this->db->query($query);
if(DB::isError($result)) $this->sql_error($query, $result);
$query = "select * from tiki_survey_questions where surveyId=$surveyId";
$result = $this->db->query($query);
if(DB::isError($result)) $this->sql_error($query, $result);
// Remove all the options for each question
while($res = $result->fetchRow(DB_FETCHMODE_ASSOC)) {
$questionId = $res["questionId"];
$query2 = "updatet iki_survey_question_options set votes=0 where questionId=$questionId";
$result2 = $this->db->query($query2);
if(DB::isError($result2)) $this->sql_error($query2, $result2);
}
$query = "update tiki_survey_questions set value=0,votes=0 where surveyId=$surveyId";
$result = $this->db->query($query);
if(DB::isError($result)) $this->sql_error($query, $result);
}
function replace_survey($surveyId,$name,$description,$status)
{
$name = addslashes($name);
......@@ -124,9 +186,12 @@ class TikiLib {
$result = $this->db->query($query);
if(DB::isError($result)) $this->sql_error($query, $result);
$ret = Array();
$votes = 0;
while($res = $result->fetchRow(DB_FETCHMODE_ASSOC)) {
$ret[]=$res;
$votes += $res["votes"];
}
$res2["ovotes"]=$votes;
$res2["qoptions"]=$ret;
return $res2;
}
......@@ -177,10 +242,13 @@ class TikiLib {
$result2 = $this->db->query($query2);
if(DB::isError($result2)) $this->sql_error($query2, $result2);
$ret2 = Array();
$votes=0;
while($res2 = $result2->fetchRow(DB_FETCHMODE_ASSOC)) {
$ret2[]=$res2;
$votes += $res2["votes"];
}
$res["qoptions"]=$ret2;
$res["ovotes"]=$votes;
$ret[] = $res;
}
$retval = Array();
......
......@@ -14,7 +14,7 @@
{if $smarty.section.user.index % 2}
<tr>
<td class="odd"><a class="tablename" href="tiki-take_quiz.php?quizId={$channels[user].quizId}">{$channels[user].name}</a>
{if ($tiki_p_admin eq 'y') or ($channels[user].individual eq 'n' and $tiki_p_admin_quizzes eq 'y') or ($channels[user].individual_tiki_p_admin_quizzes eq 'y')} (<a class="link" href="tiki-edit_quiz.php?quidIz={$channels[user].quizId}"><small>adm</small></a>){/if}
{if ($tiki_p_admin eq 'y') or ($channels[user].individual eq 'n' and $tiki_p_admin_quizzes eq 'y') or ($channels[user].individual_tiki_p_admin_quizzes eq 'y')} (<a class="link" href="tiki-edit_quiz.php?quizId={$channels[user].quizId}"><small>adm</small></a>){/if}
{if ($tiki_p_admin eq 'y') or ($channels[user].individual eq 'n' and $tiki_p_view_quiz_stats eq 'y') or ($channels[user].individual_tiki_p_view_quiz_stats eq 'y')} (<a class="link" href="tiki-quiz_stats_quiz.php?quizId={$channels[user].quizId}"><small>stats</small></a>){/if}
</td>
<td class="odd">{$channels[user].description}</td>
......
<a class="pagetitle" href="tiki-list_surveys.php">Surveys</a><br/><br/>
{if $tiki_p_view_survey_stats eq 'y'}
<a class="link" href="tiki-survey_stats.php">{tr}Survey stats{/tr}</a><br/><br/>
{/if}
<table class="normal">
<tr>
<td class="heading"><a class="tableheading" href="tiki-list_surveys.php?offset={$offset}&amp;sort_mode={if $sort_mode eq 'name_desc'}name_asc{else}name_desc{/if}">{tr}name{/tr}</a></td>
<td class="heading"><a class="tableheading" href="tiki-list_surveys.php?offset={$offset}&amp;sort_mode={if $sort_mode eq 'description_desc'}description_asc{else}description_desc{/if}">{tr}description{/tr}</a></td>
<td class="heading">{tr}questions{/tr}</td>
</tr>
{cycle values="odd,even" print=false}
{section name=user loop=$channels}
{if ($tiki_p_admin eq 'y') or ($channels[user].individual eq 'n' and $tiki_p_take_survey eq 'y') or ($channels[user].individual_tiki_p_take_survey eq 'y')}
<tr>
<td class="{cycle advance=false}"><a class="tablename" href="tiki-take_survey.php?surveyId={$channels[user].surveyId}">{$channels[user].name}</a>
{if ($tiki_p_admin eq 'y') or ($channels[user].individual eq 'n' and $tiki_p_admin_surveys eq 'y') or ($channels[user].individual_tiki_p_admin_surveys eq 'y')} (<a class="link" href="tiki-admin_survey.php?surveyId={$channels[user].surveyId}"><small>adm</small></a>){/if}
{if ($tiki_p_admin eq 'y') or ($channels[user].individual eq 'n' and $tiki_p_view_survey_stats eq 'y') or ($channels[user].individual_tiki_p_view_survey_stats eq 'y')} (<a class="link" href="tiki-survey_stats_survey.php?surveyId={$channels[user].surveyId}"><small>stats</small></a>){/if}
</td>
<td class="{cycle advance=false}">{$channels[user].description}</td>
<td class="{cycle}">{$channels[user].questions}</td>
</tr>
{/if}
{/section}
</table>
<br/>
<div align="center">
<div class="mini">
{if $prev_offset >= 0}
[<a class="prevnext" href="tiki-list_surveys.php?find={$find}&amp;offset={$prev_offset}&amp;sort_mode={$sort_mode}">{tr}prev{/tr}</a>]&nbsp;
{/if}
{tr}Page{/tr}: {$actual_page}/{$cant_pages}
{if $next_offset >= 0}
&nbsp;[<a class="prevnext" href="tiki-list_surveys.php?find={$find}&amp;offset={$next_offset}&amp;sort_mode={$sort_mode}">{tr}next{/tr}</a>]
{/if}
</div>
</div>
<a class="pagetitle" href="tiki-survey_stats.php">{tr}Stats for surveys{/tr}</a><br/><br/>
[<a class="link" href="tiki-list_surveys.php">{tr}list surveys{/tr}</a>
|<a class="link" href="tiki-survey_stats.php">{tr}survey stats{/tr}</a>
|<a class="link" href="tiki-admin_surveys.php">{tr}admin surveys{/tr}</a>]<br/><br/>
<h2>{tr}Surveys{/tr}</h2>
<div align="center">
<table class="findtable">
<tr><td class="findtable">{tr}Find{/tr}</td>
<td class="findtable">
<form method="get" action="tiki-survey_stats.php">
<input type="text" name="find" value="{$find}" />
<input type="submit" value="{tr}find{/tr}" name="search" />
<input type="hidden" name="sort_mode" value="{$sort_mode}" />
<input type="hidden" name="surveyId" value="{$surveyId}" />
</form>
</td>
</tr>
</table>
<table class="normal">
<tr>
<td class="heading"><a class="tableheading" href="tiki-survey_stats.php?offset={$offset}&amp;sort_mode={if $sort_mode eq 'name_desc'}name_asc{else}name_desc{/if}">{tr}Survey{/tr}</a></td>
<td class="heading"><a class="tableheading" href="tiki-survey_stats.php?offset={$offset}&amp;sort_mode={if $sort_mode eq 'taken_desc'}taken_asc{else}taken_desc{/if}">{tr}taken{/tr}</a></td>
<td class="heading"><a class="tableheading" href="tiki-survey_stats.php?offset={$offset}&amp;sort_mode={if $sort_mode eq 'created_desc'}created_asc{else}created_desc{/if}">{tr}Created{/tr}</a></td>
<td class="heading"><a class="tableheading" href="tiki-survey_stats.php?offset={$offset}&amp;sort_mode={if $sort_mode eq 'lastTaken_desc'}lastTaken_asc{else}lastTaken_desc{/if}">{tr}Last taken{/tr}</a></td>
</tr>
{cycle values="odd,even" print=false}
{section name=user loop=$channels}
{if ($tiki_p_admin eq 'y') or ($channels[user].individual eq 'n' and $tiki_p_view_survey_stats eq 'y') or ($channels[user].individual_tiki_p_view_survey_stats eq 'y')}
<tr>
<td class="{cycle advance=false}"><a class="tablename" href="tiki-survey_stats_survey.php?surveyId={$channels[user].surveyId}">{$channels[user].name}</a></td>
<td class="{cycle advance=false}">{$channels[user].taken}</td>
<td class="{cycle advance=false}">{$channels[user].created|date_format:"%a %d of %b [%H:%M]"}}</td>
<td class="{cycle advance=false}">{$channels[user].lastTaken|date_format:"%a %d of %b [%H:%M]"}}</td>
</tr>
{/if}
{/section}
</table>
<div class="mini">
{if $prev_offset >= 0}
[<a class="prevnext" href="tiki-survey_stats.php?surveyId={$surveyId}&amp;find={$find}&amp;offset={$prev_offset}&amp;sort_mode={$sort_mode}">{tr}prev{/tr}</a>]&nbsp;
{/if}
{tr}Page{/tr}: {$actual_page}/{$cant_pages}
{if $next_offset >= 0}
&nbsp;[<a class="prevnext" href="tiki-survey_stats.php?surveyId={$surveyId}&amp;find={$find}&amp;offset={$next_offset}&amp;sort_mode={$sort_mode}">{tr}next{/tr}</a>]
{/if}
</div>
</div>
<form name="aform" action="tiki-take_survey.php" method="post">
<input type="hidden" name="surveyId" value="{$surveyId}" />
<h2>{$survey_info.name}</h2>
<div class="quizdescription">{$survey_info.description}</div>
{section name=ix loop=$questions}
<div class="questionblock">
<div class="quizquestion">{$questions[ix].question}</div>
{if $questions[ix].type eq 'c'}
<div class="quizoptions">
{section name=jx loop=$questions[ix].qoptions}
<input type="radio" value="{$questions[ix].qoptions[jx].optionId}" name="question_{$questions[ix].questionId}">{$questions[ix].qoptions[jx].qoption}<br/>
{/section}
</div>
{/if}
{if $questions[ix].type eq 't'}
<div class="quizoptions">
<input type="text" name="question_{$questions[ix].questionId}" />
</div>
{/if}
{if $questions[ix].type eq 'm'}
<div class="quizoptions">
{section name=jx loop=$questions[ix].qoptions}
<input type="checkbox" value="{$questions[ix].qoptions[jx].optionId}" name="question_{$questions[ix].questionId}[{$questions[ix].qoptions[jx].optionId}]">{$questions[ix].qoptions[jx].qoption}<br/>
{/section}
</div>
{/if}
{if $questions[ix].type eq 'r'}
<div class="quizoptions">
1<input type="radio" value="1" name="question_{$questions[ix].questionId}" />
<input type="radio" value="2" name="question_{$questions[ix].questionId}" />
<input type="radio" value="3" name="question_{$questions[ix].questionId}" />
<input type="radio" value="4" name="question_{$questions[ix].questionId}" />
<input type="radio" value="5" name="question_{$questions[ix].questionId}" />5
</div>
{/if}
{if $questions[ix].type eq 's'}
<div class="quizoptions">
1<input type="radio" value="1" name="question_{$questions[ix].questionId}" />
<input type="radio" value="2" name="question_{$questions[ix].questionId}" />
<input type="radio" value="3" name="question_{$questions[ix].questionId}" />
<input type="radio" value="4" name="question_{$questions[ix].questionId}" />
<input type="radio" value="5" name="question_{$questions[ix].questionId}" />
<input type="radio" value="6" name="question_{$questions[ix].questionId}" />
<input type="radio" value="7" name="question_{$questions[ix].questionId}" />
<input type="radio" value="8" name="question_{$questions[ix].questionId}" />
<input type="radio" value="9" name="question_{$questions[ix].questionId}" />
<input type="radio" value="10" name="question_{$questions[ix].questionId}" />10
</div>
{/if}
</div>
{/section}
<input type="submit" value="{tr}send answers{/tr}" name="ans" />
</form>
\ No newline at end of file
<?php
// Initialization
require_once('tiki-setup.php');
/*
if($feature_quizzes != 'y') {
$smarty->assign('msg',tra("This feature is disabled"));
$smarty->display('error.tpl');
die;
}
*/
/*
if($tiki_p_take_quiz != 'y') {
$smarty->assign('msg',tra("You dont have permission to use this feature"));
$smarty->display('error.tpl');
die;
}
*/
if(!isset($_REQUEST["sort_mode"])) {
$sort_mode = 'created_desc';
} else {
$sort_mode = $_REQUEST["sort_mode"];
}
if(!isset($_REQUEST["offset"])) {
$offset = 0;
} else {
$offset = $_REQUEST["offset"];
}
$smarty->assign_by_ref('offset',$offset);
if(isset($_REQUEST["find"])) {
$find = $_REQUEST["find"];
} else {
$find = '';
}
$smarty->assign('find',$find);
$smarty->assign_by_ref('sort_mode',$sort_mode);
$channels = $tikilib->list_surveys($offset,$maxRecords,$sort_mode,$find);
for($i=0;$i<count($channels["data"]);$i++) {
if($userlib->object_has_one_permission($channels["data"][$i]["surveyId"],'survey')) {
$channels["data"][$i]["individual"]='y';
if($userlib->object_has_permission($user,$channels["data"][$i]["surveyId"],'survey','tiki_p_take_survey')) {
$channels["data"][$i]["individual_tiki_p_take_survey"]='y';
} else {
$channels["data"][$i]["individual_tiki_p_take_survey"]='n';
}
if($userlib->object_has_permission($user,$channels["data"][$i]["surveyId"],'survey','tiki_p_view_survey_stats')) {
$channels["data"][$i]["individual_tiki_p_view_survey_stats"]='y';
} else {
$channels["data"][$i]["individual_tiki_p_view_survey_stats"]='n';
}
if($tiki_p_admin=='y' || $userlib->object_has_permission($user,$channels["data"][$i]["surveyId"],'survey','tiki_p_admin_surveys')) {
$channels["data"][$i]["individual_tiki_p_take_survey"]='y';
$channels["data"][$i]["individual_tiki_p_view_survey_stats"]='y';
$channels["data"][$i]["individual_tiki_p_admin_surveys"]='y';
}
} else {
$channels["data"][$i]["individual"]='n';
}
}
$cant_pages = ceil($channels["cant"] / $maxRecords);
$smarty->assign_by_ref('cant_pages',$cant_pages);
$smarty->assign('actual_page',1+($offset/$maxRecords));
if($channels["cant"] > ($offset+$maxRecords)) {
$smarty->assign('next_offset',$offset + $maxRecords);
} else {
$smarty->assign('next_offset',-1);
}
// If offset is > 0 then prev_offset
if($offset>0) {
$smarty->assign('prev_offset',$offset - $maxRecords);
} else {
$smarty->assign('prev_offset',-1);
}
$smarty->assign_by_ref('channels',$channels["data"]);
$section='surveys';
include_once('tiki-section_options.php');
// Display the template
$smarty->assign('mid','tiki-list_surveys.tpl');
$smarty->display('tiki.tpl');
?>
\ No newline at end of file
<?php
// Initialization
require_once('tiki-setup.php');
/*
if($tiki_p_admin != 'y') {
$smarty->assign('msg',tra("You dont have permission to use this feature"));
$smarty->display('error.tpl');
die;
}
*/
/*
if($feature_surveys != 'y') {
$smarty->assign('msg',tra("This feature is disabled"));
$smarty->display('error.tpl');
die;
}
*/
if($tiki_p_view_survey_stats != 'y') {
$smarty->assign('msg',tra("You dont have permission to use this feature"));
$smarty->display('error.tpl');
die;
}
if(!isset($_REQUEST["sort_mode"])) {
$sort_mode = 'created_desc';
} else {
$sort_mode = $_REQUEST["sort_mode"];
}
if(!isset($_REQUEST["offset"])) {
$offset = 0;
} else {
$offset = $_REQUEST["offset"];
}
$smarty->assign_by_ref('offset',$offset);
if(isset($_REQUEST["find"])) {
$find = $_REQUEST["find"];
} else {
$find = '';
}
$smarty->assign('find',$find);
$smarty->assign_by_ref('sort_mode',$sort_mode);
$channels = $tikilib->list_surveys($offset,$maxRecords,$sort_mode,$find);
for($i=0;$i<count($channels["data"]);$i++) {
if($userlib->object_has_one_permission($channels["data"][$i]["surveyId"],'survey')) {
$channels["data"][$i]["individual"]='y';
if($userlib->object_has_permission($user,$channels["data"][$i]["surveyId"],'survey','tiki_p_take_survey')) {
$channels["data"][$i]["individual_tiki_p_take_survey"]='y';
} else {
$channels["data"][$i]["individual_tiki_p_take_survey"]='n';
}
if($userlib->object_has_permission($user,$channels["data"][$i]["surveyId"],'survey','tiki_p_view_survey_stats')) {
$channels["data"][$i]["individual_tiki_p_view_survey_stats"]='y';
} else {
$channels["data"][$i]["individual_tiki_p_view_survey_stats"]='n';
}
if($tiki_p_admin=='y' || $userlib->object_has_permission($user,$channels["data"][$i]["surveyId"],'survey','tiki_p_admin_surveys')) {
$channels["data"][$i]["individual_tiki_p_take_survey"]='y';
$channels["data"][$i]["individual_tiki_p_view_survey_stats"]='y';
$channels["data"][$i]["individual_tiki_p_admin_surveys"]='y';
}
} else {
$channels["data"][$i]["individual"]='n';
}
}
$cant_pages = ceil($channels["cant"] / $maxRecords);
$smarty->assign_by_ref('cant_pages',$cant_pages);
$smarty->assign('actual_page',1+($offset/$maxRecords));
if($channels["cant"] > ($offset+$maxRecords)) {
$smarty->assign('next_offset',$offset + $maxRecords);
} else {
$smarty->assign('next_offset',-1);
}
// If offset is > 0 then prev_offset
if($offset>0) {
$smarty->assign('prev_offset',$offset - $maxRecords);
} else {
$smarty->assign('prev_offset',-1);
}
$smarty->assign_by_ref('channels',$channels["data"]);
$section='surveys';
include_once('tiki-section_options.php');
// Display the template
$smarty->assign('mid','tiki-survey_stats.tpl');
$smarty->display('tiki.tpl');
?>
\ No newline at end of file
SURVEY STATS SURVEY
\ No newline at end of file
<?php
// Initialization
require_once('tiki-setup.php');
/*
if($feature_surveys != 'y') {
$smarty->assign('msg',tra("This feature is disabled"));
$smarty->display('error.tpl');
die;
}
*/
if(!isset($_REQUEST["surveyId"])) {
$smarty->assign('msg',tra("No survey indicated"));
$smarty->display('error.tpl');
die;
}
$smarty->assign('individual','n');
if($userlib->object_has_one_permission($_REQUEST["surveyId"],'survey')) {
$smarty->assign('individual','y');
if($tiki_p_admin != 'y') {
$perms = $userlib->get_permissions(0,-1,'permName_desc','','surveys');
foreach($perms["data"] as $perm) {
$permName=$perm["permName"];
if($userlib->object_has_permission($user,$_REQUEST["surveyId"],'survey',$permName)) {
$$permName = 'y';
$smarty->assign("$permName",'y');
} else {
$$permName = 'n';
$smarty->assign("$permName",'n');
}
}
}
}
$smarty->assign('surveyId',$_REQUEST["surveyId"]);
$survey_info=$tikilib->get_survey($_REQUEST["surveyId"]);
if($tiki_p_take_survey != 'y') {
$smarty->assign('msg',tra("You dont have permission to use this feature"));
$smarty->display('error.tpl');
die;
}
// Check if user has taken this survey
if($tiki_p_admin != 'y') {
if($tikilib->user_has_voted($user,'survey'.$_REQUEST["surveyId"])) {
$smarty->assign('msg',tra("You cannot take this survey twice"));
$smarty->display('error.tpl');
die;
} else {
$tikilib->register_user_vote($user,'survey'.$_REQUEST["surveyId"]);
}
}
$tikilib->add_survey_hit($_REQUEST["surveyId"]);
$smarty->assign('survey_info',$survey_info);
$questions = $tikilib->list_survey_questions($_REQUEST["surveyId"],0,-1,'position_asc','');
$smarty->assign_by_ref('questions',$questions["data"]);
if(isset($_REQUEST["ans"])) {
foreach($questions["data"] as $question) {
$questionId=$question["questionId"];
//print("question: $questionId<br/>");
if(isset($_REQUEST["question_".$questionId])) {
if($question["type"]=='m') {
// If we have a multiple question
$ids = array_keys($_REQUEST["question_".$questionId]);
//print_r($ids);
// Now for each of the options we increase the number of votes
foreach($ids as $optionId) {
$tikilib->register_survey_option_vote($questionId,$optionId);
}
} else {
$value = $_REQUEST["question_".$questionId];
//print("value: $value<br/>");
if($question["type"]=='r' || $question["type"]=='s') {
$tikilib->register_survey_rate_vote($questionId,$value);
} elseif ($question["type"]=='t') {
$tikilib->register_survey_text_option_vote($questionId,$value);
} else {
$tikilib->register_survey_option_vote($questionId,$value);
}
}
}
}
// Redirect to survey stats if the user has permission or to tiki-index if not..
}
//print_r($questions);
$section='surveys';
include_once('tiki-section_options.php');
// Display the template
$smarty->assign('mid','tiki-take_survey.tpl');
$smarty->display('tiki.tpl');
?>
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment