<repo_name>csantala/learn<file_sep>/application/views/components/ajax/synopsis_editor.php
<?php date_default_timezone_set($timezone);?>
	<script type="text/javascript" src="/js/script.js"></script>
				<span class="synopsis">
		                <div class="rows" data-assignment_id="<?php echo $assignment_id?>" data-step_id="<?php echo $step_id?>" data-session="0">
		                    <table class="ExcelTable2013">
		                        <tr style="color:#bbb">
		                            <!--th></th>
		                            <th>task
		                            <span class="details pull-right">elapsed time: <span id="elapsed_time"></span>&nbsp;</span></th-->
		                        </tr>
		                            <?php
		                                foreach ($rows as $row) { ?>
		                                    <tr class="rowx">
		                                        <td class="start">
		                                        	<span data-time="<?php echo $row->time ?>"><?php echo date('g:i:s', $row->time);?></span>
		                                        </td>
		                                        <td>
		                                            <input data-time="<?php echo $row->time ?>" data-step_id="<?php echo $step_id?>" maxlength="300" class="task span10" type="text" data-i="<?php echo $row->position; ?>" <?php if ($row->task != '') { ?> value="<?php echo quotes_to_entities($row->task); ?>"<?php } ?>/>
		                                        </td>
		                                    </tr>
		                            <?php } ?>
		                    </table>
		                </div>
		            </span>
		            <br /><file_sep>/application/views/dashboard_view.php
<?php
	$dashboard_tip = "Bookmark this page for future reference.";
	$assignment_tip = "Email or Text this URL to your students.";
	$progress_tip = "Student progress appears in this panel.  Click a Report link to view a report of the student's synopsis. Report links only appear when a student has submitted their completed work.";
	$student_tip = "Click name for student worksheet.";
?>

<!DOCTYPE html>
<!--[if lt IE 7]> <html class="ie lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>    <html class="ie lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>    <html class="ie lt-ie9"> <![endif]-->
<!--[if gt IE 8]> <html class="ie gt-ie8"> <![endif]-->
<!--[if !IE]><!--><html><!-- <![endif]-->
<head>
	<title>Dashboard</title>
    <!-- Meta -->
    <meta charset="UTF-8" />
    <meta http-equiv="refresh" content="120">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
   	<!--[if IE]><meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'><![endif]-->

    <!-- Bootstrap -->
    <link href="/common/bootstrap/css/bootstrap.css" rel="stylesheet" />
    <link href="/common/bootstrap/css/responsive.css" rel="stylesheet" />

	<script type="application/javascript" src="/js/wysihtml5-0.3.0_rc2.js" ></script>
	<script type="application/javascript" src="/js/jquery-1.7.1.min.js"></script>
	<script type="application/javascript" src="/js/bootstrap.min.js"></script>
	<script type="application/javascript" src="/js/bootstrap-wysihtml5.js"></script>

    <!-- Glyphicons Font Icons -->
    <link href="/common/theme/css/glyphicons.css" rel="stylesheet" />

    <!-- Uniform Pretty Checkboxes -->
    <link href="/common/theme/scripts/plugins/forms/pixelmatrix-uniform/css/uniform.default.css" rel="stylesheet" />

    <!-- Main Theme Stylesheet :: CSS -->
    <link href="/common/theme/css/style-light.css?1369753444" rel="stylesheet" />

    <!-- General css -->
    <link href="/css/style.css" rel="stylesheet" type="text/css" />

    <!-- LESS.js Library -->
    <script src="/common/theme/scripts/plugins/system/less.min.js"></script>

    <script src="/js/bookmark.js"></script>
    <script src="/js/learn.js"></script>
</head>
<body data-dashboard_id="<?php echo $dashboard_id;?>">
	<h4 id="assignment_header"></h4>
	<h5><?php echo $course . " " . $instructor;?></h5>
<br>
   <h5>ASSIGNMENT URL&nbsp;&bull;&nbsp;<a href="#" data-toggle="tooltip" title="" data-placement="bottom" data-original-title="<?php echo $assignment_tip;?>">?</a></h5>
   <p>
  	 <input onclick="select()" class="span9" style="color:#008000" type="text" value="<?php echo $assignment_url;?>">
  	</p>
		<h5>OBJECTIVE</h5>
		<p>
			<textarea style="vertical-align: middle; color:#000;" tabindex="1" class="span9 objective" name="objective"><?php echo $objective;?></textarea>
			 <a id="upd_obj" class="label add_synopsis" data-dashboard_id="<?php echo $dashboard_id;?>">update</a>
		</p>
<?php
	if (count($steps) > 0) { ?>
		<h5>STEPS</h5>
 <?php } ?>

			<?php
				$i = 1;
				foreach ($steps as $step) { ?>
					<p>
						<?php echo $i; $i++;?>. <input style="vertical-align: middle" class="span9 step<?php echo $step->id;?>" type="text" name="step<?php echo $step->id;?>" data-step_id="step<?php echo $step->id;?>" value="<?php echo quotes_to_entities($step->step);?>" >
						 <a class="upd_step label add_synopsis <?php echo $step->id;?>" data-step="<?php echo $step->id;?>">update</a>
					</p>
				<?php }
			?>

<br>
		<!--h4 id="progress">Progress&nbsp;&bull;&nbsp;<a href="#" data-toggle="tooltip" title="" data-original-title="<?php echo $progress_tip;?>">?</a></h4-->

		  <table id="scanner_data" class="dynamicTable table table-striped table-bordered table-condensed dataTable">
		  	<tr>
				<th>Worksheet&nbsp;&bull;&nbsp;<a href="#" data-toggle="tooltip" title="" data-placement="top" data-original-title="<?php echo $student_tip;?>">?</a></th>
				<th>Elapsed Time</th>
				<th>Status</th>
				<th>Grade</th>
			</tr>
			<?php
				if (! empty($scanner_data)) {
					foreach($scanner_data as $data) { //ds($data,1);?>
			<tr>
				<td><a target="_blank" href="/home/<?php echo $data->assignment_id;?>/<?php echo $data->synopsis_id;?>"><?php echo $data->student_name;?></a></td>
				<td><?php echo $data->elapsed_time;?></td>
				<td><?php echo $data->status;?></td>
				<td><?php echo $data->mark;?></td>
				<td><a target="_blank" href="/home/<?php echo $data->assignment_id;?>/<?php echo $data->synopsis_id;?>/<?php echo $dashboard_id;?>">mark assignment</a></td>

				<!--td><?php if ($data->report_url != '') { ?><a href="<?php echo $data->report_url;?>">Report</a><?php } else { echo "-----"; }?></td-->
			</tr>
			<?php } ?>
		<?php } else { ?>
			<?php for ($i = 0; $i < 4; $i++) { ?>
			<tr>
				<td class="scanner_cell" colspan="4">&nbsp;</td>
			</tr>
				<?php } ?>
		<?php } ?>
		</table>
	<hr>

<div id="getlost">
	<?php $this->load->view('/components/footer') ?>

</div>

<script src="/common/bootstrap/js/bootstrap.min.js"></script>
<script src="/common/theme/scripts/demo/common.js?1384198042"></script>
<!--script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script -->
</body>
</html><file_sep>/readme.md
LEARN 1.0 Copyright 2013-2014 by <NAME>

This is an experiment to aid the human learning process through the breakdown of an object into multiple steps with student/teacher interaction available at each step.  The system allows for an assignment to be created and then completed by students with their progress available at the assignment dashboard.  As this is a hashed based system, user accounts are not required.
<file_sep>/application/views/submitted_view.php
<?php // date_default_timezone_set($timezone); ?>
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="ie lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>    <html class="ie lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>    <html class="ie lt-ie9"> <![endif]-->
<!--[if gt IE 8]> <html class="ie gt-ie8"> <![endif]-->
<!--[if !IE]><!--><html><!-- <![endif]-->
<head>
	<title>Assignment</title>
	<meta name="description" content="Assignment Objectives and URL">
    <!-- Meta -->
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <!--[if IE]><meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'><![endif]-->

    <!-- Glyphicons Font Icons -->
    <link href="/common/theme/css/glyphicons.css" rel="stylesheet" />

    <!-- Uniform Pretty Checkboxes -->
    <link href="/common/theme/scripts/plugins/forms/pixelmatrix-uniform/css/uniform.default.css" rel="stylesheet" />

    <!-- Main Theme Stylesheet :: CSS -->
    <link href="/common/theme/css/style-light.css?1369753444" rel="stylesheet" />

    <!-- General css -->
    <link href="/css/style.css" rel="stylesheet" type="text/css" />

    <!-- LESS.js Library -->
    <script src="/common/theme/scripts/plugins/system/less.min.js"></script>
</head>
<body>
     <!-- Content -->
    <div id="contentx">
        <div class="innerLR innerT">
			<h4>Your worksheet has been submitted to your instructor.</h4>
	   		<h5>Worksheet permalink: <a href="<?php echo $worksheet_url;?>"><?php echo $worksheet_url;?></a></h5>
        </div>
	</div>

</body>
</html><file_sep>/application/controllers/home.php
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Home extends CI_Controller {

    public function __construct() {
        parent::__construct();
    }

    public function index() {
		$this->load->library('typography');

		$objective = '';

		$assignment_id = $this->uri->segment(2);
		$synopsis_id = $this->uri->segment(3);
		$dashboard_id = $this->uri->segment(4);

        if ($assignment_id) {
			$assignment = $this->Objectives_model->get_assignment($assignment_id);
			// verify dashboard id
			if ($dashboard_id == $assignment->dashboard_id) { $is_instructor = true; } else { $is_instructor = false; }
			if ($assignment == '') { show_404(); }
			$student_meta = $this->Synopsis_model->get_student($synopsis_id);

			$steps = $this->Step_model->get_steps_with_notes($assignment_id, $synopsis_id);
			// get synopsis for steps
			$rows = array();
			foreach ($steps as $step) {
				$rows[] = $this->Task_model->tasks($assignment_id,$step->id, $synopsis_id);
			}

			// get marked meta if any
			$data = compact('assignment_id', 'synopsis_id');
			$marked_meta = $this->Synopsis_model->get_mark($data);

           	$view_data = array(
           		'rows' => $rows,
           		'marked_meta' => $marked_meta,
           		'is_instructor' => $is_instructor,
           		'dashboard_id' => $dashboard_id,
           		'course' => $assignment->course,
				'instructor' => $assignment->instructor,
                'objective' => $assignment->objective,
                'assignment_id' => $assignment_id,
                'assignment_hash' => $assignment_id,
                'steps' => $steps,
                'date' => time(), //$rows[0]->time,
                'synopsis_id' => $synopsis_id,
                'assignment_hash' => $assignment_id,
                'session' => null,
                'project_id' => $assignment_id,
                'timezone' => $student_meta->timezone,
                'student_name' => $student_meta->student_name
            );
            //$this->load->view('editor_view', $view_data);
            $this->load->view('worksheet_view', $view_data);
        } else {
			show_404();
        	// TODO: generate proper id
            $assignment_id = time();
			$view_data = array(
				'assignment_id' => $assignment_id,
				'objective' => $objective
			);
            $this->load->view('home_view', $view_data);
        }
    }

	public function write_note() {
		$this->Note_model->write_note($_POST);
	}

    public function edit_objective() {
        $this->load->view('/components/ajax/edit_objective', $_POST);
    }

    public function update_objective() {
        // update this objective in db
        $data = array(
            'project_id' => $_POST['project_id'],
            'objective' => $_POST['objective']
        );
        $this->Objectives_model->update_objective($data);
        $this->load->view('/components/ajax/updated_objective', $_POST);
    }

	// synopsis editor ajax
	public function load_editor() {
    	$rows = $this->Task_model->tasks($_POST['assignment_id'],$_POST['step_id'],$_POST['synopsis_id']);
		// create new synopses if !$rows
		if (empty($rows)) {
       	    $rows[] = (object)array(
                'step_id' => $_POST['step_id'],
                'assignment_id' => $_POST['assignment_id'],
                'synopsis_id' => $_POST['synopsis_id'],
                'position' => 1,
                'session' => time(),
                'time' => time(),
                'task' => ''
            );
		}

		$view_vars = array(
			'assignment_id' => $_POST['assignment_id'],
			'synopsis_id' => $_POST['synopsis_id'],
			'step_id' => $_POST['step_id'],
			'rows' => $rows,
            'timezone' => $_POST['timezone']
		);

		$this->load->view('/components/ajax/synopsis_editor', $view_vars);
	}
}<file_sep>/application/models/note_model.php
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Note_model extends CI_Model {

	public function get_notes($assignment_id, $synopsis_id) {
		$this->db->where('assignment_id', $assignment_id);
		$this->db->where('synopsis_id', $synopsis_id);
		$query = $this->db->get('note');
		$data = $query->result();
		if (! empty($data[0])) { return $data[0]; }
		return array();

	}

	public function write_note($data) {
		$query = $this->db->get_where('note', array(
			'step_id' => $data['step_id'],
			'assignment_id' => $data['assignment_id'],
			'synopsis_id' => $data['synopsis_id']
		));

		// update if present, otherwise create a new row if unique ($objective_id)
		if ($query->num_rows() > 0) {
			$this->db->where('step_id', $data['step_id']);
			$this->db->where('assignment_id', $data['assignment_id']);
			$this->db->where('synopsis_id', $data['synopsis_id']);
			$this->db->update('note', $data);
		} else {
			$this->db->insert('note', $data);
		}
	}

	public function update_notes($post) {
		foreach ($post as $name => $note) {
			if (is_int($name)) {
				$data = array(
					'assignment_id' => $post['aid'],
					'synopsis_id' => $post['pid'],
					'step_id' => $name,
					'note' => $note
				);
				$query = $this->db->get_where('note', array(
					'step_id' => $name,
					'assignment_id' => $post['aid'],
					'synopsis_id' => $post['pid']
				));
				// update if present, otherwise create a new row if unique ($objective_id)
				if ($query->num_rows() > 0) {
					error_log('update!' . $name);
					$this->db->where('step_id', $name);
					$this->db->where('assignment_id', $data['assignment_id']);
					$this->db->where('synopsis_id', $data['synopsis_id']);
					$this->db->update('note', $data);
				} else {error_log('write!');
					$this->db->insert('note', $data);
				}
			}
		}
	}
}<file_sep>/misc/sql.php
-- phpMyAdmin SQL Dump
-- version 4.0.9
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jan 30, 2014 at 07:45 AM
-- Server version: 5.5.15
-- PHP Version: 5.4.17

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";

--
-- Database: `learn`
--

-- --------------------------------------------------------

--
-- Table structure for table `comments`
--

CREATE TABLE IF NOT EXISTS `comments` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user` varchar(25) NOT NULL,
  `comments_container_id` varchar(20) NOT NULL,
  `branch` int(11) NOT NULL DEFAULT '0',
  `comment` blob NOT NULL,
  `date` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- Table structure for table `content`
--

CREATE TABLE IF NOT EXISTS `content` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `date` int(11) NOT NULL,
  `content_id` varchar(32) NOT NULL,
  `content` blob NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ;

-- --------------------------------------------------------

--
-- Table structure for table `note`
--

CREATE TABLE IF NOT EXISTS `note` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `note` blob NOT NULL,
  `assignment_id` varchar(50) COLLATE utf32_unicode_ci NOT NULL,
  `date` int(11) NOT NULL,
  `synopsis_id` varchar(20) COLLATE utf32_unicode_ci NOT NULL,
  `step_id` int(11) NOT NULL,
  `status` enum('open','closed') COLLATE utf32_unicode_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf32 COLLATE=utf32_unicode_ci AUTO_INCREMENT=13 ;

-- --------------------------------------------------------

--
-- Table structure for table `objectives`
--

CREATE TABLE IF NOT EXISTS `objectives` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `time` int(11) NOT NULL,
  `objective` varchar(300) COLLATE utf32_unicode_ci NOT NULL,
  `dashboard_id` varchar(50) COLLATE utf32_unicode_ci NOT NULL,
  `user_id` int(11) NOT NULL,
  `status` enum('open','closed') COLLATE utf32_unicode_ci NOT NULL DEFAULT 'open',
  `steps` blob NOT NULL,
  `teacher_email` varchar(100) COLLATE utf32_unicode_ci NOT NULL,
  `assignment_id` varchar(200) COLLATE utf32_unicode_ci NOT NULL,
  `instructor` varchar(50) COLLATE utf32_unicode_ci NOT NULL,
  `course` varchar(200) COLLATE utf32_unicode_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf32 COLLATE=utf32_unicode_ci AUTO_INCREMENT=36 ;

-- --------------------------------------------------------

--
-- Table structure for table `project`
--

CREATE TABLE IF NOT EXISTS `project` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `project_id` varchar(100) COLLATE utf32_unicode_ci NOT NULL,
  `date` int(10) NOT NULL,
  `title` text COLLATE utf32_unicode_ci NOT NULL,
  `description` blob NOT NULL,
  `github_link` varchar(1024) COLLATE utf32_unicode_ci NOT NULL,
  `local_link` varchar(300) COLLATE utf32_unicode_ci NOT NULL,
  `staging_link` varchar(300) COLLATE utf32_unicode_ci NOT NULL,
  `production_link` varchar(300) COLLATE utf32_unicode_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf32 COLLATE=utf32_unicode_ci AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- Table structure for table `report`
--

CREATE TABLE IF NOT EXISTS `report` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `hash` varchar(20) COLLATE utf32_unicode_ci NOT NULL,
  `project_id` varchar(200) COLLATE utf32_unicode_ci NOT NULL,
  `project_title` varchar(200) COLLATE utf32_unicode_ci NOT NULL,
  `elapsed_time` varchar(50) COLLATE utf32_unicode_ci NOT NULL,
  `timezone` varchar(100) COLLATE utf32_unicode_ci NOT NULL,
  `assignment_hash` varchar(100) COLLATE utf32_unicode_ci NOT NULL,
  `student_name` varchar(100) COLLATE utf32_unicode_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf32 COLLATE=utf32_unicode_ci AUTO_INCREMENT=28 ;

-- --------------------------------------------------------

--
-- Table structure for table `statistics`
--

CREATE TABLE IF NOT EXISTS `statistics` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `assignment_hash` varchar(40) COLLATE utf8_unicode_ci NOT NULL,
  `synopsis_hash` varchar(40) COLLATE utf8_unicode_ci NOT NULL,
  `tasks` int(11) NOT NULL,
  `elapsed_time` int(11) NOT NULL,
  `link` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- Table structure for table `steps`
--

CREATE TABLE IF NOT EXISTS `steps` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `step` varchar(500) COLLATE utf32_unicode_ci NOT NULL,
  `date` int(11) NOT NULL,
  `dashboard_id` varchar(50) COLLATE utf32_unicode_ci NOT NULL,
  `assignment_id` varchar(50) COLLATE utf32_unicode_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf32 COLLATE=utf32_unicode_ci AUTO_INCREMENT=37 ;

-- --------------------------------------------------------

--
-- Table structure for table `synopsis`
--

CREATE TABLE IF NOT EXISTS `synopsis` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `assignment_id` varchar(11) COLLATE utf32_unicode_ci NOT NULL,
  `synopsis_id` varchar(11) COLLATE utf32_unicode_ci NOT NULL,
  `elapsed_time` varchar(100) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `status` enum('in_progress','submitted','returned','completed') CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT 'in_progress',
  `student_name` varchar(100) COLLATE utf32_unicode_ci NOT NULL,
  `report_url` varchar(200) COLLATE utf32_unicode_ci NOT NULL,
  `timezone` varchar(100) COLLATE utf32_unicode_ci NOT NULL,
  `mark` varchar(2) COLLATE utf32_unicode_ci NOT NULL,
  `comments` blob NOT NULL,
  `dashboard_id` varchar(20) COLLATE utf32_unicode_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf32 COLLATE=utf32_unicode_ci AUTO_INCREMENT=41 ;

-- --------------------------------------------------------

--
-- Table structure for table `task`
--

CREATE TABLE IF NOT EXISTS `task` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `assignment_id` varchar(50) COLLATE utf32_unicode_ci NOT NULL,
  `synopsis_id` varchar(40) COLLATE utf32_unicode_ci NOT NULL,
  `step_id` varchar(20) COLLATE utf32_unicode_ci NOT NULL,
  `session` int(10) NOT NULL,
  `time` int(10) NOT NULL,
  `position` int(11) NOT NULL,
  `task` varchar(100) COLLATE utf32_unicode_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf32 COLLATE=utf32_unicode_ci AUTO_INCREMENT=21 ;

-- --------------------------------------------------------

--
-- Table structure for table `tracker`
--

CREATE TABLE IF NOT EXISTS `tracker` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `dt` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `referer` varchar(255) NOT NULL DEFAULT '',
  `referer_is_local` tinyint(4) NOT NULL DEFAULT '0',
  `url` varchar(255) NOT NULL DEFAULT '',
  `page_title` varchar(255) NOT NULL DEFAULT '',
  `search_terms` varchar(255) NOT NULL DEFAULT '',
  `img_search` tinyint(4) NOT NULL DEFAULT '0',
  `browser_family` varchar(255) NOT NULL DEFAULT '',
  `browser_version` varchar(15) NOT NULL DEFAULT '',
  `os` varchar(255) NOT NULL DEFAULT '',
  `os_version` varchar(255) NOT NULL DEFAULT '',
  `ip` varchar(15) NOT NULL DEFAULT '',
  `user_agent` varchar(255) NOT NULL DEFAULT '',
  `exec_time` float NOT NULL DEFAULT '0',
  `num_queries` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=2590 ;

-- --------------------------------------------------------

--
-- Table structure for table `users`
--

CREATE TABLE IF NOT EXISTS `users` (
  `user_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_email` varchar(255) NOT NULL DEFAULT '',
  `user_pass` varchar(60) NOT NULL DEFAULT '',
  `user_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `user_modified` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `user_last_login` datetime DEFAULT NULL,
  `user_hash` varchar(255) DEFAULT NULL,
  `user_level` enum('user','administrator') NOT NULL DEFAULT 'user',
  `user_timezone` varchar(50) NOT NULL,
  `user_name` varchar(50) NOT NULL,
  `remember` varchar(20) NOT NULL,
  `product` enum('half','full') NOT NULL DEFAULT 'half',
  PRIMARY KEY (`user_id`),
  UNIQUE KEY `user_email` (`user_email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
<file_sep>/application/views/whatis_view.php
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="ie lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>    <html class="ie lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>    <html class="ie lt-ie9"> <![endif]-->
<!--[if gt IE 8]> <html class="ie gt-ie8"> <![endif]-->
<!--[if !IE]><!--><html><!-- <![endif]-->
<head>
    <title>LEARN</title>

    <!-- Meta -->
    <meta charset="UTF-8" />
    <meta name="description" content="Instructor driven student assignment system.">
	<meta name="keywords" content="learning aid, assignment generator">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta http-equiv="X-UA-Compatible" content="IE=9; IE=8; IE=7; IE=EDGE" />

    <!-- Excel-like css -->
    <link href="/css/excel-2007.css" rel="stylesheet" type="text/css" />

    <!-- Bootstrap -->
    <link href="/common/bootstrap/css/bootstrap.css" rel="stylesheet" />
    <link href="/common/bootstrap/css/responsive.css" rel="stylesheet" />

    <!-- Glyphicons Font Icons -->
    <link href="/common/theme/css/glyphicons.css" rel="stylesheet" />

    <!-- Uniform Pretty Checkboxes -->
    <link href="/common/theme/scripts/plugins/forms/pixelmatrix-uniform/css/uniform.default.css" rel="stylesheet" />

    <!-- Main Theme Stylesheet :: CSS -->
    <link href="/common/theme/css/style-light.css?1369753444" rel="stylesheet" />

    <!-- Excel-like css -->
    <link href="/css/excel-2007.css" rel="stylesheet" type="text/css" />

    <!-- General css -->
    <link href="/css/style.css" rel="stylesheet" type="text/css" />


    <!-- LESS.js Library -->
    <script src="/common/theme/scripts/plugins/system/less.min.js"></script>

</head>
<body class="">

     <!-- Content -->
    <div id="contentx">
        <div class="innerLR innerT">
            <div class="widget">
                <div class="widget-head">
                    <h4 class="heading edit_objective">LEARN</h4>
                    <span class="details pull-right">
                    	<a href="<?php echo site_url();?>create">Create An Assignment</a>
                    </span>
                </div>
                <div class="widget-body">
                    <div class="row-fluid">
                    	<h5>What is this?</h5>
                    	<p>This is a system which manages the creation, completion, and marking of an assignment conducted by an instructor with any number of students.<p>
                    	<h5>Usage</h5>
                    	<p><a href="<?php echo site_url();?>create">Create an assignment</a>, send its Assignment URL to your students, and then monitor their work from your dashboard.</p>
                    	<p>The Assignment URL will provide each student with a unique worksheet of which you may monitor and mark.</p>
                    	<h5>Demo</h5>
                    	<p>Example A: <a href="http://learn.ablitica.com/dashboard/yd7dJ9l/Y8v8rQj">Instructor Dashboard</a></p>
                    	<p>Example B: <a href="http://learn.ablitica.com/assignment/Y8v8rQj" target="_blank">Assigment URL for Students</a></p>
                    	<p>Example C: <a href="http://learn.ablitica.com/home/Y8v8rQj/27w73YD" target="_blank">Student Worksheet</a></p>
 					 </div>
                </div>
            </div>
        </div>
        <!-- // Content END -->
        </div>

        <?php $this->load->view('/components/footer') ?>


    <?php $this->load->view('/components/themer') ?>
    <?php $this->load->view('/components/js_includes') ?>

</body>
</html><file_sep>/application/views/create_view.php
<?php
	$objective_tip = "Enter the main objective of this assignment here (required field).";
	$step_tip = "Enter the steps for the student to complete. Students will checkmark each step upon completion.";
	$email_tip = "Receive email notifications when when a student has submitted a report (not requried).";
?>
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="ie lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>    <html class="ie lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>    <html class="ie lt-ie9"> <![endif]-->
<!--[if gt IE 8]> <html class="ie gt-ie8"> <![endif]-->
<!--[if !IE]><!--><html><!-- <![endif]-->
<head>
	<title>Create Assignment</title>
    <!-- Meta -->
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
  	<!--[if IE]><meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'><![endif]-->


    <!-- Bootstrap -->
    <link href="/common/bootstrap/css/bootstrap.css" rel="stylesheet" />
    <link href="/common/bootstrap/css/responsive.css" rel="stylesheet" />

  	<!-- Bootstrap Extended -->
	<script src="/js/wysihtml5-0.3.0_rc2.js"></script>
	<script src="/js/jquery-1.7.1.min.js"></script>
	<script src="/js/bootstrap.min.js"></script>
	<script src="/js/bootstrap-wysihtml5.js"></script>

    <!-- Glyphicons Font Icons -->
    <link href="/common/theme/css/glyphicons.css" rel="stylesheet" />

    <!-- Uniform Pretty Checkboxes -->
    <link href="/common/theme/scripts/plugins/forms/pixelmatrix-uniform/css/uniform.default.css" rel="stylesheet" />

    <!-- Main Theme Stylesheet :: CSS -->
    <link href="/common/theme/css/style-light.css?1369753444" rel="stylesheet" />

    <!-- General css -->
    <link href="/css/style.css" rel="stylesheet" type="text/css" />

    <!-- LESS.js Library -->
    <script src="/common/theme/scripts/plugins/system/less.min.js"></script>
	<!-- Form validation -->
	<script type="text/javascript" src="/js/jquery-1.10.2.min.js"></script>
	<script type="text/javascript" src="/js/jquery-ui.js"></script>
	<script type="text/javascript" src="/js/jquery.form.min.js"></script>
	<script type="text/javascript" src="/js/jquery-validate.js"></script>
	<script type="text/javascript" src="/js/learn.js"></script>
	<script type="text/javascript">
$(document).ready(function () {
	$('.objective').focus();
	$('#submit').click(function() {
 		$('#assignment_form').submit();
	});
	$('#assignment_form').validate({
	    rules: {
	    	 objective: {
	            required: true
	     	},
	        step1: {
	 //           required: true,
	            required: true
	        },
	    },
	    submitHandler: function (form) {
			  form.submit()
	    }
	});
});
	</script>
</head>
<body>
	<h4 id="assignment_header">LEARN 1.0</h4>


	<br>
	<form id="assignment_form" action="/create" method="post">
		<p><input tabindex="1" type="text" class="span8 course" placeholder="course" name="course"></p>
		<p><input tabindex="2" type="text" class="span8 instructor" placeholder="instructor" name="instructor"></p>
		<h5>OBJECTIVE&nbsp;&bull;&nbsp;<a href="#" data-toggle="tooltip" title="" data-original-title="<?php echo $objective_tip;?>">?</a></h5>
		<textarea tabindex="3" class="span8 objective"  style="color:#000" name="objective"></textarea>
		<div id="objectives">
			<h5>STEPS&nbsp;&bull;&nbsp;<a href="#" data-toggle="tooltip" title="" data-original-title="<?php echo $step_tip;?>">?</a></h5>
			<?php for ($i = 1; $i<=5; $i++) {?>
			<p><?php echo $i;?>. <input tabindex="<?php echo $i + 3; ?>" data-i="<?php echo $i;?>" name="step<?php echo $i;?>" class="span8 rowx" type="text" value=""></p>
			<?php } ?>
			<button class="btn add_button">Add Step</button>
		</div>
		<br>
		<p>
		<a tabindex="100" id="submit" class="btn btn-icon btn-primary glyphicons parents"><i></i>Create Assignment</a>
		</p>
	</form>
		<br>
	<hr>
<div id="getlost">
	<?php $this->load->view('/components/footer') ?>
</div>

<!-- Bootstrap -->
<script src="/common/bootstrap/js/bootstrap.min.js"></script>

</body>
</html><file_sep>/application/controllers/create.php
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Create extends CI_Controller {

    public function __construct() {
        parent::__construct();
    }

	public function index() {

		$stats = $this->tracker_lib->track('create assignment');
		$this->db->insert('tracker', $stats);

		$dashboard_id = hashids_encrypt(time());
		$assignment_id = hashids_encrypt(time() + rand(0,10000));

		if (! empty($_POST)) {
			$instructor =  $_POST['instructor'];
			$course = $_POST['course'];
			$teacher_email = '<EMAIL>'; // $_POST['teacher_email'];
			$objective = $_POST['objective'];

			// bundle steps
			$steps = array();
			foreach($_POST as $name => $step) {
				if ($name == 'objective' ||
					$name == 'course' ||
					$name == 'instructor') {
					//$steps[] = $step;
				} else {  $steps[] = $step; }
			}

			// write steps to db
			foreach($steps as $step) {
				$data = compact('dashboard_id', 'assignment_id', 'step');
				$this->Step_model->write_step($data);
			}

			$data = array(
				'time' => time(),
				'dashboard_id' => $dashboard_id,
				'objective' => $objective,
				'steps' => '',
				'teacher_email' => $teacher_email,
				'assignment_id' => $assignment_id,
				'course' => $course,
				'instructor' => $instructor
			);

			// write objective and hash to db
			$this->Objectives_model->update_objective($data);

			$data += array(
				'assignment_url' => 'a url',
				'synopsis_url' => 's url'
			);

			redirect(site_url() . 'dashboard/' . $dashboard_id . '/' . $assignment_id);
		} else {
			$this->load->view('create_view');
		}
	}

	public function update_objective() {
		if (! empty($_POST)) {
			$this->Objectives_model->update_objective($_POST);
		}
	}

	public function update_step() {
		if (! empty($_POST)) {
			$this->Step_model->update_step($_POST);
		}
	}

	public function begin() {
		$data = array(
			'student_name' => $_POST['student_name'],
			'assignment_id' => $_POST['assignment_id'],
			'synopsis_id' => $_POST['synopsis_id'],
			'timezone' => $_POST['timezone']
		);
		$this->Synopsis_model->label_synopsis($data);
		redirect($_POST['synopsis_url']);
	}
}<file_sep>/application/models/step_model.php
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Step_model extends CI_Model {

    public function write_step($step) {
//ds($step,1);
	if ($step['step'] != '') {
		$this->db->insert('steps', $step);
	}
    }

	public function get_steps($assignment_hash) {
	 	$this->db->where('assignment_id', $assignment_hash);
        $query = $this->db->get('steps');
        $data = $query->result();
		if (empty($data)) { return null; }
		else { return $data; }
	}

	public function get_steps_with_notes($assignment_id, $synopsis_id) {

        $this->db->select('*');
        $this->db->where('steps.assignment_id', $assignment_id);
        $this->db->from('note');
        $this->db->join('steps', "note.step_id = steps.id AND note.synopsis_id = '{$synopsis_id}'", 'right');

        $query = $this->db->get();
		$result = $query->result();
	//	ds($result);
        return $result;
	}

	public function update_step($post) {
		$data = array(
			'dashboard_id' => $post['dashboard_id'],
			'step' => $post['step']
		);
		error_log($post['step']);
		$this->db->where('dashboard_id', $post['dashboard_id']);
		$this->db->where('id', $post['step_id']);
		$this->db->update('steps', $data);
	}
}<file_sep>/application/views/worksheet_view.php
<?php
	date_default_timezone_set($timezone);
	$synopsis_tip = "Log each task you take when working on steps.  Checkmark the step when finished.";
	$steps_tip = "Click 'log tasks' to log your work. Click the green checkbox when complete.";
?>
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="ie lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>    <html class="ie lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>    <html class="ie lt-ie9"> <![endif]-->
<!--[if gt IE 8]> <html class="ie gt-ie8"> <![endif]-->
<!--[if !IE]><!--><html><!-- <![endif]-->
<head>
	<title>Worksheet</title>

    <!-- Meta -->
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
  	 <!--[if IE]><meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'><![endif]-->

    <!-- Bootstrap -->
    <link href="/common/bootstrap/css/bootstrap.css" rel="stylesheet" />
    <link href="/common/bootstrap/css/responsive.css" rel="stylesheet" />

    <!-- Glyphicons Font Icons -->
    <link href="/common/theme/css/glyphicons.css" rel="stylesheet" />

    <!-- Uniform Pretty Checkboxes -->
    <link href="/common/theme/scripts/plugins/forms/pixelmatrix-uniform/css/uniform.default.css" rel="stylesheet" />

    <!-- Main Theme Stylesheet :: CSS -->
    <link href="/common/theme/css/style-light.css?1369753444" rel="stylesheet" />

    <!-- General css -->
    <link href="/css/style.css" rel="stylesheet" type="text/css" />

    <!-- LESS.js Library -->
    <script src="/common/theme/scripts/plugins/system/less.min.js"></script>

</head>
<body data-timezone="<?php echo $timezone;?>" data-synopsis_id="<?php echo $synopsis_id;?>">
		<h4 id="assignment_header"></h4>
		<h5><?php echo $course . " " . $instructor;?></h5>
		<table>
			<tr>
				<td>
					<div id="student_name_container">
							<h5>STUDENT&nbsp;&bull;&nbsp;<a href="#" data-toggle="tooltip" title="" data-placement="bottom" data-original-title="<?php echo $synopsis_tip;?>">?</a></h5>
					<p>
        					<input id="student_name" value=" <?php echo $student_name; ?>" name="student_name" class="span3 student_name" type="text" readonly style="color:#000000" />
     				  </p>
     			   </div>
     			</td>
     			<td>
     				<div id="marked_meta">

					<?php
						if(! empty($marked_meta)) { ?>
							<h3><?php echo $marked_meta->mark; ?></h3>
							<h4><?php echo $marked_meta->comments;?></h4>
					<?php } ?>
					</div>
     			</td>
     		</tr>
  	   </table>
		<br>
        	<form id="begin" action="/generate/generate_report" method="post" data-sid="<?php echo $synopsis_id;?>" data-aid="<?php echo $assignment_id;?>">
				<h5>OBJECTIVE</h5>
				<p><textarea tabindex="1" class="span12 objective" name="objective" style="color:#000" readonly><?php echo $objective;?></textarea></p>

				<h5>STEPS&nbsp;&bull;&nbsp;<a href="#" data-toggle="tooltip" title="" data-placement="bottom" data-original-title="<?php echo $steps_tip;?>">?</a></h5>
				<table>
					<?php $s=1; foreach ($steps as $step) { ?>

						<?php
							// so this renders the steps with the notes from the join with css and readonly params set depending on step status
							// step panels CSS and text area properties are controlled through js
							$status = 'check'; $visual = "step_panel_sel"; $readonly = null;

							if ($step->status == 'open' || $step->status == '') { $status = 'unchecked'; $visual="step_panel_unsel"; } else { $status = 'check'; $readonly = 'readonly';}
						?>
					<tr class="step_panel<?php echo $step->id;?> <?php echo $visual;?>">
						<td class="step_number<?php echo $step->id;?> row<?php echo $step->id;?>">
							<?php echo $s;?>.
						</td>
						<td>
						 <input class="span11 steps" type="text" readonly value="<?php echo quotes_to_entities($step->step);?>" style="color:#000;" />&nbsp;
						</td>
						<td class="checkbox c<?php echo $step->id;?>">
							<a class="glyphicons <?php echo $status;?> begin begin<?php echo $step->id;?>" data-s="<?php echo $s;?>" data-step_id="<?php echo $step->id;?>" data-status="<?php echo $step->status;?>"><i></i></a>
						</td>
					</tr>
					<tr class="step_panel<?php echo $step->id;?> <?php echo $visual;?>">
						<td>
						</td>
						<td colspan="2">
							<div class="synopsis" data-assignment_id="<?php echo $assignment_id;?>" data-step_id="<?php echo $step->id;?>">
								<table>
								<?php
		                               if (count($rows[$s-1]) > 0) {

		                                foreach ($rows[$s-1] as $row) { ?>
		                                	<?php if ($row->task != '') { ?>
		                                    <tr class="rowx">
		                                        <td class="start">
		                                             <span data-time="<?php echo $row->time ?>"><?php echo date('g:i:s', $row->time);?></span>
		                                        </td>
		                                        <td>
		                                            &nbsp;&nbsp;<?php echo quotes_to_entities($row->task); ?>
		                                        </td>
		                                    </tr>

		                                   	<?php } ?>
		                                <?php } ?>

		                            <?php } else { ?>
		                            	<tr class="rowx synopsis">
		                                        <td class="start">
		                                            <span></span>
		                                        </td>
		                                        <td>
		                                            <i class="cta">click to log tasks</i>
		                                        </td>
		                                    </tr>

		                            <?php } ?>
		                            </table>
		                        <br>
							</div>
						</td>
					</tr>
					<tr><td colspan="2">&nbsp;</td>
				<?php $s++; }?>
				</table>

		        <div class="span12">
	        		<div id="done">
	        			<input type="hidden" name="pid" value="<?php echo $synopsis_id;?>">
	        			<input type="hidden" name="aid" value="<?php echo $assignment_id;?>">
	        			<?php if ($is_instructor) {?>
	        			<!--input type="submit" class="btn btn-block btn-success confirm" value="     UPDATE ASSIGNMENT     "-->
	        			<?php } else { ?>
	        			<input type="submit" class="btn btn-block btn-success" value="     SUBMIT ASSIGNMENT     ">
	        			<?php } ?>
	        		</div>
		        </div>
		        </form>
		        <?php if ($is_instructor) {?>
		        <div class="clearfix"></div>
		        <div class="span12">
		        	<form action="/generate/mark" method="post">
		        		<p><input type="text" placeholder="grade" name="mark" class="span1" size="2" value="<?php echo $marked_meta->mark; ?>"></p>
		        		<p><textarea placeholder="comments" name="comments" class="span12"><?php echo $marked_meta->comments;?></textarea></p>
		        		<input type="hidden" name="dashboard_id" value="<?php echo $dashboard_id;?>">
		        		<input type="hidden" name="assignment_id" value="<?php echo $assignment_id;?>">
		        		<input type="hidden" name="synopsis_id" value="<?php echo $synopsis_id;?>">
		        		<p><input type="submit" class="btn btn-block btn-success span12" value="     MARK ASSIGNMENT     "></p>
		        	</form>
		      	</div>
		      	<?php } ?>

	<br /><br />

    <?php $this->load->view('/components/js_includes') ?>
          <script src="/common/bootstrap/js/bootstrap.min.js"></script>

</body>
</html><file_sep>/application/views/assignment_view.php
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="ie lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>    <html class="ie lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>    <html class="ie lt-ie9"> <![endif]-->
<!--[if gt IE 8]> <html class="ie gt-ie8"> <![endif]-->
<!--[if !IE]><!--><html><!-- <![endif]-->
<head>
	<title>Assignment: <?php echo $objective;?></title>
    <!-- Meta -->
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <!--[if IE]><meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'><![endif]-->

    <!-- Bootstrap -->
    <link href="/common/bootstrap/css/bootstrap.css" rel="stylesheet" />
    <link href="/common/bootstrap/css/responsive.css" rel="stylesheet" />

	<script src="/js/wysihtml5-0.3.0_rc2.js"></script>
	<script src="/js/jquery-1.7.1.min.js"></script>
	<script src="/js/bootstrap.min.js"></script>
	<script src="/js/bootstrap-wysihtml5.js"></script>

    <!-- Glyphicons Font Icons -->
    <link href="/common/theme/css/glyphicons.css" rel="stylesheet" />

    <!-- Uniform Pretty Checkboxes -->
    <link href="/common/theme/scripts/plugins/forms/pixelmatrix-uniform/css/uniform.default.css" rel="stylesheet" />

    <!-- Main Theme Stylesheet :: CSS -->
    <link href="/common/theme/css/style-light.css?1369753444" rel="stylesheet" />

    <!-- General css -->
    <link href="/css/style.css" rel="stylesheet" type="text/css" />

    <!-- LESS.js Library -->
    <script type="text/javascript" src="/common/theme/scripts/plugins/system/less.min.js"></script>
	<script src="/js/jstz.min.js"></script>
	<script type="text/javascript" src="/js/jquery-1.10.2.min.js"></script>

    <script>
$(document).ready(function() {
	$("#student_name").focus();
	var timezone = jstz.determine();
	$("#timezone").val(timezone.name());
	//$.cookie('timezone', timezone.name());
});
	</script>
</head>
<body>
	<h4 id="assignment_header"></h4>
	<h5><?php echo $course . " " . $instructor;?></h5>
	<br>
	<form id="begin" action="/create/begin" method="post">

			<h5>STUDENT NAME</h5>
			<p>
			<input tabindex="1" id="student_name" name="student_name" class="span3" type="text" style="color:#000000" />
		</p>

		<h5>OBJECTIVE</h5>
		<p><textarea tabindex="1" class="span9 objective" name="objective" style="color:#000" readonly><?php echo $objective;?></textarea></p>

		<h5>STEPS</h5>
		<?php foreach ($steps as $step) { ?>
		<p><input class="span9 step" tabindex="3" type="text" readonly value="<?php echo quotes_to_entities($step->step);?>" /></p>
		<?php } ?>
		<input type="hidden" value="<?php echo $synopsis_url?>" name="synopsis_url">
		<input type="hidden" value="<?php echo $synopsis_id;?>" name="synopsis_id">
		<input type="hidden" value="<?php echo $assignment_id;?>" name="assignment_id">
		<input type="hidden" id="timezone" name="timezone">
		<br>
		<p><button tabindex="2" class="btn btn-icon btn-primary glyphicons lightbulb" type="submit" value="Assign"><i></i>Begin</button></p>
	</form>
	<hr>
<div id="x">
	<?php //$this->load->view('/components/footer') ?>
</div>
 <?php  $this->load->view('/components/js_includes') ?>
 <script src="/common/bootstrap/js/bootstrap.min.js"></script>
<script src="/common/theme/scripts/demo/common.js?1384198042"></script>
<script type="text/javascript" src="/js/jquery.cookie.js"></script>
</body>
</html>