Skip to content
GitLab
    • Explore Projects Groups Snippets
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • M moodle-assignsubmission_dta
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 3
    • Issues 3
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • CoTA
  • moodle-assignsubmission_dta
  • Issues
  • #2
An error occurred while fetching the assigned iteration of the selected issue.
Closed
Open
Issue created 7 months ago by mamunozgil@miguel.munoz-gilMaintainer
  • New related issue

  • Report abuse

  • New related issue

  • Report abuse

Issue: Consider using renderable for summary and detailed view.

Open

Issue: Consider using renderable for summary and detailed view.

It might be more practical to use Renderable and Template to output the content of the summary and detailed view. This is optional.

Tasks
0
server returned results with length 3, expected length of 2

Linked items
0


  • Lückemeyer @gero.lueckemeyer assigned to @32khsa1mst 6 months ago

    assigned to @32khsa1mst

  • Lückemeyer @gero.lueckemeyer added InProgress label 6 months ago

    added InProgress label

  • Lückemeyer @gero.lueckemeyer removed InProgress label 6 months ago

    removed InProgress label

  • Lückemeyer @gero.lueckemeyer unassigned @32khsa1mst 6 months ago

    unassigned @32khsa1mst

  • Lückemeyer @gero.lueckemeyer assigned to @32khsa1mst 3 months ago

    assigned to @32khsa1mst

  • Khalani
    Khalani @32khsa1mst · 3 months ago
    Maintainer

    Approach to implement the renderables for summary and detailed views.

    1. Create renderable file for the table - This is the Connector between data and the templates.

    2. Create the mustache template for the tables - templates

    3. It is recommended to create the separate small functions out of the detailed view HTML function. and use the functions there.

  • Khalani
    Khalani @32khsa1mst · 3 months ago
    Maintainer

    Example for renderable -

    `namespace assignsubmission_dta\output;

    use moodle_url; use renderable; use templatable;

    class summary_table implements renderable, templatable { public $summary; public $recommendations; public $assignsubmission_dta_component_name;

    public function __construct($summary, $recommendations, $assignsubmission_dta_component_name) {
        $this->summary = $summary;
        $this->recommendations = $recommendations;
        $this->assignsubmission_dta_component_name = $assignsubmission_dta_component_name;
    }
    
    public function export_for_template(\renderer_base $output) {
        $data = new \stdClass();
        
        // Map your existing logic for building the table data here
        $data->summary_table = $this->get_summary_table_data();
        $data->recommendations_table = $this->get_recommendations_table_data();
        
        return $data;
    }
    
    private function get_summary_table_data() {
        // Logic from your existing function to create summary table
        $summary_data = [];
        // example of what might go into summary_data
        $summary_data[] = [
            'label' => get_string('total_items', $this->assignsubmission_dta_component_name),
            'value' => $this->summary->assignsubmission_dta_result_count(),
        ];
        // Add other rows similarly
        return $summary_data;
    }
    
    private function get_recommendations_table_data() {
        $recommendation_data = [];
        foreach ($this->recommendations as $recommendation) {
            $recommendation_data[] = [
                'topic' => $recommendation->topic,
                'exercise_name' => $recommendation->exercise_name,
                'url' => $recommendation->url,
                'difficulty' => $recommendation->difficulty,
                'score' => $recommendation->score,
            ];
        }
        return $recommendation_data;
    }

    } `

  • You're only seeing other activity in the feed. To add a comment, switch to one of the following options.
Please register or sign in to reply
0 Assignees
Assign to
Epic
No epic
None
Labels
0
None
0
None
    Assign labels
  • Manage project labels

Milestone
No milestone
None
Iteration
No iteration
None
Weight
None
None
Due date
None
None
None
Time tracking
No estimate or time spent

None

Health status

    Assign health status


None

Confidentiality
Not confidential
Not confidential

You are going to turn on confidentiality. Only project members with at least the Reporter role, the author, and assignees can view or be notified about this issue.

Lock issue
Unlocked
0
0 participants
Reference:

Menu

Explore Projects Groups Snippets

Dies ist die Gitlab-Instanz des Transferportals der Hochschule für Technik Stuttgart. Hier geht es zurück zum Portal