Login and Survey problems

Login and Survey problems

by George Frampton -
Number of replies: 10

G'Day:

It quite nice to find a GOOD and USEFUL tool such as Moodle, thank you smiley.gif 

I'm experiencing two problems after a painless first time install.

After the initial login, the login footer does not change to logged in until I advance to a course link. This is fine for me but may be confusing for a non-technical person.

When attemting to create a new survey I receive the error message "Could not add a new instance of survey"

Any suggestions would be appreciated.

Thank you

George

Apache on Redhat, MySQL 3.23.43, PHP 4.2.3

Average of ratings: -
In reply to George Frampton

Re: Login and Survey problems

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
I suspect browser caching in the first case - it's not normal behaviour. Try refreshing the page to see if the footer changes.

The survey error could be caused by a number of things, try running Moodle with "debug" turned on (in the admin variables page) to see if you get more information when you try adding a survey.
In reply to Martin Dougiamas

Re: Login and Survey problems

by George Frampton -

Thank you for your response Martin smiley.gif

You are quite right on the first item. I used my site IP instead of the DOMAIN NAME, therefore when it set the PHPSESSID cookie, first for the IP then set one also for the DOMAIN, Moodle got a little confussed. I changed "$CFG->wwwroot   = myIP" to  "$CFG->wwwroot   = myDOMAIN" in the config.php and that sorted the login problem out.

For the second item I set "$CFG->buggy_referer = true;" in the config.php to see if any debug information was returned, but no luck there. The debug information returned by turning on degug on the admin variables page yielded

"Notice: Undefined variable: showall in /path/to/course/lib.php on line 753

Notice: Undefined variable: mine in /path/to/course/lib.php on line 753

Notice: Undefined offset: 4 in /path/to/course/lib.php on line 556
 
Notice: Undefined offset: 5 in /path/to/course/lib.php on line 556"

on the home page but no information returned for the survey creation error?

Much appreciaton for your efforts.

George

In reply to Martin Dougiamas

Re: Login and Survey problems

by Shriya Dhar -
Same problem I am also facing in creating a survey. I turned debug on in config.php, but the problem is still there.
In reply to Shriya Dhar

"Could not add a new instance of survey"

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
The buggy_referer variable is not the same as the 'debug' option (which is in Admin -> Configure Variables).

Also try this: edit course/mod.php and near the top insert this line:

$db->debug = true;

Then try creating a new survey again and email me the output (whole page) when the error occurs.
In reply to Martin Dougiamas

Re: "Could not add a new instance of survey"

by Shriya Dhar -

Here is the output of the page which comes when I try to add a new survey:

(mysql): UPDATE mdl_user SET lastIP='127.0.0.1', lastaccess='1043294634' WHERE id = '1'  



(mysql): SELECT * FROM mdl_user_admins WHERE userid = '1' LIMIT 1  



(mysql): SELECT * FROM mdl_survey WHERE id = '2'  



(mysql): SHOW COLUMNS FROM mdl_survey  



(mysql): INSERT INTO mdl_survey (course, template, days, timecreated, timemodified, name, intro, questions) VALUES ('2', '2', '0', '1043294634', '1043294634', 'test', 'The purpose of this survey is to help us understand what you value in an online learning experience. Each one of the 24 statements below asks about your <B>preferred</B> (ideal) experience in this unit. There are no 'right' or 'wrong' answers; we are interested only in your opinion. Please be assured that your responses will be treated with a high degree of confidentiality, and will not affect your assessment. Your carefully considered responses will help us improve the way this unit is presented online in the future. Thanks very much.', '31,32,33,34,35,36,43,44')  


1064: You have an error in your SQL syntax near 'right' or 'wrong' answers; we are interested only in your opinion. Please be ass' at line 1
' + inobj[objprop] + '\n'); } op.document.close(); } function fillmessagebox(text) { document.form.message.value = text; } function openpopup(url,name,height,width) { fullurl = "http://localhost:8080/moodle" + url; options = "menubar=0,location=0,scrollbars,resizable,width="+width+",height="+height; windowobj = window.open(fullurl,name, options); windowobj.focus(); } function copyrichtext(textname) { textname.value = document.richedit.docHtml; return true; } // done hiding -->

Could not add a new instance of survey

Continue


(mysql): SELECT * FROM mdl_course WHERE category = '0'  



You are logged in as Admin User (Logout)

Home

In reply to Shriya Dhar

Re: "Could not add a new instance of survey"

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Aha!

Your server does not have the variable "magic_quotes_gpc" turned on, which is required.

http://moodle.com/doc/?frame=install.html&sub=webserver

Check your php.ini file.
In reply to Martin Dougiamas

Re: "Could not add a new instance of survey"

by Shriya Dhar -

Yes it worked. Thanks a lot.

Its great working on Moodle.

In reply to Martin Dougiamas

Re: "Could not add a new instance of survey"

by Douglas Thomson -
I followed the suggestion of copying the htaccess file from the lib directory rather than editing my system-wide php.ini file. Therefore, my .htaccess file contained the line:
    php_flag magic_quotes_gpc        1
but I still got the "Could not add a new instance of survey" error.

To fix the problem I had to change this to:
    php_flag magic_quotes_gpc        On

I am not sure if this is a bug in the sample htaccess file, or something weird about my setup?

Anyway, I hope this might help someone...

Doug.
In reply to George Frampton

Re: Login and Survey problems

by Jai cheswick -
Actually I get the same response when I try to create a new chat area....

"Could not add a new instance of chatarea"


Haven't been able to work that out yet

Jai
In reply to Jai cheswick

Re: Login and Survey problems

by Esteban Moro -
Hi Jai
I have recently installed the Ray's chatarea and got this "could not add a new instance of chatarea". Did you managed to work it out in the end?
Any help would be appreciated.
Cheers