Skip to content

Commit 8771467

Browse files
committed
Merge branch '3.1.x'
2 parents 0e6ed3d + ecec491 commit 8771467

File tree

14 files changed

+56
-52
lines changed

14 files changed

+56
-52
lines changed

app/config/core.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@
342342
$CWL['applicationID'] = '';
343343
$CWL['applicationPassword'] = '';
344344

345-
define('IPEER_VERSION', '3.1.1');
345+
define('IPEER_VERSION', '3.1.2');
346346

347347

348348
/**

app/controllers/components/evaluation.php

+14-13
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ function loadRubricEvaluationDetail($event)
486486
$this->EvaluationRubricDetail = new EvaluationRubricDetail;
487487
$this->Rubric = new Rubric;
488488
$this->User = ClassRegistry::init('User');
489-
489+
490490
$Session = new SessionComponent();
491491
$user = $Session->read('Auth.User');//User or Admin or
492492
$evaluator = $user['id'];
@@ -715,7 +715,7 @@ function formatRubricEvaluationResultsMatrix($evalResult)
715715
$grades = Set::extract($summary, '/grades/'.$num);
716716
$group['grades'][$num] = array_sum($grades) / count($grades);
717717
}
718-
718+
719719
return $summary + $group;
720720
}
721721

@@ -826,12 +826,12 @@ function loadMixEvaluationDetail ($event)
826826
/**
827827
* saveMixevalEvaluation
828828
*
829-
* @param bool $params
829+
* @param array $params mixeval array
830830
*
831831
* @access public
832832
* @return void
833833
*/
834-
function saveMixevalEvaluation($params=null)
834+
function saveMixevalEvaluation($params)
835835
{
836836
$this->Event = ClassRegistry::init('Event');
837837
$this->Mixeval = ClassRegistry::init('Mixeval');
@@ -863,13 +863,14 @@ function saveMixevalEvaluation($params=null)
863863
$this->EvaluationMixeval->save($evalMixeval);
864864
$evalMixeval = $this->EvaluationMixeval->read();
865865
}
866-
866+
867867
$score = $this->saveNGetEvaluationMixevalDetail(
868868
$evalMixeval['EvaluationMixeval']['id'], $mixeval, $params);
869869
$evalMixeval['EvaluationMixeval']['score'] = $score;
870870
if (!$this->EvaluationMixeval->save($evalMixeval)) {
871871
return false;
872872
}
873+
873874
return true;
874875
}
875876

@@ -890,7 +891,7 @@ function saveNGetEvaluationMixevalDetail($evalMixevalId, $mixeval, $form)
890891
$this->EvaluationMixeval = ClassRegistry::init('EvaluationMixeval');
891892
$totalGrade = 0;
892893
$data = $form['EvaluationMixeval'];
893-
894+
894895
foreach($mixeval['MixevalQuestion'] as $ques) {
895896
$num = $ques['question_num'];
896897
$evalMixevalDetail = $this->EvaluationMixevalDetail->getByEvalMixevalIdCriteria($evalMixevalId, $num);
@@ -899,13 +900,13 @@ function saveNGetEvaluationMixevalDetail($evalMixevalId, $mixeval, $form)
899900
}
900901
$evalMixevalDetail['EvaluationMixevalDetail']['evaluation_mixeval_id'] = $evalMixevalId;
901902
$evalMixevalDetail['EvaluationMixevalDetail']['question_number'] = $num;
902-
903+
903904
if (in_array($ques['mixeval_question_type_id'], array('1','4'))) {
904905
if (empty($data[$num]['selected_lom']) && $ques['mixeval_question_type_id'] != '4' ) {
905906
continue;
906907
}
907908
if ($ques['mixeval_question_type_id'] == '1') {
908-
$evalMixevalDetail['EvaluationMixevalDetail']['selected_lom'] = $data[$num]['selected_lom'];
909+
$evalMixevalDetail['EvaluationMixevalDetail']['selected_lom'] = $data[$num]['selected_lom'];
909910
}
910911
$evalMixevalDetail['EvaluationMixevalDetail']['grade'] = $data[$num]['grade'];
911912
if ($ques['required'] && !$ques['self_eval']) {
@@ -920,7 +921,7 @@ function saveNGetEvaluationMixevalDetail($evalMixevalId, $mixeval, $form)
920921
}
921922
$evalMixevalDetail['EvaluationMixevalDetail']['question_comment'] = $data[$num]['question_comment'];
922923
}
923-
924+
924925
$this->EvaluationMixevalDetail->save($evalMixevalDetail);
925926
$this->EvaluationMixevalDetail->id=null;
926927
}
@@ -962,7 +963,7 @@ function getMixevalResultDetail($groupEventId, $groupMembers, $include)
962963

963964
return $mixevalResultDetail;
964965
}
965-
966+
966967
/**
967968
* formatMixevalEvaluationResultsMatrix
968969
* results matrix format:
@@ -1033,7 +1034,7 @@ function getStudentViewMixevalResultDetailReview ($event, $userId)
10331034
}
10341035
return $evalResult;
10351036
}
1036-
1037+
10371038

10381039
/**
10391040
* changeMixevalEvaluationGradeRelease
@@ -1050,7 +1051,7 @@ function changeMixevalEvaluationGradeRelease ($groupEventId, $evaluateeId, $rele
10501051
$this->EvaluationMixeval = ClassRegistry::init('EvaluationMixeval');
10511052
$this->GroupEvent = ClassRegistry::init('GroupEvent');
10521053
$this->EvaluationSubmission = ClassRegistry::init('EvaluationSubmission');
1053-
1054+
10541055
$sub = $this->EvaluationSubmission->findAllByGrpEventId($groupEventId);
10551056
$sub = Set::extract('/EvaluationSubmission/submitter_id', $sub);
10561057

@@ -1092,7 +1093,7 @@ function changeMixevalEvaluationCommentRelease ($groupEventId, $evaluateeId, $re
10921093

10931094
$this->GroupEvent->id = $groupEventId;
10941095
$groupEvent = $this->GroupEvent->read();
1095-
1096+
10961097
$sub = $this->EvaluationSubmission->findAllByGrpEventId($groupEventId);
10971098
$sub = Set::extract('/EvaluationSubmission/submitter_id', $sub);
10981099

app/views/accesses/view.ctp

+11-11
Original file line numberDiff line numberDiff line change
@@ -51,29 +51,29 @@ function fnFormatDetails (oTable, nTr)
5151
actions[i-2] = 'Allow';
5252
}
5353
}
54-
54+
5555
var sOut = '<div class="userActionPanel"><ul>';
56-
56+
5757
sOut += '<li>';
5858
sOut += '<a href="<?php echo $this->base; ?>/accesses/edit/allow/'+aData[0]+'/'+roleId+'"';
5959
sOut += 'onclick="return changeConfirmed(&quot;'+aData[1]+'&quot;)">Allow All</a>';
6060
sOut += '</li>';
61-
61+
6262
sOut += '<li>';
6363
sOut += '<a href="<?php echo $this->base; ?>/accesses/edit/deny/'+aData[0]+'/'+roleId+'"';
6464
sOut += 'onclick="return changeConfirmed(&quot;'+aData[1]+'&quot;)">Deny All</a>';
6565
sOut += '</li>';
66-
66+
6767
for (var i=0; i<4; i++) {
6868
sOut += '<li>';
6969
sOut += '<a href="<?php echo $this->base; ?>/accesses/edit/';
7070
sOut += actions[i].toLowerCase()+'/'+aData[0]+'/'+roleId+'/'+types[i].toLowerCase()+'"';
7171
sOut += 'onclick="return changeConfirmed(&quot;'+aData[1]+'&quot;)">'+actions[i]+' '+types[i]+'</a>';
7272
sOut += '</li>';
7373
}
74-
74+
7575
sOut += '</ul></div>';
76-
76+
7777
return sOut;
7878
}
7979

@@ -88,16 +88,16 @@ jQuery(document).ready(function() {
8888
"sPaginationType" : "full_numbers",
8989
"aoColumnDefs": [
9090
{ "bSearchable": false, "bSortable": false, "aTargets": [2, 3, 4, 5] },
91-
{ "bSearchable": false, "bVisible": false, "bSortable":false, "aTargets": [ 0 ] }
91+
{ "bSearchable": false, "bVisible": false, "bSortable":false, "aTargets": [ 0 ] }
9292
],
9393
"aaSorting" : [[1, 'asc']]
9494
});
95-
95+
9696
// for changing between roles
9797
jQuery("#role").change(function() {
98-
window.location.href="/accesses/view/" + jQuery(this).val();
98+
window.location.href="<?php echo $this->Html->url('/accesses/view')?>/" + jQuery(this).val();
9999
});
100-
100+
101101
// event listener for action links
102102
jQuery('#table_id tbody td').live('click', function() {
103103
var nTr = jQuery(this).parents('tr')[0];
@@ -109,4 +109,4 @@ jQuery(document).ready(function() {
109109
});
110110
});
111111

112-
</script>
112+
</script>

app/views/elements/global/banner.ctp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div id='bannerLarge' class='banner'>
22
<div id='ipeerLogo'>
3-
<a href='/' id='home'>
3+
<a href='<?php echo $this->Html->url('/')?>' id='home'>
44
<?php
55
echo $html->image('layout/ipeer_logo.png',
66
array('id'=>'bannerLogoImgLeft', 'alt'=>'logo')

app/views/elements/mixevals/view_mixeval_details.ctp

+4-10
Original file line numberDiff line numberDiff line change
@@ -49,20 +49,14 @@ foreach ($questions as $ques) {
4949
$descs = array();
5050
$marks = array();
5151
$markLabel = __("Mark", true).": ";
52-
$subIf0 = 0;
53-
if ($zero_mark) {
54-
$subIf0 = 1;
55-
$scale -= $subIf0;
56-
}
52+
5753
foreach ($ques['MixevalQuestionDesc'] as $key => $desc) {
5854
$descs[] = $desc['descriptor'];
5955
if ($desc['scale_level'] == 0) {
60-
// upgraded from pre 3.1, scale_levels are set to 0. So use $key as level
61-
$desc['scale_level'] = $subIf0 ? $key : $key + 1;
62-
} else {
63-
$desc['scale_level'] -= $subIf0;
56+
// upgraded from pre 3.1, scale_levels are set to 0. So use $key as level, scale_level starts from 1
57+
$desc['scale_level'] = $key + 1;
6458
}
65-
$mark = $highestMark * ($desc['scale_level'] / $scale);
59+
$mark = $highestMark * (($desc['scale_level'] - $zero_mark) / ($scale - $zero_mark));
6660
$checked = '';
6761
if (isset($details[$num])) {
6862
$checked = ($details[$num]['selected_lom'] == $desc['scale_level']) ? 'checked' : '';

app/views/errors/missing_connection.ctp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div style="margin-left:120px">
2-
<h1><?php __('No iPeer database found. You may want to run <a href="/install">installation</a> first. Otherwise make sure you define in it <u><tt>app/config/database.php</tt></u> in the following format:')?></h1>
2+
<h1><?php __('No iPeer database found. You may want to run %s first. Otherwise make sure you define in it <u><tt>app/config/database.php</tt></u> in the following format:', $this->Html->link('installation', '/install'))?></h1>
33

44
<pre style="background-color:#FFFFDD;">
55
&lt;?php

app/views/evaluations/view_simple_evaluation_results.ctp

+1-1
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ foreach ($results['evaluatees'] as $evaluatee) {
234234
$button = $form->button(
235235
$buttonName,
236236
array(
237-
'onclick' => "location.href='/evaluations/markGradeRelease/$eventId;$groupId;$evaluateeId;$grpEventId;$releaseAction'"
237+
'onclick' => "location.href='".$this->Html->url('/evaluations/markGradeRelease')."/$eventId;$groupId;$evaluateeId;$grpEventId;$releaseAction'"
238238
)
239239
);
240240
}

app/views/home/index.ctp

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ if (isset($course_list['I']))
8989
</li>
9090

9191
<li>
92-
<?php __('To create evaluations, check out the ')?><a href="http://ipeer.ctlt.ubc.ca/wiki/UserDocV3.1" target="_blank">User Documentations</a>.
92+
<?php __('To create evaluations, check out the <a href="http://ipeer.ctlt.ubc.ca/wiki/UserDocV3.1" target="_blank">User Documentations</a>')?>.
9393
</li>
9494
</ol>
9595
</div>

app/views/install/index.ctp

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ $yes = '<b class="green">'.__('Yes', true).'</b>';
1515

1616
// Mandatory requirements init
1717
$phpver = $no;
18-
$REQPHPVER = '5.0';
18+
$REQPHPVER = '5.3';
1919
$mysql = $no;
2020
$configwritable = $no;
2121
$dbconfig = $no;
@@ -70,7 +70,7 @@ $domdoc = (extension_loaded('dom') && class_exists('DOMDocument')) ? $yes : $no;
7070
// make sure that the php memory limit is at least 64 mb
7171
$limit = ini_get('memory_limit');
7272
$unit = substr($limit, -1);
73-
// convert to bytes
73+
// convert to bytes
7474
if ($limit == -1) $limit = 9999999999999; # no memory limit
7575
else if (strcasecmp($unit, 'k') == 0) $limit *= 1024;
7676
else if (strcasecmp($unit, 'm')) $limit *= 1024 * 1024;

app/views/install/install2.ctp

+8-8
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,22 @@ function agreesubmit() {
1717
<h3>Step 2: License Agreement</h3>
1818

1919
<p>
20-
<a href="http://ipeer.olt.ubc.ca">iPeer</a>
21-
<?php __(' is Free Software released under the GNU/GPL License.')?>
20+
<a href="http://ipeer.ctlt.ubc.ca">iPeer</a>
21+
<?php __(' is Free Software released under the GNU/GPL License.')?>
2222
</p>
2323

2424
<iframe src="gpl" width="100%" height="600" class="license" frameborder="0">
2525
</iframe>
2626

27-
<form action="<?php echo $html->url('install3') ?>"
28-
method="post" name="adminForm"
27+
<form action="<?php echo $html->url('install3') ?>"
28+
method="post" name="adminForm"
2929
onsubmit="return defaultagree(this)" id="gplform">
30-
<input type="checkbox" name="agreecheck" id="agreecheck"
30+
<input type="checkbox" name="agreecheck" id="agreecheck"
3131
onclick="agreesubmit(this)" class="floatleft" />
3232
<label for="agreecheck">I Accept the GPL License</label>
33-
<?php
34-
echo $form->submit('Next >>',
35-
array('disabled'=>'true', 'name'=>'next', 'id' => 'next'))
33+
<?php
34+
echo $form->submit('Next >>',
35+
array('disabled'=>'true', 'name'=>'next', 'id' => 'next'))
3636
?>
3737
</form>
3838
</div>

cake/console/cake

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ done
2828
LIB=$(dirname -- "$LIB")/
2929
APP=`pwd`
3030

31-
exec php -q "$LIB"cake.php -working "$APP" "$@"
31+
exec php -q -d register_argc_argv=1 "$LIB"cake.php -working "$APP" "$@"
3232

3333
exit;

readme.md

+9
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,15 @@ Ruuning the tests:
1414

1515
It is better not to touch the mouse or keyboard during the tests.
1616

17+
iPeer 3.1.2
18+
---------------------------
19+
This is a maintenance release.
20+
* Fix #567, grade release button failed when install in subdir
21+
* Fix cron email job failed when register_argc_argv is off
22+
* Update guard plugin
23+
* Update requirement to PHP 5.3
24+
* Fix #564, students unable to submit 0 mark in the mixeval
25+
1726
iPeer 3.1.1
1827
---------------------------
1928
This is a maintenance release.

version.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.1.1
1+
3.1.2

0 commit comments

Comments
 (0)