Show More
Commit Description:
update max_score / current_score to property use group filter
Commit Description:
update max_score / current_score to property use group filter
File last commit:
Show/Diff file:
Action:
db/seeds.rb | 289 lines | 8.2 KiB | text/x-ruby | RubyLexer |
Jittat Fakcharoenphol
moved data migration for config to seeds.rb, shows option description in system config page
r269 CONFIGURATIONS =
[
{
:key => 'system.single_user_mode',
:value_type => 'boolean',
Jittat Fakcharoenphol
fixed seed script
r272 :default_value => 'false',
Jittat Fakcharoenphol
moved data migration for config to seeds.rb, shows option description in system config page
r269 :description => 'Only admins can log in to the system when running under single user mode.'
},
add options to allow hall of fame viewing by any user...
r424
Jittat Fakcharoenphol
moved data migration for config to seeds.rb, shows option description in system config page
r269 {
:key => 'ui.front.title',
:value_type => 'string',
Jittat Fakcharoenphol
fixed seed script
r272 :default_value => 'Grader'
Jittat Fakcharoenphol
moved data migration for config to seeds.rb, shows option description in system config page
r269 },
add options to allow hall of fame viewing by any user...
r424
Jittat Fakcharoenphol
moved data migration for config to seeds.rb, shows option description in system config page
r269 {
:key => 'ui.front.welcome_message',
:value_type => 'string',
Jittat Fakcharoenphol
fixed seed script
r272 :default_value => 'Welcome!'
Jittat Fakcharoenphol
moved data migration for config to seeds.rb, shows option description in system config page
r269 },
add options to allow hall of fame viewing by any user...
r424
Jittat Fakcharoenphol
moved data migration for config to seeds.rb, shows option description in system config page
r269 {
:key => 'ui.show_score',
:value_type => 'boolean',
Jittat Fakcharoenphol
fixed seed script
r272 :default_value => 'true'
Jittat Fakcharoenphol
moved data migration for config to seeds.rb, shows option description in system config page
r269 },
add options to allow hall of fame viewing by any user...
r424
Jittat Fakcharoenphol
moved data migration for config to seeds.rb, shows option description in system config page
r269 {
:key => 'contest.time_limit',
:value_type => 'string',
Jittat Fakcharoenphol
fixed seed script
r272 :default_value => 'unlimited',
Jittat Fakcharoenphol
logs out users after contests changed
r294 :description => 'Time limit in format hh:mm, or "unlimited" for contests with no time limits. This config is CACHED. Restart the server before the change can take effect.'
Jittat Fakcharoenphol
moved data migration for config to seeds.rb, shows option description in system config page
r269 },
add options to allow hall of fame viewing by any user...
r424
Jittat Fakcharoenphol
moved data migration for config to seeds.rb, shows option description in system config page
r269 {
:key => 'system.mode',
:value_type => 'string',
Jittat Fakcharoenphol
fixed seed script
r272 :default_value => 'standard',
Jittat Fakcharoenphol
moved data migration for config to seeds.rb, shows option description in system config page
r269 :description => 'Current modes are "standard", "contest", "indv-contest", and "analysis".'
},
add options to allow hall of fame viewing by any user...
r424
Jittat Fakcharoenphol
moved data migration for config to seeds.rb, shows option description in system config page
r269 {
:key => 'contest.name',
:value_type => 'string',
Jittat Fakcharoenphol
fixed seed script
r272 :default_value => 'Grader',
Jittat Fakcharoenphol
moved data migration for config to seeds.rb, shows option description in system config page
r269 :description => 'This name will be shown on the user header bar.'
},
add options to allow hall of fame viewing by any user...
r424
Jittat Fakcharoenphol
moved data migration for config to seeds.rb, shows option description in system config page
r269 {
:key => 'contest.multisites',
:value_type => 'boolean',
Jittat Fakcharoenphol
fixed seed script
r272 :default_value => 'false',
Jittat Fakcharoenphol
moved data migration for config to seeds.rb, shows option description in system config page
r269 :description => 'If the server is in contest mode and this option is true, on the log in of the admin a menu for site selections is shown.'
},
add options to allow hall of fame viewing by any user...
r424
start testing...
r622 #---------------------------- right --------------------------------
Jittat Fakcharoenphol
moved data migration for config to seeds.rb, shows option description in system config page
r269 {
prepare for better hall of fame
r425 :key => 'right.user_hall_of_fame',
Jittat Fakcharoenphol
moved data migration for config to seeds.rb, shows option description in system config page
r269 :value_type => 'boolean',
Jittat Fakcharoenphol
fixed seed script
r272 :default_value => 'false',
add options to allow hall of fame viewing by any user...
r424 :description => 'If true, any user can access hall of fame page.'
Jittat Fakcharoenphol
moved data migration for config to seeds.rb, shows option description in system config page
r269 },
add options to allow hall of fame viewing by any user...
r424
prepare for better hall of fame
r425 {
add option to disable login from multiple ip
r525 :key => 'right.multiple_ip_login',
:value_type => 'boolean',
:default_value => 'true',
:description => 'When change from true to false, a user can login from the first IP they logged into afterward.'
},
{
prepare for better hall of fame
r425 :key => 'right.user_view_submission',
:value_type => 'boolean',
:default_value => 'false',
:description => 'If true, any user can view submissions of every one.'
},
start testing...
r622 {
:key => 'right.bypass_agreement',
:value_type => 'boolean',
:default_value => 'true',
:description => 'When false, a user must accept usage agreement before login'
},
{
:key => 'right.heartbeat_response',
:value_type => 'string',
:default_value => 'OK',
:description => 'Heart beat response text'
},
add show testcase feature
r625 {
heartbeat response full
r649 :key => 'right.heartbeat_response_full',
:value_type => 'string',
:default_value => 'OK',
:description => 'Heart beat response text when user got full score (set this value to the empty string to disable this feature)'
},
{
add show testcase feature
r625 :key => 'right.view_testcase',
:value_type => 'boolean',
:default_value => 'false',
fix whitelisting bugs...
r784 :description => 'If true, any user can view/download test data'
add show testcase feature
r625 },
Jittat Fakcharoenphol
re-added registration config
r774
{
:key => 'system.online_registration',
:value_type => 'boolean',
:default_value => 'false',
:description => 'This option enables online registration.'
},
Jittat Fakcharoenphol
moved data migration for config to seeds.rb, shows option description in system config page
r269 # If Configuration['system.online_registration'] is true, the
# system allows online registration, and will use these
# information for sending confirmation emails.
{
:key => 'system.online_registration.smtp',
:value_type => 'string',
Jittat Fakcharoenphol
fixed seed script
r272 :default_value => 'smtp.somehost.com'
Jittat Fakcharoenphol
moved data migration for config to seeds.rb, shows option description in system config page
r269 },
add options to allow hall of fame viewing by any user...
r424
Jittat Fakcharoenphol
moved data migration for config to seeds.rb, shows option description in system config page
r269 {
:key => 'system.online_registration.from',
:value_type => 'string',
Jittat Fakcharoenphol
fixed seed script
r272 :default_value => 'your.email@address'
Jittat Fakcharoenphol
moved data migration for config to seeds.rb, shows option description in system config page
r269 },
add options to allow hall of fame viewing by any user...
r424
Jittat Fakcharoenphol
moved data migration for config to seeds.rb, shows option description in system config page
r269 {
:key => 'system.admin_email',
:value_type => 'string',
Jittat Fakcharoenphol
fixed seed script
r272 :default_value => 'admin@admin.email'
Jittat Fakcharoenphol
moved data migration for config to seeds.rb, shows option description in system config page
r269 },
add options to allow hall of fame viewing by any user...
r424
Jittat Fakcharoenphol
moved data migration for config to seeds.rb, shows option description in system config page
r269 {
:key => 'system.user_setting_enabled',
:value_type => 'boolean',
Jittat Fakcharoenphol
fixed seed script
r272 :default_value => 'true',
Jittat Fakcharoenphol
moved data migration for config to seeds.rb, shows option description in system config page
r269 :description => 'If this option is true, users can change their settings'
},
add options to allow hall of fame viewing by any user...
r424
{
:key => 'system.user_setting_enabled',
:value_type => 'boolean',
:default_value => 'true',
:description => 'If this option is true, users can change their settings'
fix hof when submissions is not graded...
r465 },
add options to allow hall of fame viewing by any user...
r424
Jittat Fakcharoenphol
moved data migration for config to seeds.rb, shows option description in system config page
r269 # If Configuration['contest.test_request.early_timeout'] is true
# the user will not be able to use test request at 30 minutes
# before the contest ends.
{
:key => 'contest.test_request.early_timeout',
:value_type => 'boolean',
Jittat Fakcharoenphol
fixed seed script
r272 :default_value => 'false'
Jittat Fakcharoenphol
manages problems in contests
r279 },
{
:key => 'system.multicontests',
:value_type => 'boolean',
:default_value => 'false'
Jittat Fakcharoenphol
shows contest start confirmation for indv contest
r302 },
{
:key => 'contest.confirm_indv_contest_start',
:value_type => 'boolean',
:default_value => 'false'
Jittat Fakcharoenphol
added default contest
r308 },
{
:key => 'contest.default_contest_name',
:value_type => 'string',
:default_value => 'none',
:description => "New user will be assigned to this contest automatically, if it exists. Set to 'none' if there is no default contest."
add problem group
r672 },
{
:key => 'system.use_problem_group',
:value_type => 'boolean',
:default_value => 'false',
:description => "If true, available problem to the user will be only ones associated with the group of the user."
},
add ip whitelisting
r755 {
fix whitelisting bugs...
r784 :key => 'right.whitelist_ignore',
add ip whitelisting
r755 :value_type => 'boolean',
fix whitelisting bugs...
r784 :default_value => 'true',
:description => "If true, no IP check against whitelist_ip is perform. However, when false, non-admin user must have their ip in 'whitelist_ip' to be able to login."
add ip whitelisting
r755 },
{
:key => 'right.whitelist_ip',
:value_type => 'string',
:default_value => '0.0.0.0/0',
fix whitelisting bugs...
r784 :description => "list of whitelist ip, given in comma separated CIDR notation. For example '192.168.90.0/23, 192.168.1.23/32'"
add ip whitelisting
r755 },
add options to allow hall of fame viewing by any user...
r424
Jittat Fakcharoenphol
moved data migration for config to seeds.rb, shows option description in system config page
r269 ]
Jittat Fakcharoenphol
moved root/roles creation from migration to seed.rb
r276
add ip whitelisting
r755 def create_configuration_key(key,
value_type,
default_value,
Jittat Fakcharoenphol
moved root/roles creation from migration to seed.rb
r276 description='')
add ip whitelisting
r755 conf = (GraderConfiguration.find_by_key(key) ||
Jittat Fakcharoenphol
renamed model Configuration to GraderConfiguration, renamed rhtml views to erb, fixed other small errors
r320 GraderConfiguration.new(:key => key,
Jittat Fakcharoenphol
moved root/roles creation from migration to seed.rb
r276 :value_type => value_type,
:value => default_value))
conf.description = description
conf.save
end
def seed_config
CONFIGURATIONS.each do |conf|
if conf.has_key? :description
desc = conf[:description]
else
desc = ''
end
add ip whitelisting
r755 create_configuration_key(conf[:key],
Jittat Fakcharoenphol
moved root/roles creation from migration to seed.rb
r276 conf[:value_type],
conf[:default_value],
desc)
Jittat Fakcharoenphol
moved data migration for config to seeds.rb, shows option description in system config page
r269 end
Jittat Fakcharoenphol
moved root/roles creation from migration to seed.rb
r276 end
def seed_roles
update max_score / current_score to property use group filter
r802 Role.find_or_create_by(name: 'ta')
Jittat Fakcharoenphol
moved root/roles creation from migration to seed.rb
r276 return if Role.find_by_name('admin')
role = Role.create(:name => 'admin')
user_admin_right = Right.create(:name => 'user_admin',
:controller => 'user_admin',
:action => 'all')
problem_admin_right = Right.create(:name=> 'problem_admin',
:controller => 'problems',
:action => 'all')
graders_right = Right.create(:name => 'graders_admin',
:controller => 'graders',
:action => 'all')
add ip whitelisting
r755
Jittat Fakcharoenphol
moved root/roles creation from migration to seed.rb
r276 role.rights << user_admin_right;
role.rights << problem_admin_right;
role.rights << graders_right;
role.save
Jittat Fakcharoenphol
moved data migration for config to seeds.rb, shows option description in system config page
r269 end
Jittat Fakcharoenphol
moved root/roles creation from migration to seed.rb
r276
def seed_root
return if User.find_by_login('root')
root = User.new(:login => 'root',
:full_name => 'Administrator',
:alias => 'root')
root.password = 'ioionrails';
class << root
public :encrypt_new_password
Jittat Fakcharoenphol
fixed seed.db for mock valid?
r333 def valid?(context=nil)
Jittat Fakcharoenphol
moved root/roles creation from migration to seed.rb
r276 true
end
end
root.encrypt_new_password
root.roles << Role.find_by_name('admin')
root.activated = true
root.save
end
fix seed
r418 def seed_users_and_roles
seed_roles
seed_root
end
add language to db:seed, set 6 languages, c, c++, pas, ruby, python, java
r417 def seed_more_languages
add ip to front page, also fix seeds.rb
r783 #Language.delete_all
revert simple_form_for to form_tag
r758 Language.find_or_create_by( name: 'c', pretty_name: 'C', ext: 'c', common_ext: 'c' )
Language.find_or_create_by( name: 'cpp', pretty_name: 'C++', ext: 'cpp', common_ext: 'cpp,cc' )
Language.find_or_create_by( name: 'pas', pretty_name: 'Pascal', ext: 'pas', common_ext: 'pas' )
Language.find_or_create_by( name: 'ruby', pretty_name: 'Ruby', ext: 'rb', common_ext: 'rb' )
Language.find_or_create_by( name: 'python', pretty_name: 'Python', ext: 'py', common_ext: 'py' )
Language.find_or_create_by( name: 'java', pretty_name: 'Java', ext: 'java', common_ext: 'java' )
Jittat Fakcharoenphol
moved root/roles creation from migration to seed.rb
r276 end
seed_config
seed_users_and_roles
add language to db:seed, set 6 languages, c, c++, pas, ruby, python, java
r417 seed_more_languages