Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Gradebook export: Difference between revisions

From MoodleDocs
Line 7: Line 7:
The gradebook export modules are located in the grade/export directory.  To create a new gradebook export, create a new directory in grade/export and place the proper files into that directory.  Find the export format most like what the developed export format and use those files as a starting point.  Replace [newexport] below with the directory created for the new export format.
The gradebook export modules are located in the grade/export directory.  To create a new gradebook export, create a new directory in grade/export and place the proper files into that directory.  Find the export format most like what the developed export format and use those files as a starting point.  Replace [newexport] below with the directory created for the new export format.


# /grade/export/[newexport]/db/access.php
1. /grade/export/[newexport]/db/access.php - The Plain text file is shown below.  Change each instance of "txt" to [newexport]


<pre>
    <?php
<?php
   
    $gradeexport_txt_capabilities = array(
   
        'gradeexport/txt:view' => array(
            'riskbitmask' => RISK_PERSONAL,
            'captype' => 'read',
            'contextlevel' => CONTEXT_COURSE,
            'legacy' => array(
                'teacher' => CAP_ALLOW,
                'editingteacher' => CAP_ALLOW,
                'admin' => CAP_ALLOW
            )
        ),
   
        'gradeexport/txt:publish' => array(
            'riskbitmask' => RISK_PERSONAL,
            'captype' => 'read',
            'contextlevel' => CONTEXT_COURSE,
            'legacy' => array(
                  'admin' => CAP_ALLOW
            )
        )
    );
   
    ?>


$gradeexport_txt_capabilities = array(
2. /grade/export/[newexport]/dump.php


    'gradeexport/txt:view' => array(
3. /grade/export/[newexport]/export.php
        'riskbitmask' => RISK_PERSONAL,
        'captype' => 'read',
        'contextlevel' => CONTEXT_COURSE,
        'legacy' => array(
            'teacher' => CAP_ALLOW,
            'editingteacher' => CAP_ALLOW,
            'admin' => CAP_ALLOW
        )
    ),


    'gradeexport/txt:publish' => array(
4. /grade/export/[newexport]/grade_export_[newexport].php
        'riskbitmask' => RISK_PERSONAL,
        'captype' => 'read',
        'contextlevel' => CONTEXT_COURSE,
        'legacy' => array(
            'admin' => CAP_ALLOW
        )
    )
);


?>
5. /grade/export/[newexport]/index.php
</pre>


# /grade/export/[newexport]/dump.php
6. /grade/export/[newexport]/version.php - Use the current dates for your export module.  
 
# /grade/export/[newexport]/export.php
 
# /grade/export/[newexport]/grade_export_[newexport].php
 
# /grade/export/[newexport]/index.php
 
# /grade/export/[newexport]/version.php - Use the current dates for your export module.  


     $plugin->version  = 2007092700;
     $plugin->version  = 2007092700;
     $plugin->requires = 2007101000;
     $plugin->requires = 2007101000;


# /lang/en_utf8/gradeexport_[newexport].php - replace en_utf8 with your language directory if using multiple languages or a language other than English.
7. /lang/en_utf8/gradeexport_[newexport].php - replace en_utf8 with your language directory if using multiple languages or a language other than English.


The gradeexport_txt.php (Plain text file export) is shown below.  Change "Plain text file" to the name of the new export and replace "txt" with the [newexport] value.
The gradeexport_txt.php (Plain text file export) is shown below.  Change "Plain text file" to the name of the new export and replace "txt" with the [newexport] value.


  <?PHP  
    <?PHP  
  $string['modulename'] = 'Plain text file';
    $string['modulename'] = 'Plain text file';
  $string['txt:view'] = 'Use text grade export';
    $string['txt:view'] = 'Use text grade export';
  $string['txt:publish'] = 'Publish TXT grade export';
    $string['txt:publish'] = 'Publish TXT grade export';
  ?>
    ?>


== See also ==
== See also ==

Revision as of 17:13, 17 March 2010

Introduction

The Moodle 1.9 gradebook provides support for plug-in export modules. Moodle includes several export modules in the release. However, you may need the gradebook data formatted differently than the provided modules. Two primary uses for the gradebook export is to provide a teacher with a point in time copy of their gradebook and to extract student assessment data collected in Moodle so that it can be loaded into a different district software application without having to reenter that data.

Getting started

The gradebook export modules are located in the grade/export directory. To create a new gradebook export, create a new directory in grade/export and place the proper files into that directory. Find the export format most like what the developed export format and use those files as a starting point. Replace [newexport] below with the directory created for the new export format.

1. /grade/export/[newexport]/db/access.php - The Plain text file is shown below. Change each instance of "txt" to [newexport]

    <?php
    
    $gradeexport_txt_capabilities = array(
    
        'gradeexport/txt:view' => array(
            'riskbitmask' => RISK_PERSONAL,
            'captype' => 'read',
            'contextlevel' => CONTEXT_COURSE,
            'legacy' => array(
                'teacher' => CAP_ALLOW,
                'editingteacher' => CAP_ALLOW,
                'admin' => CAP_ALLOW
            )
        ),
    
        'gradeexport/txt:publish' => array(
            'riskbitmask' => RISK_PERSONAL,
            'captype' => 'read',
            'contextlevel' => CONTEXT_COURSE,
            'legacy' => array(
                 'admin' => CAP_ALLOW
            )
        )
    );
    
    ?>

2. /grade/export/[newexport]/dump.php

3. /grade/export/[newexport]/export.php

4. /grade/export/[newexport]/grade_export_[newexport].php

5. /grade/export/[newexport]/index.php

6. /grade/export/[newexport]/version.php - Use the current dates for your export module.

    $plugin->version  = 2007092700;
    $plugin->requires = 2007101000;

7. /lang/en_utf8/gradeexport_[newexport].php - replace en_utf8 with your language directory if using multiple languages or a language other than English.

The gradeexport_txt.php (Plain text file export) is shown below. Change "Plain text file" to the name of the new export and replace "txt" with the [newexport] value.

    <?PHP 
    $string['modulename'] = 'Plain text file';
    $string['txt:view'] = 'Use text grade export';
    $string['txt:publish'] = 'Publish TXT grade export';
    ?>

See also