Permalink
Browse files

sf

  • Loading branch information...
1 parent 1560a11 commit abaee7df5d85f9e1b8fdce51efc754b9a1776011 Matt Chinnock committed Apr 26, 2012
@@ -27,6 +27,7 @@ public function index()
$_SESSION['username'] = $row->email;
$_SESSION['userID'] = $row->userID;
$_SESSION['userLevelID'] = $row->userLevelID;
+ $_SESSION['firstName'] = $row->firstName;
redirect('dashboard');
}
@@ -35,14 +35,6 @@ public function viewAllGrades(){
public function viewAssignmentGrades(){
$id = $this->uri->segment(3);
$data = $this->Submissions_model->getAssignmentGrades($id);
- // foreach($data as $row){
- // echo 'Submission Date: ' . $row->submissionDate . '<br />';
- // echo 'Grade: ' . $row->grade . '<br />';
- // echo 'Comments: ' . $row->comments . '<br />';
- // echo 'Attached File: ' . $row->attachedFiles . '<br />';
- // echo 'User ID: ' . $row->userID . '<br />';
- // echo 'Assignment ID: ' . $row->assignmentID . '<br /><br />';
- // }
$send = array('entry' => $data);
@@ -77,14 +69,19 @@ public function gradeAssignment() {
$this->load->view('grade_assignment', $row);
}
+ function updateGrade(){
+ $submissionID = $this->uri->segment(3);
+ $this->Submissions_model->updateGrade($submissionID, $_POST);
+ redirect('submissions/viewAssignmentGrades/'.$submissionID, 'location');
+ }
+
// CREATE //
- public function createSubmission(){
+ public function insertSubmission(){
$this->Submissions_model->createSubmission(1, 1, '2012-07-12');
}
public function submitAssignment() {
-
$this->load->view('submit_assignment');
}
@@ -96,12 +93,6 @@ public function delete(){
}
-
- function updateGrade(){
- $submissionID = $this->uri->segment(3);
- $this->Submissions_model->updateGrade($submissionID, $_POST);
- redirect('submissions/viewAssignmentGrades/'.$submissionID, 'location');
- }
}
@@ -5,7 +5,13 @@
<p>Points: <?php echo $maxPoints; ?></p>
<h3>Description</h3>
<p><?php echo $information; ?></p>
- <p><?php echo anchor('assignments/editAssignment/' . $assignmentID, 'Edit Assignment', 'title="Edit Assignment"'); ?>
+ <p><?php
+
+ if($_SESSION['userLevelID'] == 2){
+ echo anchor('assignments/editAssignment/' . $assignmentID, 'Edit Assignment', 'title="Edit Assignment"');
+ }?>
+
+
</div>
<?php $this->load->view('sidebar') ?>
<?php $this->load->view('footer') ?>
@@ -1,6 +1,8 @@
<?php $this->load->view('header') ?>
<div class="content clearfix">
<div role="main" id="main">
+
+ <h2>Welcome, <?=$_SESSION['firstName'];?>!</h2>
<p class="is-warning">You have 101248 items to grade. Oh dear. <a href="#">Get a move on.</a></p>
<h2>Sample Table</h2>
<table>
@@ -1,7 +1,10 @@
<?php $this->load->view('header') ?>
<div role="main" id="main">
<h2>View All Assignments</h2>
- <p><?php echo anchor('assignments/createAssignment', 'Create Assignment', 'title="Create Assignment"'); ?></p>
+ <p><?php
+ if ($_SESSION['userLevelID']==2){
+ echo anchor('assignments/createAssignment', 'Create Assignment', 'title="Create Assignment"');
+ } ?></p>
<div class="table-wrapper">
<table class="respond">
<thead>
@@ -19,7 +22,7 @@
<td>
<?php
if ($_SESSION['userLevelID']==1){
- echo anchor('submissions/createSubmission/' . $row->assignmentID, 'Grade', 'title="Grade"')
+ echo anchor('submissions/submitAssignment/' . $row->assignmentID, 'Submit', 'title="Grade"');
}else{
echo anchor('submissions/viewAssignmentGrades/' . $row->assignmentID, 'Grade', 'title="Grade"');
}

0 comments on commit abaee7d

Please sign in to comment.