• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP shorten_text函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中shorten_text函数的典型用法代码示例。如果您正苦于以下问题:PHP shorten_text函数的具体用法?PHP shorten_text怎么用?PHP shorten_text使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了shorten_text函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: readquestions

 protected function readquestions($lines)
 {
     // For this class the method has been simplified as
     // there can never be more than one question for a
     // multianswer import
     $questions = array();
     $questiontext = array();
     $questiontext['text'] = implode('', $lines);
     $questiontext['format'] = 0;
     $questiontext['itemid'] = '';
     $question = qtype_multianswer_extract_question($questiontext);
     $question->questiontext = $question->questiontext['text'];
     $question->questiontextformat = 0;
     $question->qtype = MULTIANSWER;
     $question->generalfeedback = '';
     $question->course = $this->course;
     if (!empty($question)) {
         $name = html_to_text(implode(' ', $lines));
         $name = preg_replace('/{[^}]*}/', '', $name);
         $name = trim($name);
         if ($name) {
             $question->name = shorten_text($name, 45);
         } else {
             // We need some name, so use the current time, since that will be
             // reasonably unique.
             $question->name = userdate(time());
         }
         $questions[] = $question;
     }
     return $questions;
 }
开发者ID:sebastiansanio,项目名称:tallerdeprogramacion2fiuba,代码行数:31,代码来源:format.php


示例2: get_other_values

 protected function get_other_values(renderer_base $output)
 {
     $contextcache = array();
     $competencies = array();
     foreach ($this->related['competencies'] as $competency) {
         if (!isset($contextcache[$competency->get_competencyframeworkid()])) {
             $contextcache[$competency->get_competencyframeworkid()] = $competency->get_context();
         }
         $context = $contextcache[$competency->get_competencyframeworkid()];
         $compexporter = new competency_exporter($competency, array('context' => $context));
         $competencies[] = $compexporter->export($output);
     }
     $urlshort = '';
     $url = $this->persistent->get_url();
     if (!empty($url)) {
         $murl = new moodle_url($url);
         $shorturl = preg_replace('@^https?://(www\\.)?@', '', $murl->out(false));
         $urlshort = shorten_text($shorturl, 30, true);
     }
     $files = array();
     $storedfiles = $this->persistent->get_files();
     if (!empty($storedfiles)) {
         foreach ($storedfiles as $storedfile) {
             $fileexporter = new stored_file_exporter($storedfile, array('context' => $this->related['context']));
             $files[] = $fileexporter->export($output);
         }
     }
     $values = array('canmanage' => $this->persistent->can_manage(), 'competencycount' => count($competencies), 'competencies' => $competencies, 'filecount' => count($files), 'files' => $files, 'hasurlorfiles' => !empty($files) || !empty($url), 'urlshort' => $urlshort);
     return $values;
 }
开发者ID:evltuma,项目名称:moodle,代码行数:30,代码来源:user_evidence_exporter.php


示例3: get_discussion_options

 /**
  * Generate options array for hierselect form element
  *
  * Creates a list of discussions.
  *
  * @return array
  */
 public function get_discussion_options()
 {
     $options = array(0 => get_string('all', 'hsuforum'));
     $rs = hsuforum_get_discussions($this->_customdata->cm, 'd.name');
     foreach ($rs as $discussion) {
         $options[$discussion->discussion] = shorten_text(format_string($discussion->name));
     }
     $rs->close();
     return $options;
 }
开发者ID:cdsmith-umn,项目名称:moodle-mod_hsuforum,代码行数:17,代码来源:export_form.php


示例4: render_result

 /**
  * Displaying search results.
  *
  * @param \core_search\document Containing a single search response to be displayed.a
  * @return string HTML
  */
 public function render_result(\core_search\document $doc)
 {
     $docdata = $doc->export_for_template($this);
     // Limit text fields size.
     $docdata['title'] = shorten_text($docdata['title'], static::SEARCH_RESULT_STRING_SIZE, true);
     $docdata['content'] = $docdata['content'] ? shorten_text($docdata['content'], static::SEARCH_RESULT_TEXT_SIZE, true) : '';
     $docdata['description1'] = $docdata['description1'] ? shorten_text($docdata['description1'], static::SEARCH_RESULT_TEXT_SIZE, true) : '';
     $docdata['description2'] = $docdata['description2'] ? shorten_text($docdata['description2'], static::SEARCH_RESULT_TEXT_SIZE, true) : '';
     return $this->output->render_from_template('core_search/result', $docdata);
 }
开发者ID:rushi963,项目名称:moodle,代码行数:16,代码来源:renderer.php


示例5: shorten_post_name

 /**
  * Prevent name from exceeding 255 chars.
  */
 public static function shorten_post_name($name)
 {
     $strre = get_string('re', 'hsuforum');
     if (\core_text::strlen($name) > 255) {
         $shortened = shorten_text($name, 255);
         if (trim(str_ireplace($strre, '', $shortened)) === '...' || \core_text::strlen($shortened) > 255) {
             // Make a 2nd pass with the 'exact' param true, as shortening on word boundary failed or exceeded 255 chars.
             $shortened = shorten_text($name, 255, true);
         }
         $name = $shortened;
     }
     return $name;
 }
开发者ID:cdsmith-umn,项目名称:moodle-mod_hsuforum,代码行数:16,代码来源:local.php


示例6: get_other_values

 protected function get_other_values(renderer_base $output)
 {
     $filename = $this->file->get_filename();
     $filenameshort = $filename;
     if (core_text::strlen($filename) > 25) {
         $filenameshort = shorten_text(substr($filename, 0, -4), 21, true, '..');
         $filenameshort .= substr($filename, -4);
     }
     $icon = $this->file->is_directory() ? file_folder_icon() : file_file_icon($this->file);
     $iconurl = $output->pix_url($icon, 'core');
     $url = moodle_url::make_pluginfile_url($this->file->get_contextid(), $this->file->get_component(), $this->file->get_filearea(), $this->file->get_itemid(), $this->file->get_filepath(), $this->file->get_filename(), true);
     return array('filenameshort' => $filenameshort, 'filesizeformatted' => display_size((int) $this->file->get_filesize()), 'icon' => $icon, 'iconurl' => $iconurl->out(false), 'url' => $url->out(false), 'timecreatedformatted' => userdate($this->file->get_timecreated()), 'timemodifiedformatted' => userdate($this->file->get_timemodified()));
 }
开发者ID:evltuma,项目名称:moodle,代码行数:13,代码来源:stored_file_exporter.php


示例7: edit_form_add

 public function edit_form_add(&$mform)
 {
     global $COURSE, $CFG;
     require_once $CFG->dirroot . '/course/lib.php';
     get_all_mods($COURSE->id, $mods, $modnames, $modnamesplural, $modnamesusesd);
     $modinfo = unserialize((string) $COURSE->modinfo);
     $modules = array();
     foreach ($mods as $mod) {
         $instancename = urldecode($modinfo[$mod->id]->name);
         $instancename = format_string($instancename, true, $COURSE->id);
         $modules[$mod->id] = shorten_text($mod->modfullname . ': ' . $instancename, 28);
     }
     natcasesort($modules);
     // Add our choose option to the front
     $options = array(0 => get_string('choose', 'pagemenu')) + $modules;
     $mform->addElement('select', 'moduleid', get_string('addmodule', 'pagemenu'), $options);
     $mform->setType('moduleid', PARAM_INT);
 }
开发者ID:nadavkav,项目名称:MoodleTAO,代码行数:18,代码来源:module.class.php


示例8: get_text_for_indexing_txt

/**
* @param object $resource
* @uses $CFG
*/
function get_text_for_indexing_txt(&$resource, $directfile = '')
{
    global $CFG;
    // SECURITY : do not allow non admin execute anything on system !!
    if (!has_capability('moodle/site:doanything', get_context_instance(CONTEXT_SYSTEM))) {
        return;
    }
    // just try to get text empirically from ppt binary flow
    if ($directfile == '') {
        $text = implode('', file("{$CFG->dataroot}/{$resource->course}/{$resource->reference}"));
    } else {
        $text = implode('', file("{$CFG->dataroot}/{$directfile}"));
    }
    if (!empty($CFG->block_search_limit_index_body)) {
        $text = shorten_text($text, $CFG->block_search_limit_index_body);
    }
    return $text;
}
开发者ID:JackCanada,项目名称:moodle-hacks,代码行数:22,代码来源:physical_txt.php


示例9: get_other_values

 protected function get_other_values(renderer_base $output)
 {
     $urlshort = '';
     $url = $this->persistent->get_url();
     if (!empty($url)) {
         $murl = new moodle_url($url);
         $shorturl = preg_replace('@^https?://(www\\.)?@', '', $murl->out(false));
         $urlshort = shorten_text($shorturl, 30, true);
     }
     $files = array();
     $storedfiles = $this->persistent->get_files();
     if (!empty($storedfiles)) {
         foreach ($storedfiles as $storedfile) {
             $fileexporter = new stored_file_exporter($storedfile, array('context' => $this->related['context']));
             $files[] = $fileexporter->export($output);
         }
     }
     $userevidencecompetencies = array();
     $frameworks = array();
     $scales = array();
     $usercompetencies = $this->persistent->get_user_competencies();
     foreach ($usercompetencies as $usercompetency) {
         $competency = $usercompetency->get_competency();
         // Get the framework.
         if (!isset($frameworks[$competency->get_competencyframeworkid()])) {
             $frameworks[$competency->get_competencyframeworkid()] = $competency->get_framework();
         }
         $framework = $frameworks[$competency->get_competencyframeworkid()];
         // Get the scale.
         $scaleid = $competency->get_scaleid();
         if ($scaleid === null) {
             $scaleid = $framework->get_scaleid();
         }
         if (!isset($scales[$framework->get_scaleid()])) {
             $scales[$framework->get_scaleid()] = $framework->get_scale();
         }
         $scale = $scales[$framework->get_scaleid()];
         $related = array('competency' => $competency, 'usercompetency' => $usercompetency, 'scale' => $scale, 'context' => $framework->get_context());
         $userevidencecompetencysummaryexporter = new user_evidence_competency_summary_exporter(null, $related);
         $userevidencecompetencies[] = $userevidencecompetencysummaryexporter->export($output);
     }
     $values = array('canmanage' => $this->persistent->can_manage(), 'filecount' => count($files), 'files' => $files, 'userhasplan' => $this->persistent->user_has_plan(), 'hasurlorfiles' => !empty($files) || !empty($url), 'urlshort' => $urlshort, 'competencycount' => count($userevidencecompetencies), 'usercompetencies' => $userevidencecompetencies);
     return $values;
 }
开发者ID:evltuma,项目名称:moodle,代码行数:44,代码来源:user_evidence_summary_exporter.php


示例10: get_text_for_indexing_xml

/**
* @param object $resource
* @uses $CFG
*/
function get_text_for_indexing_xml(&$resource, $directfile = '')
{
    global $CFG;
    // SECURITY : do not allow non admin execute anything on system !!
    if (!has_capability('moodle/site:doanything', get_context_instance(CONTEXT_SYSTEM))) {
        return;
    }
    // just get text
    if ($directfile == '') {
        $text = implode('', file("{$CFG->dataroot}/{$resource->course}/{$resource->reference}"));
    } else {
        $text = implode('', file("{$CFG->dataroot}/{$directfile}"));
    }
    // filter out all xml tags
    $text = preg_replace("/<[^>]*>/", ' ', $text);
    if (!empty($CFG->block_search_limit_index_body)) {
        $text = shorten_text($text, $CFG->block_search_limit_index_body);
    }
    return $text;
}
开发者ID:JackCanada,项目名称:moodle-hacks,代码行数:24,代码来源:physical_xml.php


示例11: get_text_for_indexing_htm

/**
* @param object $resource
* @uses $CFG
*/
function get_text_for_indexing_htm(&$resource, $directfile = '')
{
    global $CFG;
    // SECURITY : do not allow non admin execute anything on system !!
    if (!has_capability('moodle/site:doanything', get_context_instance(CONTEXT_SYSTEM))) {
        return;
    }
    // just get text
    if ($directfile == '') {
        $text = implode('', file("{$CFG->dataroot}/{$resource->course}/{$resource->reference}"));
    } else {
        $text = implode('', file("{$CFG->dataroot}/{$directfile}"));
    }
    // extract keywords and other interesting meta information and put it back as real content for indexing
    if (preg_match('/(.*)<meta ([^>]*)>(.*)/is', $text, $matches)) {
        $prefix = $matches[1];
        $meta_attributes = $matches[2];
        $suffix = $matches[3];
        if (preg_match('/name="(keywords|description)"/i', $meta_attributes)) {
            preg_match('/content="([^"]+)"/i', $meta_attributes, $matches);
            $text = $prefix . ' ' . $matches[1] . ' ' . $suffix;
        }
    }
    // brutally filters all html tags
    $text = preg_replace("/<[^>]*>/", '', $text);
    $text = preg_replace("/<!--[^>]*-->/", '', $text);
    $text = html_entity_decode($text, ENT_COMPAT, 'UTF-8');
    $text = mb_convert_encoding($text, 'UTF-8', 'auto');
    /*
    * debug code for tracing input
    echo "<hr/>";
    $FILE = fopen("filetrace.log", 'w');
    fwrite($FILE, $text);
    fclose($FILE);
    echo "<hr/>";
    */
    if (!empty($CFG->block_search_limit_index_body)) {
        $text = shorten_text($text, $CFG->block_search_limit_index_body);
    }
    return $text;
}
开发者ID:JackCanada,项目名称:moodle-hacks,代码行数:45,代码来源:physical_htm.php


示例12: export_for_template

 public function export_for_template(\renderer_base $output)
 {
     global $USER;
     $context = clone $this->notification;
     if ($context->useridto == $USER->id && $context->timeusertodeleted) {
         $context->deleted = true;
     } else {
         $context->deleted = false;
     }
     $context->timecreatedpretty = get_string('ago', 'message', format_time(time() - $context->timecreated));
     $context->text = message_format_message_text($context);
     $context->read = $context->timeread ? true : false;
     $context->shortenedsubject = shorten_text($context->subject, 125);
     if (!empty($context->component) && substr($context->component, 0, 4) == 'mod_') {
         $iconurl = $output->pix_url('icon', $context->component);
     } else {
         $iconurl = $output->pix_url('i/marker', 'core');
     }
     $context->iconurl = $iconurl->out();
     return $context;
 }
开发者ID:dg711,项目名称:moodle,代码行数:21,代码来源:popup_notification.php


示例13: readquestions

    public function readquestions($lines) {
        question_bank::get_qtype('multianswer'); // Ensure the multianswer code is loaded.

        // For this class the method has been simplified as
        // there can never be more than one question for a
        // multianswer import.
        $questions = array();

        $questiontext = array();
        $questiontext['text'] = implode('', $lines);
        $questiontext['format'] = FORMAT_MOODLE;
        $questiontext['itemid'] = '';
        $question = qtype_multianswer_extract_question($questiontext);
        $question->questiontext = $question->questiontext['text'];
        $question->questiontextformat = 0;

        $question->qtype = 'multianswer';
        $question->generalfeedback = '';
        $question->generalfeedbackformat = FORMAT_MOODLE;
        $question->length = 1;
        $question->penalty = 0.3333333;

        if (!empty($question)) {
            $name = html_to_text(implode(' ', $lines));
            $name = preg_replace('/{[^}]*}/', '', $name);
            $name = trim($name);

            if ($name) {
                $question->name = shorten_text($name, 45);
            } else {
                // We need some name, so use the current time, since that will be
                // reasonably unique.
                $question->name = userdate(time());
            }

            $questions[] = $question;
        }

        return $questions;
    }
开发者ID:netspotau,项目名称:moodle-mod_assign,代码行数:40,代码来源:format.php


示例14: edit_form_add

 public function edit_form_add(&$mform)
 {
     global $COURSE, $CFG;
     require_once $CFG->dirroot . '/course/lib.php';
     $modinfo = get_fast_modinfo($COURSE);
     $modules = array();
     foreach ($modinfo->cms as $cm) {
         $modules[$cm->modplural][$cm->id] = shorten_text(format_string($cm->name, true, $COURSE->id), 28);
     }
     // Fix the sorting
     $options = array();
     $modnames = array_keys($modules);
     natcasesort($modnames);
     foreach ($modnames as $modname) {
         $mods = $modules[$modname];
         natcasesort($mods);
         $options[$modname] = $mods;
     }
     // Add our choose option to the front
     $options = array('' => array(0 => get_string('choose', 'pagemenu'))) + $options;
     $mform->addElement('selectgroups', 'moduleid', get_string('addmodule', 'pagemenu'), $options);
     $mform->setType('moduleid', PARAM_INT);
 }
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:23,代码来源:module.class.php


示例15: comment_on_datasetitems

 public function comment_on_datasetitems($qtypeobj, $questionid, $questiontext, $answers, $data, $number)
 {
     global $DB;
     $comment = new stdClass();
     $comment->stranswers = array();
     $comment->outsidelimit = false;
     $comment->answers = array();
     // Find a default unit.
     if (!empty($questionid) && ($unit = $DB->get_record('question_numerical_units', array('question' => $questionid, 'multiplier' => 1.0)))) {
         $unit = $unit->unit;
     } else {
         $unit = '';
     }
     $answers = fullclone($answers);
     $delimiter = ': ';
     $virtualqtype = $qtypeobj->get_virtual_qtype();
     foreach ($answers as $key => $answer) {
         $error = qtype_calculated_find_formula_errors($answer->answer);
         if ($error) {
             $comment->stranswers[$key] = $error;
             continue;
         }
         $formula = $this->substitute_variables($answer->answer, $data);
         $formattedanswer = qtype_calculated_calculate_answer($answer->answer, $data, $answer->tolerance, $answer->tolerancetype, $answer->correctanswerlength, $answer->correctanswerformat, $unit);
         if ($formula === '*') {
             $answer->min = ' ';
             $formattedanswer->answer = $answer->answer;
         } else {
             eval('$ansvalue = ' . $formula . ';');
             $ans = new qtype_numerical_answer(0, $ansvalue, 0, '', 0, $answer->tolerance);
             $ans->tolerancetype = $answer->tolerancetype;
             list($answer->min, $answer->max) = $ans->get_tolerance_interval($answer);
         }
         if ($answer->min === '') {
             // This should mean that something is wrong.
             $comment->stranswers[$key] = " {$formattedanswer->answer}" . '<br/><br/>';
         } else {
             if ($formula === '*') {
                 $comment->stranswers[$key] = $formula . ' = ' . get_string('anyvalue', 'qtype_calculated') . '<br/><br/><br/>';
             } else {
                 $formula = shorten_text($formula, 57, true);
                 $comment->stranswers[$key] = $formula . ' = ' . $formattedanswer->answer . '<br/>';
                 $correcttrue = new stdClass();
                 $correcttrue->correct = $formattedanswer->answer;
                 $correcttrue->true = '';
                 if ($formattedanswer->answer < $answer->min || $formattedanswer->answer > $answer->max) {
                     $comment->outsidelimit = true;
                     $comment->answers[$key] = $key;
                     $comment->stranswers[$key] .= get_string('trueansweroutsidelimits', 'qtype_calculated', $correcttrue);
                 } else {
                     $comment->stranswers[$key] .= get_string('trueanswerinsidelimits', 'qtype_calculated', $correcttrue);
                 }
                 $comment->stranswers[$key] .= '<br/>';
                 $comment->stranswers[$key] .= get_string('min', 'qtype_calculated') . $delimiter . $answer->min . ' --- ';
                 $comment->stranswers[$key] .= get_string('max', 'qtype_calculated') . $delimiter . $answer->max;
             }
         }
     }
     return fullclone($comment);
 }
开发者ID:EmmanuelYupit,项目名称:educursos,代码行数:60,代码来源:questiontype.php


示例16: test_shorten_text_multilang

 public function test_shorten_text_multilang()
 {
     // This is not necessaryily specific to multilang. The issue is really
     // tags with attributes, where before we were generating invalid HTML
     // output like shorten_text('<span id="x" class="y">A</span> B', 1)
     // returning '<span id="x" ...</span>'. It is just that multilang
     // requires the sort of HTML that is quite likely to trigger this.
     // ........................................1...
     $text = '<span lang="en" class="multilang">A</span>' . '<span lang="fr" class="multilang">B</span>';
     $this->assertSame('<span lang="en" class="multilang">...</span>', shorten_text($text, 1));
 }
开发者ID:miguelangelUvirtual,项目名称:uEducon,代码行数:11,代码来源:moodlelib_test.php


示例17: display_submissions


//.........这里部分代码省略.........
                        } else {
                            $studentmodified = '<div id="ts'.$auser->id.'">&nbsp;</div>';
                        }
                    ///Print grade, dropdown or text
                        if ($auser->timemarked > 0) {
                            $teachermodified = '<div id="tt'.$auser->id.'">'.userdate($auser->timemarked).'</div>';

                            if ($final_grade->locked or $final_grade->overridden) {
                                $grade = '<div id="g'.$auser->id.'" class="'. $locked_overridden .'">'.$final_grade->formatted_grade.'</div>';
                            } else if ($quickgrade) {
                                $attributes = array();
                                $attributes['tabindex'] = $tabindex++;
                                $menu = html_writer::select(make_grades_menu($this->assignment->grade), 'menu['.$auser->id.']', $auser->grade, array(-1=>get_string('nograde')), $attributes);
                                $grade = '<div id="g'.$auser->id.'">'. $menu .'</div>';
                            } else {
                                $grade = '<div id="g'.$auser->id.'">'.$this->display_grade($auser->grade).'</div>';
                            }

                        } else {
                            $teachermodified = '<div id="tt'.$auser->id.'">&nbsp;</div>';
                            if ($final_grade->locked or $final_grade->overridden) {
                                $grade = '<div id="g'.$auser->id.'" class="'. $locked_overridden .'">'.$final_grade->formatted_grade.'</div>';
                            } else if ($quickgrade) {
                                $attributes = array();
                                $attributes['tabindex'] = $tabindex++;
                                $menu = html_writer::select(make_grades_menu($this->assignment->grade), 'menu['.$auser->id.']', $auser->grade, array(-1=>get_string('nograde')), $attributes);
                                $grade = '<div id="g'.$auser->id.'">'.$menu.'</div>';
                            } else {
                                $grade = '<div id="g'.$auser->id.'">'.$this->display_grade($auser->grade).'</div>';
                            }
                        }
                    ///Print Comment
                        if ($final_grade->locked or $final_grade->overridden) {
                            $comment = '<div id="com'.$auser->id.'">'.shorten_text(strip_tags($final_grade->str_feedback),15).'</div>';

                        } else if ($quickgrade) {
                            $comment = '<div id="com'.$auser->id.'">'
                                     . '<textarea tabindex="'.$tabindex++.'" name="submissioncomment['.$auser->id.']" id="submissioncomment'
                                     . $auser->id.'" rows="2" cols="20">'.($auser->submissioncomment).'</textarea></div>';
                        } else {
                            $comment = '<div id="com'.$auser->id.'">'.shorten_text(strip_tags($auser->submissioncomment),15).'</div>';
                        }
                    } else {
                        $studentmodified = '<div id="ts'.$auser->id.'">&nbsp;</div>';
                        $teachermodified = '<div id="tt'.$auser->id.'">&nbsp;</div>';
                        $status          = '<div id="st'.$auser->id.'">&nbsp;</div>';

                        if ($final_grade->locked or $final_grade->overridden) {
                            $grade = '<div id="g'.$auser->id.'">'.$final_grade->formatted_grade . '</div>';
                        } else if ($quickgrade) {   // allow editing
                            $attributes = array();
                            $attributes['tabindex'] = $tabindex++;
                            $menu = html_writer::select(make_grades_menu($this->assignment->grade), 'menu['.$auser->id.']', $auser->grade, array(-1=>get_string('nograde')), $attributes);
                            $grade = '<div id="g'.$auser->id.'">'.$menu.'</div>';
                        } else {
                            $grade = '<div id="g'.$auser->id.'">-</div>';
                        }

                        if ($final_grade->locked or $final_grade->overridden) {
                            $comment = '<div id="com'.$auser->id.'">'.$final_grade->str_feedback.'</div>';
                        } else if ($quickgrade) {
                            $comment = '<div id="com'.$auser->id.'">'
                                     . '<textarea tabindex="'.$tabindex++.'" name="submissioncomment['.$auser->id.']" id="submissioncomment'
                                     . $auser->id.'" rows="2" cols="20">'.($auser->submissioncomment).'</textarea></div>';
                        } else {
                            $comment = '<div id="com'.$auser->id.'">&nbsp;</div>';
开发者ID:nuckey,项目名称:moodle,代码行数:67,代码来源:lib.php


示例18: display_submissions


//.........这里部分代码省略.........
                 if ($auser->timemodified > 0) {
                     $studentmodified = '<div id="ts' . $auser->id . '">' . $this->print_student_answer($auser->id) . userdate($auser->timemodified) . '</div>';
                 } else {
                     $studentmodified = '<div id="ts' . $auser->id . '">&nbsp;</div>';
                 }
                 ///Print grade, dropdown or text
                 if ($auser->timemarked > 0) {
                     $teachermodified = '<div id="tt' . $auser->id . '">' . userdate($auser->timemarked) . '</div>';
                     if ($final_grade->locked or $final_grade->overridden) {
                         $grade = '<div id="g' . $auser->id . '">' . $final_grade->str_grade . '</div>';
                     } else {
                         if ($quickgrade) {
                             $menu = choose_from_menu(make_grades_menu($this->assignment->grade), 'menu[' . $auser->id . ']', $auser->grade, get_string('nograde'), '', -1, true, false, $tabindex++);
                             $grade = '<div id="g' . $auser->id . '">' . $menu . '</div>';
                         } else {
                             $grade = '<div id="g' . $auser->id . '">' . $this->display_grade($auser->grade) . '</div>';
                         }
                     }
                 } else {
                     $teachermodified = '<div id="tt' . $auser->id . '">&nbsp;</div>';
                     if ($final_grade->locked or $final_grade->overridden) {
                         $grade = '<div id="g' . $auser->id . '">' . $final_grade->str_grade . '</div>';
                     } else {
                         if ($quickgrade) {
                             $menu = choose_from_menu(make_grades_menu($this->assignment->grade), 'menu[' . $auser->id . ']', $auser->grade, get_string('nograde'), '', -1, true, false, $tabindex++);
                             $grade = '<div id="g' . $auser->id . '">' . $menu . '</div>';
                         } else {
                             $grade = '<div id="g' . $auser->id . '">' . $this->display_grade($auser->grade) . '</div>';
                         }
                     }
                 }
                 ///Print Comment
                 if ($final_grade->locked or $final_grade->overridden) {
                     $comment = '<div id="com' . $auser->id . '">' . shorten_text(strip_tags($final_grade->str_feedback), 15) . '</div>';
                 } else {
                     if ($quickgrade) {
                         $comment = '<div id="com' . $auser->id . '">' . '<textarea tabindex="' . $tabindex++ . '" name="submissioncomment[' . $auser->id . ']" id="submissioncomment' . $auser->id . '" rows="2" cols="20">' . $auser->submissioncomment . '</textarea></div>';
                     } else {
                         $comment = '<div id="com' . $auser->id . '">' . shorten_text(strip_tags($auser->submissioncomment), 15) . '</div>';
                     }
                 }
             } else {
                 $studentmodified = '<div id="ts' . $auser->id . '">&nbsp;</div>';
                 $teachermodified = '<div id="tt' . $auser->id . '">&nbsp;</div>';
                 $status = '<div id="st' . $auser->id . '">&nbsp;</div>';
                 if ($final_grade->locked or $final_grade->overridden) {
                     $grade = '<div id="g' . $auser->id . '">' . $final_grade->str_grade . '</div>';
                 } else {
                     if ($quickgrade) {
                         // allow editing
                         $menu = choose_from_menu(make_grades_menu($this->assignment->grade), 'menu[' . $auser->id . ']', $auser->grade, get_string('nograde'), '', -1, true, false, $tabindex++);
                         $grade = '<div id="g' . $auser->id . '">' . $menu . '</div>';
                     } else {
                         $grade = '<div id="g' . $auser->id . '">-</div>';
                     }
                 }
                 if ($final_grade->locked or $final_grade->overridden) {
                     $comment = '<div id="com' . $auser->id . '">' . $final_grade->str_feedback . '</div>';
                 } else {
                     if ($quickgrade) {
                         $comment = '<div id="com' . $auser->id . '">' . '<textarea tabindex="' . $tabindex++ . '" name="submissioncomment[' . $auser->id . ']" id="submissioncomment' . $auser->id . '" rows="2" cols="20">' . $auser->submissioncomment . '</textarea></div>';
                     } else {
                         $comment = '<div id="com' . $auser->id . '">&nbsp;</div>';
                     }
                 }
             }
开发者ID:BackupTheBerlios,项目名称:samouk-svn,代码行数:67,代码来源:lib.php


示例19: get_title_detailed

 /**
  * Return a more detailed criteria title for display in reports
  *
  * @return  string
  */
 public function get_title_detailed()
 {
     global $DB;
     $module = $DB->get_record('course_modules', array('id' => $this->moduleinstance));
     $activity = $DB->get_record($this->module, array('id' => $module->instance));
     return shorten_text(urldecode($activity->name));
 }
开发者ID:EmmanuelYupit,项目名称:educursos,代码行数:12,代码来源:completion_criteria_activity.php


示例20: display_submissions


//.........这里部分代码省略.........
                 if ($auser->timemarked > 0) {
                     $teachermodified = '<div id="tt' . $auser->id . '">' . userdate($auser->timemarked) . '</div>';
                     if ($final_grade->locked or $final_grade->overridden) {
                         $grade = '<div id="g' . $auser->id . '" class="' . $locked_overridden . '">' . $final_grade->formatted_grade . '</div>';
                     } else {
                         if ($quickgrade) {
                             $select = html_select::make(make_grades_menu($this->assignment->grade), 'menu[' . $auser->id . ']', $auser->grade, get_string('nograde'));
                             $select->nothingvalue = '-1';
                             $select->tabindex = $tabindex++;
                             $menu = $OUTPUT->select($select);
                             $grade = '<div id="g' . $auser->id . '">' . $menu . '</div>';
                         } else {
                             $grade = '<div id="g' . $auser->id . '">' . $this->display_grade($auser->grade) . '</div>';
                         }
                     }
                 } else {
                     $teachermodified = '<div id="tt' . $auser->id . '">&nbsp;</div>';
                     if ($final_grade->locked or $final_grade->overridden) {
                         $grade = '<div id="g' . $auser->id . '" class="' . $locked_overridden . '">' . $final_grade->formatted_grade . '</div>';
                     } else {
                         if ($quickgrade) {
                             $select = html_select::make(make_grades_menu($this->assignment->grade), 'menu[' . $auser->id . ']', $auser->grade, get_string('nograde'));
                             $select->nothingvalue = '-1';
                             $select->tabindex = $tabindex++;
                             $menu = $OUTPUT->select($select);
                             $grade = '<div id="g' . $auser->id . '">' . $menu . '</div>';
                         } else {
                             $grade = '<div id="g' . $auser->id . '">' . $this->display_grade($auser->grade) . '</div>';
                         }
                     }
                 }
                 ///Print Comment
                 if ($final_grade->locked or $final_grade->overridden) {
                     $comment = '<div id="com' . $auser->id . '">' . shorten_text(strip_tags($final_grade->str_feedback), 15) . '</div>';
                 } else {
                     if ($quickgrade) {
                         $comment = '<div id="com' . $auser->id . '">' . '<textarea tabindex="' . $tabindex++ . '" name="submissioncomment[' . $auser->id . ']" id="submissioncomment' . $auser->id . '" rows="2" cols="20">' . $auser->submissioncomment . '</textarea></div>';
                     } else {
                         $comment = '<div id="com' . $auser->id . '">' . shorten_text(strip_tags($auser->submissioncomment), 15) . '</div>';
                     }
                 }
             } else {
                 $studentmodified = '<div id="ts' . $auser->id . '">&nbsp;</div>';
                 $teachermodified = '<div id="tt' . $auser->id . '">&nbsp;</div>';
                 $status = '<div id="st' . $auser->id . '">&nbsp;</div>';
                 if ($final_grade->locked or $final_grade->overridden) {
                     $grade = '<div id="g' . $auser->id . '">' . $final_grade->formatted_grade . '</div>';
                 } else {
                     if ($quickgrade) {
                         // allow editing
                         $select = html_select::make(make_grades_menu($this->assignment->grade), 'menu[' . $auser->id . ']', $auser->grade, get_string('nograde'));
                         $select->nothingvalue = '-1';
                         $select->tabindex = $tabindex++;
                         $menu = $OUTPUT->select($select);
                         $grade = '<div id="g' . $auser->id . '">' . $menu . '</div>';
                     } else {
                         $grade = '<div id="g' . $auser->id . '&qu 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP shorthost函数代码示例发布时间:2022-05-24
下一篇:
PHP shorten_subject函数代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap