From a875d2adeac15fda9676ec6a04b1e598975fe662 Mon Sep 17 00:00:00 2001 From: Compass Date: Tue, 18 Mar 2014 15:47:25 -0700 Subject: [PATCH 1/6] Fix #564, students unable to submit 0 mark in the mixevaL When select 0 mark, system shows require field are not completed. When select a mark other than 0, the evaluation can be submitted, however, when changing the mark to 0 and after saving, it changed back to the original value. The LOM should start with 1. Zeros are all for comments questions. The LOM values are inconsistent between evaluations with and without zero marks. E.g. with zero marks, LOM starts with 0, and without zero marks, LOM starts with 1. --- app/controllers/components/evaluation.php | 27 ++++++++++--------- .../mixevals/view_mixeval_details.ctp | 14 +++------- 2 files changed, 18 insertions(+), 23 deletions(-) diff --git a/app/controllers/components/evaluation.php b/app/controllers/components/evaluation.php index ce7cf0f6d..2b329942a 100644 --- a/app/controllers/components/evaluation.php +++ b/app/controllers/components/evaluation.php @@ -486,7 +486,7 @@ function loadRubricEvaluationDetail($event) $this->EvaluationRubricDetail = new EvaluationRubricDetail; $this->Rubric = new Rubric; $this->User = ClassRegistry::init('User'); - + $Session = new SessionComponent(); $user = $Session->read('Auth.User');//User or Admin or $evaluator = $user['id']; @@ -715,7 +715,7 @@ function formatRubricEvaluationResultsMatrix($evalResult) $grades = Set::extract($summary, '/grades/'.$num); $group['grades'][$num] = array_sum($grades) / count($grades); } - + return $summary + $group; } @@ -826,12 +826,12 @@ function loadMixEvaluationDetail ($event) /** * saveMixevalEvaluation * - * @param bool $params + * @param array $params mixeval array * * @access public * @return void */ - function saveMixevalEvaluation($params=null) + function saveMixevalEvaluation($params) { $this->Event = ClassRegistry::init('Event'); $this->Mixeval = ClassRegistry::init('Mixeval'); @@ -863,13 +863,14 @@ function saveMixevalEvaluation($params=null) $this->EvaluationMixeval->save($evalMixeval); $evalMixeval = $this->EvaluationMixeval->read(); } - + $score = $this->saveNGetEvaluationMixevalDetail( $evalMixeval['EvaluationMixeval']['id'], $mixeval, $params); $evalMixeval['EvaluationMixeval']['score'] = $score; if (!$this->EvaluationMixeval->save($evalMixeval)) { return false; } + return true; } @@ -890,7 +891,7 @@ function saveNGetEvaluationMixevalDetail($evalMixevalId, $mixeval, $form) $this->EvaluationMixeval = ClassRegistry::init('EvaluationMixeval'); $totalGrade = 0; $data = $form['EvaluationMixeval']; - + foreach($mixeval['MixevalQuestion'] as $ques) { $num = $ques['question_num']; $evalMixevalDetail = $this->EvaluationMixevalDetail->getByEvalMixevalIdCriteria($evalMixevalId, $num); @@ -899,13 +900,13 @@ function saveNGetEvaluationMixevalDetail($evalMixevalId, $mixeval, $form) } $evalMixevalDetail['EvaluationMixevalDetail']['evaluation_mixeval_id'] = $evalMixevalId; $evalMixevalDetail['EvaluationMixevalDetail']['question_number'] = $num; - + if (in_array($ques['mixeval_question_type_id'], array('1','4'))) { if (empty($data[$num]['selected_lom']) && $ques['mixeval_question_type_id'] != '4' ) { continue; } if ($ques['mixeval_question_type_id'] == '1') { - $evalMixevalDetail['EvaluationMixevalDetail']['selected_lom'] = $data[$num]['selected_lom']; + $evalMixevalDetail['EvaluationMixevalDetail']['selected_lom'] = $data[$num]['selected_lom']; } $evalMixevalDetail['EvaluationMixevalDetail']['grade'] = $data[$num]['grade']; if ($ques['required'] && !$ques['self_eval']) { @@ -920,7 +921,7 @@ function saveNGetEvaluationMixevalDetail($evalMixevalId, $mixeval, $form) } $evalMixevalDetail['EvaluationMixevalDetail']['question_comment'] = $data[$num]['question_comment']; } - + $this->EvaluationMixevalDetail->save($evalMixevalDetail); $this->EvaluationMixevalDetail->id=null; } @@ -962,7 +963,7 @@ function getMixevalResultDetail($groupEventId, $groupMembers, $include) return $mixevalResultDetail; } - + /** * formatMixevalEvaluationResultsMatrix * results matrix format: @@ -1033,7 +1034,7 @@ function getStudentViewMixevalResultDetailReview ($event, $userId) } return $evalResult; } - + /** * changeMixevalEvaluationGradeRelease @@ -1050,7 +1051,7 @@ function changeMixevalEvaluationGradeRelease ($groupEventId, $evaluateeId, $rele $this->EvaluationMixeval = ClassRegistry::init('EvaluationMixeval'); $this->GroupEvent = ClassRegistry::init('GroupEvent'); $this->EvaluationSubmission = ClassRegistry::init('EvaluationSubmission'); - + $sub = $this->EvaluationSubmission->findAllByGrpEventId($groupEventId); $sub = Set::extract('/EvaluationSubmission/submitter_id', $sub); @@ -1092,7 +1093,7 @@ function changeMixevalEvaluationCommentRelease ($groupEventId, $evaluateeId, $re $this->GroupEvent->id = $groupEventId; $groupEvent = $this->GroupEvent->read(); - + $sub = $this->EvaluationSubmission->findAllByGrpEventId($groupEventId); $sub = Set::extract('/EvaluationSubmission/submitter_id', $sub); diff --git a/app/views/elements/mixevals/view_mixeval_details.ctp b/app/views/elements/mixevals/view_mixeval_details.ctp index abe971702..229e14d00 100644 --- a/app/views/elements/mixevals/view_mixeval_details.ctp +++ b/app/views/elements/mixevals/view_mixeval_details.ctp @@ -49,20 +49,14 @@ foreach ($questions as $ques) { $descs = array(); $marks = array(); $markLabel = __("Mark", true).": "; - $subIf0 = 0; - if ($zero_mark) { - $subIf0 = 1; - $scale -= $subIf0; - } + foreach ($ques['MixevalQuestionDesc'] as $key => $desc) { $descs[] = $desc['descriptor']; if ($desc['scale_level'] == 0) { - // upgraded from pre 3.1, scale_levels are set to 0. So use $key as level - $desc['scale_level'] = $subIf0 ? $key : $key + 1; - } else { - $desc['scale_level'] -= $subIf0; + // upgraded from pre 3.1, scale_levels are set to 0. So use $key as level, scale_level starts from 1 + $desc['scale_level'] = $key + 1; } - $mark = $highestMark * ($desc['scale_level'] / $scale); + $mark = $highestMark * (($desc['scale_level'] - $zero_mark) / ($scale - $zero_mark)); $checked = ''; if (isset($details[$num])) { $checked = ($details[$num]['selected_lom'] == $desc['scale_level']) ? 'checked' : ''; From b33a7b12e23e0a0492a4ebdb6a5c14e73d5fbe88 Mon Sep 17 00:00:00 2001 From: Compass Date: Tue, 18 Mar 2014 17:09:03 -0700 Subject: [PATCH 2/6] Update requirement to PHP 5.3 --- app/views/install/index.ctp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/install/index.ctp b/app/views/install/index.ctp index 053e740c4..4828c5e66 100644 --- a/app/views/install/index.ctp +++ b/app/views/install/index.ctp @@ -15,7 +15,7 @@ $yes = ''.__('Yes', true).''; // Mandatory requirements init $phpver = $no; -$REQPHPVER = '5.0'; +$REQPHPVER = '5.3'; $mysql = $no; $configwritable = $no; $dbconfig = $no; @@ -70,7 +70,7 @@ $domdoc = (extension_loaded('dom') && class_exists('DOMDocument')) ? $yes : $no; // make sure that the php memory limit is at least 64 mb $limit = ini_get('memory_limit'); $unit = substr($limit, -1); -// convert to bytes +// convert to bytes if ($limit == -1) $limit = 9999999999999; # no memory limit else if (strcasecmp($unit, 'k') == 0) $limit *= 1024; else if (strcasecmp($unit, 'm')) $limit *= 1024 * 1024; From 01f54a0f7e6a7c227fa60e4be74746184712524e Mon Sep 17 00:00:00 2001 From: Compass Date: Wed, 19 Mar 2014 15:05:25 -0700 Subject: [PATCH 3/6] Update guard plugin --- app/plugins/guard | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/plugins/guard b/app/plugins/guard index 329960c13..25f26ab4b 160000 --- a/app/plugins/guard +++ b/app/plugins/guard @@ -1 +1 @@ -Subproject commit 329960c13761bdfbd591251871aea5fb1c5bc540 +Subproject commit 25f26ab4b9b6593be943a804276edc5d61fdb9da From 9f428888fd898caea2a34dbd9a19ef7439551d9a Mon Sep 17 00:00:00 2001 From: Compass Date: Wed, 19 Mar 2014 15:06:33 -0700 Subject: [PATCH 4/6] Fix cron email job failed when register_argc_argv is off In case of register_argc_argv value is turned off in the php.ini. Sending email job will fail with message: CakePHP Console: This file has been loaded incorrectly and cannot continue. Turning it back on from command line. --- cake/console/cake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/console/cake b/cake/console/cake index fbef004b1..9395de059 100755 --- a/cake/console/cake +++ b/cake/console/cake @@ -28,6 +28,6 @@ done LIB=$(dirname -- "$LIB")/ APP=`pwd` -exec php -q "$LIB"cake.php -working "$APP" "$@" +exec php -q -d register_argc_argv=1 "$LIB"cake.php -working "$APP" "$@" exit; From 52b80e26c010bfe0ae7458231edebf2123101c44 Mon Sep 17 00:00:00 2001 From: Compass Date: Mon, 24 Mar 2014 11:38:11 -0700 Subject: [PATCH 5/6] Fix #567, grade release button failed when install in subdir --- app/views/accesses/view.ctp | 22 +++++++++---------- app/views/elements/global/banner.ctp | 2 +- app/views/errors/missing_connection.ctp | 2 +- .../view_simple_evaluation_results.ctp | 2 +- app/views/home/index.ctp | 2 +- app/views/install/install2.ctp | 16 +++++++------- 6 files changed, 23 insertions(+), 23 deletions(-) diff --git a/app/views/accesses/view.ctp b/app/views/accesses/view.ctp index ea385e6e6..1a0bec617 100644 --- a/app/views/accesses/view.ctp +++ b/app/views/accesses/view.ctp @@ -51,19 +51,19 @@ function fnFormatDetails (oTable, nTr) actions[i-2] = 'Allow'; } } - + var sOut = '
'; - + return sOut; } @@ -88,16 +88,16 @@ jQuery(document).ready(function() { "sPaginationType" : "full_numbers", "aoColumnDefs": [ { "bSearchable": false, "bSortable": false, "aTargets": [2, 3, 4, 5] }, - { "bSearchable": false, "bVisible": false, "bSortable":false, "aTargets": [ 0 ] } + { "bSearchable": false, "bVisible": false, "bSortable":false, "aTargets": [ 0 ] } ], "aaSorting" : [[1, 'asc']] }); - + // for changing between roles jQuery("#role").change(function() { - window.location.href="/accesses/view/" + jQuery(this).val(); + window.location.href="Html->url('/accesses/view')?>/" + jQuery(this).val(); }); - + // event listener for action links jQuery('#table_id tbody td').live('click', function() { var nTr = jQuery(this).parents('tr')[0]; @@ -109,4 +109,4 @@ jQuery(document).ready(function() { }); }); - \ No newline at end of file + diff --git a/app/views/elements/global/banner.ctp b/app/views/elements/global/banner.ctp index d1eccf47f..040eec8e2 100644 --- a/app/views/elements/global/banner.ctp +++ b/app/views/elements/global/banner.ctp @@ -1,6 +1,6 @@