James,
Thank you for your fast response.
No, unanswered questions are set to 0 because a value *is* required.
Even when specified a NULL to put there, it becomes 0 because the table
field properties require it to be NOT NULL. By default this is 0 in
MySQL. This was originally from a 1.4 installation, but even in the
1.6.1 archive it is still like that:
-- # answers to rank questions
CREATE TABLE response_rank (
response_id INT UNSIGNED NOT NULL,
question_id INT UNSIGNED NOT NULL,
choice_id INT UNSIGNED NOT NULL,
rank INT NOT NULL,
PRIMARY KEY(response_id,question_id,choice_id)
);
Perhaps it would be nice to have a small additional ENUM field that sets
wether a value is entered or none to avoid ambuigities (perhaps also for
future other question types since it may also arise when for example an
integer 0 would be a valid answer for a question).
Or is there already something like that that I overlooked (and with
which I could recover the data for a large phd related survey)?
Thanks anyway for your development of phpesp which is still a very good
package and used by a few collegues.
Regards
Paul
James Flemer wrote:
>
> Paul,
>
> Are you certain that unanswered questions are not NULL? It's been a
> while since I looked at this, but I thought that's what was used for
> unanswered questions. If it is not the case, I believe it should be. A
> NULL value makes more sense to me than a magic number.
>
> -James
|