当前位置: 首页>>代码示例>>PHP>>正文


PHP Exercise::getDescription方法代码示例

本文整理汇总了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();
开发者ID:rhertzog,项目名称:lcs,代码行数:31,代码来源:edit_exercise.php

示例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)) {
开发者ID:rhertzog,项目名称:lcs,代码行数:31,代码来源:exercise.php


注:本文中的Exercise::getDescription方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。