Changeset 8f75a27 in iPeer


Ignore:
Timestamp:
2013-08-27T16:53:35-07:00 (4 years ago)
Author:
Compass <pan.luo@…>
Branches:
3.1.x, dev, master
Children:
8cab1df
Parents:
e3cf559 (diff), 227b6ba (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'studentEvalBug' into dev

Conflicts:

app/config/sql/ipeer_samples_data.sql
app/controllers/components/password_generator.php
app/tests/cases/controllers/courses_controller.test.php
app/tests/cases/controllers/home_controller.test.php

Files:
10 edited

Legend:

Unmodified
Added
Removed
  • app/config/core.php

    re3cf559 r8f75a27  
    343343  $CWL['applicationPassword'] = '';
    344344
    345   define('IPEER_VERSION', '3.0.6');
     345  define('IPEER_VERSION', '3.0.7');
    346346
    347347
  • app/config/sql/ipeer_samples_data.sql

    re3cf559 r8f75a27  
    788788
    789789INSERT INTO `email_schedules` (`id`, `subject`, `content`, `date`, `from`, `to`, `course_id`, `event_id`, `grp_id`, `sent`, `creator_id`, `created`) VALUES
    790 (1, 'Email Template', 'Hello, {{{FIRSTNAME}}}', '2013-07-18 16:52:31', '1', '5;6;7;13;15;17;19;21;26;28;31;32;33', NULL, NULL, NULL, 0, 1, '2012-07-16 16:52:50'),
     790(1, 'Email Template', 'Hello, {{{FIRSTNAME}}}', CONCAT(YEAR(DATE_ADD(NOW(), INTERVAL 1 YEAR)), '-07-18 16:52:31'), '1', '5;6;7;13;15;17;19;21;26;28;31;32;33', NULL, NULL, NULL, 0, 1, '2012-07-16 16:52:50'),
    791791(2, 'Email Template', 'Hello, {{{USERNAME}}}', '2011-07-18 16:52:31', '1', '5;6;7;13;15;17;19;21;26;28;31;32;33', NULL, NULL, NULL, 0, 1, '2010-07-16 16:57:50'),
    792792(3, 'Email Template', 'Hi, {{{USERNAME}}}', '2011-07-18 17:52:31', '1', '5;6;7;13;15;17;19;21;26;28;31;32;33', NULL, NULL, NULL, 1, 1, '2010-07-16 16:57:50');
     
    11571157(7, 'simple evaluation 3', 1, '3rd simple evaluation for testing overdue event', 1, 1, '0', 0, 0, 1, '2012-11-28 00:00:00', '2012-11-20 00:00:00', '2012-11-29 00:00:00', '2022-11-30 00:00:00', '2022-12-12 00:00:00', 'A', 1, '2012-11-21 12:23:13', 1, '2012-11-21 12:23:13'),
    11581158(8, 'simple evaluation 4', 1, 'result released with submission', 1, 1, '0', 0, 0, 1, '2012-11-28 00:00:00', '2012-11-20 00:00:00', '2012-11-29 00:00:00', '2012-11-30 00:00:00', '2022-12-12 00:00:00', 'A', 1, '2012-11-21 12:23:13', 1, '2012-11-21 12:23:13'),
    1159 (9, 'simple evaluation 5', 1, 'result released with no submission', 1, 1, '0', 0, 0, 1, '2012-11-28 00:00:00', '2012-11-20 00:00:00', '2012-11-29 00:00:00', '2012-11-30 00:00:00', '2022-12-12 00:00:00', 'A', 1, '2012-11-21 12:23:13', 1, '2012-11-21 12:23:13');
     1159(9, 'simple evaluation 5', 1, 'result released with no submission', 1, 1, '0', 0, 0, 1, '2012-11-28 00:00:00', '2012-11-20 00:00:00', '2012-11-29 00:00:00', '2012-11-30 00:00:00', '2022-12-12 00:00:00', 'A', 1, '2012-11-21 12:23:13', 1, '2012-11-21 12:23:13'),
     1160(10, 'simple evaluation 6', 1, 'result released with no submission', 1, 1, '0', 0, 0, 1, CONCAT(YEAR(DATE_ADD(NOW(), INTERVAL 2 YEAR)), '-07-31 11:20:00'), CONCAT(YEAR(DATE_ADD(NOW(), INTERVAL 1 YEAR)), '-07-31 11:20:00'), CONCAT(YEAR(DATE_ADD(NOW(), INTERVAL 2 YEAR)), '-07-31 11:20:00'), CONCAT(YEAR(DATE_ADD(NOW(), INTERVAL 2 YEAR)), '-07-31 11:20:00'), CONCAT(YEAR(DATE_ADD(NOW(), INTERVAL 3 YEAR)), '-07-31 11:20:00'), 'A', 1, '2012-11-21 12:23:13', 1, '2012-11-21 12:23:13');
    11601161
    11611162-- --------------------------------------------------------
     
    11981199INSERT INTO `group_events` VALUES (10, 1, 8, 'not reviewed', NULL, 'None', 'None', 'A', 0, NOW(), NULL, NULL);
    11991200INSERT INTO `group_events` VALUES (11, 1, 9, 'not reviewed', NULL, 'None', 'None', 'A', 0, NOW(), NULL, NULL);
     1201INSERT INTO `group_events` VALUES (12, 1, 10, 'not reviewed', NULL, 'None', 'None', 'A', 0, NOW(), NULL, NULL);
     1202
    12001203-- --------------------------------------------------------
    12011204
  • app/controllers/components/password_generator.php

    re3cf559 r8f75a27  
    11<?php
    2 /** 
    3  * Low entrophy recovery passwords may be guessed relatively easily by an 
     2/**
     3 * Low entrophy recovery passwords may be guessed relatively easily by an
    44 * attacker, this module attempts to generate more secure recovery passwords.
    55 *
     
    1313  public $name = 'PasswordGenerator';
    1414
    15   /** 
     15  /**
    1616   * Generate a secure password by first generating a random number of $len
    1717   * bytes and then converting the resulting binary string into something
     
    4848  }
    4949
    50   /** 
    51    * Convert a binary string into a printable string. Basically performs a 
     50  /**
     51   * Convert a binary string into a printable string. Basically performs a
    5252   * base64 conversion and then remove the trailing '=' delimiters.
    5353   *
     
    6262  }
    6363
    64   /** 
    65    * Use the OpenSSL PHP extension to generate a secure password. We 
    66    * basically generate a random number of $len bytes and convert the 
     64  /**
     65   * Use the OpenSSL PHP extension to generate a secure password. We
     66   * basically generate a random number of $len bytes and convert the
    6767   * resulting binary string to something user readable.
    6868   *
     
    8686  }
    8787
    88   /** 
    89    * Uses built-in Linux special files to generate a secure password. We 
    90    * basically generate a random number of $len bytes and convert the 
     88  /**
     89   * Uses built-in Linux special files to generate a secure password. We
     90   * basically generate a random number of $len bytes and convert the
    9191   * resulting binary string to something user readable.
    9292   *
     
    101101    // will block in order to collect more entrophy if necessary while
    102102    // /dev/urandom will try to make do with what it has. However, we're using
    103     // urandom since the blocking random call is unpredictable and may take 
     103    // urandom since the blocking random call is unpredictable and may take
    104104    // from minutes to hours for it to get enough randomness.
    105105    $ret = '';
     
    112112  }
    113113
    114   /** 
     114  /**
    115115   * Uses Windows API to generate a secure password. We basically generate
    116116   * a random number of $len bytes and convert the resulting binary string
     
    120120   * http://www.microsoft.com/en-us/download/details.aspx?id=25281
    121121   * Which is no longer supported after Vista. It was replaced with the
    122    * .net x509 crypto lib. 
     122   * .net x509 crypto lib.
    123123   *
    124124   * Helper for generate().
     
    139139        // request base64 return value.  We squeeze out the
    140140        // redundancy and useless ==CRLF by hashing...
    141         if ($pr_bits) { 
    142             $pr_bits = $this->binconvert($pr_bits, true); 
     141        if ($pr_bits) {
     142            $pr_bits = $this->binconvert($pr_bits, true);
    143143        }
    144144      } catch (Exception $ex) {
     
    160160   * @return void
    161161   */
    162   private function defaultAlgorithm($length = 8, $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789') {
    163     return substr(str_shuffle($chars), 0, $length);
    164   } 
     162  private function defaultAlgorithm( $length = 8, $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789' ) {
     163    return substr( str_shuffle( $chars ), 0, $length );
     164  }
    165165}
  • app/controllers/home_controller.php

    re3cf559 r8f75a27  
    188188            else if (empty($event['EvaluationSubmission']) &&
    189189                strtotime('NOW') <
    190                 strtotime($event['Event']['result_release_date_end'])
     190                strtotime($event['Event']['result_release_date_end']) &&
     191                strtotime('NOW') >
     192                strtotime($event['Event']['release_date_end'])
    191193            ) { // student did not do the survey within the allowed time
    192194                // but we should still let them view results
  • app/tests/cases/controllers/courses_controller.test.php

    re3cf559 r8f75a27  
    281281            $this->fixtureIndex[0],
    282282        );
    283         $this->assertEqual($result['paramsForList']['data']['entries'], 
     283        $this->assertEqual($result['paramsForList']['data']['entries'],
    284284            $expected);
    285285    }
     
    355355        $this->assertEqual($result['data']['Course']['title'], $this->fixtureView['Course'][0]['title']);
    356356        $this->assertEqual(count($result['data']['Group']), 2);
    357         $this->assertEqual(count($result['data']['Event']), 9);
     357        $this->assertEqual(count($result['data']['Event']), 10);
    358358        $this->assertEqual($result['title_for_layout'], $this->fixtureView['Course'][0]['course'].' - '.$this->fixtureView['Course'][0]['title']);
    359359    }
     
    585585        $this->assertEqual($message['message'], 'The course was deleted successfully.');
    586586    }
    587    
     587
    588588    /*function testMove()
    589589    {
  • app/tests/cases/controllers/events_controller.test.php

    re3cf559 r8f75a27  
    8585
    8686        $this->assertEqual(count($result["paramsForList"]['data']['entries']),
    87             9);
     87            10);
    8888        $this->assertEqual(sort(Set::extract($result["paramsForList"]['data']['entries'], '/Event/id')), array(1,2,3,6));
    8989        $events = Set::sort($result["paramsForList"]['data']['entries'], '{n}.Event.id', 'asc');
  • app/tests/cases/controllers/home_controller.test.php

    re3cf559 r8f75a27  
    9191        $this->assertEqual(count($activeCourses[0]['Event']), 0);
    9292        $this->assertEqual(count($activeCourses[1]['Instructor']), 1);
    93         $this->assertEqual(count($activeCourses[1]['Event']), 9);
     93        $this->assertEqual(count($activeCourses[1]['Event']), 10);
    9494        $this->assertEqual(count($inactiveCourses[0]['Instructor']), 1);
    9595        $this->assertEqual(count($inactiveCourses[0]['Event']), 0);
     
    109109        $activeCourses = $result['course_list']['A'];
    110110        $this->assertEqual(count($activeCourses[0]['Instructor']), 1);
    111         $this->assertEqual(count($activeCourses[0]['Event']), 9);
     111        $this->assertEqual(count($activeCourses[0]['Event']), 10);
    112112
    113113        // make sure the inactive courses are listed correctly
     
    145145        $activeCourses = $result['course_list']['A'];
    146146        $this->assertEqual(count($activeCourses[1]['Instructor']), 1);
    147         $this->assertEqual(count($activeCourses[1]['Event']), 9);
     147        $this->assertEqual(count($activeCourses[1]['Event']), 10);
    148148    }
    149149
  • app/tests/cases/models/event.test.php

    re3cf559 r8f75a27  
    9292        //Test a valid course number
    9393        $course = $this->Event->getCourseEventCount(1);
    94         $this->assertEqual($course, 9);
     94        $this->assertEqual($course, 10);
    9595
    9696        //Test an invalid course number
     
    283283        $events = $this->Event->getEventsByUserId(5);
    284284        $evaluations = $events['Evaluations'];
    285         $this->assertEqual(count($evaluations), 7);
     285        $this->assertEqual(count($evaluations), 8);
    286286        $surveys = $events['Surveys'];
    287287        $this->assertEqual(count($surveys), 2);
     
    297297        $events = $this->Event->getEventsByUserId(5, array('id', 'title'));
    298298        $evaluations = $events['Evaluations'];
    299         $this->assertEqual(count($evaluations), 7);
     299        $this->assertEqual(count($evaluations), 8);
    300300        $surveys = $events['Surveys'];
    301301        $this->assertEqual(count($surveys), 2);
     
    304304        $events = $this->Event->getEventsByUserId(7);
    305305        $evaluations = $events['Evaluations'];
    306         $this->assertEqual(count($evaluations), 11);
     306        $this->assertEqual(count($evaluations), 12);
    307307        $surveys = $events['Surveys'];
    308308        $this->assertEqual(count($surveys), 2);
  • readme.md

    re3cf559 r8f75a27  
     1iPeer 3.0.7
     2---------------------------
     3This is a maintenance release.
     4* Change mysql NOW() to php date
     5* Add "mail" as default email sending method in scheduled email
     6* Fixed #504
     7
    18iPeer 3.0.6
    29---------------------------
  • version.txt

    re3cf559 r8f75a27  
    1 3.0.6
     13.0.7
Note: See TracChangeset for help on using the changeset viewer.