예제 #1
0
 /**
  * getMixEvalDemoData get demo data for mix evaluation preview
  *
  * @param mixed $data mix data
  *
  * @static
  * @access public
  * @return array demo data
  */
 static function getMixEvalDemoData($mixeval, $selfEval = 1)
 {
     return array('event' => array('Event' => array('id' => 0, 'title' => 'Preview Event', 'self_eval' => $selfEval, 'due_date' => Toolkit::formatDate(time() + 5 * 24 * 60 * 60), 'release_date_end' => Toolkit::formatDate(time() + 6 * 24 * 60 * 60), 'description' => 'Preview for mix evaluation event.', 'com_req' => true, 'template_id' => 0), 'Group' => array('id' => 0, 'group_name' => 'Demo Group'), 'GroupEvent' => array('id' => 0)), 'groupMembers' => array(array('User' => array('id' => 1, 'first_name' => 'Demo', 'last_name' => 'Student1', 'full_name' => 'Demo Student1')), array('User' => array('id' => 2, 'first_name' => 'Demo', 'last_name' => 'Student2', 'full_name' => 'Demo Student2')), array('User' => array('id' => 3, 'first_name' => 'Demo', 'last_name' => 'Student3', 'full_name' => 'Demo Student3'))), 'mixeval' => array('Mixeval' => $mixeval), 'courseId' => 0, 'userId' => 1, 'evaluateeCount' => 2, 'fullName' => User::get('full_name'), 'members' => 0, 'enrol' => 1, 'self' => null, 'preview' => true);
 }
예제 #2
0
 /**
  * formatDates
  *
  * @param mixed $data
  *
  * @access public
  * @return void
  */
 function formatDates($data)
 {
     // Process data if it's there
     if (!empty($data) && is_array($data)) {
         // For each column defined
         foreach ($this->columns as $column) {
             // Is this column maked as a date?
             if ($column[3] == "date") {
                 $split = explode(".", $column[0], 2);
                 $model = $split[0];
                 $col = $split[1];
                 foreach ($data as $key => $entry) {
                     $date = strtotime($entry[$model][$col]);
                     $date = Toolkit::formatDate($date);
                     $data[$key][$model][$col] = $date;
                 }
             }
         }
     }
     return $data;
 }