本文整理汇总了PHP中Exercise::getDescription方法的典型用法代码示例。如果您正苦于以下问题:PHP Exercise::getDescription方法的具体用法?PHP Exercise::getDescription怎么用?PHP Exercise::getDescription使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Exercise
的用法示例。
在下文中一共展示了Exercise::getDescription方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
} else {
// sql error in save() ?
$cmd = 'rqEdit';
}
} else {
if (claro_failure::get_last_failure() == 'exercise_no_title') {
$dialogBox->error(get_lang('Field \'%name\' is required', array('%name' => get_lang('Title'))));
} elseif (claro_failure::get_last_failure() == 'exercise_incorrect_dates') {
$dialogBox->error(get_lang('Start date must be before end date ...'));
}
$cmd = 'rqEdit';
}
}
if ($cmd == 'rqEdit') {
$form['title'] = $exercise->getTitle();
$form['description'] = $exercise->getDescription();
$form['displayType'] = $exercise->getDisplayType();
$form['randomize'] = (bool) $exercise->getShuffle() > 0;
$form['questionDrawn'] = $exercise->getShuffle();
$form['useSameShuffle'] = (bool) $exercise->getUseSameShuffle();
$form['showAnswers'] = $exercise->getShowAnswers();
$form['startDate'] = $exercise->getStartDate();
// unix
if (is_null($exercise->getEndDate())) {
$form['useEndDate'] = false;
$form['endDate'] = 0;
} else {
$form['useEndDate'] = true;
$form['endDate'] = $exercise->getEndDate();
}
$form['useTimeLimit'] = (bool) $exercise->getTimeLimit();
示例2: foreach
$pdf->SetSubject(claro_utf8_encode($exercise->getTitle()));
//set margins
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
//set auto page breaks
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
//set image scale factor
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
$pdf->setPrintHeader(false);
// add a page
$pdf->AddPage();
$htmlcontent = '<div style="font-size: xx-large; font-weight: bold;">' . claro_htmlspecialchars($exercise->getTitle()) . '<div>' . "\n";
$pdf->writeHTML(claro_utf8_encode($htmlcontent, get_conf('charset')), true, 0, true, 0);
//change Img URL
$exercise->setDescription(claro_utf8_encode(change_img_url_for_pdf($exercise->getDescription()), get_conf('charset')));
//End change Img URL
$htmlcontent = '<div style="font-size: normal; font-weight: normal;">' . $exercise->getDescription() . '</div><br /><br />' . "\n";
$pdf->writeHTML(claro_utf8_encode($htmlcontent, get_conf('charset')), true, 0, true, 0);
$i = 1;
foreach ($questionList as $question) {
$htmlcontent = '<p><table cellspacing="4">' . "\n" . '<tbody>' . "\n" . '<tr>' . "\n" . '<th colspan="2" style="text-align: center; font-weight: bold; color: #693; background-color: #DEEECE;">' . get_lang('Question') . ' ' . $i . '</th>' . "\n" . '</tr>' . "\n" . '<tr>' . "\n" . '<td colspan="2">' . claro_htmlspecialchars(strip_tags($question['title'])) . '</td>' . "\n" . '</tr>' . "\n";
// Question description
if (trim(claro_htmlspecialchars($question['description']))) {
$htmlcontent .= '<tr>' . "\n" . '<td colspan="2" style="font-size: x-small; font-style: italic;">' . change_img_url_for_pdf(claro_parse_user_text($question['description'])) . '</td>' . "\n" . '</tr>' . "\n";
}
// Attachment
if (!empty($question['attachment'])) {
$extensionsList = array('jpg', 'jpeg', 'bmp', 'gif', 'png');
$ext = strtolower(get_file_extension($question['attachment']));
if (in_array($ext, $extensionsList)) {