@extends('layouts.master') @section('navigation') @include('local.managers.admins._navigation') @stop @section('main')
Create new activity
{{ Form::open(array('action' => 'ActivitiesController@update')) }}
{{ Form::label('activity_type', 'Activity Type') }} {{-- {{ Form::text('activity_type', Input::old('activity_Type'), array('class' => 'form-control', 'placeholder'=>'TEST', 'maxLength'=>5)) }}--}}
{{ Form::label('outcome', 'Learning Outcome') }}
{{ Form::label('objective', 'Learning Objective') }}
{{ Form::label('instrument', 'Instrument') }}
{{ Form::label('transforming_action', 'Transformative Actions') }}

{{ Form::submit('Submit', array('class' => 'btn btn-primary btn-block', 'name'=>'create_activity')) }} {{ Form::close() }}
@stop @section('javascript') // -------------------------------------------------------------------------- // Page load // -------------------------------------------------------------------------- const objectives = {{ $objectives_by_outcome->toJson() }}; const criteria = {{ $criteria_by_objective->toJson() }}; const outcomesSelect = document.getElementById('outcome'); const objectivesSelect = document.getElementById('objective'); const criteriaSelect = document.getElementById('criteria'); // -------------------------------------------------------------------------- // Functions // -------------------------------------------------------------------------- // -------------------------------------------------------------------------- // Events // -------------------------------------------------------------------------- outcomesSelect.addEventListener('change', (event) => { var objectivesSelectOptions = []; objectives[event.target.value].forEach((objective) => { objectivesSelectOptions.push(``); }); objectivesSelect.innerHTML = objectivesSelectOptions.join(); }); objectivesSelect.addEventListener('change', (event) => { var criteriaSelectOptions = []; var selectedObjectives = Array.from(objectivesSelect.selectedOptions).map(v => value); selectedObjectives.forEach((objectiveId) => { criteria[objectiveId].forEach((criteriaArray) => { criteriaArray.forEach((criteria) => { criteriaSelectOptions.push(``); }); }); }); criteriaSelect.innerHTML = criteriaSelectOptions.join(); }); @stop