Changeset 562f7e2 in iPeer


Ignore:
Timestamp:
2013-08-06T14:44:05-07:00 (4 years ago)
Author:
mwytang <michael.tang@…>
Branches:
3.1.x, dev, master
Children:
227b6ba
Parents:
2aa2566
Message:

Fixed reported bug in student index

The bug is events that are not released (release dates are in the
future) are placed in the expired section, when they should not be
displayed at all. The reason behind the bug is events in the above
situation are fulfills one of the filters requirements (no submissions
and date is before result_release_date_end.

To fix this bug I have added an extra condition which is the current
date and time has to also be after release_date_end for the event
to be placed in the expired section.

I have added an extra event to test this bug. The event is set to
be released "next" year on July 31st. Using the existing tests, we
can check that the bug is permanently fixed. The new event should not
appear in the expired array or any other events' arrays.

Location:
app
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • app/config/sql/ipeer_samples_data.sql

    r2aa2566 r562f7e2  
    699699(7, 'simple evaluation 3', 1, '3rd simple evaluation for testing overdue event', 1, 1, '0', 0, '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'),
    700700(8, 'simple evaluation 4', 1, 'result released with submission', 1, 1, '0', 0, '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'),
    701 (9, 'simple evaluation 5', 1, 'result released with no submission', 1, 1, '0', 0, '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');
     701(9, 'simple evaluation 5', 1, 'result released with no submission', 1, 1, '0', 0, '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'),
     702(10, 'simple evaluation 6', 1, 'result released with no submission', 1, 1, '0', 0, 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');
    702703
    703704-- --------------------------------------------------------
     
    740741INSERT INTO `group_events` VALUES (10, 1, 8, 'not reviewed', NULL, 'None', 'None', 'A', 0, '0000-00-00 00:00:00', NULL, NULL);
    741742INSERT INTO `group_events` VALUES (11, 1, 9, 'not reviewed', NULL, 'None', 'None', 'A', 0, '0000-00-00 00:00:00', NULL, NULL);
     743INSERT INTO `group_events` VALUES (12, 1, 10, 'not reviewed', NULL, 'None', 'None', 'A', 0, '0000-00-00 00:00:00', NULL, NULL);
     744
    742745-- --------------------------------------------------------
    743746
  • app/controllers/home_controller.php

    r2aa2566 r562f7e2  
    181181            else if (empty($event['EvaluationSubmission']) &&
    182182                strtotime('NOW') <
    183                 strtotime($event['Event']['result_release_date_end'])
     183                strtotime($event['Event']['result_release_date_end']) &&
     184                strtotime('NOW') >
     185                strtotime($event['Event']['release_date_end'])
    184186            ) { // student did not do the survey within the allowed time
    185187                // but we should still let them view results
  • app/tests/cases/controllers/home_controller.test.php

    r2aa2566 r562f7e2  
    8282        $inactiveCourses = $result['course_list']['I'];
    8383        $this->assertEqual(count($activeCourses[0]['Instructor']), 1);
    84         $this->assertEqual(count($activeCourses[0]['Event']), 9);
     84        $this->assertEqual(count($activeCourses[0]['Event']), 10);
    8585        $this->assertEqual(count($activeCourses[1]['Instructor']), 2);
    8686        $this->assertEqual(count($activeCourses[1]['Event']), 0);
     
    102102        $activeCourses = $result['course_list']['A'];
    103103        $this->assertEqual(count($activeCourses[0]['Instructor']), 1);
    104         $this->assertEqual(count($activeCourses[0]['Event']), 9);
     104        $this->assertEqual(count($activeCourses[0]['Event']), 10);
    105105    }
    106106
Note: See TracChangeset for help on using the changeset viewer.