omegaup 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/omega/cli.rb +11 -2
- data/lib/omega/cli/contest.rb +6 -0
- data/lib/omega/client.rb +5 -0
- data/lib/omega/contest.rb +4 -0
- data/lib/omega/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a20539af83cd7b5c51fa0bfddcb7f67e8ef459208c1816f11c41e9dd3521b84f
|
4
|
+
data.tar.gz: 9b1328302a70ab1f7458b75682179b3a30893aa8fdffe39a979653cb9f88240a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c7ebb8af607d41acca6d2b880c45ee30eeba9f8fbe388eed8dc3b850b1fbf785fc6ad43ccb16acb69e8bf0048f5b70c9dd57d9f22ea41241c4e16317f8d0e2e8
|
7
|
+
data.tar.gz: a861ae1430e372049588bb1d0e7a81fbaa1043840f0947066767dd4957a2146d051009d2e44839a956169658f6c3dba985874e40224bdbc2cebf55543e5957b2
|
data/lib/omega/cli.rb
CHANGED
@@ -23,14 +23,16 @@ module Omega
|
|
23
23
|
OmegaUp CLI. Developed by OMIJal https://github.com/omijal/omegaup-cli.
|
24
24
|
Tool for interacting with omegaup from CLI and available throug ruby gems.
|
25
25
|
Commands:
|
26
|
-
-
|
26
|
+
- register-users Add a user or a bunch of users to the a contest.
|
27
27
|
- user Generates a dump of the user data in yml format.
|
28
28
|
- scoreboard Gets contest scoreboard with users and score.
|
29
|
+
- clarifications Gets contest clarifications.
|
29
30
|
Parametes:
|
30
31
|
--contest Contest name
|
31
32
|
--user Username or email
|
32
|
-
--
|
33
|
+
--user-file A file path containing a list of user one per line without
|
33
34
|
header
|
35
|
+
--open Filter to only open clarifications
|
34
36
|
Setup:
|
35
37
|
You need to add two env variables with your omegaup credentials.
|
36
38
|
OMEGAUP_URL *Optional* This is intended for development purpose, it will target
|
@@ -58,6 +60,11 @@ OMEGAUP_PASS *Required* Your OmegaUp Password
|
|
58
60
|
Optimist.options do
|
59
61
|
opt :contest, 'Contest ShortName or identifier', type: :string
|
60
62
|
end
|
63
|
+
when 'clarifications'
|
64
|
+
Optimist.options do
|
65
|
+
opt :contest, 'Contest ShortName or identifier', type: :string
|
66
|
+
opt :open, 'Filter to only open clars'
|
67
|
+
end
|
61
68
|
# when 'create-contest'
|
62
69
|
# Optimist.options do
|
63
70
|
# opt :contest, 'Contest ShortName or identifier', type: :string
|
@@ -96,6 +103,8 @@ OMEGAUP_PASS *Required* Your OmegaUp Password
|
|
96
103
|
user_data(@cmd_opts[:user])
|
97
104
|
when 'scoreboard'
|
98
105
|
scoreboard(@cmd_opts[:contest])
|
106
|
+
when 'clarifications'
|
107
|
+
clarifications(@cmd_opts[:contest], @cmd_opts[:open])
|
99
108
|
end
|
100
109
|
end
|
101
110
|
end
|
data/lib/omega/cli/contest.rb
CHANGED
@@ -28,6 +28,12 @@ module Omega
|
|
28
28
|
puts omega.user(user).full_data.to_yaml
|
29
29
|
end
|
30
30
|
|
31
|
+
def clarifications(contest_name, filter_open)
|
32
|
+
clarifications = omega.clarifications(contest_name)
|
33
|
+
clarifications.select! { |clar| clar[:answer].nil? || clar[:answer].empty? } if filter_open
|
34
|
+
puts clarifications.to_yaml
|
35
|
+
end
|
36
|
+
|
31
37
|
def scoreboard(contest_name)
|
32
38
|
score = omega.scoreboard(contest_name)
|
33
39
|
score.simple_display.each_with_index { |s, i| puts "#{i + 1}.- #{s.values.join(': ')}" }
|
data/lib/omega/client.rb
CHANGED
@@ -66,6 +66,11 @@ module Omega
|
|
66
66
|
Scoreboard.new(self, data)
|
67
67
|
end
|
68
68
|
|
69
|
+
def clarifications(name)
|
70
|
+
data = post('/api/contest/clarifications/', { contest_alias: name })
|
71
|
+
data[:clarifications]
|
72
|
+
end
|
73
|
+
|
69
74
|
def user(user)
|
70
75
|
data = post('/api/user/profile/', { username: user })
|
71
76
|
User.new(self, data)
|
data/lib/omega/contest.rb
CHANGED
data/lib/omega/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omegaup
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gilberto Vargas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-03-
|
11
|
+
date: 2021-03-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: amazing_print
|