From 5fceb049cc33424bfa8ad2420d81e0efb286c6d8 Mon Sep 17 00:00:00 2001
From: tjhunt <tjhunt>
Date: Mon, 30 Jul 2007 17:04:46 +0000
Subject: [PATCH] Use of get_html_head_contributions was causing unwanted
 interaction bewteen question types. Switched to using a class variable.

---
 question/type/questiontype.php | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/question/type/questiontype.php b/question/type/questiontype.php
index 538af6b068..da40a84e35 100644
--- a/question/type/questiontype.php
+++ b/question/type/questiontype.php
@@ -680,6 +680,8 @@ class default_questiontype {
         return false;
     }
 
+    // Used by the following function, so that it only returns results once per quiz page.
+    var $already_done = false;
     /**
      * If this question type requires extra CSS or JavaScript to function,
      * then this method will return an array of <link ...> tags that reference
@@ -700,14 +702,13 @@ class default_questiontype {
         // script.js or script.php that exist in the plugin folder.
         // Core question types should not use this mechanism. Their styles
         // should be included in the standard theme.
-        
+
         // We only do this once 
         // for this question type, no matter how often this method is called.
-        static $already_done = false;
-        if ($already_done) {
+        if ($this->already_done) {
             return array();
         }
-        $already_done = true;
+        $this->already_done = true;
         
         $plugindir = $this->plugin_dir();
         $baseurl = $this->plugin_baseurl();
-- 
2.39.5