2007-04-16 23:10:08 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
class testData_queue
|
|
|
|
|
{
|
|
|
|
|
var $oTestData;
|
|
|
|
|
var $oDistribution;
|
|
|
|
|
|
2007-06-10 18:51:33 +00:00
|
|
|
function testData_queue($iTestId = null, $oRow = null)
|
2007-04-16 23:10:08 +00:00
|
|
|
{
|
2007-06-10 18:51:33 +00:00
|
|
|
$this->oTestData = new testData($iTestId, $oRow);
|
2007-04-16 23:10:08 +00:00
|
|
|
$this->oDistribution = new distribution($this->oTestData->iDistributionId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function create()
|
|
|
|
|
{
|
|
|
|
|
if(!$this->oTestData->iDistributionId)
|
|
|
|
|
{
|
|
|
|
|
$this->oDistribution->create();
|
|
|
|
|
$this->oTestData->iDistributionId = $this->oDistribution->iDistributionId;
|
|
|
|
|
}
|
2007-04-21 01:02:10 +00:00
|
|
|
|
2007-04-19 23:19:24 +00:00
|
|
|
return $this->oTestData->create();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function delete()
|
|
|
|
|
{
|
2007-04-27 23:45:19 +00:00
|
|
|
$bSuccess = $this->oTestData->delete();
|
|
|
|
|
|
|
|
|
|
/* We delete the distribution if it has not been approved and is not associated
|
|
|
|
|
with any other testData. Otherwise we would have to have a distribution
|
|
|
|
|
queue for admins to clean up unused, queued entries */
|
|
|
|
|
$this->oDistribution = new distribution($this->oDistribution->iDistributionId);
|
|
|
|
|
if(!sizeof($this->oDistribution->aTestingIds) &&
|
|
|
|
|
$this->oDistribution->sQueued != "false")
|
|
|
|
|
$this->oDistribution->delete();
|
|
|
|
|
|
|
|
|
|
return $bSuccess;
|
2007-04-19 23:19:24 +00:00
|
|
|
}
|
|
|
|
|
|
2007-04-21 01:02:10 +00:00
|
|
|
function reQueue()
|
|
|
|
|
{
|
|
|
|
|
$this->oTestData->reQueue();
|
|
|
|
|
if($this->oDistribution->sQueued == "rejected")
|
|
|
|
|
$this->oDistribution->reQueue();
|
|
|
|
|
}
|
|
|
|
|
|
2007-04-19 23:19:24 +00:00
|
|
|
function unQueue()
|
|
|
|
|
{
|
|
|
|
|
$this->oTestData->unQueue();
|
2007-04-21 18:22:14 +00:00
|
|
|
|
|
|
|
|
/* Avoid a misguiding message about the distribution being unqueued */
|
|
|
|
|
if($this->oDistribution->sQueued != "false")
|
|
|
|
|
$this->oDistribution->unQueue();
|
2007-04-16 23:10:08 +00:00
|
|
|
}
|
|
|
|
|
|
2007-04-21 01:02:10 +00:00
|
|
|
function reject()
|
|
|
|
|
{
|
|
|
|
|
$this->oTestData->reject();
|
|
|
|
|
}
|
|
|
|
|
|
2007-04-16 23:10:08 +00:00
|
|
|
function update()
|
|
|
|
|
{
|
|
|
|
|
$this->oTestData->update();
|
2007-04-21 18:22:14 +00:00
|
|
|
|
|
|
|
|
/* If the distribution was already un-queued the form for editing it would
|
|
|
|
|
not have been displayed and getOutputEditorValues() wouldn't have
|
|
|
|
|
retrieved a valid sName for the distribution. If sName isn't valid
|
|
|
|
|
we shouldn't update the distribution */
|
|
|
|
|
if($this->oDistribution->sName)
|
|
|
|
|
$this->oDistribution->update();
|
2007-04-16 23:10:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function outputEditor()
|
|
|
|
|
{
|
|
|
|
|
$this->oTestData->outputEditor();
|
|
|
|
|
|
2007-04-21 01:02:10 +00:00
|
|
|
/* If we are processing queued test results with a queued distribution,
|
|
|
|
|
we display some additional help here */
|
2007-04-23 23:39:44 +00:00
|
|
|
if($this->oDistribution->iDistributionId &&
|
|
|
|
|
$this->oDistribution->sQueued != "false" && $this->canEdit())
|
2007-04-19 23:19:24 +00:00
|
|
|
{
|
2007-04-21 01:02:10 +00:00
|
|
|
echo "The user submitted a new distribution, which will be un-queued ".
|
|
|
|
|
"together with the test data unless you select an existing one ".
|
|
|
|
|
"from the list above.";
|
2007-04-19 23:19:24 +00:00
|
|
|
}
|
|
|
|
|
|
2007-04-21 01:02:10 +00:00
|
|
|
/* If the testData is already associated with a distribution and the
|
|
|
|
|
distribution is un-queued, there is no need to display the
|
|
|
|
|
distribution form here */
|
|
|
|
|
if(!$this->oTestData->iDistributionId or
|
|
|
|
|
$this->oDistribution->sQueued != "false")
|
2007-04-23 23:39:44 +00:00
|
|
|
{
|
|
|
|
|
echo html_frame_start("New Distribution", "90%");
|
2007-04-16 23:10:08 +00:00
|
|
|
$this->oDistribution->outputEditor();
|
2007-04-23 23:39:44 +00:00
|
|
|
echo html_frame_end();
|
|
|
|
|
}
|
2007-04-16 23:10:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function getOutputEditorValues($aClean)
|
|
|
|
|
{
|
|
|
|
|
$this->oTestData->getOutputEditorValues($aClean);
|
|
|
|
|
$this->oDistribution->getOutputEditorValues($aClean);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function checkOutputEditorInput($aClean)
|
|
|
|
|
{
|
|
|
|
|
return $this->oTestData->checkOutputEditorInput($aClean);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function canEdit()
|
|
|
|
|
{
|
|
|
|
|
return $this->oTestData->canEdit();
|
|
|
|
|
}
|
|
|
|
|
|
2007-04-22 00:39:53 +00:00
|
|
|
function mustBeQueued()
|
|
|
|
|
{
|
|
|
|
|
return $this->oTestData->mustBeQueued();
|
|
|
|
|
}
|
|
|
|
|
|
2007-04-16 23:10:08 +00:00
|
|
|
function objectDisplayAddItemHelp()
|
|
|
|
|
{
|
|
|
|
|
$this->oTestData->objectDisplayAddItemHelp();
|
|
|
|
|
}
|
2007-04-19 23:19:24 +00:00
|
|
|
|
2007-06-12 00:02:41 +00:00
|
|
|
function objectGetEntries($bQueued, $bRejected, $iRows = 0, $iStart = 0, $sOrderBy = "testingId")
|
2007-04-19 23:19:24 +00:00
|
|
|
{
|
2007-06-12 00:02:41 +00:00
|
|
|
return $this->oTestData->objectGetEntries($bQueued, $bRejected, $iRows, $iStart, $sOrderBy);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function objectGetEntriesCount($bQueued, $bRejected)
|
|
|
|
|
{
|
|
|
|
|
return testData::objectGetEntriesCount($bQueued, $bRejected);
|
2007-04-19 23:19:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function objectGetHeader()
|
|
|
|
|
{
|
|
|
|
|
return $this->oTestData->objectGetHeader();
|
|
|
|
|
}
|
|
|
|
|
|
2007-06-14 00:50:35 +00:00
|
|
|
function objectGetTableRow()
|
2007-04-19 23:19:24 +00:00
|
|
|
{
|
2007-06-14 00:50:35 +00:00
|
|
|
return $this->oTestData->objectGetTableRow();
|
2007-04-19 23:19:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function objectDisplayQueueProcessingHelp()
|
|
|
|
|
{
|
|
|
|
|
$oTest = new testData();
|
2007-06-14 00:50:35 +00:00
|
|
|
$oTest->objectDisplayQueueProcessingHelp();
|
2007-04-19 23:19:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function display()
|
|
|
|
|
{
|
2007-06-14 00:50:35 +00:00
|
|
|
return $this->oTestData->display();
|
2007-04-19 23:19:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function objectMakeUrl()
|
|
|
|
|
{
|
2007-06-14 00:50:35 +00:00
|
|
|
return $this->oTestData->objectMakeUrl();
|
2007-04-19 23:19:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function objectMakeLink()
|
|
|
|
|
{
|
2007-06-14 00:50:35 +00:00
|
|
|
return $this->oTestData->objectMakeLink();
|
2007-04-19 23:19:24 +00:00
|
|
|
}
|
2007-04-29 23:00:01 +00:00
|
|
|
|
|
|
|
|
function allowAnonymousSubmissions()
|
|
|
|
|
{
|
|
|
|
|
return testData::allowAnonymousSubmissions();
|
|
|
|
|
}
|
2007-06-12 00:02:41 +00:00
|
|
|
|
|
|
|
|
function objectGetItemsPerPage($bQueued = false)
|
|
|
|
|
{
|
|
|
|
|
return testData::objectGetItemsPerPage($bQueued);
|
|
|
|
|
}
|
2007-06-14 00:50:35 +00:00
|
|
|
|
|
|
|
|
function objectGetId()
|
|
|
|
|
{
|
|
|
|
|
return $this->oTestData->objectGetId();
|
|
|
|
|
}
|
2007-04-16 23:10:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
?>
|