mumuki-laboratory 6.2.0 → 6.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +73 -86
- data/app/assets/javascripts/application/custom-editor.js +21 -0
- data/app/assets/javascripts/application/multiple-files.js +9 -4
- data/app/assets/javascripts/application/submission.js +5 -1
- data/app/controllers/concerns/organizations_controller_template.rb +1 -0
- data/app/helpers/exercise_input_helper.rb +1 -1
- data/app/helpers/multiple_file_editor_helper.rb +1 -1
- data/app/views/layouts/exercise_inputs/editors/_custom.html.erb +1 -0
- data/lib/mumuki/laboratory/version.rb +1 -1
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 74f37222cfbd2062f66b0734673a6d1703db85abf107e8d9a1bcdce89e00d007
|
4
|
+
data.tar.gz: 7ecb6822446436ea233a5a3491464bd87fa66ad8150ba6896ebd4ff50dac78a9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c806d54fec0d78d19de80c35b4402819e8c8364ab22e8e38fb717ac013ef73d0f076b7ad35b47f691009a6bfc3d1c51049994beafb1cb18b5d96f189c2cf352
|
7
|
+
data.tar.gz: bb6d056380dbae62c810f5ceca81b1ef22ecb383132d2454edc385985271f4b2f85ad3564141560e0c48391d820956c9de233f4ea4eb94dae9b9ac9ba8f96876
|
data/LICENSE
CHANGED
@@ -1,23 +1,21 @@
|
|
1
|
-
GNU GENERAL PUBLIC LICENSE
|
2
|
-
Version 3,
|
1
|
+
GNU AFFERO GENERAL PUBLIC LICENSE
|
2
|
+
Version 3, 19 November 2007
|
3
3
|
|
4
|
-
Copyright (C) 2007 Free Software Foundation, Inc. <
|
4
|
+
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
5
5
|
Everyone is permitted to copy and distribute verbatim copies
|
6
6
|
of this license document, but changing it is not allowed.
|
7
7
|
|
8
8
|
Preamble
|
9
9
|
|
10
|
-
The GNU General Public License is a free, copyleft license for
|
11
|
-
software and other kinds of works
|
10
|
+
The GNU Affero General Public License is a free, copyleft license for
|
11
|
+
software and other kinds of works, specifically designed to ensure
|
12
|
+
cooperation with the community in the case of network server software.
|
12
13
|
|
13
14
|
The licenses for most software and other practical works are designed
|
14
15
|
to take away your freedom to share and change the works. By contrast,
|
15
|
-
|
16
|
+
our General Public Licenses are intended to guarantee your freedom to
|
16
17
|
share and change all versions of a program--to make sure it remains free
|
17
|
-
software for all its users.
|
18
|
-
GNU General Public License for most of our software; it applies also to
|
19
|
-
any other work released this way by its authors. You can apply it to
|
20
|
-
your programs, too.
|
18
|
+
software for all its users.
|
21
19
|
|
22
20
|
When we speak of free software, we are referring to freedom, not
|
23
21
|
price. Our General Public Licenses are designed to make sure that you
|
@@ -26,44 +24,34 @@ them if you wish), that you receive source code or can get it if you
|
|
26
24
|
want it, that you can change the software or use pieces of it in new
|
27
25
|
free programs, and that you know you can do these things.
|
28
26
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
that
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
products. If such problems arise substantially in other domains, we
|
58
|
-
stand ready to extend this provision to those domains in future versions
|
59
|
-
of the GPL, as needed to protect the freedom of users.
|
60
|
-
|
61
|
-
Finally, every program is threatened constantly by software patents.
|
62
|
-
States should not allow patents to restrict development and use of
|
63
|
-
software on general-purpose computers, but in those that do, we wish to
|
64
|
-
avoid the special danger that patents applied to a free program could
|
65
|
-
make it effectively proprietary. To prevent this, the GPL assures that
|
66
|
-
patents cannot be used to render the program non-free.
|
27
|
+
Developers that use our General Public Licenses protect your rights
|
28
|
+
with two steps: (1) assert copyright on the software, and (2) offer
|
29
|
+
you this License which gives you legal permission to copy, distribute
|
30
|
+
and/or modify the software.
|
31
|
+
|
32
|
+
A secondary benefit of defending all users' freedom is that
|
33
|
+
improvements made in alternate versions of the program, if they
|
34
|
+
receive widespread use, become available for other developers to
|
35
|
+
incorporate. Many developers of free software are heartened and
|
36
|
+
encouraged by the resulting cooperation. However, in the case of
|
37
|
+
software used on network servers, this result may fail to come about.
|
38
|
+
The GNU General Public License permits making a modified version and
|
39
|
+
letting the public access it on a server without ever releasing its
|
40
|
+
source code to the public.
|
41
|
+
|
42
|
+
The GNU Affero General Public License is designed specifically to
|
43
|
+
ensure that, in such cases, the modified source code becomes available
|
44
|
+
to the community. It requires the operator of a network server to
|
45
|
+
provide the source code of the modified version running there to the
|
46
|
+
users of that server. Therefore, public use of a modified version, on
|
47
|
+
a publicly accessible server, gives the public access to the source
|
48
|
+
code of the modified version.
|
49
|
+
|
50
|
+
An older license, called the Affero General Public License and
|
51
|
+
published by Affero, was designed to accomplish similar goals. This is
|
52
|
+
a different license, not a version of the Affero GPL, but Affero has
|
53
|
+
released a new version of the Affero GPL which permits relicensing under
|
54
|
+
this license.
|
67
55
|
|
68
56
|
The precise terms and conditions for copying, distribution and
|
69
57
|
modification follow.
|
@@ -72,7 +60,7 @@ modification follow.
|
|
72
60
|
|
73
61
|
0. Definitions.
|
74
62
|
|
75
|
-
"This License" refers to version 3 of the GNU General Public License.
|
63
|
+
"This License" refers to version 3 of the GNU Affero General Public License.
|
76
64
|
|
77
65
|
"Copyright" also means copyright-like laws that apply to other kinds of
|
78
66
|
works, such as semiconductor masks.
|
@@ -549,35 +537,45 @@ to collect a royalty for further conveying from those to whom you convey
|
|
549
537
|
the Program, the only way you could satisfy both those terms and this
|
550
538
|
License would be to refrain entirely from conveying the Program.
|
551
539
|
|
552
|
-
13. Use with the GNU
|
540
|
+
13. Remote Network Interaction; Use with the GNU General Public License.
|
541
|
+
|
542
|
+
Notwithstanding any other provision of this License, if you modify the
|
543
|
+
Program, your modified version must prominently offer all users
|
544
|
+
interacting with it remotely through a computer network (if your version
|
545
|
+
supports such interaction) an opportunity to receive the Corresponding
|
546
|
+
Source of your version by providing access to the Corresponding Source
|
547
|
+
from a network server at no charge, through some standard or customary
|
548
|
+
means of facilitating copying of software. This Corresponding Source
|
549
|
+
shall include the Corresponding Source for any work covered by version 3
|
550
|
+
of the GNU General Public License that is incorporated pursuant to the
|
551
|
+
following paragraph.
|
553
552
|
|
554
553
|
Notwithstanding any other provision of this License, you have
|
555
554
|
permission to link or combine any covered work with a work licensed
|
556
|
-
under version 3 of the GNU
|
555
|
+
under version 3 of the GNU General Public License into a single
|
557
556
|
combined work, and to convey the resulting work. The terms of this
|
558
557
|
License will continue to apply to the part which is the covered work,
|
559
|
-
but the
|
560
|
-
|
561
|
-
combination as such.
|
558
|
+
but the work with which it is combined will remain governed by version
|
559
|
+
3 of the GNU General Public License.
|
562
560
|
|
563
561
|
14. Revised Versions of this License.
|
564
562
|
|
565
563
|
The Free Software Foundation may publish revised and/or new versions of
|
566
|
-
the GNU General Public License from time to time. Such new versions
|
567
|
-
be similar in spirit to the present version, but may differ in detail to
|
564
|
+
the GNU Affero General Public License from time to time. Such new versions
|
565
|
+
will be similar in spirit to the present version, but may differ in detail to
|
568
566
|
address new problems or concerns.
|
569
567
|
|
570
568
|
Each version is given a distinguishing version number. If the
|
571
|
-
Program specifies that a certain numbered version of the GNU General
|
569
|
+
Program specifies that a certain numbered version of the GNU Affero General
|
572
570
|
Public License "or any later version" applies to it, you have the
|
573
571
|
option of following the terms and conditions either of that numbered
|
574
572
|
version or of any later version published by the Free Software
|
575
573
|
Foundation. If the Program does not specify a version number of the
|
576
|
-
GNU General Public License, you may choose any version ever published
|
574
|
+
GNU Affero General Public License, you may choose any version ever published
|
577
575
|
by the Free Software Foundation.
|
578
576
|
|
579
577
|
If the Program specifies that a proxy can decide which future
|
580
|
-
versions of the GNU General Public License can be used, that proxy's
|
578
|
+
versions of the GNU Affero General Public License can be used, that proxy's
|
581
579
|
public statement of acceptance of a version permanently authorizes you
|
582
580
|
to choose that version for the Program.
|
583
581
|
|
@@ -631,44 +629,33 @@ to attach them to the start of each source file to most effectively
|
|
631
629
|
state the exclusion of warranty; and each file should have at least
|
632
630
|
the "copyright" line and a pointer to where the full notice is found.
|
633
631
|
|
634
|
-
|
635
|
-
Copyright (C)
|
632
|
+
<one line to give the program's name and a brief idea of what it does.>
|
633
|
+
Copyright (C) <year> <name of author>
|
636
634
|
|
637
635
|
This program is free software: you can redistribute it and/or modify
|
638
|
-
it under the terms of the GNU General Public License as published
|
639
|
-
the Free Software Foundation, either version 3 of the License, or
|
636
|
+
it under the terms of the GNU Affero General Public License as published
|
637
|
+
by the Free Software Foundation, either version 3 of the License, or
|
640
638
|
(at your option) any later version.
|
641
639
|
|
642
640
|
This program is distributed in the hope that it will be useful,
|
643
641
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
644
642
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
645
|
-
GNU General Public License for more details.
|
643
|
+
GNU Affero General Public License for more details.
|
646
644
|
|
647
|
-
You should have received a copy of the GNU General Public License
|
648
|
-
along with this program. If not, see <
|
645
|
+
You should have received a copy of the GNU Affero General Public License
|
646
|
+
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
649
647
|
|
650
648
|
Also add information on how to contact you by electronic and paper mail.
|
651
649
|
|
652
|
-
If
|
653
|
-
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
|
660
|
-
The hypothetical commands `show w' and `show c' should show the appropriate
|
661
|
-
parts of the General Public License. Of course, your program's commands
|
662
|
-
might be different; for a GUI interface, you would use an "about box".
|
650
|
+
If your software can interact with users remotely through a computer
|
651
|
+
network, you should also make sure that it provides a way for users to
|
652
|
+
get its source. For example, if your program is a web application, its
|
653
|
+
interface could display a "Source" link that leads users to an archive
|
654
|
+
of the code. There are many ways you could offer source, and different
|
655
|
+
solutions will be better for different programs; see section 13 for the
|
656
|
+
specific requirements.
|
663
657
|
|
664
658
|
You should also get your employer (if you work as a programmer) or school,
|
665
659
|
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
666
|
-
For more information on this, and how to apply and follow the GNU
|
667
|
-
<
|
668
|
-
|
669
|
-
The GNU General Public License does not permit incorporating your program
|
670
|
-
into proprietary programs. If your program is a subroutine library, you
|
671
|
-
may consider it more useful to permit linking proprietary applications with
|
672
|
-
the library. If this is what you want to do, use the GNU Lesser General
|
673
|
-
Public License instead of this License. But first, please read
|
674
|
-
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
660
|
+
For more information on this, and how to apply and follow the GNU AGPL, see
|
661
|
+
<https://www.gnu.org/licenses/>.
|
@@ -0,0 +1,21 @@
|
|
1
|
+
var mumuki = mumuki || {};
|
2
|
+
|
3
|
+
(function (mumuki) {
|
4
|
+
|
5
|
+
var CustomEditor = {
|
6
|
+
sources: [],
|
7
|
+
|
8
|
+
addSource: function (source) {
|
9
|
+
CustomEditor.sources.push(source);
|
10
|
+
},
|
11
|
+
|
12
|
+
// Each external source must implement getContent method
|
13
|
+
|
14
|
+
getContent: function () {
|
15
|
+
return CustomEditor.sources.map( e => e.getContent() );
|
16
|
+
}
|
17
|
+
};
|
18
|
+
|
19
|
+
mumuki.CustomEditor = CustomEditor;
|
20
|
+
|
21
|
+
}(mumuki));
|
@@ -87,7 +87,7 @@ mumuki.load(() => {
|
|
87
87
|
}
|
88
88
|
|
89
89
|
get editors() {
|
90
|
-
return this.editorsContainer.find('.file-editor')
|
90
|
+
return this.editorsContainer.find('.file-editor');
|
91
91
|
}
|
92
92
|
|
93
93
|
get highlightModes() {
|
@@ -115,9 +115,10 @@ mumuki.load(() => {
|
|
115
115
|
}
|
116
116
|
|
117
117
|
_addFile() {
|
118
|
-
|
118
|
+
let name = prompt(this.locales.insert_file_name);
|
119
119
|
const alreadyExists = this.files.toArray().some(it => it.name === name);
|
120
|
-
if (!name
|
120
|
+
if (!name || !name.includes('.') || alreadyExists) return;
|
121
|
+
name = this._sanitize(name);
|
121
122
|
|
122
123
|
const id = `editor-file-${this._getFilesCount()}`;
|
123
124
|
this.tabsContainer.append(this._createTab(name, id));
|
@@ -198,6 +199,10 @@ mumuki.load(() => {
|
|
198
199
|
return language && language.highlight_mode || extension;
|
199
200
|
}
|
200
201
|
|
202
|
+
_sanitize(name) {
|
203
|
+
return name.replace(/[^0-9A-Z\.-]/ig, "_");
|
204
|
+
}
|
205
|
+
|
201
206
|
_setVisibility(element, isVisible) {
|
202
207
|
if (isVisible) element.show(); else element.hide();
|
203
208
|
}
|
@@ -209,7 +214,7 @@ mumuki.load(() => {
|
|
209
214
|
|
210
215
|
|
211
216
|
const setUpTabsBehavior = () => {
|
212
|
-
const tabsContainer = $('.nav-tabs');
|
217
|
+
const tabsContainer = $('.nav-tabs').last();
|
213
218
|
if (!tabsContainer.length) return;
|
214
219
|
const editorsContainer = $('.tab-content');
|
215
220
|
|
@@ -103,10 +103,14 @@ var mumuki = mumuki || {};
|
|
103
103
|
submitButton.checkAttemptsLeft();
|
104
104
|
});
|
105
105
|
|
106
|
+
function getEditorsContent() {
|
107
|
+
return $('.new_solution').serializeArray().concat(mumuki.CustomEditor.getContent())
|
108
|
+
}
|
109
|
+
|
106
110
|
function getContent(){
|
107
111
|
var content = {};
|
108
112
|
|
109
|
-
|
113
|
+
getEditorsContent().forEach(function(it) {
|
110
114
|
content[it.name] = it.value;
|
111
115
|
});
|
112
116
|
|
@@ -75,7 +75,7 @@ module ExerciseInputHelper
|
|
75
75
|
|
76
76
|
def render_custom_editor(exercise, read_only=false)
|
77
77
|
custom_editor_tag = "mu-#{exercise.language}-custom-editor"
|
78
|
-
"<#{custom_editor_tag} #{custom_editor_read_only if read_only}> </#{custom_editor_tag}>".html_safe
|
78
|
+
"<#{custom_editor_tag} class='#{custom_editor_tag}' #{custom_editor_read_only if read_only}> </#{custom_editor_tag}>".html_safe
|
79
79
|
end
|
80
80
|
|
81
81
|
def custom_editor_read_only
|
@@ -8,7 +8,7 @@ module MultipleFileEditorHelper
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def multifile_hidden_inputs
|
11
|
-
hidden_field_tag('highlight-modes', highlight_modes.to_json)
|
11
|
+
hidden_field_tag('highlight-modes', highlight_modes.to_json) +
|
12
12
|
hidden_field_tag('multifile-locales', multifile_locales.to_json)
|
13
13
|
end
|
14
14
|
end
|
@@ -1,6 +1,7 @@
|
|
1
1
|
<%= render_runner_assets @exercise.language, :editor %>
|
2
2
|
|
3
3
|
<%= render_custom_editor(@exercise) %>
|
4
|
+
|
4
5
|
<%= form.hidden_field :content, id: "mu-custom-editor-value", value: @current_content %>
|
5
6
|
<%= form.hidden_field :content_extra, id: "mu-custom-editor-extra", value: @exercise.extra %>
|
6
7
|
<%= form.hidden_field :content, id: "mu-custom-editor-test", value: @exercise.test %>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mumuki-laboratory
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.
|
4
|
+
version: 6.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Franco Bulgarelli
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-01-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 6.4.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 6.4.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: mumukit-login
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -156,6 +156,7 @@ files:
|
|
156
156
|
- app/assets/javascripts/application/confirmation.js
|
157
157
|
- app/assets/javascripts/application/console.js
|
158
158
|
- app/assets/javascripts/application/csrf-token.js
|
159
|
+
- app/assets/javascripts/application/custom-editor.js
|
159
160
|
- app/assets/javascripts/application/discussions.js
|
160
161
|
- app/assets/javascripts/application/free-form.js
|
161
162
|
- app/assets/javascripts/application/inputs.js
|
@@ -539,7 +540,7 @@ files:
|
|
539
540
|
- vendor/assets/stylesheets/codemirror/show-hint.min.css
|
540
541
|
homepage: https://mumuki.io
|
541
542
|
licenses:
|
542
|
-
-
|
543
|
+
- AGPL-3.0
|
543
544
|
metadata: {}
|
544
545
|
post_install_message:
|
545
546
|
rdoc_options: []
|
@@ -556,7 +557,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
556
557
|
- !ruby/object:Gem::Version
|
557
558
|
version: '0'
|
558
559
|
requirements: []
|
559
|
-
rubygems_version: 3.0.
|
560
|
+
rubygems_version: 3.0.2
|
560
561
|
signing_key:
|
561
562
|
specification_version: 4
|
562
563
|
summary: Code assement web application for the Mumuki Platform.
|