| 
    ILIAS
    release_9 Revision v9.13-25-g2c18ec4c24f
    
   | 
  
Class ilTestArchiver. More...
 Collaboration diagram for ilTestArchiver:Public Member Functions | |
| getParticipantData () | |
| setParticipantData ($participantData) | |
| handInParticipantQuestionMaterial ($active_fi, $pass, $question_fi, $original_filename, $file_path) | |
| Hands in a particpants question material, such as an upload or other binary content.  More... | |
| handInParticipantMisc ($active_fi, $pass, $original_filename, $file_path) | |
| Hands in a participants file, which is relevant for archiving but an unspecified type.  More... | |
| handInTestBestSolution ($best_solution) | |
| Hands in the best solution for a test.  More... | |
| handInParticipantUploadedResults ($active_fi, $pass, $tst_obj) | |
| handInBestSolutionQuestionMaterial ($question_fi, $orginial_filename, $file_path) | |
| Hands in a file related to a question in context of the best solution.  More... | |
| handInTestResult ($active_fi, $pass, $pdf_path) | |
| Hands in an individual test result for a pass.  More... | |
| updateTestArchive () | |
| Replaces the test-log with the current one.  More... | |
| ensureZipExportDirectoryExists () | |
| hasZipExportDirectory () | |
| Returns if the export directory for zips exists.  More... | |
| getZipExportDirectory () | |
| Return the export directory, where zips are placed.  More... | |
| compressTestArchive () | |
| Generate the test archive for download.  More... | |
Data Fields | |
| const | DIR_SEP = '/' | 
| const | HTML_SUBMISSION_FILENAME = 'test_submission.html' | 
| const | PASS_MATERIALS_PATH_COMPONENT = 'materials' | 
| const | QUESTION_PATH_COMPONENT_PREFIX = 'q_' | 
| const | TEST_BEST_SOLUTION_PATH_COMPONENT = 'best_solution' | 
| const | HTML_BEST_SOLUTION_FILENAME = 'best_solution.html' | 
| const | TEST_MATERIALS_PATH_COMPONENT = 'materials' | 
| const | TEST_OVERVIEW_HTML_FILENAME = 'results_overview_html_v' | 
| const | TEST_OVERVIEW_HTML_POSTFIX = '.html' | 
| const | LOG_DTSGROUP_FORMAT = 'D M j G:i:s T Y' | 
| const | LOG_ADDITION_STRING = ' Adding ' | 
| const | LOG_CREATION_STRING = ' Creating ' | 
| const | LOG_UPDATE_STRING = ' Updating ' | 
| const | LOG_DELETION_STRING = ' Deleting ' | 
| const | TEST_LOG_FILENAME = 'test.log' | 
| const | DATA_INDEX_FILENAME = 'data_index.csv' | 
| const | ARCHIVE_LOG = 'archive.log' | 
| const | EXPORT_DIRECTORY = 'archive_exports' | 
Protected Member Functions | |
| hasTestArchive () | |
| Returns if the archive directory structure for the test the object is created for exists.  More... | |
| createArchiveForTest () | |
| Creates the directory for the test archive.  More... | |
| getTestArchive () | |
| Returns the (theoretical) path to the archive directory of the test, this object is created for.  More... | |
| ensureTestArchiveIsAvailable () | |
| Ensures the availability of the test archive directory.  More... | |
| createZipExportDirectory () | |
| hasPassDataDirectory ($active_fi, $pass) | |
| Checks if the directory for pass data is available.  More... | |
| createPassDataDirectory ($active_fi, $pass) | |
| Creates pass data directory.  More... | |
| getPassDataDirectory ($active_fi, $pass) | |
| Returns the pass data directory.  More... | |
| ensurePassDataDirectoryIsAvailable ($active_fi, $pass) | |
| Ensures the availability of the participant data directory.  More... | |
| hasPassMaterialsDirectory ($active_fi, $pass) | |
| Returns if the pass materials directory exists for a given pass.  More... | |
| createPassMaterialsDirectory ($active_fi, $pass) | |
| Creates pass materials directory.  More... | |
| getPassMaterialsDirectory ($active_fi, $pass) | |
| Returns the pass materials directory.  More... | |
| ensurePassMaterialsDirectoryIsAvailable ($active_fi, $pass) | |
| Ensures the availability of the pass materials directory.  More... | |
| readArchiveDataIndex () | |
| Reads the archive data index.  More... | |
| appendToArchiveDataIndex ($date, $active_fi, $pass, $user_firstname, $user_lastname, $matriculation) | |
| Appends a line to the archive data index.  More... | |
| determinePassDataPath ($date, $active_fi, $pass, $user_firstname, $user_lastname, $matriculation) | |
| Determines the pass data path.  More... | |
| logArchivingProcess ($message) | |
| Logs to the archive log.  More... | |
| countFilesInDirectory ($directory, $pattern=null) | |
| Returns the count of files in a directory, eventually matching the given, optional, pattern.  More... | |
Protected Attributes | |
| const | TEST_RESULT_FILENAME = 'test_result.html' | 
| $external_directory_path | |
| $client_id | |
| $test_obj_id | |
| $test_ref_id | |
| $archive_data_index | |
| ilLanguage | $lng | 
| ilDBInterface | $db | 
| ilCtrl | $ctrl | 
| ilObjUser | $user | 
| ilTabsGUI | $tabs | 
| ilToolbarGUI | $toolbar | 
| ilGlobalTemplateInterface | $tpl | 
| UIFactory | $ui_factory | 
| UIRenderer | $ui_renderer | 
| ilAccess | $access | 
| InternalRequestService | $testrequest | 
| GlobalHttpState | $http | 
| RefineryFactory | $refinery | 
| ilTestHTMLGenerator | $html_generator | 
| $participantData | |
Private Member Functions | |
| buildPassDataDirectory ($active_fi, $pass) | |
Private Attributes | |
| ILIAS ResourceStorage Services | $irss | 
Class ilTestArchiver.
Helper class to deal with the generation and maintenance of test archives.
Definition at line 38 of file class.ilTestArchiver.php.
      
  | 
  protected | 
Appends a line to the archive data index.
| $date | string Date for the directories path. | 
| $active_fi | integer ActiveFI of the participant. | 
| $pass | integer Pass number of the participant. | 
| $user_firstname | string User firstname. | 
| $user_lastname | string User lastname. | 
| $matriculation | string Matriculation number of the user. | 
Definition at line 770 of file class.ilTestArchiver.php.
References determinePassDataPath(), getTestArchive(), and readArchiveDataIndex().
Referenced by createPassMaterialsDirectory(), and getPassDataDirectory().
 Here is the call graph for this function:
 Here is the caller graph for this function:
      
  | 
  private | 
Definition at line 556 of file class.ilTestArchiver.php.
References getTestArchive().
Referenced by getPassDataDirectory().
 Here is the call graph for this function:
 Here is the caller graph for this function:| ilTestArchiver::compressTestArchive | ( | ) | 
Generate the test archive for download.
Definition at line 508 of file class.ilTestArchiver.php.
References ensureZipExportDirectoryExists(), getTestArchive(), getZipExportDirectory(), updateTestArchive(), and ilFileUtils\zip().
 Here is the call graph for this function:
      
  | 
  protected | 
Returns the count of files in a directory, eventually matching the given, optional, pattern.
| $directory | ||
| null | string | $pattern | 
PhpAssignmentInConditionInspection
Definition at line 845 of file class.ilTestArchiver.php.
      
  | 
  protected | 
Creates the directory for the test archive.
Definition at line 381 of file class.ilTestArchiver.php.
References getTestArchive(), and ilFileUtils\makeDirParents().
Referenced by ensureTestArchiveIsAvailable().
 Here is the call graph for this function:
 Here is the caller graph for this function:
      
  | 
  protected | 
Creates pass data directory.
| $active_fi | integer ActiveFI of the participant. | 
| $pass | integer Pass number of the test. | 
Definition at line 550 of file class.ilTestArchiver.php.
References getPassDataDirectory().
Referenced by ensurePassDataDirectoryIsAvailable().
 Here is the call graph for this function:
 Here is the caller graph for this function:
      
  | 
  protected | 
Creates pass materials directory.
| $active_fi | integer ActiveFI of the participant. | 
| $pass | integer Pass number of the test. | 
Definition at line 662 of file class.ilTestArchiver.php.
References $user, appendToArchiveDataIndex(), ilObjUser\getFirstname(), ilObjUser\getLastname(), ilObjUser\getMatriculation(), getParticipantData(), getPassMaterialsDirectory(), ilObjUser\setFirstname(), ilObjUser\setLastname(), and ilObjUser\setMatriculation().
Referenced by ensurePassMaterialsDirectoryIsAvailable().
 Here is the call graph for this function:
 Here is the caller graph for this function:
      
  | 
  protected | 
Definition at line 487 of file class.ilTestArchiver.php.
References getZipExportDirectory().
Referenced by ensureZipExportDirectoryExists().
 Here is the call graph for this function:
 Here is the caller graph for this function:
      
  | 
  protected | 
Determines the pass data path.
| $date | |
| $active_fi | |
| $pass | |
| $user_firstname | |
| $user_lastname | |
| $matriculation | 
Definition at line 801 of file class.ilTestArchiver.php.
Referenced by appendToArchiveDataIndex().
 Here is the caller graph for this function:
      
  | 
  protected | 
Ensures the availability of the participant data directory.
Checks if the directory exists and creates it if necessary.
| $active_fi | integer Active-FI of the test participant | 
| $pass | integer Pass-number of the actual test | 
Definition at line 625 of file class.ilTestArchiver.php.
References createPassDataDirectory(), and hasPassDataDirectory().
Referenced by handInParticipantMisc(), handInParticipantQuestionMaterial(), handInParticipantUploadedResults(), and handInTestResult().
 Here is the call graph for this function:
 Here is the caller graph for this function:
      
  | 
  protected | 
Ensures the availability of the pass materials directory.
Checks if the directory exists and creates it if necessary.
| $active_fi | integer Active-FI of the test participant | 
| $pass | integer Pass-number of the actual test | 
Definition at line 714 of file class.ilTestArchiver.php.
References createPassMaterialsDirectory(), and hasPassMaterialsDirectory().
Referenced by handInParticipantUploadedResults().
 Here is the call graph for this function:
 Here is the caller graph for this function:
      
  | 
  protected | 
Ensures the availability of the test archive directory.
Checks if the directory exists and creates it if necessary.
Definition at line 406 of file class.ilTestArchiver.php.
References createArchiveForTest(), and hasTestArchive().
Referenced by handInBestSolutionQuestionMaterial(), handInParticipantMisc(), handInParticipantQuestionMaterial(), handInParticipantUploadedResults(), handInTestBestSolution(), and handInTestResult().
 Here is the call graph for this function:
 Here is the caller graph for this function:| ilTestArchiver::ensureZipExportDirectoryExists | ( | ) | 
Definition at line 470 of file class.ilTestArchiver.php.
References createZipExportDirectory(), and hasZipExportDirectory().
Referenced by compressTestArchive().
 Here is the call graph for this function:
 Here is the caller graph for this function:| ilTestArchiver::getParticipantData | ( | ) | 
Definition at line 164 of file class.ilTestArchiver.php.
References $participantData.
Referenced by createPassMaterialsDirectory(), and getPassDataDirectory().
 Here is the caller graph for this function:
      
  | 
  protected | 
Returns the pass data directory.
| $active_fi | integer ActiveFI of the participant. | 
| $pass | integer Pass number of the test. | 
Definition at line 576 of file class.ilTestArchiver.php.
References appendToArchiveDataIndex(), buildPassDataDirectory(), getParticipantData(), and ILIAS\Repository\user().
Referenced by createPassDataDirectory(), getPassMaterialsDirectory(), handInParticipantMisc(), handInParticipantQuestionMaterial(), handInTestResult(), and hasPassDataDirectory().
 Here is the call graph for this function:
 Here is the caller graph for this function:
      
  | 
  protected | 
Returns the pass materials directory.
| $active_fi | integer ActiveFI of the participant. | 
| $pass | integer Pass number. | 
Definition at line 699 of file class.ilTestArchiver.php.
References getPassDataDirectory().
Referenced by createPassMaterialsDirectory(), handInParticipantUploadedResults(), and hasPassMaterialsDirectory().
 Here is the call graph for this function:
 Here is the caller graph for this function:
      
  | 
  protected | 
Returns the (theoretical) path to the archive directory of the test, this object is created for.
Definition at line 392 of file class.ilTestArchiver.php.
References $test_obj_id.
Referenced by appendToArchiveDataIndex(), buildPassDataDirectory(), compressTestArchive(), createArchiveForTest(), handInBestSolutionQuestionMaterial(), handInTestBestSolution(), hasTestArchive(), logArchivingProcess(), readArchiveDataIndex(), and updateTestArchive().
 Here is the caller graph for this function:| ilTestArchiver::getZipExportDirectory | ( | ) | 
Return the export directory, where zips are placed.
Definition at line 497 of file class.ilTestArchiver.php.
References $test_obj_id.
Referenced by compressTestArchive(), createZipExportDirectory(), and hasZipExportDirectory().
 Here is the caller graph for this function:| ilTestArchiver::handInBestSolutionQuestionMaterial | ( | $question_fi, | |
| $orginial_filename, | |||
| $file_path | |||
| ) | 
Hands in a file related to a question in context of the best solution.
| $question_fi | integer QuestionFI of the question, material is to be stored for. | 
| $orginial_filename | string Original filename of the material to be stored. | 
| $file_path | string Path to the material to be stored. | 
Definition at line 318 of file class.ilTestArchiver.php.
References ensureTestArchiveIsAvailable(), getTestArchive(), and logArchivingProcess().
 Here is the call graph for this function:| ilTestArchiver::handInParticipantMisc | ( | $active_fi, | |
| $pass, | |||
| $original_filename, | |||
| $file_path | |||
| ) | 
Hands in a participants file, which is relevant for archiving but an unspecified type.
Examples for such are signature files, remarks, feedback or the like.
| $active_fi | integer Active-FI of the test participant | 
| $pass | integer Pass-number of the actual test | 
| $original_filename | string Original filename of the material to be stored. | 
| $file_path | string Location of the file to be archived | 
Definition at line 217 of file class.ilTestArchiver.php.
References ensurePassDataDirectoryIsAvailable(), ensureTestArchiveIsAvailable(), getPassDataDirectory(), and logArchivingProcess().
 Here is the call graph for this function:| ilTestArchiver::handInParticipantQuestionMaterial | ( | $active_fi, | |
| $pass, | |||
| $question_fi, | |||
| $original_filename, | |||
| $file_path | |||
| ) | 
Hands in a particpants question material, such as an upload or other binary content.
| $active_fi | integer Active-FI of the test participant | 
| $pass | integer Pass-number of the actual test | 
| $question_fi | integer Question-FI of the question, the file is to be stored for. | 
| $original_filename | string Original filename of the material to be stored. | 
| $file_path | string Location of the file to be archived | 
Definition at line 188 of file class.ilTestArchiver.php.
References ensurePassDataDirectoryIsAvailable(), ensureTestArchiveIsAvailable(), getPassDataDirectory(), and logArchivingProcess().
 Here is the call graph for this function:| ilTestArchiver::handInParticipantUploadedResults | ( | $active_fi, | |
| $pass, | |||
| $tst_obj | |||
| ) | 
| $active_fi | |
| $pass | 
Definition at line 261 of file class.ilTestArchiver.php.
References CLIENT_WEB_DIR, ensurePassDataDirectoryIsAvailable(), ensurePassMaterialsDirectoryIsAvailable(), ensureTestArchiveIsAvailable(), getPassMaterialsDirectory(), and logArchivingProcess().
 Here is the call graph for this function:| ilTestArchiver::handInTestBestSolution | ( | $best_solution | ) | 
Hands in the best solution for a test.
| $html_string | string HTML-string of the test submission | 
| $pdf_path | string Path to a pdf representation of the test submission. | 
Definition at line 232 of file class.ilTestArchiver.php.
References ensureTestArchiveIsAvailable(), getTestArchive(), and logArchivingProcess().
 Here is the call graph for this function:| ilTestArchiver::handInTestResult | ( | $active_fi, | |
| $pass, | |||
| $pdf_path | |||
| ) | 
Hands in an individual test result for a pass.
| $active_fi | integer ActiveFI of the participant. | 
| $pass | integer Pass of the test. | 
| $pdf_path | string Path to the PDF containing the result. | 
Definition at line 354 of file class.ilTestArchiver.php.
References ensurePassDataDirectoryIsAvailable(), ensureTestArchiveIsAvailable(), getPassDataDirectory(), and logArchivingProcess().
 Here is the call graph for this function:
      
  | 
  protected | 
Checks if the directory for pass data is available.
| $active_fi | integer ActiveFI of the pass. | 
| $pass | integer Pass-number of the pass. | 
Definition at line 536 of file class.ilTestArchiver.php.
References getPassDataDirectory().
Referenced by ensurePassDataDirectoryIsAvailable().
 Here is the call graph for this function:
 Here is the caller graph for this function:
      
  | 
  protected | 
Returns if the pass materials directory exists for a given pass.
| $active_fi | integer ActiveFI for the participant. | 
| $pass | integer Pass number. | 
PhpUsageOfSilenceOperatorInspection
Definition at line 645 of file class.ilTestArchiver.php.
References getPassMaterialsDirectory().
Referenced by ensurePassMaterialsDirectoryIsAvailable().
 Here is the call graph for this function:
 Here is the caller graph for this function:
      
  | 
  protected | 
Returns if the archive directory structure for the test the object is created for exists.
Definition at line 373 of file class.ilTestArchiver.php.
References getTestArchive().
Referenced by ensureTestArchiveIsAvailable().
 Here is the call graph for this function:
 Here is the caller graph for this function:| ilTestArchiver::hasZipExportDirectory | ( | ) | 
Returns if the export directory for zips exists.
Definition at line 482 of file class.ilTestArchiver.php.
References getZipExportDirectory().
Referenced by ensureZipExportDirectoryExists().
 Here is the call graph for this function:
 Here is the caller graph for this function:
      
  | 
  protected | 
Logs to the archive log.
| $message | string Complete log message. | 
Definition at line 825 of file class.ilTestArchiver.php.
References $message, and getTestArchive().
Referenced by handInBestSolutionQuestionMaterial(), handInParticipantMisc(), handInParticipantQuestionMaterial(), handInParticipantUploadedResults(), handInTestBestSolution(), and handInTestResult().
 Here is the call graph for this function:
 Here is the caller graph for this function:
      
  | 
  protected | 
Reads the archive data index.
The Archive Data Index is a csv-file containing the following columns <active_fi>|<pass>|<yyyy>|<mm>||<directory>
PhpUsageOfSilenceOperatorInspection
Definition at line 728 of file class.ilTestArchiver.php.
References getTestArchive().
Referenced by appendToArchiveDataIndex().
 Here is the call graph for this function:
 Here is the caller graph for this function:| ilTestArchiver::setParticipantData | ( | $participantData | ) | 
| ilTestParticipantData | $participantData | 
Definition at line 172 of file class.ilTestArchiver.php.
References $participantData.
Referenced by ilTestArchiveService\archiveActivesPass().
 Here is the caller graph for this function:| ilTestArchiver::updateTestArchive | ( | ) | 
Replaces the test-log with the current one.
PhpAssignmentInConditionInspection
Definition at line 419 of file class.ilTestArchiver.php.
References $filename, ILIAS\LTI\ToolProvider\$key, ILIAS\Repository\access(), ILIAS\Repository\ctrl(), getTestArchive(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), ILIAS\Repository\tabs(), ILIAS\Repository\toolbar(), and ILIAS\Repository\user().
Referenced by compressTestArchive().
 Here is the call graph for this function:
 Here is the caller graph for this function:
      
  | 
  protected | 
Definition at line 112 of file class.ilTestArchiver.php.
      
  | 
  protected | 
Definition at line 101 of file class.ilTestArchiver.php.
      
  | 
  protected | 
Definition at line 98 of file class.ilTestArchiver.php.
      
  | 
  protected | 
Definition at line 105 of file class.ilTestArchiver.php.
      
  | 
  protected | 
Definition at line 104 of file class.ilTestArchiver.php.
      
  | 
  protected | 
Definition at line 97 of file class.ilTestArchiver.php.
      
  | 
  protected | 
Definition at line 117 of file class.ilTestArchiver.php.
      
  | 
  protected | 
Definition at line 114 of file class.ilTestArchiver.php.
      
  | 
  private | 
Definition at line 124 of file class.ilTestArchiver.php.
      
  | 
  protected | 
Definition at line 103 of file class.ilTestArchiver.php.
      
  | 
  protected | 
Definition at line 122 of file class.ilTestArchiver.php.
Referenced by getParticipantData(), and setParticipantData().
      
  | 
  protected | 
Definition at line 115 of file class.ilTestArchiver.php.
      
  | 
  protected | 
Definition at line 107 of file class.ilTestArchiver.php.
      
  | 
  protected | 
Definition at line 99 of file class.ilTestArchiver.php.
Referenced by getTestArchive(), and getZipExportDirectory().
      
  | 
  protected | 
Definition at line 100 of file class.ilTestArchiver.php.
      
  | 
  protected | 
Definition at line 113 of file class.ilTestArchiver.php.
      
  | 
  protected | 
Definition at line 108 of file class.ilTestArchiver.php.
      
  | 
  protected | 
Definition at line 109 of file class.ilTestArchiver.php.
      
  | 
  protected | 
Definition at line 110 of file class.ilTestArchiver.php.
      
  | 
  protected | 
Definition at line 111 of file class.ilTestArchiver.php.
      
  | 
  protected | 
Definition at line 106 of file class.ilTestArchiver.php.
Referenced by createPassMaterialsDirectory().
| const ilTestArchiver::ARCHIVE_LOG = 'archive.log' | 
Definition at line 65 of file class.ilTestArchiver.php.
| const ilTestArchiver::DATA_INDEX_FILENAME = 'data_index.csv' | 
Definition at line 64 of file class.ilTestArchiver.php.
| const ilTestArchiver::DIR_SEP = '/' | 
Definition at line 42 of file class.ilTestArchiver.php.
| const ilTestArchiver::EXPORT_DIRECTORY = 'archive_exports' | 
Definition at line 67 of file class.ilTestArchiver.php.
| const ilTestArchiver::HTML_BEST_SOLUTION_FILENAME = 'best_solution.html' | 
Definition at line 49 of file class.ilTestArchiver.php.
| const ilTestArchiver::HTML_SUBMISSION_FILENAME = 'test_submission.html' | 
Definition at line 44 of file class.ilTestArchiver.php.
| const ilTestArchiver::LOG_ADDITION_STRING = ' Adding ' | 
Definition at line 58 of file class.ilTestArchiver.php.
| const ilTestArchiver::LOG_CREATION_STRING = ' Creating ' | 
Definition at line 59 of file class.ilTestArchiver.php.
| const ilTestArchiver::LOG_DELETION_STRING = ' Deleting ' | 
Definition at line 61 of file class.ilTestArchiver.php.
| const ilTestArchiver::LOG_DTSGROUP_FORMAT = 'D M j G:i:s T Y' | 
Definition at line 57 of file class.ilTestArchiver.php.
| const ilTestArchiver::LOG_UPDATE_STRING = ' Updating ' | 
Definition at line 60 of file class.ilTestArchiver.php.
| const ilTestArchiver::PASS_MATERIALS_PATH_COMPONENT = 'materials' | 
Definition at line 45 of file class.ilTestArchiver.php.
| const ilTestArchiver::QUESTION_PATH_COMPONENT_PREFIX = 'q_' | 
Definition at line 46 of file class.ilTestArchiver.php.
| const ilTestArchiver::TEST_BEST_SOLUTION_PATH_COMPONENT = 'best_solution' | 
Definition at line 48 of file class.ilTestArchiver.php.
| const ilTestArchiver::TEST_LOG_FILENAME = 'test.log' | 
Definition at line 63 of file class.ilTestArchiver.php.
| const ilTestArchiver::TEST_MATERIALS_PATH_COMPONENT = 'materials' | 
Definition at line 50 of file class.ilTestArchiver.php.
| const ilTestArchiver::TEST_OVERVIEW_HTML_FILENAME = 'results_overview_html_v' | 
Definition at line 54 of file class.ilTestArchiver.php.
| const ilTestArchiver::TEST_OVERVIEW_HTML_POSTFIX = '.html' | 
Definition at line 55 of file class.ilTestArchiver.php.
      
  | 
  protected | 
Definition at line 52 of file class.ilTestArchiver.php.