ILIAS
release_5-2 Revision v5.2.25-18-g3f80b828510
|
Class ilTestArchiver. More...
Public Member Functions | |
getParticipantData () | |
setParticipantData ($participantData) | |
handInParticipantSubmission ($active_fi, $pass, $pdf_path, $html_string) | |
Hands in a participants test submission ("a completed test") for archiving. More... | |
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 ($html_string, $pdf_path) | |
Hands in the best solution for a test. More... | |
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... | |
handInTestResultsOverview ($html_string, $pdf_path) | |
Hands in a test results overview. 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 | PDF_SUBMISSION_FILENAME = 'test_submission.pdf' |
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 | PDF_BEST_SOLUTION_FILENAME = 'best_solution.pdf' |
const | TEST_MATERIALS_PATH_COMPONENT = 'materials' |
const | TEST_RESULT_FILENAME = 'test_result_v' |
const | TEST_RESULT_POSTFIX = '.pdf' |
const | TEST_OVERVIEW_PDF_FILENAME = 'results_overview_html_v' |
const | TEST_OVERVIEW_PDF_POSTFIX = '.pdf' |
const | TEST_OVERVIEW_HTML_FILENAME = 'results_overview_pdf_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 | |
$external_directory_path | |
$client_id | |
$test_obj_id | |
$archive_data_index | |
$ilDB | |
$participantData | |
Private Member Functions | |
buildPassDataDirectory ($active_fi, $pass) | |
Class ilTestArchiver.
Helper class to deal with the generation and maintenance of test archives.
Definition at line 15 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 698 of file class.ilTestArchiver.php.
References $pass, determinePassDataPath(), getTestArchive(), and readArchiveDataIndex().
Referenced by createPassMaterialsDirectory(), and getPassDataDirectory().
|
private |
Definition at line 491 of file class.ilTestArchiver.php.
References $pass, and getTestArchive().
Referenced by getPassDataDirectory().
ilTestArchiver::compressTestArchive | ( | ) |
Generate the test archive for download.
Definition at line 443 of file class.ilTestArchiver.php.
References ensureZipExportDirectoryExists(), getTestArchive(), getZipExportDirectory(), time, updateTestArchive(), and ilUtil\zip().
|
protected |
Returns the count of files in a directory, eventually matching the given, optional, pattern.
$directory | ||
null | string | $pattern |
PhpAssignmentInConditionInspection
Definition at line 774 of file class.ilTestArchiver.php.
Referenced by handInTestResult(), and handInTestResultsOverview().
|
protected |
Creates the directory for the test archive.
Definition at line 332 of file class.ilTestArchiver.php.
References getTestArchive(), and ilUtil\makeDirParents().
Referenced by ensureTestArchiveIsAvailable().
|
protected |
Creates pass data directory.
$active_fi | integer ActiveFI of the participant. |
$pass | integer Pass number of the test. |
Definition at line 485 of file class.ilTestArchiver.php.
References $pass, and getPassDataDirectory().
Referenced by ensurePassDataDirectoryIsAvailable().
|
protected |
Creates pass materials directory.
$active_fi | integer ActiveFI of the participant. |
$pass | integer Pass number of the test. |
Definition at line 594 of file class.ilTestArchiver.php.
References $ilUser, $pass, appendToArchiveDataIndex(), date, getParticipantData(), and getPassMaterialsDirectory().
Referenced by ensurePassMaterialsDirectoryIsAvailable().
|
protected |
Definition at line 422 of file class.ilTestArchiver.php.
References getZipExportDirectory().
Referenced by ensureZipExportDirectoryExists().
|
protected |
Determines the pass data path.
$date | |
$active_fi | |
$pass | |
$user_firstname | |
$user_lastname | |
$matriculation |
Definition at line 731 of file class.ilTestArchiver.php.
Referenced by appendToArchiveDataIndex().
|
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 555 of file class.ilTestArchiver.php.
References $pass, createPassDataDirectory(), and hasPassDataDirectory().
Referenced by handInParticipantMisc(), handInParticipantQuestionMaterial(), handInParticipantSubmission(), and handInTestResult().
|
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 643 of file class.ilTestArchiver.php.
References $pass, createPassMaterialsDirectory(), and hasPassMaterialsDirectory().
|
protected |
Ensures the availability of the test archive directory.
Checks if the directory exists and creates it if necessary.
Definition at line 357 of file class.ilTestArchiver.php.
References createArchiveForTest(), and hasTestArchive().
Referenced by handInBestSolutionQuestionMaterial(), handInParticipantMisc(), handInParticipantQuestionMaterial(), handInParticipantSubmission(), handInTestBestSolution(), handInTestResult(), and handInTestResultsOverview().
ilTestArchiver::ensureZipExportDirectoryExists | ( | ) |
Definition at line 404 of file class.ilTestArchiver.php.
References createZipExportDirectory(), and hasZipExportDirectory().
Referenced by compressTestArchive().
ilTestArchiver::getParticipantData | ( | ) |
Definition at line 116 of file class.ilTestArchiver.php.
References $participantData.
Referenced by createPassMaterialsDirectory(), and getPassDataDirectory().
|
protected |
Returns the pass data directory.
$active_fi | integer ActiveFI of the participant. |
$pass | integer Pass number of the test. |
Definition at line 513 of file class.ilTestArchiver.php.
References $ilUser, $pass, appendToArchiveDataIndex(), buildPassDataDirectory(), date, and getParticipantData().
Referenced by createPassDataDirectory(), handInParticipantMisc(), handInParticipantQuestionMaterial(), handInParticipantSubmission(), handInTestResult(), and hasPassDataDirectory().
|
protected |
Returns the pass materials directory.
$active_fi | integer ActiveFI of the participant. |
$pass | integer Pass number. |
Definition at line 628 of file class.ilTestArchiver.php.
References $pass.
Referenced by createPassMaterialsDirectory(), and hasPassMaterialsDirectory().
|
protected |
Returns the (theoretical) path to the archive directory of the test, this object is created for.
Definition at line 343 of file class.ilTestArchiver.php.
Referenced by appendToArchiveDataIndex(), buildPassDataDirectory(), compressTestArchive(), createArchiveForTest(), handInBestSolutionQuestionMaterial(), handInTestBestSolution(), handInTestResultsOverview(), hasTestArchive(), logArchivingProcess(), readArchiveDataIndex(), and updateTestArchive().
ilTestArchiver::getZipExportDirectory | ( | ) |
Return the export directory, where zips are placed.
Definition at line 432 of file class.ilTestArchiver.php.
References $test_obj_id.
Referenced by compressTestArchive(), createZipExportDirectory(), hasZipExportDirectory(), and ilTestExportGUI\listExportFiles().
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 244 of file class.ilTestArchiver.php.
References date, ensureTestArchiveIsAvailable(), getTestArchive(), and logArchivingProcess().
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 199 of file class.ilTestArchiver.php.
References $pass, date, ensurePassDataDirectoryIsAvailable(), ensureTestArchiveIsAvailable(), getPassDataDirectory(), and logArchivingProcess().
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 169 of file class.ilTestArchiver.php.
References $pass, date, ensurePassDataDirectoryIsAvailable(), ensureTestArchiveIsAvailable(), getPassDataDirectory(), and logArchivingProcess().
ilTestArchiver::handInParticipantSubmission | ( | $active_fi, | |
$pass, | |||
$pdf_path, | |||
$html_string | |||
) |
Hands in a participants test submission ("a completed test") for archiving.
The archive takes an html-string and a path to a PDF-file and saves it according to the archives general structure. The test is identified by active_fi and pass number, allowing to store relevant files even for anonymous tests.
$active_fi | integer Active-FI of the test participant |
$pass | integer Pass-number of the actual 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 143 of file class.ilTestArchiver.php.
References $pass, date, ensurePassDataDirectoryIsAvailable(), ensureTestArchiveIsAvailable(), getPassDataDirectory(), and logArchivingProcess().
ilTestArchiver::handInTestBestSolution | ( | $html_string, | |
$pdf_path | |||
) |
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 214 of file class.ilTestArchiver.php.
References date, ensureTestArchiveIsAvailable(), getTestArchive(), and logArchivingProcess().
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 282 of file class.ilTestArchiver.php.
References $pass, countFilesInDirectory(), date, ensurePassDataDirectoryIsAvailable(), ensureTestArchiveIsAvailable(), getPassDataDirectory(), and logArchivingProcess().
ilTestArchiver::handInTestResultsOverview | ( | $html_string, | |
$pdf_path | |||
) |
Hands in a test results overview.
$html_string | string HTML of the test results overview. |
$pdf_path | string Path |
Definition at line 299 of file class.ilTestArchiver.php.
References countFilesInDirectory(), date, ensureTestArchiveIsAvailable(), getTestArchive(), and logArchivingProcess().
|
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 471 of file class.ilTestArchiver.php.
References $pass, and getPassDataDirectory().
Referenced by ensurePassDataDirectoryIsAvailable().
|
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 576 of file class.ilTestArchiver.php.
References $pass, and getPassMaterialsDirectory().
Referenced by ensurePassMaterialsDirectoryIsAvailable().
|
protected |
Returns if the archive directory structure for the test the object is created for exists.
Definition at line 324 of file class.ilTestArchiver.php.
References getTestArchive().
Referenced by ensureTestArchiveIsAvailable().
ilTestArchiver::hasZipExportDirectory | ( | ) |
Returns if the export directory for zips exists.
Definition at line 417 of file class.ilTestArchiver.php.
References getZipExportDirectory().
Referenced by ensureZipExportDirectoryExists().
|
protected |
Logs to the archive log.
$message | string Complete log message. |
Definition at line 751 of file class.ilTestArchiver.php.
References getTestArchive().
Referenced by handInBestSolutionQuestionMaterial(), handInParticipantMisc(), handInParticipantQuestionMaterial(), handInParticipantSubmission(), handInTestBestSolution(), handInTestResult(), and handInTestResultsOverview().
|
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 658 of file class.ilTestArchiver.php.
References $contents, array, and getTestArchive().
Referenced by appendToArchiveDataIndex().
ilTestArchiver::setParticipantData | ( | $participantData | ) |
ilTestParticipantData | $participantData |
Definition at line 124 of file class.ilTestArchiver.php.
References $participantData.
Referenced by ilTestArchiveService\archiveActivesPass().
ilTestArchiver::updateTestArchive | ( | ) |
Replaces the test-log with the current one.
PhpAssignmentInConditionInspection
Definition at line 371 of file class.ilTestArchiver.php.
References $filename, $query, $result, $row, $test, array, ilDB\fetchAssoc(), ilTestPDFGenerator\generatePDF(), getTestArchive(), ilTestPDFGenerator\PDF_OUTPUT_FILE, ilDB\query(), and ilDB\quote().
Referenced by compressTestArchive().
|
protected |
Definition at line 83 of file class.ilTestArchiver.php.
|
protected |
Definition at line 81 of file class.ilTestArchiver.php.
|
protected |
Definition at line 80 of file class.ilTestArchiver.php.
|
protected |
Definition at line 85 of file class.ilTestArchiver.php.
|
protected |
Definition at line 90 of file class.ilTestArchiver.php.
Referenced by getParticipantData(), and setParticipantData().
|
protected |
Definition at line 82 of file class.ilTestArchiver.php.
Referenced by getZipExportDirectory().
const ilTestArchiver::ARCHIVE_LOG = 'archive.log' |
Definition at line 48 of file class.ilTestArchiver.php.
const ilTestArchiver::DATA_INDEX_FILENAME = 'data_index.csv' |
Definition at line 47 of file class.ilTestArchiver.php.
const ilTestArchiver::DIR_SEP = '/' |
Definition at line 19 of file class.ilTestArchiver.php.
Referenced by ilTestPlayerAbstractGUI\archiveParticipantSubmission().
const ilTestArchiver::EXPORT_DIRECTORY = 'archive_exports' |
Definition at line 50 of file class.ilTestArchiver.php.
const ilTestArchiver::HTML_BEST_SOLUTION_FILENAME = 'best_solution.html' |
Definition at line 27 of file class.ilTestArchiver.php.
const ilTestArchiver::HTML_SUBMISSION_FILENAME = 'test_submission.html' |
Definition at line 21 of file class.ilTestArchiver.php.
const ilTestArchiver::LOG_ADDITION_STRING = ' Adding ' |
Definition at line 41 of file class.ilTestArchiver.php.
const ilTestArchiver::LOG_CREATION_STRING = ' Creating ' |
Definition at line 42 of file class.ilTestArchiver.php.
const ilTestArchiver::LOG_DELETION_STRING = ' Deleting ' |
Definition at line 44 of file class.ilTestArchiver.php.
const ilTestArchiver::LOG_DTSGROUP_FORMAT = 'D M j G:i:s T Y' |
Definition at line 40 of file class.ilTestArchiver.php.
const ilTestArchiver::LOG_UPDATE_STRING = ' Updating ' |
Definition at line 43 of file class.ilTestArchiver.php.
const ilTestArchiver::PASS_MATERIALS_PATH_COMPONENT = 'materials' |
Definition at line 23 of file class.ilTestArchiver.php.
const ilTestArchiver::PDF_BEST_SOLUTION_FILENAME = 'best_solution.pdf' |
Definition at line 28 of file class.ilTestArchiver.php.
const ilTestArchiver::PDF_SUBMISSION_FILENAME = 'test_submission.pdf' |
Definition at line 22 of file class.ilTestArchiver.php.
const ilTestArchiver::QUESTION_PATH_COMPONENT_PREFIX = 'q_' |
Definition at line 24 of file class.ilTestArchiver.php.
const ilTestArchiver::TEST_BEST_SOLUTION_PATH_COMPONENT = 'best_solution' |
Definition at line 26 of file class.ilTestArchiver.php.
const ilTestArchiver::TEST_LOG_FILENAME = 'test.log' |
Definition at line 46 of file class.ilTestArchiver.php.
const ilTestArchiver::TEST_MATERIALS_PATH_COMPONENT = 'materials' |
Definition at line 29 of file class.ilTestArchiver.php.
const ilTestArchiver::TEST_OVERVIEW_HTML_FILENAME = 'results_overview_pdf_v' |
Definition at line 37 of file class.ilTestArchiver.php.
const ilTestArchiver::TEST_OVERVIEW_HTML_POSTFIX = '.html' |
Definition at line 38 of file class.ilTestArchiver.php.
const ilTestArchiver::TEST_OVERVIEW_PDF_FILENAME = 'results_overview_html_v' |
Definition at line 34 of file class.ilTestArchiver.php.
const ilTestArchiver::TEST_OVERVIEW_PDF_POSTFIX = '.pdf' |
Definition at line 35 of file class.ilTestArchiver.php.
const ilTestArchiver::TEST_RESULT_FILENAME = 'test_result_v' |
Definition at line 31 of file class.ilTestArchiver.php.
const ilTestArchiver::TEST_RESULT_POSTFIX = '.pdf' |
Definition at line 32 of file class.ilTestArchiver.php.