]> git.mjollnir.org Git - moodle.git/commitdiff
Step 1 of Bug 1223 done.
authorstronk7 <stronk7>
Sat, 15 May 2004 23:18:24 +0000 (23:18 +0000)
committerstronk7 <stronk7>
Sat, 15 May 2004 23:18:24 +0000 (23:18 +0000)
(http://moodle.org/bugs/bug.php?op=show&bugid=1223)

mod/assignment/lib.php
mod/forum/lib.php
mod/glossary/lib.php
mod/journal/lib.php

index 6502e4279832697e79923db90a2281449045b845..36a754040df6c7816739712f131e4f8878283590 100644 (file)
@@ -377,6 +377,20 @@ function assignment_get_participants($assignmentid) {
     return ($students);
 }
 
+function assignment_scale_used ($assignmentid,$scaleid) {
+//This function returns if a scale is being used by one assignment
+
+    $return = false;
+
+    $rec = get_record("assignment","id","$assignmentid","grade","-$scaleid");
+
+    if (!empty($rec)) {
+        $return = true;
+    }
+
+    return $return;
+}
+
 /// SQL STATEMENTS //////////////////////////////////////////////////////////////////
 
 function assignment_log_info($log) {
index 9f47998d69caed060cc3955efbdc6230873ddbd8..d058a2de6f2dd905ac7cfe574b229104f2a285cd 100644 (file)
@@ -584,6 +584,20 @@ function forum_get_participants($forumid) {
     return ($st_subscriptions);
 }
 
+function forum_scale_used ($forumid,$scaleid) {
+//This function returns if a scale is being used by one forum
+    
+    $return = false;
+                                 
+    $rec = get_record("forum","id","$forumid","scale","-$scaleid");
+        
+    if (!empty($rec)) { 
+        $return = true;
+    }
+    
+    return $return;
+}
+
 /// SQL FUNCTIONS ///////////////////////////////////////////////////////////
 
 function forum_get_post_full($postid) {
index 6ba303bb7ba92f09fb2acb1bf34d4d9a825fbf1f..8ac26c3c713fd0371a6c2ed6864c2a36c952c588 100644 (file)
@@ -362,6 +362,20 @@ function glossary_get_participants($glossaryid) {
     return ($students);
 }
 
+function glossary_scale_used ($glossaryid,$scaleid) {
+//This function returns if a scale is being used by one glossary
+   
+    $return = false;
+
+    $rec = get_record("glossary","id","$glossaryid","scale","-$scaleid");
+
+    if (!empty($rec)) {
+        $return = true;               
+    }                            
+    
+    return $return;
+}
+
 //////////////////////////////////////////////////////////////////////////////////////
 /// Any other glossary functions go here.  Each of them must have a name that
 /// starts with glossary_
index 5ef4c421226d6d773c19f5411d9d5686a2951556..7e120f1d1772f5bf383dd8fd60cbb87f64e8e5cf 100644 (file)
@@ -292,6 +292,20 @@ function journal_get_participants($journalid) {
     return ($students);
 }
 
+function journal_scale_used ($journalid,$scaleid) {
+//This function returns if a scale is being used by one journal
+    
+    $return = false;                  
+                                 
+    $rec = get_record("journal","id","$journalid","assessed","-$scaleid");
+
+    if (!empty($rec)) {
+        $return = true;
+    }
+
+    return $return;
+}
+
 // SQL FUNCTIONS ///////////////////////////////////////////////////////////////////
 
 function journal_get_users_done($journal) {