function writePrePostRow($pptest) { //--------------------------------------------------------------------- // //--------------------------------------------------------------------- $lPPTestID = $pptest->lKeyID; $bHidden = $pptest->bHidden; $bPublished = $pptest->bPublished; if ($bHidden) { $strHideStyle = 'color: #999; font-style: italic;'; } else { $strHideStyle = ''; } echoT(' <tr class="makeStripe"> <td class="enpRpt" style="text-align: center;' . $strHideStyle . '" nowrap>' . str_pad($lPPTestID, 5, '0', STR_PAD_LEFT) . ' ' . strLinkView_CPPTestView($lPPTestID, 'View pre/post test record', true) . ' </td> <td class="enpRpt" style="width: 130pt;' . $strHideStyle . '">' . htmlspecialchars($pptest->strTestName) . ' </td> <td class="enpRpt" style="width: 190pt;' . $strHideStyle . '">' . nl2br(htmlspecialchars($pptest->strDescription)) . ' </td> <td class="enpRpt" style="text-align: center;' . $strHideStyle . '">' . $pptest->lNumQuest . ' ' . strLinkView_CPPQuestions($lPPTestID, 'View Questions', true) . ' </td> <td class="enpRpt" nowrap style="' . $strHideStyle . '"> Visibility: ' . ($bHidden ? 'Hidden' : 'Visible') . '<br> Published: ' . ($bPublished ? 'Yes' : 'No') . '<br> </td> </tr>'); }
function showPrePostTest(&$crpt, $lPPTestID, &$pptest, $lNumQuests) { //--------------------------------------------------------------------- // //--------------------------------------------------------------------- $bPublished = $pptest->bPublished; if ($bPublished) { $strLinkEdit = ''; $strLinkAddQues = ''; } else { $strLinkEdit = strLinkEdit_CPPTest($lPPTestID, 'Edit pre/post test', true) . ' ' . strLinkEdit_CPPTest($lPPTestID, 'Edit pre/post test', false) . ' ' . strLinkRem_CPPTest($lPPTestID, 'Remove pre/post test', true, true); $strLinkAddQues = ' ' . strLinkAdd_CPPQuestion($lPPTestID, 'Add question', true) . ' ' . strLinkAdd_CPPQuestion($lPPTestID, 'Add question', false); } if ($lNumQuests > 0) { $strLinkViewQuest = strLinkView_CPPQuestions($lPPTestID, 'View questions associated with this test', true); } else { $strLinkViewQuest = ''; } openBlock('Client Pre/Post Test', $strLinkEdit); echoT($crpt->openReport() . $crpt->openRow() . $crpt->writeLabel('Pre/Post Test ID:') . $crpt->writeCell(str_pad($lPPTestID, 5, '0', STR_PAD_LEFT)) . $crpt->closeRow() . $crpt->openRow() . $crpt->writeLabel('Category:') . $crpt->writeCell(htmlspecialchars($pptest->strPPTestCat)) . $crpt->closeRow() . $crpt->openRow() . $crpt->writeLabel('Test Name:') . $crpt->writeCell(htmlspecialchars($pptest->strTestName)) . $crpt->closeRow()); //------------------ // description //------------------ echoT($crpt->openRow() . $crpt->writeLabel('Description:') . $crpt->writeCell(nl2br(htmlspecialchars($pptest->strDescription))) . $crpt->closeRow()); //------------------ // # of Questions //------------------ echoT($crpt->openRow() . $crpt->writeLabel('# of Questions:') . $crpt->writeCell($lNumQuests . $strLinkViewQuest . $strLinkAddQues) . $crpt->closeRow()); //------------------ // Visibility //------------------ echoT($crpt->openRow() . $crpt->writeLabel('Visibility:') . $crpt->writeCell(($pptest->bHidden ? 'Hidden' : 'Visible') . ' ' . strSpecial_CPPHideShow($lPPTestID, !$pptest->bHidden, true)) . $crpt->closeRow()); //------------------ // Published? //------------------ echoT($crpt->openRow() . $crpt->writeLabel('Published?:') . $crpt->writeCell($pptest->bPublished ? 'Yes' : 'No') . $crpt->closeRow()); echoT($crpt->closeReport()); closeBlock(); }
function strHTMLPPTestSummaryDisplay() { //--------------------------------------------------------------------- // caller must first load the test //--------------------------------------------------------------------- $params = array('enumStyle' => 'terse'); $clsRpt = new generic_rpt($params); $strOut = ''; $pptest =& $this->pptests[0]; $lPPTestID = $pptest->lKeyID; $clsRpt->setEntrySummary(); $strOut .= $clsRpt->openReport(); $strOut .= $clsRpt->openRow() . $clsRpt->writeLabel('Pre/Post Test:', '115pt') . $clsRpt->writeCell(htmlspecialchars($pptest->strTestName) . ' ' . strLinkView_CPPTestView($lPPTestID, 'View pre/post test', true)) . $clsRpt->closeRow(); $strOut .= $clsRpt->openRow() . $clsRpt->writeLabel('Category:') . $clsRpt->writeCell(htmlspecialchars($pptest->strPPTestCat), '350pt;') . $clsRpt->closeRow(); $strOut .= $clsRpt->openRow() . $clsRpt->writeLabel('Pre/Post Test ID:', '115pt') . $clsRpt->writeCell(str_pad($lPPTestID, 5, '0', STR_PAD_LEFT)) . $clsRpt->closeRow(); $strOut .= $clsRpt->openRow() . $clsRpt->writeLabel('Description:') . $clsRpt->writeCell(nl2br(htmlspecialchars($pptest->strDescription)), '350pt;') . $clsRpt->closeRow(); $strOut .= $clsRpt->openRow() . $clsRpt->writeLabel('Questions:') . $clsRpt->writeCell($pptest->lNumQuest . ' ' . strLinkView_CPPQuestions($lPPTestID, 'View questions', true), '') . $clsRpt->closeRow(); $strOut .= $clsRpt->openRow() . $clsRpt->writeLabel('Status:') . $clsRpt->writeCell(($pptest->bHidden ? 'Hidden' : 'Visible') . ' / ' . ($pptest->bPublished ? 'Published' : 'Not published'), '350pt;') . $clsRpt->closeRow(); $strOut .= $clsRpt->closeReport(); return $strOut; }