@@ -106,7 +106,7 @@ public function update_or_check_rubric(stdClass $newdefinition, $usermodified =
106
106
$ newdefinition ->options = json_encode ($ newdefinition ->rubric ['options ' ]);
107
107
$ editoroptions = self ::description_form_field_options ($ this ->get_context ());
108
108
$ newdefinition = file_postupdate_standard_editor ($ newdefinition , 'description ' , $ editoroptions , $ this ->get_context (),
109
- 'gradingform_rubric ' , 'definition_description ' , $ this ->definition ->id );
109
+ 'grading ' , 'description ' , $ this ->definition ->id );
110
110
111
111
// reload the definition from the database
112
112
$ currentdefinition = $ this ->get_definition (true );
@@ -353,7 +353,7 @@ public function get_definition_for_editing() {
353
353
}
354
354
$ options = self ::description_form_field_options ($ this ->get_context ());
355
355
$ properties = file_prepare_standard_editor ($ properties , 'description ' , $ options , $ this ->get_context (),
356
- 'gradingform_rubric ' , 'definition_description ' , $ definition ->id );
356
+ 'grading ' , 'description ' , $ definition ->id );
357
357
}
358
358
$ properties ->rubric = array ('criteria ' => array (), 'options ' => $ this ->get_options ());
359
359
if (!empty ($ definition ->rubric_criteria )) {
@@ -422,7 +422,7 @@ public function get_formatted_description() {
422
422
423
423
$ options = self ::description_form_field_options ($ this ->get_context ());
424
424
$ description = file_rewrite_pluginfile_urls ($ this ->definition ->description , 'pluginfile.php ' , $ context ->id ,
425
- 'gradingform_rubric ' , 'definition_description ' , $ this ->definition ->id , $ options );
425
+ 'grading ' , 'description ' , $ this ->definition ->id , $ options );
426
426
427
427
$ formatoptions = array (
428
428
'noclean ' => false ,
@@ -776,44 +776,3 @@ public function render_grading_element($page, $gradingformelement) {
776
776
return $ html ;
777
777
}
778
778
}
779
-
780
-
781
- /**
782
- * Processes file requests for the gradingform_rubric
783
- *
784
- * Required to serve files for this plugin
785
- * Called from pluginfile.php
786
- *
787
- * @global moodle_database $DB
788
- * @param stdClass $course
789
- * @param null $cm
790
- * @param stdClass $context
791
- * @param string $filearea
792
- * @param array $args
793
- * @param bool $forcedownload
794
- * @return void|false
795
- */
796
- function gradingform_rubric_pluginfile ($ course , $ cm , $ context , $ filearea , $ args , $ forcedownload ) {
797
- global $ CFG , $ DB ;
798
- // First argument should ALWAYS be the itemid
799
- $ itemid = (int )array_shift ($ args );
800
- // Construct a URL to the file and check it exists
801
- $ fs = get_file_storage ();
802
- $ relativepath = implode ('/ ' , $ args );
803
- $ fullpath = "/ $ context ->id /gradingform_rubric/ $ filearea/ $ itemid/ $ relativepath " ;
804
- if (!$ file = $ fs ->get_file_by_hash (sha1 ($ fullpath )) or $ file ->is_directory ()) {
805
- // File doesnt exist anyway no point proceeding.
806
- return false ;
807
- }
808
- // Switch by the fileare and check the appropriate information
809
- switch ($ filearea ) {
810
- case 'definition_description ' :
811
- // Make sure the itemid points to a valid definition
812
- if ($ DB ->record_exists ('grading_definitions ' , array ('id ' => $ itemid ))) {
813
- send_stored_file ($ file , 0 , 0 , $ forcedownload );
814
- }
815
- break ;
816
- }
817
- // Obviosly bogus comething or other in there
818
- return false ;
819
- }
0 commit comments