From: Roman J. <cit...@ma...> - 2002-03-17 12:11:39
|
Good job there, but we have a problem now. There is another branch that=20= is being developed for ESP where Statement question is being used for=20= something else. In fact it has the same id(11). This presents a problem=20= for the developers. I guess the solution would be to discuss details=20 with James first, since he is the Chief Yahoo here, and than put in a=20 developers list on the SF.net. This way we should be able to make sure=20= that no one will have to go back and rewrite his code. -Roman On Sunday, March 17, 2002, at 01:20 PM, angek productions wrote: > All, > =A0 > =A0=A0=A0 There are a few other files that need to be changed that I = have not=20 > mentioned. > =A0=A0=A0 The changes mentioned below (in my original post)=A0suppress = a=20 > question number from appearing > =A0=A0=A0 next to the Statement, however this means that=A0the next = valid=20 > question will appear to not > =A0=A0=A0 have a consecutive Question number appearing next to it. > =A0=A0=A0 for example, > =A0=A0=A0=A0=A0=A0=A0 assume our survey has 5 questions which includes = the Statement. > =A0=A0=A0=A0=A0=A0=A0 If our Statement is question 3 then our survey = will show the=20 > following: > =A0=A0=A0=A0=A0=A0=A0 (1) Question text > =A0=A0=A0=A0=A0=A0=A0 (2) Question text > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 Statement > =A0=A0=A0=A0=A0=A0=A0 (4) Question text > =A0=A0=A0=A0=A0=A0=A0 (5) Question text > =A0 > =A0=A0=A0To correct this the code should be: > =A0 > =A0=A0=A0 <?php > =A0=A0=A0 if ($tid !=3D '11') > =A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 echo = ("<A NAME=3D\"Q($i)\">($i).</A>");=A0=A0=A0 > =A0=A0=A0=A0else > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0$i--; > =A0=A0=A0 ?> > =A0 > =A0=A0=A0 Once this is done you will notice that=A0viewing survey = results, and=20 > viewing a survey report will > =A0=A0=A0not be consistent with the above ammendment so the following = further=20 > changes need to be made > =A0=A0=A0to provide consistency through the entire phpesp package. > =A0 > =A0=A0=A0The following files must be changed: > =A0=A0=A01- /lib/esphtml.results.inc > =A0=A0=A02- /function/survey_results.inc > =A0=A0=A03- /function/survey_report.inc > =A0=A0=A04- /function/survey_merge.inc > =A0 > =A0=A0=A0Changes to esphtml.results.inc > =A0=A0=A0=A0=A0=A0=A0 line 188 : function=20 > mkreslist($counts,$total,$precision,$showTotals) { > =A0=A0=A0=A0=A0=A0=A0 should be changed to : function=20 > mkreslist($counts,$total,$precision,$showTotals,$tid) { > =A0 > =A0=A0=A0=A0=A0=A0=A0 after line 191: <table width=3D"90%" border=3D"0" = cellpadding=3D"1"> > =A0=A0=A0=A0=A0=A0=A0 add the following: > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 <?php if ($tid !=3D '11') > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 echo = "<tr><th=20 > align=3D\"left\">#</th><th>Response</th></tr>"; ?> > =A0=A0=A0=A0=A0=A0=A0then delete / comment out the line: <tr><th = align=3D"left"><?php=20 > echo(_('#')); ?></th><th><?php echo(_('Response')); ?></th></tr> > =A0 > =A0=A0=A0Changes to survey_results.inc > =A0=A0=A0=A0=A0=A0=A0 on about line 167 you should find the following = 2 lines: > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 <tr xbgcolor=3D"<?php echo($bg); = ?>"> > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 <td> > =A0=A0=A0=A0=A0=A0=A0 add the following straight after the above = lines: > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 <?php > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 if ($tid !=3D '11') > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 echo ("<A = NAME=3D\"Q($i)\">($i).</A>"); > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 else > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 $i--; > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 ?> > =A0=A0=A0=A0=A0=A0=A0 then delete / comment out the line: > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 <A NAME=3D"Q<?php echo($i); = ?>"><?php echo($i); ?>.</A> > =A0 > =A0=A0=A0=A0=A0=A0=A0 on about line 324:=20 > mkreslist($counts,$total,$precision,$showTotals); > =A0=A0=A0=A0=A0=A0=A0 change this to :=20 > mkreslist($counts,$total,$precision,$showTotals,$tid); > =A0=A0=A0 Changes to survey_report.inc > =A0=A0=A0=A0=A0=A0=A0 on about line 85: <tr bgcolor=3D"<?php = echo($bg); ?>"> > =A0=A0=A0=A0=A0=A0=A0 add the following straight after this line: > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 <?php > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 if ($tid !=3D '11'){ > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 echo "<td = align=3D\"right\">$i</td>"; > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 } > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 else{ > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 $i--; > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 echo "<td = align=3D\"right\"></td>"; > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 } > > =A0=A0=A0=A0=A0=A0=A0?> > > =A0=A0=A0=A0=A0=A0=A0 then delete / comment out=A0the following line: > > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0<td align=3D"right"><?php echo($i); = ?></td> > > Finally, > > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 just to be consistent with the = changes made to the=20 > mkreslist function in both esphtml.results.inc and survey_results.inc=20= > we need to make the same change to the survey_merge file. > > =A0=A0=A0=A0=A0=A0=A0 line = 350:mkreslist($counts,$total,$precision,$showTotals);=20 > needs to be changed to: > > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 = mkreslist($counts,$total,$precision,$showTotals, $tid); > > =A0 > > This should be all. If you have any problems with these changes post=20= > them here....... > > Kon=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 > > > =A0 > > -----Original Message----- > From: Kon Angelopoulos [mailto:ang...@ip...] > Sent: Sunday, 17 March 2002 7:40 PM > To: an...@cp... > Subject: FW: Adding Descriptive text in a survey. > > > > =A0-----Original Message----- > From: =A0 Kon Angelopoulos [mailto:ang...@ip...] > Sent:=A0=A0 Sunday, 17 March 2002 7:10 PM > To:=A0=A0=A0=A0 'php...@li...' > Subject:=A0=A0=A0=A0=A0=A0=A0 Adding Descriptive text in a survey. > > Hi All, > > =A0=A0=A0=A0=A0=A0=A0 One of the features I needed phpesp to have was = the ability of=20 > adding descriptive text in a survey without having it > > =A0=A0=A0=A0=A0=A0=A0 be a question. I've also noticed that this has = also appeared in=20 > the feature requests so I decided to do this myself. > > =A0=A0=A0=A0=A0=A0=A0 Here are the steps. > > =A0=A0=A0=A0=A0=A0=A0 1. log into the phpesp database and issue the = following sql=20 > statement: > =A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 " insert into = question_type=20 > values(11,'Statement','N','response_text'); " > =A0=A0=A0=A0=A0=A0=A0 > =A0=A0=A0=A0=A0=A0=A0 2. now edit the = /admin/include/function/survey_render.inc file. > =A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0A:/ > =A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 go to line 85. > =A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 the original line (version = 1.5) is: > =A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 = <?php if($question['required']=3D=3D'Y')=20 > { echo('<font color=3D"#FF0000">*</font>'); } ?><A NAME=3D"Q<?php = echo($i);=20 > ?>"><?php echo($i); ?>.</A> > > =A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 change this line to: > =A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 <?php = if($question['required']=3D=3D'Y') { echo('<font=20 > color=3D"#FF0000">*</font>'); } ?> > =A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 and then add the following = line 4 lines: > =A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 <?php > =A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 if ($tid !=3D '11') > =A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 echo = ("<A NAME=3D\"Q($i)\">($i).</A>");=A0=A0 > =A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 ?> > =A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 This ensures that the = Statement does not have a=20 > Question number displayed next to it. > > =A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 B:/ > =A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 The next step is to find = the following line: > =A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 <td valign=3D"TOP" = aligh=3D"LEFT"> - this should be line 87=20 > in the original file or line 91 if you've added the above code. > > =A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 change it to: > =A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 <td valign=3D"TOP" = aligh=3D"LEFT" width=3D"95%"> > =A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 This will prevent large = descriptive text or statements=20 > from messing up the formatting of your survey. > > =A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 and that is all=85=85 > =A0=A0=A0=A0=A0=A0=A0 > =A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 Simply create or edit a = survey, go to the Question tab=20 > where you will notice the new item "Statement" in the New Field's > > =A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 type dropdown list and = enter your statement in the=20 > Text's text field. > =A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 There can not be any = possible answers to this statement=20 > so you do not need to fill in the rest of the fields in the Question > > =A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 tab page. > > =A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 Enjoy ! > Regards > Kon Angelopoulos > |