Skip to content

Commit

Permalink
Fix optional parameter declared before required parameter.
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaboesch committed Aug 4, 2024
1 parent 7e7a5d6 commit 6ea95db
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion mod/kalvidassign/grade_submissions.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@
}
}

$renderer->display_submissions_table($cm, $data->group_filter, $data->filter, $data->perpage, $data->quickgrade, $tifirst, $tilast, $page);
$renderer->display_submissions_table($cm, $data->perpage, $data->group_filter, $data->filter, $data->quickgrade, $tifirst, $tilast, $page);

$prefform->set_data($data);
$prefform->display();
Expand Down
15 changes: 8 additions & 7 deletions mod/kalvidassign/renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function __construct($uniqueid, $cm, $gradinginfo, $quickgrade = false, $
$this->gradinginfo = $gradinginfo;

$instance = $DB->get_record('kalvidassign', array('id' => $cm->instance), 'id,grade');

$this->courseId = $cm->course;

$instance->cmid = $cm->id;
Expand Down Expand Up @@ -424,11 +424,11 @@ public function display_grade($grade) {
return '-';
}
}

private function _generateLtiLaunchLink($source, $data)
{
$cmid = $this->cminstance->cmid;

$width = 485;
$height = 450;
if(isset($data->height) && isset($data->width))
Expand All @@ -438,7 +438,7 @@ private function _generateLtiLaunchLink($source, $data)
}
$realSource = local_kaltura_add_kaf_uri_token($source);
$hashedSource = base64_encode($realSource);

$target = new moodle_url('/mod/kalvidassign/lti_launch_grade.php?cmid='.$cmid.'&source='.urlencode($source).'&height='.$height.'&width='.$width.'&courseid='.$this->courseId);
return $target;
}
Expand Down Expand Up @@ -706,17 +706,18 @@ public function display_instructor_buttons($cm, $userid) {

/**
* This function returns HTML markup to render a the submissions table
*
* @param object $cm A course module object.
* @param int $perpage The number of submissions to display on a page.
* @param int $groupfilter The group id to filter against.
* @param string $filter Filter users who have submitted, submitted and graded or everyone.
* @param int $perpage The number of submissions to display on a page.
* @param bool $quickgrade True if the quick grade table needs to be rendered, otherwsie false.
* @param string $tifirst The first initial of the first name.
* @param string $tilast The first initial of the last name.
* @param int $page The current page to render.
* @return string Returns HTML markup.
*/
public function display_submissions_table($cm, $groupfilter = 0, $filter = 'all', $perpage, $quickgrade = false, $tifirst = '', $tilast = '', $page = 0) {
public function display_submissions_table($cm, $perpage, $groupfilter = 0, $filter = 'all', $quickgrade = false, $tifirst = '', $tilast = '', $page = 0) {

global $DB, $COURSE, $USER;

Expand Down Expand Up @@ -820,7 +821,7 @@ public function display_submissions_table($cm, $groupfilter = 0, $filter = 'all'
case SEPARATEGROUPS:
// If separate groups, but displaying all users then we must display only users
// who are in the same group as the current user. Otherwise, show only groupmembers
// of the selected group.
// of the selected group.
if (0 == $groupfilter) {
$groupscolumn = ', gm.groupid ';
$groupsjoin = ' INNER JOIN {groups_members} gm ON gm.userid = u.id INNER JOIN {groups} g ON g.id = gm.groupid ';
Expand Down

0 comments on commit 6ea95db

Please sign in to comment.