From: <no...@so...> - 2002-12-03 21:04:47
|
Bugs item #644337, was opened at 2002-11-26 15:07 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=108956&aid=644337&group_id=8956 Category: User Group: v1.5 Status: Open Resolution: None Priority: 5 Submitted By: James P. Dugal (jpd2) Assigned to: Nobody/Anonymous (nobody) Summary: Unanswered required question handling Initial Comment: I've installed phpESP-1.5 under Solaris 8, Apache 2.0.43 and PHP 4.2.3. I have built a small survey and it's working fine, except for one small anomaly: if I omit filling in a required question, I get a survey form back that includes a message about the missing questions. The problem is that the form does not have any of the answers indicated for the subset of questions that I did answer. This seems to occur because I have register_globals=Off in php.ini. The esphtml.forms.inc file has comments indicating 'needs register_globals = on' for setting the 'checked' html option. Is this desirable behaviour, in light of the recommendations in php.ini to leave register_globals set to Off? I suggest that if it is indeed a requirement to use register_globals=On for replaying the answered questions properly, then if register_globals is Off, just the missing question texts be displayed, followed by a directive to press the BACK button and resubmit. Something like this change might help (it still leaves the "Submit Survey" or "Next Page" button displayed ... so handler.php needs more work too to make this change viable. Comments, anyone? *** phpESP-1.5/admin/include/function/survey_render.inc~ Wed Sep 11 11:52:29 2002 --- phpESP-1.5/admin/include/function/survey_render.inc Fri Nov 22 18:09:01 2002 *************** *** 64,70 **** <font size="-1"><?php echo(_('Page')); ?> <?php echo($section+1); ?> <?php echo(_('of')); ?> <?php echo($num_sections); ?></font> <?php } ?> <blockquote class="addInfo"><?php echo($survey["info"]); ?></blockquote> ! <blockquote class="message"><?php echo($message); ?></blockquote> <?php if($has_required) { ?> <p class="reqQuestion"><font size="-1"><?php echo(_('Questions marked with a')); ?> <font color="#FF0000">*</font> <?php echo(_('are required.')); ?></font></p> --- 64,78 ---- <font size="-1"><?php echo(_('Page')); ?> <?php echo($section+1); ?> <?php echo(_('of')); ?> <?php echo($num_sections); ?></font> <?php } ?> <blockquote class="addInfo"><?php echo($survey["info"]); ?></blockquote> ! <blockquote class="message"><?php echo($message); ! /* if we can't fill in the responses (because register_globals=Off) ! then we advise pressing the Back button, rather than to replay ! all the questions unanswered - jp...@lo... ! */ ! if(!empty($message) && !ini_get('register_globals')) { ! echo ("Press your Back button to resume."); ! return; ! } ?></blockquote> <?php if($has_required) { ?> <p class="reqQuestion"><font size="-1"><?php echo(_('Questions marked with a')); ?> <font color="#FF0000">*</font> <?php echo(_('are required.')); ?></font></p> ---------------------------------------------------------------------- >Comment By: James P. Dugal (jpd2) Date: 2002-12-03 15:04 Message: Logged In: YES user_id=609168 I found the easiest way to avoid putting a 'Submit Survey' or 'Next Page' button when we wish to have the survey taker press their Back button, is to invoke render_survey() as a function, and test the return value. I attach a context- diff file of modifications to three routines to solve theissue I raised. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=108956&aid=644337&group_id=8956 |