phptest-devel
[Top][All Lists]
Advanced

[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
generated:

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.

Thanks,
Brandon


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

<HR>
<html>
<br>
<font size=3>Nice to hear the problem is fixed, but it
would bother me
not knowing exactly <br>
what caused it.<br>
<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
since<br>
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
<br>
never touched it by not executing the if
(SORT_MULTIPLE_CHOICE)
block.<br>
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
interpreter<br>
would do with it.<br>
<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>
<br>
later...<br>
John<br>
<br>
<br>
<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>
<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>
<br>
<br>
<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
<br>
with mozilla. I checked out an earlier version of <br>
add_truefalse.php and edited it back to the way it
<br>
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
<br>
IE bug. I've run into a few of them before, and IIS
<br>
as well. I wish I could put apache on our server at
<br>
work here. With that bug out of the way, I've cleaned
<br>
up the test.php code so the sorting works as we talked
<br>
about. I even tried a few tests to verify that it <br>
wasn't skipping anything :) You might want to take a
<br>
look at the current test.php and give me your <br>
thoughts. It's almost time for me to leave work but
<br>
tommorow I'm planning to spend most of the day working
<br>
on the documentation and hunting down any remaining
<br>
bugs before releasing 0.6.0. If you have time, pull
<br>
the latest version from CVS and try to break it. <br>
<br>
Brandon <br>
<br>
<br>
--- John Lacey wrote: <br>
<br>
<hr>
<br>
<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,
etc.<br>
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
test<br>
<br>
what's it doing on IE?<br>
<br>
is there any thing I can do to help out testing
something?<br>
<br>
John<br>
<br>
<br>
At 07:16 AM 7/2/2002 -0700, you wrote:<br>
&gt;I was thinking basically the same thing for
the<br>
&gt;implementation. There would be a little matrix or
grid<br>
&gt;either on the top or left hand side showing
answered<br>
&gt;and unanswered questions.  I haven't had a chance
to<br>
&gt;think about it seriously yet because phpTest
currently<br>
&gt;has a serious bug that's preventing it from being
used<br>
&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
that<br>
&gt;if I can't get it fixed soon.<br>
&gt;<br>
&gt;Take care,<br>
&gt;Brandon<br>
&gt;<br>
&gt;--- John Lacey &lt;address@hidden&gt;
wrote:<br>
&gt;&gt; Brandon,<br>
&gt;&gt; <br>
&gt;&gt; Is it safe to assume that you're implementing
the<br>
&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
test?<br>
&gt;&gt; <br>
&gt;&gt; I envisioned an implementation where after
the<br>
&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
questions<br>
&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
unanswered<br>
&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. 
We<br>
&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
test&quot;<br>
&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
the<br>
&gt;&gt; operation.  All the while, the<br>
&gt;&gt; &quot;Submit Test&quot;<br>
&gt;&gt; button/function would be disabled until
all<br>
&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;<br>
&gt;<br>
&gt;__________________________________________________<br>
&gt;Do You Yahoo!?<br>
&gt;Sign up for SBC Yahoo! Dial - First Month Free<br>
&gt;<a href="http://sbc.yahoo.com/";
eudora="autourl">http://sbc.yahoo.com</a><br>
&gt; <br>
<br>
<br>
<br>
__________________________________________________
<br>
Do You Yahoo!? <br>
Sign up for SBC Yahoo! Dial - First Month Free <br>
http://sbc.yahoo.com </blockquote><br>
</font>
<BR>
</html>


__________________________________________________
Do You Yahoo!?
Sign up for SBC Yahoo! Dial - First Month Free
http://sbc.yahoo.com



reply via email to

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