]> git.mjollnir.org Git - moodle.git/commitdiff
Removed usage of table aliases with "as" as per MDL-10808
authormoodler <moodler>
Sat, 11 Aug 2007 14:28:36 +0000 (14:28 +0000)
committermoodler <moodler>
Sat, 11 Aug 2007 14:28:36 +0000 (14:28 +0000)
question/category_class.php
question/category_form.php
question/editlib.php
question/upgrade.php

index 07b457d4dfe776189a5f45666b28fc253955a1f9..c501ec6a823ddc2feda91b59983095705589d81a 100644 (file)
@@ -416,7 +416,7 @@ class question_category_object {
         $cat->name = $newname;
         $cat->info = $newinfo;
         //never move category where it is the default
-        if (1 != count_records_sql("SELECT count(*) FROM {$CFG->prefix}question_categories as c1, {$CFG->prefix}question_categories as c2 WHERE c2.id = $updateid AND c1.contextid = c2.contextid")){
+        if (1 != count_records_sql("SELECT count(*) FROM {$CFG->prefix}question_categories c1, {$CFG->prefix}question_categories c2 WHERE c2.id = $updateid AND c1.contextid = c2.contextid")){
             if ($oldcat->contextid == $tocontextid){ // not moving contexts
                 $cat->parent = $parentid;
                 if (!update_record("question_categories", $cat)) {
index 47ae3b2e961ac2bfe5432a43b6379e3f35438c53..84a0d28e18c0c74ef389cd1b55b059f700dbba7d 100644 (file)
@@ -17,7 +17,7 @@ class question_category_edit_form extends moodleform {
         $questioncategoryel = $mform->addElement('questioncategory', 'parent', get_string('parent', 'quiz'),
                     array('contexts'=>$contexts, 'top'=>true, 'currentcat'=>$currentcat, 'nochildrenof'=>$currentcat));
         $mform->setType('parent', PARAM_SEQUENCE);
-        if (1 == count_records_sql("SELECT count(*) FROM {$CFG->prefix}question_categories as c1, {$CFG->prefix}question_categories as c2 WHERE c2.id = $currentcat AND c1.contextid = c2.contextid")){
+        if (1 == count_records_sql("SELECT count(*) FROM {$CFG->prefix}question_categories c1, {$CFG->prefix}question_categories c2 WHERE c2.id = $currentcat AND c1.contextid = c2.contextid")){
             $mform->hardFreeze('parent');
         }
 
index abead698da4d9d972fe3dbc438c9fb71985c5ff1..947e1e8cd92ca812de03aa496ae3cfd7a822b83b 100644 (file)
@@ -114,8 +114,8 @@ function question_make_default_categories($contexts) {
 
 function question_can_delete_cat($todelete){
     global $CFG;
-    $record = get_record_sql("SELECT count(*) as count, c1.contextid as contextid FROM {$CFG->prefix}question_categories as c1,
-                {$CFG->prefix}question_categories as c2 WHERE c2.id = $todelete
+    $record = get_record_sql("SELECT count(*) as count, c1.contextid as contextid FROM {$CFG->prefix}question_categories c1,
+                {$CFG->prefix}question_categories c2 WHERE c2.id = $todelete
                 AND c1.contextid = c2.contextid GROUP BY c1.contextid");
     $contextid = $record->contextid;
     $count = $record->count;
@@ -935,4 +935,4 @@ function require_login_in_context($contextorid = null){
         require_login();
     }
 }
-?>
\ No newline at end of file
+?>
index efcc2335dd379834d66ce1bef2fd78a6c003c700..e87daccb26218528b88c58f2b3788426440b1220 100644 (file)
@@ -102,8 +102,8 @@ function question_delete_unused_random(){
     $tofix = array();
     $result = true;
     //delete all 'random' questions that are not been used in a quiz.
-    if ($qqis = get_records_sql("SELECT q.* FROM {$CFG->prefix}question as q LEFT JOIN ".
-                                    "({$CFG->prefix}quiz_question_instances as qqi) ".
+    if ($qqis = get_records_sql("SELECT q.* FROM {$CFG->prefix}question q LEFT JOIN ".
+                                    "({$CFG->prefix}quiz_question_instances qqi) ".
                                     "ON (q.id = qqi.question) WHERE q.qtype='random' AND qqi.question IS NULL")){
         $qqilist = join(array_keys($qqis), ',');
         $result = $result && delete_records_select('question', "id IN ($qqilist)");
@@ -118,7 +118,7 @@ function question_cwqpfs_to_update($categories = null){
 
     //any cats with questions picking from subcats?
     if (!$cwqpfs = get_records_sql_menu("SELECT DISTINCT qc.id, 1 ".
-                                    "FROM {$CFG->prefix}question as q, {$CFG->prefix}question_categories as qc ".
+                                    "FROM {$CFG->prefix}question q, {$CFG->prefix}question_categories qc ".
                                     "WHERE q.qtype='random' AND qc.id = q.category AND q.questiontext = 1")){
         return array();
     } else {