]> git.mjollnir.org Git - moodle.git/commitdiff
Scalability issues
authorDavid Mudrak <david.mudrak@gmail.com>
Mon, 4 Jan 2010 18:07:28 +0000 (18:07 +0000)
committerDavid Mudrak <david.mudrak@gmail.com>
Mon, 4 Jan 2010 18:07:28 +0000 (18:07 +0000)
Did not display properly with dozens of users

mod/workshop/allocation/random/lib.php
mod/workshop/renderer.php

index cba20d52eb0f4b4e332a5be557ca4ae85aaf563a..d0212380cdc35d2ac311f75bfbcfb90dad9f2c1e 100644 (file)
@@ -366,8 +366,8 @@ class workshop_random_allocator implements workshop_allocator {
         } else {
             throw new moodle_exception('unknownusertypepassed', 'workshop');
         }
-        $o[] = 'debug::circle links = ' . json_encode($circlelinks);
-        $o[] = 'debug::square links = ' . json_encode($squarelinks);
+        // $o[] = 'debug::circle links = ' . json_encode($circlelinks);
+        // $o[] = 'debug::square links = ' . json_encode($squarelinks);
         $squareworkload         = array();  // individual workload indexed by squareid
         $squaregroupsworkload   = array();    // group workload indexed by squaregroupid
         foreach ($allsquares as $squaregroupid => $squares) {
@@ -382,8 +382,8 @@ class workshop_random_allocator implements workshop_allocator {
             $squaregroupsworkload[$squaregroupid] /= count($squares);
         }
         unset($squaregroupsworkload[0]);    // [0] is not real group, it contains all users
-        $o[] = 'debug::square workload = ' . json_encode($squareworkload);
-        $o[] = 'debug::square group workload = ' . json_encode($squaregroupsworkload);
+        // $o[] = 'debug::square workload = ' . json_encode($squareworkload);
+        // $o[] = 'debug::square group workload = ' . json_encode($squaregroupsworkload);
         $gmode = groups_get_activity_groupmode($this->workshop->cm, $this->workshop->course);
         if (SEPARATEGROUPS == $gmode) {
             // shuffle all groups but [0] which means "all users"
@@ -394,7 +394,7 @@ class workshop_random_allocator implements workshop_allocator {
             $circlegroups = array(0);
         }
         $this->shuffle_assoc($circlegroups);
-        $o[] = 'debug::circle groups = ' . json_encode($circlegroups);
+        // $o[] = 'debug::circle groups = ' . json_encode($circlegroups);
         foreach ($circlegroups as $circlegroupid) {
             $o[] = 'debug::processing circle group id ' . $circlegroupid;
             $circles = $allcircles[$circlegroupid];
@@ -437,7 +437,7 @@ class workshop_random_allocator implements workshop_allocator {
                     $o[] = 'debug::indent::next square should be from group id ' . $targetgroup;
                     // now, choose a square from the target group
                     $trysquares = array_intersect_key($squareworkload, $allsquares[$targetgroup]);
-                    $o[] = 'debug::indent::individual workloads in this group are ' . json_encode($trysquares);
+                    // $o[] = 'debug::indent::individual workloads in this group are ' . json_encode($trysquares);
                     unset($trysquares[$circleid]);  // can't allocate to self
                     $trysquares = array_diff_key($trysquares, array_flip($circlelinks[$circleid])); // can't re-allocate the same
                     $targetsquare = $this->get_element_with_lowest_workload($trysquares);
index d605dea9a1b11038cd8342916502fea3b3b216c2..b4c25b8ef5d56c844be72f38f3791f65d7597075 100644 (file)
@@ -103,7 +103,7 @@ class moodle_mod_workshop_renderer extends moodle_renderer_base {
                     // do not display allocation debugging messages
                     continue;
                 }
-                $o .= $this->output->output_tag('li', array('class' => $class), $text);
+                $o .= $this->output->output_tag('li', array('class' => $class), $text) . "\n";
             }
             $o .= $this->output->output_end_tag('ul');
             $o .= $this->output->continue_button($this->page->url->out());