[moodle] / contrib / plugins / grade / report / visual / lib.php Repository:

Diff of /contrib/plugins/grade/report/visual/lib.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1, Tue Jul 1 15:30:01 2008 WST revision 1.2, Tue Jul 15 03:27:17 2008 WST

By dservos:

CONTRIB-497 Cleaned up some of the code for report/visual and the flex based application for viewing the visualizations. Improved the UI of the visualization. Added documentation to both the php and actionscript 3 (flex) code. Removed some unneeded files. TODO: *Add more visualizations. *Add printer firendly version. *Make flex appplications settings less hardcoded and loaded from moodle. *Load lang files from moodle to flex for full language support. *Add a settings page for the report.

# Line 216  Line 216 
216          }*/          }*/
217      }      }
218    
219        /**
220        * TODO: have this make the data depending on what kind of visulsation
221        * is needed rather then a singal visulasztion witch is currently hardcoded.
222        */
223      public function report_data() {      public function report_data() {
224          $this->visdata['test2'] = array();          $this->visdata['test2'] = array();
225          $this->visdata['test2']['header'] = array();          $this->visdata['test2']['header'] = array();
# Line 259  Line 263 
263          }          }
264      }      }
265    
266        /**
267        *TODO: Have this call on flex.php to generate html for the report.,
268        *rather then having it hardcoded as it is now.
269        */
270      public function adapt_data($printerversion = false) {      public function adapt_data($printerversion = false) {
271    
272      }      }
273    
274        /**
275         * Returns the data for a visulazation in json format.
276         * TODO: Use moodle's json encoding functions rather then phps.
277         * @param boolean $return if true return a string, other wise echo the data.
278         * @return string If return is set to true, returns a string of the data in json format.
279         */
280      public function get_json($return = true) {      public function get_json($return = true) {
281          if ($return) {          if ($return) {
282              return json_encode($this->visdata['test']);              return json_encode($this->visdata['test']);
# Line 271  Line 285 
285          }          }
286      }      }
287    
288    
289        /**
290         * Returns the data for a visulasation in tab format.
291         * @param boolean $return if true return a string, other wise echo the data.
292         * @return string If return is set to true, returns a string of the data in tab format.
293         */
294      public function get_tab($return = true) {      public function get_tab($return = true) {
295          if ($return) {          if ($return) {
296              return $this->tab_encode($this->visdata['test2']);              return $this->tab_encode($this->visdata['test2']);
# Line 279  Line 299 
299          }          }
300      }      }
301    
302        /**
303         * Encodes an array to a string using the tab format.
304         *@param array $data the array to encode.
305         *@return string a string encoded in tab format based on the given array.
306         */
307      private function tab_encode(array $data) {      private function tab_encode(array $data) {
308          $outstring = '';          $outstring = '';
309    

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

Moodle CVS Admin
ViewVC Help
Powered by ViewVC 1.0.7