@extends('layouts.master')

@section('navigation')
    @if($role==1)
        @include('local.managers.admins._navigation')
    @elseif($role==2)
        @include('local.managers.sCoords._navigation')
    @endif
@stop

@section('main')
<a href="{{ action('SchoolsController@print_school', array($school->id)); }}" class="btn btn-primary pull-right" alt="print"><span class="glyphicon glyphicon-print"></span></a>
<br>
<br>

<!-- Nav tabs -->
<ul id="levelTabs" class="nav nav-tabs" role="tablist">
    <li role="presentation" class="active"><a href="#undergraduate" aria-controls="undergraduate" role="tab">Undergraduate</a></li>
    <li role="presentation"><a href="#graduate" aria-controls="graduate" role="tab">Graduate</a></li>
</ul>

<!-- Tab panes -->
<div class="tab-content">
    <div role="tabpanel" class="tab-pane active" id="undergraduate">
        <div class="row">
            <div class="col-md-9 graph" id="graph-undergrad"></div>
                <div class="col-md-3">
                <br>
                    <div class="panel panel-default panel-scrolling">
                        <div class="panel-heading" role="tab" id="headingOne">
                            <h4 class="panel-title">
                                Programs
                            </h4>
                        </div>
                        <div class="panel-collapse collapse in" role="tabpanel" aria-labelledby="headingOne">
                            <table class="table table-striped table-condensed">
                                <tr>
                                    <th>Name</th>
                                    <th>Participation</th>
                                </tr>
                                @foreach ($undergrad_programs as $program)
                                    <tr>
                                        <td>{{ HTML::linkAction('ProgramsController@show', $program->name, array($program->id)) }}</td>
                                        <td class="text-center">
                                            @if(in_array($program->id, $participating_programs))
                                                <span class="glyphicon glyphicon-ok"></span>
                                            @endif
                                        </td>
                                    </tr>
                                @endforeach
                            </table>
                        </div>
                    </div>
                </div>
            </div>

        <div>
            <!-- Nav tabs -->
            <ul id="undergradSchoolTabs" class="nav nav-tabs" role="tablist">
                <li role="presentation" class="active"><a href="#undergrad-outcomes-assessed" aria-controls="undergrad-outcomes-assessed" role="tab">Assessment Results by Learning Outcomes in Academic Programs</a></li>
                <li role="presentation"><a href="#undergrad-courses" aria-controls="undergrad-courses" role="tab"> Undergraduate Courses</a></li>
                <li role="presentation"><a href="#undergrad-sections" aria-controls="undergrad-sections" role="tab">Sections</a></li>
            </ul>

            <!-- Tab panes -->
            <div class="tab-content">
                <div role="tabpanel" class="tab-pane active" id="undergrad-outcomes-assessed">
                    <div class="row">
                        <div class="col-md-12">
                            <table class="table table-striped table-condensed">
                                <thead>
                                    <th>Learning Outcome</th>
                                    <th>Programs doing Assessment</th>
                                    <th>Programs Achieved</th>
                                    <th>Success Rate</th>
                                </thead>
                                <tbody>
                                    @foreach($outcomes as $outcome)
                                        <tr>
                                            <td class="col-md-6">{{ link_to_action('OutcomesController@show', $outcome->name, array($outcome->id), $attributes = array()) }}</td>
                                            <td class="col-md-2">{{{ $attemptedUndergradProgramsPerOutcome[$outcome->id] }}}</td>
                                            <td class="col-md-2">{{{ $achievedUndergradProgramsPerOutcome[$outcome->id] }}}</td>
                                            <td class="col-md-2">
                                                @if($attemptedUndergradProgramsPerOutcome[$outcome->id]!=0)
                                                    {{{ round($achievedUndergradProgramsPerOutcome[$outcome->id] / $attemptedUndergradProgramsPerOutcome[$outcome->id]*100, 2) }}}%
                                                @else
                                                    N/M
                                                @endif
                                            </td>
                                        </tr>
                                    @endforeach
                                </tbody>
                                <tfoot></tfoot>
                                <caption>N/M: Not Measured</caption>
                            </table>
                        </div>
                    </div>
                </div>

                <div role="tabpanel" class="tab-pane" id="undergrad-courses">
                    <div class="row">
                        <div class="col-md-12">
                            <br>

                            <h3>Courses in this school</h3>
                            <p>Note that some sections may have assessed activities but unpublished results. Unpublished results are <strong>not considered</strong>. Check the Sections tab for a breakdown.</p>

                            @if($undergrad_school_sections_count>0)
                                <table class="table table-striped table-condensed datatable">
                                    <thead>
                                        <tr>
                                            <th>Identifier</th>
                                            <th>Name</th>
                                            <th>Program</th>
                                            <th>Assessed and Published</th>
                                        </tr>
                                    </thead>
                                    <tfoot>
                                        <tr class="column-search">
                                            <th><input class="column-search-bar form-control" type="text" placeholder="Buscar"/></th>
                                            <th><input class="column-search-bar form-control" type="text" placeholder="Buscar"/></th>
                                            <th><input class="column-search-bar form-control" type="text" placeholder="Buscar"/></th>
                                            <th><select class="column-search-select form-control"><option value=""></option></select></th>
                                        </tr>
                                    </tfoot>
                                    <tbody>
                                        @foreach($undergrad_grouped_courses as $grouped_course)
                                            <tr>
                                                <td class="col-md-2">{{ HTML::linkAction('CoursesController@showGrouped', $grouped_course->code.$grouped_course->number.' ('.$grouped_course->semester->code.')', array($grouped_course->code, $grouped_course->number, $grouped_course->semester->code)) }}</td>
                                                <td class="col-md-4">{{{ $grouped_course->name}}}</td>
                                                <td class="col-md-2">{{{ $grouped_course->program->name }}}</td>
                                                <td class="col-md-1">
                                                    @if($grouped_course->outcomes_attempted!=NULL)
                                                        Yes
                                                    @else
                                                        No
                                                    @endif
                                                </td>
                                            </tr>
                                        @endforeach
                                    </tbody>
                                </table>
                            @else
                                <p class="lead"> No courses doing Assessment (0%)</p>
                            @endif
                        </div>
                    </div>
                </div>

                <div role="tabpanel" class="tab-pane" id="undergrad-sections">
                    <div class="row">
                        <div class="col-md-12">
                            <br>
                            @if($undergrad_school_sections_count>0)
                                <h3>Sections in this school</h3>
                                <p class="lead"> {{{ $undergrad_assessed_sections_count }}} out of {{{ $undergrad_school_sections_count }}} section(s) doing Assessment ({{{ round($undergrad_assessed_sections_count/$undergrad_school_sections_count*100, 2) }}}%)</p>
                                <p>Note that some sections may have assessed activities but unpublished results. Unplublished results are <strong>not considered</strong>.</p>

                                <table class="table table-striped table-condensed datatable">
                                    <thead>
                                        <tr>
                                            <th>Identifier</th>
                                            <th>Name</th>
                                            <th>Program</th>
                                            <th>Professor</th>
                                            <th>Assessed Activities</th>
                                            <th>Published Results</th>
                                        </tr>
                                    </thead>
                                    <tfoot>
                                        <tr class="column-search">
                                            <th><input class="column-search-bar form-control" type="text" placeholder="Buscar"/></th>
                                            <th><input class="column-search-bar form-control" type="text" placeholder="Buscar"/></th>
                                            <th><input class="column-search-bar form-control" type="text" placeholder="Buscar"/></th>
                                            <th><input class="column-search-bar form-control" type="text" placeholder="Buscar"/></th>
                                            <th><select class="column-search-select form-control"><option value=""></option></select></th>
                                            <th><select class="column-search-select form-control"><option value=""></option></select></th>
                                        </tr>
                                    </tfoot>
                                    <tbody>
                                        @foreach($school->programs as $program)
                                            @foreach($program->courses as $course)
                                            <tr>
                                                <td class="col-md-2">{{ HTML::linkAction('CoursesController@showLimited', $course->code.$course->number.'-'.$course->section.' ('.$course->semester->code.')', array('id'=>$course->id)) }}</td>
                                                <td class="col-md-3">{{{ $course->name}}}</td>
                                                <td class="col-md-2">{{{ $course->program->name }}}</td>
                                                <td class="col-md-3">{{{ $course->user->surnames }}}, {{{ $course->user->first_name }}}</td>
                                                <td class="col-md-1">
                                                    @if(count($course->assessedActivities))
                                                        Yes
                                                    @else
                                                        No
                                                    @endif
                                                </td>
                                                <td class="col-md-1">
                                                    @if(count($course->publishedActivities))
                                                        Yes
                                                    @else
                                                        No
                                                    @endif
                                                </td>
                                            </tr>
                                            @endforeach
                                        @endforeach
                                    </tbody>
                                </table>
                            @else
                                <p class="lead"> No sections doing Assessment (0%)</p>
                            @endif
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
        
    <div role="tabpanel" class="tab-pane" id="graduate">
        <div class="row">
            <div class="col-md-9 graph" id="graph-grad"></div>
                <div class="col-md-3">
                <br>
                    <div class="panel panel-default panel-scrolling">
                        <div class="panel-heading" role="tab" id="headingOne">
                            <h4 class="panel-title">
                                Programs
                            </h4>
                        </div>
                        <div class="panel-collapse collapse in" role="tabpanel" aria-labelledby="headingOne">
                            <table class="table table-striped table-condensed">
                                <tr>
                                    <th>Name</th>
                                    <th>Participation</th>
                                </tr>
                                @foreach ($grad_programs as $program)
                                    <tr>
                                        <td>{{ HTML::linkAction('ProgramsController@show', $program->name, array($program->id)) }}</td>
                                        <td class="text-center">
                                            @if(in_array($program->id, $participating_programs))
                                                <span class="glyphicon glyphicon-ok"></span>
                                            @endif
                                        </td>
                                    </tr>
                                @endforeach
                            </table>
                        </div>
                    </div>
                </div>
            </div>

        <div>
            <!-- Nav tabs -->
            <ul id="gradSchoolTabs" class="nav nav-tabs" role="tablist">
                <li role="presentation" class="active"><a href="#grad-outcomes-assessed" aria-controls="grad-outcomes-assessed" role="tab">Assessment Results by Learning Outcomes in Academic Programs</a></li>
                <li role="presentation"><a href="#grad-courses" aria-controls="grad-courses" role="tab"> Graduate Courses</a></li>
                <li role="presentation"><a href="#grad-sections" aria-controls="grad-sections" role="tab">Sections</a></li>
            </ul>

            <!-- Tab panes -->
            <div class="tab-content">
                <div role="tabpanel" class="tab-pane active" id="grad-outcomes-assessed">
                    <div class="row">
                        <div class="col-md-12">
                            <table class="table table-striped table-condensed">
                                <thead>
                                    <th>Learning Outcome</th>
                                    <th>Programs doing Assessment</th>
                                    <th>Programs Achieved</th>
                                    <th>Success Rate</th>
                                </thead>
                                <tbody>
                                    @foreach($outcomes as $outcome)
                                        <tr>
                                            <td class="col-md-6">{{ link_to_action('OutcomesController@show', $outcome->name, array($outcome->id), $attributes = array()) }}</td>
                                            <td class="col-md-2">{{{ $attemptedGradProgramsPerOutcome[$outcome->id] }}}</td>
                                            <td class="col-md-2">{{{ $achievedGradProgramsPerOutcome[$outcome->id] }}}</td>
                                            <td class="col-md-2">
                                                @if($attemptedGradProgramsPerOutcome[$outcome->id]!=0)
                                                    {{{ round($achievedGradProgramsPerOutcome[$outcome->id] / $attemptedGradProgramsPerOutcome[$outcome->id]*100, 2) }}}%
                                                @else
                                                    N/M
                                                @endif
                                            </td>
                                        </tr>
                                    @endforeach
                                </tbody>
                                <tfoot></tfoot>
                                <caption>N/M: Not Measured</caption>
                            </table>
                        </div>
                    </div>
                </div>

                <div role="tabpanel" class="tab-pane" id="grad-courses">
                    <div class="row">
                        <div class="col-md-12">
                            <br>

                            <h3>Courses in this school</h3>
                            <p>Note that some sections may have assessed activities but unpublished results. Unpublished results are <strong>not considered</strong>. Check the Sections tab for a breakdown.</p>

                            @if($grad_school_sections_count>0)
                                <table class="table table-striped table-condensed datatable">
                                    <thead>
                                        <tr>
                                            <th>Identifier</th>
                                            <th>Name</th>
                                            <th>Program</th>
                                            <th>Assessed and Published</th>
                                        </tr>
                                    </thead>
                                    <tfoot>
                                        <tr class="column-search">
                                            <th><input class="column-search-bar form-control" type="text" placeholder="Buscar"/></th>
                                            <th><input class="column-search-bar form-control" type="text" placeholder="Buscar"/></th>
                                            <th><input class="column-search-bar form-control" type="text" placeholder="Buscar"/></th>
                                            <th><select class="column-search-select form-control"><option value=""></option></select></th>
                                        </tr>
                                    </tfoot>
                                    <tbody>
                                        @foreach($grad_grouped_courses as $grouped_course)
                                            <tr>
                                                <td class="col-md-2">{{ HTML::linkAction('CoursesController@showGrouped', $grouped_course->code.$grouped_course->number.' ('.$grouped_course->semester->code.')', array($grouped_course->code, $grouped_course->number, $grouped_course->semester->code)) }}</td>
                                                <td class="col-md-4">{{{ $grouped_course->name}}}</td>
                                                <td class="col-md-2">{{{ $grouped_course->program->name }}}</td>
                                                <td class="col-md-1">
                                                    @if($grouped_course->outcomes_attempted!=NULL)
                                                        Yes
                                                    @else
                                                        No
                                                    @endif
                                                </td>
                                            </tr>
                                        @endforeach
                                    </tbody>
                                </table>
                            @else
                                <p class="lead"> No courses doing Assessment (0%)</p>
                            @endif
                        </div>
                    </div>
                </div>

                <div role="tabpanel" class="tab-pane" id="grad-sections">
                    <div class="row">
                        <div class="col-md-12">
                            <br>
                            @if($grad_school_sections_count>0)
                                <h3>Sections in this school</h3>
                                <p class="lead"> {{{ $grad_assessed_sections_count }}} out of {{{ $grad_school_sections_count }}} section(s) doing Assessment ({{{ round($grad_assessed_sections_count/$grad_school_sections_count*100, 2) }}}%)</p>
                                <p>Note that some sections may have assessed activities but unpublished results. Unplublished results are <strong>not considered</strong>.</p>

                                <table class="table table-striped table-condensed datatable">
                                    <thead>
                                        <tr>
                                            <th>Identifier</th>
                                            <th>Name</th>
                                            <th>Program</th>
                                            <th>Professor</th>
                                            <th>Assessed Activities</th>
                                            <th>Published Results</th>
                                        </tr>
                                    </thead>
                                    <tfoot>
                                        <tr class="column-search">
                                            <th><input class="column-search-bar form-control" type="text" placeholder="Buscar"/></th>
                                            <th><input class="column-search-bar form-control" type="text" placeholder="Buscar"/></th>
                                            <th><input class="column-search-bar form-control" type="text" placeholder="Buscar"/></th>
                                            <th><input class="column-search-bar form-control" type="text" placeholder="Buscar"/></th>
                                            <th><select class="column-search-select form-control"><option value=""></option></select></th>
                                            <th><select class="column-search-select form-control"><option value=""></option></select></th>
                                        </tr>
                                    </tfoot>
                                    <tbody>
                                        @foreach($school->programs as $program)
                                            @foreach($program->courses as $course)
                                            <tr>
                                                <td class="col-md-2">{{ HTML::linkAction('CoursesController@showLimited', $course->code.$course->number.'-'.$course->section.' ('.$course->semester->code.')', array('id'=>$course->id)) }}</td>
                                                <td class="col-md-3">{{{ $course->name}}}</td>
                                                <td class="col-md-2">{{{ $course->program->name }}}</td>
                                                <td class="col-md-3">{{{ $course->user->surnames }}}, {{{ $course->user->first_name }}}</td>
                                                <td class="col-md-1">
                                                    @if(count($course->assessedActivities))
                                                        Yes
                                                    @else
                                                        No
                                                    @endif
                                                </td>
                                                <td class="col-md-1">
                                                    @if(count($course->publishedActivities))
                                                        Yes
                                                    @else
                                                        No
                                                    @endif
                                                </td>
                                            </tr>
                                            @endforeach
                                        @endforeach
                                    </tbody>
                                </table>
                            @else
                                <p class="lead"> No sections doing Assessment (0%)</p>
                            @endif
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

@stop

@section('included-js')

<!-- HighCharts -->
<script src="{{ asset('vendor/highcharts/highcharts.js') }}"></script>
<!--script src="http://code.highcharts.com/modules/exporting.js"></script -->

<!-- Datatables -->
@include('global._datatables_js')

@stop

@section('javascript')
$(function () {

    $('#undergradSchoolTabs a').click(function (e) {
        e.preventDefault()
        $(this).tab('show');
    });

    $('#gradSchoolTabs a').click(function (e) {
        e.preventDefault()
        $(this).tab('show');
    });

    $('#levelTabs a').click(function (e) {
        e.preventDefault()
        $(this).tab('show');
    
    
        $('#graph-undergrad').highcharts({
            chart: {
                type: 'bar'
            },
            title: {
                text: 'Undergraduate Performance by Learning Outcome Criteria in {{ $school->name }}'
            },
            legend: {
                reversed: true,
            },
            xAxis: {
                categories: [
                    @foreach($outcomes as $outcome)
                        "{{{ $outcome->name }}}",
                    @endforeach
                ],
                labels: {
                    style: {
                        fontSize:'11px'
                    },
                    step:1,
                    useHTML:true,
                    formatter: function() {
                        return '<div style="width:200px; word-break:break; text-overflow:ellipsis; overflow:hidden;">'+this.value+'</div>';
                    },
                }
            },
            yAxis: {
                min: 0,
                max: 100,
                title: {
                    text: 'Percentage'
                }
            },
            tooltip: {
                headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
                pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
                    '<td style="padding:0"><b>{point.y:.2f}</b></td></tr>',
                footerFormat: '</table>',
                shared: true,
                useHTML: true
            },
            plotOptions: {
                bar: {
                    //grouping: false,
                    shadow: false,
                    borderWidth: 0,
                },
                series: {
                pointPadding: 0,
                groupPadding: 0.075
                },
            },
            series: [{
                name: 'Expected Value',
                color: '#555555',
                dataLabels: {
                    enabled: true,
                    fontSize: 8,
                    color: '#fff',
                    align: 'right',
                    format: '{y:.1f}%',
                    style: {
                        //fontWeight: 'bold'
                    },
                    y:-1
                },
                data: [
                    @foreach($outcomes as $index => $outcome)
                        @if(
                            is_array($undergrad_outcomes_attempted)
                            && array_key_exists($outcome->id, $undergrad_outcomes_attempted)
                            && $undergrad_outcomes_attempted[$outcome->id]!=0)
                            {{{ $outcome->expected_outcome }}},
                        @else
                            0,
                        @endif
                    @endforeach
                ],
                pointPadding: 0,
            }, {
                name: 'Obtained Value',
                color: '#e70033',
                dataLabels: {
                    enabled: true,
                    fontSize: 8,
                    color: '#fff',
                    align: 'right',
                    format: '{y:.1f}%',
                    style: {
                        //fontWeight: 'bold'
                    },
                    y:-1
                },
                data:[
                    @foreach($outcomes as $index => $outcome)
                        @if(
                            is_array($undergrad_outcomes_attempted)
                            && array_key_exists($outcome->id, $undergrad_outcomes_attempted)
                            && $undergrad_outcomes_attempted[$outcome->id]!=0)
                            {{{ ($undergrad_outcomes_achieved[$outcome->id]/$undergrad_outcomes_attempted[$outcome->id])*100 }}},
                        @else
                            0,
                        @endif
                    @endforeach
                ],
                pointPadding: 0,
            }]
        });

        $('#graph-grad').highcharts({
            chart: {
                type: 'bar'
            },
            title: {
                text: 'Graduate Performance by Learning Outcome Criteria in {{ $school->name }}'
            },
            legend: {
                reversed: true,
            },
            xAxis: {
                categories: [
                    @foreach($outcomes as $outcome)
                        "{{{ $outcome->name }}}",
                    @endforeach
                ],
                labels: {
                    style: {
                        fontSize:'11px'
                    },
                    step:1,
                    useHTML:true,
                    formatter: function() {
                        return '<div style="width:200px; word-break:break; text-overflow:ellipsis; overflow:hidden;">'+this.value+'</div>';
                    },
                }
            },
            yAxis: {
                min: 0,
                max: 100,
                title: {
                    text: 'Percentage'
                }
            },
            tooltip: {
                headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
                pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
                    '<td style="padding:0"><b>{point.y:.2f}</b></td></tr>',
                footerFormat: '</table>',
                shared: true,
                useHTML: true
            },
            plotOptions: {
                bar: {
                    //grouping: false,
                    shadow: false,
                    borderWidth: 0,
                },
                series: {
                pointPadding: 0,
                groupPadding: 0.075
                },
            },
            series: [{
                name: 'Expected Value',
                color: '#555555',
                dataLabels: {
                    enabled: true,
                    fontSize: 8,
                    color: '#fff',
                    align: 'right',
                    format: '{y:.1f}%',
                    style: {
                        //fontWeight: 'bold'
                    },
                    y:-1
                },
                data: [
                    @foreach($outcomes as $index => $outcome)
                        @if(
                            is_array($grad_outcomes_attempted)
                            && array_key_exists($outcome->id, $grad_outcomes_attempted)
                            && $grad_outcomes_attempted[$outcome->id]!=0)
                            {{{ $outcome->expected_outcome }}},
                        @else
                            0,
                        @endif
                    @endforeach
                ],
                pointPadding: 0,
            }, {
                name: 'Obtained Value',
                color: '#e70033',
                dataLabels: {
                    enabled: true,
                    fontSize: 8,
                    color: '#fff',
                    align: 'right',
                    format: '{y:.1f}%',
                    style: {
                        //fontWeight: 'bold'
                    },
                    y:-1
                },
                data:[
                    @foreach($outcomes as $index => $outcome)
                        @if(
                            is_array($grad_outcomes_attempted)
                            && array_key_exists($outcome->id, $grad_outcomes_attempted)
                            && $grad_outcomes_attempted[$outcome->id]!=0)
                            {{{ ($grad_outcomes_achieved[$outcome->id]/$grad_outcomes_attempted[$outcome->id])*100 }}},
                        @else
                            0,
                        @endif
                    @endforeach
                ],
                pointPadding: 0,
            }]
        });
    });

    $('#graph-undergrad').highcharts({
            chart: {
                type: 'bar'
            },
            title: {
                text: 'Undergraduate Performance by Learning Outcome Criteria in {{ $school->name }}'
            },
            legend: {
                reversed: true,
            },
            xAxis: {
                categories: [
                    @foreach($outcomes as $outcome)
                        "{{{ $outcome->name }}}",
                    @endforeach
                ],
                labels: {
                    style: {
                        fontSize:'11px'
                    },
                    step:1,
                    useHTML:true,
                    formatter: function() {
                        return '<div style="width:200px; word-break:break; text-overflow:ellipsis; overflow:hidden;">'+this.value+'</div>';
                    },
                }
            },
            yAxis: {
                min: 0,
                max: 100,
                title: {
                    text: 'Percentage'
                }
            },
            tooltip: {
                headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
                pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
                    '<td style="padding:0"><b>{point.y:.2f}</b></td></tr>',
                footerFormat: '</table>',
                shared: true,
                useHTML: true
            },
            plotOptions: {
                bar: {
                    //grouping: false,
                    shadow: false,
                    borderWidth: 0,
                },
                series: {
                pointPadding: 0,
                groupPadding: 0.075
                },
            },
            series: [{
                name: 'Expected Value',
                color: '#555555',
                dataLabels: {
                    enabled: true,
                    fontSize: 8,
                    color: '#fff',
                    align: 'right',
                    format: '{y:.1f}%',
                    style: {
                        //fontWeight: 'bold'
                    },
                    y:-1
                },
                data: [
                    @foreach($outcomes as $index => $outcome)
                        @if(
                            is_array($undergrad_outcomes_attempted)
                            && array_key_exists($outcome->id, $undergrad_outcomes_attempted)
                            && $undergrad_outcomes_attempted[$outcome->id]!=0)
                            {{{ $outcome->expected_outcome }}},
                        @else
                            0,
                        @endif
                    @endforeach
                ],
                pointPadding: 0,
            }, {
                name: 'Obtained Value',
                color: '#e70033',
                dataLabels: {
                    enabled: true,
                    fontSize: 8,
                    color: '#fff',
                    align: 'right',
                    format: '{y:.1f}%',
                    style: {
                        //fontWeight: 'bold'
                    },
                    y:-1
                },
                data:[
                    @foreach($outcomes as $index => $outcome)
                        @if(
                            is_array($undergrad_outcomes_attempted)
                            && array_key_exists($outcome->id, $undergrad_outcomes_attempted)
                            && $undergrad_outcomes_attempted[$outcome->id]!=0)
                            {{{ ($undergrad_outcomes_achieved[$outcome->id]/$undergrad_outcomes_attempted[$outcome->id])*100 }}},
                        @else
                            0,
                        @endif
                    @endforeach
                ],
                pointPadding: 0,
            }]
        });

    // Include dummy graph for outcomes
    @include('global.dummy-outcomes')
});

@stop