ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilTestArchiveService Class Reference
+ Collaboration diagram for ilTestArchiveService:

Public Member Functions

 __construct (private readonly ilObjTest $test_obj, private readonly ilLanguage $lng, private readonly ilDBInterface $db, private readonly ilObjUser $user, private readonly UIFactory $ui_factory, private readonly UIRenderer $ui_renderer, private readonly IRSS $irss, private readonly ServerRequestInterface $request, private readonly ilObjectDataCache $obj_cache, private readonly ilTestParticipantAccessFilterFactory $participant_access_filter_factory, private readonly ilTestHTMLGenerator $html_generator)
 
 getParticipantData ()
 
 setParticipantData (ilTestParticipantData $participantData)
 
 archivePassesByActives ($passesByActives)
 
 archiveActivesPass (int $active_id, int $pass)
 

Protected Attributes

ilTestParticipantData $participantData = null
 

Private Member Functions

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

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilTestArchiveService::__construct ( private readonly ilObjTest  $test_obj,
private readonly ilLanguage  $lng,
private readonly ilDBInterface  $db,
private readonly ilObjUser  $user,
private readonly UIFactory  $ui_factory,
private readonly UIRenderer  $ui_renderer,
private readonly IRSS  $irss,
private readonly ServerRequestInterface  $request,
private readonly ilObjectDataCache  $obj_cache,
private readonly ilTestParticipantAccessFilterFactory  $participant_access_filter_factory,
private readonly ilTestHTMLGenerator  $html_generator 
)

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

49 {
50 $this->participantData = null;
51 }

Member Function Documentation

◆ archiveActivesPass()

ilTestArchiveService::archiveActivesPass ( int  $active_id,
int  $pass 
)

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

72 : void
73 {
74 $content = $this->renderOverviewContent($active_id, $pass);
75 $filename = $this->buildOverviewFilename($active_id, $pass);
76 $this->html_generator->generateHTML($content, $filename);
77 $archiver = new ilTestArchiver(
78 $this->lng,
79 $this->db,
80 $this->user,
81 $this->ui_factory,
82 $this->ui_renderer,
83 $this->irss,
84 $this->request,
85 $this->obj_cache,
86 $this->participant_access_filter_factory,
87 $this->test_obj->getTestLogViewer(),
88 $this->test_obj->getId()
89 );
90 $archiver->setParticipantData($this->getParticipantData());
91 $archiver->handInTestResult($active_id, $pass, $filename);
92 $archiver->handInParticipantUploadedResults($active_id, $pass, $this->test_obj);
93 unlink($filename);
94 }
$filename
Definition: buildRTE.php:78
renderOverviewContent($activeId, $pass)
buildOverviewFilename($activeId, $pass)

References $filename, buildOverviewFilename(), getParticipantData(), ILIAS\Repository\lng(), renderOverviewContent(), and ILIAS\Repository\user().

Referenced by archivePassesByActives().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ archivePassesByActives()

ilTestArchiveService::archivePassesByActives (   $passesByActives)

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

63 : void
64 {
65 foreach ($passesByActives as $activeId => $passes) {
66 foreach ($passes as $pass) {
67 $this->archiveActivesPass($activeId, $pass);
68 }
69 }
70 }
archiveActivesPass(int $active_id, int $pass)

References archiveActivesPass().

+ Here is the call graph for this function:

◆ buildOverviewFilename()

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

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

131 : string
132 {
133 $tmpFileName = ilFileUtils::ilTempnam();
134 return dirname($tmpFileName) . '/scores-' . $this->test_obj->getId() . '-' . $activeId . '-' . $pass . '.html';
135 }
static ilTempnam(?string $a_temp_path=null)
Returns a unique and non existing Path for e temporary file or directory.

References ilFileUtils\ilTempnam().

Referenced by archiveActivesPass().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getParticipantData()

ilTestArchiveService::getParticipantData ( )

Definition at line 53 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 101 of file class.ilTestArchiveService.php.

101 : string
102 {
103 $results = $this->test_obj->getTestResult(
104 $activeId,
105 $pass,
106 false
107 );
108
109 $gui = new ilTestServiceGUI($this->test_obj);
110 $testResultHeaderLabelBuilder = new ResultsTitlesBuilder($this->lng, $this->obj_cache);
111
112 return $gui->getPassListOfAnswers(
113 $results,
114 $activeId,
115 $pass,
116 true,
117 false,
118 false,
119 true,
120 false,
121 null,
122 $testResultHeaderLabelBuilder
123 );
124 }
Service GUI class for tests.
$results

References $results, and ILIAS\Repository\lng().

Referenced by archiveActivesPass().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setParticipantData()

ilTestArchiveService::setParticipantData ( ilTestParticipantData  $participantData)

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

58 : void
59 {
60 $this->participantData = $participantData;
61 }

References $participantData.

Field Documentation

◆ $participantData

ilTestParticipantData ilTestArchiveService::$participantData = null
protected

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

Referenced by getParticipantData(), and setParticipantData().


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