Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fixed some php strict-mode warnings

  • Loading branch information...
commit 1afc701bff567edbea1873f31e9f45022a303714 1 parent ca6aaab
@brki brki authored
View
2  db/install.php
@@ -34,7 +34,7 @@ function xmldb_attforblock_install() {
$result = true;
$arr = array('P' => 2, 'A' => 0, 'L' => 1, 'E' => 1);
foreach ($arr as $k => $v) {
- unset($rec);
+ $rec = new stdClass;
$rec->attendanceid = 0;
$rec->acronym = get_string($k.'acronym', 'attforblock');
$rec->description = get_string($k.'full', 'attforblock');
View
1  export.php
@@ -77,6 +77,7 @@
$filename = clean_filename($course->shortname.'_Attendances_'.userdate(time(), '%Y%m%d-%H%M'));
$group = $formdata->group ? $reportdata->groups[$formdata->group] : 0;
+ $data = new stdClass;
$data->tabhead = array();
$data->course = $att->course->fullname;
$data->group = $group ? $group->name : get_string('allparticipants');
View
6 locallib.php
@@ -1292,12 +1292,14 @@ function att_update_all_users_grades($attid, $course, $context) {
$statuses = att_get_statuses($attid);
$gradebook_maxgrade = att_get_gradebook_maxgrade($attid);
foreach ($userids as $userid) {
- $grades[$userid]->userid = $userid;
+ $grade = new stdClass;
+ $grade->userid = $userid;
$userstatusesstat = att_get_user_statuses_stat($attid, $course->startdate, $userid);
$usertakensesscount = att_get_user_taken_sessions_count($attid, $course->startdate, $userid);
$usergrade = att_get_user_grade($userstatusesstat, $statuses);
$usermaxgrade = att_get_user_max_grade($usertakensesscount, $statuses);
- $grades[$userid]->rawgrade = att_calc_user_grade_fraction($usergrade, $usermaxgrade) * $gradebook_maxgrade;
+ $grade->rawgrade = att_calc_user_grade_fraction($usergrade, $usermaxgrade) * $gradebook_maxgrade;
+ $grades[$userid] = $grade;
}
return grade_update('mod/attforblock', $course->id, 'mod', 'attforblock',
View
6 preferences.php
@@ -85,9 +85,9 @@
$att->update_status($att->pageparams->statusid, null, null, null, 1);
break;
case att_preferences_page_params::ACTION_SAVE:
- $acronym = required_param('acronym', PARAM_MULTILANG);
- $description = required_param('description', PARAM_MULTILANG);
- $grade = required_param('grade', PARAM_INT);
+ $acronym = required_param_array('acronym', PARAM_MULTILANG);
+ $description = required_param_array('description', PARAM_MULTILANG);
+ $grade = required_param_array('grade', PARAM_INT);
foreach ($acronym as $id => $v) {
$att->update_status($id, $acronym[$id], $description[$id], $grade[$id], null);
Please sign in to comment.
Something went wrong with that request. Please try again.