error while Adding a new Quiz in course moodle 2.9
Adding a new Quiz getting Error writing to database
I click on course and add thi quiz in that bt while saving that quiz m gtng Error writing to database in /course/modedit.php
Plz Help me with it
error while Adding a new Quiz in course moodle 2.9
Adding a new Quiz getting Error writing to database
I click on course and add thi quiz in that bt while saving that quiz m gtng Error writing to database in /course/modedit.php
Plz Help me with it
Rod
Yes,I checked it bt m nt finding that my.inf and my.cnf so m not understanding that answer...
and one more thng in my phpmyadmin mood_course table has the modinfo and sectioncache ....
and when i adding a new course this both the field showing NULL value bt actually this field should have data like this: a:1:{i:31;O:8:"stdClass":12:{s:2:"id";s:2:"17";s:2....... idnt knw this all is related to my error or not bt i notice this kindlly plz rply
Hello again,
As Ken also says, "If you are remotely hosted on a shared server, you may NOT be able to add any my.cnf file to control the database server ... which is also shared by multiple customers. Most setups like that *are* restricted ... that's why they are so cheap! ** You must contact your provider and inquire about increasing max_packets for your setup. **"
I can't say what your error message means, but I might recommend you can get a more complete error message reporting if you go to your Moodle Administration tab, select "Site Administration" > "Development" > Debugging and in the Debug Messages drop down select either "Show all reasonable PHP debug messages" or even take the "Developer Option." Also on that page you can click "Display debug messages" to get a more comprehensive set of errors.
Also, when you report errors it is usually important to include the whole error. Some of the error results may contain information useful to those who can help you, but meaningless to you.
Hope this helps some.
Rod
I suggest turning on debugging and triggering the error again. You will get more information that will help pinpoint the cause. If it is a max packet setting causing it, it will be mentioned specifically in the error stack trace.
hello,
Thanks for rply,
I try it n it showing the error like this
Debug info: Field 'questions' doesn't have a default value
INSERT INTO mood_quiz (name,timeopen,timeclose,timelimit,overduehandling,graceperiod,grade,attempts,grademethod,questionsperpage,navmethod,shuffleanswers,preferredbehaviour,canredoquestions,attemptonlast,showuserpicture,decimalpoints,questiondecimalpoints,showblocks,subnet,delay1,delay2,browsersecurity,course,intro,introformat,timemodified,password,reviewattempt,reviewcorrectness,reviewmarks,reviewspecificfeedback,reviewgeneralfeedback,reviewrightanswer,reviewoverallfeedback) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
[array (
0 => 'computer test',
1 => 0,
2 => 0,
3 => 0,
4 => 'autoabandon',
5 => 86400,
6 => 10,
7 => '0',
8 => '1',
9 => '1',
10 => 'free',
11 => '1',
12 => 'deferredfeedback',
13 => '0',
14 => '0',
15 => '0',
16 => '2',
17 => '-1',
18 => '0',
19 => '',
20 => 0,
21 => 0,
22 => '-',
23 => '16',
24 => '',
25 => '1',
26 => 1445232368,
27 => '',
28 => 69904,
29 => 69904,
30 => 69904,
31 => 69904,
32 => 69904,
33 => 69904,
34 => 4368,
)]
Error code: dmlwriteexception
Stack trace:
line 446 of /lib/dml/moodle_database.php: dml_write_exception thrown
line 1164 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
line 1210 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->insert_record_raw()
line 89 of /mod/quiz/lib.php: call to mysqli_native_moodle_database->insert_record()
line 121 of /course/modlib.php: call to quiz_add_instance()
line 275 of /course/modedit.php: call to add_moduleinfo()
so wt to do with it ????
I am guessing:
Therefore, the database structure does not match what it should be.
See Upgrading for the correct way to upgrade Moodle.
Read the Upgrading instructions I linked to.
Probably what you need to do is to log in as Admin, and go to Site administration -> Notifications, and go through that.
actually i instaled a new version and thn i insert the whole values in database.... i hvnt upgrade
Well, the error is indicating that you have done something wrong in the database and one of the fields requires a default value.
You need to upgrade properly. I suggest restoring everything back to before the upgrade and then running the upgrade correctly.
M gtng this error in notification
That is the wrong interpretation Emma.
That column does not exist in the Moodle 2.8+ database. It did exist in the 2.7- database, but an upgrade step removed it.
Thanks for the clarification Tim!
That will not work.
If you want to move to the latest Moodle, and keep all your data from a previous version, then you need follow the upgrading instructions.
Doing what you tried to do cannot possibly work, as you found.