I have been using quiz for quite some time and recently have been having a display issue where it appears SQL code is displayed on the page. This only happens with the quiz module when I invoke the quiz view. The take view is fine. Attached is a screen print of the dispalyed text.

CommentFileSizeAuthor
quiz.JPG123.88 KBbkube

Comments

bkube’s picture

Any help with this?

bkube’s picture

The only other info I can offer is: I had 2 identical sites running off of the same database. This anomaly showed up when I was making the links relative to the site and not the entire path. No other page display was effected only the quiz view node. All of the other nodes display fine. I have since deleted the initial test sight. This really makes the quiz look bad. Would appreciate any and all suggestions. Maybe it's a template file that got corrupted or something. Please help!

vm’s picture

Category: Bug report » Support request
Issue summary: View changes
Status: Active » Postponed (maintainer needs more info)

I can't reproduce the issue. I suggest testing on a vanilla installation. If it works as expected then the issue is specific to your site and either the modules in use or the combination of modules in use. When you don't keep your core and the modules you use updated to the latest releases you should expect issues.

bkube’s picture

The issue Persisted after upgrading and restoring the database. I assume there are some database entries that are creating the weird display but I dont know where to start.

djdevin’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

That code you see is from a print_r(), you must have it somewhere in your custom code (or a contrib that accidentally has it). So it would persist after you set up a new database.

Quiz doesn't contain any print_r()s in code, so I'd search for print_r across all of your code.

bkube’s picture

Ok thanks. Would disabling a module at a time help to isolate the code location? I assume that's where the code would be, in a module? But why is this anomaly only present in the quiz view page? Could it be in the quiz view view code?

djdevin’s picture

It's not in the Quiz view code, unless you modified it. I would suggest re-installing Drupal 6, then Quiz, then manually enabling your modules one by one to see which one is doing it.

You could also search your code for "print_r" to see if there are any that look suspicious.

bkube’s picture

It appears thei si the offending code from the page source. How can I track down it's origin?

Array
(
[#action] => /node/797/take
[button] => Array
(
[#type] => button
[#value] => Start
)

[#parameters] => Array
(
[0] => quiz_start_quiz_button_form
[1] => Array
(
[storage] =>
[submitted] =>
[post] => Array
(
)

)

[2] => stdClass Object
(
[nid] => 797
[type] => quiz
[language] => en
[uid] => 1
[status] => 1
[created] => 1397843423
[changed] => 1397845431
[comment] => 2
[promote] => 0
[moderate] => 0
[sticky] => 0
[tnid] => 0
[translate] => 0
[vid] => 1033
[revision_uid] => 1
[title] => CAP BCP-A 2014
[body] =>
[teaser] =>
[log] =>
[revision_timestamp] => 1397845431
[format] => 2
[name] => bkube
[picture] =>
[data] => a:2:{s:13:"form_build_id";s:48:"form-Bdyb94XLew8AR3pUtfFUIPdbru9jb8BfQog0BxDj7fk";s:7:"contact";i:0;}
[aid] => 0
[number_of_random_questions] => 0
[max_score_for_random] => 1
[pass_rate] => 75
[summary_pass] =>
Congratulations you passed

[summary_default] =>
[randomization] => 1
[backwards_navigation] => 1
[repeat_until_correct] => 0
[feedback_time] => 0
[display_feedback] => 1
[quiz_open] => 1397793600
[quiz_close] => 1400385600
[takes] => 3
[show_attempt_stats] => 1
[keep_results] => 2
[time_limit] => 0
[quiz_always] => 1
[tid] => 0
[has_userpoints] => 0
[allow_skipping] => 1
[allow_resume] => 1
[allow_jumping] => 0
[path] => content/cap_bcp_a_2014
[print_display] => 0
[print_display_comment] => 0
[print_display_urllist] => 0
[print_pdf_display] => 0
[print_pdf_display_comment] => 0
[print_pdf_display_urllist] => 0
[last_comment_timestamp] => 1397843423
[last_comment_name] =>
[comment_count] => 0
[taxonomy] => Array
(
)

[build_mode] => 0
[readmore] =>
[content] => Array
(
[body] => Array
(
[#value] =>
[#weight] => 0
)

[stats] => Array
(
[#value] =>

Questions: 5
Attempts allowed: 3
Available: Always
Pass rate: 75 %
Backwards navigation: Allowed

[#weight] => -1
)

)

[number_of_questions] => 5
)

)

[#build_id] => form-zHApInYNaGnpdWEXUmp3Xm2yBHRtz6vVU3COc8FUuPk
[#type] => form
[#programmed] =>
[form_build_id] => Array
(
[#type] => hidden
[#value] => form-zHApInYNaGnpdWEXUmp3Xm2yBHRtz6vVU3COc8FUuPk
[#id] => form-zHApInYNaGnpdWEXUmp3Xm2yBHRtz6vVU3COc8FUuPk
[#name] => form_build_id
)

[#token] => quiz_start_quiz_button_form
[form_token] => Array
(
[#id] => edit-quiz-start-quiz-button-form-form-token
[#type] => token
[#default_value] => e110709a97be1c960c5a6aa9a28123cf
)

[form_id] => Array
(
[#type] => hidden
[#value] => quiz_start_quiz_button_form
[#id] => edit-quiz-start-quiz-button-form
)

[#id] => quiz-start-quiz-button-form
[#description] =>
[#attributes] => Array
(
)

[#required] =>
[#tree] =>
[#parents] => Array
(
)

[#method] => post
[#after_build] => Array
(
[0] => ckeditor_process_form
)

djdevin’s picture

You cannot track it down from there, it may be coming from a custom form_alter.

Search your codebase for print_r and you will find why it is printing out the form array.

Or, take the steps as suggested in #3 and #7 to narrow down your search.

bkube’s picture

Thanks for the reply, but I'm a bit green, not in IT I'm in healthcare so although I have picked up some knowledge I'm far from an expert. Which files should I explore? (code base?) and if I find the print_r(), what do I do then, comment it out?