Skip to content

Commit

Permalink
Merge branch '3.1.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
xcompass committed Mar 24, 2014
2 parents 0e6ed3d + ecec491 commit 8771467
Show file tree
Hide file tree
Showing 14 changed files with 56 additions and 52 deletions.
2 changes: 1 addition & 1 deletion app/config/core.php
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@
$CWL['applicationID'] = '';
$CWL['applicationPassword'] = '';

define('IPEER_VERSION', '3.1.1');
define('IPEER_VERSION', '3.1.2');


/**
Expand Down
27 changes: 14 additions & 13 deletions app/controllers/components/evaluation.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
Expand Down Expand Up @@ -715,7 +715,7 @@ function formatRubricEvaluationResultsMatrix($evalResult)
$grades = Set::extract($summary, '/grades/'.$num);
$group['grades'][$num] = array_sum($grades) / count($grades);
}

return $summary + $group;
}

Expand Down Expand Up @@ -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');
Expand Down Expand Up @@ -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;
}

Expand All @@ -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);
Expand All @@ -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']) {
Expand All @@ -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;
}
Expand Down Expand Up @@ -962,7 +963,7 @@ function getMixevalResultDetail($groupEventId, $groupMembers, $include)

return $mixevalResultDetail;
}

/**
* formatMixevalEvaluationResultsMatrix
* results matrix format:
Expand Down Expand Up @@ -1033,7 +1034,7 @@ function getStudentViewMixevalResultDetailReview ($event, $userId)
}
return $evalResult;
}


/**
* changeMixevalEvaluationGradeRelease
Expand All @@ -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);

Expand Down Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion app/plugins/guard
22 changes: 11 additions & 11 deletions app/views/accesses/view.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -51,29 +51,29 @@ function fnFormatDetails (oTable, nTr)
actions[i-2] = 'Allow';
}
}

var sOut = '<div class="userActionPanel"><ul>';

sOut += '<li>';
sOut += '<a href="<?php echo $this->base; ?>/accesses/edit/allow/'+aData[0]+'/'+roleId+'"';
sOut += 'onclick="return changeConfirmed(&quot;'+aData[1]+'&quot;)">Allow All</a>';
sOut += '</li>';

sOut += '<li>';
sOut += '<a href="<?php echo $this->base; ?>/accesses/edit/deny/'+aData[0]+'/'+roleId+'"';
sOut += 'onclick="return changeConfirmed(&quot;'+aData[1]+'&quot;)">Deny All</a>';
sOut += '</li>';

for (var i=0; i<4; i++) {
sOut += '<li>';
sOut += '<a href="<?php echo $this->base; ?>/accesses/edit/';
sOut += actions[i].toLowerCase()+'/'+aData[0]+'/'+roleId+'/'+types[i].toLowerCase()+'"';
sOut += 'onclick="return changeConfirmed(&quot;'+aData[1]+'&quot;)">'+actions[i]+' '+types[i]+'</a>';
sOut += '</li>';
}

sOut += '</ul></div>';

return sOut;
}

Expand All @@ -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="<?php echo $this->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];
Expand All @@ -109,4 +109,4 @@ jQuery(document).ready(function() {
});
});

</script>
</script>
2 changes: 1 addition & 1 deletion app/views/elements/global/banner.ctp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div id='bannerLarge' class='banner'>
<div id='ipeerLogo'>
<a href='/' id='home'>
<a href='<?php echo $this->Html->url('/')?>' id='home'>
<?php
echo $html->image('layout/ipeer_logo.png',
array('id'=>'bannerLogoImgLeft', 'alt'=>'logo')
Expand Down
14 changes: 4 additions & 10 deletions app/views/elements/mixevals/view_mixeval_details.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -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' : '';
Expand Down
2 changes: 1 addition & 1 deletion app/views/errors/missing_connection.ctp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div style="margin-left:120px">
<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>
<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>

<pre style="background-color:#FFFFDD;">
&lt;?php
Expand Down
2 changes: 1 addition & 1 deletion app/views/evaluations/view_simple_evaluation_results.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ foreach ($results['evaluatees'] as $evaluatee) {
$button = $form->button(
$buttonName,
array(
'onclick' => "location.href='/evaluations/markGradeRelease/$eventId;$groupId;$evaluateeId;$grpEventId;$releaseAction'"
'onclick' => "location.href='".$this->Html->url('/evaluations/markGradeRelease')."/$eventId;$groupId;$evaluateeId;$grpEventId;$releaseAction'"
)
);
}
Expand Down
2 changes: 1 addition & 1 deletion app/views/home/index.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ if (isset($course_list['I']))
</li>

<li>
<?php __('To create evaluations, check out the ')?><a href="http://ipeer.ctlt.ubc.ca/wiki/UserDocV3.1" target="_blank">User Documentations</a>.
<?php __('To create evaluations, check out the <a href="http://ipeer.ctlt.ubc.ca/wiki/UserDocV3.1" target="_blank">User Documentations</a>')?>.
</li>
</ol>
</div>
4 changes: 2 additions & 2 deletions app/views/install/index.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ $yes = '<b class="green">'.__('Yes', true).'</b>';

// Mandatory requirements init
$phpver = $no;
$REQPHPVER = '5.0';
$REQPHPVER = '5.3';
$mysql = $no;
$configwritable = $no;
$dbconfig = $no;
Expand Down Expand Up @@ -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;
Expand Down
16 changes: 8 additions & 8 deletions app/views/install/install2.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,22 @@ function agreesubmit() {
<h3>Step 2: License Agreement</h3>

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

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

<form action="<?php echo $html->url('install3') ?>"
method="post" name="adminForm"
<form action="<?php echo $html->url('install3') ?>"
method="post" name="adminForm"
onsubmit="return defaultagree(this)" id="gplform">
<input type="checkbox" name="agreecheck" id="agreecheck"
<input type="checkbox" name="agreecheck" id="agreecheck"
onclick="agreesubmit(this)" class="floatleft" />
<label for="agreecheck">I Accept the GPL License</label>
<?php
echo $form->submit('Next >>',
array('disabled'=>'true', 'name'=>'next', 'id' => 'next'))
<?php
echo $form->submit('Next >>',
array('disabled'=>'true', 'name'=>'next', 'id' => 'next'))
?>
</form>
</div>
2 changes: 1 addition & 1 deletion cake/console/cake
Original file line number Diff line number Diff line change
Expand Up @@ -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;
9 changes: 9 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@ Ruuning the tests:

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

iPeer 3.1.2
---------------------------
This is a maintenance release.
* Fix #567, grade release button failed when install in subdir
* Fix cron email job failed when register_argc_argv is off
* Update guard plugin
* Update requirement to PHP 5.3
* Fix #564, students unable to submit 0 mark in the mixeval

iPeer 3.1.1
---------------------------
This is a maintenance release.
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.1.1
3.1.2

0 comments on commit 8771467

Please sign in to comment.