next up previous contents
Next: moodle nfs 掛載 Up: 其他小修改 Previous: Evaluation 使用注意事項   Contents

作業繳交與下載

  1. 為配合工程認證,上傳檔案數由原 20 個增大至 72 個。
    [root@moodle html]# diff -uN moodle23.bak/mod/assign/submission/file/locallib.php \
    moodle23/mod/assign/submission/file/locallib.php 
    --- moodle23.bak/mod/assign/submission/file/locallib.php	2013-01-25 16:32:08.000000000 +0800
    +++ moodle23/mod/assign/submission/file/locallib.php	2016-03-02 14:21:50.000000000 +0800
    @@ -31,7 +31,7 @@
     /**
      * File areas for file submission assignment
      */
    -define('ASSIGNSUBMISSION_FILE_MAXFILES', 20);
    +define('ASSIGNSUBMISSION_FILE_MAXFILES', 72);
     define('ASSIGNSUBMISSION_FILE_MAXSUMMARYFILES', 5);
     define('ASSIGNSUBMISSION_FILE_FILEAREA', 'submission_files');
    
  2. 下載所有作業時,若繳交的作業有建目錄,各目錄中的檔名相同,則下載時會被覆蓋。因此下載檔案的檔名加上目錄名稱。
    @@ -236,7 +236,9 @@
             $files = $fs->get_area_files($this->assignment->get_context()->id, 'assignsubmission_file', ASSIGNSUBMISSION_FILE_FILEAREA, $submission->id, "timemodified", false);
     
             foreach ($files as $file) {
    -            $result[$file->get_filename()] = $file;
    +            $filepath=str_replace('/','_',substr($file->get_filepath(),1));
    +            $result[$filepath . $file->get_filename()] = $file;
             }
             return $result;
         }
    



2018-08-14