ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilTestArchiveService Class Reference
+ Collaboration diagram for ilTestArchiveService:

Public Member Functions

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

Protected Attributes

 $testOBJ
 
 $participantData
 
 $considerHiddenQuestionsEnabled
 
 $testResultHeaderLabelBuilder
 

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 36 of file class.ilTestArchiveService.php.

References $lng, and $testOBJ.

37  {
38  global $ilObjDataCache, $lng;
39 
40  $this->testOBJ = $testOBJ;
41  $this->participantData = null;
42 
43  $this->considerHiddenQuestionsEnabled = true;
44 
45  require_once 'Modules/Test/classes/class.ilTestResultHeaderLabelBuilder.php';
46  $this->testResultHeaderLabelBuilder = new ilTestResultHeaderLabelBuilder($lng, $ilObjDataCache);
47  }
global $lng
Definition: privfeed.php:40

Member Function Documentation

◆ archiveActivesPass()

ilTestArchiveService::archiveActivesPass (   $activeId,
  $pass 
)

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

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

Referenced by archivePassesByActives().

87  {
88  $content = $this->renderOverviewContent($activeId, $pass);
89  $filename = $this->buildOverviewFilename($activeId, $pass);
90 
92 
93  $archiver = new ilTestArchiver($this->testOBJ->getId());
94  $archiver->setParticipantData($this->getParticipantData());
95  $archiver->handInTestResult($activeId, $pass, $filename);
96 
97  unlink($filename);
98  }
renderOverviewContent($activeId, $pass)
$filename
Definition: buildRTE.php:89
Class ilTestArchiver.
static generatePDF($pdf_output, $output_mode, $filename=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 75 of file class.ilTestArchiveService.php.

References $pass, and archiveActivesPass().

76  {
77  foreach($passesByActives as $activeId => $passes)
78  {
79  foreach($passes as $pass)
80  {
81  $this->archiveActivesPass($activeId, $pass);
82  }
83  }
84  }
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 123 of file class.ilTestArchiveService.php.

References $pass, and ilUtil\ilTempnam().

Referenced by archiveActivesPass().

124  {
125  $tmpFileName = ilUtil::ilTempnam();
126  return dirname($tmpFileName).'/scores-'.$this->testOBJ->getId().'-'.$activeId.'-'.$pass.'.pdf';
127  }
static ilTempnam($a_temp_path=null)
Create a temporary file in an ILIAS writable 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 52 of file class.ilTestArchiveService.php.

References $participantData.

Referenced by archiveActivesPass().

+ Here is the caller graph for this function:

◆ isConsiderHiddenQuestionsEnabled()

ilTestArchiveService::isConsiderHiddenQuestionsEnabled ( )

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

References $considerHiddenQuestionsEnabled.

Referenced by renderOverviewContent().

+ Here is the caller graph for this function:

◆ renderOverviewContent()

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

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

References $pass, $results, and isConsiderHiddenQuestionsEnabled().

Referenced by archiveActivesPass().

106  {
107  $results = $this->testOBJ->getTestResult(
108  $activeId, $pass, false, $this->isConsiderHiddenQuestionsEnabled()
109  );
110 
111  $gui = new ilTestServiceGUI($this->testOBJ);
112 
113  return $gui->getPassListOfAnswers(
114  $results, $activeId, $pass, true, false, false, true, false, null, $this->testResultHeaderLabelBuilder
115  );
116  }
$results
Service GUI class for tests.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setConsiderHiddenQuestionsEnabled()

ilTestArchiveService::setConsiderHiddenQuestionsEnabled (   $considerHiddenQuestionsEnabled)

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

References $considerHiddenQuestionsEnabled.

71  {
72  $this->considerHiddenQuestionsEnabled = $considerHiddenQuestionsEnabled;
73  }

◆ setParticipantData()

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

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

References $participantData.

61  {
62  $this->participantData = $participantData;
63  }

Field Documentation

◆ $considerHiddenQuestionsEnabled

ilTestArchiveService::$considerHiddenQuestionsEnabled
protected

◆ $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().

◆ $testResultHeaderLabelBuilder

ilTestArchiveService::$testResultHeaderLabelBuilder
protected

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


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