Skip to content

Commit

Permalink
Issue #476 Modifying the contest statistics methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Mahdi authored and Mahdi committed May 16, 2014
2 parents 8b6c71a + a5626aa commit ef253f7
Show file tree
Hide file tree
Showing 121 changed files with 5,012 additions and 403 deletions.
4 changes: 2 additions & 2 deletions tutor/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
/public/uploads/*
*.rbc
capybara-*.html
.rspec
/coverage/
/spec/tmp
**.orig
Expand All @@ -40,4 +39,5 @@ models.svg

# Ignoring .java and .class files
/students_solutions/Java/*.java
/students_solutions/Class/*.class
/students_solutions/Class/*.class
/students_solutions/*
5 changes: 5 additions & 0 deletions tutor/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ gem 'foreman'
# Use composite primary keys in models
gem 'composite_primary_keys', '~> 6.0.1'

gem 'activeadmin', github: 'gregbell/active_admin'

#
gem 'acts_as_list'

Expand All @@ -72,6 +74,9 @@ gem 'json_builder', '3.1.0'
# whenever gem for scheduling tasks
gem 'whenever', :require => false

#pagination
gem 'will_paginate', '~> 3.0.5'

group :development, :test do
gem 'rspec-rails', '~> 3.0.0.beta'
end
49 changes: 49 additions & 0 deletions tutor/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
GIT
remote: git://github.com/gregbell/active_admin.git
revision: 109ab88cb7c0777d3460cbfac3cc217068ecfabf
specs:
activeadmin (1.0.0.pre)
arbre (~> 1.0)
bourbon
coffee-rails
formtastic (~> 2.3.0.rc3)
inherited_resources (~> 1.3)
jquery-rails
jquery-ui-rails
kaminari (~> 0.15)
rails (>= 3.2, < 4.2)
ransack (~> 1.0)
sass-rails

GEM
remote: https://rubygems.org/
specs:
Expand Down Expand Up @@ -28,8 +45,13 @@ GEM
acts_as_list (0.4.0)
activerecord (>= 3.0)
ansi (1.4.3)
arbre (1.0.1)
activesupport (>= 3.0.0)
arel (4.0.2)
bcrypt (3.1.7)
bourbon (3.2.1)
sass (~> 3.2)
thor
builder (3.1.4)
carrierwave (0.10.0)
activemodel (>= 3.2.0)
Expand Down Expand Up @@ -60,19 +82,35 @@ GEM
foreman (0.63.0)
dotenv (>= 0.7)
thor (>= 0.13.6)
<<<<<<< HEAD
googlecharts (1.6.8)
=======
formtastic (2.3.0.rc3)
actionpack (>= 3.0)
has_scope (0.6.0.rc)
actionpack (>= 3.2, < 5)
activesupport (>= 3.2, < 5)
>>>>>>> a5626aae62dca494a449268dc151db45acefa5e9
hashr (0.0.22)
hike (1.2.3)
i18n (0.6.9)
inherited_resources (1.4.1)
has_scope (~> 0.6.0.rc)
responders (~> 1.0.0.rc)
jbuilder (1.5.3)
activesupport (>= 3.0.0)
multi_json (>= 1.2.0)
jquery-rails (3.1.0)
railties (>= 3.0, < 5.0)
thor (>= 0.14, < 2.0)
jquery-ui-rails (4.2.1)
railties (>= 3.2.16)
json (1.8.1)
json_builder (3.1.0)
activesupport (>= 2.0.0)
kaminari (0.15.1)
actionpack (>= 3.0.0)
activesupport (>= 3.0.0)
kgio (2.9.2)
mail (2.5.4)
mime-types (~> 1.16)
Expand All @@ -81,6 +119,8 @@ GEM
minitest (4.7.5)
multi_json (1.9.2)
orm_adapter (0.5.0)
polyamorous (1.0.0)
activerecord (>= 3.0)
polyglot (0.3.4)
rack (1.5.2)
rack-test (0.6.2)
Expand All @@ -100,8 +140,16 @@ GEM
thor (>= 0.18.1, < 2.0)
raindrops (0.13.0)
rake (10.3.1)
ransack (1.2.3)
actionpack (>= 3.0)
activerecord (>= 3.0)
activesupport (>= 3.0)
i18n
polyamorous (~> 1.0.0)
rdoc (4.1.1)
json (~> 1.4)
responders (1.0.0)
railties (>= 3.2, < 5)
rest-client (1.6.7)
mime-types (>= 1.16)
rmagick (2.13.2)
Expand Down Expand Up @@ -176,6 +224,7 @@ PLATFORMS
ruby

DEPENDENCIES
activeadmin!
acts_as_list
carrierwave
chartkick
Expand Down
28 changes: 28 additions & 0 deletions tutor/app/admin/admin_user.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
ActiveAdmin.register AdminUser do
permit_params :email, :password, :password_confirmation

index do
selectable_column
id_column
column :email
column :current_sign_in_at
column :sign_in_count
column :created_at
actions
end

filter :email
filter :current_sign_in_at
filter :sign_in_count
filter :created_at

form do |f|
f.inputs "Admin Details" do
f.input :email
f.input :password
f.input :password_confirmation
end
f.actions
end

end
33 changes: 33 additions & 0 deletions tutor/app/admin/dashboard.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
ActiveAdmin.register_page "Dashboard" do

menu priority: 1, label: proc{ I18n.t("active_admin.dashboard") }

content title: proc{ I18n.t("active_admin.dashboard") } do
div class: "blank_slate_container", id: "dashboard_default_message" do
span class: "blank_slate" do
span I18n.t("active_admin.dashboard_welcome.welcome")
small I18n.t("active_admin.dashboard_welcome.call_to_action")
end
end

# Here is an example of a simple dashboard with columns and panels.
#
# columns do
# column do
# panel "Recent Posts" do
# ul do
# Post.recent(5).map do |post|
# li link_to(post.title, admin_post_path(post))
# end
# end
# end
# end

# column do
# panel "Info" do
# para "Welcome to ActiveAdmin."
# end
# end
# end
end # content
end
Binary file added tutor/app/assets/images/note.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tutor/app/assets/images/tick.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
81 changes: 81 additions & 0 deletions tutor/app/assets/javascripts/_solutions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
// [Editor cusomization - Story 3.19]
// Enable method "selectpicker" from the javascript file.
// Parameters: none.
// Returns: none.
// Author: Mimi
$(document).ready(function(e){
$('.selectpicker').selectpicker();
});

// [Editor cusomization - Story 3.19]
// change the theme of the editor.
// Parameters:
// The selected input from the 'theme' drop-downlist.
// Returns: none.
// Author: Mimi
function changeTheme(){
var new_theme = $('#theme').val();
editor.setTheme("ace/theme/"+new_theme);
}

// [Editor cusomization - Story 3.19]
// change the mode of the editor.
// Parameters:
// The selected input from the 'mode' drop-downlist.
// Returns: none.
// Author: Mimi
function changeMode(){
var new_mode = $('#mode').val();
edit_session.setMode("ace/mode/"+new_mode);
}

// [Editor cusomization - Story 3.19]
// change the font-size of the editor.
// Parameters:
// The selected input from the 'font' drop-downlist.
// Returns: none.
// Author: Mimi
function changeFont(){
var new_font = $('#font').val();
editor.setFontSize(parseInt(new_font));
}

// [Mark Solution - Story 4.29]
// shows the add note button when hovering over the the line
// Parameters:
// id: id of the div that was hovered over
// Returns: none
// Author: Abdullrahman Elhusseny
function show(id){
id += "add_button"
document.getElementById(id).style.opacity = 1;
}

// [Mark Solution - Story 4.29]
// hides the add note button when the crusor leaves the the line
// Parameters:
// id: id of the div that was hovered over
// Returns: none
// Author: Abdullrahman Elhusseny
function hide(id){
id += "add_button"
document.getElementById(id).style.opacity = 0;
}

// [Mark Solution - Story 4.29]
// pops a dialog box when trying to add or update note
// Parameters:
// id: id of the button that was pressed
// Returns: none
// Author: Abdullrahman Elhusseny
function pop(id){
id += "form"
document.getElementById(id).style.display = 'initial'
$(document.getElementById(id)).bPopup({
modalClose: false,
opacity: 0.6,
positionStyle: 'fixed',
speed: 650,
transition: 'slideIn'
});
}
15 changes: 14 additions & 1 deletion tutor/app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,19 @@
//
//= require jquery
//= require jquery_ujs
//= require jquery-ui-1.10.4
//= require_tree .
//= require bootstrap
//= require jquery.tokeninput
//= require utilities
//= require utilities

// [Simple Search auto-complete - Story 1.23]
// autocomplete for the search bar
// Parameters: search term
// Returns: Array with the matched results
// Author: Ahmed Elassuty
$(function(){
$('#search_field').autocomplete({
source: $('#search_field').data("autocomplete-source")
});
});
3 changes: 3 additions & 0 deletions tutor/app/assets/javascripts/assignment_problems.js.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@showDiv = ->
ocument.getElementById("test").style.display = ""
return
3 changes: 3 additions & 0 deletions tutor/app/assets/javascripts/assignments.js.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit ef253f7

Please sign in to comment.