Show assignment.

@return array|mixed
436217
protected function fetch_assignment()
    {
        $uri = str_replace('{assignment}', $this->assignment, config('forge-publish.show_assignment_uri'));
        $url = config('forge-publish.url') . $uri;
        try {
            $response = $this->http->get($url, [
                'headers' => [
                    'X-Requested-With' => 'XMLHttpRequest',
                    'Authorization' => 'Bearer ' . fp_env('ACACHA_FORGE_ACCESS_TOKEN')
                ]
            ]);
        } catch (\Exception $e) {
            $this->error('And error occurs connecting to the api url: ' . $url);
            $this->error('Status code: ' . $e->getResponse()->getStatusCode() . ' | Reason : ' . $e->getResponse()->getReasonPhrase());
        }
        return json_decode((string) $response->getBody());
    }
949173
public function definition() {
        $mform = $this->_form;

        list($assignment, $data, $params) = $this->_customdata;
        // Visible elements.
        $this->assignment = $assignment;
        $assignment->add_grade_form_elements($mform, $data, $params);

        if ($data) {
            $this->set_data($data);
        }
    }
446519
public function toBinaryOperationEquivalent()
    {
        $binaryOperator = Assignment::toBinaryOperator($this->operator);

        if($binaryOperator === null) {
            return $this;
        }

        return $this->update(
                $this->assignTo,
                Assignment::EQUAL,
                Expression::binaryOperation(
                        $this->assignTo,
                        $binaryOperator,
                        $this->assignmentValue
                )
        );
    }
1240348
public function getPermissionAssignmentObject()
    {
        $targ = Core::make('\Concrete\Core\Permission\Assignment\ConversationAssignment');
        if (is_object($this->permissionObject)) {
            $targ->setPermissionObject($this->permissionObject);
        }
        $targ->setPermissionKeyObject($this);

        return $targ;
    }
20823
public function init() {
        global $PAGE;

        $result = new workshop_allocation_result($this);
        $customdata = array();
        $customdata['workshop'] = $this->workshop;
        $this->mform = new workshop_random_allocator_form($PAGE->url, $customdata);
        if ($this->mform->is_cancelled()) {
            redirect($this->workshop->view_url());
        } else if ($settings = $this->mform->get_data()) {
            $settings = workshop_random_allocator_setting::instance_from_object($settings);
            $this->execute($settings, $result);
            return $result;
        } else {
            // this branch is executed if the form is submitted but the data
            // doesn't validate and the form should be redisplayed
            // or on the first display of the form.
            $result->set_status(workshop_allocation_result::STATUS_VOID);
            return $result;
        }
    }
1359321
protected function getAssignedCustomfields()
    {

        $customfields = array_get(app('customfields')->get(), get_called_class(), []);
        return !is_array($customfields) ? [$customfields] : $customfields;
    }
1229296
public static function output()
    {

        $aArgs = func_get_args();
        $iArgs = func_num_args();

        $c = $aArgs[0];

        if(isset($GLOBALS[self::$pref.$c])){
            switch (true) {
                case ($c == 'js'):

                    $output = Asset::dump($GLOBALS[self::$pref.$c]);

                    break;
                case ($c == 'css'):
                    $output = Asset::dump($GLOBALS[self::$pref.$c]);
                    break;
                default:
                    $output = $GLOBALS[self::$pref.$c];
                    break;
            }
        } else {
            $output = false;
        }



        return $output;
    }
147610
public function actionAssign()
    {
        $routes = Yii::$app->getRequest()->post('routes', []);
        $model = new Route();
        $model->addNew($routes);
        Yii::$app->getResponse()->format = 'json';
        return $model->getRoutes();
    }
833896
protected function delete_assignment()
    {
        $uri = str_replace('{assignment}', $this->assignment, config('forge-publish.update_assignment_uri'));
        $url = config('forge-publish.url') . $uri;
        try {
            $response = $this->http->delete($url, [
                'headers' => [
                    'X-Requested-With' => 'XMLHttpRequest',
                    'Authorization' => 'Bearer ' . fp_env('ACACHA_FORGE_ACCESS_TOKEN')
                ]
            ]);
        } catch (\Exception $e) {
            $this->error('And error occurs connecting to the api url: ' . $url);
            $this->error('Status code: ' . $e->getResponse()->getStatusCode() . ' | Reason : ' . $e->getResponse()->getReasonPhrase());
            return [];
        }
    }
111474
protected function skipOutputAssignment()
	{
		if ($this->tokens[$this->i    ][0] !== T_VARIABLE
		 || $this->tokens[$this->i    ][1] !== '$this'
		 || $this->tokens[$this->i + 1][0] !== T_OBJECT_OPERATOR
		 || $this->tokens[$this->i + 2][0] !== T_STRING
		 || $this->tokens[$this->i + 2][1] !== 'out'
		 || $this->tokens[$this->i + 3][0] !== T_CONCAT_EQUAL)
		{
			 return false;
		}

		// Move past the concat assignment
		$this->i += 4;

		return true;
	}
1234002
public function render_assign_header(assign_header $header) {
        $o = '';

        if ($header->subpage) {
            $this->page->navbar->add($header->subpage);
            $args = ['contextname' => $header->context->get_context_name(false, true), 'subpage' => $header->subpage];
            $title = get_string('subpagetitle', 'assign', $args);
        } else {
            $title = $header->context->get_context_name(false, true);
        }
        $courseshortname = $header->context->get_course_context()->get_context_name(false, true);
        $title = $courseshortname . ': ' . $title;
        $heading = format_string($header->assign->name, false, array('context' => $header->context));

        $this->page->set_title($title);
        $this->page->set_heading($this->page->course->fullname);

        $o .= $this->output->header();
        $o .= $this->output->heading($heading);
        if ($header->preface) {
            $o .= $header->preface;
        }

        if ($header->showintro) {
            $o .= $this->output->box_start('generalbox boxaligncenter', 'intro');
            $o .= format_module_intro('assign', $header->assign, $header->coursemoduleid);
            $o .= $header->postfix;
            $o .= $this->output->box_end();
        }

        return $o;
    }
753503
public function showVars()
    {
        $what = $this->getParameter('scope');
        switch ( $what ) {
            case 'global':
            case 'globals':
            case 'system':
            case 'systems':
                $debug = $this->getGlobals();
                break;

            default:
                $debug = $this->getLocals();
                break;
        }

        return '<pre>' . JSONUtils::encode($debug, true, false) . '</pre>';
    }
1266422
public function showHeader()
    {
        $properties = $this->getProperties();
        $properties['header'] = true;
        $this->setProperties($properties);
        return $this;
    }
971872
function show()
    {
        //---Mostrar la imagen dependiendo del tipo de archivo
        switch($this->type)
        {
            case IMAGETYPE_JPEG:
                imagejpeg($this->image);
                break;
            case IMAGETYPE_GIF:
                imagegif($this->image);
                break;
            case IMAGETYPE_PNG:
                imagepng($this->image);
                break;
        }
    }
236484
public function getSign()
    {
        foreach ($this->getMap() as $name => $method) {
            // Call associated method dynamically
            if (call_user_func(array($this, $method))) {
                return $name;
            }
        }

        // On failure
        return false;
    }
71775
protected function currentAssignment() {
        if (fp_env('ACACHA_FORGE_ASSIGNMENT')) {
            $assignmentFound = collect($this->assignments)->filter(function ($assignment) {
                return $assignment->id == fp_env('ACACHA_FORGE_ASSIGNMENT');
            })->first();
            if ($assignmentFound) return $assignmentFound->name;
        }
        return null;
    }
800809
private static function get_assignments_course_structure() {
        return new external_single_structure(
            array(
                'id' => new external_value(PARAM_INT, 'course id'),
                'fullname' => new external_value(PARAM_TEXT, 'course full name'),
                'shortname' => new external_value(PARAM_TEXT, 'course short name'),
                'timemodified' => new external_value(PARAM_INT, 'last time modified'),
                'assignments' => new external_multiple_structure(self::get_assignments_assignment_structure(), 'assignment info')
              ), 'course information object'
        );
    }