Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
rgkavodkar committed Feb 21, 2016
2 parents 4d99ad4 + 22a1312 commit 070213a
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 49 deletions.
26 changes: 22 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,41 @@
== README ==

Follow the below instructions to log in to the system (using the preconfigured accounts) and find the relevant actions

== SUPER ADMIN ==

username: admin@sp.com


password: password


== ADMINS == <Might not hold good if deleted>
username: admin_@sp.com <replace _ with a number in the range 1-5>

username: admin_@sp.com [replace _ with a number in the range 1-5]

password: password



== INSTRUCTORS == <Might not hold good if deleted>
username: ins_@sp.com <replace _ with a number in the range 1-30>

username: ins_@sp.com [replace _ with a number in the range 1-30]

password: password



== STUDENTS == <Might not hold good if deleted>
username: stu_@sp.com <replace _ with a number in the range 1-300>

username: stu_@sp.com [replace _ with a number in the range 1-300]

password: password




== ACTIONS ==

All the permitted actions are listed in the top navigation bar
Some of the actions are not listed in that, but can be performed upon visiting one of those listed pages
Some of the actions are not listed in that, but can be performed upon visiting one of those listed pages
18 changes: 18 additions & 0 deletions app/controllers/student_courses_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,28 @@ def index
# GET /student_courses/1.json
def show
end
<<<<<<< HEAD
end

# DELETE /student_courses/1
# DELETE /student_courses/1.json
def destroy
@student_course.destroy
respond_to do |format|
if current_user.utype =="student"
flash[:success] = "Student was succesfully removed from the course"
format.html { redirect_to course_history_display_url }
flash[:success] = "Student was succesfully removed from the course"
else
format.html { redirect_to course_history_display_url }
end

=======

# GET /student_courses/new
def new
@student_course = StudentCourse.new
>>>>>>> c6f9a7ce075f9d3fbba676726e805b8e35a5df88
end

# GET /student_courses/1/edit
Expand Down
39 changes: 0 additions & 39 deletions app/views/student_courses/course_history_display.html.erb

This file was deleted.

6 changes: 2 additions & 4 deletions app/views/student_courses/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
<p id="notice"><%= notice %></p>

<h1>Listing Student Courses</h1>

<table>
Expand All @@ -20,12 +18,12 @@
<td><%= student_course.grade %></td>
<td><%= link_to 'Show', student_course %></td>
<td><%= link_to 'Edit', edit_student_course_path(student_course) %></td>
<td><%= link_to 'Destroy', student_course, method: :delete, data: { confirm: 'Are you sure?' } %></td>
<td><%= link_to 'Delete', student_course, method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr>
<% end %>
</tbody>
</table>

<br>

<%= link_to 'New Student course', new_student_course_path %>

8 changes: 7 additions & 1 deletion app/views/student_courses/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<<<<<<< HEAD
<div class="col-md-6 col-md-offset-3">
=======

>>>>>>> c6f9a7ce075f9d3fbba676726e805b8e35a5df88
<table class="table">

<tr>
Expand All @@ -24,4 +28,6 @@
<% elsif @student_course.status == "enrolled" && ( current_user.utype =="admin" || current_user.utype =="instructor") %>
<%= link_to 'Remove student from the course', @student_course, method: :delete, data: {confirm: 'Are you sure?'} %>
<% end %>
<%= link_to 'Back', student_courses_path %>
</tr>
</table>
</div>
2 changes: 1 addition & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
delete 'enrolledshow'=>'student_courses#enrolledshow'
get 'pendingshow'=>'student_courses#pendingshow'
put 'complete'=> 'student_courses#complete'

get 'student_course_index'=> 'student_courses#index'
get 'coursesall'=>'courses#index'
get 'coursecreate'=>'courses#new'
patch 'courseedit'=>'courses#edit'
Expand Down

0 comments on commit 070213a

Please sign in to comment.