Skip to content

Commit

Permalink
Removed some notices, some polishing.
Browse files Browse the repository at this point in the history
No need to load all users and then remove teachers, can simply load all students.
  • Loading branch information
gustav_delius committed May 15, 2005
1 parent 19ccd12 commit 1b6fe50
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 19 deletions.
4 changes: 2 additions & 2 deletions mod/quiz/lang/en/quiz.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@
$string['wronguse'] = 'You can not use this page like that';

$string['analysisoptions'] = 'Analysis options';
$string['attemptselection'] = 'Select which attempts to analyze per user ';
$string['attemptselection'] = 'Select which attempts to analyze per user: ';
$string['lowmarkslimit'] = " Don't analyze if score is less than: ";
$string['reportanalysis'] = 'Item analysis';
$string['allattempts'] = 'all attempts';
$string['allattempts'] = 'All attempts';
$string['analysistitle'] = 'Item Analysis Table';
?>
2 changes: 1 addition & 1 deletion mod/quiz/locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ function get_all_responses($question, $state) {
}

/**
* Return the actual response to the question in a given attempt
* Return the actual response to the question in a given state
* for the question
*
* @return compond object fractiongrade & actual response .
Expand Down
23 changes: 7 additions & 16 deletions mod/quiz/report/analysis/report.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

/// Item analysis displays a table of quiz questions and their performance

require_once("locallib.php");
require_once($CFG->libdir.'/tablelib.php');


Expand Down Expand Up @@ -31,10 +30,10 @@ class quiz_report extends quiz_default_report {
function display($quiz, $cm, $course) { /// This function just displays the report

global $CFG, $SESSION, $db, $QUIZ_QTYPES;
define(QUIZ_ALLATTEMPTS, 0);
define(QUIZ_HIGHESTATTEMPT, 1);
define(QUIZ_FIRSTATTEMPT, 2);
define(QUIZ_LASTATTEMPT, 3);
define('QUIZ_ALLATTEMPTS', 0);
define('QUIZ_HIGHESTATTEMPT', 1);
define('QUIZ_FIRSTATTEMPT', 2);
define('QUIZ_LASTATTEMPT', 3);

$strnoquiz = get_string('noquiz','quiz');
$strnoattempts = get_string('noattempts','quiz');
Expand All @@ -54,21 +53,13 @@ function display($quiz, $cm, $course) { /// This function just displays the

/// Get all users: teachers and students
if ($currentgroup) {
$users = get_group_users($currentgroup);
$users = get_group_students($currentgroup);
}
else {
$users = get_course_users($course->id);
}

/// Remove teachers
$teachers = get_course_teachers($course->id);
if(!empty($teachers)) {
$keys = array_keys($teachers);
}
foreach($keys as $key) {
unset($users[$key]);
$users = get_course_students($course->id);
}


if(empty($users)) {
print_heading($strnoattempts);
return true;
Expand Down

0 comments on commit 1b6fe50

Please sign in to comment.