123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404 |
- @extends('layouts.master')
-
- @section('navigation')
- @if(Auth::user()->role==1)
- @include('local.managers.admins._navigation')
- @elseif(Auth::user()->role==2)
- @include('local.managers.sCoords._new_navigation')
- @elseif(Auth::user()->role==3)
- @include('local.managers.pCoords._new_navigation')
- @endif
- @stop
-
- @section('main')
-
- <div class="row">
- <div class="col-md-3">
- <div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
-
- <!-- Form to add a new Learning Outcome -->
- <!-- <div class="panel panel-default">
- <div class="panel-heading">
- New Learning Outcome
- </div>
- <div class="panel-body">
- {{ Form::open(array('action' => 'OutcomesController@create')) }}
-
- <div class="form-group">
- {{ Form::label('name', 'Name') }}
- {{ Form::text('name', '', array('class' => 'form-control')) }}
- </div>
-
- <div class="form-group">
- {{ Form::label('definition', 'Definition') }}
- {{ Form::textarea('definition', '', array('class' => 'form-control', 'rows'=>2)) }}
- </div>
-
- {{ Form::submit('Submit', array('class' => 'btn btn-primary btn-block')) }}
-
- {{ Form::close() }}
- </div>
- </div> -->
-
- <!-- Form to add a new criterion -->
- <div class="panel panel-default panel-button">
- <div class="panel-heading">
- Create
- </div>
- <div class="panel-body">
- {{ Form::open(array('action' => 'CriteriaController@create')) }}
-
- <div class="form-group">
- {{ Form::label('outcome_id', 'Associated Learning Outcome') }}
- <select name="outcome_id" class="form-control">
- @foreach ($outcomes as $outcome)
- <option value="{{ $outcome->id }}">{{ $outcome->name }}</option>
- @endforeach
- </select>
- </div>
-
- <div class="form-group">
- {{ Form::label('name', 'Name') }}
- {{ Form::text('name', '', array('class' => 'form-control')) }}
- </div>
-
- <div class="form-group">
- {{ Form::label('description12', 'Beginning (1-2)') }}
- {{ Form::textarea('description12', '', array('class' => 'form-control', 'rows'=>2)) }}
- </div>
-
- <div class="form-group">
- {{ Form::label('description34', 'In Progress (3-4)') }}
- {{ Form::textarea('description34', '', array('class' => 'form-control', 'rows'=>2)) }}
- </div>
-
- <div class="form-group">
- {{ Form::label('description56', 'Satisfactory (5-6)') }}
- {{ Form::textarea('description56', '', array('class' => 'form-control', 'rows'=>2)) }}
- </div>
-
- <div class="form-group">
- {{ Form::label('description78', 'Excellent (7-8)') }}
- {{ Form::textarea('description78', '', array('class' => 'form-control', 'rows'=>2)) }}
- </div>
-
- {{ Form::submit('Create', array('class' => 'btn btn-primary btn-block')) }}
- {{ Form::close() }}
- </div>
- </div>
-
- <div class="panel panel-default panel-button">
- <div class="panel-heading">
- Edit
- </div>
- <div class="panel-body">
- {{ Form::open(array('action' => 'CriteriaController@update')) }}
-
- <div class="form-group">
- {{ Form::label('criterion_id', 'Criterion') }}
- <select id="select-criterion" name="id" class="form-control">
- @foreach ($criteria as $criterion)
- <option value="{{ $criterion->id }}">{{ $criterion->name }}</option>
- @endforeach
- </select>
- </div>
-
- <div class="form-group">
- {{ Form::label('assoc_outcome_id', 'Associated Learning Outcome') }}
- <select id="assoc_outcome_id" name="outcome_id" class="form-control">
- @foreach ($outcomes as $outcome)
- <option value="{{ $outcome->id }}">{{ $outcome->name }}</option>
- @endforeach
- </select>
- </div>
-
- <div class="form-group">
- {{ Form::label('name', 'Name') }}
- {{ Form::text('name', Input::old('name'), array('class' => 'form-control', 'id'=>'criterion_name')) }}
- </div>
-
- <div class="form-group">
- {{ Form::label('description12', 'Beginning (1-2)') }}
- {{ Form::textarea('description12', Input::old('description12'), array('class' => 'form-control', 'rows'=>2, 'id'=>'criterion_description12')) }}
- </div>
-
- <div class="form-group">
- {{ Form::label('description34', 'In Progress (3-4)') }}
- {{ Form::textarea('description34', Input::old('description34'), array('class' => 'form-control', 'rows'=>2, 'id'=>'criterion_description34')) }}
- </div>
-
- <div class="form-group">
- {{ Form::label('description56', 'Satisfactory (5-6)') }}
- {{ Form::textarea('description56', Input::old('description56'), array('class' => 'form-control', 'rows'=>2, 'id'=>'criterion_description56')) }}
- </div>
-
- <div class="form-group">
- {{ Form::label('description78', 'Excellent (7-8)') }}
- {{ Form::textarea('description78', Input::old('description78'), array('class' => 'form-control', 'rows'=>2, 'id'=>'criterion_description78')) }}
- </div>
-
- {{ Form::submit('Update', array('class' => 'btn btn-primary btn-block')) }}
- {{ Form::close() }}
- </div>
- </div>
-
- <div class="panel panel-default panel-button">
- <div class="panel-heading">
- Change Status
- </div>
- <div class="panel-body">
- <p>Use this form to deactivate or reactivate criteria. Inactive criteria will
- stay in the system, but will not be available to use in new rubrics.</p>
- {{ Form::open(array('action' => 'CriteriaController@destroy', 'method'=>'delete')) }}
-
- <div class="form-group">
- {{ Form::label('criterion_id', 'Criterion') }}
- <select id="select-criterion-with-status" name="id" class="form-control">
- @foreach ($criteria as $criterion)
- <option data-status="{{ $criterion->trashed() }}" value="{{ $criterion->id }}">{{ $criterion->name }}</option>
- @endforeach
- </select>
- </div>
-
- <div class="form-group">
- {{ Form::label('status', 'Status') }}
- <p name="status" id="status" class="form-control-static"></p>
- </div>
-
- {{ Form::submit('Change', array('class' => 'btn btn-primary btn-block')) }}
- {{ Form::close() }}
- </div>
- </div>
-
- <!-- Form to edit a Learning Outcome -->
- <!-- <div class="panel panel-default">
- <div class="panel-heading">
- Edit a Learning Outcome
- </div>
- <div class="panel-body">
- {{ Form::open(array('action' => 'OutcomesController@update')) }}
-
- <div class="form-group">
- {{ Form::label('outcome_id', 'Learning Outcome') }}
- <select id="select-outcome" name="id" class="form-control">
- @foreach ($outcomes as $outcome)
- <option value="{{ $outcome->id }}">{{ $outcome->name }}</option>
- @endforeach
- </select>
- </div>
-
- <div class="form-group">
- {{ Form::label('name', 'Name') }}
- {{ Form::text('name', Input::old('name'), array('class' => 'form-control', 'id'=>'outcome_name')) }}
- </div>
-
- <div class="form-group">
- {{ Form::label('definition', 'Definition') }}
- {{ Form::textarea('definition', Input::old('definition'), array('class' => 'form-control', 'rows'=>2, 'id'=>'outcome_definition')) }}
- </div>
-
- {{ Form::submit('Update', array('class' => 'btn btn-primary btn-block')) }}
-
- {{ Form::close() }}
- </div>
- </div> -->
-
- </div>
-
- <ul class="list-group">
- @foreach ($outcomes as $outcome)
- <li data-outcome-id="{{ $outcome->id }}"class="list-group-item">{{ $outcome->name }}</li>
- @endforeach
- </ul>
- </div>
-
- <div class="col-md-9">
- <div id="outcome-display" class="panel panel-default">
- <div class="panel-heading">
- <div class="panel-title"></div>
- </h4>
- </div>
- <div class="panel-body">
- <p class="outcome-definition"></p>
- <table class="table table-striped table-condensed">
- <thead><tr><th>Criterion</th><th>Beginning (1-2)</th><th>In Progress (3-4)</th><th>Satisfactory (5-6)</th><th>Excellent (7-8)</th></tr></thead>
- <tbody>
- </tbody>
- </table>
- </div>
- </div>
- </div>
-
- <div class="col-md-9">
- <div class="no-outcome alert alert-info">
- <p>Select a Learning Outcome to view its criteria.</p>
- </div>
- </div>
-
- </div>
- @stop
-
- @section('javascript')
-
-
- // --------------------------------------------------------------------------
- // Page load
- // --------------------------------------------------------------------------
-
- // Hide accordion panel contents by default
- $('.panel-group .panel-body').hide();
-
- $('#outcome-display').parent().hide();
-
- fetchOutcomeForEditing();
- fetchCriterionForEditing();
- setCriterionStatus();
-
-
-
-
- // --------------------------------------------------------------------------
- // Functions
- // --------------------------------------------------------------------------
-
- // Fetch outcome info for editing
- function fetchOutcomeForEditing()
- {
- var id = $('#select-outcome').find(':selected').val();
-
- $.post(
- "{{ URL::action('OutcomesController@fetchOutcome') }}",
- { id: id },
- function(json)
- {
- var name = json.outcome.name;
- var definition = json.outcome.definition;
-
- //Display title and definition
- $('#outcome_name').val(name);
- $('#outcome_definition').text(definition);
- },
- 'json'
- );
- }
-
- // Fetch criterion info for editing
- function fetchCriterionForEditing()
- {
- var id = $('#select-criterion').find(':selected').val();
-
- $.post(
- "{{ URL::action('CriteriaController@fetchCriterionWithTrashed') }}",
- { id: id },
- function(json)
- {
- var name = json.name;
- var description12 = json.description12;
- var description34 = json.description34;
- var description56 = json.description56;
- var description78 = json.description78;
-
- // Display title and definition
- $('#criterion_name').val(name);
- $('#criterion_description12').text(description12);
- $('#criterion_description34').text(description34);
- $('#criterion_description56').text(description56);
- $('#criterion_description78').text(description78);
-
- // Select associated outcome
- $('#assoc_outcome_id').val(json.outcome_id);
- },
- 'json'
- );
- }
-
- // Set criterion status
- function setCriterionStatus()
- {
- $('#select-criterion-with-status').find(':selected').data('status')
- switch($('#select-criterion-with-status').find(':selected').data('status'))
- {
- case 1:
- $('#status').text('Inactive');
- break;
- default:
- $('#status').text('Active');
- break;
-
- }
- }
-
- // --------------------------------------------------------------------------
- // Events
- // --------------------------------------------------------------------------
-
- // When panel heading is clicked, toggle it
- $('.panel-group .panel-heading').on('click', function()
- {
- $(this).next().stop().slideToggle();
- })
-
- // When list item is clicked, load corresponding info
- $('.list-group-item').on('click', function()
- {
- var id = $(this).data('outcome-id');
-
- $.post(
- "{{ URL::action('OutcomesController@fetchOutcome') }}",
- { id: id },
- function(json)
- {
- var name = json.outcome.name;
- var definition = json.outcome.definition;
- var criteria =json.outcome.criteria;
- var deleted = json.outcome.deleted_at;
-
-
- $('#outcome-display').parent().show();
- $('.no-outcome').parent().hide();
-
- //Display title and definition
- $('#outcome-display .panel-title').html(name);
- $('#outcome-display .outcome-definition').html(definition);
-
-
- //Empty table body
- $('tbody').empty();
-
- if(criteria.length>0)
- {
- $('table').show();
- $.each(criteria, function(index, value)
- {
- $('tbody').append('<tr><td >'+value.name+'</td><td >'+value.description12+'</td><td >'+value.description34+'</td><td >'+value.description56+'</td><td >'+value.description78+'</td></tr>');
- });
- }
- else
- {
- $('table').hide();
- }
- },
- 'json'
- );
-
- });
-
- // When list item is clicked, load corresponding info
- $('#select-outcome').on('change', function()
- {
- fetchOutcomeForEditing();
- });
-
- // When list item is clicked, load corresponding info
- $('#select-criterion').on('change', function()
- {
- fetchCriterionForEditing();
- });
-
- // When list item is clicked, load corresponding info
- $('#select-criterion-with-status').on('change', function()
- {
- setCriterionStatus();
- });
-
- @stop
|