Errors when attempting first course

we7u
Forums
I've got a sample course with 3 lessons in it, two theory and one quiz. When I get to the end of any of the lessons I get an error page: "The website encountered an unexpected error. Please try again later. " These show up in the "Recent Log Message" listing: Notice: Undefined offset: 1 in DatabaseStatementBase->fetchAllKeyed() (line 2212 of /var/www/html/opigno/includes/database/database.inc). PDOException: SQLSTATE[22012]: Division by zero: 7 ERROR: division by zero: SELECT (max_score / ( SELECT max_score FROM {quiz_question_properties} WHERE nid = :nid AND vid = :vid )) as scale FROM {quiz_node_relationship} WHERE parent_nid = :parent_nid AND parent_vid = :parent_vid AND child_nid = :child_nid AND child_vid = :child_vid ; Array ( [:nid] => 11 [:vid] => 13 [:parent_nid] => 5 [:parent_vid] => 19 [:child_nid] => 11 [:child_vid] => 13 ) in quiz_store_question_result() (line 2454 of /var/www/html/opigno/profiles/opigno_lms/modules/contrib/quiz/quiz.module). Am running Opigno 1.20.0 and PostgreSQL 9.2.14. I disabled a bunch of the optional modules I had loaded earlier to see if it made a difference: It didn't. I'm thinking seriously about starting with a fresh install/wiping out the database and installing from scratch with the latest-latest Opigno. It shouldn't be something I forgot to set while creating lessons, right? Any pointers? Thanks!
Profile picture for user James Aparicio
James Aparicio

Hi we7u,

Hi we7u,

Have you changed the quiz module in any way?

Best regards

we7u

I've done no coding changes.

I've done no coding changes. There were errors logged earlier about improperly formed SQL for PostgreSQL when I clicked on the "Training Catalog" w/o being logged in, prior to getting rid of that option (via the GUI). It didn't seem to cause any issues other than an SQL error getting logged.
Profile picture for user James Aparicio
James Aparicio

Do you mind creating a new

Do you mind creating a new clean instance, without adding any other modules and trying to replicate the error with the same course/lessons?

 

Best regards 

we7u

I suppose I could.

I suppose I could. More info: Errors don't happen for type "Quiz", but do for types "Theory" and "Mixed": When I hit the "Next" button on a slide. Also: The label is always "Question" when editing a Lesson, whether it requires "Slides" or "Questions" (Based on Theory/Mixed/Quiz). That was confusing to me. I'll edit the PHP later on to correct that, once I get the basic site working properly. I'll save the backups from this morning , then wipe the database and HTML areas and start over. Will report back as to whether I get the same error(s). Thanks for the response!
we7u

Brand-new install of 7-1.20.0

Brand-new install on CentOS-7 with Apache-2.4.6-40 and PostgreSQL-9.2.14-1. During the standard module installations (part of the base install, I didn't install ANYTHING extra) I got these errors: Warning: Invalid argument supplied for foreach() in user_permission_get_modules() (line 3082 of /var/www/html/opigno/modules/user/user.module). While installing "opigno_notifications_app" module I think, as the next message (via timestamp) said that module was installed. Warning: Invalid argument supplied for foreach() in user_permission_get_modules() (line 3082 of /var/www/html/opigno/modules/user/user.module). While installing "phpexcel" module I think. I see a lot of "Undefined index" messages. Here's an example: Notice: Undefined index: reverse_opigno_class_courses_node in views_handler_field_field->get_base_table() (line 149 of /var/www/html/opigno/profiles/opigno_lms/modules/contrib/views/modules/field/views_handler_field_field.inc). If I filter only on Warning level and above there are 24 warnings, but there may be more that fell off the other end of the log view. These 24 warnings are without having done anything except the base install of Opigno. They are all of the format: "Warning: Invalid argument supplied for foreach() in..." A bit of searching found this: "http://www.phpro.org/tutorials/Introduction-to-PHP-PDO.html" which for the message: "Warning: Invalid argument supplied for foreach()" says: "The SELECT statement has a field name 'username' which does not exist and an error is generated by the database." Just for the heck of it I just did a fresh install into MariaDB (instead of PostgreSQL): Ended up with 23 errors above the NOTICE level, so very similar to the other install. Should I try a fresh 7.x-1.21 instead or will it give me the same results? Just tried with 7.x-1.21 and MariaDB. Got the same results.
we7u

Better this time around, but errors still logged

I created a course in a similar manner to what I did before, but with a fresh install of Opigno-1.21.0 and MySQL this time: No extra modules, no extra configs other than the minimum necessary to install Opigno. This time running through the course worked, meaning no web page saying: "An error occurred". I am still getting lots of warnings/errors logged though while running through the course. Nothing too scary, but they constantly come in. Also still have the original install warnings/errors that ARE somewhat scarier which get logged at that point. I'll start again with a clean install of Opigno-1.21.0 and PostgreSQL. This time I'll add modules one at a time as I feel I need them, making sure a backup occurs between each one so I can recover if things go terribly wrong. Are there any guidelines for which modules/settings are most useful/reliable, and which are not? Thanks for the help so far, it's much appreciated!