WeBWorK Main Forum

Problem with a particular problem set?

Problem with a particular problem set?

by Steven Xiao -
Number of replies: 8
Hello,

Recently, we moved our webwork to Ubuntu. It has been running fine until today. There are some problems with a particular homework set. In the early morning today, I was told that there are some problems with a particular homework set. At first, I couldn't log in as admin. Then I found out that there was some problem with the corresponding mysql *_problem_user table. After I used mysqlcheck command to get that fixed, for some user, it works fine. But for admin and some other users, it is still not working. For example, if I log on as admin and click that particular homework set "WW3", I would get the following error message:


Warning messages

Error messages

Can't call method "flags" on an undefined value at /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/ProblemSet.pm line 358.

Call stack

The information below can help locate the source of the problem.

  • in WeBWorK::ContentGenerator::ProblemSet::body called at line 152 of /opt/webwork/webwork2/lib/WeBWorK/Template.pm
  • in WeBWorK::Template::template called at line 509 of /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator.pm
  • in WeBWorK::ContentGenerator::content called at line 200 of /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator.pm
  • in WeBWorK::ContentGenerator::go called at line 370 of /opt/webwork/webwork2/lib/WeBWorK.pm

______________________________________________________________________

I searched the forum. It seems that I did not find anything related to that "can't call method "flags" on an undefined value".


Can someone help?


Thanks,


Steven Xiao

In reply to Steven Xiao

Re: Problem with a particular problem set?

by Michael Gage -
The admin course behaves a bit differently from the other courses so it is often not the best place to do trouble shooting. It particular it is usually older than the other courses because it is seldom replaced.

I would check to see if the courses have all been upgraded. You can do this from the upgrade tab on the admin page.

MathObjects have a method "flags" and it could be that somewhere an undefined MathObjects is being called. Can you isolate the problem to one particular WW question>

Check back if none of these ideas work and we'll see what we can come up with.
In reply to Michael Gage

Re: Problem with a particular problem set?

by Steven Xiao -
Thanks for the quick reply.

When I logged in as admin and click the "upgrade courses", I got the following:

___________________________________________
upgrade
Report for course admin:
Database:

achievement Table is ok
achievement_user Table is ok
global_user_achievement Table is ok
key Table is ok
password Table is ok
past_answer Table is ok
permission Table is ok
problem Table is ok
problem_user Schema and database table definitions do not agree
Field problem_seed => is ok
Field sub_status => is ok
Field status => is ok
Field problem_id => is ok
Field num_incorrect => is ok
Field num_correct => is ok
Field attempted => is ok
Field flags => is ok
Field max_attempts => is ok
Field value => is ok
Field last_answer => is ok
Field source_file => is ok
Field set_id => is ok
Field version_id => missing in schema
Field user_id => is ok
set Table is ok
set_locations Table is ok
set_locations_user Table is ok
set_user Schema and database table definitions do not agree
Field enable_reduced_scoring => is ok
Field version_time_limit => is ok
Field restrict_ip => is ok
Field set_header => is ok
Field psvn => is ok
Field hardcopy_header => is ok
Field version_creation_time => is ok
Field open_date => is ok
Field hide_work => is ok
Field hide_score => is ok
Field relax_restrict_ip => is ok
Field problem_randorder => is ok
Field version_last_attempt_time => is ok
Field versions_per_interval => is ok
Field visible => is ok
Field time_interval => is ok
Field set_id => is ok
Field version_id => missing in schema
Field problems_per_page => is ok
Field assignment_type => is ok
Field due_date => is ok
Field answer_date => is ok
Field time_limit_cap => is ok
Field user_id => is ok
Field attempts_per_version => is ok
Field hide_score_by_problem => is ok
Field restricted_login_proctor => is ok
setting Table is ok
user Table is ok
Database tables are ok

There are extra database fields which are not defined in the schema for at least one table. They can only be removed manually from the database.

Directory structure
DATA => /opt/webwork/courses/admin/DATA rwx
achievements => /opt/webwork/courses/admin/templates/achievements rwx
achievements_html => /opt/webwork/courses/admin/html/achievements rwx
email => /opt/webwork/courses/admin/templates/email rwx
html => /opt/webwork/courses/admin/html rwx
html_images => /opt/webwork/courses/admin/html/images rwx
html_temp => /opt/webwork/webwork2/htdocs/tmp/admin rwx
logs => /opt/webwork/courses/admin/logs rwx
macros => /opt/webwork/courses/admin/templates/macros rwx
mailmerge => /opt/webwork/courses/admin/DATA/mailmerge rwx
root => /opt/webwork/courses/admin rwx
scoring => /opt/webwork/courses/admin/scoring rwx
templates => /opt/webwork/courses/admin/templates rwx
tmpEditFileDir => /opt/webwork/courses/admin/templates/tmpEdit rwx
Directory structure is ok

________________________________________________________
Then after I clicked "upgrade", I got the following:

*******************************************************************
Report for course admin:

Database:

achievement Table is ok
achievement_user Table is ok
global_user_achievement Table is ok
key Table is ok
password Table is ok
past_answer Table is ok
permission Table is ok
problem Table is ok
problem_user Schema and database table definitions do not agree
Field problem_seed => is ok
Field flags => is ok
Field sub_status => is ok
Field max_attempts => is ok
Field status => is ok
Field value => is ok
Field last_answer => is ok
Field source_file => is ok
Field set_id => is ok
Field version_id => missing in schema
Field problem_id => is ok
Field num_incorrect => is ok
Field num_correct => is ok
Field attempted => is ok
Field user_id => is ok
set Table is ok
set_locations Table is ok
set_locations_user Table is ok
set_user Schema and database table definitions do not agree
Field enable_reduced_scoring => is ok
Field version_time_limit => is ok
Field restrict_ip => is ok
Field set_header => is ok
Field psvn => is ok
Field hardcopy_header => is ok
Field version_creation_time => is ok
Field open_date => is ok
Field hide_work => is ok
Field hide_score => is ok
Field relax_restrict_ip => is ok
Field problem_randorder => is ok
Field versions_per_interval => is ok
Field version_last_attempt_time => is ok
Field visible => is ok
Field time_interval => is ok
Field set_id => is ok
Field version_id => missing in schema
Field problems_per_page => is ok
Field assignment_type => is ok
Field due_date => is ok
Field answer_date => is ok
Field time_limit_cap => is ok
Field user_id => is ok
Field attempts_per_version => is ok
Field hide_score_by_problem => is ok
Field restricted_login_proctor => is ok
setting Table is ok
user Table is ok
Database tables are ok

There are extra database fields which are not defined in the schema for at least one table. They can only be removed manually from the database.

Directory structure

DATA => /opt/webwork/courses/admin/DATA rwx
achievements => /opt/webwork/courses/admin/templates/achievements rwx
achievements_html => /opt/webwork/courses/admin/html/achievements rwx
email => /opt/webwork/courses/admin/templates/email rwx
html => /opt/webwork/courses/admin/html rwx
html_images => /opt/webwork/courses/admin/html/images rwx
html_temp => /opt/webwork/webwork2/htdocs/tmp/admin rwx
logs => /opt/webwork/courses/admin/logs rwx
macros => /opt/webwork/courses/admin/templates/macros rwx
mailmerge => /opt/webwork/courses/admin/DATA/mailmerge rwx
root => /opt/webwork/courses/admin rwx
scoring => /opt/webwork/courses/admin/scoring rwx
templates => /opt/webwork/courses/admin/templates rwx
tmpEditFileDir => /opt/webwork/courses/admin/templates/tmpEdit rwx
Directory structure is ok

Upgrade process completed
*********************************************************************

It says that
There are extra database fields which are not defined in the schema for at least one table. They can only be removed manually from the database.

and for problem_user, it says:

Schema and database table definitions do not agree

and
Field version_id => missing in schema

How would I fix those? Does it matter since other courses are working fine.

I will see if I can isolate the particular WW problem.

BTW, I found a strange file called "setWW3.def" in webwork/courses/COURSE_NAME/template. Its content is as follow:


openDate = 02/02/2014 at 11:59pm CST
dueDate = 02/11/2014 at 11:59pm CST
answerDate = 02/12/2014 at 11:59pm CST
paperHeaderFile = defaultHeader
screenHeaderFile = defaultHeader
problemList =
Library/Rochester/setVecFunction2Curvature/ur_vc_4_5.pg, 1, -1
Library/Rochester/setVecFunction2Curvature/ur_vc_4_1.pg, 1, -1
Library/Rochester/setVecFunction2Curvature/ur_vc_4_2.pg, 1, -1
Library/Rochester/setVecFunction2Curvature/ur_vc_4_4.pg, 1, -1
Library/maCalcDB/setVecFunction3Motion/ur_vc_4_8.pg, 1, -1
Library/maCalcDB/setVecFunction2Curvature/ur_vc_4_3.pg, 1, -1
Library/Rochester/setVecFunction3Motion/ur_vc_4_7.pg, 1, -1
Library/ASU-topics/setCalculus/stef13_4p1.pg, 1, -1
Library/FortLewis/Calc3/17-2-Motion-velocity/HGM4-17-2-06-Motion-velocity-acceleration.pg, 1, -1
Library/ASU-topics/setCalculus/stef13_4p2.pg, 1, -1
Library/Dartmouth/setMTWCh4S2/problem_5.pg, 1, -1
Library/272/setStewart13_3/problem_5.pg, 1, -1
Library/Dartmouth/setStewartCh14S3/problem_3.pg, 1, -1


Since I did not see any other courses or homework sets have this kind of file in this place, so I think it is strange. The problematic HW set is WW3. Does that matter?

Thanks,


Steven Xiao
In reply to Steven Xiao

Re: Problem with a particular problem set?

by Michael Gage -
As I said, the admin course behaves somewhat differently.  You can go 
remove the version_id fields from the admin mysql tables using the mysql software, but the extra fields are doing no harm and the message you see above is just a warning.

Do you actually have a directory called /COURSE_NAME  ?  quite likely
 that was created by mistake.


*.def files are used to input homework sets and should be in the 
templates directory of each course (as they appear to be in your case).  They are a plain text representation of the homework set structure in the database. 

Which problem of homework set WW3 do you get an error for?  If you are getting an error for the top page of the homework set you might want to assign the set a specific header instead of the default header.  The default sometimes doesn't work correctly. (Use the homework sets editor to make this choice.)


In reply to Michael Gage

Re: Problem with a particular problem set?

by Steven Xiao -
BTW, when I say log on as admin, I meant log on to that course as admin, just like a student in that course or a professor in that course.

The professor of that course created me another test account. With that account, everything looked fine.

Thanks,

Steven Xiao
In reply to Steven Xiao

Re: Problem with a particular problem set?

by Michael Gage -
Possibly the user "admin" hadn't been assigned one of the homework sets? It's a little hard to tell for sure without more experimenting.  It might be that unassigning that set to admin and reassigning it would fix the problem. (Be careful not to unassign sets to students who have already started work on a homework set -- you will loose all of the data.)


In reply to Michael Gage

Re: Problem with a particular problem set?

by Steven Xiao -
admin had been assigned to all those homework sets. Blake tried to created a test course, and tried to assign and unassign, then assign again. It did not work.

Steven
In reply to Michael Gage

Re: Problem with a particular problem set?

by Steven Xiao -
Some updates.

I finally got the problem set:

openDate = 02/02/2014 at 11:59pm CST
dueDate = 02/11/2014 at 11:59pm CST
answerDate = 02/12/2014 at 11:59pm CST
paperHeaderFile = defaultHeader
screenHeaderFile = defaultHeader
description =
problemList =
Library/Rochester/setVecFunction2Curvature/ur_vc_4_5.pg, 1, -1
Library/Rochester/setVecFunction2Curvature/ur_vc_4_1.pg, 1, -1
Library/Rochester/setVecFunction2Curvature/ur_vc_4_2.pg, 1, -1
Library/Rochester/setVecFunction2Curvature/ur_vc_4_4.pg, 1, -1
Library/maCalcDB/setVecFunction3Motion/ur_vc_4_8.pg, 1, -1
Library/maCalcDB/setVecFunction2Curvature/ur_vc_4_3.pg, 1, -1
Library/Rochester/setVecFunction3Motion/ur_vc_4_7.pg, 1, -1
Library/ASU-topics/setCalculus/stef13_4p1.pg, 1, -1
Library/FortLewis/Calc3/17-2-Motion-velocity/HGM4-17-2-06-Motion-velocity-acceleration.pg, 1, -1
Library/ASU-topics/setCalculus/stef13_4p2.pg, 1, -1
Library/Dartmouth/setMTWCh4S2/problem_5.pg, 1, -1
Library/272/setStewart13_3/problem_5.pg, 1, -1
Library/Dartmouth/setStewartCh14S3/problem_3.pg, 1, -1


This is really strange problem for us. It worked ok at first. Then suddenly it stopped working. For quite some time, some users could still do that homework set while some other could not. From the system log, I can see that the first error came up when some student started doing the problem 7. This problem set file is not available from the course directly any more. Blake has a backup. My guess is that some problem(s) in this set might cause the problem under some very specific condition and we were the lucky winner.

When I first checked the problem, I found that there were some problems with the database. The corresponding table should be math233spring2014_problem_user. When I use mysqlcheck command, it looks like it fixed the problem. At least it does not report any database problem any more. But the error message from webwork is still there.

Can someone look into this strange problem?

Thanks,

Steven