[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phptest-devel] Re: single question

From: dj resonance
Subject: [Phptest-devel] Re: single question
Date: Wed, 3 Jul 2002 07:35:12 -0700 (PDT)

PHP is an interpreted language, so it's not going to
generate an error or put garbage into an unitiliazed
variable.  In fact, if it _did_ do that, phpTest
wouldn't work at all, as there are many instances of
testing a variable without being sure that it exists. 
For example, look at any page that checks if the
$HTTP_POST_VARS['submit'] variable is set.  If you
have notices turned on, PHP will put a notice on the
page that you are trying to use an unitiliazed
variable, but it will still work fine.  phpTest now
checks to see if the variable is set so no notices are

if (empty($sort_eligible)) {      

the empty() function will return true if either the
variable is not set or is 0.  The isset() function
will only return true if the variable has been added
to the php symbol table (set).  Because $sort_eligble
could be set to FALSE (and therefore isset() would
return true) we check for empty() instead, because
FALSE naturally evalutes to 0.  

Let's try to communicate via the php-devel list from
now on, so that way the email messages will be
archived and browsable via the web for people who are
interested in reading them later :)  Also, do you have
an option to send your emails in plain text?  The html
output always looks screwey viewing with yahoo.


--- John Lacey <address@hidden> wrote:

<font size=3>Nice to hear the problem is fixed, but it
would bother me
not knowing exactly <br>
what caused it.<br>
I looked over test.php and (you're gonna love this) I
liked the version
that I<br>
wrote somewhat better... and I don't know of a humbler
way to put that
one boast I could never make is that I'm a crack
programmer. :)<br>
Here's why: If SORT_MULTIPLE_CHOICE is not set, we end
up testing<br>
a variable ($sort_eligible) that was never set or
reset by code, since we
never touched it by not executing the if
I generally don't like doing that, since I'm not sure
what the contents
of the <br>
variable would be unless I had full confidence on what
a compiler or
would do with it.<br>
So far as testing for general functionality rather
than for a specific
area of code,<br>
I'm probably not a good one to do that yet, since I've
never even loaded
it up at<br>
home as I've mentioned.&nbsp; Of course, I have PHP
running under both
IIS and Apache<br>
on my Win2K Pro box, together with MySQL.&nbsp; It's
just that I've had
other fish to<br>
fry lately.&nbsp; That being said, I would take the
time to hammer on
specific functions<br>
that you needed help testing.&nbsp; Also, when I start
putting the NACSE
phpTest engine <br>
up, I'll be able to give you much better input and
hopefully send a
&quot;suggested fix&quot; <br>
along whenever I run into a problem.<br>
btw, I noticed the large string of asterisks ****
commenting out some of
the code in<br>
test.php.&nbsp; Even I can catch unused code
now...&nbsp; thanks.<br>
I just subscribed to Phptest devel and Phptest
users.&nbsp; Do you want
me to communicate<br>
with you that way from this point forward?<br>
At 02:42 PM 7/2/2002 -0700, you wrote: <br>
<blockquote type=cite cite>I got the IE bug sorted
out. I'm not sure what
the <br>
problem was. Initially I thought that IIS stopped <br>
accepting POST data, but the code still worked fine
with mozilla. I checked out an earlier version of <br>
add_truefalse.php and edited it back to the way it
was. I tested it and it started working again. <br>
Mysteriously, I tested the other pages that were <br>
having problems (add_multiple.php) and it started <br>
working fine again too. Probably some stupid obscure
IE bug. I've run into a few of them before, and IIS
as well. I wish I could put apache on our server at
work here. With that bug out of the way, I've cleaned
up the test.php code so the sorting works as we talked
about. I even tried a few tests to verify that it <br>
wasn't skipping anything :) You might want to take a
look at the current test.php and give me your <br>
thoughts. It's almost time for me to leave work but
tommorow I'm planning to spend most of the day working
on the documentation and hunting down any remaining
bugs before releasing 0.6.0. If you have time, pull
the latest version from CVS and try to break it. <br>
Brandon <br>
--- John Lacey wrote: <br>
yeah, I like the idea of a &quot;subtle&quot;
rectangular matrix at the
top of the screen above the <br>
question.  The &quot;symbols&quot; representing the
question could be
anything (or configurable) <br>
like even a radio button, a checkbox, or something
more aesthetic.  The
&quot;hotlink&quot; when <br>
clicked would just call a .php script to retrieve an
unanswered question,
also, it occurred to me that we would need a way to
submit an incomplete
test anyway<br>
when the timer code is completed and made active in a
what's it doing on IE?<br>
is there any thing I can do to help out testing
At 07:16 AM 7/2/2002 -0700, you wrote:<br>
&gt;I was thinking basically the same thing for
&gt;implementation. There would be a little matrix or
&gt;either on the top or left hand side showing
&gt;and unanswered questions.  I haven't had a chance
&gt;think about it seriously yet because phpTest
&gt;has a serious bug that's preventing it from being
&gt;on IE.  I don't know what the problem is, I'm
going to<br>
&gt;have to pull an earlier version from CVS and use
&gt;if I can't get it fixed soon.<br>
&gt;Take care,<br>
&gt;--- John Lacey &lt;address@hidden&gt;
&gt;&gt; Brandon,<br>
&gt;&gt; <br>
&gt;&gt; Is it safe to assume that you're implementing
&gt;&gt; single question per<br>
&gt;&gt; screen with<br>
&gt;&gt; a &quot;Submit Answer&quot; button at the
bottom of each<br>
&gt;&gt; question and a &quot;Submit Test&quot; <br>
&gt;&gt; button when the person wishes to end the
&gt;&gt; <br>
&gt;&gt; I envisioned an implementation where after
&gt;&gt; &quot;last&quot; question is<br>
&gt;&gt; submitted, another<br>
&gt;&gt; screen would come up with appropriate
verbiage and<br>
&gt;&gt; the Submit Test button<br>
&gt;&gt; would be on that screen.  When the answer
matrix is<br>
&gt;&gt; implemented it would<br>
&gt;&gt; also be<br>
&gt;&gt; displayed on the final screen showing any
&gt;&gt; (in red) that were not<br>
&gt;&gt; answered<br>
&gt;&gt; (marked for skipping earlier).  In the
meantime, we<br>
&gt;&gt; would probably need<br>
&gt;&gt; some way<br>
&gt;&gt; of notifying the test taker of any
&gt;&gt; questions.<br>
&gt;&gt; <br>
&gt;&gt; If we have a matrix, the person could click
on the<br>
&gt;&gt; appropriate hot linked<br>
&gt;&gt; question indicator<br>
&gt;&gt; and be whisked back to answer the question. 
&gt;&gt; would have flagged an &quot;end<br>
&gt;&gt; of test&quot; <br>
&gt;&gt; condition upon answering the &quot;last&quot;
question and<br>
&gt;&gt; going to the &quot;Submit Test&quot;<br>
&gt;&gt; screeen.<br>
&gt;&gt; In this way we could check the &quot;end of
&gt;&gt; condition after the person has<br>
&gt;&gt; submitted<br>
&gt;&gt; the answer for an unanswered question and
return to<br>
&gt;&gt; the Submit Test screen<br>
&gt;&gt; with an<br>
&gt;&gt; updated matrix indicating latest question
status. <br>
&gt;&gt; If there were additional<br>
&gt;&gt; unanswered <br>
&gt;&gt; questions, the person would then repeat
&gt;&gt; operation.  All the while, the<br>
&gt;&gt; &quot;Submit Test&quot;<br>
&gt;&gt; button/function would be disabled until
&gt;&gt; questions were answered.<br>
&gt;&gt; Optionally, we<br>
&gt;&gt; could have a config constant allowing a test
to be<br>
&gt;&gt; submitted (with a<br>
&gt;&gt; warning) that the<br>
&gt;&gt; test taker is submitting an incomplete test
and has<br>
&gt;&gt; chosen not to even take<br>
&gt;&gt; a guess on<br>
&gt;&gt; something they feel they can't answer.<br>
&gt;&gt; <br>
&gt;&gt; just some thoughts..<br>
&gt;&gt; John <br>
&gt;&gt; <br>
&gt;&gt; <br>
&gt;&gt; <br>
&gt;Do You Yahoo!?<br>
&gt;Sign up for SBC Yahoo! Dial - First Month Free<br>
&gt;<a href="";
&gt; <br>
Do You Yahoo!? <br>
Sign up for SBC Yahoo! Dial - First Month Free <br> </blockquote><br>

Do You Yahoo!?
Sign up for SBC Yahoo! Dial - First Month Free

reply via email to

[Prev in Thread] Current Thread [Next in Thread]