Render the content of an assessment.

@param workshop_assessment $assessment
@return string HTML
195827
protected function export_assessment(workshop_assessment $assessment) {

        $output = '';

        if (empty($assessment->title)) {
            $title = get_string('assessment', 'workshop');
        } else {
            $title = s($assessment->title);
        }

        $output .= html_writer::tag('h3', $title);

        if ($assessment->reviewer) {
            $output .= html_writer::div(get_string('byfullnamewithoutlink', 'mod_workshop', fullname($assessment->reviewer)));
            $output .= html_writer::empty_tag('br');
        }

        if ($this->workshop->overallfeedbackmode) {
            if ($assessment->feedbackauthorattachment or trim($assessment->feedbackauthor) !== '') {
                $output .= html_writer::tag('h3', get_string('overallfeedback', 'mod_workshop'));
                $content = $this->format_exported_text($assessment->feedbackauthor, $assessment->feedbackauthorformat);
                $content = portfolio_rewrite_pluginfile_urls($content, $this->workshop->context->id, 'mod_workshop',
                    'overallfeedback_content', $assessment->id , $this->exporter->get('format'));
                $output .= $content;

                $output .= $this->export_files_list('overallfeedback_attachment');
            }
        }

        if ($assessment->form) {
            $output .= $assessment->form->render();
        }

        return $output;
    }
446832
public function view(stdClass $submission) {
        global $CFG;
        $result = '';

        $onlinetextsubmission = $this->get_onlinetext_submission($submission->id);

        if ($onlinetextsubmission) {

            // Render for portfolio API.
            $result .= $this->assignment->render_editor_content(ASSIGNSUBMISSION_ONLINETEXT_FILEAREA,
                                                                $onlinetextsubmission->submission,
                                                                $this->get_type(),
                                                                'onlinetext',
                                                                'assignsubmission_onlinetext');

            $plagiarismlinks = '';

            if (!empty($CFG->enableplagiarism)) {
                require_once($CFG->libdir . '/plagiarismlib.php');

                $plagiarismlinks .= plagiarism_get_links(array('userid' => $submission->userid,
                    'content' => trim($onlinetextsubmission->onlinetext),
                    'cmid' => $this->assignment->get_course_module()->id,
                    'course' => $this->assignment->get_course()->id,
                    'assignment' => $submission->assignment));
            }
        }

        return $plagiarismlinks . $result;
    }
693073
protected function render_workshop_final_grades(workshop_final_grades $grades) {

        $out = html_writer::start_tag('div', array('class' => 'finalgrades'));

        if (!empty($grades->submissiongrade)) {
            $cssclass = 'grade submissiongrade';
            if ($grades->submissiongrade->hidden) {
                $cssclass .= ' hiddengrade';
            }
            $out .= html_writer::tag(
                'div',
                html_writer::tag('div', get_string('submissiongrade', 'mod_workshop'), array('class' => 'gradetype')) .
                html_writer::tag('div', $grades->submissiongrade->str_long_grade, array('class' => 'gradevalue')),
                array('class' => $cssclass)
            );
        }

        if (!empty($grades->assessmentgrade)) {
            $cssclass = 'grade assessmentgrade';
            if ($grades->assessmentgrade->hidden) {
                $cssclass .= ' hiddengrade';
            }
            $out .= html_writer::tag(
                'div',
                html_writer::tag('div', get_string('gradinggrade', 'mod_workshop'), array('class' => 'gradetype')) .
                html_writer::tag('div', $grades->assessmentgrade->str_long_grade, array('class' => 'gradevalue')),
                array('class' => $cssclass)
            );
        }

        $out .= html_writer::end_tag('div');

        return $out;
    }
598406
public function render($content)
    {
        $element = $this->getElement();
        $view    = $element->getView();
        if (null === $view) {
            return $content;
        }

        $tooltip = $element->getAttrib('tooltip');
        $tooltip = trim($tooltip);
        //$element->removeAttrib('tooltip');

        if (empty($tooltip)) {
            return $content;
        }

        $view->headScript()->appendFile(\Zend_Controller_Front::getInstance()->getBaseUrl()  .  '/gems/js/jquery.cluetip.js');
        $view->headLink()->appendStylesheet(\Zend_Controller_Front::getInstance()->getBaseUrl()  . '/gems/js/jquery.cluetip.css');
        $script = "$('" . $this->getTag() . ".tooltip').cluetip({
            activation: 'click',
            sticky: 'true',
            closeText: '[X]',
            closePosition:    'title',
            width: 450,
            titleAttribute: 'tip',
            splitTitle: '|'})
                   $('#tabContainer').bind( 'tabsselect', function(event, ui) {
  $(document).trigger('hideCluetip');
});";

        $view->jQuery()->addOnLoad($script);

        $separator = $this->getSeparator();
        $placement = $this->getPlacement();
        $class     = $this->getClass();
        $tag       = $this->getTag();
        $escape    = $this->getEscape();

        $options   = $this->getOptions();

        if ($escape) {
            $tooltip = $view->escape($tooltip);
        }

        $options['tag'] = $tag;
        $options['tip'] = str_replace('"', '\"', $tooltip);
        $decorator = new \Zend_Form_Decorator_HtmlTag($options);
        $tooltip = $decorator->render($this->getImg()) . $decorator->setOptions(array('class'=>'thetooltip', 'id'=>'tooltip-' . $this->getElement()->getAttrib('id')))->render($tooltip);

        switch ($placement) {
            case self::PREPEND:
                return $tooltip . $separator . $content;
            case self::APPEND:
            default:
                return $content . $separator . $tooltip;
        }

        /* Misschien later toch toevoegen */
        $helper = $this->getHelper();

        return $view->$helper($id, $content, $attribs);
    }
560559
public function render_adaptive_marks(qbehaviour_adaptive_mark_details $details, question_display_options $options) {
        if ($details->state == question_state::$todo || $options->marks < question_display_options::MARK_AND_MAX) {
            // No grades yet.
            return '';
        }

        // Display the grading details from the last graded state.
        $class = $details->state->get_feedback_class();
        return html_writer::tag('div', get_string($class, 'question'),
                        array('class' => 'correctness ' . $class))
                . html_writer::tag('div', $this->grading_details($details, $options),
                        array('class' => 'gradingdetails'));
    }
1319194
public function render($error)
	{
		try
		{
			if (!$this->document)
			{
				// We're probably in an CLI environment
				exit($error->getMessage());
			}

			$this->document->setType('error');

			// Push the error object into the document
			$this->document->setError($error);

			if (ob_get_contents())
			{
				ob_end_clean();
			}

			$this->document->setTitle(\Lang::txt('Error') . ': ' . $error->getCode());

			$template = $this->template->load();

			$data = $this->document->render(
				false,
				array(
					'template'  => $template->template,
					'directory' => dirname($template->path),
					'debug'     => $this->debug
				)
			);

			// Failsafe to get the error displayed.
			if (empty($data))
			{
				exit($error->getMessage() . ' in ' . $error->getFile() . ':' . $error->getLine());
			}
			else
			{
				$status = $error->getCode() ? $error->getCode() : 500;
				$status = ($status < 100 || $status >= 600) ? 500 : $status;

				$response = new Response($data, $status);
				$response->send();

				exit();
			}
		}
		catch (Exception $e)
		{
			$plain = new Plain($this->debug);
			$plain->render($e);
		}
	}
1013668
public function render()
	{
		$attributes	= $this->getAttributes();
		if( is_array( $attributes['href'] ) )
			$attributes['href']	= ADT_URL_Inference::buildStatic( $attributes['href'] );
		$content	= $this->renderInner( $this->content );
		if( !is_string( $content ) )
			throw new InvalidArgumentException( 'Link label is neither rendered nor renderable' );
		return UI_HTML_Tag::create( "a", $content, $attributes );	
	}
476492
public function render()
	{
		if($this->enabled)
		{
			$profiler = $this;
			$logger = $this->log;
			$assetPath = __DIR__.'/../../assets/';

			ob_start();

			include __DIR__ .'/../../views/profiler.php';

			return ob_get_clean();
		}
	}
368093
public function render()
    {
        Admin::script($this->script());

        $options = $this->getOptions()->map(function ($option) {
            $selected = ($option == $this->perPage) ? 'selected' : '';
            $url = app('request')->fullUrlWithQuery([$this->perPageName => $option]);

            return "<option value=\"$url\" $selected>$option</option>";
        })->implode("\r\n");

        $trans = [
            'show'    => trans('admin.show'),
            'entries' => trans('admin.entries'),
        ];

        return <<<EOT

<label class="control-label pull-right" style="margin-right: 10px; font-weight: 100;">

        <small>{$trans['show']}</small>&nbsp;
        <select class="input-sm {$this->grid->getPerPageName()}" name="per-page">
            $options
        </select>
        &nbsp;<small>{$trans['entries']}</small>
    </label>

EOT;
    }
1241122
public function render()
    {
        $nameAttribute = $this->getName();
        $this->registerFieldNameForFormTokenGeneration($nameAttribute);

        $output = '';
        $resource = $this->getUploadedResource();
        if ($resource !== null) {
            $resourceIdentityAttribute = '';
            if ($this->hasArgument('id')) {
                $resourceIdentityAttribute = ' id="' . htmlspecialchars($this->arguments['id']) . '-resource-identity"';
            }
            $output .= '<input type="hidden" name="'. htmlspecialchars($nameAttribute) . '[originallySubmittedResource][__identity]" value="' . $this->persistenceManager->getIdentifierByObject($resource) . '"' . $resourceIdentityAttribute . ' />';
        }

        if ($this->hasArgument('collection') && $this->arguments['collection'] !== false && $this->arguments['collection'] !== '') {
            $output .= '<input type="hidden" name="'. htmlspecialchars($nameAttribute) . '[__collectionName]" value="' . htmlspecialchars($this->arguments['collection']) . '" />';
        }

        $this->tag->addAttribute('type', 'file');
        $this->tag->addAttribute('name', $nameAttribute);

        $this->addAdditionalIdentityPropertiesIfNeeded();
        $this->setErrorClassAttribute();

        $output .= $this->tag->render();
        return $output;
    }
136381
protected function renderContent() {        
        ?>                
        <div id="maj-geodisp-list-page" class="center">
			<h2><?php echo $this->data->get('title'); ?></h2>
			
			<?php
			if($this->data->get('has_analysis', false)) { 
			    /** @var GeoAnalysis $ga  */
    		    $ga = $this->data->get('geoanalysis');
    		?>
    		
    		<div id="geodispersion-panel">
    			<h3><?php echo $ga->getTitle() ?></h3>
    			
    			<div id="geodispersion-tabs">
    				<ul>
    					<li>
    						<a href="#geodisp-general"><?php echo I18N::translate('General data'); ?></a>
    					</li>
    					<li>
    						<a href="#geodisp-generations"><?php echo I18N::translate('Data by Generations'); ?></a>
    					</li>
    				</ul>
    				
    				<div id="geodisp-general">
    					<div id="loading-general" class="loading-image">&nbsp;</div>
    					<div id="geodisp-data-general" class="center"></div>
    				</div>
    				
    				<div id="geodisp-generations">
    					<div id="loading-generations" class="loading-image">&nbsp;</div>
    					<div id="geodisp-data-generations"></div>
    				</div>
    			</div>
    		</div>    		
      		
      		<?php } else { ?>
      		<p class="warning"><?php echo I18N::translate('The required dispersion analysis does not exist.'); ?><p>
      		<?php } ?>	
    	</div>
    	
    	<?php 
    }
1018455
public function check_view_assessment($assessment, $submission) {
        global $USER;

        $isauthor = $submission->authorid == $USER->id;
        $isreviewer = $assessment->reviewerid == $USER->id;
        $canviewallassessments  = has_capability('mod/workshop:viewallassessments', $this->context);
        $canviewallsubmissions  = has_capability('mod/workshop:viewallsubmissions', $this->context);

        $canviewallsubmissions = $canviewallsubmissions && $this->check_group_membership($submission->authorid);

        if (!$isreviewer and !$isauthor and !($canviewallassessments and $canviewallsubmissions)) {
            print_error('nopermissions', 'error', $this->view_url(), 'view this assessment');
        }

        if ($isauthor and !$isreviewer and !$canviewallassessments and $this->phase != self::PHASE_CLOSED) {
            // Authors can see assessments of their work at the end of workshop only.
            print_error('nopermissions', 'error', $this->view_url(), 'view assessment of own work before workshop is closed');
        }
    }
464758
private function render() : string
    {
        $html = '<div class="jumbotron">' .
            (($this->fluid === true) ? '<div class="container">' : null) .
            '<h1>' . $this->view->escapeHtml($this->heading) .
            (($this->sub_heading !== null) ? '<small>' .
            $this->view->escapeHtml($this->sub_heading) . '</small>' : null) .
            '</h1>' . $this->content .
            (($this->fluid === true) ? '</div>' : null) .
            '</div>';

        return $html;
    }
1198416
public function render_competencies_to_review_page(renderable $page) {
        $data = $page->export_for_template($this);
        return parent::render_from_template('block_lp/competencies_to_review_page', $data);
    }
472337
public function render_content() {
		if ( empty( $this->choices ) ) {
			return;
		}
		?>

		<?php if ( ! empty( $this->label ) ) : ?>
			<span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
		<?php endif; ?>

		<?php if ( ! empty( $this->description ) ) : ?>
			<span class="description customize-control-description"><?php echo esc_html( $this->description ); ?></span>
		<?php endif; ?>

		<?php $multi_values = ( ! is_array( $this->value() ) ) ? explode( ',', $this->value() ) : $this->value(); ?>

		<ul>
			<?php foreach ( $this->choices as $value => $label ) : ?>
				<li>
					<label>
						<input type="checkbox" value="<?php echo esc_attr( $value ); ?>" <?php checked( in_array( $value, $multi_values ) ); ?> />
						<?php echo esc_html( $label ); ?>
					</label>
				</li>
			<?php endforeach; ?>
		</ul>

		<input type="hidden" <?php $this->link(); ?> value="<?php echo esc_attr( implode( ',', $multi_values ) ); ?>" />
		<?php
	}
1175531
public function render()
    {
        $path = $this->resolvePathVariable();
        $content =  "PATH=$path \n". implode(PHP_EOL, $this->getJobs());
        return $content;
    }
57770
public function render_competency_plan_navigation(competency_plan_navigation $nav) {
        $data = $nav->export_for_template($this);
        return parent::render_from_template('tool_lp/competency_plan_navigation', $data);
    }