Skip to content

Commit

Permalink
MDL-14238 - removing whitespaces.
Browse files Browse the repository at this point in the history
  • Loading branch information
rwijaya committed Aug 23, 2010
1 parent 93ea129 commit de75c48
Showing 1 changed file with 27 additions and 27 deletions.
54 changes: 27 additions & 27 deletions mod/assignment/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ function assignment_base($cmid='staticonly', $assignment=NULL, $cm=NULL, $course
*
* This in turn calls the methods producing individual parts of the page
*/
function view() {
function view() {

$context = get_context_instance(CONTEXT_MODULE,$this->cm->id);
require_capability('mod/assignment:view', $context);
Expand Down Expand Up @@ -595,7 +595,7 @@ function submissions($mode) {
//make user global so we can use the id
global $USER, $OUTPUT, $DB, $PAGE;

$mailinfo = optional_param('mailinfo', null, PARAM_BOOL);
$mailinfo = optional_param('mailinfo', null, PARAM_BOOL);

if (optional_param('next', null, PARAM_BOOL)) {
$mode='next';
Expand All @@ -612,7 +612,7 @@ function submissions($mode) {
}
} else {
set_user_preference('assignment_mailinfo', $mailinfo);
}
}

switch ($mode) {
case 'grade': // We are in a main window grading
Expand Down Expand Up @@ -985,7 +985,7 @@ function display_submission($offset=-1,$userid =-1) {
global $USER;
$teacher = $USER;
}

$this->preprocess_submission($submission);

$mformdata = new stdclass;
Expand All @@ -1010,7 +1010,7 @@ function display_submission($offset=-1,$userid =-1) {
$mformdata->submissioncommentformat= FORMAT_HTML;
$mformdata->submission_content= $this->print_user_files($user->id,true);
$mformdata->filter = $filter;

$submitform = new mod_assignment_grading_form( null, $mformdata );

if ($submitform->is_cancelled()) {
Expand Down Expand Up @@ -1065,19 +1065,19 @@ function display_submissions($message='') {
/* first we check to see if the form has just been submitted
* to request user_preference updates
*/

$filters = array(self::FILTER_ALL => get_string('all'),
self::FILTER_SUBMITTED => get_string('submitted', 'assignment'),
self::FILTER_REQUIRE_GRADING => get_string('requiregrading', 'assignment'));

$updatepref = optional_param('updatepref', 0, PARAM_INT);

if (isset($_POST['updatepref'])){
$perpage = optional_param('perpage', 10, PARAM_INT);
$perpage = ($perpage <= 0) ? 10 : $perpage ;
$filter = optional_param('filter', 0, PARAM_INT);
set_user_preference('assignment_perpage', $perpage);
set_user_preference('assignment_quickgrade', optional_param('quickgrade', 0, PARAM_BOOL));
set_user_preference('assignment_quickgrade', optional_param('quickgrade', 0, PARAM_BOOL));
set_user_preference('assignment_filter', $filter);
}

Expand Down Expand Up @@ -1112,7 +1112,7 @@ function display_submissions($message='') {
echo $OUTPUT->header();

echo '<div class="usersubmissions">';

/// Print quickgrade form around the table
if ($quickgrade) {
$formattrs = array();
Expand Down Expand Up @@ -1148,7 +1148,7 @@ function display_submissions($message='') {

/// Get all ppl that are allowed to submit assignments
list($esql, $params) = get_enrolled_sql($context, 'mod/assignment:submit', $currentgroup);

if ($filter == self::FILTER_ALL) {
$sql = "SELECT u.id FROM {user} u ".
"LEFT JOIN ($esql) eu ON eu.id=u.id ".
Expand Down Expand Up @@ -1249,11 +1249,11 @@ function display_submissions($message='') {
if ($where = $table->get_sql_where()) {
$where .= ' AND ';
}

if($filter == self::FILTER_SUBMITTED) {
$where .= 's.timemodified > 0 AND ';
$where .= 's.timemodified > 0 AND ';
} else if($filter == self::FILTER_REQUIRE_GRADING) {
$where .= 's.timemarked < s.timemodified AND ';
$where .= 's.timemarked < s.timemodified AND ';
}

if ($sort = $table->get_sql_sort()) {
Expand All @@ -1274,15 +1274,15 @@ function display_submissions($message='') {
$ausers = $DB->get_records_sql($select.$sql.$sort, null, $table->get_page_start(), $table->get_page_size());

$table->pagesize($perpage, count($users));

///offset used to calculate index of student in that particular query, needed for the pop up to know who's next
$offset = $page * $perpage;
$strupdate = get_string('update');
$strgrade = get_string('grade');
$grademenu = make_grades_menu($this->assignment->grade);

if ($ausers !== false) {
$grading_info = grade_get_grades($this->course->id, 'mod', 'assignment', $this->assignment->id, array_keys($ausers));
$grading_info = grade_get_grades($this->course->id, 'mod', 'assignment', $this->assignment->id, array_keys($ausers));
$endposition = $offset + $perpage;
$currentposition = 0;
foreach ($ausers as $auser) {
Expand Down Expand Up @@ -1424,7 +1424,7 @@ function display_submissions($message='') {
$row[] = $outcomes;
}

$table->add_data($row);
$table->add_data($row);
}
$currentposition++;
}
Expand All @@ -1439,44 +1439,44 @@ function display_submissions($message='') {
$mailinfopref = true;
}
$emailnotification = html_writer::checkbox('mailinfo', 1, $mailinfopref, get_string('enableemailnotification','assignment'));

$emailnotification .= $OUTPUT->help_icon('enableemailnotification', 'assignment');
echo html_writer::tag('div', $emailnotification, array('class'=>'emailnotification'));

$savefeedback = html_writer::empty_tag('input', array('type'=>'submit', 'name'=>'fastg', 'value'=>get_string('saveallfeedback', 'assignment')));
echo html_writer::tag('div', $savefeedback, array('class'=>'fastgbutton'));
echo html_writer::end_tag('form');

echo html_writer::end_tag('form');
} else if ($quickgrade) {
echo html_writer::end_tag('form');
echo html_writer::end_tag('form');
}

echo '</div>';
/// End of fast grading form

/// Mini form for setting user preference
/// Mini form for setting user preference

$formaction = new moodle_url('/mod/assignment/submissions.php', array('id'=>$this->cm->id));
$mform = new MoodleQuickForm('optionspref', 'post', $formaction, '', array('class'=>'optionspref'));

$mform->addElement('hidden', 'updatepref');
$mform->setDefault('updatepref', 1);
$mform->addElement('header', 'qgprefs', get_string('optionalsettings', 'assignment'));
$mform->addElement('select', 'filter', get_string('show'), $filters);

$mform->setDefault('filter', $filter);

$mform->addElement('text', 'perpage', get_string('pagesize', 'assignment'), array('size'=>1));
$mform->setDefault('perpage', $perpage);
$mform->setDefault('perpage', $perpage);

$mform->addElement('checkbox', 'quickgrade', get_string('quickgrade','assignment'));
$mform->setDefault('quickgrade', $quickgrade);
$mform->addHelpButton('quickgrade', 'quickgrade', 'assignment');

$mform->addElement('submit', 'savepreferences', get_string('savepreferences'));

$mform->display();

echo $OUTPUT->footer();
}

Expand Down

0 comments on commit de75c48

Please sign in to comment.