ILIAS  release_7 Revision v7.30-3-g800a261c036
ilTestArchiveService Class Reference
+ Collaboration diagram for ilTestArchiveService:

Public Member Functions

 __construct (ilObjTest $testOBJ)
 
 getParticipantData ()
 
 setParticipantData (ilTestParticipantData $participantData)
 
 archivePassesByActives ($passesByActives)
 
 archiveActivesPass ($activeId, $pass)
 

Protected Attributes

 $testOBJ
 
 $participantData
 

Private Member Functions

 renderOverviewContent ($activeId, $pass)
 
 buildOverviewFilename ($activeId, $pass)
 

Detailed Description

Definition at line 14 of file class.ilTestArchiveService.php.

Constructor & Destructor Documentation

◆ __construct()

ilTestArchiveService::__construct ( ilObjTest  $testOBJ)

Definition at line 26 of file class.ilTestArchiveService.php.

References $testOBJ.

27  {
28  $this->testOBJ = $testOBJ;
29  $this->participantData = null;
30  }

Member Function Documentation

◆ archiveActivesPass()

ilTestArchiveService::archiveActivesPass (   $activeId,
  $pass 
)

Definition at line 57 of file class.ilTestArchiveService.php.

References $filename, $pass, buildOverviewFilename(), ilTestPDFGenerator\generatePDF(), getParticipantData(), ilTestPDFGenerator\PDF_OUTPUT_FILE, PDF_USER_RESULT, renderOverviewContent(), and ilTestArchiver\setParticipantData().

Referenced by archivePassesByActives().

58  {
59  $content = $this->renderOverviewContent($activeId, $pass);
60  $filename = $this->buildOverviewFilename($activeId, $pass);
62  $archiver = new ilTestArchiver($this->testOBJ->getId());
63  $archiver->setParticipantData($this->getParticipantData());
64  $archiver->handInTestResult($activeId, $pass, $filename);
65  unlink($filename);
66  }
renderOverviewContent($activeId, $pass)
const PDF_USER_RESULT
PDF Purposes.
$filename
Definition: buildRTE.php:89
Class ilTestArchiver.
static generatePDF($pdf_output, $output_mode, $filename=null, $purpose=null)
buildOverviewFilename($activeId, $pass)
setParticipantData($participantData)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ archivePassesByActives()

ilTestArchiveService::archivePassesByActives (   $passesByActives)

Definition at line 48 of file class.ilTestArchiveService.php.

References $pass, and archiveActivesPass().

49  {
50  foreach ($passesByActives as $activeId => $passes) {
51  foreach ($passes as $pass) {
52  $this->archiveActivesPass($activeId, $pass);
53  }
54  }
55  }
archiveActivesPass($activeId, $pass)
+ Here is the call graph for this function:

◆ buildOverviewFilename()

ilTestArchiveService::buildOverviewFilename (   $activeId,
  $pass 
)
private
Parameters
$activeId
$pass
Returns
string

Definition at line 105 of file class.ilTestArchiveService.php.

References $pass, and ilUtil\ilTempnam().

Referenced by archiveActivesPass().

106  {
107  $tmpFileName = ilUtil::ilTempnam();
108  return dirname($tmpFileName) . '/scores-' . $this->testOBJ->getId() . '-' . $activeId . '-' . $pass . '.pdf';
109  }
static ilTempnam($a_temp_path=null)
Returns a unique and non existing Path for e temporary file or directory.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getParticipantData()

ilTestArchiveService::getParticipantData ( )
Returns
ilTestParticipantData

Definition at line 35 of file class.ilTestArchiveService.php.

References $participantData.

Referenced by archiveActivesPass().

+ Here is the caller graph for this function:

◆ renderOverviewContent()

ilTestArchiveService::renderOverviewContent (   $activeId,
  $pass 
)
private
Parameters
$activeId
$pass
Returns
string

Definition at line 73 of file class.ilTestArchiveService.php.

References $GLOBALS, $pass, $results, and language().

Referenced by archiveActivesPass().

74  {
75  $results = $this->testOBJ->getTestResult(
76  $activeId,
77  $pass,
78  false
79  );
80 
81  $gui = new ilTestServiceGUI($this->testOBJ);
82 
83  require_once 'Modules/Test/classes/class.ilTestResultHeaderLabelBuilder.php';
84  $testResultHeaderLabelBuilder = new ilTestResultHeaderLabelBuilder($GLOBALS['DIC']->language(), $GLOBALS['DIC']['ilObjDataCache']);
85 
86  return $gui->getPassListOfAnswers(
87  $results,
88  $activeId,
89  $pass,
90  true,
91  false,
92  false,
93  true,
94  false,
95  null,
96  $testResultHeaderLabelBuilder
97  );
98  }
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
$results
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
language()
Definition: language.php:2
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setParticipantData()

ilTestArchiveService::setParticipantData ( ilTestParticipantData  $participantData)
Parameters
ilTestParticipantData$participantData

Definition at line 43 of file class.ilTestArchiveService.php.

References $participantData.

44  {
45  $this->participantData = $participantData;
46  }

Field Documentation

◆ $participantData

ilTestArchiveService::$participantData
protected

Definition at line 24 of file class.ilTestArchiveService.php.

Referenced by getParticipantData(), and setParticipantData().

◆ $testOBJ

ilTestArchiveService::$testOBJ
protected

Definition at line 19 of file class.ilTestArchiveService.php.

Referenced by __construct().


The documentation for this class was generated from the following file: