This is the latest version.
Teemu
Hi Teemu,
I tried this last night, but thought I must have done something wrong because of many error messages, but with this one its still the same errors and debug messages:
Notice: Undefined property: blankfields in /home/cbusch/public_html/moodle/mod/data/mod.html on line 140
Unknown column 'dataid' in 'where clause'
SELECT * FROM mdl_data_values WHERE dataid = ''
Notice: Undefined property: studentemail in /home/cbusch/public_html/moodle/mod/data/mod.html on line 261
I tried this last night, but thought I must have done something wrong because of many error messages, but with this one its still the same errors and debug messages:
Notice: Undefined property: blankfields in /home/cbusch/public_html/moodle/mod/data/mod.html on line 140
Unknown column 'dataid' in 'where clause'
SELECT * FROM mdl_data_values WHERE dataid = ''
Notice: Undefined property: studentemail in /home/cbusch/public_html/moodle/mod/data/mod.html on line 261
Unknown column 'f.userid' in 'where clause'
SELECT COUNT(*)FROM mdl_data_values f,mdl_user u,mdl_user_students sWHERE f.userid = u.idAND s.userid = u.idAND f.dataid = 6AND s.course = 2
SELECT COUNT(*)FROM mdl_data_values f,mdl_user u,mdl_user_students sWHERE f.userid = u.idAND s.userid = u.idAND f.dataid = 6AND s.course = 2
Unknown column 'f.userid' in 'where clause'
SELECT COUNT(*)FROM mdl_data_values f,mdl_user u,mdl_user_teachers tWHERE f.userid = u.idAND t.userid = u.idAND f.dataid = 6AND t.course = 2
SELECT COUNT(*)FROM mdl_data_values f,mdl_user u,mdl_user_teachers tWHERE f.userid = u.idAND t.userid = u.idAND f.dataid = 6AND t.course = 2
There is one new column in the table mdl_data. It's that "studentemail". That "blancfields" column is now "blankfields". I assume that you can fix those.
Teemu
Teemu
If you want to enable zebra stripe effect, you must add these lines to your theme's styles_color.css (or standard theme's file):
.zebra1 {
background-color:#FFFFFF;
}
.zebra2 {
background-color:#8F8F8F;
}
Teemu
.zebra1 {
background-color:#FFFFFF;
}
.zebra2 {
background-color:#8F8F8F;
}
Teemu
Okay Teemu,
I was able to fix the undefined property errors: I did a search and replace from blanc to blank--it still needs to be changed in mod.html, backuplib.php and restorelib.php, and in mysql.
For the other error, I added to mod.html at line 54:
As for the database errors, I'm not sure how you have set them up so I don't want to mess with it. It appears, though, that the dataid field is missing from the data_values table. And as for the fuserid error, I also get an error message after saving the data settings of an undefined index f in lib.php on line 26.
I was able to fix the undefined property errors: I did a search and replace from blanc to blank--it still needs to be changed in mod.html, backuplib.php and restorelib.php, and in mysql.
For the other error, I added to mod.html at line 54:
if (!isset($form->studentemail)) {
$form->studentemail = "";
}
As for the database errors, I'm not sure how you have set them up so I don't want to mess with it. It appears, though, that the dataid field is missing from the data_values table. And as for the fuserid error, I also get an error message after saving the data settings of an undefined index f in lib.php on line 26.
I fixed those bugs.
dataid column is not needed in the table "mdl_data_values", because it has answerid column and the table "mdl_data_answers" has dataid column. Go to the mysql shell and give these commands:
alter table mdl_data change blancfields blankfields int(3) unsigned not null;
alter table mdl_data add studentemail int(1) unsigned not null;
Teemu
dataid column is not needed in the table "mdl_data_values", because it has answerid column and the table "mdl_data_answers" has dataid column. Go to the mysql shell and give these commands:
alter table mdl_data change blancfields blankfields int(3) unsigned not null;
alter table mdl_data add studentemail int(1) unsigned not null;
Teemu
But Teemu,
I'm still getting the error messages about dataid not being in the data_values table. For example mod.html is calling for it at line: 110
if ($form->public == "anonymous" && $data_values = get_record("data_values", "dataid", $form->id)) {
$types = array (
"anonymous" => get_string("anonymous", "data")
);
And it is still in lib.php too.
I'm still getting the error messages about dataid not being in the data_values table. For example mod.html is calling for it at line: 110
if ($form->public == "anonymous" && $data_values = get_record("data_values", "dataid", $form->id)) {
$types = array (
"anonymous" => get_string("anonymous", "data")
);
And it is still in lib.php too.
Well, I found some bugs too. It takes probably one week to fix those.
Teemu
Teemu
I fixed some serious bugs. Bugs appeared only after heavy testing.
Teemu
Teemu
Oh boy Teemu,
Hang in there! The good news is that everything works. The bad news is that these errors still show up. I'm still getting the "f" type error from the view page--but only when logged in as admin/teacher:
Hang in there! The good news is that everything works. The bad news is that these errors still show up. I'm still getting the "f" type error from the view page--but only when logged in as admin/teacher:
Unknown column 'f.userid' in 'where clause'
SELECT COUNT(*)FROM mdl_data_values f,mdl_user u,mdl_user_students sWHERE f.userid = u.idAND s.userid = u.idAND f.dataid = 1AND s.course = 3
SELECT COUNT(*)FROM mdl_data_values f,mdl_user u,mdl_user_students sWHERE f.userid = u.idAND s.userid = u.idAND f.dataid = 1AND s.course = 3
Unknown column 'f.userid' in 'where clause'
SELECT COUNT(*)FROM mdl_data_values f,mdl_user u,mdl_user_teachers tWHERE f.userid = u.idAND t.userid = u.idAND f.dataid = 1AND t.course = 3
SELECT COUNT(*)FROM mdl_data_values f,mdl_user u,mdl_user_teachers tWHERE f.userid = u.idAND t.userid = u.idAND f.dataid = 1AND t.course = 3
And I still get the datid error from the edit.php page (for both student and teacher/admin):
Unknown column 'dataid' in 'where clause'
SELECT COUNT(*) FROM mdl_data_values WHERE dataid = '1' AND userid = '2'
I also got these errors after giving feedback (on the report page):
Notice: Undefined variable: remove in /home/cbusch/public_html/moodle/mod/data/report.php on line 66
Notice: Undefined variable: deletenum in /home/cbusch/public_html/moodle/mod/data/report.php on line 95
Unknown column 'dataid' in 'where clause'
SELECT COUNT(*) FROM mdl_data_values WHERE dataid = '1' AND userid = '2'
I also got these errors after giving feedback (on the report page):
Notice: Undefined variable: remove in /home/cbusch/public_html/moodle/mod/data/report.php on line 66
Notice: Undefined variable: deletenum in /home/cbusch/public_html/moodle/mod/data/report.php on line 95
Did you try the latest version? Some of the problems should be solved. Are you sure that you use the latest database module files? It's possible that you have old and new files mixed.
Teemu
Teemu
I'm still getting the same errors as above. I have been completely deleting and then re-installing the module each time.
Is there anybody else out there who can test this?
Also, when I add a checkbox only the first value shows up. Any idea why that is?
Is there anybody else out there who can test this?
Also, when I add a checkbox only the first value shows up. Any idea why that is?
I had that feedback error with the 1.5 version two weeks ago. With the latest 1.5 version there is no feedback error. Every checkbox is invidual. It would be nice to have multiple checkboxes like you have multiple radiobuttons but then only the last checked checkbox of that field would be saved. I will try to improve checkboxes but it's not easy.
I found three bugs again. They were those SELECT COUNT queries. Please try this new version.
Teemu
I found three bugs again. They were those SELECT COUNT queries. Please try this new version.
Teemu
Okay,
Yeah, the id error message is gone. But, I still get this debug message that flashes up in between pages after hitting save changes about "unidentified index v and i in edit.php."
I haven't upgraded 1.5 in a few days, so those other debug messages should go away. I don't know why I was thinking that you could add check boxes like that, but its fine the way it is anyway.
Yeah, the id error message is gone. But, I still get this debug message that flashes up in between pages after hitting save changes about "unidentified index v and i in edit.php."
I haven't upgraded 1.5 in a few days, so those other debug messages should go away. I don't know why I was thinking that you could add check boxes like that, but its fine the way it is anyway.

WOW WEE
I think I fixed those bugs.
Teemu
I think I fixed those bugs.
Teemu
Thanks, Teemu.
If you can just update cvs:/contrib/data then you just need to point people to http://download.moodle.org/download.php/modules/data.zip or CVS for the download.
This will avoid filling the forum (and my disks
) with many versions ...
If you can just update cvs:/contrib/data then you just need to point people to http://download.moodle.org/download.php/modules/data.zip or CVS for the download.
This will avoid filling the forum (and my disks
Oh yeah. Now I know how to do it.
The latest version is now in CVS contrib/data
Teemu
The latest version is now in CVS contrib/data
Teemu
Martin, you could delete this thread if you want and we can start another one.
Hi Teemu,
Glad you got it into contrib--much easier.
Seems good. Here is a screenshot I get of the error messages that flash after saving changes to a form.
Hi Teemu,
Glad you got it into contrib--much easier.
Seems good. Here is a screenshot I get of the error messages that flash after saving changes to a form.

Can you send the screenshot of that form's details.php page? It's this table:
Teemu
Field name | Field type | Field value (Separate by '|') | Rights | Required |
---|
Teemu
I made some bug fixes. Please upgrade. Those error messages are still there.
Teemu
Teemu
Hi Teemu,
I'll upgrade both the database module and 1.5 and then let you know how it goes. I just clicked on the Update this Database link and got the following error. And below the error was a continue button that told me the course didn't exist.
I'll upgrade both the database module and 1.5 and then let you know how it goes. I just clicked on the Update this Database link and got the following error. And below the error was a continue button that told me the course didn't exist.
Error: Turn off debugging to hide this error.
SELECT * FROM mdl_data_answers WHERE dataid = '4'
Found more than one record in get_record_sql !
Array
(
[10] => Array
(
[id] => 10
[0] => 4
[dataid] => 4
[1] => 2
[userid] => 2
[2] => 1115825402
[modified] => 1115825402
[3] => 1
[attempt] => 1
[4] =>
[feedback] =>
)
[11] => Array
(
[id] => 11
[0] => 4
[dataid] => 4
[1] => 2
[userid] => 2
[2] => 1115825450
[modified] => 1115825450
[3] => 2
[attempt] => 2
[4] =>
[feedback] =>
)
[12] => Array
(
[id] => 12
[0] => 4
[dataid] => 4
[1] => 3
[userid] => 3
[2] => 1115825498
[modified] => 1115825498
[3] => 1
[attempt] => 1
[4] =>
[feedback] =>
)
)
I fixed that today. Please upgrade.
Teemu
Teemu
Unlink warnings are fixed. Other are all similar. They are showed, because I use this all the time:
if ($vals['f'] != "" && $vals['t'] != "") {
}
This is very important and I don't know yet how to solve this. It works but if you have all error messages on you get these notices. This is a problem only with IE.
Teemu
if ($vals['f'] != "" && $vals['t'] != "") {
}
This is very important and I don't know yet how to solve this. It works but if you have all error messages on you get these notices. This is a problem only with IE.
Teemu
I fixed those bugs but I can't write to CVS. Maybe CVS is down.
Teemu
Teemu
Now the latest fixes are in CVS/contrib
Teemu
Teemu
I just installed this on my server, and I got the message when I tried to save a new database:
Warning: main(../../lib/filelib.php): failed to open stream: No such file or directory in /home/directory/public_html/mod/data/view.php on line 5
Warning: main(../../lib/filelib.php): failed to open stream: No such file or directory in /home/directory/public_html/mod/data/view.php on line 5
It looks like that you are using 1.4 version. This works only with 1.5 version.
Teemu
Teemu
I see. OK, I'll just wait until I upgrade to 1.5 to test it.
Teemu-This module seems to be creating problems for the general Moodle backup. See bug 3221.
You didn't know this:
Don't use Database Module on production servers with version 1.4 because when you update to 1.5, the database module won't work at all. Database module for 1.5 will be availabe some day but there will be so many changes in the code and in the database structure, that you can't update database module from 1.4.x to 1.5.
This was written 3 months ago.
That's the reason I haven't solved all the bugs of Database module for version 1.4.
Teemu
Don't use Database Module on production servers with version 1.4 because when you update to 1.5, the database module won't work at all. Database module for 1.5 will be availabe some day but there will be so many changes in the code and in the database structure, that you can't update database module from 1.4.x to 1.5.
This was written 3 months ago.
That's the reason I haven't solved all the bugs of Database module for version 1.4.
Teemu
Hi Teemu,
Everything is working great except the problem with course backup, I get this message after installing the data module and then clicking backup:
Parse error: parse error, unexpected T_VARIABLE in /home/cbusch/public_html/moodle/mod/data/backuplib.php on line 56
Everything is working great except the problem with course backup, I get this message after installing the data module and then clicking backup:
Parse error: parse error, unexpected T_VARIABLE in /home/cbusch/public_html/moodle/mod/data/backuplib.php on line 56
Three characters were missing. I fixed that. Please upgrade.
Teemu
Teemu
I really appreciate your hard work on the Database module, which will be very useful for my needs. I just downloaded and installed the most recent version, and am running it with Moodle 1.5 (2005051500). Here are some questions/problems/possible bugs:
(1) Some help files are currently missing (e.g., for How Many Blank Rows); most of these aren't too hard to figure out though.
(2) Though I'm able to enter multiple field values in the Radio Button and Dropdown Menu field types, I'm not able to do so with the Checkbox type: it just presents a single checkbox next to the fieldname. Is anyone else able to make the Checkbox field work correctly?
(3) The Text Area field displays as editable text after the record is submitted (i.e., when a user is browsing the records); is this intentional? One can attempt to edit the text during browsing but it apparently doesn't work.
(4) The Feedback field, which appears when browsing records, displays for students as well as teachers, though student input is not stored. Additionally, when the same user enters multiple records, the same feedback information is stored for each record belonging to this user, i.e. is not unique to the record. Is this intentional?
(5) It is a little cumbersome for users to browse results, then add a record. They apparently have to exit the database module then re-enter to see the new record button. Maybe an "Add A New Record" button to the top right on every browse page would help?
(6) It seems that previously entered values are used as defaults when entering a new record; is this intentional? (This may be limited to when the same user enters a new record, which would make sense.)
(7) I'm able to get the email field to send me a confirmatory email and customize the subject header. But why would you want each student to enter this information in their record, since the email is just a confirmatory email? It would seem that you would include this in the initial setup form and not as a field option for each record...though I may clearly be missing something here!
Again, thanks very much for your hard work on this module; just the ability to enter multiple text/image/document fields alone is useful for Moodle at this point!
Thanks,
Jim P.
(1) Some help files are currently missing (e.g., for How Many Blank Rows); most of these aren't too hard to figure out though.
(2) Though I'm able to enter multiple field values in the Radio Button and Dropdown Menu field types, I'm not able to do so with the Checkbox type: it just presents a single checkbox next to the fieldname. Is anyone else able to make the Checkbox field work correctly?
(3) The Text Area field displays as editable text after the record is submitted (i.e., when a user is browsing the records); is this intentional? One can attempt to edit the text during browsing but it apparently doesn't work.
(4) The Feedback field, which appears when browsing records, displays for students as well as teachers, though student input is not stored. Additionally, when the same user enters multiple records, the same feedback information is stored for each record belonging to this user, i.e. is not unique to the record. Is this intentional?
(5) It is a little cumbersome for users to browse results, then add a record. They apparently have to exit the database module then re-enter to see the new record button. Maybe an "Add A New Record" button to the top right on every browse page would help?
(6) It seems that previously entered values are used as defaults when entering a new record; is this intentional? (This may be limited to when the same user enters a new record, which would make sense.)
(7) I'm able to get the email field to send me a confirmatory email and customize the subject header. But why would you want each student to enter this information in their record, since the email is just a confirmatory email? It would seem that you would include this in the initial setup form and not as a field option for each record...though I may clearly be missing something here!
Again, thanks very much for your hard work on this module; just the ability to enter multiple text/image/document fields alone is useful for Moodle at this point!
Thanks,
Jim P.
Hi Jim,
I'm going to try and help Teemu out and answer at least some of your questions.
1. Please feel free to help Teemu out (English is a second language) by writing help files.
2. I asked this same question above. Actually this is based on typical form behavior, a radio button is used when only one button can be chosen, and the checkboxes are used for mutliple answers. Because of this you have to enter a separate checkbox for each.
3. This all depends on the option you set for databse type. I haven't seen this behavior, so I'm not sure what you are talking about. Even with type set as public, students can write, the text box should only be editable if multiple attempts are allowed and the student is making changes to their own database. I don't see it as editable when just browsing records.
4. Again, depends on type. There can be only one feedback field per database form but the teacher can add to it and edit as much as they want but students can't. I would recommend only using the feedback for when a database type is set to private. That way students can't browse records so they will never see the feeback html editor. I don't know if Teemu would be able to make it so that students could add feedback, or to make it so the feedback html editor does not show up for browsing students.
5. I see what you mean. I don't know if this can be changed. I look at it as submitting a record and viewing all records are two separate things.
6. I think you mean that if multiple attempts are allowed, when the user clicks on "submit..." their previous values are still there? This is the way it should be. Let's say a user wants to go back and change only one answer, they shouldn't have to refill the entire form again.
7. Teachers can choose which of the records they want to be sent out in email. If you (as the teacher) want it to just be a confirmatory email, then only choose, say a header to go out. But, if you want to get all of the results in an email, then choose all of them (for example, I want my students to get their answers via email so they can easily print them out if they want to).
I hope this helps.
I'm going to try and help Teemu out and answer at least some of your questions.
1. Please feel free to help Teemu out (English is a second language) by writing help files.
2. I asked this same question above. Actually this is based on typical form behavior, a radio button is used when only one button can be chosen, and the checkboxes are used for mutliple answers. Because of this you have to enter a separate checkbox for each.
3. This all depends on the option you set for databse type. I haven't seen this behavior, so I'm not sure what you are talking about. Even with type set as public, students can write, the text box should only be editable if multiple attempts are allowed and the student is making changes to their own database. I don't see it as editable when just browsing records.
4. Again, depends on type. There can be only one feedback field per database form but the teacher can add to it and edit as much as they want but students can't. I would recommend only using the feedback for when a database type is set to private. That way students can't browse records so they will never see the feeback html editor. I don't know if Teemu would be able to make it so that students could add feedback, or to make it so the feedback html editor does not show up for browsing students.
5. I see what you mean. I don't know if this can be changed. I look at it as submitting a record and viewing all records are two separate things.
6. I think you mean that if multiple attempts are allowed, when the user clicks on "submit..." their previous values are still there? This is the way it should be. Let's say a user wants to go back and change only one answer, they shouldn't have to refill the entire form again.
7. Teachers can choose which of the records they want to be sent out in email. If you (as the teacher) want it to just be a confirmatory email, then only choose, say a header to go out. But, if you want to get all of the results in an email, then choose all of them (for example, I want my students to get their answers via email so they can easily print them out if they want to).
I hope this helps.
Thanks, Chardelle; this is helpful. Some followups:
(1) Let's see where this module moves in future; I would be happy to help once I understand it fully!
(2) Perhaps our misunderstanding is due to how we typically configure checkbox-type fields: they are usually not multiple fields, but a single field that stores multiple entries. So you usually have one instruction/question for all possible answers, just like you'd have with radio button or dropdown response types.
(3) It's not all text fields that are seemingly editable; it's only the unrestricted-length Text Area field. And, as far as I can tell, it's not actually editable! (Btw, I used the most public/multiple submission/unrestricted settings I could for the database type.)
(4) The main problem I encountered was that feedback was not unique to a record if a user stores multiple records; the way I see it, feedback should be unique to each record. (This is not a serious problem with my current database, as I won't be doing feedback in that manner.)
(5) ...
(6) My concern was whether a new user sees values entered by the immediately preceding user; if you only see the values you yourself previously entered that sounds good.
(7) Thanks, now I get what the email is all about!! Though I don't get the subject option in the email dropdown -- you had that question once I believe -- can you explain it to me?
Regards,
Jim
(1) Let's see where this module moves in future; I would be happy to help once I understand it fully!
(2) Perhaps our misunderstanding is due to how we typically configure checkbox-type fields: they are usually not multiple fields, but a single field that stores multiple entries. So you usually have one instruction/question for all possible answers, just like you'd have with radio button or dropdown response types.
(3) It's not all text fields that are seemingly editable; it's only the unrestricted-length Text Area field. And, as far as I can tell, it's not actually editable! (Btw, I used the most public/multiple submission/unrestricted settings I could for the database type.)
(4) The main problem I encountered was that feedback was not unique to a record if a user stores multiple records; the way I see it, feedback should be unique to each record. (This is not a serious problem with my current database, as I won't be doing feedback in that manner.)
(5) ...
(6) My concern was whether a new user sees values entered by the immediately preceding user; if you only see the values you yourself previously entered that sounds good.
(7) Thanks, now I get what the email is all about!! Though I don't get the subject option in the email dropdown -- you had that question once I believe -- can you explain it to me?
Regards,
Jim
Teemu mentioned above that he would try to get the checkboxes to work that way, but it wouldn't be easy. I don't have a problem with entering each checkbox as a separate entry.
I see what you mean about the textarea. Maybe Teemu can look into this odd behavior.
I can't remember what Teemu said about the subject line, but I don't quite get it yet either
.
As for feedback, I agree, I guess I wouldn't use it if I was going to have students entering vastly different values over and over. I would just add a new database in that case. Have you seen the new online text assignment? It might be a better option for giving feedback for long answers.
I see what you mean about the textarea. Maybe Teemu can look into this odd behavior.
I can't remember what Teemu said about the subject line, but I don't quite get it yet either

As for feedback, I agree, I guess I wouldn't use it if I was going to have students entering vastly different values over and over. I would just add a new database in that case. Have you seen the new online text assignment? It might be a better option for giving feedback for long answers.
Thanks for the comments. I will make a plan what I'm going to do with those problems. It takes some time to fix them all.
Teemu

Teemu