Skip to content

Commit

Permalink
quiz reports MDL-17388 tweak layout so more useful stuff fits on the …
Browse files Browse the repository at this point in the history
…first page.

In particular, I think you should be able to see at least the top of the table or results without scrolling, if your monitor is not too small.
  • Loading branch information
timhunt committed Aug 4, 2010
1 parent 21d4bdb commit f6c7f15
Showing 9 changed files with 27 additions and 28 deletions.
5 changes: 0 additions & 5 deletions mod/quiz/report/default.php
Original file line number Diff line number Diff line change
@@ -31,11 +31,6 @@ function print_header_and_tabs($cm, $course, $quiz, $reportmode="overview") {
$PAGE->set_heading($course->fullname);
echo $OUTPUT->header();
$course_context = get_context_instance(CONTEXT_COURSE, $course->id);
if (has_capability('gradereport/grader:view', $course_context) && has_capability('moodle/grade:viewall', $course_context)) {
echo '<div class="allcoursegrades"><a href="' . $CFG->wwwroot . '/grade/report/grader/index.php?id=' . $course->id . '">'
. get_string('seeallcoursegrades', 'grades') . '</a></div>';
}

}
}

6 changes: 3 additions & 3 deletions mod/quiz/report/overview/lang/en/quiz_overview.php
Original file line number Diff line number Diff line change
@@ -64,9 +64,9 @@
$string['regradeallgroup'] = 'Full regrade for group \'{$a->groupname}\'';
$string['regradeheader'] = 'Regrading';
$string['regradeselected'] = 'Regrade selected attempts';
$string['show'] = 'Show / download';
$string['showattempts'] = 'Only show / download attempts';
$string['showdetailedmarks'] = 'Show / download marks for each question';
$string['show'] = 'Include';
$string['showattempts'] = 'Include attempts';
$string['showdetailedmarks'] = 'Marks for each question';
$string['showinggraded'] = 'Showing only the attempt graded for each user.';
$string['showinggradedandungraded'] = 'Showing graded and ungraded attempts for each user. The one attempt for each user that is graded is highlighted. The grading method for this quiz is {$a}.';
$string['studentingroup'] = '\'{$a->coursestudent}\' in group \'{$a->groupname}\'';
2 changes: 1 addition & 1 deletion mod/quiz/report/overview/overviewsettings_form.php
Original file line number Diff line number Diff line change
@@ -51,7 +51,7 @@ function definition() {

$mform->addElement('selectyesno', 'detailedmarks', get_string('showdetailedmarks', 'quiz_overview'));

$this->add_action_buttons(false, get_string('preferencessave', 'quiz_overview'));
$mform->addElement('submit', 'submitbutton', get_string('preferencessave', 'quiz_overview'));
}
}

13 changes: 6 additions & 7 deletions mod/quiz/report/overview/report.php
Original file line number Diff line number Diff line change
@@ -176,12 +176,6 @@ function display($quiz, $cm, $course) {
}
}

// Print information on the number of existing attempts
if (!$table->is_downloading()) { //do not print notices when downloading
if ($strattemptnum = quiz_num_attempt_summary($quiz, $cm, true, $currentgroup)) {
echo '<div class="quizattemptcounts">' . $strattemptnum . '</div>';
}
}
$nostudents = false;
if (!$students) {
echo $OUTPUT->notification(get_string('nostudentsyet'));
@@ -194,8 +188,13 @@ function display($quiz, $cm, $course) {
// Print display options
$mform->set_data($displayoptions +compact('detailedmarks', 'pagesize'));
$mform->display();
}

// Print information on the number of existing attempts
if ($strattemptnum = quiz_num_attempt_summary($quiz, $cm, true, $currentgroup)) {
echo '<div class="quizattemptcounts">' . $strattemptnum . '</div>';
}
}

if (!$nostudents || ($attemptsmode == QUIZ_REPORT_ATTEMPTS_ALL)) {

// Construct the SQL
14 changes: 8 additions & 6 deletions mod/quiz/report/responses/report.php
Original file line number Diff line number Diff line change
@@ -146,12 +146,7 @@ function display($quiz, $cm, $course) {
groups_print_activity_menu($cm, $reporturl->out(true, $displayoptions));
}
}
// Print information on the number of existing attempts
if (!$table->is_downloading()) { //do not print notices when downloading
if ($strattemptnum = quiz_num_attempt_summary($quiz, $cm, true, $currentgroup)) {
echo '<div class="quizattemptcounts">' . $strattemptnum . '</div>';
}
}

$nostudents = false;
if (!$students) {
echo $OUTPUT->notification(get_string('nostudentsyet'));
@@ -166,6 +161,13 @@ function display($quiz, $cm, $course) {
$mform->display();
}

// Print information on the number of existing attempts
if (!$table->is_downloading()) { //do not print notices when downloading
if ($strattemptnum = quiz_num_attempt_summary($quiz, $cm, true, $currentgroup)) {
echo '<div class="quizattemptcounts">' . $strattemptnum . '</div>';
}
}

if (!$nostudents || ($attemptsmode == QUIZ_REPORT_ATTEMPTS_ALL)) {
// Print information on the grading method and whether we are displaying
//
4 changes: 2 additions & 2 deletions mod/quiz/report/responses/responsessettings_form.php
Original file line number Diff line number Diff line change
@@ -33,14 +33,14 @@ function definition() {
$mform->addElement('select', 'attemptsmode', get_string('show', 'quiz_overview'), $options);
if ($this->_customdata['qmsubselect']){
$gm = '<span class="highlight">'.quiz_get_grading_option_name($this->_customdata['quiz']->grademethod).'</span>';
$mform->addElement('advcheckbox', 'qmfilter', get_string('show', 'quiz_overview'), get_string('optonlygradedattempts', 'quiz_overview', $gm), null, array(0,1));
$mform->addElement('advcheckbox', 'qmfilter', get_string('showattempts', 'quiz_overview'), get_string('optonlygradedattempts', 'quiz_overview', $gm), null, array(0,1));
}
//-------------------------------------------------------------------------------
$mform->addElement('header', 'preferencesuser', get_string('preferencesuser', 'quiz_overview'));

$mform->addElement('text', 'pagesize', get_string('pagesize', 'quiz_overview'));
$mform->setType('pagesize', PARAM_INT);

$this->add_action_buttons(false, get_string('preferencessave', 'quiz_overview'));
$mform->addElement('submit', 'submitbutton', get_string('preferencessave', 'quiz_overview'));
}
}
2 changes: 1 addition & 1 deletion mod/quiz/report/statistics/report.php
Original file line number Diff line number Diff line change
@@ -410,7 +410,7 @@ function output_quiz_info_table($course, $cm, $quiz, $quizstats, $usingattemptss
if (!$a->count = $DB->count_records_sql($sql, array('time'=>$quizstats->timemodified)+$qaparams)){
$a->count = 0;
}
$quizinformationtablehtml .= $OUTPUT->box_start('boxaligncenter generalbox boxwidthnormal mdl-align');
$quizinformationtablehtml .= $OUTPUT->box_start('boxaligncenter generalbox boxwidthnormal mdl-align', 'cachingnotice');
$quizinformationtablehtml .= get_string('lastcalculated', 'quiz_statistics', $a);
$aurl = new moodle_url($reporturl->out_omit_querystring(), $reporturl->params() + array('recalculate' => 1, 'sesskey' => sesskey()));
$quizinformationtablehtml .= $OUTPUT->single_button($aurl, get_string('recalculatenow', 'quiz_statistics'));
2 changes: 1 addition & 1 deletion mod/quiz/report/statistics/statistics_form.php
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ function definition() {
$mform->addElement('select', 'useallattempts', get_string('calculatefrom', 'quiz_statistics'), $options);
$mform->setDefault('useallattempts', 0);
//-------------------------------------------------------------------------------
$this->add_action_buttons(false, get_string('preferencessave', 'quiz_overview'));
$mform->addElement('submit', 'submitbutton', get_string('preferencessave', 'quiz_overview'));
}
}

7 changes: 5 additions & 2 deletions mod/quiz/styles.css
Original file line number Diff line number Diff line change
@@ -100,7 +100,7 @@ table#categoryquestions td,
#page-mod-quiz-report #manualgradingform .que {margin-bottom: 0.7em;}
#page-mod-quiz-report table.titlesleft td.c0{font-weight: bold;}
#page-mod-quiz-report table .numcol {text-align: center;vertical-align : middle !important;}
#page-mod-quiz-report table#attempts {clear: both;width: 80%;margin: 20px auto;}
#page-mod-quiz-report table#attempts {clear: both;width: 80%; margin: 0.2em auto;}
#page-mod-quiz-report table#attempts .header,
#page-mod-quiz-report table#attempts .cell{padding: 4px;}
#page-mod-quiz-report table#attempts .header .commands {display: inline;}
@@ -117,6 +117,9 @@ table#categoryquestions td,
#page-mod-quiz-report table#itemanalysis .partialcorrect {color: green !important;}
#page-mod-quiz-report table#itemanalysis .cell{padding: 4px;}
#page-mod-quiz-report table#itemanalysis .qname {color: green !important;}
#page-mod-quiz-report fieldset.felement.fgroup {margin: 0;}
#page-mod-quiz-report #cachingnotice {margin-bottom: 1em; padding: 0.2em; }
#page-mod-quiz-report #cachingnotice .singlebutton {margin: 0.5em 0 0;}

/** Mod quiz grading **/
#page-mod-quiz-grading table#grading {width: 80%;margin: 20px auto;}
@@ -166,7 +169,7 @@ table.quizreviewsummary td.cell {padding: 1px 1em 1px 0.5em;text-align: left;bac
body#question-preview .quemodname,
body#question-preview .controls{text-align: center;}

.quizattemptcounts {clear : left;text-align: center;margin: 6px 0;}
.quizattemptcounts {clear: left; text-align: center;}
.generalbox#passwordbox { /* Should probably match .generalbox#intro above */width:70%;margin-left:auto;margin-right:auto;}
#passwordform {margin: 1em 0;}

0 comments on commit f6c7f15

Please sign in to comment.