From 87a5368df10b546718e18225383e931ff4e47018 Mon Sep 17 00:00:00 2001 From: David Mudrak Date: Mon, 4 Jan 2010 18:07:28 +0000 Subject: [PATCH] Scalability issues Did not display properly with dozens of users --- mod/workshop/allocation/random/lib.php | 12 ++++++------ mod/workshop/renderer.php | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/mod/workshop/allocation/random/lib.php b/mod/workshop/allocation/random/lib.php index cba20d52eb..d0212380cd 100644 --- a/mod/workshop/allocation/random/lib.php +++ b/mod/workshop/allocation/random/lib.php @@ -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); diff --git a/mod/workshop/renderer.php b/mod/workshop/renderer.php index d605dea9a1..b4c25b8ef5 100644 --- a/mod/workshop/renderer.php +++ b/mod/workshop/renderer.php @@ -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()); -- 2.39.5