Skip to content

Commit

Permalink
MDL-46776 gradereport_grader: Improve Grader report user interface
Browse files Browse the repository at this point in the history
* Adding assignments to test course generator to more easily test the grader report with large number of students and graded activities.
  • Loading branch information
rlorenzo authored and marinaglancy committed Aug 25, 2014
1 parent cf2d415 commit f0d2cb3
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
25 changes: 25 additions & 0 deletions admin/tool/generator/classes/course_backend.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ class tool_generator_course_backend extends tool_generator_backend {
* @var array Number of sections in course
*/
private static $paramsections = array(1, 10, 100, 500, 1000, 2000);
/**
* @var array Number of assignments in course
*/
private static $paramassignments = array(1, 10, 100, 500, 1000, 2000);
/**
* @var array Number of Page activities in course
*/
Expand Down Expand Up @@ -179,6 +183,7 @@ public function make() {
// Make course.
$this->course = $this->create_course();
$this->create_users();
$this->create_assignments();
$this->create_pages();
$this->create_small_files();
$this->create_big_files();
Expand Down Expand Up @@ -318,6 +323,26 @@ private function create_user_accounts($first, $last) {
$this->end_log();
}

/**
* Creates a number of Assignment activities.
*/
private function create_assignments() {
// Set up generator.
$assigngenerator = $this->generator->get_plugin_generator('mod_assign');

// Create assignments.
$number = self::$paramassignments[$this->size];
$this->log('createassignments', $number, true);
for ($i = 0; $i < $number; $i++) {
$record = array('course' => $this->course);
$options = array('section' => $this->get_target_section());
$assigngenerator->create_instance($record, $options);
$this->dot($i, $number);
}

$this->end_log();
}

/**
* Creates a number of Page activities.
*/
Expand Down
1 change: 1 addition & 0 deletions admin/tool/generator/lang/en/tool_generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
$string['progress_checkaccounts'] = 'Checking user accounts ({$a})';
$string['progress_coursecompleted'] = 'Course completed ({$a}s)';
$string['progress_createaccounts'] = 'Creating user accounts ({$a->from} - {$a->to})';
$string['progress_createassignments'] = 'Creating assignments ({$a})';
$string['progress_createbigfiles'] = 'Creating big files ({$a})';
$string['progress_createcourse'] = 'Creating course {$a}';
$string['progress_createforum'] = 'Creating forum ({$a} posts)';
Expand Down

0 comments on commit f0d2cb3

Please sign in to comment.