Changeset 9df04ef0 in iPeer


Ignore:
Timestamp:
2012-12-12T02:01:58-08:00 (6 years ago)
Author:
Compass <pan.luo@…>
Branches:
3.1.x, dev, hotfix, master, pagodabox, ticket463
Children:
aee5515
Parents:
6e59e21
Message:

fixed the view evaluation result ctp files

Location:
app
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • app/controllers/components/evaluation.php

    r6e59e21 r9df04ef0  
    433433     * @return void
    434434     */
    435     function formatSimpleEvaluationResult($event=null)
     435    function formatSimpleEvaluationResult($event)
    436436    {
    437437        $this->User = ClassRegistry::init('User');
     
    445445        // together tables since then we don't get the benefit of the virtual
    446446        // fields provided by the model such as 'full_name' for User
    447         $groupId = $event['group_id'];
     447        $groupId = $event['Group']['id'];
    448448        $selfEval = $event['Event']['self_eval'];
    449         $userid = $this->Auth->user('id');
     449        $userid = User::get('id');
    450450        $groupMemberIds = $this->GroupsMembers->find(
    451451            'list',
     
    479479        $inCompletedMembers = array();
    480480        $allMembersCompleted = true;
    481         if ($event['group_event_id'] && $groupMembersNoTutors) {
     481        if ($event['GroupEvent']['id'] && $groupMembersNoTutors) {
    482482            $pos = 0;
    483483            foreach ($groupMembers as $user) {
    484484                //Check if this memeber submitted evaluation
    485485                $evalSubmission = $this->EvaluationSubmission->getEvalSubmissionByGrpEventIdSubmitter(
    486                     $event['group_event_id'], $user['User']['id']);
     486                    $event['GroupEvent']['id'], $user['User']['id']);
    487487
    488488                if (empty($evalSubmission['EvaluationSubmission'])) {
     
    491491                }
    492492                $evalResult[$user['User']['id']] = $this->EvaluationSimple->getResultsByEvaluator(
    493                     $event['group_event_id'], $user['User']['id']);
     493                    $event['GroupEvent']['id'], $user['User']['id']);
    494494
    495495                //Get total mark each member received
    496496                $receivedTotalScore = $this->EvaluationSimple->getReceivedTotalScore(
    497                     $event['group_event_id'], $user['User']['id']);
     497                    $event['GroupEvent']['id'], $user['User']['id']);
    498498                $memberScoreSummary[$user['User']['id']]['received_total_score'] = $receivedTotalScore[0][0]['received_total_score'];
    499499
     
    501501        }
    502502        $scoreRecords = $this->formatSimpleEvaluationResultsMatrix($groupMembersNoTutors, $evalResult);
    503         $gradeReleaseStatus = $this->EvaluationSimple->getTeamReleaseStatus($event['group_event_id']);
     503        $gradeReleaseStatus = $this->EvaluationSimple->getTeamReleaseStatus($event['GroupEvent']['id']);
    504504        $result['scoreRecords'] = $scoreRecords;
    505505        $result['memberScoreSummary'] = $memberScoreSummary;
     
    687687     * @return void
    688688     */
    689     function getRubricResultDetail ($event, $groupMembers)
     689    function getRubricResultDetail($event, $groupMembers)
    690690    {
    691691        $pos = 0;
     
    702702            return false;
    703703        }
    704         if ($event['group_event_id'] && $groupMembers) {
     704        if ($event['GroupEvent']['id'] && $groupMembers) {
    705705            foreach ($groupMembers as $user) {
    706706                $userPOS = 0;
    707707                if (isset($user['id'])) {
    708708                    $userId = $user['id'];
    709                     $evalSubmission = $this->EvaluationSubmission->getEvalSubmissionByGrpEventIdSubmitter($event['group_event_id'], $userId);
     709                    $evalSubmission = $this->EvaluationSubmission->getEvalSubmissionByGrpEventIdSubmitter($event['GroupEvent']['id'], $userId);
    710710                    // if (isset($evalSubmission['EvaluationSubmission'])) {
    711                     $rubricResult = $this->EvaluationRubric->getResultsByEvaluatee($event['group_event_id'], $userId);
     711                    $rubricResult = $this->EvaluationRubric->getResultsByEvaluatee($event['GroupEvent']['id'], $userId);
    712712                    $evalResult[$userId] = $rubricResult;
    713713                    //Get total mark each member received
    714                     $receivedTotalScore = $this->EvaluationRubric->getReceivedTotalScore($event['group_event_id'], $userId);
    715                     $ttlEvaluatorCount = $this->EvaluationRubric->getReceivedTotalEvaluatorCount($event['group_event_id'], $userId);
     714                    $receivedTotalScore = $this->EvaluationRubric->getReceivedTotalScore($event['GroupEvent']['id'], $userId);
     715                    $ttlEvaluatorCount = $this->EvaluationRubric->getReceivedTotalEvaluatorCount($event['GroupEvent']['id'], $userId);
    716716                    if ($ttlEvaluatorCount >0) {
    717717                        $memberScoreSummary[$userId]['received_total_score'] =
     
    737737                    //$userId = isset($user['User'])? $user['User']['id'] : $user['id'];
    738738                    //Check if this memeber submitted evaluation
    739                     $evalSubmission = $this->EvaluationSubmission->getEvalSubmissionByGrpEventIdSubmitter($event['group_event_id'], $userId);
     739                    $evalSubmission = $this->EvaluationSubmission->getEvalSubmissionByGrpEventIdSubmitter($event['GroupEvent']['id'], $userId);
    740740                    if (isset($evalSubmission['EvaluationSubmission'])) {
    741741                    } else {
     
    743743                        $inCompletedMembers[$pos++]=$user;
    744744                    }
    745                     $rubricResult = $this->EvaluationRubric->getResultsByEvaluatee($event['group_event_id'], $userId);
     745                    $rubricResult = $this->EvaluationRubric->getResultsByEvaluatee($event['GroupEvent']['id'], $userId);
    746746                    $evalResult[$userId] = $rubricResult;
    747747
    748748                    //Get total mark each member received
    749                     $receivedTotalScore = $this->EvaluationRubric->getReceivedTotalScore($event['group_event_id'], $userId);
    750                     $ttlEvaluatorCount = $this->EvaluationRubric->getReceivedTotalEvaluatorCount($event['group_event_id'], $userId);
     749                    $receivedTotalScore = $this->EvaluationRubric->getReceivedTotalScore($event['GroupEvent']['id'], $userId);
     750                    $ttlEvaluatorCount = $this->EvaluationRubric->getReceivedTotalEvaluatorCount($event['GroupEvent']['id'], $userId);
    751751                    $memberScoreSummary[$userId]['received_total_score'] = $receivedTotalScore[0][0]['received_total_score'];
    752752                    if ($ttlEvaluatorCount == 0) {
     
    978978     * @param string $displayFormat display format
    979979     * @param int    $studentView   student view
    980      * @param bool   $currentUser   current user
    981      *
    982      * @access public
    983      * @return void
    984      */
    985     function formatRubricEvaluationResult($event=null, $displayFormat='', $studentView=0, $currentUser=null)
     980     * @param bool   $userId        current user id
     981     *
     982     * @access public
     983     * @return void
     984     */
     985    function formatRubricEvaluationResult($event, $displayFormat='', $studentView=0, $userId=null)
    986986    {
    987987        $this->Rubric =  ClassRegistry::init('Rubric');
     
    10101010            $rubricResultDetail = $this->getRubricResultDetail($event, $user);
    10111011            $groupMembers = $this->GroupsMembers->getEventGroupMembers(
    1012                 $event['group_id'], $event['Event']['self_eval'], $currentUser['id']);
     1012                $event['Group']['id'], $event['Event']['self_eval'], $userId);
    10131013            $groupMembersNoTutors = $this->GroupsMembers->getEventGroupMembersNoTutors(
    1014                 $event['group_id'], $event['Event']['self_eval'], $currentUser['id']);
     1014                $event['Group']['id'], $event['Event']['self_eval'], $userId);
    10151015            $rubricResultDetail = $this->getRubricResultDetail($event, $user);
    10161016            $membersAry = array();
     
    10251025            $result['groupMembersNoTutors'] = $membersAryNoTutors;
    10261026
    1027             $reviewEvaluations = $this->getStudentViewRubricResultDetailReview($event, $currentUser['id']);
     1027            $reviewEvaluations = $this->getStudentViewRubricResultDetailReview($event, $userId);
    10281028            $result['reviewEvaluations'] = $reviewEvaluations;
    10291029
     
    10631063            $result['penalty'] = $scorePenalty['Penalty']['percent_penalty'];
    10641064        } else {
    1065             $groupMembers = $this->GroupsMembers->getEventGroupMembers($event['group_id'], $event['Event']['self_eval'], $currentUser['id']);
    1066             $groupMembersNoTutors = $this->GroupsMembers->getEventGroupMembersNoTutors($event['group_id'], $event['Event']['self_eval'], $currentUser['id']);
     1065            $groupMembers = $this->GroupsMembers->getEventGroupMembers($event['Group']['id'], $event['Event']['self_eval'], $userId);
     1066            $groupMembersNoTutors = $this->GroupsMembers->getEventGroupMembersNoTutors($event['Group']['id'], $event['Event']['self_eval'], $userId);
    10671067            $rubricResultDetail = $this->getRubricResultDetail($event, $groupMembers);
    10681068            $result['groupMembers'] = $groupMembers;
     
    10751075            $result['rubricCriteria'] = $rubricCriteria;
    10761076        }
    1077         $gradeReleaseStatus = $this->EvaluationRubric->getTeamReleaseStatus($event['group_event_id']);
     1077        $gradeReleaseStatus = $this->EvaluationRubric->getTeamReleaseStatus($event['GroupEvent']['id']);
    10781078        $result['allMembersCompleted'] = $rubricResultDetail['allMembersCompleted'];
    10791079        $result['inCompletedMembers'] = $rubricResultDetail['inCompletedMembers'];
     
    12671267        $evalResult = array();
    12681268
    1269         if ($event['group_event_id'] && $groupMembers) {
     1269        if ($event['GroupEvent']['id'] && $groupMembers) {
    12701270            foreach ($groupMembers as $user) {
    12711271                $userPOS = 0;
     
    12731273                    $userId = $user['id'];
    12741274                    $evalSubmission = $this->EvaluationSubmission->getEvalSubmissionByGrpEventIdSubmitter(
    1275                         $event['group_event_id'], $userId);
     1275                        $event['GroupEvent']['id'], $userId);
    12761276                    // if (isset($evalSubmission['EvaluationSubmission'])) {
    1277                     $mixevalResult = $this->EvaluationMixeval->getResultsByEvaluatee($event['group_event_id'], $userId);
     1277                    $mixevalResult = $this->EvaluationMixeval->getResultsByEvaluatee($event['GroupEvent']['id'], $userId);
    12781278                    $evalResult[$userId] = $mixevalResult;
    12791279
    12801280                    //Get total mark each member received
    12811281                    $receivedTotalScore = $this->EvaluationMixeval->getReceivedTotalScore(
    1282                         $event['group_event_id'], $userId);
    1283                     $ttlEvaluatorCount = $this->EvaluationMixeval->getReceivedTotalEvaluatorCount($event['group_event_id'], $userId);
     1282                        $event['GroupEvent']['id'], $userId);
     1283                    $ttlEvaluatorCount = $this->EvaluationMixeval->getReceivedTotalEvaluatorCount($event['GroupEvent']['id'], $userId);
    12841284                    if ($ttlEvaluatorCount > 0) {
    12851285                        $memberScoreSummary[$userId]['received_total_score'] = $receivedTotalScore[0]['received_total_score'];
     
    13021302                    //Check if this memeber submitted evaluation
    13031303                    $evalSubmission = $this->EvaluationSubmission->getEvalSubmissionByGrpEventIdSubmitter(
    1304                         $event['group_event_id'], $userId);
     1304                        $event['GroupEvent']['id'], $userId);
    13051305
    13061306                    // if (isset($evalSubmission['EvaluationSubmission'])) {
    1307                     $mixevalResult = $this->EvaluationMixeval->getResultsByEvaluatee($event['group_event_id'], $userId);
     1307                    $mixevalResult = $this->EvaluationMixeval->getResultsByEvaluatee($event['GroupEvent']['id'], $userId);
    13081308                    $evalResult[$userId] = $mixevalResult;
    13091309
    13101310                    //Get total mark each member received
    13111311                    $receivedTotalScore = $this->EvaluationMixeval->getReceivedTotalScore(
    1312                         $event['group_event_id'], $userId);
     1312                        $event['GroupEvent']['id'], $userId);
    13131313                    $ttlEvaluatorCount = $this->EvaluationMixeval->getReceivedTotalEvaluatorCount(
    1314                         $event['group_event_id'], $userId);
     1314                        $event['GroupEvent']['id'], $userId);
    13151315                    if ($ttlEvaluatorCount > 0) {
    13161316                        $memberScoreSummary[$userId]['received_count'] = $ttlEvaluatorCount;
     
    15551555     * @return void
    15561556     */
    1557     function formatMixevalEvaluationResult($event=null, $displayFormat='', $studentView=0)
     1557    function formatMixevalEvaluationResult($event, $displayFormat='', $studentView=0)
    15581558    {
    15591559        $this->Course = ClassRegistry::init('Mixeval');
     
    15871587            $mixevalResultDetail = $this->getMixevalResultDetail($event, $user);
    15881588            $groupMembers = $this->GroupsMembers->getEventGroupMembers(
    1589                 $event['group_id'], $event['Event']['self_eval'], $currentUser['id']);
     1589                $event['Group']['id'], $event['Event']['self_eval'], $currentUser['id']);
    15901590            $groupMembersNoTutors = $this->GroupsMembers->getEventGroupMembersNoTutors(
    1591                 $event['group_id'], $event['Event']['self_eval'], $currentUser['id']);
     1591                $event['Group']['id'], $event['Event']['self_eval'], $currentUser['id']);
    15921592            $membersAry = array();
    15931593            $membersAryNoTutors = array();
     
    16411641        } else {
    16421642            $groupMembers = $this->GroupsMembers->getEventGroupMembers(
    1643                 $event['group_id'], $event['Event']['self_eval'], $this->Auth->user('id'));
     1643                $event['Group']['id'], $event['Event']['self_eval'], $this->Auth->user('id'));
    16441644            $groupMembersNoTutors = $this->GroupsMembers->getEventGroupMembersNoTutors(
    1645                 $event['group_id'], $event['Event']['self_eval'], $this->Auth->user('id'));
     1645                $event['Group']['id'], $event['Event']['self_eval'], $this->Auth->user('id'));
    16461646            $mixevalResultDetail = $this->getMixevalResultDetail($event, $groupMembers);
    16471647            $result['groupMembers'] = $groupMembers;
     
    16601660            //$result['mixevalQuestion'] = $mixevalQuestion;
    16611661        }
    1662         $gradeReleaseStatus = $this->EvaluationMixeval->getTeamReleaseStatus($event['group_event_id']);
     1662        $gradeReleaseStatus = $this->EvaluationMixeval->getTeamReleaseStatus($event['GroupEvent']['id']);
    16631663
    16641664        $result['allMembersCompleted'] = $mixevalResultDetail['allMembersCompleted'];
  • app/controllers/evaluations_controller.php

    r6e59e21 r9df04ef0  
    160160    function ajaxList()
    161161    {
    162         // Make sure the present user has permission
    163         if (!User::hasPermission('controllers/evaluations')) {
    164             $this->Session->setFlash(__('You do not have permission to view evaluations', true));
    165             $this->redirect('/home');
    166         }
    167162        // Set up the list
    168163        $eventId = $this->Session->read("evaluationsControllerEventIdSession");
     
    178173     * @param <type> $eventId Event Id
    179174     */
    180     function view($eventId='')
     175    function view($eventId = null)
    181176    {
    182177        // Record the event id into the session
     
    188183        }
    189184
    190         $data = $this->Event->find('first', array(
    191             'conditions' => array(
    192                 'Event.id' => $eventId,
    193                 'Event.event_template_type_id !=' => '3'
    194             )
    195         ));
    196 
    197         // event does not exist or is a survey
    198         if (null == $data) {
    199             $this->Session->setFlash(__('Error: Invalid Id', true));
    200             $this->redirect('index');
    201         }
    202 
    203         $this->set('data', $data);
    204 
    205         $courseId = $this->Event->getCourseByEventId($eventId);
    206 
    207         $course = $this->Course->getAccessibleCourseById($courseId, User::get('id'), User::getCourseFilterPermission());
    208         if (!$course) {
    209             $this->Session->setFlash(__('Error: Course does not exist or you do not have permission to view this course.', true));
     185        if (!($event = $this->Event->getAccessibleEventById($eventId,
     186            User::get('id'), User::getCourseFilterPermission(), array('Course')))) {
     187
     188            $this->Session->setFlash(__('Error: Invalid id or you do not have permission to access this event.', true));
    210189            $this->redirect('index');
    211190        }
     
    214193        $this->setUpAjaxList($eventId);
    215194
    216         //Set up the course Id
    217         $this->set('courseId', $courseId);
    218         $this->set('eventId', $eventId);
    219 
    220195        // Set the display list
    221196        $this->set('paramsForList', $this->AjaxList->getParamsForList());
     197
     198        $this->set('data', $event);
     199        $this->set('breadcrumb', $this->breadcrumb->push(array('course' => $event['Course']))
     200            ->push(array('event' => $event['Event']))
     201            ->push(__('Results', true)));
    222202    }
    223203
     
    233213        $this->redirect('/events/index');
    234214    }
    235 
    236 
    237     /**
    238      * update
    239      *
    240      * @param string $attributeCode  attribute code
    241      * @param string $attributeValue attribute value
    242      *
    243      * @access public
    244      * @return void
    245      */
    246     function update($attributeCode='', $attributeValue='')
    247     {
    248         if ($attributeCode != '' && $attributeValue != '') {
    249             //check for empty params
    250             $this->params['data'] = $this->Personalize->updateAttribute($this->Auth->user('id'), $attributeCode, $attributeValue);
    251         }
    252     }
    253 
    254     /**
    255      * test
    256      *
    257      * @param mixed $groupEventId group event id
    258      * @param mixed $userId       user id
    259      *
    260      * @access public
    261      * @return void
    262      */
    263     /*function test($groupEventId, $userId)
    264     {
    265         $subScore = $this->EvaluationMixeval->getResultsDetailByEvaluatee($groupEventId, $userId);
    266         exit;
    267     }*/
    268215
    269216    /**
     
    1006953    function viewEvaluationResults($eventId, $groupId = null, $displayFormat="")
    1007954    {
    1008         // Make sure the present user has permission
    1009         if (!User::hasPermission('controllers/evaluations/viewevaluationresults')) {
    1010             $this->Session->setFlash('Error: You do not have permission to view evaluation results', true);
    1011             $this->redirect('/home');
    1012         }
    1013 
    1014         if (!is_numeric($eventId) || !is_numeric($groupId)) {
    1015             $this->Session->setFlash('Invalid Id', true);
    1016             $this->redirect('index');
    1017         }
    1018 
    1019         $courseId = $this->Event->getCourseByEventId($eventId);
    1020 
    1021         $courses = $this->Course->getAccessibleCourses(User::get('id'), User::getCourseFilterPermission(), 'list');
    1022 
    1023         if (!in_array($courseId, array_keys($courses))) {
    1024             $this->Session->setFlash(__('Error: You do not have permission to view evaluation results from this event', true));
    1025             $this->redirect('index');
     955        // check to see if the ids are numeric
     956        if (!is_numeric($eventId) ||
     957            !($event = $this->Event->getAccessibleEventById(
     958                $eventId,
     959                User::get('id'), User::getCourseFilterPermission(), array('Course')))) {
     960
     961            $this->Session->setFlash(__('Error: Invalid id or you do not have permission to access this event.', true));
     962            $this->redirect('/home/index');
     963        }
     964
     965        if ('3' != $event['Event']['event_template_type_id']) {
     966            // not survey, we need group
     967            if (!is_numeric($groupId) ||
     968                !($group = $this->Group->getGroupByGroupIdEventId($groupId, $eventId))) {
     969
     970                    $this->Session->setFlash(__('Error: Invalid group id.', true));
     971                    $this->redirect('/home/index');
     972                }
     973            $event = array_merge($event, $group);
    1026974        }
    1027975
    1028976        $this->autoRender = false;
    1029977
    1030         $templateTypeId = $this->Event->getEventTemplateTypeId($eventId);
    1031         //$grpEvent = $this->GroupEvent->getGroupEventByEventIdGroupId($eventId, $groupId);  //unused
    1032         $courseId = $this->Event->getCourseByEventId($eventId);
    1033         $event = ($templateTypeId == '3' ? $this->Event->getEventByIdGroupId($eventId):
    1034             $this->Event->getEventByIdGroupId($eventId, $groupId));
    1035 
    1036978        $this->set('event', $event);
    1037         $this->set('title_for_layout', !empty($event['Event']) ? $this->Course->getCourseName($courseId).' > '.$event['Event']['title']. __(' > Results ', true):'');
     979        $this->set('breadcrumb', $this->breadcrumb->push(array('course' => $event['Course']))
     980            ->push(array('event' => $event['Event']))
     981            ->push(__('Results', true)));
    1038982
    1039983
     
    10721016                $this->set('rubricCriteria', $formattedResult['rubric']['RubricsCriteria']);
    10731017            }
    1074             $this->set('courseId', $courseId);
    10751018            $this->set('allMembersCompleted', $formattedResult['allMembersCompleted']);
    10761019            $this->set('inCompletedMembers', $formattedResult['inCompletedMembers']);
     
    11421085            }
    11431086            break;
    1144 
    11451087        }
    11461088    }
     
    12461188
    12471189        case 2: //View Rubric Evaluation Result
    1248             $formattedResult = $this->Evaluation->formatRubricEvaluationResult($event, 'Detail', 1, $currentUser);
     1190            $formattedResult = $this->Evaluation->formatRubricEvaluationResult($event, 'Detail', 1, User::get('id'));
    12491191            $this->set('rubric', $formattedResult['rubric']);
    12501192            if (isset($formattedResult['groupMembers'])) {
  • app/models/evaluation_base.php

    r6e59e21 r9df04ef0  
    150150        $this->Penalty = ClassRegistry::init('Penalty');
    151151        $this->EvaluationSubmission = ClassRegistry::init('EvaluationSubmission');
    152         $userPenalty = array();
     152        $memberIds = Set::extract($groupMembers, '/User/id');
     153        $userPenalty = array_fill_keys($memberIds, 0);
     154
     155        // find the event
    153156        $event = $this->Event->find(
    154157            'first',
     
    161164        // not due yet. no penalty
    162165        if ($event['Event']['due_in'] >= 0) {
    163             return array();
     166            return $userPenalty;
    164167        }
    165168
    166169        // storing the timestamp of the due date of the event
    167170        $event_due = strtotime($event['Event']['due_date']);
    168         $memberIds = Set::extract($groupMembers, '/User/id');
    169         $userPenalty = array_fill_keys($memberIds, 0);
    170171        // assign penalty to groupMember if they submitted late or never submitted by release_date_end
    171172        $submissions = $this->EvaluationSubmission->find('all', array(
  • app/models/group.php

    r6e59e21 r9df04ef0  
    381381    }
    382382
     383    function getGroupByGroupIdEventId($groupId, $eventId)
     384    {
     385        return $this->getGroupByGroupIdEventIdMemberId($groupId, $eventId, null);
     386    }
     387
    383388    function getGroupByGroupIdEventIdMemberId($groupId, $eventId, $memberId)
    384389    {
     390        $conditions = array(
     391            $this->alias.'.id' => $groupId,
     392            'GroupEvent.event_id' => $eventId,
     393        );
     394        if ($memberId != null) {
     395            $conditions['Member.id'] = $memberId;
     396        }
    385397        $group = $this->find('first', array(
    386398            'fields' => array('Group.*'),
    387             'conditions' => array(
    388                 $this->alias.'.id' => $groupId,
    389                 'GroupEvent.event_id' => $eventId,
    390                 'Member.id' => $memberId,
    391             ),
     399            'conditions' => $conditions,
    392400        ));
    393401
  • app/tests/cases/models/group.test.php

    r6e59e21 r9df04ef0  
    169169    }
    170170
    171     function testGetGroupByGroupIdMemberId()
     171    function testGetGroupByGroupIdEventId()
     172    {
     173        // group is attached to event
     174        $group = $this->Group->getGroupByGroupIdEventId(1, 1);
     175        $this->assertFalse(empty($group));
     176        $this->assertEqual($group['Group']['id'], 1);
     177
     178        // group is not attached to event
     179        $group = $this->Group->getGroupByGroupIdEventId(2, 8);
     180        $this->assertFalse($group);
     181
     182    }
     183
     184    function testGetGroupByGroupIdEventIdMemberId()
    172185    {
    173186        // student within group, and group is attached to event
  • app/views/elements/evaluations/view_event_info.ctp

    r6e59e21 r9df04ef0  
    33  <tr>
    44    <td width="15%"><?php __('Group')?>:</td>
    5     <td width="35%"><?php echo $event['group_name'] ?></td>
     5    <td width="35%"><?php echo $event['Group']['group_name'] ?></td>
    66    <td width="15%"><?php __('Self-Evaluation')?>:</td>
    77    <td><?php echo ($event['Event']['self_eval']) ? 'Yes' : 'No'?></td>
  • app/views/evaluations/view_mixeval_evaluation_results.ctp

    r6e59e21 r9df04ef0  
    2929
    3030<div class="event-summary">
    31     <span class="instruction-icon"><?php __('Summary:')?> ( <?php echo $this->Html->link(__('Basic', true), "/evaluations/viewEvaluationResults/".$event['Event']['id']."/".$event['group_id']."/Basic")?> |
    32     <?php echo $html->link(__('Detail', true), "/evaluations/viewEvaluationResults/".$event['Event']['id']."/".$event['group_id']."/Detail")?> )</span>
     31    <span class="instruction-icon"><?php __('Summary:')?> ( <?php echo $this->Html->link(__('Basic', true), "/evaluations/viewEvaluationResults/".$event['Event']['id']."/".$event['Group']['id']."/Basic")?> |
     32    <?php echo $html->link(__('Detail', true), "/evaluations/viewEvaluationResults/".$event['Event']['id']."/".$event['Group']['id']."/Detail")?> )</span>
    3333    <font size = "1" face = "arial" color = "red" >*Numerics in red denotes late submission penalty.</font>
    3434        <?php if (!$allMembersCompleted): ?>
     
    6262      <form name="evalForm" id="evalForm" method="POST" action="<?php echo $html->url('markEventReviewed') ?>">
    6363              <input type="hidden" name="event_id" value="<?php echo $event['Event']['id']?>" />
    64               <input type="hidden" name="group_id" value="<?php echo $event['group_id']?>" />
     64              <input type="hidden" name="group_id" value="<?php echo $event['Group']['id']?>" />
    6565              <input type="hidden" name="course_id" value="<?php echo $event['Event']['course_id']?>" />
    66               <input type="hidden" name="group_event_id" value="<?php echo $event['group_event_id']?>" />
     66              <input type="hidden" name="group_event_id" value="<?php echo $event['GroupEvent']['id']?>" />
    6767              <input type="hidden" name="display_format" value="Basic" />
    6868
  • app/views/evaluations/view_mixeval_evaluation_results_detail.ctp

    r6e59e21 r9df04ef0  
    2121
    2222<div class="event-summary">
    23     <span class="instruction-icon"><?php __('Summary:')?> ( <?php echo $this->Html->link(__('Basic', true), "/evaluations/viewEvaluationResults/".$event['Event']['id']."/".$event['group_id']."/Basic")?> |
    24     <?php echo $html->link(__('Detail', true), "/evaluations/viewEvaluationResults/".$event['Event']['id']."/".$event['group_id']."/Detail")?> )</span>
     23    <span class="instruction-icon"><?php __('Summary:')?> ( <?php echo $this->Html->link(__('Basic', true), "/evaluations/viewEvaluationResults/".$event['Event']['id']."/".$event['Group']['id']."/Basic")?> |
     24    <?php echo $html->link(__('Detail', true), "/evaluations/viewEvaluationResults/".$event['Event']['id']."/".$event['Group']['id']."/Detail")?> )</span>
    2525    <font size = "1" face = "arial" color = "red" >*Numerics in red denotes late submission penalty.</font>
    2626    <?php if (!$allMembersCompleted): ?>
     
    153153        <form name="evalForm" id="evalForm" method="POST" action="<?php echo $html->url('markEventReviewed') ?>">
    154154            <input type="hidden" name="event_id" value="<?php echo $event['Event']['id']?>" />
    155             <input type="hidden" name="group_id" value="<?php echo $event['group_id']?>" />
     155            <input type="hidden" name="group_id" value="<?php echo $event['Group']['id']?>" />
    156156            <input type="hidden" name="course_id" value="<?php echo $event['Event']['course_id']?>" />
    157             <input type="hidden" name="group_event_id" value="<?php echo $event['group_event_id']?>" />
     157            <input type="hidden" name="group_event_id" value="<?php echo $event['GroupEvent']['id']?>" />
    158158            <input type="hidden" name="display_format" value="Detail" />
    159159        <?php
    160             if ($event['group_event_marked'] == "reviewed") {
     160            if ($event['GroupEvent']['marked'] == "reviewed") {
    161161                echo "<input class=\"reviewed\" type=\"submit\" name=\"mark_not_reviewed\" value=\" ".__('Mark Peer Evaluations as Not Reviewed', true)."\" />";
    162162            } else {
     
    335335            //Grade Released
    336336            if (isset($scoreRecords[$user['id']]['grade_released']) && $scoreRecords[$user['id']]['grade_released']) {?>
    337                 <input type="button" name="UnreleaseGrades" value="<?php __('Unrelease Grades')?>" onClick="location.href='<?php echo $this->webroot.$this->theme.'evaluations/markGradeRelease/'.$event['Event']['id'].';'.$event['group_id'].';'.$user['id'].';'.$event['group_event_id'].';0'; ?>'">
     337                <input type="button" name="UnreleaseGrades" value="<?php __('Unrelease Grades')?>" onClick="location.href='<?php echo $this->webroot.$this->theme.'evaluations/markGradeRelease/'.$event['Event']['id'].';'.$event['Group']['id'].';'.$user['id'].';'.$event['GroupEvent']['id'].';0'; ?>'">
    338338            <?php } else {?>
    339                 <input type="button" name="ReleaseGrades" value="<?php __('Release Grades')?>" onClick="location.href='<?php echo $this->webroot.$this->theme.'evaluations/markGradeRelease/'.$event['Event']['id'].';'.$event['group_id'].';'.$user['id'].';'.$event['group_event_id'].';1'; ?>'">
     339                <input type="button" name="ReleaseGrades" value="<?php __('Release Grades')?>" onClick="location.href='<?php echo $this->webroot.$this->theme.'evaluations/markGradeRelease/'.$event['Event']['id'].';'.$event['Group']['id'].';'.$user['id'].';'.$event['GroupEvent']['id'].';1'; ?>'">
    340340            <?php }
    341341
    342342            //Comment Released
    343343            if (isset($scoreRecords[$user['id']]['comment_released']) && $scoreRecords[$user['id']]['comment_released']) {?>
    344                 <input type="button" name="UnreleaseComments" value="<?php __('Unrelease Comments')?>" onClick="location.href='<?php echo $this->webroot.$this->theme.'evaluations/markCommentRelease/'.$event['Event']['id'].';'.$event['group_id'].';'.$user['id'].';'.$event['group_event_id'].';0'; ?>'">
     344                <input type="button" name="UnreleaseComments" value="<?php __('Unrelease Comments')?>" onClick="location.href='<?php echo $this->webroot.$this->theme.'evaluations/markCommentRelease/'.$event['Event']['id'].';'.$event['Group']['id'].';'.$user['id'].';'.$event['GroupEvent']['id'].';0'; ?>'">
    345345            <?php } else {?>
    346                 <input type="button" name="ReleaseComments" value="<?php __('Release Comments')?>" onClick="location.href='<?php echo $this->webroot.$this->theme.'evaluations/markCommentRelease/'.$event['Event']['id'].';'.$event['group_id'].';'.$user['id'].';'.$event['group_event_id'].';1'; ?>'">
     346                <input type="button" name="ReleaseComments" value="<?php __('Release Comments')?>" onClick="location.href='<?php echo $this->webroot.$this->theme.'evaluations/markCommentRelease/'.$event['Event']['id'].';'.$event['Group']['id'].';'.$user['id'].';'.$event['GroupEvent']['id'].';1'; ?>'">
    347347            <?php } ?>
    348348        </div>
  • app/views/evaluations/view_rubric_evaluation_results.ctp

    r6e59e21 r9df04ef0  
    1010<tr>
    1111    <td><?php echo $event['Event']['title'] ?></td>
    12     <td><?php echo $event['group_name'] ?></td>
     12    <td><?php echo $event['Group']['group_name'] ?></td>
    1313    <td><?php echo Toolkit::formatDate(date("Y-m-d H:i:s", strtotime($event['Event']['due_date']))) ?></td>
    1414    <td><?php echo ($event['Event']['self_eval']) ? 'Yes' : 'No'?></td>
     
    2727
    2828<h3><?php __('Summary')?>
    29  :(<?php echo $this->Html->link(__('Basic', true), "/evaluations/viewEvaluationResults/".$event['Event']['id']."/".$event['group_id']."/Basic")?> |
    30     <?php echo $html->link(__('Detail', true), "/evaluations/viewEvaluationResults/".$event['Event']['id']."/".$event['group_id']."/Detail")?> )</h3>
    31    
     29 :(<?php echo $this->Html->link(__('Basic', true), "/evaluations/viewEvaluationResults/".$event['Event']['id']."/".$event['Group']['id']."/Basic")?> |
     30    <?php echo $html->link(__('Detail', true), "/evaluations/viewEvaluationResults/".$event['Event']['id']."/".$event['Group']['id']."/Detail")?> )</h3>
     31
    3232<!-- Users who haven't done the evaluation yet table -->
    3333<table class="standardtable">
     
    4949<!-- Show Evaluation Reuslts - Basic -->
    5050 <h3><?php __('Evaluation Results')?></h3>
    51  
    52 <table class='standardtable'> 
     51
     52<table class='standardtable'>
    5353   <th><?php __('Student Name')?></th>
    54    <th><?php __('Total') ?> 
     54   <th><?php __('Total') ?>
    5555       : (/<?php echo number_format($rubric['Rubric']['total_marks'], 2); ?>)</th>
    56    
     56
    5757<?php
    5858$aveScoreSum = 0;
     
    8888    <?php echo number_format($aveScoreSum / count($groupMembersNoTutors), 2); ?>
    8989    </b></td>
    90    
    91    
     90
     91
    9292    <?php if ($allMembersCompleted) :?>
    9393    <tr class="tablecell2" align="center">
    9494      <form name="evalForm" id="evalForm" method="POST" action="<?php echo $html->url('markEventReviewed') ?>">
    9595              <input type="hidden" name="event_id" value="<?php echo $event['Event']['id']?>" />
    96               <input type="hidden" name="group_id" value="<?php echo $event['group_id']?>" />
    97               <input type="hidden" name="course_id" value="<?php echo $courseId; ?>" />
    98               <input type="hidden" name="group_event_id" value="<?php echo $event['group_event_id']?>" />
     96              <input type="hidden" name="group_id" value="<?php echo $event['Group']['id']?>" />
     97              <input type="hidden" name="course_id" value="<?php echo $event['Event']['course_id']; ?>" />
     98              <input type="hidden" name="group_event_id" value="<?php echo $event['GroupEvent']['id']?>" />
    9999              <input type="hidden" name="display_format" value="<?php __('Basic')?>" />
    100100
    101               <td colspan="<?php echo count($groupMembers) + 1; ?>">     
     101              <td colspan="<?php echo count($groupMembers) + 1; ?>">
    102102           <?php  if ($event['group_event_marked'] == "reviewed"): ?>
    103103                 <input class="reviewed" type="submit" name="mark_not_reviewed" value="<?php __('Mark Peer Evaluations as Not Reviewed')?>" />
     
    107107            </form>
    108108  </tr>
    109   <?php endif; endif; ?>         
     109  <?php endif; endif; ?>
    110110</table>
    111111
  • app/views/evaluations/view_rubric_evaluation_results_detail.ctp

    r6e59e21 r9df04ef0  
    1010
    1111<div class="event-summary">
    12     <span class="instruction-icon"><?php __('Summary:')?> ( <?php echo $this->Html->link(__('Basic', true), "/evaluations/viewEvaluationResults/".$event['Event']['id']."/".$event['group_id']."/Basic")?> |
    13     <?php echo $html->link(__('Detail', true), "/evaluations/viewEvaluationResults/".$event['Event']['id']."/".$event['group_id']."/Detail")?> )</span>
     12    <span class="instruction-icon"><?php __('Summary:')?> ( <?php echo $this->Html->link(__('Basic', true), "/evaluations/viewEvaluationResults/".$event['Event']['id']."/".$event['Group']['id']."/Basic")?> |
     13    <?php echo $html->link(__('Detail', true), "/evaluations/viewEvaluationResults/".$event['Event']['id']."/".$event['Group']['id']."/Detail")?> )</span>
    1414    <font size = "1" face = "arial" color = "red" >*Numerics in red denotes late submission penalty.</font>
    1515    <?php if (!$allMembersCompleted): ?>
     
    145145        <form name="evalForm" id="evalForm" method="POST" action="<?php echo $html->url('markEventReviewed') ?>">
    146146            <input type="hidden" name="event_id" value="<?php echo $event['Event']['id']?>" />
    147             <input type="hidden" name="group_id" value="<?php echo $event['group_id']?>" />
    148             <input type="hidden" name="course_id" value="<?php echo $courseId; ?>" />
    149             <input type="hidden" name="group_event_id" value="<?php echo $event['group_event_id']?>" />
     147            <input type="hidden" name="group_id" value="<?php echo $event['Group']['id']?>" />
     148            <input type="hidden" name="course_id" value="<?php echo $event['Event']['course_id']; ?>" />
     149            <input type="hidden" name="group_event_id" value="<?php echo $event['GroupEvent']['id']?>" />
    150150            <input type="hidden" name="display_format" value="Detail" />
    151151
    152152        <?php
    153             if ($event['group_event_marked'] == "reviewed") {
     153            if ($event['GroupEvent']['marked'] == "reviewed") {
    154154                echo "<input class=\"reviewed\" type=\"submit\" name=\"mark_not_reviewed\" value=\" ".__('Mark Peer Evaluations as Not Reviewed', true)."\" />";
    155155            } else {
     
    287287        if (isset($scoreRecords[$user['id']]['grade_released']) && $scoreRecords[$user['id']]['grade_released']) {?>
    288288
    289             <input type="button" name="UnreleaseGrades" value="<?php __('Unrelease Grades')?>" onClick="location.href='<?php echo $this->webroot.$this->theme.'evaluations/markGradeRelease/'.$event['Event']['id'].';'.$event['group_id'].';'.$user['id'].';'.$event['group_event_id'].';0'; ?>'">
     289            <input type="button" name="UnreleaseGrades" value="<?php __('Unrelease Grades')?>" onClick="location.href='<?php echo $this->webroot.$this->theme.'evaluations/markGradeRelease/'.$event['Event']['id'].';'.$event['Group']['id'].';'.$user['id'].';'.$event['GroupEvent']['id'].';0'; ?>'">
    290290        <?php } else {?>
    291             <input type="button" name="ReleaseGrades" value="<?php __('Release Grades')?>" onClick="location.href='<?php echo $this->webroot.$this->theme.'evaluations/markGradeRelease/'.$event['Event']['id'].';'.$event['group_id'].';'.$user['id'].';'.$event['group_event_id'].';1'; ?>'">
     291            <input type="button" name="ReleaseGrades" value="<?php __('Release Grades')?>" onClick="location.href='<?php echo $this->webroot.$this->theme.'evaluations/markGradeRelease/'.$event['Event']['id'].';'.$event['Group']['id'].';'.$user['id'].';'.$event['GroupEvent']['id'].';1'; ?>'">
    292292        <?php }
    293293
    294294        //Comment Released
    295295        if (isset($scoreRecords[$user['id']]['comment_released']) && $scoreRecords[$user['id']]['comment_released']) {?>
    296             <input type="button" name="UnreleaseComments" value="<?php __('Unrelease Comments')?>" onClick="location.href='<?php echo $this->webroot.$this->theme.'evaluations/markCommentRelease/'.$event['Event']['id'].';'.$event['group_id'].';'.$user['id'].';'.$event['group_event_id'].';0'; ?>'">
     296            <input type="button" name="UnreleaseComments" value="<?php __('Unrelease Comments')?>" onClick="location.href='<?php echo $this->webroot.$this->theme.'evaluations/markCommentRelease/'.$event['Event']['id'].';'.$event['Group']['id'].';'.$user['id'].';'.$event['GroupEvent']['id'].';0'; ?>'">
    297297        <?php } else { ?>
    298             <input type="button" name="ReleaseComments" value="<?php __('Release Comments')?>" onClick="location.href='<?php echo $this->webroot.$this->theme.'evaluations/markCommentRelease/'.$event['Event']['id'].';'.$event['group_id'].';'.$user['id'].';'.$event['group_event_id'].';1'; ?>'">
     298            <input type="button" name="ReleaseComments" value="<?php __('Release Comments')?>" onClick="location.href='<?php echo $this->webroot.$this->theme.'evaluations/markCommentRelease/'.$event['Event']['id'].';'.$event['Group']['id'].';'.$user['id'].';'.$event['GroupEvent']['id'].';1'; ?>'">
    299299        <?php } ?>
    300300    </div>
  • app/views/evaluations/view_simple_evaluation_results.ctp

    r6e59e21 r9df04ef0  
    1010<tr>
    1111    <td><?php echo $event['Event']['title'] ?></td>
    12     <td><?php echo $event['group_name'] ?></td>
     12    <td><?php echo $event['Group']['group_name'] ?></td>
    1313    <td><?php echo Toolkit::formatDate(date("Y-m-d H:i:s", strtotime($event['Event']['due_date']))) ?></td>
    1414    <td><?php echo ($event['Event']['self_eval']) ? 'Yes' : 'No'?></td>
     
    2828<!-- Users who haven't done the evaluation yet table -->
    2929<table class="standardtable">
    30 <?php 
    31 if (!$allMembersCompleted) { 
     30<?php
     31if (!$allMembersCompleted) {
    3232    echo $html->tableHeaders(
    3333        array(__('These people have not yet submitted their evaluations',true)),
     
    3737    $incompletedMembersArr = array();
    3838    $users = array();
    39     foreach($inCompletedMembers as $row) { 
    40         $user = $row['User']; 
     39    foreach($inCompletedMembers as $row) {
     40        $user = $row['User'];
    4141        array_push($incompletedMembersArr, $user['full_name']);
    42         $users[] = array($user['full_name'] . 
     42        $users[] = array($user['full_name'] .
    4343            ($row['Role'][0]['id']==4 ? ' (TA)' : ' (student)'));
    4444    }
     
    5252<table class='standardtable'>
    5353<tr>
    54     <th><?php __('Evaluator')?></th>
     54    <th rowspan="2"><?php __('Evaluator')?></th>
    5555    <th colspan='<?php echo count($groupMembersNoTutors);?>'>
    5656    <?php __('Members Evaluated')?>
     
    5858</tr>
    5959<tr>
    60     <td></td>
    6160    <?php
    6261    foreach ($groupMembersNoTutors as $member) {
    6362        echo '<th>'.$member['User']['full_name'].'</th>';
    64     } 
     63    }
    6564    ?>
    6665</tr>
     
    8281            if (isset($scoreRecords[$evaluatorId][$evaluateeId])) {
    8382                $score = $scoreRecords[$evaluatorId][$evaluateeId];
    84                 echo '<td>'. (is_numeric($score) ? number_format($score, 2) : 
     83                echo '<td>'. (is_numeric($score) ? number_format($score, 2) :
    8584                    $score) . '</td>';
    8685            } else {
     
    9089    }
    9190    echo '</tr>';
    92 }   
     91}
    9392?>
    9493
     
    101100<?php
    102101// then the total for each user
    103 $memberEvaluatedCount = $event['Event']['self_eval'] ? count($scoreRecords) : 
     102$memberEvaluatedCount = $event['Event']['self_eval'] ? count($scoreRecords) :
    104103    count($scoreRecords) - 1;
    105104foreach ($groupMembersNoTutors as $evaluatee) {
     
    127126<?php
    128127// the penalty for each user
    129 $memberEvaluatedCount = ($event['Event']['self_eval'])? count($scoreRecords) : 
     128$memberEvaluatedCount = ($event['Event']['self_eval'])? count($scoreRecords) :
    130129    count($scoreRecords) - 1;
    131130foreach ($groupMembersNoTutors as $evaluatee) {
     
    152151<?php
    153152// the final mark for each user
    154 $memberEvaluatedCount = ($event['Event']['self_eval']) ? count($scoreRecords) : 
     153$memberEvaluatedCount = ($event['Event']['self_eval']) ? count($scoreRecords) :
    155154    count($scoreRecords) - 1;
    156155foreach ($groupMembersNoTutors as $evaluatee) {
     
    245244        echo '<td>';
    246245        if (isset($gradeRelease['grade_release']) && $gradeRelease['grade_release']) {?>
    247             <input type="button" name="Unrelease" value="Unrelease" onclick="location.href='<?php echo $this->webroot.$this->theme.'evaluations/markGradeRelease/'.$event['Event']['id'].';'.$event['group_id'].';'.$groupMembersNoTutors[$m]['User']['id'].';'.$event['group_event_id'].';0'; ?>'">
     246            <input type="button" name="Unrelease" value="Unrelease" onclick="location.href='<?php echo $this->webroot.$this->theme.'evaluations/markGradeRelease/'.$event['Event']['id'].';'.$event['Group']['id'].';'.$groupMembersNoTutors[$m]['User']['id'].';'.$event['GroupEvent']['id'].';0'; ?>'">
    248247           <?php } else { ?>
    249             <input type="button" name="Release" value="Release" onclick="location.href='<?php echo $this->webroot.$this->theme.'evaluations/markGradeRelease/'.$event['Event']['id'].';'.$event['group_id'].';'.$groupMembersNoTutors[$m]['User']['id'].';'.$event['group_event_id'].';1'; ?>'">
     248            <input type="button" name="Release" value="Release" onclick="location.href='<?php echo $this->webroot.$this->theme.'evaluations/markGradeRelease/'.$event['Event']['id'].';'.$event['Group']['id'].';'.$groupMembersNoTutors[$m]['User']['id'].';'.$event['GroupEvent']['id'].';1'; ?>'">
    250249<?php }
    251250echo '</td>';
     
    260259    <form name="evalForm" id="evalForm" method="POST" action="<?php echo $html->url('markEventReviewed') ?>">
    261260    <input type="hidden" name="event_id" value="<?php echo $event['Event']['id']?>" />
    262     <input type="hidden" name="group_id" value="<?php echo $event['group_id']?>" />
     261    <input type="hidden" name="group_id" value="<?php echo $event['Group']['id']?>" />
    263262    <input type="hidden" name="course_id" value="<?php echo $event['Event']['course_id']?>" />
    264     <input type="hidden" name="group_event_id" value="<?php echo $event['group_event_id']?>" />
     263    <input type="hidden" name="group_event_id" value="<?php echo $event['GroupEvent']['id']?>" />
    265264    <?php
    266     if ($event['group_event_marked'] == "reviewed") {
     265    if ($event['GroupEvent']['marked'] == "reviewed") {
    267266        echo "<input type=\"submit\" name=\"mark_not_reviewed\" value=\" ".__('Mark Peer Evaluations as Not Reviewed', true)."\" />";
    268267    }
     
    292291    $user = $row['User'];
    293292    echo '<h3>Evaluator: '.$user['full_name'].'</h3>';
    294     $headers = array(__('Evaluatee', true), __('Comment', true), 
     293    $headers = array(__('Evaluatee', true), __('Comment', true),
    295294        __('Released', true));
    296295    echo "<table class='standardtable'>";
     
    328327<p style="text-align: center;">
    329328<input type="hidden" name="event_id" value="<?php echo $event['Event']['id']?>" />
    330 <input type="hidden" name="group_id" value="<?php echo $event['group_id']?>" />
     329<input type="hidden" name="group_id" value="<?php echo $event['Group']['id']?>" />
    331330<input type="hidden" name="course_id" value="<?php echo $event['Event']['course_id']?>" />
    332 <input type="hidden" name="group_event_id" value="<?php echo $event['group_event_id']?>" />
     331<input type="hidden" name="group_event_id" value="<?php echo $event['GroupEvent']['id']?>" />
    333332<input type="submit" name="submit" value="<?php __('Save Changes')?>" />
    334333<input type="submit" name="submit" value="<?php __('Release All')?>" />
Note: See TracChangeset for help on using the changeset viewer.