You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
83 lines
1.9 KiB
83 lines
1.9 KiB
<?php
|
|
|
|
class TestExerciseResult extends UnitTestCase
|
|
{
|
|
public $eExerciseResult;
|
|
|
|
public function TestExerciseResult() {
|
|
$this->UnitTestCase('');
|
|
}
|
|
|
|
public function setUp() {
|
|
$this->eExerciseResult = new ExerciseResult();
|
|
}
|
|
|
|
public function tearDown() {
|
|
$this->eExerciseResult = null;
|
|
}
|
|
|
|
/**
|
|
* Gets the results of all students (or just one student if access is limited)
|
|
* @param string The document path (for HotPotatoes retrieval)
|
|
* @param integer User ID. Optional. If no user ID is provided, we take all the results. Defauts to null
|
|
*/
|
|
|
|
function test_getExercisesReporting() {
|
|
global $user_id;
|
|
$document_path = api_get_path(SYS_COURSE_PATH).'document/';
|
|
$res = $this->eExerciseResult->_getExercisesReporting($document_path,$user_id,$filter=0);
|
|
if(!is_null($res)) {
|
|
$this->assertTrue(is_bool($res));
|
|
}
|
|
//var_dump($res);
|
|
}
|
|
|
|
/**
|
|
* Exports the complete report as a CSV file
|
|
* @param string Document path inside the document tool
|
|
* @param integer Optional user ID
|
|
* @param boolean Whether to include user fields or not
|
|
* @return boolean False on error
|
|
*/
|
|
|
|
function testexportCompleteReportCSV() {
|
|
global $user_id;
|
|
$document_path = api_get_path(SYS_COURSE_PATH).'document/';
|
|
if(!headers_sent()){
|
|
$res = $this->eExerciseResult->exportCompleteReportCSV($document_path,$user_id, $export_user_fields = array(), $export_filter = 0);
|
|
}
|
|
if(!is_null($res)) {
|
|
$this->assertTrue(is_bool($res));
|
|
}
|
|
//var_dump($res);
|
|
}
|
|
|
|
/**
|
|
* Exports the complete report as an XLS file
|
|
* @return boolean False on error
|
|
*/
|
|
|
|
function testexportCompleteReportXLS() {
|
|
global $user_id;
|
|
$document_path = api_get_path(SYS_COURSE_PATH).'document/';
|
|
if(!headers_sent()){
|
|
$res = $this->eExerciseResult->exportCompleteReportXLS($document_path='',$user_id, $export_user_fields=array(), $export_filter = 0);
|
|
}
|
|
if(!is_null($res)) {
|
|
$this->assertTrue(is_bool($res));
|
|
}
|
|
//var_dump($res);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
?>
|
|
|