Check out the LimeSurvey source code on GitHub!

Confirm Results/Unanswered Questions

More
5 years 9 months ago #61055 by andrewteg
I would like to add a page after all my questions that shows the answers and hopefully highlights any non-mandatory questions that were skipped so the takers realize they skipped some questions before they submit the responses. Is this possible?

Also, I have "list with comment" questions but if they choose something and do not fill in a comment the "question index / allow jumping" feature marks it as not answered but I want it marked as answered. Is this possible?

Thanks,
Andrew

Please Log in to join the conversation.

More
5 years 9 months ago #61061 by tpartner
1) You can use {INSERTANS} to display answers to previous questions - docs.limesurvey.org/Adding+a+question&hi...rom_previous_answers

2) I'm afraid I don't understand "the "question index / allow jumping" feature marks it as not answered". Could you please elaborate or provide a screenshot?

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: andrewteg

Please Log in to join the conversation.

More
5 years 9 months ago #61062 by andrewteg
Thanks Tony.

1) I can certainly use this and probably will. Somewhat related do you know when the printable results link is supposed to come up? I could not find how to get to that page after taking a survey.

2) I attached a screenshot of a question but basically I answer it (pick a radio button), click Next, and then click Previous and it says it is not complete (in red with missing class) because I did not fill out a comment. It is a list with comment question type and I'd like to have it marked as complete once the user picks a radio button. (Since the question is marked as incomplete the section is in the Question Index feature as well which is what I referenced originally but I hope it's clearer to see on a specific question)

Thanks again for your help!
Andrew
Attachments:

Please Log in to join the conversation.

More
5 years 9 months ago #61110 by andrewteg
FYI, I have found some solutions browsing around.

1) I like the idea at ideas.limesurvey.org/ideatorrent/idea/225 as the review/print ability is needed before submission on certain questionnaires. For now I found www.limesurvey.org/en/forum/future-featu...e-submitting-answers asking what I want so I guess using {INSERTANS} on a boilerplate at the end is the best solution to date, but that's disappointing as you cannot reuse question text with that method.

2) I have found the solution by editing the common_function bCheckQuestionForAnswer as follows for anyone interested:
/**
 * Check if a question was (at least partially) answered in the current session.
 *
 * @param integer $q - Question id
 * @param array $aFieldnamesInfoInv - Inverted fieldnamesInfo
 */
function bCheckQuestionForAnswer($q, $aFieldnamesInfoInv)
{
	//echo "TYPE=".$_SESSION['fieldmap'][$aFieldnamesInfoInv[$q][0]]['type']."|";
    if(@$_SESSION['fieldmap'][$aFieldnamesInfoInv[$q][0]]['type'] != 'M' && @$_SESSION['fieldmap'][$aFieldnamesInfoInv[$q][0]]['type'] != 'O')
    {
        // all answers required
        $bAnsw = true;
        foreach($aFieldnamesInfoInv[$q] as $sField)
        {
            if(!isset($_SESSION[$sField]) || trim($_SESSION[$sField])=='')
            {
                $bAnsw = false;
                break;
            }
        }
    } elseif (@$_SESSION['fieldmap'][$aFieldnamesInfoInv[$q][0]]['type'] == 'O') {
		// list with comment, just list is required
		//echo "<PRE>"; print_r($aFieldnamesInfoInv[$q]); echo "</PRE>";
        $bAnsw = false;
        foreach($aFieldnamesInfoInv[$q] as $sField) {
            if(!strstr($sField, 'comment') && isset($_SESSION[$sField]) && trim($_SESSION[$sField])!='') {
                $bAnsw = true;
                break;
            }
        }
    } else {
        // multiple choice, just one answer is required
        $bAnsw = false;
        foreach($aFieldnamesInfoInv[$q] as $sField)
        {
            if(isset($_SESSION[$sField]) && trim($_SESSION[$sField])!='')
            {
                $bAnsw = true;
                break;
            }
        }
	}
    return $bAnsw;
}

Thanks for the help all, and please let me know if anyone finds an easier way to have a review screen before submission!

Thanks,
Andrew

Please Log in to join the conversation.

More
5 years 9 months ago - 5 years 9 months ago #61111 by tpartner
Andrew, regarding item 2 - in my opinion, this is a bug. When setting the question to mandatory, the textarea is not required so I don't think it should be required for the "question index / allow jumping" feature.

Could you please file a bug report and include your description, screenshot and fix?

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last Edit: 5 years 9 months ago by tpartner.

Please Log in to join the conversation.

More
5 years 9 months ago #61112 by andrewteg

Please Log in to join the conversation.

Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form